@mininglamp-oss/octo-runtime 1.1.4 → 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.
- package/README.md +61 -37
- package/apps/cli/README.md +58 -22
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/cli-entrypoint.d.ts +2 -0
- package/apps/cli/dist/cli-entrypoint.js +16 -0
- package/apps/cli/dist/command-tree.d.ts +20 -0
- package/apps/cli/dist/command-tree.js +402 -0
- package/apps/cli/dist/extra-command-config.d.ts +4 -0
- package/apps/cli/dist/extra-command-config.js +50 -0
- package/apps/cli/dist/extra-commands.d.ts +15 -0
- package/apps/cli/dist/extra-commands.js +275 -0
- package/apps/cli/dist/extras.js +14 -2
- package/apps/cli/dist/global-extras.d.ts +16 -0
- package/apps/cli/dist/global-extras.js +201 -0
- package/apps/cli/dist/help.d.ts +4 -1
- package/apps/cli/dist/help.js +31 -79
- package/apps/cli/dist/main.d.ts +2 -0
- package/apps/cli/dist/main.js +27 -63
- package/apps/cli/dist/manifest.json +48 -3
- package/apps/cli/dist/module-manifest.d.ts +1 -1
- package/apps/cli/dist/module-manifest.js +3 -2
- package/apps/cli/dist/output.js +13 -2
- package/apps/cli/dist/service-control.js +2 -2
- package/apps/cli/dist/state.js +48 -19
- package/dist/public/channel-gateway-commands.d.ts +1 -0
- package/dist/public/channel-gateway-commands.js +1 -0
- package/dist/public/channel-wecom-commands.d.ts +1 -0
- package/dist/public/channel-wecom-commands.js +1 -0
- package/dist/public/extra.d.ts +1 -0
- package/dist/public/extra.js +1 -0
- package/dist/public/host.d.ts +2 -4
- package/dist/public/host.js +1 -2
- package/dist/public/webui-commands.d.ts +1 -0
- package/dist/public/webui-commands.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- 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/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/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/module-manifest.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +16 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/cli-entrypoint.js +16 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.d.ts +20 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +402 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-command-config.js +50 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.d.ts +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extra-commands.js +275 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +14 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.d.ts +16 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/global-extras.js +201 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.d.ts +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +31 -79
- 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 +27 -63
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +48 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +13 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/service-control.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -19
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +25 -24
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/commands.js +124 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/connection-error.js +44 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +8 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +10 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/commands.js +128 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +9 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/commands.js +51 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +7 -3
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.d.ts +70 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-commands.js +16 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -3
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +8 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1172 -0
- package/node_modules/commander/index.js +21 -0
- package/node_modules/commander/lib/argument.js +147 -0
- package/node_modules/commander/lib/command.js +2790 -0
- package/node_modules/commander/lib/error.js +36 -0
- package/node_modules/commander/lib/help.js +731 -0
- package/node_modules/commander/lib/option.js +377 -0
- package/node_modules/commander/lib/suggestSimilar.js +99 -0
- package/node_modules/commander/package-support.json +19 -0
- package/node_modules/commander/package.json +64 -0
- package/node_modules/commander/typings/index.d.ts +1113 -0
- package/package.json +41 -27
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.d.ts +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/launch.js +0 -22
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/native.d.ts +0 -16
- 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
|
|
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,16 +24,14 @@ 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
|
|
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
|
|
|
@@ -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,
|
|
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
|
|
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://
|
|
63
|
-
"bot_id": "
|
|
64
|
-
"bf_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
|
-
|
|
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
|
|
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
|
|
96
|
-
|
|
|
97
|
-
| `@mininglamp-oss/octo-runtime/host`
|
|
98
|
-
| `@mininglamp-oss/octo-runtime/executor-kernel` | Kernel client, invocation, subscriptions and worker entry
|
|
99
|
-
| `@mininglamp-oss/octo-runtime/executor-core`
|
|
100
|
-
| `@mininglamp-oss/octo-runtime/extra`
|
|
101
|
-
| `@mininglamp-oss/octo-runtime/protocol`
|
|
102
|
-
| `@mininglamp-oss/octo-runtime/extras/*`
|
|
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
|
|
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
|
|
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
|
|
111
|
-
|
|
|
112
|
-
| Read the developer documentation
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
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.
|
package/apps/cli/README.md
CHANGED
|
@@ -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
|
|
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
|
|
17
|
-
octo-runtime
|
|
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
|
|
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
|
|
28
|
-
| restart
|
|
29
|
-
| status
|
|
30
|
-
| stop
|
|
31
|
-
| uninstall
|
|
32
|
-
| run
|
|
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
|
-
|
|
49
|
+
核心配置直接使用参数,无需拼 JSON:
|
|
49
50
|
|
|
50
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -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>;
|