gm-copilot-cli 2.0.5

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.
@@ -0,0 +1,58 @@
1
+ {
2
+ "description": "Hooks for gm GitHub Copilot CLI extension",
3
+ "hooks": {
4
+ "tool:invoke": [
5
+ {
6
+ "matcher": "*",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node ${COPILOT_EXTENSION_DIR}/hooks/pre-tool-use-hook.js",
11
+ "timeout": 3600
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "session:start": [
17
+ {
18
+ "matcher": "*",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node ${COPILOT_EXTENSION_DIR}/hooks/session-start-hook.js",
23
+ "timeout": 10000
24
+ }
25
+ ]
26
+ }
27
+ ],
28
+ "prompt:submit": [
29
+ {
30
+ "matcher": "*",
31
+ "hooks": [
32
+ {
33
+ "type": "command",
34
+ "command": "node ${COPILOT_EXTENSION_DIR}/hooks/prompt-submit-hook.js",
35
+ "timeout": 3600
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "session:end": [
41
+ {
42
+ "matcher": "*",
43
+ "hooks": [
44
+ {
45
+ "type": "command",
46
+ "command": "node ${COPILOT_EXTENSION_DIR}/hooks/session-end-hook.js",
47
+ "timeout": 300000
48
+ },
49
+ {
50
+ "type": "command",
51
+ "command": "node ${COPILOT_EXTENSION_DIR}/hooks/session-end-git-hook.js",
52
+ "timeout": 60000
53
+ }
54
+ ]
55
+ }
56
+ ]
57
+ }
58
+ }
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
7
+
8
+ const shellTools = ['Bash', 'run_shell_command'];
9
+ const writeTools = ['Write', 'write_file'];
10
+ const searchTools = ['Glob', 'Grep', 'glob', 'search_file_content', 'Search', 'search'];
11
+ const forbiddenTools = ['find', 'Find'];
12
+
13
+ const run = () => {
14
+ try {
15
+ const input = fs.readFileSync(0, 'utf-8');
16
+ const data = JSON.parse(input);
17
+ const { tool_name, tool_input } = data;
18
+
19
+ if (!tool_name) return { allow: true };
20
+
21
+ if (forbiddenTools.includes(tool_name)) {
22
+ return { block: true, reason: 'Use gm:code-search or plugin:gm:dev for semantic codebase search instead of filesystem find' };
23
+ }
24
+
25
+ if (shellTools.includes(tool_name)) {
26
+ return { block: true, reason: 'Use dev execute instead for all command execution' };
27
+ }
28
+
29
+ if (writeTools.includes(tool_name)) {
30
+ const file_path = tool_input?.file_path || '';
31
+ const ext = path.extname(file_path);
32
+ const inSkillsDir = file_path.includes('/skills/');
33
+ const base = path.basename(file_path).toLowerCase();
34
+ if ((ext === '.md' || ext === '.txt' || base.startsWith('features_list')) &&
35
+ !base.startsWith('claude') && !base.startsWith('readme') && !inSkillsDir) {
36
+ return { block: true, reason: 'Cannot create documentation files. Only CLAUDE.md and readme.md are maintained.' };
37
+ }
38
+ if (/\.(test|spec)\.(js|ts|jsx|tsx|mjs|cjs)$/.test(base) ||
39
+ /^(jest|vitest|mocha|ava|jasmine|tap)\.(config|setup)/.test(base) ||
40
+ file_path.includes('/__tests__/') || file_path.includes('/test/') ||
41
+ file_path.includes('/tests/') || file_path.includes('/fixtures/') ||
42
+ file_path.includes('/test-data/') || file_path.includes('/__mocks__/') ||
43
+ /\.(snap|stub|mock|fixture)\.(js|ts|json)$/.test(base)) {
44
+ return { block: true, reason: 'Test files forbidden on disk. Use plugin:gm:dev with real services for all testing.' };
45
+ }
46
+ }
47
+
48
+ if (searchTools.includes(tool_name)) {
49
+ return { block: true, reason: 'Code exploration must use: gm:code-search skill or plugin:gm:dev execute. This restriction enforces semantic search over filesystem patterns.' };
50
+ }
51
+
52
+ if (tool_name === 'Task') {
53
+ const subagentType = tool_input?.subagent_type || '';
54
+ if (subagentType === 'Explore') {
55
+ return { block: true, reason: 'Use gm:thorns-overview for codebase insight, then use gm:code-search or plugin:gm:dev' };
56
+ }
57
+ }
58
+
59
+ if (tool_name === 'EnterPlanMode') {
60
+ return { block: true, reason: 'Plan mode is disabled. Use GM agent planning (PLAN→EXECUTE→EMIT→VERIFY→COMPLETE state machine) via gm:gm subagent instead.' };
61
+ }
62
+
63
+ return { allow: true };
64
+ } catch (error) {
65
+ return { allow: true };
66
+ }
67
+ };
68
+
69
+ try {
70
+ const result = run();
71
+
72
+ if (result.block) {
73
+ if (isGemini) {
74
+ console.log(JSON.stringify({ decision: 'deny', reason: result.reason }));
75
+ } else {
76
+ console.log(JSON.stringify({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'deny', permissionDecisionReason: result.reason } }));
77
+ }
78
+ process.exit(2);
79
+ }
80
+
81
+ if (isGemini) {
82
+ console.log(JSON.stringify({ decision: 'allow' }));
83
+ } else {
84
+ console.log(JSON.stringify({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'allow' } }));
85
+ }
86
+ process.exit(0);
87
+ } catch (error) {
88
+ if (isGemini) {
89
+ console.log(JSON.stringify({ decision: 'allow' }));
90
+ } else {
91
+ console.log(JSON.stringify({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'allow' } }));
92
+ }
93
+ process.exit(0);
94
+ }
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const { execSync } = require('child_process');
5
+
6
+ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR;
7
+
8
+ const COMPACT_CONTEXT = 'use gm agent | ref: TOOL_INVARIANTS | codesearch for exploration | plugin:gm:dev for execution';
9
+
10
+ const PLAN_MODE_BLOCK = 'DO NOT use EnterPlanMode or any plan mode tool. Use GM agent planning (PLAN→EXECUTE→EMIT→VERIFY→COMPLETE state machine) instead. Plan mode is blocked.';
11
+
12
+ const getBaseContext = (resetMsg = '') => {
13
+ let ctx = 'use gm agent';
14
+ if (resetMsg) ctx += ' - ' + resetMsg;
15
+ return ctx;
16
+ };
17
+
18
+ const readStdinPrompt = () => {
19
+ try {
20
+ const raw = fs.readFileSync(0, 'utf-8');
21
+ const data = JSON.parse(raw);
22
+ return data.prompt || '';
23
+ } catch (e) {
24
+ return '';
25
+ }
26
+ };
27
+
28
+ const runCodeSearch = (query, cwd) => {
29
+ if (!query || !cwd || !fs.existsSync(cwd)) return '';
30
+ try {
31
+ const escaped = query.replace(/"/g, '\\"').substring(0, 200);
32
+ let out;
33
+ try {
34
+ out = execSync(`bunx codebasesearch@latest "${escaped}"`, {
35
+ encoding: 'utf-8',
36
+ stdio: ['pipe', 'pipe', 'pipe'],
37
+ cwd,
38
+ timeout: 55000,
39
+ killSignal: 'SIGTERM'
40
+ });
41
+ } catch (bunErr) {
42
+ if (bunErr.killed) return '';
43
+ out = execSync(`npx -y codebasesearch@latest "${escaped}"`, {
44
+ encoding: 'utf-8',
45
+ stdio: ['pipe', 'pipe', 'pipe'],
46
+ cwd,
47
+ timeout: 55000,
48
+ killSignal: 'SIGTERM'
49
+ });
50
+ }
51
+ const lines = out.split('\n');
52
+ const resultStart = lines.findIndex(l => l.includes('Searching for:'));
53
+ return resultStart >= 0 ? lines.slice(resultStart).join('\n').trim() : out.trim();
54
+ } catch (e) {
55
+ return '';
56
+ }
57
+ };
58
+
59
+ const emit = (additionalContext) => {
60
+ const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
61
+ const isOpenCode = process.env.OC_PLUGIN_ROOT !== undefined;
62
+
63
+ if (isGemini) {
64
+ console.log(JSON.stringify({ systemMessage: additionalContext }, null, 2));
65
+ } else if (isOpenCode) {
66
+ console.log(JSON.stringify({ hookSpecificOutput: { hookEventName: 'message.updated', additionalContext } }, null, 2));
67
+ } else {
68
+ console.log(JSON.stringify({ hookSpecificOutput: { hookEventName: 'UserPromptSubmit', additionalContext } }, null, 2));
69
+ }
70
+ };
71
+
72
+ try {
73
+ const prompt = readStdinPrompt();
74
+ const parts = [getBaseContext() + ' | ' + COMPACT_CONTEXT + ' | ' + PLAN_MODE_BLOCK];
75
+
76
+ if (prompt && projectDir) {
77
+ const searchResults = runCodeSearch(prompt, projectDir);
78
+ if (searchResults) {
79
+ parts.push(`=== Semantic code search results for initial prompt ===\n${searchResults}`);
80
+ }
81
+ }
82
+
83
+ emit(parts.join('\n\n'));
84
+ } catch (error) {
85
+ emit(getBaseContext('hook error: ' + error.message) + ' | ' + COMPACT_CONTEXT);
86
+ process.exit(0);
87
+ }
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const crypto = require('crypto');
7
+
8
+ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
9
+
10
+ const getCounterPath = () => {
11
+ const hash = crypto.createHash('md5').update(projectDir).digest('hex');
12
+ return path.join('/tmp', `gm-git-block-counter-${hash}.json`);
13
+ };
14
+
15
+ const readCounter = () => {
16
+ try {
17
+ const counterPath = getCounterPath();
18
+ if (fs.existsSync(counterPath)) {
19
+ const data = fs.readFileSync(counterPath, 'utf-8');
20
+ return JSON.parse(data);
21
+ }
22
+ } catch (e) {}
23
+ return { count: 0, lastGitHash: null };
24
+ };
25
+
26
+ const writeCounter = (data) => {
27
+ try {
28
+ const counterPath = getCounterPath();
29
+ fs.writeFileSync(counterPath, JSON.stringify(data, null, 2), 'utf-8');
30
+ } catch (e) {}
31
+ };
32
+
33
+ const getCurrentGitHash = () => {
34
+ try {
35
+ const hash = execSync('git rev-parse HEAD', {
36
+ cwd: projectDir,
37
+ stdio: 'pipe',
38
+ encoding: 'utf-8'
39
+ }).trim();
40
+ return hash;
41
+ } catch (e) {
42
+ return null;
43
+ }
44
+ };
45
+
46
+ const resetCounterIfCommitted = (currentHash) => {
47
+ const counter = readCounter();
48
+ if (counter.lastGitHash && currentHash && counter.lastGitHash !== currentHash) {
49
+ counter.count = 0;
50
+ counter.lastGitHash = currentHash;
51
+ writeCounter(counter);
52
+ return true;
53
+ }
54
+ return false;
55
+ };
56
+
57
+ const incrementCounter = (currentHash) => {
58
+ const counter = readCounter();
59
+ counter.count = (counter.count || 0) + 1;
60
+ counter.lastGitHash = currentHash;
61
+ writeCounter(counter);
62
+ return counter.count;
63
+ };
64
+
65
+ const getGitStatus = () => {
66
+ try {
67
+ execSync('git rev-parse --git-dir', {
68
+ cwd: projectDir,
69
+ stdio: 'pipe'
70
+ });
71
+ } catch (e) {
72
+ return { isRepo: false };
73
+ }
74
+
75
+ try {
76
+ const status = execSync('git status --porcelain', {
77
+ cwd: projectDir,
78
+ stdio: 'pipe',
79
+ encoding: 'utf-8'
80
+ }).trim();
81
+
82
+ const isDirty = status.length > 0;
83
+
84
+ let unpushedCount = 0;
85
+ try {
86
+ const unpushed = execSync('git rev-list --count @{u}..HEAD', {
87
+ cwd: projectDir,
88
+ stdio: 'pipe',
89
+ encoding: 'utf-8'
90
+ }).trim();
91
+ unpushedCount = parseInt(unpushed, 10) || 0;
92
+ } catch (e) {
93
+ unpushedCount = -1;
94
+ }
95
+
96
+ let behindCount = 0;
97
+ try {
98
+ const behind = execSync('git rev-list --count HEAD..@{u}', {
99
+ cwd: projectDir,
100
+ stdio: 'pipe',
101
+ encoding: 'utf-8'
102
+ }).trim();
103
+ behindCount = parseInt(behind, 10) || 0;
104
+ } catch (e) {}
105
+
106
+ return {
107
+ isRepo: true,
108
+ isDirty,
109
+ unpushedCount,
110
+ behindCount,
111
+ statusOutput: status
112
+ };
113
+ } catch (e) {
114
+ return { isRepo: true, isDirty: false, unpushedCount: 0, behindCount: 0 };
115
+ }
116
+ };
117
+
118
+ const run = () => {
119
+ const gitStatus = getGitStatus();
120
+ if (!gitStatus.isRepo) return { ok: true };
121
+
122
+ const currentHash = getCurrentGitHash();
123
+ resetCounterIfCommitted(currentHash);
124
+
125
+ const issues = [];
126
+ if (gitStatus.isDirty) {
127
+ issues.push('Uncommitted changes exist');
128
+ }
129
+ if (gitStatus.unpushedCount > 0) {
130
+ issues.push(`${gitStatus.unpushedCount} commit(s) not pushed`);
131
+ }
132
+ if (gitStatus.unpushedCount === -1) {
133
+ issues.push('Unable to verify push status - may have unpushed commits');
134
+ }
135
+ if (gitStatus.behindCount > 0) {
136
+ issues.push(`${gitStatus.behindCount} upstream change(s) not pulled`);
137
+ }
138
+
139
+ if (issues.length > 0) {
140
+ const blockCount = incrementCounter(currentHash);
141
+ return {
142
+ ok: false,
143
+ reason: `Git: ${issues.join(', ')}, must push to remote`,
144
+ blockCount
145
+ };
146
+ }
147
+
148
+ const counter = readCounter();
149
+ if (counter.count > 0) {
150
+ counter.count = 0;
151
+ writeCounter(counter);
152
+ }
153
+
154
+ return { ok: true };
155
+ };
156
+
157
+ try {
158
+ const result = run();
159
+ if (!result.ok) {
160
+ if (result.blockCount === 1) {
161
+ console.log(JSON.stringify({
162
+ decision: 'block',
163
+ reason: `Git: ${result.reason} [First violation - blocks this session]`
164
+ }, null, 2));
165
+ process.exit(2);
166
+ } else if (result.blockCount > 1) {
167
+ console.log(JSON.stringify({
168
+ decision: 'approve',
169
+ reason: `⚠️ Git warning (attempt #${result.blockCount}): ${result.reason} - Please commit and push your changes.`
170
+ }, null, 2));
171
+ process.exit(0);
172
+ }
173
+ } else {
174
+ console.log(JSON.stringify({
175
+ decision: 'approve'
176
+ }, null, 2));
177
+ process.exit(0);
178
+ }
179
+ } catch (e) {
180
+ console.log(JSON.stringify({
181
+ decision: 'approve'
182
+ }, null, 2));
183
+ process.exit(0);
184
+ }
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Always use current working directory for .prd location
7
+ // Explicitly resolve to ./.prd in the current folder
8
+ const projectDir = process.cwd();
9
+ const prdFile = path.resolve(projectDir, '.prd');
10
+
11
+ let aborted = false;
12
+ process.on('SIGTERM', () => { aborted = true; });
13
+ process.on('SIGINT', () => { aborted = true; });
14
+
15
+ const run = () => {
16
+ if (aborted) return { ok: true };
17
+
18
+ try {
19
+ // Check if .prd file exists and has content
20
+ if (fs.existsSync(prdFile)) {
21
+ const prdContent = fs.readFileSync(prdFile, 'utf-8').trim();
22
+ if (prdContent.length > 0) {
23
+ // .prd has content, block stopping
24
+ return {
25
+ ok: false,
26
+ reason: `Work items remain in ${prdFile}. Remove completed items as they finish. Current items:\n\n${prdContent}`
27
+ };
28
+ }
29
+ }
30
+
31
+ // .prd doesn't exist or is empty, allow stop
32
+ return { ok: true };
33
+ } catch (error) {
34
+ return { ok: true };
35
+ }
36
+ };
37
+
38
+ try {
39
+ const result = run();
40
+
41
+ if (!result.ok) {
42
+ console.log(JSON.stringify({
43
+ decision: 'block',
44
+ reason: result.reason
45
+ }, null, 2));
46
+ process.exit(2);
47
+ }
48
+
49
+ console.log(JSON.stringify({
50
+ decision: 'approve'
51
+ }, null, 2));
52
+ process.exit(0);
53
+ } catch (e) {
54
+ console.log(JSON.stringify({
55
+ decision: 'approve'
56
+ }, null, 2));
57
+ process.exit(0);
58
+ }
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { execSync } = require('child_process');
6
+
7
+ const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT || process.env.GEMINI_PROJECT_DIR || process.env.OC_PLUGIN_ROOT;
8
+ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR;
9
+
10
+ const ensureGitignore = () => {
11
+ if (!projectDir) return;
12
+ const gitignorePath = path.join(projectDir, '.gitignore');
13
+ const entry = '.gm-stop-verified';
14
+ try {
15
+ let content = '';
16
+ if (fs.existsSync(gitignorePath)) {
17
+ content = fs.readFileSync(gitignorePath, 'utf-8');
18
+ }
19
+ if (!content.split('\n').some(line => line.trim() === entry)) {
20
+ const newContent = content.endsWith('\n') || content === ''
21
+ ? content + entry + '\n'
22
+ : content + '\n' + entry + '\n';
23
+ fs.writeFileSync(gitignorePath, newContent);
24
+ }
25
+ } catch (e) {
26
+ // Silently fail - not critical
27
+ }
28
+ };
29
+
30
+ ensureGitignore();
31
+
32
+ try {
33
+ let outputs = [];
34
+
35
+ // 1. Read ./start.md
36
+ if (pluginRoot) {
37
+ const startMdPath = path.join(pluginRoot, '/agents/gm.md');
38
+ try {
39
+ const startMdContent = fs.readFileSync(startMdPath, 'utf-8');
40
+ outputs.push(startMdContent);
41
+ } catch (e) {
42
+ // File may not exist in this context
43
+ }
44
+ }
45
+
46
+ // 2. Add semantic code-search explanation
47
+ const codeSearchContext = `## 🔍 Semantic Code Search Now Available
48
+
49
+ Your prompts will trigger **semantic code search** - intelligent, intent-based exploration of your codebase.
50
+
51
+ ### How It Works
52
+ Describe what you need in plain language, and the search understands your intent:
53
+ - "Find authentication validation" → locates auth checks, guards, permission logic
54
+ - "Where is database initialization?" → finds connection setup, migrations, schemas
55
+ - "Show error handling patterns" → discovers try/catch patterns, error boundaries
56
+
57
+ NOT syntax-based regex matching - truly semantic understanding across files.
58
+
59
+ ### Example
60
+ Instead of regex patterns, simply describe your intent:
61
+ "Find where API authorization is checked"
62
+
63
+ The search will find permission validations, role checks, authentication guards - however they're implemented.
64
+
65
+ ### When to Use Code Search
66
+ When exploring unfamiliar code, finding similar patterns, understanding integrations, or locating feature implementations across your codebase.`;
67
+ outputs.push(codeSearchContext);
68
+
69
+ // 3. Run mcp-thorns (bunx with npx fallback)
70
+ if (projectDir && fs.existsSync(projectDir)) {
71
+ try {
72
+ let thornOutput;
73
+ try {
74
+ thornOutput = execSync(`bunx mcp-thorns@latest`, {
75
+ encoding: 'utf-8',
76
+ stdio: ['pipe', 'pipe', 'pipe'],
77
+ cwd: projectDir,
78
+ timeout: 180000,
79
+ killSignal: 'SIGTERM'
80
+ });
81
+ } catch (bunErr) {
82
+ if (bunErr.killed && bunErr.signal === 'SIGTERM') {
83
+ thornOutput = '=== mcp-thorns ===\nSkipped (3min timeout)';
84
+ } else {
85
+ try {
86
+ thornOutput = execSync(`npx -y mcp-thorns@latest`, {
87
+ encoding: 'utf-8',
88
+ stdio: ['pipe', 'pipe', 'pipe'],
89
+ cwd: projectDir,
90
+ timeout: 180000,
91
+ killSignal: 'SIGTERM'
92
+ });
93
+ } catch (npxErr) {
94
+ if (npxErr.killed && npxErr.signal === 'SIGTERM') {
95
+ thornOutput = '=== mcp-thorns ===\nSkipped (3min timeout)';
96
+ } else {
97
+ thornOutput = `=== mcp-thorns ===\nSkipped (error: ${bunErr.message.split('\n')[0]})`;
98
+ }
99
+ }
100
+ }
101
+ }
102
+ outputs.push(`=== This is your initial insight of the repository, look at every possible aspect of this for initial opinionation and to offset the need for code exploration ===\n${thornOutput}`);
103
+ } catch (e) {
104
+ if (e.killed && e.signal === 'SIGTERM') {
105
+ outputs.push(`=== mcp-thorns ===\nSkipped (3min timeout)`);
106
+ } else {
107
+ outputs.push(`=== mcp-thorns ===\nSkipped (error: ${e.message.split('\n')[0]})`);
108
+ }
109
+ }
110
+ }
111
+ outputs.push('Use gm as a philosophy to coordinate all plans and the gm subagent to create and execute all plans');
112
+ const additionalContext = outputs.join('\n\n');
113
+
114
+ const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
115
+ const isOpenCode = process.env.OC_PLUGIN_ROOT !== undefined;
116
+
117
+ if (isGemini) {
118
+ const result = {
119
+ systemMessage: additionalContext
120
+ };
121
+ console.log(JSON.stringify(result, null, 2));
122
+ } else if (isOpenCode) {
123
+ const result = {
124
+ hookSpecificOutput: {
125
+ hookEventName: 'session.created',
126
+ additionalContext
127
+ }
128
+ };
129
+ console.log(JSON.stringify(result, null, 2));
130
+ } else {
131
+ const result = {
132
+ hookSpecificOutput: {
133
+ hookEventName: 'SessionStart',
134
+ additionalContext
135
+ }
136
+ };
137
+ console.log(JSON.stringify(result, null, 2));
138
+ }
139
+ } catch (error) {
140
+ const isGemini = process.env.GEMINI_PROJECT_DIR !== undefined;
141
+ const isOpenCode = process.env.OC_PLUGIN_ROOT !== undefined;
142
+
143
+ if (isGemini) {
144
+ console.log(JSON.stringify({
145
+ systemMessage: `Error executing hook: ${error.message}`
146
+ }, null, 2));
147
+ } else if (isOpenCode) {
148
+ console.log(JSON.stringify({
149
+ hookSpecificOutput: {
150
+ hookEventName: 'session.created',
151
+ additionalContext: `Error executing hook: ${error.message}`
152
+ }
153
+ }, null, 2));
154
+ } else {
155
+ console.log(JSON.stringify({
156
+ hookSpecificOutput: {
157
+ hookEventName: 'SessionStart',
158
+ additionalContext: `Error executing hook: ${error.message}`
159
+ }
160
+ }, null, 2));
161
+ }
162
+ process.exit(0);
163
+ }
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
package/manifest.yml ADDED
@@ -0,0 +1,51 @@
1
+ name: gm
2
+ version: 2.0.5
3
+ description: Advanced Claude Code plugin with WFGY integration, MCP tools, and automated hooks
4
+ author: AnEntrypoint
5
+
6
+ repository:
7
+ url: https://github.com/AnEntrypoint/gm-copilot-cli
8
+ type: git
9
+
10
+ license: MIT
11
+
12
+ keywords:
13
+ - ai
14
+ - state-machine
15
+ - agent
16
+
17
+ activation:
18
+ on_load: true
19
+ auto_activate: true
20
+
21
+ commands:
22
+ - name: gm:activate
23
+ description: Activate state machine
24
+ - name: gm:analyze
25
+ description: Analyze code
26
+ - name: gm:search
27
+ description: Semantic search
28
+ - name: gm:refactor
29
+ description: Refactor code
30
+
31
+ api:
32
+ version: 1.0.0
33
+ min_gh_version: 2.45.0
34
+
35
+ permissions:
36
+ - read:environment
37
+ - read:project
38
+ - write:project
39
+
40
+ configuration:
41
+ settings:
42
+ - name: enabled
43
+ type: boolean
44
+ default: true
45
+ - name: auto_activate
46
+ type: boolean
47
+ default: true
48
+ - name: log_level
49
+ type: string
50
+ enum: [debug, info, warn, error]
51
+ default: info