loopforge 3.9.2 → 4.0.7
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 +236 -112
- package/dist/audit.d.ts +73 -15
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +131 -61
- package/dist/audit.js.map +1 -1
- package/dist/canonical-state.d.ts +152 -40
- package/dist/canonical-state.d.ts.map +1 -1
- package/dist/canonical-state.js +382 -206
- package/dist/canonical-state.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +41 -12
- package/dist/cli.js.map +1 -1
- package/dist/cognitive-governance.d.ts +0 -2
- package/dist/cognitive-governance.d.ts.map +1 -1
- package/dist/cognitive-governance.js +0 -4
- package/dist/cognitive-governance.js.map +1 -1
- package/dist/committed-round.d.ts +105 -141
- package/dist/committed-round.d.ts.map +1 -1
- package/dist/committed-round.js +249 -372
- package/dist/committed-round.js.map +1 -1
- package/dist/constraint-lifecycle.d.ts +73 -0
- package/dist/constraint-lifecycle.d.ts.map +1 -0
- package/dist/constraint-lifecycle.js +174 -0
- package/dist/constraint-lifecycle.js.map +1 -0
- package/dist/context-boundary.d.ts +83 -0
- package/dist/context-boundary.d.ts.map +1 -0
- package/dist/context-boundary.js +101 -0
- package/dist/context-boundary.js.map +1 -0
- package/dist/contract-items.d.ts +12 -8
- package/dist/contract-items.d.ts.map +1 -1
- package/dist/contract-items.js +31 -26
- package/dist/contract-items.js.map +1 -1
- package/dist/contract-requirement.d.ts +47 -0
- package/dist/contract-requirement.d.ts.map +1 -0
- package/dist/contract-requirement.js +51 -0
- package/dist/contract-requirement.js.map +1 -0
- package/dist/criterion-status.d.ts +35 -0
- package/dist/criterion-status.d.ts.map +1 -0
- package/dist/criterion-status.js +89 -0
- package/dist/criterion-status.js.map +1 -0
- package/dist/enforcement-gate.d.ts +32 -67
- package/dist/enforcement-gate.d.ts.map +1 -1
- package/dist/enforcement-gate.js +203 -439
- package/dist/enforcement-gate.js.map +1 -1
- package/dist/engine.d.ts +9 -103
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +28 -887
- package/dist/engine.js.map +1 -1
- package/dist/errors.d.ts +41 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +69 -0
- package/dist/errors.js.map +1 -0
- package/dist/evidence-claims.d.ts +33 -31
- package/dist/evidence-claims.d.ts.map +1 -1
- package/dist/evidence-claims.js +58 -72
- package/dist/evidence-claims.js.map +1 -1
- package/dist/evidence-posture-view.d.ts +19 -0
- package/dist/evidence-posture-view.d.ts.map +1 -0
- package/dist/evidence-posture-view.js +116 -0
- package/dist/evidence-posture-view.js.map +1 -0
- package/dist/evidence-posture.d.ts +73 -0
- package/dist/evidence-posture.d.ts.map +1 -0
- package/dist/evidence-posture.js +281 -0
- package/dist/evidence-posture.js.map +1 -0
- package/dist/evidence-provider.d.ts +55 -37
- package/dist/evidence-provider.d.ts.map +1 -1
- package/dist/evidence-provider.js +182 -332
- package/dist/evidence-provider.js.map +1 -1
- package/dist/explain.d.ts +167 -27
- package/dist/explain.d.ts.map +1 -1
- package/dist/explain.js +373 -58
- package/dist/explain.js.map +1 -1
- package/dist/field-accounting.d.ts.map +1 -1
- package/dist/field-accounting.js +3 -22
- package/dist/field-accounting.js.map +1 -1
- package/dist/generate-schema.js +13 -8
- package/dist/generate-schema.js.map +1 -1
- package/dist/git-boundary.d.ts +128 -0
- package/dist/git-boundary.d.ts.map +1 -0
- package/dist/git-boundary.js +625 -0
- package/dist/git-boundary.js.map +1 -0
- package/dist/git-facts.d.ts +22 -0
- package/dist/git-facts.d.ts.map +1 -0
- package/dist/git-facts.js +29 -0
- package/dist/git-facts.js.map +1 -0
- package/dist/git-motion.d.ts +37 -0
- package/dist/git-motion.d.ts.map +1 -0
- package/dist/git-motion.js +59 -0
- package/dist/git-motion.js.map +1 -0
- package/dist/history.d.ts +44 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +77 -0
- package/dist/history.js.map +1 -0
- package/dist/index.d.ts +19 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +16 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +80 -14
- package/dist/init.js.map +1 -1
- package/dist/loop-compiler.d.ts +51 -19
- package/dist/loop-compiler.d.ts.map +1 -1
- package/dist/loop-compiler.js +423 -507
- package/dist/loop-compiler.js.map +1 -1
- package/dist/loop-store.d.ts +6 -5
- package/dist/loop-store.d.ts.map +1 -1
- package/dist/loop-store.js +153 -35
- package/dist/loop-store.js.map +1 -1
- package/dist/mcp/round-lifecycle.d.ts +285 -81
- package/dist/mcp/round-lifecycle.d.ts.map +1 -1
- package/dist/mcp/round-lifecycle.js +1629 -574
- package/dist/mcp/round-lifecycle.js.map +1 -1
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +61 -19
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session.d.ts +81 -39
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +963 -271
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/submission-boundary.d.ts +23 -31
- package/dist/mcp/submission-boundary.d.ts.map +1 -1
- package/dist/mcp/submission-boundary.js +242 -82
- package/dist/mcp/submission-boundary.js.map +1 -1
- package/dist/mcp/submission-handle.d.ts +66 -0
- package/dist/mcp/submission-handle.d.ts.map +1 -0
- package/dist/mcp/submission-handle.js +173 -0
- package/dist/mcp/submission-handle.js.map +1 -0
- package/dist/mcp/tools.d.ts +17 -7
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +763 -244
- package/dist/mcp/tools.js.map +1 -1
- package/dist/open-question.d.ts +7 -0
- package/dist/open-question.d.ts.map +1 -0
- package/dist/open-question.js +14 -0
- package/dist/open-question.js.map +1 -0
- package/dist/policy-metrics.d.ts +31 -21
- package/dist/policy-metrics.d.ts.map +1 -1
- package/dist/policy-metrics.js +117 -64
- package/dist/policy-metrics.js.map +1 -1
- package/dist/policy.d.ts +15 -40
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +13 -13
- package/dist/policy.js.map +1 -1
- package/dist/progress.d.ts +45 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +136 -0
- package/dist/progress.js.map +1 -0
- package/dist/prompt-assembler.d.ts +28 -9
- package/dist/prompt-assembler.d.ts.map +1 -1
- package/dist/prompt-assembler.js +592 -603
- package/dist/prompt-assembler.js.map +1 -1
- package/dist/prompt-coverage.d.ts +39 -0
- package/dist/prompt-coverage.d.ts.map +1 -0
- package/dist/prompt-coverage.js +80 -0
- package/dist/prompt-coverage.js.map +1 -0
- package/dist/prompt-freshness.d.ts +25 -0
- package/dist/prompt-freshness.d.ts.map +1 -0
- package/dist/prompt-freshness.js +88 -0
- package/dist/prompt-freshness.js.map +1 -0
- package/dist/prompt-policy.d.ts +14 -4
- package/dist/prompt-policy.d.ts.map +1 -1
- package/dist/prompt-policy.js +29 -10
- package/dist/prompt-policy.js.map +1 -1
- package/dist/protocol.d.ts +875 -419
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +73 -99
- package/dist/protocol.js.map +1 -1
- package/dist/recovery-guidance.d.ts +13 -0
- package/dist/recovery-guidance.d.ts.map +1 -0
- package/dist/recovery-guidance.js +15 -0
- package/dist/recovery-guidance.js.map +1 -0
- package/dist/recovery.d.ts +68 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +234 -0
- package/dist/recovery.js.map +1 -0
- package/dist/replay.d.ts +42 -8
- package/dist/replay.d.ts.map +1 -1
- package/dist/replay.js +311 -84
- package/dist/replay.js.map +1 -1
- package/dist/result-facts.d.ts +45 -0
- package/dist/result-facts.d.ts.map +1 -0
- package/dist/result-facts.js +86 -0
- package/dist/result-facts.js.map +1 -0
- package/dist/round-contract.d.ts +38 -8
- package/dist/round-contract.d.ts.map +1 -1
- package/dist/round-contract.js +71 -31
- package/dist/round-contract.js.map +1 -1
- package/dist/round-coordinator.d.ts +45 -91
- package/dist/round-coordinator.d.ts.map +1 -1
- package/dist/round-coordinator.js +254 -271
- package/dist/round-coordinator.js.map +1 -1
- package/dist/round-driver.d.ts +56 -16
- package/dist/round-driver.d.ts.map +1 -1
- package/dist/round-driver.js +225 -39
- package/dist/round-driver.js.map +1 -1
- package/dist/round-facts.d.ts +33 -52
- package/dist/round-facts.d.ts.map +1 -1
- package/dist/round-facts.js +54 -157
- package/dist/round-facts.js.map +1 -1
- package/dist/round-guidance.d.ts +56 -0
- package/dist/round-guidance.d.ts.map +1 -0
- package/dist/round-guidance.js +161 -0
- package/dist/round-guidance.js.map +1 -0
- package/dist/round-outcome.d.ts +21 -0
- package/dist/round-outcome.d.ts.map +1 -0
- package/dist/round-outcome.js +31 -0
- package/dist/round-outcome.js.map +1 -0
- package/dist/round-transaction.d.ts +168 -21
- package/dist/round-transaction.d.ts.map +1 -1
- package/dist/round-transaction.js +856 -39
- package/dist/round-transaction.js.map +1 -1
- package/dist/self-eval.d.ts +40 -60
- package/dist/self-eval.d.ts.map +1 -1
- package/dist/self-eval.js +455 -384
- package/dist/self-eval.js.map +1 -1
- package/dist/storage.d.ts +16 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +54 -4
- package/dist/storage.js.map +1 -1
- package/dist/subgoal-state.d.ts +2 -3
- package/dist/subgoal-state.d.ts.map +1 -1
- package/dist/subgoal-state.js +2 -3
- package/dist/subgoal-state.js.map +1 -1
- package/dist/submission-guidance.d.ts +43 -21
- package/dist/submission-guidance.d.ts.map +1 -1
- package/dist/submission-guidance.js +368 -262
- package/dist/submission-guidance.js.map +1 -1
- package/dist/submission-receipt.d.ts +16 -8
- package/dist/submission-receipt.d.ts.map +1 -1
- package/dist/submission-receipt.js +146 -51
- package/dist/submission-receipt.js.map +1 -1
- package/dist/token-utils.d.ts +47 -7
- package/dist/token-utils.d.ts.map +1 -1
- package/dist/token-utils.js +66 -15
- package/dist/token-utils.js.map +1 -1
- package/dist/transaction-identity.d.ts +9 -0
- package/dist/transaction-identity.d.ts.map +1 -0
- package/dist/transaction-identity.js +69 -0
- package/dist/transaction-identity.js.map +1 -0
- package/dist/verification-actions.d.ts +13 -0
- package/dist/verification-actions.d.ts.map +1 -0
- package/dist/verification-actions.js +44 -0
- package/dist/verification-actions.js.map +1 -0
- package/dist/verification-gate.d.ts +26 -46
- package/dist/verification-gate.d.ts.map +1 -1
- package/dist/verification-gate.js +218 -427
- package/dist/verification-gate.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/working-memory.d.ts +187 -0
- package/dist/working-memory.d.ts.map +1 -0
- package/dist/working-memory.js +767 -0
- package/dist/working-memory.js.map +1 -0
- package/dist/workspace-checkpoint.d.ts +88 -0
- package/dist/workspace-checkpoint.d.ts.map +1 -0
- package/dist/workspace-checkpoint.js +326 -0
- package/dist/workspace-checkpoint.js.map +1 -0
- package/dist/workspace-restore.d.ts +68 -0
- package/dist/workspace-restore.d.ts.map +1 -0
- package/dist/workspace-restore.js +604 -0
- package/dist/workspace-restore.js.map +1 -0
- package/dist/workspace.d.ts +0 -9
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +0 -17
- package/dist/workspace.js.map +1 -1
- package/loop_policy.json +5 -19
- package/package.json +2 -2
- package/skills/forge/SKILL.md +212 -0
- package/skills/forge/references/evidence-and-contracts.md +204 -0
- package/skills/forge/references/recovery-and-views.md +188 -0
- package/dist/cognitive-facts.d.ts +0 -30
- package/dist/cognitive-facts.d.ts.map +0 -1
- package/dist/cognitive-facts.js +0 -113
- package/dist/cognitive-facts.js.map +0 -1
- package/dist/loop-extras-parser.d.ts +0 -81
- package/dist/loop-extras-parser.d.ts.map +0 -1
- package/dist/loop-extras-parser.js +0 -213
- package/dist/loop-extras-parser.js.map +0 -1
- package/dist/loop-projection.d.ts +0 -6
- package/dist/loop-projection.d.ts.map +0 -1
- package/dist/loop-projection.js +0 -28
- package/dist/loop-projection.js.map +0 -1
- package/skills/perception/SKILL.md +0 -370
|
@@ -10,44 +10,30 @@
|
|
|
10
10
|
* session ownership, queues, and leases remain in SessionManager.
|
|
11
11
|
*/
|
|
12
12
|
import { LoopForgeEngine } from "../engine.js";
|
|
13
|
-
import type {
|
|
14
|
-
import type { MachineObservation } from "../protocol.js";
|
|
13
|
+
import type { CheckpointRef, EvidencePosture, LoopCompileRequest, OperatorAcceptance, PromptContextMode, PromptContextReason, RecoveryRequest, RoundOutcome, SelfEvaluation, SubmissionDiagnostic, SubmissionGuidance, SubmissionHandle, SubmissionReceipt, VerificationFlag, LoopTerminalSink, StopReason } from "../protocol.js";
|
|
15
14
|
import type { RoundTransactionSnapshot } from "../round-transaction.js";
|
|
15
|
+
import { FileWorkspaceCheckpointStore } from "../workspace-checkpoint.js";
|
|
16
16
|
import type { LoopStore, VaultEntry } from "../loop-store.js";
|
|
17
|
-
import type { SessionStateStore } from "../storage.js";
|
|
17
|
+
import type { SessionSaveOptions, SessionStateStore } from "../storage.js";
|
|
18
18
|
export interface McpSession {
|
|
19
|
+
/** v4.0.4: a LIVE key inside this process. It is persisted and rebuilt by
|
|
20
|
+
* `loopforge_resume`/`autoResumeAll`, but it is not the durable identity:
|
|
21
|
+
* relationships and recovery use `loopId`. */
|
|
19
22
|
sessionId: string;
|
|
23
|
+
/** The one durable loop identity. */
|
|
20
24
|
loopId: string;
|
|
25
|
+
/** The compile-time task text; the immutable operator objective is a
|
|
26
|
+
* separate committed fact (`OperatorAcceptance`). */
|
|
21
27
|
task: string;
|
|
22
28
|
engine: LoopForgeEngine;
|
|
23
29
|
currentRound: number;
|
|
24
30
|
maxRounds: number;
|
|
25
|
-
successTrajectory: boolean[];
|
|
26
31
|
status: "running" | "stopped" | "stalled" | "paused";
|
|
27
32
|
createdAt: number;
|
|
28
|
-
/** Previous round's validated SelfEvaluation — used by verification gate. */
|
|
29
|
-
lastSelfEval?: SelfEvaluation;
|
|
30
33
|
consecutiveRejections: number;
|
|
31
34
|
/** Which enforcement check triggered the last rejection.
|
|
32
35
|
* Only same-check rejections accumulate toward the max. */
|
|
33
36
|
lastRejectionCheck: string;
|
|
34
|
-
/** v2.13: Files changed in skipped rounds during the last backtrack.
|
|
35
|
-
* The next round's verification gate checks that the agent did not
|
|
36
|
-
* continue working on stale files without restoring the workspace.
|
|
37
|
-
* Cleared after the first successful post-backtrack round. */
|
|
38
|
-
backtrackSkippedFiles: string[];
|
|
39
|
-
/** M3 (v3.7.x): git fingerprint of each skipped file at its failed round
|
|
40
|
-
* — machine proof for the workspace-restore check. Cleared with
|
|
41
|
-
* backtrackSkippedFiles after the restore round. */
|
|
42
|
-
backtrackSkippedFingerprints: Record<string, string>;
|
|
43
|
-
/** v2.12: Git HEAD of the last backtrack restore point. The verification
|
|
44
|
-
* gate checks the workspace returns to this commit before accepting.
|
|
45
|
-
* Cleared after the first successful post-backtrack round. */
|
|
46
|
-
backtrackTargetGitHead?: string;
|
|
47
|
-
/** v3.9: files already dirty at that restore point — the baseline the
|
|
48
|
-
* restored workspace is compared against, so unrelated work in progress
|
|
49
|
-
* does not read as a failed restore. Cleared with the HEAD above. */
|
|
50
|
-
backtrackTargetDirty?: string[];
|
|
51
37
|
/** v3.8.3: the trusted round-start fingerprint of every enabled command's
|
|
52
38
|
* entrypoint files, captured when the CURRENT in-flight round was prepared.
|
|
53
39
|
*
|
|
@@ -57,20 +43,12 @@ export interface McpSession {
|
|
|
57
43
|
* appears in and a re-derived baseline could launder. Absent means the
|
|
58
44
|
* round runs without that arm — never a lost round. */
|
|
59
45
|
entrypointTrust?: Record<string, string>;
|
|
60
|
-
/**
|
|
61
|
-
|
|
46
|
+
/** v3.9.7: operator-owned immutable acceptance, carried as a session cursor
|
|
47
|
+
* so a recovery that clears the held snapshot cannot lose it. The root
|
|
48
|
+
* committed round-1 transaction remains the authority. */
|
|
49
|
+
operatorAcceptance?: OperatorAcceptance;
|
|
62
50
|
/** Schema-versioned transaction for the prompt currently held by the agent. */
|
|
63
51
|
roundSnapshot?: RoundTransactionSnapshot;
|
|
64
|
-
/** Persisted prompt prevents resume from compiling the same round twice. */
|
|
65
|
-
currentPrompt?: string | null;
|
|
66
|
-
currentLevel?: string;
|
|
67
|
-
/** Structured warnings from the most recent compile — preferred over regex parsing. */
|
|
68
|
-
currentWarnings?: string[];
|
|
69
|
-
/** v3.0.1: The full compile response of the current round, cached so the
|
|
70
|
-
* typed projection (getProjection) derives from it instead of recompiling
|
|
71
|
-
* the whole vault. Freshness is checked via loop_id + round; rebuilt by
|
|
72
|
-
* every compile path. Not persisted — cold sessions fall back to compiling. */
|
|
73
|
-
lastCompileResponse?: LoopForgeResponse | null;
|
|
74
52
|
}
|
|
75
53
|
export interface McpSessionSummary {
|
|
76
54
|
sessionId: string;
|
|
@@ -82,43 +60,156 @@ export interface StartInput {
|
|
|
82
60
|
task: string;
|
|
83
61
|
loopId?: string;
|
|
84
62
|
maxRounds?: number;
|
|
85
|
-
domain?: string;
|
|
86
63
|
planSource?: string;
|
|
87
64
|
constraints?: string[];
|
|
65
|
+
/** v3.9.4: initial local requirements, each becoming a stable `cr-*` anchor
|
|
66
|
+
* in the objective. Omit to keep the default criterion. */
|
|
67
|
+
criteria?: string[];
|
|
88
68
|
}
|
|
69
|
+
/** v4.0.5: the host's invocation-level input. It is carried into ONE prompt
|
|
70
|
+
* compilation/artifact and never stored as loop task, acceptance, history or
|
|
71
|
+
* Working Memory. The host owns cross-process persistence. */
|
|
72
|
+
export interface InvocationInputs {
|
|
73
|
+
/** Trimmed, non-empty. An empty/whitespace value is `invalid_argument`. */
|
|
74
|
+
currentUserInstruction?: string;
|
|
75
|
+
}
|
|
76
|
+
/** v4.0.5: resume/unpause transport input. `invocationLost` is the host's
|
|
77
|
+
* declaration that the original in-context retry invocation is gone; it is
|
|
78
|
+
* never persisted and only changes the context reason of the SAME attempt. */
|
|
79
|
+
export interface ResumeInputs extends InvocationInputs {
|
|
80
|
+
invocationLost?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** v4.0.5: a structural defect in invocation input. The MCP handlers map this
|
|
83
|
+
* to `invalid_argument`; it is never a policy or round defect. */
|
|
84
|
+
export declare class InvocationInputError extends Error {
|
|
85
|
+
readonly code = "invalid_argument";
|
|
86
|
+
}
|
|
87
|
+
/** v4.0.5: normalize the invocation instruction at the transport boundary.
|
|
88
|
+
* `undefined`/absent stays absent ("not provided"); non-string or
|
|
89
|
+
* empty/whitespace is a structural defect. The trimmed text is stored
|
|
90
|
+
* verbatim — no case folding, no internal-whitespace folding. */
|
|
91
|
+
export declare function normalizeCurrentUserInstruction(raw: unknown): string | undefined;
|
|
92
|
+
/** v4.0.5: normalize a whole transport input bundle before any state is read
|
|
93
|
+
* or mutated. */
|
|
94
|
+
export declare function normalizeInvocationInputs<T extends InvocationInputs>(inputs?: T): T | undefined;
|
|
95
|
+
/** v3.9.4: a structural defect in the start criteria argument. The MCP
|
|
96
|
+
* handler maps this to `invalid_argument`; it is never a policy defect. */
|
|
97
|
+
export declare class StartCriteriaError extends Error {
|
|
98
|
+
readonly code = "invalid_argument";
|
|
99
|
+
}
|
|
100
|
+
/** v3.9.4: normalize initial criteria at the start boundary.
|
|
101
|
+
*
|
|
102
|
+
* - a non-array / non-string element is a structural defect (throws);
|
|
103
|
+
* - empty text is dropped with a warning;
|
|
104
|
+
* - duplicate normalized-exact text keeps the first spelling, with a
|
|
105
|
+
* warning (the stable id derivation would otherwise produce two entries
|
|
106
|
+
* with one `cr-*` id);
|
|
107
|
+
* - over `policy.evolution.max_start_criteria` is dropped from the tail with
|
|
108
|
+
* a warning;
|
|
109
|
+
* - an empty result is the caller's signal to keep the default criterion. */
|
|
110
|
+
export declare function normalizeStartCriteria(raw: unknown): {
|
|
111
|
+
criteria: string[];
|
|
112
|
+
warnings: string[];
|
|
113
|
+
};
|
|
114
|
+
/** v4.0.4: the terminal reason a manual `loopforge_stop` reports to the
|
|
115
|
+
* terminal sink and in its response. It is never persisted as a committed
|
|
116
|
+
* round fact, so status/resume after a restart still report "no committed
|
|
117
|
+
* terminal reason". One constant keeps the response and the sink aligned. */
|
|
118
|
+
export declare const MANUAL_STOP_REASON: "cancelled";
|
|
89
119
|
export interface AdvanceResult {
|
|
90
120
|
sessionId: string;
|
|
121
|
+
/** Durable loop identity, returned with the held prompt so a restarted
|
|
122
|
+
* agent can call `loopforge_resume` without reconstructing IDs. Absent on
|
|
123
|
+
* results that have no session (for example a missing-handle refusal). */
|
|
124
|
+
loopId?: string;
|
|
125
|
+
/** On a continue result this is the NEXT round being prepared; the
|
|
126
|
+
* `agentOutcome` field and the receipt describe the round that was just
|
|
127
|
+
* submitted. Use `submission_receipt.round_id` as the authoritative
|
|
128
|
+
* identity of the submitted round. */
|
|
91
129
|
round: number;
|
|
92
|
-
/**
|
|
93
|
-
|
|
130
|
+
/** v4.0.0: the ONE transport anchor for the held attempt. Derived from the
|
|
131
|
+
* persisted snapshot; never persisted itself. Absent on terminal results. */
|
|
132
|
+
submissionHandle?: SubmissionHandle;
|
|
133
|
+
/** v3.9.7: the held transaction's before-image + mid savepoints. */
|
|
134
|
+
checkpoints?: CheckpointRef[];
|
|
135
|
+
/** v3.9.7: explicit fact when the automatic before-image failed. */
|
|
136
|
+
beforeCheckpointError?: {
|
|
137
|
+
code: string;
|
|
138
|
+
detail: string;
|
|
139
|
+
};
|
|
94
140
|
prompt: string | null;
|
|
95
|
-
|
|
141
|
+
/** v4.0.4: LoopForge's terminal reason. ONLY a `StopReason` — session
|
|
142
|
+
* state, handle/payload/session errors are reported through
|
|
143
|
+
* `sessionStatus`/`submissionError` and never masquerade as a stop reason. */
|
|
144
|
+
stopReason?: StopReason;
|
|
145
|
+
/** v4.0.4: the live session's status when the result is not a loop terminal
|
|
146
|
+
* reason. `paused`/`stopped`/`stalled` describe the SESSION, not a
|
|
147
|
+
* `StopReason`; `running` is present only where the caller needs the
|
|
148
|
+
* distinction. */
|
|
149
|
+
sessionStatus?: "running" | "stopped" | "paused" | "stalled";
|
|
96
150
|
/** v2.0.1: Human-readable context for why the loop stopped.
|
|
97
151
|
* Provides facts the agent can use to decide its next action,
|
|
98
152
|
* without LoopForge prescribing a specific behavior. */
|
|
99
153
|
stopDetail?: string;
|
|
100
154
|
level?: string;
|
|
101
|
-
|
|
155
|
+
/** v4.0.2: the context boundary of the delivered prompt. Projected from the
|
|
156
|
+
* PromptArtifact, never re-derived by the lifecycle. Absent when this
|
|
157
|
+
* result carries no prompt. */
|
|
158
|
+
contextMode?: PromptContextMode;
|
|
159
|
+
contextReason?: PromptContextReason;
|
|
160
|
+
agentSuccessClaim?: boolean;
|
|
161
|
+
/** v4.0.6: the Agent-declared outcome of the round this result is about. */
|
|
162
|
+
agentOutcome?: RoundOutcome | null;
|
|
163
|
+
/** v4.0.4: the Agent's declared should_continue of the same round. */
|
|
164
|
+
agentShouldContinue?: boolean;
|
|
102
165
|
warnings?: string[];
|
|
103
166
|
/** v1.13: Enforcement action for this round. accept/reject/terminate.
|
|
104
167
|
* When "reject", the prompt contains a rejection notice and the agent
|
|
105
168
|
* must redo the same round. Round counter does NOT increment. */
|
|
106
|
-
enforcementAction?: "accept" | "reject" | "terminate" | "backtrack";
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
|
|
111
|
-
verificationStatus?: RoundVerificationStatus;
|
|
169
|
+
enforcementAction?: "accept" | "reject" | "terminate" | "backtrack" | "recovery";
|
|
170
|
+
/** v4.0.3: the ONE evidence posture of the round this result is about.
|
|
171
|
+
* Accepted rounds carry the persisted posture; a rejection carries its
|
|
172
|
+
* transient copy. Never a verdict about the agent's work quality. */
|
|
173
|
+
evidencePosture?: EvidencePosture;
|
|
112
174
|
/** v1.13: When enforcementAction is "reject" or "terminate", the reason
|
|
113
175
|
* why the round was rejected or the loop was terminated. */
|
|
114
176
|
enforcementReason?: string;
|
|
177
|
+
/** v3.9.7: the committed rollback directive facts and the verified restore
|
|
178
|
+
* that produced the redo prompt. The Agent does not restore the workspace;
|
|
179
|
+
* LoopForge already did. */
|
|
180
|
+
recovery?: {
|
|
181
|
+
origin: "agent" | "machine";
|
|
182
|
+
reason: string;
|
|
183
|
+
target_checkpoint_id: string;
|
|
184
|
+
redo_round: number;
|
|
185
|
+
restore: {
|
|
186
|
+
status: "verified";
|
|
187
|
+
head?: string;
|
|
188
|
+
previous_head?: string;
|
|
189
|
+
safety_ref?: string;
|
|
190
|
+
files_written: number;
|
|
191
|
+
files_deleted: number;
|
|
192
|
+
verified_at: number;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
115
195
|
/** v3.8.1: set when the RUNTIME refused the submission before touching any
|
|
116
196
|
* state — the same `ToolErrorCode` as `stopReason`, plus the structured
|
|
117
197
|
* details a transport maps onto its error envelope. Produced by
|
|
118
198
|
* `validateSubmission` in submission-boundary.ts, which SessionManager
|
|
119
199
|
* runs before its queue and lease heartbeat. */
|
|
120
200
|
submissionError?: {
|
|
121
|
-
code: "evaluation_invalid" | "contract_invalid"
|
|
201
|
+
code: "evaluation_invalid" | "contract_invalid" | "invalid_argument" | "session_not_found" | "submission_handle_required" | "submission_handle_mismatch" | "recovery_invalid" | "recovery_disabled" | "recovery_unavailable" | "checkpoint_invalid" | "checkpoint_unavailable" | "checkpoint_failed" | "checkpoint_limit" | "restore_failed" | "restore_pending"
|
|
202
|
+
/** v4.0.4: another live process owns the session lease; this is a
|
|
203
|
+
* session error, not a loop terminal reason. */
|
|
204
|
+
| "lease_conflict";
|
|
205
|
+
details: Record<string, unknown>;
|
|
206
|
+
};
|
|
207
|
+
/** v3.9.4: a prompt-projection code defect. This is NOT a submission
|
|
208
|
+
* refusal (the round may already be committed); the next prompt was not
|
|
209
|
+
* delivered and the session is stalled. The MCP envelope maps it to the
|
|
210
|
+
* `projection_incomplete` error code. */
|
|
211
|
+
projectionError?: {
|
|
212
|
+
code: "projection_incomplete";
|
|
122
213
|
details: Record<string, unknown>;
|
|
123
214
|
};
|
|
124
215
|
/** v3.9.1: current-fact submission guidance for the held/prepared round.
|
|
@@ -145,10 +236,13 @@ export interface RoundLifecycleDeps {
|
|
|
145
236
|
ownerId: string;
|
|
146
237
|
/** Session lease duration; stamped into saved session entries. */
|
|
147
238
|
leaseMs: number;
|
|
148
|
-
/**
|
|
149
|
-
|
|
239
|
+
/** v3.9.7: per-loop checkpoint store. Absent disables automatic
|
|
240
|
+
* before-images (the round still runs with an explicit error fact). */
|
|
241
|
+
checkpointStoreFor?: (loopId: string) => FileWorkspaceCheckpointStore | undefined;
|
|
150
242
|
}
|
|
151
|
-
export declare function buildLoopRequest(session: McpSession,
|
|
243
|
+
export declare function buildLoopRequest(session: McpSession,
|
|
244
|
+
/** v4.0.5: the host's explicit invocation input for THIS compile. */
|
|
245
|
+
inputs?: InvocationInputs): LoopCompileRequest;
|
|
152
246
|
export declare class RoundLifecycle {
|
|
153
247
|
private readonly store;
|
|
154
248
|
private readonly sessionStore;
|
|
@@ -156,19 +250,30 @@ export declare class RoundLifecycle {
|
|
|
156
250
|
private readonly terminalSinks;
|
|
157
251
|
private readonly ownerId;
|
|
158
252
|
private readonly leaseMs;
|
|
159
|
-
private readonly
|
|
253
|
+
private readonly checkpointStoreFor;
|
|
160
254
|
constructor(deps: RoundLifecycleDeps);
|
|
255
|
+
/** v3.9.7: the one RoundDriver construction site. Every prepare must carry
|
|
256
|
+
* the per-loop checkpoint store, or no round can produce a before-image. */
|
|
257
|
+
private driver;
|
|
161
258
|
/** v3.9.1: the submission-guidance projection for a session's held round.
|
|
162
|
-
* One history
|
|
259
|
+
* One history read and one compile window, no writes.
|
|
163
260
|
* Findings from a rejected/retried attempt are supplied by the caller. */
|
|
164
261
|
guidanceFor(session: McpSession, extras?: {
|
|
165
262
|
verificationFlags?: ReadonlyArray<VerificationFlag>;
|
|
166
263
|
recovery?: {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
264
|
+
pending: boolean;
|
|
265
|
+
redo_round: number;
|
|
266
|
+
checkpoint_id: string;
|
|
267
|
+
restore_verified: boolean;
|
|
268
|
+
origin?: "agent" | "machine";
|
|
269
|
+
reason?: string;
|
|
170
270
|
} | null;
|
|
171
271
|
}): SubmissionGuidance;
|
|
272
|
+
/** The operator criteria the held prompt's reference space was built from.
|
|
273
|
+
* The held acceptance wins; committed objective lineage is the fallback for
|
|
274
|
+
* a session whose snapshot predates the acceptance field. Null when neither
|
|
275
|
+
* is observable — callers fail open. */
|
|
276
|
+
private objectiveCriteriaFor;
|
|
172
277
|
/** v3.9.1: the before facts of the round being submitted, from the SAME
|
|
173
278
|
* history window the compile uses. Works on a replay too: rounds below the
|
|
174
279
|
* logical round exclude the round itself. */
|
|
@@ -179,7 +284,7 @@ export declare class RoundLifecycle {
|
|
|
179
284
|
/** Persist session state to vault for cross-process recovery.
|
|
180
285
|
* The filtered vault and replacement entry are written once under the
|
|
181
286
|
* backend lock, so recovery never observes the old two-write gap. */
|
|
182
|
-
save(session: McpSession): void;
|
|
287
|
+
save(session: McpSession, options?: SessionSaveOptions): void;
|
|
183
288
|
/** Reconstruct a McpSession from a vault session_state entry.
|
|
184
289
|
* Returns null if the entry is not "running" status.
|
|
185
290
|
* Shared by resume() and autoResumeAll(). */
|
|
@@ -210,25 +315,101 @@ export declare class RoundLifecycle {
|
|
|
210
315
|
*
|
|
211
316
|
* Best-effort: an unreadable policy or an unresolvable command must leave
|
|
212
317
|
* the round without the absolute arm, not fail the preparation. */
|
|
213
|
-
|
|
318
|
+
/** v4.0.3: seed the round-start entrypoint baseline. Public so the start
|
|
319
|
+
* path can seed BEFORE the first prompt is delivered; a missing baseline
|
|
320
|
+
* must never be re-derived from an already-modified workspace. */
|
|
321
|
+
seedEntrypointTrust(session: McpSession): void;
|
|
322
|
+
/** v4.0.3: warnings for a resumed round whose trusted baseline is absent.
|
|
323
|
+
* The workspace may already have been modified; re-capturing it would
|
|
324
|
+
* launder the change, so the round runs with the Git-delta arm only. */
|
|
325
|
+
private resumeWarnings;
|
|
326
|
+
/** v3.9.7: operator acceptance and branch identity travel with the session
|
|
327
|
+
* cursor (not only the held snapshot). Every prepare carries them forward;
|
|
328
|
+
* a recovery that clears the held snapshot must not reset the branch to
|
|
329
|
+
* root or lose the operator's acceptance surface. */
|
|
330
|
+
private prepareOptions;
|
|
214
331
|
private persistPrepared;
|
|
215
|
-
|
|
332
|
+
/** v4.0.2: the context boundary carried by a prompt-bearing result. It is
|
|
333
|
+
* a PROJECTION of the artifact that produced the prompt — never a second
|
|
334
|
+
* derivation from live session state. */
|
|
335
|
+
private contextFacts;
|
|
336
|
+
/** v3.9.7: execution metadata attached to every held/prepared prompt. These
|
|
337
|
+
* are transport facts, never prompt governance content. v4.0.0: the anchor
|
|
338
|
+
* itself is the separate `submissionHandle`; this bundle owns only the
|
|
339
|
+
* checkpoint facts. */
|
|
340
|
+
private transactionFacts;
|
|
341
|
+
/** v4.0.0: the transport handle for the current held snapshot, or absent. */
|
|
342
|
+
private heldHandle;
|
|
343
|
+
/** v3.9.7: guidance facts for a redo whose restore is already verified.
|
|
344
|
+
* They are derived from the still-pending committed directive, so a
|
|
345
|
+
* restart returns the same surface as the original recovery response. */
|
|
346
|
+
private pendingRecoveryGuidance;
|
|
347
|
+
/** v4.0.0: return the exact stored prompt plus the CURRENT handle. This is
|
|
348
|
+
* the ONE path that re-delivers a prompt without compiling. It fails closed
|
|
349
|
+
* unless the full held predicate holds (phase, round, attempt, rendered
|
|
350
|
+
* prompt), so a committed/terminated/retrying snapshot can never masquerade
|
|
351
|
+
* as held. The warning is appended without mutating the artifact. Public so
|
|
352
|
+
* SessionManager can use it on its pre-queue stale-handle path. */
|
|
353
|
+
heldPromptResult(session: McpSession, warning?: string): AdvanceResult | null;
|
|
216
354
|
/** Reconcile the crash window where feedback committed but session_state
|
|
217
355
|
* still points at the old prompt. Returns null when no commit is pending.
|
|
218
356
|
* v3.7: async — the continue-after-crash branch compiles through
|
|
219
357
|
* RoundDriver.prepare (the sync prepareSync fallback was removed). */
|
|
220
358
|
private reconcileCommittedRound;
|
|
359
|
+
/** v3.9.7: a committed directive with no verified redo snapshot must be
|
|
360
|
+
* completed BEFORE any ordinary compile/held-prompt path. The restore and
|
|
361
|
+
* redo prepare are idempotent; a verified held redo prompt is returned
|
|
362
|
+
* without re-checking the workspace (the Agent may already have worked). */
|
|
363
|
+
private completePendingRecovery;
|
|
364
|
+
/** v4.0.5: the zero-side-effect refusal for a cold handoff whose held retry
|
|
365
|
+
* facts are missing or inconsistent. Nothing is saved, compiled or
|
|
366
|
+
* advanced; the held snapshot and handle are unchanged. */
|
|
367
|
+
private invocationRecoveryUnavailable;
|
|
368
|
+
/** v4.0.5: map a compile failure onto the existing stalled/coverage result.
|
|
369
|
+
* Returns null for an unexpected error so the caller can rethrow it. */
|
|
370
|
+
private compileStalledResult;
|
|
371
|
+
/** v4.0.5: ONE held-prompt entry for resume/unpause/recovery. With no new
|
|
372
|
+
* instruction it re-delivers the stored prompt and handle unchanged; with a
|
|
373
|
+
* new instruction it recompiles the SAME round/attempt and preserves the
|
|
374
|
+
* held context boundary (including an existing invocation recovery). */
|
|
375
|
+
private heldPromptWithInputs;
|
|
376
|
+
/** v4.0.5: the public `loopforge_next` instruction-recompile entry. It only
|
|
377
|
+
* recompiles the held prompt for a new invocation instruction: no
|
|
378
|
+
* submission, no round/attempt change, no evidence collection. The handle
|
|
379
|
+
* was validated by SessionManager before its queue and lease heartbeat. */
|
|
380
|
+
recompileHeldWithInstruction(session: McpSession, instruction: string): Promise<AdvanceResult>;
|
|
381
|
+
/** v4.0.5: compile a held prompt again without collecting evidence, writing
|
|
382
|
+
* the Vault, changing attempt/round or touching retry counters. */
|
|
383
|
+
private recompileHeldPrompt;
|
|
384
|
+
/** v4.0.5: compile the retry prompt for a rejected attempt that has no held
|
|
385
|
+
* prompt (its retry compile failed before). This is the one path that
|
|
386
|
+
* creates the next attempt for such a session. */
|
|
387
|
+
private prepareRetryWithInputs;
|
|
388
|
+
/** v4.0.5: recompile the SAME retry attempt when the host declared the
|
|
389
|
+
* original invocation lost, or when a submitted retry prompt never existed
|
|
390
|
+
* (rejected snapshot). Returns null when this session has no retry material
|
|
391
|
+
* or when the held prompt is already a clean context (idempotent no-op). */
|
|
392
|
+
private recompileRetryAttempt;
|
|
393
|
+
/** A rejected round still owns its original before-image. Recover its next
|
|
394
|
+
* attempt through the same retry preparation used by a live rejection;
|
|
395
|
+
* ordinary prepare would recapture evidence and reset snapshot.attempt.
|
|
396
|
+
* v4.0.5: the instruction travels with the compile and is inherited from
|
|
397
|
+
* the rejected prompt within the same logical round. */
|
|
398
|
+
private prepareMissingPrompt;
|
|
221
399
|
/** Resume tail: the session has been reconstructed and registered. Reconcile
|
|
222
400
|
* a committed-but-undelivered round, restore the held prompt, or recover a
|
|
223
401
|
* missing prompt from current round state. v3.7: async — compilation runs
|
|
224
402
|
* through RoundDriver.prepare like unpause (the prepareSync fallback was
|
|
225
403
|
* removed); a failed compile now degrades to the same stalled terminal
|
|
226
|
-
* result unpause returns instead of persisting a null prompt.
|
|
227
|
-
|
|
404
|
+
* result unpause returns instead of persisting a null prompt.
|
|
405
|
+
* v4.0.5: an `invocationLost` retry is recompiled as a cold-context prompt
|
|
406
|
+
* for the SAME logical round/attempt, before the ordinary held-prompt path. */
|
|
407
|
+
resume(session: McpSession, inputs?: ResumeInputs): Promise<AdvanceResult>;
|
|
228
408
|
/** Unpause tail: the session has been reconstructed and registered with
|
|
229
|
-
* status "running".
|
|
230
|
-
*
|
|
231
|
-
|
|
409
|
+
* status "running". Reconcile a committed round, restore the held prompt,
|
|
410
|
+
* or compile the next prompt from the committed window. v4.0.5: the same
|
|
411
|
+
* invocation inputs and cold-handoff recompile apply here. */
|
|
412
|
+
unpause(session: McpSession, inputs?: ResumeInputs): Promise<AdvanceResult>;
|
|
232
413
|
/** Record a gate_opened entry when an accepted round reports a high-risk
|
|
233
414
|
* blocker (USER_RISK hit). Idempotent per gate. The gate is a record
|
|
234
415
|
* layer — it never blocks the round decision flow. */
|
|
@@ -240,20 +421,35 @@ export declare class RoundLifecycle {
|
|
|
240
421
|
private extractEvaluation;
|
|
241
422
|
/** Execute the round transaction and apply per-rule rejection tracking.
|
|
242
423
|
* MUTATES: session.roundSnapshot, session.consecutiveRejections,
|
|
243
|
-
* session.lastRejectionCheck
|
|
244
|
-
* session.successTrajectory */
|
|
424
|
+
* session.lastRejectionCheck */
|
|
245
425
|
private executeRoundTransaction;
|
|
246
426
|
/** Build a rejection result: compile a retry prompt, persist, return.
|
|
247
427
|
* MUTATES: session.roundSnapshot, session.currentPrompt, session.currentLevel */
|
|
248
428
|
private buildRejectionResult;
|
|
249
|
-
/**
|
|
250
|
-
*
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
*
|
|
254
|
-
|
|
255
|
-
|
|
429
|
+
/** v3.9.7: the workspace/state-dir facts shared by restore preflight and
|
|
430
|
+
* execution. The state directory is never part of the restored boundary. */
|
|
431
|
+
private restoreContext;
|
|
432
|
+
/** Execute the committed directive's restore, verify it, then compile the
|
|
433
|
+
* redo from the SAME baseline. The directive is never rewritten. */
|
|
434
|
+
private runRestoreAndPrepare;
|
|
435
|
+
/** Failed restore: the directive remains pending, no prompt exists, and the
|
|
436
|
+
* session is resumable. */
|
|
437
|
+
private restoreFailedResult;
|
|
438
|
+
/** v2.10: Build a backtrack result. The directive is already committed;
|
|
439
|
+
* LoopForge executes and verifies the restore, then compiles the redo from
|
|
440
|
+
* the verified baseline. A failed restore leaves the directive pending and
|
|
441
|
+
* the session stalled — no redo prompt is ever issued unverified. */
|
|
256
442
|
private buildBacktrackResult;
|
|
443
|
+
/** v4.0.4: the ONE terminal stop-detail formatter. Live stop, termination,
|
|
444
|
+
* crash-recovered stop and resume-of-stopped read the same three fact
|
|
445
|
+
* blocks; a committed fact is described identically on every path. */
|
|
446
|
+
private terminalFacts;
|
|
447
|
+
/** v4.0.4: the terminal result of an already-stopped loop, built from
|
|
448
|
+
* committed history. This is the ONE read path for `resume` of a stopped
|
|
449
|
+
* loop: it reports the committed `StopReason` and renders the same three
|
|
450
|
+
* fact blocks as a live stop. A loop with no committed stop round reports
|
|
451
|
+
* the session status and says so instead of inventing a reason. */
|
|
452
|
+
stoppedLoopResult(loopId: string, currentRound: number): AdvanceResult;
|
|
257
453
|
/** Build a termination result: persist stopped status, notify sinks.
|
|
258
454
|
* MUTATES: session.status, session.currentPrompt
|
|
259
455
|
*
|
|
@@ -272,20 +468,28 @@ export declare class RoundLifecycle {
|
|
|
272
468
|
* session.evidenceBaseline, session.roundSnapshot */
|
|
273
469
|
private advanceToNextRound;
|
|
274
470
|
/** M4: mark a session stalled after its round committed but the next
|
|
275
|
-
* prompt could not be prepared/persisted
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
471
|
+
* prompt could not be prepared/persisted. v4.0.0: the committed snapshot is
|
|
472
|
+
* NOT a held prompt, so this result carries no handle; the Agent must call
|
|
473
|
+
* `loopforge_resume`, which reconciles the commit and compiles the next
|
|
474
|
+
* prompt. Re-submitting an old handle can never resurrect the old round. */
|
|
279
475
|
private stalledAfterCommit;
|
|
280
476
|
private advanceUnlocked;
|
|
477
|
+
/** v3.9.6: Agent-initiated recovery. The Agent selects the target; this
|
|
478
|
+
* method only validates it against committed facts, records the rollback
|
|
479
|
+
* directive and compiles the redo. It never runs ordinary verification or
|
|
480
|
+
* enforcement on the abandoned work. */
|
|
481
|
+
recover(sessionId: string, recovery: RecoveryRequest, inputs?: InvocationInputs): Promise<AdvanceResult>;
|
|
482
|
+
/** Execute the committed directive's restore and return the redo prompt. */
|
|
483
|
+
private restoreAndPrepareRedo;
|
|
281
484
|
/** Core cycle entry used by SessionManager.advance after the queue + lease
|
|
282
485
|
* dance: validate → extract → execute transaction → route disposition
|
|
283
486
|
* → advance to next round (continue) or return terminal result.
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
|
|
288
|
-
|
|
487
|
+
* v4.0.0: the submission identity (the exact held transaction) is validated
|
|
488
|
+
* by SessionManager before its queue and lease heartbeat. This entry point
|
|
489
|
+
* owns the round state machine and does not re-check anchors. */
|
|
490
|
+
advance(sessionId: string, output: string, preExtractedEval?: SelfEvaluation, normalizationDiagnostics?: SubmissionDiagnostic[], submittedFields?: string[],
|
|
491
|
+
/** v4.0.5: invocation input for the prompt compiled after this submission. */
|
|
492
|
+
inputs?: InvocationInputs): Promise<AdvanceResult>;
|
|
289
493
|
/** Write back loop knowledge to long-term memory.
|
|
290
494
|
* Uses shared base builder from policy.ts. Called when a loop terminates. */
|
|
291
495
|
notifyTerminal(session: McpSession, stopReason: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-lifecycle.d.ts","sourceRoot":"","sources":["../../src/mcp/round-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"round-lifecycle.d.ts","sourceRoot":"","sources":["../../src/mcp/round-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,kBAAkB,EAElB,kBAAkB,EAElB,iBAAiB,EACjB,mBAAmB,EAEnB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAEjB,gBAAgB,EAEhB,gBAAgB,EAChB,UAAU,EACX,MAAM,gBAAgB,CAAC;AAiBxB,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AAajC,OAAO,EACL,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAmBpC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAmC3E,MAAM,WAAW,UAAU;IACzB;;mDAE+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC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