@mininglamp-oss/octo-runtime 1.1.3 → 1.1.5

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 (214) hide show
  1. package/README.md +62 -38
  2. package/apps/cli/README.md +58 -22
  3. package/apps/cli/dist/build-info.json +2 -2
  4. package/apps/cli/dist/cli-entrypoint.d.ts +2 -0
  5. package/apps/cli/dist/cli-entrypoint.js +16 -0
  6. package/apps/cli/dist/command-tree.d.ts +20 -0
  7. package/apps/cli/dist/command-tree.js +402 -0
  8. package/apps/cli/dist/extra-command-config.d.ts +4 -0
  9. package/apps/cli/dist/extra-command-config.js +50 -0
  10. package/apps/cli/dist/extra-commands.d.ts +15 -0
  11. package/apps/cli/dist/extra-commands.js +275 -0
  12. package/apps/cli/dist/extras.js +14 -2
  13. package/apps/cli/dist/global-extras.d.ts +16 -0
  14. package/apps/cli/dist/global-extras.js +201 -0
  15. package/apps/cli/dist/help.d.ts +4 -1
  16. package/apps/cli/dist/help.js +31 -75
  17. package/apps/cli/dist/main.d.ts +2 -0
  18. package/apps/cli/dist/main.js +53 -63
  19. package/apps/cli/dist/manifest.json +53 -3
  20. package/apps/cli/dist/module-manifest.d.ts +1 -1
  21. package/apps/cli/dist/module-manifest.js +3 -2
  22. package/apps/cli/dist/openclaw.js +32 -8
  23. package/apps/cli/dist/output.js +16 -2
  24. package/apps/cli/dist/playboard.d.ts +5 -0
  25. package/apps/cli/dist/playboard.js +41 -13
  26. package/apps/cli/dist/service-control.js +2 -2
  27. package/apps/cli/dist/state.js +48 -19
  28. package/dist/public/channel-gateway-commands.d.ts +1 -0
  29. package/dist/public/channel-gateway-commands.js +1 -0
  30. package/dist/public/channel-wecom-commands.d.ts +1 -0
  31. package/dist/public/channel-wecom-commands.js +1 -0
  32. package/dist/public/dsh.d.ts +2 -0
  33. package/dist/public/dsh.js +1 -0
  34. package/dist/public/executor-kernel.d.ts +1 -1
  35. package/dist/public/executor-kernel.js +1 -1
  36. package/dist/public/extra.d.ts +1 -0
  37. package/dist/public/extra.js +1 -0
  38. package/dist/public/host.d.ts +2 -4
  39. package/dist/public/host.js +1 -2
  40. package/dist/public/webui-commands.d.ts +1 -0
  41. package/dist/public/webui-commands.js +1 -0
  42. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +2 -2
  43. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +4 -0
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +26 -2
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +3 -3
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  52. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-DYOJCNWF.js +854 -0
  53. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-G5PWGRL5.js +209 -0
  54. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-UOQRXV3Q.js +340 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +1 -0
  56. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +16 -0
  57. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-NOTICE.txt +6 -0
  58. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-client-LICENSE.txt +21 -0
  59. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-protocol-LICENSE.txt +21 -0
  60. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +35 -0
  61. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +14 -0
  62. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +52 -0
  63. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +306 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +11 -0
  65. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +13 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.d.ts +12 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +7 -0
  68. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +15 -0
  69. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +2 -1
  70. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  71. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  72. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  73. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  74. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  75. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +10 -5
  76. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +214 -55
  77. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  78. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  79. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  80. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +3 -0
  81. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.d.ts +4 -0
  82. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.js +24 -2
  83. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/hourly-log.js +11 -3
  84. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +12 -3
  85. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +30 -8
  86. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/mcp.js +4 -3
  87. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.d.ts +6 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +16 -4
  89. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.js +15 -2
  90. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +29 -1
  91. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
  92. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +5 -5
  93. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  94. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  95. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.d.ts +2 -0
  96. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.js +16 -0
  97. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.d.ts +20 -0
  98. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +402 -0
  99. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.d.ts +4 -0
  100. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.js +50 -0
  101. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.d.ts +15 -0
  102. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.js +275 -0
  103. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +14 -2
  104. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.d.ts +16 -0
  105. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.js +201 -0
  106. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.d.ts +4 -1
  107. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +31 -75
  108. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
  109. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +53 -63
  110. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +53 -3
  111. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +1 -1
  112. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +3 -2
  113. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/openclaw.js +32 -8
  114. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +16 -2
  115. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +5 -0
  116. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +41 -13
  117. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/service-control.js +2 -2
  118. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -19
  119. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +25 -23
  120. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/common.d.ts +2 -2
  121. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/common.js +16 -6
  122. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/systemd.js +9 -7
  123. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.d.ts +4 -1
  124. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +36 -11
  125. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  126. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +7 -2
  127. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  128. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +2 -1
  129. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +2 -1
  130. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.js +2 -1
  131. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +16 -1
  132. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +152 -21
  133. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +9 -2
  134. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +8 -0
  135. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +17 -0
  136. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +56 -0
  138. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +170 -28
  139. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +3 -1
  140. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.d.ts +4 -0
  141. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.js +124 -0
  142. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +19 -1
  143. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.d.ts +23 -0
  144. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.js +43 -0
  145. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.d.ts +15 -0
  146. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.js +283 -0
  147. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +2 -0
  148. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +15 -1
  149. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +5 -1
  150. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -13
  151. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/tool-environment.d.ts +1 -1
  152. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/tool-environment.js +5 -3
  153. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +26 -1
  154. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +2 -1
  155. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +1 -0
  156. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +3 -2
  157. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +3 -2
  158. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +4 -0
  159. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +104 -3
  160. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/rules.js +4 -3
  161. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/url.d.ts +2 -0
  162. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/url.js +7 -0
  163. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.d.ts +1 -1
  164. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.js +4 -3
  165. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +9 -0
  166. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +44 -13
  167. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.d.ts +7 -0
  168. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +44 -3
  169. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/image-input.js +2 -1
  170. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +7 -0
  171. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +18 -12
  172. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +10 -6
  173. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/im-channel.js +141 -16
  174. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/session-store.d.ts +3 -1
  175. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.d.ts +4 -0
  176. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.js +128 -0
  177. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +9 -5
  178. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.d.ts +3 -0
  179. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.js +51 -0
  180. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/index-CXTvRGim.js +74 -0
  181. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
  182. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +7 -3
  183. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.d.ts +70 -0
  184. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.js +16 -0
  185. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +33 -9
  186. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.js +9 -4
  187. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -3
  188. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +1 -2
  189. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +8 -4
  190. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +5 -0
  191. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +39 -1
  192. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +76 -7
  193. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  194. package/node_modules/commander/LICENSE +22 -0
  195. package/node_modules/commander/Readme.md +1172 -0
  196. package/node_modules/commander/index.js +21 -0
  197. package/node_modules/commander/lib/argument.js +147 -0
  198. package/node_modules/commander/lib/command.js +2790 -0
  199. package/node_modules/commander/lib/error.js +36 -0
  200. package/node_modules/commander/lib/help.js +731 -0
  201. package/node_modules/commander/lib/option.js +377 -0
  202. package/node_modules/commander/lib/suggestSimilar.js +99 -0
  203. package/node_modules/commander/package-support.json +19 -0
  204. package/node_modules/commander/package.json +64 -0
  205. package/node_modules/commander/typings/index.d.ts +1113 -0
  206. package/package.json +49 -29
  207. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +56 -0
  208. package/packages/octo-runtime-protocol/schema/kernel-ipc.schema.json +443 -56
  209. package/packages/octo-runtime-protocol/schema/protocol.schema.json +357 -37
  210. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/index-DiPc-ipL.js +0 -74
  211. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.d.ts +0 -15
  212. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.js +0 -22
  213. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.d.ts +0 -16
  214. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.js +0 -160
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Octo Runtime brings local Agent execution, messaging integrations and a browser workspace into one npm package. Use the CLI to get running, or embed the SDK in your own application.
6
6
 
7
- [Get Started](#get-started) · [English Docs](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/README.md) · [简体中文](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/README.md)
7
+ [Get Started](#get-started) · [English](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/README.md) | [简体中文](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/README.md)
8
8
 
9
9
  ## What Is Octo Runtime?
10
10
 
@@ -15,6 +15,8 @@ Octo Runtime runs Agent tasks through Provider adapters, so applications can use
15
15
  - **WeCom** connects WeCom Bots to the same execution service.
16
16
  - **WebUI** provides a local browser workspace for conversations and projects.
17
17
 
18
+ Adapters ship for Codex, Claude Code, CodeBuddy, OpenCode, DeepSeek Harness, OpenClaw, Grok Build, Antigravity, ZCode, Hermes, Kimi Code, MCode, and both Qoder CLIs; see [Packages and layers](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/packages/README.md).
19
+
18
20
  The Kernel and each Extra run as independent services. They can start in either order, and stopping one Extra leaves the others running. Your application owns its business data, credentials and conversation history.
19
21
 
20
22
  ## Core Architecture
@@ -22,20 +24,18 @@ The Kernel and each Extra run as independent services. They can start in either
22
24
  ```mermaid
23
25
  flowchart LR
24
26
  IM[Octo IM] <--> Gateway[Channel Gateway]
25
- Loop[Loop control plane] <--> Daemon[Loop Daemon]
26
27
  Gateway <-->|IPC| Kernel[Executor Kernel]
27
- Daemon <-->|IPC| Kernel
28
28
  Other[WebUI / WeCom / SDK clients] <-->|IPC| Kernel
29
29
  Kernel <-->|stdio NDJSON| Worker[Execution worker / AgentExecutor]
30
30
  Worker --> Adapter[Provider adapters]
31
31
  Adapter --> Providers[Codex / Claude Code / OpenClaw / ...]
32
32
  ```
33
33
 
34
- The Executor Kernel provides local execution. Channel Gateway and Loop Daemon are independent clients that connect through IPC; their business logic and lifecycle stay outside the Kernel. Channel Gateway is bundled here. Loop Daemon represents an external Loop integration and is not a built-in CLI component in this repository.
34
+ The Executor Kernel provides local execution. Channel Gateway, WebUI, WeCom, and SDK clients are independent callers that connect over IPC; their business logic and lifecycle stay outside the Kernel. Channel Gateway, WebUI, and WeCom are bundled here. An external control plane can call the same Kernel IPC without being part of this repository.
35
35
 
36
36
  ## Get Started
37
37
 
38
- You need **Node.js 24.x or 26.x (LTS)** and an installed, authenticated Provider. Runtime does not install Provider software or sign in for you.
38
+ You need **Node.js 24.x or 26.x** and an installed, authenticated Provider. This requirement applies to end users running the installed CLI or SDK, not only to the development/build environment. Node.js 22 is unsupported; upgrade to Node.js 24 before installing Runtime. Runtime does not install Provider software or sign in for you.
39
39
 
40
40
  The supported range is `^24.0.0 || ^26.0.0`. Node.js 25 and future majors are outside this range. CI checks installation, build, types, automated tests, and packed CLI/SDK consumption on both supported majors. New LTS majors are added after the same checks pass; support is reviewed at each LTS transition and before a supported major reaches end of life. Removal is announced in release notes before changing the engine range.
41
41
 
@@ -46,33 +46,56 @@ npm install -g @mininglamp-oss/octo-runtime
46
46
  octo-runtime --help
47
47
  ```
48
48
 
49
- Existing users of the deprecated `1.0.1` daemon release must stop and remove the old services, uninstall the old npm package, and follow the [reinstallation guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/DEPLOYMENTS.md#旧版弃用与重新安装) before installing and configuring this architecture.
50
-
51
49
  ### 2. Configure
52
50
 
53
- To use an Octo IM Bot, save its Gateway configuration. Replace the API URL, Bot ID and token with values for your environment. This example uses an authenticated Codex installation; use `claude-code` for Claude Code.
51
+ To use an Octo IM Bot, choose either configuration method below. Replace the API URL, Bot ID, token and absolute workspace path with values for your environment. Both examples use an installed, authenticated Codex Provider; use `claude-code` for Claude Code.
52
+
53
+ #### Option A: configure one Bot
54
+
55
+ `configure` adds a new Bot or updates the matching `bot_id`. It preserves omitted fields and other Bots.
54
56
 
55
57
  ```bash
56
- octo-runtime extraset channel-gateway <<'JSON'
57
- {
58
+ octo-runtime channel-gateway configure \
59
+ --api_url https://im.example.com/api \
60
+ --bot_id '<BOT_ID>' \
61
+ --bf_token '<BOT_TOKEN>' \
62
+ --adapter_type codex \
63
+ --workdir /absolute/workspace \
64
+ --model '<MODEL_ID>' \
65
+ --effort medium
66
+ ```
67
+
68
+ `--model` and `--effort` are optional. On first configuration, omit them to use the selected Harness framework's own defaults; updates preserve existing values when these flags are omitted.
69
+
70
+ #### Option B: save a complete JSON declaration
71
+
72
+ `extraset` replaces the whole declaration. Include every Bot and setting you want to retain; it does not merge by `bot_id` or preserve omitted fields. This `<<<` example works in Bash and Zsh.
73
+
74
+ ```bash
75
+ octo-runtime channel-gateway extraset <<< '{
58
76
  "module": "@mininglamp-oss/octo-runtime-extra-channel-gateway",
77
+ "enabled": true,
59
78
  "config": {
60
79
  "bots": [
61
80
  {
62
- "api_url": "https://YOUR_OCTO_IM_HOST/api",
63
- "bot_id": "YOUR_BOT_ID",
64
- "bf_token": "bf_REPLACE_WITH_REAL_BOT_TOKEN",
81
+ "api_url": "https://im.example.com/api",
82
+ "bot_id": "<BOT_ID>",
83
+ "bf_token": "<BOT_TOKEN>",
65
84
  "adapter": {
66
- "adapter_type": "codex"
85
+ "adapter_type": "codex",
86
+ "workdir": "/absolute/workspace",
87
+ "model": "<MODEL_ID>",
88
+ "effort": "medium"
67
89
  }
68
90
  }
69
91
  ]
70
92
  }
71
- }
72
- JSON
93
+ }'
73
94
  ```
74
95
 
75
- Configuration is saved under your Runtime Home, normally `~/.octo-runtime` (`%LOCALAPPDATA%\OctoRuntime` on Windows). Bot workspaces default to `~/octo-runtime/channels/{bot_id}`. See the [Gateway guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/packages/octo-runtime-extra-channel-gateway/README.md) for multiple Bots, permissions and other Provider settings. For a browser workspace or WeCom, use the [Extra configuration guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/.octospec/guides/extra-configuration.md).
96
+ `model` and `effort` are optional: remove either field to use the selected Harness framework's own default. Replace `<MODEL_ID>` with a model supported by that Harness; supported effort values depend on the Harness. You can also use `octo-runtime channel-gateway extraset < channel-gateway.json` with the same complete JSON in a file. `octo-runtime channel-gateway extraget` returns the complete declaration, including credentials.
97
+
98
+ Both methods save configuration without starting or reloading services. Configuration is saved under your Runtime Home, normally `~/.octo-runtime` (`%LOCALAPPDATA%\OctoRuntime` on Windows). If you omit `workdir`, Gateway defaults to `~/octo-runtime/channels/{bot_id}`. See the [Gateway guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/packages/octo-runtime-extra-channel-gateway/README.md) for multiple Bots, permissions and other Provider settings. For a browser workspace or WeCom, use the [Extra configuration guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/.octospec/guides/extra-configuration.md).
76
99
 
77
100
  ### 3. Start
78
101
 
@@ -86,36 +109,37 @@ Each `start` installs its component's service if needed, enables autostart durin
86
109
 
87
110
  Successful `start` and `restart` commands include the component's current status: service state, autostart, IPC, PID, Worker readiness or Extra business status, and the service definition path. `status` shows the same readable status; use `--json` for formatted JSON. Kernel readiness and Bot connectivity are reported separately. You can now message your Bot in Octo IM.
88
111
 
89
- After changing Gateway configuration, run `octo-runtime channel-gateway restart`. Use `stop` to stop a component or `uninstall` to remove its service while keeping your data. Explicit `install --autostart=false` disables autostart; a plain `install` enables it again. See [CLI commands](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/apps/cli/README.md) for foreground execution and troubleshooting.
112
+ After changing Gateway configuration, run `octo-runtime channel-gateway restart`. Use `stop` to stop a component or `uninstall` to remove its service while keeping your data. Explicit `install --autostart=false` disables autostart; a plain `install` enables it again. See [CLI installation and operations](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/getting-started/cli.md) / [CLI 安装与运维](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/getting-started/cli.md) for commands, Home and profiles, Gateway configuration, and logs, and [Troubleshooting](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/guides/troubleshooting.md) for failures.
90
113
 
91
114
  ## Embed the SDK
92
115
 
93
116
  Applications can construct the Kernel and Extras directly in their own process through the Host SDK, then call `KernelClient.invoke` to run tasks. The Kernel supervises an isolated execution worker. SDK applications choose their own configuration, dependencies and service lifecycle.
94
117
 
95
- | Package Entry | Purpose |
96
- | --- | --- |
97
- | `@mininglamp-oss/octo-runtime/host` | Native Kernel and Extra construction, lifecycle and component endpoints |
98
- | `@mininglamp-oss/octo-runtime/executor-kernel` | Kernel client, invocation, subscriptions and worker entry |
99
- | `@mininglamp-oss/octo-runtime/executor-core` | Explicit execution inside the current process |
100
- | `@mininglamp-oss/octo-runtime/extra` | Extra plugin lifecycle and public types |
101
- | `@mininglamp-oss/octo-runtime/protocol` | Execution inputs, events and validation |
102
- | `@mininglamp-oss/octo-runtime/extras/*` | Built-in Extra modules and configuration schemas |
118
+ | Package Entry | Purpose |
119
+ | ---------------------------------------------- | ----------------------------------------------------------------------- |
120
+ | `@mininglamp-oss/octo-runtime/host` | Native Kernel and Extra construction, lifecycle and component endpoints |
121
+ | `@mininglamp-oss/octo-runtime/executor-kernel` | Kernel client, invocation, subscriptions and worker entry |
122
+ | `@mininglamp-oss/octo-runtime/executor-core` | Explicit execution inside the current process |
123
+ | `@mininglamp-oss/octo-runtime/extra` | Extra plugin lifecycle and public types |
124
+ | `@mininglamp-oss/octo-runtime/protocol` | Execution inputs, events and validation |
125
+ | `@mininglamp-oss/octo-runtime/extras/*` | Built-in Extra modules and configuration schemas |
103
126
 
104
- Follow the [SDK integration guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/SDK_NATIVE_INTEGRATION_FULL_GUIDE.md) or the [SDK Gateway guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/SDK_CHANNEL_GATEWAY_GUIDE.md). Desktop applications use the SDK directly. `octo-cli`, the Octo business API tool, is a separate program from `octo-runtime`.
127
+ Follow [Your First SDK Invocation](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/getting-started/sdk.md) and [Extras](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/guides/extras.md) for host composition. Desktop applications use the SDK directly. `octo-cli`, the Octo business API tool, is a separate program from `octo-runtime`.
105
128
 
106
129
  ## Documentation
107
130
 
108
- The developer documentation covers architecture, your first SDK call, Kernel IPC, inputs, Context types, MCP, interaction and troubleshooting. Both languages share runnable examples and Mermaid architecture diagrams.
131
+ The developer documentation covers architecture, your first SDK call, CLI operations, Kernel IPC, inputs, Context types, MCP, interaction and troubleshooting, in English and Chinese with shared runnable examples and diagrams. The Chinese `SDK_*` guides keep host-specific assembly detail.
109
132
 
110
- | Goal | Guide |
111
- | --- | --- |
112
- | Read the developer documentation | [English](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/README.md) / [简体中文](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/README.md) |
113
- | Configure and operate the CLI | [CLI Usage Guide](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/CLI_USAGE_GUIDE.md) |
114
- | Embed Runtime in an application | [SDK Integration](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/SDK_NATIVE_INTEGRATION_FULL_GUIDE.md) |
115
- | Connect Octo IM from an application | [SDK Channel Gateway](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/SDK_CHANNEL_GATEWAY_GUIDE.md) |
116
- | Install, package or replace an old release | [Deployments](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/DEPLOYMENTS.md) |
117
- | Understand architecture and ownership | [Architecture Rules](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/.octospec/rules/architecture.md) |
118
- | Contribute changes | [Contributing](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/CONTRIBUTING.md) |
133
+ | Goal | Guide |
134
+ | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
135
+ | Read the developer documentation | [English](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/README.md) / [简体中文](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/README.md) |
136
+ | Install, run, and operate the CLI | [English](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/getting-started/cli.md) / [简体中文](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/getting-started/cli.md) |
137
+ | Choose an integration path (CLI, SDK, public entries) | [INTEGRATION.md (中文)](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/INTEGRATION.md) |
138
+ | Embed Runtime in an application | [English](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/en/getting-started/sdk.md) / [简体中文](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/docs/zh-CN/getting-started/sdk.md) |
139
+ | Connect Octo IM from an application | [SDK Channel Gateway](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/SDK_CHANNEL_GATEWAY_GUIDE.md) |
140
+ | Install, package or replace an old release | [Deployments](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/DEPLOYMENTS.md) |
141
+ | Understand architecture and ownership | [Architecture Rules](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/.octospec/rules/architecture.md) |
142
+ | Contribute changes | [Contributing](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/CONTRIBUTING.md) |
119
143
 
120
144
  ## Development
121
145
 
@@ -137,4 +161,4 @@ Automated fixture tests do not replace real Provider, IM or native service-manag
137
161
 
138
162
  ## License
139
163
 
140
- [Apache License 2.0](LICENSE). Copyright 2026 Mininglamp Technology.
164
+ [Apache License 2.0](https://github.com/Mininglamp-OSS/octo-runtime/blob/main/LICENSE). Copyright 2026 Mininglamp Technology.
@@ -2,7 +2,7 @@
2
2
 
3
3
  CLI 是 Host SDK 的一个宿主,负责自己的 JSON 配置与原生用户服务。桌面或其他 HostApp 使用 SDK 接入。
4
4
 
5
- 模块由 CLI 内置 `manifest.json` 与所选 Home 的 `manifest.json` 合并选择,均含 `adapters` 和 `extras`。默认发行全量;未启动 Extra 不导入,清单不保存业务凭据或启用设置。条目以原始清单文件为解析锚点,同名内置优先;显式 `--manifest` 完整替换两份默认来源。SDK 原生 import,不读取这些文件。双语说明见 [English](../../docs/en/concepts/module-loading.md) / [简体中文](../../docs/zh-CN/concepts/module-loading.md)。
5
+ 模块由 CLI 内置 `manifest.json` 与所选 Home 的 `manifest.json` 合并选择,均含 `adapters` 和 `extras`。默认发行全量;未启动 Extra 不导入,清单不保存业务凭据或启用设置。条目以原始清单文件为解析锚点,同名内置优先;Extra 还可从当前 CLI 同一 npm/pnpm 全局安装环境自动发现,优先级为内置 > Home > 全局;显式 `--manifest` 完整替换所有默认来源。SDK 原生 import,不读取这些文件。双语说明见 [English](../../docs/en/concepts/module-loading.md) / [简体中文](../../docs/zh-CN/concepts/module-loading.md)。
6
6
 
7
7
  ## 命令
8
8
 
@@ -13,23 +13,24 @@ octo-runtime status [--json]
13
13
  octo-runtime doctor
14
14
  octo-runtime adapter list
15
15
  octo-runtime adapter probe <type>
16
- octo-runtime extraset <name> < config.json
17
- octo-runtime extraget <name>
16
+ octo-runtime <extra-name> configure [options]
17
+ octo-runtime <extra-name> extraset < declaration.json
18
+ octo-runtime <extra-name> extraget
18
19
  octo-runtime playboard < request.json
19
20
  ```
20
21
 
21
- 通用参数:`--home PATH`、`--profile NAME`、`--manifest PATH`、`--json`。裸组件命令显示帮助,也可使用 `octo-runtime executor-kernel --help`。Extra 名称可为 channel-gateway、channel-wecom、webui 或 extraset 保存的名称。Extra 配置属于 Home,extraset/extraget 不接受 --profile。
22
+ 通用参数:`--home PATH`、`--profile NAME`、`--manifest PATH`、`--json`。裸组件命令显示帮助,也可使用 `octo-runtime executor-kernel --help`。Extra 名称可为 channel-gateway、channel-wecom、webui 或有效模块清单/全局发现中的其他名称。Extra 配置属于 Home,extraset/extraget 不接受 --profile。
22
23
 
23
- | 动作 | 行为 |
24
- | --- | --- |
25
- | install | 注册并启用本组件的自启服务;首次和重复安装都默认开启自启 |
26
- | install --autostart=true/false | 显式修改本组件自启设置 |
27
- | start | 未安装时自动注册本组件并开启自启,随后启动并等待 IPC 就绪;已安装时保留服务设置 |
28
- | restart | 重启已安装并启用的本组件并等待 IPC 就绪;未安装返回 3 |
29
- | status | 查询本组件的服务、IPC 和公开业务状态 |
30
- | stop | 停止本组件,不改变自启设置 |
31
- | uninstall | 停止并移除本组件服务,保留用户数据 |
32
- | run | 前台启动本组件;SIGINT/SIGTERM 时等待清理 |
24
+ | 动作 | 行为 |
25
+ | ------------------------------ | ------------------------------------------------------------------------------- |
26
+ | install | 注册并启用本组件的自启服务;首次和重复安装都默认开启自启 |
27
+ | install --autostart=true/false | 显式修改本组件自启设置 |
28
+ | start | 未安装时自动注册本组件并开启自启,随后启动并等待 IPC 就绪;已安装时保留服务设置 |
29
+ | restart | 重启已安装并启用的本组件并等待 IPC 就绪;未安装返回 3 |
30
+ | status | 查询本组件的服务、IPC 和公开业务状态 |
31
+ | stop | 停止本组件,不改变自启设置 |
32
+ | uninstall | 停止并移除本组件服务,保留用户数据 |
33
+ | run | 前台启动本组件;SIGINT/SIGTERM 时等待清理 |
33
34
 
34
35
  CLI 面向普通用户,install 默认完成本组件自启配置,只有显式 --autostart=false 才禁用;再次执行不带该选项的 install 会恢复自启。组件互不隐式启动。channel-gateway 可以在 Kernel 未运行时独立启动,其状态报告 kernel_available=false;业务连接状态与 Kernel 就绪分别报告。Kernel 与每个 Extra 分别执行 install,默认注册各自的自启服务,自动启动不依赖前后顺序;Kernel 后上线不要求重启 Extra。这些是用户服务,在用户登录或用户 manager 激活时自启。
35
36
 
@@ -43,19 +44,54 @@ status/doctor/服务操作默认输出便于阅读的文本,`--json` 输出缩
43
44
 
44
45
  服务名包含规范化 Home 的 SHA-256 前 16 位及组件名。POSIX 端点在 Home/sockets 下;Windows 使用 Home hash 命名管道。不同 Home 和组件不共用服务 ID。
45
46
 
46
- ## 旧版弃用
47
+ ## Extra 配置(常用)
47
48
 
48
- `1.0.1` 为旧 daemon 架构的 deprecated 版本,不支持从旧 daemon 升级或迁移。已有安装先停止并移除旧服务,再执行 `npm uninstall -g @mininglamp-oss/octo-runtime`,然后安装已发布的新架构版本并重新配置。npm 卸载不会自动移除旧系统服务或 Home;完整步骤见 [部署说明](../../DEPLOYMENTS.md)。
49
+ 核心配置直接使用参数,无需拼 JSON:
49
50
 
50
- ## Extra 配置
51
+ ```sh
52
+ octo-runtime channel-gateway configure \
53
+ --bot_id assistant \
54
+ --api_url https://im.example.com/api \
55
+ --adapter_type codex \
56
+ --workdir /absolute/workspace \
57
+ --bf_token "<BOT_TOKEN>"
51
58
 
52
- ```bash
53
- octo-runtime extraset channel-gateway < gateway.json
54
- octo-runtime channel-gateway restart
55
- octo-runtime extraget channel-gateway
59
+ octo-runtime channel-wecom configure \
60
+ --bot_id assistant \
61
+ --ws_url wss://openws.work.weixin.qq.com \
62
+ --adapter_type codex \
63
+ --workdir /absolute/workspace \
64
+ --app_secret "<APP_SECRET>"
65
+
66
+ octo-runtime webui configure \
67
+ --port 13888
68
+ ```
69
+
70
+ Gateway/WeCom 每次配置一个 Bot:同 bot_id 更新,新 ID 追加到 config.bots,省略字段和其他 Bot 保留;改变地址不新增同 ID。WeCom 省略 ws_url 时更新保留旧地址,新 Bot 使用官方默认。WebUI 只暴露 port,首次会话文件为 `<home>/extras/webui/sessions.json`,已有路径保留。
71
+
72
+ 渠道另支持 `--model`、`--effort`;OpenClaw 使用 `--adapter_type openclaw --provider_agent_id main`,不传 workdir。配置保存不自动启用、启动或重载;首次用 start,已运行服务改配置后用 restart。
73
+
74
+ ```sh
75
+ octo-runtime channel-gateway start
76
+ octo-runtime channel-wecom start
77
+ octo-runtime webui start
56
78
  ```
57
79
 
58
- gateway.json 可使用 `{ "config": { "bots": [] } }`,模块由 manifest 声明。旧 `module` 可保留,但必须与有效清单文字完全一致;自定义 Extra 先加入 Home 清单,冲突明确提示迁移。每次整份替换,保存文件权限为 POSIX 0600。extraset 不打印凭据;extraget 按显式请求返回完整配置,路径写入 stderr。
80
+ 根 `-h` 列出 Extra 名称,`<extra> -h` 查看命令,`<extra> configure -h` 查看参数。全局 --home/--manifest 可放在自有命令前后,不属于 Extra 业务参数。详细说明见 [Extra 自有命令](../../docs/zh-CN/guides/extra-commands.md)。
81
+
82
+ ## 进阶:手动拼 JSON
83
+
84
+ 进阶用法:通过对应 Extra 的 `extraset/extraget` 子命令读写包含 `config`、可选 `module`/`enabled` 的完整 JSON 声明。业务配置操作以该 Extra 自己声明的子命令为准;内置 Extra 不再提供 `config set/get`。
85
+
86
+ ```sh
87
+ octo-runtime channel-gateway extraset \
88
+ < channel-gateway-declaration.json
89
+ octo-runtime channel-gateway extraget
90
+ ```
91
+
92
+ `extraset` 直接替换整份声明,不按 bot_id 合并,也不保留省略字段。读取命令返回完整对应 JSON(渠道含凭据)。保存后仍需重启已运行的 Extra。
93
+
94
+ `channel-gateway-declaration.json` 包含外壳,例如 `{ "config": { "bots": [] } }`。把名称换为 channel-wecom/webui 即可管理对应 Extra。模块通常由 manifest 提供;手写 module 时须与有效清单一致。配置文件保存为 POSIX 0600。
59
95
 
60
96
  ## 临时执行
61
97
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "fe19d350431534da4ed3a76f3466add4ced86d81",
2
+ "commit": "ae7835c168e1e138287c012a6c87517dd2874a5d",
3
3
  "dirty": false,
4
- "buildTime": "2026-10-22T15:06:34.025Z"
4
+ "buildTime": "2026-10-27T08:38:03.037Z"
5
5
  }
@@ -0,0 +1,2 @@
1
+ /** 保留包管理器入口中的安装组路径;只有指向本 CLI 的 argv 才能影响服务部署与发现。 */
2
+ export declare function cliEntrypoint(invocation?: string, installed?: string): string;
@@ -0,0 +1,16 @@
1
+ import { realpathSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ /** 保留包管理器入口中的安装组路径;只有指向本 CLI 的 argv 才能影响服务部署与发现。 */
5
+ export function cliEntrypoint(invocation = process.argv[1], installed = fileURLToPath(new URL("./index.js", import.meta.url))) {
6
+ if (invocation) {
7
+ try {
8
+ if (realpathSync(invocation) === realpathSync(installed))
9
+ return resolve(invocation);
10
+ }
11
+ catch {
12
+ // 库内调用、测试 runner 或已移除的入口不拥有本 CLI 的安装来源。
13
+ }
14
+ }
15
+ return installed;
16
+ }
@@ -0,0 +1,20 @@
1
+ import type { ExtraModuleEntry } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
2
+ import type { ExtraCommand, ExtraCommandInput } from "@mininglamp-oss/octo-runtime-host-sdk";
3
+ import type { CliDependencies } from "./main.js";
4
+ export interface ParsedCliCommand {
5
+ flags: Record<string, string>;
6
+ positional: string[];
7
+ help?: string;
8
+ extra?: {
9
+ entry: ExtraModuleEntry;
10
+ command: ExtraCommand;
11
+ input: ExtraCommandInput;
12
+ home: string;
13
+ };
14
+ }
15
+ /**
16
+ * 两阶段装配:先只解析宿主选择参数,再为有效目录挂载命令。
17
+ * 根帮助不 import Extra;离线服务动作不加载 /commands;所选业务树才递归适配。
18
+ * 本函数只返回调用描述或帮助文本,不运行 handler、不访问服务管理器、不写 Home。
19
+ */
20
+ export declare function parseCliCommand(raw: string[], dependencies: CliDependencies): Promise<ParsedCliCommand>;