cc-agent-harness 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +236 -0
  3. package/README.zh-CN.md +236 -0
  4. package/dist/chunk-3P72TGGQ.js +82 -0
  5. package/dist/chunk-3P72TGGQ.js.map +1 -0
  6. package/dist/chunk-JKJ3FP6T.js +51 -0
  7. package/dist/chunk-JKJ3FP6T.js.map +1 -0
  8. package/dist/chunk-LOE6IDTT.js +65 -0
  9. package/dist/chunk-LOE6IDTT.js.map +1 -0
  10. package/dist/chunk-PQWK2OBN.js +18 -0
  11. package/dist/chunk-PQWK2OBN.js.map +1 -0
  12. package/dist/chunk-R6VGYQOH.js +771 -0
  13. package/dist/chunk-R6VGYQOH.js.map +1 -0
  14. package/dist/config-PUMLWJWT.js +46 -0
  15. package/dist/config-PUMLWJWT.js.map +1 -0
  16. package/dist/context-SRWWNVTI.js +33 -0
  17. package/dist/context-SRWWNVTI.js.map +1 -0
  18. package/dist/doctor-TYLZH27K.js +199 -0
  19. package/dist/doctor-TYLZH27K.js.map +1 -0
  20. package/dist/harness.js +62 -0
  21. package/dist/harness.js.map +1 -0
  22. package/dist/index.d.ts +846 -0
  23. package/dist/index.js +1181 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/list-ABNY2TO7.js +124 -0
  26. package/dist/list-ABNY2TO7.js.map +1 -0
  27. package/dist/loader-RDQZFHOB.js +19 -0
  28. package/dist/loader-RDQZFHOB.js.map +1 -0
  29. package/dist/run-I5GVJH3N.js +45 -0
  30. package/dist/run-I5GVJH3N.js.map +1 -0
  31. package/dist/scaffold-C6JA3STC.js +98 -0
  32. package/dist/scaffold-C6JA3STC.js.map +1 -0
  33. package/dist/schema-AHX7LXUQ.js +27 -0
  34. package/dist/schema-AHX7LXUQ.js.map +1 -0
  35. package/dist/setup-CWDCKM34.js +115 -0
  36. package/dist/setup-CWDCKM34.js.map +1 -0
  37. package/dist/update-CTPDQCLU.js +87 -0
  38. package/dist/update-CTPDQCLU.js.map +1 -0
  39. package/dist/verify-NI3VCE2H.js +136 -0
  40. package/dist/verify-NI3VCE2H.js.map +1 -0
  41. package/package.json +61 -0
  42. package/templates/agents-md/full.md.tmpl +98 -0
  43. package/templates/agents-md/minimal.md.tmpl +20 -0
  44. package/templates/agents-md/standard.md.tmpl +43 -0
  45. package/templates/configs/harness.config.yaml.tmpl +28 -0
  46. package/templates/skills/basic/SKILL.md.tmpl +14 -0
@@ -0,0 +1,846 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const modelTierSchema: z.ZodEnum<["low", "medium", "high"]>;
4
+ declare const agentDefinitionSchema: z.ZodObject<{
5
+ name: z.ZodString;
6
+ domain: z.ZodString;
7
+ tier: z.ZodEnum<["low", "medium", "high"]>;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ name: string;
11
+ domain: string;
12
+ tier: "low" | "medium" | "high";
13
+ description?: string | undefined;
14
+ }, {
15
+ name: string;
16
+ domain: string;
17
+ tier: "low" | "medium" | "high";
18
+ description?: string | undefined;
19
+ }>;
20
+ declare const providerMappingSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
21
+ declare const agentsConfigSchema: z.ZodObject<{
22
+ delegation_first: z.ZodDefault<z.ZodBoolean>;
23
+ model_routing: z.ZodDefault<z.ZodObject<{
24
+ low: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
25
+ medium: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
26
+ high: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ low: "low" | "medium" | "high";
29
+ medium: "low" | "medium" | "high";
30
+ high: "low" | "medium" | "high";
31
+ }, {
32
+ low?: "low" | "medium" | "high" | undefined;
33
+ medium?: "low" | "medium" | "high" | undefined;
34
+ high?: "low" | "medium" | "high" | undefined;
35
+ }>>;
36
+ providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
37
+ definitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
38
+ name: z.ZodString;
39
+ domain: z.ZodString;
40
+ tier: z.ZodEnum<["low", "medium", "high"]>;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ name: string;
44
+ domain: string;
45
+ tier: "low" | "medium" | "high";
46
+ description?: string | undefined;
47
+ }, {
48
+ name: string;
49
+ domain: string;
50
+ tier: "low" | "medium" | "high";
51
+ description?: string | undefined;
52
+ }>, "many">>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ delegation_first: boolean;
55
+ model_routing: {
56
+ low: "low" | "medium" | "high";
57
+ medium: "low" | "medium" | "high";
58
+ high: "low" | "medium" | "high";
59
+ };
60
+ providers: Record<string, string>;
61
+ definitions: {
62
+ name: string;
63
+ domain: string;
64
+ tier: "low" | "medium" | "high";
65
+ description?: string | undefined;
66
+ }[];
67
+ }, {
68
+ delegation_first?: boolean | undefined;
69
+ model_routing?: {
70
+ low?: "low" | "medium" | "high" | undefined;
71
+ medium?: "low" | "medium" | "high" | undefined;
72
+ high?: "low" | "medium" | "high" | undefined;
73
+ } | undefined;
74
+ providers?: Record<string, string> | undefined;
75
+ definitions?: {
76
+ name: string;
77
+ domain: string;
78
+ tier: "low" | "medium" | "high";
79
+ description?: string | undefined;
80
+ }[] | undefined;
81
+ }>;
82
+ declare const skillsConfigSchema: z.ZodObject<{
83
+ directories: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
84
+ auto_detect: z.ZodDefault<z.ZodBoolean>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ directories: string[];
87
+ auto_detect: boolean;
88
+ }, {
89
+ directories?: string[] | undefined;
90
+ auto_detect?: boolean | undefined;
91
+ }>;
92
+ declare const verificationStageSchema: z.ZodObject<{
93
+ name: z.ZodString;
94
+ command: z.ZodOptional<z.ZodString>;
95
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ name: string;
98
+ fail_fast: boolean;
99
+ command?: string | undefined;
100
+ }, {
101
+ name: string;
102
+ command?: string | undefined;
103
+ fail_fast?: boolean | undefined;
104
+ }>;
105
+ declare const verificationConfigSchema: z.ZodObject<{
106
+ checks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
107
+ pipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
108
+ name: z.ZodString;
109
+ command: z.ZodOptional<z.ZodString>;
110
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ name: string;
113
+ fail_fast: boolean;
114
+ command?: string | undefined;
115
+ }, {
116
+ name: string;
117
+ command?: string | undefined;
118
+ fail_fast?: boolean | undefined;
119
+ }>, "many">>;
120
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ fail_fast: boolean;
123
+ checks: string[];
124
+ pipeline?: {
125
+ name: string;
126
+ fail_fast: boolean;
127
+ command?: string | undefined;
128
+ }[] | undefined;
129
+ }, {
130
+ fail_fast?: boolean | undefined;
131
+ checks?: string[] | undefined;
132
+ pipeline?: {
133
+ name: string;
134
+ command?: string | undefined;
135
+ fail_fast?: boolean | undefined;
136
+ }[] | undefined;
137
+ }>;
138
+ declare const workflowsConfigSchema: z.ZodObject<{
139
+ commands: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
140
+ verification: z.ZodDefault<z.ZodObject<{
141
+ checks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
142
+ pipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
+ name: z.ZodString;
144
+ command: z.ZodOptional<z.ZodString>;
145
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ name: string;
148
+ fail_fast: boolean;
149
+ command?: string | undefined;
150
+ }, {
151
+ name: string;
152
+ command?: string | undefined;
153
+ fail_fast?: boolean | undefined;
154
+ }>, "many">>;
155
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ fail_fast: boolean;
158
+ checks: string[];
159
+ pipeline?: {
160
+ name: string;
161
+ fail_fast: boolean;
162
+ command?: string | undefined;
163
+ }[] | undefined;
164
+ }, {
165
+ fail_fast?: boolean | undefined;
166
+ checks?: string[] | undefined;
167
+ pipeline?: {
168
+ name: string;
169
+ command?: string | undefined;
170
+ fail_fast?: boolean | undefined;
171
+ }[] | undefined;
172
+ }>>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ commands: Record<string, string>;
175
+ verification: {
176
+ fail_fast: boolean;
177
+ checks: string[];
178
+ pipeline?: {
179
+ name: string;
180
+ fail_fast: boolean;
181
+ command?: string | undefined;
182
+ }[] | undefined;
183
+ };
184
+ }, {
185
+ commands?: Record<string, string> | undefined;
186
+ verification?: {
187
+ fail_fast?: boolean | undefined;
188
+ checks?: string[] | undefined;
189
+ pipeline?: {
190
+ name: string;
191
+ command?: string | undefined;
192
+ fail_fast?: boolean | undefined;
193
+ }[] | undefined;
194
+ } | undefined;
195
+ }>;
196
+ declare const templatesConfigSchema: z.ZodObject<{
197
+ agents_md: z.ZodDefault<z.ZodObject<{
198
+ variant: z.ZodDefault<z.ZodEnum<["minimal", "standard", "full"]>>;
199
+ custom_rules: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ variant: "minimal" | "standard" | "full";
202
+ custom_rules: string[];
203
+ }, {
204
+ variant?: "minimal" | "standard" | "full" | undefined;
205
+ custom_rules?: string[] | undefined;
206
+ }>>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ agents_md: {
209
+ variant: "minimal" | "standard" | "full";
210
+ custom_rules: string[];
211
+ };
212
+ }, {
213
+ agents_md?: {
214
+ variant?: "minimal" | "standard" | "full" | undefined;
215
+ custom_rules?: string[] | undefined;
216
+ } | undefined;
217
+ }>;
218
+ declare const projectConfigSchema: z.ZodObject<{
219
+ name: z.ZodString;
220
+ language: z.ZodDefault<z.ZodEnum<["rust", "typescript", "python", "multi"]>>;
221
+ description: z.ZodDefault<z.ZodString>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ name: string;
224
+ description: string;
225
+ language: "rust" | "typescript" | "python" | "multi";
226
+ }, {
227
+ name: string;
228
+ description?: string | undefined;
229
+ language?: "rust" | "typescript" | "python" | "multi" | undefined;
230
+ }>;
231
+ declare const featuresConfigSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
232
+ declare const harnessConfigSchema: z.ZodObject<{
233
+ project: z.ZodObject<{
234
+ name: z.ZodString;
235
+ language: z.ZodDefault<z.ZodEnum<["rust", "typescript", "python", "multi"]>>;
236
+ description: z.ZodDefault<z.ZodString>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ name: string;
239
+ description: string;
240
+ language: "rust" | "typescript" | "python" | "multi";
241
+ }, {
242
+ name: string;
243
+ description?: string | undefined;
244
+ language?: "rust" | "typescript" | "python" | "multi" | undefined;
245
+ }>;
246
+ agents: z.ZodDefault<z.ZodObject<{
247
+ delegation_first: z.ZodDefault<z.ZodBoolean>;
248
+ model_routing: z.ZodDefault<z.ZodObject<{
249
+ low: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
250
+ medium: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
251
+ high: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
252
+ }, "strip", z.ZodTypeAny, {
253
+ low: "low" | "medium" | "high";
254
+ medium: "low" | "medium" | "high";
255
+ high: "low" | "medium" | "high";
256
+ }, {
257
+ low?: "low" | "medium" | "high" | undefined;
258
+ medium?: "low" | "medium" | "high" | undefined;
259
+ high?: "low" | "medium" | "high" | undefined;
260
+ }>>;
261
+ providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
262
+ definitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
263
+ name: z.ZodString;
264
+ domain: z.ZodString;
265
+ tier: z.ZodEnum<["low", "medium", "high"]>;
266
+ description: z.ZodOptional<z.ZodString>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ name: string;
269
+ domain: string;
270
+ tier: "low" | "medium" | "high";
271
+ description?: string | undefined;
272
+ }, {
273
+ name: string;
274
+ domain: string;
275
+ tier: "low" | "medium" | "high";
276
+ description?: string | undefined;
277
+ }>, "many">>;
278
+ }, "strip", z.ZodTypeAny, {
279
+ delegation_first: boolean;
280
+ model_routing: {
281
+ low: "low" | "medium" | "high";
282
+ medium: "low" | "medium" | "high";
283
+ high: "low" | "medium" | "high";
284
+ };
285
+ providers: Record<string, string>;
286
+ definitions: {
287
+ name: string;
288
+ domain: string;
289
+ tier: "low" | "medium" | "high";
290
+ description?: string | undefined;
291
+ }[];
292
+ }, {
293
+ delegation_first?: boolean | undefined;
294
+ model_routing?: {
295
+ low?: "low" | "medium" | "high" | undefined;
296
+ medium?: "low" | "medium" | "high" | undefined;
297
+ high?: "low" | "medium" | "high" | undefined;
298
+ } | undefined;
299
+ providers?: Record<string, string> | undefined;
300
+ definitions?: {
301
+ name: string;
302
+ domain: string;
303
+ tier: "low" | "medium" | "high";
304
+ description?: string | undefined;
305
+ }[] | undefined;
306
+ }>>;
307
+ skills: z.ZodDefault<z.ZodObject<{
308
+ directories: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
309
+ auto_detect: z.ZodDefault<z.ZodBoolean>;
310
+ }, "strip", z.ZodTypeAny, {
311
+ directories: string[];
312
+ auto_detect: boolean;
313
+ }, {
314
+ directories?: string[] | undefined;
315
+ auto_detect?: boolean | undefined;
316
+ }>>;
317
+ workflows: z.ZodDefault<z.ZodObject<{
318
+ commands: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
319
+ verification: z.ZodDefault<z.ZodObject<{
320
+ checks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
321
+ pipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
322
+ name: z.ZodString;
323
+ command: z.ZodOptional<z.ZodString>;
324
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ name: string;
327
+ fail_fast: boolean;
328
+ command?: string | undefined;
329
+ }, {
330
+ name: string;
331
+ command?: string | undefined;
332
+ fail_fast?: boolean | undefined;
333
+ }>, "many">>;
334
+ fail_fast: z.ZodDefault<z.ZodBoolean>;
335
+ }, "strip", z.ZodTypeAny, {
336
+ fail_fast: boolean;
337
+ checks: string[];
338
+ pipeline?: {
339
+ name: string;
340
+ fail_fast: boolean;
341
+ command?: string | undefined;
342
+ }[] | undefined;
343
+ }, {
344
+ fail_fast?: boolean | undefined;
345
+ checks?: string[] | undefined;
346
+ pipeline?: {
347
+ name: string;
348
+ command?: string | undefined;
349
+ fail_fast?: boolean | undefined;
350
+ }[] | undefined;
351
+ }>>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ commands: Record<string, string>;
354
+ verification: {
355
+ fail_fast: boolean;
356
+ checks: string[];
357
+ pipeline?: {
358
+ name: string;
359
+ fail_fast: boolean;
360
+ command?: string | undefined;
361
+ }[] | undefined;
362
+ };
363
+ }, {
364
+ commands?: Record<string, string> | undefined;
365
+ verification?: {
366
+ fail_fast?: boolean | undefined;
367
+ checks?: string[] | undefined;
368
+ pipeline?: {
369
+ name: string;
370
+ command?: string | undefined;
371
+ fail_fast?: boolean | undefined;
372
+ }[] | undefined;
373
+ } | undefined;
374
+ }>>;
375
+ templates: z.ZodDefault<z.ZodObject<{
376
+ agents_md: z.ZodDefault<z.ZodObject<{
377
+ variant: z.ZodDefault<z.ZodEnum<["minimal", "standard", "full"]>>;
378
+ custom_rules: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ variant: "minimal" | "standard" | "full";
381
+ custom_rules: string[];
382
+ }, {
383
+ variant?: "minimal" | "standard" | "full" | undefined;
384
+ custom_rules?: string[] | undefined;
385
+ }>>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ agents_md: {
388
+ variant: "minimal" | "standard" | "full";
389
+ custom_rules: string[];
390
+ };
391
+ }, {
392
+ agents_md?: {
393
+ variant?: "minimal" | "standard" | "full" | undefined;
394
+ custom_rules?: string[] | undefined;
395
+ } | undefined;
396
+ }>>;
397
+ features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
398
+ }, "strip", z.ZodTypeAny, {
399
+ project: {
400
+ name: string;
401
+ description: string;
402
+ language: "rust" | "typescript" | "python" | "multi";
403
+ };
404
+ agents: {
405
+ delegation_first: boolean;
406
+ model_routing: {
407
+ low: "low" | "medium" | "high";
408
+ medium: "low" | "medium" | "high";
409
+ high: "low" | "medium" | "high";
410
+ };
411
+ providers: Record<string, string>;
412
+ definitions: {
413
+ name: string;
414
+ domain: string;
415
+ tier: "low" | "medium" | "high";
416
+ description?: string | undefined;
417
+ }[];
418
+ };
419
+ skills: {
420
+ directories: string[];
421
+ auto_detect: boolean;
422
+ };
423
+ workflows: {
424
+ commands: Record<string, string>;
425
+ verification: {
426
+ fail_fast: boolean;
427
+ checks: string[];
428
+ pipeline?: {
429
+ name: string;
430
+ fail_fast: boolean;
431
+ command?: string | undefined;
432
+ }[] | undefined;
433
+ };
434
+ };
435
+ templates: {
436
+ agents_md: {
437
+ variant: "minimal" | "standard" | "full";
438
+ custom_rules: string[];
439
+ };
440
+ };
441
+ features: Record<string, boolean>;
442
+ }, {
443
+ project: {
444
+ name: string;
445
+ description?: string | undefined;
446
+ language?: "rust" | "typescript" | "python" | "multi" | undefined;
447
+ };
448
+ agents?: {
449
+ delegation_first?: boolean | undefined;
450
+ model_routing?: {
451
+ low?: "low" | "medium" | "high" | undefined;
452
+ medium?: "low" | "medium" | "high" | undefined;
453
+ high?: "low" | "medium" | "high" | undefined;
454
+ } | undefined;
455
+ providers?: Record<string, string> | undefined;
456
+ definitions?: {
457
+ name: string;
458
+ domain: string;
459
+ tier: "low" | "medium" | "high";
460
+ description?: string | undefined;
461
+ }[] | undefined;
462
+ } | undefined;
463
+ skills?: {
464
+ directories?: string[] | undefined;
465
+ auto_detect?: boolean | undefined;
466
+ } | undefined;
467
+ workflows?: {
468
+ commands?: Record<string, string> | undefined;
469
+ verification?: {
470
+ fail_fast?: boolean | undefined;
471
+ checks?: string[] | undefined;
472
+ pipeline?: {
473
+ name: string;
474
+ command?: string | undefined;
475
+ fail_fast?: boolean | undefined;
476
+ }[] | undefined;
477
+ } | undefined;
478
+ } | undefined;
479
+ templates?: {
480
+ agents_md?: {
481
+ variant?: "minimal" | "standard" | "full" | undefined;
482
+ custom_rules?: string[] | undefined;
483
+ } | undefined;
484
+ } | undefined;
485
+ features?: Record<string, boolean> | undefined;
486
+ }>;
487
+ type HarnessConfig = z.infer<typeof harnessConfigSchema>;
488
+ type AgentDefinition = z.infer<typeof agentDefinitionSchema>;
489
+ type ModelTier = z.infer<typeof modelTierSchema>;
490
+
491
+ interface ConfigLayer {
492
+ name: string;
493
+ path: string;
494
+ data: Record<string, unknown> | null;
495
+ }
496
+ interface LoadConfigOptions {
497
+ cwd?: string;
498
+ extraLayers?: ConfigLayer[];
499
+ }
500
+ interface LoadConfigResult {
501
+ config: HarnessConfig;
502
+ layers: ConfigLayer[];
503
+ }
504
+ /**
505
+ * Load harness configuration with N-layer merge and source tracking.
506
+ *
507
+ * Default layer order (lowest to highest priority):
508
+ * 1. Built-in defaults (via Zod schema defaults)
509
+ * 2. User-level (~/.harness/config.yaml)
510
+ * 3. Project-level (.harness/harness.config.yaml)
511
+ * 4. Extra layers (programmatic overrides)
512
+ */
513
+ declare function loadConfig(opts?: LoadConfigOptions): Promise<HarnessConfig>;
514
+ declare function loadConfigWithLayers(opts?: LoadConfigOptions): Promise<LoadConfigResult>;
515
+ declare function configExists(cwd?: string): boolean;
516
+ declare function projectConfigExists(cwd?: string): boolean;
517
+ declare function userConfigExists(): boolean;
518
+ declare function anyConfigExists(cwd?: string): boolean;
519
+
520
+ declare const BUILT_IN_AGENTS: AgentDefinition[];
521
+ declare const DEFAULT_SKILL_DIRECTORIES: string[];
522
+ declare const DEFAULT_VERIFICATION_CHECKS: string[];
523
+
524
+ declare class AgentRegistry {
525
+ private agents;
526
+ constructor(customAgents?: AgentDefinition[]);
527
+ get(name: string): AgentDefinition | undefined;
528
+ list(): AgentDefinition[];
529
+ listByDomain(domain: string): AgentDefinition[];
530
+ listByTier(tier: string): AgentDefinition[];
531
+ domains(): string[];
532
+ count(): {
533
+ builtin: number;
534
+ custom: number;
535
+ total: number;
536
+ };
537
+ }
538
+
539
+ type TaskComplexity = "low" | "medium" | "high";
540
+ interface ModelRouting {
541
+ low: ModelTier;
542
+ medium: ModelTier;
543
+ high: ModelTier;
544
+ }
545
+ declare function routeModel(complexity: TaskComplexity, routing?: Partial<ModelRouting>): ModelTier;
546
+ declare function inferComplexity(taskDescription: string): TaskComplexity;
547
+
548
+ interface CommandDefinition {
549
+ name: string;
550
+ command: string;
551
+ description: string;
552
+ }
553
+ interface HealthCheck {
554
+ name: string;
555
+ check: () => Promise<HealthCheckResult>;
556
+ }
557
+ interface HealthCheckResult {
558
+ status: "pass" | "warn" | "fail";
559
+ message: string;
560
+ }
561
+ interface ProjectAdapter {
562
+ name: string;
563
+ detect(cwd: string): Promise<boolean>;
564
+ getCommands(): CommandDefinition[];
565
+ getHealthChecks(): HealthCheck[];
566
+ }
567
+
568
+ declare class AdapterRegistry {
569
+ private adapters;
570
+ constructor(additionalAdapters?: ProjectAdapter[]);
571
+ register(adapter: ProjectAdapter): void;
572
+ get(name: string): ProjectAdapter | undefined;
573
+ list(): ProjectAdapter[];
574
+ detect(cwd: string): Promise<ProjectAdapter | null>;
575
+ count(): {
576
+ builtin: number;
577
+ custom: number;
578
+ total: number;
579
+ };
580
+ }
581
+
582
+ declare function detectProjectType(cwd: string): Promise<ProjectAdapter | null>;
583
+ declare function detectLanguage(cwd: string): "rust" | "typescript" | "python" | "multi";
584
+
585
+ declare class TypeScriptAdapter implements ProjectAdapter {
586
+ name: string;
587
+ detect(cwd: string): Promise<boolean>;
588
+ getCommands(): CommandDefinition[];
589
+ getHealthChecks(): HealthCheck[];
590
+ }
591
+
592
+ declare class PythonAdapter implements ProjectAdapter {
593
+ name: string;
594
+ detect(cwd: string): Promise<boolean>;
595
+ getCommands(): CommandDefinition[];
596
+ getHealthChecks(): HealthCheck[];
597
+ }
598
+
599
+ declare class RustAdapter implements ProjectAdapter {
600
+ name: string;
601
+ detect(cwd: string): Promise<boolean>;
602
+ getCommands(): CommandDefinition[];
603
+ getHealthChecks(): HealthCheck[];
604
+ }
605
+
606
+ interface SkillInfo {
607
+ name: string;
608
+ description: string;
609
+ path: string;
610
+ valid: boolean;
611
+ }
612
+ declare function discoverSkills(directories: string[], cwd?: string): Promise<SkillInfo[]>;
613
+ declare function listSkillDirectories(cwd?: string): Promise<string[]>;
614
+
615
+ interface SkillValidationResult {
616
+ valid: boolean;
617
+ name: string | null;
618
+ description: string | null;
619
+ errors: string[];
620
+ warnings: string[];
621
+ }
622
+ declare function validateSkill(skillDir: string): Promise<SkillValidationResult>;
623
+
624
+ interface ScaffoldOptions {
625
+ name: string;
626
+ description: string;
627
+ displayName: string;
628
+ resources?: ("scripts" | "references" | "assets")[];
629
+ }
630
+ declare function scaffoldSkill(targetDir: string, options: ScaffoldOptions): Promise<string>;
631
+
632
+ interface HealthReport {
633
+ results: HealthReportEntry[];
634
+ summary: {
635
+ pass: number;
636
+ warn: number;
637
+ fail: number;
638
+ };
639
+ }
640
+ interface HealthReportEntry {
641
+ name: string;
642
+ result: HealthCheckResult;
643
+ }
644
+ declare function runHealthChecks(checks: HealthCheck[]): Promise<HealthReport>;
645
+ declare function formatReport(report: HealthReport): string;
646
+
647
+ interface TemplateContext {
648
+ [key: string]: string | boolean | string[] | undefined;
649
+ }
650
+ /**
651
+ * Lightweight template engine:
652
+ * - {{variable}} — interpolation
653
+ * - {{#if condition}}...{{/if}} — conditional block (truthy check)
654
+ * - {{#if condition}}...{{#else}}...{{/if}} — conditional with else
655
+ * - {{#each items}}...{{/each}} — array iteration (current item as {{.}})
656
+ */
657
+ declare function render(template: string, context: TemplateContext): string;
658
+
659
+ declare function renderFile(templatePath: string, outputPath: string, context: TemplateContext): Promise<void>;
660
+ declare function renderDirectory(templateDir: string, outputDir: string, context: TemplateContext): Promise<string[]>;
661
+
662
+ type AuditEventKind = "setup" | "update" | "doctor" | "verify" | "scaffold" | "config.loaded" | "config.changed" | "skill.discovered" | "hook.executed" | "custom";
663
+ interface AuditEntry {
664
+ timestamp: string;
665
+ kind: AuditEventKind;
666
+ message: string;
667
+ data?: Record<string, unknown>;
668
+ }
669
+
670
+ declare class AuditLogger {
671
+ private logPath;
672
+ constructor(cwd: string, logDir?: string);
673
+ log(kind: AuditEventKind, message: string, data?: Record<string, unknown>): Promise<void>;
674
+ getLogPath(): string;
675
+ }
676
+
677
+ interface ContextBlock {
678
+ tag: string;
679
+ content: string;
680
+ priority: number;
681
+ }
682
+ type TagStyle = "xml" | "markdown" | "none";
683
+ interface ContextBuildOptions {
684
+ tagStyle?: TagStyle;
685
+ }
686
+ interface ContextPipelineResult {
687
+ blocks: ContextBlock[];
688
+ rendered: string;
689
+ }
690
+
691
+ declare class ContextPipeline {
692
+ private blocks;
693
+ addBlock(tag: string, content: string, priority?: number): void;
694
+ addProjectDoc(cwd: string): Promise<void>;
695
+ /**
696
+ * Walk from projectRoot to cwd, collecting AGENTS.md files.
697
+ * Deeper files override shallower ones (later blocks have higher priority).
698
+ */
699
+ addHierarchicalDocs(cwd: string, projectRoot?: string): Promise<void>;
700
+ addSkillsSummary(config: HarnessConfig, cwd: string): Promise<void>;
701
+ addCustomRules(rules: string[]): void;
702
+ addRaw(tag: string, content: string, priority?: number): void;
703
+ build(options?: ContextBuildOptions): ContextPipelineResult;
704
+ clear(): void;
705
+ }
706
+
707
+ type HookEventName = "setup.pre" | "setup.post" | "update.pre" | "update.post" | "doctor.pre" | "doctor.post" | "verify.pre" | "verify.post" | "scaffold.pre" | "scaffold.post" | "skill.discovered" | "config.loaded";
708
+ interface HookPayload {
709
+ event: HookEventName;
710
+ timestamp: string;
711
+ cwd: string;
712
+ data?: Record<string, unknown>;
713
+ }
714
+ interface HookHandler {
715
+ event: HookEventName;
716
+ command: string;
717
+ matcher?: string;
718
+ }
719
+ interface HookResult {
720
+ handler: HookHandler;
721
+ exitCode: number;
722
+ stdout: string;
723
+ stderr: string;
724
+ durationMs: number;
725
+ }
726
+ interface HooksConfig {
727
+ hooks?: HookHandler[];
728
+ }
729
+
730
+ type FeatureStage = "stable" | "experimental" | "deprecated" | "removed";
731
+ interface FeatureSpec {
732
+ id: string;
733
+ key: string;
734
+ stage: FeatureStage;
735
+ defaultEnabled: boolean;
736
+ description: string;
737
+ }
738
+
739
+ interface HarnessPlugin {
740
+ name: string;
741
+ version?: string;
742
+ description?: string;
743
+ adapters?: ProjectAdapter[];
744
+ agents?: AgentDefinition[];
745
+ hooks?: HookHandler[];
746
+ healthChecks?: HealthCheck[];
747
+ features?: FeatureSpec[];
748
+ skillDirectories?: string[];
749
+ }
750
+
751
+ declare class PluginRegistry {
752
+ private plugins;
753
+ register(plugin: HarnessPlugin): void;
754
+ get(name: string): HarnessPlugin | undefined;
755
+ list(): HarnessPlugin[];
756
+ collectAdapters(): ProjectAdapter[];
757
+ collectAgents(): AgentDefinition[];
758
+ collectHooks(): HookHandler[];
759
+ collectHealthChecks(): HealthCheck[];
760
+ collectFeatures(): FeatureSpec[];
761
+ collectSkillDirectories(): string[];
762
+ count(): number;
763
+ }
764
+
765
+ declare class FeatureRegistry {
766
+ private specs;
767
+ private overrides;
768
+ private aliases;
769
+ private aliasUsages;
770
+ register(spec: FeatureSpec): void;
771
+ registerMany(specs: FeatureSpec[]): void;
772
+ registerAlias(legacyKey: string, featureId: string): void;
773
+ registerAliases(aliasMap: Record<string, string>): void;
774
+ applyOverrides(overrides: Record<string, boolean>): void;
775
+ isEnabled(id: string): boolean;
776
+ get(id: string): FeatureSpec | undefined;
777
+ list(): FeatureSpec[];
778
+ listByStage(stage: FeatureStage): FeatureSpec[];
779
+ listEnabled(): FeatureSpec[];
780
+ count(): {
781
+ total: number;
782
+ enabled: number;
783
+ disabled: number;
784
+ };
785
+ getAliasUsages(): string[];
786
+ private resolveAlias;
787
+ private findByKey;
788
+ }
789
+
790
+ declare function discoverHooks(cwd: string): Promise<HookHandler[]>;
791
+
792
+ declare class HookDispatcher {
793
+ private handlers;
794
+ constructor(handlers: HookHandler[]);
795
+ dispatch(event: HookEventName, cwd: string, data?: Record<string, unknown>): Promise<HookResult[]>;
796
+ hasHandlers(event: HookEventName): boolean;
797
+ }
798
+
799
+ type RuntimeTaskSource = "adapter" | "workflow";
800
+ interface RuntimeTask {
801
+ name: string;
802
+ command: string;
803
+ description: string;
804
+ source: RuntimeTaskSource;
805
+ adapterName?: string;
806
+ }
807
+ interface RuntimeFeatureState {
808
+ spec: FeatureSpec;
809
+ enabled: boolean;
810
+ configured: boolean;
811
+ configuredValue?: boolean;
812
+ }
813
+ interface CreateHarnessRuntimeOptions {
814
+ cwd?: string;
815
+ requireProjectConfig?: boolean;
816
+ }
817
+ interface BuildContextOptions {
818
+ tagStyle?: TagStyle;
819
+ includeSkills?: boolean;
820
+ includeCustomRules?: boolean;
821
+ }
822
+ interface WriteContextOptions extends BuildContextOptions {
823
+ outputPath: string;
824
+ }
825
+ declare class HarnessRuntime {
826
+ readonly cwd: string;
827
+ readonly hasProjectConfig: boolean;
828
+ readonly hasAnyConfig: boolean;
829
+ readonly config?: HarnessConfig;
830
+ readonly adapter: ProjectAdapter | null;
831
+ readonly agentRegistry: AgentRegistry;
832
+ readonly featureRegistry: FeatureRegistry;
833
+ private readonly hookDispatcher;
834
+ private readonly auditLogger;
835
+ private constructor();
836
+ static create(opts?: CreateHarnessRuntimeOptions): Promise<HarnessRuntime>;
837
+ listTasks(): RuntimeTask[];
838
+ getTask(name: string): RuntimeTask | undefined;
839
+ listFeatureStates(): RuntimeFeatureState[];
840
+ dispatchHooks(event: HookEventName, data?: Record<string, unknown>): Promise<HookResult[]>;
841
+ log(kind: AuditEventKind, message: string, data?: Record<string, unknown>): Promise<void>;
842
+ buildContext(opts?: BuildContextOptions): Promise<ContextPipelineResult>;
843
+ writeContext(opts: WriteContextOptions): Promise<ContextPipelineResult>;
844
+ }
845
+
846
+ export { AdapterRegistry, type AgentDefinition, AgentRegistry, type AuditEntry, type AuditEventKind, AuditLogger, BUILT_IN_AGENTS, type BuildContextOptions, type CommandDefinition, type ConfigLayer, type ContextBlock, type ContextBuildOptions, ContextPipeline, type ContextPipelineResult, type CreateHarnessRuntimeOptions, DEFAULT_SKILL_DIRECTORIES, DEFAULT_VERIFICATION_CHECKS, FeatureRegistry, type FeatureSpec, type FeatureStage, type HarnessConfig, type HarnessPlugin, HarnessRuntime, type HealthCheck, type HealthCheckResult, type HealthReport, type HealthReportEntry, HookDispatcher, type HookEventName, type HookHandler, type HookPayload, type HookResult, type HooksConfig, type LoadConfigOptions, type LoadConfigResult, type ModelRouting, type ModelTier, PluginRegistry, type ProjectAdapter, PythonAdapter, type RuntimeFeatureState, type RuntimeTask, type RuntimeTaskSource, RustAdapter, type ScaffoldOptions, type SkillInfo, type SkillValidationResult, type TagStyle, type TaskComplexity, type TemplateContext, TypeScriptAdapter, type WriteContextOptions, agentDefinitionSchema, agentsConfigSchema, anyConfigExists, configExists, detectLanguage, detectProjectType, discoverHooks, discoverSkills, featuresConfigSchema, formatReport, harnessConfigSchema, inferComplexity, listSkillDirectories, loadConfig, loadConfigWithLayers, modelTierSchema, projectConfigExists, projectConfigSchema, providerMappingSchema, render, renderDirectory, renderFile, routeModel, runHealthChecks, scaffoldSkill, skillsConfigSchema, templatesConfigSchema, userConfigExists, validateSkill, verificationConfigSchema, verificationStageSchema, workflowsConfigSchema };