@tangle-network/agent-runtime 10.0.9 → 10.0.11
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/CHANGELOG.md +24 -0
- package/dist/{activation-Gi19oho7.d.ts → activation-B9c5eSla.d.ts} +13 -5
- package/dist/{activation-D4hAza0W.js → activation-DikG4Nxq.js} +2 -2
- package/dist/{activation-D4hAza0W.js.map → activation-DikG4Nxq.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{delegate-C53pe9th.js → delegate-BEBd1qxi.js} +2 -2
- package/dist/{delegate-C53pe9th.js.map → delegate-BEBd1qxi.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-eETy7SAi.js → driver-control-acknowledgers-C80hsHbs.js} +23 -7
- package/dist/driver-control-acknowledgers-C80hsHbs.js.map +1 -0
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +4 -4
- package/dist/{graph-CRaquJhB.js → graph-BP927YH9.js} +6 -5
- package/dist/{graph-CRaquJhB.js.map → graph-BP927YH9.js.map} +1 -1
- package/dist/{graph-registry-CRskE_Yp.js → graph-registry-BmghD_VO.js} +5 -2
- package/dist/graph-registry-BmghD_VO.js.map +1 -0
- package/dist/{graph-registry-CGKyYabE.js → graph-registry-DQ2-dA0X.js} +1 -1
- package/dist/{improve-CEOS1Ijj.js → improve-CaYHi8P-.js} +55 -15
- package/dist/improve-CaYHi8P-.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +11 -11
- package/dist/{loop-runner-2vKhhbQA.js → loop-runner-9OJItBqr.js} +2 -2
- package/dist/{loop-runner-2vKhhbQA.js.map → loop-runner-9OJItBqr.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{loop-runner-CPxQyiWQ.d.ts → loop-runner-kGLe3PSM.d.ts} +2 -2
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +4 -4
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-CzKfUJIg.js → provision-supervisor-m_kRnNQf.js} +3 -3
- package/dist/{provision-supervisor-CzKfUJIg.js.map → provision-supervisor-m_kRnNQf.js.map} +1 -1
- package/dist/{run-state-Dbi2PVOt.js → run-state-Cd_Gvsjw.js} +2 -2
- package/dist/{run-state-Dbi2PVOt.js.map → run-state-Cd_Gvsjw.js.map} +1 -1
- package/dist/{runtime-CZ-VnOr5.js → runtime-CZc-cMrk.js} +13 -13
- package/dist/{runtime-CZ-VnOr5.js.map → runtime-CZc-cMrk.js.map} +1 -1
- package/dist/{search-executor-C0aVtzXX.js → search-executor-BHypQDeY.js} +2 -2
- package/dist/{search-executor-C0aVtzXX.js.map → search-executor-BHypQDeY.js.map} +1 -1
- package/dist/{server-BwpXzcpm.js → server-D7Mq2Bn1.js} +2 -2
- package/dist/{server-BwpXzcpm.js.map → server-D7Mq2Bn1.js.map} +1 -1
- package/dist/{structural-rollout-CKNwDl0T.js → structural-rollout-BfFEGl9Q.js} +2 -2
- package/dist/{structural-rollout-CKNwDl0T.js.map → structural-rollout-BfFEGl9Q.js.map} +1 -1
- package/dist/{supervise-CkIKRWDV.js → supervise-BX3fLhUS.js} +33 -33
- package/dist/supervise-BX3fLhUS.js.map +1 -0
- package/dist/{supervisor-CAQI8ILe.js → supervisor-CNE2g7Wz.js} +61 -10
- package/dist/supervisor-CNE2g7Wz.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-BYiwLO2L.d.ts → types-CTeyeXgz.d.ts} +12 -3
- package/package.json +2 -2
- package/skills/agent-graphs/SKILL.md +40 -50
- package/skills/be-ambitious/SKILL.md +29 -25
- package/skills/build-with-agent-runtime/SKILL.md +17 -20
- package/skills/graph-designer/SKILL.md +1 -1
- package/skills/profile-authoring/SKILL.md +16 -11
- package/dist/driver-control-acknowledgers-eETy7SAi.js.map +0 -1
- package/dist/graph-registry-CRskE_Yp.js.map +0 -1
- package/dist/improve-CEOS1Ijj.js.map +0 -1
- package/dist/supervise-CkIKRWDV.js.map +0 -1
- package/dist/supervisor-CAQI8ILe.js.map +0 -1
|
@@ -15,7 +15,7 @@ import { t as PROTOCOL_VERSION } from "./tool-server-Cb7LBW4e.js";
|
|
|
15
15
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-CsW2pfFk.js";
|
|
16
16
|
import { n as encodeResultBlob } from "./result-blob-store-BMMzqpHa.js";
|
|
17
17
|
import { a as recordRootReentered, c as rootMaterializationReceipt, i as changesRootProfile, l as rootStartedAtMs, o as recordRootSegment, r as assertRootIdentity, s as rootExecutionBindingReceipt, t as assertResumeContract } from "./supervisor-root-contract-Ca5xp0Vg.js";
|
|
18
|
-
import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentExactRunControlRefSchema, AgentFileOutputPolicySchema, AgentRetainedFilePublicationSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, REASONING_EFFORTS, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalWorkspaceCwd, harnessTypeSchema, mergeProxySecretBindings, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sameAgentRunControlRef, workspaceCwdPathForBase } from "@tangle-network/agent-interface";
|
|
18
|
+
import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentExactRunControlRefSchema, AgentFileOutputPolicySchema, AgentRetainedFilePublicationSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, REASONING_EFFORTS, WorkspaceCheckpointRefSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalWorkspaceCwd, harnessTypeSchema, mergeProxySecretBindings, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sameAgentRunControlRef, workspaceCwdPathForBase } from "@tangle-network/agent-interface";
|
|
19
19
|
import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
|
|
20
20
|
import { SDKError, generateIdempotencyKey, isRecord, withRetry } from "@tangle-network/agent-core";
|
|
21
21
|
import { collectAgentFinalMessageText, collectAgentResponseText, isToolBearingEvent } from "@tangle-network/sandbox";
|
|
@@ -7301,7 +7301,42 @@ const cliInPlaceExecutor = (spec, ctx) => {
|
|
|
7301
7301
|
// src/runtime/provider-placement.ts
|
|
7302
7302
|
const placementMetadataKey = "runtimeProviderPlacement";
|
|
7303
7303
|
/** Select exactly one declaration before any provider effects. Shared defaults carry infrastructure only. */
|
|
7304
|
-
function selectProviderPlacement(profile, options) {
|
|
7304
|
+
function selectProviderPlacement(profile, options, node) {
|
|
7305
|
+
const placed = declaredPlacement(profile, options);
|
|
7306
|
+
if (options.checkpointForNode === void 0) return placed;
|
|
7307
|
+
if (!node) throw new ValidationError$1("checkpointForNode requires a supervised node");
|
|
7308
|
+
const value = options.checkpointForNode(detachedSnapshot(node, "checkpointForNode assignment"));
|
|
7309
|
+
if (value === void 0) return placed;
|
|
7310
|
+
const checkpoint = WorkspaceCheckpointRefSchema.parse(value);
|
|
7311
|
+
const defaults = placed.options.defaults ?? {};
|
|
7312
|
+
if (defaults.workspace?.checkpoint && canonicalCandidateDigest(defaults.workspace.checkpoint) !== canonicalCandidateDigest(checkpoint)) throw new ValidationError$1("checkpointForNode disagrees with the declared workspace checkpoint");
|
|
7313
|
+
if (!placed.identity && Object.hasOwn(defaults.metadata ?? {}, placementMetadataKey)) throw new ValidationError$1("checkpointForNode: reserved placement metadata key");
|
|
7314
|
+
const identity = {
|
|
7315
|
+
id: placed.identity?.id ?? "node-workspace",
|
|
7316
|
+
digest: canonicalCandidateDigest({
|
|
7317
|
+
placement: placed.identity ?? null,
|
|
7318
|
+
checkpoint
|
|
7319
|
+
})
|
|
7320
|
+
};
|
|
7321
|
+
return {
|
|
7322
|
+
options: {
|
|
7323
|
+
...placed.options,
|
|
7324
|
+
defaults: {
|
|
7325
|
+
...defaults,
|
|
7326
|
+
workspace: {
|
|
7327
|
+
...defaults.workspace,
|
|
7328
|
+
checkpoint
|
|
7329
|
+
},
|
|
7330
|
+
metadata: {
|
|
7331
|
+
...defaults.metadata,
|
|
7332
|
+
[placementMetadataKey]: identity
|
|
7333
|
+
}
|
|
7334
|
+
}
|
|
7335
|
+
},
|
|
7336
|
+
identity
|
|
7337
|
+
};
|
|
7338
|
+
}
|
|
7339
|
+
function declaredPlacement(profile, options) {
|
|
7305
7340
|
if (options.placements === void 0) return { options };
|
|
7306
7341
|
if (options.defaults?.backend !== void 0 || options.defaults?.secrets !== void 0 || options.promptOptions !== void 0) throw new ValidationError$1("provider placements: backend, secrets and promptOptions belong in each placement");
|
|
7307
7342
|
for (const key of [
|
|
@@ -8111,9 +8146,9 @@ var RetainedObservation = class {
|
|
|
8111
8146
|
let firstFailure;
|
|
8112
8147
|
while (true) {
|
|
8113
8148
|
this.lastObservedAt = Date.now();
|
|
8114
|
-
if ((yield* this.drain(session, replayedFrom
|
|
8149
|
+
if ((yield* this.drain(session, replayedFrom)) || this.sawTerminal) break;
|
|
8115
8150
|
firstFailure ??= this.failure;
|
|
8116
|
-
if (!await this.restart.retry(this.failure?.error) &&
|
|
8151
|
+
if (!await this.restart.retry(this.failure?.error) && !this.canReplayAfter(replayedFrom)) {
|
|
8117
8152
|
this.failure = firstFailure;
|
|
8118
8153
|
break;
|
|
8119
8154
|
}
|
|
@@ -8130,6 +8165,9 @@ var RetainedObservation = class {
|
|
|
8130
8165
|
while (!await this.exactOrQuiet()) await this.stopQuietObservation();
|
|
8131
8166
|
yield await this.resultFrame();
|
|
8132
8167
|
}
|
|
8168
|
+
canReplayAfter(replayedFrom) {
|
|
8169
|
+
return this.lastReplayPosition !== void 0 && this.lastReplayPosition !== replayedFrom;
|
|
8170
|
+
}
|
|
8133
8171
|
exactOrQuiet() {
|
|
8134
8172
|
let unwatch = [() => {}];
|
|
8135
8173
|
return new Promise((resolve) => {
|
|
@@ -8315,8 +8353,9 @@ var RetainedObservation = class {
|
|
|
8315
8353
|
this.readExactResult();
|
|
8316
8354
|
return true;
|
|
8317
8355
|
}
|
|
8318
|
-
async *drain(session,
|
|
8356
|
+
async *drain(session, replayedFrom) {
|
|
8319
8357
|
const subscription = linkAbort(this.signal);
|
|
8358
|
+
const since = replayedFrom ?? this.resumedFrom;
|
|
8320
8359
|
let iterator;
|
|
8321
8360
|
try {
|
|
8322
8361
|
iterator = session.events({
|
|
@@ -8347,7 +8386,15 @@ var RetainedObservation = class {
|
|
|
8347
8386
|
return false;
|
|
8348
8387
|
}
|
|
8349
8388
|
if (observed.kind === "quiet") {
|
|
8350
|
-
|
|
8389
|
+
const awaiting = this.silenceHandledAt !== void 0;
|
|
8390
|
+
if (!awaiting) {
|
|
8391
|
+
yield this.awaitingResult(this.lastObservedAt);
|
|
8392
|
+
this.lastObservedAt = Date.now();
|
|
8393
|
+
}
|
|
8394
|
+
if (!this.canReplayAfter(replayedFrom)) {
|
|
8395
|
+
if (awaiting) await this.stopQuietObservation();
|
|
8396
|
+
continue;
|
|
8397
|
+
}
|
|
8351
8398
|
this.failure ??= { error: streamFailure("retained provider stream stalled before its exact result") };
|
|
8352
8399
|
return false;
|
|
8353
8400
|
}
|
|
@@ -10198,7 +10245,7 @@ function providerAsExecutor(provider, options = {}) {
|
|
|
10198
10245
|
};
|
|
10199
10246
|
return (spec, ctx) => {
|
|
10200
10247
|
const profile = captured.placements === void 0 ? spec.profile : detachedSnapshot(spec.profile, "provider placement profile");
|
|
10201
|
-
const selected = selectProviderPlacement(profile, captured);
|
|
10248
|
+
const selected = selectProviderPlacement(profile, captured, ctx.node);
|
|
10202
10249
|
return createProviderExecutor(provider, profile, ctx, selected.options, selected.identity);
|
|
10203
10250
|
};
|
|
10204
10251
|
}
|
|
@@ -14580,7 +14627,9 @@ function snapshotExecutorConfig(config, mode = "execution") {
|
|
|
14580
14627
|
if (config.outputFile !== void 0 && config.shared !== void 0) throw new ValidationError$1("createExecutor(provider): file output requires a dedicated retained environment");
|
|
14581
14628
|
if ((config.outputFormat ?? config.outputFile) !== void 0 && config.steering !== void 0) throw new ValidationError$1("createExecutor(provider): JSON output is not supported with steering");
|
|
14582
14629
|
if (config.harnessTranscript !== void 0 && config.steering !== void 0) throw new ValidationError$1("createExecutor(provider): native capture is not supported with steering");
|
|
14583
|
-
const { provider, registry, profileForCreate, taskToTurn, validator, harnessTranscript, shared, ...decisionData } = config;
|
|
14630
|
+
const { provider, registry, profileForCreate, checkpointForNode, taskToTurn, validator, harnessTranscript, shared, ...decisionData } = config;
|
|
14631
|
+
if (checkpointForNode !== void 0 && typeof checkpointForNode !== "function") throw new ValidationError$1("createExecutor provider: checkpointForNode must be a function");
|
|
14632
|
+
if (shared !== void 0 && checkpointForNode !== void 0) throw new ValidationError$1("createExecutor provider: a per-node checkpoint requires a dedicated environment");
|
|
14584
14633
|
if (harnessTranscript !== void 0 && typeof harnessTranscript !== "function") throw new ValidationError$1("createExecutor provider: harnessTranscript must be a capture function");
|
|
14585
14634
|
if (shared !== void 0 && (decisionData.steering !== void 0 || decisionData.placements !== void 0)) throw new ValidationError$1("createExecutor(provider): shared placement cannot combine with steering or placements");
|
|
14586
14635
|
const snapshot = detachedSnapshot(decisionData, "createExecutor provider config");
|
|
@@ -14590,6 +14639,7 @@ function snapshotExecutorConfig(config, mode = "execution") {
|
|
|
14590
14639
|
provider: resolvedProvider,
|
|
14591
14640
|
...profileForCreate === void 0 ? {} : { profileForCreate },
|
|
14592
14641
|
...taskToTurn === void 0 ? {} : { taskToTurn },
|
|
14642
|
+
...checkpointForNode === void 0 ? {} : { checkpointForNode },
|
|
14593
14643
|
...validator === void 0 ? {} : { validator },
|
|
14594
14644
|
...harnessTranscript === void 0 ? {} : { harnessTranscript },
|
|
14595
14645
|
...shared === void 0 ? {} : { shared }
|
|
@@ -14735,7 +14785,7 @@ function createExecutor(config) {
|
|
|
14735
14785
|
...providerOutputOptions(spec.profile, declared)
|
|
14736
14786
|
};
|
|
14737
14787
|
if (originalSeam.outputFile !== void 0 && (originalSeam.steering !== void 0 || originalSeam.shared !== void 0)) throw new ValidationError$1("profile outputFile requires a dedicated retained provider without steering");
|
|
14738
|
-
const selected = originalSeam.steering ? selectProviderPlacement(spec.profile, originalSeam) : void 0;
|
|
14788
|
+
const selected = originalSeam.steering ? selectProviderPlacement(spec.profile, originalSeam, seamed.node) : void 0;
|
|
14739
14789
|
const providerSeam = selected?.options ?? originalSeam;
|
|
14740
14790
|
const provider = resolveAgentEnvironmentProvider(providerSeam.provider, providerSeam.registry);
|
|
14741
14791
|
if (providerSeam.steering) {
|
|
@@ -15414,6 +15464,7 @@ const bestDelivered = (ctx) => pickBestDelivered(ctx.delivered)?.out;
|
|
|
15414
15464
|
* oracle surfaces a validation error. Neither changes child validity.
|
|
15415
15465
|
*/
|
|
15416
15466
|
async function runFinalizer(finalizer, args) {
|
|
15467
|
+
if (args.deliverable?.requireSubmission) return void 0;
|
|
15417
15468
|
const deliveredRows = args.settled.filter((w) => w.status === "done" && w.valid === true);
|
|
15418
15469
|
const deliveredRefs = /* @__PURE__ */ new Set();
|
|
15419
15470
|
for (const w of deliveredRows) if (w.outRef !== void 0) deliveredRefs.add(w.outRef);
|
|
@@ -16586,4 +16637,4 @@ async function noWinner(settled, rejection) {
|
|
|
16586
16637
|
}
|
|
16587
16638
|
export { failPendingAfter as $, worktreeCliProfileMaterialization as $t, readPromptOptions as A, readCodexRolloutSession as At, toolResultText as B, terminateProcessTreeAndConfirm as Bt, captureReusableExecutorConfig as C, bridgeAdmissionRefusal as Ct, createSteerableSandboxSession as D, addHarnessUsage as Dt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as E, ROUTER_PRICE_SOURCE as Et, defaultSelectWinner as F, defaultRunCommand as Ft, providerAsExecutor as G, fullProfileMaterialization as Gt, routerBrain as H, assertProfileMaterializes as Ht, codeModeArguments as I, runSettledCommand as It, providerAsSandboxClient as J, promptModelProfileMaterialization as Jt, providerOutputOptions as K, profileMaterializationAxes$1 as Kt, codeModeModelOutput as L, runWorktreeHarness as Lt, createSandboxLineage as M, bridgeRuntimeAttachmentsKey as Mt, acquireSandbox as N, bridgeRuntimeEnvKey as Nt, runAgentRounds as O, createCodexRolloutStoreReader as Ot, TERMINAL_DECISIONS as P, bridgeStopSignalKey as Pt, createInbox as Q, unsupportedProfileDimensions as Qt, createCodeModeTools as R, LOCAL_HARNESSES as Rt, bindReusableExecutorExecutionId as S, verdictFromJudgeScore as St, snapshotExecutorConfig as T, priceTokens as Tt, createAgentEnvironmentProviderRegistry as U, controlProfileMaterialization as Ut, createRouterTranscript as V, assertProfileMaterialization as Vt, resolveAgentEnvironmentProvider as W, defineProfileMaterializationContract as Wt, createInPlaceCliExecutor as X, sandboxActProfileMaterialization as Xt, createWorktreeCliExecutor as Y, renderUnsupported as Yt, INBOX_RECEIPT_KEY as Z, sandboxProfileMaterialization as Zt, isDriverSpec as _, preflightPublicCoordination as _t, awaitRootWake as a, isPeerMailEnvelope as at, InMemorySpawnJournal as b, gateOnDeliverable as bt, readRunParking as c, taskToPrompt$1 as ct, bestDelivered as d, abandonablePending as dt, projectSandboxOutcome as en, AUTHORITY_MARKERS as et, runFinalizer as f, classifyDriverFailure as ft, driverExecutorFactory as g, upstreamUnavailableSignal as gt, driverChild as h, undispatchedCredentialExit as ht, assertRunParking as i, createPeerMailbox as it, createSandboxForSpec as j, createPushTraceSource as jt, assertBoxlessPromptOptions as k, harnessUsageIsEmpty as kt, sleepScopeWait as l, DriverAttemptsExhaustedError as lt, createRootHandle as m, transientFailureKind as mt, createSupervisor as n, PEER_MAIL_WIRE_KEY as nt, bindScopeParkingDrain as o, peerMailTools as ot, runTree as p, summarizeDriverAttempts as pt, LEAF_CONTINUATION_TASK as q, promptControlProfileMaterialization as qt, RunParkedError as r, claimsAuthority as rt, isRunParked as s, peerMailVerbNames as st, DEFAULT_MAX_DEPTH as t, readSandboxOutcome as tn, DEFAULT_PEER_MAIL_LIMITS as tt, withRunParking as u, HarnessTurnFailedError as ut, withDriverExecutor as v, CheckUnavailableError as vt, createExecutor as w, bridgeModelRouteRefusal as wt, createExecutorRegistry as x, mapExecutorResult as xt, InMemoryResultBlobStore as y, gateFactoryOnDeliverable as yt, runCodeMode as z, harnessInvocation as zt };
|
|
16588
16639
|
|
|
16589
|
-
//# sourceMappingURL=supervisor-
|
|
16640
|
+
//# sourceMappingURL=supervisor-CNE2g7Wz.js.map
|