@tangle-network/agent-runtime 0.95.0 → 0.96.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -15
- package/dist/activation-B0ZD7nfX.d.ts +63 -0
- package/dist/agent.d.ts +5 -169
- package/dist/agent.js +8 -229
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +6 -9
- package/dist/analyst-loop.js +1 -2
- package/dist/candidate-execution/index.js +6 -7
- package/dist/chunk-3XKSBI2U.js +474 -0
- package/dist/chunk-3XKSBI2U.js.map +1 -0
- package/dist/{chunk-6YBA64Z2.js → chunk-6XKPVJAZ.js} +5 -18
- package/dist/chunk-6XKPVJAZ.js.map +1 -0
- package/dist/{chunk-MKGRLDWB.js → chunk-BLQIYRVR.js} +17 -2
- package/dist/chunk-BLQIYRVR.js.map +1 -0
- package/dist/{chunk-QDSOD7RC.js → chunk-FD2MBMOH.js} +13 -101
- package/dist/chunk-FD2MBMOH.js.map +1 -0
- package/dist/{chunk-YLUOTX6U.js → chunk-FXF2OL34.js} +7 -7
- package/dist/{chunk-EP6RVHMX.js → chunk-HZDEXTSL.js} +848 -2
- package/dist/chunk-HZDEXTSL.js.map +1 -0
- package/dist/chunk-PSOCBNM3.js +2069 -0
- package/dist/chunk-PSOCBNM3.js.map +1 -0
- package/dist/{chunk-BPGXIKK7.js → chunk-SGQ4YIQW.js} +4 -4
- package/dist/{chunk-IADLKE7I.js → chunk-UQ6PNNXM.js} +5 -7
- package/dist/{chunk-IADLKE7I.js.map → chunk-UQ6PNNXM.js.map} +1 -1
- package/dist/{chunk-Z5I642SY.js → chunk-WYC2XJF2.js} +2 -2
- package/dist/{chunk-ZEYAT33L.js → chunk-Y3SRWZMP.js} +2 -2
- package/dist/{chunk-WTZ37EQY.js → chunk-YOLKCWRV.js} +197 -90
- package/dist/chunk-YOLKCWRV.js.map +1 -0
- package/dist/conversation.js +0 -1
- package/dist/environment-provider.js +0 -1
- package/dist/{agentic-generator-hCaQRAes.d.ts → improve-g75IE2Cx.d.ts} +152 -3
- package/dist/{improvement-adapter-BieWeK5J.d.ts → improvement-adapter-HAZz-7vK.d.ts} +8 -31
- package/dist/index.d.ts +41 -11
- package/dist/index.js +180 -51
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +16 -9
- package/dist/intelligence.js +13 -8
- package/dist/intelligence.js.map +1 -1
- package/dist/knowledge.d.ts +30 -13
- package/dist/knowledge.js +11 -10
- package/dist/{loop-runner-bin-BIQldFS8.d.ts → loop-runner-bin-Cn1N2rRo.d.ts} +1 -1
- package/dist/loop-runner-bin.d.ts +2 -2
- package/dist/loop-runner-bin.js +6 -8
- package/dist/loops.d.ts +1 -1
- package/dist/loops.js +4 -6
- package/dist/mcp/bin.js +3 -5
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.js +10 -12
- package/dist/mcp/index.js.map +1 -1
- package/dist/platform.js +0 -2
- package/dist/platform.js.map +1 -1
- package/dist/primeintellect/index.js +0 -1
- package/dist/primeintellect/index.js.map +1 -1
- package/dist/profiles.js +0 -1
- package/dist/profiles.js.map +1 -1
- package/dist/{types-BC3bZpH0.d.ts → types-CmYCMbFT.d.ts} +12 -54
- package/package.json +7 -12
- package/skills/build-with-agent-runtime/SKILL.md +122 -213
- package/dist/chunk-6O73TRHW.js +0 -142
- package/dist/chunk-6O73TRHW.js.map +0 -1
- package/dist/chunk-6YBA64Z2.js.map +0 -1
- package/dist/chunk-AP7CPGMZ.js +0 -334
- package/dist/chunk-AP7CPGMZ.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-DHCHL6OG.js +0 -625
- package/dist/chunk-DHCHL6OG.js.map +0 -1
- package/dist/chunk-EP6RVHMX.js.map +0 -1
- package/dist/chunk-G55QE4IQ.js +0 -1137
- package/dist/chunk-G55QE4IQ.js.map +0 -1
- package/dist/chunk-ISTDY47H.js +0 -849
- package/dist/chunk-ISTDY47H.js.map +0 -1
- package/dist/chunk-MKGRLDWB.js.map +0 -1
- package/dist/chunk-QDSOD7RC.js.map +0 -1
- package/dist/chunk-WTZ37EQY.js.map +0 -1
- package/dist/generator-YkAQrOoD.d.ts +0 -382
- package/dist/improve-B-UYaEH5.d.ts +0 -172
- package/dist/lifecycle.d.ts +0 -870
- package/dist/lifecycle.js +0 -981
- package/dist/lifecycle.js.map +0 -1
- package/dist/mcp-serve-verifier-Bs_n0xPc.d.ts +0 -34
- package/skills/agent-runtime-adoption/SKILL.md +0 -246
- /package/dist/{chunk-YLUOTX6U.js.map → chunk-FXF2OL34.js.map} +0 -0
- /package/dist/{chunk-BPGXIKK7.js.map → chunk-SGQ4YIQW.js.map} +0 -0
- /package/dist/{chunk-Z5I642SY.js.map → chunk-WYC2XJF2.js.map} +0 -0
- /package/dist/{chunk-ZEYAT33L.js.map → chunk-Y3SRWZMP.js.map} +0 -0
package/dist/conversation.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LabeledScenarioStore, WorktreeAdapter, SurfaceProposer } from '@tangle-network/agent-eval/campaign';
|
|
2
|
+
import { Scenario, SelfImproveOptions, SurfaceProposer as SurfaceProposer$1, MutableSurface, SelfImproveResult } from '@tangle-network/agent-eval/contract';
|
|
2
3
|
import { AgentProfile, ReasoningEffort } from '@tangle-network/agent-interface';
|
|
3
4
|
import { L as LocalHarness, C as CodexTokenUsage, a as CodexExecutionEvidence, b as LocalHarnessResult, r as runLocalHarness } from './local-harness-ZqCx51u7.js';
|
|
4
|
-
import {
|
|
5
|
+
import { AnalystFinding, CostLedgerHandle, MaximumCharge } from '@tangle-network/agent-eval';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
@@ -254,4 +255,152 @@ declare function agenticGenerator(opts?: AgenticGeneratorOptions): CandidateGene
|
|
|
254
255
|
* silent fallback). */
|
|
255
256
|
declare function commandVerifier(command: string, args?: string[], timeoutMs?: number): Verifier;
|
|
256
257
|
|
|
257
|
-
|
|
258
|
+
/**
|
|
259
|
+
*
|
|
260
|
+
* `improve` — the ONE public, surface-pluggable RSI verb.
|
|
261
|
+
*
|
|
262
|
+
* A thin facade over agent-eval's `selfImprove` (the held-out-gated closed
|
|
263
|
+
* loop). It removes the two things a caller otherwise has to know to drive the
|
|
264
|
+
* loop by hand: WHICH `MutableSurface` of the profile is being optimized, and
|
|
265
|
+
* WHICH `SurfaceProposer` mutates that surface. You name a `surface`; the
|
|
266
|
+
* facade picks the matching default proposer, extracts the baseline surface from
|
|
267
|
+
* the profile, and runs `selfImprove`. It returns a frozen candidate and never
|
|
268
|
+
* changes the input profile or caller-owned state.
|
|
269
|
+
*
|
|
270
|
+
* - `surface: 'prompt'` → `gepaProposer` mutates `profile.prompt.systemPrompt`.
|
|
271
|
+
* - `surface: 'skills'` → `skillOptProposer` mutates one named inline skill.
|
|
272
|
+
* - `surface: 'memory'` → `memoryCurationProposer` curates the profile's
|
|
273
|
+
* additional instructions as bounded durable lessons.
|
|
274
|
+
* - `surface: 'agent-profile'` → caller-supplied proposer mutates the complete
|
|
275
|
+
* canonical AgentProfile JSON in one candidate.
|
|
276
|
+
* - `surface` ∈ {`tools`, `mcp`, `hooks`, `subagents`, `agent-profile`} → no zero-config default
|
|
277
|
+
* proposer exists (a code/config proposer needs caller-supplied wiring — a
|
|
278
|
+
* worktree repo root, a candidate generator, a serializer). The facade
|
|
279
|
+
* requires an explicit `opts.generator` for these and throws a `ConfigError`
|
|
280
|
+
* otherwise. This is a designed boundary, not a missing default: there is
|
|
281
|
+
* no safe value the facade could invent for those surfaces. Code instead
|
|
282
|
+
* requires `opts.code.repoRoot` and accepts only the runtime-owned
|
|
283
|
+
* `opts.code.generator` path so every isolated checkout can be released.
|
|
284
|
+
*
|
|
285
|
+
* Everything else (`scenarios`, `judge`, `agent`, `budget`, `llm`) passes
|
|
286
|
+
* straight through to `selfImprove`.
|
|
287
|
+
*
|
|
288
|
+
* @experimental
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
/** The executable agent lever `improve` optimizes. Profile fields remain
|
|
292
|
+
* portable AgentProfile coordinates; implementation and orchestration files
|
|
293
|
+
* use the code surface so a winner can be sealed into an exact candidate. */
|
|
294
|
+
type ImproveSurface = 'prompt' | 'skills' | 'tools' | 'mcp' | 'hooks' | 'subagents' | 'agent-profile' | 'memory' | 'code';
|
|
295
|
+
type ImproveOptions<TScenario extends Scenario, TArtifact> = Omit<SelfImproveOptions<TScenario, TArtifact>, 'analyzeGeneration' | 'baselineSurface' | 'findings' | 'gate' | 'proposer'> & {
|
|
296
|
+
/** Which profile lever to optimize. Default `'prompt'`. Selects the default
|
|
297
|
+
* generator + the baseline-surface extraction shape. */
|
|
298
|
+
surface?: ImproveSurface;
|
|
299
|
+
/** The `SurfaceProposer` that mutates a profile surface. When unset, the facade
|
|
300
|
+
* picks the default for prompt, skills, and memory; surfaces
|
|
301
|
+
* with no default REQUIRE this (fail-loud otherwise). Forbidden for code;
|
|
302
|
+
* use `code.generator` so the runtime owns candidate cleanup. */
|
|
303
|
+
generator?: SurfaceProposer$1;
|
|
304
|
+
/** Gate mode. `'holdout'` (default) runs the held-out promotion gate;
|
|
305
|
+
* `'none'` is a baseline-only run (`budget.generations = 0`). */
|
|
306
|
+
gate?: 'holdout' | 'none';
|
|
307
|
+
/** Restrict the run to this subset of models. When set, the reflection model
|
|
308
|
+
* (`llm.model`, or the default when unset) must be a member, or `improve()` throws
|
|
309
|
+
* a `ConfigError` before the generator is built. Unset = unrestricted. */
|
|
310
|
+
allowedModels?: readonly string[];
|
|
311
|
+
/** Per-generation findings producer passthrough (see selfImprove.analyzeGeneration).
|
|
312
|
+
* DEFAULT: the built-in failure distiller — after each generation it turns the
|
|
313
|
+
* worst-scoring/errored cells into structured findings ({ scenario, composite,
|
|
314
|
+
* notes, error }) for the NEXT proposal round, so the proposer reasons over what
|
|
315
|
+
* actually failed instead of a static seed. Pass your own producer (e.g. a
|
|
316
|
+
* trace-analyst over the runDir's traces) to replace it; pass `null` to disable
|
|
317
|
+
* and keep the static `findings` all the way through. */
|
|
318
|
+
analyzeGeneration?: SelfImproveOptions<TScenario, TArtifact>['analyzeGeneration'] | null;
|
|
319
|
+
/** META-HARNESS mode: instead of the ~1500-char distilled findings, feed the
|
|
320
|
+
* proposer RAW-TRACE FILESYSTEM CONTEXT — the PATHS into the prior generation's
|
|
321
|
+
* real run traces under `runDir` (per-cell `spans.jsonl` event logs +
|
|
322
|
+
* `cached-result.json` scores + artifacts) plus a `grep`/`cat`-to-diagnose
|
|
323
|
+
* instruction — so the coding agent reads the actual failures itself rather than
|
|
324
|
+
* a pre-summary. Requires a REAL `runDir` (that is where the traces live).
|
|
325
|
+
* Ignored when `analyzeGeneration` is set explicitly (that wins) or is `null`
|
|
326
|
+
* (disabled). Equivalent to `analyzeGeneration: rawTraceDistiller()`; this flag
|
|
327
|
+
* is the one-line enable. Default `false` (the distiller stays the default). */
|
|
328
|
+
rawTraceContext?: boolean;
|
|
329
|
+
/** CODE-surface wiring: name `surface: 'code'`, point at a repo, and the
|
|
330
|
+
* facade assembles the whole candidate pipeline — an isolated incumbent plus git worktrees
|
|
331
|
+
* (`gitWorktreeAdapter`) driven by `improvementDriver` with the full agentic
|
|
332
|
+
* generator (a real coding harness edits each candidate worktree; a `verify`
|
|
333
|
+
* hook gates candidates before they are ever measured). Ignored when
|
|
334
|
+
* `opts.generator` is supplied. Required for every code run because a real
|
|
335
|
+
* repository and base ref are necessary to measure the incumbent. */
|
|
336
|
+
code?: ImproveCodeOptions;
|
|
337
|
+
/** Select the exact inline skill document to optimize. */
|
|
338
|
+
skills?: ImproveSkillsOptions;
|
|
339
|
+
/** Custom held-back-exam decision. The string `gate` above controls whether
|
|
340
|
+
* the exam runs; this callback controls how its evidence decides promotion. */
|
|
341
|
+
promotionGate?: SelfImproveOptions<TScenario, TArtifact>['gate'];
|
|
342
|
+
};
|
|
343
|
+
interface ImproveSkillsOptions {
|
|
344
|
+
/** `name` of one inline entry in `profile.resources.skills`. */
|
|
345
|
+
resourceName: string;
|
|
346
|
+
}
|
|
347
|
+
interface ImproveCodeOptions {
|
|
348
|
+
/** Repo root candidate worktrees fork from. */
|
|
349
|
+
repoRoot: string;
|
|
350
|
+
/** Base ref candidates fork from. Default `main`. */
|
|
351
|
+
baseRef?: string;
|
|
352
|
+
/** Directory worktrees are created under. Default `<repoRoot>/.worktrees`. */
|
|
353
|
+
worktreeDir?: string;
|
|
354
|
+
/** Git-compatible adapter override, primarily for tests. Candidate advancement
|
|
355
|
+
* still requires normal Git worktree and commit semantics. */
|
|
356
|
+
worktree?: WorktreeAdapter;
|
|
357
|
+
/** Coding harness the agentic generator runs in each worktree. Default `claude`. */
|
|
358
|
+
harness?: LocalHarness;
|
|
359
|
+
/** Verify a candidate worktree before it becomes a measurable surface; failures
|
|
360
|
+
* feed the next shot (see `agenticGenerator.verify` / `commandVerifier`). */
|
|
361
|
+
verify?: Verifier;
|
|
362
|
+
/** Per-shot wall-clock timeout for the harness (ms). */
|
|
363
|
+
timeoutMs?: number;
|
|
364
|
+
/** Byte-producer override — the test seam and the escape hatch for custom
|
|
365
|
+
* candidate production. When set, `harness`/`verify`/`timeoutMs` are unused. */
|
|
366
|
+
generator?: CandidateGenerator;
|
|
367
|
+
}
|
|
368
|
+
interface ImprovementCandidate {
|
|
369
|
+
/** Surface searched by this run. */
|
|
370
|
+
surface: ImproveSurface;
|
|
371
|
+
/** Exact winning value returned by agent-eval. */
|
|
372
|
+
value: MutableSurface;
|
|
373
|
+
/** Detached profile candidate when the surface maps directly to AgentProfile. */
|
|
374
|
+
profile?: AgentProfile;
|
|
375
|
+
}
|
|
376
|
+
interface ImproveResult<TScenario extends Scenario, TArtifact> {
|
|
377
|
+
/** Frozen candidate only. Live state is changed through an approved activation. */
|
|
378
|
+
candidate: ImprovementCandidate;
|
|
379
|
+
/** Held-out decision for this search result. */
|
|
380
|
+
decision: SelfImproveResult<TScenario, TArtifact>['gateDecision'];
|
|
381
|
+
/** Held-out lift (`winner − baseline` composite). */
|
|
382
|
+
lift: number;
|
|
383
|
+
/** Full `selfImprove` result for advanced inspection. For code runs,
|
|
384
|
+
* `raw.winner.surface.worktreeRef` remains live after return whether the
|
|
385
|
+
* candidate passed or held; call `dispose()` after consuming it. */
|
|
386
|
+
raw: SelfImproveResult<TScenario, TArtifact>;
|
|
387
|
+
/** Release resources owned by this result. Idempotent; currently disposes
|
|
388
|
+
* the returned code worktree and is a no-op for profile-only surfaces. */
|
|
389
|
+
dispose(): Promise<void>;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Run the held-out-gated self-improvement loop on ONE profile surface.
|
|
393
|
+
*
|
|
394
|
+
* @example Optimize the system prompt, default holdout gate:
|
|
395
|
+
*
|
|
396
|
+
* const out = await improve(profile, findings, {
|
|
397
|
+
* surface: 'prompt',
|
|
398
|
+
* scenarios,
|
|
399
|
+
* judge,
|
|
400
|
+
* agent: (surface, scenario, ctx) => runAgent(surface, scenario, ctx.signal),
|
|
401
|
+
* })
|
|
402
|
+
* if (out.decision === 'ship') console.log(out.candidate)
|
|
403
|
+
*/
|
|
404
|
+
declare function improve<TScenario extends Scenario, TArtifact>(profile: AgentProfile, findings: unknown[], opts: ImproveOptions<TScenario, TArtifact>): Promise<ImproveResult<TScenario, TArtifact>>;
|
|
405
|
+
|
|
406
|
+
export { AGENTIC_PROFILE_RESOURCE_ROOT as A, type CandidateGenerator as C, type ImproveOptions as I, type ManagedImprovementDriver as M, type Verifier as V, type ImproveResult as a, type AgenticGeneratorOptions as b, type AgenticGeneratorShotDisposition as c, type AgenticGeneratorShotExecution as d, type AgenticGeneratorShotReceipt as e, type ImproveCodeOptions as f, type ImproveSkillsOptions as g, type ImproveSurface as h, type ImprovementCandidate as i, type ImprovementDriverOptions as j, type VerifyResult as k, agenticGenerator as l, commandVerifier as m, improve as n, improvementDriver as o };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FindingSubject, AnalystFinding } from '@tangle-network/agent-eval';
|
|
2
|
-
import { I as
|
|
2
|
+
import { I as ImprovementProposalSource } from './types-CmYCMbFT.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `AgentSurfaces` — declarative map of the mutable file/directory paths
|
|
@@ -116,23 +116,15 @@ declare function validateSurfaces(surfaces: AgentSurfaces, repoRoot: string): Re
|
|
|
116
116
|
declare function renderSurfaceIssues(issues: ReadonlyArray<SurfaceValidationIssue>, repoRoot: string): string;
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
120
|
-
* patches
|
|
119
|
+
* Surface improvement proposer — resolves analyst findings into LLM-drafted
|
|
120
|
+
* candidate patches without changing the caller's repository.
|
|
121
121
|
*
|
|
122
|
-
*
|
|
123
|
-
* substrate parses each finding's `subject` via
|
|
122
|
+
* The proposer parses each finding's `subject` via
|
|
124
123
|
* `parseFindingSubject` (agent-eval), resolves it to a real file path
|
|
125
124
|
* via the agent's `AgentSurfaces`, reads the current content, and asks
|
|
126
125
|
* an LLM to draft a unified-diff patch given the finding + current
|
|
127
126
|
* content + per-kind editing-discipline rules.
|
|
128
127
|
*
|
|
129
|
-
* Auto-apply gates on the source-finding's confidence and the
|
|
130
|
-
* autoApply.improvement policy. Two modes:
|
|
131
|
-
* `write` — apply the patch in-place via `git apply -p0`. Operator
|
|
132
|
-
* reviews via `git diff`.
|
|
133
|
-
* `open-pr` — write to a branch, commit, push, open a PR via `gh`.
|
|
134
|
-
* Operator reviews via the PR UI.
|
|
135
|
-
*
|
|
136
128
|
* Fail-loud rules:
|
|
137
129
|
* - Findings whose subject doesn't parse → counted in `errors`.
|
|
138
130
|
* - Findings whose subject targets an undeclared surface → counted in
|
|
@@ -169,7 +161,7 @@ interface SurfaceImprovementEdit {
|
|
|
169
161
|
/** Carry-forward severity for prioritization. */
|
|
170
162
|
severity: AnalystFinding['severity'];
|
|
171
163
|
}
|
|
172
|
-
interface
|
|
164
|
+
interface CreateSurfaceImprovementProposerOptions {
|
|
173
165
|
surfaces: AgentSurfaces;
|
|
174
166
|
repoRoot: string;
|
|
175
167
|
/**
|
|
@@ -181,21 +173,6 @@ interface CreateSurfaceImprovementAdapterOpts {
|
|
|
181
173
|
* substantive prompt rewrites, etc.) via this callback.
|
|
182
174
|
*/
|
|
183
175
|
draftPatch: (input: DraftPatchInput) => Promise<DraftPatchOutput>;
|
|
184
|
-
/**
|
|
185
|
-
* Apply mode:
|
|
186
|
-
* `write` — `git apply` in-place; operator reviews via `git diff`
|
|
187
|
-
* `open-pr` — branch + commit + push + `gh pr create`
|
|
188
|
-
* `none` — never apply; collect proposals for the report only
|
|
189
|
-
*
|
|
190
|
-
* The `apply` method honours this even when the loop calls it; the
|
|
191
|
-
* effective behaviour is also gated on the per-finding confidence
|
|
192
|
-
* threshold via `runAnalystLoop`'s `autoApply` policy.
|
|
193
|
-
*/
|
|
194
|
-
mode?: 'write' | 'open-pr' | 'none';
|
|
195
|
-
/** When `mode === 'open-pr'`, the base branch new PRs target. Default: `main`. */
|
|
196
|
-
baseBranch?: string;
|
|
197
|
-
/** Required for `mode === 'open-pr'` — the GH owner/repo (`tangle-network/tax-agent`). */
|
|
198
|
-
ghRepo?: string;
|
|
199
176
|
/**
|
|
200
177
|
* When the resolved target doesn't exist, allow the substrate to
|
|
201
178
|
* CREATE the file (for `knowledge.wiki`, `new-tool` subjects). Default
|
|
@@ -220,7 +197,7 @@ interface DraftPatchOutput {
|
|
|
220
197
|
/** Multi-line rationale for the PR body. */
|
|
221
198
|
rationale: string;
|
|
222
199
|
}
|
|
223
|
-
/**
|
|
224
|
-
declare function
|
|
200
|
+
/** Resolve each finding to a real surface and draft a detached patch candidate. */
|
|
201
|
+
declare function createSurfaceImprovementProposer(opts: CreateSurfaceImprovementProposerOptions): ImprovementProposalSource<SurfaceImprovementEdit>;
|
|
225
202
|
|
|
226
|
-
export { type AgentSurfaces as A, type
|
|
203
|
+
export { type AgentSurfaces as A, type CreateSurfaceImprovementProposerOptions as C, type DraftPatchInput as D, type ResolvedSurface as R, type SurfaceImprovementEdit as S, type DraftPatchOutput as a, type SurfaceValidationIssue as b, createSurfaceImprovementProposer as c, resolveSubjectPath as d, renderSurfaceIssues as r, validateSurfaces as v };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,18 +6,16 @@ export { AGENT_CANDIDATE_EXECUTION_SUPPORT, AgentCandidateBundleInput, AgentCand
|
|
|
6
6
|
export { a as AgentCandidateExecutionAttemptRecord, b as AgentCandidateExecutionAttemptRef, c as AgentCandidateExecutionClaim, d as AgentCandidateExecutionClaimResult, A as AgentCandidateExecutionClaimStore, e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, g as AgentCandidateExecutionFinishResult, h as AgentCandidateExecutionLease, i as AgentCandidateExecutionPhase, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionRecoveryEvidence, l as AgentCandidateExecutionStageResult, m as AgentCandidateExecutionTerminalRecord, n as AgentCandidateExecutionTerminalResult, o as AgentCandidatePreparationEvidence, q as AgentCandidateRetryRejection, E as ExecutePreparedAgentCandidateOptions, I as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, r as applyExactAgentProfileDiff, s as executePreparedAgentCandidate, t as parseExactAgentProfile, u as parseExactAgentProfileDiff, v as prepareAgentCandidateExecution } from './profile-DbfaMTdk.js';
|
|
7
7
|
export { f as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, g as AgentCandidateContainerPort, e as AgentCandidateExecutionPorts, h as AgentCandidateExecutorFinalCapture, i as AgentCandidateExecutorMemoryCapture, A as AgentCandidateExecutorPort, j as AgentCandidateExecutorProfileFile, k as AgentCandidateExecutorRequest, l as AgentCandidateExecutorStopRequest, m as AgentCandidateExecutorTaskOutcomeCapture, n as AgentCandidateExecutorWorkspaceFile, o as AgentCandidateExecutorWorkspaceInput, p as AgentCandidateMemoryPort, q as AgentCandidateMemoryResetResult, r as AgentCandidateModelLimits, s as AgentCandidateModelPort, b as AgentCandidateOutputArtifactPort, t as AgentCandidateOutputPurpose, u as AgentCandidateProtectedModelActivation, v as AgentCandidateProtectedModelReservation, w as AgentCandidateProtectedModelSettlement, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, z as AgentCandidateVerificationPorts, B as AgentCandidateWorkspacePort, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, P as PreparedAgentCandidateExecution, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, V as VerifiedAgentCandidate, J as VerifiedAgentCandidateTaskOutcome } from './types-CWqfCO8s.js';
|
|
8
8
|
export { AuthSource, BackendCallPolicy, CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, Conversation, ConversationDriveState, ConversationJournal, ConversationJournalEntry, ConversationParticipant, ConversationPolicy, ConversationResult, ConversationStreamEvent, ConversationTurn, D1DatabaseLike, D1StmtLike, DEFAULT_MAX_DEPTH, DeadlineExceededError, FORWARD_HEADERS, FileConversationJournal, ForwardHeaderName, HaltContext, HaltPredicate, HaltReason, HaltSignal, InMemoryConversationJournal, PersonaConversationResult, PersonaDriver, PropagatedHeaders, RetryBackoff, RetryableErrorPredicate, RunConversationOptions, RunPersonaConfig, RunPersonaConversationOptions, SqlAdapter, SqlConversationJournal, TurnOrder, buildForwardHeaders, computeBackoff, createConversationBackend, d1ToSqlAdapter, defaultIsRetryable, defineConversation, isDepthExceeded, makePerAttemptSignal, readDepth, runConversation, runConversationStream, runPersonaConversation, runPersonaDispatch, sleep, slugifySpeaker, turnId } from './conversation.js';
|
|
9
|
-
import { C as CandidateGenerator } from './
|
|
10
|
-
export { A as AGENTIC_PROFILE_RESOURCE_ROOT,
|
|
11
|
-
export { b as ImproveCodeOptions, c as ImproveMemoryOptions, I as ImproveOptions, a as ImproveResult, d as ImproveSkillsOptions, e as ImproveSurface, f as applyImprovementWinnerToProfile, i as improve } from './improve-B-UYaEH5.js';
|
|
12
|
-
export { M as McpServeSpec, m as mcpServeVerifier } from './mcp-serve-verifier-Bs_n0xPc.js';
|
|
9
|
+
import { V as Verifier, C as CandidateGenerator } from './improve-g75IE2Cx.js';
|
|
10
|
+
export { A as AGENTIC_PROFILE_RESOURCE_ROOT, b as AgenticGeneratorOptions, c as AgenticGeneratorShotDisposition, d as AgenticGeneratorShotExecution, e as AgenticGeneratorShotReceipt, f as ImproveCodeOptions, I as ImproveOptions, a as ImproveResult, g as ImproveSkillsOptions, h as ImproveSurface, i as ImprovementCandidate, j as ImprovementDriverOptions, M as ManagedImprovementDriver, k as VerifyResult, l as agenticGenerator, m as commandVerifier, n as improve, o as improvementDriver } from './improve-g75IE2Cx.js';
|
|
13
11
|
import { ProposeContext, SurfaceProposer } from '@tangle-network/agent-eval/campaign';
|
|
14
12
|
import { AgentProfile, AgentProfileDiff } from '@tangle-network/agent-interface';
|
|
15
13
|
export { AgentCandidateBenchmarkGraderIdentity } from '@tangle-network/agent-interface';
|
|
16
14
|
import { Scenario, SelfImproveOptions } from '@tangle-network/agent-eval/contract';
|
|
17
|
-
import { S as SurfaceImprovementEdit } from './improvement-adapter-
|
|
18
|
-
import { I as
|
|
19
|
-
export { AgentKnowledgeReadinessCheckOptions,
|
|
20
|
-
export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-
|
|
15
|
+
import { S as SurfaceImprovementEdit } from './improvement-adapter-HAZz-7vK.js';
|
|
16
|
+
import { I as ImprovementProposalSource } from './types-CmYCMbFT.js';
|
|
17
|
+
export { AgentKnowledgeReadinessCheckOptions, CreateKnowledgeImprovementActivationExecutorOptions, KnowledgeImprovementActivationExecutor, KnowledgeImprovementCandidatePair, KnowledgeImprovementExperimentBundles, KnowledgeImprovementJobMeasurement, KnowledgeImprovementJobResult, KnowledgeReadinessCheck, KnowledgeReadinessCheckInput, KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, RunKnowledgeImprovementJobOptions, SupervisedKnowledgeUpdateInput, SupervisedKnowledgeUpdateOptions, SupervisedKnowledgeUpdateResult, SupervisedKnowledgeUpdater, buildKnowledgeImprovementExperimentBundles, createAgentKnowledgeReadinessCheck, createKnowledgeImprovementActivationExecutor, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate } from './knowledge.js';
|
|
18
|
+
export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-Cn1N2rRo.js';
|
|
21
19
|
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-fnj6SRVg.js';
|
|
22
20
|
export { b0 as EvalRunEvent, b1 as EvalRunGeneration, b2 as EvalRunsExportConfig, b3 as EvalRunsExportResult, b4 as INTELLIGENCE_WIRE_VERSION, b5 as LoopSpanNode, b6 as OtelAttribute, b7 as OtelExportConfig, b8 as OtelExporter, b9 as OtelSpan, ba as RuntimeEventOtelOptions, bb as buildLoopOtelSpans, bc as buildLoopSpanNodes, bd as buildRuntimeEventOtelSpans, be as createOtelExporter, bf as exportEvalRuns, bg as loopEventToOtelSpan } from './coordination-BFE3Den7.js';
|
|
23
21
|
import { K as KnowledgeReadinessDecision, A as AgentBackendInput, c as AgentExecutionBackend, h as RunAgentTaskOptions, i as AgentTaskRunResult, j as RunAgentTaskStreamOptions, R as RuntimeStreamEvent, k as RuntimeSessionStore, l as RuntimeSession } from './types-BwoZWq-i.js';
|
|
@@ -29,6 +27,7 @@ export { d as RuntimeEventCollector, e as RuntimeStreamEventCollector, S as Sani
|
|
|
29
27
|
import './local-harness-ZqCx51u7.js';
|
|
30
28
|
import 'node:child_process';
|
|
31
29
|
import '@tangle-network/agent-knowledge';
|
|
30
|
+
import './activation-B0ZD7nfX.js';
|
|
32
31
|
import './supervise-BLPI50-w.js';
|
|
33
32
|
import './types-CmnA2iL3.js';
|
|
34
33
|
import '@tangle-network/sandbox';
|
|
@@ -265,6 +264,37 @@ declare function toolBuildPrompt(args: FindingsArg): string;
|
|
|
265
264
|
/** Build the starting instruction for a coder agent tasked with implementing a new MCP server. */
|
|
266
265
|
declare function mcpBuildPrompt(args: FindingsArg): string;
|
|
267
266
|
|
|
267
|
+
/**
|
|
268
|
+
* `mcpServeVerifier` — the intrinsic verifier for a built MCP server: the
|
|
269
|
+
* boot-and-probe checker named in docs/artifact-lifecycle-frontier.md. A
|
|
270
|
+
* generated MCP server is only a candidate if it actually *serves* — so this
|
|
271
|
+
* boots it over stdio (the default local MCP transport) and runs the real
|
|
272
|
+
* handshake: `initialize` → `notifications/initialized` → `tools/list`, and
|
|
273
|
+
* asserts the server answers with at least `minTools` tools.
|
|
274
|
+
*
|
|
275
|
+
* Outcomes follow the `Verifier` contract: a server that fails to start, exits
|
|
276
|
+
* early, errors the handshake, times out, or exposes no tools is a FAILED
|
|
277
|
+
* candidate (`{ok:false}`, fed back into the next generation shot); a missing
|
|
278
|
+
* start binary or spawn fault THROWS (a setup bug, never a silent fallback).
|
|
279
|
+
*
|
|
280
|
+
* Protocol matches the runtime's own stdio MCP server (src/mcp/server.ts):
|
|
281
|
+
* newline-delimited JSON-RPC 2.0, protocol version 2024-11-05.
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
interface McpServeSpec {
|
|
285
|
+
/** Command that starts the built MCP server in the worktree (stdio transport). */
|
|
286
|
+
command: string;
|
|
287
|
+
args?: string[];
|
|
288
|
+
/** Extra env for the server process (merged over `process.env`). */
|
|
289
|
+
env?: Record<string, string>;
|
|
290
|
+
/** Handshake timeout (ms). Default 30s. */
|
|
291
|
+
timeoutMs?: number;
|
|
292
|
+
/** Minimum tools the server must expose to pass. Default 1. */
|
|
293
|
+
minTools?: number;
|
|
294
|
+
}
|
|
295
|
+
/** Build a `Verifier` that boots a generated MCP server over stdio and checks it exposes tools. */
|
|
296
|
+
declare function mcpServeVerifier(spec: McpServeSpec): Verifier;
|
|
297
|
+
|
|
268
298
|
type ProfileDiffProposerContext<TFindings = unknown> = ProposeContext<TFindings> & {
|
|
269
299
|
profile: AgentProfile;
|
|
270
300
|
};
|
|
@@ -350,7 +380,7 @@ declare function rawTraceDistiller<TScenario extends Scenario = Scenario, TArtif
|
|
|
350
380
|
/**
|
|
351
381
|
*
|
|
352
382
|
* `reflectiveGenerator` — the cheap, no-sandbox `CandidateGenerator`. It drafts
|
|
353
|
-
* surface edits via the existing improvement
|
|
383
|
+
* surface edits via the existing improvement proposer (`proposeFromFindings`,
|
|
354
384
|
* one LLM patch per finding) and applies them as ONE coherent improvement into
|
|
355
385
|
* the candidate worktree. `maxShots` is ignored — reflection is single-shot by
|
|
356
386
|
* construction (the patches are already drafted).
|
|
@@ -363,7 +393,7 @@ declare function rawTraceDistiller<TScenario extends Scenario = Scenario, TArtif
|
|
|
363
393
|
*/
|
|
364
394
|
|
|
365
395
|
interface ReflectiveGeneratorOptions {
|
|
366
|
-
|
|
396
|
+
improvementProposalSource: ImprovementProposalSource<SurfaceImprovementEdit>;
|
|
367
397
|
}
|
|
368
398
|
/** Cheap no-sandbox `CandidateGenerator` (the `shots=1` setting): draft surface edits via the improvement adapter and apply them as one coherent candidate. */
|
|
369
399
|
declare function reflectiveGenerator(opts: ReflectiveGeneratorOptions): CandidateGenerator;
|
|
@@ -793,4 +823,4 @@ interface StreamToolLoopOptions<Raw> {
|
|
|
793
823
|
* `capped` if it stops for any non-completed reason with calls still pending. */
|
|
794
824
|
declare function streamToolLoop<Raw>(opts: StreamToolLoopOptions<Raw>): AsyncGenerator<StreamToolLoopYield<Raw>, void, unknown>;
|
|
795
825
|
|
|
796
|
-
export { AgentBackendInput, type AgentBackendKind, AgentExecutionBackend, AgentTaskRunResult, BackendTransportError, CandidateGenerator, type ChatStreamEvent, type ChatTurnHooks, type ChatTurnIdentity, type ChatTurnProducer, type ChatTurnResult, DEFAULT_ROUTER_BASE_URL, InMemoryRuntimeSessionStore, type ModelInfo, PlannerError, type ProfileDiffProposerContext, type ProfileDiffProposerOptions, type RawTraceDistillerOptions, type ReflectiveGeneratorOptions, type ResolveAgentBackendOptions, type ResolvedChatModel, type RouterEnv, type RunChatTurnInput, type RunToolLoopOptions, RuntimeHooks, RuntimeRunStateError, RuntimeSessionStore, RuntimeStreamEvent, RuntimeTelemetryOptions, type StreamToolLoopOptions, type StreamToolLoopYield, type ToolCallOutcome, type ToolLoopAssistantToolCall, type ToolLoopCall, type ToolLoopEvent, type ToolLoopMessage, type ToolLoopResult, type ToolLoopStopReason, applyRunRecordDefaults, cleanModelId, createOpenAICompatibleBackend, decideKnowledgeReadiness, deriveExecutionId, getModels, handleChatTurn, mcpBuildPrompt, profileDiffProposer, rawTraceDistiller, readinessServerSentEvent, reflectiveGenerator, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runToolLoop, runtimeStreamServerSentEvent, streamToolLoop, toolBuildPrompt, validateChatModelId };
|
|
826
|
+
export { AgentBackendInput, type AgentBackendKind, AgentExecutionBackend, AgentTaskRunResult, BackendTransportError, CandidateGenerator, type ChatStreamEvent, type ChatTurnHooks, type ChatTurnIdentity, type ChatTurnProducer, type ChatTurnResult, DEFAULT_ROUTER_BASE_URL, InMemoryRuntimeSessionStore, type McpServeSpec, type ModelInfo, PlannerError, type ProfileDiffProposerContext, type ProfileDiffProposerOptions, type RawTraceDistillerOptions, type ReflectiveGeneratorOptions, type ResolveAgentBackendOptions, type ResolvedChatModel, type RouterEnv, type RunChatTurnInput, type RunToolLoopOptions, RuntimeHooks, RuntimeRunStateError, RuntimeSessionStore, RuntimeStreamEvent, RuntimeTelemetryOptions, type StreamToolLoopOptions, type StreamToolLoopYield, type ToolCallOutcome, type ToolLoopAssistantToolCall, type ToolLoopCall, type ToolLoopEvent, type ToolLoopMessage, type ToolLoopResult, type ToolLoopStopReason, Verifier, applyRunRecordDefaults, cleanModelId, createOpenAICompatibleBackend, decideKnowledgeReadiness, deriveExecutionId, getModels, handleChatTurn, mcpBuildPrompt, mcpServeVerifier, profileDiffProposer, rawTraceDistiller, readinessServerSentEvent, reflectiveGenerator, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runToolLoop, runtimeStreamServerSentEvent, streamToolLoop, toolBuildPrompt, validateChatModelId };
|