@mininglamp-oss/octo-runtime 1.1.5 → 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 (96) hide show
  1. package/apps/cli/dist/adapter-configurations.d.ts +4 -0
  2. package/apps/cli/dist/adapter-configurations.js +102 -0
  3. package/apps/cli/dist/build-info.json +2 -2
  4. package/apps/cli/dist/command-tree.js +1 -1
  5. package/apps/cli/dist/logs.js +8 -4
  6. package/apps/cli/dist/main.js +11 -5
  7. package/apps/cli/dist/output.js +5 -0
  8. package/apps/cli/dist/playboard.js +3 -2
  9. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +5 -2
  10. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  11. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  12. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  13. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  14. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +3 -4
  15. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +161 -26
  16. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  17. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +3 -1
  18. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  19. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-G5PWGRL5.js → chunk-3GXX5VD5.js} +24 -90
  20. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-UOQRXV3Q.js → chunk-FWAPYRV2.js} +1 -1
  21. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-DYOJCNWF.js → chunk-IW62UM3C.js} +1 -1
  22. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +1 -1
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +1 -1
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +3 -3
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +1 -1
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +8 -2
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +1 -1
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +8 -4
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +12 -0
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +91 -0
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +2 -2
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +13 -1
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +9 -0
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +40 -0
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +3 -2
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  48. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +4 -0
  49. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +102 -0
  50. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  51. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +1 -1
  52. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +8 -4
  53. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +11 -5
  54. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +5 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +3 -2
  56. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
  57. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  58. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +8 -3
  59. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +47 -4
  60. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  61. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
  62. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  63. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +79 -5
  65. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +3 -1
  66. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +22 -6
  67. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  68. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +5 -3
  69. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +12 -6
  70. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +4 -2
  71. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +131 -43
  72. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  73. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +2 -2
  74. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +33 -17
  75. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +3 -0
  76. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.d.ts +29 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.js +171 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +4 -1
  79. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -6
  80. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +2 -0
  81. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +1 -1
  82. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +37 -0
  83. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  84. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  85. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  86. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +2 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +5 -3
  88. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  89. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -1
  90. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +9 -1
  91. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +9 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  93. package/package.json +27 -27
  94. package/packages/octo-runtime-protocol/schema/protocol.schema.json +14 -0
  95. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +0 -1
  96. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +0 -16
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
3
- "version": "1.1.5",
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.5",
9
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.5",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.5"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
9
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.6",
10
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
@@ -2,6 +2,7 @@ import { actmodeEvidence, invocationEnvs, mapReasoningEffort } from "@mininglamp
2
2
  import { canonicalTerminalStatus, classifyFailure, contextHash, contextActmode, assertJsonByteLimit, INVOKE_REQUEST_MAX_BYTES, hasImageInput, providerInputParts, PROVIDER_DIAGNOSTIC_MAX_BYTES, resolveStreamLimitPolicy, streamCapacityError } from "@mininglamp-oss/octo-runtime-protocol";
3
3
  import { codexEnvironmentConfig } from "./environment.js";
4
4
  import { createProcessCleanup } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-cleanup";
5
+ import { resolveProcessLaunch } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-launch";
5
6
  /**
6
7
  * Codex app-server transport and event adaptation layer.
7
8
  *
@@ -1844,7 +1845,8 @@ class CodexAppServerClient {
1844
1845
  }
1845
1846
  }
1846
1847
  function defaultSpawn(command, args, options) {
1847
- const child = spawn(command, [...args], {
1848
+ const launch = resolveProcessLaunch(command, args, options);
1849
+ const child = spawn(launch.command, [...launch.args], {
1848
1850
  cwd: options.cwd,
1849
1851
  env: options.env,
1850
1852
  stdio: ["pipe", "pipe", "pipe"],
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-codex",
3
- "version": "1.1.5",
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.5",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.5"
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": [
@@ -3,111 +3,45 @@ import {
3
3
  DshError,
4
4
  dshError,
5
5
  nativeCode
6
- } from "./chunk-DYOJCNWF.js";
6
+ } from "./chunk-IW62UM3C.js";
7
7
 
8
8
  // packages/octo-runtime-adapter-dsh/dist/launch.js
9
9
  import { spawn } from "node:child_process";
10
- import { constants } from "node:fs";
11
- import { access, stat } from "node:fs/promises";
12
- import { delimiter, isAbsolute, join, resolve } from "node:path";
13
- import { fileURLToPath } from "node:url";
10
+ import { realpath, stat } from "node:fs/promises";
11
+ import { isAbsolute } from "node:path";
14
12
  import { createProcessCleanup } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-cleanup";
15
- import { processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
13
+ import { mergeProcessEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
16
14
  var VERSION_PROBE_TIMEOUT_MS = 1e4;
17
15
  var VERSION_PROBE_MAX_BYTES = 4096;
18
- var MAX_LAUNCH_ARGS = 64;
19
- var MAX_LAUNCH_ARG_BYTES = 4096;
20
16
  var MAX_TIMEOUT_MS = 864e5;
21
17
  var MAX_OPTION_STRING_LENGTH = 4096;
22
18
  var DSH_PROCESS_GRACE_MS = 1e3;
23
19
  async function resolveDshLaunch(options, env, signal) {
24
- if (options.args !== void 0 && options.command === void 0)
20
+ if (["command", "args", "desktopPath"].some((key) => options[key] !== void 0))
25
21
  throw new DshError("DSH_CONFIG_INVALID");
26
- if (options.command !== void 0 && options.desktopPath !== void 0)
27
- throw new DshError("DSH_CONFIG_INVALID");
28
- let command;
29
- let args = [];
30
- let dshBin;
31
- if (options.dshBin !== void 0) {
32
- if (options.command !== void 0 || options.args !== void 0 || options.desktopPath !== void 0)
33
- throw new DshError("DSH_CONFIG_INVALID");
34
- dshBin = resolve(stringOption(options, "dshBin", ""));
35
- try {
36
- if (!(await stat(dshBin)).isFile())
37
- throw new Error("not a file");
38
- } catch {
39
- throw new DshError("DSH_EXECUTABLE_NOT_FOUND");
40
- }
41
- command = process.execPath;
42
- args = [dshBin];
43
- } else if (options.command !== void 0) {
44
- if (typeof options.command !== "string" || !options.command.trim())
45
- throw new DshError("DSH_CONFIG_INVALID");
46
- command = await executable(options.command, env);
47
- if (!command)
48
- throw new DshError("DSH_EXECUTABLE_NOT_FOUND");
49
- if (options.args !== void 0) {
50
- if (!Array.isArray(options.args) || options.args.length > MAX_LAUNCH_ARGS || options.args.some((value) => typeof value !== "string" || value.length > MAX_LAUNCH_ARG_BYTES || value.includes("\0") || Buffer.byteLength(value) > MAX_LAUNCH_ARG_BYTES))
51
- throw new DshError("DSH_CONFIG_INVALID");
52
- args = options.args.map((value) => value);
53
- }
54
- } else if (options.desktopPath === void 0) {
55
- command = await executable("dsh", env);
56
- }
57
- if (!command) {
58
- const desktop = options.desktopPath ?? (process.platform === "darwin" ? "/Applications/DeepSeek Harness.app" : void 0);
59
- if (typeof desktop !== "string" || !isAbsolute(desktop))
60
- throw new DshError("DSH_EXECUTABLE_NOT_FOUND");
61
- if (process.platform !== "darwin")
62
- throw new DshError("DSH_CONFIG_INVALID");
63
- command = join(desktop, "Contents/MacOS/DeepSeek Harness");
64
- const entry = join(desktop, "Contents/Resources/app.asar/dsh/node_modules/@deepseek-ai/dsh/lib/bin.js");
65
- try {
66
- await access(command);
67
- await access(join(desktop, "Contents/Resources/app.asar"));
68
- } catch {
69
- throw new DshError("DSH_EXECUTABLE_NOT_FOUND");
70
- }
71
- args = [entry];
72
- dshBin = fileURLToPath(new URL("./desktop-entry.js", import.meta.url));
73
- env = {
74
- ...env,
75
- ELECTRON_RUN_AS_NODE: "1",
76
- OCTO_DSH_DESKTOP_BINARY: command,
77
- OCTO_DSH_DESKTOP_ENTRY: entry
78
- };
79
- }
80
- if (process.platform === "win32" && /\.(cmd|bat)$/i.test(command))
81
- throw new DshError("DSH_CONFIG_INVALID");
82
- if (!dshBin) {
83
- if (args.length === 0)
84
- dshBin = command;
85
- else if (args.length === 1 && (process.platform === "win32" ? command.toLowerCase() === process.execPath.toLowerCase() : command === process.execPath))
86
- dshBin = resolve(args[0]);
87
- else
88
- throw new DshError("DSH_CONFIG_INVALID");
22
+ const dshBin = stringOption(options, "dshBin", "");
23
+ assertModulePath(dshBin);
24
+ let physicalPath;
25
+ try {
26
+ physicalPath = await realpath(dshBin);
27
+ if (!(await stat(physicalPath)).isFile())
28
+ throw new Error("not a file");
29
+ } catch {
30
+ throw new DshError("DSH_EXECUTABLE_NOT_FOUND");
89
31
  }
90
- const launch = { command, args, env, dshBin };
32
+ assertModulePath(physicalPath);
33
+ const launch = {
34
+ command: process.execPath,
35
+ args: [physicalPath],
36
+ env: mergeProcessEnvironment(env, process.versions.electron ? { ELECTRON_RUN_AS_NODE: "1" } : {}),
37
+ dshBin: physicalPath
38
+ };
91
39
  await checkVersion(launch, signal);
92
40
  return launch;
93
41
  }
94
- async function executable(command, env) {
95
- const candidates = isAbsolute(command) || /[/\\]/.test(command) ? [resolve(command)] : (processEnvironmentValue(env, "PATH") ?? "").split(delimiter).flatMap((directory) => {
96
- const extensions = process.platform === "win32" && !/\.[^\\/]+$/.test(command) ? [
97
- "",
98
- ...(processEnvironmentValue(env, "PATHEXT") ?? ".EXE;.CMD;.BAT;.COM").split(";")
99
- ] : [""];
100
- return extensions.map((extension) => resolve(directory, command + extension));
101
- });
102
- for (const candidate of candidates) {
103
- try {
104
- await access(candidate, constants.X_OK);
105
- if ((await stat(candidate)).isFile())
106
- return candidate;
107
- } catch {
108
- }
109
- }
110
- return void 0;
42
+ function assertModulePath(path) {
43
+ if (!isAbsolute(path) || !/\.(?:c|m)?js$/i.test(path) || /(?:^|[/\\])[^/\\]*\.asar(?:[/\\]|$)/i.test(path) || /\.app[/\\]Contents(?:[/\\]|$)/i.test(path))
44
+ throw new DshError("DSH_CONFIG_INVALID");
111
45
  }
112
46
  async function checkVersion(launch, signal) {
113
47
  if (signal?.aborted)
@@ -2,7 +2,7 @@ import {
2
2
  DshError,
3
3
  nativeCode,
4
4
  record
5
- } from "./chunk-DYOJCNWF.js";
5
+ } from "./chunk-IW62UM3C.js";
6
6
 
7
7
  // packages/octo-runtime-adapter-dsh/dist/trajectory.js
8
8
  import { createHash } from "node:crypto";
@@ -787,7 +787,7 @@ var messages = {
787
787
  STREAM_QUEUE_ITEM_TOO_LARGE: "DeepSeek Harness event exceeded the configured queue item limit.",
788
788
  STREAM_QUEUE_BYTES_EXCEEDED: "DeepSeek Harness event queue exceeded the configured byte limit.",
789
789
  STREAM_QUEUE_ITEMS_EXCEEDED: "DeepSeek Harness event queue exceeded the configured item limit.",
790
- DSH_EXECUTABLE_NOT_FOUND: "Install a compatible DeepSeek Harness or select its executable.",
790
+ DSH_EXECUTABLE_NOT_FOUND: "The host-configured DeepSeek Harness JavaScript entry is missing.",
791
791
  DSH_VERSION_UNSUPPORTED: "DeepSeek Harness version is incompatible with this adapter.",
792
792
  DSH_START_FAILED: "DeepSeek Harness could not start.",
793
793
  DSH_INITIALIZE_TIMEOUT: "DeepSeek Harness initialization timed out.",
@@ -6,7 +6,7 @@ declare const messages: {
6
6
  readonly STREAM_QUEUE_ITEM_TOO_LARGE: "DeepSeek Harness event exceeded the configured queue item limit.";
7
7
  readonly STREAM_QUEUE_BYTES_EXCEEDED: "DeepSeek Harness event queue exceeded the configured byte limit.";
8
8
  readonly STREAM_QUEUE_ITEMS_EXCEEDED: "DeepSeek Harness event queue exceeded the configured item limit.";
9
- readonly DSH_EXECUTABLE_NOT_FOUND: "Install a compatible DeepSeek Harness or select its executable.";
9
+ readonly DSH_EXECUTABLE_NOT_FOUND: "The host-configured DeepSeek Harness JavaScript entry is missing.";
10
10
  readonly DSH_VERSION_UNSUPPORTED: "DeepSeek Harness version is incompatible with this adapter.";
11
11
  readonly DSH_START_FAILED: "DeepSeek Harness could not start.";
12
12
  readonly DSH_INITIALIZE_TIMEOUT: "DeepSeek Harness initialization timed out.";
@@ -4,7 +4,7 @@ import {
4
4
  dshError,
5
5
  nativeCode,
6
6
  record
7
- } from "./chunk-DYOJCNWF.js";
7
+ } from "./chunk-IW62UM3C.js";
8
8
  export {
9
9
  DSH_VERSION,
10
10
  DshError,
@@ -2,17 +2,17 @@ import {
2
2
  resolveDshLaunch,
3
3
  stringOption,
4
4
  timeoutOption
5
- } from "./chunk-G5PWGRL5.js";
5
+ } from "./chunk-3GXX5VD5.js";
6
6
  import {
7
7
  DshTrajectory
8
- } from "./chunk-UOQRXV3Q.js";
8
+ } from "./chunk-FWAPYRV2.js";
9
9
  import {
10
10
  DSH_VERSION,
11
11
  DshError,
12
12
  HarnessClient,
13
13
  dshError,
14
14
  record
15
- } from "./chunk-DYOJCNWF.js";
15
+ } from "./chunk-IW62UM3C.js";
16
16
 
17
17
  // packages/octo-runtime-adapter-dsh/dist/index.js
18
18
  import { randomUUID } from "node:crypto";
@@ -5,7 +5,7 @@ export interface DshLaunch {
5
5
  env: NodeJS.ProcessEnv;
6
6
  dshBin: string;
7
7
  }
8
- /** 宿主选择已安装 Provider;Desktop 只作为发行载体,不控制 GUI 或改写用户 profile。 */
8
+ /** 宿主维护 npm 安装的 JS 入口;这里只校验所选入口和版本,不发现或替换安装。 */
9
9
  export declare function resolveDshLaunch(options: Record<string, unknown>, env: NodeJS.ProcessEnv, signal?: AbortSignal): Promise<DshLaunch>;
10
10
  export declare function timeoutOption(options: Record<string, unknown>, key: string, fallback: number): number;
11
11
  export declare function stringOption(options: Record<string, unknown>, key: string, fallback: string): string;
@@ -3,8 +3,8 @@ import {
3
3
  resolveDshLaunch,
4
4
  stringOption,
5
5
  timeoutOption
6
- } from "./chunk-G5PWGRL5.js";
7
- import "./chunk-DYOJCNWF.js";
6
+ } from "./chunk-3GXX5VD5.js";
7
+ import "./chunk-IW62UM3C.js";
8
8
  export {
9
9
  DSH_PROCESS_GRACE_MS,
10
10
  resolveDshLaunch,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DshTrajectory
3
- } from "./chunk-UOQRXV3Q.js";
4
- import "./chunk-DYOJCNWF.js";
3
+ } from "./chunk-FWAPYRV2.js";
4
+ import "./chunk-IW62UM3C.js";
5
5
  export {
6
6
  DshTrajectory
7
7
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-dsh",
3
- "version": "1.1.5",
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.5",
13
- "@mininglamp-oss/octo-runtime-protocol": "1.1.5"
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,7 @@
1
1
  import { AcpClient } from "@mininglamp-oss/octo-runtime-acp-client";
2
2
  import { INVOKE_REQUEST_MAX_BYTES } from "@mininglamp-oss/octo-runtime-protocol";
3
3
  import { mergeProcessEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
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
  export class GrokBuildRpcError extends Error {
@@ -134,9 +135,14 @@ class GrokBuildAcpClient extends AcpClient {
134
135
  }
135
136
  }
136
137
  export function spawnGrokBuildAcpClient(options) {
137
- const child = spawn(options.command, options.args ?? [], {
138
+ const env = mergeProcessEnvironment(process.env, options.env ?? {});
139
+ const launch = resolveProcessLaunch(options.command, options.args ?? [], {
138
140
  cwd: options.cwd,
139
- env: mergeProcessEnvironment(process.env, options.env ?? {}),
141
+ env
142
+ });
143
+ const child = spawn(launch.command, launch.args, {
144
+ cwd: options.cwd,
145
+ env,
140
146
  stdio: ["pipe", "pipe", "pipe"],
141
147
  detached: process.platform !== "win32"
142
148
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-grok-build",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,9 +9,9 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.5",
13
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5",
14
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.5",
15
- "@mininglamp-oss/octo-runtime-protocol": "1.1.5"
12
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.6",
13
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6",
14
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
15
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6"
16
16
  }
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-hermes",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-kimi-code",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-mcode",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
13
13
  }
14
14
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-openclaw",
3
- "version": "1.1.5",
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.5",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.5",
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
10
10
  "ws": "8.22.0"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-opencode",
3
- "version": "1.1.5",
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.5",
9
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.5"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
9
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6",
10
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qodercli",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.5"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
13
13
  }
14
14
  }
@@ -15,7 +15,7 @@ export { watchLineLimit } from "./line-limit.js";
15
15
  export { readBoundedLines } from "./bounded-lines.js";
16
16
  export { HourlyLogWriter, HOURLY_LOG_MAX_BYTES } from "./hourly-log.js";
17
17
  export { RuntimeLogging, assertRuntimeLogging, noopRuntimeLog, type RuntimeLog, type RuntimeLogLevel, type RuntimeLoggingOptions } from "./runtime-log.js";
18
- export { extraStatusRecord, type ExtraStatusRecord } from "./service-status.js";
18
+ export { extraStatusRecord, kernelStatusRecord, type ExtraStatusRecord, type KernelStatusRecord } from "./service-status.js";
19
19
  export { sanitizePublicValue } from "./public-display.js";
20
20
  export { DEFAULT_REASONING_LEVEL_MAPS, OMNI_REASONING_LEVELS, mapReasoningEffort, reasoningLevelMap, type OmniReasoningLevel, type ReasoningLevelMap } from "./reasoning.js";
21
21
  export interface AdapterMetadata {
@@ -6,6 +6,7 @@ import { createInterface } from "node:readline";
6
6
  import { promisify } from "node:util";
7
7
  import { invocationEnvironment, mergeProcessEnvironment, processEnvironmentValue } from "./environment.js";
8
8
  import { createProcessCleanup } from "./process-cleanup.js";
9
+ import { resolveProcessLaunch } from "./process-launch.js";
9
10
  import { watchLineLimit } from "./line-limit.js";
10
11
  import { mapReasoningEffort, reasoningLevelMap } from "./reasoning.js";
11
12
  export { invocationEnvironment, invocationEnvs, mergeProcessEnvironment, processEnvironmentValue } from "./environment.js";
@@ -21,7 +22,7 @@ export { watchLineLimit } from "./line-limit.js";
21
22
  export { readBoundedLines } from "./bounded-lines.js";
22
23
  export { HourlyLogWriter, HOURLY_LOG_MAX_BYTES } from "./hourly-log.js";
23
24
  export { RuntimeLogging, assertRuntimeLogging, noopRuntimeLog } from "./runtime-log.js";
24
- export { extraStatusRecord } from "./service-status.js";
25
+ export { extraStatusRecord, kernelStatusRecord } from "./service-status.js";
25
26
  export { sanitizePublicValue } from "./public-display.js";
26
27
  export { DEFAULT_REASONING_LEVEL_MAPS, OMNI_REASONING_LEVELS, mapReasoningEffort, reasoningLevelMap } from "./reasoning.js";
27
28
  /**
@@ -88,9 +89,11 @@ export function defineAdapter(adapter, levels = reasoningLevelMap(adapter.metada
88
89
  */
89
90
  export async function* spawnJsonLines(options) {
90
91
  const { command, args = [], cwd, env, input, signal, parseLine, onInputWritten } = options;
91
- const child = spawn(command, args, {
92
+ const processEnv = mergeProcessEnvironment(process.env, env ?? {});
93
+ const launch = resolveProcessLaunch(command, args, { cwd, env: processEnv });
94
+ const child = spawn(launch.command, launch.args, {
92
95
  cwd,
93
- env: mergeProcessEnvironment(process.env, env ?? {}),
96
+ env: processEnv,
94
97
  stdio: ["pipe", "pipe", "pipe"],
95
98
  detached: process.platform !== "win32"
96
99
  });
@@ -288,7 +291,8 @@ export async function probeCommand(command, { env = process.env, cwd } = {}) {
288
291
  continue;
289
292
  let version = null;
290
293
  try {
291
- const { stdout } = await promisify(execFile)(resolve(candidate), ["--version"], {
294
+ const launch = resolveProcessLaunch(resolve(candidate), ["--version"], { env, cwd });
295
+ const { stdout } = await promisify(execFile)(launch.command, launch.args, {
292
296
  env,
293
297
  cwd,
294
298
  timeout: 2_000,
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 在 Provider 启动和版本探测前同步解析 Windows npm 包装器,保持 spawn 的同步返回合同。
3
+ * JS 入口交给 Node,原生入口直接执行;argv 独立传递,未知 batch 沿原路径报错。
4
+ * 返回启动命令和参数;ChildProcess、管道及清理仍由调用方负责。
5
+ */
6
+ export declare function resolveProcessLaunch(command: string, args: readonly string[], { env, cwd }?: {
7
+ env?: NodeJS.ProcessEnv;
8
+ cwd?: string;
9
+ }): {
10
+ command: string;
11
+ args: readonly string[];
12
+ };
@@ -0,0 +1,91 @@
1
+ import { readFileSync, statSync } from "node:fs";
2
+ import { basename, delimiter, dirname, extname, join, resolve } from "node:path";
3
+ import { processEnvironmentValue } from "./environment.js";
4
+ function fileSize(file) {
5
+ try {
6
+ const info = statSync(file);
7
+ return info.isFile() ? info.size : undefined;
8
+ }
9
+ catch (error) {
10
+ if (["ENOENT", "ENOTDIR"].includes(error.code ?? ""))
11
+ return undefined;
12
+ throw error;
13
+ }
14
+ }
15
+ function commandPath(command, env, cwd) {
16
+ if (/[/\\]/.test(command) || /^[A-Za-z]:/.test(command))
17
+ return resolve(cwd, command);
18
+ const extensions = extname(command)
19
+ ? [""]
20
+ : (processEnvironmentValue(env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD")
21
+ .split(";")
22
+ .filter((extension) => /^\.(exe|com|cmd|bat)$/i.test(extension));
23
+ const path = processEnvironmentValue(env, "PATH") ?? processEnvironmentValue(process.env, "PATH") ?? "";
24
+ for (const directory of [cwd, ...path.split(delimiter)]) {
25
+ for (const extension of extensions) {
26
+ const candidate = resolve(cwd, directory.replace(/^"(.*)"$/, "$1"), command + extension);
27
+ if (fileSize(candidate) !== undefined)
28
+ return candidate;
29
+ }
30
+ }
31
+ return undefined;
32
+ }
33
+ /**
34
+ * 在 Provider 启动和版本探测前同步解析 Windows npm 包装器,保持 spawn 的同步返回合同。
35
+ * JS 入口交给 Node,原生入口直接执行;argv 独立传递,未知 batch 沿原路径报错。
36
+ * 返回启动命令和参数;ChildProcess、管道及清理仍由调用方负责。
37
+ */
38
+ export function resolveProcessLaunch(command, args, { env = process.env, cwd = process.cwd() } = {}) {
39
+ const original = { command, args };
40
+ if (process.platform !== "win32")
41
+ return original;
42
+ let carrier = commandPath(command, env, cwd);
43
+ if (!carrier)
44
+ return original;
45
+ // probeCommand 可能返回 npm 同时生成的 Unix 入口,仍绑定同一目录的 Windows shim。
46
+ if (!extname(carrier)) {
47
+ const size = fileSize(carrier);
48
+ if (size !== undefined &&
49
+ size <= 64 * 1024 &&
50
+ /^#!.*\bsh\b/.test(readFileSync(carrier, "utf8"))) {
51
+ const sibling = `${carrier}.cmd`;
52
+ if (fileSize(sibling) !== undefined)
53
+ carrier = sibling;
54
+ }
55
+ }
56
+ if (!/\.(cmd|bat)$/i.test(carrier))
57
+ return { command: carrier, args };
58
+ const size = fileSize(carrier);
59
+ if (size === undefined || size > 64 * 1024)
60
+ return { command: carrier, args };
61
+ const shim = readFileSync(carrier, "utf8");
62
+ if (!/^:find_dp0\s*$/im.test(shim) || !/^\s*CALL :find_dp0\s*$/im.test(shim))
63
+ return { command: carrier, args };
64
+ const match = /^(.*)"%(?:~dp0|dp0%)([^"\r\n]+?\.(?:[cm]?js|exe|com))"\s+%\*\s*$/im.exec(shim);
65
+ // 不解释自定义 batch、额外参数或变量展开;保留 Node 对不支持载体的原始失败。
66
+ if (!match || match[2].includes("%"))
67
+ return { command: carrier, args };
68
+ const entry = resolve(dirname(carrier), match[2].replace(/^[/\\]+/, ""));
69
+ if (/\.(exe|com)$/i.test(entry)) {
70
+ if (match[1].trim() && !/[&|]\s*$/.test(match[1]))
71
+ return { command: carrier, args };
72
+ return { command: entry, args };
73
+ }
74
+ if (!/(?:\bnode(?:\.exe)?|"%_prog%")\s*$/i.test(match[1]))
75
+ return { command: carrier, args };
76
+ if (fileSize(entry) === undefined)
77
+ throw Object.assign(new Error("Provider command entry not found"), {
78
+ code: "ENOENT",
79
+ path: entry
80
+ });
81
+ const adjacentNode = join(dirname(carrier), "node.exe");
82
+ const pathNode = commandPath("node", env, cwd);
83
+ const node = fileSize(adjacentNode) !== undefined
84
+ ? adjacentNode
85
+ : pathNode && /\.(exe|com)$/i.test(pathNode)
86
+ ? pathNode
87
+ : basename(process.execPath).toLowerCase() === "node.exe"
88
+ ? process.execPath
89
+ : "node";
90
+ return { command: node, args: [entry, ...args] };
91
+ }