@tangle-network/agent-runtime 0.93.1 → 0.94.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/README.md +4 -3
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +4 -5
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/candidate-execution/index.d.ts +10 -3
- package/dist/candidate-execution/index.js +8 -2
- package/dist/{chunk-XDSWWUKE.js → chunk-4E2GM63H.js} +6 -29
- package/dist/chunk-4E2GM63H.js.map +1 -0
- package/dist/{chunk-LQQPGRKT.js → chunk-4GBT4WQ6.js} +2 -2
- package/dist/{chunk-TKJ3Q6CQ.js → chunk-55P6V5JT.js} +2 -2
- package/dist/{chunk-OX3QRJOA.js → chunk-7I2AOKCI.js} +280 -250
- package/dist/chunk-7I2AOKCI.js.map +1 -0
- package/dist/{chunk-UO2L5VTP.js → chunk-FHZHADIM.js} +1328 -20
- package/dist/chunk-FHZHADIM.js.map +1 -0
- package/dist/{chunk-VMHKMNEU.js → chunk-H2D3DCEB.js} +8 -161
- package/dist/chunk-H2D3DCEB.js.map +1 -0
- package/dist/chunk-ISTDY47H.js +849 -0
- package/dist/chunk-ISTDY47H.js.map +1 -0
- package/dist/{chunk-P6B3Z7PR.js → chunk-MRYPFDHJ.js} +3 -3
- package/dist/{chunk-BVVRQ4YC.js → chunk-OO4EK3JB.js} +1228 -18
- package/dist/chunk-OO4EK3JB.js.map +1 -0
- package/dist/{chunk-CMYMTRGA.js → chunk-PX6SXX3M.js} +26 -3
- package/dist/chunk-PX6SXX3M.js.map +1 -0
- package/dist/{chunk-FRBHUNQ7.js → chunk-RTVVH2KL.js} +2 -2
- package/dist/{chunk-R5GWDTM3.js → chunk-ZEYAT33L.js} +2 -2
- package/dist/{completion-gate-BLaiN0-X.d.ts → completion-gate-BDkEYB_-.d.ts} +1 -1
- package/dist/{coordination-DxJ83oZA.d.ts → coordination-EGoRbbsd.d.ts} +4 -4
- package/dist/environment-provider.d.ts +2 -2
- package/dist/{improve-DDhQaaJT.d.ts → improve-ZzTEkpF_.d.ts} +11 -14
- package/dist/index.d.ts +35 -106
- package/dist/index.js +91 -35
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +22 -5
- package/dist/intelligence.js +113 -19
- package/dist/intelligence.js.map +1 -1
- package/dist/knowledge.d.ts +6 -6
- package/dist/knowledge.js +4 -4
- package/dist/lifecycle.js +2 -2
- package/dist/{loop-runner-bin-kKUNGLyV.d.ts → loop-runner-bin-BRXC1RwC.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +5 -5
- package/dist/loop-runner-bin.js +5 -6
- package/dist/loops.d.ts +456 -17
- package/dist/loops.js +38 -40
- package/dist/mcp/bin.js +4 -4
- package/dist/mcp/index.d.ts +8 -8
- package/dist/mcp/index.js +6 -7
- package/dist/mcp/index.js.map +1 -1
- package/dist/{openai-tools-E3woykz9.d.ts → openai-tools-D0ZSRCC6.d.ts} +1 -1
- package/dist/{prepare-DiVGKcwS.d.ts → prepare-BKxAiUcH.d.ts} +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{sanitize-C9go6tXj.d.ts → sanitize-C2jicjNf.d.ts} +1 -1
- package/dist/{supervise-T2pazU3G.d.ts → supervise-Gmf709kn.d.ts} +4 -4
- package/dist/{types-DAdIm4AC.d.ts → types-Cg_teUPO.d.ts} +2 -2
- package/dist/{types-B00NtbCs.d.ts → types-DWA64rbJ.d.ts} +1 -1
- package/dist/{worktree-fanout-BUb2Ag02.d.ts → worktree-fanout-BrB4att3.d.ts} +233 -233
- package/package.json +4 -4
- package/skills/build-with-agent-runtime/SKILL.md +1 -1
- package/dist/chunk-BVVRQ4YC.js.map +0 -1
- package/dist/chunk-CMYMTRGA.js.map +0 -1
- package/dist/chunk-FDJ7AHXG.js +0 -1229
- package/dist/chunk-FDJ7AHXG.js.map +0 -1
- package/dist/chunk-J2K6WIG6.js +0 -2172
- package/dist/chunk-J2K6WIG6.js.map +0 -1
- package/dist/chunk-OX3QRJOA.js.map +0 -1
- package/dist/chunk-UO2L5VTP.js.map +0 -1
- package/dist/chunk-VMHKMNEU.js.map +0 -1
- package/dist/chunk-XDSWWUKE.js.map +0 -1
- package/dist/structural-rollout-DHGDbhvR.d.ts +0 -446
- /package/dist/{chunk-LQQPGRKT.js.map → chunk-4GBT4WQ6.js.map} +0 -0
- /package/dist/{chunk-TKJ3Q6CQ.js.map → chunk-55P6V5JT.js.map} +0 -0
- /package/dist/{chunk-P6B3Z7PR.js.map → chunk-MRYPFDHJ.js.map} +0 -0
- /package/dist/{chunk-FRBHUNQ7.js.map → chunk-RTVVH2KL.js.map} +0 -0
- /package/dist/{chunk-R5GWDTM3.js.map → chunk-ZEYAT33L.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
createProtectedAgentCandidateModelPort,
|
|
5
5
|
disposePreparedAgentCandidateExecution,
|
|
6
6
|
recoverExpiredAgentCandidateExecution
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4E2GM63H.js";
|
|
8
8
|
import {
|
|
9
9
|
mcpToolsForRuntimeMcp,
|
|
10
10
|
mcpToolsForRuntimeMcpSubset
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-55P6V5JT.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_ROUTER_BASE_URL,
|
|
14
14
|
cleanModelId,
|
|
@@ -27,33 +27,29 @@ import {
|
|
|
27
27
|
runLoopRunnerCli,
|
|
28
28
|
selfImproveLoopRunner,
|
|
29
29
|
worktreeLoopRunner
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MRYPFDHJ.js";
|
|
31
31
|
import "./chunk-SGKPNBXE.js";
|
|
32
32
|
import {
|
|
33
|
-
|
|
34
|
-
ROLLOUT_POLICY_EXTENSION,
|
|
35
|
-
applyRolloutPolicyToProfile,
|
|
36
|
-
enumerateNeighborPolicies,
|
|
33
|
+
applyImprovementWinnerToProfile,
|
|
37
34
|
improve,
|
|
38
35
|
improvementDriver,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
rawTraceDistiller,
|
|
42
|
-
rolloutPolicyProposer,
|
|
43
|
-
serializeRolloutPolicy,
|
|
44
|
-
structuralRolloutPolicyFromProfile
|
|
45
|
-
} from "./chunk-VMHKMNEU.js";
|
|
36
|
+
rawTraceDistiller
|
|
37
|
+
} from "./chunk-H2D3DCEB.js";
|
|
46
38
|
import {
|
|
47
39
|
CANDIDATE_TRACE_ENV,
|
|
48
40
|
CANDIDATE_TRACE_TAGS,
|
|
49
41
|
InMemoryAgentCandidateExecutionClaimStore,
|
|
42
|
+
applyExactAgentProfileDiff,
|
|
50
43
|
candidateExecutionClaim,
|
|
44
|
+
canonicalCandidateDigest,
|
|
51
45
|
executePreparedAgentCandidate,
|
|
46
|
+
parseExactAgentProfile,
|
|
47
|
+
parseExactAgentProfileDiff,
|
|
52
48
|
persistCandidateOutputArtifact,
|
|
53
49
|
prepareAgentCandidateExecution,
|
|
54
50
|
sealAgentCandidateBundle,
|
|
55
51
|
verifyAgentCandidateBundle
|
|
56
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-7I2AOKCI.js";
|
|
57
53
|
import {
|
|
58
54
|
InMemoryRuntimeSessionStore,
|
|
59
55
|
createIterableBackend,
|
|
@@ -63,8 +59,7 @@ import {
|
|
|
63
59
|
normalizeBackendStreamEvent,
|
|
64
60
|
nowIso,
|
|
65
61
|
touchSession
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-FDJ7AHXG.js";
|
|
62
|
+
} from "./chunk-OO4EK3JB.js";
|
|
68
63
|
import "./chunk-ZQZX77MM.js";
|
|
69
64
|
import {
|
|
70
65
|
mcpBuildPrompt,
|
|
@@ -74,7 +69,7 @@ import {
|
|
|
74
69
|
import {
|
|
75
70
|
agenticGenerator,
|
|
76
71
|
commandVerifier
|
|
77
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-RTVVH2KL.js";
|
|
78
73
|
import {
|
|
79
74
|
RESEARCH_SUPERVISOR_SYSTEM_PROMPT,
|
|
80
75
|
createAgentKnowledgeReadinessCheck,
|
|
@@ -83,33 +78,34 @@ import {
|
|
|
83
78
|
knowledgeReadinessDeliverable,
|
|
84
79
|
runKnowledgeImprovementJob,
|
|
85
80
|
runSupervisedKnowledgeUpdate
|
|
86
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-4GBT4WQ6.js";
|
|
87
82
|
import "./chunk-5QOB7H74.js";
|
|
88
|
-
import
|
|
83
|
+
import {
|
|
84
|
+
composeRuntimeHooks,
|
|
85
|
+
defineRuntimeHooks,
|
|
86
|
+
notifyRuntimeDecisionPoint,
|
|
87
|
+
notifyRuntimeHookEvent
|
|
88
|
+
} from "./chunk-FHZHADIM.js";
|
|
89
89
|
import "./chunk-DPEUKJRO.js";
|
|
90
90
|
import {
|
|
91
91
|
INTELLIGENCE_WIRE_VERSION,
|
|
92
92
|
buildLoopOtelSpans,
|
|
93
93
|
buildLoopSpanNodes,
|
|
94
94
|
buildRuntimeEventOtelSpans,
|
|
95
|
-
composeRuntimeHooks,
|
|
96
95
|
createOtelExporter,
|
|
97
96
|
createRuntimeEventCollector,
|
|
98
97
|
createRuntimeStreamEventCollector,
|
|
99
|
-
defineRuntimeHooks,
|
|
100
98
|
exportEvalRuns,
|
|
101
99
|
loopEventToOtelSpan,
|
|
102
|
-
notifyRuntimeDecisionPoint,
|
|
103
|
-
notifyRuntimeHookEvent,
|
|
104
100
|
sanitizeAgentRuntimeEvent,
|
|
105
101
|
sanitizeKnowledgeReadinessReport,
|
|
106
102
|
sanitizeRuntimeStreamEvent
|
|
107
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-ISTDY47H.js";
|
|
108
104
|
import "./chunk-3D2RHC4K.js";
|
|
109
105
|
import "./chunk-VSWBYWFK.js";
|
|
110
106
|
import "./chunk-3MDZX7YU.js";
|
|
111
107
|
import "./chunk-FVJ7M3DA.js";
|
|
112
|
-
import "./chunk-
|
|
108
|
+
import "./chunk-PX6SXX3M.js";
|
|
113
109
|
import {
|
|
114
110
|
AgentEvalError,
|
|
115
111
|
BackendTransportError,
|
|
@@ -1322,6 +1318,70 @@ function deriveExecutionId(input) {
|
|
|
1322
1318
|
return `${input.projectId}:${input.sessionId}:${input.turnIndex}`;
|
|
1323
1319
|
}
|
|
1324
1320
|
|
|
1321
|
+
// src/improvement/profile-diff-proposer.ts
|
|
1322
|
+
import { canonicalJson } from "@tangle-network/agent-eval";
|
|
1323
|
+
import {
|
|
1324
|
+
changedAgentProfileAxes
|
|
1325
|
+
} from "@tangle-network/agent-interface";
|
|
1326
|
+
function profileDiffProposer(options) {
|
|
1327
|
+
return {
|
|
1328
|
+
kind: "agent-profile-diff",
|
|
1329
|
+
async propose(ctx) {
|
|
1330
|
+
if (typeof ctx.currentSurface !== "string") {
|
|
1331
|
+
throw new Error("profileDiffProposer requires a serialized AgentProfile surface");
|
|
1332
|
+
}
|
|
1333
|
+
const profile = parseSerializedProfile(ctx.currentSurface);
|
|
1334
|
+
const proposals = await options.proposeDiffs({
|
|
1335
|
+
...ctx,
|
|
1336
|
+
profile
|
|
1337
|
+
});
|
|
1338
|
+
const candidates = [];
|
|
1339
|
+
const normalizedBaseline = applyExactAgentProfileDiff(
|
|
1340
|
+
profile,
|
|
1341
|
+
{ schemaVersion: 1, kind: "agent-profile-diff" },
|
|
1342
|
+
"profile diff baseline"
|
|
1343
|
+
);
|
|
1344
|
+
const seen = /* @__PURE__ */ new Set([canonicalJson(normalizedBaseline)]);
|
|
1345
|
+
for (const [index, proposal] of proposals.entries()) {
|
|
1346
|
+
if (candidates.length >= ctx.populationSize || ctx.signal.aborted) break;
|
|
1347
|
+
const diff = parseExactAgentProfileDiff(proposal.diff, `profile diff proposal ${index}`);
|
|
1348
|
+
const axes = changedAgentProfileAxes(diff);
|
|
1349
|
+
if (axes.length === 0) continue;
|
|
1350
|
+
const candidate = applyExactAgentProfileDiff(
|
|
1351
|
+
profile,
|
|
1352
|
+
diff,
|
|
1353
|
+
`profile diff candidate ${index}`
|
|
1354
|
+
);
|
|
1355
|
+
const surface = canonicalJson(candidate);
|
|
1356
|
+
if (seen.has(surface)) continue;
|
|
1357
|
+
seen.add(surface);
|
|
1358
|
+
candidates.push({
|
|
1359
|
+
surface,
|
|
1360
|
+
label: proposal.label ?? diff.title ?? diff.id ?? `Change ${axes.join(", ")}`,
|
|
1361
|
+
rationale: candidateRationale(proposal, diff, axes)
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
return candidates;
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
function candidateRationale(proposal, diff, axes) {
|
|
1369
|
+
const reason = proposal.rationale ?? diff.rationale ?? `Changes profile axes: ${axes.join(", ")}.`;
|
|
1370
|
+
const source = diff.source ? [diff.source.kind, ...diff.source.artifacts ?? []].join(" \xB7 ") : "source unspecified";
|
|
1371
|
+
return `${reason} Source: ${source}. Diff: ${canonicalCandidateDigest(diff)}.`;
|
|
1372
|
+
}
|
|
1373
|
+
function parseSerializedProfile(surface) {
|
|
1374
|
+
let raw;
|
|
1375
|
+
try {
|
|
1376
|
+
raw = JSON.parse(surface);
|
|
1377
|
+
} catch (cause) {
|
|
1378
|
+
throw new Error("profileDiffProposer current surface is not valid AgentProfile JSON", {
|
|
1379
|
+
cause
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
return parseExactAgentProfile(raw, "profileDiffProposer current profile");
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1325
1385
|
// src/improvement/reflective-generator.ts
|
|
1326
1386
|
import { spawnSync } from "child_process";
|
|
1327
1387
|
function reflectiveGenerator(opts) {
|
|
@@ -2437,13 +2497,12 @@ export {
|
|
|
2437
2497
|
NotFoundError,
|
|
2438
2498
|
PlannerError,
|
|
2439
2499
|
RESEARCH_SUPERVISOR_SYSTEM_PROMPT,
|
|
2440
|
-
ROLLOUT_POLICY_BOUNDS,
|
|
2441
|
-
ROLLOUT_POLICY_EXTENSION,
|
|
2442
2500
|
RuntimeRunStateError,
|
|
2443
2501
|
SqlConversationJournal,
|
|
2444
2502
|
ValidationError,
|
|
2445
2503
|
agenticGenerator,
|
|
2446
|
-
|
|
2504
|
+
applyExactAgentProfileDiff,
|
|
2505
|
+
applyImprovementWinnerToProfile,
|
|
2447
2506
|
applyRunRecordDefaults,
|
|
2448
2507
|
auditLoopRunner,
|
|
2449
2508
|
buildAgentCandidateBundle,
|
|
@@ -2473,7 +2532,6 @@ export {
|
|
|
2473
2532
|
defineRuntimeHooks,
|
|
2474
2533
|
deriveExecutionId,
|
|
2475
2534
|
disposePreparedAgentCandidateExecution,
|
|
2476
|
-
enumerateNeighborPolicies,
|
|
2477
2535
|
executePreparedAgentCandidate,
|
|
2478
2536
|
exportEvalRuns,
|
|
2479
2537
|
formatSupervisedKnowledgeTask,
|
|
@@ -2490,13 +2548,14 @@ export {
|
|
|
2490
2548
|
mcpServeVerifier,
|
|
2491
2549
|
mcpToolsForRuntimeMcp,
|
|
2492
2550
|
mcpToolsForRuntimeMcpSubset,
|
|
2493
|
-
normalizeRolloutPolicy,
|
|
2494
2551
|
notifyRuntimeDecisionPoint,
|
|
2495
2552
|
notifyRuntimeHookEvent,
|
|
2553
|
+
parseExactAgentProfile,
|
|
2554
|
+
parseExactAgentProfileDiff,
|
|
2496
2555
|
parseLoopRunnerArgv,
|
|
2497
|
-
parseRolloutPolicy,
|
|
2498
2556
|
persistCandidateOutputArtifact,
|
|
2499
2557
|
prepareAgentCandidateExecution,
|
|
2558
|
+
profileDiffProposer,
|
|
2500
2559
|
rawTraceDistiller,
|
|
2501
2560
|
readDepth,
|
|
2502
2561
|
readinessServerSentEvent,
|
|
@@ -2506,7 +2565,6 @@ export {
|
|
|
2506
2565
|
resolveAgentBackend,
|
|
2507
2566
|
resolveChatModel,
|
|
2508
2567
|
resolveRouterBaseUrl,
|
|
2509
|
-
rolloutPolicyProposer,
|
|
2510
2568
|
runAgentTask,
|
|
2511
2569
|
runAgentTaskStream,
|
|
2512
2570
|
runConversation,
|
|
@@ -2524,12 +2582,10 @@ export {
|
|
|
2524
2582
|
sanitizeRuntimeStreamEvent,
|
|
2525
2583
|
sealAgentCandidateBundle,
|
|
2526
2584
|
selfImproveLoopRunner,
|
|
2527
|
-
serializeRolloutPolicy,
|
|
2528
2585
|
sleep,
|
|
2529
2586
|
slugifySpeaker,
|
|
2530
2587
|
startRuntimeRun,
|
|
2531
2588
|
streamToolLoop,
|
|
2532
|
-
structuralRolloutPolicyFromProfile,
|
|
2533
2589
|
toolBuildPrompt,
|
|
2534
2590
|
turnId,
|
|
2535
2591
|
validateChatModelId,
|