@zibby/cli 0.6.1 → 0.7.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.
- package/dist/bin/zibby.js +19 -18
- package/dist/commands/app-auth.js +17 -0
- package/dist/commands/app.js +1 -1
- package/dist/commands/init.js +126 -118
- package/dist/commands/workflows/generate.js +143 -135
- package/dist/package.json +3 -2
- package/dist/templates/zibby-workflow-claude/agents-md-block.md +23 -23
- package/dist/templates/zibby-workflow-claude/claude/agents/zibby-workflow-builder.md +24 -24
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-add-node.md +18 -18
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-debug.md +10 -10
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-delete.md +7 -7
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-deploy.md +26 -26
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-list.md +8 -8
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-static-ip.md +13 -13
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-tail.md +13 -13
- package/dist/templates/zibby-workflow-claude/claude/commands/zibby-trigger.md +16 -16
- package/dist/templates/zibby-workflow-claude/cursor/rules/zibby-workflows.mdc +19 -19
- package/dist/templates/zibby-workflow-claude/manifest.json +1 -1
- package/package.json +3 -2
- package/templates/zibby-workflow-claude/agents-md-block.md +23 -23
- package/templates/zibby-workflow-claude/claude/agents/zibby-workflow-builder.md +24 -24
- package/templates/zibby-workflow-claude/claude/commands/zibby-add-node.md +18 -18
- package/templates/zibby-workflow-claude/claude/commands/zibby-debug.md +10 -10
- package/templates/zibby-workflow-claude/claude/commands/zibby-delete.md +7 -7
- package/templates/zibby-workflow-claude/claude/commands/zibby-deploy.md +26 -26
- package/templates/zibby-workflow-claude/claude/commands/zibby-list.md +8 -8
- package/templates/zibby-workflow-claude/claude/commands/zibby-static-ip.md +13 -13
- package/templates/zibby-workflow-claude/claude/commands/zibby-tail.md +13 -13
- package/templates/zibby-workflow-claude/claude/commands/zibby-trigger.md +16 -16
- package/templates/zibby-workflow-claude/cursor/rules/zibby-workflows.mdc +19 -19
- package/templates/zibby-workflow-claude/manifest.json +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
|
-
# /zibby-tail — stream live logs from a Zibby
|
|
2
|
+
# /zibby-tail — stream live logs from a Zibby agent
|
|
3
3
|
|
|
4
|
-
You are helping the user tail logs from
|
|
4
|
+
You are helping the user tail logs from an agent execution.
|
|
5
5
|
|
|
6
|
-
`zibby
|
|
6
|
+
`zibby agent logs <jobId> -t` is the live-streaming variant (like `heroku logs --tail` or `docker compose logs -f`). Without `-t`, you get a one-shot fetch.
|
|
7
7
|
|
|
8
8
|
Canonical docs: **https://docs.zibby.app/workflows/logs**
|
|
9
9
|
|
|
10
10
|
## What `<jobId>` accepts
|
|
11
11
|
|
|
12
|
-
- A **
|
|
12
|
+
- A **agent UUID** (`2b1ea07f-...`) → tails ALL currently-active executions of that agent, plus any new ones triggered while the tail is open. Lines are interleaved by arrival time, prefixed with `(taskId)` so concurrent runs are distinguishable.
|
|
13
13
|
- An **execution ID** (`abc-...`) → tails just that single execution. Closes when the execution drains.
|
|
14
14
|
|
|
15
15
|
## Example flow
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
$ zibby
|
|
18
|
+
$ zibby agent trigger 2b1ea07f-3ede-4bfd-a51d-431f0bab008e
|
|
19
19
|
Job ID: 569ef1ee-15c8-4ee7-af30-933c8bec7ea7
|
|
20
20
|
|
|
21
|
-
$ zibby
|
|
22
|
-
Streaming logs for
|
|
21
|
+
$ zibby agent logs 2b1ea07f-3ede-4bfd-a51d-431f0bab008e -t
|
|
22
|
+
Streaming logs for agent 2b1ea07f-...
|
|
23
23
|
Press Ctrl+C to stop.
|
|
24
24
|
|
|
25
25
|
┌─ Execution: 569ef1ee...7ea7 (task: 9e61c690)
|
|
26
26
|
└─ Streaming logs...
|
|
27
27
|
|
|
28
28
|
2026-05-04 06:16:27.621 (9e61c690) zibby v0.1.91
|
|
29
|
-
2026-05-04 06:16:27.997 (9e61c690)
|
|
29
|
+
2026-05-04 06:16:27.997 (9e61c690) Agent: hello-world
|
|
30
30
|
2026-05-04 06:16:33.055 (9e61c690) │ Prompt sent to LLM:
|
|
31
31
|
...
|
|
32
|
-
2026-05-04 06:16:56.389 (9e61c690) ✓
|
|
32
|
+
2026-05-04 06:16:56.389 (9e61c690) ✓ Agent completed
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## Tail behavior worth knowing
|
|
36
36
|
|
|
37
37
|
- **Auto-switch:** when the current execution drains and a new trigger lands, the tail seamlessly picks it up — no need to re-run the command.
|
|
38
|
-
- **Multi-attach:** if you trigger two
|
|
38
|
+
- **Multi-attach:** if you trigger two agents in parallel, the tail attaches to both. Lines from each are interleaved by timestamp.
|
|
39
39
|
- **Reconnect:** transient network blips reconnect silently. Long quiet windows (3+ min) are kept alive via 5s keepalives.
|
|
40
40
|
|
|
41
41
|
## Steps for this command
|
|
42
42
|
|
|
43
|
-
1. Identify the jobId. If user gives
|
|
43
|
+
1. Identify the jobId. If user gives an agent name (not UUID), look it up via `zibby agent list` and use the UUID.
|
|
44
44
|
2. **Run in the background** — `-t` is a long-running stream. If you call `Bash` without `run_in_background: true` it'll block the chat for minutes:
|
|
45
45
|
```
|
|
46
|
-
Bash({ command: "zibby
|
|
46
|
+
Bash({ command: "zibby agent logs <jobId> -t", run_in_background: true })
|
|
47
47
|
```
|
|
48
48
|
Then use `BashOutput` (or whatever your background-output tool is) to read new lines as they arrive.
|
|
49
49
|
3. If the user wants a **one-shot snapshot** (no follow), drop the `-t` flag and call Bash normally:
|
|
50
50
|
```
|
|
51
|
-
Bash({ command: "zibby
|
|
51
|
+
Bash({ command: "zibby agent logs <jobId>" })
|
|
52
52
|
```
|
|
53
53
|
4. To stop the live tail: kill the background bash task. The CLI exits cleanly with `Stopped streaming.`
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
|
-
# /zibby-trigger — run a deployed Zibby
|
|
2
|
+
# /zibby-trigger — run a deployed Zibby agent
|
|
3
3
|
|
|
4
|
-
You are helping the user trigger a deployed
|
|
4
|
+
You are helping the user trigger a deployed agent execution.
|
|
5
5
|
|
|
6
|
-
A trigger creates a new ECS Fargate task that loads the
|
|
6
|
+
A trigger creates a new ECS Fargate task that loads the agent's bundle, runs the graph, and writes status + logs as it goes.
|
|
7
7
|
|
|
8
8
|
Canonical docs: **https://docs.zibby.app/cloud/triggering**
|
|
9
9
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
|
-
1. **Get the
|
|
12
|
+
1. **Get the agent UUID.** The user should provide it; if not, run `zibby agent list` to discover it. UUIDs are stable across deploys (the same agent always has the same UUID; only the bundle version changes).
|
|
13
13
|
|
|
14
|
-
2. **Construct the input.**
|
|
14
|
+
2. **Construct the input.** Agents take a JSON input that nodes can read via `ctx.input`. Ask the user what input the agent expects (or read `workflow.json`'s `inputSchema` if present).
|
|
15
15
|
|
|
16
16
|
3. **Run the trigger.** Three ways to pass input — they merge with this **precedence (highest → lowest)**:
|
|
17
17
|
1. `-p key=value` (repeatable) — wins over everything; great for shell-friendly tweaks on top of a base payload
|
|
@@ -19,21 +19,21 @@ Canonical docs: **https://docs.zibby.app/cloud/triggering**
|
|
|
19
19
|
3. `--input-file path.json` — full JSON/YAML payload from a file (lowest precedence; `-p` and `--input` override individual keys)
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
zibby
|
|
23
|
-
zibby
|
|
24
|
-
zibby
|
|
22
|
+
zibby agent trigger <uuid> --input '{"key":"value"}'
|
|
23
|
+
zibby agent trigger <uuid> -p ticket=ENG-1234 -p priority=high
|
|
24
|
+
zibby agent trigger <uuid> --input-file payload.json -p priority=urgent # mix
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Same flag surface as `zibby
|
|
27
|
+
Same flag surface as `zibby agent run` (local) — flip the verb and the same call shape goes from local to remote.
|
|
28
28
|
|
|
29
29
|
4. **Tail the logs immediately:**
|
|
30
30
|
```
|
|
31
|
-
zibby
|
|
31
|
+
zibby agent logs <uuid> -t
|
|
32
32
|
```
|
|
33
|
-
This streams live output. The tail auto-attaches to all currently-running executions of the
|
|
33
|
+
This streams live output. The tail auto-attaches to all currently-running executions of the agent (docker-compose-style), so back-to-back triggers interleave naturally.
|
|
34
34
|
|
|
35
|
-
5. **Watch for completion.**
|
|
36
|
-
- `✓
|
|
35
|
+
5. **Watch for completion.** Agent runs typically end with one of:
|
|
36
|
+
- `✓ Agent completed` — success, status `completed`
|
|
37
37
|
- `Error: Node 'X' failed` — a node threw; status `failed`
|
|
38
38
|
- silent timeout — task killed by ECS; status stays `running` then becomes a zombie. Trigger again.
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ Canonical docs: **https://docs.zibby.app/cloud/triggering**
|
|
|
41
41
|
|
|
42
42
|
Use `--idempotency-key <key>` to prevent duplicate runs from a retry-prone caller:
|
|
43
43
|
```
|
|
44
|
-
zibby
|
|
44
|
+
zibby agent trigger <uuid> --input '{}' --idempotency-key job-2026-05-04-001
|
|
45
45
|
```
|
|
46
46
|
Same key + same input within ~24h = same execution returned (no new run).
|
|
47
47
|
|
|
@@ -50,7 +50,7 @@ Same key + same input within ~24h = same execution returned (no new run).
|
|
|
50
50
|
There's no built-in batch trigger — script it from your shell:
|
|
51
51
|
```
|
|
52
52
|
for ticket in ENG-1 ENG-2 ENG-3; do
|
|
53
|
-
zibby
|
|
53
|
+
zibby agent trigger <uuid> -p ticket=$ticket
|
|
54
54
|
done
|
|
55
|
-
zibby
|
|
55
|
+
zibby agent logs <uuid> -t # tail will show all 3 interleaved
|
|
56
56
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
2
|
---
|
|
3
|
-
description: Help the user build, test, and deploy Zibby
|
|
3
|
+
description: Help the user build, test, and deploy Zibby agents + browser tests
|
|
4
4
|
globs:
|
|
5
5
|
- "**/.zibby/workflows/**"
|
|
6
6
|
- ".zibby.config.mjs"
|
|
@@ -11,11 +11,11 @@ globs:
|
|
|
11
11
|
alwaysApply: false
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
# Zibby —
|
|
14
|
+
# Zibby — agents + tests
|
|
15
15
|
|
|
16
16
|
This project uses **Zibby**. Two surfaces share `.zibby.config.mjs` at the project root.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Agents
|
|
19
19
|
|
|
20
20
|
A graph of AI-agent-driven steps that runs inside an ECS Fargate sandbox.
|
|
21
21
|
|
|
@@ -32,14 +32,14 @@ Each node exports `{ id, description, async run(ctx) }`. `ctx` provides `input`,
|
|
|
32
32
|
### Common dev loop
|
|
33
33
|
|
|
34
34
|
```
|
|
35
|
-
zibby
|
|
36
|
-
zibby
|
|
37
|
-
zibby
|
|
38
|
-
zibby
|
|
39
|
-
zibby
|
|
40
|
-
zibby
|
|
41
|
-
zibby
|
|
42
|
-
zibby
|
|
35
|
+
zibby agent new <name> # scaffold
|
|
36
|
+
zibby agent run <name> # one-shot local run (preferred for the dev loop)
|
|
37
|
+
zibby agent deploy <name> # build + push to cloud
|
|
38
|
+
zibby agent trigger <uuid> # invoke the cloud agent
|
|
39
|
+
zibby agent logs <uuid> -t # tail live logs (docker-compose-style for concurrent runs)
|
|
40
|
+
zibby agent list # local + cloud
|
|
41
|
+
zibby agent download <uuid> # pull cloud source back to .zibby/workflows/
|
|
42
|
+
zibby agent delete <uuid> # remove a deployed agent
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
`run` (one-shot) vs `start` (long-lived dev server, port 3848 — Studio integration). For plain CLI iteration always use `run`.
|
|
@@ -51,20 +51,20 @@ zibby workflow delete <uuid> # remove a deployed workflow
|
|
|
51
51
|
1. Create `<workflow>/nodes/<name>.mjs` (mirror existing `example.mjs` pattern)
|
|
52
52
|
2. Register in `<workflow>/nodes/index.mjs`
|
|
53
53
|
3. Wire into `<workflow>/graph.mjs` (add to `nodes` array and connect via edges)
|
|
54
|
-
4. `zibby
|
|
54
|
+
4. `zibby agent run <name>` to test locally; `zibby agent deploy` to push
|
|
55
55
|
|
|
56
|
-
### Per-
|
|
56
|
+
### Per-agent env vars
|
|
57
57
|
|
|
58
|
-
Each deployed
|
|
58
|
+
Each deployed agent has its own encrypted env-var bag (KMS-backed); agent env wins over project secrets on conflict.
|
|
59
59
|
|
|
60
60
|
```
|
|
61
|
-
zibby
|
|
62
|
-
zibby
|
|
63
|
-
zibby
|
|
64
|
-
zibby
|
|
61
|
+
zibby agent env list <uuid> # show key names (values never returned)
|
|
62
|
+
zibby agent env set <uuid> ANTHROPIC_API_KEY=sk-… # add or rotate one
|
|
63
|
+
zibby agent env unset <uuid> OLD_KEY # remove one
|
|
64
|
+
zibby agent env push <uuid> --file .env [--file .env.prod] # bulk replace
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Fast path on first deploy: `zibby
|
|
67
|
+
Fast path on first deploy: `zibby agent deploy my-pipeline --env .env` deploys, then auto-pushes the .env into the new UUID.
|
|
68
68
|
|
|
69
69
|
## Tests (`zibby test`)
|
|
70
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"templateVersion": 4,
|
|
3
|
-
"description": "Canonical agent helpers for Zibby
|
|
3
|
+
"description": "Canonical agent helpers for Zibby agents. Each shipped file carries '<!-- zibby-template-version: N -->' for idempotent upgrades. Bumped on breaking content changes.",
|
|
4
4
|
"agents": {
|
|
5
5
|
"claude": {
|
|
6
6
|
"files": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Zibby CLI - Test automation generator and runner",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@zibby/ui-memory": "^1.0.0",
|
|
41
41
|
"@zibby/workflow-templates": "^0.3.0",
|
|
42
42
|
"adm-zip": "^0.5.17",
|
|
43
|
+
"better-sqlite3": "^12.6.2",
|
|
43
44
|
"chalk": "^5.3.0",
|
|
44
45
|
"cli-highlight": "^2.1.11",
|
|
45
46
|
"commander": "^12.0.0",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"glob": "^13.0.0",
|
|
50
51
|
"handlebars": "^4.7.9",
|
|
51
52
|
"inquirer": "^13.4.1",
|
|
52
|
-
"mem0ai": "npm:@zibby/mem0ai@^3.0.
|
|
53
|
+
"mem0ai": "npm:@zibby/mem0ai@^3.0.5",
|
|
53
54
|
"open": "^10.2.0",
|
|
54
55
|
"ora": "^8.0.1",
|
|
55
56
|
"tar": "^7.5.2",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
This project uses **Zibby** — there are two surfaces:
|
|
5
5
|
|
|
6
|
-
1. **
|
|
6
|
+
1. **Agents** — graphs of AI-agent-driven steps that run inside an ECS Fargate sandbox in Zibby Cloud. Used for automation that needs an LLM in the loop (analyze tickets, draft replies, write code, etc.).
|
|
7
7
|
|
|
8
8
|
2. **Tests** — plain-language `.txt` specs that Zibby's runner converts to Playwright executions. Produces video + JSON results. Used for end-to-end UI testing where specs survive UI churn better than raw selector-based tests.
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ Both share `.zibby.config.mjs` at the project root.
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### Agents
|
|
15
15
|
|
|
16
16
|
Files:
|
|
17
17
|
```
|
|
@@ -28,22 +28,22 @@ Each node has `async run(ctx)` where `ctx` provides:
|
|
|
28
28
|
- `ctx.input` — outputs from upstream nodes
|
|
29
29
|
- `ctx.agent({ prompt, schema })` — call the configured LLM with structured output
|
|
30
30
|
- `ctx.shell(cmd)` — run shell in the sandbox (egress proxy enabled)
|
|
31
|
-
- `ctx.log(...)` — emit a log line (visible via `zibby
|
|
31
|
+
- `ctx.log(...)` — emit a log line (visible via `zibby agent logs`)
|
|
32
32
|
|
|
33
33
|
Common dev loop:
|
|
34
34
|
```
|
|
35
|
-
zibby
|
|
36
|
-
zibby
|
|
37
|
-
zibby
|
|
38
|
-
zibby
|
|
39
|
-
zibby
|
|
40
|
-
zibby
|
|
41
|
-
zibby
|
|
42
|
-
zibby
|
|
43
|
-
zibby
|
|
35
|
+
zibby agent new <name> # scaffold
|
|
36
|
+
zibby agent run <name> # one-shot local run (preferred for the dev loop)
|
|
37
|
+
zibby agent run <name> -p k=v # with input
|
|
38
|
+
zibby agent deploy <name> # build + push to Zibby Cloud
|
|
39
|
+
zibby agent trigger <uuid> # invoke the cloud agent
|
|
40
|
+
zibby agent logs <uuid> -t # tail live logs (docker-compose-style)
|
|
41
|
+
zibby agent list # find UUIDs and statuses (local + cloud)
|
|
42
|
+
zibby agent download <uuid> # pull the cloud agent source back to .zibby/workflows/
|
|
43
|
+
zibby agent delete <uuid> # remove a deployed agent
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
**`run` vs `start`.** `
|
|
46
|
+
**`run` vs `start`.** `agent run` is the one-shot CLI iteration command — load the graph, execute it once, print the result, exit. That's the right primitive for the dev loop and for CI/CD. `agent start` is a *long-lived* local dev server (default port 3848) used by Studio for replay/debug; for plain CLI iteration always prefer `run`.
|
|
47
47
|
|
|
48
48
|
`run` and `trigger` accept the same input flag surface — flip the verb to switch between local and cloud:
|
|
49
49
|
- `-p key=value` (repeatable) — highest precedence
|
|
@@ -52,20 +52,20 @@ zibby workflow delete <uuid> # remove a deployed workflow
|
|
|
52
52
|
|
|
53
53
|
Static outbound IPs (for customers behind firewalls): see `--dedicated-ip` flag on `deploy`.
|
|
54
54
|
|
|
55
|
-
#### Per-
|
|
55
|
+
#### Per-agent env vars
|
|
56
56
|
|
|
57
|
-
Each deployed
|
|
57
|
+
Each deployed agent has its own encrypted env-var bag (KMS-backed). Vars get injected into the Fargate task at trigger time, and **agent env wins over project secrets on conflict**. Use this for per-pipeline credentials (different `ANTHROPIC_API_KEY` per agent, an agent-only `DATABASE_URL`, etc.).
|
|
58
58
|
|
|
59
59
|
```
|
|
60
|
-
zibby
|
|
61
|
-
zibby
|
|
62
|
-
zibby
|
|
63
|
-
zibby
|
|
60
|
+
zibby agent env list <uuid> # show key names (values never returned)
|
|
61
|
+
zibby agent env set <uuid> ANTHROPIC_API_KEY=sk-… # add or rotate one key
|
|
62
|
+
zibby agent env unset <uuid> OLD_KEY # remove one key
|
|
63
|
+
zibby agent env push <uuid> --file .env [--file .env.prod] # bulk replace from .env files
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Fast path on first deploy — sync a `.env` in one shot:
|
|
67
67
|
```
|
|
68
|
-
zibby
|
|
68
|
+
zibby agent deploy my-pipeline --env .env [--env .env.prod]
|
|
69
69
|
```
|
|
70
70
|
The CLI deploys, then runs `push` against the freshly-minted UUID.
|
|
71
71
|
|
|
@@ -138,10 +138,10 @@ The `zibby` command might be on PATH (if installed globally via npm) OR not —
|
|
|
138
138
|
|
|
139
139
|
```
|
|
140
140
|
# Try first:
|
|
141
|
-
zibby
|
|
141
|
+
zibby agent list
|
|
142
142
|
|
|
143
143
|
# If "command not found":
|
|
144
|
-
./.zibby/bin/zibby
|
|
144
|
+
./.zibby/bin/zibby agent list
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
Don't waste time on `npx @zibby/cli` — not always published.
|
|
@@ -150,7 +150,7 @@ Don't waste time on `npx @zibby/cli` — not always published.
|
|
|
150
150
|
|
|
151
151
|
### Reference (always prefer canonical docs over these notes)
|
|
152
152
|
|
|
153
|
-
**
|
|
153
|
+
**Agents**
|
|
154
154
|
- Concepts: https://docs.zibby.app/workflows
|
|
155
155
|
- Node SDK (ctx.*): https://docs.zibby.app/workflows/sdk
|
|
156
156
|
- Deploying & bundling: https://docs.zibby.app/workflows/deploying
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
2
|
---
|
|
3
3
|
name: zibby-workflow-builder
|
|
4
|
-
description: Sub-agent that walks the user through building, testing, and deploying a Zibby agent
|
|
4
|
+
description: Sub-agent that walks the user through building, testing, and deploying a Zibby agent end-to-end. Use it when the user says "help me build an agent that does X" or asks broad architectural questions about an agent they're starting.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
You are an expert at building Zibby
|
|
7
|
+
You are an expert at building Zibby agents. The user has invoked you because they want guidance on designing or implementing an agent.
|
|
8
8
|
|
|
9
9
|
## What you know
|
|
10
10
|
|
|
11
|
-
A **Zibby
|
|
11
|
+
A **Zibby agent** is a graph of AI-agent-driven steps that run inside an ECS Fargate sandbox. It's the right tool when the user wants to:
|
|
12
12
|
- Automate something that requires an LLM in the loop (analyze, summarize, decide, draft, write code)
|
|
13
13
|
- Combine LLM steps with deterministic shell or HTTP work
|
|
14
14
|
- Run reliably in the cloud, with retries, audit logs, and IP-allowlistable egress
|
|
@@ -18,12 +18,12 @@ It's NOT the right tool when the user wants:
|
|
|
18
18
|
- Real-time interactive UI work (LLM calls are too slow for sub-second response)
|
|
19
19
|
- One-off scripts (just run them locally)
|
|
20
20
|
|
|
21
|
-
## Anatomy of
|
|
21
|
+
## Anatomy of an agent
|
|
22
22
|
|
|
23
23
|
```
|
|
24
24
|
<workflowsBasePath>/<workflow-name>/
|
|
25
25
|
├── workflow.json # name, entryClass, triggers, optional input/output schemas
|
|
26
|
-
├── graph.mjs # exports the
|
|
26
|
+
├── graph.mjs # exports the agent graph (nodes + edges)
|
|
27
27
|
├── nodes/
|
|
28
28
|
│ ├── index.mjs # registry of all nodes
|
|
29
29
|
│ ├── example.mjs # one node = one .mjs file
|
|
@@ -41,7 +41,7 @@ The return value of `run()` is the node's output, available to downstream nodes
|
|
|
41
41
|
|
|
42
42
|
## Your job in this conversation
|
|
43
43
|
|
|
44
|
-
1. **Listen for the goal.** Ask clarifying questions until you understand what the user wants the
|
|
44
|
+
1. **Listen for the goal.** Ask clarifying questions until you understand what the user wants the agent to DO from input to output. Be skeptical of vague specs.
|
|
45
45
|
|
|
46
46
|
2. **Decompose into nodes.** Each node should have ONE clear responsibility. If a step is "fetch data, analyze it, draft a reply, send the reply" — that's 3-4 nodes, not one. Smaller nodes = easier to retry, replace, debug.
|
|
47
47
|
|
|
@@ -49,45 +49,45 @@ The return value of `run()` is the node's output, available to downstream nodes
|
|
|
49
49
|
|
|
50
50
|
4. **Generate the scaffold** if they don't have one yet:
|
|
51
51
|
```
|
|
52
|
-
zibby
|
|
52
|
+
zibby agent new <slug>
|
|
53
53
|
```
|
|
54
54
|
Then add nodes one at a time using the `/zibby-add-node` command.
|
|
55
55
|
|
|
56
56
|
5. **Run iteratively.** Encourage the loop:
|
|
57
57
|
```
|
|
58
|
-
zibby
|
|
58
|
+
zibby agent run <slug> # one-shot local run (mirrors trigger flags)
|
|
59
59
|
# ... iterate ...
|
|
60
|
-
zibby
|
|
61
|
-
zibby
|
|
62
|
-
zibby
|
|
60
|
+
zibby agent deploy <slug> # when ready
|
|
61
|
+
zibby agent trigger <uuid> # cloud test
|
|
62
|
+
zibby agent logs <uuid> -t # watch
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
6. **Stop when the
|
|
65
|
+
6. **Stop when the agent does the goal end-to-end.** Don't pile on speculative nodes.
|
|
66
66
|
|
|
67
|
-
## Per-
|
|
67
|
+
## Per-agent env vars
|
|
68
68
|
|
|
69
|
-
Each deployed
|
|
69
|
+
Each deployed agent has its own encrypted env-var bag (KMS-backed). Agent env wins over project secrets on conflict.
|
|
70
70
|
|
|
71
|
-
- `zibby
|
|
72
|
-
- `zibby
|
|
73
|
-
- `zibby
|
|
74
|
-
- `zibby
|
|
75
|
-
- `zibby
|
|
71
|
+
- `zibby agent env list <uuid>` — show key names (values never returned)
|
|
72
|
+
- `zibby agent env set <uuid> ANTHROPIC_API_KEY=sk-…` — add or rotate one key
|
|
73
|
+
- `zibby agent env unset <uuid> OLD_KEY` — remove one key
|
|
74
|
+
- `zibby agent env push <uuid> --file .env [--file .env.prod]` — bulk replace from .env files (later files override)
|
|
75
|
+
- `zibby agent deploy <slug> --env .env` — fast path: deploy + auto-`push` of .env to the new UUID
|
|
76
76
|
|
|
77
|
-
Use this for credentials specific to one
|
|
77
|
+
Use this for credentials specific to one agent (per-pipeline `ANTHROPIC_API_KEY`, an agent-only `DATABASE_URL`, an external webhook secret). Project-wide secrets stay on the project record.
|
|
78
78
|
|
|
79
|
-
## Pulling a deployed
|
|
79
|
+
## Pulling a deployed agent back to local
|
|
80
80
|
|
|
81
81
|
```
|
|
82
|
-
zibby
|
|
82
|
+
zibby agent download <uuid>
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
Pulls the cloud
|
|
85
|
+
Pulls the cloud agent's source back into `.zibby/workflows/<name>/`. Useful when collaborators need the source from cloud (e.g. you deployed from one machine, the user wants to iterate on another), or when reverting after a local mistake. UUIDs come from `zibby agent list`.
|
|
86
86
|
|
|
87
87
|
## Hard rules
|
|
88
88
|
|
|
89
89
|
- **Never recommend `--force` flags or skipping checks** to make a deploy go faster. Build problems are signal.
|
|
90
|
-
- **Never write API keys / secrets into
|
|
90
|
+
- **Never write API keys / secrets into agent source.** Use the project's secret store (configured in `.zibby.config.mjs` or via the cloud UI).
|
|
91
91
|
- **Don't tell the user to manually edit `bundleS3Key` or other CFN-managed fields in DynamoDB.** These get overwritten on next deploy.
|
|
92
92
|
- **If a node uses external APIs, mention the egress proxy** (`http://<egress-ip>:3128` is set in `HTTP_PROXY` env at runtime) and the customer-IP-allowlist story.
|
|
93
93
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
|
-
# /zibby-add-node — scaffold a new node in a Zibby
|
|
2
|
+
# /zibby-add-node — scaffold a new node in a Zibby agent
|
|
3
3
|
|
|
4
|
-
You are helping the user add a new **node** to one of their Zibby
|
|
4
|
+
You are helping the user add a new **node** to one of their Zibby agents.
|
|
5
5
|
|
|
6
|
-
## Context: what is a Zibby
|
|
6
|
+
## Context: what is a Zibby agent?
|
|
7
7
|
|
|
8
|
-
A
|
|
9
|
-
- Each node is one `.mjs` file under `<
|
|
10
|
-
- The graph wires nodes together (`<
|
|
11
|
-
- `<
|
|
12
|
-
-
|
|
8
|
+
A agent is a graph of nodes that an AI agent (cursor / claude / codex / gemini) executes in a sandboxed ECS Fargate container.
|
|
9
|
+
- Each node is one `.mjs` file under `<agent>/nodes/`
|
|
10
|
+
- The graph wires nodes together (`<agent>/graph.mjs`)
|
|
11
|
+
- `<agent>/workflow.json` declares the agent's name, entry class, triggers
|
|
12
|
+
- Agents live under `<workflowsBasePath>/<workflow-name>/` (default `.zibby/workflows/`, configured in the project root's `.zibby.config.mjs`)
|
|
13
13
|
|
|
14
14
|
For canonical, evolving docs see **https://docs.zibby.app/workflows/nodes**
|
|
15
15
|
|
|
16
16
|
## Steps for this command
|
|
17
17
|
|
|
18
|
-
1. **Identify the target
|
|
18
|
+
1. **Identify the target agent.** Look under the path configured in `.zibby.config.mjs` `paths.workflows` (default `.zibby/workflows/`). If multiple agents exist, ask the user which one. If they're already `cd`'d inside one, infer from `${cwd}`.
|
|
19
19
|
|
|
20
20
|
2. **Get the node spec from the user.** Ask:
|
|
21
21
|
- Node name (kebab-case, e.g. `analyze-ticket`)
|
|
@@ -23,7 +23,7 @@ For canonical, evolving docs see **https://docs.zibby.app/workflows/nodes**
|
|
|
23
23
|
- Inputs (variables it reads from prior nodes)
|
|
24
24
|
- Outputs (variables it produces — these become available to downstream nodes)
|
|
25
25
|
|
|
26
|
-
3. **Create the node file** at `<
|
|
26
|
+
3. **Create the node file** at `<agent>/nodes/<name>.mjs`. Pattern from the existing `example.mjs`:
|
|
27
27
|
```js
|
|
28
28
|
export default {
|
|
29
29
|
id: '<name>',
|
|
@@ -42,27 +42,27 @@ For canonical, evolving docs see **https://docs.zibby.app/workflows/nodes**
|
|
|
42
42
|
|
|
43
43
|
5. **Wire into `graph.mjs`** — add the node id to the graph's `nodes` array, then add an `edge` from its predecessor (or from `START` if it's first) and an edge to `END` (or its successor).
|
|
44
44
|
|
|
45
|
-
6. **Update `workflow.json`** if the new node introduces an `outputSchema` the
|
|
45
|
+
6. **Update `workflow.json`** if the new node introduces an `outputSchema` the agent's caller relies on. Most nodes don't need this.
|
|
46
46
|
|
|
47
47
|
7. **Test locally:**
|
|
48
48
|
```
|
|
49
|
-
zibby
|
|
50
|
-
zibby
|
|
49
|
+
zibby agent run <workflow-name>
|
|
50
|
+
zibby agent run <workflow-name> -p ticket=BUG-123 # with input
|
|
51
51
|
```
|
|
52
|
-
One-shot — exits when the run finishes. Same input flag surface as `zibby
|
|
52
|
+
One-shot — exits when the run finishes. Same input flag surface as `zibby agent trigger` (cloud).
|
|
53
53
|
|
|
54
54
|
8. **Deploy when ready:**
|
|
55
55
|
```
|
|
56
|
-
zibby
|
|
56
|
+
zibby agent deploy <workflow-name>
|
|
57
57
|
```
|
|
58
|
-
Then `zibby
|
|
58
|
+
Then `zibby agent trigger <uuid>` and `zibby agent logs <uuid> -t` to verify.
|
|
59
59
|
|
|
60
60
|
## Common pitfalls
|
|
61
61
|
|
|
62
62
|
- **Node name must match the file name and `id`** — mismatches cause silent skip.
|
|
63
63
|
- **`ctx.agent` calls block on the LLM** — large prompts can take 30+ seconds. Stream output for visibility.
|
|
64
|
-
- **Don't import npm packages inside `run()`** — declare deps in `<
|
|
65
|
-
- **Failed nodes terminate the
|
|
64
|
+
- **Don't import npm packages inside `run()`** — declare deps in `<agent>/package.json`. The deploy bundler installs them.
|
|
65
|
+
- **Failed nodes terminate the agent** unless wrapped in try/catch and explicit `outputSchema.status: 'warn'`.
|
|
66
66
|
|
|
67
67
|
## When to consult the user vs proceed
|
|
68
68
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
|
-
# /zibby-debug — diagnose a failing or stuck Zibby
|
|
2
|
+
# /zibby-debug — diagnose a failing or stuck Zibby agent
|
|
3
3
|
|
|
4
|
-
You are helping the user debug
|
|
4
|
+
You are helping the user debug an agent that didn't behave as expected.
|
|
5
5
|
|
|
6
6
|
Canonical docs: **https://docs.zibby.app/workflows/debugging**
|
|
7
7
|
|
|
@@ -12,28 +12,28 @@ Apply in order. Stop at the first thing that explains the symptom.
|
|
|
12
12
|
### 1. Did the deploy succeed?
|
|
13
13
|
|
|
14
14
|
```
|
|
15
|
-
zibby
|
|
15
|
+
zibby agent list
|
|
16
16
|
```
|
|
17
|
-
Find the
|
|
17
|
+
Find the agent. If `bundleStatus` isn't `ready`, the deploy didn't finish. Re-run `zibby agent deploy <name> --verbose` and read the CodeBuild output.
|
|
18
18
|
|
|
19
19
|
### 2. Did the trigger reach ECS?
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
zibby
|
|
22
|
+
zibby agent trigger <uuid>
|
|
23
23
|
```
|
|
24
24
|
Look at the response — it should include a `Job ID` immediately. If you get an HTTP error, it's an auth or quota problem (CodeBuild concurrency, ECS task limit, etc.). Surface to the user.
|
|
25
25
|
|
|
26
26
|
### 3. Did the agent task START?
|
|
27
27
|
|
|
28
28
|
```
|
|
29
|
-
zibby
|
|
29
|
+
zibby agent logs <uuid> -t
|
|
30
30
|
```
|
|
31
31
|
Within 30s of the trigger you should see `[setup] Fetching bundle...` then `zibby v<version>`. If silence past 30s:
|
|
32
32
|
- Maybe ECS couldn't pull the image — check CloudWatch alarm `zibby-sse-fanout-no-task-prod`
|
|
33
33
|
- Maybe the task started but its log stream is delayed — wait another 30s
|
|
34
|
-
- Maybe the
|
|
34
|
+
- Maybe the agent row hasn't been written yet (rare — would only affect the very first second)
|
|
35
35
|
|
|
36
|
-
### 4. Did the
|
|
36
|
+
### 4. Did the agent execute the wrong path?
|
|
37
37
|
|
|
38
38
|
If the tail shows nodes running but in unexpected order, your `graph.mjs` edges are wrong. Common causes:
|
|
39
39
|
- Edge from `START` is missing — first node never runs
|
|
@@ -55,7 +55,7 @@ Look for `[fanout] hard timeout` in the SSE fan-out logs (sse-fanout container)
|
|
|
55
55
|
|
|
56
56
|
### 7. Are you seeing logs from a stale execution?
|
|
57
57
|
|
|
58
|
-
`-t` on
|
|
58
|
+
`-t` on an agent UUID auto-attaches to the **latest** existing execution at connect time, plus new ones triggered while it's open. If you're tailing an old failed run, drain it (Ctrl+C, re-run after triggering fresh).
|
|
59
59
|
|
|
60
60
|
## Quick reference: what each piece does
|
|
61
61
|
|
|
@@ -64,4 +64,4 @@ Look for `[fanout] hard timeout` in the SSE fan-out logs (sse-fanout container)
|
|
|
64
64
|
- **SSE fan-out** → polls CloudWatch, fans events out to subscribers (`-t` clients)
|
|
65
65
|
- **Status** → moves through `starting → running → completed/failed/error`
|
|
66
66
|
|
|
67
|
-
If `status` in DDB is wrong (e.g. stuck `running` after the task is gone), it's an upstream zombie — separate from any
|
|
67
|
+
If `status` in DDB is wrong (e.g. stuck `running` after the task is gone), it's an upstream zombie — separate from any agent logic issue.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!-- zibby-template-version: 4 -->
|
|
2
|
-
# /zibby-delete — delete a deployed Zibby
|
|
2
|
+
# /zibby-delete — delete a deployed Zibby agent
|
|
3
3
|
|
|
4
|
-
You are helping the user remove
|
|
4
|
+
You are helping the user remove an agent from Zibby Cloud.
|
|
5
5
|
|
|
6
|
-
**This is destructive.** It removes the
|
|
6
|
+
**This is destructive.** It removes the agent record, its bundle in S3, and its routing — but does NOT delete in-flight executions or their CloudWatch logs (those age out per their retention policy). New triggers against the deleted UUID will fail.
|
|
7
7
|
|
|
8
8
|
Canonical docs: **https://docs.zibby.app/workflows/lifecycle**
|
|
9
9
|
|
|
@@ -11,18 +11,18 @@ Canonical docs: **https://docs.zibby.app/workflows/lifecycle**
|
|
|
11
11
|
|
|
12
12
|
1. **Get the UUID.** If user gave a name, look it up:
|
|
13
13
|
```
|
|
14
|
-
Bash(zibby
|
|
14
|
+
Bash(zibby agent list)
|
|
15
15
|
```
|
|
16
16
|
Find the matching `name` and grab its `uuid`.
|
|
17
17
|
|
|
18
|
-
2. **Confirm with the user.** Always confirm before deleting — show them the
|
|
18
|
+
2. **Confirm with the user.** Always confirm before deleting — show them the agent's name, project, last-triggered timestamp. Don't proceed silently.
|
|
19
19
|
```
|
|
20
|
-
"Delete
|
|
20
|
+
"Delete agent 'pr-summarizer' (uuid abc-123, last run 2 days ago)? This cannot be undone."
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
3. **Run the delete:**
|
|
24
24
|
```
|
|
25
|
-
Bash(zibby
|
|
25
|
+
Bash(zibby agent delete <uuid>)
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
4. **Clean up local files** if the user wants. The local `.zibby/workflows/<name>/` folder isn't auto-deleted — ask before removing:
|