@zenera/cli 1.3.3 → 1.3.5
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/ask.d.ts +5 -5
- package/dist/ask.js +56 -18
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +11 -5
- package/dist/commands/init.js +8 -9
- package/dist/commands/inspect.js +12 -5
- package/dist/commands/key.js +2 -2
- package/dist/commands/models.js +9 -6
- package/dist/liveness.js +3 -2
- package/dist/modelref.d.ts +11 -6
- package/dist/modelref.js +23 -23
- package/dist/scaffold.js +16 -8
- package/dist/trace.js +1 -0
- package/dist/validate.js +107 -9
- package/package.json +6 -6
- package/templates/editor/.github/copilot-instructions.md +60 -20
- package/templates/editor/.github/skills/add-mcp/SKILL.md +43 -0
- package/templates/editor/.github/skills/finetune/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-analyze-run/SKILL.md +4 -2
- package/templates/editor/.github/skills/zen-cli/references/keys.md +1 -1
- package/templates/editor/.github/skills/zen-cli/references/models.md +8 -8
- package/templates/editor/.github/skills/zen-cli/references/projects.md +2 -0
- package/templates/editor/.github/skills/zen-cli/references/rag.md +1 -1
- package/templates/editor/.github/skills/zen-finetune/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-finetune-apply/SKILL.md +3 -2
- package/templates/editor/.github/skills/zen-inspect-ask/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-instructions/SKILL.md +50 -37
- package/templates/editor/.github/skills/zen-mcp/SKILL.md +142 -0
- package/templates/editor/.github/skills/zen-mcp/references/discovery.md +120 -0
- package/templates/editor/.github/skills/zen-mcp/references/install.md +159 -0
- package/templates/editor/.github/skills/zen-mcp/references/memory-cache.md +73 -0
- package/templates/editor/.github/skills/zen-memory/SKILL.md +2 -2
- package/templates/editor/.github/skills/zen-memory-warmup/SKILL.md +3 -3
- package/templates/editor/.github/skills/zen-rag-docs/SKILL.md +6 -6
- package/templates/editor/.github/skills/zen-rag-schema/SKILL.md +5 -5
- package/templates/editor/.github/skills/zen-review/SKILL.md +5 -3
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +3 -2
- package/templates/editor/.github/skills/zen-spec-sync/SKILL.md +2 -1
- package/templates/editor/.github/skills/zen-spec-sync/scripts/snapshot.sh +1 -1
- package/templates/parts/memory-terms.yaml.tmpl +1 -1
- package/templates/parts/models.yaml.tmpl +1 -1
- package/templates/project/agents/mcp-instructions.md +66 -0
- package/templates/project/agents/mcp-memory-instructions.md +28 -0
- package/templates/project/scripts/_setup.sh +1 -1
package/dist/validate.js
CHANGED
|
@@ -19,8 +19,14 @@ const FILE_RULES = 'agents/files-instructions.md';
|
|
|
19
19
|
const MEMORY_RULES = 'agents/memory-instructions.md';
|
|
20
20
|
/** The only place forking is explained to a model; the same holds. */
|
|
21
21
|
const FORK_RULES = 'agents/fork-instructions.md';
|
|
22
|
+
/** How a run finds and calls an external service through the `mcp` tools. */
|
|
23
|
+
const MCP_RULES = 'agents/mcp-instructions.md';
|
|
24
|
+
/** What an MCP agent with a memory store may commit about those calls. */
|
|
25
|
+
const MCP_MEMORY_RULES = 'agents/mcp-memory-instructions.md';
|
|
26
|
+
/** The tool group Zenera's MCP plugin registers. */
|
|
27
|
+
const MCP_GROUP = 'mcp';
|
|
22
28
|
/** The conditioned documents `zen` ships, which land whether or not they apply. */
|
|
23
|
-
const OURS = new Set([FILE_RULES, MEMORY_RULES, FORK_RULES]);
|
|
29
|
+
const OURS = new Set([FILE_RULES, MEMORY_RULES, FORK_RULES, MCP_RULES, MCP_MEMORY_RULES]);
|
|
24
30
|
const PROMPTS_DIR = 'agents/prompts';
|
|
25
31
|
const SKILLS_DIR = 'agents/skills';
|
|
26
32
|
const SKILL_FILE = 'SKILL.md';
|
|
@@ -102,6 +108,42 @@ const CAPABILITIES = {
|
|
|
102
108
|
workspace: (spec) => hasFileTools(spec),
|
|
103
109
|
'workspace-write': (spec) => hasFileWriteTools(spec),
|
|
104
110
|
};
|
|
111
|
+
/** `tools:<group>`, the open-ended capability. Mirrors the loader's. */
|
|
112
|
+
const TOOLS_CAPABILITY = 'tools:';
|
|
113
|
+
function grantsGroup(selectors, group) {
|
|
114
|
+
let whole = false;
|
|
115
|
+
const named = new Set();
|
|
116
|
+
for (const raw of selectors ?? []) {
|
|
117
|
+
const drop = raw.startsWith('-');
|
|
118
|
+
const selector = (drop ? raw.slice(1) : raw).trim();
|
|
119
|
+
if (selector === '*' || selector === `${group}:*`) {
|
|
120
|
+
whole = !drop;
|
|
121
|
+
named.clear();
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const colon = selector.lastIndexOf(':');
|
|
125
|
+
const name = colon >= 0 ? selector.slice(colon + 1) : selector;
|
|
126
|
+
const inGroup = colon >= 0 ? selector.slice(0, colon) === group : name.startsWith(`${group}_`);
|
|
127
|
+
if (!inGroup) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (drop) {
|
|
131
|
+
named.delete(name);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
named.add(name);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return whole || named.size > 0;
|
|
138
|
+
}
|
|
139
|
+
function capability(cap) {
|
|
140
|
+
if (cap.startsWith(TOOLS_CAPABILITY)) {
|
|
141
|
+
const group = cap.slice(TOOLS_CAPABILITY.length);
|
|
142
|
+
return group ? (spec) => grantsGroup(spec.tools, group) : undefined;
|
|
143
|
+
}
|
|
144
|
+
return Object.hasOwn(CAPABILITIES, cap) ? CAPABILITIES[cap] : undefined;
|
|
145
|
+
}
|
|
146
|
+
const KNOWN_CAPABILITIES = [...Object.keys(CAPABILITIES), `${TOOLS_CAPABILITY}<group>`].join(', ');
|
|
105
147
|
/**
|
|
106
148
|
* Mirrors `readHouseRules` in the loader, in the same order:
|
|
107
149
|
* `agents/instructions.md`, then every `agents/<topic>-instructions.md` by
|
|
@@ -137,7 +179,7 @@ function houseRules(root) {
|
|
|
137
179
|
*/
|
|
138
180
|
function rulesFor(rules, spec) {
|
|
139
181
|
return rules
|
|
140
|
-
.filter((r) => r.requires.every((cap) =>
|
|
182
|
+
.filter((r) => r.requires.every((cap) => capability(cap)?.(spec) ?? true))
|
|
141
183
|
.map((r) => r.rel);
|
|
142
184
|
}
|
|
143
185
|
export async function validateProject(opts) {
|
|
@@ -275,14 +317,14 @@ export async function validateProject(opts) {
|
|
|
275
317
|
});
|
|
276
318
|
}
|
|
277
319
|
for (const cap of requires) {
|
|
278
|
-
if (!(cap
|
|
320
|
+
if (!capability(cap)) {
|
|
279
321
|
add({
|
|
280
322
|
severity: 'error',
|
|
281
323
|
code: 'rules.requires.unknown',
|
|
282
324
|
where: rel,
|
|
283
325
|
message: `\`requires: ${cap}\` names no capability, so the loader refuses the ` +
|
|
284
326
|
'project',
|
|
285
|
-
fix: `use one of: ${
|
|
327
|
+
fix: `use one of: ${KNOWN_CAPABILITIES}`,
|
|
286
328
|
});
|
|
287
329
|
}
|
|
288
330
|
}
|
|
@@ -360,6 +402,36 @@ export async function validateProject(opts) {
|
|
|
360
402
|
});
|
|
361
403
|
}
|
|
362
404
|
}
|
|
405
|
+
// The same again for the MCP tools. They come from a plugin, so nothing in
|
|
406
|
+
// `zen` explains them otherwise, and their schemas say nothing about the
|
|
407
|
+
// connect pause, the result limit, or where they refuse to work.
|
|
408
|
+
const mcpAgents = config.agents.filter((a) => grantsGroup(a.tools, MCP_GROUP));
|
|
409
|
+
if (mcpAgents.length) {
|
|
410
|
+
const path = join(root, MCP_RULES);
|
|
411
|
+
if (!existsSync(path) || empty(path)) {
|
|
412
|
+
add({
|
|
413
|
+
severity: 'error',
|
|
414
|
+
code: 'mcp.uninstructed',
|
|
415
|
+
where: MCP_RULES,
|
|
416
|
+
message: 'an agent has the mcp tools, but nothing tells it how to find, describe ' +
|
|
417
|
+
'and call a service tool, or what to do when the user must connect',
|
|
418
|
+
fix: 'zen check --fix, which writes the current rules back',
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (mcpAgents.some((a) => a.memory)) {
|
|
423
|
+
const path = join(root, MCP_MEMORY_RULES);
|
|
424
|
+
if (!existsSync(path) || empty(path)) {
|
|
425
|
+
add({
|
|
426
|
+
severity: 'error',
|
|
427
|
+
code: 'mcp-memory.uninstructed',
|
|
428
|
+
where: MCP_MEMORY_RULES,
|
|
429
|
+
message: 'an agent has both the mcp tools and memory, but nothing tells it to ' +
|
|
430
|
+
'commit tool routes and never the results, which are the user’s data',
|
|
431
|
+
fix: 'zen check --fix, which writes the current rules back',
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
}
|
|
363
435
|
// Present is not the same as current. These files are copies of ours
|
|
364
436
|
// and nobody is meant to be maintaining them, so bytes that differ are an
|
|
365
437
|
// older `zen`'s — prose about a runtime that has since moved, which reads
|
|
@@ -1571,6 +1643,32 @@ function siblings(skillFile) {
|
|
|
1571
1643
|
// ---------------------------------------------------------------------------
|
|
1572
1644
|
// Models
|
|
1573
1645
|
// ---------------------------------------------------------------------------
|
|
1646
|
+
/**
|
|
1647
|
+
* A ref that resolves, but is not written the way a ref is written today. Only
|
|
1648
|
+
* the ambiguous one is a warning: it means what it always meant, and the next
|
|
1649
|
+
* reader will take it for something else.
|
|
1650
|
+
*/
|
|
1651
|
+
function refStyle(registry, ref, where, add) {
|
|
1652
|
+
const style = registry.refStyle(ref);
|
|
1653
|
+
if (!style) {
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
const fallback = registry.defaultProvider;
|
|
1657
|
+
const message = {
|
|
1658
|
+
bare: `\`${ref}\` names no provider, so it goes to the default one, ${fallback}`,
|
|
1659
|
+
colon: `\`${ref}\` is the older colon form`,
|
|
1660
|
+
ambiguous: `\`${ref}\` is read as a ${fallback} model id, not as a model of ` +
|
|
1661
|
+
`${ref.slice(0, ref.indexOf('/'))}: ${fallback} names its models with slashes`,
|
|
1662
|
+
publisher: `\`${ref}\` leaves out the model's publisher`,
|
|
1663
|
+
}[style.issue];
|
|
1664
|
+
add({
|
|
1665
|
+
severity: style.issue === 'ambiguous' ? 'warning' : 'note',
|
|
1666
|
+
code: `model.ref.${style.issue}`,
|
|
1667
|
+
where,
|
|
1668
|
+
message,
|
|
1669
|
+
fix: `write \`${style.canonical}\` — the same model, from the same provider`,
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1574
1672
|
function checkModels(root, config, keys, add, probe = false) {
|
|
1575
1673
|
let registry;
|
|
1576
1674
|
try {
|
|
@@ -1656,11 +1754,13 @@ function checkModels(root, config, keys, add, probe = false) {
|
|
|
1656
1754
|
// report says what it stands for — otherwise `main was refused`
|
|
1657
1755
|
// names nothing anyone can look up or retype.
|
|
1658
1756
|
const spec = typeof ref === 'string' ? registry.parse(ref) : ref;
|
|
1659
|
-
const
|
|
1660
|
-
const resolved = `${need.provider}${api}:${spec.model}`;
|
|
1757
|
+
const resolved = registry.refOf(spec);
|
|
1661
1758
|
if (resolved !== name) {
|
|
1662
1759
|
report.ref = resolved;
|
|
1663
1760
|
}
|
|
1761
|
+
if (typeof ref === 'string') {
|
|
1762
|
+
refStyle(registry, ref, whereFor(config, role, name, usedBy), add);
|
|
1763
|
+
}
|
|
1664
1764
|
// Reported here rather than left to the probe below: a knob for the
|
|
1665
1765
|
// wrong vendor is a config mistake that wants naming whether or not
|
|
1666
1766
|
// there is a credential to build the model with.
|
|
@@ -1683,9 +1783,7 @@ function checkModels(root, config, keys, add, probe = false) {
|
|
|
1683
1783
|
code: `${role}.unresolvable`,
|
|
1684
1784
|
where: whereFor(config, role, name, usedBy),
|
|
1685
1785
|
message: err instanceof Error ? err.message : String(err),
|
|
1686
|
-
fix:
|
|
1687
|
-
? 'a reference is `[provider:]model`; see docs/agents-yaml.md'
|
|
1688
|
-
: 'a reference is `[provider[/api]:]model`; see docs/agents-yaml.md',
|
|
1786
|
+
fix: 'a reference is `provider/model`; see docs/agents-yaml.md',
|
|
1689
1787
|
});
|
|
1690
1788
|
report.credential = 'unknown';
|
|
1691
1789
|
models.push(report);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenera/cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Command-line front end for @zenera/neo: agentic projects you can run, share and commit.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"@google/genai": "^2.30.0",
|
|
57
57
|
"@inkjs/ui": "^2.0.0",
|
|
58
58
|
"@openrouter/sdk": "^1.4.25",
|
|
59
|
-
"@zenera/engine": "^1.3.
|
|
60
|
-
"@zenera/neo": "^1.3.
|
|
61
|
-
"@zenera/sandbox": "^1.3.
|
|
62
|
-
"@zenera/server": "^1.3.
|
|
63
|
-
"@zenera/view": "^1.3.
|
|
59
|
+
"@zenera/engine": "^1.3.5",
|
|
60
|
+
"@zenera/neo": "^1.3.5",
|
|
61
|
+
"@zenera/sandbox": "^1.3.5",
|
|
62
|
+
"@zenera/server": "^1.3.5",
|
|
63
|
+
"@zenera/view": "^1.3.5",
|
|
64
64
|
"google-auth-library": "^10.0.0",
|
|
65
65
|
"ink": "^7.1.1",
|
|
66
66
|
"openai": "^6.0.0",
|
|
@@ -49,6 +49,7 @@ the editor skill for each one - `zen-memory` for a `memory:` block,
|
|
|
49
49
|
`zen-sandbox` for sandbox configuration or shell tools, `zen-rag-schema` or
|
|
50
50
|
`zen-rag-docs` for an index, `zen-code-python` for an agent that writes or runs
|
|
51
51
|
code, `zen-topology` for `handoffs:` or `fork:` on any agent,
|
|
52
|
+
`zen-mcp` for `mcp:*` or any `mcp_*` tool on any agent,
|
|
52
53
|
`zen-sandbox-capacity` before any `zen run batch`
|
|
53
54
|
(except under `zen-finetune`, which sets its own concurrency),
|
|
54
55
|
`zen-cli` always. A capability that is already
|
|
@@ -59,10 +60,10 @@ change.
|
|
|
59
60
|
|
|
60
61
|
**Load `zen-instructions` before writing, editing, reviewing or deleting any
|
|
61
62
|
`agents/*instructions.md`.** They are the house rules, prepended to every
|
|
62
|
-
agent's prompt, and
|
|
63
|
+
agent's prompt, and six of them are `zen`'s own copies rather than the
|
|
63
64
|
project's: an edit made inside one is lost at the next `zen check --fix`, `zen
|
|
64
65
|
init` or `zen open`, with no diff to show for it. The skill is what says which
|
|
65
|
-
|
|
66
|
+
six those are, where a project's own rules on the same subjects go instead,
|
|
66
67
|
how `requires:` conditions a document, and what filename order decides. None of
|
|
67
68
|
that is visible in the file being edited.
|
|
68
69
|
Replacing generated copies with `zen check --fix` is maintenance, not manual
|
|
@@ -246,6 +247,8 @@ my-project/
|
|
|
246
247
|
│ ├── instructions.md house rules, prepended to every agent
|
|
247
248
|
│ ├── files-instructions.md and more - how files are handled
|
|
248
249
|
│ ├── fork-instructions.md more of them - any `<topic>-instructions.md`
|
|
250
|
+
│ ├── mcp-instructions.md and more - how external services are called
|
|
251
|
+
│ ├── mcp-memory-instructions.md and more - what of them memory keeps
|
|
249
252
|
│ ├── memory-instructions.md and more - how the graph is used
|
|
250
253
|
│ ├── tools-instructions.md and more - how tools are called
|
|
251
254
|
│ ├── prompts/
|
|
@@ -553,7 +556,7 @@ providers:
|
|
|
553
556
|
apiKey: ${ACME_OPENAI_KEY}
|
|
554
557
|
|
|
555
558
|
embeddings:
|
|
556
|
-
small: openai
|
|
559
|
+
small: openai/text-embedding-3-small # a shorthand string...
|
|
557
560
|
large: # ...or the object form
|
|
558
561
|
provider: house
|
|
559
562
|
model: text-embedding-3-large
|
|
@@ -575,7 +578,7 @@ embedding: small
|
|
|
575
578
|
Four things differ from `models:` and are worth knowing before you write one:
|
|
576
579
|
|
|
577
580
|
- **No `api:` field.** `/v1/responses` has no embeddings endpoint, so naming an
|
|
578
|
-
api means nothing on any protocol. The shorthand is `
|
|
581
|
+
api means nothing on any protocol. The shorthand is `provider/model`.
|
|
579
582
|
- **`kind: anthropic` has no embeddings API at all.** Anthropic publishes none
|
|
580
583
|
and points at third parties; an `embeddings:` entry on an Anthropic provider
|
|
581
584
|
fails at load. Use another provider - the connection need not be the one the
|
|
@@ -661,9 +664,10 @@ follow. So:
|
|
|
661
664
|
Target 20-60 lines each. If one exceeds ~100, split the stable half out into a
|
|
662
665
|
preloaded skill.
|
|
663
666
|
|
|
664
|
-
|
|
665
|
-
`tools-instructions.md`, `files-instructions.md`, `memory-instructions.md
|
|
666
|
-
`fork-instructions.md
|
|
667
|
+
Six of these documents are **`zen`'s, not the project's** -
|
|
668
|
+
`tools-instructions.md`, `files-instructions.md`, `memory-instructions.md`,
|
|
669
|
+
`fork-instructions.md`, `mcp-instructions.md` and `mcp-memory-instructions.md`.
|
|
670
|
+
They are replaced by `zen check --fix`, and a copy that
|
|
667
671
|
differs is reported as `rules.stale`. This project's own rules on any of those
|
|
668
672
|
subjects go in a topic file beside them - `agents/files-policy-instructions.md`,
|
|
669
673
|
`agents/memory-policy-instructions.md` and the like, carrying the same
|
|
@@ -851,6 +855,17 @@ Three rules follow:
|
|
|
851
855
|
Skills can own tools too - `tools:` in a skill's frontmatter (§3.4) names tools
|
|
852
856
|
that refuse to run until that skill is active.
|
|
853
857
|
|
|
858
|
+
A project running in Zenera also has `mcp:*` - external services such as GitHub
|
|
859
|
+
or Linear, called as the signed-in user. Those tools work only in the app's
|
|
860
|
+
chats and Test tab. How to use them reaches the agent through zen's house rules
|
|
861
|
+
`agents/mcp-instructions.md`, which `requires: [tools:mcp]` delivers to every
|
|
862
|
+
agent granted the group. Load `zen-mcp` before granting or reviewing them.
|
|
863
|
+
|
|
864
|
+
A request to "add GitHub MCP", "connect Linear" or the like is about **this
|
|
865
|
+
project's agents**: grant them `mcp:*` (`/add-mcp`, or `zen-mcp`). It never
|
|
866
|
+
means editing `.vscode/mcp.json` - that gives the editor tools, not the
|
|
867
|
+
project, and a project declares no servers or credentials.
|
|
868
|
+
|
|
854
869
|
### 3.6 The file tools (`files:*`, alias `workspace:*`)
|
|
855
870
|
|
|
856
871
|
`zen run` builds this set for you, rooted at the session's workspace directory.
|
|
@@ -1559,13 +1574,20 @@ agents:
|
|
|
1559
1574
|
### 7.3 Shorthand
|
|
1560
1575
|
|
|
1561
1576
|
```
|
|
1562
|
-
|
|
1577
|
+
provider/id
|
|
1563
1578
|
```
|
|
1564
1579
|
|
|
1565
|
-
`
|
|
1580
|
+
`openai/gpt-5-mini` · `vertex/gemini-3.5-flash` · `vertex/anthropic/claude-opus-5` ·
|
|
1581
|
+
`openrouter/anthropic/claude-sonnet-4.5`
|
|
1582
|
+
|
|
1583
|
+
The first segment is a provider _name_ - a built-in kind or a `providers:`
|
|
1584
|
+
entry - and everything after the first slash is the id exactly as that provider
|
|
1585
|
+
spells it, slashes and colons included. It is also how a Bifrost gateway names a
|
|
1586
|
+
model, so the ref written here is the one the gateway logs.
|
|
1566
1587
|
|
|
1567
|
-
|
|
1568
|
-
`openai
|
|
1588
|
+
On Vertex a model from another publisher keeps its publisher:
|
|
1589
|
+
`vertex/anthropic/claude-opus-5`, `vertex/openai/gpt-oss-120b-maas`. Google's own
|
|
1590
|
+
models need none.
|
|
1569
1591
|
|
|
1570
1592
|
**Always write the prefix.** The first segment is a provider _name_, not a vendor
|
|
1571
1593
|
hint - nothing reads `gemini-3.5-flash` and infers Google. An unprefixed id goes
|
|
@@ -1574,10 +1596,26 @@ otherwise, so a bare `gemini-3.5-flash` asks OpenAI for a Google model and fails
|
|
|
1574
1596
|
with `OPENAI_API_KEY is not set`. The message names the provider it resolved to;
|
|
1575
1597
|
read it as "the prefix is missing", not "the key is missing".
|
|
1576
1598
|
|
|
1599
|
+
Two older spellings are still read, and `zen validate` names the ref to write
|
|
1600
|
+
instead:
|
|
1601
|
+
|
|
1602
|
+
- `provider[/api]:id` - `openai:gpt-4o`, `openai/responses:o3`. Still the only
|
|
1603
|
+
shorthand that names an api, and the way to write an id the slash form would
|
|
1604
|
+
misread: a fine-tuned `openai:ft:gpt-4o:acme::a1b2`.
|
|
1605
|
+
- a bare id, which goes to the default provider - see below.
|
|
1606
|
+
|
|
1607
|
+
One ref reads two ways. On a default provider whose own ids contain slashes -
|
|
1608
|
+
OpenRouter, Vertex, `openai-compatible`, anything with a base url of its own -
|
|
1609
|
+
`anthropic/claude-sonnet-4.5` is that provider's id, as it always was, not a
|
|
1610
|
+
model of Anthropic's. `zen validate` warns, and asks for
|
|
1611
|
+
`openrouter/anthropic/claude-sonnet-4.5` so the next reader cannot take it the
|
|
1612
|
+
other way. To reach Anthropic itself from such a project, write
|
|
1613
|
+
`anthropic:claude-sonnet-4.5`: the colon form is never read two ways.
|
|
1614
|
+
|
|
1577
1615
|
Anything the shorthand cannot express (keys, base urls, `api:`, reasoning knobs)
|
|
1578
1616
|
needs the object form. The object form does **not** re-parse a shorthand: its
|
|
1579
1617
|
`model:` is the bare id and the provider goes in `provider:` beside it. Writing
|
|
1580
|
-
`model: openai
|
|
1618
|
+
`model: openai/gpt-5.4-mini` there sends that whole string to the API.
|
|
1581
1619
|
|
|
1582
1620
|
Resolution order for any `model:` value: `zen run --model` → this file's
|
|
1583
1621
|
`models:` → the shorthand parser. Two agents naming `balanced` share one model
|
|
@@ -1623,20 +1661,20 @@ entry is only worth writing when it adds something:
|
|
|
1623
1661
|
```yaml
|
|
1624
1662
|
agents:
|
|
1625
1663
|
- name: triage
|
|
1626
|
-
model: openrouter
|
|
1664
|
+
model: openrouter/anthropic/claude-sonnet-4.5
|
|
1627
1665
|
```
|
|
1628
1666
|
|
|
1629
1667
|
**Model ids** are `vendor/model` and may carry a variant suffix after a colon -
|
|
1630
1668
|
`:free`, `:nitro` (throughput-routed), `:floor` (price-routed), `:online` (web
|
|
1631
|
-
search). Both survive the shorthand, because only the _first_
|
|
1669
|
+
search). Both survive the shorthand, because only the _first_ slash separates:
|
|
1632
1670
|
|
|
1633
1671
|
| Ref | Provider | Model |
|
|
1634
1672
|
| -------------------------------- | ------------ | --------------------- |
|
|
1635
|
-
| `openrouter
|
|
1636
|
-
| `openrouter
|
|
1673
|
+
| `openrouter/openai/gpt-5.4-nano` | `openrouter` | `openai/gpt-5.4-nano` |
|
|
1674
|
+
| `openrouter/z-ai/glm-5.2:free` | `openrouter` | `z-ai/glm-5.2:free` |
|
|
1637
1675
|
|
|
1638
|
-
The `vendor/`
|
|
1639
|
-
first
|
|
1676
|
+
The `vendor/` after `openrouter/` is part of the _id_, not a provider name: what
|
|
1677
|
+
precedes the first slash is the provider, and nothing after it is read as one.
|
|
1640
1678
|
|
|
1641
1679
|
**No api to choose.** This kind speaks one protocol, its own, so `api: responses`
|
|
1642
1680
|
and `openrouter/responses:…` are both a load error ("has one api, so … means
|
|
@@ -1796,7 +1834,7 @@ up (§7.8).
|
|
|
1796
1834
|
|
|
1797
1835
|
- **A model id with no provider prefix** - `gemini-3.5-flash` resolves to the
|
|
1798
1836
|
default provider, not to Google, and the failure reads as a missing OpenAI key.
|
|
1799
|
-
Write `google
|
|
1837
|
+
Write `google/gemini-3.5-flash` - §7.3.
|
|
1800
1838
|
- **OpenAI reasoning without `api: responses`** - chat completions rejects
|
|
1801
1839
|
`reasoningEffort` alongside function tools with a `400`, and exposes no
|
|
1802
1840
|
reasoning summary even without tools - §7.6.
|
|
@@ -1930,7 +1968,8 @@ Before finishing any change here:
|
|
|
1930
1968
|
of every agent it reaches - `requires:` if it is about one of them
|
|
1931
1969
|
- [ ] If any agent has file tools, `agents/files-instructions.md` is present - §3.6
|
|
1932
1970
|
- [ ] If any agent has `fork:`, `agents/fork-instructions.md` is present - zen-topology §8
|
|
1933
|
-
- [ ]
|
|
1971
|
+
- [ ] If any agent has `mcp:*`, `agents/mcp-instructions.md` is present - zen-mcp
|
|
1972
|
+
- [ ] No `rules.stale`: the six files that are `zen`'s rather than yours say
|
|
1934
1973
|
what this version of the runtime does, and `zen check --fix` replaces them
|
|
1935
1974
|
- [ ] Any change to an `agents/*instructions.md` was made with the
|
|
1936
1975
|
`zen-instructions` skill loaded, and nothing of this project's was written
|
|
@@ -2027,6 +2066,7 @@ candidates; these are the judgements to make about each one)**
|
|
|
2027
2066
|
| Answers from stale knowledge of the world | Grant `web_search` + `web_read`, and say when - §3.8 |
|
|
2028
2067
|
| Cites a page it only saw the excerpt of | A prompt line: `web_read` before quoting - §3.8 |
|
|
2029
2068
|
| Every web call refuses | No Exa key: `zen key add exa` - `zen check` warns - §3.8 |
|
|
2069
|
+
| Every MCP call says it is not available | Run it in the app chat or Test tab - zen-mcp |
|
|
2030
2070
|
| A model or embedder refuses every call | `zen models test <ref>` - if `blocked`, `zen models ls` - §8 |
|
|
2031
2071
|
| Answers instead of routing | Router prompt prohibition; check `handoffs:` |
|
|
2032
2072
|
| Routes to the wrong specialist | The target agents' `description:` fields |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-mcp
|
|
3
|
+
description: Give this project's agents external services (GitHub, Linear, Notion, ...) through the MCP tools.
|
|
4
|
+
argument-hint: '[which services, and what the agents should do with them]'
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Add MCP to this project: grant the `mcp:*` tools, say which services are used
|
|
9
|
+
here, and add a skill for each recurring job. How to use the tools needs no
|
|
10
|
+
work: zen's house rules `agents/mcp-instructions.md` (and, with memory,
|
|
11
|
+
`agents/mcp-memory-instructions.md`) reach every agent granted the group.
|
|
12
|
+
|
|
13
|
+
Load the `zen-mcp` skill first. It holds the rules this command follows. Also
|
|
14
|
+
load `zen-instructions` before writing the policy file in step 3. If any agent
|
|
15
|
+
will hand MCP data to code it runs, also load `zen-code-python`.
|
|
16
|
+
|
|
17
|
+
1. **Ask** which servers are enabled for this project in Project settings → MCP
|
|
18
|
+
servers, whether any is limited to some tools, and what jobs the agents
|
|
19
|
+
should do, if I have not already said. The project files cannot answer this.
|
|
20
|
+
2. **Pick the agents** that act on external services. Add `mcp:*` to their
|
|
21
|
+
`tools:` in `agents.yaml` with a short comment saying which services they use,
|
|
22
|
+
and `-mcp_call` for any that must only look
|
|
23
|
+
(`zen-mcp` → `references/install.md` §2).
|
|
24
|
+
3. **Name the servers.** If I confirmed any, write
|
|
25
|
+
`agents/mcp-policy-instructions.md` with `requires: [tools:mcp]` and one line
|
|
26
|
+
per server on what it is for here (`references/install.md` §3). Skip it if
|
|
27
|
+
none were confirmed. Never edit `agents/mcp-instructions.md` or
|
|
28
|
+
`agents/mcp-memory-instructions.md`.
|
|
29
|
+
4. **Add a workflow skill** under `agents/skills/<job>/SKILL.md` for each
|
|
30
|
+
recurring job from step 1: prerequisite first, then server, tool, argument
|
|
31
|
+
shape, what to ask before writing, and what to do when the route is refused
|
|
32
|
+
(`references/install.md` §4). Bind each one in `skills.allow` of the agents
|
|
33
|
+
from step 2 if they have an allow list.
|
|
34
|
+
5. **Add a prompt line** to each agent from step 2 saying when to reach for the
|
|
35
|
+
services.
|
|
36
|
+
6. Run `zen check`. If it reports `mcp.uninstructed` or
|
|
37
|
+
`mcp-memory.uninstructed`, run `zen check --fix`, which writes the house
|
|
38
|
+
rules back. If it reports `unknown tool "mcp:*"`, this is not a Zenera
|
|
39
|
+
environment. Say so instead of removing the grant.
|
|
40
|
+
7. Tell me to try it in the Test tab: the first request per service shows a
|
|
41
|
+
connect card. A terminal `zen run` cannot call MCP.
|
|
42
|
+
|
|
43
|
+
Report the agents changed, the files and skills added, and what `zen check` said.
|
|
@@ -562,7 +562,8 @@ standing rule to `agents/instructions.md`, a rule about one capability to a new
|
|
|
562
562
|
|
|
563
563
|
You may edit prompts, skills, house rules and new policy files. You may not edit
|
|
564
564
|
`agents/memory-instructions.md`, `agents/fork-instructions.md`,
|
|
565
|
-
`agents/tools-instructions.md
|
|
565
|
+
`agents/tools-instructions.md`, `agents/files-instructions.md`,
|
|
566
|
+
`agents/mcp-instructions.md` or `agents/mcp-memory-instructions.md` - `zen check
|
|
566
567
|
--fix` overwrites them. You may not change a rubric to make a run pass. Do not
|
|
567
568
|
change `agents.yaml`: a finding that needs it is structural - record it as an
|
|
568
569
|
open problem and carry on.
|
|
@@ -642,8 +642,10 @@ When nothing warrants a change, write `No instruction changes needed.`
|
|
|
642
642
|
In a tuning loop, keep the actionable list identical to §7 `improvements`.
|
|
643
643
|
Smaller cost observations below §7's threshold stay in section 3, not here.
|
|
644
644
|
|
|
645
|
-
`agents/fork-instructions.md`, `agents/memory-instructions.md
|
|
646
|
-
`agents/tools-instructions.md`
|
|
645
|
+
`agents/fork-instructions.md`, `agents/memory-instructions.md`,
|
|
646
|
+
`agents/tools-instructions.md`, `agents/files-instructions.md`,
|
|
647
|
+
`agents/mcp-instructions.md` and `agents/mcp-memory-instructions.md` are zen's
|
|
648
|
+
own copies, and so is every built-in
|
|
647
649
|
tool description. Never propose editing them; propose the project's policy
|
|
648
650
|
file or prompt, or say the change belongs upstream in zen.
|
|
649
651
|
|
|
@@ -66,7 +66,7 @@ zen key mode direct # back to vendor keys
|
|
|
66
66
|
In `bifrost` mode a run exports `BIFROST_API_KEY` and `BIFROST_BASE_URL` and
|
|
67
67
|
**withholds every vendor key**. The runtime then sends every model and every
|
|
68
68
|
embedding through the gateway, each in its own vendor's protocol, and
|
|
69
|
-
`agents.yaml` does not change: `vertex
|
|
69
|
+
`agents.yaml` does not change: `vertex/gemini-3.5-flash` reaches
|
|
70
70
|
`<url>/genai` as `vertex/gemini-3.5-flash`, `anthropic:*` reaches
|
|
71
71
|
`<url>/anthropic`, `openai:*` and `openrouter:*` reach `<url>/openai`.
|
|
72
72
|
Declared providers are rerouted too. `zen check` then reports
|
|
@@ -52,7 +52,7 @@ it was - `--json` carries `source` per model and `origin` per provider.
|
|
|
52
52
|
After `zen key mode bifrost`, every listing is **what the gateway serves**,
|
|
53
53
|
not what the vendors do: one `GET <url>/v1/models`, split by its
|
|
54
54
|
`<upstream>/<id>` names back into refs (`vertex/gemini-3.5-flash` lists as
|
|
55
|
-
`vertex
|
|
55
|
+
`vertex/gemini-3.5-flash`). Upstreams no zen provider names (bedrock, groq, ...)
|
|
56
56
|
are left out, and there is no built-in fallback list. Each command says so on
|
|
57
57
|
stderr with a `⇄ bifrost mode` line, `browse` carries the same badge on every
|
|
58
58
|
screen, and `--json` adds a `gateway` field. `zen models` then does go to the
|
|
@@ -63,8 +63,8 @@ gateway too. The full guide is
|
|
|
63
63
|
## Testing a model
|
|
64
64
|
|
|
65
65
|
```
|
|
66
|
-
zen models test openai
|
|
67
|
-
zen models test vertex
|
|
66
|
+
zen models test openai/gpt-4o-mini
|
|
67
|
+
zen models test vertex/gemini-embedding-001 --embedding
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
The role is taken from the flag, else from what the provider says the model is
|
|
@@ -90,9 +90,9 @@ not parse.
|
|
|
90
90
|
This is what the command is for.
|
|
91
91
|
|
|
92
92
|
```
|
|
93
|
-
$ zen models test vertex
|
|
94
|
-
vertex
|
|
95
|
-
fix vertex
|
|
93
|
+
$ zen models test vertex/gemini-embedding-001
|
|
94
|
+
vertex/gemini-embedding-001 blocked Vertex AI API has not been used in project my-proj …
|
|
95
|
+
fix vertex/gemini-embedding-001 gcloud services enable aiplatform.googleapis.com --project my-proj
|
|
96
96
|
error 1 of 1 did not answer
|
|
97
97
|
see what else there is: zen models ls --embeddings
|
|
98
98
|
```
|
|
@@ -102,8 +102,8 @@ account serves, test the one you want, and put its ref where the old one was.
|
|
|
102
102
|
|
|
103
103
|
```
|
|
104
104
|
$ zen models ls --embeddings
|
|
105
|
-
$ zen models test openai
|
|
106
|
-
openai
|
|
105
|
+
$ zen models test openai/text-embedding-3-small
|
|
106
|
+
openai/text-embedding-3-small answers 412ms 1536 dims
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
Test one model, not the whole list - each test is a billable call.
|
|
@@ -23,6 +23,8 @@ agents.yaml the configuration
|
|
|
23
23
|
agents/instructions.md house rules, prepended to every agent
|
|
24
24
|
agents/files-instructions.md more of them, for agents that work with files
|
|
25
25
|
agents/fork-instructions.md more of them, for agents that can fork
|
|
26
|
+
agents/mcp-instructions.md more of them, for agents granted the mcp tools
|
|
27
|
+
agents/mcp-memory-instructions.md the same, for those that also have memory
|
|
26
28
|
agents/memory-instructions.md more of them, for agents with the memory store
|
|
27
29
|
agents/tools-instructions.md more of them, about how tools are called
|
|
28
30
|
agents/prompts/default.md the default agent's prompt
|
|
@@ -31,7 +31,7 @@ zen rag schema index <spec...> [--embedding <ref>] [-o <dir>] [--batch <n>]
|
|
|
31
31
|
| `--quiet` | - | No narration |
|
|
32
32
|
|
|
33
33
|
```
|
|
34
|
-
zen rag schema index openapi.yaml --embedding openai
|
|
34
|
+
zen rag schema index openapi.yaml --embedding openai/text-embedding-3-small
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Unlike the gym, `$ref`s are **bundled, not dereferenced**: component names are
|
|
@@ -1328,7 +1328,8 @@ assembled prefix in order. The remaining copies must either have different
|
|
|
1328
1328
|
audiences or be deleted.
|
|
1329
1329
|
|
|
1330
1330
|
Never edit `agents/memory-instructions.md`, `agents/fork-instructions.md`,
|
|
1331
|
-
`agents/tools-instructions.md
|
|
1331
|
+
`agents/tools-instructions.md`, `agents/files-instructions.md`,
|
|
1332
|
+
`agents/mcp-instructions.md` or `agents/mcp-memory-instructions.md`. They are copies
|
|
1332
1333
|
of the runtime templates; `zen check --fix` replaces them wholesale. If a finding
|
|
1333
1334
|
genuinely belongs in one — true of every Zenera project, not just this one —
|
|
1334
1335
|
change the master upstream in the CLI templates, and note it in the run.
|
|
@@ -164,8 +164,9 @@ the skill is how you find out whether it is.
|
|
|
164
164
|
(create a policy file only when step 3 proved the rule absent and every
|
|
165
165
|
agent with that capability must obey it).
|
|
166
166
|
11. **Never edit** `agents.yaml`, `agents/memory-instructions.md`,
|
|
167
|
-
`agents/tools-instructions.md`, `agents/fork-instructions.md
|
|
168
|
-
`agents/files-instructions.md`,
|
|
167
|
+
`agents/tools-instructions.md`, `agents/fork-instructions.md`,
|
|
168
|
+
`agents/files-instructions.md`, `agents/mcp-instructions.md` or
|
|
169
|
+
`agents/mcp-memory-instructions.md`, nor anything outside `agents/`.
|
|
169
170
|
12. **Tidy up every file you touched** - the whole file, not only your lines.
|
|
170
171
|
For each obligation in it, search the files the same agents read, and pick
|
|
171
172
|
one move:
|
|
@@ -258,7 +258,8 @@ only a finding once the sentence is confirmed.
|
|
|
258
258
|
once in a skill with a softer tail. Grep the whole request for a distinctive
|
|
259
259
|
phrase of it, then grep the project's `agents/` tree for the file to edit.
|
|
260
260
|
3. **Check it is the project's file.** `fork-instructions.md`,
|
|
261
|
-
`memory-instructions.md`, `tools-instructions.md`
|
|
261
|
+
`memory-instructions.md`, `tools-instructions.md`, `files-instructions.md`,
|
|
262
|
+
`mcp-instructions.md`, `mcp-memory-instructions.md` are zen's own copies; load
|
|
262
263
|
**zen-instructions** before changing where that rule lives.
|
|
263
264
|
4. **Second opinion only when justified.** A thin answer or `no instruction -
|
|
264
265
|
my own default` does not itself justify more replay. In a whole-run audit,
|