@tangle-network/agent-runtime 0.132.7 → 0.132.9
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-Cb1vGSdK.js → activation-BNyOriQ_.js} +2 -2
- package/dist/{activation-Cb1vGSdK.js.map → activation-BNyOriQ_.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{authoring-CQP4S4uc.js → authoring-BpIDTX_5.js} +2 -2
- package/dist/{authoring-CQP4S4uc.js.map → authoring-BpIDTX_5.js.map} +1 -1
- package/dist/candidate-execution/index.d.ts +2 -2
- package/dist/candidate-execution/index.js +2 -2
- package/dist/{candidate-execution-DxL_I3xx.js → candidate-execution-DUefVdnW.js} +65 -2
- package/dist/candidate-execution-DUefVdnW.js.map +1 -0
- package/dist/{graph-DgDaI3KK.js → graph-lB5TUusP.js} +2 -2
- package/dist/{graph-DgDaI3KK.js.map → graph-lB5TUusP.js.map} +1 -1
- package/dist/{improvement-cycle-DCBmuhht.js → improvement-cycle-BSK4bjDT.js} +3 -3
- package/dist/{improvement-cycle-DCBmuhht.js.map → improvement-cycle-BSK4bjDT.js.map} +1 -1
- package/dist/{index-DixXnx07.d.ts → index-B2vnuE5e.d.ts} +4 -54
- package/dist/{index-BsrFZu0N.d.ts → index-B6vqfzZt.d.ts} +3 -3
- package/dist/{index-B3bHsVLw.d.ts → index-C8WhH5Yt.d.ts} +44 -5
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +6 -6
- package/dist/{knowledge-B8pmbGqF.js → knowledge-CAGriDRo.js} +3 -3
- package/dist/{knowledge-B8pmbGqF.js.map → knowledge-CAGriDRo.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-BqJGlXju.d.ts → loop-runner-bin-C5oxfyi9.d.ts} +2 -2
- package/dist/{loop-runner-bin-D9qLc2dD.js → loop-runner-bin-DVqbR72k.js} +3 -3
- package/dist/{loop-runner-bin-D9qLc2dD.js.map → loop-runner-bin-DVqbR72k.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 +3 -3
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-C6KQ6aVK.js → openai-tools-C2v4x1Lv.js} +2 -2
- package/dist/{openai-tools-C6KQ6aVK.js.map → openai-tools-C2v4x1Lv.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{redact-BAnM2avI.d.ts → redact-CJpB66r5.d.ts} +2 -2
- package/dist/{runtime-B5z9C4gn.js → runtime-D7It83FH.js} +6 -6
- package/dist/{runtime-B5z9C4gn.js.map → runtime-D7It83FH.js.map} +1 -1
- package/dist/{runtime-CKk_poJ-.d.ts → runtime-laujrVXP.d.ts} +68 -3
- package/dist/{structural-rollout-DBYiyyE-.js → structural-rollout-Cd8ZM0dD.js} +2 -2
- package/dist/{structural-rollout-DBYiyyE-.js.map → structural-rollout-Cd8ZM0dD.js.map} +1 -1
- package/dist/{supervise-oLZHae_v.js → supervise-D8I1BRWe.js} +2 -2
- package/dist/{supervise-oLZHae_v.js.map → supervise-D8I1BRWe.js.map} +1 -1
- package/dist/{supervisor-D5ar0Rs6.js → supervisor-Dr3AoSh0.js} +66 -4
- package/dist/supervisor-Dr3AoSh0.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +11 -11
- package/package.json +1 -1
- package/dist/candidate-execution-DxL_I3xx.js.map +0 -1
- package/dist/supervisor-D5ar0Rs6.js.map +0 -1
|
@@ -5931,10 +5931,58 @@ const sandboxSeamKey = "sandbox";
|
|
|
5931
5931
|
const cliSeamKey = "cli";
|
|
5932
5932
|
const bridgeSeamKey = "bridge";
|
|
5933
5933
|
const maxBridgeTimeoutMs = 2147483647;
|
|
5934
|
+
const bridgeModelCredentialHeader = "x-cli-bridge-model-credential";
|
|
5934
5935
|
const bridgeProfileMaterializationSchema = "cli-bridge.profile-materialization.v2";
|
|
5935
5936
|
const bridgeUsageCostSchema = "cli-bridge.usage-cost.v1";
|
|
5936
5937
|
const cliWorktreeSeamKey = "cli-worktree";
|
|
5937
5938
|
const providerSeamKey = "provider";
|
|
5939
|
+
function isLoopbackBridgeHost(hostname) {
|
|
5940
|
+
const host = hostname.trim().toLowerCase().replace(/^\[/, "").replace(/\]$/, "");
|
|
5941
|
+
if (host === "localhost" || host === "::1" || host === "0:0:0:0:0:0:0:1") return true;
|
|
5942
|
+
if (host === "::ffff:127.0.0.1") return true;
|
|
5943
|
+
return /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/u.test(host);
|
|
5944
|
+
}
|
|
5945
|
+
function isLoopbackBridgeUrl(value) {
|
|
5946
|
+
try {
|
|
5947
|
+
const target = new URL(value);
|
|
5948
|
+
return (target.protocol === "http:" || target.protocol === "https:") && isLoopbackBridgeHost(target.hostname);
|
|
5949
|
+
} catch {
|
|
5950
|
+
return false;
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5953
|
+
/** Validate and capture the non-serialisable credential service without reading its value. */
|
|
5954
|
+
function captureBridgeModelCredential(value, context) {
|
|
5955
|
+
if (value === null || typeof value !== "object") throw new ValidationError(`${context}: modelCredential must be an object`);
|
|
5956
|
+
assertExactConfigKeys(value, /* @__PURE__ */ new Set(["key", "provider"]), `${context} modelCredential`);
|
|
5957
|
+
if (typeof value.key !== "string" || value.key.trim().length === 0) throw new ValidationError(`${context}: modelCredential.key must be a non-empty string`);
|
|
5958
|
+
if (!value.provider || typeof value.provider.get !== "function") throw new ValidationError(`${context}: modelCredential.provider must implement get(name)`);
|
|
5959
|
+
const captured = { key: value.key };
|
|
5960
|
+
Object.defineProperty(captured, "provider", {
|
|
5961
|
+
configurable: false,
|
|
5962
|
+
enumerable: false,
|
|
5963
|
+
value: value.provider,
|
|
5964
|
+
writable: false
|
|
5965
|
+
});
|
|
5966
|
+
return Object.freeze(captured);
|
|
5967
|
+
}
|
|
5968
|
+
function validateBridgeModelCredential(value, bridgeUrl, context) {
|
|
5969
|
+
if (value === void 0) return void 0;
|
|
5970
|
+
if (!isLoopbackBridgeUrl(bridgeUrl)) throw new ValidationError(`${context}: modelCredential is allowed only for a loopback bridge URL`);
|
|
5971
|
+
return captureBridgeModelCredential(value, context);
|
|
5972
|
+
}
|
|
5973
|
+
/** Resolve only at the outbound boundary. Provider errors are redacted because they may contain
|
|
5974
|
+
* the protected value; diagnostics identify the key name, never the value or provider error. */
|
|
5975
|
+
async function resolveBridgeModelCredential(credential, context) {
|
|
5976
|
+
if (credential === void 0) return void 0;
|
|
5977
|
+
let value;
|
|
5978
|
+
try {
|
|
5979
|
+
value = await credential.provider.get(credential.key);
|
|
5980
|
+
} catch {
|
|
5981
|
+
throw new ValidationError(`${context}: modelCredential provider failed for '${credential.key}'`);
|
|
5982
|
+
}
|
|
5983
|
+
if (typeof value !== "string" || value.length === 0 || /[\r\n]/u.test(value)) throw new ValidationError(`${context}: modelCredential provider has no usable value for '${credential.key}'`);
|
|
5984
|
+
return value;
|
|
5985
|
+
}
|
|
5938
5986
|
/** Deterministic content hash for an `outRef`. FNV-1a 32-bit over the canonical
|
|
5939
5987
|
* JSON of the result — not cryptographic, sufficient for content-addressing the
|
|
5940
5988
|
* replay blob so two identical outputs collapse to one pointer. */
|
|
@@ -6882,11 +6930,13 @@ function bridgeProfileModel(profile, context) {
|
|
|
6882
6930
|
}
|
|
6883
6931
|
const bridgeExecutor = (spec, ctx) => {
|
|
6884
6932
|
const base = readSeam(ctx, bridgeSeamKey, "bridge");
|
|
6933
|
+
const modelCredential = validateBridgeModelCredential(base.modelCredential, base.bridgeUrl, "bridgeExecutor");
|
|
6885
6934
|
const effectiveProfile = agentProfileSchema.parse(spec.profile);
|
|
6886
6935
|
const model = bridgeProfileModel(effectiveProfile, "bridgeExecutor");
|
|
6887
6936
|
const profileExecution = profileModelExecutionSettings(effectiveProfile, "bridgeExecutor");
|
|
6888
6937
|
const seam = {
|
|
6889
6938
|
...base,
|
|
6939
|
+
...modelCredential === void 0 ? {} : { modelCredential },
|
|
6890
6940
|
model,
|
|
6891
6941
|
...profileExecution.maxTokens !== void 0 ? { maxTokens: profileExecution.maxTokens } : {}
|
|
6892
6942
|
};
|
|
@@ -7369,6 +7419,7 @@ async function* streamDurableBridgeRun(args) {
|
|
|
7369
7419
|
args.run.transportAttempts += 1;
|
|
7370
7420
|
res = await bridgeStreamPost(args.seam.bridgeUrl, {
|
|
7371
7421
|
bearer: args.seam.bridgeBearer,
|
|
7422
|
+
modelCredential: args.seam.modelCredential,
|
|
7372
7423
|
sessionId: args.sessionId,
|
|
7373
7424
|
runId: args.run.id,
|
|
7374
7425
|
afterEventId: args.run.lastEventId,
|
|
@@ -7378,6 +7429,7 @@ async function* streamDurableBridgeRun(args) {
|
|
|
7378
7429
|
});
|
|
7379
7430
|
} catch (error) {
|
|
7380
7431
|
if (args.signal.aborted) throw error;
|
|
7432
|
+
if (error instanceof ValidationError) throw error;
|
|
7381
7433
|
if (reconnects >= args.maxReconnects) throw new ValidationError(`bridgeExecutor: run ${args.run.id} disconnected before terminal acknowledgement after ${reconnects + 1} attempts: ${errorMessage(error)}`);
|
|
7382
7434
|
reconnects += 1;
|
|
7383
7435
|
continue;
|
|
@@ -7486,7 +7538,8 @@ async function assertBridgeExecutionCapabilities(seam, signal) {
|
|
|
7486
7538
|
* `IncomingMessage` (a Node `Readable`) is adapted to a web `ReadableStream` so the
|
|
7487
7539
|
* shared `parseSseChatStream` consumes it unchanged.
|
|
7488
7540
|
*/
|
|
7489
|
-
function bridgeStreamPost(url, args) {
|
|
7541
|
+
async function bridgeStreamPost(url, args) {
|
|
7542
|
+
const modelCredential = await resolveBridgeModelCredential(args.modelCredential, "bridgeExecutor");
|
|
7490
7543
|
const target = new URL(`${url.replace(/\/$/, "")}/v1/chat/completions`);
|
|
7491
7544
|
const payload = JSON.stringify(args.body);
|
|
7492
7545
|
const requestFn = target.protocol === "https:" ? request$1 : request;
|
|
@@ -7501,6 +7554,7 @@ function bridgeStreamPost(url, args) {
|
|
|
7501
7554
|
...args.traceHeaders,
|
|
7502
7555
|
"content-type": "application/json",
|
|
7503
7556
|
authorization: `Bearer ${args.bearer}`,
|
|
7557
|
+
...modelCredential === void 0 ? {} : { [bridgeModelCredentialHeader]: modelCredential },
|
|
7504
7558
|
"x-session-id": args.sessionId,
|
|
7505
7559
|
"x-run-id": args.runId,
|
|
7506
7560
|
...args.afterEventId > 0 ? { "last-event-id": String(args.afterEventId) } : {},
|
|
@@ -8376,7 +8430,7 @@ function snapshotExecutorConfig(config) {
|
|
|
8376
8430
|
})
|
|
8377
8431
|
});
|
|
8378
8432
|
}
|
|
8379
|
-
case "bridge":
|
|
8433
|
+
case "bridge": {
|
|
8380
8434
|
assertExactConfigKeys(config, /* @__PURE__ */ new Set([
|
|
8381
8435
|
"activityWindow",
|
|
8382
8436
|
"backend",
|
|
@@ -8384,10 +8438,18 @@ function snapshotExecutorConfig(config) {
|
|
|
8384
8438
|
"bridgeUrl",
|
|
8385
8439
|
"cwd",
|
|
8386
8440
|
"maxReconnects",
|
|
8441
|
+
"modelCredential",
|
|
8387
8442
|
"sessionId",
|
|
8388
8443
|
"timeoutMs"
|
|
8389
8444
|
]), "createExecutor bridge config");
|
|
8390
|
-
|
|
8445
|
+
const { modelCredential, ...decisionData } = config;
|
|
8446
|
+
const snapshot = detachedSnapshot(decisionData, "createExecutor bridge config");
|
|
8447
|
+
const capturedCredential = validateBridgeModelCredential(modelCredential, config.bridgeUrl, "createExecutor bridge config");
|
|
8448
|
+
return Object.freeze({
|
|
8449
|
+
...snapshot,
|
|
8450
|
+
...capturedCredential === void 0 ? {} : { modelCredential: capturedCredential }
|
|
8451
|
+
});
|
|
8452
|
+
}
|
|
8391
8453
|
case "cli": return detachedSnapshot(config, `createExecutor ${config.backend} config`);
|
|
8392
8454
|
}
|
|
8393
8455
|
}
|
|
@@ -12167,4 +12229,4 @@ function isNonEmptySpend(s) {
|
|
|
12167
12229
|
//#endregion
|
|
12168
12230
|
export { runAgentRounds as $, bindReusableExecutorExecutionId as A, createWorktree as At, workerTraceHeaders as B, controlProfileMaterialization as Bt, queueOf as C, createRuntimeStreamEventCollector as Ct, assertValidBudget as D, runSettledCommand as Dt, teardownExecutor as E, sanitizeRuntimeStreamEvent as Et, snapshotExecutorConfig as F, localHarnessExecutable as Ft, decodeToolPart as G, promptModelProfileMaterialization as Gt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as H, fullProfileMaterialization as Ht, createWorktreeCliExecutor as I, parseCodexTokenUsage as It, createActivityLog as J, renderProfileMaterializationIssues as Jt, sandboxSessionTraceSource as K, promptOnlyProfileMaterialization as Kt, WORKER_TRACE_PROPAGATION as L, CodexExecutionDiagnosticError as Lt, cliWorktreeExecutor as M, DEFAULT_LOCAL_HARNESS as Mt, createExecutor as N, LOCAL_HARNESSES as Nt, createBudgetPool as O, runWorktreeHarness as Ot, createExecutorRegistry as P, harnessSupportsReasoningEffort as Pt, defaultSelectWinner as Q, readWorkerTraceContext as R, AGENT_PROFILE_MATERIALIZATION_AXES as Rt, freeSlots as S, createRuntimeEventCollector as St, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as T, sanitizeKnowledgeReadinessReport as Tt, createSteerableSandboxSession as U, profileMaterializationAxes$1 as Ut, workerTraceSeamKey as V, defineProfileMaterializationContract as Vt, createPushTraceSource as W, promptControlProfileMaterialization as Wt, createInbox as X, validateProfileMaterialization as Xt, readWorkerProgress as Y, sandboxActProfileMaterialization as Yt, createSandboxForSpec as Z, worktreeCliProfileMaterialization as Zt, pollFor as _, generateSpanId as _t, pickBestDelivered as a, createPropagatingTraceEmitter as at, waitUntil as b, padTraceId as bt, driverChild as c, traceContextToEnv as ct, deriveNodeExecutionIdentity as d, buildLoopSpanNodes as dt, createSandboxLineage as et, recordScopeOwnerMaterialization as f, buildRuntimeEventOtelSpans as ft, isWaitOutcome as g, flatOtelSpan as gt, createWaitProbes as h, exportEvalRuns as ht, collectDelivered as i, runBrainLoop as it, captureReusableExecutorConfig as j, removeWorktree as jt, spendFromUsageEvents as k, captureWorktreeDiff as kt, withDriverExecutor as l, INTELLIGENCE_WIRE_VERSION as lt, settledToIteration as m, createOtelExporter as mt, createSupervisor as n, acquireSandbox as nt, runFinalizer as o, mergeTraceEnv as ot, scopeOwnerExecutorNodeContext as p, createOpenInferenceFileExporter as pt, DEFAULT_STALL_AFTER_MS as q, promptResourceProfileMaterialization as qt, bestDelivered as r, routerBrain as rt, runTree as s, readTraceContextFromEnv as st, createRootHandle as t, probeSandboxCapabilities as tt, createScope as u, buildLoopOtelSpans as ut, timerAt as v, loopEventToOtelSpan as vt, rollingDispatch as w, sanitizeAgentRuntimeEvent as wt, effectiveConcurrency as x, toOtelAttributes as xt, validateWaitSpec as y, padSpanId as yt, workerTraceEnv as z, assertProfileMaterialization as zt };
|
|
12169
12231
|
|
|
12170
|
-
//# sourceMappingURL=supervisor-
|
|
12232
|
+
//# sourceMappingURL=supervisor-Dr3AoSh0.js.map
|