@mininglamp-oss/octo-runtime 1.1.3 → 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 +152 -21
- 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 +56 -0
- 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 +19 -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 +44 -13
- 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/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 +56 -0
- 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
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Octo Runtime</title> <script type="module" crossorigin src="/assets/index-
|
|
1
|
+
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Octo Runtime</title> <script type="module" crossorigin src="/assets/index-CXTvRGim.js"></script>
|
|
2
2
|
<link rel="stylesheet" crossorigin href="/assets/index-CYTpqItx.css">
|
|
3
3
|
</head><body><div id="root"></div></body></html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-extra-webui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local Runtime workbench with canonical SSE presentation",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"porting-map.md"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
22
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { lstat, open, readdir } from "node:fs/promises";
|
|
2
3
|
import { isAbsolute, join } from "node:path";
|
|
3
4
|
import { pathToFileURL } from "node:url";
|
|
4
5
|
import { assertExtraName } from "./extras.js";
|
|
@@ -85,14 +86,37 @@ export async function readExtraDirectory(directory) {
|
|
|
85
86
|
export async function readStoredExtra(directory, name) {
|
|
86
87
|
assertExtraName(name);
|
|
87
88
|
const file = join(directory, name, "config.json");
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
const handle = await open(file, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
90
|
+
try {
|
|
91
|
+
// 权限、大小和读取绑定同一个文件,不允许检查后换成链接或其他目标。
|
|
92
|
+
const info = await handle.stat();
|
|
93
|
+
if (!info.isFile() || (process.platform !== "win32" && info.mode & 0o077))
|
|
94
|
+
throw new Error("EXTRA_CONFIG_PERMISSIONS_INVALID");
|
|
95
|
+
if (!constants.O_NOFOLLOW) {
|
|
96
|
+
const entry = await lstat(file);
|
|
97
|
+
if (!entry.isFile() || entry.dev !== info.dev || entry.ino !== info.ino)
|
|
98
|
+
throw new Error("EXTRA_CONFIG_PERMISSIONS_INVALID");
|
|
99
|
+
}
|
|
100
|
+
const maximum = 1024 * 1024;
|
|
101
|
+
if (info.size > maximum)
|
|
102
|
+
throw new Error("EXTRA_CONFIG_TOO_LARGE");
|
|
103
|
+
const bytes = Buffer.alloc(maximum + 1);
|
|
104
|
+
let length = 0;
|
|
105
|
+
while (length < bytes.length) {
|
|
106
|
+
const { bytesRead } = await handle.read(bytes, length, bytes.length - length, null);
|
|
107
|
+
if (!bytesRead)
|
|
108
|
+
break;
|
|
109
|
+
length += bytesRead;
|
|
110
|
+
}
|
|
111
|
+
if (length > maximum)
|
|
112
|
+
throw new Error("EXTRA_CONFIG_TOO_LARGE");
|
|
113
|
+
const stored = JSON.parse(bytes.subarray(0, length).toString("utf8"));
|
|
114
|
+
assertStoredExtra(stored);
|
|
115
|
+
return stored;
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
await handle.close();
|
|
119
|
+
}
|
|
96
120
|
}
|
|
97
121
|
function validModule(module) {
|
|
98
122
|
if (isAbsolute(module))
|
|
@@ -159,12 +159,17 @@ function validateHome(homeInput, platform) {
|
|
|
159
159
|
return home;
|
|
160
160
|
}
|
|
161
161
|
function appSlug(appId) {
|
|
162
|
-
const
|
|
162
|
+
const normalized = appId
|
|
163
163
|
.trim()
|
|
164
164
|
.toLowerCase()
|
|
165
|
-
.replace(/[^a-z0-9._-]+/g, "-")
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
.replace(/[^a-z0-9._-]+/g, "-");
|
|
166
|
+
// 保持原有 slug/身份映射,只以线性扫描移除首尾连字符。
|
|
167
|
+
let start = 0, end = normalized.length;
|
|
168
|
+
while (start < end && normalized[start] === "-")
|
|
169
|
+
start++;
|
|
170
|
+
while (end > start && normalized[end - 1] === "-")
|
|
171
|
+
end--;
|
|
172
|
+
const slug = normalized.slice(start, end).slice(0, 48);
|
|
168
173
|
if (!slug || !/^[a-z0-9]/.test(slug)) {
|
|
169
174
|
throw new HostRuntimeError("APP_ID_INVALID", "home", false, "appId must contain an ASCII letter or digit");
|
|
170
175
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-host-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
23
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
24
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
22
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
|
|
23
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.4",
|
|
24
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4"
|
|
25
25
|
},
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"files": [
|
|
@@ -10,6 +10,8 @@ export interface FailureClassificationContext {
|
|
|
10
10
|
occurredAt?: string;
|
|
11
11
|
/** Only trusted downstream boundaries may retain a previously validated envelope. */
|
|
12
12
|
preserveExisting?: boolean;
|
|
13
|
+
/** 仅可信调用边界在确认 Kernel 本地写出前拒绝后设置;错误字符串不能提供此证据。 */
|
|
14
|
+
invocationNotSubmitted?: boolean;
|
|
13
15
|
}
|
|
14
16
|
interface CatalogEntry {
|
|
15
17
|
category: string;
|
|
@@ -32,6 +34,9 @@ export declare const FAILURE_CATALOG: Readonly<{
|
|
|
32
34
|
"OH-RUN-2005": CatalogEntry;
|
|
33
35
|
"OH-RUN-2008": CatalogEntry;
|
|
34
36
|
"OH-RUN-2009": CatalogEntry;
|
|
37
|
+
"OH-RUN-2010": CatalogEntry;
|
|
38
|
+
"OH-RUN-2011": CatalogEntry;
|
|
39
|
+
"OH-RUN-2012": CatalogEntry;
|
|
35
40
|
"OH-ADP-3002": CatalogEntry;
|
|
36
41
|
"OH-ADP-3003": CatalogEntry;
|
|
37
42
|
"OH-ADP-3004": CatalogEntry;
|
|
@@ -12,6 +12,9 @@ export const FAILURE_CATALOG = Object.freeze({
|
|
|
12
12
|
"OH-RUN-2005": entry("channel_delivery_unknown", "回复已尝试发送,但未收到消息服务的确认,可能已送达。请先检查聊天记录,避免重复提交任务。", "error.channel.delivery_unknown", false, "contact_admin"),
|
|
13
13
|
"OH-RUN-2008": entry("runtime_local_store", "运行设备存储异常,本轮任务已安全结束。", "error.runtime.local_store", true, "check_runtime"),
|
|
14
14
|
"OH-RUN-2009": entry("runtime_stream_capacity", "运行输出队列超过容量限制,本轮任务已停止。请检查运行设备的输出容量配置。", "error.runtime.stream_queue_capacity", false, "check_runtime"),
|
|
15
|
+
"OH-RUN-2010": entry("channel_session_store", "会话读取失败,尚未发起执行,请检查运行设备或稍后重试。", "error.channel.session_store", true, "check_runtime"),
|
|
16
|
+
"OH-RUN-2011": entry("channel_presentation_initialization", "状态展示初始化失败,尚未发起执行,请检查运行设备或稍后重试。", "error.channel.presentation_initialization", true, "check_runtime"),
|
|
17
|
+
"OH-RUN-2012": entry("channel_invocation_admission", "执行服务当前不接收新任务,本次尝试尚未提交,请稍后重试。", "error.channel.invocation_admission", true, "retry_later"),
|
|
15
18
|
"OH-ADP-3002": entry("adapter_dependency", "未找到 Agent 命令或必要程序。", "error.adapter.command_not_found", false, "install_dependency"),
|
|
16
19
|
"OH-ADP-3003": entry("adapter_permission", "Agent 进程没有访问所需资源的权限。", "error.adapter.permission_denied", false, "fix_permissions"),
|
|
17
20
|
"OH-ADP-3004": entry("adapter_invocation", "Agent 适配器启动或执行失败。", "error.adapter.invocation_failed", false, "contact_admin"),
|
|
@@ -40,7 +43,20 @@ export const FAILURE_CATALOG = Object.freeze({
|
|
|
40
43
|
/** Classify untrusted adapter/provider error data without copying raw messages or secrets into the result. */
|
|
41
44
|
export function classifyFailure(input, context) {
|
|
42
45
|
const evidence = failureEvidence(input);
|
|
43
|
-
|
|
46
|
+
// 执行前分类同时依赖可信调用阶段;不能由 Provider 的同名原因推断执行从未提交。
|
|
47
|
+
const channelCode = context.stage === "channel_session_read" && evidence.explicitCode === "IM_SESSION_STORE_FAILED"
|
|
48
|
+
? "OH-RUN-2010"
|
|
49
|
+
: context.stage === "channel_presentation_initialize" &&
|
|
50
|
+
evidence.explicitCode === "IM_PRESENTATION_INITIALIZATION_FAILED"
|
|
51
|
+
? "OH-RUN-2011"
|
|
52
|
+
: context.stage === "channel_admission" &&
|
|
53
|
+
context.invocationNotSubmitted === true &&
|
|
54
|
+
evidence.explicitCode === "CLIENT_INVOCATION_ADMISSION_CLOSED"
|
|
55
|
+
? "OH-RUN-2012"
|
|
56
|
+
: undefined;
|
|
57
|
+
const classification = channelCode
|
|
58
|
+
? result(channelCode, evidence.explicitCode)
|
|
59
|
+
: classify(evidence, context.defaultDomain);
|
|
44
60
|
const catalog = FAILURE_CATALOG[classification.code];
|
|
45
61
|
return {
|
|
46
62
|
schemaVersion: 1,
|
|
@@ -314,6 +330,28 @@ function classify(evidence, defaultDomain) {
|
|
|
314
330
|
};
|
|
315
331
|
if (explicit && timeouts[explicit])
|
|
316
332
|
return result(timeouts[explicit], explicit);
|
|
333
|
+
// DSH 的公开分类复用共同目录,原生阶段仍由稳定 reasonCode 保留。
|
|
334
|
+
const dshCodes = {
|
|
335
|
+
DSH_CONFIG_INVALID: "OH-ADP-3004",
|
|
336
|
+
DSH_ACTMODE_UNSUPPORTED: "OH-ADP-3004",
|
|
337
|
+
DSH_EXECUTABLE_NOT_FOUND: "OH-ADP-3002",
|
|
338
|
+
DSH_VERSION_UNSUPPORTED: "OH-ADP-3005",
|
|
339
|
+
DSH_START_FAILED: "OH-ADP-3004",
|
|
340
|
+
DSH_INITIALIZE_TIMEOUT: "OH-ADP-3007",
|
|
341
|
+
DSH_RPC_ERROR: "OH-ADP-3004",
|
|
342
|
+
DSH_REQUEST_TIMEOUT: "OH-ADP-3013",
|
|
343
|
+
DSH_TRANSPORT_CLOSED: "OH-ADP-3005",
|
|
344
|
+
DSH_PROTOCOL_ERROR: "OH-ADP-3005",
|
|
345
|
+
DSH_TRAJECTORY_INVALID: "OH-ADP-3005",
|
|
346
|
+
DSH_SESSION_RESUME_FAILED: "OH-ADP-3004",
|
|
347
|
+
DSH_SESSION_BUSY: "OH-ADP-3004",
|
|
348
|
+
DSH_EXECUTION_FAILED: "OH-PRV-4099",
|
|
349
|
+
DSH_NO_FINAL_OUTPUT: "OH-ADP-3005",
|
|
350
|
+
DSH_CANCEL_FAILED: "OH-ADP-3012",
|
|
351
|
+
DSH_CLEANUP_FAILED: "OH-ADP-3012"
|
|
352
|
+
};
|
|
353
|
+
if (explicit && dshCodes[explicit])
|
|
354
|
+
return result(dshCodes[explicit], explicit);
|
|
317
355
|
if (explicit === "PROVIDER_MESSAGE_TOO_LARGE")
|
|
318
356
|
return result("OH-PRV-4009", "PROVIDER_MESSAGE_TOO_LARGE");
|
|
319
357
|
if (explicit === "HOST_FRAME_TOO_LARGE")
|
package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Generated by scripts/gen-types.mjs from schema/protocol.schema.json.
|
|
3
3
|
* Do not edit directly; update the schema and run `pnpm gen`.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
7
|
+
* via the `definition` "ProtocolMode".
|
|
8
|
+
*/
|
|
9
|
+
export type ProtocolMode = "native" | "canonical";
|
|
5
10
|
/**
|
|
6
11
|
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
7
12
|
* via the `definition` "HostFrame".
|
|
@@ -21,11 +26,6 @@ export type MessageChannel = "analysis" | "commentary" | "final";
|
|
|
21
26
|
* via the `definition` "MessageExposure".
|
|
22
27
|
*/
|
|
23
28
|
export type MessageExposure = "public_reasoning" | "public_summary" | "public_plan" | "private_reasoning" | "unknown";
|
|
24
|
-
/**
|
|
25
|
-
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
26
|
-
* via the `definition` "ProtocolMode".
|
|
27
|
-
*/
|
|
28
|
-
export type ProtocolMode = "native" | "canonical";
|
|
29
29
|
/**
|
|
30
30
|
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
31
31
|
* via the `definition` "HostControl".
|
|
@@ -293,6 +293,14 @@ export type ContextReferenceEntry = {
|
|
|
293
293
|
authorization_ref?: string;
|
|
294
294
|
revision?: string;
|
|
295
295
|
};
|
|
296
|
+
/**
|
|
297
|
+
* @minItems 1
|
|
298
|
+
* @maxItems 128
|
|
299
|
+
*
|
|
300
|
+
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
301
|
+
* via the `definition` "ModelInputParts".
|
|
302
|
+
*/
|
|
303
|
+
export type ModelInputParts = [ModelInputPart, ...ModelInputPart[]];
|
|
296
304
|
/**
|
|
297
305
|
* Serializable data shapes for the Octo Runtime NDJSON protocol. Runtime behavior remains hand-written in src/index.ts, and this schema is the source of truth for generated TypeScript types. The x-octo-unicode-scalar-strings semantic keyword requires every JSON string value and object member name to contain Unicode scalar values only: unpaired UTF-16 surrogates are rejected, not repaired or normalized. Consumers must enforce this protocol-wide rule even when validating a definition directly.
|
|
298
306
|
*/
|
|
@@ -307,7 +315,7 @@ export interface KernelLookupKey {
|
|
|
307
315
|
invocation_id: string;
|
|
308
316
|
agent_session_id: string;
|
|
309
317
|
session_generation: number;
|
|
310
|
-
protocol_mode:
|
|
318
|
+
protocol_mode: ProtocolMode;
|
|
311
319
|
}
|
|
312
320
|
/**
|
|
313
321
|
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
@@ -320,7 +328,7 @@ export interface KernelRunRef {
|
|
|
320
328
|
stream_id: string;
|
|
321
329
|
agent_session_id: string;
|
|
322
330
|
session_generation: number;
|
|
323
|
-
protocol_mode:
|
|
331
|
+
protocol_mode: ProtocolMode;
|
|
324
332
|
protocol: string;
|
|
325
333
|
}
|
|
326
334
|
/**
|
|
@@ -2824,3 +2832,64 @@ export interface IssuedToolAuthorization {
|
|
|
2824
2832
|
namespace: string;
|
|
2825
2833
|
expires_at: string;
|
|
2826
2834
|
}
|
|
2835
|
+
export interface InvokeInputWire {
|
|
2836
|
+
sessionId?: string;
|
|
2837
|
+
invocationId?: string;
|
|
2838
|
+
runId?: string;
|
|
2839
|
+
prompt?: string;
|
|
2840
|
+
modelInput?: string;
|
|
2841
|
+
freshFallbackModelInput?: string;
|
|
2842
|
+
workdir?: string;
|
|
2843
|
+
controlInstructions?: string;
|
|
2844
|
+
inputs: ModelInputParts;
|
|
2845
|
+
contexts: ContextEnvelope;
|
|
2846
|
+
protocol_mode?: ProtocolMode;
|
|
2847
|
+
agentSource?: AgentSource;
|
|
2848
|
+
approvalMode?: ApprovalMode;
|
|
2849
|
+
agentConfig?: AgentConfig;
|
|
2850
|
+
runtimeLimits?: RuntimeLimits;
|
|
2851
|
+
providerSession?: ProviderSession;
|
|
2852
|
+
sessionGeneration?: number;
|
|
2853
|
+
providerEpoch?: number;
|
|
2854
|
+
runMetadata?: {
|
|
2855
|
+
[k: string]: unknown;
|
|
2856
|
+
};
|
|
2857
|
+
continuityMode?: "fresh" | "continue";
|
|
2858
|
+
freshFallbackModelInputParts?: ModelInputParts;
|
|
2859
|
+
freshFallbackImagesUnavailable?: boolean;
|
|
2860
|
+
[k: string]: unknown;
|
|
2861
|
+
}
|
|
2862
|
+
/**
|
|
2863
|
+
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
2864
|
+
* via the `definition` "KernelInvokeEnvironmentWire".
|
|
2865
|
+
*/
|
|
2866
|
+
export interface KernelInvokeEnvironmentWire {
|
|
2867
|
+
executionEnvOverrides?: ContextEnvsPayload;
|
|
2868
|
+
}
|
|
2869
|
+
/**
|
|
2870
|
+
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
2871
|
+
* via the `definition` "InteractionResponseWire".
|
|
2872
|
+
*/
|
|
2873
|
+
export interface InteractionResponseWire {
|
|
2874
|
+
interactionId: string;
|
|
2875
|
+
outcome: "accepted" | "declined" | "answered" | "cancelled";
|
|
2876
|
+
value?: unknown;
|
|
2877
|
+
[k: string]: unknown;
|
|
2878
|
+
}
|
|
2879
|
+
/**
|
|
2880
|
+
* This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
|
|
2881
|
+
* via the `definition` "HostedAdapterMetadataWire".
|
|
2882
|
+
*/
|
|
2883
|
+
export interface HostedAdapterMetadataWire {
|
|
2884
|
+
type: string;
|
|
2885
|
+
agentSources: AgentSource[];
|
|
2886
|
+
workspace?: boolean;
|
|
2887
|
+
protocolSupport?: AdapterProtocolSupport;
|
|
2888
|
+
processModel?: string;
|
|
2889
|
+
transport?: string;
|
|
2890
|
+
providerVersion?: string | null;
|
|
2891
|
+
providerPath?: string | null;
|
|
2892
|
+
available?: boolean;
|
|
2893
|
+
unavailableReason?: string | null;
|
|
2894
|
+
[k: string]: unknown;
|
|
2895
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Provider-neutral Agent runtime for unified execution through provider adapters",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"octo-runtime": "apps/cli/dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
|
+
"./adapters/dsh": {
|
|
20
|
+
"types": "./dist/public/dsh.d.ts",
|
|
21
|
+
"import": "./dist/public/dsh.js"
|
|
22
|
+
},
|
|
19
23
|
"./executor-kernel/ipc-fixtures.json": "./packages/octo-runtime-protocol/schema/kernel-ipc-fixtures.json",
|
|
20
24
|
"./protocol/schema.json": "./packages/octo-runtime-protocol/schema/protocol.schema.json",
|
|
21
25
|
"./executor-kernel/ipc-schema.json": "./packages/octo-runtime-protocol/schema/kernel-ipc.schema.json",
|
|
@@ -70,30 +74,31 @@
|
|
|
70
74
|
"access": "public"
|
|
71
75
|
},
|
|
72
76
|
"dependencies": {
|
|
73
|
-
"@mininglamp-oss/octo-runtime-
|
|
74
|
-
"@mininglamp-oss/octo-runtime-
|
|
75
|
-
"@mininglamp-oss/octo-runtime-
|
|
76
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.3",
|
|
77
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.3",
|
|
77
|
+
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.4",
|
|
78
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.4",
|
|
79
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.4",
|
|
78
80
|
"import-meta-resolve": "4.2.0",
|
|
79
|
-
"@mininglamp-oss/octo-runtime-
|
|
80
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
81
|
-
"@mininglamp-oss/octo-runtime-
|
|
82
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
83
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
84
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
85
|
-
"@mininglamp-oss/octo-runtime-
|
|
86
|
-
"@mininglamp-oss/octo-runtime-
|
|
87
|
-
"@mininglamp-oss/octo-runtime-adapter-
|
|
88
|
-
"@mininglamp-oss/octo-runtime-
|
|
89
|
-
"@mininglamp-oss/octo-runtime-
|
|
81
|
+
"@mininglamp-oss/octo-runtime-extra-webui": "1.1.4",
|
|
82
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.4",
|
|
83
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.4",
|
|
84
|
+
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.4",
|
|
85
|
+
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.4",
|
|
86
|
+
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.4",
|
|
87
|
+
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.4",
|
|
88
|
+
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.4",
|
|
89
|
+
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.4",
|
|
90
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.4",
|
|
91
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.4",
|
|
92
|
+
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.4",
|
|
93
|
+
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.4",
|
|
94
|
+
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.4",
|
|
90
95
|
"ws": "8.22.0",
|
|
91
|
-
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.
|
|
92
|
-
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.
|
|
93
|
-
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.
|
|
94
|
-
"@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.
|
|
95
|
-
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.
|
|
96
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.
|
|
96
|
+
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.4",
|
|
97
|
+
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.4",
|
|
98
|
+
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.4",
|
|
99
|
+
"@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.4",
|
|
100
|
+
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.4",
|
|
101
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.4",
|
|
97
102
|
"mdast-util-from-markdown": "2.1.0",
|
|
98
103
|
"@types/mdast": "4.0.4",
|
|
99
104
|
"@types/unist": "3.0.3",
|
|
@@ -129,18 +134,19 @@
|
|
|
129
134
|
"micromark-util-sanitize-uri": "2.0.1",
|
|
130
135
|
"micromark-util-decode-string": "2.0.1",
|
|
131
136
|
"unist-util-stringify-position": "4.0.0",
|
|
132
|
-
"@mininglamp-oss/octo-runtime-cross-service": "1.1.
|
|
133
|
-
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.
|
|
134
|
-
"@mininglamp-oss/octo-runtime-cli": "1.1.
|
|
137
|
+
"@mininglamp-oss/octo-runtime-cross-service": "1.1.4",
|
|
138
|
+
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.4",
|
|
139
|
+
"@mininglamp-oss/octo-runtime-cli": "1.1.4",
|
|
135
140
|
"json5": "2.2.3"
|
|
136
141
|
},
|
|
137
142
|
"bundleDependencies": [
|
|
138
|
-
"@mininglamp-oss/octo-runtime-
|
|
143
|
+
"@mininglamp-oss/octo-runtime-adapter-dsh",
|
|
144
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk",
|
|
139
145
|
"@mininglamp-oss/octo-runtime-protocol",
|
|
146
|
+
"import-meta-resolve",
|
|
147
|
+
"@mininglamp-oss/octo-runtime-extra-webui",
|
|
140
148
|
"@mininglamp-oss/octo-runtime-adapter-acp",
|
|
141
149
|
"@mininglamp-oss/octo-runtime-acp-client",
|
|
142
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk",
|
|
143
|
-
"import-meta-resolve",
|
|
144
150
|
"@mininglamp-oss/octo-runtime-adapter-antigravity",
|
|
145
151
|
"@mininglamp-oss/octo-runtime-adapter-claude-code",
|
|
146
152
|
"@mininglamp-oss/octo-runtime-adapter-codebuddy",
|
|
@@ -231,6 +231,62 @@
|
|
|
231
231
|
"description": "允许的群范围 ID(groupNo)。"
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
|
+
"artifact_delivery": {
|
|
235
|
+
"type": "object",
|
|
236
|
+
"additionalProperties": true,
|
|
237
|
+
"description": "workflow 固定产物交付,执行前通过 Context 明示。省略为 channel:成功 final 显式引用的本地文件上传为 IM 附件,普通链接同时保留正文下载链接并发送原生文件卡,图片内嵌展示;tools 保留 Agent 主动工具交付。不扫描目录或自动发布在线文档。",
|
|
238
|
+
"properties": {
|
|
239
|
+
"mode": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"enum": ["channel", "tools"],
|
|
242
|
+
"default": "channel",
|
|
243
|
+
"description": "省略启用渠道固定交付;tools 关闭 Gateway 自动上传,保留普通工具调用。"
|
|
244
|
+
},
|
|
245
|
+
"allowed_roots": {
|
|
246
|
+
"type": "array",
|
|
247
|
+
"maxItems": 32,
|
|
248
|
+
"description": "宿主授权的绝对产物目录;省略使用当前本地 Agent 工作区,空列表拒绝全部文件。realpath 后检查包含关系,拒绝 symlink 逃逸;远程 Provider 路径始终不可读。",
|
|
249
|
+
"items": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"pattern": "^(?:/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+)"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"allowed_mime_types": {
|
|
255
|
+
"type": "array",
|
|
256
|
+
"maxItems": 32,
|
|
257
|
+
"description": "可选精确 MIME 类型列表;省略不增加类型限制,空列表拒绝所有类型。服务端实际策略仍可拒绝;未知扩展使用 application/octet-stream。",
|
|
258
|
+
"items": { "type": "string", "pattern": "^[\\w.+-]+/[\\w.+-]+$" }
|
|
259
|
+
},
|
|
260
|
+
"max_file_bytes": {
|
|
261
|
+
"type": "integer",
|
|
262
|
+
"minimum": 1,
|
|
263
|
+
"maximum": 20971520,
|
|
264
|
+
"default": 20971520,
|
|
265
|
+
"description": "单个文件上限(字节),宿主可收紧。"
|
|
266
|
+
},
|
|
267
|
+
"max_total_bytes": {
|
|
268
|
+
"type": "integer",
|
|
269
|
+
"minimum": 1,
|
|
270
|
+
"maximum": 52428800,
|
|
271
|
+
"default": 52428800,
|
|
272
|
+
"description": "一次最终回复的文件总字节预算,失败上传也占预算。"
|
|
273
|
+
},
|
|
274
|
+
"max_files": {
|
|
275
|
+
"type": "integer",
|
|
276
|
+
"minimum": 1,
|
|
277
|
+
"maximum": 16,
|
|
278
|
+
"default": 16,
|
|
279
|
+
"description": "一次最终回复最多尝试的不同 realpath 文件数量。"
|
|
280
|
+
},
|
|
281
|
+
"timeout_ms": {
|
|
282
|
+
"type": "integer",
|
|
283
|
+
"minimum": 1,
|
|
284
|
+
"maximum": 30000,
|
|
285
|
+
"default": 30000,
|
|
286
|
+
"description": "整次产物准备的上传时间预算;取消、reset 和关闭可提前结束。"
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
234
290
|
"cards": {
|
|
235
291
|
"type": "boolean",
|
|
236
292
|
"default": true,
|