@tangle-network/agent-runtime 0.51.0 → 0.52.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.js +1 -1
- package/dist/{chunk-FQH33M5N.js → chunk-2OU7ZQPD.js} +26 -5
- package/dist/chunk-2OU7ZQPD.js.map +1 -0
- package/dist/{chunk-HYG4ISNS.js → chunk-4JI4BCBI.js} +2 -2
- package/dist/{chunk-HAA4KZUD.js → chunk-7SP2OVYZ.js} +3 -3
- package/dist/{chunk-47SWANFA.js → chunk-BERLUBAP.js} +2 -2
- package/dist/{chunk-XEI7AIHU.js → chunk-COAVO6QB.js} +3 -3
- package/dist/{chunk-FKHNHUXP.js → chunk-V2K35HF2.js} +2 -2
- package/dist/index.d.ts +114 -4
- package/dist/index.js +141 -16
- package/dist/index.js.map +1 -1
- package/dist/loop-runner-bin.js +3 -3
- package/dist/loops.d.ts +2 -1
- package/dist/loops.js +3 -1
- package/dist/mcp/bin.js +4 -4
- package/dist/mcp/index.js +5 -5
- package/dist/runtime.d.ts +47 -8
- package/dist/runtime.js +3 -1
- package/dist/workflow.js +1 -1
- package/package.json +1 -1
- package/skills/agent-runtime-adoption/SKILL.md +41 -26
- package/skills/build-with-agent-runtime/SKILL.md +143 -0
- package/skills/loop-writer/SKILL.md +6 -7
- package/dist/chunk-FQH33M5N.js.map +0 -1
- /package/dist/{chunk-HYG4ISNS.js.map → chunk-4JI4BCBI.js.map} +0 -0
- /package/dist/{chunk-HAA4KZUD.js.map → chunk-7SP2OVYZ.js.map} +0 -0
- /package/dist/{chunk-47SWANFA.js.map → chunk-BERLUBAP.js.map} +0 -0
- /package/dist/{chunk-XEI7AIHU.js.map → chunk-COAVO6QB.js.map} +0 -0
- /package/dist/{chunk-FKHNHUXP.js.map → chunk-V2K35HF2.js.map} +0 -0
package/dist/agent.js
CHANGED
|
@@ -710,6 +710,17 @@ function readAnalystFindings(settled) {
|
|
|
710
710
|
}
|
|
711
711
|
return out;
|
|
712
712
|
}
|
|
713
|
+
function registryScopeAnalyst(registry, buildInputs) {
|
|
714
|
+
return {
|
|
715
|
+
async analyze(input) {
|
|
716
|
+
const projection = buildInputs(input);
|
|
717
|
+
const result = await registry.run(projection.runId, projection.inputs, projection.opts);
|
|
718
|
+
const findings = result.findings;
|
|
719
|
+
assertTraceDerivedFindings(findings);
|
|
720
|
+
return findings;
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
}
|
|
713
724
|
function buildSteerContext(findings, settledSoFar) {
|
|
714
725
|
assertTraceDerivedFindings(findings);
|
|
715
726
|
const lastValidScore = observedBestScore(settledSoFar);
|
|
@@ -2691,6 +2702,7 @@ function loopUntil(seed, spec) {
|
|
|
2691
2702
|
async act(task, scope) {
|
|
2692
2703
|
let state = { round: 0, value: seed };
|
|
2693
2704
|
const blockers = [];
|
|
2705
|
+
const settledSoFar = [];
|
|
2694
2706
|
for (; ; ) {
|
|
2695
2707
|
const label = spec.label ? spec.label(state.round) : `step:${state.round}`;
|
|
2696
2708
|
const child = ctx.spawnChild(label, ctx.persona.root);
|
|
@@ -2704,8 +2716,10 @@ function loopUntil(seed, spec) {
|
|
|
2704
2716
|
}
|
|
2705
2717
|
const settled = await drainOne(scope, label);
|
|
2706
2718
|
if (settled.kind === "down") blockers.push(blockerFromDown(settled));
|
|
2719
|
+
settledSoFar.push(settled);
|
|
2707
2720
|
state = spec.fold(state, settled);
|
|
2708
|
-
const
|
|
2721
|
+
const findings = ctx.analyst ? await ctx.analyst.analyze({ task, settledSoFar, nodeId: scope.view.root }) : [];
|
|
2722
|
+
const reached = spec.until(state, findings);
|
|
2709
2723
|
if (reached) return reached;
|
|
2710
2724
|
state = { round: state.round + 1, value: state.value };
|
|
2711
2725
|
}
|
|
@@ -2817,7 +2831,12 @@ function widen(spec) {
|
|
|
2817
2831
|
let widenIndex = 0;
|
|
2818
2832
|
for (let s = await scope.next(); s !== null; s = await scope.next()) {
|
|
2819
2833
|
gathered.push(s);
|
|
2820
|
-
const
|
|
2834
|
+
const findings = ctx.analyst ? await ctx.analyst.analyze({
|
|
2835
|
+
task: _task,
|
|
2836
|
+
settledSoFar: gathered,
|
|
2837
|
+
nodeId: scope.view.root
|
|
2838
|
+
}) : [];
|
|
2839
|
+
const decision = spec.gate.decide(s, findings, scope.budget);
|
|
2821
2840
|
if (decision.kind !== "widen") continue;
|
|
2822
2841
|
const label = `widen:${widenIndex}`;
|
|
2823
2842
|
widenIndex += 1;
|
|
@@ -4215,10 +4234,11 @@ function definePersona(input) {
|
|
|
4215
4234
|
...input.extensions ? { extensions: input.extensions } : {}
|
|
4216
4235
|
});
|
|
4217
4236
|
}
|
|
4218
|
-
function createShapeContext(persona, budget) {
|
|
4237
|
+
function createShapeContext(persona, budget, analyst) {
|
|
4219
4238
|
return {
|
|
4220
4239
|
persona,
|
|
4221
4240
|
budget,
|
|
4241
|
+
...analyst ? { analyst } : {},
|
|
4222
4242
|
spawnChild(name, spec) {
|
|
4223
4243
|
const agent = {
|
|
4224
4244
|
name,
|
|
@@ -4244,7 +4264,7 @@ async function runPersonified(options) {
|
|
|
4244
4264
|
const { persona } = options;
|
|
4245
4265
|
const shape = resolveShape(options.shape);
|
|
4246
4266
|
const shapeBudget = resolveShapeBudget(options.budget, options.shapeBudget);
|
|
4247
|
-
const ctx = createShapeContext(persona, shapeBudget);
|
|
4267
|
+
const ctx = createShapeContext(persona, shapeBudget, options.analyst);
|
|
4248
4268
|
const rootAgent = shape(ctx);
|
|
4249
4269
|
const executors = personaRegistry(persona);
|
|
4250
4270
|
const supervisor = createSupervisor();
|
|
@@ -6453,6 +6473,7 @@ export {
|
|
|
6453
6473
|
deterministicCompletion,
|
|
6454
6474
|
assertTraceDerivedFindings,
|
|
6455
6475
|
createScopeAnalyst,
|
|
6476
|
+
registryScopeAnalyst,
|
|
6456
6477
|
buildSteerContext,
|
|
6457
6478
|
createDriver,
|
|
6458
6479
|
renderAnalyses,
|
|
@@ -6528,4 +6549,4 @@ export {
|
|
|
6528
6549
|
gitWorkspace,
|
|
6529
6550
|
jjWorkspace
|
|
6530
6551
|
};
|
|
6531
|
-
//# sourceMappingURL=chunk-
|
|
6552
|
+
//# sourceMappingURL=chunk-2OU7ZQPD.js.map
|