bluelamp 4.0.0 → 4.0.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/bin/bluelamp-base +4 -0
- package/bin/bluelamp-hook +19 -3
- package/package.json +1 -1
package/bin/bluelamp-base
CHANGED
|
@@ -156,6 +156,10 @@ async function main() {
|
|
|
156
156
|
console.log('');
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
// SessionStart Hook 用にキーワードを一時ファイルに保存
|
|
160
|
+
const keywordFilePath = path.join(os.tmpdir(), 'bluelamp-keyword');
|
|
161
|
+
fs.writeFileSync(keywordFilePath, keyword);
|
|
162
|
+
|
|
159
163
|
const child = spawn(claudeCommand, claudeArgs, {
|
|
160
164
|
stdio: 'inherit',
|
|
161
165
|
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
|
|