@andreprado/agentkit 0.1.0-alpha.2 → 0.1.0-alpha.20
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 +67 -6
- package/docs/guides/add-channel.md +118 -7
- package/docs/guides/add-knowledge.md +144 -0
- package/docs/guides/add-managed-composio.md +163 -0
- package/docs/guides/add-tool.md +1 -1
- package/docs/guides/channel-security.md +97 -32
- package/docs/guides/connect-discord.md +178 -0
- package/docs/guides/connect-slack.md +126 -0
- package/docs/guides/connect-telegram.md +78 -1
- package/docs/guides/connect-whatsapp-zapster.md +112 -8
- package/docs/guides/create-agent.md +45 -4
- package/docs/guides/debug-channel.md +147 -0
- package/docs/guides/improve-from-production.md +151 -0
- package/docs/guides/prepare-deploy.md +47 -17
- package/docs/guides/replay-production-traces.md +72 -0
- package/docs/guides/run-evals.md +147 -20
- package/docs/guides/security-rules.md +7 -6
- package/docs/guides/send-feedback.md +135 -0
- package/docs/guides/use-provider.md +27 -3
- package/docs/llms-full.txt +303 -55
- package/docs/llms.txt +57 -7
- package/package.json +2 -5
- package/src/cli/args.ts +57 -0
- package/src/cli/cloud-client.ts +377 -0
- package/src/cli/commands/channels.ts +1315 -0
- package/src/cli/commands/feedback.ts +438 -0
- package/src/cli/commands/knowledge.ts +136 -0
- package/src/cli/commands/transcribe.ts +171 -0
- package/src/cli/constants.ts +4 -0
- package/src/cli/deploy-chat-ui.ts +535 -0
- package/src/cli/deploy-readiness.ts +481 -0
- package/src/cli/flags.ts +162 -0
- package/src/cli/help.ts +236 -0
- package/src/cli/index.ts +1167 -1005
- package/src/cli/process.ts +31 -0
- package/src/cloud/artifact.ts +139 -0
- package/src/cloud/client.ts +80 -0
- package/src/cloud/contracts.ts +63 -0
- package/src/cloud/index.ts +3 -0
- package/src/create-project.ts +21 -6
- package/src/index.ts +479 -7
- package/src/providers/pi.ts +70 -16
- package/src/providers/test.ts +88 -1
- package/src/providers/types.ts +7 -0
- package/src/runtime/channel-buffer.ts +30 -0
- package/src/runtime/channel-test-harness.ts +8 -1
- package/src/runtime/channels/discord.ts +896 -0
- package/src/runtime/channels/slack.ts +646 -0
- package/src/runtime/channels/telegram.ts +466 -23
- package/src/runtime/channels/whatsapp-meta.ts +9 -0
- package/src/runtime/channels/whatsapp-zapster.ts +677 -40
- package/src/runtime/channels.ts +86 -3
- package/src/runtime/chat.ts +130 -38
- package/src/runtime/config.ts +483 -18
- package/src/runtime/core/manifest.ts +103 -5
- package/src/runtime/core/targets.ts +5 -5
- package/src/runtime/database.ts +93 -2
- package/src/runtime/db-commands.ts +9 -0
- package/src/runtime/deploy-readiness.ts +46 -4
- package/src/runtime/deploy.ts +1 -1
- package/src/runtime/dev-server.ts +759 -41
- package/src/runtime/env.ts +8 -3
- package/src/runtime/evals.ts +589 -43
- package/src/runtime/improve.ts +868 -0
- package/src/runtime/inspect.ts +194 -4
- package/src/runtime/integrations/composio.ts +423 -0
- package/src/runtime/knowledge/chunk.ts +333 -0
- package/src/runtime/knowledge/config.ts +135 -0
- package/src/runtime/knowledge/embeddings.ts +133 -0
- package/src/runtime/knowledge/ingest.ts +521 -0
- package/src/runtime/knowledge/prompt-policy.ts +30 -0
- package/src/runtime/knowledge/retrieve.ts +303 -0
- package/src/runtime/knowledge/schema.ts +100 -0
- package/src/runtime/knowledge/tool.ts +64 -0
- package/src/runtime/knowledge/vector.ts +258 -0
- package/src/runtime/prompt-context.ts +141 -0
- package/src/runtime/runtime-contract.ts +86 -8
- package/src/runtime/skills.ts +95 -0
- package/src/runtime/spec.ts +152 -0
- package/src/runtime/sync.ts +144 -0
- package/src/runtime/targets/cloudflare/build.ts +1430 -185
- package/src/runtime/targets/container/server.ts +1 -1
- package/src/runtime/targets/vps/deploy.ts +26 -9
- package/src/runtime/tool-runner.ts +9 -1
- package/src/runtime/tools.ts +128 -2
- package/src/runtime/traces.ts +41 -0
- package/src/runtime/transcription.ts +483 -0
- package/src/storage/sqlite.ts +149 -3
- package/src/templates/blank.ts +76 -17
- package/src/templates/dentista.ts +1011 -0
- package/src/templates/index.ts +2 -0
- package/src/templates/skills/agentkit-build-agent/SKILL.md +52 -0
- package/src/templates/skills/agentkit-build-agent/templates/appointment-intake.instructions.md +21 -0
- package/src/templates/skills/agentkit-build-agent/templates/sales-qualifier.instructions.md +17 -0
- package/src/templates/skills/agentkit-build-agent/templates/support-agent.instructions.md +16 -0
- package/src/templates/skills/agentkit-capsule/SKILL.md +70 -0
- package/src/templates/skills/agentkit-capsule/references/docs-router.md +15 -0
- package/src/templates/skills/agentkit-channels/SKILL.md +104 -0
- package/src/templates/skills/agentkit-channels/references/channel-buffering.md +65 -0
- package/src/templates/skills/agentkit-channels/references/channel-debugging.md +66 -0
- package/src/templates/skills/agentkit-channels/references/discord.md +93 -0
- package/src/templates/skills/agentkit-channels/references/slack.md +56 -0
- package/src/templates/skills/agentkit-channels/references/telegram.md +72 -0
- package/src/templates/skills/agentkit-channels/references/whatsapp-zapster.md +77 -0
- package/src/templates/skills/agentkit-database/SKILL.md +45 -0
- package/src/templates/skills/agentkit-database/templates/appointments.schema.sql +15 -0
- package/src/templates/skills/agentkit-database/templates/leads.schema.sql +17 -0
- package/src/templates/skills/agentkit-deploy/SKILL.md +50 -0
- package/src/templates/skills/agentkit-evals/SKILL.md +109 -0
- package/src/templates/skills/agentkit-evals/templates/multi-turn.eval.md +29 -0
- package/src/templates/skills/agentkit-evals/templates/no-leak.eval.md +18 -0
- package/src/templates/skills/agentkit-evals/templates/smoke.eval.md +18 -0
- package/src/templates/skills/agentkit-evals/templates/tool-call.eval.md +27 -0
- package/src/templates/skills/agentkit-improve/SKILL.md +86 -0
- package/src/templates/skills/agentkit-improve/references/replay-side-effects.md +18 -0
- package/src/templates/skills/agentkit-improve/references/trace-packets.md +22 -0
- package/src/templates/skills/agentkit-improve/templates/regression.eval.md +18 -0
- package/src/templates/skills/agentkit-integrations/SKILL.md +76 -0
- package/src/templates/skills/agentkit-knowledge/SKILL.md +43 -0
- package/src/templates/skills/agentkit-knowledge/templates/faq.md +14 -0
- package/src/templates/skills/agentkit-knowledge/templates/policies.md +14 -0
- package/src/templates/skills/agentkit-knowledge/templates/prices.csv +3 -0
- package/src/templates/skills/agentkit-prompts/SKILL.md +47 -0
- package/src/templates/skills/agentkit-prompts/templates/knowledge-grounded-faq.instructions.md +11 -0
- package/src/templates/skills/agentkit-provider/SKILL.md +60 -0
- package/src/templates/skills/agentkit-security/SKILL.md +56 -0
- package/src/templates/skills/agentkit-tools/SKILL.md +37 -0
- package/src/templates/skills/agentkit-tools/examples/database-write.tool.md +35 -0
- package/src/templates/skills/agentkit-tools/examples/eval-safe-external-action.tool.md +37 -0
- package/src/templates/skills/agentkit-tools/examples/lookup-order.tool.md +46 -0
- package/src/templates/skills/agentkit-troubleshooting/SKILL.md +76 -0
- package/src/templates/support.ts +77 -18
- package/docs/guides/channels-production-handoff.md +0 -99
- package/docs/portable-deploy-release-checklist.md +0 -41
- package/src/runtime/targets/cloudflare/deploy.ts +0 -5475
|
@@ -1,99 +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
|
-
- Retryable failures dead-letter after the configured retry ceiling.
|
|
85
|
-
- `channel_limit_exceeded` does not create queue backlog.
|
|
86
|
-
|
|
87
|
-
## Rollback
|
|
88
|
-
|
|
89
|
-
- Disable the channel resource first; do not delete delivery history.
|
|
90
|
-
- Remove provider webhook registration if the provider keeps retrying.
|
|
91
|
-
- Roll back the Worker only after queue drain or pause.
|
|
92
|
-
- Keep managed secrets; rotate only if a secret may have leaked.
|
|
93
|
-
|
|
94
|
-
## Production Defaults
|
|
95
|
-
|
|
96
|
-
- Start with conservative per-channel daily message and cost limits.
|
|
97
|
-
- Keep raw body storage disabled unless there is an explicit encrypted R2 retention policy.
|
|
98
|
-
- Delivery APIs return hashes and redacted metadata, not payload bodies.
|
|
99
|
-
- 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.
|