{"_id":"@airalogy/masterbrain-client","name":"@airalogy/masterbrain-client","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@airalogy/masterbrain-client","version":"0.1.0","description":"Framework-neutral client and workspace change contract for Masterbrain","repository":{"type":"git","url":"git+https://github.com/airalogy/masterbrain.git","directory":"packages/client"},"homepage":"https://github.com/airalogy/masterbrain#readme","bugs":{"url":"https://github.com/airalogy/masterbrain/issues"},"type":"module","license":"Apache-2.0","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./schema/code-edit.v1.json":"./schema/code-edit.v1.schema.json"},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json","type-check":"tsc -p tsconfig.json --noEmit","test":"vitest run"},"devDependencies":{"@types/node":"^24.0.0","typescript":"~5.9.3","vitest":"^3.2.4"},"publishConfig":{"access":"public"},"_id":"@airalogy/masterbrain-client@0.1.0","gitHead":"d0e7a47977f640639a4c065d3cbc3436f0cca5ae","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Rzhud4eLUB+AMw8NlUn9h/um5ZRG1NDUT8SnxI6NFPWL7yQghhl0CIauUKDQCxrGaG4m1zUAOd6rrJcToXk74Q==","shasum":"bc426ee15ca0194e645a2c3c40ffa87c0689b49f","tarball":"https://registry.npmjs.org/@airalogy/masterbrain-client/-/masterbrain-client-0.1.0.tgz","fileCount":31,"unpackedSize":49026,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGOPD1kXnIib+RqC1imaS/mEsOwucFR1pv4GgdUtZfbFAiAv7kvOHNj9sJg+4MjJv3NKOasfpvrazOqcBu3CWWHRQw=="}]},"_npmUser":{"name":"yangzijie","email":"yangzijie2026@gmail.com"},"directories":{},"maintainers":[{"name":"yangzijie","email":"yangzijie2026@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/masterbrain-client_0.1.0_1786616759925_0.9757594651849928"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-13T10:25:59.570Z","0.1.0":"2026-08-13T10:26:00.058Z","modified":"2026-08-13T10:26:00.384Z"},"maintainers":[{"name":"yangzijie","email":"yangzijie2026@gmail.com"}],"description":"Framework-neutral client and workspace change contract for Masterbrain","homepage":"https://github.com/airalogy/masterbrain#readme","repository":{"type":"git","url":"git+https://github.com/airalogy/masterbrain.git","directory":"packages/client"},"bugs":{"url":"https://github.com/airalogy/masterbrain/issues"},"license":"Apache-2.0","readme":"# @airalogy/masterbrain-client\n\nFramework-neutral types, HTTP transport, and conflict-safe workspace change helpers for Masterbrain.\n\nThe browser client never stores model-provider credentials. Use a same-origin Platform proxy in hosted products, or point the fetch transport at a locally trusted Masterbrain service.\n\nThe Python Pydantic models remain the source of truth for the public request/response schema. The generated fixture is exported as `@airalogy/masterbrain-client/schema/code-edit.v1.json`; CI rejects drift between that fixture and the backend models.\n\n```ts\nimport {\n  MasterbrainClient,\n  createFetchTransport,\n  handleCodeEditResponse,\n} from '@airalogy/masterbrain-client';\n\nconst client = new MasterbrainClient(createFetchTransport({\n  // Hosted products should inject their own same-origin authentication here.\n  headers: () => ({ Authorization: `Bearer ${sessionToken}` }),\n}));\n\nconst response = await client.runCodeEdit({\n  model: { name: 'qwen3.5-flash', enable_thinking: false },\n  prompt: 'Add an optional operator_notes field.',\n  files: await workspace.listFiles(),\n});\n\nconst application = await handleCodeEditResponse(response, workspace);\n// application.status is answer, applied, review, or blocked.\n```\n\nThe host-provided `WorkspaceAdapter` receives one mutation batch for each apply or undo. It should persist that batch transactionally where the storage layer supports transactions.\n","readmeFilename":"README.md","_rev":"1-fad32dd1613d2fb01daf352e0647a325"}