@tangle-network/sdk-provider-cli-base 0.13.9 → 0.13.11
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/index.d.mts +4 -2
- package/dist/index.mjs +25 -13
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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-BHn_1z69.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 } 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, 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, 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, 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";
|
|
@@ -459,7 +459,7 @@ declare abstract class CliAdapterProfile<TConfig extends CliProviderConfig = Cli
|
|
|
459
459
|
/** A profile's declared executable tools, sealed in its revision, stand in for the app's own tool dirs on this launch's PATH tail. */
|
|
460
460
|
private bindProfileToolBinDirs;
|
|
461
461
|
protected bindExecutionCorrelation(environment: Record<string, string | undefined>, correlationHeaders: Readonly<Record<string, string>> | undefined): Record<string, string | undefined>;
|
|
462
|
-
/** Launcher controls this adapter OWNS on the spawn it starts
|
|
462
|
+
/** Launcher controls this adapter OWNS on the spawn it starts; the pre-box verdict reads the same table. */
|
|
463
463
|
protected profileMaterializationBinds(): readonly BindableLaunchControl[];
|
|
464
464
|
/** Optional native instruction root. */
|
|
465
465
|
protected profileAgentDirectory(_workspaceRoot: string): string | undefined;
|
|
@@ -476,6 +476,8 @@ declare abstract class CliAdapterProfile<TConfig extends CliProviderConfig = Cli
|
|
|
476
476
|
/** Bind the private revision into the session's stable native cwd. */
|
|
477
477
|
protected bindSecretProfileSessionView(revisionWorkspaceDir: string, sessionId: string): string;
|
|
478
478
|
protected materializeProfileResources(inputProfile: AgentProfile | undefined, workspaceRoot: string, ownerId?: string, sessionId?: string, scope?: "turn" | "prewarm"): Promise<WorkspacePlanApplication$1 | undefined>;
|
|
479
|
+
/** This spawn's plan: a strict refusal throws, a best-effort one is logged. */
|
|
480
|
+
protected planProfile(profile: AgentProfile, harness: HarnessId$1, agentInstructions?: boolean): WorkspacePlan;
|
|
479
481
|
private applyProfileResources;
|
|
480
482
|
/** Publish the profile as an executor-sealed revision for this session's subprocess identity, and record the receipt that binds it to the turn. */
|
|
481
483
|
private applySecretProfileRevision;
|
package/dist/index.mjs
CHANGED
|
@@ -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, 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, 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, REASONING_EFFORTS, agentProfileSchema, nativeReasoningControl, normalizeInputParts } from "@tangle-network/agent-interface";
|
|
@@ -1542,9 +1542,10 @@ var CliAdapterProfile = class extends CliAdapterLifecycle {
|
|
|
1542
1542
|
if (correlationHeaders?.["X-Tangle-Execution-ID"] !== void 0) this.logger.warn("Native model request correlation is unsupported", { provider: this.provider });
|
|
1543
1543
|
return environment;
|
|
1544
1544
|
}
|
|
1545
|
-
/** Launcher controls this adapter OWNS on the spawn it starts
|
|
1545
|
+
/** Launcher controls this adapter OWNS on the spawn it starts; the pre-box verdict reads the same table. */
|
|
1546
1546
|
profileMaterializationBinds() {
|
|
1547
|
-
|
|
1547
|
+
const harness = this.profileHarness;
|
|
1548
|
+
return (harness && HARNESS_LAUNCH_MATERIALIZE_OPTIONS[harness]?.binds) ?? [];
|
|
1548
1549
|
}
|
|
1549
1550
|
/** Optional native instruction root. */
|
|
1550
1551
|
profileAgentDirectory(_workspaceRoot) {}
|
|
@@ -1591,24 +1592,29 @@ var CliAdapterProfile = class extends CliAdapterLifecycle {
|
|
|
1591
1592
|
this.logger.observePhase?.("profile_materialize", performance.now() - started, scope);
|
|
1592
1593
|
}
|
|
1593
1594
|
}
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
const harness = this.profileHarness;
|
|
1597
|
-
if (!harness) {
|
|
1598
|
-
if (hasPortableProfileControls(profile) || this.config.runtimeAttachments !== void 0) throw new Error(`${this.provider} does not support portable AgentProfile controls`);
|
|
1599
|
-
return;
|
|
1600
|
-
}
|
|
1601
|
-
const agentDir = this.profileAgentDirectory(workspaceRoot);
|
|
1595
|
+
/** This spawn's plan: a strict refusal throws, a best-effort one is logged. */
|
|
1596
|
+
planProfile(profile, harness, agentInstructions = false) {
|
|
1602
1597
|
const plan = materializeProfile(profile, harness, {
|
|
1603
1598
|
runtimeAttachments: this.config.runtimeAttachments,
|
|
1604
1599
|
binds: this.profileMaterializationBinds(),
|
|
1605
|
-
...
|
|
1600
|
+
...agentInstructions ? { instructionsRoot: "agent" } : {}
|
|
1606
1601
|
});
|
|
1607
1602
|
const unsupported = enforceWorkspacePlanSupport(plan, profile.resources?.failOnError);
|
|
1608
1603
|
if (unsupported.length > 0) this.logger.warn("profile contains unsupported best-effort resources", {
|
|
1609
1604
|
harness,
|
|
1610
1605
|
unsupported
|
|
1611
1606
|
});
|
|
1607
|
+
return plan;
|
|
1608
|
+
}
|
|
1609
|
+
async applyProfileResources(inputProfile, workspaceRoot, ownerId, sessionId) {
|
|
1610
|
+
const profile = inputProfile ?? {};
|
|
1611
|
+
const harness = this.profileHarness;
|
|
1612
|
+
if (!harness) {
|
|
1613
|
+
if (hasPortableProfileControls(profile) || this.config.runtimeAttachments !== void 0) throw new Error(`${this.provider} does not support portable AgentProfile controls`);
|
|
1614
|
+
return;
|
|
1615
|
+
}
|
|
1616
|
+
const agentDir = this.profileAgentDirectory(workspaceRoot);
|
|
1617
|
+
const plan = this.planProfile(profile, harness, agentDir !== void 0);
|
|
1612
1618
|
if (this.config.secretProfileRevisionRoot) return await this.applySecretProfileRevision(plan, this.config.secretProfileRevisionRoot, workspaceRoot, ownerId, sessionId);
|
|
1613
1619
|
if (this.config.publicProfileRevisionRoot) {
|
|
1614
1620
|
if (!ownerId) throw new Error("Concurrent public profile launch requires a session scope; idle prewarm is unsupported");
|
|
@@ -2844,7 +2850,13 @@ var TurnObserver = class {
|
|
|
2844
2850
|
state.sessionId = providerSessionId;
|
|
2845
2851
|
this.persistProviderSession(providerSessionId);
|
|
2846
2852
|
}
|
|
2847
|
-
if (event.type === "warning")
|
|
2853
|
+
if (event.type === "warning") {
|
|
2854
|
+
state.lastDiagnostic = event.message;
|
|
2855
|
+
if (event.code === "EXECUTION_INTERRUPTED") state.failure ??= {
|
|
2856
|
+
code: event.code,
|
|
2857
|
+
message: event.message
|
|
2858
|
+
};
|
|
2859
|
+
}
|
|
2848
2860
|
if (event.type === "status" && (event.status === "completed" || event.status === "failed")) {
|
|
2849
2861
|
state.terminalStatus = event.status;
|
|
2850
2862
|
if (event.status === "failed" && event.detail) state.lastDiagnostic = event.detail;
|
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.11",
|
|
4
4
|
"description": "Base adapter for CLI-based AI agent providers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
25
25
|
"@tangle-network/agent-core": "^1.0.3",
|
|
26
|
-
"@tangle-network/agent-interface": "^5.10.
|
|
27
|
-
"@tangle-network/agent-profile-materialize": "1.1.
|
|
26
|
+
"@tangle-network/agent-interface": "^5.10.19",
|
|
27
|
+
"@tangle-network/agent-profile-materialize": "1.1.33",
|
|
28
28
|
"@tangle-network/agent-trace-contract": "^2.2.0",
|
|
29
|
-
"@tangle-network/cli-agent-registry": "0.15.
|
|
30
|
-
"@tangle-network/sdk-cli-runner": "0.3.
|
|
31
|
-
"@tangle-network/sdk-session-persistence": "0.7.
|
|
29
|
+
"@tangle-network/cli-agent-registry": "0.15.22",
|
|
30
|
+
"@tangle-network/sdk-cli-runner": "0.3.7",
|
|
31
|
+
"@tangle-network/sdk-session-persistence": "0.7.3",
|
|
32
32
|
"zod": "4.6.6"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"registry": "https://registry.npmjs.org"
|
|
44
44
|
},
|
|
45
45
|
"tangleRelease": {
|
|
46
|
-
"sourceSha": "
|
|
47
|
-
"mergedAt": "2026-11-
|
|
46
|
+
"sourceSha": "2610fa24827acda4cb7c05a9a6d41a7a6ddb6a6c",
|
|
47
|
+
"mergedAt": "2026-11-05T02:05:58-08:00"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsdown",
|
|
51
|
-
"test": "vitest run
|
|
51
|
+
"test": "vitest run",
|
|
52
52
|
"test:watch": "vitest",
|
|
53
53
|
"lint": "biome check --write .",
|
|
54
54
|
"check-types": "node ../../scripts/tsc-native.mjs --noEmit"
|