@tangle-network/agent-runtime 0.321.0 → 0.322.4
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-BxOOvwjo.d.ts → activation-Bw6S7lI1.d.ts} +2 -2
- package/dist/{activation-CXFl5YVE.js → activation-ClHYiUF-.js} +2 -2
- package/dist/{activation-CXFl5YVE.js.map → activation-ClHYiUF-.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-Bpn05N-Y.js → coordination-driver-xq1y2G6E.js} +69 -2
- package/dist/coordination-driver-xq1y2G6E.js.map +1 -0
- package/dist/{delegate-BHlcTOdK.js → delegate-C9dMTZ8s.js} +2 -2
- package/dist/{delegate-BHlcTOdK.js.map → delegate-C9dMTZ8s.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +2 -2
- package/dist/{graph-DE2dLhDI.js → graph-DLgIEaDB.js} +4 -4
- package/dist/{graph-DE2dLhDI.js.map → graph-DLgIEaDB.js.map} +1 -1
- package/dist/{improvement-cycle-CyChbojL.js → improvement-cycle-C0N4tt1G.js} +3 -3
- package/dist/{improvement-cycle-CyChbojL.js.map → improvement-cycle-C0N4tt1G.js.map} +1 -1
- package/dist/{index-BxiHetnG.d.ts → index-BE5-_p0B.d.ts} +638 -543
- package/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +22 -6
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-bin-CT02Vzco.js → loop-runner-bin-B4QRhI5z.js} +3 -3
- package/dist/{loop-runner-bin-CT02Vzco.js.map → loop-runner-bin-B4QRhI5z.js.map} +1 -1
- package/dist/{loop-runner-bin-DInJZNgs.d.ts → loop-runner-bin-DeT99QWD.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 +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-DLTw576v.d.ts → openai-tools-C80KeWl4.d.ts} +2 -2
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-DvgBNtoJ.js → provision-supervisor-C40ye4h2.js} +3 -3
- package/dist/{provision-supervisor-DvgBNtoJ.js.map → provision-supervisor-C40ye4h2.js.map} +1 -1
- package/dist/{runtime-wLgjMOaj.js → runtime-zv5GK0m4.js} +77 -12
- package/dist/runtime-zv5GK0m4.js.map +1 -0
- package/dist/{search-executor-TEKWC579.js → search-executor-BtJktjPt.js} +2 -2
- package/dist/{search-executor-TEKWC579.js.map → search-executor-BtJktjPt.js.map} +1 -1
- package/dist/{server-qYhzITTm.js → server-DNnLa4KU.js} +3 -3
- package/dist/{server-qYhzITTm.js.map → server-DNnLa4KU.js.map} +1 -1
- package/dist/{supervise-C4bLIU7J.js → supervise-DLezpJcp.js} +172 -123
- package/dist/supervise-DLezpJcp.js.map +1 -0
- package/dist/{supervisor-bkq2b8k-.js → supervisor-dlufUXys.js} +268 -42
- package/dist/supervisor-dlufUXys.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +4 -4
- package/skills/profile-authoring/SKILL.md +4 -3
- package/dist/coordination-driver-Bpn05N-Y.js.map +0 -1
- package/dist/runtime-wLgjMOaj.js.map +0 -1
- package/dist/supervise-C4bLIU7J.js.map +0 -1
- package/dist/supervisor-bkq2b8k-.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { a as graphRunsFor, d as recordGraphRun, i as graphRegistry, l as lookupGraph, p as taskShapeDigest, r as graphFromStored, t as digestOfGraph } from "./graph-registry-BuJbzTzF.js";
|
|
2
|
-
import { Cn as readPromptOptions, Hn as InMemoryResultBlobStore, It as createWorktreeCliExecutor, Nt as createExecutor, Ot as verdictFromJudgeScore, Pr as contentAddress, Pt as createExecutorRegistry, Sn as assertBoxlessPromptOptions, Tn as runBrainLoop, Un as InMemorySpawnJournal, Wn as insideCursorNamespace, Xn as readCommittedJsonLines, Yn as prepareJsonlAppend, Zn as writeAllBytes, _n as runAgentRounds, aa as
|
|
2
|
+
import { Cn as readPromptOptions, Hn as InMemoryResultBlobStore, It as createWorktreeCliExecutor, Nt as createExecutor, Ot as verdictFromJudgeScore, Pr as contentAddress, Pt as createExecutorRegistry, Sn as assertBoxlessPromptOptions, Tn as runBrainLoop, Un as InMemorySpawnJournal, Wn as insideCursorNamespace, Xn as readCommittedJsonLines, Yn as prepareJsonlAppend, Zn as writeAllBytes, _n as runAgentRounds, aa as executableAgentProfileSnapshot, ca as detachedSnapshot, er as isTraceAnalysisStore, hn as defaultSelectWinner, ht as mapExecutorResult, j as settledToIteration, mt as gateOnDeliverable, oa as executableAgentSpecSnapshot, pt as rollingDispatch, r as createSupervisor, rt as coordinationProfileToolPrefix, sa as detachedFrozen, v as withDriverExecutor, vn as createSandboxLineage, vt as CheckUnavailableError, wn as routerBrain, ya as notifySandboxEventObserver } from "./supervisor-dlufUXys.js";
|
|
3
3
|
import { i as ConfigError, m as ValidationError, n as AnalystError, s as PlannerError } from "./errors-DodWX-cb.js";
|
|
4
|
-
import { B as runAgentic, G as observe, K as renderReport, U as ObservationError, V as sample, X as strategyAuthorMethod, a as reconcileInterruptedSearchCalls, c as searchExecutor, q as profileChatClient, r as dedicatedLane, x as runtimeShipDecision, z as refine } from "./search-executor-
|
|
4
|
+
import { B as runAgentic, G as observe, K as renderReport, U as ObservationError, V as sample, X as strategyAuthorMethod, a as reconcileInterruptedSearchCalls, c as searchExecutor, q as profileChatClient, r as dedicatedLane, x as runtimeShipDecision, z as refine } from "./search-executor-BtJktjPt.js";
|
|
5
5
|
import { A as markPutStreamVerified, J as fnv1a32Hex, L as immutableCandidateValue, N as canonicalCandidateDigest$1, S as captureMaterializedWorkspace, U as chargedTokens, V as addSpend, W as cloneSpend, X as isAbortError, Y as hasCompleteCacheBreakdown, Z as isAsyncIterable, et as randomSuffix, it as stringifySafe, lt as zeroSpend, q as errorMessage, rt as sleep, xt as armDeadlineTimer, y as WorkspaceScanLimitError, z as sha256Bytes$1 } from "./workspace-streams-DFAhW7hF.js";
|
|
6
6
|
import { c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, p as canonicalObservedModelParts, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-CNe257pB.js";
|
|
7
7
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
|
|
8
8
|
import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction-DylCC_ot.js";
|
|
9
|
-
import { D as foldCoordinationRecords, w as createInMemoryRunContext } from "./coordination-driver-
|
|
10
|
-
import { r as supervise } from "./supervise-
|
|
9
|
+
import { D as foldCoordinationRecords, w as createInMemoryRunContext } from "./coordination-driver-xq1y2G6E.js";
|
|
10
|
+
import { r as supervise } from "./supervise-DLezpJcp.js";
|
|
11
11
|
import "./run-layout-DSCWdbX2.js";
|
|
12
|
-
import "./provision-supervisor-
|
|
13
|
-
import "./delegate-
|
|
14
|
-
import "./graph-
|
|
12
|
+
import "./provision-supervisor-C40ye4h2.js";
|
|
13
|
+
import "./delegate-C9dMTZ8s.js";
|
|
14
|
+
import "./graph-DLgIEaDB.js";
|
|
15
15
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256Bytes, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
16
16
|
import { CODING_HARNESSES, DEFAULT_TRACE_ANALYST_KINDS, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, createTraceAnalyst, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
|
|
17
17
|
import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
|
|
@@ -23,6 +23,7 @@ import { chmod, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, r
|
|
|
23
23
|
import { tmpdir } from "node:os";
|
|
24
24
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
25
25
|
import { redact } from "@tangle-network/agent-eval/traces";
|
|
26
|
+
import { z } from "zod";
|
|
26
27
|
import { Readable } from "node:stream";
|
|
27
28
|
import { collectAgentResponseText } from "@tangle-network/sandbox";
|
|
28
29
|
import { SearchRecorder, asha, beam, createRunCostLedger, estimateNode, fsCampaignStorage, openSearchLedger, renderSearchSummary, runProfileMatrix, runSearch, searchClaimReserveUsd, searchModelIdentity, surfaceDiff } from "@tangle-network/agent-eval/campaign";
|
|
@@ -456,8 +457,9 @@ async function connectHttpMcp(spec) {
|
|
|
456
457
|
let sessionId;
|
|
457
458
|
let nextId = 1;
|
|
458
459
|
let closed = false;
|
|
459
|
-
const post = async (path, body, method = "POST") => fetchImpl(`${endpoint.origin}${endpoint.pathname}${endpoint.search}${path}`, {
|
|
460
|
+
const post = async (path, body, method = "POST", signal) => fetchImpl(`${endpoint.origin}${endpoint.pathname}${endpoint.search}${path}`, {
|
|
460
461
|
method,
|
|
462
|
+
...signal ? { signal } : {},
|
|
461
463
|
headers: {
|
|
462
464
|
accept: "application/json, text/event-stream",
|
|
463
465
|
...body !== void 0 ? { "content-type": "application/json" } : {},
|
|
@@ -479,7 +481,7 @@ async function connectHttpMcp(spec) {
|
|
|
479
481
|
id,
|
|
480
482
|
method,
|
|
481
483
|
params
|
|
482
|
-
}, "POST");
|
|
484
|
+
}, "POST", controller.signal);
|
|
483
485
|
const sessionHeader = res.headers.get("mcp-session-id");
|
|
484
486
|
if (sessionHeader) sessionId = sessionHeader;
|
|
485
487
|
if (!res.ok) {
|
|
@@ -7539,6 +7541,69 @@ async function bestProfileFor(reg, name) {
|
|
|
7539
7541
|
} : void 0;
|
|
7540
7542
|
}
|
|
7541
7543
|
//#endregion
|
|
7544
|
+
//#region src/runtime/supervise/remote-supervisor.ts
|
|
7545
|
+
const agentSchema = z.object({
|
|
7546
|
+
id: z.string(),
|
|
7547
|
+
parent: z.string().optional(),
|
|
7548
|
+
label: z.string(),
|
|
7549
|
+
status: z.string(),
|
|
7550
|
+
runtime: z.string()
|
|
7551
|
+
}).passthrough();
|
|
7552
|
+
const treeSchema = z.object({
|
|
7553
|
+
root: z.string(),
|
|
7554
|
+
nodes: z.array(agentSchema),
|
|
7555
|
+
inFlight: z.number().int().nonnegative()
|
|
7556
|
+
});
|
|
7557
|
+
const eventPageSchema = z.discriminatedUnion("status", [z.object({
|
|
7558
|
+
status: z.literal("unavailable"),
|
|
7559
|
+
reason: z.enum(["unknown-worker", "not-captured"])
|
|
7560
|
+
}), z.object({
|
|
7561
|
+
status: z.literal("available"),
|
|
7562
|
+
entries: z.array(z.object({
|
|
7563
|
+
sequence: z.number().int().nonnegative(),
|
|
7564
|
+
at: z.number(),
|
|
7565
|
+
event: z.unknown(),
|
|
7566
|
+
omitted: z.enum(["event-too-large", "event-not-serializable"]).optional()
|
|
7567
|
+
})),
|
|
7568
|
+
cursor: z.object({
|
|
7569
|
+
epoch: z.string(),
|
|
7570
|
+
next: z.number().int().nonnegative()
|
|
7571
|
+
}),
|
|
7572
|
+
reset: z.boolean(),
|
|
7573
|
+
historyExpired: z.boolean(),
|
|
7574
|
+
remaining: z.number().int().nonnegative()
|
|
7575
|
+
})]);
|
|
7576
|
+
/** Connect with the server's readOnly URL and protected headers; credentials never enter a profile. */
|
|
7577
|
+
async function connectRemoteSupervisor(spec) {
|
|
7578
|
+
const connection = await connectHttpMcp(spec);
|
|
7579
|
+
if (!connection.tools.some((tool) => tool.name === "observe_agent")) {
|
|
7580
|
+
await connection.close();
|
|
7581
|
+
throw new ValidationError("remote supervisor does not expose observe_agent");
|
|
7582
|
+
}
|
|
7583
|
+
const call = async (args) => {
|
|
7584
|
+
const text = await connection.callTool("observe_agent", args);
|
|
7585
|
+
if (text.startsWith("ERROR:")) throw new ValidationError(text);
|
|
7586
|
+
const result = z.record(z.string(), z.unknown()).parse(JSON.parse(text));
|
|
7587
|
+
if (result.error) throw new ValidationError(`remote supervisor refused observation: ${String(result.error)}`);
|
|
7588
|
+
return result;
|
|
7589
|
+
};
|
|
7590
|
+
return {
|
|
7591
|
+
tree: async () => treeSchema.parse((await call({ tree: true })).tree),
|
|
7592
|
+
observe: async (workerId, cursor) => {
|
|
7593
|
+
const agent = await call({
|
|
7594
|
+
workerId,
|
|
7595
|
+
events: true,
|
|
7596
|
+
...cursor ? { eventCursor: cursor } : {}
|
|
7597
|
+
});
|
|
7598
|
+
return {
|
|
7599
|
+
agent,
|
|
7600
|
+
events: eventPageSchema.parse(agent.events)
|
|
7601
|
+
};
|
|
7602
|
+
},
|
|
7603
|
+
close: () => connection.close()
|
|
7604
|
+
};
|
|
7605
|
+
}
|
|
7606
|
+
//#endregion
|
|
7542
7607
|
//#region src/runtime/supervise/search-spec.ts
|
|
7543
7608
|
/**
|
|
7544
7609
|
* SearchSpec: one data value for a multi-agent research configuration, and the compiler that maps
|
|
@@ -7852,7 +7917,7 @@ function compileSearchSpec(raw, inputs) {
|
|
|
7852
7917
|
};
|
|
7853
7918
|
const backend = placedBackend(spec, inputs);
|
|
7854
7919
|
const callerOwnsLeaves = passed.makeLeafAgent !== void 0 || passed.makeWorkerAgent !== void 0;
|
|
7855
|
-
if (spec.comms === "messages" && backend !== void 0 && backend.backend !== "bridge" && !callerOwnsLeaves) refuse(`comms 'messages' needs workers that can call peer mail: Runtime mounts it on 'bridge' workers, and '${backend.backend}' workers run no client for it. Run the workers on a bridge, or mount WorkerSpawnContext.peerMailUrl through makeLeafAgent`);
|
|
7920
|
+
if (spec.comms === "messages" && backend !== void 0 && backend.backend !== "bridge" && backend.backend !== "provider" && !callerOwnsLeaves) refuse(`comms 'messages' needs workers that can call peer mail: Runtime mounts it on 'bridge' or capable 'provider' workers, and '${backend.backend}' workers run no client for it. Run the workers on a bridge, or mount WorkerSpawnContext.peerMailUrl through makeLeafAgent`);
|
|
7856
7921
|
const analystKinds = spec.evaluate.analysts ?? [];
|
|
7857
7922
|
if (analystKinds.length > 0 && inputs.analysts === void 0) refuse("evaluate.analysts names analyst kinds, and inputs.analysts holds no registry to run them");
|
|
7858
7923
|
const axisOptions = {
|
|
@@ -9212,6 +9277,6 @@ function tail(s) {
|
|
|
9212
9277
|
return s.slice(-400);
|
|
9213
9278
|
}
|
|
9214
9279
|
//#endregion
|
|
9215
|
-
export {
|
|
9280
|
+
export { runBenchmark as $, McpSpawnFault as $t, connectRemoteSupervisor as A, inlineSandboxClient as At, chatTransportExecutor as B, runIsolatedCheck as Bt, analyzeTrace as C, observationFromRegistry as Ct, compileSearchSpec as D, defineLeaderboard as Dt, assertSearchSpec as E, harvestCorpus as Et, profileRunsForName as F, checkProgramDigest as Ft, assertStrategyContract as G, leaderboard as Gt, createChatSessionStore as H, deterministicCompletion as Ht, recordProfileRun as I, declaredCheckDeliverable as It, strategyAuthorSystemPrompt as J, renderLeaderboardMarkdown as Jt, authorStrategy as K, pairwiseSignificance as Kt, patchDelivered as L, declaredCheckDigest as Lt, loadProfile as M, loopDispatch as Mt, pickBestProfile as N, superviseDispatch as Nt, searchPresets as O, resolveSandboxClient as Ot, profileRegistry as P, assertDeclaredCheck as Pt, printBenchmarkReport as Q, openSqlRunStore as Qt, runCoderChecks as R, declaredCheckJudge as Rt, withUntrackedArtifacts as S, registryScopeAnalyst as St, SEARCH_SPEC_CORRELATION_KEY as T, HarvestError as Tt, runStrategyEvolution as U, sentinelCompletion as Ut, chatWorkerSeam as V, completionAuthorizes as Vt, strategyTournament as W, stopSentinel as Wt, openSandboxRun as X, renderPairwiseMarkdown as Xt, SandboxRunAbortError as Y, renderLeaderboardSvg as Yt, createS3PrivateCasStore as Z, SqlRunOwnershipError as Zt, VERIFY_TAIL_CHARS as _, verify as _t, localShell as a, mcpSecretEnvMetadataKey as an, builtinShapes as at, settledWorkerOut as b, buildSteerContext as bt, createVerifierEnvironment as c, secretEnvOfMcpServer as cn, FileCorpus as ct, harvestSurfaceDiffs as d, fanout as dt, connectStdioMcp as en, createPrivateCasArtifactPort as et, analystsFromRegistry as f, flatWidenGate as ft, NOTE_MAX_CHARS as g, selectValidWinner as gt, EVIDENCE_MAX_CHARS as h, pipeline as ht, jjWorkspace as i, envKeyProvider as in, runPersonified as it, bestProfileFor as j, loopCampaignDispatch as jt, searchSpecDigest as k, localSandboxClient as kt, boxSurfaceReader as l, createTangleSandboxExactProcessProvider as ln, InMemoryCorpus as lt, worktreeFanout as m, panel as mt, makeFinding$1 as n, createMcpEnvironment as nn, trajectoryReport as nt, runInWorkspace as o, resolveMcpServerLaunch as on, createShapeRegistry as ot, failuresAnalyst as p, loopUntil as pt, strategyAuthorContract as q, renderLeaderboardHtml as qt, gitWorkspace as r, sanitizeMcpToolSchema as rn, definePersona as rt, createWaterfallCollector as s, resolveSecretEnv as sn, registerShape as st, computeFindingId$1 as t, materializeLocalMcp as tn, equalKOnCost as tt, fsSurfaceReader as u, renderCorpusToInstructions as ut, closingWorkerNote as v, widen as vt, createFencedSqlRunContext as w, inProcessSandboxClient as wt, copyUntrackedIntoClone as x, createScopeAnalyst as xt, composeWorkerEvidence as y, assertTraceDerivedFindings as yt, graphDesignerExtraTools as z, readDeclaredCheck as zt };
|
|
9216
9281
|
|
|
9217
|
-
//# sourceMappingURL=runtime-
|
|
9282
|
+
//# sourceMappingURL=runtime-zv5GK0m4.js.map
|