@thaodangspace/argos 0.1.1 → 0.1.3
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 +4 -4
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +5 -1
- package/dist/args.js.map +1 -1
- package/dist/commands/chart.d.ts +21 -0
- package/dist/commands/chart.d.ts.map +1 -0
- package/dist/commands/chart.js +209 -0
- package/dist/commands/chart.js.map +1 -0
- package/dist/commands/doctor.d.ts +18 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +123 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/hc.d.ts +16 -0
- package/dist/commands/hc.d.ts.map +1 -0
- package/dist/commands/hc.js +689 -0
- package/dist/commands/hc.js.map +1 -0
- package/dist/commands/serve.d.ts +23 -2
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +72 -14
- package/dist/commands/serve.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -0
- package/dist/main.js.map +1 -1
- package/dist/output.d.ts +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +6 -0
- package/dist/output.js.map +1 -1
- package/dist/packs/apply.d.ts +36 -0
- package/dist/packs/apply.d.ts.map +1 -0
- package/dist/packs/apply.js +103 -0
- package/dist/packs/apply.js.map +1 -0
- package/dist/packs/bundled.d.ts +27 -0
- package/dist/packs/bundled.d.ts.map +1 -0
- package/dist/packs/bundled.js +42 -0
- package/dist/packs/bundled.js.map +1 -0
- package/dist/packs/pack.d.ts +142 -0
- package/dist/packs/pack.d.ts.map +1 -0
- package/dist/packs/pack.js +204 -0
- package/dist/packs/pack.js.map +1 -0
- package/dist/packs/plan.d.ts +123 -0
- package/dist/packs/plan.d.ts.map +1 -0
- package/dist/packs/plan.js +307 -0
- package/dist/packs/plan.js.map +1 -0
- package/dist/packs/templates-dir.d.ts +29 -0
- package/dist/packs/templates-dir.d.ts.map +1 -0
- package/dist/packs/templates-dir.js +49 -0
- package/dist/packs/templates-dir.js.map +1 -0
- package/package.json +4 -2
- package/templates/packs/claude/claude-step.mjs +666 -0
- package/templates/packs/claude/pack.json +38 -0
- package/templates/packs/smoke/pack.json +20 -0
- package/templates/packs/smoke/smoke.mjs +104 -0
- package/ui/_app/immutable/assets/0.CTk3h7Zx.css +2 -0
- package/ui/_app/immutable/chunks/9Dk6YhUf.js +1 -0
- package/ui/_app/immutable/chunks/BDgjZRhb.js +1 -0
- package/ui/_app/immutable/chunks/BQUxoyXx.js +1 -0
- package/ui/_app/immutable/chunks/BVvEKWUw.js +1 -0
- package/ui/_app/immutable/chunks/BXIfM5K1.js +1 -0
- package/ui/_app/immutable/chunks/B_XCALJf.js +1 -0
- package/ui/_app/immutable/chunks/BiQUXUyr.js +1 -0
- package/ui/_app/immutable/chunks/CPty2F6V.js +2 -0
- package/ui/_app/immutable/chunks/CqLqOuLw.js +4 -0
- package/ui/_app/immutable/chunks/Cta5wR5U.js +1 -0
- package/ui/_app/immutable/chunks/DlHMls5I.js +1 -0
- package/ui/_app/immutable/chunks/DqmgjiJ7.js +3 -0
- package/ui/_app/immutable/chunks/{D8sQwgC_.js → DxP_sZrQ.js} +1 -1
- package/ui/_app/immutable/chunks/PR6kdzSw.js +1 -0
- package/ui/_app/immutable/entry/app.DefioTIJ.js +2 -0
- package/ui/_app/immutable/entry/start.D3LG_apg.js +2 -0
- package/ui/_app/immutable/nodes/0.Bxn1Q-bg.js +1 -0
- package/ui/_app/immutable/nodes/1.DVMonhb0.js +1 -0
- package/ui/_app/immutable/nodes/2.DiUZ9i2y.js +2 -0
- package/ui/_app/immutable/nodes/3.C6GP2DYu.js +1 -0
- package/ui/_app/immutable/nodes/4._uRXFvRQ.js +3 -0
- package/ui/_app/immutable/nodes/5.BwtM7IQO.js +1 -0
- package/ui/_app/version.json +1 -1
- package/ui/build.json +3 -3
- package/ui/index.html +22 -18
- package/ui/_app/immutable/assets/0.Y-Ej83kR.css +0 -1
- package/ui/_app/immutable/assets/2.D2FEqQBh.css +0 -1
- package/ui/_app/immutable/assets/3.CI7aeD9i.css +0 -1
- package/ui/_app/immutable/assets/StartRunDialog.BbbZvJfB.css +0 -1
- package/ui/_app/immutable/assets/runs.CU5wtnW2.css +0 -1
- package/ui/_app/immutable/chunks/BKHbyffl.js +0 -3
- package/ui/_app/immutable/chunks/BeG5AxKI.js +0 -3
- package/ui/_app/immutable/chunks/Buwi_lQz.js +0 -2
- package/ui/_app/immutable/chunks/CV2Ptlrp.js +0 -1
- package/ui/_app/immutable/chunks/CtbaNJav.js +0 -1
- package/ui/_app/immutable/entry/app.DPg5reEl.js +0 -2
- package/ui/_app/immutable/entry/start.iWBP-EvH.js +0 -2
- package/ui/_app/immutable/nodes/0.Cu8SyVzm.js +0 -1
- package/ui/_app/immutable/nodes/1.Bga_qdeZ.js +0 -1
- package/ui/_app/immutable/nodes/2.CKNrkmzJ.js +0 -1
- package/ui/_app/immutable/nodes/3.OrFQ8OoI.js +0 -1
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of the installer (spec FR11/FR12, plan Phase 2).
|
|
3
|
+
*
|
|
4
|
+
* `planInstall` and `planUninstall` take the *contents* of everything they need and return the
|
|
5
|
+
* list of writes, links, removals, and the next manifest. No fs, no clock, no env read: `--dry-run`
|
|
6
|
+
* prints this plan and the real install applies the same one, so the two cannot disagree.
|
|
7
|
+
*
|
|
8
|
+
* Rules encoded here:
|
|
9
|
+
* - a version bump installs into `packs/<name>@<version>/`, never over a running terminal's file;
|
|
10
|
+
* - identical content is no write at all, and a plan with nothing to do is `unchanged`;
|
|
11
|
+
* - a `.md` without our marker is refused unless `--force`, and a marker naming another pack is
|
|
12
|
+
* refused too (two packs may not own one template name);
|
|
13
|
+
* - the running Node must satisfy `requires.node`, and `requires.hcProtocol` must be 1;
|
|
14
|
+
* - `hc`/`claude` floors are warnings: the API has no per-template probe, and a template that works
|
|
15
|
+
* today must not be blocked by a version string;
|
|
16
|
+
* - `uninstall` deletes a file only when the file itself carries our marker.
|
|
17
|
+
*/
|
|
18
|
+
import { createHash } from "node:crypto";
|
|
19
|
+
import { dirname, join, resolve } from "node:path";
|
|
20
|
+
import { parseTemplate, renderTemplate, serializeManifest, } from "./pack.js";
|
|
21
|
+
import { PACK_DIR_RULE, manifestPath, packInstallDir, packsRoot } from "./templates-dir.js";
|
|
22
|
+
// ------------------------------------------------------------------ quoting
|
|
23
|
+
/**
|
|
24
|
+
* One command argument, quoted for the platform that will parse it (FR11).
|
|
25
|
+
*
|
|
26
|
+
* POSIX gets single quotes with a `'\''` run for an embedded quote (correct for every byte a path
|
|
27
|
+
* can hold), Windows gets CRT-style double quotes with a backslash-escaped `"`. A path containing
|
|
28
|
+
* both quote styles therefore survives either way instead of producing a command hc cannot run.
|
|
29
|
+
*/
|
|
30
|
+
export function quoteCommandArg(value, platform = process.platform) {
|
|
31
|
+
if (platform === "win32")
|
|
32
|
+
return quoteWindows(value);
|
|
33
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
34
|
+
}
|
|
35
|
+
function quoteWindows(value) {
|
|
36
|
+
let out = '"';
|
|
37
|
+
let backslashes = 0;
|
|
38
|
+
for (const char of value) {
|
|
39
|
+
if (char === "\\") {
|
|
40
|
+
backslashes += 1;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (char === '"') {
|
|
44
|
+
out += `${"\\".repeat(backslashes * 2 + 1)}"`;
|
|
45
|
+
backslashes = 0;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
out += `${"\\".repeat(backslashes)}${char}`;
|
|
49
|
+
backslashes = 0;
|
|
50
|
+
}
|
|
51
|
+
return `${out}${"\\".repeat(backslashes * 2)}"`;
|
|
52
|
+
}
|
|
53
|
+
// ------------------------------------------------------------------ node floors
|
|
54
|
+
const NODE_FLOOR = /^>=\s*(\d+)(?:\.(\d+))?(?:\.(\d+))?$/;
|
|
55
|
+
/**
|
|
56
|
+
* `satisfiesNodeFloor(">=22.13", "22.13.0")` → true. `undefined` means the floor is not a form this
|
|
57
|
+
* installer understands, which the caller turns into a refusal rather than a guess.
|
|
58
|
+
*/
|
|
59
|
+
export function satisfiesNodeFloor(floor, version) {
|
|
60
|
+
const wanted = NODE_FLOOR.exec(floor.trim());
|
|
61
|
+
if (wanted === null)
|
|
62
|
+
return undefined;
|
|
63
|
+
const have = version.split(".").map((part) => Number.parseInt(part, 10));
|
|
64
|
+
if (have.length < 2 || have.some((part) => !Number.isInteger(part)))
|
|
65
|
+
return undefined;
|
|
66
|
+
const wantedParts = [wanted[1], wanted[2] ?? "0", wanted[3] ?? "0"].map((part) => Number.parseInt(part, 10));
|
|
67
|
+
for (let index = 0; index < 3; index += 1) {
|
|
68
|
+
const left = have[index] ?? 0;
|
|
69
|
+
const right = wantedParts[index];
|
|
70
|
+
if (left > right)
|
|
71
|
+
return true;
|
|
72
|
+
if (left < right)
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
// ------------------------------------------------------------------ install
|
|
78
|
+
function sha256(text) {
|
|
79
|
+
return createHash("sha256").update(text).digest("hex");
|
|
80
|
+
}
|
|
81
|
+
function sortedPacks(packs) {
|
|
82
|
+
const entries = Object.keys(packs)
|
|
83
|
+
.sort()
|
|
84
|
+
.map((name) => [name, packs[name]]);
|
|
85
|
+
return { version: 1, packs: Object.fromEntries(entries) };
|
|
86
|
+
}
|
|
87
|
+
/** `<abs node> <abs program> <pack args> <template args>` — quoted, never re-split by us. */
|
|
88
|
+
function templateCommand(nodePath, programPath, programArgs, templateArgs, platform) {
|
|
89
|
+
const parts = [quoteCommandArg(nodePath, platform), quoteCommandArg(programPath, platform)];
|
|
90
|
+
for (const extra of [programArgs, templateArgs]) {
|
|
91
|
+
const trimmed = extra?.trim() ?? "";
|
|
92
|
+
if (trimmed !== "")
|
|
93
|
+
parts.push(trimmed);
|
|
94
|
+
}
|
|
95
|
+
return parts.join(" ");
|
|
96
|
+
}
|
|
97
|
+
export function planInstall(input) {
|
|
98
|
+
const platform = input.platform ?? process.platform;
|
|
99
|
+
const refusals = [];
|
|
100
|
+
const warnings = [];
|
|
101
|
+
const writes = [];
|
|
102
|
+
const links = [];
|
|
103
|
+
const nextPacks = { ...input.manifest.packs };
|
|
104
|
+
const claimed = new Map();
|
|
105
|
+
const refuse = (code, message) => {
|
|
106
|
+
refusals.push({ code, message });
|
|
107
|
+
};
|
|
108
|
+
if (input.link && platform === "win32") {
|
|
109
|
+
refuse("link_unsupported", "--link is not supported on Windows (creating a symlink needs a privilege)");
|
|
110
|
+
}
|
|
111
|
+
const seen = new Set();
|
|
112
|
+
for (const source of input.packs) {
|
|
113
|
+
const pack = source.pack;
|
|
114
|
+
if (seen.has(pack.name)) {
|
|
115
|
+
refuse("pack_duplicate", `${source.file}: pack "${pack.name}" is listed twice`);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
seen.add(pack.name);
|
|
119
|
+
if (pack.requires.hcProtocol !== 1) {
|
|
120
|
+
refuse("unsupported_protocol", `${source.file}:requires.hcProtocol is ${pack.requires.hcProtocol}; this argos speaks protocol 1`);
|
|
121
|
+
}
|
|
122
|
+
const nodeFloor = satisfiesNodeFloor(pack.requires.node, input.nodeVersion);
|
|
123
|
+
if (nodeFloor === undefined) {
|
|
124
|
+
refuse("invalid_floor", `${source.file}:requires.node ${JSON.stringify(pack.requires.node)} is not a ">=x.y" floor`);
|
|
125
|
+
}
|
|
126
|
+
else if (!nodeFloor) {
|
|
127
|
+
refuse("node_too_old", `${source.file}:requires.node ${pack.requires.node} is newer than the running Node ${input.nodeVersion}`);
|
|
128
|
+
}
|
|
129
|
+
if (pack.requires.hc !== undefined) {
|
|
130
|
+
warnings.push(`pack "${pack.name}" requires hc ${pack.requires.hc}; not checked offline (run \`hc --version\`)`);
|
|
131
|
+
}
|
|
132
|
+
if (pack.requires.claude !== undefined) {
|
|
133
|
+
warnings.push(`pack "${pack.name}" requires claude ${pack.requires.claude}; not checked offline (run \`claude --version\`)`);
|
|
134
|
+
}
|
|
135
|
+
const previous = input.manifest.packs[pack.name];
|
|
136
|
+
if (previous !== undefined && previous.version > pack.version) {
|
|
137
|
+
warnings.push(`pack "${pack.name}" is installed at version ${previous.version}; installing ${pack.version} is a downgrade`);
|
|
138
|
+
}
|
|
139
|
+
if (source.programContent === undefined && !input.link) {
|
|
140
|
+
refuse("program_missing", `${source.file}: program "${pack.program.file}" could not be read`);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const packDir = packInstallDir(input.home, pack.name, pack.version);
|
|
144
|
+
const programDest = join(packDir, pack.program.file);
|
|
145
|
+
const programSource = resolve(source.dir, pack.program.file);
|
|
146
|
+
// A linked pack runs the program where the operator keeps it; a copied one runs the copy.
|
|
147
|
+
const programPath = input.link ? programSource : programDest;
|
|
148
|
+
if (input.link) {
|
|
149
|
+
if (source.installedProgram?.linkTarget !== programSource) {
|
|
150
|
+
links.push({ path: programDest, target: programSource });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
const content = source.programContent;
|
|
155
|
+
if (source.installedProgram?.sha256 !== sha256(content)) {
|
|
156
|
+
writes.push({ path: programDest, content, mode: 0o700 });
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const templates = {};
|
|
160
|
+
for (const template of pack.templates) {
|
|
161
|
+
const owner = claimed.get(template.name);
|
|
162
|
+
if (owner !== undefined && owner !== pack.name) {
|
|
163
|
+
refuse("template_conflict", `template "${template.name}" is claimed by both pack "${owner}" and pack "${pack.name}"`);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
claimed.set(template.name, pack.name);
|
|
167
|
+
const file = join(input.templatesDir, `${template.name}.md`);
|
|
168
|
+
const existing = input.templates.find((candidate) => candidate.name === template.name);
|
|
169
|
+
if (existing !== undefined) {
|
|
170
|
+
const marker = parseTemplate(existing.content).pack;
|
|
171
|
+
if (marker === undefined) {
|
|
172
|
+
if (!input.force) {
|
|
173
|
+
refuse("template_conflict", `${file} exists and is not an argos pack template (pass --force to overwrite)`);
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (marker.name !== pack.name && !input.force) {
|
|
178
|
+
refuse("template_conflict", `${file} belongs to pack "${marker.name}"; pass --force to let pack "${pack.name}" take it`);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const command = templateCommand(input.nodePath, programPath, pack.program.args, template.args, platform);
|
|
183
|
+
const content = renderTemplate({
|
|
184
|
+
name: template.name,
|
|
185
|
+
description: template.description ?? `${pack.name} template ${template.name}`,
|
|
186
|
+
command,
|
|
187
|
+
pack: { name: pack.name, version: pack.version },
|
|
188
|
+
});
|
|
189
|
+
if (existing?.content !== content)
|
|
190
|
+
writes.push({ path: file, content, mode: 0o644 });
|
|
191
|
+
templates[template.name] = { file, minStepTimeoutMs: template.minStepTimeoutMs };
|
|
192
|
+
}
|
|
193
|
+
const entry = {
|
|
194
|
+
version: pack.version,
|
|
195
|
+
source: source.source,
|
|
196
|
+
program: programDest,
|
|
197
|
+
...(input.link
|
|
198
|
+
? { link: programPath }
|
|
199
|
+
: { programSha256: sha256(source.programContent) }),
|
|
200
|
+
templates,
|
|
201
|
+
};
|
|
202
|
+
nextPacks[pack.name] = entry;
|
|
203
|
+
}
|
|
204
|
+
// A refusal writes nothing, so a half-installed pack can never be the result of a bad input.
|
|
205
|
+
if (refusals.length > 0) {
|
|
206
|
+
return {
|
|
207
|
+
writes: [],
|
|
208
|
+
links: [],
|
|
209
|
+
manifest: input.manifest,
|
|
210
|
+
warnings,
|
|
211
|
+
refusals,
|
|
212
|
+
unchanged: false,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const manifest = sortedPacks(nextPacks);
|
|
216
|
+
const text = serializeManifest(manifest);
|
|
217
|
+
const manifestWrite = text === serializeManifest(input.manifest)
|
|
218
|
+
? undefined
|
|
219
|
+
: { path: manifestPath(input.home), content: text, mode: 0o600 };
|
|
220
|
+
const plan = {
|
|
221
|
+
writes,
|
|
222
|
+
links,
|
|
223
|
+
manifest,
|
|
224
|
+
warnings,
|
|
225
|
+
refusals,
|
|
226
|
+
unchanged: writes.length === 0 && links.length === 0 && manifestWrite === undefined,
|
|
227
|
+
};
|
|
228
|
+
return manifestWrite === undefined ? plan : { ...plan, manifestWrite };
|
|
229
|
+
}
|
|
230
|
+
export function planUninstall(input) {
|
|
231
|
+
const refusals = [];
|
|
232
|
+
const removes = [];
|
|
233
|
+
const keeps = [];
|
|
234
|
+
const nextPacks = { ...input.manifest.packs };
|
|
235
|
+
for (const name of input.packs) {
|
|
236
|
+
const entry = nextPacks[name];
|
|
237
|
+
if (entry === undefined) {
|
|
238
|
+
refusals.push({ code: "pack_unknown", message: `pack "${name}" is not installed` });
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
delete nextPacks[name];
|
|
242
|
+
for (const [templateName, template] of Object.entries(entry.templates)) {
|
|
243
|
+
// The recorded path is authoritative: uninstalling under a different `--dir` must not reach
|
|
244
|
+
// into a directory this pack never wrote. A moved file is reported, never guessed at.
|
|
245
|
+
const expected = join(input.templatesDir, `${templateName}.md`);
|
|
246
|
+
if (resolve(template.file) !== resolve(expected)) {
|
|
247
|
+
keeps.push({ path: template.file, reason: `moved (not ${expected})` });
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const disk = input.templates.find((candidate) => candidate.name === templateName);
|
|
251
|
+
if (disk === undefined) {
|
|
252
|
+
keeps.push({ path: expected, reason: "missing" });
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
const marker = parseTemplate(disk.content).pack;
|
|
256
|
+
if (marker === undefined) {
|
|
257
|
+
keeps.push({ path: expected, reason: "not an argos pack template" });
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (marker.name !== name) {
|
|
261
|
+
keeps.push({ path: expected, reason: `owned by pack "${marker.name}"` });
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
removes.push({ path: expected, kind: "template" });
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (refusals.length > 0) {
|
|
268
|
+
return {
|
|
269
|
+
removes: [],
|
|
270
|
+
keeps: [],
|
|
271
|
+
manifest: input.manifest,
|
|
272
|
+
refusals,
|
|
273
|
+
unchanged: false,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
const manifest = sortedPacks(nextPacks);
|
|
277
|
+
const referenced = new Set(Object.values(manifest.packs).map((entry) => dirname(entry.program).split(/[\\/]/).at(-1) ?? ""));
|
|
278
|
+
// Prune is scoped to the packs the operator named: a stray `<pack>@<version>` directory of a
|
|
279
|
+
// pack still installed is never touched, and a directory Argos does not name
|
|
280
|
+
// (`<pack>@<version>`) is never ours to delete.
|
|
281
|
+
const removedPacks = new Set(input.packs);
|
|
282
|
+
const unreferenced = input.existingPackDirs
|
|
283
|
+
.filter((dir) => PACK_DIR_RULE.test(dir) &&
|
|
284
|
+
!referenced.has(dir) &&
|
|
285
|
+
removedPacks.has(dir.slice(0, dir.indexOf("@"))))
|
|
286
|
+
.sort();
|
|
287
|
+
for (const dir of unreferenced) {
|
|
288
|
+
const path = join(packsRoot(input.home), dir);
|
|
289
|
+
if (input.prune)
|
|
290
|
+
removes.push({ path, kind: "pack" });
|
|
291
|
+
else
|
|
292
|
+
keeps.push({ path, reason: "program dir (pass --prune to remove)" });
|
|
293
|
+
}
|
|
294
|
+
const text = serializeManifest(manifest);
|
|
295
|
+
const manifestWrite = text === serializeManifest(input.manifest)
|
|
296
|
+
? undefined
|
|
297
|
+
: { path: manifestPath(input.home), content: text, mode: 0o600 };
|
|
298
|
+
const plan = {
|
|
299
|
+
removes,
|
|
300
|
+
keeps,
|
|
301
|
+
manifest,
|
|
302
|
+
refusals,
|
|
303
|
+
unchanged: removes.length === 0 && manifestWrite === undefined,
|
|
304
|
+
};
|
|
305
|
+
return manifestWrite === undefined ? plan : { ...plan, manifestWrite };
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/packs/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,GAIlB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5F,6EAA6E;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,QAAQ,GAAoB,OAAO,CAAC,QAAQ;IACzF,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;IACrD,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC/C,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,GAAG,GAAG,GAAG,CAAC;IACd,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,WAAW,IAAI,CAAC,CAAC;YACjB,SAAS;QACX,CAAC;QACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;YAC9C,WAAW,GAAG,CAAC,CAAC;YAChB,SAAS;QACX,CAAC;QACD,GAAG,IAAI,GAAG,IAAI,CAAC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AG,IAAI,YAAY,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAI,KAAK,CAAC,KAAK;YAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;;YACjD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,sCAAsC,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,aAAa,GACjB,IAAI,KAAK,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC;QACxC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACrE,MAAM,IAAI,GAAkB;QAC1B,OAAO;QACP,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,SAAS,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,KAAK,SAAS;KAC/D,CAAC;IACF,OAAO,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a pack installs to (spec FR10–FR12; plan D1/D2).
|
|
3
|
+
*
|
|
4
|
+
* Two directories, resolved in exactly one place so `install`, `list`, `uninstall`, and `doctor`
|
|
5
|
+
* cannot disagree about them:
|
|
6
|
+
*
|
|
7
|
+
* | What | Path |
|
|
8
|
+
* |---|---|
|
|
9
|
+
* | templates hc reads | `--dir` → `$XDG_CONFIG_HOME/herdr-core/templates` → `~/.config/herdr-core/templates` |
|
|
10
|
+
* | Argos' own state | `$ARGOS_HOME` → `~/.argos` (`hc/packs/<name>@<version>/`, `hc/packs.json`) |
|
|
11
|
+
*
|
|
12
|
+
* hc's own help names the literal `~/.config/herdr-core/templates`; honoring `XDG_CONFIG_HOME` is
|
|
13
|
+
* the correct POSIX reading and `--dir` is the escape hatch, which is why the resolved path is
|
|
14
|
+
* printed by every command that writes.
|
|
15
|
+
*/
|
|
16
|
+
export type PackEnv = Readonly<Record<string, string | undefined>>;
|
|
17
|
+
/** A directory name Argos owns under `$ARGOS_HOME/hc/packs`: `<pack>@<version>`. */
|
|
18
|
+
export declare const PACK_DIR_RULE: RegExp;
|
|
19
|
+
/** `$ARGOS_HOME`, defaulting to `~/.argos` (the same rule as core's `argosHome`, kept local). */
|
|
20
|
+
export declare function argosStateDir(env?: PackEnv, home?: string): string;
|
|
21
|
+
/** The herdr-core templates directory `hc` reads (D2). */
|
|
22
|
+
export declare function templatesDir(dir?: string, env?: PackEnv, home?: string): string;
|
|
23
|
+
/** `$ARGOS_HOME/hc/packs.json` — the manifest, in Argos' own state, never in hc's directory. */
|
|
24
|
+
export declare function manifestPath(home: string): string;
|
|
25
|
+
/** `$ARGOS_HOME/hc/packs` — one `<name>@<version>/` directory per installed pack version. */
|
|
26
|
+
export declare function packsRoot(home: string): string;
|
|
27
|
+
/** `<packsRoot>/<name>@<version>`: a version bump installs beside the old one, never over it. */
|
|
28
|
+
export declare function packInstallDir(home: string, name: string, version: number): string;
|
|
29
|
+
//# sourceMappingURL=templates-dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates-dir.d.ts","sourceRoot":"","sources":["../../src/packs/templates-dir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAEnE,oFAAoF;AACpF,eAAO,MAAM,aAAa,QAAkC,CAAC;AAE7D,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,GAAG,GAAE,OAAqB,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAK1F;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAC1B,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,GAAE,OAAqB,EAC1B,IAAI,GAAE,MAAkB,GACvB,MAAM,CAOR;AAED,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAElF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a pack installs to (spec FR10–FR12; plan D1/D2).
|
|
3
|
+
*
|
|
4
|
+
* Two directories, resolved in exactly one place so `install`, `list`, `uninstall`, and `doctor`
|
|
5
|
+
* cannot disagree about them:
|
|
6
|
+
*
|
|
7
|
+
* | What | Path |
|
|
8
|
+
* |---|---|
|
|
9
|
+
* | templates hc reads | `--dir` → `$XDG_CONFIG_HOME/herdr-core/templates` → `~/.config/herdr-core/templates` |
|
|
10
|
+
* | Argos' own state | `$ARGOS_HOME` → `~/.argos` (`hc/packs/<name>@<version>/`, `hc/packs.json`) |
|
|
11
|
+
*
|
|
12
|
+
* hc's own help names the literal `~/.config/herdr-core/templates`; honoring `XDG_CONFIG_HOME` is
|
|
13
|
+
* the correct POSIX reading and `--dir` is the escape hatch, which is why the resolved path is
|
|
14
|
+
* printed by every command that writes.
|
|
15
|
+
*/
|
|
16
|
+
import { homedir } from "node:os";
|
|
17
|
+
import { join, resolve } from "node:path";
|
|
18
|
+
/** A directory name Argos owns under `$ARGOS_HOME/hc/packs`: `<pack>@<version>`. */
|
|
19
|
+
export const PACK_DIR_RULE = /^[a-z0-9][a-z0-9-]{0,31}@\d+$/;
|
|
20
|
+
/** `$ARGOS_HOME`, defaulting to `~/.argos` (the same rule as core's `argosHome`, kept local). */
|
|
21
|
+
export function argosStateDir(env = process.env, home = homedir()) {
|
|
22
|
+
const override = env["ARGOS_HOME"];
|
|
23
|
+
return override !== undefined && override.trim() !== ""
|
|
24
|
+
? resolve(override)
|
|
25
|
+
: join(home, ".argos");
|
|
26
|
+
}
|
|
27
|
+
/** The herdr-core templates directory `hc` reads (D2). */
|
|
28
|
+
export function templatesDir(dir, env = process.env, home = homedir()) {
|
|
29
|
+
if (dir !== undefined && dir.trim() !== "")
|
|
30
|
+
return resolve(dir);
|
|
31
|
+
const xdg = env["XDG_CONFIG_HOME"];
|
|
32
|
+
if (xdg !== undefined && xdg.trim() !== "") {
|
|
33
|
+
return join(resolve(xdg), "herdr-core", "templates");
|
|
34
|
+
}
|
|
35
|
+
return join(home, ".config", "herdr-core", "templates");
|
|
36
|
+
}
|
|
37
|
+
/** `$ARGOS_HOME/hc/packs.json` — the manifest, in Argos' own state, never in hc's directory. */
|
|
38
|
+
export function manifestPath(home) {
|
|
39
|
+
return join(home, "hc", "packs.json");
|
|
40
|
+
}
|
|
41
|
+
/** `$ARGOS_HOME/hc/packs` — one `<name>@<version>/` directory per installed pack version. */
|
|
42
|
+
export function packsRoot(home) {
|
|
43
|
+
return join(home, "hc", "packs");
|
|
44
|
+
}
|
|
45
|
+
/** `<packsRoot>/<name>@<version>`: a version bump installs beside the old one, never over it. */
|
|
46
|
+
export function packInstallDir(home, name, version) {
|
|
47
|
+
return join(packsRoot(home), `${name}@${version}`);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=templates-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates-dir.js","sourceRoot":"","sources":["../../src/packs/templates-dir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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ED,6FAA6F;AAC7F,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,IAAY,EAAE,OAAe;IACxE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thaodangspace/argos",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Durable YAML playbook engine CLI for Paseo agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|
|
41
|
+
"templates",
|
|
41
42
|
"ui",
|
|
42
43
|
"!dist/.tsbuildinfo"
|
|
43
44
|
],
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"typecheck:tests": "tsc --noEmit -p tsconfig.test.json"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@thaodangspace/argos-core": "0.1.
|
|
54
|
+
"@thaodangspace/argos-core": "0.1.3",
|
|
55
|
+
"zod": "4.6.7"
|
|
54
56
|
}
|
|
55
57
|
}
|