@fractary/codex 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +613 -125
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +754 -48
- package/dist/index.d.ts +754 -48
- package/dist/index.js +595 -125
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -33,16 +33,56 @@ declare function getExtension(uri: string): string;
|
|
|
33
33
|
declare function getFilename(uri: string): string;
|
|
34
34
|
declare function getDirectory(uri: string): string;
|
|
35
35
|
|
|
36
|
+
type StorageProviderType = 'local' | 'github' | 'http' | 's3' | 's3-archive' | 'r2' | 'gcs' | 'drive' | 'file-plugin';
|
|
37
|
+
interface FetchResult {
|
|
38
|
+
content: Buffer;
|
|
39
|
+
contentType: string;
|
|
40
|
+
size: number;
|
|
41
|
+
source: string;
|
|
42
|
+
metadata?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
interface FetchOptions {
|
|
45
|
+
timeout?: number;
|
|
46
|
+
maxRetries?: number;
|
|
47
|
+
token?: string;
|
|
48
|
+
branch?: string;
|
|
49
|
+
followRedirects?: boolean;
|
|
50
|
+
maxSize?: number;
|
|
51
|
+
}
|
|
52
|
+
interface StorageProvider {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly type: StorageProviderType;
|
|
55
|
+
fetch(reference: ResolvedReference, options?: FetchOptions): Promise<FetchResult>;
|
|
56
|
+
exists(reference: ResolvedReference, options?: FetchOptions): Promise<boolean>;
|
|
57
|
+
canHandle(reference: ResolvedReference): boolean;
|
|
58
|
+
}
|
|
59
|
+
interface StorageProviderConfig {
|
|
60
|
+
type: StorageProviderType;
|
|
61
|
+
options?: Record<string, unknown>;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
maxRetries?: number;
|
|
64
|
+
auth?: {
|
|
65
|
+
tokenEnv?: string;
|
|
66
|
+
token?: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
declare const DEFAULT_FETCH_OPTIONS: Required<FetchOptions>;
|
|
70
|
+
declare function mergeFetchOptions(options?: FetchOptions): Required<FetchOptions>;
|
|
71
|
+
declare function detectContentType(path: string): string;
|
|
72
|
+
|
|
36
73
|
interface ResolvedReference extends ParsedReference {
|
|
37
74
|
cachePath: string;
|
|
38
75
|
isCurrentProject: boolean;
|
|
39
76
|
localPath?: string;
|
|
77
|
+
sourceType?: StorageProviderType;
|
|
78
|
+
filePluginSource?: string;
|
|
40
79
|
}
|
|
41
80
|
interface ResolveOptions {
|
|
42
81
|
cacheDir?: string;
|
|
43
82
|
currentOrg?: string;
|
|
44
83
|
currentProject?: string;
|
|
45
84
|
cwd?: string;
|
|
85
|
+
config?: any;
|
|
46
86
|
}
|
|
47
87
|
declare const DEFAULT_CACHE_DIR = ".fractary/codex/cache";
|
|
48
88
|
declare function detectCurrentProject(cwd?: string): {
|
|
@@ -143,7 +183,7 @@ declare const CustomTypeSchema: z.ZodObject<{
|
|
|
143
183
|
description?: string | undefined;
|
|
144
184
|
defaultTtl?: number | undefined;
|
|
145
185
|
archiveAfterDays?: number | null | undefined;
|
|
146
|
-
archiveStorage?: "local" | "
|
|
186
|
+
archiveStorage?: "local" | "drive" | "cloud" | null | undefined;
|
|
147
187
|
syncPatterns?: string[] | undefined;
|
|
148
188
|
excludePatterns?: string[] | undefined;
|
|
149
189
|
permissions?: {
|
|
@@ -155,7 +195,7 @@ declare const CustomTypeSchema: z.ZodObject<{
|
|
|
155
195
|
description?: string | undefined;
|
|
156
196
|
defaultTtl?: number | undefined;
|
|
157
197
|
archiveAfterDays?: number | null | undefined;
|
|
158
|
-
archiveStorage?: "local" | "
|
|
198
|
+
archiveStorage?: "local" | "drive" | "cloud" | null | undefined;
|
|
159
199
|
syncPatterns?: string[] | undefined;
|
|
160
200
|
excludePatterns?: string[] | undefined;
|
|
161
201
|
permissions?: {
|
|
@@ -188,7 +228,7 @@ declare const TypesConfigSchema: z.ZodObject<{
|
|
|
188
228
|
description?: string | undefined;
|
|
189
229
|
defaultTtl?: number | undefined;
|
|
190
230
|
archiveAfterDays?: number | null | undefined;
|
|
191
|
-
archiveStorage?: "local" | "
|
|
231
|
+
archiveStorage?: "local" | "drive" | "cloud" | null | undefined;
|
|
192
232
|
syncPatterns?: string[] | undefined;
|
|
193
233
|
excludePatterns?: string[] | undefined;
|
|
194
234
|
permissions?: {
|
|
@@ -200,7 +240,7 @@ declare const TypesConfigSchema: z.ZodObject<{
|
|
|
200
240
|
description?: string | undefined;
|
|
201
241
|
defaultTtl?: number | undefined;
|
|
202
242
|
archiveAfterDays?: number | null | undefined;
|
|
203
|
-
archiveStorage?: "local" | "
|
|
243
|
+
archiveStorage?: "local" | "drive" | "cloud" | null | undefined;
|
|
204
244
|
syncPatterns?: string[] | undefined;
|
|
205
245
|
excludePatterns?: string[] | undefined;
|
|
206
246
|
permissions?: {
|
|
@@ -214,7 +254,7 @@ declare const TypesConfigSchema: z.ZodObject<{
|
|
|
214
254
|
description?: string | undefined;
|
|
215
255
|
defaultTtl?: number | undefined;
|
|
216
256
|
archiveAfterDays?: number | null | undefined;
|
|
217
|
-
archiveStorage?: "local" | "
|
|
257
|
+
archiveStorage?: "local" | "drive" | "cloud" | null | undefined;
|
|
218
258
|
syncPatterns?: string[] | undefined;
|
|
219
259
|
excludePatterns?: string[] | undefined;
|
|
220
260
|
permissions?: {
|
|
@@ -228,7 +268,7 @@ declare const TypesConfigSchema: z.ZodObject<{
|
|
|
228
268
|
description?: string | undefined;
|
|
229
269
|
defaultTtl?: number | undefined;
|
|
230
270
|
archiveAfterDays?: number | null | undefined;
|
|
231
|
-
archiveStorage?: "local" | "
|
|
271
|
+
archiveStorage?: "local" | "drive" | "cloud" | null | undefined;
|
|
232
272
|
syncPatterns?: string[] | undefined;
|
|
233
273
|
excludePatterns?: string[] | undefined;
|
|
234
274
|
permissions?: {
|
|
@@ -353,17 +393,18 @@ declare const SyncRulesSchema: z.ZodObject<{
|
|
|
353
393
|
type SyncRules = z.infer<typeof SyncRulesSchema>;
|
|
354
394
|
declare const CodexConfigSchema: z.ZodObject<{
|
|
355
395
|
organizationSlug: z.ZodString;
|
|
396
|
+
project: z.ZodOptional<z.ZodString>;
|
|
356
397
|
directories: z.ZodOptional<z.ZodObject<{
|
|
357
398
|
source: z.ZodOptional<z.ZodString>;
|
|
358
399
|
target: z.ZodOptional<z.ZodString>;
|
|
359
400
|
systems: z.ZodOptional<z.ZodString>;
|
|
360
401
|
}, "strip", z.ZodTypeAny, {
|
|
361
|
-
systems?: string | undefined;
|
|
362
402
|
source?: string | undefined;
|
|
403
|
+
systems?: string | undefined;
|
|
363
404
|
target?: string | undefined;
|
|
364
405
|
}, {
|
|
365
|
-
systems?: string | undefined;
|
|
366
406
|
source?: string | undefined;
|
|
407
|
+
systems?: string | undefined;
|
|
367
408
|
target?: string | undefined;
|
|
368
409
|
}>>;
|
|
369
410
|
rules: z.ZodOptional<z.ZodObject<{
|
|
@@ -461,11 +502,81 @@ declare const CodexConfigSchema: z.ZodObject<{
|
|
|
461
502
|
prefix?: string | undefined;
|
|
462
503
|
}>;
|
|
463
504
|
}>>;
|
|
505
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
506
|
+
github: z.ZodOptional<z.ZodObject<{
|
|
507
|
+
default_token_env: z.ZodOptional<z.ZodString>;
|
|
508
|
+
fallback_to_public: z.ZodOptional<z.ZodBoolean>;
|
|
509
|
+
}, "strip", z.ZodTypeAny, {
|
|
510
|
+
default_token_env?: string | undefined;
|
|
511
|
+
fallback_to_public?: boolean | undefined;
|
|
512
|
+
}, {
|
|
513
|
+
default_token_env?: string | undefined;
|
|
514
|
+
fallback_to_public?: boolean | undefined;
|
|
515
|
+
}>>;
|
|
516
|
+
}, "strip", z.ZodTypeAny, {
|
|
517
|
+
github?: {
|
|
518
|
+
default_token_env?: string | undefined;
|
|
519
|
+
fallback_to_public?: boolean | undefined;
|
|
520
|
+
} | undefined;
|
|
521
|
+
}, {
|
|
522
|
+
github?: {
|
|
523
|
+
default_token_env?: string | undefined;
|
|
524
|
+
fallback_to_public?: boolean | undefined;
|
|
525
|
+
} | undefined;
|
|
526
|
+
}>>;
|
|
527
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
528
|
+
sources: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
529
|
+
type: z.ZodEnum<["github", "s3", "http", "local"]>;
|
|
530
|
+
token_env: z.ZodOptional<z.ZodString>;
|
|
531
|
+
token: z.ZodOptional<z.ZodString>;
|
|
532
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
533
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
534
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
535
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
536
|
+
}, "strip", z.ZodTypeAny, {
|
|
537
|
+
type: "local" | "github" | "http" | "s3";
|
|
538
|
+
token?: string | undefined;
|
|
539
|
+
branch?: string | undefined;
|
|
540
|
+
bucket?: string | undefined;
|
|
541
|
+
prefix?: string | undefined;
|
|
542
|
+
token_env?: string | undefined;
|
|
543
|
+
base_url?: string | undefined;
|
|
544
|
+
}, {
|
|
545
|
+
type: "local" | "github" | "http" | "s3";
|
|
546
|
+
token?: string | undefined;
|
|
547
|
+
branch?: string | undefined;
|
|
548
|
+
bucket?: string | undefined;
|
|
549
|
+
prefix?: string | undefined;
|
|
550
|
+
token_env?: string | undefined;
|
|
551
|
+
base_url?: string | undefined;
|
|
552
|
+
}>>;
|
|
553
|
+
}, "strip", z.ZodTypeAny, {
|
|
554
|
+
sources: Record<string, {
|
|
555
|
+
type: "local" | "github" | "http" | "s3";
|
|
556
|
+
token?: string | undefined;
|
|
557
|
+
branch?: string | undefined;
|
|
558
|
+
bucket?: string | undefined;
|
|
559
|
+
prefix?: string | undefined;
|
|
560
|
+
token_env?: string | undefined;
|
|
561
|
+
base_url?: string | undefined;
|
|
562
|
+
}>;
|
|
563
|
+
}, {
|
|
564
|
+
sources: Record<string, {
|
|
565
|
+
type: "local" | "github" | "http" | "s3";
|
|
566
|
+
token?: string | undefined;
|
|
567
|
+
branch?: string | undefined;
|
|
568
|
+
bucket?: string | undefined;
|
|
569
|
+
prefix?: string | undefined;
|
|
570
|
+
token_env?: string | undefined;
|
|
571
|
+
base_url?: string | undefined;
|
|
572
|
+
}>;
|
|
573
|
+
}>>>;
|
|
464
574
|
}, "strict", z.ZodTypeAny, {
|
|
465
575
|
organizationSlug: string;
|
|
576
|
+
project?: string | undefined;
|
|
466
577
|
directories?: {
|
|
467
|
-
systems?: string | undefined;
|
|
468
578
|
source?: string | undefined;
|
|
579
|
+
systems?: string | undefined;
|
|
469
580
|
target?: string | undefined;
|
|
470
581
|
} | undefined;
|
|
471
582
|
rules?: {
|
|
@@ -495,11 +606,29 @@ declare const CodexConfigSchema: z.ZodObject<{
|
|
|
495
606
|
prefix?: string | undefined;
|
|
496
607
|
}>;
|
|
497
608
|
} | undefined;
|
|
609
|
+
auth?: {
|
|
610
|
+
github?: {
|
|
611
|
+
default_token_env?: string | undefined;
|
|
612
|
+
fallback_to_public?: boolean | undefined;
|
|
613
|
+
} | undefined;
|
|
614
|
+
} | undefined;
|
|
615
|
+
dependencies?: Record<string, {
|
|
616
|
+
sources: Record<string, {
|
|
617
|
+
type: "local" | "github" | "http" | "s3";
|
|
618
|
+
token?: string | undefined;
|
|
619
|
+
branch?: string | undefined;
|
|
620
|
+
bucket?: string | undefined;
|
|
621
|
+
prefix?: string | undefined;
|
|
622
|
+
token_env?: string | undefined;
|
|
623
|
+
base_url?: string | undefined;
|
|
624
|
+
}>;
|
|
625
|
+
}> | undefined;
|
|
498
626
|
}, {
|
|
499
627
|
organizationSlug: string;
|
|
628
|
+
project?: string | undefined;
|
|
500
629
|
directories?: {
|
|
501
|
-
systems?: string | undefined;
|
|
502
630
|
source?: string | undefined;
|
|
631
|
+
systems?: string | undefined;
|
|
503
632
|
target?: string | undefined;
|
|
504
633
|
} | undefined;
|
|
505
634
|
rules?: {
|
|
@@ -529,8 +658,588 @@ declare const CodexConfigSchema: z.ZodObject<{
|
|
|
529
658
|
prefix?: string | undefined;
|
|
530
659
|
}>;
|
|
531
660
|
} | undefined;
|
|
661
|
+
auth?: {
|
|
662
|
+
github?: {
|
|
663
|
+
default_token_env?: string | undefined;
|
|
664
|
+
fallback_to_public?: boolean | undefined;
|
|
665
|
+
} | undefined;
|
|
666
|
+
} | undefined;
|
|
667
|
+
dependencies?: Record<string, {
|
|
668
|
+
sources: Record<string, {
|
|
669
|
+
type: "local" | "github" | "http" | "s3";
|
|
670
|
+
token?: string | undefined;
|
|
671
|
+
branch?: string | undefined;
|
|
672
|
+
bucket?: string | undefined;
|
|
673
|
+
prefix?: string | undefined;
|
|
674
|
+
token_env?: string | undefined;
|
|
675
|
+
base_url?: string | undefined;
|
|
676
|
+
}>;
|
|
677
|
+
}> | undefined;
|
|
532
678
|
}>;
|
|
533
679
|
type CodexConfig = z.infer<typeof CodexConfigSchema>;
|
|
680
|
+
declare const UnifiedConfigSchema: z.ZodObject<{
|
|
681
|
+
file: z.ZodOptional<z.ZodObject<{
|
|
682
|
+
schema_version: z.ZodString;
|
|
683
|
+
sources: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
684
|
+
type: z.ZodEnum<["s3", "r2", "gcs", "local"]>;
|
|
685
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
686
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
687
|
+
region: z.ZodOptional<z.ZodString>;
|
|
688
|
+
local: z.ZodObject<{
|
|
689
|
+
base_path: z.ZodString;
|
|
690
|
+
}, "strip", z.ZodTypeAny, {
|
|
691
|
+
base_path: string;
|
|
692
|
+
}, {
|
|
693
|
+
base_path: string;
|
|
694
|
+
}>;
|
|
695
|
+
push: z.ZodOptional<z.ZodObject<{
|
|
696
|
+
compress: z.ZodOptional<z.ZodBoolean>;
|
|
697
|
+
keep_local: z.ZodOptional<z.ZodBoolean>;
|
|
698
|
+
}, "strip", z.ZodTypeAny, {
|
|
699
|
+
compress?: boolean | undefined;
|
|
700
|
+
keep_local?: boolean | undefined;
|
|
701
|
+
}, {
|
|
702
|
+
compress?: boolean | undefined;
|
|
703
|
+
keep_local?: boolean | undefined;
|
|
704
|
+
}>>;
|
|
705
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
706
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
707
|
+
}, "strip", z.ZodTypeAny, {
|
|
708
|
+
profile?: string | undefined;
|
|
709
|
+
}, {
|
|
710
|
+
profile?: string | undefined;
|
|
711
|
+
}>>;
|
|
712
|
+
}, "strip", z.ZodTypeAny, {
|
|
713
|
+
local: {
|
|
714
|
+
base_path: string;
|
|
715
|
+
};
|
|
716
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
717
|
+
push?: {
|
|
718
|
+
compress?: boolean | undefined;
|
|
719
|
+
keep_local?: boolean | undefined;
|
|
720
|
+
} | undefined;
|
|
721
|
+
bucket?: string | undefined;
|
|
722
|
+
prefix?: string | undefined;
|
|
723
|
+
auth?: {
|
|
724
|
+
profile?: string | undefined;
|
|
725
|
+
} | undefined;
|
|
726
|
+
region?: string | undefined;
|
|
727
|
+
}, {
|
|
728
|
+
local: {
|
|
729
|
+
base_path: string;
|
|
730
|
+
};
|
|
731
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
732
|
+
push?: {
|
|
733
|
+
compress?: boolean | undefined;
|
|
734
|
+
keep_local?: boolean | undefined;
|
|
735
|
+
} | undefined;
|
|
736
|
+
bucket?: string | undefined;
|
|
737
|
+
prefix?: string | undefined;
|
|
738
|
+
auth?: {
|
|
739
|
+
profile?: string | undefined;
|
|
740
|
+
} | undefined;
|
|
741
|
+
region?: string | undefined;
|
|
742
|
+
}>, {
|
|
743
|
+
local: {
|
|
744
|
+
base_path: string;
|
|
745
|
+
};
|
|
746
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
747
|
+
push?: {
|
|
748
|
+
compress?: boolean | undefined;
|
|
749
|
+
keep_local?: boolean | undefined;
|
|
750
|
+
} | undefined;
|
|
751
|
+
bucket?: string | undefined;
|
|
752
|
+
prefix?: string | undefined;
|
|
753
|
+
auth?: {
|
|
754
|
+
profile?: string | undefined;
|
|
755
|
+
} | undefined;
|
|
756
|
+
region?: string | undefined;
|
|
757
|
+
}, {
|
|
758
|
+
local: {
|
|
759
|
+
base_path: string;
|
|
760
|
+
};
|
|
761
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
762
|
+
push?: {
|
|
763
|
+
compress?: boolean | undefined;
|
|
764
|
+
keep_local?: boolean | undefined;
|
|
765
|
+
} | undefined;
|
|
766
|
+
bucket?: string | undefined;
|
|
767
|
+
prefix?: string | undefined;
|
|
768
|
+
auth?: {
|
|
769
|
+
profile?: string | undefined;
|
|
770
|
+
} | undefined;
|
|
771
|
+
region?: string | undefined;
|
|
772
|
+
}>>;
|
|
773
|
+
}, "strip", z.ZodTypeAny, {
|
|
774
|
+
sources: Record<string, {
|
|
775
|
+
local: {
|
|
776
|
+
base_path: string;
|
|
777
|
+
};
|
|
778
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
779
|
+
push?: {
|
|
780
|
+
compress?: boolean | undefined;
|
|
781
|
+
keep_local?: boolean | undefined;
|
|
782
|
+
} | undefined;
|
|
783
|
+
bucket?: string | undefined;
|
|
784
|
+
prefix?: string | undefined;
|
|
785
|
+
auth?: {
|
|
786
|
+
profile?: string | undefined;
|
|
787
|
+
} | undefined;
|
|
788
|
+
region?: string | undefined;
|
|
789
|
+
}>;
|
|
790
|
+
schema_version: string;
|
|
791
|
+
}, {
|
|
792
|
+
sources: Record<string, {
|
|
793
|
+
local: {
|
|
794
|
+
base_path: string;
|
|
795
|
+
};
|
|
796
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
797
|
+
push?: {
|
|
798
|
+
compress?: boolean | undefined;
|
|
799
|
+
keep_local?: boolean | undefined;
|
|
800
|
+
} | undefined;
|
|
801
|
+
bucket?: string | undefined;
|
|
802
|
+
prefix?: string | undefined;
|
|
803
|
+
auth?: {
|
|
804
|
+
profile?: string | undefined;
|
|
805
|
+
} | undefined;
|
|
806
|
+
region?: string | undefined;
|
|
807
|
+
}>;
|
|
808
|
+
schema_version: string;
|
|
809
|
+
}>>;
|
|
810
|
+
codex: z.ZodOptional<z.ZodObject<{
|
|
811
|
+
organizationSlug: z.ZodString;
|
|
812
|
+
project: z.ZodOptional<z.ZodString>;
|
|
813
|
+
directories: z.ZodOptional<z.ZodObject<{
|
|
814
|
+
source: z.ZodOptional<z.ZodString>;
|
|
815
|
+
target: z.ZodOptional<z.ZodString>;
|
|
816
|
+
systems: z.ZodOptional<z.ZodString>;
|
|
817
|
+
}, "strip", z.ZodTypeAny, {
|
|
818
|
+
source?: string | undefined;
|
|
819
|
+
systems?: string | undefined;
|
|
820
|
+
target?: string | undefined;
|
|
821
|
+
}, {
|
|
822
|
+
source?: string | undefined;
|
|
823
|
+
systems?: string | undefined;
|
|
824
|
+
target?: string | undefined;
|
|
825
|
+
}>>;
|
|
826
|
+
rules: z.ZodOptional<z.ZodObject<{
|
|
827
|
+
autoSyncPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
828
|
+
pattern: z.ZodString;
|
|
829
|
+
include: z.ZodArray<z.ZodString, "many">;
|
|
830
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
831
|
+
}, "strip", z.ZodTypeAny, {
|
|
832
|
+
include: string[];
|
|
833
|
+
pattern: string;
|
|
834
|
+
exclude?: string[] | undefined;
|
|
835
|
+
}, {
|
|
836
|
+
include: string[];
|
|
837
|
+
pattern: string;
|
|
838
|
+
exclude?: string[] | undefined;
|
|
839
|
+
}>, "many">>;
|
|
840
|
+
preventSelfSync: z.ZodOptional<z.ZodBoolean>;
|
|
841
|
+
preventCodexSync: z.ZodOptional<z.ZodBoolean>;
|
|
842
|
+
allowProjectOverrides: z.ZodOptional<z.ZodBoolean>;
|
|
843
|
+
defaultInclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
844
|
+
defaultExclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
845
|
+
}, "strip", z.ZodTypeAny, {
|
|
846
|
+
autoSyncPatterns?: {
|
|
847
|
+
include: string[];
|
|
848
|
+
pattern: string;
|
|
849
|
+
exclude?: string[] | undefined;
|
|
850
|
+
}[] | undefined;
|
|
851
|
+
preventSelfSync?: boolean | undefined;
|
|
852
|
+
preventCodexSync?: boolean | undefined;
|
|
853
|
+
allowProjectOverrides?: boolean | undefined;
|
|
854
|
+
defaultInclude?: string[] | undefined;
|
|
855
|
+
defaultExclude?: string[] | undefined;
|
|
856
|
+
}, {
|
|
857
|
+
autoSyncPatterns?: {
|
|
858
|
+
include: string[];
|
|
859
|
+
pattern: string;
|
|
860
|
+
exclude?: string[] | undefined;
|
|
861
|
+
}[] | undefined;
|
|
862
|
+
preventSelfSync?: boolean | undefined;
|
|
863
|
+
preventCodexSync?: boolean | undefined;
|
|
864
|
+
allowProjectOverrides?: boolean | undefined;
|
|
865
|
+
defaultInclude?: string[] | undefined;
|
|
866
|
+
defaultExclude?: string[] | undefined;
|
|
867
|
+
}>>;
|
|
868
|
+
sync: z.ZodOptional<z.ZodObject<{
|
|
869
|
+
to_codex: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
870
|
+
from_codex: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
871
|
+
default_to_codex: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
872
|
+
default_from_codex: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
873
|
+
}, "strip", z.ZodTypeAny, {
|
|
874
|
+
to_codex?: string[] | undefined;
|
|
875
|
+
from_codex?: string[] | undefined;
|
|
876
|
+
default_to_codex?: string[] | undefined;
|
|
877
|
+
default_from_codex?: string[] | undefined;
|
|
878
|
+
}, {
|
|
879
|
+
to_codex?: string[] | undefined;
|
|
880
|
+
from_codex?: string[] | undefined;
|
|
881
|
+
default_to_codex?: string[] | undefined;
|
|
882
|
+
default_from_codex?: string[] | undefined;
|
|
883
|
+
}>>;
|
|
884
|
+
archive: z.ZodOptional<z.ZodObject<{
|
|
885
|
+
projects: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
886
|
+
enabled: z.ZodBoolean;
|
|
887
|
+
handler: z.ZodEnum<["s3", "r2", "gcs", "local"]>;
|
|
888
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
889
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
890
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
891
|
+
}, "strip", z.ZodTypeAny, {
|
|
892
|
+
enabled: boolean;
|
|
893
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
894
|
+
patterns?: string[] | undefined;
|
|
895
|
+
bucket?: string | undefined;
|
|
896
|
+
prefix?: string | undefined;
|
|
897
|
+
}, {
|
|
898
|
+
enabled: boolean;
|
|
899
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
900
|
+
patterns?: string[] | undefined;
|
|
901
|
+
bucket?: string | undefined;
|
|
902
|
+
prefix?: string | undefined;
|
|
903
|
+
}>>;
|
|
904
|
+
}, "strip", z.ZodTypeAny, {
|
|
905
|
+
projects: Record<string, {
|
|
906
|
+
enabled: boolean;
|
|
907
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
908
|
+
patterns?: string[] | undefined;
|
|
909
|
+
bucket?: string | undefined;
|
|
910
|
+
prefix?: string | undefined;
|
|
911
|
+
}>;
|
|
912
|
+
}, {
|
|
913
|
+
projects: Record<string, {
|
|
914
|
+
enabled: boolean;
|
|
915
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
916
|
+
patterns?: string[] | undefined;
|
|
917
|
+
bucket?: string | undefined;
|
|
918
|
+
prefix?: string | undefined;
|
|
919
|
+
}>;
|
|
920
|
+
}>>;
|
|
921
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
922
|
+
github: z.ZodOptional<z.ZodObject<{
|
|
923
|
+
default_token_env: z.ZodOptional<z.ZodString>;
|
|
924
|
+
fallback_to_public: z.ZodOptional<z.ZodBoolean>;
|
|
925
|
+
}, "strip", z.ZodTypeAny, {
|
|
926
|
+
default_token_env?: string | undefined;
|
|
927
|
+
fallback_to_public?: boolean | undefined;
|
|
928
|
+
}, {
|
|
929
|
+
default_token_env?: string | undefined;
|
|
930
|
+
fallback_to_public?: boolean | undefined;
|
|
931
|
+
}>>;
|
|
932
|
+
}, "strip", z.ZodTypeAny, {
|
|
933
|
+
github?: {
|
|
934
|
+
default_token_env?: string | undefined;
|
|
935
|
+
fallback_to_public?: boolean | undefined;
|
|
936
|
+
} | undefined;
|
|
937
|
+
}, {
|
|
938
|
+
github?: {
|
|
939
|
+
default_token_env?: string | undefined;
|
|
940
|
+
fallback_to_public?: boolean | undefined;
|
|
941
|
+
} | undefined;
|
|
942
|
+
}>>;
|
|
943
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
944
|
+
sources: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
945
|
+
type: z.ZodEnum<["github", "s3", "http", "local"]>;
|
|
946
|
+
token_env: z.ZodOptional<z.ZodString>;
|
|
947
|
+
token: z.ZodOptional<z.ZodString>;
|
|
948
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
949
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
950
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
951
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
952
|
+
}, "strip", z.ZodTypeAny, {
|
|
953
|
+
type: "local" | "github" | "http" | "s3";
|
|
954
|
+
token?: string | undefined;
|
|
955
|
+
branch?: string | undefined;
|
|
956
|
+
bucket?: string | undefined;
|
|
957
|
+
prefix?: string | undefined;
|
|
958
|
+
token_env?: string | undefined;
|
|
959
|
+
base_url?: string | undefined;
|
|
960
|
+
}, {
|
|
961
|
+
type: "local" | "github" | "http" | "s3";
|
|
962
|
+
token?: string | undefined;
|
|
963
|
+
branch?: string | undefined;
|
|
964
|
+
bucket?: string | undefined;
|
|
965
|
+
prefix?: string | undefined;
|
|
966
|
+
token_env?: string | undefined;
|
|
967
|
+
base_url?: string | undefined;
|
|
968
|
+
}>>;
|
|
969
|
+
}, "strip", z.ZodTypeAny, {
|
|
970
|
+
sources: Record<string, {
|
|
971
|
+
type: "local" | "github" | "http" | "s3";
|
|
972
|
+
token?: string | undefined;
|
|
973
|
+
branch?: string | undefined;
|
|
974
|
+
bucket?: string | undefined;
|
|
975
|
+
prefix?: string | undefined;
|
|
976
|
+
token_env?: string | undefined;
|
|
977
|
+
base_url?: string | undefined;
|
|
978
|
+
}>;
|
|
979
|
+
}, {
|
|
980
|
+
sources: Record<string, {
|
|
981
|
+
type: "local" | "github" | "http" | "s3";
|
|
982
|
+
token?: string | undefined;
|
|
983
|
+
branch?: string | undefined;
|
|
984
|
+
bucket?: string | undefined;
|
|
985
|
+
prefix?: string | undefined;
|
|
986
|
+
token_env?: string | undefined;
|
|
987
|
+
base_url?: string | undefined;
|
|
988
|
+
}>;
|
|
989
|
+
}>>>;
|
|
990
|
+
}, "strict", z.ZodTypeAny, {
|
|
991
|
+
organizationSlug: string;
|
|
992
|
+
project?: string | undefined;
|
|
993
|
+
directories?: {
|
|
994
|
+
source?: string | undefined;
|
|
995
|
+
systems?: string | undefined;
|
|
996
|
+
target?: string | undefined;
|
|
997
|
+
} | undefined;
|
|
998
|
+
rules?: {
|
|
999
|
+
autoSyncPatterns?: {
|
|
1000
|
+
include: string[];
|
|
1001
|
+
pattern: string;
|
|
1002
|
+
exclude?: string[] | undefined;
|
|
1003
|
+
}[] | undefined;
|
|
1004
|
+
preventSelfSync?: boolean | undefined;
|
|
1005
|
+
preventCodexSync?: boolean | undefined;
|
|
1006
|
+
allowProjectOverrides?: boolean | undefined;
|
|
1007
|
+
defaultInclude?: string[] | undefined;
|
|
1008
|
+
defaultExclude?: string[] | undefined;
|
|
1009
|
+
} | undefined;
|
|
1010
|
+
sync?: {
|
|
1011
|
+
to_codex?: string[] | undefined;
|
|
1012
|
+
from_codex?: string[] | undefined;
|
|
1013
|
+
default_to_codex?: string[] | undefined;
|
|
1014
|
+
default_from_codex?: string[] | undefined;
|
|
1015
|
+
} | undefined;
|
|
1016
|
+
archive?: {
|
|
1017
|
+
projects: Record<string, {
|
|
1018
|
+
enabled: boolean;
|
|
1019
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
1020
|
+
patterns?: string[] | undefined;
|
|
1021
|
+
bucket?: string | undefined;
|
|
1022
|
+
prefix?: string | undefined;
|
|
1023
|
+
}>;
|
|
1024
|
+
} | undefined;
|
|
1025
|
+
auth?: {
|
|
1026
|
+
github?: {
|
|
1027
|
+
default_token_env?: string | undefined;
|
|
1028
|
+
fallback_to_public?: boolean | undefined;
|
|
1029
|
+
} | undefined;
|
|
1030
|
+
} | undefined;
|
|
1031
|
+
dependencies?: Record<string, {
|
|
1032
|
+
sources: Record<string, {
|
|
1033
|
+
type: "local" | "github" | "http" | "s3";
|
|
1034
|
+
token?: string | undefined;
|
|
1035
|
+
branch?: string | undefined;
|
|
1036
|
+
bucket?: string | undefined;
|
|
1037
|
+
prefix?: string | undefined;
|
|
1038
|
+
token_env?: string | undefined;
|
|
1039
|
+
base_url?: string | undefined;
|
|
1040
|
+
}>;
|
|
1041
|
+
}> | undefined;
|
|
1042
|
+
}, {
|
|
1043
|
+
organizationSlug: string;
|
|
1044
|
+
project?: string | undefined;
|
|
1045
|
+
directories?: {
|
|
1046
|
+
source?: string | undefined;
|
|
1047
|
+
systems?: string | undefined;
|
|
1048
|
+
target?: string | undefined;
|
|
1049
|
+
} | undefined;
|
|
1050
|
+
rules?: {
|
|
1051
|
+
autoSyncPatterns?: {
|
|
1052
|
+
include: string[];
|
|
1053
|
+
pattern: string;
|
|
1054
|
+
exclude?: string[] | undefined;
|
|
1055
|
+
}[] | undefined;
|
|
1056
|
+
preventSelfSync?: boolean | undefined;
|
|
1057
|
+
preventCodexSync?: boolean | undefined;
|
|
1058
|
+
allowProjectOverrides?: boolean | undefined;
|
|
1059
|
+
defaultInclude?: string[] | undefined;
|
|
1060
|
+
defaultExclude?: string[] | undefined;
|
|
1061
|
+
} | undefined;
|
|
1062
|
+
sync?: {
|
|
1063
|
+
to_codex?: string[] | undefined;
|
|
1064
|
+
from_codex?: string[] | undefined;
|
|
1065
|
+
default_to_codex?: string[] | undefined;
|
|
1066
|
+
default_from_codex?: string[] | undefined;
|
|
1067
|
+
} | undefined;
|
|
1068
|
+
archive?: {
|
|
1069
|
+
projects: Record<string, {
|
|
1070
|
+
enabled: boolean;
|
|
1071
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
1072
|
+
patterns?: string[] | undefined;
|
|
1073
|
+
bucket?: string | undefined;
|
|
1074
|
+
prefix?: string | undefined;
|
|
1075
|
+
}>;
|
|
1076
|
+
} | undefined;
|
|
1077
|
+
auth?: {
|
|
1078
|
+
github?: {
|
|
1079
|
+
default_token_env?: string | undefined;
|
|
1080
|
+
fallback_to_public?: boolean | undefined;
|
|
1081
|
+
} | undefined;
|
|
1082
|
+
} | undefined;
|
|
1083
|
+
dependencies?: Record<string, {
|
|
1084
|
+
sources: Record<string, {
|
|
1085
|
+
type: "local" | "github" | "http" | "s3";
|
|
1086
|
+
token?: string | undefined;
|
|
1087
|
+
branch?: string | undefined;
|
|
1088
|
+
bucket?: string | undefined;
|
|
1089
|
+
prefix?: string | undefined;
|
|
1090
|
+
token_env?: string | undefined;
|
|
1091
|
+
base_url?: string | undefined;
|
|
1092
|
+
}>;
|
|
1093
|
+
}> | undefined;
|
|
1094
|
+
}>>;
|
|
1095
|
+
}, "strip", z.ZodTypeAny, {
|
|
1096
|
+
file?: {
|
|
1097
|
+
sources: Record<string, {
|
|
1098
|
+
local: {
|
|
1099
|
+
base_path: string;
|
|
1100
|
+
};
|
|
1101
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
1102
|
+
push?: {
|
|
1103
|
+
compress?: boolean | undefined;
|
|
1104
|
+
keep_local?: boolean | undefined;
|
|
1105
|
+
} | undefined;
|
|
1106
|
+
bucket?: string | undefined;
|
|
1107
|
+
prefix?: string | undefined;
|
|
1108
|
+
auth?: {
|
|
1109
|
+
profile?: string | undefined;
|
|
1110
|
+
} | undefined;
|
|
1111
|
+
region?: string | undefined;
|
|
1112
|
+
}>;
|
|
1113
|
+
schema_version: string;
|
|
1114
|
+
} | undefined;
|
|
1115
|
+
codex?: {
|
|
1116
|
+
organizationSlug: string;
|
|
1117
|
+
project?: string | undefined;
|
|
1118
|
+
directories?: {
|
|
1119
|
+
source?: string | undefined;
|
|
1120
|
+
systems?: string | undefined;
|
|
1121
|
+
target?: string | undefined;
|
|
1122
|
+
} | undefined;
|
|
1123
|
+
rules?: {
|
|
1124
|
+
autoSyncPatterns?: {
|
|
1125
|
+
include: string[];
|
|
1126
|
+
pattern: string;
|
|
1127
|
+
exclude?: string[] | undefined;
|
|
1128
|
+
}[] | undefined;
|
|
1129
|
+
preventSelfSync?: boolean | undefined;
|
|
1130
|
+
preventCodexSync?: boolean | undefined;
|
|
1131
|
+
allowProjectOverrides?: boolean | undefined;
|
|
1132
|
+
defaultInclude?: string[] | undefined;
|
|
1133
|
+
defaultExclude?: string[] | undefined;
|
|
1134
|
+
} | undefined;
|
|
1135
|
+
sync?: {
|
|
1136
|
+
to_codex?: string[] | undefined;
|
|
1137
|
+
from_codex?: string[] | undefined;
|
|
1138
|
+
default_to_codex?: string[] | undefined;
|
|
1139
|
+
default_from_codex?: string[] | undefined;
|
|
1140
|
+
} | undefined;
|
|
1141
|
+
archive?: {
|
|
1142
|
+
projects: Record<string, {
|
|
1143
|
+
enabled: boolean;
|
|
1144
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
1145
|
+
patterns?: string[] | undefined;
|
|
1146
|
+
bucket?: string | undefined;
|
|
1147
|
+
prefix?: string | undefined;
|
|
1148
|
+
}>;
|
|
1149
|
+
} | undefined;
|
|
1150
|
+
auth?: {
|
|
1151
|
+
github?: {
|
|
1152
|
+
default_token_env?: string | undefined;
|
|
1153
|
+
fallback_to_public?: boolean | undefined;
|
|
1154
|
+
} | undefined;
|
|
1155
|
+
} | undefined;
|
|
1156
|
+
dependencies?: Record<string, {
|
|
1157
|
+
sources: Record<string, {
|
|
1158
|
+
type: "local" | "github" | "http" | "s3";
|
|
1159
|
+
token?: string | undefined;
|
|
1160
|
+
branch?: string | undefined;
|
|
1161
|
+
bucket?: string | undefined;
|
|
1162
|
+
prefix?: string | undefined;
|
|
1163
|
+
token_env?: string | undefined;
|
|
1164
|
+
base_url?: string | undefined;
|
|
1165
|
+
}>;
|
|
1166
|
+
}> | undefined;
|
|
1167
|
+
} | undefined;
|
|
1168
|
+
}, {
|
|
1169
|
+
file?: {
|
|
1170
|
+
sources: Record<string, {
|
|
1171
|
+
local: {
|
|
1172
|
+
base_path: string;
|
|
1173
|
+
};
|
|
1174
|
+
type: "local" | "s3" | "r2" | "gcs";
|
|
1175
|
+
push?: {
|
|
1176
|
+
compress?: boolean | undefined;
|
|
1177
|
+
keep_local?: boolean | undefined;
|
|
1178
|
+
} | undefined;
|
|
1179
|
+
bucket?: string | undefined;
|
|
1180
|
+
prefix?: string | undefined;
|
|
1181
|
+
auth?: {
|
|
1182
|
+
profile?: string | undefined;
|
|
1183
|
+
} | undefined;
|
|
1184
|
+
region?: string | undefined;
|
|
1185
|
+
}>;
|
|
1186
|
+
schema_version: string;
|
|
1187
|
+
} | undefined;
|
|
1188
|
+
codex?: {
|
|
1189
|
+
organizationSlug: string;
|
|
1190
|
+
project?: string | undefined;
|
|
1191
|
+
directories?: {
|
|
1192
|
+
source?: string | undefined;
|
|
1193
|
+
systems?: string | undefined;
|
|
1194
|
+
target?: string | undefined;
|
|
1195
|
+
} | undefined;
|
|
1196
|
+
rules?: {
|
|
1197
|
+
autoSyncPatterns?: {
|
|
1198
|
+
include: string[];
|
|
1199
|
+
pattern: string;
|
|
1200
|
+
exclude?: string[] | undefined;
|
|
1201
|
+
}[] | undefined;
|
|
1202
|
+
preventSelfSync?: boolean | undefined;
|
|
1203
|
+
preventCodexSync?: boolean | undefined;
|
|
1204
|
+
allowProjectOverrides?: boolean | undefined;
|
|
1205
|
+
defaultInclude?: string[] | undefined;
|
|
1206
|
+
defaultExclude?: string[] | undefined;
|
|
1207
|
+
} | undefined;
|
|
1208
|
+
sync?: {
|
|
1209
|
+
to_codex?: string[] | undefined;
|
|
1210
|
+
from_codex?: string[] | undefined;
|
|
1211
|
+
default_to_codex?: string[] | undefined;
|
|
1212
|
+
default_from_codex?: string[] | undefined;
|
|
1213
|
+
} | undefined;
|
|
1214
|
+
archive?: {
|
|
1215
|
+
projects: Record<string, {
|
|
1216
|
+
enabled: boolean;
|
|
1217
|
+
handler: "local" | "s3" | "r2" | "gcs";
|
|
1218
|
+
patterns?: string[] | undefined;
|
|
1219
|
+
bucket?: string | undefined;
|
|
1220
|
+
prefix?: string | undefined;
|
|
1221
|
+
}>;
|
|
1222
|
+
} | undefined;
|
|
1223
|
+
auth?: {
|
|
1224
|
+
github?: {
|
|
1225
|
+
default_token_env?: string | undefined;
|
|
1226
|
+
fallback_to_public?: boolean | undefined;
|
|
1227
|
+
} | undefined;
|
|
1228
|
+
} | undefined;
|
|
1229
|
+
dependencies?: Record<string, {
|
|
1230
|
+
sources: Record<string, {
|
|
1231
|
+
type: "local" | "github" | "http" | "s3";
|
|
1232
|
+
token?: string | undefined;
|
|
1233
|
+
branch?: string | undefined;
|
|
1234
|
+
bucket?: string | undefined;
|
|
1235
|
+
prefix?: string | undefined;
|
|
1236
|
+
token_env?: string | undefined;
|
|
1237
|
+
base_url?: string | undefined;
|
|
1238
|
+
}>;
|
|
1239
|
+
}> | undefined;
|
|
1240
|
+
} | undefined;
|
|
1241
|
+
}>;
|
|
1242
|
+
type UnifiedConfig = z.infer<typeof UnifiedConfigSchema>;
|
|
534
1243
|
|
|
535
1244
|
interface ParseMetadataOptions {
|
|
536
1245
|
strict?: boolean;
|
|
@@ -604,43 +1313,6 @@ interface CustomSyncDestination {
|
|
|
604
1313
|
declare function parseCustomDestination(value: string): CustomSyncDestination;
|
|
605
1314
|
declare function getCustomSyncDestinations(metadata: Metadata): CustomSyncDestination[];
|
|
606
1315
|
|
|
607
|
-
type StorageProviderType = 'local' | 'github' | 'http' | 's3' | 's3-archive' | 'r2' | 'gcs' | 'drive';
|
|
608
|
-
interface FetchResult {
|
|
609
|
-
content: Buffer;
|
|
610
|
-
contentType: string;
|
|
611
|
-
size: number;
|
|
612
|
-
source: string;
|
|
613
|
-
metadata?: Record<string, unknown>;
|
|
614
|
-
}
|
|
615
|
-
interface FetchOptions {
|
|
616
|
-
timeout?: number;
|
|
617
|
-
maxRetries?: number;
|
|
618
|
-
token?: string;
|
|
619
|
-
branch?: string;
|
|
620
|
-
followRedirects?: boolean;
|
|
621
|
-
maxSize?: number;
|
|
622
|
-
}
|
|
623
|
-
interface StorageProvider {
|
|
624
|
-
readonly name: string;
|
|
625
|
-
readonly type: StorageProviderType;
|
|
626
|
-
fetch(reference: ResolvedReference, options?: FetchOptions): Promise<FetchResult>;
|
|
627
|
-
exists(reference: ResolvedReference, options?: FetchOptions): Promise<boolean>;
|
|
628
|
-
canHandle(reference: ResolvedReference): boolean;
|
|
629
|
-
}
|
|
630
|
-
interface StorageProviderConfig {
|
|
631
|
-
type: StorageProviderType;
|
|
632
|
-
options?: Record<string, unknown>;
|
|
633
|
-
timeout?: number;
|
|
634
|
-
maxRetries?: number;
|
|
635
|
-
auth?: {
|
|
636
|
-
tokenEnv?: string;
|
|
637
|
-
token?: string;
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
declare const DEFAULT_FETCH_OPTIONS: Required<FetchOptions>;
|
|
641
|
-
declare function mergeFetchOptions(options?: FetchOptions): Required<FetchOptions>;
|
|
642
|
-
declare function detectContentType(path: string): string;
|
|
643
|
-
|
|
644
1316
|
interface LocalStorageOptions {
|
|
645
1317
|
baseDir?: string;
|
|
646
1318
|
}
|
|
@@ -708,6 +1380,35 @@ declare class HttpStorage implements StorageProvider {
|
|
|
708
1380
|
}
|
|
709
1381
|
declare function createHttpStorage(options?: HttpStorageOptions): HttpStorage;
|
|
710
1382
|
|
|
1383
|
+
interface FilePluginStorageOptions {
|
|
1384
|
+
config: UnifiedConfig;
|
|
1385
|
+
enableS3Fallback?: boolean;
|
|
1386
|
+
baseDir?: string;
|
|
1387
|
+
}
|
|
1388
|
+
declare class FilePluginStorage implements StorageProvider {
|
|
1389
|
+
private options;
|
|
1390
|
+
readonly name = "file-plugin";
|
|
1391
|
+
readonly type: "local";
|
|
1392
|
+
private sourceResolver;
|
|
1393
|
+
private baseDir;
|
|
1394
|
+
constructor(options: FilePluginStorageOptions);
|
|
1395
|
+
canHandle(reference: ResolvedReference): boolean;
|
|
1396
|
+
fetch(reference: ResolvedReference, _options?: FetchOptions): Promise<FetchResult>;
|
|
1397
|
+
exists(reference: ResolvedReference, _options?: FetchOptions): Promise<boolean>;
|
|
1398
|
+
private detectContentType;
|
|
1399
|
+
private createFileNotFoundError;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
interface FilePluginFileNotFoundErrorOptions {
|
|
1403
|
+
includeCloudSuggestions?: boolean;
|
|
1404
|
+
storageType?: string;
|
|
1405
|
+
}
|
|
1406
|
+
declare class FilePluginFileNotFoundError extends Error {
|
|
1407
|
+
readonly filePath: string;
|
|
1408
|
+
readonly sourceName: string;
|
|
1409
|
+
constructor(filePath: string, sourceName: string, options?: FilePluginFileNotFoundErrorOptions);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
711
1412
|
interface ArchiveProjectConfig {
|
|
712
1413
|
enabled: boolean;
|
|
713
1414
|
handler: 's3' | 'r2' | 'gcs' | 'local';
|
|
@@ -725,13 +1426,18 @@ interface StorageManagerConfig {
|
|
|
725
1426
|
github?: GitHubStorageOptions;
|
|
726
1427
|
http?: HttpStorageOptions;
|
|
727
1428
|
s3Archive?: S3ArchiveStorageOptions;
|
|
1429
|
+
filePlugin?: FilePluginStorageOptions;
|
|
728
1430
|
priority?: StorageProviderType[];
|
|
729
1431
|
enableCaching?: boolean;
|
|
1432
|
+
codexConfig?: CodexConfig;
|
|
730
1433
|
}
|
|
731
1434
|
declare class StorageManager {
|
|
732
1435
|
private providers;
|
|
733
1436
|
private priority;
|
|
1437
|
+
private codexConfig?;
|
|
734
1438
|
constructor(config?: StorageManagerConfig);
|
|
1439
|
+
private resolveToken;
|
|
1440
|
+
private resolveFetchOptions;
|
|
735
1441
|
registerProvider(provider: StorageProvider): void;
|
|
736
1442
|
removeProvider(type: StorageProviderType): boolean;
|
|
737
1443
|
getProvider(type: StorageProviderType): StorageProvider | undefined;
|
|
@@ -1270,4 +1976,4 @@ declare function hasLegacyReferences(text: string): boolean;
|
|
|
1270
1976
|
declare function migrateFileReferences(content: string, options?: ConversionOptions): ReferenceConversionResult;
|
|
1271
1977
|
declare function generateReferenceMigrationSummary(results: ReferenceConversionResult[]): string;
|
|
1272
1978
|
|
|
1273
|
-
export { type ArtifactType, type AutoSyncPattern, AutoSyncPatternSchema, BUILT_IN_TYPES, CODEX_URI_PREFIX, type CacheEntry, type CacheEntryMetadata, type CacheEntryStatus, type CacheLookupResult, CacheManager, type CacheManagerConfig, CachePersistence, type CachePersistenceOptions, type CacheStats, type CodexConfig, CodexConfigSchema, CodexError, CommonRules, ConfigurationError, type ConversionOptions, type ConvertedReference, type CustomSyncDestination, type CustomTypeConfig, CustomTypeSchema, DEFAULT_CACHE_DIR, DEFAULT_FETCH_OPTIONS, DEFAULT_MIGRATION_OPTIONS, DEFAULT_PERMISSION_CONFIG, DEFAULT_SYNC_CONFIG, DEFAULT_TYPE, type EvaluationResult, type EvaluationSummary, type FetchOptions, type FetchResult, type FileInfo, type FileSyncStatus, GitHubStorage, type GitHubStorageOptions, HttpStorage, type HttpStorageOptions, LEGACY_PATTERNS, LEGACY_REF_PREFIX, type LegacyAutoSyncPattern, type LegacyCodexConfig, type LoadConfigOptions, LocalStorage, type LocalStorageOptions, type Metadata, MetadataSchema, type MigrationChange, type MigrationOptions, type MigrationResult, type ModernCodexConfig, type ModernSyncPattern, PERMISSION_LEVEL_ORDER, type ParseMetadataOptions, type ParseOptions, type ParseResult, type ParsedReference, type PermissionAction, type PermissionConfig, type PermissionContext, PermissionDeniedError, type PermissionLevel, PermissionManager, type PermissionManagerConfig, type PermissionResult, type PermissionRule, type PermissionScope, type PlanStats, type ReferenceConversionResult, type ResolveOptions, type ResolveOrgOptions, type ResolvedReference, type SerializedCacheEntry, type ShouldSyncOptions, StorageManager, type StorageManagerConfig, type StorageProvider, type StorageProviderConfig, type StorageProviderType, type SyncConfig, type SyncDirection, SyncManager, type SyncManagerConfig, type SyncManifest, type SyncManifestEntry, type SyncOperation, type SyncOptions, type SyncPlan, type SyncResult, type SyncRule, type SyncRules, SyncRulesSchema, TTL, TypeRegistry, type TypeRegistryOptions, type TypesConfig, TypesConfigSchema, ValidationError, type VersionDetectionResult, buildUri, calculateCachePath, calculateContentHash, convertLegacyReference, convertLegacyReferences, convertToUri, createCacheEntry, createCacheManager, createCachePersistence, createDefaultRegistry, createEmptyModernConfig, createEmptySyncPlan, createGitHubStorage, createHttpStorage, createLocalStorage, createPermissionManager, createRule, createRulesFromPatterns, createStorageManager, createSyncManager, createSyncPlan, deserializeCacheEntry, detectContentType, detectCurrentProject, detectVersion, estimateSyncTime, evaluatePath, evaluatePaths, evaluatePatterns, evaluatePermission, evaluatePermissions, extendType, extractOrgFromRepoName, extractRawFrontmatter, filterByPatterns, filterByPermission, filterPlanOperations, filterSyncablePaths, findLegacyReferences, formatPlanSummary, generateMigrationReport, generateReferenceMigrationSummary, getBuiltInType, getBuiltInTypeNames, getCacheEntryAge, getCacheEntryStatus, getCurrentContext, getCustomSyncDestinations, getDefaultCacheManager, getDefaultConfig, getDefaultDirectories, getDefaultPermissionManager, getDefaultRules, getDefaultStorageManager, getDirectory, getExtension, getFilename, getMigrationRequirements, getPlanStats, getRelativeCachePath, getRemainingTtl, getTargetRepos, hasContentChanged, hasFrontmatter, hasLegacyReferences, hasPermission as hasPermissionLevel, isBuiltInType, isCacheEntryFresh, isCacheEntryValid, isCurrentProjectUri, isLegacyConfig, isLegacyReference, isModernConfig, isAllowed as isPermissionAllowed, isValidUri, levelGrants, loadConfig, loadCustomTypes, matchAnyPattern, matchPattern, maxLevel, mergeFetchOptions, mergeRules, mergeTypes, migrateConfig, migrateFileReferences, minLevel, needsMigration, parseCustomDestination, parseMetadata, parseReference, parseTtl, resolveOrganization, resolveReference, resolveReferences, ruleMatchesAction, ruleMatchesContext, ruleMatchesPath, sanitizePath, serializeCacheEntry, setDefaultCacheManager, setDefaultPermissionManager, setDefaultStorageManager, shouldSyncToRepo, summarizeEvaluations, touchCacheEntry, validateCustomTypes, validateMetadata, validateMigratedConfig, validateOrg, validatePath, validateRules as validatePermissionRules, validateProject, validateRules$1 as validateRules, validateUri };
|
|
1979
|
+
export { type ArtifactType, type AutoSyncPattern, AutoSyncPatternSchema, BUILT_IN_TYPES, CODEX_URI_PREFIX, type CacheEntry, type CacheEntryMetadata, type CacheEntryStatus, type CacheLookupResult, CacheManager, type CacheManagerConfig, CachePersistence, type CachePersistenceOptions, type CacheStats, type CodexConfig, CodexConfigSchema, CodexError, CommonRules, ConfigurationError, type ConversionOptions, type ConvertedReference, type CustomSyncDestination, type CustomTypeConfig, CustomTypeSchema, DEFAULT_CACHE_DIR, DEFAULT_FETCH_OPTIONS, DEFAULT_MIGRATION_OPTIONS, DEFAULT_PERMISSION_CONFIG, DEFAULT_SYNC_CONFIG, DEFAULT_TYPE, type EvaluationResult, type EvaluationSummary, type FetchOptions, type FetchResult, type FileInfo, FilePluginFileNotFoundError, type FilePluginFileNotFoundErrorOptions, FilePluginStorage, type FilePluginStorageOptions, type FileSyncStatus, GitHubStorage, type GitHubStorageOptions, HttpStorage, type HttpStorageOptions, LEGACY_PATTERNS, LEGACY_REF_PREFIX, type LegacyAutoSyncPattern, type LegacyCodexConfig, type LoadConfigOptions, LocalStorage, type LocalStorageOptions, type Metadata, MetadataSchema, type MigrationChange, type MigrationOptions, type MigrationResult, type ModernCodexConfig, type ModernSyncPattern, PERMISSION_LEVEL_ORDER, type ParseMetadataOptions, type ParseOptions, type ParseResult, type ParsedReference, type PermissionAction, type PermissionConfig, type PermissionContext, PermissionDeniedError, type PermissionLevel, PermissionManager, type PermissionManagerConfig, type PermissionResult, type PermissionRule, type PermissionScope, type PlanStats, type ReferenceConversionResult, type ResolveOptions, type ResolveOrgOptions, type ResolvedReference, type SerializedCacheEntry, type ShouldSyncOptions, StorageManager, type StorageManagerConfig, type StorageProvider, type StorageProviderConfig, type StorageProviderType, type SyncConfig, type SyncDirection, SyncManager, type SyncManagerConfig, type SyncManifest, type SyncManifestEntry, type SyncOperation, type SyncOptions, type SyncPlan, type SyncResult, type SyncRule, type SyncRules, SyncRulesSchema, TTL, TypeRegistry, type TypeRegistryOptions, type TypesConfig, TypesConfigSchema, ValidationError, type VersionDetectionResult, buildUri, calculateCachePath, calculateContentHash, convertLegacyReference, convertLegacyReferences, convertToUri, createCacheEntry, createCacheManager, createCachePersistence, createDefaultRegistry, createEmptyModernConfig, createEmptySyncPlan, createGitHubStorage, createHttpStorage, createLocalStorage, createPermissionManager, createRule, createRulesFromPatterns, createStorageManager, createSyncManager, createSyncPlan, deserializeCacheEntry, detectContentType, detectCurrentProject, detectVersion, estimateSyncTime, evaluatePath, evaluatePaths, evaluatePatterns, evaluatePermission, evaluatePermissions, extendType, extractOrgFromRepoName, extractRawFrontmatter, filterByPatterns, filterByPermission, filterPlanOperations, filterSyncablePaths, findLegacyReferences, formatPlanSummary, generateMigrationReport, generateReferenceMigrationSummary, getBuiltInType, getBuiltInTypeNames, getCacheEntryAge, getCacheEntryStatus, getCurrentContext, getCustomSyncDestinations, getDefaultCacheManager, getDefaultConfig, getDefaultDirectories, getDefaultPermissionManager, getDefaultRules, getDefaultStorageManager, getDirectory, getExtension, getFilename, getMigrationRequirements, getPlanStats, getRelativeCachePath, getRemainingTtl, getTargetRepos, hasContentChanged, hasFrontmatter, hasLegacyReferences, hasPermission as hasPermissionLevel, isBuiltInType, isCacheEntryFresh, isCacheEntryValid, isCurrentProjectUri, isLegacyConfig, isLegacyReference, isModernConfig, isAllowed as isPermissionAllowed, isValidUri, levelGrants, loadConfig, loadCustomTypes, matchAnyPattern, matchPattern, maxLevel, mergeFetchOptions, mergeRules, mergeTypes, migrateConfig, migrateFileReferences, minLevel, needsMigration, parseCustomDestination, parseMetadata, parseReference, parseTtl, resolveOrganization, resolveReference, resolveReferences, ruleMatchesAction, ruleMatchesContext, ruleMatchesPath, sanitizePath, serializeCacheEntry, setDefaultCacheManager, setDefaultPermissionManager, setDefaultStorageManager, shouldSyncToRepo, summarizeEvaluations, touchCacheEntry, validateCustomTypes, validateMetadata, validateMigratedConfig, validateOrg, validatePath, validateRules as validatePermissionRules, validateProject, validateRules$1 as validateRules, validateUri };
|