@tangle-network/agent-runtime 0.50.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-CM2IK7VS.js → chunk-2OU7ZQPD.js} +38 -8
- package/dist/chunk-2OU7ZQPD.js.map +1 -0
- package/dist/{chunk-OM3YNZIW.js → chunk-4JI4BCBI.js} +5 -360
- package/dist/chunk-4JI4BCBI.js.map +1 -0
- package/dist/{chunk-NDM5VXZW.js → chunk-7SP2OVYZ.js} +7 -5
- package/dist/{chunk-NDM5VXZW.js.map → chunk-7SP2OVYZ.js.map} +1 -1
- package/dist/{chunk-RHW75JW5.js → chunk-BERLUBAP.js} +2 -2
- package/dist/{chunk-BKAIVNFA.js → chunk-COAVO6QB.js} +3 -3
- package/dist/chunk-G3RGMA7C.js +361 -0
- package/dist/chunk-G3RGMA7C.js.map +1 -0
- package/dist/{chunk-ML4IXGTV.js → chunk-V2K35HF2.js} +2 -2
- package/dist/improvement.d.ts +96 -8
- package/dist/improvement.js +191 -9
- package/dist/improvement.js.map +1 -1
- package/dist/index.d.ts +114 -4
- package/dist/index.js +144 -18
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +423 -0
- package/dist/intelligence.js +427 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/loop-runner-bin.js +4 -3
- package/dist/loops.d.ts +2 -1
- package/dist/loops.js +3 -1
- package/dist/mcp/bin.js +5 -4
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.js +6 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/platform.d.ts +120 -62
- package/dist/platform.js +68 -26
- package/dist/platform.js.map +1 -1
- package/dist/runtime.d.ts +47 -8
- package/dist/runtime.js +3 -1
- package/dist/workflow.js +1 -1
- package/package.json +6 -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-CM2IK7VS.js.map +0 -1
- package/dist/chunk-OM3YNZIW.js.map +0 -1
- /package/dist/{chunk-RHW75JW5.js.map → chunk-BERLUBAP.js.map} +0 -0
- /package/dist/{chunk-BKAIVNFA.js.map → chunk-COAVO6QB.js.map} +0 -0
- /package/dist/{chunk-ML4IXGTV.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);
|
|
@@ -1112,15 +1123,24 @@ function inlineSandboxClient(factory) {
|
|
|
1112
1123
|
try {
|
|
1113
1124
|
const artifact = await settle(exec, message, controller.signal);
|
|
1114
1125
|
const out = artifact.out;
|
|
1126
|
+
const tokensIn = artifact.spent.tokens.input;
|
|
1127
|
+
const tokensOut = artifact.spent.tokens.output;
|
|
1128
|
+
const costUsd = artifact.spent.usd;
|
|
1129
|
+
if (tokensIn || tokensOut || costUsd) {
|
|
1130
|
+
yield {
|
|
1131
|
+
type: "llm_call",
|
|
1132
|
+
data: { tokensIn, tokensOut, costUsd }
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1115
1135
|
yield {
|
|
1116
1136
|
type: "result",
|
|
1117
1137
|
data: {
|
|
1118
1138
|
finalText: out?.content ?? "",
|
|
1119
1139
|
tokenUsage: {
|
|
1120
|
-
inputTokens:
|
|
1121
|
-
outputTokens:
|
|
1140
|
+
inputTokens: tokensIn,
|
|
1141
|
+
outputTokens: tokensOut
|
|
1122
1142
|
},
|
|
1123
|
-
costUsd
|
|
1143
|
+
costUsd
|
|
1124
1144
|
}
|
|
1125
1145
|
};
|
|
1126
1146
|
} finally {
|
|
@@ -2682,6 +2702,7 @@ function loopUntil(seed, spec) {
|
|
|
2682
2702
|
async act(task, scope) {
|
|
2683
2703
|
let state = { round: 0, value: seed };
|
|
2684
2704
|
const blockers = [];
|
|
2705
|
+
const settledSoFar = [];
|
|
2685
2706
|
for (; ; ) {
|
|
2686
2707
|
const label = spec.label ? spec.label(state.round) : `step:${state.round}`;
|
|
2687
2708
|
const child = ctx.spawnChild(label, ctx.persona.root);
|
|
@@ -2695,8 +2716,10 @@ function loopUntil(seed, spec) {
|
|
|
2695
2716
|
}
|
|
2696
2717
|
const settled = await drainOne(scope, label);
|
|
2697
2718
|
if (settled.kind === "down") blockers.push(blockerFromDown(settled));
|
|
2719
|
+
settledSoFar.push(settled);
|
|
2698
2720
|
state = spec.fold(state, settled);
|
|
2699
|
-
const
|
|
2721
|
+
const findings = ctx.analyst ? await ctx.analyst.analyze({ task, settledSoFar, nodeId: scope.view.root }) : [];
|
|
2722
|
+
const reached = spec.until(state, findings);
|
|
2700
2723
|
if (reached) return reached;
|
|
2701
2724
|
state = { round: state.round + 1, value: state.value };
|
|
2702
2725
|
}
|
|
@@ -2808,7 +2831,12 @@ function widen(spec) {
|
|
|
2808
2831
|
let widenIndex = 0;
|
|
2809
2832
|
for (let s = await scope.next(); s !== null; s = await scope.next()) {
|
|
2810
2833
|
gathered.push(s);
|
|
2811
|
-
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);
|
|
2812
2840
|
if (decision.kind !== "widen") continue;
|
|
2813
2841
|
const label = `widen:${widenIndex}`;
|
|
2814
2842
|
widenIndex += 1;
|
|
@@ -4206,10 +4234,11 @@ function definePersona(input) {
|
|
|
4206
4234
|
...input.extensions ? { extensions: input.extensions } : {}
|
|
4207
4235
|
});
|
|
4208
4236
|
}
|
|
4209
|
-
function createShapeContext(persona, budget) {
|
|
4237
|
+
function createShapeContext(persona, budget, analyst) {
|
|
4210
4238
|
return {
|
|
4211
4239
|
persona,
|
|
4212
4240
|
budget,
|
|
4241
|
+
...analyst ? { analyst } : {},
|
|
4213
4242
|
spawnChild(name, spec) {
|
|
4214
4243
|
const agent = {
|
|
4215
4244
|
name,
|
|
@@ -4235,7 +4264,7 @@ async function runPersonified(options) {
|
|
|
4235
4264
|
const { persona } = options;
|
|
4236
4265
|
const shape = resolveShape(options.shape);
|
|
4237
4266
|
const shapeBudget = resolveShapeBudget(options.budget, options.shapeBudget);
|
|
4238
|
-
const ctx = createShapeContext(persona, shapeBudget);
|
|
4267
|
+
const ctx = createShapeContext(persona, shapeBudget, options.analyst);
|
|
4239
4268
|
const rootAgent = shape(ctx);
|
|
4240
4269
|
const executors = personaRegistry(persona);
|
|
4241
4270
|
const supervisor = createSupervisor();
|
|
@@ -6444,6 +6473,7 @@ export {
|
|
|
6444
6473
|
deterministicCompletion,
|
|
6445
6474
|
assertTraceDerivedFindings,
|
|
6446
6475
|
createScopeAnalyst,
|
|
6476
|
+
registryScopeAnalyst,
|
|
6447
6477
|
buildSteerContext,
|
|
6448
6478
|
createDriver,
|
|
6449
6479
|
renderAnalyses,
|
|
@@ -6519,4 +6549,4 @@ export {
|
|
|
6519
6549
|
gitWorkspace,
|
|
6520
6550
|
jjWorkspace
|
|
6521
6551
|
};
|
|
6522
|
-
//# sourceMappingURL=chunk-
|
|
6552
|
+
//# sourceMappingURL=chunk-2OU7ZQPD.js.map
|