@mininglamp-oss/octo-runtime 1.1.12 → 1.1.14
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/adapters.d.ts +19 -1
- package/apps/cli/dist/adapters.js +154 -28
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/codex.d.ts +5 -0
- package/apps/cli/dist/codex.js +36 -0
- package/apps/cli/dist/kernel.d.ts +4 -0
- package/apps/cli/dist/kernel.js +84 -0
- package/apps/cli/dist/main.js +8 -7
- package/apps/cli/dist/manifest.json +33 -22
- package/apps/cli/dist/output.d.ts +1 -0
- package/apps/cli/dist/output.js +8 -4
- package/apps/cli/dist/playboard.js +21 -12
- package/apps/cli/dist/provider-launch.d.ts +28 -0
- package/apps/cli/dist/provider-launch.js +52 -0
- package/apps/cli/dist/providers.d.ts +182 -0
- package/apps/cli/dist/providers.js +34 -0
- package/dist/public/adapter-sdk.d.ts +2 -0
- package/dist/public/adapter-sdk.js +2 -0
- package/dist/public/protocol.d.ts +2 -2
- package/dist/public/protocol.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/dist/index.js +4 -4
- 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 +26 -10
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +44 -53
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.d.ts +10 -35
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.js +21 -29
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/agent-env.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/agent-env.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.d.ts +14 -68
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/dist/index.js +77 -61
- 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 +19 -31
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/dist/index.js +28 -18
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/agent-env.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/agent-env.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +6 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +55 -54
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/engine.d.ts +54 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/engine.js +147 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/environment.js +4 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +20 -92
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +103 -217
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/mcp.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/mcp.js +4 -11
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.d.ts +9 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.js +77 -81
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-SMTJTIN7.js → chunk-AE3OJBDS.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-H3S6WM37.js → chunk-NGR74QLF.js} +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-RISQ6NGV.js → chunk-XIUZ6GXG.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/errors.d.ts +0 -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.d.ts +6 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +16 -21
- 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/adapter.d.ts +14 -16
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.js +29 -46
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/agent-env.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/agent-env.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/client.js +4 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.d.ts +13 -21
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/index.js +47 -36
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.d.ts +24 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.js +14 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.d.ts +24 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.js +13 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.d.ts +24 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.js +14 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +7 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +28 -31
- 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 +16 -25
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +113 -179
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.d.ts +24 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.js +14 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +24 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.js +14 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/agent-env.d.ts +48 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/agent-env.js +234 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/approval.js +7 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/environment.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +25 -14
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +112 -59
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/mcp.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.d.ts +11 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/process-launch.js +89 -8
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/provider-launch.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/provider-launch.js +25 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/public-display.js +10 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +19 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +154 -28
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/codex.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/codex.js +36 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/kernel.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/kernel.js +84 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +8 -7
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +33 -22
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +8 -4
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +21 -12
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/provider-launch.d.ts +28 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/provider-launch.js +52 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/providers.d.ts +182 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/providers.js +34 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +20 -20
- package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.js +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc.schema.json +3 -104
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +166 -1870
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +122 -65
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +13 -85
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-output-silence.d.ts +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-output-silence.js +176 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.d.ts +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +8 -4
- 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 +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +17 -20
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/adapter-metadata.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.js +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-catalog.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-catalog.js +3 -9
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context-configuration.js +1 -8
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +1 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +3 -292
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/experience.js +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +18 -13
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +90 -608
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.js +32 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +7 -18
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +34 -189
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.d.ts +11 -22
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +38 -78
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/multimodal.js +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.d.ts +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +5 -40
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +34 -37
- package/packages/octo-runtime-protocol/schema/kernel-ipc.schema.json +3 -104
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +166 -1870
- package/dist/public/codex.d.ts +0 -1
- package/dist/public/codex.js +0 -1
- package/dist/public/dsh.d.ts +0 -2
- package/dist/public/dsh.js +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/actmode.d.ts +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/actmode.js +0 -8
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-configuration-fixtures.json +0 -1219
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-fixtures.json +0 -5988
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-client.behavior.json +0 -56
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/native-invoke-fixtures.json +0 -116
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/run-protocol-fixtures.json +0 -761
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/runtime-selection-fixtures.json +0 -663
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/session-name-fixtures.json +0 -191
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/context.d.ts +0 -12
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/context.js +0 -89
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/execution-preparation.d.ts +0 -33
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/execution-preparation.js +0 -93
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/actmode.d.ts +0 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/actmode.js +0 -36
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/execution-plan.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/execution-plan.js +0 -80
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/model-context.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/model-context.js +0 -9
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/runtime-selection.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/runtime-selection.js +0 -68
- /package/node_modules/@mininglamp-oss/octo-runtime-client/{schema → fixtures}/kernel-ipc-fixtures.json +0 -0
- /package/packages/octo-runtime-protocol/{schema → test/fixtures}/kernel-ipc-fixtures.json +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { RUNTIME_SELECTION_SCHEMA } from "./runtime-selection.js";
|
|
2
1
|
export const CONTEXT_SCHEMA = "octo.context-envelope/v3";
|
|
3
2
|
export const RUNTIME_RUN_CONTRACT = Object.freeze({
|
|
4
3
|
schema_version: 7,
|
|
5
|
-
routing_schema: RUNTIME_SELECTION_SCHEMA,
|
|
6
4
|
context_schema: CONTEXT_SCHEMA,
|
|
7
5
|
approval_schema: "octo.approval-request/v1"
|
|
8
6
|
});
|
|
@@ -12,10 +10,6 @@ export const CONTEXT_MAX_ITEMS = 32;
|
|
|
12
10
|
export const DEFAULT_RUN_TIMEOUT_MS = 86_400_000;
|
|
13
11
|
export const MAX_RUN_TIMEOUT_MS = 604_800_000;
|
|
14
12
|
export const APPROVAL_MODES = ["ask", "assisted", "full_access"];
|
|
15
|
-
export function assertAgentSource(value) {
|
|
16
|
-
if (value !== "preset" && value !== "provisioned")
|
|
17
|
-
throw new TypeError("AGENT_SOURCE_INVALID");
|
|
18
|
-
}
|
|
19
13
|
export function assertApprovalMode(value) {
|
|
20
14
|
if (!APPROVAL_MODES.includes(value))
|
|
21
15
|
throw new TypeError("APPROVAL_MODE_UNSUPPORTED");
|
|
@@ -31,7 +25,9 @@ export function assertContextEnvelope(value) {
|
|
|
31
25
|
const keys = new Set();
|
|
32
26
|
for (const item of value.items) {
|
|
33
27
|
object(item, "CONTEXT_SCHEMA_INVALID");
|
|
34
|
-
|
|
28
|
+
if (item.namespace === "octo.control" && item.name === "instructions")
|
|
29
|
+
throw new TypeError("CONTROL_INSTRUCTIONS_REMOVED: controlInstructions was removed; provide application prompts in inputs.parts");
|
|
30
|
+
fields(item, ["namespace", "name", "payload"]);
|
|
35
31
|
for (const property of ["namespace", "name"]) {
|
|
36
32
|
const text = item[property];
|
|
37
33
|
if (typeof text !== "string" || text.length > 96 || !/^[a-z0-9][a-z0-9._-]*$/.test(text))
|
|
@@ -41,21 +37,7 @@ export function assertContextEnvelope(value) {
|
|
|
41
37
|
if (keys.has(key))
|
|
42
38
|
throw new TypeError("CONTEXT_KEY_DUPLICATED");
|
|
43
39
|
keys.add(key);
|
|
44
|
-
if (item.guidance !== undefined) {
|
|
45
|
-
if (typeof item.guidance !== "string")
|
|
46
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
47
|
-
if (["octo.execution", "octo.runtime", "octo.security", "octo.control"].includes(String(item.namespace)))
|
|
48
|
-
throw new TypeError("CONTEXT_GUIDANCE_FORBIDDEN");
|
|
49
|
-
}
|
|
50
40
|
object(item.payload, "CONTEXT_SCHEMA_INVALID");
|
|
51
|
-
if (item.data_format !== undefined) {
|
|
52
|
-
if (item.data_format !== "text" || !String(item.namespace).startsWith("extra."))
|
|
53
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
54
|
-
fields(item.payload, ["text"]);
|
|
55
|
-
if (typeof item.payload.text !== "string")
|
|
56
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
57
|
-
}
|
|
58
|
-
publicPayload(item.namespace, item.name, item.payload);
|
|
59
41
|
}
|
|
60
42
|
if (new TextEncoder().encode(JSON.stringify(value)).length > CONTEXT_MAX_BYTES)
|
|
61
43
|
throw new TypeError("CONTEXT_BUDGET_EXCEEDED");
|
|
@@ -92,70 +74,12 @@ export function mergeContext(defaults, overrides) {
|
|
|
92
74
|
...next.payload.mcpServers
|
|
93
75
|
}
|
|
94
76
|
};
|
|
95
|
-
if (previous && item.namespace === "octo.runtime" && item.name === "selection") {
|
|
96
|
-
for (const field of ["offline_behavior", "failover"])
|
|
97
|
-
if (next.payload[field] === undefined && previous.payload[field] !== undefined)
|
|
98
|
-
next.payload[field] = previous.payload[field];
|
|
99
|
-
}
|
|
100
|
-
if (previous && item.namespace === "octo.content" && item.name === "references")
|
|
101
|
-
next.payload.entries = mergeReferences(previous.payload.entries, next.payload.entries);
|
|
102
77
|
items.set(key, next);
|
|
103
78
|
}
|
|
104
79
|
const result = { schema: CONTEXT_SCHEMA, items: [...items.values()] };
|
|
105
80
|
assertContextEnvelope(result);
|
|
106
81
|
return JSON.parse(canonicalContext(result));
|
|
107
82
|
}
|
|
108
|
-
export function assertResolvedExecutionPlan(value) {
|
|
109
|
-
object(value, "RESOLVED_EXECUTION_PLAN_REQUIRED");
|
|
110
|
-
assertJsonValue(value);
|
|
111
|
-
fields(value, [
|
|
112
|
-
"agent_source",
|
|
113
|
-
"adapter_type",
|
|
114
|
-
"provider_agent_id",
|
|
115
|
-
"workdir",
|
|
116
|
-
"workspace",
|
|
117
|
-
"approval_mode",
|
|
118
|
-
"model",
|
|
119
|
-
"effort",
|
|
120
|
-
"actmode",
|
|
121
|
-
"runtime_limits",
|
|
122
|
-
"envs",
|
|
123
|
-
"mcp"
|
|
124
|
-
]);
|
|
125
|
-
if (value.envs !== undefined)
|
|
126
|
-
assertContextEnvs(value.envs);
|
|
127
|
-
if (value.mcp !== undefined)
|
|
128
|
-
assertContextMcp(value.mcp);
|
|
129
|
-
assertAgentSource(value.agent_source);
|
|
130
|
-
if (value.actmode !== undefined && value.actmode !== "default" && value.actmode !== "plan")
|
|
131
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
132
|
-
text(value.adapter_type);
|
|
133
|
-
assertProviderAgent(value.adapter_type, value.provider_agent_id);
|
|
134
|
-
if (typeof value.workdir !== "string")
|
|
135
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
136
|
-
if (value.workspace !== undefined) {
|
|
137
|
-
object(value.workspace, "RESOLVED_EXECUTION_PLAN_INVALID");
|
|
138
|
-
executionField("octo.execution", "workspace", value.workspace);
|
|
139
|
-
}
|
|
140
|
-
if (!value.workdir &&
|
|
141
|
-
value.agent_source !== "preset" &&
|
|
142
|
-
(!isObject(value.workspace) || value.workspace.mode !== "random"))
|
|
143
|
-
throw new TypeError("RESOLVED_EXECUTION_PLAN_INVALID");
|
|
144
|
-
if (isObject(value.workspace) &&
|
|
145
|
-
value.workspace.mode === "none" &&
|
|
146
|
-
(value.agent_source !== "preset" || value.workdir !== ""))
|
|
147
|
-
throw new TypeError("RESOLVED_EXECUTION_PLAN_INVALID");
|
|
148
|
-
if (value.agent_source === "preset" && typeof value.provider_agent_id !== "string")
|
|
149
|
-
throw new TypeError("PRESET_AGENT_TARGET_REQUIRED");
|
|
150
|
-
assertApprovalMode(value.approval_mode);
|
|
151
|
-
for (const property of ["model", "effort"])
|
|
152
|
-
if (value[property] !== undefined)
|
|
153
|
-
text(value[property]);
|
|
154
|
-
if (value.runtime_limits !== undefined) {
|
|
155
|
-
object(value.runtime_limits, "RESOLVED_EXECUTION_PLAN_INVALID");
|
|
156
|
-
limits(value.runtime_limits);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
83
|
export function assertContextMcp(value) {
|
|
160
84
|
object(value, "CONTEXT_SCHEMA_INVALID");
|
|
161
85
|
fields(value, ["mcpServers"]);
|
|
@@ -276,223 +200,10 @@ function assertMcpTimeout(value, path, maximum) {
|
|
|
276
200
|
export function assertJsonValue(value) {
|
|
277
201
|
json(value, 0);
|
|
278
202
|
}
|
|
279
|
-
export function mergeReferences(base, next) {
|
|
280
|
-
const entries = new Map([...base, ...next].map((entry) => [String(entry.resource_ref), structuredClone(entry)]));
|
|
281
|
-
return [...entries].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)).map(([, entry]) => entry);
|
|
282
|
-
}
|
|
283
|
-
function publicPayload(namespace, name, value) {
|
|
284
|
-
if (namespace === "octo.execution" && name === "actmode") {
|
|
285
|
-
fields(value, ["mode"]);
|
|
286
|
-
if (value.mode !== "default" && value.mode !== "plan")
|
|
287
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
if (namespace === "octo.execution" && name === "mcp") {
|
|
291
|
-
assertContextMcp(value);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
if (namespace === "octo.execution" && name === "envs") {
|
|
295
|
-
assertContextEnvs(value);
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
if (namespace === "octo.resources")
|
|
299
|
-
throw new TypeError("CONTEXT_TYPE_REMOVED");
|
|
300
|
-
if (namespace === "octo.execution" && name === "model") {
|
|
301
|
-
fields(value, ["selection", "reasoning"]);
|
|
302
|
-
if (!Object.keys(value).length)
|
|
303
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
304
|
-
for (const [key, setting] of Object.entries(value)) {
|
|
305
|
-
object(setting, "CONTEXT_SCHEMA_INVALID");
|
|
306
|
-
executionField("octo.execution", key === "selection" ? "model" : "reasoning", setting);
|
|
307
|
-
}
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
if ((namespace === "octo.execution" && ["adapter", "workspace", "limits"].includes(name)) ||
|
|
311
|
-
(namespace === "octo.runtime" && name === "selection") ||
|
|
312
|
-
(namespace === "octo.security" && name === "approval_policy")) {
|
|
313
|
-
executionField(namespace, name, value);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
if ((namespace === "octo.content" && ["inline", "references"].includes(name)) ||
|
|
317
|
-
(namespace === "octo.control" && name === "instructions")) {
|
|
318
|
-
fields(value, ["entries"]);
|
|
319
|
-
if (!Array.isArray(value.entries) || (name !== "instructions" && value.entries.length === 0))
|
|
320
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
321
|
-
const refs = new Set();
|
|
322
|
-
for (const entry of value.entries) {
|
|
323
|
-
object(entry, "CONTEXT_SCHEMA_INVALID");
|
|
324
|
-
if (name === "instructions") {
|
|
325
|
-
fields(entry, ["text"]);
|
|
326
|
-
text(entry.text);
|
|
327
|
-
}
|
|
328
|
-
else if (name === "references") {
|
|
329
|
-
resource(entry);
|
|
330
|
-
const ref = String(entry.resource_ref);
|
|
331
|
-
if (refs.has(ref))
|
|
332
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
333
|
-
refs.add(ref);
|
|
334
|
-
}
|
|
335
|
-
else if (name === "inline") {
|
|
336
|
-
fields(entry, ["text", "resource_ref", "source", "summary"]);
|
|
337
|
-
text(entry.text);
|
|
338
|
-
if (entry.resource_ref !== undefined)
|
|
339
|
-
text(entry.resource_ref);
|
|
340
|
-
if (entry.source !== undefined &&
|
|
341
|
-
typeof entry.source !== "string" &&
|
|
342
|
-
!isObject(entry.source))
|
|
343
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
344
|
-
if (entry.summary !== undefined && typeof entry.summary !== "string")
|
|
345
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
346
|
-
}
|
|
347
|
-
else
|
|
348
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
349
|
-
}
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
// Unknown optional types remain opaque until a consumer explicitly supports them.
|
|
353
|
-
}
|
|
354
|
-
function executionField(namespace, name, value) {
|
|
355
|
-
if (namespace === "octo.execution") {
|
|
356
|
-
if (name === "adapter") {
|
|
357
|
-
fields(value, ["type", "provider_agent_id"]);
|
|
358
|
-
text(value.type);
|
|
359
|
-
assertProviderAgent(value.type, value.provider_agent_id);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
if (name === "model" || name === "reasoning") {
|
|
363
|
-
const property = name === "model" ? "id" : "effort";
|
|
364
|
-
fields(value, [property, "use_provider_default"]);
|
|
365
|
-
if (value.use_provider_default === true && value[property] === undefined)
|
|
366
|
-
return;
|
|
367
|
-
if (value.use_provider_default !== undefined)
|
|
368
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
369
|
-
text(value[property]);
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
if (name === "workspace") {
|
|
373
|
-
fields(value, ["mode", "path"]);
|
|
374
|
-
if (value.mode === "none" && value.path === undefined)
|
|
375
|
-
return;
|
|
376
|
-
if (value.mode === "fixed") {
|
|
377
|
-
text(value.path);
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
if (value.mode === "random" && value.path === undefined)
|
|
381
|
-
return;
|
|
382
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
383
|
-
}
|
|
384
|
-
if (name === "limits") {
|
|
385
|
-
limits(value);
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
if (namespace === "octo.runtime" && name === "selection") {
|
|
390
|
-
fields(value, [
|
|
391
|
-
"mode",
|
|
392
|
-
"runtime_id",
|
|
393
|
-
"runtime_ids",
|
|
394
|
-
"strategy",
|
|
395
|
-
"offline_behavior",
|
|
396
|
-
"failover"
|
|
397
|
-
]);
|
|
398
|
-
if (value.offline_behavior !== undefined &&
|
|
399
|
-
value.offline_behavior !== "wait" &&
|
|
400
|
-
value.offline_behavior !== "fail")
|
|
401
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
402
|
-
if (value.failover !== undefined &&
|
|
403
|
-
value.failover !== "none" &&
|
|
404
|
-
value.failover !== "candidates")
|
|
405
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
406
|
-
if (value.mode === "explicit" && value.failover !== undefined && value.failover !== "none")
|
|
407
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
408
|
-
if (value.mode === "explicit" &&
|
|
409
|
-
value.runtime_ids === undefined &&
|
|
410
|
-
value.strategy === undefined) {
|
|
411
|
-
text(value.runtime_id);
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
if (value.mode === "candidates" &&
|
|
415
|
-
value.runtime_id === undefined &&
|
|
416
|
-
value.strategy === "preferred_failover") {
|
|
417
|
-
stringList(value.runtime_ids, 64, 1);
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
421
|
-
}
|
|
422
|
-
if (namespace === "octo.security" && name === "approval_policy") {
|
|
423
|
-
fields(value, ["mode"]);
|
|
424
|
-
assertApprovalMode(value.mode);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
throw new TypeError("CONTEXT_TYPE_UNSUPPORTED");
|
|
428
|
-
}
|
|
429
|
-
function limits(value) {
|
|
430
|
-
const bounds = {
|
|
431
|
-
first_frame_timeout_ms: 1_800_000,
|
|
432
|
-
model_idle_timeout_ms: 3_600_000,
|
|
433
|
-
model_idle_warning_ms: 3_600_000,
|
|
434
|
-
tool_timeout_ms: 86_400_000,
|
|
435
|
-
tool_wall_timeout_ms: 86_400_000,
|
|
436
|
-
run_timeout_ms: MAX_RUN_TIMEOUT_MS,
|
|
437
|
-
cancel_grace_ms: 60_000
|
|
438
|
-
};
|
|
439
|
-
fields(value, [...Object.keys(bounds), "model_idle_policy", "enforcement"]);
|
|
440
|
-
for (const [key, setting] of Object.entries(value)) {
|
|
441
|
-
if (key === "model_idle_policy" || key === "enforcement") {
|
|
442
|
-
if (setting !== "enforce" && setting !== "observe")
|
|
443
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
444
|
-
}
|
|
445
|
-
else
|
|
446
|
-
integer(setting, 100, bounds[key]);
|
|
447
|
-
}
|
|
448
|
-
if (value.enforcement === "observe" &&
|
|
449
|
-
["model_idle_policy", "model_idle_warning_ms", "tool_wall_timeout_ms"].some((key) => key in value))
|
|
450
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
451
|
-
}
|
|
452
|
-
function resource(value) {
|
|
453
|
-
fields(value, ["resource_ref", "resolver", "locator", "params", "authorization_ref", "revision"]);
|
|
454
|
-
text(value.resource_ref);
|
|
455
|
-
for (const property of ["authorization_ref", "revision"])
|
|
456
|
-
if (value[property] !== undefined)
|
|
457
|
-
text(value[property]);
|
|
458
|
-
if (value.params !== undefined)
|
|
459
|
-
object(value.params, "CONTEXT_SCHEMA_INVALID");
|
|
460
|
-
const locator = value.locator;
|
|
461
|
-
object(locator, "CONTEXT_SCHEMA_INVALID");
|
|
462
|
-
if (value.resolver !== "mcp")
|
|
463
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
464
|
-
fields(locator, ["server_ref", "tool"]);
|
|
465
|
-
text(locator.server_ref);
|
|
466
|
-
text(locator.tool);
|
|
467
|
-
}
|
|
468
|
-
function integer(value, minimum, maximum = Number.MAX_SAFE_INTEGER) {
|
|
469
|
-
if (!Number.isSafeInteger(value) || Number(value) < minimum || Number(value) > maximum)
|
|
470
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
471
|
-
}
|
|
472
|
-
function stringList(value, maximum, minimum = 0) {
|
|
473
|
-
if (!Array.isArray(value) ||
|
|
474
|
-
value.length < minimum ||
|
|
475
|
-
value.length > maximum ||
|
|
476
|
-
value.some((item) => typeof item !== "string" || !item) ||
|
|
477
|
-
new Set(value).size !== value.length)
|
|
478
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
479
|
-
}
|
|
480
|
-
function assertProviderAgent(type, id) {
|
|
481
|
-
if (type === "openclaw") {
|
|
482
|
-
if (typeof id !== "string" || !/^[a-z0-9_][a-z0-9_-]{0,63}$/.test(id))
|
|
483
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
484
|
-
}
|
|
485
|
-
else if (id !== undefined)
|
|
486
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
487
|
-
}
|
|
488
203
|
function fields(value, allowed) {
|
|
489
204
|
if (Object.keys(value).some((key) => !allowed.includes(key)))
|
|
490
205
|
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
491
206
|
}
|
|
492
|
-
function text(value) {
|
|
493
|
-
if (typeof value !== "string" || value.length === 0)
|
|
494
|
-
throw new TypeError("CONTEXT_SCHEMA_INVALID");
|
|
495
|
-
}
|
|
496
207
|
function isObject(value) {
|
|
497
208
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
498
209
|
}
|
|
@@ -138,6 +138,13 @@ export function assertExperiencePayload(type, payload) {
|
|
|
138
138
|
if (params.reasonCode !== undefined)
|
|
139
139
|
string(params.reasonCode);
|
|
140
140
|
break;
|
|
141
|
+
case "model_output_idle":
|
|
142
|
+
fields(params, ["silenceMs", "message"], ["silenceMs", "message"]);
|
|
143
|
+
integer(params.silenceMs, 60_000);
|
|
144
|
+
if (payload.severity !== "info" ||
|
|
145
|
+
params.message !== `${Math.floor(Number(params.silenceMs) / 1000)}s no LLM output`)
|
|
146
|
+
throw new TypeError("invalid model output idle notice");
|
|
147
|
+
break;
|
|
141
148
|
case "config_warning":
|
|
142
149
|
fields(params, ["warningCode"], ["warningCode"]);
|
|
143
150
|
string(params.warningCode);
|
|
@@ -65,6 +65,8 @@ export declare const FAILURE_CATALOG: Readonly<{
|
|
|
65
65
|
}>;
|
|
66
66
|
export type PublicFailureCode = keyof typeof FAILURE_CATALOG;
|
|
67
67
|
export declare function isCodexLocalFailureReason(value: unknown): value is string;
|
|
68
|
+
/** 执行目录检查的封闭原因码;native 帧与公开失败分类共用。 */
|
|
69
|
+
export declare function isWorkdirFailureReason(value: unknown): value is "WORKDIR_REQUIRED" | "WORKDIR_INVALID" | "WORKDIR_NOT_FOUND" | "WORKDIR_NOT_DIRECTORY" | "WORKDIR_UNAVAILABLE";
|
|
68
70
|
/** native 仅允许中央目录的本地失败;不开放任意 params 或 Provider 自报错误提升。 */
|
|
69
71
|
export declare function isCodexLocalFailure(failure: FailureEnvelope): boolean;
|
|
70
72
|
/** Classify untrusted adapter/provider error data without copying raw messages or secrets into the result. */
|
|
@@ -60,6 +60,17 @@ const CODEX_LOCAL_FAILURES = Object.freeze({
|
|
|
60
60
|
export function isCodexLocalFailureReason(value) {
|
|
61
61
|
return typeof value === "string" && Object.hasOwn(CODEX_LOCAL_FAILURES, value);
|
|
62
62
|
}
|
|
63
|
+
/** 执行目录检查的封闭原因码;native 帧与公开失败分类共用。 */
|
|
64
|
+
export function isWorkdirFailureReason(value) {
|
|
65
|
+
return (typeof value === "string" &&
|
|
66
|
+
[
|
|
67
|
+
"WORKDIR_REQUIRED",
|
|
68
|
+
"WORKDIR_INVALID",
|
|
69
|
+
"WORKDIR_NOT_FOUND",
|
|
70
|
+
"WORKDIR_NOT_DIRECTORY",
|
|
71
|
+
"WORKDIR_UNAVAILABLE"
|
|
72
|
+
].includes(value));
|
|
73
|
+
}
|
|
63
74
|
/** native 仅允许中央目录的本地失败;不开放任意 params 或 Provider 自报错误提升。 */
|
|
64
75
|
export function isCodexLocalFailure(failure) {
|
|
65
76
|
const reason = failure.reasonCode;
|
|
@@ -109,13 +120,7 @@ export function classifyFailure(input, context) {
|
|
|
109
120
|
category: catalog.category,
|
|
110
121
|
stage: context.stage,
|
|
111
122
|
messageKey: catalog.messageKey,
|
|
112
|
-
params: codexLocal
|
|
113
|
-
? {}
|
|
114
|
-
: classification.reasonCode === "CODEX_FINALIZATION_TIMEOUT"
|
|
115
|
-
? {
|
|
116
|
-
configParameter: "execution_profile.agent_config.providerOptions.finalizationTimeoutMs"
|
|
117
|
-
}
|
|
118
|
-
: timeoutConfiguration(classification.code, context.source?.adapter),
|
|
123
|
+
params: codexLocal ? {} : timeoutConfiguration(classification.code),
|
|
119
124
|
retryable: codexLocal || classification.reasonCode === "CODEX_FINALIZATION_TIMEOUT"
|
|
120
125
|
? false
|
|
121
126
|
: catalog.retryable,
|
|
@@ -205,7 +210,8 @@ function safeTimeoutStage(value) {
|
|
|
205
210
|
? value
|
|
206
211
|
: undefined;
|
|
207
212
|
}
|
|
208
|
-
|
|
213
|
+
// 公共诊断只提示公共 limits;Adapter 私有配置路径由所属包文档维护,不能在此登记。
|
|
214
|
+
function timeoutConfiguration(code) {
|
|
209
215
|
const fields = {
|
|
210
216
|
"OH-ADP-3007": "first_frame_timeout_ms",
|
|
211
217
|
"OH-ADP-3008": "model_idle_timeout_ms",
|
|
@@ -215,11 +221,7 @@ function timeoutConfiguration(code, adapter) {
|
|
|
215
221
|
"OH-ADP-3012": "cancel_grace_ms"
|
|
216
222
|
};
|
|
217
223
|
if (fields[code])
|
|
218
|
-
return { configParameter: `
|
|
219
|
-
if (code === "OH-ADP-3013" && adapter === "codex")
|
|
220
|
-
return {
|
|
221
|
-
configParameter: "execution_profile.agent_config.providerOptions.appServerRequestTimeoutMs"
|
|
222
|
-
};
|
|
224
|
+
return { configParameter: `octo.execution/limits.${fields[code]}` };
|
|
223
225
|
return {};
|
|
224
226
|
}
|
|
225
227
|
function safeWatchdogEvidence(value) {
|
|
@@ -366,6 +368,9 @@ function classify(evidence, defaultDomain, adapter) {
|
|
|
366
368
|
// ACP 已明确声明失败;meta 仅作诊断,不从其中的状态码或文字猜测其他类别。
|
|
367
369
|
if (explicit === "ACP_MODEL_REQUEST_FAILED")
|
|
368
370
|
return result("OH-PRV-4010", explicit);
|
|
371
|
+
// 目录失败属于既有调用配置分类,具体原因先于 errno/正文启发式保留。
|
|
372
|
+
if (isWorkdirFailureReason(explicit))
|
|
373
|
+
return result("OH-ADP-3004", explicit);
|
|
369
374
|
for (const [reason, code] of Object.entries({
|
|
370
375
|
UNSUPPORTED_INPUT_MODALITY: "OH-INP-5001",
|
|
371
376
|
IMAGE_RECOVERY_INPUT_REQUIRED: "OH-INP-5001",
|