@dzhechkov/harness-cli 0.7.4 → 0.7.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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `dz install` argument resolution — feature install-spec-honesty (backlog 43a52cf2 + c999786b).
3
+ *
4
+ * cmdInstall used to splice the RAW argument into `join(projectRoot, 'node_modules', pkg)`.
5
+ * MEASURED, five broken forms: an absolute path (path.join CONCATENATES an absolute segment —
6
+ * `/proj/node_modules/home/dz/pkgs/...`); a versioned spec `@dzhechkov/health-advisor@1.9.0`
7
+ * (the WORST: `npm install` SUCCEEDS and mutates the project's package.json, then dz dies on an
8
+ * invented path with exit 1 — and the versioned form is exactly what the npm-lag README
9
+ * prescribes); a tarball `pack-1.0.0.tgz`; `github:user/repo`; an alias `ha@npm:...`.
10
+ *
11
+ * The cure is a PURE resolver that runs BEFORE any npm process: every accepted form yields the
12
+ * npm spec AND the node_modules directory name it will land under; everything else is a NAMED
13
+ * refusal carrying the working two-command form. A spec whose landing dir cannot be established
14
+ * must never reach npm — that is what made the versioned failure mutate state and then die.
15
+ */
16
+ export interface InstallSpecProbe {
17
+ /** Does `path` exist as a regular file? */
18
+ readonly isFile: (path: string) => boolean;
19
+ /** Does `path` exist as a directory? */
20
+ readonly isDir: (path: string) => boolean;
21
+ /** `name` from `package/package.json` inside a tarball, or null (unreadable/absent). */
22
+ readonly readTarballName: (path: string) => string | null;
23
+ /** `name` from `<dir>/package.json`, or null. */
24
+ readonly readDirName: (path: string) => string | null;
25
+ }
26
+ export type InstallSpecResolution = {
27
+ readonly kind: 'name' | 'versioned' | 'alias' | 'tarball' | 'dir';
28
+ readonly npmSpec: string;
29
+ readonly dirName: string;
30
+ } | {
31
+ readonly kind: 'refused';
32
+ readonly reason: string;
33
+ readonly hint: string;
34
+ };
35
+ export declare function resolveInstallSpec(raw: string, resolveAgainstCwd: (p: string) => string, probe: InstallSpecProbe): InstallSpecResolution;
36
+ //# sourceMappingURL=install-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-spec.d.ts","sourceRoot":"","sources":["../src/install-spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,wFAAwF;IACxF,QAAQ,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC1D,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACvD;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACzH;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AASjF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,qBAAqB,CA+CxI"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * `dz install` argument resolution — feature install-spec-honesty (backlog 43a52cf2 + c999786b).
3
+ *
4
+ * cmdInstall used to splice the RAW argument into `join(projectRoot, 'node_modules', pkg)`.
5
+ * MEASURED, five broken forms: an absolute path (path.join CONCATENATES an absolute segment —
6
+ * `/proj/node_modules/home/dz/pkgs/...`); a versioned spec `@dzhechkov/health-advisor@1.9.0`
7
+ * (the WORST: `npm install` SUCCEEDS and mutates the project's package.json, then dz dies on an
8
+ * invented path with exit 1 — and the versioned form is exactly what the npm-lag README
9
+ * prescribes); a tarball `pack-1.0.0.tgz`; `github:user/repo`; an alias `ha@npm:...`.
10
+ *
11
+ * The cure is a PURE resolver that runs BEFORE any npm process: every accepted form yields the
12
+ * npm spec AND the node_modules directory name it will land under; everything else is a NAMED
13
+ * refusal carrying the working two-command form. A spec whose landing dir cannot be established
14
+ * must never reach npm — that is what made the versioned failure mutate state and then die.
15
+ */
16
+ const BARE_NAME_RE = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
17
+ /** The two-command fallback that always works, named in every refusal (43a52cf2's own ask). */
18
+ function twoCommandHint(raw) {
19
+ return `working form: npm install ${raw} --save-dev && dz init --skills-dir node_modules/<installed-package-name>`;
20
+ }
21
+ export function resolveInstallSpec(raw, resolveAgainstCwd, probe) {
22
+ const spec = raw.trim();
23
+ if (spec === '')
24
+ return { kind: 'refused', reason: 'empty spec', hint: 'dz install <package|package@version|path/to.tgz|path/to/dir>' };
25
+ // Path forms first — a path is never an npm name. Absolute, explicit-relative, or an existing
26
+ // .tgz/.tar.gz/.dir anywhere: the OLD code spliced these into node_modules verbatim.
27
+ const looksPathy = spec.startsWith('/') || spec.startsWith('./') || spec.startsWith('../') || /\.(tgz|tar\.gz)$/.test(spec);
28
+ if (looksPathy) {
29
+ const abs = resolveAgainstCwd(spec);
30
+ if (/\.(tgz|tar\.gz)$/.test(spec)) {
31
+ if (!probe.isFile(abs))
32
+ return { kind: 'refused', reason: `tarball not found: ${abs}`, hint: twoCommandHint(spec) };
33
+ const name = probe.readTarballName(abs);
34
+ if (name === null)
35
+ return { kind: 'refused', reason: `cannot read package/package.json name from ${abs}`, hint: twoCommandHint(spec) };
36
+ return { kind: 'tarball', npmSpec: abs, dirName: name };
37
+ }
38
+ if (probe.isDir(abs)) {
39
+ const name = probe.readDirName(abs);
40
+ if (name === null)
41
+ return { kind: 'refused', reason: `${abs} has no readable package.json name`, hint: twoCommandHint(spec) };
42
+ return { kind: 'dir', npmSpec: abs, dirName: name };
43
+ }
44
+ return { kind: 'refused', reason: `path does not exist: ${abs}`, hint: twoCommandHint(spec) };
45
+ }
46
+ // git/github/url specs: the landing dir is not cheaply establishable — refuse with the cure.
47
+ if (/^(github:|git\+|git:|https?:\/\/)/.test(spec)) {
48
+ return { kind: 'refused', reason: `git/url specs are not resolvable to a node_modules dir up front (${spec})`, hint: twoCommandHint(spec) };
49
+ }
50
+ // alias@npm:real[@version] — installs under the ALIAS name.
51
+ const alias = /^([^@][^@]*|@[^/]+\/[^@]+)@npm:(.+)$/.exec(spec);
52
+ if (alias !== null) {
53
+ return { kind: 'alias', npmSpec: spec, dirName: alias[1] };
54
+ }
55
+ if (BARE_NAME_RE.test(spec))
56
+ return { kind: 'name', npmSpec: spec, dirName: spec };
57
+ // name@version / @scope/name@version — the dir is the name WITHOUT the version.
58
+ const at = spec.lastIndexOf('@');
59
+ if (at > 0) {
60
+ const name = spec.slice(0, at);
61
+ const version = spec.slice(at + 1);
62
+ if (BARE_NAME_RE.test(name) && version !== '' && !version.includes('/')) {
63
+ return { kind: 'versioned', npmSpec: spec, dirName: name };
64
+ }
65
+ }
66
+ return { kind: 'refused', reason: `unrecognized install spec: ${spec}`, hint: twoCommandHint(spec) };
67
+ }
68
+ //# sourceMappingURL=install-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-spec.js","sourceRoot":"","sources":["../src/install-spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,MAAM,YAAY,GAAG,wDAAwD,CAAC;AAE9E,+FAA+F;AAC/F,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,6BAA6B,GAAG,2EAA2E,CAAC;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AK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACnC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACxE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,8BAA8B,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;AACvG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"known-flags.d.ts","sourceRoot":"","sources":["../src/known-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EA+Q5C,CAAC"}
1
+ {"version":3,"file":"known-flags.d.ts","sourceRoot":"","sources":["../src/known-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAuR5C,CAAC"}
@@ -38,6 +38,7 @@ export const KNOWN_CLI_FLAGS = [
38
38
  'candidates',
39
39
  'canonical',
40
40
  'category',
41
+ 'channel',
41
42
  'check',
42
43
  'claim-check',
43
44
  'claude-bin',
@@ -52,6 +53,7 @@ export const KNOWN_CLI_FLAGS = [
52
53
  'confirmed',
53
54
  'context-only',
54
55
  'corroborate',
56
+ 'count-project',
55
57
  'day',
56
58
  'deep',
57
59
  'default-family',
@@ -62,6 +64,7 @@ export const KNOWN_CLI_FLAGS = [
62
64
  'dir',
63
65
  'domain',
64
66
  'done',
67
+ 'draft',
65
68
  'dry-run',
66
69
  'effect',
67
70
  'effort',
@@ -142,6 +145,7 @@ export const KNOWN_CLI_FLAGS = [
142
145
  'n',
143
146
  'name',
144
147
  'name-only',
148
+ 'night',
145
149
  'no-audit',
146
150
  'no-decorate',
147
151
  'no-dry-run',
@@ -183,6 +187,7 @@ export const KNOWN_CLI_FLAGS = [
183
187
  'porcelain',
184
188
  'preset',
185
189
  'pretty',
190
+ 'preview',
186
191
  'project',
187
192
  'promote',
188
193
  'proposal',
@@ -197,6 +202,7 @@ export const KNOWN_CLI_FLAGS = [
197
202
  'recalled',
198
203
  'reconcile',
199
204
  'record-provisional',
205
+ 'refresh-publishes',
200
206
  'registry',
201
207
  'reinforce',
202
208
  'remove',
@@ -222,6 +228,7 @@ export const KNOWN_CLI_FLAGS = [
222
228
  'seed',
223
229
  'select',
224
230
  'semantic',
231
+ 'send',
225
232
  'session',
226
233
  'sessions-dir',
227
234
  'short',
@@ -274,6 +281,7 @@ export const KNOWN_CLI_FLAGS = [
274
281
  'week',
275
282
  'weekly',
276
283
  'window-days',
284
+ 'window',
277
285
  'with-pairs',
278
286
  'with-references',
279
287
  'work-order',
@@ -1 +1 @@
1
- {"version":3,"file":"known-flags.js","sourceRoot":"","sources":["../src/known-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,UAAU;IACV,KAAK;IACL,mBAAmB;IACnB,sBAAsB;IACtB,KAAK;IACL,QAAQ;IACR,OAAO;IACP,KAAK;IACL,UAAU;IACV,IAAI;IACJ,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM;IACN,UAAU;IACV,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;IACR,cAAc;IACd,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,UAAU;IACV,OAAO;IACP,aAAa;IACb,YAAY;IACZ,KAAK;IACL,cAAc;IACd,YAAY;IACZ,SAAS;IACT,UAAU;IACV,QAAQ;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;IACV,SAAS;IACT,UAAU;IACV,QAAQ;IACR,SAAS;IACT,kBAAkB;IAClB,MAAM;IACN,MAAM;IACN,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,OAAO;IACP,MAAM;IACN,KAAK;CACN,CAAC"}
1
+ {"version":3,"file":"known-flags.js","sourceRoot":"","sources":["../src/known-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,UAAU;IACV,KAAK;IACL,mBAAmB;IACnB,sBAAsB;IACtB,KAAK;IACL,QAAQ;IACR,OAAO;IACP,KAAK;IACL,UAAU;IACV,IAAI;IACJ,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM;IACN,UAAU;IACV,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;IACR,cAAc;IACd,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,UAAU;IACV,SAAS;IACT,OAAO;IACP,aAAa;IACb,YAAY;IACZ,KAAK;IACL,cAAc;IACd,YAAY;IACZ,SAAS;IACT,UAAU;IACV,QAAQ;IACR,SAAS;IACT,SAAS;IACT,WAAW;IACX,cAAc;IACd,aAAa;IACb,eAAe;IACf,KAAK;IACL,MAAM;IACN,gBAAgB;IAChB,MAAM;IACN,aAAa;IACb,MAAM;IACN,aAAa;IACb,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,aAAa;IACb,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,iBAAiB;IACjB,QAAQ;IACR,WAAW;IACX,SAAS;IACT,oBAAoB;IACpB,QAAQ;IACR,aAAa;IACb,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,WAA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IACV,WAAW;IACX,oBAAoB;IACpB,mBAAmB;IACnB,UAAU;IACV,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,iBAAiB;IACjB,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,KAAK;IACL,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,SAAS;IACT,UAAU;IACV,WAAW;IACX,aAAa;IACb,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,MAAM;IACN,SAAS;IACT,cAAc;IACd,OAAO;IACP,eAAe;IACf,UAAU;IACV,OAAO;IACP,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;IACP,eAAe;IACf,aAAa;IACb,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,mBAAmB;IACnB,WAAW;IACX,SAAS;IACT,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,UAAU;IACV,MAAM;IACN,WAAW;IACX,UAAU;IACV,MAAM;IACN,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,UAAU;IACV,SAAS;IACT,UAAU;IACV,QAAQ;IACR,SAAS;IACT,kBAAkB;IAClB,MAAM;IACN,MAAM;IACN,QAAQ;IACR,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,OAAO;IACP,MAAM;IACN,KAAK;CACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/harness-cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "The dz CLI — install AI skills for Claude Code, Codex, OpenCode, Hermes, OpenClaude, GitHub Copilot. 67 commands, 14 presets, 10 platform targets.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,23 +41,23 @@
41
41
  "sbom.json"
42
42
  ],
43
43
  "dependencies": {
44
- "@dzhechkov/harness-core": "^0.7.0",
45
- "@dzhechkov/harness-presets": "^0.5.0",
46
- "@dzhechkov/scout": "^0.8.0",
47
- "@dzhechkov/skills-devops": "^0.3.0",
48
- "@dzhechkov/skills-mcp": "^0.3.0",
49
- "@dzhechkov/skills-web3": "^0.2.0",
50
- "@dzhechkov/skills-qe": "^0.3.0",
51
- "@dzhechkov/skills-meta": "^0.9.0",
52
- "@dzhechkov/skills-academic": "^0.3.0",
53
- "@dzhechkov/skills-ecc": "^0.1.0",
54
- "@dzhechkov/skills-news": "^0.1.0",
55
- "@dzhechkov/skills-pm": "^0.1.0",
56
- "@dzhechkov/skills-taste": "^0.1.0",
57
- "@dzhechkov/skills-idea2prd": "^0.1.0",
58
- "@dzhechkov/skills-reverse-engineering": "^0.1.0",
59
- "@dzhechkov/skills-presentation-storyteller": "^0.1.0",
60
- "@dzhechkov/skills-website-cloner": "^0.1.0"
44
+ "@dzhechkov/harness-core": "^0.7.5",
45
+ "@dzhechkov/scout": "^0.8.7",
46
+ "@dzhechkov/harness-presets": "^0.5.14",
47
+ "@dzhechkov/skills-mcp": "^0.3.6",
48
+ "@dzhechkov/skills-devops": "^0.3.13",
49
+ "@dzhechkov/skills-web3": "^0.2.5",
50
+ "@dzhechkov/skills-qe": "^0.3.10",
51
+ "@dzhechkov/skills-news": "^0.1.12",
52
+ "@dzhechkov/skills-ecc": "^0.1.8",
53
+ "@dzhechkov/skills-meta": "^0.9.49",
54
+ "@dzhechkov/skills-pm": "^0.1.1",
55
+ "@dzhechkov/skills-academic": "^0.3.3",
56
+ "@dzhechkov/skills-taste": "^0.1.1",
57
+ "@dzhechkov/skills-reverse-engineering": "^0.1.9",
58
+ "@dzhechkov/skills-presentation-storyteller": "^0.1.10",
59
+ "@dzhechkov/skills-website-cloner": "^0.1.1",
60
+ "@dzhechkov/skills-idea2prd": "^0.1.11"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "^25.6.0",
package/sbom.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "hashes": [
26
26
  {
27
27
  "alg": "SHA-256",
28
- "content": "1f117cb9a9e3ebf8e1ddd9fcd9227c64afa93c4dee354851befdfb1c6f1d1e98"
28
+ "content": "bf6ac920e20f4e9978dbb7b1cca48790d97e44f245dc53088e189776b4a7616e"
29
29
  }
30
30
  ]
31
31
  },
@@ -69,6 +69,46 @@
69
69
  }
70
70
  ]
71
71
  },
72
+ {
73
+ "type": "file",
74
+ "name": "dist/boolean-flags.d.ts",
75
+ "hashes": [
76
+ {
77
+ "alg": "SHA-256",
78
+ "content": "014b309c8b7de90b6c0d87e4f4c6a15623fd9c261252282faa3567dd3b9d0d4d"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "type": "file",
84
+ "name": "dist/boolean-flags.d.ts.map",
85
+ "hashes": [
86
+ {
87
+ "alg": "SHA-256",
88
+ "content": "a8309c4a78c90a1c9db9518a6d07c5fa800c4d39710941a379635a65012e208d"
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "type": "file",
94
+ "name": "dist/boolean-flags.js",
95
+ "hashes": [
96
+ {
97
+ "alg": "SHA-256",
98
+ "content": "8cf050f1bc0b69be1088e58cc5f88f034d2e847fba9ffc87f3cc01121d7d9d74"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "type": "file",
104
+ "name": "dist/boolean-flags.js.map",
105
+ "hashes": [
106
+ {
107
+ "alg": "SHA-256",
108
+ "content": "442b8bbb2ec9f7701ddc2232fc8662956966097d6f46ee1fce49bd06c20db97f"
109
+ }
110
+ ]
111
+ },
72
112
  {
73
113
  "type": "file",
74
114
  "name": "dist/cli.d.ts",
@@ -85,7 +125,7 @@
85
125
  "hashes": [
86
126
  {
87
127
  "alg": "SHA-256",
88
- "content": "2adf5f4cd1cdb6f9300c50b67acf6031eb8dfa48eed9e44cceb0e87b705a3335"
128
+ "content": "6fc728a98d8a920a226a4ee2d8b045ee46e27246c7d7e8bdf15e6c7758f3efbc"
89
129
  }
90
130
  ]
91
131
  },
@@ -95,7 +135,7 @@
95
135
  "hashes": [
96
136
  {
97
137
  "alg": "SHA-256",
98
- "content": "86d6f102999ac1b5183775cd8d721b71050ac55b024113f23cca6be1fe494a6c"
138
+ "content": "4bc5e7cb6563fd672fd7e2c38eac4ba55d54de46940c194b3d2cd5ea4519732a"
99
139
  }
100
140
  ]
101
141
  },
@@ -105,7 +145,7 @@
105
145
  "hashes": [
106
146
  {
107
147
  "alg": "SHA-256",
108
- "content": "87e420d5db13a85a12cb185d9da2874c788bfdf26fd44a6400f3799a4b835ccc"
148
+ "content": "560d103ce98af8095eb7ee86537aa80de7a914fffa693dc23fdf2440a4f76183"
109
149
  }
110
150
  ]
111
151
  },
@@ -189,6 +229,46 @@
189
229
  }
190
230
  ]
191
231
  },
232
+ {
233
+ "type": "file",
234
+ "name": "dist/install-spec.d.ts",
235
+ "hashes": [
236
+ {
237
+ "alg": "SHA-256",
238
+ "content": "f1a4d132eb06068e2c45ce7976f1b01482187c93021bbfaceb7f1dbe76c8c991"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "type": "file",
244
+ "name": "dist/install-spec.d.ts.map",
245
+ "hashes": [
246
+ {
247
+ "alg": "SHA-256",
248
+ "content": "59a6d12466909c86aa06c272b237ca39473f106fd544725b1e6c707ca1c06a25"
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ "type": "file",
254
+ "name": "dist/install-spec.js",
255
+ "hashes": [
256
+ {
257
+ "alg": "SHA-256",
258
+ "content": "354aae49a20a404eb9d0405ca6c7f6fa277e23b3e9f4988582f0c610486a2e6b"
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "type": "file",
264
+ "name": "dist/install-spec.js.map",
265
+ "hashes": [
266
+ {
267
+ "alg": "SHA-256",
268
+ "content": "3f8225df12c17826d5e8642f342a2fae21f4d1c32bb0969915570258a1ce6a76"
269
+ }
270
+ ]
271
+ },
192
272
  {
193
273
  "type": "file",
194
274
  "name": "dist/known-flags.d.ts",
@@ -205,7 +285,7 @@
205
285
  "hashes": [
206
286
  {
207
287
  "alg": "SHA-256",
208
- "content": "4ac14404f0c1d3c75c215fd7eb7b49c7b0b5d2e3f9fe9a22851117fc8944975b"
288
+ "content": "23fa9b92489e2f39d99397a57f99a4c7566d41b75682d1bbde3f113c480acdcd"
209
289
  }
210
290
  ]
211
291
  },
@@ -215,7 +295,7 @@
215
295
  "hashes": [
216
296
  {
217
297
  "alg": "SHA-256",
218
- "content": "a3a40afcc63df47a39512dfc243f989fdf5dabe205342d76ee9ca77e33646976"
298
+ "content": "f4ed9bddb45629484baf117a3b92eb4097932abda6e5a48227acbc7b5f23f561"
219
299
  }
220
300
  ]
221
301
  },
@@ -225,7 +305,7 @@
225
305
  "hashes": [
226
306
  {
227
307
  "alg": "SHA-256",
228
- "content": "8e9dadaf3a205827c7b5dec03a73b2ab15a6ea775e4d6fc58314065c2a43851b"
308
+ "content": "41bce9592c8192431f7f023271eaf3f548398e5c15441ea69a59e78633915cd9"
229
309
  }
230
310
  ]
231
311
  },
@@ -255,7 +335,7 @@
255
335
  "hashes": [
256
336
  {
257
337
  "alg": "SHA-256",
258
- "content": "95d92b6f95141dc44061f0d728d7df200d96518ee42f9ff9174cd0539263cc52"
338
+ "content": "423120966d33fb4515177a7613f0ace5b392a576098987d0d9ca22aedea96716"
259
339
  }
260
340
  ]
261
341
  },
@@ -269,13 +349,23 @@
269
349
  }
270
350
  ]
271
351
  },
352
+ {
353
+ "type": "file",
354
+ "name": "src/boolean-flags.ts",
355
+ "hashes": [
356
+ {
357
+ "alg": "SHA-256",
358
+ "content": "c3ef929a729f53ca612ac67b1571d2e8da3681ac5060a1cd16e453e0bb1d4e00"
359
+ }
360
+ ]
361
+ },
272
362
  {
273
363
  "type": "file",
274
364
  "name": "src/cli.ts",
275
365
  "hashes": [
276
366
  {
277
367
  "alg": "SHA-256",
278
- "content": "9564c17c05ac595a2db3eef3ea547b39db88837c84e6efe6c1716fb9f7e16018"
368
+ "content": "cae511b9b892c43e874ee06b439306290cd2c0a9e6b75cd0cd931d47adaef3f5"
279
369
  }
280
370
  ]
281
371
  },
@@ -299,13 +389,23 @@
299
389
  }
300
390
  ]
301
391
  },
392
+ {
393
+ "type": "file",
394
+ "name": "src/install-spec.ts",
395
+ "hashes": [
396
+ {
397
+ "alg": "SHA-256",
398
+ "content": "4196fd89c6d2ab1f3ba107141c32635f2739dc38d978a9f4f41a8b0db0ddc5f9"
399
+ }
400
+ ]
401
+ },
302
402
  {
303
403
  "type": "file",
304
404
  "name": "src/known-flags.ts",
305
405
  "hashes": [
306
406
  {
307
407
  "alg": "SHA-256",
308
- "content": "59b255c1ba248365fe5e9432d7ec8933e73bfcb9cd2ce8e19cf8f85f96137163"
408
+ "content": "aed996e8a3741b595eba31ef694ec5b2999dc0a73933a4289325cf6b9944e254"
309
409
  }
310
410
  ]
311
411
  }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Boolean flags DECLARED AS DATA — feature boolean-flags-declared (backlog 247ddcfa).
3
+ *
4
+ * Before this file, `parseArgs` had no concept of a boolean flag: ANY `--flag` greedily consumed
5
+ * the next token unless it began with `--`. MEASURED 2026-08-22 on 0.7.0: `dz sync --dry-run .`
6
+ * turned the safety flag into the option `dry-run=.` — `flags.has('dry-run')` was FALSE and the
7
+ * run WROTE, its only trace a missing label. The same class swallowed positionals
8
+ * (`dz recall --no-semantic "torque"` ate the query) across ~72 commands.
9
+ *
10
+ * GENERATED from a census of `cli.ts` reads — `test/boolean-flags.test.ts` re-derives the census
11
+ * on every run and fails on ANY divergence, in BOTH directions: a name here that gains a valued
12
+ * read, or a new flags.has-only name missing from here, each forces a conscious decision.
13
+ *
14
+ * Two names are declared beyond the mechanical census, both documented:
15
+ * - `json` — its one valued read (cli.ts, the `--json <path>` recovery in the mcp-scan family) IS
16
+ * the hand-patch for this very defect; with the flag declared boolean the recovery goes
17
+ * harmlessly dead and `--json <path>` parses as flag + positional, which that code also accepts.
18
+ * - `force` — valued ONLY under `dz guard` (`--force <reason>`, the audited override); boolean in
19
+ * every other command. Encoded via {@link VALUED_FORCE_COMMANDS}.
20
+ */
21
+ export const BOOLEAN_CLI_FLAGS: ReadonlySet<string> = new Set([
22
+ 'affected',
23
+ 'all',
24
+ 'allow-same-family',
25
+ 'allow-same-family-qe',
26
+ 'any',
27
+ 'apply',
28
+ 'audit-dev',
29
+ 'auto',
30
+ 'books',
31
+ 'bto',
32
+ 'bump-only',
33
+ 'by-stage',
34
+ 'calibrate',
35
+ 'check',
36
+ 'confirm',
37
+ 'context-only',
38
+ 'deep',
39
+ 'diff',
40
+ 'done',
41
+ 'dry-run',
42
+ 'emit',
43
+ 'enrich',
44
+ 'fa-record',
45
+ 'fail-on-undergrant',
46
+ 'finalize',
47
+ 'force',
48
+ 'full',
49
+ 'gates',
50
+ 'guard',
51
+ 'guards',
52
+ 'harmonize',
53
+ 'help',
54
+ 'include-pairs',
55
+ 'init',
56
+ 'install',
57
+ 'install-driver',
58
+ 'install-hook',
59
+ 'json',
60
+ 'keep-scratch',
61
+ 'legacy',
62
+ 'lexical',
63
+ 'list',
64
+ 'live-content',
65
+ 'mock',
66
+ 'night',
67
+ 'no-dry-run',
68
+ 'no-evals',
69
+ 'no-hooks',
70
+ 'no-issue',
71
+ 'no-memory',
72
+ 'no-mirror',
73
+ 'no-provenance',
74
+ 'no-result',
75
+ 'no-semantic',
76
+ 'no-teach',
77
+ 'no-verify',
78
+ 'once',
79
+ 'override',
80
+ 'preview',
81
+ 'provenance',
82
+ 'prune-noise',
83
+ 'prune-quarantine',
84
+ 'publish',
85
+ 'reconcile',
86
+ 'record-provisional',
87
+ 'refresh-publishes',
88
+ 'remove',
89
+ 'require-plan',
90
+ 'require-signing',
91
+ 'rerank',
92
+ 'revise',
93
+ 'scope-check',
94
+ 'semantic',
95
+ 'send',
96
+ 'split',
97
+ 'stages-json',
98
+ 'static',
99
+ 'stats',
100
+ 'strict',
101
+ 'tag',
102
+ 'teach',
103
+ 'usage',
104
+ 'validate',
105
+ 'weak',
106
+ 'with-pairs',
107
+ 'with-references',
108
+ 'yes',
109
+ ]);
110
+
111
+ /** Commands where `--force` takes a VALUE (`--force <reason>`, logged) and must stay greedy. */
112
+ export const VALUED_FORCE_COMMANDS: readonly string[] = ['guard'];
113
+
114
+ /** Is `--<name>` a boolean flag for this command — i.e. it must never swallow the next token? */
115
+ export function isBooleanFlag(name: string, command: string): boolean {
116
+ if (name === 'force') return !VALUED_FORCE_COMMANDS.includes(command);
117
+ return BOOLEAN_CLI_FLAGS.has(name);
118
+ }