@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.
- package/README.md +2 -2
- package/apps/cli/README.md +1 -1
- package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.d.ts → apps/cli/dist/adapter-configuration.d.ts} +1 -0
- package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.js → apps/cli/dist/adapter-configuration.js} +1 -0
- package/apps/cli/dist/adapter-configurations.d.ts +1 -1
- package/apps/cli/dist/adapter-configurations.js +1 -1
- package/apps/cli/dist/adapters.d.ts +7 -0
- package/apps/cli/dist/adapters.js +77 -0
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/command-tree.js +2 -3
- package/apps/cli/dist/extras.js +11 -1
- package/apps/cli/dist/help.js +1 -1
- package/apps/cli/dist/index.js +18 -1
- package/apps/cli/dist/main.d.ts +2 -0
- package/apps/cli/dist/main.js +67 -34
- package/apps/cli/dist/manifest.json +0 -5
- package/apps/cli/dist/module-manifest.js +21 -3
- package/apps/cli/dist/output.d.ts +19 -1
- package/apps/cli/dist/output.js +180 -33
- package/apps/cli/dist/playboard-interrupt.d.ts +6 -0
- package/apps/cli/dist/playboard-interrupt.js +86 -0
- package/apps/cli/dist/playboard.d.ts +2 -0
- package/apps/cli/dist/playboard.js +10 -11
- package/apps/cli/dist/state.d.ts +5 -2
- package/apps/cli/dist/state.js +48 -13
- package/dist/public/codex.d.ts +1 -0
- package/dist/public/codex.js +1 -0
- package/dist/public/executor-kernel.d.ts +4 -1
- package/dist/public/executor-kernel.js +2 -1
- package/dist/public/extra.d.ts +1 -1
- package/dist/public/host.d.ts +5 -0
- package/dist/public/host.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +20 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +68 -253
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +11 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +198 -52
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.d.ts +58 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.js +650 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.d.ts +25 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.js +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +12 -30
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.js +125 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +77 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +2 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +11 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +18 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +67 -34
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +21 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.d.ts +19 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +180 -33
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.js +86 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +10 -11
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.d.ts +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -13
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -24
- package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.d.ts +30 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.js +199 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.js +465 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.js +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.js +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.d.ts +59 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.js +287 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.d.ts +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.js +138 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.d.ts +8 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.js +65 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.d.ts +82 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.js +371 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.js +23 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.d.ts +72 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +54 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-configuration-fixtures.json +1219 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-fixtures.json +5988 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-client.behavior.json +56 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc-fixtures.json +53 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc.schema.json +538 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/native-invoke-fixtures.json +116 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +4525 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/run-protocol-fixtures.json +761 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/runtime-selection-fixtures.json +663 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/session-name-fixtures.json +191 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +29 -21
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +173 -14
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +1 -30
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +2 -199
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.d.ts +1 -8
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -444
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/endpoint.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.d.ts +17 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.js +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.d.ts +11 -9
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +14 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +5 -7
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +6 -7
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.d.ts +1 -53
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.js +2 -280
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +14 -13
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +84 -187
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.d.ts +5 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.js +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.d.ts +20 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.js +180 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -8
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +75 -45
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.d.ts +9 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +60 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.js +18 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +1 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +2 -23
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.d.ts +2 -72
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.js +2 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -12
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/ports.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/ports.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/{index-BVxePruX.js → index-BLMf2Etg.js} +1 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +12 -5
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.js +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.d.ts +44 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.js +207 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +23 -3
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.d.ts +27 -4
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +133 -25
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.d.ts +10 -3
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.js +18 -4
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.d.ts +5 -6
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.js +33 -45
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/identity.js +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +5 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/adapter-metadata.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +19 -15
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.js +65 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +33 -29
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +42 -36
- package/apps/cli/dist/worker.js +0 -18
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.d.ts +0 -63
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.js +0 -846
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +0 -54
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +0 -154
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +0 -18
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +0 -16
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +0 -59
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +0 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +0 -88
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +0 -42
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +0 -292
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +0 -64
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +0 -674
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.d.ts +0 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +0 -96
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +0 -279
- /package/{apps/cli/dist/worker.d.ts → node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.js} +0 -0
- /package/node_modules/@mininglamp-oss/{octo-runtime-cli/dist/worker.d.ts → octo-runtime-protocol/dist/adapter-metadata.js} +0 -0
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ 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,
|
|
18
|
+
Adapters ship for Codex, Claude Code, CodeBuddy, OpenCode, DeepSeek Harness, OpenClaw, Grok Build, Antigravity, 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
19
|
|
|
20
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.
|
|
21
21
|
|
|
@@ -95,7 +95,7 @@ octo-runtime channel-gateway extraset <<< '{
|
|
|
95
95
|
|
|
96
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
97
|
|
|
98
|
-
Both methods save configuration without starting or reloading services. Configuration is saved under your Runtime Home, normally `~/.octo-runtime`
|
|
98
|
+
Both methods save configuration without starting or reloading services. Configuration is saved under your Runtime Home, normally `~/.octo-runtime` on every supported platform. 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).
|
|
99
99
|
|
|
100
100
|
### 3. Start
|
|
101
101
|
|
package/apps/cli/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Gateway 的 cardDeliveries、Gateway/WeCom 的 deliveries 仅展示当前保留
|
|
|
42
42
|
|
|
43
43
|
status/doctor/服务操作默认输出便于阅读的文本,`--json` 输出缩进 JSON。status 仍查询每个已配置 Extra 自身的状态,文本展示业务健康、Bot 与任务等计数,完整公开数据保留在 JSON 中。旧版解析 status JSON 的脚本须添加 --json。extraget 仍输出完整紧凑 JSON,playboard 仍输出 NDJSON。文本错误写 stderr;--json 错误写 stdout,包含稳定错误码、组件、动作和日志位置,均须检查退出码。
|
|
44
44
|
|
|
45
|
-
服务名包含规范化 Home 的 SHA-256 前 16 位及组件名。POSIX
|
|
45
|
+
服务名包含规范化 Home 的 SHA-256 前 16 位及组件名。POSIX Kernel 端点准确为 `<home>/executor-kernel.sock`,Extra 状态控制端点继续在 Home/sockets 下;Windows 保留 Home hash 命名管道。不同 Home 和组件不共用服务 ID。这是破坏性地址变更:停止旧进程,同步更新 Kernel、客户端与 Extra 后重启。
|
|
46
46
|
|
|
47
47
|
## Extra 配置(常用)
|
|
48
48
|
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { AdapterProbeOptions } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
/** CLI 读取 profile 配置和凭据引用,返回配置值;Kernel 不读取这些文件或路径。 */
|
|
2
3
|
export declare function readAdapterConfigurations(profileRoot: string, adaptersValue: unknown): Record<string, AdapterProbeOptions>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync, realpathSync } from "node:fs";
|
|
2
2
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
3
3
|
import { resolveStreamLimitPolicy } from "@mininglamp-oss/octo-runtime-protocol";
|
|
4
|
+
/** CLI 读取 profile 配置和凭据引用,返回配置值;Kernel 不读取这些文件或路径。 */
|
|
4
5
|
export function readAdapterConfigurations(profileRoot, adaptersValue) {
|
|
5
6
|
const adapters = objectValue(adaptersValue);
|
|
6
7
|
const connections = { openclaw: { providerOptions: { OPENCLAW_RUNTIME_ROOT: profileRoot } } };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { readAdapterConfigurations } from "./adapter-configuration.js";
|
|
1
2
|
import type { ModuleManifest } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
2
|
-
import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
3
3
|
/** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
|
|
4
4
|
export declare function readCliAdapterConfigurations(profileRoot: string, adapters: unknown, manifest: ModuleManifest, env?: NodeJS.ProcessEnv): Promise<ReturnType<typeof readAdapterConfigurations>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { readAdapterConfigurations } from "./adapter-configuration.js";
|
|
1
2
|
import { constants } from "node:fs";
|
|
2
3
|
import { access, lstat, readFile, realpath, stat } from "node:fs/promises";
|
|
3
4
|
import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
5
|
import { processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
5
|
-
import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
6
6
|
/** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
|
|
7
7
|
export async function readCliAdapterConfigurations(profileRoot, adapters, manifest, env = process.env) {
|
|
8
8
|
const configurations = readAdapterConfigurations(profileRoot, adapters);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AdapterModuleEntry } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
2
|
+
import type { HostedAdapter } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
3
|
+
/** CLI 只加载所选模块并构造实例;Kernel 不接触清单、模块路径或产品准备。 */
|
|
4
|
+
export declare function loadCliAdapters(entries: readonly AdapterModuleEntry[], options?: {
|
|
5
|
+
profileRoot: string;
|
|
6
|
+
syncOpenClawTools: boolean;
|
|
7
|
+
}): Promise<HostedAdapter[]>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { resolveModuleSpecifier } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
2
|
+
import { withStartupContext } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
3
|
+
import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
/** CLI 只加载所选模块并构造实例;Kernel 不接触清单、模块路径或产品准备。 */
|
|
6
|
+
export async function loadCliAdapters(entries, options) {
|
|
7
|
+
const adapters = [];
|
|
8
|
+
// 解析也在诊断边界内;仍先解析整个所选集合,再导入/构造,保持 CLI 原顺序。
|
|
9
|
+
const selected = entries.map((entry) => {
|
|
10
|
+
try {
|
|
11
|
+
return { entry, specifier: resolveModuleSpecifier(entry.module, entry.sourceManifest) };
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw adapterStartupFailure(error, entry);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
for (const { entry, specifier } of selected) {
|
|
18
|
+
try {
|
|
19
|
+
const loaded = await import(specifier);
|
|
20
|
+
const exports = asRecord(loaded, `adapter module ${entry.module}`);
|
|
21
|
+
const exported = exports[entry.export];
|
|
22
|
+
if (exported === undefined)
|
|
23
|
+
throw new Error(`missing export ${entry.export} from ${entry.module}`);
|
|
24
|
+
// 动态模块先校验工厂与 Adapter 形状,再交给唯一 Core 注册;不提前探测未选模块。
|
|
25
|
+
const instance = entry.factory ? callFactory(exported, entry) : exported;
|
|
26
|
+
if (!isHostedAdapter(instance))
|
|
27
|
+
throw new TypeError(`${entry.module}#${entry.export} is not an Octo Runtime adapter`);
|
|
28
|
+
if (entry.type && instance.metadata.type !== entry.type)
|
|
29
|
+
throw new Error(`manifest type ${entry.type} does not match adapter ${instance.metadata.type}`);
|
|
30
|
+
adapters.push(instance);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw adapterStartupFailure(error, entry);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (options && adapters.some((adapter) => adapter.metadata.type === "openclaw")) {
|
|
37
|
+
const { initializeCliOpenClaw, syncCliOpenClawToolEnvironment } = await import("./openclaw.js");
|
|
38
|
+
await initializeCliOpenClaw(options.profileRoot);
|
|
39
|
+
if (options.syncOpenClawTools)
|
|
40
|
+
await syncCliOpenClawToolEnvironment(options.profileRoot, await readExtraDirectory(join(dirname(options.profileRoot), "extras")));
|
|
41
|
+
}
|
|
42
|
+
return adapters;
|
|
43
|
+
}
|
|
44
|
+
function adapterStartupFailure(error, entry) {
|
|
45
|
+
return withStartupContext(error, {
|
|
46
|
+
component: "cli",
|
|
47
|
+
phase: "created",
|
|
48
|
+
context: {
|
|
49
|
+
module: entry.module,
|
|
50
|
+
resource: "adapter-module",
|
|
51
|
+
operation: "assemble-adapter",
|
|
52
|
+
configKey: "adapters"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function callFactory(value, entry) {
|
|
57
|
+
if (typeof value !== "function")
|
|
58
|
+
throw new TypeError(`${entry.module}#${entry.export} is marked as a factory but is not callable`);
|
|
59
|
+
return value(entry.options);
|
|
60
|
+
}
|
|
61
|
+
function isHostedAdapter(value) {
|
|
62
|
+
if (!isRecord(value) || !isRecord(value.metadata))
|
|
63
|
+
return false;
|
|
64
|
+
return (typeof value.metadata.type === "string" &&
|
|
65
|
+
Array.isArray(value.metadata.agentSources) &&
|
|
66
|
+
value.metadata.agentSources.length > 0 &&
|
|
67
|
+
value.metadata.agentSources.every((source) => source === "preset" || source === "provisioned") &&
|
|
68
|
+
typeof value.invoke === "function");
|
|
69
|
+
}
|
|
70
|
+
function asRecord(value, label) {
|
|
71
|
+
if (!isRecord(value))
|
|
72
|
+
throw new TypeError(`${label} must be an object`);
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
function isRecord(value) {
|
|
76
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
77
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Command, CommanderError, Option } from "commander";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
2
|
import { cliHelpHeader, lifecycleCommands, preferredRootCommands, rootCommands } from "./help.js";
|
|
4
3
|
import { loadCliManifest } from "./module-manifest.js";
|
|
5
4
|
import { loadExtraCommands, validateCommands } from "./extra-commands.js";
|
|
6
|
-
import {
|
|
5
|
+
import { selectRuntimeHome } from "./state.js";
|
|
7
6
|
const hostStrings = new Set(["home", "manifest", "profile"]);
|
|
8
7
|
const hostBooleans = new Set(["help", "json", "version", "follow"]);
|
|
9
8
|
const commandExamples = new WeakMap();
|
|
@@ -203,7 +202,7 @@ export async function parseCliCommand(raw, dependencies) {
|
|
|
203
202
|
const globalArgs = [...hostStrings].flatMap((key) => selected[key] ? [`--${key}=${selected[key]}`] : []);
|
|
204
203
|
return parseCliCommand([...globalArgs, ...(target ? [target, name] : []), "--help"], dependencies);
|
|
205
204
|
}
|
|
206
|
-
const home =
|
|
205
|
+
const home = selectRuntimeHome(selected.home, dependencies.env, dependencies.platform);
|
|
207
206
|
const isExtra = Boolean(name && !rootCommands.has(name));
|
|
208
207
|
const offline = isExtra && lifecycleCommands.has(operands[1]);
|
|
209
208
|
const needsDirectory = !selected.version && (!name || (isExtra && !offline));
|
package/apps/cli/dist/extras.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { withStartupContext } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
2
3
|
import { resolveExtraModule } from "./global-extras.js";
|
|
3
4
|
import { assertExtraName, assertStoredExtra, readStoredExtra } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
4
5
|
import { withSetupLock, writeJsonAtomic } from "./state.js";
|
|
@@ -54,7 +55,16 @@ export async function readExtra(paths, name, manifest) {
|
|
|
54
55
|
catch (error) {
|
|
55
56
|
if (error instanceof Error && error.message === "EXTRA_NAME_MISMATCH")
|
|
56
57
|
throw error;
|
|
57
|
-
throw new Error("EXTRA_MODULE_LOAD_FAILED", { cause: error })
|
|
58
|
+
throw withStartupContext(new Error("EXTRA_MODULE_LOAD_FAILED", { cause: error }), {
|
|
59
|
+
component: name,
|
|
60
|
+
phase: "created",
|
|
61
|
+
context: {
|
|
62
|
+
module: entry.module,
|
|
63
|
+
resource: "extra-module",
|
|
64
|
+
operation: "import",
|
|
65
|
+
configKey: "module"
|
|
66
|
+
}
|
|
67
|
+
});
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
};
|
package/apps/cli/dist/help.js
CHANGED
|
@@ -44,7 +44,7 @@ export const lifecycleCommands = new Map([
|
|
|
44
44
|
export const rootCommands = new Map([
|
|
45
45
|
["adapter", "List and probe execution adapters"],
|
|
46
46
|
["doctor", "Diagnose the local runtime"],
|
|
47
|
-
["executor-kernel", "Manage
|
|
47
|
+
["executor-kernel", "Manage native Agent execution and local RPC"],
|
|
48
48
|
["extraget", "Read a complete service configuration (advanced)"],
|
|
49
49
|
["extraset", "Replace a complete service configuration from JSON (advanced)"],
|
|
50
50
|
["help", "Help about any command"],
|
package/apps/cli/dist/index.js
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { runCli } from "./main.js";
|
|
3
|
+
import { installPlayboardInterrupt } from "./playboard-interrupt.js";
|
|
4
|
+
import { describeError, formatErrorDetails } from "./output.js";
|
|
5
|
+
import { safeStartupValue } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
3
6
|
let componentRun = false;
|
|
4
7
|
try {
|
|
5
8
|
process.exitCode = await runCli(process.argv.slice(2), {
|
|
9
|
+
onPlayboardRun: () => {
|
|
10
|
+
installPlayboardInterrupt();
|
|
11
|
+
},
|
|
6
12
|
onComponentRun: () => {
|
|
7
13
|
componentRun = true;
|
|
8
14
|
}
|
|
9
15
|
});
|
|
10
16
|
}
|
|
11
17
|
catch (error) {
|
|
12
|
-
|
|
18
|
+
const failure = describeError(error);
|
|
19
|
+
// Playboard 的执行/交互与清理失败沿原执行域展示,不能被标成组件启动失败。
|
|
20
|
+
if (!failure.diagnostic)
|
|
21
|
+
console.error(`Error: ${safeStartupValue(error instanceof Error ? error.message : String(error))}`);
|
|
22
|
+
else {
|
|
23
|
+
const args = process.argv.slice(2);
|
|
24
|
+
const literal = args.indexOf("--");
|
|
25
|
+
if ((literal < 0 ? args : args.slice(0, literal)).some((arg) => arg === "--json" || arg.startsWith("--json=")))
|
|
26
|
+
console.log(JSON.stringify({ error: failure }));
|
|
27
|
+
else
|
|
28
|
+
console.error(`Error: ${formatErrorDetails(failure)}`);
|
|
29
|
+
}
|
|
13
30
|
process.exitCode = 1;
|
|
14
31
|
}
|
|
15
32
|
finally {
|
package/apps/cli/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ServiceControlOptions } from "./service-control.js";
|
|
2
2
|
export interface CliDependencies extends ServiceControlOptions {
|
|
3
|
+
/** 参数确认后通知可执行入口接管 Playboard 信号;可导入调用方默认保留协作取消。 */
|
|
4
|
+
onPlayboardRun?: () => void;
|
|
3
5
|
env?: NodeJS.ProcessEnv;
|
|
4
6
|
input?: NodeJS.ReadableStream;
|
|
5
7
|
output?: (line: string) => void;
|
package/apps/cli/dist/main.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
+
import { loadCliAdapters } from "./adapters.js";
|
|
1
2
|
import { runExtraCommand, commandError } from "./extra-commands.js";
|
|
2
3
|
import net from "node:net";
|
|
3
4
|
import { randomUUID } from "node:crypto";
|
|
4
5
|
import { once } from "node:events";
|
|
5
|
-
import { lstat
|
|
6
|
+
import { lstat } from "node:fs/promises";
|
|
6
7
|
import { join, resolve } from "node:path";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { componentEndpoint, createExtraService } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
8
|
+
import { attachKernel, acknowledgeOrphanCleanup, inspectOrphanCleanup, createKernelService, safeStartupValue } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
9
|
+
import { componentEndpoint, createExtraService, validateRuntimeHome, RuntimeHomeError } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
10
10
|
import { getExtra, readExtra, setExtra } from "./extras.js";
|
|
11
11
|
import { cliVersionInfo } from "./help.js";
|
|
12
12
|
import { parseCliCommand } from "./command-tree.js";
|
|
13
13
|
import { runForegroundService } from "./foreground.js";
|
|
14
14
|
import { showExtraLogs } from "./logs.js";
|
|
15
15
|
import { StatusOutput } from "./status-output.js";
|
|
16
|
-
import {
|
|
16
|
+
import { selectRuntimeHome, prepareRuntimeHome, runtimePaths, withSetupLock, readJsonFile } from "./state.js";
|
|
17
17
|
import { resolveServiceControl } from "./service-control.js";
|
|
18
18
|
import { loadCliManifest } from "./module-manifest.js";
|
|
19
19
|
import { readCliAdapterConfigurations } from "./adapter-configurations.js";
|
|
20
|
-
import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
21
20
|
import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
22
|
-
import { describeError, formatStatus, recordStartupFailure, readStartupFailure } from "./output.js";
|
|
21
|
+
import { describeError, formatErrorDetails, formatStatus, residentProcesses, formatResidentProcesses, recordStartupFailure, readStartupFailure } from "./output.js";
|
|
23
22
|
const components = ["executor-kernel", "channel-gateway"];
|
|
24
23
|
const builtinComponents = [...components, "channel-wecom", "webui"];
|
|
25
24
|
export async function runCli(args, dependencies = {}) {
|
|
@@ -28,6 +27,12 @@ export async function runCli(args, dependencies = {}) {
|
|
|
28
27
|
const literalIndex = args.indexOf("--");
|
|
29
28
|
let json = (literalIndex < 0 ? args : args.slice(0, literalIndex)).some((arg) => arg === "--json" || arg.startsWith("--json="));
|
|
30
29
|
let context = {};
|
|
30
|
+
// 实际日志 IO 仍使用原路径;失败输出的附带元信息与 diagnostic 使用同一净化。
|
|
31
|
+
const failureContext = () => ({
|
|
32
|
+
component: context.component === undefined ? undefined : safeStartupValue(context.component, 128),
|
|
33
|
+
action: context.action === undefined ? undefined : safeStartupValue(context.action, 128),
|
|
34
|
+
logs: context.logs === undefined ? undefined : safeStartupValue(context.logs)
|
|
35
|
+
});
|
|
31
36
|
let runningComponent;
|
|
32
37
|
let statusOutput;
|
|
33
38
|
try {
|
|
@@ -37,6 +42,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
37
42
|
return 0;
|
|
38
43
|
}
|
|
39
44
|
const { flags, positional } = parsed;
|
|
45
|
+
context = { component: positional[0], action: positional[1] };
|
|
40
46
|
json = Boolean(flags.json);
|
|
41
47
|
if (parsed.extra)
|
|
42
48
|
return await runExtraCommand(parsed, dependencies);
|
|
@@ -50,7 +56,18 @@ export async function runCli(args, dependencies = {}) {
|
|
|
50
56
|
output(cliVersionInfo);
|
|
51
57
|
return 0;
|
|
52
58
|
}
|
|
53
|
-
const home =
|
|
59
|
+
const home = selectRuntimeHome(flags.home, dependencies.env, dependencies.platform);
|
|
60
|
+
// 先验证已存在的根,避免普通文件先退化成配置读取 ENOTDIR。
|
|
61
|
+
// 缺失根只由后面已确认的宿主动作准备;未知/已移除命令不能因此创建 Home。
|
|
62
|
+
if (["install", "start", "restart", "run"].includes(positional[1])) {
|
|
63
|
+
try {
|
|
64
|
+
validateRuntimeHome(home);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (!(error instanceof RuntimeHomeError && error.code === "HOME_NOT_FOUND"))
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
54
71
|
// 模块清单不决定运行状态位置;前台 Kernel、doctor 和恢复确认共用 Home 下的同一路径。
|
|
55
72
|
const kernelStateDirectory = join(home, "run");
|
|
56
73
|
const kernelInvocationManifest = join(kernelStateDirectory, "kernel-invocations.json");
|
|
@@ -115,7 +132,8 @@ export async function runCli(args, dependencies = {}) {
|
|
|
115
132
|
const root = await readJsonFile(runtimePaths(home, "default").rootConfig);
|
|
116
133
|
const profile = flags.profile ?? root?.default_profile ?? "default";
|
|
117
134
|
const paths = runtimePaths(home, profile, dependencies.platform);
|
|
118
|
-
|
|
135
|
+
// 配置/恢复和 Playboard 不使用常驻端点;只在实际连接或托管常驻服务时派生并校验。
|
|
136
|
+
const kernelEndpoint = () => componentEndpoint(home, "executor-kernel", dependencies.platform);
|
|
119
137
|
context = { component: positional[0], action: positional[1], logs: join(home, "logs") };
|
|
120
138
|
const registrations = await readExtraDirectory(join(home, "extras"));
|
|
121
139
|
// 部署、停止及配置修复命令不启动模块,也不因尚未可读的启动清单而无法操作。
|
|
@@ -179,6 +197,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
179
197
|
return 0;
|
|
180
198
|
}
|
|
181
199
|
if (positional[0] === "playboard" && positional.length === 1) {
|
|
200
|
+
dependencies.onPlayboardRun?.();
|
|
182
201
|
const { runPlayboard } = await import("./playboard.js");
|
|
183
202
|
return runPlayboard({
|
|
184
203
|
home,
|
|
@@ -186,11 +205,12 @@ export async function runCli(args, dependencies = {}) {
|
|
|
186
205
|
manifest: flags.manifest,
|
|
187
206
|
input,
|
|
188
207
|
output: dependencies.output,
|
|
189
|
-
env: dependencies.env
|
|
208
|
+
env: dependencies.env,
|
|
209
|
+
handleSignals: !dependencies.onPlayboardRun
|
|
190
210
|
});
|
|
191
211
|
}
|
|
192
212
|
if (positional[0] === "adapter" && positional[1] === "list" && positional.length === 2) {
|
|
193
|
-
const client = attachKernel({ endpoint });
|
|
213
|
+
const client = attachKernel({ endpoint: kernelEndpoint() });
|
|
194
214
|
try {
|
|
195
215
|
publish(await client.list());
|
|
196
216
|
}
|
|
@@ -200,7 +220,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
200
220
|
return 0;
|
|
201
221
|
}
|
|
202
222
|
if (positional[0] === "adapter" && positional[1] === "probe" && positional.length === 3) {
|
|
203
|
-
const client = attachKernel({ endpoint });
|
|
223
|
+
const client = attachKernel({ endpoint: kernelEndpoint() });
|
|
204
224
|
try {
|
|
205
225
|
const adapter = (await client.list()).find((value) => value.type === positional[2]);
|
|
206
226
|
if (!adapter)
|
|
@@ -217,9 +237,10 @@ export async function runCli(args, dependencies = {}) {
|
|
|
217
237
|
const status = await snapshots(componentNames);
|
|
218
238
|
const checks = Object.entries(status).map(([component, value]) => ({ component, ...value }));
|
|
219
239
|
const recovery = await inspectOrphanCleanup(kernelInvocationManifest);
|
|
220
|
-
|
|
240
|
+
const processes = residentProcesses(status);
|
|
241
|
+
publish({ manager, checks, recovery, processes }, `Manager: ${manager.manager} (${manager.supported ? "available" : "unavailable"})\n\n${Object.entries(status)
|
|
221
242
|
.map(([name, value]) => formatStatus(name, value))
|
|
222
|
-
.join("\n\n")}\n\nOrphan cleanup: ${recovery.state}\nManifest: ${recovery.manifestPath}${recovery.state === "cleanup_incomplete" ? "\nStop all orphan tools, then run executor-kernel recover --acknowledge-orphan-cleanup with the same --home." : ""}`);
|
|
243
|
+
.join("\n\n")}\n\n${formatResidentProcesses(processes)}\n\nOrphan cleanup: ${recovery.state}\nManifest: ${recovery.manifestPath}${recovery.state === "cleanup_incomplete" ? "\nStop all orphan tools, then run executor-kernel recover --acknowledge-orphan-cleanup with the same --home." : ""}`);
|
|
223
244
|
return 0;
|
|
224
245
|
}
|
|
225
246
|
if (positional[0] === "status" && positional.length === 1) {
|
|
@@ -236,6 +257,8 @@ export async function runCli(args, dependencies = {}) {
|
|
|
236
257
|
throw new Error("INVALID_ARGUMENTS");
|
|
237
258
|
if (flags.autostart !== undefined && action !== "install")
|
|
238
259
|
throw new Error("INVALID_ARGUMENTS");
|
|
260
|
+
if (["install", "start", "restart", "run"].includes(action))
|
|
261
|
+
componentEndpoint(home, component, dependencies.platform);
|
|
239
262
|
if (action === "status") {
|
|
240
263
|
const status = await snapshots([component]);
|
|
241
264
|
publish(status[component], formatStatus(component, status[component]));
|
|
@@ -246,27 +269,24 @@ export async function runCli(args, dependencies = {}) {
|
|
|
246
269
|
throw new Error("MANIFEST_INVALID");
|
|
247
270
|
runningComponent = component;
|
|
248
271
|
dependencies.onComponentRun?.();
|
|
249
|
-
await
|
|
272
|
+
await prepareRuntimeHome(home);
|
|
250
273
|
let handle;
|
|
251
274
|
if (component === "executor-kernel") {
|
|
252
275
|
const config = await readJsonFile(paths.profileConfig);
|
|
253
276
|
handle = createKernelService({
|
|
277
|
+
home,
|
|
254
278
|
logging: { directory: join(home, "logs") },
|
|
255
|
-
endpoint,
|
|
279
|
+
endpoint: kernelEndpoint(),
|
|
256
280
|
stateDirectory: kernelStateDirectory,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
OCTO_RUNTIME_HOME: home,
|
|
263
|
-
OCTO_RUNTIME_CLI_PROFILE_ROOT: paths.profileRoot,
|
|
264
|
-
OCTO_RUNTIME_CLI_SYNC_OPENCLAW_TOOLS: "1",
|
|
265
|
-
OCTO_RUNTIME_LOGS_DIRECTORY: join(home, "logs")
|
|
266
|
-
}
|
|
281
|
+
adapters: await loadCliAdapters(manifest.adapters, {
|
|
282
|
+
profileRoot: paths.profileRoot,
|
|
283
|
+
syncOpenClawTools: true
|
|
284
|
+
}),
|
|
285
|
+
adapterConfigurations: await readCliAdapterConfigurations(paths.profileRoot, config?.adapters, manifest, dependencies.env ?? process.env)
|
|
267
286
|
});
|
|
268
287
|
}
|
|
269
288
|
else {
|
|
289
|
+
// CLI 的 Gateway 等 Extra 独立托管;ExtraService 内部 attach 已有 Kernel,不创建执行内核。
|
|
270
290
|
const registration = await readExtra(paths, component, manifest);
|
|
271
291
|
const module = registration.enabled === false
|
|
272
292
|
? { name: registration.name, default: () => () => { } }
|
|
@@ -276,6 +296,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
276
296
|
if (!dependencies.output)
|
|
277
297
|
statusOutput = new StatusOutput(process.stdout);
|
|
278
298
|
handle = createExtraService({
|
|
299
|
+
home,
|
|
279
300
|
logging: {
|
|
280
301
|
directory: join(home, "logs"),
|
|
281
302
|
statusOutput: dependencies.output
|
|
@@ -286,7 +307,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
286
307
|
config: registration.config,
|
|
287
308
|
dependencies: {},
|
|
288
309
|
enabled: registration.enabled,
|
|
289
|
-
endpoint,
|
|
310
|
+
endpoint: kernelEndpoint(),
|
|
290
311
|
controlEndpoint: componentEndpoint(home, component, dependencies.platform)
|
|
291
312
|
});
|
|
292
313
|
}
|
|
@@ -296,13 +317,16 @@ export async function runCli(args, dependencies = {}) {
|
|
|
296
317
|
}
|
|
297
318
|
finally {
|
|
298
319
|
const failure = {
|
|
299
|
-
...describeError(error, "SERVICE_INITIALIZATION_FAILED"
|
|
300
|
-
|
|
320
|
+
...describeError(error, "SERVICE_INITIALIZATION_FAILED", {
|
|
321
|
+
component,
|
|
322
|
+
phase: "initializing"
|
|
323
|
+
}),
|
|
324
|
+
...failureContext()
|
|
301
325
|
};
|
|
302
326
|
if (json)
|
|
303
327
|
publish({ error: failure });
|
|
304
328
|
else
|
|
305
|
-
(dependencies.errorOutput ?? ((line) => process.stderr.write(`${line}\n`)))(`${component}: ${failure.code}${failure.cause_code ? ` (${failure.cause_code})` : ""}\n${failure
|
|
329
|
+
(dependencies.errorOutput ?? ((line) => process.stderr.write(`${line}\n`)))(`${component}: ${failure.code}${failure.cause_code ? ` (${failure.cause_code})` : ""}\n${formatErrorDetails(failure)}\nLogs: ${failure.logs}`);
|
|
306
330
|
}
|
|
307
331
|
});
|
|
308
332
|
}
|
|
@@ -315,7 +339,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
315
339
|
return await withSetupLock({ ...paths, setupLock: join(home, "run", `${component}.setup.lock`) }, async () => {
|
|
316
340
|
if (action === "install") {
|
|
317
341
|
spec = { ...spec, enabled: flags.autostart !== "false" };
|
|
318
|
-
await
|
|
342
|
+
await prepareRuntimeHome(home);
|
|
319
343
|
await service.backend.install(spec);
|
|
320
344
|
}
|
|
321
345
|
else {
|
|
@@ -325,7 +349,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
325
349
|
const progress = dependencies.errorOutput ?? ((line) => process.stderr.write(`${line}\n`));
|
|
326
350
|
progress(`${component}: service not installed; installing with autostart enabled...`);
|
|
327
351
|
spec = { ...spec, enabled: true };
|
|
328
|
-
await
|
|
352
|
+
await prepareRuntimeHome(home);
|
|
329
353
|
await service.backend.install(spec);
|
|
330
354
|
progress(`${component}: installation complete; starting service...`);
|
|
331
355
|
}
|
|
@@ -377,12 +401,21 @@ export async function runCli(args, dependencies = {}) {
|
|
|
377
401
|
catch (error) {
|
|
378
402
|
if (runningComponent && context.logs)
|
|
379
403
|
await recordStartupFailure(context.logs, runningComponent, error);
|
|
380
|
-
const failure = {
|
|
404
|
+
const failure = {
|
|
405
|
+
...(commandError(error) ??
|
|
406
|
+
describeError(error, "COMMAND_FAILED", ["run", "start", "restart", "install"].includes(context.action ?? "")
|
|
407
|
+
? {
|
|
408
|
+
component: context.component ?? "cli",
|
|
409
|
+
phase: runningComponent ? "initializing" : "created"
|
|
410
|
+
}
|
|
411
|
+
: undefined)),
|
|
412
|
+
...failureContext()
|
|
413
|
+
};
|
|
381
414
|
const code = failure.code;
|
|
382
415
|
if (json)
|
|
383
416
|
output(JSON.stringify({ error: failure }, null, context.action === "logs" ? undefined : 2));
|
|
384
417
|
else
|
|
385
|
-
(dependencies.errorOutput ?? ((line) => process.stderr.write(`${line}\n`)))(`${[
|
|
418
|
+
(dependencies.errorOutput ?? ((line) => process.stderr.write(`${line}\n`)))(`${[failure.component, failure.action].filter(Boolean).join(" ") || "octo-runtime"}: ${code}${failure.cause_code ? ` (${failure.cause_code})` : ""}\n${formatErrorDetails(failure)}${failure.logs ? `\nLogs: ${failure.logs}` : ""}`);
|
|
386
419
|
return code === "EXTRA_COMMAND_CANCELLED"
|
|
387
420
|
? 130
|
|
388
421
|
: ["SERVICE_NOT_INSTALLED", "NOT_INSTALLED"].includes(code)
|
|
@@ -61,11 +61,6 @@
|
|
|
61
61
|
"module": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
|
|
62
62
|
"export": "qoderCliCnAdapter"
|
|
63
63
|
},
|
|
64
|
-
{
|
|
65
|
-
"type": "zcode-gui",
|
|
66
|
-
"module": "@mininglamp-oss/octo-runtime-adapter-zcode-gui",
|
|
67
|
-
"export": "zcodeGuiAdapter"
|
|
68
|
-
},
|
|
69
64
|
{
|
|
70
65
|
"type": "antigravity",
|
|
71
66
|
"module": "@mininglamp-oss/octo-runtime-adapter-antigravity",
|
|
@@ -2,11 +2,29 @@ import { join, resolve } from "node:path";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { mergeModuleManifests, readModuleManifest } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
4
4
|
import { discoverGlobalExtras, mergeGlobalExtras } from "./global-extras.js";
|
|
5
|
+
import { withStartupContext } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
5
6
|
/** CLI 独占内置、Home 与全局 Extra 目录;SDK 不扫描,显式清单完全替换。 */
|
|
6
7
|
export async function loadCliManifest(home, override, report = (message) => console.error(message)) {
|
|
8
|
+
const read = async (path, options) => {
|
|
9
|
+
try {
|
|
10
|
+
return await readModuleManifest(path, options);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
throw withStartupContext(error, {
|
|
14
|
+
component: "cli",
|
|
15
|
+
phase: "created",
|
|
16
|
+
context: {
|
|
17
|
+
path,
|
|
18
|
+
resource: "module-manifest",
|
|
19
|
+
operation: "read-manifest",
|
|
20
|
+
configKey: "manifest"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
7
25
|
if (override)
|
|
8
|
-
return
|
|
9
|
-
const builtin = await
|
|
10
|
-
const extension = await
|
|
26
|
+
return read(resolve(override), { legacy: true });
|
|
27
|
+
const builtin = await read(fileURLToPath(new URL("./manifest.json", import.meta.url)));
|
|
28
|
+
const extension = await read(join(home, "manifest.json"), { optional: true });
|
|
11
29
|
return mergeGlobalExtras(mergeModuleManifests(builtin, extension, report), await discoverGlobalExtras(report), report);
|
|
12
30
|
}
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
import type { ServiceStatus } from "@mininglamp-oss/octo-runtime-cross-service";
|
|
2
|
+
import { type StartupLocation } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
2
3
|
export interface ComponentSnapshot {
|
|
3
4
|
service: ServiceStatus;
|
|
4
5
|
runtime: unknown;
|
|
5
6
|
}
|
|
7
|
+
export interface ResidentProcessView {
|
|
8
|
+
pid?: number;
|
|
9
|
+
owner_pid?: number;
|
|
10
|
+
roles: string[];
|
|
11
|
+
state: string;
|
|
12
|
+
observation: string;
|
|
13
|
+
service_id?: string;
|
|
14
|
+
incarnation?: number;
|
|
15
|
+
}
|
|
16
|
+
/** doctor 仅投影已取得的常驻快照;同 PID 合并角色,层级表示所有权而非猜测 OS PPID。 */
|
|
17
|
+
export declare function residentProcesses(snapshots: Record<string, ComponentSnapshot>): ResidentProcessView[];
|
|
18
|
+
export declare function formatResidentProcesses(processes: readonly ResidentProcessView[]): string;
|
|
6
19
|
/** 展示公开状态的摘要,不为输出克隆完整 session/delivery 集合。JSON 模式保留原结果。 */
|
|
7
20
|
export declare function formatStatus(name: string, snapshot: ComponentSnapshot): string;
|
|
8
21
|
/** 只保留受控错误码和管理器元信息;异常正文及任意 stderr 可能含凭据,不能直出。 */
|
|
9
|
-
export declare function describeError(error: unknown, fallback?: string): {
|
|
22
|
+
export declare function describeError(error: unknown, fallback?: string, startup?: StartupLocation): {
|
|
10
23
|
backend?: import("@mininglamp-oss/octo-runtime-cross-service").ServiceBackendKind | undefined;
|
|
11
24
|
command?: string | undefined;
|
|
12
25
|
exit_code?: number | undefined;
|
|
26
|
+
cleanup?: import("@mininglamp-oss/octo-runtime-executor-kernel").ServiceCleanupResult | undefined;
|
|
27
|
+
startup?: import("@mininglamp-oss/octo-runtime-executor-kernel").StartupPathDiagnostic | undefined;
|
|
28
|
+
diagnostic?: import("@mininglamp-oss/octo-runtime-executor-kernel").StartupDiagnostic | undefined;
|
|
13
29
|
cause_code?: string | undefined;
|
|
14
30
|
code: string;
|
|
15
31
|
message: string;
|
|
16
32
|
};
|
|
33
|
+
/** 保留兼容 code/cause_code;共享启动结构决定动态解释与下一步。 */
|
|
34
|
+
export declare function formatErrorDetails(failure: ReturnType<typeof describeError>): string;
|
|
17
35
|
/** 前台启动失败沿既有白名单和小时轮转落盘;不捕获任意进程 stdout/stderr。 */
|
|
18
36
|
export declare function recordStartupFailure(directory: string, component: string, error: unknown): Promise<void>;
|
|
19
37
|
/** 只读本次 start 后的白名单失败事件;每个轮转文件最多读取末尾 64 KiB。 */
|