@ken-jo/agent-connector 0.3.0 → 0.4.0
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 +188 -20
- package/dist/action-PLZW5BGX.js +54 -0
- package/dist/action-PLZW5BGX.js.map +1 -0
- package/dist/{amp-YGV66GJT.js → amp-B524U6LO.js} +81 -5
- package/dist/amp-B524U6LO.js.map +1 -0
- package/dist/{antigravity-7IBYFO6P.js → antigravity-ANDKF3K7.js} +4 -4
- package/dist/{antigravity-cli-JEOUP2VN.js → antigravity-cli-LLRPDDOT.js} +4 -4
- package/dist/chunk-22Y24V7O.js +21 -0
- package/dist/chunk-22Y24V7O.js.map +1 -0
- package/dist/chunk-3PFFTFCU.js +190 -0
- package/dist/chunk-3PFFTFCU.js.map +1 -0
- package/dist/{chunk-SCVBYSF7.js → chunk-6XHB6BE3.js} +1 -1
- package/dist/chunk-76FUSVIA.js +43 -0
- package/dist/chunk-76FUSVIA.js.map +1 -0
- package/dist/{chunk-GSGDG2BV.js → chunk-ADTHT2FN.js} +109 -16
- package/dist/chunk-ADTHT2FN.js.map +1 -0
- package/dist/{chunk-ZAM4M7LI.js → chunk-BHUCB6LY.js} +135 -296
- package/dist/chunk-BHUCB6LY.js.map +1 -0
- package/dist/{chunk-MEH7GC7R.js → chunk-BXGFUENQ.js} +20 -3
- package/dist/chunk-BXGFUENQ.js.map +1 -0
- package/dist/chunk-CIRDOY2V.js +351 -0
- package/dist/chunk-CIRDOY2V.js.map +1 -0
- package/dist/{chunk-QADSG2JY.js → chunk-G3ER4SY5.js} +1152 -106
- package/dist/chunk-G3ER4SY5.js.map +1 -0
- package/dist/{chunk-44HUXXC6.js → chunk-G5CQHVQG.js} +232 -5
- package/dist/chunk-G5CQHVQG.js.map +1 -0
- package/dist/{chunk-PD4VFEBY.js → chunk-IW77FFNX.js} +39 -1
- package/dist/chunk-IW77FFNX.js.map +1 -0
- package/dist/chunk-J3D5W5T2.js +83 -0
- package/dist/chunk-J3D5W5T2.js.map +1 -0
- package/dist/{openclaw-UZ5BMCGQ.js → chunk-KGGBNKI4.js} +125 -33
- package/dist/chunk-KGGBNKI4.js.map +1 -0
- package/dist/{chunk-3JCRUROU.js → chunk-KGJWE6A2.js} +13 -4
- package/dist/chunk-KGJWE6A2.js.map +1 -0
- package/dist/{chunk-DS3LUFVN.js → chunk-KGXDYGNJ.js} +26 -16
- package/dist/chunk-KGXDYGNJ.js.map +1 -0
- package/dist/{chunk-KVAAFYRR.js → chunk-KHO5WNTP.js} +2 -18
- package/dist/chunk-KHO5WNTP.js.map +1 -0
- package/dist/{chunk-KQSNDFBN.js → chunk-LL4OBGRU.js} +3 -3
- package/dist/{chunk-WNREHWKL.js → chunk-MAH6QQTO.js} +3 -3
- package/dist/{claude-code-4275HQU4.js → claude-code-MLWS7CW6.js} +180 -28
- package/dist/claude-code-MLWS7CW6.js.map +1 -0
- package/dist/cli/sdk.js +4 -3
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/{codebuff-LE3KBZGM.js → codebuff-SH2S3QAN.js} +102 -5
- package/dist/codebuff-SH2S3QAN.js.map +1 -0
- package/dist/{codex-4BY2ZJIW.js → codex-BXA4FIF4.js} +3 -3
- package/dist/{copilot-cli-IPISKO3V.js → copilot-cli-ROIBTTDT.js} +3 -3
- package/dist/{crush-X3E25EQG.js → crush-QLEFLHUC.js} +3 -3
- package/dist/{cursor-UH3W622V.js → cursor-ASJPWZ4R.js} +6 -3
- package/dist/cursor-ASJPWZ4R.js.map +1 -0
- package/dist/{detect-MNDHGLSV.js → detect-ZIIS55LD.js} +4 -3
- package/dist/{detect-MNDHGLSV.js.map → detect-ZIIS55LD.js.map} +1 -1
- package/dist/{doctor-N5KZDD55.js → doctor-TJUGSQ5C.js} +17 -13
- package/dist/doctor-TJUGSQ5C.js.map +1 -0
- package/dist/{droid-T5VBRXZF.js → droid-NCSS3B5Y.js} +170 -4
- package/dist/droid-NCSS3B5Y.js.map +1 -0
- package/dist/{gemini-cli-ZSUK55UA.js → gemini-cli-SLVWLXJW.js} +3 -3
- package/dist/{goose-M3RR3CZG.js → goose-PBA7KTE5.js} +100 -5
- package/dist/goose-PBA7KTE5.js.map +1 -0
- package/dist/{hermes-CUNKIAR5.js → hermes-ONDCECP2.js} +3 -3
- package/dist/{hook-7LUOKIXH.js → hook-OU522ABV.js} +12 -9
- package/dist/{hook-7LUOKIXH.js.map → hook-OU522ABV.js.map} +1 -1
- package/dist/index.d.ts +71 -3
- package/dist/index.js +22 -3
- package/dist/{install-TQTT4F3I.js → install-UDCBL7HP.js} +12 -10
- package/dist/{install-TQTT4F3I.js.map → install-UDCBL7HP.js.map} +1 -1
- package/dist/introspect-DuZSPSHB.d.ts +53 -0
- package/dist/{jetbrains-copilot-C3HDGGML.js → jetbrains-copilot-YABZ3HFA.js} +3 -3
- package/dist/{kilo-PKAJCWPX.js → kilo-F3ZDZKCT.js} +3 -3
- package/dist/{kilo-cli-QWUVXG2O.js → kilo-cli-3HWPWBY4.js} +3 -3
- package/dist/{kimi-EVD7YKXS.js → kimi-NV72FVAO.js} +3 -3
- package/dist/{kiro-UQRY6EIO.js → kiro-C5W6AGDR.js} +3 -3
- package/dist/{leaderboard-MUJ7DURM.js → leaderboard-TIBVONVT.js} +3 -3
- package/dist/mimo-code-IMM5YM3M.js +754 -0
- package/dist/mimo-code-IMM5YM3M.js.map +1 -0
- package/dist/{mux-5CI5FP2W.js → mux-DSSH4AFS.js} +3 -3
- package/dist/nemoclaw-3EVNKD3I.js +58 -0
- package/dist/nemoclaw-3EVNKD3I.js.map +1 -0
- package/dist/{omp-AXA7XY22.js → omp-Z6FRNDPN.js} +3 -3
- package/dist/openclaw-7G437NT7.js +18 -0
- package/dist/openclaw-7G437NT7.js.map +1 -0
- package/dist/{opencode-NZBRLJN3.js → opencode-Q6KBSAKW.js} +3 -3
- package/dist/{package-SYPA5POO.js → package-RMPN57YZ.js} +7 -6
- package/dist/{package-SYPA5POO.js.map → package-RMPN57YZ.js.map} +1 -1
- package/dist/{pi-WMTUX6ES.js → pi-LZT6WWAZ.js} +2 -2
- package/dist/{qwen-code-MRRIUQ3P.js → qwen-code-WQBKRPWJ.js} +3 -3
- package/dist/{roo-code-NI5UU6JB.js → roo-code-GWSNU3OW.js} +137 -4
- package/dist/roo-code-GWSNU3OW.js.map +1 -0
- package/dist/runtime/index.d.ts +96 -2
- package/dist/runtime/index.js +18 -10
- package/dist/sdk/index.d.ts +52 -0
- package/dist/sdk/index.js +81 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/test.d.ts +74 -0
- package/dist/sdk/test.js +291 -0
- package/dist/sdk/test.js.map +1 -0
- package/dist/{serve-XJOSA7BY.js → serve-D3GO36UT.js} +12 -9
- package/dist/{serve-XJOSA7BY.js.map → serve-D3GO36UT.js.map} +1 -1
- package/dist/{status-DYSS6BOR.js → status-KOSKCETC.js} +10 -8
- package/dist/{status-DYSS6BOR.js.map → status-KOSKCETC.js.map} +1 -1
- package/dist/statusline-ZNTCL5YC.js +59 -0
- package/dist/statusline-ZNTCL5YC.js.map +1 -0
- package/dist/{telemetry-IJ4GP2Q3.js → telemetry-XIKUUGTQ.js} +5 -4
- package/dist/{telemetry-IJ4GP2Q3.js.map → telemetry-XIKUUGTQ.js.map} +1 -1
- package/dist/{trae-CQC72RHH.js → trae-NWT3TMSZ.js} +99 -5
- package/dist/trae-NWT3TMSZ.js.map +1 -0
- package/dist/{types-CNigfEuR.d.ts → types-BEKsAium.d.ts} +268 -6
- package/dist/{uninstall-3DXIBRCV.js → uninstall-2LBLQVFA.js} +12 -10
- package/dist/{uninstall-3DXIBRCV.js.map → uninstall-2LBLQVFA.js.map} +1 -1
- package/dist/{upgrade-GJEB3ITY.js → upgrade-ZC2S7VRN.js} +12 -10
- package/dist/{upgrade-GJEB3ITY.js.map → upgrade-ZC2S7VRN.js.map} +1 -1
- package/dist/{usage-2BJLM3GJ.js → usage-E2A4O2CY.js} +3 -3
- package/dist/{usage-event-472X3DOY.js → usage-event-JKMC4QC4.js} +11 -8
- package/dist/{usage-event-472X3DOY.js.map → usage-event-JKMC4QC4.js.map} +1 -1
- package/dist/{vscode-copilot-4RVRTCKV.js → vscode-copilot-ALV45XF6.js} +3 -3
- package/dist/{warp-X6MB67NT.js → warp-H6IX4U3J.js} +3 -3
- package/dist/{zed-NTCYW4V2.js → zed-RH34TNSW.js} +3 -3
- package/package.json +9 -1
- package/dist/amp-YGV66GJT.js.map +0 -1
- package/dist/chunk-3JCRUROU.js.map +0 -1
- package/dist/chunk-44HUXXC6.js.map +0 -1
- package/dist/chunk-DS3LUFVN.js.map +0 -1
- package/dist/chunk-GSGDG2BV.js.map +0 -1
- package/dist/chunk-KVAAFYRR.js.map +0 -1
- package/dist/chunk-MEH7GC7R.js.map +0 -1
- package/dist/chunk-NJU275US.js +0 -238
- package/dist/chunk-NJU275US.js.map +0 -1
- package/dist/chunk-PD4VFEBY.js.map +0 -1
- package/dist/chunk-QADSG2JY.js.map +0 -1
- package/dist/chunk-ZAM4M7LI.js.map +0 -1
- package/dist/claude-code-4275HQU4.js.map +0 -1
- package/dist/codebuff-LE3KBZGM.js.map +0 -1
- package/dist/cursor-UH3W622V.js.map +0 -1
- package/dist/doctor-N5KZDD55.js.map +0 -1
- package/dist/droid-T5VBRXZF.js.map +0 -1
- package/dist/goose-M3RR3CZG.js.map +0 -1
- package/dist/openclaw-UZ5BMCGQ.js.map +0 -1
- package/dist/roo-code-NI5UU6JB.js.map +0 -1
- package/dist/trae-CQC72RHH.js.map +0 -1
- /package/dist/{antigravity-7IBYFO6P.js.map → antigravity-ANDKF3K7.js.map} +0 -0
- /package/dist/{antigravity-cli-JEOUP2VN.js.map → antigravity-cli-LLRPDDOT.js.map} +0 -0
- /package/dist/{chunk-SCVBYSF7.js.map → chunk-6XHB6BE3.js.map} +0 -0
- /package/dist/{chunk-KQSNDFBN.js.map → chunk-LL4OBGRU.js.map} +0 -0
- /package/dist/{chunk-WNREHWKL.js.map → chunk-MAH6QQTO.js.map} +0 -0
- /package/dist/{codex-4BY2ZJIW.js.map → codex-BXA4FIF4.js.map} +0 -0
- /package/dist/{copilot-cli-IPISKO3V.js.map → copilot-cli-ROIBTTDT.js.map} +0 -0
- /package/dist/{crush-X3E25EQG.js.map → crush-QLEFLHUC.js.map} +0 -0
- /package/dist/{gemini-cli-ZSUK55UA.js.map → gemini-cli-SLVWLXJW.js.map} +0 -0
- /package/dist/{hermes-CUNKIAR5.js.map → hermes-ONDCECP2.js.map} +0 -0
- /package/dist/{jetbrains-copilot-C3HDGGML.js.map → jetbrains-copilot-YABZ3HFA.js.map} +0 -0
- /package/dist/{kilo-PKAJCWPX.js.map → kilo-F3ZDZKCT.js.map} +0 -0
- /package/dist/{kilo-cli-QWUVXG2O.js.map → kilo-cli-3HWPWBY4.js.map} +0 -0
- /package/dist/{kimi-EVD7YKXS.js.map → kimi-NV72FVAO.js.map} +0 -0
- /package/dist/{kiro-UQRY6EIO.js.map → kiro-C5W6AGDR.js.map} +0 -0
- /package/dist/{leaderboard-MUJ7DURM.js.map → leaderboard-TIBVONVT.js.map} +0 -0
- /package/dist/{mux-5CI5FP2W.js.map → mux-DSSH4AFS.js.map} +0 -0
- /package/dist/{omp-AXA7XY22.js.map → omp-Z6FRNDPN.js.map} +0 -0
- /package/dist/{opencode-NZBRLJN3.js.map → opencode-Q6KBSAKW.js.map} +0 -0
- /package/dist/{pi-WMTUX6ES.js.map → pi-LZT6WWAZ.js.map} +0 -0
- /package/dist/{qwen-code-MRRIUQ3P.js.map → qwen-code-WQBKRPWJ.js.map} +0 -0
- /package/dist/{usage-2BJLM3GJ.js.map → usage-E2A4O2CY.js.map} +0 -0
- /package/dist/{vscode-copilot-4RVRTCKV.js.map → vscode-copilot-ALV45XF6.js.map} +0 -0
- /package/dist/{warp-X6MB67NT.js.map → warp-H6IX4U3J.js.map} +0 -0
- /package/dist/{zed-NTCYW4V2.js.map → zed-RH34TNSW.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/mimo-code/index.ts"],"sourcesContent":["/**\n * adapters/mimo-code — Xiaomi MiMoCode platform adapter for agent-connector.\n *\n * MiMoCode (github.com/XiaomiMiMo/MiMo-Code, MIT) is Xiaomi's open-source\n * terminal AI coding agent — a FORK OF OpenCode (anomalyco/opencode) that adds\n * cross-session memory, checkpoints, subagents, etc. Official npm `@mimo-ai/cli`\n * (bin: `mimo`). NOTE: `@xiaomi-mimo/cli` is an UNOFFICIAL squatter (GPL) — not\n * referenced here; the bin is `mimo`, NOT `mimo-code`.\n *\n * DESIGN — STANDALONE (mirrors OpenCode's render logic with mimocode paths),\n * NOT `extends OpenCodeAdapter`. The OpenCode adapter binds the host string in\n * several places that a subclass cannot cleanly override:\n * - a module-level `const HOST = \"opencode\"` used for the per-platform server/\n * hooks override lookup (`ctx.connector.platforms[HOST]`) and stamped as\n * `hostPlatform` on every parsed event — extending would read\n * `platforms[\"opencode\"]` overrides and mis-stamp events as opencode;\n * - the PRIVATE `buildPluginSource` hardcodes `[\"hook\", \"opencode\", event, …]`\n * in the GENERATED bridge, so an inherited plugin would dispatch the runtime\n * hook to the opencode adapter (`hook opencode`) instead of mimo-code;\n * - the config/plugin/content directory builders hardcode \"opencode\" /\n * \".opencode\" / \"opencode.json\".\n * Overriding all of that means re-implementing the private render core anyway,\n * so this adapter mirrors OpenCode's logic with a `HOST = \"mimo-code\"` constant\n * and the mimocode paths — a clean standalone that routes detection, the runtime\n * bridge, and per-platform overrides to its own id.\n *\n * MiMoCode IS OpenCode's config dialect, so the render shapes are IDENTICAL:\n * - config file `mimocode.json`\n * user scope → ~/.config/mimocode/mimocode.json\n * project scope → <projectDir>/mimocode.json\n * (the dir is `.mimocode` / `~/.config/mimocode` — NO hyphen; the committed\n * example is `.mimocode/mimocode.jsonc`).\n * - MCP root key \"mcp\" (the OpenCode shape, NOT \"mcpServers\"); each server\n * keyed by name; stdio → { type:\"local\", command:[exe,…args], environment },\n * remote → { type:\"remote\", url }.\n * - ts-plugin hooks: a self-contained ESM bridge module auto-loaded from the\n * user scope → ~/.config/mimocode/plugin/<id>.js\n * project scope → <projectDir>/.mimocode/plugin/<id>.js\n * plugin dir (writing the file IS the registration; no config array edit).\n * - content surfaces under <mcDir>/{commands,skills,agent} (singular `agent/`,\n * matching OpenCode).\n *\n * Event mapping (OpenCode's, unchanged):\n * PreToolUse → \"tool.execute.before\" (mutate output.args; throw to deny)\n * PostToolUse → \"tool.execute.after\" (mutate output.output)\n * SessionStart → \"experimental.chat.system.transform\" (inject into output.system)\n *\n * SOURCES: github.com/XiaomiMiMo/MiMo-Code (README, .mimocode/mimocode.jsonc,\n * packages/opencode/src/config/{config.ts,mcp.ts,plugin.ts}). npm @mimo-ai/cli.\n * mimo.xiaomi.com/en/mimocode.\n */\n\nimport {\n chmodSync,\n existsSync,\n mkdirSync,\n readFileSync,\n rmSync,\n writeFileSync,\n} from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type {\n Adapter,\n GeneratedPluginFile,\n HookReply,\n InstallContext,\n MemoryTarget,\n NormalizedEvent,\n} from \"../spi.js\";\nimport type {\n ChangeRecord,\n CommandDef,\n DetectedPlatform,\n HealthCheck,\n HookEventName,\n HookParadigm,\n HookResponse,\n PlatformCapabilities,\n PlatformId,\n PostToolUseEvent,\n PreToolUseEvent,\n ServerDef,\n SessionStartEvent,\n SkillDef,\n SubagentDef,\n Transport,\n} from \"../../core/types.js\";\nimport { resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport {\n buildServeWrapperCommand,\n shouldWrapForTelemetry,\n} from \"../../core/spawn.js\";\n\nconst HOST: PlatformId = \"mimo-code\";\nconst MCP_ROOT_KEY = \"mcp\";\n\n/** The config dir name (NO hyphen): `.mimocode` / `~/.config/mimocode`. */\nconst CONFIG_DIR_NAME = \"mimocode\";\n/** The config file name: `mimocode.json`. */\nconst CONFIG_FILE_NAME = \"mimocode.json\";\n\n/**\n * Canonical → MiMoCode (OpenCode-shaped) event name map. A connector hook event\n * is only emitted by the generated plugin when it appears here AND is declared\n * by the connector.\n */\nconst EVENT_TO_MIMOCODE: Partial<Record<HookEventName, string>> = {\n PreToolUse: \"tool.execute.before\",\n PostToolUse: \"tool.execute.after\",\n // No real SessionStart hook (inherited from OpenCode #14808 / #5409). The\n // verified surrogate is experimental.chat.system.transform.\n SessionStart: \"experimental.chat.system.transform\",\n};\n\n/** Raw payload the generated plugin posts to the universal hook entrypoint. */\ninterface MiMoCodeBridgePayload {\n toolName?: string;\n toolInput?: Record<string, unknown>;\n toolOutput?: string;\n isError?: boolean;\n sessionId?: string;\n projectDir?: string;\n}\n\n/** Native MCP server entry shapes MiMoCode accepts under the \"mcp\" key. */\ninterface MiMoCodeLocalServer {\n type: \"local\";\n command: string[];\n environment?: Record<string, string>;\n enabled?: boolean;\n}\ninterface MiMoCodeRemoteServer {\n type: \"remote\";\n url: string;\n enabled?: boolean;\n}\n\nexport class MiMoCodeAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"MiMoCode\";\n readonly paradigm: HookParadigm = \"ts-plugin\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: AGENTS.md-first managed block (CLAUDE.md fallback, like\n // OpenCode — MiMoCode keeps OpenCode's CLAUDE.md import + AGENTS.md reading).\n supportsMemory: true,\n preToolUse: true,\n postToolUse: true,\n preCompact: false,\n sessionStart: true,\n sessionEnd: false,\n userPromptSubmit: false,\n stop: false,\n notification: false,\n // tool.execute.before mutates output.args → input rewrite supported.\n canModifyArgs: true,\n // tool.execute.after mutates output.output → output rewrite supported.\n canModifyOutput: true,\n // injected via experimental.chat.system.transform at session start.\n canInjectSessionContext: true,\n transports: [\"stdio\", \"sse\", \"http\"],\n // Content surfaces: MiMoCode authors all three natively under <mcDir>\n // (inherited from OpenCode's commands/skills/agent layout).\n supportsCommands: true,\n supportsSkills: true,\n supportsSubagents: true,\n };\n\n // ── Detection ──────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userConfigDir = join(homedir(), \".config\", CONFIG_DIR_NAME);\n const userConfig = join(userConfigDir, CONFIG_FILE_NAME);\n const projectConfig = join(projectDir, CONFIG_FILE_NAME);\n\n const userInstalled = existsSync(userConfigDir) || existsSync(userConfig);\n const projInstalled = existsSync(projectConfig);\n const installed = userInstalled || projInstalled;\n\n // Report the marker that actually matched so a project-only install isn't\n // misreported as a (non-existent) user install.\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projectConfig : userConfig;\n\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n configPath,\n scope,\n reason: installed\n ? scope === \"project\"\n ? `found project MiMoCode config at ${projectConfig}`\n : `found MiMoCode config under ${userConfigDir}`\n : `no MiMoCode config at ${userConfigDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Memory surface: AGENTS.md / CLAUDE.md-fallback probe (project) ──────\n // Mirrors OpenCode: project AGENTS.md, falling back to CLAUDE.md ONLY when no\n // AGENTS.md exists (creating AGENTS.md beside a relied-on CLAUDE.md would\n // shadow the user's rules). User scope stays on the BaseAdapter default.\n protected override memoryTargets(ctx: InstallContext): MemoryTarget[] {\n if (this.memoryOverride(ctx)?.path || ctx.scope !== \"project\") {\n return super.memoryTargets(ctx);\n }\n const agentsMd = join(ctx.projectDir, \"AGENTS.md\");\n if (existsSync(agentsMd)) {\n return [{ path: agentsMd, reason: \"AGENTS.md (mimocode's primary project rules file)\" }];\n }\n const claudeMd = join(ctx.projectDir, \"CLAUDE.md\");\n if (existsSync(claudeMd)) {\n return [\n {\n path: claudeMd,\n reason:\n \"CLAUDE.md (mimocode's fallback rules file — creating AGENTS.md would shadow it)\",\n },\n ];\n }\n return [{ path: agentsMd, reason: \"AGENTS.md standard (created; no mimocode rules file yet)\" }];\n }\n\n // ── Native paths ───────────────────────────────────────────────────────\n\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? ctx.projectDir\n : join(homedir(), \".config\", CONFIG_DIR_NAME);\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), CONFIG_FILE_NAME);\n }\n\n /**\n * For ts-plugin hosts the \"hook config path\" is the generated plugin FILE.\n * MiMoCode (like OpenCode) auto-loads every file in the plugin dir; writing\n * this file IS the registration.\n */\n getHookConfigPath(ctx: InstallContext): string {\n return join(this.pluginDir(ctx), this.pluginFileName(ctx));\n }\n\n /** Plugin directory MiMoCode auto-loads modules from, per scope. */\n private pluginDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, `.${CONFIG_DIR_NAME}`, \"plugin\")\n : join(homedir(), \".config\", CONFIG_DIR_NAME, \"plugin\");\n }\n\n /** Plugin module file name (one per connector, kebab-case id). */\n private pluginFileName(ctx: InstallContext): string {\n return `${ctx.connector.id}.js`;\n }\n\n // ── MCP server install / uninstall ─────────────────────────────────────\n\n installServer(ctx: InstallContext): ChangeRecord[] {\n const server = this.effectiveServer(ctx);\n const serverPath = this.getServerConfigPath(ctx);\n\n if (!server) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: serverPath,\n detail: ctx.connector.server\n ? \"server registration disabled for mimo-code\"\n : \"connector declares no MCP server\",\n },\n ];\n }\n\n const entry = this.renderServerEntry(ctx, server);\n return [\n this.upsertServerInJson(\n serverPath,\n MCP_ROOT_KEY,\n ctx.connector.id,\n entry,\n ctx.dryRun,\n ),\n ];\n }\n\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const serverPath = this.getServerConfigPath(ctx);\n return [\n this.removeServerFromJson(\n serverPath,\n MCP_ROOT_KEY,\n ctx.connector.id,\n ctx.dryRun,\n ),\n ];\n }\n\n /** Resolve the per-platform server override into an effective ServerDef. */\n private effectiveServer(ctx: InstallContext): ServerDef | undefined {\n const override = ctx.connector.platforms[HOST]?.server;\n if (override === false) return undefined;\n const base = ctx.connector.server;\n if (!base) return undefined;\n return override && typeof override === \"object\" ? { ...base, ...override } : base;\n }\n\n /**\n * Render a normalized ServerDef into MiMoCode's native \"mcp\" entry (OpenCode\n * dialect).\n *\n * stdio → { type: \"local\", command: [exe, ...args], environment }\n * remote → { type: \"remote\", url }\n *\n * MiMoCode flattens command+args into a single ARRAY. When telemetry wrapping\n * applies, the wrapper's command+args (which already include the real command\n * tail after `--`) become the head of that array. No native interpolation\n * token → resolve every ${env:VAR} reference to a literal at install time.\n */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): MiMoCodeLocalServer | MiMoCodeRemoteServer {\n const transport: Transport = server.transport;\n\n if (transport === \"stdio\") {\n let command = server.command ?? \"\";\n let args = [...(server.args ?? [])];\n\n if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {\n const wrapped = buildServeWrapperCommand(\n ctx.homeBinPath,\n ctx.connector.id,\n command,\n args,\n ctx.scope,\n this.id,\n );\n command = wrapped.command;\n args = wrapped.args;\n }\n\n const commandArray = resolveEnvRefsDeep([command, ...args]).filter(\n (s) => s !== \"\",\n );\n const entry: MiMoCodeLocalServer = {\n type: \"local\",\n command: commandArray,\n };\n const environment = this.renderEnv(server.env);\n if (environment) entry.environment = environment;\n if (server.enabled === false) entry.enabled = false;\n return entry;\n }\n\n // sse / http / ws (any remote transport) — MiMoCode registers a URL.\n const entry: MiMoCodeRemoteServer = {\n type: \"remote\",\n url: resolveEnvRefsDeep(server.url ?? \"\"),\n };\n if (server.enabled === false) entry.enabled = false;\n return entry;\n }\n\n /** Render env values, resolving every ${env:VAR} reference to a literal. */\n private renderEnv(\n env: Record<string, string> | undefined,\n ): Record<string, string> | undefined {\n if (!env || Object.keys(env).length === 0) return undefined;\n return resolveEnvRefsDeep({ ...env });\n }\n\n // ── Hook install / uninstall (ts-plugin) ───────────────────────────────\n\n installHooks(ctx: InstallContext): ChangeRecord[] {\n const pluginPath = this.getHookConfigPath(ctx);\n\n if (ctx.connector.platforms[HOST]?.hooks === false) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: pluginPath,\n detail: \"hooks disabled for mimo-code\",\n },\n ];\n }\n if (ctx.connector.hookEvents.length === 0) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: pluginPath,\n detail: \"connector declares no hooks\",\n },\n ];\n }\n\n const files = this.synthesizePlugin(ctx);\n const changes: ChangeRecord[] = [];\n\n for (const file of files) {\n const before = existsSync(file.path)\n ? this.safeRead(file.path)\n : undefined;\n let action: ChangeRecord[\"action\"];\n if (before === undefined) action = \"create\";\n else if (before === file.contents) action = \"skip\";\n else action = \"update\";\n\n if (action !== \"skip\" && !ctx.dryRun) {\n ensureDir(dirname(file.path));\n writeFileSync(file.path, file.contents, \"utf8\");\n chmodSync(file.path, file.executable ? 0o755 : 0o644);\n }\n\n changes.push({\n platform: this.id,\n action,\n path: file.path,\n detail: `mimo-code plugin module (${this.hookDetail(ctx)})`,\n });\n }\n\n return changes;\n }\n\n /**\n * Human-facing summary of which declared events the synthesized module\n * ACTUALLY wires. Only events present in EVENT_TO_MIMOCODE are mapped/wired;\n * any declared event with no mapping is reported separately as \"unsupported\n * here\" so the detail never overstates coverage.\n */\n private hookDetail(ctx: InstallContext): string {\n const declared = ctx.connector.hookEvents;\n const mapped = declared.filter((e) => EVENT_TO_MIMOCODE[e] !== undefined);\n const unsupported = declared.filter((e) => EVENT_TO_MIMOCODE[e] === undefined);\n const base = mapped.join(\",\");\n return unsupported.length > 0\n ? `${base}; unsupported here: ${unsupported.join(\",\")}`\n : base;\n }\n\n uninstallHooks(ctx: InstallContext): ChangeRecord[] {\n const pluginPath = this.getHookConfigPath(ctx);\n if (!existsSync(pluginPath)) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: pluginPath,\n detail: \"no mimo-code plugin module present\",\n },\n ];\n }\n if (!ctx.dryRun) rmSync(pluginPath, { force: true });\n return [\n {\n platform: this.id,\n action: \"remove\",\n path: pluginPath,\n detail: \"mimo-code plugin module\",\n },\n ];\n }\n\n // ── Content surfaces: commands / skills / subagents ──────────────────────\n // CONTENT-ONLY: pure native-file writers under <mcDir>/{commands,skills,\n // agent}. No runtime dispatch, no home-bin pointer, no telemetry wrap. Each\n // method is idempotent (byte-identical → skip) and reversible. Mirrors\n // OpenCode's layout: commands/<name>.md, skills/<name>/SKILL.md, and the\n // SINGULAR agent/<name>.md dir for subagents. For project scope the content\n // root is <projectDir>/.mimocode (NOT the project root where mimocode.json\n // lives).\n\n private contentRootDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, `.${CONFIG_DIR_NAME}`)\n : this.getConfigDir(ctx);\n }\n private commandsDir(ctx: InstallContext): string {\n return join(this.contentRootDir(ctx), \"commands\");\n }\n private skillsDir(ctx: InstallContext): string {\n return join(this.contentRootDir(ctx), \"skills\");\n }\n private agentDir(ctx: InstallContext): string {\n return join(this.contentRootDir(ctx), \"agent\");\n }\n\n /** Native command file path: <mcDir>/commands/<name>.md. */\n private commandPath(ctx: InstallContext, name: string): string {\n return join(this.commandsDir(ctx), `${name}.md`);\n }\n /** Native skill dir: <mcDir>/skills/<name>. */\n private skillDir(ctx: InstallContext, name: string): string {\n return join(this.skillsDir(ctx), name);\n }\n /** Native subagent file path: <mcDir>/agent/<name>.md (SINGULAR dir). */\n private subagentPath(ctx: InstallContext, name: string): string {\n return join(this.agentDir(ctx), `${name}.md`);\n }\n\n // ── Commands ──────────────────────────────────────────────────────────────\n\n override installCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.commands === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"commands disabled for mimo-code\" }];\n }\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.writeContentFile(\n this.commandPath(ctx, cmd.name),\n this.renderCommand(cmd),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun),\n );\n }\n\n /** Render a command to md+frontmatter (description, model, subtask). */\n private renderCommand(cmd: CommandDef): string {\n const frontmatter: Record<string, unknown> = {};\n if (cmd.description !== undefined) frontmatter.description = cmd.description;\n if (cmd.model !== undefined) frontmatter.model = cmd.model;\n if (cmd.subtask !== undefined) frontmatter.subtask = cmd.subtask;\n if (cmd.extra) Object.assign(frontmatter, cmd.extra);\n return this.renderFrontmatterMd(frontmatter, cmd.prompt);\n }\n\n // ── Skills ────────────────────────────────────────────────────────────────\n\n override installSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.skills === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for mimo-code\" }];\n }\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(\n this.writeContentFile(join(dir, \"SKILL.md\"), this.renderSkill(skill), ctx.dryRun),\n );\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\n });\n continue;\n }\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\n }\n }\n return changes;\n }\n\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\n for (const rel of Object.keys(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) continue;\n changes.push(this.removeContentFile(target, ctx.dryRun));\n }\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\n }\n return changes;\n }\n\n /**\n * Render a skill's SKILL.md (UNIFORM across platforms): frontmatter\n * (name, description + optional model, allowed-tools, disable-model-invocation)\n * + markdown body.\n */\n private renderSkill(skill: SkillDef): string {\n const frontmatter: Record<string, unknown> = {\n name: skill.name,\n description: skill.description,\n };\n if (skill.model !== undefined) frontmatter.model = skill.model;\n const allow = skill.tools?.allow;\n if (allow && allow.length > 0) frontmatter[\"allowed-tools\"] = allow.join(\", \");\n if (skill.disableModelInvocation !== undefined) {\n frontmatter[\"disable-model-invocation\"] = skill.disableModelInvocation;\n }\n if (skill.extra) Object.assign(frontmatter, skill.extra);\n return this.renderFrontmatterMd(frontmatter, skill.body);\n }\n\n // ── Subagents ───────────────────────────────────────────────────────────────\n\n override installSubagents(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.subagents === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"subagents disabled for mimo-code\" }];\n }\n if (connector.subagents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no subagents\" }];\n }\n return connector.subagents.map((agent) =>\n this.writeContentFile(\n this.subagentPath(ctx, agent.name),\n this.renderSubagent(agent),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallSubagents(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.subagents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no subagents\" }];\n }\n return connector.subagents.map((agent) =>\n this.removeContentFile(this.subagentPath(ctx, agent.name), ctx.dryRun),\n );\n }\n\n /**\n * Render a subagent to md+frontmatter (OpenCode's shape, inherited by\n * MiMoCode): (description, mode:\"subagent\", model, permission) with the system\n * prompt as the body. `name` comes from the filename. A readonly agent gets a\n * per-tool deny map (edit/bash) so it cannot mutate the workspace.\n */\n private renderSubagent(agent: SubagentDef): string {\n const frontmatter: Record<string, unknown> = {\n description: agent.description,\n mode: \"subagent\",\n };\n if (agent.model !== undefined) frontmatter.model = agent.model;\n if (agent.readonly === true) {\n frontmatter.permission = { edit: \"deny\", bash: \"deny\" };\n }\n if (agent.extra) Object.assign(frontmatter, agent.extra);\n return this.renderFrontmatterMd(frontmatter, agent.prompt);\n }\n\n // ── ts-plugin synthesis ────────────────────────────────────────────────\n\n /**\n * Build ONE self-contained ESM bridge module for MiMoCode. The module imports\n * nothing from agent-connector; it embeds the home-bin path + connector id and\n * a `bridge()` helper that shells out to the universal hook entrypoint\n * (`<homeBin> hook mimo-code <event> --connector <id>`), feeding the payload on\n * stdin and JSON.parsing the normalized HookResponse from stdout (fail-open).\n */\n synthesizePlugin(ctx: InstallContext): GeneratedPluginFile[] {\n const path = this.getHookConfigPath(ctx);\n const contents = this.buildPluginSource(ctx);\n return [{ path, contents, executable: false }];\n }\n\n /** Compose the generated plugin source with plain string concatenation. */\n private buildPluginSource(ctx: InstallContext): string {\n const homeBin = JSON.stringify(ctx.homeBinPath);\n const connectorId = JSON.stringify(ctx.connector.id);\n\n const events = ctx.connector.hookEvents.filter(\n (e): e is HookEventName => EVENT_TO_MIMOCODE[e] !== undefined,\n );\n const has = (e: HookEventName) => events.includes(e);\n\n const header = `/**\n * AUTO-GENERATED by agent-connector — DO NOT EDIT.\n *\n * Self-contained MiMoCode plugin bridge for connector ${ctx.connector.id}.\n * It imports nothing from agent-connector: every hook invocation shells out to\n * the stable home binary's universal entrypoint and JSON-parses the normalized\n * response. Fail-open: any bridge error degrades to \"allow\".\n */\nimport { execFileSync, execSync } from \"node:child_process\";\n\nconst HOME_BIN = ${homeBin};\nconst CONNECTOR_ID = ${connectorId};\n\n/**\n * Invoke the universal hook entrypoint for one event.\n * @param {string} event canonical event name (PreToolUse|PostToolUse|SessionStart)\n * @param {object} payload MiMoCode-shaped payload posted on stdin\n * @returns {object|null} normalized HookResponse, or null on any failure\n */\nfunction bridge(event, payload) {\n try {\n // On Windows HOME_BIN is the agent-connector.cmd launcher: Node cannot\n // execFile a batch file, and shell+args is deprecated (DEP0190), so run one\n // quoted command line via a shell. POSIX keeps the direct execFile (no shell).\n const args = [\"hook\", \"mimo-code\", event, \"--connector\", CONNECTOR_ID];\n const opts = { input: JSON.stringify(payload), encoding: \"utf8\" };\n const stdout =\n process.platform === \"win32\"\n ? execSync([HOME_BIN, ...args].map((a) => '\"' + a + '\"').join(\" \"), opts)\n : execFileSync(HOME_BIN, args, opts);\n const text = (stdout || \"\").trim();\n if (text === \"\") return { decision: \"allow\" };\n return JSON.parse(text);\n } catch {\n // Fail-open — never wedge a tool call on a bridge error.\n return null;\n }\n}\n`;\n\n const handlers: string[] = [];\n\n if (has(\"PreToolUse\")) {\n handlers.push(` // PreToolUse → block (throw) / rewrite args (mutate output.args).\n \"tool.execute.before\": async (input, output) => {\n const payload = {\n toolName: input.tool ?? \"\",\n toolInput: (output && output.args) ?? {},\n sessionId: input.sessionID ?? \"\",\n projectDir: PROJECT_DIR,\n };\n const res = bridge(\"PreToolUse\", payload);\n if (!res) return;\n // MiMoCode has no \"ask\" gate — degrade \"ask\" to a block (safe direction).\n if (res.decision === \"deny\" || res.decision === \"ask\") {\n throw new Error(res.reason || \"Blocked by ${ctx.connector.id}\");\n }\n if (res.updatedInput && output && output.args) {\n Object.assign(output.args, res.updatedInput);\n }\n },`);\n }\n\n if (has(\"PostToolUse\")) {\n handlers.push(` // PostToolUse → observe / rewrite tool output (mutate output.output).\n \"tool.execute.after\": async (input, output) => {\n const payload = {\n toolName: input.tool ?? \"\",\n toolInput: input.args ?? {},\n toolOutput: output ? output.output : undefined,\n sessionId: input.sessionID ?? \"\",\n projectDir: PROJECT_DIR,\n };\n const res = bridge(\"PostToolUse\", payload);\n if (!res) return;\n if (typeof res.updatedOutput === \"string\" && output) {\n output.output = res.updatedOutput;\n }\n },`);\n }\n\n if (has(\"SessionStart\")) {\n handlers.push(` // SessionStart surrogate → inject context into the system prompt.\n // MiMoCode has no real SessionStart hook (inherited from OpenCode\n // #14808 / #5409); experimental.chat.system.transform is the injection point.\n \"experimental.chat.system.transform\": async (input, output) => {\n const payload = {\n sessionId: (input && input.sessionID) ?? \"\",\n projectDir: PROJECT_DIR,\n };\n const res = bridge(\"SessionStart\", payload);\n if (!res) return;\n if (res.additionalContext && output && Array.isArray(output.system)) {\n // Insert at index 1 (after the header) to preserve the prompt-cache\n // fold (header must remain system[0]).\n output.system.splice(1, 0, res.additionalContext);\n }\n },`);\n }\n\n const factory = `\nexport default async function (ctx) {\n // ctx.directory is the MiMoCode project root; fall back to cwd.\n const PROJECT_DIR =\n (ctx && (ctx.directory || (ctx.worktree && ctx.worktree.path))) ||\n process.cwd();\n\n return {\n${handlers.join(\"\\n\")}\n };\n}\n`;\n\n return header + factory;\n }\n\n // ── Runtime: parse OUR bridge payload → normalized event ───────────────\n\n /**\n * `raw` is the payload OUR generated plugin posts (NOT a host-native shape):\n * { toolName, toolInput, toolOutput?, isError?, sessionId, projectDir }\n * so this maps straight through.\n */\n parseEvent(event: HookEventName, raw: unknown): NormalizedEvent {\n const input = (raw ?? {}) as MiMoCodeBridgePayload;\n const base = {\n hostPlatform: HOST,\n connectorId: \"\",\n sessionId: typeof input.sessionId === \"string\" ? input.sessionId : \"\",\n raw,\n ...(typeof input.projectDir === \"string\"\n ? { projectDir: input.projectDir }\n : {}),\n } as const;\n\n switch (event) {\n case \"PreToolUse\": {\n const ev: PreToolUseEvent = {\n ...base,\n toolName: input.toolName ?? \"\",\n toolInput: input.toolInput ?? {},\n };\n return ev;\n }\n case \"PostToolUse\": {\n const ev: PostToolUseEvent = {\n ...base,\n toolName: input.toolName ?? \"\",\n toolInput: input.toolInput ?? {},\n ...(typeof input.toolOutput === \"string\"\n ? { toolOutput: input.toolOutput }\n : {}),\n ...(typeof input.isError === \"boolean\"\n ? { isError: input.isError }\n : {}),\n };\n return ev;\n }\n case \"SessionStart\": {\n const ev: SessionStartEvent = { ...base, source: \"startup\" };\n return ev;\n }\n default:\n // Other canonical events are not surfaced by MiMoCode; treat as a\n // session-start-shaped no-op so the dispatcher fails open gracefully.\n return { ...base, source: \"startup\" } satisfies SessionStartEvent;\n }\n }\n\n // ── Runtime: normalized response → reply the generated bridge parses ───\n\n /**\n * Our generated bridge consumes this stdout directly, so the reply body is the\n * NORMALIZED HookResponse itself — the bridge JSON.parses it and reads\n * decision / updatedInput / updatedOutput / additionalContext.\n */\n formatReply(_event: HookEventName, response: HookResponse): HookReply {\n return {\n exitCode: 0,\n stdout: JSON.stringify(response ?? { decision: \"allow\" }),\n };\n }\n\n // ── Diagnostics ────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const serverPath = this.getServerConfigPath(ctx);\n const pluginPath = this.getHookConfigPath(ctx);\n const connectorId = ctx.connector.id;\n const hasHooks = ctx.connector.hookEvents.length > 0;\n\n const checks: HealthCheck[] = [\n {\n name: `${this.name}: mimocode.json present`,\n check: () =>\n existsSync(serverPath)\n ? { status: \"OK\", detail: serverPath }\n : { status: \"FAIL\", detail: `not found: ${serverPath}` },\n },\n {\n name: `${this.name}: mcp.${connectorId} registered`,\n check: () => {\n if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<{ [k: string]: Record<string, unknown> }>(\n serverPath,\n );\n const bucket = cfg?.[MCP_ROOT_KEY];\n if (!cfg || !bucket) {\n return { status: \"FAIL\", detail: `no ${MCP_ROOT_KEY} in ${serverPath}` };\n }\n return connectorId in bucket\n ? { status: \"OK\", detail: `${MCP_ROOT_KEY}.${connectorId} present` }\n : {\n status: \"FAIL\",\n detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${serverPath}`,\n };\n },\n },\n {\n name: `${this.name}: plugin module present`,\n check: () => {\n if (!hasHooks) return { status: \"OK\", detail: \"no hooks declared\" };\n return existsSync(pluginPath)\n ? { status: \"OK\", detail: pluginPath }\n : { status: \"FAIL\", detail: `not found: ${pluginPath}` };\n },\n },\n ];\n\n for (const cmd of ctx.connector.commands) {\n const p = this.commandPath(ctx, cmd.name);\n checks.push({\n name: `${this.name}: command ${cmd.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n for (const skill of ctx.connector.skills) {\n const p = join(this.skillDir(ctx, skill.name), \"SKILL.md\");\n checks.push({\n name: `${this.name}: skill ${skill.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n for (const agent of ctx.connector.subagents) {\n const p = this.subagentPath(ctx, agent.name);\n checks.push({\n name: `${this.name}: subagent ${agent.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n return checks;\n }\n\n /** Read a file, returning undefined on any error (idempotency compare). */\n private safeRead(path: string): string | undefined {\n try {\n return readFileSync(path, \"utf8\");\n } catch {\n return undefined;\n }\n }\n}\n\n/** Create a directory (recursive) if it does not already exist. */\nfunction ensureDir(dir: string): void {\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n}\n\nexport const adapter = new MiMoCodeAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAmC9B,IAAM,OAAmB;AACzB,IAAM,eAAe;AAGrB,IAAM,kBAAkB;AAExB,IAAM,mBAAmB;AAOzB,IAAM,oBAA4D;AAAA,EAChE,YAAY;AAAA,EACZ,aAAa;AAAA;AAAA;AAAA,EAGb,cAAc;AAChB;AAyBO,IAAM,kBAAN,cAA8B,YAA+B;AAAA,EACzD,KAAiB;AAAA,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AE,IAAI,EAAE,QAAQ,QAAQ,QAAQ,cAAc,CAAC,GAAG;AAAA,MAC9F,CAAC;AAAA,IACH;AACA,WAAO;AAAA,EACT;AAAA;AAAA,EAGQ,SAAS,MAAkC;AACjD,QAAI;AACF,aAAO,aAAa,MAAM,MAAM;AAAA,IAClC,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAGA,SAAS,UAAU,KAAmB;AACpC,MAAI,CAAC,WAAW,GAAG,EAAG,WAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AAC1D;AAEO,IAAM,UAAU,IAAI,gBAAgB;AAC3C,IAAO,oBAAQ;","names":["entry"]}
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "./chunk-DBQMX75U.js";
|
|
6
6
|
import {
|
|
7
7
|
BaseAdapter
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IW77FFNX.js";
|
|
9
9
|
import "./chunk-7L6ITC4T.js";
|
|
10
10
|
import {
|
|
11
11
|
buildServeWrapperCommand,
|
|
12
12
|
shouldWrapForTelemetry
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BXGFUENQ.js";
|
|
14
14
|
import "./chunk-N6HH7K6P.js";
|
|
15
15
|
import "./chunk-TRQKHP7D.js";
|
|
16
16
|
|
|
@@ -215,4 +215,4 @@ export {
|
|
|
215
215
|
adapter,
|
|
216
216
|
mux_default as default
|
|
217
217
|
};
|
|
218
|
-
//# sourceMappingURL=mux-
|
|
218
|
+
//# sourceMappingURL=mux-DSSH4AFS.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
OpenClawAdapter
|
|
4
|
+
} from "./chunk-KGGBNKI4.js";
|
|
5
|
+
import "./chunk-DBQMX75U.js";
|
|
6
|
+
import "./chunk-IW77FFNX.js";
|
|
7
|
+
import "./chunk-7L6ITC4T.js";
|
|
8
|
+
import "./chunk-BXGFUENQ.js";
|
|
9
|
+
import "./chunk-N6HH7K6P.js";
|
|
10
|
+
import "./chunk-TRQKHP7D.js";
|
|
11
|
+
|
|
12
|
+
// src/adapters/nemoclaw/index.ts
|
|
13
|
+
import { existsSync } from "fs";
|
|
14
|
+
import { homedir } from "os";
|
|
15
|
+
import { join } from "path";
|
|
16
|
+
var HOST = "nemoclaw";
|
|
17
|
+
var NemoClawAdapter = class extends OpenClawAdapter {
|
|
18
|
+
id = HOST;
|
|
19
|
+
name = "NVIDIA NemoClaw";
|
|
20
|
+
// ── Detection ────────────────────────────────────────────────────────────
|
|
21
|
+
/**
|
|
22
|
+
* Probe the NemoClaw-specific marker `~/.nemoclaw/` (its onboarding writes
|
|
23
|
+
* config.json + rebuild-backups/ + blueprints/ there). This is DISTINCT from
|
|
24
|
+
* OpenClaw's `~/.openclaw/` marker even though NemoClaw drives the wrapped
|
|
25
|
+
* OpenClaw config: a box with `~/.nemoclaw/` is a NemoClaw install. Reported
|
|
26
|
+
* before the OpenClaw adapter in the registry so the more-specific NemoClaw
|
|
27
|
+
* marker wins host detection (a plain OpenClaw box — `~/.openclaw/` only,
|
|
28
|
+
* no `~/.nemoclaw/` — falls through to the openclaw adapter).
|
|
29
|
+
*
|
|
30
|
+
* The config path returned is the WRAPPED OpenClaw config (where MCP/hooks are
|
|
31
|
+
* actually written) so install/doctor point at the file the agent loads.
|
|
32
|
+
*/
|
|
33
|
+
detectInstalled(projectDir) {
|
|
34
|
+
const nemoclawDir = join(homedir(), ".nemoclaw");
|
|
35
|
+
const installed = existsSync(nemoclawDir);
|
|
36
|
+
const base = super.detectInstalled(projectDir);
|
|
37
|
+
return {
|
|
38
|
+
id: this.id,
|
|
39
|
+
name: this.name,
|
|
40
|
+
installed,
|
|
41
|
+
paradigm: this.paradigm,
|
|
42
|
+
capabilities: this.capabilities,
|
|
43
|
+
// Where MCP/hooks land for NemoClaw: the wrapped OpenClaw config.
|
|
44
|
+
configPath: base.configPath,
|
|
45
|
+
scope: base.scope,
|
|
46
|
+
reason: installed ? `found NVIDIA NemoClaw config at ${nemoclawDir} (wraps OpenClaw at ${base.configPath})` : `no NVIDIA NemoClaw config at ${nemoclawDir}`,
|
|
47
|
+
confidence: installed ? "high" : "low"
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var adapter = new NemoClawAdapter();
|
|
52
|
+
var nemoclaw_default = adapter;
|
|
53
|
+
export {
|
|
54
|
+
NemoClawAdapter,
|
|
55
|
+
adapter,
|
|
56
|
+
nemoclaw_default as default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=nemoclaw-3EVNKD3I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/nemoclaw/index.ts"],"sourcesContent":["/**\n * adapters/nemoclaw — NVIDIA NemoClaw platform adapter for agent-connector.\n *\n * NemoClaw (github.com/NVIDIA/NemoClaw, Apache-2.0, v0.1.0) is an\n * orchestrator/wrapper that deploys and lifecycle-manages an OpenClaw agent\n * (the default) inside an NVIDIA OpenShell sandbox. It is ALSO an OpenClaw\n * plugin. It is NOT a Claude/Codex/Gemini fork: the agent it wraps is OpenClaw,\n * and the config the wrapped agent actually loads is the SAME\n * `~/.openclaw/openclaw.json` the OpenClaw adapter already targets (top-level\n * `mcp.servers.<id>` for MCP sidecars; plugins.entries + plugins.load.paths for\n * the ts-plugin bridge — OpenClaw's verified DUAL REGISTRATION shape).\n *\n * DESIGN — a thin fork of {@link OpenClawAdapter} (precedent:\n * AntigravityCliAdapter extends AntigravityAdapter). It REUSES every render /\n * hook / parse / surface path from the parent unchanged — MCP still lands in\n * the wrapped `~/.openclaw/openclaw.json`, the paradigm stays ts-plugin, and the\n * content surfaces (skills) are inherited. The ONLY differences are identity and\n * detection:\n *\n * - id = \"nemoclaw\", name = \"NVIDIA NemoClaw\". Identity flows into the\n * ChangeRecord `platform` stamp and the host-detection result.\n * - detectInstalled probes the NemoClaw-specific marker `~/.nemoclaw/`\n * (config.json + rebuild-backups/ + blueprints/). A NemoClaw box has BOTH\n * markers on disk: it DRIVES the wrapped `~/.openclaw/openclaw.json`, so\n * `~/.openclaw/` is present too. Exclusivity is therefore guaranteed at the\n * SOURCE, not by registry order alone — {@link OpenClawAdapter.detectInstalled}\n * BOWS OUT (reports its user scope not-installed) whenever `~/.nemoclaw/`\n * exists, so the shared config is never double-targeted as two platforms\n * (an `uninstall openclaw` would otherwise strip nemoclaw's entries). nemoclaw\n * is ALSO registered BEFORE openclaw (PlatformId union AND ADAPTER_REGISTRY)\n * as the deterministic tie-break — a NemoClaw box classifies as nemoclaw; an\n * OpenClaw-only box (no `~/.nemoclaw/`) classifies as openclaw.\n *\n * HOOKS: NemoClaw ships NO Claude-style lifecycle hooks of its own\n * (managedChannels are messaging; plugin activation.onStartup and runtime-slash\n * aliases are not hook events). It nonetheless INHERITS OpenClaw's ts-plugin\n * hook machinery — when a connector declares hooks, the inherited installHooks\n * writes the same self-contained OpenClaw plugin bridge into the wrapped\n * `~/.openclaw/openclaw.json` (the agent NemoClaw runs), so the paradigm stays\n * ts-plugin honestly.\n *\n * SOURCES: github.com/NVIDIA/NemoClaw (README, nemoclaw/openclaw.plugin.json,\n * src/onboard/config.ts, test/openclaw-config-snapshot.test.ts,\n * src/lib/state/sandbox.ts), docs.nvidia.com/nemoclaw.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { OpenClawAdapter } from \"../openclaw/index.js\";\nimport type { Adapter } from \"../spi.js\";\nimport type { DetectedPlatform, PlatformId } from \"../../core/types.js\";\n\nconst HOST: PlatformId = \"nemoclaw\";\n\nexport class NemoClawAdapter extends OpenClawAdapter implements Adapter {\n override readonly id: PlatformId = HOST;\n override readonly name = \"NVIDIA NemoClaw\";\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n /**\n * Probe the NemoClaw-specific marker `~/.nemoclaw/` (its onboarding writes\n * config.json + rebuild-backups/ + blueprints/ there). This is DISTINCT from\n * OpenClaw's `~/.openclaw/` marker even though NemoClaw drives the wrapped\n * OpenClaw config: a box with `~/.nemoclaw/` is a NemoClaw install. Reported\n * before the OpenClaw adapter in the registry so the more-specific NemoClaw\n * marker wins host detection (a plain OpenClaw box — `~/.openclaw/` only,\n * no `~/.nemoclaw/` — falls through to the openclaw adapter).\n *\n * The config path returned is the WRAPPED OpenClaw config (where MCP/hooks are\n * actually written) so install/doctor point at the file the agent loads.\n */\n override detectInstalled(projectDir: string): DetectedPlatform {\n const nemoclawDir = join(homedir(), \".nemoclaw\");\n const installed = existsSync(nemoclawDir);\n\n // Inherit OpenClaw's path resolution for the wrapped config (the file the\n // agent NemoClaw runs actually loads) and the capabilities/paradigm.\n const base = super.detectInstalled(projectDir);\n\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n // Where MCP/hooks land for NemoClaw: the wrapped OpenClaw config.\n configPath: base.configPath,\n scope: base.scope,\n reason: installed\n ? `found NVIDIA NemoClaw config at ${nemoclawDir} (wraps OpenClaw at ${base.configPath})`\n : `no NVIDIA NemoClaw config at ${nemoclawDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n}\n\nexport const adapter = new NemoClawAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;AA8CA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,YAAY;AAMrB,IAAM,OAAmB;AAElB,IAAM,kBAAN,cAA8B,gBAAmC;AAAA,EACpD,KAAiB;AAAA,EACjB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBhB,gBAAgB,YAAsC;AAC7D,UAAM,cAAc,KAAK,QAAQ,GAAG,WAAW;AAC/C,UAAM,YAAY,WAAW,WAAW;AAIxC,UAAM,OAAO,MAAM,gBAAgB,UAAU;AAE7C,WAAO;AAAA,MACL,IAAI,KAAK;AAAA,MACT,MAAM,KAAK;AAAA,MACX;AAAA,MACA,UAAU,KAAK;AAAA,MACf,cAAc,KAAK;AAAA;AAAA,MAEnB,YAAY,KAAK;AAAA,MACjB,OAAO,KAAK;AAAA,MACZ,QAAQ,YACJ,mCAAmC,WAAW,uBAAuB,KAAK,UAAU,MACpF,gCAAgC,WAAW;AAAA,MAC/C,YAAY,YAAY,SAAS;AAAA,IACnC;AAAA,EACF;AACF;AAEO,IAAM,UAAU,IAAI,gBAAgB;AAC3C,IAAO,mBAAQ;","names":[]}
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-DBQMX75U.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IW77FFNX.js";
|
|
8
8
|
import "./chunk-7L6ITC4T.js";
|
|
9
9
|
import {
|
|
10
10
|
buildServeWrapperCommand,
|
|
11
11
|
shouldWrapForTelemetry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BXGFUENQ.js";
|
|
13
13
|
import "./chunk-N6HH7K6P.js";
|
|
14
14
|
import "./chunk-TRQKHP7D.js";
|
|
15
15
|
|
|
@@ -594,4 +594,4 @@ export {
|
|
|
594
594
|
adapter,
|
|
595
595
|
omp_default as default
|
|
596
596
|
};
|
|
597
|
-
//# sourceMappingURL=omp-
|
|
597
|
+
//# sourceMappingURL=omp-Z6FRNDPN.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
OpenClawAdapter,
|
|
4
|
+
adapter,
|
|
5
|
+
openclaw_default
|
|
6
|
+
} from "./chunk-KGGBNKI4.js";
|
|
7
|
+
import "./chunk-DBQMX75U.js";
|
|
8
|
+
import "./chunk-IW77FFNX.js";
|
|
9
|
+
import "./chunk-7L6ITC4T.js";
|
|
10
|
+
import "./chunk-BXGFUENQ.js";
|
|
11
|
+
import "./chunk-N6HH7K6P.js";
|
|
12
|
+
import "./chunk-TRQKHP7D.js";
|
|
13
|
+
export {
|
|
14
|
+
OpenClawAdapter,
|
|
15
|
+
adapter,
|
|
16
|
+
openclaw_default as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=openclaw-7G437NT7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-DBQMX75U.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IW77FFNX.js";
|
|
8
8
|
import "./chunk-7L6ITC4T.js";
|
|
9
9
|
import {
|
|
10
10
|
buildServeWrapperCommand,
|
|
11
11
|
shouldWrapForTelemetry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BXGFUENQ.js";
|
|
13
13
|
import "./chunk-N6HH7K6P.js";
|
|
14
14
|
import "./chunk-TRQKHP7D.js";
|
|
15
15
|
|
|
@@ -777,4 +777,4 @@ export {
|
|
|
777
777
|
adapter,
|
|
778
778
|
opencode_default as default
|
|
779
779
|
};
|
|
780
|
-
//# sourceMappingURL=opencode-
|
|
780
|
+
//# sourceMappingURL=opencode-Q6KBSAKW.js.map
|
|
@@ -6,19 +6,20 @@ import {
|
|
|
6
6
|
isPackageFormat,
|
|
7
7
|
packageConnector,
|
|
8
8
|
packageConnectorAll
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MAH6QQTO.js";
|
|
10
10
|
import {
|
|
11
11
|
fail,
|
|
12
12
|
print
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KGXDYGNJ.js";
|
|
14
14
|
import {
|
|
15
15
|
findConnectorConfig,
|
|
16
16
|
loadConnectorFromPath
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-KGJWE6A2.js";
|
|
18
|
+
import "./chunk-ADTHT2FN.js";
|
|
19
|
+
import "./chunk-3PFFTFCU.js";
|
|
19
20
|
import "./chunk-OPXAP3AC.js";
|
|
20
21
|
import "./chunk-7L6ITC4T.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-BXGFUENQ.js";
|
|
22
23
|
import "./chunk-N6HH7K6P.js";
|
|
23
24
|
import "./chunk-TRQKHP7D.js";
|
|
24
25
|
|
|
@@ -127,4 +128,4 @@ async function run(argv) {
|
|
|
127
128
|
export {
|
|
128
129
|
run
|
|
129
130
|
};
|
|
130
|
-
//# sourceMappingURL=package-
|
|
131
|
+
//# sourceMappingURL=package-RMPN57YZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/package.ts"],"sourcesContent":["/**\n * cli/commands/package — emit a marketplace/extension-installable connector bundle.\n *\n * Resolves the connector config (--connector <path>, else findConnectorConfig\n * walking up from the project dir, exactly like install.ts), packages it for the\n * requested --format into --out (default <cwd>/dist-plugin), then prints the\n * emitted file tree plus per-format install instructions.\n *\n * `--format <x>` accepts the full union; `--format all` emits EVERY feasible\n * format, each into <out>/<format>/..., printing install instructions per format.\n * Default --format claude-plugin.\n */\n\nimport { parseArgs } from \"node:util\";\nimport { join, relative } from \"node:path\";\n\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\nimport {\n ALL_FORMATS,\n FEASIBLE_FORMATS,\n installInstructions,\n isPackageFormat,\n packageConnector,\n packageConnectorAll,\n type PackageFormat,\n type PackageResult,\n} from \"../../core/package.js\";\nimport { fail, print } from \"../app.js\";\n\nconst HELP = `agent-connector package — emit a plugin/extension/marketplace bundle.\n\nusage: agent-connector package [flags]\n\nflags:\n --connector <path> Connector config to package (else auto-discovered).\n --format <fmt> Output format (default: claude-plugin). One of:\n ${ALL_FORMATS.join(\", \")}\n or \"all\" to emit every feasible format into <out>/<fmt>/.\n --out <dir> Output directory. Default: <cwd>/dist-plugin.\n --project <dir> Project root for connector discovery (default: cwd).\n --dry-run Compute the file tree without writing anything.\n --help Show this help.`;\n\n/** Print the file tree + the per-format install instructions for one bundle. */\nfunction printFormatResult(\n format: PackageFormat,\n connectorId: string,\n outDir: string,\n result: PackageResult,\n): void {\n print(` pluginDir: ${result.pluginDir}`);\n if (result.marketplacePath) {\n print(` marketplace: ${relative(outDir, result.marketplacePath)}`);\n }\n print(\" emitted files:\");\n for (const f of result.files) {\n print(` + ${relative(outDir, f)}`);\n }\n if (result.notes && result.notes.length > 0) {\n print(\" notes:\");\n for (const n of result.notes) print(` ! ${n}`);\n }\n print(\" install:\");\n for (const line of installInstructions(format, connectorId, outDir)) {\n print(` ${line}`);\n }\n // `package` stays a pure emitter (no host CLIs spawned) — but for hosts whose\n // marketplace flow agent-connector can DRIVE, point at the lifecycle verb.\n if (format === \"claude-plugin\") {\n print(\n \" (or let agent-connector drive it: agent-connector install --method marketplace --targets claude-code)\",\n );\n }\n print(\"\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n format: { type: \"string\", default: \"claude-plugin\" },\n out: { type: \"string\" },\n project: { type: \"string\" },\n \"dry-run\": { type: \"boolean\", default: false },\n help: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n if (values.help) {\n print(HELP);\n return 0;\n }\n\n const formatArg = values.format ?? \"claude-plugin\";\n const isAll = formatArg === \"all\";\n if (!isAll && !isPackageFormat(formatArg)) {\n return fail(\n `invalid --format \"${formatArg}\" (expected one of: ${ALL_FORMATS.join(\", \")}, or \"all\")`,\n );\n }\n\n const projectDir = values.project ?? process.cwd();\n const configPath = values.connector ?? findConnectorConfig(projectDir);\n if (!configPath) {\n return fail(\n \"no connector config found. Pass --connector <path> or add an \" +\n \"agent-connector.config.{mjs,js,json} to your project.\",\n );\n }\n\n const outDir = values.out ?? `${process.cwd()}/dist-plugin`;\n const dryRun = values[\"dry-run\"];\n const mode = dryRun ? \" (dry-run — nothing written)\" : \"\";\n\n const { connector } = await loadConnectorFromPath(configPath);\n\n if (isAll) {\n print(`package \"${connector.id}\" → all formats${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n const results = packageConnectorAll(connector, { outDir, dryRun });\n for (const { format, result } of results) {\n const formatOut = join(outDir, format);\n print(`── ${format} ──`);\n printFormatResult(format, connector.id, formatOut, result);\n }\n print(`emitted ${results.length} formats: ${FEASIBLE_FORMATS.join(\", \")}`);\n return 0;\n }\n\n const format: PackageFormat = formatArg;\n let result: PackageResult;\n try {\n result = packageConnector(connector, { outDir, format, dryRun });\n } catch (err) {\n // Emitter validation errors (e.g. mcp-server-json without\n // publish.registryNamespace) are actionable one-liners — print them as a\n // normal CLI error, never a stack trace.\n const message = err instanceof Error ? err.message : String(err);\n return fail(message);\n }\n\n print(`package \"${connector.id}\" → ${format}${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n printFormatResult(format, connector.id, outDir, result);\n return 0;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/package.ts"],"sourcesContent":["/**\n * cli/commands/package — emit a marketplace/extension-installable connector bundle.\n *\n * Resolves the connector config (--connector <path>, else findConnectorConfig\n * walking up from the project dir, exactly like install.ts), packages it for the\n * requested --format into --out (default <cwd>/dist-plugin), then prints the\n * emitted file tree plus per-format install instructions.\n *\n * `--format <x>` accepts the full union; `--format all` emits EVERY feasible\n * format, each into <out>/<format>/..., printing install instructions per format.\n * Default --format claude-plugin.\n */\n\nimport { parseArgs } from \"node:util\";\nimport { join, relative } from \"node:path\";\n\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\nimport {\n ALL_FORMATS,\n FEASIBLE_FORMATS,\n installInstructions,\n isPackageFormat,\n packageConnector,\n packageConnectorAll,\n type PackageFormat,\n type PackageResult,\n} from \"../../core/package.js\";\nimport { fail, print } from \"../app.js\";\n\nconst HELP = `agent-connector package — emit a plugin/extension/marketplace bundle.\n\nusage: agent-connector package [flags]\n\nflags:\n --connector <path> Connector config to package (else auto-discovered).\n --format <fmt> Output format (default: claude-plugin). One of:\n ${ALL_FORMATS.join(\", \")}\n or \"all\" to emit every feasible format into <out>/<fmt>/.\n --out <dir> Output directory. Default: <cwd>/dist-plugin.\n --project <dir> Project root for connector discovery (default: cwd).\n --dry-run Compute the file tree without writing anything.\n --help Show this help.`;\n\n/** Print the file tree + the per-format install instructions for one bundle. */\nfunction printFormatResult(\n format: PackageFormat,\n connectorId: string,\n outDir: string,\n result: PackageResult,\n): void {\n print(` pluginDir: ${result.pluginDir}`);\n if (result.marketplacePath) {\n print(` marketplace: ${relative(outDir, result.marketplacePath)}`);\n }\n print(\" emitted files:\");\n for (const f of result.files) {\n print(` + ${relative(outDir, f)}`);\n }\n if (result.notes && result.notes.length > 0) {\n print(\" notes:\");\n for (const n of result.notes) print(` ! ${n}`);\n }\n print(\" install:\");\n for (const line of installInstructions(format, connectorId, outDir)) {\n print(` ${line}`);\n }\n // `package` stays a pure emitter (no host CLIs spawned) — but for hosts whose\n // marketplace flow agent-connector can DRIVE, point at the lifecycle verb.\n if (format === \"claude-plugin\") {\n print(\n \" (or let agent-connector drive it: agent-connector install --method marketplace --targets claude-code)\",\n );\n }\n print(\"\");\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n format: { type: \"string\", default: \"claude-plugin\" },\n out: { type: \"string\" },\n project: { type: \"string\" },\n \"dry-run\": { type: \"boolean\", default: false },\n help: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n if (values.help) {\n print(HELP);\n return 0;\n }\n\n const formatArg = values.format ?? \"claude-plugin\";\n const isAll = formatArg === \"all\";\n if (!isAll && !isPackageFormat(formatArg)) {\n return fail(\n `invalid --format \"${formatArg}\" (expected one of: ${ALL_FORMATS.join(\", \")}, or \"all\")`,\n );\n }\n\n const projectDir = values.project ?? process.cwd();\n const configPath = values.connector ?? findConnectorConfig(projectDir);\n if (!configPath) {\n return fail(\n \"no connector config found. Pass --connector <path> or add an \" +\n \"agent-connector.config.{mjs,js,json} to your project.\",\n );\n }\n\n const outDir = values.out ?? `${process.cwd()}/dist-plugin`;\n const dryRun = values[\"dry-run\"];\n const mode = dryRun ? \" (dry-run — nothing written)\" : \"\";\n\n const { connector } = await loadConnectorFromPath(configPath);\n\n if (isAll) {\n print(`package \"${connector.id}\" → all formats${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n const results = packageConnectorAll(connector, { outDir, dryRun });\n for (const { format, result } of results) {\n const formatOut = join(outDir, format);\n print(`── ${format} ──`);\n printFormatResult(format, connector.id, formatOut, result);\n }\n print(`emitted ${results.length} formats: ${FEASIBLE_FORMATS.join(\", \")}`);\n return 0;\n }\n\n const format: PackageFormat = formatArg;\n let result: PackageResult;\n try {\n result = packageConnector(connector, { outDir, format, dryRun });\n } catch (err) {\n // Emitter validation errors (e.g. mcp-server-json without\n // publish.registryNamespace) are actionable one-liners — print them as a\n // normal CLI error, never a stack trace.\n const message = err instanceof Error ? err.message : String(err);\n return fail(message);\n }\n\n print(`package \"${connector.id}\" → ${format}${mode}`);\n print(` outDir: ${outDir}`);\n print(\"\");\n printFormatResult(format, connector.id, outDir, result);\n return 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,SAAS,iBAAiB;AAC1B,SAAS,MAAM,gBAAgB;AAe/B,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAOc,YAAY,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAQjD,SAAS,kBACP,QACA,aACA,QACA,QACM;AACN,QAAM,gBAAgB,OAAO,SAAS,EAAE;AACxC,MAAI,OAAO,iBAAiB;AAC1B,UAAM,kBAAkB,SAAS,QAAQ,OAAO,eAAe,CAAC,EAAE;AAAA,EACpE;AACA,QAAM,kBAAkB;AACxB,aAAW,KAAK,OAAO,OAAO;AAC5B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
|
|
7
7
|
import "./chunk-TRQKHP7D.js";
|
|
@@ -288,4 +288,4 @@ export {
|
|
|
288
288
|
adapter,
|
|
289
289
|
pi_default as default
|
|
290
290
|
};
|
|
291
|
-
//# sourceMappingURL=pi-
|
|
291
|
+
//# sourceMappingURL=pi-LZT6WWAZ.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-DBQMX75U.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseAdapter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IW77FFNX.js";
|
|
11
11
|
import {
|
|
12
12
|
renderSkillMd
|
|
13
13
|
} from "./chunk-7L6ITC4T.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
buildServeWrapperCommand,
|
|
17
17
|
isHomeBinHookCommand,
|
|
18
18
|
shouldWrapForTelemetry
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BXGFUENQ.js";
|
|
20
20
|
import "./chunk-N6HH7K6P.js";
|
|
21
21
|
import "./chunk-TRQKHP7D.js";
|
|
22
22
|
|
|
@@ -751,4 +751,4 @@ export {
|
|
|
751
751
|
adapter,
|
|
752
752
|
qwen_code_default as default
|
|
753
753
|
};
|
|
754
|
-
//# sourceMappingURL=qwen-code-
|
|
754
|
+
//# sourceMappingURL=qwen-code-WQBKRPWJ.js.map
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-DBQMX75U.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IW77FFNX.js";
|
|
8
8
|
import "./chunk-7L6ITC4T.js";
|
|
9
9
|
import {
|
|
10
10
|
buildServeWrapperCommand,
|
|
11
11
|
shouldWrapForTelemetry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BXGFUENQ.js";
|
|
13
13
|
import "./chunk-N6HH7K6P.js";
|
|
14
14
|
import "./chunk-TRQKHP7D.js";
|
|
15
15
|
|
|
@@ -57,7 +57,13 @@ var RooCodeAdapter = class extends BaseAdapter {
|
|
|
57
57
|
canModifyOutput: false,
|
|
58
58
|
canInjectSessionContext: false,
|
|
59
59
|
// Roo Code registers stdio, SSE, and Streamable HTTP MCP servers.
|
|
60
|
-
transports: ["stdio", "sse", "http"]
|
|
60
|
+
transports: ["stdio", "sse", "http"],
|
|
61
|
+
// Content surfaces: Roo Code reads custom slash commands and AgentSkills from
|
|
62
|
+
// its `.roo` config dir (BOTH user ~/.roo and project <projectDir>/.roo).
|
|
63
|
+
// command → <configDir>/commands/<name>.md (md+optional frontmatter)
|
|
64
|
+
// skill → <configDir>/skills/<name>/SKILL.md (+ resources)
|
|
65
|
+
supportsCommands: true,
|
|
66
|
+
supportsSkills: true
|
|
61
67
|
};
|
|
62
68
|
// ── Detection ────────────────────────────────────────────────────────────
|
|
63
69
|
detectInstalled(projectDir) {
|
|
@@ -227,6 +233,133 @@ var RooCodeAdapter = class extends BaseAdapter {
|
|
|
227
233
|
}
|
|
228
234
|
];
|
|
229
235
|
}
|
|
236
|
+
// ── Content surfaces: commands / skills ──────────────────────────────────
|
|
237
|
+
// CONTENT-ONLY: pure native-file writers. No runtime dispatch, no home-bin
|
|
238
|
+
// pointer, no telemetry wrap. Each method is idempotent (byte-identical →
|
|
239
|
+
// skip) via writeContentFile and reversible via removeContentFile. Honors
|
|
240
|
+
// platforms["roo-code"] per-surface false to skip. BOTH scopes are supported:
|
|
241
|
+
// user → ~/.roo, project → <projectDir>/.roo.
|
|
242
|
+
//
|
|
243
|
+
// Native locations (the `.roo` content root, NOT the globalStorage MCP dir):
|
|
244
|
+
// command → <rooDir>/commands/<name>.md md+optional frontmatter
|
|
245
|
+
// (description, argument-hint, + `mode` when cmd.extra carries it)
|
|
246
|
+
// skill → <rooDir>/skills/<name>/SKILL.md (+ resources)
|
|
247
|
+
/**
|
|
248
|
+
* The `.roo` content root for the active scope: ~/.roo (user) or
|
|
249
|
+
* <projectDir>/.roo (project). Distinct from getConfigDir's user-scope path
|
|
250
|
+
* (the VS Code globalStorage `settings` dir, which holds MCP settings only).
|
|
251
|
+
*/
|
|
252
|
+
rooDir(ctx) {
|
|
253
|
+
return ctx.scope === "project" ? join(ctx.projectDir, ".roo") : join(homedir(), ".roo");
|
|
254
|
+
}
|
|
255
|
+
commandPath(ctx, name) {
|
|
256
|
+
return join(this.rooDir(ctx), "commands", `${name}.md`);
|
|
257
|
+
}
|
|
258
|
+
skillDir(ctx, name) {
|
|
259
|
+
return join(this.rooDir(ctx), "skills", name);
|
|
260
|
+
}
|
|
261
|
+
// ── Commands ─────────────────────────────────────────────────────────────
|
|
262
|
+
installCommands(ctx) {
|
|
263
|
+
const { connector } = ctx;
|
|
264
|
+
if (connector.platforms[this.id]?.commands === false) {
|
|
265
|
+
return [{ platform: this.id, action: "skip", detail: "commands disabled for roo-code" }];
|
|
266
|
+
}
|
|
267
|
+
if (connector.commands.length === 0) {
|
|
268
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
|
|
269
|
+
}
|
|
270
|
+
return connector.commands.map(
|
|
271
|
+
(cmd) => this.writeContentFile(this.commandPath(ctx, cmd.name), this.renderCommand(cmd), ctx.dryRun)
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
uninstallCommands(ctx) {
|
|
275
|
+
const { connector } = ctx;
|
|
276
|
+
if (connector.commands.length === 0) {
|
|
277
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
|
|
278
|
+
}
|
|
279
|
+
return connector.commands.map(
|
|
280
|
+
(cmd) => this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun)
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Render a command to md+optional frontmatter (description, argument-hint).
|
|
285
|
+
* Roo Code additionally honors a `mode` frontmatter key; it is passed through
|
|
286
|
+
* only when cmd.extra carries it (the escape-hatch Object.assign below) — the
|
|
287
|
+
* standard description/argument-hint shape otherwise.
|
|
288
|
+
*/
|
|
289
|
+
renderCommand(cmd) {
|
|
290
|
+
const frontmatter = {};
|
|
291
|
+
if (cmd.description !== void 0) frontmatter.description = cmd.description;
|
|
292
|
+
if (cmd.argumentHint !== void 0) frontmatter["argument-hint"] = cmd.argumentHint;
|
|
293
|
+
if (cmd.extra) Object.assign(frontmatter, cmd.extra);
|
|
294
|
+
return this.renderFrontmatterMd(frontmatter, cmd.prompt);
|
|
295
|
+
}
|
|
296
|
+
// ── Skills ───────────────────────────────────────────────────────────────
|
|
297
|
+
installSkills(ctx) {
|
|
298
|
+
const { connector } = ctx;
|
|
299
|
+
if (connector.platforms[this.id]?.skills === false) {
|
|
300
|
+
return [{ platform: this.id, action: "skip", detail: "skills disabled for roo-code" }];
|
|
301
|
+
}
|
|
302
|
+
if (connector.skills.length === 0) {
|
|
303
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
|
|
304
|
+
}
|
|
305
|
+
const changes = [];
|
|
306
|
+
for (const skill of connector.skills) {
|
|
307
|
+
const dir = this.skillDir(ctx, skill.name);
|
|
308
|
+
changes.push(
|
|
309
|
+
this.writeContentFile(join(dir, "SKILL.md"), this.renderSkill(skill), ctx.dryRun)
|
|
310
|
+
);
|
|
311
|
+
for (const [rel, contents] of Object.entries(skill.resources ?? {})) {
|
|
312
|
+
const target = this.resolveWithin(dir, rel);
|
|
313
|
+
if (target === null) {
|
|
314
|
+
changes.push({
|
|
315
|
+
platform: this.id,
|
|
316
|
+
action: "warn",
|
|
317
|
+
detail: `skill resource "${rel}" escapes the skill dir; skipped`
|
|
318
|
+
});
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
changes.push(this.writeContentFile(target, contents, ctx.dryRun));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return changes;
|
|
325
|
+
}
|
|
326
|
+
uninstallSkills(ctx) {
|
|
327
|
+
const { connector } = ctx;
|
|
328
|
+
if (connector.skills.length === 0) {
|
|
329
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
|
|
330
|
+
}
|
|
331
|
+
const changes = [];
|
|
332
|
+
for (const skill of connector.skills) {
|
|
333
|
+
const dir = this.skillDir(ctx, skill.name);
|
|
334
|
+
changes.push(this.removeContentFile(join(dir, "SKILL.md"), ctx.dryRun));
|
|
335
|
+
for (const rel of Object.keys(skill.resources ?? {})) {
|
|
336
|
+
const target = this.resolveWithin(dir, rel);
|
|
337
|
+
if (target === null) continue;
|
|
338
|
+
changes.push(this.removeContentFile(target, ctx.dryRun));
|
|
339
|
+
}
|
|
340
|
+
changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));
|
|
341
|
+
}
|
|
342
|
+
return changes;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Render a skill's SKILL.md: frontmatter (name, description + optional model,
|
|
346
|
+
* allowed-tools, disable-model-invocation) + body. UNIFORM with every other
|
|
347
|
+
* skill-supporting platform — only the parent dir differs.
|
|
348
|
+
*/
|
|
349
|
+
renderSkill(skill) {
|
|
350
|
+
const frontmatter = {
|
|
351
|
+
name: skill.name,
|
|
352
|
+
description: skill.description
|
|
353
|
+
};
|
|
354
|
+
if (skill.model !== void 0) frontmatter.model = skill.model;
|
|
355
|
+
const allow = skill.tools?.allow;
|
|
356
|
+
if (allow && allow.length > 0) frontmatter["allowed-tools"] = allow.join(", ");
|
|
357
|
+
if (skill.disableModelInvocation !== void 0) {
|
|
358
|
+
frontmatter["disable-model-invocation"] = skill.disableModelInvocation;
|
|
359
|
+
}
|
|
360
|
+
if (skill.extra) Object.assign(frontmatter, skill.extra);
|
|
361
|
+
return this.renderFrontmatterMd(frontmatter, skill.body);
|
|
362
|
+
}
|
|
230
363
|
// ── Diagnostics ──────────────────────────────────────────────────────────
|
|
231
364
|
getHealthChecks(ctx) {
|
|
232
365
|
const mcpPath = this.getServerConfigPath(ctx);
|
|
@@ -263,4 +396,4 @@ export {
|
|
|
263
396
|
adapter,
|
|
264
397
|
roo_code_default as default
|
|
265
398
|
};
|
|
266
|
-
//# sourceMappingURL=roo-code-
|
|
399
|
+
//# sourceMappingURL=roo-code-GWSNU3OW.js.map
|