@tangle-network/sdk-provider-cli-base 0.13.98 → 0.13.100
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/dist/adapters/amp/index.d.mts +1 -1
- package/dist/adapters/amp/index.mjs +1 -1
- package/dist/adapters/exo/index.d.mts +1 -1
- package/dist/adapters/exo/index.mjs +2 -2
- package/dist/adapters/factory-droids/index.d.mts +1 -1
- package/dist/adapters/factory-droids/index.mjs +1 -1
- package/dist/adapters/grok/index.d.mts +1 -1
- package/dist/adapters/grok/index.mjs +1 -1
- package/dist/adapters/hermes/index.d.mts +1 -1
- package/dist/adapters/hermes/index.mjs +1 -1
- package/dist/adapters/nanoclaw/index.d.mts +1 -1
- package/dist/adapters/nanoclaw/index.mjs +1 -1
- package/dist/adapters/nanocode/index.d.mts +1 -1
- package/dist/adapters/nanocode/index.mjs +1 -1
- package/dist/adapters/openclaw/index.d.mts +1 -1
- package/dist/adapters/openclaw/index.mjs +1 -1
- package/dist/adapters/prime/index.d.mts +1 -1
- package/dist/adapters/prime/index.mjs +3 -9
- package/dist/{index-C5lgVtsB.d.mts → index-CWT1VwcD.d.mts} +28 -9
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{src-BWNbC3sj.mjs → src-DG4Y1JhF.mjs} +147 -74
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { McpConfig, ProviderConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as jsonEventParser, It as toolResultEvents, K as recordCliTokenUsage, Lt as toolStartEvents, Mt as sessionObservedEvents, Pt as textDeltaEvents, Q as localMcpEnv, Z as localMcpArgv, jt as reasoningEvents, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
//#region src/adapters/amp/types.ts
|
|
3
3
|
/**
|
|
4
4
|
* Type guard for AMP events.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as CliTurnSpawn, Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState, kt as CliTurnProcess } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as sessionObservedEvents, V as plaintextResponseParser, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region src/adapters/exo/adapter.ts
|
|
@@ -61,7 +61,7 @@ var ExoProviderAdapter = class extends CliProviderAdapterBase {
|
|
|
61
61
|
async spawnExecutionProcess(request) {
|
|
62
62
|
const { config, env, execArgs, workspaceRoot } = request;
|
|
63
63
|
await this.ensureSubprocessOwnedDir(this.home(config));
|
|
64
|
-
await this.runNodeAsSubprocess(WRITE_FILE, [execArgs.args[1] ?? ""], execArgs.stdin);
|
|
64
|
+
await this.runNodeAsSubprocess("exo: cannot write the agent definition as the subprocess user", WRITE_FILE, [execArgs.args[1] ?? ""], execArgs.stdin);
|
|
65
65
|
if (!config.apiKey) return super.spawnExecutionProcess(request);
|
|
66
66
|
const vault = (verb) => this.runCli({
|
|
67
67
|
command: this.getCliPath(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { AgentExecutionInput, AgentExecutionResult, BackendCapabilities, InteractionResponse, McpConfig, ProviderConfig, SdkHostServices, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as enabledInteractionKinds,
|
|
1
|
+
import { $ as enabledInteractionKinds, B as jsonEventParser, It as toolResultEvents, K as recordCliTokenUsage, Lt as toolStartEvents, Mt as sessionObservedEvents, Nt as streamPartBase, P as McpInteractionSupport, Pt as textDeltaEvents, Q as localMcpEnv, X as isLocalMcpConfig, Z as localMcpArgv, at as withTurnInteractions, jt as reasoningEvents, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
3
3
|
import { InteractionKind } from "@tangle-network/agent-interface";
|
|
4
4
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as sessionObservedEvents, V as plaintextResponseParser, dt as prependPromptSection, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
//#region src/adapters/grok/adapter.ts
|
|
3
3
|
const DECLARE_MODEL = "d=$HOME/.grok; [ -z \"$GROK_HOME\" ] || d=$GROK_HOME; t=\"[model.\\\"$1\\\"]\"; mkdir -p \"$d\" && { grep -qxF \"$t\" \"$d/managed_config.toml\" 2>/dev/null || printf '%s\\nmodel = \"%s\"\\n' \"$t\" \"$1\" >> \"$d/managed_config.toml\"; }; shift; exec \"$@\"";
|
|
4
4
|
var GrokProviderAdapter = class extends CliProviderAdapterBase {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState, n as HarnessId } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { i as PreparedAttachment } from "../../prompt-input-CD7okX8T.mjs";
|
|
3
3
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
4
4
|
import { InputPart, McpConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as recordCliTokenUsage, Q as localMcpEnv, V as plaintextResponseParser, X as isLocalMcpConfig, Z as localMcpArgv, dt as prependPromptSection,
|
|
1
|
+
import { K as recordCliTokenUsage, Mt as sessionObservedEvents, Q as localMcpEnv, V as plaintextResponseParser, X as isLocalMcpConfig, Z as localMcpArgv, dt as prependPromptSection, lt as partitionImageAttachments, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
import { writeFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState, n as HarnessId } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as recordCliTokenUsage, V as plaintextResponseParser, W as parseCliUsageLine, dt as prependPromptSection,
|
|
1
|
+
import { K as recordCliTokenUsage, Mt as sessionObservedEvents, V as plaintextResponseParser, W as parseCliUsageLine, dt as prependPromptSection, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region src/adapters/nanoclaw/adapter.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { i as PreparedAttachment } from "../../prompt-input-CD7okX8T.mjs";
|
|
3
3
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
4
4
|
import { InputPart, StreamEvent } from "@tangle-network/agent-interface";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as sessionObservedEvents, V as plaintextResponseParser, dt as prependPromptSection, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { qualifyModelId } from "@tangle-network/agent-profile-materialize";
|
|
3
3
|
import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as CliProviderAdapterBase, Kt as CliProviderConfig, Wt as CliExecArgs, Xt as ExecutionState, c as WorkspacePlanApplication, n as HarnessId } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { CliAuthFile, ProviderConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as finalTextEvent, K as recordCliTokenUsage, Mt as sessionObservedEvents, N as nativeEffortArgs, dt as prependPromptSection, q as CliProviderAdapterBase } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
//#region src/adapters/openclaw/adapter.ts
|
|
4
4
|
/** openclaw's default agent id; the synthesized config declares only it. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cn as
|
|
1
|
+
import { Cn as AcpBridgeSpawn, Ft as AcpContentBlock, Pt as AcpBridgeConfig, Tt as AcpProviderAdapterBase, Vt as AcpTurn, wn as AcpProcessSpec } from "../../index-CWT1VwcD.mjs";
|
|
2
2
|
import { i as PreparedAttachment } from "../../prompt-input-CD7okX8T.mjs";
|
|
3
3
|
import { PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_MCP_UNSUPPORTED_REASON, PrimeHarnessStateError, PrimeMaterializeOptions, PrimeProfileControls, PrimeProfileControls as PrimeProfileControls$1, PrimeProfileError, PrimeProfileSkill, PrimeProfileSubagent, assertPrimeModelAgreement, hasPrimeProfileMaterial, matchPrimeKernelDeadMarker, materializePrimeProfileControls, primeAgentDirEnv, primeProfileNeedsAgentDir, primeSubagentEntryId as subagentEntryId, primeThinkingLevel, prunePrimeProfileMaterial, readPrimeProfileControls } from "@tangle-network/agent-profile-materialize";
|
|
4
4
|
import { RpcBridge } from "@tangle-network/sdk-cli-runner";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as AcpProviderAdapterBase,
|
|
1
|
+
import { H as AcpProviderAdapterBase, Ut as spawnAcpBridge, dt as prependPromptSection } from "../../src-DG4Y1JhF.mjs";
|
|
2
2
|
import { PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_HARNESS_STATE_ENV_DENYLIST as PRIME_HARNESS_STATE_ENV_DENYLIST$1, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_KERNEL_ENV_PASSTHROUGH as PRIME_KERNEL_ENV_PASSTHROUGH$1, PRIME_MCP_UNSUPPORTED_REASON, PrimeHarnessStateError, PrimeProfileError, assertPrimeModelAgreement, assertPrimeModelAgreement as assertPrimeModelAgreement$1, buildPiModelsConfig, hasPrimeProfileMaterial, matchPrimeKernelDeadMarker, materializePrimeProfileControls, materializePrimeProfileControls as materializePrimeProfileControls$1, primeAgentDirEnv, primeAgentDirEnv as primeAgentDirEnv$1, primeHarnessStatePath, primeProfileNeedsAgentDir, primeSubagentEntryId as subagentEntryId, primeThinkingLevel, primeThinkingLevel as primeThinkingLevel$1, prunePrimeProfileMaterial, readPrimeProfileControls, readPrimeProfileControls as readPrimeProfileControls$1, writePrimeAgentFile } from "@tangle-network/agent-profile-materialize";
|
|
3
3
|
import { isAbsolute, join, relative, sep } from "node:path";
|
|
4
4
|
import { existsSync, lchownSync, lstatSync, mkdirSync } from "node:fs";
|
|
@@ -60,13 +60,7 @@ if (mode === "read") {
|
|
|
60
60
|
*/
|
|
61
61
|
async function materializeAgentDirAsOwner(options) {
|
|
62
62
|
const { storageRoot, agentDir, owner, reads, build } = options;
|
|
63
|
-
const runAsOwner =
|
|
64
|
-
try {
|
|
65
|
-
return await options.runAsOwner(AGENT_DIR_SCRIPT, args, input);
|
|
66
|
-
} catch (error) {
|
|
67
|
-
throw new Error(`prime: cannot ${args[0]} the agent dir as its owner: ${error instanceof Error ? error.message : String(error)}`);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
63
|
+
const runAsOwner = (args, input) => options.runAsOwner(`prime: cannot ${args[0]} the agent dir as its owner`, AGENT_DIR_SCRIPT, args, input);
|
|
70
64
|
const snapshot = ensureOwnedAgentDir(storageRoot, agentDir, owner) ? Object.fromEntries(reads.map((file) => [file, null])) : JSON.parse(await runAsOwner(["read", ...reads]));
|
|
71
65
|
const writes = [];
|
|
72
66
|
const result = build({
|
|
@@ -281,7 +275,7 @@ var PrimeProviderAdapter = class extends AcpProviderAdapterBase {
|
|
|
281
275
|
storageRoot: this.agentDirOwnerRoot(agentDir),
|
|
282
276
|
agentDir,
|
|
283
277
|
owner: this.subprocessIdentity(),
|
|
284
|
-
runAsOwner: (script, args, input) => this.runNodeAsSubprocess(script, args, input),
|
|
278
|
+
runAsOwner: (operation, script, args, input) => this.runNodeAsSubprocess(operation, script, args, input),
|
|
285
279
|
reads: [primeHarnessStatePath(agentDir)],
|
|
286
280
|
build: (io) => {
|
|
287
281
|
materializePrimeModelsConfig(agentDir, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as PreparedAttachment, o as preparePromptInputParts } from "./prompt-input-CD7okX8T.mjs";
|
|
2
2
|
import { AskUserBridge, DEFAULT_INTERACTION_DECISION_TIMEOUT_MS as PERMISSION_DECISION_TIMEOUT_MS, InteractionBroker, InteractionBroker as InteractionBroker$1, InteractionHttpBridge, PermissionPromptBridge, RequestPermissionBridge, RequestPlanBridge, brokerInteractionTools as brokerInteractionTools$1 } from "@tangle-network/agent-core/interactions";
|
|
3
3
|
import * as _$_tangle_network_agent_profile_materialize0 from "@tangle-network/agent-profile-materialize";
|
|
4
|
-
import { BindableLaunchControl, CODEX_DISABLED_FEATURE_ARGS, HarnessId, HarnessId as HarnessId$1, WorkspacePlan, WorkspacePlanApplication, WorkspacePlanApplication as WorkspacePlanApplication$1, WorkspacePlanReceipt, codexDeveloperInstructionArgs } from "@tangle-network/agent-profile-materialize";
|
|
4
|
+
import { BindableLaunchControl, CODEX_DISABLED_FEATURE_ARGS, HarnessId, HarnessId as HarnessId$1, SECRET_REFERENCE as SECRET_REFERENCE$1, SECRET_REFERENCE_PREFIX, WorkspacePlan, WorkspacePlanApplication, WorkspacePlanApplication as WorkspacePlanApplication$1, WorkspacePlanReceipt, codexDeveloperInstructionArgs } from "@tangle-network/agent-profile-materialize";
|
|
5
5
|
import { CliExecResult, CliExitResult, CliLauncher, CliProcess, CliSpawnConfig, InvalidAttachmentError, JsonRpcError, RpcBridge, StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
6
6
|
import { AgentExecutionInput, AgentExecutionOutcome, AgentExecutionResult, AgentProfile, AgentProfileSecretProvider, AgentRuntimeAttachments, BackendCapabilities, BackendMessage, CliAuthFile, DurablePlan, GetMessagesOptions, HarnessType, InputPart, InteractionExecutionBinding, InteractionResponse, LocalMcpConfig, McpConfig, McpStatusResponse, PlanProviderState, ProviderConfig, ProxySecretReceipt, ReasoningEffort, RequestedInteractions, SdkHostServices, SdkPlanHost, SdkProviderAdapter, StreamEvent, TokenUsage, ToolPart } from "@tangle-network/agent-interface";
|
|
7
7
|
import { HarnessSessionContract } from "@tangle-network/cli-agent-registry/session-contract";
|
|
@@ -9,8 +9,8 @@ import * as _$_tangle_network_sdk_session_persistence0 from "@tangle-network/sdk
|
|
|
9
9
|
import { MessagePart, MessageStore, PersistedMessage, PersistedSession, SessionStore, readProviderMessageIds } from "@tangle-network/sdk-session-persistence";
|
|
10
10
|
import { ProviderLogger } from "@tangle-network/cli-agent-registry";
|
|
11
11
|
import { NATIVE_SESSION_CONTRACTS as NATIVE_SESSION_CONTRACTS$1 } from "@tangle-network/cli-agent-registry/native-session-contracts";
|
|
12
|
-
import { DEFAULT_INTERACTION_MCP_SERVER_NAME, InteractionMcpServer, InteractionMcpServerConfig, interactionMcpToolName } from "@tangle-network/agent-core/interactions/mcp";
|
|
13
12
|
import { isRecord as isPlainRecord } from "@tangle-network/agent-core";
|
|
13
|
+
import { DEFAULT_INTERACTION_MCP_SERVER_NAME, InteractionMcpServer, InteractionMcpServerConfig, interactionMcpToolName } from "@tangle-network/agent-core/interactions/mcp";
|
|
14
14
|
|
|
15
15
|
//#region src/acp-process-launch.d.ts
|
|
16
16
|
/** How to start the agent process for a session. */
|
|
@@ -35,9 +35,6 @@ interface AcpBridgeSpawn {
|
|
|
35
35
|
declare function spawnAcpBridge(request: AcpBridgeSpawn): RpcBridge;
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/secret-profile-mcp.d.ts
|
|
38
|
-
/** Executor-held MCP credentials shared by native private-profile adapters. */
|
|
39
|
-
declare const SECRET_REFERENCE_PREFIX = "TANGLE_PROFILE_SECRET_";
|
|
40
|
-
declare const SECRET_REFERENCE: RegExp;
|
|
41
38
|
declare function requireRecord(raw: unknown, message: string): Record<string, unknown>;
|
|
42
39
|
type SecretProfileMcpStdio<Value = string> = {
|
|
43
40
|
name: string;
|
|
@@ -228,6 +225,18 @@ interface ExecutionState {
|
|
|
228
225
|
id: string;
|
|
229
226
|
text: string;
|
|
230
227
|
}>;
|
|
228
|
+
/**
|
|
229
|
+
* Each streamed part's `type:id`, numbered by its first
|
|
230
|
+
* `message.part.updated` (recordStreamedPart): the order the live
|
|
231
|
+
* transcript showed. The persisted reply keeps it.
|
|
232
|
+
*/
|
|
233
|
+
partOrder?: Map<string, number>;
|
|
234
|
+
/**
|
|
235
|
+
* Each streamed text part's latest text, by the id the stream named it by.
|
|
236
|
+
* A reply that streams text, a tool and more text has two; each is stored
|
|
237
|
+
* as its own part. `textBuffer` stays the reply's text.
|
|
238
|
+
*/
|
|
239
|
+
textParts?: Map<string, string>;
|
|
231
240
|
fileParts?: Array<{
|
|
232
241
|
id: string;
|
|
233
242
|
key: string;
|
|
@@ -441,8 +450,11 @@ declare abstract class CliAdapterLifecycle<TConfig extends CliProviderConfig = C
|
|
|
441
450
|
};
|
|
442
451
|
/** Run a one-shot CLI command under this adapter's subprocess identity. */
|
|
443
452
|
protected runCli(config: Omit<CliSpawnConfig, "rawCapturePath">): Promise<CliExecResult<unknown>>;
|
|
444
|
-
/**
|
|
445
|
-
|
|
453
|
+
/**
|
|
454
|
+
* Run a builtin-only Node script under this adapter's subprocess identity and return its stdout. A failure carries
|
|
455
|
+
* `operation`, how the child ended and its stderr tail; execFile's own error names the script and holds stdout.
|
|
456
|
+
*/
|
|
457
|
+
protected runNodeAsSubprocess(operation: string, script: string, args: readonly string[], input?: string): Promise<string>;
|
|
446
458
|
getCapabilities(): BackendCapabilities;
|
|
447
459
|
initialize(config: ProviderConfig & Pick<CliProviderConfig, "runtimeAttachments">): Promise<void>;
|
|
448
460
|
private initializeAtGeneration;
|
|
@@ -898,6 +910,13 @@ declare class SessionRehydrationError extends Error {
|
|
|
898
910
|
declare function rejectNotLaunched<E>(error: E): never;
|
|
899
911
|
/** Whether this error is one the adapter raised before launching anything. */
|
|
900
912
|
declare function wasNeverLaunched(error: Error): boolean;
|
|
913
|
+
/**
|
|
914
|
+
* Run each cleanup in order, even after one fails, and return what the caller
|
|
915
|
+
* throws: `failure` (undefined for none) when every cleanup succeeds, else one
|
|
916
|
+
* AggregateError of `failure`, when there is one, and each cleanup's error, so
|
|
917
|
+
* a failed cleanup never hides the failure that needed it.
|
|
918
|
+
*/
|
|
919
|
+
declare function failureAfterCleanup(failure: unknown, message: string, ...cleanups: Array<() => unknown>): Promise<unknown>;
|
|
901
920
|
//#endregion
|
|
902
921
|
//#region src/event-parsers.d.ts
|
|
903
922
|
/**
|
|
@@ -1361,5 +1380,5 @@ declare function homeXdgEnv(home: string): {
|
|
|
1361
1380
|
XDG_STATE_HOME: string;
|
|
1362
1381
|
};
|
|
1363
1382
|
//#endregion
|
|
1364
|
-
export {
|
|
1365
|
-
//# sourceMappingURL=index-
|
|
1383
|
+
export { InteractionMcpServer$1 as $, PerTurnInteractionInput as $t, ROUTER_MODEL_CATALOG_TIMEOUT_MS as A, CliTurnSpawn as At, trackReasoningBlock as B, AcpSessionUpdateParams as Bt, NATIVE_SESSION_CONTRACTS$1 as C, AcpBridgeSpawn as Cn, wasNeverLaunched as Ct, provenStoreBinary as D, runtimeSecretsOverlay as Dt, isTrustedStoreBinary as E, CliProviderAdapterBase as Et, resolveRouterModelLimits as F, AcpContentBlock as Ft, readCliTokenUsage as G, CliExecutionInput as Gt, nativeEffortArgs as H, acpContentText as Ht, resolveRouterModelReasoningEfforts as I, AcpInitializeParams as It, localMcpArgv as J, CliProviderOptions as Jt, recordCliTokenUsage as K, CliProviderConfig as Kt, RepeatedToolFailure as L, AcpInitializeResult as Lt, RouterModelLimits as M, ACP_MIN_PROTOCOL_VERSION as Mt, RouterModelLimitsResult as N, ACP_PROTOCOL_VERSION as Nt, refuseSecretLaunch as O, createExecutionState as Ot, findRouterCatalogEntry as P, AcpBridgeConfig as Pt, DEFAULT_INTERACTION_MCP_SERVER_NAME as Q, InteractionToggleKind as Qt, RepeatedToolFailureGuardOptions as R, AcpNewSessionResult as Rt, secretMcpScope as S, untilSettledOrAborted as Sn, rejectNotLaunched as St, assertSealedNativeHome as T, spawnAcpBridge as Tn, AcpProviderAdapterBase as Tt, accumulateCliTokenUsage as U, assertAcpTurnFinished as Ut, kimiThinkingArgs as V, AcpTurn as Vt, parseCliUsageLine as W, CliExecArgs as Wt, McpInteractionSupport as X, ExecutionState as Xt, localMcpEnv as Y, EphemeralContextInput as Yt, AskUserBridge as Z, InteractionToggleConfig as Zt, textDeltaEvents as _, requireRecord as _n, jsonEventParser as _t, PERMISSION_DECISION_TIMEOUT_MS as a, turnEndReason as an, interactionMcpToolName as at, toolStartEvents as b, servableMcpServer as bn, SessionRehydrationError as bt, WorkspacePlanApplication$1 as c, withTurnInteractions as cn, deterministicFilePartId as ct, TerminalPlanSupport as d, SecretProfileMcpServer as dn, EXECUTION_CORRELATION_HEADERS as dt, ToolCallState as en, InteractionMcpServerConfig$1 as et, TerminalPlanSupportOptions as f, assertSealedNativeSearchPath as fn, EXECUTION_ID_HEADER as ft, streamPartBase as g, joinQueue as gn, PlaintextResponse as gt, sessionObservedEvents as h, isPlainRecord as hn, executionCorrelationHeaders as ht, InteractionHttpBridge as i, readEphemeralContext as in, brokerInteractionTools$1 as it, ResolveRouterModelLimitsInput as j, PreparedCliLaunch as jt, resolveExecutableRealpath as k, CliTurnProcess as kt, codexDeveloperInstructionArgs as l, SecretProfileMcpCredentialProxy as ln, inferMediaType as lt, reasoningEvents as m, isLoopbackEndpoint as mn, MANAGED_QUOTE_VERSION_HEADER as mt, HarnessId$1 as n, enabledInteractionKinds as nn, RequestPermissionBridge as nt, SECRET_REFERENCE$1 as o, turnInteractionEnabled as on, buildFileUrl as ot, finalTextEvent as p, directStdioMcpServers as pn, EXECUTION_TRACE_HEADER as pt, isLocalMcpConfig as q, CliProviderLogger as qt, InteractionBroker$1 as r, interactionToggleEnabled as rn, RequestPlanBridge as rt, SECRET_REFERENCE_PREFIX as s, withEphemeralContext as sn, deriveFilePart as st, CODEX_DISABLED_FEATURE_ARGS as t, TurnEndReason as tn, PermissionPromptBridge as tt, homeXdgEnv as u, SecretProfileMcpLease as un, trackFilePart as ut, textSnapshotEvents as v, resolveReferences as vn, plaintextResponseParser as vt, SEALED_NATIVE_HOME_LAYOUT as w, AcpProcessSpec as wn, mapAcpSessionUpdate as wt, forgetSessionScopes as x, servableStdioServer as xn, failureAfterCleanup as xt, toolResultEvents as y, secretSessionTurnQueue as yn, InvalidAttachmentError as yt, createRepeatedToolFailureGuard as z, AcpPromptResult as zt };
|
|
1384
|
+
//# sourceMappingURL=index-CWT1VwcD.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as InteractionMcpServer, $t as PerTurnInteractionInput, A as ROUTER_MODEL_CATALOG_TIMEOUT_MS, At as CliTurnSpawn, B as trackReasoningBlock, Bt as AcpSessionUpdateParams, C as NATIVE_SESSION_CONTRACTS, Cn as AcpBridgeSpawn, Ct as wasNeverLaunched, D as provenStoreBinary, Dt as runtimeSecretsOverlay, E as isTrustedStoreBinary, Et as CliProviderAdapterBase, F as resolveRouterModelLimits, Ft as AcpContentBlock, G as readCliTokenUsage, Gt as CliExecutionInput, H as nativeEffortArgs, Ht as acpContentText, I as resolveRouterModelReasoningEfforts, It as AcpInitializeParams, J as localMcpArgv, Jt as CliProviderOptions, K as recordCliTokenUsage, Kt as CliProviderConfig, L as RepeatedToolFailure, Lt as AcpInitializeResult, M as RouterModelLimits, Mt as ACP_MIN_PROTOCOL_VERSION, N as RouterModelLimitsResult, Nt as ACP_PROTOCOL_VERSION, O as refuseSecretLaunch, Ot as createExecutionState, P as findRouterCatalogEntry, Pt as AcpBridgeConfig, Q as DEFAULT_INTERACTION_MCP_SERVER_NAME, Qt as InteractionToggleKind, R as RepeatedToolFailureGuardOptions, Rt as AcpNewSessionResult, S as secretMcpScope, Sn as untilSettledOrAborted, St as rejectNotLaunched, T as assertSealedNativeHome, Tn as spawnAcpBridge, Tt as AcpProviderAdapterBase, U as accumulateCliTokenUsage, Ut as assertAcpTurnFinished, V as kimiThinkingArgs, Vt as AcpTurn, W as parseCliUsageLine, Wt as CliExecArgs, X as McpInteractionSupport, Xt as ExecutionState, Y as localMcpEnv, Yt as EphemeralContextInput, Z as AskUserBridge, Zt as InteractionToggleConfig, _ as textDeltaEvents, _n as requireRecord, _t as jsonEventParser, a as PERMISSION_DECISION_TIMEOUT_MS, an as turnEndReason, at as interactionMcpToolName, b as toolStartEvents, bn as servableMcpServer, bt as SessionRehydrationError, c as WorkspacePlanApplication, cn as withTurnInteractions, ct as deterministicFilePartId, d as TerminalPlanSupport, dn as SecretProfileMcpServer, dt as EXECUTION_CORRELATION_HEADERS, en as ToolCallState, et as InteractionMcpServerConfig, f as TerminalPlanSupportOptions, fn as assertSealedNativeSearchPath, ft as EXECUTION_ID_HEADER, g as streamPartBase, gn as joinQueue, gt as PlaintextResponse, h as sessionObservedEvents, hn as isPlainRecord, ht as executionCorrelationHeaders, i as InteractionHttpBridge, in as readEphemeralContext, it as brokerInteractionTools, j as ResolveRouterModelLimitsInput, jt as PreparedCliLaunch, k as resolveExecutableRealpath, kt as CliTurnProcess, l as codexDeveloperInstructionArgs, ln as SecretProfileMcpCredentialProxy, lt as inferMediaType, m as reasoningEvents, mn as isLoopbackEndpoint, mt as MANAGED_QUOTE_VERSION_HEADER, n as HarnessId, nn as enabledInteractionKinds, nt as RequestPermissionBridge, o as SECRET_REFERENCE, on as turnInteractionEnabled, ot as buildFileUrl, p as finalTextEvent, pn as directStdioMcpServers, pt as EXECUTION_TRACE_HEADER, q as isLocalMcpConfig, qt as CliProviderLogger, r as InteractionBroker, rn as interactionToggleEnabled, rt as RequestPlanBridge, s as SECRET_REFERENCE_PREFIX, sn as withEphemeralContext, st as deriveFilePart, t as CODEX_DISABLED_FEATURE_ARGS, tn as TurnEndReason, tt as PermissionPromptBridge, u as homeXdgEnv, un as SecretProfileMcpLease, ut as trackFilePart, v as textSnapshotEvents, vn as resolveReferences, vt as plaintextResponseParser, w as SEALED_NATIVE_HOME_LAYOUT, wn as AcpProcessSpec, wt as mapAcpSessionUpdate, x as forgetSessionScopes, xn as servableStdioServer, xt as failureAfterCleanup, y as toolResultEvents, yn as secretSessionTurnQueue, yt as InvalidAttachmentError, z as createRepeatedToolFailureGuard, zt as AcpPromptResult } from "./index-CWT1VwcD.mjs";
|
|
2
2
|
import { a as partitionImageAttachments, i as PreparedAttachment, n as MAX_TOTAL_INLINE_IMAGE_BYTES, o as preparePromptInputParts, r as PROMPT_SECTION_SEPARATOR, s as prependPromptSection, t as MAX_INLINE_IMAGE_BYTES } from "./prompt-input-CD7okX8T.mjs";
|
|
3
|
-
export { ACP_MIN_PROTOCOL_VERSION, ACP_PROTOCOL_VERSION, AcpBridgeConfig, AcpBridgeSpawn, AcpContentBlock, AcpInitializeParams, AcpInitializeResult, AcpNewSessionResult, AcpProcessSpec, AcpPromptResult, AcpProviderAdapterBase, AcpSessionUpdateParams, AcpTurn, AskUserBridge, CODEX_DISABLED_FEATURE_ARGS, CliExecArgs, CliExecutionInput, CliProviderAdapterBase, CliProviderConfig, CliProviderLogger, CliProviderOptions, CliTurnProcess, CliTurnSpawn, DEFAULT_INTERACTION_MCP_SERVER_NAME, EXECUTION_CORRELATION_HEADERS, EXECUTION_ID_HEADER, EXECUTION_TRACE_HEADER, EphemeralContextInput, ExecutionState, HarnessId, InteractionBroker, InteractionHttpBridge, InteractionMcpServer, InteractionMcpServerConfig, InteractionToggleConfig, InteractionToggleKind, InvalidAttachmentError, MANAGED_QUOTE_VERSION_HEADER, MAX_INLINE_IMAGE_BYTES, MAX_TOTAL_INLINE_IMAGE_BYTES, McpInteractionSupport, NATIVE_SESSION_CONTRACTS, PERMISSION_DECISION_TIMEOUT_MS, PROMPT_SECTION_SEPARATOR, PerTurnInteractionInput, PermissionPromptBridge, PlaintextResponse, PreparedAttachment, PreparedCliLaunch, ROUTER_MODEL_CATALOG_TIMEOUT_MS, RepeatedToolFailure, RepeatedToolFailureGuardOptions, RequestPermissionBridge, RequestPlanBridge, ResolveRouterModelLimitsInput, RouterModelLimits, RouterModelLimitsResult, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SecretProfileMcpCredentialProxy, SecretProfileMcpLease, SecretProfileMcpServer, SessionRehydrationError, TerminalPlanSupport, TerminalPlanSupportOptions, ToolCallState, TurnEndReason, WorkspacePlanApplication, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, executionCorrelationHeaders, finalTextEvent, findRouterCatalogEntry, forgetSessionScopes, homeXdgEnv, inferMediaType, interactionMcpToolName, interactionToggleEnabled, isLocalMcpConfig, isLoopbackEndpoint, isPlainRecord, isTrustedStoreBinary, joinQueue, jsonEventParser, kimiThinkingArgs, localMcpArgv, localMcpEnv, mapAcpSessionUpdate, nativeEffortArgs, parseCliUsageLine, partitionImageAttachments, plaintextResponseParser, preparePromptInputParts, prependPromptSection, provenStoreBinary, readCliTokenUsage, readEphemeralContext, reasoningEvents, recordCliTokenUsage, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, spawnAcpBridge, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
|
3
|
+
export { ACP_MIN_PROTOCOL_VERSION, ACP_PROTOCOL_VERSION, AcpBridgeConfig, AcpBridgeSpawn, AcpContentBlock, AcpInitializeParams, AcpInitializeResult, AcpNewSessionResult, AcpProcessSpec, AcpPromptResult, AcpProviderAdapterBase, AcpSessionUpdateParams, AcpTurn, AskUserBridge, CODEX_DISABLED_FEATURE_ARGS, CliExecArgs, CliExecutionInput, CliProviderAdapterBase, CliProviderConfig, CliProviderLogger, CliProviderOptions, CliTurnProcess, CliTurnSpawn, DEFAULT_INTERACTION_MCP_SERVER_NAME, EXECUTION_CORRELATION_HEADERS, EXECUTION_ID_HEADER, EXECUTION_TRACE_HEADER, EphemeralContextInput, ExecutionState, HarnessId, InteractionBroker, InteractionHttpBridge, InteractionMcpServer, InteractionMcpServerConfig, InteractionToggleConfig, InteractionToggleKind, InvalidAttachmentError, MANAGED_QUOTE_VERSION_HEADER, MAX_INLINE_IMAGE_BYTES, MAX_TOTAL_INLINE_IMAGE_BYTES, McpInteractionSupport, NATIVE_SESSION_CONTRACTS, PERMISSION_DECISION_TIMEOUT_MS, PROMPT_SECTION_SEPARATOR, PerTurnInteractionInput, PermissionPromptBridge, PlaintextResponse, PreparedAttachment, PreparedCliLaunch, ROUTER_MODEL_CATALOG_TIMEOUT_MS, RepeatedToolFailure, RepeatedToolFailureGuardOptions, RequestPermissionBridge, RequestPlanBridge, ResolveRouterModelLimitsInput, RouterModelLimits, RouterModelLimitsResult, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SecretProfileMcpCredentialProxy, SecretProfileMcpLease, SecretProfileMcpServer, SessionRehydrationError, TerminalPlanSupport, TerminalPlanSupportOptions, ToolCallState, TurnEndReason, WorkspacePlanApplication, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, executionCorrelationHeaders, failureAfterCleanup, finalTextEvent, findRouterCatalogEntry, forgetSessionScopes, homeXdgEnv, inferMediaType, interactionMcpToolName, interactionToggleEnabled, isLocalMcpConfig, isLoopbackEndpoint, isPlainRecord, isTrustedStoreBinary, joinQueue, jsonEventParser, kimiThinkingArgs, localMcpArgv, localMcpEnv, mapAcpSessionUpdate, nativeEffortArgs, parseCliUsageLine, partitionImageAttachments, plaintextResponseParser, preparePromptInputParts, prependPromptSection, provenStoreBinary, readCliTokenUsage, readEphemeralContext, reasoningEvents, recordCliTokenUsage, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, spawnAcpBridge, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as enabledInteractionKinds, A as resolveRouterModelLimits, At as
|
|
2
|
-
export { ACP_MIN_PROTOCOL_VERSION, ACP_PROTOCOL_VERSION, AcpProviderAdapterBase, CODEX_DISABLED_FEATURE_ARGS, CliProviderAdapterBase, DEFAULT_INTERACTION_MCP_SERVER_NAME, EXECUTION_CORRELATION_HEADERS, EXECUTION_ID_HEADER, EXECUTION_TRACE_HEADER, InteractionBroker, InteractionHttpBridge, InteractionMcpServer, InvalidAttachmentError, MANAGED_QUOTE_VERSION_HEADER, MAX_INLINE_IMAGE_BYTES, MAX_TOTAL_INLINE_IMAGE_BYTES, McpInteractionSupport, NATIVE_SESSION_CONTRACTS, PERMISSION_DECISION_TIMEOUT_MS, PROMPT_SECTION_SEPARATOR, ROUTER_MODEL_CATALOG_TIMEOUT_MS, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SessionRehydrationError, TerminalPlanSupport, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, executionCorrelationHeaders, finalTextEvent, findRouterCatalogEntry, forgetSessionScopes, homeXdgEnv, inferMediaType, interactionMcpToolName, interactionToggleEnabled, isLocalMcpConfig, isLoopbackEndpoint, isPlainRecord, isTrustedStoreBinary, joinQueue, jsonEventParser, kimiThinkingArgs, localMcpArgv, localMcpEnv, mapAcpSessionUpdate, nativeEffortArgs, parseCliUsageLine, partitionImageAttachments, plaintextResponseParser, preparePromptInputParts, prependPromptSection, provenStoreBinary, readCliTokenUsage, readEphemeralContext, reasoningEvents, recordCliTokenUsage, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, spawnAcpBridge, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
|
1
|
+
import { $ as enabledInteractionKinds, A as resolveRouterModelLimits, At as finalTextEvent, B as jsonEventParser, Bt as ACP_PROTOCOL_VERSION, C as assertSealedNativeHome, Ct as EXECUTION_CORRELATION_HEADERS, D as resolveExecutableRealpath, Dt as executionCorrelationHeaders, E as refuseSecretLaunch, Et as MANAGED_QUOTE_VERSION_HEADER, F as TerminalPlanSupport, Ft as textSnapshotEvents, G as readCliTokenUsage, H as AcpProviderAdapterBase, Ht as assertAcpTurnFinished, I as DEFAULT_INTERACTION_MCP_SERVER_NAME, It as toolResultEvents, J as createRepeatedToolFailureGuard, K as recordCliTokenUsage, L as InteractionMcpServer, Lt as toolStartEvents, M as kimiThinkingArgs, Mt as sessionObservedEvents, N as nativeEffortArgs, Nt as streamPartBase, O as ROUTER_MODEL_CATALOG_TIMEOUT_MS, Ot as homeXdgEnv, P as McpInteractionSupport, Pt as textDeltaEvents, Q as localMcpEnv, R as brokerInteractionTools, Rt as trackReasoningBlock, S as SEALED_NATIVE_HOME_LAYOUT, St as runtimeSecretsOverlay, T as provenStoreBinary, Tt as EXECUTION_TRACE_HEADER, U as accumulateCliTokenUsage, Ut as spawnAcpBridge, V as plaintextResponseParser, Vt as acpContentText, W as parseCliUsageLine, X as isLocalMcpConfig, Y as createExecutionState, Z as localMcpArgv, _ as secretSessionTurnQueue, _t as InvalidAttachmentError, a as SECRET_REFERENCE, at as withTurnInteractions, b as untilSettledOrAborted, bt as rejectNotLaunched, c as forgetSessionScopes, ct as PROMPT_SECTION_SEPARATOR, d as directStdioMcpServers, dt as prependPromptSection, et as interactionToggleEnabled, f as isLoopbackEndpoint, ft as buildFileUrl, g as resolveReferences, gt as trackFilePart, h as requireRecord, ht as inferMediaType, i as PERMISSION_DECISION_TIMEOUT_MS, it as withEphemeralContext, j as resolveRouterModelReasoningEfforts, jt as reasoningEvents, k as findRouterCatalogEntry, kt as mapAcpSessionUpdate, l as secretMcpScope, lt as partitionImageAttachments, m as joinQueue, mt as deterministicFilePartId, n as InteractionBroker, nt as turnEndReason, o as SECRET_REFERENCE_PREFIX, ot as MAX_INLINE_IMAGE_BYTES, p as isPlainRecord, pt as deriveFilePart, q as CliProviderAdapterBase, r as InteractionHttpBridge, rt as turnInteractionEnabled, s as codexDeveloperInstructionArgs, st as MAX_TOTAL_INLINE_IMAGE_BYTES, t as CODEX_DISABLED_FEATURE_ARGS, tt as readEphemeralContext, u as assertSealedNativeSearchPath, ut as preparePromptInputParts, v as servableMcpServer, vt as SessionRehydrationError, w as isTrustedStoreBinary, wt as EXECUTION_ID_HEADER, x as NATIVE_SESSION_CONTRACTS, xt as wasNeverLaunched, y as servableStdioServer, yt as failureAfterCleanup, z as interactionMcpToolName, zt as ACP_MIN_PROTOCOL_VERSION } from "./src-DG4Y1JhF.mjs";
|
|
2
|
+
export { ACP_MIN_PROTOCOL_VERSION, ACP_PROTOCOL_VERSION, AcpProviderAdapterBase, CODEX_DISABLED_FEATURE_ARGS, CliProviderAdapterBase, DEFAULT_INTERACTION_MCP_SERVER_NAME, EXECUTION_CORRELATION_HEADERS, EXECUTION_ID_HEADER, EXECUTION_TRACE_HEADER, InteractionBroker, InteractionHttpBridge, InteractionMcpServer, InvalidAttachmentError, MANAGED_QUOTE_VERSION_HEADER, MAX_INLINE_IMAGE_BYTES, MAX_TOTAL_INLINE_IMAGE_BYTES, McpInteractionSupport, NATIVE_SESSION_CONTRACTS, PERMISSION_DECISION_TIMEOUT_MS, PROMPT_SECTION_SEPARATOR, ROUTER_MODEL_CATALOG_TIMEOUT_MS, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SessionRehydrationError, TerminalPlanSupport, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, executionCorrelationHeaders, failureAfterCleanup, finalTextEvent, findRouterCatalogEntry, forgetSessionScopes, homeXdgEnv, inferMediaType, interactionMcpToolName, interactionToggleEnabled, isLocalMcpConfig, isLoopbackEndpoint, isPlainRecord, isTrustedStoreBinary, joinQueue, jsonEventParser, kimiThinkingArgs, localMcpArgv, localMcpEnv, mapAcpSessionUpdate, nativeEffortArgs, parseCliUsageLine, partitionImageAttachments, plaintextResponseParser, preparePromptInputParts, prependPromptSection, provenStoreBinary, readCliTokenUsage, readEphemeralContext, reasoningEvents, recordCliTokenUsage, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, spawnAcpBridge, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_INTERACTION_DECISION_TIMEOUT_MS as PERMISSION_DECISION_TIMEOUT_MS, InteractionBroker, InteractionBroker as InteractionBroker$1, InteractionHttpBridge, brokerInteractionTools, brokerInteractionTools as brokerInteractionTools$1 } from "@tangle-network/agent-core/interactions";
|
|
2
|
-
import { CODEX_DISABLED_FEATURE_ARGS, HARNESS_LAUNCH_MATERIALIZE_OPTIONS, UNAVAILABLE_AGENT_PROFILE_SECRET_PROVIDER, applyWorkspacePlanWithSecretProvider, bindLaunchToolBinDirs, bindSecretSessionView, codexDeveloperInstructionArgs, enforceWorkspacePlanSupport, ensurePublicConcurrentProfileRoots, joinSystemPromptAdditions, keepsHarnessSystemPrompt, materializeProfile, modelIdsMatch, parseSandboxToolBinDirs, preparePublicConcurrentProfileRevision, prepareSecretConcurrentProfileRevision, resolveAgentProfileResources, secretSessionViewWorkspace } from "@tangle-network/agent-profile-materialize";
|
|
2
|
+
import { CODEX_DISABLED_FEATURE_ARGS, HARNESS_LAUNCH_MATERIALIZE_OPTIONS, SECRET_REFERENCE, SECRET_REFERENCE as SECRET_REFERENCE$1, SECRET_REFERENCE_PREFIX, UNAVAILABLE_AGENT_PROFILE_SECRET_PROVIDER, applyWorkspacePlanWithSecretProvider, bindLaunchToolBinDirs, bindSecretSessionView, codexDeveloperInstructionArgs, enforceWorkspacePlanSupport, ensurePublicConcurrentProfileRoots, joinSystemPromptAdditions, keepsHarnessSystemPrompt, materializeProfile, modelIdsMatch, parseSandboxToolBinDirs, preparePublicConcurrentProfileRevision, prepareSecretConcurrentProfileRevision, resolveAgentProfileResources, secretSessionViewWorkspace } from "@tangle-network/agent-profile-materialize";
|
|
3
3
|
import { BridgeClosedError, InvalidAttachmentError, JsonRpcError, RpcRequestTimeoutError, execCli, launchCliProcess, resolveRawCapturePath, spawnCliProcess, spawnRpcBridge } from "@tangle-network/sdk-cli-runner";
|
|
4
4
|
import { createHash, createHmac, randomUUID } from "node:crypto";
|
|
5
5
|
import { AgentExecutionError, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, InteractionExecutionBindingSchema, InteractionKind, ProxySecretReceiptSchema, REASONING_EFFORTS, agentProfileSchema, nativeReasoningControl, normalizeInputParts } from "@tangle-network/agent-interface";
|
|
@@ -13,6 +13,7 @@ import { execFile } from "node:child_process";
|
|
|
13
13
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
14
14
|
import { messageStorageDirOf } from "@tangle-network/cli-agent-registry";
|
|
15
15
|
import { NATIVE_SESSION_CONTRACTS, NATIVE_SESSION_CONTRACTS as NATIVE_SESSION_CONTRACTS$1, configDirHomeEnv } from "@tangle-network/cli-agent-registry/native-session-contracts";
|
|
16
|
+
import { isRecord, isRecord as isPlainRecord } from "@tangle-network/agent-core";
|
|
16
17
|
import * as W3C from "@tangle-network/agent-trace-contract";
|
|
17
18
|
import { z } from "zod";
|
|
18
19
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -20,7 +21,6 @@ import { DatabaseSync } from "node:sqlite";
|
|
|
20
21
|
import { StringDecoder } from "node:string_decoder";
|
|
21
22
|
import { DEFAULT_INTERACTION_MCP_SERVER_NAME, InteractionMcpServer, interactionMcpToolName } from "@tangle-network/agent-core/interactions/mcp";
|
|
22
23
|
import { addAbortListener } from "node:events";
|
|
23
|
-
import { isRecord, isRecord as isPlainRecord } from "@tangle-network/agent-core";
|
|
24
24
|
//#region src/acp-process-launch.ts
|
|
25
25
|
/** Spawn an ACP agent over NDJSON stdio from `env` alone, never the sidecar's own environment. The adapter owns abort, so no signal. */
|
|
26
26
|
function spawnAcpBridge(request) {
|
|
@@ -427,47 +427,6 @@ function mapAcpSessionUpdate({ update }, state, options) {
|
|
|
427
427
|
}];
|
|
428
428
|
}
|
|
429
429
|
//#endregion
|
|
430
|
-
//#region src/provider-config.ts
|
|
431
|
-
/**
|
|
432
|
-
* Render a value as a digest that does not change with key order. The type
|
|
433
|
-
* parameter keeps the caller's own type at the call site, so the digest of a
|
|
434
|
-
* configuration cannot silently accept a value of an unrelated shape.
|
|
435
|
-
*/
|
|
436
|
-
function stableSerialize(value) {
|
|
437
|
-
if (value === null) return "null";
|
|
438
|
-
if (value === void 0) return "undefined";
|
|
439
|
-
if (typeof value === "string") return JSON.stringify(value);
|
|
440
|
-
if (typeof value === "number") {
|
|
441
|
-
if (Number.isNaN(value)) return "number:NaN";
|
|
442
|
-
if (Object.is(value, -0)) return "number:-0";
|
|
443
|
-
return `number:${value}`;
|
|
444
|
-
}
|
|
445
|
-
if (typeof value === "boolean") return value ? "true" : "false";
|
|
446
|
-
if (typeof value === "bigint") return `bigint:${value.toString()}`;
|
|
447
|
-
if (Array.isArray(value)) return `[${value.map((entry) => stableSerialize(entry)).join(",")}]`;
|
|
448
|
-
if (typeof value === "object") return `{${Object.entries(value).filter(([, entry]) => entry !== void 0).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableSerialize(entry)}`).join(",")}}`;
|
|
449
|
-
return `${typeof value}:${String(value)}`;
|
|
450
|
-
}
|
|
451
|
-
function cloneConfig(config) {
|
|
452
|
-
return structuredClone(config);
|
|
453
|
-
}
|
|
454
|
-
function isInteractionObject(value) {
|
|
455
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
456
|
-
}
|
|
457
|
-
function mergeCliProviderConfig(current, next) {
|
|
458
|
-
const merged = {
|
|
459
|
-
...current,
|
|
460
|
-
...next
|
|
461
|
-
};
|
|
462
|
-
const currentInteractions = current.interactions;
|
|
463
|
-
const nextInteractions = next.interactions;
|
|
464
|
-
if (isInteractionObject(currentInteractions) && isInteractionObject(nextInteractions)) merged.interactions = {
|
|
465
|
-
...currentInteractions,
|
|
466
|
-
...nextInteractions
|
|
467
|
-
};
|
|
468
|
-
return merged;
|
|
469
|
-
}
|
|
470
|
-
//#endregion
|
|
471
430
|
//#region src/adapter-initialization.ts
|
|
472
431
|
/**
|
|
473
432
|
* The in-flight and settled initialization of one adapter, and the pending
|
|
@@ -511,7 +470,7 @@ var InitializationTracker = class {
|
|
|
511
470
|
* trusted-path or identity value is malformed.
|
|
512
471
|
*/
|
|
513
472
|
function overlayProviderConfig(provider, initialConfig, config) {
|
|
514
|
-
const nextConfig =
|
|
473
|
+
const nextConfig = structuredClone(initialConfig);
|
|
515
474
|
const proxySecretReceipt = config.proxySecretReceipt;
|
|
516
475
|
if (proxySecretReceipt !== void 0) nextConfig.proxySecretReceipt = ProxySecretReceiptSchema.parse(proxySecretReceipt);
|
|
517
476
|
const runtimeAttachments = config.runtimeAttachments;
|
|
@@ -601,6 +560,41 @@ function finishExecution(owner, execution) {
|
|
|
601
560
|
execution.resolveSettled();
|
|
602
561
|
}
|
|
603
562
|
//#endregion
|
|
563
|
+
//#region src/provider-config.ts
|
|
564
|
+
/**
|
|
565
|
+
* Render a value as a digest that does not change with key order. The type
|
|
566
|
+
* parameter keeps the caller's own type at the call site, so the digest of a
|
|
567
|
+
* configuration cannot silently accept a value of an unrelated shape.
|
|
568
|
+
*/
|
|
569
|
+
function stableSerialize(value) {
|
|
570
|
+
if (value === null) return "null";
|
|
571
|
+
if (value === void 0) return "undefined";
|
|
572
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
573
|
+
if (typeof value === "number") {
|
|
574
|
+
if (Number.isNaN(value)) return "number:NaN";
|
|
575
|
+
if (Object.is(value, -0)) return "number:-0";
|
|
576
|
+
return `number:${value}`;
|
|
577
|
+
}
|
|
578
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
579
|
+
if (typeof value === "bigint") return `bigint:${value.toString()}`;
|
|
580
|
+
if (Array.isArray(value)) return `[${value.map((entry) => stableSerialize(entry)).join(",")}]`;
|
|
581
|
+
if (typeof value === "object") return `{${Object.entries(value).filter(([, entry]) => entry !== void 0).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableSerialize(entry)}`).join(",")}}`;
|
|
582
|
+
return `${typeof value}:${String(value)}`;
|
|
583
|
+
}
|
|
584
|
+
function mergeCliProviderConfig(current, next) {
|
|
585
|
+
const merged = {
|
|
586
|
+
...current,
|
|
587
|
+
...next
|
|
588
|
+
};
|
|
589
|
+
const currentInteractions = current.interactions;
|
|
590
|
+
const nextInteractions = next.interactions;
|
|
591
|
+
if (isRecord(currentInteractions) && isRecord(nextInteractions)) merged.interactions = {
|
|
592
|
+
...currentInteractions,
|
|
593
|
+
...nextInteractions
|
|
594
|
+
};
|
|
595
|
+
return merged;
|
|
596
|
+
}
|
|
597
|
+
//#endregion
|
|
604
598
|
//#region src/writable-home.ts
|
|
605
599
|
/**
|
|
606
600
|
* The nearest ancestor of `target` that exists, or null when even the root of
|
|
@@ -710,8 +704,8 @@ var CliAdapterLifecycle = class {
|
|
|
710
704
|
initialization = new InitializationTracker(() => this.provider);
|
|
711
705
|
constructor(options = {}) {
|
|
712
706
|
executionLifecycle(this);
|
|
713
|
-
this.initialConfig =
|
|
714
|
-
this.config =
|
|
707
|
+
this.initialConfig = structuredClone(options.config ?? {});
|
|
708
|
+
this.config = structuredClone(this.initialConfig);
|
|
715
709
|
this.logger = options.logger ?? consoleLogger;
|
|
716
710
|
this.storagePath = options.storagePath ?? process.cwd();
|
|
717
711
|
this._storageDir = options.storageDir;
|
|
@@ -777,8 +771,11 @@ var CliAdapterLifecycle = class {
|
|
|
777
771
|
}
|
|
778
772
|
});
|
|
779
773
|
}
|
|
780
|
-
/**
|
|
781
|
-
|
|
774
|
+
/**
|
|
775
|
+
* Run a builtin-only Node script under this adapter's subprocess identity and return its stdout. A failure carries
|
|
776
|
+
* `operation`, how the child ended and its stderr tail; execFile's own error names the script and holds stdout.
|
|
777
|
+
*/
|
|
778
|
+
async runNodeAsSubprocess(operation, script, args, input = "") {
|
|
782
779
|
try {
|
|
783
780
|
const pending = execFileAsync(process.execPath, [
|
|
784
781
|
"-e",
|
|
@@ -796,8 +793,14 @@ var CliAdapterLifecycle = class {
|
|
|
796
793
|
pending.child.stdin?.end(input);
|
|
797
794
|
return (await pending).stdout;
|
|
798
795
|
} catch (error) {
|
|
799
|
-
const
|
|
800
|
-
|
|
796
|
+
const { code, signal, stderr = "" } = error;
|
|
797
|
+
const exitCode = typeof code === "number" ? code : null;
|
|
798
|
+
const ended = exitCode === null ? signal ?? code ?? "failed" : `exit ${exitCode}`;
|
|
799
|
+
const tail = stderr.trim().slice(-500);
|
|
800
|
+
throw new Error(`${operation} (${ended})${tail && `: ${tail}`}`, { cause: {
|
|
801
|
+
exitCode,
|
|
802
|
+
signal: signal ?? null
|
|
803
|
+
} });
|
|
801
804
|
}
|
|
802
805
|
}
|
|
803
806
|
getCapabilities() {
|
|
@@ -873,7 +876,7 @@ var CliAdapterLifecycle = class {
|
|
|
873
876
|
this.initialization.initializedConfigKey = configKey;
|
|
874
877
|
} catch (error) {
|
|
875
878
|
if (generation === this.initialization.generation) {
|
|
876
|
-
this.config =
|
|
879
|
+
this.config = structuredClone(this.initialConfig);
|
|
877
880
|
this.sessionStore = null;
|
|
878
881
|
this.messageStore = null;
|
|
879
882
|
this.initialized = false;
|
|
@@ -914,7 +917,7 @@ var CliAdapterLifecycle = class {
|
|
|
914
917
|
this.initialization.cancel();
|
|
915
918
|
this.initialized = false;
|
|
916
919
|
executionLifecycle(this).shuttingDown = true;
|
|
917
|
-
this.config =
|
|
920
|
+
this.config = structuredClone(this.initialConfig);
|
|
918
921
|
if (this.initialization.shutdownPromise) return this.initialization.shutdownPromise;
|
|
919
922
|
const executions = [...executionLifecycle(this).inFlightExecutions];
|
|
920
923
|
const processes = [...this.activeProcesses];
|
|
@@ -1196,6 +1199,22 @@ function rejectNotLaunched(error) {
|
|
|
1196
1199
|
function wasNeverLaunched(error) {
|
|
1197
1200
|
return Object.getOwnPropertyDescriptor(error, NOT_LAUNCHED)?.value === true;
|
|
1198
1201
|
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Run each cleanup in order, even after one fails, and return what the caller
|
|
1204
|
+
* throws: `failure` (undefined for none) when every cleanup succeeds, else one
|
|
1205
|
+
* AggregateError of `failure`, when there is one, and each cleanup's error, so
|
|
1206
|
+
* a failed cleanup never hides the failure that needed it.
|
|
1207
|
+
*/
|
|
1208
|
+
async function failureAfterCleanup(failure, message, ...cleanups) {
|
|
1209
|
+
const errors = failure === void 0 ? [] : [failure];
|
|
1210
|
+
const before = errors.length;
|
|
1211
|
+
for (const cleanup of cleanups) try {
|
|
1212
|
+
await cleanup();
|
|
1213
|
+
} catch (error) {
|
|
1214
|
+
errors.push(error);
|
|
1215
|
+
}
|
|
1216
|
+
return errors.length === before ? failure : new AggregateError(errors, message);
|
|
1217
|
+
}
|
|
1199
1218
|
//#endregion
|
|
1200
1219
|
//#region src/file-parts.ts
|
|
1201
1220
|
/** Extension → MIME type, keyed by lowercased extension without the dot. */
|
|
@@ -1992,13 +2011,34 @@ var CliAdapterSessions = class extends CliAdapterProfile {
|
|
|
1992
2011
|
}
|
|
1993
2012
|
buildAssistantParts(state) {
|
|
1994
2013
|
const parts = [];
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2014
|
+
const reasoningParts = state.reasoningParts ?? [];
|
|
2015
|
+
let nextReasoning = 0;
|
|
2016
|
+
for (const reasoning of state.reasoningBuffer) {
|
|
2017
|
+
const at = reasoningParts.findIndex(({ text }, index) => index >= nextReasoning && text === reasoning);
|
|
2018
|
+
const id = reasoningParts[at]?.id;
|
|
2019
|
+
if (id) nextReasoning = at + 1;
|
|
2020
|
+
parts.push({
|
|
2021
|
+
key: id ? `reasoning:${id}` : void 0,
|
|
2022
|
+
part: {
|
|
2023
|
+
type: "reasoning",
|
|
2024
|
+
text: reasoning
|
|
2025
|
+
}
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
const streamedText = [...state.textParts ?? []].filter(([, text]) => text !== "");
|
|
2029
|
+
for (const [id, text] of streamedText) parts.push({
|
|
2030
|
+
key: `text:${id}`,
|
|
2031
|
+
part: {
|
|
2032
|
+
type: "text",
|
|
2033
|
+
text
|
|
2034
|
+
}
|
|
1998
2035
|
});
|
|
1999
|
-
if (state.textBuffer) parts.push({
|
|
2000
|
-
|
|
2001
|
-
|
|
2036
|
+
if (streamedText.length === 0 && state.textBuffer) parts.push({
|
|
2037
|
+
rank: Number.POSITIVE_INFINITY,
|
|
2038
|
+
part: {
|
|
2039
|
+
type: "text",
|
|
2040
|
+
text: state.textBuffer
|
|
2041
|
+
}
|
|
2002
2042
|
});
|
|
2003
2043
|
for (const toolCall of state.toolCalls.values()) {
|
|
2004
2044
|
const inputRecord = toolCall.input ?? {};
|
|
@@ -2022,20 +2062,33 @@ var CliAdapterSessions = class extends CliAdapterProfile {
|
|
|
2022
2062
|
input: inputRecord
|
|
2023
2063
|
};
|
|
2024
2064
|
parts.push({
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2065
|
+
key: `tool:${toolCall.id}`,
|
|
2066
|
+
part: {
|
|
2067
|
+
type: "tool",
|
|
2068
|
+
tool: toolCall.name,
|
|
2069
|
+
callID: toolCall.id,
|
|
2070
|
+
state: toolState
|
|
2071
|
+
}
|
|
2029
2072
|
});
|
|
2030
2073
|
}
|
|
2031
2074
|
for (const file of state.fileParts ?? []) parts.push({
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2075
|
+
key: `file:${file.id}`,
|
|
2076
|
+
part: {
|
|
2077
|
+
type: "file",
|
|
2078
|
+
id: file.id,
|
|
2079
|
+
filename: file.filename,
|
|
2080
|
+
mediaType: file.mediaType,
|
|
2081
|
+
url: file.url
|
|
2082
|
+
}
|
|
2037
2083
|
});
|
|
2038
|
-
|
|
2084
|
+
let rank = -1;
|
|
2085
|
+
return parts.map(({ key, part, rank: fixed }) => {
|
|
2086
|
+
rank = fixed ?? (key === void 0 ? void 0 : state.partOrder?.get(key)) ?? rank;
|
|
2087
|
+
return {
|
|
2088
|
+
part,
|
|
2089
|
+
rank
|
|
2090
|
+
};
|
|
2091
|
+
}).sort((a, b) => a.rank - b.rank).map(({ part }) => part);
|
|
2039
2092
|
}
|
|
2040
2093
|
extractToolInvocations(state) {
|
|
2041
2094
|
const invocations = [];
|
|
@@ -2890,6 +2943,25 @@ var TurnLiveness = class {
|
|
|
2890
2943
|
*/
|
|
2891
2944
|
const REPEATED_TOOL_FAILURE_LIMIT = 3;
|
|
2892
2945
|
/**
|
|
2946
|
+
* Records a streamed part on the turn: its rank, by the first
|
|
2947
|
+
* `message.part.updated` that names it, and a text part's latest text. The
|
|
2948
|
+
* stored reply replays both (buildAssistantParts), so it reads as the live
|
|
2949
|
+
* transcript did.
|
|
2950
|
+
*/
|
|
2951
|
+
function recordStreamedPart(state, event) {
|
|
2952
|
+
if (event.type !== "message.part.updated") return;
|
|
2953
|
+
const { part } = event;
|
|
2954
|
+
const id = part.id;
|
|
2955
|
+
if (!id) return;
|
|
2956
|
+
state.partOrder ??= /* @__PURE__ */ new Map();
|
|
2957
|
+
const key = `${part.type}:${id}`;
|
|
2958
|
+
if (!state.partOrder.has(key)) state.partOrder.set(key, state.partOrder.size);
|
|
2959
|
+
if (part.type === "text") {
|
|
2960
|
+
state.textParts ??= /* @__PURE__ */ new Map();
|
|
2961
|
+
state.textParts.set(id, part.text);
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2893
2965
|
* Observes one turn's provider stream: keeps the execution state current,
|
|
2894
2966
|
* persists parts and the provider session id as they arrive, stops a turn
|
|
2895
2967
|
* that repeats a rejected tool call, and pings while the stream is quiet.
|
|
@@ -2954,6 +3026,7 @@ var TurnObserver = class {
|
|
|
2954
3026
|
state.terminalStatus = event.status;
|
|
2955
3027
|
if (event.status === "failed" && event.detail) state.lastDiagnostic = event.detail;
|
|
2956
3028
|
}
|
|
3029
|
+
recordStreamedPart(state, event);
|
|
2957
3030
|
if (event.type === "message.part.updated" && recorder.recordAssistantPartUpdate) this.partUpdates.schedule(event.part, event.delta);
|
|
2958
3031
|
this.options.onEvent?.(event);
|
|
2959
3032
|
this.stopIfRequested();
|
|
@@ -3771,7 +3844,10 @@ var AcpProviderAdapterBase = class extends CliProviderAdapterBase {
|
|
|
3771
3844
|
timeoutMs: Math.min(timeoutMs, 12e4),
|
|
3772
3845
|
abortSignal: input.abortSignal,
|
|
3773
3846
|
onUpdate: (params) => {
|
|
3774
|
-
for (const event of this.mapAcpUpdate(params, state, sessionId))
|
|
3847
|
+
for (const event of this.mapAcpUpdate(params, state, sessionId)) {
|
|
3848
|
+
recordStreamedPart(state, event);
|
|
3849
|
+
onEvent?.(event);
|
|
3850
|
+
}
|
|
3775
3851
|
}
|
|
3776
3852
|
});
|
|
3777
3853
|
break;
|
|
@@ -4577,9 +4653,6 @@ function refuseSecretLaunch(reason, { path, expected, actual, exitCode } = {}) {
|
|
|
4577
4653
|
}
|
|
4578
4654
|
//#endregion
|
|
4579
4655
|
//#region src/secret-profile-mcp.ts
|
|
4580
|
-
/** Executor-held MCP credentials shared by native private-profile adapters. */
|
|
4581
|
-
const SECRET_REFERENCE_PREFIX = "TANGLE_PROFILE_SECRET_";
|
|
4582
|
-
const SECRET_REFERENCE = /\{env:(TANGLE_PROFILE_SECRET_[0-9A-F]{24})\}/g;
|
|
4583
4656
|
function requireRecord(raw, message) {
|
|
4584
4657
|
return isRecord(raw) ? raw : refuseSecretLaunch(message);
|
|
4585
4658
|
}
|
|
@@ -4779,6 +4852,6 @@ async function forgetSessionScopes(target) {
|
|
|
4779
4852
|
}
|
|
4780
4853
|
}
|
|
4781
4854
|
//#endregion
|
|
4782
|
-
export { enabledInteractionKinds as $, resolveRouterModelLimits as A,
|
|
4855
|
+
export { enabledInteractionKinds as $, resolveRouterModelLimits as A, finalTextEvent as At, jsonEventParser as B, ACP_PROTOCOL_VERSION as Bt, assertSealedNativeHome as C, EXECUTION_CORRELATION_HEADERS as Ct, resolveExecutableRealpath as D, executionCorrelationHeaders as Dt, refuseSecretLaunch as E, MANAGED_QUOTE_VERSION_HEADER as Et, TerminalPlanSupport as F, textSnapshotEvents as Ft, readCliTokenUsage as G, AcpProviderAdapterBase as H, assertAcpTurnFinished as Ht, DEFAULT_INTERACTION_MCP_SERVER_NAME as I, toolResultEvents as It, createRepeatedToolFailureGuard as J, recordCliTokenUsage as K, InteractionMcpServer$1 as L, toolStartEvents as Lt, kimiThinkingArgs as M, sessionObservedEvents as Mt, nativeEffortArgs as N, streamPartBase as Nt, ROUTER_MODEL_CATALOG_TIMEOUT_MS as O, homeXdgEnv as Ot, McpInteractionSupport as P, textDeltaEvents as Pt, localMcpEnv as Q, brokerInteractionTools$1 as R, trackReasoningBlock as Rt, SEALED_NATIVE_HOME_LAYOUT as S, runtimeSecretsOverlay as St, provenStoreBinary as T, EXECUTION_TRACE_HEADER as Tt, accumulateCliTokenUsage as U, spawnAcpBridge as Ut, plaintextResponseParser as V, acpContentText as Vt, parseCliUsageLine as W, isLocalMcpConfig as X, createExecutionState as Y, localMcpArgv as Z, secretSessionTurnQueue as _, InvalidAttachmentError as _t, SECRET_REFERENCE$1 as a, withTurnInteractions as at, untilSettledOrAborted as b, rejectNotLaunched as bt, forgetSessionScopes as c, PROMPT_SECTION_SEPARATOR as ct, directStdioMcpServers as d, prependPromptSection as dt, interactionToggleEnabled as et, isLoopbackEndpoint as f, buildFileUrl as ft, resolveReferences as g, trackFilePart as gt, requireRecord as h, inferMediaType as ht, PERMISSION_DECISION_TIMEOUT_MS as i, withEphemeralContext as it, resolveRouterModelReasoningEfforts as j, reasoningEvents as jt, findRouterCatalogEntry as k, mapAcpSessionUpdate as kt, secretMcpScope as l, partitionImageAttachments as lt, joinQueue as m, deterministicFilePartId as mt, InteractionBroker$1 as n, turnEndReason as nt, SECRET_REFERENCE_PREFIX as o, MAX_INLINE_IMAGE_BYTES as ot, isPlainRecord as p, deriveFilePart as pt, CliProviderAdapterBase as q, InteractionHttpBridge as r, turnInteractionEnabled as rt, codexDeveloperInstructionArgs as s, MAX_TOTAL_INLINE_IMAGE_BYTES as st, CODEX_DISABLED_FEATURE_ARGS as t, readEphemeralContext as tt, assertSealedNativeSearchPath as u, preparePromptInputParts as ut, servableMcpServer as v, SessionRehydrationError as vt, isTrustedStoreBinary as w, EXECUTION_ID_HEADER as wt, NATIVE_SESSION_CONTRACTS$1 as x, wasNeverLaunched as xt, servableStdioServer as y, failureAfterCleanup as yt, interactionMcpToolName as z, ACP_MIN_PROTOCOL_VERSION as zt };
|
|
4783
4856
|
|
|
4784
|
-
//# sourceMappingURL=src-
|
|
4857
|
+
//# sourceMappingURL=src-DG4Y1JhF.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sdk-provider-cli-base",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.100",
|
|
4
4
|
"description": "Base adapter for CLI-based AI agent providers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
61
61
|
"@tangle-network/agent-core": "^1.0.3",
|
|
62
62
|
"@tangle-network/agent-interface": "^5.10.23",
|
|
63
|
-
"@tangle-network/agent-profile-materialize": "1.1.
|
|
63
|
+
"@tangle-network/agent-profile-materialize": "1.1.120",
|
|
64
64
|
"@tangle-network/agent-trace-contract": "^2.2.0",
|
|
65
|
-
"@tangle-network/cli-agent-registry": "0.15.
|
|
65
|
+
"@tangle-network/cli-agent-registry": "0.15.96",
|
|
66
66
|
"@tangle-network/sdk-cli-runner": "0.3.12",
|
|
67
67
|
"@tangle-network/sdk-session-persistence": "0.7.12",
|
|
68
68
|
"zod": "4.6.7"
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"registry": "https://registry.npmjs.org"
|
|
80
80
|
},
|
|
81
81
|
"tangleRelease": {
|
|
82
|
-
"sourceSha": "
|
|
83
|
-
"mergedAt": "2026-11-
|
|
82
|
+
"sourceSha": "ab34bf1ff5768f8016d9dc772fd0e9cad38eb402",
|
|
83
|
+
"mergedAt": "2026-11-16T03:50:33-08:00"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "tsdown",
|