@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,11 +1,12 @@
|
|
|
1
|
+
import type { AdapterMetadata } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
2
|
import { spawnGrokBuildAcpClient as spawnAcpClient, type SpawnGrokBuildClientOptions as SpawnAcpClientOptions } from "./client.js";
|
|
2
3
|
import { GrokBuildInteractionBridge as AcpApprovalBridge } from "./interactions.js";
|
|
3
|
-
import { acpActmodeSelectionRequest } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
4
4
|
import { type AcpClient, type AcpUpdate } from "@mininglamp-oss/octo-runtime-acp-client";
|
|
5
5
|
import { type ProbeResult, type ReasoningLevelMap, type AdapterInvocationContext, type CanonicalEvent, type InvokeRequest } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
6
6
|
import { type InteractionResponse } from "@mininglamp-oss/octo-runtime-protocol";
|
|
7
7
|
type JsonRecord = Record<string, unknown>;
|
|
8
8
|
export interface AcpAdapterDefinition {
|
|
9
|
+
metadata?: AdapterMetadata;
|
|
9
10
|
type: string;
|
|
10
11
|
provider: string;
|
|
11
12
|
command: string;
|
|
@@ -19,8 +20,6 @@ export interface AcpAdapterDefinition {
|
|
|
19
20
|
sessionParams?: (params: JsonRecord, request: InvokeRequest, fresh: boolean) => JsonRecord;
|
|
20
21
|
isMissingSessionError?: (error: unknown) => boolean;
|
|
21
22
|
configureSession?: (client: AcpClient, session: JsonRecord, sessionId: string, request: InvokeRequest) => AsyncIterable<CanonicalEvent>;
|
|
22
|
-
selectActmode?: typeof acpActmodeSelectionRequest;
|
|
23
|
-
controlInstructions?: "session";
|
|
24
23
|
reasoningLevels?: ReasoningLevelMap;
|
|
25
24
|
clientOptions?: (request: InvokeRequest, bridge: AcpApprovalBridge) => Pick<SpawnAcpClientOptions, "requestHandler" | "onRequestResponseWritten" | "onRequestResponseFailed">;
|
|
26
25
|
validatePromptResult?: (update: StandardAcpUpdate) => CanonicalEvent[];
|
|
@@ -38,24 +37,23 @@ export interface StandardAcpUpdate extends AcpUpdate {
|
|
|
38
37
|
output?: unknown;
|
|
39
38
|
status?: string;
|
|
40
39
|
}
|
|
41
|
-
export declare function createGrokBuildAcpAdapter(definition: AcpAdapterDefinition, { acpClientFactory, command }?: {
|
|
40
|
+
export declare function createGrokBuildAcpAdapter(definition: AcpAdapterDefinition, { acpClientFactory, command, commandArgsPrefix, env }?: {
|
|
42
41
|
acpClientFactory?: typeof spawnAcpClient;
|
|
43
42
|
command?: string;
|
|
43
|
+
commandArgsPrefix?: readonly string[];
|
|
44
|
+
env?: NodeJS.ProcessEnv;
|
|
44
45
|
}): Readonly<Omit<{
|
|
45
|
-
metadata:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
metadata: AdapterMetadata;
|
|
47
|
+
probe: (() => Promise<ProbeResult>) | (() => Promise<{
|
|
48
|
+
available: false;
|
|
49
|
+
command: string;
|
|
50
|
+
reason: string;
|
|
51
|
+
}>);
|
|
51
52
|
respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
|
|
52
53
|
invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<CanonicalEvent>;
|
|
53
|
-
}, "metadata"> & {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type: string;
|
|
57
|
-
agentSources: "provisioned"[];
|
|
58
|
-
}, "protocolSupport"> & {
|
|
54
|
+
}, "metadata" | "defaultAgentEnv"> & {
|
|
55
|
+
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
56
|
+
metadata: Omit<AdapterMetadata, "protocolSupport"> & {
|
|
59
57
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
60
58
|
};
|
|
61
59
|
}>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { grokModeId } from "./agent-env.js";
|
|
2
|
+
import { invocationModel, invocationApprovalMode, invocationWorkdir } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
3
|
import { spawnGrokBuildAcpClient as spawnAcpClient } from "./client.js";
|
|
2
4
|
import { GrokBuildInteractionBridge as AcpApprovalBridge } from "./interactions.js";
|
|
3
|
-
import { acpModelSelectionRequest,
|
|
5
|
+
import { acpModelSelectionRequest, normalizeAcpUpdate } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
4
6
|
import { acpLoadSessionParams, acpNewSessionParams, acpPromptParams } from "@mininglamp-oss/octo-runtime-acp-client";
|
|
5
|
-
import {
|
|
6
|
-
import { canonicalTerminalStatus,
|
|
7
|
+
import { AcpTurnNormalizer, defineAdapter, invocationEnvironment, invocationMcpServers, assertMcpOptions, probeCommand, snapshotProviderLaunch } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
8
|
+
import { canonicalTerminalStatus, providerInputParts } from "@mininglamp-oss/octo-runtime-protocol";
|
|
7
9
|
function sessionModel(session) {
|
|
8
10
|
const modelOption = arrayField(session, "configOptions")
|
|
9
11
|
.map(recordValue)
|
|
@@ -12,15 +14,20 @@ function sessionModel(session) {
|
|
|
12
14
|
stringField(recordValue(session.models), "currentModelId") ??
|
|
13
15
|
stringField(session, "model"));
|
|
14
16
|
}
|
|
15
|
-
export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawnAcpClient, command = definition.command } = {}) {
|
|
17
|
+
export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawnAcpClient, command = definition.command, commandArgsPrefix = [], env = {} } = {}) {
|
|
18
|
+
const launch = acpClientFactory === spawnAcpClient
|
|
19
|
+
? snapshotProviderLaunch({ command, args: commandArgsPrefix, env })
|
|
20
|
+
: { command, args: [...commandArgsPrefix], env: { ...env } };
|
|
16
21
|
const responders = new Map();
|
|
17
22
|
return defineAdapter({
|
|
18
|
-
metadata: {
|
|
23
|
+
metadata: definition.metadata ?? {
|
|
19
24
|
mcp: true,
|
|
20
|
-
type: definition.type
|
|
21
|
-
agentSources: ["provisioned"]
|
|
25
|
+
type: definition.type
|
|
22
26
|
},
|
|
23
|
-
probe: definition.probe ??
|
|
27
|
+
probe: definition.probe ??
|
|
28
|
+
(acpClientFactory === spawnAcpClient
|
|
29
|
+
? () => probeCommand(launch.command, { args: launch.args, env: launch.env })
|
|
30
|
+
: () => Promise.resolve({ available: false, command, reason: "probe_missing" })),
|
|
24
31
|
async respondInteraction(invocationId, response) {
|
|
25
32
|
const bridge = responders.get(invocationId);
|
|
26
33
|
if (!bridge)
|
|
@@ -28,7 +35,8 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
28
35
|
await bridge.respond(response);
|
|
29
36
|
},
|
|
30
37
|
async *invoke(request, context) {
|
|
31
|
-
if (request
|
|
38
|
+
if (invocationApprovalMode(request) !== "ask" &&
|
|
39
|
+
invocationApprovalMode(request) !== "full_access")
|
|
32
40
|
throw new Error("APPROVAL_MODE_UNSUPPORTED: this ACP adapter has no assisted policy");
|
|
33
41
|
if (responders.has(request.invocationId))
|
|
34
42
|
throw new Error("INVOCATION_ALREADY_ACTIVE");
|
|
@@ -47,7 +55,7 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
47
55
|
const args = typeof definition.args === "function"
|
|
48
56
|
? definition.args(request)
|
|
49
57
|
: (definition.args ?? ["acp"]);
|
|
50
|
-
const runEnv = invocationEnvironment(request, definition.env?.(request));
|
|
58
|
+
const runEnv = invocationEnvironment(request, definition.env?.(request), launch.env);
|
|
51
59
|
const mcp = invocationMcpServers(request, runEnv);
|
|
52
60
|
assertMcpOptions(mcp, definition.type, []);
|
|
53
61
|
const servers = Object.entries(mcp).map(([name, server]) => server.type === "stdio"
|
|
@@ -64,10 +72,10 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
64
72
|
headers: Object.entries(server.headers ?? {}).map(([name, value]) => ({ name, value }))
|
|
65
73
|
});
|
|
66
74
|
const client = acpClientFactory({
|
|
67
|
-
command,
|
|
68
|
-
args: [...args],
|
|
75
|
+
command: launch.command,
|
|
76
|
+
args: [...launch.args, ...args],
|
|
69
77
|
env: runEnv,
|
|
70
|
-
cwd: request
|
|
78
|
+
cwd: invocationWorkdir(request),
|
|
71
79
|
...definition.clientOptions?.(request, bridge),
|
|
72
80
|
permissionHandler: (params) => bridge.requestPermission(params),
|
|
73
81
|
onPermissionResponseWritten: (params) => bridge.responseWritten(params),
|
|
@@ -115,8 +123,8 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
115
123
|
let resumeFallback;
|
|
116
124
|
let sessionMethod = requestedSessionId ? "session/load" : "session/new";
|
|
117
125
|
let sessionParams = requestedSessionId
|
|
118
|
-
? acpLoadSessionParams(requestedSessionId, { cwd: request
|
|
119
|
-
: acpNewSessionParams({ cwd: request
|
|
126
|
+
? acpLoadSessionParams(requestedSessionId, { cwd: invocationWorkdir(request) })
|
|
127
|
+
: acpNewSessionParams({ cwd: invocationWorkdir(request) });
|
|
120
128
|
sessionParams.mcpServers = servers;
|
|
121
129
|
sessionParams =
|
|
122
130
|
definition.sessionParams?.(sessionParams, request, !requestedSessionId) ?? sessionParams;
|
|
@@ -143,7 +151,7 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
143
151
|
if (missingLoadedSession) {
|
|
144
152
|
resumeFallback = "session_load_not_found";
|
|
145
153
|
sessionMethod = "session/new";
|
|
146
|
-
sessionParams = acpNewSessionParams({ cwd: request
|
|
154
|
+
sessionParams = acpNewSessionParams({ cwd: invocationWorkdir(request) });
|
|
147
155
|
sessionParams.mcpServers = servers;
|
|
148
156
|
sessionParams = definition.sessionParams?.(sessionParams, request, true) ?? sessionParams;
|
|
149
157
|
sessionRequestId = client.reserveRequestId();
|
|
@@ -160,22 +168,12 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
160
168
|
: (requestedSessionId ?? stringField(sessionResult, "sessionId"));
|
|
161
169
|
if (!sessionId)
|
|
162
170
|
throw new Error("ACP session/new returned no sessionId");
|
|
163
|
-
const requestedMode =
|
|
171
|
+
const requestedMode = grokModeId(request);
|
|
164
172
|
if (requestedMode !== undefined) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
await client.request(selection.method, selection.params);
|
|
168
|
-
yield actmodeEvidence({
|
|
169
|
-
requested: requestedMode,
|
|
170
|
-
effective: selection.effective,
|
|
171
|
-
nativeMode: selection.nativeMode,
|
|
172
|
-
status: selection.effective === requestedMode ? "applied" : "fallback",
|
|
173
|
-
...(selection.effective !== requestedMode
|
|
174
|
-
? { reason: "provider_unsupported" }
|
|
175
|
-
: {})
|
|
176
|
-
});
|
|
173
|
+
// Grok 原生实现 set_mode 但不广告 modes;此约定仅在本包生效。
|
|
174
|
+
await client.request("session/set_mode", { sessionId, modeId: requestedMode });
|
|
177
175
|
}
|
|
178
|
-
const requestedModel = nonEmptyString(request
|
|
176
|
+
const requestedModel = nonEmptyString(invocationModel(request));
|
|
179
177
|
if (requestedModel) {
|
|
180
178
|
const selection = acpModelSelectionRequest(sessionResult, sessionId, requestedModel);
|
|
181
179
|
if (selection) {
|
|
@@ -214,23 +212,8 @@ export function createGrokBuildAcpAdapter(definition, { acpClientFactory = spawn
|
|
|
214
212
|
}
|
|
215
213
|
};
|
|
216
214
|
const input = providerInputParts(request, resumeFallback !== undefined);
|
|
217
|
-
const instructions = definition.controlInstructions === "session"
|
|
218
|
-
? ""
|
|
219
|
-
: initialControlInstructions(request, !requestedSessionId || resumeFallback !== undefined);
|
|
220
215
|
// Preserve the legacy text call while mixed prompts retain every block's position.
|
|
221
|
-
const prompt = input.length === 1 && input[0]?.type === "text"
|
|
222
|
-
? `${input[0].text}${instructions ? `\n\n${instructions}` : ""}`
|
|
223
|
-
: [
|
|
224
|
-
...input,
|
|
225
|
-
...(instructions
|
|
226
|
-
? [
|
|
227
|
-
{
|
|
228
|
-
type: "text",
|
|
229
|
-
text: instructions
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
: [])
|
|
233
|
-
];
|
|
216
|
+
const prompt = input.length === 1 && input[0]?.type === "text" ? input[0].text : input;
|
|
234
217
|
const promptParams = acpPromptParams(sessionId, prompt);
|
|
235
218
|
const promptRequestId = client.reserveRequestId();
|
|
236
219
|
let stopReason;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { agentEnvItem } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
/** 只读本轮私有 item;省略不补模式,非法显式值在原生映射前拒绝。 */
|
|
3
|
+
export function grokModeId(request) {
|
|
4
|
+
const value = agentEnvItem(request.agentEnv, "adapter.grok-build", "options")?.modeId;
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (value !== "default" && value !== "plan")
|
|
8
|
+
throw new TypeError("ADAPTER_OPTION_INVALID: grok-build.modeId");
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AcpClient } from "@mininglamp-oss/octo-runtime-acp-client";
|
|
2
2
|
import { INVOKE_REQUEST_MAX_BYTES } from "@mininglamp-oss/octo-runtime-protocol";
|
|
3
3
|
import { mergeProcessEnvironment } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
4
|
-
import {
|
|
4
|
+
import { assertProviderCommand } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
import { createInterface } from "node:readline";
|
|
7
7
|
export class GrokBuildRpcError extends Error {
|
|
@@ -135,12 +135,9 @@ class GrokBuildAcpClient extends AcpClient {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
export function spawnGrokBuildAcpClient(options) {
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
env
|
|
142
|
-
});
|
|
143
|
-
const child = spawn(launch.command, launch.args, {
|
|
138
|
+
assertProviderCommand(options.command);
|
|
139
|
+
const env = mergeProcessEnvironment(options.env ?? {});
|
|
140
|
+
const child = spawn(options.command, options.args ?? [], {
|
|
144
141
|
cwd: options.cwd,
|
|
145
142
|
env,
|
|
146
143
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -1,33 +1,25 @@
|
|
|
1
|
+
import type { AdapterMetadata } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
2
|
import { spawnGrokBuildAcpClient } from "./client.js";
|
|
2
3
|
import { type CanonicalEvent, type InvokeRequest } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
3
4
|
import type { InteractionResponse } from "@mininglamp-oss/octo-runtime-protocol";
|
|
4
5
|
export declare const GROK_BUILD_TESTED_VERSION = "1.0.67";
|
|
6
|
+
export declare const grokBuildMetadata: AdapterMetadata;
|
|
5
7
|
/** 宿主可指定已安装命令;每次调用拥有独立 ACP 子进程,不连接用户常驻 leader。 */
|
|
6
|
-
export declare function createGrokBuildAdapter({ command, acpClientFactory }
|
|
7
|
-
command
|
|
8
|
+
export declare function createGrokBuildAdapter({ command, acpClientFactory, commandArgsPrefix, env }: {
|
|
9
|
+
command: string;
|
|
8
10
|
acpClientFactory?: typeof spawnGrokBuildAcpClient;
|
|
11
|
+
commandArgsPrefix?: readonly string[];
|
|
12
|
+
env?: NodeJS.ProcessEnv;
|
|
9
13
|
}): Readonly<{
|
|
14
|
+
defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").ContextEnvelope;
|
|
10
15
|
invoke(request: InvokeRequest, context?: Parameters<(request: InvokeRequest, context?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterInvocationContext) => AsyncGenerator<CanonicalEvent>>[1]): AsyncGenerator<CanonicalEvent, void, any>;
|
|
11
16
|
respondInteraction: (invocationId: string, response: InteractionResponse) => Promise<void>;
|
|
12
|
-
probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
probe: (() => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>) | (() => Promise<{
|
|
18
|
+
available: false;
|
|
19
|
+
command: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
}>);
|
|
22
|
+
metadata: Omit<AdapterMetadata, "protocolSupport"> & {
|
|
18
23
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
19
24
|
};
|
|
20
25
|
}>;
|
|
21
|
-
export declare const grokBuildAdapter: Readonly<{
|
|
22
|
-
invoke(request: InvokeRequest, context?: Parameters<(request: InvokeRequest, context?: import("@mininglamp-oss/octo-runtime-adapter-sdk").AdapterInvocationContext) => AsyncGenerator<CanonicalEvent>>[1]): AsyncGenerator<CanonicalEvent, void, any>;
|
|
23
|
-
respondInteraction: (invocationId: string, response: InteractionResponse) => Promise<void>;
|
|
24
|
-
probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>;
|
|
25
|
-
metadata: Omit<{
|
|
26
|
-
mcp: true;
|
|
27
|
-
type: string;
|
|
28
|
-
agentSources: "provisioned"[];
|
|
29
|
-
}, "protocolSupport"> & {
|
|
30
|
-
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
33
|
-
export default grokBuildAdapter;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { assertAdapterAgentEnv, assertAdapterWorkdir, runAdapterPreparation, isAdapterPreparationFailure, invocationEffort, invocationOption, invocationApprovalMode } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
1
2
|
import { GrokBuildRpcError, spawnGrokBuildAcpClient } from "./client.js";
|
|
2
3
|
import { createGrokBuildAcpAdapter } from "./adapter.js";
|
|
3
|
-
import {
|
|
4
|
+
import { invocationEnvironment, invocationMcpServers, probeCommand, snapshotProviderLaunch } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
4
5
|
export const GROK_BUILD_TESTED_VERSION = "1.0.67";
|
|
6
|
+
export const grokBuildMetadata = {
|
|
7
|
+
type: "grok-build",
|
|
8
|
+
mcp: true
|
|
9
|
+
};
|
|
5
10
|
const levels = { low: "low", medium: "medium", high: "high", xhigh: "xhigh" };
|
|
6
11
|
function supportedVersion(version) {
|
|
7
12
|
if (typeof version !== "string")
|
|
@@ -10,21 +15,23 @@ function supportedVersion(version) {
|
|
|
10
15
|
return !!match && Number(match[1]) === 1 && (Number(match[2]) > 0 || Number(match[3]) >= 67);
|
|
11
16
|
}
|
|
12
17
|
/** 宿主可指定已安装命令;每次调用拥有独立 ACP 子进程,不连接用户常驻 leader。 */
|
|
13
|
-
export function createGrokBuildAdapter({ command =
|
|
18
|
+
export function createGrokBuildAdapter({ command, acpClientFactory = spawnGrokBuildAcpClient, commandArgsPrefix = [], env = {} }) {
|
|
19
|
+
const launch = acpClientFactory === spawnGrokBuildAcpClient
|
|
20
|
+
? snapshotProviderLaunch({ command, args: commandArgsPrefix, env })
|
|
21
|
+
: { command, args: [...commandArgsPrefix], env: { ...env } };
|
|
14
22
|
const adapter = createGrokBuildAcpAdapter({
|
|
15
23
|
type: "grok-build",
|
|
24
|
+
metadata: grokBuildMetadata,
|
|
16
25
|
provider: "grok-build",
|
|
17
26
|
command,
|
|
18
27
|
args: ["--no-auto-update", "agent", "--no-leader", "stdio"],
|
|
19
|
-
controlInstructions: "session",
|
|
20
28
|
reasoningLevels: levels,
|
|
21
29
|
async probe() {
|
|
22
|
-
|
|
30
|
+
if (acpClientFactory !== spawnGrokBuildAcpClient)
|
|
31
|
+
return { available: false, command, reason: "probe_missing" };
|
|
32
|
+
const result = await probeCommand(launch.command, { args: launch.args, env: launch.env });
|
|
23
33
|
if (!result.available)
|
|
24
|
-
return
|
|
25
|
-
...result,
|
|
26
|
-
reason: "command_not_found: install Grok Build and put grok on PATH"
|
|
27
|
-
};
|
|
34
|
+
return result;
|
|
28
35
|
return supportedVersion(result.version)
|
|
29
36
|
? result
|
|
30
37
|
: {
|
|
@@ -33,8 +40,11 @@ export function createGrokBuildAdapter({ command = "grok", acpClientFactory = sp
|
|
|
33
40
|
reason: `grok_version_unsupported: install Grok Build ${GROK_BUILD_TESTED_VERSION} or a compatible 1.x release`
|
|
34
41
|
};
|
|
35
42
|
},
|
|
36
|
-
async initialize(client, init
|
|
37
|
-
const version = record(init._meta).agentVersion ??
|
|
43
|
+
async initialize(client, init) {
|
|
44
|
+
const version = record(init._meta).agentVersion ??
|
|
45
|
+
(acpClientFactory === spawnGrokBuildAcpClient
|
|
46
|
+
? (await probeCommand(launch.command, { args: launch.args, env: launch.env })).version
|
|
47
|
+
: undefined);
|
|
38
48
|
if (init.protocolVersion !== 1 || !supportedVersion(version))
|
|
39
49
|
throw new Error(`GROK_VERSION_UNSUPPORTED: expected ACP v1 and Grok Build >= ${GROK_BUILD_TESTED_VERSION}, < 2.0.0`);
|
|
40
50
|
const methods = Array.isArray(init.authMethods)
|
|
@@ -52,32 +62,21 @@ export function createGrokBuildAdapter({ command = "grok", acpClientFactory = sp
|
|
|
52
62
|
}
|
|
53
63
|
},
|
|
54
64
|
sessionParams(params, request, fresh) {
|
|
55
|
-
//
|
|
56
|
-
const rules = initialControlInstructions(request, fresh);
|
|
65
|
+
// 应用提示词只来自普通输入;会话元数据仅保留执行策略和恢复行为。
|
|
57
66
|
return {
|
|
58
67
|
...params,
|
|
59
68
|
_meta: {
|
|
60
|
-
yoloMode: request
|
|
69
|
+
yoloMode: invocationApprovalMode(request) === "full_access",
|
|
61
70
|
autoMode: false,
|
|
62
|
-
...(fresh ?
|
|
71
|
+
...(!fresh ? { "x.ai/restore_code": false } : {})
|
|
63
72
|
}
|
|
64
73
|
};
|
|
65
74
|
},
|
|
66
75
|
isMissingSessionError: (error) => error instanceof GrokBuildRpcError &&
|
|
67
76
|
error.code === -32603 &&
|
|
68
77
|
record(error.data).code === "FS_NOT_FOUND",
|
|
69
|
-
selectActmode(_session, sessionId, requested) {
|
|
70
|
-
// 1.0.67 不发布 modes,但实现标准 set_mode(default/plan);成功响应后才发布 applied。
|
|
71
|
-
return {
|
|
72
|
-
method: "session/set_mode",
|
|
73
|
-
params: { sessionId, modeId: requested },
|
|
74
|
-
effective: requested,
|
|
75
|
-
nativeMode: requested,
|
|
76
|
-
unchanged: false
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
78
|
async *configureSession(client, session, sessionId, request) {
|
|
80
|
-
const requested = request
|
|
79
|
+
const requested = invocationEffort(request);
|
|
81
80
|
if (requested === undefined)
|
|
82
81
|
return;
|
|
83
82
|
const option = (Array.isArray(session.configOptions) ? session.configOptions : [])
|
|
@@ -165,22 +164,36 @@ export function createGrokBuildAdapter({ command = "grok", acpClientFactory = sp
|
|
|
165
164
|
? [{ protocolVersion: 2, type: "usage.update", payload }]
|
|
166
165
|
: [];
|
|
167
166
|
}
|
|
168
|
-
}, { command, acpClientFactory });
|
|
167
|
+
}, { command: launch.command, acpClientFactory, commandArgsPrefix: launch.args, env: launch.env });
|
|
169
168
|
return Object.freeze({
|
|
170
169
|
...adapter,
|
|
170
|
+
get defaultAgentEnv() {
|
|
171
|
+
return adapter.defaultAgentEnv;
|
|
172
|
+
},
|
|
171
173
|
async *invoke(request, context) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
let env = {};
|
|
175
|
+
await runAdapterPreparation(context, async () => {
|
|
176
|
+
assertAdapterAgentEnv(request);
|
|
177
|
+
await assertAdapterWorkdir(request);
|
|
178
|
+
if (invocationOption(request, "sandbox", "grok-build") !== undefined)
|
|
179
|
+
throw new Error("SANDBOX_UNSUPPORTED: grok-build ACP has no per-session sandbox override");
|
|
180
|
+
// 纯模板校验在 Provider 操作前完成;预算和 notice 仍只由内层 SDK 应用一次。
|
|
181
|
+
env = invocationEnvironment(request, {}, launch.env);
|
|
182
|
+
const mcp = invocationMcpServers(request, env);
|
|
183
|
+
if (JSON.stringify(mcp).includes("${"))
|
|
184
|
+
throw new Error("MCP_LITERAL_UNSUPPORTED: grok-build");
|
|
185
|
+
});
|
|
179
186
|
try {
|
|
180
187
|
yield* adapter.invoke(request, context);
|
|
181
188
|
}
|
|
182
189
|
catch (error) {
|
|
183
|
-
|
|
190
|
+
const failure = publicFailure(error, env);
|
|
191
|
+
// 脱敏会创建新 Error;仅转移原错误已经确认的本轮准备证据。
|
|
192
|
+
if (context && isAdapterPreparationFailure(error, context))
|
|
193
|
+
await runAdapterPreparation(context, () => {
|
|
194
|
+
throw failure;
|
|
195
|
+
});
|
|
196
|
+
throw failure;
|
|
184
197
|
}
|
|
185
198
|
}
|
|
186
199
|
});
|
|
@@ -269,5 +282,3 @@ function record(value) {
|
|
|
269
282
|
? value
|
|
270
283
|
: {};
|
|
271
284
|
}
|
|
272
|
-
export const grokBuildAdapter = createGrokBuildAdapter();
|
|
273
|
-
export default grokBuildAdapter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-grok-build",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@mininglamp-oss/octo-runtime-acp-client": "1.1.
|
|
13
|
-
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.
|
|
14
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.
|
|
15
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.
|
|
12
|
+
"@mininglamp-oss/octo-runtime-acp-client": "1.1.14",
|
|
13
|
+
"@mininglamp-oss/octo-runtime-adapter-acp": "1.1.14",
|
|
14
|
+
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.14",
|
|
15
|
+
"@mininglamp-oss/octo-runtime-protocol": "1.1.14"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,19 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AdapterMetadata } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
import { createAcpAdapter } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
3
|
+
export declare const hermesMetadata: AdapterMetadata;
|
|
4
|
+
/** 宿主交付所选命令或 client factory;本模块仅维护 ACP 协议要求。 */
|
|
5
|
+
export declare function createHermesAdapter(options: NonNullable<Parameters<typeof createAcpAdapter>[1]> & {
|
|
6
|
+
command: string;
|
|
7
|
+
}): Readonly<Omit<{
|
|
2
8
|
metadata: {
|
|
3
|
-
mcp
|
|
9
|
+
mcp?: boolean;
|
|
10
|
+
workspace?: boolean;
|
|
11
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
4
12
|
type: string;
|
|
5
|
-
|
|
13
|
+
processModel?: string;
|
|
14
|
+
transport?: string;
|
|
6
15
|
};
|
|
7
|
-
probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult
|
|
16
|
+
probe: (() => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>) | (() => Promise<{
|
|
17
|
+
available: false;
|
|
18
|
+
command: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
}>);
|
|
8
21
|
respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
|
|
9
22
|
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>;
|
|
10
|
-
}, "metadata"> & {
|
|
23
|
+
}, "metadata" | "defaultAgentEnv"> & {
|
|
24
|
+
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
11
25
|
metadata: Omit<{
|
|
12
|
-
mcp
|
|
26
|
+
mcp?: boolean;
|
|
27
|
+
workspace?: boolean;
|
|
28
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
13
29
|
type: string;
|
|
14
|
-
|
|
30
|
+
processModel?: string;
|
|
31
|
+
transport?: string;
|
|
15
32
|
}, "protocolSupport"> & {
|
|
16
33
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
17
34
|
};
|
|
18
35
|
}>;
|
|
19
|
-
export default hermesAdapter;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { createAcpAdapter } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
2
|
-
export const
|
|
2
|
+
export const hermesMetadata = {
|
|
3
3
|
type: "hermes",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
mcp: true
|
|
5
|
+
};
|
|
6
|
+
/** 宿主交付所选命令或 client factory;本模块仅维护 ACP 协议要求。 */
|
|
7
|
+
export function createHermesAdapter(options) {
|
|
8
|
+
return createAcpAdapter({
|
|
9
|
+
metadata: hermesMetadata,
|
|
10
|
+
type: "hermes",
|
|
11
|
+
provider: "hermes",
|
|
12
|
+
command: options.command,
|
|
13
|
+
args: ["acp"],
|
|
14
|
+
emptyLoadResultMeansMissing: true
|
|
15
|
+
}, options);
|
|
16
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-hermes",
|
|
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
|
}
|
|
@@ -1,19 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AdapterMetadata } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
+
import { createAcpAdapter } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
3
|
+
export declare const kimiCodeMetadata: AdapterMetadata;
|
|
4
|
+
/** 宿主交付所选命令或 client factory;本模块仅维护 ACP 协议要求。 */
|
|
5
|
+
export declare function createKimiCodeAdapter(options: NonNullable<Parameters<typeof createAcpAdapter>[1]> & {
|
|
6
|
+
command: string;
|
|
7
|
+
}): Readonly<Omit<{
|
|
2
8
|
metadata: {
|
|
3
|
-
mcp
|
|
9
|
+
mcp?: boolean;
|
|
10
|
+
workspace?: boolean;
|
|
11
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
4
12
|
type: string;
|
|
5
|
-
|
|
13
|
+
processModel?: string;
|
|
14
|
+
transport?: string;
|
|
6
15
|
};
|
|
7
|
-
probe: () => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult
|
|
16
|
+
probe: (() => Promise<import("@mininglamp-oss/octo-runtime-adapter-sdk").ProbeResult>) | (() => Promise<{
|
|
17
|
+
available: false;
|
|
18
|
+
command: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
}>);
|
|
8
21
|
respondInteraction(invocationId: string, response: import("@mininglamp-oss/octo-runtime-protocol").InteractionResponse): Promise<void>;
|
|
9
22
|
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>;
|
|
10
|
-
}, "metadata"> & {
|
|
23
|
+
}, "metadata" | "defaultAgentEnv"> & {
|
|
24
|
+
readonly defaultAgentEnv: import("@mininglamp-oss/octo-runtime-protocol").AgentEnv;
|
|
11
25
|
metadata: Omit<{
|
|
12
|
-
mcp
|
|
26
|
+
mcp?: boolean;
|
|
27
|
+
workspace?: boolean;
|
|
28
|
+
protocolSupport?: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
13
29
|
type: string;
|
|
14
|
-
|
|
30
|
+
processModel?: string;
|
|
31
|
+
transport?: string;
|
|
15
32
|
}, "protocolSupport"> & {
|
|
16
33
|
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
17
34
|
};
|
|
18
35
|
}>;
|
|
19
|
-
export default kimiCodeAdapter;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { createAcpAdapter } from "@mininglamp-oss/octo-runtime-adapter-acp";
|
|
2
|
-
export const
|
|
2
|
+
export const kimiCodeMetadata = {
|
|
3
3
|
type: "kimi-code",
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
mcp: true
|
|
5
|
+
};
|
|
6
|
+
/** 宿主交付所选命令或 client factory;本模块仅维护 ACP 协议要求。 */
|
|
7
|
+
export function createKimiCodeAdapter(options) {
|
|
8
|
+
return createAcpAdapter({
|
|
9
|
+
metadata: kimiCodeMetadata,
|
|
10
|
+
type: "kimi-code",
|
|
11
|
+
provider: "kimi-code",
|
|
12
|
+
command: options.command,
|
|
13
|
+
args: ["acp"]
|
|
14
|
+
}, options);
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mininglamp-oss/octo-runtime-adapter-kimi-code",
|
|
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
|
}
|