@tangle-network/agent-runtime 0.143.0 → 0.153.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/README.md +32 -0
- package/dist/{activation-mi8TgSLM.js → activation-DKxQsHiO.js} +3 -3
- package/dist/{activation-mi8TgSLM.js.map → activation-DKxQsHiO.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{analyst-loop-CvkmfhUB.js → analyst-loop-B2kTHKNh.js} +2 -2
- package/dist/{analyst-loop-CvkmfhUB.js.map → analyst-loop-B2kTHKNh.js.map} +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/{authoring-DuyShLdw.js → authoring-Tk2xFys0.js} +2 -2
- package/dist/{authoring-DuyShLdw.js.map → authoring-Tk2xFys0.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-CD5PoNmC.js → candidate-execution-CB9RJbbJ.js} +4 -4
- package/dist/{candidate-execution-CD5PoNmC.js.map → candidate-execution-CB9RJbbJ.js.map} +1 -1
- package/dist/{conversation-1hNtDeMM.js → conversation-D64WyWrK.js} +4 -4
- package/dist/{conversation-1hNtDeMM.js.map → conversation-D64WyWrK.js.map} +1 -1
- package/dist/conversation.d.ts +1 -1
- package/dist/conversation.js +1 -1
- package/dist/durable.d.ts +102 -4
- package/dist/durable.js +259 -10
- package/dist/durable.js.map +1 -1
- package/dist/{environment-provider-B8eZ85Ga.d.ts → environment-provider-DJG0yIYl.d.ts} +2 -2
- package/dist/{environment-provider-DCBJ13VP.js → environment-provider-D_MXw3jK.js} +88 -9
- package/dist/environment-provider-D_MXw3jK.js.map +1 -0
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/executable-spec-BUcUcEPk.js +73 -0
- package/dist/executable-spec-BUcUcEPk.js.map +1 -0
- package/dist/{graph-De_XEsfH.js → graph-M0Qr4863.js} +4 -4
- package/dist/{graph-De_XEsfH.js.map → graph-M0Qr4863.js.map} +1 -1
- package/dist/{improvement-cycle-Bi-Tf4QF.js → improvement-cycle-CDxlGQGE.js} +7 -7
- package/dist/{improvement-cycle-Bi-Tf4QF.js.map → improvement-cycle-CDxlGQGE.js.map} +1 -1
- package/dist/{index-B8rKtH3U.d.ts → index-BihHgUAI.d.ts} +4 -4
- package/dist/{index-C2caGomG.d.ts → index-Dlz7ejRx.d.ts} +339 -503
- package/dist/{index-D4sLkOPY.d.ts → index-LQfgFJoX.d.ts} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +13 -13
- package/dist/intelligence.d.ts +4 -4
- package/dist/intelligence.js +6 -6
- package/dist/kernel.d.ts +6 -6
- package/dist/kernel.js +13 -13
- package/dist/{knowledge-CVE6Wk1i.js → knowledge-DM-i40b9.js} +10 -7
- package/dist/{knowledge-CVE6Wk1i.js.map → knowledge-DM-i40b9.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-BoHdQqLm.d.ts → loop-runner-bin-D-BW51yr.d.ts} +3 -3
- package/dist/{loop-runner-bin-DdaI1nLL.js → loop-runner-bin-pD5WJuqJ.js} +4 -4
- package/dist/{loop-runner-bin-DdaI1nLL.js.map → loop-runner-bin-pD5WJuqJ.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{materialization-P86EciBw.js → materialization-Bo6j3Hg9.js} +257 -61
- package/dist/materialization-Bo6j3Hg9.js.map +1 -0
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +6 -6
- package/dist/{model-policy-DgRJIJse.js → model-policy-Sw4ywhtL.js} +68 -6
- package/dist/model-policy-Sw4ywhtL.js.map +1 -0
- package/dist/{openai-tools-BiAWKjh6.js → openai-tools-CWBywy-e.js} +2 -2
- package/dist/{openai-tools-BiAWKjh6.js.map → openai-tools-CWBywy-e.js.map} +1 -1
- package/dist/{prepare-D3n7cA39.js → prepare-C3eFd3UA.js} +2 -2
- package/dist/{prepare-D3n7cA39.js.map → prepare-C3eFd3UA.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/{protected-model-port-bq6bD9YX.js → protected-model-port-Dn2b6peS.js} +2 -2
- package/dist/{protected-model-port-bq6bD9YX.js.map → protected-model-port-Dn2b6peS.js.map} +1 -1
- package/dist/{redact-DexTuAiX.d.ts → redact-NAptmqKw.d.ts} +3 -3
- package/dist/{researcher-CiSY6Wzb.js → researcher-BMFFPwKb.js} +2 -2
- package/dist/{researcher-CiSY6Wzb.js.map → researcher-BMFFPwKb.js.map} +1 -1
- package/dist/{run-layout-Be_Z0dF8.js → run-layout-C2jgwsCq.js} +111 -6
- package/dist/run-layout-C2jgwsCq.js.map +1 -0
- package/dist/{runtime-J6Toky8K.d.ts → runtime-B-5dp5Iz.d.ts} +214 -14
- package/dist/{runtime-BnqjbOGX.js → runtime-RY_rvv7t.js} +85 -82
- package/dist/runtime-RY_rvv7t.js.map +1 -0
- package/dist/{sandbox-events-COwCWUVB.js → sandbox-events-DMijDq2p.js} +49 -2
- package/dist/sandbox-events-DMijDq2p.js.map +1 -0
- package/dist/{spawn-journal-D2HKUImC.js → spawn-journal-CLguaA2A.js} +8 -43
- package/dist/spawn-journal-CLguaA2A.js.map +1 -0
- package/dist/{stream-agent-turn-C1Vs_3B9.d.ts → stream-agent-turn-BGyszuPH.d.ts} +2 -2
- package/dist/{stream-agent-turn-CXRugSGO.js → stream-agent-turn-D6HoaRPV.js} +90 -14
- package/dist/stream-agent-turn-D6HoaRPV.js.map +1 -0
- package/dist/{structural-rollout-CJgj9YXH.js → structural-rollout-P1YxFRfl.js} +11 -8
- package/dist/structural-rollout-P1YxFRfl.js.map +1 -0
- package/dist/{supervise-hCgG6ROJ.js → supervise-BezbzKiJ.js} +1550 -1186
- package/dist/supervise-BezbzKiJ.js.map +1 -0
- package/dist/{supervisor-s8SfZYbW.js → supervisor-DBVlPONC.js} +597 -194
- package/dist/supervisor-DBVlPONC.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/{top-app-BMOSKK06.js → top-app-tKo9OrON.js} +189 -86
- package/dist/top-app-tKo9OrON.js.map +1 -0
- package/dist/tui/bin.js +1 -1
- package/dist/tui/index.d.ts +32 -4
- package/dist/tui/index.js +1 -1
- package/dist/{types-Df9vulGc.d.ts → types-BPQhQRrC.d.ts} +507 -10
- package/dist/{util-C1bv6yog.js → util-Bncw0o_F.js} +41 -2
- package/dist/util-Bncw0o_F.js.map +1 -0
- package/dist/{workspace-archive-C52LjkeN.js → workspace-archive-Dm73lTfB.js} +2 -2
- package/dist/{workspace-archive-C52LjkeN.js.map → workspace-archive-Dm73lTfB.js.map} +1 -1
- package/package.json +4 -4
- package/dist/environment-provider-DCBJ13VP.js.map +0 -1
- package/dist/materialization-P86EciBw.js.map +0 -1
- package/dist/model-policy-DgRJIJse.js.map +0 -1
- package/dist/retained-run-binding-Dp2e8xne.js +0 -268
- package/dist/retained-run-binding-Dp2e8xne.js.map +0 -1
- package/dist/run-layout-Be_Z0dF8.js.map +0 -1
- package/dist/runtime-BnqjbOGX.js.map +0 -1
- package/dist/sandbox-events-COwCWUVB.js.map +0 -1
- package/dist/spawn-journal-D2HKUImC.js.map +0 -1
- package/dist/stream-agent-turn-CXRugSGO.js.map +0 -1
- package/dist/structural-rollout-CJgj9YXH.js.map +0 -1
- package/dist/supervise-hCgG6ROJ.js.map +0 -1
- package/dist/supervisor-s8SfZYbW.js.map +0 -1
- package/dist/top-app-BMOSKK06.js.map +0 -1
- package/dist/util-C1bv6yog.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as assertInteractionBinding, B as exactControlRef, D as assertBoundaryBinding, E as abortError, F as awaitAbortable, G as hasDurableCancel, H as exactSessionCancel, I as cancellationRequest, J as freshTurnInput, K as isTerminalSessionStatus, L as copyControlRef, M as assertSequence, N as assertStableText, O as assertCanonicalEventBinding, P as assertWaitDuration, R as delay, T as RetainedRunProviderContractError, U as exactSessionResult, V as exactSession, W as freezeControlRef, j as assertResultBinding, k as assertEventBinding, q as sameControlCoordinates, z as exactContinuedControlRef } from "./materialization-Bo6j3Hg9.js";
|
|
2
2
|
import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBindingError, l as RetainedInteractiveBindingError, m as ValidationError, n as AnalystError, s as PlannerError, u as RetainedRunAdmissionError } from "./errors-CDZ8XsVj.js";
|
|
3
|
-
import "./stream-agent-turn-
|
|
3
|
+
import "./stream-agent-turn-D6HoaRPV.js";
|
|
4
4
|
import { t as detachedSnapshot } from "./snapshot-cK9K420n.js";
|
|
5
|
-
import { S as contentAddress, i as InMemorySpawnJournal, r as InMemoryResultBlobStore, y as isTraceAnalysisStore } from "./spawn-journal-
|
|
6
|
-
import {
|
|
5
|
+
import { S as contentAddress, i as InMemorySpawnJournal, r as InMemoryResultBlobStore, y as isTraceAnalysisStore } from "./spawn-journal-CLguaA2A.js";
|
|
6
|
+
import { c as isAbortError, d as randomSuffix, i as cloneSpend, m as stringifySafe, p as sleep, r as chargedTokens, s as hasCompleteCacheBreakdown, t as addSpend, v as zeroSpend } from "./util-Bncw0o_F.js";
|
|
7
7
|
import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction--F3v1oo8.js";
|
|
8
|
-
import { d as
|
|
9
|
-
import {
|
|
10
|
-
import { c as
|
|
11
|
-
import { E as rollingDispatch,
|
|
12
|
-
import "./environment-provider-
|
|
8
|
+
import { d as extractTransportEventIdentity, f as parseCanonicalTransportEvent, s as notifySandboxEventObserver } from "./sandbox-events-DMijDq2p.js";
|
|
9
|
+
import { n as executableAgentSpecSnapshot, t as executableAgentProfileSnapshot } from "./executable-spec-BUcUcEPk.js";
|
|
10
|
+
import { c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, t as assertExecutableAgentProfile } from "./model-policy-Sw4ywhtL.js";
|
|
11
|
+
import { B as createExecutorRegistry, E as rollingDispatch, H as createWorktreeCliExecutor, X as createPushTraceSource, _t as probeSandboxCapabilities, bt as runBrainLoop, g as settledToIteration, gt as createSandboxLineage, ht as runAgentRounds, l as withDriverExecutor, n as createSupervisor, pt as defaultSelectWinner, xt as canonicalObservedModel, yt as routerBrain, z as createExecutor } from "./supervisor-DBVlPONC.js";
|
|
12
|
+
import "./environment-provider-D_MXw3jK.js";
|
|
13
13
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
|
|
14
|
-
import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-
|
|
15
|
-
import {
|
|
16
|
-
import "./authoring-
|
|
17
|
-
import "./graph-
|
|
14
|
+
import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-P1YxFRfl.js";
|
|
15
|
+
import { At as mapExecutorResult, kt as gateOnDeliverable, n as supervise } from "./supervise-BezbzKiJ.js";
|
|
16
|
+
import "./authoring-Tk2xFys0.js";
|
|
17
|
+
import "./graph-M0Qr4863.js";
|
|
18
18
|
import { AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentTurnResultSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionControlClaimRequestDigest, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, exactAgentInteractiveSessionStart, nativeContextContinuationTurnDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
19
|
-
import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
|
|
19
|
+
import { CODING_HARNESSES, DEFAULT_TRACE_ANALYST_KINDS, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
|
|
20
20
|
import { heldoutSignificance, runProfileMatrix } from "@tangle-network/agent-eval/campaign";
|
|
21
|
-
import { createHash } from "node:crypto";
|
|
21
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
22
22
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
23
23
|
import { mkdir, readFile, realpath, writeFile } from "node:fs/promises";
|
|
24
24
|
import { appendFileSync, chmodSync, constants, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
@@ -1390,7 +1390,7 @@ function localSandboxClient(opts) {
|
|
|
1390
1390
|
routerKey: router.key,
|
|
1391
1391
|
model,
|
|
1392
1392
|
...settings.retry !== void 0 ? { retry: settings.retry } : {},
|
|
1393
|
-
...settings.
|
|
1393
|
+
...enforceTokenLimits(settings.tokenLimits, "router", "localSandboxClient").applied,
|
|
1394
1394
|
...settings.stream !== void 0 ? { stream: settings.stream } : {}
|
|
1395
1395
|
}, {
|
|
1396
1396
|
...settings.temperature !== void 0 ? { temperature: settings.temperature } : {},
|
|
@@ -3074,7 +3074,7 @@ async function trajectoryReport(journal, blobs, root, options = {}) {
|
|
|
3074
3074
|
const events = await journal.loadTree(root);
|
|
3075
3075
|
if (events === void 0) throw new Error(`trajectoryReport: no journaled tree for root '${root}'`);
|
|
3076
3076
|
const spawns = events.filter(isNodeCreation).sort(bySeq);
|
|
3077
|
-
const closes = events.filter((ev) => ev.kind !== "spawned" && ev.kind !== "waiting" && ev.kind !== "metered" && ev.kind !== "materialized" && ev.kind !== "execution-bound" && ev.kind !== "edge" && ev.kind !== "trace-unpropagated").sort(bySeq);
|
|
3077
|
+
const closes = events.filter((ev) => ev.kind !== "spawned" && ev.kind !== "waiting" && ev.kind !== "metered" && ev.kind !== "materialized" && ev.kind !== "execution-bound" && ev.kind !== "edge" && ev.kind !== "teardown-unconfirmed" && ev.kind !== "trace-unpropagated").sort(bySeq);
|
|
3078
3078
|
const nodes = /* @__PURE__ */ new Map();
|
|
3079
3079
|
for (const ev of spawns) nodes.set(ev.id, {
|
|
3080
3080
|
id: ev.id,
|
|
@@ -3104,7 +3104,7 @@ async function trajectoryReport(journal, blobs, root, options = {}) {
|
|
|
3104
3104
|
for (const ev of events) {
|
|
3105
3105
|
if (ev.kind !== "metered") continue;
|
|
3106
3106
|
const node = requireNode(nodes, ev.id, root);
|
|
3107
|
-
node.ownSpend =
|
|
3107
|
+
node.ownSpend = addSpend(node.ownSpend, ev.spend);
|
|
3108
3108
|
}
|
|
3109
3109
|
if (!nodes.has(root)) throw new Error(`trajectoryReport: root '${root}' has no spawned event in its journaled tree (corrupted log)`);
|
|
3110
3110
|
for (const ev of spawns) {
|
|
@@ -3181,8 +3181,8 @@ function rollUpSpend(nodes, root) {
|
|
|
3181
3181
|
});
|
|
3182
3182
|
continue;
|
|
3183
3183
|
}
|
|
3184
|
-
|
|
3185
|
-
for (const child of node.children) addSpend(sum, requireSpend(rolled, child, root));
|
|
3184
|
+
let sum = cloneSpend(node.ownSpend);
|
|
3185
|
+
for (const child of node.children) sum = addSpend(sum, requireSpend(rolled, child, root));
|
|
3186
3186
|
rolled.set(frame.id, sum);
|
|
3187
3187
|
}
|
|
3188
3188
|
return rolled;
|
|
@@ -3226,51 +3226,6 @@ function countStatuses(reported) {
|
|
|
3226
3226
|
for (const node of reported) counts[node.status] += 1;
|
|
3227
3227
|
return counts;
|
|
3228
3228
|
}
|
|
3229
|
-
function zeroSpend() {
|
|
3230
|
-
return {
|
|
3231
|
-
iterations: 0,
|
|
3232
|
-
tokens: zeroTokenUsage(),
|
|
3233
|
-
usd: 0,
|
|
3234
|
-
ms: 0
|
|
3235
|
-
};
|
|
3236
|
-
}
|
|
3237
|
-
/** Add a `metered` event's spend onto a node's accumulated ownSpend (per channel). */
|
|
3238
|
-
function addNodeSpend(a, b) {
|
|
3239
|
-
return {
|
|
3240
|
-
iterations: a.iterations + b.iterations,
|
|
3241
|
-
tokens: (() => {
|
|
3242
|
-
const tokens = cloneTokenUsage(a.tokens);
|
|
3243
|
-
addTokenUsage(tokens, b.tokens);
|
|
3244
|
-
return tokens;
|
|
3245
|
-
})(),
|
|
3246
|
-
...a.tokensKnown === false || b.tokensKnown === false ? { tokensKnown: false } : {},
|
|
3247
|
-
usd: a.usd + b.usd,
|
|
3248
|
-
...a.usdKnown === false || b.usdKnown === false ? { usdKnown: false } : {},
|
|
3249
|
-
...usdEstimatedOf(a, b),
|
|
3250
|
-
ms: a.ms + b.ms
|
|
3251
|
-
};
|
|
3252
|
-
}
|
|
3253
|
-
function cloneSpend(spend) {
|
|
3254
|
-
return {
|
|
3255
|
-
iterations: spend.iterations,
|
|
3256
|
-
tokens: cloneTokenUsage(spend.tokens),
|
|
3257
|
-
...spend.tokensKnown === false ? { tokensKnown: false } : {},
|
|
3258
|
-
usd: spend.usd,
|
|
3259
|
-
...spend.usdKnown === false ? { usdKnown: false } : {},
|
|
3260
|
-
...spend.usdEstimated !== void 0 ? { usdEstimated: spend.usdEstimated } : {},
|
|
3261
|
-
ms: spend.ms
|
|
3262
|
-
};
|
|
3263
|
-
}
|
|
3264
|
-
/** Add `delta` into `acc` in place across every conserved channel. */
|
|
3265
|
-
function addSpend(acc, delta) {
|
|
3266
|
-
acc.iterations += delta.iterations;
|
|
3267
|
-
addTokenUsage(acc.tokens, delta.tokens);
|
|
3268
|
-
if (delta.tokensKnown === false) acc.tokensKnown = false;
|
|
3269
|
-
acc.usd += delta.usd;
|
|
3270
|
-
if (delta.usdKnown === false) acc.usdKnown = false;
|
|
3271
|
-
if (delta.usdEstimated !== void 0) acc.usdEstimated = (acc.usdEstimated ?? 0) + delta.usdEstimated;
|
|
3272
|
-
acc.ms += delta.ms;
|
|
3273
|
-
}
|
|
3274
3229
|
function spreadOf(values) {
|
|
3275
3230
|
if (values.length === 0) return 0;
|
|
3276
3231
|
return Math.max(...values) - Math.min(...values);
|
|
@@ -4069,11 +4024,26 @@ async function dispatchRetainedRun(options) {
|
|
|
4069
4024
|
sessionId: identity.sessionId,
|
|
4070
4025
|
executionId: identity.executionId
|
|
4071
4026
|
});
|
|
4072
|
-
const
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4027
|
+
const destroyIfCreated = async (cause) => {
|
|
4028
|
+
if (environment.creation !== "created") throw cause;
|
|
4029
|
+
try {
|
|
4030
|
+
await environment.destroy?.();
|
|
4031
|
+
} catch (cleanupError) {
|
|
4032
|
+
throw new AggregateError([cause, cleanupError], "retained run dispatch failed and the environment it created could not be destroyed");
|
|
4033
|
+
}
|
|
4034
|
+
throw cause;
|
|
4035
|
+
};
|
|
4036
|
+
let reference;
|
|
4037
|
+
try {
|
|
4038
|
+
reference = await environment.dispatch(freshTurnInput(options.turn, {
|
|
4039
|
+
turnId: options.turn.turnId,
|
|
4040
|
+
detach: true,
|
|
4041
|
+
...identity
|
|
4042
|
+
}));
|
|
4043
|
+
} catch (error) {
|
|
4044
|
+
await destroyIfCreated(error);
|
|
4045
|
+
throw error;
|
|
4046
|
+
}
|
|
4077
4047
|
let exact;
|
|
4078
4048
|
try {
|
|
4079
4049
|
if (reference.provider !== void 0 && reference.provider !== options.provider.name) throw new Error("provider dispatch returned a session reference for another provider");
|
|
@@ -4086,7 +4056,7 @@ async function dispatchRetainedRun(options) {
|
|
|
4086
4056
|
if (controlRef.executionId !== identity.executionId) throw new Error("provider bound another execution than the requested identity");
|
|
4087
4057
|
exact = exactSession(environment, controlRef);
|
|
4088
4058
|
} catch (error) {
|
|
4089
|
-
|
|
4059
|
+
const bindingError = new RetainedRunDispatchBindingError({
|
|
4090
4060
|
provider: options.provider.name,
|
|
4091
4061
|
environmentId: environment.id,
|
|
4092
4062
|
sessionId: identity.sessionId,
|
|
@@ -4096,6 +4066,8 @@ async function dispatchRetainedRun(options) {
|
|
|
4096
4066
|
...reference.provider === void 0 ? {} : { provider: reference.provider },
|
|
4097
4067
|
...reference.controlRef === void 0 ? {} : { controlRef: reference.controlRef }
|
|
4098
4068
|
}, { cause: error });
|
|
4069
|
+
await destroyIfCreated(bindingError);
|
|
4070
|
+
throw bindingError;
|
|
4099
4071
|
}
|
|
4100
4072
|
await admitDurably(options.onAdmission, {
|
|
4101
4073
|
phase: "dispatched",
|
|
@@ -4676,13 +4648,13 @@ async function runBenchmark(cfg) {
|
|
|
4676
4648
|
resolved: false,
|
|
4677
4649
|
progression: [],
|
|
4678
4650
|
usd: 0,
|
|
4679
|
-
usdKnown:
|
|
4651
|
+
usdKnown: false,
|
|
4680
4652
|
ms: 0,
|
|
4681
4653
|
tokens: {
|
|
4682
4654
|
input: 0,
|
|
4683
4655
|
output: 0
|
|
4684
4656
|
},
|
|
4685
|
-
tokensKnown:
|
|
4657
|
+
tokensKnown: false
|
|
4686
4658
|
};
|
|
4687
4659
|
}
|
|
4688
4660
|
row = {
|
|
@@ -6291,6 +6263,43 @@ function traceSurfaceCalls(base) {
|
|
|
6291
6263
|
traceSource: trace.source
|
|
6292
6264
|
};
|
|
6293
6265
|
}
|
|
6266
|
+
/**
|
|
6267
|
+
* Adapt an `agent-eval` `AnalystRegistry` into the lens shape `supervise({ analysts })` takes.
|
|
6268
|
+
*
|
|
6269
|
+
* The two registries were never structurally compatible: eval's class exposes `list()` and
|
|
6270
|
+
* `run(runId, inputs, opts)` and returns an `AnalystRunResult`, while `supervise` wants `kinds`
|
|
6271
|
+
* and `run(kindId, trace)`. So `'kinds' in buildDefaultAnalystRegistry()` is `false` and the five
|
|
6272
|
+
* calibrated lenses in `DEFAULT_TRACE_ANALYST_KINDS` were unreachable from any supervised run —
|
|
6273
|
+
* every consumer hand-rolled a lens instead (#630).
|
|
6274
|
+
*
|
|
6275
|
+
* The adapter lives HERE, not in eval, for one reason: eval must never import runtime, and runtime
|
|
6276
|
+
* already owns both shapes — it consumes `AnalystFinding` / `AnalystRunResult` from eval for its
|
|
6277
|
+
* analyst loop and defines the supervise lens itself. Writing it in eval would mean eval declaring
|
|
6278
|
+
* a duck-typed copy of a type this package already exports.
|
|
6279
|
+
*
|
|
6280
|
+
* `kinds` is the DEFINITION list, not `registry.list()`, because `Analyst` carries no `area` while
|
|
6281
|
+
* `TraceAnalystDefinition` does — `list()` cannot supply the field the lens shape requires. Every
|
|
6282
|
+
* id must be registered: an unknown kind throws at adapt time rather than returning nothing at run
|
|
6283
|
+
* time, when the driver would read the silence as "no findings".
|
|
6284
|
+
*/
|
|
6285
|
+
function analystsFromRegistry(registry, kinds = DEFAULT_TRACE_ANALYST_KINDS, opts) {
|
|
6286
|
+
const registered = new Set(registry.list().map((analyst) => analyst.id));
|
|
6287
|
+
const missing = kinds.map((kind) => kind.id).filter((id) => !registered.has(id));
|
|
6288
|
+
if (missing.length > 0) throw new ValidationError(`analystsFromRegistry: ${missing.map((id) => JSON.stringify(id)).join(", ")} ${missing.length === 1 ? "is" : "are"} not registered; the registry has ${[...registered].map((id) => JSON.stringify(id)).join(", ") || "<none>"}`);
|
|
6289
|
+
return {
|
|
6290
|
+
kinds: kinds.map((kind) => ({
|
|
6291
|
+
id: kind.id,
|
|
6292
|
+
description: kind.description,
|
|
6293
|
+
area: kind.area
|
|
6294
|
+
})),
|
|
6295
|
+
run: async (kindId, trace) => {
|
|
6296
|
+
return (await registry.run(`supervise-analyst-${kindId}-${randomUUID()}`, { traceStore: trace }, {
|
|
6297
|
+
...opts?.runOpts,
|
|
6298
|
+
only: [kindId]
|
|
6299
|
+
})).findings;
|
|
6300
|
+
}
|
|
6301
|
+
};
|
|
6302
|
+
}
|
|
6294
6303
|
/** The default self-improvement LENS — authored content, not a code path. On each settled worker it hands
|
|
6295
6304
|
* the driver the still-FAILING tests (not just a score), so the next spawn targets the persistently-hard
|
|
6296
6305
|
* cases. Swap `analysts` to change what the driver improves from — that's the one knob. */
|
|
@@ -6431,7 +6440,7 @@ async function superviseSurface(profile, task, opts) {
|
|
|
6431
6440
|
maxIterations: (innerTurns + 2) * 5 + 16,
|
|
6432
6441
|
maxTokens: 1e9
|
|
6433
6442
|
};
|
|
6434
|
-
const workerMaxTokens =
|
|
6443
|
+
const workerMaxTokens = Math.max(1, Math.floor(budget.maxTokens / 8));
|
|
6435
6444
|
const makeWorkerAgent = (rawProfile) => {
|
|
6436
6445
|
const p = rawProfile ?? {};
|
|
6437
6446
|
return {
|
|
@@ -6476,12 +6485,6 @@ async function superviseSurface(profile, task, opts) {
|
|
|
6476
6485
|
completions: sp.iterations
|
|
6477
6486
|
};
|
|
6478
6487
|
}
|
|
6479
|
-
function profileMaxTokens(profile) {
|
|
6480
|
-
const value = profile.model?.metadata?.maxTokens;
|
|
6481
|
-
if (value === void 0) return void 0;
|
|
6482
|
-
if (!Number.isSafeInteger(value) || value < 1) throw new Error("superviseSurface: AgentProfile.model.metadata.maxTokens must be a positive safe integer");
|
|
6483
|
-
return value;
|
|
6484
|
-
}
|
|
6485
6488
|
//#endregion
|
|
6486
6489
|
//#region src/runtime/surface-diff.ts
|
|
6487
6490
|
/**
|
|
@@ -7095,6 +7098,6 @@ function tail(s) {
|
|
|
7095
7098
|
return s.slice(-400);
|
|
7096
7099
|
}
|
|
7097
7100
|
//#endregion
|
|
7098
|
-
export {
|
|
7101
|
+
export { definePersona as $, discriminatingMeans as A, sentinelCompletion as At, printBenchmarkReport as B, McpSpawnFault as Bt, withUntrackedArtifacts as C, localSandboxClient as Ct, chatTransportExecutor as D, superviseDispatch as Dt, runCoderChecks as E, loopDispatch as Et, authorStrategy as F, renderLeaderboardMarkdown as Ft, startRetainedInteractiveRun as G, envKeyProvider as Gt, claimRetainedInteractiveControl as H, materializeLocalMcp as Ht, strategyAuthorContract as I, renderLeaderboardSvg as It, startRetainedRun as J, resolveSecretEnv as Jt, reconnectRetainedRun as K, mcpSecretEnvMetadataKey as Kt, strategyAuthorSystemPrompt as L, renderPairwiseMarkdown as Lt, runStrategyEvolution as M, leaderboard as Mt, selectChampion as N, pairwiseSignificance as Nt, chatWorkerSeam as O, completionAuthorizes as Ot, assertStrategyContract as P, renderLeaderboardHtml as Pt, trajectoryReport as Q, SandboxRunAbortError as R, auditIntent as Rt, copyUntrackedIntoClone as S, resolveSandboxClient as St, patchDelivered as T, loopCampaignDispatch as Tt, reconnectRetainedInteractiveRun as U, createMcpEnvironment as Ut, runBenchmark as V, connectStdioMcp as Vt, recoverRetainedInteractiveRun as W, sanitizeMcpToolSchema as Wt, promotionGate as X, startRetainedRunInEnvironment as Y, secretEnvOfMcpServer as Yt, equalKOnCost as Z, NOTE_MAX_CHARS as _, createScopeAnalyst as _t, localShell as a, InMemoryCorpus as at, composeWorkerEvidence as b, harvestCorpus as bt, createVerifierEnvironment as c, flatWidenGate as ct, harvestSurfaceDiffs as d, pipeline as dt, runPersonified as et, analystsFromRegistry as f, selectValidWinner as ft, EVIDENCE_MAX_CHARS as g, buildSteerContext as gt, worktreeFanout as h, assertTraceDerivedFindings as ht, jjWorkspace as i, FileCorpus as it, pickChampion as j, stopSentinel as jt, createChatSessionStore as k, deterministicCompletion as kt, boxSurfaceReader as l, loopUntil as lt, superviseSurface as m, widen as mt, makeFinding$1 as n, createShapeRegistry as nt, runInWorkspace as o, renderCorpusToInstructions as ot, failuresAnalyst as p, verify as pt, recoverRetainedRun as q, resolveMcpServerLaunch as qt, gitWorkspace as r, registerShape as rt, createWaterfallCollector as s, fanout as st, computeFindingId$1 as t, builtinShapes as tt, fsSurfaceReader as u, panel as ut, VERIFY_TAIL_CHARS as v, registryScopeAnalyst as vt, analyzeTrace as w, inlineSandboxClient as wt, settledWorkerOut as x, defineLeaderboard as xt, closingWorkerNote as y, inProcessSandboxClient as yt, openSandboxRun as z, defaultAuditorInstruction as zt };
|
|
7099
7102
|
|
|
7100
|
-
//# sourceMappingURL=runtime-
|
|
7103
|
+
//# sourceMappingURL=runtime-RY_rvv7t.js.map
|