@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,3 +1,5 @@
|
|
|
1
|
+
import type { AdapterMetadata } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
import { createAcpAdapter } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
1
3
|
/**
|
|
2
4
|
* MiniMax Code ACP adapter. Launches `mcode acp` and speaks the Agent Client
|
|
3
5
|
* Protocol through the shared ACP adapter, which reconstructs model steps,
|
|
@@ -10,22 +12,36 @@
|
|
|
10
12
|
* `session/load` returns an empty result is treated as a missing session and
|
|
11
13
|
* falls back to a fresh session (`emptyLoadResultMeansMissing`).
|
|
12
14
|
*/
|
|
13
|
-
export declare const
|
|
15
|
+
export declare const mcodeMetadata: AdapterMetadata;
|
|
16
|
+
/** 宿主交付所选命令或 client factory;本模块仅维护 ACP 协议要求。 */
|
|
17
|
+
export declare function createMcodeAdapter(options: NonNullable<Parameters<typeof createAcpAdapter>[1]> & {
|
|
18
|
+
command: string;
|
|
19
|
+
}): Readonly<Omit<{
|
|
14
20
|
metadata: {
|
|
15
|
-
mcp
|
|
21
|
+
mcp?: boolean;
|
|
22
|
+
workspace?: boolean;
|
|
23
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
16
24
|
type: string;
|
|
17
|
-
|
|
25
|
+
processModel?: string;
|
|
26
|
+
transport?: string;
|
|
18
27
|
};
|
|
19
|
-
probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult
|
|
28
|
+
probe: (() => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>) | (() => Promise<{
|
|
29
|
+
available: false;
|
|
30
|
+
command: string;
|
|
31
|
+
reason: string;
|
|
32
|
+
}>);
|
|
20
33
|
respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
|
|
21
34
|
invoke(request: import("@mininglamp-oss/octo-runtime-protocol").InvokeRequest, context?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent>;
|
|
22
|
-
}, "metadata"> & {
|
|
35
|
+
}, "metadata" | "defaultAgentEnv"> & {
|
|
36
|
+
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
23
37
|
metadata: Omit<{
|
|
24
|
-
mcp
|
|
38
|
+
mcp?: boolean;
|
|
39
|
+
workspace?: boolean;
|
|
40
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
25
41
|
type: string;
|
|
26
|
-
|
|
42
|
+
processModel?: string;
|
|
43
|
+
transport?: string;
|
|
27
44
|
}, "protocolSupport"> & {
|
|
28
45
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
29
46
|
};
|
|
30
47
|
}>;
|
|
31
|
-
export default mcodeAdapter;
|
|
@@ -11,11 +11,18 @@ import { createAcpAdapter } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
|
11
11
|
* `session/load` returns an empty result is treated as a missing session and
|
|
12
12
|
* falls back to a fresh session (`emptyLoadResultMeansMissing`).
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const mcodeMetadata = {
|
|
15
15
|
type: "mcode",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
mcp: true
|
|
17
|
+
};
|
|
18
|
+
/** 宿主交付所选命令或 client factory;本模块仅维护 ACP 协议要求。 */
|
|
19
|
+
export function createMcodeAdapter(options) {
|
|
20
|
+
return createAcpAdapter({
|
|
21
|
+
metadata: mcodeMetadata,
|
|
22
|
+
type: "mcode",
|
|
23
|
+
provider: "mcode",
|
|
24
|
+
command: options.command,
|
|
25
|
+
args: ["acp"],
|
|
26
|
+
emptyLoadResultMeansMissing: true
|
|
27
|
+
}, options);
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-mcode",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.14"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ export interface OpenClawGatewayInvocation {
|
|
|
18
18
|
createParams: JsonRecord;
|
|
19
19
|
agentParams: JsonRecord;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
21
|
+
/** 应用在调用前组装正文;Adapter 不添加原生 system prompt 或业务前缀。 */
|
|
22
22
|
export declare function composeOpenClawPrompt(req: InvokeRequest): string;
|
|
23
23
|
export declare function buildOpenClawGatewayInvocation(req: InvokeRequest): OpenClawGatewayInvocation;
|
|
24
24
|
export interface OpenClawGatewayClientLike {
|
|
@@ -37,12 +37,12 @@ export declare function createOpenClawAdapter({ clientFactory, log }?: {
|
|
|
37
37
|
clientFactory?: GatewayClientFactory;
|
|
38
38
|
log?: RuntimeLog;
|
|
39
39
|
}): Readonly<Omit<{
|
|
40
|
+
defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").ContextEnvelope;
|
|
40
41
|
metadata: {
|
|
41
42
|
type: string;
|
|
42
43
|
workspace: false;
|
|
43
44
|
processModel: string;
|
|
44
45
|
transport: string;
|
|
45
|
-
agentSources: ("preset" | "provisioned")[];
|
|
46
46
|
};
|
|
47
47
|
probe: (options?: AdapterProbeOptions) => Promise<{
|
|
48
48
|
available: boolean;
|
|
@@ -55,13 +55,13 @@ export declare function createOpenClawAdapter({ clientFactory, log }?: {
|
|
|
55
55
|
}>;
|
|
56
56
|
respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
|
|
57
57
|
invoke(req: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
|
|
58
|
-
}, "metadata"> & {
|
|
58
|
+
}, "metadata" | "defaultAgentEnv"> & {
|
|
59
|
+
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
59
60
|
metadata: Omit<{
|
|
60
61
|
type: string;
|
|
61
62
|
workspace: false;
|
|
62
63
|
processModel: string;
|
|
63
64
|
transport: string;
|
|
64
|
-
agentSources: ("preset" | "provisioned")[];
|
|
65
65
|
}, "protocolSupport"> & {
|
|
66
66
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
67
67
|
};
|
|
@@ -70,12 +70,12 @@ export { loadLocalOpenClawGateway, configureOpenClawConnection, readOpenClawConn
|
|
|
70
70
|
export { OpenClawGatewayClient, createOpenClawDeviceIdentity, type OpenClawDeviceIdentity, type OpenClawGatewayEvent, type OpenClawGatewayOptions } from "./gateway.js";
|
|
71
71
|
export { OpenClawTranscriptNormalizer, normalizeOpenClawFrame, tryParseOpenClawEvent, tryParseOpenClawFinalBlob, tryParseOpenClawTranscriptLine } from "./parser.js";
|
|
72
72
|
export declare const openclawAdapter: Readonly<Omit<{
|
|
73
|
+
defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").ContextEnvelope;
|
|
73
74
|
metadata: {
|
|
74
75
|
type: string;
|
|
75
76
|
workspace: false;
|
|
76
77
|
processModel: string;
|
|
77
78
|
transport: string;
|
|
78
|
-
agentSources: ("preset" | "provisioned")[];
|
|
79
79
|
};
|
|
80
80
|
probe: (options?: AdapterProbeOptions) => Promise<{
|
|
81
81
|
available: boolean;
|
|
@@ -88,13 +88,13 @@ export declare const openclawAdapter: Readonly<Omit<{
|
|
|
88
88
|
}>;
|
|
89
89
|
respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
|
|
90
90
|
invoke(req: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
|
|
91
|
-
}, "metadata"> & {
|
|
91
|
+
}, "metadata" | "defaultAgentEnv"> & {
|
|
92
|
+
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
92
93
|
metadata: Omit<{
|
|
93
94
|
type: string;
|
|
94
95
|
workspace: false;
|
|
95
96
|
processModel: string;
|
|
96
97
|
transport: string;
|
|
97
|
-
agentSources: ("preset" | "provisioned")[];
|
|
98
98
|
}, "protocolSupport"> & {
|
|
99
99
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
100
100
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { invocationProviderOptions, invocationTimeoutSeconds, invocationModel, invocationEffort, invocationApprovalMode, bindInvocationConnection, defaultAgentEnv, withAgentEnvItems } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
import { hasImageInput, AcpApprovalBridge, DriverQueue, defineAdapter, invocationEnvs, mapReasoningEffort, providerInputText } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
3
|
import { canonicalTerminalStatus } from "@mininglamp-oss/octo-runtime-protocol";
|
|
3
4
|
import { randomUUID } from "node:crypto";
|
|
4
5
|
import { OpenClawGatewayClient } from "./gateway.js";
|
|
@@ -23,7 +24,7 @@ function finiteNumber(value) {
|
|
|
23
24
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
24
25
|
}
|
|
25
26
|
function option(req, key) {
|
|
26
|
-
return nonEmptyString(req
|
|
27
|
+
return nonEmptyString(invocationProviderOptions(req, "openclaw")?.[key]);
|
|
27
28
|
}
|
|
28
29
|
function requiredOption(req, key) {
|
|
29
30
|
const value = option(req, key);
|
|
@@ -31,7 +32,7 @@ function requiredOption(req, key) {
|
|
|
31
32
|
throw new Error(`OpenClaw adapter is not configured: missing ${key}`);
|
|
32
33
|
return value;
|
|
33
34
|
}
|
|
34
|
-
/**
|
|
35
|
+
/** 应用在调用前组装正文;Adapter 不添加原生 system prompt 或业务前缀。 */
|
|
35
36
|
export function composeOpenClawPrompt(req) {
|
|
36
37
|
return providerInputText(req);
|
|
37
38
|
}
|
|
@@ -48,9 +49,9 @@ export function buildOpenClawGatewayInvocation(req) {
|
|
|
48
49
|
publicKey: requiredOption(req, OPENCLAW_PROVIDER_OPTIONS.publicKey),
|
|
49
50
|
privateKey: requiredOption(req, OPENCLAW_PROVIDER_OPTIONS.privateKey)
|
|
50
51
|
};
|
|
51
|
-
const agentId = req.
|
|
52
|
-
if (
|
|
53
|
-
throw new
|
|
52
|
+
const agentId = invocationProviderOptions(req, "openclaw").agentId ?? "main";
|
|
53
|
+
if (typeof agentId !== "string" || !/^[a-z0-9_][a-z0-9_-]{0,63}$/.test(agentId))
|
|
54
|
+
throw new TypeError("OPENCLAW_AGENT_ID_INVALID");
|
|
54
55
|
const resumedKey = req.providerSession?.sessionId;
|
|
55
56
|
if (resumedKey &&
|
|
56
57
|
(!resumedKey.startsWith(`agent:${agentId}:`) ||
|
|
@@ -61,9 +62,9 @@ export function buildOpenClawGatewayInvocation(req) {
|
|
|
61
62
|
`agent:${agentId}:${req.sessionName ? `${encodeURIComponent(req.sessionName)}-` : ""}${randomUUID()}`;
|
|
62
63
|
const requestId = `octo-runtime-${req.runId}-${randomUUID()}`;
|
|
63
64
|
const message = composeOpenClawPrompt(req);
|
|
64
|
-
const timeout = finiteNumber(req
|
|
65
|
-
const model = nonEmptyString(req
|
|
66
|
-
const thinking = mapReasoningEffort("openclaw", req
|
|
65
|
+
const timeout = finiteNumber(invocationTimeoutSeconds(req, "openclaw"));
|
|
66
|
+
const model = nonEmptyString(invocationModel(req));
|
|
67
|
+
const thinking = mapReasoningEffort("openclaw", invocationEffort(req));
|
|
67
68
|
const timeoutMilliseconds = timeout && timeout > 0 ? timeout * 1_000 : 30 * 60_000;
|
|
68
69
|
const reconciliationGraceMilliseconds = Math.min(30_000, timeoutMilliseconds * 0.1);
|
|
69
70
|
const createParams = {
|
|
@@ -77,9 +78,6 @@ export function buildOpenClawGatewayInvocation(req) {
|
|
|
77
78
|
sessionKey,
|
|
78
79
|
deliver: false,
|
|
79
80
|
idempotencyKey: requestId,
|
|
80
|
-
...(initialControlInstructions(req)
|
|
81
|
-
? { extraSystemPrompt: initialControlInstructions(req) }
|
|
82
|
-
: {}),
|
|
83
81
|
...(model ? { model } : {}),
|
|
84
82
|
...(thinking ? { thinking } : {}),
|
|
85
83
|
...(timeout === undefined ? {} : { timeout: Math.max(0, Math.floor(timeout)) })
|
|
@@ -891,7 +889,7 @@ async function* invokeOpenClawGateway(req, invocation, context, clientFactory, p
|
|
|
891
889
|
try {
|
|
892
890
|
const hello = await client.connect();
|
|
893
891
|
const contract = resolveGatewayContract(hello);
|
|
894
|
-
const policy = resolveGatewayPermission(contract, req
|
|
892
|
+
const policy = resolveGatewayPermission(contract, invocationApprovalMode(req));
|
|
895
893
|
permissions.options.effectiveApprovalMode = policy.effective;
|
|
896
894
|
// 参数在真实握手之后生成;probe 的版本快照不作为本次执行依据。
|
|
897
895
|
const createParams = gatewayCreateParams(contract, policy, invocation.createParams, invocation.requestId, invocation.agentParams.thinking);
|
|
@@ -1203,12 +1201,14 @@ export function createOpenClawAdapter({ clientFactory = (options) => new OpenCla
|
|
|
1203
1201
|
}
|
|
1204
1202
|
};
|
|
1205
1203
|
return defineAdapter({
|
|
1204
|
+
defaultAgentEnv: withAgentEnvItems(defaultAgentEnv("openclaw"), [
|
|
1205
|
+
{ namespace: "adapter.openclaw", name: "options", payload: { agentId: "main" } }
|
|
1206
|
+
]),
|
|
1206
1207
|
metadata: {
|
|
1207
1208
|
type: "openclaw",
|
|
1208
1209
|
workspace: false,
|
|
1209
1210
|
processModel: "websocket-per-invocation",
|
|
1210
|
-
transport: "openclaw-gateway-rpc"
|
|
1211
|
-
agentSources: ["preset", "provisioned"]
|
|
1211
|
+
transport: "openclaw-gateway-rpc"
|
|
1212
1212
|
},
|
|
1213
1213
|
probe: probeGateway,
|
|
1214
1214
|
async respondInteraction(invocationId, response) {
|
|
@@ -1220,25 +1220,22 @@ export function createOpenClawAdapter({ clientFactory = (options) => new OpenCla
|
|
|
1220
1220
|
async *invoke(req, context) {
|
|
1221
1221
|
if (hasImageInput(req))
|
|
1222
1222
|
throw new Error("UNSUPPORTED_INPUT_MODALITY: openclaw does not encode image input");
|
|
1223
|
-
if (req
|
|
1223
|
+
if (invocationApprovalMode(req) === "assisted")
|
|
1224
1224
|
throw new Error("APPROVAL_MODE_UNSUPPORTED: OpenClaw has no qualified assisted policy");
|
|
1225
1225
|
if (responders.has(req.invocationId))
|
|
1226
1226
|
throw new Error("INVOCATION_ALREADY_ACTIVE");
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
};
|
|
1227
|
+
const connectionOptions = invocationProviderOptions(req, "openclaw");
|
|
1228
|
+
// 本次连接解析独占请求包装;复用调用方请求时不共享私有连接绑定。
|
|
1229
|
+
req = { ...req };
|
|
1230
|
+
const gateway = await resolveOpenClawGateway(connectionOptions);
|
|
1231
|
+
bindInvocationConnection(req, {
|
|
1232
|
+
...Object.fromEntries(Object.entries(connectionOptions).filter((entry) => typeof entry[1] === "string")),
|
|
1233
|
+
[OPENCLAW_PROVIDER_OPTIONS.url]: gateway.url,
|
|
1234
|
+
[OPENCLAW_PROVIDER_OPTIONS.token]: gateway.token,
|
|
1235
|
+
[OPENCLAW_PROVIDER_OPTIONS.deviceId]: gateway.device.deviceId,
|
|
1236
|
+
[OPENCLAW_PROVIDER_OPTIONS.publicKey]: gateway.device.publicKey,
|
|
1237
|
+
[OPENCLAW_PROVIDER_OPTIONS.privateKey]: gateway.device.privateKey
|
|
1238
|
+
});
|
|
1242
1239
|
const invocation = buildOpenClawGatewayInvocation(req);
|
|
1243
1240
|
// 本轮及其对账/取消恢复连接共用本轮 sink;probe 则只使用工厂 sink。
|
|
1244
1241
|
invocation.gateway.log = context?.log ?? log;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-openclaw",
|
|
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
|
"ws": "8.22.1"
|
|
11
11
|
},
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { AdapterMetadata } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
export declare const openCodeMetadata: AdapterMetadata;
|
|
1
3
|
import { type AdapterInvocationContext, type CanonicalEvent, type InvokeRequest, type ProbeResult } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare function probeOpenCode(command?: string, env?: NodeJS.ProcessEnv, cwd?: string): Promise<ProbeResult>;
|
|
4
|
+
/** 只展示宿主绑定目标的可选版本,不按版本号准入;协议可用性由实际执行结果确定。 */
|
|
5
|
+
export declare function probeOpenCode(command: string, env?: NodeJS.ProcessEnv, cwd?: string, args?: readonly string[]): Promise<ProbeResult>;
|
|
5
6
|
/** A single OpenCode stream part; tool lifecycle is carried in `state.status` (running -> completed/error). */
|
|
6
7
|
interface OpenCodePart {
|
|
7
8
|
sessionID?: string;
|
|
@@ -44,15 +45,10 @@ interface OpenCodeNativeEvent extends OpenCodePart {
|
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* Runtime context is injected as an extra entry in OpenCode's `instructions`
|
|
50
|
-
* config (a temp markdown file) delivered through OPENCODE_CONFIG_CONTENT,
|
|
51
|
-
* merged onto any inline config so the user's existing OpenCode config is not
|
|
52
|
-
* overwritten. Returns a `cleanup` that removes the temp directory.
|
|
53
|
-
*
|
|
48
|
+
* 构造本轮 OpenCode 命令、普通输入和执行配置;原生 inline config 保持,
|
|
49
|
+
* 仅合并本轮 MCP 设置,不生成应用指令文件或追加系统提示词。
|
|
54
50
|
*/
|
|
55
|
-
export declare function buildOpenCodeCommand(req: InvokeRequest, command?: string): Promise<{
|
|
51
|
+
export declare function buildOpenCodeCommand(req: InvokeRequest, command?: string, inherited?: NodeJS.ProcessEnv): Promise<{
|
|
56
52
|
command: string;
|
|
57
53
|
args: string[];
|
|
58
54
|
input: string;
|
|
@@ -63,7 +59,7 @@ export declare function buildOpenCodeCommand(req: InvokeRequest, command?: strin
|
|
|
63
59
|
};
|
|
64
60
|
rpcMethod: string;
|
|
65
61
|
providerSessionId: string | undefined;
|
|
66
|
-
cleanup: () =>
|
|
62
|
+
cleanup: () => undefined;
|
|
67
63
|
}>;
|
|
68
64
|
/** Translate one OpenCode native event/part into canonical events; unrelated events yield an empty list. */
|
|
69
65
|
export declare function normalizeOpenCodeEvent(native: OpenCodeNativeEvent): CanonicalEvent[];
|
|
@@ -76,24 +72,19 @@ export declare class OpenCodeEventNormalizer {
|
|
|
76
72
|
#private;
|
|
77
73
|
normalize(native: OpenCodeNativeEvent): CanonicalEvent[];
|
|
78
74
|
}
|
|
79
|
-
export declare function createOpenCodeAdapter({ command }
|
|
80
|
-
command
|
|
75
|
+
export declare function createOpenCodeAdapter({ command, commandArgsPrefix, env }: {
|
|
76
|
+
command: string;
|
|
77
|
+
commandArgsPrefix?: readonly string[];
|
|
78
|
+
env?: NodeJS.ProcessEnv;
|
|
81
79
|
}): {
|
|
80
|
+
defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").ContextEnvelope;
|
|
82
81
|
respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
|
|
83
82
|
invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
|
|
84
83
|
probe?: (options?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterProbeOptions) => Promise<ProbeResult>;
|
|
84
|
+
respondNative?: ((invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").NativeInteractionResponse) => Promise<void>) | undefined;
|
|
85
85
|
createExecutionScope?: import("@mininglamp-oss/octo-runtime-adapter-sdk").CreateAdapterExecutionScope;
|
|
86
|
-
metadata: Omit<
|
|
87
|
-
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
export declare const opencodeAdapter: {
|
|
91
|
-
respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
|
|
92
|
-
invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
|
|
93
|
-
probe?: (options?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterProbeOptions) => Promise<ProbeResult>;
|
|
94
|
-
createExecutionScope?: import("@mininglamp-oss/octo-runtime-adapter-sdk").CreateAdapterExecutionScope;
|
|
95
|
-
metadata: Omit<import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterMetadata, "protocolSupport"> & {
|
|
86
|
+
metadata: Omit<AdapterMetadata, "protocolSupport"> & {
|
|
96
87
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
97
88
|
};
|
|
98
89
|
};
|
|
99
|
-
export
|
|
90
|
+
export {};
|