@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,53 +1 @@
1
- import { type HostFrame } from "@mininglamp-oss/octo-runtime-protocol";
2
- import { type KernelInvocationRecord, type KernelInvocationLifecycle, type KernelInvocationDrainResult, type LookupKey, type RunRef, type RunSnapshot } from "./types.js";
3
- export interface TrackedInvocation {
4
- key: LookupKey;
5
- ref?: RunRef;
6
- instance?: string;
7
- submitted: boolean;
8
- phase: KernelInvocationRecord["phase"];
9
- cancellation: KernelInvocationRecord["cancellation"];
10
- lastSeq: number;
11
- observationError?: string;
12
- reason?: string;
13
- cancelTask?: Promise<{
14
- accepted: boolean;
15
- }>;
16
- admitted: Promise<void>;
17
- settleAdmission(): void;
18
- admissionError?: Error;
19
- }
20
- /**
21
- * 每个 client 独立保存 invoke 的身份、取消和观察状态;执行与断线恢复由 client.ts 负责。
22
- * 最多登记 128 项,不缓存正文;未知结果继续占用额度,不能通过删除记录伪造排空成功。
23
- */
24
- export declare class InvocationRegistry implements KernelInvocationLifecycle {
25
- #private;
26
- private readonly transport;
27
- constructor(transport: {
28
- get(key: LookupKey, instance: string, deadline: number, signal: AbortSignal): Promise<RunSnapshot>;
29
- cancel(ref: RunRef, reason: string, deadline: number, signal: AbortSignal): Promise<{
30
- accepted: boolean;
31
- }>;
32
- });
33
- begin(key: LookupKey): TrackedInvocation;
34
- assertSubmission(): void;
35
- accepted(record: TrackedInvocation, ref: RunRef, terminal?: HostFrame): void;
36
- reconcile(ref: RunRef, terminal?: HostFrame): void;
37
- rejected(record: TrackedInvocation, error: unknown): void;
38
- observe(ref: RunRef, frame: HostFrame): void;
39
- interrupted(record: TrackedInvocation, error?: unknown): void;
40
- active(id: string): TrackedInvocation;
41
- ref(id: string): RunRef;
42
- cancel(record: TrackedInvocation, reason?: string): Promise<{
43
- accepted: boolean;
44
- }>;
45
- snapshot(): readonly KernelInvocationRecord[];
46
- stopAdmission(): void;
47
- close(): void;
48
- drain(options: {
49
- deadline: number;
50
- reason: string;
51
- }): Promise<KernelInvocationDrainResult>;
52
- }
53
- export declare function errorCode(error: unknown): string;
1
+ export { InvocationRegistry, errorCode, type TrackedInvocation } from "@mininglamp-oss/octo-runtime-client/internal";
@@ -1,280 +1,2 @@
1
- import { setTimeout as delay } from "node:timers/promises";
2
- import { admissionClosedError } from "./submission-error.js";
3
- import { isHostTerminal } from "@mininglamp-oss/octo-runtime-protocol";
4
- import { KernelError } from "./types.js";
5
- /**
6
- * 每个 client 独立保存 invoke 的身份、取消和观察状态;执行与断线恢复由 client.ts 负责。
7
- * 最多登记 128 项,不缓存正文;未知结果继续占用额度,不能通过删除记录伪造排空成功。
8
- */
9
- export class InvocationRegistry {
10
- transport;
11
- #records = new Map();
12
- #stopped = false;
13
- #draining;
14
- #drainDeadline;
15
- #closed = false;
16
- #cancelling = 0;
17
- #cancelQueue = [];
18
- #cancelControllers = new Set();
19
- constructor(transport) {
20
- this.transport = transport;
21
- }
22
- begin(key) {
23
- this.assertSubmission();
24
- if (this.#records.has(key.invocation_id))
25
- throw new KernelError("EXECUTION_IDENTITY_CONFLICT");
26
- if (this.#records.size >= 128)
27
- throw new KernelError("CLIENT_INVOCATION_CAPACITY_EXHAUSTED");
28
- let settleAdmission;
29
- const admitted = new Promise((resolve) => {
30
- settleAdmission = resolve;
31
- });
32
- const record = {
33
- key,
34
- submitted: false,
35
- phase: "admitting",
36
- cancellation: "none",
37
- lastSeq: 0,
38
- admitted,
39
- settleAdmission
40
- };
41
- this.#records.set(key.invocation_id, record);
42
- return record;
43
- }
44
- assertSubmission() {
45
- if (this.#stopped)
46
- throw admissionClosedError();
47
- }
48
- accepted(record, ref, terminal) {
49
- record.ref = ref;
50
- record.instance = ref.kernel_instance_id;
51
- record.phase = "accepted";
52
- record.settleAdmission();
53
- if (terminal)
54
- this.observe(ref, terminal);
55
- if (record.reason !== undefined && !terminal && this.#records.get(ref.invocation_id) === record)
56
- void this.cancel(record, record.reason).catch(() => undefined);
57
- }
58
- reconcile(ref, terminal) {
59
- const record = this.#records.get(ref.invocation_id);
60
- if (!record ||
61
- (record.instance && record.instance !== ref.kernel_instance_id) ||
62
- Object.entries(record.key).some(([field, value]) => Reflect.get(ref, field) !== value))
63
- return;
64
- if (record.ref &&
65
- (record.ref.stream_id !== ref.stream_id || record.ref.protocol !== ref.protocol))
66
- throw new KernelError("RUN_IDENTITY_MISMATCH");
67
- if (!record.ref)
68
- this.accepted(record, ref, terminal);
69
- else if (terminal)
70
- this.observe(ref, terminal);
71
- }
72
- rejected(record, error) {
73
- if (record.ref) {
74
- record.settleAdmission();
75
- this.interrupted(record, error);
76
- return;
77
- }
78
- record.admissionError = error instanceof Error ? error : new KernelError("ACCEPTANCE_UNKNOWN");
79
- record.observationError = errorCode(error);
80
- record.phase = "acceptance_unknown";
81
- record.settleAdmission();
82
- const rejectedByServer = error instanceof KernelError &&
83
- error.data !== undefined &&
84
- !["KERNEL_INSTANCE_CHANGED", "RUN_IDENTITY_MISMATCH"].includes(error.code);
85
- // 仅未发送或明确拒绝可安全移除;已发送但 ACK 未知时保留身份,后续 drain 只能查询确认。
86
- if (!record.submitted || rejectedByServer)
87
- this.#records.delete(record.key.invocation_id);
88
- }
89
- observe(ref, frame) {
90
- const record = this.#records.get(ref.invocation_id);
91
- if (!record ||
92
- !record.ref ||
93
- record.ref.stream_id !== ref.stream_id ||
94
- record.ref.kernel_instance_id !== ref.kernel_instance_id)
95
- return;
96
- record.lastSeq = Math.max(record.lastSeq, frame.seq);
97
- if (!isHostTerminal(frame))
98
- return;
99
- if (frame.kind === "control" &&
100
- frame.control.type === "state" &&
101
- frame.control.state === "lost") {
102
- record.phase = "unobserved";
103
- record.observationError = "RUN_OUTCOME_UNKNOWN";
104
- }
105
- else
106
- this.#records.delete(ref.invocation_id);
107
- }
108
- interrupted(record, error) {
109
- if (this.#records.get(record.key.invocation_id) !== record || !record.ref)
110
- return;
111
- record.phase = "unobserved";
112
- if (error !== undefined)
113
- record.observationError = errorCode(error);
114
- }
115
- active(id) {
116
- const record = this.#records.get(id);
117
- if (!record)
118
- throw new KernelError("INVOCATION_NOT_TRACKED");
119
- return record;
120
- }
121
- ref(id) {
122
- const record = this.active(id);
123
- if (!record.ref)
124
- throw new KernelError("INVOCATION_NOT_ACCEPTED");
125
- return record.ref;
126
- }
127
- cancel(record, reason = "caller_cancelled") {
128
- if (record.ref && this.#records.get(record.key.invocation_id) !== record)
129
- return Promise.resolve({ accepted: false });
130
- if (record.observationError === "RUN_OUTCOME_UNKNOWN")
131
- return Promise.reject(new KernelError("RUN_OUTCOME_UNKNOWN"));
132
- record.reason ??= reason;
133
- if (record.cancellation === "none")
134
- record.cancellation = "requested";
135
- // 取消可能早于接纳 ACK:记住首次原因,等同一执行获得 RunRef 后发出一次控制请求。
136
- if (!record.ref)
137
- return record.admitted.then(() => {
138
- if (!record.ref)
139
- throw record.admissionError ?? new KernelError("ACCEPTANCE_UNKNOWN");
140
- return this.cancel(record, reason);
141
- });
142
- if (!record.cancelTask) {
143
- const controller = new AbortController();
144
- this.#cancelControllers.add(controller);
145
- record.cancelTask = new Promise((resolve, reject) => {
146
- this.#cancelQueue.push(async () => {
147
- try {
148
- if (this.#closed)
149
- throw new KernelError("CLIENT_CLOSED");
150
- if (this.#records.get(record.key.invocation_id) !== record) {
151
- resolve({ accepted: false });
152
- return;
153
- }
154
- if (record.observationError === "RUN_OUTCOME_UNKNOWN")
155
- throw new KernelError("RUN_OUTCOME_UNKNOWN");
156
- const deadline = Math.min(Date.now() + 5000, this.#drainDeadline ?? Infinity);
157
- if (deadline <= Date.now())
158
- throw new KernelError("OPERATION_OUTCOME_UNKNOWN");
159
- resolve(await this.transport.cancel(record.ref, record.reason, deadline, controller.signal));
160
- }
161
- catch (error) {
162
- reject(error instanceof Error ? error : new KernelError("OPERATION_OUTCOME_UNKNOWN"));
163
- }
164
- });
165
- this.#pumpCancellations();
166
- })
167
- .then((result) => {
168
- record.cancellation = "acknowledged";
169
- return result;
170
- })
171
- .catch((error) => {
172
- record.cancellation = "unknown";
173
- record.observationError = errorCode(error);
174
- throw error;
175
- })
176
- .finally(() => this.#cancelControllers.delete(controller));
177
- // Automatic signal cancellation may outlive its consumer; always consume rejection.
178
- void record.cancelTask.catch(() => undefined);
179
- }
180
- return record.cancelTask;
181
- }
182
- #pumpCancellations() {
183
- while (this.#cancelling < 4 && this.#cancelQueue.length) {
184
- this.#cancelling++;
185
- void this.#cancelQueue.shift()().finally(() => {
186
- this.#cancelling--;
187
- this.#pumpCancellations();
188
- });
189
- }
190
- }
191
- snapshot() {
192
- return [...this.#records.values()].map((record) => ({
193
- key: { ...record.key },
194
- ...(record.ref ? { ref: { ...record.ref } } : {}),
195
- phase: record.phase,
196
- cancellation: record.cancellation,
197
- lastSeq: record.lastSeq,
198
- ...(record.observationError ? { observationError: record.observationError } : {})
199
- }));
200
- }
201
- stopAdmission() {
202
- this.#stopped = true;
203
- }
204
- close() {
205
- this.#closed = true;
206
- this.stopAdmission();
207
- for (const controller of this.#cancelControllers)
208
- controller.abort();
209
- }
210
- drain(options) {
211
- if (!Number.isSafeInteger(options.deadline) || options.deadline - Date.now() > 2_147_483_647)
212
- throw new KernelError("INVOCATION_DEADLINE_INVALID");
213
- // 首次关闭锁定绝对期限;重复调用不能延长预算,也不能启动第二轮取消副作用。
214
- if (this.#draining)
215
- return this.#draining;
216
- this.stopAdmission();
217
- this.#drainDeadline = options.deadline;
218
- return (this.#draining = this.#drain(options));
219
- }
220
- async #drain({ deadline, reason }) {
221
- const controller = new AbortController();
222
- const timer = setTimeout(() => {
223
- controller.abort();
224
- for (const cancelController of this.#cancelControllers)
225
- cancelController.abort();
226
- }, Math.max(0, deadline - Date.now()));
227
- try {
228
- while (this.#records.size && !controller.signal.aborted && Date.now() < deadline) {
229
- const records = [...this.#records.values()];
230
- // 最多四路查询/控制 IO;只查终态元数据,不新增正文订阅,避免与业务消费者争夺尾流。
231
- let index = 0;
232
- await Promise.all(Array.from({ length: Math.min(4, records.length) }, async () => {
233
- while (index < records.length && !controller.signal.aborted && Date.now() < deadline) {
234
- const record = records[index++];
235
- record.reason ??= reason;
236
- if (record.cancellation === "none")
237
- record.cancellation = "requested";
238
- if (!record.instance)
239
- continue;
240
- try {
241
- const info = await this.transport.get(record.key, record.instance, deadline, controller.signal);
242
- if (!record.ref)
243
- this.accepted(record, info.ref);
244
- if (info.terminal)
245
- this.observe(info.ref, info.terminal);
246
- if (!this.#records.has(record.key.invocation_id))
247
- continue;
248
- // lost 表示执行结果未知,必须留在 unresolved,不能据此重放可能已有副作用的执行。
249
- if (record.observationError !== "RUN_OUTCOME_UNKNOWN")
250
- await this.cancel(record, reason);
251
- }
252
- catch (error) {
253
- if (record.observationError !== "RUN_OUTCOME_UNKNOWN")
254
- record.observationError = errorCode(error);
255
- }
256
- }
257
- }));
258
- if (this.#records.size && Date.now() < deadline) {
259
- await delay(Math.min(100, deadline - Date.now()), undefined, {
260
- signal: controller.signal
261
- }).catch(() => undefined);
262
- }
263
- }
264
- return { complete: this.#records.size === 0, unresolved: this.snapshot() };
265
- }
266
- finally {
267
- clearTimeout(timer);
268
- controller.abort();
269
- for (const cancelController of this.#cancelControllers)
270
- cancelController.abort();
271
- }
272
- }
273
- }
274
- export function errorCode(error) {
275
- return error instanceof KernelError
276
- ? error.code
277
- : error instanceof Error && /^[A-Z][A-Z0-9_]+$/.test(error.message)
278
- ? error.message
279
- : "INVOCATION_OBSERVATION_FAILED";
280
- }
1
+ // 兼容旧入口;客户端状态、错误身份和恢复实现由独立包统一持有。
2
+ export { InvocationRegistry, errorCode } from "@mininglamp-oss/octo-runtime-client/internal";
@@ -6,13 +6,14 @@ export interface InvocationManifestEntry {
6
6
  }
7
7
  export interface OrphanReapResult {
8
8
  found: boolean;
9
- reaped: boolean;
10
- pid?: number;
11
- reason?: "kernel_alive" | "host_missing" | "identity_mismatch" | "unsupported_identity" | "cleanup_incomplete" | "cleanup_acknowledged";
9
+ /** 原生恢复不终止任何进程;人工确认也不表示自动回收。 */
10
+ reaped: false;
11
+ reason?: "kernel_alive" | "cleanup_incomplete" | "cleanup_acknowledged";
12
12
  }
13
13
  /**
14
- * 持久化 Kernel/worker 身份与在途执行事实,用于下次启动时识别遗留资源,不保存业务历史。
15
- * 写入串行化并通过 rename 替换;只有 owner 确认 worker 回收后才能 close 删除清单。
14
+ * 持久化原生 Kernel 所有权与在途执行事实,不保存业务历史,不迁移旧执行架构。
15
+ * 这是资源恢复记录,不是模块 manifest。写入串行化并通过 rename 替换;
16
+ * 只有 owner 确认 Core/Adapter 资源回收后才能 close 删除记录。
16
17
  */
17
18
  export declare class InvocationManifest {
18
19
  #private;
@@ -21,30 +22,30 @@ export declare class InvocationManifest {
21
22
  manifest: InvocationManifest;
22
23
  reap: OrphanReapResult;
23
24
  }>;
24
- setWorker(pid: number | undefined, entrypoint: string): Promise<void>;
25
+ /** 原生服务异常退出无法证明 Adapter 资源已清空;正常 close 才删除所有权证据。 */
26
+ markNativeOwner(): Promise<void>;
27
+ /** owner 关闭未完成时登记实际失败;宿主继续存活也不能将诊断恢复为 available。 */
28
+ markCleanupIncomplete(): Promise<void>;
25
29
  begin(entry: Omit<InvocationManifestEntry, "startedAt">): Promise<void>;
26
30
  end(invocationId: string): Promise<void>;
27
31
  close(): Promise<void>;
28
32
  }
29
33
  /**
30
- * 仅在原 Kernel 已退出且 worker 的 PID/启动身份仍匹配时尝试回收,防止 PID 复用误杀。
31
- * 无法验证身份时保留清单并报告 unsupported_identity;worker 已消失不证明 Windows 后代已清空。
34
+ * 检查原生 owner 的遗留记录,不终止宿主或 Provider 进程。
35
+ * 仅文件不存在或该原文已获人工确认才允许 open;损坏及旧 worker 记录保留并明确拒绝。
32
36
  */
33
37
  export declare function reapOrphanedInvocationManifest(path: string): Promise<OrphanReapResult>;
34
38
  /** 只读恢复诊断,不回收进程、不改写清单;用于 doctor 及 SDK 运维界面。 */
35
39
  export declare function inspectOrphanCleanup(path: string): Promise<{
36
40
  manifestPath: string;
37
- state: "missing" | "available" | "cleanup_incomplete" | "acknowledged" | "unreadable";
38
- workerPid?: number;
41
+ state: "missing" | "available" | "cleanup_incomplete" | "acknowledged" | "unsupported" | "unreadable";
39
42
  }>;
40
43
  /**
41
44
  * 操作者已停止未知后代后显式确认当前失败记录;不终止进程、不声称整树回收已验证。
42
- * 仍存活的原 Kernel/worker 或无法核验的 PID 不能放行。备份保留,确认仅匹配原文摘要,
45
+ * 仅接受有效原生记录,仍存活的原 Kernel 不能放行。备份保留,确认仅匹配原文摘要,
43
46
  * 所以并发启动、后续调用或另一份清单不会复用旧确认;下一次 open 才替换失败记录。
44
47
  */
45
48
  export declare function acknowledgeOrphanCleanup(path: string): Promise<{
46
49
  manifestPath: string;
47
50
  archivePath: string;
48
51
  }>;
49
- /** 查询系统启动时间以区分 PID 复用;失败时不返回可用于回收的身份,绝不以 PID 本身兜底。 */
50
- export declare function processStartIdentity(pid: number): Promise<string | undefined>;