@ryuenn3123/agentic-senior-core 6.11.0 → 6.11.1
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/.agents/plugins/agentic-senior-core/.codex-plugin/plugin.json +1 -1
- package/.agents/plugins/agentic-senior-core/hooks/post-edit-enforce.js +82 -10
- package/.agents/plugins/agentic-senior-core/hooks.json +22 -138
- package/.agents/plugins/agentic-senior-core/plugin.json +1 -1
- package/bin/agentic-senior-core.js +0 -8
- package/gemini-extension.json +1 -1
- package/lib/cli/commands/git-hook-generator.mjs +12 -2
- package/package.json +1 -3
- package/plugin.yaml +1 -1
- package/lib/cli/commands/mcp.mjs +0 -3
- package/scripts/mcp-server/constants.mjs +0 -57
- package/scripts/mcp-server/tool-registry.mjs +0 -204
- package/scripts/mcp-server/tools.mjs +0 -592
- package/scripts/mcp-server.mjs +0 -202
|
@@ -57,16 +57,50 @@ const {
|
|
|
57
57
|
} = require('./constants.cjs');
|
|
58
58
|
|
|
59
59
|
// Module-level counter for Claude Code path (resets per process spawn)
|
|
60
|
-
|
|
60
|
+
function logHook(event, msg) {
|
|
61
|
+
try {
|
|
62
|
+
const os = require('os');
|
|
63
|
+
const logDir = path.join(os.homedir(), '.asc');
|
|
64
|
+
if (!fs.existsSync(logDir)) fs.mkdirSync(logDir, { recursive: true });
|
|
65
|
+
const logFile = path.join(logDir, 'hooks.log');
|
|
66
|
+
try {
|
|
67
|
+
if (fs.existsSync(logFile)) {
|
|
68
|
+
const stats = fs.statSync(logFile);
|
|
69
|
+
if (stats.size > 100 * 1024) {
|
|
70
|
+
const content = fs.readFileSync(logFile, 'utf8');
|
|
71
|
+
const trimmed = content.slice(-50 * 1024);
|
|
72
|
+
const firstNewline = trimmed.indexOf('\n');
|
|
73
|
+
fs.writeFileSync(logFile, firstNewline >= 0 ? trimmed.slice(firstNewline + 1) : trimmed, 'utf8');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
} catch (_) {}
|
|
77
|
+
fs.appendFileSync(logFile, `[${new Date().toISOString()}] [post-edit-enforce] [${event}] ${msg}\n`, 'utf8');
|
|
78
|
+
} catch (_) {}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
logHook('ScriptStart', `pid=${process.pid} cwd=${process.cwd()}`);
|
|
82
|
+
|
|
83
|
+
if (process.stdin.isTTY) {
|
|
84
|
+
logHook('StdinTTY', 'Exiting because stdin is a TTY');
|
|
85
|
+
process.exit(0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const stdinTimeout = setTimeout(() => {
|
|
89
|
+
logHook('StdinTimeout', `No input after 3s, exiting bufferLen=${inputBuffer.length}`);
|
|
90
|
+
process.exit(0);
|
|
91
|
+
}, 3000);
|
|
61
92
|
|
|
62
93
|
let inputBuffer = '';
|
|
63
94
|
process.stdin.setEncoding('utf8');
|
|
64
95
|
process.stdin.on('data', chunk => {
|
|
65
96
|
inputBuffer += chunk;
|
|
97
|
+
logHook('DataChunk', `len=${chunk.length} preview=${chunk.slice(0, 100).replace(/[\r\n]+/g, ' ')}`);
|
|
66
98
|
try {
|
|
67
99
|
const data = JSON.parse(inputBuffer);
|
|
100
|
+
clearTimeout(stdinTimeout);
|
|
101
|
+
logHook('StdinData', 'keys=' + Object.keys(data).join(','));
|
|
68
102
|
|
|
69
|
-
if (data.
|
|
103
|
+
if (data.transcriptPath) {
|
|
70
104
|
handleAntigravityPostInvocation(data);
|
|
71
105
|
return;
|
|
72
106
|
}
|
|
@@ -82,6 +116,32 @@ process.stdin.on('data', chunk => {
|
|
|
82
116
|
}
|
|
83
117
|
});
|
|
84
118
|
|
|
119
|
+
process.stdin.on('end', () => {
|
|
120
|
+
clearTimeout(stdinTimeout);
|
|
121
|
+
logHook('StdinEnd', `bufferLen=${inputBuffer.length}`);
|
|
122
|
+
if (inputBuffer.trim()) {
|
|
123
|
+
try {
|
|
124
|
+
const data = JSON.parse(inputBuffer);
|
|
125
|
+
logHook('ParsedInputOnEnd', 'keys=' + Object.keys(data).join(','));
|
|
126
|
+
if (data.transcriptPath) {
|
|
127
|
+
handleAntigravityPostInvocation(data);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const toolName = data.tool_name || '';
|
|
131
|
+
const toolInput = data.tool_input || {};
|
|
132
|
+
processSingleEdit(toolName, toolInput, function (nudge) {
|
|
133
|
+
emitClaude(nudge);
|
|
134
|
+
});
|
|
135
|
+
process.exit(0);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
logHook('JsonParseErrorOnEnd', e.message);
|
|
138
|
+
process.exit(0);
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
process.exit(0);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
85
145
|
function handleAntigravityPostInvocation(data) {
|
|
86
146
|
try {
|
|
87
147
|
if (!fs.existsSync(data.transcriptPath)) return;
|
|
@@ -133,22 +193,32 @@ function handleAntigravityPostInvocation(data) {
|
|
|
133
193
|
+ '(2) Does the codebase already have this? (3) Stdlib/native? (4) Existing dependency?');
|
|
134
194
|
}
|
|
135
195
|
|
|
136
|
-
|
|
196
|
+
const isPostToolUse = data.stepIdx !== undefined;
|
|
197
|
+
logHook('AntigravityResult', `sourceEdits=${sourceEditsSinceStart}, findings=${findings.length}, isPostToolUse=${isPostToolUse}`);
|
|
198
|
+
|
|
199
|
+
if (isPostToolUse) {
|
|
200
|
+
process.stdout.write(JSON.stringify({}) + '\n');
|
|
201
|
+
} else if (findings.length > 0) {
|
|
137
202
|
const injectSteps = findings.map(function (f) { return { ephemeralMessage: f }; });
|
|
138
203
|
process.stdout.write(JSON.stringify({ injectSteps: injectSteps }) + '\n');
|
|
139
204
|
} else {
|
|
140
205
|
process.stdout.write(JSON.stringify({}) + '\n');
|
|
141
206
|
}
|
|
142
207
|
} catch (e) {
|
|
208
|
+
logHook('AntigravityError', e.message);
|
|
143
209
|
process.stdout.write(JSON.stringify({}) + '\n');
|
|
144
210
|
}
|
|
211
|
+
process.exit(0);
|
|
145
212
|
}
|
|
146
213
|
|
|
147
214
|
function processSingleEdit(toolName, toolInput, emitFn, skipArray) {
|
|
148
|
-
const filePath = toolInput.file_path || '';
|
|
215
|
+
const filePath = toolInput.file_path || toolInput.TargetFile || toolInput.filePath || '';
|
|
149
216
|
if (!filePath) return;
|
|
150
217
|
const findings = [];
|
|
151
218
|
|
|
219
|
+
const isEdit = toolName === 'Edit' || toolName === 'replace_file_content' || toolName === 'multi_replace_file_content';
|
|
220
|
+
const isWrite = toolName === 'Write' || toolName === 'write_to_file';
|
|
221
|
+
|
|
152
222
|
// Increment per-process counter for Claude Code drift detection
|
|
153
223
|
const ext = path.extname(filePath).slice(1);
|
|
154
224
|
if (SOURCE_EXTENSIONS.has(ext)) {
|
|
@@ -168,9 +238,9 @@ function processSingleEdit(toolName, toolInput, emitFn, skipArray) {
|
|
|
168
238
|
}
|
|
169
239
|
|
|
170
240
|
if (SOURCE_EXTENSIONS.has(ext)) {
|
|
171
|
-
if (
|
|
241
|
+
if (isEdit) {
|
|
172
242
|
checkLocDelta(toolInput, filePath, findings);
|
|
173
|
-
} else if (
|
|
243
|
+
} else if (isWrite) {
|
|
174
244
|
checkNewFileSize(toolInput, filePath, findings);
|
|
175
245
|
}
|
|
176
246
|
}
|
|
@@ -191,6 +261,8 @@ function processSingleEdit(toolName, toolInput, emitFn, skipArray) {
|
|
|
191
261
|
checkWorkflowGate(toolName, filePath, ext, findings);
|
|
192
262
|
}
|
|
193
263
|
|
|
264
|
+
logHook('ProcessSingleEdit', 'tool=' + toolName + ', file=' + filePath + ', findings=' + findings.length);
|
|
265
|
+
|
|
194
266
|
if (findings.length === 0) return;
|
|
195
267
|
|
|
196
268
|
const nudge = '[ASC enforcement] ' + findings.join(' ') + ' Review the decision ladder before continuing.';
|
|
@@ -256,8 +328,8 @@ function extractDeps(text, pattern) {
|
|
|
256
328
|
}
|
|
257
329
|
|
|
258
330
|
function checkLocDelta(toolInput, filePath, findings) {
|
|
259
|
-
var newLines = (toolInput.new_string || '').split('\n').length;
|
|
260
|
-
var oldLines = (toolInput.old_string || '').split('\n').length;
|
|
331
|
+
var newLines = (toolInput.new_string || toolInput.ReplacementContent || '').split('\n').length;
|
|
332
|
+
var oldLines = (toolInput.old_string || toolInput.TargetContent || '').split('\n').length;
|
|
261
333
|
var delta = newLines - oldLines;
|
|
262
334
|
if (delta > LOC_DELTA_THRESHOLD) {
|
|
263
335
|
findings.push(
|
|
@@ -268,7 +340,7 @@ function checkLocDelta(toolInput, filePath, findings) {
|
|
|
268
340
|
}
|
|
269
341
|
|
|
270
342
|
function checkNewFileSize(toolInput, filePath, findings) {
|
|
271
|
-
var lines = (toolInput.content || '').split('\n').length;
|
|
343
|
+
var lines = (toolInput.content || toolInput.CodeContent || '').split('\n').length;
|
|
272
344
|
if (lines > NEW_FILE_LINE_THRESHOLD) {
|
|
273
345
|
// Step 1-2 coverage ("does this already exist?") moved to dedup-gate.js
|
|
274
346
|
// which provides concrete file-name + overlap-percentage feedback.
|
|
@@ -327,7 +399,7 @@ function checkSecurityPatterns(toolName, toolInput, filePath, findings) {
|
|
|
327
399
|
}
|
|
328
400
|
|
|
329
401
|
function checkUiSlopPatterns(toolName, toolInput, filePath, findings) {
|
|
330
|
-
var target = toolName === 'Edit' ? (toolInput.new_string || '') : (toolInput.content || '');
|
|
402
|
+
var target = toolName === 'Edit' ? (toolInput.new_string || toolInput.ReplacementContent || '') : (toolInput.content || toolInput.CodeContent || '');
|
|
331
403
|
if (!target) return;
|
|
332
404
|
|
|
333
405
|
if (UI_SLOP_PATTERNS.patterns) {
|
|
@@ -1,121 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"agentic-senior-core": {
|
|
3
|
-
"SessionStart": [
|
|
4
|
-
{
|
|
5
|
-
"matcher": "startup|resume|clear|compact",
|
|
6
|
-
"hooks": [
|
|
7
|
-
{
|
|
8
|
-
"type": "command",
|
|
9
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','session-start.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','session-start.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','session-start.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','session-start.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
10
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\session-start.js\" }",
|
|
11
|
-
"timeout": 5,
|
|
12
|
-
"statusMessage": "Loading ASC rules..."
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"SubagentStart": [
|
|
18
|
-
{
|
|
19
|
-
"hooks": [
|
|
20
|
-
{
|
|
21
|
-
"type": "command",
|
|
22
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','subagent-start.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','subagent-start.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','subagent-start.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','subagent-start.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
23
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\subagent-start.js\" }",
|
|
24
|
-
"timeout": 5,
|
|
25
|
-
"statusMessage": "Loading ASC rules..."
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
"PreToolUse": [
|
|
31
|
-
{
|
|
32
|
-
"matcher": "Edit|Write|replace_file_content|write_to_file|write_file|multi_replace_file_content",
|
|
33
|
-
"hooks": [
|
|
34
|
-
{
|
|
35
|
-
"type": "command",
|
|
36
|
-
"if": "Edit(**/package.json)|Edit(**/requirements.txt)|Edit(**/pyproject.toml)|Edit(**/go.mod)|Edit(**/Cargo.toml)|Edit(**/Gemfile)",
|
|
37
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
38
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\pre-tool-dependency-gate.js\" }",
|
|
39
|
-
"timeout": 5,
|
|
40
|
-
"statusMessage": "ASC Pre-tool dependency check (Edit)..."
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"type": "command",
|
|
44
|
-
"if": "Write(**/package.json)|Write(**/requirements.txt)|Write(**/pyproject.toml)|Write(**/go.mod)|Write(**/Cargo.toml)|Write(**/Gemfile)",
|
|
45
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
46
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\pre-tool-dependency-gate.js\" }",
|
|
47
|
-
"timeout": 5,
|
|
48
|
-
"statusMessage": "ASC Pre-tool dependency check (Write)..."
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"matcher": "Bash|run_command|run_shell_command|terminal|execute_command",
|
|
54
|
-
"hooks": [
|
|
55
|
-
{
|
|
56
|
-
"type": "command",
|
|
57
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','pre-tool-dependency-gate.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
58
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\pre-tool-dependency-gate.js\" }",
|
|
59
|
-
"timeout": 5,
|
|
60
|
-
"statusMessage": "ASC Pre-tool dependency check (Terminal)..."
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
"PostToolUse": [
|
|
66
|
-
{
|
|
67
|
-
"matcher": "Edit|Write|replace_file_content|write_to_file|write_file|multi_replace_file_content",
|
|
68
|
-
"hooks": [
|
|
69
|
-
{
|
|
70
|
-
"type": "command",
|
|
71
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','post-edit-enforce.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','post-edit-enforce.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','post-edit-enforce.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','post-edit-enforce.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
72
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\post-edit-enforce.js\" }",
|
|
73
|
-
"timeout": 5,
|
|
74
|
-
"statusMessage": "ASC ladder & spec gate check..."
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"type": "command",
|
|
78
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','dedup-gate.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','dedup-gate.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','dedup-gate.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','dedup-gate.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
79
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\dedup-gate.js\" }",
|
|
80
|
-
"timeout": 15,
|
|
81
|
-
"statusMessage": "ASC duplicate-code scan..."
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
"PreInvocation": [
|
|
87
|
-
{
|
|
88
|
-
"type": "command",
|
|
89
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','session-pulse.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','session-pulse.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','session-pulse.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','session-pulse.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
90
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\session-pulse.js\" }",
|
|
91
|
-
"timeout": 5,
|
|
92
|
-
"statusMessage": "Loading ASC rules..."
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"type": "command",
|
|
96
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','ladder-pulse.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','ladder-pulse.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','ladder-pulse.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','ladder-pulse.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
97
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\ladder-pulse.js\" }",
|
|
98
|
-
"timeout": 5,
|
|
99
|
-
"statusMessage": "ASC ladder pulse..."
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"PostInvocation": [
|
|
103
|
-
{
|
|
104
|
-
"type": "command",
|
|
105
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','post-edit-enforce.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','post-edit-enforce.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','post-edit-enforce.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','post-edit-enforce.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
106
|
-
"timeout": 15
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
"PreCompact": [
|
|
110
|
-
{
|
|
111
|
-
"type": "command",
|
|
112
|
-
"command": "node -e \"const p=require('path'),fs=require('fs'),os=require('os');const local=p.join(process.cwd(),'.agents','plugins','agentic-senior-core','hooks','pre-compact-pin.js');const g1=p.join(os.homedir(),'.agents','plugins','agentic-senior-core','hooks','pre-compact-pin.js');const g2=p.join(os.homedir(),'.gemini','config','plugins','agentic-senior-core','hooks','pre-compact-pin.js');const g3=p.join(os.homedir(),'.gemini','antigravity-cli','plugins','agentic-senior-core','hooks','pre-compact-pin.js');require(fs.existsSync(local)?local:(fs.existsSync(g1)?g1:(fs.existsSync(g2)?g2:g3)));\"",
|
|
113
|
-
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { $root = if ($env:PLUGIN_ROOT) { $env:PLUGIN_ROOT } else { if ($env:CLAUDE_PLUGIN_ROOT) { $env:CLAUDE_PLUGIN_ROOT } else { if (Test-Path \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\") { \"$env:USERPROFILE\\.agents\\plugins\\agentic-senior-core\" } else { \"$env:USERPROFILE\\.gemini\\config\\plugins\\agentic-senior-core\" } } }; node \"$root\\hooks\\pre-compact-pin.js\" }",
|
|
114
|
-
"timeout": 5,
|
|
115
|
-
"statusMessage": "ASC constraint pinning..."
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
2
|
"hooks": {
|
|
120
3
|
"SessionStart": [
|
|
121
4
|
{
|
|
@@ -123,8 +6,8 @@
|
|
|
123
6
|
"hooks": [
|
|
124
7
|
{
|
|
125
8
|
"type": "command",
|
|
126
|
-
"command": "node
|
|
127
|
-
"commandWindows": "
|
|
9
|
+
"command": "node hooks/session-start.js",
|
|
10
|
+
"commandWindows": "node hooks/session-start.js",
|
|
128
11
|
"timeout": 5,
|
|
129
12
|
"statusMessage": "Loading ASC rules..."
|
|
130
13
|
}
|
|
@@ -136,8 +19,8 @@
|
|
|
136
19
|
"hooks": [
|
|
137
20
|
{
|
|
138
21
|
"type": "command",
|
|
139
|
-
"command": "node
|
|
140
|
-
"commandWindows": "
|
|
22
|
+
"command": "node hooks/subagent-start.js",
|
|
23
|
+
"commandWindows": "node hooks/subagent-start.js",
|
|
141
24
|
"timeout": 5,
|
|
142
25
|
"statusMessage": "Loading ASC rules..."
|
|
143
26
|
}
|
|
@@ -151,16 +34,16 @@
|
|
|
151
34
|
{
|
|
152
35
|
"type": "command",
|
|
153
36
|
"if": "Edit(**/package.json)|Edit(**/requirements.txt)|Edit(**/pyproject.toml)|Edit(**/go.mod)|Edit(**/Cargo.toml)|Edit(**/Gemfile)",
|
|
154
|
-
"command": "node
|
|
155
|
-
"commandWindows": "
|
|
37
|
+
"command": "node hooks/pre-tool-dependency-gate.js",
|
|
38
|
+
"commandWindows": "node hooks/pre-tool-dependency-gate.js",
|
|
156
39
|
"timeout": 5,
|
|
157
40
|
"statusMessage": "ASC Pre-tool dependency check (Edit)..."
|
|
158
41
|
},
|
|
159
42
|
{
|
|
160
43
|
"type": "command",
|
|
161
44
|
"if": "Write(**/package.json)|Write(**/requirements.txt)|Write(**/pyproject.toml)|Write(**/go.mod)|Write(**/Cargo.toml)|Write(**/Gemfile)",
|
|
162
|
-
"command": "node
|
|
163
|
-
"commandWindows": "
|
|
45
|
+
"command": "node hooks/pre-tool-dependency-gate.js",
|
|
46
|
+
"commandWindows": "node hooks/pre-tool-dependency-gate.js",
|
|
164
47
|
"timeout": 5,
|
|
165
48
|
"statusMessage": "ASC Pre-tool dependency check (Write)..."
|
|
166
49
|
}
|
|
@@ -171,8 +54,8 @@
|
|
|
171
54
|
"hooks": [
|
|
172
55
|
{
|
|
173
56
|
"type": "command",
|
|
174
|
-
"command": "node
|
|
175
|
-
"commandWindows": "
|
|
57
|
+
"command": "node hooks/pre-tool-dependency-gate.js",
|
|
58
|
+
"commandWindows": "node hooks/pre-tool-dependency-gate.js",
|
|
176
59
|
"timeout": 5,
|
|
177
60
|
"statusMessage": "ASC Pre-tool dependency check (Terminal)..."
|
|
178
61
|
}
|
|
@@ -185,15 +68,15 @@
|
|
|
185
68
|
"hooks": [
|
|
186
69
|
{
|
|
187
70
|
"type": "command",
|
|
188
|
-
"command": "node
|
|
189
|
-
"commandWindows": "
|
|
71
|
+
"command": "node hooks/post-edit-enforce.js",
|
|
72
|
+
"commandWindows": "node hooks/post-edit-enforce.js",
|
|
190
73
|
"timeout": 5,
|
|
191
74
|
"statusMessage": "ASC ladder & spec gate check..."
|
|
192
75
|
},
|
|
193
76
|
{
|
|
194
77
|
"type": "command",
|
|
195
|
-
"command": "node
|
|
196
|
-
"commandWindows": "
|
|
78
|
+
"command": "node hooks/dedup-gate.js",
|
|
79
|
+
"commandWindows": "node hooks/dedup-gate.js",
|
|
197
80
|
"timeout": 15,
|
|
198
81
|
"statusMessage": "ASC duplicate-code scan..."
|
|
199
82
|
}
|
|
@@ -203,15 +86,15 @@
|
|
|
203
86
|
"PreInvocation": [
|
|
204
87
|
{
|
|
205
88
|
"type": "command",
|
|
206
|
-
"command": "node
|
|
207
|
-
"commandWindows": "
|
|
89
|
+
"command": "node hooks/session-pulse.js",
|
|
90
|
+
"commandWindows": "node hooks/session-pulse.js",
|
|
208
91
|
"timeout": 5,
|
|
209
92
|
"statusMessage": "Loading ASC rules..."
|
|
210
93
|
},
|
|
211
94
|
{
|
|
212
95
|
"type": "command",
|
|
213
|
-
"command": "node
|
|
214
|
-
"commandWindows": "
|
|
96
|
+
"command": "node hooks/ladder-pulse.js",
|
|
97
|
+
"commandWindows": "node hooks/ladder-pulse.js",
|
|
215
98
|
"timeout": 5,
|
|
216
99
|
"statusMessage": "ASC ladder pulse..."
|
|
217
100
|
}
|
|
@@ -219,15 +102,16 @@
|
|
|
219
102
|
"PostInvocation": [
|
|
220
103
|
{
|
|
221
104
|
"type": "command",
|
|
222
|
-
"command": "node
|
|
105
|
+
"command": "node hooks/post-edit-enforce.js",
|
|
106
|
+
"commandWindows": "node hooks/post-edit-enforce.js",
|
|
223
107
|
"timeout": 15
|
|
224
108
|
}
|
|
225
109
|
],
|
|
226
110
|
"PreCompact": [
|
|
227
111
|
{
|
|
228
112
|
"type": "command",
|
|
229
|
-
"command": "node
|
|
230
|
-
"commandWindows": "
|
|
113
|
+
"command": "node hooks/pre-compact-pin.js",
|
|
114
|
+
"commandWindows": "node hooks/pre-compact-pin.js",
|
|
231
115
|
"timeout": 5,
|
|
232
116
|
"statusMessage": "ASC constraint pinning..."
|
|
233
117
|
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* uninstall Remove ASC adapter files from the current project
|
|
9
9
|
* clean Remove v4 per-project artifacts (.agent-context/, bridge files)
|
|
10
10
|
* status Show detected IDEs and install hints
|
|
11
|
-
* mcp Start MCP stdio server
|
|
12
11
|
*/
|
|
13
12
|
import { exit } from 'node:process';
|
|
14
13
|
import { readFileSync } from 'node:fs';
|
|
@@ -37,7 +36,6 @@ function printUsage() {
|
|
|
37
36
|
console.log(' uninstall Remove ASC adapter files and git hooks from this project');
|
|
38
37
|
console.log(' clean Remove v4 per-project artifacts');
|
|
39
38
|
console.log(' status Show detected IDEs and install hints');
|
|
40
|
-
console.log(' mcp Start MCP stdio server');
|
|
41
39
|
console.log(' --version Show version');
|
|
42
40
|
console.log(' --help Show this help');
|
|
43
41
|
}
|
|
@@ -92,12 +90,6 @@ async function main() {
|
|
|
92
90
|
return;
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
if (commandArgument === 'mcp') {
|
|
96
|
-
const { runMcpServerCommand } = await import('../lib/cli/commands/mcp.mjs');
|
|
97
|
-
await runMcpServerCommand();
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
93
|
console.error(`Unknown command: ${commandArgument}`);
|
|
102
94
|
printUsage();
|
|
103
95
|
exit(1);
|
package/gemini-extension.json
CHANGED
|
@@ -470,6 +470,13 @@ export function installGlobalGitPreCommitHook({ homeDir = os.homedir() } = {}) {
|
|
|
470
470
|
fs.mkdirSync(globalHooksDir, { recursive: true });
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
+
// Generate standalone universal runner in global directory for fallback
|
|
474
|
+
const globalRunnerPath = path.join(globalHooksDir, 'pre-commit-runner.cjs');
|
|
475
|
+
const runnerScriptContent = generatePreCommitRunnerScript();
|
|
476
|
+
fs.writeFileSync(globalRunnerPath, runnerScriptContent, { encoding: 'utf8', mode: 0o755 });
|
|
477
|
+
|
|
478
|
+
const globalRunnerPosix = globalRunnerPath.replace(/\\/g, '/');
|
|
479
|
+
|
|
473
480
|
const hookPath = path.join(globalHooksDir, 'pre-commit');
|
|
474
481
|
const dispatcherContent = `#!/bin/sh
|
|
475
482
|
${ASC_HOOK_HEADER} -- Global Smart Dispatcher
|
|
@@ -504,13 +511,16 @@ if [ -n "$LOCAL_HOOK" ]; then
|
|
|
504
511
|
fi
|
|
505
512
|
fi
|
|
506
513
|
|
|
507
|
-
# 3. Run ASC workspace pre-commit runner if present
|
|
514
|
+
# 3. Run ASC workspace pre-commit runner if present, or fallback to global runner
|
|
508
515
|
if [ -n "$GIT_ROOT" ] && [ -f "$GIT_ROOT/.asc/hooks/pre-commit-runner.cjs" ]; then
|
|
509
516
|
node "$GIT_ROOT/.asc/hooks/pre-commit-runner.cjs" "$@"
|
|
510
517
|
exit $?
|
|
511
518
|
elif [ -f ".asc/hooks/pre-commit-runner.cjs" ]; then
|
|
512
519
|
node .asc/hooks/pre-commit-runner.cjs "$@"
|
|
513
520
|
exit $?
|
|
521
|
+
elif [ -f "${globalRunnerPosix}" ]; then
|
|
522
|
+
node "${globalRunnerPosix}" "$@"
|
|
523
|
+
exit $?
|
|
514
524
|
fi
|
|
515
525
|
|
|
516
526
|
exit 0
|
|
@@ -525,6 +535,6 @@ exit 0
|
|
|
525
535
|
return { installed: false, hookPath, reason: 'Could not set git config --global core.hooksPath' };
|
|
526
536
|
}
|
|
527
537
|
|
|
528
|
-
return { installed: true, hookPath, global: true };
|
|
538
|
+
return { installed: true, hookPath, runnerPath: globalRunnerPath, global: true };
|
|
529
539
|
}
|
|
530
540
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuenn3123/agentic-senior-core",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agentic Senior Core: Universal AI coding rules and workflows. Write code like a staff engineer, not a junior.",
|
|
6
6
|
"bin": {
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
"gemini-extension.json",
|
|
17
17
|
"plugin.yaml",
|
|
18
18
|
"__init__.py",
|
|
19
|
-
"scripts/mcp-server.mjs",
|
|
20
|
-
"scripts/mcp-server/",
|
|
21
19
|
"scripts/uninstall.js",
|
|
22
20
|
"README.md",
|
|
23
21
|
"LICENSE",
|
package/plugin.yaml
CHANGED
package/lib/cli/commands/mcp.mjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
-
import { dirname, resolve } from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
|
|
7
|
-
const SCRIPT_FILE_PATH = fileURLToPath(import.meta.url);
|
|
8
|
-
export const REPOSITORY_ROOT = resolve(dirname(SCRIPT_FILE_PATH), '..', '..');
|
|
9
|
-
export const STATE_DIRECTORY = resolve(REPOSITORY_ROOT, '.agent-context', 'state');
|
|
10
|
-
export const DEFAULT_PROTOCOL_VERSION = '2024-11-05';
|
|
11
|
-
export const DEFAULT_FETCH_TIMEOUT_MS = 15000;
|
|
12
|
-
export const DEFAULT_FETCH_MAX_CHARS = 6000;
|
|
13
|
-
export const MAX_FETCH_MAX_CHARS = 20000;
|
|
14
|
-
export const DEFAULT_TREND_WINDOW_DAYS = 90;
|
|
15
|
-
export const MAX_TREND_PACKAGES = 10;
|
|
16
|
-
export const FALLBACK_PACKAGE_VERSION = '0.0.0-local';
|
|
17
|
-
|
|
18
|
-
// IMPORTANT: This version extraction logic is intentionally duplicated from lib/cli/constants.mjs.
|
|
19
|
-
// The MCP server is designed to be copied directly into target user workspaces where
|
|
20
|
-
// the original package.json may not exist in the parent tree. This try/catch fallback
|
|
21
|
-
// ensures the server can still run standalone without crashing if package.json is missing.
|
|
22
|
-
function resolvePackageVersion() {
|
|
23
|
-
try {
|
|
24
|
-
const parsedPackageManifest = JSON.parse(
|
|
25
|
-
readFileSync(resolve(REPOSITORY_ROOT, 'package.json'), 'utf8')
|
|
26
|
-
);
|
|
27
|
-
const rawVersion = typeof parsedPackageManifest?.version === 'string'
|
|
28
|
-
? parsedPackageManifest.version.trim()
|
|
29
|
-
: '';
|
|
30
|
-
|
|
31
|
-
return rawVersion || FALLBACK_PACKAGE_VERSION;
|
|
32
|
-
} catch {
|
|
33
|
-
return FALLBACK_PACKAGE_VERSION;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const PACKAGE_VERSION = resolvePackageVersion();
|
|
38
|
-
|
|
39
|
-
export const TEST_SUITE_ARGS = {
|
|
40
|
-
adapter: ['--test', './tests/adapter.test.mjs'],
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const INTERNAL_SCRIPT_PATHS = {};
|
|
44
|
-
|
|
45
|
-
function getAvailableTestSuites() {
|
|
46
|
-
return Object.entries(TEST_SUITE_ARGS)
|
|
47
|
-
.filter(([, commandArguments]) => (
|
|
48
|
-
Array.isArray(commandArguments)
|
|
49
|
-
&& commandArguments.length > 1
|
|
50
|
-
&& commandArguments
|
|
51
|
-
.slice(1)
|
|
52
|
-
.every((relativeTestPath) => existsSync(resolve(REPOSITORY_ROOT, relativeTestPath)))
|
|
53
|
-
))
|
|
54
|
-
.map(([suiteName]) => suiteName);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const AVAILABLE_TEST_SUITES = getAvailableTestSuites();
|