@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,674 +0,0 @@
1
- import { createInterface } from "node:readline";
2
- import { randomUUID } from "node:crypto";
3
- import { watchLineLimit, readBoundedLines } from "@mininglamp-oss/octo-runtime-adapter-sdk";
4
- import { createInputInvoke, HOST_RPC_MAX_LINE_BYTES, INVOKE_REQUEST_MAX_BYTES, resolveStreamLimitPolicy, streamCapacityError, assertJsonByteLimit, assertHostFrame, assertHostRunReceipt, assertHostFrameIdentity, isHostTerminal } from "@mininglamp-oss/octo-runtime-protocol";
5
- /** A single-consumer async queue: producers `push`, one consumer iterates, and `close` ends the stream (optionally with an error). */
6
- class AsyncQueue {
7
- limits;
8
- #items = [];
9
- #bytes = 0;
10
- #waiters = [];
11
- #closed = false;
12
- #error;
13
- constructor(limits) {
14
- this.limits = limits;
15
- }
16
- push(value) {
17
- if (this.#closed)
18
- return;
19
- const bytes = Buffer.byteLength(JSON.stringify(value));
20
- if (bytes > this.limits.itemMaxBytes) {
21
- this.close(streamCapacityError("STREAM_QUEUE_ITEM_TOO_LARGE", {
22
- boundary: this.limits.boundary,
23
- measuredBytes: bytes,
24
- limitBytes: this.limits.itemMaxBytes
25
- }));
26
- return;
27
- }
28
- if (this.#items.length >= this.limits.maxItems) {
29
- this.close(streamCapacityError("STREAM_QUEUE_ITEMS_EXCEEDED", {
30
- boundary: this.limits.boundary,
31
- itemCount: this.#items.length + 1,
32
- limitItems: this.limits.maxItems
33
- }));
34
- return;
35
- }
36
- if (this.#bytes + bytes > this.limits.maxBytes) {
37
- this.close(streamCapacityError("STREAM_QUEUE_BYTES_EXCEEDED", {
38
- boundary: this.limits.boundary,
39
- measuredBytes: this.#bytes + bytes,
40
- limitBytes: this.limits.maxBytes
41
- }));
42
- return;
43
- }
44
- const waiter = this.#waiters.shift();
45
- if (waiter)
46
- waiter.resolve({ value, done: false });
47
- else {
48
- this.#items.push({ value, bytes });
49
- this.#bytes += bytes;
50
- }
51
- }
52
- close(error) {
53
- if (this.#closed)
54
- return;
55
- this.#closed = true;
56
- this.#error = error;
57
- for (const waiter of this.#waiters.splice(0)) {
58
- if (error)
59
- waiter.reject(error);
60
- else
61
- waiter.resolve({ value: undefined, done: true });
62
- }
63
- }
64
- next() {
65
- const item = this.#items.shift();
66
- if (item !== undefined) {
67
- this.#bytes -= item.bytes;
68
- return Promise.resolve({ value: item.value, done: false });
69
- }
70
- if (this.#error)
71
- return Promise.reject(this.#error);
72
- if (this.#closed)
73
- return Promise.resolve({ value: undefined, done: true });
74
- return new Promise((resolve, reject) => this.#waiters.push({ resolve, reject }));
75
- }
76
- [Symbol.asyncIterator]() {
77
- return this;
78
- }
79
- }
80
- function writer(output, trace, onError) {
81
- return (value) => {
82
- try {
83
- const frame = JSON.stringify(value);
84
- trace?.("send", traceFrame(value, frame));
85
- output.write(`${frame}\n`, (error) => {
86
- if (error)
87
- onError?.(error);
88
- });
89
- }
90
- catch (error) {
91
- if (!onError)
92
- throw error;
93
- onError(error instanceof Error ? error : new Error(errorMessage(error)));
94
- }
95
- };
96
- }
97
- /**
98
- * 在 worker 中将唯一 AgentExecutor 暴露为 stdio NDJSON JSON-RPC 服务。
99
- * 普通方法是一问一答;invoke 先返回接纳凭据,再发送通知流,不与 Kernel 对外 socket 协议混用。
100
- */
101
- export class WorkerRpcServer {
102
- #log;
103
- #controllers = new Map();
104
- #host;
105
- #send;
106
- #trace;
107
- #output;
108
- #closed = false;
109
- constructor({ host, output, trace, log }) {
110
- this.#log = (level, event, data) => {
111
- try {
112
- log?.(level, event, data);
113
- }
114
- catch {
115
- /* 诊断不能破坏协议流。 */
116
- }
117
- };
118
- this.#host = host;
119
- this.#output = output;
120
- const send = writer(output, trace, (error) => this.#close(error));
121
- this.#send = (value) => {
122
- if (!this.#closed)
123
- send(value);
124
- };
125
- this.#trace = trace;
126
- output.on("error", (error) => this.#close(error));
127
- }
128
- /** Start consuming the input stream; each line must be one complete JSON-RPC object. */
129
- listen(input) {
130
- readBoundedLines(input, INVOKE_REQUEST_MAX_BYTES, {
131
- onTooLarge: () => this.#send({
132
- jsonrpc: "2.0",
133
- id: null,
134
- error: {
135
- code: -32000,
136
- message: "INVOKE_REQUEST_TOO_LARGE",
137
- data: { code: "INVOKE_REQUEST_TOO_LARGE" }
138
- }
139
- }),
140
- onError: (error) => this.#close(error),
141
- onClose: () => this.#close(new Error("adapter-host parent connection closed")),
142
- onLine: (line) => {
143
- if (this.#closed)
144
- return;
145
- try {
146
- const message = asRpcMessage(JSON.parse(line));
147
- if (message.method !== "invoke" &&
148
- message.method !== "invoke.with-environment" &&
149
- Buffer.byteLength(line) > 512 * 1024) {
150
- this.#send({
151
- jsonrpc: "2.0",
152
- id: message.id ?? null,
153
- error: { code: -32000, message: "RPC_REQUEST_TOO_LARGE" }
154
- });
155
- return;
156
- }
157
- this.#trace?.("receive", traceFrame(message, line));
158
- void this.#dispatch(message);
159
- }
160
- catch (error) {
161
- this.#send({
162
- jsonrpc: "2.0",
163
- error: { code: -32700, message: errorMessage(error) },
164
- id: null
165
- });
166
- }
167
- }
168
- });
169
- }
170
- async #dispatch(message) {
171
- if (this.#closed)
172
- return;
173
- const { id = null, method, params = {} } = message;
174
- try {
175
- if (method === "list") {
176
- this.#send({
177
- jsonrpc: "2.0",
178
- id,
179
- result: await this.#host.describe(probeConfigurations(params.configurations))
180
- });
181
- return;
182
- }
183
- if (method === "probe") {
184
- this.#send({
185
- jsonrpc: "2.0",
186
- id,
187
- result: await this.#host.probe(requiredString(params.adapterType, "adapterType"), probeOptions(params.options))
188
- });
189
- return;
190
- }
191
- if (method === "cancel") {
192
- const invocationId = requiredString(params.invocationId, "invocationId");
193
- const reason = typeof params.reason === "string" ? params.reason : undefined;
194
- const controller = this.#controllers.get(invocationId);
195
- controller?.abort(new Error(reason ?? "cancelled"));
196
- this.#send({
197
- jsonrpc: "2.0",
198
- id,
199
- result: {
200
- cancelled: this.#host.cancel(invocationId, reason) || !!controller
201
- }
202
- });
203
- return;
204
- }
205
- if (method === "interaction.respond") {
206
- await this.#host.respondInteraction(requiredString(params.invocationId, "invocationId"), params.response);
207
- this.#send({ jsonrpc: "2.0", id, result: {} });
208
- return;
209
- }
210
- if (method === "native.respond") {
211
- await this.#host.respondNative(requiredString(params.invocationId, "invocationId"), params.response);
212
- this.#send({ jsonrpc: "2.0", id, result: {} });
213
- return;
214
- }
215
- if (method === "invoke" || method === "invoke.with-environment") {
216
- const input = params.input;
217
- this.#log("info", "rpc.invoke_received", {
218
- invocation_id: input?.invocationId,
219
- run_id: input?.runId,
220
- session_id: input?.sessionId
221
- });
222
- const invocationId = requiredString(input?.invocationId, "invocationId");
223
- if (this.#controllers.has(invocationId))
224
- throw new Error("EXECUTION_IDENTITY_CONFLICT");
225
- const controller = new AbortController();
226
- const source = this.#host.invokeFrames(input, {
227
- signal: controller.signal,
228
- ...(method === "invoke.with-environment"
229
- ? {
230
- executionEnvOverrides: params.executionEnvOverrides,
231
- streamLimits: resolveStreamLimitPolicy(params.streamLimits)
232
- }
233
- : {})
234
- });
235
- this.#controllers.set(invocationId, controller);
236
- let first;
237
- try {
238
- first = await source.next();
239
- }
240
- catch (error) {
241
- this.#controllers.delete(invocationId);
242
- throw error;
243
- }
244
- if (first.done) {
245
- this.#controllers.delete(invocationId);
246
- throw new Error("HOST_ENDED_WITHOUT_RECEIPT");
247
- }
248
- const { run_id, invocation_id, stream_id, agent_session_id, session_generation, protocol_mode, protocol } = first.value;
249
- const receipt = {
250
- run_id,
251
- invocation_id,
252
- stream_id,
253
- agent_session_id,
254
- session_generation,
255
- protocol_mode,
256
- protocol
257
- };
258
- this.#send({ jsonrpc: "2.0", id, result: receipt });
259
- void this.#streamInvoke(invocationId, (async function* () {
260
- yield first.value;
261
- yield* source;
262
- })());
263
- return;
264
- }
265
- throw Object.assign(new Error(`unknown method: ${method}`), { code: -32601 });
266
- }
267
- catch (error) {
268
- this.#send({
269
- jsonrpc: "2.0",
270
- id,
271
- error: {
272
- code: errorCode(error),
273
- message: errorMessage(error),
274
- ...(isRecord(error) && typeof error.code === "string"
275
- ? {
276
- data: {
277
- code: error.code,
278
- ...(error.code === "ASYNC_ANSWER_REJECTED" &&
279
- Number.isSafeInteger(error.providerRpcCode)
280
- ? { providerRpcCode: error.providerRpcCode }
281
- : {})
282
- }
283
- }
284
- : {})
285
- }
286
- });
287
- }
288
- }
289
- async #streamInvoke(invocationId, source) {
290
- if (this.#closed)
291
- return;
292
- const started = Date.now();
293
- let failed = false;
294
- try {
295
- for await (const event of source) {
296
- if (this.#closed)
297
- break;
298
- this.#send({
299
- jsonrpc: "2.0",
300
- method: "invoke.event",
301
- params: { invocationId, event }
302
- });
303
- if (this.#output.writableNeedDrain)
304
- await this.#waitForDrain();
305
- }
306
- this.#send({
307
- jsonrpc: "2.0",
308
- method: "invoke.done",
309
- params: { invocationId }
310
- });
311
- }
312
- catch (error) {
313
- failed = true;
314
- this.#send({
315
- jsonrpc: "2.0",
316
- method: "invoke.done",
317
- params: {
318
- invocationId,
319
- error: { message: errorMessage(error), ...safeStreamErrorDetails(error) }
320
- }
321
- });
322
- }
323
- finally {
324
- this.#log(failed ? "error" : "info", "rpc.stream_closed", {
325
- invocation_id: invocationId,
326
- duration_ms: Date.now() - started,
327
- status: failed || this.#closed ? "unknown" : "ended"
328
- });
329
- this.#controllers.delete(invocationId);
330
- }
331
- }
332
- #close(error) {
333
- if (this.#closed)
334
- return;
335
- this.#closed = true;
336
- for (const controller of this.#controllers.values())
337
- controller.abort(error);
338
- this.#controllers.clear();
339
- void this.#host
340
- .shutdown(error.message)
341
- .then((result) => {
342
- if (result.cleanup === "incomplete")
343
- this.#log("error", "rpc.cleanup_incomplete", {
344
- code: "EXECUTOR_CLEANUP_INCOMPLETE",
345
- unresolved_count: result.unresolvedInvocationIds.length
346
- });
347
- })
348
- .catch(() => undefined);
349
- }
350
- #waitForDrain() {
351
- return new Promise((resolve, reject) => {
352
- const cleanup = () => {
353
- clearTimeout(timer);
354
- this.#output.off("drain", drain);
355
- this.#output.off("error", fail);
356
- this.#output.off("close", closed);
357
- };
358
- const drain = () => {
359
- cleanup();
360
- resolve();
361
- };
362
- const fail = (error) => {
363
- cleanup();
364
- reject(error);
365
- };
366
- const closed = () => fail(new Error("adapter-host output closed"));
367
- const timer = setTimeout(() => fail(new Error("STREAM_BACKPRESSURE_TIMEOUT")), 5000);
368
- this.#output.once("drain", drain);
369
- this.#output.once("error", fail);
370
- this.#output.once("close", closed);
371
- });
372
- }
373
- }
374
- /**
375
- * Kernel 持有的 worker RPC 客户端,将按身份校验的通知还原为有界异步流。
376
- * 这里只管理逻辑请求与流;进程存活、心跳和回收由 WorkerSupervisor/WorkerProcess 负责。
377
- */
378
- export class WorkerRpcClient {
379
- invoke = createInputInvoke((input, environment) => this.invokeFrames(input, environment));
380
- #send;
381
- #pending = new Map();
382
- #invocations = new Map();
383
- #closedError;
384
- constructor({ input, output, trace, maximumInputBytes = HOST_RPC_MAX_LINE_BYTES }) {
385
- this.#send = writer(output, trace, (error) => this.close(error));
386
- const removeGuard = watchLineLimit(input, maximumInputBytes, (error) => {
387
- const measuredBytes = "measuredBytes" in error && typeof error.measuredBytes === "number"
388
- ? error.measuredBytes
389
- : undefined;
390
- const failure = streamCapacityError("HOST_FRAME_TOO_LARGE", {
391
- boundary: "host.rpc_transport",
392
- limitBytes: maximumInputBytes,
393
- ...(measuredBytes === undefined ? {} : { measuredBytes })
394
- });
395
- failure.cause = error;
396
- this.close(failure);
397
- input.destroy(failure);
398
- });
399
- const lines = createInterface({ input });
400
- lines.once("close", removeGuard);
401
- lines.on("line", (line) => {
402
- try {
403
- const message = asRpcMessage(JSON.parse(line));
404
- trace?.("receive", traceFrame(message, line));
405
- this.#receive(message);
406
- }
407
- catch (error) {
408
- this.close(new Error(`invalid adapter-host RPC: ${errorMessage(error)}`));
409
- }
410
- });
411
- lines.on("close", () => this.close(new Error("adapter-host connection closed")));
412
- lines.on("error", (error) => this.close(error));
413
- input.on("error", (error) => this.close(error));
414
- output.on("error", (error) => this.close(error));
415
- }
416
- #receive(message) {
417
- if (message.method === "invoke.event") {
418
- const params = message.params ?? {};
419
- const invocationId = requiredString(params.invocationId, "invocationId");
420
- assertHostFrame(params.event);
421
- this.#invocations.get(invocationId)?.push(params.event);
422
- return;
423
- }
424
- if (message.method === "invoke.done") {
425
- const params = message.params ?? {};
426
- const invocationId = requiredString(params.invocationId, "invocationId");
427
- const queue = this.#invocations.get(invocationId);
428
- const detail = isRecord(params.error) ? params.error : undefined;
429
- const rpcError = detail
430
- ? Object.assign(new Error(errorMessage(detail)), safeStreamErrorDetails(detail))
431
- : undefined;
432
- queue?.close(rpcError);
433
- this.#invocations.delete(invocationId);
434
- return;
435
- }
436
- if (typeof message.id !== "string")
437
- return;
438
- const pending = this.#pending.get(message.id);
439
- if (!pending)
440
- return;
441
- this.#pending.delete(message.id);
442
- if (message.error)
443
- pending.reject(Object.assign(new Error(message.error.message), {
444
- code: message.error.data?.code ?? message.error.code,
445
- ...(message.error.data?.code === "ASYNC_ANSWER_REJECTED" &&
446
- Number.isSafeInteger(message.error.data.providerRpcCode)
447
- ? { providerRpcCode: message.error.data.providerRpcCode }
448
- : {})
449
- }));
450
- else
451
- pending.resolve(message.result);
452
- }
453
- /** Send an ordinary JSON-RPC request and await the matching response by random ID. */
454
- request(method, params = {}, signal) {
455
- if (this.#closedError)
456
- return Promise.reject(this.#closedError);
457
- if (signal?.aborted)
458
- return Promise.reject(abortError(signal));
459
- signal = AbortSignal.any([...(signal ? [signal] : []), AbortSignal.timeout(30_000)]);
460
- const id = randomUUID();
461
- const message = { jsonrpc: "2.0", id, method, params };
462
- try {
463
- assertJsonByteLimit(message, method === "invoke" || method === "invoke.with-environment"
464
- ? INVOKE_REQUEST_MAX_BYTES
465
- : 512 * 1024, method === "invoke" || method === "invoke.with-environment"
466
- ? "INVOKE_REQUEST_TOO_LARGE"
467
- : "RPC_REQUEST_TOO_LARGE");
468
- }
469
- catch (error) {
470
- return Promise.reject(error instanceof Error ? error : new Error("RPC_REQUEST_INVALID"));
471
- }
472
- const promise = new Promise((resolve, reject) => {
473
- const cleanup = () => {
474
- signal?.removeEventListener("abort", onAbort);
475
- this.#pending.delete(id);
476
- };
477
- const onAbort = () => {
478
- cleanup();
479
- reject(abortError(signal));
480
- };
481
- this.#pending.set(id, {
482
- resolve: (value) => {
483
- cleanup();
484
- resolve(value);
485
- },
486
- reject: (error) => {
487
- cleanup();
488
- reject(error);
489
- }
490
- });
491
- signal?.addEventListener("abort", onAbort, { once: true });
492
- });
493
- this.#send(message);
494
- return promise;
495
- }
496
- /** 用同一故障结束所有逻辑请求/流;不终止进程,owner 仍须调用 WorkerProcess.close。 */
497
- close(error = new Error("adapter-host client closed")) {
498
- if (this.#closedError)
499
- return;
500
- this.#closedError = error;
501
- for (const pending of this.#pending.values())
502
- pending.reject(error);
503
- this.#pending.clear();
504
- for (const queue of this.#invocations.values())
505
- queue.close(error);
506
- this.#invocations.clear();
507
- }
508
- list(configurations) {
509
- return this.request("list", { configurations });
510
- }
511
- probe(adapterType, options) {
512
- return this.request("probe", { adapterType, options });
513
- }
514
- cancel(invocationId, reason) {
515
- return this.request("cancel", { invocationId, reason });
516
- }
517
- async respondInteraction(invocationId, response) {
518
- await this.request("interaction.respond", { invocationId, response });
519
- }
520
- async respondNative(invocationId, response) {
521
- await this.request("native.respond", { invocationId, response });
522
- }
523
- /** Await the invoke ACK first, then keep yielding this invocation's event notifications until done. */
524
- async *invokeFrames(input, environment = {}) {
525
- const { signal, executionEnvOverrides } = environment;
526
- const streamLimits = resolveStreamLimitPolicy(environment.streamLimits);
527
- const invocationId = input.invocationId ?? randomUUID();
528
- const wireInput = { ...input, invocationId };
529
- if (signal?.aborted)
530
- throw abortError(signal);
531
- if (this.#invocations.has(invocationId))
532
- throw new Error("EXECUTION_IDENTITY_CONFLICT");
533
- const queue = new AsyncQueue({
534
- itemMaxBytes: streamLimits.hostFrameMaxBytes,
535
- maxBytes: streamLimits.rpcQueueMaxBytes,
536
- maxItems: streamLimits.rpcQueueMaxItems,
537
- boundary: "host.rpc_queue"
538
- });
539
- let terminal = false;
540
- let accepted = false;
541
- this.#invocations.set(invocationId, queue);
542
- // AbortSignal 只留在本进程;跨进程发送明确的 cancel RPC,不能序列化成空对象。
543
- const onAbort = () => {
544
- queue.close(abortError(signal));
545
- void this.request("cancel", { invocationId, reason: "caller_aborted" }, AbortSignal.timeout(2000)).catch(() => undefined);
546
- };
547
- signal?.addEventListener("abort", onAbort, { once: true });
548
- try {
549
- const receipt = await this.request(executionEnvOverrides?.env_variables.length || environment.streamLimits
550
- ? "invoke.with-environment"
551
- : "invoke", {
552
- input: wireInput,
553
- ...(executionEnvOverrides ? { executionEnvOverrides } : {}),
554
- ...(environment.streamLimits ? { streamLimits } : {})
555
- }, signal);
556
- assertHostRunReceipt(receipt);
557
- accepted = true;
558
- assertReceiptInput(receipt, wireInput);
559
- let seq = 0;
560
- for await (const event of queue) {
561
- if (signal?.aborted)
562
- throw abortError(signal);
563
- assertHostFrameIdentity(event, receipt);
564
- if (event.seq !== ++seq)
565
- throw new Error("STREAM_GAP");
566
- if (terminal)
567
- throw new Error("HOST_FRAME_AFTER_TERMINAL");
568
- terminal = isHostTerminal(event);
569
- yield event;
570
- }
571
- if (!terminal)
572
- throw new Error("HOST_ENDED_WITHOUT_TERMINAL");
573
- }
574
- finally {
575
- signal?.removeEventListener("abort", onAbort);
576
- this.#invocations.delete(invocationId);
577
- queue.close();
578
- if (accepted && !terminal && !signal?.aborted)
579
- await this.request("cancel", { invocationId, reason: "consumer_closed" }, AbortSignal.timeout(2000)).catch(() => undefined);
580
- }
581
- }
582
- }
583
- function assertReceiptInput(receipt, input) {
584
- if ((input.runId !== undefined && receipt.run_id !== input.runId) ||
585
- receipt.invocation_id !== input.invocationId ||
586
- (input.sessionId !== undefined && receipt.agent_session_id !== input.sessionId) ||
587
- receipt.session_generation !== (input.sessionGeneration ?? 0) ||
588
- receipt.protocol_mode !== (input.protocol_mode ?? "native"))
589
- throw new Error("EXECUTION_IDENTITY_CONFLICT");
590
- }
591
- function asRpcMessage(value) {
592
- if (!isRecord(value) || value.jsonrpc !== "2.0")
593
- throw new TypeError("expected a JSON-RPC 2.0 object");
594
- return value;
595
- }
596
- function isRecord(value) {
597
- return value !== null && typeof value === "object" && !Array.isArray(value);
598
- }
599
- function safeStreamErrorDetails(value) {
600
- if (!isRecord(value))
601
- return {};
602
- const result = {};
603
- if (typeof value.code === "string" && /^[A-Z][A-Z0-9_]{0,127}$/.test(value.code))
604
- result.code = value.code;
605
- if (typeof value.boundary === "string" && /^[a-z0-9][a-z0-9._-]{0,127}$/i.test(value.boundary))
606
- result.boundary = value.boundary;
607
- for (const key of ["measuredBytes", "limitBytes", "itemCount", "limitItems"]) {
608
- const entry = value[key];
609
- if (typeof entry === "number" && Number.isSafeInteger(entry) && entry >= 0)
610
- result[key] = entry;
611
- }
612
- return result;
613
- }
614
- function requiredString(value, name) {
615
- if (typeof value !== "string" || value.length === 0)
616
- throw new TypeError(`${name} must be a non-empty string`);
617
- return value;
618
- }
619
- function errorMessage(error) {
620
- if (error instanceof Error)
621
- return error.message;
622
- if (isRecord(error) && typeof error.message === "string")
623
- return error.message;
624
- return String(error);
625
- }
626
- function errorCode(error) {
627
- return isRecord(error) && typeof error.code === "number" ? error.code : -32000;
628
- }
629
- function abortError(signal) {
630
- return signal.reason instanceof Error ? signal.reason : new Error("adapter invocation aborted");
631
- }
632
- function traceFrame(message, raw) {
633
- const params = message.params ?? {};
634
- const event = isRecord(params.event) ? params.event : {};
635
- const input = isRecord(params.input) ? params.input : {};
636
- const canonical = isRecord(event.event) ? event.event : {};
637
- return JSON.stringify({
638
- jsonrpc: message.jsonrpc,
639
- id: message.id,
640
- method: message.method,
641
- invocationId: params.invocationId ?? input.invocationId,
642
- protocolMode: event.protocol_mode ?? input.protocol_mode,
643
- eventType: canonical.type,
644
- frameKind: event.kind,
645
- bytes: Buffer.byteLength(raw)
646
- });
647
- }
648
- /** Kernel 配置与 worker 探测共用的配置形态校验;不修改调用方对象。 */
649
- export function probeOptions(value) {
650
- if (value === undefined)
651
- return undefined;
652
- if (!value || typeof value !== "object" || Array.isArray(value))
653
- throw new TypeError("invalid probe options");
654
- const options = value;
655
- if (options.providerOptions !== undefined &&
656
- (!options.providerOptions ||
657
- typeof options.providerOptions !== "object" ||
658
- Array.isArray(options.providerOptions) ||
659
- Object.values(options.providerOptions).some((v) => typeof v !== "string")))
660
- throw new TypeError("invalid probe provider options");
661
- return {
662
- ...options,
663
- ...(options.streamLimits === undefined
664
- ? {}
665
- : { streamLimits: resolveStreamLimitPolicy(options.streamLimits) })
666
- };
667
- }
668
- function probeConfigurations(value) {
669
- if (value === undefined)
670
- return undefined;
671
- if (!value || typeof value !== "object" || Array.isArray(value))
672
- throw new TypeError("invalid probe configurations");
673
- return Object.fromEntries(Object.entries(value).map(([type, options]) => [type, probeOptions(options) ?? {}]));
674
- }
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- // 通用清单 worker 不包含产品准备逻辑;SDK 自有 worker 原生 import 后直接调用 serveWorker。
3
- import { loadManifestAdapters } from "./manifest-adapters.js";
4
- import { serveWorker } from "./index.js";
5
- serveWorker(await loadManifestAdapters());
@@ -1,10 +0,0 @@
1
- import { type HostedAdapter } from "@mininglamp-oss/octo-runtime-executor-core";
2
- import { type RuntimeLoggingOptions } from "@mininglamp-oss/octo-runtime-adapter-sdk";
3
- /**
4
- * 在当前独立 worker 子进程中提供 Core 执行服务。调用方已经决定加载集合:
5
- * CLI 可从自己的 JSON 动态加载,SDK 可直接 import;这里不扫描或补齐任何 Adapter。
6
- * 该函数只在 worker 入口调用;宿主 App 和 Kernel 监督进程通过客户端接入,不直接调用。
7
- */
8
- export declare function serveWorker(adapters: readonly HostedAdapter[], options?: {
9
- logging?: RuntimeLoggingOptions;
10
- }): void;