@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.
- package/docs/guides/add-channel.md +2 -2
- package/docs/guides/add-managed-composio.md +40 -16
- package/docs/guides/channel-security.md +36 -39
- package/docs/guides/debug-channel.md +141 -0
- package/docs/guides/prepare-deploy.md +5 -10
- package/docs/llms-full.txt +8 -6
- package/docs/llms.txt +5 -3
- package/package.json +1 -3
- package/src/cli/cloud-client.ts +12 -0
- package/src/cli/deploy-chat-ui.ts +146 -3
- package/src/cli/deploy-readiness.ts +54 -1
- package/src/cli/help.ts +6 -6
- package/src/cli/index.ts +69 -4
- package/src/index.ts +4 -0
- package/src/runtime/config.ts +4 -0
- package/src/runtime/core/manifest.ts +2 -0
- package/src/runtime/inspect.ts +1 -0
- package/src/runtime/integrations/composio.ts +168 -2
- package/src/runtime/targets/cloudflare/build.ts +235 -5
- package/src/templates/skills/agentkit-integrations/SKILL.md +11 -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
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# Channels Production Handoff
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
Move Channels from local fake control-plane tests to production safely.
|
|
6
|
-
|
|
7
|
-
## Deployment Order
|
|
8
|
-
|
|
9
|
-
1. Build and typecheck:
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
npm run typecheck
|
|
13
|
-
bun test
|
|
14
|
-
agentkit build --target cloudflare
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. Deploy AgentKit Cloud/control plane with:
|
|
18
|
-
|
|
19
|
-
```txt
|
|
20
|
-
Cloudflare Worker
|
|
21
|
-
Cloudflare Queue for channel jobs
|
|
22
|
-
Durable Object namespace for channel coordination
|
|
23
|
-
R2 bucket for large/raw payload handoff when enabled
|
|
24
|
-
Turso/Postgres control-plane tables for deploys, channels, deliveries, events, and identities
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
3. Set managed secrets:
|
|
28
|
-
|
|
29
|
-
```txt
|
|
30
|
-
OPENAI_API_KEY or another model provider key
|
|
31
|
-
TELEGRAM_BOT_TOKEN
|
|
32
|
-
TELEGRAM_WEBHOOK_SECRET
|
|
33
|
-
ZAPSTER_API_KEY
|
|
34
|
-
ZAPSTER_INSTANCE_ID
|
|
35
|
-
ZAPSTER_WEBHOOK_ID
|
|
36
|
-
META_WHATSAPP_ACCESS_TOKEN
|
|
37
|
-
META_WHATSAPP_APP_SECRET
|
|
38
|
-
META_WHATSAPP_VERIFY_TOKEN
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
4. Create channels:
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
agentkit channels add telegram support-telegram
|
|
45
|
-
agentkit channels add whatsapp support-whatsapp --provider zapster
|
|
46
|
-
agentkit channels setup support-telegram --apply
|
|
47
|
-
agentkit channels connect whatsapp support-whatsapp --provider zapster
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
5. Run smoke checks:
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
agentkit channels status support-telegram
|
|
54
|
-
agentkit channels test support-telegram --message "hello"
|
|
55
|
-
agentkit channels status support-whatsapp
|
|
56
|
-
agentkit channels test support-whatsapp --message "hello"
|
|
57
|
-
agentkit channels deliveries list support-telegram --since 1h
|
|
58
|
-
agentkit channels deliveries list support-whatsapp --since 1h
|
|
59
|
-
agentkit channels buffers list support-whatsapp
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
After deploy, record this exact handoff block:
|
|
63
|
-
|
|
64
|
-
```txt
|
|
65
|
-
Deploy URL: https://<deploy-host>
|
|
66
|
-
Telegram channel URL: https://<deploy-host>/channels/support-telegram/telegram/telegram/webhook
|
|
67
|
-
Zapster channel URL: https://<deploy-host>/channels/support-whatsapp/whatsapp/zapster/webhook
|
|
68
|
-
Required provider webhook settings: Telegram setWebhook URL/secret token; Zapster webhook URL plus optional ZAPSTER_WEBHOOK_TOKEN query parameter
|
|
69
|
-
Required managed secrets: TELEGRAM_BOT_TOKEN, TELEGRAM_WEBHOOK_SECRET, ZAPSTER_API_KEY, ZAPSTER_INSTANCE_ID, ZAPSTER_WEBHOOK_ID
|
|
70
|
-
Smoke commands: agentkit channels doctor <name>; agentkit channels test <name> --message "hello"; agentkit channels test-audio <name> --fixture voice-note for audio channels; agentkit transcribe smoke --provider groq for transcription; agentkit channels deliveries list <name> --since 1h
|
|
71
|
-
Rollback command: curl -X DELETE "$AGENTKIT_CLOUD_API_URL/v1/channels/<channel-id>" -H "Authorization: Bearer $AGENTKIT_CLOUD_API_TOKEN"; then remove provider webhook registration before rolling back the Worker
|
|
72
|
-
Known unverified items: any channel with no real provider inbound, no provider_sent outbound, stale buffers, or AGENTKIT_CHANNEL_SEND_DRY_RUN=1
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Local Fake Versus Real Provider Gates
|
|
76
|
-
|
|
77
|
-
Default tests are offline and must pass without provider credentials:
|
|
78
|
-
|
|
79
|
-
```sh
|
|
80
|
-
bun test
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Real-provider smoke tests are opt-in:
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
AGENTKIT_RUN_TELEGRAM_CHANNEL_TESTS=1 bun test
|
|
87
|
-
AGENTKIT_RUN_ZAPSTER_CHANNEL_TESTS=1 bun test
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Telegram smoke requires `TELEGRAM_BOT_TOKEN`, `TELEGRAM_WEBHOOK_SECRET`, and `AGENTKIT_TELEGRAM_WEBHOOK_URL`.
|
|
91
|
-
|
|
92
|
-
Zapster smoke 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`.
|
|
93
|
-
|
|
94
|
-
## Smoke Checks
|
|
95
|
-
|
|
96
|
-
- Unknown channel ID returns `404` and creates no tenant record.
|
|
97
|
-
- Invalid Telegram signature or Zapster origin headers return `401` and create a failed delivery.
|
|
98
|
-
- Duplicate provider event returns `200` with `duplicate` and creates no second queue job.
|
|
99
|
-
- Accepted inbound text creates one queue job and one outbound delivery.
|
|
100
|
-
- Real outbound success is `provider_sent` and includes a provider message ID. `adapter_stubbed` means dry-run mode built a request but did not call the provider.
|
|
101
|
-
- Buffered inbound bursts stay in `buffered` state, then flush into one queue job and one outbound delivery.
|
|
102
|
-
- Retryable failures dead-letter after the configured retry ceiling.
|
|
103
|
-
- `channel_limit_exceeded` does not create queue backlog.
|
|
104
|
-
|
|
105
|
-
## Rollback
|
|
106
|
-
|
|
107
|
-
- Disable the channel resource first; do not delete delivery history.
|
|
108
|
-
- Remove provider webhook registration if the provider keeps retrying.
|
|
109
|
-
- Roll back the Worker only after queue drain or pause.
|
|
110
|
-
- Keep managed secrets; rotate only if a secret may have leaked.
|
|
111
|
-
|
|
112
|
-
## Production Defaults
|
|
113
|
-
|
|
114
|
-
- Start with conservative per-channel daily message and cost limits.
|
|
115
|
-
- For WhatsApp and Telegram agents that receive rapid client message bursts, start with `buffer.mode: "debounce"`, `quietWindowMs` between `1500` and `2500`, `maxWaitMs` between `8000` and `12000`, and strict `maxMessages`/`maxChars`.
|
|
116
|
-
- Keep raw body storage disabled unless there is an explicit encrypted R2 retention policy.
|
|
117
|
-
- Delivery APIs return hashes and redacted metadata, not payload bodies.
|
|
118
|
-
- Turso remains reserved for the user's agent application data, not AgentKit channel plumbing.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Portable Deploy Release Checklist
|
|
2
|
-
|
|
3
|
-
Run this before merging portable deploy target work.
|
|
4
|
-
|
|
5
|
-
## Tests
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
bun test
|
|
9
|
-
npm run typecheck
|
|
10
|
-
npm run agentkit -- build --target cloudflare
|
|
11
|
-
npm run agentkit -- build --target container
|
|
12
|
-
npm run agentkit -- deploy --target vps --host agent.example.com --dry-run
|
|
13
|
-
docker compose -f .agentkit/build/vps/compose.yaml config
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Smoke
|
|
17
|
-
|
|
18
|
-
- Cloudflare build contains `worker.js`, `wrangler.jsonc`, `durable-object-schema.sql`, and `agent.manifest.json`.
|
|
19
|
-
- Container build contains `server.js`, `Dockerfile`, `migrations/`, and `agent.manifest.json`.
|
|
20
|
-
- VPS build contains `compose.yaml`, `.env.production.example`, `SECRETS.md`, and `PRODUCTION_HANDOFF.md`.
|
|
21
|
-
- `/health`, `/_agentkit`, `/chat`, `/tools/:name`, `/files/:key`, and channel webhook fixtures pass on the local/container runtime.
|
|
22
|
-
|
|
23
|
-
## Secrets
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
rg -n "sk-|OPENAI_API_KEY=.*[A-Za-z0-9]" .agentkit/build || true
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Expected: no secret values. Generated files may contain secret names only.
|
|
30
|
-
|
|
31
|
-
## Production Handoff
|
|
32
|
-
|
|
33
|
-
- Cloudflare deploy has target-aware `.agentkit/deploy.json` with `target`, `runtime`, and `resources`.
|
|
34
|
-
- VPS handoff documents `PORT`, `AGENTKIT_SQLITE_PATH`, reverse proxy expectations, smoke checks, SQLite backup, Postgres upgrade path, and rollback.
|
|
35
|
-
- Rollback command is present in `.agentkit/build/vps/PRODUCTION_HANDOFF.md`.
|
|
36
|
-
|
|
37
|
-
## External Smokes
|
|
38
|
-
|
|
39
|
-
- Cloudflare deployed smoke requires Cloudflare credentials and a provider key.
|
|
40
|
-
- Docker image smoke requires a running Docker daemon.
|
|
41
|
-
- Telegram/Zapster real send smoke requires explicit provider credentials.
|