zcode-agent 1.0.0 → 1.2.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/README.md +68 -11
- package/assets/acp-agents.md +11 -0
- package/bin/zcode-agent-acp.js +11 -0
- package/bin/zcode-agent.js +30 -6
- package/lib/acp-map.js +543 -0
- package/lib/acp.js +763 -0
- package/lib/appserver.js +42 -12
- package/lib/bootstrap.js +2 -1
- package/lib/commands/acp.js +35 -0
- package/lib/commands/sessions.js +6 -2
- package/lib/help.js +17 -2
- package/lib/isolation.js +5 -1
- package/lib/models.js +5 -3
- package/lib/plan.js +2 -2
- package/lib/ui.js +1 -1
- package/package.json +9 -4
- package/skills/claude-code/zcode-agent/SKILL.md +3 -3
- package/skills/codex/zcode-agent/SKILL.md +3 -3
package/lib/appserver.js
CHANGED
|
@@ -35,7 +35,7 @@ class TurnError extends Error {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
class AppServerClient {
|
|
38
|
-
constructor({ nodeBin, enginePath, env, cwd, scrub = (s) => s }) {
|
|
38
|
+
constructor({ nodeBin, enginePath, env, cwd, scrub = (s) => s, interactions = null }) {
|
|
39
39
|
this.nodeBin = nodeBin;
|
|
40
40
|
this.enginePath = enginePath;
|
|
41
41
|
this.env = env;
|
|
@@ -47,6 +47,9 @@ class AppServerClient {
|
|
|
47
47
|
this.onFrame = null; // (frame) => void for every notification
|
|
48
48
|
this.dead = false;
|
|
49
49
|
this.engineStderr = '';
|
|
50
|
+
// ACP (lib/acp.js): {permission(params), userInput(params)} → the
|
|
51
|
+
// engine's reply, asked of a person instead of the headless policy.
|
|
52
|
+
this.interactions = interactions;
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
start() {
|
|
@@ -135,13 +138,21 @@ class AppServerClient {
|
|
|
135
138
|
reply(RUNTIME_PREFERENCES);
|
|
136
139
|
return;
|
|
137
140
|
}
|
|
141
|
+
if (this.interactions && (method === 'interaction/requestPermission' || method === 'interaction/requestUserInput')) {
|
|
142
|
+
const ask = method === 'interaction/requestPermission' ? this.interactions.permission : this.interactions.userInput;
|
|
143
|
+
Promise.resolve()
|
|
144
|
+
.then(() => ask(frame.params || {}))
|
|
145
|
+
.then(reply, (err) => replyError(-32000, `zcode-agent: ${err && err.message ? err.message : err}`));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
138
148
|
if (method === 'interaction/requestPermission') {
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
|
|
149
|
+
// The reply schema is strict ({decision, reason?, modifiedInput?,
|
|
150
|
+
// permissionUpdates?}; live-probed 1.1: an extra resolvedAt made the
|
|
151
|
+
// engine deny the tool). The request's own "allow once" option carries
|
|
152
|
+
// a reply in exactly that shape.
|
|
153
|
+
reply(allowOnce(frame.params) || {
|
|
142
154
|
decision: 'allow',
|
|
143
155
|
reason: 'zcode-agent: headless auto-approve (yolo mode; --cwd is the blast radius)',
|
|
144
|
-
resolvedAt: new Date().toISOString(),
|
|
145
156
|
});
|
|
146
157
|
return;
|
|
147
158
|
}
|
|
@@ -215,6 +226,13 @@ class AppServerClient {
|
|
|
215
226
|
}
|
|
216
227
|
}
|
|
217
228
|
|
|
229
|
+
// The engine's reply for a permission request's "allow once" option, or null.
|
|
230
|
+
function allowOnce(params) {
|
|
231
|
+
const options = (params && Array.isArray(params.options)) ? params.options : [];
|
|
232
|
+
const option = options.find((o) => o && o.kind === 'allow_once' && o.response);
|
|
233
|
+
return option ? option.response : null;
|
|
234
|
+
}
|
|
235
|
+
|
|
218
236
|
// --- turn orchestration -----------------------------------------------------
|
|
219
237
|
|
|
220
238
|
function workspaceKeyFor(workspacePath) {
|
|
@@ -297,10 +315,11 @@ async function openSession(client, {
|
|
|
297
315
|
effort,
|
|
298
316
|
resumeSessionId = null,
|
|
299
317
|
requiredMcp = [],
|
|
318
|
+
mode = 'yolo',
|
|
300
319
|
onEvent = () => {},
|
|
301
320
|
onMcpStatuses = () => {},
|
|
302
321
|
}) {
|
|
303
|
-
const session = { sessionId: null, resumed: false, mode: null };
|
|
322
|
+
const session = { sessionId: null, resumed: false, mode: null, created: null };
|
|
304
323
|
if (resumeSessionId) {
|
|
305
324
|
const resumed = await client.request(
|
|
306
325
|
'session/resume',
|
|
@@ -311,14 +330,15 @@ async function openSession(client, {
|
|
|
311
330
|
session.sessionId = s.sessionId || resumeSessionId;
|
|
312
331
|
session.resumed = true;
|
|
313
332
|
session.mode = s.mode || null;
|
|
314
|
-
|
|
315
|
-
session.mode
|
|
333
|
+
session.created = resumed;
|
|
334
|
+
await client.request('session/setMode', { sessionId: session.sessionId, mode }, { timeoutMs: 15000 });
|
|
335
|
+
session.mode = mode;
|
|
316
336
|
} else {
|
|
317
337
|
const created = await client.request(
|
|
318
338
|
'session/create',
|
|
319
339
|
{
|
|
320
340
|
workspace: { workspacePath, workspaceKey: workspaceKeyFor(workspacePath) },
|
|
321
|
-
mode
|
|
341
|
+
mode,
|
|
322
342
|
model: { providerId: 'zai-api', modelId, options: { reasoningLevel: effort } },
|
|
323
343
|
thoughtLevel: effort,
|
|
324
344
|
// Persist the session row NOW: the default (deferred) loses it to
|
|
@@ -330,11 +350,12 @@ async function openSession(client, {
|
|
|
330
350
|
const s = created.session || created.value || {};
|
|
331
351
|
session.sessionId = s.sessionId;
|
|
332
352
|
session.mode = s.mode || null;
|
|
353
|
+
session.created = created;
|
|
333
354
|
if (!session.sessionId) throw new TurnError('session/create returned no session.sessionId');
|
|
334
355
|
// §9.1 mode ladder: create's mode param is not honored (live-probed).
|
|
335
|
-
if (s.mode !==
|
|
336
|
-
await client.request('session/setMode', { sessionId: session.sessionId, mode
|
|
337
|
-
session.mode =
|
|
356
|
+
if (s.mode !== mode) {
|
|
357
|
+
await client.request('session/setMode', { sessionId: session.sessionId, mode }, { timeoutMs: 15000 });
|
|
358
|
+
session.mode = mode;
|
|
338
359
|
}
|
|
339
360
|
}
|
|
340
361
|
await client.request(
|
|
@@ -360,6 +381,7 @@ async function runTurn(client, session, {
|
|
|
360
381
|
signal = null,
|
|
361
382
|
keepReasoning = false,
|
|
362
383
|
onEvent = () => {},
|
|
384
|
+
onFrame = null,
|
|
363
385
|
}) {
|
|
364
386
|
const started = Date.now();
|
|
365
387
|
const turn = {
|
|
@@ -400,6 +422,13 @@ async function runTurn(client, session, {
|
|
|
400
422
|
client.onFrame = (frame) => {
|
|
401
423
|
const method = frame.method;
|
|
402
424
|
const params = frame.params || {};
|
|
425
|
+
if (onFrame) {
|
|
426
|
+
try {
|
|
427
|
+
onFrame(frame);
|
|
428
|
+
} catch {
|
|
429
|
+
/* a consumer's bug must not take down the engine reader */
|
|
430
|
+
}
|
|
431
|
+
}
|
|
403
432
|
if (method === 'session/event') {
|
|
404
433
|
const type = params.type;
|
|
405
434
|
const payload = params.payload;
|
|
@@ -513,4 +542,5 @@ module.exports = {
|
|
|
513
542
|
workspaceKeyFor,
|
|
514
543
|
waitForMcp,
|
|
515
544
|
RUNTIME_PREFERENCES,
|
|
545
|
+
allowOnce,
|
|
516
546
|
};
|
package/lib/bootstrap.js
CHANGED
|
@@ -57,13 +57,14 @@ function resolveRuntime(env = process.env) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function makeClient(runtime, { home, cwd, sessionEnv = {} }) {
|
|
60
|
+
function makeClient(runtime, { home, cwd, sessionEnv = {}, interactions = null }) {
|
|
61
61
|
return new AppServerClient({
|
|
62
62
|
nodeBin: runtime.nodeBin,
|
|
63
63
|
enginePath: runtime.enginePath,
|
|
64
64
|
env: engineEnv({ home, builtinProviderConfig: runtime.builtinConfig, sessionEnv }),
|
|
65
65
|
cwd,
|
|
66
66
|
scrub: runtime.scrub,
|
|
67
|
+
interactions,
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// lib/commands/acp.js — `zcode-agent acp`: serve the Agent Client Protocol
|
|
3
|
+
// on stdio (lib/acp.js) until the client closes stdin. Flags set the
|
|
4
|
+
// defaults of every session; clients change mode, model and effort per
|
|
5
|
+
// session through ACP config options.
|
|
6
|
+
const { serve } = require('../acp.js');
|
|
7
|
+
const { MODE_IDS } = require('../acp-map.js');
|
|
8
|
+
|
|
9
|
+
module.exports = function acpCommand(parsed) {
|
|
10
|
+
const { flags, given } = parsed;
|
|
11
|
+
if (parsed.prompts.length) {
|
|
12
|
+
process.stderr.write(`zcode-agent: acp takes no arguments (got "${parsed.prompts.join(' ')}"); it speaks ACP on stdio.\n`);
|
|
13
|
+
process.exit(2);
|
|
14
|
+
}
|
|
15
|
+
const mode = flags.mode || process.env.ZCODE_ACP_MODE || 'build';
|
|
16
|
+
if (!MODE_IDS.includes(mode)) {
|
|
17
|
+
process.stderr.write(`zcode-agent: unknown mode "${mode}". --mode accepts ${MODE_IDS.join(' | ')}.\n`);
|
|
18
|
+
process.exit(2);
|
|
19
|
+
}
|
|
20
|
+
serve({
|
|
21
|
+
version: require('../../package.json').version,
|
|
22
|
+
defaults: {
|
|
23
|
+
model: flags.model,
|
|
24
|
+
effort: flags.effort,
|
|
25
|
+
mode,
|
|
26
|
+
mcpSpecs: flags.mcpSpecs,
|
|
27
|
+
hermetic: flags.hermetic,
|
|
28
|
+
browser: !flags.noBrowser,
|
|
29
|
+
skillsDirs: flags.skillsDirs.map((d) => require('node:path').resolve(d)),
|
|
30
|
+
noSkills: flags.noSkills,
|
|
31
|
+
inheritDesktop: flags.inheritDesktop,
|
|
32
|
+
timeoutMs: given.has('timeoutMs') ? flags.timeoutMs : null,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
};
|
package/lib/commands/sessions.js
CHANGED
|
@@ -196,8 +196,12 @@ async function cancel(parsed) {
|
|
|
196
196
|
process.exit(0);
|
|
197
197
|
};
|
|
198
198
|
if (!view.live) return report('not running');
|
|
199
|
+
// An ACP session's pid is the `zcode-agent acp` host, which serves its
|
|
200
|
+
// client's other sessions too: stop only this session's engine. The turn
|
|
201
|
+
// fails in the client; its next prompt starts a new engine.
|
|
202
|
+
const acp = view.kind === 'acp';
|
|
199
203
|
try {
|
|
200
|
-
process.kill(view.pid, 'SIGTERM');
|
|
204
|
+
process.kill(acp ? -view.enginePid : view.pid, 'SIGTERM');
|
|
201
205
|
} catch {
|
|
202
206
|
/* exited in between */
|
|
203
207
|
}
|
|
@@ -207,7 +211,7 @@ async function cancel(parsed) {
|
|
|
207
211
|
view = store.viewSession(store.readSession(id));
|
|
208
212
|
if (!view.live) return report('cancelled');
|
|
209
213
|
}
|
|
210
|
-
for (const target of [view.pid, -view.enginePid]) {
|
|
214
|
+
for (const target of [acp ? null : view.pid, -view.enginePid]) {
|
|
211
215
|
if (!target) continue;
|
|
212
216
|
try {
|
|
213
217
|
process.kill(target, 'SIGKILL'); // negative = the engine's process group
|
package/lib/help.js
CHANGED
|
@@ -8,8 +8,8 @@ const SESSION = ` --id <id> name the session (existing id is never re-ru
|
|
|
8
8
|
--cwd <dir> workspace (default: current dir)
|
|
9
9
|
--owns <path> repeatable: paths this session may change (default: whole workspace)
|
|
10
10
|
--allow-overlap start despite overlapping ownership`;
|
|
11
|
-
const EXEC = ` --model <id> glm-5.3 | glm-5.3-flash (default glm-5.3
|
|
12
|
-
--effort <lvl> low | high | max (default
|
|
11
|
+
const EXEC = ` --model <id> glm-5.3 | glm-5.3-flash (default glm-5.3)
|
|
12
|
+
--effort <lvl> low | high | max (default high)
|
|
13
13
|
--mcp <json|@f> add MCP servers (repeatable) --mcp-inherit --no-browser
|
|
14
14
|
--skills <dir> add skills (repeatable) --no-skills
|
|
15
15
|
--inherit-desktop give the executor the desktop's AGENTS.md, skills, plugins
|
|
@@ -119,6 +119,21 @@ Engine, key, inherited MCP servers and skills, and browser report.
|
|
|
119
119
|
drives (needed only without the ZCode app's own Playwright server).`,
|
|
120
120
|
skills: `usage: zcode-agent skills [install|uninstall] [claude|codex]
|
|
121
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)
|
|
130
|
+
--effort <lvl> low | high | max (default high)
|
|
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.`,
|
|
122
137
|
};
|
|
123
138
|
|
|
124
139
|
function commandHelp(command) {
|
package/lib/isolation.js
CHANGED
|
@@ -358,6 +358,8 @@ const HOST_ONLY_SKILLS = new Set(['control-browser', 'zcode', 'zcode-agent']);
|
|
|
358
358
|
// The executor instructions every engine HOME gets as ~/.zcode/AGENTS.md.
|
|
359
359
|
// Named so that agents working on this repo don't read it as their own.
|
|
360
360
|
const EXECUTOR_AGENTS_MD = path.join(__dirname, '..', 'assets', 'executor-agents.md');
|
|
361
|
+
// `zcode-agent acp`: a person watches and approves in the client.
|
|
362
|
+
const ACP_AGENTS_MD = path.join(__dirname, '..', 'assets', 'acp-agents.md');
|
|
361
363
|
|
|
362
364
|
// Rewrites the frontmatter `model:` of an agent profile when it names
|
|
363
365
|
// GLM-5.3 / GLM-5.3-Flash (any prefix: "account:x/GLM-5.3",
|
|
@@ -385,6 +387,7 @@ function buildEngineHome({
|
|
|
385
387
|
inheritDesktop = false,
|
|
386
388
|
profile = null,
|
|
387
389
|
model = DEFAULT_MODEL,
|
|
390
|
+
instructions = EXECUTOR_AGENTS_MD,
|
|
388
391
|
}) {
|
|
389
392
|
const zdir = path.join(home, '.zcode');
|
|
390
393
|
const v2 = path.join(zdir, 'v2');
|
|
@@ -449,7 +452,7 @@ function buildEngineHome({
|
|
|
449
452
|
// minutes per session (0.7.1), so it is appended only with
|
|
450
453
|
// --inherit-desktop.
|
|
451
454
|
const agentsMd = path.join(zdir, 'AGENTS.md');
|
|
452
|
-
const parts = [fs.readFileSync(
|
|
455
|
+
const parts = [fs.readFileSync(instructions, 'utf8').trim()];
|
|
453
456
|
if (inheritDesktop && fs.existsSync(path.join(live, 'AGENTS.md'))) {
|
|
454
457
|
parts.push(fs.readFileSync(path.join(live, 'AGENTS.md'), 'utf8').trim());
|
|
455
458
|
}
|
|
@@ -609,6 +612,7 @@ module.exports = {
|
|
|
609
612
|
inheritableMcpServers,
|
|
610
613
|
needsOAuth,
|
|
611
614
|
EXECUTOR_AGENTS_MD,
|
|
615
|
+
ACP_AGENTS_MD,
|
|
612
616
|
DEFAULT_BROWSER_SERVER,
|
|
613
617
|
PLAYWRIGHT_MCP_VERSION,
|
|
614
618
|
readMcpHealth,
|
package/lib/models.js
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
const fs = require('node:fs');
|
|
7
7
|
|
|
8
|
-
const DEFAULT_MODEL = 'GLM-5.3
|
|
8
|
+
const DEFAULT_MODEL = 'GLM-5.3';
|
|
9
|
+
const DEFAULT_EFFORT = 'high';
|
|
9
10
|
|
|
10
11
|
// Case-insensitive aliases → official ids (exact ids pass through verbatim;
|
|
11
12
|
// they are exactly "GLM-5.3" / "GLM-5.3-Flash").
|
|
@@ -21,8 +22,8 @@ const ALIASES = new Map([
|
|
|
21
22
|
|
|
22
23
|
const SUPPORTED = ['glm-5.3', 'glm-5.3-flash'];
|
|
23
24
|
|
|
24
|
-
// Effort enum per the bundle's schema (DESIGN §8). `
|
|
25
|
-
//
|
|
25
|
+
// Effort enum per the bundle's schema (DESIGN §8). `high` is the default;
|
|
26
|
+
// `low|high|max` are the levels both models accept.
|
|
26
27
|
const EFFORT_LEVELS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
27
28
|
|
|
28
29
|
function normalizeEffort(input) {
|
|
@@ -171,6 +172,7 @@ module.exports = {
|
|
|
171
172
|
effortProblem,
|
|
172
173
|
FALLBACK_LEVELS,
|
|
173
174
|
DEFAULT_MODEL,
|
|
175
|
+
DEFAULT_EFFORT,
|
|
174
176
|
normalizeModel,
|
|
175
177
|
unknownModelMessage,
|
|
176
178
|
normalizeEffort,
|
package/lib/plan.js
CHANGED
|
@@ -18,7 +18,7 @@ const store = require('./store.js');
|
|
|
18
18
|
const { buildContract } = require('./taskspec.js');
|
|
19
19
|
const { ContractError } = require('./contract.js');
|
|
20
20
|
const { workspaceRoot, normalizeOwns, ownsOverlap, OwnershipError } = require('./workspace.js');
|
|
21
|
-
const { normalizeModel, normalizeEffort, effortProblem, unknownModelMessage, DEFAULT_MODEL } = require('./models.js');
|
|
21
|
+
const { normalizeModel, normalizeEffort, effortProblem, unknownModelMessage, DEFAULT_MODEL, DEFAULT_EFFORT } = require('./models.js');
|
|
22
22
|
const { buildBrief } = require('./brief.js');
|
|
23
23
|
|
|
24
24
|
const BIN = path.join(__dirname, '..', 'bin', 'zcode-agent.js');
|
|
@@ -167,7 +167,7 @@ function checkPlan(r, { name, state } = {}) {
|
|
|
167
167
|
if (!model) {
|
|
168
168
|
problems.push(`session "${s.id}": ${unknownModelMessage(contract.model)}`);
|
|
169
169
|
} else {
|
|
170
|
-
const effort = contract.effort === null ?
|
|
170
|
+
const effort = contract.effort === null ? DEFAULT_EFFORT : normalizeEffort(contract.effort);
|
|
171
171
|
if (!effort) problems.push(`session "${s.id}": contract effort "${contract.effort}" is not valid.`);
|
|
172
172
|
else {
|
|
173
173
|
const p = effortProblem(model, effort, { source: `session "${s.id}" effort` });
|
package/lib/ui.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// are unset, and nothing animates — the feed is append-only lines, so a
|
|
6
6
|
// non-interactive log reads exactly like the terminal did.
|
|
7
7
|
//
|
|
8
|
-
// ▸ zcode zc-1a2b3c4d task GLM-5.3
|
|
8
|
+
// ▸ zcode zc-1a2b3c4d task GLM-5.3 · effort high session header
|
|
9
9
|
// ● executing phase
|
|
10
10
|
// → Edit · ✓ Edit · ✗ Bash tools (dim)
|
|
11
11
|
// ⇢ subagent started / returned subagents
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcode-agent",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Cheap, verified execution for Claude Code and Codex: your orchestrator decides, GLM-5.3
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Cheap, verified execution for Claude Code and Codex: your orchestrator decides, GLM-5.3 builds and tests, and a GLM-5.3-Flash verifier checks the screenshots in headless ZCode sessions (parallel sessions, subagents, dependency plans) and hands back a compact result. Also an ACP agent for T3 Code, Zed and any Agent Client Protocol client. Uses your ZCode app's key, MCP servers and skills, or runs standalone.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
|
-
"zcode-agent": "bin/zcode-agent.js"
|
|
7
|
+
"zcode-agent": "bin/zcode-agent.js",
|
|
8
|
+
"zcode-agent-acp": "bin/zcode-agent-acp.js"
|
|
8
9
|
},
|
|
9
10
|
"engines": {
|
|
10
11
|
"node": ">=22.13"
|
|
@@ -40,7 +41,11 @@
|
|
|
40
41
|
"coding-agent",
|
|
41
42
|
"subagent",
|
|
42
43
|
"headless",
|
|
43
|
-
"mcp"
|
|
44
|
+
"mcp",
|
|
45
|
+
"acp",
|
|
46
|
+
"agent-client-protocol",
|
|
47
|
+
"t3code",
|
|
48
|
+
"zed"
|
|
44
49
|
],
|
|
45
50
|
"repository": {
|
|
46
51
|
"type": "git",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zcode-agent
|
|
3
|
-
description: Delegate scoped implementation work to the zcode-agent CLI (cheap GLM-5.3
|
|
3
|
+
description: Delegate scoped implementation work to the zcode-agent CLI (cheap GLM-5.3 executor with Playwright; an independent GLM-5.3-Flash vision verifier judges UI) and consume its compact verified handback. Use when you are orchestrating: you make the product, design and logic decisions once, then zcode-agent implements, tests, visually verifies and repairs — in one session with subagent units, several parallel sessions, or a dependency plan — while you spend tokens only on decisions and exceptions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Operating zcode-agent as an executor
|
|
7
7
|
|
|
8
8
|
zcode-agent is a CLI execution engine. You decide; it builds. It implements a scoped task in its own session, runs your checks itself, has a fresh, independent vision verifier screenshot and judge UI when you ask, repairs failures within a budget, and returns a small structured handback.
|
|
9
9
|
|
|
10
|
-
**The point is cost.** Your tokens are the expensive ones; GLM-5.3
|
|
10
|
+
**The point is cost.** Your tokens are the expensive ones; GLM-5.3's are cheap. Your tokens go to decisions and exceptions. Everything mechanical — writing code, running builds and tests, reading diffs, looking at screenshots, fixing small failures — is zcode-agent's. If you are doing any of that after dispatch, you are paying twice.
|
|
11
11
|
|
|
12
12
|
Check readiness once per machine: `zcode-agent doctor` (exit 3 → no key: the user runs `zcode-agent login` or sets `ZAI_API_KEY`; with the ZCode app installed its key, MCP servers and skills are used automatically). Don't run `--help` or a bare `zcode-agent status`: everything you need is here.
|
|
13
13
|
|
|
@@ -81,7 +81,7 @@ Parallel sessions cost you nothing extra while they run: one background `wait` o
|
|
|
81
81
|
|
|
82
82
|
Environment: by default the executor gets the ZCode app's MCP servers and user skills (OAuth-only remote servers excluded) plus zcode-agent's own executor instructions; `--hermetic` gives it only your `--mcp` servers and `--skills`. Leave the default unless a run needs to be reproducible on another machine.
|
|
83
83
|
|
|
84
|
-
Model and effort: don't pass `--model`. Everything runs on GLM-5.3
|
|
84
|
+
Model and effort: don't pass `--model` or `--effort`. Everything runs on GLM-5.3 at effort `high` by default: sessions, units and plans. The visual verifier always runs on GLM-5.3-Flash, because only Flash can see images. Use `--model flash` when the user asks for it, or when the executor itself should look at screenshots or attached images (GLM-5.3 can't); it is cheaper and faster too. `--effort low|high|max`. Other values are refused before anything starts.
|
|
85
85
|
|
|
86
86
|
## Running
|
|
87
87
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zcode-agent
|
|
3
|
-
description: Delegate scoped implementation work to the zcode-agent CLI (cheap GLM-5.3
|
|
3
|
+
description: Delegate scoped implementation work to the zcode-agent CLI (cheap GLM-5.3 executor with Playwright; an independent GLM-5.3-Flash vision verifier judges UI) and consume its compact verified handback. Use when you are orchestrating: you make the product, design and logic decisions once, then zcode-agent implements, tests, visually verifies and repairs — in one session with subagent units, several parallel sessions, or a dependency plan — while you spend tokens only on decisions and exceptions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Operating zcode-agent as an executor
|
|
7
7
|
|
|
8
8
|
zcode-agent is a CLI execution engine. You decide; it builds. It implements a scoped task in its own session, runs your checks itself, has a fresh, independent vision verifier screenshot and judge UI when you ask, repairs failures within a budget, and returns a small structured handback.
|
|
9
9
|
|
|
10
|
-
**The point is cost.** Your tokens are the expensive ones; GLM-5.3
|
|
10
|
+
**The point is cost.** Your tokens are the expensive ones; GLM-5.3's are cheap. Your tokens go to decisions and exceptions. Everything mechanical — writing code, running builds and tests, reading diffs, looking at screenshots, fixing small failures — is zcode-agent's. If you are doing any of that after dispatch, you are paying twice.
|
|
11
11
|
|
|
12
12
|
Check readiness once per machine: `zcode-agent doctor` (exit 3 → no key: the user runs `zcode-agent login` or sets `ZAI_API_KEY`; with the ZCode app installed its key, MCP servers and skills are used automatically). Don't run `--help` or a bare `zcode-agent status`: everything you need is here.
|
|
13
13
|
|
|
@@ -81,7 +81,7 @@ Parallel sessions cost you little extra while they run: one `wait` on all of the
|
|
|
81
81
|
|
|
82
82
|
Environment: by default the executor gets the ZCode app's MCP servers and user skills (OAuth-only remote servers excluded) plus zcode-agent's own executor instructions; `--hermetic` gives it only your `--mcp` servers and `--skills`. Leave the default unless a run needs to be reproducible on another machine.
|
|
83
83
|
|
|
84
|
-
Model and effort: don't pass `--model`. Everything runs on GLM-5.3
|
|
84
|
+
Model and effort: don't pass `--model` or `--effort`. Everything runs on GLM-5.3 at effort `high` by default: sessions, units and plans. The visual verifier always runs on GLM-5.3-Flash, because only Flash can see images. Use `--model flash` when the user asks for it, or when the executor itself should look at screenshots or attached images (GLM-5.3 can't); it is cheaper and faster too. `--effort low|high|max`. Other values are refused before anything starts.
|
|
85
85
|
|
|
86
86
|
## Running
|
|
87
87
|
|