@thaodangspace/argos 0.1.2 → 0.1.5
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 +34 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +181 -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/rex-agents.d.ts +26 -0
- package/dist/commands/rex-agents.d.ts.map +1 -0
- package/dist/commands/rex-agents.js +505 -0
- package/dist/commands/rex-agents.js.map +1 -0
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +5 -1
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/schedule.d.ts.map +1 -1
- package/dist/commands/schedule.js +2 -1
- package/dist/commands/schedule.js.map +1 -1
- package/dist/commands/serve.d.ts +170 -10
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +291 -49
- package/dist/commands/serve.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +9 -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 +14 -4
- 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.CUSoXXAe.css +1 -0
- package/ui/_app/immutable/chunks/7kS98abs.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/BcmE4Pmo.js +2 -0
- package/ui/_app/immutable/chunks/BeleWrn1.js +5 -0
- package/ui/_app/immutable/chunks/CJuNNExc.js +1 -0
- package/ui/_app/immutable/chunks/CSzwgvai.js +55 -0
- package/ui/_app/immutable/chunks/CrMz2YMe.js +1 -0
- package/ui/_app/immutable/chunks/DK3Fl9T5.js +1 -0
- package/ui/_app/immutable/chunks/DR13iyEP.js +3 -0
- package/ui/_app/immutable/chunks/DxF9htzl.js +1 -0
- package/ui/_app/immutable/chunks/KjnrVwp0.js +4 -0
- package/ui/_app/immutable/chunks/Ta9EVp1m.js +1 -0
- package/ui/_app/immutable/chunks/UEYpU5e_.js +1 -0
- package/ui/_app/immutable/chunks/XmWYLfMV.js +1 -0
- package/ui/_app/immutable/entry/app.fpTlr2bV.js +2 -0
- package/ui/_app/immutable/entry/start.CmdXdr1Q.js +2 -0
- package/ui/_app/immutable/nodes/0.CexwxgPf.js +1 -0
- package/ui/_app/immutable/nodes/1.CXvw6Lx4.js +1 -0
- package/ui/_app/immutable/nodes/2.CVRWg4vc.js +2 -0
- package/ui/_app/immutable/nodes/3.Te_SG5Lg.js +1 -0
- package/ui/_app/immutable/nodes/4.9tMyBzuY.js +3 -0
- package/ui/_app/immutable/nodes/5.G4bzLcKA.js +1 -0
- package/ui/_app/version.json +1 -1
- package/ui/build.json +3 -3
- package/ui/index.html +23 -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/chunks/D8sQwgC_.js +0 -55
- 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
package/dist/output.js
CHANGED
|
@@ -165,8 +165,9 @@ export const USAGE = `argos — durable YAML playbooks for Paseo agents
|
|
|
165
165
|
|
|
166
166
|
Usage:
|
|
167
167
|
argos validate [path] [--home dir] [--json]
|
|
168
|
+
argos chart [path] [--playbook <id>] [--format mermaid|json] [--direction LR|TB] [--out <file>] [--run <id>] [--json]
|
|
168
169
|
argos run <playbook> [--input k=v ...] [--cwd dir] [--isolation none|worktree]
|
|
169
|
-
[--executor paseo|hc] [--json]
|
|
170
|
+
[--executor paseo|hc|rex] [--json]
|
|
170
171
|
argos ls [--schedule <id>] [--json]
|
|
171
172
|
argos status <runId> [--json]
|
|
172
173
|
argos gates [--json]
|
|
@@ -178,17 +179,26 @@ Usage:
|
|
|
178
179
|
argos worktree rm <runId> [--force] [--delete-branch] [--json]
|
|
179
180
|
argos worktree gc --older-than <n>(s|m|h|d) [--dry-run] [--force] [--delete-branch] [--json]
|
|
180
181
|
argos schedule add <playbook> --cron <expr> [--id <id>] [--tz <zone>] [--cwd dir]
|
|
181
|
-
[--input k=v ...] [--isolation none|worktree] [--executor paseo|hc]
|
|
182
|
+
[--input k=v ...] [--isolation none|worktree] [--executor paseo|hc|rex]
|
|
182
183
|
[--overlap skip|allow]
|
|
183
184
|
[--catch-up all|0|<n>(s|m|h|d)] [--keep <n>|all] [--paused] [--json]
|
|
184
185
|
argos schedule edit <id> [--cron <expr>] [--tz <zone>] [--cwd dir] [--input k=v ...]
|
|
185
|
-
[--isolation none|worktree] [--executor paseo|hc] [--overlap skip|allow]
|
|
186
|
+
[--isolation none|worktree] [--executor paseo|hc|rex] [--overlap skip|allow]
|
|
186
187
|
[--catch-up all|0|<n>(s|m|h|d)] [--keep <n>|all] [--json]
|
|
187
188
|
argos schedule ls|show <id>|pause <id>|resume <id>|run <id>|rm <id> [--json]
|
|
188
189
|
argos db stats [--json]
|
|
189
190
|
argos db purge --older-than <n>(s|m|h|d) [--dry-run] [--vacuum] [--json]
|
|
190
191
|
argos db vacuum [--json]
|
|
191
|
-
argos
|
|
192
|
+
argos hc templates list [--dir <path>] [--json]
|
|
193
|
+
argos hc templates install [pack ...] [--from <dir>] [--link] [--force] [--dry-run]
|
|
194
|
+
[--dir <path>] [--json]
|
|
195
|
+
argos hc templates uninstall <pack ...> [--prune] [--dry-run] [--dir <path>] [--json]
|
|
196
|
+
argos hc templates verify [--require-server] [--dir <path>] [--json]
|
|
197
|
+
argos rex agents add <name> --argv '<json array>' [--cwd dir] [--input terminal|file]
|
|
198
|
+
[--prompt-arg <arg>] [--force] [--dry-run] [--home dir] [--json]
|
|
199
|
+
argos rex agents ls [--home dir] [--json]
|
|
200
|
+
argos rex agents rm <name> [--dry-run] [--home dir] [--json]
|
|
201
|
+
argos serve [--port N] [--home dir] [--default-executor paseo|hc|rex] [--json]
|
|
192
202
|
argos doctor [--home dir] [--port N] [--json]
|
|
193
203
|
|
|
194
204
|
Environment:
|
package/dist/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAO/D,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AACzB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,wFAAwF;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,OAAO,GAAW,OAAO,CAAC,QAAQ,CAAC,IAAI;IACnE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAA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KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDpB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fs half of the installer (spec NFR "Atomic writes"; plan Phase 2).
|
|
3
|
+
*
|
|
4
|
+
* `plan.ts` decided *what* to write; this module only performs it:
|
|
5
|
+
*
|
|
6
|
+
* - every file is written to a sibling temp file, `chmod`ed, then `rename`d, so a reader never sees
|
|
7
|
+
* half a template;
|
|
8
|
+
* - the manifest is written **last**, so an interrupted install leaves a detectable gap;
|
|
9
|
+
* - a pack's program directory is `0700`, and a `--link`ed program is a symlink instead of a copy;
|
|
10
|
+
* - `--prune` removes a `<name>@<version>/` directory only when the plan named it, and only when it
|
|
11
|
+
* is a direct child of `$ARGOS_HOME/hc/packs` whose name matches `<pack>@<version>`.
|
|
12
|
+
*
|
|
13
|
+
* Every path is re-checked against the two resolved directories before it is touched: the plan is
|
|
14
|
+
* pure and tested, but a bug in it must not become a write outside `$ARGOS_HOME` or the templates
|
|
15
|
+
* directory.
|
|
16
|
+
*/
|
|
17
|
+
import type { InstallPlan, UninstallPlan } from "./plan.js";
|
|
18
|
+
/** A path the installer refused to touch (a bug, or a hand-edited plan — never a user error). */
|
|
19
|
+
export declare class PackApplyError extends Error {
|
|
20
|
+
readonly name = "PackApplyError";
|
|
21
|
+
}
|
|
22
|
+
export interface ApplyContext {
|
|
23
|
+
readonly home: string;
|
|
24
|
+
readonly templatesDir: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ApplyResult {
|
|
27
|
+
readonly written: readonly string[];
|
|
28
|
+
readonly linked: readonly string[];
|
|
29
|
+
readonly removed: readonly string[];
|
|
30
|
+
readonly unchanged: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Apply an install plan: programs and templates, then the manifest. */
|
|
33
|
+
export declare function applyInstall(plan: InstallPlan, context: ApplyContext): ApplyResult;
|
|
34
|
+
/** Apply an uninstall plan: marker files and pruned pack directories, then the manifest. */
|
|
35
|
+
export declare function applyUninstall(plan: UninstallPlan, context: ApplyContext): ApplyResult;
|
|
36
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/packs/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG5D,iGAAiG;AACjG,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAkB,IAAI,oBAAoB;CAC3C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAsCD,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,GAAG,WAAW,CA8BlF;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,WAAW,CActF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fs half of the installer (spec NFR "Atomic writes"; plan Phase 2).
|
|
3
|
+
*
|
|
4
|
+
* `plan.ts` decided *what* to write; this module only performs it:
|
|
5
|
+
*
|
|
6
|
+
* - every file is written to a sibling temp file, `chmod`ed, then `rename`d, so a reader never sees
|
|
7
|
+
* half a template;
|
|
8
|
+
* - the manifest is written **last**, so an interrupted install leaves a detectable gap;
|
|
9
|
+
* - a pack's program directory is `0700`, and a `--link`ed program is a symlink instead of a copy;
|
|
10
|
+
* - `--prune` removes a `<name>@<version>/` directory only when the plan named it, and only when it
|
|
11
|
+
* is a direct child of `$ARGOS_HOME/hc/packs` whose name matches `<pack>@<version>`.
|
|
12
|
+
*
|
|
13
|
+
* Every path is re-checked against the two resolved directories before it is touched: the plan is
|
|
14
|
+
* pure and tested, but a bug in it must not become a write outside `$ARGOS_HOME` or the templates
|
|
15
|
+
* directory.
|
|
16
|
+
*/
|
|
17
|
+
import { chmodSync, mkdirSync, renameSync, rmSync, symlinkSync, writeFileSync, } from "node:fs";
|
|
18
|
+
import { basename, dirname, resolve, sep } from "node:path";
|
|
19
|
+
import { PACK_DIR_RULE, manifestPath, packsRoot } from "./templates-dir.js";
|
|
20
|
+
/** A path the installer refused to touch (a bug, or a hand-edited plan — never a user error). */
|
|
21
|
+
export class PackApplyError extends Error {
|
|
22
|
+
name = "PackApplyError";
|
|
23
|
+
}
|
|
24
|
+
function inside(root, path) {
|
|
25
|
+
const base = resolve(root);
|
|
26
|
+
const target = resolve(path);
|
|
27
|
+
return target === base || target.startsWith(`${base}${sep}`);
|
|
28
|
+
}
|
|
29
|
+
function guard(ok, path) {
|
|
30
|
+
if (!ok) {
|
|
31
|
+
throw new PackApplyError(`refusing to touch ${path}: outside the argos pack directories`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** A pack directory is `<packsRoot>/<pack>@<version>` and nothing else. */
|
|
35
|
+
function assertPackDir(path, home) {
|
|
36
|
+
const root = resolve(packsRoot(home));
|
|
37
|
+
const target = resolve(path);
|
|
38
|
+
guard(dirname(target) === root && PACK_DIR_RULE.test(basename(target)), path);
|
|
39
|
+
}
|
|
40
|
+
function writeAtomic(path, content, mode) {
|
|
41
|
+
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
42
|
+
const temp = `${path}.argos-tmp-${process.pid}`;
|
|
43
|
+
writeFileSync(temp, content, { mode });
|
|
44
|
+
chmodSync(temp, mode);
|
|
45
|
+
renameSync(temp, path);
|
|
46
|
+
}
|
|
47
|
+
function linkAtomic(path, target) {
|
|
48
|
+
const dir = dirname(path);
|
|
49
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
50
|
+
// The destination is inside a directory Argos owns: replacing an older copy (or a stale link) is
|
|
51
|
+
// exactly what `--link` means.
|
|
52
|
+
rmSync(path, { force: true });
|
|
53
|
+
symlinkSync(target, path, "file");
|
|
54
|
+
}
|
|
55
|
+
/** Apply an install plan: programs and templates, then the manifest. */
|
|
56
|
+
export function applyInstall(plan, context) {
|
|
57
|
+
const packs = packsRoot(context.home);
|
|
58
|
+
const manifest = manifestPath(context.home);
|
|
59
|
+
for (const write of plan.writes) {
|
|
60
|
+
guard(inside(context.templatesDir, write.path) ||
|
|
61
|
+
inside(packs, write.path) ||
|
|
62
|
+
resolve(write.path) === resolve(manifest), write.path);
|
|
63
|
+
}
|
|
64
|
+
for (const link of plan.links)
|
|
65
|
+
guard(inside(packs, link.path), link.path);
|
|
66
|
+
const written = [];
|
|
67
|
+
for (const write of plan.writes) {
|
|
68
|
+
writeAtomic(write.path, write.content, write.mode);
|
|
69
|
+
if (inside(packs, write.path))
|
|
70
|
+
chmodSync(dirname(write.path), 0o700);
|
|
71
|
+
written.push(write.path);
|
|
72
|
+
}
|
|
73
|
+
const linked = [];
|
|
74
|
+
for (const link of plan.links) {
|
|
75
|
+
linkAtomic(link.path, link.target);
|
|
76
|
+
chmodSync(dirname(link.path), 0o700);
|
|
77
|
+
linked.push(link.path);
|
|
78
|
+
}
|
|
79
|
+
if (plan.manifestWrite !== undefined) {
|
|
80
|
+
writeAtomic(plan.manifestWrite.path, plan.manifestWrite.content, plan.manifestWrite.mode);
|
|
81
|
+
written.push(plan.manifestWrite.path);
|
|
82
|
+
}
|
|
83
|
+
return { written, linked, removed: [], unchanged: plan.unchanged };
|
|
84
|
+
}
|
|
85
|
+
/** Apply an uninstall plan: marker files and pruned pack directories, then the manifest. */
|
|
86
|
+
export function applyUninstall(plan, context) {
|
|
87
|
+
for (const remove of plan.removes) {
|
|
88
|
+
if (remove.kind === "pack")
|
|
89
|
+
assertPackDir(remove.path, context.home);
|
|
90
|
+
else
|
|
91
|
+
guard(inside(context.templatesDir, remove.path), remove.path);
|
|
92
|
+
}
|
|
93
|
+
const removed = [];
|
|
94
|
+
for (const remove of plan.removes) {
|
|
95
|
+
rmSync(remove.path, remove.kind === "pack" ? { recursive: true, force: true } : { force: true });
|
|
96
|
+
removed.push(remove.path);
|
|
97
|
+
}
|
|
98
|
+
if (plan.manifestWrite !== undefined) {
|
|
99
|
+
writeAtomic(plan.manifestWrite.path, plan.manifestWrite.content, plan.manifestWrite.mode);
|
|
100
|
+
}
|
|
101
|
+
return { written: [], linked: [], removed, unchanged: plan.unchanged };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/packs/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,MAAM,EACN,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAG5D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5E,iGAAiG;AACjG,MAAM,OAAO,cAAe,SAAQ,KAAK;IACrB,IAAI,GAAG,gBAAgB,CAAC;CAC3C;AAcD,SAAS,MAAM,CAAC,IAAY,EA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EAAE,CAAC;IAC7B,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACrC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The packs that ship inside the CLI tarball (plan D8, NFR Packaging).
|
|
3
|
+
*
|
|
4
|
+
* `../../templates` is resolved from the compiled module's own URL, so the same code finds the
|
|
5
|
+
* assets from a development checkout (`src/packs/bundled.ts` → `packages/cli/templates`), from
|
|
6
|
+
* `dist/packs/bundled.js` after `npm run build`, and from a global install
|
|
7
|
+
* (`…/lib/node_modules/@thaodangspace/argos/dist/packs/bundled.js`). Nothing here spawns a process
|
|
8
|
+
* or reads the network.
|
|
9
|
+
*
|
|
10
|
+
* A tarball built before `templates` was added to `files` would install nothing; that is a broken
|
|
11
|
+
* installation, not an operator error, so it fails loudly instead of reporting "0 packs".
|
|
12
|
+
*/
|
|
13
|
+
/** `<cli package root>/templates` — beside `dist/` and `src/`, in both layouts. */
|
|
14
|
+
export declare const BUNDLED_TEMPLATES_DIR: string;
|
|
15
|
+
/** The bundled assets are not where the tarball says they should be. */
|
|
16
|
+
export declare class PackAssetsError extends Error {
|
|
17
|
+
readonly name = "PackAssetsError";
|
|
18
|
+
}
|
|
19
|
+
export interface BundledPacks {
|
|
20
|
+
/** The directory that holds one subdirectory per pack. */
|
|
21
|
+
readonly dir: string;
|
|
22
|
+
/** Pack directory names, sorted, so an install without arguments is deterministic. */
|
|
23
|
+
readonly names: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/** The bundled pack directory and its pack names; `dir` is injectable for tests. */
|
|
26
|
+
export declare function bundledPacks(dir?: string): BundledPacks;
|
|
27
|
+
//# sourceMappingURL=bundled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled.d.ts","sourceRoot":"","sources":["../../src/packs/bundled.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,QAA6D,CAAC;AAEhG,wEAAwE;AACxE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,SAAkB,IAAI,qBAAqB;CAC5C;AAED,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAA6C,GAAG,YAAY,CAqB7F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The packs that ship inside the CLI tarball (plan D8, NFR Packaging).
|
|
3
|
+
*
|
|
4
|
+
* `../../templates` is resolved from the compiled module's own URL, so the same code finds the
|
|
5
|
+
* assets from a development checkout (`src/packs/bundled.ts` → `packages/cli/templates`), from
|
|
6
|
+
* `dist/packs/bundled.js` after `npm run build`, and from a global install
|
|
7
|
+
* (`…/lib/node_modules/@thaodangspace/argos/dist/packs/bundled.js`). Nothing here spawns a process
|
|
8
|
+
* or reads the network.
|
|
9
|
+
*
|
|
10
|
+
* A tarball built before `templates` was added to `files` would install nothing; that is a broken
|
|
11
|
+
* installation, not an operator error, so it fails loudly instead of reporting "0 packs".
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
/** `<cli package root>/templates` — beside `dist/` and `src/`, in both layouts. */
|
|
17
|
+
export const BUNDLED_TEMPLATES_DIR = fileURLToPath(new URL("../../templates", import.meta.url));
|
|
18
|
+
/** The bundled assets are not where the tarball says they should be. */
|
|
19
|
+
export class PackAssetsError extends Error {
|
|
20
|
+
name = "PackAssetsError";
|
|
21
|
+
}
|
|
22
|
+
/** The bundled pack directory and its pack names; `dir` is injectable for tests. */
|
|
23
|
+
export function bundledPacks(dir = join(BUNDLED_TEMPLATES_DIR, "packs")) {
|
|
24
|
+
let entries;
|
|
25
|
+
try {
|
|
26
|
+
entries = readdirSync(dir);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
throw new PackAssetsError(`bundled hc template packs are missing at ${dir}; this installation is incomplete (reinstall @thaodangspace/argos)`);
|
|
30
|
+
}
|
|
31
|
+
const names = entries
|
|
32
|
+
.filter((entry) => {
|
|
33
|
+
const path = join(dir, entry);
|
|
34
|
+
return statSync(path).isDirectory() && existsSync(join(path, "pack.json"));
|
|
35
|
+
})
|
|
36
|
+
.sort();
|
|
37
|
+
if (names.length === 0) {
|
|
38
|
+
throw new PackAssetsError(`bundled hc template packs are missing at ${dir}; this installation is incomplete (reinstall @thaodangspace/argos)`);
|
|
39
|
+
}
|
|
40
|
+
return { dir, names };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=bundled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled.js","sourceRoot":"","sources":["../../src/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,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hc template pack model (spec FR1–FR4; plan Phase 2).
|
|
3
|
+
*
|
|
4
|
+
* A pack is **data on disk**: `pack.json` (strict, so an operator's typo is never ignored), the
|
|
5
|
+
* program named by `program.file`, and the `*.md` templates we generate from it. Nothing here
|
|
6
|
+
* touches `node:fs` — the caller hands in file contents, which is what keeps `planInstall` pure and
|
|
7
|
+
* `--dry-run` incapable of disagreeing with the real run.
|
|
8
|
+
*
|
|
9
|
+
* Every template we write carries one ownership signal in its frontmatter `description`:
|
|
10
|
+
* `· argos-pack <name> <version>`. hc echoes name/description/command from `templates.list`, so the
|
|
11
|
+
* marker is the only thing `list`, `uninstall`, and `doctor` can recognize after a machine was
|
|
12
|
+
* rebuilt with a different Argos version.
|
|
13
|
+
*/
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
/** Template and pack name rule (FR3): lower-case, digits, `-`; 1–32 characters. */
|
|
16
|
+
export declare const PACK_NAME_RULE: RegExp;
|
|
17
|
+
/** The ownership marker's stable prefix. The whole line is `· argos-pack <name> <version>`. */
|
|
18
|
+
export declare const PACK_MARKER_PREFIX = "\u00B7 argos-pack";
|
|
19
|
+
/** One template a pack ships: its args, and the step budget authors should write. */
|
|
20
|
+
export declare const PackTemplateSchema: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
args: z.ZodString;
|
|
23
|
+
minStepTimeoutMs: z.ZodNumber;
|
|
24
|
+
description: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type PackTemplate = z.infer<typeof PackTemplateSchema>;
|
|
27
|
+
/** `pack.json`: strict, because an operator writes packs and a typo must not be a silent no-op. */
|
|
28
|
+
export declare const PackSchema: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
version: z.ZodNumber;
|
|
31
|
+
description: z.ZodOptional<z.ZodString>;
|
|
32
|
+
requires: z.ZodObject<{
|
|
33
|
+
node: z.ZodString;
|
|
34
|
+
hcProtocol: z.ZodNumber;
|
|
35
|
+
hc: z.ZodOptional<z.ZodString>;
|
|
36
|
+
claude: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
program: z.ZodObject<{
|
|
39
|
+
file: z.ZodString;
|
|
40
|
+
args: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
templates: z.ZodArray<z.ZodObject<{
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
args: z.ZodString;
|
|
45
|
+
minStepTimeoutMs: z.ZodNumber;
|
|
46
|
+
description: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
export type Pack = z.infer<typeof PackSchema>;
|
|
50
|
+
/** One installed template: where its `.md` lives and the step budget the pack declared. */
|
|
51
|
+
export declare const PackManifestTemplateSchema: z.ZodObject<{
|
|
52
|
+
file: z.ZodString;
|
|
53
|
+
minStepTimeoutMs: z.ZodNumber;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
export type PackManifestTemplate = z.infer<typeof PackManifestTemplateSchema>;
|
|
56
|
+
/**
|
|
57
|
+
* One installed pack. `program` is always the absolute destination path (the copy, or the symlink);
|
|
58
|
+
* a copied pack carries `programSha256`, a `--link`ed one carries `link` instead (FR11).
|
|
59
|
+
*/
|
|
60
|
+
export declare const PackManifestPackSchema: z.ZodObject<{
|
|
61
|
+
version: z.ZodNumber;
|
|
62
|
+
source: z.ZodString;
|
|
63
|
+
program: z.ZodString;
|
|
64
|
+
programSha256: z.ZodOptional<z.ZodString>;
|
|
65
|
+
link: z.ZodOptional<z.ZodString>;
|
|
66
|
+
templates: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
67
|
+
file: z.ZodString;
|
|
68
|
+
minStepTimeoutMs: z.ZodNumber;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
export type PackManifestPack = z.infer<typeof PackManifestPackSchema>;
|
|
72
|
+
/** `$ARGOS_HOME/hc/packs.json` (D1). Argos-owned; hc never reads it, and it has no timestamps (D12). */
|
|
73
|
+
export declare const PackManifestSchema: z.ZodObject<{
|
|
74
|
+
version: z.ZodLiteral<1>;
|
|
75
|
+
packs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
76
|
+
version: z.ZodNumber;
|
|
77
|
+
source: z.ZodString;
|
|
78
|
+
program: z.ZodString;
|
|
79
|
+
programSha256: z.ZodOptional<z.ZodString>;
|
|
80
|
+
link: z.ZodOptional<z.ZodString>;
|
|
81
|
+
templates: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
82
|
+
file: z.ZodString;
|
|
83
|
+
minStepTimeoutMs: z.ZodNumber;
|
|
84
|
+
}, z.core.$strict>>;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export type PackManifest = z.infer<typeof PackManifestSchema>;
|
|
88
|
+
export declare function emptyManifest(): PackManifest;
|
|
89
|
+
/** Canonical bytes: two-space indent, insertion order, trailing LF. No timestamp, ever (D12). */
|
|
90
|
+
export declare function serializeManifest(manifest: PackManifest): string;
|
|
91
|
+
export interface PackIssue {
|
|
92
|
+
/** `<file>` or `<file>:<field path>`, so an operator knows exactly which line to edit. */
|
|
93
|
+
readonly path: string;
|
|
94
|
+
readonly message: string;
|
|
95
|
+
}
|
|
96
|
+
export type ParseResult<T> = {
|
|
97
|
+
readonly ok: true;
|
|
98
|
+
readonly value: T;
|
|
99
|
+
} | {
|
|
100
|
+
readonly ok: false;
|
|
101
|
+
readonly issues: readonly PackIssue[];
|
|
102
|
+
};
|
|
103
|
+
/** Validate `pack.json` text; an unknown key or a bad floor names the file and the field. */
|
|
104
|
+
export declare function parsePack(text: string, file: string): ParseResult<Pack>;
|
|
105
|
+
/** Validate a manifest document; a hand-edited row is refused, never merged. */
|
|
106
|
+
export declare function parseManifest(text: string, file: string): ParseResult<PackManifest>;
|
|
107
|
+
export interface PackIdentity {
|
|
108
|
+
readonly name: string;
|
|
109
|
+
readonly version: number;
|
|
110
|
+
}
|
|
111
|
+
/** `· argos-pack claude 1` — the one ownership signal a template file carries. */
|
|
112
|
+
export declare function packMarker(pack: PackIdentity): string;
|
|
113
|
+
/** The marker a description carries, or `undefined` when the file is not ours. */
|
|
114
|
+
export declare function markerOf(description: string | undefined): PackIdentity | undefined;
|
|
115
|
+
export interface RenderTemplateInput {
|
|
116
|
+
readonly name: string;
|
|
117
|
+
/** The author's sentence; the marker is appended by `renderTemplate`, never by a caller. */
|
|
118
|
+
readonly description: string;
|
|
119
|
+
readonly command: string;
|
|
120
|
+
/** When given, the description gains the ownership marker (FR2). */
|
|
121
|
+
readonly pack?: PackIdentity;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A generated template (FR2): frontmatter `name`/`description`/`command`, empty body — hc sends a
|
|
125
|
+
* template's body *with* the prompt, and our prompt is the whole task.
|
|
126
|
+
*
|
|
127
|
+
* `description` and `command` are written as YAML double-quoted scalars (JSON escaping is a YAML
|
|
128
|
+
* subset), so a path that contains a quote, a space, or a `#` cannot silently break the document.
|
|
129
|
+
*/
|
|
130
|
+
export declare function renderTemplate(input: RenderTemplateInput): string;
|
|
131
|
+
export interface ParsedTemplate {
|
|
132
|
+
readonly name?: string;
|
|
133
|
+
readonly description?: string;
|
|
134
|
+
readonly command?: string;
|
|
135
|
+
/** Everything after the closing `---` (empty for a generated template). */
|
|
136
|
+
readonly body: string;
|
|
137
|
+
/** `· argos-pack <name> <version>` when the description carries our marker. */
|
|
138
|
+
readonly pack?: PackIdentity;
|
|
139
|
+
}
|
|
140
|
+
/** Parse a template's frontmatter. Never throws: a foreign file is data, not an error. */
|
|
141
|
+
export declare function parseTemplate(text: string): ParsedTemplate;
|
|
142
|
+
//# sourceMappingURL=pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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