@mininglamp-oss/octo-runtime 1.1.2 → 1.1.4
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 +1 -1
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/help.js +5 -1
- package/apps/cli/dist/main.js +32 -6
- package/apps/cli/dist/manifest.json +5 -0
- package/apps/cli/dist/openclaw.js +32 -8
- package/apps/cli/dist/output.js +3 -0
- package/apps/cli/dist/playboard.d.ts +5 -0
- package/apps/cli/dist/playboard.js +41 -13
- package/dist/public/dsh.d.ts +2 -0
- package/dist/public/dsh.js +1 -0
- package/dist/public/executor-kernel.d.ts +1 -1
- package/dist/public/executor-kernel.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +26 -2
- 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/index.js +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-DYOJCNWF.js +854 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-G5PWGRL5.js +209 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/chunk-UOQRXV3Q.js +340 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +16 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-NOTICE.txt +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-client-LICENSE.txt +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-protocol-LICENSE.txt +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +35 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.d.ts +52 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +306 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +11 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +13 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.d.ts +12 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +2 -1
- 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 +10 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +214 -55
- 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 +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.js +24 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/hourly-log.js +11 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +12 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +30 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/mcp.js +4 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.js +15 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +29 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +5 -5
- 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/help.js +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +32 -6
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/openclaw.js +32 -8
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +41 -13
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -23
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/common.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/common.js +16 -6
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/systemd.js +9 -7
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.d.ts +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/windows-task.js +36 -11
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +7 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +16 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +181 -27
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +9 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +8 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +17 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +57 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +167 -25
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/session-store.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +20 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.d.ts +23 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifact-policy.js +43 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.d.ts +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/delivery/artifacts.js +283 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +15 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -13
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/tool-environment.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/tool-environment.js +5 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/lifecycle/configuration.js +26 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/cards.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/client.js +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/conversations.js +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/files.js +104 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/rules.js +4 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/url.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/api/url.js +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/auth.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +49 -17
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/image-input.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/normalize.js +4 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/wukong.js +10 -7
- 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/application/im-channel.js +141 -16
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/application/session-store.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/index-CXTvRGim.js +74 -0
- 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/extra-config.js +33 -9
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.js +9 -4
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +39 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +76 -7
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +35 -29
- package/packages/octo-runtime-extra-channel-gateway/config-schema.json +57 -1
- package/packages/octo-runtime-protocol/schema/kernel-ipc.schema.json +443 -56
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +357 -37
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/index-DiPc-ipL.js +0 -74
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ The Executor Kernel provides local execution. Channel Gateway and Loop Daemon ar
|
|
|
35
35
|
|
|
36
36
|
## Get Started
|
|
37
37
|
|
|
38
|
-
You need **Node.js 24.x or 26.x
|
|
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
|
|
package/apps/cli/dist/help.js
CHANGED
|
@@ -63,10 +63,12 @@ Commands:
|
|
|
63
63
|
stop Stop this service, preserving its autostart setting
|
|
64
64
|
status Show native service, IPC and component status
|
|
65
65
|
run Run this component in the foreground
|
|
66
|
-
${component === "executor-kernel" ? "" : " logs Tail service status logs (no conversation content)\n"}
|
|
66
|
+
${component === "executor-kernel" ? " recover Acknowledge a blocked orphan cleanup after stopping all orphan tools\n" : " logs Tail service status logs (no conversation content)\n"}
|
|
67
67
|
|
|
68
68
|
Flags: --home <path> --profile <name> --manifest <path> --json --help
|
|
69
|
+
--manifest selects Provider/Extra modules; invocation state stays in --home/run.
|
|
69
70
|
Install: --autostart=true|false
|
|
71
|
+
${component === "executor-kernel" ? "Recover: --acknowledge-orphan-cleanup (retains evidence; refuses a live owner)\n" : ""}
|
|
70
72
|
${component === "executor-kernel" ? "" : "Logs: --lines <1..10000> (default 200) --follow --json (NDJSON)\n"}
|
|
71
73
|
Kernel and Extras have independent services and autostart settings.
|
|
72
74
|
An Extra may start before Kernel and connect when Kernel becomes available.`;
|
|
@@ -76,6 +78,7 @@ Manage the local Agent runtime and independent services.
|
|
|
76
78
|
|
|
77
79
|
Usage:
|
|
78
80
|
octo-runtime executor-kernel uninstall|install|start|restart|stop|status|run
|
|
81
|
+
octo-runtime executor-kernel recover --acknowledge-orphan-cleanup
|
|
79
82
|
octo-runtime <extra-name> uninstall|install|start|restart|stop|status|run
|
|
80
83
|
octo-runtime <extra-name> logs [--lines 200] [--follow] [--json]
|
|
81
84
|
octo-runtime status [--json]
|
|
@@ -87,6 +90,7 @@ octo-runtime extraget <name>
|
|
|
87
90
|
octo-runtime playboard < request.json
|
|
88
91
|
|
|
89
92
|
Flags: --home <path> --profile <name> --manifest <path> --json
|
|
93
|
+
--manifest selects Provider/Extra modules; invocation state stays in --home/run.
|
|
90
94
|
Install: --autostart=true|false (defaults to true)
|
|
91
95
|
Extras: channel-gateway, channel-wecom, webui, or a name saved by extraset.
|
|
92
96
|
Components:
|
package/apps/cli/dist/main.js
CHANGED
|
@@ -4,7 +4,7 @@ import { once } from "node:events";
|
|
|
4
4
|
import { lstat, mkdir } from "node:fs/promises";
|
|
5
5
|
import { join, resolve } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { attachKernel, createKernelService, readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
7
|
+
import { attachKernel, acknowledgeOrphanCleanup, inspectOrphanCleanup, createKernelService, readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
8
8
|
import { componentEndpoint, createExtraService } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
9
9
|
import { getExtra, readExtra, setExtra } from "./extras.js";
|
|
10
10
|
import { cliVersionInfo, helpText } from "./help.js";
|
|
@@ -27,6 +27,9 @@ export async function runCli(args, dependencies = {}) {
|
|
|
27
27
|
let statusOutput;
|
|
28
28
|
try {
|
|
29
29
|
const { flags, positional } = parse(args);
|
|
30
|
+
if (flags["acknowledge-orphan-cleanup"] !== undefined &&
|
|
31
|
+
!(positional[0] === "executor-kernel" && positional[1] === "recover"))
|
|
32
|
+
throw new Error("INVALID_ARGUMENTS");
|
|
30
33
|
if ((flags.lines !== undefined || flags.follow !== undefined) && positional[1] !== "logs")
|
|
31
34
|
throw new Error("INVALID_ARGUMENTS");
|
|
32
35
|
json = Boolean(flags.json);
|
|
@@ -44,6 +47,25 @@ export async function runCli(args, dependencies = {}) {
|
|
|
44
47
|
return 0;
|
|
45
48
|
}
|
|
46
49
|
const home = resolve(flags.home ?? defaultRuntimeHome(dependencies.env, dependencies.platform));
|
|
50
|
+
// 模块清单不决定运行状态位置;前台 Kernel、doctor 和恢复确认共用 Home 下的同一路径。
|
|
51
|
+
const kernelStateDirectory = join(home, "run");
|
|
52
|
+
const kernelInvocationManifest = join(kernelStateDirectory, "kernel-invocations.json");
|
|
53
|
+
// 恢复确认不加载 Provider 或访问服务管理器;原记录继续保留,下一次启动校验摘要后替换。
|
|
54
|
+
if (positional[0] === "executor-kernel" && positional[1] === "recover") {
|
|
55
|
+
context = { component: "executor-kernel", action: "recover", logs: join(home, "logs") };
|
|
56
|
+
if (positional.length !== 2 ||
|
|
57
|
+
flags["acknowledge-orphan-cleanup"] !== "true" ||
|
|
58
|
+
flags.autostart !== undefined)
|
|
59
|
+
throw new Error("INVALID_ARGUMENTS");
|
|
60
|
+
const recovery = await withSetupLock({
|
|
61
|
+
...runtimePaths(home, "default", dependencies.platform),
|
|
62
|
+
setupLock: join(kernelStateDirectory, "executor-kernel.setup.lock")
|
|
63
|
+
}, () => acknowledgeOrphanCleanup(kernelInvocationManifest));
|
|
64
|
+
output(json
|
|
65
|
+
? JSON.stringify(recovery)
|
|
66
|
+
: `Orphan cleanup acknowledged. Evidence: ${recovery.archivePath}\nStart executor-kernel again using the same --home.`);
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
47
69
|
// Route logs before config/module/manager access so offline failures remain diagnosable.
|
|
48
70
|
if (positional[1] === "logs") {
|
|
49
71
|
const extra = positional[0];
|
|
@@ -190,9 +212,10 @@ export async function runCli(args, dependencies = {}) {
|
|
|
190
212
|
const manager = await service.backend.probe();
|
|
191
213
|
const status = await snapshots(componentNames);
|
|
192
214
|
const checks = Object.entries(status).map(([component, value]) => ({ component, ...value }));
|
|
193
|
-
|
|
215
|
+
const recovery = await inspectOrphanCleanup(kernelInvocationManifest);
|
|
216
|
+
publish({ manager, checks, recovery }, `Manager: ${manager.manager} (${manager.supported ? "available" : "unavailable"})\n\n${Object.entries(status)
|
|
194
217
|
.map(([name, value]) => formatStatus(name, value))
|
|
195
|
-
.join("\n\n")}`);
|
|
218
|
+
.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." : ""}`);
|
|
196
219
|
return 0;
|
|
197
220
|
}
|
|
198
221
|
if (positional[0] === "status" && positional.length === 1) {
|
|
@@ -225,7 +248,7 @@ export async function runCli(args, dependencies = {}) {
|
|
|
225
248
|
const config = await readJsonFile(paths.profileConfig);
|
|
226
249
|
handle = createKernelService({
|
|
227
250
|
endpoint,
|
|
228
|
-
stateDirectory:
|
|
251
|
+
stateDirectory: kernelStateDirectory,
|
|
229
252
|
workerEntrypoint: fileURLToPath(new URL("./worker.js", import.meta.url)),
|
|
230
253
|
adapterModules: resolveAdapterModules(manifest),
|
|
231
254
|
adapterConfigurations: readAdapterConfigurations(paths.profileRoot, config?.adapters),
|
|
@@ -444,14 +467,17 @@ function parse(args) {
|
|
|
444
467
|
"version",
|
|
445
468
|
"autostart",
|
|
446
469
|
"lines",
|
|
447
|
-
"follow"
|
|
470
|
+
"follow",
|
|
471
|
+
"acknowledge-orphan-cleanup"
|
|
448
472
|
].includes(match[1]) ||
|
|
449
473
|
Object.hasOwn(flags, match[1]))
|
|
450
474
|
throw new Error("INVALID_ARGUMENTS");
|
|
451
475
|
const key = match[1];
|
|
452
|
-
flags[key] = ["json", "help", "version", "follow"].includes(key)
|
|
476
|
+
flags[key] = ["json", "help", "version", "follow", "acknowledge-orphan-cleanup"].includes(key)
|
|
453
477
|
? "true"
|
|
454
478
|
: (match[2] ?? args[++i]);
|
|
479
|
+
if (key === "acknowledge-orphan-cleanup" && match[2] !== undefined)
|
|
480
|
+
throw new Error("INVALID_ARGUMENTS");
|
|
455
481
|
if (!flags[key] ||
|
|
456
482
|
flags[key].startsWith("--") ||
|
|
457
483
|
(key === "autostart" && !["true", "false"].includes(flags[key])))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { readFile, mkdir, writeFile, rename, lstat, open, rm } from "node:fs/promises";
|
|
2
3
|
import { parseEnv, promisify } from "node:util";
|
|
3
4
|
import { execFile } from "node:child_process";
|
|
4
5
|
import { randomUUID } from "node:crypto";
|
|
@@ -134,8 +135,19 @@ export async function syncCliOpenClawToolEnvironment(runtimeRoot, extras) {
|
|
|
134
135
|
(url.protocol !== "https:" &&
|
|
135
136
|
!(url.protocol === "http:" && ["127.0.0.1", "localhost", "[::1]"].includes(url.hostname))))
|
|
136
137
|
throw new Error("IM_API_URL_INVALID");
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
let end = url.pathname.length;
|
|
139
|
+
while (end > 0 && url.pathname[end - 1] === "/")
|
|
140
|
+
end--;
|
|
141
|
+
url.pathname = url.pathname.slice(0, end).replace(/\/api$/, "");
|
|
142
|
+
// 去掉 /api 后可能露出多重尾斜杠,仍需全部移除,并保留路径内部的分隔符。
|
|
143
|
+
const href = url.href;
|
|
144
|
+
end = href.length;
|
|
145
|
+
while (end > 0 && href[end - 1] === "/")
|
|
146
|
+
end--;
|
|
147
|
+
values = {
|
|
148
|
+
OCTO_BOT_TOKEN: token,
|
|
149
|
+
OCTO_API_BASE_URL: href.slice(0, end)
|
|
150
|
+
};
|
|
139
151
|
}
|
|
140
152
|
if (!values)
|
|
141
153
|
return { written: false, restartRequired: false };
|
|
@@ -149,10 +161,23 @@ export async function syncCliOpenClawToolEnvironment(runtimeRoot, extras) {
|
|
|
149
161
|
throw new Error("OPENCLAW_ENV_DIRECTORY_INVALID");
|
|
150
162
|
let previous = "";
|
|
151
163
|
try {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
const handle = await open(file, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
165
|
+
try {
|
|
166
|
+
// 校验、读取和收紧权限绑定同一目标;拒绝链接,避免检查后重新按路径操作。
|
|
167
|
+
const info = await handle.stat();
|
|
168
|
+
if (!info.isFile())
|
|
169
|
+
throw new Error("OPENCLAW_ENV_FILE_INVALID");
|
|
170
|
+
if (!constants.O_NOFOLLOW) {
|
|
171
|
+
const entry = await lstat(file);
|
|
172
|
+
if (!entry.isFile() || entry.dev !== info.dev || entry.ino !== info.ino)
|
|
173
|
+
throw new Error("OPENCLAW_ENV_FILE_INVALID");
|
|
174
|
+
}
|
|
175
|
+
await handle.chmod(0o600);
|
|
176
|
+
previous = await handle.readFile("utf8");
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
await handle.close();
|
|
180
|
+
}
|
|
156
181
|
}
|
|
157
182
|
catch (error) {
|
|
158
183
|
if (error.code !== "ENOENT")
|
|
@@ -170,7 +195,6 @@ export async function syncCliOpenClawToolEnvironment(runtimeRoot, extras) {
|
|
|
170
195
|
Object.entries(values).some(([key, value]) => after[key] !== value))
|
|
171
196
|
throw new Error("OPENCLAW_ENV_UPDATE_INVALID");
|
|
172
197
|
if (content === previous) {
|
|
173
|
-
await chmod(file, 0o600);
|
|
174
198
|
return { file, written: false, restartRequired: true };
|
|
175
199
|
}
|
|
176
200
|
const temporary = join(origin.openclaw_home, `.octo-env-${randomUUID()}.tmp`);
|
package/apps/cli/dist/output.js
CHANGED
|
@@ -99,6 +99,9 @@ export function describeError(error, fallback = "COMMAND_FAILED") {
|
|
|
99
99
|
KERNEL_UNAVAILABLE: "Kernel is unavailable. Check executor-kernel status; Extras can remain running.",
|
|
100
100
|
INVALID_ARGUMENTS: "Use --help to see the available commands and flags.",
|
|
101
101
|
SETUP_IN_PROGRESS: "Another component lifecycle operation is in progress. Wait for it to finish, then retry.",
|
|
102
|
+
ORPHAN_CLEANUP_INCOMPLETE: "Run doctor with the same --home to inspect the manifest. After stopping all orphan tools, run executor-kernel recover --acknowledge-orphan-cleanup, then start again.",
|
|
103
|
+
ORPHAN_CLEANUP_OWNER_ALIVE: "The original Kernel or worker is still alive or its identity cannot be verified. Stop it safely before acknowledging cleanup.",
|
|
104
|
+
ORPHAN_CLEANUP_NOT_PENDING: "There is no valid incomplete orphan cleanup to acknowledge. Run doctor with the same --home.",
|
|
102
105
|
SERVICE_NOT_INSTALLED: "Run this component's install command, then start it.",
|
|
103
106
|
NOT_INSTALLED: "Run this component's install command, then start it.",
|
|
104
107
|
EXTRA_NOT_REGISTERED: "Save this Extra's declaration with extraset before starting it.",
|
|
@@ -6,4 +6,9 @@ export interface PlayboardOptions {
|
|
|
6
6
|
home?: string;
|
|
7
7
|
profile?: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* CLI 单次执行入口:读取一个 InvokeInput,原生构造并拥有本次临时 Kernel,消费源帧后关闭。
|
|
11
|
+
* 返回执行退出码;关闭失败仍拒绝,并保留已发生的执行错误或非零结果,不能假报清理成功。
|
|
12
|
+
* Home/profile 属于调用者,仅删除本次创建的临时目录,不改变公共 SDK 调用合同。
|
|
13
|
+
*/
|
|
9
14
|
export declare function runPlayboard(options: PlayboardOptions): Promise<number>;
|
|
@@ -9,6 +9,11 @@ import { tmpdir } from "node:os";
|
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { identifyInvokeInput, isHostTerminal, isTerminal } from "@mininglamp-oss/octo-runtime-protocol";
|
|
11
11
|
import { INVOKE_REQUEST_MAX_BYTES } from "@mininglamp-oss/octo-runtime-protocol";
|
|
12
|
+
/**
|
|
13
|
+
* CLI 单次执行入口:读取一个 InvokeInput,原生构造并拥有本次临时 Kernel,消费源帧后关闭。
|
|
14
|
+
* 返回执行退出码;关闭失败仍拒绝,并保留已发生的执行错误或非零结果,不能假报清理成功。
|
|
15
|
+
* Home/profile 属于调用者,仅删除本次创建的临时目录,不改变公共 SDK 调用合同。
|
|
16
|
+
*/
|
|
12
17
|
export async function runPlayboard(options) {
|
|
13
18
|
if (options.input.isTTY) {
|
|
14
19
|
throw new Error("playboard requires a JSON request on stdin; use <<< '...JSON...' or < request.json");
|
|
@@ -46,6 +51,9 @@ export async function runPlayboard(options) {
|
|
|
46
51
|
throw new Error("RUNTIME_CONFIGURATION_NOT_FOUND: request profile differs from --profile");
|
|
47
52
|
input.runMetadata = { ...input.runMetadata, profile };
|
|
48
53
|
const output = options.output ?? writeLine;
|
|
54
|
+
// Unix socket 的路径预算小于普通文件路径;固定短根,避免 TMPDIR 嵌套或中文路径超限。
|
|
55
|
+
// mkdtemp 创建本次独占的 0700 目录;常驻服务仍使用 Runtime Home,Windows 保留命名管道。
|
|
56
|
+
const temporary = await mkdtemp(join(process.platform === "win32" ? tmpdir() : "/tmp", "op-"));
|
|
49
57
|
const controller = new AbortController();
|
|
50
58
|
let interrupted = 0;
|
|
51
59
|
const onInterrupt = () => {
|
|
@@ -64,7 +72,9 @@ export async function runPlayboard(options) {
|
|
|
64
72
|
process.once("SIGINT", onInterrupt);
|
|
65
73
|
process.once("SIGTERM", onTerminate);
|
|
66
74
|
let kernel;
|
|
67
|
-
|
|
75
|
+
let outcome;
|
|
76
|
+
let primaryFailure;
|
|
77
|
+
let cleanupFailure;
|
|
68
78
|
try {
|
|
69
79
|
const paths = runtimePaths(home, profile);
|
|
70
80
|
const manifest = await loadCliManifest(home, options.manifest);
|
|
@@ -101,25 +111,43 @@ export async function runPlayboard(options) {
|
|
|
101
111
|
if (!("kind" in frame) && isTerminal(frame))
|
|
102
112
|
exitCode = frame.type === "run.completed" ? 0 : frame.type === "run.cancelled" ? 130 : 1;
|
|
103
113
|
}
|
|
104
|
-
|
|
114
|
+
outcome = interrupted || exitCode;
|
|
105
115
|
}
|
|
106
116
|
catch (error) {
|
|
107
117
|
if (interrupted)
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
outcome = interrupted;
|
|
119
|
+
else
|
|
120
|
+
primaryFailure = { error };
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
await closeKernel(kernel);
|
|
124
|
+
await rm(temporary, { recursive: true, force: true });
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
cleanupFailure = { error };
|
|
110
128
|
}
|
|
111
129
|
finally {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
130
|
+
if (!options.output)
|
|
131
|
+
process.stdout.removeListener("error", onOutputError);
|
|
132
|
+
process.removeListener("SIGINT", onInterrupt);
|
|
133
|
+
process.removeListener("SIGTERM", onTerminate);
|
|
134
|
+
}
|
|
135
|
+
// 清理之后统一选择结果,避免 finally 的拒绝覆盖主结果。保留两个原始异常对象;
|
|
136
|
+
// 取消/失败已有帧不改写,清理失败仍非零退出,不返回原来的成功码。
|
|
137
|
+
if (cleanupFailure) {
|
|
138
|
+
const cleanupError = cleanupFailure.error;
|
|
139
|
+
const cleanupMessage = cleanupError instanceof Error ? cleanupError.message : String(cleanupError);
|
|
140
|
+
if (primaryFailure) {
|
|
141
|
+
const primary = primaryFailure.error;
|
|
142
|
+
throw new AggregateError([primary, cleanupError], `${primary instanceof Error ? primary.message : String(primary)}; cleanup: ${cleanupMessage}`, { cause: cleanupError });
|
|
121
143
|
}
|
|
144
|
+
if (outcome !== undefined && outcome !== 0)
|
|
145
|
+
throw new AggregateError([cleanupError], `Playboard exited with code ${outcome}; cleanup: ${cleanupMessage}`, { cause: cleanupError });
|
|
146
|
+
throw cleanupError;
|
|
122
147
|
}
|
|
148
|
+
if (primaryFailure)
|
|
149
|
+
throw primaryFailure.error;
|
|
150
|
+
return outcome ?? 1;
|
|
123
151
|
}
|
|
124
152
|
function writeLine(line) {
|
|
125
153
|
return new Promise((resolve, reject) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createDshAdapter, dshAdapter, DshError, DSH_VERSION } from "@mininglamp-oss/octo-runtime-adapter-dsh";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { attachKernel, KernelError, createKernelService, ServiceInitializationError } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
1
|
+
export { attachKernel, KernelError, isInvocationNotSubmitted, createKernelService, ServiceInitializationError } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
2
2
|
export { serveWorker } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
3
3
|
export type { HostedAdapter } from "@mininglamp-oss/octo-runtime-executor-core";
|
|
4
4
|
export type { KernelClient, KernelInvocationRecord, KernelInvocationDrainResult, KernelInvocationLifecycle, KernelService, KernelServiceOptions, KernelServiceStatus, ServiceCleanupResult, ServiceLifecycle, ServicePhase, KernelStatus, LookupKey, RunRef, RunSnapshot } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { attachKernel, KernelError, createKernelService, ServiceInitializationError } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
1
|
+
export { attachKernel, KernelError, isInvocationNotSubmitted, createKernelService, ServiceInitializationError } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
2
2
|
export { serveWorker } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DriverQueue, watchLineLimit } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
|
+
import { DriverQueue, watchLineLimit, mergeProcessEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
2
|
import { INVOKE_REQUEST_MAX_BYTES, resolveStreamLimitPolicy } from "@mininglamp-oss/octo-runtime-protocol";
|
|
3
3
|
import { createProcessCleanup } from "@mininglamp-oss/octo-runtime-adapter-sdk/process-cleanup";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
@@ -326,7 +326,7 @@ export function spawnAcpClient(options) {
|
|
|
326
326
|
const { command, args = [], cwd, env, signal, permissionHandler, onPermissionResponseWritten, onPermissionResponseFailed, streamLimits } = options;
|
|
327
327
|
const child = spawn(command, args, {
|
|
328
328
|
cwd,
|
|
329
|
-
env:
|
|
329
|
+
env: mergeProcessEnvironment(process.env, env ?? {}),
|
|
330
330
|
stdio: ["pipe", "pipe", "pipe"],
|
|
331
331
|
detached: process.platform !== "win32"
|
|
332
332
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-acp-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -2,6 +2,10 @@ import { spawnAcpClient, type AcpUpdate } from "@mininglamp-oss/octo-runtime-acp
|
|
|
2
2
|
import { type AdapterInvocationContext, type CanonicalEvent, type InvokeRequest } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
3
3
|
import { type InteractionResponse } from "@mininglamp-oss/octo-runtime-protocol";
|
|
4
4
|
type JsonRecord = Record<string, unknown>;
|
|
5
|
+
/** 调用已失败但 ACP 传输已成功关闭;清理异常不包装成此类型。 */
|
|
6
|
+
export declare class AcpInvocationError extends Error {
|
|
7
|
+
constructor(cause: unknown);
|
|
8
|
+
}
|
|
5
9
|
export interface AcpAdapterDefinition {
|
|
6
10
|
type: string;
|
|
7
11
|
provider: string;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { acpLoadSessionParams, acpNewSessionParams, acpPromptParams, spawnAcpClient } from "@mininglamp-oss/octo-runtime-acp-client";
|
|
2
2
|
import { initialControlInstructions, actmodeEvidence, AcpApprovalBridge, AcpTurnNormalizer, acpToolTerminalStatus, defineAdapter, invocationEnvironment, invocationMcpServers, assertMcpOptions, normalizeAcpToolUpdate, probeCommand } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
3
3
|
import { canonicalTerminalStatus, contextActmode, providerInputParts } from "@mininglamp-oss/octo-runtime-protocol";
|
|
4
|
+
/** 调用已失败但 ACP 传输已成功关闭;清理异常不包装成此类型。 */
|
|
5
|
+
export class AcpInvocationError extends Error {
|
|
6
|
+
constructor(cause) {
|
|
7
|
+
super(cause instanceof Error ? cause.message : String(cause), { cause });
|
|
8
|
+
this.name = "AcpInvocationError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
4
11
|
/** 只使用 Provider 发布的模式 ID;不从产品名称、审批档位或正文猜测。 */
|
|
5
12
|
export function acpActmodeSelectionRequest(session, sessionId, requested) {
|
|
6
13
|
const option = arrayField(session, "configOptions")
|
|
@@ -128,7 +135,13 @@ export function normalizeAcpUpdate(update, provider) {
|
|
|
128
135
|
{
|
|
129
136
|
protocolVersion: 2,
|
|
130
137
|
type: "usage.update",
|
|
131
|
-
payload: {
|
|
138
|
+
payload: {
|
|
139
|
+
...update.usage,
|
|
140
|
+
...(update.used !== undefined ? { used: update.used } : {}),
|
|
141
|
+
...(update.size !== undefined ? { size: update.size } : {}),
|
|
142
|
+
...(update.cost !== undefined ? { cost: update.cost } : {}),
|
|
143
|
+
...(update.model !== undefined ? { model: update.model } : {})
|
|
144
|
+
}
|
|
132
145
|
}
|
|
133
146
|
];
|
|
134
147
|
}
|
|
@@ -198,6 +211,8 @@ export function createAcpAdapter(definition, { acpClientFactory = spawnAcpClient
|
|
|
198
211
|
bridge.bindTransport(() => client.close());
|
|
199
212
|
let sessionId;
|
|
200
213
|
let terminal = false;
|
|
214
|
+
let invocationFailed = false;
|
|
215
|
+
let invocationError;
|
|
201
216
|
let forceCloseTimer;
|
|
202
217
|
const abort = () => {
|
|
203
218
|
if (sessionId)
|
|
@@ -432,7 +447,8 @@ export function createAcpAdapter(definition, { acpClientFactory = spawnAcpClient
|
|
|
432
447
|
};
|
|
433
448
|
}
|
|
434
449
|
else {
|
|
435
|
-
|
|
450
|
+
invocationFailed = true;
|
|
451
|
+
invocationError = error;
|
|
436
452
|
}
|
|
437
453
|
}
|
|
438
454
|
finally {
|
|
@@ -441,6 +457,14 @@ export function createAcpAdapter(definition, { acpClientFactory = spawnAcpClient
|
|
|
441
457
|
clearTimeout(forceCloseTimer);
|
|
442
458
|
await client.close();
|
|
443
459
|
}
|
|
460
|
+
if (invocationFailed) {
|
|
461
|
+
// 有明确错误码的容量等结构化错误保留原对象;普通内建子类仍交给适配器归一化。
|
|
462
|
+
if (invocationError instanceof Error &&
|
|
463
|
+
"code" in invocationError &&
|
|
464
|
+
(typeof invocationError.code === "string" || typeof invocationError.code === "number"))
|
|
465
|
+
throw invocationError;
|
|
466
|
+
throw new AcpInvocationError(invocationError);
|
|
467
|
+
}
|
|
444
468
|
}
|
|
445
469
|
}
|
|
446
470
|
function contentText(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-acp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.4",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-antigravity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-claude-code",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
10
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.4",
|
|
10
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { invocationEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
|
+
import { invocationEnvironment, mergeProcessEnvironment, processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
2
|
import { codexMcpConfig } from "./mcp.js";
|
|
3
3
|
/**
|
|
4
4
|
* Assembly entry point for the Codex adapter.
|
|
@@ -25,12 +25,12 @@ export { buildCodexAppServerArgs, CodexEventNormalizer, CodexAppServerProcessErr
|
|
|
25
25
|
export function buildCodexCommand(req, command = "codex", appServerArgs = buildCodexAppServerArgs(), env = process.env) {
|
|
26
26
|
const runEnv = invocationEnvironment(req, {}, env);
|
|
27
27
|
const mcp = codexMcpConfig(req, runEnv);
|
|
28
|
-
const realHome = runEnv
|
|
28
|
+
const realHome = processEnvironmentValue(runEnv, "CODEX_HOME") || join(homedir(), ".codex");
|
|
29
29
|
return {
|
|
30
30
|
command,
|
|
31
31
|
args: [...appServerArgs, ...nativeCapacityOverrides(req)],
|
|
32
32
|
cwd: req.workdir,
|
|
33
|
-
env:
|
|
33
|
+
env: mergeProcessEnvironment(runEnv, mcp.env, { CODEX_HOME: realHome }),
|
|
34
34
|
...(Object.keys(mcp.servers).length ? { mcpServers: mcp.servers } : {}),
|
|
35
35
|
cleanup: () => undefined
|
|
36
36
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-codex",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|