@tangle-network/agent-runtime 9.0.16 → 10.0.1
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 +86 -0
- package/dist/{activation-DgT20fzX.js → activation-C_BenzIu.js} +2 -2
- package/dist/{activation-DgT20fzX.js.map → activation-C_BenzIu.js.map} +1 -1
- package/dist/{activation-y6NAn3sW.d.ts → activation-s6dGGify.d.ts} +7 -8
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/candidate-execution/index.d.ts +3 -0
- package/dist/candidate-execution/index.js +10 -3
- package/dist/candidate-execution/index.js.map +1 -1
- package/dist/{delegate-Cmu5OF3M.js → delegate-BOren4c7.js} +2 -2
- package/dist/{delegate-Cmu5OF3M.js.map → delegate-BOren4c7.js.map} +1 -1
- package/dist/{coordination-manager-CFtnSLPw.js → driver-control-acknowledgers-ByKwAgCI.js} +1062 -1042
- package/dist/driver-control-acknowledgers-ByKwAgCI.js.map +1 -0
- package/dist/durable.d.ts +5 -5
- package/dist/durable.js +13 -13
- package/dist/durable.js.map +1 -1
- package/dist/{failure-cause-WifbY42M.js → failure-cause-DoCCGLDH.js} +42 -18
- package/dist/failure-cause-DoCCGLDH.js.map +1 -0
- package/dist/{graph-DqtIiS94.js → graph-BXONYT1o.js} +8 -8
- package/dist/{graph-DqtIiS94.js.map → graph-BXONYT1o.js.map} +1 -1
- package/dist/{graph-registry-B_1C7qye.js → graph-registry-DxhlgHdA.js} +1 -1
- package/dist/{graph-registry-BbZN5deo.js → graph-registry-j9t9J0KT.js} +11 -12
- package/dist/{graph-registry-BbZN5deo.js.map → graph-registry-j9t9J0KT.js.map} +1 -1
- package/dist/{improve-B0vNv6e7.js → improve-CS2GIF5O.js} +42 -26
- package/dist/{improve-B0vNv6e7.js.map → improve-CS2GIF5O.js.map} +1 -1
- package/dist/index.d.ts +38 -6
- package/dist/index.js +59 -20
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +93 -63
- package/dist/intelligence.js +166 -73
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +16 -15
- package/dist/{loop-runner-CfMOsISJ.d.ts → loop-runner-C0B3PexH.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{loop-runner-BvVdDdZC.js → loop-runner-ftyZP4st.js} +2 -2
- package/dist/{loop-runner-BvVdDdZC.js.map → loop-runner-ftyZP4st.js.map} +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-CZwhXp8O.js → model-policy-CqDuBTq-.js} +12 -2
- package/dist/model-policy-CqDuBTq-.js.map +1 -0
- package/dist/{prepare-Cw4ZaN01.js → prepare-DT-ibRsm.js} +2 -2
- package/dist/{prepare-Cw4ZaN01.js.map → prepare-DT-ibRsm.js.map} +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/{provision-supervisor-BjKluSKl.js → provision-supervisor-CauovUHn.js} +6 -6
- package/dist/{provision-supervisor-BjKluSKl.js.map → provision-supervisor-CauovUHn.js.map} +1 -1
- package/dist/{run-cancellation-BvGEEwRG.js → run-cancellation-NMNVuYiO.js} +2 -2
- package/dist/{run-cancellation-BvGEEwRG.js.map → run-cancellation-NMNVuYiO.js.map} +1 -1
- package/dist/{run-state-Dd_AjWd6.js → run-state-COyIVOVb.js} +5 -5
- package/dist/{run-state-Dd_AjWd6.js.map → run-state-COyIVOVb.js.map} +1 -1
- package/dist/{runtime-7VEM9muH.js → runtime-DYaRDLKn.js} +191 -24
- package/dist/runtime-DYaRDLKn.js.map +1 -0
- package/dist/{search-executor-Dqtm1fOC.js → search-executor-Drd_N9YO.js} +5 -5
- package/dist/{search-executor-Dqtm1fOC.js.map → search-executor-Drd_N9YO.js.map} +1 -1
- package/dist/{server-B8Kmit_v.js → server-Dk9B1WFf.js} +4 -4
- package/dist/{server-B8Kmit_v.js.map → server-Dk9B1WFf.js.map} +1 -1
- package/dist/{settle-record-BvH2-Ao5.js → settle-record-YdkkHzqw.js} +2 -2
- package/dist/{settle-record-BvH2-Ao5.js.map → settle-record-YdkkHzqw.js.map} +1 -1
- package/dist/{structural-rollout-CYc8PE2N.js → structural-rollout-DbZAkHTq.js} +5 -5
- package/dist/{structural-rollout-CYc8PE2N.js.map → structural-rollout-DbZAkHTq.js.map} +1 -1
- package/dist/{supervise-BayNu7qZ.js → supervise-B5hb0my3.js} +2426 -2336
- package/dist/supervise-B5hb0my3.js.map +1 -0
- package/dist/{supervision-discovery-Ca4QO4rG.js → supervision-discovery-ChkTxilL.js} +3 -3
- package/dist/{supervision-discovery-Ca4QO4rG.js.map → supervision-discovery-ChkTxilL.js.map} +1 -1
- package/dist/{supervisor-Bx21Hy27.js → supervisor-DpwcTrTh.js} +437 -75
- package/dist/supervisor-DpwcTrTh.js.map +1 -0
- package/dist/{supervisor-accounting-StDNW1YT.js → supervisor-accounting-QiXnF-EW.js} +541 -344
- package/dist/supervisor-accounting-QiXnF-EW.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{tool-server-CirrqFlr.js → tool-server-DQCdu3am.js} +2 -2
- package/dist/{tool-server-CirrqFlr.js.map → tool-server-DQCdu3am.js.map} +1 -1
- package/dist/{top-web-Cg7ywIkF.js → top-web-E85Fk8pH.js} +6 -6
- package/dist/{top-web-Cg7ywIkF.js.map → top-web-E85Fk8pH.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-_j53efrk.d.ts → types-dv295cpm.d.ts} +9907 -9784
- package/dist/{workspace-streams-BakRr-Pl.js → workspace-streams-C7PGLAUd.js} +3 -3
- package/dist/workspace-streams-C7PGLAUd.js.map +1 -0
- package/package.json +8 -7
- package/dist/coordination-manager-CFtnSLPw.js.map +0 -1
- package/dist/failure-cause-WifbY42M.js.map +0 -1
- package/dist/model-policy-CZwhXp8O.js.map +0 -1
- package/dist/runtime-7VEM9muH.js.map +0 -1
- package/dist/supervise-BayNu7qZ.js.map +0 -1
- package/dist/supervisor-Bx21Hy27.js.map +0 -1
- package/dist/supervisor-accounting-StDNW1YT.js.map +0 -1
- package/dist/workspace-streams-BakRr-Pl.js.map +0 -1
|
@@ -197,6 +197,17 @@ function sandboxEventServedBackend(event) {
|
|
|
197
197
|
return Object.fromEntries(named);
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
|
+
* Read the served models a CLI Bridge provider names on one event, from `provider_models` and
|
|
201
|
+
* `provider_model` only. A chunk's `model` field is never read: Bridge run-event replay and
|
|
202
|
+
* one-shot retained deltas set it to the literal `cli-bridge` (cli-bridge src/routes/runs.ts), so
|
|
203
|
+
* it names the transport, not the served model.
|
|
204
|
+
*/
|
|
205
|
+
function sandboxEventProviderModels(event) {
|
|
206
|
+
const data = recordValue(event?.data);
|
|
207
|
+
const models = [...Array.isArray(data?.provider_models) ? data.provider_models : [], data?.provider_model].filter((model) => typeof model === "string" && model.trim().length > 0);
|
|
208
|
+
return [...new Set(models)];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
200
211
|
* Fail the execution when the platform reports serving a model other than the exact one asked for.
|
|
201
212
|
* Measured motive (agent-runtime#892): 6 of 6 boxes declaring `zai-coding-plan/glm-5.2` reported
|
|
202
213
|
* `deepseek/deepseek-v4-flash` (`source: "environment"`) while the materialization receipt recorded
|
|
@@ -2310,13 +2321,27 @@ function jsonContentText(value) {
|
|
|
2310
2321
|
return str;
|
|
2311
2322
|
}
|
|
2312
2323
|
// src/runtime/supervise/executor-outcome.ts
|
|
2324
|
+
/** @internal Canonical producer-supplied remediation, shared by transport and read models. */
|
|
2325
|
+
const runtimeFailureRemediationSchema = z.object({
|
|
2326
|
+
cause: z.enum([
|
|
2327
|
+
"api_key_selected",
|
|
2328
|
+
"provider_unresolved",
|
|
2329
|
+
"subscription_unverified",
|
|
2330
|
+
"not_authenticated"
|
|
2331
|
+
]),
|
|
2332
|
+
fix: z.string().min(1).max(256),
|
|
2333
|
+
harness: z.string().min(1).max(64),
|
|
2334
|
+
provider: z.string().min(1).max(128).nullable()
|
|
2335
|
+
});
|
|
2313
2336
|
const outcomeSchema = AgentTurnResultSchema.pick({
|
|
2314
2337
|
success: true,
|
|
2315
2338
|
error: true,
|
|
2316
2339
|
failure: true
|
|
2317
2340
|
}).extend({
|
|
2318
2341
|
errorCode: AgentTurnResultSchema.shape.error,
|
|
2319
|
-
statusCode: z.number().int().min(400).max(599).optional()
|
|
2342
|
+
statusCode: z.number().int().min(400).max(599).optional(),
|
|
2343
|
+
remediation: runtimeFailureRemediationSchema.readonly().optional(),
|
|
2344
|
+
resetAt: z.string().datetime({ offset: true }).optional()
|
|
2320
2345
|
}).strict();
|
|
2321
2346
|
/** Read only the executor envelope; application output and grades are not execution status. */
|
|
2322
2347
|
function executorFailure(result) {
|
|
@@ -2327,7 +2352,9 @@ function executorFailure(result) {
|
|
|
2327
2352
|
error: outcome.error ?? "Agent execution failed",
|
|
2328
2353
|
...outcome.failure === void 0 ? {} : { failure: outcome.failure },
|
|
2329
2354
|
...outcome.errorCode === void 0 ? {} : { errorCode: outcome.errorCode },
|
|
2330
|
-
...outcome.statusCode === void 0 ? {} : { statusCode: outcome.statusCode }
|
|
2355
|
+
...outcome.statusCode === void 0 ? {} : { statusCode: outcome.statusCode },
|
|
2356
|
+
...outcome.remediation === void 0 ? {} : { remediation: outcome.remediation },
|
|
2357
|
+
...outcome.resetAt === void 0 ? {} : { resetAt: outcome.resetAt }
|
|
2331
2358
|
};
|
|
2332
2359
|
}
|
|
2333
2360
|
/** The failure text alone, for callers that record a settlement reason. */
|
|
@@ -2373,6 +2400,13 @@ function turnFailureOf(value) {
|
|
|
2373
2400
|
if (parsed.success) return parsed.data;
|
|
2374
2401
|
} catch {}
|
|
2375
2402
|
}
|
|
2403
|
+
/** The producer's structured subscription remedy in a failure chain; message text is never read. */
|
|
2404
|
+
function turnRemediationOf(value) {
|
|
2405
|
+
for (const link of causeChain(value)) try {
|
|
2406
|
+
const parsed = runtimeFailureRemediationSchema.readonly().safeParse(Reflect.get(link, "remediation"));
|
|
2407
|
+
if (parsed.success) return parsed.data;
|
|
2408
|
+
} catch {}
|
|
2409
|
+
}
|
|
2376
2410
|
const PLATFORM_FAILURE_CODES = new Set([
|
|
2377
2411
|
"QUOTA_EXCEEDED",
|
|
2378
2412
|
"provider_quota_exceeded",
|
|
@@ -2739,6 +2773,7 @@ function executorEvidenceWriter(args) {
|
|
|
2739
2773
|
await args.journal.appendEvent(args.rootId, {
|
|
2740
2774
|
kind: "execution-evidence",
|
|
2741
2775
|
id: args.nodeId,
|
|
2776
|
+
...args.attemptId === void 0 ? {} : { attemptId: args.attemptId },
|
|
2742
2777
|
outRef,
|
|
2743
2778
|
...traceRoot === void 0 ? {} : { traceRoot },
|
|
2744
2779
|
seq: args.nextSequence(),
|
|
@@ -2946,18 +2981,6 @@ function prepareRetainedExecutor(factory, input) {
|
|
|
2946
2981
|
// src/runtime/failure-cause.ts
|
|
2947
2982
|
const MAX_CAUSE_CHARS = 2048;
|
|
2948
2983
|
const MACHINE_CODE_PATTERN = /^[A-Za-z][A-Za-z0-9_.-]{0,63}$/u;
|
|
2949
|
-
/** @internal Canonical producer-supplied remediation, shared by transport and read models. */
|
|
2950
|
-
const runtimeFailureRemediationSchema = z.object({
|
|
2951
|
-
cause: z.enum([
|
|
2952
|
-
"api_key_selected",
|
|
2953
|
-
"provider_unresolved",
|
|
2954
|
-
"subscription_unverified",
|
|
2955
|
-
"not_authenticated"
|
|
2956
|
-
]),
|
|
2957
|
-
fix: z.string().min(1).max(256),
|
|
2958
|
-
harness: z.string().min(1).max(64),
|
|
2959
|
-
provider: z.string().min(1).max(128).nullable()
|
|
2960
|
-
});
|
|
2961
2984
|
/** @internal Validate Runtime-owned failure values on observation transports. */
|
|
2962
2985
|
const runtimeFailureCauseSchema = z.object({
|
|
2963
2986
|
code: z.enum([
|
|
@@ -3119,7 +3142,7 @@ function runtimeFailureCause(error, context = {}) {
|
|
|
3119
3142
|
const links = causeChain(error);
|
|
3120
3143
|
const providerCode = upstreamMachineCode(links);
|
|
3121
3144
|
const upstream = links.find((link) => link instanceof BackendTransportError && link.backend === "bridge" && link.status === 403 && link.upstreamCode === "subscription_required" && link.providerDispatch === "not_started");
|
|
3122
|
-
const remedy = runtimeFailureRemediationSchema.readonly().safeParse(upstream?.remediation);
|
|
3145
|
+
const remedy = runtimeFailureRemediationSchema.readonly().safeParse(upstream?.remediation ?? turnRemediationOf(error));
|
|
3123
3146
|
const failure = ({ code, owner }) => ({
|
|
3124
3147
|
code,
|
|
3125
3148
|
owner,
|
|
@@ -3176,7 +3199,8 @@ function reportedFailureCause(outcome) {
|
|
|
3176
3199
|
return runtimeFailureCause(Object.assign(new Error(outcome.error ?? "execution reported a failure"), {
|
|
3177
3200
|
errorCode: outcome.errorCode,
|
|
3178
3201
|
statusCode: outcome.statusCode,
|
|
3179
|
-
failure: outcome.failure
|
|
3202
|
+
failure: outcome.failure,
|
|
3203
|
+
remediation: outcome.remediation
|
|
3180
3204
|
}));
|
|
3181
3205
|
}
|
|
3182
3206
|
/**
|
|
@@ -3213,6 +3237,6 @@ function settlementFailureCause(down) {
|
|
|
3213
3237
|
...down.failure?.providerCode === void 0 ? {} : { providerCode: down.failure.providerCode }
|
|
3214
3238
|
};
|
|
3215
3239
|
}
|
|
3216
|
-
export {
|
|
3240
|
+
export { newUsageTotals as $, TRACE_SUMMARY_SCHEMA as A, turnFailurePolicy as B, jitteredMs as C, sandboxEventServedBackend as Ct, unavailableResumeAt as D, parseCodexUsageRecord as Dt, unavailablePauseMs as E, decodeHarnessUsage as Et, executorFailureInfra as F, BudgetReconcileFault as G, hashJson as H, executorFailureReason as I, budgetRecoverySeeds as J, budgetLeaseUpdates as K, harnessProcessDied as L, contentAddress as M, contentRef as N, unavailableSignalOfFailure as O, recordValue as Ot, executorFailure as P, meterUsageEvent as Q, runtimeFailureRemediationSchema as R, cappedDoublingMs as S, sandboxEventProviderModels as St, reportedResetAt as T, sumSandboxUsage as Tt, credentialCommandExit as U, turnRemediationOf as V, isCredentialRefusal as W, createBudgetPool as X, completedLeafBacking as Y, refreshBudgetLease as Z, retainedExecutorContext as _, createSandboxUsageLedger as _t, settlementFailureCause as a, mapSandboxEvent as at, UNAVAILABLE_CODES as b, notifySandboxEventObserver as bt, DISPATCH_NOT_ADMITTED_CODE as c, sandboxOutputMarker as ct, executorEvidenceWriter as d, canonicalStreamEventFromSandboxEvent as dt, spendFromUsageEvents as et, isProvisioningRefusal as f, extractTransportEventIdentity as ft, registerRetainedExecutorPreparation as g, createSandboxTurnEventCollector as gt, prepareRetainedExecutor as h, canonicalSandboxUsageMode as ht, runtimeProviderCode as i, createSandboxToolPartState as it, traceRootWriter as j, TRACE_ROOT_SCHEMA as k, RetainedExecutionPendingError as l, sandboxProgressEvents as lt, leafContinuationExecutionId as m, assertSandboxServedModel as mt, runtimeFailureCause as n, assertValidBudget as nt, BUDGET_CONTINUATION_TASK as o, mapSandboxToolEvent as ot, isSchemaRejection as p, parseCanonicalTransportEvent as pt, budgetLeases as q, runtimeFailureCauseSchema as r, assertValidSpend as rt, DISPATCH_EXECUTION_CHANGED_CODE as s, sandboxLeafOutputFromEvents as st, reportedFailureCause as t, spendFromUsageTotals as tt, TRANSPORT_ERROR_CODES as u, terminalTextFromSandboxEvent as ut, retainedExecutorSeamKey as v, extractLlmCallEvent as vt, printedStatus as w, sandboxTerminalUsageField as wt, UNAVAILABLE_STATUSES as x, sameModelId as xt, RATE_LIMIT_SIGNALS as y, isSandboxTerminalEvent as yt, turnFailureOf as z };
|
|
3217
3241
|
|
|
3218
|
-
//# sourceMappingURL=failure-cause-
|
|
3242
|
+
//# sourceMappingURL=failure-cause-DoCCGLDH.js.map
|