@mininglamp-oss/octo-runtime 1.1.6 → 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 (236) hide show
  1. package/apps/cli/dist/build-info.json +2 -2
  2. package/dist/public/dsh.d.ts +1 -1
  3. package/dist/public/dsh.js +1 -1
  4. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  5. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +9 -1
  6. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +17 -0
  7. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  8. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +20 -2
  9. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  10. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +32 -2
  11. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +3 -0
  12. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  13. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +16 -2
  14. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  15. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +5 -0
  16. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +32 -2
  17. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  18. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-IW62UM3C.js → chunk-CFKMMCO6.js} +5 -3
  19. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-FWAPYRV2.js → chunk-LO34KB7D.js} +1 -1
  20. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-3GXX5VD5.js → chunk-V5W6ZTYC.js} +14 -6
  21. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +4 -2
  22. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +3 -1
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +17 -3
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +8 -6
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +1 -0
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +4 -3
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.d.ts +9 -1
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +10 -6
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +9 -1
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +9 -1
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +9 -1
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.d.ts +2 -1
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/compatibility.js +12 -40
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +22 -2
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +422 -135
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +6 -2
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +2 -0
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +9 -1
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +9 -1
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +18 -4
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +7 -4
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +20 -2
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  55. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  56. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
  57. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.d.ts +2 -1
  58. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/runner.js +102 -52
  59. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +8 -3
  60. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +5 -3
  61. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +4 -3
  62. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +1 -1
  63. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +2 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
  65. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +9 -6
  66. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  67. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  68. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
  69. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.d.ts +17 -1
  70. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +22 -6
  71. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.d.ts +3 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/history-context.js +27 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +444 -226
  74. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.d.ts +5 -2
  75. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/rules-context.js +42 -4
  76. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +5 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.d.ts +15 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/stable-context.js +28 -0
  79. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +16 -5
  80. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.d.ts +4 -5
  81. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.js +12 -9
  82. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.d.ts +1 -0
  83. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.js +7 -5
  84. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.d.ts +15 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/identity.js +36 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.d.ts +2 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/scheduler.js +10 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +5 -2
  89. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +36 -22
  90. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +14 -1
  91. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +4 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +5 -1
  93. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.js +265 -38
  94. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.d.ts +4 -0
  95. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +5 -5
  96. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +7 -0
  97. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +19 -2
  98. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.d.ts +3 -1
  99. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +4 -3
  100. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.d.ts +0 -12
  101. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/errors.js +5 -3
  102. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +2 -1
  103. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +8 -6
  104. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.d.ts +3 -0
  105. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/messages.js +2 -2
  106. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.d.ts +2 -2
  107. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/card-session.js +27 -15
  108. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +17 -1
  109. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +217 -50
  110. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +2 -4
  111. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.d.ts +3 -2
  112. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connector.js +41 -12
  113. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.d.ts +2 -6
  114. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +53 -82
  115. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.d.ts +12 -0
  116. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-content.js +133 -0
  117. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.d.ts +21 -0
  118. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/history-messages.js +76 -0
  119. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.d.ts +0 -2
  120. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/mentions.js +0 -2
  121. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.d.ts +16 -0
  122. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-identities.js +74 -0
  123. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.d.ts +4 -0
  124. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-time.js +19 -0
  125. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.d.ts +7 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/message-trigger.js +90 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +2 -2
  128. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.d.ts +6 -0
  129. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/retry-after.js +60 -0
  130. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +2 -1
  131. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +20 -8
  132. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  133. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js +10 -2
  134. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +14 -1
  135. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/transport/channel.js +2 -3
  136. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  138. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.d.ts +3 -2
  139. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/context-loader.js +11 -4
  140. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  141. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +8 -1
  142. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +9 -0
  143. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +3 -0
  144. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +6 -0
  145. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +14 -0
  146. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  147. package/node_modules/iconv-lite/LICENSE +21 -0
  148. package/node_modules/iconv-lite/README.md +138 -0
  149. package/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  150. package/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  151. package/node_modules/iconv-lite/encodings/index.js +23 -0
  152. package/node_modules/iconv-lite/encodings/internal.js +218 -0
  153. package/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  154. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  155. package/node_modules/iconv-lite/encodings/sbcs-data.js +180 -0
  156. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  157. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  158. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  159. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  160. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  161. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  162. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  163. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  164. package/node_modules/iconv-lite/encodings/utf16.js +187 -0
  165. package/node_modules/iconv-lite/encodings/utf32.js +314 -0
  166. package/node_modules/iconv-lite/encodings/utf7.js +283 -0
  167. package/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  168. package/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  169. package/node_modules/iconv-lite/lib/index.d.ts +129 -0
  170. package/node_modules/iconv-lite/lib/index.js +182 -0
  171. package/node_modules/iconv-lite/lib/streams.js +105 -0
  172. package/node_modules/iconv-lite/package.json +70 -0
  173. package/node_modules/iconv-lite/types/encodings.d.ts +425 -0
  174. package/node_modules/safer-buffer/LICENSE +21 -0
  175. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  176. package/node_modules/safer-buffer/Readme.md +156 -0
  177. package/node_modules/safer-buffer/dangerous.js +58 -0
  178. package/node_modules/safer-buffer/package.json +34 -0
  179. package/node_modules/safer-buffer/safer.js +77 -0
  180. package/node_modules/safer-buffer/tests.js +406 -0
  181. package/node_modules/semver/LICENSE +15 -0
  182. package/node_modules/semver/README.md +680 -0
  183. package/node_modules/semver/bin/semver.js +195 -0
  184. package/node_modules/semver/classes/comparator.js +143 -0
  185. package/node_modules/semver/classes/index.js +7 -0
  186. package/node_modules/semver/classes/range.js +577 -0
  187. package/node_modules/semver/classes/semver.js +350 -0
  188. package/node_modules/semver/functions/clean.js +8 -0
  189. package/node_modules/semver/functions/cmp.js +54 -0
  190. package/node_modules/semver/functions/coerce.js +62 -0
  191. package/node_modules/semver/functions/compare-build.js +9 -0
  192. package/node_modules/semver/functions/compare-loose.js +5 -0
  193. package/node_modules/semver/functions/compare.js +7 -0
  194. package/node_modules/semver/functions/diff.js +60 -0
  195. package/node_modules/semver/functions/eq.js +5 -0
  196. package/node_modules/semver/functions/gt.js +5 -0
  197. package/node_modules/semver/functions/gte.js +5 -0
  198. package/node_modules/semver/functions/inc.js +21 -0
  199. package/node_modules/semver/functions/lt.js +5 -0
  200. package/node_modules/semver/functions/lte.js +5 -0
  201. package/node_modules/semver/functions/major.js +5 -0
  202. package/node_modules/semver/functions/minor.js +5 -0
  203. package/node_modules/semver/functions/neq.js +5 -0
  204. package/node_modules/semver/functions/parse.js +18 -0
  205. package/node_modules/semver/functions/patch.js +5 -0
  206. package/node_modules/semver/functions/prerelease.js +8 -0
  207. package/node_modules/semver/functions/rcompare.js +5 -0
  208. package/node_modules/semver/functions/rsort.js +5 -0
  209. package/node_modules/semver/functions/satisfies.js +12 -0
  210. package/node_modules/semver/functions/sort.js +5 -0
  211. package/node_modules/semver/functions/truncate.js +48 -0
  212. package/node_modules/semver/functions/valid.js +8 -0
  213. package/node_modules/semver/index.js +93 -0
  214. package/node_modules/semver/internal/constants.js +37 -0
  215. package/node_modules/semver/internal/debug.js +11 -0
  216. package/node_modules/semver/internal/identifiers.js +29 -0
  217. package/node_modules/semver/internal/lrucache.js +42 -0
  218. package/node_modules/semver/internal/parse-options.js +17 -0
  219. package/node_modules/semver/internal/re.js +223 -0
  220. package/node_modules/semver/package.json +78 -0
  221. package/node_modules/semver/preload.js +4 -0
  222. package/node_modules/semver/range.bnf +17 -0
  223. package/node_modules/semver/ranges/gtr.js +6 -0
  224. package/node_modules/semver/ranges/intersects.js +9 -0
  225. package/node_modules/semver/ranges/ltr.js +6 -0
  226. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  227. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  228. package/node_modules/semver/ranges/min-version.js +63 -0
  229. package/node_modules/semver/ranges/outside.js +82 -0
  230. package/node_modules/semver/ranges/simplify.js +49 -0
  231. package/node_modules/semver/ranges/subset.js +249 -0
  232. package/node_modules/semver/ranges/to-comparators.js +10 -0
  233. package/node_modules/semver/ranges/valid.js +13 -0
  234. package/package.json +33 -27
  235. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +8 -1
  236. package/packages/octo-runtime-protocol/schema/protocol.schema.json +43 -1
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-openclaw",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
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.6",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.7",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.7",
10
10
  "ws": "8.22.0"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
@@ -81,13 +81,17 @@ export declare function createOpenCodeAdapter({ command }?: {
81
81
  }): {
82
82
  respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
83
83
  invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
84
- metadata: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata;
85
84
  probe?: (options?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterProbeOptions) => Promise<ProbeResult>;
85
+ metadata: Omit<import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata, "protocolSupport"> & {
86
+ protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
87
+ };
86
88
  };
87
89
  export declare const opencodeAdapter: {
88
90
  respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
89
91
  invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
90
- metadata: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata;
91
92
  probe?: (options?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterProbeOptions) => Promise<ProbeResult>;
93
+ metadata: Omit<import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata, "protocolSupport"> & {
94
+ protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
95
+ };
92
96
  };
93
97
  export default opencodeAdapter;
@@ -193,6 +193,8 @@ export function normalizeOpenCodeEvent(native) {
193
193
  type: "message.delta",
194
194
  payload: {
195
195
  text: part.text,
196
+ // 原生 text 是公开最终正文;显式标记,展示层无需猜测缺失的通道。
197
+ channel: "final",
196
198
  ...(stepId
197
199
  ? { stepId, messageId: `opencode:${part.id ?? `${stepId}:answer`}` }
198
200
  : part.id
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-opencode",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
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.6",
9
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.7",
9
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.7",
10
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.7"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
@@ -10,7 +10,7 @@
10
10
  * fallback. Per-session model selection follows the standard ACP path when the
11
11
  * runtime configures a model that Qoder advertises.
12
12
  */
13
- export declare const qoderCliAdapter: Readonly<{
13
+ export declare const qoderCliAdapter: Readonly<Omit<{
14
14
  metadata: {
15
15
  mcp: true;
16
16
  type: string;
@@ -19,5 +19,13 @@ export declare const qoderCliAdapter: Readonly<{
19
19
  probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>;
20
20
  respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
21
21
  invoke(request: import("@mininglamp-oss/octo-runtime-protocol").InvokeRequest, context?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent>;
22
+ }, "metadata"> & {
23
+ metadata: Omit<{
24
+ mcp: true;
25
+ type: string;
26
+ agentSources: "provisioned"[];
27
+ }, "protocolSupport"> & {
28
+ protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
29
+ };
22
30
  }>;
23
31
  export default qoderCliAdapter;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qodercli",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.7"
13
13
  }
14
14
  }
@@ -10,7 +10,7 @@
10
10
  * binary and is registered as its own adapter type so a runtime can pick the CN
11
11
  * build explicitly.
12
12
  */
13
- export declare const qoderCliCnAdapter: Readonly<{
13
+ export declare const qoderCliCnAdapter: Readonly<Omit<{
14
14
  metadata: {
15
15
  mcp: true;
16
16
  type: string;
@@ -19,5 +19,13 @@ export declare const qoderCliCnAdapter: Readonly<{
19
19
  probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>;
20
20
  respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
21
21
  invoke(request: import("@mininglamp-oss/octo-runtime-protocol").InvokeRequest, context?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent>;
22
+ }, "metadata"> & {
23
+ metadata: Omit<{
24
+ mcp: true;
25
+ type: string;
26
+ agentSources: "provisioned"[];
27
+ }, "protocolSupport"> & {
28
+ protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
29
+ };
22
30
  }>;
23
31
  export default qoderCliCnAdapter;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.7"
13
13
  }
14
14
  }
@@ -18,11 +18,13 @@ export { RuntimeLogging, assertRuntimeLogging, noopRuntimeLog, type RuntimeLog,
18
18
  export { extraStatusRecord, kernelStatusRecord, type ExtraStatusRecord, type KernelStatusRecord } from "./service-status.js";
19
19
  export { sanitizePublicValue } from "./public-display.js";
20
20
  export { DEFAULT_REASONING_LEVEL_MAPS, OMNI_REASONING_LEVELS, mapReasoningEffort, reasoningLevelMap, type OmniReasoningLevel, type ReasoningLevelMap } from "./reasoning.js";
21
+ /** Adapter 的编写输入;defineAdapter 在省略协议声明时补 canonical-only 默认值。 */
21
22
  export interface AdapterMetadata {
22
23
  /** Local implementation support; not a remote runtime admission feature. */
23
24
  mcp?: boolean;
24
25
  /** False ignores octo.execution/workspace; the Provider owns its workspace. */
25
26
  workspace?: boolean;
27
+ /** 仅编写输入可省略;这是执行时消费的协议描述,不能作为业务能力标签。 */
26
28
  protocolSupport?: AdapterProtocolSupport;
27
29
  type: string;
28
30
  agentSources: ("preset" | "provisioned")[];
@@ -40,6 +42,7 @@ export interface ProbeResult {
40
42
  version?: string | null;
41
43
  reason?: string;
42
44
  }
45
+ /** 工厂的编写输入;直接交给 Core 注册时须满足完整的 HostedAdapter 合同。 */
43
46
  export interface Adapter<TOutput extends AdapterOutput = AdapterOutput> {
44
47
  metadata: AdapterMetadata;
45
48
  probe?: (options?: AdapterProbeOptions) => Promise<ProbeResult>;
@@ -52,6 +55,15 @@ export interface Adapter<TOutput extends AdapterOutput = AdapterOutput> {
52
55
  */
53
56
  invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncIterable<TOutput>;
54
57
  }
58
+ /**
59
+ * 工厂输出必须表达已补齐的协议声明,供宿主直接注册;保留作者扩展的字段和方法。
60
+ * 禁止与允许省略字段的编写输入混用,否则会把注册前的类型错误推迟到运行时。
61
+ */
62
+ export type DefinedAdapter<TAdapter extends Adapter = Adapter> = Readonly<Omit<TAdapter, "metadata"> & {
63
+ metadata: Omit<TAdapter["metadata"], "protocolSupport"> & {
64
+ protocolSupport: AdapterProtocolSupport;
65
+ };
66
+ }>;
55
67
  /** Provider objects and lifetime signals before the Host assigns stream identity. */
56
68
  export type DriverFrame = Pick<NativeHostFrame, "kind" | "messageKind" | "payload"> | {
57
69
  kind: "control";
@@ -92,10 +104,12 @@ interface ProcessExit {
92
104
  signal: NodeJS.Signals | null;
93
105
  }
94
106
  /**
95
- * Validate and freeze an adapter definition. Freezing makes the metadata and
96
- * `invoke` reference immutable so a loaded adapter cannot be mutated at runtime.
107
+ * 接收编写输入并返回可注册的 Adapter,省略协议时仅补 canonical-only 声明。
108
+ * 返回类型必须保留字段必有的保证;不得根据缺省声明推断 native 支持。
109
+ * 冻结顶层对象以固定 metadata 和 invoke 引用;嵌套元数据不作深冻结。
110
+ * 工厂不注册或启动 Provider,宿主随后注册并负责执行与关闭。
97
111
  */
98
- export declare function defineAdapter<TAdapter extends Adapter>(adapter: TAdapter, levels?: ReasoningLevelMap | null): Readonly<TAdapter>;
112
+ export declare function defineAdapter<TAdapter extends Adapter>(adapter: TAdapter, levels?: ReasoningLevelMap | null): DefinedAdapter<TAdapter>;
99
113
  /**
100
114
  * Spawn a JSON-lines subprocess and yield one parsed native event per stdout
101
115
  * line. stderr is buffered and surfaced only if the process exits non-zero (as
@@ -122,7 +136,7 @@ export declare function parseJsonLine(line: string): Record<string, unknown> | n
122
136
  * produced a terminal event — synthesize the `onSuccess` events. `cleanup` runs
123
137
  * in a `finally` so it fires on cancellation and error paths too.
124
138
  */
125
- export declare function createJsonCliAdapter<TNative = Record<string, unknown>>(options: JsonCliAdapterOptions<TNative>): Readonly<Adapter<CanonicalEvent>>;
139
+ export declare function createJsonCliAdapter<TNative = Record<string, unknown>>(options: JsonCliAdapterOptions<TNative>): DefinedAdapter<Adapter<CanonicalEvent>>;
126
140
  /**
127
141
  * Resolve whether a command is runnable. A path-qualified command is checked
128
142
  * directly; a bare name is searched across `PATH` (`;`-separated on Windows).
@@ -26,15 +26,18 @@ export { extraStatusRecord, kernelStatusRecord } from "./service-status.js";
26
26
  export { sanitizePublicValue } from "./public-display.js";
27
27
  export { DEFAULT_REASONING_LEVEL_MAPS, OMNI_REASONING_LEVELS, mapReasoningEffort, reasoningLevelMap } from "./reasoning.js";
28
28
  /**
29
- * Validate and freeze an adapter definition. Freezing makes the metadata and
30
- * `invoke` reference immutable so a loaded adapter cannot be mutated at runtime.
29
+ * 接收编写输入并返回可注册的 Adapter,省略协议时仅补 canonical-only 声明。
30
+ * 返回类型必须保留字段必有的保证;不得根据缺省声明推断 native 支持。
31
+ * 冻结顶层对象以固定 metadata 和 invoke 引用;嵌套元数据不作深冻结。
32
+ * 工厂不注册或启动 Provider,宿主随后注册并负责执行与关闭。
31
33
  */
32
34
  export function defineAdapter(adapter, levels = reasoningLevelMap(adapter.metadata.type)) {
33
35
  if (!adapter?.metadata?.type || typeof adapter.invoke !== "function") {
34
36
  throw new TypeError("adapter requires metadata.type and invoke(req)");
35
37
  }
36
38
  const invoke = adapter.invoke.bind(adapter);
37
- const protocolSupport = adapter.metadata.protocolSupport ?? {
39
+ const metadata = adapter.metadata;
40
+ const protocolSupport = metadata.protocolSupport ?? {
38
41
  protocol: `${adapter.metadata.type}.canonical`,
39
42
  modes: ["canonical"],
40
43
  nativeMethods: []
@@ -42,7 +45,7 @@ export function defineAdapter(adapter, levels = reasoningLevelMap(adapter.metada
42
45
  return Object.freeze({
43
46
  ...adapter,
44
47
  metadata: {
45
- ...adapter.metadata,
48
+ ...metadata,
46
49
  protocolSupport
47
50
  },
48
51
  async *invoke(request, context) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-sdk",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -10,7 +10,7 @@
10
10
  "./module-manifest": "./dist/module-manifest.js"
11
11
  },
12
12
  "dependencies": {
13
- "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
13
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.7",
14
14
  "import-meta-resolve": "4.2.0"
15
15
  },
16
16
  "types": "./dist/index.d.ts",
@@ -11,7 +11,7 @@ export declare function createZcodeGuiAdapter({ command, appServerArgs, spawnFn
11
11
  command?: string;
12
12
  appServerArgs?: readonly string[];
13
13
  spawnFn?: ZcodeAppServerSpawn;
14
- }): Readonly<{
14
+ }): Readonly<Omit<{
15
15
  metadata: {
16
16
  type: string;
17
17
  agentSources: "provisioned"[];
@@ -21,8 +21,17 @@ export declare function createZcodeGuiAdapter({ command, appServerArgs, spawnFn
21
21
  probe: () => Promise<ProbeResult>;
22
22
  respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
23
23
  invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent, void, any>;
24
+ }, "metadata"> & {
25
+ metadata: Omit<{
26
+ type: string;
27
+ agentSources: "provisioned"[];
28
+ processModel: string;
29
+ transport: string;
30
+ }, "protocolSupport"> & {
31
+ protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
32
+ };
24
33
  }>;
25
- export declare const zcodeGuiAdapter: Readonly<{
34
+ export declare const zcodeGuiAdapter: Readonly<Omit<{
26
35
  metadata: {
27
36
  type: string;
28
37
  agentSources: "provisioned"[];
@@ -32,5 +41,14 @@ export declare const zcodeGuiAdapter: Readonly<{
32
41
  probe: () => Promise<ProbeResult>;
33
42
  respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
34
43
  invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent, void, any>;
44
+ }, "metadata"> & {
45
+ metadata: Omit<{
46
+ type: string;
47
+ agentSources: "provisioned"[];
48
+ processModel: string;
49
+ transport: string;
50
+ }, "protocolSupport"> & {
51
+ protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
52
+ };
35
53
  }>;
36
54
  export default zcodeGuiAdapter;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-zcode-gui",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
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.6",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.7",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.7"
10
10
  },
11
11
  "types": "./dist/index.d.ts",
12
12
  "files": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "064f56a25ff431f5fc1c001b2830ba79d45ec951",
2
+ "commit": "ed7a4c899e5666238bc67e6a8418e3805ac924da",
3
3
  "dirty": false,
4
- "buildTime": "2026-10-28T08:41:32.948Z"
4
+ "buildTime": "2026-10-30T03:47:52.513Z"
5
5
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-cli",
3
- "version": "1.1.6",
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.6",
13
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
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.6",
16
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.6",
17
- "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.6",
18
- "@mininglamp-oss/octo-runtime-cross-service": "1.1.6",
19
- "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
20
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.6",
21
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.6",
22
- "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.6",
23
- "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.6",
24
- "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.6",
25
- "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.6",
26
- "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.6",
27
- "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.6",
28
- "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.6",
29
- "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.6",
30
- "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.6",
31
- "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.6",
32
- "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.6",
33
- "@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.6",
34
- "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.6",
35
- "@mininglamp-oss/octo-runtime-extra-webui": "1.1.6"
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.6",
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
  }