@monoes/monomindcli 2.15.5 → 2.15.7

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 (226) hide show
  1. package/dist/src/commands/cleanup-plan.d.ts +57 -0
  2. package/dist/src/commands/cleanup-plan.d.ts.map +1 -0
  3. package/dist/src/commands/cleanup-plan.js +379 -0
  4. package/dist/src/commands/cleanup-plan.js.map +1 -0
  5. package/dist/src/commands/cleanup.d.ts.map +1 -1
  6. package/dist/src/commands/cleanup.js +87 -160
  7. package/dist/src/commands/cleanup.js.map +1 -1
  8. package/dist/src/commands/search-universal.d.ts +8 -0
  9. package/dist/src/commands/search-universal.d.ts.map +1 -1
  10. package/dist/src/commands/search-universal.js +14 -0
  11. package/dist/src/commands/search-universal.js.map +1 -1
  12. package/dist/src/index.d.ts.map +1 -1
  13. package/dist/src/index.js +11 -2
  14. package/dist/src/index.js.map +1 -1
  15. package/dist/src/orgrt/completion-gate.d.ts +40 -0
  16. package/dist/src/orgrt/completion-gate.d.ts.map +1 -1
  17. package/dist/src/orgrt/completion-gate.js +90 -9
  18. package/dist/src/orgrt/completion-gate.js.map +1 -1
  19. package/dist/src/orgrt/daemon.d.ts +4 -0
  20. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  21. package/dist/src/orgrt/daemon.js +15 -2
  22. package/dist/src/orgrt/daemon.js.map +1 -1
  23. package/dist/src/orgrt/decisions.d.ts +24 -1
  24. package/dist/src/orgrt/decisions.d.ts.map +1 -1
  25. package/dist/src/orgrt/decisions.js +171 -11
  26. package/dist/src/orgrt/decisions.js.map +1 -1
  27. package/dist/src/orgrt/idle-deadline.d.ts +10 -0
  28. package/dist/src/orgrt/idle-deadline.d.ts.map +1 -1
  29. package/dist/src/orgrt/idle-deadline.js +8 -0
  30. package/dist/src/orgrt/idle-deadline.js.map +1 -1
  31. package/dist/src/orgrt/mailbox.d.ts +7 -0
  32. package/dist/src/orgrt/mailbox.d.ts.map +1 -1
  33. package/dist/src/orgrt/mailbox.js +14 -0
  34. package/dist/src/orgrt/mailbox.js.map +1 -1
  35. package/dist/src/orgrt/review-packet.d.ts +1 -1
  36. package/dist/src/orgrt/review-packet.d.ts.map +1 -1
  37. package/dist/src/orgrt/review-packet.js +2 -1
  38. package/dist/src/orgrt/review-packet.js.map +1 -1
  39. package/dist/src/orgrt/role-sandbox.d.ts +1 -0
  40. package/dist/src/orgrt/role-sandbox.d.ts.map +1 -1
  41. package/dist/src/orgrt/role-sandbox.js +6 -1
  42. package/dist/src/orgrt/role-sandbox.js.map +1 -1
  43. package/dist/src/orgrt/session.d.ts +3 -0
  44. package/dist/src/orgrt/session.d.ts.map +1 -1
  45. package/dist/src/orgrt/session.js +8 -1
  46. package/dist/src/orgrt/session.js.map +1 -1
  47. package/dist/src/orgrt/task-dag.d.ts +3 -0
  48. package/dist/src/orgrt/task-dag.d.ts.map +1 -1
  49. package/dist/src/orgrt/task-dag.js +7 -0
  50. package/dist/src/orgrt/task-dag.js.map +1 -1
  51. package/dist/src/orgrt/types.d.ts +3 -0
  52. package/dist/src/orgrt/types.d.ts.map +1 -1
  53. package/dist/src/orgrt/types.js +6 -2
  54. package/dist/src/orgrt/types.js.map +1 -1
  55. package/dist/src/update/checker.d.ts +3 -1
  56. package/dist/src/update/checker.d.ts.map +1 -1
  57. package/dist/src/update/checker.js +7 -3
  58. package/dist/src/update/checker.js.map +1 -1
  59. package/dist/src/update/index.d.ts +16 -0
  60. package/dist/src/update/index.d.ts.map +1 -1
  61. package/dist/src/update/index.js +37 -1
  62. package/dist/src/update/index.js.map +1 -1
  63. package/dist/src/update/refresh-worker.d.ts +9 -0
  64. package/dist/src/update/refresh-worker.d.ts.map +1 -0
  65. package/dist/src/update/refresh-worker.js +17 -0
  66. package/dist/src/update/refresh-worker.js.map +1 -0
  67. package/dist/src/utils/resource-governor.d.ts +44 -2
  68. package/dist/src/utils/resource-governor.d.ts.map +1 -1
  69. package/dist/src/utils/resource-governor.js +157 -40
  70. package/dist/src/utils/resource-governor.js.map +1 -1
  71. package/dist/tsconfig.tsbuildinfo +1 -1
  72. package/package.json +4 -4
  73. package/.claude/skills/monodesign/SKILL.md +0 -257
  74. package/.claude/skills/monodesign/adapt.md +0 -53
  75. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +0 -100
  76. package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +0 -103
  77. package/.claude/skills/monodesign/animate.md +0 -65
  78. package/.claude/skills/monodesign/audit.md +0 -89
  79. package/.claude/skills/monodesign/bolder.md +0 -50
  80. package/.claude/skills/monodesign/clarify.md +0 -64
  81. package/.claude/skills/monodesign/colorize.md +0 -68
  82. package/.claude/skills/monodesign/craft.md +0 -51
  83. package/.claude/skills/monodesign/critique.md +0 -66
  84. package/.claude/skills/monodesign/delight.md +0 -47
  85. package/.claude/skills/monodesign/distill.md +0 -56
  86. package/.claude/skills/monodesign/document.md +0 -83
  87. package/.claude/skills/monodesign/extract.md +0 -74
  88. package/.claude/skills/monodesign/harden.md +0 -65
  89. package/.claude/skills/monodesign/init.md +0 -30
  90. package/.claude/skills/monodesign/layout.md +0 -36
  91. package/.claude/skills/monodesign/live.md +0 -34
  92. package/.claude/skills/monodesign/onboard.md +0 -50
  93. package/.claude/skills/monodesign/optimize.md +0 -64
  94. package/.claude/skills/monodesign/overdrive.md +0 -56
  95. package/.claude/skills/monodesign/polish.md +0 -68
  96. package/.claude/skills/monodesign/quieter.md +0 -57
  97. package/.claude/skills/monodesign/reference/adapt.md +0 -312
  98. package/.claude/skills/monodesign/reference/adapt.native.md +0 -58
  99. package/.claude/skills/monodesign/reference/android.md +0 -40
  100. package/.claude/skills/monodesign/reference/animate.md +0 -203
  101. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +0 -410
  102. package/.claude/skills/monodesign/reference/audit.md +0 -135
  103. package/.claude/skills/monodesign/reference/audit.native.md +0 -139
  104. package/.claude/skills/monodesign/reference/bolder.md +0 -120
  105. package/.claude/skills/monodesign/reference/brand-workflow.md +0 -180
  106. package/.claude/skills/monodesign/reference/brand.md +0 -108
  107. package/.claude/skills/monodesign/reference/clarify.md +0 -288
  108. package/.claude/skills/monodesign/reference/codex.md +0 -105
  109. package/.claude/skills/monodesign/reference/cognitive-load.md +0 -106
  110. package/.claude/skills/monodesign/reference/color-and-contrast.md +0 -105
  111. package/.claude/skills/monodesign/reference/colorize.md +0 -257
  112. package/.claude/skills/monodesign/reference/component-specs.md +0 -260
  113. package/.claude/skills/monodesign/reference/component-states.md +0 -274
  114. package/.claude/skills/monodesign/reference/component-system.md +0 -358
  115. package/.claude/skills/monodesign/reference/copy-formulas.md +0 -160
  116. package/.claude/skills/monodesign/reference/craft.md +0 -123
  117. package/.claude/skills/monodesign/reference/critique.md +0 -780
  118. package/.claude/skills/monodesign/reference/delight.md +0 -302
  119. package/.claude/skills/monodesign/reference/design-principles.md +0 -246
  120. package/.claude/skills/monodesign/reference/distill.md +0 -111
  121. package/.claude/skills/monodesign/reference/document.md +0 -429
  122. package/.claude/skills/monodesign/reference/extract.md +0 -69
  123. package/.claude/skills/monodesign/reference/harden.md +0 -347
  124. package/.claude/skills/monodesign/reference/heuristics-scoring.md +0 -234
  125. package/.claude/skills/monodesign/reference/hooks.md +0 -92
  126. package/.claude/skills/monodesign/reference/image-prompts.md +0 -130
  127. package/.claude/skills/monodesign/reference/init.md +0 -221
  128. package/.claude/skills/monodesign/reference/interaction-design.md +0 -189
  129. package/.claude/skills/monodesign/reference/ios.md +0 -45
  130. package/.claude/skills/monodesign/reference/layout.md +0 -185
  131. package/.claude/skills/monodesign/reference/live.md +0 -710
  132. package/.claude/skills/monodesign/reference/motion-design.md +0 -109
  133. package/.claude/skills/monodesign/reference/onboard.md +0 -234
  134. package/.claude/skills/monodesign/reference/optimize.md +0 -258
  135. package/.claude/skills/monodesign/reference/overdrive.md +0 -130
  136. package/.claude/skills/monodesign/reference/personas.md +0 -179
  137. package/.claude/skills/monodesign/reference/polish.md +0 -241
  138. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +0 -108
  139. package/.claude/skills/monodesign/reference/product.md +0 -60
  140. package/.claude/skills/monodesign/reference/quieter.md +0 -99
  141. package/.claude/skills/monodesign/reference/responsive-design.md +0 -114
  142. package/.claude/skills/monodesign/reference/shape.md +0 -165
  143. package/.claude/skills/monodesign/reference/spatial-design.md +0 -100
  144. package/.claude/skills/monodesign/reference/teach.md +0 -10
  145. package/.claude/skills/monodesign/reference/token-architecture.md +0 -222
  146. package/.claude/skills/monodesign/reference/typeset.md +0 -301
  147. package/.claude/skills/monodesign/reference/typography.md +0 -159
  148. package/.claude/skills/monodesign/reference/ux-research.md +0 -143
  149. package/.claude/skills/monodesign/reference/ux-rules.md +0 -211
  150. package/.claude/skills/monodesign/reference/ux-writing.md +0 -107
  151. package/.claude/skills/monodesign/scripts/command-metadata.json +0 -94
  152. package/.claude/skills/monodesign/scripts/context-signals.mjs +0 -260
  153. package/.claude/skills/monodesign/scripts/context.mjs +0 -1065
  154. package/.claude/skills/monodesign/scripts/critique-storage.mjs +0 -416
  155. package/.claude/skills/monodesign/scripts/detect-csp.mjs +0 -193
  156. package/.claude/skills/monodesign/scripts/detect.mjs +0 -33
  157. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +0 -1960
  158. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +0 -321
  159. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +0 -814
  160. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +0 -5628
  161. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +0 -50
  162. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +0 -259
  163. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +0 -349
  164. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +0 -636
  165. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +0 -1016
  166. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +0 -253
  167. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -198
  168. package/.claude/skills/monodesign/scripts/detector/findings.mjs +0 -12
  169. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +0 -181
  170. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +0 -373
  171. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +0 -426
  172. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +0 -198
  173. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +0 -166
  174. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +0 -563
  175. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +0 -3024
  176. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +0 -124
  177. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +0 -101
  178. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +0 -30
  179. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +0 -148
  180. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +0 -7
  181. package/.claude/skills/monodesign/scripts/hook-admin.mjs +0 -694
  182. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +0 -516
  183. package/.claude/skills/monodesign/scripts/hook-lib.mjs +0 -1785
  184. package/.claude/skills/monodesign/scripts/hook.mjs +0 -61
  185. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +0 -809
  186. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +0 -69
  187. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +0 -640
  188. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +0 -129
  189. package/.claude/skills/monodesign/scripts/lib/provider.mjs +0 -4
  190. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +0 -42
  191. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +0 -50
  192. package/.claude/skills/monodesign/scripts/live/completion.mjs +0 -19
  193. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +0 -137
  194. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +0 -458
  195. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +0 -939
  196. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +0 -357
  197. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +0 -152
  198. package/.claude/skills/monodesign/scripts/live/session-store.mjs +0 -293
  199. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +0 -826
  200. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +0 -279
  201. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +0 -180
  202. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +0 -36
  203. package/.claude/skills/monodesign/scripts/live-accept.mjs +0 -812
  204. package/.claude/skills/monodesign/scripts/live-browser-dom.js +0 -147
  205. package/.claude/skills/monodesign/scripts/live-browser-session.js +0 -124
  206. package/.claude/skills/monodesign/scripts/live-browser.js +0 -11213
  207. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +0 -1241
  208. package/.claude/skills/monodesign/scripts/live-complete.mjs +0 -75
  209. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +0 -683
  210. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +0 -51
  211. package/.claude/skills/monodesign/scripts/live-inject.mjs +0 -596
  212. package/.claude/skills/monodesign/scripts/live-insert.mjs +0 -272
  213. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +0 -363
  214. package/.claude/skills/monodesign/scripts/live-poll.mjs +0 -384
  215. package/.claude/skills/monodesign/scripts/live-resume.mjs +0 -94
  216. package/.claude/skills/monodesign/scripts/live-server.mjs +0 -1210
  217. package/.claude/skills/monodesign/scripts/live-status.mjs +0 -61
  218. package/.claude/skills/monodesign/scripts/live-target.mjs +0 -30
  219. package/.claude/skills/monodesign/scripts/live-wrap.mjs +0 -884
  220. package/.claude/skills/monodesign/scripts/live.mjs +0 -297
  221. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +0 -14
  222. package/.claude/skills/monodesign/scripts/palette.mjs +0 -635
  223. package/.claude/skills/monodesign/scripts/pin.mjs +0 -221
  224. package/.claude/skills/monodesign/shape.md +0 -71
  225. package/.claude/skills/monodesign/teach.md +0 -18
  226. package/.claude/skills/monodesign/typeset.md +0 -59
@@ -1,694 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * The Monodesign hooks command manages the design hook runtime
4
- * via the `hook` key and shared detector ignores via the `detector` key in
5
- * .monodesign/config.json / .monodesign/config.local.json.
6
- *
7
- * Usage:
8
- * node hook-admin.mjs status # print current state
9
- * node hook-admin.mjs on # set enabled: true
10
- * node hook-admin.mjs off # set enabled: false
11
- * node hook-admin.mjs ignore-rule <rule-id> # append to ignoreRules
12
- * node hook-admin.mjs ignore-rule overused-font --all-values
13
- * node hook-admin.mjs ignore-file <glob> # append to ignoreFiles
14
- * node hook-admin.mjs ignore-value <rule> <value> # append to shared ignoreValues
15
- * node hook-admin.mjs ignore-value <rule> <value> --local
16
- * node hook-admin.mjs reset # remove all config + cache
17
- *
18
- * Designed to be invoked by the LLM from the reference/hooks.md flow.
19
- * Output is human-readable; the harness will pass it back to the user.
20
- */
21
-
22
- import fs from 'node:fs';
23
- import path from 'node:path';
24
- import { MONODESIGN_COMMAND } from './lib/provider.mjs';
25
-
26
- import {
27
- getConfigPath,
28
- getLocalConfigPath,
29
- getCachePath,
30
- getPendingPath,
31
- readConfig,
32
- DEFAULT_CONFIG,
33
- ensureHookGitExcludes,
34
- normalizeIgnoreValue,
35
- normalizeIgnoreValueEntries,
36
- } from './hook-lib.mjs';
37
-
38
- const ACTIONS = new Set(['status', 'on', 'off', 'ignore-rule', 'ignore-file', 'ignore-value', 'reset']);
39
- const MONODESIGN_HOOK_COMMAND_MARKERS = [
40
- 'skills/monodesign/scripts/hook-probe.mjs',
41
- 'skills/monodesign/scripts/hook.mjs',
42
- 'skills/monodesign/scripts/hook-before-edit.mjs',
43
- 'skills/monodesign/scripts/hook-after-edit.mjs',
44
- 'skills/monodesign/scripts/hook-stop.mjs',
45
- ];
46
- const TIMEOUT_SECONDS = 5;
47
- const STATUS_MESSAGE = 'Checking UI changes';
48
-
49
- const HOOK_MANIFEST_TARGETS = [
50
- {
51
- provider: '.claude',
52
- skillRel: '.claude/skills/monodesign',
53
- destRel: '.claude/settings.local.json',
54
- sharedDestRel: '.claude/settings.json',
55
- manifest: () => ({
56
- description: 'Monodesign design detector: runs after Edit/Write/MultiEdit on UI files and surfaces findings as system reminders.',
57
- hooks: {
58
- PostToolUse: [
59
- {
60
- matcher: 'Edit|Write|MultiEdit',
61
- hooks: [
62
- {
63
- type: 'command',
64
- command: 'node "${CLAUDE_PROJECT_DIR}/.claude/skills/monodesign/scripts/hook.mjs"',
65
- timeout: TIMEOUT_SECONDS,
66
- statusMessage: STATUS_MESSAGE,
67
- },
68
- ],
69
- },
70
- ],
71
- },
72
- }),
73
- },
74
- {
75
- provider: '.agents',
76
- skillRel: '.agents/skills/monodesign',
77
- destRel: '.codex/config.toml',
78
- format: 'toml',
79
- manifest: () => [
80
- '# monodesign:start native-hook',
81
- '[[hooks.PostToolUse]]',
82
- 'matcher = "Edit|Write|apply_patch"',
83
- '[[hooks.PostToolUse.hooks]]',
84
- 'type = "command"',
85
- 'command = "node .agents/skills/monodesign/scripts/hook.mjs"',
86
- `timeout = ${TIMEOUT_SECONDS}`,
87
- `statusMessage = "${STATUS_MESSAGE}"`,
88
- '# monodesign:end native-hook',
89
- '',
90
- ].join('\n'),
91
- },
92
- {
93
- provider: '.cursor',
94
- skillRel: '.cursor/skills/monodesign',
95
- destRel: '.cursor/hooks.json',
96
- manifest: () => ({
97
- version: 1,
98
- hooks: {
99
- preToolUse: [
100
- {
101
- command: 'node ".cursor/skills/monodesign/scripts/hook-before-edit.mjs"',
102
- timeout: TIMEOUT_SECONDS,
103
- },
104
- ],
105
- },
106
- }),
107
- },
108
- {
109
- // GitHub Copilot reads repo-level hooks from `.github/hooks/*.json`. The same
110
- // manifest is honored by the CLI (once committed to the default branch) and
111
- // the cloud/app agent. Schema differs: lowercase `postToolUse`, flat entries,
112
- // `bash`/`timeoutSec`, and a `matcher` regex against the `edit`/`create` tools.
113
- provider: '.github',
114
- skillRel: '.github/skills/monodesign',
115
- destRel: '.github/hooks/monodesign.json',
116
- manifest: () => ({
117
- version: 1,
118
- hooks: {
119
- postToolUse: [
120
- {
121
- type: 'command',
122
- matcher: 'edit|create|apply_patch',
123
- bash: 'node "$(git rev-parse --show-toplevel)/.github/skills/monodesign/scripts/hook.mjs"',
124
- timeoutSec: TIMEOUT_SECONDS,
125
- },
126
- ],
127
- },
128
- }),
129
- },
130
- ];
131
-
132
- function readRawConfigFile(filePath) {
133
- if (!fs.existsSync(filePath)) return { exists: false, malformed: false, raw: null };
134
- try {
135
- return { exists: true, malformed: false, raw: JSON.parse(fs.readFileSync(filePath, 'utf-8')) };
136
- } catch {
137
- return { exists: true, malformed: true, raw: null };
138
- }
139
- }
140
-
141
- const DETECTOR_CONFIG_KEYS = new Set(['ignoreRules', 'ignoreFiles', 'ignoreValues', 'designSystem']);
142
-
143
- function hookSection(unified) {
144
- return unified && typeof unified === 'object' && !Array.isArray(unified) && unified.hook && typeof unified.hook === 'object' && !Array.isArray(unified.hook)
145
- ? unified.hook
146
- : null;
147
- }
148
-
149
- function detectorSection(unified) {
150
- return unified && typeof unified === 'object' && !Array.isArray(unified) && unified.detector && typeof unified.detector === 'object' && !Array.isArray(unified.detector)
151
- ? unified.detector
152
- : null;
153
- }
154
-
155
- function readRawHookConfig(cwd, opts = {}) {
156
- const unified = readRawConfigFile(opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd)).raw;
157
- return hookSection(unified);
158
- }
159
-
160
- function readRawDetectorConfig(cwd, opts = {}) {
161
- const unified = readRawConfigFile(opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd)).raw;
162
- const merged = mergeDetectorConfig(hookSection(unified));
163
- return mergeDetectorConfig(detectorSection(unified), merged);
164
- }
165
-
166
- function stripDetectorKeys(raw) {
167
- if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return {};
168
- const out = {};
169
- for (const [key, value] of Object.entries(raw)) {
170
- if (!DETECTOR_CONFIG_KEYS.has(key)) out[key] = value;
171
- }
172
- return out;
173
- }
174
-
175
- // Write hook runtime config under `hook`, leaving detector filters in
176
- // `detector` and preserving sibling keys such as updateCheck.
177
- function writeHookConfig(cwd, hookConfig, opts = {}) {
178
- const filePath = opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd);
179
- if (opts.local) ensureHookGitExcludes(cwd);
180
- const existingRaw = readRawConfigFile(filePath).raw;
181
- const existing = existingRaw && typeof existingRaw === 'object' && !Array.isArray(existingRaw) ? existingRaw : {};
182
- const existingHook = stripDetectorKeys(hookSection(existing));
183
- // Merge over the existing hook object so fields the merge helpers don't manage
184
- // (consent, quiet, auditLog) survive an Monodesign hooks edit.
185
- const next = { ...existing, hook: { ...existingHook, ...hookConfig } };
186
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
187
- fs.writeFileSync(filePath, `${JSON.stringify(next, null, 2)}\n`);
188
- return filePath;
189
- }
190
-
191
- function writeDetectorConfig(cwd, detectorConfig, opts = {}) {
192
- const filePath = opts.local ? getLocalConfigPath(cwd) : getConfigPath(cwd);
193
- if (opts.local) ensureHookGitExcludes(cwd);
194
- const existingRaw = readRawConfigFile(filePath).raw;
195
- const existing = existingRaw && typeof existingRaw === 'object' && !Array.isArray(existingRaw) ? existingRaw : {};
196
- const nextHook = stripDetectorKeys(hookSection(existing));
197
- const existingDetector = mergeDetectorConfig(detectorSection(existing));
198
- const next = {
199
- ...existing,
200
- detector: mergeDetectorConfig(detectorConfig, existingDetector),
201
- };
202
- if (Object.keys(nextHook).length > 0) next.hook = nextHook;
203
- else delete next.hook;
204
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
205
- fs.writeFileSync(filePath, `${JSON.stringify(next, null, 2)}\n`);
206
- return filePath;
207
- }
208
-
209
- function mergeHookConfig(existing) {
210
- const base = existing && typeof existing === 'object' ? existing : {};
211
- return {
212
- enabled: base.enabled !== false,
213
- limits: {
214
- maxFindings: Number.isFinite(base?.limits?.maxFindings) ? base.limits.maxFindings : DEFAULT_CONFIG.limits.maxFindings,
215
- maxChars: Number.isFinite(base?.limits?.maxChars) ? base.limits.maxChars : DEFAULT_CONFIG.limits.maxChars,
216
- },
217
- };
218
- }
219
-
220
- function mergeDetectorConfig(existing, seed = null) {
221
- const base = existing && typeof existing === 'object' ? existing : {};
222
- const out = seed ? {
223
- ignoreRules: [...seed.ignoreRules],
224
- ignoreFiles: [...seed.ignoreFiles],
225
- ignoreValues: normalizeIgnoreValueEntries(seed.ignoreValues),
226
- } : {
227
- ignoreRules: [],
228
- ignoreFiles: [],
229
- ignoreValues: [],
230
- };
231
- if (seed?.designSystem && typeof seed.designSystem === 'object' && !Array.isArray(seed.designSystem)) {
232
- out.designSystem = { ...seed.designSystem };
233
- }
234
- if (base.designSystem && typeof base.designSystem === 'object' && !Array.isArray(base.designSystem)) {
235
- out.designSystem = {
236
- ...(out.designSystem || {}),
237
- enabled: base.designSystem.enabled !== false,
238
- };
239
- }
240
- if (Array.isArray(base.ignoreRules)) {
241
- out.ignoreRules = Array.from(new Set([...out.ignoreRules, ...base.ignoreRules.map(String)]));
242
- }
243
- if (Array.isArray(base.ignoreFiles)) {
244
- out.ignoreFiles = Array.from(new Set([...out.ignoreFiles, ...base.ignoreFiles.map(String)]));
245
- }
246
- if (Array.isArray(base.ignoreValues)) {
247
- out.ignoreValues = mergeIgnoreValueEntries(out.ignoreValues, base.ignoreValues);
248
- }
249
- return out;
250
- }
251
-
252
- function mergeIgnoreValueEntries(existing, incoming) {
253
- const map = new Map();
254
- for (const entry of normalizeIgnoreValueEntries(existing)) {
255
- map.set(ignoreValueEntryKey(entry), entry);
256
- }
257
- for (const entry of normalizeIgnoreValueEntries(incoming)) {
258
- map.set(ignoreValueEntryKey(entry), entry);
259
- }
260
- return Array.from(map.values());
261
- }
262
-
263
- function ignoreValueEntryKey(entry) {
264
- const files = Array.isArray(entry.files) && entry.files.length > 0 ? entry.files.join('\x1f') : '';
265
- return `${entry.rule}\0${entry.value}\0${files}`;
266
- }
267
-
268
- function statusReport(cwd) {
269
- const shared = readRawConfigFile(getConfigPath(cwd));
270
- const local = readRawConfigFile(getLocalConfigPath(cwd));
271
- const cfg = readConfig(cwd);
272
- const envKill = process.env.MONODESIGN_HOOK_DISABLED;
273
- const envState = envKill ? `MONODESIGN_HOOK_DISABLED=${envKill}` : 'unset';
274
- const cfgPath = path.relative(cwd, getConfigPath(cwd)).split(path.sep).join('/') || '.monodesign/config.json';
275
- const localPath = path.relative(cwd, getLocalConfigPath(cwd)).split(path.sep).join('/') || '.monodesign/config.local.json';
276
- const cachePath = path.relative(cwd, getCachePath(cwd)).split(path.sep).join('/') || '.monodesign/hook.cache.json';
277
- const fileState = (info, relPath, absent) => {
278
- if (info.malformed) return `${relPath} (malformed; ignored)`;
279
- if (info.exists) return relPath;
280
- return `${relPath} (${absent})`;
281
- };
282
- const ignoreValues = cfg.ignoreValues.map((entry) => `${entry.rule}=${entry.value}`);
283
-
284
- const lines = [
285
- `Monodesign design hook`,
286
- ` state: ${cfg.enabled ? 'enabled' : 'disabled'}`,
287
- ` shared file: ${fileState(shared, cfgPath, 'using defaults; file not present')}`,
288
- ` local file: ${fileState(local, localPath, 'not present')}`,
289
- ` ignoreRules: ${cfg.ignoreRules.length ? cfg.ignoreRules.join(', ') : '(none)'}`,
290
- ` ignoreFiles: ${cfg.ignoreFiles.length ? cfg.ignoreFiles.join(', ') : '(none)'}`,
291
- ` ignoreValues: ${ignoreValues.length ? ignoreValues.join(', ') : '(none)'}`,
292
- ` maxFindings: ${cfg.limits.maxFindings}`,
293
- ` maxChars: ${cfg.limits.maxChars}`,
294
- ` env override: ${envState}`,
295
- ` cache file: ${fs.existsSync(getCachePath(cwd)) ? cachePath : `${cachePath} (not present)`}`,
296
- ];
297
- return lines.join('\n');
298
- }
299
-
300
- function setEnabled(cwd, value) {
301
- const config = mergeHookConfig(readRawHookConfig(cwd));
302
- config.enabled = value;
303
- const target = writeHookConfig(cwd, config);
304
- if (!value) {
305
- return `Design hook disabled for this project (wrote ${path.relative(cwd, target).split(path.sep).join('/') || target}).`;
306
- }
307
-
308
- const localTarget = writeHookConfig(cwd, { consent: 'accepted' }, { local: true });
309
- const repaired = repairHookManifests(cwd);
310
- const parts = [
311
- `Design hook enabled for this project (wrote ${path.relative(cwd, target).split(path.sep).join('/') || target}).`,
312
- `Recorded local hook consent in ${path.relative(cwd, localTarget).split(path.sep).join('/') || localTarget}.`,
313
- ];
314
- if (repaired.written.length > 0) {
315
- parts.push(`Installed or repaired hook manifests for: ${repaired.written.join(', ')}.`);
316
- } else if (repaired.already.length > 0) {
317
- parts.push(`Hook manifests already installed for: ${repaired.already.join(', ')}.`);
318
- } else {
319
- parts.push('No installed provider skill folders found to repair.');
320
- }
321
- if (repaired.backups.length > 0) {
322
- parts.push(`Backed up malformed manifest(s): ${repaired.backups.map((filePath) => path.relative(cwd, filePath).split(path.sep).join('/') || filePath).join(', ')}.`);
323
- }
324
- return parts.join(' ');
325
- }
326
-
327
- function repairHookManifests(cwd) {
328
- const result = { written: [], already: [], backups: [] };
329
- for (const target of HOOK_MANIFEST_TARGETS) {
330
- if (!fs.existsSync(path.join(cwd, target.skillRel))) continue;
331
- const dest = path.join(cwd, target.destRel);
332
- const sharedDest = target.sharedDestRel ? path.join(cwd, target.sharedDestRel) : null;
333
-
334
- if (target.format === 'toml') {
335
- const current = fs.existsSync(dest) ? safeReadText(dest) : '';
336
- const next = mergeCodexHookConfig(current || '', target.manifest());
337
- if (current === next) {
338
- result.already.push(target.provider);
339
- continue;
340
- }
341
- fs.mkdirSync(path.dirname(dest), { recursive: true });
342
- fs.writeFileSync(dest, next);
343
- result.written.push(target.provider);
344
- continue;
345
- }
346
-
347
- if (sharedDest && fileHasMonodesignHookMarker(sharedDest)) {
348
- pruneMonodesignHookFromManifest(dest);
349
- result.already.push(target.provider);
350
- continue;
351
- }
352
-
353
- const fresh = target.manifest();
354
- let next = fresh;
355
- if (fs.existsSync(dest)) {
356
- try {
357
- next = mergeHookManifests(JSON.parse(fs.readFileSync(dest, 'utf-8')), fresh);
358
- } catch {
359
- const backup = `${dest}.bak`;
360
- fs.copyFileSync(dest, backup);
361
- result.backups.push(backup);
362
- }
363
- }
364
-
365
- const serialized = `${JSON.stringify(next, null, 2)}\n`;
366
- const current = fs.existsSync(dest) ? safeReadText(dest) : null;
367
- if (current === serialized) {
368
- result.already.push(target.provider);
369
- continue;
370
- }
371
- fs.mkdirSync(path.dirname(dest), { recursive: true });
372
- fs.writeFileSync(dest, serialized);
373
- result.written.push(target.provider);
374
- }
375
- return result;
376
- }
377
-
378
- function mergeCodexHookConfig(existing, hookBlock) {
379
- const completeBlock = /# monodesign:start native-hook[\s\S]*?# monodesign:end native-hook\n?/m;
380
- const incompleteBlock = /# monodesign:start native-hook[\s\S]*$/m;
381
- let merged = existing;
382
- if (completeBlock.test(merged)) merged = merged.replace(completeBlock, hookBlock);
383
- else if (incompleteBlock.test(merged)) merged = merged.replace(incompleteBlock, hookBlock);
384
- else merged = `${merged.trimEnd()}${merged.trim() ? '\n\n' : ''}${hookBlock}`;
385
- return enableCodexHooks(merged);
386
- }
387
-
388
- function enableCodexHooks(config) {
389
- if (!/^\[features\]\s*$/m.test(config)) {
390
- return `[features]\nhooks = true\n\n${config}`;
391
- }
392
- const lines = config.split(/\r?\n/);
393
- const start = lines.findIndex((line) => /^\[features\]\s*$/.test(line));
394
- let end = start + 1;
395
- while (end < lines.length && !/^\[\[?[^\]]+\]\]?\s*$/.test(lines[end])) end++;
396
- const hookIndex = lines.slice(start + 1, end).findIndex((line) => /^hooks\s*=/.test(line));
397
- if (hookIndex === -1) lines.splice(end, 0, 'hooks = true');
398
- else lines[start + 1 + hookIndex] = 'hooks = true';
399
- return lines.join('\n');
400
- }
401
-
402
- function safeReadText(filePath) {
403
- try {
404
- return fs.readFileSync(filePath, 'utf-8');
405
- } catch {
406
- return null;
407
- }
408
- }
409
-
410
- function mergeHookManifests(existing, fresh) {
411
- const existingObject = existing && typeof existing === 'object' && !Array.isArray(existing) ? existing : {};
412
- const freshObject = fresh && typeof fresh === 'object' && !Array.isArray(fresh) ? fresh : {};
413
- const existingHooks = existingObject.hooks && typeof existingObject.hooks === 'object' && !Array.isArray(existingObject.hooks)
414
- ? existingObject.hooks
415
- : {};
416
- const freshHooks = freshObject.hooks && typeof freshObject.hooks === 'object' && !Array.isArray(freshObject.hooks)
417
- ? freshObject.hooks
418
- : {};
419
-
420
- const merged = { ...existingObject, hooks: {} };
421
- if (freshObject.version !== undefined) merged.version = freshObject.version;
422
- if (freshObject.description !== undefined) merged.description = freshObject.description;
423
-
424
- const hookEvents = new Set([...Object.keys(existingHooks), ...Object.keys(freshHooks)]);
425
- for (const event of hookEvents) {
426
- const preserved = stripMonodesignHookEntries(existingHooks[event]);
427
- const added = Array.isArray(freshHooks[event]) ? freshHooks[event] : [];
428
- const mergedEntries = [...preserved, ...added];
429
- if (mergedEntries.length > 0) merged.hooks[event] = mergedEntries;
430
- }
431
- return merged;
432
- }
433
-
434
- function fileHasMonodesignHookMarker(filePath) {
435
- if (!fs.existsSync(filePath)) return false;
436
- let parsed;
437
- try {
438
- parsed = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
439
- } catch {
440
- return false;
441
- }
442
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return false;
443
- if (!parsed.hooks || typeof parsed.hooks !== 'object') return false;
444
- return valueHasMonodesignHookMarker(parsed.hooks);
445
- }
446
-
447
- function valueHasMonodesignHookMarker(value) {
448
- if (typeof value === 'string') {
449
- return MONODESIGN_HOOK_COMMAND_MARKERS.some((marker) => value.includes(marker));
450
- }
451
- if (Array.isArray(value)) return value.some(valueHasMonodesignHookMarker);
452
- if (value && typeof value === 'object') return Object.values(value).some(valueHasMonodesignHookMarker);
453
- return false;
454
- }
455
-
456
- function stripMonodesignHookEntry(entry) {
457
- if (!entry || typeof entry !== 'object') return entry;
458
- // `command`/`args`: Claude/Codex/Cursor. `bash`/`powershell`: GitHub Copilot's
459
- // flat entry shape, where the marker lives under the shell-command keys.
460
- if (valueHasMonodesignHookMarker(entry.command) || valueHasMonodesignHookMarker(entry.args)
461
- || valueHasMonodesignHookMarker(entry.bash) || valueHasMonodesignHookMarker(entry.powershell)) {
462
- return null;
463
- }
464
- if (!Array.isArray(entry.hooks)) return entry;
465
-
466
- const strippedHooks = entry.hooks
467
- .map(stripMonodesignHookEntry)
468
- .filter(Boolean);
469
-
470
- if (strippedHooks.length === 0 && entry.hooks.some(valueHasMonodesignHookMarker)) {
471
- return null;
472
- }
473
- return { ...entry, hooks: strippedHooks };
474
- }
475
-
476
- function stripMonodesignHookEntries(entries) {
477
- if (!Array.isArray(entries)) return [];
478
- return entries
479
- .map(stripMonodesignHookEntry)
480
- .filter(Boolean);
481
- }
482
-
483
- function pruneMonodesignHookFromManifest(manifestPath) {
484
- if (!fileHasMonodesignHookMarker(manifestPath)) return false;
485
- let parsed;
486
- try {
487
- parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
488
- } catch {
489
- return false;
490
- }
491
-
492
- const existingHooks = parsed.hooks && typeof parsed.hooks === 'object' && !Array.isArray(parsed.hooks)
493
- ? parsed.hooks
494
- : {};
495
- const cleanedHooks = {};
496
- for (const [event, entries] of Object.entries(existingHooks)) {
497
- const kept = stripMonodesignHookEntries(entries);
498
- if (kept.length > 0) cleanedHooks[event] = kept;
499
- }
500
-
501
- const next = { ...parsed };
502
- if (Object.keys(cleanedHooks).length > 0) {
503
- next.hooks = cleanedHooks;
504
- } else {
505
- delete next.hooks;
506
- delete next.description;
507
- delete next.version;
508
- }
509
-
510
- if (Object.keys(next).length === 0) {
511
- fs.rmSync(manifestPath, { force: true });
512
- } else {
513
- fs.writeFileSync(manifestPath, `${JSON.stringify(next, null, 2)}\n`);
514
- }
515
- return true;
516
- }
517
-
518
- function normalizeRuleId(rule) {
519
- return String(rule || '').trim().toLowerCase();
520
- }
521
-
522
- function parseIgnoreRuleArgs(args) {
523
- const positionals = [];
524
- let allValues = false;
525
-
526
- for (let i = 0; i < args.length; i++) {
527
- const arg = String(args[i] || '');
528
- if (arg === '--all-values') {
529
- allValues = true;
530
- } else if (arg === '--reason') {
531
- while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) i++;
532
- } else if (arg.startsWith('--reason=')) {
533
- // Accepted for command symmetry; ignoreRules stores rule ids only.
534
- } else if (arg.startsWith('--')) {
535
- throw new Error(`Unknown ignore-rule flag: ${arg}`);
536
- } else {
537
- positionals.push(arg);
538
- }
539
- }
540
-
541
- return {
542
- rule: normalizeRuleId(positionals[0]),
543
- allValues,
544
- };
545
- }
546
-
547
- function addIgnoreRule(cwd, args) {
548
- const parsed = parseIgnoreRuleArgs(args);
549
- const rule = parsed.rule;
550
- if (!rule) throw new Error(`Pass a rule id, e.g. ${MONODESIGN_COMMAND} hooks ignore-rule side-tab`);
551
- if (rule === 'overused-font' && !parsed.allValues) {
552
- throw new Error(`overused-font is value-specific by default. Use ${MONODESIGN_COMMAND} hooks ignore-value overused-font <font> for a confirmed font, or ${MONODESIGN_COMMAND} hooks ignore-rule overused-font --all-values only when the user asked to ignore overused fonts generally.`);
553
- }
554
- const config = mergeDetectorConfig(readRawDetectorConfig(cwd));
555
- if (!config.ignoreRules.includes(rule)) config.ignoreRules.push(rule);
556
- writeDetectorConfig(cwd, config);
557
- return `Added "${rule}" to detector.ignoreRules. Current: ${config.ignoreRules.join(', ')}`;
558
- }
559
-
560
- function addIgnoreFile(cwd, glob) {
561
- if (!glob) throw new Error(`Pass a glob, e.g. ${MONODESIGN_COMMAND} hooks ignore-file "src/legacy/**"`);
562
- const config = mergeDetectorConfig(readRawDetectorConfig(cwd));
563
- if (!config.ignoreFiles.includes(glob)) config.ignoreFiles.push(glob);
564
- writeDetectorConfig(cwd, config);
565
- return `Added "${glob}" to detector.ignoreFiles. Current: ${config.ignoreFiles.join(', ')}`;
566
- }
567
-
568
- function parseIgnoreValueArgs(args) {
569
- const positionals = [];
570
- let shared = false;
571
- let local = false;
572
- let reason = '';
573
-
574
- for (let i = 0; i < args.length; i++) {
575
- const arg = args[i];
576
- if (arg === '--shared') {
577
- shared = true;
578
- } else if (arg === '--local') {
579
- local = true;
580
- } else if (arg === '--reason') {
581
- const chunks = [];
582
- while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) {
583
- chunks.push(args[++i]);
584
- }
585
- reason = chunks.join(' ').trim();
586
- } else if (String(arg).startsWith('--reason=')) {
587
- reason = String(arg).slice('--reason='.length).trim();
588
- } else {
589
- positionals.push(arg);
590
- }
591
- }
592
-
593
- const [rule, ...valueParts] = positionals;
594
- return {
595
- rule: String(rule || '').trim().toLowerCase(),
596
- value: normalizeIgnoreValue(valueParts.join(' ')),
597
- shared,
598
- local,
599
- reason,
600
- };
601
- }
602
-
603
- function addIgnoreValue(cwd, args) {
604
- const parsed = parseIgnoreValueArgs(args);
605
- if (!parsed.rule || !parsed.value) {
606
- throw new Error(`Pass a rule id and value, e.g. ${MONODESIGN_COMMAND} hooks ignore-value overused-font Inter`);
607
- }
608
-
609
- if (parsed.shared && parsed.local) {
610
- throw new Error('Pass only one scope flag: --shared or --local');
611
- }
612
-
613
- const local = parsed.local;
614
- const config = mergeDetectorConfig(readRawDetectorConfig(cwd, { local }));
615
- const key = `${parsed.rule}\0${parsed.value}`;
616
- const existing = config.ignoreValues.find((entry) => `${entry.rule}\0${entry.value}` === key);
617
-
618
- if (existing) {
619
- if (parsed.reason) existing.reason = parsed.reason;
620
- } else {
621
- const entry = {
622
- rule: parsed.rule,
623
- value: parsed.value,
624
- createdAt: new Date().toISOString(),
625
- };
626
- if (parsed.reason) entry.reason = parsed.reason;
627
- config.ignoreValues.push(entry);
628
- }
629
-
630
- const target = writeDetectorConfig(cwd, config, { local });
631
- const scope = local ? 'local detector.ignoreValues' : 'shared detector.ignoreValues';
632
- return `Added ${parsed.rule}=${parsed.value} to ${scope} (${path.relative(cwd, target).split(path.sep).join('/') || target}).`;
633
- }
634
-
635
- function reset(cwd) {
636
- const removed = [];
637
- // Unified files may hold non-hook keys (e.g. updateCheck); strip only the
638
- // hook/detector subtrees and keep the rest, deleting the file only if nothing remains.
639
- for (const filePath of [getConfigPath(cwd), getLocalConfigPath(cwd)]) {
640
- try {
641
- const raw = readRawConfigFile(filePath).raw;
642
- if (!raw || typeof raw !== 'object' || Array.isArray(raw) || (!('hook' in raw) && !('detector' in raw))) continue;
643
- const { hook, detector, ...rest } = raw;
644
- if (Object.keys(rest).length === 0) {
645
- fs.unlinkSync(filePath);
646
- } else {
647
- fs.writeFileSync(filePath, `${JSON.stringify(rest, null, 2)}\n`);
648
- }
649
- removed.push(path.relative(cwd, filePath).split(path.sep).join('/') || filePath);
650
- } catch { /* ignore */ }
651
- }
652
- // State files are wholly ours; delete outright.
653
- for (const filePath of [getCachePath(cwd), getPendingPath(cwd)]) {
654
- try {
655
- if (fs.existsSync(filePath)) {
656
- fs.unlinkSync(filePath);
657
- removed.push(path.relative(cwd, filePath).split(path.sep).join('/') || filePath);
658
- }
659
- } catch { /* ignore */ }
660
- }
661
- return removed.length
662
- ? `Reset design hook config and cache (removed: ${removed.join(', ')}).`
663
- : 'No hook config or cache to remove. Already at defaults.';
664
- }
665
-
666
- function main() {
667
- const [, , actionArg, ...rest] = process.argv;
668
- const action = (actionArg || 'status').toLowerCase();
669
- const cwd = process.cwd();
670
-
671
- if (!ACTIONS.has(action)) {
672
- process.stderr.write(`Unknown action: ${action}\nValid: ${Array.from(ACTIONS).join(', ')}\n`);
673
- process.exit(1);
674
- }
675
-
676
- try {
677
- let out = '';
678
- switch (action) {
679
- case 'status': out = statusReport(cwd); break;
680
- case 'on': out = setEnabled(cwd, true); break;
681
- case 'off': out = setEnabled(cwd, false); break;
682
- case 'ignore-rule': out = addIgnoreRule(cwd, rest); break;
683
- case 'ignore-file': out = addIgnoreFile(cwd, rest[0]); break;
684
- case 'ignore-value': out = addIgnoreValue(cwd, rest); break;
685
- case 'reset': out = reset(cwd); break;
686
- }
687
- process.stdout.write(`${out}\n`);
688
- } catch (err) {
689
- process.stderr.write(`Error: ${err.message || err}\n`);
690
- process.exit(1);
691
- }
692
- }
693
-
694
- main();