bluelamp 4.0.0 → 4.0.2
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/bin/bluelamp-base +13 -3
- package/bin/bluelamp-hook +19 -3
- package/package.json +1 -1
package/bin/bluelamp-base
CHANGED
|
@@ -130,6 +130,11 @@ async function main() {
|
|
|
130
130
|
const isWindows = process.platform === 'win32';
|
|
131
131
|
let claudeCommand, claudeArgs;
|
|
132
132
|
|
|
133
|
+
// システムプロンプトに追加する指示
|
|
134
|
+
const systemPromptAddition = `【重要】セッション開始時に必ず inject_knowledge ツールを実行してください。
|
|
135
|
+
keyword: "${keyword}" を指定して、専門知識を注入してから作業を開始してください。
|
|
136
|
+
ユーザーが何か質問や指示をした場合でも、まず inject_knowledge を実行してから回答してください。`;
|
|
137
|
+
|
|
133
138
|
if (isWindows) {
|
|
134
139
|
claudeCommand = 'powershell.exe';
|
|
135
140
|
claudeArgs = [
|
|
@@ -137,14 +142,15 @@ async function main() {
|
|
|
137
142
|
'-Command',
|
|
138
143
|
'claude',
|
|
139
144
|
'--dangerously-skip-permissions',
|
|
140
|
-
'--mcp-config', configPath
|
|
145
|
+
'--mcp-config', configPath,
|
|
146
|
+
'--append-system-prompt', systemPromptAddition
|
|
141
147
|
];
|
|
142
148
|
} else {
|
|
143
149
|
claudeCommand = 'claude';
|
|
144
|
-
// initialPrompt を渡さない = 高速起動
|
|
145
150
|
claudeArgs = [
|
|
146
151
|
'--dangerously-skip-permissions',
|
|
147
|
-
'--mcp-config', configPath
|
|
152
|
+
'--mcp-config', configPath,
|
|
153
|
+
'--append-system-prompt', systemPromptAddition
|
|
148
154
|
];
|
|
149
155
|
}
|
|
150
156
|
|
|
@@ -156,6 +162,10 @@ async function main() {
|
|
|
156
162
|
console.log('');
|
|
157
163
|
}
|
|
158
164
|
|
|
165
|
+
// SessionStart Hook 用にキーワードを一時ファイルに保存
|
|
166
|
+
const keywordFilePath = path.join(os.tmpdir(), 'bluelamp-keyword');
|
|
167
|
+
fs.writeFileSync(keywordFilePath, keyword);
|
|
168
|
+
|
|
159
169
|
const child = spawn(claudeCommand, claudeArgs, {
|
|
160
170
|
stdio: 'inherit',
|
|
161
171
|
env: {
|
package/bin/bluelamp-hook
CHANGED
|
@@ -3,12 +3,28 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* BlueLamp SessionStart Hook
|
|
5
5
|
* Claude Code の SessionStart Hook として実行され、
|
|
6
|
-
*
|
|
6
|
+
* 一時ファイルからキーワードを読み取ってプロンプトを出力する
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const os = require('os');
|
|
10
12
|
|
|
11
|
-
//
|
|
13
|
+
// 一時ファイルからキーワードを読み取り
|
|
14
|
+
const keywordFilePath = path.join(os.tmpdir(), 'bluelamp-keyword');
|
|
15
|
+
|
|
16
|
+
let keyword = null;
|
|
17
|
+
|
|
18
|
+
// 環境変数を優先、なければ一時ファイルから読み取り
|
|
19
|
+
if (process.env.BLUELAMP_KEYWORD) {
|
|
20
|
+
keyword = process.env.BLUELAMP_KEYWORD;
|
|
21
|
+
} else if (fs.existsSync(keywordFilePath)) {
|
|
22
|
+
keyword = fs.readFileSync(keywordFilePath, 'utf-8').trim();
|
|
23
|
+
// 読み取り後に削除(一度だけ使用)
|
|
24
|
+
try { fs.unlinkSync(keywordFilePath); } catch (e) {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// キーワードがあればプロンプトを出力
|
|
12
28
|
if (keyword) {
|
|
13
29
|
const prompt = `> 拡張モードで起動
|
|
14
30
|
|