@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
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { A as readPromptOptions, F as defaultSelectWinner, H as routerBrain,
|
|
2
|
-
import {
|
|
3
|
-
import "./run-state-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { A as readPromptOptions, F as defaultSelectWinner, H as routerBrain, M as createSandboxLineage, O as runAgentRounds, St as verdictFromJudgeScore, Y as createWorktreeCliExecutor, b as InMemorySpawnJournal, bt as gateOnDeliverable, k as assertBoxlessPromptOptions, n as createSupervisor, v as withDriverExecutor, vt as CheckUnavailableError, w as createExecutor, x as createExecutorRegistry, xt as mapExecutorResult, y as InMemoryResultBlobStore } from "./supervisor-DpwcTrTh.js";
|
|
2
|
+
import { M as contentAddress, Ot as recordValue, bt as notifySandboxEventObserver, gt as createSandboxTurnEventCollector, r as runtimeFailureCauseSchema } from "./failure-cause-DoCCGLDH.js";
|
|
3
|
+
import "./run-state-COyIVOVb.js";
|
|
4
|
+
import { $r as executableAgentSpecSnapshot, Bt as coordinationProfileToolPrefix, P as isTraceAnalysisStore, Qr as executableAgentProfileSnapshot, Y as settledToIteration, dr as readBoundHarnessSessions, et as rollingDispatch, fn as insideCursorNamespace, ir as harnessTranscriptArtifact } from "./supervisor-accounting-QiXnF-EW.js";
|
|
5
|
+
import { E as validateFlowGraph, I as kernelPromptRegistry, b as coordinationControlToolNames, k as validateGraphTopology, m as runBrainLoop, t as supervise } from "./supervise-B5hb0my3.js";
|
|
6
6
|
import { T as zeroSpend, a as cloneSpend, c as errorMessage, d as isAbortError, f as isAsyncIterable, h as randomSuffix, i as chargedTokens, l as fnv1a32Hex, n as addSpend, p as mapWithConcurrency, u as hasCompleteCacheBreakdown, v as sleep, y as stringifySafe } from "./util-qsH5cC9S.js";
|
|
7
7
|
import { a as captureMaterializedWorkspace, b as sha256Bytes$1, m as canonicalCandidateDigest$1, v as immutableCandidateValue } from "./output-artifacts-AqkZ8lO2.js";
|
|
8
8
|
import { i as ConfigError, m as ValidationError, n as AnalystError, s as PlannerError } from "./errors-DG8yufqX.js";
|
|
9
|
-
import { c as runIsolatedCheck, l as createIsolatedCheckCpuSession } from "./graph-
|
|
10
|
-
import { a as concreteProfileModel, c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, p as canonicalObservedModelParts, t as assertExecutableAgentProfile,
|
|
9
|
+
import { c as runIsolatedCheck, l as createIsolatedCheckCpuSession } from "./graph-BXONYT1o.js";
|
|
10
|
+
import { a as concreteProfileModel, c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, p as canonicalObservedModelParts, t as assertExecutableAgentProfile, y as harnessRunsAgent } from "./model-policy-CqDuBTq-.js";
|
|
11
11
|
import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction-DilFZch5.js";
|
|
12
12
|
import { o as armDeadlineTimer } from "./deadline-CySmJ_0S.js";
|
|
13
|
-
import { D as runAgentic, E as refine, M as renderReport, N as profileChatClient, O as sample, j as observe, k as ObservationError, v as loadAuthoredStrategy, x as strategyAuthorContract, y as requestStrategySource } from "./structural-rollout-
|
|
13
|
+
import { D as runAgentic, E as refine, M as renderReport, N as profileChatClient, O as sample, j as observe, k as ObservationError, v as loadAuthoredStrategy, x as strategyAuthorContract, y as requestStrategySource } from "./structural-rollout-DbZAkHTq.js";
|
|
14
14
|
import { a as readCommittedJsonLines, c as appendCommittedJsonLine, i as readCommittedJsonFile, m as runAbortable, o as upsertCommittedJsonLine, s as withJsonlFileLock, t as isNoEntError } from "./jsonl-file-BhuxeejY.js";
|
|
15
15
|
import { n as detachedSnapshot, t as detachedFrozen } from "./snapshot-BKI_w3JD.js";
|
|
16
|
-
import {
|
|
17
|
-
import "./provision-supervisor-
|
|
16
|
+
import { y as markPutStreamVerified } from "./workspace-streams-C7PGLAUd.js";
|
|
17
|
+
import "./provision-supervisor-CauovUHn.js";
|
|
18
18
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-CsW2pfFk.js";
|
|
19
|
-
import { a as reconcileInterruptedSearchCalls, c as searchExecutor, r as dedicatedLane, x as runtimeShipDecision } from "./search-executor-
|
|
20
|
-
import "./delegate-
|
|
19
|
+
import { a as reconcileInterruptedSearchCalls, c as searchExecutor, r as dedicatedLane, x as runtimeShipDecision } from "./search-executor-Drd_N9YO.js";
|
|
20
|
+
import "./delegate-BOren4c7.js";
|
|
21
21
|
import "./continuation-CZaeHEzQ.js";
|
|
22
|
-
import { S as graphRouteWhenSchema, _ as compileGraphParameters, a as graphRegistry, d as recordGraphRun, g as bindGraphParameters, h as assertGraphTriggerBindings, i as graphFromStored, j as assertJsonData, l as lookupGraph, m as taskShapeDigest, o as graphRunsFor, r as graphDigest, t as digestOfGraph, v as graphTriggerBindingsSchema, x as graphFileSchema, y as graphCheckNodeSchema } from "./graph-registry-
|
|
23
|
-
import { y as foldCoordinationRecords } from "./run-cancellation-
|
|
24
|
-
import {
|
|
22
|
+
import { S as graphRouteWhenSchema, _ as compileGraphParameters, a as graphRegistry, d as recordGraphRun, g as bindGraphParameters, h as assertGraphTriggerBindings, i as graphFromStored, j as assertJsonData, l as lookupGraph, m as taskShapeDigest, o as graphRunsFor, r as graphDigest, t as digestOfGraph, v as graphTriggerBindingsSchema, x as graphFileSchema, y as graphCheckNodeSchema } from "./graph-registry-j9t9J0KT.js";
|
|
23
|
+
import { y as foldCoordinationRecords } from "./run-cancellation-NMNVuYiO.js";
|
|
24
|
+
import { p as createInMemoryRunContext, s as downMessageRefusalReasons } from "./driver-control-acknowledgers-ByKwAgCI.js";
|
|
25
25
|
import { a as writeAtomicDurableFile } from "./durable-file-DstVeHcj.js";
|
|
26
|
-
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256Bytes, sha256DigestSchema, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
26
|
+
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sameAgentRunControlRef, sha256Bytes, sha256DigestSchema, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
27
27
|
import { CODING_HARNESSES, DEFAULT_TRACE_ANALYST_KINDS, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, createTraceAnalyst, expandProfileAxes, makeFinding as makeFinding$1, meanConfidenceInterval, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
|
|
28
28
|
import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
|
|
29
29
|
import { collectAgentResponseText } from "@tangle-network/sandbox";
|
|
@@ -41,7 +41,7 @@ import { SearchRecorder, asha, beam, createRunCostLedger, estimateNode, fsCampai
|
|
|
41
41
|
import { defineEvaluationClaim, summarizeEvaluationUnits } from "@tangle-network/agent-eval/experiment";
|
|
42
42
|
import { Worker } from "node:worker_threads";
|
|
43
43
|
import { gzipSync } from "node:zlib";
|
|
44
|
-
import { isScalar, parseDocument } from "yaml";
|
|
44
|
+
import { isAlias, isMap, isScalar, isSeq, parseDocument, visit } from "yaml";
|
|
45
45
|
import { stuckLoopView, toolWasteView } from "@tangle-network/agent-eval/pipelines";
|
|
46
46
|
import { sha256Hex } from "@tangle-network/agent-core/node";
|
|
47
47
|
// src/durable/sql-run-store.ts
|
|
@@ -2553,6 +2553,97 @@ function defineLeaderboard(spec) {
|
|
|
2553
2553
|
toBenchmarkAdapter: () => leaderboardBenchmarkAdapter(spec)
|
|
2554
2554
|
};
|
|
2555
2555
|
}
|
|
2556
|
+
// src/runtime/harness-transcript-sessions.ts
|
|
2557
|
+
const completeEvidence = z.object({
|
|
2558
|
+
status: z.literal("available"),
|
|
2559
|
+
transcriptRef: z.string().regex(/^sha256:[0-9a-f]{64}$/u),
|
|
2560
|
+
harness: z.string().min(1),
|
|
2561
|
+
fileCount: z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
2562
|
+
totalBytes: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
2563
|
+
skippedCount: z.literal(0),
|
|
2564
|
+
coverageComplete: z.literal(true),
|
|
2565
|
+
missing: z.array(z.string()).max(0).optional()
|
|
2566
|
+
});
|
|
2567
|
+
/**
|
|
2568
|
+
* Verify complete native evidence and its exact execution before ending source custody. Original
|
|
2569
|
+
* retained archive bytes are checked even when binary or bounded files have no text projection.
|
|
2570
|
+
* Parsed conversation completeness is a separate check owned by `readHarnessTranscriptSessions`.
|
|
2571
|
+
*/
|
|
2572
|
+
async function readVerifiedHarnessTranscript(receipt, blobs, options) {
|
|
2573
|
+
try {
|
|
2574
|
+
const parsed = completeEvidence.safeParse(receipt);
|
|
2575
|
+
if (!parsed.success) throw new Error(`Native transcript coverage is incomplete: ${recordValue(receipt)?.reason ?? "complete receipt required"}`);
|
|
2576
|
+
const { node, controlRef, profileDigest, executionId, ...readOptions } = options;
|
|
2577
|
+
const metadata = await harnessTranscriptArtifact(parsed.data, blobs, {
|
|
2578
|
+
...readOptions,
|
|
2579
|
+
content: false
|
|
2580
|
+
});
|
|
2581
|
+
if (!metadata || metadata.harness !== parsed.data.harness || metadata.skipped.length || metadata.missing?.length || metadata.source && !metadata.source.coverageComplete || metadata.files.length !== parsed.data.fileCount || metadata.files.reduce((total, file) => total + file.bytes, 0) !== parsed.data.totalBytes) throw new Error("Native transcript bytes or inventory do not match the complete receipt");
|
|
2582
|
+
if (metadata.binding && metadata.source) throw new Error("Native transcript has conflicting source bindings");
|
|
2583
|
+
const source = metadata.binding ?? metadata.source;
|
|
2584
|
+
if (!source?.nativeSessionId) throw new Error("Native transcript has no bound native session");
|
|
2585
|
+
for (const key of [
|
|
2586
|
+
"rootId",
|
|
2587
|
+
"nodeId",
|
|
2588
|
+
"attemptId"
|
|
2589
|
+
]) if (!node[key] || source.node?.[key] !== node[key]) throw new Error(`Native transcript ${key} does not match the requested execution`);
|
|
2590
|
+
if (controlRef && (!source.controlRef || !sameAgentRunControlRef(source.controlRef, controlRef))) throw new Error("Native transcript control reference does not match the requested execution");
|
|
2591
|
+
if (profileDigest !== void 0 && source.profileDigest !== profileDigest) throw new Error("Native transcript profile does not match the requested execution");
|
|
2592
|
+
if (executionId !== void 0 && metadata.source?.executionId !== executionId) throw new Error("Native transcript invocation does not match the requested execution");
|
|
2593
|
+
const artifact = await harnessTranscriptArtifact(parsed.data, blobs, readOptions);
|
|
2594
|
+
if (!artifact) throw new Error("Native transcript bytes could not be resolved");
|
|
2595
|
+
return {
|
|
2596
|
+
succeeded: true,
|
|
2597
|
+
value: {
|
|
2598
|
+
metadata,
|
|
2599
|
+
artifact
|
|
2600
|
+
}
|
|
2601
|
+
};
|
|
2602
|
+
} catch (error) {
|
|
2603
|
+
return {
|
|
2604
|
+
succeeded: false,
|
|
2605
|
+
error: error instanceof Error ? error.message : "Native transcript could not be verified"
|
|
2606
|
+
};
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
/**
|
|
2610
|
+
* Resolve complete native sessions for one exact Runtime execution. The existing capture reader
|
|
2611
|
+
* verifies retained bytes; the caller supplies its native parser. Missing coverage, a different
|
|
2612
|
+
* attempt, and incomplete native families return explicit failures rather than training examples.
|
|
2613
|
+
*/
|
|
2614
|
+
async function readHarnessTranscriptSessions(receipt, blobs, options) {
|
|
2615
|
+
const { readSessions, ...readOptions } = options;
|
|
2616
|
+
const verified = await readVerifiedHarnessTranscript(receipt, blobs, readOptions);
|
|
2617
|
+
if (!verified.succeeded) return verified;
|
|
2618
|
+
try {
|
|
2619
|
+
const { artifact, metadata } = verified.value;
|
|
2620
|
+
const source = metadata.binding ?? metadata.source;
|
|
2621
|
+
if (!artifact.files.length) throw new Error("Native transcript projection has no readable session bytes");
|
|
2622
|
+
options.signal?.throwIfAborted();
|
|
2623
|
+
const sessions = await readSessions(artifact, options.signal);
|
|
2624
|
+
const { sessions: family } = await readBoundHarnessSessions({
|
|
2625
|
+
nativeSessionId: source.nativeSessionId,
|
|
2626
|
+
...source.nativeSessionIds ? { nativeSessionIds: source.nativeSessionIds } : {},
|
|
2627
|
+
files: sessions.map((session, index) => ({
|
|
2628
|
+
path: `session-${index}`,
|
|
2629
|
+
nativeSessionId: session.nativeSessionId
|
|
2630
|
+
})),
|
|
2631
|
+
read: async (file) => new TextEncoder().encode(file.path),
|
|
2632
|
+
parse: (_text, file) => sessions[Number(file.path.slice(8))],
|
|
2633
|
+
signal: options.signal
|
|
2634
|
+
});
|
|
2635
|
+
if (family.length !== sessions.length) throw new Error("Native transcript includes a session outside the bound family");
|
|
2636
|
+
return {
|
|
2637
|
+
succeeded: true,
|
|
2638
|
+
value: { sessions: family }
|
|
2639
|
+
};
|
|
2640
|
+
} catch (error) {
|
|
2641
|
+
return {
|
|
2642
|
+
succeeded: false,
|
|
2643
|
+
error: error instanceof Error ? error.message : "Native transcript could not be verified"
|
|
2644
|
+
};
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2556
2647
|
// src/runtime/harvest-corpus.ts
|
|
2557
2648
|
/**
|
|
2558
2649
|
* Analyze completed runs through the selected observer and retain findings in a corpus.
|
|
@@ -6763,7 +6854,7 @@ function createChatSessionStore() {
|
|
|
6763
6854
|
}
|
|
6764
6855
|
};
|
|
6765
6856
|
}
|
|
6766
|
-
function exactProfile(profile, context) {
|
|
6857
|
+
function exactProfile$1(profile, context) {
|
|
6767
6858
|
const parsed = agentProfileSchema.safeParse(profile);
|
|
6768
6859
|
if (!parsed.success) throw new ValidationError(`${context}: invalid AgentProfile: ${parsed.error.message}`);
|
|
6769
6860
|
assertExecutableAgentProfile(parsed.data, context);
|
|
@@ -6777,7 +6868,7 @@ function initialMessages(opts) {
|
|
|
6777
6868
|
return prior;
|
|
6778
6869
|
}
|
|
6779
6870
|
function executorConfig(opts) {
|
|
6780
|
-
const profile = exactProfile(opts.profile, "chat transport");
|
|
6871
|
+
const profile = exactProfile$1(opts.profile, "chat transport");
|
|
6781
6872
|
if (!opts.complete && !opts.url) throw new ValidationError("chat transport: url required unless complete is injected");
|
|
6782
6873
|
const tools = opts.tools ?? [];
|
|
6783
6874
|
for (const tool of tools) if (!tool.spec.function.name || typeof tool.execute !== "function") throw new ValidationError("chat transport: every tool needs spec.function.name and execute");
|
|
@@ -6838,7 +6929,7 @@ function chatWorkerSeam(opts) {
|
|
|
6838
6929
|
if (!opts.complete && !opts.url) throw new ValidationError("chatWorkerSeam: url required unless complete is injected");
|
|
6839
6930
|
const sessions = opts.sessions ?? createChatSessionStore();
|
|
6840
6931
|
return (rawProfile, spawnContext) => {
|
|
6841
|
-
const profile = exactProfile(rawProfile, "chatWorkerSeam");
|
|
6932
|
+
const profile = exactProfile$1(rawProfile, "chatWorkerSeam");
|
|
6842
6933
|
return {
|
|
6843
6934
|
name: profile.name ?? "chat-worker",
|
|
6844
6935
|
act: async () => void 0,
|
|
@@ -6990,7 +7081,7 @@ function graphDesignerExtraTools(env) {
|
|
|
6990
7081
|
})();
|
|
6991
7082
|
if (name === "designer_history") return (async () => {
|
|
6992
7083
|
const args = asRecord(raw ?? {}, "designer_history");
|
|
6993
|
-
const { listGraphRuns } = await import("./graph-registry-
|
|
7084
|
+
const { listGraphRuns } = await import("./graph-registry-DxhlgHdA.js");
|
|
6994
7085
|
const all = await listGraphRuns(registry);
|
|
6995
7086
|
return { runs: (args.taskShape === void 0 ? all : all.filter((row) => row.taskDigest === taskShapeDigest(asRecord(args.taskShape, "designer_history.taskShape")))).map(summarize) };
|
|
6996
7087
|
})();
|
|
@@ -7001,7 +7092,7 @@ function graphDesignerExtraTools(env) {
|
|
|
7001
7092
|
if (mode === "replay") {
|
|
7002
7093
|
const digest = args.graphDigest;
|
|
7003
7094
|
if (typeof digest !== "string" || digest.length === 0) throw new ValidationError("designer_run_graph: replay mode requires graphDigest from lookup");
|
|
7004
|
-
const { loadGraph } = await import("./graph-registry-
|
|
7095
|
+
const { loadGraph } = await import("./graph-registry-DxhlgHdA.js");
|
|
7005
7096
|
const stored = await loadGraph(registry, digest);
|
|
7006
7097
|
if (!stored) throw new ValidationError(`designer_run_graph: no stored graph ${digest.slice(0, 12)} — re-lookup`);
|
|
7007
7098
|
const graph = env.bindCheck(graphFromStored(stored, () => {
|
|
@@ -7113,6 +7204,82 @@ function setGraphStrings(graphText, map) {
|
|
|
7113
7204
|
if (maskedDigest(parseGraph(next)) !== maskedDigest(parsed) || canonicalCandidateDigest(readGraphStrings(next)) !== expected) throw new ValidationError("graph strings: the write changed more than the named prompts");
|
|
7114
7205
|
return next;
|
|
7115
7206
|
}
|
|
7207
|
+
function exactProfile(value, nodeId) {
|
|
7208
|
+
assertJsonData(value, "graph profile");
|
|
7209
|
+
if (redact(value).report.findings.length) throw new ValidationError("graph profile: private literal values are not portable candidates");
|
|
7210
|
+
const parsed = agentProfileSchema.safeParse(value);
|
|
7211
|
+
if (!parsed.success || canonicalCandidateDigest(value) !== canonicalCandidateDigest(parsed.data)) throw new ValidationError("graph profile: requires an exact canonical AgentProfile");
|
|
7212
|
+
if (parsed.data.name !== nodeId) throw new ValidationError("graph profile: profile name must equal the node id");
|
|
7213
|
+
assertExecutableAgentProfile(parsed.data, "graph profile");
|
|
7214
|
+
compileGraphParameters(parsed.data, {});
|
|
7215
|
+
return parsed.data;
|
|
7216
|
+
}
|
|
7217
|
+
/** An alias, anchor or tag shares or reinterprets YAML another owner may also read. */
|
|
7218
|
+
function sharedYaml(item) {
|
|
7219
|
+
return isAlias(item) || (isMap(item) || isSeq(item) || isScalar(item)) && !!(item.anchor || item.tag);
|
|
7220
|
+
}
|
|
7221
|
+
function ownProfile(graphText, nodeId) {
|
|
7222
|
+
const document = parseGraphYaml(graphText, "graph profile");
|
|
7223
|
+
const value = document.toJS({ maxAliasCount: 100 });
|
|
7224
|
+
assertJsonData(value, "graph profile");
|
|
7225
|
+
if (!isMap(document.contents)) throw new ValidationError("graph profile: requires a graph mapping");
|
|
7226
|
+
const graphNodes = graphFileSchema.shape.nodes.parse(value.nodes);
|
|
7227
|
+
const matches = graphNodes.flatMap((node, index) => node.id === nodeId ? [index] : []);
|
|
7228
|
+
if (matches.length !== 1) throw new ValidationError("graph profile: requires exactly one matching node");
|
|
7229
|
+
const index = matches[0];
|
|
7230
|
+
const node = graphNodes[index];
|
|
7231
|
+
const nodes = document.getIn(["nodes"], true);
|
|
7232
|
+
const own = document.getIn(["nodes", index], true);
|
|
7233
|
+
const profile = document.getIn([
|
|
7234
|
+
"nodes",
|
|
7235
|
+
index,
|
|
7236
|
+
"profile"
|
|
7237
|
+
], true);
|
|
7238
|
+
const parents = [
|
|
7239
|
+
document.contents,
|
|
7240
|
+
nodes,
|
|
7241
|
+
own
|
|
7242
|
+
];
|
|
7243
|
+
if (!isSeq(nodes) || !isMap(own) || !isMap(profile) || parents.some(sharedYaml) || node.seat !== void 0 || node.needs !== void 0 || node.check !== void 0) throw new ValidationError("graph profile: requires an unshared inline agent profile without host overlays");
|
|
7244
|
+
visit(own, (_key, item) => {
|
|
7245
|
+
if (sharedYaml(item)) throw new ValidationError("graph profile: aliases, anchors and tags are not owned profile data");
|
|
7246
|
+
});
|
|
7247
|
+
return {
|
|
7248
|
+
document,
|
|
7249
|
+
index,
|
|
7250
|
+
profile,
|
|
7251
|
+
canonical: exactProfile({
|
|
7252
|
+
...node.profile,
|
|
7253
|
+
name: nodeId
|
|
7254
|
+
}, nodeId)
|
|
7255
|
+
};
|
|
7256
|
+
}
|
|
7257
|
+
/** Read the exact executable profile owned by one inline graph node. Refuses shared YAML,
|
|
7258
|
+
* host overlays, dynamic bindings, incomplete identities and private literals; never resolves them. */
|
|
7259
|
+
function readGraphProfile(graphText, nodeId) {
|
|
7260
|
+
return ownProfile(graphText, nodeId).canonical;
|
|
7261
|
+
}
|
|
7262
|
+
/** Materialize a measured profile in its owning node. Other source bytes and graph semantics
|
|
7263
|
+
* remain unchanged. Load without seat/need overrides to execute this exact candidate. */
|
|
7264
|
+
function setGraphProfile(graphText, nodeId, profile) {
|
|
7265
|
+
const parsed = ownProfile(graphText, nodeId);
|
|
7266
|
+
const candidate = exactProfile(profile, nodeId);
|
|
7267
|
+
if (canonicalCandidateDigest(candidate) === canonicalCandidateDigest(parsed.canonical)) return graphText;
|
|
7268
|
+
if (parsed.document.has("digest")) throw new ValidationError("graph profile: a pinned graph digest requires its compilation owner");
|
|
7269
|
+
const range = parsed.profile.range;
|
|
7270
|
+
if (!range) throw new ValidationError("graph profile: missing source range");
|
|
7271
|
+
const [start, end] = range;
|
|
7272
|
+
const trailing = /\s*$/.exec(graphText.slice(start, end))[0].length;
|
|
7273
|
+
const next = graphText.slice(0, start) + JSON.stringify(candidate) + graphText.slice(end - trailing);
|
|
7274
|
+
const readback = ownProfile(next, nodeId);
|
|
7275
|
+
const masked = (source) => {
|
|
7276
|
+
const value = source.document.toJS({ maxAliasCount: 100 });
|
|
7277
|
+
value.nodes[source.index].profile = null;
|
|
7278
|
+
return canonicalCandidateDigest(value);
|
|
7279
|
+
};
|
|
7280
|
+
if (masked(parsed) !== masked(readback) || canonicalAgentProfileDigest(readback.canonical) !== canonicalAgentProfileDigest(candidate)) throw new ValidationError("graph profile: write changed more than the named profile");
|
|
7281
|
+
return next;
|
|
7282
|
+
}
|
|
7116
7283
|
// src/runtime/supervise/graph-file.ts
|
|
7117
7284
|
/** A provider name in authored data needs an environment-owned canonical connection binding. */
|
|
7118
7285
|
var GraphFileResolutionError = class extends Error {
|
|
@@ -9813,6 +9980,6 @@ async function runInWorkspace(ws, body, opts = {}) {
|
|
|
9813
9980
|
function tail(s) {
|
|
9814
9981
|
return s.slice(-400);
|
|
9815
9982
|
}
|
|
9816
|
-
export {
|
|
9983
|
+
export { strategyTournament as $, completionAuthorizes as $t, searchPresets as A, readHarnessTranscriptSessions as At, graphFromSessionFacts as B, resolveMcpServerLaunch as Bt, withUntrackedArtifacts as C, createScopeAnalyst as Ct, SEARCH_SPEC_CORRELATION_KEY as D, inProcessSandboxClient as Dt, createFencedSqlRunContext as E, observationFromRegistry as Et, loadProfile as F, materializeLocalMcp as Ft, readGraphStrings as G, loopDispatch as Gt, graphWorkspace as H, secretEnvOfMcpServer as Ht, pickBestProfile as I, createMcpEnvironment as It, graphDesignerExtraTools as J, checkProgramDigest as Jt, setGraphProfile as K, superviseDispatch as Kt, profileRegistry as L, sanitizeMcpToolSchema as Lt, connectRemoteSupervisor as M, resolveSandboxClient as Mt, connectRemoteSupervisorControl as N, McpSpawnFault as Nt, assertSearchSpec as O, HarvestError as Ot, bestProfileFor as P, connectStdioMcp as Pt, runStrategyEvolution as Q, readDeclaredCheck as Qt, profileRunsForName as R, envKeyProvider as Rt, copyUntrackedIntoClone as S, buildSteerContext as St, validateStoredGraph as T, measurePairedCommands as Tt, loadGraphFile as U, inlineSandboxClient as Ut, GraphFileResolutionError as V, resolveSecretEnv as Vt, readGraphProfile as W, loopCampaignDispatch as Wt, chatWorkerSeam as X, declaredCheckDigest as Xt, chatTransportExecutor as Y, declaredCheckDeliverable as Yt, createChatSessionStore as Z, declaredCheckJudge as Zt, NOTE_MAX_CHARS as _, pipeline as _t, localShell as a, renderLeaderboardHtml as an, createPrivateCasArtifactPort as at, composeWorkerEvidence as b, widen as bt, createVerifierEnvironment as c, renderPairwiseMarkdown as cn, definePersona as ct, harvestSurfaceDiffs as d, InMemoryCorpus as dt, deterministicCompletion as en, SandboxRunAbortError as et, analystsFromRegistry as f, renderCorpusToInstructions as ft, EVIDENCE_MAX_CHARS as g, panel as gt, runCoderChecks as h, loopUntil as ht, jjWorkspace as i, pairwiseSignificance as in, runBenchmark as it, searchSpecDigest as j, defineLeaderboard as jt, compileSearchSpec as k, harvestCorpus as kt, boxSurfaceReader as l, SqlRunOwnershipError as ln, runPersonified as lt, worktreeFanout as m, flatWidenGate as mt, makeFinding$1 as n, stopSentinel as nn, createS3PrivateCasStore as nt, runInWorkspace as o, renderLeaderboardMarkdown as on, equalKOnCost as ot, failuresAnalyst as p, fanout as pt, setGraphStrings as q, assertDeclaredCheck as qt, gitWorkspace as r, leaderboard as rn, printBenchmarkReport as rt, createWaterfallCollector as s, renderLeaderboardSvg as sn, trajectoryReport as st, computeFindingId$1 as t, sentinelCompletion as tn, openSandboxRun as tt, fsSurfaceReader as u, openSqlRunStore as un, FileCorpus as ut, VERIFY_TAIL_CHARS as v, selectValidWinner as vt, analyzeTrace as w, registryScopeAnalyst as wt, settledWorkerOut as x, assertTraceDerivedFindings as xt, closingWorkerNote as y, verify as yt, recordProfileRun as z, mcpSecretEnvMetadataKey as zt };
|
|
9817
9984
|
|
|
9818
|
-
//# sourceMappingURL=runtime-
|
|
9985
|
+
//# sourceMappingURL=runtime-DYaRDLKn.js.map
|