@mininglamp-oss/octo-runtime 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/cli/dist/adapter-configurations.d.ts +4 -0
- package/apps/cli/dist/adapter-configurations.js +102 -0
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/command-tree.js +1 -1
- package/apps/cli/dist/logs.js +8 -4
- package/apps/cli/dist/main.js +11 -5
- package/apps/cli/dist/output.js +5 -0
- package/apps/cli/dist/playboard.js +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +5 -2
- 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/dist/index.d.ts +3 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +161 -26
- 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.js +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-G5PWGRL5.js → chunk-3GXX5VD5.js} +24 -90
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-UOQRXV3Q.js → chunk-FWAPYRV2.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-DYOJCNWF.js → chunk-IW62UM3C.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/launch.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/trajectory.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +8 -2
- 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/index.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +8 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +12 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +91 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +13 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +40 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +102 -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 +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +8 -4
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +11 -5
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +24 -24
- 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 +8 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +47 -4
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +79 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +22 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +5 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +12 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +4 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +131 -43
- 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/context-gap.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +33 -17
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/dispatcher.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.d.ts +29 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/model-wait.js +171 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.d.ts +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +48 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/presentation/run-projector.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/contexts.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/reasoning-frame.js +37 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- 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 +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +5 -3
- 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 +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +9 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +27 -27
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/desktop-entry.js +0 -16
|
@@ -15,8 +15,8 @@ parentPort.on("message", (message) => {
|
|
|
15
15
|
try {
|
|
16
16
|
const category = message.extra
|
|
17
17
|
? `${message.extra}${message.status ? "-status" : ""}`
|
|
18
|
-
:
|
|
19
|
-
const key = message.extra ? `extra:${category}` :
|
|
18
|
+
: `kernel${message.status ? "-status" : ""}`;
|
|
19
|
+
const key = message.extra ? `extra:${category}` : category;
|
|
20
20
|
let writer = writers.get(key);
|
|
21
21
|
if (!writer && writers.size < 128) {
|
|
22
22
|
writer = new HourlyLogWriter(message.extra ? join(directory, "extras") : directory, category, { onError: () => { } });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Optional metadata logging; bounded queues isolate filesystem writes in a dedicated worker. */
|
|
2
2
|
import { isAbsolute } from "node:path";
|
|
3
3
|
import { Worker } from "node:worker_threads";
|
|
4
|
-
import { extraStatusRecord } from "./service-status.js";
|
|
4
|
+
import { extraStatusRecord, kernelStatusRecord } from "./service-status.js";
|
|
5
5
|
export const noopRuntimeLog = () => { };
|
|
6
6
|
const strings = new Set([
|
|
7
7
|
"run_id",
|
|
@@ -94,6 +94,18 @@ export class RuntimeLogging {
|
|
|
94
94
|
#write(source, extra, level, event, data) {
|
|
95
95
|
if (this.#closed)
|
|
96
96
|
return;
|
|
97
|
+
if (source === "kernel" && this.#worker && this.#statusPending < 128) {
|
|
98
|
+
try {
|
|
99
|
+
const status = kernelStatusRecord(level, event, data);
|
|
100
|
+
if (status) {
|
|
101
|
+
this.#worker.postMessage({ status: true, line: `${JSON.stringify(status)}\n` });
|
|
102
|
+
this.#statusPending++;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
/* 状态镜像失败不影响执行或普通日志。 */
|
|
107
|
+
}
|
|
108
|
+
}
|
|
97
109
|
if (extra) {
|
|
98
110
|
try {
|
|
99
111
|
const status = extraStatusRecord(extra, level, event, data);
|
|
@@ -7,5 +7,14 @@ export interface ExtraStatusRecord {
|
|
|
7
7
|
event: string;
|
|
8
8
|
data: Record<string, string | number>;
|
|
9
9
|
}
|
|
10
|
+
export interface KernelStatusRecord {
|
|
11
|
+
time: string;
|
|
12
|
+
level: RuntimeLogLevel;
|
|
13
|
+
source: "kernel";
|
|
14
|
+
event: string;
|
|
15
|
+
data: Record<string, string | number>;
|
|
16
|
+
}
|
|
17
|
+
/** Kernel 父进程的监督诊断白名单;读盘时也重建,绝不包含执行正文或原始异常。 */
|
|
18
|
+
export declare function kernelStatusRecord(level: RuntimeLogLevel, event: string, data?: Readonly<Record<string, unknown>>, time?: string): KernelStatusRecord | undefined;
|
|
10
19
|
/** Rebuild status records from a separate allowlist, including when reading persisted files. */
|
|
11
20
|
export declare function extraStatusRecord(extra: string, level: RuntimeLogLevel, event: string, data?: Readonly<Record<string, unknown>>, time?: string): ExtraStatusRecord | undefined;
|
|
@@ -1,3 +1,43 @@
|
|
|
1
|
+
/** Kernel 父进程的监督诊断白名单;读盘时也重建,绝不包含执行正文或原始异常。 */
|
|
2
|
+
export function kernelStatusRecord(level, event, data, time = new Date().toISOString()) {
|
|
3
|
+
if (!["info", "warn", "error"].includes(level) ||
|
|
4
|
+
![
|
|
5
|
+
"worker.ready",
|
|
6
|
+
"worker.lost",
|
|
7
|
+
"worker.recovery_blocked",
|
|
8
|
+
"worker.retry_scheduled",
|
|
9
|
+
"worker.start_failed"
|
|
10
|
+
].includes(event) ||
|
|
11
|
+
!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(time) ||
|
|
12
|
+
!Number.isFinite(Date.parse(time)))
|
|
13
|
+
return;
|
|
14
|
+
const safe = {};
|
|
15
|
+
for (const key of ["code", "signal", "trigger", "stage", "occurred_at", "retry_at"]) {
|
|
16
|
+
const value = data?.[key];
|
|
17
|
+
if (typeof value !== "string")
|
|
18
|
+
continue;
|
|
19
|
+
const valid = key === "code"
|
|
20
|
+
? /^[A-Z][A-Z0-9_]{0,95}$/.test(value)
|
|
21
|
+
: key === "signal"
|
|
22
|
+
? /^SIG[A-Z0-9]+$/.test(value)
|
|
23
|
+
: key === "trigger"
|
|
24
|
+
? ["exit", "error", "heartbeat", "ipc"].includes(value)
|
|
25
|
+
: key === "stage"
|
|
26
|
+
? ["cleanup", "manifest", "starting", "backoff"].includes(value)
|
|
27
|
+
: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value) &&
|
|
28
|
+
Number.isFinite(Date.parse(value));
|
|
29
|
+
if (valid)
|
|
30
|
+
safe[key] = value;
|
|
31
|
+
}
|
|
32
|
+
for (const key of ["pid", "generation", "attempt", "delay_ms", "exit_code"]) {
|
|
33
|
+
const value = data?.[key];
|
|
34
|
+
if (typeof value === "number" &&
|
|
35
|
+
Number.isSafeInteger(value) &&
|
|
36
|
+
(key === "exit_code" || value >= 0))
|
|
37
|
+
safe[key] = value;
|
|
38
|
+
}
|
|
39
|
+
return Object.freeze({ time, level, source: "kernel", event, data: Object.freeze(safe) });
|
|
40
|
+
}
|
|
1
41
|
const events = new Set([
|
|
2
42
|
"service.initializing",
|
|
3
43
|
"service.ready",
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
8
8
|
"./process-cleanup": "./dist/process-cleanup.js",
|
|
9
|
+
"./process-launch": "./dist/process-launch.js",
|
|
9
10
|
"./module-manifest": "./dist/module-manifest.js"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.6",
|
|
13
14
|
"import-meta-resolve": "4.2.0"
|
|
14
15
|
},
|
|
15
16
|
"types": "./dist/index.d.ts",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-zcode-gui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
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.6",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ModuleManifest } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
2
|
+
import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
3
|
+
/** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
|
|
4
|
+
export declare function readCliAdapterConfigurations(profileRoot: string, adapters: unknown, manifest: ModuleManifest, env?: NodeJS.ProcessEnv): Promise<ReturnType<typeof readAdapterConfigurations>>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { access, lstat, readFile, realpath, stat } from "node:fs/promises";
|
|
3
|
+
import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
5
|
+
import { readAdapterConfigurations } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
6
|
+
/** CLI 宿主在创建 Kernel 前补齐 npm DSH 入口;探测与调用共享快照,显式配置始终优先。 */
|
|
7
|
+
export async function readCliAdapterConfigurations(profileRoot, adapters, manifest, env = process.env) {
|
|
8
|
+
const configurations = readAdapterConfigurations(profileRoot, adapters);
|
|
9
|
+
if (configurations.dsh?.providerOptions?.dshBin !== undefined ||
|
|
10
|
+
!manifest.adapters.some((entry) => entry.type === "dsh" || entry.type === undefined))
|
|
11
|
+
return configurations;
|
|
12
|
+
const dshBin = await discoverDshEntry(env);
|
|
13
|
+
if (dshBin)
|
|
14
|
+
configurations.dsh = {
|
|
15
|
+
...configurations.dsh,
|
|
16
|
+
providerOptions: { ...configurations.dsh?.providerOptions, dshBin }
|
|
17
|
+
};
|
|
18
|
+
return configurations;
|
|
19
|
+
}
|
|
20
|
+
async function discoverDshEntry(env) {
|
|
21
|
+
const extensions = process.platform === "win32"
|
|
22
|
+
? (processEnvironmentValue(env, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";")
|
|
23
|
+
: [""];
|
|
24
|
+
for (const directory of (processEnvironmentValue(env, "PATH") ?? "").split(delimiter)) {
|
|
25
|
+
if (!directory)
|
|
26
|
+
continue;
|
|
27
|
+
for (const extension of extensions) {
|
|
28
|
+
const command = resolve(directory, `dsh${extension}`);
|
|
29
|
+
// 只有路径不存在才能继续;lstat 保留损坏链接,首个已存在候选不可因不可用而换安装。
|
|
30
|
+
try {
|
|
31
|
+
await lstat(command);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
const code = error.code;
|
|
35
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
36
|
+
continue;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
await access(command, process.platform === "win32" ? constants.F_OK : constants.X_OK);
|
|
41
|
+
if (!(await stat(command)).isFile())
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// 先固定 PATH 中的命令,再读取安装元数据;不执行 shim,也不因版本不兼容换另一安装。
|
|
48
|
+
return packageEntryForCommand(command);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function packageEntryForCommand(command) {
|
|
53
|
+
let target;
|
|
54
|
+
try {
|
|
55
|
+
target = await realpath(command);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// npm 在 Unix 上使用符号链接;从链接目标向上确认包名,兼容自定义 prefix。
|
|
61
|
+
for (let directory = dirname(target);; directory = dirname(directory)) {
|
|
62
|
+
const entry = await packageEntry(directory);
|
|
63
|
+
if (entry)
|
|
64
|
+
return entry;
|
|
65
|
+
if (directory === dirname(directory))
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
const binDirectory = dirname(command);
|
|
69
|
+
// Windows npm shim、Unix 全局 prefix/bin、以及项目 node_modules/.bin 均只读相邻安装。
|
|
70
|
+
for (const directory of [
|
|
71
|
+
join(binDirectory, "node_modules", "@deepseek-ai", "dsh"),
|
|
72
|
+
join(binDirectory, "..", "lib", "node_modules", "@deepseek-ai", "dsh"),
|
|
73
|
+
join(binDirectory, "..", "@deepseek-ai", "dsh")
|
|
74
|
+
]) {
|
|
75
|
+
const entry = await packageEntry(directory);
|
|
76
|
+
if (entry)
|
|
77
|
+
return entry;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function packageEntry(directory) {
|
|
81
|
+
try {
|
|
82
|
+
const metadata = JSON.parse(await readFile(join(directory, "package.json"), "utf8"));
|
|
83
|
+
if (metadata?.name !== "@deepseek-ai/dsh")
|
|
84
|
+
return;
|
|
85
|
+
const bin = typeof metadata.bin === "string"
|
|
86
|
+
? metadata.bin
|
|
87
|
+
: metadata.bin && typeof metadata.bin === "object"
|
|
88
|
+
? metadata.bin.dsh
|
|
89
|
+
: undefined;
|
|
90
|
+
if (typeof bin !== "string" || !bin.trim() || isAbsolute(bin))
|
|
91
|
+
return;
|
|
92
|
+
const entry = resolve(directory, bin);
|
|
93
|
+
const location = relative(directory, entry);
|
|
94
|
+
if (location === ".." || location.startsWith(`..${sep}`) || isAbsolute(location))
|
|
95
|
+
return;
|
|
96
|
+
// 文件与版本由 Adapter 校验;即使入口缺失,也不能改选 PATH 中的另一安装。
|
|
97
|
+
return entry;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -297,7 +297,7 @@ export async function parseCliCommand(raw, dependencies) {
|
|
|
297
297
|
...(name === "executor-kernel" ? [] : [extrasetExample(name, configExample, module)])
|
|
298
298
|
]);
|
|
299
299
|
for (const [action, summary] of lifecycleCommands) {
|
|
300
|
-
if (name === "executor-kernel" && ["
|
|
300
|
+
if (name === "executor-kernel" && ["extraset", "extraget"].includes(action))
|
|
301
301
|
continue;
|
|
302
302
|
const child = leaf(parent, action, summary);
|
|
303
303
|
const invocation = `${prefix} ${action}`;
|
|
@@ -2,7 +2,7 @@ import { constants } from "node:fs";
|
|
|
2
2
|
import { lstat, open, opendir } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { setTimeout as delay } from "node:timers/promises";
|
|
5
|
-
import { extraStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
5
|
+
import { extraStatusRecord, kernelStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
6
6
|
const MAX_READ = 4 * 1024 * 1024;
|
|
7
7
|
const MAX_LINE = 4096;
|
|
8
8
|
function record(line, extra) {
|
|
@@ -10,6 +10,10 @@ function record(line, extra) {
|
|
|
10
10
|
return;
|
|
11
11
|
try {
|
|
12
12
|
const value = JSON.parse(line);
|
|
13
|
+
if (extra === "executor-kernel")
|
|
14
|
+
return value.source === "kernel" && typeof value.time === "string"
|
|
15
|
+
? kernelStatusRecord(value.level, value.event, value.data, value.time)
|
|
16
|
+
: undefined;
|
|
13
17
|
if (value.source !== "extra" || value.extra_type !== extra || typeof value.time !== "string")
|
|
14
18
|
return;
|
|
15
19
|
return extraStatusRecord(extra, value.level, value.event, value.data, value.time);
|
|
@@ -19,7 +23,7 @@ function record(line, extra) {
|
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
async function files(home, extra) {
|
|
22
|
-
const directory = join(home, "logs", "extras");
|
|
26
|
+
const directory = extra === "executor-kernel" ? join(home, "logs") : join(home, "logs", "extras");
|
|
23
27
|
for (const path of [join(home, "logs"), directory]) {
|
|
24
28
|
try {
|
|
25
29
|
const stat = await lstat(path);
|
|
@@ -32,7 +36,7 @@ async function files(home, extra) {
|
|
|
32
36
|
throw error;
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
|
-
const pattern = new RegExp(`^${extra}-status-\\d{8}T\\d{2}\\.log$`);
|
|
39
|
+
const pattern = new RegExp(`^${extra === "executor-kernel" ? "kernel" : extra}-status-\\d{8}T\\d{2}\\.log$`);
|
|
36
40
|
// Keep only three candidates while scanning, without loading an unbounded directory listing.
|
|
37
41
|
const selected = [];
|
|
38
42
|
let count = 0;
|
|
@@ -88,7 +92,7 @@ export async function showExtraLogs(options) {
|
|
|
88
92
|
const emit = async (value) => {
|
|
89
93
|
const text = options.json
|
|
90
94
|
? JSON.stringify(value)
|
|
91
|
-
: `${value.time} ${value.level.toUpperCase()} ${value.extra_type} ${value.event}${Object.keys(value.data).length ? ` ${JSON.stringify(value.data)}` : ""}`;
|
|
95
|
+
: `${value.time} ${value.level.toUpperCase()} ${value.source === "extra" ? value.extra_type : "executor-kernel"} ${value.event}${Object.keys(value.data).length ? ` ${JSON.stringify(value.data)}` : ""}`;
|
|
92
96
|
await options.output(text, controller.signal);
|
|
93
97
|
};
|
|
94
98
|
try {
|
|
@@ -5,7 +5,7 @@ import { once } from "node:events";
|
|
|
5
5
|
import { lstat, mkdir } from "node:fs/promises";
|
|
6
6
|
import { join, resolve } from "node:path";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { attachKernel, acknowledgeOrphanCleanup, inspectOrphanCleanup, createKernelService
|
|
8
|
+
import { attachKernel, acknowledgeOrphanCleanup, inspectOrphanCleanup, createKernelService } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
9
9
|
import { componentEndpoint, createExtraService } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
10
10
|
import { getExtra, readExtra, setExtra } from "./extras.js";
|
|
11
11
|
import { cliVersionInfo } from "./help.js";
|
|
@@ -16,6 +16,7 @@ import { StatusOutput } from "./status-output.js";
|
|
|
16
16
|
import { defaultRuntimeHome, runtimePaths, withSetupLock, readJsonFile } from "./state.js";
|
|
17
17
|
import { resolveServiceControl } from "./service-control.js";
|
|
18
18
|
import { loadCliManifest } from "./module-manifest.js";
|
|
19
|
+
import { readCliAdapterConfigurations } from "./adapter-configurations.js";
|
|
19
20
|
import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
20
21
|
import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
21
22
|
import { describeError, formatStatus, recordStartupFailure, readStartupFailure } from "./output.js";
|
|
@@ -72,9 +73,12 @@ export async function runCli(args, dependencies = {}) {
|
|
|
72
73
|
// Route logs before config/module/manager access so offline failures remain diagnosable.
|
|
73
74
|
if (positional[1] === "logs") {
|
|
74
75
|
const extra = positional[0];
|
|
75
|
-
context = {
|
|
76
|
+
context = {
|
|
77
|
+
component: extra,
|
|
78
|
+
action: "logs",
|
|
79
|
+
logs: extra === "executor-kernel" ? join(home, "logs") : join(home, "logs", "extras")
|
|
80
|
+
};
|
|
76
81
|
if (positional.length !== 2 ||
|
|
77
|
-
extra === "executor-kernel" ||
|
|
78
82
|
!/^[a-z][a-z0-9-]{0,63}$/.test(extra) ||
|
|
79
83
|
flags.autostart !== undefined)
|
|
80
84
|
throw new Error("INVALID_ARGUMENTS");
|
|
@@ -181,7 +185,8 @@ export async function runCli(args, dependencies = {}) {
|
|
|
181
185
|
profile,
|
|
182
186
|
manifest: flags.manifest,
|
|
183
187
|
input,
|
|
184
|
-
output: dependencies.output
|
|
188
|
+
output: dependencies.output,
|
|
189
|
+
env: dependencies.env
|
|
185
190
|
});
|
|
186
191
|
}
|
|
187
192
|
if (positional[0] === "adapter" && positional[1] === "list" && positional.length === 2) {
|
|
@@ -246,11 +251,12 @@ export async function runCli(args, dependencies = {}) {
|
|
|
246
251
|
if (component === "executor-kernel") {
|
|
247
252
|
const config = await readJsonFile(paths.profileConfig);
|
|
248
253
|
handle = createKernelService({
|
|
254
|
+
logging: { directory: join(home, "logs") },
|
|
249
255
|
endpoint,
|
|
250
256
|
stateDirectory: kernelStateDirectory,
|
|
251
257
|
workerEntrypoint: fileURLToPath(new URL("./worker.js", import.meta.url)),
|
|
252
258
|
adapterModules: resolveAdapterModules(manifest),
|
|
253
|
-
adapterConfigurations:
|
|
259
|
+
adapterConfigurations: await readCliAdapterConfigurations(paths.profileRoot, config?.adapters, manifest, dependencies.env ?? process.env),
|
|
254
260
|
env: {
|
|
255
261
|
...(dependencies.env ?? process.env),
|
|
256
262
|
OCTO_RUNTIME_HOME: home,
|
|
@@ -20,6 +20,11 @@ export function formatStatus(name, snapshot) {
|
|
|
20
20
|
];
|
|
21
21
|
if (runtime.execution_ready !== undefined)
|
|
22
22
|
lines.push(` Worker: ${runtime.execution_ready ? "ready" : "unavailable"}`);
|
|
23
|
+
const recovery = record(record(runtime.worker).recovery);
|
|
24
|
+
if (recovery.code) {
|
|
25
|
+
lines.push(` Recovery: ${text(recovery.stage)} (${text(recovery.code)})${recovery.retry_at ? ` Next retry: ${text(recovery.retry_at)}` : ""}`);
|
|
26
|
+
lines.push(" Diagnostics: octo-runtime executor-kernel logs --follow (use the same --home)");
|
|
27
|
+
}
|
|
23
28
|
if (runtime.available === false)
|
|
24
29
|
lines.push(` Reason: ${text(record(runtime.error).code ?? "COMPONENT_UNAVAILABLE")}`);
|
|
25
30
|
if (service.lastExitCode !== undefined && service.lastExitCode !== 0)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defaultRuntimeHome, runtimePaths, readJsonFile } from "./state.js";
|
|
2
2
|
import { loadCliManifest } from "./module-manifest.js";
|
|
3
|
+
import { readCliAdapterConfigurations } from "./adapter-configurations.js";
|
|
3
4
|
import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
4
|
-
import {
|
|
5
|
+
import { createKernelService } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
6
7
|
import { componentEndpoint } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
7
8
|
import { mkdtemp, rm } from "node:fs/promises";
|
|
@@ -88,7 +89,7 @@ export async function runPlayboard(options) {
|
|
|
88
89
|
OCTO_RUNTIME_CLI_PROFILE_ROOT: paths.profileRoot,
|
|
89
90
|
OCTO_RUNTIME_CLI_SYNC_OPENCLAW_TOOLS: "0"
|
|
90
91
|
},
|
|
91
|
-
adapterConfigurations:
|
|
92
|
+
adapterConfigurations: await readCliAdapterConfigurations(paths.profileRoot, configuration?.adapters, manifest, options.env ?? process.env)
|
|
92
93
|
});
|
|
93
94
|
await kernel.initialize({ signal: controller.signal });
|
|
94
95
|
let exitCode = 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,29 +9,29 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"commander": "15.0.0",
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.6",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
|
|
14
14
|
"json5": "2.2.3",
|
|
15
|
-
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.
|
|
16
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
17
|
-
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.
|
|
18
|
-
"@mininglamp-oss/octo-runtime-cross-service": "1.1.
|
|
19
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
20
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
21
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
22
|
-
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.
|
|
24
|
-
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.
|
|
25
|
-
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.
|
|
26
|
-
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.
|
|
27
|
-
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.
|
|
28
|
-
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.
|
|
29
|
-
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.
|
|
30
|
-
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.
|
|
31
|
-
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.
|
|
32
|
-
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.
|
|
33
|
-
"@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.
|
|
34
|
-
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.
|
|
35
|
-
"@mininglamp-oss/octo-runtime-extra-webui": "1.1.
|
|
15
|
+
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.6",
|
|
16
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.6",
|
|
17
|
+
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.6",
|
|
18
|
+
"@mininglamp-oss/octo-runtime-cross-service": "1.1.6",
|
|
19
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.6",
|
|
20
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.6",
|
|
21
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.6",
|
|
22
|
+
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.6",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.6",
|
|
24
|
+
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.6",
|
|
25
|
+
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.6",
|
|
26
|
+
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.6",
|
|
27
|
+
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.6",
|
|
28
|
+
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.6",
|
|
29
|
+
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.6",
|
|
30
|
+
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.6",
|
|
31
|
+
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.6",
|
|
32
|
+
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.6",
|
|
33
|
+
"@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.6",
|
|
34
|
+
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.6",
|
|
35
|
+
"@mininglamp-oss/octo-runtime-extra-webui": "1.1.6"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -964,9 +964,14 @@ async function adapterFailurePayload(input, workdir, context) {
|
|
|
964
964
|
...context,
|
|
965
965
|
...(detail !== input ? { defaultDomain: "adapter" } : {})
|
|
966
966
|
});
|
|
967
|
-
|
|
968
|
-
const message
|
|
969
|
-
|
|
967
|
+
// 仅 ACP 消息保留原始 _meta;外层字段仍按公共错误规则脱敏,不能凭错误码整体绕过。
|
|
968
|
+
const { message: originalMessage, ...outerDetail } = detail;
|
|
969
|
+
const safe = sanitizePublicValue(outerDetail);
|
|
970
|
+
const publicMessage = detail.code === "ACP_MODEL_REQUEST_FAILED" && typeof originalMessage === "string"
|
|
971
|
+
? originalMessage
|
|
972
|
+
: sanitizePublicValue(originalMessage);
|
|
973
|
+
const message = typeof publicMessage === "string" && publicMessage.trim()
|
|
974
|
+
? publicMessage
|
|
970
975
|
: typeof safe.error === "string"
|
|
971
976
|
? safe.error
|
|
972
977
|
: safe.error && typeof safe.error === "object"
|
|
@@ -33,6 +33,7 @@ export class InvocationWatchdog {
|
|
|
33
33
|
#startedAt;
|
|
34
34
|
#tools = new Map();
|
|
35
35
|
#interactions = new Set();
|
|
36
|
+
#activities = new Map();
|
|
36
37
|
#waitingSince;
|
|
37
38
|
#nativeProgressSeen = false;
|
|
38
39
|
#modelStarted = false;
|
|
@@ -133,6 +134,21 @@ export class InvocationWatchdog {
|
|
|
133
134
|
this.dispose();
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
137
|
+
// 统一活动补充执行阶段;与正式工具/交互分别持有暂停原因,不能互相提前解除。
|
|
138
|
+
if (event.type === "activity.started" &&
|
|
139
|
+
["executing_tool", "waiting_input", "waiting_approval"].includes(event.payload.kind) &&
|
|
140
|
+
!this.#activities.has(event.payload.activityId)) {
|
|
141
|
+
const waitId = event.payload.kind === "executing_tool" ? undefined : Symbol();
|
|
142
|
+
this.#activities.set(event.payload.activityId, {
|
|
143
|
+
subject: event.payload.subject,
|
|
144
|
+
waitId,
|
|
145
|
+
tool: waitId ? undefined : { startedAt: now, progressAt: now }
|
|
146
|
+
});
|
|
147
|
+
if (waitId)
|
|
148
|
+
this.#interaction(waitId, true);
|
|
149
|
+
}
|
|
150
|
+
if (event.type === "activity.finished")
|
|
151
|
+
this.#finishActivity(event.payload.activityId);
|
|
136
152
|
const rawID = event.payload.toolCallId ?? event.payload.id ?? event.payload.itemId;
|
|
137
153
|
const id = typeof rawID === "string" && rawID ? rawID : undefined;
|
|
138
154
|
let toolChanged = false;
|
|
@@ -144,12 +160,14 @@ export class InvocationWatchdog {
|
|
|
144
160
|
id &&
|
|
145
161
|
["completed", "failed", "cancelled", "stopped"].includes(String(event.payload.status))) {
|
|
146
162
|
toolChanged = this.#tools.delete(id);
|
|
163
|
+
this.#finishSubjectActivities("tool", id);
|
|
147
164
|
}
|
|
148
165
|
if (event.type === "interaction.requested" && typeof event.payload.interactionId === "string") {
|
|
149
166
|
this.#interaction(event.payload.interactionId, true);
|
|
150
167
|
}
|
|
151
168
|
if (event.type === "interaction.resolved" && typeof event.payload.interactionId === "string") {
|
|
152
169
|
this.#interaction(event.payload.interactionId, false);
|
|
170
|
+
this.#finishSubjectActivities("interaction", event.payload.interactionId);
|
|
153
171
|
}
|
|
154
172
|
const hasText = (value) => typeof value === "string" && value.length > 0;
|
|
155
173
|
const toolProgress = event.payload.progress;
|
|
@@ -180,6 +198,25 @@ export class InvocationWatchdog {
|
|
|
180
198
|
this.#syncPhase();
|
|
181
199
|
this.#arm();
|
|
182
200
|
}
|
|
201
|
+
#finishSubjectActivities(type, id) {
|
|
202
|
+
for (const [activityId, activity] of this.#activities)
|
|
203
|
+
if (activity.subject.type === type && activity.subject.id === id)
|
|
204
|
+
this.#finishActivity(activityId);
|
|
205
|
+
}
|
|
206
|
+
#finishActivity(id) {
|
|
207
|
+
const activity = this.#activities.get(id);
|
|
208
|
+
if (!activity)
|
|
209
|
+
return;
|
|
210
|
+
this.#activities.delete(id);
|
|
211
|
+
if (activity.waitId)
|
|
212
|
+
this.#interaction(activity.waitId, false);
|
|
213
|
+
}
|
|
214
|
+
*#toolClocks() {
|
|
215
|
+
yield* this.#tools.values();
|
|
216
|
+
for (const activity of this.#activities.values())
|
|
217
|
+
if (activity.tool)
|
|
218
|
+
yield activity.tool;
|
|
219
|
+
}
|
|
183
220
|
#interaction(id, pending) {
|
|
184
221
|
const now = this.time.now();
|
|
185
222
|
if (pending) {
|
|
@@ -192,7 +229,7 @@ export class InvocationWatchdog {
|
|
|
192
229
|
if (!this.#interactions.size && this.#waitingSince !== undefined) {
|
|
193
230
|
// Each timestamp is suspended only for its own overlap with the wait.
|
|
194
231
|
this.#progressAt += now - Math.max(this.#waitingSince, this.#progressAt);
|
|
195
|
-
for (const tool of this.#
|
|
232
|
+
for (const tool of this.#toolClocks()) {
|
|
196
233
|
tool.startedAt += now - Math.max(this.#waitingSince, tool.startedAt);
|
|
197
234
|
tool.progressAt += now - Math.max(this.#waitingSince, tool.progressAt);
|
|
198
235
|
}
|
|
@@ -219,6 +256,7 @@ export class InvocationWatchdog {
|
|
|
219
256
|
maxProgressGapMs: Math.floor(Math.max(this.#maxProgressGapMs, now - this.#progressAt)),
|
|
220
257
|
openToolCount: this.#tools.size,
|
|
221
258
|
pendingInteractionCount: this.#interactions.size,
|
|
259
|
+
openActivityCount: this.#activities.size,
|
|
222
260
|
retryCount: this.#retryCount,
|
|
223
261
|
lastMethod: this.#lastMethod,
|
|
224
262
|
activitySupport: this.#nativeProgressSeen ? "native_progress" : "canonical_only",
|
|
@@ -249,6 +287,10 @@ export class InvocationWatchdog {
|
|
|
249
287
|
const tool = toolCallId ? this.#tools.get(toolCallId) : undefined;
|
|
250
288
|
if (tool)
|
|
251
289
|
tool.progressAt = now;
|
|
290
|
+
if (toolCallId)
|
|
291
|
+
for (const activity of this.#activities.values())
|
|
292
|
+
if (activity.tool && activity.subject.type === "tool" && activity.subject.id === toolCallId)
|
|
293
|
+
activity.tool.progressAt = now;
|
|
252
294
|
if (this.#warned) {
|
|
253
295
|
this.#warned = false;
|
|
254
296
|
this.#emit("progress_resumed");
|
|
@@ -257,7 +299,7 @@ export class InvocationWatchdog {
|
|
|
257
299
|
#syncPhase() {
|
|
258
300
|
const phase = this.#interactions.size
|
|
259
301
|
? "waiting_approval"
|
|
260
|
-
: this.#tools.size
|
|
302
|
+
: this.#tools.size || this.#activities.size
|
|
261
303
|
? "tool_active"
|
|
262
304
|
: this.#modelStarted
|
|
263
305
|
? "model_active"
|
|
@@ -284,7 +326,8 @@ export class InvocationWatchdog {
|
|
|
284
326
|
];
|
|
285
327
|
if (this.#phase === "starting")
|
|
286
328
|
deadlines.push({
|
|
287
|
-
|
|
329
|
+
// 工具或人工等待结束后重新进入 starting,从此时重开首帧预算。
|
|
330
|
+
at: this.#phaseAt + this.limits.firstFrameTimeoutMs,
|
|
288
331
|
reason: "first_frame",
|
|
289
332
|
budget: this.limits.firstFrameTimeoutMs
|
|
290
333
|
});
|
|
@@ -294,7 +337,7 @@ export class InvocationWatchdog {
|
|
|
294
337
|
reason: "model_silence",
|
|
295
338
|
budget: this.limits.modelIdleTimeoutMs
|
|
296
339
|
});
|
|
297
|
-
for (const tool of this.#phase === "waiting_approval" ? [] : this.#
|
|
340
|
+
for (const tool of this.#phase === "waiting_approval" ? [] : this.#toolClocks()) {
|
|
298
341
|
deadlines.push({
|
|
299
342
|
at: tool.progressAt + this.limits.toolTimeoutMs,
|
|
300
343
|
reason: "tool_idle",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-executor-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.6",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.6"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|