@tangle-network/agent-runtime 0.123.0 → 0.123.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/dist/{activation-B7sTehZB.js → activation-DhWJ3p8N.js} +2 -2
- package/dist/{activation-B7sTehZB.js.map → activation-DhWJ3p8N.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{environment-provider-CY22kUQH.js → environment-provider-DqFS6FSZ.js} +3 -2
- package/dist/environment-provider-DqFS6FSZ.js.map +1 -0
- package/dist/{environment-provider-CEjwunXO.d.ts → environment-provider-PM9PeW_J.d.ts} +5 -1
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-cycle-BcwsSbT-.js → improvement-cycle-IJgCbKWQ.js} +5 -5
- package/dist/improvement-cycle-IJgCbKWQ.js.map +1 -0
- package/dist/{index-CKply5aj.d.ts → index-4NcThsDc.d.ts} +3 -3
- package/dist/{index-BKSzgMvA.d.ts → index-CQBioeAj.d.ts} +5 -5
- package/dist/{index-CyXinqJw.d.ts → index-xP27vtnt.d.ts} +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +1 -1
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +5 -5
- package/dist/{knowledge-Cuvb21T7.js → knowledge-BOHj6nGh.js} +3 -3
- package/dist/{knowledge-Cuvb21T7.js.map → knowledge-BOHj6nGh.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-BjnNpN5m.d.ts → loop-runner-bin-DMnNxZHw.d.ts} +3 -3
- package/dist/{loop-runner-bin-Clhj8gy5.js → loop-runner-bin-DUM37LLw.js} +3 -3
- package/dist/{loop-runner-bin-Clhj8gy5.js.map → loop-runner-bin-DUM37LLw.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-BwTsBfd-.js → openai-tools-Bm1SDJIp.js} +2 -2
- package/dist/{openai-tools-BwTsBfd-.js.map → openai-tools-Bm1SDJIp.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{runtime-OI7oLLec.js → runtime-DZblIf3R.js} +9 -8
- package/dist/runtime-DZblIf3R.js.map +1 -0
- package/dist/{structural-rollout-C4Jv_7vt.js → structural-rollout-zY0oqQzO.js} +2 -2
- package/dist/{structural-rollout-C4Jv_7vt.js.map → structural-rollout-zY0oqQzO.js.map} +1 -1
- package/dist/{supervise-Dwq16u8n.js → supervise-Cx24b3lw.js} +34 -42
- package/dist/supervise-Cx24b3lw.js.map +1 -0
- package/dist/{supervisor-DjZ82HIB.js → supervisor-DpjO0Gmy.js} +67 -8
- package/dist/supervisor-DpjO0Gmy.js.map +1 -0
- package/dist/testing.js +9 -9
- package/package.json +1 -1
- package/dist/environment-provider-CY22kUQH.js.map +0 -1
- package/dist/improvement-cycle-BcwsSbT-.js.map +0 -1
- package/dist/runtime-OI7oLLec.js.map +0 -1
- package/dist/supervise-Dwq16u8n.js.map +0 -1
- package/dist/supervisor-DjZ82HIB.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as RuntimeRunStateError, u as ValidationError } from "./errors-DEAvWQPy.js";
|
|
1
|
+
import { c as RuntimeRunStateError, i as ConfigError, u as ValidationError } from "./errors-DEAvWQPy.js";
|
|
2
2
|
import { S as detachedSnapshot, _ as captureWorkerTraceEvidence, c as replaySpawnTree, f as attestNestedDriverTreeOwner, h as runtimeOwnedNestedDriverTreeRoot, m as nestedDriverTreeRoot, o as materializeTreeView, p as driverRuntime, s as pendingWaits, x as contentAddress } from "./spawn-journal-DsZKDqeh.js";
|
|
3
3
|
import { f as zeroTokenUsage, t as addTokenUsage } from "./util-MVgdwuIS.js";
|
|
4
4
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
|
|
5
|
-
import { estimateCost, isModelPriced } from "@tangle-network/agent-eval";
|
|
5
|
+
import { HARNESS_NATIVE_MODEL, estimateCost, isModelPriced } from "@tangle-network/agent-eval";
|
|
6
6
|
import { AGENT_PROFILE_MATERIALIZATION_AXES, agentProfileSchema, canonicalCandidateDigest, profileMaterializationAxes, sha256DigestSchema } from "@tangle-network/agent-interface";
|
|
7
7
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
8
|
import { applyWorkspacePlan, hashWorkspacePlan, materializeProfile, resolveAgentProfileResources } from "@tangle-network/agent-profile-materialize";
|
|
@@ -13,6 +13,66 @@ import { spawn } from "node:child_process";
|
|
|
13
13
|
import { homedir, tmpdir } from "node:os";
|
|
14
14
|
import { stripVTControlCharacters } from "node:util";
|
|
15
15
|
import { deriveHexId, isW3CSpanId, isW3CTraceId } from "@tangle-network/agent-trace-contract";
|
|
16
|
+
//#region src/runtime/supervise/model-policy.ts
|
|
17
|
+
/**
|
|
18
|
+
* `assertModelAllowed` — a fail-loud guard that restricts a run to a chosen subset of
|
|
19
|
+
* models. The two front doors (`supervise()` / `improve()`) call it once per configured
|
|
20
|
+
* model at resolve time, so a run that names a model outside the allowed set throws before
|
|
21
|
+
* any compute is spent — never silently swapped or silently allowed.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Return the model id an executor may send to a provider.
|
|
25
|
+
*
|
|
26
|
+
* Eval stamps {@link HARNESS_NATIVE_MODEL} into a profile when model selection is deliberately
|
|
27
|
+
* delegated to the configured runtime. That marker belongs in experiment identity and cost
|
|
28
|
+
* admission; it is not a provider model id.
|
|
29
|
+
*/
|
|
30
|
+
function concreteModelId(model) {
|
|
31
|
+
if (model === void 0) return void 0;
|
|
32
|
+
const id = model.trim();
|
|
33
|
+
return id.length > 0 && !isHarnessNativeModel(id) ? id : void 0;
|
|
34
|
+
}
|
|
35
|
+
/** Whether a model value delegates selection to the chosen execution system. */
|
|
36
|
+
function isHarnessNativeModel(model) {
|
|
37
|
+
return model?.trim() === HARNESS_NATIVE_MODEL;
|
|
38
|
+
}
|
|
39
|
+
/** Return a profile's explicitly selected provider model, if it has one. */
|
|
40
|
+
function concreteProfileModel(profile) {
|
|
41
|
+
return concreteModelId(profile.model?.default);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Remove only Eval's runtime-selected model marker before a profile crosses an execution boundary.
|
|
45
|
+
* Every other model hint remains intact, including provider, reasoning effort, and small-model
|
|
46
|
+
* preferences. The input profile is never mutated.
|
|
47
|
+
*/
|
|
48
|
+
function profileForExecution(profile) {
|
|
49
|
+
const model = profile.model;
|
|
50
|
+
if (!isHarnessNativeModel(model?.default) || model === void 0) return profile;
|
|
51
|
+
const { default: _runtimeSelected, ...remainingModel } = model;
|
|
52
|
+
const { model: _model, ...remainingProfile } = profile;
|
|
53
|
+
return Object.keys(remainingModel).length > 0 ? {
|
|
54
|
+
...remainingProfile,
|
|
55
|
+
model: remainingModel
|
|
56
|
+
} : remainingProfile;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Throw a `ConfigError` when `allowed` is set, `model` is defined, and `model` is not a
|
|
60
|
+
* member of `allowed`. No-op when `allowed` is unset (the unrestricted default) or when
|
|
61
|
+
* `model` is undefined (nothing was configured to check).
|
|
62
|
+
*/
|
|
63
|
+
function assertModelAllowed(model, allowed) {
|
|
64
|
+
if (!allowed || model === void 0) return;
|
|
65
|
+
if (!allowed.includes(model)) throw new ConfigError(`model ${JSON.stringify(model)} is not in the allowed set ${JSON.stringify([...allowed])}`);
|
|
66
|
+
}
|
|
67
|
+
/** Check every canonical model-bearing field in a complete profile, including the models a
|
|
68
|
+
* backend may select for cheap work, named subagents, or modes. */
|
|
69
|
+
function assertProfileModelsAllowed(profile, allowed) {
|
|
70
|
+
assertModelAllowed(profile.model?.default, allowed);
|
|
71
|
+
assertModelAllowed(profile.model?.small, allowed);
|
|
72
|
+
for (const subagent of Object.values(profile.subagents ?? {})) assertModelAllowed(subagent.model, allowed);
|
|
73
|
+
for (const mode of Object.values(profile.modes ?? {})) assertModelAllowed(mode.model, allowed);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
16
76
|
//#region src/mcp/codex-diagnostics.ts
|
|
17
77
|
/** Thrown when reproducible Codex exits without one valid terminal usage event. */
|
|
18
78
|
var CodexExecutionDiagnosticError = class extends Error {
|
|
@@ -290,8 +350,7 @@ function harnessInvocation(harness, profile, taskPrompt, options = {}) {
|
|
|
290
350
|
const invocation = HARNESS_INVOCATIONS[harness];
|
|
291
351
|
if (!invocation) throw new Error(`harnessInvocation: unknown harness ${String(harness)}`);
|
|
292
352
|
if (options.codexReproducible) {
|
|
293
|
-
|
|
294
|
-
if (typeof model !== "string" || model.trim().length === 0) throw new Error("harnessInvocation: codexReproducible requires profile.model.default");
|
|
353
|
+
if (!concreteProfileModel(profile)) throw new Error("harnessInvocation: codexReproducible requires profile.model.default");
|
|
295
354
|
if (profile.model?.reasoningEffort === void 0) throw new Error("harnessInvocation: codexReproducible requires profile.model.reasoningEffort");
|
|
296
355
|
}
|
|
297
356
|
const systemPrompt = profile.prompt?.systemPrompt;
|
|
@@ -303,8 +362,8 @@ function harnessInvocation(harness, profile, taskPrompt, options = {}) {
|
|
|
303
362
|
taskPrompt
|
|
304
363
|
].join("\n\n");
|
|
305
364
|
const args = buildHarnessArgs(harness, composedPrompt, options);
|
|
306
|
-
const model = profile
|
|
307
|
-
if (
|
|
365
|
+
const model = concreteProfileModel(profile);
|
|
366
|
+
if (model) args.push(...invocation.modelArgs(model));
|
|
308
367
|
const reasoningEffort = profile.model?.reasoningEffort;
|
|
309
368
|
if (reasoningEffort !== void 0) args.push(...harnessReasoningArgs(harness, reasoningEffort));
|
|
310
369
|
return {
|
|
@@ -7329,6 +7388,6 @@ function isNonEmptySpend(s) {
|
|
|
7329
7388
|
return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false;
|
|
7330
7389
|
}
|
|
7331
7390
|
//#endregion
|
|
7332
|
-
export { queueOf as $, flatOtelSpan as A, controlProfileMaterialization as At, sanitizeRuntimeStreamEvent as B, validateProfileMaterialization as Bt, INTELLIGENCE_WIRE_VERSION as C, runWorktreeHarness as Ct, createOpenInferenceFileExporter as D, removeWorktree as Dt, buildRuntimeEventOtelSpans as E, createWorktree as Et, toOtelAttributes as F, promptModelProfileMaterialization as Ft, validateWaitSpec as G, harnessSupportsReasoningEffort as Gt, isWaitOutcome as H, DEFAULT_LOCAL_HARNESS as Ht, createRuntimeEventCollector as I, promptOnlyProfileMaterialization as It, createActivityLog as J, runLocalHarness as Jt, waitUntil as K, localHarnessExecutable as Kt, createRuntimeStreamEventCollector as L, promptResourceProfileMaterialization as Lt, loopEventToOtelSpan as M, fullProfileMaterialization as Mt, padSpanId as N, profileMaterializationAxes as Nt, createOtelExporter as O, AGENT_PROFILE_MATERIALIZATION_AXES as Ot, padTraceId as P, promptControlProfileMaterialization as Pt, freeSlots as Q, sanitizeAgentRuntimeEvent as R, renderProfileMaterializationIssues as Rt, traceContextToEnv as S, runWorktreeChecks as St, buildLoopSpanNodes as T, captureWorktreeDiff as Tt, pollFor as U, LOCAL_HARNESSES as Ut, createWaitProbes as V, worktreeCliProfileMaterialization as Vt, timerAt as W, harnessInvocation as Wt, readWorkerProgress as X, describeToolArgs as Y, CodexExecutionDiagnosticError as Yt, effectiveConcurrency as Z, workerTraceEnv as _, routerChatWithUsage as _t, pickBestDelivered as a, assertValidBudget as at, mergeTraceEnv as b, runBrainLoop as bt, driverChild as c, attestRuntimeOwnedExecutor as ct, deriveNodeExecutionIdentity as d, newExecutionAttemptId as dt, rollingDispatch as et, recordScopeOwnerMaterialization as f, runtimeOwnedExecutorExecutionBinding as ft, readWorkerTraceContext as g, routerChatWithTools as gt, WORKER_TRACE_PROPAGATION as h, routerBrain as ht, collectDelivered as i, workerTokenFloor as it, generateSpanId as j, defineProfileMaterializationContract as jt, exportEvalRuns as k, assertProfileMaterialization as kt, withDriverExecutor as l, attestRuntimeOwnedScopeOwner as lt, settledToIteration as m, runtimeOwnedScopeOwnerRuntime as mt, createSupervisor as n, teardownExecutor as nt, runFinalizer as o, createBudgetPool as ot, scopeOwnerExecutorNodeContext as p, runtimeOwnedExecutorMaterialization as pt, DEFAULT_STALL_AFTER_MS as q, parseCodexTokenUsage as qt, bestDelivered as r, WORKER_TOKEN_FLOOR as rt, runTree as s, spendFromUsageEvents as st, createRootHandle as t, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as tt, createScope as u, inheritRuntimeOwnedExecutorAttestation as ut, workerTraceSeamKey as v, routerToolLoop as vt, buildLoopOtelSpans as w, worktreeProfileExecutionPlan as wt, readTraceContextFromEnv as x, runSettledCommand as xt, createPropagatingTraceEmitter as y, streamRouterChatWithTools as yt, sanitizeKnowledgeReadinessReport as z, sandboxActProfileMaterialization as zt };
|
|
7391
|
+
export { queueOf as $, concreteProfileModel as $t, flatOtelSpan as A, controlProfileMaterialization as At, sanitizeRuntimeStreamEvent as B, validateProfileMaterialization as Bt, INTELLIGENCE_WIRE_VERSION as C, runWorktreeHarness as Ct, createOpenInferenceFileExporter as D, removeWorktree as Dt, buildRuntimeEventOtelSpans as E, createWorktree as Et, toOtelAttributes as F, promptModelProfileMaterialization as Ft, validateWaitSpec as G, harnessSupportsReasoningEffort as Gt, isWaitOutcome as H, DEFAULT_LOCAL_HARNESS as Ht, createRuntimeEventCollector as I, promptOnlyProfileMaterialization as It, createActivityLog as J, runLocalHarness as Jt, waitUntil as K, localHarnessExecutable as Kt, createRuntimeStreamEventCollector as L, promptResourceProfileMaterialization as Lt, loopEventToOtelSpan as M, fullProfileMaterialization as Mt, padSpanId as N, profileMaterializationAxes as Nt, createOtelExporter as O, AGENT_PROFILE_MATERIALIZATION_AXES as Ot, padTraceId as P, promptControlProfileMaterialization as Pt, freeSlots as Q, concreteModelId as Qt, sanitizeAgentRuntimeEvent as R, renderProfileMaterializationIssues as Rt, traceContextToEnv as S, runWorktreeChecks as St, buildLoopSpanNodes as T, captureWorktreeDiff as Tt, pollFor as U, LOCAL_HARNESSES as Ut, createWaitProbes as V, worktreeCliProfileMaterialization as Vt, timerAt as W, harnessInvocation as Wt, readWorkerProgress as X, assertModelAllowed as Xt, describeToolArgs as Y, CodexExecutionDiagnosticError as Yt, effectiveConcurrency as Z, assertProfileModelsAllowed as Zt, workerTraceEnv as _, routerChatWithUsage as _t, pickBestDelivered as a, assertValidBudget as at, mergeTraceEnv as b, runBrainLoop as bt, driverChild as c, attestRuntimeOwnedExecutor as ct, deriveNodeExecutionIdentity as d, newExecutionAttemptId as dt, isHarnessNativeModel as en, rollingDispatch as et, recordScopeOwnerMaterialization as f, runtimeOwnedExecutorExecutionBinding as ft, readWorkerTraceContext as g, routerChatWithTools as gt, WORKER_TRACE_PROPAGATION as h, routerBrain as ht, collectDelivered as i, workerTokenFloor as it, generateSpanId as j, defineProfileMaterializationContract as jt, exportEvalRuns as k, assertProfileMaterialization as kt, withDriverExecutor as l, attestRuntimeOwnedScopeOwner as lt, settledToIteration as m, runtimeOwnedScopeOwnerRuntime as mt, createSupervisor as n, teardownExecutor as nt, runFinalizer as o, createBudgetPool as ot, scopeOwnerExecutorNodeContext as p, runtimeOwnedExecutorMaterialization as pt, DEFAULT_STALL_AFTER_MS as q, parseCodexTokenUsage as qt, bestDelivered as r, WORKER_TOKEN_FLOOR as rt, runTree as s, spendFromUsageEvents as st, createRootHandle as t, profileForExecution as tn, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as tt, createScope as u, inheritRuntimeOwnedExecutorAttestation as ut, workerTraceSeamKey as v, routerToolLoop as vt, buildLoopOtelSpans as w, worktreeProfileExecutionPlan as wt, readTraceContextFromEnv as x, runSettledCommand as xt, createPropagatingTraceEmitter as y, streamRouterChatWithTools as yt, sanitizeKnowledgeReadinessReport as z, sandboxActProfileMaterialization as zt };
|
|
7333
7392
|
|
|
7334
|
-
//# sourceMappingURL=supervisor-
|
|
7393
|
+
//# sourceMappingURL=supervisor-DpjO0Gmy.js.map
|