@michaelfromyeg/weft-schema 1.0.0 → 1.1.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/dist/index.d.ts +174 -45
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,21 @@ import * as zod_v4_core from 'zod/v4/core';
|
|
|
2
2
|
import * as zod from 'zod';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The coding-agent harnesses Weft compiles to. The first five have full,
|
|
7
|
+
* dedicated adapters (skills + MCP + agents + hooks + commands); the rest are
|
|
8
|
+
* skills-only directory-convention harnesses served by a generic adapter.
|
|
9
|
+
*/
|
|
6
10
|
declare const Target: z.ZodEnum<{
|
|
7
11
|
claude: "claude";
|
|
8
12
|
codex: "codex";
|
|
9
13
|
cursor: "cursor";
|
|
10
14
|
copilot: "copilot";
|
|
11
15
|
opencode: "opencode";
|
|
16
|
+
zed: "zed";
|
|
17
|
+
gemini: "gemini";
|
|
18
|
+
amp: "amp";
|
|
19
|
+
aider: "aider";
|
|
12
20
|
}>;
|
|
13
21
|
type Target = z.infer<typeof Target>;
|
|
14
22
|
declare const ALL_TARGETS: readonly Target[];
|
|
@@ -40,6 +48,10 @@ declare const SkillComponent: z.ZodObject<{
|
|
|
40
48
|
cursor: "cursor";
|
|
41
49
|
copilot: "copilot";
|
|
42
50
|
opencode: "opencode";
|
|
51
|
+
zed: "zed";
|
|
52
|
+
gemini: "gemini";
|
|
53
|
+
amp: "amp";
|
|
54
|
+
aider: "aider";
|
|
43
55
|
}>>>;
|
|
44
56
|
evals: z.ZodOptional<z.ZodString>;
|
|
45
57
|
}, z.core.$strict>;
|
|
@@ -58,6 +70,10 @@ declare const McpComponent: z.ZodObject<{
|
|
|
58
70
|
cursor: "cursor";
|
|
59
71
|
copilot: "copilot";
|
|
60
72
|
opencode: "opencode";
|
|
73
|
+
zed: "zed";
|
|
74
|
+
gemini: "gemini";
|
|
75
|
+
amp: "amp";
|
|
76
|
+
aider: "aider";
|
|
61
77
|
}>>>;
|
|
62
78
|
evals: z.ZodOptional<z.ZodString>;
|
|
63
79
|
}, z.core.$strict>;
|
|
@@ -69,6 +85,10 @@ declare const AgentComponent: z.ZodObject<{
|
|
|
69
85
|
cursor: "cursor";
|
|
70
86
|
copilot: "copilot";
|
|
71
87
|
opencode: "opencode";
|
|
88
|
+
zed: "zed";
|
|
89
|
+
gemini: "gemini";
|
|
90
|
+
amp: "amp";
|
|
91
|
+
aider: "aider";
|
|
72
92
|
}>>>;
|
|
73
93
|
evals: z.ZodOptional<z.ZodString>;
|
|
74
94
|
}, z.core.$strict>;
|
|
@@ -80,6 +100,10 @@ declare const HookComponent: z.ZodObject<{
|
|
|
80
100
|
cursor: "cursor";
|
|
81
101
|
copilot: "copilot";
|
|
82
102
|
opencode: "opencode";
|
|
103
|
+
zed: "zed";
|
|
104
|
+
gemini: "gemini";
|
|
105
|
+
amp: "amp";
|
|
106
|
+
aider: "aider";
|
|
83
107
|
}>>>;
|
|
84
108
|
evals: z.ZodOptional<z.ZodString>;
|
|
85
109
|
}, z.core.$strict>;
|
|
@@ -91,6 +115,10 @@ declare const CommandComponent: z.ZodObject<{
|
|
|
91
115
|
cursor: "cursor";
|
|
92
116
|
copilot: "copilot";
|
|
93
117
|
opencode: "opencode";
|
|
118
|
+
zed: "zed";
|
|
119
|
+
gemini: "gemini";
|
|
120
|
+
amp: "amp";
|
|
121
|
+
aider: "aider";
|
|
94
122
|
}>>>;
|
|
95
123
|
evals: z.ZodOptional<z.ZodString>;
|
|
96
124
|
}, z.core.$strict>;
|
|
@@ -103,6 +131,10 @@ declare const PassthroughComponent: z.ZodObject<{
|
|
|
103
131
|
cursor: "cursor";
|
|
104
132
|
copilot: "copilot";
|
|
105
133
|
opencode: "opencode";
|
|
134
|
+
zed: "zed";
|
|
135
|
+
gemini: "gemini";
|
|
136
|
+
amp: "amp";
|
|
137
|
+
aider: "aider";
|
|
106
138
|
}>;
|
|
107
139
|
kind: z.ZodEnum<{
|
|
108
140
|
hook: "hook";
|
|
@@ -120,6 +152,10 @@ declare const Component: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
120
152
|
cursor: "cursor";
|
|
121
153
|
copilot: "copilot";
|
|
122
154
|
opencode: "opencode";
|
|
155
|
+
zed: "zed";
|
|
156
|
+
gemini: "gemini";
|
|
157
|
+
amp: "amp";
|
|
158
|
+
aider: "aider";
|
|
123
159
|
}>>>;
|
|
124
160
|
evals: z.ZodOptional<z.ZodString>;
|
|
125
161
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -137,6 +173,10 @@ declare const Component: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
137
173
|
cursor: "cursor";
|
|
138
174
|
copilot: "copilot";
|
|
139
175
|
opencode: "opencode";
|
|
176
|
+
zed: "zed";
|
|
177
|
+
gemini: "gemini";
|
|
178
|
+
amp: "amp";
|
|
179
|
+
aider: "aider";
|
|
140
180
|
}>>>;
|
|
141
181
|
evals: z.ZodOptional<z.ZodString>;
|
|
142
182
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -147,6 +187,10 @@ declare const Component: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
147
187
|
cursor: "cursor";
|
|
148
188
|
copilot: "copilot";
|
|
149
189
|
opencode: "opencode";
|
|
190
|
+
zed: "zed";
|
|
191
|
+
gemini: "gemini";
|
|
192
|
+
amp: "amp";
|
|
193
|
+
aider: "aider";
|
|
150
194
|
}>>>;
|
|
151
195
|
evals: z.ZodOptional<z.ZodString>;
|
|
152
196
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -157,6 +201,10 @@ declare const Component: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
157
201
|
cursor: "cursor";
|
|
158
202
|
copilot: "copilot";
|
|
159
203
|
opencode: "opencode";
|
|
204
|
+
zed: "zed";
|
|
205
|
+
gemini: "gemini";
|
|
206
|
+
amp: "amp";
|
|
207
|
+
aider: "aider";
|
|
160
208
|
}>>>;
|
|
161
209
|
evals: z.ZodOptional<z.ZodString>;
|
|
162
210
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -167,6 +215,10 @@ declare const Component: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
167
215
|
cursor: "cursor";
|
|
168
216
|
copilot: "copilot";
|
|
169
217
|
opencode: "opencode";
|
|
218
|
+
zed: "zed";
|
|
219
|
+
gemini: "gemini";
|
|
220
|
+
amp: "amp";
|
|
221
|
+
aider: "aider";
|
|
170
222
|
}>>>;
|
|
171
223
|
evals: z.ZodOptional<z.ZodString>;
|
|
172
224
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -177,6 +229,10 @@ declare const Component: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
177
229
|
cursor: "cursor";
|
|
178
230
|
copilot: "copilot";
|
|
179
231
|
opencode: "opencode";
|
|
232
|
+
zed: "zed";
|
|
233
|
+
gemini: "gemini";
|
|
234
|
+
amp: "amp";
|
|
235
|
+
aider: "aider";
|
|
180
236
|
}>;
|
|
181
237
|
kind: z.ZodEnum<{
|
|
182
238
|
hook: "hook";
|
|
@@ -222,6 +278,10 @@ declare const Plugin: z.ZodObject<{
|
|
|
222
278
|
cursor: "cursor";
|
|
223
279
|
copilot: "copilot";
|
|
224
280
|
opencode: "opencode";
|
|
281
|
+
zed: "zed";
|
|
282
|
+
gemini: "gemini";
|
|
283
|
+
amp: "amp";
|
|
284
|
+
aider: "aider";
|
|
225
285
|
}>>>;
|
|
226
286
|
evals: z.ZodOptional<z.ZodString>;
|
|
227
287
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -239,6 +299,10 @@ declare const Plugin: z.ZodObject<{
|
|
|
239
299
|
cursor: "cursor";
|
|
240
300
|
copilot: "copilot";
|
|
241
301
|
opencode: "opencode";
|
|
302
|
+
zed: "zed";
|
|
303
|
+
gemini: "gemini";
|
|
304
|
+
amp: "amp";
|
|
305
|
+
aider: "aider";
|
|
242
306
|
}>>>;
|
|
243
307
|
evals: z.ZodOptional<z.ZodString>;
|
|
244
308
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -249,6 +313,10 @@ declare const Plugin: z.ZodObject<{
|
|
|
249
313
|
cursor: "cursor";
|
|
250
314
|
copilot: "copilot";
|
|
251
315
|
opencode: "opencode";
|
|
316
|
+
zed: "zed";
|
|
317
|
+
gemini: "gemini";
|
|
318
|
+
amp: "amp";
|
|
319
|
+
aider: "aider";
|
|
252
320
|
}>>>;
|
|
253
321
|
evals: z.ZodOptional<z.ZodString>;
|
|
254
322
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -259,6 +327,10 @@ declare const Plugin: z.ZodObject<{
|
|
|
259
327
|
cursor: "cursor";
|
|
260
328
|
copilot: "copilot";
|
|
261
329
|
opencode: "opencode";
|
|
330
|
+
zed: "zed";
|
|
331
|
+
gemini: "gemini";
|
|
332
|
+
amp: "amp";
|
|
333
|
+
aider: "aider";
|
|
262
334
|
}>>>;
|
|
263
335
|
evals: z.ZodOptional<z.ZodString>;
|
|
264
336
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -269,6 +341,10 @@ declare const Plugin: z.ZodObject<{
|
|
|
269
341
|
cursor: "cursor";
|
|
270
342
|
copilot: "copilot";
|
|
271
343
|
opencode: "opencode";
|
|
344
|
+
zed: "zed";
|
|
345
|
+
gemini: "gemini";
|
|
346
|
+
amp: "amp";
|
|
347
|
+
aider: "aider";
|
|
272
348
|
}>>>;
|
|
273
349
|
evals: z.ZodOptional<z.ZodString>;
|
|
274
350
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -279,6 +355,10 @@ declare const Plugin: z.ZodObject<{
|
|
|
279
355
|
cursor: "cursor";
|
|
280
356
|
copilot: "copilot";
|
|
281
357
|
opencode: "opencode";
|
|
358
|
+
zed: "zed";
|
|
359
|
+
gemini: "gemini";
|
|
360
|
+
amp: "amp";
|
|
361
|
+
aider: "aider";
|
|
282
362
|
}>;
|
|
283
363
|
kind: z.ZodEnum<{
|
|
284
364
|
hook: "hook";
|
|
@@ -326,6 +406,10 @@ declare function schemaForKind(kind: ComponentKind): zod.ZodObject<{
|
|
|
326
406
|
cursor: "cursor";
|
|
327
407
|
copilot: "copilot";
|
|
328
408
|
opencode: "opencode";
|
|
409
|
+
zed: "zed";
|
|
410
|
+
gemini: "gemini";
|
|
411
|
+
amp: "amp";
|
|
412
|
+
aider: "aider";
|
|
329
413
|
}>>>;
|
|
330
414
|
evals: zod.ZodOptional<zod.ZodString>;
|
|
331
415
|
}, zod_v4_core.$strict> | zod.ZodObject<{
|
|
@@ -343,6 +427,10 @@ declare function schemaForKind(kind: ComponentKind): zod.ZodObject<{
|
|
|
343
427
|
cursor: "cursor";
|
|
344
428
|
copilot: "copilot";
|
|
345
429
|
opencode: "opencode";
|
|
430
|
+
zed: "zed";
|
|
431
|
+
gemini: "gemini";
|
|
432
|
+
amp: "amp";
|
|
433
|
+
aider: "aider";
|
|
346
434
|
}>>>;
|
|
347
435
|
evals: zod.ZodOptional<zod.ZodString>;
|
|
348
436
|
}, zod_v4_core.$strict> | zod.ZodObject<{
|
|
@@ -353,6 +441,10 @@ declare function schemaForKind(kind: ComponentKind): zod.ZodObject<{
|
|
|
353
441
|
cursor: "cursor";
|
|
354
442
|
copilot: "copilot";
|
|
355
443
|
opencode: "opencode";
|
|
444
|
+
zed: "zed";
|
|
445
|
+
gemini: "gemini";
|
|
446
|
+
amp: "amp";
|
|
447
|
+
aider: "aider";
|
|
356
448
|
}>>>;
|
|
357
449
|
evals: zod.ZodOptional<zod.ZodString>;
|
|
358
450
|
}, zod_v4_core.$strict> | zod.ZodObject<{
|
|
@@ -363,6 +455,10 @@ declare function schemaForKind(kind: ComponentKind): zod.ZodObject<{
|
|
|
363
455
|
cursor: "cursor";
|
|
364
456
|
copilot: "copilot";
|
|
365
457
|
opencode: "opencode";
|
|
458
|
+
zed: "zed";
|
|
459
|
+
gemini: "gemini";
|
|
460
|
+
amp: "amp";
|
|
461
|
+
aider: "aider";
|
|
366
462
|
}>>>;
|
|
367
463
|
evals: zod.ZodOptional<zod.ZodString>;
|
|
368
464
|
}, zod_v4_core.$strict> | zod.ZodObject<{
|
|
@@ -373,6 +469,10 @@ declare function schemaForKind(kind: ComponentKind): zod.ZodObject<{
|
|
|
373
469
|
cursor: "cursor";
|
|
374
470
|
copilot: "copilot";
|
|
375
471
|
opencode: "opencode";
|
|
472
|
+
zed: "zed";
|
|
473
|
+
gemini: "gemini";
|
|
474
|
+
amp: "amp";
|
|
475
|
+
aider: "aider";
|
|
376
476
|
}>>>;
|
|
377
477
|
evals: zod.ZodOptional<zod.ZodString>;
|
|
378
478
|
}, zod_v4_core.$strict> | zod.ZodObject<{
|
|
@@ -383,6 +483,10 @@ declare function schemaForKind(kind: ComponentKind): zod.ZodObject<{
|
|
|
383
483
|
cursor: "cursor";
|
|
384
484
|
copilot: "copilot";
|
|
385
485
|
opencode: "opencode";
|
|
486
|
+
zed: "zed";
|
|
487
|
+
gemini: "gemini";
|
|
488
|
+
amp: "amp";
|
|
489
|
+
aider: "aider";
|
|
386
490
|
}>;
|
|
387
491
|
kind: zod.ZodEnum<{
|
|
388
492
|
hook: "hook";
|
|
@@ -421,6 +525,7 @@ declare const OutputAssert: z.ZodObject<{
|
|
|
421
525
|
matches: z.ZodOptional<z.ZodString>;
|
|
422
526
|
jsonSchema: z.ZodOptional<z.ZodString>;
|
|
423
527
|
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
528
|
+
minPassRate: z.ZodDefault<z.ZodNumber>;
|
|
424
529
|
}, z.core.$strip>;
|
|
425
530
|
type OutputAssert = z.infer<typeof OutputAssert>;
|
|
426
531
|
declare const JudgeAssert: z.ZodObject<{
|
|
@@ -455,6 +560,7 @@ declare const Assertion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
455
560
|
matches: z.ZodOptional<z.ZodString>;
|
|
456
561
|
jsonSchema: z.ZodOptional<z.ZodString>;
|
|
457
562
|
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
563
|
+
minPassRate: z.ZodDefault<z.ZodNumber>;
|
|
458
564
|
}, z.core.$strip>, z.ZodObject<{
|
|
459
565
|
kind: z.ZodLiteral<"judge">;
|
|
460
566
|
rubric: z.ZodString;
|
|
@@ -492,6 +598,7 @@ declare const Case: z.ZodObject<{
|
|
|
492
598
|
matches: z.ZodOptional<z.ZodString>;
|
|
493
599
|
jsonSchema: z.ZodOptional<z.ZodString>;
|
|
494
600
|
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
601
|
+
minPassRate: z.ZodDefault<z.ZodNumber>;
|
|
495
602
|
}, z.core.$strip>, z.ZodObject<{
|
|
496
603
|
kind: z.ZodLiteral<"judge">;
|
|
497
604
|
rubric: z.ZodString;
|
|
@@ -519,6 +626,10 @@ declare const EvalFile: z.ZodObject<{
|
|
|
519
626
|
cursor: "cursor";
|
|
520
627
|
copilot: "copilot";
|
|
521
628
|
opencode: "opencode";
|
|
629
|
+
zed: "zed";
|
|
630
|
+
gemini: "gemini";
|
|
631
|
+
amp: "amp";
|
|
632
|
+
aider: "aider";
|
|
522
633
|
}>>;
|
|
523
634
|
cases: z.ZodArray<z.ZodObject<{
|
|
524
635
|
name: z.ZodString;
|
|
@@ -540,6 +651,7 @@ declare const EvalFile: z.ZodObject<{
|
|
|
540
651
|
matches: z.ZodOptional<z.ZodString>;
|
|
541
652
|
jsonSchema: z.ZodOptional<z.ZodString>;
|
|
542
653
|
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
654
|
+
minPassRate: z.ZodDefault<z.ZodNumber>;
|
|
543
655
|
}, z.core.$strip>, z.ZodObject<{
|
|
544
656
|
kind: z.ZodLiteral<"judge">;
|
|
545
657
|
rubric: z.ZodString;
|
|
@@ -586,6 +698,10 @@ declare const IndexVersion: z.ZodObject<{
|
|
|
586
698
|
cursor: "cursor";
|
|
587
699
|
copilot: "copilot";
|
|
588
700
|
opencode: "opencode";
|
|
701
|
+
zed: "zed";
|
|
702
|
+
gemini: "gemini";
|
|
703
|
+
amp: "amp";
|
|
704
|
+
aider: "aider";
|
|
589
705
|
}>>;
|
|
590
706
|
}, z.core.$strip>;
|
|
591
707
|
type IndexVersion = z.infer<typeof IndexVersion>;
|
|
@@ -609,6 +725,10 @@ declare const IndexEntry: z.ZodObject<{
|
|
|
609
725
|
cursor: "cursor";
|
|
610
726
|
copilot: "copilot";
|
|
611
727
|
opencode: "opencode";
|
|
728
|
+
zed: "zed";
|
|
729
|
+
gemini: "gemini";
|
|
730
|
+
amp: "amp";
|
|
731
|
+
aider: "aider";
|
|
612
732
|
}>>;
|
|
613
733
|
}, z.core.$strip>>;
|
|
614
734
|
telemetry: z.ZodOptional<z.ZodObject<{
|
|
@@ -640,6 +760,10 @@ declare const IndexFile: z.ZodObject<{
|
|
|
640
760
|
cursor: "cursor";
|
|
641
761
|
copilot: "copilot";
|
|
642
762
|
opencode: "opencode";
|
|
763
|
+
zed: "zed";
|
|
764
|
+
gemini: "gemini";
|
|
765
|
+
amp: "amp";
|
|
766
|
+
aider: "aider";
|
|
643
767
|
}>>;
|
|
644
768
|
}, z.core.$strip>>;
|
|
645
769
|
telemetry: z.ZodOptional<z.ZodObject<{
|
|
@@ -675,6 +799,10 @@ declare const SCHEMAS: {
|
|
|
675
799
|
cursor: "cursor";
|
|
676
800
|
copilot: "copilot";
|
|
677
801
|
opencode: "opencode";
|
|
802
|
+
zed: "zed";
|
|
803
|
+
gemini: "gemini";
|
|
804
|
+
amp: "amp";
|
|
805
|
+
aider: "aider";
|
|
678
806
|
}>>>;
|
|
679
807
|
evals: z.ZodOptional<z.ZodString>;
|
|
680
808
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -692,6 +820,10 @@ declare const SCHEMAS: {
|
|
|
692
820
|
cursor: "cursor";
|
|
693
821
|
copilot: "copilot";
|
|
694
822
|
opencode: "opencode";
|
|
823
|
+
zed: "zed";
|
|
824
|
+
gemini: "gemini";
|
|
825
|
+
amp: "amp";
|
|
826
|
+
aider: "aider";
|
|
695
827
|
}>>>;
|
|
696
828
|
evals: z.ZodOptional<z.ZodString>;
|
|
697
829
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -702,6 +834,10 @@ declare const SCHEMAS: {
|
|
|
702
834
|
cursor: "cursor";
|
|
703
835
|
copilot: "copilot";
|
|
704
836
|
opencode: "opencode";
|
|
837
|
+
zed: "zed";
|
|
838
|
+
gemini: "gemini";
|
|
839
|
+
amp: "amp";
|
|
840
|
+
aider: "aider";
|
|
705
841
|
}>>>;
|
|
706
842
|
evals: z.ZodOptional<z.ZodString>;
|
|
707
843
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -712,6 +848,10 @@ declare const SCHEMAS: {
|
|
|
712
848
|
cursor: "cursor";
|
|
713
849
|
copilot: "copilot";
|
|
714
850
|
opencode: "opencode";
|
|
851
|
+
zed: "zed";
|
|
852
|
+
gemini: "gemini";
|
|
853
|
+
amp: "amp";
|
|
854
|
+
aider: "aider";
|
|
715
855
|
}>>>;
|
|
716
856
|
evals: z.ZodOptional<z.ZodString>;
|
|
717
857
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -722,6 +862,10 @@ declare const SCHEMAS: {
|
|
|
722
862
|
cursor: "cursor";
|
|
723
863
|
copilot: "copilot";
|
|
724
864
|
opencode: "opencode";
|
|
865
|
+
zed: "zed";
|
|
866
|
+
gemini: "gemini";
|
|
867
|
+
amp: "amp";
|
|
868
|
+
aider: "aider";
|
|
725
869
|
}>>>;
|
|
726
870
|
evals: z.ZodOptional<z.ZodString>;
|
|
727
871
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -732,6 +876,10 @@ declare const SCHEMAS: {
|
|
|
732
876
|
cursor: "cursor";
|
|
733
877
|
copilot: "copilot";
|
|
734
878
|
opencode: "opencode";
|
|
879
|
+
zed: "zed";
|
|
880
|
+
gemini: "gemini";
|
|
881
|
+
amp: "amp";
|
|
882
|
+
aider: "aider";
|
|
735
883
|
}>;
|
|
736
884
|
kind: z.ZodEnum<{
|
|
737
885
|
hook: "hook";
|
|
@@ -794,6 +942,10 @@ declare const SCHEMAS: {
|
|
|
794
942
|
cursor: "cursor";
|
|
795
943
|
copilot: "copilot";
|
|
796
944
|
opencode: "opencode";
|
|
945
|
+
zed: "zed";
|
|
946
|
+
gemini: "gemini";
|
|
947
|
+
amp: "amp";
|
|
948
|
+
aider: "aider";
|
|
797
949
|
}>;
|
|
798
950
|
scope: z.ZodEnum<{
|
|
799
951
|
user: "user";
|
|
@@ -807,28 +959,10 @@ declare const SCHEMAS: {
|
|
|
807
959
|
}>;
|
|
808
960
|
enabled: z.ZodBoolean;
|
|
809
961
|
}, z.core.$strip>>;
|
|
810
|
-
adapters: z.ZodObject<{
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}, z.core.$strip>>>;
|
|
815
|
-
codex: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
816
|
-
version: z.ZodString;
|
|
817
|
-
targetSchema: z.ZodString;
|
|
818
|
-
}, z.core.$strip>>>;
|
|
819
|
-
cursor: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
820
|
-
version: z.ZodString;
|
|
821
|
-
targetSchema: z.ZodString;
|
|
822
|
-
}, z.core.$strip>>>;
|
|
823
|
-
copilot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
824
|
-
version: z.ZodString;
|
|
825
|
-
targetSchema: z.ZodString;
|
|
826
|
-
}, z.core.$strip>>>;
|
|
827
|
-
opencode: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
828
|
-
version: z.ZodString;
|
|
829
|
-
targetSchema: z.ZodString;
|
|
830
|
-
}, z.core.$strip>>>;
|
|
831
|
-
}, z.core.$strip>;
|
|
962
|
+
adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
963
|
+
version: z.ZodString;
|
|
964
|
+
targetSchema: z.ZodString;
|
|
965
|
+
}, z.core.$strip>>;
|
|
832
966
|
}, z.core.$strip>;
|
|
833
967
|
readonly "cases.yaml": z.ZodObject<{
|
|
834
968
|
component: z.ZodString;
|
|
@@ -838,6 +972,10 @@ declare const SCHEMAS: {
|
|
|
838
972
|
cursor: "cursor";
|
|
839
973
|
copilot: "copilot";
|
|
840
974
|
opencode: "opencode";
|
|
975
|
+
zed: "zed";
|
|
976
|
+
gemini: "gemini";
|
|
977
|
+
amp: "amp";
|
|
978
|
+
aider: "aider";
|
|
841
979
|
}>>;
|
|
842
980
|
cases: z.ZodArray<z.ZodObject<{
|
|
843
981
|
name: z.ZodString;
|
|
@@ -859,6 +997,7 @@ declare const SCHEMAS: {
|
|
|
859
997
|
matches: z.ZodOptional<z.ZodString>;
|
|
860
998
|
jsonSchema: z.ZodOptional<z.ZodString>;
|
|
861
999
|
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
1000
|
+
minPassRate: z.ZodDefault<z.ZodNumber>;
|
|
862
1001
|
}, z.core.$strip>, z.ZodObject<{
|
|
863
1002
|
kind: z.ZodLiteral<"judge">;
|
|
864
1003
|
rubric: z.ZodString;
|
|
@@ -898,6 +1037,10 @@ declare const ArtifactRecord: z.ZodObject<{
|
|
|
898
1037
|
cursor: "cursor";
|
|
899
1038
|
copilot: "copilot";
|
|
900
1039
|
opencode: "opencode";
|
|
1040
|
+
zed: "zed";
|
|
1041
|
+
gemini: "gemini";
|
|
1042
|
+
amp: "amp";
|
|
1043
|
+
aider: "aider";
|
|
901
1044
|
}>;
|
|
902
1045
|
scope: z.ZodEnum<{
|
|
903
1046
|
user: "user";
|
|
@@ -959,6 +1102,10 @@ declare const Lockfile: z.ZodObject<{
|
|
|
959
1102
|
cursor: "cursor";
|
|
960
1103
|
copilot: "copilot";
|
|
961
1104
|
opencode: "opencode";
|
|
1105
|
+
zed: "zed";
|
|
1106
|
+
gemini: "gemini";
|
|
1107
|
+
amp: "amp";
|
|
1108
|
+
aider: "aider";
|
|
962
1109
|
}>;
|
|
963
1110
|
scope: z.ZodEnum<{
|
|
964
1111
|
user: "user";
|
|
@@ -972,28 +1119,10 @@ declare const Lockfile: z.ZodObject<{
|
|
|
972
1119
|
}>;
|
|
973
1120
|
enabled: z.ZodBoolean;
|
|
974
1121
|
}, z.core.$strip>>;
|
|
975
|
-
adapters: z.ZodObject<{
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
}, z.core.$strip>>>;
|
|
980
|
-
codex: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
981
|
-
version: z.ZodString;
|
|
982
|
-
targetSchema: z.ZodString;
|
|
983
|
-
}, z.core.$strip>>>;
|
|
984
|
-
cursor: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
985
|
-
version: z.ZodString;
|
|
986
|
-
targetSchema: z.ZodString;
|
|
987
|
-
}, z.core.$strip>>>;
|
|
988
|
-
copilot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
989
|
-
version: z.ZodString;
|
|
990
|
-
targetSchema: z.ZodString;
|
|
991
|
-
}, z.core.$strip>>>;
|
|
992
|
-
opencode: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
993
|
-
version: z.ZodString;
|
|
994
|
-
targetSchema: z.ZodString;
|
|
995
|
-
}, z.core.$strip>>>;
|
|
996
|
-
}, z.core.$strip>;
|
|
1122
|
+
adapters: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1123
|
+
version: z.ZodString;
|
|
1124
|
+
targetSchema: z.ZodString;
|
|
1125
|
+
}, z.core.$strip>>;
|
|
997
1126
|
}, z.core.$strip>;
|
|
998
1127
|
type Lockfile = z.infer<typeof Lockfile>;
|
|
999
1128
|
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,17 @@ import JSON5 from 'json5';
|
|
|
3
3
|
import * as YAML from 'yaml';
|
|
4
4
|
|
|
5
5
|
// src/plugin.ts
|
|
6
|
-
var Target = z.enum([
|
|
6
|
+
var Target = z.enum([
|
|
7
|
+
"claude",
|
|
8
|
+
"codex",
|
|
9
|
+
"cursor",
|
|
10
|
+
"copilot",
|
|
11
|
+
"opencode",
|
|
12
|
+
"zed",
|
|
13
|
+
"gemini",
|
|
14
|
+
"amp",
|
|
15
|
+
"aider"
|
|
16
|
+
]);
|
|
7
17
|
var ALL_TARGETS = Target.options;
|
|
8
18
|
var Namespace = z.string().regex(/^[a-z0-9]+(\.[a-z0-9]+)+$/, "namespace must be reverse-DNS, e.g. com.acme");
|
|
9
19
|
var Owner = z.object({
|
|
@@ -156,7 +166,9 @@ var OutputAssert = z.object({
|
|
|
156
166
|
equals: z.string().optional(),
|
|
157
167
|
matches: z.string().optional(),
|
|
158
168
|
jsonSchema: z.string().optional(),
|
|
159
|
-
tolerance: z.number().optional()
|
|
169
|
+
tolerance: z.number().optional(),
|
|
170
|
+
/** Fraction of `samples` that must match; <1 tolerates LLM variance. */
|
|
171
|
+
minPassRate: z.number().min(0).max(1).default(1)
|
|
160
172
|
});
|
|
161
173
|
var JudgeAssert = z.object({
|
|
162
174
|
kind: z.literal("judge"),
|
|
@@ -264,13 +276,8 @@ var Lockfile = z.object({
|
|
|
264
276
|
plugins: z.array(PluginLock),
|
|
265
277
|
/** Every placed artifact across all plugins; each tagged with its `plugin` id. */
|
|
266
278
|
artifacts: z.array(ArtifactRecord),
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
codex: AdapterRecord.optional(),
|
|
270
|
-
cursor: AdapterRecord.optional(),
|
|
271
|
-
copilot: AdapterRecord.optional(),
|
|
272
|
-
opencode: AdapterRecord.optional()
|
|
273
|
-
}).partial()
|
|
279
|
+
/** Adapter version + targetSchema used per target, keyed by target name. */
|
|
280
|
+
adapters: z.record(z.string(), AdapterRecord)
|
|
274
281
|
});
|
|
275
282
|
var MarketplaceEntry = z.object({
|
|
276
283
|
/** Same source forms as Dependency.plugin. */
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts","../src/component.ts","../src/evals.ts","../src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nC;AAChB,EAAA,IAAI,GAAA;AACJ,EAAA,IAAI;AACF,IAAA,GAAA,GAAM,cAAc,IAAA,EAAM,IAAA,CAAK,MAAA,IAAU,MAAA,EAAQ,KAAK,QAAQ,CAAA;AAAA,EAChE,SAAS,GAAA,EAAK;AACZ,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,EAAA,EAAI,OAAA,EAAS,CAAA,aAAA,EAAiB,GAAA,CAAc,OAAO,CAAA,CAAA,EAAI,CAAA,EAAE;AAAA,EAChG;AACA,EAAA,OAAO,QAAA,CAAS,QAAQ,GAAG,CAAA;AAC7B;AAGO,SAAS,UAAA,CACd,IAAA,EACA,IAAA,GAAkD,EAAC,EAC9B;AACrB,EAAA,IAAI,GAAA;AACJ,EAAA,IAAI;AACF,IAAA,GAAA,GAAM,cAAc,IAAA,EAAM,IAAA,CAAK,MAAA,IAAU,MAAA,EAAQ,KAAK,QAAQ,CAAA;AAAA,EAChE,SAAS,GAAA,EAAK;AACZ,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,EAAA,EAAI,OAAA,EAAS,CAAA,aAAA,EAAiB,GAAA,CAAc,OAAO,CAAA,CAAA,EAAI,CAAA,EAAE;AAAA,EAChG;AACA,EAAA,OAAO,YAAY,GAAG,CAAA;AACxB","file":"index.js","sourcesContent":["import { z } from \"zod\";\n\n/** The five coding-agent harnesses Weft compiles to. */\nexport const Target = z.enum([\"claude\", \"codex\", \"cursor\", \"copilot\", \"opencode\"]);\nexport type Target = z.infer<typeof Target>;\n\nexport const ALL_TARGETS: readonly Target[] = Target.options;\n\n/** Reverse-DNS namespace, e.g. `com.acme`. */\nexport const Namespace = z\n .string()\n .regex(/^[a-z0-9]+(\\.[a-z0-9]+)+$/, \"namespace must be reverse-DNS, e.g. com.acme\");\n\nexport const Owner = z.object({\n name: z.string(),\n namespace: Namespace,\n email: z.email().optional(),\n});\nexport type Owner = z.infer<typeof Owner>;\n\n/** A config value a component reads at runtime. Declared, never stored (§11). */\nexport const ConfigVar = z.object({\n env: z.string(),\n secret: z.boolean().default(false),\n prompt: z.string().optional(),\n default: z.string().optional(),\n required: z.boolean().default(true),\n});\nexport type ConfigVar = z.infer<typeof ConfigVar>;\n\nconst commonFields = {\n /** Which harnesses to emit for; default = all five. */\n targets: z.array(Target).optional(),\n /** Path to a `cases.yaml` eval file, relative to the plugin root. */\n evals: z.string().optional(),\n} as const;\n\n/** The seven primitive component kinds. `passthrough` is verbatim/single-target. */\nexport const COMPONENT_KINDS = [\"skill\", \"mcp\", \"agent\", \"hook\", \"command\", \"passthrough\"] as const;\nexport type ComponentKind = (typeof COMPONENT_KINDS)[number];\n\nexport const SkillComponent = z.strictObject({ ...commonFields, skill: z.string() });\nexport const McpComponent = z.strictObject({\n ...commonFields,\n mcp: z.string(),\n config: z.array(ConfigVar).optional(),\n});\nexport const AgentComponent = z.strictObject({ ...commonFields, agent: z.string() });\nexport const HookComponent = z.strictObject({ ...commonFields, hook: z.string() });\nexport const CommandComponent = z.strictObject({ ...commonFields, command: z.string() });\n\n/** A verbatim executable artifact bound to a single harness. Placed DISABLED. */\nexport const PassthroughComponent = z.strictObject({\n passthrough: z.string(),\n target: Target,\n kind: z.enum([\"hook\", \"plugin\", \"script\"]),\n default_enabled: z.boolean().default(false),\n /** Path to a `cases.yaml` eval file (a passthrough eval is a setup+verify check). */\n evals: z.string().optional(),\n});\n\nexport const Component = z.union([\n SkillComponent,\n McpComponent,\n AgentComponent,\n HookComponent,\n CommandComponent,\n PassthroughComponent,\n]);\nexport type Component = z.infer<typeof Component>;\n\n/** Source forms accepted for a plugin reference. */\nexport const Dependency = z.object({\n /** github:owner/repo | <git-url> | npm:<pkg> | ./path */\n plugin: z.string(),\n version: z.string().optional(),\n /** Piecemeal: pull only these leaf names (+ their shared/sibling assets). */\n components: z.array(z.string()).optional(),\n});\nexport type Dependency = z.infer<typeof Dependency>;\n\nexport const Trust = z.object({\n sign: z.boolean().default(false),\n scan: z.array(z.enum([\"schema\", \"security\"])).default([\"schema\"]),\n});\nexport type Trust = z.infer<typeof Trust>;\n\n/** `weft.yaml` — the single file an author writes. */\nexport const Plugin = z.object({\n name: z.string().regex(/^[a-z0-9-]+$/, \"plugin name must be kebab-case\"),\n version: z.string(),\n owner: Owner,\n description: z.string().optional(),\n license: z.string().optional(),\n weft_min_version: z.string().optional(),\n components: z.array(Component),\n depends: z.array(Dependency).optional(),\n trust: Trust.optional(),\n});\nexport type Plugin = z.infer<typeof Plugin>;\n","import {\n AgentComponent,\n CommandComponent,\n type Component,\n type ComponentKind,\n HookComponent,\n McpComponent,\n PassthroughComponent,\n SkillComponent,\n} from \"./plugin\";\n\n/** The key that names each component variant in `weft.yaml`. */\nconst KIND_KEYS: Record<ComponentKind, string> = {\n skill: \"skill\",\n mcp: \"mcp\",\n agent: \"agent\",\n hook: \"hook\",\n command: \"command\",\n passthrough: \"passthrough\",\n};\n\nconst VARIANT_SCHEMAS = {\n skill: SkillComponent,\n mcp: McpComponent,\n agent: AgentComponent,\n hook: HookComponent,\n command: CommandComponent,\n passthrough: PassthroughComponent,\n} as const;\n\nexport interface DetectedKind {\n kind: ComponentKind;\n}\n\n/**\n * Decide a component's kind from which discriminating key is present.\n * Returns an error string instead of throwing so callers can attach a path.\n */\nexport function detectComponentKind(\n raw: unknown,\n): { ok: true; kind: ComponentKind } | { ok: false; error: string } {\n if (typeof raw !== \"object\" || raw === null) {\n return { ok: false, error: \"component must be an object\" };\n }\n const present = (Object.keys(KIND_KEYS) as ComponentKind[]).filter(\n (kind) => KIND_KEYS[kind] in (raw as Record<string, unknown>),\n );\n if (present.length === 0) {\n return {\n ok: false,\n error: `component has no kind key (one of: ${Object.values(KIND_KEYS).join(\", \")})`,\n };\n }\n if (present.length > 1) {\n return {\n ok: false,\n error: `component has conflicting kind keys: ${present.join(\", \")}`,\n };\n }\n return { ok: true, kind: present[0] as ComponentKind };\n}\n\n/** The schema for a detected kind — used by the loader for path-precise errors. */\nexport function schemaForKind(kind: ComponentKind) {\n return VARIANT_SCHEMAS[kind];\n}\n\n/** The kind of an already-validated component. */\nexport function kindOf(component: Component): ComponentKind {\n const detected = detectComponentKind(component);\n if (!detected.ok) throw new Error(detected.error);\n return detected.kind;\n}\n\n/** The relative path (skill dir, mcp dir, hook file, …) this component points at. */\nexport function refOf(component: Component): string {\n const c = component as Record<string, unknown>;\n const kind = kindOf(component);\n return c[KIND_KEYS[kind]] as string;\n}\n\n/**\n * The leaf name used to build a fully-qualified id `{namespace}/{plugin}:{leaf}`.\n * Derived from the basename of the component's ref, stripping a known extension.\n */\nexport function leafNameOf(component: Component): string {\n const ref = refOf(component);\n const base = ref.split(\"/\").filter(Boolean).pop() ?? ref;\n return base.replace(/\\.(md|json|toml|ya?ml|ts|js|sh)$/i, \"\");\n}\n\n/** Harnesses this component targets, defaulting to all when unspecified. */\nexport function targetsOf(component: Component, all: readonly string[]): readonly string[] {\n if (\"target\" in component && typeof component.target === \"string\") {\n return [component.target];\n }\n if (\"targets\" in component && component.targets && component.targets.length > 0) {\n return component.targets;\n }\n return all;\n}\n\n/** Build the canonical fully-qualified id for a component. */\nexport function fqid(namespace: string, bundleName: string, leaf: string): string {\n return `${namespace}/${bundleName}:${leaf}`;\n}\n","import { z } from \"zod\";\nimport { Target } from \"./plugin\";\n\nconst TraceAssert = z.object({\n kind: z.literal(\"trace\"),\n toolCalled: z.string().optional(),\n toolNotCalled: z.string().optional(),\n /** Required call order. */\n sequence: z.array(z.string()).optional(),\n /** Path-efficiency ceiling. */\n maxCalls: z.number().optional(),\n minPassRate: z.number().min(0).max(1).default(1.0),\n});\nexport type TraceAssert = z.infer<typeof TraceAssert>;\n\nconst OutputAssert = z.object({\n kind: z.literal(\"output\"),\n equals: z.string().optional(),\n matches: z.string().optional(),\n jsonSchema: z.string().optional(),\n tolerance: z.number().optional(),\n});\nexport type OutputAssert = z.infer<typeof OutputAssert>;\n\nconst JudgeAssert = z.object({\n kind: z.literal(\"judge\"),\n rubric: z.string(),\n mode: z.enum([\"absolute\", \"pairwise\"]).default(\"pairwise\"),\n /** Required for pairwise. */\n reference: z.string().optional(),\n samples: z.number().default(3),\n /** Absolute mode only. */\n threshold: z.number().optional(),\n /** Advisory unless true. */\n gate: z.boolean().default(false),\n});\nexport type JudgeAssert = z.infer<typeof JudgeAssert>;\n\nconst DifferentialAssert = z.object({\n kind: z.literal(\"differential\"),\n baseline: z.string().default(\"last-release\"),\n noWorseThan: z.number().default(0.0),\n});\nexport type DifferentialAssert = z.infer<typeof DifferentialAssert>;\n\nexport const Assertion = z.discriminatedUnion(\"kind\", [\n TraceAssert,\n OutputAssert,\n JudgeAssert,\n DifferentialAssert,\n]);\nexport type Assertion = z.infer<typeof Assertion>;\n\nexport const Case = z.object({\n name: z.string(),\n prompt: z.string(),\n /** Shell, run before. */\n setup: z.string().optional(),\n /** Shell, exit 0 = pass (post-state check). */\n verify: z.string().optional(),\n cleanup: z.string().optional(),\n samples: z.number().default(1),\n assert: z.array(Assertion),\n});\nexport type Case = z.infer<typeof Case>;\n\n/** `cases.yaml` — evals for one component. */\nexport const EvalFile = z.object({\n /** Fully-qualified component id. */\n component: z.string(),\n /** Which harnesses to run; others reported UNTESTED. */\n harnesses: z.array(Target),\n cases: z.array(Case),\n});\nexport type EvalFile = z.infer<typeof EvalFile>;\n","import { z } from \"zod\";\nimport { Target } from \"./plugin\";\n\n/** Trust badges (spec §10). valid/tested are computed in Phase 2; the rest in Phase 3. */\nexport const Badge = z.enum([\"valid\", \"tested\", \"verified\", \"scanned\", \"signed\"]);\nexport type Badge = z.infer<typeof Badge>;\n\nexport const IndexVersion = z.object({\n version: z.string(),\n ref: z.string(),\n sha: z.string(),\n badges: z.array(Badge),\n /** Harnesses with passing deterministic eval runs. */\n harnessCoverage: z.array(Target),\n});\nexport type IndexVersion = z.infer<typeof IndexVersion>;\n\nexport const IndexEntry = z.object({\n id: z.string(),\n source: z.string(),\n versions: z.array(IndexVersion),\n /** Aggregate, opt-in only -- never per-user. */\n telemetry: z\n .object({\n installs: z.number().default(0),\n activeUsage: z.number().default(0),\n })\n .optional(),\n});\nexport type IndexEntry = z.infer<typeof IndexEntry>;\n\n/** `weft.index/1` -- a metadata-only aggregator (spec §10), self-hostable static JSON. */\nexport const IndexFile = z.object({\n schema: z.literal(\"weft.index/1\"),\n plugins: z.array(IndexEntry),\n federated: z.array(z.object({ source: z.string(), ingestedAt: z.string() })).optional(),\n});\nexport type IndexFile = z.infer<typeof IndexFile>;\n","import { z } from \"zod\";\nimport { Target } from \"./plugin\";\n\nexport const Scope = z.enum([\"user\", \"project\"]);\nexport type Scope = z.infer<typeof Scope>;\n\nexport const ArtifactRecord = z.object({\n /** Fully-qualified id of the plugin this artifact belongs to. */\n plugin: z.string(),\n /** Fully-qualified component id. */\n component: z.string(),\n target: Target,\n scope: Scope,\n /** Absolute placement path. */\n path: z.string(),\n /** sha256 of compiled output. */\n hash: z.string(),\n placement: z.enum([\"copy\", \"shared\"]),\n /** Executable artifacts start disabled (§11). */\n enabled: z.boolean(),\n});\nexport type ArtifactRecord = z.infer<typeof ArtifactRecord>;\n\nexport const AdapterRecord = z.object({\n version: z.string(),\n targetSchema: z.string(),\n});\n\n/** One installed plugin's record within a lockfile. */\nexport const PluginLock = z.object({\n id: z.string(),\n version: z.string(),\n ref: z.string(),\n sha: z.string(),\n dependencies: z.array(\n z.object({\n id: z.string(),\n range: z.string(),\n resolvedSha: z.string(),\n }),\n ),\n /** Bare leaf name -> fully-qualified id (§9.4). */\n aliases: z.record(z.string(), z.string()),\n});\nexport type PluginLock = z.infer<typeof PluginLock>;\n\n/**\n * `weft.lock` — the ledger of everything installed into one target (a project for\n * project scope, the user dir for user scope). Drives update/uninstall/verify.\n * Holds many plugins so a marketplace install is a single lockfile.\n */\nexport const Lockfile = z.object({\n weftVersion: z.string(),\n generatedAt: z.string(),\n plugins: z.array(PluginLock),\n /** Every placed artifact across all plugins; each tagged with its `plugin` id. */\n artifacts: z.array(ArtifactRecord),\n adapters: z\n .object({\n claude: AdapterRecord.optional(),\n codex: AdapterRecord.optional(),\n cursor: AdapterRecord.optional(),\n copilot: AdapterRecord.optional(),\n opencode: AdapterRecord.optional(),\n })\n .partial(),\n});\nexport type Lockfile = z.infer<typeof Lockfile>;\n","import { z } from \"zod\";\nimport { Owner } from \"./plugin\";\n\nexport const MarketplaceEntry = z.object({\n /** Same source forms as Dependency.plugin. */\n plugin: z.string(),\n version: z.string().optional(),\n category: z.string().optional(),\n tags: z.array(z.string()).optional(),\n});\nexport type MarketplaceEntry = z.infer<typeof MarketplaceEntry>;\n\n/** `marketplace.yaml` — a curated catalog compiled to each harness's native form. */\nexport const Marketplace = z.object({\n name: z.string().regex(/^[a-z0-9-]+$/, \"marketplace name must be kebab-case\"),\n owner: Owner,\n description: z.string().optional(),\n plugins: z.array(MarketplaceEntry),\n /** Permitted external namespaces a plugin here may depend on. */\n allow_dependencies_on: z.array(z.string()).optional(),\n});\nexport type Marketplace = z.infer<typeof Marketplace>;\n","import { z } from \"zod\";\nimport { EvalFile } from \"./evals\";\nimport { Lockfile } from \"./lockfile\";\nimport { Marketplace } from \"./marketplace\";\nimport { Plugin } from \"./plugin\";\n\n/** Canonical manifests for which we publish a `$schema` for editor autocomplete. */\nexport const SCHEMAS = {\n \"weft.yaml\": Plugin,\n \"marketplace.yaml\": Marketplace,\n \"weft.lock\": Lockfile,\n \"cases.yaml\": EvalFile,\n} as const;\n\nexport type SchemaName = keyof typeof SCHEMAS;\n\n/** Export a JSON Schema (draft 2020-12) for one canonical manifest. */\nexport function jsonSchemaFor(name: SchemaName): unknown {\n return z.toJSONSchema(SCHEMAS[name], { target: \"draft-2020-12\" });\n}\n\n/** Export JSON Schemas for every canonical manifest, keyed by file name. */\nexport function allJsonSchemas(): Record<SchemaName, unknown> {\n const out = {} as Record<SchemaName, unknown>;\n for (const name of Object.keys(SCHEMAS) as SchemaName[]) {\n out[name] = jsonSchemaFor(name);\n }\n return out;\n}\n","import JSON5 from \"json5\";\nimport * as YAML from \"yaml\";\nimport type { z } from \"zod\";\nimport { detectComponentKind, schemaForKind } from \"./component\";\nimport { Plugin } from \"./plugin\";\n\nexport type DocFormat = \"yaml\" | \"json5\" | \"auto\";\n\nexport interface ParseIssue {\n path: string;\n message: string;\n}\nexport type ParseResult<T> = { ok: true; value: T } | { ok: false; issues: ParseIssue[] };\n\nfunction guessFormat(filename?: string): \"yaml\" | \"json5\" {\n if (filename && /\\.json5$/i.test(filename)) return \"json5\";\n return \"yaml\";\n}\n\n/**\n * Read raw manifest text into a plain object.\n *\n * YAML is parsed in **1.2 core** mode, which kills the \"Norway problem\": only\n * `true`/`false` are booleans, so `no`/`yes`/`on`/`off` stay strings. (Unquoted\n * `1.10` still becomes the float `1.1` per YAML semantics — but version fields\n * are typed as strings, so that surfaces as a precise Zod error telling the\n * author to quote it.) `strict` rejects duplicate keys. JSON5 input is accepted\n * against the same schemas.\n */\nexport function parseDocument(\n text: string,\n format: DocFormat = \"auto\",\n filename?: string,\n): unknown {\n const fmt = format === \"auto\" ? guessFormat(filename) : format;\n if (fmt === \"json5\") return JSON5.parse(text);\n return YAML.parse(text, { version: \"1.2\", schema: \"core\", strict: true });\n}\n\n/** Serialize an object back to YAML 1.2 (used when writing a generated manifest). */\nexport function stringifyDocument(obj: unknown): string {\n return YAML.stringify(obj, { version: \"1.2\" });\n}\n\nfunction pathStr(path: readonly PropertyKey[]): string {\n let out = \"\";\n for (const seg of path) {\n if (typeof seg === \"number\") out += `[${seg}]`;\n else {\n const key = String(seg);\n out += out ? `.${key}` : key;\n }\n }\n return out;\n}\n\n/** Validate an already-parsed object against a schema, returning path-precise issues. */\nexport function validate<T>(schema: z.ZodType<T>, raw: unknown): ParseResult<T> {\n const r = schema.safeParse(raw);\n if (r.success) return { ok: true, value: r.data };\n return {\n ok: false,\n issues: r.error.issues.map((iss) => ({ path: pathStr(iss.path), message: iss.message })),\n };\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/**\n * Parse a plugin with kind-aware component routing, so a malformed component\n * produces `components[2].mcp: Required` rather than a noisy union error.\n */\nexport function parsePlugin(raw: unknown): ParseResult<Plugin> {\n const issues: ParseIssue[] = [];\n\n if (isRecord(raw) && Array.isArray(raw.components)) {\n raw.components.forEach((c, i) => {\n const det = detectComponentKind(c);\n if (!det.ok) {\n issues.push({ path: `components[${i}]`, message: det.error });\n return;\n }\n const r = schemaForKind(det.kind).safeParse(c);\n if (!r.success) {\n for (const iss of r.error.issues) {\n issues.push({ path: `components[${i}].${pathStr(iss.path)}`, message: iss.message });\n }\n }\n });\n }\n\n const full = Plugin.safeParse(raw);\n if (!full.success) {\n for (const iss of full.error.issues) {\n // Skip generic union noise on components — pass 1 gave precise messages.\n if (issues.length > 0 && iss.path[0] === \"components\") continue;\n issues.push({ path: pathStr(iss.path), message: iss.message });\n }\n }\n\n if (issues.length > 0) return { ok: false, issues };\n // No issues means the full parse succeeded (a bad component fails Plugin too).\n return { ok: true, value: (full as { data: Plugin }).data };\n}\n\n/** Convenience: read text (YAML/JSON5) and validate against any schema. */\nexport function loadManifest<T>(\n schema: z.ZodType<T>,\n text: string,\n opts: { format?: DocFormat; filename?: string } = {},\n): ParseResult<T> {\n let raw: unknown;\n try {\n raw = parseDocument(text, opts.format ?? \"auto\", opts.filename);\n } catch (err) {\n return { ok: false, issues: [{ path: \"\", message: `parse error: ${(err as Error).message}` }] };\n }\n return validate(schema, raw);\n}\n\n/** Read text (YAML/JSON5) and parse as a plugin with component routing. */\nexport function loadPlugin(\n text: string,\n opts: { format?: DocFormat; filename?: string } = {},\n): ParseResult<Plugin> {\n let raw: unknown;\n try {\n raw = parseDocument(text, opts.format ?? \"auto\", opts.filename);\n } catch (err) {\n return { ok: false, issues: [{ path: \"\", message: `parse error: ${(err as Error).message}` }] };\n }\n return parsePlugin(raw);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts","../src/component.ts","../src/evals.ts","../src/indexfile.ts","../src/lockfile.ts","../src/marketplace.ts","../src/jsonschema.ts","../src/parse.ts"],"names":["z"],"mappings":";;;;;AAOO,IAAM,MAAA,GAAS,EAAE,IAAA,CAAK;AAAA,EAC3B,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,cAAiC,MAAA,CAAO;AAG9C,IAAM,YAAY,CAAA,CACtB,MAAA,EAAO,CACP,KAAA,CAAM,6BAA6B,8CAA8C;AAE7E,IAAM,KAAA,GAAQ,EAAE,MAAA,CAAO;AAAA,EAC5B,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,EACf,SAAA,EAAW,SAAA;AAAA,EACX,KAAA,EAAO,CAAA,CAAE,KAAA,EAAM,CAAE,QAAA;AACnB,CAAC;AAIM,IAAM,SAAA,GAAY,EAAE,MAAA,CAAO;AAAA,EAChC,GAAA,EAAK,EAAE,MAAA,EAAO;AAAA,EACd,MAAA,EAAQ,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAQ,KAAK,CAAA;AAAA,EACjC,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC5B,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC7B,QAAA,EAAU,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAQ,IAAI;AACpC,CAAC;AAGD,IAAM,YAAA,GAAe;AAAA;AAAA,EAEnB,OAAA,EAAS,CAAA,CAAE,KAAA,CAAM,MAAM,EAAE,QAAA,EAAS;AAAA;AAAA,EAElC,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACpB,CAAA;AAGO,IAAM,kBAAkB,CAAC,OAAA,EAAS,OAAO,OAAA,EAAS,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Q,KAA0B,IAAA,EAAK;AAC5D;AAGO,SAAS,YAAA,CACd,MAAA,EACA,IAAA,EACA,IAAA,GAAkD,EAAC,EACnC;AAChB,EAAA,IAAI,GAAA;AACJ,EAAA,IAAI;AACF,IAAA,GAAA,GAAM,cAAc,IAAA,EAAM,IAAA,CAAK,MAAA,IAAU,MAAA,EAAQ,KAAK,QAAQ,CAAA;AAAA,EAChE,SAAS,GAAA,EAAK;AACZ,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,EAAA,EAAI,OAAA,EAAS,CAAA,aAAA,EAAiB,GAAA,CAAc,OAAO,CAAA,CAAA,EAAI,CAAA,EAAE;AAAA,EAChG;AACA,EAAA,OAAO,QAAA,CAAS,QAAQ,GAAG,CAAA;AAC7B;AAGO,SAAS,UAAA,CACd,IAAA,EACA,IAAA,GAAkD,EAAC,EAC9B;AACrB,EAAA,IAAI,GAAA;AACJ,EAAA,IAAI;AACF,IAAA,GAAA,GAAM,cAAc,IAAA,EAAM,IAAA,CAAK,MAAA,IAAU,MAAA,EAAQ,KAAK,QAAQ,CAAA;AAAA,EAChE,SAAS,GAAA,EAAK;AACZ,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,EAAA,EAAI,OAAA,EAAS,CAAA,aAAA,EAAiB,GAAA,CAAc,OAAO,CAAA,CAAA,EAAI,CAAA,EAAE;AAAA,EAChG;AACA,EAAA,OAAO,YAAY,GAAG,CAAA;AACxB","file":"index.js","sourcesContent":["import { z } from \"zod\";\n\n/**\n * The coding-agent harnesses Weft compiles to. The first five have full,\n * dedicated adapters (skills + MCP + agents + hooks + commands); the rest are\n * skills-only directory-convention harnesses served by a generic adapter.\n */\nexport const Target = z.enum([\n \"claude\",\n \"codex\",\n \"cursor\",\n \"copilot\",\n \"opencode\",\n \"zed\",\n \"gemini\",\n \"amp\",\n \"aider\",\n]);\nexport type Target = z.infer<typeof Target>;\n\nexport const ALL_TARGETS: readonly Target[] = Target.options;\n\n/** Reverse-DNS namespace, e.g. `com.acme`. */\nexport const Namespace = z\n .string()\n .regex(/^[a-z0-9]+(\\.[a-z0-9]+)+$/, \"namespace must be reverse-DNS, e.g. com.acme\");\n\nexport const Owner = z.object({\n name: z.string(),\n namespace: Namespace,\n email: z.email().optional(),\n});\nexport type Owner = z.infer<typeof Owner>;\n\n/** A config value a component reads at runtime. Declared, never stored (§11). */\nexport const ConfigVar = z.object({\n env: z.string(),\n secret: z.boolean().default(false),\n prompt: z.string().optional(),\n default: z.string().optional(),\n required: z.boolean().default(true),\n});\nexport type ConfigVar = z.infer<typeof ConfigVar>;\n\nconst commonFields = {\n /** Which harnesses to emit for; default = all five. */\n targets: z.array(Target).optional(),\n /** Path to a `cases.yaml` eval file, relative to the plugin root. */\n evals: z.string().optional(),\n} as const;\n\n/** The seven primitive component kinds. `passthrough` is verbatim/single-target. */\nexport const COMPONENT_KINDS = [\"skill\", \"mcp\", \"agent\", \"hook\", \"command\", \"passthrough\"] as const;\nexport type ComponentKind = (typeof COMPONENT_KINDS)[number];\n\nexport const SkillComponent = z.strictObject({ ...commonFields, skill: z.string() });\nexport const McpComponent = z.strictObject({\n ...commonFields,\n mcp: z.string(),\n config: z.array(ConfigVar).optional(),\n});\nexport const AgentComponent = z.strictObject({ ...commonFields, agent: z.string() });\nexport const HookComponent = z.strictObject({ ...commonFields, hook: z.string() });\nexport const CommandComponent = z.strictObject({ ...commonFields, command: z.string() });\n\n/** A verbatim executable artifact bound to a single harness. Placed DISABLED. */\nexport const PassthroughComponent = z.strictObject({\n passthrough: z.string(),\n target: Target,\n kind: z.enum([\"hook\", \"plugin\", \"script\"]),\n default_enabled: z.boolean().default(false),\n /** Path to a `cases.yaml` eval file (a passthrough eval is a setup+verify check). */\n evals: z.string().optional(),\n});\n\nexport const Component = z.union([\n SkillComponent,\n McpComponent,\n AgentComponent,\n HookComponent,\n CommandComponent,\n PassthroughComponent,\n]);\nexport type Component = z.infer<typeof Component>;\n\n/** Source forms accepted for a plugin reference. */\nexport const Dependency = z.object({\n /** github:owner/repo | <git-url> | npm:<pkg> | ./path */\n plugin: z.string(),\n version: z.string().optional(),\n /** Piecemeal: pull only these leaf names (+ their shared/sibling assets). */\n components: z.array(z.string()).optional(),\n});\nexport type Dependency = z.infer<typeof Dependency>;\n\nexport const Trust = z.object({\n sign: z.boolean().default(false),\n scan: z.array(z.enum([\"schema\", \"security\"])).default([\"schema\"]),\n});\nexport type Trust = z.infer<typeof Trust>;\n\n/** `weft.yaml` — the single file an author writes. */\nexport const Plugin = z.object({\n name: z.string().regex(/^[a-z0-9-]+$/, \"plugin name must be kebab-case\"),\n version: z.string(),\n owner: Owner,\n description: z.string().optional(),\n license: z.string().optional(),\n weft_min_version: z.string().optional(),\n components: z.array(Component),\n depends: z.array(Dependency).optional(),\n trust: Trust.optional(),\n});\nexport type Plugin = z.infer<typeof Plugin>;\n","import {\n AgentComponent,\n CommandComponent,\n type Component,\n type ComponentKind,\n HookComponent,\n McpComponent,\n PassthroughComponent,\n SkillComponent,\n} from \"./plugin\";\n\n/** The key that names each component variant in `weft.yaml`. */\nconst KIND_KEYS: Record<ComponentKind, string> = {\n skill: \"skill\",\n mcp: \"mcp\",\n agent: \"agent\",\n hook: \"hook\",\n command: \"command\",\n passthrough: \"passthrough\",\n};\n\nconst VARIANT_SCHEMAS = {\n skill: SkillComponent,\n mcp: McpComponent,\n agent: AgentComponent,\n hook: HookComponent,\n command: CommandComponent,\n passthrough: PassthroughComponent,\n} as const;\n\nexport interface DetectedKind {\n kind: ComponentKind;\n}\n\n/**\n * Decide a component's kind from which discriminating key is present.\n * Returns an error string instead of throwing so callers can attach a path.\n */\nexport function detectComponentKind(\n raw: unknown,\n): { ok: true; kind: ComponentKind } | { ok: false; error: string } {\n if (typeof raw !== \"object\" || raw === null) {\n return { ok: false, error: \"component must be an object\" };\n }\n const present = (Object.keys(KIND_KEYS) as ComponentKind[]).filter(\n (kind) => KIND_KEYS[kind] in (raw as Record<string, unknown>),\n );\n if (present.length === 0) {\n return {\n ok: false,\n error: `component has no kind key (one of: ${Object.values(KIND_KEYS).join(\", \")})`,\n };\n }\n if (present.length > 1) {\n return {\n ok: false,\n error: `component has conflicting kind keys: ${present.join(\", \")}`,\n };\n }\n return { ok: true, kind: present[0] as ComponentKind };\n}\n\n/** The schema for a detected kind — used by the loader for path-precise errors. */\nexport function schemaForKind(kind: ComponentKind) {\n return VARIANT_SCHEMAS[kind];\n}\n\n/** The kind of an already-validated component. */\nexport function kindOf(component: Component): ComponentKind {\n const detected = detectComponentKind(component);\n if (!detected.ok) throw new Error(detected.error);\n return detected.kind;\n}\n\n/** The relative path (skill dir, mcp dir, hook file, …) this component points at. */\nexport function refOf(component: Component): string {\n const c = component as Record<string, unknown>;\n const kind = kindOf(component);\n return c[KIND_KEYS[kind]] as string;\n}\n\n/**\n * The leaf name used to build a fully-qualified id `{namespace}/{plugin}:{leaf}`.\n * Derived from the basename of the component's ref, stripping a known extension.\n */\nexport function leafNameOf(component: Component): string {\n const ref = refOf(component);\n const base = ref.split(\"/\").filter(Boolean).pop() ?? ref;\n return base.replace(/\\.(md|json|toml|ya?ml|ts|js|sh)$/i, \"\");\n}\n\n/** Harnesses this component targets, defaulting to all when unspecified. */\nexport function targetsOf(component: Component, all: readonly string[]): readonly string[] {\n if (\"target\" in component && typeof component.target === \"string\") {\n return [component.target];\n }\n if (\"targets\" in component && component.targets && component.targets.length > 0) {\n return component.targets;\n }\n return all;\n}\n\n/** Build the canonical fully-qualified id for a component. */\nexport function fqid(namespace: string, bundleName: string, leaf: string): string {\n return `${namespace}/${bundleName}:${leaf}`;\n}\n","import { z } from \"zod\";\nimport { Target } from \"./plugin\";\n\nconst TraceAssert = z.object({\n kind: z.literal(\"trace\"),\n toolCalled: z.string().optional(),\n toolNotCalled: z.string().optional(),\n /** Required call order. */\n sequence: z.array(z.string()).optional(),\n /** Path-efficiency ceiling. */\n maxCalls: z.number().optional(),\n minPassRate: z.number().min(0).max(1).default(1.0),\n});\nexport type TraceAssert = z.infer<typeof TraceAssert>;\n\nconst OutputAssert = z.object({\n kind: z.literal(\"output\"),\n equals: z.string().optional(),\n matches: z.string().optional(),\n jsonSchema: z.string().optional(),\n tolerance: z.number().optional(),\n /** Fraction of `samples` that must match; <1 tolerates LLM variance. */\n minPassRate: z.number().min(0).max(1).default(1.0),\n});\nexport type OutputAssert = z.infer<typeof OutputAssert>;\n\nconst JudgeAssert = z.object({\n kind: z.literal(\"judge\"),\n rubric: z.string(),\n mode: z.enum([\"absolute\", \"pairwise\"]).default(\"pairwise\"),\n /** Required for pairwise. */\n reference: z.string().optional(),\n samples: z.number().default(3),\n /** Absolute mode only. */\n threshold: z.number().optional(),\n /** Advisory unless true. */\n gate: z.boolean().default(false),\n});\nexport type JudgeAssert = z.infer<typeof JudgeAssert>;\n\nconst DifferentialAssert = z.object({\n kind: z.literal(\"differential\"),\n baseline: z.string().default(\"last-release\"),\n noWorseThan: z.number().default(0.0),\n});\nexport type DifferentialAssert = z.infer<typeof DifferentialAssert>;\n\nexport const Assertion = z.discriminatedUnion(\"kind\", [\n TraceAssert,\n OutputAssert,\n JudgeAssert,\n DifferentialAssert,\n]);\nexport type Assertion = z.infer<typeof Assertion>;\n\nexport const Case = z.object({\n name: z.string(),\n prompt: z.string(),\n /** Shell, run before. */\n setup: z.string().optional(),\n /** Shell, exit 0 = pass (post-state check). */\n verify: z.string().optional(),\n cleanup: z.string().optional(),\n samples: z.number().default(1),\n assert: z.array(Assertion),\n});\nexport type Case = z.infer<typeof Case>;\n\n/** `cases.yaml` — evals for one component. */\nexport const EvalFile = z.object({\n /** Fully-qualified component id. */\n component: z.string(),\n /** Which harnesses to run; others reported UNTESTED. */\n harnesses: z.array(Target),\n cases: z.array(Case),\n});\nexport type EvalFile = z.infer<typeof EvalFile>;\n","import { z } from \"zod\";\nimport { Target } from \"./plugin\";\n\n/** Trust badges (spec §10). valid/tested are computed in Phase 2; the rest in Phase 3. */\nexport const Badge = z.enum([\"valid\", \"tested\", \"verified\", \"scanned\", \"signed\"]);\nexport type Badge = z.infer<typeof Badge>;\n\nexport const IndexVersion = z.object({\n version: z.string(),\n ref: z.string(),\n sha: z.string(),\n badges: z.array(Badge),\n /** Harnesses with passing deterministic eval runs. */\n harnessCoverage: z.array(Target),\n});\nexport type IndexVersion = z.infer<typeof IndexVersion>;\n\nexport const IndexEntry = z.object({\n id: z.string(),\n source: z.string(),\n versions: z.array(IndexVersion),\n /** Aggregate, opt-in only -- never per-user. */\n telemetry: z\n .object({\n installs: z.number().default(0),\n activeUsage: z.number().default(0),\n })\n .optional(),\n});\nexport type IndexEntry = z.infer<typeof IndexEntry>;\n\n/** `weft.index/1` -- a metadata-only aggregator (spec §10), self-hostable static JSON. */\nexport const IndexFile = z.object({\n schema: z.literal(\"weft.index/1\"),\n plugins: z.array(IndexEntry),\n federated: z.array(z.object({ source: z.string(), ingestedAt: z.string() })).optional(),\n});\nexport type IndexFile = z.infer<typeof IndexFile>;\n","import { z } from \"zod\";\nimport { Target } from \"./plugin\";\n\nexport const Scope = z.enum([\"user\", \"project\"]);\nexport type Scope = z.infer<typeof Scope>;\n\nexport const ArtifactRecord = z.object({\n /** Fully-qualified id of the plugin this artifact belongs to. */\n plugin: z.string(),\n /** Fully-qualified component id. */\n component: z.string(),\n target: Target,\n scope: Scope,\n /** Absolute placement path. */\n path: z.string(),\n /** sha256 of compiled output. */\n hash: z.string(),\n placement: z.enum([\"copy\", \"shared\"]),\n /** Executable artifacts start disabled (§11). */\n enabled: z.boolean(),\n});\nexport type ArtifactRecord = z.infer<typeof ArtifactRecord>;\n\nexport const AdapterRecord = z.object({\n version: z.string(),\n targetSchema: z.string(),\n});\n\n/** One installed plugin's record within a lockfile. */\nexport const PluginLock = z.object({\n id: z.string(),\n version: z.string(),\n ref: z.string(),\n sha: z.string(),\n dependencies: z.array(\n z.object({\n id: z.string(),\n range: z.string(),\n resolvedSha: z.string(),\n }),\n ),\n /** Bare leaf name -> fully-qualified id (§9.4). */\n aliases: z.record(z.string(), z.string()),\n});\nexport type PluginLock = z.infer<typeof PluginLock>;\n\n/**\n * `weft.lock` — the ledger of everything installed into one target (a project for\n * project scope, the user dir for user scope). Drives update/uninstall/verify.\n * Holds many plugins so a marketplace install is a single lockfile.\n */\nexport const Lockfile = z.object({\n weftVersion: z.string(),\n generatedAt: z.string(),\n plugins: z.array(PluginLock),\n /** Every placed artifact across all plugins; each tagged with its `plugin` id. */\n artifacts: z.array(ArtifactRecord),\n /** Adapter version + targetSchema used per target, keyed by target name. */\n adapters: z.record(z.string(), AdapterRecord),\n});\nexport type Lockfile = z.infer<typeof Lockfile>;\n","import { z } from \"zod\";\nimport { Owner } from \"./plugin\";\n\nexport const MarketplaceEntry = z.object({\n /** Same source forms as Dependency.plugin. */\n plugin: z.string(),\n version: z.string().optional(),\n category: z.string().optional(),\n tags: z.array(z.string()).optional(),\n});\nexport type MarketplaceEntry = z.infer<typeof MarketplaceEntry>;\n\n/** `marketplace.yaml` — a curated catalog compiled to each harness's native form. */\nexport const Marketplace = z.object({\n name: z.string().regex(/^[a-z0-9-]+$/, \"marketplace name must be kebab-case\"),\n owner: Owner,\n description: z.string().optional(),\n plugins: z.array(MarketplaceEntry),\n /** Permitted external namespaces a plugin here may depend on. */\n allow_dependencies_on: z.array(z.string()).optional(),\n});\nexport type Marketplace = z.infer<typeof Marketplace>;\n","import { z } from \"zod\";\nimport { EvalFile } from \"./evals\";\nimport { Lockfile } from \"./lockfile\";\nimport { Marketplace } from \"./marketplace\";\nimport { Plugin } from \"./plugin\";\n\n/** Canonical manifests for which we publish a `$schema` for editor autocomplete. */\nexport const SCHEMAS = {\n \"weft.yaml\": Plugin,\n \"marketplace.yaml\": Marketplace,\n \"weft.lock\": Lockfile,\n \"cases.yaml\": EvalFile,\n} as const;\n\nexport type SchemaName = keyof typeof SCHEMAS;\n\n/** Export a JSON Schema (draft 2020-12) for one canonical manifest. */\nexport function jsonSchemaFor(name: SchemaName): unknown {\n return z.toJSONSchema(SCHEMAS[name], { target: \"draft-2020-12\" });\n}\n\n/** Export JSON Schemas for every canonical manifest, keyed by file name. */\nexport function allJsonSchemas(): Record<SchemaName, unknown> {\n const out = {} as Record<SchemaName, unknown>;\n for (const name of Object.keys(SCHEMAS) as SchemaName[]) {\n out[name] = jsonSchemaFor(name);\n }\n return out;\n}\n","import JSON5 from \"json5\";\nimport * as YAML from \"yaml\";\nimport type { z } from \"zod\";\nimport { detectComponentKind, schemaForKind } from \"./component\";\nimport { Plugin } from \"./plugin\";\n\nexport type DocFormat = \"yaml\" | \"json5\" | \"auto\";\n\nexport interface ParseIssue {\n path: string;\n message: string;\n}\nexport type ParseResult<T> = { ok: true; value: T } | { ok: false; issues: ParseIssue[] };\n\nfunction guessFormat(filename?: string): \"yaml\" | \"json5\" {\n if (filename && /\\.json5$/i.test(filename)) return \"json5\";\n return \"yaml\";\n}\n\n/**\n * Read raw manifest text into a plain object.\n *\n * YAML is parsed in **1.2 core** mode, which kills the \"Norway problem\": only\n * `true`/`false` are booleans, so `no`/`yes`/`on`/`off` stay strings. (Unquoted\n * `1.10` still becomes the float `1.1` per YAML semantics — but version fields\n * are typed as strings, so that surfaces as a precise Zod error telling the\n * author to quote it.) `strict` rejects duplicate keys. JSON5 input is accepted\n * against the same schemas.\n */\nexport function parseDocument(\n text: string,\n format: DocFormat = \"auto\",\n filename?: string,\n): unknown {\n const fmt = format === \"auto\" ? guessFormat(filename) : format;\n if (fmt === \"json5\") return JSON5.parse(text);\n return YAML.parse(text, { version: \"1.2\", schema: \"core\", strict: true });\n}\n\n/** Serialize an object back to YAML 1.2 (used when writing a generated manifest). */\nexport function stringifyDocument(obj: unknown): string {\n return YAML.stringify(obj, { version: \"1.2\" });\n}\n\nfunction pathStr(path: readonly PropertyKey[]): string {\n let out = \"\";\n for (const seg of path) {\n if (typeof seg === \"number\") out += `[${seg}]`;\n else {\n const key = String(seg);\n out += out ? `.${key}` : key;\n }\n }\n return out;\n}\n\n/** Validate an already-parsed object against a schema, returning path-precise issues. */\nexport function validate<T>(schema: z.ZodType<T>, raw: unknown): ParseResult<T> {\n const r = schema.safeParse(raw);\n if (r.success) return { ok: true, value: r.data };\n return {\n ok: false,\n issues: r.error.issues.map((iss) => ({ path: pathStr(iss.path), message: iss.message })),\n };\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/**\n * Parse a plugin with kind-aware component routing, so a malformed component\n * produces `components[2].mcp: Required` rather than a noisy union error.\n */\nexport function parsePlugin(raw: unknown): ParseResult<Plugin> {\n const issues: ParseIssue[] = [];\n\n if (isRecord(raw) && Array.isArray(raw.components)) {\n raw.components.forEach((c, i) => {\n const det = detectComponentKind(c);\n if (!det.ok) {\n issues.push({ path: `components[${i}]`, message: det.error });\n return;\n }\n const r = schemaForKind(det.kind).safeParse(c);\n if (!r.success) {\n for (const iss of r.error.issues) {\n issues.push({ path: `components[${i}].${pathStr(iss.path)}`, message: iss.message });\n }\n }\n });\n }\n\n const full = Plugin.safeParse(raw);\n if (!full.success) {\n for (const iss of full.error.issues) {\n // Skip generic union noise on components — pass 1 gave precise messages.\n if (issues.length > 0 && iss.path[0] === \"components\") continue;\n issues.push({ path: pathStr(iss.path), message: iss.message });\n }\n }\n\n if (issues.length > 0) return { ok: false, issues };\n // No issues means the full parse succeeded (a bad component fails Plugin too).\n return { ok: true, value: (full as { data: Plugin }).data };\n}\n\n/** Convenience: read text (YAML/JSON5) and validate against any schema. */\nexport function loadManifest<T>(\n schema: z.ZodType<T>,\n text: string,\n opts: { format?: DocFormat; filename?: string } = {},\n): ParseResult<T> {\n let raw: unknown;\n try {\n raw = parseDocument(text, opts.format ?? \"auto\", opts.filename);\n } catch (err) {\n return { ok: false, issues: [{ path: \"\", message: `parse error: ${(err as Error).message}` }] };\n }\n return validate(schema, raw);\n}\n\n/** Read text (YAML/JSON5) and parse as a plugin with component routing. */\nexport function loadPlugin(\n text: string,\n opts: { format?: DocFormat; filename?: string } = {},\n): ParseResult<Plugin> {\n let raw: unknown;\n try {\n raw = parseDocument(text, opts.format ?? \"auto\", opts.filename);\n } catch (err) {\n return { ok: false, issues: [{ path: \"\", message: `parse error: ${(err as Error).message}` }] };\n }\n return parsePlugin(raw);\n}\n"]}
|