bluelamp 6.4.8 → 6.4.10
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 -1
- package/dist/auth/InteractiveLogin.js +1 -1
- package/dist/auth/PortalAuthClient.js +1 -1
- package/dist/auth/TokenManager.js +1 -1
- package/dist/bin/bluelamp-vscode-base.mjs +1 -1
- package/dist/lib/account-mcp/index.cjs +2 -0
- package/dist/scripts/generate-commands.js +0 -0
- package/dist/scripts/setup-mcps.js +1 -1
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -25,7 +25,59 @@ bluelamp42 # slot #42
|
|
|
25
25
|
- `bin/bluelamp1.mjs` 〜 `bin/bluelamp200.mjs` — `bluelamp-vscode-base.mjs` を import する薄いトランポリン
|
|
26
26
|
- `scripts/build-obfuscate.mjs` — 2 段階難読化 (Terser + javascript-obfuscator HIGH) の production build
|
|
27
27
|
- `scripts/generate-commands.ts` — 200 トランポリンの冪等再生成 (`dist/scripts/generate-commands.js` にコンパイル)
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
## MCP 配布の仕組み(重要)
|
|
30
|
+
|
|
31
|
+
受講生 PC の Claude Code に MCP を「配る」のは、**`npm install -g bluelamp` で入るこのパッケージの launcher が、起動のたびに `--mcp-config` を生成して `claude` に渡している**から。ユーザーは MCP 設定ファイルを一切編集しない。
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
bluelampN (trampoline)
|
|
35
|
+
→ bin/bluelamp-vscode-base.mjs
|
|
36
|
+
→ createMCPConfig() : os.tmpdir() に bluelamp-mcp-<ts>.json を書く
|
|
37
|
+
→ spawn('claude', [..., '--mcp-config', <temp>])
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`createMCPConfig()`(`bin/bluelamp-vscode-base.mjs`)が書く中身は現状 MCP **1 個だけ**:
|
|
41
|
+
|
|
42
|
+
```jsonc
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"bluelamp": { // gateway。これ 1 個が全 cloud_proxy tool を露出
|
|
46
|
+
"command": "node",
|
|
47
|
+
"args": ["<pkg>/lib/mcp-server/index.cjs"],
|
|
48
|
+
"env": {
|
|
49
|
+
"MUSUHI_TOKEN": cliToken, // ~/.musuhi/portal-token.enc 由来(TokenManager)
|
|
50
|
+
"MUSUHI_KEYWORD": keyword, // slot → エージェント
|
|
51
|
+
"MUSUHI_TENANT_ID": "...", // アクティブテナント
|
|
52
|
+
"PORTAL_URL": "..."
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- `load_knowledge` / `install_from_store` / `tenant-agents` 等の "BlueLamp MCP" は **全部この `bluelamp` gateway 1 プロセス経由**。tool を増やしても MCP プロセスは増えない。
|
|
60
|
+
- token は **launcher 起動時に env 固定注入**。→ ログアウト / アカウント切替の効果は **次回 `bluelampN` 起動から**(in-session では差し替わらない)。
|
|
61
|
+
|
|
62
|
+
### ローカル MCP を 1 個足したいとき(例: アカウント管理 MCP)
|
|
63
|
+
|
|
64
|
+
cloud_proxy(portal 転送)では触れない **ローカル操作**(token 削除・`npm install -g bluelamp@latest`)をする MCP は、`@bluelamp/mcp-shim`(転送専用)では作れない。代わりに:
|
|
65
|
+
|
|
66
|
+
1. `packages/bluelamp-cli/lib/` にローカル MCP スクリプトを bundle する(`lib/` は build で `dist/lib/` にコピーされ npm 同梱される)
|
|
67
|
+
2. `createMCPConfig()` の `mcpServers` に **2 個目**を足す(ローカル操作のみなら env 注入は不要。token は MCP 側が `~/.musuhi/portal-token.enc` を直読み)
|
|
68
|
+
3. `bluelamp` を再 publish → 受講生は自己更新で入手 → launcher が毎回 temp config に書く=**自動配布・自動登録**
|
|
69
|
+
|
|
70
|
+
別 npm パッケージも、ユーザーの設定編集も不要。これが「`npm install -g bluelamp` だけで MCP が増える」の実体。
|
|
71
|
+
|
|
72
|
+
> **実装済み(Phase 151)**: 第1号が `lib/account-mcp/index.cjs`(MCP 名 `bluelamp-account`)。tool = `logout`(`~/.musuhi/portal-token.enc` を削除=別アカウント切替の起点)/ `update_cli`(`npm i -g bluelamp@latest`)。`createMCPConfig()` に登録済み。効果はどちらも **次回 `bluelampN` 起動から**(起動中の gateway は起動時 token を保持するため in-session では切り替わらない)。
|
|
73
|
+
|
|
74
|
+
### `@bluelamp/mcp-shim` との違い
|
|
75
|
+
|
|
76
|
+
| | gateway / ローカル MCP(このパッケージの `lib/`) | `@bluelamp/mcp-shim`(別 npm) |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| 配布 | `bluelamp` 本体に同梱、launcher が `--mcp-config` で登録 | `manifest.json` だけで動く cloud_proxy 用 shim |
|
|
79
|
+
| できること | **ローカル操作**(token / fs / npm)も可 | portal `/api/cli/mcp-dispatch` への **転送のみ** |
|
|
80
|
+
| 用途 | gateway 本体、アカウント管理 など | cloud_proxy + externalApi の汎用 tool |
|
|
29
81
|
|
|
30
82
|
## 開発
|
|
31
83
|
|