@christang/keel 5.231.13 → 5.232.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/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -3
- package/README.zh-CN.md +5 -3
- package/assets/bootstrap/AGENTS.md +2 -2
- package/bin/keel.js +163 -24
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/plugins/keel/.claude-plugin/plugin.json +1 -1
- package/plugins/keel/.codex-plugin/plugin.json +1 -1
- package/plugins/keel/hooks.json +23 -0
- package/plugins/keel/plugin.json +10 -0
- package/plugins/keel/scripts/pretooluse-guard.js +42 -1
- package/plugins/keel/scripts/session-start.js +47 -6
- package/scripts/bump_version.js +3 -0
- package/scripts/install_to_repo.py +4 -3
- package/scripts/validation/agy.py +770 -0
- package/scripts/validation/baseline.py +19 -3
- package/scripts/validation/common.py +2 -2
- package/scripts/validation/hosts.py +7 -3
- package/scripts/validation/registry.py +7 -0
- package/src/core/capabilities.js +65 -13
- package/src/core/gates.js +3 -3
- package/src/core/projection.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.232.0",
|
|
4
4
|
"description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TanglmChris",
|
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**English** | [中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
> Execution and coordination for AI coding agents — Claude Code, Codex, OpenCode, and
|
|
5
|
+
> Execution and coordination for AI coding agents — Claude Code, Codex, OpenCode, DSH, and AGY.
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|

|
|
9
|
-

|
|
9
|
+

|
|
10
10
|
|
|
11
11
|
## What Keel is for
|
|
12
12
|
|
|
@@ -202,9 +202,11 @@ In your project's root, set it up once:
|
|
|
202
202
|
|
|
203
203
|
```bash
|
|
204
204
|
keel --init # default target: claude
|
|
205
|
-
keel --init --target codex # or: opencode, dsh
|
|
205
|
+
keel --init --target codex # or: opencode, dsh, agy
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
+
`--target agy` (Google Antigravity) shares the `AGENTS.md` and `.agents/skills` repository surface with Codex and DSH, and ships a native AGY plugin manifest (`plugins/keel/plugin.json` and `plugins/keel/hooks.json`) providing `SessionStart` context projection and `PreToolUse` Touch/push guards (`edit_file`, `write_file`, `run_command`). Mount `plugins/` via `~/.gemini/config/plugins.json` or `.agents/plugins/` and run `keel --doctor --target agy` to inspect local AGY plugin configuration.
|
|
209
|
+
|
|
208
210
|
`--target dsh` (DSH, DeepSeek Harness) writes, checks and removes exactly the files `--target codex` does: DSH reads the repository `AGENTS.md` and `.agents/skills`, so there is no separate DSH copy, and uninstalling one removes them for the other. DSH's factory profiles carry no session-start hook, so every capability is `manual` and the `AGENTS.md` bootstrap ("run `keel context` first") is the entry; `keel --doctor --target dsh` reports whether a `dsh` is on PATH and says so.
|
|
209
211
|
|
|
210
212
|
`keel --init` runs OpenSpec init/update and writes Keel's host surface. Then, every time you
|
package/README.zh-CN.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | **中文**
|
|
4
4
|
|
|
5
|
-
> 面向 AI 编码 agent 的执行与协作,支持 Claude Code、Codex、OpenCode 和
|
|
5
|
+
> 面向 AI 编码 agent 的执行与协作,支持 Claude Code、Codex、OpenCode、DSH 和 AGY。
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|

|
|
9
|
-

|
|
9
|
+

|
|
10
10
|
|
|
11
11
|
## Keel 是做什么的
|
|
12
12
|
|
|
@@ -173,9 +173,11 @@ Keel 托管的 Codex 团队通过 `keel codex start --role <role> --repo <worktr
|
|
|
173
173
|
|
|
174
174
|
```bash
|
|
175
175
|
keel --init # 默认 target:claude
|
|
176
|
-
keel --init --target codex # 或 opencode、dsh
|
|
176
|
+
keel --init --target codex # 或 opencode、dsh、agy
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
+
`--target agy`(Google Antigravity)与 Codex、DSH 共用仓库里的 `AGENTS.md` 和 `.agents/skills`,并在插件根目录自带 AGY 原生 manifest(`plugins/keel/plugin.json` 与 `plugins/keel/hooks.json`),提供 `SessionStart` 上下文投影与 `PreToolUse` 写守卫/推分支守卫(覆盖 `edit_file`、`write_file`、`run_command`)。通过 `~/.gemini/config/plugins.json` 或 `.agents/plugins/` 挂载后,可用 `keel --doctor --target agy` 检查本机 AGY 插件配置。
|
|
180
|
+
|
|
179
181
|
`--target dsh`(DSH,DeepSeek Harness)写入、检查、移除的文件与 `--target codex` 完全相同:DSH 读仓库的 `AGENTS.md` 和 `.agents/skills`,所以没有单独的 DSH 副本,卸载其中一个会让另一个也失去这些文件。DSH 的出厂 profile 没有 session-start hook,所以六项能力都是 `manual`,入口是 `AGENTS.md` 的 bootstrap(「先运行 `keel context`」);`keel --doctor --target dsh` 会报告 PATH 上有没有 `dsh`。
|
|
180
182
|
|
|
181
183
|
`keel --init` 会跑 OpenSpec 初始化/更新,并写入 Keel 的宿主面。之后每次开始或恢复工作:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<!-- keel:start version=5.
|
|
1
|
+
<!-- keel:start version=5.232.0 -->
|
|
2
2
|
## Keel Bootstrap
|
|
3
3
|
|
|
4
4
|
- Start every session with `keel context`; OpenSpec artifacts and Git are the durable authority, and memory or transcripts may only inform.
|
|
5
5
|
- Memory: write only what the next session would get wrong without it and the repository cannot answer, never a one-off slip; one fact per entry. Recheck it after a fix, at a release, and at a shift change.
|
|
6
|
-
- Obey the selected task capsule: `keel gate task-start` before implementing, `--record` its fingerprint to Evidence `Contract`, which `task-complete` requires, before checking complete. Touch bounds product writes; the change's own dir is exempt. On Claude a passing `task-start` guards it by default (`--no-guard` opts out).
|
|
6
|
+
- Obey the selected task capsule: `keel gate task-start` before implementing, `--record` its fingerprint to Evidence `Contract`, which `task-complete` requires, before checking complete. Touch bounds product writes; the change's own dir is exempt. On Claude and AGY a passing `task-start` guards it by default (`--no-guard` opts out).
|
|
7
7
|
- Work through an approved `tasks.md` in order, each task through its own gates. A subagent is the model's choice and is treated as the main agent is. No commit, push, sync, or archive unless the task, the owner, or `keel/config.yaml` authorizes it.
|
|
8
8
|
- Route Full (the OpenSpec flow) for new features, interface or protocol changes, cross-module work, or over ~3 files / 100 lines; Lite for local fixes with no interface change. No gate checks routing; a project corrects the size bar with `full_mode_paths:` in `keel/config.yaml`, which `keel context` reports.
|
|
9
9
|
- SessionStart projections are disposable views, never authority; without the plugin, run the commands by hand.
|
package/bin/keel.js
CHANGED
|
@@ -50,7 +50,7 @@ const INSTALL_SCRIPT = path.join(PACKAGE_ROOT, "scripts", "install_to_repo.py");
|
|
|
50
50
|
const DEFAULT_UPDATE_SOURCE = "@christang/keel";
|
|
51
51
|
// `dsh` is a host, not a surface of its own: DSH reads the files the Codex target
|
|
52
52
|
// writes, so parseArgs turns it into target `codex` and remembers the host (#504).
|
|
53
|
-
const VALID_TARGETS = new Set(["claude", "codex", "opencode", "dsh", "both"]);
|
|
53
|
+
const VALID_TARGETS = new Set(["claude", "codex", "opencode", "dsh", "agy", "both"]);
|
|
54
54
|
const KEEL_SKILLS = [
|
|
55
55
|
"align-expectations",
|
|
56
56
|
"debug-failure",
|
|
@@ -88,8 +88,8 @@ const HELP = `keel ${PACKAGE_JSON.version}
|
|
|
88
88
|
|
|
89
89
|
Usage:
|
|
90
90
|
keel context [repo] [--change name] [--task id] [--json] [--clear-handoff]
|
|
91
|
-
keel capabilities [repo] [--target claude|codex|opencode|dsh] [--json]
|
|
92
|
-
keel project --target claude|codex|opencode|dsh --event startup|resume|compaction|worktree [--expected-owner owner] [--change name] [--task id] [--json]
|
|
91
|
+
keel capabilities [repo] [--target claude|codex|opencode|dsh|agy] [--json]
|
|
92
|
+
keel project --target claude|codex|opencode|dsh|agy --event startup|resume|compaction|worktree [--expected-owner owner] [--change name] [--task id] [--json]
|
|
93
93
|
keel gate task-start|task-complete [repo] [--change name] [--task id] [--base git-ref] [--no-guard] [--record] [--keep-evidence M1,M3] [--json]
|
|
94
94
|
keel gate change-close [repo] [--change name] --action sync|archive [--base git-ref] [--json]
|
|
95
95
|
keel guard start|status|clear [repo] [--change name] [--task id] [--force] [--json]
|
|
@@ -118,19 +118,19 @@ Usage:
|
|
|
118
118
|
keel codex migration-status --plan <json-file> [--json]
|
|
119
119
|
keel tick [--repo <path>] [--json] (one model-free step for a host scheduler; keel tick task prints the job)
|
|
120
120
|
keel openspec [args...]
|
|
121
|
-
keel --init [repo] [--target claude|codex|opencode|dsh] [--dry-run] [--force-template-update]
|
|
122
|
-
keel --install [repo] [--target claude|codex|opencode|dsh] [--dry-run] [--force-template-update] [--with-git-hooks]
|
|
123
|
-
keel --clear [repo] [--target claude|codex|opencode|dsh] [--dry-run]
|
|
124
|
-
keel --uninstall [repo] [--target claude|codex|opencode|dsh] [--dry-run]
|
|
121
|
+
keel --init [repo] [--target claude|codex|opencode|dsh|agy] [--dry-run] [--force-template-update]
|
|
122
|
+
keel --install [repo] [--target claude|codex|opencode|dsh|agy] [--dry-run] [--force-template-update] [--with-git-hooks]
|
|
123
|
+
keel --clear [repo] [--target claude|codex|opencode|dsh|agy] [--dry-run]
|
|
124
|
+
keel --uninstall [repo] [--target claude|codex|opencode|dsh|agy] [--dry-run]
|
|
125
125
|
keel --update [--dry-run] [--source npm-package-or-git-spec] [--adopt]
|
|
126
|
-
keel --check [repo] [--target claude|codex|opencode|dsh]
|
|
127
|
-
keel --doctor [repo] [--target claude|codex|opencode|dsh]
|
|
126
|
+
keel --check [repo] [--target claude|codex|opencode|dsh|agy]
|
|
127
|
+
keel --doctor [repo] [--target claude|codex|opencode|dsh|agy]
|
|
128
128
|
keel --version
|
|
129
129
|
keel --help
|
|
130
130
|
|
|
131
131
|
Defaults:
|
|
132
132
|
repo defaults to the current working directory.
|
|
133
|
-
target defaults to claude. dsh is DSH (DeepSeek Harness)
|
|
133
|
+
target defaults to claude. dsh is DSH (DeepSeek Harness) and agy is Google Antigravity (AGY); both share Codex's repository surface (AGENTS.md and .agents/skills).
|
|
134
134
|
--update refreshes the global keel CLI and the Claude and Codex plugins it
|
|
135
135
|
finds installed, not project protocol files.
|
|
136
136
|
update source defaults to ${DEFAULT_UPDATE_SOURCE}.
|
|
@@ -382,7 +382,7 @@ function parseArgs(argv) {
|
|
|
382
382
|
if (arg === "--target") {
|
|
383
383
|
index += 1;
|
|
384
384
|
if (index >= argv.length) {
|
|
385
|
-
fail("--target requires claude, codex, opencode, or
|
|
385
|
+
fail("--target requires claude, codex, opencode, dsh, or agy");
|
|
386
386
|
}
|
|
387
387
|
parsed.target = argv[index];
|
|
388
388
|
continue;
|
|
@@ -475,7 +475,7 @@ function parseArgs(argv) {
|
|
|
475
475
|
fail(`invalid target: ${parsed.target}`);
|
|
476
476
|
}
|
|
477
477
|
parsed.host = parsed.target;
|
|
478
|
-
if (parsed.target === "dsh") {
|
|
478
|
+
if (parsed.target === "dsh" || parsed.target === "agy") {
|
|
479
479
|
parsed.target = "codex";
|
|
480
480
|
}
|
|
481
481
|
if (
|
|
@@ -1421,11 +1421,94 @@ function updateGlobalCli(options, npm, source) {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
|
|
1424
|
+
function agyConfigDir() {
|
|
1425
|
+
const configured = (process.env.KEEL_AGY_CONFIG_DIR || "").trim();
|
|
1426
|
+
return path.resolve(configured || path.join(os.homedir(), ".gemini", "config"));
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
function expandHome(value) {
|
|
1430
|
+
if (typeof value !== "string") return "";
|
|
1431
|
+
if (value === "~") return os.homedir();
|
|
1432
|
+
if (value.startsWith("~/")) return path.join(os.homedir(), value.slice(2));
|
|
1433
|
+
return value;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
function inspectAgyPlugins(repo) {
|
|
1437
|
+
const configDir = agyConfigDir();
|
|
1438
|
+
const globalPluginsJson = path.join(configDir, "plugins.json");
|
|
1439
|
+
const globalPluginsDir = path.join(configDir, "plugins", "keel", "plugin.json");
|
|
1440
|
+
const globalConfigJson = path.join(configDir, "config.json");
|
|
1441
|
+
const sources = [];
|
|
1442
|
+
let disabled = false;
|
|
1443
|
+
|
|
1444
|
+
if (fs.existsSync(globalPluginsJson)) {
|
|
1445
|
+
try {
|
|
1446
|
+
const parsed = JSON.parse(fs.readFileSync(globalPluginsJson, "utf8"));
|
|
1447
|
+
const entries = Array.isArray(parsed.entries) ? parsed.entries : [];
|
|
1448
|
+
for (const entry of entries) {
|
|
1449
|
+
const rawPath = entry && typeof entry.path === "string" ? entry.path : "";
|
|
1450
|
+
if (!rawPath) continue;
|
|
1451
|
+
const resolved = path.resolve(expandHome(rawPath));
|
|
1452
|
+
const hasKeel =
|
|
1453
|
+
fs.existsSync(path.join(resolved, "keel", "plugin.json"))
|
|
1454
|
+
|| (path.basename(resolved) === "keel" && fs.existsSync(path.join(resolved, "plugin.json")));
|
|
1455
|
+
if (hasKeel) {
|
|
1456
|
+
sources.push(`${globalPluginsJson} -> ${rawPath}`);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
} catch {
|
|
1460
|
+
sources.push(`${globalPluginsJson} (unreadable)`);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
if (fs.existsSync(globalPluginsDir)) {
|
|
1464
|
+
sources.push(globalPluginsDir);
|
|
1465
|
+
}
|
|
1466
|
+
if (repo) {
|
|
1467
|
+
const wsPluginsDir = path.join(repo, ".agents", "plugins", "keel", "plugin.json");
|
|
1468
|
+
const wsPluginsJson = path.join(repo, ".agents", "plugins.json");
|
|
1469
|
+
if (fs.existsSync(wsPluginsDir)) {
|
|
1470
|
+
sources.push(".agents/plugins/keel/plugin.json");
|
|
1471
|
+
}
|
|
1472
|
+
if (fs.existsSync(wsPluginsJson)) {
|
|
1473
|
+
sources.push(".agents/plugins.json");
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
if (fs.existsSync(globalConfigJson)) {
|
|
1477
|
+
try {
|
|
1478
|
+
const cfg = JSON.parse(fs.readFileSync(globalConfigJson, "utf8"));
|
|
1479
|
+
if (cfg && cfg.plugins && cfg.plugins.keel && cfg.plugins.keel.enabled === false) {
|
|
1480
|
+
disabled = true;
|
|
1481
|
+
}
|
|
1482
|
+
} catch {
|
|
1483
|
+
// Ignore unreadable config.json for disabled probe.
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
return { configDir, globalPluginsJson, sources, disabled };
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
function noticeAgyPlugin(options) {
|
|
1490
|
+
const info = inspectAgyPlugins(null);
|
|
1491
|
+
if (info.sources.length === 0) return true;
|
|
1492
|
+
if (options.dryRun) {
|
|
1493
|
+
process.stdout.write(
|
|
1494
|
+
`keel: would report read-only AGY plugin notice for ${info.sources.join(", ")} (leaves ${info.configDir} untouched)\n`
|
|
1495
|
+
);
|
|
1496
|
+
return true;
|
|
1497
|
+
}
|
|
1498
|
+
updateLine(
|
|
1499
|
+
"agy plugin",
|
|
1500
|
+
"manual",
|
|
1501
|
+
`configured via ${info.sources.join(", ")}${info.disabled ? " (disabled in config.json)" : ""}; `
|
|
1502
|
+
+ "keel --update does not modify AGY config — update your Keel plugin checkout or reinstall via `agy plugin` and start a new AGY session"
|
|
1503
|
+
);
|
|
1504
|
+
return true;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1424
1507
|
function runGlobalUpdate(options) {
|
|
1425
1508
|
if (options.repo !== null) {
|
|
1426
1509
|
fail("--update refreshes the global keel CLI and does not accept a repo path");
|
|
1427
1510
|
}
|
|
1428
|
-
if (options.target !== "claude") {
|
|
1511
|
+
if (options.target !== "claude" || (options.host && options.host !== "claude")) {
|
|
1429
1512
|
fail("--update refreshes the global keel CLI and does not accept --target");
|
|
1430
1513
|
}
|
|
1431
1514
|
if (options.forceTemplateUpdate) {
|
|
@@ -1443,6 +1526,7 @@ function runGlobalUpdate(options) {
|
|
|
1443
1526
|
updateClaudePlugin(options, npm),
|
|
1444
1527
|
adoptClaudeSessions(options),
|
|
1445
1528
|
updateCodexPlugin(options),
|
|
1529
|
+
noticeAgyPlugin(options),
|
|
1446
1530
|
];
|
|
1447
1531
|
return results.every(Boolean) ? 0 : 1;
|
|
1448
1532
|
}
|
|
@@ -1568,7 +1652,8 @@ function runPython(script, args) {
|
|
|
1568
1652
|
|
|
1569
1653
|
function installerArgs(options, extra = []) {
|
|
1570
1654
|
const repo = path.resolve(options.repo || process.cwd());
|
|
1571
|
-
const
|
|
1655
|
+
const installTarget = options.host === "agy" ? "agy" : options.target;
|
|
1656
|
+
const args = [repo, "--target", installTarget, ...extra];
|
|
1572
1657
|
if (options.dryRun) {
|
|
1573
1658
|
args.push("--dry-run");
|
|
1574
1659
|
}
|
|
@@ -2248,6 +2333,45 @@ function printDshSurface() {
|
|
|
2248
2333
|
);
|
|
2249
2334
|
}
|
|
2250
2335
|
|
|
2336
|
+
function printAgySurface(repo) {
|
|
2337
|
+
const probe = spawnSync("agy", ["--version"], { encoding: "utf8", timeout: 5000 });
|
|
2338
|
+
const version = probe.error || probe.status !== 0
|
|
2339
|
+
? null
|
|
2340
|
+
: String(probe.stdout || "").trim().split("\n")[0];
|
|
2341
|
+
if (version) {
|
|
2342
|
+
printDoctorLine("AGY CLI", "ok", version);
|
|
2343
|
+
} else if (probe.error && probe.error.code !== "ENOENT") {
|
|
2344
|
+
printDoctorLine("AGY CLI", "unreadable", `agy --version did not answer (${probe.error.code || "error"})`);
|
|
2345
|
+
} else {
|
|
2346
|
+
printDoctorLine("AGY CLI", "not found", "no agy on PATH; the repository surface does not need it");
|
|
2347
|
+
}
|
|
2348
|
+
const info = inspectAgyPlugins(repo);
|
|
2349
|
+
if (info.sources.length === 0) {
|
|
2350
|
+
printDoctorLine(
|
|
2351
|
+
"AGY plugin config",
|
|
2352
|
+
"not found",
|
|
2353
|
+
`no Keel plugin entry found in ${info.globalPluginsJson}, ${path.join(info.configDir, "plugins")}, or .agents/plugins`
|
|
2354
|
+
);
|
|
2355
|
+
} else if (info.disabled) {
|
|
2356
|
+
printDoctorLine(
|
|
2357
|
+
"AGY plugin config",
|
|
2358
|
+
"warning",
|
|
2359
|
+
`found at ${info.sources.join(", ")}, but disabled in ${path.join(info.configDir, "config.json")} (plugins.keel.enabled=false)`
|
|
2360
|
+
);
|
|
2361
|
+
} else {
|
|
2362
|
+
printDoctorLine(
|
|
2363
|
+
"AGY plugin config",
|
|
2364
|
+
"ok",
|
|
2365
|
+
`found at ${info.sources.join(", ")}; runtime activation, trust, and hook blocking stay manual/advisory until verified in an AGY session`
|
|
2366
|
+
);
|
|
2367
|
+
}
|
|
2368
|
+
printDoctorLine(
|
|
2369
|
+
"AGY surface",
|
|
2370
|
+
"ok",
|
|
2371
|
+
"shared with Codex and DSH: AGENTS.md and .agents/skills, which AGY reads"
|
|
2372
|
+
);
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2251
2375
|
function printTargetSurface(repo, target, host = target) {
|
|
2252
2376
|
process.stdout.write("\nTarget surface:\n");
|
|
2253
2377
|
|
|
@@ -2286,12 +2410,14 @@ function printTargetSurface(repo, target, host = target) {
|
|
|
2286
2410
|
+ "compatibility-only outside v4 support"
|
|
2287
2411
|
);
|
|
2288
2412
|
} else {
|
|
2289
|
-
const manifestRelative =
|
|
2290
|
-
"plugins",
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2413
|
+
const manifestRelative = host === "agy"
|
|
2414
|
+
? path.join("plugins", "keel", "plugin.json")
|
|
2415
|
+
: path.join(
|
|
2416
|
+
"plugins",
|
|
2417
|
+
"keel",
|
|
2418
|
+
target === "codex" ? ".codex-plugin" : ".claude-plugin",
|
|
2419
|
+
"plugin.json"
|
|
2420
|
+
);
|
|
2295
2421
|
const manifestPath = path.join(repo, manifestRelative);
|
|
2296
2422
|
let sourceStatus = "missing";
|
|
2297
2423
|
let sourceDetail = `plugin source absent at ${manifestRelative}`;
|
|
@@ -2327,9 +2453,11 @@ function printTargetSurface(repo, target, host = target) {
|
|
|
2327
2453
|
"manual",
|
|
2328
2454
|
"marketplace install, enablement, hook trust/activation, and behavior "
|
|
2329
2455
|
+ `need runtime evidence; install via ${
|
|
2330
|
-
|
|
2331
|
-
? "
|
|
2332
|
-
:
|
|
2456
|
+
host === "agy"
|
|
2457
|
+
? "~/.gemini/config/plugins.json, .agents/plugins/, or `agy plugin install`"
|
|
2458
|
+
: target === "codex"
|
|
2459
|
+
? "codex plugin add keel@<marketplace>"
|
|
2460
|
+
: "claude plugin install keel@<marketplace>"
|
|
2333
2461
|
} and verify in a fresh session`
|
|
2334
2462
|
);
|
|
2335
2463
|
if (target === "claude") {
|
|
@@ -2535,6 +2663,7 @@ function runDoctor(options) {
|
|
|
2535
2663
|
|
|
2536
2664
|
printTargetSurface(repo, options.target, options.host || options.target);
|
|
2537
2665
|
if (options.host === "dsh") printDshSurface();
|
|
2666
|
+
if (options.host === "agy") printAgySurface(repo);
|
|
2538
2667
|
printAdditionalOverlayHealth(repo, options.target);
|
|
2539
2668
|
printLensSurface(repo, options.target);
|
|
2540
2669
|
const authorizationOk = printStandingAuthorizationSurface(repo);
|
|
@@ -3189,7 +3318,10 @@ function runAction(options) {
|
|
|
3189
3318
|
const repo = path.resolve(options.repo || process.cwd());
|
|
3190
3319
|
let result;
|
|
3191
3320
|
try {
|
|
3192
|
-
result = runGate(repo, options.gateStage,
|
|
3321
|
+
result = runGate(repo, options.gateStage, {
|
|
3322
|
+
...options,
|
|
3323
|
+
target: options.host || options.target,
|
|
3324
|
+
});
|
|
3193
3325
|
} catch (error) {
|
|
3194
3326
|
if (error instanceof GateInputError) {
|
|
3195
3327
|
process.stderr.write(`keel: gate input error: ${error.message}\n`);
|
|
@@ -3338,6 +3470,13 @@ function runAction(options) {
|
|
|
3338
3470
|
+ "the files which host the repository was set up for\n"
|
|
3339
3471
|
);
|
|
3340
3472
|
}
|
|
3473
|
+
if (options.host === "agy") {
|
|
3474
|
+
process.stdout.write(
|
|
3475
|
+
"keel: AGY's repository files are shared with Codex and DSH (AGENTS.md and .agents/skills); "
|
|
3476
|
+
+ "removing them removes them for those hosts too, and Keel cannot tell from "
|
|
3477
|
+
+ "the files which host the repository was set up for\n"
|
|
3478
|
+
);
|
|
3479
|
+
}
|
|
3341
3480
|
const uninstallStatus = runPython(
|
|
3342
3481
|
INSTALL_SCRIPT,
|
|
3343
3482
|
installerArgs(options, ["--uninstall"])
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christang/keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.232.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@christang/keel",
|
|
9
|
-
"version": "5.
|
|
9
|
+
"version": "5.232.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fission-ai/openspec": "1.14.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.232.0",
|
|
4
4
|
"description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TanglmChris",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.232.0",
|
|
4
4
|
"description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Codex and Claude Code.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TanglmChris",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"keel": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"type": "command",
|
|
6
|
+
"command": "node ./scripts/session-start.js --host agy",
|
|
7
|
+
"timeout": 15
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"PreToolUse": [
|
|
11
|
+
{
|
|
12
|
+
"matcher": "edit_file|write_file|run_command",
|
|
13
|
+
"hooks": [
|
|
14
|
+
{
|
|
15
|
+
"type": "command",
|
|
16
|
+
"command": "node ./scripts/pretooluse-guard.js --host agy",
|
|
17
|
+
"timeout": 10
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "keel",
|
|
3
|
+
"version": "5.232.0",
|
|
4
|
+
"description": "Keel OpenSpec execution discipline: stateless continuity, task capsules, deterministic gates, and expectation alignment for Antigravity (AGY), Codex, and Claude Code.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "TanglmChris",
|
|
7
|
+
"url": "https://github.com/TanglmChris"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/TanglmChris/keel"
|
|
10
|
+
}
|
|
@@ -43,10 +43,28 @@ function readStdin() {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
function cliHost(argv = process.argv.slice(2)) {
|
|
47
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
48
|
+
if (argv[i] === "--host" && argv[i + 1]) return argv[i + 1].trim().toLowerCase();
|
|
49
|
+
if (argv[i].startsWith("--host=")) return argv[i].slice("--host=".length).trim().toLowerCase();
|
|
50
|
+
}
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isAgyEvent(event) {
|
|
55
|
+
if (cliHost() === "agy") return true;
|
|
56
|
+
return Boolean(event && typeof event === "object" && event.toolCall && typeof event.toolCall === "object");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let agyMode = cliHost() === "agy";
|
|
46
60
|
let denied = false;
|
|
47
61
|
|
|
48
62
|
function deny(reason) {
|
|
49
63
|
denied = true;
|
|
64
|
+
if (agyMode) {
|
|
65
|
+
process.stdout.write(`${JSON.stringify({ decision: "deny", reason })}\n`);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
50
68
|
process.stdout.write(
|
|
51
69
|
`${JSON.stringify({
|
|
52
70
|
hookSpecificOutput: {
|
|
@@ -59,8 +77,13 @@ function deny(reason) {
|
|
|
59
77
|
}
|
|
60
78
|
|
|
61
79
|
// Hand the decision to the user for this one call (#280): the host asks, and
|
|
62
|
-
// nothing is stored, so the next call is asked again.
|
|
80
|
+
// nothing is stored, so the next call is asked again. On AGY, `force_ask`
|
|
81
|
+
// ignores any cached Always Allow rule so every protected push asks again.
|
|
63
82
|
function ask(reason) {
|
|
83
|
+
if (agyMode) {
|
|
84
|
+
process.stdout.write(`${JSON.stringify({ decision: "force_ask", reason })}\n`);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
64
87
|
process.stdout.write(
|
|
65
88
|
`${JSON.stringify({
|
|
66
89
|
hookSpecificOutput: {
|
|
@@ -773,6 +796,7 @@ function main(suppliedEvent = null) {
|
|
|
773
796
|
} catch {
|
|
774
797
|
event = {};
|
|
775
798
|
}
|
|
799
|
+
agyMode = isAgyEvent(event);
|
|
776
800
|
const repo =
|
|
777
801
|
typeof event.cwd === "string" && event.cwd ? event.cwd : process.cwd();
|
|
778
802
|
|
|
@@ -784,6 +808,23 @@ function main(suppliedEvent = null) {
|
|
|
784
808
|
if (handed !== null) return handed;
|
|
785
809
|
}
|
|
786
810
|
|
|
811
|
+
// Normalize AGY `toolCall` payloads into the shared Touch and push evaluators.
|
|
812
|
+
// Pass-through returns 0 with empty stdout so AGY's own permission policy
|
|
813
|
+
// remains authoritative and is never bypassed by an explicit allow.
|
|
814
|
+
if (event.toolCall && typeof event.toolCall === "object") {
|
|
815
|
+
const toolName = event.toolCall.name;
|
|
816
|
+
const args = event.toolCall.args && typeof event.toolCall.args === "object"
|
|
817
|
+
? event.toolCall.args
|
|
818
|
+
: {};
|
|
819
|
+
if (toolName === "edit_file" || toolName === "write_file") {
|
|
820
|
+
event = { ...event, tool_name: "Edit", tool_input: { file_path: args.Path } };
|
|
821
|
+
} else if (toolName === "run_command") {
|
|
822
|
+
event = { ...event, tool_name: "Bash", tool_input: { command: args.CommandLine } };
|
|
823
|
+
} else {
|
|
824
|
+
return 0;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
787
828
|
if (event.tool_name === "apply_patch") {
|
|
788
829
|
const patch = typeof event.tool_input === "string" ? event.tool_input
|
|
789
830
|
: event.tool_input && (event.tool_input.command || event.tool_input.patch || event.tool_input.input);
|
|
@@ -36,6 +36,25 @@ const TIMEOUT_MS = Number(process.env.KEEL_HOOK_TIMEOUT_MS || 8000) || 8000;
|
|
|
36
36
|
const MAX_REASONS = 3;
|
|
37
37
|
const MAX_REASON_LENGTH = 300;
|
|
38
38
|
|
|
39
|
+
function cliHost(argv = process.argv.slice(2)) {
|
|
40
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
41
|
+
if (argv[i] === "--host" && argv[i + 1]) return argv[i + 1].trim().toLowerCase();
|
|
42
|
+
if (argv[i].startsWith("--host=")) return argv[i].slice("--host=".length).trim().toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function isAgyEvent(event) {
|
|
48
|
+
if (cliHost() === "agy") return true;
|
|
49
|
+
if (!event || typeof event !== "object") return false;
|
|
50
|
+
if (event.hookEventName === "SessionStart") return true;
|
|
51
|
+
if (typeof event.conversationId === "string" && event.conversationId) return true;
|
|
52
|
+
if (Array.isArray(event.workspacePaths)) return true;
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let agyMode = cliHost() === "agy";
|
|
57
|
+
|
|
39
58
|
function readStdin() {
|
|
40
59
|
try {
|
|
41
60
|
return fs.readFileSync(0, "utf8");
|
|
@@ -49,7 +68,18 @@ function readStdin() {
|
|
|
49
68
|
// channel, not a replacement: `additionalContext` still carries the full
|
|
50
69
|
// projection to the agent, and a host that does not recognize the field simply
|
|
51
70
|
// ignores it and leaves today's behavior intact.
|
|
71
|
+
// On AGY, SessionStart expects `injectSteps: [{ systemMessage: { systemMessage } }]`
|
|
72
|
+
// without `metadata` (probed on agy 1.5.20: adding `metadata.user_markdown`
|
|
73
|
+
// caused the injected step to be dropped).
|
|
52
74
|
function emit(context, humanMessage) {
|
|
75
|
+
if (agyMode) {
|
|
76
|
+
process.stdout.write(
|
|
77
|
+
`${JSON.stringify({
|
|
78
|
+
injectSteps: [{ systemMessage: { systemMessage: context } }],
|
|
79
|
+
})}\n`
|
|
80
|
+
);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
53
83
|
const payload = {};
|
|
54
84
|
if (humanMessage) payload.systemMessage = humanMessage;
|
|
55
85
|
payload.hookSpecificOutput = {
|
|
@@ -123,19 +153,29 @@ function precedentPointer(cwd) {
|
|
|
123
153
|
// Keel has verified; an unprobed target gets a description instead of an
|
|
124
154
|
// invented command line.
|
|
125
155
|
const HOST_UPDATE = "your host's own plugin update command";
|
|
156
|
+
const AGY_UPDATE = "updating your AGY Keel plugin source or reinstalling via `agy plugin`";
|
|
126
157
|
|
|
127
158
|
// The plugin's own manifest sits beside this script, so its version is read
|
|
128
159
|
// from `__dirname` rather than from CLAUDE_PLUGIN_ROOT: the path this file was
|
|
129
160
|
// loaded from is a fact, while an environment variable is a claim the host may
|
|
130
161
|
// not have made. Whichever target's manifest is present is the one that ran.
|
|
131
162
|
function pluginManifest() {
|
|
132
|
-
const targets =
|
|
133
|
-
[
|
|
134
|
-
|
|
135
|
-
|
|
163
|
+
const targets = agyMode
|
|
164
|
+
? [
|
|
165
|
+
["", AGY_UPDATE],
|
|
166
|
+
[".claude-plugin", "`claude plugin update`"],
|
|
167
|
+
[".codex-plugin", HOST_UPDATE],
|
|
168
|
+
]
|
|
169
|
+
: [
|
|
170
|
+
[".claude-plugin", "`claude plugin update`"],
|
|
171
|
+
[".codex-plugin", HOST_UPDATE],
|
|
172
|
+
["", AGY_UPDATE],
|
|
173
|
+
];
|
|
136
174
|
for (const [dir, remedy] of targets) {
|
|
137
175
|
try {
|
|
138
|
-
const manifest =
|
|
176
|
+
const manifest = dir
|
|
177
|
+
? path.join(__dirname, "..", dir, "plugin.json")
|
|
178
|
+
: path.join(__dirname, "..", "plugin.json");
|
|
139
179
|
const value = JSON.parse(fs.readFileSync(manifest, "utf8")).version;
|
|
140
180
|
if (typeof value === "string" && value.trim()) {
|
|
141
181
|
return { version: value.trim(), remedy };
|
|
@@ -144,7 +184,7 @@ function pluginManifest() {
|
|
|
144
184
|
// A missing or unreadable manifest is undiscoverable, not drift.
|
|
145
185
|
}
|
|
146
186
|
}
|
|
147
|
-
return { version: null, remedy: HOST_UPDATE };
|
|
187
|
+
return { version: null, remedy: agyMode ? AGY_UPDATE : HOST_UPDATE };
|
|
148
188
|
}
|
|
149
189
|
|
|
150
190
|
// On Claude the plugin is the repository's tagged tree, cached at
|
|
@@ -549,6 +589,7 @@ function main() {
|
|
|
549
589
|
} catch {
|
|
550
590
|
event = {};
|
|
551
591
|
}
|
|
592
|
+
agyMode = isAgyEvent(event);
|
|
552
593
|
const cwd =
|
|
553
594
|
typeof event.cwd === "string" && event.cwd ? event.cwd : process.cwd();
|
|
554
595
|
|
package/scripts/bump_version.js
CHANGED
|
@@ -179,6 +179,9 @@ function main() {
|
|
|
179
179
|
|
|
180
180
|
bumpPackageFiles(newVersion);
|
|
181
181
|
bumpClaudeMarketplace(newVersion);
|
|
182
|
+
replaceInFile("plugins/keel/plugin.json", [
|
|
183
|
+
[`"version": "${oldVersion}"`, `"version": "${newVersion}"`],
|
|
184
|
+
]);
|
|
182
185
|
replaceInFile("plugins/keel/.claude-plugin/plugin.json", [
|
|
183
186
|
[`"version": "${oldVersion}"`, `"version": "${newVersion}"`],
|
|
184
187
|
]);
|
|
@@ -73,12 +73,13 @@ MANAGED_START = _bootstrap_marker()
|
|
|
73
73
|
CLAUDE_IMPORT_BLOCK = f"{MANAGED_START}\n@AGENTS.md\n{MANAGED_END}\n"
|
|
74
74
|
KEEL_HOOK_NAME = "keel-gate"
|
|
75
75
|
KEEL_HOOK_ROOT = Path(".claude") / "hooks" / KEEL_HOOK_NAME
|
|
76
|
-
SUPPORTED_TARGETS = ("claude", "codex", "opencode")
|
|
77
|
-
AGENT_PROTOCOL_TARGETS = {"codex", "opencode"}
|
|
76
|
+
SUPPORTED_TARGETS = ("claude", "codex", "opencode", "agy")
|
|
77
|
+
AGENT_PROTOCOL_TARGETS = {"codex", "opencode", "agy"}
|
|
78
78
|
TARGET_ADAPTER_PATHS = {
|
|
79
79
|
"claude": Path(".claude") / "keel" / "keel-adapter.js",
|
|
80
80
|
"codex": Path(".agents") / "keel" / "keel-adapter.js",
|
|
81
81
|
"opencode": Path(".opencode") / "keel" / "keel-adapter.js",
|
|
82
|
+
"agy": Path(".agents") / "keel" / "keel-adapter.js",
|
|
82
83
|
}
|
|
83
84
|
HANDOFF_FIELDS = {"schema", "owner", "action", "reason"}
|
|
84
85
|
HANDOFF_ACTIONS = {
|
|
@@ -1445,7 +1446,7 @@ def main() -> int:
|
|
|
1445
1446
|
parser.add_argument("repo", help="Target repository path.")
|
|
1446
1447
|
parser.add_argument(
|
|
1447
1448
|
"--target",
|
|
1448
|
-
choices=["both", "claude", "codex", "opencode"],
|
|
1449
|
+
choices=["both", "claude", "codex", "opencode", "agy"],
|
|
1449
1450
|
default="claude",
|
|
1450
1451
|
help="Protocol target to install. Defaults to claude; both is a legacy alias for claude.",
|
|
1451
1452
|
)
|