@mininglamp-oss/octo-runtime 1.1.9 → 1.1.11

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 (225) hide show
  1. package/README.md +2 -2
  2. package/apps/cli/README.md +1 -1
  3. package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.d.ts → apps/cli/dist/adapter-configuration.d.ts} +1 -0
  4. package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.js → apps/cli/dist/adapter-configuration.js} +1 -0
  5. package/apps/cli/dist/adapter-configurations.d.ts +1 -1
  6. package/apps/cli/dist/adapter-configurations.js +1 -1
  7. package/apps/cli/dist/adapters.d.ts +7 -0
  8. package/apps/cli/dist/adapters.js +77 -0
  9. package/apps/cli/dist/build-info.json +2 -2
  10. package/apps/cli/dist/command-tree.js +2 -3
  11. package/apps/cli/dist/extras.js +11 -1
  12. package/apps/cli/dist/help.js +1 -1
  13. package/apps/cli/dist/index.js +18 -1
  14. package/apps/cli/dist/main.d.ts +2 -0
  15. package/apps/cli/dist/main.js +67 -34
  16. package/apps/cli/dist/manifest.json +0 -5
  17. package/apps/cli/dist/module-manifest.js +21 -3
  18. package/apps/cli/dist/output.d.ts +19 -1
  19. package/apps/cli/dist/output.js +180 -33
  20. package/apps/cli/dist/playboard-interrupt.d.ts +6 -0
  21. package/apps/cli/dist/playboard-interrupt.js +86 -0
  22. package/apps/cli/dist/playboard.d.ts +2 -0
  23. package/apps/cli/dist/playboard.js +10 -11
  24. package/apps/cli/dist/state.d.ts +5 -2
  25. package/apps/cli/dist/state.js +48 -13
  26. package/dist/public/codex.d.ts +1 -0
  27. package/dist/public/codex.js +1 -0
  28. package/dist/public/executor-kernel.d.ts +4 -1
  29. package/dist/public/executor-kernel.js +2 -1
  30. package/dist/public/extra.d.ts +1 -1
  31. package/dist/public/host.d.ts +5 -0
  32. package/dist/public/host.js +2 -0
  33. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +20 -0
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +6 -6
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +68 -253
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +11 -6
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +198 -52
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.d.ts +58 -0
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.js +650 -0
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +3 -0
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +15 -0
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +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/package.json +2 -2
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +5 -0
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.d.ts +25 -0
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +3 -0
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.js +1 -2
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +1 -1
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +12 -30
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
  65. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.d.ts +3 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.js +125 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +1 -1
  68. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +1 -1
  69. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +7 -0
  70. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +77 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  72. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +2 -3
  73. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +11 -1
  74. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +1 -1
  75. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +18 -1
  76. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +67 -34
  78. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +0 -5
  79. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +21 -3
  80. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.d.ts +19 -1
  81. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +180 -33
  82. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.d.ts +6 -0
  83. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.js +86 -0
  84. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +2 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +10 -11
  86. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.d.ts +5 -2
  87. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -13
  88. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -24
  89. package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +5 -0
  90. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.d.ts +30 -0
  91. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.js +199 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.d.ts +1 -0
  93. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.js +1 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.d.ts +10 -0
  95. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.js +465 -0
  96. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.d.ts +6 -0
  97. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.js +6 -0
  98. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.d.ts +4 -0
  99. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.js +5 -0
  100. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.d.ts +59 -0
  101. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.js +287 -0
  102. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.d.ts +1 -0
  103. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.js +1 -0
  104. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.d.ts +1 -0
  105. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.js +1 -0
  106. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.d.ts +21 -0
  107. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.js +138 -0
  108. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.d.ts +8 -0
  109. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.js +65 -0
  110. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.d.ts +82 -0
  111. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.js +371 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.d.ts +10 -0
  113. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.js +23 -0
  114. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.d.ts +72 -0
  115. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.js +10 -0
  116. package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +54 -0
  117. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-configuration-fixtures.json +1219 -0
  118. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-fixtures.json +5988 -0
  119. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-client.behavior.json +56 -0
  120. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc-fixtures.json +53 -0
  121. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc.schema.json +538 -0
  122. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/native-invoke-fixtures.json +116 -0
  123. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +4525 -0
  124. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/run-protocol-fixtures.json +761 -0
  125. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/runtime-selection-fixtures.json +663 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/session-name-fixtures.json +191 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  128. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +29 -21
  129. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +173 -14
  130. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  131. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +1 -30
  132. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +2 -199
  133. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.d.ts +1 -8
  134. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -444
  135. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/endpoint.js +2 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.d.ts +17 -0
  137. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.js +21 -0
  138. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.d.ts +11 -9
  139. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +14 -3
  140. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +5 -7
  141. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +6 -7
  142. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.d.ts +1 -53
  143. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.js +2 -280
  144. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +14 -13
  145. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +84 -187
  146. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.d.ts +5 -10
  147. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.js +4 -1
  148. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.d.ts +20 -0
  149. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.js +180 -0
  150. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -8
  151. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +75 -45
  152. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.d.ts +9 -2
  153. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +60 -5
  154. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.d.ts +1 -0
  155. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.js +1 -0
  156. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.d.ts +1 -0
  157. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.js +1 -0
  158. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.d.ts +4 -0
  159. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.js +18 -0
  160. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +1 -10
  161. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +2 -23
  162. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.d.ts +2 -72
  163. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.js +2 -10
  164. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -12
  165. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +1 -1
  166. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/ports.d.ts +2 -2
  167. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  168. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +1 -1
  169. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/ports.d.ts +2 -2
  170. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  171. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +4 -4
  172. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/{index-BVxePruX.js → index-BLMf2Etg.js} +1 -3
  173. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
  174. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  175. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +1 -1
  176. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +12 -5
  177. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.d.ts +5 -1
  178. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.js +9 -0
  179. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.d.ts +44 -0
  180. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.js +207 -0
  181. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +23 -3
  182. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.d.ts +27 -4
  183. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +133 -25
  184. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.d.ts +10 -3
  185. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.js +18 -4
  186. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.d.ts +5 -6
  187. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.js +33 -45
  188. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/identity.js +6 -0
  189. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +4 -0
  190. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +3 -0
  191. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +5 -4
  192. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/adapter-metadata.d.ts +7 -0
  193. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +19 -15
  194. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +3 -1
  195. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +1 -0
  196. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.d.ts +5 -0
  197. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.js +65 -0
  198. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  199. package/package.json +33 -29
  200. package/packages/octo-runtime-protocol/schema/protocol.schema.json +42 -36
  201. package/apps/cli/dist/worker.js +0 -18
  202. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.d.ts +0 -63
  203. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.js +0 -846
  204. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +0 -54
  205. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +0 -154
  206. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +0 -15
  207. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +0 -18
  208. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +0 -16
  209. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +0 -59
  210. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +0 -6
  211. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +0 -88
  212. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +0 -1
  213. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +0 -2
  214. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +0 -42
  215. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +0 -292
  216. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +0 -64
  217. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +0 -674
  218. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.d.ts +0 -2
  219. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +0 -5
  220. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.d.ts +0 -10
  221. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +0 -96
  222. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +0 -15
  223. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +0 -279
  224. /package/{apps/cli/dist/worker.d.ts → node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.js} +0 -0
  225. /package/node_modules/@mininglamp-oss/{octo-runtime-cli/dist/worker.d.ts → octo-runtime-protocol/dist/adapter-metadata.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-codex",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11"
10
10
  },
11
11
  "types": "./dist/index.d.ts",
12
12
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-dsh",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "semver": "7.8.5",
13
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9",
14
- "@mininglamp-oss/octo-runtime-protocol": "1.1.9"
13
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11",
14
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11"
15
15
  }
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-grok-build",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,9 +9,9 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.9",
13
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.9",
14
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9",
15
- "@mininglamp-oss/octo-runtime-protocol": "1.1.9"
12
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.11",
13
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11",
14
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11",
15
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11"
16
16
  }
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-hermes",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-kimi-code",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-mcode",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11"
13
13
  }
14
14
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-openclaw",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9",
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11",
10
10
  "ws": "8.22.0"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
@@ -82,6 +82,7 @@ export declare function createOpenCodeAdapter({ command }?: {
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
84
  probe?: (options?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterProbeOptions) => Promise<ProbeResult>;
85
+ createExecutionScope?: import("@mininglamp-oss/octo-runtime-adapter-sdk").CreateAdapterExecutionScope;
85
86
  metadata: Omit<import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata, "protocolSupport"> & {
86
87
  protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
87
88
  };
@@ -90,6 +91,7 @@ export declare const opencodeAdapter: {
90
91
  respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
91
92
  invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
92
93
  probe?: (options?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterProbeOptions) => Promise<ProbeResult>;
94
+ createExecutionScope?: import("@mininglamp-oss/octo-runtime-adapter-sdk").CreateAdapterExecutionScope;
93
95
  metadata: Omit<import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata, "protocolSupport"> & {
94
96
  protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
95
97
  };
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-opencode",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9",
9
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.9",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11",
9
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11",
10
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qodercli",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11"
13
13
  }
14
14
  }
@@ -14,4 +14,9 @@ export interface AdapterInvocationContext {
14
14
  log?: RuntimeLog;
15
15
  reportConversion?(): void;
16
16
  reportActivity?(activity: ProviderActivity): void;
17
+ /** 本地资格确认:成功结果已确定,后续 cleanup 失败独立报告;不是 wire 事件。 */
18
+ reportExecutionResult?(result: {
19
+ status: "completed";
20
+ basis: "final_answer_cleanup_fallback";
21
+ }): void;
17
22
  }
@@ -0,0 +1,25 @@
1
+ import type { AdapterInvocationContext } from "./activity.js";
2
+ import type { AdapterOutput } from "./index.js";
3
+ import type { RuntimeLog } from "./runtime-log.js";
4
+ import type { InteractionResponse, NativeInteractionResponse, InvokeRequest, ServiceProcessSnapshot } from "@mininglamp-oss/octo-runtime-protocol";
5
+ export type { ServiceProcessSnapshot } from "@mininglamp-oss/octo-runtime-protocol";
6
+ /** 服务资源独立于单轮清理;deadline 使用 performance.now() 的绝对毫秒值。 */
7
+ export interface AdapterScopeCleanup {
8
+ complete: boolean;
9
+ unresolvedServiceIds: readonly string[];
10
+ failedCleanupServiceIds: readonly string[];
11
+ }
12
+ /** Core 每次注册独占一个作用域;构造不得启动进程,关闭后不可重新接纳或恢复。 */
13
+ export interface AdapterExecutionScope {
14
+ invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncIterable<AdapterOutput>;
15
+ respondInteraction?(invocationId: string, response: InteractionResponse): Promise<void>;
16
+ respondNative?(invocationId: string, response: NativeInteractionResponse): Promise<void>;
17
+ processes?(): readonly ServiceProcessSnapshot[];
18
+ beginShutdown(reason: string): void;
19
+ close(options: {
20
+ deadline: number;
21
+ }): Promise<AdapterScopeCleanup>;
22
+ }
23
+ export type CreateAdapterExecutionScope = (options: {
24
+ log: RuntimeLog;
25
+ }) => AdapterExecutionScope;
@@ -1,4 +1,6 @@
1
1
  import type { AdapterInvocationContext } from "./activity.js";
2
+ import type { CreateAdapterExecutionScope } from "./execution-scope.js";
3
+ export type { AdapterExecutionScope, AdapterScopeCleanup, CreateAdapterExecutionScope, ServiceProcessSnapshot } from "./execution-scope.js";
2
4
  import { type ReasoningLevelMap } from "./reasoning.js";
3
5
  export type { AdapterInvocationContext, ProviderActivity } from "./activity.js";
4
6
  export { invocationEnvironment, invocationEnvs, mergeProcessEnvironment, processEnvironmentValue } from "./environment.js";
@@ -45,6 +47,7 @@ export interface ProbeResult {
45
47
  /** 工厂的编写输入;直接交给 Core 注册时须满足完整的 HostedAdapter 合同。 */
46
48
  export interface Adapter<TOutput extends AdapterOutput = AdapterOutput> {
47
49
  metadata: AdapterMetadata;
50
+ createExecutionScope?: CreateAdapterExecutionScope;
48
51
  probe?: (options?: AdapterProbeOptions) => Promise<ProbeResult>;
49
52
  /**
50
53
  * Execute one provider turn, optionally reporting watchdog progress.
@@ -28,8 +28,7 @@ export const DEFAULT_REASONING_LEVEL_MAPS = Object.freeze({
28
28
  "kimi-code": null,
29
29
  mcode: null,
30
30
  qodercli: null,
31
- qoderclicn: null,
32
- "zcode-gui": null
31
+ qoderclicn: null
33
32
  });
34
33
  export function reasoningLevelMap(adapterType) {
35
34
  return Object.hasOwn(DEFAULT_REASONING_LEVEL_MAPS, adapterType)
@@ -14,7 +14,7 @@ export interface KernelStatusRecord {
14
14
  event: string;
15
15
  data: Record<string, string | number>;
16
16
  }
17
- /** Kernel 父进程的监督诊断白名单;读盘时也重建,绝不包含执行正文或原始异常。 */
17
+ /** Kernel 原生生命周期诊断白名单;读盘时也重建,绝不包含执行正文或原始异常。 */
18
18
  export declare function kernelStatusRecord(level: RuntimeLogLevel, event: string, data?: Readonly<Record<string, unknown>>, time?: string): KernelStatusRecord | undefined;
19
19
  /** Rebuild status records from a separate allowlist, including when reading persisted files. */
20
20
  export declare function extraStatusRecord(extra: string, level: RuntimeLogLevel, event: string, data?: Readonly<Record<string, unknown>>, time?: string): ExtraStatusRecord | undefined;
@@ -1,41 +1,23 @@
1
- /** Kernel 父进程的监督诊断白名单;读盘时也重建,绝不包含执行正文或原始异常。 */
1
+ /** Kernel 原生生命周期诊断白名单;读盘时也重建,绝不包含执行正文或原始异常。 */
2
2
  export function kernelStatusRecord(level, event, data, time = new Date().toISOString()) {
3
3
  if (!["info", "warn", "error"].includes(level) ||
4
4
  ![
5
- "worker.ready",
6
- "worker.lost",
7
- "worker.recovery_blocked",
8
- "worker.retry_scheduled",
9
- "worker.start_failed"
5
+ "kernel.ready",
6
+ "kernel.closing",
7
+ "kernel.execution_drained",
8
+ "kernel.cleanup_incomplete",
9
+ "kernel.start_failed"
10
10
  ].includes(event) ||
11
11
  !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(time) ||
12
12
  !Number.isFinite(Date.parse(time)))
13
13
  return;
14
14
  const safe = {};
15
- for (const key of ["code", "signal", "trigger", "stage", "occurred_at", "retry_at"]) {
16
- const value = data?.[key];
17
- if (typeof value !== "string")
18
- continue;
19
- const valid = key === "code"
20
- ? /^[A-Z][A-Z0-9_]{0,95}$/.test(value)
21
- : key === "signal"
22
- ? /^SIG[A-Z0-9]+$/.test(value)
23
- : key === "trigger"
24
- ? ["exit", "error", "heartbeat", "ipc"].includes(value)
25
- : key === "stage"
26
- ? ["cleanup", "manifest", "starting", "backoff"].includes(value)
27
- : /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value) &&
28
- Number.isFinite(Date.parse(value));
29
- if (valid)
30
- safe[key] = value;
31
- }
32
- for (const key of ["pid", "generation", "attempt", "delay_ms", "exit_code"]) {
33
- const value = data?.[key];
34
- if (typeof value === "number" &&
35
- Number.isSafeInteger(value) &&
36
- (key === "exit_code" || value >= 0))
37
- safe[key] = value;
38
- }
15
+ const code = data?.code;
16
+ if (typeof code === "string" && /^[A-Z][A-Z0-9_]{0,95}$/.test(code))
17
+ safe.code = code;
18
+ const pid = data?.pid;
19
+ if (typeof pid === "number" && Number.isSafeInteger(pid) && pid >= 0)
20
+ safe.pid = pid;
39
21
  return Object.freeze({ time, level, source: "kernel", event, data: Object.freeze(safe) });
40
22
  }
41
23
  const events = new Set([
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-sdk",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.9",
13
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11",
14
14
  "import-meta-resolve": "4.2.0"
15
15
  },
16
16
  "types": "./dist/index.d.ts",
@@ -0,0 +1,3 @@
1
+ import type { AdapterProbeOptions } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
+ /** CLI 读取 profile 配置和凭据引用,返回配置值;Kernel 不读取这些文件或路径。 */
3
+ export declare function readAdapterConfigurations(profileRoot: string, adaptersValue: unknown): Record<string, AdapterProbeOptions>;
@@ -0,0 +1,125 @@
1
+ import { readFileSync, realpathSync } from "node:fs";
2
+ import { isAbsolute, join, relative, resolve } from "node:path";
3
+ import { resolveStreamLimitPolicy } from "@mininglamp-oss/octo-runtime-protocol";
4
+ /** CLI 读取 profile 配置和凭据引用,返回配置值;Kernel 不读取这些文件或路径。 */
5
+ export function readAdapterConfigurations(profileRoot, adaptersValue) {
6
+ const adapters = objectValue(adaptersValue);
7
+ const connections = { openclaw: { providerOptions: { OPENCLAW_RUNTIME_ROOT: profileRoot } } };
8
+ if (!adapters)
9
+ return connections;
10
+ if (adapters.openclaw !== undefined)
11
+ throw new Error("OpenClaw uses adapters/openclaw/connection.json; remove the obsolete external binding and configure this Runtime connection");
12
+ return {
13
+ ...connections,
14
+ ...Object.fromEntries(Object.entries(adapters).map(([adapterType, value]) => {
15
+ if (!/^[a-z0-9][a-z0-9-]{0,127}$/.test(adapterType)) {
16
+ throw new Error(`managed adapter type is invalid: ${adapterType}`);
17
+ }
18
+ const adapter = objectValue(value);
19
+ const execution = objectValue(adapter?.execution);
20
+ if (!execution)
21
+ throw new Error(`managed ${adapterType} adapter execution manifest is missing`);
22
+ const publicOptions = stringRecord(execution.provider_options, `${adapterType} provider_options`);
23
+ assertNoCredentialLikeOptions(publicOptions, adapterType);
24
+ const credentialRef = optionalString(execution.credential_ref);
25
+ const credentialOptions = credentialRef
26
+ ? readCredentialOptions(profileRoot, credentialRef, adapterType)
27
+ : {};
28
+ if (Object.hasOwn(execution, "managed_workspace"))
29
+ throw new TypeError("LOCAL_PLUGIN_CONFIGURATION_REQUIRED");
30
+ return [
31
+ adapterType,
32
+ {
33
+ providerOptions: { ...publicOptions, ...credentialOptions },
34
+ ...(execution.stream_limits === undefined
35
+ ? {}
36
+ : { streamLimits: readStreamLimits(execution.stream_limits, adapterType) })
37
+ }
38
+ ];
39
+ }))
40
+ };
41
+ }
42
+ const STREAM_LIMIT_FIELDS = {
43
+ raw_message_max_bytes: "rawMessageMaxBytes",
44
+ adapter_queue_item_max_bytes: "adapterQueueItemMaxBytes",
45
+ adapter_queue_max_bytes: "adapterQueueMaxBytes",
46
+ adapter_queue_max_items: "adapterQueueMaxItems",
47
+ host_frame_max_bytes: "hostFrameMaxBytes",
48
+ rpc_queue_max_bytes: "rpcQueueMaxBytes",
49
+ rpc_queue_max_items: "rpcQueueMaxItems",
50
+ replay_run_max_bytes: "replayRunMaxBytes",
51
+ replay_run_max_items: "replayRunMaxItems",
52
+ replay_global_max_bytes: "replayGlobalMaxBytes"
53
+ };
54
+ function readStreamLimits(value, adapterType) {
55
+ const record = objectValue(value);
56
+ if (!record)
57
+ throw new TypeError(`managed ${adapterType} stream_limits must be an object`);
58
+ const overrides = {};
59
+ for (const [key, entry] of Object.entries(record)) {
60
+ const field = STREAM_LIMIT_FIELDS[key];
61
+ if (!field)
62
+ throw new TypeError(`managed ${adapterType} stream_limits.${key} is unknown`);
63
+ if (!Number.isSafeInteger(entry) || entry < 1)
64
+ throw new TypeError(`managed ${adapterType} stream_limits.${key} must be a positive integer`);
65
+ overrides[field] = entry;
66
+ }
67
+ return { ...resolveStreamLimitPolicy(overrides) };
68
+ }
69
+ function readCredentialOptions(profileRoot, credentialRef, adapterType) {
70
+ const credentialsRoot = realpathSync(join(profileRoot, "credentials"));
71
+ const credentialPath = realpathSync(resolve(profileRoot, credentialRef));
72
+ const relativeCredential = relative(credentialsRoot, credentialPath);
73
+ if (relativeCredential.startsWith("..") || isAbsolute(relativeCredential)) {
74
+ throw new Error(`managed ${adapterType} credential_ref resolves outside the profile credentials directory`);
75
+ }
76
+ const credential = readJsonRequired(credentialPath);
77
+ if (credential.schema_version !== 1)
78
+ throw new Error(`managed ${adapterType} credential is invalid`);
79
+ return stringRecord(credential.provider_options, `${adapterType} credential provider_options`);
80
+ }
81
+ function stringRecord(value, name) {
82
+ const record = objectValue(value);
83
+ if (!record)
84
+ throw new Error(`managed ${name} is required`);
85
+ return Object.fromEntries(Object.entries(record).map(([key, entry]) => [key, requiredString(entry, `${name}.${key}`)]));
86
+ }
87
+ function assertNoCredentialLikeOptions(options, adapterType) {
88
+ for (const key of Object.keys(options)) {
89
+ if (/(?:TOKEN|SECRET|PASSWORD|PRIVATE_KEY|CREDENTIAL)/i.test(key)) {
90
+ throw new Error(`managed ${adapterType} public provider_options contains credential-like key ${key}`);
91
+ }
92
+ }
93
+ }
94
+ function readJsonOptional(path) {
95
+ try {
96
+ return JSON.parse(readFileSync(path, "utf8"));
97
+ }
98
+ catch (error) {
99
+ if (isNodeError(error, "ENOENT"))
100
+ return undefined;
101
+ throw new Error(`cannot read managed config ${path}`, { cause: error });
102
+ }
103
+ }
104
+ function readJsonRequired(path) {
105
+ const value = readJsonOptional(path);
106
+ if (!value)
107
+ throw new Error(`managed setup file is missing: ${path}`);
108
+ return value;
109
+ }
110
+ function requiredString(value, name) {
111
+ if (typeof value !== "string" || !value.trim())
112
+ throw new Error(`managed ${name} is required`);
113
+ return value.trim();
114
+ }
115
+ function optionalString(value) {
116
+ return typeof value === "string" && value.trim() ? value.trim() : undefined;
117
+ }
118
+ function objectValue(value) {
119
+ return value !== null && typeof value === "object" && !Array.isArray(value)
120
+ ? value
121
+ : undefined;
122
+ }
123
+ function isNodeError(error, code) {
124
+ return (error instanceof Error && "code" in error && error.code === code);
125
+ }
@@ -1,4 +1,4 @@
1
+ import { readAdapterConfigurations } from "./adapter-configuration.js";
1
2
  import type { ModuleManifest } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
2
- import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
3
3
  /** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
4
4
  export declare function readCliAdapterConfigurations(profileRoot: string, adapters: unknown, manifest: ModuleManifest, env?: NodeJS.ProcessEnv): Promise<ReturnType<typeof readAdapterConfigurations>>;
@@ -1,8 +1,8 @@
1
+ import { readAdapterConfigurations } from "./adapter-configuration.js";
1
2
  import { constants } from "node:fs";
2
3
  import { access, lstat, readFile, realpath, stat } from "node:fs/promises";
3
4
  import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
5
  import { processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
5
- import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
6
6
  /** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
7
7
  export async function readCliAdapterConfigurations(profileRoot, adapters, manifest, env = process.env) {
8
8
  const configurations = readAdapterConfigurations(profileRoot, adapters);
@@ -0,0 +1,7 @@
1
+ import { type AdapterModuleEntry } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
2
+ import type { HostedAdapter } from "@mininglamp-oss/octo-runtime-executor-kernel";
3
+ /** CLI 只加载所选模块并构造实例;Kernel 不接触清单、模块路径或产品准备。 */
4
+ export declare function loadCliAdapters(entries: readonly AdapterModuleEntry[], options?: {
5
+ profileRoot: string;
6
+ syncOpenClawTools: boolean;
7
+ }): Promise<HostedAdapter[]>;
@@ -0,0 +1,77 @@
1
+ import { resolveModuleSpecifier } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
2
+ import { withStartupContext } from "@mininglamp-oss/octo-runtime-executor-kernel";
3
+ import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
4
+ import { dirname, join } from "node:path";
5
+ /** CLI 只加载所选模块并构造实例;Kernel 不接触清单、模块路径或产品准备。 */
6
+ export async function loadCliAdapters(entries, options) {
7
+ const adapters = [];
8
+ // 解析也在诊断边界内;仍先解析整个所选集合,再导入/构造,保持 CLI 原顺序。
9
+ const selected = entries.map((entry) => {
10
+ try {
11
+ return { entry, specifier: resolveModuleSpecifier(entry.module, entry.sourceManifest) };
12
+ }
13
+ catch (error) {
14
+ throw adapterStartupFailure(error, entry);
15
+ }
16
+ });
17
+ for (const { entry, specifier } of selected) {
18
+ try {
19
+ const loaded = await import(specifier);
20
+ const exports = asRecord(loaded, `adapter module ${entry.module}`);
21
+ const exported = exports[entry.export];
22
+ if (exported === undefined)
23
+ throw new Error(`missing export ${entry.export} from ${entry.module}`);
24
+ // 动态模块先校验工厂与 Adapter 形状,再交给唯一 Core 注册;不提前探测未选模块。
25
+ const instance = entry.factory ? callFactory(exported, entry) : exported;
26
+ if (!isHostedAdapter(instance))
27
+ throw new TypeError(`${entry.module}#${entry.export} is not an Octo Runtime adapter`);
28
+ if (entry.type && instance.metadata.type !== entry.type)
29
+ throw new Error(`manifest type ${entry.type} does not match adapter ${instance.metadata.type}`);
30
+ adapters.push(instance);
31
+ }
32
+ catch (error) {
33
+ throw adapterStartupFailure(error, entry);
34
+ }
35
+ }
36
+ if (options && adapters.some((adapter) => adapter.metadata.type === "openclaw")) {
37
+ const { initializeCliOpenClaw, syncCliOpenClawToolEnvironment } = await import("./openclaw.js");
38
+ await initializeCliOpenClaw(options.profileRoot);
39
+ if (options.syncOpenClawTools)
40
+ await syncCliOpenClawToolEnvironment(options.profileRoot, await readExtraDirectory(join(dirname(options.profileRoot), "extras")));
41
+ }
42
+ return adapters;
43
+ }
44
+ function adapterStartupFailure(error, entry) {
45
+ return withStartupContext(error, {
46
+ component: "cli",
47
+ phase: "created",
48
+ context: {
49
+ module: entry.module,
50
+ resource: "adapter-module",
51
+ operation: "assemble-adapter",
52
+ configKey: "adapters"
53
+ }
54
+ });
55
+ }
56
+ function callFactory(value, entry) {
57
+ if (typeof value !== "function")
58
+ throw new TypeError(`${entry.module}#${entry.export} is marked as a factory but is not callable`);
59
+ return value(entry.options);
60
+ }
61
+ function isHostedAdapter(value) {
62
+ if (!isRecord(value) || !isRecord(value.metadata))
63
+ return false;
64
+ return (typeof value.metadata.type === "string" &&
65
+ Array.isArray(value.metadata.agentSources) &&
66
+ value.metadata.agentSources.length > 0 &&
67
+ value.metadata.agentSources.every((source) => source === "preset" || source === "provisioned") &&
68
+ typeof value.invoke === "function");
69
+ }
70
+ function asRecord(value, label) {
71
+ if (!isRecord(value))
72
+ throw new TypeError(`${label} must be an object`);
73
+ return value;
74
+ }
75
+ function isRecord(value) {
76
+ return value !== null && typeof value === "object" && !Array.isArray(value);
77
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "58332b3bcf5651f58e674fa236184dc6a0d927ca",
2
+ "commit": "780cd7cd5e67e4868df895a2e74a826097f349fd",
3
3
  "dirty": false,
4
- "buildTime": "2026-11-01T12:55:39.653Z"
4
+ "buildTime": "2026-11-05T06:19:50.356Z"
5
5
  }
@@ -1,9 +1,8 @@
1
1
  import { Command, CommanderError, Option } from "commander";
2
- import { resolve } from "node:path";
3
2
  import { cliHelpHeader, lifecycleCommands, preferredRootCommands, rootCommands } from "./help.js";
4
3
  import { loadCliManifest } from "./module-manifest.js";
5
4
  import { loadExtraCommands, validateCommands } from "./extra-commands.js";
6
- import { defaultRuntimeHome } from "./state.js";
5
+ import { selectRuntimeHome } from "./state.js";
7
6
  const hostStrings = new Set(["home", "manifest", "profile"]);
8
7
  const hostBooleans = new Set(["help", "json", "version", "follow"]);
9
8
  const commandExamples = new WeakMap();
@@ -203,7 +202,7 @@ export async function parseCliCommand(raw, dependencies) {
203
202
  const globalArgs = [...hostStrings].flatMap((key) => selected[key] ? [`--${key}=${selected[key]}`] : []);
204
203
  return parseCliCommand([...globalArgs, ...(target ? [target, name] : []), "--help"], dependencies);
205
204
  }
206
- const home = resolve(selected.home ?? defaultRuntimeHome(dependencies.env, dependencies.platform));
205
+ const home = selectRuntimeHome(selected.home, dependencies.env, dependencies.platform);
207
206
  const isExtra = Boolean(name && !rootCommands.has(name));
208
207
  const offline = isExtra && lifecycleCommands.has(operands[1]);
209
208
  const needsDirectory = !selected.version && (!name || (isExtra && !offline));
@@ -1,4 +1,5 @@
1
1
  import { join } from "node:path";
2
+ import { withStartupContext } from "@mininglamp-oss/octo-runtime-executor-kernel";
2
3
  import { resolveExtraModule } from "./global-extras.js";
3
4
  import { assertExtraName, assertStoredExtra, readStoredExtra } from "@mininglamp-oss/octo-runtime-host-sdk";
4
5
  import { withSetupLock, writeJsonAtomic } from "./state.js";
@@ -54,7 +55,16 @@ export async function readExtra(paths, name, manifest) {
54
55
  catch (error) {
55
56
  if (error instanceof Error && error.message === "EXTRA_NAME_MISMATCH")
56
57
  throw error;
57
- throw new Error("EXTRA_MODULE_LOAD_FAILED", { cause: error });
58
+ throw withStartupContext(new Error("EXTRA_MODULE_LOAD_FAILED", { cause: error }), {
59
+ component: name,
60
+ phase: "created",
61
+ context: {
62
+ module: entry.module,
63
+ resource: "extra-module",
64
+ operation: "import",
65
+ configKey: "module"
66
+ }
67
+ });
58
68
  }
59
69
  }
60
70
  };