@tangle-network/agent-runtime 0.117.0 → 0.119.0
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 +2 -0
- package/dist/{activation-BZ2FyX0O.js → activation-DdIpwQ0k.js} +3 -3
- package/dist/{activation-BZ2FyX0O.js.map → activation-DdIpwQ0k.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/candidate-execution/index.d.ts +2 -2
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-PX61zXd2.js → candidate-execution-DDkSRPjY.js} +4 -4
- package/dist/{candidate-execution-PX61zXd2.js.map → candidate-execution-DDkSRPjY.js.map} +1 -1
- package/dist/{environment-provider-CTZjdIUg.d.ts → environment-provider-Bh4nX2qt.d.ts} +9 -1
- package/dist/{environment-provider-CzcEyRL7.js → environment-provider-Cr75N-rU.js} +2 -2
- package/dist/{environment-provider-CzcEyRL7.js.map → environment-provider-Cr75N-rU.js.map} +1 -1
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-cycle-Bcqz8rZI.js → improvement-cycle-zjR-MXwK.js} +7 -7
- package/dist/improvement-cycle-zjR-MXwK.js.map +1 -0
- package/dist/{index-X2YwyWkc.d.ts → index-B3bHsVLw.d.ts} +2 -2
- package/dist/{index-BHSYaWrC.d.ts → index-BLsKcxNd.d.ts} +3 -3
- package/dist/{index-DPWJxSRa.d.ts → index-CGADWaa_.d.ts} +20 -165
- package/dist/{index-BTUG4Xln.d.ts → index-I35151Fr.d.ts} +9 -9
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +4 -4
- package/dist/intelligence.js +6 -6
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +8 -7
- package/dist/{knowledge-CDlrayRc.js → knowledge-I1e9zQGj.js} +5 -5
- package/dist/{knowledge-CDlrayRc.js.map → knowledge-I1e9zQGj.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{local-harness-t6cDWDQ2.d.ts → local-harness-BIajef4A.d.ts} +29 -7
- package/dist/{loop-runner-bin-oyL7it5O.d.ts → loop-runner-bin-BeG9vTdE.d.ts} +3 -3
- package/dist/{loop-runner-bin-BxhhDtmG.js → loop-runner-bin-L996YVPS.js} +3 -3
- package/dist/{loop-runner-bin-BxhhDtmG.js.map → loop-runner-bin-L996YVPS.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/index.js +8 -13
- package/dist/mcp/index.js.map +1 -1
- package/dist/{openai-tools-CO9X36zy.js → openai-tools-CvFEzw6f.js} +2 -2
- package/dist/{openai-tools-CO9X36zy.js.map → openai-tools-CvFEzw6f.js.map} +1 -1
- package/dist/{prepare-BbI6qGOW.js → prepare-DpV6np9e.js} +44 -34
- package/dist/{prepare-BbI6qGOW.js.map → prepare-DpV6np9e.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-B0yXMpLL.d.ts → protected-model-port-CoJOiINX.d.ts} +2 -2
- package/dist/{protected-model-port-COnyZfML.js → protected-model-port-vQLBRoAQ.js} +2 -2
- package/dist/{protected-model-port-COnyZfML.js.map → protected-model-port-vQLBRoAQ.js.map} +1 -1
- package/dist/{redact-BEtQtvd6.d.ts → redact-PQzmE1Jn.d.ts} +4 -4
- package/dist/run-layout-C2FGmZ3v.js +158 -0
- package/dist/run-layout-C2FGmZ3v.js.map +1 -0
- package/dist/{runtime-Ce39zfqn.js → runtime-D4e3GP5K.js} +7 -142
- package/dist/runtime-D4e3GP5K.js.map +1 -0
- package/dist/{spawn-journal-B_mu_oH2.js → spawn-journal-IeXpidO2.js} +2 -2
- package/dist/{spawn-journal-B_mu_oH2.js.map → spawn-journal-IeXpidO2.js.map} +1 -1
- package/dist/{structural-rollout-DLwW69R4.js → structural-rollout-DQHO3b2Y.js} +3 -3
- package/dist/{structural-rollout-DLwW69R4.js.map → structural-rollout-DQHO3b2Y.js.map} +1 -1
- package/dist/{supervise-U7_K5yuV.js → supervise-Cq50UT5-.js} +289 -1084
- package/dist/supervise-Cq50UT5-.js.map +1 -0
- package/dist/{supervisor-CAXiCKnX.js → supervisor-CpT9yAxL.js} +113 -35
- package/dist/supervisor-CpT9yAxL.js.map +1 -0
- package/dist/testing.js +10 -10
- package/dist/top-app-5unxqovu.js +1088 -0
- package/dist/top-app-5unxqovu.js.map +1 -0
- package/dist/tui/bin.d.ts +1 -0
- package/dist/tui/bin.js +19 -0
- package/dist/tui/bin.js.map +1 -0
- package/dist/tui/index.d.ts +209 -0
- package/dist/tui/index.js +2 -0
- package/dist/{util-Cc9g9Y-o.js → util-MVgdwuIS.js} +2 -2
- package/dist/{util-Cc9g9Y-o.js.map → util-MVgdwuIS.js.map} +1 -1
- package/dist/{workspace-archive-CqPIijFA.js → workspace-archive-B4SkNJjw.js} +2 -2
- package/dist/{workspace-archive-CqPIijFA.js.map → workspace-archive-B4SkNJjw.js.map} +1 -1
- package/package.json +8 -2
- package/dist/improvement-cycle-Bcqz8rZI.js.map +0 -1
- package/dist/runtime-Ce39zfqn.js.map +0 -1
- package/dist/supervise-U7_K5yuV.js.map +0 -1
- package/dist/supervisor-CAXiCKnX.js.map +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { n as AnalystError, r as BackendTransportError, s as PlannerError, u as ValidationError } from "./errors-DEAvWQPy.js";
|
|
2
2
|
import { i as normalizeBackendStreamEvent, o as newRuntimeSession, s as nowIso } from "./backends-CiOCyRHb.js";
|
|
3
|
-
import { i as InMemorySpawnJournal, r as InMemoryResultBlobStore, v as isTraceAnalysisStore } from "./spawn-journal-
|
|
4
|
-
import {
|
|
3
|
+
import { i as InMemorySpawnJournal, r as InMemoryResultBlobStore, v as isTraceAnalysisStore } from "./spawn-journal-IeXpidO2.js";
|
|
4
|
+
import { a as randomSuffix, c as stringifySafe, f as zeroTokenUsage, r as isAbortError, s as sleep, t as addTokenUsage } from "./util-MVgdwuIS.js";
|
|
5
5
|
import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction--F3v1oo8.js";
|
|
6
|
-
import {
|
|
7
|
-
import { C as observe, O as strategyAuthorMethod, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-
|
|
6
|
+
import { X as rollingDispatch, dt as routerBrain, gt as runBrainLoop, l as withDriverExecutor, m as settledToIteration, n as createSupervisor, pt as routerChatWithUsage } from "./supervisor-CpT9yAxL.js";
|
|
7
|
+
import { C as observe, O as strategyAuthorMethod, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-DQHO3b2Y.js";
|
|
8
8
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
|
|
9
9
|
import { a as notifySandboxEventObserver, i as mapSandboxToolEvent, r as mapSandboxEvent, t as createSandboxToolPartState } from "./sandbox-events-Yhd1GYWl.js";
|
|
10
|
-
import {
|
|
10
|
+
import { At as runAgentRounds, Kt as gateOnDeliverable, Mt as createSandboxLineage, Nt as probeSandboxCapabilities, bt as createExecutorRegistry, kt as defaultSelectWinner, n as supervise, wt as createPushTraceSource, xt as createWorktreeCliExecutor, yt as createExecutor } from "./supervise-Cq50UT5-.js";
|
|
11
11
|
import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, harnessAxisOf, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, scoreKnowledgeReadiness, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
|
|
12
12
|
import { heldoutSignificance, runProfileMatrix } from "@tangle-network/agent-eval/campaign";
|
|
13
13
|
import { canonicalCandidateDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
14
|
-
import { randomUUID } from "node:crypto";
|
|
15
14
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
16
15
|
import { appendFileSync, chmodSync, constants, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
17
16
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -4778,140 +4777,6 @@ function signalPass(value, required) {
|
|
|
4778
4777
|
return !required;
|
|
4779
4778
|
}
|
|
4780
4779
|
//#endregion
|
|
4781
|
-
//#region src/runtime/supervise/run-layout.ts
|
|
4782
|
-
/**
|
|
4783
|
-
* The on-disk supervisor-run layout: `<root>/.agent/supervisor/<id>`.
|
|
4784
|
-
*
|
|
4785
|
-
* This is the durable, cross-process face of a supervisor run — the counterpart to the in-process
|
|
4786
|
-
* `Inbox` seam in `./inbox`. A run persists its state under one directory so that any OTHER process
|
|
4787
|
-
* can find it after the fact: `@tangle-network/traces` reads exactly this layout via
|
|
4788
|
-
* `traces analyze --supervisor-run-dir`, a restarted host can rehydrate a run it no longer holds
|
|
4789
|
-
* handles to, and a human can steer a live worker by appending one NDJSON line. Until now the
|
|
4790
|
-
* layout was defined only in the unpublished `loops` repo (`src/supervisor-control.ts`) — a
|
|
4791
|
-
* published reader depending on an unpublished writer's convention — so the contract is promoted
|
|
4792
|
-
* here, names preserved.
|
|
4793
|
-
*
|
|
4794
|
-
* `.agent` is the one dot-dir for ALL agent-owned state (skills already write
|
|
4795
|
-
* `.agent/hypotheses/`, `.agent/skill-runs.jsonl`); supervisor runs live beside them rather than
|
|
4796
|
-
* under a product-branded dir. Runs written by older writers used `.loops/supervisor/<id>` —
|
|
4797
|
-
* readers that must see those keep a legacy fallback; this writer never creates `.loops` again.
|
|
4798
|
-
*
|
|
4799
|
-
* Layout, relative to `supervisorRunDir(root, id)`:
|
|
4800
|
-
*
|
|
4801
|
-
* workers/<label>.inbox.ndjson down-leg steer/answer requests for one worker (durable inbox);
|
|
4802
|
-
* each line is a {@link WorkerSteerRequest}
|
|
4803
|
-
* workers/<label>.ndjson best-effort per-worker control-event log (delivery bookkeeping)
|
|
4804
|
-
*
|
|
4805
|
-
* Reads are tolerant by contract: a partial trailing line (a writer mid-append) or a corrupt line
|
|
4806
|
-
* never poisons the rest of the file — later valid lines still matter.
|
|
4807
|
-
*
|
|
4808
|
-
* Promoted from `loops/src/supervisor-control.ts`. The one deliberate difference: the loops version
|
|
4809
|
-
* resolved a worker id to its label through the run journal before writing a steer; that resolution
|
|
4810
|
-
* stays with the caller (it is journal-format-specific), so `writeWorkerSteer` here takes the worker
|
|
4811
|
-
* LABEL directly.
|
|
4812
|
-
*
|
|
4813
|
-
* @experimental
|
|
4814
|
-
*/
|
|
4815
|
-
/** The root every supervisor run of one workspace lives under. */
|
|
4816
|
-
function supervisorRunsRoot(rootDir) {
|
|
4817
|
-
return join(resolve(rootDir), ".agent", "supervisor");
|
|
4818
|
-
}
|
|
4819
|
-
/** The run directory every artifact of one supervisor run lives under. */
|
|
4820
|
-
function supervisorRunDir(rootDir, id) {
|
|
4821
|
-
return join(supervisorRunsRoot(rootDir), id);
|
|
4822
|
-
}
|
|
4823
|
-
/**
|
|
4824
|
-
* Where a pre-rename writer put the same run (`<root>/.loops/supervisor/<id>`). Readers that must
|
|
4825
|
-
* see historical runs check {@link supervisorRunDir} first and fall back to this; nothing writes
|
|
4826
|
-
* here anymore.
|
|
4827
|
-
*/
|
|
4828
|
-
function legacySupervisorRunDir(rootDir, id) {
|
|
4829
|
-
return join(resolve(rootDir), ".loops", "supervisor", id);
|
|
4830
|
-
}
|
|
4831
|
-
/** A worker label reduced to a safe filename stem. Empty labels get a stable fallback. */
|
|
4832
|
-
function safeWorkerFile(label) {
|
|
4833
|
-
const safe = label.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
4834
|
-
return safe.length > 0 ? safe : "worker";
|
|
4835
|
-
}
|
|
4836
|
-
/** The durable inbox file for one worker of one run. */
|
|
4837
|
-
function workerInboxFile(rootDir, supervisorId, worker) {
|
|
4838
|
-
return workerInboxFileFromEventDir(supervisorRunDir(rootDir, supervisorId), worker);
|
|
4839
|
-
}
|
|
4840
|
-
/** Same, addressed from an already-known run directory (the reader's usual entry point). */
|
|
4841
|
-
function workerInboxFileFromEventDir(eventDir, worker) {
|
|
4842
|
-
return join(eventDir, "workers", `${safeWorkerFile(worker)}.inbox.ndjson`);
|
|
4843
|
-
}
|
|
4844
|
-
/**
|
|
4845
|
-
* Durably append one steer request to a worker's inbox and log the delivery attempt.
|
|
4846
|
-
*
|
|
4847
|
-
* The inbox append is the durable act; the control-event log is best-effort bookkeeping and may
|
|
4848
|
-
* silently fail without voiding the steer.
|
|
4849
|
-
*/
|
|
4850
|
-
function writeWorkerSteer(rootDir, supervisorId, worker, message, source = "human") {
|
|
4851
|
-
const trimmed = message.trim();
|
|
4852
|
-
if (!trimmed) throw new Error("steer message is empty");
|
|
4853
|
-
const dir = supervisorRunDir(rootDir, supervisorId);
|
|
4854
|
-
mkdirSync(join(dir, "workers"), { recursive: true });
|
|
4855
|
-
const request = {
|
|
4856
|
-
id: randomUUID(),
|
|
4857
|
-
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4858
|
-
source,
|
|
4859
|
-
worker,
|
|
4860
|
-
message: trimmed
|
|
4861
|
-
};
|
|
4862
|
-
const file = workerInboxFile(rootDir, supervisorId, worker);
|
|
4863
|
-
appendFileSync(file, `${JSON.stringify(request)}\n`, "utf8");
|
|
4864
|
-
appendWorkerControlEvent(dir, worker, {
|
|
4865
|
-
kind: "message",
|
|
4866
|
-
direction: "down",
|
|
4867
|
-
source,
|
|
4868
|
-
requestId: request.id,
|
|
4869
|
-
message: trimmed,
|
|
4870
|
-
queued: true,
|
|
4871
|
-
delivered: false
|
|
4872
|
-
});
|
|
4873
|
-
return {
|
|
4874
|
-
worker,
|
|
4875
|
-
file,
|
|
4876
|
-
request
|
|
4877
|
-
};
|
|
4878
|
-
}
|
|
4879
|
-
/** Read every valid steer request in a worker's inbox. Corrupt or partial lines are skipped. */
|
|
4880
|
-
function readWorkerSteerRequests(eventDir, worker) {
|
|
4881
|
-
const file = workerInboxFileFromEventDir(eventDir, worker);
|
|
4882
|
-
if (!existsSync(file)) return [];
|
|
4883
|
-
const out = [];
|
|
4884
|
-
let raw = "";
|
|
4885
|
-
try {
|
|
4886
|
-
raw = readFileSync(file, "utf8");
|
|
4887
|
-
} catch {
|
|
4888
|
-
return out;
|
|
4889
|
-
}
|
|
4890
|
-
for (const line of raw.split("\n")) {
|
|
4891
|
-
const trimmed = line.trim();
|
|
4892
|
-
if (!trimmed) continue;
|
|
4893
|
-
try {
|
|
4894
|
-
const parsed = JSON.parse(trimmed);
|
|
4895
|
-
if (isWorkerSteerRequest(parsed)) out.push(parsed);
|
|
4896
|
-
} catch {}
|
|
4897
|
-
}
|
|
4898
|
-
return out;
|
|
4899
|
-
}
|
|
4900
|
-
function appendWorkerControlEvent(eventDir, label, event) {
|
|
4901
|
-
try {
|
|
4902
|
-
const workersDir = join(eventDir, "workers");
|
|
4903
|
-
mkdirSync(workersDir, { recursive: true });
|
|
4904
|
-
appendFileSync(join(workersDir, `${safeWorkerFile(label)}.ndjson`), `${JSON.stringify({
|
|
4905
|
-
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4906
|
-
label,
|
|
4907
|
-
...event
|
|
4908
|
-
})}\n`, "utf8");
|
|
4909
|
-
} catch {}
|
|
4910
|
-
}
|
|
4911
|
-
function isWorkerSteerRequest(value) {
|
|
4912
|
-
return typeof value.id === "string" && typeof value.at === "string" && typeof value.source === "string" && typeof value.worker === "string" && typeof value.message === "string" && value.message.trim().length > 0;
|
|
4913
|
-
}
|
|
4914
|
-
//#endregion
|
|
4915
4780
|
//#region src/runtime/supervise/trajectory-recorder.ts
|
|
4916
4781
|
/**
|
|
4917
4782
|
*
|
|
@@ -5912,6 +5777,6 @@ function tail(s) {
|
|
|
5912
5777
|
return s.slice(-400);
|
|
5913
5778
|
}
|
|
5914
5779
|
//#endregion
|
|
5915
|
-
export {
|
|
5780
|
+
export { verify as $, authorStrategy as A, createMcpEnvironment as At, runPersonified as B, collectAgentTurn as C, renderLeaderboardSvg as Ct, runStrategyEvolution as D, McpSpawnFault as Dt, pickChampion as E, defaultAuditorInstruction as Et, runBenchmark as F, resolveSecretEnv as Ft, InMemoryCorpus as G, createShapeRegistry as H, promotionGate as I, secretEnvOfMcpServer as It, flatWidenGate as J, renderCorpusToInstructions as K, equalKOnCost as L, SandboxRunAbortError as M, envKeyProvider as Mt, openSandboxRun as N, mcpSecretEnvMetadataKey as Nt, selectChampion as O, connectStdioMcp as Ot, printBenchmarkReport as P, resolveMcpServerLaunch as Pt, selectValidWinner as Q, trajectoryReport as R, runCoderChecks as S, renderLeaderboardMarkdown as St, discriminatingMeans as T, auditIntent as Tt, registerShape as U, builtinShapes as V, FileCorpus as W, panel as X, loopUntil as Y, pipeline as Z, settledWorkerOut as _, sentinelCompletion as _t, localShell as a, inProcessSandboxClient as at, analyzeTrace as b, pairwiseSignificance as bt, createVerifierEnvironment as c, dumbDriver as ct, worktreeFanout as d, localSandboxClient as dt, widen as et, EVIDENCE_MAX_CHARS as f, inlineSandboxClient as ft, composeWorkerEvidence as g, deterministicCompletion as gt, closingWorkerNote as h, completionAuthorizes as ht, jjWorkspace as i, registryScopeAnalyst as it, strategyAuthorContract as j, sanitizeMcpToolSchema as jt, assertStrategyContract as k, materializeLocalMcp as kt, failuresAnalyst as l, naiveDriver as lt, VERIFY_TAIL_CHARS as m, loopDispatch as mt, makeFinding$1 as n, buildSteerContext as nt, runInWorkspace as o, harvestCorpus as ot, NOTE_MAX_CHARS as p, loopCampaignDispatch as pt, fanout as q, gitWorkspace as r, createScopeAnalyst as rt, createWaterfallCollector as s, defineLeaderboard as st, computeFindingId$1 as t, assertTraceDerivedFindings as tt, superviseSurface as u, resolveSandboxClient as ut, copyUntrackedIntoClone as v, stopSentinel as vt, streamAgentTurn as w, renderPairwiseMarkdown as wt, patchDelivered as x, renderLeaderboardHtml as xt, withUntrackedArtifacts as y, leaderboard as yt, definePersona as z };
|
|
5916
5781
|
|
|
5917
|
-
//# sourceMappingURL=runtime-
|
|
5782
|
+
//# sourceMappingURL=runtime-D4e3GP5K.js.map
|