@tangle-network/agent-runtime 0.348.1 → 0.350.2
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-BEGalhOL.js → activation-CfJMyzEs.js} +12 -14
- package/dist/{activation-BEGalhOL.js.map → activation-CfJMyzEs.js.map} +1 -1
- package/dist/{activation-NQZP_mdI.d.ts → activation-DyiHrTlS.d.ts} +2 -24
- package/dist/agent.d.ts +8 -12
- package/dist/agent.js +9 -12
- package/dist/agent.js.map +1 -1
- package/dist/{analyst-loop-DZw5QWT9.js → analyst-loop-BZvXCDKy.js} +2 -3
- package/dist/{analyst-loop-DZw5QWT9.js.map → analyst-loop-BZvXCDKy.js.map} +1 -1
- package/dist/analyst-loop.d.ts +3 -5
- package/dist/analyst-loop.js +1 -2
- package/dist/{bundle-DKQtOO9d.js → bundle-Ze8pd07a.js} +3 -4
- package/dist/{bundle-DKQtOO9d.js.map → bundle-Ze8pd07a.js.map} +1 -1
- package/dist/candidate-execution/index.d.ts +13 -33
- package/dist/candidate-execution/index.js +16 -18
- package/dist/candidate-execution/index.js.map +1 -1
- package/dist/{coordination-manager-Bm6leXc6.js → coordination-manager-BkVfWlMz.js} +101 -132
- package/dist/coordination-manager-BkVfWlMz.js.map +1 -0
- package/dist/{delegate-Cp5-PsaX.js → delegate-DgEie4ad.js} +19 -21
- package/dist/delegate-DgEie4ad.js.map +1 -0
- package/dist/durable.d.ts +13 -23
- package/dist/durable.js +48 -43
- package/dist/durable.js.map +1 -1
- package/dist/{errors-DodWX-cb.js → errors-wuhGvpE3.js} +2 -3
- package/dist/{errors-DodWX-cb.js.map → errors-wuhGvpE3.js.map} +1 -1
- package/dist/{graph-CE_pzU31.js → graph-Cx0FhKSE.js} +192 -15
- package/dist/graph-Cx0FhKSE.js.map +1 -0
- package/dist/{improve-wT11zteg.js → improve-i0HU1-aa.js} +35 -53
- package/dist/{improve-wT11zteg.js.map → improve-i0HU1-aa.js.map} +1 -1
- package/dist/{improvement-adapter-sIthWkcN.d.ts → improvement-adapter-D5GRU1eY.d.ts} +2 -6
- package/dist/index.d.ts +41 -89
- package/dist/index.js +43 -61
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +39 -59
- package/dist/intelligence.js +23 -33
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +5 -5
- package/dist/kernel.js +11 -11
- package/dist/{loop-runner-CZzeeJTG.js → loop-runner-BwN9MhdP.js} +5 -6
- package/dist/{loop-runner-CZzeeJTG.js.map → loop-runner-BwN9MhdP.js.map} +1 -1
- package/dist/{loop-runner-CY5HHhtR.d.ts → loop-runner-DvfOXVx9.d.ts} +3 -5
- package/dist/loop-runner-bin.d.ts +5 -8
- package/dist/loop-runner-bin.js +2 -3
- package/dist/mcp/bin.js +6 -8
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +8 -18
- package/dist/mcp/index.js +17 -25
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-bin.js +4 -6
- package/dist/mcp/memory-bin.js.map +1 -1
- package/dist/{model-policy-CyCUwHed.js → model-policy-GSxWwP-b.js} +11 -13
- package/dist/model-policy-GSxWwP-b.js.map +1 -0
- package/dist/placement.d.ts +12 -14
- package/dist/placement.js +1 -2
- package/dist/platform.d.ts +7 -13
- package/dist/platform.js +3 -6
- package/dist/platform.js.map +1 -1
- package/dist/{prepare-TEEHSJwq.js → prepare-DE8TQnLu.js} +49 -69
- package/dist/{prepare-TEEHSJwq.js.map → prepare-DE8TQnLu.js.map} +1 -1
- package/dist/{profile-6OLpbjvV.js → profile-CAhZDW2T.js} +58 -92
- package/dist/profile-CAhZDW2T.js.map +1 -0
- package/dist/{profile-materialization-bPm0gGLO.d.ts → profile-materialization-BRY22Oh8.d.ts} +1 -3
- package/dist/profiles.d.ts +25 -12
- package/dist/profiles.js +52 -11
- package/dist/profiles.js.map +1 -1
- package/dist/{protected-model-port-DVVh-hEk.d.ts → protected-model-port-IKqhTypD.d.ts} +2 -14
- package/dist/{protected-redaction-DFCeo4vg.js → protected-redaction-DilFZch5.js} +2 -3
- package/dist/{protected-redaction-DFCeo4vg.js.map → protected-redaction-DilFZch5.js.map} +1 -1
- package/dist/{provision-supervisor-CC0HdOHo.js → provision-supervisor-Bde_FF0R.js} +11 -15
- package/dist/{provision-supervisor-CC0HdOHo.js.map → provision-supervisor-Bde_FF0R.js.map} +1 -1
- package/dist/{record-events-D93DkpAx.js → record-events-B2GUgYdz.js} +12 -14
- package/dist/{record-events-D93DkpAx.js.map → record-events-B2GUgYdz.js.map} +1 -1
- package/dist/{run-cancellation-CzFhQGMa.js → run-cancellation-BLy_Zz-w.js} +6 -7
- package/dist/{run-cancellation-CzFhQGMa.js.map → run-cancellation-BLy_Zz-w.js.map} +1 -1
- package/dist/{runtime-B_40dXlF.js → runtime-6Ec9sHRe.js} +833 -215
- package/dist/runtime-6Ec9sHRe.js.map +1 -0
- package/dist/{runtime-hooks-tXpAarhW.js → runtime-hooks-CsW2pfFk.js} +2 -3
- package/dist/{runtime-hooks-tXpAarhW.js.map → runtime-hooks-CsW2pfFk.js.map} +1 -1
- package/dist/{runtime-hooks-nsqxSUFL.d.ts → runtime-hooks-ZQqPw-0g.d.ts} +1 -3
- package/dist/{sandbox-profile-compat-_fEtHPCj.js → sandbox-profile-compat-BxMQ1VXv.js} +62 -44
- package/dist/sandbox-profile-compat-BxMQ1VXv.js.map +1 -0
- package/dist/{search-executor-COd2F2wp.js → search-executor-B7g_5Wjl.js} +12 -17
- package/dist/search-executor-B7g_5Wjl.js.map +1 -0
- package/dist/{server-BGB4R4wQ.js → server-fvEMwGMQ.js} +19 -30
- package/dist/{server-BGB4R4wQ.js.map → server-fvEMwGMQ.js.map} +1 -1
- package/dist/{structural-rollout-Wl_rCuzM.js → structural-rollout-B86bSixU.js} +69 -70
- package/dist/structural-rollout-B86bSixU.js.map +1 -0
- package/dist/{substrate-CGDFTSRh.js → substrate-Db2pp6y3.js} +2 -3
- package/dist/{substrate-CGDFTSRh.js.map → substrate-Db2pp6y3.js.map} +1 -1
- package/dist/{supervise-BUOeThuB.js → supervise-CaeZcgAW.js} +615 -203
- package/dist/supervise-CaeZcgAW.js.map +1 -0
- package/dist/{supervisor-DDy0aEtR.js → supervisor-C1OePYE-.js} +526 -642
- package/dist/supervisor-C1OePYE-.js.map +1 -0
- package/dist/{task-queue-0fKkoweu.d.ts → task-queue-kefGy79U.d.ts} +1 -3
- package/dist/task-queue.d.ts +1 -1
- package/dist/task-queue.js +1 -2
- package/dist/testing.d.ts +8 -16
- package/dist/testing.js +241 -244
- package/dist/testing.js.map +1 -1
- package/dist/tool-loop.d.ts +16 -19
- package/dist/tool-loop.js +2 -3
- package/dist/{tool-server-XV4aJwoQ.js → tool-server-CwuYeW_Z.js} +3 -4
- package/dist/{tool-server-XV4aJwoQ.js.map → tool-server-CwuYeW_Z.js.map} +1 -1
- package/dist/{top-snapshot-CflmaDgk.js → top-snapshot-ChwpTr7A.js} +4 -5
- package/dist/{top-snapshot-CflmaDgk.js.map → top-snapshot-ChwpTr7A.js.map} +1 -1
- package/dist/tui/bin.js +7 -9
- package/dist/tui/bin.js.map +1 -1
- package/dist/tui/index.d.ts +3 -5
- package/dist/tui/index.js +2 -2
- package/dist/{types-hc4cmSc7.d.ts → types-Fowuwdz2.d.ts} +555 -503
- package/dist/{types-Cwrea-bU.d.ts → types-qsqfyQoY.d.ts} +1 -3
- package/dist/workspace-store/index.d.ts +12 -22
- package/dist/workspace-store/index.js +4 -7
- package/dist/workspace-store/index.js.map +1 -1
- package/dist/{workspace-streams-BiS4ABah.d.ts → workspace-streams-Dq2Fzk3c.d.ts} +1 -11
- package/package.json +25 -25
- package/skills/agent-graphs/SKILL.md +19 -4
- package/skills/be-ambitious/SKILL.md +46 -0
- package/skills/graph-designer/SKILL.md +15 -2
- package/skills/profile-authoring/SKILL.md +1 -1
- package/dist/coordination-manager-Bm6leXc6.js.map +0 -1
- package/dist/delegate-Cp5-PsaX.js.map +0 -1
- package/dist/graph-CE_pzU31.js.map +0 -1
- package/dist/model-policy-CyCUwHed.js.map +0 -1
- package/dist/profile-6OLpbjvV.js.map +0 -1
- package/dist/runtime-B_40dXlF.js.map +0 -1
- package/dist/sandbox-profile-compat-_fEtHPCj.js.map +0 -1
- package/dist/search-executor-COd2F2wp.js.map +0 -1
- package/dist/structural-rollout-Wl_rCuzM.js.map +0 -1
- package/dist/supervise-BUOeThuB.js.map +0 -1
- package/dist/supervisor-DDy0aEtR.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Dn as loopEventToOtelSpan, Er as ROUTER_PRICE_SOURCE, Mn as createRuntimeStreamEventCollector, Nn as sanitizeKnowledgeReadinessReport, On as padSpanId, Pn as sanitizeRuntimeStreamEvent,
|
|
2
|
-
import { a as JudgeError, f as RuntimeRunStateError, i as ConfigError, m as ValidationError, o as NotFoundError, r as BackendTransportError, t as AgentEvalError } from "./errors-
|
|
3
|
-
import { B as InMemoryRuntimeSessionStore, C as optimizerMethod, H as nowIso, I as streamAgentTurn, L as createIterableBackend, R as createSandboxPromptBackend, U as startOrResumeRuntimeSession, V as newRuntimeSession, W as touchSession, z as normalizeBackendStreamEvent } from "./structural-rollout-
|
|
4
|
-
import { L as embeddedCandidateArtifact, N as canonicalCandidateBytes$1, P as canonicalCandidateDigest$1, R as immutableCandidateValue, b as persistCandidateOutputArtifact, l as captureAgentCandidateWorkspace,
|
|
5
|
-
import { t as assertExecutableAgentProfile } from "./model-policy-
|
|
6
|
-
import { c as withMethodRuntimeControls, d as commandVerifier, f as addRuntimeUsage, i as assertCandidateValidator, m as isUsageAmount, n as createCommandProfileTrainer, o as parseExecutionRef, p as createRuntimeUsageTotals, r as searchMethod, s as privateValuePaths, t as improve, u as agenticGenerator } from "./improve-
|
|
7
|
-
import { n as defineRuntimeHooks, t as composeRuntimeHooks } from "./runtime-hooks-
|
|
8
|
-
import { n as createAgentImprovementActivationResult } from "./activation-
|
|
9
|
-
import { l as sharedBoxLane, o as routerLane, r as dedicatedLane, t as SearchEnvironmentFault, u as subscriptionLane, y as decideSearchImprovement } from "./search-executor-
|
|
10
|
-
import { t as sealAgentCandidateBundle } from "./bundle-
|
|
11
|
-
import { t as supervise } from "./supervise-
|
|
12
|
-
import { n as auditLoopRunner } from "./loop-runner-
|
|
1
|
+
import { Dn as loopEventToOtelSpan, Ei as runtimeFailureCause, Er as ROUTER_PRICE_SOURCE, Mn as createRuntimeStreamEventCollector, Nn as sanitizeKnowledgeReadinessReport, On as padSpanId, Pn as sanitizeRuntimeStreamEvent, Qi as resolveRedactor, Si as executableAgentProfileSnapshot, Tr as priceTokens, Zi as defaultRedactorIdentityMaterial, bn as buildLoopOtelSpans, jn as createRuntimeEventCollector, kn as padTraceId, pa as providerMessageText, wn as createOtelExporter } from "./supervisor-C1OePYE-.js";
|
|
2
|
+
import { a as JudgeError, f as RuntimeRunStateError, i as ConfigError, m as ValidationError, o as NotFoundError, r as BackendTransportError, t as AgentEvalError } from "./errors-wuhGvpE3.js";
|
|
3
|
+
import { B as InMemoryRuntimeSessionStore, C as optimizerMethod, H as nowIso, I as streamAgentTurn, L as createIterableBackend, R as createSandboxPromptBackend, U as startOrResumeRuntimeSession, V as newRuntimeSession, W as touchSession, z as normalizeBackendStreamEvent } from "./structural-rollout-B86bSixU.js";
|
|
4
|
+
import { L as embeddedCandidateArtifact, N as canonicalCandidateBytes$1, P as canonicalCandidateDigest$1, R as immutableCandidateValue, b as persistCandidateOutputArtifact, l as captureAgentCandidateWorkspace, st as sleep, z as omitTopLevelDigest } from "./sandbox-profile-compat-BxMQ1VXv.js";
|
|
5
|
+
import { t as assertExecutableAgentProfile } from "./model-policy-GSxWwP-b.js";
|
|
6
|
+
import { c as withMethodRuntimeControls, d as commandVerifier, f as addRuntimeUsage, i as assertCandidateValidator, m as isUsageAmount, n as createCommandProfileTrainer, o as parseExecutionRef, p as createRuntimeUsageTotals, r as searchMethod, s as privateValuePaths, t as improve, u as agenticGenerator } from "./improve-i0HU1-aa.js";
|
|
7
|
+
import { n as defineRuntimeHooks, t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
|
|
8
|
+
import { n as createAgentImprovementActivationResult } from "./activation-CfJMyzEs.js";
|
|
9
|
+
import { l as sharedBoxLane, o as routerLane, r as dedicatedLane, t as SearchEnvironmentFault, u as subscriptionLane, y as decideSearchImprovement } from "./search-executor-B7g_5Wjl.js";
|
|
10
|
+
import { t as sealAgentCandidateBundle } from "./bundle-Ze8pd07a.js";
|
|
11
|
+
import { t as supervise } from "./supervise-CaeZcgAW.js";
|
|
12
|
+
import { n as auditLoopRunner } from "./loop-runner-BwN9MhdP.js";
|
|
13
13
|
import { agentCandidateKnowledgeSchema, agentCandidateWorkspaceManifestMaterialSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256DigestSchema } from "@tangle-network/agent-interface";
|
|
14
14
|
import { FAILURE_CLASSES, acquisitionPlansForKnowledgeGaps, blockingKnowledgeEval, canonicalJson, runAgentControlLoop, scoreKnowledgeReadiness, userQuestionsForKnowledgeGaps } from "@tangle-network/agent-eval";
|
|
15
15
|
import { z } from "zod";
|
|
@@ -20,7 +20,7 @@ import { spawnSync } from "node:child_process";
|
|
|
20
20
|
import { realpath } from "node:fs/promises";
|
|
21
21
|
import { gepaOptimizationMethod, skillOptOptimizationMethod } from "@tangle-network/agent-eval/campaign";
|
|
22
22
|
import { evaluateKnowledgeBaseReadiness, fromAgentCandidateKnowledgeRef, improveKnowledgeBase, knowledgeImprovementCandidateRef, loadKnowledgeImprovementActivationResult, normalizeKnowledgeStateScope, promoteKnowledgeCandidate, restoreKnowledgeCandidateBaseline, toAgentCandidateKnowledgeRef, withKnowledgeImprovementComparison } from "@tangle-network/agent-knowledge";
|
|
23
|
-
|
|
23
|
+
// src/runtime/profile-execution-backend.ts
|
|
24
24
|
/**
|
|
25
25
|
* Bind one exact profile and Runtime executor to the stable `AgentExecutionBackend` contract used
|
|
26
26
|
* by `runAgentTaskStream` and conversations.
|
|
@@ -100,8 +100,7 @@ function rebindEvent(event, context) {
|
|
|
100
100
|
session: context.session
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
//#region src/conversation/headers.ts
|
|
103
|
+
// src/conversation/headers.ts
|
|
105
104
|
/**
|
|
106
105
|
*
|
|
107
106
|
* Cross-gateway forwarding headers — the wire-level contract that makes
|
|
@@ -179,8 +178,7 @@ function pickHeader(headers, name) {
|
|
|
179
178
|
return value;
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
|
-
|
|
183
|
-
//#region src/conversation/call-policy.ts
|
|
181
|
+
// src/conversation/call-policy.ts
|
|
184
182
|
/** Thrown when the circuit breaker is open for a participant and no retry is allowed yet. */
|
|
185
183
|
var CircuitOpenError = class extends Error {
|
|
186
184
|
constructor(participant, retryAfterMs) {
|
|
@@ -252,11 +250,13 @@ function makePerAttemptSignal(parentSignal, deadlineMs) {
|
|
|
252
250
|
const controller = new AbortController();
|
|
253
251
|
let deadlineError;
|
|
254
252
|
const cleanups = [];
|
|
255
|
-
if (parentSignal)
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
253
|
+
if (parentSignal) {
|
|
254
|
+
if (parentSignal.aborted) controller.abort(parentSignal.reason);
|
|
255
|
+
else {
|
|
256
|
+
const onAbort = () => controller.abort(parentSignal.reason);
|
|
257
|
+
parentSignal.addEventListener("abort", onAbort, { once: true });
|
|
258
|
+
cleanups.push(() => parentSignal.removeEventListener("abort", onAbort));
|
|
259
|
+
}
|
|
260
260
|
}
|
|
261
261
|
if (deadlineMs !== void 0) {
|
|
262
262
|
const ms = deadlineMs;
|
|
@@ -286,8 +286,7 @@ function computeBackoff(spec, attempt) {
|
|
|
286
286
|
if (typeof spec === "function") return Math.max(0, spec(attempt));
|
|
287
287
|
return Math.max(0, spec);
|
|
288
288
|
}
|
|
289
|
-
|
|
290
|
-
//#region src/conversation/turn-id.ts
|
|
289
|
+
// src/conversation/turn-id.ts
|
|
291
290
|
/**
|
|
292
291
|
*
|
|
293
292
|
* Deterministic turn identifier. Stable across retries of the same logical
|
|
@@ -313,8 +312,7 @@ function turnId(runId, index, speaker) {
|
|
|
313
312
|
function slugifySpeaker(speaker) {
|
|
314
313
|
return speaker.normalize("NFKD").replace(/[^\w-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").toLowerCase() || "anon";
|
|
315
314
|
}
|
|
316
|
-
|
|
317
|
-
//#region src/conversation/run-conversation.ts
|
|
315
|
+
// src/conversation/run-conversation.ts
|
|
318
316
|
/** Run a conversation to completion and return its terminal result. */
|
|
319
317
|
async function runConversation(conversation, options) {
|
|
320
318
|
let result;
|
|
@@ -755,8 +753,7 @@ function passingReadiness(taskId) {
|
|
|
755
753
|
reason: "conversation-mode: readiness gating not applied per-turn"
|
|
756
754
|
};
|
|
757
755
|
}
|
|
758
|
-
|
|
759
|
-
//#region src/conversation/conversation-backend.ts
|
|
756
|
+
// src/conversation/conversation-backend.ts
|
|
760
757
|
/**
|
|
761
758
|
*
|
|
762
759
|
* Wrap a `Conversation` so it satisfies `AgentExecutionBackend`. The result is
|
|
@@ -881,8 +878,7 @@ function describeHalt(halt) {
|
|
|
881
878
|
case "participant_error": return `participant_error[${halt.participant}]: ${halt.message}`;
|
|
882
879
|
}
|
|
883
880
|
}
|
|
884
|
-
|
|
885
|
-
//#region src/conversation/define-conversation.ts
|
|
881
|
+
// src/conversation/define-conversation.ts
|
|
886
882
|
/**
|
|
887
883
|
*
|
|
888
884
|
* Declarative constructor for a multi-agent `Conversation`. Validates inputs
|
|
@@ -918,8 +914,7 @@ function normalizePolicy(policy, participantCount) {
|
|
|
918
914
|
turnOrder
|
|
919
915
|
};
|
|
920
916
|
}
|
|
921
|
-
|
|
922
|
-
//#region src/conversation/run-persona.ts
|
|
917
|
+
// src/conversation/run-persona.ts
|
|
923
918
|
/** Adapt one exact profile + Runtime executor into the conversation stream protocol. */
|
|
924
919
|
function profileRuntimeBackend(profile, factory, counter) {
|
|
925
920
|
const backend = createProfileExecutionBackend({
|
|
@@ -1047,8 +1042,7 @@ function runPersonaDispatch(config) {
|
|
|
1047
1042
|
return config.artifactOf(result.transcript, scenario);
|
|
1048
1043
|
};
|
|
1049
1044
|
}
|
|
1050
|
-
|
|
1051
|
-
//#region src/improvement/official-optimizers.ts
|
|
1045
|
+
// src/improvement/official-optimizers.ts
|
|
1052
1046
|
const defaultMaxFindingsChars = 5e4;
|
|
1053
1047
|
const pythonClientDocs = "https://github.com/tangle-network/agent-eval/tree/main/clients/python";
|
|
1054
1048
|
const bridgeInstall = "`python -m pip install \"agent-eval-rpc==0.145.0\"`";
|
|
@@ -1104,7 +1098,7 @@ function officialOptimizer(optimizer, options, create) {
|
|
|
1104
1098
|
describeArtifact,
|
|
1105
1099
|
authorizeSensitiveCandidate
|
|
1106
1100
|
});
|
|
1107
|
-
|
|
1101
|
+
const method = withDependencyHelp(optimizer, externalEvaluationRef, redactor, redactionPolicyRef, create({
|
|
1108
1102
|
...config,
|
|
1109
1103
|
objective,
|
|
1110
1104
|
evaluationId: externalEvaluationRef,
|
|
@@ -1119,7 +1113,8 @@ function officialOptimizer(optimizer, options, create) {
|
|
|
1119
1113
|
}),
|
|
1120
1114
|
...describeScenario ? { describeScenario: (scenario) => redactOptimizerEvidence(label, "scenario descriptor", describeScenario(scenario), redactor) } : {},
|
|
1121
1115
|
...describeArtifact ? { describeArtifact: (artifact, scenario) => redactOptimizerEvidence(label, "artifact descriptor", describeArtifact(artifact, scenario), redactor) } : {}
|
|
1122
|
-
}))
|
|
1116
|
+
}));
|
|
1117
|
+
return withMethodRuntimeControls(method, {
|
|
1123
1118
|
costAttribution: "optimizer-run",
|
|
1124
1119
|
validateCandidate: (input) => assertSafeOptimizerCandidate(label, input, authorizeSensitiveCandidate)
|
|
1125
1120
|
});
|
|
@@ -1330,8 +1325,7 @@ function isMissingDependency(optimizer, cause) {
|
|
|
1330
1325
|
];
|
|
1331
1326
|
return [...common, ...specific].some((fragment) => message.includes(fragment));
|
|
1332
1327
|
}
|
|
1333
|
-
|
|
1334
|
-
//#region src/improvement/profile-improvement-harness.ts
|
|
1328
|
+
// src/improvement/profile-improvement-harness.ts
|
|
1335
1329
|
/**
|
|
1336
1330
|
* Bind one exact profile and executor into a repeatable self-improvement
|
|
1337
1331
|
* harness. The returned `run` method remains generic over every existing
|
|
@@ -1373,8 +1367,7 @@ function createProfileImprovementHarness(options) {
|
|
|
1373
1367
|
}
|
|
1374
1368
|
});
|
|
1375
1369
|
}
|
|
1376
|
-
|
|
1377
|
-
//#region src/improvement/reflective-generator.ts
|
|
1370
|
+
// src/improvement/reflective-generator.ts
|
|
1378
1371
|
/**
|
|
1379
1372
|
*
|
|
1380
1373
|
* `reflectiveGenerator` — the cheap, no-sandbox `CandidateGenerator`. It drafts
|
|
@@ -1467,8 +1460,7 @@ function applyPatches(edits, cwd) {
|
|
|
1467
1460
|
if (result.error) throw result.error;
|
|
1468
1461
|
if (result.status !== 0) throw new Error(`reflectiveGenerator: patch batch failed: ${result.stderr.trim()}`);
|
|
1469
1462
|
}
|
|
1470
|
-
|
|
1471
|
-
//#region src/improvement/reflective-profile-proposer.ts
|
|
1463
|
+
// src/improvement/reflective-profile-proposer.ts
|
|
1472
1464
|
const OPERATOR = {
|
|
1473
1465
|
draft: "OPERATOR: draft. Write a substantially different approach from the parent below, not an edit of it.",
|
|
1474
1466
|
improve: "OPERATOR: improve. Edit the parent below to fix its dominant failure mode; keep what already works.",
|
|
@@ -1644,8 +1636,7 @@ function surfaceOf(value, shape, maxChars) {
|
|
|
1644
1636
|
function defaultEvidence(parent) {
|
|
1645
1637
|
return parent.trainCells.map((cell) => `- train unit ${cell.unitId}: score ${cell.score}`);
|
|
1646
1638
|
}
|
|
1647
|
-
|
|
1648
|
-
//#region src/knowledge/activation.ts
|
|
1639
|
+
// src/knowledge/activation.ts
|
|
1649
1640
|
/** Apply or restore one local knowledge candidate through the shared activation contract. */
|
|
1650
1641
|
function createKnowledgeImprovementActivationExecutor(options) {
|
|
1651
1642
|
if (!options.identity.trim()) throw new Error("knowledge activation identity is required");
|
|
@@ -1820,8 +1811,7 @@ function completionTime(transition, now) {
|
|
|
1820
1811
|
const completedAt = (now ?? (() => /* @__PURE__ */ new Date()))().toISOString();
|
|
1821
1812
|
return Date.parse(completedAt) < Date.parse(transition.attemptedAt) ? transition.attemptedAt : completedAt;
|
|
1822
1813
|
}
|
|
1823
|
-
|
|
1824
|
-
//#region src/knowledge/supervised-update.ts
|
|
1814
|
+
// src/knowledge/supervised-update.ts
|
|
1825
1815
|
/** Build the completion check a supervised KB update uses to stop only when the KB is ready. */
|
|
1826
1816
|
function knowledgeReadinessDeliverable(options) {
|
|
1827
1817
|
return {
|
|
@@ -1886,8 +1876,7 @@ function formatSupervisedKnowledgeTask(options) {
|
|
|
1886
1876
|
options.metadata && Object.keys(options.metadata).length > 0 ? `Metadata:\n${JSON.stringify(options.metadata, null, 2)}` : void 0
|
|
1887
1877
|
].filter((section) => Boolean(section)).join("\n\n")}\n\nUpdate files under the knowledge base root only. Stop when the readiness check passes.`;
|
|
1888
1878
|
}
|
|
1889
|
-
|
|
1890
|
-
//#region src/knowledge/improvement-job.ts
|
|
1879
|
+
// src/knowledge/improvement-job.ts
|
|
1891
1880
|
/** Build the default readiness check backed by `@tangle-network/agent-knowledge` validation and scoring. */
|
|
1892
1881
|
function createAgentKnowledgeReadinessCheck(options) {
|
|
1893
1882
|
return async (input) => {
|
|
@@ -2052,8 +2041,7 @@ function addSpent(target, result) {
|
|
|
2052
2041
|
target.usd += spent.usd;
|
|
2053
2042
|
target.ms += spent.ms;
|
|
2054
2043
|
}
|
|
2055
|
-
|
|
2056
|
-
//#region src/model-resolution.ts
|
|
2044
|
+
// src/model-resolution.ts
|
|
2057
2045
|
/** Default Tangle Router base URL used when no env override is set. */
|
|
2058
2046
|
const DEFAULT_ROUTER_BASE_URL = "https://router.tangle.tools";
|
|
2059
2047
|
/** Resolve the router base URL from env, normalised — no trailing `/v1` or `/`. */
|
|
@@ -2147,8 +2135,7 @@ async function validateChatModelId(modelId, options = {}) {
|
|
|
2147
2135
|
value: cleaned
|
|
2148
2136
|
};
|
|
2149
2137
|
}
|
|
2150
|
-
|
|
2151
|
-
//#region src/readiness.ts
|
|
2138
|
+
// src/readiness.ts
|
|
2152
2139
|
const DEFAULT_MINIMUM_READINESS_SCORE = .7;
|
|
2153
2140
|
/**
|
|
2154
2141
|
* Map a `KnowledgeReadinessReport` to a three-state branch (`ready` / `blocked` / `caveat`) the runtime, route handlers, and UI shells all switch on.
|
|
@@ -2191,8 +2178,7 @@ function decideKnowledgeReadiness(report, options = {}) {
|
|
|
2191
2178
|
nonBlockingGapIds
|
|
2192
2179
|
};
|
|
2193
2180
|
}
|
|
2194
|
-
|
|
2195
|
-
//#region src/run.ts
|
|
2181
|
+
// src/run.ts
|
|
2196
2182
|
/**
|
|
2197
2183
|
*
|
|
2198
2184
|
* The two top-level entry points:
|
|
@@ -2670,8 +2656,7 @@ function toAgentContext(task, knowledge, ctx) {
|
|
|
2670
2656
|
abortSignal: ctx.abortSignal
|
|
2671
2657
|
};
|
|
2672
2658
|
}
|
|
2673
|
-
|
|
2674
|
-
//#region src/runtime/isolated-check-result.ts
|
|
2659
|
+
// src/runtime/isolated-check-result.ts
|
|
2675
2660
|
/** Decode the existing execution contract without widening or reinterpreting its evidence. */
|
|
2676
2661
|
const isolatedCheckBoxEvidenceSchema = z.object({
|
|
2677
2662
|
sandboxId: z.string().min(1),
|
|
@@ -2711,8 +2696,7 @@ const isolatedCheckResultSchema = z.discriminatedUnion("succeeded", [z.object({
|
|
|
2711
2696
|
cleanupDiagnostic: z.string().optional(),
|
|
2712
2697
|
box: isolatedCheckBoxEvidenceSchema.optional()
|
|
2713
2698
|
}).strict()]);
|
|
2714
|
-
|
|
2715
|
-
//#region src/runtime-run.ts
|
|
2699
|
+
// src/runtime-run.ts
|
|
2716
2700
|
/**
|
|
2717
2701
|
*
|
|
2718
2702
|
* Production-run lifecycle: record what the agent did on behalf of a customer,
|
|
@@ -2838,8 +2822,7 @@ function mergeMetadata(base, extra) {
|
|
|
2838
2822
|
function randomSuffix() {
|
|
2839
2823
|
return Math.random().toString(36).slice(2, 10);
|
|
2840
2824
|
}
|
|
2841
|
-
|
|
2842
|
-
//#region src/sse.ts
|
|
2825
|
+
// src/sse.ts
|
|
2843
2826
|
/** @stable */
|
|
2844
2827
|
function encodeServerSentEvent(data, options = {}) {
|
|
2845
2828
|
const lines = [];
|
|
@@ -2874,7 +2857,6 @@ function runtimeStreamServerSentEvent(event, options = {}) {
|
|
|
2874
2857
|
function stripNewlines(value) {
|
|
2875
2858
|
return value.replace(/[\r\n]/g, " ");
|
|
2876
2859
|
}
|
|
2877
|
-
//#endregion
|
|
2878
2860
|
export { AgentEvalError, BackendTransportError, ConfigError, DEFAULT_ROUTER_BASE_URL, InMemoryRuntimeSessionStore, JudgeError, NotFoundError, ROUTER_PRICE_SOURCE, SearchEnvironmentFault, ValidationError, agenticGenerator, auditLoopRunner, buildKnowledgeImprovementExperimentBundles, buildLoopOtelSpans, cleanModelId, commandVerifier, composeRuntimeHooks, createCommandProfileTrainer, createConversationBackend, createIterableBackend, createKnowledgeImprovementActivationExecutor, createOtelExporter, createProfileExecutionBackend, createProfileImprovementHarness, createRuntimeEventCollector, createRuntimeStreamEventCollector, createSandboxPromptBackend, decideKnowledgeReadiness, decideSearchImprovement, dedicatedLane, defineRuntimeHooks, getModels, improve, isolatedCheckBoxEvidenceSchema, isolatedCheckResultSchema, loopEventToOtelSpan, officialGepa, officialSkillOpt, optimizerMethod, padSpanId, padTraceId, priceTokens, readinessServerSentEvent, reflectiveGenerator, reflectiveProfileProposer, resolveChatModel, resolveRouterBaseUrl, routerLane, runAgentTask, runAgentTaskStream, runConversation, runConversationStream, runKnowledgeImprovementJob, runPersonaConversation, runPersonaDispatch, runtimeStreamServerSentEvent, sanitizeKnowledgeReadinessReport, searchMethod, sharedBoxLane, startRuntimeRun, subscriptionLane, validateChatModelId };
|
|
2879
2861
|
|
|
2880
2862
|
//# sourceMappingURL=index.js.map
|