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

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.
@@ -30,54 +30,65 @@ The capsule root is the runtime boundary. Run AgentKit commands from the directo
30
30
 
31
31
  ## Current Command Surface
32
32
 
33
- Implemented local commands:
33
+ Current commands:
34
34
 
35
35
  ```sh
36
- agentkit new <name> --template blank
37
- agentkit new <name> --template support
38
- agentkit chat --message "hello"
39
- agentkit tool <name> --input <path-or-json>
36
+ agentkit new <name> [--template blank|support|dentista] [--no-install]
37
+ agentkit dev [--port <number>]
38
+ agentkit open
39
+ agentkit chat-ui --deploy
40
+ agentkit chat-ui --deploy [--port <number>] [--token-file <path>]
41
+ agentkit chat --message <text> [--conversation-id <id>]
42
+ agentkit tool <name> [--input <path-or-json>]
43
+ agentkit db migrate
44
+ agentkit db reset --yes
45
+ agentkit db shell
46
+ agentkit db seed [--file <path>]
40
47
  agentkit eval run
41
48
  agentkit conversations list
42
49
  agentkit conversations show <conversation-id>
43
50
  agentkit channels list
44
- agentkit channels add website website-chat
45
- agentkit channels add telegram support-telegram
46
- agentkit channels add whatsapp support-whatsapp --provider zapster
47
- agentkit channels setup <name>
48
- agentkit channels setup <name> --apply
49
- agentkit channels status <name>
50
- agentkit channels test <name> --message "hello"
51
- agentkit channels test <name> --fixture ./fixtures/provider-event.json
52
- agentkit channels deliveries list <name>
53
- agentkit channels deliveries show <delivery-id>
51
+ agentkit channels add <website|telegram|whatsapp> <name> [--provider zapster|meta] [--api <url>]
52
+ agentkit channels setup <name> [--apply] [--api <url>]
53
+ agentkit channels status <name> [--api <url>]
54
+ agentkit channels test <name> [--message <text>] [--fixture <path>] [--api <url>]
55
+ agentkit channels deliveries list <name> [--api <url>]
56
+ agentkit channels deliveries show <delivery-id> [--api <url>]
54
57
  agentkit inspect
55
- agentkit env set <NAME> <VALUE>
56
- agentkit env list
57
- agentkit env unset <NAME>
58
- agentkit docs path
59
- agentkit docs llms
60
- agentkit docs full
61
- agentkit handoff codex [goal]
62
- agentkit handoff claude [goal]
63
- agentkit dev
64
- agentkit dev --port 4124
65
- agentkit build
66
- agentkit deploy
67
- agentkit deploy --dry-run
58
+ agentkit build [--target cloudflare|container]
68
59
  agentkit login --token <token>
69
60
  agentkit logout
61
+ agentkit deploy [--target cloudflare|vps] [--host <host>] [--api <url>] [--dry-run] [--anonymous] [--local-wrangler] [--smoke <message>]
62
+ agentkit deploy doctor [--api <url>] [--anonymous]
63
+ agentkit deploy smoke [--message <text>] [--api <url>]
70
64
  agentkit deploy status
71
65
  agentkit deploy pause
72
66
  agentkit deploy resume
73
67
  agentkit secret set <NAME> <VALUE>
68
+ agentkit secret set <NAME> --stdin
69
+ agentkit secret set <NAME> --from-env [ENV_NAME]
70
+ agentkit secret set <NAME> --from-local-env
71
+ agentkit secret sync --from-local
74
72
  agentkit secret list
75
73
  agentkit secret unset <NAME>
76
- agentkit access token create <name>
74
+ agentkit access token create <name> [--api <url>] [--out <path>]
77
75
  agentkit access token list
78
76
  agentkit access token revoke <token-id>
77
+ agentkit env set <NAME> <VALUE>
78
+ agentkit env set <NAME> --stdin
79
+ agentkit env set <NAME> --from-env [ENV_NAME]
80
+ agentkit env list
81
+ agentkit env unset <NAME>
82
+ agentkit docs path
83
+ agentkit docs llms
84
+ agentkit docs full
85
+ agentkit handoff codex [goal]
86
+ agentkit handoff claude [goal]
87
+ agentkit help commands
79
88
  ```
80
89
 
90
+ Prefer `env set --stdin` or `--from-env` for local secret values, and prefer `secret set --stdin`, `--from-env`, or `--from-local-env` for hosted secrets. Inline `<VALUE>` forms exist for simple non-sensitive values, but agents should avoid putting secrets in shell history.
91
+
81
92
  Planned commands described by the contract but not implemented yet:
82
93
 
83
94
  ```sh
@@ -95,7 +106,6 @@ cd /tmp/agentkit-demo
95
106
 
96
107
  npx @andreprado/agentkit@alpha new demo --template blank
97
108
  cd demo
98
- npm install
99
109
  npm run chat -- --message "hello"
100
110
  npm run chat -- --message "second message"
101
111
  npm run eval
@@ -117,7 +127,6 @@ The primary flow is:
117
127
  ```sh
118
128
  agentkit new eye-office-agent --template blank
119
129
  cd eye-office-agent
120
- npm install
121
130
  ```
122
131
 
123
132
  Then open the folder in Codex, Claude Code, or another coding agent and ask directly:
@@ -126,7 +135,7 @@ Then open the folder in Codex, Claude Code, or another coding agent and ask dire
126
135
  Develop an appointment and intake agent for an ophthalmology office.
127
136
  ```
128
137
 
129
- The coding agent should infer the first useful version, edit `prompts/instructions.md`, `agentkit.config.ts`, and `tools/`, then run the verification commands before finishing.
138
+ The coding agent should infer the first useful version, edit `prompts/instructions.md`, `agentkit.config.ts`, `schema.sql`, `tools/`, and `evals/`, then run the verification commands before finishing. Do not wait for a wizard or recipe. AgentKit provides the scaffold and contract; the coding agent implements directly in the capsule.
130
139
 
131
140
  Optional handoff shortcut:
132
141
 
@@ -137,6 +146,8 @@ npm run agentkit -- handoff claude "Develop an appointment and intake agent for
137
146
 
138
147
  The command prints a ready-to-paste prompt that points the coding agent at `AGENTKIT.md` and the packaged `llms-full.txt` contract.
139
148
 
149
+ The generated docs and handoff prompt must make UI testing explicit. For local UI testing, run `npm run dev`, open the printed `Chat:` URL, and tell the owner the exact URL. For hosted UI testing after deploy, run `npm run agentkit -- chat-ui --deploy`, open the printed `Chat:` URL, and tell the owner it is connected to the hosted deploy.
150
+
140
151
  ## Agent Config
141
152
 
142
153
  `agentkit.config.ts` is the source of truth:
@@ -203,7 +214,11 @@ provider: {
203
214
  secrets: [],
204
215
  ```
205
216
 
206
- Use OpenAI locally:
217
+ `test/fake` is deterministic. It is useful for scaffold checks, direct tool checks, and fake-provider evals, but it does not validate natural conversation quality.
218
+
219
+ Before claiming real conversation behavior has been tested, ask the owner which provider to use: OpenRouter, OpenAI, Anthropic, or another supported provider. Do not choose for them. After the owner chooses, update `agentkit.config.ts`, `.env.schema`, local secrets, hosted secrets if deploying, then rerun chat/UI checks.
220
+
221
+ OpenAI example:
207
222
 
208
223
  ```ts
209
224
  provider: {
@@ -540,6 +555,8 @@ Run:
540
555
  agentkit dev
541
556
  ```
542
557
 
558
+ If the default local port is occupied, `agentkit dev` chooses the next available port and prints the actual URLs. If the occupied port is another AgentKit server, the output names the agent using it.
559
+
543
560
  Expected output:
544
561
 
545
562
  ```txt
@@ -551,6 +568,12 @@ Inspect: http://localhost:4123/_agentkit
551
568
  Storage: .agentkit/agentkit.db
552
569
  ```
553
570
 
571
+ To reopen the local UI for the current capsule after the server is already running:
572
+
573
+ ```sh
574
+ agentkit open
575
+ ```
576
+
554
577
  Endpoints:
555
578
 
556
579
  ```txt
@@ -568,6 +591,8 @@ curl -X POST http://localhost:4123/v1/chat \
568
591
  -d '{"message":{"role":"user","content":"hello"}}'
569
592
  ```
570
593
 
594
+ The chat response includes `conversationId`. Send the same `conversationId` on the next `POST /v1/chat` request, or pass it to `agentkit chat --conversation-id <id>`, to continue with the persisted message history.
595
+
571
596
  ## Conversations
572
597
 
573
598
  After chat:
@@ -611,6 +636,8 @@ persisted_tool_call
611
636
 
612
637
  `persisted_tool_call` validates the tool call saved in local SQLite `tool_calls`, not a provider-specific raw response shape. It can be a tool name string or an object with `name`, `input`, `output`, `status`, and/or `visibility`. `tool_call` remains accepted as a backwards-compatible alias.
613
638
 
639
+ Evals run the normal capsule tools. If a tool would write externally, delete, charge money, send email, or call a real customer system, make its `execute` implementation branch on `ctx.runtime.environment === "eval"` and return deterministic non-destructive output for eval runs. Do not invent an eval-only mock API; keep the behavior inside the registered tool contract unless AgentKit adds a first-class mock facility later.
640
+
614
641
  ## Security Rules
615
642
 
616
643
  Never commit:
@@ -634,7 +661,7 @@ prompts/
634
661
  docs/
635
662
  ```
636
663
 
637
- Local `.env` is development only. Use `.env.schema` as the committed secret-name contract; local AgentKit commands load `.env` directly. Hosted alpha deploys use `agentkit login --token ...` and managed secrets through `agentkit secret set/list/unset`.
664
+ Local `.env` is development only. Use `.env.schema` as the committed secret-name contract; local AgentKit commands load `.env` directly. Hosted alpha deploys use `agentkit login --token ...` and managed secrets through `agentkit secret set/list/unset` or `agentkit secret sync --from-local`. Prefer `--stdin`, `--from-env`, `--from-local-env`, or sync from local `.env` so secret values do not appear in shell history. Inline `<VALUE>` forms exist only for compatibility and simple non-sensitive values.
638
665
 
639
666
  Tools are a security boundary. A tool must declare every secret it needs. The runtime injects only tool-declared secrets.
640
667
 
@@ -648,20 +675,23 @@ Current flow:
648
675
  agentkit deploy --dry-run
649
676
  agentkit login --token agk_user_...
650
677
  agentkit deploy doctor
651
- agentkit deploy
678
+ agentkit deploy --smoke "hello"
652
679
  agentkit deploy status
680
+ agentkit deploy smoke --message "hello"
681
+ agentkit chat-ui --deploy
653
682
  ```
654
683
 
655
- `agentkit deploy doctor` checks AgentKit Cloud login, `cloudflare_deploy_alpha`, hosted secrets, local `.env` names that still need `agentkit secret set`, and private-access runtime token handling. `agentkit deploy` sends the capsule to AgentKit Cloud and runs the same readiness check automatically before building and uploading. Production alpha deploys require an account with `cloudflare_deploy_alpha`; local commands and dry-run builds do not require login. AgentKit owns infrastructure selection, backend migration, managed secrets, and public URL creation.
684
+ `agentkit deploy doctor` checks AgentKit Cloud login, `cloudflare_deploy_alpha`, online deploy capacity, hosted secrets, local `.env` names that still need `agentkit secret set`, and private-access runtime token handling. `agentkit deploy` sends the capsule to AgentKit Cloud, runs the same readiness check automatically before building and uploading, and writes the local chat/UI deploy access token to `.agentkit/chat-access-token.json` for private hosted deploys. `agentkit deploy --smoke "hello"` deploys and then tests `/v1/chat` with the deploy access token. `agentkit deploy smoke --message "hello"` repeats that smoke against the last local deploy. `agentkit chat-ui --deploy` serves a local UI pointed at the hosted deploy using that token without exposing it to browser code. Production alpha deploys require an account with `cloudflare_deploy_alpha`; local commands and dry-run builds do not require login. AgentKit owns infrastructure selection, backend migration, managed secrets, and public URL creation.
656
685
 
657
686
  The CLI defaults to the hosted AgentKit Cloud API at `https://agentkit-cloud.aibuilders.com.br`. Use `AGENTKIT_CLOUD_API_URL` or `agentkit deploy --api <url>` only for local or alternate control-plane tests.
658
687
 
659
688
  Account/access flow:
660
689
 
661
690
  ```sh
662
- agentkit secret set OPENAI_API_KEY
691
+ agentkit secret set OPENAI_API_KEY --from-local-env
692
+ agentkit secret sync --from-local
663
693
  agentkit secret list
664
- agentkit access token create website-chat
694
+ agentkit access token create website-chat --out .agentkit/website-chat-access-token.json
665
695
  agentkit access token list
666
696
  ```
667
697
 
@@ -710,6 +740,8 @@ npm install
710
740
  npm run typecheck
711
741
  ```
712
742
 
743
+ `agentkit new` installs dependencies by default. Run this if the scaffold used `--no-install`, the install failed, or `node_modules` was deleted.
744
+
713
745
  Make sure `tsconfig.json` contains:
714
746
 
715
747
  ```json
package/docs/llms.txt CHANGED
@@ -24,8 +24,10 @@ Task guides:
24
24
  Current local commands:
25
25
 
26
26
  ```sh
27
- agentkit new <name> --template blank|support
27
+ agentkit new <name> --template blank|support|dentista
28
+ agentkit new <name> --template blank --no-install
28
29
  agentkit docs full
30
+ agentkit env set <NAME> --stdin
29
31
  agentkit env list
30
32
  agentkit env unset <NAME>
31
33
  agentkit handoff codex|claude [goal]
@@ -42,16 +44,25 @@ agentkit channels test support-telegram --message "hello"
42
44
  agentkit channels deliveries list support-telegram
43
45
  agentkit login --token agk_user_...
44
46
  agentkit deploy doctor
45
- agentkit deploy
47
+ agentkit deploy --smoke "hello"
46
48
  agentkit deploy status
49
+ agentkit deploy smoke --message "hello"
50
+ agentkit chat-ui --deploy
51
+ agentkit secret set <NAME> --from-local-env
52
+ agentkit secret sync --from-local
47
53
  agentkit secret list
48
- agentkit access token create website-chat
54
+ agentkit access token create website-chat --out .agentkit/website-chat-access-token.json
49
55
  agentkit access token list
50
56
  agentkit inspect
51
57
  agentkit dev
58
+ agentkit open
52
59
  ```
53
60
 
54
- Generated capsules include `AGENTKIT.md` and `AGENTS.md` so Codex, Claude Code, or another coding agent can treat the owner's natural-language request as the brief and start building immediately. `agentkit handoff codex "Develop an ophthalmology office intake agent"` is an optional prompt-printing shortcut for users who are not already inside a coding-agent workspace.
61
+ Generated capsules include `AGENTKIT.md` and `AGENTS.md` so Codex, Claude Code, or another coding agent can treat the owner's natural-language request as the brief and start building immediately. `agentkit handoff codex "Develop an ophthalmology office intake agent"` is an optional prompt-printing shortcut for users who are not already inside a coding-agent workspace. There is no wizard or recipe layer: the coding agent edits the capsule directly from the scaffold and contract.
62
+
63
+ UI testing is part of the handoff. For local UI testing, run `agentkit dev`, open the printed `Chat:` URL, and tell the owner the exact URL. After hosted deploy, run `agentkit chat-ui --deploy`, open the printed `Chat:` URL, and tell the owner it is connected to the deploy.
64
+
65
+ `test/fake` is deterministic and validates scaffold, direct tool calls, and fake-provider evals. It does not validate natural conversation quality. Before claiming real conversation behavior has been tested, ask the owner which provider to use: OpenRouter, OpenAI, Anthropic, or another supported provider. Do not choose for them.
55
66
 
56
67
  Current local endpoints from `agentkit dev`:
57
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andreprado/agentkit",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -36,7 +36,6 @@
36
36
  "@earendil-works/pi-ai": "^0.75.5",
37
37
  "@earendil-works/pi-coding-agent": "^0.75.5",
38
38
  "esbuild": "^0.28.0",
39
- "postgres": "^3.4.9",
40
39
  "tsx": "^4.22.3",
41
40
  "typebox": "^1.1.38"
42
41
  },