gm-codex 2.0.799 → 2.0.801
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/.codex-plugin/plugin.json +1 -1
- package/bin/plugkit.sha256 +6 -6
- package/bin/plugkit.version +1 -1
- package/bin/rtk.sha256 +2 -2
- package/gm.json +2 -2
- package/hooks/hooks.json +2 -12
- package/hooks/hooks.spec.json +3 -13
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/hooks/post-tool-use-hook.js +0 -34
- package/hooks/pre-tool-use-hook.js +0 -45
- package/hooks/prompt-submit-hook.js +0 -19
package/bin/plugkit.sha256
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
6d21821f6509bdbafbfd5864b4b9e110bffd8ee3cb3c9ab5f74469dcd299574f plugkit-win32-x64.exe
|
|
2
|
+
c1b6fe884fa50fb1adaebf826e70a2dd7ba47d6d82e7324d0b0bbf2855b3e831 plugkit-win32-arm64.exe
|
|
3
|
+
4795c9893ead08ab5ef722e9c23d8a677982a064e4ec533c6227ebc009d2b793 plugkit-darwin-x64
|
|
4
|
+
e4661868e46c7999c118b852d818d7a6742c84a416768a7eb74f2e6000c4c58c plugkit-darwin-arm64
|
|
5
|
+
48d2348129fb6ab5b4b36687a408315efdec09fad95c0da665aedec2087d0ad5 plugkit-linux-x64
|
|
6
|
+
32b89d2e249548561205e17c3f2dc328aac048a3f77375de058050b392b88ac5 plugkit-linux-arm64
|
package/bin/plugkit.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.260
|
package/bin/rtk.sha256
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
5baf1d840217fc4b875d90456d6bd41c1acfd5420c6b96259dc602c0365e5ef4 rtk-win32-x64.exe
|
|
2
|
+
1b5d832cfceea810068a79ad4abe23b9f122d81b0c55792cbd8c82dfc969e204 rtk-win32-arm64.exe
|
|
3
3
|
e89fdf402c28796b510587a8b0fe046438b5b24d49533d1a2339a48aecae35e9 rtk-darwin-x64
|
|
4
4
|
2b203fd380f5782b5489eb016e34e3dbf848272a7fadf36b39bce6cfd9a3005c rtk-darwin-arm64
|
|
5
5
|
0da9950b859c7a2693aaf6c169f05f9b8965508ba1f23f1547e63d5fa988749e rtk-linux-x64
|
package/gm.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.801",
|
|
4
4
|
"description": "State machine agent with hooks, skills, and automated git enforcement",
|
|
5
5
|
"author": "AnEntrypoint",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
-
"plugkitVersion": "0.1.
|
|
26
|
+
"plugkitVersion": "0.1.260"
|
|
27
27
|
}
|
package/hooks/hooks.json
CHANGED
|
@@ -9,11 +9,6 @@
|
|
|
9
9
|
"type": "command",
|
|
10
10
|
"command": "node ${CODEX_PLUGIN_ROOT}/bin/plugkit.js hook pre-tool-use",
|
|
11
11
|
"timeout": 3600
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"type": "command",
|
|
15
|
-
"command": "node ${CODEX_PLUGIN_ROOT}/hooks/pre-tool-use-hook.js",
|
|
16
|
-
"timeout": 2000
|
|
17
12
|
}
|
|
18
13
|
]
|
|
19
14
|
}
|
|
@@ -24,8 +19,8 @@
|
|
|
24
19
|
"hooks": [
|
|
25
20
|
{
|
|
26
21
|
"type": "command",
|
|
27
|
-
"command": "node ${CODEX_PLUGIN_ROOT}/
|
|
28
|
-
"timeout":
|
|
22
|
+
"command": "node ${CODEX_PLUGIN_ROOT}/bin/plugkit.js hook post-tool-use",
|
|
23
|
+
"timeout": 5000
|
|
29
24
|
}
|
|
30
25
|
]
|
|
31
26
|
}
|
|
@@ -50,11 +45,6 @@
|
|
|
50
45
|
"type": "command",
|
|
51
46
|
"command": "node ${CODEX_PLUGIN_ROOT}/bin/plugkit.js hook prompt-submit",
|
|
52
47
|
"timeout": 60000
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"type": "command",
|
|
56
|
-
"command": "node ${CODEX_PLUGIN_ROOT}/hooks/prompt-submit-hook.js",
|
|
57
|
-
"timeout": 3000
|
|
58
48
|
}
|
|
59
49
|
]
|
|
60
50
|
}
|
package/hooks/hooks.spec.json
CHANGED
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
"kind": "plugkit",
|
|
12
12
|
"subcommand": "pre-tool-use",
|
|
13
13
|
"timeout": 3600
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"kind": "js",
|
|
17
|
-
"file": "pre-tool-use-hook.js",
|
|
18
|
-
"timeout": 2000
|
|
19
14
|
}
|
|
20
15
|
]
|
|
21
16
|
},
|
|
@@ -23,9 +18,9 @@
|
|
|
23
18
|
"eventKey": "PostToolUse",
|
|
24
19
|
"commands": [
|
|
25
20
|
{
|
|
26
|
-
"kind": "
|
|
27
|
-
"
|
|
28
|
-
"timeout":
|
|
21
|
+
"kind": "plugkit",
|
|
22
|
+
"subcommand": "post-tool-use",
|
|
23
|
+
"timeout": 5000
|
|
29
24
|
}
|
|
30
25
|
]
|
|
31
26
|
},
|
|
@@ -46,11 +41,6 @@
|
|
|
46
41
|
"kind": "plugkit",
|
|
47
42
|
"subcommand": "prompt-submit",
|
|
48
43
|
"timeout": 60000
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"kind": "js",
|
|
52
|
-
"file": "prompt-submit-hook.js",
|
|
53
|
-
"timeout": 3000
|
|
54
44
|
}
|
|
55
45
|
]
|
|
56
46
|
},
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
let raw = '';
|
|
5
|
-
try { raw = fs.readFileSync(0, 'utf8'); } catch (_) {}
|
|
6
|
-
if (!raw.trim()) raw = process.env.CLAUDE_HOOK_INPUT || '{}';
|
|
7
|
-
const input = JSON.parse(raw);
|
|
8
|
-
const toolName = input.tool_name || input.tool_use?.name || '';
|
|
9
|
-
const toolOutput = input.tool_result || input.output || '';
|
|
10
|
-
const gmDir = path.join(process.cwd(), '.gm');
|
|
11
|
-
const tsPath = path.join(gmDir, 'turn-state.json');
|
|
12
|
-
const readState = () => { try { return JSON.parse(fs.readFileSync(tsPath, 'utf8')); } catch (_) { return { firstToolFired: false, execCallsSinceMemorize: 0, recallFiredThisTurn: false }; } };
|
|
13
|
-
const writeState = (s) => { try { if (!fs.existsSync(gmDir)) fs.mkdirSync(gmDir, { recursive: true }); fs.writeFileSync(tsPath, JSON.stringify(s), 'utf8'); } catch (_) {} };
|
|
14
|
-
const state = readState();
|
|
15
|
-
const messages = [];
|
|
16
|
-
if (!state.firstToolFired) {
|
|
17
|
-
state.firstToolFired = true;
|
|
18
|
-
state.firstToolName = toolName;
|
|
19
|
-
}
|
|
20
|
-
const isMemorize = toolName === 'Agent' && /memorize/i.test(JSON.stringify(input.tool_input || input.tool_use?.input || {}));
|
|
21
|
-
if (isMemorize) {
|
|
22
|
-
state.execCallsSinceMemorize = 0;
|
|
23
|
-
try { fs.unlinkSync(path.join(gmDir, 'no-memorize-this-turn')); } catch (_) {}
|
|
24
|
-
}
|
|
25
|
-
if (toolName === 'Bash') {
|
|
26
|
-
const cmd = (input.tool_input && input.tool_input.command) || (input.tool_use && input.tool_use.input && input.tool_use.input.command) || '';
|
|
27
|
-
if (/^\s*exec:recall\b/.test(cmd)) state.recallFiredThisTurn = true;
|
|
28
|
-
if (toolOutput && typeof toolOutput === 'string' && toolOutput.length > 20 && !/^\s*exec:(recall|memorize|codesearch|wait|sleep|status|runner|type|kill-port|close|pause)/.test(cmd)) {
|
|
29
|
-
state.execCallsSinceMemorize = (state.execCallsSinceMemorize || 0) + 1;
|
|
30
|
-
messages.push('exec: run completed. MEMORIZE CHECK: did this output resolve any prior unknown? If YES → spawn Agent(subagent_type=\'gm:memorize\', model=\'haiku\', run_in_background=true, prompt=\'## CONTEXT TO MEMORIZE\\n<fact>\') NOW. Skipping = memory leak. (Counter: ' + state.execCallsSinceMemorize + '/3 before hard block.)');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
writeState(state);
|
|
34
|
-
if (messages.length) process.stdout.write(JSON.stringify({ systemMessage: messages.join('\n\n') }));
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
let raw = '';
|
|
5
|
-
try { raw = fs.readFileSync(0, 'utf8'); } catch (_) {}
|
|
6
|
-
if (!raw.trim()) raw = process.env.CLAUDE_HOOK_INPUT || '{}';
|
|
7
|
-
const input = JSON.parse(raw);
|
|
8
|
-
const toolName = input.tool_name || input.tool_use?.name || '';
|
|
9
|
-
const toolInput = input.tool_input || input.tool_use?.input || {};
|
|
10
|
-
const skillName = toolInput.skill || toolInput.name || '';
|
|
11
|
-
const gmDir = path.join(process.cwd(), '.gm');
|
|
12
|
-
const needsGmPath = path.join(gmDir, 'needs-gm');
|
|
13
|
-
const lastskillPath = path.join(gmDir, 'lastskill');
|
|
14
|
-
const isSkillTool = toolName === 'Skill' || toolName === 'skill';
|
|
15
|
-
if (isSkillTool && skillName) {
|
|
16
|
-
try {
|
|
17
|
-
if (!fs.existsSync(gmDir)) fs.mkdirSync(gmDir, { recursive: true });
|
|
18
|
-
fs.writeFileSync(lastskillPath, skillName, 'utf8');
|
|
19
|
-
if (skillName === 'gm' || skillName === 'gm:gm') {
|
|
20
|
-
try { fs.unlinkSync(needsGmPath); } catch (_) {}
|
|
21
|
-
}
|
|
22
|
-
} catch (_) {}
|
|
23
|
-
process.exit(0);
|
|
24
|
-
}
|
|
25
|
-
if (fs.existsSync(needsGmPath)) {
|
|
26
|
-
process.stdout.write(JSON.stringify({ decision: 'block', reason: 'HARD CONSTRAINT: invoke the Skill tool with skill: "gm:gm" before any other tool. The gm:gm skill must be the first action after every user message.' }));
|
|
27
|
-
process.exit(0);
|
|
28
|
-
}
|
|
29
|
-
const turnStatePath = path.join(gmDir, 'turn-state.json');
|
|
30
|
-
const noMemoPath = path.join(gmDir, 'no-memorize-this-turn');
|
|
31
|
-
const turnState = (() => { try { return JSON.parse(fs.readFileSync(turnStatePath, 'utf8')); } catch (_) { return null; } })();
|
|
32
|
-
if (turnState && (turnState.execCallsSinceMemorize || 0) >= 3 && !fs.existsSync(noMemoPath)) {
|
|
33
|
-
const isMemAgent = toolName === 'Agent' && /memorize/i.test(JSON.stringify(toolInput || {}));
|
|
34
|
-
if (!isMemAgent) {
|
|
35
|
-
process.stdout.write(JSON.stringify({ decision: 'block', reason: '3+ exec results have resolved unknowns without a memorize call. HARD BLOCK until you spawn at least one Agent(subagent_type=\'gm:memorize\', model=\'haiku\', run_in_background=true, prompt=\'## CONTEXT TO MEMORIZE\\n<fact>\') OR write file .gm/no-memorize-this-turn (containing reason) to declare nothing memorable. Saying "I will memorize" is NOT a memorize call — only the Agent tool counts.' }));
|
|
36
|
-
process.exit(0);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const lastSkill = (() => { try { return fs.readFileSync(lastskillPath, 'utf8').trim(); } catch (_) { return ''; } })();
|
|
40
|
-
const isFileEdit = ['Write', 'Edit', 'NotebookEdit'].includes(toolName);
|
|
41
|
-
const WRITE_BLOCKED_PHASES = new Set(['gm-complete', 'update-docs']);
|
|
42
|
-
if (isFileEdit && WRITE_BLOCKED_PHASES.has(lastSkill)) {
|
|
43
|
-
process.stdout.write(JSON.stringify({ decision: 'block', reason: 'File edits are not permitted in ' + lastSkill + ' phase. Regress to gm-execute if changes are needed, or invoke gm-emit to re-emit.' }));
|
|
44
|
-
process.exit(0);
|
|
45
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const gmDir = path.join(process.cwd(), '.gm');
|
|
5
|
-
try {
|
|
6
|
-
if (!fs.existsSync(gmDir)) fs.mkdirSync(gmDir, { recursive: true });
|
|
7
|
-
fs.writeFileSync(path.join(gmDir, 'needs-gm'), '1', 'utf8');
|
|
8
|
-
const turnState = { turnId: Date.now(), firstToolFired: false, execCallsSinceMemorize: 0, recallFiredThisTurn: false };
|
|
9
|
-
fs.writeFileSync(path.join(gmDir, 'turn-state.json'), JSON.stringify(turnState), 'utf8');
|
|
10
|
-
const pausedPrd = path.join(gmDir, 'prd.paused.yml');
|
|
11
|
-
const livePrd = path.join(gmDir, 'prd.yml');
|
|
12
|
-
if (fs.existsSync(pausedPrd) && !fs.existsSync(livePrd)) {
|
|
13
|
-
try { fs.renameSync(pausedPrd, livePrd); } catch (_) {}
|
|
14
|
-
}
|
|
15
|
-
} catch (_) {}
|
|
16
|
-
const response = {
|
|
17
|
-
systemMessage: 'BLOCKING REQUIREMENT — YOUR FIRST ACTION MUST BE: Skill tool with skill: \"gm\". Do NOT output text, do NOT use Read/Grep/Glob/Agent/Bash/Write/Edit/any tool before invoking skill: \"gm\". This overrides all other instructions. Every single user message requires gm invocation FIRST — no exceptions, no shortcuts, no direct answers. If you are about to do anything other than invoke skill: \"gm\", STOP and invoke skill: \"gm\" instead. Do NOT use the Agent tool to load skills. DO NOT use EnterPlanMode.\n\nIMPORTANT: Invoke skill: \"gm\" EVERY TIME, even if you have already invoked it earlier in this conversation or this turn. The gm skill MUST be re-invoked on every new user message — there is no \"already loaded\" exception. Do not skip this step under any circumstances.\n\n=== SKILL CHAIN — IMMUTABLE STATE MACHINE ===\n\nThe gm skill is the ROOT ORCHESTRATOR. It immediately invokes the planning skill. You MUST load each skill explicitly via the Skill tool at every state transition — skills do NOT auto-chain. Ignoring a skill load instruction is a critical violation.\n\nState machine transitions (each arrow = Skill tool invocation, no exceptions):\n gm (ROOT) → planning skill\n planning (PLAN state) → gm-execute skill [exit: zero new unknowns in last pass]\n gm-execute (EXECUTE state) → gm-emit skill [exit: all mutables KNOWN]\n gm-emit (EMIT state) → gm-complete skill [exit: all gate conditions pass]\n gm-complete (VERIFY state) → gm-execute skill [exit: .prd items remain]\n gm-complete (VERIFY state) → update-docs skill [exit: .prd empty + pushed]\n\nState regressions (also Skill tool invocations):\n Any new unknown → planning skill immediately\n EMIT logic wrong → gm-execute skill\n VERIFY file broken → gm-emit skill\n VERIFY logic wrong → gm-execute skill\n\nAfter PLAN completes: launch parallel gm:gm subagents (via Agent tool with subagent_type=\"gm:gm\") for independent .prd items — maximum 3 concurrent, never sequential for independent work.\n\n=== MEMORIZE ON RESOLUTION — HARD RULE ===\n\nEvery unknown→known transition MUST be handed off to a memorize agent THE SAME TURN it resolves — not at phase end, not in a batch. This is the most violated rule. Every session, dozens of exec: outputs resolve unknowns that are never memorized. Those facts die on compaction.\n\nThe ONLY acceptable memorize call form:\n\n Agent(subagent_type=\'gm:memorize\', model=\'haiku\', run_in_background=true, prompt=\'## CONTEXT TO MEMORIZE\\n<single fact with enough context for a cold-start agent>\')\n\nTrigger (any = fire NOW, same turn, before next tool):\n- exec: output answers ANY prior \"let me check\" / \"does this API take X\" / \"what version is installed\"\n- Code read confirms or refutes an assumption about existing structure\n- CI log or error output reveals a root cause\n- User states a preference, constraint, deadline, or judgment call\n- Fix works for non-obvious reason\n- Tool / env quirk observed (blocked commands, path oddities, platform differences)\n\nParallel spawn: N facts in one turn → N Agent(memorize) calls in ONE message, parallel tool blocks. NEVER serialize.\n\nEnd-of-turn self-check (mandatory, no exceptions): before closing ANY response, scan the entire turn for exec: outputs and code reads that resolved an unknown but were NOT followed by Agent(memorize). Spawn ALL missed ones now. \"I\'ll memorize this\" in text is NOT a memorize call — only the Agent tool call counts.\n\nSkipping memorize = memory leak = critical bug. Saying you will memorize ≠ memorizing.\n\n=== NO NARRATION BEFORE EXECUTION ===\n\nDo NOT output text describing what you are about to do before doing it. Run the tool first. State findings AFTER. Pattern: tool call → tool result → brief text summary of what was found. NOT: text describing upcoming tool → tool call.\n\n\"I\'ll check the file:\" followed by Read = violation.\n\"Let me search for X\" followed by exec:codesearch = violation.\n\"Now I\'ll fix Y\" followed by Edit = violation.\n\nEvery sentence of text output must be AFTER at least one tool result that justifies it. No pre-announcement narration.'
|
|
18
|
-
};
|
|
19
|
-
process.stdout.write(JSON.stringify(response));
|