@tangle-network/agent-runtime 0.116.0 → 0.119.0
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 +9 -1
- package/dist/{activation-DuqQhee6.js → activation-DdIpwQ0k.js} +3 -3
- package/dist/{activation-DuqQhee6.js.map → activation-DdIpwQ0k.js.map} +1 -1
- package/dist/agent.d.ts +3 -64
- package/dist/agent.js +5 -207
- package/dist/agent.js.map +1 -1
- package/dist/{analyst-loop-BoNIG2hA.js → analyst-loop-DvSciOfB.js} +2 -2
- package/dist/{analyst-loop-BoNIG2hA.js.map → analyst-loop-DvSciOfB.js.map} +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/candidate-execution/index.d.ts +3 -3
- package/dist/candidate-execution/index.js +5 -5
- package/dist/{candidate-execution-CfpJrd3o.js → candidate-execution-DDkSRPjY.js} +4 -4
- package/dist/{candidate-execution-CfpJrd3o.js.map → candidate-execution-DDkSRPjY.js.map} +1 -1
- package/dist/{environment-provider-CWsRh6Uz.d.ts → environment-provider-Bh4nX2qt.d.ts} +306 -32
- package/dist/{environment-provider-CCaEhA-l.js → environment-provider-Cr75N-rU.js} +141 -32
- package/dist/environment-provider-Cr75N-rU.js.map +1 -0
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{improvement-cycle-C1cmjvPD.js → improvement-cycle-zjR-MXwK.js} +163 -22
- package/dist/improvement-cycle-zjR-MXwK.js.map +1 -0
- package/dist/{index-C-FYUuFG.d.ts → index-B3bHsVLw.d.ts} +2 -2
- package/dist/{index-CYkDeM5L.d.ts → index-BLsKcxNd.d.ts} +3 -3
- package/dist/{index-COumPQka.d.ts → index-CGADWaa_.d.ts} +864 -437
- package/dist/{index-DcLMNnG5.d.ts → index-I35151Fr.d.ts} +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +10 -9
- package/dist/intelligence.js +15 -9
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +9 -8
- package/dist/{knowledge-DOzbywZT.js → knowledge-I1e9zQGj.js} +7 -7
- package/dist/knowledge-I1e9zQGj.js.map +1 -0
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{local-harness-t6cDWDQ2.d.ts → local-harness-BIajef4A.d.ts} +29 -7
- package/dist/{loop-runner-bin-BFrhPLKt.d.ts → loop-runner-bin-BeG9vTdE.d.ts} +3 -3
- package/dist/{loop-runner-bin-BuQjc5DR.js → loop-runner-bin-L996YVPS.js} +4 -4
- package/dist/{loop-runner-bin-BuQjc5DR.js.map → loop-runner-bin-L996YVPS.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 +43 -10
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +5 -45
- package/dist/mcp/index.js +8 -212
- package/dist/mcp/index.js.map +1 -1
- package/dist/{openai-tools-_Wyp4udO.js → openai-tools-CvFEzw6f.js} +2 -2
- package/dist/{openai-tools-_Wyp4udO.js.map → openai-tools-CvFEzw6f.js.map} +1 -1
- package/dist/{prepare-BHQBb02e.js → prepare-DpV6np9e.js} +47 -34
- package/dist/prepare-DpV6np9e.js.map +1 -0
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-BP6Z4eau.d.ts → protected-model-port-CoJOiINX.d.ts} +11 -3
- package/dist/{protected-model-port-DqAH1Z2M.js → protected-model-port-vQLBRoAQ.js} +2 -2
- package/dist/{protected-model-port-DqAH1Z2M.js.map → protected-model-port-vQLBRoAQ.js.map} +1 -1
- package/dist/{redact-BEtQtvd6.d.ts → redact-PQzmE1Jn.d.ts} +4 -4
- package/dist/run-layout-C2FGmZ3v.js +158 -0
- package/dist/run-layout-C2FGmZ3v.js.map +1 -0
- package/dist/{runtime-Ut1pkd2n.js → runtime-D4e3GP5K.js} +147 -190
- package/dist/runtime-D4e3GP5K.js.map +1 -0
- package/dist/{sandbox-events-DeI5xX8P.js → sandbox-events-Yhd1GYWl.js} +4 -2
- package/dist/sandbox-events-Yhd1GYWl.js.map +1 -0
- package/dist/spawn-journal-IeXpidO2.js +857 -0
- package/dist/spawn-journal-IeXpidO2.js.map +1 -0
- package/dist/{structural-rollout-CVY_0hJp.js → structural-rollout-DQHO3b2Y.js} +4 -4
- package/dist/structural-rollout-DQHO3b2Y.js.map +1 -0
- package/dist/{supervise-BUR9ByF7.js → supervise-Cq50UT5-.js} +2874 -1892
- package/dist/supervise-Cq50UT5-.js.map +1 -0
- package/dist/{supervisor-BBbPBXpe.js → supervisor-CpT9yAxL.js} +2896 -983
- package/dist/supervisor-CpT9yAxL.js.map +1 -0
- package/dist/testing.js +98 -76
- package/dist/testing.js.map +1 -1
- package/dist/top-app-5unxqovu.js +1088 -0
- package/dist/top-app-5unxqovu.js.map +1 -0
- package/dist/tui/bin.d.ts +1 -0
- package/dist/tui/bin.js +19 -0
- package/dist/tui/bin.js.map +1 -0
- package/dist/tui/index.d.ts +209 -0
- package/dist/tui/index.js +2 -0
- package/dist/{util-Cc9g9Y-o.js → util-MVgdwuIS.js} +2 -2
- package/dist/{util-Cc9g9Y-o.js.map → util-MVgdwuIS.js.map} +1 -1
- package/dist/{workspace-archive-DXzJq7WP.js → workspace-archive-B4SkNJjw.js} +2 -2
- package/dist/{workspace-archive-DXzJq7WP.js.map → workspace-archive-B4SkNJjw.js.map} +1 -1
- package/package.json +8 -2
- package/dist/environment-provider-CCaEhA-l.js.map +0 -1
- package/dist/improvement-cycle-C1cmjvPD.js.map +0 -1
- package/dist/knowledge-DOzbywZT.js.map +0 -1
- package/dist/prepare-BHQBb02e.js.map +0 -1
- package/dist/runtime-Ut1pkd2n.js.map +0 -1
- package/dist/sandbox-events-DeI5xX8P.js.map +0 -1
- package/dist/spawn-journal-DCPbicXB.js +0 -457
- package/dist/spawn-journal-DCPbicXB.js.map +0 -1
- package/dist/structural-rollout-CVY_0hJp.js.map +0 -1
- package/dist/supervise-BUR9ByF7.js.map +0 -1
- package/dist/supervisor-BBbPBXpe.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as contentAddress } from "./spawn-journal-IeXpidO2.js";
|
|
2
2
|
import { i as redactProtectedValue, n as createProtectedRecordRedactor, r as redactProtectedReason, t as assertNoProtectedBytes } from "./protected-redaction--F3v1oo8.js";
|
|
3
3
|
import { REDACTION_VERSION, canonicalJson, isLlmSpan } from "@tangle-network/agent-eval";
|
|
4
4
|
import { agentCandidateArtifactRefSchema, agentCandidateBenchmarkResultEvidenceSchema, agentCandidateBenchmarkSuiteSchema, agentCandidateBenchmarkTaskSchema, agentCandidateBundleSchema, agentCandidateContainerSchema, agentCandidateExecutionLimitsSchema, agentCandidateExecutionPlanEvidenceSchema, agentCandidateExecutionPlanMaterialSchema, agentCandidateMaterializationReceiptSchema, agentCandidateModelAccessNetworkSchema, agentCandidateModelSettlementEvidenceSchema, agentCandidateProfileActivationSchema, agentCandidateProfilePlanEvidenceSchema, agentCandidateProfileSchema, agentCandidateResolvedModelSchema, agentCandidateRunCellSchema, agentCandidateRunReceiptSchema, agentCandidateTaskOutcomeEvidenceSchema, agentCandidateTaskOutcomeSpecSchema, agentCandidateTerminationSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, agentProfileDiffSchema, agentProfileSchema, applyAgentProfileDiff, sha256DigestSchema } from "@tangle-network/agent-interface";
|
|
@@ -177,6 +177,7 @@ function parseExactAgentProfileDiff(input, label) {
|
|
|
177
177
|
function applyExactAgentProfileDiff(baseInput, diffInput, label) {
|
|
178
178
|
return parseExactAgentProfile(omitUndefinedObjectFields(applyAgentProfileDiff(parseExactAgentProfile(baseInput, `${label} base profile`), parseExactAgentProfileDiff(diffInput, `${label} diff`)), label), `${label} result`);
|
|
179
179
|
}
|
|
180
|
+
/** Parse a candidate profile without silently discarding unsupported or non-canonical fields. */
|
|
180
181
|
function parseExactCandidateProfile(input) {
|
|
181
182
|
const parsed = agentCandidateProfileSchema.parse(input);
|
|
182
183
|
assertCanonicalParse(input, parsed, "candidate profile");
|
|
@@ -192,6 +193,7 @@ function assertCandidateProfileExecutionSupport(profile) {
|
|
|
192
193
|
].filter((field) => hasEntries(profile[field]));
|
|
193
194
|
if (unsupported.length > 0) throw new Error(`candidate execution cannot prove in-session effects for non-empty AgentProfile fields: ${unsupported.join(", ")}`);
|
|
194
195
|
}
|
|
196
|
+
/** Convert the candidate profile contract into the portable interface profile it represents. */
|
|
195
197
|
function agentCandidateProfileAsAgentProfile(candidate) {
|
|
196
198
|
const output = {};
|
|
197
199
|
copyDirectProfileFields(output, candidate);
|
|
@@ -225,6 +227,7 @@ function agentCandidateProfileAsAgentProfile(candidate) {
|
|
|
225
227
|
}
|
|
226
228
|
return output;
|
|
227
229
|
}
|
|
230
|
+
/** Recursively remove undefined object fields while refusing undefined array entries. */
|
|
228
231
|
function omitUndefinedObjectFields(value, path) {
|
|
229
232
|
if (Array.isArray(value)) return value.map((entry, index) => {
|
|
230
233
|
if (entry === void 0) throw new Error(`${path} produced an undefined array entry at ${index}`);
|
|
@@ -3733,33 +3736,55 @@ var CandidateExecutionDeadlineError = class extends Error {
|
|
|
3733
3736
|
};
|
|
3734
3737
|
//#endregion
|
|
3735
3738
|
//#region src/candidate-execution/system-prompt.ts
|
|
3736
|
-
const NATIVE_EXECUTABLES = {
|
|
3737
|
-
"claude-code": "claude",
|
|
3738
|
-
codex: "codex",
|
|
3739
|
-
opencode: "opencode",
|
|
3740
|
-
pi: "pi"
|
|
3741
|
-
};
|
|
3742
3739
|
const SYSTEM_PROMPT_FILE = ".tangle/system-prompt.md";
|
|
3740
|
+
const SYSTEM_PROMPT_FLAGS = ["--system-prompt", "--system-prompt-file"];
|
|
3741
|
+
/** Shared by the harnesses whose native control IS a `--system-prompt*` flag. */
|
|
3742
|
+
function argsSetSystemPromptFlag(values) {
|
|
3743
|
+
return values.some((value) => SYSTEM_PROMPT_FLAGS.some((flag) => value === flag || value.startsWith(`${flag}=`)));
|
|
3744
|
+
}
|
|
3745
|
+
function argsSetCodexDeveloperInstructions(values) {
|
|
3746
|
+
for (let index = 0; index < values.length; index++) {
|
|
3747
|
+
const value = values[index];
|
|
3748
|
+
if ((value === "-c" || value === "--config" ? values[index + 1] : value.startsWith("--config=") ? value.slice(9) : void 0)?.trimStart().startsWith("developer_instructions=")) return true;
|
|
3749
|
+
}
|
|
3750
|
+
return false;
|
|
3751
|
+
}
|
|
3752
|
+
const HARNESS_SYSTEM_PROMPTS = {
|
|
3753
|
+
"claude-code": {
|
|
3754
|
+
executable: "claude",
|
|
3755
|
+
project: (plan, systemPrompt, path) => appendFlags(addSystemPromptFile(plan, systemPrompt), "--system-prompt-file", path),
|
|
3756
|
+
conflictsWithArgs: argsSetSystemPromptFlag
|
|
3757
|
+
},
|
|
3758
|
+
codex: {
|
|
3759
|
+
executable: "codex",
|
|
3760
|
+
project: (plan, systemPrompt) => appendFlags(plan, "-c", `developer_instructions=${tomlString(systemPrompt)}`),
|
|
3761
|
+
conflictsWithArgs: argsSetCodexDeveloperInstructions
|
|
3762
|
+
},
|
|
3763
|
+
opencode: {
|
|
3764
|
+
executable: "opencode",
|
|
3765
|
+
project: (plan, systemPrompt) => ({
|
|
3766
|
+
...plan,
|
|
3767
|
+
files: projectOpenCodeSystemPrompt(plan.files, systemPrompt)
|
|
3768
|
+
}),
|
|
3769
|
+
conflictsWithArgs: () => false
|
|
3770
|
+
},
|
|
3771
|
+
pi: {
|
|
3772
|
+
executable: "pi",
|
|
3773
|
+
project: (plan, systemPrompt, path) => appendFlags(addSystemPromptFile(plan, systemPrompt), "--system-prompt", path),
|
|
3774
|
+
conflictsWithArgs: argsSetSystemPromptFlag
|
|
3775
|
+
}
|
|
3776
|
+
};
|
|
3743
3777
|
/** Project a replacement system prompt onto the exact native process control. */
|
|
3744
3778
|
function projectCandidateSystemPrompt(plan, launch, systemPromptFilePath) {
|
|
3745
3779
|
const systemPrompt = plan.systemPrompt;
|
|
3746
3780
|
if (systemPrompt === void 0) return plan;
|
|
3747
|
-
const
|
|
3748
|
-
if (!
|
|
3781
|
+
const projection = HARNESS_SYSTEM_PROMPTS[plan.harness];
|
|
3782
|
+
if (!projection) throw new Error(`candidate system prompt has no native launch projection for ${plan.harness}`);
|
|
3783
|
+
const expectedExecutable = projection.executable;
|
|
3749
3784
|
if (launch.kind !== "container-command") throw new Error(`candidate-entrypoint launch cannot prove ${plan.harness} system-prompt replacement`);
|
|
3750
3785
|
if (launch.executable !== expectedExecutable && !(posix.isAbsolute(launch.executable) && posix.basename(launch.executable) === expectedExecutable)) throw new Error(`${plan.harness} system-prompt replacement requires the native ${expectedExecutable} executable`);
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
switch (plan.harness) {
|
|
3754
|
-
case "codex": return appendFlags(projectedPlan, "-c", `developer_instructions=${tomlString(systemPrompt.value)}`);
|
|
3755
|
-
case "claude-code": return appendFlags(addSystemPromptFile(projectedPlan, systemPrompt.value), "--system-prompt-file", systemPromptFilePath);
|
|
3756
|
-
case "opencode": return {
|
|
3757
|
-
...projectedPlan,
|
|
3758
|
-
files: projectOpenCodeSystemPrompt(projectedPlan.files, systemPrompt.value)
|
|
3759
|
-
};
|
|
3760
|
-
case "pi": return appendFlags(addSystemPromptFile(projectedPlan, systemPrompt.value), "--system-prompt", systemPromptFilePath);
|
|
3761
|
-
default: throw new Error(`candidate system prompt has no native launch projection for ${plan.harness}`);
|
|
3762
|
-
}
|
|
3786
|
+
if (projection.conflictsWithArgs((launch.args ?? []).map((value) => value.value))) throw new Error(`${plan.harness} launch arguments conflict with the candidate profile system prompt`);
|
|
3787
|
+
return projection.project(omitUnappliedSystemPrompt(plan), systemPrompt.value, systemPromptFilePath);
|
|
3763
3788
|
}
|
|
3764
3789
|
function omitUnappliedSystemPrompt(plan) {
|
|
3765
3790
|
const { systemPrompt: _systemPrompt, ...projected } = plan;
|
|
@@ -3788,18 +3813,6 @@ function addSystemPromptFile(plan, systemPrompt) {
|
|
|
3788
3813
|
}]
|
|
3789
3814
|
};
|
|
3790
3815
|
}
|
|
3791
|
-
function assertNoSystemPromptOverride(harness, args) {
|
|
3792
|
-
const values = args.map((value) => value.value);
|
|
3793
|
-
if (harness === "claude-code" || harness === "pi") {
|
|
3794
|
-
if (values.some((value) => value === "--system-prompt" || value.startsWith("--system-prompt=") || value === "--system-prompt-file" || value.startsWith("--system-prompt-file="))) throw new Error(`${harness} launch arguments conflict with the candidate profile system prompt`);
|
|
3795
|
-
return;
|
|
3796
|
-
}
|
|
3797
|
-
if (harness !== "codex") return;
|
|
3798
|
-
for (let index = 0; index < values.length; index++) {
|
|
3799
|
-
const value = values[index];
|
|
3800
|
-
if ((value === "-c" || value === "--config" ? values[index + 1] : value.startsWith("--config=") ? value.slice(9) : void 0)?.trimStart().startsWith("developer_instructions=")) throw new Error("codex launch arguments conflict with the candidate profile system prompt");
|
|
3801
|
-
}
|
|
3802
|
-
}
|
|
3803
3816
|
function projectOpenCodeSystemPrompt(files, prompt) {
|
|
3804
3817
|
const configIndex = files.findIndex((file) => file.relPath === "opencode.json");
|
|
3805
3818
|
if (configIndex === -1) return [...files, {
|
|
@@ -4442,4 +4455,4 @@ function errorMessage(error) {
|
|
|
4442
4455
|
//#endregion
|
|
4443
4456
|
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 };
|
|
4444
4457
|
|
|
4445
|
-
//# sourceMappingURL=prepare-
|
|
4458
|
+
//# sourceMappingURL=prepare-DpV6np9e.js.map
|