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
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/** v4.0.0: the ONE submission-handle projection and validator.
|
|
2
|
+
*
|
|
3
|
+
* A handle bundles the three identities a held-round call needs. It is derived
|
|
4
|
+
* from the persisted session snapshot on every response and is never written
|
|
5
|
+
* to durable state. This module is deliberately free of I/O and of the
|
|
6
|
+
* `McpSession` import: `round-lifecycle.ts` needs the factory, so importing
|
|
7
|
+
* that module here would create a cycle.
|
|
8
|
+
*/
|
|
9
|
+
/** THE held-prompt predicate. A snapshot is held only when it names the current
|
|
10
|
+
* round and the exact prompted attempt the artifact was rendered for. A
|
|
11
|
+
* committed/terminated/stopped/retrying snapshot must never expose a handle:
|
|
12
|
+
* returning a stale prompt as "held" is the failure mode this predicate
|
|
13
|
+
* closes. */
|
|
14
|
+
export function heldPromptSnapshot(session) {
|
|
15
|
+
if (!session || session.status === "stopped")
|
|
16
|
+
return null;
|
|
17
|
+
const snapshot = session.roundSnapshot;
|
|
18
|
+
if (!snapshot)
|
|
19
|
+
return null;
|
|
20
|
+
if (snapshot.kind !== "evaluation")
|
|
21
|
+
return null;
|
|
22
|
+
if (snapshot.round !== session.currentRound)
|
|
23
|
+
return null;
|
|
24
|
+
if (snapshot.phase !== "prompted")
|
|
25
|
+
return null;
|
|
26
|
+
const artifact = snapshot.promptArtifact;
|
|
27
|
+
if (!artifact)
|
|
28
|
+
return null;
|
|
29
|
+
if (artifact.roundId !== snapshot.roundId)
|
|
30
|
+
return null;
|
|
31
|
+
if (artifact.round !== snapshot.round)
|
|
32
|
+
return null;
|
|
33
|
+
if (artifact.attempt !== snapshot.attempt)
|
|
34
|
+
return null;
|
|
35
|
+
if (typeof artifact.renderedPrompt !== "string" || artifact.renderedPrompt.length === 0) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return snapshot;
|
|
39
|
+
}
|
|
40
|
+
/** Derive the handle from the held snapshot. Never recomputes the transaction
|
|
41
|
+
* id (the snapshot's identity is the authority), never reads the vault, and
|
|
42
|
+
* never mutates the session. */
|
|
43
|
+
export function makeSubmissionHandle(session) {
|
|
44
|
+
const snapshot = heldPromptSnapshot(session);
|
|
45
|
+
if (!snapshot || !session)
|
|
46
|
+
return null;
|
|
47
|
+
const { roundId, transactionId } = snapshot;
|
|
48
|
+
if (typeof session.sessionId !== "string" || session.sessionId.length === 0)
|
|
49
|
+
return null;
|
|
50
|
+
if (typeof roundId !== "string" || roundId.length === 0)
|
|
51
|
+
return null;
|
|
52
|
+
if (typeof transactionId !== "string" || transactionId.length === 0)
|
|
53
|
+
return null;
|
|
54
|
+
return {
|
|
55
|
+
sessionId: session.sessionId,
|
|
56
|
+
roundId,
|
|
57
|
+
transactionId,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Strict shape parsing: a plain object with exactly the three non-empty
|
|
61
|
+
* string fields. No trimming, case folding, prefix matching, or defaults. */
|
|
62
|
+
export function parseSubmissionHandle(raw) {
|
|
63
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
64
|
+
return null;
|
|
65
|
+
const record = raw;
|
|
66
|
+
const keys = Object.keys(record);
|
|
67
|
+
if (keys.length !== 3)
|
|
68
|
+
return null;
|
|
69
|
+
if (!keys.includes("sessionId") || !keys.includes("roundId") ||
|
|
70
|
+
!keys.includes("transactionId")) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const { sessionId, roundId, transactionId } = record;
|
|
74
|
+
if (typeof sessionId !== "string" || sessionId.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
if (typeof roundId !== "string" || roundId.length === 0)
|
|
77
|
+
return null;
|
|
78
|
+
if (typeof transactionId !== "string" || transactionId.length === 0)
|
|
79
|
+
return null;
|
|
80
|
+
return { sessionId, roundId, transactionId };
|
|
81
|
+
}
|
|
82
|
+
/** Exact comparison against the held snapshot. The caller resolves the session
|
|
83
|
+
* by `handle.sessionId`; this function owns every field comparison so no
|
|
84
|
+
* second anchor rule can appear in the lifecycle or transport. */
|
|
85
|
+
export function validateSubmissionHandle(raw, session) {
|
|
86
|
+
const parsed = parseSubmissionHandle(raw);
|
|
87
|
+
if (!parsed) {
|
|
88
|
+
return {
|
|
89
|
+
ok: false,
|
|
90
|
+
code: "submission_handle_required",
|
|
91
|
+
reason: "shape",
|
|
92
|
+
mismatched: [],
|
|
93
|
+
current: null,
|
|
94
|
+
detail: "submissionHandle must be an object with exactly sessionId, roundId, " +
|
|
95
|
+
"and transactionId as non-empty strings.",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (!session) {
|
|
99
|
+
return {
|
|
100
|
+
ok: false,
|
|
101
|
+
code: "session_not_found",
|
|
102
|
+
reason: "session",
|
|
103
|
+
mismatched: [],
|
|
104
|
+
current: null,
|
|
105
|
+
detail: `No session exists for sessionId "${parsed.sessionId}". Call ` +
|
|
106
|
+
`loopforge_status with view="all" to find the loopId; if the held ` +
|
|
107
|
+
`prompt is still in context, call loopforge_status with that loopId ` +
|
|
108
|
+
`to fetch the current handle; otherwise call loopforge_resume with it.`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const current = makeSubmissionHandle(session);
|
|
112
|
+
if (!current) {
|
|
113
|
+
return {
|
|
114
|
+
ok: false,
|
|
115
|
+
code: "submission_handle_mismatch",
|
|
116
|
+
reason: "no_held_prompt",
|
|
117
|
+
mismatched: [],
|
|
118
|
+
current: null,
|
|
119
|
+
detail: "No held prompt exists for this session. Call loopforge_resume with " +
|
|
120
|
+
"the loopId to recover the current prompt; loopforge_status is " +
|
|
121
|
+
"read-only and cannot create one.",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const mismatched = [];
|
|
125
|
+
if (parsed.sessionId !== current.sessionId)
|
|
126
|
+
mismatched.push("sessionId");
|
|
127
|
+
if (parsed.roundId !== current.roundId)
|
|
128
|
+
mismatched.push("roundId");
|
|
129
|
+
if (parsed.transactionId !== current.transactionId)
|
|
130
|
+
mismatched.push("transactionId");
|
|
131
|
+
if (mismatched.length === 0) {
|
|
132
|
+
const snapshot = heldPromptSnapshot(session);
|
|
133
|
+
// `current` is non-null only when the predicate holds; the assertion is
|
|
134
|
+
// local and keeps the success branch total.
|
|
135
|
+
if (!snapshot) {
|
|
136
|
+
return {
|
|
137
|
+
ok: false,
|
|
138
|
+
code: "submission_handle_mismatch",
|
|
139
|
+
reason: "no_held_prompt",
|
|
140
|
+
mismatched: [],
|
|
141
|
+
current: null,
|
|
142
|
+
detail: "No held prompt exists for this session. Call loopforge_resume with " +
|
|
143
|
+
"the loopId to recover the current prompt; loopforge_status is " +
|
|
144
|
+
"read-only and cannot create one.",
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return { ok: true, handle: current, snapshot };
|
|
148
|
+
}
|
|
149
|
+
const reason = mismatched.length > 1
|
|
150
|
+
? "attempt"
|
|
151
|
+
: mismatched[0] === "sessionId"
|
|
152
|
+
? "session"
|
|
153
|
+
: mismatched[0] === "roundId"
|
|
154
|
+
? "round"
|
|
155
|
+
: "transaction";
|
|
156
|
+
return {
|
|
157
|
+
ok: false,
|
|
158
|
+
code: "submission_handle_mismatch",
|
|
159
|
+
reason,
|
|
160
|
+
mismatched,
|
|
161
|
+
current,
|
|
162
|
+
detail: "submissionHandle does not match the current held attempt " +
|
|
163
|
+
`(mismatched: ${mismatched.join(", ")}). Use the submissionHandle ` +
|
|
164
|
+
"returned with the current prompt; do not reconstruct it.",
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/** The one deterministic warning used whenever a stale handle returns the
|
|
168
|
+
* held prompt. It names no ids and never changes with the attempt. */
|
|
169
|
+
export function staleHandleWarning() {
|
|
170
|
+
return ("Submitted submissionHandle does not match the current held attempt — " +
|
|
171
|
+
"returning the current prompt. Use the submissionHandle returned with it.");
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=submission-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AA8B;YACnE,0DAA0D;KAC7D,CAAC;AACJ,CAAC;AAED;uEACuE;AACvE,MAAM,UAAU,kBAAkB;IAChC,OAAO,CACL,uEAAuE;QACvE,0EAA0E,CAC3E,CAAC;AACJ,CAAC"}
|
package/dist/mcp/tools.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
/** LoopForge MCP — Tool definitions and handlers.
|
|
2
2
|
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* status is the unified inspection tool (view=session|loop|all|audit).
|
|
3
|
+
* 10 tools: start, next, status, stop, pause, resume, replay,
|
|
4
|
+
* checkpoint, gate_check, gate_resolve.
|
|
5
|
+
* status is the unified inspection tool (view=session|loop|all|audit|explain).
|
|
6
6
|
* Each handler receives SessionManager + parsed input, returns the output object.
|
|
7
7
|
*/
|
|
8
8
|
import type { SessionManager } from "./session.js";
|
|
9
|
+
/** The closed argument set for `loopforge_start`.
|
|
10
|
+
*
|
|
11
|
+
* The handler's unknown-argument guard reads this list; `schema-sync.test`
|
|
12
|
+
* asserts that the advertised tool schema exposes exactly the same keys. A
|
|
13
|
+
* field removed from the protocol (for example `domain` in 4.0.1) must not
|
|
14
|
+
* survive in only one of them: the schema says what clients may send, and
|
|
15
|
+
* the guard makes a stale caller fail loudly instead of silently dropping
|
|
16
|
+
* the field. */
|
|
17
|
+
export declare const START_INPUT_KEYS: readonly ["task", "loopId", "maxRounds", "planSource", "constraints", "criteria"];
|
|
9
18
|
type JsonSchema = Record<string, unknown>;
|
|
10
|
-
/** Declared structured-output contracts for every tool. The MCP server
|
|
11
|
-
* validates each handler's output against these before returning it —
|
|
12
|
-
* a mismatch is a contract bug, surfaced as a JSON-RPC error instead of
|
|
13
|
-
* silently shipping an output that violates the declared schema. */
|
|
14
19
|
export declare const TOOL_OUTPUT_SCHEMAS: Record<string, JsonSchema>;
|
|
15
20
|
/** MCP tool contracts include strict input and structured output schemas. */
|
|
16
21
|
export declare const TOOL_SCHEMAS: ({
|
|
@@ -53,6 +58,11 @@ export declare const TOOL_SCHEMAS: ({
|
|
|
53
58
|
outputSchema: JsonSchema;
|
|
54
59
|
name: string;
|
|
55
60
|
description: string;
|
|
61
|
+
} | {
|
|
62
|
+
inputSchema: JsonSchema;
|
|
63
|
+
outputSchema: JsonSchema;
|
|
64
|
+
name: string;
|
|
65
|
+
description: string;
|
|
56
66
|
})[];
|
|
57
67
|
export declare class ToolInputValidationError extends Error {
|
|
58
68
|
constructor(message: string);
|
package/dist/mcp/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,cAAc,CAAC;AAkE/D;;;;;;;iBAOiB;AACjB,eAAO,MAAM,gBAAgB,mFAOnB,CAAC;AAunBX,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAiI1C,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAiI1D,CAAC;AA+CF,6EAA6E;AAC7E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOtB,CAAC;AAEJ,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAI5B;AA8ED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI,CAIN;AAED;;;;;2DAK2D;AAC3D,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,E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