@fractary/codex 0.11.0 → 0.11.2
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 +25 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +138 -24
- package/dist/index.d.ts +138 -24
- package/dist/index.js +25 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -888,12 +888,21 @@ var SyncRulesSchema = zod.z.object({
|
|
|
888
888
|
defaultInclude: zod.z.array(zod.z.string()).optional(),
|
|
889
889
|
defaultExclude: zod.z.array(zod.z.string()).optional()
|
|
890
890
|
});
|
|
891
|
+
var DirectionalSyncConfigSchema = zod.z.object({
|
|
892
|
+
/** Patterns to include (required) */
|
|
893
|
+
include: zod.z.array(zod.z.string()),
|
|
894
|
+
/** Patterns to exclude (optional) */
|
|
895
|
+
exclude: zod.z.array(zod.z.string()).optional()
|
|
896
|
+
});
|
|
891
897
|
var DirectionalSyncSchema = zod.z.object({
|
|
898
|
+
// New format (v0.7.0+) - Recommended
|
|
892
899
|
// Patterns for files to push from this project to codex
|
|
893
|
-
to_codex:
|
|
900
|
+
to_codex: DirectionalSyncConfigSchema.optional(),
|
|
894
901
|
// Patterns for files to pull from codex to this project
|
|
895
|
-
|
|
896
|
-
|
|
902
|
+
from_codex: DirectionalSyncConfigSchema.optional(),
|
|
903
|
+
// Global exclude patterns (applied to both directions)
|
|
904
|
+
exclude: zod.z.array(zod.z.string()).optional(),
|
|
905
|
+
// Legacy format (deprecated, backward compatible)
|
|
897
906
|
// Org-level defaults (only in codex repository config)
|
|
898
907
|
default_to_codex: zod.z.array(zod.z.string()).optional(),
|
|
899
908
|
default_from_codex: zod.z.array(zod.z.string()).optional()
|
|
@@ -3785,14 +3794,19 @@ var SyncManager = class {
|
|
|
3785
3794
|
* @param options - Sync options
|
|
3786
3795
|
*/
|
|
3787
3796
|
async createPlan(_org, _project, sourceDir, targetFiles, options) {
|
|
3788
|
-
let sourceFiles
|
|
3789
|
-
if (options?.
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
)
|
|
3797
|
+
let sourceFiles;
|
|
3798
|
+
if (options?.sourceFiles && options.sourceFiles.length > 0) {
|
|
3799
|
+
sourceFiles = options.sourceFiles;
|
|
3800
|
+
} else {
|
|
3801
|
+
sourceFiles = await this.listLocalFiles(sourceDir);
|
|
3802
|
+
if (options?.direction === "to-codex") {
|
|
3803
|
+
const toCodexPatterns = this.resolveToCodexPatterns();
|
|
3804
|
+
if (toCodexPatterns.length > 0) {
|
|
3805
|
+
const { matchToCodexPattern: matchToCodexPattern2 } = await Promise.resolve().then(() => (init_directional_patterns(), directional_patterns_exports));
|
|
3806
|
+
sourceFiles = sourceFiles.filter(
|
|
3807
|
+
(file) => matchToCodexPattern2(file.path, toCodexPatterns)
|
|
3808
|
+
);
|
|
3809
|
+
}
|
|
3796
3810
|
}
|
|
3797
3811
|
}
|
|
3798
3812
|
const plan = createSyncPlan(
|