@nodeskai/genehub-types 0.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.
@@ -0,0 +1,954 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const AuthorSchema: z.ZodObject<{
4
+ type: z.ZodEnum<["human", "agent"]>;
5
+ name: z.ZodString;
6
+ ref: z.ZodDefault<z.ZodOptional<z.ZodString>>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "agent" | "human";
9
+ name: string;
10
+ ref: string;
11
+ }, {
12
+ type: "agent" | "human";
13
+ name: string;
14
+ ref?: string | undefined;
15
+ }>;
16
+ type Author = z.infer<typeof AuthorSchema>;
17
+ declare const CompatibilityEntrySchema: z.ZodObject<{
18
+ product: z.ZodEnum<["openclaw", "nanobot", "deskclaw", "generic"]>;
19
+ min_version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ product: "openclaw" | "nanobot" | "deskclaw" | "generic";
22
+ min_version: string;
23
+ }, {
24
+ product: "openclaw" | "nanobot" | "deskclaw" | "generic";
25
+ min_version?: string | undefined;
26
+ }>;
27
+ type CompatibilityEntry = z.infer<typeof CompatibilityEntrySchema>;
28
+ declare const DependencyEntrySchema: z.ZodObject<{
29
+ slug: z.ZodString;
30
+ version: z.ZodString;
31
+ optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ slug: string;
34
+ version: string;
35
+ optional: boolean;
36
+ }, {
37
+ slug: string;
38
+ version: string;
39
+ optional?: boolean | undefined;
40
+ }>;
41
+ type DependencyEntry = z.infer<typeof DependencyEntrySchema>;
42
+ declare const SkillSchema: z.ZodObject<{
43
+ name: z.ZodString;
44
+ always: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
45
+ content: z.ZodOptional<z.ZodString>;
46
+ file: z.ZodOptional<z.ZodString>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ name: string;
49
+ always: boolean;
50
+ content?: string | undefined;
51
+ file?: string | undefined;
52
+ }, {
53
+ name: string;
54
+ always?: boolean | undefined;
55
+ content?: string | undefined;
56
+ file?: string | undefined;
57
+ }>;
58
+ type Skill = z.infer<typeof SkillSchema>;
59
+ declare const RuleSchema: z.ZodObject<{
60
+ name: z.ZodString;
61
+ content: z.ZodString;
62
+ applies_to: z.ZodOptional<z.ZodString>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ name: string;
65
+ content: string;
66
+ applies_to?: string | undefined;
67
+ }, {
68
+ name: string;
69
+ content: string;
70
+ applies_to?: string | undefined;
71
+ }>;
72
+ type Rule = z.infer<typeof RuleSchema>;
73
+ declare const OpenClawConfigSchema: z.ZodObject<{
74
+ openclaw_config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
75
+ tool_allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ openclaw_config?: Record<string, unknown> | undefined;
78
+ tool_allow?: string[] | undefined;
79
+ }, {
80
+ openclaw_config?: Record<string, unknown> | undefined;
81
+ tool_allow?: string[] | undefined;
82
+ }>;
83
+ declare const NanobotConfigSchema: z.ZodObject<{
84
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
85
+ requires: z.ZodOptional<z.ZodObject<{
86
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
87
+ env: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ bins?: string[] | undefined;
90
+ env?: string[] | undefined;
91
+ }, {
92
+ bins?: string[] | undefined;
93
+ env?: string[] | undefined;
94
+ }>>;
95
+ always: z.ZodOptional<z.ZodBoolean>;
96
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
+ install: z.ZodOptional<z.ZodArray<z.ZodObject<{
98
+ id: z.ZodString;
99
+ kind: z.ZodString;
100
+ formula: z.ZodOptional<z.ZodString>;
101
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
102
+ label: z.ZodOptional<z.ZodString>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ id: string;
105
+ kind: string;
106
+ bins?: string[] | undefined;
107
+ formula?: string | undefined;
108
+ label?: string | undefined;
109
+ }, {
110
+ id: string;
111
+ kind: string;
112
+ bins?: string[] | undefined;
113
+ formula?: string | undefined;
114
+ label?: string | undefined;
115
+ }>, "many">>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ always?: boolean | undefined;
118
+ capabilities?: string[] | undefined;
119
+ requires?: {
120
+ bins?: string[] | undefined;
121
+ env?: string[] | undefined;
122
+ } | undefined;
123
+ os?: string[] | undefined;
124
+ install?: {
125
+ id: string;
126
+ kind: string;
127
+ bins?: string[] | undefined;
128
+ formula?: string | undefined;
129
+ label?: string | undefined;
130
+ }[] | undefined;
131
+ }, {
132
+ always?: boolean | undefined;
133
+ capabilities?: string[] | undefined;
134
+ requires?: {
135
+ bins?: string[] | undefined;
136
+ env?: string[] | undefined;
137
+ } | undefined;
138
+ os?: string[] | undefined;
139
+ install?: {
140
+ id: string;
141
+ kind: string;
142
+ bins?: string[] | undefined;
143
+ formula?: string | undefined;
144
+ label?: string | undefined;
145
+ }[] | undefined;
146
+ }>;
147
+ declare const GeneConfigSchema: z.ZodObject<{
148
+ common: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
+ openclaw: z.ZodOptional<z.ZodObject<{
150
+ openclaw_config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
151
+ tool_allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ openclaw_config?: Record<string, unknown> | undefined;
154
+ tool_allow?: string[] | undefined;
155
+ }, {
156
+ openclaw_config?: Record<string, unknown> | undefined;
157
+ tool_allow?: string[] | undefined;
158
+ }>>;
159
+ nanobot: z.ZodOptional<z.ZodObject<{
160
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
161
+ requires: z.ZodOptional<z.ZodObject<{
162
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
+ env: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
164
+ }, "strip", z.ZodTypeAny, {
165
+ bins?: string[] | undefined;
166
+ env?: string[] | undefined;
167
+ }, {
168
+ bins?: string[] | undefined;
169
+ env?: string[] | undefined;
170
+ }>>;
171
+ always: z.ZodOptional<z.ZodBoolean>;
172
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
173
+ install: z.ZodOptional<z.ZodArray<z.ZodObject<{
174
+ id: z.ZodString;
175
+ kind: z.ZodString;
176
+ formula: z.ZodOptional<z.ZodString>;
177
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
+ label: z.ZodOptional<z.ZodString>;
179
+ }, "strip", z.ZodTypeAny, {
180
+ id: string;
181
+ kind: string;
182
+ bins?: string[] | undefined;
183
+ formula?: string | undefined;
184
+ label?: string | undefined;
185
+ }, {
186
+ id: string;
187
+ kind: string;
188
+ bins?: string[] | undefined;
189
+ formula?: string | undefined;
190
+ label?: string | undefined;
191
+ }>, "many">>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ always?: boolean | undefined;
194
+ capabilities?: string[] | undefined;
195
+ requires?: {
196
+ bins?: string[] | undefined;
197
+ env?: string[] | undefined;
198
+ } | undefined;
199
+ os?: string[] | undefined;
200
+ install?: {
201
+ id: string;
202
+ kind: string;
203
+ bins?: string[] | undefined;
204
+ formula?: string | undefined;
205
+ label?: string | undefined;
206
+ }[] | undefined;
207
+ }, {
208
+ always?: boolean | undefined;
209
+ capabilities?: string[] | undefined;
210
+ requires?: {
211
+ bins?: string[] | undefined;
212
+ env?: string[] | undefined;
213
+ } | undefined;
214
+ os?: string[] | undefined;
215
+ install?: {
216
+ id: string;
217
+ kind: string;
218
+ bins?: string[] | undefined;
219
+ formula?: string | undefined;
220
+ label?: string | undefined;
221
+ }[] | undefined;
222
+ }>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ openclaw?: {
225
+ openclaw_config?: Record<string, unknown> | undefined;
226
+ tool_allow?: string[] | undefined;
227
+ } | undefined;
228
+ nanobot?: {
229
+ always?: boolean | undefined;
230
+ capabilities?: string[] | undefined;
231
+ requires?: {
232
+ bins?: string[] | undefined;
233
+ env?: string[] | undefined;
234
+ } | undefined;
235
+ os?: string[] | undefined;
236
+ install?: {
237
+ id: string;
238
+ kind: string;
239
+ bins?: string[] | undefined;
240
+ formula?: string | undefined;
241
+ label?: string | undefined;
242
+ }[] | undefined;
243
+ } | undefined;
244
+ common?: Record<string, unknown> | undefined;
245
+ }, {
246
+ openclaw?: {
247
+ openclaw_config?: Record<string, unknown> | undefined;
248
+ tool_allow?: string[] | undefined;
249
+ } | undefined;
250
+ nanobot?: {
251
+ always?: boolean | undefined;
252
+ capabilities?: string[] | undefined;
253
+ requires?: {
254
+ bins?: string[] | undefined;
255
+ env?: string[] | undefined;
256
+ } | undefined;
257
+ os?: string[] | undefined;
258
+ install?: {
259
+ id: string;
260
+ kind: string;
261
+ bins?: string[] | undefined;
262
+ formula?: string | undefined;
263
+ label?: string | undefined;
264
+ }[] | undefined;
265
+ } | undefined;
266
+ common?: Record<string, unknown> | undefined;
267
+ }>;
268
+ type GeneConfig = z.infer<typeof GeneConfigSchema>;
269
+ declare const McpServerSchema: z.ZodObject<{
270
+ name: z.ZodString;
271
+ transport: z.ZodDefault<z.ZodOptional<z.ZodEnum<["stdio", "http"]>>>;
272
+ command: z.ZodOptional<z.ZodString>;
273
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
274
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
275
+ url: z.ZodOptional<z.ZodString>;
276
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
277
+ }, "strip", z.ZodTypeAny, {
278
+ name: string;
279
+ transport: "stdio" | "http";
280
+ env?: Record<string, string> | undefined;
281
+ command?: string | undefined;
282
+ args?: string[] | undefined;
283
+ url?: string | undefined;
284
+ headers?: Record<string, string> | undefined;
285
+ }, {
286
+ name: string;
287
+ env?: Record<string, string> | undefined;
288
+ transport?: "stdio" | "http" | undefined;
289
+ command?: string | undefined;
290
+ args?: string[] | undefined;
291
+ url?: string | undefined;
292
+ headers?: Record<string, string> | undefined;
293
+ }>;
294
+ type McpServer = z.infer<typeof McpServerSchema>;
295
+ declare const LearningScenarioSchema: z.ZodObject<{
296
+ title: z.ZodString;
297
+ context: z.ZodString;
298
+ expected_focus: z.ZodString;
299
+ }, "strip", z.ZodTypeAny, {
300
+ title: string;
301
+ context: string;
302
+ expected_focus: string;
303
+ }, {
304
+ title: string;
305
+ context: string;
306
+ expected_focus: string;
307
+ }>;
308
+ type LearningScenario = z.infer<typeof LearningScenarioSchema>;
309
+ declare const LearningSchema: z.ZodObject<{
310
+ force_deep_learn: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
311
+ objectives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
312
+ scenarios: z.ZodOptional<z.ZodArray<z.ZodObject<{
313
+ title: z.ZodString;
314
+ context: z.ZodString;
315
+ expected_focus: z.ZodString;
316
+ }, "strip", z.ZodTypeAny, {
317
+ title: string;
318
+ context: string;
319
+ expected_focus: string;
320
+ }, {
321
+ title: string;
322
+ context: string;
323
+ expected_focus: string;
324
+ }>, "many">>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ force_deep_learn: boolean;
327
+ objectives?: string[] | undefined;
328
+ scenarios?: {
329
+ title: string;
330
+ context: string;
331
+ expected_focus: string;
332
+ }[] | undefined;
333
+ }, {
334
+ force_deep_learn?: boolean | undefined;
335
+ objectives?: string[] | undefined;
336
+ scenarios?: {
337
+ title: string;
338
+ context: string;
339
+ expected_focus: string;
340
+ }[] | undefined;
341
+ }>;
342
+ type Learning = z.infer<typeof LearningSchema>;
343
+ declare const GeneManifestSchema: z.ZodObject<{
344
+ slug: z.ZodString;
345
+ name: z.ZodString;
346
+ version: z.ZodString;
347
+ description: z.ZodString;
348
+ short_description: z.ZodString;
349
+ category: z.ZodEnum<["development", "data", "operations", "network", "creative", "communication", "security", "efficiency"]>;
350
+ tags: z.ZodArray<z.ZodEnum<["ability", "personality", "knowledge", "tool"]>, "many">;
351
+ icon: z.ZodOptional<z.ZodString>;
352
+ author: z.ZodOptional<z.ZodObject<{
353
+ type: z.ZodEnum<["human", "agent"]>;
354
+ name: z.ZodString;
355
+ ref: z.ZodDefault<z.ZodOptional<z.ZodString>>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ type: "agent" | "human";
358
+ name: string;
359
+ ref: string;
360
+ }, {
361
+ type: "agent" | "human";
362
+ name: string;
363
+ ref?: string | undefined;
364
+ }>>;
365
+ compatibility: z.ZodArray<z.ZodObject<{
366
+ product: z.ZodEnum<["openclaw", "nanobot", "deskclaw", "generic"]>;
367
+ min_version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
368
+ }, "strip", z.ZodTypeAny, {
369
+ product: "openclaw" | "nanobot" | "deskclaw" | "generic";
370
+ min_version: string;
371
+ }, {
372
+ product: "openclaw" | "nanobot" | "deskclaw" | "generic";
373
+ min_version?: string | undefined;
374
+ }>, "many">;
375
+ dependencies: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
376
+ slug: z.ZodString;
377
+ version: z.ZodString;
378
+ optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ slug: string;
381
+ version: string;
382
+ optional: boolean;
383
+ }, {
384
+ slug: string;
385
+ version: string;
386
+ optional?: boolean | undefined;
387
+ }>, "many">>>;
388
+ synergies: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
389
+ skill: z.ZodObject<{
390
+ name: z.ZodString;
391
+ always: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
392
+ content: z.ZodOptional<z.ZodString>;
393
+ file: z.ZodOptional<z.ZodString>;
394
+ }, "strip", z.ZodTypeAny, {
395
+ name: string;
396
+ always: boolean;
397
+ content?: string | undefined;
398
+ file?: string | undefined;
399
+ }, {
400
+ name: string;
401
+ always?: boolean | undefined;
402
+ content?: string | undefined;
403
+ file?: string | undefined;
404
+ }>;
405
+ rules: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
406
+ name: z.ZodString;
407
+ content: z.ZodString;
408
+ applies_to: z.ZodOptional<z.ZodString>;
409
+ }, "strip", z.ZodTypeAny, {
410
+ name: string;
411
+ content: string;
412
+ applies_to?: string | undefined;
413
+ }, {
414
+ name: string;
415
+ content: string;
416
+ applies_to?: string | undefined;
417
+ }>, "many">>>;
418
+ config: z.ZodOptional<z.ZodObject<{
419
+ common: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
420
+ openclaw: z.ZodOptional<z.ZodObject<{
421
+ openclaw_config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
422
+ tool_allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
423
+ }, "strip", z.ZodTypeAny, {
424
+ openclaw_config?: Record<string, unknown> | undefined;
425
+ tool_allow?: string[] | undefined;
426
+ }, {
427
+ openclaw_config?: Record<string, unknown> | undefined;
428
+ tool_allow?: string[] | undefined;
429
+ }>>;
430
+ nanobot: z.ZodOptional<z.ZodObject<{
431
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
432
+ requires: z.ZodOptional<z.ZodObject<{
433
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
434
+ env: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ bins?: string[] | undefined;
437
+ env?: string[] | undefined;
438
+ }, {
439
+ bins?: string[] | undefined;
440
+ env?: string[] | undefined;
441
+ }>>;
442
+ always: z.ZodOptional<z.ZodBoolean>;
443
+ os: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
444
+ install: z.ZodOptional<z.ZodArray<z.ZodObject<{
445
+ id: z.ZodString;
446
+ kind: z.ZodString;
447
+ formula: z.ZodOptional<z.ZodString>;
448
+ bins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
449
+ label: z.ZodOptional<z.ZodString>;
450
+ }, "strip", z.ZodTypeAny, {
451
+ id: string;
452
+ kind: string;
453
+ bins?: string[] | undefined;
454
+ formula?: string | undefined;
455
+ label?: string | undefined;
456
+ }, {
457
+ id: string;
458
+ kind: string;
459
+ bins?: string[] | undefined;
460
+ formula?: string | undefined;
461
+ label?: string | undefined;
462
+ }>, "many">>;
463
+ }, "strip", z.ZodTypeAny, {
464
+ always?: boolean | undefined;
465
+ capabilities?: string[] | undefined;
466
+ requires?: {
467
+ bins?: string[] | undefined;
468
+ env?: string[] | undefined;
469
+ } | undefined;
470
+ os?: string[] | undefined;
471
+ install?: {
472
+ id: string;
473
+ kind: string;
474
+ bins?: string[] | undefined;
475
+ formula?: string | undefined;
476
+ label?: string | undefined;
477
+ }[] | undefined;
478
+ }, {
479
+ always?: boolean | undefined;
480
+ capabilities?: string[] | undefined;
481
+ requires?: {
482
+ bins?: string[] | undefined;
483
+ env?: string[] | undefined;
484
+ } | undefined;
485
+ os?: string[] | undefined;
486
+ install?: {
487
+ id: string;
488
+ kind: string;
489
+ bins?: string[] | undefined;
490
+ formula?: string | undefined;
491
+ label?: string | undefined;
492
+ }[] | undefined;
493
+ }>>;
494
+ }, "strip", z.ZodTypeAny, {
495
+ openclaw?: {
496
+ openclaw_config?: Record<string, unknown> | undefined;
497
+ tool_allow?: string[] | undefined;
498
+ } | undefined;
499
+ nanobot?: {
500
+ always?: boolean | undefined;
501
+ capabilities?: string[] | undefined;
502
+ requires?: {
503
+ bins?: string[] | undefined;
504
+ env?: string[] | undefined;
505
+ } | undefined;
506
+ os?: string[] | undefined;
507
+ install?: {
508
+ id: string;
509
+ kind: string;
510
+ bins?: string[] | undefined;
511
+ formula?: string | undefined;
512
+ label?: string | undefined;
513
+ }[] | undefined;
514
+ } | undefined;
515
+ common?: Record<string, unknown> | undefined;
516
+ }, {
517
+ openclaw?: {
518
+ openclaw_config?: Record<string, unknown> | undefined;
519
+ tool_allow?: string[] | undefined;
520
+ } | undefined;
521
+ nanobot?: {
522
+ always?: boolean | undefined;
523
+ capabilities?: string[] | undefined;
524
+ requires?: {
525
+ bins?: string[] | undefined;
526
+ env?: string[] | undefined;
527
+ } | undefined;
528
+ os?: string[] | undefined;
529
+ install?: {
530
+ id: string;
531
+ kind: string;
532
+ bins?: string[] | undefined;
533
+ formula?: string | undefined;
534
+ label?: string | undefined;
535
+ }[] | undefined;
536
+ } | undefined;
537
+ common?: Record<string, unknown> | undefined;
538
+ }>>;
539
+ mcp_servers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
540
+ name: z.ZodString;
541
+ transport: z.ZodDefault<z.ZodOptional<z.ZodEnum<["stdio", "http"]>>>;
542
+ command: z.ZodOptional<z.ZodString>;
543
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
544
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
545
+ url: z.ZodOptional<z.ZodString>;
546
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ name: string;
549
+ transport: "stdio" | "http";
550
+ env?: Record<string, string> | undefined;
551
+ command?: string | undefined;
552
+ args?: string[] | undefined;
553
+ url?: string | undefined;
554
+ headers?: Record<string, string> | undefined;
555
+ }, {
556
+ name: string;
557
+ env?: Record<string, string> | undefined;
558
+ transport?: "stdio" | "http" | undefined;
559
+ command?: string | undefined;
560
+ args?: string[] | undefined;
561
+ url?: string | undefined;
562
+ headers?: Record<string, string> | undefined;
563
+ }>, "many">>>;
564
+ learning: z.ZodOptional<z.ZodObject<{
565
+ force_deep_learn: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
566
+ objectives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
567
+ scenarios: z.ZodOptional<z.ZodArray<z.ZodObject<{
568
+ title: z.ZodString;
569
+ context: z.ZodString;
570
+ expected_focus: z.ZodString;
571
+ }, "strip", z.ZodTypeAny, {
572
+ title: string;
573
+ context: string;
574
+ expected_focus: string;
575
+ }, {
576
+ title: string;
577
+ context: string;
578
+ expected_focus: string;
579
+ }>, "many">>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ force_deep_learn: boolean;
582
+ objectives?: string[] | undefined;
583
+ scenarios?: {
584
+ title: string;
585
+ context: string;
586
+ expected_focus: string;
587
+ }[] | undefined;
588
+ }, {
589
+ force_deep_learn?: boolean | undefined;
590
+ objectives?: string[] | undefined;
591
+ scenarios?: {
592
+ title: string;
593
+ context: string;
594
+ expected_focus: string;
595
+ }[] | undefined;
596
+ }>>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ name: string;
599
+ slug: string;
600
+ version: string;
601
+ description: string;
602
+ short_description: string;
603
+ category: "development" | "data" | "operations" | "network" | "creative" | "communication" | "security" | "efficiency";
604
+ tags: ("ability" | "personality" | "knowledge" | "tool")[];
605
+ compatibility: {
606
+ product: "openclaw" | "nanobot" | "deskclaw" | "generic";
607
+ min_version: string;
608
+ }[];
609
+ dependencies: {
610
+ slug: string;
611
+ version: string;
612
+ optional: boolean;
613
+ }[];
614
+ synergies: string[];
615
+ skill: {
616
+ name: string;
617
+ always: boolean;
618
+ content?: string | undefined;
619
+ file?: string | undefined;
620
+ };
621
+ rules: {
622
+ name: string;
623
+ content: string;
624
+ applies_to?: string | undefined;
625
+ }[];
626
+ mcp_servers: {
627
+ name: string;
628
+ transport: "stdio" | "http";
629
+ env?: Record<string, string> | undefined;
630
+ command?: string | undefined;
631
+ args?: string[] | undefined;
632
+ url?: string | undefined;
633
+ headers?: Record<string, string> | undefined;
634
+ }[];
635
+ icon?: string | undefined;
636
+ author?: {
637
+ type: "agent" | "human";
638
+ name: string;
639
+ ref: string;
640
+ } | undefined;
641
+ config?: {
642
+ openclaw?: {
643
+ openclaw_config?: Record<string, unknown> | undefined;
644
+ tool_allow?: string[] | undefined;
645
+ } | undefined;
646
+ nanobot?: {
647
+ always?: boolean | undefined;
648
+ capabilities?: string[] | undefined;
649
+ requires?: {
650
+ bins?: string[] | undefined;
651
+ env?: string[] | undefined;
652
+ } | undefined;
653
+ os?: string[] | undefined;
654
+ install?: {
655
+ id: string;
656
+ kind: string;
657
+ bins?: string[] | undefined;
658
+ formula?: string | undefined;
659
+ label?: string | undefined;
660
+ }[] | undefined;
661
+ } | undefined;
662
+ common?: Record<string, unknown> | undefined;
663
+ } | undefined;
664
+ learning?: {
665
+ force_deep_learn: boolean;
666
+ objectives?: string[] | undefined;
667
+ scenarios?: {
668
+ title: string;
669
+ context: string;
670
+ expected_focus: string;
671
+ }[] | undefined;
672
+ } | undefined;
673
+ }, {
674
+ name: string;
675
+ slug: string;
676
+ version: string;
677
+ description: string;
678
+ short_description: string;
679
+ category: "development" | "data" | "operations" | "network" | "creative" | "communication" | "security" | "efficiency";
680
+ tags: ("ability" | "personality" | "knowledge" | "tool")[];
681
+ compatibility: {
682
+ product: "openclaw" | "nanobot" | "deskclaw" | "generic";
683
+ min_version?: string | undefined;
684
+ }[];
685
+ skill: {
686
+ name: string;
687
+ always?: boolean | undefined;
688
+ content?: string | undefined;
689
+ file?: string | undefined;
690
+ };
691
+ icon?: string | undefined;
692
+ author?: {
693
+ type: "agent" | "human";
694
+ name: string;
695
+ ref?: string | undefined;
696
+ } | undefined;
697
+ dependencies?: {
698
+ slug: string;
699
+ version: string;
700
+ optional?: boolean | undefined;
701
+ }[] | undefined;
702
+ synergies?: string[] | undefined;
703
+ rules?: {
704
+ name: string;
705
+ content: string;
706
+ applies_to?: string | undefined;
707
+ }[] | undefined;
708
+ config?: {
709
+ openclaw?: {
710
+ openclaw_config?: Record<string, unknown> | undefined;
711
+ tool_allow?: string[] | undefined;
712
+ } | undefined;
713
+ nanobot?: {
714
+ always?: boolean | undefined;
715
+ capabilities?: string[] | undefined;
716
+ requires?: {
717
+ bins?: string[] | undefined;
718
+ env?: string[] | undefined;
719
+ } | undefined;
720
+ os?: string[] | undefined;
721
+ install?: {
722
+ id: string;
723
+ kind: string;
724
+ bins?: string[] | undefined;
725
+ formula?: string | undefined;
726
+ label?: string | undefined;
727
+ }[] | undefined;
728
+ } | undefined;
729
+ common?: Record<string, unknown> | undefined;
730
+ } | undefined;
731
+ mcp_servers?: {
732
+ name: string;
733
+ env?: Record<string, string> | undefined;
734
+ transport?: "stdio" | "http" | undefined;
735
+ command?: string | undefined;
736
+ args?: string[] | undefined;
737
+ url?: string | undefined;
738
+ headers?: Record<string, string> | undefined;
739
+ }[] | undefined;
740
+ learning?: {
741
+ force_deep_learn?: boolean | undefined;
742
+ objectives?: string[] | undefined;
743
+ scenarios?: {
744
+ title: string;
745
+ context: string;
746
+ expected_focus: string;
747
+ }[] | undefined;
748
+ } | undefined;
749
+ }>;
750
+ type GeneManifest = z.infer<typeof GeneManifestSchema>;
751
+
752
+ type InstallOptions = {
753
+ targetPath?: string;
754
+ force?: boolean;
755
+ skipDependencies?: boolean;
756
+ };
757
+ type UninstallOptions = {
758
+ keepConfig?: boolean;
759
+ };
760
+ type InstallResult = {
761
+ success: boolean;
762
+ slug: string;
763
+ version: string;
764
+ files: string[];
765
+ needsRestart: boolean;
766
+ dependencies: string[];
767
+ };
768
+ type UninstallResult = {
769
+ success: boolean;
770
+ slug: string;
771
+ files: string[];
772
+ needsRestart: boolean;
773
+ };
774
+ type InstalledGene = {
775
+ slug: string;
776
+ version: string;
777
+ installedAt: string;
778
+ files: string[];
779
+ };
780
+ interface GeneAdapter {
781
+ readonly product: string;
782
+ detect(): Promise<boolean>;
783
+ install(manifest: GeneManifest, options?: InstallOptions): Promise<InstallResult>;
784
+ uninstall(slug: string, options?: UninstallOptions): Promise<UninstallResult>;
785
+ list(): Promise<InstalledGene[]>;
786
+ isInstalled(slug: string): Promise<boolean>;
787
+ getInstalledVersion(slug: string): Promise<string | null>;
788
+ /**
789
+ * Notify the host that a skill was added/removed/updated.
790
+ * Implementations should invalidate caches and inject notifications
791
+ * so the agent sees the change immediately.
792
+ */
793
+ notifySkillChange?(geneName: string, action: 'installed' | 'updated' | 'uninstalled'): Promise<void>;
794
+ }
795
+
796
+ declare const GeneCategory: z.ZodEnum<["development", "data", "operations", "network", "creative", "communication", "security", "efficiency"]>;
797
+ type GeneCategory = z.infer<typeof GeneCategory>;
798
+ declare const GeneTag: z.ZodEnum<["ability", "personality", "knowledge", "tool"]>;
799
+ type GeneTag = z.infer<typeof GeneTag>;
800
+ declare const GeneSource: z.ZodEnum<["official", "clawhub", "evomap", "community", "agent"]>;
801
+ type GeneSource = z.infer<typeof GeneSource>;
802
+ declare const ReviewStatus: z.ZodEnum<["draft", "pending", "approved", "rejected"]>;
803
+ type ReviewStatus = z.infer<typeof ReviewStatus>;
804
+ declare const ProductId: z.ZodEnum<["openclaw", "nanobot", "deskclaw", "generic"]>;
805
+ type ProductId = z.infer<typeof ProductId>;
806
+ declare const AuthorType: z.ZodEnum<["human", "agent"]>;
807
+ type AuthorType = z.infer<typeof AuthorType>;
808
+ declare const LearningMode: z.ZodEnum<["learn", "create", "forget"]>;
809
+ type LearningMode = z.infer<typeof LearningMode>;
810
+ declare const LearningDecision: z.ZodEnum<["direct_install", "learned", "failed", "created", "forgotten", "simplified", "forget_failed"]>;
811
+ type LearningDecision = z.infer<typeof LearningDecision>;
812
+
813
+ type Gene = {
814
+ id: string;
815
+ name: string;
816
+ slug: string;
817
+ version: string;
818
+ description: string;
819
+ short_description: string;
820
+ category: string;
821
+ tags: string[];
822
+ icon: string | null;
823
+ source: GeneSource;
824
+ source_ref: string | null;
825
+ manifest: GeneManifest;
826
+ compatibility: string[];
827
+ dependencies: {
828
+ slug: string;
829
+ version: string;
830
+ }[];
831
+ synergies: string[];
832
+ parent_gene_id: string | null;
833
+ author: Author;
834
+ install_count: number;
835
+ avg_rating: number;
836
+ effectiveness_score: number;
837
+ review_status: ReviewStatus;
838
+ is_published: boolean;
839
+ created_at: string;
840
+ updated_at: string;
841
+ deleted_at: string | null;
842
+ };
843
+ type Genome = {
844
+ id: string;
845
+ name: string;
846
+ slug: string;
847
+ version: string;
848
+ description: string;
849
+ short_description: string;
850
+ icon: string | null;
851
+ genes: {
852
+ slug: string;
853
+ version: string;
854
+ config_override?: Record<string, unknown>;
855
+ }[];
856
+ compatibility: string[];
857
+ install_count: number;
858
+ avg_rating: number;
859
+ author: Author;
860
+ is_published: boolean;
861
+ created_at: string;
862
+ updated_at: string;
863
+ deleted_at: string | null;
864
+ };
865
+ type GeneVersion = {
866
+ id: string;
867
+ gene_id: string;
868
+ version: string;
869
+ manifest: GeneManifest;
870
+ changelog: string;
871
+ is_latest: boolean;
872
+ published_at: string;
873
+ };
874
+
875
+ type ApiResponse<T = unknown> = {
876
+ code: number;
877
+ message: string;
878
+ data: T;
879
+ };
880
+ type ApiErrorResponse = {
881
+ code: number;
882
+ error_code: string;
883
+ message: string;
884
+ data: null;
885
+ };
886
+ type PaginatedData<T> = {
887
+ items: T[];
888
+ total: number;
889
+ page: number;
890
+ page_size: number;
891
+ total_pages: number;
892
+ };
893
+ type GeneListParams = {
894
+ q?: string;
895
+ category?: string;
896
+ tags?: string[];
897
+ compatibility?: string;
898
+ sort?: 'newest' | 'popular' | 'rating';
899
+ page?: number;
900
+ page_size?: number;
901
+ };
902
+ type GeneListResponse = ApiResponse<PaginatedData<Gene>>;
903
+ type GeneDetailResponse = ApiResponse<Gene>;
904
+ type GeneManifestResponse = ApiResponse<Gene['manifest']>;
905
+ type GeneVersionsResponse = ApiResponse<GeneVersion[]>;
906
+ type GenomeDetailResponse = ApiResponse<Genome>;
907
+ type CreateGeneRequest = {
908
+ manifest: Gene['manifest'];
909
+ source?: string;
910
+ source_ref?: string;
911
+ };
912
+ type ResolveRequest = {
913
+ slug: string;
914
+ version?: string;
915
+ product?: string;
916
+ };
917
+ type ResolvedGene = {
918
+ slug: string;
919
+ version: string;
920
+ manifest: unknown;
921
+ optional: boolean;
922
+ };
923
+ type ResolveResponse = ApiResponse<{
924
+ plan: ResolvedGene[];
925
+ warnings: string[];
926
+ }>;
927
+ type EffectivenessReport = {
928
+ gene_slug: string;
929
+ gene_version: string;
930
+ product: string;
931
+ instance_id: string;
932
+ metric_type: 'user_positive' | 'user_negative' | 'agent_self_eval' | 'task_success';
933
+ value: number;
934
+ context?: string;
935
+ timestamp: string;
936
+ };
937
+ declare const ERROR_CODES: {
938
+ readonly TOKEN_INVALID: 10001;
939
+ readonly TOKEN_EXPIRED: 10002;
940
+ readonly PERMISSION_DENIED: 10003;
941
+ readonly GENE_NOT_FOUND: 20001;
942
+ readonly GENE_VERSION_CONFLICT: 20002;
943
+ readonly GENE_SLUG_EXISTS: 20003;
944
+ readonly GENE_MANIFEST_INVALID: 20004;
945
+ readonly GENE_VERSION_NOT_FOUND: 20005;
946
+ readonly GENOME_NOT_FOUND: 30001;
947
+ readonly DEPENDENCY_RESOLVE_FAILED: 40001;
948
+ readonly COMPATIBILITY_MISMATCH: 40002;
949
+ readonly LEARNING_TASK_TIMEOUT: 50001;
950
+ readonly LEARNING_CALLBACK_FAILED: 50002;
951
+ readonly INTERNAL_ERROR: 90001;
952
+ };
953
+
954
+ export { type ApiErrorResponse, type ApiResponse, type Author, AuthorSchema, AuthorType, type CompatibilityEntry, CompatibilityEntrySchema, type CreateGeneRequest, type DependencyEntry, DependencyEntrySchema, ERROR_CODES, type EffectivenessReport, type Gene, type GeneAdapter, GeneCategory, type GeneConfig, GeneConfigSchema, type GeneDetailResponse, type GeneListParams, type GeneListResponse, type GeneManifest, type GeneManifestResponse, GeneManifestSchema, GeneSource, GeneTag, type GeneVersion, type GeneVersionsResponse, type Genome, type GenomeDetailResponse, type InstallOptions, type InstallResult, type InstalledGene, type Learning, LearningDecision, LearningMode, type LearningScenario, LearningScenarioSchema, LearningSchema, type McpServer, McpServerSchema, NanobotConfigSchema, OpenClawConfigSchema, type PaginatedData, ProductId, type ResolveRequest, type ResolveResponse, type ResolvedGene, ReviewStatus, type Rule, RuleSchema, type Skill, SkillSchema, type UninstallOptions, type UninstallResult };
package/dist/index.js ADDED
@@ -0,0 +1,164 @@
1
+ // src/api.ts
2
+ var ERROR_CODES = {
3
+ TOKEN_INVALID: 10001,
4
+ TOKEN_EXPIRED: 10002,
5
+ PERMISSION_DENIED: 10003,
6
+ GENE_NOT_FOUND: 20001,
7
+ GENE_VERSION_CONFLICT: 20002,
8
+ GENE_SLUG_EXISTS: 20003,
9
+ GENE_MANIFEST_INVALID: 20004,
10
+ GENE_VERSION_NOT_FOUND: 20005,
11
+ GENOME_NOT_FOUND: 30001,
12
+ DEPENDENCY_RESOLVE_FAILED: 40001,
13
+ COMPATIBILITY_MISMATCH: 40002,
14
+ LEARNING_TASK_TIMEOUT: 50001,
15
+ LEARNING_CALLBACK_FAILED: 50002,
16
+ INTERNAL_ERROR: 90001
17
+ };
18
+
19
+ // src/enums.ts
20
+ import { z } from "zod";
21
+ var GeneCategory = z.enum([
22
+ "development",
23
+ "data",
24
+ "operations",
25
+ "network",
26
+ "creative",
27
+ "communication",
28
+ "security",
29
+ "efficiency"
30
+ ]);
31
+ var GeneTag = z.enum(["ability", "personality", "knowledge", "tool"]);
32
+ var GeneSource = z.enum(["official", "clawhub", "evomap", "community", "agent"]);
33
+ var ReviewStatus = z.enum(["draft", "pending", "approved", "rejected"]);
34
+ var ProductId = z.enum(["openclaw", "nanobot", "deskclaw", "generic"]);
35
+ var AuthorType = z.enum(["human", "agent"]);
36
+ var LearningMode = z.enum(["learn", "create", "forget"]);
37
+ var LearningDecision = z.enum([
38
+ "direct_install",
39
+ "learned",
40
+ "failed",
41
+ "created",
42
+ "forgotten",
43
+ "simplified",
44
+ "forget_failed"
45
+ ]);
46
+
47
+ // src/manifest.ts
48
+ import { z as z2 } from "zod";
49
+ var SLUG_REGEX = /^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$/;
50
+ var SEMVER_REGEX = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/;
51
+ var AuthorSchema = z2.object({
52
+ type: AuthorType,
53
+ name: z2.string().max(128),
54
+ ref: z2.string().optional().default("")
55
+ });
56
+ var CompatibilityEntrySchema = z2.object({
57
+ product: ProductId,
58
+ min_version: z2.string().optional().default("0.0.0")
59
+ });
60
+ var DependencyEntrySchema = z2.object({
61
+ slug: z2.string().regex(SLUG_REGEX),
62
+ version: z2.string(),
63
+ optional: z2.boolean().optional().default(false)
64
+ });
65
+ var SkillSchema = z2.object({
66
+ name: z2.string().min(1).max(128),
67
+ always: z2.boolean().optional().default(false),
68
+ content: z2.string().optional(),
69
+ file: z2.string().optional()
70
+ });
71
+ var RuleSchema = z2.object({
72
+ name: z2.string().min(1).max(128),
73
+ content: z2.string(),
74
+ applies_to: z2.string().optional()
75
+ });
76
+ var OpenClawConfigSchema = z2.object({
77
+ openclaw_config: z2.record(z2.unknown()).optional(),
78
+ tool_allow: z2.array(z2.string()).optional()
79
+ });
80
+ var NanobotConfigSchema = z2.object({
81
+ capabilities: z2.array(z2.string()).optional(),
82
+ requires: z2.object({
83
+ bins: z2.array(z2.string()).optional(),
84
+ env: z2.array(z2.string()).optional()
85
+ }).optional(),
86
+ always: z2.boolean().optional(),
87
+ os: z2.array(z2.string()).optional(),
88
+ install: z2.array(
89
+ z2.object({
90
+ id: z2.string(),
91
+ kind: z2.string(),
92
+ formula: z2.string().optional(),
93
+ bins: z2.array(z2.string()).optional(),
94
+ label: z2.string().optional()
95
+ })
96
+ ).optional()
97
+ });
98
+ var GeneConfigSchema = z2.object({
99
+ common: z2.record(z2.unknown()).optional(),
100
+ openclaw: OpenClawConfigSchema.optional(),
101
+ nanobot: NanobotConfigSchema.optional()
102
+ });
103
+ var McpServerSchema = z2.object({
104
+ name: z2.string(),
105
+ transport: z2.enum(["stdio", "http"]).optional().default("stdio"),
106
+ command: z2.string().optional(),
107
+ args: z2.array(z2.string()).optional(),
108
+ env: z2.record(z2.string()).optional(),
109
+ url: z2.string().optional(),
110
+ headers: z2.record(z2.string()).optional()
111
+ });
112
+ var LearningScenarioSchema = z2.object({
113
+ title: z2.string(),
114
+ context: z2.string(),
115
+ expected_focus: z2.string()
116
+ });
117
+ var LearningSchema = z2.object({
118
+ force_deep_learn: z2.boolean().optional().default(false),
119
+ objectives: z2.array(z2.string()).optional(),
120
+ scenarios: z2.array(LearningScenarioSchema).optional()
121
+ });
122
+ var GeneManifestSchema = z2.object({
123
+ slug: z2.string().regex(SLUG_REGEX, "slug \u5FC5\u987B\u4E3A kebab-case\uFF0C3-64 \u5B57\u7B26"),
124
+ name: z2.string().min(1).max(128),
125
+ version: z2.string().regex(SEMVER_REGEX, "\u7248\u672C\u53F7\u5FC5\u987B\u7B26\u5408 SemVer"),
126
+ description: z2.string(),
127
+ short_description: z2.string().max(256),
128
+ category: GeneCategory,
129
+ tags: z2.array(GeneTag).min(1),
130
+ icon: z2.string().max(64).optional(),
131
+ author: AuthorSchema.optional(),
132
+ compatibility: z2.array(CompatibilityEntrySchema).min(1),
133
+ dependencies: z2.array(DependencyEntrySchema).optional().default([]),
134
+ synergies: z2.array(z2.string()).optional().default([]),
135
+ skill: SkillSchema,
136
+ rules: z2.array(RuleSchema).optional().default([]),
137
+ config: GeneConfigSchema.optional(),
138
+ mcp_servers: z2.array(McpServerSchema).optional().default([]),
139
+ learning: LearningSchema.optional()
140
+ });
141
+ export {
142
+ AuthorSchema,
143
+ AuthorType,
144
+ CompatibilityEntrySchema,
145
+ DependencyEntrySchema,
146
+ ERROR_CODES,
147
+ GeneCategory,
148
+ GeneConfigSchema,
149
+ GeneManifestSchema,
150
+ GeneSource,
151
+ GeneTag,
152
+ LearningDecision,
153
+ LearningMode,
154
+ LearningScenarioSchema,
155
+ LearningSchema,
156
+ McpServerSchema,
157
+ NanobotConfigSchema,
158
+ OpenClawConfigSchema,
159
+ ProductId,
160
+ ReviewStatus,
161
+ RuleSchema,
162
+ SkillSchema
163
+ };
164
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api.ts","../src/enums.ts","../src/manifest.ts"],"sourcesContent":["import type { Gene, GeneVersion, Genome } from './gene.js';\n\nexport type ApiResponse<T = unknown> = {\n code: number;\n message: string;\n data: T;\n};\n\nexport type ApiErrorResponse = {\n code: number;\n error_code: string;\n message: string;\n data: null;\n};\n\nexport type PaginatedData<T> = {\n items: T[];\n total: number;\n page: number;\n page_size: number;\n total_pages: number;\n};\n\nexport type GeneListParams = {\n q?: string;\n category?: string;\n tags?: string[];\n compatibility?: string;\n sort?: 'newest' | 'popular' | 'rating';\n page?: number;\n page_size?: number;\n};\n\nexport type GeneListResponse = ApiResponse<PaginatedData<Gene>>;\nexport type GeneDetailResponse = ApiResponse<Gene>;\nexport type GeneManifestResponse = ApiResponse<Gene['manifest']>;\nexport type GeneVersionsResponse = ApiResponse<GeneVersion[]>;\nexport type GenomeDetailResponse = ApiResponse<Genome>;\n\nexport type CreateGeneRequest = {\n manifest: Gene['manifest'];\n source?: string;\n source_ref?: string;\n};\n\nexport type ResolveRequest = {\n slug: string;\n version?: string;\n product?: string;\n};\n\nexport type ResolvedGene = {\n slug: string;\n version: string;\n manifest: unknown;\n optional: boolean;\n};\n\nexport type ResolveResponse = ApiResponse<{\n plan: ResolvedGene[];\n warnings: string[];\n}>;\n\nexport type EffectivenessReport = {\n gene_slug: string;\n gene_version: string;\n product: string;\n instance_id: string;\n metric_type: 'user_positive' | 'user_negative' | 'agent_self_eval' | 'task_success';\n value: number;\n context?: string;\n timestamp: string;\n};\n\nexport const ERROR_CODES = {\n TOKEN_INVALID: 10001,\n TOKEN_EXPIRED: 10002,\n PERMISSION_DENIED: 10003,\n GENE_NOT_FOUND: 20001,\n GENE_VERSION_CONFLICT: 20002,\n GENE_SLUG_EXISTS: 20003,\n GENE_MANIFEST_INVALID: 20004,\n GENE_VERSION_NOT_FOUND: 20005,\n GENOME_NOT_FOUND: 30001,\n DEPENDENCY_RESOLVE_FAILED: 40001,\n COMPATIBILITY_MISMATCH: 40002,\n LEARNING_TASK_TIMEOUT: 50001,\n LEARNING_CALLBACK_FAILED: 50002,\n INTERNAL_ERROR: 90001,\n} as const;\n","import { z } from 'zod';\n\nexport const GeneCategory = z.enum([\n 'development',\n 'data',\n 'operations',\n 'network',\n 'creative',\n 'communication',\n 'security',\n 'efficiency',\n]);\nexport type GeneCategory = z.infer<typeof GeneCategory>;\n\nexport const GeneTag = z.enum(['ability', 'personality', 'knowledge', 'tool']);\nexport type GeneTag = z.infer<typeof GeneTag>;\n\nexport const GeneSource = z.enum(['official', 'clawhub', 'evomap', 'community', 'agent']);\nexport type GeneSource = z.infer<typeof GeneSource>;\n\nexport const ReviewStatus = z.enum(['draft', 'pending', 'approved', 'rejected']);\nexport type ReviewStatus = z.infer<typeof ReviewStatus>;\n\nexport const ProductId = z.enum(['openclaw', 'nanobot', 'deskclaw', 'generic']);\nexport type ProductId = z.infer<typeof ProductId>;\n\nexport const AuthorType = z.enum(['human', 'agent']);\nexport type AuthorType = z.infer<typeof AuthorType>;\n\nexport const LearningMode = z.enum(['learn', 'create', 'forget']);\nexport type LearningMode = z.infer<typeof LearningMode>;\n\nexport const LearningDecision = z.enum([\n 'direct_install',\n 'learned',\n 'failed',\n 'created',\n 'forgotten',\n 'simplified',\n 'forget_failed',\n]);\nexport type LearningDecision = z.infer<typeof LearningDecision>;\n","import { z } from 'zod';\nimport { AuthorType, GeneCategory, GeneTag, ProductId } from './enums.js';\n\nconst SLUG_REGEX = /^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$/;\nconst SEMVER_REGEX = /^\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.]+)?$/;\n\nexport const AuthorSchema = z.object({\n type: AuthorType,\n name: z.string().max(128),\n ref: z.string().optional().default(''),\n});\nexport type Author = z.infer<typeof AuthorSchema>;\n\nexport const CompatibilityEntrySchema = z.object({\n product: ProductId,\n min_version: z.string().optional().default('0.0.0'),\n});\nexport type CompatibilityEntry = z.infer<typeof CompatibilityEntrySchema>;\n\nexport const DependencyEntrySchema = z.object({\n slug: z.string().regex(SLUG_REGEX),\n version: z.string(),\n optional: z.boolean().optional().default(false),\n});\nexport type DependencyEntry = z.infer<typeof DependencyEntrySchema>;\n\nexport const SkillSchema = z.object({\n name: z.string().min(1).max(128),\n always: z.boolean().optional().default(false),\n content: z.string().optional(),\n file: z.string().optional(),\n});\nexport type Skill = z.infer<typeof SkillSchema>;\n\nexport const RuleSchema = z.object({\n name: z.string().min(1).max(128),\n content: z.string(),\n applies_to: z.string().optional(),\n});\nexport type Rule = z.infer<typeof RuleSchema>;\n\nexport const OpenClawConfigSchema = z.object({\n openclaw_config: z.record(z.unknown()).optional(),\n tool_allow: z.array(z.string()).optional(),\n});\n\nexport const NanobotConfigSchema = z.object({\n capabilities: z.array(z.string()).optional(),\n requires: z\n .object({\n bins: z.array(z.string()).optional(),\n env: z.array(z.string()).optional(),\n })\n .optional(),\n always: z.boolean().optional(),\n os: z.array(z.string()).optional(),\n install: z\n .array(\n z.object({\n id: z.string(),\n kind: z.string(),\n formula: z.string().optional(),\n bins: z.array(z.string()).optional(),\n label: z.string().optional(),\n }),\n )\n .optional(),\n});\n\nexport const GeneConfigSchema = z.object({\n common: z.record(z.unknown()).optional(),\n openclaw: OpenClawConfigSchema.optional(),\n nanobot: NanobotConfigSchema.optional(),\n});\nexport type GeneConfig = z.infer<typeof GeneConfigSchema>;\n\nexport const McpServerSchema = z.object({\n name: z.string(),\n transport: z.enum(['stdio', 'http']).optional().default('stdio'),\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string()).optional(),\n url: z.string().optional(),\n headers: z.record(z.string()).optional(),\n});\nexport type McpServer = z.infer<typeof McpServerSchema>;\n\nexport const LearningScenarioSchema = z.object({\n title: z.string(),\n context: z.string(),\n expected_focus: z.string(),\n});\nexport type LearningScenario = z.infer<typeof LearningScenarioSchema>;\n\nexport const LearningSchema = z.object({\n force_deep_learn: z.boolean().optional().default(false),\n objectives: z.array(z.string()).optional(),\n scenarios: z.array(LearningScenarioSchema).optional(),\n});\nexport type Learning = z.infer<typeof LearningSchema>;\n\nexport const GeneManifestSchema = z.object({\n slug: z.string().regex(SLUG_REGEX, 'slug 必须为 kebab-case,3-64 字符'),\n name: z.string().min(1).max(128),\n version: z.string().regex(SEMVER_REGEX, '版本号必须符合 SemVer'),\n description: z.string(),\n short_description: z.string().max(256),\n category: GeneCategory,\n tags: z.array(GeneTag).min(1),\n icon: z.string().max(64).optional(),\n author: AuthorSchema.optional(),\n\n compatibility: z.array(CompatibilityEntrySchema).min(1),\n\n dependencies: z.array(DependencyEntrySchema).optional().default([]),\n synergies: z.array(z.string()).optional().default([]),\n\n skill: SkillSchema,\n rules: z.array(RuleSchema).optional().default([]),\n config: GeneConfigSchema.optional(),\n mcp_servers: z.array(McpServerSchema).optional().default([]),\n learning: LearningSchema.optional(),\n});\nexport type GeneManifest = z.infer<typeof GeneManifestSchema>;\n"],"mappings":";AA0EO,IAAM,cAAc;AAAA,EACzB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,gBAAgB;AAClB;;;ACzFA,SAAS,SAAS;AAEX,IAAM,eAAe,EAAE,KAAK;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,UAAU,EAAE,KAAK,CAAC,WAAW,eAAe,aAAa,MAAM,CAAC;AAGtE,IAAM,aAAa,EAAE,KAAK,CAAC,YAAY,WAAW,UAAU,aAAa,OAAO,CAAC;AAGjF,IAAM,eAAe,EAAE,KAAK,CAAC,SAAS,WAAW,YAAY,UAAU,CAAC;AAGxE,IAA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cA,GAAE,MAAM,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EAClE,WAAWA,GAAE,MAAMA,GAAE,OAAO,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EAEpD,OAAO;AAAA,EACP,OAAOA,GAAE,MAAM,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EAChD,QAAQ,iBAAiB,SAAS;AAAA,EAClC,aAAaA,GAAE,MAAM,eAAe,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC3D,UAAU,eAAe,SAAS;AACpC,CAAC;","names":["z","z"]}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@nodeskai/genehub-types",
3
+ "version": "0.1.0",
4
+ "description": "GeneHub 共享类型定义与 Zod schemas",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsup",
19
+ "dev": "tsup --watch",
20
+ "prepublishOnly": "pnpm build",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest"
23
+ },
24
+ "dependencies": {
25
+ "zod": "^3.24"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^22.0",
29
+ "tsup": "^8.3",
30
+ "typescript": "^5.7",
31
+ "vitest": "^3.0"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/NoDeskAI/genehub.git",
36
+ "directory": "packages/types"
37
+ },
38
+ "homepage": "https://github.com/NoDeskAI/genehub",
39
+ "keywords": [
40
+ "genehub",
41
+ "ai",
42
+ "agent",
43
+ "gene",
44
+ "types"
45
+ ],
46
+ "license": "MIT"
47
+ }