@andreprado/agentkit 0.1.0-alpha.17 → 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.
@@ -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>` with hosted commands when testing against a non-default AgentKit Cloud API.
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 are control-plane owned.
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
@@ -39,8 +39,13 @@ export default defineAgent({
39
39
  toolkits: ["gmail", "googlecalendar"],
40
40
  tools: {
41
41
  gmail: ["GMAIL_FETCH_EMAILS", "GMAIL_SEND_EMAIL"],
42
- googlecalendar: ["GOOGLECALENDAR_CREATE_EVENT"],
42
+ googlecalendar: [
43
+ "GOOGLECALENDAR_EVENTS_LIST",
44
+ "GOOGLECALENDAR_CREATE_EVENT",
45
+ "GOOGLECALENDAR_UPDATE_EVENT",
46
+ ],
43
47
  },
48
+ confirmExternalWrites: true,
44
49
  }),
45
50
  ],
46
51
  access: {
@@ -61,7 +66,7 @@ export default defineAgent({
61
66
  agentkit login --token agk_user_...
62
67
  agentkit deploy doctor
63
68
  agentkit deploy
64
- agentkit integrations status
69
+ agentkit integrations status --toolkit googlecalendar
65
70
  ```
66
71
 
67
72
  Expected readiness:
@@ -83,23 +88,41 @@ AgentKit prints a URL. Send that URL to the person who owns the app account.
83
88
 
84
89
  If the deploy has only one toolkit, `--toolkit` can be omitted.
85
90
 
86
- ## Operator Setup
91
+ ## Calendar Defaults
87
92
 
88
- Trusted AgentKit Cloud operators grant access and configure Composio auth configs:
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.
89
94
 
90
- ```sh
91
- npm run agentkit:operator -- accounts grant user@example.com --managed-composio
95
+ Use these starter actions:
96
+
97
+ ```ts
98
+ googlecalendar: [
99
+ "GOOGLECALENDAR_EVENTS_LIST",
100
+ "GOOGLECALENDAR_CREATE_EVENT",
101
+ "GOOGLECALENDAR_UPDATE_EVENT",
102
+ ]
92
103
  ```
93
104
 
94
- Required control-plane environment:
105
+ `GOOGLECALENDAR_CREATE_EVENT` requires extra care:
95
106
 
96
- ```txt
97
- AGENTKIT_SECRET_COMPOSIO_API_KEY=<project API key>
98
- AGENTKIT_COMPOSIO_AUTH_CONFIG_GMAIL=<auth config id>
99
- AGENTKIT_COMPOSIO_AUTH_CONFIG_GOOGLECALENDAR=<auth config id>
100
- ```
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
101
112
 
102
- Use one `AGENTKIT_COMPOSIO_AUTH_CONFIG_<TOOLKIT>` value per toolkit slug, uppercased with non-alphanumeric characters converted to `_`.
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
+ ```
103
126
 
104
127
  ## Verification
105
128
 
@@ -107,7 +130,7 @@ Use one `AGENTKIT_COMPOSIO_AUTH_CONFIG_<TOOLKIT>` value per toolkit slug, upperc
107
130
  agentkit inspect
108
131
  agentkit build --target cloudflare
109
132
  agentkit deploy doctor
110
- agentkit integrations status
133
+ agentkit integrations status --toolkit googlecalendar
111
134
  ```
112
135
 
113
136
  Expected:
@@ -117,6 +140,7 @@ Expected:
117
140
  - Build manifest includes `integrations`.
118
141
  - Build manifest includes `COMPOSIO_API_KEY`.
119
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.
120
144
 
121
145
  ## Troubleshooting
122
146
 
@@ -126,11 +150,11 @@ Log in with a paid AgentKit Cloud account that has `managed_composio`.
126
150
 
127
151
  `managed_composio_auth_config_missing`:
128
152
 
129
- An operator must set `AGENTKIT_COMPOSIO_AUTH_CONFIG_<TOOLKIT>` on the control plane.
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.
130
154
 
131
155
  `managed_composio_not_configured`:
132
156
 
133
- An operator must set `AGENTKIT_SECRET_COMPOSIO_API_KEY` on the control plane.
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.
134
158
 
135
159
  `integration_toolkit_required`:
136
160
 
@@ -2,52 +2,39 @@
2
2
 
3
3
  ## Goal
4
4
 
5
- Keep channel webhooks, delivery logs, provider sends, and managed secrets safe by default.
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 before adding a channel provider, changing webhook validation, adding delivery logging, or enabling real-provider smoke tests.
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
- - Managed hosted secrets: production secret values, no readback.
37
- - Delivery records: hashes, statuses, provider event IDs, redacted metadata.
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
- - Validate provider authenticity when the provider supports it.
43
- - Do not store channel plumbing in the user's Turso database.
44
- - Do not store raw webhook bodies in delivery records; store a SHA-256 hash.
45
- - Do not store raw audio in delivery records. V1 audio transcription downloads provider media into memory and stores only redacted metadata and state transitions.
46
- - Redact bearer tokens, bot tokens, signing secrets, provider API tokens, and phone numbers.
47
- - Inject only channel-declared secrets into adapter code.
48
- - Inject transcription secrets only when the deploy manifest declares transcription and the channel uses `audio.mode: "transcribe"`.
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
- bun test packages/agentkit/src/runtime/channels/adapters.test.ts
96
- bun test packages/agentkit/src/runtime/transcription.test.ts
97
- bun test packages/agentkit/src/runtime/deploy.test.ts
98
- npm run typecheck
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 add a regression test before changing behavior. Delivery APIs must never return secret values.
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
- Redact it to a stable partial form such as `5511******9999`.
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
- Webhook accepts invalid signatures or origin headers:
110
- Fix `verifyWebhook` for the adapter before enabling provider setup docs.
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 or transcript provider secret appears in output:
113
- Stop and add a regression test before changing behavior. Delivery APIs may include transcript text in normalized agent messages after successful transcription, but must never include raw bytes or provider secret values.
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.
@@ -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. Only hosted production deploy and hosted control-plane mutations require an invited AgentKit Cloud token:
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 or the configured control plane:
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
@@ -194,7 +195,7 @@ npm run agentkit -- deploy doctor
194
195
 
195
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.
196
197
 
197
- 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`. Operators configure `AGENTKIT_SECRET_COMPOSIO_API_KEY` and per-toolkit `AGENTKIT_COMPOSIO_AUTH_CONFIG_<TOOLKIT>` values on the control plane.
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`.
198
199
 
199
200
  `alpha_access_required`:
200
201
 
@@ -203,9 +204,3 @@ Log in with an invited alpha account:
203
204
  ```sh
204
205
  npm run agentkit -- login --token agk_user_...
205
206
  ```
206
-
207
- ## Operator Notes
208
-
209
- This section is for AgentKit maintainers, not for capsule-building agents.
210
-
211
- `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.
@@ -51,6 +51,7 @@ 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>]
@@ -59,7 +60,7 @@ agentkit channels test <name> [--message <text>] [--fixture <path>] [--api <url>
59
60
  agentkit channels test-audio <name> [--fixture voice-note|audio-file|<path>] [--api <url>]
60
61
  agentkit channels deliveries list <name> [--api <url>]
61
62
  agentkit channels deliveries show <delivery-id> [--api <url>]
62
- agentkit integrations status [--api <url>]
63
+ agentkit integrations status [--toolkit <slug>] [--api <url>]
63
64
  agentkit integrations connect composio [--toolkit <slug>] [--callback-url <url>] [--api <url>]
64
65
  agentkit skills status
65
66
  agentkit skills sync
@@ -99,7 +100,7 @@ agentkit help commands
99
100
 
100
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.
101
102
 
102
- 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, and exposes the generated `agentkit_composio_execute` tool only for explicit configured action slugs. See `docs/guides/add-managed-composio.md`.
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`.
103
104
 
104
105
  Planned commands described by the contract but not implemented yet:
105
106
 
@@ -380,7 +381,6 @@ Useful guides:
380
381
  - Connect WhatsApp through Zapster: `docs/guides/connect-whatsapp-zapster.md`
381
382
  - Debug a channel: `docs/guides/debug-channel.md`
382
383
  - Channel security: `docs/guides/channel-security.md`
383
- - Production handoff: `docs/guides/channels-production-handoff.md`
384
384
 
385
385
  Telegram required secrets:
386
386
 
@@ -685,6 +685,7 @@ GET /_agentkit
685
685
  POST /v1/chat
686
686
  GET /v1/conversations
687
687
  GET /v1/conversations/:id
688
+ GET /v1/conversations/:id/trace
688
689
  ```
689
690
 
690
691
  Chat request:
@@ -704,6 +705,7 @@ After chat:
704
705
  ```sh
705
706
  agentkit conversations list
706
707
  agentkit conversations show <conversation-id>
708
+ agentkit conversations trace <conversation-id>
707
709
  ```
708
710
 
709
711
  List output columns:
@@ -712,7 +714,7 @@ List output columns:
712
714
  id title updated_at messages
713
715
  ```
714
716
 
715
- 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.
716
718
 
717
719
  ## Evals
718
720
 
@@ -796,9 +798,9 @@ agentkit deploy smoke --message "hello"
796
798
  agentkit chat-ui --deploy
797
799
  ```
798
800
 
799
- `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.
800
802
 
801
- 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 for local or alternate control-plane tests.
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.
802
804
 
803
805
  Account/access flow:
804
806
 
package/docs/llms.txt CHANGED
@@ -21,9 +21,7 @@ Task guides:
21
21
  - Connect Telegram: `docs/guides/connect-telegram.md`
22
22
  - Connect WhatsApp through Zapster: `docs/guides/connect-whatsapp-zapster.md`
23
23
  - Follow channel webhook and delivery-log safety rules: `docs/guides/channel-security.md`
24
- - Prepare Channels for production: `docs/guides/channels-production-handoff.md`
25
24
  - Follow secret, access, and tool safety rules: `docs/guides/security-rules.md`
26
- - Plan repo-local skills for coding agents: `docs/guides/agentkit-skills-architecture.md`
27
25
 
28
26
  Current local commands:
29
27
 
@@ -44,6 +42,7 @@ agentkit knowledge search <query> [--top-k <number>]
44
42
  agentkit eval run
45
43
  agentkit conversations list
46
44
  agentkit conversations show <conversation-id>
45
+ agentkit conversations trace <conversation-id> [--deploy]
47
46
  agentkit channels list
48
47
  agentkit channels add telegram support-telegram
49
48
  agentkit channels setup support-telegram
@@ -52,7 +51,7 @@ agentkit channels test support-telegram --message "hello"
52
51
  agentkit channels test-audio support-telegram --fixture voice-note
53
52
  agentkit transcribe smoke --provider groq
54
53
  agentkit channels deliveries list support-telegram
55
- agentkit integrations status
54
+ agentkit integrations status [--toolkit googlecalendar]
56
55
  agentkit integrations connect composio --toolkit gmail
57
56
  agentkit skills status
58
57
  agentkit skills sync
@@ -76,6 +75,8 @@ Generated capsules include `AGENTKIT.md`, `AGENTS.md`, and a repo-local `skills/
76
75
 
77
76
  UI testing is part of the handoff. For local UI testing, run `agentkit dev`, open the printed `Chat:` URL, and tell the owner the exact URL. After hosted deploy, run `agentkit chat-ui --deploy`, open the printed `Chat:` URL, and tell the owner it is connected to the deploy.
78
77
 
78
+ Hosted Chat UI shows the current conversation id, tool calls, tool errors, and a new-conversation control. Use `agentkit conversations trace <conversation-id> --deploy` to pull the hosted trace from the last deploy.
79
+
79
80
  `test/fake` is deterministic and validates scaffold, direct tool calls, and fake-provider evals. It does not validate natural conversation quality. Before claiming real conversation behavior has been tested, ask the owner which provider to use: OpenRouter, OpenAI, Anthropic, or another supported provider. Do not choose for them.
80
81
 
81
82
  AgentKit injects the current ISO timestamp, local date, weekday, local date/time, and timezone dynamically into every chat run. Set `timeZone` in `agentkit.config.ts` for scheduling agents so "today", "tomorrow", and weekdays resolve in the business/user timezone; otherwise AgentKit falls back to `AGENTKIT_TIME_ZONE`, valid `TZ`, then the runtime default. Do not hardcode today's date in prompts.
@@ -87,6 +88,7 @@ GET /_agentkit
87
88
  POST /v1/chat
88
89
  GET /v1/conversations
89
90
  GET /v1/conversations/:id
91
+ GET /v1/conversations/:id/trace
90
92
  ```
91
93
 
92
94
  Local `.env` is for development only. Use `.env.schema` as the committed secret-name contract; local AgentKit commands load `.env` directly. Hosted alpha deploys require `cloudflare_deploy_alpha` through `agentkit login --token ...`; production uses managed secrets in the hosted contract.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andreprado/agentkit",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.18",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -18,8 +18,6 @@
18
18
  "!src/**/*.test.ts",
19
19
  "!src/runtime/fixtures",
20
20
  "docs",
21
- "!docs/guides/backend-contracts.md",
22
- "!docs/guides/debug-channel.md",
23
21
  "README.md"
24
22
  ],
25
23
  "publishConfig": {
@@ -39,6 +39,18 @@ export type CloudLimitsResponse = {
39
39
  };
40
40
  };
41
41
 
42
+ export type CloudManagedComposioResponse = {
43
+ managed_composio?: {
44
+ entitlement?: "active" | "missing" | string;
45
+ api_key?: "set" | "missing" | string;
46
+ toolkits?: Array<{
47
+ toolkit?: string;
48
+ auth_config_env?: string;
49
+ auth_config?: "set" | "missing" | string;
50
+ }>;
51
+ };
52
+ };
53
+
42
54
  export type CloudProjectResolveResponse = {
43
55
  project?: {
44
56
  id?: string;