@copilotkit/channels 0.1.0 → 0.2.0
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.
- package/README.md +43 -185
- package/dist/discord.d.ts +2 -0
- package/dist/discord.d.ts.map +1 -0
- package/dist/discord.js +1 -0
- package/dist/index.d.ts +1 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -32
- package/dist/intelligence.d.ts +3 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +1 -0
- package/dist/jsx-dev-runtime.d.ts +2 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +1 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +1 -0
- package/dist/slack/codec.d.ts +2 -0
- package/dist/slack/codec.d.ts.map +1 -0
- package/dist/slack/codec.js +1 -0
- package/dist/slack/render.d.ts +2 -0
- package/dist/slack/render.d.ts.map +1 -0
- package/dist/slack/render.js +1 -0
- package/dist/slack.d.ts +2 -0
- package/dist/slack.d.ts.map +1 -0
- package/dist/slack.js +1 -0
- package/dist/teams/render.d.ts +2 -0
- package/dist/teams/render.d.ts.map +1 -0
- package/dist/teams/render.js +1 -0
- package/dist/teams.d.ts +2 -0
- package/dist/teams.d.ts.map +1 -0
- package/dist/teams.js +1 -0
- package/dist/telegram.d.ts +2 -0
- package/dist/telegram.d.ts.map +1 -0
- package/dist/telegram.js +1 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +1 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +1 -0
- package/dist/umbrella.smoke.test.d.ts +2 -0
- package/dist/umbrella.smoke.test.d.ts.map +1 -0
- package/dist/umbrella.smoke.test.js +40 -0
- package/dist/whatsapp.d.ts +2 -0
- package/dist/whatsapp.d.ts.map +1 -0
- package/dist/whatsapp.js +1 -0
- package/package.json +78 -13
- package/dist/action-registry.d.ts +0 -59
- package/dist/action-registry.d.ts.map +0 -1
- package/dist/action-registry.js +0 -217
- package/dist/action-registry.test.d.ts +0 -2
- package/dist/action-registry.test.d.ts.map +0 -1
- package/dist/action-registry.test.js +0 -115
- package/dist/action-store.d.ts +0 -21
- package/dist/action-store.d.ts.map +0 -1
- package/dist/action-store.js +0 -23
- package/dist/action-store.test.d.ts +0 -2
- package/dist/action-store.test.d.ts.map +0 -1
- package/dist/action-store.test.js +0 -27
- package/dist/codec.d.ts +0 -25
- package/dist/codec.d.ts.map +0 -1
- package/dist/codec.js +0 -1
- package/dist/commands.d.ts +0 -73
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -38
- package/dist/commands.test.d.ts +0 -2
- package/dist/commands.test.d.ts.map +0 -1
- package/dist/commands.test.js +0 -23
- package/dist/create-bot.d.ts +0 -171
- package/dist/create-bot.d.ts.map +0 -1
- package/dist/create-bot.foundations.test.d.ts +0 -2
- package/dist/create-bot.foundations.test.d.ts.map +0 -1
- package/dist/create-bot.foundations.test.js +0 -147
- package/dist/create-bot.js +0 -576
- package/dist/create-bot.test.d.ts +0 -2
- package/dist/create-bot.test.d.ts.map +0 -1
- package/dist/create-bot.test.js +0 -936
- package/dist/mint-id.d.ts +0 -3
- package/dist/mint-id.d.ts.map +0 -1
- package/dist/mint-id.js +0 -20
- package/dist/mint-id.test.d.ts +0 -2
- package/dist/mint-id.test.d.ts.map +0 -1
- package/dist/mint-id.test.js +0 -16
- package/dist/modal-submit.test.d.ts +0 -2
- package/dist/modal-submit.test.d.ts.map +0 -1
- package/dist/modal-submit.test.js +0 -68
- package/dist/platform-adapter.d.ts +0 -312
- package/dist/platform-adapter.d.ts.map +0 -1
- package/dist/platform-adapter.js +0 -1
- package/dist/platform-adapter.test.d.ts +0 -2
- package/dist/platform-adapter.test.d.ts.map +0 -1
- package/dist/platform-adapter.test.js +0 -40
- package/dist/reactions.test.d.ts +0 -2
- package/dist/reactions.test.d.ts.map +0 -1
- package/dist/reactions.test.js +0 -197
- package/dist/run-loop.d.ts +0 -41
- package/dist/run-loop.d.ts.map +0 -1
- package/dist/run-loop.js +0 -102
- package/dist/run-loop.test.d.ts +0 -2
- package/dist/run-loop.test.d.ts.map +0 -1
- package/dist/run-loop.test.js +0 -125
- package/dist/standard-schema.d.ts +0 -52
- package/dist/standard-schema.d.ts.map +0 -1
- package/dist/standard-schema.js +0 -66
- package/dist/state/duration.d.ts +0 -3
- package/dist/state/duration.d.ts.map +0 -1
- package/dist/state/duration.js +0 -16
- package/dist/state/duration.test.d.ts +0 -2
- package/dist/state/duration.test.d.ts.map +0 -1
- package/dist/state/duration.test.js +0 -13
- package/dist/state/kv-action-store.d.ts +0 -7
- package/dist/state/kv-action-store.d.ts.map +0 -1
- package/dist/state/kv-action-store.js +0 -9
- package/dist/state/kv-action-store.test.d.ts +0 -2
- package/dist/state/kv-action-store.test.d.ts.map +0 -1
- package/dist/state/kv-action-store.test.js +0 -21
- package/dist/state/memory-store.d.ts +0 -41
- package/dist/state/memory-store.d.ts.map +0 -1
- package/dist/state/memory-store.js +0 -110
- package/dist/state/memory-store.test.d.ts +0 -2
- package/dist/state/memory-store.test.d.ts.map +0 -1
- package/dist/state/memory-store.test.js +0 -22
- package/dist/state/state-conversation-store.d.ts +0 -14
- package/dist/state/state-conversation-store.d.ts.map +0 -1
- package/dist/state/state-conversation-store.js +0 -22
- package/dist/state/state-conversation-store.test.d.ts +0 -2
- package/dist/state/state-conversation-store.test.d.ts.map +0 -1
- package/dist/state/state-conversation-store.test.js +0 -58
- package/dist/state/state-store.d.ts +0 -63
- package/dist/state/state-store.d.ts.map +0 -1
- package/dist/state/state-store.js +0 -1
- package/dist/telemetry/bot-telemetry.d.ts +0 -31
- package/dist/telemetry/bot-telemetry.d.ts.map +0 -1
- package/dist/telemetry/bot-telemetry.js +0 -70
- package/dist/telemetry/bot-telemetry.test.d.ts +0 -2
- package/dist/telemetry/bot-telemetry.test.d.ts.map +0 -1
- package/dist/telemetry/bot-telemetry.test.js +0 -56
- package/dist/telemetry/create-bot-telemetry.test.d.ts +0 -2
- package/dist/telemetry/create-bot-telemetry.test.d.ts.map +0 -1
- package/dist/telemetry/create-bot-telemetry.test.js +0 -71
- package/dist/telemetry/e2e-telemetry.test.d.ts +0 -2
- package/dist/telemetry/e2e-telemetry.test.d.ts.map +0 -1
- package/dist/telemetry/e2e-telemetry.test.js +0 -56
- package/dist/telemetry/events-catalog.test.d.ts +0 -2
- package/dist/telemetry/events-catalog.test.d.ts.map +0 -1
- package/dist/telemetry/events-catalog.test.js +0 -8
- package/dist/telemetry/install-id.d.ts +0 -8
- package/dist/telemetry/install-id.d.ts.map +0 -1
- package/dist/telemetry/install-id.js +0 -43
- package/dist/telemetry/install-id.test.d.ts +0 -2
- package/dist/telemetry/install-id.test.d.ts.map +0 -1
- package/dist/telemetry/install-id.test.js +0 -43
- package/dist/telemetry/platform-allowlist-coverage.test.d.ts +0 -2
- package/dist/telemetry/platform-allowlist-coverage.test.d.ts.map +0 -1
- package/dist/telemetry/platform-allowlist-coverage.test.js +0 -45
- package/dist/telemetry/sanitize-error.d.ts +0 -3
- package/dist/telemetry/sanitize-error.d.ts.map +0 -1
- package/dist/telemetry/sanitize-error.js +0 -31
- package/dist/telemetry/sanitize-error.test.d.ts +0 -2
- package/dist/telemetry/sanitize-error.test.d.ts.map +0 -1
- package/dist/telemetry/sanitize-error.test.js +0 -33
- package/dist/testing/fake-adapter.d.ts +0 -137
- package/dist/testing/fake-adapter.d.ts.map +0 -1
- package/dist/testing/fake-adapter.js +0 -273
- package/dist/testing/fake-agent.d.ts +0 -28
- package/dist/testing/fake-agent.d.ts.map +0 -1
- package/dist/testing/fake-agent.js +0 -36
- package/dist/testing/state-store-conformance.d.ts +0 -4
- package/dist/testing/state-store-conformance.d.ts.map +0 -1
- package/dist/testing/state-store-conformance.js +0 -117
- package/dist/thread-capabilities.test.d.ts +0 -2
- package/dist/thread-capabilities.test.d.ts.map +0 -1
- package/dist/thread-capabilities.test.js +0 -77
- package/dist/thread-ephemeral.test.d.ts +0 -2
- package/dist/thread-ephemeral.test.d.ts.map +0 -1
- package/dist/thread-ephemeral.test.js +0 -45
- package/dist/thread-reactions.test.d.ts +0 -2
- package/dist/thread-reactions.test.d.ts.map +0 -1
- package/dist/thread-reactions.test.js +0 -38
- package/dist/thread.d.ts +0 -152
- package/dist/thread.d.ts.map +0 -1
- package/dist/thread.js +0 -329
- package/dist/thread.test.d.ts +0 -2
- package/dist/thread.test.d.ts.map +0 -1
- package/dist/thread.test.js +0 -83
- package/dist/tools.d.ts +0 -67
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -38
- package/dist/tools.test.d.ts +0 -2
- package/dist/tools.test.d.ts.map +0 -1
- package/dist/tools.test.js +0 -31
- package/dist/transcripts.d.ts +0 -52
- package/dist/transcripts.d.ts.map +0 -1
- package/dist/transcripts.js +0 -67
- package/dist/transcripts.test.d.ts +0 -2
- package/dist/transcripts.test.d.ts.map +0 -1
- package/dist/transcripts.test.js +0 -108
package/README.md
CHANGED
|
@@ -1,204 +1,62 @@
|
|
|
1
1
|
# @copilotkit/channels
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
169
|
-
|
|
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
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../src/discord.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|
package/dist/discord.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@copilotkit/channels-discord";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
export
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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
|
-
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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";
|
package/dist/slack.d.ts
ADDED
|
@@ -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 @@
|
|
|
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";
|
package/dist/teams.d.ts
ADDED
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"telegram.d.ts","sourceRoot":"","sources":["../src/telegram.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/telegram.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@copilotkit/channels-telegram";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@copilotkit/channels-core/testing";
|
package/dist/ui.d.ts
ADDED
package/dist/ui.d.ts.map
ADDED
|
@@ -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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../src/whatsapp.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/whatsapp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@copilotkit/channels-whatsapp";
|