@tangle-network/agent-runtime 0.160.0 → 0.161.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{authoring-rIDPzwYY.js → authoring-DDRliHit.js} +2 -2
- package/dist/{authoring-rIDPzwYY.js.map → authoring-DDRliHit.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +1 -1
- package/dist/{graph-BN2fCNTN.js → graph-DWUz1caU.js} +36 -21
- package/dist/graph-DWUz1caU.js.map +1 -0
- package/dist/{index-BUoMn70Q.d.ts → index-5B7TlTSi.d.ts} +54 -6
- package/dist/{index-BpWTxm_M.d.ts → index-CT7Cmz66.d.ts} +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +4 -4
- package/dist/{knowledge-6LGnJFc7.js → knowledge-BBfx7pSo.js} +2 -2
- package/dist/{knowledge-6LGnJFc7.js.map → knowledge-BBfx7pSo.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-8lZGsvdz.js → loop-runner-bin-CjRjwtal.js} +2 -2
- package/dist/{loop-runner-bin-8lZGsvdz.js.map → loop-runner-bin-CjRjwtal.js.map} +1 -1
- package/dist/{loop-runner-bin-DxrZ1wr8.d.ts → loop-runner-bin-DRX6EDIy.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 +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +3 -3
- package/dist/{openai-tools-D1VQ5e9p.js → openai-tools-CLb9RqXL.js} +2 -2
- package/dist/{openai-tools-D1VQ5e9p.js.map → openai-tools-CLb9RqXL.js.map} +1 -1
- package/dist/{runtime-Ccotdixu.js → runtime-CyVJSWzN.js} +4 -4
- package/dist/{runtime-Ccotdixu.js.map → runtime-CyVJSWzN.js.map} +1 -1
- package/dist/{supervise-CqwjiXlX.js → supervise-DE-GFNKg.js} +22 -8
- package/dist/supervise-DE-GFNKg.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +10 -10
- package/package.json +1 -1
- package/dist/graph-BN2fCNTN.js.map +0 -1
- package/dist/supervise-CqwjiXlX.js.map +0 -1
|
@@ -1222,7 +1222,8 @@ function createCoordinationTools(opts) {
|
|
|
1222
1222
|
const task = detachedFrozen(a.task);
|
|
1223
1223
|
const label = typeof a.label === "string" ? a.label : "worker";
|
|
1224
1224
|
if (opts.preflightSpawn) {
|
|
1225
|
-
const
|
|
1225
|
+
const preflightProfile = opts.resolveSpawnProfile ? detachedFrozen(opts.resolveSpawnProfile(profile)) : profile;
|
|
1226
|
+
const refusal = await opts.preflightSpawn(preflightProfile, {
|
|
1226
1227
|
label,
|
|
1227
1228
|
...key !== void 0 ? { key } : {},
|
|
1228
1229
|
task
|
|
@@ -3132,6 +3133,7 @@ function driverAgent(opts) {
|
|
|
3132
3133
|
...opts.stallAfterMs !== void 0 ? { stallAfterMs: opts.stallAfterMs } : {},
|
|
3133
3134
|
...opts.continuityByProfile ? { continuityByProfile: opts.continuityByProfile } : {},
|
|
3134
3135
|
...opts.preflightSpawn ? { preflightSpawn: opts.preflightSpawn } : {},
|
|
3136
|
+
...opts.resolveSpawnProfile ? { resolveSpawnProfile: opts.resolveSpawnProfile } : {},
|
|
3135
3137
|
...opts.onEvent ? { onEvent: opts.onEvent } : {},
|
|
3136
3138
|
...opts.replaySettlements ? { replaySettlements: true } : {},
|
|
3137
3139
|
...opts.priorCoordination?.questions.length ? { priorQuestions: opts.priorCoordination.questions } : {}
|
|
@@ -5193,6 +5195,7 @@ async function serveCoordinationMcp(opts) {
|
|
|
5193
5195
|
...opts.questionPolicy ? { questionPolicy: opts.questionPolicy } : {},
|
|
5194
5196
|
...opts.priorQuestions?.length ? { priorQuestions: opts.priorQuestions } : {},
|
|
5195
5197
|
...opts.preflightSpawn ? { preflightSpawn: opts.preflightSpawn } : {},
|
|
5198
|
+
...opts.resolveSpawnProfile ? { resolveSpawnProfile: opts.resolveSpawnProfile } : {},
|
|
5196
5199
|
...opts.peerMail ? { peerMail: typeof opts.peerMail === "object" && opts.peerMail.limits ? { limits: opts.peerMail.limits } : {} } : {}
|
|
5197
5200
|
});
|
|
5198
5201
|
await coord.ready();
|
|
@@ -5874,6 +5877,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
5874
5877
|
...deps.stallAfterMs !== void 0 ? { stallAfterMs: deps.stallAfterMs } : {},
|
|
5875
5878
|
...deps.continuityByProfile ? { continuityByProfile: deps.continuityByProfile } : {},
|
|
5876
5879
|
...deps.preflightSpawn ? { preflightSpawn: deps.preflightSpawn } : {},
|
|
5880
|
+
...deps.resolveSpawnProfile ? { resolveSpawnProfile: deps.resolveSpawnProfile } : {},
|
|
5877
5881
|
...deps.stopRule ? { stopRule: deps.stopRule } : {},
|
|
5878
5882
|
...deps.onProgressStop ? { onProgressStop: deps.onProgressStop } : {},
|
|
5879
5883
|
...deps.maxTurns !== void 0 ? { maxTurns: deps.maxTurns } : {},
|
|
@@ -5955,6 +5959,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
5955
5959
|
...onEvent ? { onEvent } : {},
|
|
5956
5960
|
...deps.replaySettlements ? { replaySettlements: true } : {},
|
|
5957
5961
|
...deps.preflightSpawn ? { preflightSpawn: deps.preflightSpawn } : {},
|
|
5962
|
+
...deps.resolveSpawnProfile ? { resolveSpawnProfile: deps.resolveSpawnProfile } : {},
|
|
5958
5963
|
...deps.peerMail ? { peerMail: deps.peerMail } : {},
|
|
5959
5964
|
...priorCoordination?.questions.length ? { priorQuestions: priorCoordination.questions } : {},
|
|
5960
5965
|
...nodeTools?.length ? { nodeTools } : {},
|
|
@@ -6623,7 +6628,7 @@ function captureDeliverable(deliverable, context) {
|
|
|
6623
6628
|
* Service internals intentionally remain live, while replacing a callback/service on the caller's
|
|
6624
6629
|
* mutable options object can no longer change an in-flight run. */
|
|
6625
6630
|
function captureSuperviseOptions(opts) {
|
|
6626
|
-
const { backend, driverBackend, deliverable, resolveDeliverable, router, compaction, watchWorkers, analysts, makeWorkerAgent, blobs, journal, probes, registry, hooks, otel, authorizeSpawn, authorizeMessage, isDriverProfile, driveHarness, resolveDriveHarness, resolveSupervisorTools, onCoordinationEvent, executeExtraTool, stopRule, onProgressStop, onDriverAttempt, finalizer, now, signal, rootHandle, ...decisionData } = opts;
|
|
6631
|
+
const { backend, driverBackend, deliverable, resolveDeliverable, router, compaction, watchWorkers, analysts, makeWorkerAgent, makeLeafAgent, resolveSpawnProfile, blobs, journal, probes, registry, hooks, otel, authorizeSpawn, authorizeMessage, isDriverProfile, driveHarness, resolveDriveHarness, resolveSupervisorTools, onCoordinationEvent, executeExtraTool, stopRule, onProgressStop, onDriverAttempt, finalizer, now, signal, rootHandle, ...decisionData } = opts;
|
|
6627
6632
|
const capturedData = detachedSnapshot(decisionData, "supervise options");
|
|
6628
6633
|
const capturedBackend = backend === void 0 ? void 0 : snapshotExecutorConfig(backend);
|
|
6629
6634
|
const capturedDriverBackend = driverBackend === void 0 ? void 0 : snapshotExecutorConfig(driverBackend);
|
|
@@ -6663,6 +6668,8 @@ function captureSuperviseOptions(opts) {
|
|
|
6663
6668
|
...capturedWatchWorkers === void 0 ? {} : { watchWorkers: capturedWatchWorkers },
|
|
6664
6669
|
...capturedAnalysts === void 0 ? {} : { analysts: capturedAnalysts },
|
|
6665
6670
|
...makeWorkerAgent === void 0 ? {} : { makeWorkerAgent },
|
|
6671
|
+
...makeLeafAgent === void 0 ? {} : { makeLeafAgent },
|
|
6672
|
+
...resolveSpawnProfile === void 0 ? {} : { resolveSpawnProfile },
|
|
6666
6673
|
...blobs === void 0 ? {} : { blobs },
|
|
6667
6674
|
...journal === void 0 ? {} : { journal },
|
|
6668
6675
|
...probes === void 0 ? {} : { probes },
|
|
@@ -6847,7 +6854,8 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
6847
6854
|
const canonicalProfile = freezeDetachedProfile(parsedProfile.data);
|
|
6848
6855
|
assertExecutableAgentProfile(canonicalProfile, "supervise root");
|
|
6849
6856
|
const canonicalTask = freezeDetached(task);
|
|
6850
|
-
if (options.makeWorkerAgent && options.authorizeSpawn) throw new ValidationError("supervise: authorizeSpawn cannot be combined with caller-owned makeWorkerAgent;
|
|
6857
|
+
if (options.makeWorkerAgent && options.authorizeSpawn) throw new ValidationError("supervise: authorizeSpawn cannot be combined with caller-owned makeWorkerAgent; use makeLeafAgent to override leaf execution inside the authorized path, or use backend-derived workers");
|
|
6858
|
+
if (options.makeWorkerAgent && options.makeLeafAgent) throw new ValidationError("supervise: makeWorkerAgent replaces the worker path and makeLeafAgent overrides a leaf inside it; pass one");
|
|
6851
6859
|
if (options.makeWorkerAgent && options.resolveDeliverable) throw new ValidationError("supervise: resolveDeliverable applies only to backend-derived workers; wrap a caller-owned makeWorkerAgent with its completion checks explicitly");
|
|
6852
6860
|
const authorizeDownFor = (parent, depth) => {
|
|
6853
6861
|
if (!options.authorizeSpawn && !options.authorizeMessage) return void 0;
|
|
@@ -6885,7 +6893,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
6885
6893
|
const observeNodeEvent = options.onCoordinationEvent ? async (context, event, record) => {
|
|
6886
6894
|
await options.onCoordinationEvent?.(context, coordinationEventId(context, event), record);
|
|
6887
6895
|
} : void 0;
|
|
6888
|
-
const managerBackend = options.driverBackend ?? options.backend;
|
|
6896
|
+
const managerBackend = options.driverBackend ?? (options.rootDriverFromBackend === false ? void 0 : options.backend);
|
|
6889
6897
|
const spawnPreflight = options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0;
|
|
6890
6898
|
if (options.driveHarness && options.resolveDriveHarness) throw new ValidationError("supervise: provide driveHarness or resolveDriveHarness, not both");
|
|
6891
6899
|
const driverMaterialization = Boolean(options.driveHarness || options.resolveDriveHarness) ? options.driveHarnessMaterialization ?? fullProfileMaterialization : managerBackend && automaticDriverBackendSupported(managerBackend) ? backendProfileMaterialization(managerBackend) : void 0;
|
|
@@ -6933,8 +6941,8 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
6933
6941
|
const traceUnpropagated = options.backend ? workerTraceUnpropagatedDeclaration(options.backend.backend) : void 0;
|
|
6934
6942
|
let makeWorkerAgent = options.makeWorkerAgent;
|
|
6935
6943
|
if (!makeWorkerAgent) {
|
|
6936
|
-
if (!options.backend) throw new ValidationError("supervise: provide opts.backend (where workers run) or opts.makeWorkerAgent");
|
|
6937
|
-
const makeLeaf = workerFromBackend(options.backend, deliverable);
|
|
6944
|
+
if (!options.backend && !options.makeLeafAgent) throw new ValidationError("supervise: provide opts.backend (where workers run), opts.makeLeafAgent, or opts.makeWorkerAgent");
|
|
6945
|
+
const makeLeaf = options.makeLeafAgent ?? workerFromBackend(options.backend, deliverable);
|
|
6938
6946
|
const securityPolicy = options.profileSecurity ?? DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY;
|
|
6939
6947
|
const makeRecursiveWorkerFor = (parent, parentIdentity, depth, parentOwnerId) => {
|
|
6940
6948
|
const makeRecursiveWorker = (authoredProfile, spawnContext) => {
|
|
@@ -6950,7 +6958,9 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
6950
6958
|
budget: spawnContext.budget,
|
|
6951
6959
|
label: spawnContext.label,
|
|
6952
6960
|
...spawnContext.key !== void 0 ? { key: spawnContext.key } : {},
|
|
6953
|
-
depth
|
|
6961
|
+
depth,
|
|
6962
|
+
...spawnContext.analyst !== void 0 ? { analyst: spawnContext.analyst } : {},
|
|
6963
|
+
...spawnContext.continuity !== void 0 ? { continuity: spawnContext.continuity } : {}
|
|
6954
6964
|
});
|
|
6955
6965
|
const decision = options.authorizeSpawn ? freezeDetached(options.authorizeSpawn(authorizationInput)) : Object.freeze({
|
|
6956
6966
|
profile: input,
|
|
@@ -6988,6 +6998,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
6988
6998
|
if (!isDriver) {
|
|
6989
6999
|
const selectedDeliverable = options.resolveDeliverable?.(postAuthorizationContext);
|
|
6990
7000
|
const leafDeliverable = selectedDeliverable === void 0 ? deliverable : captureDeliverable(selectedDeliverable, `supervise deliverable for ${JSON.stringify(spawnContext.label)}`);
|
|
7001
|
+
if (leafDeliverable !== deliverable && !options.backend) throw new ValidationError("supervise: resolveDeliverable selected a per-spawn deliverable but there is no backend to derive that leaf from; makeLeafAgent owns its own completion check");
|
|
6991
7002
|
return (leafDeliverable === deliverable ? makeLeaf : workerFromBackend(options.backend, leafDeliverable))(authorized, Object.freeze({
|
|
6992
7003
|
...authorizedContext,
|
|
6993
7004
|
assignmentId: workerAssignmentNamespace(runNamespace, parentOwnerId, spawnContext.assignmentId)
|
|
@@ -7036,6 +7047,8 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
7036
7047
|
...options.stallAfterMs !== void 0 ? { stallAfterMs: options.stallAfterMs } : {},
|
|
7037
7048
|
...options.continuityByProfile ? { continuityByProfile: options.continuityByProfile } : {},
|
|
7038
7049
|
...spawnPreflight ? { preflightSpawn: spawnPreflight } : {},
|
|
7050
|
+
...options.resolveSpawnProfile ? { resolveSpawnProfile: options.resolveSpawnProfile } : {},
|
|
7051
|
+
...options.resolveSpawnProfile ? { resolveSpawnProfile: options.resolveSpawnProfile } : {},
|
|
7039
7052
|
...options.peerMail ? { peerMail: options.peerMail } : {},
|
|
7040
7053
|
...options.stopRule ? { stopRule: options.stopRule } : {},
|
|
7041
7054
|
...options.onProgressStop ? { onProgressStop: options.onProgressStop } : {},
|
|
@@ -7077,6 +7090,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
7077
7090
|
...finalizer ? { finalizer } : {},
|
|
7078
7091
|
...options.coordination ? { coordination: options.coordination } : {},
|
|
7079
7092
|
...spawnPreflight ? { preflightSpawn: spawnPreflight } : {},
|
|
7093
|
+
...options.resolveSpawnProfile ? { resolveSpawnProfile: options.resolveSpawnProfile } : {},
|
|
7080
7094
|
...options.peerMail ? { peerMail: options.peerMail } : {},
|
|
7081
7095
|
...options.maxLiveWorkers !== void 0 ? { maxLiveWorkers: options.maxLiveWorkers } : {},
|
|
7082
7096
|
...options.router ? { router: options.router } : {},
|
|
@@ -7189,4 +7203,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
|
|
|
7189
7203
|
//#endregion
|
|
7190
7204
|
export { hashIdempotencyInput as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, gateOnDeliverable as At, DELEGATE_FEEDBACK_DESCRIPTION as B, createMcpServer as C, bestSoFar as Ct, createDelegationStatusHandler as D, createInMemoryRunContext as Dt, DELEGATION_STATUS_TOOL_NAME as E, createFileRunContext as Et, DELEGATE_UI_AUDIT_DESCRIPTION as F, normalizeAnalyzeOnSettle as Ft, DELEGATE_DESCRIPTION as G, DELEGATE_FEEDBACK_TOOL_NAME as H, DELEGATE_UI_AUDIT_INPUT_SCHEMA as I, questionEscalationTargets as It, createDelegateHandler as J, DELEGATE_INPUT_SCHEMA as K, DELEGATE_UI_AUDIT_TOOL_NAME as L, createEventBus as Lt, createDelegationHistoryHandler as M, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as Mt, validateDelegationHistoryArgs as N, canonicalFindingEvent as Nt, validateDelegationStatusArgs as O, FileCoordinationLog as Ot, delegationProfiles as P, createCoordinationTools as Pt, DelegationTaskQueue as Q, createDelegateUiAuditHandler as R, defaultToolDetectors as Rt, createInProcessTransport as S, areaUnderCurve as St, DELEGATION_STATUS_INPUT_SCHEMA as T, renderAnytimeTable as Tt, createDelegateFeedbackHandler as U, DELEGATE_FEEDBACK_INPUT_SCHEMA as V, validateDelegateFeedbackArgs as W, defaultDelegateBudget as X, validateDelegateArgs as Y, delegate as Z, promptHandle as _, createProgressTracker as _t, assertCoordinationBinding as a, createDelegationTraceCollector as at, classifyDriverFailure as b, sampleFromSettled as bt, supervisorAgentWithTestBrain as c, FileDelegationStore as ct, delegatesWorkerBriefPrompt as d, eventToSnapshot as dt, DELEGATION_TRACE_MAX_BYTES as et, dumbContinuationFailPrompt as f, driverAgent as ft, naiveContinuationPrompt as g, anyOf as gt, kernelPromptRegistry as h, allWorkersStalled as ht, workerFromBackend as i, composeLoopTraceEmitters as it, DELEGATION_HISTORY_TOOL_NAME as j, mapExecutorResult as jt, DELEGATION_HISTORY_DESCRIPTION as k, createSupervisorSpanRecorder as kt, analyzesFindingsReportPrompt as l, InMemoryDelegationStore as lt, formatPromptHandle as m, allOf as mt, supervise as n, buildDelegationTraceSpans as nt, resolveSupervisorProfile as o, DelegationPersistenceError as ot, dumbContinuationPassPrompt as p, finalizeBestDelivered as pt, DELEGATE_TOOL_NAME as q, superviseWithTestBrain as r, capDelegationTrace as rt, supervisorAgent as s, DelegationStateCorruptError as st, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, DELEGATION_TRACE_MAX_SPANS as tt, createPromptRegistry as u, InMemoryFeedbackStore as ut, supervisorPolicyPrompt as v, noProgressFor as vt, DELEGATION_STATUS_DESCRIPTION as w, plateauLength as wt, serveCoordinationMcp as x, anytimeReport as xt, DriverAttemptsExhaustedError as y, plateau as yt, validateDelegateUiAuditArgs as z, watchTrace as zt };
|
|
7191
7205
|
|
|
7192
|
-
//# sourceMappingURL=supervise-
|
|
7206
|
+
//# sourceMappingURL=supervise-DE-GFNKg.js.map
|