harness-everything 0.57.3 → 0.58.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/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.releaserc.json +2 -0
- package/CHANGELOG.md +15 -0
- package/benchmarks/results/live-host/agy-2026-11-22/README.md +49 -0
- package/benchmarks/results/live-host/agy-2026-11-23/README.md +48 -0
- package/ci/action-gate.test.js +162 -0
- package/ci/doc-capability-consistency.test.js +11 -1
- package/ci/mechanism-2aa-codex-action-gate-policy.test.js +37 -0
- package/ci/mechanism-2ao-plugin-sync.test.js +235 -2
- package/ci/mechanism-2w-platform-compatibility.test.js +13 -2
- package/ci/mechanism-2x-release-automation.test.js +3 -1
- package/ci/mechanism-agy-hooks.test.js +1096 -0
- package/ci/mechanism-agy-plugin-package.test.js +76 -0
- package/docs/codex-action-gate.md +2 -0
- package/docs/platform-capabilities.md +3 -1
- package/docs/platform-compatibility.json +34 -1
- package/hooks/scripts/action-gate.js +71 -5
- package/hooks/scripts/agy-post-tool.js +124 -0
- package/hooks/scripts/agy-pre-invocation.js +185 -0
- package/hooks/scripts/agy-pre-tool.js +158 -0
- package/hooks/scripts/agy-session-start.js +54 -0
- package/hooks/scripts/agy-stop.js +152 -0
- package/hooks/scripts/lib/agy-adapter-core.js +168 -0
- package/hooks/scripts/state-persist.js +50 -10
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.antigravity-plugin/plugin.json +18 -0
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/action-gate.js +71 -5
- package/plugins/harness-everything/hooks/scripts/agy-post-tool.js +124 -0
- package/plugins/harness-everything/hooks/scripts/agy-pre-invocation.js +185 -0
- package/plugins/harness-everything/hooks/scripts/agy-pre-tool.js +158 -0
- package/plugins/harness-everything/hooks/scripts/agy-session-start.js +54 -0
- package/plugins/harness-everything/hooks/scripts/agy-stop.js +152 -0
- package/plugins/harness-everything/hooks/scripts/lib/agy-adapter-core.js +168 -0
- package/plugins/harness-everything/hooks/scripts/state-persist.js +50 -10
- package/plugins/harness-everything/hooks.json +44 -0
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/rules/AGENTS.md +111 -0
- package/sbom.cdx.json +7 -7
- package/scripts/plugin-sync.js +105 -14
- package/scripts/sync-openai-plugin.js +16 -1
- package/scripts/sync-release-version.js +1 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('assert');
|
|
4
|
+
const crypto = require('crypto');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
9
|
+
const PLUGIN = path.join(ROOT, 'plugins', 'harness-everything');
|
|
10
|
+
const ROOT_PKG = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
|
11
|
+
const SOURCE_MANIFEST = JSON.parse(fs.readFileSync(path.join(ROOT, '.claude-plugin', 'plugin.json'), 'utf8'));
|
|
12
|
+
|
|
13
|
+
function sha256File(filePath) {
|
|
14
|
+
return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 1. Manifest structure & schema
|
|
18
|
+
const AGY_MANIFEST_PATH = path.join(PLUGIN, '.antigravity-plugin', 'plugin.json');
|
|
19
|
+
assert.ok(fs.existsSync(AGY_MANIFEST_PATH), '.antigravity-plugin/plugin.json must exist');
|
|
20
|
+
const agyManifest = JSON.parse(fs.readFileSync(AGY_MANIFEST_PATH, 'utf8'));
|
|
21
|
+
|
|
22
|
+
assert.strictEqual(agyManifest.name, 'harness-everything', 'name must be harness-everything');
|
|
23
|
+
assert.strictEqual(agyManifest.version, ROOT_PKG.version, 'version must match package.json');
|
|
24
|
+
assert.ok(typeof agyManifest.description === 'string' && agyManifest.description.length > 0, 'description must be non-empty');
|
|
25
|
+
assert.ok(agyManifest.author && agyManifest.author.name, 'author name must be present');
|
|
26
|
+
assert.match(agyManifest.repository, /^https:\/\/github\.com\//, 'repository must be valid HTTPS github URL');
|
|
27
|
+
assert.match(agyManifest.homepage, /^https:\/\/github\.com\//, 'homepage must be valid HTTPS URL');
|
|
28
|
+
assert.strictEqual(agyManifest.license, 'Apache-2.0', 'license must be Apache-2.0');
|
|
29
|
+
assert.ok(Array.isArray(agyManifest.keywords) && agyManifest.keywords.length > 0, 'keywords must be non-empty array');
|
|
30
|
+
|
|
31
|
+
// 2. Rules integration (AGENTS.md)
|
|
32
|
+
const RULES_PATH = path.join(PLUGIN, 'rules', 'AGENTS.md');
|
|
33
|
+
assert.ok(fs.existsSync(RULES_PATH), 'plugins/harness-everything/rules/AGENTS.md must exist');
|
|
34
|
+
assert.strictEqual(sha256File(RULES_PATH), sha256File(path.join(ROOT, 'AGENTS.md')), 'rules/AGENTS.md must match repository AGENTS.md byte-for-byte');
|
|
35
|
+
|
|
36
|
+
// 3. AGY hook runtime parity between hooks/scripts/ and plugins/harness-everything/hooks/scripts/
|
|
37
|
+
const HOOKS_JSON = path.join(PLUGIN, 'hooks.json');
|
|
38
|
+
assert.ok(fs.existsSync(HOOKS_JSON), 'plugins/harness-everything/hooks.json must exist at plugin root');
|
|
39
|
+
JSON.parse(fs.readFileSync(HOOKS_JSON, 'utf8'));
|
|
40
|
+
|
|
41
|
+
const agyHookFiles = [
|
|
42
|
+
'agy-session-start.js',
|
|
43
|
+
'agy-pre-invocation.js',
|
|
44
|
+
'agy-pre-tool.js',
|
|
45
|
+
'agy-post-tool.js',
|
|
46
|
+
'agy-stop.js',
|
|
47
|
+
'state-persist.js',
|
|
48
|
+
path.join('lib', 'agy-adapter-core.js')
|
|
49
|
+
];
|
|
50
|
+
for (const rel of agyHookFiles) {
|
|
51
|
+
const sourceFile = path.join(ROOT, 'hooks', 'scripts', rel);
|
|
52
|
+
const packagedFile = path.join(PLUGIN, 'hooks', 'scripts', rel);
|
|
53
|
+
assert.ok(fs.existsSync(sourceFile), `Source hook script missing: ${rel}`);
|
|
54
|
+
assert.ok(fs.existsSync(packagedFile), `Packaged hook script missing: ${rel}`);
|
|
55
|
+
assert.strictEqual(sha256File(packagedFile), sha256File(sourceFile), `Packaged hook script must match source byte-for-byte: ${rel}`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 4. Canonical skills parity
|
|
59
|
+
const expectedSkills = (SOURCE_MANIFEST.skills || []).map(entry => path.basename(entry)).sort();
|
|
60
|
+
const packagedSkills = fs.readdirSync(path.join(PLUGIN, 'skills'), { withFileTypes: true })
|
|
61
|
+
.filter(entry => entry.isDirectory())
|
|
62
|
+
.map(entry => entry.name)
|
|
63
|
+
.sort();
|
|
64
|
+
|
|
65
|
+
assert.strictEqual(expectedSkills.length, 28, 'canonical suite should contain 28 skills');
|
|
66
|
+
assert.deepStrictEqual(packagedSkills, expectedSkills, 'AGY package must contain exactly the 28 canonical skills');
|
|
67
|
+
|
|
68
|
+
for (const skillName of packagedSkills) {
|
|
69
|
+
const skillFile = path.join(PLUGIN, 'skills', skillName, 'SKILL.md');
|
|
70
|
+
assert.ok(fs.existsSync(skillFile), `${skillName} must contain SKILL.md`);
|
|
71
|
+
const content = fs.readFileSync(skillFile, 'utf8');
|
|
72
|
+
assert.ok(content.includes('## USE FOR:'), `${skillName} must contain ## USE FOR:`);
|
|
73
|
+
assert.ok(content.includes('## DO NOT USE FOR:'), `${skillName} must contain ## DO NOT USE FOR:`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
console.log('Antigravity (AGY) plugin package verified: manifest, rules, hooks parity, and 28 canonical skills in lockstep.');
|
|
@@ -168,6 +168,8 @@ The Codex-only metadata exception checks the actual tool input, with all of thes
|
|
|
168
168
|
|
|
169
169
|
Any additional key, including `state`, `base_branch`, `base`, `maintainer_can_modify`, `draft`, or an unknown key, prevents the exception, even when its value is null. Mixed metadata/high-risk inputs and similar operation names retain the existing Gate. Claude, OpenCode and unknown hosts retain their prior mutation rules. PR creation behavior is unchanged.
|
|
170
170
|
|
|
171
|
+
Codex also defers only the exact Issue comment tools when their arguments are exactly `{ repo_full_name, pr_number, comment }` with a non-empty string comment, and the exact Issue update tools when their arguments are exactly `{ repository_full_name, issue_number, state: "closed", state_reason: "completed" }`. The comment connector uses `pr_number` for the Issue number. These remain `mutate`/`gated` actions and are audited as `routine-issue-comment` or `routine-issue-completed-close`; extra keys (including null), other states, required action gates, and other hosts stay gated.
|
|
172
|
+
|
|
171
173
|
```mermaid
|
|
172
174
|
flowchart LR
|
|
173
175
|
A["Exact PR update + actual arguments"] --> B{"Codex + title/body only<br/>+ no required Gate?"}
|
|
@@ -15,7 +15,7 @@ Statuses are intentionally explicit:
|
|
|
15
15
|
- `Unsupported`: official host documentation explicitly rules out the capability.
|
|
16
16
|
- `Unknown`: the capability or its current host behavior was not established.
|
|
17
17
|
|
|
18
|
-
Codex and OpenCode are `Partial` in `liveHostVerification`. The Codex artifact verifies user-hook compatibility capture for two consecutive turns on one Windows Codex CLI host; native plugin-hook mounting and other host/version combinations remain unverified. OpenCode's retained evidence supports project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS), not durable hard enforcement. No fresh artifacts exist yet for the other surfaces, managed-workspace import, or public OpenAI approval.
|
|
18
|
+
Codex, Antigravity (AGY), and OpenCode are `Partial` in `liveHostVerification`. The Codex artifact verifies user-hook compatibility capture for two consecutive turns on one Windows Codex CLI host; native plugin-hook mounting and other host/version combinations remain unverified. The AGY artifact covers global Desktop App `2.34.0` and `agy` CLI `1.5.15` (macOS) for plugin loading/validation and lifecycle hooks under host-limited `PostToolUse` shell outcomes; IDE write tools, live `exitCode: 0` shell verification credit, live `model_stop`, and full project-scope isolation remain unverified. OpenCode's retained evidence supports project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS), not durable hard enforcement. No fresh artifacts exist yet for the other surfaces, managed-workspace import, or public OpenAI approval.
|
|
19
19
|
|
|
20
20
|
### Codex PR metadata action-gate boundary
|
|
21
21
|
|
|
@@ -73,6 +73,7 @@ A shared matcher (`hooks/scripts/lib/ledger-match.js`) selects workspace ledger
|
|
|
73
73
|
| Platform surface | Standalone skills | Plugin support | Hooks/lifecycle | Project scope | Global scope | Current evidence boundary |
|
|
74
74
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
75
75
|
| Codex | `Supported` | `Mechanism verified` | `Partial`: user-hook compatibility capture is live-verified for `UserPromptSubmit` and `Stop` on one Windows Codex CLI host; native plugin hooks remain mechanism-verified | `.agents/skills/`, `AGENTS.md` | `~/.agents/skills/` | [Live evidence](../benchmarks/results/live-host/codex-2026-10-13/README.md) verifies two consecutive turns on Codex CLI 0.162.1; native plugin mounting, other lifecycle events, and other versions remain unverified. |
|
|
76
|
+
| Antigravity (AGY) | `Supported` | `Partial` (`Mechanism verified`; global Desktop App `2.34.0` load and `agy` CLI `1.5.15` `validate`/`list --json` live-verified on macOS; `validate --strict` fails on 2 multi-host warnings; temp `.agents/plugins/` hook discovery observed via `agy --print`) | `Partial`: `Mechanism verified` for all adapters; Desktop App `2.34.0` + CLI `1.5.15` (macOS) live-verified `SessionStart`, `PreInvocation` dedup, `PreToolUse` (`write_file`/`run_command`), `PostToolUse` edit tracking, and `Stop` (`NO_TOOL_CALL`); `PostToolUse` omits `exitCode`/`error` on shell non-zero exit (`1`) on both `2.34.0` and CLI `1.5.15`, so unknown shell outcomes grant no verification credit (`exitCode === 0` required); IDE write tools (`write_to_file`/`replace_file_content`/`multi_replace_file_content`) and live `model_stop` remain mechanism-only | `.agents/plugins/harness-everything/`, `.agents/rules/AGENTS.md` | `~/.gemini/config/plugins/harness-everything/` | [Mechanism evidence](../benchmarks/results/live-host/agy-2026-11-22/README.md) + [partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-23/README.md) (Antigravity 2.0 Desktop App `2.34.0` + `agy` CLI `1.5.15`, macOS); `/hooks` TUI view, full project-scope `harness-everything` isolation, IDE write tools, live shell `exitCode: 0` verification credit, and live `Stop` `model_stop` remain open in issue #514. |
|
|
76
77
|
| ChatGPT / OpenAI Plugin | `Unknown` for a repository-local standalone path | `Mechanism verified` | `Partial`: local Work/Codex hooks are separate from ordinary Chat | Managed workspace marketplace | Not established | The public Skills-only bundle is mechanically reproducible; import, approval, and live behavior remain `Unknown`. |
|
|
77
78
|
| Claude Code | `Supported` | `Supported` | `Mechanism verified` for Harness configuration | `.claude/skills/` | `~/.claude/skills/` | Native Claude surfaces and the state-specific plugin sync command are mechanically checked; fresh-host execution is not preserved here. |
|
|
78
79
|
| OpenCode | `Supported` | `Partial` live-host loading for the project-scope, `.js`-filename install path on OpenCode 1.18.31 (macOS); router injection and observation capture are mechanism-tested on V2 | `Partial` live-host evidence for project-scope `.js` loading and edit/verification state; new prompt/context hooks have mechanism evidence only | `.opencode/skills/`, `.agents/skills/`, `.opencode/plugins/` | `~/.config/opencode/skills/`, `~/.agents/skills/`, `~/.config/opencode/plugins/` | [Retained evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md): loading and state effects verified in one host session; final snapshot post-reset; hard lock only an interactive observation, with no retained blocked-tool trace, and a post-reset final snapshot; reflection operator-seeded, then agent-rewritten; no raw transcript or behavioral-effectiveness claim. `.mjs` auto-discovery broken (issue #127); global scope, npm-package installation, and other host versions remain unverified; V2 default-export load verified live on OpenCode 2.1.3 (macOS, 2026-10-23, server-log evidence only). A separate [OpenCode 2.1.4/macOS session workspace trace](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md) observed `ctx.session.get({sessionID})` returning `location.directory` for two sessions, both matching setup; it did not exercise a mismatch or fire the V2 hooks. Prompt/system injection and observation capture remain mechanism evidence only; no live-host behavior claim is made. |
|
|
@@ -101,6 +102,7 @@ The general installer’s target paths are tested independently from host discov
|
|
|
101
102
|
| Cursor | `.cursor/skills/` | `~/.agents/skills/` | Official Agent Skills compatibility path |
|
|
102
103
|
| GitHub Copilot agent surfaces | `.github/skills/` | `~/.agents/skills/` | Official project/global Agent Skills paths |
|
|
103
104
|
| Codex | `.agents/skills/` | `~/.agents/skills/` | Official Agent Skills paths; `AGENTS.md` is separate instruction context |
|
|
105
|
+
| Antigravity (AGY) | `.agents/plugins/harness-everything/` | `~/.gemini/config/plugins/harness-everything/` | Native Customization System plugin path and lifecycle hooks |
|
|
104
106
|
| Continue.dev | `.continue/skills/` | `~/.continue/skills/` | Installer adapter candidate; host discovery is `Unknown` from reviewed official docs |
|
|
105
107
|
| Hermes Agent | `.agents/skills/` | `~/.hermes/skills/` | Project loading is subject to Hermes trust |
|
|
106
108
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "harness-platform-compatibility-v1",
|
|
3
|
-
"last_reviewed": "2026-
|
|
3
|
+
"last_reviewed": "2026-11-23",
|
|
4
4
|
"status_vocabulary": {
|
|
5
5
|
"Supported": "An official or native mechanism exists and the Harness behavior is verified.",
|
|
6
6
|
"Mechanism verified": "Harness package, adapter, or installer checks pass, but a real host run is not confirmed.",
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"project": ".agents/skills",
|
|
62
62
|
"global": "~/.hermes/skills",
|
|
63
63
|
"host_discovery_status": "Supported"
|
|
64
|
+
},
|
|
65
|
+
"agy": {
|
|
66
|
+
"project": ".agents/plugins/harness-everything",
|
|
67
|
+
"global": "~/.gemini/config/plugins/harness-everything",
|
|
68
|
+
"host_discovery_status": "Partial"
|
|
64
69
|
}
|
|
65
70
|
},
|
|
66
71
|
"action_gate": {
|
|
@@ -87,6 +92,12 @@
|
|
|
87
92
|
"fallback": "exit-2-block",
|
|
88
93
|
"notes": "Public skills-only distribution does not include local lifecycle hooks; local plugin hook semantics remain a separate host capability."
|
|
89
94
|
},
|
|
95
|
+
"agy": {
|
|
96
|
+
"ask_decision": "Unknown",
|
|
97
|
+
"permission_mode_matrix": "Unknown",
|
|
98
|
+
"fallback": "hook-deny",
|
|
99
|
+
"notes": "agy-pre-tool.js returns {\"decision\":\"deny\",\"reason\":\"...\"} for canonical Action Gate blocks (verified live for run_command force-push on Antigravity 2.0 Desktop App 2.34.0 macOS) and filesystem boundary violations."
|
|
100
|
+
},
|
|
90
101
|
"other": {
|
|
91
102
|
"ask_decision": "Unknown",
|
|
92
103
|
"permission_mode_matrix": "Unknown",
|
|
@@ -265,6 +276,28 @@
|
|
|
265
276
|
"updateSync": {"status": "Unknown", "notes": "Hermes bundled-skill update behavior is documented, but Harness source refresh is not live verified."},
|
|
266
277
|
"liveHostVerification": {"status": "Unknown", "notes": "No Hermes session artifact is committed."}
|
|
267
278
|
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"id": "agy",
|
|
282
|
+
"name": "Antigravity (AGY)",
|
|
283
|
+
"official_sources": [
|
|
284
|
+
"https://antigravity.google/docs/skills",
|
|
285
|
+
"https://antigravity.google/docs/plugins",
|
|
286
|
+
"https://antigravity.google/docs/hooks",
|
|
287
|
+
"https://antigravity.google/docs/rules"
|
|
288
|
+
],
|
|
289
|
+
"capabilities": {
|
|
290
|
+
"standaloneSkills": {"status": "Supported", "notes": "Harness bundles all 28 canonical skills in plugins/harness-everything/skills/ and syncs rules/AGENTS.md; standalone AGY skill-only targets are not separately registered in installer.js."},
|
|
291
|
+
"pluginSupport": {"status": "Partial", "paths": {"manifest": [".antigravity-plugin/plugin.json"], "project": [".agents/plugins/harness-everything"], "global": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Package parity is mechanism-verified; global Desktop App 2.34.0 (macOS) GetAllPlugins load and agy CLI 1.5.15 validate/list --json are live-verified (validate exits 0 with 2 multi-host warnings; --strict exits 1). Project-scope .agents/plugins/ hook discovery was observed on agy CLI 1.5.15 via a temporary probe plugin; full project-scope harness-everything isolation and Desktop App project scope remain unverified."},
|
|
292
|
+
"bundledSkills": {"status": "Mechanism verified", "paths": {"skills": ["plugins/harness-everything/skills/<name>/SKILL.md"]}, "notes": "Package checks verify all 28 canonical skills, and agy plugin validate --json (1.5.15) counted skills: 28; live invocation across all 28 skills remains unverified."},
|
|
293
|
+
"hooksLifecycle": {"status": "Partial", "notes": "Deterministic mechanism tests cover SessionStart, PreInvocation, PreToolUse, PostToolUse, and Stop. Desktop App 2.34.0 and CLI 1.5.15 (macOS) live-verified SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, and Stop (NO_TOOL_CALL). Host limits: PostToolUse omits exitCode and error on shell non-zero exit (1) on both Desktop 2.34.0 and CLI 1.5.15, so unknown shell outcomes grant no verification credit and preserve failed state (explicit exitCode === 0 required); IDE write tools (write_to_file, replace_file_content, multi_replace_file_content) and live Stop model_stop remain unverified."},
|
|
294
|
+
"projectScope": {"status": "Partial", "paths": {"plugins": [".agents/plugins/harness-everything"], "rules": [".agents/rules/AGENTS.md"]}, "notes": "agy CLI 1.5.15 plugin list --json only lists global plugins, while agy --print discovered and executed project-scope .agents/plugins/ hooks from a temporary probe plugin. Full project-scope harness-everything isolation without global install and Desktop App project-scope loading remain unverified."},
|
|
295
|
+
"globalScope": {"status": "Partial", "paths": {"plugins": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Global load and hook execution are live-verified on Antigravity 2.0 Desktop App 2.34.0 (macOS) and agy CLI 1.5.15 (agy plugin list --json); Windows, Linux, and other AGY versions remain unverified."},
|
|
296
|
+
"installUninstallSymmetry": {"status": "Mechanism verified", "notes": "scripts/plugin-sync.js --host agy install/update/dry-run and staged rollback are covered by mechanism tests and synced live to global scope; plugin-sync.js does not provide uninstall symmetry."},
|
|
297
|
+
"assetsReferences": {"status": "Mechanism verified", "notes": "Packaged skills, rules/AGENTS.md byte-for-byte parity, and packaged agy-*.js hook scripts are verified by ci/mechanism-agy-plugin-package.test.js."},
|
|
298
|
+
"updateSync": {"status": "Partial", "notes": "scripts/plugin-sync.js --host agy --json is mechanism-tested and was observed live updating ~/.gemini/config/plugins/harness-everything on macOS; other OSes and project-scope sync live behavior remain unverified."},
|
|
299
|
+
"liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/agy-2026-11-23/README.md", "notes": "Partial live-host evidence covers global Antigravity 2.0 Desktop App 2.34.0 (macOS) and agy CLI 1.5.15 (macOS): plugin validate/list, SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, Stop (NO_TOOL_CALL), and temporary project-scope hook discovery. IDE write tools, live shell exitCode: 0 verification credit, live Stop model_stop, full project-scope isolation, and non-macOS hosts remain unverified."}
|
|
300
|
+
}
|
|
268
301
|
}
|
|
269
302
|
]
|
|
270
303
|
}
|
|
@@ -112,10 +112,13 @@ function normalizeActionDescriptor(payload, options = {}) {
|
|
|
112
112
|
const tool = toolNameOf(payload);
|
|
113
113
|
const input = toolInputOf(payload);
|
|
114
114
|
const explicit = explicitActionDescriptor(payload);
|
|
115
|
-
const
|
|
116
|
-
const
|
|
115
|
+
const codex = detectHost(payload, options.host) === 'codex';
|
|
116
|
+
const codexPrUpdate = codex && isPullRequestUpdateTool(tool);
|
|
117
|
+
const codexIssueMutation = codex && isRoutineIssueTool(tool);
|
|
118
|
+
const protectedMcpMutation = codexPrUpdate || codexIssueMutation;
|
|
119
|
+
const toolFamily = inferToolFamily(tool, protectedMcpMutation ? null : explicit);
|
|
117
120
|
const inferred = inferStructuredAction(tool, explicit);
|
|
118
|
-
const action =
|
|
121
|
+
const action = protectedMcpMutation && !STRUCTURED_GATED_ACTIONS.has(inferred) ? 'mutate' : inferred;
|
|
119
122
|
const classification = STRUCTURED_GATED_ACTIONS.has(action)
|
|
120
123
|
? 'gated'
|
|
121
124
|
: (STRUCTURED_SAFE_ACTIONS.has(action) ? 'safe' : 'unknown');
|
|
@@ -146,6 +149,49 @@ function isPullRequestUpdateTool(name) {
|
|
|
146
149
|
return name.split('__').pop() === 'update_pull_request' || name === 'mcp__codex_apps__github_update_pull_request';
|
|
147
150
|
}
|
|
148
151
|
|
|
152
|
+
const ISSUE_COMMENT_TOOLS = new Set([
|
|
153
|
+
'mcp__codex_apps__github__add_comment_to_issue',
|
|
154
|
+
'mcp__codex_apps__github_add_comment_to_issue',
|
|
155
|
+
]);
|
|
156
|
+
const ISSUE_COMPLETED_CLOSE_TOOLS = new Set([
|
|
157
|
+
'mcp__codex_apps__github__update_issue',
|
|
158
|
+
'mcp__codex_apps__github_update_issue',
|
|
159
|
+
]);
|
|
160
|
+
// Both Issue exceptions require an owner/name repository selector; an ownerless
|
|
161
|
+
// name is uncertain and must keep the original gate.
|
|
162
|
+
const OWNER_REPO_SELECTOR = /^[^/\s]+\/[^/\s]+$/;
|
|
163
|
+
|
|
164
|
+
function isRoutineIssueTool(name) {
|
|
165
|
+
return ISSUE_COMMENT_TOOLS.has(name) || ISSUE_COMPLETED_CLOSE_TOOLS.has(name);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function hasExactKeys(input, expected) {
|
|
169
|
+
const keys = Object.keys(input);
|
|
170
|
+
return keys.length === expected.length && expected.every(key => Object.prototype.hasOwnProperty.call(input, key));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function isRoutineIssueComment(payload) {
|
|
174
|
+
const input = toolInputOf(payload);
|
|
175
|
+
return ISSUE_COMMENT_TOOLS.has(toolNameOf(payload))
|
|
176
|
+
&& input && typeof input === 'object' && !Array.isArray(input)
|
|
177
|
+
&& hasExactKeys(input, ['repo_full_name', 'pr_number', 'comment'])
|
|
178
|
+
&& typeof input.repo_full_name === 'string' && input.repo_full_name.trim() !== ''
|
|
179
|
+
&& OWNER_REPO_SELECTOR.test(input.repo_full_name)
|
|
180
|
+
&& Number.isSafeInteger(input.pr_number) && input.pr_number > 0
|
|
181
|
+
&& typeof input.comment === 'string' && input.comment.trim() !== '';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function isRoutineIssueCompletedClose(payload) {
|
|
185
|
+
const input = toolInputOf(payload);
|
|
186
|
+
return ISSUE_COMPLETED_CLOSE_TOOLS.has(toolNameOf(payload))
|
|
187
|
+
&& input && typeof input === 'object' && !Array.isArray(input)
|
|
188
|
+
&& hasExactKeys(input, ['repository_full_name', 'issue_number', 'state', 'state_reason'])
|
|
189
|
+
&& typeof input.repository_full_name === 'string' && input.repository_full_name.trim() !== ''
|
|
190
|
+
&& OWNER_REPO_SELECTOR.test(input.repository_full_name)
|
|
191
|
+
&& Number.isSafeInteger(input.issue_number) && input.issue_number > 0
|
|
192
|
+
&& input.state === 'closed' && input.state_reason === 'completed';
|
|
193
|
+
}
|
|
194
|
+
|
|
149
195
|
function isPullRequestMetadataUpdate(payload) {
|
|
150
196
|
if (!isPullRequestUpdateTool(toolNameOf(payload))) return false;
|
|
151
197
|
const input = toolInputOf(payload);
|
|
@@ -173,6 +219,26 @@ function structuredRule(payload, options = {}) {
|
|
|
173
219
|
&& isPullRequestMetadataUpdate(payload) && !(hint && hint.required)) {
|
|
174
220
|
return { descriptor, rule: null, hostDeferred: true };
|
|
175
221
|
}
|
|
222
|
+
if (detectHost(payload, options.host) === 'codex' && descriptor.action === 'mutate'
|
|
223
|
+
&& isRoutineIssueComment(payload) && !(hint && hint.required)) {
|
|
224
|
+
return {
|
|
225
|
+
descriptor,
|
|
226
|
+
rule: null,
|
|
227
|
+
hostDeferred: true,
|
|
228
|
+
hostDeferredId: 'routine-issue-comment',
|
|
229
|
+
hostDeferredReason: 'Codex routine Issue comments defer to native task scope and permissions.',
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
if (detectHost(payload, options.host) === 'codex' && descriptor.action === 'mutate'
|
|
233
|
+
&& isRoutineIssueCompletedClose(payload) && !(hint && hint.required)) {
|
|
234
|
+
return {
|
|
235
|
+
descriptor,
|
|
236
|
+
rule: null,
|
|
237
|
+
hostDeferred: true,
|
|
238
|
+
hostDeferredId: 'routine-issue-completed-close',
|
|
239
|
+
hostDeferredReason: 'Codex routine Issue completed-close operations defer to native task scope and permissions.',
|
|
240
|
+
};
|
|
241
|
+
}
|
|
176
242
|
if (descriptor.classification === 'gated') {
|
|
177
243
|
return {
|
|
178
244
|
descriptor,
|
|
@@ -495,8 +561,8 @@ function evaluatePreToolUse(payload, options = {}) {
|
|
|
495
561
|
|
|
496
562
|
if (!rule) {
|
|
497
563
|
const record = structured.hostDeferred ? recordDecision(payload, {
|
|
498
|
-
id: 'routine-pr-metadata-update',
|
|
499
|
-
reason: 'Codex PR title/body metadata update defers to native task scope and permissions.',
|
|
564
|
+
id: structured.hostDeferredId || 'routine-pr-metadata-update',
|
|
565
|
+
reason: structured.hostDeferredReason || 'Codex PR title/body metadata update defers to native task scope and permissions.',
|
|
500
566
|
}, table, host, 'deferred-to-host', { ...options, sessionDir: context.sessionDir }) : null;
|
|
501
567
|
return {
|
|
502
568
|
kind: 'allow',
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Antigravity (AGY) PostToolUse Hook Adapter
|
|
6
|
+
*
|
|
7
|
+
* Captures tool outcomes, tracks execution errors and file edits for state persistence.
|
|
8
|
+
* Bridges AGY tool execution to Harness session state (handoff-state.json).
|
|
9
|
+
* Returns empty JSON object `{}` on stdout as required by AGY protocol.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const { spawnSync } = require('child_process');
|
|
14
|
+
const {
|
|
15
|
+
readJsonStdin,
|
|
16
|
+
getAgySessionId,
|
|
17
|
+
getAgyEffectiveCwd
|
|
18
|
+
} = require('./lib/agy-adapter-core');
|
|
19
|
+
|
|
20
|
+
const FILE_MUTATION_TOOLS = new Set([
|
|
21
|
+
'write_file',
|
|
22
|
+
'write_to_file',
|
|
23
|
+
'edit_file',
|
|
24
|
+
'replace_file_content',
|
|
25
|
+
'multi_replace_file_content'
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
function mapAgyPayloadToStatePersist(payload) {
|
|
29
|
+
const safePayload = payload && typeof payload === 'object' ? payload : {};
|
|
30
|
+
const sessionId = getAgySessionId(safePayload);
|
|
31
|
+
const workspaceCwd = getAgyEffectiveCwd(safePayload);
|
|
32
|
+
const toolCall = (safePayload.toolCall && typeof safePayload.toolCall === 'object') ? safePayload.toolCall : {};
|
|
33
|
+
const rawToolName = toolCall.name || safePayload.tool_name || safePayload.toolName || safePayload.tool || '';
|
|
34
|
+
const args = (toolCall.args && typeof toolCall.args === 'object')
|
|
35
|
+
? toolCall.args
|
|
36
|
+
: ((safePayload.tool_input && typeof safePayload.tool_input === 'object') ? safePayload.tool_input : {});
|
|
37
|
+
|
|
38
|
+
let toolName = rawToolName;
|
|
39
|
+
let toolInput = { ...args };
|
|
40
|
+
let effectiveCwd = workspaceCwd;
|
|
41
|
+
|
|
42
|
+
if (rawToolName === 'run_command') {
|
|
43
|
+
toolName = 'Bash';
|
|
44
|
+
const command = String(args.CommandLine || args.command || '').trim();
|
|
45
|
+
const commandCwd = (typeof args.Cwd === 'string' && args.Cwd.trim())
|
|
46
|
+
|| (typeof args.cwd === 'string' && args.cwd.trim())
|
|
47
|
+
|| workspaceCwd;
|
|
48
|
+
effectiveCwd = commandCwd;
|
|
49
|
+
toolInput = {
|
|
50
|
+
command,
|
|
51
|
+
...(commandCwd ? { cwd: commandCwd } : {})
|
|
52
|
+
};
|
|
53
|
+
} else if (FILE_MUTATION_TOOLS.has(rawToolName)) {
|
|
54
|
+
toolName = 'Write';
|
|
55
|
+
const filePath = args.TargetFile || args.Path || args.path || args.targetFile || args.filePath || args.file_path || '';
|
|
56
|
+
toolInput = { ...args, file_path: filePath };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const toolResponse = safePayload.toolResponse || safePayload.tool_response || safePayload.result || {};
|
|
60
|
+
const rawError = safePayload.error || toolResponse.error || '';
|
|
61
|
+
const error = typeof rawError === 'string' ? rawError : (rawError ? JSON.stringify(rawError) : '');
|
|
62
|
+
const stdout = toolResponse.stdout || (typeof safePayload.output === 'string' ? safePayload.output : '') || '';
|
|
63
|
+
const stderr = toolResponse.stderr || (typeof error === 'string' ? error : '') || '';
|
|
64
|
+
|
|
65
|
+
const rawExitCodes = [
|
|
66
|
+
safePayload.exitCode,
|
|
67
|
+
safePayload.exit_code,
|
|
68
|
+
toolResponse.exitCode,
|
|
69
|
+
toolResponse.exit_code
|
|
70
|
+
].filter(Number.isInteger);
|
|
71
|
+
const exitCode = rawExitCodes.find(code => code !== 0) ?? rawExitCodes[0];
|
|
72
|
+
|
|
73
|
+
const isFailed = Boolean(error && error.trim()) || (exitCode !== undefined && exitCode !== 0);
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
hook_event_name: isFailed ? 'PostToolUseFailure' : 'PostToolUse',
|
|
77
|
+
session_id: sessionId,
|
|
78
|
+
sessionId: sessionId,
|
|
79
|
+
conversationId: sessionId,
|
|
80
|
+
cwd: effectiveCwd,
|
|
81
|
+
workspace_root: workspaceCwd,
|
|
82
|
+
workspacePaths: (Array.isArray(safePayload.workspacePaths) && safePayload.workspacePaths.length > 0)
|
|
83
|
+
? safePayload.workspacePaths
|
|
84
|
+
: [workspaceCwd],
|
|
85
|
+
tool_name: toolName,
|
|
86
|
+
tool_input: toolInput,
|
|
87
|
+
tool_response: {
|
|
88
|
+
stdout,
|
|
89
|
+
stderr,
|
|
90
|
+
...(exitCode !== undefined ? { exitCode } : {})
|
|
91
|
+
},
|
|
92
|
+
error: isFailed ? (error || stderr || `Command exited with code ${exitCode}`) : '',
|
|
93
|
+
...(exitCode !== undefined ? { exitCode } : {})
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function main() {
|
|
98
|
+
const payload = await readJsonStdin();
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
const mapped = mapAgyPayloadToStatePersist(payload);
|
|
102
|
+
const statePersistScript = path.join(__dirname, 'state-persist.js');
|
|
103
|
+
spawnSync(process.execPath, [statePersistScript, '--agy'], {
|
|
104
|
+
input: JSON.stringify(mapped),
|
|
105
|
+
encoding: 'utf8',
|
|
106
|
+
env: process.env,
|
|
107
|
+
timeout: 10000
|
|
108
|
+
});
|
|
109
|
+
} catch (err) {
|
|
110
|
+
if (process.env.HARNESS_DEBUG) {
|
|
111
|
+
console.error('[AGY-PostToolUse] State persistence error:', err);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
process.stdout.write('{}\n');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (require.main === module) {
|
|
119
|
+
main().catch(() => {
|
|
120
|
+
process.stdout.write('{}\n');
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
module.exports = { main, mapAgyPayloadToStatePersist };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Antigravity (AGY) PreInvocation Hook Adapter
|
|
6
|
+
*
|
|
7
|
+
* Runs before model invocation. Invokes the Harness kernel router and ledger lessons
|
|
8
|
+
* ONCE per user turn (deduplicated across tool-call roundtrips within a turn), then
|
|
9
|
+
* returns systemMessage injectSteps in AGY's required protojson format.
|
|
10
|
+
* Bridges AGY conversationId to session_id for workflow persistence.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const crypto = require('crypto');
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const { spawnSync } = require('child_process');
|
|
17
|
+
const {
|
|
18
|
+
readJsonStdin,
|
|
19
|
+
resolveKernelRouter,
|
|
20
|
+
getAgySessionId,
|
|
21
|
+
getAgyEffectiveCwd,
|
|
22
|
+
normalizeAgyStatePayload
|
|
23
|
+
} = require('./lib/agy-adapter-core');
|
|
24
|
+
const { getWorkspaceRoot, getSessionDir } = require('./lib/harness-state');
|
|
25
|
+
|
|
26
|
+
const DEDUP_STATE_FILE = 'agy-pre-invocation-state.json';
|
|
27
|
+
|
|
28
|
+
function hashUserInput(text) {
|
|
29
|
+
return crypto.createHash('sha256').update(String(text || ''), 'utf8').digest('hex').slice(0, 16);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function readDedupState(filePath) {
|
|
33
|
+
try {
|
|
34
|
+
if (!fs.existsSync(filePath)) return null;
|
|
35
|
+
const parsed = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
36
|
+
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
37
|
+
} catch (_) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function writeDedupState(filePath, state) {
|
|
43
|
+
try {
|
|
44
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
45
|
+
const temp = `${filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
46
|
+
fs.writeFileSync(temp, JSON.stringify(state, null, 2) + '\n', 'utf8');
|
|
47
|
+
fs.renameSync(temp, filePath);
|
|
48
|
+
} catch (_) {
|
|
49
|
+
// Best-effort marker write; never fail invocation on state IO.
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function shouldSkipInjection(payload, userInput, dedupFile) {
|
|
54
|
+
const hasInvNum = payload && payload.invocationNum !== undefined && payload.invocationNum !== null && payload.invocationNum !== '';
|
|
55
|
+
const invNum = hasInvNum ? Number(payload.invocationNum) : 0;
|
|
56
|
+
const hasInitialSteps = payload && payload.initialNumSteps !== undefined && payload.initialNumSteps !== null && payload.initialNumSteps !== '';
|
|
57
|
+
const inputHash = hashUserInput(userInput);
|
|
58
|
+
const turnKey = hasInitialSteps
|
|
59
|
+
? `step:${payload.initialNumSteps}:${inputHash}`
|
|
60
|
+
: `input:${inputHash}`;
|
|
61
|
+
|
|
62
|
+
if (!dedupFile) {
|
|
63
|
+
return {
|
|
64
|
+
skip: Number.isFinite(invNum) && invNum > 0,
|
|
65
|
+
turnKey,
|
|
66
|
+
invNum: Number.isFinite(invNum) ? invNum : 0,
|
|
67
|
+
base: 0
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const saved = readDedupState(dedupFile);
|
|
72
|
+
const sameTurn = Boolean(saved && saved.turnKey === turnKey);
|
|
73
|
+
|
|
74
|
+
if (sameTurn) {
|
|
75
|
+
// When initialNumSteps is absent and a host explicitly sends invocationNum: 0
|
|
76
|
+
// (or restarts at 0 after a previous positive invocation), treat it as a new turn.
|
|
77
|
+
if (!hasInitialSteps && (saved.sawPositiveInvocation || hasInvNum) && Number.isFinite(invNum) && invNum === 0) {
|
|
78
|
+
return { skip: false, turnKey, invNum: 0, base: 0 };
|
|
79
|
+
}
|
|
80
|
+
if (Number.isFinite(invNum) && invNum > 0 && !saved.sawPositiveInvocation) {
|
|
81
|
+
writeDedupState(dedupFile, { ...saved, sawPositiveInvocation: true, updatedAt: new Date().toISOString() });
|
|
82
|
+
}
|
|
83
|
+
return { skip: true, turnKey, invNum: Number.isFinite(invNum) ? invNum : 0, base: saved.base || 0 };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Not the same turnKey: guard against mid-turn calls (both 0-based and 1-based).
|
|
87
|
+
if (Number.isFinite(invNum) && invNum > 1) {
|
|
88
|
+
return { skip: true, turnKey, invNum, base: (saved && saved.base) || 0 };
|
|
89
|
+
}
|
|
90
|
+
if (Number.isFinite(invNum) && invNum === 1 && (!hasInitialSteps || (saved && saved.base === 0))) {
|
|
91
|
+
return { skip: true, turnKey, invNum, base: 0 };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const base = Number.isFinite(invNum) && invNum === 1 ? 1 : 0;
|
|
95
|
+
return { skip: false, turnKey, invNum: Number.isFinite(invNum) ? invNum : 0, base };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function main() {
|
|
99
|
+
const payload = await readJsonStdin();
|
|
100
|
+
const userInput = payload.lastUserInput || payload.prompt || '';
|
|
101
|
+
const routerScript = resolveKernelRouter();
|
|
102
|
+
|
|
103
|
+
if (!routerScript || !String(userInput).trim()) {
|
|
104
|
+
process.stdout.write(JSON.stringify({ injectSteps: [] }) + '\n');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const sessionId = getAgySessionId(payload);
|
|
109
|
+
const effectiveCwd = getAgyEffectiveCwd(payload);
|
|
110
|
+
const normalizedPayload = normalizeAgyStatePayload(payload, effectiveCwd);
|
|
111
|
+
|
|
112
|
+
let dedupFile = null;
|
|
113
|
+
if (sessionId) {
|
|
114
|
+
try {
|
|
115
|
+
const root = getWorkspaceRoot(normalizedPayload) || effectiveCwd;
|
|
116
|
+
const sessionDir = getSessionDir(root, sessionId);
|
|
117
|
+
dedupFile = path.join(sessionDir, DEDUP_STATE_FILE);
|
|
118
|
+
} catch (_) {
|
|
119
|
+
dedupFile = null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const dedup = shouldSkipInjection(payload, userInput, dedupFile);
|
|
124
|
+
if (dedup.skip) {
|
|
125
|
+
process.stdout.write(JSON.stringify({ injectSteps: [] }) + '\n');
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
const routerInput = {
|
|
131
|
+
hook_event_name: 'UserPromptSubmit',
|
|
132
|
+
prompt: userInput,
|
|
133
|
+
lastUserInput: userInput,
|
|
134
|
+
cwd: effectiveCwd,
|
|
135
|
+
conversationId: sessionId,
|
|
136
|
+
session_id: sessionId,
|
|
137
|
+
sessionId: sessionId,
|
|
138
|
+
...(payload.workspacePaths ? { workspacePaths: payload.workspacePaths } : {})
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const run = spawnSync(process.execPath, [routerScript], {
|
|
142
|
+
input: JSON.stringify(routerInput),
|
|
143
|
+
encoding: 'utf8',
|
|
144
|
+
env: process.env,
|
|
145
|
+
timeout: 20000
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const context = String(run.stdout || '').trim();
|
|
149
|
+
if (context) {
|
|
150
|
+
if (dedupFile) {
|
|
151
|
+
writeDedupState(dedupFile, {
|
|
152
|
+
turnKey: dedup.turnKey,
|
|
153
|
+
base: dedup.base,
|
|
154
|
+
sawPositiveInvocation: dedup.invNum > 0,
|
|
155
|
+
updatedAt: new Date().toISOString()
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const response = {
|
|
159
|
+
injectSteps: [
|
|
160
|
+
{
|
|
161
|
+
systemMessage: {
|
|
162
|
+
systemMessage: context
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
};
|
|
167
|
+
process.stdout.write(JSON.stringify(response) + '\n');
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
} catch (err) {
|
|
171
|
+
if (process.env.HARNESS_DEBUG) {
|
|
172
|
+
console.error('[AGY-PreInvocation] Routing error:', err);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
process.stdout.write(JSON.stringify({ injectSteps: [] }) + '\n');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (require.main === module) {
|
|
180
|
+
main().catch(() => {
|
|
181
|
+
process.stdout.write(JSON.stringify({ injectSteps: [] }) + '\n');
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
module.exports = { main, shouldSkipInjection };
|