bluelamp 4.0.8 → 4.0.11
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/README.md +53 -56
- package/bin/bluelamp-vscode-base +1 -257
- 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-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/bin/bluelamp1 +0 -0
- package/bin/bluelamp10 +0 -0
- package/bin/bluelamp11 +0 -0
- package/bin/bluelamp12 +0 -0
- package/bin/bluelamp13 +0 -0
- package/bin/bluelamp14 +0 -0
- package/bin/bluelamp15 +0 -0
- package/bin/bluelamp16 +0 -0
- package/bin/bluelamp17 +0 -0
- package/bin/bluelamp18 +0 -0
- package/bin/bluelamp2 +0 -0
- package/bin/bluelamp3 +0 -0
- package/bin/bluelamp4 +0 -0
- package/bin/bluelamp5 +0 -0
- package/bin/bluelamp6 +0 -0
- package/bin/bluelamp7 +0 -0
- package/bin/bluelamp8 +0 -0
- package/bin/bluelamp9 +0 -0
- package/lib/auth/InteractiveLogin.js +1 -243
- package/lib/auth/PortalAuthClient.js +1 -187
- package/lib/auth/TokenManager.js +1 -258
- package/lib/mcp-server/index.cjs +1 -195
- package/lib/mcp-server/portal-api-client.cjs +1 -237
- package/lib/utils/logger.js +1 -83
- package/package.json +5 -17
- package/bin/docs/SCOPE_PROGRESS.md +0 -222
- package/scripts/build-release.js +0 -426
- package/scripts/generate-commands.js +0 -35
package/README.md
CHANGED
|
@@ -1,81 +1,78 @@
|
|
|
1
|
-
# BlueLamp
|
|
1
|
+
# BlueLamp MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## 概要
|
|
6
|
-
|
|
7
|
-
BlueLamp VSCodeは、VSCode拡張機能から16種類の開発プロンプトを使用してClaude Desktopを起動するためのMCP(Model Context Protocol)統合パッケージです。
|
|
3
|
+
Claude Code用の18種類の開発プロンプト知識注入システム
|
|
8
4
|
|
|
9
5
|
## インストール
|
|
10
6
|
|
|
11
|
-
### グローバルインストール(推奨)
|
|
12
|
-
|
|
13
7
|
```bash
|
|
14
|
-
npm install -g bluelamp
|
|
8
|
+
npm install -g bluelamp
|
|
15
9
|
```
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
## 使用方法
|
|
18
12
|
|
|
19
13
|
```bash
|
|
20
|
-
|
|
14
|
+
bluelamp1 # 要件定義エンジニアとして起動
|
|
15
|
+
bluelamp2 # Git管理エンジニアとして起動
|
|
16
|
+
# ... 18種類のコマンド
|
|
21
17
|
```
|
|
22
18
|
|
|
23
|
-
##
|
|
19
|
+
## コマンド一覧
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
| コマンド | キーワード | 役割 |
|
|
22
|
+
|---------|----------|------|
|
|
23
|
+
| `bluelamp1` | @要件定義 | 要件定義エンジニア |
|
|
24
|
+
| `bluelamp2` | @Git管理 | Git/GitHub管理 |
|
|
25
|
+
| `bluelamp3` | @フロントエンド基盤 | フロントエンド基盤オーケストレーター |
|
|
26
|
+
| `bluelamp4` | @ページ実装オーケストレーター | ページ実装統括 |
|
|
27
|
+
| `bluelamp5` | @環境構築オーケストレーター | 環境構築 |
|
|
28
|
+
| `bluelamp6` | @バックエンド計画オーケストレーター | バックエンド実装計画 |
|
|
29
|
+
| `bluelamp7` | @バックエンド実装オーケストレーター | バックエンド実装統括 |
|
|
30
|
+
| `bluelamp8` | @フロントエンド実装オーケストレーター | API統合統括 |
|
|
31
|
+
| `bluelamp9` | @E2Eテストオーケストレーター | E2Eテスト統括 |
|
|
32
|
+
| `bluelamp10` | @本番運用診断オーケストレーター | CVSS 3.1準拠本番運用診断 |
|
|
33
|
+
| `bluelamp11` | @デプロイオーケストレーター | デプロイメント統括 |
|
|
34
|
+
| `bluelamp12` | @拡張要件定義 | 拡張要件定義オーケストレーター |
|
|
35
|
+
| `bluelamp13` | @拡張機能実装 | 拡張機能実装オーケストレーター |
|
|
36
|
+
| `bluelamp14` | @デバッグ技術 | 自己完結型デバッグマスター |
|
|
37
|
+
| `bluelamp15` | @リファクタリング | 超並列リファクタリング |
|
|
38
|
+
| `bluelamp16` | @ドキュメント生成 | ドキュメント生成統括 |
|
|
39
|
+
| `bluelamp17` | @相談 | 相談対応 |
|
|
40
|
+
| `bluelamp18` | @MCP追加 | MCP追加エージェント |
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
# 要件定義エンジニアとして起動
|
|
29
|
-
bluelamp-vscode1
|
|
42
|
+
## 必要要件
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
- Node.js 18以上
|
|
45
|
+
- Claude Code CLI
|
|
46
|
+
- BlueLamp Portalアカウント
|
|
33
47
|
|
|
34
|
-
|
|
35
|
-
```
|
|
48
|
+
---
|
|
36
49
|
|
|
37
|
-
|
|
50
|
+
## 開発者向け
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
### ローカルビルド(難読化)
|
|
40
53
|
|
|
41
|
-
|
|
54
|
+
```bash
|
|
55
|
+
npm run build
|
|
56
|
+
```
|
|
42
57
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| `bluelamp-vscode2` | BL-UIUXデザイン | UI/UXデザイナー |
|
|
47
|
-
| `bluelamp-vscode3` | BL-データモデル | データモデリングエンジニア |
|
|
48
|
-
| `bluelamp-vscode4` | BL-システム設計 | システムアーキテクト |
|
|
49
|
-
| `bluelamp-vscode5` | BL-実装計画 | 実装プランナー |
|
|
50
|
-
| `bluelamp-vscode6` | BL-環境構築 | 環境構築エンジニア |
|
|
51
|
-
| `bluelamp-vscode7` | BL-プロトタイプ | プロトタイプ開発者 |
|
|
52
|
-
| `bluelamp-vscode8` | BL-バックエンド | バックエンドエンジニア |
|
|
53
|
-
| `bluelamp-vscode9` | BL-テスト検証 | QAエンジニア |
|
|
54
|
-
| `bluelamp-vscode10` | BL-API統合 | API統合スペシャリスト |
|
|
55
|
-
| `bluelamp-vscode11` | BL-デプロイ | デプロイメントエンジニア |
|
|
56
|
-
| `bluelamp-vscode12` | BL-GitHub | GitHub運用エキスパート |
|
|
57
|
-
| `bluelamp-vscode13` | BL-TypeScript | TypeScriptエキスパート |
|
|
58
|
-
| `bluelamp-vscode14` | BL-デバッグ | デバッグスペシャリスト |
|
|
59
|
-
| `bluelamp-vscode15` | BL-機能拡張 | 機能拡張エンジニア |
|
|
60
|
-
| `bluelamp-vscode16` | BL-リファクタリング | リファクタリングエキスパート |
|
|
61
|
-
|
|
62
|
-
## 仕組み
|
|
63
|
-
|
|
64
|
-
1. コマンド実行時にMCPサーバーが自動起動
|
|
65
|
-
2. Claude Desktopが起動し、MCPサーバーに接続
|
|
66
|
-
3. 初回プロンプトで知識注入(inject_knowledge)を実行
|
|
67
|
-
4. 選択したロールの専門知識が注入され、開発支援開始
|
|
58
|
+
2段階難読化を適用してdist/に出力:
|
|
59
|
+
- **HIGH**: 認証・API関連ファイル(制御フロー平坦化、文字列暗号化)
|
|
60
|
+
- **Terser**: 一般ファイル(軽量縮小化)
|
|
68
61
|
|
|
69
|
-
|
|
62
|
+
### npm公開(GitHub Actions)
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
- Claude Desktop(インストール済み)
|
|
73
|
-
- VSCode BlueLamp拡張機能(オプション)
|
|
64
|
+
タグをプッシュすると自動でnpmに公開されます:
|
|
74
65
|
|
|
75
|
-
|
|
66
|
+
```bash
|
|
67
|
+
npm version patch # 4.0.9
|
|
68
|
+
git push && git push --tags
|
|
69
|
+
```
|
|
76
70
|
|
|
77
|
-
|
|
71
|
+
GitHub Actionsが自動で:
|
|
72
|
+
1. 依存関係インストール
|
|
73
|
+
2. 難読化ビルド
|
|
74
|
+
3. npmに公開
|
|
78
75
|
|
|
79
|
-
##
|
|
76
|
+
## ライセンス
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
MIT
|
package/bin/bluelamp-vscode-base
CHANGED
|
@@ -1,258 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* BlueLamp VSCode MCP Integration
|
|
5
|
-
* Base script for VSCode extension prompt injection
|
|
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
|
-
console.log('📁 Loaded .env.local');
|
|
23
|
-
} else if (fs.existsSync(dotenvPath)) {
|
|
24
|
-
require('dotenv').config({ path: dotenvPath });
|
|
25
|
-
console.log('📁 Loaded .env');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// コマンドマッピング(18個のプロンプト - 新BlueLamp 18エージェント体制)
|
|
29
|
-
const PROMPT_MAPPING = {
|
|
30
|
-
'bluelamp1': '@要件定義', // Phase @1: 要件定義エンジニア
|
|
31
|
-
'bluelamp2': '@Git管理', // Phase @2: Git/GitHub管理
|
|
32
|
-
'bluelamp3': '@フロントエンド基盤', // Phase @3: フロントエンド基盤オーケストレーター
|
|
33
|
-
'bluelamp4': '@ページ実装オーケストレーター', // Phase @4: ページ実装統括
|
|
34
|
-
'bluelamp5': '@環境構築オーケストレーター', // Phase @5: 環境構築
|
|
35
|
-
'bluelamp6': '@バックエンド計画オーケストレーター', // Phase @6: バックエンド実装計画
|
|
36
|
-
'bluelamp7': '@バックエンド実装オーケストレーター', // Phase @7: バックエンド実装統括
|
|
37
|
-
'bluelamp8': '@フロントエンド実装オーケストレーター', // Phase @8: API統合統括
|
|
38
|
-
'bluelamp9': '@E2Eテストオーケストレーター', // Phase @9: E2Eテスト統括
|
|
39
|
-
'bluelamp10': '@本番運用診断オーケストレーター', // Phase @10: CVSS 3.1準拠本番運用診断
|
|
40
|
-
'bluelamp11': '@デプロイオーケストレーター', // Phase @11: デプロイメント統括
|
|
41
|
-
'bluelamp12': '@拡張要件定義', // Tools @12: 拡張要件定義オーケストレーター
|
|
42
|
-
'bluelamp13': '@拡張機能実装', // Tools @13: 拡張機能実装オーケストレーター
|
|
43
|
-
'bluelamp14': '@デバッグ技術', // Tools @14: 自己完結型デバッグマスター
|
|
44
|
-
'bluelamp15': '@リファクタリング', // Tools @15: 超並列リファクタリング
|
|
45
|
-
'bluelamp16': '@ドキュメント生成', // Tools @16: ドキュメント生成統括
|
|
46
|
-
'bluelamp17': '@相談', // Tools @17: 相談対応
|
|
47
|
-
'bluelamp18': '@MCP追加' // Tools @18: MCP追加エージェント
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* コマンド名から対応するキーワードを取得
|
|
52
|
-
*/
|
|
53
|
-
function getKeywordFromCommand() {
|
|
54
|
-
const commandPath = process.argv[1];
|
|
55
|
-
const commandName = path.basename(commandPath);
|
|
56
|
-
|
|
57
|
-
if (!PROMPT_MAPPING[commandName]) {
|
|
58
|
-
console.error(`❌ 未定義のコマンド: ${commandName}`);
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return PROMPT_MAPPING[commandName];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* MCPサーバー設定を作成
|
|
67
|
-
*/
|
|
68
|
-
function createMCPConfig(keyword, cliToken) {
|
|
69
|
-
const mcpServerPath = path.join(packageRoot, 'lib/mcp-server/index.cjs');
|
|
70
|
-
const tempConfigPath = path.join(os.tmpdir(), `bluelamp-vscode-${Date.now()}.json`);
|
|
71
|
-
|
|
72
|
-
// .env.localからPORTAL_URLを取得(デフォルトは本番)
|
|
73
|
-
const portalUrl = process.env.PORTAL_URL || "https://bluelamp-6clpzmy5pa-an.a.run.app";
|
|
74
|
-
|
|
75
|
-
const config = {
|
|
76
|
-
mcpServers: {
|
|
77
|
-
"bluelamp-vscode": {
|
|
78
|
-
command: "node",
|
|
79
|
-
args: [mcpServerPath],
|
|
80
|
-
env: {
|
|
81
|
-
BLUELAMP_KEYWORD: keyword,
|
|
82
|
-
BLUELAMP_TOKEN: cliToken,
|
|
83
|
-
PORTAL_URL: portalUrl
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
fs.writeFileSync(tempConfigPath, JSON.stringify(config, null, 2));
|
|
90
|
-
return tempConfigPath;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Portal認証の実行(BlueLamp VSCode独自の認証システム)
|
|
95
|
-
*/
|
|
96
|
-
async function performPortalAuth() {
|
|
97
|
-
try {
|
|
98
|
-
// BlueLamp VSCode用の認証モジュールを使用
|
|
99
|
-
const { InteractiveLogin } = require('../lib/auth/InteractiveLogin');
|
|
100
|
-
|
|
101
|
-
const authResult = await InteractiveLogin.performLogin();
|
|
102
|
-
|
|
103
|
-
InteractiveLogin.displayLoginSuccess(authResult);
|
|
104
|
-
|
|
105
|
-
return authResult.token;
|
|
106
|
-
|
|
107
|
-
} catch (error) {
|
|
108
|
-
console.error('❌ Portal認証エラー:', error.message);
|
|
109
|
-
console.error('');
|
|
110
|
-
console.error('解決方法:');
|
|
111
|
-
console.error('1. インターネット接続を確認してください');
|
|
112
|
-
console.error('2. Portal認証情報が正しいか確認してください');
|
|
113
|
-
console.error('3. https://bluelamp-6clpzmy5pa-an.a.run.app にアクセスできるか確認してください');
|
|
114
|
-
process.exit(1);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* メイン処理
|
|
120
|
-
*/
|
|
121
|
-
async function main() {
|
|
122
|
-
const keyword = getKeywordFromCommand();
|
|
123
|
-
|
|
124
|
-
// --debugフラグの確認
|
|
125
|
-
const isDebugMode = process.argv.includes('--debug');
|
|
126
|
-
|
|
127
|
-
console.log('🔵 BlueLamp VSCode MCP Integration');
|
|
128
|
-
console.log(`📚 プロンプト: ${keyword}`);
|
|
129
|
-
if (isDebugMode) {
|
|
130
|
-
console.log('🐛 デバッグモード: 有効');
|
|
131
|
-
console.log(` ログファイル: ${path.join(os.tmpdir(), 'bluelamp-vscode-mcp-latest.log')}`);
|
|
132
|
-
}
|
|
133
|
-
console.log('');
|
|
134
|
-
|
|
135
|
-
// Portal認証の実行
|
|
136
|
-
const cliToken = await performPortalAuth();
|
|
137
|
-
|
|
138
|
-
// MCP設定ファイルを作成(認証トークンを含む)
|
|
139
|
-
const configPath = createMCPConfig(keyword, cliToken);
|
|
140
|
-
|
|
141
|
-
// 初期プロンプトメッセージ
|
|
142
|
-
const initialPrompt = `> 拡張モードで起動
|
|
143
|
-
|
|
144
|
-
🔵 BlueLamp 統合認証システム が有効化されました
|
|
145
|
-
|
|
146
|
-
\x1b[34m╭─────────────────────────────────────────────────────────────────╮\x1b[0m
|
|
147
|
-
\x1b[34m│ │\x1b[0m
|
|
148
|
-
\x1b[34m│ B l u e L a m p │\x1b[0m
|
|
149
|
-
\x1b[34m│ ───────────────── │\x1b[0m
|
|
150
|
-
\x1b[34m│ さあ始めましょう │\x1b[0m
|
|
151
|
-
\x1b[34m│ │\x1b[0m
|
|
152
|
-
\x1b[34m╰─────────────────────────────────────────────────────────────────╯\x1b[0m
|
|
153
|
-
|
|
154
|
-
**最初に必ず専門知識を注入してください**
|
|
155
|
-
inject_knowledge ツールで keyword: "${keyword}" を実行してから開始してください。(初回必須)
|
|
156
|
-
|
|
157
|
-
重要:キーワードは "${keyword}" をそのまま使用してください。変換や推測は不要です。
|
|
158
|
-
|
|
159
|
-
準備完了です。まず知識注入を実行してから、タスクを開始してください。`;
|
|
160
|
-
|
|
161
|
-
// Claude を起動
|
|
162
|
-
console.log('🚀 Claude 起動中...');
|
|
163
|
-
console.log(' - MCP Server: BlueLamp VSCode');
|
|
164
|
-
console.log(` - Knowledge: ${keyword}`);
|
|
165
|
-
console.log('');
|
|
166
|
-
|
|
167
|
-
// Windows対応: PowerShell経由でclaude.ps1を実行
|
|
168
|
-
const isWindows = process.platform === 'win32';
|
|
169
|
-
let claudeCommand, claudeArgs;
|
|
170
|
-
|
|
171
|
-
if (isWindows) {
|
|
172
|
-
// Windows: PowerShell経由でclaude.ps1を実行
|
|
173
|
-
claudeCommand = 'powershell.exe';
|
|
174
|
-
claudeArgs = [
|
|
175
|
-
'-NoProfile',
|
|
176
|
-
'-Command',
|
|
177
|
-
'claude',
|
|
178
|
-
initialPrompt,
|
|
179
|
-
'--dangerously-skip-permissions',
|
|
180
|
-
'--mcp-config', configPath
|
|
181
|
-
];
|
|
182
|
-
} else {
|
|
183
|
-
// Mac/Linux: 直接実行
|
|
184
|
-
claudeCommand = 'claude';
|
|
185
|
-
claudeArgs = [
|
|
186
|
-
initialPrompt,
|
|
187
|
-
'--dangerously-skip-permissions',
|
|
188
|
-
'--mcp-config', configPath
|
|
189
|
-
];
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// デバッグモードの場合、詳細情報を表示
|
|
193
|
-
if (isDebugMode) {
|
|
194
|
-
console.log('🐛 デバッグ情報:');
|
|
195
|
-
console.log(` コマンド: ${claudeCommand}`);
|
|
196
|
-
console.log(` 引数: ${JSON.stringify(claudeArgs, null, 2)}`);
|
|
197
|
-
console.log(` MCP設定ファイル: ${configPath}`);
|
|
198
|
-
console.log(` 環境変数 BLUELAMP_KEYWORD: ${keyword}`);
|
|
199
|
-
console.log(` 環境変数 BLUELAMP_TOKEN: ${cliToken.substring(0, 20)}...`);
|
|
200
|
-
console.log(` 環境変数 PORTAL_URL: ${process.env.PORTAL_URL || 'https://bluelamp-6clpzmy5pa-an.a.run.app'}`);
|
|
201
|
-
console.log('');
|
|
202
|
-
|
|
203
|
-
// MCP設定ファイルの内容を表示
|
|
204
|
-
const configContent = fs.readFileSync(configPath, 'utf-8');
|
|
205
|
-
console.log('📄 MCP設定ファイル内容:');
|
|
206
|
-
console.log(configContent);
|
|
207
|
-
console.log('');
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const child = spawn(claudeCommand, claudeArgs, {
|
|
211
|
-
stdio: 'inherit',
|
|
212
|
-
env: {
|
|
213
|
-
...process.env,
|
|
214
|
-
BLUELAMP_VSCODE_KEYWORD: keyword
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
// エラーハンドリング
|
|
219
|
-
child.on('error', (error) => {
|
|
220
|
-
console.error('❌ Claude 起動エラー:', error.message);
|
|
221
|
-
|
|
222
|
-
// 一時ファイルをクリーンアップ
|
|
223
|
-
try {
|
|
224
|
-
fs.unlinkSync(configPath);
|
|
225
|
-
} catch (e) {
|
|
226
|
-
// ignore
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
process.exit(1);
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// 終了時のクリーンアップ
|
|
233
|
-
child.on('exit', (code) => {
|
|
234
|
-
console.log('');
|
|
235
|
-
console.log('🔵 BlueLamp VSCode セッション終了');
|
|
236
|
-
|
|
237
|
-
// 一時ファイルをクリーンアップ
|
|
238
|
-
try {
|
|
239
|
-
fs.unlinkSync(configPath);
|
|
240
|
-
} catch (e) {
|
|
241
|
-
// ignore
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
process.exit(code || 0);
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
// SIGINT (Ctrl+C) ハンドリング
|
|
248
|
-
process.on('SIGINT', () => {
|
|
249
|
-
console.log('\n🔵 BlueLamp VSCode を終了しています...');
|
|
250
|
-
child.kill('SIGINT');
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// メイン処理の実行
|
|
255
|
-
main().catch((error) => {
|
|
256
|
-
console.error('❌ 予期しないエラー:', error.message);
|
|
257
|
-
process.exit(1);
|
|
258
|
-
});
|
|
2
|
+
const{spawn:spawn}=require("child_process"),path=require("path"),fs=require("fs"),os=require("os"),packageRoot=path.dirname(__dirname),dotenvLocalPath=path.join(packageRoot,".env.local"),dotenvPath=path.join(packageRoot,".env");fs.existsSync(dotenvLocalPath)?(require("dotenv").config({path:dotenvLocalPath}),console.log("📁 Loaded .env.local")):fs.existsSync(dotenvPath)&&(require("dotenv").config({path:dotenvPath}),console.log("📁 Loaded .env"));const PROMPT_MAPPING={bluelamp1:"@要件定義",bluelamp2:"@Git管理",bluelamp3:"@フロントエンド基盤",bluelamp4:"@ページ実装オーケストレーター",bluelamp5:"@環境構築オーケストレーター",bluelamp6:"@バックエンド計画オーケストレーター",bluelamp7:"@バックエンド実装オーケストレーター",bluelamp8:"@フロントエンド実装オーケストレーター",bluelamp9:"@E2Eテストオーケストレーター",bluelamp10:"@本番運用診断オーケストレーター",bluelamp11:"@デプロイオーケストレーター",bluelamp12:"@拡張要件定義",bluelamp13:"@拡張機能実装",bluelamp14:"@デバッグ技術",bluelamp15:"@リファクタリング",bluelamp16:"@ドキュメント生成",bluelamp17:"@相談",bluelamp18:"@MCP追加"};function getKeywordFromCommand(){const o=process.argv[1],e=path.basename(o);return PROMPT_MAPPING[e]||(console.error(`❌ 未定義のコマンド: ${e}`),process.exit(1)),PROMPT_MAPPING[e]}function createMCPConfig(o,e){const n=path.join(packageRoot,"lib/mcp-server/index.cjs"),l=path.join(os.tmpdir(),`bluelamp-vscode-${Date.now()}.json`),s={mcpServers:{"bluelamp-vscode":{command:"node",args:[n],env:{BLUELAMP_KEYWORD:o,BLUELAMP_TOKEN:e,PORTAL_URL:process.env.PORTAL_URL||"https://bluelamp-6clpzmy5pa-an.a.run.app"}}}};return fs.writeFileSync(l,JSON.stringify(s,null,2)),l}async function performPortalAuth(){try{const{InteractiveLogin:o}=require("../lib/auth/InteractiveLogin"),e=await o.performLogin();return o.displayLoginSuccess(e),e.token}catch(o){console.error("❌ Portal認証エラー:",o.message),console.error(""),console.error("解決方法:"),console.error("1. インターネット接続を確認してください"),console.error("2. Portal認証情報が正しいか確認してください"),console.error("3. https://bluelamp-6clpzmy5pa-an.a.run.app にアクセスできるか確認してください"),process.exit(1)}}async function main(){const o=getKeywordFromCommand(),e=process.argv.includes("--debug");console.log("🔵 BlueLamp VSCode MCP Integration"),console.log(`📚 プロンプト: ${o}`),e&&(console.log("🐛 デバッグモード: 有効"),console.log(` ログファイル: ${path.join(os.tmpdir(),"bluelamp-vscode-mcp-latest.log")}`)),console.log("");const n=await performPortalAuth(),l=createMCPConfig(o,n),s=`> 拡張モードで起動\n\n🔵 BlueLamp 統合認証システム が有効化されました\n\n[34m╭─────────────────────────────────────────────────────────────────╮[0m\n[34m│ │[0m\n[34m│ B l u e L a m p │[0m\n[34m│ ───────────────── │[0m\n[34m│ さあ始めましょう │[0m\n[34m│ │[0m\n[34m╰─────────────────────────────────────────────────────────────────╯[0m\n\n**最初に必ず専門知識を注入してください**\ninject_knowledge ツールで keyword: "${o}" を実行してから開始してください。(初回必須)\n\n重要:キーワードは "${o}" をそのまま使用してください。変換や推測は不要です。\n\n準備完了です。まず知識注入を実行してから、タスクを開始してください。`;let a,r;if(console.log("🚀 Claude 起動中..."),console.log(" - MCP Server: BlueLamp VSCode"),console.log(` - Knowledge: ${o}`),console.log(""),"win32"===process.platform?(a="powershell.exe",r=["-NoProfile","-Command","claude",s,"--dangerously-skip-permissions","--mcp-config",l]):(a="claude",r=[s,"--dangerously-skip-permissions","--mcp-config",l]),e){console.log("🐛 デバッグ情報:"),console.log(` コマンド: ${a}`),console.log(` 引数: ${JSON.stringify(r,null,2)}`),console.log(` MCP設定ファイル: ${l}`),console.log(` 環境変数 BLUELAMP_KEYWORD: ${o}`),console.log(` 環境変数 BLUELAMP_TOKEN: ${n.substring(0,20)}...`),console.log(` 環境変数 PORTAL_URL: ${process.env.PORTAL_URL||"https://bluelamp-6clpzmy5pa-an.a.run.app"}`),console.log("");const e=fs.readFileSync(l,"utf-8");console.log("📄 MCP設定ファイル内容:"),console.log(e),console.log("")}const c=spawn(a,r,{stdio:"inherit",env:{...process.env,BLUELAMP_VSCODE_KEYWORD:o}});c.on("error",o=>{console.error("❌ Claude 起動エラー:",o.message);try{fs.unlinkSync(l)}catch(o){}process.exit(1)}),c.on("exit",o=>{console.log(""),console.log("🔵 BlueLamp VSCode セッション終了");try{fs.unlinkSync(l)}catch(o){}process.exit(o||0)}),process.on("SIGINT",()=>{console.log("\n🔵 BlueLamp VSCode を終了しています..."),c.kill("SIGINT")})}main().catch(o=>{console.error("❌ 予期しないエラー:",o.message),process.exit(1)});
|
package/bin/bluelamp1
CHANGED
|
File without changes
|
package/bin/bluelamp10
CHANGED
|
File without changes
|
package/bin/bluelamp11
CHANGED
|
File without changes
|
package/bin/bluelamp12
CHANGED
|
File without changes
|
package/bin/bluelamp13
CHANGED
|
File without changes
|
package/bin/bluelamp14
CHANGED
|
File without changes
|
package/bin/bluelamp15
CHANGED
|
File without changes
|
package/bin/bluelamp16
CHANGED
|
File without changes
|
package/bin/bluelamp17
CHANGED
|
File without changes
|
package/bin/bluelamp18
CHANGED
|
File without changes
|
package/bin/bluelamp2
CHANGED
|
File without changes
|
package/bin/bluelamp3
CHANGED
|
File without changes
|
package/bin/bluelamp4
CHANGED
|
File without changes
|
package/bin/bluelamp5
CHANGED
|
File without changes
|
package/bin/bluelamp6
CHANGED
|
File without changes
|
package/bin/bluelamp7
CHANGED
|
File without changes
|
package/bin/bluelamp8
CHANGED
|
File without changes
|
package/bin/bluelamp9
CHANGED
|
File without changes
|