@paramour-js/next 0.4.1 → 0.7.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/README.md +1 -1
- package/dist/commands/doctor.d.ts +12 -0
- package/dist/commands/doctor.js +12 -7
- package/dist/commands/generate.d.ts +48 -0
- package/dist/commands/generate.js +13 -6
- package/dist/commands/init.d.ts +40 -0
- package/dist/commands/init.js +110 -18
- package/dist/commands/list.d.ts +21 -0
- package/dist/commands/list.js +12 -7
- package/dist/commands/skills.d.ts +45 -0
- package/dist/commands/skills.js +222 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +13 -0
- package/dist/devtools-seam.d.ts +1 -1
- package/dist/doctor/checks.js +6 -2
- package/dist/init/agents-md.d.ts +32 -0
- package/dist/init/agents-md.js +78 -0
- package/dist/init/scaffold.js +54 -0
- package/dist/run-cli.d.ts +2 -0
- package/dist/run-cli.js +6 -2
- package/dist/skills/doctor.d.ts +11 -0
- package/dist/skills/doctor.js +71 -0
- package/dist/skills/manifest.d.ts +41 -0
- package/dist/skills/manifest.js +96 -0
- package/dist/skills/packaged.d.ts +21 -0
- package/dist/skills/packaged.js +32 -0
- package/dist/skills/sync.d.ts +84 -0
- package/dist/skills/sync.js +136 -0
- package/dist/skills/targets.d.ts +29 -0
- package/dist/skills/targets.js +73 -0
- package/package.json +4 -3
- package/skills/paramour/SKILL.md +43 -0
- package/skills/paramour/references/authoring.md +113 -0
- package/skills/paramour/references/migration.md +141 -0
- package/skills/paramour/references/reference.md +96 -0
- package/skills/paramour/references/setup.md +139 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
The Next.js integration for [paramour](https://paramour.dev):
|
|
4
4
|
`withTypedRoutes` (build-time registry generation and drift checking),
|
|
5
5
|
typed client hooks for both routers, and the `paramour` CLI
|
|
6
|
-
(`generate` / `check` / `init` / `list` / `doctor`).
|
|
6
|
+
(`generate` / `check` / `init` / `list` / `doctor` / `skills`).
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
9
|
pnpm add paramour @paramour-js/next
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { type CliIo } from "../cli-io.js";
|
|
2
|
+
/** @internal `paramour doctor` flags — skill-drift test's source of truth. */
|
|
3
|
+
export declare const DOCTOR_OPTIONS: {
|
|
4
|
+
readonly help: {
|
|
5
|
+
readonly default: false;
|
|
6
|
+
readonly short: "h";
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
};
|
|
9
|
+
readonly json: {
|
|
10
|
+
readonly default: false;
|
|
11
|
+
readonly type: "boolean";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
2
14
|
/**
|
|
3
15
|
* @internal `paramour doctor` — a verification, so its exit codes follow
|
|
4
16
|
* `check`'s class: 0 pass/warn, 1 any fail, 2 only when doctor itself
|
package/dist/commands/doctor.js
CHANGED
|
@@ -6,9 +6,9 @@ const USAGE = [
|
|
|
6
6
|
"Usage: paramour doctor [options]",
|
|
7
7
|
"",
|
|
8
8
|
"Diagnose the project's paramour setup: config validity, artifact",
|
|
9
|
-
"freshness, next.config wrapping, version alignment,
|
|
10
|
-
"and route-definition discovery (which
|
|
11
|
-
"`paramour list`).",
|
|
9
|
+
"freshness, next.config wrapping, version alignment, installed agent",
|
|
10
|
+
"skills, tsconfig coverage, and route-definition discovery (which",
|
|
11
|
+
"evaluates matched modules, like `paramour list`).",
|
|
12
12
|
"",
|
|
13
13
|
"Exit codes: 0 all checks pass (warnings allowed), 1 any check fails.",
|
|
14
14
|
"",
|
|
@@ -16,6 +16,11 @@ const USAGE = [
|
|
|
16
16
|
" --help, -h show this help",
|
|
17
17
|
" --json machine-readable output",
|
|
18
18
|
].join("\n");
|
|
19
|
+
/** @internal `paramour doctor` flags — skill-drift test's source of truth. */
|
|
20
|
+
export const DOCTOR_OPTIONS = {
|
|
21
|
+
help: { default: false, short: "h", type: "boolean" },
|
|
22
|
+
json: { default: false, type: "boolean" },
|
|
23
|
+
};
|
|
19
24
|
/**
|
|
20
25
|
* @internal `paramour doctor` — a verification, so its exit codes follow
|
|
21
26
|
* `check`'s class: 0 pass/warn, 1 any fail, 2 only when doctor itself
|
|
@@ -23,10 +28,10 @@ const USAGE = [
|
|
|
23
28
|
*/
|
|
24
29
|
export async function runDoctor(argv, io) {
|
|
25
30
|
const { stderr, stdout } = resolveIo(io);
|
|
26
|
-
const parsed = parseCommandFlags(argv, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
31
|
+
const parsed = parseCommandFlags(argv, DOCTOR_OPTIONS, USAGE, {
|
|
32
|
+
stderr,
|
|
33
|
+
stdout,
|
|
34
|
+
});
|
|
30
35
|
if ("exit" in parsed)
|
|
31
36
|
return parsed.exit;
|
|
32
37
|
const flags = parsed.values;
|
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
import { type CliIo } from "../cli-io.js";
|
|
2
|
+
/** @internal `paramour check` flags — skill-drift test's source of truth. */
|
|
3
|
+
export declare const CHECK_OPTIONS: {
|
|
4
|
+
readonly "app-dir": {
|
|
5
|
+
readonly type: "string";
|
|
6
|
+
};
|
|
7
|
+
readonly help: {
|
|
8
|
+
readonly default: false;
|
|
9
|
+
readonly short: "h";
|
|
10
|
+
readonly type: "boolean";
|
|
11
|
+
};
|
|
12
|
+
readonly "out-file": {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
};
|
|
15
|
+
readonly "page-extensions": {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
};
|
|
18
|
+
readonly "pages-dir": {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/** @internal `paramour generate` flags — skill-drift test's source of truth. */
|
|
23
|
+
export declare const GENERATE_OPTIONS: {
|
|
24
|
+
readonly check: {
|
|
25
|
+
readonly default: false;
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
readonly watch: {
|
|
29
|
+
readonly default: false;
|
|
30
|
+
readonly type: "boolean";
|
|
31
|
+
};
|
|
32
|
+
readonly "app-dir": {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
};
|
|
35
|
+
readonly help: {
|
|
36
|
+
readonly default: false;
|
|
37
|
+
readonly short: "h";
|
|
38
|
+
readonly type: "boolean";
|
|
39
|
+
};
|
|
40
|
+
readonly "out-file": {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
};
|
|
43
|
+
readonly "page-extensions": {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
};
|
|
46
|
+
readonly "pages-dir": {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
2
50
|
/**
|
|
3
51
|
* @internal `paramour generate` and its `check` alias, in-process testable:
|
|
4
52
|
* returns the exit code instead of exiting. Codes are grep-style so CI can
|
|
@@ -12,6 +12,14 @@ const SHARED_OPTIONS = {
|
|
|
12
12
|
"page-extensions": { type: "string" },
|
|
13
13
|
"pages-dir": { type: "string" },
|
|
14
14
|
};
|
|
15
|
+
/** @internal `paramour check` flags — skill-drift test's source of truth. */
|
|
16
|
+
export const CHECK_OPTIONS = SHARED_OPTIONS;
|
|
17
|
+
/** @internal `paramour generate` flags — skill-drift test's source of truth. */
|
|
18
|
+
export const GENERATE_OPTIONS = {
|
|
19
|
+
...SHARED_OPTIONS,
|
|
20
|
+
check: { default: false, type: "boolean" },
|
|
21
|
+
watch: { default: false, type: "boolean" },
|
|
22
|
+
};
|
|
15
23
|
const SHARED_OPTION_LINES = [
|
|
16
24
|
" --app-dir <dir> app directory (default: discovered app/ or src/app/)",
|
|
17
25
|
" --help, -h show this help",
|
|
@@ -51,11 +59,10 @@ export async function runGenerate(argv, io, mode) {
|
|
|
51
59
|
const usage = mode === "check" ? CHECK_USAGE : GENERATE_USAGE;
|
|
52
60
|
let flags;
|
|
53
61
|
if (mode === "generate") {
|
|
54
|
-
const parsed = parseCommandFlags(argv, {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, usage, { stderr, stdout });
|
|
62
|
+
const parsed = parseCommandFlags(argv, GENERATE_OPTIONS, usage, {
|
|
63
|
+
stderr,
|
|
64
|
+
stdout,
|
|
65
|
+
});
|
|
59
66
|
if ("exit" in parsed)
|
|
60
67
|
return parsed.exit;
|
|
61
68
|
flags = parsed.values;
|
|
@@ -63,7 +70,7 @@ export async function runGenerate(argv, io, mode) {
|
|
|
63
70
|
else {
|
|
64
71
|
// `check` omits --check/--watch entirely: `paramour check --watch`
|
|
65
72
|
// fails as an unknown option, which is the right message for it.
|
|
66
|
-
const parsed = parseCommandFlags(argv,
|
|
73
|
+
const parsed = parseCommandFlags(argv, CHECK_OPTIONS, usage, {
|
|
67
74
|
stderr,
|
|
68
75
|
stdout,
|
|
69
76
|
});
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
import { type CliIo } from "../cli-io.js";
|
|
2
|
+
/** @internal `paramour init` flags — skill-drift test's source of truth. */
|
|
3
|
+
export declare const INIT_OPTIONS: {
|
|
4
|
+
readonly "dry-run": {
|
|
5
|
+
readonly default: false;
|
|
6
|
+
readonly type: "boolean";
|
|
7
|
+
};
|
|
8
|
+
readonly force: {
|
|
9
|
+
readonly default: false;
|
|
10
|
+
readonly type: "boolean";
|
|
11
|
+
};
|
|
12
|
+
readonly help: {
|
|
13
|
+
readonly default: false;
|
|
14
|
+
readonly short: "h";
|
|
15
|
+
readonly type: "boolean";
|
|
16
|
+
};
|
|
17
|
+
readonly "no-agents-md": {
|
|
18
|
+
readonly default: false;
|
|
19
|
+
readonly type: "boolean";
|
|
20
|
+
};
|
|
21
|
+
readonly "no-config": {
|
|
22
|
+
readonly default: false;
|
|
23
|
+
readonly type: "boolean";
|
|
24
|
+
};
|
|
25
|
+
readonly "no-generate": {
|
|
26
|
+
readonly default: false;
|
|
27
|
+
readonly type: "boolean";
|
|
28
|
+
};
|
|
29
|
+
readonly "no-script": {
|
|
30
|
+
readonly default: false;
|
|
31
|
+
readonly type: "boolean";
|
|
32
|
+
};
|
|
33
|
+
readonly "no-skills": {
|
|
34
|
+
readonly default: false;
|
|
35
|
+
readonly type: "boolean";
|
|
36
|
+
};
|
|
37
|
+
readonly "no-wrap": {
|
|
38
|
+
readonly default: false;
|
|
39
|
+
readonly type: "boolean";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
2
42
|
/**
|
|
3
43
|
* @internal `paramour init` — non-interactive by design: it runs straight
|
|
4
44
|
* through with defaults and prints one status line per step. Exit codes: 0
|
package/dist/commands/init.js
CHANGED
|
@@ -5,25 +5,46 @@ import { NoRouteDirsError, resolveInputs } from "../cli-inputs.js";
|
|
|
5
5
|
import { message, resolveIo } from "../cli-io.js";
|
|
6
6
|
import { CONFIG_FILE_NAMES, loadConfigFile } from "../config.js";
|
|
7
7
|
import { generate } from "../generate.js";
|
|
8
|
+
import { findAgentsFile, upsertAgentsSection } from "../init/agents-md.js";
|
|
8
9
|
import { addPackageScript, checkSetup, paramourConfigTemplate, } from "../init/scaffold.js";
|
|
9
10
|
import { findNextConfig, manualSnippet, wrapNextConfigSource, } from "../init/wrap-next-config.js";
|
|
10
11
|
import { scanRoutes } from "../scan.js";
|
|
12
|
+
import { loadPackagedSkill } from "../skills/packaged.js";
|
|
13
|
+
import { syncTarget } from "../skills/sync.js";
|
|
14
|
+
import { detectTargets } from "../skills/targets.js";
|
|
15
|
+
import { reportOrphans } from "./skills.js";
|
|
11
16
|
const USAGE = [
|
|
12
17
|
"Usage: paramour init [options]",
|
|
13
18
|
"",
|
|
14
19
|
"Set up paramour in this project: scaffold paramour.config.ts, wrap",
|
|
15
|
-
'next.config with withTypedRoutes, add a "paramour" script,
|
|
16
|
-
"first generate
|
|
20
|
+
'next.config with withTypedRoutes, add a "paramour" script, run the',
|
|
21
|
+
"first generate, install agent skills for detected agent tools, and add",
|
|
22
|
+
"a paramour section to an existing AGENTS.md/CLAUDE.md. Every step is",
|
|
23
|
+
"idempotent and individually skippable.",
|
|
17
24
|
"",
|
|
18
25
|
"Options:",
|
|
19
|
-
" --dry-run
|
|
20
|
-
" --force
|
|
21
|
-
" --help, -h
|
|
22
|
-
" --no-
|
|
23
|
-
" --no-
|
|
24
|
-
" --no-
|
|
25
|
-
" --no-
|
|
26
|
+
" --dry-run report every step without writing anything",
|
|
27
|
+
" --force overwrite an existing paramour.config with the scaffold",
|
|
28
|
+
" --help, -h show this help",
|
|
29
|
+
" --no-agents-md skip the AGENTS.md/CLAUDE.md paramour section",
|
|
30
|
+
" --no-config skip scaffolding paramour.config.ts",
|
|
31
|
+
" --no-generate skip the first generate",
|
|
32
|
+
" --no-script skip adding the package.json script",
|
|
33
|
+
" --no-skills skip installing agent skills",
|
|
34
|
+
" --no-wrap skip wrapping next.config",
|
|
26
35
|
].join("\n");
|
|
36
|
+
/** @internal `paramour init` flags — skill-drift test's source of truth. */
|
|
37
|
+
export const INIT_OPTIONS = {
|
|
38
|
+
"dry-run": { default: false, type: "boolean" },
|
|
39
|
+
force: { default: false, type: "boolean" },
|
|
40
|
+
help: { default: false, short: "h", type: "boolean" },
|
|
41
|
+
"no-agents-md": { default: false, type: "boolean" },
|
|
42
|
+
"no-config": { default: false, type: "boolean" },
|
|
43
|
+
"no-generate": { default: false, type: "boolean" },
|
|
44
|
+
"no-script": { default: false, type: "boolean" },
|
|
45
|
+
"no-skills": { default: false, type: "boolean" },
|
|
46
|
+
"no-wrap": { default: false, type: "boolean" },
|
|
47
|
+
};
|
|
27
48
|
/**
|
|
28
49
|
* @internal `paramour init` — non-interactive by design: it runs straight
|
|
29
50
|
* through with defaults and prints one status line per step. Exit codes: 0
|
|
@@ -33,15 +54,10 @@ const USAGE = [
|
|
|
33
54
|
*/
|
|
34
55
|
export async function runInit(argv, io) {
|
|
35
56
|
const { stderr, stdout } = resolveIo(io);
|
|
36
|
-
const parsed = parseCommandFlags(argv, {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"no-config": { default: false, type: "boolean" },
|
|
41
|
-
"no-generate": { default: false, type: "boolean" },
|
|
42
|
-
"no-script": { default: false, type: "boolean" },
|
|
43
|
-
"no-wrap": { default: false, type: "boolean" },
|
|
44
|
-
}, USAGE, { stderr, stdout });
|
|
57
|
+
const parsed = parseCommandFlags(argv, INIT_OPTIONS, USAGE, {
|
|
58
|
+
stderr,
|
|
59
|
+
stdout,
|
|
60
|
+
});
|
|
45
61
|
if ("exit" in parsed)
|
|
46
62
|
return parsed.exit;
|
|
47
63
|
const flags = parsed.values;
|
|
@@ -184,6 +200,82 @@ export async function runInit(argv, io) {
|
|
|
184
200
|
}
|
|
185
201
|
}
|
|
186
202
|
}
|
|
203
|
+
// 5. Agent skills for detected agent tools. Detection-driven and
|
|
204
|
+
// non-interactive; init never invents an install location — with no
|
|
205
|
+
// tooling present, the explicit `paramour skills` command carries the
|
|
206
|
+
// intent its portable-location fallback needs.
|
|
207
|
+
if (!flags["no-skills"]) {
|
|
208
|
+
const detected = detectTargets(projectRoot);
|
|
209
|
+
if (detected.length === 0) {
|
|
210
|
+
stdout(" • no agent tooling detected — skipped agent skills (`paramour skills` installs to the portable .agents/skills/)");
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
try {
|
|
214
|
+
const packaged = loadPackagedSkill();
|
|
215
|
+
for (const target of detected) {
|
|
216
|
+
const result = syncTarget(target, packaged, { dry, force: false });
|
|
217
|
+
if (result.written.length > 0) {
|
|
218
|
+
stdout(` ✔ ${dry ? "would install" : "installed"} agent skills → ${target.rel}`);
|
|
219
|
+
}
|
|
220
|
+
else if (result.skippedModified.length === 0) {
|
|
221
|
+
stdout(` • agent skills already up to date in ${target.rel}`);
|
|
222
|
+
}
|
|
223
|
+
if (result.skippedModified.length > 0) {
|
|
224
|
+
stdout(` ⚠ ${target.rel}: locally-modified skill files left as-is (\`paramour skills --force\` overwrites)`);
|
|
225
|
+
}
|
|
226
|
+
// A sync can also delete files (managed orphans from a previous
|
|
227
|
+
// install); those must never happen silently, so reuse the exact
|
|
228
|
+
// per-orphan wording `paramour skills` prints.
|
|
229
|
+
reportOrphans(result, dry, stdout);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
// Same stance as the wrap step: a failed nicety degrades to a
|
|
234
|
+
// printed pointer, never a failed init.
|
|
235
|
+
stdout(` ⚠ could not install agent skills (${message(error)}) — run \`paramour skills\``);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// 6. Marker-managed paramour section in AGENTS.md/CLAUDE.md, pointing
|
|
240
|
+
// agents at the skill step 5 installed. Append-only: init never creates
|
|
241
|
+
// the file — a root AGENTS.md is a detectTargets signal, so inventing one
|
|
242
|
+
// would change what the skills step sees on the next run. --force is
|
|
243
|
+
// deliberately not consulted: the markers delimit paramour-owned content,
|
|
244
|
+
// so refreshing it is unconditionally safe.
|
|
245
|
+
if (!flags["no-agents-md"]) {
|
|
246
|
+
const agentsFile = findAgentsFile(projectRoot);
|
|
247
|
+
if (agentsFile === undefined) {
|
|
248
|
+
stdout(" • no AGENTS.md or CLAUDE.md — skipped agents snippet");
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
const name = basename(agentsFile);
|
|
252
|
+
let source;
|
|
253
|
+
try {
|
|
254
|
+
source = readFileSync(agentsFile, "utf8");
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
// The skills-step stance: a failed nicety never fails init.
|
|
258
|
+
stdout(` ⚠ could not read ${name} (${message(error)}) — skipped agents snippet`);
|
|
259
|
+
}
|
|
260
|
+
if (source !== undefined) {
|
|
261
|
+
const result = upsertAgentsSection(source);
|
|
262
|
+
if (result.status === "added") {
|
|
263
|
+
write(agentsFile, result.text);
|
|
264
|
+
stdout(` ✔ ${dry ? "would append" : "appended"} paramour section to ${name}`);
|
|
265
|
+
}
|
|
266
|
+
else if (result.status === "updated") {
|
|
267
|
+
write(agentsFile, result.text);
|
|
268
|
+
stdout(` ✔ ${dry ? "would update" : "updated"} paramour section in ${name}`);
|
|
269
|
+
}
|
|
270
|
+
else if (result.status === "unchanged") {
|
|
271
|
+
stdout(` • ${name} paramour section already up to date — skipped`);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
stdout(` ⚠ ${name} has an unterminated paramour marker — left as-is (remove or close the markers, then re-run)`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
187
279
|
return finishWithSummary(projectRoot, artifactPath, stdout);
|
|
188
280
|
}
|
|
189
281
|
function countRoutes(routes) {
|
package/dist/commands/list.d.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { type CliIo } from "../cli-io.js";
|
|
2
|
+
/** @internal `paramour list` flags — skill-drift test's source of truth. */
|
|
3
|
+
export declare const LIST_OPTIONS: {
|
|
4
|
+
readonly "app-dir": {
|
|
5
|
+
readonly type: "string";
|
|
6
|
+
};
|
|
7
|
+
readonly help: {
|
|
8
|
+
readonly default: false;
|
|
9
|
+
readonly short: "h";
|
|
10
|
+
readonly type: "boolean";
|
|
11
|
+
};
|
|
12
|
+
readonly json: {
|
|
13
|
+
readonly default: false;
|
|
14
|
+
readonly type: "boolean";
|
|
15
|
+
};
|
|
16
|
+
readonly "page-extensions": {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
};
|
|
19
|
+
readonly "pages-dir": {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
2
23
|
/**
|
|
3
24
|
* @internal `paramour list`: the filesystem scan is authoritative for WHICH
|
|
4
25
|
* routes exist (same engine as generate); discovered definitions overlay
|
package/dist/commands/list.js
CHANGED
|
@@ -23,6 +23,14 @@ const USAGE = [
|
|
|
23
23
|
" --page-extensions <list> comma-separated, no leading dots (default: tsx,ts,jsx,js)",
|
|
24
24
|
" --pages-dir <dir> pages directory (default: discovered pages/ or src/pages/)",
|
|
25
25
|
].join("\n");
|
|
26
|
+
/** @internal `paramour list` flags — skill-drift test's source of truth. */
|
|
27
|
+
export const LIST_OPTIONS = {
|
|
28
|
+
"app-dir": { type: "string" },
|
|
29
|
+
help: { default: false, short: "h", type: "boolean" },
|
|
30
|
+
json: { default: false, type: "boolean" },
|
|
31
|
+
"page-extensions": { type: "string" },
|
|
32
|
+
"pages-dir": { type: "string" },
|
|
33
|
+
};
|
|
26
34
|
/**
|
|
27
35
|
* @internal `paramour list`: the filesystem scan is authoritative for WHICH
|
|
28
36
|
* routes exist (same engine as generate); discovered definitions overlay
|
|
@@ -32,13 +40,10 @@ const USAGE = [
|
|
|
32
40
|
*/
|
|
33
41
|
export async function runList(argv, io) {
|
|
34
42
|
const { stderr, stdout } = resolveIo(io);
|
|
35
|
-
const parsed = parseCommandFlags(argv, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"page-extensions": { type: "string" },
|
|
40
|
-
"pages-dir": { type: "string" },
|
|
41
|
-
}, USAGE, { stderr, stdout });
|
|
43
|
+
const parsed = parseCommandFlags(argv, LIST_OPTIONS, USAGE, {
|
|
44
|
+
stderr,
|
|
45
|
+
stdout,
|
|
46
|
+
});
|
|
42
47
|
if ("exit" in parsed)
|
|
43
48
|
return parsed.exit;
|
|
44
49
|
const flags = parsed.values;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type CliIo } from "../cli-io.js";
|
|
2
|
+
import { type TargetSyncResult } from "../skills/sync.js";
|
|
3
|
+
/** @internal `paramour skills` flags — skill-drift test's source of truth. */
|
|
4
|
+
export declare const SKILLS_OPTIONS: {
|
|
5
|
+
readonly check: {
|
|
6
|
+
readonly default: false;
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
};
|
|
9
|
+
readonly "dry-run": {
|
|
10
|
+
readonly default: false;
|
|
11
|
+
readonly type: "boolean";
|
|
12
|
+
};
|
|
13
|
+
readonly force: {
|
|
14
|
+
readonly default: false;
|
|
15
|
+
readonly type: "boolean";
|
|
16
|
+
};
|
|
17
|
+
readonly help: {
|
|
18
|
+
readonly default: false;
|
|
19
|
+
readonly short: "h";
|
|
20
|
+
readonly type: "boolean";
|
|
21
|
+
};
|
|
22
|
+
readonly json: {
|
|
23
|
+
readonly default: false;
|
|
24
|
+
readonly type: "boolean";
|
|
25
|
+
};
|
|
26
|
+
readonly tool: {
|
|
27
|
+
readonly multiple: true;
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @internal Per-orphan reporting for a sync: removals (deletions are the one
|
|
33
|
+
* thing a sync does that must never happen silently) and kept locally-modified
|
|
34
|
+
* orphans. Shared by `paramour skills` and `paramour init` so the two commands
|
|
35
|
+
* describe the same operation in the same words.
|
|
36
|
+
*/
|
|
37
|
+
export declare function reportOrphans(result: TargetSyncResult, dry: boolean, stdout: (line: string) => void): void;
|
|
38
|
+
/**
|
|
39
|
+
* @internal `paramour skills` — the installer for the bundled agent skill.
|
|
40
|
+
* `--check` follows `check`'s exit class: 1 means "the installed copies do
|
|
41
|
+
* not reflect the installed package". A plain run treats refusing to clobber
|
|
42
|
+
* local edits as success (init's manual-fallback precedent): the refusal is
|
|
43
|
+
* printed, the fix (`--force`) is named, and nothing is broken.
|
|
44
|
+
*/
|
|
45
|
+
export declare function runSkills(argv: readonly string[], io: CliIo): number;
|