@mininglamp-oss/octo-runtime 1.1.13 → 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/apps/cli/dist/adapters.js +1 -5
- package/apps/cli/dist/build-info.json +2 -2
- package/dist/public/protocol.d.ts +1 -1
- 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 +19 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +24 -29
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/dist/index.js +0 -1
- 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.js +23 -24
- 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.js +1 -2
- 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.js +25 -30
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +0 -2
- 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 +2 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/dist/index.js +5 -8
- 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 +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/dist/adapter.js +8 -18
- 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/index.js +1 -12
- 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 +16 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/dist/index.js +1 -2
- 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 +16 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/dist/index.js +1 -2
- 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 +16 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/dist/index.js +1 -2
- 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 +0 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/dist/index.js +2 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.js +6 -3
- 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 +16 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/dist/index.js +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.d.ts +16 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/dist/index.js +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/agent-env.d.ts +2 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/agent-env.js +6 -28
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +2 -7
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +1 -5
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- 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/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +42 -624
- 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 +97 -12
- 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 +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/watchdog.js +3 -4
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- 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/context-catalog.js +1 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/context.js +1 -26
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/experience.js +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/failure.js +3 -12
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +16 -240
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +3 -5
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +2 -12
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/run-protocol.js +0 -12
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +24 -24
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +42 -624
- 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-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/runtime-selection.d.ts +0 -3
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/runtime-selection.js +0 -68
|
@@ -182,11 +182,7 @@ function callFactory(value, entry, env) {
|
|
|
182
182
|
function isHostedAdapter(value) {
|
|
183
183
|
if (!isRecord(value) || !isRecord(value.metadata))
|
|
184
184
|
return false;
|
|
185
|
-
return
|
|
186
|
-
Array.isArray(value.metadata.agentSources) &&
|
|
187
|
-
value.metadata.agentSources.length > 0 &&
|
|
188
|
-
value.metadata.agentSources.every((source) => source === "preset" || source === "provisioned") &&
|
|
189
|
-
typeof value.invoke === "function");
|
|
185
|
+
return typeof value.metadata.type === "string" && typeof value.invoke === "function";
|
|
190
186
|
}
|
|
191
187
|
function isScopeCleanup(value) {
|
|
192
188
|
if (!isRecord(value) || typeof value.complete !== "boolean")
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type * from "@mininglamp-oss/octo-runtime-protocol";
|
|
2
|
-
export type { CanonicalEventWire,
|
|
2
|
+
export type { CanonicalEventWire, ContextMcpPayload, ContextModelSelectionPayload, PersistentContextEnvelope } from "@mininglamp-oss/octo-runtime-protocol/browser";
|
|
3
3
|
export { InvokeInput, assertInvokeInput, CONTEXT_SCHEMA, CONTEXT_MAX_BYTES, CONTEXT_MAX_ITEMS, RUNTIME_RUN_CONTRACT, PROTOCOL_VERSION, KERNEL_IPC_VERSION, APPROVAL_MODES, CANONICAL_EVENT_TYPES, TERMINAL_EVENT_TYPES, INTERACTION_RESPONSE_OUTCOMES, IMAGE_INPUT_LIMITS, IMAGE_INPUT_MIME_TYPES, assertContextEnvelope, assertModelInputParts, assertRuntimeLimits, assertCanonicalEvent, assertApprovalRequest, assertAsyncQuestions, assertQuestionRequest, assertQuestionResponse, questionAnswerText, assertInteractionResponse, assertNativeInteractionResponse, assertHostRunReceipt, assertHostControl, assertHostFrame, assertHostFrameIdentity, assertFailureEnvelope, isTerminal, isHostTerminal, canonicalEvents, contextItem, contextHash, messageExposure, isFailureEnvelope, failureMessage } from "@mininglamp-oss/octo-runtime-protocol";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-acp-client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -34,10 +34,9 @@ export interface AcpModelSelectionRequest {
|
|
|
34
34
|
params: JsonRecord;
|
|
35
35
|
}
|
|
36
36
|
/** 只使用 Provider 发布的模式 ID;不从产品名称、审批档位或正文猜测。 */
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function acpModeSelectionRequest(session: JsonRecord, sessionId: string, requested: string): {
|
|
38
38
|
method: "session/set_config_option" | "session/set_mode";
|
|
39
39
|
params: JsonRecord;
|
|
40
|
-
effective: "default" | "plan";
|
|
41
40
|
nativeMode: string;
|
|
42
41
|
unchanged: boolean;
|
|
43
42
|
};
|
|
@@ -51,7 +50,14 @@ export declare function createAcpAdapter(definition: AcpAdapterDefinition, { acp
|
|
|
51
50
|
env?: NodeJS.ProcessEnv;
|
|
52
51
|
probe?: () => Promise<ProbeResult>;
|
|
53
52
|
}): Readonly<Omit<{
|
|
54
|
-
metadata:
|
|
53
|
+
metadata: {
|
|
54
|
+
mcp?: boolean;
|
|
55
|
+
workspace?: boolean;
|
|
56
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
57
|
+
type: string;
|
|
58
|
+
processModel?: string;
|
|
59
|
+
transport?: string;
|
|
60
|
+
};
|
|
55
61
|
probe: (() => Promise<ProbeResult>) | (() => Promise<{
|
|
56
62
|
available: false;
|
|
57
63
|
command: string;
|
|
@@ -61,8 +67,17 @@ export declare function createAcpAdapter(definition: AcpAdapterDefinition, { acp
|
|
|
61
67
|
invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
|
|
62
68
|
}, "metadata" | "defaultAgentEnv"> & {
|
|
63
69
|
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
64
|
-
metadata: Omit<
|
|
70
|
+
metadata: Omit<{
|
|
71
|
+
mcp?: boolean;
|
|
72
|
+
workspace?: boolean;
|
|
73
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
74
|
+
type: string;
|
|
75
|
+
processModel?: string;
|
|
76
|
+
transport?: string;
|
|
77
|
+
}, "protocolSupport"> & {
|
|
65
78
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
66
79
|
};
|
|
67
80
|
}>;
|
|
81
|
+
/** ACP 包私有约定;派生 Adapter 以自己的类型命名空间选取原生 modeId。 */
|
|
82
|
+
export declare function acpModeId(request: InvokeRequest, type: string): string | undefined;
|
|
68
83
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { invocationModel, invocationApprovalMode, invocationWorkdir } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
|
+
import { agentEnvItem, invocationModel, invocationApprovalMode, invocationWorkdir } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
2
|
import { acpLoadSessionParams, acpNewSessionParams, acpPromptParams, spawnAcpClient } from "@mininglamp-oss/octo-runtime-acp-client";
|
|
3
|
-
import {
|
|
4
|
-
import { canonicalTerminalStatus,
|
|
3
|
+
import { AcpApprovalBridge, AcpTurnNormalizer, acpToolTerminalStatus, defineAdapter, invocationEnvironment, invocationMcpServers, assertMcpOptions, normalizeAcpToolUpdate, probeCommand, snapshotProviderLaunch } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
4
|
+
import { canonicalTerminalStatus, providerInputParts } from "@mininglamp-oss/octo-runtime-protocol";
|
|
5
5
|
/** 调用已失败但 ACP 传输已成功关闭;清理异常不包装成此类型。 */
|
|
6
6
|
export class AcpInvocationError extends Error {
|
|
7
7
|
constructor(cause) {
|
|
@@ -10,7 +10,7 @@ export class AcpInvocationError extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
/** 只使用 Provider 发布的模式 ID;不从产品名称、审批档位或正文猜测。 */
|
|
13
|
-
export function
|
|
13
|
+
export function acpModeSelectionRequest(session, sessionId, requested) {
|
|
14
14
|
const option = arrayField(session, "configOptions")
|
|
15
15
|
.map(recordValue)
|
|
16
16
|
.find((value) => stringField(value, "category") === "mode" || stringField(value, "id") === "mode");
|
|
@@ -23,21 +23,17 @@ export function acpActmodeSelectionRequest(session, sessionId, requested) {
|
|
|
23
23
|
})
|
|
24
24
|
.map((value) => stringField(value, "value"))
|
|
25
25
|
: arrayField(modes, "availableModes").map((value) => stringField(recordValue(value), "id"));
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const nativeMode = requested === "plan" && available.includes("plan") ? "plan" : ordinary;
|
|
32
|
-
if (!nativeMode)
|
|
33
|
-
throw new Error("ACTMODE_UNSUPPORTED: ACP did not advertise an applicable mode");
|
|
26
|
+
if (!requested.trim() || !available.includes(requested))
|
|
27
|
+
throw new Error("ACP_MODE_UNSUPPORTED: Provider did not advertise the requested mode ID");
|
|
28
|
+
if (option && !stringField(option, "id"))
|
|
29
|
+
throw new Error("ACP_MODE_INVALID: mode config option has no ID");
|
|
30
|
+
const nativeMode = requested;
|
|
34
31
|
return {
|
|
35
32
|
method: option ? "session/set_config_option" : "session/set_mode",
|
|
36
33
|
params: option
|
|
37
34
|
? { sessionId, configId: stringField(option, "id"), value: nativeMode }
|
|
38
35
|
: { sessionId, modeId: nativeMode },
|
|
39
36
|
nativeMode,
|
|
40
|
-
effective: nativeMode === "plan" ? "plan" : "default",
|
|
41
37
|
unchanged: (option ? stringField(option, "currentValue") : stringField(modes, "currentModeId")) ===
|
|
42
38
|
nativeMode
|
|
43
39
|
};
|
|
@@ -153,12 +149,11 @@ export function createAcpAdapter(definition, { acpClientFactory = spawnAcpClient
|
|
|
153
149
|
? snapshotProviderLaunch({ command, args: commandArgsPrefix, env })
|
|
154
150
|
: { command, args: [...commandArgsPrefix], env: { ...env } };
|
|
155
151
|
const responders = new Map();
|
|
152
|
+
// 私有条目按最终注册身份读取;宿主可复用传输定义并覆盖 metadata.type。
|
|
153
|
+
// 固定构造时的 metadata,避免调用方后来修改定义对象改变本包读取的命名空间。
|
|
154
|
+
const metadata = { ...(definition.metadata ?? { mcp: true, type: definition.type }) };
|
|
156
155
|
return defineAdapter({
|
|
157
|
-
metadata
|
|
158
|
-
mcp: true,
|
|
159
|
-
type: definition.type,
|
|
160
|
-
agentSources: ["provisioned"]
|
|
161
|
-
},
|
|
156
|
+
metadata,
|
|
162
157
|
probe: probe ??
|
|
163
158
|
(acpClientFactory === spawnAcpClient
|
|
164
159
|
? () => probeCommand(launch.command, { args: launch.args, env: launch.env })
|
|
@@ -306,20 +301,11 @@ export function createAcpAdapter(definition, { acpClientFactory = spawnAcpClient
|
|
|
306
301
|
}
|
|
307
302
|
}
|
|
308
303
|
};
|
|
309
|
-
const requestedMode =
|
|
304
|
+
const requestedMode = acpModeId(request, metadata.type);
|
|
310
305
|
if (requestedMode !== undefined) {
|
|
311
|
-
const selection =
|
|
306
|
+
const selection = acpModeSelectionRequest(sessionResult, sessionId, requestedMode);
|
|
312
307
|
if (!selection.unchanged)
|
|
313
308
|
await client.request(selection.method, selection.params);
|
|
314
|
-
yield actmodeEvidence({
|
|
315
|
-
requested: requestedMode,
|
|
316
|
-
effective: selection.effective,
|
|
317
|
-
nativeMode: selection.nativeMode,
|
|
318
|
-
status: selection.effective === requestedMode ? "applied" : "fallback",
|
|
319
|
-
...(selection.effective !== requestedMode
|
|
320
|
-
? { reason: "provider_unsupported" }
|
|
321
|
-
: {})
|
|
322
|
-
});
|
|
323
309
|
}
|
|
324
310
|
const requestedModel = nonEmptyString(invocationModel(request));
|
|
325
311
|
if (requestedModel) {
|
|
@@ -550,3 +536,12 @@ function nonEmptyString(value) {
|
|
|
550
536
|
function stringField(value, key) {
|
|
551
537
|
return typeof value[key] === "string" ? value[key] : undefined;
|
|
552
538
|
}
|
|
539
|
+
/** ACP 包私有约定;派生 Adapter 以自己的类型命名空间选取原生 modeId。 */
|
|
540
|
+
export function acpModeId(request, type) {
|
|
541
|
+
const value = agentEnvItem(request.agentEnv, `adapter.${type}`, "options")?.modeId;
|
|
542
|
+
if (value === undefined)
|
|
543
|
+
return undefined;
|
|
544
|
+
if (typeof value !== "string" || !value.trim())
|
|
545
|
+
throw new TypeError("ADAPTER_OPTION_INVALID: modeId");
|
|
546
|
+
return value;
|
|
547
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-acp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.14",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-antigravity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { agentEnvItem } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
/** 只读本轮私有 item;省略不补模式,非法显式值在原生映射前拒绝。 */
|
|
3
|
+
export function claudePlanMode(request) {
|
|
4
|
+
const value = agentEnvItem(request.agentEnv, "adapter.claude-code", "options")?.permissionMode;
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (value !== "plan")
|
|
8
|
+
throw new TypeError("ADAPTER_OPTION_INVALID: claude-code.permissionMode");
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { claudePlanMode } from "./agent-env.js";
|
|
1
2
|
export const claudeCodeMetadata = {
|
|
2
3
|
mcp: true,
|
|
3
4
|
protocolSupport: {
|
|
@@ -6,13 +7,12 @@ export const claudeCodeMetadata = {
|
|
|
6
7
|
nativeMethods: ["managed-turn", "can_use_tool", "control_response", "cancel"]
|
|
7
8
|
},
|
|
8
9
|
type: "claude-code",
|
|
9
|
-
agentSources: ["provisioned"],
|
|
10
10
|
processModel: "subprocess-per-invocation",
|
|
11
11
|
transport: "ndjson/stdio"
|
|
12
12
|
};
|
|
13
13
|
import { invocationModel, invocationEffort, invocationApprovalMode, invocationWorkdir } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
14
|
-
import { hasImageInput, invocationEnvironment, invocationMcpServers, assertMcpOptions,
|
|
15
|
-
import { canonicalTerminalStatus
|
|
14
|
+
import { hasImageInput, invocationEnvironment, invocationMcpServers, assertMcpOptions, mapReasoningEffort } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
15
|
+
import { canonicalTerminalStatus } from "@mininglamp-oss/octo-runtime-protocol";
|
|
16
16
|
/**
|
|
17
17
|
* Claude Code local CLI transport and event normalization layer.
|
|
18
18
|
*
|
|
@@ -36,9 +36,7 @@ const MAX_STEP_PUBLIC_TEXT_CHARS = 1_000;
|
|
|
36
36
|
export async function buildClaudeCommand(req, command = "claude", commandArgsPrefix = [], inherited = {}) {
|
|
37
37
|
if (hasImageInput(req))
|
|
38
38
|
throw new Error("UNSUPPORTED_INPUT_MODALITY: claude-code does not encode image input");
|
|
39
|
-
const mode =
|
|
40
|
-
? "plan"
|
|
41
|
-
: claudePermissionMode(invocationApprovalMode(req));
|
|
39
|
+
const mode = claudePlanMode(req) === "plan" ? "plan" : claudePermissionMode(invocationApprovalMode(req));
|
|
42
40
|
const servers = invocationMcpServers(req, invocationEnvironment(req, {}, inherited));
|
|
43
41
|
assertMcpOptions(servers, "claude-code", []);
|
|
44
42
|
// Native Claude expands placeholders again at connection time. Reject values
|
|
@@ -628,7 +626,7 @@ export function createClaudeCodeAdapter({ command, commandArgsPrefix = [], env =
|
|
|
628
626
|
const spec = await buildClaudeCommand(request, launch.command, [...launch.args], launch.env);
|
|
629
627
|
// The normalizer must not be hoisted to an adapter singleton: one adapter may run several invocations concurrently.
|
|
630
628
|
const normalizer = permissions instanceof NativeInteractionBridge ? undefined : new ClaudeEventNormalizer();
|
|
631
|
-
const requestedMode =
|
|
629
|
+
const requestedMode = claudePlanMode(request);
|
|
632
630
|
let modeReported = false;
|
|
633
631
|
try {
|
|
634
632
|
if (normalizer)
|
|
@@ -738,25 +736,26 @@ export function createClaudeCodeAdapter({ command, commandArgsPrefix = [], env =
|
|
|
738
736
|
})) {
|
|
739
737
|
if (requestedMode !== undefined &&
|
|
740
738
|
!modeReported &&
|
|
741
|
-
native.type === "system" &&
|
|
742
|
-
native.subtype === "init") {
|
|
739
|
+
((native.type === "system" && native.subtype === "init") || native.type === "result")) {
|
|
743
740
|
modeReported = true;
|
|
744
741
|
const nativeMode = typeof native.permissionMode === "string" ? native.permissionMode : undefined;
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
:
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
742
|
+
// 原生模式是否确认由本包解释;不再发布统一 execution evidence。
|
|
743
|
+
if (nativeMode !== requestedMode && context?.protocolMode !== "native")
|
|
744
|
+
yield {
|
|
745
|
+
protocolVersion: 2,
|
|
746
|
+
type: "run.notice",
|
|
747
|
+
payload: {
|
|
748
|
+
noticeId: `${request.invocationId}:permission-mode`,
|
|
749
|
+
code: "provider_diagnostic",
|
|
750
|
+
severity: "warning",
|
|
751
|
+
params: {
|
|
752
|
+
adapter: "claude-code",
|
|
753
|
+
diagnosticId: "permission-mode-unconfirmed",
|
|
754
|
+
category: "permission_mode_unconfirmed",
|
|
755
|
+
message: "Claude did not confirm the requested plan permission mode."
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
};
|
|
760
759
|
}
|
|
761
760
|
if (native.type === "system" && native.subtype === "init")
|
|
762
761
|
context?.reportActivity?.({ kind: "turn_started", method: "turn_start" });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-claude-code",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const codeBuddyMetadata = {
|
|
2
|
-
type: "codebuddy"
|
|
3
|
-
agentSources: ["provisioned"]
|
|
2
|
+
type: "codebuddy"
|
|
4
3
|
};
|
|
5
4
|
import { invocationModel, invocationApprovalMode, invocationWorkdir } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
6
5
|
import { invocationEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
10
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.14",
|
|
10
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { agentEnvItem } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
/** 只读本轮私有 item;省略不补模式,非法显式值在原生映射前拒绝。 */
|
|
3
|
+
export function codexCollaborationMode(request) {
|
|
4
|
+
const value = agentEnvItem(request.agentEnv, "adapter.codex", "options")?.collaborationMode;
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (value !== "default" && value !== "plan")
|
|
8
|
+
throw new TypeError("ADAPTER_OPTION_INVALID: codex.collaborationMode");
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { codexCollaborationMode } from "./agent-env.js";
|
|
1
2
|
import { invocationModel, invocationEffort, invocationProviderOptions, invocationOption, invocationApprovalMode, invocationWorkdir } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
-
import {
|
|
3
|
-
import { canonicalTerminalStatus, classifyFailure, isCodexLocalFailureReason, isStreamCapacityReason, contextHash,
|
|
3
|
+
import { invocationEnvs, mapReasoningEffort } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
4
|
+
import { canonicalTerminalStatus, classifyFailure, isCodexLocalFailureReason, isStreamCapacityReason, contextHash, assertJsonByteLimit, providerInputParts, PROVIDER_DIAGNOSTIC_MAX_BYTES, resolveStreamLimitPolicy, streamCapacityError } from "@mininglamp-oss/octo-runtime-protocol";
|
|
4
5
|
import { codexTransportError } from "./stdin-writer.js";
|
|
5
6
|
import { codexEnvironmentConfig } from "./environment.js";
|
|
6
7
|
import { CodexAsyncQuestions, asyncQuestionMetadata } from "./async-questions.js";
|
|
@@ -145,37 +146,39 @@ export async function* runCodexAppServerTurn({ request, spec, channel, context,
|
|
|
145
146
|
// 名称属于调用方;只命名本轮新建 thread,恢复时保留原生标题与句柄。
|
|
146
147
|
if (!resumed && request.sessionName)
|
|
147
148
|
await client.request("thread/name/set", { threadId, name: request.sessionName });
|
|
148
|
-
const requestedMode =
|
|
149
|
-
let collaborationMode;
|
|
150
|
-
let effectiveMode;
|
|
149
|
+
const requestedMode = codexCollaborationMode(request);
|
|
151
150
|
if (requestedMode !== undefined) {
|
|
152
151
|
const modes = recordValue(await client.request("collaborationMode/list", {}));
|
|
153
152
|
const available = Array.isArray(modes?.data) ? modes.data.map(recordValue) : [];
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
if (!available.some((mode) => mode?.mode === requestedMode))
|
|
154
|
+
throw new Error("CODEX_COLLABORATION_MODE_UNSUPPORTED");
|
|
155
|
+
}
|
|
156
|
+
// 恢复线程转为 fresh fallback 时必须重新读取新线程的模型,不能沿用旧线程默认值。
|
|
157
|
+
const collaborationSettings = () => {
|
|
158
|
+
if (requestedMode === undefined)
|
|
159
|
+
return undefined;
|
|
159
160
|
const thread = recordValue(threadResult);
|
|
160
161
|
const model = invocationModel(request) ?? stringValue(thread?.model);
|
|
161
162
|
if (!model)
|
|
162
|
-
throw new Error("
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
throw new Error("CODEX_COLLABORATION_MODE_UNCONFIRMED: Codex omitted its effective model");
|
|
164
|
+
return {
|
|
165
|
+
collaborationMode: {
|
|
166
|
+
mode: requestedMode,
|
|
167
|
+
settings: {
|
|
168
|
+
model,
|
|
169
|
+
reasoning_effort: mapReasoningEffort("codex", invocationEffort(request)) ??
|
|
170
|
+
thread?.reasoningEffort ??
|
|
171
|
+
null,
|
|
172
|
+
developer_instructions: null
|
|
173
|
+
}
|
|
171
174
|
}
|
|
172
175
|
};
|
|
173
|
-
}
|
|
176
|
+
};
|
|
174
177
|
let turnResult;
|
|
175
178
|
try {
|
|
176
179
|
turnResult = await client.request("turn/start", {
|
|
177
180
|
...turnParams(request, threadId, resumeFallback !== undefined),
|
|
178
|
-
...(
|
|
181
|
+
...collaborationSettings()
|
|
179
182
|
});
|
|
180
183
|
}
|
|
181
184
|
catch (error) {
|
|
@@ -194,21 +197,13 @@ export async function* runCodexAppServerTurn({ request, spec, channel, context,
|
|
|
194
197
|
await client.request("thread/name/set", { threadId, name: request.sessionName });
|
|
195
198
|
turnResult = await client.request("turn/start", {
|
|
196
199
|
...turnParams(request, threadId, true),
|
|
197
|
-
...(
|
|
200
|
+
...collaborationSettings()
|
|
198
201
|
});
|
|
199
202
|
}
|
|
200
203
|
const turnId = extractTurnId(turnResult);
|
|
201
204
|
if (turnId)
|
|
202
205
|
client.setActiveTurn(turnId);
|
|
203
206
|
context?.reportActivity?.({ kind: "turn_started", method: "turn_start" });
|
|
204
|
-
if (requestedMode !== undefined && effectiveMode !== undefined)
|
|
205
|
-
yield actmodeEvidence({
|
|
206
|
-
requested: requestedMode,
|
|
207
|
-
effective: effectiveMode,
|
|
208
|
-
status: effectiveMode === requestedMode ? "applied" : "fallback",
|
|
209
|
-
nativeMode: effectiveMode,
|
|
210
|
-
...(effectiveMode !== requestedMode ? { reason: "provider_unsupported" } : {})
|
|
211
|
-
}, context?.protocolMode);
|
|
212
207
|
// turn/start 成功后才发布权威会话更新,供调用方保存完整 binding;Core 不持久化业务会话绑定。
|
|
213
208
|
const session = {
|
|
214
209
|
protocolVersion: 2,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const codexMetadata = {
|
|
2
2
|
type: "codex",
|
|
3
|
-
agentSources: ["provisioned"],
|
|
4
3
|
mcp: true,
|
|
5
4
|
processModel: "host-owned-engine",
|
|
6
5
|
transport: "codex-channel",
|
|
@@ -48,7 +47,6 @@ export function createCodexAdapter({ engine }) {
|
|
|
48
47
|
const scope = {
|
|
49
48
|
metadata: {
|
|
50
49
|
type: "codex",
|
|
51
|
-
agentSources: ["provisioned"],
|
|
52
50
|
mcp: true,
|
|
53
51
|
protocolSupport: {
|
|
54
52
|
protocol: "codex.app-server",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-codex",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
8
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14",
|
|
9
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14"
|
|
10
10
|
},
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"files": [
|
|
@@ -783,7 +783,6 @@ var DSH_MIN_VERSION = "0.2.1-rc.4";
|
|
|
783
783
|
var DSH_VERSION = DSH_MIN_VERSION;
|
|
784
784
|
var messages = {
|
|
785
785
|
DSH_CONFIG_INVALID: "DeepSeek Harness configuration is invalid for this invocation.",
|
|
786
|
-
DSH_ACTMODE_UNSUPPORTED: "DeepSeek Harness supports only the default actmode.",
|
|
787
786
|
PROVIDER_MESSAGE_TOO_LARGE: "DeepSeek Harness protocol line exceeded the configured limit.",
|
|
788
787
|
STREAM_QUEUE_ITEM_TOO_LARGE: "DeepSeek Harness event exceeded the configured queue item limit.",
|
|
789
788
|
STREAM_QUEUE_BYTES_EXCEEDED: "DeepSeek Harness event queue exceeded the configured byte limit.",
|
|
@@ -3,7 +3,6 @@ export declare const DSH_MIN_VERSION = "0.2.1-rc.4";
|
|
|
3
3
|
export declare const DSH_VERSION = "0.2.1-rc.4";
|
|
4
4
|
declare const messages: {
|
|
5
5
|
readonly DSH_CONFIG_INVALID: "DeepSeek Harness configuration is invalid for this invocation.";
|
|
6
|
-
readonly DSH_ACTMODE_UNSUPPORTED: "DeepSeek Harness supports only the default actmode.";
|
|
7
6
|
readonly PROVIDER_MESSAGE_TOO_LARGE: "DeepSeek Harness protocol line exceeded the configured limit.";
|
|
8
7
|
readonly STREAM_QUEUE_ITEM_TOO_LARGE: "DeepSeek Harness event exceeded the configured queue item limit.";
|
|
9
8
|
readonly STREAM_QUEUE_BYTES_EXCEEDED: "DeepSeek Harness event queue exceeded the configured byte limit.";
|