@tangle-network/agent-runtime 0.282.0 → 0.283.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{activation-Bi_oOB1-.js → activation-B_vuAOSo.js} +3 -3
  2. package/dist/{activation-Bi_oOB1-.js.map → activation-B_vuAOSo.js.map} +1 -1
  3. package/dist/{activation-BcTWDNOD.d.ts → activation-DL1VoNrT.d.ts} +16 -3
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{bundle-CvLGRVO-.js → bundle-BfW-32vB.js} +2 -2
  7. package/dist/{bundle-CvLGRVO-.js.map → bundle-BfW-32vB.js.map} +1 -1
  8. package/dist/candidate-execution/index.js +5 -5
  9. package/dist/{coordination-driver-B-HOpGN4.js → coordination-driver-BmkANXc5.js} +2 -2
  10. package/dist/{coordination-driver-B-HOpGN4.js.map → coordination-driver-BmkANXc5.js.map} +1 -1
  11. package/dist/{delegate-C1eIBN70.js → delegate-BfHKdHzV.js} +2 -2
  12. package/dist/{delegate-C1eIBN70.js.map → delegate-BfHKdHzV.js.map} +1 -1
  13. package/dist/durable.d.ts +1 -1
  14. package/dist/durable.js +3 -3
  15. package/dist/{graph-KjJaTmbO.js → graph-XmlRTlaI.js} +4 -4
  16. package/dist/{graph-KjJaTmbO.js.map → graph-XmlRTlaI.js.map} +1 -1
  17. package/dist/{improvement-cycle-8MUf5Xfp.js → improvement-cycle-BFerq3l4.js} +6 -6
  18. package/dist/{improvement-cycle-8MUf5Xfp.js.map → improvement-cycle-BFerq3l4.js.map} +1 -1
  19. package/dist/{index-CSyzK6Kd.d.ts → index-CkLB8mJF.d.ts} +11 -3
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +9 -9
  22. package/dist/intelligence.d.ts +1 -1
  23. package/dist/intelligence.js +8 -8
  24. package/dist/kernel.d.ts +1 -1
  25. package/dist/kernel.js +8 -8
  26. package/dist/{loop-runner-bin-Dtt8FdYO.d.ts → loop-runner-bin-CINywrHK.d.ts} +2 -2
  27. package/dist/{loop-runner-bin-Cg78CKmf.js → loop-runner-bin-D8P3T5rT.js} +3 -3
  28. package/dist/{loop-runner-bin-Cg78CKmf.js.map → loop-runner-bin-D8P3T5rT.js.map} +1 -1
  29. package/dist/loop-runner-bin.d.ts +1 -1
  30. package/dist/loop-runner-bin.js +1 -1
  31. package/dist/mcp/bin.js +3 -3
  32. package/dist/mcp/index.d.ts +1 -1
  33. package/dist/mcp/index.js +4 -4
  34. package/dist/{prepare-DVlvGP7V.js → prepare-CxnyZ1fG.js} +3 -3
  35. package/dist/{prepare-DVlvGP7V.js.map → prepare-CxnyZ1fG.js.map} +1 -1
  36. package/dist/{profile-D3eXNBQV.js → profile-C4NDjZyB.js} +2 -2
  37. package/dist/{profile-D3eXNBQV.js.map → profile-C4NDjZyB.js.map} +1 -1
  38. package/dist/{protected-model-port-BrWgsCnl.js → protected-model-port-BSsgmdhI.js} +4 -4
  39. package/dist/{protected-model-port-BrWgsCnl.js.map → protected-model-port-BSsgmdhI.js.map} +1 -1
  40. package/dist/{provision-supervisor-CkN8RRjv.js → provision-supervisor-BNUmrHwC.js} +3 -3
  41. package/dist/{provision-supervisor-CkN8RRjv.js.map → provision-supervisor-BNUmrHwC.js.map} +1 -1
  42. package/dist/{runtime-Bid-kBes.js → runtime-CM3KCe9V.js} +86 -23
  43. package/dist/runtime-CM3KCe9V.js.map +1 -0
  44. package/dist/{search-method-CbUyhdz5.js → search-method-Dlor0kKQ.js} +43 -9
  45. package/dist/{search-method-CbUyhdz5.js.map → search-method-Dlor0kKQ.js.map} +1 -1
  46. package/dist/{server-dOyG5Tw6.js → server-BnMcTE7J.js} +3 -3
  47. package/dist/{server-dOyG5Tw6.js.map → server-BnMcTE7J.js.map} +1 -1
  48. package/dist/{supervise-zt91I62x.js → supervise-DL_Hj1uk.js} +3 -3
  49. package/dist/{supervise-zt91I62x.js.map → supervise-DL_Hj1uk.js.map} +1 -1
  50. package/dist/{supervisor-UXgaPisu.js → supervisor-YAc4U8HQ.js} +2 -2
  51. package/dist/{supervisor-UXgaPisu.js.map → supervisor-YAc4U8HQ.js.map} +1 -1
  52. package/dist/testing.d.ts +1 -1
  53. package/dist/testing.js +14 -14
  54. package/dist/tui/index.d.ts +1 -1
  55. package/dist/tui/index.js +1 -1
  56. package/dist/{workspace-archive-C9lgf77y.js → workspace-archive-MhowMCmp.js} +8 -6
  57. package/dist/workspace-archive-MhowMCmp.js.map +1 -0
  58. package/package.json +2 -2
  59. package/skills/profile-authoring/SKILL.md +60 -14
  60. package/dist/runtime-Bid-kBes.js.map +0 -1
  61. package/dist/workspace-archive-C9lgf77y.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { Ba as promptOptionsFromAgentTurnInput, Br as createOpenInferenceFileExporter, Gr as padSpanId, Ht as InMemorySpawnJournal, Ia as armDeadlineTimer, Ji as unknownExecutionBindingReceipt, K as openSlotGroup, Ki as runtimeOwnedPendingExecutorMaterialization, Kr as padTraceId, Li as knownExecutionBindingReceipt, M as withDriverExecutor, Mt as createExecutorRegistry, Ot as captureReusableExecutorConfig, Pa as awaitAbortable, Pi as authoredProfileDigest, Qn as observedModelMatchesDeclared, Ri as knownMaterializationReceipt, Sa as sleep, Ui as runtimeOwnedExecutorExecutionBinding, Ur as generateSpanId, Va as providerMessageText, Vr as createOtelExporter, Vt as InMemoryResultBlobStore, Wi as runtimeOwnedExecutorMaterialization, Xi as executableAgentProfileSnapshot, Yi as unknownMaterializationReceipt, aa as createSandboxUsageLedger, ar as sandboxClientAsProvider, ca as mapSandboxEvent, ea as projectSandboxOutcome, er as LEAF_CONTINUATION_TASK, ia as createSandboxToolPartState, jt as createExecutor, la as mapSandboxToolEvent, oi as harnessInvocation, or as unavailablePauseMs, qr as toOtelAttributes, r as createSupervisor, ra as canonicalStreamEventFromSandboxEvent, sa as isSandboxTerminalEvent, sr as unavailableSignalOfFailure, ta as readSandboxOutcome, za as promptFromAgentTurnInput } from "./supervisor-UXgaPisu.js";
1
+ import { Ba as promptOptionsFromAgentTurnInput, Br as createOpenInferenceFileExporter, Gr as padSpanId, Ht as InMemorySpawnJournal, Ia as armDeadlineTimer, Ji as unknownExecutionBindingReceipt, K as openSlotGroup, Ki as runtimeOwnedPendingExecutorMaterialization, Kr as padTraceId, Li as knownExecutionBindingReceipt, M as withDriverExecutor, Mt as createExecutorRegistry, Ot as captureReusableExecutorConfig, Pa as awaitAbortable, Pi as authoredProfileDigest, Qn as observedModelMatchesDeclared, Ri as knownMaterializationReceipt, Sa as sleep, Ui as runtimeOwnedExecutorExecutionBinding, Ur as generateSpanId, Va as providerMessageText, Vr as createOtelExporter, Vt as InMemoryResultBlobStore, Wi as runtimeOwnedExecutorMaterialization, Xi as executableAgentProfileSnapshot, Yi as unknownMaterializationReceipt, aa as createSandboxUsageLedger, ar as sandboxClientAsProvider, ca as mapSandboxEvent, ea as projectSandboxOutcome, er as LEAF_CONTINUATION_TASK, ia as createSandboxToolPartState, jt as createExecutor, la as mapSandboxToolEvent, oi as harnessInvocation, or as unavailablePauseMs, qr as toOtelAttributes, r as createSupervisor, ra as canonicalStreamEventFromSandboxEvent, sa as isSandboxTerminalEvent, sr as unavailableSignalOfFailure, ta as readSandboxOutcome, za as promptFromAgentTurnInput } from "./supervisor-YAc4U8HQ.js";
2
2
  import { i as ConfigError, m as ValidationError, p as SessionMismatchError, r as BackendTransportError } from "./errors-DodWX-cb.js";
3
3
  import { a as concreteProfileModel, c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-BbSCSak0.js";
4
- import { C as canonicalCandidateDigest$1, D as immutableCandidateValue } from "./workspace-archive-C9lgf77y.js";
4
+ import { O as immutableCandidateValue, w as canonicalCandidateDigest$1 } from "./workspace-archive-MhowMCmp.js";
5
5
  import { agentProfileSchema, applyAgentProfileDiff, canonicalAgentProfileDigest, canonicalCandidateDigest, diffAgentProfiles, renderInputPartsAsText, sha256DigestSchema } from "@tangle-network/agent-interface";
6
6
  import { CostAccountingIncompleteError, CostCeilingReachedError, canonicalJson, costForTokenPricing, costForUsage, makeProposalFinding, scoreKnowledgeReadiness } from "@tangle-network/agent-eval";
7
7
  import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
@@ -4610,13 +4610,15 @@ function searchExecutor(options) {
4610
4610
  run: work.runId,
4611
4611
  lane: lane.name
4612
4612
  });
4613
- const measured = await options.runAttempt({
4613
+ const { recordCell, ...measured } = await options.runAttempt({
4614
4614
  work,
4615
4615
  lane,
4616
4616
  context,
4617
4617
  costLedger: attemptLedger(options.costLedger, lane, tags),
4618
4618
  span: trace.span
4619
4619
  });
4620
+ const traceRef = await trace.finish(measured);
4621
+ const execRunId = measured.traceRef && "execRunId" in measured.traceRef ? measured.traceRef.execRunId : null;
4620
4622
  result = {
4621
4623
  ...measured,
4622
4624
  accounting: attemptAccounting(options.costLedger, lane, tags),
@@ -4625,8 +4627,12 @@ function searchExecutor(options) {
4625
4627
  lane: lane.name,
4626
4628
  boxId: measured.placement?.boxId ?? null
4627
4629
  },
4628
- traceRef: await trace.finish(measured)
4630
+ traceRef: execRunId && "traceId" in traceRef ? {
4631
+ ...traceRef,
4632
+ execRunId
4633
+ } : traceRef
4629
4634
  };
4635
+ if (recordCell && result.outcome.status !== "errored") result.runRecord = await recordCell(result);
4630
4636
  } finally {
4631
4637
  hold.release(result);
4632
4638
  }
@@ -5099,7 +5105,7 @@ const SEARCH_METHOD_SOURCE = {
5099
5105
  })
5100
5106
  };
5101
5107
  async function runSearchImprovement(profile, opts) {
5102
- const { method, claim: inputClaim, agent, trainScenarios, selectionScenarios, testScenarios, judges: _judges, surface: _surface, executionRef: _executionRef, validateCandidate: _validateCandidate, findings: _findings, skills: _skills, profileComponents: _profileComponents, minimumLift: _minimumLift, subject: _subject, costCeiling, costLedger: inputCostLedger, seed = 42, signal, workerSlots, budgetPool, trace, ...campaignOptions } = opts;
5108
+ const { method, claim: inputClaim, agent, executionRunId, recordCell, trainScenarios, selectionScenarios, testScenarios, judges: _judges, surface: _surface, executionRef: _executionRef, validateCandidate: _validateCandidate, findings: _findings, skills: _skills, profileComponents: _profileComponents, minimumLift: _minimumLift, subject: _subject, costCeiling, costLedger: inputCostLedger, seed = 42, signal, workerSlots, budgetPool, trace, ...campaignOptions } = opts;
5103
5109
  if (!isImproveSearchMethod(method)) throw new ConfigError("improve(): a search needs method: searchMethod(...)");
5104
5110
  const claim = defineEvaluationClaim(inputClaim);
5105
5111
  if (claim.minimumEffect === void 0) throw new ConfigError("improve(): a search claim needs minimumEffect for its power check");
@@ -5284,7 +5290,17 @@ async function runSearchImprovement(profile, opts) {
5284
5290
  ...campaignOptions,
5285
5291
  ...lane.kind === "subscription" && campaignOptions.expectUsage === void 0 ? { expectUsage: "off" } : {},
5286
5292
  scenarios,
5287
- judges: prepared.judges,
5293
+ judges: prepared.judges.map((judge) => ({
5294
+ ...judge,
5295
+ async score(input) {
5296
+ try {
5297
+ return await judge.score(input);
5298
+ } catch (error) {
5299
+ if (isSearchEnvironmentFault(error)) fault = error;
5300
+ throw error;
5301
+ }
5302
+ }
5303
+ })),
5288
5304
  seed,
5289
5305
  reps,
5290
5306
  storage,
@@ -5313,10 +5329,28 @@ async function runSearchImprovement(profile, opts) {
5313
5329
  signal: work.signal
5314
5330
  })).cells[0];
5315
5331
  if (!cell) throw new Error(`improve(): cell ${work.cellId} produced no campaign cell`);
5316
- return faultResult(campaignCellSearchResult(cell, {
5332
+ const result = campaignCellSearchResult(cell, {
5317
5333
  execution,
5318
5334
  lane: lane.name
5319
- }), cell.errorStage === "dispatch" ? fault : void 0);
5335
+ });
5336
+ const execRunId = cell.error ? null : executionRunId?.(cell.artifact) ?? null;
5337
+ const settled = faultResult(execRunId && context.trace ? {
5338
+ ...result,
5339
+ traceRef: {
5340
+ traceId: context.trace.traceId,
5341
+ execRunId,
5342
+ spansWritten: null,
5343
+ spansDropped: null
5344
+ }
5345
+ } : result, fault);
5346
+ return recordCell && settled.outcome.status !== "errored" ? {
5347
+ ...settled,
5348
+ recordCell: (finalResult) => recordCell({
5349
+ cell,
5350
+ search: context,
5351
+ result: finalResult
5352
+ })
5353
+ } : settled;
5320
5354
  }
5321
5355
  });
5322
5356
  const { proposer } = method;
@@ -5603,4 +5637,4 @@ function refusalText(error) {
5603
5637
  //#endregion
5604
5638
  export { sampleThenRefine as $, parseRolloutPolicy as A, officialChecksFromMeta as B, privateValuePaths as C, ROLLOUT_POLICY_EXTENSION as D, isCodeSurface as E, composeCheckSources as F, visibleCheckScore as G, sandboxCheckRunner as H, defaultExtractCandidate as I, defineStrategy as J, adaptiveRefine as K, defaultStructuralRolloutPolicy as L, structuralRolloutPolicyFromProfile as M, canDisplace as N, applyRolloutPolicyToProfile as O, compareCheckOutcomes as P, sample as Q, filterAuthoredAsserts as R, parseExecutionRef as S, assertCandidateSurfaceKind as T, selectBestIndex as U, resolveEntrySymbol as V, structuralRollout as W, refine as X, depthStrategy as Y, runAgentic as Z, sharedBoxRefusal as _, startOrResumeRuntimeSession as _t, SearchEnvironmentFault as a, profileOptimizerModelCall as at, assertCandidateValidator as b, reconcileInterruptedSearchCalls as c, strategyAuthorMethod as ct, sharedBoxLane as d, createIterableBackend as dt, ObservationError as et, subscriptionLane as f, createSandboxPromptBackend as ft, sharedBoxPlacement as g, nowIso as gt, ROUTER_CLIENT_HEADER as h, newRuntimeSession as ht, searchMethod as i, profileChatClient as it, serializeRolloutPolicy as j, normalizeRolloutPolicy as k, routerLane as l, collectAgentTurn as lt, DEFAULT_SHARED_BOX_WORKERS as m, InMemoryRuntimeSessionStore as mt, runSearchImprovement as n, observe as nt, dedicatedLane as o, copyImproveCost as ot, DEFAULT_SHARED_BOX_RESOURCES as p, normalizeBackendStreamEvent as pt, breadthStrategy as q, runtimeShipDecision as r, renderReport as rt, isSearchEnvironmentFault as s, optimizerMethod as st, isImproveSearchMethod as t, defaultAnalystInstruction as tt, searchExecutor as u, streamAgentTurn as ut, sharedWorkerClientName as v, touchSession as vt, validateProfileCandidate as w, assertProfileTrainingIsHeldOut as x, prepareProfileImprovement as y, modelAuthoredChecks as z };
5605
5639
 
5606
- //# sourceMappingURL=search-method-CbUyhdz5.js.map
5640
+ //# sourceMappingURL=search-method-Dlor0kKQ.js.map