@mininglamp-oss/octo-runtime 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/README.md +61 -37
  2. package/apps/cli/README.md +58 -22
  3. package/apps/cli/dist/adapter-configurations.d.ts +4 -0
  4. package/apps/cli/dist/adapter-configurations.js +102 -0
  5. package/apps/cli/dist/build-info.json +2 -2
  6. package/apps/cli/dist/cli-entrypoint.d.ts +2 -0
  7. package/apps/cli/dist/cli-entrypoint.js +16 -0
  8. package/apps/cli/dist/command-tree.d.ts +20 -0
  9. package/apps/cli/dist/command-tree.js +402 -0
  10. package/apps/cli/dist/extra-command-config.d.ts +4 -0
  11. package/apps/cli/dist/extra-command-config.js +50 -0
  12. package/apps/cli/dist/extra-commands.d.ts +15 -0
  13. package/apps/cli/dist/extra-commands.js +275 -0
  14. package/apps/cli/dist/extras.js +14 -2
  15. package/apps/cli/dist/global-extras.d.ts +16 -0
  16. package/apps/cli/dist/global-extras.js +201 -0
  17. package/apps/cli/dist/help.d.ts +4 -1
  18. package/apps/cli/dist/help.js +31 -79
  19. package/apps/cli/dist/logs.js +8 -4
  20. package/apps/cli/dist/main.d.ts +2 -0
  21. package/apps/cli/dist/main.js +38 -68
  22. package/apps/cli/dist/manifest.json +48 -3
  23. package/apps/cli/dist/module-manifest.d.ts +1 -1
  24. package/apps/cli/dist/module-manifest.js +3 -2
  25. package/apps/cli/dist/output.js +18 -2
  26. package/apps/cli/dist/playboard.js +3 -2
  27. package/apps/cli/dist/service-control.js +2 -2
  28. package/apps/cli/dist/state.js +48 -19
  29. package/dist/public/channel-gateway-commands.d.ts +1 -0
  30. package/dist/public/channel-gateway-commands.js +1 -0
  31. package/dist/public/channel-wecom-commands.d.ts +1 -0
  32. package/dist/public/channel-wecom-commands.js +1 -0
  33. package/dist/public/extra.d.ts +1 -0
  34. package/dist/public/extra.js +1 -0
  35. package/dist/public/host.d.ts +2 -4
  36. package/dist/public/host.js +1 -2
  37. package/dist/public/webui-commands.d.ts +1 -0
  38. package/dist/public/webui-commands.js +1 -0
  39. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +5 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +3 -4
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +161 -26
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +3 -1
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-G5PWGRL5.js → chunk-3GXX5VD5.js} +24 -90
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-UOQRXV3Q.js → chunk-FWAPYRV2.js} +1 -1
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-DYOJCNWF.js → chunk-IW62UM3C.js} +1 -1
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +1 -1
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +1 -1
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +3 -3
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +1 -1
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +8 -2
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  65. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  66. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  67. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  68. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +1 -1
  69. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +8 -4
  70. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.d.ts +6 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +16 -4
  72. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +12 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +91 -0
  74. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +2 -2
  75. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +13 -1
  76. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +9 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +40 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +3 -2
  79. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  80. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +4 -0
  81. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +102 -0
  82. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  83. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.d.ts +2 -0
  84. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.js +16 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.d.ts +20 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +402 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.d.ts +4 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.js +50 -0
  89. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.d.ts +15 -0
  90. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.js +275 -0
  91. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +14 -2
  92. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.d.ts +16 -0
  93. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.js +201 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.d.ts +4 -1
  95. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +31 -79
  96. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +8 -4
  97. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
  98. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +38 -68
  99. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +48 -3
  100. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +1 -1
  101. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +3 -2
  102. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +18 -2
  103. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +3 -2
  104. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/service-control.js +2 -2
  105. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -19
  106. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +25 -24
  107. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  108. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +8 -3
  109. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +47 -4
  110. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  111. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  113. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -0
  114. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +79 -5
  115. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +3 -1
  116. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +22 -6
  117. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  118. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +5 -3
  119. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +12 -6
  120. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +4 -2
  121. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +131 -43
  122. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  123. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +2 -2
  124. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +36 -20
  125. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.d.ts +4 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.js +124 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +3 -0
  128. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.d.ts +29 -0
  129. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.js +171 -0
  130. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +4 -1
  131. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -6
  132. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +2 -0
  133. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.d.ts +1 -1
  134. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.js +2 -2
  135. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.d.ts +7 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +44 -3
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +1 -1
  138. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +37 -0
  139. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +8 -5
  140. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +10 -6
  141. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.d.ts +4 -0
  142. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.js +128 -0
  143. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +9 -5
  144. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.d.ts +3 -0
  145. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.js +51 -0
  146. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +7 -3
  147. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +2 -0
  148. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +5 -3
  149. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.d.ts +70 -0
  150. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.js +16 -0
  151. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -3
  152. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +1 -2
  153. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +8 -4
  154. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -1
  155. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +9 -1
  156. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +9 -0
  157. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  158. package/node_modules/commander/LICENSE +22 -0
  159. package/node_modules/commander/Readme.md +1172 -0
  160. package/node_modules/commander/index.js +21 -0
  161. package/node_modules/commander/lib/argument.js +147 -0
  162. package/node_modules/commander/lib/command.js +2790 -0
  163. package/node_modules/commander/lib/error.js +36 -0
  164. package/node_modules/commander/lib/help.js +731 -0
  165. package/node_modules/commander/lib/option.js +377 -0
  166. package/node_modules/commander/lib/suggestSimilar.js +99 -0
  167. package/node_modules/commander/package-support.json +19 -0
  168. package/node_modules/commander/package.json +64 -0
  169. package/node_modules/commander/typings/index.d.ts +1113 -0
  170. package/package.json +41 -27
  171. package/packages/octo-runtime-protocol/schema/protocol.schema.json +14 -0
  172. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +0 -1
  173. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +0 -16
  174. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.d.ts +0 -15
  175. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.js +0 -22
  176. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.d.ts +0 -16
  177. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.js +0 -160
@@ -2,7 +2,7 @@ import { constants } from "node:fs";
2
2
  import { lstat, open, opendir } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { setTimeout as delay } from "node:timers/promises";
5
- import { extraStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
5
+ import { extraStatusRecord, kernelStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
6
6
  const MAX_READ = 4 * 1024 * 1024;
7
7
  const MAX_LINE = 4096;
8
8
  function record(line, extra) {
@@ -10,6 +10,10 @@ function record(line, extra) {
10
10
  return;
11
11
  try {
12
12
  const value = JSON.parse(line);
13
+ if (extra === "executor-kernel")
14
+ return value.source === "kernel" && typeof value.time === "string"
15
+ ? kernelStatusRecord(value.level, value.event, value.data, value.time)
16
+ : undefined;
13
17
  if (value.source !== "extra" || value.extra_type !== extra || typeof value.time !== "string")
14
18
  return;
15
19
  return extraStatusRecord(extra, value.level, value.event, value.data, value.time);
@@ -19,7 +23,7 @@ function record(line, extra) {
19
23
  }
20
24
  }
21
25
  async function files(home, extra) {
22
- const directory = join(home, "logs", "extras");
26
+ const directory = extra === "executor-kernel" ? join(home, "logs") : join(home, "logs", "extras");
23
27
  for (const path of [join(home, "logs"), directory]) {
24
28
  try {
25
29
  const stat = await lstat(path);
@@ -32,7 +36,7 @@ async function files(home, extra) {
32
36
  throw error;
33
37
  }
34
38
  }
35
- const pattern = new RegExp(`^${extra}-status-\\d{8}T\\d{2}\\.log$`);
39
+ const pattern = new RegExp(`^${extra === "executor-kernel" ? "kernel" : extra}-status-\\d{8}T\\d{2}\\.log$`);
36
40
  // Keep only three candidates while scanning, without loading an unbounded directory listing.
37
41
  const selected = [];
38
42
  let count = 0;
@@ -88,7 +92,7 @@ export async function showExtraLogs(options) {
88
92
  const emit = async (value) => {
89
93
  const text = options.json
90
94
  ? JSON.stringify(value)
91
- : `${value.time} ${value.level.toUpperCase()} ${value.extra_type} ${value.event}${Object.keys(value.data).length ? ` ${JSON.stringify(value.data)}` : ""}`;
95
+ : `${value.time} ${value.level.toUpperCase()} ${value.source === "extra" ? value.extra_type : "executor-kernel"} ${value.event}${Object.keys(value.data).length ? ` ${JSON.stringify(value.data)}` : ""}`;
92
96
  await options.output(text, controller.signal);
93
97
  };
94
98
  try {
@@ -8,5 +8,7 @@ export interface CliDependencies extends ServiceControlOptions {
8
8
  /** CLI 入口选择前台组件的退出策略;仅确认命令类型,不表示服务 ready。 */
9
9
  onComponentRun?: () => void;
10
10
  logsSignal?: AbortSignal;
11
+ /** 自有命令的取消;不启动或停止任何服务。 */
12
+ commandSignal?: AbortSignal;
11
13
  }
12
14
  export declare function runCli(args: string[], dependencies?: CliDependencies): Promise<number>;
@@ -1,19 +1,22 @@
1
+ import { runExtraCommand, commandError } from "./extra-commands.js";
1
2
  import net from "node:net";
2
3
  import { randomUUID } from "node:crypto";
3
4
  import { once } from "node:events";
4
5
  import { lstat, mkdir } from "node:fs/promises";
5
6
  import { join, resolve } from "node:path";
6
7
  import { fileURLToPath } from "node:url";
7
- import { attachKernel, acknowledgeOrphanCleanup, inspectOrphanCleanup, createKernelService, readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
8
+ import { attachKernel, acknowledgeOrphanCleanup, inspectOrphanCleanup, createKernelService } from "@mininglamp-oss/octo-runtime-executor-kernel";
8
9
  import { componentEndpoint, createExtraService } from "@mininglamp-oss/octo-runtime-host-sdk";
9
10
  import { getExtra, readExtra, setExtra } from "./extras.js";
10
- import { cliVersionInfo, helpText } from "./help.js";
11
+ import { cliVersionInfo } from "./help.js";
12
+ import { parseCliCommand } from "./command-tree.js";
11
13
  import { runForegroundService } from "./foreground.js";
12
14
  import { showExtraLogs } from "./logs.js";
13
15
  import { StatusOutput } from "./status-output.js";
14
16
  import { defaultRuntimeHome, runtimePaths, withSetupLock, readJsonFile } from "./state.js";
15
17
  import { resolveServiceControl } from "./service-control.js";
16
18
  import { loadCliManifest } from "./module-manifest.js";
19
+ import { readCliAdapterConfigurations } from "./adapter-configurations.js";
17
20
  import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
18
21
  import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
19
22
  import { describeError, formatStatus, recordStartupFailure, readStartupFailure } from "./output.js";
@@ -21,12 +24,22 @@ const components = ["executor-kernel", "channel-gateway"];
21
24
  const builtinComponents = [...components, "channel-wecom", "webui"];
22
25
  export async function runCli(args, dependencies = {}) {
23
26
  const output = dependencies.output ?? ((line) => process.stdout.write(`${line}\n`));
24
- let json = args.includes("--json");
27
+ // 参数解析失败也按宿主布尔标记输出 JSON;-- 后的字面位置参数不选择输出格式。
28
+ const literalIndex = args.indexOf("--");
29
+ let json = (literalIndex < 0 ? args : args.slice(0, literalIndex)).some((arg) => arg === "--json" || arg.startsWith("--json="));
25
30
  let context = {};
26
31
  let runningComponent;
27
32
  let statusOutput;
28
33
  try {
29
- const { flags, positional } = parse(args);
34
+ const parsed = await parseCliCommand(args, dependencies);
35
+ if (parsed.help !== undefined) {
36
+ output(parsed.help);
37
+ return 0;
38
+ }
39
+ const { flags, positional } = parsed;
40
+ json = Boolean(flags.json);
41
+ if (parsed.extra)
42
+ return await runExtraCommand(parsed, dependencies);
30
43
  if (flags["acknowledge-orphan-cleanup"] !== undefined &&
31
44
  !(positional[0] === "executor-kernel" && positional[1] === "recover"))
32
45
  throw new Error("INVALID_ARGUMENTS");
@@ -37,15 +50,6 @@ export async function runCli(args, dependencies = {}) {
37
50
  output(cliVersionInfo);
38
51
  return 0;
39
52
  }
40
- if (flags.help || !positional.length || positional[0] === "help") {
41
- output(helpText(builtinComponents.includes(positional[0]) ? positional[0] : undefined));
42
- return 0;
43
- }
44
- // 裸组件帮助仅做词法校验,不读取配置或创建服务管理器。
45
- if (positional.length === 1 && builtinComponents.includes(positional[0])) {
46
- output(helpText(positional[0]));
47
- return 0;
48
- }
49
53
  const home = resolve(flags.home ?? defaultRuntimeHome(dependencies.env, dependencies.platform));
50
54
  // 模块清单不决定运行状态位置;前台 Kernel、doctor 和恢复确认共用 Home 下的同一路径。
51
55
  const kernelStateDirectory = join(home, "run");
@@ -69,9 +73,12 @@ export async function runCli(args, dependencies = {}) {
69
73
  // Route logs before config/module/manager access so offline failures remain diagnosable.
70
74
  if (positional[1] === "logs") {
71
75
  const extra = positional[0];
72
- context = { component: extra, action: "logs", logs: join(home, "logs", "extras") };
76
+ context = {
77
+ component: extra,
78
+ action: "logs",
79
+ logs: extra === "executor-kernel" ? join(home, "logs") : join(home, "logs", "extras")
80
+ };
73
81
  if (positional.length !== 2 ||
74
- extra === "executor-kernel" ||
75
82
  !/^[a-z][a-z0-9-]{0,63}$/.test(extra) ||
76
83
  flags.autostart !== undefined)
77
84
  throw new Error("INVALID_ARGUMENTS");
@@ -125,10 +132,6 @@ export async function runCli(args, dependencies = {}) {
125
132
  const isComponent = (name) => builtinComponents.includes(name) ||
126
133
  registrations.some((entry) => entry.name === name) ||
127
134
  manifest?.extras.some((entry) => entry.name === name) === true;
128
- if (positional.length === 1 && isComponent(positional[0])) {
129
- output(helpText(positional[0]));
130
- return 0;
131
- }
132
135
  const service = resolveServiceControl(dependencies);
133
136
  const input = dependencies.input ?? process.stdin;
134
137
  const publish = (value, human) => output(typeof value === "string" ? value : !json && human ? human : JSON.stringify(value, null, 2));
@@ -182,7 +185,8 @@ export async function runCli(args, dependencies = {}) {
182
185
  profile,
183
186
  manifest: flags.manifest,
184
187
  input,
185
- output: dependencies.output
188
+ output: dependencies.output,
189
+ env: dependencies.env
186
190
  });
187
191
  }
188
192
  if (positional[0] === "adapter" && positional[1] === "list" && positional.length === 2) {
@@ -247,11 +251,12 @@ export async function runCli(args, dependencies = {}) {
247
251
  if (component === "executor-kernel") {
248
252
  const config = await readJsonFile(paths.profileConfig);
249
253
  handle = createKernelService({
254
+ logging: { directory: join(home, "logs") },
250
255
  endpoint,
251
256
  stateDirectory: kernelStateDirectory,
252
257
  workerEntrypoint: fileURLToPath(new URL("./worker.js", import.meta.url)),
253
258
  adapterModules: resolveAdapterModules(manifest),
254
- adapterConfigurations: readAdapterConfigurations(paths.profileRoot, config?.adapters),
259
+ adapterConfigurations: await readCliAdapterConfigurations(paths.profileRoot, config?.adapters, manifest, dependencies.env ?? process.env),
255
260
  env: {
256
261
  ...(dependencies.env ?? process.env),
257
262
  OCTO_RUNTIME_HOME: home,
@@ -372,21 +377,23 @@ export async function runCli(args, dependencies = {}) {
372
377
  catch (error) {
373
378
  if (runningComponent && context.logs)
374
379
  await recordStartupFailure(context.logs, runningComponent, error);
375
- const failure = { ...describeError(error), ...context };
380
+ const failure = { ...(commandError(error) ?? describeError(error)), ...context };
376
381
  const code = failure.code;
377
382
  if (json)
378
383
  output(JSON.stringify({ error: failure }, null, context.action === "logs" ? undefined : 2));
379
384
  else
380
385
  (dependencies.errorOutput ?? ((line) => process.stderr.write(`${line}\n`)))(`${[context.component, context.action].filter(Boolean).join(" ") || "octo-runtime"}: ${code}${failure.cause_code ? ` (${failure.cause_code})` : ""}\n${failure.message}${context.logs ? `\nLogs: ${context.logs}` : ""}`);
381
- return ["SERVICE_NOT_INSTALLED", "NOT_INSTALLED"].includes(code)
382
- ? 3
383
- : /INVALID|REQUIRED/.test(code)
384
- ? 2
385
- : /INCOMPLETE/.test(code)
386
- ? 5
387
- : /UNAVAILABLE|SERVICE_PROCESS_EXITED/.test(code)
388
- ? 4
389
- : 1;
386
+ return code === "EXTRA_COMMAND_CANCELLED"
387
+ ? 130
388
+ : ["SERVICE_NOT_INSTALLED", "NOT_INSTALLED"].includes(code)
389
+ ? 3
390
+ : /INVALID|REQUIRED|COMMAND_NOT_FOUND/.test(code)
391
+ ? 2
392
+ : /INCOMPLETE/.test(code)
393
+ ? 5
394
+ : /UNAVAILABLE|SERVICE_PROCESS_EXITED/.test(code)
395
+ ? 4
396
+ : 1;
390
397
  }
391
398
  finally {
392
399
  statusOutput?.close();
@@ -448,40 +455,3 @@ async function componentStatus(home, component, platform, requireReady = false)
448
455
  });
449
456
  }
450
457
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
451
- function parse(args) {
452
- const flags = {}, positional = [];
453
- for (let i = 0; i < args.length; i++) {
454
- const arg = args[i] === "-h" ? "--help" : args[i] === "-v" ? "--version" : args[i];
455
- if (!arg.startsWith("-")) {
456
- positional.push(arg);
457
- continue;
458
- }
459
- const match = /^--([a-z-]+)(?:=(.*))?$/.exec(arg);
460
- if (!match ||
461
- ![
462
- "home",
463
- "profile",
464
- "manifest",
465
- "json",
466
- "help",
467
- "version",
468
- "autostart",
469
- "lines",
470
- "follow",
471
- "acknowledge-orphan-cleanup"
472
- ].includes(match[1]) ||
473
- Object.hasOwn(flags, match[1]))
474
- throw new Error("INVALID_ARGUMENTS");
475
- const key = match[1];
476
- flags[key] = ["json", "help", "version", "follow", "acknowledge-orphan-cleanup"].includes(key)
477
- ? "true"
478
- : (match[2] ?? args[++i]);
479
- if (key === "acknowledge-orphan-cleanup" && match[2] !== undefined)
480
- throw new Error("INVALID_ARGUMENTS");
481
- if (!flags[key] ||
482
- flags[key].startsWith("--") ||
483
- (key === "autostart" && !["true", "false"].includes(flags[key])))
484
- throw new Error("INVALID_ARGUMENTS");
485
- }
486
- return { flags, positional };
487
- }
@@ -73,8 +73,53 @@
73
73
  }
74
74
  ],
75
75
  "extras": [
76
- { "name": "channel-gateway", "module": "@mininglamp-oss/octo-runtime-extra-channel-gateway" },
77
- { "name": "channel-wecom", "module": "@mininglamp-oss/octo-runtime-extra-channel-wecom" },
78
- { "name": "webui", "module": "@mininglamp-oss/octo-runtime-extra-webui" }
76
+ {
77
+ "name": "channel-gateway",
78
+ "description": "Connect Octo IM Bots to local Agent execution",
79
+ "configExample": {
80
+ "bots": [
81
+ {
82
+ "api_url": "https://im.example.com/api",
83
+ "bot_id": "<BOT_ID>",
84
+ "bf_token": "<BOT_TOKEN>",
85
+ "adapter": {
86
+ "adapter_type": "codex",
87
+ "workdir": "/absolute/workspace",
88
+ "model": "<MODEL_ID>",
89
+ "effort": "medium"
90
+ }
91
+ }
92
+ ]
93
+ },
94
+ "module": "@mininglamp-oss/octo-runtime-extra-channel-gateway"
95
+ },
96
+ {
97
+ "name": "channel-wecom",
98
+ "description": "Connect WeCom Bots to local Agent execution",
99
+ "configExample": {
100
+ "bots": [
101
+ {
102
+ "bot_id": "<BOT_ID>",
103
+ "app_secret": "<APP_SECRET>",
104
+ "adapter": {
105
+ "adapter_type": "codex",
106
+ "workdir": "/absolute/workspace",
107
+ "model": "<MODEL_ID>",
108
+ "effort": "medium"
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ "module": "@mininglamp-oss/octo-runtime-extra-channel-wecom"
114
+ },
115
+ {
116
+ "name": "webui",
117
+ "description": "Open a local browser workspace for Agent conversations",
118
+ "configExample": {
119
+ "port": 13888,
120
+ "sessionStorePath": "/absolute/host-home/extras/webui/sessions.json"
121
+ },
122
+ "module": "@mininglamp-oss/octo-runtime-extra-webui"
123
+ }
79
124
  ]
80
125
  }
@@ -1,3 +1,3 @@
1
1
  import { type ModuleManifest } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
2
- /** CLI 独占默认目录与 Home 扩展策略;SDK 原生装配不读取这两份文件。 */
2
+ /** CLI 独占内置、Home 与全局 Extra 目录;SDK 不扫描,显式清单完全替换。 */
3
3
  export declare function loadCliManifest(home: string, override?: string, report?: (message: string) => void): Promise<ModuleManifest>;
@@ -1,11 +1,12 @@
1
1
  import { join, resolve } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
  import { mergeModuleManifests, readModuleManifest } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
4
- /** CLI 独占默认目录与 Home 扩展策略;SDK 原生装配不读取这两份文件。 */
4
+ import { discoverGlobalExtras, mergeGlobalExtras } from "./global-extras.js";
5
+ /** CLI 独占内置、Home 与全局 Extra 目录;SDK 不扫描,显式清单完全替换。 */
5
6
  export async function loadCliManifest(home, override, report = (message) => console.error(message)) {
6
7
  if (override)
7
8
  return readModuleManifest(resolve(override), { legacy: true });
8
9
  const builtin = await readModuleManifest(fileURLToPath(new URL("./manifest.json", import.meta.url)));
9
10
  const extension = await readModuleManifest(join(home, "manifest.json"), { optional: true });
10
- return mergeModuleManifests(builtin, extension, report);
11
+ return mergeGlobalExtras(mergeModuleManifests(builtin, extension, report), await discoverGlobalExtras(report), report);
11
12
  }
@@ -20,6 +20,11 @@ export function formatStatus(name, snapshot) {
20
20
  ];
21
21
  if (runtime.execution_ready !== undefined)
22
22
  lines.push(` Worker: ${runtime.execution_ready ? "ready" : "unavailable"}`);
23
+ const recovery = record(record(runtime.worker).recovery);
24
+ if (recovery.code) {
25
+ lines.push(` Recovery: ${text(recovery.stage)} (${text(recovery.code)})${recovery.retry_at ? ` Next retry: ${text(recovery.retry_at)}` : ""}`);
26
+ lines.push(" Diagnostics: octo-runtime executor-kernel logs --follow (use the same --home)");
27
+ }
23
28
  if (runtime.available === false)
24
29
  lines.push(` Reason: ${text(record(runtime.error).code ?? "COMPONENT_UNAVAILABLE")}`);
25
30
  if (service.lastExitCode !== undefined && service.lastExitCode !== 0)
@@ -104,8 +109,19 @@ export function describeError(error, fallback = "COMMAND_FAILED") {
104
109
  ORPHAN_CLEANUP_NOT_PENDING: "There is no valid incomplete orphan cleanup to acknowledge. Run doctor with the same --home.",
105
110
  SERVICE_NOT_INSTALLED: "Run this component's install command, then start it.",
106
111
  NOT_INSTALLED: "Run this component's install command, then start it.",
107
- EXTRA_NOT_REGISTERED: "Save this Extra's declaration with extraset before starting it.",
108
- EXTRA_MANIFEST_DECLARATION_REQUIRED: "Add this Extra's name and module to the selected Home manifest.json (extras array), then retry.",
112
+ EXTRA_COMMAND_FAILED: "The Extra command failed. No private backend error is printed; check its input and configuration, then retry.",
113
+ EXTRA_CONFIG_CONFLICT: "Configuration changed after this command read it. Read the latest configuration and retry.",
114
+ EXTRA_COMMAND_LOAD_FAILED: "The selected Extra command module or one of its dependencies is broken. Check its package and commands export; lifecycle commands remain available.",
115
+ EXTRA_COMMAND_API_UNSUPPORTED: "This CLI supports Extra command apiVersion 1. Install a compatible command extension.",
116
+ EXTRA_COMMAND_DEFINITION_INVALID: "Command definitions must have unique names and valid options; lifecycle and host option names are reserved.",
117
+ EXTRA_COMMAND_NAMESPACE_CONFLICT: "An Extra name conflicts with a Runtime command. Rename its manifest entry.",
118
+ EXTRA_COMMAND_NOT_FOUND: "Unknown command. Use --help on the service command to see available subcommands.",
119
+ EXTRA_COMMAND_CANCELLED: "The command was cancelled. Any save that already completed remains persisted.",
120
+ EXTRA_COMMAND_STDIN_REQUIRED: "Pipe the required input through stdin; do not put credentials in command arguments.",
121
+ EXTRA_NOT_REGISTERED: "Save the service configuration using its configure or extraset subcommand before starting it.",
122
+ EXTRA_MANIFEST_DECLARATION_REQUIRED: "Install this Extra alongside the global Runtime, or add its name and module to the selected Home manifest.json (extras array), then retry.",
123
+ EXTRA_NAME_MISMATCH: "The selected Extra must export the same name as its catalog entry. Check the reported package origin.",
124
+ EXTRA_MODULE_LOAD_FAILED: "Check the selected catalog declaration, discovery diagnostics, installation and ESM exports; reinstall it or select a valid Home manifest entry, then retry.",
109
125
  EXTRA_MODULE_MIGRATION_REQUIRED: "The saved module differs from manifest.json. Review both declarations, then save matching module text or omit module from the Extra configuration.",
110
126
  MANIFEST_INVALID: "Check manifest.json: version must be 1 and adapters/extras must be valid arrays without duplicate keys.",
111
127
  MANAGER_UNAVAILABLE: "Run doctor and check the current user's native service manager.",
@@ -1,7 +1,8 @@
1
1
  import { defaultRuntimeHome, runtimePaths, readJsonFile } from "./state.js";
2
2
  import { loadCliManifest } from "./module-manifest.js";
3
+ import { readCliAdapterConfigurations } from "./adapter-configurations.js";
3
4
  import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
4
- import { readAdapterConfigurations, createKernelService } from "@mininglamp-oss/octo-runtime-executor-kernel";
5
+ import { createKernelService } from "@mininglamp-oss/octo-runtime-executor-kernel";
5
6
  import { fileURLToPath } from "node:url";
6
7
  import { componentEndpoint } from "@mininglamp-oss/octo-runtime-host-sdk";
7
8
  import { mkdtemp, rm } from "node:fs/promises";
@@ -88,7 +89,7 @@ export async function runPlayboard(options) {
88
89
  OCTO_RUNTIME_CLI_PROFILE_ROOT: paths.profileRoot,
89
90
  OCTO_RUNTIME_CLI_SYNC_OPENCLAW_TOOLS: "0"
90
91
  },
91
- adapterConfigurations: readAdapterConfigurations(paths.profileRoot, configuration?.adapters)
92
+ adapterConfigurations: await readCliAdapterConfigurations(paths.profileRoot, configuration?.adapters, manifest, options.env ?? process.env)
92
93
  });
93
94
  await kernel.initialize({ signal: controller.signal });
94
95
  let exitCode = 1;
@@ -1,6 +1,6 @@
1
1
  import { homedir } from "node:os";
2
2
  import { resolve } from "node:path";
3
- import { fileURLToPath } from "node:url";
3
+ import { cliEntrypoint } from "./cli-entrypoint.js";
4
4
  import { componentServiceId } from "@mininglamp-oss/octo-runtime-host-sdk";
5
5
  import { createServiceBackend } from "@mininglamp-oss/octo-runtime-cross-service";
6
6
  export function resolveServiceControl(options = {}) {
@@ -19,7 +19,7 @@ export function resolveServiceControl(options = {}) {
19
19
  description: `Octo Runtime ${component}`,
20
20
  command: resolve(options.nodeExecutable ?? process.execPath),
21
21
  args: [
22
- resolve(options.cliEntrypoint ?? fileURLToPath(new URL("./index.js", import.meta.url))),
22
+ resolve(options.cliEntrypoint ?? cliEntrypoint()),
23
23
  component,
24
24
  "run",
25
25
  "--home",
@@ -1,5 +1,5 @@
1
- import { randomUUID } from "node:crypto";
2
- import { access, chmod, mkdir, open, readFile, rename, rm, rmdir } from "node:fs/promises";
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { access, chmod, link, mkdir, open, readFile, rename, rm, rmdir } from "node:fs/promises";
3
3
  import { homedir } from "node:os";
4
4
  import { basename, dirname, join, resolve } from "node:path";
5
5
  import { componentEndpoint } from "@mininglamp-oss/octo-runtime-host-sdk";
@@ -235,35 +235,64 @@ async function writeFileAtomic(path, value) {
235
235
  throw error;
236
236
  }
237
237
  }
238
+ /**
239
+ * 主锁和回收锁使用同一协议:先完整写入独占临时文件,再用硬链接原子发布 PID/随机身份。
240
+ * 发布前退出只留下不参与互斥的临时文件;发布后退出可按 PID 回收,不存在无 owner 窗口。
241
+ * 回收前先持有该锁自己的回收锁,并再次核对原记录,防止删除后来取得的锁。
242
+ * 回收者也可能退出,因此回收锁递归遵循同一协议;固定长度哈希避免路径随层级增长。
243
+ */
238
244
  async function acquireProcessLock(path) {
239
- for (let attempt = 0; attempt < 2; attempt++) {
245
+ const record = `${JSON.stringify({ pid: process.pid, id: randomUUID() })}\n`;
246
+ const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
247
+ const handle = await open(temporary, "wx", 0o600);
248
+ try {
240
249
  try {
241
- const handle = await open(path, "wx", 0o600);
242
- await handle.writeFile(`${JSON.stringify({ pid: process.pid, created_at: new Date().toISOString() })}\n`, "utf8");
250
+ await handle.writeFile(record, "utf8");
251
+ }
252
+ finally {
243
253
  await handle.close();
244
- return async () => {
254
+ }
255
+ for (let attempt = 0; attempt < 2; attempt++) {
256
+ try {
257
+ await link(temporary, path);
258
+ return async () => {
259
+ if ((await readLockOwner(path))?.record === record)
260
+ await rm(path, { force: true });
261
+ };
262
+ }
263
+ catch (error) {
264
+ if (!isNodeError(error, "EEXIST"))
265
+ throw error;
245
266
  const owner = await readLockOwner(path);
246
- if (owner === process.pid)
267
+ // 旧格式的不完整记录仍需保守拒绝;不能根据时间猜测它已失效。
268
+ if (!owner || processAlive(owner.pid))
269
+ throw new Error("SETUP_IN_PROGRESS", { cause: error });
270
+ // 只哈希文件名,使同一 Home 的不同符号链接路径仍争用同一个回收锁。
271
+ const reclaim = join(dirname(path), `.reclaim-${createHash("sha256").update(basename(path)).digest("hex")}`);
272
+ const release = await acquireProcessLock(reclaim);
273
+ try {
274
+ const current = await readLockOwner(path);
275
+ if (!current || current.record !== owner.record || processAlive(current.pid))
276
+ throw new Error("SETUP_IN_PROGRESS", { cause: error });
247
277
  await rm(path, { force: true });
248
- };
249
- }
250
- catch (error) {
251
- if (!isNodeError(error, "EEXIST"))
252
- throw error;
253
- const owner = await readLockOwner(path);
254
- if (owner !== undefined && processAlive(owner)) {
255
- throw new Error("SETUP_IN_PROGRESS", { cause: error });
278
+ }
279
+ finally {
280
+ await release();
281
+ }
256
282
  }
257
- await rm(path, { force: true });
258
283
  }
284
+ throw new Error("could not acquire setup lock");
285
+ }
286
+ finally {
287
+ await rm(temporary, { force: true });
259
288
  }
260
- throw new Error("could not acquire setup lock");
261
289
  }
262
290
  async function readLockOwner(path) {
263
291
  try {
264
- const value = JSON.parse(await readFile(path, "utf8"));
292
+ const record = await readFile(path, "utf8");
293
+ const value = JSON.parse(record);
265
294
  return typeof value.pid === "number" && Number.isSafeInteger(value.pid) && value.pid > 0
266
- ? value.pid
295
+ ? { pid: value.pid, record }
267
296
  : undefined;
268
297
  }
269
298
  catch {
@@ -0,0 +1 @@
1
+ export { default } from "@mininglamp-oss/octo-runtime-extra-channel-gateway/commands";
@@ -0,0 +1 @@
1
+ export { default } from "@mininglamp-oss/octo-runtime-extra-channel-gateway/commands";
@@ -0,0 +1 @@
1
+ export { default } from "@mininglamp-oss/octo-runtime-extra-channel-wecom/commands";
@@ -0,0 +1 @@
1
+ export { default } from "@mininglamp-oss/octo-runtime-extra-channel-wecom/commands";
@@ -2,3 +2,4 @@ export * from "./protocol.js";
2
2
  export type { ExtraContext, RuntimeLog, RuntimeLogLevel, ExtraDisposer, ExtraInitializer, ExtraPlugin, ExtraPluginModule, ExtraRegistration, ExtraStatus, ExtraStatusHandler, JsonObject, JsonValue } from "@mininglamp-oss/octo-runtime-host-sdk/extra";
3
3
  export { ExtraPlugins } from "@mininglamp-oss/octo-runtime-host-sdk/extra";
4
4
  export type { ExtraDescriptor, StoredExtra } from "@mininglamp-oss/octo-runtime-host-sdk/extra-config";
5
+ export * from "@mininglamp-oss/octo-runtime-host-sdk/extra-commands";
@@ -1,2 +1,3 @@
1
1
  export * from "./protocol.js";
2
2
  export { ExtraPlugins } from "@mininglamp-oss/octo-runtime-host-sdk/extra";
3
+ export * from "@mininglamp-oss/octo-runtime-host-sdk/extra-commands";
@@ -1,7 +1,5 @@
1
- export { createExtraService, ComponentStartError, componentEndpoint, componentServiceId, homeHash, normalizedHome } from "@mininglamp-oss/octo-runtime-host-sdk";
2
- export type { ExtraService, ExtraServiceOptions, ExtraServiceStatus, CleanupResult } from "@mininglamp-oss/octo-runtime-host-sdk";
3
- export { startNativeComponent } from "@mininglamp-oss/octo-runtime-host-sdk";
4
- export type { NativeComponentOptions } from "@mininglamp-oss/octo-runtime-host-sdk";
1
+ export { createExtraService, componentEndpoint, componentServiceId, homeHash, normalizedHome } from "@mininglamp-oss/octo-runtime-host-sdk";
2
+ export type { ExtraService, ExtraServiceOptions, ExtraServiceStatus } from "@mininglamp-oss/octo-runtime-host-sdk";
5
3
  export type { RuntimeLoggingOptions, ExtraStatusRecord } from "@mininglamp-oss/octo-runtime-host-sdk";
6
4
  export { createKernelService, ServiceInitializationError } from "./executor-kernel.js";
7
5
  export type { KernelService, KernelServiceOptions, KernelServiceStatus, ServiceCleanupResult, ServiceLifecycle, ServicePhase } from "./executor-kernel.js";
@@ -1,3 +1,2 @@
1
- export { createExtraService, ComponentStartError, componentEndpoint, componentServiceId, homeHash, normalizedHome } from "@mininglamp-oss/octo-runtime-host-sdk";
2
- export { startNativeComponent } from "@mininglamp-oss/octo-runtime-host-sdk";
1
+ export { createExtraService, componentEndpoint, componentServiceId, homeHash, normalizedHome } from "@mininglamp-oss/octo-runtime-host-sdk";
3
2
  export { createKernelService, ServiceInitializationError } from "./executor-kernel.js";
@@ -0,0 +1 @@
1
+ export { default } from "@mininglamp-oss/octo-runtime-extra-webui/commands";
@@ -0,0 +1 @@
1
+ export { default } from "@mininglamp-oss/octo-runtime-extra-webui/commands";
@@ -1,6 +1,7 @@
1
1
  import { DriverQueue, watchLineLimit, mergeProcessEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
2
  import { INVOKE_REQUEST_MAX_BYTES, resolveStreamLimitPolicy } from "@mininglamp-oss/octo-runtime-protocol";
3
3
  import { createProcessCleanup } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-cleanup";
4
+ import { resolveProcessLaunch } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-launch";
4
5
  import { spawn } from "node:child_process";
5
6
  import { createInterface } from "node:readline";
6
7
  /** Build the exact params serialized by `session/new`. */
@@ -324,9 +325,11 @@ export class AcpClient {
324
325
  */
325
326
  export function spawnAcpClient(options) {
326
327
  const { command, args = [], cwd, env, signal, permissionHandler, onPermissionResponseWritten, onPermissionResponseFailed, streamLimits } = options;
327
- const child = spawn(command, args, {
328
+ const processEnv = mergeProcessEnvironment(process.env, env ?? {});
329
+ const launch = resolveProcessLaunch(command, args, { cwd, env: processEnv });
330
+ const child = spawn(launch.command, launch.args, {
328
331
  cwd,
329
- env: mergeProcessEnvironment(process.env, env ?? {}),
332
+ env: processEnv,
330
333
  stdio: ["pipe", "pipe", "pipe"],
331
334
  detached: process.platform !== "win32"
332
335
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-acp-client",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,7 +9,7 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
13
- "@mininglamp-oss/octo-runtime-protocol": "1.1.4"
12
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
13
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6"
14
14
  }
15
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-acp",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,8 +9,8 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-protocol": "1.1.4",
13
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.4",
14
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
12
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
13
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.6",
14
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
15
15
  }
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-antigravity",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "README.md"
11
11
  ],
12
12
  "dependencies": {
13
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
14
- "@mininglamp-oss/octo-runtime-protocol": "1.1.4"
13
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
14
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6"
15
15
  }
16
16
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-claude-code",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-protocol": "1.1.4",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
10
10
  },
11
11
  "types": "./dist/index.d.ts",
12
12
  "files": [