@tangle-network/agent-runtime 0.101.1 → 0.102.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/dist/candidate-execution/index.d.ts +13 -2
- package/dist/candidate-execution/index.js +7 -3
- package/dist/{chunk-TA4RBJLE.js → chunk-23Z7N5IG.js} +4 -4
- package/dist/{chunk-RJPQLUDA.js → chunk-4AMAFNUD.js} +28 -6
- package/dist/chunk-4AMAFNUD.js.map +1 -0
- package/dist/{chunk-BXZ7GPL4.js → chunk-AIBIRAJ6.js} +2 -2
- package/dist/{chunk-U4PRAATQ.js → chunk-DA7YL6I4.js} +3 -3
- package/dist/{chunk-DI677IPX.js → chunk-LKKIM5QD.js} +3 -3
- package/dist/chunk-SPCD4IQQ.js +578 -0
- package/dist/chunk-SPCD4IQQ.js.map +1 -0
- package/dist/{chunk-HGSHPVJ6.js → chunk-TGDHHHH4.js} +189 -189
- package/dist/{chunk-HGSHPVJ6.js.map → chunk-TGDHHHH4.js.map} +1 -1
- package/dist/{improve-g75IE2Cx.d.ts → improve-CIml6hT3.d.ts} +7 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +60 -59
- package/dist/intelligence.js +59 -470
- package/dist/intelligence.js.map +1 -1
- package/dist/knowledge.js +5 -5
- package/dist/testing.js +252 -210
- package/dist/testing.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-RJPQLUDA.js.map +0 -1
- /package/dist/{chunk-TA4RBJLE.js.map → chunk-23Z7N5IG.js.map} +0 -0
- /package/dist/{chunk-BXZ7GPL4.js.map → chunk-AIBIRAJ6.js.map} +0 -0
- /package/dist/{chunk-U4PRAATQ.js.map → chunk-DA7YL6I4.js.map} +0 -0
- /package/dist/{chunk-DI677IPX.js.map → chunk-LKKIM5QD.js.map} +0 -0
|
@@ -3,8 +3,9 @@ import { AgentCandidateBundle, AgentCandidateCodeDisabled, AgentCandidateCodeNoO
|
|
|
3
3
|
export { AgentCandidateBenchmarkGraderIdentity } from '@tangle-network/agent-interface';
|
|
4
4
|
import { c as AgentCandidateExecutionClaim, A as AgentCandidateExecutionClaimStore, d as AgentCandidateExecutionClaimResult, b as AgentCandidateExecutionAttemptRef, a as AgentCandidateExecutionAttemptRecord, h as AgentCandidateExecutionLease, j as AgentCandidateExecutionPhaseResult, n as AgentCandidateExecutionTerminalResult, l as AgentCandidateExecutionStageResult, g as AgentCandidateExecutionFinishResult, k as AgentCandidateExecutionRecoveryEvidence } from '../profile-DbfaMTdk.js';
|
|
5
5
|
export { e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, i as AgentCandidateExecutionPhase, m as AgentCandidateExecutionTerminalRecord, o as AgentCandidatePreparationEvidence, q as AgentCandidateRetryRejection, E as ExecutePreparedAgentCandidateOptions, I as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, r as applyExactAgentProfileDiff, s as executePreparedAgentCandidate, t as parseExactAgentProfile, u as parseExactAgentProfileDiff, v as prepareAgentCandidateExecution } from '../profile-DbfaMTdk.js';
|
|
6
|
-
import { P as PreparedAgentCandidateExecution, b as AgentCandidateOutputArtifactPort, t as AgentCandidateOutputPurpose, s as AgentCandidateModelPort, v as AgentCandidateProtectedModelReservation, u as AgentCandidateProtectedModelActivation, w as AgentCandidateProtectedModelSettlement,
|
|
6
|
+
import { P as PreparedAgentCandidateExecution, A as AgentCandidateExecutorPort, b as AgentCandidateOutputArtifactPort, t as AgentCandidateOutputPurpose, s as AgentCandidateModelPort, v as AgentCandidateProtectedModelReservation, u as AgentCandidateProtectedModelActivation, w as AgentCandidateProtectedModelSettlement, e as AgentCandidateExecutionPorts, z as AgentCandidateVerificationPorts, V as VerifiedAgentCandidate, n as AgentCandidateExecutorWorkspaceFile, B as AgentCandidateWorkspacePort } from '../types-CWqfCO8s.js';
|
|
7
7
|
export { f as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, g as AgentCandidateContainerPort, h as AgentCandidateExecutorFinalCapture, i as AgentCandidateExecutorMemoryCapture, j as AgentCandidateExecutorProfileFile, k as AgentCandidateExecutorRequest, l as AgentCandidateExecutorStopRequest, m as AgentCandidateExecutorTaskOutcomeCapture, o as AgentCandidateExecutorWorkspaceInput, p as AgentCandidateMemoryPort, q as AgentCandidateMemoryResetResult, r as AgentCandidateModelLimits, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, J as VerifiedAgentCandidateTaskOutcome } from '../types-CWqfCO8s.js';
|
|
8
|
+
import { AgentEnvironmentProvider, AgentExactProcessResources } from '@tangle-network/agent-interface/environment-provider';
|
|
8
9
|
import { TraceStore } from '@tangle-network/agent-eval';
|
|
9
10
|
|
|
10
11
|
/** Exact candidate wire shape before the runtime computes its canonical digest. */
|
|
@@ -93,6 +94,16 @@ declare function disposePreparedAgentCandidateExecution(prepared: PreparedAgentC
|
|
|
93
94
|
disposed: true;
|
|
94
95
|
}>;
|
|
95
96
|
|
|
97
|
+
interface ExactProcessCandidateExecutorOptions {
|
|
98
|
+
provider: AgentEnvironmentProvider;
|
|
99
|
+
resources: AgentExactProcessResources;
|
|
100
|
+
provisionTimeoutMs?: number;
|
|
101
|
+
recoveryRetentionMs?: number;
|
|
102
|
+
providerOptions?: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
/** Adapt one neutral exact-process provider to Runtime's trusted candidate boundary. */
|
|
105
|
+
declare function exactProcessProviderAsCandidateExecutor(options: ExactProcessCandidateExecutorOptions): AgentCandidateExecutorPort;
|
|
106
|
+
|
|
96
107
|
/** Environment variable containing the materialized candidate knowledge root. */
|
|
97
108
|
declare const CANDIDATE_KNOWLEDGE_ROOT_ENV = "TANGLE_CANDIDATE_KNOWLEDGE_ROOT";
|
|
98
109
|
/** Environment variable containing the materialized retrieval configuration path. */
|
|
@@ -214,4 +225,4 @@ declare function captureAgentCandidateWorkspaceFiles(input: readonly AgentCandid
|
|
|
214
225
|
/** Create the standard bounded materializer for candidate execution ports. */
|
|
215
226
|
declare function createAgentCandidateWorkspacePort(options?: CreateAgentCandidateWorkspacePortOptions): AgentCandidateWorkspacePort;
|
|
216
227
|
|
|
217
|
-
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, AgentCandidateExecutionAttemptRecord, AgentCandidateExecutionAttemptRef, AgentCandidateExecutionClaim, AgentCandidateExecutionClaimResult, AgentCandidateExecutionClaimStore, AgentCandidateExecutionFinishResult, AgentCandidateExecutionLease, AgentCandidateExecutionPhaseResult, AgentCandidateExecutionPorts, AgentCandidateExecutionRecoveryEvidence, AgentCandidateExecutionStageResult, AgentCandidateExecutionTerminalResult, AgentCandidateExecutorPort, AgentCandidateExecutorWorkspaceFile, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantSettleInput, AgentCandidateModelPort, AgentCandidateOutputArtifactPort, AgentCandidateOutputPurpose, type AgentCandidateProfileSource, AgentCandidateProtectedModelActivation, AgentCandidateProtectedModelReservation, AgentCandidateProtectedModelSettlement, AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, AgentCandidateWorkspacePort, type BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type CreateProtectedAgentCandidateModelPortOptions, type DisposePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, PreparedAgentCandidateExecution, type RecoverExpiredAgentCandidateOptions, VerifiedAgentCandidate, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle };
|
|
228
|
+
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, AgentCandidateExecutionAttemptRecord, AgentCandidateExecutionAttemptRef, AgentCandidateExecutionClaim, AgentCandidateExecutionClaimResult, AgentCandidateExecutionClaimStore, AgentCandidateExecutionFinishResult, AgentCandidateExecutionLease, AgentCandidateExecutionPhaseResult, AgentCandidateExecutionPorts, AgentCandidateExecutionRecoveryEvidence, AgentCandidateExecutionStageResult, AgentCandidateExecutionTerminalResult, AgentCandidateExecutorPort, AgentCandidateExecutorWorkspaceFile, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantSettleInput, AgentCandidateModelPort, AgentCandidateOutputArtifactPort, AgentCandidateOutputPurpose, type AgentCandidateProfileSource, AgentCandidateProtectedModelActivation, AgentCandidateProtectedModelReservation, AgentCandidateProtectedModelSettlement, AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, AgentCandidateWorkspacePort, type BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type CreateProtectedAgentCandidateModelPortOptions, type DisposePreparedAgentCandidateOptions, type ExactProcessCandidateExecutorOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, PreparedAgentCandidateExecution, type RecoverExpiredAgentCandidateOptions, VerifiedAgentCandidate, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle };
|
|
@@ -4,13 +4,16 @@ import {
|
|
|
4
4
|
createProtectedAgentCandidateModelPort,
|
|
5
5
|
disposePreparedAgentCandidateExecution,
|
|
6
6
|
recoverExpiredAgentCandidateExecution
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-DA7YL6I4.js";
|
|
8
|
+
import {
|
|
9
|
+
exactProcessProviderAsCandidateExecutor
|
|
10
|
+
} from "../chunk-SPCD4IQQ.js";
|
|
8
11
|
import {
|
|
9
12
|
captureAgentCandidateWorkspace,
|
|
10
13
|
captureAgentCandidateWorkspaceFiles,
|
|
11
14
|
createAgentCandidateWorkspacePort,
|
|
12
15
|
sealAgentCandidateBundle
|
|
13
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-AIBIRAJ6.js";
|
|
14
17
|
import {
|
|
15
18
|
AGENT_CANDIDATE_EXECUTION_SUPPORT,
|
|
16
19
|
CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV,
|
|
@@ -27,7 +30,7 @@ import {
|
|
|
27
30
|
persistCandidateOutputArtifact,
|
|
28
31
|
prepareAgentCandidateExecution,
|
|
29
32
|
verifyAgentCandidateBundle
|
|
30
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-TGDHHHH4.js";
|
|
31
34
|
import "../chunk-IMSNJSXH.js";
|
|
32
35
|
import "../chunk-3MDZX7YU.js";
|
|
33
36
|
export {
|
|
@@ -47,6 +50,7 @@ export {
|
|
|
47
50
|
createAgentCandidateWorkspacePort,
|
|
48
51
|
createProtectedAgentCandidateModelPort,
|
|
49
52
|
disposePreparedAgentCandidateExecution,
|
|
53
|
+
exactProcessProviderAsCandidateExecutor,
|
|
50
54
|
executePreparedAgentCandidate,
|
|
51
55
|
parseExactAgentProfile,
|
|
52
56
|
parseExactAgentProfileDiff,
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
captureAgentCandidateWorkspace,
|
|
6
6
|
sealAgentCandidateBundle
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AIBIRAJ6.js";
|
|
8
8
|
import {
|
|
9
9
|
createAgentImprovementActivationResult
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LKKIM5QD.js";
|
|
11
11
|
import {
|
|
12
12
|
canonicalCandidateBytes,
|
|
13
13
|
embeddedCandidateArtifact,
|
|
14
14
|
omitTopLevelDigest,
|
|
15
15
|
persistCandidateOutputArtifact
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TGDHHHH4.js";
|
|
17
17
|
import {
|
|
18
18
|
supervise
|
|
19
19
|
} from "./chunk-KVJQV342.js";
|
|
@@ -471,4 +471,4 @@ export {
|
|
|
471
471
|
runKnowledgeImprovementJob,
|
|
472
472
|
buildKnowledgeImprovementExperimentBundles
|
|
473
473
|
};
|
|
474
|
-
//# sourceMappingURL=chunk-
|
|
474
|
+
//# sourceMappingURL=chunk-23Z7N5IG.js.map
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
verifiedResourceTextByDigest,
|
|
17
17
|
verifyAgentCandidateBundle,
|
|
18
18
|
verifyCanonicalCandidateDocument
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TGDHHHH4.js";
|
|
20
20
|
import {
|
|
21
21
|
assertModelAllowed,
|
|
22
22
|
harnessInvocation,
|
|
@@ -244,7 +244,7 @@ ${attemptNote}` : basePrompt;
|
|
|
244
244
|
worktreePath,
|
|
245
245
|
verified: false
|
|
246
246
|
});
|
|
247
|
-
return
|
|
247
|
+
return acceptedCandidate(findings);
|
|
248
248
|
}
|
|
249
249
|
let result;
|
|
250
250
|
try {
|
|
@@ -264,7 +264,7 @@ ${attemptNote}` : basePrompt;
|
|
|
264
264
|
worktreePath,
|
|
265
265
|
verified: true
|
|
266
266
|
});
|
|
267
|
-
return
|
|
267
|
+
return acceptedCandidate(findings);
|
|
268
268
|
}
|
|
269
269
|
await emitShotDisposition(opts.onShotDisposition, receipt, {
|
|
270
270
|
kind: "rejected",
|
|
@@ -619,6 +619,26 @@ function summarize(findings) {
|
|
|
619
619
|
if (findings.length === 1) return `agentic: ${truncate(findings[0].claim, 64)}`;
|
|
620
620
|
return `agentic: ${findings.length} findings addressed`;
|
|
621
621
|
}
|
|
622
|
+
function acceptedCandidate(findings) {
|
|
623
|
+
const summary = summarize(findings);
|
|
624
|
+
return {
|
|
625
|
+
applied: true,
|
|
626
|
+
summary,
|
|
627
|
+
label: slugify(summary.split("\n", 1)[0] ?? summary),
|
|
628
|
+
rationale: boundedRationale(summary, findings)
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
function slugify(line) {
|
|
632
|
+
const slug = line.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
633
|
+
return truncate(slug || "agentic-improvement", 48);
|
|
634
|
+
}
|
|
635
|
+
function boundedRationale(summary, findings) {
|
|
636
|
+
if (findings.length === 0) return summary;
|
|
637
|
+
return truncate(
|
|
638
|
+
findings.map((finding) => `(${finding.severity}) ${finding.claim}`).join("; "),
|
|
639
|
+
400
|
|
640
|
+
);
|
|
641
|
+
}
|
|
622
642
|
function truncate(s, n) {
|
|
623
643
|
return s.length <= n ? s : `${s.slice(0, n - 1)}\u2026`;
|
|
624
644
|
}
|
|
@@ -688,7 +708,7 @@ function improvementDriver(opts) {
|
|
|
688
708
|
owned.set(wt.path, wt);
|
|
689
709
|
try {
|
|
690
710
|
if (incumbent) advanceToIncumbent(wt, incumbent);
|
|
691
|
-
const { applied, summary } = await opts.generator.generate({
|
|
711
|
+
const { applied, summary, label, rationale } = await opts.generator.generate({
|
|
692
712
|
worktreePath: wt.path,
|
|
693
713
|
report: ctx.report,
|
|
694
714
|
findings,
|
|
@@ -706,7 +726,9 @@ function improvementDriver(opts) {
|
|
|
706
726
|
continue;
|
|
707
727
|
}
|
|
708
728
|
const surface = await opts.worktree.finalize(wt, summary);
|
|
709
|
-
surfaces.push(
|
|
729
|
+
surfaces.push(
|
|
730
|
+
label || rationale ? { surface, label: label ?? "", rationale: rationale ?? "" } : surface
|
|
731
|
+
);
|
|
710
732
|
owned.delete(wt.path);
|
|
711
733
|
owned.set(surface.worktreeRef, wt);
|
|
712
734
|
} catch (err) {
|
|
@@ -2042,4 +2064,4 @@ export {
|
|
|
2042
2064
|
verifyAgentImprovementActivation,
|
|
2043
2065
|
verifyCandidateExecutionEvidence
|
|
2044
2066
|
};
|
|
2045
|
-
//# sourceMappingURL=chunk-
|
|
2067
|
+
//# sourceMappingURL=chunk-4AMAFNUD.js.map
|