bluelamp 4.0.5 → 4.0.6
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-vscode-base +258 -0
- package/bin/bluelamp-vscode1 +2 -0
- package/bin/bluelamp-vscode10 +2 -0
- package/bin/bluelamp-vscode11 +2 -0
- package/bin/bluelamp-vscode12 +2 -0
- package/bin/bluelamp-vscode13 +2 -0
- package/bin/bluelamp-vscode14 +2 -0
- package/bin/bluelamp-vscode15 +2 -0
- package/bin/bluelamp-vscode16 +2 -0
- package/bin/bluelamp-vscode17 +2 -0
- package/bin/bluelamp-vscode18 +2 -0
- package/bin/bluelamp-vscode2 +2 -0
- package/bin/bluelamp-vscode3 +2 -0
- package/bin/bluelamp-vscode4 +2 -0
- package/bin/bluelamp-vscode5 +2 -0
- package/bin/bluelamp-vscode6 +2 -0
- package/bin/bluelamp-vscode7 +2 -0
- package/bin/bluelamp-vscode8 +2 -0
- package/bin/bluelamp-vscode9 +2 -0
- package/lib/auth/PortalAuthClient.js +1 -1
- package/lib/mcp-server/index.cjs +57 -25
- package/lib/mcp-server/portal-api-client.cjs +37 -10
- package/lib/utils/logger.js +83 -0
- package/package.json +33 -25
- package/scripts/generate-commands.js +10 -15
- package/bin/bluelamp-base +0 -200
- package/bin/bluelamp-hook +0 -49
- package/bin/bluelamp1 +0 -2
- package/bin/bluelamp10 +0 -2
- package/bin/bluelamp11 +0 -2
- package/bin/bluelamp12 +0 -2
- package/bin/bluelamp13 +0 -2
- package/bin/bluelamp14 +0 -2
- package/bin/bluelamp15 +0 -2
- package/bin/bluelamp16 +0 -2
- package/bin/bluelamp17 +0 -2
- package/bin/bluelamp18 +0 -2
- package/bin/bluelamp2 +0 -2
- package/bin/bluelamp3 +0 -2
- package/bin/bluelamp4 +0 -2
- package/bin/bluelamp5 +0 -2
- package/bin/bluelamp6 +0 -2
- package/bin/bluelamp7 +0 -2
- package/bin/bluelamp8 +0 -2
- package/bin/bluelamp9 +0 -2
- package/lib/mcp-server/fetch-prompt.js +0 -61
- package/scripts/setup-hook.js +0 -98
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BlueLamp VSCode Logger
|
|
3
|
+
* 環境変数ベースのログレベル制御
|
|
4
|
+
*
|
|
5
|
+
* @module logger
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const LOG_LEVELS = {
|
|
9
|
+
debug: 0,
|
|
10
|
+
info: 1,
|
|
11
|
+
warn: 2,
|
|
12
|
+
error: 3,
|
|
13
|
+
silent: 4
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const LOG_LEVEL = process.env.BLUELAMP_LOG_LEVEL || 'info';
|
|
17
|
+
const currentLevel = LOG_LEVELS[LOG_LEVEL] ?? LOG_LEVELS.info;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* タイムスタンプ付きログメッセージを生成
|
|
21
|
+
* @param {string} level - ログレベル
|
|
22
|
+
* @param {string} message - メッセージ
|
|
23
|
+
* @returns {string} フォーマット済みメッセージ
|
|
24
|
+
*/
|
|
25
|
+
function formatMessage(level, message) {
|
|
26
|
+
const timestamp = new Date().toISOString();
|
|
27
|
+
return `[${timestamp}] [${level.toUpperCase()}] ${message}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ログ出力関数
|
|
32
|
+
*/
|
|
33
|
+
const logger = {
|
|
34
|
+
/**
|
|
35
|
+
* デバッグログ
|
|
36
|
+
* @param {string} message - メッセージ
|
|
37
|
+
*/
|
|
38
|
+
debug(message) {
|
|
39
|
+
if (currentLevel <= LOG_LEVELS.debug) {
|
|
40
|
+
console.error(formatMessage('debug', message));
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 情報ログ
|
|
46
|
+
* @param {string} message - メッセージ
|
|
47
|
+
*/
|
|
48
|
+
info(message) {
|
|
49
|
+
if (currentLevel <= LOG_LEVELS.info) {
|
|
50
|
+
console.error(formatMessage('info', message));
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 警告ログ
|
|
56
|
+
* @param {string} message - メッセージ
|
|
57
|
+
*/
|
|
58
|
+
warn(message) {
|
|
59
|
+
if (currentLevel <= LOG_LEVELS.warn) {
|
|
60
|
+
console.warn(formatMessage('warn', message));
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* エラーログ
|
|
66
|
+
* @param {string} message - メッセージ
|
|
67
|
+
*/
|
|
68
|
+
error(message) {
|
|
69
|
+
if (currentLevel <= LOG_LEVELS.error) {
|
|
70
|
+
console.error(formatMessage('error', message));
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* ログレベルを取得
|
|
76
|
+
* @returns {string} 現在のログレベル
|
|
77
|
+
*/
|
|
78
|
+
getLevel() {
|
|
79
|
+
return LOG_LEVEL;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
module.exports = { logger, LOG_LEVELS };
|
package/package.json
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bluelamp",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "BlueLamp MCP Integration -
|
|
3
|
+
"version": "4.0.6",
|
|
4
|
+
"description": "BlueLamp VSCode Extension MCP Integration - 18 Development Prompts",
|
|
5
5
|
"main": "lib/mcp-server/index.cjs",
|
|
6
6
|
"bin": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"bluelamp-hook": "./bin/bluelamp-hook"
|
|
7
|
+
"bluelamp-vscode1": "./bin/bluelamp-vscode1",
|
|
8
|
+
"bluelamp-vscode2": "./bin/bluelamp-vscode2",
|
|
9
|
+
"bluelamp-vscode3": "./bin/bluelamp-vscode3",
|
|
10
|
+
"bluelamp-vscode4": "./bin/bluelamp-vscode4",
|
|
11
|
+
"bluelamp-vscode5": "./bin/bluelamp-vscode5",
|
|
12
|
+
"bluelamp-vscode6": "./bin/bluelamp-vscode6",
|
|
13
|
+
"bluelamp-vscode7": "./bin/bluelamp-vscode7",
|
|
14
|
+
"bluelamp-vscode8": "./bin/bluelamp-vscode8",
|
|
15
|
+
"bluelamp-vscode9": "./bin/bluelamp-vscode9",
|
|
16
|
+
"bluelamp-vscode10": "./bin/bluelamp-vscode10",
|
|
17
|
+
"bluelamp-vscode11": "./bin/bluelamp-vscode11",
|
|
18
|
+
"bluelamp-vscode12": "./bin/bluelamp-vscode12",
|
|
19
|
+
"bluelamp-vscode13": "./bin/bluelamp-vscode13",
|
|
20
|
+
"bluelamp-vscode14": "./bin/bluelamp-vscode14",
|
|
21
|
+
"bluelamp-vscode15": "./bin/bluelamp-vscode15",
|
|
22
|
+
"bluelamp-vscode16": "./bin/bluelamp-vscode16",
|
|
23
|
+
"bluelamp-vscode17": "./bin/bluelamp-vscode17",
|
|
24
|
+
"bluelamp-vscode18": "./bin/bluelamp-vscode18"
|
|
26
25
|
},
|
|
27
26
|
"scripts": {
|
|
28
|
-
"postinstall": "node scripts/generate-commands.js
|
|
29
|
-
"test": "
|
|
27
|
+
"postinstall": "node scripts/generate-commands.js",
|
|
28
|
+
"test": "jest",
|
|
29
|
+
"test:coverage": "jest --coverage",
|
|
30
|
+
"test:mcp": "node test-mcp.js",
|
|
31
|
+
"build:release": "node scripts/build-release.js"
|
|
30
32
|
},
|
|
31
33
|
"keywords": [
|
|
34
|
+
"vscode",
|
|
32
35
|
"bluelamp",
|
|
33
36
|
"mcp",
|
|
34
37
|
"claude",
|
|
35
38
|
"knowledge-injection",
|
|
36
|
-
"
|
|
39
|
+
"development-prompts"
|
|
37
40
|
],
|
|
38
41
|
"author": "BlueLamp Team",
|
|
39
42
|
"license": "MIT",
|
|
@@ -55,6 +58,11 @@
|
|
|
55
58
|
"preferGlobal": true,
|
|
56
59
|
"repository": {
|
|
57
60
|
"type": "git",
|
|
58
|
-
"url": "https://github.com/bluelamp/bluelamp.git"
|
|
61
|
+
"url": "https://github.com/bluelamp/bluelamp-vscode.git"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"javascript-obfuscator": "^4.1.1",
|
|
65
|
+
"jest": "^30.2.0",
|
|
66
|
+
"terser": "^5.44.0"
|
|
59
67
|
}
|
|
60
68
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* BlueLamp コマンド生成スクリプト
|
|
5
|
-
*
|
|
4
|
+
* BlueLamp VSCode コマンド生成スクリプト
|
|
5
|
+
* 16個のコマンドファイルを自動生成
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('path');
|
|
10
10
|
|
|
11
11
|
const binDir = path.join(__dirname, '..', 'bin');
|
|
12
|
-
const baseScript = path.join(binDir, 'bluelamp-base');
|
|
13
|
-
const hookScript = path.join(binDir, 'bluelamp-hook');
|
|
12
|
+
const baseScript = path.join(binDir, 'bluelamp-vscode-base');
|
|
14
13
|
|
|
15
|
-
//
|
|
16
|
-
for (let i = 1; i <=
|
|
17
|
-
const commandName = `bluelamp${i}`;
|
|
14
|
+
// 16個のコマンドを生成
|
|
15
|
+
for (let i = 1; i <= 16; i++) {
|
|
16
|
+
const commandName = `bluelamp-vscode${i}`;
|
|
18
17
|
const commandPath = path.join(binDir, commandName);
|
|
19
18
|
|
|
19
|
+
// シンボリックリンクまたはラッパースクリプトを作成
|
|
20
20
|
const content = `#!/usr/bin/env node
|
|
21
|
-
require('./bluelamp-base');
|
|
21
|
+
require('./bluelamp-vscode-base');
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
24
|
fs.writeFileSync(commandPath, content);
|
|
@@ -27,14 +27,9 @@ require('./bluelamp-base');
|
|
|
27
27
|
console.log(`✅ Created: ${commandName}`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// ベーススクリプトにも実行権限を付与
|
|
31
31
|
if (fs.existsSync(baseScript)) {
|
|
32
32
|
fs.chmodSync(baseScript, '755');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
if (fs.existsSync(hookScript)) {
|
|
37
|
-
fs.chmodSync(hookScript, '755');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
console.log('\n✨ 18個のコマンドファイルを生成しました');
|
|
35
|
+
console.log('\n✨ 16個のコマンドファイルを生成しました');
|
package/bin/bluelamp-base
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* BlueLamp MCP Integration
|
|
5
|
-
* Fast startup with short initial prompt
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const { spawn } = require('child_process');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
const fs = require('fs');
|
|
11
|
-
const os = require('os');
|
|
12
|
-
|
|
13
|
-
// パッケージのルートディレクトリを取得
|
|
14
|
-
const packageRoot = path.dirname(__dirname);
|
|
15
|
-
|
|
16
|
-
// .envファイルを読み込み(.env.localを優先)
|
|
17
|
-
const dotenvLocalPath = path.join(packageRoot, '.env.local');
|
|
18
|
-
const dotenvPath = path.join(packageRoot, '.env');
|
|
19
|
-
|
|
20
|
-
if (fs.existsSync(dotenvLocalPath)) {
|
|
21
|
-
require('dotenv').config({ path: dotenvLocalPath });
|
|
22
|
-
} else if (fs.existsSync(dotenvPath)) {
|
|
23
|
-
require('dotenv').config({ path: dotenvPath });
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// コマンドマッピング(18個のプロンプト - BlueLamp 18エージェント体制)
|
|
27
|
-
const PROMPT_MAPPING = {
|
|
28
|
-
'bluelamp1': '@要件定義',
|
|
29
|
-
'bluelamp2': '@Git管理',
|
|
30
|
-
'bluelamp3': '@フロントエンド基盤',
|
|
31
|
-
'bluelamp4': '@ページ実装オーケストレーター',
|
|
32
|
-
'bluelamp5': '@環境構築オーケストレーター',
|
|
33
|
-
'bluelamp6': '@バックエンド計画オーケストレーター',
|
|
34
|
-
'bluelamp7': '@バックエンド実装オーケストレーター',
|
|
35
|
-
'bluelamp8': '@フロントエンド実装オーケストレーター',
|
|
36
|
-
'bluelamp9': '@E2Eテストオーケストレーター',
|
|
37
|
-
'bluelamp10': '@本番運用診断オーケストレーター',
|
|
38
|
-
'bluelamp11': '@デプロイオーケストレーター',
|
|
39
|
-
'bluelamp12': '@拡張要件定義',
|
|
40
|
-
'bluelamp13': '@拡張機能実装',
|
|
41
|
-
'bluelamp14': '@デバッグ技術',
|
|
42
|
-
'bluelamp15': '@リファクタリング',
|
|
43
|
-
'bluelamp16': '@ドキュメント生成',
|
|
44
|
-
'bluelamp17': '@相談',
|
|
45
|
-
'bluelamp18': '@MCP追加'
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* コマンド名から対応するキーワードを取得
|
|
50
|
-
*/
|
|
51
|
-
function getKeywordFromCommand() {
|
|
52
|
-
const commandPath = process.argv[1];
|
|
53
|
-
const commandName = path.basename(commandPath);
|
|
54
|
-
|
|
55
|
-
if (!PROMPT_MAPPING[commandName]) {
|
|
56
|
-
console.error(`❌ 未定義のコマンド: ${commandName}`);
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return PROMPT_MAPPING[commandName];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* MCPサーバー設定を作成
|
|
65
|
-
*/
|
|
66
|
-
function createMCPConfig(keyword, cliToken) {
|
|
67
|
-
const mcpServerPath = path.join(packageRoot, 'lib/mcp-server/index.cjs');
|
|
68
|
-
const tempConfigPath = path.join(os.tmpdir(), `bluelamp-${Date.now()}.json`);
|
|
69
|
-
|
|
70
|
-
const portalUrl = process.env.PORTAL_URL || "https://bluelamp-6clpzmy5pa-an.a.run.app";
|
|
71
|
-
|
|
72
|
-
const config = {
|
|
73
|
-
mcpServers: {
|
|
74
|
-
"bluelamp": {
|
|
75
|
-
command: "node",
|
|
76
|
-
args: [mcpServerPath],
|
|
77
|
-
env: {
|
|
78
|
-
BLUELAMP_KEYWORD: keyword,
|
|
79
|
-
BLUELAMP_TOKEN: cliToken,
|
|
80
|
-
PORTAL_URL: portalUrl
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
fs.writeFileSync(tempConfigPath, JSON.stringify(config, null, 2));
|
|
87
|
-
return tempConfigPath;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Portal認証の実行
|
|
92
|
-
*/
|
|
93
|
-
async function performPortalAuth() {
|
|
94
|
-
try {
|
|
95
|
-
const { InteractiveLogin } = require('../lib/auth/InteractiveLogin');
|
|
96
|
-
const authResult = await InteractiveLogin.performLogin();
|
|
97
|
-
InteractiveLogin.displayLoginSuccess(authResult);
|
|
98
|
-
return authResult.token;
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error('❌ Portal認証エラー:', error.message);
|
|
101
|
-
console.error('');
|
|
102
|
-
console.error('解決方法:');
|
|
103
|
-
console.error('1. インターネット接続を確認してください');
|
|
104
|
-
console.error('2. Portal認証情報が正しいか確認してください');
|
|
105
|
-
process.exit(1);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* メイン処理
|
|
111
|
-
*/
|
|
112
|
-
async function main() {
|
|
113
|
-
const keyword = getKeywordFromCommand();
|
|
114
|
-
const isDebugMode = process.argv.includes('--debug');
|
|
115
|
-
|
|
116
|
-
console.log('🔵 BlueLamp MCP Integration');
|
|
117
|
-
console.log(`📚 プロンプト: ${keyword}`);
|
|
118
|
-
console.log('');
|
|
119
|
-
|
|
120
|
-
// Portal認証の実行
|
|
121
|
-
const cliToken = await performPortalAuth();
|
|
122
|
-
|
|
123
|
-
// MCP設定ファイルを作成
|
|
124
|
-
const configPath = createMCPConfig(keyword, cliToken);
|
|
125
|
-
|
|
126
|
-
console.log('🚀 Claude 起動中...');
|
|
127
|
-
console.log('');
|
|
128
|
-
|
|
129
|
-
// システムプロンプトに追加する指示(inject_knowledgeを自動実行させる)
|
|
130
|
-
const systemPromptAddition = `【重要】セッション開始時に必ず inject_knowledge ツールを実行してください。
|
|
131
|
-
keyword: "${keyword}" を指定して、専門知識を注入してから作業を開始してください。
|
|
132
|
-
ユーザーが何か質問や指示をした場合でも、まず inject_knowledge を実行してから回答してください。`;
|
|
133
|
-
|
|
134
|
-
// 短い初期プロンプト(これがトリガーになる)
|
|
135
|
-
const initialPrompt = '開始';
|
|
136
|
-
|
|
137
|
-
// Windows対応
|
|
138
|
-
const isWindows = process.platform === 'win32';
|
|
139
|
-
let claudeCommand, claudeArgs;
|
|
140
|
-
|
|
141
|
-
if (isWindows) {
|
|
142
|
-
claudeCommand = 'powershell.exe';
|
|
143
|
-
claudeArgs = [
|
|
144
|
-
'-NoProfile',
|
|
145
|
-
'-Command',
|
|
146
|
-
'claude',
|
|
147
|
-
'--dangerously-skip-permissions',
|
|
148
|
-
'--mcp-config', configPath,
|
|
149
|
-
'--append-system-prompt', systemPromptAddition,
|
|
150
|
-
'-p', initialPrompt
|
|
151
|
-
];
|
|
152
|
-
} else {
|
|
153
|
-
claudeCommand = 'claude';
|
|
154
|
-
claudeArgs = [
|
|
155
|
-
'--dangerously-skip-permissions',
|
|
156
|
-
'--mcp-config', configPath,
|
|
157
|
-
'--append-system-prompt', systemPromptAddition,
|
|
158
|
-
'-p', initialPrompt
|
|
159
|
-
];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (isDebugMode) {
|
|
163
|
-
console.log('🐛 デバッグ情報:');
|
|
164
|
-
console.log(` コマンド: ${claudeCommand}`);
|
|
165
|
-
console.log(` 引数: ${JSON.stringify(claudeArgs)}`);
|
|
166
|
-
console.log(` MCP設定: ${configPath}`);
|
|
167
|
-
console.log('');
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const child = spawn(claudeCommand, claudeArgs, {
|
|
171
|
-
stdio: 'inherit',
|
|
172
|
-
env: {
|
|
173
|
-
...process.env,
|
|
174
|
-
BLUELAMP_KEYWORD: keyword
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
child.on('error', (error) => {
|
|
179
|
-
console.error('❌ Claude 起動エラー:', error.message);
|
|
180
|
-
try { fs.unlinkSync(configPath); } catch (e) {}
|
|
181
|
-
process.exit(1);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
child.on('exit', (code) => {
|
|
185
|
-
console.log('');
|
|
186
|
-
console.log('🔵 BlueLamp セッション終了');
|
|
187
|
-
try { fs.unlinkSync(configPath); } catch (e) {}
|
|
188
|
-
process.exit(code || 0);
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
process.on('SIGINT', () => {
|
|
192
|
-
console.log('\n🔵 BlueLamp を終了しています...');
|
|
193
|
-
child.kill('SIGINT');
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
main().catch((error) => {
|
|
198
|
-
console.error('❌ 予期しないエラー:', error.message);
|
|
199
|
-
process.exit(1);
|
|
200
|
-
});
|
package/bin/bluelamp-hook
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* BlueLamp SessionStart Hook
|
|
5
|
-
* Claude Code の SessionStart Hook として実行され、
|
|
6
|
-
* 一時ファイルからキーワードを読み取ってプロンプトを出力する
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
const os = require('os');
|
|
12
|
-
|
|
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
|
-
// キーワードがあればプロンプトを出力
|
|
28
|
-
if (keyword) {
|
|
29
|
-
const prompt = `> 拡張モードで起動
|
|
30
|
-
|
|
31
|
-
🔵 BlueLamp 統合認証システム が有効化されました
|
|
32
|
-
|
|
33
|
-
╭─────────────────────────────────────────────────────────────────╮
|
|
34
|
-
│ │
|
|
35
|
-
│ B l u e L a m p │
|
|
36
|
-
│ ───────────────── │
|
|
37
|
-
│ さあ始めましょう │
|
|
38
|
-
│ │
|
|
39
|
-
╰─────────────────────────────────────────────────────────────────╯
|
|
40
|
-
|
|
41
|
-
**最初に必ず専門知識を注入してください**
|
|
42
|
-
inject_knowledge ツールで keyword: "${keyword}" を実行してから開始してください。(初回必須)
|
|
43
|
-
|
|
44
|
-
重要:キーワードは "${keyword}" をそのまま使用してください。変換や推測は不要です。
|
|
45
|
-
|
|
46
|
-
準備完了です。まず知識注入を実行してから、タスクを開始してください。`;
|
|
47
|
-
|
|
48
|
-
console.log(prompt);
|
|
49
|
-
}
|
package/bin/bluelamp1
DELETED
package/bin/bluelamp10
DELETED
package/bin/bluelamp11
DELETED
package/bin/bluelamp12
DELETED
package/bin/bluelamp13
DELETED
package/bin/bluelamp14
DELETED
package/bin/bluelamp15
DELETED
package/bin/bluelamp16
DELETED
package/bin/bluelamp17
DELETED
package/bin/bluelamp18
DELETED
package/bin/bluelamp2
DELETED
package/bin/bluelamp3
DELETED
package/bin/bluelamp4
DELETED
package/bin/bluelamp5
DELETED
package/bin/bluelamp6
DELETED
package/bin/bluelamp7
DELETED
package/bin/bluelamp8
DELETED
package/bin/bluelamp9
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portal APIからプロンプトを取得するモジュール
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import fetch from 'node-fetch';
|
|
6
|
-
|
|
7
|
-
const PORTAL_URL = process.env.PORTAL_URL || 'https://bluelamp-6clpzmy5pa-an.a.run.app';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* キーワードに基づいてPortalからプロンプトを取得
|
|
11
|
-
*/
|
|
12
|
-
export async function fetchPromptFromPortal(keyword) {
|
|
13
|
-
try {
|
|
14
|
-
// Portal APIエンドポイント
|
|
15
|
-
const response = await fetch(`${PORTAL_URL}/api/prompts/by-keyword/${encodeURIComponent(keyword)}`, {
|
|
16
|
-
method: 'GET',
|
|
17
|
-
headers: {
|
|
18
|
-
'Content-Type': 'application/json',
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
if (!response.ok) {
|
|
23
|
-
console.error(`Portal API error: ${response.status}`);
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const data = await response.json();
|
|
28
|
-
|
|
29
|
-
if (!data.prompt) {
|
|
30
|
-
console.error('No prompt found in response');
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Portalから取得したプロンプトデータを返す
|
|
35
|
-
return {
|
|
36
|
-
title: data.prompt.name || keyword,
|
|
37
|
-
content: data.prompt.text || '',
|
|
38
|
-
tags: data.prompt.tags || [],
|
|
39
|
-
level: 'expert'
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
} catch (error) {
|
|
43
|
-
console.error('Failed to fetch prompt from Portal:', error);
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* フォールバック用のデフォルトプロンプト
|
|
50
|
-
*/
|
|
51
|
-
export const DEFAULT_PROMPTS = {
|
|
52
|
-
'BL-要件定義': {
|
|
53
|
-
title: '要件定義エンジニア',
|
|
54
|
-
content: `あなたは要件定義のスペシャリストです。
|
|
55
|
-
- ユーザーの要求を正確に理解し、技術要件に落とし込む
|
|
56
|
-
- 機能要件と非機能要件を明確に分離
|
|
57
|
-
- 実装可能性を考慮した要件定義`,
|
|
58
|
-
level: 'expert'
|
|
59
|
-
},
|
|
60
|
-
// ... 他の15個も同様
|
|
61
|
-
};
|