@andreprado/agentkit 0.1.0-alpha.17 → 0.1.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +3 -0
  2. package/docs/guides/add-channel.md +14 -8
  3. package/docs/guides/add-knowledge.md +10 -0
  4. package/docs/guides/add-managed-composio.md +43 -17
  5. package/docs/guides/channel-security.md +60 -39
  6. package/docs/guides/connect-discord.md +178 -0
  7. package/docs/guides/create-agent.md +13 -0
  8. package/docs/guides/debug-channel.md +147 -0
  9. package/docs/guides/improve-from-production.md +151 -0
  10. package/docs/guides/prepare-deploy.md +30 -14
  11. package/docs/guides/replay-production-traces.md +72 -0
  12. package/docs/guides/run-evals.md +18 -0
  13. package/docs/guides/security-rules.md +5 -5
  14. package/docs/guides/use-provider.md +11 -1
  15. package/docs/llms-full.txt +106 -15
  16. package/docs/llms.txt +22 -4
  17. package/package.json +1 -3
  18. package/src/cli/args.ts +23 -2
  19. package/src/cli/cloud-client.ts +75 -0
  20. package/src/cli/commands/channels.ts +139 -14
  21. package/src/cli/deploy-chat-ui.ts +146 -3
  22. package/src/cli/deploy-readiness.ts +57 -1
  23. package/src/cli/help.ts +32 -8
  24. package/src/cli/index.ts +447 -17
  25. package/src/create-project.ts +13 -2
  26. package/src/index.ts +46 -3
  27. package/src/providers/pi.ts +49 -15
  28. package/src/runtime/channel-test-harness.ts +4 -1
  29. package/src/runtime/channels/discord.ts +887 -0
  30. package/src/runtime/channels.ts +15 -0
  31. package/src/runtime/config.ts +39 -3
  32. package/src/runtime/core/manifest.ts +2 -0
  33. package/src/runtime/dev-server.ts +149 -8
  34. package/src/runtime/evals.ts +27 -6
  35. package/src/runtime/improve.ts +868 -0
  36. package/src/runtime/inspect.ts +1 -0
  37. package/src/runtime/integrations/composio.ts +168 -2
  38. package/src/runtime/knowledge/retrieve.ts +25 -5
  39. package/src/runtime/knowledge/schema.ts +45 -1
  40. package/src/runtime/runtime-contract.ts +54 -0
  41. package/src/runtime/targets/cloudflare/build.ts +479 -194
  42. package/src/runtime/targets/vps/deploy.ts +1 -1
  43. package/src/storage/sqlite.ts +7 -2
  44. package/src/templates/skills/agentkit-capsule/SKILL.md +8 -1
  45. package/src/templates/skills/agentkit-capsule/references/docs-router.md +1 -2
  46. package/src/templates/skills/agentkit-channels/SKILL.md +6 -1
  47. package/src/templates/skills/agentkit-channels/references/channel-debugging.md +2 -1
  48. package/src/templates/skills/agentkit-channels/references/discord.md +93 -0
  49. package/src/templates/skills/agentkit-deploy/SKILL.md +6 -0
  50. package/src/templates/skills/agentkit-evals/SKILL.md +12 -3
  51. package/src/templates/skills/agentkit-improve/SKILL.md +86 -0
  52. package/src/templates/skills/agentkit-improve/references/replay-side-effects.md +18 -0
  53. package/src/templates/skills/agentkit-improve/references/trace-packets.md +22 -0
  54. package/src/templates/skills/agentkit-improve/templates/regression.eval.md +18 -0
  55. package/src/templates/skills/agentkit-integrations/SKILL.md +12 -2
  56. package/src/templates/skills/agentkit-knowledge/SKILL.md +4 -1
  57. package/src/templates/skills/agentkit-provider/SKILL.md +4 -1
  58. package/src/templates/skills/agentkit-security/SKILL.md +3 -2
  59. package/src/templates/skills/agentkit-troubleshooting/SKILL.md +9 -0
  60. package/src/templates/support.ts +4 -2
  61. package/docs/guides/agentkit-skills-architecture.md +0 -472
  62. package/docs/guides/channels-implementation-map.md +0 -243
  63. package/docs/guides/channels-production-handoff.md +0 -118
  64. 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.