@tangle-network/agent-runtime 10.0.15 → 10.0.17
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/CHANGELOG.md +18 -0
- package/dist/{activation-BmdINnh5.d.ts → activation-BSyIPZNw.d.ts} +2 -2
- package/dist/{activation-b0nzPqca.js → activation-CxTZHC70.js} +2 -2
- package/dist/{activation-b0nzPqca.js.map → activation-CxTZHC70.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +4 -4
- package/dist/{continuation-Bccak14N.js → continuation-CDdjAkpk.js} +2 -2
- package/dist/{continuation-Bccak14N.js.map → continuation-CDdjAkpk.js.map} +1 -1
- package/dist/{coordination-map-routing-XZXTlCmn.js → coordination-map-routing-DovTCk1Y.js} +2 -2
- package/dist/{coordination-map-routing-XZXTlCmn.js.map → coordination-map-routing-DovTCk1Y.js.map} +1 -1
- package/dist/{delegate-CLaWDfML.js → delegate-DGeAiukN.js} +2 -2
- package/dist/{delegate-CLaWDfML.js.map → delegate-DGeAiukN.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-NPX-VWeS.js → driver-control-acknowledgers-Q4c0RMoG.js} +10 -10
- package/dist/{driver-control-acknowledgers-NPX-VWeS.js.map → driver-control-acknowledgers-Q4c0RMoG.js.map} +1 -1
- package/dist/durable-writer-thread.js +4 -4
- package/dist/durable.d.ts +2 -1
- package/dist/durable.js +18 -16
- package/dist/durable.js.map +1 -1
- package/dist/{failure-cause-B2TBXIu-.js → failure-cause-DeSINrKC.js} +20 -10
- package/dist/{failure-cause-B2TBXIu-.js.map → failure-cause-DeSINrKC.js.map} +1 -1
- package/dist/{graph-B2OzHayc.js → graph-qm8N8-Jg.js} +31 -12
- package/dist/graph-qm8N8-Jg.js.map +1 -0
- package/dist/{graph-registry-BmghD_VO.js → graph-registry-SgsCxCTZ.js} +5 -5
- package/dist/{graph-registry-BmghD_VO.js.map → graph-registry-SgsCxCTZ.js.map} +1 -1
- package/dist/{graph-registry-DQ2-dA0X.js → graph-registry-aMRd94PD.js} +1 -1
- package/dist/{improve-dYbnuXC8.js → improve-BIgddUb2.js} +8 -8
- package/dist/{improve-dYbnuXC8.js.map → improve-BIgddUb2.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -12
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +5 -5
- package/dist/{jsonl-file-vE9H9UXa.js → jsonl-file-B8xfYz9M.js} +14 -3
- package/dist/{jsonl-file-vE9H9UXa.js.map → jsonl-file-B8xfYz9M.js.map} +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +19 -19
- package/dist/{loop-runner-UfFomLu5.js → loop-runner-CARBEmJ-.js} +2 -2
- package/dist/{loop-runner-UfFomLu5.js.map → loop-runner-CARBEmJ-.js.map} +1 -1
- package/dist/{loop-runner-AQcWx9uu.d.ts → loop-runner-CG8rMjSU.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +7 -7
- package/dist/mcp/memory-bin.js +1 -1
- package/dist/{model-policy-DTbTFyOG.js → model-policy-DFuhCC0-.js} +27 -2
- package/dist/model-policy-DFuhCC0-.js.map +1 -0
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/{provision-supervisor-DSDkye8b.js → provision-supervisor-bnP_5YKO.js} +8 -8
- package/dist/{provision-supervisor-DSDkye8b.js.map → provision-supervisor-bnP_5YKO.js.map} +1 -1
- package/dist/{result-blob-store-nBpCKwFg.js → result-blob-store-hfSuzvWt.js} +4 -4
- package/dist/{result-blob-store-nBpCKwFg.js.map → result-blob-store-hfSuzvWt.js.map} +1 -1
- package/dist/{run-cancellation-BYnz8GlN.js → run-cancellation-3JALg48v.js} +2 -2
- package/dist/{run-cancellation-BYnz8GlN.js.map → run-cancellation-3JALg48v.js.map} +1 -1
- package/dist/{run-lock-Ckakh1Uq.js → run-lock-BOg7BaXF.js} +2 -2
- package/dist/{run-lock-Ckakh1Uq.js.map → run-lock-BOg7BaXF.js.map} +1 -1
- package/dist/{run-reopen-CQjs4kpp.js → run-reopen-CrlP610D.js} +6 -6
- package/dist/{run-reopen-CQjs4kpp.js.map → run-reopen-CrlP610D.js.map} +1 -1
- package/dist/{run-state-DI59zWDh.js → run-state-CdmftIyV.js} +7 -7
- package/dist/{run-state-DI59zWDh.js.map → run-state-CdmftIyV.js.map} +1 -1
- package/dist/{runtime-DZupdBai.js → runtime-BJfxfru1.js} +45 -22
- package/dist/{runtime-DZupdBai.js.map → runtime-BJfxfru1.js.map} +1 -1
- package/dist/{search-executor-DXKX36KX.js → search-executor-B0XqNpI1.js} +5 -5
- package/dist/{search-executor-DXKX36KX.js.map → search-executor-B0XqNpI1.js.map} +1 -1
- package/dist/{server-db_tgJ2j.js → server-BL1KHd0N.js} +4 -4
- package/dist/{server-db_tgJ2j.js.map → server-BL1KHd0N.js.map} +1 -1
- package/dist/{settle-record-DV7zCjhI.js → settle-record-CWixHcZl.js} +5 -4
- package/dist/{settle-record-DV7zCjhI.js.map → settle-record-CWixHcZl.js.map} +1 -1
- package/dist/{snapshot-BKI_w3JD.js → snapshot-BKLziJ5K.js} +12 -4
- package/dist/snapshot-BKLziJ5K.js.map +1 -0
- package/dist/{structural-rollout-BgGJOWEx.js → structural-rollout-PkvuJbEk.js} +5 -5
- package/dist/{structural-rollout-BgGJOWEx.js.map → structural-rollout-PkvuJbEk.js.map} +1 -1
- package/dist/{supervise-jfYp4dyB.js → supervise-CPMm88sh.js} +72 -37
- package/dist/supervise-CPMm88sh.js.map +1 -0
- package/dist/{supervise-identity-uI2Ke-Mm.js → supervise-identity-BAOmWwLn.js} +4 -4
- package/dist/{supervise-identity-uI2Ke-Mm.js.map → supervise-identity-BAOmWwLn.js.map} +1 -1
- package/dist/{supervision-discovery-CHRT0UXq.js → supervision-discovery-B6fyGpHe.js} +4 -4
- package/dist/{supervision-discovery-CHRT0UXq.js.map → supervision-discovery-B6fyGpHe.js.map} +1 -1
- package/dist/{supervisor-BVtN_Szy.js → supervisor-BOYyb8eL.js} +15 -12
- package/dist/supervisor-BOYyb8eL.js.map +1 -0
- package/dist/{supervisor-accounting--LFd8H4U.js → supervisor-accounting-BmY9xWOW.js} +5 -5
- package/dist/{supervisor-accounting--LFd8H4U.js.map → supervisor-accounting-BmY9xWOW.js.map} +1 -1
- package/dist/{supervisor-root-contract-xlqe8DE1.js → supervisor-root-contract-DIMbL04L.js} +3 -3
- package/dist/{supervisor-root-contract-xlqe8DE1.js.map → supervisor-root-contract-DIMbL04L.js.map} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{tool-server-B_cNseNf.js → tool-server--58hhIKE.js} +2 -2
- package/dist/{tool-server-B_cNseNf.js.map → tool-server--58hhIKE.js.map} +1 -1
- package/dist/{top-web-CRmycSiU.js → top-web-CPzT4hJX.js} +23 -18
- package/dist/top-web-CPzT4hJX.js.map +1 -0
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +3 -2
- package/dist/tui/index.js +2 -2
- package/dist/{types-Br9sWTWk.d.ts → types-C477vlPv.d.ts} +49 -42
- package/package.json +4 -2
- package/dist/graph-B2OzHayc.js.map +0 -1
- package/dist/model-policy-DTbTFyOG.js.map +0 -1
- package/dist/snapshot-BKI_w3JD.js.map +0 -1
- package/dist/supervise-jfYp4dyB.js.map +0 -1
- package/dist/supervisor-BVtN_Szy.js.map +0 -1
- package/dist/top-web-CRmycSiU.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as ValidationError, r as BackendTransportError, t as AgentEvalError } from "./errors-DG8yufqX.js";
|
|
2
2
|
import { A as withBudgetResources, C as unreportedSpend, D as addResourceSpend, E as zeroTokenUsage, O as assertResources, T as zeroSpend, i as chargedTokens, l as fnv1a32Hex, m as promptCacheTokenClasses, n as addSpend, o as cloneTokenUsage, r as addTokenUsage, u as hasCompleteCacheBreakdown } from "./util-qsH5cC9S.js";
|
|
3
|
-
import { a as errMessage, i as causeChain, n as detachedSnapshot, s as errorProperty } from "./snapshot-
|
|
3
|
+
import { a as errMessage, d as providerTraceIdPattern, i as causeChain, n as detachedSnapshot, s as errorProperty, u as providerTraceId } from "./snapshot-BKLziJ5K.js";
|
|
4
4
|
import { AgentTurnResultSchema, CanonicalStreamEventSchema, RuntimeEventEnvelopeSchema } from "@tangle-network/agent-interface";
|
|
5
5
|
import { isRecord } from "@tangle-network/agent-core";
|
|
6
6
|
import { collectAgentFinalMessageText, collectAgentResponseText } from "@tangle-network/sandbox";
|
|
@@ -2651,11 +2651,12 @@ function storedText(event) {
|
|
|
2651
2651
|
}
|
|
2652
2652
|
// src/runtime/supervise/upstream-unavailable.ts
|
|
2653
2653
|
/** Shared capacity recognition and pause policy for drivers and retained leaves. */
|
|
2654
|
-
/** Sandbox: a create its same key gets placed by later. No host has room now
|
|
2655
|
-
* paced, its existence probe failed or its box is in
|
|
2656
|
-
* for its 150 s deploy window only); or an earlier
|
|
2657
|
-
* which Sandbox answers until its reconciler's grace
|
|
2658
|
-
* and the driver both wait on these under the same
|
|
2654
|
+
/** Sandbox: a create its same key gets placed by later. No host has room now, or a parked box's own
|
|
2655
|
+
* host has none to resume it; or the create is paced, its existence probe failed or its box is in
|
|
2656
|
+
* transfer (the SDK re-POSTs this whole family for its 150 s deploy window only); or an earlier
|
|
2657
|
+
* attempt under the key is still reconciling, which Sandbox answers until its reconciler's grace
|
|
2658
|
+
* ends and the SDK never retries. Acquisition and the driver both wait on these under the same
|
|
2659
|
+
* key, within the run's deadline. */
|
|
2659
2660
|
const PLACEMENT_SIGNALS = /* @__PURE__ */ new Set([
|
|
2660
2661
|
"capacity_exhausted",
|
|
2661
2662
|
"host_pressure",
|
|
@@ -2665,7 +2666,8 @@ const PLACEMENT_SIGNALS = /* @__PURE__ */ new Set([
|
|
|
2665
2666
|
"internal_create_pacing_unavailable",
|
|
2666
2667
|
"idempotent_create_probe_failed",
|
|
2667
2668
|
"sandbox_transfer_pending",
|
|
2668
|
-
"sandbox_create_reconciling"
|
|
2669
|
+
"sandbox_create_reconciling",
|
|
2670
|
+
"host_slot_unavailable"
|
|
2669
2671
|
]);
|
|
2670
2672
|
/** The cause in `error`'s chain whose own code is a placement refusal, if any. */
|
|
2671
2673
|
const placementRefusal = (error) => causeChain(error).find((cause) => PLACEMENT_SIGNALS.has(String(Reflect.get(cause, "code")).toLowerCase()));
|
|
@@ -3025,6 +3027,8 @@ const runtimeFailureCauseSchema = z.object({
|
|
|
3025
3027
|
cause: z.string().max(MAX_CAUSE_CHARS),
|
|
3026
3028
|
/** The upstream or provider machine code the failure carried, when it carried one. */
|
|
3027
3029
|
providerCode: z.string().regex(MACHINE_CODE_PATTERN).optional(),
|
|
3030
|
+
/** The upstream request's trace ID, copied from the provider error. */
|
|
3031
|
+
providerTraceId: z.string().regex(providerTraceIdPattern).optional(),
|
|
3028
3032
|
/** The HTTP status the provider's typed error carried with that code. */
|
|
3029
3033
|
providerStatus: z.number().int().min(100).max(599).optional(),
|
|
3030
3034
|
/** The provider's typed retry-after hint, in milliseconds. A hint, never an automatic retry. */
|
|
@@ -3157,6 +3161,7 @@ function runtimeFailureCause(error, context = {}) {
|
|
|
3157
3161
|
try {
|
|
3158
3162
|
const links = causeChain(error);
|
|
3159
3163
|
const providerCode = upstreamMachineCode(links);
|
|
3164
|
+
const traceId = providerTraceId(links);
|
|
3160
3165
|
const upstream = links.find((link) => link instanceof BackendTransportError && link.backend === "bridge" && link.status === 403 && link.upstreamCode === "subscription_required" && link.providerDispatch === "not_started");
|
|
3161
3166
|
const remedy = runtimeFailureRemediationSchema.readonly().safeParse(upstream?.remediation ?? turnRemediationOf(error));
|
|
3162
3167
|
const failure = ({ code, owner }) => ({
|
|
@@ -3164,6 +3169,7 @@ function runtimeFailureCause(error, context = {}) {
|
|
|
3164
3169
|
owner,
|
|
3165
3170
|
cause,
|
|
3166
3171
|
...providerCode === void 0 ? {} : { providerCode },
|
|
3172
|
+
...traceId === void 0 ? {} : { providerTraceId: traceId },
|
|
3167
3173
|
...upstreamResponse(links, providerCode),
|
|
3168
3174
|
...code === "credential-refused" && providerCode === "subscription_required" && remedy.success ? { remediation: remedy.data } : {}
|
|
3169
3175
|
});
|
|
@@ -3228,6 +3234,10 @@ function reportedFailureCause(outcome) {
|
|
|
3228
3234
|
*/
|
|
3229
3235
|
function settlementFailureCause(down) {
|
|
3230
3236
|
const cause = errMessage(down.reason).slice(0, MAX_CAUSE_CHARS);
|
|
3237
|
+
const providerEvidence = {
|
|
3238
|
+
...down.failure?.providerCode === void 0 ? {} : { providerCode: down.failure.providerCode },
|
|
3239
|
+
...down.failure?.providerTraceId === void 0 ? {} : { providerTraceId: down.failure.providerTraceId }
|
|
3240
|
+
};
|
|
3231
3241
|
if (down.retainedPendingCause !== void 0) {
|
|
3232
3242
|
const retained = retainedFailures[down.retainedPendingCause];
|
|
3233
3243
|
if (down.failure !== void 0 && down.failure.code === retained.code) return {
|
|
@@ -3237,7 +3247,7 @@ function settlementFailureCause(down) {
|
|
|
3237
3247
|
return {
|
|
3238
3248
|
...retained,
|
|
3239
3249
|
cause,
|
|
3240
|
-
...
|
|
3250
|
+
...providerEvidence
|
|
3241
3251
|
};
|
|
3242
3252
|
}
|
|
3243
3253
|
if (down.failure !== void 0 && down.failure.code !== "unknown") return {
|
|
@@ -3250,9 +3260,9 @@ function settlementFailureCause(down) {
|
|
|
3250
3260
|
owner: "work"
|
|
3251
3261
|
} : UNATTRIBUTED,
|
|
3252
3262
|
cause,
|
|
3253
|
-
...
|
|
3263
|
+
...providerEvidence
|
|
3254
3264
|
};
|
|
3255
3265
|
}
|
|
3256
3266
|
export { refreshBudgetLease as $, unavailableSignalOfFailure as A, recordValue as At, runtimeFailureRemediationSchema as B, cappedDoublingMs as C, sameModelId as Ct, reportedResetAt as D, sumSandboxUsage as Dt, printedStatus as E, sandboxTerminalUsageField as Et, contentRef as F, credentialCommandExit as G, turnFailurePolicy as H, executorFailure as I, budgetLeaseUpdates as J, isCredentialRefusal as K, executorFailureInfra as L, TRACE_SUMMARY_SCHEMA as M, traceRootWriter as N, unavailablePauseMs as O, decodeHarnessUsage as Ot, contentAddress as P, createBudgetPool as Q, executorFailureReason as R, UNAVAILABLE_STATUSES as S, notifySandboxEventObserver as St, placementRefusal as T, sandboxEventServedBackend as Tt, turnRemediationOf as U, turnFailureOf as V, hashJson as W, budgetRecoverySeeds as X, budgetLeases as Y, completedLeafBacking as Z, retainedExecutorContext as _, canonicalSandboxUsageMode as _t, settlementFailureCause as a, assertValidSpend as at, RATE_LIMIT_SIGNALS as b, extractLlmCallEvent as bt, DISPATCH_NOT_ADMITTED_CODE as c, mapSandboxToolEvent as ct, executorEvidenceWriter as d, sandboxProgressEvents as dt, meterUsageEvent as et, isProvisioningRefusal as f, terminalTextFromSandboxEvent as ft, registerRetainedExecutorPreparation as g, assertSandboxServedModel as gt, prepareRetainedExecutor as h, parseCanonicalTransportEvent as ht, runtimeProviderCode as i, assertValidBudget as it, TRACE_ROOT_SCHEMA as j, unavailableResumeAt as k, parseCodexUsageRecord as kt, RetainedExecutionPendingError as l, sandboxLeafOutputFromEvents as lt, leafContinuationExecutionId as m, extractTransportEventIdentity as mt, runtimeFailureCause as n, spendFromUsageEvents as nt, BUDGET_CONTINUATION_TASK as o, createSandboxToolPartState as ot, isSchemaRejection as p, canonicalStreamEventFromSandboxEvent as pt, BudgetReconcileFault as q, runtimeFailureCauseSchema as r, spendFromUsageTotals as rt, DISPATCH_EXECUTION_CHANGED_CODE as s, mapSandboxEvent as st, reportedFailureCause as t, newUsageTotals as tt, TRANSPORT_ERROR_CODES as u, sandboxOutputMarker as ut, retainedExecutorSeamKey as v, createSandboxTurnEventCollector as vt, jitteredMs as w, sandboxEventProviderModels as wt, UNAVAILABLE_CODES as x, isSandboxTerminalEvent as xt, PLACEMENT_SIGNALS as y, createSandboxUsageLedger as yt, harnessProcessDied as z };
|
|
3257
3267
|
|
|
3258
|
-
//# sourceMappingURL=failure-cause-
|
|
3268
|
+
//# sourceMappingURL=failure-cause-DeSINrKC.js.map
|