{"_id":"@muse-code/sdk","_rev":"4-ceff8c4fe92469c064798e9bb7a8256e","name":"@muse-code/sdk","dist-tags":{"latest":"1.4.2"},"versions":{"0.1.0":{"name":"@muse-code/sdk","version":"0.1.0","license":"MIT","_id":"@muse-code/sdk@0.1.0","maintainers":[{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"}],"homepage":"https://github.com/meta-models/muse-code-sdk","bugs":{"url":"https://github.com/meta-models/muse-code-sdk/issues"},"dist":{"shasum":"4913415e0189e03229624c130e5bec6f3a65c823","tarball":"https://registry.npmjs.org/@muse-code/sdk/-/sdk-0.1.0.tgz","fileCount":37,"integrity":"sha512-waUyZMufiAPd3PhEyH70vRrna6EHT2F2Giq4rY8eCP1WkIQcTy3/KnnNEcWEM5il+xtdgz/r7pDD6zJpn72ATQ==","signatures":[{"sig":"MEUCIEa0Pm2ZN5qGSxYGKKCs6Bxcy1x20cpaNAQezlFXOMvAAiEAikXs2z6BP6VQiej00c30On2YdsAoXI7Pqo3au9Dsm7I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":337949},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=20"},"scripts":{"test":"npm run build && node --test --test-timeout=300000 \"dist/test/**/*.test.js\"","build":"tsc --build","check":"tsc --build","qa:sdk":"npm run build && node dist/qa/bin.js","prepack":"npm run build"},"_npmUser":{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"},"repository":{"url":"git+https://github.com/meta-models/muse-code-sdk.git","type":"git","directory":"clients/sdk-ts"},"_npmVersion":"11.12.1","description":"TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.","directories":{},"_nodeVersion":"26.0.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"26.2.0","@muse-code/msp":"*"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1788159142797_0.6287197647684808","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@muse-code/sdk","version":"0.1.1","license":"MIT","_id":"@muse-code/sdk@0.1.1","maintainers":[{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"}],"homepage":"https://github.com/meta-models/muse-code-sdk","bugs":{"url":"https://github.com/meta-models/muse-code-sdk/issues"},"dist":{"shasum":"6f0f714a7aed85962655682460d46bedcaf4956b","tarball":"https://registry.npmjs.org/@muse-code/sdk/-/sdk-0.1.1.tgz","fileCount":38,"integrity":"sha512-kis3zolvwlExDeX9F1f3KVSSdCWTgF2TdbGcMJIb0HGkQNrX+qTmel6U9sC9ylHtFizxqOZ/yxGv1cvbcRywiQ==","signatures":[{"sig":"MEQCIA83ttQT2Q0+YBEBClOg5rd0Y2zsBx8YDBzmY68hHyq9AiAlMdg4Bpp8u8FMS7OjkvETot80/2mPwU9oOu1d6P4SAA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":442234},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=20"},"scripts":{"test":"npm run build && node --test --test-timeout=300000 \"dist/test/**/*.test.js\"","build":"tsc --build","check":"tsc --build","qa:sdk":"npm run build && node dist/qa/bin.js","prepack":"npm run build && node scripts/bundle-msp-types.mjs"},"_npmUser":{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"},"repository":{"url":"git+https://github.com/meta-models/muse-code-sdk.git","type":"git","directory":"clients/sdk-ts"},"_npmVersion":"11.12.1","description":"TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.","directories":{},"_nodeVersion":"26.0.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"26.2.0","@muse-code/msp":"*"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1788187267654_0.7500368907698842","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@muse-code/sdk","version":"1.3.0","license":"MIT","_id":"@muse-code/sdk@1.3.0","maintainers":[{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"}],"homepage":"https://github.com/meta-models/muse-code-sdk","bugs":{"url":"https://github.com/meta-models/muse-code-sdk/issues"},"dist":{"shasum":"e981156fb52df1b15fe33559911f155af9b2acd1","tarball":"https://registry.npmjs.org/@muse-code/sdk/-/sdk-1.3.0.tgz","fileCount":38,"integrity":"sha512-hl1gws0KhYa8FX7dQRsam3HwzcB/wD8NNrCzoQo9Yr2ilGBB8Mlr0DBVXFZJHFKFe7HkgeppKyYetJoCpuMdag==","signatures":[{"sig":"MEUCIQCACqwmhlwGVt9ohYBmo9xVQtNt6IsMA+Rfb0EujyPOywIgRqMPqalwcL4Cy0OBCN8q5GJdZwWNTYSYe/h0xtwWNG4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIGLacZq9TE8dsVcZZNhJ0Bq0M8ae9GcsNDmR44FUAr8hAiBxXvcvKKaPz0g+e/6HeZQp2WIy3uraDstHFBJG9YuEpw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@muse-code%2fsdk@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":470849},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=20"},"gitHead":"4dc252c1a31b02ff676dce0358d297ffbc5d8784","scripts":{"test":"npm run build && node --test --test-timeout=300000 \"dist/test/**/*.test.js\"","build":"tsc --build","check":"tsc --build","qa:sdk":"npm run build && node dist/qa/bin.js","prepack":"npm run build && node scripts/bundle-msp-types.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:220da468-216f-4529-ad6e-b8cf4fd70849"}},"repository":{"url":"git+https://github.com/meta-models/muse-code-sdk.git","type":"git","directory":"clients/sdk-ts"},"_npmVersion":"12.0.2","description":"TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.","directories":{},"_nodeVersion":"22.23.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"26.2.0","@muse-code/msp":"*"},"peerDependencies":{"@types/node":">=20"},"peerDependenciesMeta":{"@types/node":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.3.0_1789695508707_0.4199544373756168","host":"s3://npm-registry-packages-npm-production"}},"1.4.2":{"_id":"@muse-code/sdk@1.4.2","bugs":{"url":"https://github.com/meta-models/muse-code-sdk/issues"},"dist":{"shasum":"c98908212fb8a13bbfa9f6740ba0bd50f17fe2c3","tarball":"https://registry.npmjs.org/@muse-code/sdk/-/sdk-1.4.2.tgz","fileCount":38,"integrity":"sha512-2gl6EMq0pOoqokQxlfaKciyrkhvfd17UwtRui9rEUULmJZ4wwr3h/eW1HO88iGbU7X8QvTjwPa1WXcOl/HN/mA==","signatures":[{"sig":"MEYCIQCWZsdMY4qHGdSc89WCSHA8ECI1lVbu5vx+FnknxHhP2wIhAJSXyWDet3u2dRcMZY/NwrCpeVMvBfafsOrSwP/9Z3uD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEysayg1qD3PGVxuevrBFdsXspvE/JdQok8VnhpWxwP4AiBtYygZF5bKHlnde1uXj2sSWU7TucQP2E8gCoUXKFT9hQ=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@muse-code%2fsdk@1.4.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":488127},"main":"dist/src/index.js","name":"@muse-code/sdk","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=20"},"gitHead":"cd4134968074ec9aa6c55e0a4c9daf0b5bea2ee1","license":"MIT","scripts":{"test":"npm run build && node --test --test-timeout=300000 \"dist/test/**/*.test.js\"","build":"tsc --build","check":"tsc --build","qa:sdk":"npm run build && node dist/qa/bin.js","prepack":"npm run build && node scripts/bundle-msp-types.mjs"},"version":"1.4.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"220da468-216f-4529-ad6e-b8cf4fd70849"}},"homepage":"https://github.com/meta-models/muse-code-sdk","repository":{"url":"git+https://github.com/meta-models/muse-code-sdk.git","type":"git","directory":"clients/sdk-ts"},"_npmVersion":"12.2.0","description":"TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.","directories":{},"maintainers":[{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"}],"_nodeVersion":"22.23.2","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"26.2.0","@muse-code/msp":"*"},"peerDependencies":{"@types/node":">=20"},"peerDependenciesMeta":{"@types/node":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.4.2_1790803951337_0.014959763828441774"}}},"time":{"created":"2026-08-31T06:52:22.598Z","modified":"2026-09-30T21:32:32.011Z","0.1.0":"2026-08-31T06:52:22.936Z","0.1.1":"2026-08-31T14:41:07.868Z","1.3.0":"2026-09-18T01:38:28.796Z","1.4.2":"2026-09-30T21:32:31.439Z"},"bugs":{"url":"https://github.com/meta-models/muse-code-sdk/issues"},"license":"MIT","homepage":"https://github.com/meta-models/muse-code-sdk","repository":{"url":"git+https://github.com/meta-models/muse-code-sdk.git","type":"git","directory":"clients/sdk-ts"},"description":"TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.","maintainers":[{"name":"mjdouglas_meta","email":"mjdouglas@meta.com"}],"readme":"# `@muse-code/sdk`\n\nThe TypeScript SDK for Muse Code: a typed Node client for driving a Muse Code\nagent over the Muse Session Protocol (MSP).\n\n- Spawn a `muse serve` host, open and resume sessions, and send turns.\n- Stream a turn's items and text deltas as async iterators; await the turn's\n  server-authored outcome.\n- Answer tool-approval requests with a handler you register — or register\n  none and run under the server's own default-deny.\n- A client-side fold keeps a live, typed view of the session — items, session\n  state, pending commands — with gap recovery after dropped deliveries and\n  safe same-command retry that can never double-submit.\n\n**Zero runtime dependencies**: pure TypeScript over the Node standard\nlibrary. The MSP wire declarations are bundled into the package, so nothing\nelse is needed to typecheck against it.\n\n## Install\n\n```sh\nnpm install @muse-code/sdk\nnpm install -D @types/node   # required for TypeScript consumers\n```\n\nNode 20 or newer. `@types/node` is declared as an **optional peer\ndependency**: a JavaScript consumer needs nothing, while a TypeScript\nconsumer installs it explicitly — without it the declarations that name\n`ChildProcess`, `Readable` and friends do not resolve.\n\nYou also need the Muse Code CLI: a `muse` binary on `PATH`, or an explicit\npath passed at spawn time.\n\n**This package versions in lockstep with Muse Code**: the SDK version is the\nMuse Code release it ships with — `@muse-code/sdk X.Y.Z` pairs with Muse Code\n`X.Y.Z`. The stable MSP surface follows the product's compatibility posture:\nevolution is additive, and a breaking change follows a documented deprecation\nand changelog path. Surfaces marked experimental (`x-msp-openness`)\nmay change or be removed with a changelog entry and no deprecation window. Pin an\nexact version, and read the changelog before moving off it.\n\n## Use\n\n```ts\nimport { MuseClient } from \"@muse-code/sdk\";\n\nconst client = await MuseClient.spawn({\n  museBin: \"muse\",\n  args: [\"serve\"],\n  clientInfo: { name: \"my-app\", version: \"1.0.0\" },\n});\n\nconst session = await client.startSession({ workspaceRoot: process.cwd() });\n\nconst turn = await session.sendUserTurn({\n  input: [{ type: \"text\", text: \"Summarize this repository.\" }],\n});\nfor await (const item of turn.items()) console.log(item);\nawait turn.completed;\n\nawait client.close();\n```\n\n`turn.items()` replays what the session already holds before its live tail;\n`turn.deltas()` is live-only. `turn.completed` settles on every exit, so an\nawaited turn can never hang on a session that ended without an answer.\n\nTo approve tool use programmatically, register a handler on the session;\napproval choices are server-minted, and a decision the request never offered\nis refused and reported rather than sent:\n\n```ts\nsession.onApproval(async (request) => ({\n  choiceId: request.availableChoices[0].choiceId,\n}));\n```\n\nStatus: developer preview. The facade — spawn, session open/resume, turns,\napprovals, and recovery after dropped deliveries — is complete and covered by\nthe conformance suites in the source repository.\n\n## Documentation\n\n- Guides, cookbook recipes, and the protocol reference:\n  <https://meta-models.github.io/muse-code-sdk/>\n- TypeScript API reference:\n  <https://meta-models.github.io/muse-code-sdk/next/generated/sdk/>\n- Source and issues: <https://github.com/meta-models/muse-code-sdk>\n","readmeFilename":"README.md"}