@andreprado/agentkit 0.1.0-alpha.9 → 0.1.1

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 (122) hide show
  1. package/README.md +18 -1
  2. package/docs/guides/add-channel.md +251 -7
  3. package/docs/guides/add-knowledge.md +10 -0
  4. package/docs/guides/add-managed-composio.md +165 -0
  5. package/docs/guides/add-tool.md +10 -3
  6. package/docs/guides/channel-security.md +162 -32
  7. package/docs/guides/connect-discord.md +178 -0
  8. package/docs/guides/connect-slack.md +126 -0
  9. package/docs/guides/connect-telegram.md +61 -1
  10. package/docs/guides/connect-whatsapp-evolution.md +121 -0
  11. package/docs/guides/connect-whatsapp-uazapi.md +139 -0
  12. package/docs/guides/connect-whatsapp-zapster.md +119 -16
  13. package/docs/guides/create-agent.md +31 -4
  14. package/docs/guides/debug-channel.md +159 -0
  15. package/docs/guides/improve-from-production.md +151 -0
  16. package/docs/guides/prepare-deploy.md +32 -14
  17. package/docs/guides/replay-production-traces.md +72 -0
  18. package/docs/guides/run-evals.md +95 -25
  19. package/docs/guides/security-rules.md +9 -5
  20. package/docs/guides/send-feedback.md +135 -0
  21. package/docs/guides/use-jev.md +67 -0
  22. package/docs/guides/use-provider.md +70 -3
  23. package/docs/llms-full.txt +295 -25
  24. package/docs/llms.txt +54 -7
  25. package/package.json +3 -7
  26. package/src/cli/args.ts +23 -2
  27. package/src/cli/cloud-client.ts +121 -9
  28. package/src/cli/commands/channels.ts +856 -36
  29. package/src/cli/commands/feedback.ts +438 -0
  30. package/src/cli/commands/provider.ts +47 -0
  31. package/src/cli/commands/transcribe.ts +171 -0
  32. package/src/cli/deploy-chat-ui.ts +232 -18
  33. package/src/cli/deploy-readiness.ts +227 -14
  34. package/src/cli/help.ts +67 -9
  35. package/src/cli/index.ts +740 -35
  36. package/src/cli/new-command.ts +41 -0
  37. package/src/cloud/client.ts +4 -3
  38. package/src/cloud/contracts.ts +1 -1
  39. package/src/create-project.ts +18 -35
  40. package/src/index.ts +565 -11
  41. package/src/providers/codex-auth.ts +111 -0
  42. package/src/providers/pi.ts +88 -19
  43. package/src/providers/test.ts +36 -0
  44. package/src/providers/types.ts +8 -0
  45. package/src/runtime/channel-test-harness.ts +21 -1
  46. package/src/runtime/channels/discord.ts +904 -0
  47. package/src/runtime/channels/generic-webhook.ts +682 -0
  48. package/src/runtime/channels/net-guard.ts +480 -0
  49. package/src/runtime/channels/provider-fetch.ts +54 -0
  50. package/src/runtime/channels/slack.ts +652 -0
  51. package/src/runtime/channels/telegram.ts +379 -15
  52. package/src/runtime/channels/whatsapp-evolution.ts +1330 -0
  53. package/src/runtime/channels/whatsapp-meta.ts +9 -0
  54. package/src/runtime/channels/whatsapp-uazapi.ts +1192 -0
  55. package/src/runtime/channels/whatsapp-zapster.ts +702 -40
  56. package/src/runtime/channels.ts +83 -3
  57. package/src/runtime/chat.ts +70 -44
  58. package/src/runtime/config.ts +512 -20
  59. package/src/runtime/core/manifest.ts +75 -5
  60. package/src/runtime/core/targets.ts +5 -5
  61. package/src/runtime/deploy-readiness.ts +34 -4
  62. package/src/runtime/dev-server.ts +639 -39
  63. package/src/runtime/env.ts +8 -3
  64. package/src/runtime/evals.ts +445 -74
  65. package/src/runtime/improve.ts +868 -0
  66. package/src/runtime/inspect.ts +173 -4
  67. package/src/runtime/integrations/composio.ts +425 -0
  68. package/src/runtime/knowledge/embeddings.ts +45 -7
  69. package/src/runtime/knowledge/ingest.ts +69 -6
  70. package/src/runtime/knowledge/retrieve.ts +25 -5
  71. package/src/runtime/knowledge/schema.ts +45 -1
  72. package/src/runtime/knowledge/vector.ts +30 -30
  73. package/src/runtime/prompt-context.ts +141 -0
  74. package/src/runtime/runtime-contract.ts +71 -7
  75. package/src/runtime/skills.ts +95 -0
  76. package/src/runtime/targets/cloudflare/build.ts +1010 -208
  77. package/src/runtime/targets/container/server.ts +1 -1
  78. package/src/runtime/targets/vps/deploy.ts +26 -9
  79. package/src/runtime/tool-runner.ts +9 -1
  80. package/src/runtime/tools.ts +26 -2
  81. package/src/runtime/transcription.ts +483 -0
  82. package/src/storage/sqlite.ts +7 -2
  83. package/src/templates/blank.ts +37 -9
  84. package/src/templates/dentista.ts +40 -14
  85. package/src/templates/skills/agentkit-build-agent/SKILL.md +34 -5
  86. package/src/templates/skills/agentkit-build-agent/templates/appointment-intake.instructions.md +2 -1
  87. package/src/templates/skills/agentkit-capsule/SKILL.md +32 -3
  88. package/src/templates/skills/agentkit-capsule/references/docs-router.md +2 -2
  89. package/src/templates/skills/agentkit-channels/SKILL.md +66 -1
  90. package/src/templates/skills/agentkit-channels/references/channel-buffering.md +8 -1
  91. package/src/templates/skills/agentkit-channels/references/channel-debugging.md +28 -3
  92. package/src/templates/skills/agentkit-channels/references/discord.md +93 -0
  93. package/src/templates/skills/agentkit-channels/references/slack.md +56 -0
  94. package/src/templates/skills/agentkit-channels/references/telegram.md +34 -0
  95. package/src/templates/skills/agentkit-channels/references/whatsapp-evolution.md +57 -0
  96. package/src/templates/skills/agentkit-channels/references/whatsapp-uazapi.md +54 -0
  97. package/src/templates/skills/agentkit-channels/references/whatsapp-zapster.md +42 -8
  98. package/src/templates/skills/agentkit-database/SKILL.md +11 -0
  99. package/src/templates/skills/agentkit-deploy/SKILL.md +9 -1
  100. package/src/templates/skills/agentkit-evals/SKILL.md +77 -13
  101. package/src/templates/skills/agentkit-evals/templates/multi-turn.eval.md +13 -6
  102. package/src/templates/skills/agentkit-evals/templates/no-leak.eval.md +8 -4
  103. package/src/templates/skills/agentkit-evals/templates/smoke.eval.md +8 -4
  104. package/src/templates/skills/agentkit-evals/templates/tool-call.eval.md +16 -7
  105. package/src/templates/skills/agentkit-improve/SKILL.md +96 -0
  106. package/src/templates/skills/agentkit-improve/references/replay-side-effects.md +18 -0
  107. package/src/templates/skills/agentkit-improve/references/trace-packets.md +22 -0
  108. package/src/templates/skills/agentkit-improve/templates/regression.eval.md +18 -0
  109. package/src/templates/skills/agentkit-integrations/SKILL.md +98 -0
  110. package/src/templates/skills/agentkit-knowledge/SKILL.md +4 -1
  111. package/src/templates/skills/agentkit-prompts/SKILL.md +3 -1
  112. package/src/templates/skills/agentkit-provider/SKILL.md +29 -4
  113. package/src/templates/skills/agentkit-security/SKILL.md +5 -2
  114. package/src/templates/skills/agentkit-tools/SKILL.md +8 -1
  115. package/src/templates/skills/agentkit-tools/examples/eval-safe-external-action.tool.md +8 -8
  116. package/src/templates/skills/agentkit-tools/examples/jev-service-fit.tool.md +110 -0
  117. package/src/templates/skills/agentkit-troubleshooting/SKILL.md +25 -1
  118. package/src/templates/support.ts +42 -12
  119. package/docs/guides/agentkit-skills-architecture.md +0 -471
  120. package/docs/guides/channels-implementation-map.md +0 -243
  121. package/docs/guides/channels-production-handoff.md +0 -101
  122. package/docs/portable-deploy-release-checklist.md +0 -41
@@ -1,101 +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_WEBHOOK_SECRET
35
- META_WHATSAPP_ACCESS_TOKEN
36
- META_WHATSAPP_APP_SECRET
37
- META_WHATSAPP_VERIFY_TOKEN
38
- ```
39
-
40
- 4. Create channels:
41
-
42
- ```sh
43
- agentkit channels add telegram support-telegram
44
- agentkit channels add whatsapp support-whatsapp --provider zapster
45
- agentkit channels setup support-telegram --apply
46
- agentkit channels setup support-whatsapp
47
- ```
48
-
49
- 5. Run smoke checks:
50
-
51
- ```sh
52
- agentkit channels status support-telegram
53
- agentkit channels test support-telegram --message "hello"
54
- agentkit channels status support-whatsapp
55
- agentkit channels test support-whatsapp --message "hello"
56
- agentkit channels deliveries list support-telegram --since 1h
57
- ```
58
-
59
- ## Local Fake Versus Real Provider Gates
60
-
61
- Default tests are offline and must pass without provider credentials:
62
-
63
- ```sh
64
- bun test
65
- ```
66
-
67
- Real-provider smoke tests are opt-in:
68
-
69
- ```sh
70
- AGENTKIT_RUN_TELEGRAM_CHANNEL_TESTS=1 bun test
71
- AGENTKIT_RUN_ZAPSTER_CHANNEL_TESTS=1 bun test
72
- ```
73
-
74
- Telegram smoke requires `TELEGRAM_BOT_TOKEN`, `TELEGRAM_WEBHOOK_SECRET`, and `AGENTKIT_TELEGRAM_WEBHOOK_URL`.
75
-
76
- Zapster smoke requires `ZAPSTER_API_KEY`, `AGENTKIT_ZAPSTER_SEND_URL`, and `AGENTKIT_ZAPSTER_TO`.
77
-
78
- ## Smoke Checks
79
-
80
- - Unknown channel ID returns `404` and creates no tenant record.
81
- - Invalid Telegram/Zapster signature returns `401` and creates a failed delivery.
82
- - Duplicate provider event returns `200` with `duplicate` and creates no second queue job.
83
- - Accepted inbound text creates one queue job and one outbound delivery.
84
- - Buffered inbound bursts stay in `buffered` state, then flush into one queue job and one outbound delivery.
85
- - Retryable failures dead-letter after the configured retry ceiling.
86
- - `channel_limit_exceeded` does not create queue backlog.
87
-
88
- ## Rollback
89
-
90
- - Disable the channel resource first; do not delete delivery history.
91
- - Remove provider webhook registration if the provider keeps retrying.
92
- - Roll back the Worker only after queue drain or pause.
93
- - Keep managed secrets; rotate only if a secret may have leaked.
94
-
95
- ## Production Defaults
96
-
97
- - Start with conservative per-channel daily message and cost limits.
98
- - 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`.
99
- - Keep raw body storage disabled unless there is an explicit encrypted R2 retention policy.
100
- - Delivery APIs return hashes and redacted metadata, not payload bodies.
101
- - 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.