@tangle-network/agent-runtime 0.106.0 → 0.107.1
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 +2 -2
- package/dist/{activation-CRjVfOiy.js → activation-Ck5ksFWg.js} +5 -4
- package/dist/{activation-CRjVfOiy.js.map → activation-Ck5ksFWg.js.map} +1 -1
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +1 -1
- package/dist/{analyst-loop-DGdtVENg.js → analyst-loop-C8cGThTW.js} +12 -4
- package/dist/{analyst-loop-DGdtVENg.js.map → analyst-loop-C8cGThTW.js.map} +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/{backends-Dy8NujB4.js → backends-CiOCyRHb.js} +33 -3
- package/dist/{backends-Dy8NujB4.js.map → backends-CiOCyRHb.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-DqMbv1rU.js → candidate-execution-BUpR0mSD.js} +4 -4
- package/dist/{candidate-execution-DqMbv1rU.js.map → candidate-execution-BUpR0mSD.js.map} +1 -1
- package/dist/{conversation-XucG_K3l.js → conversation-BpLQZGPH.js} +2 -2
- package/dist/{conversation-XucG_K3l.js.map → conversation-BpLQZGPH.js.map} +1 -1
- package/dist/conversation.js +1 -1
- package/dist/{improvement-adapter-Cr5TBSji.d.ts → improvement-adapter-BaAdfJKT.d.ts} +2 -2
- package/dist/{improvement-cycle-C095kS_g.js → improvement-cycle-Ulvvbg5p.js} +367 -34
- package/dist/improvement-cycle-Ulvvbg5p.js.map +1 -0
- package/dist/{index-DruSKs3Z.d.ts → index-CeawCSEg.d.ts} +2 -2
- package/dist/{index-BGdxAwfO.d.ts → index-D6MwUzvB.d.ts} +7 -7
- package/dist/{index-CbNM40xG.d.ts → index-jmFVBIHo.d.ts} +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +10 -10
- package/dist/intelligence.d.ts +145 -66
- package/dist/intelligence.js +5 -5
- package/dist/intelligence.js.map +1 -1
- package/dist/{knowledge-Ku-mPP4f.js → knowledge-Dizh_AtL.js} +4 -4
- package/dist/{knowledge-Ku-mPP4f.js.map → knowledge-Dizh_AtL.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-BXsFEUcf.d.ts → loop-runner-bin-BbYG9CeA.d.ts} +3 -3
- package/dist/{loop-runner-bin-BwjQ1NfH.js → loop-runner-bin-CvdKZkE4.js} +3 -3
- package/dist/{loop-runner-bin-BwjQ1NfH.js.map → loop-runner-bin-CvdKZkE4.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/loops.d.ts +1 -1
- package/dist/loops.js +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/{prepare-B53sPV7M.js → prepare-_WTTffkz.js} +25 -8
- package/dist/prepare-_WTTffkz.js.map +1 -0
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/primeintellect/index.js +1 -1
- package/dist/{protected-model-port-BLPH5VVv.js → protected-model-port-ZUwVuftA.js} +2 -2
- package/dist/{protected-model-port-BLPH5VVv.js.map → protected-model-port-ZUwVuftA.js.map} +1 -1
- package/dist/{redact-kbIOjfjM.d.ts → redact-C5xOm8cu.d.ts} +23 -3
- package/dist/{runtime-BG0BziaP.js → runtime-5zM5XxLr.js} +2 -2
- package/dist/{runtime-BG0BziaP.js.map → runtime-5zM5XxLr.js.map} +1 -1
- package/dist/testing.js +222 -194
- package/dist/testing.js.map +1 -1
- package/dist/{types-Cja5OTGh.d.ts → types-CfGKhIuj.d.ts} +10 -2
- package/dist/{workspace-archive-BosQiotA.js → workspace-archive-CIG1VNCj.js} +2 -2
- package/dist/{workspace-archive-BosQiotA.js.map → workspace-archive-CIG1VNCj.js.map} +1 -1
- package/package.json +7 -6
- package/dist/improvement-cycle-C095kS_g.js.map +0 -1
- package/dist/prepare-B53sPV7M.js.map +0 -1
|
@@ -561,16 +561,26 @@ function sealUsage(usage) {
|
|
|
561
561
|
"outputTokens",
|
|
562
562
|
"cachedInputTokens",
|
|
563
563
|
"reasoningTokens",
|
|
564
|
-
"modelCalls"
|
|
564
|
+
"modelCalls",
|
|
565
|
+
"costProvenance"
|
|
565
566
|
], "candidate execution terminal usage");
|
|
566
|
-
for (const
|
|
567
|
+
for (const field of [
|
|
568
|
+
"costUsdNanos",
|
|
569
|
+
"inputTokens",
|
|
570
|
+
"outputTokens",
|
|
571
|
+
"cachedInputTokens",
|
|
572
|
+
"reasoningTokens",
|
|
573
|
+
"modelCalls"
|
|
574
|
+
]) assertCount$1(usage[field], `terminal usage ${field}`);
|
|
575
|
+
if (usage.costProvenance !== "observed" && usage.costProvenance !== "estimated") throw new Error("terminal usage costProvenance must be observed or estimated");
|
|
567
576
|
return Object.freeze({
|
|
568
577
|
costUsdNanos: usage.costUsdNanos,
|
|
569
578
|
inputTokens: usage.inputTokens,
|
|
570
579
|
outputTokens: usage.outputTokens,
|
|
571
580
|
cachedInputTokens: usage.cachedInputTokens,
|
|
572
581
|
reasoningTokens: usage.reasoningTokens,
|
|
573
|
-
modelCalls: usage.modelCalls
|
|
582
|
+
modelCalls: usage.modelCalls,
|
|
583
|
+
costProvenance: usage.costProvenance
|
|
574
584
|
});
|
|
575
585
|
}
|
|
576
586
|
function sealArtifactRef(ref, label) {
|
|
@@ -2075,6 +2085,7 @@ function sealAgentCandidateModelSettlement(settlement, expected) {
|
|
|
2075
2085
|
let cachedInputTokens = 0;
|
|
2076
2086
|
let reasoningTokens = 0;
|
|
2077
2087
|
let costUsdNanos = 0;
|
|
2088
|
+
let costProvenance = "observed";
|
|
2078
2089
|
const calls = settlement.calls.map((source, index) => {
|
|
2079
2090
|
assertExactObjectKeys(source, [
|
|
2080
2091
|
"callId",
|
|
@@ -2088,7 +2099,8 @@ function sealAgentCandidateModelSettlement(settlement, expected) {
|
|
|
2088
2099
|
"outputTokens",
|
|
2089
2100
|
"cachedInputTokens",
|
|
2090
2101
|
"reasoningTokens",
|
|
2091
|
-
"costUsdNanos"
|
|
2102
|
+
"costUsdNanos",
|
|
2103
|
+
"costProvenance"
|
|
2092
2104
|
], `model settlement call ${index}`);
|
|
2093
2105
|
assertIdentifier(source.callId, `model settlement call ${index} callId`);
|
|
2094
2106
|
assertIdentifier(source.generationId, `model settlement call ${index} generationId`);
|
|
@@ -2110,6 +2122,8 @@ function sealAgentCandidateModelSettlement(settlement, expected) {
|
|
|
2110
2122
|
assertCount(source.reasoningTokens, `model settlement call ${index} reasoningTokens`);
|
|
2111
2123
|
reasoningTokens = safeAdd(reasoningTokens, source.reasoningTokens, "reasoning token total");
|
|
2112
2124
|
assertCount(source.costUsdNanos, `model settlement call ${index} costUsdNanos`);
|
|
2125
|
+
if (source.costProvenance !== "observed" && source.costProvenance !== "estimated") throw new Error(`model settlement call ${index} has an invalid cost provenance`);
|
|
2126
|
+
if (source.costProvenance === "estimated") costProvenance = "estimated";
|
|
2113
2127
|
inputTokens = safeAdd(inputTokens, source.inputTokens, "input token total");
|
|
2114
2128
|
outputTokens = safeAdd(outputTokens, source.outputTokens, "output token total");
|
|
2115
2129
|
costUsdNanos = safeAdd(costUsdNanos, source.costUsdNanos, "cost total");
|
|
@@ -2121,7 +2135,8 @@ function sealAgentCandidateModelSettlement(settlement, expected) {
|
|
|
2121
2135
|
outputTokens,
|
|
2122
2136
|
cachedInputTokens,
|
|
2123
2137
|
reasoningTokens,
|
|
2124
|
-
modelCalls: calls.length
|
|
2138
|
+
modelCalls: calls.length,
|
|
2139
|
+
costProvenance
|
|
2125
2140
|
});
|
|
2126
2141
|
return Object.freeze({
|
|
2127
2142
|
value: Object.freeze({
|
|
@@ -2739,7 +2754,8 @@ function emptyFixedSpend() {
|
|
|
2739
2754
|
cachedInputTokens: 0,
|
|
2740
2755
|
reasoningTokens: 0,
|
|
2741
2756
|
modelCalls: 0,
|
|
2742
|
-
costUsdNanos: 0
|
|
2757
|
+
costUsdNanos: 0,
|
|
2758
|
+
costProvenance: "observed"
|
|
2743
2759
|
};
|
|
2744
2760
|
}
|
|
2745
2761
|
function detachedImplementation(bytes) {
|
|
@@ -2875,7 +2891,8 @@ async function persistCandidateModelSettlementEvidence(identity, settlement, out
|
|
|
2875
2891
|
outputTokens: call.outputTokens,
|
|
2876
2892
|
cachedInputTokens: call.cachedInputTokens ?? 0,
|
|
2877
2893
|
reasoningTokens: call.reasoningTokens ?? 0,
|
|
2878
|
-
costUsdNanos: call.costUsdNanos
|
|
2894
|
+
costUsdNanos: call.costUsdNanos,
|
|
2895
|
+
costProvenance: call.costProvenance
|
|
2879
2896
|
})),
|
|
2880
2897
|
usage: settlement.usage
|
|
2881
2898
|
};
|
|
@@ -4289,4 +4306,4 @@ function errorMessage(error) {
|
|
|
4289
4306
|
//#endregion
|
|
4290
4307
|
export { parseExactAgentProfile as $, verifyMaterializedWorkspace as A, rejectedStage as B, assertNoGitIndirection as C, captureMaterializedWorkspace as D, candidateWorkspaceManifest as E, assertTerminalAllowedInPhase as F, agentCandidateProfileAsAgentProfile as G, sealTerminalDigest as H, assertTerminalMatchesClaim as I, candidateMaterializerHarness as J, applyExactAgentProfileDiff as K, assertTerminalMatchesStaged as L, candidateCleanupTimeout as M, withinCandidateCleanupDeadline as N, readVerifiedArtifact as O, assertRecoveryMatchesStaged as P, parseAgentCandidateProfileActivation as Q, recoveredTerminalRecord as R, CANDIDATE_TRACE_TAGS as S, runCandidateGit as T, terminalRecord as U, requireStagedTerminal as V, assertExactObjectKeys as W, freezeGenericAgentCandidateProfile as X, createAgentCandidateProfileActivation as Y, omitUndefinedObjectFields as Z, candidateExecutionClaim as _, persistCandidateOutputArtifact as a, deepFreezeCandidate as at, consumePreparedCandidateExecution as b, CANDIDATE_KNOWLEDGE_ROOT_ENV as c, omitTopLevelDigest as ct, verifiedResourceTextByDigest as d, parseExactAgentProfileDiff as et, verifyAgentCandidateBundle as f, candidateClaimFileInternals as g, InMemoryAgentCandidateExecutionClaimStore as h, persistCandidateModelSettlementEvidence as i, canonicalCandidateDocument as it, candidateCleanupDeadline as j, verifyBytes as k, candidateKnowledgeExecutionPaths as l, sha256Bytes as lt, usdToNanos as m, executePreparedAgentCandidate as n, canonicalCandidateBytes as nt, sealAgentCandidateExecutorStopAcknowledgement as o, embeddedCandidateArtifact as ot, sealAgentCandidateModelSettlement as p, assertCandidateProfileBinding as q, RecoveryAgentCandidateTraceStore as r, canonicalCandidateDigest$1 as rt, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV as s, immutableCandidateValue as st, prepareAgentCandidateExecution as t, parseExactCandidateProfile as tt, AGENT_CANDIDATE_EXECUTION_SUPPORT as u, verifyCanonicalCandidateDocument as ut, assertPreparedCandidateIntegrity as v, readCandidateGitTreeFiles as w, CANDIDATE_TRACE_ENV as x, beginPreparedCandidateDisposal as y, rejectedFinish as z };
|
|
4291
4308
|
|
|
4292
|
-
//# sourceMappingURL=prepare-
|
|
4309
|
+
//# sourceMappingURL=prepare-_WTTffkz.js.map
|