@tangle-network/agent-runtime 9.0.3 → 9.0.6
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/CHANGELOG.md +24 -0
- package/dist/{activation-BrBDs0Yj.js → activation-BA4WLqwN.js} +2 -2
- package/dist/{activation-BrBDs0Yj.js.map → activation-BA4WLqwN.js.map} +1 -1
- package/dist/{activation-CoVktVKr.d.ts → activation-OSYxeVWi.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{coordination-manager-DKmQGzBB.js → coordination-manager-CawAzVwE.js} +68 -38
- package/dist/coordination-manager-CawAzVwE.js.map +1 -0
- package/dist/{delegate-CHGMIC6s.js → delegate-B-uEepRq.js} +2 -2
- package/dist/{delegate-CHGMIC6s.js.map → delegate-B-uEepRq.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +9 -9
- package/dist/{failure-cause-CVB-YE88.js → failure-cause-W0o778qO.js} +12 -3
- package/dist/failure-cause-W0o778qO.js.map +1 -0
- package/dist/{graph-rY9OQUa_.js → graph-C8S9Qyqo.js} +6 -6
- package/dist/{graph-rY9OQUa_.js.map → graph-C8S9Qyqo.js.map} +1 -1
- package/dist/{improve-CnTEGkF6.js → improve-CKQwcCz1.js} +6 -6
- package/dist/{improve-CnTEGkF6.js.map → improve-CKQwcCz1.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +13 -13
- package/dist/{loop-runner-BpnJwopI.js → loop-runner-BF2Rmc90.js} +2 -2
- package/dist/{loop-runner-BpnJwopI.js.map → loop-runner-BF2Rmc90.js.map} +1 -1
- package/dist/{loop-runner-DZeXWH78.d.ts → loop-runner-CCdQ1pmE.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 +6 -6
- package/dist/mcp/memory-bin.js +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-B-ULubUf.js → provision-supervisor-Cm6RLHuw.js} +5 -5
- package/dist/{provision-supervisor-B-ULubUf.js.map → provision-supervisor-Cm6RLHuw.js.map} +1 -1
- package/dist/{run-cancellation-DZn4OSl8.js → run-cancellation-B4-1Rt4u.js} +2 -2
- package/dist/{run-cancellation-DZn4OSl8.js.map → run-cancellation-B4-1Rt4u.js.map} +1 -1
- package/dist/{run-state-nbF5NNGy.js → run-state-D1LkVTBQ.js} +5 -5
- package/dist/{run-state-nbF5NNGy.js.map → run-state-D1LkVTBQ.js.map} +1 -1
- package/dist/{runtime-CRbF3eyC.js → runtime-BxfLCey9.js} +13 -13
- package/dist/{runtime-CRbF3eyC.js.map → runtime-BxfLCey9.js.map} +1 -1
- package/dist/{search-executor-2xqDTDNO.js → search-executor-D8TxXXSY.js} +4 -4
- package/dist/{search-executor-2xqDTDNO.js.map → search-executor-D8TxXXSY.js.map} +1 -1
- package/dist/{server-D3RV-84X.js → server-DABPxHO9.js} +4 -4
- package/dist/{server-D3RV-84X.js.map → server-DABPxHO9.js.map} +1 -1
- package/dist/{settle-record-B95oiypS.js → settle-record-BmXd-_3O.js} +2 -2
- package/dist/{settle-record-B95oiypS.js.map → settle-record-BmXd-_3O.js.map} +1 -1
- package/dist/{structural-rollout-BHNqBUV0.js → structural-rollout-DXymZ3go.js} +4 -4
- package/dist/{structural-rollout-BHNqBUV0.js.map → structural-rollout-DXymZ3go.js.map} +1 -1
- package/dist/{supervise-CULDLjjS.js → supervise-BAXUJgwd.js} +35 -11
- package/dist/supervise-BAXUJgwd.js.map +1 -0
- package/dist/{supervision-discovery-DUpm_6nQ.js → supervision-discovery-DzYBmrJC.js} +3 -3
- package/dist/{supervision-discovery-DUpm_6nQ.js.map → supervision-discovery-DzYBmrJC.js.map} +1 -1
- package/dist/{supervisor-BhcXPxAk.js → supervisor-Cnn37lon.js} +80 -20
- package/dist/supervisor-Cnn37lon.js.map +1 -0
- package/dist/{supervisor-accounting-BB22j3hu.js → supervisor-accounting-BMrdsYxz.js} +65 -80
- package/dist/supervisor-accounting-BMrdsYxz.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{tool-server-DYwRbi0I.js → tool-server-Df-Uy99W.js} +2 -2
- package/dist/{tool-server-DYwRbi0I.js.map → tool-server-Df-Uy99W.js.map} +1 -1
- package/dist/{top-web-DsFGyUlS.js → top-web-Qk6x-A9O.js} +6 -6
- package/dist/{top-web-DsFGyUlS.js.map → top-web-Qk6x-A9O.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-CTp7j9jD.d.ts → types-KQkbyDmn.d.ts} +58 -6
- package/package.json +3 -3
- package/skills/profile-authoring/SKILL.md +57 -120
- package/skills/profile-authoring/references/acceptance-examples.md +15 -10
- package/skills/profile-authoring/references/execution-and-credentials.md +2 -7
- package/skills/profile-authoring/references/profile-contract.md +59 -0
- package/skills/profile-authoring/references/research-directors.md +1 -5
- package/dist/coordination-manager-DKmQGzBB.js.map +0 -1
- package/dist/failure-cause-CVB-YE88.js.map +0 -1
- package/dist/supervise-CULDLjjS.js.map +0 -1
- package/dist/supervisor-BhcXPxAk.js.map +0 -1
- package/dist/supervisor-accounting-BB22j3hu.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { E as writeWorkerCancellation, F as parseWorkerToolTraceArtifact, I as workerTraceAnalysisStore, K as spawnJournalRecordEvents, O as writeWorkerSteerAcknowledgement, Rt as runtimeGraphMetadataKey, S as workerCancelRequestsFile, St as resolveSpawnResourcePaths, T as workerSteerRequestsDir, W as FileSpawnJournal, _ as readWorkerSteerAcknowledgement, an as FileResultBlobStore, d as claimWorkerSteerDelivery,
|
|
1
|
+
import { E as writeWorkerCancellation, F as parseWorkerToolTraceArtifact, I as workerTraceAnalysisStore, K as spawnJournalRecordEvents, O as writeWorkerSteerAcknowledgement, Rt as runtimeGraphMetadataKey, S as workerCancelRequestsFile, St as resolveSpawnResourcePaths, T as workerSteerRequestsDir, W as FileSpawnJournal, _ as readWorkerSteerAcknowledgement, an as FileResultBlobStore, d as claimWorkerSteerDelivery, g as readWorkerCancellation, h as readWorkerCancelRequests, it as meterRuntimeOwnedAccounting, mr as isTerminalNodeStatus, pr as isLiveNodeStatus, v as readWorkerSteerRequests } from "./supervisor-accounting-BMrdsYxz.js";
|
|
2
2
|
import { m as ValidationError } from "./errors-DG8yufqX.js";
|
|
3
|
-
import {
|
|
3
|
+
import { N as contentAddress, o as settlementFailureCause, tt as assertValidBudget } from "./failure-cause-W0o778qO.js";
|
|
4
4
|
import { a as errMessage, f as resolveRedactor, t as detachedFrozen } from "./snapshot-BKI_w3JD.js";
|
|
5
|
-
import { X as INBOX_RECEIPT_KEY, _t as CheckUnavailableError, b as InMemorySpawnJournal, rt as createPeerMailbox, v as withDriverExecutor, x as createExecutorRegistry, y as InMemoryResultBlobStore } from "./supervisor-
|
|
5
|
+
import { X as INBOX_RECEIPT_KEY, _t as CheckUnavailableError, b as InMemorySpawnJournal, rt as createPeerMailbox, v as withDriverExecutor, x as createExecutorRegistry, y as InMemoryResultBlobStore } from "./supervisor-Cnn37lon.js";
|
|
6
6
|
import { i as checkVerdictOf, o as failedItems } from "./continuation-DDPfLw2w.js";
|
|
7
|
-
import { c as writeRunCancellation, i as readRunCancellation, r as readRunCancelRequest, t as applyRunCancellation, v as FileCoordinationLog } from "./run-cancellation-
|
|
7
|
+
import { c as writeRunCancellation, i as readRunCancellation, r as readRunCancelRequest, t as applyRunCancellation, v as FileCoordinationLog } from "./run-cancellation-B4-1Rt4u.js";
|
|
8
8
|
import { a as admitRuntimeSpawn, i as workerSettlement, n as resolveJsonPointer, o as safeJsonText, r as textBytes, t as createMapRouting } from "./coordination-map-routing-XZXTlCmn.js";
|
|
9
9
|
import { ResourceRequestSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest } from "@tangle-network/agent-interface";
|
|
10
10
|
import { argHash, errorStreakDetector, observeAll, repeatedActionDetector } from "@tangle-network/agent-eval";
|
|
@@ -546,8 +546,33 @@ function descendantsSince(tail, nodeId, sinceIso) {
|
|
|
546
546
|
function createSteerAcknowledger(deps) {
|
|
547
547
|
const iso = () => new Date(deps.now()).toISOString();
|
|
548
548
|
const awaiting = /* @__PURE__ */ new Map();
|
|
549
|
+
const named = /* @__PURE__ */ new Map();
|
|
550
|
+
const paused = () => {
|
|
551
|
+
const pause = deps.rootPause?.();
|
|
552
|
+
if (pause === void 0) return { why: "" };
|
|
553
|
+
const left = pause.tokensLeft === void 0 ? "" : ` with ${pause.tokensLeft} tokens left`;
|
|
554
|
+
return {
|
|
555
|
+
pausedOn: pause,
|
|
556
|
+
why: `; the root is paused on ${pause.stop}${left}`
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
const queuedRoot = (request) => {
|
|
560
|
+
const { pausedOn, why } = paused();
|
|
561
|
+
const key = pausedOn?.stop ?? "";
|
|
562
|
+
if (named.get(request.operationId) === key) return;
|
|
563
|
+
named.set(request.operationId, key);
|
|
564
|
+
writeWorkerSteerAcknowledgement(deps.dir, {
|
|
565
|
+
...base(request),
|
|
566
|
+
effect: "unknown",
|
|
567
|
+
observedAt: iso(),
|
|
568
|
+
detail: `queued in the root inbox; no root turn has consumed it yet${why}`,
|
|
569
|
+
...pausedOn === void 0 ? {} : { pausedOn }
|
|
570
|
+
});
|
|
571
|
+
};
|
|
549
572
|
const answerRoot = (request, receipt) => {
|
|
550
573
|
if (!awaiting.delete(request.operationId)) return;
|
|
574
|
+
named.delete(request.operationId);
|
|
575
|
+
const { pausedOn, why } = receipt.status === "consumed" ? { why: "" } : paused();
|
|
551
576
|
writeWorkerSteerAcknowledgement(deps.dir, {
|
|
552
577
|
...base(request),
|
|
553
578
|
...receipt.status === "consumed" ? {
|
|
@@ -555,9 +580,10 @@ function createSteerAcknowledger(deps) {
|
|
|
555
580
|
detail: `the root consumed the steer in ${receipt.attemptId}`
|
|
556
581
|
} : {
|
|
557
582
|
effect: "not_live",
|
|
558
|
-
detail: `the root did not consume the steer: ${receipt.reason}`
|
|
583
|
+
detail: `the root did not consume the steer: ${receipt.reason}${why}`
|
|
559
584
|
},
|
|
560
|
-
observedAt: iso()
|
|
585
|
+
observedAt: iso(),
|
|
586
|
+
...pausedOn === void 0 ? {} : { pausedOn }
|
|
561
587
|
});
|
|
562
588
|
};
|
|
563
589
|
const base = (request) => ({
|
|
@@ -582,9 +608,9 @@ function createSteerAcknowledger(deps) {
|
|
|
582
608
|
return changed;
|
|
583
609
|
};
|
|
584
610
|
return { async pass(phase) {
|
|
611
|
+
if (phase === "turn") for (const request of awaiting.values()) queuedRoot(request);
|
|
585
612
|
const changed = steerChanged(phase);
|
|
586
613
|
if (phase !== "final" && !changed && steerIdle) return;
|
|
587
|
-
let waiting = false;
|
|
588
614
|
for (const request of readWorkerSteerRequests(deps.dir)) {
|
|
589
615
|
if (phase !== "final" && deps.signal?.aborted) {
|
|
590
616
|
steerIdle = false;
|
|
@@ -613,10 +639,6 @@ function createSteerAcknowledger(deps) {
|
|
|
613
639
|
});
|
|
614
640
|
continue;
|
|
615
641
|
}
|
|
616
|
-
if (rootRequest && deps.deliverRootReady !== void 0 && !deps.deliverRootReady()) {
|
|
617
|
-
waiting = true;
|
|
618
|
-
continue;
|
|
619
|
-
}
|
|
620
642
|
if (!claimWorkerSteerDelivery(deps.dir, {
|
|
621
643
|
...base(request),
|
|
622
644
|
effect: "unknown",
|
|
@@ -640,12 +662,7 @@ function createSteerAcknowledger(deps) {
|
|
|
640
662
|
};
|
|
641
663
|
} else outcome = await deps.coord.steerWorker(request.worker, request.message, { interrupt: request.interrupt });
|
|
642
664
|
if (rootRequest && outcome.delivered) {
|
|
643
|
-
if (awaiting.has(request.operationId))
|
|
644
|
-
...base(request),
|
|
645
|
-
effect: "unknown",
|
|
646
|
-
observedAt: iso(),
|
|
647
|
-
detail: "queued in the root inbox; no root turn has consumed it yet"
|
|
648
|
-
});
|
|
665
|
+
if (awaiting.has(request.operationId)) queuedRoot(request);
|
|
649
666
|
continue;
|
|
650
667
|
}
|
|
651
668
|
const effect = outcome.delivered ? "delivered" : outcome.outcome === "runtime-has-no-inbox" ? "unsupported" : outcome.outcome === "unknown-worker" || outcome.outcome === "already-settled" || outcome.outcome === "scope-stopped" ? "not_live" : "unknown";
|
|
@@ -665,7 +682,7 @@ function createSteerAcknowledger(deps) {
|
|
|
665
682
|
});
|
|
666
683
|
}
|
|
667
684
|
}
|
|
668
|
-
if (phase === "turn") steerIdle =
|
|
685
|
+
if (phase === "turn") steerIdle = true;
|
|
669
686
|
} };
|
|
670
687
|
}
|
|
671
688
|
function steerAcknowledgementDetail(outcome) {
|
|
@@ -1997,7 +2014,8 @@ function createJournalReader({ opts, bus, readSteer }) {
|
|
|
1997
2014
|
}
|
|
1998
2015
|
entries.push(row);
|
|
1999
2016
|
usedBytes += bytes;
|
|
2000
|
-
|
|
2017
|
+
const shown = row.event?.redactionFailed === void 0;
|
|
2018
|
+
if (trackOwnRead && !candidate.prior && record.event.type === "lead-message" && shown) readSteer(record.seq);
|
|
2001
2019
|
}
|
|
2002
2020
|
const last = entries[entries.length - 1];
|
|
2003
2021
|
const nextRow = last === void 0 ? sinceRow : last.row + 1;
|
|
@@ -2271,23 +2289,29 @@ function appendCheckRead(state, read) {
|
|
|
2271
2289
|
state.checkReads.push(entry);
|
|
2272
2290
|
return entry;
|
|
2273
2291
|
}
|
|
2292
|
+
/** Tell a lead message's sender its manager read it, once: in a wake or in its own journal read. */
|
|
2293
|
+
function answerLeadReceipt({ opts, state, leadReceipts }, delivery) {
|
|
2294
|
+
const event = delivery.record.event;
|
|
2295
|
+
const messageId = event.type === "lead-message" ? event.message.messageId : void 0;
|
|
2296
|
+
const receipt = messageId === void 0 ? void 0 : leadReceipts.get(messageId);
|
|
2297
|
+
if (messageId === void 0 || receipt === void 0) return;
|
|
2298
|
+
leadReceipts.delete(messageId);
|
|
2299
|
+
try {
|
|
2300
|
+
receipt({
|
|
2301
|
+
status: "consumed",
|
|
2302
|
+
messageId,
|
|
2303
|
+
attemptId: `${opts.scope.view.root}#attempt-${delivery.attempt ?? state.driverAttempt ?? 1}`
|
|
2304
|
+
});
|
|
2305
|
+
} catch {}
|
|
2306
|
+
}
|
|
2274
2307
|
async function acknowledgeDeliveries({ opts, bus, state, leadReceipts }, targets, by) {
|
|
2275
2308
|
const fresh = targets.filter((delivery) => !delivery.acknowledged);
|
|
2276
2309
|
if (fresh.length === 0) return [];
|
|
2277
|
-
for (const delivery of fresh) {
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
leadReceipts.delete(messageId);
|
|
2283
|
-
try {
|
|
2284
|
-
receipt({
|
|
2285
|
-
status: "consumed",
|
|
2286
|
-
messageId,
|
|
2287
|
-
attemptId: `${opts.scope.view.root}#attempt-${delivery.attempt ?? state.driverAttempt ?? 1}`
|
|
2288
|
-
});
|
|
2289
|
-
} catch {}
|
|
2290
|
-
}
|
|
2310
|
+
for (const delivery of fresh) answerLeadReceipt({
|
|
2311
|
+
opts,
|
|
2312
|
+
state,
|
|
2313
|
+
leadReceipts
|
|
2314
|
+
}, delivery);
|
|
2291
2315
|
const seqs = fresh.map((delivery) => delivery.record.seq);
|
|
2292
2316
|
await bus.publish({
|
|
2293
2317
|
type: "acknowledgement",
|
|
@@ -4834,12 +4858,18 @@ function createCoordinationToolsForManager(opts, lifetime) {
|
|
|
4834
4858
|
bus,
|
|
4835
4859
|
readSteer: (seq) => {
|
|
4836
4860
|
const record = bus.take?.(seq);
|
|
4837
|
-
|
|
4838
|
-
|
|
4861
|
+
if (record === void 0) return;
|
|
4862
|
+
const delivery = {
|
|
4839
4863
|
record,
|
|
4840
|
-
attempt,
|
|
4864
|
+
attempt: state.driverAttempt,
|
|
4841
4865
|
acknowledged: false
|
|
4842
|
-
}
|
|
4866
|
+
};
|
|
4867
|
+
state.deliveries.push(delivery);
|
|
4868
|
+
answerLeadReceipt({
|
|
4869
|
+
opts,
|
|
4870
|
+
state,
|
|
4871
|
+
leadReceipts
|
|
4872
|
+
}, delivery);
|
|
4843
4873
|
}
|
|
4844
4874
|
});
|
|
4845
4875
|
const ackEnv = {
|
|
@@ -5232,4 +5262,4 @@ function createResumeReplay({ opts, bus, ledger, analysis, projectSettled }) {
|
|
|
5232
5262
|
}
|
|
5233
5263
|
export { downMessageRefusalReasons as a, createSteerAcknowledger as c, coordinationVerbNames as d, createFileRunContext as f, watchTrace as i, budgetOverspendText as l, withRunContext as m, createCoordinationToolsForManager as n, createEventBus as o, createInMemoryRunContext as p, defaultToolDetectors as r, createCancelAcknowledger as s, createCoordinationTools as t, normalizeAnalyzeOnSettle as u };
|
|
5234
5264
|
|
|
5235
|
-
//# sourceMappingURL=coordination-manager-
|
|
5265
|
+
//# sourceMappingURL=coordination-manager-CawAzVwE.js.map
|