@dzhechkov/harness-core 0.4.5 → 0.5.1

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.
Files changed (141) hide show
  1. package/.dz-manifest.json +489 -105
  2. package/README.md +116 -5
  3. package/dist/agents-policy.d.ts +67 -0
  4. package/dist/agents-policy.d.ts.map +1 -0
  5. package/dist/agents-policy.js +258 -0
  6. package/dist/agents-policy.js.map +1 -0
  7. package/dist/codex-hooks-assets.d.ts +47 -0
  8. package/dist/codex-hooks-assets.d.ts.map +1 -0
  9. package/dist/codex-hooks-assets.js +324 -0
  10. package/dist/codex-hooks-assets.js.map +1 -0
  11. package/dist/codex-hooks-verify.d.ts +95 -0
  12. package/dist/codex-hooks-verify.d.ts.map +1 -0
  13. package/dist/codex-hooks-verify.js +169 -0
  14. package/dist/codex-hooks-verify.js.map +1 -0
  15. package/dist/codex-hooks.d.ts +341 -0
  16. package/dist/codex-hooks.d.ts.map +1 -0
  17. package/dist/codex-hooks.js +541 -0
  18. package/dist/codex-hooks.js.map +1 -0
  19. package/dist/discrimination-gate.d.ts +88 -15
  20. package/dist/discrimination-gate.d.ts.map +1 -1
  21. package/dist/discrimination-gate.js +343 -51
  22. package/dist/discrimination-gate.js.map +1 -1
  23. package/dist/feature-adr-checkpoints.d.ts +22 -0
  24. package/dist/feature-adr-checkpoints.d.ts.map +1 -1
  25. package/dist/feature-adr-checkpoints.js +42 -0
  26. package/dist/feature-adr-checkpoints.js.map +1 -1
  27. package/dist/feature-adr-routing.d.ts +218 -5
  28. package/dist/feature-adr-routing.d.ts.map +1 -1
  29. package/dist/feature-adr-routing.js +583 -54
  30. package/dist/feature-adr-routing.js.map +1 -1
  31. package/dist/guard.d.ts +13 -0
  32. package/dist/guard.d.ts.map +1 -1
  33. package/dist/guard.js +25 -1
  34. package/dist/guard.js.map +1 -1
  35. package/dist/index.d.ts +23 -7
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +37 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/loop-blobs.generated.d.ts +1 -1
  40. package/dist/loop-blobs.generated.d.ts.map +1 -1
  41. package/dist/loop-blobs.generated.js +12 -3
  42. package/dist/loop-blobs.generated.js.map +1 -1
  43. package/dist/loop-plan.d.ts +70 -0
  44. package/dist/loop-plan.d.ts.map +1 -1
  45. package/dist/loop-plan.js +103 -0
  46. package/dist/loop-plan.js.map +1 -1
  47. package/dist/loop-render.d.ts.map +1 -1
  48. package/dist/loop-render.js +37 -129
  49. package/dist/loop-render.js.map +1 -1
  50. package/dist/loop-run-semantics.d.ts +130 -0
  51. package/dist/loop-run-semantics.d.ts.map +1 -0
  52. package/dist/loop-run-semantics.js +257 -0
  53. package/dist/loop-run-semantics.js.map +1 -0
  54. package/dist/loop-trace.d.ts +31 -2
  55. package/dist/loop-trace.d.ts.map +1 -1
  56. package/dist/loop-trace.js +89 -12
  57. package/dist/loop-trace.js.map +1 -1
  58. package/dist/managed-hooks.d.ts +86 -0
  59. package/dist/managed-hooks.d.ts.map +1 -0
  60. package/dist/managed-hooks.js +101 -0
  61. package/dist/managed-hooks.js.map +1 -0
  62. package/dist/mutation-gate.d.ts +14 -0
  63. package/dist/mutation-gate.d.ts.map +1 -1
  64. package/dist/mutation-gate.js +25 -2
  65. package/dist/mutation-gate.js.map +1 -1
  66. package/dist/named-lock.d.ts +57 -0
  67. package/dist/named-lock.d.ts.map +1 -0
  68. package/dist/named-lock.js +247 -0
  69. package/dist/named-lock.js.map +1 -0
  70. package/dist/operations.d.ts +229 -0
  71. package/dist/operations.d.ts.map +1 -1
  72. package/dist/operations.js +880 -26
  73. package/dist/operations.js.map +1 -1
  74. package/dist/parity.d.ts +106 -1
  75. package/dist/parity.d.ts.map +1 -1
  76. package/dist/parity.js +209 -5
  77. package/dist/parity.js.map +1 -1
  78. package/dist/qe-bridge.d.ts +291 -0
  79. package/dist/qe-bridge.d.ts.map +1 -0
  80. package/dist/qe-bridge.js +538 -0
  81. package/dist/qe-bridge.js.map +1 -0
  82. package/dist/recall-usage.d.ts +53 -0
  83. package/dist/recall-usage.d.ts.map +1 -1
  84. package/dist/recall-usage.js +125 -2
  85. package/dist/recall-usage.js.map +1 -1
  86. package/dist/score.d.ts.map +1 -1
  87. package/dist/score.js +43 -9
  88. package/dist/score.js.map +1 -1
  89. package/dist/setup.d.ts.map +1 -1
  90. package/dist/setup.js +14 -26
  91. package/dist/setup.js.map +1 -1
  92. package/dist/shell-veto-policy.d.ts +53 -0
  93. package/dist/shell-veto-policy.d.ts.map +1 -0
  94. package/dist/shell-veto-policy.js +103 -0
  95. package/dist/shell-veto-policy.js.map +1 -0
  96. package/dist/skills.d.ts +86 -1
  97. package/dist/skills.d.ts.map +1 -1
  98. package/dist/skills.js +116 -1
  99. package/dist/skills.js.map +1 -1
  100. package/dist/targets.d.ts +75 -0
  101. package/dist/targets.d.ts.map +1 -1
  102. package/dist/targets.js +160 -0
  103. package/dist/targets.js.map +1 -1
  104. package/dist/workflow-run-dispatch.d.ts +230 -0
  105. package/dist/workflow-run-dispatch.d.ts.map +1 -0
  106. package/dist/workflow-run-dispatch.js +363 -0
  107. package/dist/workflow-run-dispatch.js.map +1 -0
  108. package/dist/workflow-run.d.ts +498 -0
  109. package/dist/workflow-run.d.ts.map +1 -0
  110. package/dist/workflow-run.js +1359 -0
  111. package/dist/workflow-run.js.map +1 -0
  112. package/package.json +6 -5
  113. package/sbom.json +1099 -139
  114. package/src/agents-policy.ts +338 -0
  115. package/src/codex-hooks-assets.ts +328 -0
  116. package/src/codex-hooks-verify.ts +237 -0
  117. package/src/codex-hooks.ts +723 -0
  118. package/src/discrimination-gate.ts +456 -58
  119. package/src/feature-adr-checkpoints.ts +38 -0
  120. package/src/feature-adr-routing.ts +697 -75
  121. package/src/guard.ts +36 -1
  122. package/src/index.ts +162 -2
  123. package/src/loop-blobs.generated.ts +12 -3
  124. package/src/loop-plan.ts +185 -0
  125. package/src/loop-render.ts +37 -127
  126. package/src/loop-run-semantics.ts +278 -0
  127. package/src/loop-trace.ts +84 -10
  128. package/src/managed-hooks.ts +150 -0
  129. package/src/mutation-gate.ts +24 -2
  130. package/src/named-lock.ts +277 -0
  131. package/src/operations.ts +1121 -29
  132. package/src/parity.ts +295 -6
  133. package/src/qe-bridge.ts +737 -0
  134. package/src/recall-usage.ts +184 -1
  135. package/src/score.ts +50 -9
  136. package/src/setup.ts +26 -27
  137. package/src/shell-veto-policy.ts +119 -0
  138. package/src/skills.ts +174 -1
  139. package/src/targets.ts +189 -0
  140. package/src/workflow-run-dispatch.ts +459 -0
  141. package/src/workflow-run.ts +1743 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Shell veto policy (`crossrt-2-codex-hooks`, ADR-004 + ADR-005).
3
+ *
4
+ * ONE rule, judged on the raw command string, with no I/O of any kind. The mode — what the CALLER
5
+ * does with a hit — is decided by the caller from project config, never here.
6
+ *
7
+ * Polarity, in one sentence (ADR-004): **a policy hit ⇒ WARN by default, BLOCK only when the
8
+ * project opted in; our own failure ⇒ always ALLOW.**
9
+ *
10
+ * ## Why exactly one rule, and why this one
11
+ *
12
+ * `shell-veto-policy.ts` is NOT a general shell-guardrail engine (plan §0.1's C4 fence). Its
13
+ * charter is a single rule whose violation is **unambiguous**: the command line explicitly asks for
14
+ * WEAKER authentication than the ssh default. Every token below is one a safe invocation never
15
+ * contains, so a hit always means the user deliberately disabled a protection.
16
+ *
17
+ * The withdrawn v1 (`ssh-no-identity`, AM-23) judged the ABSENCE of `-i`/`IdentityFile=`, which
18
+ * blocked `ssh myhost` whenever the identity came from `~/.ssh/config` or `ssh-agent` — the normal
19
+ * secure case — from a user-global registry that reaches every directory on the machine. Absence of
20
+ * a token is not evidence of intent; presence of these four is.
21
+ *
22
+ * `StrictHostKeyChecking=no` and `UserKnownHostsFile=/dev/null` are deliberately NOT rules: they are
23
+ * a real weakening, but CI images use them legitimately, so no unambiguous verdict is available.
24
+ * They are the first candidates for a future rule with its own ADR — **no second rule ships in this
25
+ * leg**.
26
+ *
27
+ * @packageDocumentation
28
+ */
29
+ /** What the caller does with a hit. `warn` is the shipped default (ADR-004). */
30
+ export type VetoMode = 'off' | 'warn' | 'block';
31
+ /** A policy hit. `null` from {@link vetoShellCommand} means allow. */
32
+ export interface VetoHit {
33
+ readonly rule: string;
34
+ readonly reason: string;
35
+ }
36
+ /** The one rule id this leg ships. Exported so tests and the probe cannot drift from it. */
37
+ export declare const SHELL_VETO_RULE_ID = "ssh-explicit-auth-weakening";
38
+ /**
39
+ * Judge one raw shell command.
40
+ *
41
+ * @returns a {@link VetoHit} when the command EXPLICITLY weakens ssh authentication, else `null`.
42
+ * Pure: no filesystem, no environment, no config, no clock.
43
+ */
44
+ export declare function vetoShellCommand(command: string): VetoHit | null;
45
+ /**
46
+ * Resolve the enforcement mode from a parsed `.dz/config.json`.
47
+ *
48
+ * ABSENT, unknown, non-string, or malformed ⇒ `'warn'`. Never `'block'` by default: fail-closed is
49
+ * a decision the owner makes, not one a user-global hook install imposes on every directory
50
+ * (ADR-004 / AM-24). A mutant that flips this default is registered in the mutation registry.
51
+ */
52
+ export declare function resolveVetoMode(projectConfig: unknown): VetoMode;
53
+ //# sourceMappingURL=shell-veto-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-veto-policy.d.ts","sourceRoot":"","sources":["../src/shell-veto-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,gFAAgF;AAChF,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAEhD,sEAAsE;AACtE,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,4FAA4F;AAC5F,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AA6BhE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CA4BhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,OAAO,GAAG,QAAQ,CAOhE"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Shell veto policy (`crossrt-2-codex-hooks`, ADR-004 + ADR-005).
3
+ *
4
+ * ONE rule, judged on the raw command string, with no I/O of any kind. The mode — what the CALLER
5
+ * does with a hit — is decided by the caller from project config, never here.
6
+ *
7
+ * Polarity, in one sentence (ADR-004): **a policy hit ⇒ WARN by default, BLOCK only when the
8
+ * project opted in; our own failure ⇒ always ALLOW.**
9
+ *
10
+ * ## Why exactly one rule, and why this one
11
+ *
12
+ * `shell-veto-policy.ts` is NOT a general shell-guardrail engine (plan §0.1's C4 fence). Its
13
+ * charter is a single rule whose violation is **unambiguous**: the command line explicitly asks for
14
+ * WEAKER authentication than the ssh default. Every token below is one a safe invocation never
15
+ * contains, so a hit always means the user deliberately disabled a protection.
16
+ *
17
+ * The withdrawn v1 (`ssh-no-identity`, AM-23) judged the ABSENCE of `-i`/`IdentityFile=`, which
18
+ * blocked `ssh myhost` whenever the identity came from `~/.ssh/config` or `ssh-agent` — the normal
19
+ * secure case — from a user-global registry that reaches every directory on the machine. Absence of
20
+ * a token is not evidence of intent; presence of these four is.
21
+ *
22
+ * `StrictHostKeyChecking=no` and `UserKnownHostsFile=/dev/null` are deliberately NOT rules: they are
23
+ * a real weakening, but CI images use them legitimately, so no unambiguous verdict is available.
24
+ * They are the first candidates for a future rule with its own ADR — **no second rule ships in this
25
+ * leg**.
26
+ *
27
+ * @packageDocumentation
28
+ */
29
+ /** The one rule id this leg ships. Exported so tests and the probe cannot drift from it. */
30
+ export const SHELL_VETO_RULE_ID = 'ssh-explicit-auth-weakening';
31
+ /**
32
+ * Shell word boundaries. Both ends of every token are anchored, so `echo "sshpassword"` and
33
+ * `--my-passwordauthentication=yes` cannot hit: a user-global guard that matches on a bare
34
+ * substring is one common word away from a machine-wide outage.
35
+ */
36
+ const BOUNDARY = String.raw `[\s;&|()'"\`]`;
37
+ const OPT = String.raw `(?:^|${BOUNDARY})-o\s*`;
38
+ const END = String.raw `(?=$|${BOUNDARY})`;
39
+ /** `-o PasswordAuthentication=yes` — the user turns ON password auth against the ssh default. */
40
+ const PASSWORD_AUTHENTICATION = new RegExp(`${OPT}passwordauthentication\\s*=\\s*yes${END}`, 'i');
41
+ /** `-o PubkeyAuthentication=no` — the user turns OFF key auth. */
42
+ const PUBKEY_AUTHENTICATION = new RegExp(`${OPT}pubkeyauthentication\\s*=\\s*no${END}`, 'i');
43
+ /** `-o PreferredAuthentications=…password…` — the user ORDERS password auth ahead of pubkey. */
44
+ const PREFERRED_AUTHENTICATIONS = new RegExp(`${OPT}preferredauthentications\\s*=\\s*` +
45
+ `(?:[a-z][a-z0-9-]*\\s*,\\s*)*` +
46
+ `(?:password|keyboard-interactive)` +
47
+ `(?:\\s*,\\s*[a-z][a-z0-9-]*)*${END}`, 'i');
48
+ /** `sshpass` as a COMMAND TOKEN — a password is fed to ssh from the command line by construction. */
49
+ const SSHPASS_TOKEN = new RegExp(`(?:^|${BOUNDARY})sshpass${END}`, 'i');
50
+ /**
51
+ * Judge one raw shell command.
52
+ *
53
+ * @returns a {@link VetoHit} when the command EXPLICITLY weakens ssh authentication, else `null`.
54
+ * Pure: no filesystem, no environment, no config, no clock.
55
+ */
56
+ export function vetoShellCommand(command) {
57
+ if (typeof command !== 'string' || command === '')
58
+ return null;
59
+ if (SSHPASS_TOKEN.test(command)) {
60
+ return {
61
+ rule: SHELL_VETO_RULE_ID,
62
+ reason: 'sshpass feeds an ssh password from the command line, disabling key-based auth by construction',
63
+ };
64
+ }
65
+ if (PASSWORD_AUTHENTICATION.test(command)) {
66
+ return {
67
+ rule: SHELL_VETO_RULE_ID,
68
+ reason: 'PasswordAuthentication=yes turns ON password auth against the ssh default',
69
+ };
70
+ }
71
+ if (PUBKEY_AUTHENTICATION.test(command)) {
72
+ return {
73
+ rule: SHELL_VETO_RULE_ID,
74
+ reason: 'PubkeyAuthentication=no turns OFF key auth',
75
+ };
76
+ }
77
+ if (PREFERRED_AUTHENTICATIONS.test(command)) {
78
+ return {
79
+ rule: SHELL_VETO_RULE_ID,
80
+ reason: 'PreferredAuthentications orders password/keyboard-interactive auth ahead of pubkey',
81
+ };
82
+ }
83
+ return null;
84
+ }
85
+ /**
86
+ * Resolve the enforcement mode from a parsed `.dz/config.json`.
87
+ *
88
+ * ABSENT, unknown, non-string, or malformed ⇒ `'warn'`. Never `'block'` by default: fail-closed is
89
+ * a decision the owner makes, not one a user-global hook install imposes on every directory
90
+ * (ADR-004 / AM-24). A mutant that flips this default is registered in the mutation registry.
91
+ */
92
+ export function resolveVetoMode(projectConfig) {
93
+ if (typeof projectConfig !== 'object' || projectConfig === null)
94
+ return 'warn';
95
+ const hooks = projectConfig['hooks'];
96
+ if (typeof hooks !== 'object' || hooks === null)
97
+ return 'warn';
98
+ const mode = hooks['shellVeto'];
99
+ if (mode === 'off' || mode === 'warn' || mode === 'block')
100
+ return mode;
101
+ return 'warn';
102
+ }
103
+ //# sourceMappingURL=shell-veto-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-veto-policy.js","sourceRoot":"","sources":["../src/shell-veto-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAWH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEhE;;;;GAIG;AACH,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA,eAAe,CAAC;AAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA,QAAQ,QAAQ,QAAQ,CAAC;AAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA,QAAQ,QAAQ,GAAG,CAAC;AAE1C,iGAAiG;AACjG,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,qCAAqC,GAAG,EAAE,EAAE,GAAG,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ACpD,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAC/E,MAAM,KAAK,GAAI,aAAyC,CAAC,OAAO,CAAC,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAC/D,MAAM,IAAI,GAAI,KAAiC,CAAC,WAAW,CAAC,CAAC;IAC7D,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/skills.d.ts CHANGED
@@ -22,8 +22,93 @@ export interface SkillInfo {
22
22
  }
23
23
  /** Return the ids of every `<skillsDir>/<id>/SKILL.md`, sorted. */
24
24
  export declare function discoverSkillIds(skillsDir: string): string[];
25
- /** Discover every skill in `skillsDir`, returning id + description. */
25
+ /**
26
+ * Discover every skill in `skillsDir`, returning id + description.
27
+ *
28
+ * **Throws on the first unloadable skill — deliberately, and permanently.** This is a
29
+ * published export; silently turning it into a skip-and-collect function would downgrade
30
+ * every unknown third-party consumer from fail-closed to fail-silent without their
31
+ * consent (an incomplete catalogue reported as complete). Callers that want a partial
32
+ * listing ask for one by name: {@link listSkillsDetailed}. A pinned regression test
33
+ * asserts this function still throws, so a future "helpful" refactor cannot quietly
34
+ * erase the strict variant. (feature dz-cli-defects, ADR-001 as amended by AM-6.)
35
+ */
26
36
  export declare function listSkills(skillsDir: string): SkillSummary[];
37
+ /** How much of the offending file's first line is echoed back to the user. */
38
+ export declare const SKILL_FAILURE_FIRST_LINE_MAX = 100;
39
+ /** One skill directory that could not be loaded. Named, so a log is actionable. */
40
+ export interface SkillLoadFailure {
41
+ /** The skill id (its directory name), e.g. `bto`. */
42
+ readonly id: string;
43
+ /** ABSOLUTE path to the offending `SKILL.md`. */
44
+ readonly path: string;
45
+ /** The caught error's message, verbatim — the classifier stays out of the loader. */
46
+ readonly reason: string;
47
+ /**
48
+ * First line of the source text, trimmed and capped at
49
+ * {@link SKILL_FAILURE_FIRST_LINE_MAX}; `''` when the file is unreadable. Echoing it
50
+ * is what turns the message into a FIX — the user sees the H1 and knows to add the
51
+ * frontmatter fence.
52
+ */
53
+ readonly firstLine: string;
54
+ }
55
+ /** A listing that separates what parsed from what did not. */
56
+ export interface SkillListing {
57
+ /** Sorted by id — same order, same shape as {@link listSkills} produces today. */
58
+ readonly skills: readonly SkillSummary[];
59
+ /** Sorted by id. Empty when every skill loaded. */
60
+ readonly failures: readonly SkillLoadFailure[];
61
+ }
62
+ /**
63
+ * Attribute any skill-load throw to a file. Shared by every consumer
64
+ * (`listSkillsDetailed`, `runInit`, `runInitSingleFileMd`, `runSync`).
65
+ *
66
+ * Best-effort on the first line: an unreadable file yields `''` rather than a second
67
+ * throw — this helper runs on an error path and must never become one.
68
+ */
69
+ export declare function describeSkillLoadFailure(skillsDir: string, id: string, error: unknown): SkillLoadFailure;
70
+ /**
71
+ * Discover every skill in `skillsDir`, separating the ones that parsed from the ones
72
+ * that did not. One broken `SKILL.md` never hides the rest.
73
+ *
74
+ * Catch policy: **every** error per id, not only `SkillDocumentError` — an `EACCES`, a
75
+ * YAML syntax error and a Zod schema rejection are all equally "this one skill is
76
+ * unusable". The `reason` is the caught message verbatim.
77
+ */
78
+ export declare function listSkillsDetailed(skillsDir: string): SkillListing;
79
+ /**
80
+ * Render a `SkillLoadFailure[]` as the diagnostic block a CLI writes to **stderr**.
81
+ *
82
+ * One helper, two rendering modes, chosen by the CALLER — never by the helper sniffing
83
+ * the path. `dz list` / `dz sync` print absolute paths (the user can act on those);
84
+ * `dz install` passes `relativeTo` = the downloaded package root, because a
85
+ * `node_modules/**` absolute path is not something the user can act on.
86
+ *
87
+ * Returns `[]` for an empty input, so callers can splice it unconditionally.
88
+ */
89
+ export declare function formatSkillLoadFailures(failures: readonly SkillLoadFailure[], opts?: {
90
+ readonly relativeTo?: string;
91
+ }): string[];
92
+ /**
93
+ * One skill that LOADED cleanly but could not be compiled for, or written to, the
94
+ * target. The subject is the TARGET, never the source `SKILL.md`.
95
+ */
96
+ export interface SkillApplyFailure {
97
+ /** The skill id (its directory name). */
98
+ readonly id: string;
99
+ /** The caught error's message, verbatim. */
100
+ readonly reason: string;
101
+ }
102
+ /**
103
+ * Render a `SkillApplyFailure[]` as the diagnostic block a CLI writes to **stderr**.
104
+ *
105
+ * Deliberately a DIFFERENT header from {@link formatSkillLoadFailures}: the two kinds
106
+ * point the user at two different files, and a shared header is what let a write
107
+ * failure masquerade as a parse failure.
108
+ *
109
+ * Returns `[]` for an empty input, so callers can splice it unconditionally.
110
+ */
111
+ export declare function formatSkillApplyFailures(failures: readonly SkillApplyFailure[]): string[];
27
112
  /** Get detailed info about a single skill without loading all assets. */
28
113
  export declare function getSkillInfo(skillsDir: string, id: string): SkillInfo | undefined;
29
114
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAElE,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,2BAA2B;AAC3B,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,E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AAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAQzF;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAqBjF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,CAoB9E"}
package/dist/skills.js CHANGED
@@ -52,7 +52,17 @@ export function discoverSkillIds(skillsDir) {
52
52
  .map((entry) => entry.name)
53
53
  .sort();
54
54
  }
55
- /** Discover every skill in `skillsDir`, returning id + description. */
55
+ /**
56
+ * Discover every skill in `skillsDir`, returning id + description.
57
+ *
58
+ * **Throws on the first unloadable skill — deliberately, and permanently.** This is a
59
+ * published export; silently turning it into a skip-and-collect function would downgrade
60
+ * every unknown third-party consumer from fail-closed to fail-silent without their
61
+ * consent (an incomplete catalogue reported as complete). Callers that want a partial
62
+ * listing ask for one by name: {@link listSkillsDetailed}. A pinned regression test
63
+ * asserts this function still throws, so a future "helpful" refactor cannot quietly
64
+ * erase the strict variant. (feature dz-cli-defects, ADR-001 as amended by AM-6.)
65
+ */
56
66
  export function listSkills(skillsDir) {
57
67
  return discoverSkillIds(skillsDir).map((id) => {
58
68
  const document = parseSkillDocument(readFileSync(join(skillsDir, id, 'SKILL.md'), 'utf-8'));
@@ -60,6 +70,111 @@ export function listSkills(skillsDir) {
60
70
  return { id, description: frontmatter.description };
61
71
  });
62
72
  }
73
+ // ---------------------------------------------------------------------------
74
+ // Skip-and-collect (feature dz-cli-defects, D1)
75
+ //
76
+ // The parser (`@dzhechkov/core/src/skill-document.ts`) is handed only TEXT, so its
77
+ // message can never carry a path. `describeSkillLoadFailure` is the ONE place that
78
+ // turns a pathless throw into a named failure — every consumer calls it, so "named,
79
+ // never anonymous" has one implementation and one test.
80
+ // ---------------------------------------------------------------------------
81
+ /** How much of the offending file's first line is echoed back to the user. */
82
+ export const SKILL_FAILURE_FIRST_LINE_MAX = 100;
83
+ /**
84
+ * Attribute any skill-load throw to a file. Shared by every consumer
85
+ * (`listSkillsDetailed`, `runInit`, `runInitSingleFileMd`, `runSync`).
86
+ *
87
+ * Best-effort on the first line: an unreadable file yields `''` rather than a second
88
+ * throw — this helper runs on an error path and must never become one.
89
+ */
90
+ export function describeSkillLoadFailure(skillsDir, id, error) {
91
+ const path = join(skillsDir, id, 'SKILL.md');
92
+ let firstLine = '';
93
+ try {
94
+ const raw = readFileSync(path, 'utf-8');
95
+ const line = (raw.split('\n', 1)[0] ?? '').replace(/\r$/, '').trim();
96
+ firstLine =
97
+ line.length > SKILL_FAILURE_FIRST_LINE_MAX
98
+ ? `${line.slice(0, SKILL_FAILURE_FIRST_LINE_MAX)}…`
99
+ : line;
100
+ }
101
+ catch {
102
+ firstLine = '';
103
+ }
104
+ return {
105
+ id,
106
+ path,
107
+ reason: error instanceof Error ? error.message : String(error),
108
+ firstLine,
109
+ };
110
+ }
111
+ /**
112
+ * Discover every skill in `skillsDir`, separating the ones that parsed from the ones
113
+ * that did not. One broken `SKILL.md` never hides the rest.
114
+ *
115
+ * Catch policy: **every** error per id, not only `SkillDocumentError` — an `EACCES`, a
116
+ * YAML syntax error and a Zod schema rejection are all equally "this one skill is
117
+ * unusable". The `reason` is the caught message verbatim.
118
+ */
119
+ export function listSkillsDetailed(skillsDir) {
120
+ const skills = [];
121
+ const failures = [];
122
+ for (const id of discoverSkillIds(skillsDir)) {
123
+ try {
124
+ const document = parseSkillDocument(readFileSync(join(skillsDir, id, 'SKILL.md'), 'utf-8'));
125
+ const frontmatter = ClaudeSkillFrontmatterSchema.parse(parseYaml(document.frontmatterYaml));
126
+ skills.push({ id, description: frontmatter.description });
127
+ }
128
+ catch (error) {
129
+ failures.push(describeSkillLoadFailure(skillsDir, id, error));
130
+ }
131
+ }
132
+ return { skills, failures };
133
+ }
134
+ /**
135
+ * Render a `SkillLoadFailure[]` as the diagnostic block a CLI writes to **stderr**.
136
+ *
137
+ * One helper, two rendering modes, chosen by the CALLER — never by the helper sniffing
138
+ * the path. `dz list` / `dz sync` print absolute paths (the user can act on those);
139
+ * `dz install` passes `relativeTo` = the downloaded package root, because a
140
+ * `node_modules/**` absolute path is not something the user can act on.
141
+ *
142
+ * Returns `[]` for an empty input, so callers can splice it unconditionally.
143
+ */
144
+ export function formatSkillLoadFailures(failures, opts = {}) {
145
+ if (failures.length === 0)
146
+ return [];
147
+ const lines = [`⚠ ${failures.length} skill(s) skipped (unparseable SKILL.md):`];
148
+ for (const failure of failures) {
149
+ const shown = opts.relativeTo !== undefined
150
+ ? relative(opts.relativeTo, failure.path).split('\\').join('/')
151
+ : failure.path;
152
+ lines.push(` ${shown}`);
153
+ lines.push(` ${failure.reason}`);
154
+ if (failure.firstLine !== '')
155
+ lines.push(` (line 1: ${JSON.stringify(failure.firstLine)})`);
156
+ }
157
+ return lines;
158
+ }
159
+ /**
160
+ * Render a `SkillApplyFailure[]` as the diagnostic block a CLI writes to **stderr**.
161
+ *
162
+ * Deliberately a DIFFERENT header from {@link formatSkillLoadFailures}: the two kinds
163
+ * point the user at two different files, and a shared header is what let a write
164
+ * failure masquerade as a parse failure.
165
+ *
166
+ * Returns `[]` for an empty input, so callers can splice it unconditionally.
167
+ */
168
+ export function formatSkillApplyFailures(failures) {
169
+ if (failures.length === 0)
170
+ return [];
171
+ const lines = [`✗ ${failures.length} skill(s) failed to install (compile/write error):`];
172
+ for (const failure of failures) {
173
+ lines.push(` ${failure.id}`);
174
+ lines.push(` ${failure.reason}`);
175
+ }
176
+ return lines;
177
+ }
63
178
  /** Get detailed info about a single skill without loading all assets. */
64
179
  export function getSkillInfo(skillsDir, id) {
65
180
  const skillDir = join(skillsDir, id);
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names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AC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YACpD,QAAQ;YACR,OAAO;SACR,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC"}
package/dist/targets.d.ts CHANGED
@@ -15,4 +15,79 @@ export declare const TARGETS: Record<TargetName, Adapter>;
15
15
  export declare const TARGET_NAMES: TargetName[];
16
16
  /** Type guard: is `value` a supported `--target` name? */
17
17
  export declare function isTargetName(value: string): value is TargetName;
18
+ /** `TARGET_NAMES` sorted alphabetically, for display in error messages. */
19
+ export declare const TARGET_NAMES_SORTED: readonly TargetName[];
20
+ /**
21
+ * Semantic `--target` aliases — DATA, not branching logic. Adding a row is one line
22
+ * and zero control flow (ADR-002 §Rationale D5).
23
+ *
24
+ * Purely typographic variants (`Claude_Code`, `claudecode`, `agents.md`) are handled by
25
+ * normalisation, not by rows; the rows below carry only meanings normalisation cannot
26
+ * derive (`claude` ≠ `claude-code` by any string rule — it is an owner decision).
27
+ */
28
+ export declare const TARGET_ALIASES: Readonly<Record<string, TargetName>>;
29
+ /**
30
+ * Rows deleted in fix round 1 (QE F7) because they were UNREACHABLE, not because their
31
+ * inputs stopped working: `claude_code`, `claudecode`, `agentsmd` and `agents.md` all
32
+ * normalise onto a canonical name, and precedence step 2 (normalised canonical) runs
33
+ * BEFORE step 3 (this table). Every one of them still resolves — through normalisation,
34
+ * which is where the README already says typographic variants are handled.
35
+ *
36
+ * They were invisible dead data because the table test iterated every row asserting
37
+ * `via === 'alias'`, which is true on both paths — a PRESENCE assertion where a
38
+ * REACHABILITY one was intended. `target-resolution.test.ts` now removes each row from a
39
+ * COPY of the table and asserts the resolution changes, so a future dead row is red.
40
+ */
41
+ /** The outcome of {@link resolveTargetName}. Total: every string maps to one of these. */
42
+ export type TargetResolution = {
43
+ readonly kind: 'ok';
44
+ readonly target: TargetName;
45
+ readonly via: 'canonical' | 'alias';
46
+ } | {
47
+ readonly kind: 'unknown';
48
+ readonly input: string;
49
+ readonly suggestion: TargetName | null;
50
+ };
51
+ /** Levenshtein suggestions are only offered at or below this edit distance. */
52
+ export declare const TARGET_SUGGESTION_MAX_DISTANCE = 3;
53
+ /**
54
+ * Normalise a `--target` token for matching: byte-level lowercase (never
55
+ * `toLocaleLowerCase` — behaviour must not vary with the host locale), trimmed, with
56
+ * every separator dropped so `Claude_Code`, `claude-code` and `claudecode` collapse.
57
+ *
58
+ * Exported so the alias-REACHABILITY test can ask the production normaliser whether a
59
+ * proposed alias row is already carried by precedence step 2, instead of keeping a
60
+ * second copy of this rule in the test file (fix round 1, QE F7).
61
+ */
62
+ export declare function normalizeTargetToken(value: string): string;
63
+ /**
64
+ * Resolve a user-supplied `--target` value to a canonical {@link TargetName}.
65
+ *
66
+ * Total, pure, no I/O. Precedence (fixed and tested):
67
+ *
68
+ * 1. exact canonical hit → `{kind:'ok', via:'canonical'}` (`isTargetName` semantics);
69
+ * 2. normalised canonical hit → `{kind:'ok', via:'alias'}` (`Claude_Code`, `agentsmd`);
70
+ * 3. explicit {@link TARGET_ALIASES} row → `{kind:'ok', via:'alias'}`;
71
+ * 4. unique normalised prefix → `{kind:'unknown', suggestion}`;
72
+ * 5. Levenshtein ≤ 3 strictly better than the runner-up → `{kind:'unknown', suggestion}`;
73
+ * 6. otherwise → `{kind:'unknown', suggestion:null}`.
74
+ *
75
+ * **Aliases ACCEPT; prefix and Levenshtein only SUGGEST.** An alias row is an owner
76
+ * decision recorded in data; a fuzzy match is a guess, and silently installing to the
77
+ * wrong target on a guess is worse than one round-trip.
78
+ */
79
+ export declare function resolveTargetName(value: string): TargetResolution;
80
+ /**
81
+ * Render the two-line failure for an unresolvable `--target`.
82
+ *
83
+ * Line 2 keeps the literal substring `--target must be one of:` — three shipped
84
+ * assertions (`test/cli.test.ts`) pin it, and keeping the shape additive is what makes
85
+ * the D3 change prove itself with NEW tests instead of rewriting old ones. The values
86
+ * are {@link TARGET_NAMES_SORTED} (alphabetical), which the pre-change message was not.
87
+ */
88
+ export declare function formatTargetProblem(command: string, resolution: Extract<TargetResolution, {
89
+ kind: 'unknown';
90
+ }>): readonly string[];
91
+ /** The one-line diagnostic emitted (on stderr) when an alias was accepted. */
92
+ export declare function formatTargetAliasNote(command: string, input: string, target: TargetName): string;
18
93
  //# sourceMappingURL=targets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../src/targets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;GAGG;AACH,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAKrJ,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAa/C,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAA2B,UAAU,EAAE,CAAC;AAEjE,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D"}
1
+ {"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../src/targets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;GAGG;AACH,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,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