@andreprado/agentkit 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (142) hide show
  1. package/README.md +68 -6
  2. package/docs/guides/add-channel.md +189 -7
  3. package/docs/guides/add-knowledge.md +144 -0
  4. package/docs/guides/add-managed-composio.md +163 -0
  5. package/docs/guides/add-tool.md +1 -1
  6. package/docs/guides/channel-security.md +128 -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 +78 -1
  10. package/docs/guides/connect-whatsapp-evolution.md +121 -0
  11. package/docs/guides/connect-whatsapp-uazapi.md +126 -0
  12. package/docs/guides/connect-whatsapp-zapster.md +112 -8
  13. package/docs/guides/create-agent.md +45 -4
  14. package/docs/guides/debug-channel.md +147 -0
  15. package/docs/guides/improve-from-production.md +151 -0
  16. package/docs/guides/prepare-deploy.md +47 -17
  17. package/docs/guides/replay-production-traces.md +72 -0
  18. package/docs/guides/run-evals.md +147 -20
  19. package/docs/guides/security-rules.md +7 -6
  20. package/docs/guides/send-feedback.md +135 -0
  21. package/docs/guides/use-provider.md +27 -3
  22. package/docs/llms-full.txt +348 -55
  23. package/docs/llms.txt +62 -7
  24. package/package.json +2 -5
  25. package/src/cli/args.ts +57 -0
  26. package/src/cli/cloud-client.ts +377 -0
  27. package/src/cli/commands/channels.ts +1586 -0
  28. package/src/cli/commands/feedback.ts +438 -0
  29. package/src/cli/commands/knowledge.ts +136 -0
  30. package/src/cli/commands/transcribe.ts +171 -0
  31. package/src/cli/constants.ts +4 -0
  32. package/src/cli/deploy-chat-ui.ts +535 -0
  33. package/src/cli/deploy-readiness.ts +481 -0
  34. package/src/cli/flags.ts +162 -0
  35. package/src/cli/help.ts +236 -0
  36. package/src/cli/index.ts +1167 -1005
  37. package/src/cli/process.ts +31 -0
  38. package/src/cloud/artifact.ts +139 -0
  39. package/src/cloud/client.ts +80 -0
  40. package/src/cloud/contracts.ts +63 -0
  41. package/src/cloud/index.ts +3 -0
  42. package/src/create-project.ts +21 -6
  43. package/src/index.ts +517 -8
  44. package/src/providers/pi.ts +70 -16
  45. package/src/providers/test.ts +88 -1
  46. package/src/providers/types.ts +7 -0
  47. package/src/runtime/channel-buffer.ts +30 -0
  48. package/src/runtime/channel-test-harness.ts +21 -1
  49. package/src/runtime/channels/discord.ts +896 -0
  50. package/src/runtime/channels/generic-webhook.ts +225 -0
  51. package/src/runtime/channels/slack.ts +646 -0
  52. package/src/runtime/channels/telegram.ts +466 -23
  53. package/src/runtime/channels/whatsapp-evolution.ts +1357 -0
  54. package/src/runtime/channels/whatsapp-meta.ts +9 -0
  55. package/src/runtime/channels/whatsapp-uazapi.ts +1327 -0
  56. package/src/runtime/channels/whatsapp-zapster.ts +677 -40
  57. package/src/runtime/channels.ts +87 -4
  58. package/src/runtime/chat.ts +130 -38
  59. package/src/runtime/config.ts +519 -19
  60. package/src/runtime/core/manifest.ts +103 -5
  61. package/src/runtime/core/targets.ts +5 -5
  62. package/src/runtime/database.ts +93 -2
  63. package/src/runtime/db-commands.ts +9 -0
  64. package/src/runtime/deploy-readiness.ts +46 -4
  65. package/src/runtime/deploy.ts +1 -1
  66. package/src/runtime/dev-server.ts +779 -45
  67. package/src/runtime/env.ts +8 -3
  68. package/src/runtime/evals.ts +589 -43
  69. package/src/runtime/improve.ts +868 -0
  70. package/src/runtime/inspect.ts +194 -4
  71. package/src/runtime/integrations/composio.ts +423 -0
  72. package/src/runtime/knowledge/chunk.ts +333 -0
  73. package/src/runtime/knowledge/config.ts +135 -0
  74. package/src/runtime/knowledge/embeddings.ts +133 -0
  75. package/src/runtime/knowledge/ingest.ts +521 -0
  76. package/src/runtime/knowledge/prompt-policy.ts +30 -0
  77. package/src/runtime/knowledge/retrieve.ts +303 -0
  78. package/src/runtime/knowledge/schema.ts +100 -0
  79. package/src/runtime/knowledge/tool.ts +64 -0
  80. package/src/runtime/knowledge/vector.ts +258 -0
  81. package/src/runtime/prompt-context.ts +141 -0
  82. package/src/runtime/runtime-contract.ts +86 -8
  83. package/src/runtime/skills.ts +95 -0
  84. package/src/runtime/spec.ts +152 -0
  85. package/src/runtime/sync.ts +144 -0
  86. package/src/runtime/targets/cloudflare/build.ts +1468 -203
  87. package/src/runtime/targets/container/server.ts +1 -1
  88. package/src/runtime/targets/vps/deploy.ts +26 -9
  89. package/src/runtime/tool-runner.ts +9 -1
  90. package/src/runtime/tools.ts +128 -2
  91. package/src/runtime/traces.ts +41 -0
  92. package/src/runtime/transcription.ts +483 -0
  93. package/src/storage/sqlite.ts +149 -3
  94. package/src/templates/blank.ts +76 -17
  95. package/src/templates/dentista.ts +1011 -0
  96. package/src/templates/index.ts +2 -0
  97. package/src/templates/skills/agentkit-build-agent/SKILL.md +52 -0
  98. package/src/templates/skills/agentkit-build-agent/templates/appointment-intake.instructions.md +21 -0
  99. package/src/templates/skills/agentkit-build-agent/templates/sales-qualifier.instructions.md +17 -0
  100. package/src/templates/skills/agentkit-build-agent/templates/support-agent.instructions.md +16 -0
  101. package/src/templates/skills/agentkit-capsule/SKILL.md +70 -0
  102. package/src/templates/skills/agentkit-capsule/references/docs-router.md +15 -0
  103. package/src/templates/skills/agentkit-channels/SKILL.md +127 -0
  104. package/src/templates/skills/agentkit-channels/references/channel-buffering.md +65 -0
  105. package/src/templates/skills/agentkit-channels/references/channel-debugging.md +66 -0
  106. package/src/templates/skills/agentkit-channels/references/discord.md +93 -0
  107. package/src/templates/skills/agentkit-channels/references/slack.md +56 -0
  108. package/src/templates/skills/agentkit-channels/references/telegram.md +72 -0
  109. package/src/templates/skills/agentkit-channels/references/whatsapp-evolution.md +57 -0
  110. package/src/templates/skills/agentkit-channels/references/whatsapp-uazapi.md +61 -0
  111. package/src/templates/skills/agentkit-channels/references/whatsapp-zapster.md +77 -0
  112. package/src/templates/skills/agentkit-database/SKILL.md +45 -0
  113. package/src/templates/skills/agentkit-database/templates/appointments.schema.sql +15 -0
  114. package/src/templates/skills/agentkit-database/templates/leads.schema.sql +17 -0
  115. package/src/templates/skills/agentkit-deploy/SKILL.md +50 -0
  116. package/src/templates/skills/agentkit-evals/SKILL.md +109 -0
  117. package/src/templates/skills/agentkit-evals/templates/multi-turn.eval.md +29 -0
  118. package/src/templates/skills/agentkit-evals/templates/no-leak.eval.md +18 -0
  119. package/src/templates/skills/agentkit-evals/templates/smoke.eval.md +18 -0
  120. package/src/templates/skills/agentkit-evals/templates/tool-call.eval.md +27 -0
  121. package/src/templates/skills/agentkit-improve/SKILL.md +86 -0
  122. package/src/templates/skills/agentkit-improve/references/replay-side-effects.md +18 -0
  123. package/src/templates/skills/agentkit-improve/references/trace-packets.md +22 -0
  124. package/src/templates/skills/agentkit-improve/templates/regression.eval.md +18 -0
  125. package/src/templates/skills/agentkit-integrations/SKILL.md +76 -0
  126. package/src/templates/skills/agentkit-knowledge/SKILL.md +43 -0
  127. package/src/templates/skills/agentkit-knowledge/templates/faq.md +14 -0
  128. package/src/templates/skills/agentkit-knowledge/templates/policies.md +14 -0
  129. package/src/templates/skills/agentkit-knowledge/templates/prices.csv +3 -0
  130. package/src/templates/skills/agentkit-prompts/SKILL.md +47 -0
  131. package/src/templates/skills/agentkit-prompts/templates/knowledge-grounded-faq.instructions.md +11 -0
  132. package/src/templates/skills/agentkit-provider/SKILL.md +60 -0
  133. package/src/templates/skills/agentkit-security/SKILL.md +56 -0
  134. package/src/templates/skills/agentkit-tools/SKILL.md +37 -0
  135. package/src/templates/skills/agentkit-tools/examples/database-write.tool.md +35 -0
  136. package/src/templates/skills/agentkit-tools/examples/eval-safe-external-action.tool.md +37 -0
  137. package/src/templates/skills/agentkit-tools/examples/lookup-order.tool.md +46 -0
  138. package/src/templates/skills/agentkit-troubleshooting/SKILL.md +76 -0
  139. package/src/templates/support.ts +77 -18
  140. package/docs/guides/channels-production-handoff.md +0 -99
  141. package/docs/portable-deploy-release-checklist.md +0 -41
  142. package/src/runtime/targets/cloudflare/deploy.ts +0 -5475
@@ -0,0 +1,135 @@
1
+ # Send Feedback To AgentKit
2
+
3
+ ## Goal
4
+
5
+ Create a redacted local feedback draft when AgentKit itself is confusing, missing docs, or failing, then send it to AgentKit Cloud only after the user has authenticated.
6
+
7
+ ## When To Use This
8
+
9
+ Use this for AgentKit product feedback, not for the user's agent's client conversations.
10
+
11
+ Good cases:
12
+
13
+ - an AgentKit CLI command failed and the error did not explain recovery;
14
+ - a docs guide or generated skill is missing a step;
15
+ - deploy, channel, provider, eval, or runtime behavior looks like an AgentKit bug;
16
+ - the user's coding agent found a feature gap in AgentKit itself.
17
+
18
+ Do not use this to upload private client data, provider keys, `.env` values, or full conversation transcripts.
19
+
20
+ ## Commands
21
+
22
+ Create a local draft only:
23
+
24
+ ```sh
25
+ agentkit feedback create --about last-run --kind bug --summary "Deploy failed after secrets sync"
26
+ ```
27
+
28
+ Preview a draft:
29
+
30
+ ```sh
31
+ agentkit feedback preview .agentkit/feedback/<draft>.json
32
+ ```
33
+
34
+ Send a saved draft:
35
+
36
+ ```sh
37
+ agentkit login --token agk_user_...
38
+ agentkit feedback send .agentkit/feedback/<draft>.json
39
+ ```
40
+
41
+ Create and send in one command:
42
+
43
+ ```sh
44
+ agentkit feedback send --about deploy --kind deploy_issue --summary "Deploy doctor passed but deploy failed" --message "The recovery step was unclear."
45
+ ```
46
+
47
+ ## Files Created Or Edited
48
+
49
+ `feedback create` writes ignored local files:
50
+
51
+ ```txt
52
+ .agentkit/feedback/<timestamp>-<summary>.json
53
+ .agentkit/feedback/<timestamp>-<summary>.md
54
+ ```
55
+
56
+ These files are local diagnostic drafts. Keep `.agentkit/` out of commits.
57
+
58
+ ## Minimal Working Example
59
+
60
+ ```sh
61
+ agentkit feedback create \
62
+ --about last-run \
63
+ --kind missing_docs \
64
+ --summary "The channel debug guide did not explain Discord bot mode recovery" \
65
+ --message "The command failed after setup, and I could not tell whether to rerun connect or setup."
66
+ ```
67
+
68
+ Review the printed JSON path, then send it:
69
+
70
+ ```sh
71
+ agentkit feedback send .agentkit/feedback/<draft>.json
72
+ ```
73
+
74
+ ## Safety Rules
75
+
76
+ - Creating a draft never sends network feedback.
77
+ - Sending requires AgentKit Cloud login.
78
+ - The CLI redacts common bearer tokens, AgentKit tokens, provider key patterns, and Authorization headers before saving or sending.
79
+ - AgentKit Cloud validates the payload again and stores the redacted report under the authenticated account.
80
+ - Do not paste `.env` contents, provider key values, OAuth tokens, cookies, client PII, or full private transcripts into `--message`.
81
+ - The feedback command does not upload arbitrary files and does not ask AgentKit Cloud to fetch URLs.
82
+ - The deployed agent runtime does not send feedback to the AgentKit team.
83
+
84
+ ## Verification
85
+
86
+ After creating a draft:
87
+
88
+ ```sh
89
+ agentkit feedback preview .agentkit/feedback/<draft>.json
90
+ ```
91
+
92
+ Expected:
93
+
94
+ - `schema_version` is `agentkit.feedback.v1`;
95
+ - `source.channel` is `cli`;
96
+ - `context` describes the current capsule and deploy shape;
97
+ - no secret values are present.
98
+
99
+ After sending:
100
+
101
+ ```txt
102
+ Feedback sent
103
+ ID: fb_...
104
+ Status: new
105
+ ```
106
+
107
+ ## Troubleshooting
108
+
109
+ `auth_required`:
110
+
111
+ Log in before sending:
112
+
113
+ ```sh
114
+ agentkit login --token agk_user_...
115
+ ```
116
+
117
+ `feedback_draft_invalid`:
118
+
119
+ Recreate the draft with `agentkit feedback create`. Do not hand-edit the JSON schema unless you keep `schema_version: "agentkit.feedback.v1"`.
120
+
121
+ `payload_too_large`:
122
+
123
+ Shorten `--message`. Do not paste full logs; include the command, exact error code, and the smallest useful excerpt.
124
+
125
+ ## Backend Contracts Used
126
+
127
+ Feedback submit uses authenticated AgentKit Cloud account auth:
128
+
129
+ ```txt
130
+ POST /v1/feedback
131
+ Authorization: Bearer agk_user_...
132
+ Idempotency-Key: fbdraft_...
133
+ ```
134
+
135
+ The endpoint accepts only structured JSON feedback and stores it in the AgentKit Cloud feedback inbox.
@@ -6,7 +6,9 @@ Switch a capsule from the offline `test/fake` provider to a Pi-backed provider.
6
6
 
7
7
  ## When To Use This
8
8
 
9
- Use this when local fake responses are no longer enough and the agent needs model behavior from OpenAI, Anthropic, or OpenRouter.
9
+ Use this when local fake responses are no longer enough and the agent needs model behavior from OpenRouter, OpenAI, Anthropic, or another supported provider.
10
+
11
+ The coding agent should not choose a real provider automatically. Ask the owner which provider to use, then update the capsule.
10
12
 
11
13
  ## Commands
12
14
 
@@ -19,6 +21,14 @@ npm run chat -- --message "hello"
19
21
  npm run agentkit -- inspect
20
22
  ```
21
23
 
24
+ On Windows PowerShell, if `npm.ps1` is blocked by `PSSecurityException`, use the Windows command shim:
25
+
26
+ ```sh
27
+ npm.cmd run typecheck
28
+ npm.cmd run chat -- --message "hello"
29
+ npm.cmd run agentkit -- inspect
30
+ ```
31
+
22
32
  ## Files Created Or Edited
23
33
 
24
34
  Edit:
@@ -75,6 +85,19 @@ provider: {
75
85
  secrets: ["OPENROUTER_API_KEY"],
76
86
  ```
77
87
 
88
+ Prefer model ids or aliases listed by the installed Pi SDK when available, such as `~google/gemini-flash-latest`. If an OpenRouter model id is newer than the Pi model registry, AgentKit passes the id through to OpenRouter using Pi's OpenAI-compatible transport with conservative unknown-model metadata. The provider may still reject the request if the id is invalid, inaccessible, or does not support the tools/features the agent uses.
89
+
90
+ ## UI Verification
91
+
92
+ After the provider is configured and the local secret is set, test through chat and UI:
93
+
94
+ ```sh
95
+ npm run chat -- --message "hello"
96
+ npm run dev
97
+ ```
98
+
99
+ Open the printed `Chat:` URL and tell the owner the exact URL. If the provider is still `test/fake`, say the UI was tested only with the deterministic fake provider.
100
+
78
101
  ## Safety Rules
79
102
 
80
103
  - Keep `.env` local.
@@ -84,6 +107,7 @@ secrets: ["OPENROUTER_API_KEY"],
84
107
  - Do not import provider SDKs in the Agent Capsule.
85
108
  - AgentKit uses Pi SDK internally.
86
109
  - Run `agentkit inspect` to confirm secret status without printing values.
110
+ - Do not claim real conversation behavior was tested until a real provider selected by the owner is configured.
87
111
 
88
112
  ## Verification
89
113
 
@@ -111,7 +135,7 @@ npm run agentkit -- inspect
111
135
 
112
136
  `provider_model_unsupported`:
113
137
 
114
- Use a model id known to the installed Pi SDK for that provider.
138
+ For OpenAI or Anthropic, use a model id known to the installed Pi SDK for that provider. For OpenRouter, prefer a known Pi alias when possible; otherwise a raw OpenRouter model id is passed through and any remaining model error comes from OpenRouter.
115
139
 
116
140
  Provider returns auth failure:
117
141
 
@@ -123,4 +147,4 @@ Check the key value, provider account status, and model access.
123
147
 
124
148
  ## Backend Contracts Used
125
149
 
126
- Local provider keys come from ignored `.env`, loaded directly by AgentKit. Hosted production will use `agentkit secret set <NAME>` and the secret API. Secret values have no readback in hosted responses.
150
+ Local provider keys come from ignored `.env`, loaded directly by AgentKit. Hosted production uses `agentkit secret set <NAME> --from-local-env`, `--from-env`, or `--stdin` and the secret API. Secret values have no readback in hosted responses.