@copilotkit/channels 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +43 -185
  2. package/dist/discord.d.ts +2 -0
  3. package/dist/discord.d.ts.map +1 -0
  4. package/dist/discord.js +1 -0
  5. package/dist/index.d.ts +1 -25
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -32
  8. package/dist/intelligence.d.ts +3 -0
  9. package/dist/intelligence.d.ts.map +1 -0
  10. package/dist/intelligence.js +1 -0
  11. package/dist/jsx-dev-runtime.d.ts +2 -0
  12. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  13. package/dist/jsx-dev-runtime.js +1 -0
  14. package/dist/jsx-runtime.d.ts +2 -0
  15. package/dist/jsx-runtime.d.ts.map +1 -0
  16. package/dist/jsx-runtime.js +1 -0
  17. package/dist/slack/codec.d.ts +2 -0
  18. package/dist/slack/codec.d.ts.map +1 -0
  19. package/dist/slack/codec.js +1 -0
  20. package/dist/slack/render.d.ts +2 -0
  21. package/dist/slack/render.d.ts.map +1 -0
  22. package/dist/slack/render.js +1 -0
  23. package/dist/slack.d.ts +2 -0
  24. package/dist/slack.d.ts.map +1 -0
  25. package/dist/slack.js +1 -0
  26. package/dist/teams/render.d.ts +2 -0
  27. package/dist/teams/render.d.ts.map +1 -0
  28. package/dist/teams/render.js +1 -0
  29. package/dist/teams.d.ts +2 -0
  30. package/dist/teams.d.ts.map +1 -0
  31. package/dist/teams.js +1 -0
  32. package/dist/telegram.d.ts +2 -0
  33. package/dist/telegram.d.ts.map +1 -0
  34. package/dist/telegram.js +1 -0
  35. package/dist/testing.d.ts +2 -0
  36. package/dist/testing.d.ts.map +1 -0
  37. package/dist/testing.js +1 -0
  38. package/dist/ui.d.ts +2 -0
  39. package/dist/ui.d.ts.map +1 -0
  40. package/dist/ui.js +1 -0
  41. package/dist/umbrella.smoke.test.d.ts +2 -0
  42. package/dist/umbrella.smoke.test.d.ts.map +1 -0
  43. package/dist/umbrella.smoke.test.js +40 -0
  44. package/dist/whatsapp.d.ts +2 -0
  45. package/dist/whatsapp.d.ts.map +1 -0
  46. package/dist/whatsapp.js +1 -0
  47. package/package.json +78 -13
  48. package/dist/action-registry.d.ts +0 -59
  49. package/dist/action-registry.d.ts.map +0 -1
  50. package/dist/action-registry.js +0 -217
  51. package/dist/action-registry.test.d.ts +0 -2
  52. package/dist/action-registry.test.d.ts.map +0 -1
  53. package/dist/action-registry.test.js +0 -115
  54. package/dist/action-store.d.ts +0 -21
  55. package/dist/action-store.d.ts.map +0 -1
  56. package/dist/action-store.js +0 -23
  57. package/dist/action-store.test.d.ts +0 -2
  58. package/dist/action-store.test.d.ts.map +0 -1
  59. package/dist/action-store.test.js +0 -27
  60. package/dist/codec.d.ts +0 -25
  61. package/dist/codec.d.ts.map +0 -1
  62. package/dist/codec.js +0 -1
  63. package/dist/commands.d.ts +0 -73
  64. package/dist/commands.d.ts.map +0 -1
  65. package/dist/commands.js +0 -38
  66. package/dist/commands.test.d.ts +0 -2
  67. package/dist/commands.test.d.ts.map +0 -1
  68. package/dist/commands.test.js +0 -23
  69. package/dist/create-bot.d.ts +0 -171
  70. package/dist/create-bot.d.ts.map +0 -1
  71. package/dist/create-bot.foundations.test.d.ts +0 -2
  72. package/dist/create-bot.foundations.test.d.ts.map +0 -1
  73. package/dist/create-bot.foundations.test.js +0 -147
  74. package/dist/create-bot.js +0 -579
  75. package/dist/create-bot.test.d.ts +0 -2
  76. package/dist/create-bot.test.d.ts.map +0 -1
  77. package/dist/create-bot.test.js +0 -936
  78. package/dist/mint-id.d.ts +0 -3
  79. package/dist/mint-id.d.ts.map +0 -1
  80. package/dist/mint-id.js +0 -20
  81. package/dist/mint-id.test.d.ts +0 -2
  82. package/dist/mint-id.test.d.ts.map +0 -1
  83. package/dist/mint-id.test.js +0 -16
  84. package/dist/modal-submit.test.d.ts +0 -2
  85. package/dist/modal-submit.test.d.ts.map +0 -1
  86. package/dist/modal-submit.test.js +0 -68
  87. package/dist/platform-adapter.d.ts +0 -331
  88. package/dist/platform-adapter.d.ts.map +0 -1
  89. package/dist/platform-adapter.js +0 -1
  90. package/dist/platform-adapter.test.d.ts +0 -2
  91. package/dist/platform-adapter.test.d.ts.map +0 -1
  92. package/dist/platform-adapter.test.js +0 -40
  93. package/dist/reactions.test.d.ts +0 -2
  94. package/dist/reactions.test.d.ts.map +0 -1
  95. package/dist/reactions.test.js +0 -225
  96. package/dist/run-loop.d.ts +0 -41
  97. package/dist/run-loop.d.ts.map +0 -1
  98. package/dist/run-loop.js +0 -102
  99. package/dist/run-loop.test.d.ts +0 -2
  100. package/dist/run-loop.test.d.ts.map +0 -1
  101. package/dist/run-loop.test.js +0 -125
  102. package/dist/standard-schema.d.ts +0 -52
  103. package/dist/standard-schema.d.ts.map +0 -1
  104. package/dist/standard-schema.js +0 -66
  105. package/dist/state/duration.d.ts +0 -3
  106. package/dist/state/duration.d.ts.map +0 -1
  107. package/dist/state/duration.js +0 -16
  108. package/dist/state/duration.test.d.ts +0 -2
  109. package/dist/state/duration.test.d.ts.map +0 -1
  110. package/dist/state/duration.test.js +0 -13
  111. package/dist/state/kv-action-store.d.ts +0 -7
  112. package/dist/state/kv-action-store.d.ts.map +0 -1
  113. package/dist/state/kv-action-store.js +0 -9
  114. package/dist/state/kv-action-store.test.d.ts +0 -2
  115. package/dist/state/kv-action-store.test.d.ts.map +0 -1
  116. package/dist/state/kv-action-store.test.js +0 -21
  117. package/dist/state/memory-store.d.ts +0 -41
  118. package/dist/state/memory-store.d.ts.map +0 -1
  119. package/dist/state/memory-store.js +0 -110
  120. package/dist/state/memory-store.test.d.ts +0 -2
  121. package/dist/state/memory-store.test.d.ts.map +0 -1
  122. package/dist/state/memory-store.test.js +0 -22
  123. package/dist/state/state-conversation-store.d.ts +0 -14
  124. package/dist/state/state-conversation-store.d.ts.map +0 -1
  125. package/dist/state/state-conversation-store.js +0 -22
  126. package/dist/state/state-conversation-store.test.d.ts +0 -2
  127. package/dist/state/state-conversation-store.test.d.ts.map +0 -1
  128. package/dist/state/state-conversation-store.test.js +0 -58
  129. package/dist/state/state-store.d.ts +0 -63
  130. package/dist/state/state-store.d.ts.map +0 -1
  131. package/dist/state/state-store.js +0 -1
  132. package/dist/telemetry/bot-telemetry.d.ts +0 -31
  133. package/dist/telemetry/bot-telemetry.d.ts.map +0 -1
  134. package/dist/telemetry/bot-telemetry.js +0 -70
  135. package/dist/telemetry/bot-telemetry.test.d.ts +0 -2
  136. package/dist/telemetry/bot-telemetry.test.d.ts.map +0 -1
  137. package/dist/telemetry/bot-telemetry.test.js +0 -56
  138. package/dist/telemetry/create-bot-telemetry.test.d.ts +0 -2
  139. package/dist/telemetry/create-bot-telemetry.test.d.ts.map +0 -1
  140. package/dist/telemetry/create-bot-telemetry.test.js +0 -71
  141. package/dist/telemetry/e2e-telemetry.test.d.ts +0 -2
  142. package/dist/telemetry/e2e-telemetry.test.d.ts.map +0 -1
  143. package/dist/telemetry/e2e-telemetry.test.js +0 -56
  144. package/dist/telemetry/events-catalog.test.d.ts +0 -2
  145. package/dist/telemetry/events-catalog.test.d.ts.map +0 -1
  146. package/dist/telemetry/events-catalog.test.js +0 -8
  147. package/dist/telemetry/install-id.d.ts +0 -8
  148. package/dist/telemetry/install-id.d.ts.map +0 -1
  149. package/dist/telemetry/install-id.js +0 -43
  150. package/dist/telemetry/install-id.test.d.ts +0 -2
  151. package/dist/telemetry/install-id.test.d.ts.map +0 -1
  152. package/dist/telemetry/install-id.test.js +0 -43
  153. package/dist/telemetry/platform-allowlist-coverage.test.d.ts +0 -2
  154. package/dist/telemetry/platform-allowlist-coverage.test.d.ts.map +0 -1
  155. package/dist/telemetry/platform-allowlist-coverage.test.js +0 -45
  156. package/dist/telemetry/sanitize-error.d.ts +0 -3
  157. package/dist/telemetry/sanitize-error.d.ts.map +0 -1
  158. package/dist/telemetry/sanitize-error.js +0 -31
  159. package/dist/telemetry/sanitize-error.test.d.ts +0 -2
  160. package/dist/telemetry/sanitize-error.test.d.ts.map +0 -1
  161. package/dist/telemetry/sanitize-error.test.js +0 -33
  162. package/dist/testing/fake-adapter.d.ts +0 -137
  163. package/dist/testing/fake-adapter.d.ts.map +0 -1
  164. package/dist/testing/fake-adapter.js +0 -273
  165. package/dist/testing/fake-agent.d.ts +0 -28
  166. package/dist/testing/fake-agent.d.ts.map +0 -1
  167. package/dist/testing/fake-agent.js +0 -36
  168. package/dist/testing/state-store-conformance.d.ts +0 -4
  169. package/dist/testing/state-store-conformance.d.ts.map +0 -1
  170. package/dist/testing/state-store-conformance.js +0 -117
  171. package/dist/thread-capabilities.test.d.ts +0 -2
  172. package/dist/thread-capabilities.test.d.ts.map +0 -1
  173. package/dist/thread-capabilities.test.js +0 -77
  174. package/dist/thread-ephemeral.test.d.ts +0 -2
  175. package/dist/thread-ephemeral.test.d.ts.map +0 -1
  176. package/dist/thread-ephemeral.test.js +0 -45
  177. package/dist/thread-reactions.test.d.ts +0 -2
  178. package/dist/thread-reactions.test.d.ts.map +0 -1
  179. package/dist/thread-reactions.test.js +0 -38
  180. package/dist/thread.d.ts +0 -154
  181. package/dist/thread.d.ts.map +0 -1
  182. package/dist/thread.js +0 -333
  183. package/dist/thread.test.d.ts +0 -2
  184. package/dist/thread.test.d.ts.map +0 -1
  185. package/dist/thread.test.js +0 -83
  186. package/dist/tools.d.ts +0 -67
  187. package/dist/tools.d.ts.map +0 -1
  188. package/dist/tools.js +0 -38
  189. package/dist/tools.test.d.ts +0 -2
  190. package/dist/tools.test.d.ts.map +0 -1
  191. package/dist/tools.test.js +0 -31
  192. package/dist/transcripts.d.ts +0 -52
  193. package/dist/transcripts.d.ts.map +0 -1
  194. package/dist/transcripts.js +0 -67
  195. package/dist/transcripts.test.d.ts +0 -2
  196. package/dist/transcripts.test.d.ts.map +0 -1
  197. package/dist/transcripts.test.js +0 -108
package/README.md CHANGED
@@ -1,204 +1,62 @@
1
1
  # @copilotkit/channels
2
2
 
3
- The **platform-agnostic channel engine**. It owns everything between an incoming
4
- message and a rendered reply — handler registration, the agent
5
- run/tool/interrupt loop, JSX action binding, and the `PlatformAdapter`
6
- contract — without knowing anything about Slack (or any other surface). A
7
- platform adapter plugs in at the boundary; `@copilotkit/channels-slack` is the
8
- concrete Slack one.
9
-
10
- It builds on `@copilotkit/channels-ui` (the JSX runtime + component vocabulary,
11
- re-exported from here for convenience) and AG-UI (`@ag-ui/client`,
12
- `@ag-ui/core`).
3
+ `@copilotkit/channels` is the batteries-included CopilotKit Channels package. One install
4
+ provides the engine, JSX vocabulary, UI primitives, testing API, and every supported adapter.
13
5
 
14
6
  ## Install
15
7
 
16
8
  ```sh
17
- pnpm add @copilotkit/channels @copilotkit/channels-ui
18
- # plus a platform adapter, e.g.
19
- pnpm add @copilotkit/channels-slack
20
- ```
21
-
22
- ## Quickstart
23
-
24
- ```ts
25
- import { createBot } from "@copilotkit/channels";
26
- import { slack } from "@copilotkit/channels-slack"; // a concrete PlatformAdapter
27
-
28
- const bot = createBot({
29
- adapters: [slack({ botToken, appToken })],
30
- agent: (threadId) => makeAgent(threadId), // AbstractAgent or (threadId) => AbstractAgent
31
- tools: [...myTools], // BotTool[] forwarded on every runAgent
32
- context: [...myContext], // ContextEntry[] forwarded on every runAgent
33
- });
34
-
35
- bot.onMention(({ thread }) => thread.runAgent());
36
- bot.onMessage(({ thread }) => thread.runAgent());
37
-
38
- await bot.start();
9
+ pnpm add @copilotkit/channels
39
10
  ```
40
11
 
41
- `createBot(opts)` returns a `Bot`:
42
-
43
- - `onMention(handler)` / `onMessage(handler)` — turn handlers receiving
44
- `{ thread, message }`. (Routing is mention-preferred: if any mention
45
- handler is registered, all turns route to it; otherwise message handlers
46
- fire.)
47
- - `onThreadStarted(handler)` — a conversation surface opened (e.g. the Slack
48
- assistant pane); receives `{ thread, user? }`. Greet, set suggested prompts
49
- or a title, or run the agent. Adapters without the concept never fire it.
50
- - `onInteraction<TValue>(id, handler)` — explicit escape-hatch handler for a
51
- known action id, bypassing the registry; `ctx.action.value` is typed `TValue`.
52
- - `onInterrupt<TPayload>(eventName, handler)` — handle a captured agent
53
- interrupt (LangGraph-style `on_interrupt`); receives `{ payload, thread }`
54
- with `payload` typed `TPayload`.
55
- - `onCommand(command)` / `onCommand(name, handler)` — register a slash command.
56
- The handler gets `{ thread, command, text, options, user }`. `text` is the
57
- raw args (Slack); `options` is the typed, parsed form (`defineBotCommand`
58
- with an `options` Standard Schema) for surfaces with native structured args
59
- (e.g. Discord). Forwarded to adapters that support commands and ignored
60
- elsewhere — also pass them up front via `commands` in `CreateBotOptions`.
61
- - `tool(t)` — register a `BotTool` (alternative to `opts.tools`); must be
62
- added before `start()`.
63
- - `start()` / `stop()` — bring adapters up / down.
64
-
65
- `agent` is optional. If omitted, calling `thread.runAgent()` throws; supply
66
- an `AbstractAgent` or a `(threadId) => AbstractAgent` factory.
67
-
68
- ## `Thread`
12
+ Configure TypeScript to use the Channels JSX runtime:
69
13
 
70
- A `Thread` is the per-conversation handle handed to your handlers and tool
71
- contexts. It accepts any `Renderable` (JSX or a string) for posting.
72
-
73
- ```ts
74
- interface Thread {
75
- readonly platform: string;
76
- post(ui: Renderable): Promise<MessageRef>;
77
- update(ref: MessageRef, ui: Renderable): Promise<MessageRef>;
78
- delete(ref: MessageRef): Promise<void>;
79
- stream(src: string | AsyncIterable<string>): Promise<MessageRef>;
80
- runAgent(input?: {
81
- context?: ContextEntry[];
82
- tools?: BotTool[];
83
- }): Promise<MessageRef | undefined>;
84
- resume(value: unknown): Promise<MessageRef | undefined>;
85
- awaitChoice<T = unknown>(ui: Renderable): Promise<T>;
86
- // Capability-gated (return { ok: false } on surfaces without support):
87
- setSuggestedPrompts(
88
- prompts: ReadonlyArray<{ title: string; message: string }>,
89
- opts?: { title?: string },
90
- ): Promise<{ ok: boolean; error?: string }>;
91
- setTitle(title: string): Promise<{ ok: boolean; error?: string }>;
14
+ ```json
15
+ {
16
+ "compilerOptions": {
17
+ "jsx": "react-jsx",
18
+ "jsxImportSource": "@copilotkit/channels"
19
+ }
92
20
  }
93
21
  ```
94
22
 
95
- - `post` / `update` render the JSX to IR, **bind** every event-prop handler
96
- in the tree (mint a content-stable id, snapshot it, rewrite the prop to
97
- `{ id }`), then hand the IR to the adapter.
98
- - `runAgent` resolves the conversation's agent session, creates the adapter's
99
- `RunRenderer`, and drives the run/tool/interrupt loop. Per-run `tools` /
100
- `context` are merged on top of the bot-level defaults for that run only.
101
- - `resume(value)` re-enters a paused interrupt run with
102
- `forwardedProps.command`.
103
- - `awaitChoice<T>(ui)` posts a picker and blocks until an interaction in this
104
- conversation resolves it to the clicked control's value (HITL); pass `T` to
105
- type the returned value.
106
-
107
- ## Tools & context
108
-
109
- A `BotTool` is forwarded to the agent as a frontend tool; its handler runs in
110
- the bot when the agent calls it. The handler `ctx` carries the `thread`, so a
111
- tool can render JSX (`ctx.thread.post(<Card .../>)`) or run the agent further.
112
-
113
- ```ts
114
- interface BotTool<Schema extends ObjectSchema = ObjectSchema> {
115
- name: string;
116
- description: string;
117
- parameters: Schema; // any Standard Schema (Zod/Valibot/ArkType/…)
118
- handler(args, ctx: BotToolContext): Promise<unknown> | unknown;
119
- }
120
- ```
121
-
122
- Define one with the non-curried `defineBotTool`, which infers the arg types
123
- from `parameters`:
124
-
125
- ```ts
126
- defineBotTool({
127
- name: "read_thread",
128
- description: "Read the messages in the current conversation.",
129
- parameters: z.object({}),
130
- async handler(_args, { thread }) {
131
- return await thread.getMessages();
132
- },
23
+ ```tsx
24
+ import { createChannel, Message, Section } from "@copilotkit/channels";
25
+ import { slack } from "@copilotkit/channels/slack";
26
+
27
+ const channel = createChannel({
28
+ adapters: [
29
+ slack({
30
+ botToken: process.env.SLACK_BOT_TOKEN!,
31
+ appToken: process.env.SLACK_APP_TOKEN!,
32
+ }),
33
+ ],
133
34
  });
134
- ```
135
-
136
- `parameters` (a Standard Schema) is converted to JSON Schema for the LLM and
137
- validated on the way back. `BotToolContext` is `{ thread, message?, user?,
138
- signal?, platform }` — a single shared type with no per-adapter generic.
139
- Platform-specific power is reached only through capability-gated `thread`
140
- methods (e.g. `thread.getMessages()`, `thread.lookupUser(query)`,
141
- `thread.postFile(...)`), so a tool stays portable across surfaces.
142
35
 
143
- A `ContextEntry` is `{ description: string; value: string }` — knowledge
144
- folded into the agent's system context on each `runAgent`.
145
-
146
- ## ActionStore
147
-
148
- Inline JSX handlers are bound by content. Each interactive node gets a
149
- **content-stable, opaque** minted id — `mintId(componentName, path, props)`
150
- = `"ck:" + sha1(name | path | stableStringify(props)).slice(0,16)`. Only the
151
- opaque id (plus any small `bind()` args) is stamped on the native token; no
152
- props, PII, or secrets go over the wire.
153
-
154
- On a click, the `ActionRegistry` resolves the handler from a hot in-memory
155
- cache; on a miss it **rehydrates** by loading the snapshot from the
156
- `ActionStore`, re-rendering the named component with the frozen props, and
157
- re-walking to the handler's path.
36
+ channel.onMessage(({ thread, message }) =>
37
+ thread.post(
38
+ <Message>
39
+ <Section>Echo: {message.text}</Section>
40
+ </Message>,
41
+ ),
42
+ );
43
+ ```
158
44
 
159
- The default `ActionStore` is `InMemoryActionStore` (a `Map` with optional
160
- TTL). It is lost on restart: after a restart an old button click degrades to
161
- an `ActionExpiredError` ("this action expired"), which `createBot` swallows.
162
- **Durable actions require an external store (Redis / DB) — not shipped in
163
- v1.** Implement the `ActionStore` interface (`put` / `get` / `delete`) and
164
- pass it as `actionStore` to make actions survive restarts.
45
+ ## Adapter entry points
165
46
 
166
- ## Writing a `PlatformAdapter`
47
+ - `@copilotkit/channels/slack` (plus `/slack/codec` and `/slack/render`)
48
+ - `@copilotkit/channels/teams` (plus `/teams/render`)
49
+ - `@copilotkit/channels/discord`
50
+ - `@copilotkit/channels/telegram`
51
+ - `@copilotkit/channels/whatsapp`
52
+ - `@copilotkit/channels/intelligence` for the curated `intelligenceAdapter` factory and `IntelligenceAdapterOptions` type
167
53
 
168
- To target a new surface, implement `PlatformAdapter` from this package. The
169
- engine drives ingress through the `IngressSink` you receive in `start(sink)`
170
- (`sink.onTurn(IncomingTurn)` / `sink.onInteraction(InteractionEvent)` /
171
- `sink.onCommand(IncomingCommand)` / `sink.onThreadStarted(IncomingThreadStart)`)
172
- and egress through your `post` / `update` / `stream` / `delete` (which receive
173
- `BotNode[]` to translate to a native payload via `render`). You also provide
174
- `createRunRenderer(target)` (an AG-UI `RunRenderer`: the subscriber to stream
175
- into, plus accessors for captured tool calls and interrupts that the run-loop
176
- reads after each `runAgent`), `decodeInteraction(raw)` (native event → opaque
177
- `InteractionEvent`), `lookupUser`, a `conversationStore`
178
- (`getOrCreate` → `AgentSession`), and the surface `capabilities` /
179
- `ackDeadlineMs`. Optional capability methods like `getMessages(target)` and
180
- `postFile(target, args)` back the matching `thread` methods when the surface
181
- supports them — likewise `setSuggestedPrompts(target, prompts, opts?)` and
182
- `setThreadTitle(target, title)` back `thread.setSuggestedPrompts` /
183
- `thread.setTitle`, and `sink.onThreadStarted(...)` emits the "conversation
184
- opened" lifecycle event. Slash commands are also capability-gated: an adapter forwards
185
- invocations via `sink.onCommand(IncomingCommand)`, and may implement
186
- `registerCommands(specs)` to publish the bot's declared commands up front
187
- (e.g. Discord's application-command API); adapters that omit it are skipped.
188
- See `@copilotkit/channels-slack` for a complete implementation.
54
+ One package version gives you a tested snapshot of the core engine, JSX/UI vocabulary,
55
+ testing helpers, and every adapter listed above.
189
56
 
190
- ## Exports
57
+ For adapter authoring or a selective dependency graph, install
58
+ `@copilotkit/channels-core` plus the direct adapter package you need, for example:
191
59
 
192
- `createBot`, `Bot`, `CreateBotOptions`, `BotHandler`, `ThreadStartHandler`;
193
- `Thread`; the `PlatformAdapter` boundary types (`RunRenderer`, `IngressSink`,
194
- `IncomingTurn`, `InteractionEvent`, `IncomingCommand`, `IncomingThreadStart`,
195
- `SurfaceCapabilities`,
196
- `ReplyTarget`, `ConversationStore`, `AgentSession`, `CapturedToolCall`,
197
- `CapturedInterrupt`, `UserQuery`); `ActionStore` / `InMemoryActionStore` /
198
- `ActionSnapshot` / `ActionRegistry` / `ActionExpiredError`; `BotTool` /
199
- `BotToolContext` / `defineBotTool` / `BotCommand` / `CommandContext` /
200
- `CommandSpec` / `defineBotCommand` / `ContextEntry` /
201
- `AgentToolDescriptor` / `ObjectSchema` and the tool helpers
202
- (`toAgentToolDescriptors`, `parseToolArgs`, `stringifyHandlerResult`);
203
- `mintId` / `stableStringify`; `runAgentLoop`; plus the re-exported
204
- `@copilotkit/channels-ui` vocabulary.
60
+ ```sh
61
+ pnpm add @copilotkit/channels-core @copilotkit/channels-slack
62
+ ```
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-discord";
2
+ //# sourceMappingURL=discord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../src/discord.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-discord";
package/dist/index.d.ts CHANGED
@@ -1,26 +1,2 @@
1
- export { createBot } from "./create-bot.js";
2
- export type { Bot, CreateBotOptions, BotHandler, ThreadStartHandler, ReactionEvent, ReactionHandler, ModalSubmitEvent, ModalSubmitHandler, ModalCloseEvent, ModalCloseHandler, StoreConfig, LockConflictDecision, StatefulThread, BotComponent, } from "./create-bot.js";
3
- export { Thread } from "./thread.js";
4
- export type { ThreadDeps } from "./thread.js";
5
- export type { PlatformAdapter, AdapterStartContext, RunRenderer, IngressSink, IncomingTurn, InteractionEvent, IncomingCommand, IncomingThreadStart, IncomingReaction, IncomingModalSubmit, IncomingModalClose, ModalSubmitResult, SurfaceCapabilities, ReplyTarget, ConversationStore, AgentSession, CapturedToolCall, CapturedInterrupt, UserQuery, NativePayload, } from "./platform-adapter.js";
6
- export { defineBotCommand, normalizeCommandName, toCommandSpec, } from "./commands.js";
7
- export type { BotCommand, CommandContext, CommandSpec } from "./commands.js";
8
- export { InMemoryActionStore } from "./action-store.js";
9
- export type { ActionStore, ActionSnapshot } from "./action-store.js";
10
- export { ActionRegistry, ActionExpiredError } from "./action-registry.js";
11
- export type { StateStore } from "./state/state-store.js";
12
- export { MemoryStore } from "./state/memory-store.js";
13
- export { parseDuration } from "./state/duration.js";
14
- export { createStateBackedConversationStore } from "./state/state-conversation-store.js";
15
- export { Transcripts } from "./transcripts.js";
16
- export type { TranscriptEntry, Identity, TranscriptsConfig, } from "./transcripts.js";
17
- export { toAgentToolDescriptors, parseToolArgs, stringifyHandlerResult, defineBotTool, } from "./tools.js";
18
- export type { BotTool, ObjectSchema, BotToolContext, ContextEntry, AgentToolDescriptor, } from "./tools.js";
19
- export { mintId, stableStringify } from "./mint-id.js";
20
- export { runAgentLoop } from "./run-loop.js";
21
- export type { RunLoopArgs } from "./run-loop.js";
22
- export type { PlatformCodec } from "./codec.js";
23
- export { FakeAdapter, makeFakeRunRenderer } from "./testing/fake-adapter.js";
24
- export { FakeAgent } from "./testing/fake-agent.js";
25
- export * from "@copilotkit/channels-ui";
1
+ export * from "@copilotkit/channels-core";
26
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EACV,GAAG,EACH,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,YAAY,GACb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1E,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAGzF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,eAAe,EACf,QAAQ,EACR,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,OAAO,EACP,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKjD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -1,32 +1 @@
1
- // Public API for @copilotkit/channels.
2
- // Bot orchestration
3
- export { createBot } from "./create-bot.js";
4
- // Thread
5
- export { Thread } from "./thread.js";
6
- // Slash commands
7
- export { defineBotCommand, normalizeCommandName, toCommandSpec, } from "./commands.js";
8
- // Action store
9
- export { InMemoryActionStore } from "./action-store.js";
10
- // Action registry
11
- export { ActionRegistry, ActionExpiredError } from "./action-registry.js";
12
- export { MemoryStore } from "./state/memory-store.js";
13
- // NOTE: `runStateStoreConformance` is intentionally NOT re-exported here. It
14
- // pulls in `vitest`, so re-exporting it from the package entry would drag a
15
- // test framework into every consumer's runtime module graph (a bare
16
- // `import ... from "@copilotkit/channels"` would fail unless vitest is installed).
17
- // It is published under the `@copilotkit/channels/testing` subpath instead.
18
- export { parseDuration } from "./state/duration.js";
19
- export { createStateBackedConversationStore } from "./state/state-conversation-store.js";
20
- // Transcripts
21
- export { Transcripts } from "./transcripts.js";
22
- // Tools & context
23
- export { toAgentToolDescriptors, parseToolArgs, stringifyHandlerResult, defineBotTool, } from "./tools.js";
24
- // Id / serialization helpers
25
- export { mintId, stableStringify } from "./mint-id.js";
26
- // Run loop
27
- export { runAgentLoop } from "./run-loop.js";
28
- // Test utilities (also surfaces them for downstream adapter packages' tests).
29
- export { FakeAdapter, makeFakeRunRenderer } from "./testing/fake-adapter.js";
30
- export { FakeAgent } from "./testing/fake-agent.js";
31
- // Re-export the bot-ui component vocabulary + types for convenience.
32
- export * from "@copilotkit/channels-ui";
1
+ export * from "@copilotkit/channels-core";
@@ -0,0 +1,3 @@
1
+ export { intelligenceAdapter } from "@copilotkit/channels-intelligence";
2
+ export type { IntelligenceAdapterOptions } from "@copilotkit/channels-intelligence";
3
+ //# sourceMappingURL=intelligence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intelligence.d.ts","sourceRoot":"","sources":["../src/intelligence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1 @@
1
+ export { intelligenceAdapter } from "@copilotkit/channels-intelligence";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-core/jsx-dev-runtime";
2
+ //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-core/jsx-dev-runtime";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-core/jsx-runtime";
2
+ //# sourceMappingURL=jsx-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-core/jsx-runtime";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-slack/codec";
2
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/slack/codec.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-slack/codec";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-slack/render";
2
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/slack/render.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-slack/render";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-slack";
2
+ //# sourceMappingURL=slack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
package/dist/slack.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-slack";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-teams/render";
2
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/teams/render.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-teams/render";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-teams";
2
+ //# sourceMappingURL=teams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
package/dist/teams.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-teams";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-telegram";
2
+ //# sourceMappingURL=telegram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram.d.ts","sourceRoot":"","sources":["../src/telegram.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-telegram";
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-core/testing";
2
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-core/testing";
package/dist/ui.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-ui";
2
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
package/dist/ui.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-ui";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=umbrella.smoke.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"umbrella.smoke.test.d.ts","sourceRoot":"","sources":["../src/umbrella.smoke.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "@copilotkit/channels/jsx-runtime";
2
+ import { describe, expect, it } from "vitest";
3
+ import { createChannel, Message, Button } from "@copilotkit/channels";
4
+ import { runStateStoreConformance } from "@copilotkit/channels/testing";
5
+ import { slack } from "@copilotkit/channels/slack";
6
+ import { teams } from "@copilotkit/channels/teams";
7
+ import { intelligenceAdapter } from "@copilotkit/channels/intelligence";
8
+ import * as intelligence from "@copilotkit/channels/intelligence";
9
+ import { discord } from "@copilotkit/channels/discord";
10
+ import { telegram } from "@copilotkit/channels/telegram";
11
+ import { whatsapp } from "@copilotkit/channels/whatsapp";
12
+ import { slackCodec } from "@copilotkit/channels/slack/codec";
13
+ import { renderSlackMessage } from "@copilotkit/channels/slack/render";
14
+ import { renderAdaptiveCard } from "@copilotkit/channels/teams/render";
15
+ describe("@copilotkit/channels umbrella", () => {
16
+ it("exposes the existing engine, testing API, and JSX vocabulary", () => {
17
+ const view = (_jsx(Message, { children: _jsx(Button, { children: "OK" }) }));
18
+ expect(typeof createChannel).toBe("function");
19
+ expect(typeof runStateStoreConformance).toBe("function");
20
+ expect(view.type).toBe(Message);
21
+ });
22
+ it("exposes every adapter and supported nested entry", () => {
23
+ for (const value of [
24
+ slack,
25
+ teams,
26
+ intelligenceAdapter,
27
+ discord,
28
+ telegram,
29
+ whatsapp,
30
+ renderSlackMessage,
31
+ renderAdaptiveCard,
32
+ ]) {
33
+ expect(typeof value).toBe("function");
34
+ }
35
+ expect(typeof slackCodec).toBe("object");
36
+ });
37
+ it("keeps Intelligence gateway and bootstrap internals private", () => {
38
+ expect(Object.keys(intelligence).sort()).toEqual(["intelligenceAdapter"]);
39
+ });
40
+ });
@@ -0,0 +1,2 @@
1
+ export * from "@copilotkit/channels-whatsapp";
2
+ //# sourceMappingURL=whatsapp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../src/whatsapp.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "@copilotkit/channels-whatsapp";