bluelamp 2.0.9 → 2.0.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/bin/blcf3 +1 -1
- package/bin/blcf4 +1 -1
- package/package.json +1 -1
package/bin/blcf3
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const{spawn:spawn}=require("child_process"),path=require("path"),fs=require("fs"),os=require("os"),packageRoot=path.dirname(__dirname),mcpServerPath=path.join(packageRoot,"lib/mcp-server/
|
|
2
|
+
const{spawn:spawn}=require("child_process"),path=require("path"),fs=require("fs"),os=require("os"),packageRoot=path.dirname(__dirname),mcpServerPath=path.join(packageRoot,"lib/mcp-server/dist_optimized/secure-mcp-server.js"),securityPath=path.join(packageRoot,"lib/mcp-server/dist_optimized/security");async function performPortalAuth(){try{const{InteractiveLogin:e}=await import(`file://${securityPath}/InteractiveLogin.js`);console.log("🔐 Portal認証を開始します...");const o=await e.performLogin();return e.displayLoginSuccess(o),o.token}catch(e){console.error("❌ Portal認証エラー:",e.message),console.error(""),console.error("解決方法:"),console.error("1. インターネット接続を確認してください"),console.error("2. Portal認証情報が正しいか確認してください"),console.error("3. https://geniemon.vercel.app にアクセスできるか確認してください"),process.exit(1)}}async function performDistributedStorage(e){try{const{SimpleAuthManager:o}=await import(`file://${securityPath}/SimpleAuthManager.js`);console.log("🔒 APIキーを安全に保存中...");const s=o.saveApiKey(e);return s&&(console.log("✅ APIキー保存完了"),console.log("🛡️ セキュリティレベル: 高")),{success:s,distributionTime:1}}catch(e){return console.error("❌ APIキー保存エラー:",e.message),{success:!1,error:e.message}}}function ensureAgentsSetup(){const e=path.join(os.homedir(),".claude/agents"),o=path.join(e,"ブルーランプ.md");if(!fs.existsSync(o)){console.log("🔧 エージェントセットアップが必要です...");try{const e=path.join(packageRoot,"scripts/setup-agents.js");require(e),console.log("✅ エージェントセットアップ完了")}catch(e){console.warn("⚠️ エージェント自動セットアップに失敗しました:",e.message),console.warn("手動でセットアップを実行してください: npm run postinstall")}}}async function main(){const e=process.argv.slice(2);if(e.includes("--logout"))try{const{InteractiveLogin:e}=await import(`file://${securityPath}/InteractiveLogin.js`);await e.logout(),process.exit(0)}catch(e){console.error("❌ ログアウトエラー:",e.message),process.exit(1)}if(e.includes("--status"))try{const{InteractiveLogin:e}=await import(`file://${securityPath}/InteractiveLogin.js`);await e.checkLoginStatus(),process.exit(0)}catch(e){console.error("❌ ステータス確認エラー:",e.message),process.exit(1)}ensureAgentsSetup();const o=await performPortalAuth();console.log("🔒 APIキーを保存中...");const s=await performDistributedStorage(o);s.success||(console.error("❌ APIキー保存に失敗しました:",s.error),console.error("フォールバックモードで起動します..."));process.stdout.isTTY&&process.stdin.isTTY||console.warn("⚠️ TTY環境が検出されませんでした。互換モードで起動します。");const n={...process.env,BLUELAMP_ENCRYPTION_KEY:process.env.BLUELAMP_ENCRYPTION_KEY||"bluelamp-default-key-2024",BLUELAMP_TOKEN:o,BLUELAMP_DISTRIBUTED:s.success?"true":"false",NODE_ENV:"production"},t=path.join(os.tmpdir(),`bluelamp-mcp-${Date.now()}.json`),c={mcpServers:{"bluelamp-secure":{command:"node",args:[mcpServerPath],env:{BLUELAMP_ENCRYPTION_KEY:n.BLUELAMP_ENCRYPTION_KEY,BLUELAMP_TOKEN:n.BLUELAMP_TOKEN}}}};fs.writeFileSync(t,JSON.stringify(c,null,2));const r='> 拡張モードで起動\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 ツールで "拡張" を実行してから開始してください。(初回必須)\n\n準備完了です。まず知識注入を実行してから、何を実装するか教えてください。',a=path.join(os.tmpdir(),`bluelamp-prompt-${Date.now()}.txt`);fs.writeFileSync(a,r),console.log("🚀 Claude Code起動中..."),console.log(" - Portal認証: ON"),console.log(" - 単一ファイル保存: ON"),console.log(" - bypassmode: ON (--dangerously-skip-permissions)"),console.log(" - Knowledge Injection: ON"),console.log(" - MCP Server: BlueLamp Secure"),console.log(" - TTY互換モード: ON"),console.log("");const l=spawn("claude",[r,"--dangerously-skip-permissions","--mcp-config",t],{stdio:"inherit",env:n,detached:!1,windowsHide:!1,shell:!1});l.on("error",e=>{console.error("❌ Claude Code起動エラー:",e.message),console.error(""),console.error("解決方法:"),console.error("1. Claude Codeがインストールされているか確認"),console.error("2. PATHにclaudeコマンドが含まれているか確認"),console.error("3. Claude Codeのバージョンが最新か確認");try{fs.unlinkSync(t),fs.unlinkSync(a)}catch(e){}process.exit(1)}),l.on("exit",e=>{console.log(""),console.log("🔵 BlueLamp セッション終了");try{fs.unlinkSync(t),fs.unlinkSync(a)}catch(e){}process.exit(e||0)}),process.on("SIGINT",()=>{console.log("\n🔵 BlueLamp を終了しています..."),l.kill("SIGINT")})}console.log("🔵 BlueLamp - AIエージェント統合システム"),console.log(" ポータル統合認証 + 知識注入 + 24種類のAIエージェント"),console.log(""),main().catch(e=>{console.error("❌ 予期しないエラーが発生しました:",e.message),process.exit(1)});
|
package/bin/blcf4
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const{spawn:spawn}=require("child_process"),path=require("path"),fs=require("fs"),os=require("os"),packageRoot=path.dirname(__dirname),mcpServerPath=path.join(packageRoot,"lib/mcp-server/
|
|
2
|
+
const{spawn:spawn}=require("child_process"),path=require("path"),fs=require("fs"),os=require("os"),packageRoot=path.dirname(__dirname),mcpServerPath=path.join(packageRoot,"lib/mcp-server/dist_optimized/secure-mcp-server.js"),securityPath=path.join(packageRoot,"lib/mcp-server/dist_optimized/security");async function performPortalAuth(){try{const{InteractiveLogin:e}=await import(`file://${securityPath}/InteractiveLogin.js`);console.log("🔐 Portal認証を開始します...");const o=await e.performLogin();return e.displayLoginSuccess(o),o.token}catch(e){console.error("❌ Portal認証エラー:",e.message),console.error(""),console.error("解決方法:"),console.error("1. インターネット接続を確認してください"),console.error("2. Portal認証情報が正しいか確認してください"),console.error("3. https://geniemon.vercel.app にアクセスできるか確認してください"),process.exit(1)}}async function performDistributedStorage(e){try{const{SimpleAuthManager:o}=await import(`file://${securityPath}/SimpleAuthManager.js`);console.log("🔒 APIキーを安全に保存中...");const s=o.saveApiKey(e);return s&&(console.log("✅ APIキー保存完了"),console.log("🛡️ セキュリティレベル: 高")),{success:s,distributionTime:1}}catch(e){return console.error("❌ APIキー保存エラー:",e.message),{success:!1,error:e.message}}}function ensureAgentsSetup(){const e=path.join(os.homedir(),".claude/agents"),o=path.join(e,"ブルーランプ.md");if(!fs.existsSync(o)){console.log("🔧 エージェントセットアップが必要です...");try{const e=path.join(packageRoot,"scripts/setup-agents.js");require(e),console.log("✅ エージェントセットアップ完了")}catch(e){console.warn("⚠️ エージェント自動セットアップに失敗しました:",e.message),console.warn("手動でセットアップを実行してください: npm run postinstall")}}}async function main(){const e=process.argv.slice(2);if(e.includes("--logout"))try{const{InteractiveLogin:e}=await import(`file://${securityPath}/InteractiveLogin.js`);await e.logout(),process.exit(0)}catch(e){console.error("❌ ログアウトエラー:",e.message),process.exit(1)}if(e.includes("--status"))try{const{InteractiveLogin:e}=await import(`file://${securityPath}/InteractiveLogin.js`);await e.checkLoginStatus(),process.exit(0)}catch(e){console.error("❌ ステータス確認エラー:",e.message),process.exit(1)}ensureAgentsSetup();const o=await performPortalAuth();console.log("🔒 APIキーを保存中...");const s=await performDistributedStorage(o);s.success||(console.error("❌ APIキー保存に失敗しました:",s.error),console.error("フォールバックモードで起動します..."));process.stdout.isTTY&&process.stdin.isTTY||console.warn("⚠️ TTY環境が検出されませんでした。互換モードで起動します。");const t={...process.env,BLUELAMP_ENCRYPTION_KEY:process.env.BLUELAMP_ENCRYPTION_KEY||"bluelamp-default-key-2024",BLUELAMP_TOKEN:o,BLUELAMP_DISTRIBUTED:s.success?"true":"false",NODE_ENV:"production"},c=path.join(os.tmpdir(),`bluelamp-mcp-${Date.now()}.json`),n={mcpServers:{"bluelamp-secure":{command:"node",args:[mcpServerPath],env:{BLUELAMP_ENCRYPTION_KEY:t.BLUELAMP_ENCRYPTION_KEY,BLUELAMP_TOKEN:t.BLUELAMP_TOKEN}}}};fs.writeFileSync(c,JSON.stringify(n,null,2));const r='> 拡張モードで起動\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 ツールで "拡張" を実行してから開始してください。(初回必須)\n\n準備完了です。まず知識注入を実行してから、何を実装するか教えてください。',a=path.join(os.tmpdir(),`bluelamp-prompt-${Date.now()}.txt`);fs.writeFileSync(a,r),console.log("🚀 Claude Code起動中..."),console.log(" - Portal認証: ON"),console.log(" - 単一ファイル保存: ON"),console.log(" - bypassmode: OFF (通常モード)"),console.log(" - Knowledge Injection: ON"),console.log(" - MCP Server: BlueLamp Secure"),console.log(" - TTY互換モード: ON"),console.log("");const l=spawn("claude",[r,"--mcp-config",c],{stdio:"inherit",env:t,detached:!1,windowsHide:!1,shell:!1});l.on("error",e=>{console.error("❌ Claude Code起動エラー:",e.message),console.error(""),console.error("解決方法:"),console.error("1. Claude Codeがインストールされているか確認"),console.error("2. PATHにclaudeコマンドが含まれているか確認"),console.error("3. Claude Codeのバージョンが最新か確認");try{fs.unlinkSync(c),fs.unlinkSync(a)}catch(e){}process.exit(1)}),l.on("exit",e=>{console.log(""),console.log("🔵 BlueLamp セッション終了");try{fs.unlinkSync(c),fs.unlinkSync(a)}catch(e){}process.exit(e||0)}),process.on("SIGINT",()=>{console.log("\n🔵 BlueLamp を終了しています..."),l.kill("SIGINT")})}console.log("🔵 BlueLamp - AIエージェント統合システム"),console.log(" ポータル統合認証 + 知識注入 + 24種類のAIエージェント"),console.log(""),main().catch(e=>{console.error("❌ 予期しないエラーが発生しました:",e.message),process.exit(1)});
|