gm-codex 2.0.798 → 2.0.800
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 +6 -0
- package/bin/rtk.version +1 -0
- 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
|
+
142fd0fd408b9eee594c407b7cb7ca028a56f5973d1f5a7ae0a23d53777c50e7 plugkit-win32-x64.exe
|
|
2
|
+
250fd4917801bd6e269dfb0b936bc42048738dbf6cf2d8e2121f959ac84d33e3 plugkit-win32-arm64.exe
|
|
3
|
+
566e01efb8663828fed8e66c03015011ea0f715e36be0cd407bd029c104ad369 plugkit-darwin-x64
|
|
4
|
+
a5c516bd6a1be23cc0dc8e7f5d8c16c5a80930fcc1040c56fd85a7063c550a86 plugkit-darwin-arm64
|
|
5
|
+
1a9697bfca3a07614da5080828c26268905a84e7fe09003d5fc738f18cbe10bd plugkit-linux-x64
|
|
6
|
+
c6a3bff26e9d039c1abba8ab2218d22b25195e8f5efd55023fd8bb5e8516d0e8 plugkit-linux-arm64
|
package/bin/plugkit.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.259
|
package/bin/rtk.sha256
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
986bf1dac917fd8e6ee5b14b2686aff49e26341923b45d77187dc4e6bf993d6c rtk-win32-x64.exe
|
|
2
|
+
3bdb09ac8553288eb3a8df3a4514db906217f9dd29acfcb4cdc22d95ea08ec10 rtk-win32-arm64.exe
|
|
3
|
+
e89fdf402c28796b510587a8b0fe046438b5b24d49533d1a2339a48aecae35e9 rtk-darwin-x64
|
|
4
|
+
2b203fd380f5782b5489eb016e34e3dbf848272a7fadf36b39bce6cfd9a3005c rtk-darwin-arm64
|
|
5
|
+
0da9950b859c7a2693aaf6c169f05f9b8965508ba1f23f1547e63d5fa988749e rtk-linux-x64
|
|
6
|
+
690b82a0f1aecb0f8baef8653f9e8bcf4d5aa60217198edce2d7e5b40f4fa29f rtk-linux-arm64
|
package/bin/rtk.version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.38.0
|
package/gm.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.800",
|
|
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.259"
|
|
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));
|