@tangle-network/agent-runtime 0.133.3 → 0.133.5
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/{activation-WLt7Dmfv.js → activation-CeZdt1R3.js} +2 -2
- package/dist/{activation-WLt7Dmfv.js.map → activation-CeZdt1R3.js.map} +1 -1
- package/dist/agent.js +2 -2
- package/dist/{authoring-BmzFs-eQ.js → authoring-Cbz3BYqD.js} +2 -2
- package/dist/{authoring-BmzFs-eQ.js.map → authoring-Cbz3BYqD.js.map} +1 -1
- package/dist/{environment-provider-mDsjfGjY.js → environment-provider-DTJA4ZiM.js} +10 -5
- package/dist/{environment-provider-mDsjfGjY.js.map → environment-provider-DTJA4ZiM.js.map} +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{graph-Ck6Lm5XP.js → graph-BcwxFLW_.js} +2 -2
- package/dist/{graph-Ck6Lm5XP.js.map → graph-BcwxFLW_.js.map} +1 -1
- package/dist/{improvement-cycle-ClbcuXvP.js → improvement-cycle-CXY8XmhV.js} +3 -3
- package/dist/{improvement-cycle-ClbcuXvP.js.map → improvement-cycle-CXY8XmhV.js.map} +1 -1
- package/dist/index.js +7 -7
- package/dist/intelligence.js +4 -4
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-jGnr0Fpn.js → knowledge-vEyPvtRm.js} +3 -3
- package/dist/{knowledge-jGnr0Fpn.js.map → knowledge-vEyPvtRm.js.map} +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-SvKBQeUG.js → loop-runner-bin-BrF0g950.js} +3 -3
- package/dist/{loop-runner-bin-SvKBQeUG.js.map → loop-runner-bin-BrF0g950.js.map} +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-Sh1Q_4vy.js → openai-tools-BEeoh5i0.js} +2 -2
- package/dist/{openai-tools-Sh1Q_4vy.js.map → openai-tools-BEeoh5i0.js.map} +1 -1
- package/dist/{runtime-BdtZvPzb.js → runtime-BX5c47Qm.js} +7 -7
- package/dist/{runtime-BdtZvPzb.js.map → runtime-BX5c47Qm.js.map} +1 -1
- package/dist/{structural-rollout-BfOB1pIb.js → structural-rollout-CHq3qJau.js} +2 -2
- package/dist/{structural-rollout-BfOB1pIb.js.map → structural-rollout-CHq3qJau.js.map} +1 -1
- package/dist/{supervise-DG11q6jc.js → supervise-D-e9RIuG.js} +35 -6
- package/dist/supervise-D-e9RIuG.js.map +1 -0
- package/dist/{supervisor-D8sBmGYd.js → supervisor-GBIOnjUo.js} +25 -15
- package/dist/supervisor-GBIOnjUo.js.map +1 -0
- package/dist/testing.js +11 -11
- package/package.json +1 -1
- package/dist/supervise-DG11q6jc.js.map +0 -1
- package/dist/supervisor-D8sBmGYd.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { t as detachedSnapshot } from "./snapshot-DY6VGliG.js";
|
|
|
3
3
|
import { S as contentAddress, b as parseWorkerToolTraceArtifact, d as prepareJsonlAppend, f as writeAllBytes, i as InMemorySpawnJournal, n as FileSpawnJournal, r as InMemoryResultBlobStore, t as FileResultBlobStore, u as parseCommittedJsonLines, x as workerTraceAnalysisStore } from "./spawn-journal-BX3-4WDm.js";
|
|
4
4
|
import { a as concreteProfileModel, d as harnessRunsAgent, n as assertModelAllowed, r as assertProfileModelsAllowed, s as profileModelExecutionSettings, t as assertExecutableAgentProfile, u as agentHarness } from "./model-policy-Bv1DU2fw.js";
|
|
5
5
|
import { _ as runtimeOwnedExecutorExecutionBinding, b as runtimeOwnedPendingExecutorMaterialization, d as recordRuntimeOwnedDriveHarnessProviderEvidence, g as runtimeOwnedDriveHarnessProviderEvidence, i as attestRuntimeOwnedScopeOwner, s as inheritRuntimeOwnedExecutorAttestation, v as runtimeOwnedExecutorMaterialization, x as runtimeOwnedScopeOwnerRuntime, y as runtimeOwnedExecutorProviderEvidence } from "./materialization-D2bdTfkK.js";
|
|
6
|
-
import { A as spendFromUsageEvents, C as freeSlots, D as teardownExecutor, E as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, F as createExecutorRegistry, Gt as fullProfileMaterialization, Ht as assertProfileMaterialization, I as snapshotExecutorConfig, Jt as promptModelProfileMaterialization, Kt as profileMaterializationAxes$1, M as captureReusableExecutorConfig, O as assertValidBudget, P as createExecutor, R as WORKER_TRACE_PROPAGATION, Ut as controlProfileMaterialization, Wt as defineProfileMaterializationContract, Z as createInbox, _t as createOtelExporter, a as pickBestDelivered, at as runBrainLoop, bt as generateSpanId, c as driverChild, d as deriveNodeExecutionIdentity, en as worktreeCliProfileMaterialization, f as meterRuntimeOwnedProviderAttempt, it as routerBrain, j as bindReusableExecutorExecutionId, l as withDriverExecutor, m as scopeOwnerExecutorNodeContext, mt as buildLoopSpanNodes, n as createSupervisor, o as runFinalizer, p as recordScopeOwnerMaterialization, qt as promptControlProfileMaterialization, r as bestDelivered, s as runTree, wt as toOtelAttributes } from "./supervisor-
|
|
6
|
+
import { A as spendFromUsageEvents, C as freeSlots, D as teardownExecutor, E as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, F as createExecutorRegistry, Gt as fullProfileMaterialization, Ht as assertProfileMaterialization, I as snapshotExecutorConfig, Jt as promptModelProfileMaterialization, Kt as profileMaterializationAxes$1, M as captureReusableExecutorConfig, O as assertValidBudget, P as createExecutor, R as WORKER_TRACE_PROPAGATION, Ut as controlProfileMaterialization, Wt as defineProfileMaterializationContract, Z as createInbox, _t as createOtelExporter, a as pickBestDelivered, at as runBrainLoop, bt as generateSpanId, c as driverChild, d as deriveNodeExecutionIdentity, en as worktreeCliProfileMaterialization, f as meterRuntimeOwnedProviderAttempt, it as routerBrain, j as bindReusableExecutorExecutionId, l as withDriverExecutor, m as scopeOwnerExecutorNodeContext, mt as buildLoopSpanNodes, n as createSupervisor, o as runFinalizer, p as recordScopeOwnerMaterialization, qt as promptControlProfileMaterialization, r as bestDelivered, s as runTree, wt as toOtelAttributes } from "./supervisor-GBIOnjUo.js";
|
|
7
7
|
import { t as composeRuntimeHooks } from "./runtime-hooks-C7iJOWm3.js";
|
|
8
8
|
import { t as createStdioToolServer } from "./tool-server-VvSK1K3X.js";
|
|
9
9
|
import { n as UI_LENSES } from "./substrate-B0TYNrXn.js";
|
|
@@ -2729,6 +2729,38 @@ function providerAttemptEvidence$1(model) {
|
|
|
2729
2729
|
models
|
|
2730
2730
|
});
|
|
2731
2731
|
}
|
|
2732
|
+
/** The USD-denominated members of {@link PromptCacheUsage} — the schema, not a guess. Every
|
|
2733
|
+
* other known member (`readTokens`, `writeTokens`, `missTokens`) is a token COUNT. */
|
|
2734
|
+
const PROMPT_CACHE_USD_FIELDS = /* @__PURE__ */ new Set(["readSavingsUsd"]);
|
|
2735
|
+
/** Dollar amounts above this are provider nonsense, not evidence. The old all-integer rule
|
|
2736
|
+
* rejected them as a side effect; keeping an explicit ceiling preserves that protection
|
|
2737
|
+
* without pretending a dollar amount is an integer. */
|
|
2738
|
+
const MAX_PROMPT_CACHE_USD = 1e6;
|
|
2739
|
+
/**
|
|
2740
|
+
* Validate provider-reported prompt-cache evidence.
|
|
2741
|
+
*
|
|
2742
|
+
* Prompt-cache carries two kinds of number and they obey different rules: token COUNTS are
|
|
2743
|
+
* integers, and USD amounts are fractional by nature. Applying the count rule to a dollar
|
|
2744
|
+
* field refuses every provider that reports cache savings in dollars — a healthy router
|
|
2745
|
+
* response carrying `readSavingsUsd: 0.0034` failed the driver outright before this split.
|
|
2746
|
+
*
|
|
2747
|
+
* Classification is schema-first: a field named in {@link PromptCacheUsage} is validated by
|
|
2748
|
+
* what that member IS. `promptCache` is an open record (the sandbox path forwards provider
|
|
2749
|
+
* fields verbatim), so an unknown field falls back to the `usd` name-suffix convention —
|
|
2750
|
+
* documented here as the contract a provider must follow to report dollars.
|
|
2751
|
+
*
|
|
2752
|
+
* Returns the refusal, or `undefined` when the evidence is acceptable.
|
|
2753
|
+
*/
|
|
2754
|
+
function validateDriverPromptCache(promptCache) {
|
|
2755
|
+
for (const [field, value] of Object.entries(promptCache ?? {})) {
|
|
2756
|
+
if (typeof value !== "number") continue;
|
|
2757
|
+
if (PROMPT_CACHE_USD_FIELDS.has(field) || /usd$/i.test(field)) {
|
|
2758
|
+
if (!Number.isFinite(value) || value < 0 || value > MAX_PROMPT_CACHE_USD) return new ValidationError(`driverAgent: prompt-cache field ${JSON.stringify(field)} must be a non-negative finite number of dollars`);
|
|
2759
|
+
continue;
|
|
2760
|
+
}
|
|
2761
|
+
if (!Number.isSafeInteger(value) || value < 0) return new ValidationError(`driverAgent: prompt-cache field ${JSON.stringify(field)} must be a non-negative safe integer`);
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2732
2764
|
/**
|
|
2733
2765
|
* Build the intelligent recursive driver. Its `act` is the LLM tool-loop; spawn it as a
|
|
2734
2766
|
* `driverChild` (`driver-executor.ts`) to run it inside a nested scope, recursively.
|
|
@@ -2850,10 +2882,7 @@ function driverAgent(opts) {
|
|
|
2850
2882
|
else if (res.model !== opts.expectedModel) evidenceError = new ValidationError(`driverAgent: Router response reported model ${JSON.stringify(res.model)}; expected ${JSON.stringify(opts.expectedModel)}`);
|
|
2851
2883
|
}
|
|
2852
2884
|
if (res.transportAttempts !== void 0 && (!Number.isSafeInteger(res.transportAttempts) || res.transportAttempts < 1)) evidenceError = new ValidationError("driverAgent: transportAttempts must be a positive safe integer when reported");
|
|
2853
|
-
|
|
2854
|
-
evidenceError = new ValidationError(`driverAgent: prompt-cache field ${JSON.stringify(field)} must be a non-negative safe integer`);
|
|
2855
|
-
break;
|
|
2856
|
-
}
|
|
2885
|
+
evidenceError = validateDriverPromptCache(res.promptCache) ?? evidenceError;
|
|
2857
2886
|
const trustedCost = res.costProvenance === "provider-receipt" || res.costProvenance === "billing-receipt";
|
|
2858
2887
|
const cacheUsage = driverPromptCacheUsage(res.usage?.input, res.promptCache);
|
|
2859
2888
|
await meterRuntimeOwnedProviderAttempt(scope, {
|
|
@@ -6496,4 +6525,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
|
|
|
6496
6525
|
//#endregion
|
|
6497
6526
|
export { DELEGATION_TRACE_MAX_BYTES as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, defaultToolDetectors as At, DELEGATE_FEEDBACK_INPUT_SCHEMA as B, createMcpServer as C, plateauLength as Ct, createDelegationStatusHandler as D, createCoordinationTools as Dt, DELEGATION_STATUS_TOOL_NAME as E, canonicalFindingEvent as Et, DELEGATE_UI_AUDIT_INPUT_SCHEMA as F, createSupervisorSpanRecorder as Ft, DELEGATE_INPUT_SCHEMA as G, createDelegateFeedbackHandler as H, DELEGATE_UI_AUDIT_TOOL_NAME as I, gateOnDeliverable as It, validateDelegateArgs as J, DELEGATE_TOOL_NAME as K, createDelegateUiAuditHandler as L, mapExecutorResult as Lt, createDelegationHistoryHandler as M, createFileRunContext as Mt, validateDelegationHistoryArgs as N, createInMemoryRunContext as Nt, validateDelegationStatusArgs as O, normalizeAnalyzeOnSettle as Ot, DELEGATE_UI_AUDIT_DESCRIPTION as P, FileCoordinationLog as Pt, hashIdempotencyInput as Q, validateDelegateUiAuditArgs as R, createInProcessTransport as S, bestSoFar as St, DELEGATION_STATUS_INPUT_SCHEMA as T, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as Tt, validateDelegateFeedbackArgs as U, DELEGATE_FEEDBACK_TOOL_NAME as V, DELEGATE_DESCRIPTION as W, delegate as X, defaultDelegateBudget as Y, DelegationTaskQueue as Z, promptHandle as _, noProgressFor as _t, assertCoordinationBinding as a, DelegationPersistenceError as at, classifyDriverFailure as b, anytimeReport as bt, supervisorAgentWithTestBrain as c, InMemoryDelegationStore as ct, delegatesWorkerBriefPrompt as d, driverAgent as dt, DELEGATION_TRACE_MAX_SPANS as et, dumbContinuationFailPrompt as f, finalizeBestDelivered as ft, naiveContinuationPrompt as g, createProgressTracker as gt, kernelPromptRegistry as h, anyOf as ht, workerFromBackend as i, createDelegationTraceCollector as it, DELEGATION_HISTORY_TOOL_NAME as j, watchTrace as jt, DELEGATION_HISTORY_DESCRIPTION as k, createEventBus as kt, analyzesFindingsReportPrompt as l, InMemoryFeedbackStore as lt, formatPromptHandle as m, allWorkersStalled as mt, supervise as n, capDelegationTrace as nt, resolveSupervisorProfile as o, DelegationStateCorruptError as ot, dumbContinuationPassPrompt as p, allOf as pt, createDelegateHandler as q, superviseWithTestBrain as r, composeLoopTraceEmitters as rt, supervisorAgent as s, FileDelegationStore as st, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, buildDelegationTraceSpans as tt, createPromptRegistry as u, eventToSnapshot as ut, supervisorPolicyPrompt as v, plateau as vt, DELEGATION_STATUS_DESCRIPTION as w, renderAnytimeTable as wt, serveCoordinationMcp as x, areaUnderCurve as xt, DriverAttemptsExhaustedError as y, sampleFromSettled as yt, DELEGATE_FEEDBACK_DESCRIPTION as z };
|
|
6498
6527
|
|
|
6499
|
-
//# sourceMappingURL=supervise-
|
|
6528
|
+
//# sourceMappingURL=supervise-D-e9RIuG.js.map
|