@mininglamp-oss/octo-runtime 1.1.8 → 1.1.10
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/README.md +3 -1
- package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.d.ts → apps/cli/dist/adapter-configuration.d.ts} +1 -0
- package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.js → apps/cli/dist/adapter-configuration.js} +1 -0
- package/apps/cli/dist/adapter-configurations.d.ts +1 -1
- package/apps/cli/dist/adapter-configurations.js +1 -1
- package/apps/cli/dist/adapters.d.ts +7 -0
- package/apps/cli/dist/adapters.js +51 -0
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/command-tree.js +3 -1
- package/apps/cli/dist/help.js +1 -1
- package/apps/cli/dist/index.js +4 -0
- package/apps/cli/dist/main.d.ts +2 -0
- package/apps/cli/dist/main.js +10 -12
- package/apps/cli/dist/manifest.json +0 -5
- package/apps/cli/dist/output.js +7 -9
- package/apps/cli/dist/playboard-interrupt.d.ts +6 -0
- package/apps/cli/dist/playboard-interrupt.js +86 -0
- package/apps/cli/dist/playboard.d.ts +2 -0
- package/apps/cli/dist/playboard.js +20 -12
- package/dist/public/executor-kernel.d.ts +2 -3
- package/dist/public/executor-kernel.js +1 -2
- package/dist/public/protocol.d.ts +1 -1
- package/dist/public/protocol.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +200 -106
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/async-questions.d.ts +27 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/async-questions.js +205 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +30 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +223 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-V5W6ZTYC.js → chunk-FGFEM7JP.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-CFKMMCO6.js → chunk-R3PDZLX5.js} +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/{chunk-LO34KB7D.js → chunk-TSRZVLIG.js} +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/dsh-sdk-NOTICE.txt +2 -2
- 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 +5 -5
- 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/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/dist/gateway.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/gateway.js +57 -13
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.d.ts +3 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +4 -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/approval.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.js +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +12 -30
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.js +125 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +51 -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 +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +10 -12
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +7 -9
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.js +86 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +20 -12
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -24
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/dist/launchd.js +12 -11
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/experience.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +8 -7
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +33 -11
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/invoke-input.js +9 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +6 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +30 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +199 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.d.ts +17 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.js +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.d.ts +9 -9
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +2 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +3 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +14 -13
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +84 -187
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -8
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +77 -53
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +15 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -12
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +6 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/contracts.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/execution/task.js +14 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/channel.js +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/interaction-card.js +2 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/session-command.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/transport/session-command.js +71 -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/dist/application/im-channel.js +14 -0
- 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-B127MhT-.js → index-BLMf2Etg.js} +2 -4
- 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/context-loader.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/browser.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +63 -12
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +110 -20
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +7 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +28 -6
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/invoke-input.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/questions.d.ts +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/questions.js +84 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +11 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +26 -28
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +157 -41
- package/apps/cli/dist/worker.d.ts +0 -1
- package/apps/cli/dist/worker.js +0 -18
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.d.ts +0 -63
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.js +0 -846
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +0 -54
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +0 -154
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +0 -18
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +0 -16
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +0 -59
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +0 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +0 -88
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +0 -42
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +0 -292
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +0 -62
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +0 -661
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.d.ts +0 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +0 -96
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +0 -279
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { assertJsonValue } from "./context.js";
|
|
2
|
+
const invalidResponse = () => Object.assign(new TypeError("INVALID_QUESTION_RESPONSE"), { code: "INVALID_QUESTION_RESPONSE" });
|
|
3
|
+
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
const text = (value) => typeof value === "string" && value.trim().length > 0 && Array.from(value).length <= 4096;
|
|
5
|
+
const fields = (value, allowed) => Object.keys(value).every((key) => allowed.includes(key));
|
|
6
|
+
/** 校验公开问题快照;不裁剪选项或把损坏的表单降为普通文字。 */
|
|
7
|
+
export function assertAsyncQuestions(value) {
|
|
8
|
+
assertJsonValue(value);
|
|
9
|
+
if (!Array.isArray(value) ||
|
|
10
|
+
value.length > 50 ||
|
|
11
|
+
value.some((question) => !record(question) ||
|
|
12
|
+
!fields(question, ["title", "options"]) ||
|
|
13
|
+
!text(question.title) ||
|
|
14
|
+
!(question.options === null ||
|
|
15
|
+
(Array.isArray(question.options) &&
|
|
16
|
+
question.options.length <= 50 &&
|
|
17
|
+
question.options.every(text)))))
|
|
18
|
+
throw new TypeError("INVALID_ASYNC_QUESTIONS");
|
|
19
|
+
}
|
|
20
|
+
/** 异步表单由交互事件授权回答;消息快照本身不代表仍有活动轮次。 */
|
|
21
|
+
export function assertQuestionRequest(value) {
|
|
22
|
+
assertJsonValue(value);
|
|
23
|
+
if (!record(value) ||
|
|
24
|
+
!fields(value, ["schema", "messageId", "questions"]) ||
|
|
25
|
+
value.schema !== "octo.question-request/v1" ||
|
|
26
|
+
typeof value.messageId !== "string" ||
|
|
27
|
+
!value.messageId ||
|
|
28
|
+
!Array.isArray(value.questions) ||
|
|
29
|
+
!value.questions.length ||
|
|
30
|
+
value.questions.length > 50)
|
|
31
|
+
throw new TypeError("INVALID_QUESTION_REQUEST");
|
|
32
|
+
for (const [index, q] of value.questions.entries()) {
|
|
33
|
+
if (!record(q) ||
|
|
34
|
+
!fields(q, ["id", "title", "options", "allowCustom"]) ||
|
|
35
|
+
q.id !== `q:${index}` ||
|
|
36
|
+
q.allowCustom !== true)
|
|
37
|
+
throw new TypeError("INVALID_QUESTION_REQUEST");
|
|
38
|
+
assertAsyncQuestions([{ title: q.title, options: q.options }]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** 只校验响应形状;题目归属、漏题和排序由持有原始表单的 Adapter 核对。 */
|
|
42
|
+
export function assertQuestionResponse(value) {
|
|
43
|
+
try {
|
|
44
|
+
assertJsonValue(value);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
throw invalidResponse();
|
|
48
|
+
}
|
|
49
|
+
if (!record(value) ||
|
|
50
|
+
!fields(value, ["schema", "answers"]) ||
|
|
51
|
+
value.schema !== "octo.question-response/v1" ||
|
|
52
|
+
!Array.isArray(value.answers) ||
|
|
53
|
+
!value.answers.length ||
|
|
54
|
+
value.answers.length > 50)
|
|
55
|
+
throw invalidResponse();
|
|
56
|
+
const ids = new Set();
|
|
57
|
+
for (const answer of value.answers) {
|
|
58
|
+
if (!record(answer) ||
|
|
59
|
+
!fields(answer, ["questionId", "text"]) ||
|
|
60
|
+
typeof answer.questionId !== "string" ||
|
|
61
|
+
!/^q:(0|[1-9][0-9]?)$/.test(answer.questionId) ||
|
|
62
|
+
ids.has(answer.questionId) ||
|
|
63
|
+
!text(answer.text))
|
|
64
|
+
throw invalidResponse();
|
|
65
|
+
ids.add(answer.questionId);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** 两条补充路径使用同一原题关联;只校验并编码数据,不解析正文或执行模板。 */
|
|
69
|
+
export function questionAnswerText(request, value) {
|
|
70
|
+
assertQuestionRequest(request);
|
|
71
|
+
assertQuestionResponse(value);
|
|
72
|
+
if (value.answers.length !== request.questions.length ||
|
|
73
|
+
value.answers.some((answer) => !request.questions.some((q) => q.id === answer.questionId)))
|
|
74
|
+
throw invalidResponse();
|
|
75
|
+
return ("Answer to async user questions:\n" +
|
|
76
|
+
JSON.stringify({
|
|
77
|
+
messageId: request.messageId,
|
|
78
|
+
answers: request.questions.map((q) => ({
|
|
79
|
+
questionId: q.id,
|
|
80
|
+
title: q.title,
|
|
81
|
+
text: value.answers.find((a) => a.questionId === q.id).text
|
|
82
|
+
}))
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CanonicalEvent } from "./index.js";
|
|
2
2
|
import type { ProtocolMode, RunProtocolErrorCode, HostInvokeOptions, HostRunReceipt, HostFrame, NativeHostFrame, CanonicalHostFrame, ControlHostFrame, HostControl, NativeInteractionResponse, AdapterProtocolSupport } from "./generated/protocol-types.js";
|
|
3
3
|
export type { ProtocolMode, RunProtocolErrorCode, HostInvokeOptions, HostRunReceipt, HostFrame, NativeHostFrame, CanonicalHostFrame, ControlHostFrame, HostControl, NativeInteractionResponse, AdapterProtocolSupport };
|
|
4
|
-
export declare const RUN_PROTOCOL_ERRORS: readonly ["PROTOCOL_MODE_INVALID", "PROTOCOL_MODE_UNSUPPORTED", "EXECUTION_PROTOCOL_MISMATCH", "EXECUTION_IDENTITY_CONFLICT", "NATIVE_METHOD_UNSUPPORTED", "NATIVE_RESPONSE_INVALID", "INTERACTION_NOT_ACTIVE", "HOST_EXECUTION_FAILED", "HOST_ENDED_WITHOUT_TERMINAL", "PROVIDER_MESSAGE_TOO_LARGE", "HOST_FRAME_TOO_LARGE", "STREAM_QUEUE_ITEM_TOO_LARGE", "STREAM_QUEUE_BYTES_EXCEEDED", "STREAM_QUEUE_ITEMS_EXCEEDED", "STREAM_GAP", "STREAM_EXPIRED", "REMOTE_NATIVE_UNSUPPORTED", "HOST_FRAME_INVALID", "HOST_CONTROL_INVALID", "HOST_RECEIPT_INVALID", "PROTOCOL_SUPPORT_INVALID"];
|
|
4
|
+
export declare const RUN_PROTOCOL_ERRORS: readonly ["PROTOCOL_MODE_INVALID", "PROTOCOL_MODE_UNSUPPORTED", "EXECUTION_PROTOCOL_MISMATCH", "EXECUTION_IDENTITY_CONFLICT", "NATIVE_METHOD_UNSUPPORTED", "NATIVE_RESPONSE_INVALID", "INTERACTION_NOT_ACTIVE", "INVALID_QUESTION_RESPONSE", "ASYNC_ANSWER_REJECTED", "OPERATION_OUTCOME_UNKNOWN", "HOST_EXECUTION_FAILED", "HOST_ENDED_WITHOUT_TERMINAL", "PROVIDER_MESSAGE_TOO_LARGE", "HOST_FRAME_TOO_LARGE", "STREAM_QUEUE_ITEM_TOO_LARGE", "STREAM_QUEUE_BYTES_EXCEEDED", "STREAM_QUEUE_ITEMS_EXCEEDED", "STREAM_GAP", "STREAM_EXPIRED", "REMOTE_NATIVE_UNSUPPORTED", "HOST_FRAME_INVALID", "HOST_CONTROL_INVALID", "HOST_RECEIPT_INVALID", "PROTOCOL_SUPPORT_INVALID"];
|
|
5
5
|
export declare function protocolError(code: (typeof RUN_PROTOCOL_ERRORS)[number], message?: string): Error & {
|
|
6
6
|
code: (typeof RUN_PROTOCOL_ERRORS)[number];
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assertJsonValue } from "./context.js";
|
|
2
2
|
import { assertExecutionEvidence } from "./actmode.js";
|
|
3
3
|
import { assertCanonicalEvent, assertFailureEnvelope } from "./index.js";
|
|
4
|
-
import { safeCapacityEvidence } from "./failure.js";
|
|
4
|
+
import { safeCapacityEvidence, isCodexLocalFailure } from "./failure.js";
|
|
5
5
|
import { isStreamCapacityReason } from "./stream-limits.js";
|
|
6
6
|
export const RUN_PROTOCOL_ERRORS = [
|
|
7
7
|
"PROTOCOL_MODE_INVALID",
|
|
@@ -11,6 +11,9 @@ export const RUN_PROTOCOL_ERRORS = [
|
|
|
11
11
|
"NATIVE_METHOD_UNSUPPORTED",
|
|
12
12
|
"NATIVE_RESPONSE_INVALID",
|
|
13
13
|
"INTERACTION_NOT_ACTIVE",
|
|
14
|
+
"INVALID_QUESTION_RESPONSE",
|
|
15
|
+
"ASYNC_ANSWER_REJECTED",
|
|
16
|
+
"OPERATION_OUTCOME_UNKNOWN",
|
|
14
17
|
"HOST_EXECUTION_FAILED",
|
|
15
18
|
"HOST_ENDED_WITHOUT_TERMINAL",
|
|
16
19
|
"PROVIDER_MESSAGE_TOO_LARGE",
|
|
@@ -124,8 +127,9 @@ export function assertHostControl(value) {
|
|
|
124
127
|
try {
|
|
125
128
|
assertFailureEnvelope(value.failure);
|
|
126
129
|
const evidence = safeCapacityEvidence(value.failure.params);
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
const localCodex = value.code === "HOST_EXECUTION_FAILED" && isCodexLocalFailure(value.failure);
|
|
131
|
+
if ((!localCodex &&
|
|
132
|
+
(!isStreamCapacityReason(value.code) || value.failure.reasonCode !== value.code)) ||
|
|
129
133
|
!exactKeys(value.failure, [
|
|
130
134
|
"schemaVersion",
|
|
131
135
|
"code",
|
|
@@ -154,11 +158,13 @@ export function assertHostControl(value) {
|
|
|
154
158
|
return;
|
|
155
159
|
}
|
|
156
160
|
if (value.type === "interaction" &&
|
|
157
|
-
exactKeys(value, ["type", "requestId", "status"], ["expiresAt"]) &&
|
|
161
|
+
exactKeys(value, ["type", "requestId", "status"], ["expiresAt", "responseRequired"]) &&
|
|
158
162
|
requestId(value.requestId) &&
|
|
159
163
|
["pending", "resolved", "expired", "invalidated"].includes(String(value.status)) &&
|
|
160
164
|
(!Object.hasOwn(value, "expiresAt") || safeInteger(value.expiresAt, 1)) &&
|
|
161
|
-
(value.status !== "pending" || safeInteger(value.expiresAt, 1))
|
|
165
|
+
(value.status !== "pending" || safeInteger(value.expiresAt, 1)) &&
|
|
166
|
+
(!Object.hasOwn(value, "responseRequired") ||
|
|
167
|
+
(value.status === "pending" && typeof value.responseRequired === "boolean")))
|
|
162
168
|
return;
|
|
163
169
|
if (value.type === "gap" &&
|
|
164
170
|
exactKeys(value, ["type", "requested_after_seq", "oldest_seq", "latest_seq"]) &&
|
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.10",
|
|
4
4
|
"description": "Provider-neutral Agent runtime for unified execution through provider adapters",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -87,32 +87,31 @@
|
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"commander": "15.0.0",
|
|
90
|
-
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.
|
|
90
|
+
"@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.10",
|
|
91
91
|
"semver": "7.8.5",
|
|
92
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
93
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
92
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.10",
|
|
93
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.10",
|
|
94
94
|
"import-meta-resolve": "4.2.0",
|
|
95
|
-
"@mininglamp-oss/octo-runtime-extra-webui": "1.1.
|
|
96
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
97
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
98
|
-
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.
|
|
99
|
-
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.
|
|
100
|
-
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.
|
|
101
|
-
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.
|
|
102
|
-
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.
|
|
103
|
-
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.
|
|
104
|
-
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.
|
|
105
|
-
"@mininglamp-oss/octo-runtime-executor-core": "1.1.
|
|
106
|
-
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.
|
|
107
|
-
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.
|
|
108
|
-
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.
|
|
95
|
+
"@mininglamp-oss/octo-runtime-extra-webui": "1.1.10",
|
|
96
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.10",
|
|
97
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.10",
|
|
98
|
+
"@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.10",
|
|
99
|
+
"@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.10",
|
|
100
|
+
"@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.10",
|
|
101
|
+
"@mininglamp-oss/octo-runtime-adapter-codex": "1.1.10",
|
|
102
|
+
"@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.10",
|
|
103
|
+
"@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.10",
|
|
104
|
+
"@mininglamp-oss/octo-runtime-executor-kernel": "1.1.10",
|
|
105
|
+
"@mininglamp-oss/octo-runtime-executor-core": "1.1.10",
|
|
106
|
+
"@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.10",
|
|
107
|
+
"@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.10",
|
|
108
|
+
"@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.10",
|
|
109
109
|
"ws": "8.22.0",
|
|
110
|
-
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.
|
|
111
|
-
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.
|
|
112
|
-
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.
|
|
113
|
-
"@mininglamp-oss/octo-runtime-
|
|
114
|
-
"@mininglamp-oss/octo-runtime-
|
|
115
|
-
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.8",
|
|
110
|
+
"@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.10",
|
|
111
|
+
"@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.10",
|
|
112
|
+
"@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.10",
|
|
113
|
+
"@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.10",
|
|
114
|
+
"@mininglamp-oss/octo-runtime-host-sdk": "1.1.10",
|
|
116
115
|
"mdast-util-from-markdown": "2.1.0",
|
|
117
116
|
"@types/mdast": "4.0.4",
|
|
118
117
|
"@types/unist": "3.0.3",
|
|
@@ -148,11 +147,11 @@
|
|
|
148
147
|
"micromark-util-sanitize-uri": "2.0.1",
|
|
149
148
|
"micromark-util-decode-string": "2.0.1",
|
|
150
149
|
"unist-util-stringify-position": "4.0.0",
|
|
151
|
-
"@mininglamp-oss/octo-runtime-cross-service": "1.1.
|
|
150
|
+
"@mininglamp-oss/octo-runtime-cross-service": "1.1.10",
|
|
152
151
|
"iconv-lite": "0.7.3",
|
|
153
152
|
"safer-buffer": "2.1.2",
|
|
154
|
-
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.
|
|
155
|
-
"@mininglamp-oss/octo-runtime-cli": "1.1.
|
|
153
|
+
"@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.10",
|
|
154
|
+
"@mininglamp-oss/octo-runtime-cli": "1.1.10",
|
|
156
155
|
"json5": "2.2.3"
|
|
157
156
|
},
|
|
158
157
|
"bundleDependencies": [
|
|
@@ -180,7 +179,6 @@
|
|
|
180
179
|
"@mininglamp-oss/octo-runtime-adapter-opencode",
|
|
181
180
|
"@mininglamp-oss/octo-runtime-adapter-qodercli",
|
|
182
181
|
"@mininglamp-oss/octo-runtime-adapter-qoderclicn",
|
|
183
|
-
"@mininglamp-oss/octo-runtime-adapter-zcode-gui",
|
|
184
182
|
"@mininglamp-oss/octo-runtime-extra-channel-gateway",
|
|
185
183
|
"@mininglamp-oss/octo-runtime-host-sdk",
|
|
186
184
|
"mdast-util-from-markdown",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"title": "KernelStatus",
|
|
127
127
|
"type": "object",
|
|
128
128
|
"additionalProperties": false,
|
|
129
|
-
"required": ["ipc_version", "kernel_instance_id", "pid", "
|
|
129
|
+
"required": ["ipc_version", "kernel_instance_id", "pid", "execution_ready"],
|
|
130
130
|
"properties": {
|
|
131
131
|
"ipc_version": {
|
|
132
132
|
"const": 1
|
|
@@ -141,42 +141,6 @@
|
|
|
141
141
|
},
|
|
142
142
|
"execution_ready": {
|
|
143
143
|
"type": "boolean"
|
|
144
|
-
},
|
|
145
|
-
"worker": {
|
|
146
|
-
"type": "object",
|
|
147
|
-
"additionalProperties": false,
|
|
148
|
-
"required": ["generation", "state", "restart_attempt"],
|
|
149
|
-
"properties": {
|
|
150
|
-
"pid": {
|
|
151
|
-
"type": "integer",
|
|
152
|
-
"minimum": 1
|
|
153
|
-
},
|
|
154
|
-
"generation": {
|
|
155
|
-
"type": "integer",
|
|
156
|
-
"minimum": 0
|
|
157
|
-
},
|
|
158
|
-
"restart_attempt": {
|
|
159
|
-
"type": "integer",
|
|
160
|
-
"minimum": 0
|
|
161
|
-
},
|
|
162
|
-
"recovery": {
|
|
163
|
-
"type": "object",
|
|
164
|
-
"additionalProperties": false,
|
|
165
|
-
"required": ["trigger", "stage", "code", "occurred_at"],
|
|
166
|
-
"properties": {
|
|
167
|
-
"trigger": { "enum": ["exit", "error", "heartbeat", "ipc"] },
|
|
168
|
-
"stage": { "enum": ["cleanup", "manifest", "starting", "backoff"] },
|
|
169
|
-
"code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,95}$" },
|
|
170
|
-
"occurred_at": { "type": "string", "format": "date-time" },
|
|
171
|
-
"retry_at": { "type": "string", "format": "date-time" },
|
|
172
|
-
"exit_code": { "type": "integer" },
|
|
173
|
-
"signal": { "type": "string", "pattern": "^SIG[A-Z0-9]+$" }
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
"state": {
|
|
177
|
-
"enum": ["starting", "ready", "recovering", "stopped", "exhausted"]
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
144
|
}
|
|
181
145
|
}
|
|
182
146
|
},
|
|
@@ -190,6 +154,9 @@
|
|
|
190
154
|
"NATIVE_METHOD_UNSUPPORTED",
|
|
191
155
|
"NATIVE_RESPONSE_INVALID",
|
|
192
156
|
"INTERACTION_NOT_ACTIVE",
|
|
157
|
+
"INVALID_QUESTION_RESPONSE",
|
|
158
|
+
"ASYNC_ANSWER_REJECTED",
|
|
159
|
+
"OPERATION_OUTCOME_UNKNOWN",
|
|
193
160
|
"HOST_EXECUTION_FAILED",
|
|
194
161
|
"HOST_ENDED_WITHOUT_TERMINAL",
|
|
195
162
|
"PROVIDER_MESSAGE_TOO_LARGE",
|
|
@@ -484,6 +451,10 @@
|
|
|
484
451
|
"status": {
|
|
485
452
|
"enum": ["pending", "resolved", "expired", "invalidated"]
|
|
486
453
|
},
|
|
454
|
+
"responseRequired": {
|
|
455
|
+
"description": "Whether an external response is required. Omission means required; false does not imply resolution or completion.",
|
|
456
|
+
"type": "boolean"
|
|
457
|
+
},
|
|
487
458
|
"expiresAt": {
|
|
488
459
|
"type": "integer",
|
|
489
460
|
"minimum": 1,
|
|
@@ -499,6 +470,9 @@
|
|
|
499
470
|
},
|
|
500
471
|
"then": {
|
|
501
472
|
"required": ["expiresAt"]
|
|
473
|
+
},
|
|
474
|
+
"else": {
|
|
475
|
+
"not": { "required": ["responseRequired"] }
|
|
502
476
|
}
|
|
503
477
|
},
|
|
504
478
|
{
|
|
@@ -1824,7 +1798,7 @@
|
|
|
1824
1798
|
"run_timeout_ms": {
|
|
1825
1799
|
"type": "integer",
|
|
1826
1800
|
"minimum": 100,
|
|
1827
|
-
"maximum":
|
|
1801
|
+
"maximum": 604800000
|
|
1828
1802
|
},
|
|
1829
1803
|
"cancel_grace_ms": {
|
|
1830
1804
|
"type": "integer",
|
|
@@ -2449,6 +2423,10 @@
|
|
|
2449
2423
|
"description": "Whether the provider declares that later invocations can resume this session.",
|
|
2450
2424
|
"type": "boolean"
|
|
2451
2425
|
},
|
|
2426
|
+
"requireResume": {
|
|
2427
|
+
"description": "Require the original provider session; adapters must reject rather than start a fresh fallback. Currently implemented by Codex.",
|
|
2428
|
+
"type": "boolean"
|
|
2429
|
+
},
|
|
2452
2430
|
"resumeOutcome": {
|
|
2453
2431
|
"description": "Continuity outcome for this session update. Compaction applies to the next turn; fresh fallback applies to the current turn.",
|
|
2454
2432
|
"type": "string",
|
|
@@ -2503,7 +2481,7 @@
|
|
|
2503
2481
|
"runTimeoutMs": {
|
|
2504
2482
|
"type": "integer",
|
|
2505
2483
|
"minimum": 100,
|
|
2506
|
-
"maximum":
|
|
2484
|
+
"maximum": 604800000
|
|
2507
2485
|
},
|
|
2508
2486
|
"cancelGraceMs": {
|
|
2509
2487
|
"type": "integer",
|
|
@@ -2578,12 +2556,113 @@
|
|
|
2578
2556
|
}
|
|
2579
2557
|
}
|
|
2580
2558
|
},
|
|
2559
|
+
"AsyncUserInputQuestion": {
|
|
2560
|
+
"type": "object",
|
|
2561
|
+
"additionalProperties": false,
|
|
2562
|
+
"required": ["title", "options"],
|
|
2563
|
+
"properties": {
|
|
2564
|
+
"title": {
|
|
2565
|
+
"type": "string",
|
|
2566
|
+
"minLength": 1,
|
|
2567
|
+
"maxLength": 4096,
|
|
2568
|
+
"pattern": "[^\u0009-\u000d\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]"
|
|
2569
|
+
},
|
|
2570
|
+
"options": {
|
|
2571
|
+
"type": ["array", "null"],
|
|
2572
|
+
"maxItems": 50,
|
|
2573
|
+
"items": {
|
|
2574
|
+
"type": "string",
|
|
2575
|
+
"minLength": 1,
|
|
2576
|
+
"maxLength": 4096,
|
|
2577
|
+
"pattern": "[^\u0009-\u000d\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]"
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
},
|
|
2582
|
+
"QuestionRequest": {
|
|
2583
|
+
"description": "Non-blocking question batch. IDs are positions scoped to this interaction, not provider-native question IDs.",
|
|
2584
|
+
"type": "object",
|
|
2585
|
+
"additionalProperties": false,
|
|
2586
|
+
"required": ["schema", "messageId", "questions"],
|
|
2587
|
+
"properties": {
|
|
2588
|
+
"schema": { "const": "octo.question-request/v1", "type": "string" },
|
|
2589
|
+
"messageId": { "type": "string", "minLength": 1 },
|
|
2590
|
+
"questions": {
|
|
2591
|
+
"type": "array",
|
|
2592
|
+
"minItems": 1,
|
|
2593
|
+
"maxItems": 50,
|
|
2594
|
+
"items": {
|
|
2595
|
+
"type": "object",
|
|
2596
|
+
"additionalProperties": false,
|
|
2597
|
+
"required": ["id", "title", "options", "allowCustom"],
|
|
2598
|
+
"properties": {
|
|
2599
|
+
"id": { "type": "string", "pattern": "^q:(0|[1-9][0-9]?)$" },
|
|
2600
|
+
"title": {
|
|
2601
|
+
"type": "string",
|
|
2602
|
+
"minLength": 1,
|
|
2603
|
+
"maxLength": 4096,
|
|
2604
|
+
"pattern": "[^\u0009-\u000d\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]"
|
|
2605
|
+
},
|
|
2606
|
+
"options": {
|
|
2607
|
+
"type": ["array", "null"],
|
|
2608
|
+
"maxItems": 50,
|
|
2609
|
+
"items": {
|
|
2610
|
+
"type": "string",
|
|
2611
|
+
"minLength": 1,
|
|
2612
|
+
"maxLength": 4096,
|
|
2613
|
+
"pattern": "[^\u0009-\u000d\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]"
|
|
2614
|
+
}
|
|
2615
|
+
},
|
|
2616
|
+
"allowCustom": { "type": "boolean", "const": true }
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
},
|
|
2622
|
+
"QuestionResponse": {
|
|
2623
|
+
"type": "object",
|
|
2624
|
+
"additionalProperties": false,
|
|
2625
|
+
"required": ["schema", "answers"],
|
|
2626
|
+
"properties": {
|
|
2627
|
+
"schema": { "type": "string", "const": "octo.question-response/v1" },
|
|
2628
|
+
"answers": {
|
|
2629
|
+
"type": "array",
|
|
2630
|
+
"minItems": 1,
|
|
2631
|
+
"maxItems": 50,
|
|
2632
|
+
"items": {
|
|
2633
|
+
"type": "object",
|
|
2634
|
+
"additionalProperties": false,
|
|
2635
|
+
"required": ["questionId", "text"],
|
|
2636
|
+
"properties": {
|
|
2637
|
+
"questionId": { "type": "string", "pattern": "^q:(0|[1-9][0-9]?)$" },
|
|
2638
|
+
"text": {
|
|
2639
|
+
"type": "string",
|
|
2640
|
+
"minLength": 1,
|
|
2641
|
+
"maxLength": 4096,
|
|
2642
|
+
"pattern": "[^\u0009-\u000d\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]"
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
},
|
|
2581
2649
|
"CanonicalEventPayload": {
|
|
2582
2650
|
"title": "CanonicalEventPayload",
|
|
2583
2651
|
"description": "Shared canonical event payload. The open dictionary carries structured tool, surface, and usage fields while common lifecycle fields remain explicit.",
|
|
2584
2652
|
"type": "object",
|
|
2585
2653
|
"additionalProperties": true,
|
|
2586
2654
|
"properties": {
|
|
2655
|
+
"delivery": {
|
|
2656
|
+
"description": "Async questions do not block provider work. Omitted for existing synchronous interactions.",
|
|
2657
|
+
"type": "string",
|
|
2658
|
+
"const": "async"
|
|
2659
|
+
},
|
|
2660
|
+
"questions": {
|
|
2661
|
+
"description": "Message snapshot only; an active interaction.requested authorizes submission.",
|
|
2662
|
+
"type": "array",
|
|
2663
|
+
"maxItems": 50,
|
|
2664
|
+
"items": { "$ref": "#/definitions/AsyncUserInputQuestion" }
|
|
2665
|
+
},
|
|
2587
2666
|
"providerSession": {
|
|
2588
2667
|
"$ref": "#/definitions/ProviderSession"
|
|
2589
2668
|
},
|
|
@@ -2629,13 +2708,31 @@
|
|
|
2629
2708
|
}
|
|
2630
2709
|
}
|
|
2631
2710
|
},
|
|
2711
|
+
"AsyncQuestionReplySnapshot": {
|
|
2712
|
+
"description": "Host-owned supplement state, never stored by Kernel. Submitting or unknown records cannot be replayed.",
|
|
2713
|
+
"type": "object",
|
|
2714
|
+
"additionalProperties": false,
|
|
2715
|
+
"required": ["schema", "ref", "question", "providerSession", "completed", "phase"],
|
|
2716
|
+
"properties": {
|
|
2717
|
+
"schema": { "const": "octo.async-question-reply/v1" },
|
|
2718
|
+
"ref": { "$ref": "#/definitions/KernelRunRef" },
|
|
2719
|
+
"question": { "$ref": "#/definitions/InteractionRequestedPayload" },
|
|
2720
|
+
"providerSession": { "$ref": "#/definitions/ProviderSession" },
|
|
2721
|
+
"providerEpoch": { "type": "integer", "minimum": 0 },
|
|
2722
|
+
"completed": { "type": "boolean" },
|
|
2723
|
+
"phase": {
|
|
2724
|
+
"enum": ["pending", "submitting", "answered", "cancelled", "invalidated", "unknown"]
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
},
|
|
2632
2728
|
"InteractionRequestedPayload": {
|
|
2633
2729
|
"title": "InteractionRequestedPayload",
|
|
2634
|
-
"description": "Provider-neutral
|
|
2730
|
+
"description": "Provider-neutral interaction. Omitted delivery retains synchronous blocking semantics; async questions allow continued work. Only Adapter-owned automatic approvals may omit external responses; this does not imply completion.",
|
|
2635
2731
|
"type": "object",
|
|
2636
2732
|
"additionalProperties": false,
|
|
2637
|
-
"required": ["interactionId", "kind", "request", "executionInstanceId"
|
|
2733
|
+
"required": ["interactionId", "kind", "request", "executionInstanceId"],
|
|
2638
2734
|
"properties": {
|
|
2735
|
+
"delivery": { "type": "string", "const": "async" },
|
|
2639
2736
|
"executionInstanceId": {
|
|
2640
2737
|
"type": "string",
|
|
2641
2738
|
"minLength": 1,
|
|
@@ -2655,6 +2752,10 @@
|
|
|
2655
2752
|
"type": "string",
|
|
2656
2753
|
"enum": ["approval", "question", "elicitation"]
|
|
2657
2754
|
},
|
|
2755
|
+
"responseRequired": {
|
|
2756
|
+
"description": "Whether an external response is required. Omission means required; only an Adapter-owned automatic approval may set false.",
|
|
2757
|
+
"type": "boolean"
|
|
2758
|
+
},
|
|
2658
2759
|
"request": {
|
|
2659
2760
|
"description": "Display-safe provider request projected for the responding product.",
|
|
2660
2761
|
"type": "object",
|
|
@@ -2662,6 +2763,18 @@
|
|
|
2662
2763
|
"tsType": "Record<string, unknown>"
|
|
2663
2764
|
}
|
|
2664
2765
|
},
|
|
2766
|
+
"allOf": [
|
|
2767
|
+
{
|
|
2768
|
+
"if": { "required": ["delivery"], "properties": { "delivery": { "const": "async" } } },
|
|
2769
|
+
"then": {
|
|
2770
|
+
"properties": {
|
|
2771
|
+
"kind": { "const": "question" },
|
|
2772
|
+
"request": { "$ref": "#/definitions/QuestionRequest" }
|
|
2773
|
+
}
|
|
2774
|
+
},
|
|
2775
|
+
"else": { "required": ["expiresAt"] }
|
|
2776
|
+
}
|
|
2777
|
+
],
|
|
2665
2778
|
"if": {
|
|
2666
2779
|
"properties": {
|
|
2667
2780
|
"kind": {
|
|
@@ -2676,6 +2789,9 @@
|
|
|
2676
2789
|
"$ref": "#/definitions/ApprovalRequest"
|
|
2677
2790
|
}
|
|
2678
2791
|
}
|
|
2792
|
+
},
|
|
2793
|
+
"else": {
|
|
2794
|
+
"properties": { "responseRequired": { "const": true } }
|
|
2679
2795
|
}
|
|
2680
2796
|
},
|
|
2681
2797
|
"ApprovalRequest": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/apps/cli/dist/worker.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// CLI 自有执行 worker。顶层 Kernel 仍由 CLI 调用进程创建;SDK 原生入口不使用此装配。
|
|
2
|
-
import { loadManifestAdapters } from "@mininglamp-oss/octo-runtime-executor-kernel/manifest-adapters";
|
|
3
|
-
import { serveWorker } from "@mininglamp-oss/octo-runtime-executor-kernel";
|
|
4
|
-
import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
|
|
5
|
-
import { dirname, join } from "node:path";
|
|
6
|
-
const adapters = await loadManifestAdapters();
|
|
7
|
-
// 旧显式清单允许省略 type;以所选实例真实类型判断,不猜包名,也不在父进程重复实例化。
|
|
8
|
-
if (adapters.some((adapter) => adapter.metadata.type === "openclaw")) {
|
|
9
|
-
const profileRoot = process.env.OCTO_RUNTIME_CLI_PROFILE_ROOT;
|
|
10
|
-
if (!profileRoot)
|
|
11
|
-
throw new Error("CLI_PROFILE_ROOT_REQUIRED");
|
|
12
|
-
const { initializeCliOpenClaw, syncCliOpenClawToolEnvironment } = await import("./openclaw.js");
|
|
13
|
-
await initializeCliOpenClaw(profileRoot);
|
|
14
|
-
if (process.env.OCTO_RUNTIME_CLI_SYNC_OPENCLAW_TOOLS === "1")
|
|
15
|
-
await syncCliOpenClawToolEnvironment(profileRoot, await readExtraDirectory(join(dirname(profileRoot), "extras")));
|
|
16
|
-
}
|
|
17
|
-
// 产品连接准备完成后才建立既有 list/probe 握手;所有实例仅交给唯一 Core 注册一次。
|
|
18
|
-
serveWorker(adapters);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { type AcpApprovalBridge, type AdapterInvocationContext, type CanonicalEvent, type InvokeRequest } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
-
import { type ChildProcessWithoutNullStreams } from "node:child_process";
|
|
3
|
-
type JsonRecord = Record<string, unknown>;
|
|
4
|
-
interface ProcessExit {
|
|
5
|
-
code: number | null;
|
|
6
|
-
signal: NodeJS.Signals | null;
|
|
7
|
-
}
|
|
8
|
-
export interface ZcodeSessionEvent {
|
|
9
|
-
sessionId: string;
|
|
10
|
-
seq?: number;
|
|
11
|
-
type: string;
|
|
12
|
-
payload?: JsonRecord;
|
|
13
|
-
}
|
|
14
|
-
export interface ZcodeAppServerCommand {
|
|
15
|
-
command: string;
|
|
16
|
-
args: string[];
|
|
17
|
-
cwd: string;
|
|
18
|
-
env: NodeJS.ProcessEnv;
|
|
19
|
-
cleanup?: () => void | Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
export type ZcodeAppServerSpawn = (command: string, args: readonly string[], options: {
|
|
22
|
-
cwd: string;
|
|
23
|
-
env: NodeJS.ProcessEnv;
|
|
24
|
-
detached: boolean;
|
|
25
|
-
}) => ChildProcessWithoutNullStreams;
|
|
26
|
-
export declare class ZcodeAppServerRpcError extends Error {
|
|
27
|
-
readonly method: string;
|
|
28
|
-
readonly code: string | number;
|
|
29
|
-
readonly data?: unknown | undefined;
|
|
30
|
-
constructor(method: string, code: string | number, message: string, data?: unknown | undefined);
|
|
31
|
-
}
|
|
32
|
-
export declare class ZcodeAppServerProcessError extends Error {
|
|
33
|
-
readonly exit: ProcessExit;
|
|
34
|
-
constructor(message: string, exit: ProcessExit);
|
|
35
|
-
}
|
|
36
|
-
export interface NormalizerState {
|
|
37
|
-
stepId: string;
|
|
38
|
-
stepStarted: boolean;
|
|
39
|
-
stepFinished: boolean;
|
|
40
|
-
finalMessageStarted: boolean;
|
|
41
|
-
reasoningMessageStarted: boolean;
|
|
42
|
-
publicText: string;
|
|
43
|
-
tools: Map<string, {
|
|
44
|
-
name: string;
|
|
45
|
-
input: unknown;
|
|
46
|
-
terminal: boolean;
|
|
47
|
-
created: boolean;
|
|
48
|
-
}>;
|
|
49
|
-
}
|
|
50
|
-
export declare class ZcodeEventNormalizer {
|
|
51
|
-
#private;
|
|
52
|
-
constructor(runId: string);
|
|
53
|
-
normalize(event: ZcodeSessionEvent): CanonicalEvent[];
|
|
54
|
-
}
|
|
55
|
-
export declare function normalizeZcodeEvent(event: ZcodeSessionEvent, state: NormalizerState): CanonicalEvent[];
|
|
56
|
-
export declare function runZcodeAppServerTurn({ request, spec, spawnFn, context, approvalBridge }: {
|
|
57
|
-
request: InvokeRequest;
|
|
58
|
-
spec: ZcodeAppServerCommand;
|
|
59
|
-
context?: AdapterInvocationContext;
|
|
60
|
-
spawnFn?: ZcodeAppServerSpawn;
|
|
61
|
-
approvalBridge?: AcpApprovalBridge;
|
|
62
|
-
}): AsyncGenerator<CanonicalEvent>;
|
|
63
|
-
export {};
|