{"_id":"@baguette-studios/kernl-react","_rev":"4-49212eb561427b1394e89e95ac2c2e44","name":"@baguette-studios/kernl-react","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@baguette-studios/kernl-react","version":"0.1.0","license":"ISC","_id":"@baguette-studios/kernl-react@0.1.0","maintainers":[{"name":"baguette-studios","email":"astier.jules@gmail.com"}],"homepage":"https://github.com/Jules-Astier/agent-context#readme","bugs":{"url":"https://github.com/Jules-Astier/agent-context/issues"},"dist":{"shasum":"2daff345b8fc41f3a3f9e34fa710ff0e04094f80","tarball":"https://registry.npmjs.org/@baguette-studios/kernl-react/-/kernl-react-0.1.0.tgz","fileCount":6,"integrity":"sha512-ZxaPETRB+pnmUC3zvWjL8XgGwBGi5piQqdHFhorErCiEQEau3gs1/0rupvxBT/isvl1aMnoMrYTISAwszXMyoA==","signatures":[{"sig":"MEYCIQC+b4yu1UALP4DIMNCMzmPzOHdixRqslueN1m0wuYHwcgIhALMtdqOHY0j48jnEoCp1DvNOSfz0pWIbzhWCwXLu6L9c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89508},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8a1785f4716e17064cce879e285c95ef7b10d371","private":false,"scripts":{"test":"vitest run --root ../.. packages/react","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"baguette-studios","email":"astier.jules@gmail.com"},"repository":{"url":"git+https://github.com/Jules-Astier/agent-context.git","type":"git","directory":"packages/react"},"_npmVersion":"10.9.3","description":"React 18 and 19 bindings for the Kernl embedded-agent runtime.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","dependencies":{"@baguette-studios/kernl-core":"0.1.0","@baguette-studios/kernl-client":"0.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.9","typescript":"^5.8.3","@types/react":"^18.3.23"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/kernl-react_0.1.0_1784066867067_0.33831006131109365","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@baguette-studios/kernl-react","version":"0.1.1","license":"ISC","_id":"@baguette-studios/kernl-react@0.1.1","maintainers":[{"name":"baguette-studios","email":"astier.jules@gmail.com"}],"homepage":"https://github.com/Jules-Astier/agent-context#readme","bugs":{"url":"https://github.com/Jules-Astier/agent-context/issues"},"dist":{"shasum":"c4f8c67008e8a6f1b2c22f2130135b052b1c9c14","tarball":"https://registry.npmjs.org/@baguette-studios/kernl-react/-/kernl-react-0.1.1.tgz","fileCount":6,"integrity":"sha512-uwZ4FVQ/UXZM+7RBYE2gmz5i8YC0uVz9KkUkwv0ds7ZsdaQVTjdBavo9ldfY1D6AIHSJnEwgcDdHKLcgq6hUcA==","signatures":[{"sig":"MEYCIQDuiDK5HpdeNsj+3Xbqdpo+EqFiF6WhRSdqy2jhL9HM/AIhAIw3HIsiwVKSsCapGlcBTO3BQwVsVTvCRA+cYko0QKrm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89544},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"8a1785f4716e17064cce879e285c95ef7b10d371","private":false,"scripts":{"test":"vitest run --root ../.. packages/react","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"baguette-studios","email":"astier.jules@gmail.com"},"repository":{"url":"git+https://github.com/Jules-Astier/agent-context.git","type":"git","directory":"packages/react"},"_npmVersion":"10.9.3","description":"React 18 and 19 bindings for the Kernl embedded-agent runtime.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","dependencies":{"@baguette-studios/kernl-core":"0.1.1","@baguette-studios/kernl-client":"0.1.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.9","typescript":"^5.8.3","@types/react":"^18.3.23"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/kernl-react_0.1.1_1784104272311_0.6266381112160548","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@baguette-studios/kernl-react","version":"0.1.2","license":"ISC","_id":"@baguette-studios/kernl-react@0.1.2","maintainers":[{"name":"baguette-studios","email":"astier.jules@gmail.com"}],"homepage":"https://github.com/Jules-Astier/agent-context#readme","bugs":{"url":"https://github.com/Jules-Astier/agent-context/issues"},"dist":{"shasum":"b03c5bbe6287dac9db053e62479ffc671f233993","tarball":"https://registry.npmjs.org/@baguette-studios/kernl-react/-/kernl-react-0.1.2.tgz","fileCount":6,"integrity":"sha512-wjPGRz9u5ksgXo0ZTUuAsIVtFWIxVdxICuCwn5+uc6fOSYwvsufdvdKjB3Tj1tkZhmlimxqhYVmy2ruXp3v3DA==","signatures":[{"sig":"MEUCIQCVZ7qBgjrDJEvbSVT9LEMZBkX5LNWs9kEFJ3GfOUdrqQIgV5lZZZzjgV/fE/89sh8PaYc/zIIm9GJSqEMWqBpzvLc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":89848},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"8a1785f4716e17064cce879e285c95ef7b10d371","private":false,"scripts":{"test":"vitest run --root ../.. packages/react","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"baguette-studios","email":"astier.jules@gmail.com"},"repository":{"url":"git+https://github.com/Jules-Astier/agent-context.git","type":"git","directory":"packages/react"},"_npmVersion":"10.9.8","description":"React 18 and 19 bindings for the Kernl embedded-agent runtime.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"@baguette-studios/kernl-core":"0.1.2","@baguette-studios/kernl-client":"0.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.9","typescript":"^5.8.3","@types/react":"^18.3.23"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/kernl-react_0.1.2_1784114036808_0.27001552666955275","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@baguette-studios/kernl-react","version":"0.2.0","type":"module","private":false,"description":"React 18 and 19 bindings for the Kernl embedded-agent runtime.","license":"ISC","repository":{"type":"git","url":"git+https://github.com/Jules-Astier/agent-context.git","directory":"packages/react"},"homepage":"https://github.com/Jules-Astier/agent-context#readme","bugs":{"url":"https://github.com/Jules-Astier/agent-context/issues"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run --root ../.. packages/react"},"dependencies":{"@baguette-studios/kernl-core":"0.2.0","@baguette-studios/kernl-client":"0.2.0"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0"},"devDependencies":{"@types/react":"^18.3.23","typescript":"^5.8.3","vitest":"^4.1.9"},"_id":"@baguette-studios/kernl-react@0.2.0","gitHead":"d8fc5415769275ee958ad9ede38126edaba34a91","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-n+cNwwWXg/pa4TCKbF+2g0byyxsF+8gD1drmlwHBDBantmY9ImXZt8K0HjzMnIX8lC6KPOIpa8y/qd5rPlCGgw==","shasum":"f1d3b971f744eb7152717a9dd8549c06a6d28788","tarball":"https://registry.npmjs.org/@baguette-studios/kernl-react/-/kernl-react-0.2.0.tgz","fileCount":6,"unpackedSize":97314,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGsXOyJVROICljI4ZvhisAxc3y+iHiRMhRWcNKeH8UiUAiEAsRrv2+5a3LrTCUiXU8vX8KoGJlqp+3zQsDYalaUb0Pg="}]},"_npmUser":{"name":"baguette-studios","email":"astier.jules@gmail.com"},"directories":{},"maintainers":[{"name":"baguette-studios","email":"astier.jules@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kernl-react_0.2.0_1784736189487_0.9197669303901357"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-14T22:07:46.898Z","modified":"2026-07-22T16:03:09.768Z","0.1.0":"2026-07-14T22:07:47.258Z","0.1.1":"2026-07-15T08:31:12.438Z","0.1.2":"2026-07-15T11:13:56.992Z","0.2.0":"2026-07-22T16:03:09.613Z"},"bugs":{"url":"https://github.com/Jules-Astier/agent-context/issues"},"license":"ISC","homepage":"https://github.com/Jules-Astier/agent-context#readme","repository":{"type":"git","url":"git+https://github.com/Jules-Astier/agent-context.git","directory":"packages/react"},"description":"React 18 and 19 bindings for the Kernl embedded-agent runtime.","maintainers":[{"name":"baguette-studios","email":"astier.jules@gmail.com"}],"readme":"# @baguette-studios/kernl-react\n\nReact 18 and 19 bindings for embedding Kernl agents in an existing application.\n\n```bash\nnpm install @baguette-studios/kernl-react @baguette-studios/kernl-ui\n```\n\n```tsx\nimport { AgentProvider } from \"@baguette-studios/kernl-react\";\nimport { AgentBubbleLauncher } from \"@baguette-studios/kernl-ui\";\nimport \"@baguette-studios/kernl-ui/styles.css\";\n\nexport function App() {\n  return (\n    <AgentProvider\n      client={{\n        projectId: \"your-project\",\n        clientKey: \"kernlpk_...\",\n        url: \"https://your-kernl-endpoint.example\",\n        auth: {\n          getSessionToken: async ({ sessionId, forceRefresh, signal }) => {\n            const response = await fetch(\"/api/kernl/session-token\", {\n              method: \"POST\",\n              credentials: \"include\",\n              headers: { \"content-type\": \"application/json\" },\n              body: JSON.stringify({ sessionId, forceRefresh }),\n              signal\n            });\n            if (!response.ok) throw new Error(\"Unable to create Kernl session token\");\n            return (await response.json()).token;\n          }\n        }\n      }}\n      user={{ id: \"current-user-id\" }}\n      session={{ id: \"current-session-id\" }}\n      ui={{ launcherDraggable: true }}\n    >\n      <YourApplication />\n      <AgentBubbleLauncher />\n    </AgentProvider>\n  );\n}\n```\n\nRegister context, tools, prompts, instructions, and navigation near the UI that owns those capabilities. Application tools continue to use the application's authenticated APIs and backend authorization.\n\nFor production, `client.auth.getSessionToken` should call your backend using the signed-in user's normal app session. The backend authenticates and authorizes that user, then signs a short-lived, session-bound JWT; signing keys must never be shipped to the browser. The underlying client caches the token in memory per session, refreshes from its JWT `exp`, deduplicates concurrent requests, and retries once with `forceRefresh: true` after a `401`. Its bearer token covers message and browser tool-result appends plus event replay and transcript reads, and token values are redacted from client-visible failures.\n\nWith a configured client, `AgentProvider` restores the server-visible transcript\nby default when neither initial messages nor `sessionPersistence` is supplied.\nUse `client={{ ..., restoreTranscript: false }}` only when the host deliberately\nwants a fresh UI. Kernl server persistence remains the default source of truth.\n\nThe Kernl server verifies the JWT and is authoritative for hosted identity, tenant, budget, and restriction claims. Browser `user` data and metadata are not authorization inputs. Tools continue to call the app's normal APIs, and the app backend remains the final authority for permissions and side effects.\n\nStatic `client.session.token` remains supported for compatibility, but the token-provider form is recommended for production rotation. See the [client authentication documentation](https://github.com/Jules-Astier/agent-context/blob/main/packages/client/README.md#production-authentication) for cache clearing and refresh details.\n\nSet `ui.launcherDraggable` to `true` to let users drag the collapsed launcher around the viewport. When released, it snaps to the closest edge. The option defaults to `false`.\n\nSee the [repository quickstart](https://github.com/Jules-Astier/agent-context#quickstart) for a complete example.\n","readmeFilename":"README.md"}