@sabaiway/agent-workflow-kit 23.2.0 → 23.3.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/CHANGELOG.md +26 -0
- package/README.md +11 -11
- package/SKILL.md +1 -1
- package/bridges/typesafe-jev-bridge/SKILL.md +70 -0
- package/bridges/typesafe-jev-bridge/bin/jev-ask.sh +277 -0
- package/bridges/typesafe-jev-bridge/bin/jev-ask.test.mjs +392 -0
- package/bridges/typesafe-jev-bridge/bin/jev-client.mjs +155 -0
- package/bridges/typesafe-jev-bridge/capability.json +31 -0
- package/bridges/typesafe-jev-bridge/service-facts.txt +6 -0
- package/bridges/typesafe-jev-bridge/setup/README.md +20 -0
- package/capability.json +1 -1
- package/package.json +2 -2
- package/references/hooks/gate-approve.mjs +61 -61
- package/references/modes/backends.md +4 -1
- package/references/modes/setup.md +5 -3
- package/tools/commands.mjs +1 -1
- package/tools/detect-backends.mjs +33 -12
- package/tools/family-members.mjs +10 -2
- package/tools/family-registry.mjs +1 -2
- package/tools/labels.mjs +1 -0
- package/tools/manifest/schema.md +4 -2
- package/tools/manifest/validate.mjs +1 -1
- package/tools/setup-backends.mjs +7 -6
- package/tools/velocity-profile.mjs +3 -3
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
// .claude/settings.json.
|
|
6
6
|
//
|
|
7
7
|
// SELF-CONTAINED by contract: the placed copy must run on machines without the kit — no kit
|
|
8
|
-
// imports, dependency-free, Node >= 22, no side effects on import.
|
|
9
|
-
//
|
|
10
|
-
// SEEDED_READONLY_CORE ≡ UNIVERSAL_READONLY_ALLOWLIST and RESIDUAL_FORMS ≡
|
|
11
|
-
// RUNTIME_RESIDUAL_FORMS — drift-guarded by the kit's test/gate-hook-core-parity.test.mjs.
|
|
8
|
+
// imports, dependency-free, Node >= 22, no side effects on import.
|
|
9
|
+
// SEEDED_READONLY_CORE and RESIDUAL_FORMS are the generated region scripts/sync-mirrors.mjs writes from velocity-profile.mjs.
|
|
12
10
|
//
|
|
13
11
|
// It reads <project root>/docs/ai/gates.json LIVE on every invocation (AD-035: one declaration,
|
|
14
12
|
// two consumers — editing gates.json never requires re-wiring) and, for the opt-in read-lane
|
|
@@ -101,67 +99,69 @@ export const DECISION_ASK = 'ask';
|
|
|
101
99
|
// fenced closed by default. The residual guard (b) is NOT mode-fenced: an `ask` never loosens.
|
|
102
100
|
export const ALLOW_PERMISSION_MODES = Object.freeze(['default', 'acceptEdits']);
|
|
103
101
|
|
|
104
|
-
//
|
|
105
|
-
// core velocity seeds as settings allow rules). Drift-guarded — never edit here alone.
|
|
102
|
+
// generated from agent-workflow-kit/tools/velocity-profile.mjs by scripts/sync-mirrors.mjs; do not edit
|
|
106
103
|
export const SEEDED_READONLY_CORE = Object.freeze([
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
104
|
+
"Bash(git status:*)",
|
|
105
|
+
"Bash(git diff:*)",
|
|
106
|
+
"Bash(git log:*)",
|
|
107
|
+
"Bash(git show:*)",
|
|
108
|
+
"Bash(git ls-files:*)",
|
|
109
|
+
"Bash(git check-ignore:*)",
|
|
110
|
+
"Bash(git branch --list:*)",
|
|
111
|
+
"Bash(git rev-parse:*)",
|
|
112
|
+
"Bash(git blame:*)",
|
|
113
|
+
"Bash(git shortlog:*)",
|
|
114
|
+
"Bash(git describe:*)",
|
|
115
|
+
"Bash(git tag --list:*)",
|
|
116
|
+
"Bash(git stash list:*)",
|
|
117
|
+
"Bash(git worktree list:*)",
|
|
118
|
+
"Bash(npm view:*)",
|
|
119
|
+
"Bash(npm ls:*)",
|
|
120
|
+
"Bash(npm outdated:*)",
|
|
121
|
+
"Bash(ls:*)",
|
|
122
|
+
"Bash(cat:*)",
|
|
123
|
+
"Bash(head:*)",
|
|
124
|
+
"Bash(tail:*)",
|
|
125
|
+
"Bash(wc:*)",
|
|
126
|
+
"Bash(readlink:*)",
|
|
127
|
+
"Bash(which:*)",
|
|
128
|
+
"Bash(grep:*)",
|
|
129
|
+
"Bash(diff:*)",
|
|
130
|
+
"Bash(stat:*)",
|
|
131
|
+
"Bash(du:*)",
|
|
132
|
+
"Bash(basename:*)",
|
|
133
|
+
"Bash(dirname:*)",
|
|
134
|
+
"Bash(realpath:*)",
|
|
138
135
|
]);
|
|
139
|
-
|
|
140
|
-
// Baked frozen copy of velocity-profile.mjs RUNTIME_RESIDUAL_FORMS (the documented residual a
|
|
141
|
-
// settings-level allow rule cannot see). Drift-guarded — never edit here alone.
|
|
142
136
|
export const RESIDUAL_FORMS = Object.freeze({
|
|
143
|
-
writeRedirections: Object.freeze([
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
137
|
+
"writeRedirections": Object.freeze([
|
|
138
|
+
">",
|
|
139
|
+
">>",
|
|
140
|
+
"1>",
|
|
141
|
+
"2>",
|
|
142
|
+
"&>",
|
|
143
|
+
">|",
|
|
144
|
+
]),
|
|
145
|
+
"commandSubstitutions": Object.freeze([
|
|
146
|
+
"$(",
|
|
147
|
+
"`",
|
|
148
|
+
"<(",
|
|
149
|
+
">(",
|
|
150
|
+
"${ ",
|
|
151
|
+
"${\t",
|
|
152
|
+
"${\n",
|
|
153
|
+
"${\r",
|
|
154
|
+
"${|",
|
|
155
|
+
]),
|
|
156
|
+
"lineContinuations": Object.freeze([
|
|
157
|
+
"\\\n",
|
|
158
|
+
"\\\r",
|
|
159
|
+
]),
|
|
160
|
+
"boundedWriteFlags": Object.freeze([
|
|
161
|
+
"--output",
|
|
162
|
+
]),
|
|
164
163
|
});
|
|
164
|
+
// end of the generated lists
|
|
165
165
|
|
|
166
166
|
export const RESIDUAL_CLASS_REDIRECTION = 'output redirection';
|
|
167
167
|
export const RESIDUAL_CLASS_SUBSTITUTION = 'command substitution';
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
Read-only. Answers *"which optional execution-backends are set up vs missing, and what's the next step?"* — for the family's subscription-CLI bridges (`codex-cli-bridge` → `codex`, `antigravity-cli-bridge` → `agy`). It **never writes, never commits, and never runs a subscription CLI**.
|
|
6
6
|
|
|
7
|
+
The judge bridge `typesafe-jev-bridge` → `jev-ask` has no CLI of its own beyond `node`; it is covered by the same detection-only report.
|
|
8
|
+
|
|
7
9
|
1. Run `node ${CLAUDE_SKILL_DIR}/tools/detect-backends.mjs` and present its table verbatim. Each row reports two **decoupled** axes: `manifestState` (health of the bridge *skill* — `not-installed | unsupported-schema | invalid-manifest | foreign | stub | ok`) and the readiness signals `cli` / `credentials` / `wrappers`, probed independently — so a CLI that is installed and signed in but whose bridge *skill* is absent reads `needs-skill`, not "missing".
|
|
8
10
|
2. For any backend that is not `ready`, point to its setup: the local `setup/README.md` when the bridge is installed, otherwise the backend's setup URL (both are in the report).
|
|
9
11
|
3. State plainly to the user that this is **detection only**:
|
|
10
|
-
- **"credentials present"** means the credential-marker **file** exists — it is **not** a live login check. The detector never runs `codex login status` / `agy` (that would spawn a paid, slow, networked subscription CLI).
|
|
12
|
+
- For subscription CLIs, **"credentials present"** means the credential-marker **file** exists — it is **not** a live login check. The detector never runs `codex login status` / `agy` (that would spawn a paid, slow, networked subscription CLI).
|
|
13
|
+
- For `typesafe-jev-bridge`, **"credentials present"** means `TYPESAFE_API_KEY` is set to a non-blank value; its value is never printed. Detection only, no request.
|
|
11
14
|
- The bridges' wrappers are **POSIX `.sh`** scripts. On Windows the detector still works, but the bridges themselves are **not promised to run** — say so rather than implying they will.
|
|
@@ -6,7 +6,7 @@ The **only writer** among the backend modes, and **opt-in / in-agent only** —
|
|
|
6
6
|
|
|
7
7
|
Run `node ${CLAUDE_SKILL_DIR}/tools/setup-backends.mjs [<backend>] [--bindir <path>] [--dry-run]`:
|
|
8
8
|
|
|
9
|
-
- `<backend>` — `codex` | `agy` | `antigravity` | `codex-cli-bridge` | `antigravity-cli-bridge`; omit
|
|
9
|
+
- `<backend>` — `codex` | `agy` | `antigravity` | `jev` | `codex-cli-bridge` | `antigravity-cli-bridge` | `typesafe-jev-bridge`; omit to place only the **review bridges** (`codex`, `agy`), leaving the judge out.
|
|
10
10
|
- `--bindir <path>` — where to link the wrappers (default `~/.local/bin`).
|
|
11
11
|
- `--dry-run` — print the per-backend plan and change **nothing** (run this first).
|
|
12
12
|
- `--refresh-placed` — the **refresh-only** mode (what `init` runs automatically and `${CLAUDE_SKILL_DIR}/references/modes/upgrade.md`
|
|
@@ -40,8 +40,10 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/setup-backends.mjs [<backend>] [--bindir <pa
|
|
|
40
40
|
|
|
41
41
|
For each backend it:
|
|
42
42
|
1. **Places / refreshes the bundled bridge skill** (from the kit's `bridges/<name>/` mirror) into its canonical dir — but only when that dir is **absent / empty / proven-managed** (valid manifest, matching `name`+`kind`). A `stub` / `foreign` / `invalid` / `unsupported` dir, a marker fs-error, or a symlinked dir → **STOP**, never overwritten. Refresh re-runs on a proven-managed dir so re-running `setup` delivers bundled fixes.
|
|
43
|
-
2. **Links its wrappers** (`codex-exec` / `codex-review`; `agy-review` / `agy-run`) onto `--bindir` via **managed symlinks** — replacing only a symlink that already points at our source. A non-symlink or a foreign symlink → **STOP**; it **preflights every target first**, so a conflict on one wrapper makes **zero** changes. If `--bindir` is not on `PATH`, it prints the one-line `export PATH=…` to add — it never edits a shell rc.
|
|
44
|
-
3. **Guides the manual, secret-bearing steps it will NOT automate** — the binary install (
|
|
43
|
+
2. **Links its wrappers** (`codex-exec` / `codex-review`; `agy-review` / `agy-run`; `jev-ask`) onto `--bindir` via **managed symlinks** — replacing only a symlink that already points at our source. A non-symlink or a foreign symlink → **STOP**; it **preflights every target first**, so a conflict on one wrapper makes **zero** changes. If `--bindir` is not on `PATH`, it prints the one-line `export PATH=…` to add — it never edits a shell rc.
|
|
44
|
+
3. **Guides the manual, secret-bearing steps it will NOT automate** — for subscription CLIs, the binary install (their bridge's `setup/README.md` §1) and the one-time interactive subscription login (`codex login` / `agy`) — printing the exact command for whichever axis is still missing (axis-aware: it can ask for both the CLI and the login at once).
|
|
45
|
+
|
|
46
|
+
For `typesafe-jev-bridge`, the manual steps are Node.js 22.21 or newer on PATH and the key through the kit's connect command, run by the user in a terminal of their own, then a restart of the agent; setup places the skill and links `jev-ask` only.
|
|
45
47
|
|
|
46
48
|
**Your own services list.** A service a bridge run must reach that the kit does not ship goes into one strict JSON file of your own, `services.json` beside the bridge settings file (`$XDG_CONFIG_HOME/agent-workflow/services.json`, default `~/.config/agent-workflow/services.json`); the kit only reads it. Its root maps a service id (lowercase letters, digits and `-`, starting with a letter, never a kit service id) to an object with exactly the six keys of a kit service fragment (`agent-workflow-kit/tools/services/`, schema in `${CLAUDE_SKILL_DIR}/tools/manifest/schema.md`): `hosts`, `writableDirs`, `excludedCommands`, `passedVariables`, `billingVariables`, `runReachesHosts`. A passed variable equal to any billing variable is refused. Every service in it joins every placed bridge, in two phases: (1) this step's place and every refresh (`init`, `/agent-workflow-kit upgrade`) write each placed bridge's `service-facts.txt` from the bridge's own services then yours; (2) the `velocity --bridge-tier` item adds your hosts, state dirs and excluded commands to the project `.claude/settings.json` for every used bridge. A list the loader refuses stops the place (`stop`) or the refresh (`could not refresh`) with zero writes in that bridge's folder, and stops the tier with zero writes: the line names the file — fix or remove it, then run the same step again. **Removal:** a service you delete from the list leaves each placed facts file at the next refresh; the sandbox entries the tier already added stay (the tier only adds) — remove them from `.claude/settings.json` yourself.
|
|
47
49
|
|
package/tools/commands.mjs
CHANGED
|
@@ -103,7 +103,7 @@ const CATALOG = [
|
|
|
103
103
|
invocation: invocationOf('backends'),
|
|
104
104
|
group: 'Inspect',
|
|
105
105
|
kind: READ_ONLY,
|
|
106
|
-
oneLine: 'Check which optional
|
|
106
|
+
oneLine: 'Check which optional backends (codex, agy and the judge) are set up versus missing, and the next step.',
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
key: 'help',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Backend detector — read-only detection of the family's optional execution-backends (the bridges
|
|
3
|
-
// to subscription CLIs: codex-cli-bridge → `codex`, antigravity-cli-bridge → `agy
|
|
3
|
+
// to subscription CLIs: codex-cli-bridge → `codex`, antigravity-cli-bridge → `agy`, and the judge). Surfaced as
|
|
4
4
|
// `/agent-workflow-kit backends` and a one-line bootstrap summary. It answers "what is set up vs
|
|
5
5
|
// missing" WITHOUT running any subscription CLI: "credentials present" means the credential-marker
|
|
6
|
-
//
|
|
6
|
+
// file exists or the judge's key is set, never a live `codex login` / `agy` check.
|
|
7
7
|
//
|
|
8
8
|
// Two orthogonal axes are reported independently (a healthy manifest ≠ a usable backend):
|
|
9
9
|
// manifestState — health of the bridge SKILL: not-installed | unsupported-schema |
|
|
@@ -13,17 +13,19 @@
|
|
|
13
13
|
//
|
|
14
14
|
// Source of truth is the in-tool KNOWN_BACKENDS registry (Option B / AD-008): a missing bridge has
|
|
15
15
|
// no manifest on disk and no setup/README in the kit tarball, so the per-backend facts (bin,
|
|
16
|
-
// credential
|
|
16
|
+
// credential probe, stable setup URL) must live here. A drift-guard test keeps the registry in
|
|
17
17
|
// lockstep with the in-repo manifests.
|
|
18
18
|
//
|
|
19
19
|
// Pure, dependency-injectable (fs/env/validator are deps), dependency-free, Node >= 22. Every fs
|
|
20
20
|
// probe is wrapped → an explicit `unknown` + reason, never a throw and never a nameless failure.
|
|
21
21
|
|
|
22
22
|
import { existsSync, statSync, accessSync, realpathSync, constants } from 'node:fs';
|
|
23
|
-
import { join } from 'node:path';
|
|
23
|
+
import { join, dirname } from 'node:path';
|
|
24
|
+
import { fileURLToPath } from 'node:url';
|
|
24
25
|
import os from 'node:os';
|
|
25
26
|
import { isDirectRun } from './direct-run.mjs';
|
|
26
27
|
import { loadServiceFragments } from './services/index.mjs';
|
|
28
|
+
import { keySet, connectLine, RESTART_STEP } from './jev-facts.mjs';
|
|
27
29
|
import { validateManifest, UNSUPPORTED, INVALID } from './manifest/validate.mjs';
|
|
28
30
|
|
|
29
31
|
// Probe states. `unknown` (a wrapped fs error) NEVER counts as present in any readiness rule.
|
|
@@ -48,6 +50,8 @@ export const NEEDS_CREDENTIALS = 'needs-credentials';
|
|
|
48
50
|
export const DEGRADED = 'degraded';
|
|
49
51
|
|
|
50
52
|
const EXPECTED_KIND = 'execution-backend';
|
|
53
|
+
const TOOLS_DIR = dirname(fileURLToPath(import.meta.url));
|
|
54
|
+
const JUDGE_CONNECT_LINE = connectLine(TOOLS_DIR, process.platform);
|
|
51
55
|
|
|
52
56
|
// The kit-owned registry: the per-backend facts the detector needs even when a bridge is NOT
|
|
53
57
|
// installed (no manifest on disk to read). Kept in lockstep with the in-repo manifests by the
|
|
@@ -157,6 +161,19 @@ const RAW_BACKENDS = [
|
|
|
157
161
|
setupPathLocal: 'setup/README.md',
|
|
158
162
|
guide: { setupRef: 'antigravity-cli-bridge/setup/README.md', loginCmd: 'agy', verifyCmd: 'echo "say OK" | agy-run -' },
|
|
159
163
|
},
|
|
164
|
+
{
|
|
165
|
+
name: 'typesafe-jev-bridge',
|
|
166
|
+
installed: { env: 'TYPESAFE_JEV_BRIDGE_DIR', default: '~/.claude/skills/typesafe-jev-bridge', file: 'SKILL.md' },
|
|
167
|
+
roleCmds: { judge: 'jev-ask' },
|
|
168
|
+
bin: 'node',
|
|
169
|
+
deadlineDefaultS: 10,
|
|
170
|
+
credential: { isSet: keySet },
|
|
171
|
+
cliHint: 'install or locate Node.js 22.21 or newer on PATH',
|
|
172
|
+
credentialsHint: `run ${JUDGE_CONNECT_LINE} in a terminal of your own, then ${RESTART_STEP}`,
|
|
173
|
+
setupUrl: 'https://github.com/sabaiway/agent-workflow/blob/main/typesafe-jev-bridge/setup/README.md',
|
|
174
|
+
setupPathLocal: 'setup/README.md',
|
|
175
|
+
guide: { setupRef: 'typesafe-jev-bridge/setup/README.md', loginCmd: JUDGE_CONNECT_LINE, verifyCmd: '/agent-workflow-kit backends' },
|
|
176
|
+
},
|
|
160
177
|
];
|
|
161
178
|
|
|
162
179
|
// The deduped roles[].cmd set the CURRENT kit bundles, derived from roleCmds in first-seen order — one
|
|
@@ -261,9 +278,11 @@ const probeFile = (file, deps = {}) => {
|
|
|
261
278
|
}
|
|
262
279
|
};
|
|
263
280
|
|
|
264
|
-
//
|
|
281
|
+
// Credentials = a marker file or an entry's key-presence rule. NEVER runs the subscription CLI.
|
|
265
282
|
// Report wording is "credentials present/missing/unknown", never "authenticated".
|
|
266
283
|
export const probeCredential = (entry, deps = {}) => {
|
|
284
|
+
const getenv = deps.getenv ?? process.env;
|
|
285
|
+
if (entry.credential.isSet) return { state: entry.credential.isSet(getenv) ? PRESENT : MISSING, path: null };
|
|
267
286
|
const service = entry.credential.service;
|
|
268
287
|
try {
|
|
269
288
|
const fragment = (deps.loadServiceFragments ?? loadServiceFragments)()?.[service];
|
|
@@ -271,7 +290,7 @@ export const probeCredential = (entry, deps = {}) => {
|
|
|
271
290
|
if (!Array.isArray(fragment.writableDirs) || fragment.writableDirs.length !== 1) {
|
|
272
291
|
return { state: UNKNOWN, path: null, reason: `${service}: expected exactly one writableDirs entry` };
|
|
273
292
|
}
|
|
274
|
-
const dir = resolveDir(fragment.writableDirs[0],
|
|
293
|
+
const dir = resolveDir(fragment.writableDirs[0], getenv, deps.home ?? os.homedir());
|
|
275
294
|
const file = join(dir, entry.credential.file);
|
|
276
295
|
return { state: probeFile(file, deps), path: file };
|
|
277
296
|
} catch (error) {
|
|
@@ -382,16 +401,17 @@ const skillHint = (status, guide) =>
|
|
|
382
401
|
// fresh machine needs both the CLI and a login). `[]` ⇒ nothing manual left (the linker handles the
|
|
383
402
|
// wrappers). Each step is `{ need: 'skill'|'cli'|'credentials', hint }`. Pure; no fs, no side effects.
|
|
384
403
|
export const guideFor = (status) => {
|
|
385
|
-
const
|
|
404
|
+
const entry = registryEntry(status.name);
|
|
405
|
+
const guide = entry?.guide;
|
|
386
406
|
const out = [];
|
|
387
407
|
if (status.manifestState !== OK) out.push({ need: 'skill', hint: skillHint(status, guide) });
|
|
388
408
|
if (status.cli.state !== PRESENT) {
|
|
389
|
-
out.push({ need: 'cli', hint: `install the "${status.cli.bin}" CLI — see ${guide?.setupRef ?? status.setupHint?.url} §1` });
|
|
409
|
+
out.push({ need: 'cli', hint: entry?.cliHint ?? `install the "${status.cli.bin}" CLI — see ${guide?.setupRef ?? status.setupHint?.url} §1` });
|
|
390
410
|
}
|
|
391
411
|
if (status.credentials.state !== PRESENT) {
|
|
392
412
|
out.push({
|
|
393
413
|
need: 'credentials',
|
|
394
|
-
hint: status.credentials.reason ?? `sign in once (subscription): ${guide?.loginCmd ?? 'see the setup README'} (verify: ${guide?.verifyCmd ?? 'see the setup README'})`,
|
|
414
|
+
hint: status.credentials.reason ?? entry?.credentialsHint ?? `sign in once (subscription): ${guide?.loginCmd ?? 'see the setup README'} (verify: ${guide?.verifyCmd ?? 'see the setup README'})`,
|
|
395
415
|
});
|
|
396
416
|
}
|
|
397
417
|
return out;
|
|
@@ -405,18 +425,19 @@ const mark = (state) => MARK[state] ?? '?';
|
|
|
405
425
|
const setupTarget = (s) => s.setupHint.local ?? s.setupHint.url;
|
|
406
426
|
|
|
407
427
|
// Next-step hint per readiness. Deliberately never says "authenticated"/"authed" — only
|
|
408
|
-
// "credentials present/missing" (
|
|
428
|
+
// "credentials present/missing" (file or key presence, never a live login check).
|
|
409
429
|
const nextStep = (s) => {
|
|
410
430
|
if (s.credentials.reason) return s.credentials.reason;
|
|
431
|
+
const entry = registryEntry(s.name);
|
|
411
432
|
switch (s.readiness) {
|
|
412
433
|
case READY:
|
|
413
434
|
return null;
|
|
414
435
|
case NEEDS_SKILL:
|
|
415
436
|
return `install the bridge skill — ${setupTarget(s)}`;
|
|
416
437
|
case NEEDS_CLI:
|
|
417
|
-
return `install or locate the "${s.cli.bin}" CLI on PATH`;
|
|
438
|
+
return entry?.cliHint ?? `install or locate the "${s.cli.bin}" CLI on PATH`;
|
|
418
439
|
case NEEDS_CREDENTIALS:
|
|
419
|
-
return `set up credentials for "${s.cli.bin}" (marker file ${s.credentials.path} not present)`;
|
|
440
|
+
return entry?.credentialsHint ?? `set up credentials for "${s.cli.bin}" (marker file ${s.credentials.path} not present)`;
|
|
420
441
|
case DEGRADED:
|
|
421
442
|
return `bridge wrapper(s) not on PATH: ${s.wrappers.filter((w) => w.state !== PRESENT).map((w) => w.name).join(', ')}`;
|
|
422
443
|
default:
|
package/tools/family-members.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// itself — can import the DATA without dragging in the whole status/presenter graph
|
|
6
6
|
// (detect-backends, the manifest validator, hide-footprint, engine-source, recipes, the renderers …).
|
|
7
7
|
// install.mjs runs on the npx cold-start hot path, so the leaner import matters; single-source-of-truth
|
|
8
|
-
// + the drift-guard (family-registry.test.mjs pins FAMILY_MEMBERS to the
|
|
8
|
+
// + the drift-guard (family-registry.test.mjs pins FAMILY_MEMBERS to the 6 in-repo capability.json)
|
|
9
9
|
// are preserved — the table just lives in a dependency-free leaf now.
|
|
10
10
|
//
|
|
11
11
|
// Pure data, no imports, no side effects, Node >= 22.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// `npm` is the install package (null for the bridges — placed by `setup`, and once placed refreshed
|
|
17
17
|
// by `init`/`upgrade` from the kit's bundled copies, never npm);
|
|
18
18
|
// `wrapperCmds` is the deduped roles[].cmd set the `setup` linker creates on PATH (bridges only).
|
|
19
|
-
// Kept in lockstep with the
|
|
19
|
+
// Kept in lockstep with the 6 in-repo capability.json by the drift-guard test. The two release skills
|
|
20
20
|
// (release-engineering / release-marketing) are deliberately NOT here — they are not family members
|
|
21
21
|
// (AD-013): no capability.json, not in the kit tarball, not in the role vocabulary.
|
|
22
22
|
export const FAMILY_MEMBERS = [
|
|
@@ -61,6 +61,14 @@ export const FAMILY_MEMBERS = [
|
|
|
61
61
|
// review → agy-review, probe → agy-run (first-seen role order in capability.json; bridge 2.0.0).
|
|
62
62
|
wrapperCmds: ['agy-review', 'agy-run'],
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
name: 'typesafe-jev-bridge',
|
|
66
|
+
kind: 'execution-backend',
|
|
67
|
+
installed: { env: 'TYPESAFE_JEV_BRIDGE_DIR', default: '~/.claude/skills/typesafe-jev-bridge', file: 'SKILL.md' },
|
|
68
|
+
deployed: null,
|
|
69
|
+
npm: null,
|
|
70
|
+
wrapperCmds: ['jev-ask'],
|
|
71
|
+
},
|
|
64
72
|
];
|
|
65
73
|
|
|
66
74
|
// A GLOBAL skill (lives under ~/.claude/skills) may be shared by other projects on the host — the
|
|
@@ -349,8 +349,7 @@ const hasHiddenFence = (projectDir, deps = {}) => {
|
|
|
349
349
|
// probe never imports the rotator).
|
|
350
350
|
// The ADR-layout probe's paths. LOCAL literals, not an import: this module backs the read-only
|
|
351
351
|
// `status` view and importing the rotator would drag child_process + crypto into a status read. A
|
|
352
|
-
// drift guard in family-registry.test.mjs pins each literal to the rotator's exported constant
|
|
353
|
-
// the same baked-frozen-copy shape the gate hook uses for its velocity constants.
|
|
352
|
+
// drift guard in family-registry.test.mjs pins each literal to the rotator's exported constant.
|
|
354
353
|
export const ADR_LAYOUT_PATHS = Object.freeze({
|
|
355
354
|
hot: 'docs/ai/decisions.md',
|
|
356
355
|
monoliths: Object.freeze(['docs/ai/history/decisions-archive.md', 'docs/ai/history/decisions-archive-early.md']),
|
package/tools/labels.mjs
CHANGED
|
@@ -62,6 +62,7 @@ export const DISPLAY_NAMES = Object.freeze({
|
|
|
62
62
|
'agent-workflow-engine': 'engine',
|
|
63
63
|
'codex-cli-bridge': 'codex-bridge',
|
|
64
64
|
'antigravity-cli-bridge': 'antigravity-bridge',
|
|
65
|
+
'typesafe-jev-bridge': 'jev-bridge',
|
|
65
66
|
});
|
|
66
67
|
export const displayOf = (name) => DISPLAY_NAMES[name] ?? name;
|
|
67
68
|
|
package/tools/manifest/schema.md
CHANGED
|
@@ -26,10 +26,12 @@ expansion), never via the shell. The validator is [`validate.mjs`](./validate.mj
|
|
|
26
26
|
|
|
27
27
|
## Role vocabulary
|
|
28
28
|
|
|
29
|
-
`context | plan | execute | review | probe | synthesize`. Every entry of `provides` and every
|
|
29
|
+
`context | plan | execute | review | probe | synthesize | judge`. Every entry of `provides` and every
|
|
30
30
|
key of `roles` must come from this set, and **`provides` ⊇ `Object.keys(roles)`** (you may
|
|
31
31
|
advertise a capability without a callable role, but never the reverse).
|
|
32
32
|
|
|
33
|
+
`judge` is a per-lane carrier the orchestrator dispatches, never a recipe or roster role.
|
|
34
|
+
|
|
33
35
|
### Roles
|
|
34
36
|
|
|
35
37
|
Each `roles.<role>` is an object:
|
|
@@ -42,7 +44,7 @@ Each `roles.<role>` is an object:
|
|
|
42
44
|
`references/review-prompt.md`); repo-relative, **must exist**.
|
|
43
45
|
- `modes`, `output` (optional) — e.g. `["plan","code"]`, `"advisory"`.
|
|
44
46
|
- `contract` (object, optional; execution-backend bridges) — the machine-readable **driving
|
|
45
|
-
contract** for a dispatchable recipe role (`review` / `execute`; the `probe`
|
|
47
|
+
contract** for a dispatchable recipe role (`review` / `execute`; the `probe` and `judge` roles carry none).
|
|
46
48
|
Rides as a validator-tolerated extra field (format-checked by the bridge/kit drift-guard tests,
|
|
47
49
|
not by `validate.mjs`), and is the single source the point-of-use advisor
|
|
48
50
|
(`/agent-workflow-kit procedures`) and each wrapper's `--help` render verbatim:
|
|
@@ -31,7 +31,7 @@ export const KINDS = new Set([
|
|
|
31
31
|
'execution-backend',
|
|
32
32
|
'composition-root',
|
|
33
33
|
]);
|
|
34
|
-
export const ROLE_VOCAB = new Set(['context', 'plan', 'execute', 'review', 'probe', 'synthesize']);
|
|
34
|
+
export const ROLE_VOCAB = new Set(['context', 'plan', 'execute', 'review', 'probe', 'synthesize', 'judge']);
|
|
35
35
|
|
|
36
36
|
export const VALID = 'valid';
|
|
37
37
|
export const UNSUPPORTED = 'unsupported';
|
package/tools/setup-backends.mjs
CHANGED
|
@@ -28,9 +28,10 @@ const EXPECTED_KIND = 'execution-backend';
|
|
|
28
28
|
const CMD_ALLOWED = /^[A-Za-z0-9._-]+$/;
|
|
29
29
|
|
|
30
30
|
// Token → registry name. `codex`/`agy`/`antigravity` are the CLI-facing aliases.
|
|
31
|
-
const ALIASES = { codex: 'codex-cli-bridge', agy: 'antigravity-cli-bridge', antigravity: 'antigravity-cli-bridge' };
|
|
31
|
+
const ALIASES = { codex: 'codex-cli-bridge', agy: 'antigravity-cli-bridge', antigravity: 'antigravity-cli-bridge', jev: 'typesafe-jev-bridge' };
|
|
32
32
|
const resolveBackendName = (token) => ALIASES[token] ?? token;
|
|
33
33
|
const registryEntry = (name) => KNOWN_BACKENDS.find((b) => b.name === resolveBackendName(name));
|
|
34
|
+
const providesReview = (entry) => Boolean(entry?.roleCmds?.review);
|
|
34
35
|
|
|
35
36
|
// A typed STOP — a deliberate refusal we surface (distinct from a native fs error, though both exit
|
|
36
37
|
// non-zero). `Object.assign(new Error(), { code })`, the codebase's typed-error idiom (no classes).
|
|
@@ -671,13 +672,13 @@ export const refreshPlacedBridges = (deps = {}, names = KNOWN_BACKENDS.map((b) =
|
|
|
671
672
|
// view lives in the read-only status mode.
|
|
672
673
|
const STATUS_POINTER = 'Full family + deployment versions: /agent-workflow-kit status';
|
|
673
674
|
|
|
674
|
-
// Count the review-capable backends that are READY right now (
|
|
675
|
+
// Count the review-capable backends that are READY right now (a READY
|
|
675
676
|
// count ≥1 unlocks Reviewed, ≥2 unlocks Council). Uses the MULTI-backend detector. A detection failure
|
|
676
677
|
// → null: we can't tell, so we make NO offer (never a false one). Read-only.
|
|
677
678
|
const reviewReadyCount = (deps) => {
|
|
678
679
|
const detectAll = deps.detectAll ?? detectBackends;
|
|
679
680
|
try {
|
|
680
|
-
return detectAll(deps).filter((d) => d.readiness === READY).length;
|
|
681
|
+
return detectAll(deps).filter((d) => d.readiness === READY && providesReview(registryEntry(d.name))).length;
|
|
681
682
|
} catch {
|
|
682
683
|
return null;
|
|
683
684
|
}
|
|
@@ -704,7 +705,7 @@ export const proactiveReviewOffer = (before, after) => {
|
|
|
704
705
|
|
|
705
706
|
const USAGE = `usage: setup-backends [<backend>] [--bindir <path>] [--dry-run | --refresh-placed] [--help]
|
|
706
707
|
|
|
707
|
-
<backend> codex | agy | antigravity | codex-cli-bridge | antigravity-cli-bridge (default:
|
|
708
|
+
<backend> codex | agy | antigravity | jev | codex-cli-bridge | antigravity-cli-bridge | typesafe-jev-bridge (default: the review bridges)
|
|
708
709
|
--bindir where to link the wrappers (default: ~/.local/bin)
|
|
709
710
|
--dry-run print the plan; change nothing
|
|
710
711
|
--refresh-placed refresh ONLY the already-placed bridges from the kit's bundled copies —
|
|
@@ -714,7 +715,7 @@ const USAGE = `usage: setup-backends [<backend>] [--bindir <path>] [--dry-run |
|
|
|
714
715
|
--help, -h this help
|
|
715
716
|
|
|
716
717
|
Places the bundled bridge skill + links its wrappers (idempotent; refuses to clobber a non-symlink).
|
|
717
|
-
Binary install + the interactive subscription login stay manual — the printed guidance has the exact
|
|
718
|
+
Binary install + the interactive subscription login + a key stay manual — the printed guidance has the exact
|
|
718
719
|
commands. The detector ("/agent-workflow-kit backends") stays read-only; this is the only writer.`;
|
|
719
720
|
|
|
720
721
|
const parseArgs = (argv) => {
|
|
@@ -759,7 +760,7 @@ export const main = (argv = process.argv.slice(2), deps = {}) => {
|
|
|
759
760
|
}
|
|
760
761
|
|
|
761
762
|
let targets;
|
|
762
|
-
if (args.backend === undefined) targets = KNOWN_BACKENDS.map((b) => b.name);
|
|
763
|
+
if (args.backend === undefined) targets = KNOWN_BACKENDS.filter((b) => args.refreshPlaced || providesReview(b)).map((b) => b.name);
|
|
763
764
|
else {
|
|
764
765
|
const entry = registryEntry(args.backend);
|
|
765
766
|
if (!entry) {
|
|
@@ -233,9 +233,9 @@ export { SHELL_METACHARACTERS };
|
|
|
233
233
|
|
|
234
234
|
// The RUNTIME residual documented above, as data: the exact write-redirection / command-
|
|
235
235
|
// substitution / bounded write-flag forms a settings-level allow rule cannot see. Consumed by
|
|
236
|
-
// the PreToolUse gate hook's residual guard —
|
|
237
|
-
//
|
|
238
|
-
//
|
|
236
|
+
// the PreToolUse gate hook's residual guard — scripts/sync-mirrors.mjs writes the generated region
|
|
237
|
+
// in the bundled hook (references/hooks/gate-approve.mjs; a placed file cannot import the kit),
|
|
238
|
+
// alongside UNIVERSAL_READONLY_ALLOWLIST.
|
|
239
239
|
export const RUNTIME_RESIDUAL_FORMS = Object.freeze({
|
|
240
240
|
writeRedirections: Object.freeze(['>', '>>', '1>', '2>', '&>', '>|']),
|
|
241
241
|
// `$(…)` + backtick + BOTH process substitutions `<(…)` / `>(…)` RUN a nested command. `>(…)` is
|