@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
@@ -23,10 +23,9 @@ interface CodeBuddyUpdate extends AcpUpdate {
23
23
  /** Translate one ACP update into canonical events; unrecognized update kinds yield nothing. */
24
24
  export declare function normalizeCodeBuddyUpdate(update: CodeBuddyUpdate): CanonicalEvent[];
25
25
  /**
26
- * Create a CodeBuddy adapter. Each invocation spawns an ACP client, initializes
27
- * the connection, then either loads the stored provider session or creates a
28
- * new one. The final message/run terminals are synthesized here because ACP
29
- * prompt streams end silently rather than with a terminal.
26
+ * 创建 CodeBuddy adapter;每轮拥有独立 ACP client,先握手并创建或恢复显式会话,再发送 prompt。
27
+ * adapter 将 Provider 结果映射为唯一终态并负责关闭 client;Core 独立确认清理完成。
28
+ * 显式模型在 prompt 前按本次原生目录设置并确认;回执只取确认值,Provider 失败优先于部分输出及空输出检查。
30
29
  */
31
30
  export declare function createCodeBuddyAdapter({ acpClientFactory, command }?: {
32
31
  acpClientFactory?: typeof spawnAcpClient;
@@ -1,5 +1,5 @@
1
1
  import { initialControlInstructions, invocationEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
- import { canonicalTerminalStatus, hasImageInput } from "@mininglamp-oss/octo-runtime-protocol";
2
+ import { canonicalTerminalStatus, failureMessage, hasImageInput } from "@mininglamp-oss/octo-runtime-protocol";
3
3
  import { acpLoadSessionParams, acpNewSessionParams, acpPromptParams, spawnAcpClient } from "@mininglamp-oss/octo-runtime-acp-client";
4
4
  import { AcpApprovalBridge, AcpTurnNormalizer, acpToolTerminalStatus, defineAdapter, normalizeAcpToolUpdate, probeCommand, providerInputText } from "@mininglamp-oss/octo-runtime-adapter-sdk";
5
5
  /** Translate one ACP update into canonical events; unrecognized update kinds yield nothing. */
@@ -55,7 +55,7 @@ export function normalizeCodeBuddyUpdate(update) {
55
55
  {
56
56
  protocolVersion: 2,
57
57
  type: "usage.update",
58
- payload: { ...update.usage, model: update.model }
58
+ payload: { ...update.usage, ...(update.model ? { model: update.model } : {}) }
59
59
  }
60
60
  ];
61
61
  return [];
@@ -68,11 +68,101 @@ function isCancelledStopReason(reason) {
68
68
  return (typeof reason === "string" &&
69
69
  ["cancelled", "canceled", "interrupted", "aborted"].includes(reason.toLowerCase()));
70
70
  }
71
+ /** 只回报本次原生响应确认的模型;请求值及旧 binding 都不代表恢复后的实际模型。 */
72
+ function confirmedSessionModel(result) {
73
+ if (!isRecord(result))
74
+ return undefined;
75
+ const option = Array.isArray(result.configOptions)
76
+ ? result.configOptions.find((value) => isRecord(value) && (value.id === "model" || value.category === "model"))
77
+ : undefined;
78
+ for (const value of [
79
+ isRecord(option) ? option.currentValue : undefined,
80
+ isRecord(result.models) ? result.models.currentModelId : undefined,
81
+ result.model
82
+ ]) {
83
+ if (typeof value === "string" && value.trim())
84
+ return value;
85
+ }
86
+ return undefined;
87
+ }
88
+ /** 只使用本次会话广告的目录与原生 setter,不把 session/new.model 当作选模确认。 */
89
+ function modelSelection(session, sessionId, model) {
90
+ const result = isRecord(session) ? session : {};
91
+ const option = Array.isArray(result.configOptions)
92
+ ? result.configOptions.find((value) => isRecord(value) && (value.id === "model" || value.category === "model"))
93
+ : undefined;
94
+ const config = isRecord(option) ? option : undefined;
95
+ const models = isRecord(result.models) ? result.models : {};
96
+ const entries = config
97
+ ? Array.isArray(config.options)
98
+ ? config.options.flatMap((value) => isRecord(value) && Array.isArray(value.options) ? value.options : [value])
99
+ : []
100
+ : Array.isArray(models.availableModels)
101
+ ? models.availableModels
102
+ : [];
103
+ const available = entries
104
+ .filter(isRecord)
105
+ .map((entry) => (config ? entry.value : entry.modelId))
106
+ .filter((value) => typeof value === "string" && value.length > 0);
107
+ if (!available.includes(model)) {
108
+ throw new Error(`MODEL_NOT_FOUND: CodeBuddy does not offer model ${model}. Select a model from its advertised catalog.`);
109
+ }
110
+ if (confirmedSessionModel(result) === model)
111
+ return undefined;
112
+ if (config && (typeof config.id !== "string" || !config.id.trim())) {
113
+ throw new Error(`CodeBuddy cannot select model ${model}: the model config option has no id`);
114
+ }
115
+ return config
116
+ ? {
117
+ method: "session/set_config_option",
118
+ params: { sessionId, configId: config.id, value: model }
119
+ }
120
+ : { method: "session/set_model", params: { sessionId, modelId: model } };
121
+ }
122
+ /** ACP 失败详情按宿主要求原样序列化,不解析或筛选 Provider 的私有错误字段。 */
123
+ function promptFailure(update) {
124
+ const meta = isRecord(update._meta) ? update._meta : {};
125
+ const outcome = meta["codebuddy.ai/outcome"];
126
+ const raw = meta["codebuddy.ai/errorMessage"];
127
+ const hasError = typeof raw === "string" ? raw.trim().length > 0 : raw != null;
128
+ if (!(typeof update.stopReason === "string" && update.stopReason.toLowerCase() === "refusal") &&
129
+ !(typeof outcome === "string" && outcome.startsWith("FAILED")) &&
130
+ !hasError)
131
+ return undefined;
132
+ return {
133
+ code: "ACP_MODEL_REQUEST_FAILED",
134
+ message: `${failureMessage("OH-PRV-4010")}\n${JSON.stringify(update._meta)}`,
135
+ adapterType: "codebuddy"
136
+ };
137
+ }
138
+ /** 与通用 ACP 一致,仅在无流式 final 且未失败时使用已支持的结果正文载体。 */
139
+ function promptResultText(update) {
140
+ for (const value of [
141
+ update.text,
142
+ update.content,
143
+ update.output,
144
+ update.response,
145
+ update.message
146
+ ]) {
147
+ if (typeof value === "string" && value.trim())
148
+ return value;
149
+ if (isRecord(value) && typeof value.text === "string" && value.text.trim())
150
+ return value.text;
151
+ if (Array.isArray(value)) {
152
+ const text = value
153
+ .filter(isRecord)
154
+ .map((item) => (typeof item.text === "string" ? item.text : ""))
155
+ .join("");
156
+ if (text.trim())
157
+ return text;
158
+ }
159
+ }
160
+ return undefined;
161
+ }
71
162
  /**
72
- * Create a CodeBuddy adapter. Each invocation spawns an ACP client, initializes
73
- * the connection, then either loads the stored provider session or creates a
74
- * new one. The final message/run terminals are synthesized here because ACP
75
- * prompt streams end silently rather than with a terminal.
163
+ * 创建 CodeBuddy adapter;每轮拥有独立 ACP client,先握手并创建或恢复显式会话,再发送 prompt。
164
+ * adapter 将 Provider 结果映射为唯一终态并负责关闭 client;Core 独立确认清理完成。
165
+ * 显式模型在 prompt 前按本次原生目录设置并确认;回执只取确认值,Provider 失败优先于部分输出及空输出检查。
76
166
  */
77
167
  export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, command = "codebuddy" } = {}) {
78
168
  const responders = new Map();
@@ -114,7 +204,7 @@ export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, comm
114
204
  const sessionMethod = requestedSessionId ? "session/load" : "session/new";
115
205
  const sessionParams = requestedSessionId
116
206
  ? acpLoadSessionParams(requestedSessionId, { cwd: req.workdir })
117
- : acpNewSessionParams({ cwd: req.workdir, model: req.agentConfig?.model });
207
+ : acpNewSessionParams({ cwd: req.workdir });
118
208
  const sessionRequestId = client.reserveRequestId();
119
209
  let session;
120
210
  const requestOptions = {
@@ -133,8 +223,21 @@ export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, comm
133
223
  throw new Error("ACP session/new returned no sessionId");
134
224
  session = { id: sessionId };
135
225
  }
136
- // The AgentSession stores only the provider sessionId; both the
137
- // new and resume paths converge on the same ACP prompt stream.
226
+ let model = confirmedSessionModel(sessionResult);
227
+ const requestedModel = req.agentConfig?.model;
228
+ if (requestedModel) {
229
+ const selection = modelSelection(sessionResult, session.id, requestedModel);
230
+ if (selection) {
231
+ const selected = await client.request(selection.method, selection.params, {
232
+ requestId: client.reserveRequestId()
233
+ });
234
+ // 空 ACK 或旧模型都不能证明切换生效;失败时不发送下一轮 prompt。
235
+ model = confirmedSessionModel(selected);
236
+ if (model !== requestedModel) {
237
+ throw new Error(`CodeBuddy did not confirm model ${requestedModel} after selection (confirmed: ${model ?? "unknown"}). Select a supported model and retry.`);
238
+ }
239
+ }
240
+ }
138
241
  yield {
139
242
  protocolVersion: 2,
140
243
  type: "session.update",
@@ -142,7 +245,7 @@ export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, comm
142
245
  providerSession: {
143
246
  sessionId: session.id,
144
247
  resumable: true,
145
- model: req.agentConfig?.model
248
+ ...(model ? { model } : {})
146
249
  }
147
250
  }
148
251
  };
@@ -151,6 +254,9 @@ export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, comm
151
254
  const promptRequestId = client.reserveRequestId();
152
255
  let promptStopReason;
153
256
  let promptFinishReason;
257
+ let failure;
258
+ let resultText;
259
+ let producedFinalOutput = false;
154
260
  const activeToolIds = new Set();
155
261
  const turn = new AcpTurnNormalizer("codebuddy");
156
262
  for await (const update of client.prompt(session.id, prompt, {
@@ -158,12 +264,21 @@ export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, comm
158
264
  params: promptParams
159
265
  })) {
160
266
  if (update.type === "prompt_result") {
161
- promptStopReason = update.stopReason;
162
- promptFinishReason = update.finishReason;
267
+ promptStopReason =
268
+ typeof update.stopReason === "string" ? update.stopReason : undefined;
269
+ promptFinishReason =
270
+ typeof update.finishReason === "string" ? update.finishReason : undefined;
271
+ failure ??= promptFailure(update);
272
+ resultText = promptResultText(update);
163
273
  continue;
164
274
  }
165
275
  const events = turn.normalize(update.sessionUpdate ?? update.type, normalizeCodeBuddyUpdate(update));
166
276
  for (const event of events) {
277
+ if (event.type === "message.delta" &&
278
+ event.payload.channel !== "analysis" &&
279
+ typeof event.payload.text === "string" &&
280
+ event.payload.text.trim())
281
+ producedFinalOutput = true;
167
282
  const toolID = typeof event.payload.id === "string" ? event.payload.id : undefined;
168
283
  if (event.type === "tool_call.create" && toolID)
169
284
  activeToolIds.add(toolID);
@@ -174,34 +289,54 @@ export function createCodeBuddyAdapter({ acpClientFactory = spawnAcpClient, comm
174
289
  yield event;
175
290
  }
176
291
  }
177
- const cancelled = isCancelledStopReason(promptStopReason);
178
- if (cancelled) {
292
+ const cancelled = !failure && (req.signal?.aborted || isCancelledStopReason(promptStopReason));
293
+ if (!cancelled && !failure && !producedFinalOutput && resultText) {
294
+ yield* turn.normalize("agent_message_chunk", normalizeCodeBuddyUpdate({
295
+ sessionUpdate: "agent_message_chunk",
296
+ content: { text: resultText }
297
+ }));
298
+ producedFinalOutput = true;
299
+ }
300
+ if (!cancelled && !failure && !producedFinalOutput) {
301
+ failure = {
302
+ code: "ACP_NO_FINAL_OUTPUT",
303
+ message: "CodeBuddy completed without assistant output",
304
+ adapterType: "codebuddy"
305
+ };
306
+ }
307
+ const status = failure ? "failed" : cancelled ? "cancelled" : "completed";
308
+ if (cancelled || failure) {
179
309
  for (const id of activeToolIds) {
180
310
  yield {
181
311
  protocolVersion: 2,
182
312
  type: "tool_call.update",
183
- payload: { id, status: canonicalTerminalStatus("cancelled") }
313
+ payload: { id, status: canonicalTerminalStatus(status) }
184
314
  };
185
315
  }
186
316
  }
187
- for (const event of turn.finish(promptFinishReason ?? promptStopReason, cancelled ? "cancelled" : "completed"))
317
+ for (const event of turn.finish(promptFinishReason ?? promptStopReason, status))
188
318
  yield event;
189
319
  const terminalMessage = {
190
320
  protocolVersion: 2,
191
321
  type: "message.update",
192
- payload: { role: "assistant", status: cancelled ? "stopped" : "completed" }
322
+ payload: {
323
+ role: "assistant",
324
+ status: failure ? "failed" : cancelled ? "stopped" : "completed"
325
+ }
193
326
  };
194
327
  yield terminalMessage;
195
- yield cancelled
196
- ? {
197
- protocolVersion: 2,
198
- type: "run.cancelled",
199
- payload: {
200
- reason: promptStopReason ?? "cancelled",
201
- ...(promptFinishReason ? { finishReason: promptFinishReason } : {})
328
+ yield failure
329
+ ? { protocolVersion: 2, type: "run.failed", payload: failure }
330
+ : cancelled
331
+ ? {
332
+ protocolVersion: 2,
333
+ type: "run.cancelled",
334
+ payload: {
335
+ reason: promptStopReason ?? "cancelled",
336
+ ...(promptFinishReason ? { finishReason: promptFinishReason } : {})
337
+ }
202
338
  }
203
- }
204
- : { protocolVersion: 2, type: "run.completed", payload: {} };
339
+ : { protocolVersion: 2, type: "run.completed", payload: {} };
205
340
  }
206
341
  finally {
207
342
  await client.close?.();
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
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-acp-client": "1.1.4",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
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.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": [
@@ -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.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,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.4",
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.4",
13
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.4",
14
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
15
- "@mininglamp-oss/octo-runtime-protocol": "1.1.4"
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
  }