@theglitchking/hit-em-with-the-docs 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +180 -0
- package/commands/archive.md +43 -0
- package/commands/domain.md +48 -0
- package/commands/help.md +10 -1
- package/dist/action/core/archive/candidates.d.ts +38 -0
- package/dist/action/core/archive/candidates.d.ts.map +1 -0
- package/dist/action/core/archive/links.d.ts +22 -0
- package/dist/action/core/archive/links.d.ts.map +1 -0
- package/dist/action/core/archive/manage.d.ts +50 -0
- package/dist/action/core/archive/manage.d.ts.map +1 -0
- package/dist/action/core/audit/auditor.d.ts.map +1 -1
- package/dist/action/core/audit/rules.d.ts.map +1 -1
- package/dist/action/core/domains/constants.d.ts +28 -23
- package/dist/action/core/domains/constants.d.ts.map +1 -1
- package/dist/action/core/domains/detector.d.ts +1 -1
- package/dist/action/core/domains/detector.d.ts.map +1 -1
- package/dist/action/core/domains/manage.d.ts +76 -0
- package/dist/action/core/domains/manage.d.ts.map +1 -0
- package/dist/action/core/domains/registry.d.ts +54 -0
- package/dist/action/core/domains/registry.d.ts.map +1 -0
- package/dist/action/core/links/tracker.d.ts.map +1 -1
- package/dist/action/core/metadata/schema.d.ts +73 -0
- package/dist/action/core/metadata/schema.d.ts.map +1 -1
- package/dist/action/generators/index-generator.d.ts.map +1 -1
- package/dist/action/generators/regenerate.d.ts.map +1 -1
- package/dist/action/generators/registry-generator.d.ts.map +1 -1
- package/dist/action/generators/scaffold.d.ts.map +1 -1
- package/dist/action/index.d.ts +4 -0
- package/dist/action/index.d.ts.map +1 -1
- package/dist/action/index.js +4 -4
- package/dist/action/utils/config.d.ts +211 -0
- package/dist/action/utils/config.d.ts.map +1 -1
- package/dist/action/utils/glob.d.ts +13 -1
- package/dist/action/utils/glob.d.ts.map +1 -1
- package/dist/cli/index.js +235 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/core/archive/candidates.d.ts +38 -0
- package/dist/core/archive/candidates.d.ts.map +1 -0
- package/dist/core/archive/candidates.js +113 -0
- package/dist/core/archive/candidates.js.map +1 -0
- package/dist/core/archive/links.d.ts +22 -0
- package/dist/core/archive/links.d.ts.map +1 -0
- package/dist/core/archive/links.js +33 -0
- package/dist/core/archive/links.js.map +1 -0
- package/dist/core/archive/manage.d.ts +50 -0
- package/dist/core/archive/manage.d.ts.map +1 -0
- package/dist/core/archive/manage.js +163 -0
- package/dist/core/archive/manage.js.map +1 -0
- package/dist/core/audit/auditor.d.ts.map +1 -1
- package/dist/core/audit/auditor.js +16 -2
- package/dist/core/audit/auditor.js.map +1 -1
- package/dist/core/audit/rules.d.ts.map +1 -1
- package/dist/core/audit/rules.js +3 -2
- package/dist/core/audit/rules.js.map +1 -1
- package/dist/core/domains/constants.d.ts +28 -23
- package/dist/core/domains/constants.d.ts.map +1 -1
- package/dist/core/domains/constants.js +11 -41
- package/dist/core/domains/constants.js.map +1 -1
- package/dist/core/domains/detector.d.ts +1 -1
- package/dist/core/domains/detector.d.ts.map +1 -1
- package/dist/core/domains/detector.js +5 -5
- package/dist/core/domains/detector.js.map +1 -1
- package/dist/core/domains/manage.d.ts +76 -0
- package/dist/core/domains/manage.d.ts.map +1 -0
- package/dist/core/domains/manage.js +171 -0
- package/dist/core/domains/manage.js.map +1 -0
- package/dist/core/domains/registry.d.ts +54 -0
- package/dist/core/domains/registry.d.ts.map +1 -0
- package/dist/core/domains/registry.js +116 -0
- package/dist/core/domains/registry.js.map +1 -0
- package/dist/core/links/tracker.d.ts.map +1 -1
- package/dist/core/links/tracker.js +8 -5
- package/dist/core/links/tracker.js.map +1 -1
- package/dist/core/maintain/orchestrator.js +2 -2
- package/dist/core/maintain/orchestrator.js.map +1 -1
- package/dist/core/metadata/schema.d.ts +121 -48
- package/dist/core/metadata/schema.d.ts.map +1 -1
- package/dist/core/metadata/schema.js +14 -1
- package/dist/core/metadata/schema.js.map +1 -1
- package/dist/generators/index-generator.d.ts.map +1 -1
- package/dist/generators/index-generator.js +10 -10
- package/dist/generators/index-generator.js.map +1 -1
- package/dist/generators/regenerate.d.ts.map +1 -1
- package/dist/generators/regenerate.js +5 -4
- package/dist/generators/regenerate.js.map +1 -1
- package/dist/generators/registry-generator.d.ts.map +1 -1
- package/dist/generators/registry-generator.js +6 -6
- package/dist/generators/registry-generator.js.map +1 -1
- package/dist/generators/scaffold.d.ts.map +1 -1
- package/dist/generators/scaffold.js +66 -9
- package/dist/generators/scaffold.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +211 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +102 -5
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/glob.d.ts +13 -1
- package/dist/utils/glob.d.ts.map +1 -1
- package/dist/utils/glob.js +23 -2
- package/dist/utils/glob.js.map +1 -1
- package/package.json +1 -1
- package/templates/claude/CLAUDE.md +5 -1
|
@@ -10,6 +10,43 @@ import { z } from 'zod';
|
|
|
10
10
|
export declare const DEFAULT_VAULT_ROOT = ".documentation/knowledge-base/";
|
|
11
11
|
export declare const DEFAULT_PLAYBOOK_GLOBS: string[];
|
|
12
12
|
export declare const DEFAULT_AUDIT_WINDOW_DAYS = 90;
|
|
13
|
+
/**
|
|
14
|
+
* Valid `category` values for a domain. Kept in sync with `DomainDefinition`
|
|
15
|
+
* in `core/domains/constants.ts` — duplicated here intentionally so the config
|
|
16
|
+
* loader carries no dependency on the domain layer (the registry imports the
|
|
17
|
+
* config, not the other way around).
|
|
18
|
+
*/
|
|
19
|
+
export declare const DOMAIN_CATEGORY_VALUES: readonly ["core", "development", "features", "advanced"];
|
|
20
|
+
/**
|
|
21
|
+
* Schema for a single custom domain entry. Mirrors `DomainDefinition`. Used
|
|
22
|
+
* by the registry merge layer and by `hewtd domain add` (which validates
|
|
23
|
+
* strictly before writing). Collision with a built-in id is NOT checked here —
|
|
24
|
+
* that requires knowing the built-in set, so it is enforced in the registry
|
|
25
|
+
* merge (drop-with-warning) and in the CLI writer (hard error).
|
|
26
|
+
*/
|
|
27
|
+
export declare const customDomainSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
description: z.ZodString;
|
|
31
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
32
|
+
loadPriority: z.ZodNumber;
|
|
33
|
+
category: z.ZodEnum<["core", "development", "features", "advanced"]>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
keywords: string[];
|
|
39
|
+
loadPriority: number;
|
|
40
|
+
category: "features" | "core" | "development" | "advanced";
|
|
41
|
+
}, {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
description: string;
|
|
45
|
+
keywords: string[];
|
|
46
|
+
loadPriority: number;
|
|
47
|
+
category: "features" | "core" | "development" | "advanced";
|
|
48
|
+
}>;
|
|
49
|
+
export type CustomDomainConfig = z.infer<typeof customDomainSchema>;
|
|
13
50
|
/**
|
|
14
51
|
* Schema for `.claude/hit-em-with-the-docs.json`. Every field is optional
|
|
15
52
|
* with a sensible default. The runtime's `updatePolicy` is preserved via
|
|
@@ -28,6 +65,29 @@ declare const vaultConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
28
65
|
playbook_paths?: string[] | undefined;
|
|
29
66
|
audit_window_days?: number | undefined;
|
|
30
67
|
}>>;
|
|
68
|
+
export declare const DEFAULT_ARCHIVE_CANDIDATE_DAYS = 365;
|
|
69
|
+
/**
|
|
70
|
+
* Archival policy. Governs candidate DETECTION and archival aggressiveness.
|
|
71
|
+
* The safe default is propose-don't-impose: nothing is ever auto-archived
|
|
72
|
+
* (`auto: false`), age alone never qualifies a doc (`require_orphaned: true`),
|
|
73
|
+
* and the recency threshold is generous (docs churn slower than code).
|
|
74
|
+
*/
|
|
75
|
+
declare const archiveConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
76
|
+
honor_status_deprecated: z.ZodDefault<z.ZodBoolean>;
|
|
77
|
+
candidate_after_days: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
require_orphaned: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
auto: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
honor_status_deprecated: boolean;
|
|
82
|
+
candidate_after_days: number;
|
|
83
|
+
require_orphaned: boolean;
|
|
84
|
+
auto: boolean;
|
|
85
|
+
}, {
|
|
86
|
+
honor_status_deprecated?: boolean | undefined;
|
|
87
|
+
candidate_after_days?: number | undefined;
|
|
88
|
+
require_orphaned?: boolean | undefined;
|
|
89
|
+
auto?: boolean | undefined;
|
|
90
|
+
}>>;
|
|
31
91
|
declare const pluginConfigSchema: z.ZodObject<{
|
|
32
92
|
vault: z.ZodDefault<z.ZodObject<{
|
|
33
93
|
root: z.ZodDefault<z.ZodString>;
|
|
@@ -42,6 +102,51 @@ declare const pluginConfigSchema: z.ZodObject<{
|
|
|
42
102
|
playbook_paths?: string[] | undefined;
|
|
43
103
|
audit_window_days?: number | undefined;
|
|
44
104
|
}>>;
|
|
105
|
+
domains: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
description: z.ZodString;
|
|
109
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
110
|
+
loadPriority: z.ZodNumber;
|
|
111
|
+
category: z.ZodEnum<["core", "development", "features", "advanced"]>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
description: string;
|
|
116
|
+
keywords: string[];
|
|
117
|
+
loadPriority: number;
|
|
118
|
+
category: "features" | "core" | "development" | "advanced";
|
|
119
|
+
}, {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
description: string;
|
|
123
|
+
keywords: string[];
|
|
124
|
+
loadPriority: number;
|
|
125
|
+
category: "features" | "core" | "development" | "advanced";
|
|
126
|
+
}>, "many">, {
|
|
127
|
+
id: string;
|
|
128
|
+
name: string;
|
|
129
|
+
description: string;
|
|
130
|
+
keywords: string[];
|
|
131
|
+
loadPriority: number;
|
|
132
|
+
category: "features" | "core" | "development" | "advanced";
|
|
133
|
+
}[], unknown>>;
|
|
134
|
+
archive: z.ZodDefault<z.ZodObject<{
|
|
135
|
+
honor_status_deprecated: z.ZodDefault<z.ZodBoolean>;
|
|
136
|
+
candidate_after_days: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
require_orphaned: z.ZodDefault<z.ZodBoolean>;
|
|
138
|
+
auto: z.ZodDefault<z.ZodBoolean>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
honor_status_deprecated: boolean;
|
|
141
|
+
candidate_after_days: number;
|
|
142
|
+
require_orphaned: boolean;
|
|
143
|
+
auto: boolean;
|
|
144
|
+
}, {
|
|
145
|
+
honor_status_deprecated?: boolean | undefined;
|
|
146
|
+
candidate_after_days?: number | undefined;
|
|
147
|
+
require_orphaned?: boolean | undefined;
|
|
148
|
+
auto?: boolean | undefined;
|
|
149
|
+
}>>;
|
|
45
150
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
46
151
|
vault: z.ZodDefault<z.ZodObject<{
|
|
47
152
|
root: z.ZodDefault<z.ZodString>;
|
|
@@ -56,6 +161,51 @@ declare const pluginConfigSchema: z.ZodObject<{
|
|
|
56
161
|
playbook_paths?: string[] | undefined;
|
|
57
162
|
audit_window_days?: number | undefined;
|
|
58
163
|
}>>;
|
|
164
|
+
domains: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
name: z.ZodString;
|
|
167
|
+
description: z.ZodString;
|
|
168
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
169
|
+
loadPriority: z.ZodNumber;
|
|
170
|
+
category: z.ZodEnum<["core", "development", "features", "advanced"]>;
|
|
171
|
+
}, "strip", z.ZodTypeAny, {
|
|
172
|
+
id: string;
|
|
173
|
+
name: string;
|
|
174
|
+
description: string;
|
|
175
|
+
keywords: string[];
|
|
176
|
+
loadPriority: number;
|
|
177
|
+
category: "features" | "core" | "development" | "advanced";
|
|
178
|
+
}, {
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
keywords: string[];
|
|
183
|
+
loadPriority: number;
|
|
184
|
+
category: "features" | "core" | "development" | "advanced";
|
|
185
|
+
}>, "many">, {
|
|
186
|
+
id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
description: string;
|
|
189
|
+
keywords: string[];
|
|
190
|
+
loadPriority: number;
|
|
191
|
+
category: "features" | "core" | "development" | "advanced";
|
|
192
|
+
}[], unknown>>;
|
|
193
|
+
archive: z.ZodDefault<z.ZodObject<{
|
|
194
|
+
honor_status_deprecated: z.ZodDefault<z.ZodBoolean>;
|
|
195
|
+
candidate_after_days: z.ZodDefault<z.ZodNumber>;
|
|
196
|
+
require_orphaned: z.ZodDefault<z.ZodBoolean>;
|
|
197
|
+
auto: z.ZodDefault<z.ZodBoolean>;
|
|
198
|
+
}, "strip", z.ZodTypeAny, {
|
|
199
|
+
honor_status_deprecated: boolean;
|
|
200
|
+
candidate_after_days: number;
|
|
201
|
+
require_orphaned: boolean;
|
|
202
|
+
auto: boolean;
|
|
203
|
+
}, {
|
|
204
|
+
honor_status_deprecated?: boolean | undefined;
|
|
205
|
+
candidate_after_days?: number | undefined;
|
|
206
|
+
require_orphaned?: boolean | undefined;
|
|
207
|
+
auto?: boolean | undefined;
|
|
208
|
+
}>>;
|
|
59
209
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
60
210
|
vault: z.ZodDefault<z.ZodObject<{
|
|
61
211
|
root: z.ZodDefault<z.ZodString>;
|
|
@@ -70,8 +220,54 @@ declare const pluginConfigSchema: z.ZodObject<{
|
|
|
70
220
|
playbook_paths?: string[] | undefined;
|
|
71
221
|
audit_window_days?: number | undefined;
|
|
72
222
|
}>>;
|
|
223
|
+
domains: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
description: z.ZodString;
|
|
227
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
228
|
+
loadPriority: z.ZodNumber;
|
|
229
|
+
category: z.ZodEnum<["core", "development", "features", "advanced"]>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
description: string;
|
|
234
|
+
keywords: string[];
|
|
235
|
+
loadPriority: number;
|
|
236
|
+
category: "features" | "core" | "development" | "advanced";
|
|
237
|
+
}, {
|
|
238
|
+
id: string;
|
|
239
|
+
name: string;
|
|
240
|
+
description: string;
|
|
241
|
+
keywords: string[];
|
|
242
|
+
loadPriority: number;
|
|
243
|
+
category: "features" | "core" | "development" | "advanced";
|
|
244
|
+
}>, "many">, {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
description: string;
|
|
248
|
+
keywords: string[];
|
|
249
|
+
loadPriority: number;
|
|
250
|
+
category: "features" | "core" | "development" | "advanced";
|
|
251
|
+
}[], unknown>>;
|
|
252
|
+
archive: z.ZodDefault<z.ZodObject<{
|
|
253
|
+
honor_status_deprecated: z.ZodDefault<z.ZodBoolean>;
|
|
254
|
+
candidate_after_days: z.ZodDefault<z.ZodNumber>;
|
|
255
|
+
require_orphaned: z.ZodDefault<z.ZodBoolean>;
|
|
256
|
+
auto: z.ZodDefault<z.ZodBoolean>;
|
|
257
|
+
}, "strip", z.ZodTypeAny, {
|
|
258
|
+
honor_status_deprecated: boolean;
|
|
259
|
+
candidate_after_days: number;
|
|
260
|
+
require_orphaned: boolean;
|
|
261
|
+
auto: boolean;
|
|
262
|
+
}, {
|
|
263
|
+
honor_status_deprecated?: boolean | undefined;
|
|
264
|
+
candidate_after_days?: number | undefined;
|
|
265
|
+
require_orphaned?: boolean | undefined;
|
|
266
|
+
auto?: boolean | undefined;
|
|
267
|
+
}>>;
|
|
73
268
|
}, z.ZodTypeAny, "passthrough">>;
|
|
74
269
|
export type VaultConfig = z.infer<typeof vaultConfigSchema>;
|
|
270
|
+
export type ArchiveConfig = z.infer<typeof archiveConfigSchema>;
|
|
75
271
|
export type PluginConfig = z.infer<typeof pluginConfigSchema>;
|
|
76
272
|
/**
|
|
77
273
|
* Load the plugin config for a project, applying defaults. Never throws —
|
|
@@ -85,6 +281,21 @@ export declare function loadPluginConfig(projectRoot?: string): Promise<PluginCo
|
|
|
85
281
|
* Same fail-open behavior.
|
|
86
282
|
*/
|
|
87
283
|
export declare function loadPluginConfigSync(projectRoot?: string): PluginConfig;
|
|
284
|
+
/**
|
|
285
|
+
* Read the RAW config object (unparsed, no defaults applied) for a project.
|
|
286
|
+
* Returns `{}` when the file is missing or unreadable/malformed. Use this when
|
|
287
|
+
* you need to MUTATE the config and write it back without clobbering keys this
|
|
288
|
+
* module doesn't model (e.g. the runtime's `updatePolicy`). Never throws.
|
|
289
|
+
*/
|
|
290
|
+
export declare function readRawConfig(projectRoot?: string): Promise<Record<string, unknown>>;
|
|
291
|
+
/**
|
|
292
|
+
* Write the RAW config object back to `.claude/hit-em-with-the-docs.json`,
|
|
293
|
+
* creating the `.claude/` directory if needed. Pretty-printed with a trailing
|
|
294
|
+
* newline. Returns the absolute path written.
|
|
295
|
+
*/
|
|
296
|
+
export declare function writeRawConfig(projectRoot: string, data: Record<string, unknown>): Promise<string>;
|
|
297
|
+
/** Absolute path to a project's config file (whether or not it exists). */
|
|
298
|
+
export declare function configFilePath(projectRoot: string): string;
|
|
88
299
|
/**
|
|
89
300
|
* Resolve the vault root for a project, applying config + defaults.
|
|
90
301
|
* The returned path is absolute.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,mCAAmC,CAAC;AACnE,eAAO,MAAM,sBAAsB,UAA6B,CAAC;AACjE,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAK5C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,0DAKzB,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAO7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAgBpE;;;;GAIG;AACH,QAAA,MAAM,iBAAiB;;;;;;;;;;;;GAMT,CAAC;AAEf,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAElD;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;GAWX,CAAC;AAEf,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMR,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAkBlF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAiBvE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAYlC;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAElF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,YAAY,GACnB,MAAM,EAAE,CAEV"}
|
|
@@ -9,7 +9,19 @@ export interface GlobOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function glob(pattern: string, options?: GlobOptions): Promise<string[]>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Reserved documentation subdirectory for DEPRECATED docs. Anything under
|
|
13
|
+
* `<docs>/archive/` is intentionally excluded from every hewtd scan (audit,
|
|
14
|
+
* link-check, metadata-sync, integrate dup-detection, link graph, search) —
|
|
15
|
+
* it's a parking lot for retired docs, not part of the active corpus.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ARCHIVE_DIR = "archive";
|
|
18
|
+
/**
|
|
19
|
+
* Find all markdown files in a directory.
|
|
20
|
+
*
|
|
21
|
+
* Used exclusively as the documentation-corpus scanner, so it always skips
|
|
22
|
+
* the reserved `archive/` subtree (deprecated docs) in addition to the
|
|
23
|
+
* standard build/vcs ignores. Callers may pass extra `ignore` patterns; they
|
|
24
|
+
* are merged, never override the archive exclusion.
|
|
13
25
|
*/
|
|
14
26
|
export declare function findMarkdownFiles(dir: string, options?: Omit<GlobOptions, 'absolute'>): Promise<string[]>;
|
|
15
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/utils/glob.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AAED
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/utils/glob.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,YAAY,CAAC;AAUrC;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAM,GAC1C,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOhE;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO3D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAStE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/dist/cli/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { analyzeDependencies } from '../core/discover/dependencies.js';
|
|
|
19
19
|
import { saveHealthReport } from '../reports/health-report.js';
|
|
20
20
|
import { saveAuditReport } from '../reports/audit-report.js';
|
|
21
21
|
import { saveLinkReport } from '../reports/link-report.js';
|
|
22
|
-
import {
|
|
22
|
+
import { getAllDomains, getDomainDefinition, isValidDomain, } from '../core/domains/registry.js';
|
|
23
23
|
import { regenerateIndexes } from '../generators/regenerate.js';
|
|
24
24
|
const program = new Command();
|
|
25
25
|
program
|
|
@@ -81,7 +81,7 @@ program
|
|
|
81
81
|
if (options.domain) {
|
|
82
82
|
if (!isValidDomain(options.domain)) {
|
|
83
83
|
logger.error(`Unknown domain: ${options.domain}`);
|
|
84
|
-
logger.info(`Valid domains: ${
|
|
84
|
+
logger.info(`Valid domains: ${getAllDomains().join(', ')}`);
|
|
85
85
|
process.exit(1);
|
|
86
86
|
}
|
|
87
87
|
domains = [options.domain];
|
|
@@ -92,7 +92,7 @@ program
|
|
|
92
92
|
...(domains ? { domains } : {}),
|
|
93
93
|
silent: true,
|
|
94
94
|
});
|
|
95
|
-
for (const domain of
|
|
95
|
+
for (const domain of getAllDomains()) {
|
|
96
96
|
const count = result.documentCounts[domain] ?? 0;
|
|
97
97
|
logger.info(` ${domain.padEnd(16)} ${count} document${count === 1 ? '' : 's'}`);
|
|
98
98
|
}
|
|
@@ -291,12 +291,242 @@ program
|
|
|
291
291
|
.action(() => {
|
|
292
292
|
logger.header('Documentation Domains');
|
|
293
293
|
const headers = ['Domain', 'Category', 'Priority', 'Description'];
|
|
294
|
-
const rows =
|
|
295
|
-
const def =
|
|
294
|
+
const rows = getAllDomains().map((d) => {
|
|
295
|
+
const def = getDomainDefinition(d);
|
|
296
296
|
return [d, def.category, `${def.loadPriority}/10`, def.description];
|
|
297
297
|
});
|
|
298
298
|
logger.table(headers, rows);
|
|
299
299
|
});
|
|
300
|
+
// --- Custom domains: add / remove / list ---
|
|
301
|
+
const domain = program
|
|
302
|
+
.command('domain')
|
|
303
|
+
.description('Manage custom documentation domains (add | remove | list)');
|
|
304
|
+
domain
|
|
305
|
+
.command('list')
|
|
306
|
+
.description('List built-in and custom domains')
|
|
307
|
+
.option('--json', 'Output as JSON', false)
|
|
308
|
+
.action(async (options) => {
|
|
309
|
+
const { listDomains } = await import('../core/domains/manage.js');
|
|
310
|
+
const result = listDomains(process.cwd());
|
|
311
|
+
if (options.json) {
|
|
312
|
+
logger.info(JSON.stringify(result, null, 2));
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
logger.header('Documentation Domains');
|
|
316
|
+
const headers = ['Domain', 'Kind', 'Category', 'Priority', 'Description'];
|
|
317
|
+
const rows = [
|
|
318
|
+
...result.builtin.map((d) => [
|
|
319
|
+
d.id,
|
|
320
|
+
'built-in',
|
|
321
|
+
d.category,
|
|
322
|
+
`${d.loadPriority}/10`,
|
|
323
|
+
d.description,
|
|
324
|
+
]),
|
|
325
|
+
...result.custom.map((d) => [
|
|
326
|
+
d.id,
|
|
327
|
+
'custom',
|
|
328
|
+
d.category,
|
|
329
|
+
`${d.loadPriority}/10`,
|
|
330
|
+
d.description,
|
|
331
|
+
]),
|
|
332
|
+
];
|
|
333
|
+
logger.table(headers, rows);
|
|
334
|
+
logger.newline();
|
|
335
|
+
logger.info(`${result.builtin.length} built-in · ${result.custom.length} custom`);
|
|
336
|
+
});
|
|
337
|
+
domain
|
|
338
|
+
.command('add <id>')
|
|
339
|
+
.description('Add a custom domain (writes config + scaffolds the folder)')
|
|
340
|
+
.option('-p, --path <path>', 'Documentation path', '.documentation')
|
|
341
|
+
.option('-n, --name <name>', 'Human-readable name (defaults to a title-cased id)')
|
|
342
|
+
.option('-d, --description <desc>', 'One-line description')
|
|
343
|
+
.option('-k, --keywords <csv>', 'Comma-separated keywords used for auto-classification (required)')
|
|
344
|
+
.option('-c, --category <category>', 'core | development | features | advanced', 'features')
|
|
345
|
+
.option('--load-priority <n>', 'Load priority 1-10', '5')
|
|
346
|
+
.option('--dry-run', 'Preview without writing', false)
|
|
347
|
+
.action(async (id, options) => {
|
|
348
|
+
const { addDomain } = await import('../core/domains/manage.js');
|
|
349
|
+
const docsPath = resolve(process.cwd(), options.path);
|
|
350
|
+
const titleCase = (s) => s.replace(/[-_]/g, ' ').replace(/\b\w/g, (ch) => ch.toUpperCase());
|
|
351
|
+
const spec = {
|
|
352
|
+
id,
|
|
353
|
+
name: options.name ?? titleCase(id),
|
|
354
|
+
description: options.description ?? `${titleCase(id)} documentation`,
|
|
355
|
+
keywords: options.keywords
|
|
356
|
+
? String(options.keywords)
|
|
357
|
+
.split(',')
|
|
358
|
+
.map((k) => k.trim())
|
|
359
|
+
.filter(Boolean)
|
|
360
|
+
: [],
|
|
361
|
+
loadPriority: parseInt(options.loadPriority, 10),
|
|
362
|
+
category: options.category,
|
|
363
|
+
};
|
|
364
|
+
const result = await addDomain({
|
|
365
|
+
projectRoot: process.cwd(),
|
|
366
|
+
docsPath,
|
|
367
|
+
spec,
|
|
368
|
+
dryRun: options.dryRun,
|
|
369
|
+
});
|
|
370
|
+
logger.header(`hewtd domain add: ${id}`);
|
|
371
|
+
if (!result.ok) {
|
|
372
|
+
for (const e of result.errors)
|
|
373
|
+
logger.error(e);
|
|
374
|
+
process.exit(1);
|
|
375
|
+
}
|
|
376
|
+
logger.info(`Config: ${result.configPath}`);
|
|
377
|
+
logger.info(`Folder: ${result.domainFolder}`);
|
|
378
|
+
if (result.action === 'dry_run') {
|
|
379
|
+
logger.info('');
|
|
380
|
+
logger.info('--- proposed config entry ---');
|
|
381
|
+
logger.info(JSON.stringify(result.spec, null, 2));
|
|
382
|
+
logger.info('');
|
|
383
|
+
logger.info('Dry-run — nothing written. Re-run without --dry-run to apply.');
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
logger.success(`Added custom domain "${id}".`);
|
|
387
|
+
logger.info(`Wrote ${result.filesWritten?.length ?? 0} file(s).`);
|
|
388
|
+
logger.info('Run `hewtd maintain` any time to refresh indexes.');
|
|
389
|
+
});
|
|
390
|
+
domain
|
|
391
|
+
.command('remove <id>')
|
|
392
|
+
.alias('rm')
|
|
393
|
+
.description('Remove a custom domain from config (never deletes docs)')
|
|
394
|
+
.option('-p, --path <path>', 'Documentation path', '.documentation')
|
|
395
|
+
.option('--dry-run', 'Preview without writing', false)
|
|
396
|
+
.action(async (id, options) => {
|
|
397
|
+
const { removeDomain } = await import('../core/domains/manage.js');
|
|
398
|
+
const docsPath = resolve(process.cwd(), options.path);
|
|
399
|
+
const result = await removeDomain({
|
|
400
|
+
projectRoot: process.cwd(),
|
|
401
|
+
docsPath,
|
|
402
|
+
id,
|
|
403
|
+
dryRun: options.dryRun,
|
|
404
|
+
});
|
|
405
|
+
logger.header(`hewtd domain remove: ${id}`);
|
|
406
|
+
if (!result.ok) {
|
|
407
|
+
for (const e of result.errors)
|
|
408
|
+
logger.error(e);
|
|
409
|
+
process.exit(1);
|
|
410
|
+
}
|
|
411
|
+
if (result.orphanedDocs > 0) {
|
|
412
|
+
logger.warn(`${result.orphanedDocs} document(s) in ${result.domainFolder} will be ORPHANED (left on disk, no longer a recognized domain).`);
|
|
413
|
+
}
|
|
414
|
+
if (result.action === 'dry_run') {
|
|
415
|
+
logger.info('');
|
|
416
|
+
logger.info('Dry-run — nothing written. Re-run without --dry-run to apply.');
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
logger.success(`Removed custom domain "${id}" from config.`);
|
|
420
|
+
logger.info(`Folder left intact: ${result.domainFolder}`);
|
|
421
|
+
});
|
|
422
|
+
// --- Archival process: archive / unarchive / archive-candidates ---
|
|
423
|
+
program
|
|
424
|
+
.command('archive <file>')
|
|
425
|
+
.description('Archive (deprecate) a doc: move it into archive/, stamp lifecycle metadata, reindex. Non-destructive + reversible.')
|
|
426
|
+
.option('-p, --path <path>', 'Documentation path', '.documentation')
|
|
427
|
+
.option('-r, --reason <reason>', 'Why this doc is being archived')
|
|
428
|
+
.option('--force', 'Archive even if active docs still link to it', false)
|
|
429
|
+
.option('--dry-run', 'Preview without moving anything', false)
|
|
430
|
+
.action(async (file, options) => {
|
|
431
|
+
const { archiveDoc } = await import('../core/archive/manage.js');
|
|
432
|
+
const docsPath = resolve(process.cwd(), options.path);
|
|
433
|
+
const result = await archiveDoc({
|
|
434
|
+
projectRoot: process.cwd(),
|
|
435
|
+
docsPath,
|
|
436
|
+
file,
|
|
437
|
+
reason: options.reason,
|
|
438
|
+
force: options.force,
|
|
439
|
+
dryRun: options.dryRun,
|
|
440
|
+
});
|
|
441
|
+
logger.header(`hewtd archive: ${file}`);
|
|
442
|
+
if (!result.ok) {
|
|
443
|
+
for (const e of result.errors)
|
|
444
|
+
logger.error(e);
|
|
445
|
+
if (result.action === 'blocked' && result.inboundLinks.length > 0) {
|
|
446
|
+
logger.info('');
|
|
447
|
+
logger.info('Active docs linking here (fix these or use --force):');
|
|
448
|
+
for (const l of result.inboundLinks) {
|
|
449
|
+
logger.info(` ${l.source}:${l.lineNumber} "${l.linkText}"`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
process.exit(1);
|
|
453
|
+
}
|
|
454
|
+
logger.info(`From: ${result.from}`);
|
|
455
|
+
logger.info(`To: ${result.to}`);
|
|
456
|
+
if (result.inboundLinks.length > 0) {
|
|
457
|
+
logger.warn(`${result.inboundLinks.length} active doc(s) link here — these become dangling:`);
|
|
458
|
+
for (const l of result.inboundLinks)
|
|
459
|
+
logger.info(` ${l.source}:${l.lineNumber}`);
|
|
460
|
+
}
|
|
461
|
+
if (result.action === 'dry_run') {
|
|
462
|
+
logger.info('');
|
|
463
|
+
logger.info('Dry-run — nothing moved. Re-run without --dry-run to apply.');
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
logger.success(`Archived via ${result.moveMethod}. Run \`hewtd maintain\` any time to refresh.`);
|
|
467
|
+
});
|
|
468
|
+
program
|
|
469
|
+
.command('unarchive <file>')
|
|
470
|
+
.description('Restore an archived doc back to its domain folder (reverse of archive).')
|
|
471
|
+
.option('-p, --path <path>', 'Documentation path', '.documentation')
|
|
472
|
+
.option('--dry-run', 'Preview without moving anything', false)
|
|
473
|
+
.action(async (file, options) => {
|
|
474
|
+
const { unarchiveDoc } = await import('../core/archive/manage.js');
|
|
475
|
+
const docsPath = resolve(process.cwd(), options.path);
|
|
476
|
+
const result = await unarchiveDoc({
|
|
477
|
+
projectRoot: process.cwd(),
|
|
478
|
+
docsPath,
|
|
479
|
+
file,
|
|
480
|
+
dryRun: options.dryRun,
|
|
481
|
+
});
|
|
482
|
+
logger.header(`hewtd unarchive: ${file}`);
|
|
483
|
+
if (!result.ok) {
|
|
484
|
+
for (const e of result.errors)
|
|
485
|
+
logger.error(e);
|
|
486
|
+
process.exit(1);
|
|
487
|
+
}
|
|
488
|
+
logger.info(`From: ${result.from}`);
|
|
489
|
+
logger.info(`To: ${result.to}`);
|
|
490
|
+
if (result.action === 'dry_run') {
|
|
491
|
+
logger.info('');
|
|
492
|
+
logger.info('Dry-run — nothing moved. Re-run without --dry-run to apply.');
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
logger.success(`Restored via ${result.moveMethod}.`);
|
|
496
|
+
});
|
|
497
|
+
program
|
|
498
|
+
.command('archive-candidates')
|
|
499
|
+
.description('List docs that may warrant archiving (advisory — never moves anything).')
|
|
500
|
+
.option('-p, --path <path>', 'Documentation path', '.documentation')
|
|
501
|
+
.option('--json', 'Output as JSON', false)
|
|
502
|
+
.action(async (options) => {
|
|
503
|
+
const { loadPluginConfig } = await import('../utils/config.js');
|
|
504
|
+
const { findArchiveCandidates } = await import('../core/archive/candidates.js');
|
|
505
|
+
const docsPath = resolve(process.cwd(), options.path);
|
|
506
|
+
const config = await loadPluginConfig(process.cwd());
|
|
507
|
+
const candidates = await findArchiveCandidates({
|
|
508
|
+
docsPath,
|
|
509
|
+
projectRoot: process.cwd(),
|
|
510
|
+
config: config.archive,
|
|
511
|
+
});
|
|
512
|
+
if (options.json) {
|
|
513
|
+
logger.info(JSON.stringify(candidates, null, 2));
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
logger.header('Archive candidates');
|
|
517
|
+
if (candidates.length === 0) {
|
|
518
|
+
logger.success('No archival candidates. Nothing flagged.');
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
for (const c of candidates) {
|
|
522
|
+
logger.info(` ${c.file} (score ${c.score})`);
|
|
523
|
+
for (const r of c.reasons)
|
|
524
|
+
logger.info(` - ${r}`);
|
|
525
|
+
}
|
|
526
|
+
logger.info('');
|
|
527
|
+
logger.info('These are suggestions only. Archive one with:');
|
|
528
|
+
logger.info(' hewtd archive <file> --dry-run # preview, then drop --dry-run');
|
|
529
|
+
});
|
|
300
530
|
// --- 2.3.0: knowledge-base commands ---
|
|
301
531
|
program
|
|
302
532
|
.command('find-citers <fact-id>')
|