{"versions":{"0.1.1":{"name":"@copilotkit/channels-core","version":"0.1.1","keywords":["ai","agent","bot","chatbot","copilotkit","slack","teams","discord","ag-ui"],"license":"MIT","_id":"@copilotkit/channels-core@0.1.1","maintainers":[{"name":"anonymous","email":"devops@copilotkit.ai"}],"homepage":"https://github.com/CopilotKit/CopilotKit","bugs":{"url":"https://github.com/CopilotKit/CopilotKit/issues"},"nx":{"targets":{"test":{"dependsOn":["build","^build"]}}},"dist":{"shasum":"f240a3d143f216d7d57f7991d3f50f772170f1b6","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@copilotkit/channels-core/-/channels-core-0.1.1.tgz","fileCount":183,"integrity":"sha512-oWF0VizhilMmKrx+Hbm1wNEVjoLvUPF2qlMrO6DlHnmhdBzGmP09XtdhS8YFjOZ+9unJVleyPtfWqM721+by2w==","signatures":[{"sig":"MEUCIDm5PfjgJWhQx8eIC+eQ3XR4VsnTBkt3rAgOovuCSC5MAiEAr3mSJuZk7r//Y+m5cxft5cYWERtklxdafXNciW3DKoE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":422683,"size":99075},"main":"./dist/index.js","type":"module","_from":"file:copilotkit-channels-core-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./testing":{"types":"./dist/testing/state-store-conformance.d.ts","import":"./dist/testing/state-store-conformance.js"},"./jsx-runtime":{"types":"./dist/jsx-runtime.d.ts","import":"./dist/jsx-runtime.js"},"./jsx-dev-runtime":{"types":"./dist/jsx-dev-runtime.d.ts","import":"./dist/jsx-dev-runtime.js"}},"scripts":{"attw":"attw --pack . --profile esm-only","test":"vitest run","build":"tsc -p tsconfig.json","publint":"publint .","test:watch":"vitest","check-types":"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.check.json"},"_npmUser":{"name":"anonymous","email":"devops@copilotkit.ai"},"_resolved":"/private/var/folders/b6/vwlb8t4n6sqdg9v2s565gwjm0000gn/T/be2df564c161852ced6e4fb6bc7e073d/copilotkit-channels-core-0.1.1.tgz","_integrity":"sha512-oWF0VizhilMmKrx+Hbm1wNEVjoLvUPF2qlMrO6DlHnmhdBzGmP09XtdhS8YFjOZ+9unJVleyPtfWqM721+by2w==","repository":{"url":"git+https://github.com/CopilotKit/CopilotKit.git","type":"git","directory":"packages/channels-core"},"_npmVersion":"10.9.2","description":"Platform-agnostic JSX channel engine for CopilotKit (createChannel, Thread, PlatformAdapter, ActionStore).","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@ag-ui/core":"0.0.57","@ag-ui/client":"0.0.57","@copilotkit/core":"^1.62.3","@copilotkit/shared":"^1.62.3","zod-to-json-schema":"^3.24.1","@copilotkit/channels-ui":"~0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","vitest":"^4.1.3","typescript":"^5.6.3","@types/node":"^22.10.0","@copilotkit/typescript-config":"^1.55.0-next.8"},"peerDependencies":{"vitest":"^4.0.0"},"peerDependenciesMeta":{"vitest":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/channels-core_0.1.1_1784147251103_0.34689632323097785","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-07-15T20:27:31.254Z","publish_time":1784147251254,"_source_registry_name":"default","contributors":[]},"0.2.0":{"name":"@copilotkit/channels-core","version":"0.2.0","description":"Platform-agnostic JSX channel engine for CopilotKit (createChannel, Thread, PlatformAdapter, ActionStore).","license":"MIT","repository":{"type":"git","url":"git+https://github.com/CopilotKit/CopilotKit.git","directory":"packages/channels-core"},"homepage":"https://github.com/CopilotKit/CopilotKit","keywords":["ai","agent","bot","chatbot","copilotkit","slack","teams","discord","ag-ui"],"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./testing":{"types":"./dist/testing/state-store-conformance.d.ts","import":"./dist/testing/state-store-conformance.js"},"./jsx-runtime":{"types":"./dist/jsx-runtime.d.ts","import":"./dist/jsx-runtime.js"},"./jsx-dev-runtime":{"types":"./dist/jsx-dev-runtime.d.ts","import":"./dist/jsx-dev-runtime.js"}},"dependencies":{"@ag-ui/client":"0.0.57","@ag-ui/core":"0.0.57","zod-to-json-schema":"^3.24.1","@copilotkit/channels-ui":"~0.2.0","@copilotkit/core":"^1.62.3","@copilotkit/shared":"^1.62.3"},"devDependencies":{"@types/node":"^22.10.0","typescript":"^5.6.3","vitest":"^4.1.3","zod":"^3.25.76","@copilotkit/typescript-config":"^1.55.0-next.8"},"peerDependencies":{"vitest":"^4.0.0"},"peerDependenciesMeta":{"vitest":{"optional":true}},"nx":{"targets":{"test":{"dependsOn":["build","^build"]}}},"scripts":{"build":"tsc -p tsconfig.json","check-types":"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.check.json","test":"vitest run","test:watch":"vitest","publint":"publint .","attw":"attw --pack . --profile esm-only"},"_id":"@copilotkit/channels-core@0.2.0","bugs":{"url":"https://github.com/CopilotKit/CopilotKit/issues"},"_integrity":"sha512-8nk0kse8aZiD+Upj9hvOtvZi7LCl2RsUMYCow/v+7KRUhriORX69y6SbP8dpblMQbhqTjmH9ZWZZAgB6koinJQ==","_resolved":"/home/runner/work/CopilotKit/CopilotKit/packages/channels-core/copilotkit-channels-core-0.2.0.tgz","_from":"file:copilotkit-channels-core-0.2.0.tgz","_nodeVersion":"22.23.1","_npmVersion":"11.15.0","dist":{"integrity":"sha512-8nk0kse8aZiD+Upj9hvOtvZi7LCl2RsUMYCow/v+7KRUhriORX69y6SbP8dpblMQbhqTjmH9ZWZZAgB6koinJQ==","shasum":"7e85e691e653fd724c99a6ce0e77eef53e632634","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@copilotkit/channels-core/-/channels-core-0.2.0.tgz","fileCount":165,"unpackedSize":328382,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@copilotkit%2fchannels-core@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFJKAF9G4f9ln4t4R6S9C5rSGjBmuP19OgzJyweOQvTnAiBhtZJjua9y0noYtNmXgfuPevFUMhaEZBEvchqy/WqWUw=="}],"size":83488},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b6791168-5a66-4a3b-8302-4b8a99b6bc5b"}},"directories":{},"maintainers":[{"name":"anonymous","email":"devops@copilotkit.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/channels-core_0.2.0_1784148896967_0.5065335039432728"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-07-15T20:54:57.109Z","publish_time":1784148897109,"_source_registry_name":"default","contributors":[]},"0.2.1":{"name":"@copilotkit/channels-core","version":"0.2.1","description":"Platform-agnostic JSX channel engine for CopilotKit (createChannel, Thread, PlatformAdapter, ActionStore).","license":"MIT","repository":{"type":"git","url":"git+https://github.com/CopilotKit/CopilotKit.git","directory":"packages/channels-core"},"homepage":"https://github.com/CopilotKit/CopilotKit","keywords":["ai","agent","bot","chatbot","copilotkit","slack","teams","discord","ag-ui"],"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./testing":{"types":"./dist/testing/state-store-conformance.d.ts","import":"./dist/testing/state-store-conformance.js"},"./jsx-runtime":{"types":"./dist/jsx-runtime.d.ts","import":"./dist/jsx-runtime.js"},"./jsx-dev-runtime":{"types":"./dist/jsx-dev-runtime.d.ts","import":"./dist/jsx-dev-runtime.js"}},"dependencies":{"@ag-ui/client":"0.0.57","@ag-ui/core":"0.0.57","zod-to-json-schema":"^3.24.1","@copilotkit/channels-ui":"~0.2.1","@copilotkit/core":"^1.63.1","@copilotkit/shared":"^1.63.1"},"devDependencies":{"@types/node":"^22.10.0","typescript":"^5.6.3","vitest":"^4.1.3","zod":"^3.25.76","@copilotkit/typescript-config":"^1.55.0-next.8"},"peerDependencies":{"vitest":"^4.0.0"},"peerDependenciesMeta":{"vitest":{"optional":true}},"nx":{"targets":{"test":{"dependsOn":["build","^build"]}}},"scripts":{"build":"tsc -p tsconfig.json","check-types":"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.check.json","test":"vitest run","test:watch":"vitest","publint":"publint .","attw":"attw --pack . --profile esm-only"},"_id":"@copilotkit/channels-core@0.2.1","bugs":{"url":"https://github.com/CopilotKit/CopilotKit/issues"},"_integrity":"sha512-Uab1LRb5HVXlqMYhkVROucujLWUTVUlVOpRzwdYAjIRWR/GL4kgWM3YioZ9qJyJMXwvQnSYFK2Up3zv/Uojk8w==","_resolved":"/home/runner/work/CopilotKit/CopilotKit/packages/channels-core/copilotkit-channels-core-0.2.1.tgz","_from":"file:copilotkit-channels-core-0.2.1.tgz","_nodeVersion":"22.23.1","_npmVersion":"11.15.0","dist":{"integrity":"sha512-Uab1LRb5HVXlqMYhkVROucujLWUTVUlVOpRzwdYAjIRWR/GL4kgWM3YioZ9qJyJMXwvQnSYFK2Up3zv/Uojk8w==","shasum":"7aff9f0d24cfe501e5aeaa14ca489d601419893a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@copilotkit/channels-core/-/channels-core-0.2.1.tgz","fileCount":165,"unpackedSize":330237,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@copilotkit%2fchannels-core@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGq3lGT8UOXktdpHlei/FE2Ck88o8jh0UdB3nf+6DIsSAiEA/JUDDUCw5I72FT9poaCMIE6ld5EQdCkaHDLM/V11L1E="}],"size":84078},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b6791168-5a66-4a3b-8302-4b8a99b6bc5b"}},"directories":{},"maintainers":[{"name":"anonymous","email":"devops@copilotkit.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/channels-core_0.2.1_1784280035346_0.05502444227273373"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-07-17T09:20:35.480Z","publish_time":1784280035480,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.2.1"},"name":"@copilotkit/channels-core","time":{"created":"2026-07-15T20:55:11.924Z","modified":"2026-07-17T09:20:47.518Z","0.1.1":"2026-07-15T20:27:31.254Z","0.2.0":"2026-07-15T20:54:57.109Z","0.2.1":"2026-07-17T09:20:35.480Z"},"readme":"# @copilotkit/channels-core\n\nThe supported platform-neutral foundation behind `@copilotkit/channels`.\nMost applications should use the batteries-included `@copilotkit/channels` package;\ninstall core directly when building an adapter or intentionally selecting one platform.\n\n## Selective install\n\n```sh\npnpm add @copilotkit/channels-core @copilotkit/channels-slack\n```\n\n```json\n{\n  \"compilerOptions\": {\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"@copilotkit/channels-core\"\n  }\n}\n```\n\n```ts\nimport { createChannel } from \"@copilotkit/channels-core\";\nimport { slack } from \"@copilotkit/channels-slack\";\n```\n\n`createChannel(opts)` returns a `Channel`:\n\n- `onMention(handler)` / `onMessage(handler)` — turn handlers receiving\n  `{ thread, message }`. (Routing is mention-preferred: if any mention\n  handler is registered, all turns route to it; otherwise message handlers\n  fire.)\n- `onThreadStarted(handler)` — a conversation surface opened (e.g. the Slack\n  assistant pane); receives `{ thread, user? }`. Greet, set suggested prompts\n  or a title, or run the agent. Adapters without the concept never fire it.\n- `onInteraction<TValue>(id, handler)` — explicit escape-hatch handler for a\n  known action id, bypassing the registry; `ctx.action.value` is typed `TValue`.\n- `onInterrupt<TPayload>(eventName, handler)` — handle a captured agent\n  interrupt (LangGraph-style `on_interrupt`); receives `{ payload, thread }`\n  with `payload` typed `TPayload`.\n- `onCommand(command)` / `onCommand(name, handler)` — register a slash command.\n  The handler gets `{ thread, command, text, options, user }`. `text` is the\n  raw args (Slack); `options` is the typed, parsed form (`defineChannelCommand`\n  with an `options` Standard Schema) for surfaces with native structured args\n  (e.g. Discord). Forwarded to adapters that support commands and ignored\n  elsewhere — also pass them up front via `commands` in `CreateChannelOptions`.\n- `tool(t)` — register a `ChannelTool` (alternative to `opts.tools`); must be\n  added before `start()`.\n- `start()` / `stop()` — bring adapters up / down.\n\n`agent` is optional. If omitted, calling `thread.runAgent()` throws; supply\nan `AbstractAgent` or a `(threadId) => AbstractAgent` factory.\n\n## `Thread`\n\nA `Thread` is the per-conversation handle handed to your handlers and tool\ncontexts. It accepts any `Renderable` (JSX or a string) for posting.\n\n```ts\ninterface Thread {\n  readonly platform: string;\n  post(ui: Renderable): Promise<MessageRef>;\n  update(ref: MessageRef, ui: Renderable): Promise<MessageRef>;\n  delete(ref: MessageRef): Promise<void>;\n  stream(src: string | AsyncIterable<string>): Promise<MessageRef>;\n  runAgent(input?: {\n    context?: ContextEntry[];\n    tools?: ChannelTool[];\n  }): Promise<MessageRef | undefined>;\n  resume(value: unknown): Promise<MessageRef | undefined>;\n  awaitChoice<T = unknown>(ui: Renderable): Promise<T>;\n  // Capability-gated (return { ok: false } on surfaces without support):\n  setSuggestedPrompts(\n    prompts: ReadonlyArray<{ title: string; message: string }>,\n    opts?: { title?: string },\n  ): Promise<{ ok: boolean; error?: string }>;\n  setTitle(title: string): Promise<{ ok: boolean; error?: string }>;\n}\n```\n\n- `post` / `update` render the JSX to IR, **bind** every event-prop handler\n  in the tree (mint a content-stable id, snapshot it, rewrite the prop to\n  `{ id }`), then hand the IR to the adapter.\n- `runAgent` resolves the conversation's agent session, creates the adapter's\n  `RunRenderer`, and drives the run/tool/interrupt loop. Per-run `tools` /\n  `context` are merged on top of the channel-level defaults for that run only.\n- `resume(value)` re-enters a paused interrupt run with\n  `forwardedProps.command`.\n- `awaitChoice<T>(ui)` posts a picker and blocks until an interaction in this\n  conversation resolves it to the clicked control's value (HITL); pass `T` to\n  type the returned value.\n\n## Tools & context\n\nA `ChannelTool` is forwarded to the agent as a frontend tool; its handler runs in\nthe channel when the agent calls it. The handler `ctx` carries the `thread`, so a\ntool can render JSX (`ctx.thread.post(<Card .../>)`) or run the agent further.\n\n```ts\ninterface ChannelTool<Schema extends ObjectSchema = ObjectSchema> {\n  name: string;\n  description: string;\n  parameters: Schema; // any Standard Schema (Zod/Valibot/ArkType/…)\n  handler(args, ctx: ChannelToolContext): Promise<unknown> | unknown;\n}\n```\n\nDefine one with the non-curried `defineChannelTool`, which infers the arg types\nfrom `parameters`:\n\n```ts\ndefineChannelTool({\n  name: \"read_thread\",\n  description: \"Read the messages in the current conversation.\",\n  parameters: z.object({}),\n  async handler(_args, { thread }) {\n    return await thread.getMessages();\n  },\n});\n```\n\n`parameters` (a Standard Schema) is converted to JSON Schema for the LLM and\nvalidated on the way back. `ChannelToolContext` is `{ thread, message?, user?,\nsignal?, platform }` — a single shared type with no per-adapter generic.\nPlatform-specific power is reached only through capability-gated `thread`\nmethods (e.g. `thread.getMessages()`, `thread.lookupUser(query)`,\n`thread.postFile(...)`), so a tool stays portable across surfaces.\n\nA `ContextEntry` is `{ description: string; value: string }` — knowledge\nfolded into the agent's system context on each `runAgent`.\n\n## ActionStore\n\nInline JSX handlers are bound by content. Each interactive node gets a\n**content-stable, opaque** minted id — `mintId(componentName, path, props)`\n= `\"ck:\" + sha1(name | path | stableStringify(props)).slice(0,16)`. Only the\nopaque id (plus any small `bind()` args) is stamped on the native token; no\nprops, PII, or secrets go over the wire.\n\nOn a click, the `ActionRegistry` resolves the handler from a hot in-memory\ncache; on a miss it **rehydrates** by loading the snapshot from the\n`ActionStore`, re-rendering the named component with the frozen props, and\nre-walking to the handler's path.\n\nThe default `ActionStore` is `InMemoryActionStore` (a `Map` with optional\nTTL). It is lost on restart: after a restart an old button click degrades to\nan `ActionExpiredError` (\"this action expired\"), which `createChannel` swallows.\n**Durable actions require an external store (Redis / DB) — not shipped in\nv1.** Implement the `ActionStore` interface (`put` / `get` / `delete`) and\npass it as `actionStore` to make actions survive restarts.\n\n## Writing a `PlatformAdapter`\n\nTo target a new surface, implement `PlatformAdapter` from this package. The\nengine drives ingress through the `IngressSink` you receive in `start(sink)`\n(`sink.onTurn(IncomingTurn)` / `sink.onInteraction(InteractionEvent)` /\n`sink.onCommand(IncomingCommand)` / `sink.onThreadStarted(IncomingThreadStart)`)\nand egress through your `post` / `update` / `stream` / `delete` (which receive\n`ChannelNode[]` to translate to a native payload via `render`). You also provide\n`createRunRenderer(target)` (an AG-UI `RunRenderer`: the subscriber to stream\ninto, plus accessors for captured tool calls and interrupts that the run-loop\nreads after each `runAgent`), `decodeInteraction(raw)` (native event → opaque\n`InteractionEvent`), `lookupUser`, a `conversationStore`\n(`getOrCreate` → `AgentSession`), and the surface `capabilities` /\n`ackDeadlineMs`. Optional capability methods like `getMessages(target)` and\n`postFile(target, args)` back the matching `thread` methods when the surface\nsupports them — likewise `setSuggestedPrompts(target, prompts, opts?)` and\n`setThreadTitle(target, title)` back `thread.setSuggestedPrompts` /\n`thread.setTitle`, and `sink.onThreadStarted(...)` emits the \"conversation\nopened\" lifecycle event. Slash commands are also capability-gated: an adapter forwards\ninvocations via `sink.onCommand(IncomingCommand)`, and may implement\n`registerCommands(specs)` to publish the channel's declared commands up front\n(e.g. Discord's application-command API); adapters that omit it are skipped.\nSee `@copilotkit/channels-slack` for a complete implementation.\n\n## Exports\n\n`createChannel`, `Channel`, `CreateChannelOptions`, `ChannelHandler`, `ThreadStartHandler`;\n`Thread`; the `PlatformAdapter` boundary types (`RunRenderer`, `IngressSink`,\n`IncomingTurn`, `InteractionEvent`, `IncomingCommand`, `IncomingThreadStart`,\n`SurfaceCapabilities`,\n`ReplyTarget`, `ConversationStore`, `AgentSession`, `CapturedToolCall`,\n`CapturedInterrupt`, `UserQuery`); `ActionStore` / `InMemoryActionStore` /\n`ActionSnapshot` / `ActionRegistry` / `ActionExpiredError`; `ChannelTool` /\n`ChannelToolContext` / `defineChannelTool` / `ChannelCommand` / `CommandContext` /\n`CommandSpec` / `defineChannelCommand` / `ContextEntry` /\n`AgentToolDescriptor` / `ObjectSchema` and the tool helpers\n(`toAgentToolDescriptors`, `parseToolArgs`, `stringifyHandlerResult`);\n`mintId` / `stableStringify`; `runAgentLoop`; plus the re-exported\n`@copilotkit/channels-ui` vocabulary.","users":{}}