{"_id":"@darrenloasby/clawdbridge","name":"@darrenloasby/clawdbridge","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@darrenloasby/clawdbridge","version":"0.1.1","description":"🦀ClawdBridge bridge helpers for OpenAI-compatible Claude routing with brokered session state.","license":"MIT","author":{"name":"Darren Loasby"},"repository":{"type":"git","url":"git+https://github.com/darrenloasby/opencode-chatbridge.git"},"keywords":["opencode","openai-compatible","claude","bridge","tool-calls","sessions"],"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./hooks":{"types":"./dist/hooks.d.ts","default":"./dist/hooks.js"},"./state":{"types":"./dist/state.d.ts","default":"./dist/state.js"},"./oa-compat":{"types":"./dist/oa-compat.d.ts","default":"./dist/oa-compat.js"},"./media":{"types":"./dist/media.d.ts","default":"./dist/media.js"},"./openai-compatible":{"types":"./dist/openai-compatible.d.ts","default":"./dist/openai-compatible.js"},"./r2":{"types":"./dist/r2.d.ts","default":"./dist/r2.js"},"./provider-helper":{"types":"./dist/provider-helper.d.ts","default":"./dist/provider-helper.js"}},"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","typecheck":"tsc -p tsconfig.json --noEmit"},"devDependencies":{"@types/node":"^24.3.0","typescript":"^5.8.3"},"dependencies":{"@ai-sdk/openai-compatible":"^1.0.0","@aws-sdk/client-s3":"^3.887.0","@aws-sdk/s3-request-presigner":"^3.887.0"},"publishConfig":{"access":"public"},"_id":"@darrenloasby/clawdbridge@0.1.1","bugs":{"url":"https://github.com/darrenloasby/opencode-chatbridge/issues"},"homepage":"https://github.com/darrenloasby/opencode-chatbridge#readme","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-SQPilfec2vghx7624QcmuFgeMu4/IirdQHZoEkII52UE7rbWWJH4gZKzj3cxZhdYd+ImusBMBcK7JL82EPaIOQ==","shasum":"48d7a3d130a07f62e77cef0dccd72c31094f1d88","tarball":"https://registry.npmjs.org/@darrenloasby/clawdbridge/-/clawdbridge-0.1.1.tgz","fileCount":34,"unpackedSize":93049,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDmwO1C2UqEODb7KQpcwuIXAtP4KoqxhRv0kkKFv1OKKgIhAOM5SruMJZjVF52QmGRAi4xL2VTEWyq7vlOoMyNBvZS2"}]},"_npmUser":{"name":"darrenloasby","email":"darren.loasby@gmail.com"},"directories":{},"maintainers":[{"name":"darrenloasby","email":"darren.loasby@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clawdbridge_0.1.1_1776476095273_0.16623816425725724"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T01:34:55.166Z","0.1.1":"2026-04-18T01:34:55.421Z","modified":"2026-04-18T01:34:55.631Z"},"maintainers":[{"name":"darrenloasby","email":"darren.loasby@gmail.com"}],"description":"🦀ClawdBridge bridge helpers for OpenAI-compatible Claude routing with brokered session state.","homepage":"https://github.com/darrenloasby/opencode-chatbridge#readme","keywords":["opencode","openai-compatible","claude","bridge","tool-calls","sessions"],"repository":{"type":"git","url":"git+https://github.com/darrenloasby/opencode-chatbridge.git"},"author":{"name":"Darren Loasby"},"bugs":{"url":"https://github.com/darrenloasby/opencode-chatbridge/issues"},"license":"MIT","readme":"# ClawdBridge\n\nPrivate OpenCode bridge helpers for an OpenAI-compatible Claude endpoint.\n\nThis package is intentionally tiny:\n\n- wraps an OpenAI-compatible transport\n- carries `project_id` / `session_id` between calls\n - persists bridge context in a local JSON state file\n - keys state per `baseURL` and optional `workspaceId`\n- preserves OpenAI-style `tool_calls` handoff\n- exposes an OpenCode-style `modifyUrl` / `modifyHeaders` / `modifyBody` helper\n\n## Install\n\n```bash\nnpm install @darrenloasby/clawdbridge\n```\n\n## Use\n\n```ts\nimport createChatBridgeProvider from \"@darrenloasby/clawdbridge\";\n\nconst provider = createChatBridgeProvider({\n  baseURL: \"http://127.0.0.1:8888/v1\",\n  apiKey: process.env.OPENAI_API_KEY,\n  workspaceId: \"my-project\",\n});\n\nconst body = provider.request({\n  model: \"claude-chat-haiku\",\n  messages: [{ role: \"user\", content: \"hello\" }],\n});\n```\n\n## OpenCode-style helper\n\n```ts\nimport { createOaCompatBridgeHelper } from \"@darrenloasby/clawdbridge\";\n\nconst helper = createOaCompatBridgeHelper({\n  baseURL: \"http://127.0.0.1:8888/v1\",\n});\n\nhelper.modifyUrl(\"http://127.0.0.1:8888/v1\");\nhelper.modifyBody({\n  model: \"claude-chat-haiku\",\n  messages: [{ role: \"user\", content: \"hello\" }],\n});\n```\n\n## UI status\n\nIf the host app wants to show the current binding, use:\n\n```ts\nimport { describeBridgeState } from \"@darrenloasby/clawdbridge\";\n\nconst status = describeBridgeState(\n  \"http://127.0.0.1:8888/v1\",\n  { projectId: \"proj-123\", sessionId: \"sess-456\" },\n  \"my-project\",\n);\n```\n\nThat returns a small label like:\n\n```text\nworkspace my-project · project proj-123 · session sess-456\n```\n\n## What it stores\n\nThe default state file is:\n\n```text\n~/.local/share/opencode-chatbridge/state.json\n```\n\nIt stores one entry per `baseURL`.\n\n## Notes\n\n- `tool_calls` are preserved as OpenAI-compatible function calls.\n- `project_id` and `session_id` are added when available.\n- This package is a bridge helper, not a full model provider by itself.\n","readmeFilename":"README.md","_rev":"1-434b9b2c34ed45bf62e05008f8ee9bbf"}