@tangle-network/agent-runtime 0.194.0 → 0.195.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/dist/{activation-BQFIiyUG.js → activation-B4adh0sA.js} +3 -3
- package/dist/{activation-BQFIiyUG.js.map → activation-B4adh0sA.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-B6CDW-fp.js → candidate-execution-nvqVIMyS.js} +5 -4
- package/dist/{candidate-execution-B6CDW-fp.js.map → candidate-execution-nvqVIMyS.js.map} +1 -1
- package/dist/{coordination-driver-iSN-m3VX.js → coordination-driver-CuShDjRV.js} +3 -3
- package/dist/{coordination-driver-iSN-m3VX.js.map → coordination-driver-CuShDjRV.js.map} +1 -1
- package/dist/{delegate-DCC2muUd.js → delegate-CSFC-Kh3.js} +2 -2
- package/dist/{delegate-DCC2muUd.js.map → delegate-CSFC-Kh3.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +2 -2
- package/dist/{environment-provider-Dr-wfnHg.js → environment-provider-Z1JazbJ1.js} +108 -10
- package/dist/environment-provider-Z1JazbJ1.js.map +1 -0
- package/dist/environment-provider.js +1 -1
- package/dist/{graph-DghidDx5.js → graph-DqPUeri6.js} +3 -3
- package/dist/{graph-DghidDx5.js.map → graph-DqPUeri6.js.map} +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/graph.js +4 -4
- package/dist/{improve-COGzLCiY.d.ts → improve-7VTwse1c.d.ts} +4 -4
- package/dist/{improvement-cycle-DeS1ZC5B.js → improvement-cycle-DEbciBTL.js} +20 -6
- package/dist/{improvement-cycle-DeS1ZC5B.js.map → improvement-cycle-DEbciBTL.js.map} +1 -1
- package/dist/{index-CrBgLCIf.d.ts → index-CVD30soi.d.ts} +2 -2
- package/dist/{index-BEPjOPwH.d.ts → index-DNx0nWZH.d.ts} +9 -2
- package/dist/index.d.ts +6 -5
- package/dist/index.js +72 -26
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +1 -1
- package/dist/intelligence.js +7 -6
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +9 -9
- package/dist/{knowledge-B5okOzBQ.js → knowledge-B0Mrp-XB.js} +7 -17
- package/dist/knowledge-B0Mrp-XB.js.map +1 -0
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-U1J6x_UF.js → loop-runner-bin-C5K46H0Q.js} +3 -3
- package/dist/{loop-runner-bin-U1J6x_UF.js.map → loop-runner-bin-C5K46H0Q.js.map} +1 -1
- package/dist/{loop-runner-bin-Clc5IAwu.d.ts → loop-runner-bin-b4585v9Z.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 +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/{prepare-C29kNAon.js → prepare-DDGp0-rW.js} +4 -54
- package/dist/prepare-DDGp0-rW.js.map +1 -0
- package/dist/profiles.js +454 -1
- package/dist/profiles.js.map +1 -1
- package/dist/{protected-model-port-CKYND416.js → protected-model-port-DxFN8DLS.js} +3 -2
- package/dist/{protected-model-port-CKYND416.js.map → protected-model-port-DxFN8DLS.js.map} +1 -1
- package/dist/{protected-redaction--F3v1oo8.js → protected-redaction-wGo44k2K.js} +54 -3
- package/dist/protected-redaction-wGo44k2K.js.map +1 -0
- package/dist/{provision-supervisor-CRPbnJiB.js → provision-supervisor-chyz0_Aj.js} +4 -4
- package/dist/{provision-supervisor-CRPbnJiB.js.map → provision-supervisor-chyz0_Aj.js.map} +1 -1
- package/dist/{redact-BOU77QfQ.js → redact-Dv6PeuQz.js} +2 -2
- package/dist/{redact-BOU77QfQ.js.map → redact-Dv6PeuQz.js.map} +1 -1
- package/dist/{runtime-BVrqSu0-.js → runtime-BZryF6gD.js} +140 -65
- package/dist/runtime-BZryF6gD.js.map +1 -0
- package/dist/{server-D6XmE1Du.js → server-BorSFmn8.js} +3 -3
- package/dist/{server-D6XmE1Du.js.map → server-BorSFmn8.js.map} +1 -1
- package/dist/{structural-rollout-BcPXFzVb.js → structural-rollout-pOqANr8Y.js} +23 -10
- package/dist/structural-rollout-pOqANr8Y.js.map +1 -0
- package/dist/{supervise-C0V3pZXK.js → supervise-BReI5ATC.js} +4 -4
- package/dist/{supervise-C0V3pZXK.js.map → supervise-BReI5ATC.js.map} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +14 -13
- package/dist/testing.js.map +1 -1
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{workspace-archive-BCezkeIk.js → workspace-archive-Ybomp7AN.js} +3 -2
- package/dist/{workspace-archive-BCezkeIk.js.map → workspace-archive-Ybomp7AN.js.map} +1 -1
- package/package.json +4 -4
- package/skills/agent-graphs/SKILL.md +28 -123
- package/skills/agent-graphs/references/authoring.md +34 -0
- package/skills/agent-graphs/references/measurement.md +18 -0
- package/skills/build-with-agent-runtime/SKILL.md +31 -117
- package/skills/build-with-agent-runtime/references/improvement.md +32 -0
- package/skills/codemode/SKILL.md +22 -34
- package/skills/codemode/references/runtime-execution.md +14 -0
- package/skills/generate-eval/SKILL.md +2 -1
- package/skills/loop-writer/SKILL.md +30 -84
- package/skills/supervise/SKILL.md +43 -95
- package/skills/supervise/references/profile-authoring.md +19 -0
- package/dist/environment-provider-Dr-wfnHg.js.map +0 -1
- package/dist/knowledge-B5okOzBQ.js.map +0 -1
- package/dist/prepare-C29kNAon.js.map +0 -1
- package/dist/protected-redaction--F3v1oo8.js.map +0 -1
- package/dist/researcher-Cp4JRbFp.js +0 -457
- package/dist/researcher-Cp4JRbFp.js.map +0 -1
- package/dist/runtime-BVrqSu0-.js.map +0 -1
- package/dist/structural-rollout-BcPXFzVb.js.map +0 -1
- package/skills/agent-graphs/IMPROVE.md +0 -58
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ps as SupervisorProfile, qp as DeliverableSpec, zo as SuperviseOptions } from "./index-
|
|
1
|
+
import { ps as SupervisorProfile, qp as DeliverableSpec, zo as SuperviseOptions } from "./index-DNx0nWZH.js";
|
|
2
2
|
import { Z as SupervisedResult, i as Budget } from "./types-B_pNTBjK.js";
|
|
3
3
|
import { c as ExecutorConfig } from "./runtime-B8x43nGP.js";
|
|
4
4
|
import { y as AgentCandidateOutputArtifactPort } from "./types-1s_29INY.js";
|
|
@@ -135,4 +135,4 @@ declare function runKnowledgeImprovementJob(options: RunKnowledgeImprovementJobO
|
|
|
135
135
|
declare function buildKnowledgeImprovementExperimentBundles(bundle: AgentCandidateBundle, knowledge: KnowledgeImprovementCandidatePair): KnowledgeImprovementExperimentBundles;
|
|
136
136
|
//#endregion
|
|
137
137
|
export { KnowledgeImprovementActivationExecutor as C, CreateKnowledgeImprovementActivationExecutorOptions as S, SupervisedKnowledgeUpdater as _, KnowledgeImprovementJobResult as a, knowledgeReadinessDeliverable as b, createAgentKnowledgeReadinessCheck as c, KnowledgeReadinessCheckInput as d, KnowledgeReadinessCheckResult as f, SupervisedKnowledgeUpdateResult as g, SupervisedKnowledgeUpdateOptions as h, KnowledgeImprovementJobMeasurement as i, runKnowledgeImprovementJob as l, SupervisedKnowledgeUpdateInput as m, KnowledgeImprovementCandidatePair as n, RunKnowledgeImprovementJobOptions as o, RESEARCH_SUPERVISOR_SYSTEM_PROMPT as p, KnowledgeImprovementExperimentBundles as r, buildKnowledgeImprovementExperimentBundles as s, AgentKnowledgeReadinessCheckOptions as t, KnowledgeReadinessCheck as u, createSupervisedKnowledgeUpdater as v, createKnowledgeImprovementActivationExecutor as w, runSupervisedKnowledgeUpdate as x, formatSupervisedKnowledgeTask as y };
|
|
138
|
-
//# sourceMappingURL=index-
|
|
138
|
+
//# sourceMappingURL=index-CVD30soi.d.ts.map
|
|
@@ -6913,7 +6913,7 @@ declare function materializeLocalMcp(profile: AgentProfile, opts?: MaterializeLo
|
|
|
6913
6913
|
//#endregion
|
|
6914
6914
|
//#region src/runtime/strategy-author.d.ts
|
|
6915
6915
|
/** The compressed consumable a skill carries: everything an author needs to emit a loop. */
|
|
6916
|
-
declare const strategyAuthorContract = "\nYou author an OPTIMIZATION STRATEGY for an agentic loop system. A strategy decides how to\nspend a compute budget to beat a task's deployable check. You compose exactly two steps:\n\n shot(spec?: { handle?, messages?, steer?,
|
|
6916
|
+
declare const strategyAuthorContract = "\nYou author an OPTIMIZATION STRATEGY for an agentic loop system. A strategy decides how to\nspend a compute budget to beat a task's deployable check. You compose exactly two steps:\n\n shot(spec?: { handle?, messages?, steer?, profile?, tools? }): Promise<ShotResult | null>\n Runs ONE worker attempt (a bounded tool loop) over an artifact.\n - omit handle => the shot opens its OWN fresh artifact and closes it after (a sample).\n - pass handle => the shot CONTINUES that artifact (state accumulates across shots).\n - messages => the carried conversation (pass the previous ShotResult.messages to continue).\n - steer => a corrective instruction injected before the shot.\n - profile => a complete AgentProfile — give THIS shot its own instructions,\n model, skills, tools, hooks, and subagents. Include name, harness, and\n model: { provider, default }; put standing instructions in prompt.systemPrompt.\n For example: { ...opts.workerProfile, name: 'researcher',\n prompt: { ...opts.workerProfile.prompt,\n systemPrompt: 'Inspect the evidence before proposing a change.' } }.\n Choose an available model from the current execution setup. Omit profile to use\n the worker's exact profile. Every shot spends from the same conserved budget.\n - tools => string[] — restrict THIS shot to a subset of the task's tools by\n name (focus an explore shot on read-only tools, an execute shot on write tools).\n Restriction-only; unknown names make the shot fail. ALWAYS select from\n await listTools(handle) — never hardcode. Omitted => the shot sees every tool.\n ShotResult = { messages, score (0..1 on the task's check), passes, total, completions, toolErrors }\n Returns null if the attempt failed infra-wise.\n\n critique(messages): Promise<string | null>\n A firewalled trace-analyst reads the attempt's trajectory and returns ONE corrective\n instruction (or null when it judges the work complete). Costs ~1 completion.\n\n consult(messages, instruction): Promise<string | null>\n The RAW analyst channel: the same firewalled critic answers YOUR instruction over the\n trajectory verbatim (no reformatting) — use it when you need a specific reply format\n (a decision, a prediction). Costs ~1 completion.\n\n surface.open(task) / surface.close(handle)\n Open a persistent artifact you manage yourself (remember to close in a finally).\n close is idempotent — closing an already-closed handle is a safe no-op.\n\n listTools(handle): Promise<Array<{ name, description? }>>\n The tools THIS task actually offers. TOOL SETS VARY PER TASK — if you restrict a\n shot with `tools`, you MUST pick names from await listTools(handle); hardcoding\n names from an example kills your shots on every task whose tools differ.\n\nRules:\n- ALWAYS await every shot/critique/surface call — a floating promise that rejects\n crashes the whole benchmark run.\n- Stay within ~budget total shots; every shot/critique spends from a conserved pool.\n- For a FRESH attempt OMIT `messages` entirely (never pass `[]` — an empty array is a\n fresh conversation too, but be explicit). To CONTINUE, pass the previous\n ShotResult.messages unchanged.\n- Return { score, resolved, completions, progression, shots } — score = the BEST checkpoint\n you reached (keep-best, never final-state), progression = score after each shot.\n- The module must be EXACTLY this shape (no other imports, no commentary outside code):\n\nimport { defineStrategy } from '@tangle-network/agent-runtime/kernel'\nexport default defineStrategy('your-strategy-name', async ({ surface, task, opts, budget, shot, critique, listTools }) => {\n // your composition (listTools comes from the destructured context — it is NOT a global)\n})\n";
|
|
6917
6917
|
interface AuthorStrategyOptions {
|
|
6918
6918
|
/** Exact author identity. Runtime binds it to every authoring turn. */
|
|
6919
6919
|
profile: AgentProfile;
|
|
@@ -7053,6 +7053,11 @@ interface StrategyEvolutionConfig {
|
|
|
7053
7053
|
checkpoint?: {
|
|
7054
7054
|
path: string;
|
|
7055
7055
|
resume?: boolean;
|
|
7056
|
+
/** Digest of execution dependencies: environment, baseline code, transports, callbacks,
|
|
7057
|
+
* and external state such as a corpus. Update it when any dependency changes.
|
|
7058
|
+
* Runtime hashes profiles, settings, JSON task payloads, and authored bytes separately;
|
|
7059
|
+
* it cannot infer callback behavior or external state. */
|
|
7060
|
+
executionRef: Sha256Digest;
|
|
7056
7061
|
};
|
|
7057
7062
|
/** Called before each benchmark phase (gen0, gen1…, band-screen, holdout, reproduce).
|
|
7058
7063
|
* The seam for environment recycling — no artifacts span phases, so a runner may
|
|
@@ -7069,6 +7074,8 @@ interface ChampionPick {
|
|
|
7069
7074
|
interface EvolutionCandidate {
|
|
7070
7075
|
name: string;
|
|
7071
7076
|
file?: string;
|
|
7077
|
+
/** Digest of the exact authored module evaluated in this generation. */
|
|
7078
|
+
sourceSha256?: Sha256Digest;
|
|
7072
7079
|
gzipBits?: number;
|
|
7073
7080
|
codeChars?: number;
|
|
7074
7081
|
/** Present when this author attempt failed (recorded, never silent). */
|
|
@@ -9585,4 +9592,4 @@ interface VerifierEnvironmentOptions {
|
|
|
9585
9592
|
declare function createVerifierEnvironment(opts: VerifierEnvironmentOptions): Environment;
|
|
9586
9593
|
//#endregion
|
|
9587
9594
|
export { WorkspaceRun as $, BenchmarkTaskRow as $a, LoopUntilSpec as $c, DetachedWinnerSelection as $d, DelegationStatus as $f, probeSandboxCapabilities as $i, sentinelCompletion as $l, freeSlots as $n, withWorkerSpawnRetry as $o, InMemoryResultBlobStore as $p, defaultStructuralRolloutPolicy as $r, runFinalizer as $s, RunContext as $t, DefinedAnalystRecord as $u, worktreeFanout as A, fanout as Aa, HarvestReport as Ac, questionEscalationTargets as Ad, SubmitInput as Af, McpSpawnFault as Ai, PersonaExecutors as Al, renderProfileMaterializationIssues as Am, RunGraphTestOptions as An, SuperviseDispatchOptions as Ao, PlannerError as Ap, ProfileRichness as Ar, ProgressTrackerOptions as As, readWorkerCancellation as At, WaterfallCollector as Au, VERIFY_TAIL_CHARS as B, assertTraceDerivedFindings as Ba, Corpus as Bc, DelegateHandlerOptions as Bd, DelegateResearchResult as Bf, SandboxRun as Bi, LeaderboardFlagSpec as Bl, delegatesWorkerBriefPrompt as Bn, SuperviseRegistry as Bo, BusStats as Bp, CheckRunner as Br, sampleFromSettled as Bs, workerCancellationFile as Bt, AnalystToolGroupName as Bu, SurfaceWorkerConfig as C, createShapeRegistry as Ca, inlineSandboxClient as Cc, WorkerWatchOptions as Cd, DelegationRecord as Cf, AuthoredStrategy as Ci, WinnerStrategy as Cl, defineProfileMaterializationContract as Cm, EdgeDeliveryOutcome as Cn, refine as Co, InMemoryDelegationStore as Cp, BudgetPoolRestore as Cr, FileCoordinationLog as Cs, cancelRun as Ct, AnytimeStrategySummary as Cu, superviseSurface as D, FileCorpus as Da, inProcessSandboxClient as Dc, downMessageRefusalReasons as Dd, DelegationRunContext as Df, strategyAuthorSystemPrompt as Di, Outcome as Dl, promptModelProfileMaterialization as Dm, GraphNode as Dn, LoopCampaignDispatchOptions as Do, ConfigError as Dp, createBudgetPool as Dr, PlateauOptions as Ds, readRunCancelRequest as Dt, bestSoFar as Du, failuresAnalyst as E, runPersonified as Ea, InProcessSandboxClientOptions as Ec, createCoordinationTools as Ed, DelegationResumeTick as Ef, strategyAuthorContract as Ei, LoopShape as El, promptControlProfileMaterialization as Em, GraphEdgeCapError as En, sampleThenRefine as Eo, BackendTransportError as Ep, ReservationTicket as Er, NoProgressForOptions as Es, legacySupervisorRunsRoot as Et, areaUnderCurve as Eu, readWorkerInteractiveBinding as F, selectValidWinner as Fa, defaultAnalystInstruction as Fc, DELEGATE_DESCRIPTION as Fd, DelegateCodeResult as Ff, materializeLocalMcp as Fi, ShapeRegistry as Fl, PromptHandle as Fn, AuthorizedSpawn as Fo, RuntimeRunStateError as Fp, profileRichnessFinding as Fr, allWorkersStalled as Fs, safeWorkerFile as Ft, AnalystDefinitionIssue as Fu, CopyOptions as G, McpEnvironmentOptions as Ga, EqualKOnCostOptions as Gc, FeedbackStore as Gd, DelegationError as Gf, CheckpointCapableBox as Gi, LeaderboardSpec as Gl, naiveContinuationPrompt as Gn, workerFromBackend as Go, defaultToolDetectors as Gp, StructuralRolloutMessage as Gr, createSupervisorSpanRecorder as Gs, workerSteerAcknowledgementFile as Gt, AuthorizedDownMessage as Gu, closingWorkerNote as H, createScopeAnalyst as Ha, CorpusRecord as Hc, createDelegateHandler as Hd, DelegateUiAuditConfig as Hf, TurnResult as Hi, LeaderboardRunContext as Hl, dumbContinuationPassPrompt as Hn, SuperviseTestOptions as Ho, PublishOptions as Hp, CheckSourceCtx as Hr, SupervisorSpanOptions as Hs, workerControlLogFile as Ht, AuthoredAnalystDefinition as Hu, workerInteractiveBindingFile as I, verify as Ia, observe as Ic, DELEGATE_INPUT_SCHEMA as Id, DelegateFeedbackArgs as If, Deliverable as Ii, DefinedLeaderboard as Il, PromptRegistry as In, AuthorizedSpawnContext as Io, ValidationError as Ip, supervisorInstructions as Ir, anyOf as Is, supervisorRunDir as It, AnalystFindingEvent as Iu, withUntrackedArtifacts as J, BenchmarkCell as Ja, FanoutOptions as Jc, CoderDelegate as Jd, DelegationHistoryEntry as Jf, SandboxLineageHandle as Ji, CompletionEvidence as Jl, DispatchReport as Jn, WorkerSpawnRetryHooks as Jo, ExecutorResultMapping as Jp, VisibleCheck as Jr, FinalizerSettled as Js, workerSteerRequestsDir as Jt, CoordinationEvent as Ju, UntrackedCopyStats as K, createMcpEnvironment as Ka, EqualKVerdict as Kc, InMemoryFeedbackStore as Kd, DelegationFeedbackSnapshot as Kf, ForkCapableBox as Ki, defineLeaderboard as Kl, promptHandle as Kn, ResolvedWorkerSpawnRetry as Ko, watchTrace as Kp, StructuralRolloutPolicy as Kr, DeliveredOutput as Ks, workerSteerAcknowledgementsDir as Kt, ContinuationInstruction as Ku, workerInteractiveBindingsDir as L, widen as La, renderReport as Lc, DELEGATE_TOOL_NAME as Ld, DelegateFeedbackResult as Lf, OpenSandboxRunBeforeStartContext as Li, LeaderboardBenchScore as Ll, RegisteredPrompt as Ln, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as Lo, CoderOutput as Lp, CheckExecChannel as Lr, createProgressTracker as Ls, supervisorRunsRoot as Lt, AnalystKind as Lu, WorkerInteractiveBinding as M, loopUntil as Ma, Observation as Mc, McpServerOptions as Md, hashIdempotencyInput as Mf, StdioMcpConnection as Mi, RunPersonifiedOptions as Ml, validateProfileMaterialization as Mm, defaultEdgeTraversalCap as Mn, loopCampaignDispatch as Mo, RetainedInteractiveBindingError as Mp, asAuthoredProfile as Mr, StopDecision as Ms, readWorkerSteerRequests as Mt, WaterfallSpan as Mu, WorkerInteractiveProviderSource as N, panel as Na, ObserveInput as Nc, createInProcessTransport as Nd, DelegateCodeArgs as Nf, StdioMcpServerSpec as Ni, ShapeBudget as Nl, worktreeCliProfileMaterialization as Nm, runGraph as Nn, loopDispatch as No, RetainedRunAdmissionError as Np, assessAuthoredProfile as Nr, StopRule as Ns, runCancelRequestFile as Nt, createWaterfallCollector as Nu, AuthoredHarness as O, InMemoryCorpus as Oa, HarvestCorpusOptions as Oc, normalizeAnalyzeOnSettle as Od, DelegationTaskQueue as Of, LocalMcpMaterialization as Oi, Persona as Ol, promptOnlyProfileMaterialization as Om, GraphResult as On, LoopDispatchOptions as Oo, JudgeError as Op, spendFromUsageEvents as Or, ProgressSample as Os, readRunCancellation as Ot, plateauLength as Ou, attachWorker as P, pipeline as Pa, ObserveOptions as Pc, createMcpServer as Pd, DelegateCodeConfig as Pf, connectStdioMcp as Pi, ShapeContext as Pl, runGraphWithTestBrain as Pn, superviseDispatch as Po, RetainedRunDispatchBindingError as Pp, defaultProfileRichnessThresholds as Pr, allOf as Ps, runCancellationFile as Pt, ANALYST_DEFINITION_BOUNDS as Pu, WorkspaceCommit as Q, BenchmarkStrategySummary as Qa, LoopUntil as Qc, DetachedSessionDelegateOptions as Qd, DelegationResultPayload as Qf, SandboxCapabilities as Qi, deterministicCompletion as Ql, effectiveConcurrency as Qn, retryPreSpawnRefusals as Qo, FileSpawnJournal as Qp, defaultExtractCandidate as Qr, pickBestDelivered as Qs, InMemoryRunContextOptions as Qt, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as Qu, EVIDENCE_MAX_CHARS as R, CreateScopeAnalystOptions as Ra, AssertTraceDerivedFindings as Rc, DelegateArgs as Rd, DelegateResearchArgs as Rf, OpenSandboxRunOptions as Ri, LeaderboardBenchTask as Rl, analyzesFindingsReportPrompt as Rn, DeliverableResolutionInput as Ro, BusEvent as Rp, CheckOutcome as Rr, noProgressFor as Rs, supervisorWorkersDir as Rt, AnalystLensOutput as Ru, SuperviseSurfaceResult as S, builtinShapes as Sa, localSandboxClient as Sc, WorkerSpawnContext as Sd, DelegationArgs as Sf, AuthorStrategyOptions as Si, WidenSpec as Sl, controlProfileMaterialization as Sm, AgentGraph as Sn, depthStrategy as So, FileDelegationStoreOptions as Sp, BudgetPool as Sr, CoordinationOwnerId as Ss, WriteWorkerSteerOptions as St, AnytimeReport as Su, analystsFromRegistry as T, definePersona as Ta, InProcessPromptCtx as Tc, canonicalFindingEvent as Td, DelegationResumeDriver as Tf, authorStrategy as Ti, DefinePersonaInput as Tl, profileMaterializationAxes$1 as Tm, GraphEdge as Tn, sample as To, AgentEvalErrorCode as Tp, ReservationRejection as Tr, AllWorkersStalledOptions as Ts, legacySupervisorRunDir as Tt, anytimeReport as Tu, composeWorkerEvidence as U, registryScopeAnalyst as Ua, EqualKArm as Uc, validateDelegateArgs as Ud, DelegateUiAuditResult as Uf, openSandboxRun as Ui, LeaderboardScenario as Ul, formatPromptHandle as Un, supervise as Uo, createEventBus as Up, RepairStop as Ur, SupervisorSpanOutcome as Us, workerInboxFile as Ut, AuthoredAnalystLimits as Uu, WorkerEvidenceInput as V, buildSteerContext as Va, CorpusFilter as Vc, DelegateResult as Vd, DelegateUiAuditArgs as Vf, SandboxRunAbortError as Vi, LeaderboardIterationInfo as Vl, dumbContinuationFailPrompt as Vn, SuperviseRegistryTable as Vo, EventBus as Vp, CheckSource as Vr, SupervisorSpanAttributes as Vs, workerCancellationsDir as Vt, AnalyzeOnSettleRoute as Vu, settledWorkerOut as W, McpEndpoint as Wa, EqualKOnCost as Wc, FeedbackEvent as Wd, DelegateUiAuditRoute as Wf, BranchCapableBox as Wi, LeaderboardScore as Wl, kernelPromptRegistry as Wn, superviseWithTestBrain as Wo, WatchTraceOptions as Wp, StructuralRolloutConfig as Wr, SupervisorSpanRecorder as Ws, workerInboxFileFromEventDir as Wt, AuthorizeDownMessage as Wu, Shell as X, BenchmarkLift as Xa, FanoutWinnerSelector as Xc, CoderReviewer as Xd, DelegationProfile as Xf, createSandboxLineage as Xi, CompletionVerdict as Xl, DispatchUnit as Xn, isPreSpawnExecutorFailure as Xo, mapExecutorResult as Xp, compareCheckOutcomes as Xr, bestDelivered as Xs, writeWorkerSteer as Xt, CoordinationTools as Xu, GitWorkspaceOptions as Y, BenchmarkConfig as Ya, FanoutSynthesis as Yc, CoderReview as Yd, DelegationHistoryResult as Yf, SessionCapableBox as Yi, CompletionPolicy as Yl, DispatchStopReason as Yn, WorkerSpawnRetryPolicy as Yo, gateOnDeliverable as Yp, canDisplace as Yr, SupervisorFinalizer as Ys, workerSteersDir as Yt, CoordinationStats as Yu, Workspace as Z, BenchmarkReport as Za, FlatWidenGate as Zc, DelegateRunCtx as Zd, DelegationProgress as Zf, CriuCapableClient as Zi, completionAuthorizes as Zl, RollingDispatchOptions as Zn, resolveWorkerSpawnRetry as Zo, FileResultBlobStore as Zp, composeCheckSources as Zr, collectDelivered as Zs, InMemoryRunContext as Zt, CoordinationToolsOptions as Zu, boxSurfaceReader as _, profileOptimizerModelCall as _a, TerminalDecision as _c, SpawnPreflight as _d, createDetachedTurnResumeDriver as _f, StrategyEvolutionConfig as _i, Verify as _l, KnownAgentProfileMaterializationAxis as _m, WorkerInteractiveAdmission as _n, StrategyShotResult as _o, createDelegationTraceCollector as _p, ChatTransportTool as _r, resolveSupervisorProfile as _s, RunCancellation as _t, AuditIntentInput as _u, SandboxInstance$1 as a, startRetainedRunInEnvironment as aa, DriverProgressMark as ac, MakeWorkerAgent as ad, DelegationExecutor as af, selectBestIndex as ai, Pipeline as al, SpawnForestNode as am, SupervisorCleanupReceipt as an, AgenticSurface as ao, UiAuditLensFilter as ap, CoordinationMcpHandle as ar, ObserveSupervisorNodeEvent as as, analyzeTrace as at, LeaderboardOptions as au, AnalystAuthoring as b, equalKOnCost as ba, runAgentRounds as bc, SpawnRefusalCause as bd, parseDetachedSessionRef as bf, runStrategyEvolution as bi, WidenDecision as bl, ValidateProfileMaterializationOptions as bm, InPlaceCliExecutorOptions as bn, breadthStrategy as bo, DelegationStore as bp, chatWorkerSeam as br, CoordinationDeliveryEvidence as bs, WorkerSteerAcknowledgement as bt, auditIntent as bu, VerifierEnvironmentOptions as c, reconnectRetainedInteractiveRun as ca, DriverRepromptRefusal as cc, QuestionEscalationOutcome as cd, SiblingSandboxExecutorOptions as cf, ChampionPick as ci, RenderCorpusToInstructionsOptions as cl, materializeTreeView as cm, patchDelivered as cn, ArtifactHandle as co, CappedDelegationTrace as cp, driverAgent as cr, ResolvedSupervisorProfile as cs, captureWorkerTraceEvidence as ct, PairwiseVerdict as cu, HarvestSurfaceDiffsOptions as d, ResolveSandboxClientOptions as da, DriverUnmetContractDecision as dc, QuestionLevel as dd, DetachedSessionRefParts as df, EvolutionAuthor as di, ScopeWidenGate as dl, contentAddress as dm, createWorktreeCliExecutor as dn, ShotSpec as do, DelegationTraceCaps as dp, CodeModeRunner as dr, SupervisorNodeContext as ds, createRootHandle as dt, leaderboard as du, AcquireOptions as ea, DriverAttemptRecord as ec, DownMessageAuthorizationInput as ed, SettleDetachedCoderTurnOptions as ef, filterAuthoredAsserts as ei, LoopUntilState as el, InMemorySpawnJournal as em, createFileRunContext as en, Environment as eo, DelegationStatusArgs as ep, queueOf as er, CoordinationBinding as es, gitWorkspace as et, stopSentinel as eu, SurfaceDiff as f, resolveSandboxClient as fa, OnUnmetContract as fc, QuestionOption as fd, DetachedTurn as ff, EvolutionBandInfo as fi, SteerContext as fl, AGENT_PROFILE_MATERIALIZATION_AXES as fm, InteractiveWorkerEnvironment as fn, Strategy as fo, DelegationTraceCollector as fp, codeModeSupervisorTools as fr, SupervisorNodeContextSeed as fs, createSupervisor as ft, pairwiseSignificance as fu, WatchedSurface as g, profileChatClient as ga, TERMINAL_DECISIONS as gc, SettledWorker as gd, RunDetachedTurnOptions as gf, ReproductionCheck as gi, TrajectoryReportOptions as gl, DefineProfileMaterializationContractOptions as gm, workerFromInteractiveProvider as gn, StrategyResult as go, composeLoopTraceEmitters as gp, ChatTransportExecutorOptions as gr, assertCoordinationBinding as gs, RunCancelRequest as gt, renderPairwiseMarkdown as gu, SurfaceReader as h, promotionGate as ha, RunAgentRoundsOptions as hc, QuestionUrgency as hd, DriveTurnTick as hf, EvolutionReport as hi, TrajectoryReportFn as hl, CanonicalAgentProfileMaterializationAxis as hm, InteractiveWorkerResult as hn, StrategyMessage as ho, capDelegationTrace as hp, ChatSessionStore as hr, SupervisorToolInvocationContext as hs, settledToIteration as ht, renderLeaderboardSvg as hu, SandboxEvent$1 as i, startRetainedRun as ia, DriverContractState as ic, EscalateQuestion as id, settleDetachedCoderTurn as if, sandboxCheckRunner as ii, PanelVerdict as il, SpawnForestMissingTree as im, ProvisionedSupervisor as in, AgenticRunResult as io, ResearchOutputShape as ip, delegate as ir, DriveHarnessOwnerContext as is, TrajectoryAnalysis as it, Leaderboard as iu, AttachWorkerOptions as j, flatWidenGate as ja, harvestCorpus as jc, McpServer as jd, SubmitOutput as jf, McpToolDescriptor as ji, RunPersonified as jl, sandboxActProfileMaterialization as jm, TraversalContinuity as jn, SuperviseOptionsForDispatch as jo, RetainedInteractiveAdmissionError as jp, ProfileRichnessThresholds as jr, ProgressView as js, readWorkerSteerAcknowledgement as jt, WaterfallReport as ju, WorktreeFanoutOptions as k, renderCorpusToInstructions as ka, HarvestFailure as kc, parseAuthoredAnalystDefinition as kd, DelegationTaskQueueOptions as kf, MaterializeLocalMcpOptions as ki, PersonaContext as kl, promptResourceProfileMaterialization as km, RunGraphOptions as kn, LoopOptionsForDispatch as ko, NotFoundError as kp, AuthoredProfile as kr, ProgressTracker as ks, readWorkerCancelRequests as kt, renderAnytimeTable as ku, createVerifierEnvironment as l, recoverRetainedInteractiveRun as la, DriverRetryPolicy as lc, QuestionEscalationRecord as ld, createFleetWorkspaceExecutor as lf, ChampionPolicy as li, ScopeAnalyst as ll, pendingWaits as lm, WorktreeCliExecutorOptions as ln, CorpusReadbackOptions as lo, DELEGATION_TRACE_MAX_BYTES as lp, finalizeBestDelivered as lr, SupervisorAgentDeps as ls, parseWorkerToolTraceArtifact as lt, ProfileKeyOf as lu, SurfaceReadOutcome as m, PromotionVerdict as ma, defaultUnmetContractSteer as mc, QuestionRecord as md, DriveTurnCapableBox as mf, EvolutionGeneration as mi, TrajectoryReport as ml, AssertProfileMaterializationOptions as mm, InteractiveWorkerOptions as mn, StrategyCtx as mo, buildDelegationTraceSpans as mp, ChatCompletionsTransport as mr, SupervisorToolDescriptor as ms, createScope as mt, renderLeaderboardMarkdown as mu, AnalystFinding$1 as n, reconnectRetainedRun as na, DriverAttemptsExhaustedError as nc, DownMessageDeliveryOutcome as nd, coderTaskFromArgs as nf, officialChecksFromMeta as ni, PanelJudge as nl, SpawnForestEvent as nm, ProvisionSupervisorConnection as nn, runBenchmark as no, FeedbackRating as np, DelegateOptions as nr, CoordinationVerbs as ns, localShell as nt, GroupOf as nu, computeFindingId$1 as o, ClaimRetainedInteractiveControlOptions as oa, DriverReentry as oc, Question as od, FleetHandle as of, structuralRollout as oi, PipelineStage as ol, SpawnForestTree as om, provisionSupervisor as on, AgenticTask as oo, UiAuditorDelegationOutput as op, serveCoordinationMcp as or, ResolveDriveHarness as os, WORKER_TOOL_TRACE_SCHEMA_VERSION as ot, LeaderboardRow as ou, SurfaceReadBox as p, PromotionGateOptions as pa, classifyDriverFailure as pc, QuestionPolicy as pd, DetachedTurnResumeDriverOptions as pf, EvolutionCandidate as pi, TrajectoryNode as pl, AgentProfileMaterializationAxis as pm, InteractiveWorkerKeyInput as pn, StrategyArtifacts as po, DelegationTraceSpan as pp, unsafeInProcessRunner as pr, SupervisorProfile as ps, ScopeArgs as pt, renderLeaderboardHtml as pu, copyUntrackedIntoClone as q, sanitizeMcpToolSchema as qa, Fanout as qc, eventToSnapshot as qd, DelegationHistoryArgs as qf, SandboxLineage as qi, CompletionAnalyst as ql, ConcurrencyCaps as qn, WorkerSpawnRetryAttempt as qo, DeliverableSpec as qp, StructuralRolloutResult as qr, FinalizeContext as qs, workerSteerRequestFile as qt, ContinuityMode as qu, CreateSandboxOptions$1 as r, recoverRetainedRun as ra, DriverBudgetReadout as rc, DownMessageEvent as rd, detachedSessionDelegate as rf, resolveEntrySymbol as ri, PanelSpec as rl, SpawnForestInDoubtNode as rm, ProvisionSupervisorRequest as rn, AgenticOptions as ro, FeedbackRefersTo as rp, defaultDelegateBudget as rr, DriveHarness as rs, runInWorkspace as rt, Interval as ru, makeFinding$1 as s, claimRetainedInteractiveControl as sa, DriverRepromptPolicy as sc, QuestionDecision as sd, FleetWorkspaceExecutorOptions as sf, visibleCheckScore as si, RenderCorpusToInstructions as sl, loadSpawnForest as sm, PatchDeliverableOptions as sn, AgenticTool as so, delegationProfiles as sp, DriverAgentOptions as sr, ResolveSupervisorTools as ss, WorkerToolTraceArtifact as st, PairwiseOptions as su, AgentProfile$2 as t, acquireSandbox as ta, DriverAttemptStop as tc, DownMessageDeliveryAttempt as td, UiAuditorDelegate as tf, modelAuthoredChecks as ti, Panel as tl, SpawnForest as tm, createInMemoryRunContext as tn, printBenchmarkReport as to, DelegationStatusResult as tp, rollingDispatch as tr, CoordinationToolFace as ts, jjWorkspace as tt, AxisScoresOf as tu, BoxSurfaceReaderOptions as u, startRetainedInteractiveRun as ua, DriverUnmetContractContext as uc, QuestionEscalationTarget as ud, createSiblingSandboxExecutor as uf, EvolutionArchiveNode as ui, ScopeAnalyzeInput as ul, replaySpawnTree as um, WorktreePatchArtifact as un, RunAgenticOptions as uo, DELEGATION_TRACE_MAX_SPANS as up, CodeModeOptions as ur, SupervisorAgentTestDeps as us, workerTraceAnalysisStore as ut, ScoreOf as uu, fsSurfaceReader as v, assertModelAllowed as va, defaultSelectWinner as vc, SpawnPreflightContext as vd, detachedTurnEvents as vf, discriminatingMeans as vi, VerifySpec as vl, ProfileMaterializationContract as vm, readWorkerInteractiveAdmissions as vn, SurfaceScore as vo, DelegationPersistenceError as vp, ChatWorkerSeamOptions as vr, supervisorAgent as vs, WorkerCancelRequest as vt, AuditIntentOptions as vu, SurfaceWorkerOut as w, registerShape as wa, InProcessOnPrompt as wc, analystToolGroupNames as wd, DelegationResumeContext as wf, assertStrategyContract as wi, DefinePersona as wl, fullProfileMaterialization as wm, EdgeTraversal as wn, runAgentic as wo, AgentEvalError$1 as wp, BudgetReadout as wr, PriorCoordination as ws, cancelWorker as wt, AnytimeTaskCurve as wu, SuperviseSurfaceOptions as x, trajectoryReport as xa, LocalSandboxClientOptions as xc, WorkerResumeContext as xd, runDetachedTurn as xf, selectChampion as xi, WidenLineage as xl, assertProfileMaterialization as xm, createInPlaceCliExecutor as xn, defineStrategy as xo, FileDelegationStore as xp, createChatSessionStore as xr, CoordinationLog as xs, WorkerSteerRequest as xt, defaultAuditorInstruction as xu, harvestSurfaceDiffs as y, assertProfileModelsAllowed as ya, isTerminalDecision as yc, SpawnRefusal as yd, formatDetachedSessionRef as yf, pickChampion as yi, Widen as yl, ProfileMaterializationIssue as ym, workerInteractiveAdmissionFile as yn, adaptiveRefine as yo, DelegationStateCorruptError as yp, chatTransportExecutor as yr, supervisorAgentWithTestBrain as ys, WorkerCancellation as yt, IntentAudit as yu, NOTE_MAX_CHARS as z, RegistryAnalyzeProjection as za, CombinatorShape as zc, DelegateError as zd, DelegateResearchConfig as zf, OpenSandboxRunPromptOptions as zi, LeaderboardBenchmarkAdapter as zl, createPromptRegistry as zn, SuperviseOptions as zo, BusRecord as zp, CheckRunContext as zr, plateau as zs, workerCancelRequestsFile as zt, AnalystRegistry as zu };
|
|
9588
|
-
//# sourceMappingURL=index-
|
|
9595
|
+
//# sourceMappingURL=index-DNx0nWZH.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as OpenAIChatToolChoice, A as RuntimeRunCompleteInput, B as AgentBackendInput, F as RuntimeRunRow, G as AgentTaskContext, H as AgentKnowledgeProvider, I as RuntimeRunStatus, J as AgentTaskStatus, K as AgentTaskRunResult, L as startRuntimeRun, M as RuntimeRunHandle, N as RuntimeRunOptions, P as RuntimeRunPersistenceAdapter, Q as OpenAIChatTool, R as AgentAdapter, U as AgentRuntimeEvent, V as AgentExecutionBackend, W as AgentRuntimeEventSink, X as KnowledgeReadinessDecision, Y as BackendErrorDetail, Z as OpenAIChatResponseFormat, at as RuntimeStreamEvent, et as RunAgentTaskOptions, it as RuntimeSessionStore, j as RuntimeRunCost, m as LoopResult, nt as RuntimeCanonicalStreamEvent, q as AgentTaskSpec, r as Driver, rt as RuntimeSession, tt as RunAgentTaskStreamOptions, z as AgentBackendContext } from "./types-BdolQ6Zi.js";
|
|
2
2
|
import { i as SurfaceImprovementEdit } from "./improvement-adapter-D5gwwoXQ.js";
|
|
3
3
|
import { o as ImprovementProposalSource } from "./types-zWfqDjeL.js";
|
|
4
|
-
import { Ap as PlannerError, Dp as ConfigError, Ep as BackendTransportError, Fp as RuntimeRunStateError, Hu as AuthoredAnalystDefinition, Ip as ValidationError, Ju as CoordinationEvent, Kr as StructuralRolloutPolicy, Lu as AnalystKind, Mp as RetainedInteractiveBindingError, Np as RetainedRunAdmissionError, Op as JudgeError, Pp as RetainedRunDispatchBindingError, Tp as AgentEvalErrorCode, Ys as SupervisorFinalizer, jp as RetainedInteractiveAdmissionError, kp as NotFoundError, qs as FinalizeContext, wp as AgentEvalError, zu as AnalystRegistry } from "./index-
|
|
4
|
+
import { Ap as PlannerError, Dp as ConfigError, Ep as BackendTransportError, Fp as RuntimeRunStateError, Hu as AuthoredAnalystDefinition, Ip as ValidationError, Ju as CoordinationEvent, Kr as StructuralRolloutPolicy, Lu as AnalystKind, Mp as RetainedInteractiveBindingError, Np as RetainedRunAdmissionError, Op as JudgeError, Pp as RetainedRunDispatchBindingError, Tp as AgentEvalErrorCode, Ys as SupervisorFinalizer, jp as RetainedInteractiveAdmissionError, kp as NotFoundError, qs as FinalizeContext, wp as AgentEvalError, zu as AnalystRegistry } from "./index-DNx0nWZH.js";
|
|
5
5
|
import { a as RuntimeHookErrorContext, c as RuntimeHookTarget, d as defineRuntimeHooks, f as notifyRuntimeDecisionPoint, i as RuntimeHookContext, l as RuntimeHooks, n as RuntimeDecisionKind, o as RuntimeHookEvent, p as notifyRuntimeHookEvent, r as RuntimeDecisionPoint, s as RuntimeHookPhase, t as RuntimeDecisionEvidenceRef, u as composeRuntimeHooks } from "./runtime-hooks-Bj6wJHlH.js";
|
|
6
6
|
import { $t as sanitizeAgentRuntimeEvent, A as ProviderModelAttemptEvidence, At as OtelExporter, B as Scope, Bt as loopEventToOtelSpan, Ct as EvalRunGeneration, Dt as LoopSpanNode, Et as INTELLIGENCE_WIRE_VERSION, Ft as buildRuntimeEventOtelSpans, Gt as RuntimeStreamEventCollector, Ht as padTraceId, It as createOpenInferenceFileExporter, J as SpendChannel, Jt as RuntimeTelemetryOptions, Kt as RuntimeStreamEventSink, L as RootProviderModelEvidence, Lt as createOtelExporter, Mt as RuntimeEventOtelOptions, Nt as buildLoopOtelSpans, Ot as OtelAttribute, Pt as buildLoopSpanNodes, Q as Supervisor, Qt as createRuntimeStreamEventCollector, Rt as exportEvalRuns, St as EvalRunEvent, Tt as EvalRunsExportResult, Ut as toOtelAttributes, V as Settled, Vt as padSpanId, Wt as RuntimeEventCollector, Xt as SanitizedKnowledgeRequirement, Y as SpendGap, Yt as SanitizedKnowledgeReadinessReport, Z as SupervisedResult, Zt as createRuntimeEventCollector, _ as ExecutorRegistry, en as sanitizeKnowledgeReadinessReport, et as TokenUsageProvenance, i as Budget, j as ProviderModelExecutionEvidence, jt as OtelSpan, kt as OtelExportConfig, lt as WorkerTraceEvidence, q as Spend, qt as RuntimeStreamEventSummary, r as AgentSpec, s as Executor, tn as sanitizeRuntimeStreamEvent, ut as WorkerTraceUnavailableReason, wt as EvalRunsExportConfig, zt as generateSpanId } from "./types-B_pNTBjK.js";
|
|
7
7
|
import { c as Redactor } from "./stream-agent-turn-B-gtBlOy.js";
|
|
@@ -10,9 +10,9 @@ import { A as AgentCandidateWorkspacePort, B as ResolvedAgentCandidateContainer,
|
|
|
10
10
|
import { A as ExactProcessCandidateExecutorOptions, B as buildAgentCandidateBundle, C as RunProtectedAgentCandidateModelGrantOptions, D as CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, E as persistCandidateOutputArtifact, F as FileAgentCandidateExecutionClaimStoreOptions, G as candidateWorkspaceManifest, H as sealAgentCandidateBundle, I as AgentCandidateCodeSource, K as scanMaterializedWorkspaceManifest, L as AgentCandidateCodeSurfaceSource, M as DisposePreparedAgentCandidateOptions, N as disposePreparedAgentCandidateExecution, O as CANDIDATE_KNOWLEDGE_ROOT_ENV, P as FileAgentCandidateExecutionClaimStore, R as AgentCandidateProfileSource, S as ProtectedAgentCandidateModelGrantContext, T as runProtectedAgentCandidateModelGrant, U as WorkspaceScanLimits, V as AgentCandidateBundleInput, W as WorkspaceScanOptions, _ as AGENT_CANDIDATE_EXECUTION_SUPPORT, a as WorkspaceTreeEntryPolicy, b as recoverExpiredAgentCandidateExecution, c as describeWorkspaceTree, d as CaptureAgentCandidateWorkspaceOptions, f as CapturedAgentCandidateWorkspace, g as createAgentCandidateWorkspacePort, h as captureAgentCandidateWorkspaceFiles, i as WorkspaceTreeDescriptor, j as exactProcessProviderAsCandidateExecutor, k as candidateKnowledgeExecutionPaths, l as seedWorkspaceTree, m as captureAgentCandidateWorkspace, n as SeedWorkspaceTreeInput, o as WorkspaceTreeExclusion, p as CreateAgentCandidateWorkspacePortOptions, q as verifyMaterializedWorkspace, r as WorkspaceTreeAlgorithm, s as WorkspaceTreeExclusionReason, t as DescribeWorkspaceTreeOptions, u as AgentCandidateWorkspaceArchiveLimits, v as verifyAgentCandidateBundle, w as RunProtectedAgentCandidateModelGrantResult, x as AgentCandidateModelGrantRunReservationInput, y as RecoverExpiredAgentCandidateOptions, z as BuildAgentCandidateBundleInput } from "./index-CUosKU4N.js";
|
|
11
11
|
import { A as AgentCandidateExecutionPhase, B as AgentCandidatePreparationEvidence, C as AgentCandidateExecutionClaim, D as AgentCandidateExecutionFailureClass, E as AgentCandidateExecutionCleanupHandles, F as AgentCandidateExecutionTerminalResult, I as AgentCandidateRetryRejection, L as InMemoryAgentCandidateExecutionClaimStore, M as AgentCandidateExecutionRecoveryEvidence, N as AgentCandidateExecutionStageResult, O as AgentCandidateExecutionFinishResult, P as AgentCandidateExecutionTerminalRecord, R as InMemoryAgentCandidateExecutionClaimStoreOptions, S as AgentCandidateExecutionAttemptRef, T as AgentCandidateExecutionClaimStore, _ as PrepareAgentCandidateExecutionOptions, a as AgentCandidateModelGrantSettleInput, b as executePreparedAgentCandidate, c as agentCandidateProfileAsAgentProfile, d as freezeGenericAgentCandidateProfile, f as omitUndefinedObjectFields, g as parseExactCandidateProfile, h as parseExactAgentProfileDiff, i as AgentCandidateModelGrantReserveInput, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionLease, l as applyExactAgentProfileDiff, m as parseExactAgentProfile, n as AgentCandidateModelGrantClient, o as CreateProtectedAgentCandidateModelPortOptions, r as AgentCandidateModelGrantReservation, s as createProtectedAgentCandidateModelPort, t as AgentCandidateModelGrantActivateInput, u as assertCandidateProfileBinding, v as prepareAgentCandidateExecution, w as AgentCandidateExecutionClaimResult, x as AgentCandidateExecutionAttemptRecord, y as ExecutePreparedAgentCandidateOptions, z as candidateExecutionClaim } from "./protected-model-port-BtXp2dUY.js";
|
|
12
12
|
import { $ as sleep, A as RunConversationOptions, B as buildForwardHeaders, C as ConversationResult, D as HaltPredicate, E as HaltContext, F as InMemoryConversationJournal, G as CircuitBreakerState, H as readDepth, I as DEFAULT_MAX_DEPTH, J as RetryBackoff, K as CircuitOpenError, L as FORWARD_HEADERS, M as ConversationJournal, N as ConversationJournalEntry, O as HaltReason, P as FileConversationJournal, Q as makePerAttemptSignal, R as ForwardHeaderName, S as ConversationPolicy, T as ConversationTurn, U as BackendCallPolicy, V as isDepthExceeded, W as CircuitBreakerConfig, X as computeBackoff, Y as RetryableErrorPredicate, Z as defaultIsRetryable, _ as createConversationBackend, a as RunPersonaConfig, b as ConversationDriveState, c as runPersonaDispatch, d as D1DatabaseLike, et as createProfileExecutionBackend, f as D1StmtLike, g as defineConversation, h as d1ToSqlAdapter, i as PersonaDriver, j as TurnOrder, k as HaltSignal, l as runConversation, m as SqlConversationJournal, n as turnId, o as RunPersonaConversationOptions, p as SqlAdapter, q as DeadlineExceededError, r as PersonaConversationResult, s as runPersonaConversation, t as slugifySpeaker, u as runConversationStream, v as AuthSource, w as ConversationStreamEvent, x as ConversationParticipant, y as Conversation, z as PropagatedHeaders } from "./index-DO6DHgRP.js";
|
|
13
|
-
import { $ as CandidateGenerator, A as ImprovementProfileCandidate, B as ImprovementRefusedProfilePopulationCandidate, C as ImproveRuntimeCodeGeneratorOptions, D as ImprovementCandidate, E as ImproveSurface, F as ImprovementProfilePopulationCandidate, G as AgenticGeneratorShotDisposition, H as ReadonlyAgentProfile, I as ImprovementProfilePopulationCandidateSource, J as Verifier, K as AgenticGeneratorShotExecution, L as ImprovementProfilePopulationLineage, M as ImprovementProfileCandidatePopulationAvailable, N as ImprovementProfileCandidatePopulationUnavailable, O as ImprovementCodeCandidate, P as ImprovementProfilePopulationArtifactSource, Q as defaultBuildPrompt, R as ImprovementProfilePopulationLineageNode, S as ImproveResult, T as ImproveSkillsOptions, U as AgenticGeneratorExecutorForWorktree, V as DeepReadonly, W as AgenticGeneratorOptions, X as agenticGenerator, Y as VerifyResult, Z as commandVerifier, _ as ImproveOptimizationRunOptions, a as ImproveCodeOptions, b as ImproveProfileComponents, c as ImproveCost, d as ImproveMethodContext, f as ImproveMethodFactory, g as ImproveMethodSource, h as ImproveMethodResult, i as ImproveCodeBaseOptions, j as ImprovementProfileCandidatePopulation, k as ImprovementMaterializedProfilePopulationCandidate, l as ImproveCustomCodeGeneratorOptions, m as ImproveMethodOptions, n as ImproveCandidateValidationInput, o as ImproveCodeResult, p as ImproveMethodLineage, q as AgenticGeneratorShotReceipt, r as ImproveCandidateValidator, s as ImproveCodeRunOptions, t as improve, u as ImproveLineage, v as ImproveOptions, w as ImproveScenarioPartitions, x as ImproveProfileSurface, y as ImproveProfileAgent, z as ImprovementProfilePopulationObservationSource } from "./improve-
|
|
14
|
-
import { C as KnowledgeImprovementActivationExecutor, S as CreateKnowledgeImprovementActivationExecutorOptions, _ as SupervisedKnowledgeUpdater, a as KnowledgeImprovementJobResult, b as knowledgeReadinessDeliverable, c as createAgentKnowledgeReadinessCheck, d as KnowledgeReadinessCheckInput, f as KnowledgeReadinessCheckResult, g as SupervisedKnowledgeUpdateResult, h as SupervisedKnowledgeUpdateOptions, i as KnowledgeImprovementJobMeasurement, l as runKnowledgeImprovementJob, m as SupervisedKnowledgeUpdateInput, n as KnowledgeImprovementCandidatePair, o as RunKnowledgeImprovementJobOptions, p as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, r as KnowledgeImprovementExperimentBundles, s as buildKnowledgeImprovementExperimentBundles, t as AgentKnowledgeReadinessCheckOptions, u as KnowledgeReadinessCheck, v as createSupervisedKnowledgeUpdater, w as createKnowledgeImprovementActivationExecutor, x as runSupervisedKnowledgeUpdate, y as formatSupervisedKnowledgeTask } from "./index-
|
|
15
|
-
import { _ as researchLoopRunner, a as DELEGATED_LOOP_MODES, c as DelegatedLoopResult, d as ResearchLoopRunnerOptions, f as RunDelegatedLoopOptions, g as isDelegatedLoopMode, h as auditLoopRunner, i as runLoopRunnerCli, l as DelegatedLoopRunner, m as WorktreeLoopRunnerOptions, n as LoopRunnerCliResult, o as DelegatedLoopMode, p as VetoedFact, r as parseLoopRunnerArgv, s as DelegatedLoopRegistry, t as LoopRunnerCliArgs, u as ResearchLoopResult, v as runDelegatedLoop, y as worktreeLoopRunner } from "./loop-runner-bin-
|
|
13
|
+
import { $ as CandidateGenerator, A as ImprovementProfileCandidate, B as ImprovementRefusedProfilePopulationCandidate, C as ImproveRuntimeCodeGeneratorOptions, D as ImprovementCandidate, E as ImproveSurface, F as ImprovementProfilePopulationCandidate, G as AgenticGeneratorShotDisposition, H as ReadonlyAgentProfile, I as ImprovementProfilePopulationCandidateSource, J as Verifier, K as AgenticGeneratorShotExecution, L as ImprovementProfilePopulationLineage, M as ImprovementProfileCandidatePopulationAvailable, N as ImprovementProfileCandidatePopulationUnavailable, O as ImprovementCodeCandidate, P as ImprovementProfilePopulationArtifactSource, Q as defaultBuildPrompt, R as ImprovementProfilePopulationLineageNode, S as ImproveResult, T as ImproveSkillsOptions, U as AgenticGeneratorExecutorForWorktree, V as DeepReadonly, W as AgenticGeneratorOptions, X as agenticGenerator, Y as VerifyResult, Z as commandVerifier, _ as ImproveOptimizationRunOptions, a as ImproveCodeOptions, b as ImproveProfileComponents, c as ImproveCost, d as ImproveMethodContext, f as ImproveMethodFactory, g as ImproveMethodSource, h as ImproveMethodResult, i as ImproveCodeBaseOptions, j as ImprovementProfileCandidatePopulation, k as ImprovementMaterializedProfilePopulationCandidate, l as ImproveCustomCodeGeneratorOptions, m as ImproveMethodOptions, n as ImproveCandidateValidationInput, o as ImproveCodeResult, p as ImproveMethodLineage, q as AgenticGeneratorShotReceipt, r as ImproveCandidateValidator, s as ImproveCodeRunOptions, t as improve, u as ImproveLineage, v as ImproveOptions, w as ImproveScenarioPartitions, x as ImproveProfileSurface, y as ImproveProfileAgent, z as ImprovementProfilePopulationObservationSource } from "./improve-7VTwse1c.js";
|
|
14
|
+
import { C as KnowledgeImprovementActivationExecutor, S as CreateKnowledgeImprovementActivationExecutorOptions, _ as SupervisedKnowledgeUpdater, a as KnowledgeImprovementJobResult, b as knowledgeReadinessDeliverable, c as createAgentKnowledgeReadinessCheck, d as KnowledgeReadinessCheckInput, f as KnowledgeReadinessCheckResult, g as SupervisedKnowledgeUpdateResult, h as SupervisedKnowledgeUpdateOptions, i as KnowledgeImprovementJobMeasurement, l as runKnowledgeImprovementJob, m as SupervisedKnowledgeUpdateInput, n as KnowledgeImprovementCandidatePair, o as RunKnowledgeImprovementJobOptions, p as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, r as KnowledgeImprovementExperimentBundles, s as buildKnowledgeImprovementExperimentBundles, t as AgentKnowledgeReadinessCheckOptions, u as KnowledgeReadinessCheck, v as createSupervisedKnowledgeUpdater, w as createKnowledgeImprovementActivationExecutor, x as runSupervisedKnowledgeUpdate, y as formatSupervisedKnowledgeTask } from "./index-CVD30soi.js";
|
|
15
|
+
import { _ as researchLoopRunner, a as DELEGATED_LOOP_MODES, c as DelegatedLoopResult, d as ResearchLoopRunnerOptions, f as RunDelegatedLoopOptions, g as isDelegatedLoopMode, h as auditLoopRunner, i as runLoopRunnerCli, l as DelegatedLoopRunner, m as WorktreeLoopRunnerOptions, n as LoopRunnerCliResult, o as DelegatedLoopMode, p as VetoedFact, r as parseLoopRunnerArgv, s as DelegatedLoopRegistry, t as LoopRunnerCliArgs, u as ResearchLoopResult, v as runDelegatedLoop, y as worktreeLoopRunner } from "./loop-runner-bin-b4585v9Z.js";
|
|
16
16
|
import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-BDwAdxk5.js";
|
|
17
17
|
import { AgentProfile, Sha256Digest } from "@tangle-network/agent-interface";
|
|
18
18
|
import { ControlBudget, ControlDecision, ControlEvalResult, ControlEvalResult as ControlEvalResult$1, ControlRunResult, ControlStep, DataAcquisitionPlan, KnowledgeReadinessReport, KnowledgeReadinessReport as KnowledgeReadinessReport$1, KnowledgeRequirement, ProposalFinding, RunRecord, RunRecord as RunRecord$1 } from "@tangle-network/agent-eval";
|
|
@@ -253,7 +253,8 @@ declare function rawTraceDistiller<TScenario extends Scenario$1 = Scenario$1, TA
|
|
|
253
253
|
//#endregion
|
|
254
254
|
//#region src/improvement/reflective-generator.d.ts
|
|
255
255
|
interface ReflectiveGeneratorOptions {
|
|
256
|
-
|
|
256
|
+
/** Bind proposal reads and paid calls to this candidate's worktree and account. */
|
|
257
|
+
createImprovementProposalSource(context: Parameters<CandidateGenerator['generate']>[0]): ImprovementProposalSource<SurfaceImprovementEdit>;
|
|
257
258
|
}
|
|
258
259
|
/** Cheap no-sandbox `CandidateGenerator` (the `shots=1` setting): draft surface edits via the improvement adapter and apply them as one coherent candidate. */
|
|
259
260
|
declare function reflectiveGenerator(opts: ReflectiveGeneratorOptions): CandidateGenerator;
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { a as JudgeError, c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBindingError, f as RuntimeRunStateError, i as ConfigError, l as RetainedInteractiveBindingError, m as ValidationError, o as NotFoundError, r as BackendTransportError, s as PlannerError, t as AgentEvalError, u as RetainedRunAdmissionError } from "./errors-CDZ8XsVj.js";
|
|
2
2
|
import { a as normalizeBackendStreamEvent, c as nowIso, i as createSandboxPromptBackend, l as startOrResumeRuntimeSession, o as InMemoryRuntimeSessionStore, r as createIterableBackend, u as touchSession } from "./stream-agent-turn-DOtEsvCV.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
3
|
+
import { o as canonicalCandidateDigest$1, u as immutableCandidateValue } from "./protected-redaction-wGo44k2K.js";
|
|
4
|
+
import { $ as parseExactAgentProfile, G as applyExactAgentProfileDiff, K as assertCandidateProfileBinding, S as CANDIDATE_TRACE_TAGS, W as agentCandidateProfileAsAgentProfile, Y as freezeGenericAgentCandidateProfile, Z as omitUndefinedObjectFields, _ as candidateExecutionClaim, a as persistCandidateOutputArtifact, at as scanMaterializedWorkspaceManifest, c as CANDIDATE_KNOWLEDGE_ROOT_ENV, et as parseExactAgentProfileDiff, f as verifyAgentCandidateBundle, h as InMemoryAgentCandidateExecutionClaimStore, l as candidateKnowledgeExecutionPaths, n as executePreparedAgentCandidate, nt as candidateWorkspaceManifest, s as CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, st as verifyMaterializedWorkspace, t as prepareAgentCandidateExecution, tt as parseExactCandidateProfile, u as AGENT_CANDIDATE_EXECUTION_SUPPORT, x as CANDIDATE_TRACE_ENV } from "./prepare-DDGp0-rW.js";
|
|
5
|
+
import { i as sealAgentCandidateBundle, n as captureAgentCandidateWorkspaceFiles, r as createAgentCandidateWorkspacePort, t as captureAgentCandidateWorkspace } from "./workspace-archive-Ybomp7AN.js";
|
|
6
|
+
import { a as disposePreparedAgentCandidateExecution, i as runProtectedAgentCandidateModelGrant, n as seedWorkspaceTree, o as FileAgentCandidateExecutionClaimStore, r as recoverExpiredAgentCandidateExecution, s as buildAgentCandidateBundle, t as describeWorkspaceTree } from "./candidate-execution-nvqVIMyS.js";
|
|
7
|
+
import { n as exactProcessProviderAsCandidateExecutor, t as createProtectedAgentCandidateModelPort } from "./protected-model-port-DxFN8DLS.js";
|
|
7
8
|
import { C as makePerAttemptSignal, S as defaultIsRetryable, T as createProfileExecutionBackend, _ as readDepth, a as FileConversationJournal, b as DeadlineExceededError, c as createConversationBackend, d as slugifySpeaker, f as turnId, g as isDepthExceeded, h as buildForwardHeaders, i as d1ToSqlAdapter, l as runConversation, m as FORWARD_HEADERS, n as runPersonaDispatch, o as InMemoryConversationJournal, p as DEFAULT_MAX_DEPTH, r as SqlConversationJournal, s as defineConversation, t as runPersonaConversation, u as runConversationStream, v as CircuitBreakerState, w as sleep, x as computeBackoff, y as CircuitOpenError } from "./conversation-BXPWMOSd.js";
|
|
8
|
-
import { Bn as sanitizeRuntimeStreamEvent, Cn as INTELLIGENCE_WIRE_VERSION, Dn as createOpenInferenceFileExporter, En as buildRuntimeEventOtelSpans, Fn as toOtelAttributes, In as createRuntimeEventCollector, Ln as createRuntimeStreamEventCollector, Mn as loopEventToOtelSpan, Nn as padSpanId, On as createOtelExporter, Pn as padTraceId, Rn as sanitizeAgentRuntimeEvent, Tn as buildLoopSpanNodes, jn as generateSpanId, kn as exportEvalRuns, n as defaultRedactorIdentityMaterial, r as resolveRedactor, t as defaultRedactor, wn as buildLoopOtelSpans, zn as sanitizeKnowledgeReadinessReport } from "./redact-
|
|
9
|
+
import { Bn as sanitizeRuntimeStreamEvent, Cn as INTELLIGENCE_WIRE_VERSION, Dn as createOpenInferenceFileExporter, En as buildRuntimeEventOtelSpans, Fn as toOtelAttributes, In as createRuntimeEventCollector, Ln as createRuntimeStreamEventCollector, Mn as loopEventToOtelSpan, Nn as padSpanId, On as createOtelExporter, Pn as padTraceId, Rn as sanitizeAgentRuntimeEvent, Tn as buildLoopSpanNodes, jn as generateSpanId, kn as exportEvalRuns, n as defaultRedactorIdentityMaterial, r as resolveRedactor, t as defaultRedactor, wn as buildLoopOtelSpans, zn as sanitizeKnowledgeReadinessReport } from "./redact-Dv6PeuQz.js";
|
|
9
10
|
import { i as notifyRuntimeHookEvent, n as defineRuntimeHooks, r as notifyRuntimeDecisionPoint, t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
10
|
-
import { D as optimizerMethod, O as strategyAuthorMethod } from "./structural-rollout-
|
|
11
|
-
import { B as ROLLOUT_POLICY_EXTENSION, G as structuralRolloutPolicyFromProfile, H as normalizeRolloutPolicy, J as defaultBuildPrompt, K as agenticGenerator, L as improve, R as withMethodRuntimeControls, U as parseRolloutPolicy, V as applyRolloutPolicyToProfile, W as serializeRolloutPolicy, q as commandVerifier, z as rawTraceDistiller } from "./improvement-cycle-
|
|
12
|
-
import { Ft as connectStdioMcp, Pt as McpSpawnFault } from "./runtime-
|
|
13
|
-
import { a as createSupervisedKnowledgeUpdater, c as runSupervisedKnowledgeUpdate, i as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, l as createKnowledgeImprovementActivationExecutor, n as createAgentKnowledgeReadinessCheck, o as formatSupervisedKnowledgeTask, r as runKnowledgeImprovementJob, s as knowledgeReadinessDeliverable, t as buildKnowledgeImprovementExperimentBundles } from "./knowledge-
|
|
14
|
-
import { a as isDelegatedLoopMode, c as worktreeLoopRunner, i as auditLoopRunner, n as runLoopRunnerCli, o as researchLoopRunner, r as DELEGATED_LOOP_MODES, s as runDelegatedLoop, t as parseLoopRunnerArgv } from "./loop-runner-bin-
|
|
11
|
+
import { D as optimizerMethod, O as strategyAuthorMethod } from "./structural-rollout-pOqANr8Y.js";
|
|
12
|
+
import { B as ROLLOUT_POLICY_EXTENSION, G as structuralRolloutPolicyFromProfile, H as normalizeRolloutPolicy, J as defaultBuildPrompt, K as agenticGenerator, L as improve, R as withMethodRuntimeControls, U as parseRolloutPolicy, V as applyRolloutPolicyToProfile, W as serializeRolloutPolicy, q as commandVerifier, z as rawTraceDistiller } from "./improvement-cycle-DEbciBTL.js";
|
|
13
|
+
import { Ft as connectStdioMcp, Pt as McpSpawnFault } from "./runtime-BZryF6gD.js";
|
|
14
|
+
import { a as createSupervisedKnowledgeUpdater, c as runSupervisedKnowledgeUpdate, i as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, l as createKnowledgeImprovementActivationExecutor, n as createAgentKnowledgeReadinessCheck, o as formatSupervisedKnowledgeTask, r as runKnowledgeImprovementJob, s as knowledgeReadinessDeliverable, t as buildKnowledgeImprovementExperimentBundles } from "./knowledge-B0Mrp-XB.js";
|
|
15
|
+
import { a as isDelegatedLoopMode, c as worktreeLoopRunner, i as auditLoopRunner, n as runLoopRunnerCli, o as researchLoopRunner, r as DELEGATED_LOOP_MODES, s as runDelegatedLoop, t as parseLoopRunnerArgv } from "./loop-runner-bin-C5K46H0Q.js";
|
|
15
16
|
import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-DmvmaG0a.js";
|
|
16
17
|
import { agentProfileSchema, canonicalAgentProfileDigest } from "@tangle-network/agent-interface";
|
|
17
18
|
import { FAILURE_CLASSES, acquisitionPlansForKnowledgeGaps, blockingKnowledgeEval, canonicalJson, runAgentControlLoop, scoreKnowledgeReadiness, userQuestionsForKnowledgeGaps } from "@tangle-network/agent-eval";
|
|
19
|
+
import { createHash } from "node:crypto";
|
|
20
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
21
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
18
22
|
import { gepaOptimizationMethod, skillOptOptimizationMethod } from "@tangle-network/agent-eval/campaign";
|
|
19
23
|
import { spawnSync } from "node:child_process";
|
|
20
24
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -509,38 +513,80 @@ const promptInstructionsProfileComponents = Object.freeze({
|
|
|
509
513
|
function reflectiveGenerator(opts) {
|
|
510
514
|
return {
|
|
511
515
|
kind: "reflective",
|
|
512
|
-
async generate(
|
|
513
|
-
const
|
|
516
|
+
async generate(context) {
|
|
517
|
+
const { worktreePath, findings, signal } = context;
|
|
518
|
+
signal.throwIfAborted();
|
|
519
|
+
const batch = await opts.createImprovementProposalSource(context).proposeFromFindings(findings);
|
|
520
|
+
signal.throwIfAborted();
|
|
521
|
+
if (batch.errors.length > 0) throw new AggregateError(batch.errors.map((error) => /* @__PURE__ */ new Error(`${error.findingId}: ${error.message}`)), `reflectiveGenerator: proposal failed: ${batch.errors.map((error) => error.message).join("; ")}`);
|
|
514
522
|
if (batch.edits.length === 0) return {
|
|
515
523
|
applied: false,
|
|
516
524
|
summary: ""
|
|
517
525
|
};
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
526
|
+
for (const edit of batch.edits) {
|
|
527
|
+
assertPatchTarget(edit, worktreePath);
|
|
528
|
+
assertCurrentBase(edit, worktreePath);
|
|
529
|
+
}
|
|
530
|
+
applyPatches(batch.edits, worktreePath);
|
|
531
|
+
signal.throwIfAborted();
|
|
524
532
|
return {
|
|
525
533
|
applied: true,
|
|
526
|
-
summary: batch.edits.length === 1 ? batch.edits[0].summary : `analyst: ${
|
|
534
|
+
summary: batch.edits.length === 1 ? batch.edits[0].summary : `analyst: ${batch.edits.length} surface edits`
|
|
527
535
|
};
|
|
528
536
|
}
|
|
529
537
|
};
|
|
530
538
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
539
|
+
function assertPatchTarget(edit, cwd) {
|
|
540
|
+
for (const reverse of [false, true]) {
|
|
541
|
+
const result = spawnSync("git", [
|
|
542
|
+
"apply",
|
|
543
|
+
"--numstat",
|
|
544
|
+
"-z",
|
|
545
|
+
"-p0",
|
|
546
|
+
...reverse ? ["--reverse"] : [],
|
|
547
|
+
"-"
|
|
548
|
+
], {
|
|
549
|
+
cwd,
|
|
550
|
+
input: edit.patch,
|
|
551
|
+
encoding: "utf8"
|
|
552
|
+
});
|
|
553
|
+
if (result.error) throw result.error;
|
|
554
|
+
if (result.status !== 0) throw new Error(`reflectiveGenerator: invalid patch: ${result.stderr.trim()}`);
|
|
555
|
+
const paths = result.stdout.split("\0").filter(Boolean).map((entry) => entry.slice(entry.indexOf(" ", entry.indexOf(" ") + 1) + 1));
|
|
556
|
+
const target = resolve(cwd, edit.target.repoRelativePath);
|
|
557
|
+
if (paths.length === 0 || paths.some((path) => resolve(cwd, path) !== target)) throw new Error("reflectiveGenerator: patch paths do not match the declared target");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function assertCurrentBase(edit, cwd) {
|
|
561
|
+
const root = realpathSync(cwd);
|
|
562
|
+
const path = resolve(root, edit.target.repoRelativePath);
|
|
563
|
+
assertWithinWorktree(root, path);
|
|
564
|
+
let content;
|
|
565
|
+
try {
|
|
566
|
+
assertWithinWorktree(root, realpathSync(path));
|
|
567
|
+
content = readFileSync(path, "utf8");
|
|
568
|
+
} catch (error) {
|
|
569
|
+
if (edit.target.intent !== "create-new" || !(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
|
570
|
+
content = "";
|
|
571
|
+
}
|
|
572
|
+
if (createHash("sha256").update(content, "utf8").digest("hex") !== edit.baseSha256) throw new Error(`reflectiveGenerator: stale proposal base for ${edit.target.repoRelativePath}`);
|
|
573
|
+
}
|
|
574
|
+
function assertWithinWorktree(root, path) {
|
|
575
|
+
const local = relative(root, path);
|
|
576
|
+
if (local === ".." || local.startsWith(`..${sep}`) || isAbsolute(local)) throw new Error("reflectiveGenerator: proposal target is outside the candidate worktree");
|
|
577
|
+
}
|
|
578
|
+
function applyPatches(edits, cwd) {
|
|
579
|
+
const result = spawnSync("git", [
|
|
535
580
|
"apply",
|
|
536
|
-
"--whitespace=fix",
|
|
537
581
|
"-p0",
|
|
538
582
|
"-"
|
|
539
583
|
], {
|
|
540
584
|
cwd,
|
|
541
|
-
input: patch,
|
|
585
|
+
input: edits.map((edit) => `${edit.patch.trimEnd()}\n`).join(""),
|
|
542
586
|
encoding: "utf-8"
|
|
543
|
-
})
|
|
587
|
+
});
|
|
588
|
+
if (result.error) throw result.error;
|
|
589
|
+
if (result.status !== 0) throw new Error(`reflectiveGenerator: patch batch failed: ${result.stderr.trim()}`);
|
|
544
590
|
}
|
|
545
591
|
//#endregion
|
|
546
592
|
//#region src/model-resolution.ts
|