{"_id":"@shadcn/helpers","_rev":"2-b5f9efd381abf111a7dd3d65963e77e5","name":"@shadcn/helpers","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@shadcn/helpers","version":"0.1.0","keywords":["ai","chat","helpers","development","ai-sdk","tanstack","shadcn"],"author":{"url":"https://twitter.com/shadcn","name":"shadcn"},"license":"MIT","_id":"@shadcn/helpers@0.1.0","maintainers":[{"name":"shadcn","email":"m@shadcn.com"}],"homepage":"https://ui.shadcn.com","bugs":{"url":"https://github.com/shadcn-ui/ui/issues"},"dist":{"shasum":"26e6bc0064b53252f32f1e44c1ed4077ca33f2c9","tarball":"https://registry.npmjs.org/@shadcn/helpers/-/helpers-0.1.0.tgz","fileCount":9,"integrity":"sha512-A80apw7i2ZcuwgKKW51zmPSaUXfzLeAQ28XmACB/KeIAVA7PQuaON1hyIEHU3yvk9oriCaWuzU20r0CgieYmmA==","signatures":[{"sig":"MEUCIQCO0ehH4bdfmQfBwva+rV4cPzw7oL1PXqxdWLhkllrRQAIgXjm5QdfAi2MMgE4SR5YYlDpvOCr3QQX8tdklNMmnuZM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38285},"type":"module","_from":"file:shadcn-helpers-0.1.0.tgz","exports":{"./ai-sdk":{"types":"./dist/ai-sdk/index.d.ts","default":"./dist/ai-sdk/index.js"},"./tanstack-ai":{"types":"./dist/tanstack-ai/index.d.ts","default":"./dist/tanstack-ai/index.js"}},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","clean":"rimraf dist","typecheck":"tsc --noEmit","format:check":"prettier --check \"**/*.{ts,tsx,mdx}\" --cache","format:write":"prettier --write \"**/*.{ts,tsx,mdx}\" --cache"},"_npmUser":{"name":"shadcn","email":"m@shadcn.com"},"_resolved":"/private/var/folders/g5/v4_fbyys44b9vq9_cg3hsvf00000gn/T/dd5f82864065bff392b30564f7ffefa3/shadcn-helpers-0.1.0.tgz","_integrity":"sha512-A80apw7i2ZcuwgKKW51zmPSaUXfzLeAQ28XmACB/KeIAVA7PQuaON1hyIEHU3yvk9oriCaWuzU20r0CgieYmmA==","repository":{"url":"git+https://github.com/shadcn-ui/ui.git","type":"git","directory":"packages/helpers"},"_npmVersion":"11.16.0","description":"Small helpers for developing apps.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"7.0.22","tsup":"^8.5.0","rimraf":"^6.0.1","vitest":"^3.2.6","typescript":"^5.9.2","@tanstack/ai":"0.40.0","@tanstack/ai-client":"0.20.0"},"peerDependencies":{"ai":">=7.0.0 <8","@tanstack/ai":">=0.40.0 <0.41.0","@tanstack/ai-client":">=0.20.0 <0.21.0"},"peerDependenciesMeta":{"ai":{"optional":true},"@tanstack/ai":{"optional":true},"@tanstack/ai-client":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/helpers_0.1.0_1784046799803_0.26647784497965366","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@shadcn/helpers","version":"0.2.0","description":"Small helpers for developing apps.","publishConfig":{"access":"public"},"license":"MIT","author":{"name":"shadcn","url":"https://twitter.com/shadcn"},"repository":{"type":"git","url":"git+https://github.com/shadcn-ui/ui.git","directory":"packages/helpers"},"homepage":"https://ui.shadcn.com","bugs":{"url":"https://github.com/shadcn-ui/ui/issues"},"keywords":["ai","chat","helpers","development","ai-sdk","tanstack","shadcn"],"type":"module","sideEffects":false,"exports":{"./ai-sdk":{"types":"./dist/ai-sdk/index.d.ts","default":"./dist/ai-sdk/index.js"},"./tanstack-ai":{"types":"./dist/tanstack-ai/index.d.ts","default":"./dist/tanstack-ai/index.js"}},"peerDependencies":{"@tanstack/ai":">=0.40.0 <0.41.0","@tanstack/ai-client":">=0.20.0 <0.21.0","ai":">=7.0.0 <8"},"peerDependenciesMeta":{"@tanstack/ai":{"optional":true},"@tanstack/ai-client":{"optional":true},"ai":{"optional":true}},"devDependencies":{"@tanstack/ai":"0.40.0","@tanstack/ai-client":"0.20.0","ai":"7.0.0-canary.159","zod":"3.25.76","rimraf":"^6.0.1","tsup":"^8.5.0","typescript":"^5.9.2","vitest":"^3.2.6"},"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit","format:write":"prettier --write \"**/*.{ts,tsx,mdx}\" --cache","format:check":"prettier --check \"**/*.{ts,tsx,mdx}\" --cache","clean":"rimraf dist","test":"vitest run"},"_id":"@shadcn/helpers@0.2.0","_integrity":"sha512-wpcZNuRgdW16jLwjvh4mbREKpVFrGY+nBM3Okgic8b04sijN5CHW1Nl/AEMajsP3INaCTNnqMCouOalZ7OHvEQ==","_resolved":"/tmp/d0d373837563008cbb61cfdd0d674e6e/shadcn-helpers-0.2.0.tgz","_from":"file:shadcn-helpers-0.2.0.tgz","_nodeVersion":"24.18.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-wpcZNuRgdW16jLwjvh4mbREKpVFrGY+nBM3Okgic8b04sijN5CHW1Nl/AEMajsP3INaCTNnqMCouOalZ7OHvEQ==","shasum":"4f376bf0a87c55bc73a9b8fba7a786d719989fb5","tarball":"https://registry.npmjs.org/@shadcn/helpers/-/helpers-0.2.0.tgz","fileCount":9,"unpackedSize":47860,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@shadcn%2fhelpers@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCViO/0qfPK6cTZGdoZ8ubjDxHda/+5NNT82EWl1lcc6AIgcsrhVZdcBb7iZfBFdfyss6WZv1UKyoyAY7UUhnuJFLg="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d805983f-5a9b-4021-9e61-36c32c0e2c2d"}},"directories":{},"maintainers":[{"name":"shadcn","email":"m@shadcn.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/helpers_0.2.0_1786481372157_0.2278558167933773"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-14T16:33:19.688Z","modified":"2026-08-11T20:49:32.626Z","0.1.0":"2026-07-14T16:33:19.930Z","0.2.0":"2026-08-11T20:49:32.306Z"},"bugs":{"url":"https://github.com/shadcn-ui/ui/issues"},"author":{"name":"shadcn","url":"https://twitter.com/shadcn"},"license":"MIT","homepage":"https://ui.shadcn.com","keywords":["ai","chat","helpers","development","ai-sdk","tanstack","shadcn"],"repository":{"type":"git","url":"git+https://github.com/shadcn-ui/ui.git","directory":"packages/helpers"},"description":"Small helpers for developing apps.","maintainers":[{"name":"shadcn","email":"m@shadcn.com"}],"readme":"# @shadcn/helpers\n\nA collection of helpers for building AI applications.\n\n## createChat\n\n```ts\nimport { createChat } from \"@shadcn/helpers/ai-sdk\"\n\nconst chat = createChat()\n  .user(\"What's the weather in San Francisco?\")\n  .sleep(800)\n  .assistant(({ writer }) => {\n    writer.reasoning(\"I should call the weather tool first.\")\n    writer\n      .tool(\"getWeather\", { input: { city: \"San Francisco\" } })\n      .sleep(1200)\n      .output({ temperature: 72, condition: \"sunny\" })\n    writer.text(\"It's sunny and 72 degrees in San Francisco.\")\n  })\n```\n\n## Human in the loop\n\nA tool call left unresolved pauses the turn: the input streams, the turn\nfinishes, and the client decides what happens next. A callback turn scripted\nafter a paused turn becomes a continuation. It materializes when the follow-up\nrequest arrives and receives the resolved `toolCall` in its context.\n\nFor client-executed tools, the user supplies the output through\n`addToolOutput` and the continuation reads it:\n\n```ts\nconst chat = createChat()\n  .user(\"Help me plan the release.\")\n  .assistant(({ writer }) => {\n    writer.tool(\"askQuestions\", { dynamic: true, input: { questions } })\n  })\n  .assistant(({ writer, toolCall }) => {\n    writer.text(`Got it. Starting with ${toolCall?.output?.answers.direction}.`)\n  })\n```\n\nFor approval-gated tools, `needsApproval` pauses behind the user's decision.\n`output` (or `errorText`) then means \"stream this if approved\"; denial streams\n`tool-output-denied` automatically:\n\n```ts\nconst chat = createChat()\n  .user(\"Clean up old deployments.\")\n  .assistant(({ writer }) => {\n    writer.text(\"This will delete 3 deployments. Approve?\")\n    writer.tool(\"deleteDeployments\", {\n      input: { count: 3 },\n      needsApproval: true,\n      output: { deleted: 3 },\n    })\n  })\n  .assistant(({ writer, toolCall }) => {\n    writer.text(\n      toolCall?.approved\n        ? \"Deleted 3 deployments.\"\n        : \"Okay, leaving them in place.\"\n    )\n  })\n```\n\nWire the client with the AI SDK's own triggers:\n`sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls` for\nclient-executed tools, or `lastAssistantMessageIsCompleteWithApprovalResponses`\nplus `addToolApprovalResponse({ id: part.approval.id, approved })` for\napprovals.\n\nContinuation callbacks must be pure; regenerating re-resolves them against the\ncurrent transcript. `get()` stops before the first continuation turn, since a\ncontinuation has no message without a live transcript.\n\n## Installation\n\n```bash\nnpm install @shadcn/helpers\n```\n\n## Documentation\n\nVisit https://ui.shadcn.com/docs to view the documentation.\n\n## Contributing\n\nPlease read the [contributing guide](https://github.com/shadcn-ui/ui/blob/main/CONTRIBUTING.md).\n\n## License\n\nLicensed under the [MIT license](https://github.com/shadcn-ui/ui/blob/main/LICENSE.md).\n","readmeFilename":"README.md"}