@tangle-network/sdk-provider-cli-base 0.13.211 → 0.13.213
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 +1 -1
- 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 +4 -3
- package/dist/adapters/openclaw/index.mjs +4 -3
- package/dist/adapters/prime/index.d.mts +1 -1
- package/dist/adapters/prime/index.mjs +1 -1
- package/dist/{index-yb6YAk69.d.mts → index-OkLCNcdk.d.mts} +27 -15
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{src-BvKseXkS.mjs → src-DPS1Iz0N.mjs} +137 -76
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as ExecutionState, Yt as CliProviderConfig, jt as CliProviderAdapterBase, qt as CliExecArgs } from "../../index-OkLCNcdk.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 localMcpEnv, Bt as reasoningEvents, Gt as toolResultEvents, Kt as toolStartEvents, M as CliProviderAdapterBase, T as jsonEventParser, Ut as textDeltaEvents, Vt as sessionObservedEvents, j as recordCliTokenUsage, z as localMcpArgv } from "../../src-DPS1Iz0N.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 { $t as ExecutionState, An as CliTurnSpawn, Yt as CliProviderConfig, jt as CliProviderAdapterBase, kn as CliTurnProcess, qt as CliExecArgs } from "../../index-OkLCNcdk.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 { E as plaintextResponseParser, Gt as toolResultEvents, Kt as toolStartEvents, M as CliProviderAdapterBase, Vt as sessionObservedEvents, j as recordCliTokenUsage } from "../../src-DPS1Iz0N.mjs";
|
|
2
2
|
import { normalizeOpenAiCompatibleBaseUrl, resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { statSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as ExecutionState, Yt as CliProviderConfig, jt as CliProviderAdapterBase, qt as CliExecArgs } from "../../index-OkLCNcdk.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 {
|
|
1
|
+
import { B as localMcpEnv, Bt as reasoningEvents, Gt as toolResultEvents, Ht as streamPartBase, Kt as toolStartEvents, M as CliProviderAdapterBase, R as isLocalMcpConfig, T as jsonEventParser, Ut as textDeltaEvents, V as enabledInteractionKinds, Vt as sessionObservedEvents, j as recordCliTokenUsage, q as withTurnInteractions, y as McpInteractionSupport, z as localMcpArgv } from "../../src-DPS1Iz0N.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 { $t as ExecutionState, Yt as CliProviderConfig, jt as CliProviderAdapterBase, qt as CliExecArgs } from "../../index-OkLCNcdk.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 { Bt as
|
|
1
|
+
import { Bt as reasoningEvents, Gt as toolResultEvents, Kt as toolStartEvents, M as CliProviderAdapterBase, T as jsonEventParser, Ut as textDeltaEvents, Vt as sessionObservedEvents, bt as prependPromptSection, j as recordCliTokenUsage } from "../../src-DPS1Iz0N.mjs";
|
|
2
2
|
import { isRecord } from "@tangle-network/agent-core";
|
|
3
3
|
//#region src/adapters/grok/adapter.ts
|
|
4
4
|
const DECLARE_MODEL = String.raw`d=$HOME/.grok; [ -z "$GROK_HOME" ] || d=$GROK_HOME
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as ExecutionState, Yt as CliProviderConfig, jt as CliProviderAdapterBase, n as HarnessId, qt as CliExecArgs } from "../../index-OkLCNcdk.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 {
|
|
1
|
+
import { B as localMcpEnv, E as plaintextResponseParser, Gt as toolResultEvents, Kt as toolStartEvents, M as CliProviderAdapterBase, R as isLocalMcpConfig, Ut as textDeltaEvents, Vt as sessionObservedEvents, Wt as textSnapshotEvents, bt as prependPromptSection, j as recordCliTokenUsage, vt as partitionImageAttachments, z as localMcpArgv, zt as finalTextEvent } from "../../src-DPS1Iz0N.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
4
4
|
import { writeFile } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as ExecutionState, Yt as CliProviderConfig, jt as CliProviderAdapterBase, n as HarnessId, qt as CliExecArgs } from "../../index-OkLCNcdk.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 { E as plaintextResponseParser, M as CliProviderAdapterBase, Vt as sessionObservedEvents, bt as prependPromptSection, j as recordCliTokenUsage, k as parseCliUsageLine } from "../../src-DPS1Iz0N.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 { $t as ExecutionState, An as CliTurnSpawn, Yt as CliProviderConfig, jt as CliProviderAdapterBase, kn as CliTurnProcess, qt as CliExecArgs } from "../../index-OkLCNcdk.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 { Gt as toolResultEvents, Kt as toolStartEvents, M as CliProviderAdapterBase, Ut as textDeltaEvents, Vt as sessionObservedEvents, bt as prependPromptSection, j as recordCliTokenUsage } from "../../src-DPS1Iz0N.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, relative } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as ExecutionState, An as CliTurnSpawn, Jt as CliExecutionInput, Yt as CliProviderConfig, c as WorkspacePlanApplication, jt as CliProviderAdapterBase, kn as CliTurnProcess, n as HarnessId, qt as CliExecArgs } from "../../index-OkLCNcdk.mjs";
|
|
2
2
|
import { StreamParserConfig } from "@tangle-network/sdk-cli-runner";
|
|
3
3
|
import { CliAuthFile, ProviderConfig, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
|
|
@@ -52,8 +52,9 @@ declare class OpenclawProviderAdapter extends CliProviderAdapterBase<OpenclawCon
|
|
|
52
52
|
* Reads the limits of each model that has none yet from the Router's
|
|
53
53
|
* catalog, with the key the turn's model calls carry. This runs before a
|
|
54
54
|
* turn, so it must not hold or fail one: resolveRouterModelLimits bounds the
|
|
55
|
-
* request, answers from
|
|
56
|
-
*
|
|
55
|
+
* request, answers from the catalog the process already read, asks again for
|
|
56
|
+
* a model that catalog does not name no sooner than its spacing, and does not
|
|
57
|
+
* repeat a failed read inside its stop.
|
|
57
58
|
*
|
|
58
59
|
* A model whose limits could not be read is declared without them, so until
|
|
59
60
|
* a later turn's read succeeds OpenClaw takes it to hold 128000 tokens and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as toolResultEvents, Kt as toolStartEvents, M as CliProviderAdapterBase, Ut as textDeltaEvents, Vt as sessionObservedEvents, Wt as textSnapshotEvents, bt as prependPromptSection, h as resolveRouterModelLimits, j as recordCliTokenUsage, v as nativeEffortArgs, zt as finalTextEvent } from "../../src-DPS1Iz0N.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { resolveTangleRouterDefaults } from "@tangle-network/agent-interface";
|
|
4
4
|
import { StringDecoder } from "node:string_decoder";
|
|
@@ -165,8 +165,9 @@ var OpenclawProviderAdapter = class extends CliProviderAdapterBase {
|
|
|
165
165
|
* Reads the limits of each model that has none yet from the Router's
|
|
166
166
|
* catalog, with the key the turn's model calls carry. This runs before a
|
|
167
167
|
* turn, so it must not hold or fail one: resolveRouterModelLimits bounds the
|
|
168
|
-
* request, answers from
|
|
169
|
-
*
|
|
168
|
+
* request, answers from the catalog the process already read, asks again for
|
|
169
|
+
* a model that catalog does not name no sooner than its spacing, and does not
|
|
170
|
+
* repeat a failed read inside its stop.
|
|
170
171
|
*
|
|
171
172
|
* A model whose limits could not be read is declared without them, so until
|
|
172
173
|
* a later turn's read succeeds OpenClaw takes it to hold 128000 tokens and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as AcpProviderAdapterBase, Lt as AcpBridgeConfig, Mn as AcpBridgeSpawn, Nn as AcpProcessSpec, Rt as AcpContentBlock, Wt as AcpTurn } from "../../index-OkLCNcdk.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 {
|
|
1
|
+
import { A as readCliTokenUsage, D as AcpProviderAdapterBase, Qt as spawnAcpBridge, bt as prependPromptSection } from "../../src-DPS1Iz0N.mjs";
|
|
2
2
|
import { PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VAR as PRIME_AGENT_DIR_ENV_VAR$1, 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";
|
|
@@ -1264,7 +1264,7 @@ type RouterModelLimitsResult = {
|
|
|
1264
1264
|
status: "unavailable";
|
|
1265
1265
|
reason: string;
|
|
1266
1266
|
};
|
|
1267
|
-
/**
|
|
1267
|
+
/** How long one catalog request may take; a slow gateway must not hold the turn. */
|
|
1268
1268
|
declare const ROUTER_MODEL_CATALOG_TIMEOUT_MS = 5000;
|
|
1269
1269
|
interface ResolveRouterModelLimitsInput {
|
|
1270
1270
|
/** OpenAI-compatible root, including `/v1`. */
|
|
@@ -1275,26 +1275,38 @@ interface ResolveRouterModelLimitsInput {
|
|
|
1275
1275
|
catalogAlias?: string;
|
|
1276
1276
|
/** The backend's model credential. Sent as a bearer token; a sandbox's egress proxy requires it. */
|
|
1277
1277
|
apiKey?: string;
|
|
1278
|
-
|
|
1279
|
-
timeoutMs?: number;
|
|
1280
|
-
/** Opt in to sharing a successful catalog for this credential and deployment revision. */
|
|
1278
|
+
/** A deployment revision. Callers naming different revisions keep separate catalogs; the rest share one. */
|
|
1281
1279
|
cacheRevision?: string;
|
|
1282
1280
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
context_length?: unknown;
|
|
1287
|
-
max_completion_tokens?: unknown;
|
|
1288
|
-
max_completion_tokens_source?: unknown;
|
|
1289
|
-
max_completion_tokens_verified?: unknown;
|
|
1290
|
-
reasoning_effort_values?: unknown;
|
|
1291
|
-
}
|
|
1281
|
+
/** The entry fields this module reads. A kept catalog holds these and nothing else of the list. */
|
|
1282
|
+
declare const CATALOG_FIELDS: readonly ["id", "_provider", "context_length", "max_completion_tokens", "max_completion_tokens_source", "max_completion_tokens_verified", "reasoning_effort_values"];
|
|
1283
|
+
type CatalogEntry = Partial<Record<(typeof CATALOG_FIELDS)[number], unknown>>;
|
|
1292
1284
|
/**
|
|
1293
1285
|
* The catalog names a model two ways: some ids are already provider-qualified, and the rest are
|
|
1294
1286
|
* bare with the vendor in `_provider` (the Tangle Router lists `glm-5.3` with `_provider: "zai"`
|
|
1295
1287
|
* while requests name `zai/glm-5.3`). An exact id wins so a qualified id is never shadowed.
|
|
1296
1288
|
*/
|
|
1297
1289
|
declare function findRouterCatalogEntry(entries: readonly unknown[], model: string): CatalogEntry | undefined;
|
|
1290
|
+
/**
|
|
1291
|
+
* How long the list a process read answers for the models it names. It is also the floor: no
|
|
1292
|
+
* response header shortens it and none lengthens it, because `cache-control` and `expires` are
|
|
1293
|
+
* not read. The production Router marks this list, about 63 KB gzipped, `no-store`, and a
|
|
1294
|
+
* helper that obeys the mark asks for the whole list on every call from every box; on
|
|
1295
|
+
* 2026-11-24 a benchmark starting many boxes made the Router's replicas miss health checks.
|
|
1296
|
+
* One lifetime covers a box start and the turns after it with one request, and it bounds how
|
|
1297
|
+
* long a running box keeps a limit the Router has since corrected. After it the list is asked
|
|
1298
|
+
* for again, with the validator the gateway gave, so an unchanged list costs a 304 and no body.
|
|
1299
|
+
*/
|
|
1300
|
+
declare const ROUTER_MODEL_CATALOG_LIFETIME_MS: number;
|
|
1301
|
+
/**
|
|
1302
|
+
* A lookup for a model the kept list does not name asks for the list again, because the Router
|
|
1303
|
+
* may have added the model since the read, but no sooner than this after that catalog's last
|
|
1304
|
+
* request. A box that keeps looking up a model no list names therefore costs the gateway at
|
|
1305
|
+
* most one request per spacing, and a conditional one once the gateway sends a validator.
|
|
1306
|
+
*/
|
|
1307
|
+
declare const ROUTER_MODEL_CATALOG_MISS_REREAD_MS = 60000;
|
|
1308
|
+
/** A failed read is not repeated for this long, so no turn waits on a failing catalog twice. */
|
|
1309
|
+
declare const ROUTER_MODEL_CATALOG_FAILURE_STOP_MS = 60000;
|
|
1298
1310
|
/** The model's listed `reasoning_effort_values`, trimmed and lowercased, or why the catalog was unreadable. */
|
|
1299
1311
|
declare function resolveRouterModelReasoningEfforts(input: ResolveRouterModelLimitsInput): Promise<string[] | string>;
|
|
1300
1312
|
declare function resolveRouterModelLimits(input: ResolveRouterModelLimitsInput): Promise<RouterModelLimitsResult>;
|
|
@@ -1468,5 +1480,5 @@ declare function homeXdgEnv(home: string): {
|
|
|
1468
1480
|
XDG_STATE_HOME: string;
|
|
1469
1481
|
};
|
|
1470
1482
|
//#endregion
|
|
1471
|
-
export {
|
|
1472
|
-
//# sourceMappingURL=index-
|
|
1483
|
+
export { localMcpArgv as $, ExecutionState as $t, refuseSecretLaunch as A, CliTurnSpawn as An, AcpProviderAdapterBase as At, resolveRouterModelLimits as B, AcpInitializeResult as Bt, forgetSessionScopes as C, secretSessionTurnQueue as Cn, plaintextResponseParser as Ct, assertSealedNativeHome as D, spawnUnderSecretMcpLease as Dn, rejectNotLaunched as Dt, SEALED_NATIVE_HOME_LAYOUT as E, sharedSecretMcpRefused as En, failureAfterCleanup as Et, ROUTER_MODEL_CATALOG_TIMEOUT_MS as F, ACP_MIN_PROTOCOL_VERSION as Ft, trackReasoningBlock as G, acpContentText as Gt, RepeatedToolFailure as H, AcpPromptResult as Ht, ResolveRouterModelLimitsInput as I, ACP_PROTOCOL_VERSION as It, accumulateCliTokenUsage as J, CliExecutionInput as Jt, kimiThinkingArgs as K, assertAcpTurnFinished as Kt, RouterModelLimits as L, AcpBridgeConfig as Lt, ROUTER_MODEL_CATALOG_FAILURE_STOP_MS as M, AcpBridgeSpawn as Mn, runtimeSecretsOverlay as Mt, ROUTER_MODEL_CATALOG_LIFETIME_MS as N, AcpProcessSpec as Nn, createExecutionState as Nt, isTrustedStoreBinary as O, untilSettledOrAborted as On, wasNeverLaunched as Ot, ROUTER_MODEL_CATALOG_MISS_REREAD_MS as P, spawnAcpBridge as Pn, TurnObserver as Pt, isLocalMcpConfig as Q, EphemeralContextInput as Qt, RouterModelLimitsResult as R, AcpContentBlock as Rt, toolStartEvents as S, resolveReferences as Sn, jsonEventParser as St, NATIVE_SESSION_CONTRACTS$1 as T, servableStdioServer as Tn, SessionRehydrationError as Tt, RepeatedToolFailureGuardOptions as U, AcpSessionUpdateParams as Ut, resolveRouterModelReasoningEfforts as V, AcpNewSessionResult as Vt, createRepeatedToolFailureGuard as W, AcpTurn as Wt, readCliTokenUsage as X, CliProviderLogger as Xt, parseCliUsageLine as Y, CliProviderConfig as Yt, recordCliTokenUsage as Z, CliProviderOptions as Zt, sessionObservedEvents as _, directStdioMcpServers as _n, EXECUTION_ID_HEADER as _t, PERMISSION_DECISION_TIMEOUT_MS as a, enabledInteractionKinds as an, InteractionMcpServerConfig$1 as at, textSnapshotEvents as b, joinQueue as bn, executionCorrelationHeaders as bt, WorkspacePlanApplication$1 as c, turnEndReason as cn, RequestPlanBridge as ct, endFailedTurn as d, withTurnInteractions as dn, buildFileUrl as dt, InteractionToggleConfig as en, localMcpEnv as et, recordTurnInterruption as f, SHARED_WORKSPACE_DIR_ENV as fn, deriveFilePart as ft, reasoningEvents as g, assertSealedNativeSearchPath as gn, EXECUTION_CORRELATION_HEADERS as gt, finalTextEvent as h, SecretProfileMcpServer as hn, trackFilePart as ht, InteractionHttpBridge as i, TurnEndReason as in, InteractionMcpServer$1 as it, resolveExecutableRealpath as j, PreparedCliLaunch as jn, CliProviderAdapterBase as jt, provenStoreBinary as k, CliTurnProcess as kn, mapAcpSessionUpdate as kt, codexDeveloperInstructionArgs as l, turnInteractionEnabled as ln, brokerInteractionTools$1 as lt, TerminalPlanSupportOptions as m, SecretProfileMcpLease as mn, inferMediaType as mt, HarnessId$1 as n, PerTurnInteractionInput as nn, AskUserBridge as nt, SECRET_REFERENCE$1 as o, interactionToggleEnabled as on, PermissionPromptBridge as ot, TerminalPlanSupport as p, SecretProfileMcpCredentialProxy as pn, deterministicFilePartId as pt, nativeEffortArgs as q, CliExecArgs as qt, InteractionBroker$1 as r, ToolCallState as rn, DEFAULT_INTERACTION_MCP_SERVER_NAME as rt, SECRET_REFERENCE_PREFIX$1 as s, readEphemeralContext as sn, RequestPermissionBridge as st, CODEX_DISABLED_FEATURE_ARGS as t, InteractionToggleKind as tn, McpInteractionSupport as tt, homeXdgEnv as u, withEphemeralContext as un, interactionMcpToolName as ut, streamPartBase as v, isLoopbackEndpoint as vn, EXECUTION_TRACE_HEADER as vt, secretMcpScope as w, servableMcpServer as wn, InvalidAttachmentError as wt, toolResultEvents as x, requireRecord as xn, PlaintextResponse as xt, textDeltaEvents as y, isPlainRecord as yn, MANAGED_QUOTE_VERSION_HEADER as yt, findRouterCatalogEntry as z, AcpInitializeParams as zt };
|
|
1484
|
+
//# sourceMappingURL=index-OkLCNcdk.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as localMcpArgv, $t as ExecutionState, A as refuseSecretLaunch, An as CliTurnSpawn, At as AcpProviderAdapterBase, B as resolveRouterModelLimits, Bt as AcpInitializeResult, C as forgetSessionScopes, Cn as secretSessionTurnQueue, Ct as plaintextResponseParser, D as assertSealedNativeHome, Dn as spawnUnderSecretMcpLease, Dt as rejectNotLaunched, E as SEALED_NATIVE_HOME_LAYOUT, En as sharedSecretMcpRefused, Et as failureAfterCleanup, F as ROUTER_MODEL_CATALOG_TIMEOUT_MS, Ft as ACP_MIN_PROTOCOL_VERSION, G as trackReasoningBlock, Gt as acpContentText, H as RepeatedToolFailure, Ht as AcpPromptResult, I as ResolveRouterModelLimitsInput, It as ACP_PROTOCOL_VERSION, J as accumulateCliTokenUsage, Jt as CliExecutionInput, K as kimiThinkingArgs, Kt as assertAcpTurnFinished, L as RouterModelLimits, Lt as AcpBridgeConfig, M as ROUTER_MODEL_CATALOG_FAILURE_STOP_MS, Mn as AcpBridgeSpawn, Mt as runtimeSecretsOverlay, N as ROUTER_MODEL_CATALOG_LIFETIME_MS, Nn as AcpProcessSpec, Nt as createExecutionState, O as isTrustedStoreBinary, On as untilSettledOrAborted, Ot as wasNeverLaunched, P as ROUTER_MODEL_CATALOG_MISS_REREAD_MS, Pn as spawnAcpBridge, Pt as TurnObserver, Q as isLocalMcpConfig, Qt as EphemeralContextInput, R as RouterModelLimitsResult, Rt as AcpContentBlock, S as toolStartEvents, Sn as resolveReferences, St as jsonEventParser, T as NATIVE_SESSION_CONTRACTS, Tn as servableStdioServer, Tt as SessionRehydrationError, U as RepeatedToolFailureGuardOptions, Ut as AcpSessionUpdateParams, V as resolveRouterModelReasoningEfforts, Vt as AcpNewSessionResult, W as createRepeatedToolFailureGuard, Wt as AcpTurn, X as readCliTokenUsage, Xt as CliProviderLogger, Y as parseCliUsageLine, Yt as CliProviderConfig, Z as recordCliTokenUsage, Zt as CliProviderOptions, _ as sessionObservedEvents, _n as directStdioMcpServers, _t as EXECUTION_ID_HEADER, a as PERMISSION_DECISION_TIMEOUT_MS, an as enabledInteractionKinds, at as InteractionMcpServerConfig, b as textSnapshotEvents, bn as joinQueue, bt as executionCorrelationHeaders, c as WorkspacePlanApplication, cn as turnEndReason, ct as RequestPlanBridge, d as endFailedTurn, dn as withTurnInteractions, dt as buildFileUrl, en as InteractionToggleConfig, et as localMcpEnv, f as recordTurnInterruption, fn as SHARED_WORKSPACE_DIR_ENV, ft as deriveFilePart, g as reasoningEvents, gn as assertSealedNativeSearchPath, gt as EXECUTION_CORRELATION_HEADERS, h as finalTextEvent, hn as SecretProfileMcpServer, ht as trackFilePart, i as InteractionHttpBridge, in as TurnEndReason, it as InteractionMcpServer, j as resolveExecutableRealpath, jn as PreparedCliLaunch, jt as CliProviderAdapterBase, k as provenStoreBinary, kn as CliTurnProcess, kt as mapAcpSessionUpdate, l as codexDeveloperInstructionArgs, ln as turnInteractionEnabled, lt as brokerInteractionTools, m as TerminalPlanSupportOptions, mn as SecretProfileMcpLease, mt as inferMediaType, n as HarnessId, nn as PerTurnInteractionInput, nt as AskUserBridge, o as SECRET_REFERENCE, on as interactionToggleEnabled, ot as PermissionPromptBridge, p as TerminalPlanSupport, pn as SecretProfileMcpCredentialProxy, pt as deterministicFilePartId, q as nativeEffortArgs, qt as CliExecArgs, r as InteractionBroker, rn as ToolCallState, rt as DEFAULT_INTERACTION_MCP_SERVER_NAME, s as SECRET_REFERENCE_PREFIX, sn as readEphemeralContext, st as RequestPermissionBridge, t as CODEX_DISABLED_FEATURE_ARGS, tn as InteractionToggleKind, tt as McpInteractionSupport, u as homeXdgEnv, un as withEphemeralContext, ut as interactionMcpToolName, v as streamPartBase, vn as isLoopbackEndpoint, vt as EXECUTION_TRACE_HEADER, w as secretMcpScope, wn as servableMcpServer, wt as InvalidAttachmentError, x as toolResultEvents, xn as requireRecord, xt as PlaintextResponse, y as textDeltaEvents, yn as isPlainRecord, yt as MANAGED_QUOTE_VERSION_HEADER, z as findRouterCatalogEntry, zt as AcpInitializeParams } from "./index-OkLCNcdk.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, SHARED_WORKSPACE_DIR_ENV, SecretProfileMcpCredentialProxy, SecretProfileMcpLease, SecretProfileMcpServer, SessionRehydrationError, TerminalPlanSupport, TerminalPlanSupportOptions, ToolCallState, TurnEndReason, TurnObserver, WorkspacePlanApplication, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, endFailedTurn, 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, recordTurnInterruption, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, sharedSecretMcpRefused, spawnAcpBridge, spawnUnderSecretMcpLease, 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_FAILURE_STOP_MS, ROUTER_MODEL_CATALOG_LIFETIME_MS, ROUTER_MODEL_CATALOG_MISS_REREAD_MS, ROUTER_MODEL_CATALOG_TIMEOUT_MS, RepeatedToolFailure, RepeatedToolFailureGuardOptions, RequestPermissionBridge, RequestPlanBridge, ResolveRouterModelLimitsInput, RouterModelLimits, RouterModelLimitsResult, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SHARED_WORKSPACE_DIR_ENV, SecretProfileMcpCredentialProxy, SecretProfileMcpLease, SecretProfileMcpServer, SessionRehydrationError, TerminalPlanSupport, TerminalPlanSupportOptions, ToolCallState, TurnEndReason, TurnObserver, WorkspacePlanApplication, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, endFailedTurn, 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, recordTurnInterruption, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, sharedSecretMcpRefused, spawnAcpBridge, spawnUnderSecretMcpLease, 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
|
|
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, SHARED_WORKSPACE_DIR_ENV, SessionRehydrationError, TerminalPlanSupport, TurnObserver, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, endFailedTurn, 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, recordTurnInterruption, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, sharedSecretMcpRefused, spawnAcpBridge, spawnUnderSecretMcpLease, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
|
1
|
+
import { $ as joinQueue, A as readCliTokenUsage, At as wasNeverLaunched, B as localMcpEnv, Bt as reasoningEvents, C as brokerInteractionTools, Ct as deterministicFilePartId, D as AcpProviderAdapterBase, Dt as SessionRehydrationError, E as plaintextResponseParser, Et as InvalidAttachmentError, F as endFailedTurn, Ft as MANAGED_QUOTE_VERSION_HEADER, G as turnInteractionEnabled, Gt as toolResultEvents, H as interactionToggleEnabled, Ht as streamPartBase, I as recordTurnInterruption, It as executionCorrelationHeaders, J as SHARED_WORKSPACE_DIR_ENV, Jt as ACP_MIN_PROTOCOL_VERSION, K as withEphemeralContext, Kt as toolStartEvents, L as createExecutionState, Lt as homeXdgEnv, M as CliProviderAdapterBase, Mt as EXECUTION_CORRELATION_HEADERS, N as TurnObserver, Nt as EXECUTION_ID_HEADER, O as accumulateCliTokenUsage, Ot as failureAfterCleanup, P as createRepeatedToolFailureGuard, Pt as EXECUTION_TRACE_HEADER, Q as isPlainRecord, Qt as spawnAcpBridge, R as isLocalMcpConfig, Rt as mapAcpSessionUpdate, S as InteractionMcpServer, St as deriveFilePart, T as jsonEventParser, Tt as trackFilePart, U as readEphemeralContext, Ut as textDeltaEvents, V as enabledInteractionKinds, Vt as sessionObservedEvents, W as turnEndReason, Wt as textSnapshotEvents, X as directStdioMcpServers, Xt as acpContentText, Y as assertSealedNativeSearchPath, Yt as ACP_PROTOCOL_VERSION, Z as isLoopbackEndpoint, Zt as assertAcpTurnFinished, _ as kimiThinkingArgs, _t as PROMPT_SECTION_SEPARATOR, a as SECRET_REFERENCE, at as sharedSecretMcpRefused, b as TerminalPlanSupport, bt as prependPromptSection, c as forgetSessionScopes, ct as NATIVE_SESSION_CONTRACTS, d as ROUTER_MODEL_CATALOG_LIFETIME_MS, dt as isTrustedStoreBinary, et as requireRecord, f as ROUTER_MODEL_CATALOG_MISS_REREAD_MS, ft as provenStoreBinary, g as resolveRouterModelReasoningEfforts, gt as MAX_TOTAL_INLINE_IMAGE_BYTES, h as resolveRouterModelLimits, ht as MAX_INLINE_IMAGE_BYTES, i as PERMISSION_DECISION_TIMEOUT_MS, it as servableStdioServer, j as recordCliTokenUsage, jt as runtimeSecretsOverlay, k as parseCliUsageLine, kt as rejectNotLaunched, l as secretMcpScope, lt as SEALED_NATIVE_HOME_LAYOUT, m as findRouterCatalogEntry, mt as resolveExecutableRealpath, n as InteractionBroker, nt as secretSessionTurnQueue, o as SECRET_REFERENCE_PREFIX, ot as spawnUnderSecretMcpLease, p as ROUTER_MODEL_CATALOG_TIMEOUT_MS, pt as refuseSecretLaunch, q as withTurnInteractions, qt as trackReasoningBlock, r as InteractionHttpBridge, rt as servableMcpServer, s as codexDeveloperInstructionArgs, st as untilSettledOrAborted, t as CODEX_DISABLED_FEATURE_ARGS, tt as resolveReferences, u as ROUTER_MODEL_CATALOG_FAILURE_STOP_MS, ut as assertSealedNativeHome, v as nativeEffortArgs, vt as partitionImageAttachments, w as interactionMcpToolName, wt as inferMediaType, x as DEFAULT_INTERACTION_MCP_SERVER_NAME, xt as buildFileUrl, y as McpInteractionSupport, yt as preparePromptInputParts, z as localMcpArgv, zt as finalTextEvent } from "./src-DPS1Iz0N.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_FAILURE_STOP_MS, ROUTER_MODEL_CATALOG_LIFETIME_MS, ROUTER_MODEL_CATALOG_MISS_REREAD_MS, ROUTER_MODEL_CATALOG_TIMEOUT_MS, SEALED_NATIVE_HOME_LAYOUT, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SHARED_WORKSPACE_DIR_ENV, SessionRehydrationError, TerminalPlanSupport, TurnObserver, accumulateCliTokenUsage, acpContentText, assertAcpTurnFinished, assertSealedNativeHome, assertSealedNativeSearchPath, brokerInteractionTools, buildFileUrl, codexDeveloperInstructionArgs, createExecutionState, createRepeatedToolFailureGuard, deriveFilePart, deterministicFilePartId, directStdioMcpServers, enabledInteractionKinds, endFailedTurn, 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, recordTurnInterruption, refuseSecretLaunch, rejectNotLaunched, requireRecord, resolveExecutableRealpath, resolveReferences, resolveRouterModelLimits, resolveRouterModelReasoningEfforts, runtimeSecretsOverlay, secretMcpScope, secretSessionTurnQueue, servableMcpServer, servableStdioServer, sessionObservedEvents, sharedSecretMcpRefused, spawnAcpBridge, spawnUnderSecretMcpLease, streamPartBase, textDeltaEvents, textSnapshotEvents, toolResultEvents, toolStartEvents, trackFilePart, trackReasoningBlock, turnEndReason, turnInteractionEnabled, untilSettledOrAborted, wasNeverLaunched, withEphemeralContext, withTurnInteractions };
|
|
@@ -4876,8 +4876,18 @@ function kimiThinkingArgs(level, modelId) {
|
|
|
4876
4876
|
}
|
|
4877
4877
|
//#endregion
|
|
4878
4878
|
//#region src/router-model-limits.ts
|
|
4879
|
-
/**
|
|
4879
|
+
/** How long one catalog request may take; a slow gateway must not hold the turn. */
|
|
4880
4880
|
const ROUTER_MODEL_CATALOG_TIMEOUT_MS = 5e3;
|
|
4881
|
+
/** The entry fields this module reads. A kept catalog holds these and nothing else of the list. */
|
|
4882
|
+
const CATALOG_FIELDS = [
|
|
4883
|
+
"id",
|
|
4884
|
+
"_provider",
|
|
4885
|
+
"context_length",
|
|
4886
|
+
"max_completion_tokens",
|
|
4887
|
+
"max_completion_tokens_source",
|
|
4888
|
+
"max_completion_tokens_verified",
|
|
4889
|
+
"reasoning_effort_values"
|
|
4890
|
+
];
|
|
4881
4891
|
function isPositiveInteger(value) {
|
|
4882
4892
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
4883
4893
|
}
|
|
@@ -4892,103 +4902,154 @@ function findRouterCatalogEntry(entries, model) {
|
|
|
4892
4902
|
if (exact) return exact;
|
|
4893
4903
|
return candidates.find((entry) => typeof entry.id === "string" && typeof entry._provider === "string" && `${entry._provider}/${entry.id}` === model);
|
|
4894
4904
|
}
|
|
4895
|
-
/**
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4905
|
+
/**
|
|
4906
|
+
* How long the list a process read answers for the models it names. It is also the floor: no
|
|
4907
|
+
* response header shortens it and none lengthens it, because `cache-control` and `expires` are
|
|
4908
|
+
* not read. The production Router marks this list, about 63 KB gzipped, `no-store`, and a
|
|
4909
|
+
* helper that obeys the mark asks for the whole list on every call from every box; on
|
|
4910
|
+
* 2026-11-24 a benchmark starting many boxes made the Router's replicas miss health checks.
|
|
4911
|
+
* One lifetime covers a box start and the turns after it with one request, and it bounds how
|
|
4912
|
+
* long a running box keeps a limit the Router has since corrected. After it the list is asked
|
|
4913
|
+
* for again, with the validator the gateway gave, so an unchanged list costs a 304 and no body.
|
|
4914
|
+
*/
|
|
4915
|
+
const ROUTER_MODEL_CATALOG_LIFETIME_MS = 60 * 6e4;
|
|
4916
|
+
/**
|
|
4917
|
+
* A lookup for a model the kept list does not name asks for the list again, because the Router
|
|
4918
|
+
* may have added the model since the read, but no sooner than this after that catalog's last
|
|
4919
|
+
* request. A box that keeps looking up a model no list names therefore costs the gateway at
|
|
4920
|
+
* most one request per spacing, and a conditional one once the gateway sends a validator.
|
|
4921
|
+
*/
|
|
4922
|
+
const ROUTER_MODEL_CATALOG_MISS_REREAD_MS = 6e4;
|
|
4923
|
+
/** A failed read is not repeated for this long, so no turn waits on a failing catalog twice. */
|
|
4924
|
+
const ROUTER_MODEL_CATALOG_FAILURE_STOP_MS = 6e4;
|
|
4925
|
+
/** A box reads with one or two credentials; the bound stops a caller that varies them from growing the map. */
|
|
4926
|
+
const MAX_KEPT_CATALOGS = 32;
|
|
4899
4927
|
const catalogs = /* @__PURE__ */ new Map();
|
|
4928
|
+
/** An unreachable or failing (5xx) endpoint answers no credential, so its stop covers them all. */
|
|
4929
|
+
const endpointStops = /* @__PURE__ */ new Map();
|
|
4900
4930
|
function digest(value) {
|
|
4901
4931
|
return createHash("sha256").update(value).digest("hex");
|
|
4902
4932
|
}
|
|
4903
|
-
function
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4933
|
+
function catalogUrl(baseUrl) {
|
|
4934
|
+
try {
|
|
4935
|
+
const url = new URL(baseUrl);
|
|
4936
|
+
url.pathname = `${url.pathname.replace(/\/+$/, "")}/models`;
|
|
4937
|
+
url.hash = "";
|
|
4938
|
+
return url.href;
|
|
4939
|
+
} catch {
|
|
4940
|
+
return `${baseUrl.replace(/\/+$/, "")}/models`;
|
|
4941
|
+
}
|
|
4942
|
+
}
|
|
4943
|
+
function keptEntries(data) {
|
|
4944
|
+
return data.filter((entry) => typeof entry === "object" && entry !== null).map((entry) => {
|
|
4945
|
+
const kept = {};
|
|
4946
|
+
for (const field of CATALOG_FIELDS) kept[field] = entry[field];
|
|
4947
|
+
return kept;
|
|
4907
4948
|
});
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
function
|
|
4911
|
-
const control = headers.get("cache-control") ?? "";
|
|
4912
|
-
if (/(?:^|,)\s*(?:no-cache|no-store)\s*(?:=|,|$)/i.test(control)) return 0;
|
|
4913
|
-
const maxAge = /(?:^|,)\s*max-age\s*=\s*"?(\d+)"?\s*(?:,|$)/i.exec(control);
|
|
4914
|
-
const date = Date.parse(headers.get("date") ?? "");
|
|
4915
|
-
const expires = Date.parse(headers.get("expires") ?? "");
|
|
4916
|
-
const now = Date.now();
|
|
4917
|
-
const ageMs = Math.max(0, Number(headers.get("age")) || 0) * 1e3;
|
|
4918
|
-
const lifetime = maxAge ? Number(maxAge[1]) * 1e3 : Number.isFinite(expires) ? expires - (Number.isFinite(date) ? date : now) : CATALOG_FRESHNESS_MS;
|
|
4919
|
-
const currentAge = Math.max(ageMs, Number.isFinite(date) ? now - date : 0);
|
|
4920
|
-
return now + Math.min(CATALOG_FRESHNESS_MS, lifetime) - currentAge;
|
|
4921
|
-
}
|
|
4922
|
-
async function fetchCatalog(input, url) {
|
|
4923
|
-
const endpoint = digest(input.baseUrl);
|
|
4924
|
-
const failed = catalogFailures.get(endpoint);
|
|
4925
|
-
if (failed) {
|
|
4926
|
-
if (Date.now() - failed.at < 6e4) return failed.reason;
|
|
4927
|
-
catalogFailures.delete(endpoint);
|
|
4928
|
-
}
|
|
4929
|
-
const fetchImpl = input.fetchImpl ?? fetch;
|
|
4949
|
+
}
|
|
4950
|
+
/** One request, never retried: the list, or why there is none and whether the endpoint is at fault. */
|
|
4951
|
+
async function requestCatalog(url, apiKey, held) {
|
|
4930
4952
|
try {
|
|
4931
|
-
const
|
|
4932
|
-
const response = await fetchImpl(url, {
|
|
4953
|
+
const response = await fetch(url, {
|
|
4933
4954
|
headers: {
|
|
4934
4955
|
accept: "application/json",
|
|
4935
|
-
...apiKey ? { authorization: `Bearer ${apiKey}` } : {}
|
|
4956
|
+
...apiKey ? { authorization: `Bearer ${apiKey}` } : {},
|
|
4957
|
+
...held?.etag ? { "if-none-match": held.etag } : {}
|
|
4936
4958
|
},
|
|
4937
|
-
signal: AbortSignal.timeout(
|
|
4959
|
+
signal: AbortSignal.timeout(ROUTER_MODEL_CATALOG_TIMEOUT_MS)
|
|
4938
4960
|
});
|
|
4939
|
-
|
|
4940
|
-
if (!response.ok) return
|
|
4961
|
+
if (response.status === 304 && held?.etag) return held;
|
|
4962
|
+
if (!response.ok) return {
|
|
4963
|
+
failed: `model catalog returned HTTP ${response.status}`,
|
|
4964
|
+
endpoint: response.status >= 500
|
|
4965
|
+
};
|
|
4941
4966
|
const body = await response.json();
|
|
4942
|
-
if (typeof body !== "object" || body === null || !("data" in body) || !Array.isArray(body.data)) return
|
|
4967
|
+
if (typeof body !== "object" || body === null || !("data" in body) || !Array.isArray(body.data)) return {
|
|
4968
|
+
failed: "model catalog has no data array",
|
|
4969
|
+
endpoint: false
|
|
4970
|
+
};
|
|
4971
|
+
const etag = response.headers.get("etag");
|
|
4943
4972
|
return {
|
|
4944
|
-
entries: body.data,
|
|
4945
|
-
|
|
4973
|
+
entries: keptEntries(body.data),
|
|
4974
|
+
...etag ? { etag } : {}
|
|
4946
4975
|
};
|
|
4947
4976
|
} catch (error) {
|
|
4948
|
-
return
|
|
4977
|
+
return {
|
|
4978
|
+
failed: `model catalog request failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
4979
|
+
endpoint: true
|
|
4980
|
+
};
|
|
4949
4981
|
}
|
|
4950
4982
|
}
|
|
4951
|
-
async function
|
|
4952
|
-
const
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4983
|
+
async function refreshCatalog(catalog, url, apiKey) {
|
|
4984
|
+
const asked = Date.now();
|
|
4985
|
+
const answer = await requestCatalog(url, apiKey, catalog.list);
|
|
4986
|
+
const now = Date.now();
|
|
4987
|
+
if ("failed" in answer) {
|
|
4988
|
+
catalog.quiet = now + ROUTER_MODEL_CATALOG_FAILURE_STOP_MS;
|
|
4989
|
+
if (answer.endpoint) {
|
|
4990
|
+
for (const [stopped, { until }] of endpointStops) if (until <= now) endpointStops.delete(stopped);
|
|
4991
|
+
endpointStops.set(url, {
|
|
4992
|
+
until: catalog.quiet,
|
|
4993
|
+
reason: answer.failed
|
|
4994
|
+
});
|
|
4995
|
+
}
|
|
4996
|
+
return catalog.list?.entries ?? answer.failed;
|
|
4959
4997
|
}
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4998
|
+
endpointStops.delete(url);
|
|
4999
|
+
catalog.list = answer;
|
|
5000
|
+
catalog.fresh = now + ROUTER_MODEL_CATALOG_LIFETIME_MS;
|
|
5001
|
+
catalog.quiet = asked + ROUTER_MODEL_CATALOG_MISS_REREAD_MS;
|
|
5002
|
+
return answer.entries;
|
|
5003
|
+
}
|
|
5004
|
+
/**
|
|
5005
|
+
* The read that answers a lookup the kept list cannot: the request in flight, the last one
|
|
5006
|
+
* while none may be sent, or a new one. Callers that arrive together share it. A failure is
|
|
5007
|
+
* remembered for its stop: a 4xx for the credential it answered, an unreachable or failing
|
|
5008
|
+
* endpoint for every credential.
|
|
5009
|
+
*/
|
|
5010
|
+
function readCatalog(key, url, apiKey) {
|
|
5011
|
+
const now = Date.now();
|
|
5012
|
+
const kept = catalogs.get(key);
|
|
5013
|
+
if (kept && kept.quiet > now) return kept.read;
|
|
5014
|
+
const stopped = endpointStops.get(url);
|
|
5015
|
+
if (stopped && stopped.until > now) return Promise.resolve(kept?.list?.entries ?? stopped.reason);
|
|
5016
|
+
for (const [other, { quiet, list }] of catalogs) if (quiet <= now && !list) catalogs.delete(other);
|
|
4969
5017
|
catalogs.delete(key);
|
|
4970
|
-
if (catalogs.size >=
|
|
5018
|
+
if (catalogs.size >= MAX_KEPT_CATALOGS) {
|
|
4971
5019
|
const oldest = catalogs.keys().next();
|
|
4972
5020
|
if (!oldest.done) catalogs.delete(oldest.value);
|
|
4973
5021
|
}
|
|
4974
|
-
const
|
|
4975
|
-
|
|
4976
|
-
|
|
5022
|
+
const next = {
|
|
5023
|
+
quiet: Number.POSITIVE_INFINITY,
|
|
5024
|
+
list: kept?.list,
|
|
5025
|
+
fresh: kept?.fresh ?? 0
|
|
4977
5026
|
};
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
entry.expiresAt = typeof result === "string" ? 0 : result.expiresAt;
|
|
4982
|
-
return result;
|
|
4983
|
-
} finally {
|
|
4984
|
-
if (catalogs.get(key) === entry && !(entry.expiresAt > Date.now() && Number.isFinite(entry.expiresAt))) catalogs.delete(key);
|
|
4985
|
-
}
|
|
5027
|
+
const read = refreshCatalog(next, url, apiKey);
|
|
5028
|
+
catalogs.set(key, Object.assign(next, { read }));
|
|
5029
|
+
return read;
|
|
4986
5030
|
}
|
|
5031
|
+
/**
|
|
5032
|
+
* The model's entry in the catalog for this endpoint, credential and revision. A process asks
|
|
5033
|
+
* for that catalog once per lifetime for the models its list names: such a lookup is answered
|
|
5034
|
+
* from the kept list at once, also while another request is in flight. A lookup the list does
|
|
5035
|
+
* not name waits on one read, a new conditional request when the last is old enough, and is
|
|
5036
|
+
* answered from the list that read leaves; an unchanged or unreadable list leaves it unnamed.
|
|
5037
|
+
*/
|
|
4987
5038
|
async function readRouterCatalogEntry(input) {
|
|
4988
|
-
const
|
|
4989
|
-
|
|
4990
|
-
const
|
|
4991
|
-
|
|
5039
|
+
const url = catalogUrl(input.baseUrl);
|
|
5040
|
+
const apiKey = input.apiKey?.trim() ?? "";
|
|
5041
|
+
const key = digest(JSON.stringify([
|
|
5042
|
+
url,
|
|
5043
|
+
apiKey,
|
|
5044
|
+
input.cacheRevision ?? ""
|
|
5045
|
+
]));
|
|
5046
|
+
const named = (entries) => findRouterCatalogEntry(entries, input.model) ?? (input.catalogAlias ? findRouterCatalogEntry(entries, input.catalogAlias) : void 0);
|
|
5047
|
+
const kept = catalogs.get(key);
|
|
5048
|
+
const listed = kept?.list && kept.fresh > Date.now() ? named(kept.list.entries) : void 0;
|
|
5049
|
+
if (listed) return listed;
|
|
5050
|
+
const entries = await readCatalog(key, url, apiKey);
|
|
5051
|
+
if (typeof entries === "string") return entries;
|
|
5052
|
+
return named(entries) ?? `model catalog does not list ${input.model}`;
|
|
4992
5053
|
}
|
|
4993
5054
|
/** The model's listed `reasoning_effort_values`, trimmed and lowercased, or why the catalog was unreadable. */
|
|
4994
5055
|
async function resolveRouterModelReasoningEfforts(input) {
|
|
@@ -5055,6 +5116,6 @@ async function forgetSessionScopes(target) {
|
|
|
5055
5116
|
}
|
|
5056
5117
|
}
|
|
5057
5118
|
//#endregion
|
|
5058
|
-
export {
|
|
5119
|
+
export { joinQueue as $, readCliTokenUsage as A, wasNeverLaunched as At, localMcpEnv as B, reasoningEvents as Bt, brokerInteractionTools$1 as C, deterministicFilePartId as Ct, AcpProviderAdapterBase as D, SessionRehydrationError as Dt, plaintextResponseParser as E, InvalidAttachmentError as Et, endFailedTurn as F, MANAGED_QUOTE_VERSION_HEADER as Ft, turnInteractionEnabled as G, toolResultEvents as Gt, interactionToggleEnabled as H, streamPartBase as Ht, recordTurnInterruption as I, executionCorrelationHeaders as It, SHARED_WORKSPACE_DIR_ENV as J, ACP_MIN_PROTOCOL_VERSION as Jt, withEphemeralContext as K, toolStartEvents as Kt, createExecutionState as L, homeXdgEnv as Lt, CliProviderAdapterBase as M, EXECUTION_CORRELATION_HEADERS as Mt, TurnObserver as N, EXECUTION_ID_HEADER as Nt, accumulateCliTokenUsage as O, failureAfterCleanup as Ot, createRepeatedToolFailureGuard as P, EXECUTION_TRACE_HEADER as Pt, isPlainRecord as Q, spawnAcpBridge as Qt, isLocalMcpConfig as R, mapAcpSessionUpdate as Rt, InteractionMcpServer$1 as S, deriveFilePart as St, jsonEventParser as T, trackFilePart as Tt, readEphemeralContext as U, textDeltaEvents as Ut, enabledInteractionKinds as V, sessionObservedEvents as Vt, turnEndReason as W, textSnapshotEvents as Wt, directStdioMcpServers as X, acpContentText as Xt, assertSealedNativeSearchPath as Y, ACP_PROTOCOL_VERSION as Yt, isLoopbackEndpoint as Z, assertAcpTurnFinished as Zt, kimiThinkingArgs as _, PROMPT_SECTION_SEPARATOR as _t, SECRET_REFERENCE$1 as a, sharedSecretMcpRefused as at, TerminalPlanSupport as b, prependPromptSection as bt, forgetSessionScopes as c, NATIVE_SESSION_CONTRACTS$1 as ct, ROUTER_MODEL_CATALOG_LIFETIME_MS as d, isTrustedStoreBinary as dt, requireRecord as et, ROUTER_MODEL_CATALOG_MISS_REREAD_MS as f, provenStoreBinary as ft, resolveRouterModelReasoningEfforts as g, MAX_TOTAL_INLINE_IMAGE_BYTES as gt, resolveRouterModelLimits as h, MAX_INLINE_IMAGE_BYTES as ht, PERMISSION_DECISION_TIMEOUT_MS as i, servableStdioServer as it, recordCliTokenUsage as j, runtimeSecretsOverlay as jt, parseCliUsageLine as k, rejectNotLaunched as kt, secretMcpScope as l, SEALED_NATIVE_HOME_LAYOUT as lt, findRouterCatalogEntry as m, resolveExecutableRealpath as mt, InteractionBroker$1 as n, secretSessionTurnQueue as nt, SECRET_REFERENCE_PREFIX$1 as o, spawnUnderSecretMcpLease as ot, ROUTER_MODEL_CATALOG_TIMEOUT_MS as p, refuseSecretLaunch as pt, withTurnInteractions as q, trackReasoningBlock as qt, InteractionHttpBridge as r, servableMcpServer as rt, codexDeveloperInstructionArgs as s, untilSettledOrAborted as st, CODEX_DISABLED_FEATURE_ARGS as t, resolveReferences as tt, ROUTER_MODEL_CATALOG_FAILURE_STOP_MS as u, assertSealedNativeHome as ut, nativeEffortArgs as v, partitionImageAttachments as vt, interactionMcpToolName as w, inferMediaType as wt, DEFAULT_INTERACTION_MCP_SERVER_NAME as x, buildFileUrl as xt, McpInteractionSupport as y, preparePromptInputParts as yt, localMcpArgv as z, finalTextEvent as zt };
|
|
5059
5120
|
|
|
5060
|
-
//# sourceMappingURL=src-
|
|
5121
|
+
//# sourceMappingURL=src-DPS1Iz0N.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.213",
|
|
4
4
|
"description": "Base adapter for CLI-based AI agent providers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"registry": "https://registry.npmjs.org"
|
|
80
80
|
},
|
|
81
81
|
"tangleRelease": {
|
|
82
|
-
"sourceSha": "
|
|
83
|
-
"mergedAt": "2026-11-
|
|
82
|
+
"sourceSha": "621a0e457ea79edaea8c83d545663da6b083de31",
|
|
83
|
+
"mergedAt": "2026-11-24T15:08:19-08:00"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "tsdown",
|