@mininglamp-oss/octo-runtime 1.1.5 → 1.1.7

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 (282) 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/dist/public/dsh.d.ts +1 -1
  10. package/dist/public/dsh.js +1 -1
  11. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +5 -2
  12. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  13. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +9 -1
  14. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +17 -0
  15. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  16. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +20 -2
  17. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  18. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +32 -2
  19. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +3 -0
  20. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  21. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +19 -6
  22. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +161 -26
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +8 -1
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +32 -2
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-DYOJCNWF.js → chunk-CFKMMCO6.js} +6 -4
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-UOQRXV3Q.js → chunk-LO34KB7D.js} +1 -1
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-V5W6ZTYC.js +151 -0
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +5 -3
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +3 -1
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +17 -3
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +8 -6
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +2 -1
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +4 -3
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +9 -1
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +8 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +10 -6
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +9 -1
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +9 -1
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +9 -1
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.d.ts +2 -1
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.js +12 -40
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +22 -2
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +422 -135
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +6 -2
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +2 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +9 -1
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +9 -1
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +19 -5
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +15 -8
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +12 -0
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +91 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +2 -2
  65. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +13 -1
  66. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +9 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +40 -0
  68. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +3 -2
  69. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +20 -2
  70. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  71. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +4 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +102 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  74. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +1 -1
  75. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +8 -4
  76. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +11 -5
  77. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +5 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +3 -2
  79. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
  80. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.d.ts +2 -1
  81. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.js +102 -52
  82. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +8 -3
  83. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +5 -3
  84. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +4 -3
  85. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +9 -4
  86. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +2 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
  88. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +9 -6
  89. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +47 -4
  90. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  91. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  93. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +79 -5
  95. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +3 -1
  96. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +22 -6
  97. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  98. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +5 -3
  99. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +12 -6
  100. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +4 -2
  101. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +131 -43
  102. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  103. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
  104. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.d.ts +17 -1
  105. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +22 -6
  106. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.d.ts +3 -0
  107. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.js +27 -0
  108. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +462 -228
  109. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.d.ts +5 -2
  110. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.js +42 -4
  111. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +5 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.d.ts +15 -0
  113. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.js +28 -0
  114. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +16 -5
  115. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.d.ts +4 -5
  116. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.js +12 -9
  117. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.d.ts +1 -0
  118. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.js +7 -5
  119. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.d.ts +15 -0
  120. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.js +36 -0
  121. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.d.ts +2 -0
  122. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.js +10 -0
  123. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +5 -2
  124. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +39 -22
  125. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.d.ts +29 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.js +171 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +4 -1
  128. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -6
  129. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +14 -1
  130. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +4 -0
  131. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +7 -1
  132. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.js +265 -38
  133. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.d.ts +4 -0
  134. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +5 -5
  135. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +7 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +19 -2
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.d.ts +3 -1
  138. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +4 -3
  139. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.d.ts +0 -12
  140. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.js +5 -3
  141. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +2 -1
  142. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +8 -6
  143. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.d.ts +3 -0
  144. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.js +2 -2
  145. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.d.ts +2 -2
  146. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.js +27 -15
  147. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +17 -1
  148. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +217 -50
  149. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +2 -4
  150. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.d.ts +3 -2
  151. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.js +41 -12
  152. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.d.ts +2 -6
  153. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +53 -82
  154. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.d.ts +12 -0
  155. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.js +133 -0
  156. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.d.ts +21 -0
  157. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.js +76 -0
  158. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +0 -2
  159. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +0 -2
  160. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.d.ts +16 -0
  161. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.js +74 -0
  162. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.d.ts +4 -0
  163. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.js +19 -0
  164. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.d.ts +7 -0
  165. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.js +90 -0
  166. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +39 -2
  167. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.d.ts +6 -0
  168. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.js +60 -0
  169. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +2 -1
  170. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +20 -8
  171. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  172. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js +10 -2
  173. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +14 -1
  174. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/channel.js +2 -3
  175. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  176. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  177. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.d.ts +3 -2
  178. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.js +11 -4
  179. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +2 -0
  180. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +5 -3
  181. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  182. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +8 -1
  183. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -1
  184. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +9 -1
  185. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +18 -0
  186. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +3 -0
  187. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +6 -0
  188. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +14 -0
  189. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  190. package/node_modules/iconv-lite/LICENSE +21 -0
  191. package/node_modules/iconv-lite/README.md +138 -0
  192. package/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  193. package/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  194. package/node_modules/iconv-lite/encodings/index.js +23 -0
  195. package/node_modules/iconv-lite/encodings/internal.js +218 -0
  196. package/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  197. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  198. package/node_modules/iconv-lite/encodings/sbcs-data.js +180 -0
  199. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  200. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  201. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  202. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  203. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  204. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  205. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  206. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  207. package/node_modules/iconv-lite/encodings/utf16.js +187 -0
  208. package/node_modules/iconv-lite/encodings/utf32.js +314 -0
  209. package/node_modules/iconv-lite/encodings/utf7.js +283 -0
  210. package/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  211. package/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  212. package/node_modules/iconv-lite/lib/index.d.ts +129 -0
  213. package/node_modules/iconv-lite/lib/index.js +182 -0
  214. package/node_modules/iconv-lite/lib/streams.js +105 -0
  215. package/node_modules/iconv-lite/package.json +70 -0
  216. package/node_modules/iconv-lite/types/encodings.d.ts +425 -0
  217. package/node_modules/safer-buffer/LICENSE +21 -0
  218. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  219. package/node_modules/safer-buffer/Readme.md +156 -0
  220. package/node_modules/safer-buffer/dangerous.js +58 -0
  221. package/node_modules/safer-buffer/package.json +34 -0
  222. package/node_modules/safer-buffer/safer.js +77 -0
  223. package/node_modules/safer-buffer/tests.js +406 -0
  224. package/node_modules/semver/LICENSE +15 -0
  225. package/node_modules/semver/README.md +680 -0
  226. package/node_modules/semver/bin/semver.js +195 -0
  227. package/node_modules/semver/classes/comparator.js +143 -0
  228. package/node_modules/semver/classes/index.js +7 -0
  229. package/node_modules/semver/classes/range.js +577 -0
  230. package/node_modules/semver/classes/semver.js +350 -0
  231. package/node_modules/semver/functions/clean.js +8 -0
  232. package/node_modules/semver/functions/cmp.js +54 -0
  233. package/node_modules/semver/functions/coerce.js +62 -0
  234. package/node_modules/semver/functions/compare-build.js +9 -0
  235. package/node_modules/semver/functions/compare-loose.js +5 -0
  236. package/node_modules/semver/functions/compare.js +7 -0
  237. package/node_modules/semver/functions/diff.js +60 -0
  238. package/node_modules/semver/functions/eq.js +5 -0
  239. package/node_modules/semver/functions/gt.js +5 -0
  240. package/node_modules/semver/functions/gte.js +5 -0
  241. package/node_modules/semver/functions/inc.js +21 -0
  242. package/node_modules/semver/functions/lt.js +5 -0
  243. package/node_modules/semver/functions/lte.js +5 -0
  244. package/node_modules/semver/functions/major.js +5 -0
  245. package/node_modules/semver/functions/minor.js +5 -0
  246. package/node_modules/semver/functions/neq.js +5 -0
  247. package/node_modules/semver/functions/parse.js +18 -0
  248. package/node_modules/semver/functions/patch.js +5 -0
  249. package/node_modules/semver/functions/prerelease.js +8 -0
  250. package/node_modules/semver/functions/rcompare.js +5 -0
  251. package/node_modules/semver/functions/rsort.js +5 -0
  252. package/node_modules/semver/functions/satisfies.js +12 -0
  253. package/node_modules/semver/functions/sort.js +5 -0
  254. package/node_modules/semver/functions/truncate.js +48 -0
  255. package/node_modules/semver/functions/valid.js +8 -0
  256. package/node_modules/semver/index.js +93 -0
  257. package/node_modules/semver/internal/constants.js +37 -0
  258. package/node_modules/semver/internal/debug.js +11 -0
  259. package/node_modules/semver/internal/identifiers.js +29 -0
  260. package/node_modules/semver/internal/lrucache.js +42 -0
  261. package/node_modules/semver/internal/parse-options.js +17 -0
  262. package/node_modules/semver/internal/re.js +223 -0
  263. package/node_modules/semver/package.json +78 -0
  264. package/node_modules/semver/preload.js +4 -0
  265. package/node_modules/semver/range.bnf +17 -0
  266. package/node_modules/semver/ranges/gtr.js +6 -0
  267. package/node_modules/semver/ranges/intersects.js +9 -0
  268. package/node_modules/semver/ranges/ltr.js +6 -0
  269. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  270. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  271. package/node_modules/semver/ranges/min-version.js +63 -0
  272. package/node_modules/semver/ranges/outside.js +82 -0
  273. package/node_modules/semver/ranges/simplify.js +49 -0
  274. package/node_modules/semver/ranges/subset.js +249 -0
  275. package/node_modules/semver/ranges/to-comparators.js +10 -0
  276. package/node_modules/semver/ranges/valid.js +13 -0
  277. package/package.json +33 -27
  278. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
  279. package/packages/octo-runtime-protocol/schema/protocol.schema.json +57 -1
  280. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-G5PWGRL5.js +0 -209
  281. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +0 -1
  282. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +0 -16
@@ -0,0 +1,102 @@
1
+ import { constants } from "node:fs";
2
+ import { access, lstat, readFile, realpath, stat } from "node:fs/promises";
3
+ import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
+ import { processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
5
+ import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
6
+ /** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
7
+ export async function readCliAdapterConfigurations(profileRoot, adapters, manifest, env = process.env) {
8
+ const configurations = readAdapterConfigurations(profileRoot, adapters);
9
+ if (configurations.dsh?.providerOptions?.dshBin !== undefined ||
10
+ !manifest.adapters.some((entry) => entry.type === "dsh" || entry.type === undefined))
11
+ return configurations;
12
+ const dshBin = await discoverDshEntry(env);
13
+ if (dshBin)
14
+ configurations.dsh = {
15
+ ...configurations.dsh,
16
+ providerOptions: { ...configurations.dsh?.providerOptions, dshBin }
17
+ };
18
+ return configurations;
19
+ }
20
+ async function discoverDshEntry(env) {
21
+ const extensions = process.platform === "win32"
22
+ ? (processEnvironmentValue(env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";")
23
+ : [""];
24
+ for (const directory of (processEnvironmentValue(env, "PATH") ?? "").split(delimiter)) {
25
+ if (!directory)
26
+ continue;
27
+ for (const extension of extensions) {
28
+ const command = resolve(directory, `dsh${extension}`);
29
+ // 只有路径不存在才能继续;lstat 保留损坏链接,首个已存在候选不可因不可用而换安装。
30
+ try {
31
+ await lstat(command);
32
+ }
33
+ catch (error) {
34
+ const code = error.code;
35
+ if (code === "ENOENT" || code === "ENOTDIR")
36
+ continue;
37
+ return;
38
+ }
39
+ try {
40
+ await access(command, process.platform === "win32" ? constants.F_OK : constants.X_OK);
41
+ if (!(await stat(command)).isFile())
42
+ return;
43
+ }
44
+ catch {
45
+ return;
46
+ }
47
+ // 先固定 PATH 中的命令,再读取安装元数据;不执行 shim,也不因版本不兼容换另一安装。
48
+ return packageEntryForCommand(command);
49
+ }
50
+ }
51
+ }
52
+ async function packageEntryForCommand(command) {
53
+ let target;
54
+ try {
55
+ target = await realpath(command);
56
+ }
57
+ catch {
58
+ return;
59
+ }
60
+ // npm 在 Unix 上使用符号链接;从链接目标向上确认包名,兼容自定义 prefix。
61
+ for (let directory = dirname(target);; directory = dirname(directory)) {
62
+ const entry = await packageEntry(directory);
63
+ if (entry)
64
+ return entry;
65
+ if (directory === dirname(directory))
66
+ break;
67
+ }
68
+ const binDirectory = dirname(command);
69
+ // Windows npm shim、Unix 全局 prefix/bin、以及项目 node_modules/.bin 均只读相邻安装。
70
+ for (const directory of [
71
+ join(binDirectory, "node_modules", "@deepseek-ai", "dsh"),
72
+ join(binDirectory, "..", "lib", "node_modules", "@deepseek-ai", "dsh"),
73
+ join(binDirectory, "..", "@deepseek-ai", "dsh")
74
+ ]) {
75
+ const entry = await packageEntry(directory);
76
+ if (entry)
77
+ return entry;
78
+ }
79
+ }
80
+ async function packageEntry(directory) {
81
+ try {
82
+ const metadata = JSON.parse(await readFile(join(directory, "package.json"), "utf8"));
83
+ if (metadata?.name !== "@deepseek-ai/dsh")
84
+ return;
85
+ const bin = typeof metadata.bin === "string"
86
+ ? metadata.bin
87
+ : metadata.bin && typeof metadata.bin === "object"
88
+ ? metadata.bin.dsh
89
+ : undefined;
90
+ if (typeof bin !== "string" || !bin.trim() || isAbsolute(bin))
91
+ return;
92
+ const entry = resolve(directory, bin);
93
+ const location = relative(directory, entry);
94
+ if (location === ".." || location.startsWith(`..${sep}`) || isAbsolute(location))
95
+ return;
96
+ // 文件与版本由 Adapter 校验;即使入口缺失,也不能改选 PATH 中的另一安装。
97
+ return entry;
98
+ }
99
+ catch {
100
+ return;
101
+ }
102
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "ae7835c168e1e138287c012a6c87517dd2874a5d",
2
+ "commit": "ed7a4c899e5666238bc67e6a8418e3805ac924da",
3
3
  "dirty": false,
4
- "buildTime": "2026-10-27T08:38:03.037Z"
4
+ "buildTime": "2026-10-30T03:47:52.513Z"
5
5
  }
@@ -297,7 +297,7 @@ export async function parseCliCommand(raw, dependencies) {
297
297
  ...(name === "executor-kernel" ? [] : [extrasetExample(name, configExample, module)])
298
298
  ]);
299
299
  for (const [action, summary] of lifecycleCommands) {
300
- if (name === "executor-kernel" && ["logs", "extraset", "extraget"].includes(action))
300
+ if (name === "executor-kernel" && ["extraset", "extraget"].includes(action))
301
301
  continue;
302
302
  const child = leaf(parent, action, summary);
303
303
  const invocation = `${prefix} ${action}`;
@@ -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 {
@@ -5,7 +5,7 @@ import { once } from "node:events";
5
5
  import { lstat, mkdir } from "node:fs/promises";
6
6
  import { join, resolve } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
- 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";
9
9
  import { componentEndpoint, createExtraService } from "@mininglamp-oss/octo-runtime-host-sdk";
10
10
  import { getExtra, readExtra, setExtra } from "./extras.js";
11
11
  import { cliVersionInfo } from "./help.js";
@@ -16,6 +16,7 @@ import { StatusOutput } from "./status-output.js";
16
16
  import { defaultRuntimeHome, runtimePaths, withSetupLock, readJsonFile } from "./state.js";
17
17
  import { resolveServiceControl } from "./service-control.js";
18
18
  import { loadCliManifest } from "./module-manifest.js";
19
+ import { readCliAdapterConfigurations } from "./adapter-configurations.js";
19
20
  import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
20
21
  import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
21
22
  import { describeError, formatStatus, recordStartupFailure, readStartupFailure } from "./output.js";
@@ -72,9 +73,12 @@ export async function runCli(args, dependencies = {}) {
72
73
  // Route logs before config/module/manager access so offline failures remain diagnosable.
73
74
  if (positional[1] === "logs") {
74
75
  const extra = positional[0];
75
- 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
+ };
76
81
  if (positional.length !== 2 ||
77
- extra === "executor-kernel" ||
78
82
  !/^[a-z][a-z0-9-]{0,63}$/.test(extra) ||
79
83
  flags.autostart !== undefined)
80
84
  throw new Error("INVALID_ARGUMENTS");
@@ -181,7 +185,8 @@ export async function runCli(args, dependencies = {}) {
181
185
  profile,
182
186
  manifest: flags.manifest,
183
187
  input,
184
- output: dependencies.output
188
+ output: dependencies.output,
189
+ env: dependencies.env
185
190
  });
186
191
  }
187
192
  if (positional[0] === "adapter" && positional[1] === "list" && positional.length === 2) {
@@ -246,11 +251,12 @@ export async function runCli(args, dependencies = {}) {
246
251
  if (component === "executor-kernel") {
247
252
  const config = await readJsonFile(paths.profileConfig);
248
253
  handle = createKernelService({
254
+ logging: { directory: join(home, "logs") },
249
255
  endpoint,
250
256
  stateDirectory: kernelStateDirectory,
251
257
  workerEntrypoint: fileURLToPath(new URL("./worker.js", import.meta.url)),
252
258
  adapterModules: resolveAdapterModules(manifest),
253
- adapterConfigurations: readAdapterConfigurations(paths.profileRoot, config?.adapters),
259
+ adapterConfigurations: await readCliAdapterConfigurations(paths.profileRoot, config?.adapters, manifest, dependencies.env ?? process.env),
254
260
  env: {
255
261
  ...(dependencies.env ?? process.env),
256
262
  OCTO_RUNTIME_HOME: home,
@@ -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)
@@ -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
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-cli",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,29 +9,29 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "dependencies": {
11
11
  "commander": "15.0.0",
12
- "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.5",
13
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.5",
12
+ "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.7",
13
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.7",
14
14
  "json5": "2.2.3",
15
- "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.5",
16
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.5",
17
- "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.5",
18
- "@mininglamp-oss/octo-runtime-cross-service": "1.1.5",
19
- "@mininglamp-oss/octo-runtime-protocol": "1.1.5",
20
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.5",
21
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.5",
22
- "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.5",
23
- "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.5",
24
- "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.5",
25
- "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.5",
26
- "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.5",
27
- "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.5",
28
- "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.5",
29
- "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.5",
30
- "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.5",
31
- "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.5",
32
- "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.5",
33
- "@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.5",
34
- "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.5",
35
- "@mininglamp-oss/octo-runtime-extra-webui": "1.1.5"
15
+ "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.7",
16
+ "@mininglamp-oss/octo-runtime-host-sdk": "1.1.7",
17
+ "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.7",
18
+ "@mininglamp-oss/octo-runtime-cross-service": "1.1.7",
19
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.7",
20
+ "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.7",
21
+ "@mininglamp-oss/octo-runtime-executor-core": "1.1.7",
22
+ "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.7",
23
+ "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.7",
24
+ "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.7",
25
+ "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.7",
26
+ "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.7",
27
+ "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.7",
28
+ "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.7",
29
+ "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.7",
30
+ "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.7",
31
+ "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.7",
32
+ "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.7",
33
+ "@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.7",
34
+ "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.7",
35
+ "@mininglamp-oss/octo-runtime-extra-webui": "1.1.7"
36
36
  }
37
37
  }
@@ -6,6 +6,7 @@ import type { CommandOptions, CommandResult, CommandRunner } from "./types.js";
6
6
  * with exit code 124, allowing the service layer to attach backend context.
7
7
  */
8
8
  export declare class NodeCommandRunner implements CommandRunner {
9
- /** Spawn without a shell, ignore stdin, and capture bounded stdout/stderr. */
9
+ #private;
10
+ /** 原命令直接启动并有界捕获;Windows schtasks 内部协商解码,不改变调用方输入。 */
10
11
  run(command: string, args: readonly string[], options?: CommandOptions): Promise<CommandResult>;
11
12
  }
@@ -1,5 +1,7 @@
1
1
  /** Shell-free Node.js process runner used to invoke native service managers. */
2
2
  import { spawn } from "node:child_process";
3
+ import { win32 } from "node:path";
4
+ import iconv from "iconv-lite";
3
5
  const DEFAULT_TIMEOUT_MS = 30_000;
4
6
  const MAX_CAPTURE_CHARS = 64 * 1024;
5
7
  /**
@@ -9,62 +11,110 @@ const MAX_CAPTURE_CHARS = 64 * 1024;
9
11
  * with exit code 124, allowing the service layer to attach backend context.
10
12
  */
11
13
  export class NodeCommandRunner {
12
- /** Spawn without a shell, ignore stdin, and capture bounded stdout/stderr. */
13
- run(command, args, options = {}) {
14
- return new Promise((resolve, reject) => {
15
- const child = spawn(command, [...args], {
16
- cwd: options.cwd,
17
- env: options.env ?? process.env,
18
- shell: false,
19
- stdio: ["ignore", "pipe", "pipe"],
20
- windowsHide: true
21
- });
22
- let stdout = "";
23
- let stderr = "";
24
- let settled = false;
25
- let timedOut = false;
26
- const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
27
- const timer = timeoutMs > 0
28
- ? setTimeout(() => {
29
- timedOut = true;
30
- child.kill("SIGKILL");
31
- }, timeoutMs)
32
- : undefined;
33
- timer?.unref();
14
+ #windowsTaskEncoding;
15
+ /** 原命令直接启动并有界捕获;Windows schtasks 内部协商解码,不改变调用方输入。 */
16
+ async run(command, args, options = {}) {
17
+ if (process.platform !== "win32" || !/^schtasks(?:\.exe)?$/i.test(win32.basename(command))) {
18
+ return runProcess(command, args, options);
19
+ }
20
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
21
+ const startedAt = performance.now();
22
+ if (!this.#windowsTaskEncoding) {
23
+ // 与 manager 相同的隐藏控制台启动条件,只查询代码页,不改变宿主控制台或 shell 设置。
24
+ // 仅缓存成功结果;并发查询各自使用调用预算,短超时不能污染其他请求。
25
+ const system32 = win32.join(process.env.SystemRoot ?? "C:\\Windows", "System32");
26
+ const queried = await runProcess(win32.join(system32, "cmd.exe"), ["/d", "/c", win32.join(system32, "chcp.com")], options);
27
+ if (queried.exitCode === 124)
28
+ return commandTimeout(command, args, timeoutMs);
29
+ const codePage = /(\d+)\s*$/.exec(queried.stdout)?.[1];
30
+ const candidate = codePage === "65001" ? "utf8" : codePage ? `cp${codePage}` : "";
31
+ if (queried.exitCode !== 0 || !candidate || !iconv.encodingExists(candidate)) {
32
+ throw new Error("Windows task output code-page query failed", { cause: queried });
33
+ }
34
+ this.#windowsTaskEncoding = candidate;
35
+ }
36
+ const remainingMs = timeoutMs - (performance.now() - startedAt);
37
+ if (timeoutMs > 0 && remainingMs <= 0)
38
+ return commandTimeout(command, args, timeoutMs);
39
+ // 原命令仍直接启动,超时诊断使用原预算,真实 exit code 124 不等于 timer 已触发。
40
+ return runProcess(command, args, { ...options, timeoutMs: timeoutMs > 0 ? remainingMs : timeoutMs }, this.#windowsTaskEncoding, timeoutMs);
41
+ }
42
+ }
43
+ /** 直接启动原命令;只有 schtasks 的原生字节需要按已查询代码页增量解码。 */
44
+ function runProcess(command, args, options, encoding, reportedTimeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS) {
45
+ return new Promise((resolve, reject) => {
46
+ const child = spawn(command, [...args], {
47
+ cwd: options.cwd,
48
+ env: options.env ?? process.env,
49
+ shell: false,
50
+ stdio: ["ignore", "pipe", "pipe"],
51
+ windowsHide: true
52
+ });
53
+ let stdout = "";
54
+ let stderr = "";
55
+ let settled = false;
56
+ let timedOut = false;
57
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
58
+ const timer = timeoutMs > 0
59
+ ? setTimeout(() => {
60
+ timedOut = true;
61
+ child.kill("SIGKILL");
62
+ }, timeoutMs)
63
+ : undefined;
64
+ timer?.unref();
65
+ const stdoutDecoder = encoding ? iconv.getDecoder(encoding, { stripBOM: false }) : undefined;
66
+ const stderrDecoder = encoding ? iconv.getDecoder(encoding, { stripBOM: false }) : undefined;
67
+ if (!encoding) {
34
68
  child.stdout.setEncoding("utf8");
35
69
  child.stderr.setEncoding("utf8");
36
- child.stdout.on("data", (chunk) => {
37
- stdout = appendBounded(stdout, chunk.toString());
38
- });
39
- child.stderr.on("data", (chunk) => {
40
- stderr = appendBounded(stderr, chunk.toString());
41
- });
42
- child.once("error", (error) => {
43
- if (settled)
44
- return;
45
- settled = true;
46
- if (timer)
47
- clearTimeout(timer);
48
- reject(error);
49
- });
50
- child.once("close", (code) => {
51
- if (settled)
52
- return;
53
- settled = true;
54
- if (timer)
55
- clearTimeout(timer);
56
- resolve({
57
- command,
58
- args: [...args],
59
- exitCode: timedOut ? 124 : (code ?? 1),
60
- stdout,
61
- stderr: timedOut
62
- ? appendBounded(stderr, `\ncommand timed out after ${timeoutMs}ms`)
63
- : stderr
64
- });
70
+ }
71
+ child.stdout.on("data", (chunk) => {
72
+ stdout = appendBounded(stdout, stdoutDecoder ? stdoutDecoder.write(chunk) : chunk.toString());
73
+ });
74
+ child.stderr.on("data", (chunk) => {
75
+ stderr = appendBounded(stderr, stderrDecoder ? stderrDecoder.write(chunk) : chunk.toString());
76
+ });
77
+ child.stdout.once("end", () => {
78
+ stdout = appendBounded(stdout, stdoutDecoder?.end() ?? "");
79
+ });
80
+ child.stderr.once("end", () => {
81
+ stderr = appendBounded(stderr, stderrDecoder?.end() ?? "");
82
+ });
83
+ child.once("error", (error) => {
84
+ if (settled)
85
+ return;
86
+ settled = true;
87
+ if (timer)
88
+ clearTimeout(timer);
89
+ reject(error);
90
+ });
91
+ child.once("close", (code) => {
92
+ if (settled)
93
+ return;
94
+ settled = true;
95
+ if (timer)
96
+ clearTimeout(timer);
97
+ resolve({
98
+ command,
99
+ args: [...args],
100
+ exitCode: timedOut ? 124 : (code ?? 1),
101
+ stdout,
102
+ stderr: timedOut
103
+ ? appendBounded(stderr, `\ncommand timed out after ${reportedTimeoutMs}ms`)
104
+ : stderr
65
105
  });
66
106
  });
67
- }
107
+ });
108
+ }
109
+ /** 内部代码页查询耗尽预算时,不再启动 manager,仍返回原命令的超时事实。 */
110
+ function commandTimeout(command, args, timeoutMs) {
111
+ return {
112
+ command,
113
+ args: [...args],
114
+ exitCode: 124,
115
+ stdout: "",
116
+ stderr: `command timed out after ${timeoutMs}ms`
117
+ };
68
118
  }
69
119
  function appendBounded(current, chunk) {
70
120
  return (current + chunk).slice(-MAX_CAPTURE_CHARS);
@@ -79,6 +79,10 @@ export class WindowsUserTaskBackend {
79
79
  }
80
80
  /** Return live scheduler state and exact drift from the desired XML/principal/action. */
81
81
  async inspect(spec) {
82
+ return this.#inspect(spec, true);
83
+ }
84
+ /** 公开查询要求身份可确认;清理只依赖管理器状态,保留诊断且不放宽查询失败。 */
85
+ async #inspect(spec, requireIdentity) {
82
86
  const normalized = this.#normalize(spec);
83
87
  const taskName = windowsTaskName(normalized);
84
88
  const definitionPath = this.#definitionPath(normalized);
@@ -123,7 +127,7 @@ export class WindowsUserTaskBackend {
123
127
  windowsAccountIdentity(task.trigger_user_id, task.trigger_user_matches, this.#windowsUserId) === undefined;
124
128
  return {
125
129
  manager: this.kind,
126
- state: identityUnknown ? "unknown" : windowsTaskState(task.state),
130
+ state: identityUnknown && requireIdentity ? "unknown" : windowsTaskState(task.state),
127
131
  enabled: task.enabled === true,
128
132
  lastExitCode: task.last_exit_code,
129
133
  definitionPath,
@@ -206,7 +210,8 @@ export class WindowsUserTaskBackend {
206
210
  async stop(spec) {
207
211
  const normalized = await this.#installed(spec);
208
212
  const taskName = windowsTaskName(normalized);
209
- const status = await this.inspect(spec);
213
+ // 账号翻译失败不代表任务仍在运行;停止不依赖账号匹配,权限仍由 Scheduler 校验。
214
+ const status = await this.#inspect(spec, false);
210
215
  if (status.state === "stopped" || status.state === "not_installed")
211
216
  return;
212
217
  if (status.state === "unknown")
@@ -219,7 +224,7 @@ export class WindowsUserTaskBackend {
219
224
  // /End 仅表示请求受理;旧实例仍运行时不能 /Run(IgnoreNew 会吞掉重启)。
220
225
  const end = Date.now() + normalized.timeoutStopSeconds * 1000;
221
226
  while (true) {
222
- const current = await this.inspect(spec);
227
+ const current = await this.#inspect(spec, false);
223
228
  if (current.state === "stopped" || current.state === "not_installed")
224
229
  return;
225
230
  if (current.state === "unknown")
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-cross-service",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "private": true,
5
5
  "description": "Native user-service lifecycle backends for Octo Runtime",
6
6
  "type": "module",
@@ -10,8 +10,10 @@
10
10
  "dist",
11
11
  "README.md"
12
12
  ],
13
+ "dependencies": {
14
+ "iconv-lite": "0.7.3"
15
+ },
13
16
  "engines": {
14
17
  "node": "^24.0.0 || ^26.0.0"
15
- },
16
- "dependencies": {}
18
+ }
17
19
  }
@@ -5,11 +5,12 @@ import type { AdapterInvocationContext, AdapterProbeOptions, AdapterOutput } fro
5
5
  import { type InvokeInput, type InvokeEnvironment, type AdapterProtocolSupport, type HostFrame, type NativeInteractionResponse, type InteractionResponse, type InvokeRequest } from "@mininglamp-oss/octo-runtime-protocol";
6
6
  import { type RuntimeLog } from "@mininglamp-oss/octo-runtime-adapter-sdk";
7
7
  export type { AdapterInvocationContext, AdapterOutput, AdapterProbeOptions, RuntimeLog } from "@mininglamp-oss/octo-runtime-adapter-sdk";
8
- /** Provider-neutral metadata the Host uses for registration and capability discovery. */
8
+ /** 宿主注册及执行时使用的完整元数据;编写时的可选默认值须由 Adapter 工厂先补齐。 */
9
9
  export interface HostedAdapterMetadata {
10
10
  /** False skips Runtime workspace preparation for this Provider. */
11
11
  workspace?: boolean;
12
- protocolSupport?: AdapterProtocolSupport;
12
+ /** 注册输入必须完整;不得因编写阶段可省略而将此字段改成可选或在注册时猜测支持范围。 */
13
+ protocolSupport: AdapterProtocolSupport;
13
14
  type: string;
14
15
  agentSources: ("preset" | "provisioned")[];
15
16
  processModel?: string;
@@ -55,7 +56,7 @@ export declare class AgentExecutor {
55
56
  * 与 Kernel 的观察 iterator 不同,本地 Core 提前结束迭代会请求取消并进入 Adapter 清理。
56
57
  */
57
58
  readonly invoke: import("@mininglamp-oss/octo-runtime-protocol").InputInvoke;
58
- /** Register an adapter by `metadata.type`; the same type cannot be overwritten twice. */
59
+ /** 按 type 注册完整 Adapter 并校验协议声明,不补默认值或启动 Provider;同类型不可覆盖。 */
59
60
  register(adapter: HostedAdapter): void;
60
61
  /** List registered adapters, for Agent registration and control-plane display. */
61
62
  list(): HostedAdapterMetadata[];
@@ -46,7 +46,7 @@ export class AgentExecutor {
46
46
  #acceptedTerminals = new Set();
47
47
  #runs = new Map();
48
48
  #modes = new Map();
49
- /** Register an adapter by `metadata.type`; the same type cannot be overwritten twice. */
49
+ /** 按 type 注册完整 Adapter 并校验协议声明,不补默认值或启动 Provider;同类型不可覆盖。 */
50
50
  register(adapter) {
51
51
  this.#assertOpen();
52
52
  assertAdapterProtocolSupport(adapter.metadata.protocolSupport);
@@ -964,9 +964,14 @@ async function adapterFailurePayload(input, workdir, context) {
964
964
  ...context,
965
965
  ...(detail !== input ? { defaultDomain: "adapter" } : {})
966
966
  });
967
- const safe = sanitizePublicValue(detail);
968
- const message = typeof safe.message === "string" && safe.message.trim()
969
- ? safe.message
967
+ // 仅 ACP 消息保留原始 _meta;外层字段仍按公共错误规则脱敏,不能凭错误码整体绕过。
968
+ const { message: originalMessage, ...outerDetail } = detail;
969
+ const safe = sanitizePublicValue(outerDetail);
970
+ const publicMessage = detail.code === "ACP_MODEL_REQUEST_FAILED" && typeof originalMessage === "string"
971
+ ? originalMessage
972
+ : sanitizePublicValue(originalMessage);
973
+ const message = typeof publicMessage === "string" && publicMessage.trim()
974
+ ? publicMessage
970
975
  : typeof safe.error === "string"
971
976
  ? safe.error
972
977
  : safe.error && typeof safe.error === "object"
@@ -103,6 +103,8 @@ export function prepareInvokeInput(value) {
103
103
  invocationId: input.invocationId ?? `invoke_${randomUUID()}`,
104
104
  runId: input.runId ?? `run_${randomUUID()}`,
105
105
  agentSessionId: value.sessionId ?? `session_${randomUUID()}`,
106
+ // 名称默认值只在此归一化;Host SDK/Adapter 不猜业务策略或据此决定恢复。
107
+ sessionName: input.sessionName ?? randomUUID(),
106
108
  agentSource,
107
109
  continuityMode,
108
110
  ...(providerSession ? { providerSession } : {}),
@@ -1,5 +1,5 @@
1
1
  import type { ContextEnvelope, InvokeRequest } from "@mininglamp-oss/octo-runtime-protocol";
2
- /** 仅渲染允许进入模型的本轮业务 Context;Markdown 指引保留原文,排序后的 payload 用 CDATA 包裹,不修改输入。 */
2
+ /** 仅渲染本轮业务 Context;默认完整 JSON,显式文本格式保留原文,不修改输入。 */
3
3
  export declare function renderModelContexts(context: ContextEnvelope): string;
4
4
  /**
5
5
  * Core 冻结原请求后、派发 Adapter 前调用一次;接入方不应预先渲染而造成 Context 重复。