@su-record/vibe 2.4.36 → 2.4.41

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.
Files changed (59) hide show
  1. package/README.md +26 -13
  2. package/dist/cli/auth.js +9 -9
  3. package/dist/cli/auth.js.map +1 -1
  4. package/dist/cli/collaborator.js +28 -28
  5. package/dist/cli/collaborator.js.map +1 -1
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +57 -54
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/llm.js +20 -20
  10. package/dist/cli/llm.js.map +1 -1
  11. package/dist/cli/setup.d.ts.map +1 -1
  12. package/dist/cli/setup.js +59 -44
  13. package/dist/cli/setup.js.map +1 -1
  14. package/dist/lib/gemini-api.d.ts +2 -2
  15. package/dist/lib/gemini-api.d.ts.map +1 -1
  16. package/dist/lib/gemini-api.js +9 -5
  17. package/dist/lib/gemini-api.js.map +1 -1
  18. package/dist/lib/gpt-api.d.ts +2 -2
  19. package/dist/lib/gpt-api.d.ts.map +1 -1
  20. package/dist/lib/gpt-api.js +12 -6
  21. package/dist/lib/gpt-api.js.map +1 -1
  22. package/dist/lib/utils.d.ts +15 -0
  23. package/dist/lib/utils.d.ts.map +1 -1
  24. package/dist/lib/utils.js +27 -0
  25. package/dist/lib/utils.js.map +1 -1
  26. package/dist/orchestrator/backgroundAgent.d.ts.map +1 -1
  27. package/dist/orchestrator/backgroundAgent.js +37 -1
  28. package/dist/orchestrator/backgroundAgent.js.map +1 -1
  29. package/dist/orchestrator/index.d.ts +112 -1
  30. package/dist/orchestrator/index.d.ts.map +1 -1
  31. package/dist/orchestrator/index.js +216 -0
  32. package/dist/orchestrator/index.js.map +1 -1
  33. package/dist/orchestrator/orchestrator.d.ts +115 -1
  34. package/dist/orchestrator/orchestrator.d.ts.map +1 -1
  35. package/dist/orchestrator/orchestrator.js +358 -1
  36. package/dist/orchestrator/orchestrator.js.map +1 -1
  37. package/dist/orchestrator/types.d.ts +42 -0
  38. package/dist/orchestrator/types.d.ts.map +1 -1
  39. package/dist/orchestrator/types.js +10 -1
  40. package/dist/orchestrator/types.js.map +1 -1
  41. package/hooks/hooks.json +29 -29
  42. package/hooks/scripts/code-check.js +22 -0
  43. package/hooks/scripts/code-review.js +22 -0
  44. package/hooks/scripts/complexity.js +22 -0
  45. package/hooks/scripts/compound.js +23 -0
  46. package/hooks/scripts/context-save.js +33 -0
  47. package/hooks/scripts/llm-orchestrate.js +64 -0
  48. package/hooks/scripts/recall.js +22 -0
  49. package/hooks/scripts/session-start.js +30 -0
  50. package/hooks/scripts/utils.js +40 -0
  51. package/package.json +1 -1
  52. package/dist/lib/gemini-mcp.d.ts +0 -10
  53. package/dist/lib/gemini-mcp.d.ts.map +0 -1
  54. package/dist/lib/gemini-mcp.js +0 -353
  55. package/dist/lib/gemini-mcp.js.map +0 -1
  56. package/dist/lib/gpt-mcp.d.ts +0 -10
  57. package/dist/lib/gpt-mcp.d.ts.map +0 -1
  58. package/dist/lib/gpt-mcp.js +0 -352
  59. package/dist/lib/gpt-mcp.js.map +0 -1
package/hooks/hooks.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "hooks": [
11
11
  {
12
12
  "type": "command",
13
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/';const p=process.env.CLAUDE_PROJECT_DIR||'.';Promise.all([import(B+'memory/index.js').then(t=>t.startSession({projectPath:p})),import(B+'time/index.js').then(t=>t.getCurrentTime({format:'human',timezone:'Asia/Seoul'})),import(B+'memory/index.js').then(t=>t.listMemories({limit:5,projectPath:p}))]).then(([s,t,m])=>console.log(s.content[0].text+'\\n\\n'+t.content[0].text+'\\n\\n[Recent Memories]\\n'+m.content[0].text)).catch(e=>console.log('[Session] Error:',e.message))\""
13
+ "command": "node {{VIBE_PATH}}/hooks/scripts/session-start.js"
14
14
  }
15
15
  ]
16
16
  }
@@ -32,7 +32,7 @@
32
32
  "hooks": [
33
33
  {
34
34
  "type": "command",
35
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/convention/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.validateCodeQuality({targetPath:'.',projectPath:p}).then(r=>console.log('[CODE CHECK]',r.content[0].text.split('\\n').slice(0,3).join(' | ')))).catch(()=>console.log('[AUTO-CONTINUE] Code written. Continue.'))\""
35
+ "command": "node {{VIBE_PATH}}/hooks/scripts/code-check.js"
36
36
  }
37
37
  ]
38
38
  }
@@ -61,7 +61,7 @@
61
61
  "hooks": [
62
62
  {
63
63
  "type": "command",
64
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/memory/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.saveMemory({key:'solution-'+Date.now(),value:'Solution documented at '+new Date().toISOString(),category:'solution',projectPath:p}).then(r=>console.log('[COMPOUND]',r.content[0].text))).catch(e=>console.log('[COMPOUND] \\u2717 Error:',e.message))\""
64
+ "command": "node {{VIBE_PATH}}/hooks/scripts/compound.js"
65
65
  }
66
66
  ]
67
67
  },
@@ -70,7 +70,7 @@
70
70
  "hooks": [
71
71
  {
72
72
  "type": "command",
73
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/convention/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.validateCodeQuality({targetPath:'.',projectPath:p}).then(r=>console.log('[CODE REVIEW]',r.content[0].text.split('\\n').slice(0,5).join(' | ')))).catch(e=>console.log('[CODE REVIEW] Error:',e.message))\""
73
+ "command": "node {{VIBE_PATH}}/hooks/scripts/code-review.js"
74
74
  }
75
75
  ]
76
76
  },
@@ -88,7 +88,7 @@
88
88
  "hooks": [
89
89
  {
90
90
  "type": "command",
91
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/convention/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.analyzeComplexity({targetPath:'.',projectPath:p}).then(r=>console.log('[COMPLEXITY]',r.content[0].text.split('\\n').slice(0,5).join(' | ')))).catch(e=>console.log('[COMPLEXITY] Error:',e.message))\""
91
+ "command": "node {{VIBE_PATH}}/hooks/scripts/complexity.js"
92
92
  }
93
93
  ]
94
94
  },
@@ -97,7 +97,7 @@
97
97
  "hooks": [
98
98
  {
99
99
  "type": "command",
100
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/memory/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.listMemories({limit:10,projectPath:p}).then(r=>console.log('[RECALL] \\u2713 Found '+r.content[0].text.split('\\n').length+' memories:',r.content[0].text.split('\\n').slice(0,7).join(' | ')))).catch(e=>console.log('[RECALL] Error:',e.message))\""
100
+ "command": "node {{VIBE_PATH}}/hooks/scripts/recall.js"
101
101
  }
102
102
  ]
103
103
  },
@@ -106,7 +106,7 @@
106
106
  "hooks": [
107
107
  {
108
108
  "type": "command",
109
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gpt-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt;import(V).then(g=>g.vibeGptOrchestrate(q,'You are a software architect. Analyze and review the architecture.',{jsonMode:false})).then(r=>console.log('[GPT Architecture] '+r)).catch(e=>console.log('[GPT] Error:',e.message))})\"",
109
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gpt orchestrate \"You are a software architect. Analyze and review the architecture.\"",
110
110
  "statusMessage": "GPT analyzing architecture..."
111
111
  }
112
112
  ]
@@ -116,68 +116,68 @@
116
116
  "hooks": [
117
117
  {
118
118
  "type": "command",
119
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gemini-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt;import(V).then(g=>g.vibeGeminiOrchestrate(q,'You are a UI/UX expert. Analyze and provide feedback.',{jsonMode:false})).then(r=>console.log('[Gemini UI/UX] '+r)).catch(e=>console.log('[Gemini] Error:',e.message))})\"",
119
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gemini orchestrate \"You are a UI/UX expert. Analyze and provide feedback.\"",
120
120
  "statusMessage": "Gemini reviewing UI/UX..."
121
121
  }
122
122
  ]
123
123
  },
124
124
  {
125
- "matcher": "^(gpt[-.\\s]|지피티-)",
125
+ "matcher": "디버깅|debugging|버그.*찾|find.*bug|debug.*this",
126
126
  "hooks": [
127
127
  {
128
128
  "type": "command",
129
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gpt-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt.replace(/^(gpt[-.\\s]|지피티-)\\s*/i,'').trim();import(V).then(g=>g.quickWebSearch(q)).then(r=>console.log('GPT-5.2 응답: '+r)).catch(e=>console.log('[GPT] Error:',e.message))})\"",
130
- "statusMessage": "Asking GPT (with web search)..."
129
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gpt orchestrate \"You are a debugging expert. Find bugs and suggest fixes.\"",
130
+ "statusMessage": "GPT debugging..."
131
131
  }
132
132
  ]
133
133
  },
134
134
  {
135
- "matcher": "^vibe-gpt-",
135
+ "matcher": "코드.*분석|analyze.*code|code.*review",
136
136
  "hooks": [
137
137
  {
138
138
  "type": "command",
139
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gpt-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt.replace(/^vibe-gpt-\\s*/i,'').trim();import(V).then(g=>g.vibeGptOrchestrate(q,'You are a Vibe orchestrator. Process the request and output structured JSON.',{jsonMode:true})).then(r=>console.log('[vibe-gpt] '+r)).catch(e=>console.log('[vibe-gpt] Error:',e.message))})\"",
140
- "statusMessage": "Vibe GPT orchestrating (no search)..."
139
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gemini orchestrate \"You are a code analysis expert. Review and analyze the code.\"",
140
+ "statusMessage": "Gemini analyzing code..."
141
141
  }
142
142
  ]
143
143
  },
144
144
  {
145
- "matcher": "^(gemini[-.\\s]|제미나이-)",
145
+ "matcher": "^(gpt[-.\\s]|지피티-)",
146
146
  "hooks": [
147
147
  {
148
148
  "type": "command",
149
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gemini-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt.replace(/^(gemini[-.\\s]|제미나이-)\\s*/i,'').trim();import(V).then(g=>g.quickWebSearch(q)).then(r=>console.log('Gemini-3 응답: '+r)).catch(e=>console.log('[Gemini] Error:',e.message))})\"",
150
- "statusMessage": "Asking Gemini (with web search)..."
149
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gpt search",
150
+ "statusMessage": "Asking GPT (with web search)..."
151
151
  }
152
152
  ]
153
153
  },
154
154
  {
155
- "matcher": "^vibe-gemini-",
155
+ "matcher": "^vibe-gpt-",
156
156
  "hooks": [
157
157
  {
158
158
  "type": "command",
159
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gemini-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt.replace(/^vibe-gemini-\\s*/i,'').trim();import(V).then(g=>g.vibeGeminiOrchestrate(q,'You are a Vibe orchestrator. Process the request and output structured JSON.',{jsonMode:true})).then(r=>console.log('[vibe-gemini] '+r)).catch(e=>console.log('[vibe-gemini] Error:',e.message))})\"",
160
- "statusMessage": "Vibe Gemini orchestrating (no search)..."
159
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gpt orchestrate-json \"You are a Vibe orchestrator. Process the request and output structured JSON.\"",
160
+ "statusMessage": "Vibe GPT orchestrating (no search)..."
161
161
  }
162
162
  ]
163
163
  },
164
164
  {
165
- "matcher": "디버깅|debugging|버그.*찾|find.*bug|debug.*this",
165
+ "matcher": "^(gemini[-.\\s]|제미나이-)",
166
166
  "hooks": [
167
167
  {
168
168
  "type": "command",
169
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gpt-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt;import(V).then(g=>g.vibeGptOrchestrate(q,'You are a debugging expert. Find bugs and suggest fixes.',{jsonMode:false})).then(r=>console.log('[GPT Debug] '+r)).catch(e=>console.log('[GPT] Error:',e.message))})\"",
170
- "statusMessage": "GPT debugging..."
169
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gemini search",
170
+ "statusMessage": "Asking Gemini (with web search)..."
171
171
  }
172
172
  ]
173
173
  },
174
174
  {
175
- "matcher": "코드.*분석|analyze.*code|code.*review",
175
+ "matcher": "^vibe-gemini-",
176
176
  "hooks": [
177
177
  {
178
178
  "type": "command",
179
- "command": "node -e \"const V='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/lib/gemini-api.js';let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const q=JSON.parse(d).prompt;import(V).then(g=>g.vibeGeminiOrchestrate(q,'You are a code analysis expert. Review and analyze the code.',{jsonMode:false})).then(r=>console.log('[Gemini Code] '+r)).catch(e=>console.log('[Gemini] Error:',e.message))})\"",
180
- "statusMessage": "Gemini analyzing code..."
179
+ "command": "node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gemini orchestrate-json \"You are a Vibe orchestrator. Process the request and output structured JSON.\"",
180
+ "statusMessage": "Vibe Gemini orchestrating (no search)..."
181
181
  }
182
182
  ]
183
183
  }
@@ -188,7 +188,7 @@
188
188
  "hooks": [
189
189
  {
190
190
  "type": "command",
191
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/memory/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.autoSaveContext({urgency:'medium',contextType:'progress',summary:'Context at 80% - auto checkpoint',projectPath:p}).then(r=>console.log('[CONTEXT 80%]',r.content[0].text))).catch(()=>{})\""
191
+ "command": "node {{VIBE_PATH}}/hooks/scripts/context-save.js medium"
192
192
  }
193
193
  ]
194
194
  },
@@ -197,7 +197,7 @@
197
197
  "hooks": [
198
198
  {
199
199
  "type": "command",
200
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/memory/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.autoSaveContext({urgency:'high',contextType:'progress',summary:'Context at 90% - save before overflow',projectPath:p}).then(r=>console.log('[CONTEXT 90%]',r.content[0].text))).catch(()=>{})\""
200
+ "command": "node {{VIBE_PATH}}/hooks/scripts/context-save.js high"
201
201
  }
202
202
  ]
203
203
  },
@@ -206,7 +206,7 @@
206
206
  "hooks": [
207
207
  {
208
208
  "type": "command",
209
- "command": "node -e \"const B='file:///{{VIBE_PATH}}/node_modules/@su-record/vibe/dist/tools/memory/index.js';const p=process.env.CLAUDE_PROJECT_DIR||'.';import(B).then(t=>t.autoSaveContext({urgency:'critical',contextType:'progress',summary:'Context at 95% - CRITICAL save before session end',projectPath:p}).then(r=>console.log('[CONTEXT 95%]',r.content[0].text))).catch(()=>{})\""
209
+ "command": "node {{VIBE_PATH}}/hooks/scripts/context-save.js critical"
210
210
  }
211
211
  ]
212
212
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * PostToolUse Hook - Write/Edit 후 코드 품질 검사
3
+ */
4
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
5
+
6
+ const BASE_URL = getToolsBaseUrl();
7
+
8
+ async function main() {
9
+ try {
10
+ const module = await import(`${BASE_URL}convention/index.js`);
11
+ const result = await module.validateCodeQuality({
12
+ targetPath: '.',
13
+ projectPath: PROJECT_DIR,
14
+ });
15
+ const lines = result.content[0].text.split('\n').slice(0, 3).join(' | ');
16
+ console.log('[CODE CHECK]', lines);
17
+ } catch {
18
+ console.log('[AUTO-CONTINUE] Code written. Continue.');
19
+ }
20
+ }
21
+
22
+ main();
@@ -0,0 +1,22 @@
1
+ /**
2
+ * UserPromptSubmit Hook - 코드 리뷰 요청 시 품질 검사
3
+ */
4
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
5
+
6
+ const BASE_URL = getToolsBaseUrl();
7
+
8
+ async function main() {
9
+ try {
10
+ const module = await import(`${BASE_URL}convention/index.js`);
11
+ const result = await module.validateCodeQuality({
12
+ targetPath: '.',
13
+ projectPath: PROJECT_DIR,
14
+ });
15
+ const lines = result.content[0].text.split('\n').slice(0, 5).join(' | ');
16
+ console.log('[CODE REVIEW]', lines);
17
+ } catch (e) {
18
+ console.log('[CODE REVIEW] Error:', e.message);
19
+ }
20
+ }
21
+
22
+ main();
@@ -0,0 +1,22 @@
1
+ /**
2
+ * UserPromptSubmit Hook - 복잡도 분석
3
+ */
4
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
5
+
6
+ const BASE_URL = getToolsBaseUrl();
7
+
8
+ async function main() {
9
+ try {
10
+ const module = await import(`${BASE_URL}convention/index.js`);
11
+ const result = await module.analyzeComplexity({
12
+ targetPath: '.',
13
+ projectPath: PROJECT_DIR,
14
+ });
15
+ const lines = result.content[0].text.split('\n').slice(0, 5).join(' | ');
16
+ console.log('[COMPLEXITY]', lines);
17
+ } catch (e) {
18
+ console.log('[COMPLEXITY] Error:', e.message);
19
+ }
20
+ }
21
+
22
+ main();
@@ -0,0 +1,23 @@
1
+ /**
2
+ * UserPromptSubmit Hook - 버그 해결/PR 머지 시 솔루션 저장
3
+ */
4
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
5
+
6
+ const BASE_URL = getToolsBaseUrl();
7
+
8
+ async function main() {
9
+ try {
10
+ const module = await import(`${BASE_URL}memory/index.js`);
11
+ const result = await module.saveMemory({
12
+ key: `solution-${Date.now()}`,
13
+ value: `Solution documented at ${new Date().toISOString()}`,
14
+ category: 'solution',
15
+ projectPath: PROJECT_DIR,
16
+ });
17
+ console.log('[COMPOUND]', result.content[0].text);
18
+ } catch (e) {
19
+ console.log('[COMPOUND] ✗ Error:', e.message);
20
+ }
21
+ }
22
+
23
+ main();
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Notification Hook - 컨텍스트 자동 저장 (80/90/95%)
3
+ * Usage: node context-save.js <urgency>
4
+ * urgency: medium | high | critical
5
+ */
6
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
7
+
8
+ const BASE_URL = getToolsBaseUrl();
9
+
10
+ const urgency = process.argv[2] || 'medium';
11
+ const summaryMap = {
12
+ medium: 'Context at 80% - auto checkpoint',
13
+ high: 'Context at 90% - save before overflow',
14
+ critical: 'Context at 95% - CRITICAL save before session end',
15
+ };
16
+
17
+ async function main() {
18
+ try {
19
+ const module = await import(`${BASE_URL}memory/index.js`);
20
+ const result = await module.autoSaveContext({
21
+ urgency,
22
+ contextType: 'progress',
23
+ summary: summaryMap[urgency] || summaryMap.medium,
24
+ projectPath: PROJECT_DIR,
25
+ });
26
+ const percent = urgency === 'critical' ? '95' : urgency === 'high' ? '90' : '80';
27
+ console.log(`[CONTEXT ${percent}%]`, result.content[0].text);
28
+ } catch {
29
+ // 무시
30
+ }
31
+ }
32
+
33
+ main();
@@ -0,0 +1,64 @@
1
+ /**
2
+ * UserPromptSubmit Hook - LLM 오케스트레이션 (GPT/Gemini)
3
+ *
4
+ * Usage: node llm-orchestrate.js <provider> <mode> <systemPrompt>
5
+ * provider: gpt | gemini
6
+ * mode: search | orchestrate | orchestrate-json
7
+ * systemPrompt: (optional) custom system prompt for orchestrate mode
8
+ *
9
+ * Input: JSON from stdin with { prompt: string }
10
+ */
11
+ import { getLibBaseUrl } from './utils.js';
12
+
13
+ const LIB_URL = getLibBaseUrl();
14
+
15
+ const provider = process.argv[2] || 'gemini';
16
+ const mode = process.argv[3] || 'search';
17
+ const systemPrompt = process.argv[4] || 'You are a helpful assistant.';
18
+
19
+ async function main() {
20
+ // stdin에서 JSON 읽기
21
+ let inputData = '';
22
+ for await (const chunk of process.stdin) {
23
+ inputData += chunk;
24
+ }
25
+
26
+ let prompt;
27
+ try {
28
+ const parsed = JSON.parse(inputData);
29
+ prompt = parsed.prompt;
30
+ } catch {
31
+ console.log(`[${provider.toUpperCase()}] Error: Invalid JSON input`);
32
+ return;
33
+ }
34
+
35
+ // 접두사 제거
36
+ const prefixPatterns = {
37
+ gpt: /^(gpt[-.\s]|지피티-|vibe-gpt-)\s*/i,
38
+ gemini: /^(gemini[-.\s]|제미나이-|vibe-gemini-)\s*/i,
39
+ };
40
+ const cleanPrompt = prompt.replace(prefixPatterns[provider] || /^/, '').trim();
41
+
42
+ try {
43
+ const modulePath = `${LIB_URL}${provider}-api.js`;
44
+ const module = await import(modulePath);
45
+
46
+ let result;
47
+ if (mode === 'search') {
48
+ result = await module.quickWebSearch(cleanPrompt);
49
+ const label = provider === 'gpt' ? 'GPT-5.2' : 'Gemini-3';
50
+ console.log(`${label} 응답: ${result}`);
51
+ } else {
52
+ const jsonMode = mode === 'orchestrate-json';
53
+ const orchestrateFn = provider === 'gpt'
54
+ ? module.vibeGptOrchestrate
55
+ : module.vibeGeminiOrchestrate;
56
+ result = await orchestrateFn(cleanPrompt, systemPrompt, { jsonMode });
57
+ console.log(`[vibe-${provider}] ${result}`);
58
+ }
59
+ } catch (e) {
60
+ console.log(`[${provider.toUpperCase()}] Error: ${e.message}`);
61
+ }
62
+ }
63
+
64
+ main();
@@ -0,0 +1,22 @@
1
+ /**
2
+ * UserPromptSubmit Hook - 메모리 검색
3
+ */
4
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
5
+
6
+ const BASE_URL = getToolsBaseUrl();
7
+
8
+ async function main() {
9
+ try {
10
+ const module = await import(`${BASE_URL}memory/index.js`);
11
+ const result = await module.listMemories({
12
+ limit: 10,
13
+ projectPath: PROJECT_DIR,
14
+ });
15
+ const lines = result.content[0].text.split('\n');
16
+ console.log(`[RECALL] ✓ Found ${lines.length} memories:`, lines.slice(0, 7).join(' | '));
17
+ } catch (e) {
18
+ console.log('[RECALL] Error:', e.message);
19
+ }
20
+ }
21
+
22
+ main();
@@ -0,0 +1,30 @@
1
+ /**
2
+ * SessionStart Hook - 세션 시작 시 메모리/시간 로드
3
+ */
4
+ import { getToolsBaseUrl, PROJECT_DIR } from './utils.js';
5
+
6
+ const BASE_URL = getToolsBaseUrl();
7
+
8
+ async function main() {
9
+ try {
10
+ const [memoryModule, timeModule] = await Promise.all([
11
+ import(`${BASE_URL}memory/index.js`),
12
+ import(`${BASE_URL}time/index.js`),
13
+ ]);
14
+
15
+ const [session, time, memories] = await Promise.all([
16
+ memoryModule.startSession({ projectPath: PROJECT_DIR }),
17
+ timeModule.getCurrentTime({ format: 'human', timezone: 'Asia/Seoul' }),
18
+ memoryModule.listMemories({ limit: 5, projectPath: PROJECT_DIR }),
19
+ ]);
20
+
21
+ console.log(session.content[0].text);
22
+ console.log('\n' + time.content[0].text);
23
+ console.log('\n[Recent Memories]');
24
+ console.log(memories.content[0].text);
25
+ } catch (e) {
26
+ console.log('[Session] Error:', e.message);
27
+ }
28
+ }
29
+
30
+ main();
@@ -0,0 +1,40 @@
1
+ /**
2
+ * 훅 스크립트 공통 유틸리티
3
+ */
4
+ import fs from 'fs';
5
+ import path from 'path';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ // 스크립트 위치에서 VIBE_PATH 자동 감지
9
+ // hooks/scripts/utils.js → hooks → VIBE_PATH
10
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
+ const DETECTED_VIBE_PATH = path.resolve(__dirname, '..', '..');
12
+
13
+ export const VIBE_PATH = process.env.VIBE_PATH || DETECTED_VIBE_PATH;
14
+ export const PROJECT_DIR = process.env.CLAUDE_PROJECT_DIR || '.';
15
+
16
+ /**
17
+ * 로컬 개발 환경 vs 설치된 패키지 환경 자동 감지하여 tools 경로 반환
18
+ */
19
+ export function getToolsBaseUrl() {
20
+ const localDist = path.join(VIBE_PATH, 'dist', 'tools');
21
+ const packageDist = path.join(VIBE_PATH, 'node_modules', '@su-record', 'vibe', 'dist', 'tools');
22
+
23
+ if (fs.existsSync(localDist)) {
24
+ return `file:///${localDist.replace(/\\/g, '/')}/`;
25
+ }
26
+ return `file:///${packageDist.replace(/\\/g, '/')}/`;
27
+ }
28
+
29
+ /**
30
+ * lib 경로 반환 (gpt-api, gemini-api 등)
31
+ */
32
+ export function getLibBaseUrl() {
33
+ const localDist = path.join(VIBE_PATH, 'dist', 'lib');
34
+ const packageDist = path.join(VIBE_PATH, 'node_modules', '@su-record', 'vibe', 'dist', 'lib');
35
+
36
+ if (fs.existsSync(localDist)) {
37
+ return `file:///${localDist.replace(/\\/g, '/')}/`;
38
+ }
39
+ return `file:///${packageDist.replace(/\\/g, '/')}/`;
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@su-record/vibe",
3
- "version": "2.4.36",
3
+ "version": "2.4.41",
4
4
  "description": "Vibe - Claude Code exclusive SPEC-driven AI coding framework with 35+ integrated tools",
5
5
  "type": "module",
6
6
  "main": "dist/cli/index.js",
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * vibe-gemini MCP Server
4
- * Gemini API를 MCP 도구로 제공하여 Claude Code에서 서브에이전트로 활용
5
- *
6
- * 사용법:
7
- * claude mcp add vibe-gemini node /path/to/vibe/dist/lib/gemini-mcp.js -s user
8
- */
9
- export {};
10
- //# sourceMappingURL=gemini-mcp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gemini-mcp.d.ts","sourceRoot":"","sources":["../../src/lib/gemini-mcp.ts"],"names":[],"mappings":";AACA;;;;;;GAMG"}