@andreprado/agentkit 0.1.0-alpha.16 → 0.1.0-alpha.18
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 +8 -0
- package/docs/guides/add-channel.md +4 -2
- package/docs/guides/add-managed-composio.md +161 -0
- package/docs/guides/channel-security.md +36 -39
- package/docs/guides/connect-telegram.md +3 -1
- package/docs/guides/debug-channel.md +141 -0
- package/docs/guides/prepare-deploy.md +7 -10
- package/docs/llms-full.txt +19 -5
- package/docs/llms.txt +11 -2
- package/package.json +1 -3
- package/src/cli/cloud-client.ts +12 -0
- package/src/cli/commands/channels.ts +119 -7
- package/src/cli/commands/transcribe.ts +171 -0
- package/src/cli/deploy-chat-ui.ts +146 -3
- package/src/cli/deploy-readiness.ts +112 -3
- package/src/cli/help.ts +19 -4
- package/src/cli/index.ts +198 -3
- package/src/create-project.ts +4 -32
- package/src/index.ts +149 -0
- package/src/runtime/chat.ts +2 -1
- package/src/runtime/config.ts +133 -0
- package/src/runtime/core/manifest.ts +31 -2
- package/src/runtime/deploy-readiness.ts +31 -1
- package/src/runtime/inspect.ts +109 -4
- package/src/runtime/integrations/composio.ts +423 -0
- package/src/runtime/skills.ts +95 -0
- package/src/runtime/targets/cloudflare/build.ts +395 -10
- package/src/runtime/tool-runner.ts +2 -1
- package/src/templates/skills/agentkit-capsule/SKILL.md +1 -0
- package/src/templates/skills/agentkit-channels/SKILL.md +2 -0
- package/src/templates/skills/agentkit-channels/references/channel-debugging.md +3 -1
- package/src/templates/skills/agentkit-channels/references/telegram.md +3 -1
- package/src/templates/skills/agentkit-deploy/SKILL.md +1 -1
- package/src/templates/skills/agentkit-integrations/SKILL.md +75 -0
- package/src/templates/skills/agentkit-troubleshooting/SKILL.md +3 -2
- package/docs/guides/agentkit-skills-architecture.md +0 -472
- package/docs/guides/channels-implementation-map.md +0 -243
- package/docs/guides/channels-production-handoff.md +0 -118
- package/docs/portable-deploy-release-checklist.md +0 -41
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ agentkit tool <name> [--input <path-or-json>]
|
|
|
37
37
|
agentkit knowledge add <path-or-url>
|
|
38
38
|
agentkit knowledge sync
|
|
39
39
|
agentkit knowledge search <query> [--top-k <number>]
|
|
40
|
+
agentkit integrations status
|
|
41
|
+
agentkit integrations connect composio --toolkit gmail
|
|
40
42
|
agentkit spec init --brief <text>
|
|
41
43
|
agentkit db migrate
|
|
42
44
|
agentkit sync run
|
|
@@ -50,18 +52,24 @@ Knowledge indexes local `.md`, `.txt`, and `.csv` sources into the capsule datab
|
|
|
50
52
|
|
|
51
53
|
Every chat run receives dynamic runtime date context: current ISO timestamp, local date, weekday, local date/time, and timezone. Set `timeZone` in `agentkit.config.ts` for scheduling agents so relative dates like "today" and "next Friday" resolve in the right business/user timezone.
|
|
52
54
|
|
|
55
|
+
AgentKit-managed Composio is a paid hosted integration layer for per-agent connected apps. Configure it with `composioManaged({...})`, deploy with a `managed_composio` entitlement, then use `agentkit integrations connect composio --toolkit <slug>` to create hosted Connect Links. BYO Composio remains available through normal `defineTool` wrappers.
|
|
56
|
+
|
|
53
57
|
## Deploy Later
|
|
54
58
|
|
|
55
59
|
```sh
|
|
56
60
|
agentkit login --token <token>
|
|
57
61
|
agentkit deploy doctor
|
|
62
|
+
agentkit skills status
|
|
58
63
|
agentkit secret set OPENAI_API_KEY --from-local-env
|
|
59
64
|
agentkit deploy
|
|
60
65
|
agentkit deploy status
|
|
66
|
+
agentkit channels test support-telegram --message "hello"
|
|
67
|
+
agentkit transcribe smoke --provider groq
|
|
61
68
|
agentkit chat-ui --deploy
|
|
62
69
|
```
|
|
63
70
|
|
|
64
71
|
Production secrets are managed secrets, not committed `.env` values.
|
|
72
|
+
After upgrading AgentKit in an existing capsule, run `agentkit skills status` and `agentkit skills sync` if local agent-facing skills are stale.
|
|
65
73
|
Private hosted deploys automatically store a local chat/UI deploy access token at `.agentkit/chat-access-token.json`. `agentkit chat-ui --deploy` serves a local UI pointed at the hosted deploy without exposing that token to browser code.
|
|
66
74
|
|
|
67
75
|
The npm package contains the public CLI/runtime/client surface only. AgentKit Cloud's control-plane server, operator commands, Postgres store, and Cloudflare/Turso/R2 publisher live in the private repo workspace and are not part of the published package.
|
|
@@ -24,13 +24,13 @@ agentkit channels deliveries list support-telegram
|
|
|
24
24
|
agentkit channels buffers list support-telegram
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Use `--api <url>`
|
|
27
|
+
Use `--api <url>` only when the owner gives you a non-default AgentKit Cloud API URL.
|
|
28
28
|
|
|
29
29
|
## Files Created Or Edited
|
|
30
30
|
|
|
31
31
|
- `agentkit.config.ts`: declare channel config with `websiteChannel`, `telegramChannel`, or `whatsappChannel`.
|
|
32
32
|
- `.agentkit/deploy.json`: written by `agentkit deploy`; used by `agentkit channels ...`.
|
|
33
|
-
- No user Turso tables: AgentKit channel resources, dedupe, identities, queue state, and delivery logs
|
|
33
|
+
- No user Turso tables: AgentKit owns channel resources, dedupe, identities, queue state, and delivery logs.
|
|
34
34
|
- Website channel clients must send `AGENTKIT_WEBSITE_CHANNEL_TOKEN` as `Authorization: Bearer <token>` or `X-AgentKit-Channel-Token`.
|
|
35
35
|
|
|
36
36
|
## Minimal Working Example
|
|
@@ -160,6 +160,8 @@ bun test
|
|
|
160
160
|
agentkit inspect
|
|
161
161
|
agentkit channels list
|
|
162
162
|
agentkit channels test support-telegram --message "hello"
|
|
163
|
+
agentkit channels test-audio support-telegram --fixture voice-note
|
|
164
|
+
agentkit transcribe smoke --provider groq
|
|
163
165
|
agentkit channels deliveries list support-telegram
|
|
164
166
|
agentkit channels buffers list support-telegram
|
|
165
167
|
```
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Add Managed Composio
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Enable AgentKit-managed Composio for one deployed agent so the agent can use explicitly allowed external app actions without the user owning Composio credentials.
|
|
6
|
+
|
|
7
|
+
Use BYO `defineTool` wrappers instead when the user wants to use their own Composio account/API key for free.
|
|
8
|
+
|
|
9
|
+
## Contract
|
|
10
|
+
|
|
11
|
+
Managed Composio is paid hosted AgentKit infrastructure:
|
|
12
|
+
|
|
13
|
+
- It works per agent/project, not per client.
|
|
14
|
+
- It requires an AgentKit Cloud account with `managed_composio`.
|
|
15
|
+
- AgentKit Cloud injects `COMPOSIO_API_KEY`; do not put it in `.env`, `.env.schema`, or `agentkit.config.ts`.
|
|
16
|
+
- AgentKit Cloud assigns the deployed Composio `user_id` from the account, project, agent, and integration name. The local inspect/build id is only a preview.
|
|
17
|
+
- The agent gets one generated tool, `agentkit_composio_execute`, only when explicit Composio action slugs are configured.
|
|
18
|
+
- Anonymous deploys cannot use managed Composio.
|
|
19
|
+
|
|
20
|
+
## Minimal Config
|
|
21
|
+
|
|
22
|
+
Edit `agentkit.config.ts`:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { composioManaged, defineAgent } from "@andreprado/agentkit";
|
|
26
|
+
|
|
27
|
+
export default defineAgent({
|
|
28
|
+
name: "acme-receptionist",
|
|
29
|
+
runtime: "edge",
|
|
30
|
+
provider: {
|
|
31
|
+
name: "test",
|
|
32
|
+
model: "fake",
|
|
33
|
+
},
|
|
34
|
+
instructions: "./prompts/instructions.md",
|
|
35
|
+
secrets: [],
|
|
36
|
+
tools: [],
|
|
37
|
+
integrations: [
|
|
38
|
+
composioManaged({
|
|
39
|
+
toolkits: ["gmail", "googlecalendar"],
|
|
40
|
+
tools: {
|
|
41
|
+
gmail: ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"],
|
|
42
|
+
googlecalendar: [
|
|
43
|
+
"GOOGLECALENDAR_EVENTS_LIST",
|
|
44
|
+
"GOOGLECALENDAR_CREATE_EVENT",
|
|
45
|
+
"GOOGLECALENDAR_UPDATE_EVENT",
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
confirmExternalWrites: true,
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
access: {
|
|
52
|
+
mode: "private",
|
|
53
|
+
},
|
|
54
|
+
storage: {
|
|
55
|
+
driver: "agentkit",
|
|
56
|
+
database: {
|
|
57
|
+
driver: "turso",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Deploy
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
agentkit login --token agk_user_...
|
|
67
|
+
agentkit deploy doctor
|
|
68
|
+
agentkit deploy
|
|
69
|
+
agentkit integrations status --toolkit googlecalendar
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Expected readiness:
|
|
73
|
+
|
|
74
|
+
- `cloudflare_deploy_alpha` is active.
|
|
75
|
+
- `managed_composio` is active.
|
|
76
|
+
- `COMPOSIO_API_KEY` appears as an AgentKit-managed secret, not a user-managed hosted secret.
|
|
77
|
+
|
|
78
|
+
## Connect Apps
|
|
79
|
+
|
|
80
|
+
After deploy, create a hosted Composio Connect Link:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
agentkit integrations connect composio --toolkit gmail
|
|
84
|
+
agentkit integrations connect composio --toolkit googlecalendar
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
AgentKit prints a URL. Send that URL to the person who owns the app account.
|
|
88
|
+
|
|
89
|
+
If the deploy has only one toolkit, `--toolkit` can be omitted.
|
|
90
|
+
|
|
91
|
+
## Calendar Defaults
|
|
92
|
+
|
|
93
|
+
For Google Calendar agents, include read and write actions together. Do not expose only `GOOGLECALENDAR_CREATE_EVENT`; users naturally ask to see availability before booking.
|
|
94
|
+
|
|
95
|
+
Use these starter actions:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
googlecalendar: [
|
|
99
|
+
"GOOGLECALENDAR_EVENTS_LIST",
|
|
100
|
+
"GOOGLECALENDAR_CREATE_EVENT",
|
|
101
|
+
"GOOGLECALENDAR_UPDATE_EVENT",
|
|
102
|
+
]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`GOOGLECALENDAR_CREATE_EVENT` requires extra care:
|
|
106
|
+
|
|
107
|
+
- `start_datetime` must be explicit UTC RFC3339, such as `2026-06-03T15:00:00Z` for 12:00 in `America/Sao_Paulo`.
|
|
108
|
+
- `event_duration_minutes` or `event_duration_hour` must be explicit. AgentKit blocks the implicit Composio default because `event_duration_minutes` defaults to 30.
|
|
109
|
+
- Confirm the final title, date, local time, duration, timezone, and attendees/location when relevant before creating or updating an event.
|
|
110
|
+
|
|
111
|
+
## Write Confirmation
|
|
112
|
+
|
|
113
|
+
Managed Composio requires confirmation for external write actions by default. For actions such as create, update, delete, send, patch, move, insert, clear, remove, import, or quick add, the generated `agentkit_composio_execute` tool requires `confirmed: true`.
|
|
114
|
+
|
|
115
|
+
Set `confirmed: true` only after the user confirms the exact external change. If a capsule intentionally handles confirmation elsewhere, disable this guard explicitly:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
composioManaged({
|
|
119
|
+
toolkits: ["googlecalendar"],
|
|
120
|
+
tools: {
|
|
121
|
+
googlecalendar: ["GOOGLECALENDAR_EVENTS_LIST", "GOOGLECALENDAR_CREATE_EVENT"],
|
|
122
|
+
},
|
|
123
|
+
confirmExternalWrites: false,
|
|
124
|
+
})
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Verification
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
agentkit inspect
|
|
131
|
+
agentkit build --target cloudflare
|
|
132
|
+
agentkit deploy doctor
|
|
133
|
+
agentkit integrations status --toolkit googlecalendar
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Expected:
|
|
137
|
+
|
|
138
|
+
- `inspect.integrations[0].provider` is `composio`.
|
|
139
|
+
- `inspect.tools` includes `agentkit_composio_execute` when allowed actions are configured.
|
|
140
|
+
- Build manifest includes `integrations`.
|
|
141
|
+
- Build manifest includes `COMPOSIO_API_KEY`.
|
|
142
|
+
- `deploy doctor` does not ask the user to set `COMPOSIO_API_KEY`.
|
|
143
|
+
- `deploy doctor` reports each configured toolkit auth config as present before the connect link flow.
|
|
144
|
+
|
|
145
|
+
## Troubleshooting
|
|
146
|
+
|
|
147
|
+
`managed_composio_entitlement_required`:
|
|
148
|
+
|
|
149
|
+
Log in with a paid AgentKit Cloud account that has `managed_composio`.
|
|
150
|
+
|
|
151
|
+
`managed_composio_auth_config_missing`:
|
|
152
|
+
|
|
153
|
+
The AgentKit Cloud account is entitled, but the requested toolkit is not available for managed Composio yet. Report the exact error code and toolkit slug to the AgentKit owner.
|
|
154
|
+
|
|
155
|
+
`managed_composio_not_configured`:
|
|
156
|
+
|
|
157
|
+
Managed Composio is not available for this AgentKit Cloud environment. Use BYO `defineTool` wrappers for now or ask the owner to enable managed Composio for the account.
|
|
158
|
+
|
|
159
|
+
`integration_toolkit_required`:
|
|
160
|
+
|
|
161
|
+
The deploy has multiple configured toolkits. Re-run connect with `--toolkit <slug>`.
|
|
@@ -2,52 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
## Goal
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Configure website, Telegram, and WhatsApp channels without leaking secrets, storing raw provider payloads, or treating public webhook URLs as authorization.
|
|
6
6
|
|
|
7
7
|
## When To Use It
|
|
8
8
|
|
|
9
|
-
Use this
|
|
9
|
+
Use this when a coding agent adds or changes channels in an Agent Capsule, enables audio transcription, inspects deliveries, or prepares a hosted deploy that receives provider webhooks.
|
|
10
10
|
|
|
11
11
|
## Commands
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
14
|
agentkit inspect
|
|
15
15
|
agentkit channels status <name>
|
|
16
|
+
agentkit channels doctor <name>
|
|
17
|
+
agentkit channels deliveries list <name> --since 24h
|
|
16
18
|
agentkit channels deliveries show <delivery-id>
|
|
17
|
-
bun test packages/agentkit/src/runtime/channels/adapters.test.ts
|
|
18
|
-
bun test packages/agentkit/src/runtime/transcription.test.ts
|
|
19
|
-
bun test packages/agentkit/src/runtime/deploy.test.ts
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
Real-provider gates are opt-in:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
AGENTKIT_RUN_TELEGRAM_CHANNEL_TESTS=1 bun test
|
|
26
|
-
AGENTKIT_RUN_ZAPSTER_CHANNEL_TESTS=1 bun test
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Telegram smoke also requires `TELEGRAM_BOT_TOKEN`, `TELEGRAM_WEBHOOK_SECRET`, and `AGENTKIT_TELEGRAM_WEBHOOK_URL`.
|
|
30
|
-
|
|
31
|
-
Zapster smoke also requires `ZAPSTER_API_KEY`, `ZAPSTER_INSTANCE_ID`, and `AGENTKIT_ZAPSTER_TO`. `AGENTKIT_ZAPSTER_SEND_URL` is optional and defaults to `https://api.zapsterapi.com/v1/wa/messages`.
|
|
32
|
-
|
|
33
21
|
## Files Created Or Edited
|
|
34
22
|
|
|
35
|
-
- `agentkit.config.ts`: secret names only.
|
|
36
|
-
-
|
|
37
|
-
-
|
|
23
|
+
- `agentkit.config.ts`: channel names, provider choices, audio/buffer config, and secret names only.
|
|
24
|
+
- `.env.schema`: local secret names only when the capsule needs a local provider or local smoke.
|
|
25
|
+
- `.env`: local-only secret values; do not commit it.
|
|
26
|
+
- Hosted managed secrets: production secret values with no readback.
|
|
38
27
|
|
|
39
28
|
## Safety Rules
|
|
40
29
|
|
|
41
30
|
- Public webhook URLs are not permission grants.
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
- Do not store raw webhook bodies in
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- Prefer acknowledging Telegram/WhatsApp over retry storms when a channel-level limit is exceeded.
|
|
50
|
-
- Keep audio duration and byte limits bounded before provider calls to avoid uncontrolled transcription spend.
|
|
31
|
+
- Keep provider tokens, webhook secrets, bot tokens, transcription keys, and bearer tokens out of source files.
|
|
32
|
+
- Put secret names in `agentkit.config.ts`; put local values in ignored `.env`; upload production values with `agentkit secret set` or `agentkit secret sync`.
|
|
33
|
+
- Do not store raw webhook bodies, raw audio, or provider secret values in tools, prompts, evals, fixtures, or delivery notes.
|
|
34
|
+
- Inspect delivery IDs, hashes, redacted metadata, and statuses instead of raw provider payloads.
|
|
35
|
+
- Keep channel plumbing out of the agent's application database. The user's Turso tables are for the agent's business data.
|
|
36
|
+
- Enable audio transcription only when the capsule declares a transcription provider and bounded `limits`.
|
|
37
|
+
- Keep channel buffer limits bounded so bursty client messages cannot create unbounded runs or provider spend.
|
|
51
38
|
|
|
52
39
|
## Minimal Working Example
|
|
53
40
|
|
|
@@ -81,7 +68,7 @@ export default defineAgent({
|
|
|
81
68
|
});
|
|
82
69
|
```
|
|
83
70
|
|
|
84
|
-
The config contains secret names only. Hosted responses report:
|
|
71
|
+
The config contains secret names only. Hosted responses report status, not values:
|
|
85
72
|
|
|
86
73
|
```txt
|
|
87
74
|
TELEGRAM_BOT_TOKEN: set
|
|
@@ -92,22 +79,32 @@ GROQ_API_KEY: set
|
|
|
92
79
|
## Verification
|
|
93
80
|
|
|
94
81
|
```sh
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
npm run
|
|
82
|
+
npm run agentkit -- inspect
|
|
83
|
+
npm run agentkit -- deploy doctor
|
|
84
|
+
npm run agentkit -- channels status <name>
|
|
85
|
+
npm run agentkit -- channels doctor <name>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For a synthetic channel smoke after deploy:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npm run agentkit -- channels test <name> --message "hello"
|
|
92
|
+
npm run agentkit -- channels deliveries list <name> --since 1h
|
|
99
93
|
```
|
|
100
94
|
|
|
101
95
|
## Troubleshooting
|
|
102
96
|
|
|
103
97
|
Secret value appears in output:
|
|
104
|
-
Stop and
|
|
98
|
+
Stop and remove the value from source, fixtures, prompts, evals, and delivery notes. Hosted delivery APIs must not return secret values.
|
|
105
99
|
|
|
106
100
|
Phone number appears in delivery logs:
|
|
107
|
-
|
|
101
|
+
Use the redacted delivery metadata and avoid pasting full phone numbers into committed fixtures.
|
|
102
|
+
|
|
103
|
+
`channel_secret_missing`:
|
|
104
|
+
Set the named hosted secret with `agentkit secret set <NAME> --from-local-env` or `agentkit secret sync --from-local`.
|
|
108
105
|
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
`channel_signature_invalid`:
|
|
107
|
+
Check that the provider webhook secret/token configured in the provider dashboard matches the hosted secret name declared by the channel.
|
|
111
108
|
|
|
112
|
-
Raw audio
|
|
113
|
-
|
|
109
|
+
Raw audio appears in files or logs:
|
|
110
|
+
Remove it. AgentKit may pass transcript text into the normalized agent message after successful transcription, but raw audio belongs outside committed capsule files.
|
|
@@ -141,6 +141,8 @@ Against AgentKit Cloud, `--apply` runs through the Cloud API and uses managed ho
|
|
|
141
141
|
```sh
|
|
142
142
|
agentkit channels status support-telegram
|
|
143
143
|
agentkit channels test support-telegram --message "hello"
|
|
144
|
+
agentkit channels test-audio support-telegram --fixture voice-note
|
|
145
|
+
agentkit transcribe smoke --provider groq
|
|
144
146
|
agentkit channels deliveries show <delivery-id>
|
|
145
147
|
```
|
|
146
148
|
|
|
@@ -165,4 +167,4 @@ The update is malformed or is not a supported private text message.
|
|
|
165
167
|
Set `GROQ_API_KEY` or the custom secret named in `transcription.secret` as a managed hosted secret.
|
|
166
168
|
|
|
167
169
|
`transcription_audio_format_unsupported`:
|
|
168
|
-
The configured transcription provider does not accept the Telegram file format. Use Groq for OGG/Opus voice notes in V1.
|
|
170
|
+
The configured transcription provider does not accept the Telegram file format. Use Groq for OGG/Opus voice notes in V1. `agentkit inspect` warns when a Telegram channel uses `audio.mode: "transcribe"` with OpenAI transcription.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Debug A Channel
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Diagnose website, Telegram, or WhatsApp channel setup, webhook validation, dedupe, buffering, outbound sends, and delivery failures from the Agent Capsule CLI.
|
|
6
|
+
|
|
7
|
+
## When To Use It
|
|
8
|
+
|
|
9
|
+
Use this when a hosted channel is not responding, a provider is retrying messages, audio transcription is failing, or delivery status does not match the user's expectation.
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
agentkit channels list
|
|
15
|
+
agentkit channels status <name>
|
|
16
|
+
agentkit channels doctor <name>
|
|
17
|
+
agentkit channels test <name> --message "hello"
|
|
18
|
+
agentkit channels test-audio <name> --fixture voice-note
|
|
19
|
+
agentkit transcribe smoke --provider groq
|
|
20
|
+
agentkit channels test <name> --fixture ./fixtures/provider-event.json
|
|
21
|
+
agentkit channels deliveries list <name> --since 24h
|
|
22
|
+
agentkit channels deliveries show <delivery-id>
|
|
23
|
+
agentkit channels buffers list <name>
|
|
24
|
+
agentkit channels buffers show <conversation-id>
|
|
25
|
+
agentkit channels buffers flush <conversation-id>
|
|
26
|
+
agentkit channels buffers clear <conversation-id>
|
|
27
|
+
agentkit channels buffers retry <conversation-id>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Files Created Or Edited
|
|
31
|
+
|
|
32
|
+
Debugging should not require source edits. Use fixtures only when reproducing provider payload shape, and never commit provider secrets, full phone numbers, raw audio, or private client data.
|
|
33
|
+
|
|
34
|
+
## Delivery States
|
|
35
|
+
|
|
36
|
+
```txt
|
|
37
|
+
received
|
|
38
|
+
validated
|
|
39
|
+
duplicate
|
|
40
|
+
audio_received
|
|
41
|
+
audio_downloaded
|
|
42
|
+
transcribing
|
|
43
|
+
transcribed
|
|
44
|
+
buffered
|
|
45
|
+
queued
|
|
46
|
+
running
|
|
47
|
+
agent_completed
|
|
48
|
+
provider_request_built
|
|
49
|
+
provider_sent
|
|
50
|
+
adapter_stubbed
|
|
51
|
+
delivered
|
|
52
|
+
provider_failed
|
|
53
|
+
failed
|
|
54
|
+
dead_lettered
|
|
55
|
+
skipped
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Minimal Working Example
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
agentkit channels test support-telegram --message "hello"
|
|
62
|
+
agentkit channels deliveries list support-telegram --since 1h
|
|
63
|
+
agentkit channels deliveries show del_123
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Expected `show` output includes signature status, dedupe key, queue/run state, outbound provider request ID when available, and a normalized error envelope.
|
|
67
|
+
|
|
68
|
+
## Safety Rules
|
|
69
|
+
|
|
70
|
+
- Inspect delivery IDs, hashes, statuses, and redacted metadata rather than raw provider payloads.
|
|
71
|
+
- Never paste provider secrets into fixtures or prompts.
|
|
72
|
+
- Treat `adapter_stubbed` as a dry-run send, not proof that a client received a message.
|
|
73
|
+
- Before replaying or flushing buffered conversations, confirm the channel name and conversation ID.
|
|
74
|
+
- Keep local `.env` values ignored and upload hosted production values through AgentKit secret commands.
|
|
75
|
+
|
|
76
|
+
## Troubleshooting By Error Code
|
|
77
|
+
|
|
78
|
+
`channel_not_found`:
|
|
79
|
+
The webhook URL points to an unknown or deleted channel. Stable hosted URLs use the channel name, for example `/channels/support-whatsapp/whatsapp/zapster/webhook`; old `chn_*` URLs are accepted only for compatibility.
|
|
80
|
+
|
|
81
|
+
`agentkit channels test <name>` is the official synthetic smoke. If it fails while `channels list`, `status`, or `doctor` find the channel, rerun against the current deploy state in `.agentkit/deploy.json`.
|
|
82
|
+
|
|
83
|
+
`channel_disabled`:
|
|
84
|
+
The channel was disabled. Re-add or recreate it.
|
|
85
|
+
|
|
86
|
+
`channel_secret_missing`:
|
|
87
|
+
The hosted secret metadata says a required channel secret is missing. Set it with `agentkit secret set <NAME> --from-local-env` or `agentkit secret sync --from-local`.
|
|
88
|
+
|
|
89
|
+
`channel_signature_invalid`:
|
|
90
|
+
Provider authenticity validation failed. Check the provider webhook secret, token, or origin settings.
|
|
91
|
+
|
|
92
|
+
`channel_payload_invalid`:
|
|
93
|
+
The provider payload is malformed or does not match the route provider.
|
|
94
|
+
|
|
95
|
+
`audio_received`:
|
|
96
|
+
The webhook contained a supported audio message and the channel is entering the audio handling path.
|
|
97
|
+
|
|
98
|
+
`audio_downloaded`:
|
|
99
|
+
The retryable channel worker downloaded the provider media file into memory. The delivery metadata should include only redacted size, MIME, and provider IDs.
|
|
100
|
+
|
|
101
|
+
`transcribing`:
|
|
102
|
+
AgentKit is calling the configured transcription provider with the user's managed transcription secret.
|
|
103
|
+
|
|
104
|
+
`transcribed`:
|
|
105
|
+
Transcription succeeded and the queued agent message contains transcript text instead of raw audio.
|
|
106
|
+
|
|
107
|
+
`channel_event_duplicate` or `duplicate`:
|
|
108
|
+
The provider retried an already-processed event. No second agent run should be created.
|
|
109
|
+
|
|
110
|
+
`buffered`:
|
|
111
|
+
The message is accepted and waiting inside a per-conversation channel buffer. It should move to `queued` after the quiet window, max wait, max message count, or max character count.
|
|
112
|
+
|
|
113
|
+
`adapter_stubbed`:
|
|
114
|
+
The adapter built the outbound request in explicit dry-run mode. The provider was not called.
|
|
115
|
+
|
|
116
|
+
`provider_sent`:
|
|
117
|
+
The provider API accepted the outbound request and returned a provider message ID.
|
|
118
|
+
|
|
119
|
+
`channel_limit_exceeded`:
|
|
120
|
+
Backpressure skipped the message before queueing.
|
|
121
|
+
|
|
122
|
+
`channel_audio_download_unavailable`:
|
|
123
|
+
The channel provider reported audio but did not include enough metadata for AgentKit to download it.
|
|
124
|
+
|
|
125
|
+
`transcription_secret_missing`:
|
|
126
|
+
The transcription provider secret declared in `agentkit inspect` is not set as a managed hosted secret.
|
|
127
|
+
|
|
128
|
+
`transcription_audio_too_large` or `transcription_audio_too_long`:
|
|
129
|
+
The audio exceeded `transcription.limits` or the channel-level `audio.limits`.
|
|
130
|
+
|
|
131
|
+
`transcription_audio_format_unsupported`:
|
|
132
|
+
The configured transcription provider does not accept this audio MIME type or file extension.
|
|
133
|
+
|
|
134
|
+
`transcription_provider_unavailable`:
|
|
135
|
+
The transcription provider returned a retryable error, usually HTTP 429 or a server-side failure.
|
|
136
|
+
|
|
137
|
+
`channel_provider_unavailable`:
|
|
138
|
+
The agent run or provider send path failed with a retryable provider condition.
|
|
139
|
+
|
|
140
|
+
`channel_delivery_dead_lettered`:
|
|
141
|
+
The queue exhausted retries. Inspect the delivery and replay manually only after fixing the cause.
|
|
@@ -25,7 +25,7 @@ npm run agentkit -- db migrate
|
|
|
25
25
|
npm run chat -- --message "hello"
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
All scaffold, local dev, chat, eval, inspect, database, and build commands are token-free.
|
|
28
|
+
All scaffold, local dev, chat, eval, inspect, database, and build commands are token-free. Hosted production deploy and hosted AgentKit Cloud changes require an invited AgentKit Cloud token:
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
npm run agentkit -- login --token agk_user_...
|
|
@@ -134,7 +134,7 @@ npm run agentkit -- chat-ui --deploy
|
|
|
134
134
|
npm run agentkit -- access token list
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
For private hosted deploys, `npm run agentkit -- deploy` writes the local chat/UI access token to `.agentkit/chat-access-token.json`. Use `npm run agentkit -- deploy --smoke "hello"` for the official hosted chat smoke, and use `npm run agentkit -- chat-ui --deploy` for hosted UI testing. Use `npm run agentkit -- access token create <name> --out <path>` only for additional clients.
|
|
137
|
+
For private hosted deploys, `npm run agentkit -- deploy` writes the local chat/UI access token to `.agentkit/chat-access-token.json`. Use `npm run agentkit -- deploy --smoke "hello"` for the official hosted chat smoke, and use `npm run agentkit -- chat-ui --deploy` for hosted UI testing. The hosted Chat UI shows the conversation id, tool calls, tool errors, and a new-conversation control; use `npm run agentkit -- conversations trace <conversation-id> --deploy` to pull the hosted trace from the last deploy. Use `npm run agentkit -- access token create <name> --out <path>` only for additional clients.
|
|
138
138
|
|
|
139
139
|
When the UI is running, open the printed `Chat:` URL and tell the owner the exact URL. If the capsule is still on `test/fake`, say the UI was tested only with the deterministic fake provider.
|
|
140
140
|
|
|
@@ -147,6 +147,7 @@ All required secret names are declared
|
|
|
147
147
|
Prompt path exists
|
|
148
148
|
Tools have input schemas
|
|
149
149
|
Dangerous tools have permissions
|
|
150
|
+
Managed Composio toolkit auth configs are present when configured
|
|
150
151
|
Provider model is supported by AgentKit
|
|
151
152
|
schema.sql is idempotent
|
|
152
153
|
README/AGENTS/CLAUDE match the capsule
|
|
@@ -172,7 +173,7 @@ echo 'OPENAI_API_KEY=sk-...' >> .env
|
|
|
172
173
|
|
|
173
174
|
Missing hosted secret:
|
|
174
175
|
|
|
175
|
-
Set the secret in AgentKit Cloud
|
|
176
|
+
Set the secret in AgentKit Cloud:
|
|
176
177
|
|
|
177
178
|
```sh
|
|
178
179
|
npm run agentkit -- secret set OPENAI_API_KEY --from-local-env
|
|
@@ -192,7 +193,9 @@ Before a hosted production deploy, run:
|
|
|
192
193
|
npm run agentkit -- deploy doctor
|
|
193
194
|
```
|
|
194
195
|
|
|
195
|
-
The doctor checks AgentKit Cloud login, alpha deploy entitlement, online deploy capacity, declared hosted secrets, local `.env` names that have not been uploaded with `agentkit secret set`, and private-access runtime token handling. `agentkit deploy` runs the same readiness check automatically before building and uploading the artifact.
|
|
196
|
+
The doctor checks AgentKit Cloud login, Node version, alpha deploy entitlement, online deploy capacity, declared hosted secrets, local `.env` names that have not been uploaded with `npm run agentkit -- secret set`, and private-access runtime token handling. `agentkit deploy` runs the same readiness check automatically before building and uploading the artifact.
|
|
197
|
+
|
|
198
|
+
If the capsule configures `composioManaged({...})`, the doctor also checks the paid `managed_composio` entitlement. `COMPOSIO_API_KEY` is AgentKit-managed in this path; the user must not set it with `agentkit secret set`.
|
|
196
199
|
|
|
197
200
|
`alpha_access_required`:
|
|
198
201
|
|
|
@@ -201,9 +204,3 @@ Log in with an invited alpha account:
|
|
|
201
204
|
```sh
|
|
202
205
|
npm run agentkit -- login --token agk_user_...
|
|
203
206
|
```
|
|
204
|
-
|
|
205
|
-
## Operator Notes
|
|
206
|
-
|
|
207
|
-
This section is for AgentKit maintainers, not for capsule-building agents.
|
|
208
|
-
|
|
209
|
-
`agentkit deploy` sends the capsule artifact to the configured AgentKit Cloud API. The control plane owns infrastructure selection, provisioning, managed secrets, and public URL creation. Use `AGENTKIT_CLOUD_API_URL` only when testing a non-default control plane.
|
package/docs/llms-full.txt
CHANGED
|
@@ -51,13 +51,19 @@ agentkit db seed [--file <path>]
|
|
|
51
51
|
agentkit eval run
|
|
52
52
|
agentkit conversations list
|
|
53
53
|
agentkit conversations show <conversation-id>
|
|
54
|
+
agentkit conversations trace <conversation-id> [--deploy]
|
|
54
55
|
agentkit channels list
|
|
55
56
|
agentkit channels add <website|telegram|whatsapp> <name> [--provider zapster|meta] [--api <url>]
|
|
56
57
|
agentkit channels setup <name> [--apply] [--api <url>]
|
|
57
58
|
agentkit channels status <name> [--api <url>]
|
|
58
59
|
agentkit channels test <name> [--message <text>] [--fixture <path>] [--api <url>]
|
|
60
|
+
agentkit channels test-audio <name> [--fixture voice-note|audio-file|<path>] [--api <url>]
|
|
59
61
|
agentkit channels deliveries list <name> [--api <url>]
|
|
60
62
|
agentkit channels deliveries show <delivery-id> [--api <url>]
|
|
63
|
+
agentkit integrations status [--toolkit <slug>] [--api <url>]
|
|
64
|
+
agentkit integrations connect composio [--toolkit <slug>] [--callback-url <url>] [--api <url>]
|
|
65
|
+
agentkit skills status
|
|
66
|
+
agentkit skills sync
|
|
61
67
|
agentkit inspect
|
|
62
68
|
agentkit build [--target cloudflare|container]
|
|
63
69
|
agentkit login --token <token>
|
|
@@ -68,6 +74,7 @@ agentkit deploy smoke [--message <text>] [--api <url>]
|
|
|
68
74
|
agentkit deploy status
|
|
69
75
|
agentkit deploy pause
|
|
70
76
|
agentkit deploy resume
|
|
77
|
+
agentkit transcribe smoke [--provider test|openai|groq] [--model <model>] [--fixture <audio-file>]
|
|
71
78
|
agentkit secret set <NAME> <VALUE>
|
|
72
79
|
agentkit secret set <NAME> --stdin
|
|
73
80
|
agentkit secret set <NAME> --from-env [ENV_NAME]
|
|
@@ -93,6 +100,8 @@ agentkit help commands
|
|
|
93
100
|
|
|
94
101
|
Prefer `env set --stdin` or `--from-env` for local secret values, and prefer `secret set --stdin`, `--from-env`, or `--from-local-env` for hosted secrets. Inline `<VALUE>` forms exist for simple non-sensitive values, but agents should avoid putting secrets in shell history.
|
|
95
102
|
|
|
103
|
+
Managed Composio is configured with `composioManaged({...})` in `agentkit.config.ts` and is paid hosted AgentKit infrastructure. It requires a non-anonymous AgentKit Cloud deploy with `managed_composio`, uses one Composio settings profile per agent, injects `COMPOSIO_API_KEY` as an AgentKit-managed secret, validates toolkit auth configs during `agentkit deploy doctor`, and exposes the generated `agentkit_composio_execute` tool only for explicit configured action slugs. Calendar starters should include `GOOGLECALENDAR_EVENTS_LIST`, `GOOGLECALENDAR_CREATE_EVENT`, and `GOOGLECALENDAR_UPDATE_EVENT`; create-event calls must pass UTC `start_datetime` plus explicit duration. Managed external write actions require tool input `confirmed: true` by default unless the integration sets `confirmExternalWrites: false`. See `docs/guides/add-managed-composio.md`.
|
|
104
|
+
|
|
96
105
|
Planned commands described by the contract but not implemented yet:
|
|
97
106
|
|
|
98
107
|
```sh
|
|
@@ -372,7 +381,6 @@ Useful guides:
|
|
|
372
381
|
- Connect WhatsApp through Zapster: `docs/guides/connect-whatsapp-zapster.md`
|
|
373
382
|
- Debug a channel: `docs/guides/debug-channel.md`
|
|
374
383
|
- Channel security: `docs/guides/channel-security.md`
|
|
375
|
-
- Production handoff: `docs/guides/channels-production-handoff.md`
|
|
376
384
|
|
|
377
385
|
Telegram required secrets:
|
|
378
386
|
|
|
@@ -398,11 +406,13 @@ agentkit channels list
|
|
|
398
406
|
agentkit channels add telegram support-telegram
|
|
399
407
|
agentkit channels setup support-telegram
|
|
400
408
|
agentkit channels test support-telegram --message "hello"
|
|
409
|
+
agentkit channels test-audio support-telegram --fixture voice-note
|
|
410
|
+
agentkit transcribe smoke --provider groq
|
|
401
411
|
agentkit channels deliveries list support-telegram
|
|
402
412
|
agentkit channels deliveries show <delivery-id>
|
|
403
413
|
```
|
|
404
414
|
|
|
405
|
-
`channels setup` is read-only by default. `channels setup <telegram-name> --apply` calls Telegram `setWebhook` and requires `TELEGRAM_BOT_TOKEN` plus `TELEGRAM_WEBHOOK_SECRET`.
|
|
415
|
+
`channels connect` creates or refreshes the channel resource, validates secrets, runs provider setup when supported, then runs the official synthetic smoke. `channels setup` is read-only by default. `channels setup <telegram-name> --apply` calls Telegram `setWebhook` and requires `TELEGRAM_BOT_TOKEN` plus `TELEGRAM_WEBHOOK_SECRET`.
|
|
406
416
|
|
|
407
417
|
Default tests are offline. Real provider smoke tests are opt-in:
|
|
408
418
|
|
|
@@ -675,6 +685,7 @@ GET /_agentkit
|
|
|
675
685
|
POST /v1/chat
|
|
676
686
|
GET /v1/conversations
|
|
677
687
|
GET /v1/conversations/:id
|
|
688
|
+
GET /v1/conversations/:id/trace
|
|
678
689
|
```
|
|
679
690
|
|
|
680
691
|
Chat request:
|
|
@@ -694,6 +705,7 @@ After chat:
|
|
|
694
705
|
```sh
|
|
695
706
|
agentkit conversations list
|
|
696
707
|
agentkit conversations show <conversation-id>
|
|
708
|
+
agentkit conversations trace <conversation-id>
|
|
697
709
|
```
|
|
698
710
|
|
|
699
711
|
List output columns:
|
|
@@ -702,7 +714,7 @@ List output columns:
|
|
|
702
714
|
id title updated_at messages
|
|
703
715
|
```
|
|
704
716
|
|
|
705
|
-
Show output includes the conversation id, title, updated timestamp, and each message as `role: content`.
|
|
717
|
+
Show output includes the conversation id, title, updated timestamp, and each message as `role: content`. Trace output includes stored messages and tool calls for the conversation.
|
|
706
718
|
|
|
707
719
|
## Evals
|
|
708
720
|
|
|
@@ -786,9 +798,9 @@ agentkit deploy smoke --message "hello"
|
|
|
786
798
|
agentkit chat-ui --deploy
|
|
787
799
|
```
|
|
788
800
|
|
|
789
|
-
`agentkit deploy doctor` checks AgentKit Cloud login, `cloudflare_deploy_alpha`, online deploy capacity, hosted secrets, local `.env` names that still need `agentkit secret set`, and private-access runtime token handling. `agentkit deploy` sends the capsule to AgentKit Cloud, runs the same readiness check automatically before building and uploading, and writes the local chat/UI deploy access token to `.agentkit/chat-access-token.json` for private hosted deploys. `agentkit deploy --smoke "hello"` deploys and then tests `/v1/chat` with the deploy access token. `agentkit deploy smoke --message "hello"` repeats that smoke against the last local deploy. `agentkit chat-ui --deploy` serves a local UI pointed at the hosted deploy using that token without exposing it to browser code. Production alpha deploys require an account with `cloudflare_deploy_alpha`; local commands and dry-run builds do not require login. AgentKit owns infrastructure selection, backend migration, managed secrets, and public URL creation.
|
|
801
|
+
`agentkit deploy doctor` checks AgentKit Cloud login, `cloudflare_deploy_alpha`, online deploy capacity, hosted secrets, local `.env` names that still need `agentkit secret set`, managed Composio API/auth-config readiness by toolkit, and private-access runtime token handling. `agentkit deploy` sends the capsule to AgentKit Cloud, runs the same readiness check automatically before building and uploading, updates the current project deploy slot by default, and writes the local chat/UI deploy access token to `.agentkit/chat-access-token.json` for private hosted deploys. `agentkit deploy --smoke "hello"` deploys and then tests `/v1/chat` with the deploy access token. `agentkit deploy smoke --message "hello"` repeats that smoke against the last local deploy. `agentkit chat-ui --deploy` serves a local UI pointed at the hosted deploy using that token without exposing it to browser code, shows the conversation id and tool calls, and supports starting a new conversation. Use `agentkit conversations trace <conversation-id> --deploy` to pull hosted conversation messages and tool calls from the last deploy. Production alpha deploys require an account with `cloudflare_deploy_alpha`; local commands and dry-run builds do not require login. AgentKit owns infrastructure selection, backend migration, managed secrets, and public URL creation.
|
|
790
802
|
|
|
791
|
-
The CLI defaults to the hosted AgentKit Cloud API at `https://agentkit-cloud.aibuilders.com.br`. Use `AGENTKIT_CLOUD_API_URL` or `agentkit deploy --api <url>` only
|
|
803
|
+
The CLI defaults to the hosted AgentKit Cloud API at `https://agentkit-cloud.aibuilders.com.br`. Use `AGENTKIT_CLOUD_API_URL` or `agentkit deploy --api <url>` only when the owner gives you a non-default AgentKit Cloud API URL.
|
|
792
804
|
|
|
793
805
|
Account/access flow:
|
|
794
806
|
|
|
@@ -796,6 +808,8 @@ Account/access flow:
|
|
|
796
808
|
agentkit secret set OPENAI_API_KEY --from-local-env
|
|
797
809
|
agentkit secret sync --from-local
|
|
798
810
|
agentkit secret list
|
|
811
|
+
agentkit skills status
|
|
812
|
+
agentkit skills sync
|
|
799
813
|
agentkit access token create website-chat --out .agentkit/website-chat-access-token.json
|
|
800
814
|
agentkit access token list
|
|
801
815
|
```
|