zcode-agent 0.0.0-stage → 1.1.0
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/LICENSE +21 -0
- package/README.md +468 -2
- package/assets/acp-agents.md +11 -0
- package/assets/executor-agents.md +10 -0
- package/bin/zcode-agent-acp.js +11 -0
- package/bin/zcode-agent.js +442 -0
- package/lib/acp-map.js +543 -0
- package/lib/acp.js +763 -0
- package/lib/appserver.js +546 -0
- package/lib/bootstrap.js +71 -0
- package/lib/brief.js +109 -0
- package/lib/checks.js +104 -0
- package/lib/commands/acp.js +35 -0
- package/lib/commands/cost.js +67 -0
- package/lib/commands/doctor.js +179 -0
- package/lib/commands/exec.js +394 -0
- package/lib/commands/login.js +44 -0
- package/lib/commands/mcp-list.js +12 -0
- package/lib/commands/plan.js +302 -0
- package/lib/commands/sessions.js +333 -0
- package/lib/commands/skills.js +47 -0
- package/lib/contract.js +530 -0
- package/lib/cost.js +278 -0
- package/lib/engine.js +212 -0
- package/lib/executor.js +914 -0
- package/lib/help.js +143 -0
- package/lib/isolation.js +625 -0
- package/lib/key.js +81 -0
- package/lib/models.js +179 -0
- package/lib/plan.js +459 -0
- package/lib/ports.js +45 -0
- package/lib/skills.js +92 -0
- package/lib/store.js +340 -0
- package/lib/taskspec.js +114 -0
- package/lib/ui.js +249 -0
- package/lib/verify.js +100 -0
- package/lib/workspace.js +383 -0
- package/package.json +57 -4
- package/skills/README.md +40 -0
- package/skills/claude-code/zcode-agent/SKILL.md +169 -0
- package/skills/codex/zcode-agent/SKILL.md +169 -0
- package/skills/codex/zcode-agent/agents/openai.yaml +4 -0
package/lib/help.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Per-command help: `zcode <command> --help` prints the command's usage and
|
|
3
|
+
// only the flags that apply to it (each text <= 2000 bytes). The full text
|
|
4
|
+
// (bin/zcode-agent.js USAGE) is for `zcode --help` with no command.
|
|
5
|
+
const SESSION = ` --id <id> name the session (existing id is never re-run: use resume)
|
|
6
|
+
--label <text> free-form label shown in status
|
|
7
|
+
--detach start in the background, print the id, exit 0
|
|
8
|
+
--cwd <dir> workspace (default: current dir)
|
|
9
|
+
--owns <path> repeatable: paths this session may change (default: whole workspace)
|
|
10
|
+
--allow-overlap start despite overlapping ownership`;
|
|
11
|
+
const EXEC = ` --model <id> glm-5.3 | glm-5.3-flash (default glm-5.3-flash)
|
|
12
|
+
--effort <lvl> low | high | max (default max)
|
|
13
|
+
--mcp <json|@f> add MCP servers (repeatable) --mcp-inherit --no-browser
|
|
14
|
+
--skills <dir> add skills (repeatable) --no-skills
|
|
15
|
+
--inherit-desktop give the executor the desktop's AGENTS.md, skills, plugins
|
|
16
|
+
--json NDJSON events; last line is the compact brief (--full: whole record)
|
|
17
|
+
--quiet no progress feed; with --json only the result line`;
|
|
18
|
+
|
|
19
|
+
const HELP = {
|
|
20
|
+
task: `usage: zcode-agent task [options] <objective...>
|
|
21
|
+
Execute a task contract, verify it with zcode-run checks, hand back.
|
|
22
|
+
|
|
23
|
+
contract:
|
|
24
|
+
--task <file|-> JSON contract or markdown brief (- = stdin)
|
|
25
|
+
--accept <text> repeatable acceptance criterion
|
|
26
|
+
--check <command> repeatable shell check zcode-agent runs after the work
|
|
27
|
+
--file <path> repeatable file to read first
|
|
28
|
+
--context <text|@f> repeatable context --decision <text> / --decisions <@f>
|
|
29
|
+
--touch <path> repeatable minimal edits allowed outside --owns
|
|
30
|
+
--unit "n: goal [owns a,b]" repeatable subagent unit
|
|
31
|
+
--visual <criterion> repeatable --viewport <WxH> --serve <cmd>
|
|
32
|
+
--preflight read-only: list open questions, no edits
|
|
33
|
+
--max-repairs <n> default 2 --check-timeout-ms <n> default 300000
|
|
34
|
+
session:
|
|
35
|
+
${SESSION}
|
|
36
|
+
--timeout-ms <n> whole invocation (default 7200000 = 2 h)
|
|
37
|
+
${EXEC}
|
|
38
|
+
Full reference: zcode-agent --help`,
|
|
39
|
+
run: `usage: zcode-agent [run] [options] <prompt...>
|
|
40
|
+
One-shot turn (prompt via stdin when piped).
|
|
41
|
+
--session <id> continue a session
|
|
42
|
+
--timeout-ms <n> default 600000
|
|
43
|
+
--thinking | --no-thinking mirror reasoning to stderr
|
|
44
|
+
${SESSION}
|
|
45
|
+
${EXEC}
|
|
46
|
+
Full reference: zcode-agent --help`,
|
|
47
|
+
agent: `usage: zcode-agent agent [options] <instructions...>
|
|
48
|
+
Turn that MUST dispatch a subagent.
|
|
49
|
+
--profile <name> subagent profile (default general-purpose)
|
|
50
|
+
--timeout-ms <n> default 600000
|
|
51
|
+
${SESSION}
|
|
52
|
+
${EXEC}
|
|
53
|
+
Full reference: zcode-agent --help`,
|
|
54
|
+
resume: `usage: zcode-agent resume <id> [message...]
|
|
55
|
+
Continue a session: answer questions, follow up, or retry after a timeout.
|
|
56
|
+
Pass "-" as the message to read it from stdin.
|
|
57
|
+
--timeout-ms <n> --max-repairs <n> --check-timeout-ms <n>
|
|
58
|
+
--model <id> --effort <lvl>
|
|
59
|
+
--json --full --quiet --include-reasoning
|
|
60
|
+
Start-time flags (--id, --owns, --cwd, ...) cannot change on resume.`,
|
|
61
|
+
status: `usage: zcode-agent status [<id>] [--all] [--json]
|
|
62
|
+
One session in detail, or the 15 most recent (--all: every session).
|
|
63
|
+
--json machine-readable list or detail`,
|
|
64
|
+
wait: `usage: zcode-agent wait <id...> [--any] [--json] [--full] [--timeout-ms n]
|
|
65
|
+
Block until sessions finish; print each handback.
|
|
66
|
+
--any return when the FIRST id finishes
|
|
67
|
+
--timeout-ms <n> one line per pending session, exit 124
|
|
68
|
+
--json briefs --full full records`,
|
|
69
|
+
watch: `usage: zcode-agent watch [<id>… | --plan <name>] [--stall-min n]
|
|
70
|
+
Live view of sessions, no model tokens. One line each:
|
|
71
|
+
id state phase[ n/m] elapsed last: <tool> <age> ago req <n> sub <running> $cost
|
|
72
|
+
"thinking 12m 40k chars" / "writing …" appears while one model request streams.
|
|
73
|
+
cost: every GLM request so far (implementer, subagents, verifier) at Z.ai API
|
|
74
|
+
list price, from the engine's own ledger; with several sessions a total line
|
|
75
|
+
follows. STALLED? is appended when a running session has had no engine event for
|
|
76
|
+
--stall-min minutes (default 8). Nothing is done automatically.
|
|
77
|
+
<id…> the sessions to watch
|
|
78
|
+
--plan name every session of a plan
|
|
79
|
+
(no args) live sessions and those finished in the last 10 minutes
|
|
80
|
+
TTY: redraws every 2 s. Piped: a line is printed only when a session changes.
|
|
81
|
+
Exits 0 when every watched session has finished; Ctrl-C exits 0.`,
|
|
82
|
+
cost: `usage: zcode-agent cost [<dir>] [--app] [--json]
|
|
83
|
+
GLM cost of every zcode-agent session whose workspace is <dir> or below it (default:
|
|
84
|
+
the current directory), per session and in total, at Z.ai API list price
|
|
85
|
+
(USD per M tokens: GLM-5.3-Flash 0.15 input / 0.03 cached / 0.50 output;
|
|
86
|
+
GLM-5.3 1.40 / 0.26 / 4.40). Counts come from each session's engine DB:
|
|
87
|
+
every request of the implementer, its subagents and the visual verifier,
|
|
88
|
+
across resumes. ~ marks an estimate (no cache split).
|
|
89
|
+
--app also the desktop app's own sessions in that directory
|
|
90
|
+
--json {type:"cost", dir, total, sessions[, app]}
|
|
91
|
+
ZCODE_PRICES='{"GLM-5.3-Flash":{"input":0.15,"cached":0.03,"output":0.5}}' overrides.`,
|
|
92
|
+
result: `usage: zcode-agent result <id> [--json] [--full]
|
|
93
|
+
Print a finished session's handback without waiting (exit 7 if running).
|
|
94
|
+
--json compact brief --full the whole record`,
|
|
95
|
+
cancel: `usage: zcode-agent cancel <id> [--json]
|
|
96
|
+
Stop a running session (SIGTERM, SIGKILL after 15 s). No-op when finished.`,
|
|
97
|
+
plan: `usage: zcode-agent plan <subcommand>
|
|
98
|
+
zcode-agent plan check <file> validate (ids, after, cycles, owns, effort)
|
|
99
|
+
zcode-agent plan run <file> [--preflight] [--detach] [--timeout-ms n] [--id name] [--json]
|
|
100
|
+
zcode-agent plan wait|status <name> [--timeout-ms n] [--json]
|
|
101
|
+
zcode-agent plan resume <name> [message...] [--session <id>]
|
|
102
|
+
plan file: {cwd?, decisions?, context?, files?, model?, effort?, limits?,
|
|
103
|
+
sessions:[{id, after?:[ids], label?, ...task contract keys}]}
|
|
104
|
+
top-level decisions/context/files are prepended to every session; limits
|
|
105
|
+
({timeoutMs,maxRepairs,checkTimeoutMs}) default every session; "@file"
|
|
106
|
+
resolves next to the plan file, then against its cwd.
|
|
107
|
+
--preflight read-only preflight of every session (sessions with "after"
|
|
108
|
+
are told to assume their prerequisites)
|
|
109
|
+
--detach supervise in a background process
|
|
110
|
+
--id <name> plan name (default: file basename)
|
|
111
|
+
--cwd <dir> workspace override
|
|
112
|
+
Exit: 0 completed, 10 blocked, 8 partial/failed, 124 timeout.`,
|
|
113
|
+
login: `usage: printf %s "$ZAI_API_KEY" | zcode-agent login
|
|
114
|
+
Store a Z.ai API key (read from piped stdin, never echoed) in ~/.zcode-agent.
|
|
115
|
+
Not needed when ZAI_API_KEY is set or the ZCode app holds a key.`,
|
|
116
|
+
doctor: `usage: zcode-agent doctor [--json] [--install-browser]
|
|
117
|
+
Engine, key, inherited MCP servers and skills, and browser report.
|
|
118
|
+
--install-browser installs the Chromium build the default Playwright server
|
|
119
|
+
drives (needed only without the ZCode app's own Playwright server).`,
|
|
120
|
+
skills: `usage: zcode-agent skills [install|uninstall] [claude|codex]
|
|
121
|
+
Install the orchestrator skills (default: show status).`,
|
|
122
|
+
acp: `usage: zcode-agent acp [options]
|
|
123
|
+
Serve the Agent Client Protocol (ACP v1) on stdio: T3 Code, Zed and any ACP
|
|
124
|
+
client run GLM-5.3 through it. Each ACP session is a zcode-agent session
|
|
125
|
+
(status, watch, cost see it); clients switch mode, model and effort per session.
|
|
126
|
+
--mode <mode> default for new sessions: build (ask before edits and
|
|
127
|
+
commands) | edit (accept edits) | plan | yolo (full access)
|
|
128
|
+
default build (or $ZCODE_ACP_MODE)
|
|
129
|
+
--model <id> glm-5.3 | glm-5.3-flash (default glm-5.3-flash)
|
|
130
|
+
--effort <lvl> low | high | max (default max)
|
|
131
|
+
--timeout-ms <n> per prompt (default: none)
|
|
132
|
+
--mcp <json|@f> add MCP servers (repeatable) --hermetic --no-browser
|
|
133
|
+
--skills <dir> add skills (repeatable) --no-skills
|
|
134
|
+
--inherit-desktop also the desktop's AGENTS.md, plugins and agent profiles
|
|
135
|
+
T3 Code: an ACP Registry provider, source "Local command", executable
|
|
136
|
+
zcode-agent-acp (see the README). $ZCODE_ACP_LOG=<file> logs every frame.`,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
function commandHelp(command) {
|
|
140
|
+
return HELP[command] || null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
module.exports = { commandHelp };
|