@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
package/dist/utils/config.d.ts
CHANGED
|
@@ -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":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../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"}
|
package/dist/utils/config.js
CHANGED
|
@@ -6,12 +6,56 @@
|
|
|
6
6
|
* 2.3.0 `vault` block for knowledge-base configuration. Missing or
|
|
7
7
|
* malformed files fall back to defaults — never throws.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { readFileSync } from 'fs';
|
|
10
|
+
import { mkdir, readFile, writeFile } from 'fs/promises';
|
|
11
|
+
import { dirname, join, resolve } from 'path';
|
|
11
12
|
import { z } from 'zod';
|
|
12
13
|
export const DEFAULT_VAULT_ROOT = '.documentation/knowledge-base/';
|
|
13
14
|
export const DEFAULT_PLAYBOOK_GLOBS = ['.documentation/**/*.md'];
|
|
14
15
|
export const DEFAULT_AUDIT_WINDOW_DAYS = 90;
|
|
16
|
+
/** Kebab-case slug: matches the fact/incident id convention used elsewhere. */
|
|
17
|
+
const KEBAB_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
18
|
+
/**
|
|
19
|
+
* Valid `category` values for a domain. Kept in sync with `DomainDefinition`
|
|
20
|
+
* in `core/domains/constants.ts` — duplicated here intentionally so the config
|
|
21
|
+
* loader carries no dependency on the domain layer (the registry imports the
|
|
22
|
+
* config, not the other way around).
|
|
23
|
+
*/
|
|
24
|
+
export const DOMAIN_CATEGORY_VALUES = [
|
|
25
|
+
'core',
|
|
26
|
+
'development',
|
|
27
|
+
'features',
|
|
28
|
+
'advanced',
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Schema for a single custom domain entry. Mirrors `DomainDefinition`. Used
|
|
32
|
+
* by the registry merge layer and by `hewtd domain add` (which validates
|
|
33
|
+
* strictly before writing). Collision with a built-in id is NOT checked here —
|
|
34
|
+
* that requires knowing the built-in set, so it is enforced in the registry
|
|
35
|
+
* merge (drop-with-warning) and in the CLI writer (hard error).
|
|
36
|
+
*/
|
|
37
|
+
export const customDomainSchema = z.object({
|
|
38
|
+
id: z.string().regex(KEBAB_SLUG_RE, 'domain id must be kebab-case'),
|
|
39
|
+
name: z.string().min(1),
|
|
40
|
+
description: z.string().min(1),
|
|
41
|
+
keywords: z.array(z.string().min(1)).min(1, 'at least one keyword is required'),
|
|
42
|
+
loadPriority: z.number().int().min(1).max(10),
|
|
43
|
+
category: z.enum(DOMAIN_CATEGORY_VALUES),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Lenient `domains[]` parser: drops malformed entries instead of failing the
|
|
47
|
+
* whole config load. This preserves `loadPluginConfig`'s never-throw contract —
|
|
48
|
+
* a hand-edited config with one bad domain entry still loads the rest (and the
|
|
49
|
+
* valid vault block). The CLI `domain add` command does the strict, user-facing
|
|
50
|
+
* validation; this is the last-line filter for the runtime.
|
|
51
|
+
*/
|
|
52
|
+
const lenientDomainsArray = z
|
|
53
|
+
.preprocess((val) => {
|
|
54
|
+
if (!Array.isArray(val))
|
|
55
|
+
return [];
|
|
56
|
+
return val.filter((entry) => customDomainSchema.safeParse(entry).success);
|
|
57
|
+
}, z.array(customDomainSchema))
|
|
58
|
+
.default([]);
|
|
15
59
|
/**
|
|
16
60
|
* Schema for `.claude/hit-em-with-the-docs.json`. Every field is optional
|
|
17
61
|
* with a sensible default. The runtime's `updatePolicy` is preserved via
|
|
@@ -24,9 +68,30 @@ const vaultConfigSchema = z
|
|
|
24
68
|
audit_window_days: z.number().int().positive().default(DEFAULT_AUDIT_WINDOW_DAYS),
|
|
25
69
|
})
|
|
26
70
|
.default({});
|
|
71
|
+
export const DEFAULT_ARCHIVE_CANDIDATE_DAYS = 365;
|
|
72
|
+
/**
|
|
73
|
+
* Archival policy. Governs candidate DETECTION and archival aggressiveness.
|
|
74
|
+
* The safe default is propose-don't-impose: nothing is ever auto-archived
|
|
75
|
+
* (`auto: false`), age alone never qualifies a doc (`require_orphaned: true`),
|
|
76
|
+
* and the recency threshold is generous (docs churn slower than code).
|
|
77
|
+
*/
|
|
78
|
+
const archiveConfigSchema = z
|
|
79
|
+
.object({
|
|
80
|
+
honor_status_deprecated: z.boolean().default(true),
|
|
81
|
+
candidate_after_days: z
|
|
82
|
+
.number()
|
|
83
|
+
.int()
|
|
84
|
+
.positive()
|
|
85
|
+
.default(DEFAULT_ARCHIVE_CANDIDATE_DAYS),
|
|
86
|
+
require_orphaned: z.boolean().default(true),
|
|
87
|
+
auto: z.boolean().default(false),
|
|
88
|
+
})
|
|
89
|
+
.default({});
|
|
27
90
|
const pluginConfigSchema = z
|
|
28
91
|
.object({
|
|
29
92
|
vault: vaultConfigSchema,
|
|
93
|
+
domains: lenientDomainsArray,
|
|
94
|
+
archive: archiveConfigSchema,
|
|
30
95
|
})
|
|
31
96
|
.passthrough();
|
|
32
97
|
const CONFIG_FILENAME = '.claude/hit-em-with-the-docs.json';
|
|
@@ -63,9 +128,6 @@ export function loadPluginConfigSync(projectRoot) {
|
|
|
63
128
|
const configPath = resolve(root, CONFIG_FILENAME);
|
|
64
129
|
let raw;
|
|
65
130
|
try {
|
|
66
|
-
// Lazy require to avoid hoisting an fs dep when this code path isn't used.
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
68
|
-
const { readFileSync } = require('fs');
|
|
69
131
|
const contents = readFileSync(configPath, 'utf-8');
|
|
70
132
|
raw = JSON.parse(contents);
|
|
71
133
|
}
|
|
@@ -78,6 +140,41 @@ export function loadPluginConfigSync(projectRoot) {
|
|
|
78
140
|
}
|
|
79
141
|
return pluginConfigSchema.parse({});
|
|
80
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Read the RAW config object (unparsed, no defaults applied) for a project.
|
|
145
|
+
* Returns `{}` when the file is missing or unreadable/malformed. Use this when
|
|
146
|
+
* you need to MUTATE the config and write it back without clobbering keys this
|
|
147
|
+
* module doesn't model (e.g. the runtime's `updatePolicy`). Never throws.
|
|
148
|
+
*/
|
|
149
|
+
export async function readRawConfig(projectRoot) {
|
|
150
|
+
const root = projectRoot ?? process.cwd();
|
|
151
|
+
const configPath = resolve(root, CONFIG_FILENAME);
|
|
152
|
+
try {
|
|
153
|
+
const contents = await readFile(configPath, 'utf-8');
|
|
154
|
+
const parsed = JSON.parse(contents);
|
|
155
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
156
|
+
? parsed
|
|
157
|
+
: {};
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return {};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Write the RAW config object back to `.claude/hit-em-with-the-docs.json`,
|
|
165
|
+
* creating the `.claude/` directory if needed. Pretty-printed with a trailing
|
|
166
|
+
* newline. Returns the absolute path written.
|
|
167
|
+
*/
|
|
168
|
+
export async function writeRawConfig(projectRoot, data) {
|
|
169
|
+
const configPath = resolve(projectRoot, CONFIG_FILENAME);
|
|
170
|
+
await mkdir(dirname(configPath), { recursive: true });
|
|
171
|
+
await writeFile(configPath, JSON.stringify(data, null, 2) + '\n', 'utf-8');
|
|
172
|
+
return configPath;
|
|
173
|
+
}
|
|
174
|
+
/** Absolute path to a project's config file (whether or not it exists). */
|
|
175
|
+
export function configFilePath(projectRoot) {
|
|
176
|
+
return resolve(projectRoot, CONFIG_FILENAME);
|
|
177
|
+
}
|
|
81
178
|
/**
|
|
82
179
|
* Resolve the vault root for a project, applying config + defaults.
|
|
83
180
|
* The returned path is absolute.
|
package/dist/utils/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,gCAAgC,CAAC;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,+EAA+E;AAC/E,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAEnD;;;;;GAKG;AACH,MAA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EpB,OAAO,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/utils/glob.d.ts
CHANGED
|
@@ -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
|
/**
|
package/dist/utils/glob.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../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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M,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/utils/glob.js
CHANGED
|
@@ -17,11 +17,32 @@ export async function glob(pattern, options = {}) {
|
|
|
17
17
|
return matches;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Reserved documentation subdirectory for DEPRECATED docs. Anything under
|
|
21
|
+
* `<docs>/archive/` is intentionally excluded from every hewtd scan (audit,
|
|
22
|
+
* link-check, metadata-sync, integrate dup-detection, link graph, search) —
|
|
23
|
+
* it's a parking lot for retired docs, not part of the active corpus.
|
|
24
|
+
*/
|
|
25
|
+
export const ARCHIVE_DIR = 'archive';
|
|
26
|
+
/** Glob ignores always applied to documentation scans. */
|
|
27
|
+
const DOC_SCAN_IGNORE = [
|
|
28
|
+
'node_modules/**',
|
|
29
|
+
'dist/**',
|
|
30
|
+
'.git/**',
|
|
31
|
+
`${ARCHIVE_DIR}/**`,
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Find all markdown files in a directory.
|
|
35
|
+
*
|
|
36
|
+
* Used exclusively as the documentation-corpus scanner, so it always skips
|
|
37
|
+
* the reserved `archive/` subtree (deprecated docs) in addition to the
|
|
38
|
+
* standard build/vcs ignores. Callers may pass extra `ignore` patterns; they
|
|
39
|
+
* are merged, never override the archive exclusion.
|
|
21
40
|
*/
|
|
22
41
|
export async function findMarkdownFiles(dir, options = {}) {
|
|
42
|
+
const { ignore: extraIgnore = [], ...rest } = options;
|
|
23
43
|
return glob('**/*.md', {
|
|
24
|
-
...
|
|
44
|
+
...rest,
|
|
45
|
+
ignore: [...DOC_SCAN_IGNORE, ...extraIgnore],
|
|
25
46
|
cwd: dir,
|
|
26
47
|
absolute: true,
|
|
27
48
|
});
|
package/dist/utils/glob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/utils/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAShC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,OAAe,EACf,UAAuB,EAAE;IAEzB,MAAM,EACJ,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EACnB,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,CAAC,iBAAiB,EAAE,SAAS,EAAE,SAAS,CAAC,EAClD,GAAG,GAAG,KAAK,GACZ,GAAG,OAAO,CAAC;IAEZ,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE;QACrC,GAAG;QACH,QAAQ;QACR,MAAM;QACN,GAAG;QACH,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/utils/glob.ts"],"names":[],"mappings":"AAAA,OA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,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,YAAoB;IAC5D,OAAO,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAAc;IAC1D,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theglitchking/hit-em-with-the-docs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
@@ -27,6 +27,10 @@ This project uses the hit-em-with-the-docs documentation system for hierarchical
|
|
|
27
27
|
└── plans/ # Planning documents
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
These 15 domains are built-in and always present. The set is **extensible** — register project-specific domains at runtime with `npx hit-em-with-the-docs domain add <id> -k <keywords>` (stored in `.claude/hit-em-with-the-docs.json` under `domains: []`, and scaffolded under `.documentation/<id>/`). Run `npx hit-em-with-the-docs domain list` to see the active set, and `domain remove <id>` to drop a custom one (never deletes docs).
|
|
31
|
+
|
|
32
|
+
**Deprecated docs → `.documentation/archive/`.** To retire a doc without deleting it, use `npx hit-em-with-the-docs archive <file>` — it moves the doc under `archive/`, stamps lifecycle frontmatter (`archived_from` makes it reversible), and reindexes. A link guard refuses if active docs still link to it (`--force` overrides); `--dry-run` previews. `unarchive <file>` restores it where it came from, and `archive-candidates` lists docs that may warrant archiving (advisory, read-only — never moves anything). hewtd excludes the `archive/` folder from every scan (audit, link-check, metadata-sync, integrate, link graph, search), so archived docs are never validated or indexed. `archive` is reserved and cannot be a domain. A doc left at `status: deprecated` in an active folder is now surfaced by `audit` as an INFO nudge toward `archive`.
|
|
33
|
+
|
|
30
34
|
## Commands
|
|
31
35
|
|
|
32
36
|
### /docs
|
|
@@ -46,7 +50,7 @@ This loads:
|
|
|
46
50
|
|
|
47
51
|
#### /docs list
|
|
48
52
|
|
|
49
|
-
List all 15
|
|
53
|
+
List all documentation domains (the 15 built-in plus any custom domains) with descriptions.
|
|
50
54
|
|
|
51
55
|
#### /docs search <query>
|
|
52
56
|
|