@mininglamp-oss/octo-runtime 1.1.4 → 1.1.6

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 (177) hide show
  1. package/README.md +61 -37
  2. package/apps/cli/README.md +58 -22
  3. package/apps/cli/dist/adapter-configurations.d.ts +4 -0
  4. package/apps/cli/dist/adapter-configurations.js +102 -0
  5. package/apps/cli/dist/build-info.json +2 -2
  6. package/apps/cli/dist/cli-entrypoint.d.ts +2 -0
  7. package/apps/cli/dist/cli-entrypoint.js +16 -0
  8. package/apps/cli/dist/command-tree.d.ts +20 -0
  9. package/apps/cli/dist/command-tree.js +402 -0
  10. package/apps/cli/dist/extra-command-config.d.ts +4 -0
  11. package/apps/cli/dist/extra-command-config.js +50 -0
  12. package/apps/cli/dist/extra-commands.d.ts +15 -0
  13. package/apps/cli/dist/extra-commands.js +275 -0
  14. package/apps/cli/dist/extras.js +14 -2
  15. package/apps/cli/dist/global-extras.d.ts +16 -0
  16. package/apps/cli/dist/global-extras.js +201 -0
  17. package/apps/cli/dist/help.d.ts +4 -1
  18. package/apps/cli/dist/help.js +31 -79
  19. package/apps/cli/dist/logs.js +8 -4
  20. package/apps/cli/dist/main.d.ts +2 -0
  21. package/apps/cli/dist/main.js +38 -68
  22. package/apps/cli/dist/manifest.json +48 -3
  23. package/apps/cli/dist/module-manifest.d.ts +1 -1
  24. package/apps/cli/dist/module-manifest.js +3 -2
  25. package/apps/cli/dist/output.js +18 -2
  26. package/apps/cli/dist/playboard.js +3 -2
  27. package/apps/cli/dist/service-control.js +2 -2
  28. package/apps/cli/dist/state.js +48 -19
  29. package/dist/public/channel-gateway-commands.d.ts +1 -0
  30. package/dist/public/channel-gateway-commands.js +1 -0
  31. package/dist/public/channel-wecom-commands.d.ts +1 -0
  32. package/dist/public/channel-wecom-commands.js +1 -0
  33. package/dist/public/extra.d.ts +1 -0
  34. package/dist/public/extra.js +1 -0
  35. package/dist/public/host.d.ts +2 -4
  36. package/dist/public/host.js +1 -2
  37. package/dist/public/webui-commands.d.ts +1 -0
  38. package/dist/public/webui-commands.js +1 -0
  39. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +5 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.d.ts +3 -4
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +161 -26
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +3 -1
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-G5PWGRL5.js → chunk-3GXX5VD5.js} +24 -90
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-UOQRXV3Q.js → chunk-FWAPYRV2.js} +1 -1
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-DYOJCNWF.js → chunk-IW62UM3C.js} +1 -1
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +1 -1
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +1 -1
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +3 -3
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +1 -1
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +8 -2
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  65. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  66. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  67. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  68. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +1 -1
  69. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +8 -4
  70. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.d.ts +6 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +16 -4
  72. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +12 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +91 -0
  74. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +2 -2
  75. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +13 -1
  76. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +9 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +40 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +3 -2
  79. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  80. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +4 -0
  81. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +102 -0
  82. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  83. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.d.ts +2 -0
  84. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.js +16 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.d.ts +20 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +402 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.d.ts +4 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.js +50 -0
  89. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.d.ts +15 -0
  90. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.js +275 -0
  91. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +14 -2
  92. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.d.ts +16 -0
  93. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.js +201 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.d.ts +4 -1
  95. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +31 -79
  96. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +8 -4
  97. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
  98. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +38 -68
  99. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +48 -3
  100. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +1 -1
  101. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +3 -2
  102. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +18 -2
  103. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +3 -2
  104. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/service-control.js +2 -2
  105. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -19
  106. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +25 -24
  107. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  108. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +8 -3
  109. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +47 -4
  110. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  111. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  113. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -0
  114. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +79 -5
  115. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +3 -1
  116. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +22 -6
  117. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  118. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +5 -3
  119. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +12 -6
  120. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +4 -2
  121. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +131 -43
  122. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  123. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/context-gap.js +2 -2
  124. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +36 -20
  125. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.d.ts +4 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.js +124 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +3 -0
  128. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.d.ts +29 -0
  129. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.js +171 -0
  130. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +4 -1
  131. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -6
  132. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +2 -0
  133. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.d.ts +1 -1
  134. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.js +2 -2
  135. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.d.ts +7 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +44 -3
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +1 -1
  138. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +37 -0
  139. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +8 -5
  140. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +10 -6
  141. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.d.ts +4 -0
  142. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.js +128 -0
  143. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +9 -5
  144. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.d.ts +3 -0
  145. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.js +51 -0
  146. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +7 -3
  147. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +2 -0
  148. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +5 -3
  149. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.d.ts +70 -0
  150. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.js +16 -0
  151. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -3
  152. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +1 -2
  153. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +8 -4
  154. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -1
  155. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +9 -1
  156. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +9 -0
  157. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  158. package/node_modules/commander/LICENSE +22 -0
  159. package/node_modules/commander/Readme.md +1172 -0
  160. package/node_modules/commander/index.js +21 -0
  161. package/node_modules/commander/lib/argument.js +147 -0
  162. package/node_modules/commander/lib/command.js +2790 -0
  163. package/node_modules/commander/lib/error.js +36 -0
  164. package/node_modules/commander/lib/help.js +731 -0
  165. package/node_modules/commander/lib/option.js +377 -0
  166. package/node_modules/commander/lib/suggestSimilar.js +99 -0
  167. package/node_modules/commander/package-support.json +19 -0
  168. package/node_modules/commander/package.json +64 -0
  169. package/node_modules/commander/typings/index.d.ts +1113 -0
  170. package/package.json +41 -27
  171. package/packages/octo-runtime-protocol/schema/protocol.schema.json +14 -0
  172. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +0 -1
  173. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +0 -16
  174. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.d.ts +0 -15
  175. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.js +0 -22
  176. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.d.ts +0 -16
  177. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.js +0 -160
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Provider-neutral Agent runtime for unified execution through provider adapters",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,6 +57,18 @@
57
57
  "./protocol": {
58
58
  "types": "./dist/public/protocol.d.ts",
59
59
  "import": "./dist/public/protocol.js"
60
+ },
61
+ "./extras/channel-gateway/commands": {
62
+ "types": "./dist/public/channel-gateway-commands.d.ts",
63
+ "import": "./dist/public/channel-gateway-commands.js"
64
+ },
65
+ "./extras/channel-wecom/commands": {
66
+ "types": "./dist/public/channel-wecom-commands.d.ts",
67
+ "import": "./dist/public/channel-wecom-commands.js"
68
+ },
69
+ "./extras/webui/commands": {
70
+ "types": "./dist/public/webui-commands.d.ts",
71
+ "import": "./dist/public/webui-commands.js"
60
72
  }
61
73
  },
62
74
  "engines": {
@@ -74,31 +86,32 @@
74
86
  "access": "public"
75
87
  },
76
88
  "dependencies": {
77
- "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.4",
78
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
79
- "@mininglamp-oss/octo-runtime-protocol": "1.1.4",
89
+ "commander": "15.0.0",
90
+ "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.6",
91
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
92
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.6",
80
93
  "import-meta-resolve": "4.2.0",
81
- "@mininglamp-oss/octo-runtime-extra-webui": "1.1.4",
82
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.4",
83
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.4",
84
- "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.4",
85
- "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.4",
86
- "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.4",
87
- "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.4",
88
- "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.4",
89
- "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.4",
90
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.4",
91
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.4",
92
- "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.4",
93
- "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.4",
94
- "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.4",
94
+ "@mininglamp-oss/octo-runtime-extra-webui": "1.1.6",
95
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.6",
96
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.6",
97
+ "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.6",
98
+ "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.6",
99
+ "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.6",
100
+ "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.6",
101
+ "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.6",
102
+ "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.6",
103
+ "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.6",
104
+ "@mininglamp-oss/octo-runtime-executor-core": "1.1.6",
105
+ "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.6",
106
+ "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.6",
107
+ "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.6",
95
108
  "ws": "8.22.0",
96
- "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.4",
97
- "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.4",
98
- "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.4",
99
- "@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.4",
100
- "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.4",
101
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.4",
109
+ "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.6",
110
+ "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.6",
111
+ "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.6",
112
+ "@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.6",
113
+ "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.6",
114
+ "@mininglamp-oss/octo-runtime-host-sdk": "1.1.6",
102
115
  "mdast-util-from-markdown": "2.1.0",
103
116
  "@types/mdast": "4.0.4",
104
117
  "@types/unist": "3.0.3",
@@ -134,12 +147,13 @@
134
147
  "micromark-util-sanitize-uri": "2.0.1",
135
148
  "micromark-util-decode-string": "2.0.1",
136
149
  "unist-util-stringify-position": "4.0.0",
137
- "@mininglamp-oss/octo-runtime-cross-service": "1.1.4",
138
- "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.4",
139
- "@mininglamp-oss/octo-runtime-cli": "1.1.4",
150
+ "@mininglamp-oss/octo-runtime-cross-service": "1.1.6",
151
+ "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.6",
152
+ "@mininglamp-oss/octo-runtime-cli": "1.1.6",
140
153
  "json5": "2.2.3"
141
154
  },
142
155
  "bundleDependencies": [
156
+ "commander",
143
157
  "@mininglamp-oss/octo-runtime-adapter-dsh",
144
158
  "@mininglamp-oss/octo-runtime-adapter-sdk",
145
159
  "@mininglamp-oss/octo-runtime-protocol",
@@ -159,6 +159,20 @@
159
159
  "type": "integer",
160
160
  "minimum": 0
161
161
  },
162
+ "recovery": {
163
+ "type": "object",
164
+ "additionalProperties": false,
165
+ "required": ["trigger", "stage", "code", "occurred_at"],
166
+ "properties": {
167
+ "trigger": { "enum": ["exit", "error", "heartbeat", "ipc"] },
168
+ "stage": { "enum": ["cleanup", "manifest", "starting", "backoff"] },
169
+ "code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,95}$" },
170
+ "occurred_at": { "type": "string", "format": "date-time" },
171
+ "retry_at": { "type": "string", "format": "date-time" },
172
+ "exit_code": { "type": "integer" },
173
+ "signal": { "type": "string", "pattern": "^SIG[A-Z0-9]+$" }
174
+ }
175
+ },
162
176
  "state": {
163
177
  "enum": ["starting", "ready", "recovering", "stopped", "exhausted"]
164
178
  }
@@ -1,16 +0,0 @@
1
- import { isAbsolute } from "node:path";
2
- // 官方 Client 用 Node 启动 dshBin;execve 保留其拥有的 PID 和 stdio,交给 Electron 解析 asar。
3
- // 不创建代理进程,也不读取、编码或转发 JSON-RPC。此入口只用于 macOS Desktop。
4
- const binary = process.env.OCTO_DSH_DESKTOP_BINARY;
5
- const entry = process.env.OCTO_DSH_DESKTOP_ENTRY;
6
- if (process.platform !== "darwin" || !binary || !entry || !isAbsolute(binary) || !isAbsolute(entry))
7
- throw new Error("DSH_CONFIG_INVALID: invalid Desktop launch paths");
8
- if (!process.execve)
9
- throw new Error("DSH_START_FAILED: Desktop requires Node execve support");
10
- const env = { ...process.env };
11
- delete env.OCTO_DSH_DESKTOP_BINARY;
12
- delete env.OCTO_DSH_DESKTOP_ENTRY;
13
- process.execve(binary, [binary, entry, ...process.argv.slice(2)], {
14
- ...env,
15
- ELECTRON_RUN_AS_NODE: "1"
16
- });
@@ -1,15 +0,0 @@
1
- /** Cleanup contract for explicitly configured external native executables. */
2
- export interface CleanupResult {
3
- complete: boolean;
4
- processExited: boolean;
5
- pendingResources: string[];
6
- errors: {
7
- code: string;
8
- component: string;
9
- }[];
10
- }
11
- export declare class ComponentStartError extends Error {
12
- readonly cleanup: CleanupResult;
13
- constructor(cause: unknown, cleanup: CleanupResult);
14
- }
15
- export declare function deadline<T>(operation: Promise<T>, timeoutMs: number, code: string): Promise<T>;
@@ -1,22 +0,0 @@
1
- export class ComponentStartError extends Error {
2
- cleanup;
3
- constructor(cause, cleanup) {
4
- super(cause instanceof Error ? cause.message : "COMPONENT_START_FAILED", { cause });
5
- this.cleanup = cleanup;
6
- this.name = "ComponentStartError";
7
- }
8
- }
9
- export async function deadline(operation, timeoutMs, code) {
10
- let timer;
11
- try {
12
- return await Promise.race([
13
- operation,
14
- new Promise((_, reject) => {
15
- timer = setTimeout(() => reject(new Error(code)), timeoutMs);
16
- })
17
- ]);
18
- }
19
- finally {
20
- clearTimeout(timer);
21
- }
22
- }
@@ -1,16 +0,0 @@
1
- import { type CleanupResult } from "./launch.js";
2
- export interface NativeComponentOptions {
3
- executable: string;
4
- argv: string[];
5
- cwd: string;
6
- configPath: string;
7
- endpoint: string;
8
- stop: "stdin-json" | "signal";
9
- readiness: "ipc" | "process";
10
- }
11
- /** 原生组件拥有独立进程树,参数始终按 argv 传递,不经过 shell。 */
12
- export declare function startNativeComponent(options: NativeComponentOptions): Promise<{
13
- ownership: "owned";
14
- pid: number;
15
- stop: () => Promise<CleanupResult>;
16
- }>;
@@ -1,160 +0,0 @@
1
- import { spawn } from "node:child_process";
2
- import { randomUUID } from "node:crypto";
3
- import { isAbsolute } from "node:path";
4
- import { once } from "node:events";
5
- import net from "node:net";
6
- import { createProcessCleanup } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-cleanup";
7
- import { readBoundedLines } from "@mininglamp-oss/octo-runtime-adapter-sdk";
8
- import { ComponentStartError, deadline } from "./launch.js";
9
- /** 原生组件拥有独立进程树,参数始终按 argv 传递,不经过 shell。 */
10
- export async function startNativeComponent(options) {
11
- for (const path of [options.executable, options.cwd, options.configPath])
12
- if (!isAbsolute(path))
13
- throw new Error("COMPONENT_PATH_INVALID");
14
- if (options.argv.some((arg) => /^--(?:config|endpoint)(?:=|$)/.test(arg)))
15
- throw new Error("COMPONENT_RESERVED_ARGUMENT");
16
- const child = spawn(options.executable, [...options.argv, "--config", options.configPath, "--endpoint", options.endpoint], {
17
- cwd: options.cwd,
18
- shell: false,
19
- stdio: ["pipe", "pipe", "ignore"],
20
- detached: process.platform !== "win32"
21
- });
22
- const cleanup = createProcessCleanup(child, {
23
- processGroup: process.platform !== "win32",
24
- processTree: true
25
- });
26
- let ack;
27
- child.stdin.on("error", () => ack?.reject(new Error("COMPONENT_INPUT_CLOSED")));
28
- child.on("error", () => ack?.reject(new Error("COMPONENT_EXITED")));
29
- child.once("exit", () => ack?.reject(new Error("COMPONENT_CLEANUP_UNCONFIRMED")));
30
- const stopInput = readBoundedLines(child.stdout, 4096, {
31
- onError: () => { },
32
- onTooLarge: () => { },
33
- onClose: () => { },
34
- onLine(line) {
35
- try {
36
- const value = JSON.parse(line);
37
- if (ack && value.type === "component.stopped" && value.request_id === ack.id) {
38
- if (value.complete === true)
39
- ack.resolve();
40
- else
41
- ack.reject(new Error("COMPONENT_CLEANUP_INCOMPLETE"));
42
- }
43
- }
44
- catch {
45
- /* 原生组件 stdout 不作诊断或业务数据来源。 */
46
- }
47
- }
48
- });
49
- let closing;
50
- const stop = () => (closing ??= (async () => {
51
- const errors = [];
52
- if (child.exitCode === null && child.signalCode === null) {
53
- try {
54
- if (options.stop === "stdin-json") {
55
- const pending = new Promise((resolve, reject) => {
56
- ack = { id: randomUUID(), resolve, reject };
57
- });
58
- void pending.catch(() => undefined);
59
- child.stdin.write(`${JSON.stringify({ type: "component.stop", request_id: ack.id })}\n`);
60
- await deadline(pending, 5000, "COMPONENT_STOP_TIMEOUT");
61
- }
62
- else {
63
- child.kill("SIGTERM");
64
- await deadline(once(child, "exit"), 5000, "COMPONENT_STOP_TIMEOUT");
65
- }
66
- }
67
- catch {
68
- errors.push({ component: options.executable, code: "COMPONENT_CLEANUP_INCOMPLETE" });
69
- }
70
- }
71
- else {
72
- errors.push({ component: options.executable, code: "COMPONENT_CLEANUP_UNCONFIRMED" });
73
- }
74
- try {
75
- await cleanup();
76
- }
77
- catch {
78
- errors.push({ component: options.executable, code: "PROCESS_CLEANUP_INCOMPLETE" });
79
- }
80
- finally {
81
- stopInput();
82
- }
83
- const processExited = child.exitCode !== null || child.signalCode !== null;
84
- return {
85
- complete: !errors.length && processExited,
86
- processExited,
87
- errors,
88
- pendingResources: errors.length ? ["native"] : []
89
- };
90
- })());
91
- try {
92
- await deadline(once(child, "spawn"), 5000, "COMPONENT_START_TIMEOUT");
93
- if (options.readiness === "ipc") {
94
- const until = Date.now() + 30_000;
95
- while (true) {
96
- if (child.exitCode !== null || child.signalCode !== null)
97
- throw new Error("COMPONENT_EXITED");
98
- try {
99
- await nativeStatus(options.endpoint, child.pid);
100
- break;
101
- }
102
- catch (error) {
103
- if (error instanceof Error && error.message === "COMPONENT_IDENTITY_MISMATCH")
104
- throw error;
105
- if (Date.now() >= until)
106
- throw new Error("COMPONENT_START_TIMEOUT", { cause: error });
107
- await new Promise((resolve) => setTimeout(resolve, 100));
108
- }
109
- }
110
- }
111
- }
112
- catch (error) {
113
- throw new ComponentStartError(error, await stop());
114
- }
115
- return { ownership: "owned", pid: child.pid, stop };
116
- }
117
- async function nativeStatus(endpoint, pid) {
118
- await new Promise((resolve, reject) => {
119
- const socket = net.createConnection(endpoint);
120
- const requestId = randomUUID();
121
- let bytes = "";
122
- socket.setTimeout(1000, () => {
123
- socket.destroy();
124
- reject(new Error("COMPONENT_UNAVAILABLE"));
125
- });
126
- socket.on("error", reject);
127
- socket.on("connect", () => socket.write(`${JSON.stringify({ jsonrpc: "2.0", id: requestId, method: "status", params: {} })}\n`));
128
- socket.on("data", (chunk) => {
129
- bytes += chunk.toString();
130
- if (bytes.length > 4096) {
131
- socket.destroy();
132
- reject(new Error("COMPONENT_STATUS_INVALID"));
133
- }
134
- if (bytes.includes("\n")) {
135
- try {
136
- const reply = JSON.parse(bytes.slice(0, bytes.indexOf("\n")));
137
- if (reply.jsonrpc !== "2.0" || reply.id !== requestId || !reply.result)
138
- throw new Error();
139
- if (typeof reply.result !== "object" ||
140
- !("pid" in reply.result) ||
141
- reply.result.pid !== pid) {
142
- socket.destroy();
143
- reject(new Error("COMPONENT_IDENTITY_MISMATCH"));
144
- return;
145
- }
146
- resolve();
147
- }
148
- catch {
149
- reject(new Error("COMPONENT_STATUS_INVALID"));
150
- }
151
- socket.destroy();
152
- }
153
- });
154
- socket.on("end", () => {
155
- if (!bytes.includes("\n"))
156
- reject(new Error("COMPONENT_UNAVAILABLE"));
157
- });
158
- socket.on("close", () => reject(new Error("COMPONENT_UNAVAILABLE")));
159
- });
160
- }