@warpgogol/forge 9.7.1 → 10.0.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/AGENTS.md +50 -27
- package/CHANGELOG.md +27 -0
- package/bin/cli.js +0 -0
- package/dist/os/codebase/handlers/codebase-measure-symbols.d.ts.map +1 -1
- package/dist/os/codebase/handlers/codebase-measure-symbols.js +35 -4
- package/dist/os/codebase/handlers/codebase-measure-symbols.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +1 -69
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +2 -3
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/determinism-check.d.ts.map +1 -1
- package/dist/os/core/handlers/determinism-check.js +2 -3
- package/dist/os/core/handlers/determinism-check.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +2 -4
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.js +1 -1
- package/dist/os/flow/handlers/flow-peers.js.map +1 -1
- package/dist/os/{mission → flow}/open-missions.d.ts +1 -2
- package/dist/os/flow/open-missions.d.ts.map +1 -0
- package/dist/os/flow/open-missions.js +37 -0
- package/dist/os/flow/open-missions.js.map +1 -0
- package/dist/os/flow/preflight.js +1 -1
- package/dist/os/flow/preflight.js.map +1 -1
- package/dist/src/command-modules.d.ts.map +1 -1
- package/dist/src/command-modules.js +0 -2
- package/dist/src/command-modules.js.map +1 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/onboarding/doctor.d.ts +0 -5
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +6 -79
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/npm-token-check.d.ts +1 -1
- package/dist/src/onboarding/npm-token-check.d.ts.map +1 -1
- package/dist/src/onboarding/npm-token-check.js +2 -2
- package/dist/src/onboarding/npm-token-check.js.map +1 -1
- package/dist/src/utils/hash.d.ts +1 -0
- package/dist/src/utils/hash.d.ts.map +1 -1
- package/dist/src/utils/hash.js +4 -0
- package/dist/src/utils/hash.js.map +1 -1
- package/dist/{os/mission → src/utils}/lockfile.d.ts +1 -18
- package/dist/src/utils/lockfile.d.ts.map +1 -0
- package/dist/src/utils/lockfile.js +70 -0
- package/dist/src/utils/lockfile.js.map +1 -0
- package/os/codebase/handlers/codebase-measure-symbols.ts +32 -4
- package/os/core/core.module.ts +3 -76
- package/os/core/handlers/assets-helpers.ts +2 -4
- package/os/core/handlers/determinism-check.ts +2 -3
- package/os/core/handlers/lifecycle-handlers.test.ts +529 -0
- package/os/core/handlers/release-prepare.ts +2 -4
- package/os/correctness/gate/trust-boundary-cx18.test.ts +1 -1
- package/os/flow/handlers/flow-peers.ts +1 -1
- package/os/flow/open-missions.ts +45 -0
- package/os/flow/preflight.ts +1 -1
- package/os/flow/tests/release-lines.test.ts +136 -0
- package/os/flow/tests/state-roots.test.ts +1 -48
- package/os/rfc/handlers/validate-corpus.test.ts +149 -0
- package/os/rfc/probe-batch.test.ts +253 -0
- package/os/rfc/verifier/rfc-1391/ac10-operating-model-policy.acceptance.test.ts +63 -0
- package/package.json +161 -506
- package/src/command-modules.ts +0 -2
- package/src/index.ts +0 -2
- package/src/onboarding/doctor.ts +9 -96
- package/src/onboarding/npm-token-check.ts +3 -3
- package/src/tests/pkg-health-self-scan.test.ts +29 -0
- package/src/tests/rfc-evidence-sync.test.ts +369 -0
- package/src/tests/skill-agents-sync.test.ts +192 -0
- package/src/utils/hash.ts +5 -0
- package/src/utils/lockfile.ts +78 -0
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts +0 -25
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +0 -1
- package/dist/os/core/handlers/forge-autonomy-validate.js +0 -208
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +0 -1
- package/dist/os/mission/handlers/archive.d.ts +0 -4
- package/dist/os/mission/handlers/archive.d.ts.map +0 -1
- package/dist/os/mission/handlers/archive.js +0 -583
- package/dist/os/mission/handlers/archive.js.map +0 -1
- package/dist/os/mission/importer-block.d.ts +0 -19
- package/dist/os/mission/importer-block.d.ts.map +0 -1
- package/dist/os/mission/importer-block.js +0 -124
- package/dist/os/mission/importer-block.js.map +0 -1
- package/dist/os/mission/index.d.ts +0 -2
- package/dist/os/mission/index.d.ts.map +0 -1
- package/dist/os/mission/index.js +0 -15
- package/dist/os/mission/index.js.map +0 -1
- package/dist/os/mission/lockfile.d.ts.map +0 -1
- package/dist/os/mission/lockfile.js +0 -138
- package/dist/os/mission/lockfile.js.map +0 -1
- package/dist/os/mission/mission.module.d.ts +0 -3
- package/dist/os/mission/mission.module.d.ts.map +0 -1
- package/dist/os/mission/mission.module.js +0 -63
- package/dist/os/mission/mission.module.js.map +0 -1
- package/dist/os/mission/open-missions.d.ts.map +0 -1
- package/dist/os/mission/open-missions.js +0 -42
- package/dist/os/mission/open-missions.js.map +0 -1
- package/dist/os/mission/types.d.ts +0 -23
- package/dist/os/mission/types.d.ts.map +0 -1
- package/dist/os/mission/types.js +0 -19
- package/dist/os/mission/types.js.map +0 -1
- package/dist/os/werkstatt/handlers/lock.d.ts +0 -10
- package/dist/os/werkstatt/handlers/lock.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/lock.js +0 -153
- package/dist/os/werkstatt/handlers/lock.js.map +0 -1
- package/dist/os/werkstatt/handlers/schema.d.ts +0 -33
- package/dist/os/werkstatt/handlers/schema.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/schema.js +0 -42
- package/dist/os/werkstatt/handlers/schema.js.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts +0 -15
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +0 -171
- package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.d.ts +0 -18
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.js +0 -51
- package/dist/os/werkstatt/handlers/werkstatt-lock-status.js.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts +0 -11
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +0 -86
- package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +0 -1
- package/dist/os/werkstatt/handlers/workspace-deps.d.ts +0 -12
- package/dist/os/werkstatt/handlers/workspace-deps.d.ts.map +0 -1
- package/dist/os/werkstatt/handlers/workspace-deps.js +0 -42
- package/dist/os/werkstatt/handlers/workspace-deps.js.map +0 -1
- package/dist/os/werkstatt/index.d.ts +0 -7
- package/dist/os/werkstatt/index.d.ts.map +0 -1
- package/dist/os/werkstatt/index.js +0 -18
- package/dist/os/werkstatt/index.js.map +0 -1
- package/dist/os/werkstatt/werkstatt.module.d.ts +0 -3
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +0 -1
- package/dist/os/werkstatt/werkstatt.module.js +0 -91
- package/dist/os/werkstatt/werkstatt.module.js.map +0 -1
- package/os/core/handlers/forge-autonomy-validate.ts +0 -276
- package/os/correctness/gate/trust-boundary-cx19.test.ts +0 -514
- package/os/mission/handlers/archive.test.ts +0 -764
- package/os/mission/handlers/archive.ts +0 -711
- package/os/mission/handlers/ship-inflight-degraded.test.ts +0 -105
- package/os/mission/importer-block.ts +0 -119
- package/os/mission/index.ts +0 -15
- package/os/mission/lockfile.ts +0 -152
- package/os/mission/mission.module.ts +0 -68
- package/os/mission/open-missions.ts +0 -50
- package/os/mission/types.ts +0 -42
- package/os/werkstatt/handlers/lock.ts +0 -168
- package/os/werkstatt/handlers/schema.ts +0 -47
- package/os/werkstatt/handlers/werkstatt-lock-recover.ts +0 -206
- package/os/werkstatt/handlers/werkstatt-lock-status.ts +0 -82
- package/os/werkstatt/handlers/werkstatt-operation-validate.ts +0 -112
- package/os/werkstatt/handlers/workspace-deps.ts +0 -56
- package/os/werkstatt/index.ts +0 -39
- package/os/werkstatt/werkstatt.module.ts +0 -95
- package/src/tests/doctor-autonomy.test.ts +0 -246
- package/src/tests/forge-autonomy-validate.test.ts +0 -159
- package/src/tests/werkstatt-lock.test.ts +0 -357
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>CI gate: every forge/pack skill source must be fully propagated to
|
|
4
|
+
`.agents/skills/` (IDE discovery copy written by forge.init/forge.upgrade).
|
|
5
|
+
SKILL.md syncs verbatim; declared knowledge files follow the append-only
|
|
6
|
+
syncKnowledgeFile contract — in the canonical repo a resync must be a no-op,
|
|
7
|
+
otherwise source and copy have drifted apart.</purpose>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>Do not validate skill content/schema — forge.skill.validate owns that.</item>
|
|
10
|
+
<item>Do not flag unmarked dirs — a missing .forge-managed marker means
|
|
11
|
+
consumer-owned (RFC-1154), e.g. `_shared/`.</item>
|
|
12
|
+
</non-goals>
|
|
13
|
+
</MODULE_CONTRACT>
|
|
14
|
+
<KEY_DECISIONS>
|
|
15
|
+
<item>planKnowledgeSync is reused so the gate encodes the exact merge
|
|
16
|
+
semantics of the syncer</item>
|
|
17
|
+
<item>Runs on the real repo — this is a drift gate, not a fixture test.</item>
|
|
18
|
+
</KEY_DECISIONS>
|
|
19
|
+
<CHANGE_SUMMARY>
|
|
20
|
+
<item>RFC-1311: carried legacy entry — Initial version — covers FORGE_SKILLS, declared pack skills
|
|
21
|
+
(discoverPackSkills), and the shared-knowledge layer.</item>
|
|
22
|
+
</CHANGE_SUMMARY>
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import fs from "node:fs";
|
|
26
|
+
import path from "node:path";
|
|
27
|
+
import { describe, expect, it } from "vitest";
|
|
28
|
+
|
|
29
|
+
import { loadForgeConfig } from "../config/forge-config.ts";
|
|
30
|
+
import { planKnowledgeSync } from "../knowledge/index.ts";
|
|
31
|
+
import { FORGE_SKILLS, discoverPackSkills } from "../registry.ts";
|
|
32
|
+
|
|
33
|
+
const forgeRoot = path.resolve(import.meta.dirname, "../..");
|
|
34
|
+
const workspaceRoot = path.resolve(import.meta.dirname, "../../../..");
|
|
35
|
+
|
|
36
|
+
interface SkillSource {
|
|
37
|
+
name: string;
|
|
38
|
+
srcDir: string;
|
|
39
|
+
knowledge: string[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function collectSkillSources(): SkillSource[] {
|
|
43
|
+
const sources: SkillSource[] = [];
|
|
44
|
+
for (const skill of FORGE_SKILLS) {
|
|
45
|
+
sources.push({
|
|
46
|
+
name: skill.name,
|
|
47
|
+
srcDir: path.dirname(path.join(forgeRoot, skill.path)),
|
|
48
|
+
knowledge: skill.knowledge ?? [],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const config = loadForgeConfig(workspaceRoot);
|
|
52
|
+
for (const skill of discoverPackSkills(workspaceRoot, config)) {
|
|
53
|
+
sources.push({
|
|
54
|
+
name: skill.name,
|
|
55
|
+
srcDir: path.dirname(path.join(workspaceRoot, skill.dir, skill.path)),
|
|
56
|
+
knowledge: skill.knowledge ?? [],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return sources;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Skipped in the standalone package repo — the gate needs a forge-managed
|
|
63
|
+
// workspace root (forge.yaml + synced skillsDir), which only exists for the
|
|
64
|
+
// monorepo and consumer projects, not for the published forge source tree.
|
|
65
|
+
const hasForgeWorkspace = fs.existsSync(path.join(workspaceRoot, "forge.yaml"));
|
|
66
|
+
describe.runIf(hasForgeWorkspace)(
|
|
67
|
+
".agents/skills sync gate (forge.init/forge.upgrade parity)",
|
|
68
|
+
() => {
|
|
69
|
+
// describe callbacks still run during collection even when runIf is false,
|
|
70
|
+
// so initializers must tolerate the absent forge.yaml themselves.
|
|
71
|
+
const config = hasForgeWorkspace ? loadForgeConfig(workspaceRoot) : null;
|
|
72
|
+
const skillsDir = config ? path.join(workspaceRoot, config.paths.skillsDir) : "";
|
|
73
|
+
const sources = config ? collectSkillSources() : [];
|
|
74
|
+
|
|
75
|
+
it("every forge + pack skill has a synced copy in .agents/skills/", () => {
|
|
76
|
+
const missing = sources
|
|
77
|
+
.filter((s) => !fs.existsSync(path.join(skillsDir, s.name, "SKILL.md")))
|
|
78
|
+
.map((s) => `${s.name} (src ${path.relative(workspaceRoot, s.srcDir)})`);
|
|
79
|
+
expect(
|
|
80
|
+
missing,
|
|
81
|
+
`skills never synced — run \`forge init\`/\`forge upgrade\` to populate ${path.relative(workspaceRoot, skillsDir)}`,
|
|
82
|
+
).toEqual([]);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("SKILL.md copies are byte-identical to their sources", () => {
|
|
86
|
+
const drifted: string[] = [];
|
|
87
|
+
for (const s of sources) {
|
|
88
|
+
const src = path.join(s.srcDir, "SKILL.md");
|
|
89
|
+
const dest = path.join(skillsDir, s.name, "SKILL.md");
|
|
90
|
+
if (!fs.existsSync(dest)) continue; // reported by the presence test
|
|
91
|
+
if (fs.readFileSync(src, "utf8") !== fs.readFileSync(dest, "utf8")) {
|
|
92
|
+
drifted.push(s.name);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
expect(
|
|
96
|
+
drifted,
|
|
97
|
+
"SKILL.md drift — edit the pack source and re-sync, never edit .agents/skills/ directly",
|
|
98
|
+
).toEqual([]);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("declared knowledge files are in sync (append-only merge would be a no-op)", () => {
|
|
102
|
+
const stale: string[] = [];
|
|
103
|
+
for (const s of sources) {
|
|
104
|
+
for (const kf of s.knowledge) {
|
|
105
|
+
const src = path.join(s.srcDir, kf);
|
|
106
|
+
const dest = path.join(skillsDir, s.name, kf);
|
|
107
|
+
if (!fs.existsSync(src)) {
|
|
108
|
+
stale.push(`${s.name}/${kf} — declared but missing in source`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (!fs.existsSync(dest)) {
|
|
112
|
+
stale.push(`${s.name}/${kf} — missing in .agents/skills (run forge upgrade)`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const plan = planKnowledgeSync(src, dest);
|
|
116
|
+
if (plan.action === "merged") {
|
|
117
|
+
stale.push(`${s.name}/${kf} — source has entries the copy lacks`);
|
|
118
|
+
} else if (plan.action === "skipped") {
|
|
119
|
+
stale.push(`${s.name}/${kf} — copy diverged non-mergeably (hand-edited .agents copy)`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
expect(stale).toEqual([]);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("undeclared aux files in the copy still match their sources", () => {
|
|
127
|
+
// The syncer writes SKILL.md + declared knowledge files only. Aux files
|
|
128
|
+
// (references, templates, placeholder dirs) that exist in BOTH trees are
|
|
129
|
+
// hand-copied and silently diverge — a same-named pair must stay identical,
|
|
130
|
+
// and a copy-only orphan can never resync.
|
|
131
|
+
const flagged: string[] = [];
|
|
132
|
+
for (const s of sources) {
|
|
133
|
+
const destDir = path.join(skillsDir, s.name);
|
|
134
|
+
if (!fs.existsSync(destDir)) continue;
|
|
135
|
+
const declared = new Set(["SKILL.md", ".forge-managed", ...s.knowledge]);
|
|
136
|
+
for (const entry of fs.readdirSync(destDir)) {
|
|
137
|
+
if (declared.has(entry)) continue;
|
|
138
|
+
const srcEntry = path.join(s.srcDir, entry);
|
|
139
|
+
const destEntry = path.join(destDir, entry);
|
|
140
|
+
if (fs.statSync(destEntry).isDirectory()) {
|
|
141
|
+
if (!fs.existsSync(srcEntry))
|
|
142
|
+
flagged.push(`${s.name}/${entry}/ — dir absent in source`);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (!fs.existsSync(srcEntry)) {
|
|
146
|
+
flagged.push(`${s.name}/${entry} — absent in source, copy can never resync`);
|
|
147
|
+
} else if (fs.readFileSync(srcEntry, "utf8") !== fs.readFileSync(destEntry, "utf8")) {
|
|
148
|
+
flagged.push(`${s.name}/${entry} — diverged from source`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
expect(
|
|
153
|
+
flagged,
|
|
154
|
+
"aux-file drift — declare aux files via `knowledge:` in SKILL.md or keep copies identical to source",
|
|
155
|
+
).toEqual([]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("shared-knowledge layer is synced", () => {
|
|
159
|
+
const src = path.join(forgeRoot, "skills", "shared", "knowledge", "learned-principles.md");
|
|
160
|
+
const dest = path.join(skillsDir, "shared-knowledge", "learned-principles.md");
|
|
161
|
+
if (!fs.existsSync(src)) return; // layer absent — nothing to gate
|
|
162
|
+
expect(fs.existsSync(dest), "shared-knowledge/learned-principles.md not synced").toBe(true);
|
|
163
|
+
const plan = planKnowledgeSync(src, dest);
|
|
164
|
+
expect(plan.action, `shared-knowledge drift (sync action: ${plan.action})`).toBe("unchanged");
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it("_shared convention docs are synced verbatim", () => {
|
|
168
|
+
const srcDir = path.join(forgeRoot, "skills", "_shared");
|
|
169
|
+
if (!fs.existsSync(srcDir)) return; // conventions layer absent — nothing to gate
|
|
170
|
+
const drifted: string[] = [];
|
|
171
|
+
const walk = (dir: string, prefix: string): string[] =>
|
|
172
|
+
fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
173
|
+
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
174
|
+
return entry.isDirectory() ? walk(path.join(dir, entry.name), rel) : [rel];
|
|
175
|
+
});
|
|
176
|
+
for (const rel of walk(srcDir, "")) {
|
|
177
|
+
const dest = path.join(skillsDir, "_shared", rel);
|
|
178
|
+
if (!fs.existsSync(dest)) {
|
|
179
|
+
drifted.push(`_shared/${rel} — missing in .agents/skills (run forge upgrade)`);
|
|
180
|
+
} else if (
|
|
181
|
+
fs.readFileSync(path.join(srcDir, rel), "utf8") !== fs.readFileSync(dest, "utf8")
|
|
182
|
+
) {
|
|
183
|
+
drifted.push(`_shared/${rel} — diverged from source`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
expect(
|
|
187
|
+
drifted,
|
|
188
|
+
"_shared drift — convention docs sync verbatim via forge upgrade; never edit .agents/skills/_shared/ directly",
|
|
189
|
+
).toEqual([]);
|
|
190
|
+
});
|
|
191
|
+
},
|
|
192
|
+
);
|
package/src/utils/hash.ts
CHANGED
|
@@ -23,8 +23,13 @@ Sweep batch 4: 73 Compass headers on headerless engine files (certification, com
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { createHash } from "node:crypto";
|
|
26
|
+
import { readFile } from "node:fs/promises";
|
|
26
27
|
|
|
27
28
|
export function byteHash(bytes: Uint8Array | string): string {
|
|
28
29
|
const input = typeof bytes === "string" ? Buffer.from(bytes, "utf8") : bytes;
|
|
29
30
|
return `sha256:${createHash("sha256").update(input).digest("hex")}`;
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
export async function byteHashFile(absPath: string): Promise<string> {
|
|
34
|
+
return byteHash(await readFile(absPath));
|
|
35
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Generic tracked-lockfile hygiene — restore pnpm-lock.yaml to HEAD bytes through the judged git channel, plus a sync-world exec adapter. Absorbed from the v9 os/mission module during the v10 core transfer (Werkstatt RFC-1649); mission-specific importer pruning stayed studio-private and did not transfer.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>No mission/studio layout knowledge — this module is layout-generic.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { execFileSync } from "./sync-fs.ts";
|
|
12
|
+
import type { ExecOptions, ExecResult, WorkspaceIO } from "../types.ts";
|
|
13
|
+
import { verifierGit } from "./verifier-git.ts";
|
|
14
|
+
|
|
15
|
+
const LOCKFILE_NAME = "pnpm-lock.yaml";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Restore `pnpm-lock.yaml` to the bytes committed at HEAD.
|
|
19
|
+
*
|
|
20
|
+
* Runs `git show HEAD:pnpm-lock.yaml` in `root`. On exit 0 the stdout is written
|
|
21
|
+
* back over `root/pnpm-lock.yaml` and the call returns `true`. On a non-zero
|
|
22
|
+
* exit (no such file at HEAD, not a git repository) it returns `false` and
|
|
23
|
+
* changes nothing. Spawn failures (missing git binary) propagate.
|
|
24
|
+
* `root` is the repository root — git resolves `HEAD:pnpm-lock.yaml` against
|
|
25
|
+
* the enclosing repo's top level, so passing a nested directory of a larger
|
|
26
|
+
* repo would restore that repo's root lockfile instead.
|
|
27
|
+
*/
|
|
28
|
+
export async function restoreTrackedLockfile(
|
|
29
|
+
root: string,
|
|
30
|
+
io: Pick<WorkspaceIO, "exec" | "writeFile">,
|
|
31
|
+
): Promise<boolean> {
|
|
32
|
+
// The committed-bytes read goes through the judged channel — the
|
|
33
|
+
// ambient exec layer inherits `process.env`, so a session `GIT_DIR`
|
|
34
|
+
// would serve `HEAD:` from a foreign object store and this "restore"
|
|
35
|
+
// would write forged bytes into the real worktree (CX-164). A refused
|
|
36
|
+
// read restores nothing and reports false.
|
|
37
|
+
const res = await verifierGit(root, ["show", `HEAD:${LOCKFILE_NAME}`]);
|
|
38
|
+
if (res.exitCode !== 0) return false;
|
|
39
|
+
await io.writeFile(path.join(root, LOCKFILE_NAME), res.stdout);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Sync-world adapter for `io.exec` — wraps `execFileSync` so handlers that still
|
|
45
|
+
* run on `execSync`/`execFileSync` (e.g. mission.archive) can call
|
|
46
|
+
* `restoreTrackedLockfile` without duplicating its logic. A non-zero exit maps
|
|
47
|
+
* to `exitCode`; a spawn failure (missing binary) keeps throwing.
|
|
48
|
+
*/
|
|
49
|
+
export function execFileSyncAdapter(): Pick<WorkspaceIO, "exec"> {
|
|
50
|
+
return {
|
|
51
|
+
exec(command: string, args: string[], opts?: ExecOptions): Promise<ExecResult> {
|
|
52
|
+
try {
|
|
53
|
+
const stdout = execFileSync(command, args, {
|
|
54
|
+
cwd: opts?.cwd,
|
|
55
|
+
encoding: "utf-8",
|
|
56
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
57
|
+
timeout: opts?.timeoutMs,
|
|
58
|
+
// Real pnpm-lock.yaml files exceed the 1 MiB default many times over —
|
|
59
|
+
// an ENOBUFS kill carries status null and would rethrow below.
|
|
60
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
61
|
+
});
|
|
62
|
+
return Promise.resolve({ exitCode: 0, stdout, stderr: "" });
|
|
63
|
+
} catch (err) {
|
|
64
|
+
const e = err as {
|
|
65
|
+
status?: number | null;
|
|
66
|
+
stdout?: Buffer | string;
|
|
67
|
+
stderr?: Buffer | string;
|
|
68
|
+
};
|
|
69
|
+
if (e.status === undefined || e.status === null) throw err;
|
|
70
|
+
return Promise.resolve({
|
|
71
|
+
exitCode: e.status,
|
|
72
|
+
stdout: e.stdout?.toString() ?? "",
|
|
73
|
+
stderr: e.stderr?.toString() ?? "",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ForgeCommandInput, ForgeCommandResult, ForgeRuntimeContext } from "../../../src/types.ts";
|
|
2
|
-
export interface ForgeAutonomyViolation {
|
|
3
|
-
ruleId: "FORGE-AUTONOMY-01" | "FORGE-AUTONOMY-02";
|
|
4
|
-
file: string;
|
|
5
|
-
specifier?: string;
|
|
6
|
-
message?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ForgeAutonomyValidateResult {
|
|
9
|
-
command: "forge.autonomy.validate";
|
|
10
|
-
status: "pass" | "fail";
|
|
11
|
-
violations: ForgeAutonomyViolation[];
|
|
12
|
-
scannedFiles: number;
|
|
13
|
-
modules: Record<string, {
|
|
14
|
-
runtime: "autonomous" | "werkstatt-adapter";
|
|
15
|
-
violations: number;
|
|
16
|
-
}>;
|
|
17
|
-
stripTypes?: {
|
|
18
|
-
diagnosticFiles: number;
|
|
19
|
-
durationMs: number;
|
|
20
|
-
skipped?: string;
|
|
21
|
-
outOfScopeDiagnostics: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare function runForgeAutonomyValidate(_input: ForgeCommandInput, context: ForgeRuntimeContext): Promise<ForgeCommandResult<ForgeAutonomyValidateResult>>;
|
|
25
|
-
//# sourceMappingURL=forge-autonomy-validate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forge-autonomy-validate.d.ts","sourceRoot":"","sources":["../../../../os/core/handlers/forge-autonomy-validate.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAqD/B,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAAC;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,yBAAyB,CAAC;IACnC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,YAAY,GAAG,mBAAmB,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7F,UAAU,CAAC,EAAE;QACX,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,qBAAqB,EAAE,MAAM,CAAC;KAC/B,CAAC;CACH;AAaD,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,CAAC,CAwE1D"}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
<MODULE_CONTRACT>
|
|
3
|
-
<purpose>forge.autonomy.validate — scans packages/forge/os/** for forbidden
|
|
4
|
-
@warpgogol/werkstatt-engine imports outside os/werkstatt/. Enforces FORGE-AUTONOMY-01
|
|
5
|
-
(RFC-0940, DNA-64). @warpgogol/werkstatt-shared is exempt (shared infrastructure).
|
|
6
|
-
Type-only imports (import type) are exempt.</purpose>
|
|
7
|
-
|
|
8
|
-
<non-goals>
|
|
9
|
-
<item>Does not scan test files — .test.ts and .spec.ts are always excluded.</item>
|
|
10
|
-
<item>Does not scan os/werkstatt/ — the adapter directory may import @warpgogol/werkstatt-engine.</item>
|
|
11
|
-
<item>Does not flag @warpgogol/werkstatt-shared — shared infrastructure, not the engine.</item>
|
|
12
|
-
<item>Does not flag import type statements — type-only imports are erased at compile time.</item>
|
|
13
|
-
<item>RFC-1606: the strip-types arm (FORGE-AUTONOMY-02) covers the os/ + bin/ trees — diagnostics in imported dependency sources (werkstatt-shared etc.) are reported under outOfScopeDiagnostics, not violations.</item>
|
|
14
|
-
</non-goals>
|
|
15
|
-
</MODULE_CONTRACT>
|
|
16
|
-
<CHANGE_SUMMARY>
|
|
17
|
-
<item>RFC-0940: initial forge.autonomy.validate handler implementing FORGE-AUTONOMY-01.</item>
|
|
18
|
-
<item>ADR-0019: inlined scanDirectoryForImports to make forge dependency-free.</item>
|
|
19
|
-
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
20
|
-
|
|
21
|
-
Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
|
|
22
|
-
<item>RFC-1097: sweep — werkstatt-engine clean
|
|
23
|
-
|
|
24
|
-
Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
|
|
25
|
-
</CHANGE_SUMMARY>
|
|
26
|
-
*/
|
|
27
|
-
import { join, relative } from "node:path";
|
|
28
|
-
import { ambientIo, resolveIo } from "../../../src/utils/io.js";
|
|
29
|
-
// Ambient default for helper fns without a context param — handlers override
|
|
30
|
-
// with `const io = resolveIo(context.io)` inside their own scope.
|
|
31
|
-
const io = ambientIo;
|
|
32
|
-
const FORBIDDEN_PACKAGE = "@warpgogol/werkstatt-engine";
|
|
33
|
-
const ADAPTER_DIR_PREFIX = "packages/forge/os/werkstatt/";
|
|
34
|
-
const EXCLUDE_DIRS = new Set(["node_modules", "tests", "tests-handoff", "dist", "templates"]);
|
|
35
|
-
const EXCLUDE_SUFFIXES = [".test.ts", ".spec.ts"];
|
|
36
|
-
const IMPORT_PATTERN = /(?:^|\n)\s*(?:import\s+(?:type\s+)?[^;]+?\s+from\s+|require\s*\(\s*)["'`]([^"'`]+)["'`]/g;
|
|
37
|
-
function shouldExcludeFile(fileName) {
|
|
38
|
-
return EXCLUDE_SUFFIXES.some((suffix) => fileName.endsWith(suffix));
|
|
39
|
-
}
|
|
40
|
-
async function scanDirectoryForImports(dir, workspaceRoot, specifierFilter) {
|
|
41
|
-
let scannedFiles = 0;
|
|
42
|
-
const violations = [];
|
|
43
|
-
const entries = await io.readdir(dir).catch(() => []);
|
|
44
|
-
for (const entry of entries) {
|
|
45
|
-
const fullPath = join(dir, entry.name);
|
|
46
|
-
if (entry.isDirectory) {
|
|
47
|
-
if (EXCLUDE_DIRS.has(entry.name))
|
|
48
|
-
continue;
|
|
49
|
-
const subResult = await scanDirectoryForImports(fullPath, workspaceRoot, specifierFilter);
|
|
50
|
-
scannedFiles += subResult.scannedFiles;
|
|
51
|
-
violations.push(...subResult.violations);
|
|
52
|
-
}
|
|
53
|
-
else if (entry.name.endsWith(".ts") && !shouldExcludeFile(entry.name)) {
|
|
54
|
-
scannedFiles++;
|
|
55
|
-
const content = await io.readFile(fullPath).catch(() => "");
|
|
56
|
-
let match;
|
|
57
|
-
const pattern = new RegExp(IMPORT_PATTERN.source, "g");
|
|
58
|
-
while ((match = pattern.exec(content)) !== null) {
|
|
59
|
-
const specifier = match[1];
|
|
60
|
-
if (specifierFilter(specifier)) {
|
|
61
|
-
violations.push({
|
|
62
|
-
// Reported paths are repo-relative logical paths — forward
|
|
63
|
-
// slashes on every platform.
|
|
64
|
-
file: relative(workspaceRoot, fullPath).replace(/\\/g, "/"),
|
|
65
|
-
specifier,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return { violations, scannedFiles };
|
|
72
|
-
}
|
|
73
|
-
function isTypeOnlyImport(content, specifier) {
|
|
74
|
-
const specifierIdx = content.indexOf(specifier);
|
|
75
|
-
if (specifierIdx === -1)
|
|
76
|
-
return false;
|
|
77
|
-
const importStart = content.lastIndexOf("import", specifierIdx);
|
|
78
|
-
if (importStart === -1)
|
|
79
|
-
return false;
|
|
80
|
-
const importLine = content.slice(importStart, specifierIdx);
|
|
81
|
-
return /\bimport\s+type\b/.test(importLine);
|
|
82
|
-
}
|
|
83
|
-
export async function runForgeAutonomyValidate(_input, context) {
|
|
84
|
-
const io = resolveIo(context.io);
|
|
85
|
-
const workspaceRoot = context.workspaceRoot;
|
|
86
|
-
const forgeOsDir = join(workspaceRoot, "packages", "forge", "os");
|
|
87
|
-
const { violations: rawViolations, scannedFiles } = await scanDirectoryForImports(forgeOsDir, workspaceRoot, (specifier) => specifier === FORBIDDEN_PACKAGE || specifier.startsWith(FORBIDDEN_PACKAGE + "/"));
|
|
88
|
-
const violations = [];
|
|
89
|
-
for (const v of rawViolations) {
|
|
90
|
-
if (v.file.startsWith(ADAPTER_DIR_PREFIX))
|
|
91
|
-
continue;
|
|
92
|
-
const fullPath = join(workspaceRoot, v.file);
|
|
93
|
-
const content = await io.readFile(fullPath).catch(() => "");
|
|
94
|
-
if (!isTypeOnlyImport(content, v.specifier)) {
|
|
95
|
-
violations.push({
|
|
96
|
-
ruleId: "FORGE-AUTONOMY-01",
|
|
97
|
-
file: v.file,
|
|
98
|
-
specifier: v.specifier,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const modules = {};
|
|
103
|
-
for (const v of violations) {
|
|
104
|
-
const parts = v.file.split("/");
|
|
105
|
-
const modKey = parts.slice(0, 4).join("/");
|
|
106
|
-
if (!modules[modKey]) {
|
|
107
|
-
const isAdapter = v.file.startsWith(ADAPTER_DIR_PREFIX);
|
|
108
|
-
modules[modKey] = {
|
|
109
|
-
runtime: isAdapter ? "werkstatt-adapter" : "autonomous",
|
|
110
|
-
violations: 0,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
modules[modKey].violations++;
|
|
114
|
-
}
|
|
115
|
-
// ── RFC-1606 AC-3: FORGE-AUTONOMY-02 strip-types arm ──────────────────
|
|
116
|
-
// `node --experimental-strip-types` can only strip erasable syntax — any
|
|
117
|
-
// runtime TypeScript construct (parameter properties, enums, namespaces)
|
|
118
|
-
// in os/** + bin/** breaks the standalone CLI under strip-types. The arm
|
|
119
|
-
// spawns `tsc -p tsconfig.strip-types.json` and parses its diagnostics;
|
|
120
|
-
// diagnostics inside imported dependency sources (werkstatt-shared etc.)
|
|
121
|
-
// are out of scope and reported separately rather than failing the arm.
|
|
122
|
-
const stripTypes = await runStripTypesArm(workspaceRoot, io);
|
|
123
|
-
for (const v of stripTypes.violations)
|
|
124
|
-
violations.push(v);
|
|
125
|
-
const status = violations.length === 0 ? "pass" : "fail";
|
|
126
|
-
return {
|
|
127
|
-
data: {
|
|
128
|
-
command: "forge.autonomy.validate",
|
|
129
|
-
status,
|
|
130
|
-
violations,
|
|
131
|
-
scannedFiles,
|
|
132
|
-
modules,
|
|
133
|
-
stripTypes: {
|
|
134
|
-
diagnosticFiles: stripTypes.checkedFiles,
|
|
135
|
-
durationMs: stripTypes.durationMs,
|
|
136
|
-
skipped: stripTypes.skipped,
|
|
137
|
-
outOfScopeDiagnostics: stripTypes.outOfScopeDiagnostics,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
exitCode: status === "pass" ? 0 : 1,
|
|
141
|
-
summary: `[forge.autonomy.validate] ${status.toUpperCase()} — ${violations.length} violation(s) across ${scannedFiles} files`,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
const armErrMessage = (err) => (err instanceof Error ? err.message : String(err));
|
|
145
|
-
/** Diagnostic line shape: `path(line,col): error TSnnnn: message`. */
|
|
146
|
-
const TSC_DIAG_LINE = /^(.+?)\((\d+),(\d+)\): error (TS\d+): (.+)$/;
|
|
147
|
-
/**
|
|
148
|
-
* FORGE-AUTONOMY-02 — the os/ + bin/ trees must be erasable-syntax-only
|
|
149
|
-
* (F-0227, RFC-1606). Runs `tsc -p tsconfig.strip-types.json` scoped to the
|
|
150
|
-
* forge package; diagnostics outside the package's own os//bin trees are
|
|
151
|
-
* dependency-source findings — reported as outOfScopeDiagnostics, never
|
|
152
|
-
* violations. Degrades (never blocks) when io lacks exec.
|
|
153
|
-
*/
|
|
154
|
-
async function runStripTypesArm(workspaceRoot, ioArg) {
|
|
155
|
-
const started = Date.now();
|
|
156
|
-
const empty = {
|
|
157
|
-
violations: [],
|
|
158
|
-
checkedFiles: 0,
|
|
159
|
-
durationMs: 0,
|
|
160
|
-
outOfScopeDiagnostics: 0,
|
|
161
|
-
};
|
|
162
|
-
if (typeof ioArg.exec !== "function") {
|
|
163
|
-
return { ...empty, skipped: "io.exec unavailable" };
|
|
164
|
-
}
|
|
165
|
-
const forgeDir = join(workspaceRoot, "packages", "forge");
|
|
166
|
-
const tscBin = join(forgeDir, "node_modules", ".bin", "tsc");
|
|
167
|
-
// Reduced/fake workspaces carry no node_modules — degrade like a missing
|
|
168
|
-
// exec rather than refusing the scan (io.exec-lacks rule, RFC-1606).
|
|
169
|
-
if (typeof ioArg.exists === "function" && !(await ioArg.exists(tscBin))) {
|
|
170
|
-
return { ...empty, skipped: "tsc binary unavailable" };
|
|
171
|
-
}
|
|
172
|
-
// Direct binary — `pnpm exec` rewrites pnpm-lock.yaml as a side effect
|
|
173
|
-
// (F-0201), and this arm must not dirty the tree it inspects.
|
|
174
|
-
let res;
|
|
175
|
-
try {
|
|
176
|
-
res = await ioArg.exec(tscBin, ["-p", "tsconfig.strip-types.json", "--noEmit"], { cwd: forgeDir });
|
|
177
|
-
}
|
|
178
|
-
catch (err) {
|
|
179
|
-
return { ...empty, skipped: `tsc spawn failed: ${armErrMessage(err)}` };
|
|
180
|
-
}
|
|
181
|
-
const durationMs = Date.now() - started;
|
|
182
|
-
const output = `${res.stdout ?? ""}\n${res.stderr ?? ""}`;
|
|
183
|
-
const violations = [];
|
|
184
|
-
let outOfScopeDiagnostics = 0;
|
|
185
|
-
const diagnosticFiles = new Set();
|
|
186
|
-
for (const line of output.split("\n")) {
|
|
187
|
-
const m = TSC_DIAG_LINE.exec(line.trim());
|
|
188
|
-
if (!m)
|
|
189
|
-
continue;
|
|
190
|
-
const [, rawPath, lineNo, , code, message] = m;
|
|
191
|
-
const rel = rawPath.replace(/\\/g, "/");
|
|
192
|
-
diagnosticFiles.add(rel);
|
|
193
|
-
// Scope: only diagnostics inside this package's os//bin trees fail the
|
|
194
|
-
// arm — imported dependency sources are reported, not refused (RFC-1606).
|
|
195
|
-
const inScope = !rel.includes("../") && /^(os|bin)\//.test(rel);
|
|
196
|
-
if (!inScope) {
|
|
197
|
-
outOfScopeDiagnostics++;
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
violations.push({
|
|
201
|
-
ruleId: "FORGE-AUTONOMY-02",
|
|
202
|
-
file: `packages/forge/${rel}`,
|
|
203
|
-
message: `${code} at line ${lineNo}: ${message}`,
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
return { violations, checkedFiles: diagnosticFiles.size, durationMs, outOfScopeDiagnostics };
|
|
207
|
-
}
|
|
208
|
-
//# sourceMappingURL=forge-autonomy-validate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forge-autonomy-validate.js","sourceRoot":"","sources":["../../../../os/core/handlers/forge-autonomy-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;EAyBE;AAEF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAEhE,6EAA6E;AAC7E,kEAAkE;AAClE,MAAM,EAAE,GAAG,SAAS,CAAC;AAOrB,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AACxD,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AAE1D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9F,MAAM,gBAAgB,GAAG,CAAC,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AO,EAAE,GAAG,IAAI,YAAY,MAAM,KAAK,OAAO,EAAE;SACjD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC;AAC/F,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ForgeCommandInput, ForgeCommandResult, ForgeRuntimeContext } from "../../../src/types.ts";
|
|
2
|
-
import { type MissionArchiveResult } from "../types.ts";
|
|
3
|
-
export declare function runMissionArchive(input: ForgeCommandInput, context: ForgeRuntimeContext): Promise<ForgeCommandResult<MissionArchiveResult>>;
|
|
4
|
-
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../../os/mission/handlers/archive.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AAyNrB,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CA2bnD"}
|