@zibby/skills 0.2.22 → 0.2.24
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/browser.js +3 -10
- package/dist/code-scan.d.ts +1 -1
- package/dist/index.js +81 -88
- package/dist/jira.d.ts +75 -9
- package/dist/jira.js +4 -4
- package/dist/package.json +1 -1
- package/dist/report.d.ts +51 -276
- package/dist/trackers/index.js +12 -12
- package/dist/trackers/jira-adapter.js +11 -11
- package/package.json +1 -1
- package/docs/analysis.md +0 -109
- package/docs/apps/agent-ops.md +0 -130
- package/docs/apps/auth.md +0 -158
- package/docs/apps/deploy.md +0 -207
- package/docs/apps/goal-mode.md +0 -175
- package/docs/apps/index.md +0 -149
- package/docs/apps/managing.md +0 -121
- package/docs/cli-reference.md +0 -494
- package/docs/cloning-repositories.md +0 -285
- package/docs/cloud/bundles.md +0 -92
- package/docs/cloud/dedicated-egress.md +0 -140
- package/docs/cloud/editing-prompts.md +0 -79
- package/docs/cloud/env-vars.md +0 -144
- package/docs/cloud/limits.md +0 -81
- package/docs/cloud/logs.md +0 -104
- package/docs/cloud/triggering.md +0 -128
- package/docs/concepts/agents.md +0 -112
- package/docs/concepts/designing-agents.md +0 -247
- package/docs/concepts/graph.md +0 -83
- package/docs/concepts/sessions.md +0 -70
- package/docs/concepts/skills.md +0 -86
- package/docs/concepts/state.md +0 -106
- package/docs/concepts/sub-graphs.md +0 -227
- package/docs/custom-workflows.md +0 -358
- package/docs/get-started/deploy.md +0 -75
- package/docs/get-started/install.md +0 -60
- package/docs/get-started/run-locally.md +0 -94
- package/docs/get-started/trigger-and-logs.md +0 -90
- package/docs/get-started/use-from-agents.md +0 -153
- package/docs/get-started/your-first-workflow.md +0 -69
- package/docs/getting-started.md +0 -108
- package/docs/installation.md +0 -127
- package/docs/integrations/github.md +0 -73
- package/docs/integrations/gitlab.md +0 -43
- package/docs/integrations/jira.md +0 -71
- package/docs/integrations/lark.md +0 -41
- package/docs/integrations/linear.md +0 -43
- package/docs/integrations/notion.md +0 -33
- package/docs/integrations/plane.md +0 -46
- package/docs/integrations/sentry.md +0 -42
- package/docs/integrations/slack.md +0 -33
- package/docs/intro.md +0 -86
- package/docs/legacy/test-automation.md +0 -111
- package/docs/packages/agent-workflow.md +0 -88
- package/docs/packages/cli.md +0 -73
- package/docs/packages/core.md +0 -72
- package/docs/packages/mcp-browser.md +0 -110
- package/docs/packages/mcp-cli.md +0 -176
- package/docs/packages/memory.md +0 -223
- package/docs/packages/skills.md +0 -218
- package/docs/packages/ui-memory.md +0 -245
- package/docs/recipes/bug-autofix.md +0 -85
- package/docs/recipes/github-ai-scout.md +0 -61
- package/docs/recipes/index.md +0 -68
- package/docs/recipes/pipeline-supervisor.md +0 -57
- package/docs/recipes/sentry-triage.md +0 -93
- package/docs/recipes/test.md +0 -190
- package/docs/reviewing-results.md +0 -114
- package/docs/running-tests.md +0 -134
- package/docs/self-host/backup-restore.md +0 -53
- package/docs/self-host/custom-sidecars.md +0 -136
- package/docs/self-host/index.md +0 -75
- package/docs/self-host/storage.md +0 -50
- package/docs/self-host/troubleshooting.md +0 -48
- package/docs/self-host/upgrade.md +0 -81
- package/docs/skills/browser.md +0 -97
- package/docs/skills/chat-memory.md +0 -122
- package/docs/skills/core-tools.md +0 -80
- package/docs/skills/function-skill.md +0 -93
- package/docs/skills/github.md +0 -91
- package/docs/skills/index.md +0 -46
- package/docs/skills/jira.md +0 -99
- package/docs/skills/lark.md +0 -85
- package/docs/skills/memory.md +0 -92
- package/docs/skills/sentry.md +0 -80
- package/docs/skills/slack.md +0 -89
- package/docs/tests/memory.md +0 -131
- package/docs/triggering-workflows.md +0 -552
- package/docs/workflow-artifact-layout-evaluation.md +0 -119
- package/docs/workflow.md +0 -558
package/docs/cloud/env-vars.md
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 4
|
|
3
|
-
title: Per-agent env vars
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Per-agent env vars
|
|
7
|
-
|
|
8
|
-
Each deployed agent has its own encrypted env-var bag. The cloud runtime injects those vars into the Fargate task that runs the agent — they show up in `process.env` like any other env var.
|
|
9
|
-
|
|
10
|
-
Use this for credentials that are **specific to one agent** — different `ANTHROPIC_API_KEY` per agent, an agent-only `DATABASE_URL`, an external webhook secret. Project-wide secrets stay on the project record (set in dashboard); agent env wins on conflict.
|
|
11
|
-
|
|
12
|
-
## The fast path: `--env` at deploy
|
|
13
|
-
|
|
14
|
-
Most users want to ship a `.env` alongside the agent:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
zibby agent deploy my-agent --env .env
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
The CLI deploys the agent as usual, then syncs the `.env` into per-agent env vars. You'll see:
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
✔ Deployed my-agent (v1)
|
|
24
|
-
✔ Bundle ready (78s)
|
|
25
|
-
✔ Synced 4 env vars from .env
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Multiple files merge with later wins (mirrors how dotenv libraries usually layer):
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
zibby agent deploy my-agent --env .env --env .env.prod
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Manage after deploy: `zibby agent env`
|
|
35
|
-
|
|
36
|
-
Four verbs, all keyed by the agent UUID (from `zibby agent list` or `.zibby-deploy.json`):
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
zibby agent env list <uuid> # show key names (no values)
|
|
40
|
-
zibby agent env set <uuid> ANTHROPIC_API_KEY=sk-… # add or rotate one
|
|
41
|
-
zibby agent env unset <uuid> OLD_KEY # remove one
|
|
42
|
-
zibby agent env push <uuid> --file .env [--file .env.prod] # bulk replace
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
`set` is for surgical updates — leaves every other key alone. `push` is the deploy-flow `--env` exposed as a standalone command for when you want to update env without redeploying the agent itself.
|
|
46
|
-
|
|
47
|
-
`list` only returns key names, never values. Once you set a value, the only place it surfaces is inside the running container.
|
|
48
|
-
|
|
49
|
-
### Examples
|
|
50
|
-
|
|
51
|
-
Rotate one key:
|
|
52
|
-
```bash
|
|
53
|
-
zibby agent env set 1a255ded-9f57-44ad-81cf-70726b13d653 ANTHROPIC_API_KEY=sk-ant-rotated
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Wipe all env on an agent (push an empty file):
|
|
57
|
-
```bash
|
|
58
|
-
zibby agent env push <uuid> --file /dev/null
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
CI rotation (GitHub Actions):
|
|
62
|
-
```yaml
|
|
63
|
-
- run: |
|
|
64
|
-
echo "ANTHROPIC_API_KEY=$ANTHROPIC_KEY" > .env.cd
|
|
65
|
-
npx @zibby/cli agent env push $WORKFLOW_UUID --file .env.cd
|
|
66
|
-
env:
|
|
67
|
-
ANTHROPIC_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
68
|
-
WORKFLOW_UUID: ${{ vars.WORKFLOW_UUID }}
|
|
69
|
-
ZIBBY_API_KEY: ${{ secrets.ZIBBY_API_KEY }}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Resolution order at trigger time
|
|
73
|
-
|
|
74
|
-
When a Fargate task starts, env vars come from three layers (later wins):
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
built-in container vars → project secrets (DDB) → agent env (DDB)
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
So if both your project record and your agent env define `ANTHROPIC_API_KEY`, the agent's value is what `process.env.ANTHROPIC_API_KEY` returns inside the run.
|
|
81
|
-
|
|
82
|
-
## Validation
|
|
83
|
-
|
|
84
|
-
| Field | Rule |
|
|
85
|
-
|---|---|
|
|
86
|
-
| Key name | Must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters, digits, underscores; can't start with a digit). Bash-compatible. |
|
|
87
|
-
| Value | Any string. Empty string is allowed. |
|
|
88
|
-
| `.env` files | Standard dotenv syntax — comments, quoted values, blank lines, `KEY=value` per line. |
|
|
89
|
-
|
|
90
|
-
The CLI validates locally before the API round-trip, so `zibby agent env set <uuid> lowercase=v` fails fast with a readable message instead of a 400.
|
|
91
|
-
|
|
92
|
-
## Use case: multi-vendor agents
|
|
93
|
-
|
|
94
|
-
Different nodes in the same agent may want to call different model vendors:
|
|
95
|
-
|
|
96
|
-
```js
|
|
97
|
-
// graph.mjs
|
|
98
|
-
graph
|
|
99
|
-
.addNode('plan', { prompt, outputSchema: Plan, agent: 'claude' }) // uses ANTHROPIC_API_KEY
|
|
100
|
-
.addNode('implement', { prompt, outputSchema: Diff, agent: 'cursor' }) // uses CURSOR_API_KEY
|
|
101
|
-
.addNode('verify', { prompt, outputSchema: Result, agent: 'codex' }); // uses OPENAI_API_KEY
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Drop the three keys into `.env`, deploy:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
cat > .env <<EOF
|
|
108
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
109
|
-
CURSOR_API_KEY=key_...
|
|
110
|
-
OPENAI_API_KEY=sk-...
|
|
111
|
-
EOF
|
|
112
|
-
|
|
113
|
-
zibby agent deploy multi-agent --env .env
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Each agent reads its own env var when invoked. No prompt-stuffing keys, no per-node config.
|
|
117
|
-
|
|
118
|
-
## Security model
|
|
119
|
-
|
|
120
|
-
- **Encryption**: KMS envelope encryption with per-account keys. The plaintext never lands in CloudWatch, DDB, or Lambda logs.
|
|
121
|
-
- **Access control**: every env command needs project-level access on the agent's project — checked on every request.
|
|
122
|
-
- **Audit**: KMS logs every decrypt operation. Cross-reference with `WORKFLOW_JOB_ID` to see exactly which run pulled which secret.
|
|
123
|
-
- **Rotation**: `zibby agent env set` with a new value — the next triggered run picks it up. Currently in-flight runs keep using the value they decrypted at start time.
|
|
124
|
-
|
|
125
|
-
## What this is *not*
|
|
126
|
-
|
|
127
|
-
- **Not for the project's primary credentials** — those live on the project record (dashboard → Project → Secrets). Use agent env for *agent-specific* overrides.
|
|
128
|
-
- **Not a values-readable store** — `list` returns key names only. If you need to retrieve the value, you'll have to push it again. This is intentional.
|
|
129
|
-
- **Not 1Password / Vault** — no rotation policies, no version history. Plain CRUD.
|
|
130
|
-
|
|
131
|
-
## HTTP API (advanced / scripting)
|
|
132
|
-
|
|
133
|
-
If you can't use the CLI (e.g. inline server-side trigger, similar to `triggering.md`'s webhook section), the routes are exposed directly:
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
GET /workflows/{uuid}/env
|
|
137
|
-
PUT /workflows/{uuid}/env body: {"env": {"KEY": "value", ...}}
|
|
138
|
-
PATCH /workflows/{uuid}/env/{key} body: {"value": "..."}
|
|
139
|
-
DELETE /workflows/{uuid}/env/{key}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Auth is `Bearer` (session JWT or `ZIBBY_API_KEY`). Host is `https://api-prod.zibby.app`. There is no `/v1` prefix.
|
|
143
|
-
|
|
144
|
-
For everything else, use the CLI — it's the supported public surface and handles auth + UUID resolution + error messages for you.
|
package/docs/cloud/limits.md
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 4
|
|
3
|
-
title: Limits & quotas
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Limits & quotas
|
|
7
|
-
|
|
8
|
-
## Agent runtime cap
|
|
9
|
-
|
|
10
|
-
Every agent execution has a **30-minute hard cap**. If an agent exceeds it, the
|
|
11
|
-
container is terminated with exit code `124` (timeout) and the execution is marked
|
|
12
|
-
`failed` with reason `TIMEOUT`.
|
|
13
|
-
|
|
14
|
-
Why this exists:
|
|
15
|
-
- Stops runaway agents (infinite loops, hung HTTP calls, stuck npm installs)
|
|
16
|
-
from burning unbounded compute
|
|
17
|
-
- Predictable per-execution cost ceiling
|
|
18
|
-
- Industry standard — GitHub Actions defaults to 6 hours, GitLab CI defaults to
|
|
19
|
-
1 hour, Vercel functions cap at 5 minutes. We picked 30 min as the sweet spot
|
|
20
|
-
for AI-driven agents
|
|
21
|
-
|
|
22
|
-
If your agent needs to run longer:
|
|
23
|
-
- Split it into multiple shorter executions chained via input/output
|
|
24
|
-
- Move long-running work (large npm installs, video processing) into your bundled
|
|
25
|
-
artifact at deploy time so the agent itself stays short
|
|
26
|
-
- Contact us about a Pro tier with a longer cap
|
|
27
|
-
|
|
28
|
-
The cap is enforced **inside** the container by a watchdog timer set on startup,
|
|
29
|
-
so it works even if the AWS-side controls fail.
|
|
30
|
-
|
|
31
|
-
## Per-execution resource budget
|
|
32
|
-
|
|
33
|
-
| Resource | Limit |
|
|
34
|
-
|---|---|
|
|
35
|
-
| Runtime | 30 min |
|
|
36
|
-
| CPU | 1 vCPU |
|
|
37
|
-
| Memory | 2 GB |
|
|
38
|
-
| Disk | 20 GB ephemeral |
|
|
39
|
-
| Outbound bandwidth | Unmetered |
|
|
40
|
-
|
|
41
|
-
If you hit memory or CPU limits, the container is OOM-killed and the execution is
|
|
42
|
-
marked failed.
|
|
43
|
-
|
|
44
|
-
## Container freedom (what you CAN do)
|
|
45
|
-
|
|
46
|
-
Inside your container, your agent has **full control**:
|
|
47
|
-
|
|
48
|
-
- Install any npm package (`npm install`, `pip install`, `apt install` if root)
|
|
49
|
-
- Run any shell command (`curl`, `git`, `docker`-in-docker not supported)
|
|
50
|
-
- Spawn child processes
|
|
51
|
-
- Read/write files in `/workspace`
|
|
52
|
-
- Use the full CPU/memory budget for compute
|
|
53
|
-
|
|
54
|
-
Your code runs in an isolated Fargate task — no shared state with other customers,
|
|
55
|
-
no side effects on Zibby infrastructure.
|
|
56
|
-
|
|
57
|
-
## What you CAN'T do
|
|
58
|
-
|
|
59
|
-
| Boundary | Why |
|
|
60
|
-
|---|---|
|
|
61
|
-
| Talk to other customers' agents | Each task is a separate isolated container |
|
|
62
|
-
| Use someone else's static IP | Only your account's IP is reachable from your task |
|
|
63
|
-
| Run beyond the 30-min cap | Watchdog kills the process |
|
|
64
|
-
| Read Zibby infra secrets | Container IAM role only sees your execution data |
|
|
65
|
-
| Persist state between runs | Containers are ephemeral — use S3 or your DB for state |
|
|
66
|
-
|
|
67
|
-
## Outbound network
|
|
68
|
-
|
|
69
|
-
By default your agent exits via a random AWS IP that changes every run. If you
|
|
70
|
-
need a stable IP for whitelisting customer firewalls, see
|
|
71
|
-
[Dedicated egress IP](./dedicated-egress) ($50/mo addon).
|
|
72
|
-
|
|
73
|
-
## Rate limits
|
|
74
|
-
|
|
75
|
-
| Endpoint | Limit |
|
|
76
|
-
|---|---|
|
|
77
|
-
| Trigger agent | 60/min per account |
|
|
78
|
-
| Read logs | 600/min per account |
|
|
79
|
-
| Deploy agent | 30/hour per account |
|
|
80
|
-
|
|
81
|
-
Hitting a rate limit returns `429 Too Many Requests` with a `Retry-After` header.
|
package/docs/cloud/logs.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 2
|
|
3
|
-
title: Logs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Logs
|
|
7
|
-
|
|
8
|
-
Cloud workflow runs stream to CloudWatch in real time. The CLI exposes them via Server-Sent Events (SSE) — `zibby workflow logs <uuid> -t` is a thin client over that.
|
|
9
|
-
|
|
10
|
-
## Tail live
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
zibby workflow logs <uuid> -t
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
What you see:
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Streaming logs for workflow 2b1ea07f-3ede-4bfd-a51d-431f0bab008e...
|
|
20
|
-
Press Ctrl+C to stop.
|
|
21
|
-
|
|
22
|
-
2026-05-02 23:30:51.345 zibby v0.1.x
|
|
23
|
-
────────────────────────────────────────────────────────────
|
|
24
|
-
Workflow: my-pipeline
|
|
25
|
-
Job: ee333411-...
|
|
26
|
-
Project: 6b60049d-...
|
|
27
|
-
Agent: cursor (model: auto)
|
|
28
|
-
────────────────────────────────────────────────────────────
|
|
29
|
-
[setup] Bundle extracted (3.2s)
|
|
30
|
-
[setup] Loaded MyPipelineWorkflow
|
|
31
|
-
[setup] Registered 5 agent strategies (...)
|
|
32
|
-
|
|
33
|
-
┌ example
|
|
34
|
-
│ ◆ Model: auto | key: ***bc97
|
|
35
|
-
│ Prompt sent to LLM:
|
|
36
|
-
│ ...
|
|
37
|
-
│ ◆ status: warn
|
|
38
|
-
└ done 19.4s
|
|
39
|
-
[done] my-pipeline completed in 19.4s
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Heroku-style follow
|
|
43
|
-
|
|
44
|
-
UUID is a *workflow* identifier, not an execution identifier. With `-t`, after one execution finishes the stream waits for the next trigger of the same workflow and auto-switches:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
Waiting for next execution...
|
|
48
|
-
|
|
49
|
-
┌─ Execution: cd1f55d5...43d7 (task: 3b85ee3a)
|
|
50
|
-
└─ Streaming logs...
|
|
51
|
-
|
|
52
|
-
(streams the new execution)
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Ctrl+C to exit. There's no "exit on completion" mode — if you only want logs from one specific run, dump (without `-t`):
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
zibby workflow logs <uuid>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Reconnects
|
|
62
|
-
|
|
63
|
-
The SSE client reconnects automatically on transient errors. You'll see at most one `SSE Error:` + `Reconnecting...` per outage; once recovered, `Reconnected.` is printed once and the stream continues. No spam during cold-start flap.
|
|
64
|
-
|
|
65
|
-
## Past runs
|
|
66
|
-
|
|
67
|
-
CloudWatch retains logs for 30 days by default. Beyond that, the per-run session folder (uploaded to S3 at the end of each execution) is the long-term archive — accessible via `zibby workflow download <uuid>`.
|
|
68
|
-
|
|
69
|
-
## Programmatic access
|
|
70
|
-
|
|
71
|
-
The same SSE endpoint is consumable from your own code:
|
|
72
|
-
|
|
73
|
-
```js
|
|
74
|
-
const eventSource = new EventSource(
|
|
75
|
-
`https://logs-stream.zibby.app/?jobId=${uuid}`,
|
|
76
|
-
{ headers: { Authorization: `Bearer ${apiKey}` } }
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
eventSource.addEventListener('log', (e) => {
|
|
80
|
-
const { timestamp, message } = JSON.parse(e.data);
|
|
81
|
-
console.log(timestamp, message);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
eventSource.addEventListener('complete', () => {
|
|
85
|
-
console.log('Run finished');
|
|
86
|
-
eventSource.close();
|
|
87
|
-
});
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Or use the polling endpoint for batch retrieval:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
GET /v1/workflows/<uuid>/logs?lines=1000&since=<unix-ms>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Filtering by job ID
|
|
97
|
-
|
|
98
|
-
`uuid` matches the workflow. To pin to a specific execution, pass the job ID instead:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
zibby workflow logs <jobId>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
The CLI auto-detects: if it's an execution row, you stream that one. If it's a workflow row, you get follow-mode.
|
package/docs/cloud/triggering.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 1
|
|
3
|
-
title: Triggering programmatically
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Triggering programmatically
|
|
7
|
-
|
|
8
|
-
The CLI is the public surface for triggering agents. CI runners, cron hosts, webhook handlers — all of them shell out to the same command:
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
zibby agent trigger <uuid>
|
|
12
|
-
zibby agent trigger <uuid> -p ticket=BUG-123
|
|
13
|
-
zibby agent trigger <uuid> --input '{"ticket":"BUG-123","priority":"high"}'
|
|
14
|
-
zibby agent trigger <uuid> --input-file payload.json
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Auth: set `ZIBBY_API_KEY` in the environment, or run `zibby login` once on a workstation. Either works; the CLI picks up whichever is available.
|
|
18
|
-
|
|
19
|
-
The flag surface is identical to `zibby agent run` (local) — same `-p / --input / --input-file`, plus `--idempotency-key` for the cloud-only dedup case below. Flip the verb and the same call shape goes from local to remote.
|
|
20
|
-
|
|
21
|
-
### Input precedence
|
|
22
|
-
|
|
23
|
-
When more than one input source is provided, they merge with this **precedence (highest → lowest)**:
|
|
24
|
-
|
|
25
|
-
1. `-p key=value` (repeatable) — wins over everything; great for shell-friendly tweaks on top of a base payload
|
|
26
|
-
2. `--input '<json>'` — full JSON payload as a string
|
|
27
|
-
3. `--input-file path.json` — full JSON/YAML payload from a file (lowest precedence)
|
|
28
|
-
|
|
29
|
-
This means the common pattern of "load a base payload from disk, override a few keys for this run" works without manual merging:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
zibby agent trigger <uuid> --input-file payload.json -p priority=urgent
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## CI / cron
|
|
36
|
-
|
|
37
|
-
Anywhere you can shell out, call the CLI. Don't hand-roll an HTTP client — you'll just rebuild what the CLI already does (project lookup from UUID, idempotency, quota error messages, retries).
|
|
38
|
-
|
|
39
|
-
### GitHub Actions
|
|
40
|
-
|
|
41
|
-
```yaml
|
|
42
|
-
- name: Trigger Zibby agent
|
|
43
|
-
run: |
|
|
44
|
-
npm i -g @zibby/cli
|
|
45
|
-
zibby agent trigger $WORKFLOW_UUID -p sha=$GITHUB_SHA -p pr=$PR_NUMBER
|
|
46
|
-
env:
|
|
47
|
-
WORKFLOW_UUID: 2b1ea07f-3ede-4bfd-a51d-431f0bab008e
|
|
48
|
-
ZIBBY_API_KEY: ${{ secrets.ZIBBY_API_KEY }}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Cron (any provider)
|
|
52
|
-
|
|
53
|
-
GitHub Actions schedule, Vercel Cron, EventBridge with a Lambda runner, fly.io machines — all the same pattern:
|
|
54
|
-
|
|
55
|
-
```yaml
|
|
56
|
-
on:
|
|
57
|
-
schedule:
|
|
58
|
-
- cron: '0 9 * * 1' # every Monday 9am UTC
|
|
59
|
-
jobs:
|
|
60
|
-
triage:
|
|
61
|
-
runs-on: ubuntu-latest
|
|
62
|
-
steps:
|
|
63
|
-
- run: npm i -g @zibby/cli
|
|
64
|
-
- run: zibby agent trigger $UUID --input '{"weekly":true}'
|
|
65
|
-
env:
|
|
66
|
-
UUID: ${{ vars.WORKFLOW_UUID }}
|
|
67
|
-
ZIBBY_API_KEY: ${{ secrets.ZIBBY_API_KEY }}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Webhook handlers
|
|
71
|
-
|
|
72
|
-
Inside a Node/Python/Go server processing an inbound webhook (Stripe, GitHub, Linear), spawn the CLI from your handler. You inherit all of its behavior — auth, error handling, idempotency — and don't write any of it yourself.
|
|
73
|
-
|
|
74
|
-
```js
|
|
75
|
-
import { execFileSync } from 'node:child_process';
|
|
76
|
-
|
|
77
|
-
app.post('/webhook', (req, res) => {
|
|
78
|
-
if (!verifySignature(req)) return res.status(401).end();
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
execFileSync('zibby', [
|
|
82
|
-
'agent', 'trigger', process.env.WORKFLOW_UUID,
|
|
83
|
-
'--input', JSON.stringify(req.body),
|
|
84
|
-
'--idempotency-key', req.headers['x-event-id'],
|
|
85
|
-
], { env: process.env, stdio: 'pipe' });
|
|
86
|
-
res.status(202).end();
|
|
87
|
-
} catch (err) {
|
|
88
|
-
res.status(502).end();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
If your runtime can't spawn a Node CLI (constrained Lambda layers, edge runtimes, non-Node servers without child_process), open an issue — that's the case worth a real SDK, not a documented HTTP surface.
|
|
94
|
-
|
|
95
|
-
## Idempotency
|
|
96
|
-
|
|
97
|
-
Pass an idempotency key to deduplicate triggers within a 24-hour window:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
zibby agent trigger <uuid> \
|
|
101
|
-
-p ticket=BUG-123 \
|
|
102
|
-
--idempotency-key webhook-2026-05-02-event-7
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Same key + same input within 24h returns the original `jobId` instead of starting a new run. Use the inbound event's ID (`X-Event-Id`, Stripe's `event.id`, GitHub's delivery ID) — that way a retry from the source automatically dedupes.
|
|
106
|
-
|
|
107
|
-
## Tailing the result
|
|
108
|
-
|
|
109
|
-
After triggering, the CLI prints the `jobId`. To watch the execution:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
zibby agent logs <uuid> -t
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
See [`agent logs` in the CLI Reference](../cli-reference#agent-logs).
|
|
116
|
-
|
|
117
|
-
## Per-agent env vars
|
|
118
|
-
|
|
119
|
-
If your agent needs credentials or config that's specific to it (different `ANTHROPIC_API_KEY` per agent, an agent-only `DATABASE_URL`, etc.), set them via the env-var API — see [Per-agent env vars](./env-vars). They get injected into the Fargate task at trigger time and override anything set on the project record.
|
|
120
|
-
|
|
121
|
-
## Quotas
|
|
122
|
-
|
|
123
|
-
Per-project quota:
|
|
124
|
-
- Concurrent executions
|
|
125
|
-
- Total executions per day
|
|
126
|
-
- Per-execution wall-clock cap (default: 30 min)
|
|
127
|
-
|
|
128
|
-
Hit a quota and the trigger errors out with a readable message + retry hint. The CLI surfaces these directly; if you're shelling out from CI, the non-zero exit + stderr is enough to fail the job and have your retry logic kick in.
|
package/docs/concepts/agents.md
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 2
|
|
3
|
-
title: Agent strategies
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Agent strategies
|
|
7
|
-
|
|
8
|
-
A **strategy** is the bridge between a node and a real coding-agent CLI. The framework ships with five built-in strategies; you can also write your own.
|
|
9
|
-
|
|
10
|
-
## Built-ins
|
|
11
|
-
|
|
12
|
-
| Strategy | Backed by | When to pick it |
|
|
13
|
-
|---|---|---|
|
|
14
|
-
| `cursor` | `cursor-agent` CLI | Fast, file-aware, great default for code tasks |
|
|
15
|
-
| `claude` | `@anthropic-ai/claude-agent-sdk` | Best reasoning, deep tool-use loops, large context |
|
|
16
|
-
| `codex` | `@openai/codex` CLI | Strong general-purpose, good for verification nodes |
|
|
17
|
-
| `gemini` | `@google/gemini-cli` | When you specifically want Gemini's behavior |
|
|
18
|
-
| `assistant` | OpenAI Assistants API | Stateful conversations, retrieval, file uploads |
|
|
19
|
-
|
|
20
|
-
## Selecting per node
|
|
21
|
-
|
|
22
|
-
Two ways:
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
// 1. Per-node config — wins over everything else
|
|
26
|
-
graph.addNode('plan', { prompt, outputSchema, agent: 'claude' });
|
|
27
|
-
|
|
28
|
-
// 2. Project default — falls through if no per-node override
|
|
29
|
-
// .zibby.config.mjs
|
|
30
|
-
export default {
|
|
31
|
-
agent: { default: 'cursor' },
|
|
32
|
-
};
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
The resolution order: `node.agent` → `state.agentType` → `process.env.AGENT_TYPE` → project config default.
|
|
36
|
-
|
|
37
|
-
## Models
|
|
38
|
-
|
|
39
|
-
Each agent CLI has its own model selector. Override it via:
|
|
40
|
-
|
|
41
|
-
```js
|
|
42
|
-
// Per-node model
|
|
43
|
-
graph.addNode('plan', {
|
|
44
|
-
prompt,
|
|
45
|
-
outputSchema,
|
|
46
|
-
agent: 'claude',
|
|
47
|
-
model: 'claude-opus-4-6',
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Or globally per-agent in .zibby.config.mjs
|
|
51
|
-
export default {
|
|
52
|
-
agent: {
|
|
53
|
-
default: 'cursor',
|
|
54
|
-
claude: { model: 'claude-opus-4-6' },
|
|
55
|
-
cursor: { model: 'auto' },
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
`auto` (the default for cursor/claude/gemini) uses the agent CLI's own current default — which tracks the latest stable model.
|
|
61
|
-
|
|
62
|
-
## Bring your own
|
|
63
|
-
|
|
64
|
-
The `AgentStrategy` base class is two methods:
|
|
65
|
-
|
|
66
|
-
```js
|
|
67
|
-
import { AgentStrategy, registerStrategy } from '@zibby/agent-workflow';
|
|
68
|
-
|
|
69
|
-
class MyAgent extends AgentStrategy {
|
|
70
|
-
constructor() { super('mine', 'My custom agent', 100); }
|
|
71
|
-
|
|
72
|
-
canHandle(_context) {
|
|
73
|
-
return Boolean(process.env.MY_API_KEY);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async invoke(prompt, { schema, model }) {
|
|
77
|
-
const raw = await fetch('https://my.api/chat', {
|
|
78
|
-
method: 'POST',
|
|
79
|
-
body: JSON.stringify({ prompt, model: model ?? 'default' }),
|
|
80
|
-
}).then(r => r.text());
|
|
81
|
-
|
|
82
|
-
return { raw, structured: schema.parse(JSON.parse(raw)) };
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
registerStrategy(new MyAgent());
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Then a node can use it:
|
|
90
|
-
|
|
91
|
-
```js
|
|
92
|
-
graph.addNode('plan', { prompt, outputSchema: Plan, agent: 'mine' });
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
The framework ships **zero** agent strategies bundled — `@zibby/agent-workflow` is BYO. The five built-ins above live in `@zibby/core`, which is what `zibby agent new` scaffolds and what the cloud runtime preloads.
|
|
96
|
-
|
|
97
|
-
## Authentication
|
|
98
|
-
|
|
99
|
-
| Strategy | Env var | Alternative |
|
|
100
|
-
|---|---|---|
|
|
101
|
-
| `cursor` | `CURSOR_API_KEY` | `cursor-agent login` |
|
|
102
|
-
| `claude` | `ANTHROPIC_API_KEY` | — |
|
|
103
|
-
| `codex` | `OPENAI_API_KEY` | — |
|
|
104
|
-
| `gemini` | `GOOGLE_API_KEY` | — |
|
|
105
|
-
| `assistant` | `OPENAI_API_KEY` | — |
|
|
106
|
-
|
|
107
|
-
In Zibby Cloud, you have two options:
|
|
108
|
-
|
|
109
|
-
- **Project-wide credentials**: set once on the project record (dashboard → Project → Secrets) — every agent in the project uses them.
|
|
110
|
-
- **Per-agent overrides**: set on a single agent via [`PUT /workflows/<uuid>/env`](../cloud/env-vars) — useful when one agent needs a different `ANTHROPIC_API_KEY` from the rest of the project, or when one agent needs to talk to multiple agent vendors with their own keys.
|
|
111
|
-
|
|
112
|
-
Agent env wins over project secrets on conflict (last-write-wins inside the Fargate task).
|