@g3nomaly/core 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.
Files changed (77) hide show
  1. package/dist/config/config.d.ts +26 -0
  2. package/dist/config/config.d.ts.map +1 -0
  3. package/dist/config/config.js +67 -0
  4. package/dist/config/config.js.map +1 -0
  5. package/dist/config/index.d.ts +4 -0
  6. package/dist/config/index.d.ts.map +1 -0
  7. package/dist/config/index.js +3 -0
  8. package/dist/config/index.js.map +1 -0
  9. package/dist/config/types.d.ts +141 -0
  10. package/dist/config/types.d.ts.map +1 -0
  11. package/dist/config/types.js +66 -0
  12. package/dist/config/types.js.map +1 -0
  13. package/dist/hash/hash.d.ts +25 -0
  14. package/dist/hash/hash.d.ts.map +1 -0
  15. package/dist/hash/hash.js +44 -0
  16. package/dist/hash/hash.js.map +1 -0
  17. package/dist/hash/index.d.ts +2 -0
  18. package/dist/hash/index.d.ts.map +1 -0
  19. package/dist/hash/index.js +2 -0
  20. package/dist/hash/index.js.map +1 -0
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/paths/index.d.ts +2 -0
  26. package/dist/paths/index.d.ts.map +1 -0
  27. package/dist/paths/index.js +3 -0
  28. package/dist/paths/index.js.map +1 -0
  29. package/dist/paths/paths.d.ts +9 -0
  30. package/dist/paths/paths.d.ts.map +1 -0
  31. package/dist/paths/paths.js +21 -0
  32. package/dist/paths/paths.js.map +1 -0
  33. package/dist/registry/index.d.ts +12 -0
  34. package/dist/registry/index.d.ts.map +1 -0
  35. package/dist/registry/index.js +12 -0
  36. package/dist/registry/index.js.map +1 -0
  37. package/dist/registry/registry.handlers.d.ts +9 -0
  38. package/dist/registry/registry.handlers.d.ts.map +1 -0
  39. package/dist/registry/registry.handlers.js +13 -0
  40. package/dist/registry/registry.handlers.js.map +1 -0
  41. package/dist/registry/registry.io.d.ts +22 -0
  42. package/dist/registry/registry.io.d.ts.map +1 -0
  43. package/dist/registry/registry.io.js +78 -0
  44. package/dist/registry/registry.io.js.map +1 -0
  45. package/dist/registry/registry.mutations.d.ts +12 -0
  46. package/dist/registry/registry.mutations.d.ts.map +1 -0
  47. package/dist/registry/registry.mutations.js +22 -0
  48. package/dist/registry/registry.mutations.js.map +1 -0
  49. package/dist/registry/registry.selectors.d.ts +27 -0
  50. package/dist/registry/registry.selectors.d.ts.map +1 -0
  51. package/dist/registry/registry.selectors.js +37 -0
  52. package/dist/registry/registry.selectors.js.map +1 -0
  53. package/dist/registry/registry.store.d.ts +34 -0
  54. package/dist/registry/registry.store.d.ts.map +1 -0
  55. package/dist/registry/registry.store.js +27 -0
  56. package/dist/registry/registry.store.js.map +1 -0
  57. package/dist/registry/registry.template.d.ts +23 -0
  58. package/dist/registry/registry.template.d.ts.map +1 -0
  59. package/dist/registry/registry.template.js +63 -0
  60. package/dist/registry/registry.template.js.map +1 -0
  61. package/dist/registry/types.d.ts +31 -0
  62. package/dist/registry/types.d.ts.map +1 -0
  63. package/dist/registry/types.js +20 -0
  64. package/dist/registry/types.js.map +1 -0
  65. package/dist/security/index.d.ts +2 -0
  66. package/dist/security/index.d.ts.map +1 -0
  67. package/dist/security/index.js +2 -0
  68. package/dist/security/index.js.map +1 -0
  69. package/dist/security/securityParser.d.ts +14 -0
  70. package/dist/security/securityParser.d.ts.map +1 -0
  71. package/dist/security/securityParser.js +88 -0
  72. package/dist/security/securityParser.js.map +1 -0
  73. package/dist/security/securityWorker.d.ts +8 -0
  74. package/dist/security/securityWorker.d.ts.map +1 -0
  75. package/dist/security/securityWorker.js +158 -0
  76. package/dist/security/securityWorker.js.map +1 -0
  77. package/package.json +64 -0
@@ -0,0 +1,26 @@
1
+ import { type G3nConfig, type CoreConfig, type G3nuiConfig, type G3nerateConfig, type SkillsConfig } from "./types";
2
+ export declare function getConfigPath(projectRoot: string): string;
3
+ /**
4
+ * Loads `.g3n.config.json` from the project root.
5
+ * Returns a fully-defaulted config if the file doesn't exist yet.
6
+ */
7
+ export declare function loadConfig(projectRoot: string): Promise<G3nConfig>;
8
+ /** Every key optional at every depth, so a caller can name one setting alone. */
9
+ type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
10
+ [K in keyof T]?: DeepPartial<T[K]>;
11
+ } : T;
12
+ /**
13
+ * Deep-merges updates into the existing config and writes back to disk.
14
+ * Pass any subset of the config — only the keys you provide are updated.
15
+ *
16
+ * @example
17
+ * await saveConfig(cwd, { g3nui: { settings: { componentsDir: "src/ui" } } })
18
+ */
19
+ export declare function saveConfig(projectRoot: string, updates: DeepPartial<G3nConfig>): Promise<G3nConfig>;
20
+ export declare function loadCoreConfig(projectRoot: string): Promise<CoreConfig>;
21
+ export declare function loadG3nuiConfig(projectRoot: string): Promise<G3nuiConfig>;
22
+ export declare function loadG3nerateConfig(projectRoot: string): Promise<G3nerateConfig>;
23
+ export declare function loadSkillsConfig(projectRoot: string): Promise<SkillsConfig>;
24
+ export declare function configExists(projectRoot: string): Promise<boolean>;
25
+ export {};
26
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAYjB,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAMD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAWxE;AAMD,iFAAiF;AACjF,KAAK,WAAW,CAAC,CAAC,IAChB,CAAC,SAAS,SAAS,OAAO,EAAE,GAAG,CAAC,GAC9B,CAAC,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACzD,CAAC,CAAC;AAEN;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,GAC9B,OAAO,CAAC,SAAS,CAAC,CAapB;AAMD,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAE/E;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAErF;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEjF;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAExE"}
@@ -0,0 +1,67 @@
1
+ // packages/core/src/config/config.ts
2
+ import { join } from "path";
3
+ import { G3nConfigSchema, } from "./types";
4
+ if ("window" in globalThis) {
5
+ throw new Error("@g3nomaly/core config utilities are CLI-only");
6
+ }
7
+ // ---------------------------------------------------------------------------
8
+ // Path helper
9
+ // ---------------------------------------------------------------------------
10
+ const CONFIG_FILE = ".g3n.config.json";
11
+ export function getConfigPath(projectRoot) {
12
+ return join(projectRoot, CONFIG_FILE);
13
+ }
14
+ // ---------------------------------------------------------------------------
15
+ // Read
16
+ // ---------------------------------------------------------------------------
17
+ /**
18
+ * Loads `.g3n.config.json` from the project root.
19
+ * Returns a fully-defaulted config if the file doesn't exist yet.
20
+ */
21
+ export async function loadConfig(projectRoot) {
22
+ const configPath = getConfigPath(projectRoot);
23
+ const file = Bun.file(configPath);
24
+ const exists = await file.exists();
25
+ if (!exists) {
26
+ return G3nConfigSchema.parse({});
27
+ }
28
+ const raw = await file.json();
29
+ return G3nConfigSchema.parse(raw);
30
+ }
31
+ /**
32
+ * Deep-merges updates into the existing config and writes back to disk.
33
+ * Pass any subset of the config — only the keys you provide are updated.
34
+ *
35
+ * @example
36
+ * await saveConfig(cwd, { g3nui: { settings: { componentsDir: "src/ui" } } })
37
+ */
38
+ export async function saveConfig(projectRoot, updates) {
39
+ const existing = await loadConfig(projectRoot);
40
+ const merged = G3nConfigSchema.parse({
41
+ core: { ...existing.core, ...updates.core },
42
+ g3nui: { ...existing.g3nui, ...updates.g3nui, settings: { ...existing.g3nui.settings, ...updates.g3nui?.settings } },
43
+ g3nerate: { ...existing.g3nerate, ...updates.g3nerate, settings: { ...existing.g3nerate.settings, ...updates.g3nerate?.settings } },
44
+ skills: { ...existing.skills, ...updates.skills, settings: { ...existing.skills.settings, ...updates.skills?.settings } },
45
+ });
46
+ await Bun.write(getConfigPath(projectRoot), JSON.stringify(merged, null, 2));
47
+ return merged;
48
+ }
49
+ // ---------------------------------------------------------------------------
50
+ // Section accessors
51
+ // ---------------------------------------------------------------------------
52
+ export async function loadCoreConfig(projectRoot) {
53
+ return (await loadConfig(projectRoot)).core;
54
+ }
55
+ export async function loadG3nuiConfig(projectRoot) {
56
+ return (await loadConfig(projectRoot)).g3nui;
57
+ }
58
+ export async function loadG3nerateConfig(projectRoot) {
59
+ return (await loadConfig(projectRoot)).g3nerate;
60
+ }
61
+ export async function loadSkillsConfig(projectRoot) {
62
+ return (await loadConfig(projectRoot)).skills;
63
+ }
64
+ export async function configExists(projectRoot) {
65
+ return Bun.file(getConfigPath(projectRoot)).exists();
66
+ }
67
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,eAAe,GAMhB,MAAM,SAAS,CAAC;AAEjB,IAAI,QAAQ,IAAI,UAAU,EAAE,CAAC;I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mB;IACpD,OAAO,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AACvD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type { CoreConfig, PackageMeta, G3nuiSettings, G3nuiConfig, G3nerateSettings, G3nerateConfig, SkillTarget, SkillsInstallDirs, SkillsSettings, SkillsConfig, G3nConfig, } from "./types";
2
+ export { CoreConfigSchema, PackageMetaSchema, G3nuiSettingsSchema, G3nuiConfigSchema, G3nerateSettingsSchema, G3nerateConfigSchema, SkillTargetSchema, SkillsInstallDirsSchema, SkillsSettingsSchema, SkillsConfigSchema, G3nConfigSchema, } from "./types";
3
+ export { getConfigPath, loadConfig, saveConfig, loadCoreConfig, loadG3nuiConfig, loadG3nerateConfig, loadSkillsConfig, configExists, } from "./config";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { CoreConfigSchema, PackageMetaSchema, G3nuiSettingsSchema, G3nuiConfigSchema, G3nerateSettingsSchema, G3nerateConfigSchema, SkillTargetSchema, SkillsInstallDirsSchema, SkillsSettingsSchema, SkillsConfigSchema, G3nConfigSchema, } from "./types";
2
+ export { getConfigPath, loadConfig, saveConfig, loadCoreConfig, loadG3nuiConfig, loadG3nerateConfig, loadSkillsConfig, configExists, } from "./config";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,UAAU,CAAC"}
@@ -0,0 +1,141 @@
1
+ import { z } from "zod";
2
+ export declare const CoreConfigSchema: z.ZodObject<{
3
+ version: z.ZodDefault<z.ZodString>;
4
+ description: z.ZodDefault<z.ZodString>;
5
+ license: z.ZodDefault<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ /** Shared package metadata present on every non-core package section */
8
+ export declare const PackageMetaSchema: z.ZodObject<{
9
+ version: z.ZodDefault<z.ZodString>;
10
+ description: z.ZodDefault<z.ZodString>;
11
+ license: z.ZodDefault<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ export declare const G3nuiSettingsSchema: z.ZodObject<{
14
+ componentsDir: z.ZodDefault<z.ZodString>;
15
+ includeDebugFiles: z.ZodDefault<z.ZodBoolean>;
16
+ includeMetaFiles: z.ZodDefault<z.ZodBoolean>;
17
+ manifestFormat: z.ZodDefault<z.ZodEnum<{
18
+ json: "json";
19
+ ts: "ts";
20
+ }>>;
21
+ registeredPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strip>;
23
+ export declare const G3nuiConfigSchema: z.ZodObject<{
24
+ version: z.ZodDefault<z.ZodString>;
25
+ description: z.ZodDefault<z.ZodString>;
26
+ license: z.ZodDefault<z.ZodString>;
27
+ settings: z.ZodDefault<z.ZodObject<{
28
+ componentsDir: z.ZodDefault<z.ZodString>;
29
+ includeDebugFiles: z.ZodDefault<z.ZodBoolean>;
30
+ includeMetaFiles: z.ZodDefault<z.ZodBoolean>;
31
+ manifestFormat: z.ZodDefault<z.ZodEnum<{
32
+ json: "json";
33
+ ts: "ts";
34
+ }>>;
35
+ registeredPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>;
38
+ export declare const G3nerateSettingsSchema: z.ZodObject<{
39
+ outputDir: z.ZodDefault<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export declare const G3nerateConfigSchema: z.ZodObject<{
42
+ version: z.ZodDefault<z.ZodString>;
43
+ description: z.ZodDefault<z.ZodString>;
44
+ license: z.ZodDefault<z.ZodString>;
45
+ settings: z.ZodDefault<z.ZodObject<{
46
+ outputDir: z.ZodDefault<z.ZodString>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>;
49
+ export declare const SkillTargetSchema: z.ZodEnum<{
50
+ claude: "claude";
51
+ codex: "codex";
52
+ }>;
53
+ export declare const SkillsInstallDirsSchema: z.ZodObject<{
54
+ claude: z.ZodDefault<z.ZodString>;
55
+ codex: z.ZodDefault<z.ZodString>;
56
+ }, z.core.$strip>;
57
+ export declare const SkillsSettingsSchema: z.ZodObject<{
58
+ filetreeRoot: z.ZodDefault<z.ZodString>;
59
+ targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
60
+ claude: "claude";
61
+ codex: "codex";
62
+ }>>>;
63
+ installDirs: z.ZodDefault<z.ZodObject<{
64
+ claude: z.ZodDefault<z.ZodString>;
65
+ codex: z.ZodDefault<z.ZodString>;
66
+ }, z.core.$strip>>;
67
+ }, z.core.$strip>;
68
+ export declare const SkillsConfigSchema: z.ZodObject<{
69
+ version: z.ZodDefault<z.ZodString>;
70
+ description: z.ZodDefault<z.ZodString>;
71
+ license: z.ZodDefault<z.ZodString>;
72
+ settings: z.ZodDefault<z.ZodObject<{
73
+ filetreeRoot: z.ZodDefault<z.ZodString>;
74
+ targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
75
+ claude: "claude";
76
+ codex: "codex";
77
+ }>>>;
78
+ installDirs: z.ZodDefault<z.ZodObject<{
79
+ claude: z.ZodDefault<z.ZodString>;
80
+ codex: z.ZodDefault<z.ZodString>;
81
+ }, z.core.$strip>>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ export declare const G3nConfigSchema: z.ZodObject<{
85
+ core: z.ZodDefault<z.ZodObject<{
86
+ version: z.ZodDefault<z.ZodString>;
87
+ description: z.ZodDefault<z.ZodString>;
88
+ license: z.ZodDefault<z.ZodString>;
89
+ }, z.core.$strip>>;
90
+ g3nui: z.ZodDefault<z.ZodObject<{
91
+ version: z.ZodDefault<z.ZodString>;
92
+ description: z.ZodDefault<z.ZodString>;
93
+ license: z.ZodDefault<z.ZodString>;
94
+ settings: z.ZodDefault<z.ZodObject<{
95
+ componentsDir: z.ZodDefault<z.ZodString>;
96
+ includeDebugFiles: z.ZodDefault<z.ZodBoolean>;
97
+ includeMetaFiles: z.ZodDefault<z.ZodBoolean>;
98
+ manifestFormat: z.ZodDefault<z.ZodEnum<{
99
+ json: "json";
100
+ ts: "ts";
101
+ }>>;
102
+ registeredPackages: z.ZodDefault<z.ZodArray<z.ZodString>>;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>>;
105
+ g3nerate: z.ZodDefault<z.ZodObject<{
106
+ version: z.ZodDefault<z.ZodString>;
107
+ description: z.ZodDefault<z.ZodString>;
108
+ license: z.ZodDefault<z.ZodString>;
109
+ settings: z.ZodDefault<z.ZodObject<{
110
+ outputDir: z.ZodDefault<z.ZodString>;
111
+ }, z.core.$strip>>;
112
+ }, z.core.$strip>>;
113
+ skills: z.ZodDefault<z.ZodObject<{
114
+ version: z.ZodDefault<z.ZodString>;
115
+ description: z.ZodDefault<z.ZodString>;
116
+ license: z.ZodDefault<z.ZodString>;
117
+ settings: z.ZodDefault<z.ZodObject<{
118
+ filetreeRoot: z.ZodDefault<z.ZodString>;
119
+ targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
120
+ claude: "claude";
121
+ codex: "codex";
122
+ }>>>;
123
+ installDirs: z.ZodDefault<z.ZodObject<{
124
+ claude: z.ZodDefault<z.ZodString>;
125
+ codex: z.ZodDefault<z.ZodString>;
126
+ }, z.core.$strip>>;
127
+ }, z.core.$strip>>;
128
+ }, z.core.$strip>>;
129
+ }, z.core.$strip>;
130
+ export type CoreConfig = z.infer<typeof CoreConfigSchema>;
131
+ export type PackageMeta = z.infer<typeof PackageMetaSchema>;
132
+ export type G3nuiSettings = z.infer<typeof G3nuiSettingsSchema>;
133
+ export type G3nuiConfig = z.infer<typeof G3nuiConfigSchema>;
134
+ export type G3nerateSettings = z.infer<typeof G3nerateSettingsSchema>;
135
+ export type G3nerateConfig = z.infer<typeof G3nerateConfigSchema>;
136
+ export type SkillTarget = z.infer<typeof SkillTargetSchema>;
137
+ export type SkillsInstallDirs = z.infer<typeof SkillsInstallDirsSchema>;
138
+ export type SkillsSettings = z.infer<typeof SkillsSettingsSchema>;
139
+ export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
140
+ export type G3nConfig = z.infer<typeof G3nConfigSchema>;
141
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,iBAAiB;;;;iBAI5B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;iBA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,OAAO,kBAAkB,CAAC,CAAC;AACrE,MAAM,MAAM,SAAS,GAAa,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ // packages/core/src/config/types.ts
2
+ import { z } from "zod";
3
+ // ---------------------------------------------------------------------------
4
+ // Per-package section schemas
5
+ // ---------------------------------------------------------------------------
6
+ export const CoreConfigSchema = z.object({
7
+ version: z.string().default("0.1.0"),
8
+ description: z.string().default(""),
9
+ license: z.string().default("UNLICENSED"),
10
+ });
11
+ /** Shared package metadata present on every non-core package section */
12
+ export const PackageMetaSchema = z.object({
13
+ version: z.string().default("0.1.0"),
14
+ description: z.string().default(""),
15
+ license: z.string().default("UNLICENSED"),
16
+ });
17
+ export const G3nuiSettingsSchema = z.object({
18
+ /** Where components are installed in the user's project */
19
+ componentsDir: z.string().default("src/components/ui"),
20
+ /** Whether to copy .debug.ts files alongside components */
21
+ includeDebugFiles: z.boolean().default(false),
22
+ /** Whether to copy .meta.ts files alongside components */
23
+ includeMetaFiles: z.boolean().default(false),
24
+ /** Format of the user manifest file: json (default) or ts */
25
+ manifestFormat: z.enum(["json", "ts"]).default("json"),
26
+ /** External package adapters to load (e.g. ["shadcn"]) */
27
+ registeredPackages: z.array(z.string()).default([]),
28
+ });
29
+ export const G3nuiConfigSchema = PackageMetaSchema.extend({
30
+ settings: G3nuiSettingsSchema.default(() => G3nuiSettingsSchema.parse({})),
31
+ });
32
+ export const G3nerateSettingsSchema = z.object({
33
+ /** Output directory for generated files */
34
+ outputDir: z.string().default("src/generated"),
35
+ });
36
+ export const G3nerateConfigSchema = PackageMetaSchema.extend({
37
+ settings: G3nerateSettingsSchema.default(() => G3nerateSettingsSchema.parse({})),
38
+ });
39
+ export const SkillTargetSchema = z.enum(["claude", "codex"]);
40
+ export const SkillsInstallDirsSchema = z.object({
41
+ /** Skill install directory for Claude Code, relative to the project root */
42
+ claude: z.string().default(".claude/skills"),
43
+ /** Skill install directory for Codex (`.agents/skills`), relative to the project root */
44
+ codex: z.string().default(".agents/skills"),
45
+ });
46
+ export const SkillsSettingsSchema = z.object({
47
+ /** Where the plan, phase and task tree lives, relative to the project root */
48
+ filetreeRoot: z.string().default("docs/task-manager"),
49
+ /** Which agent harnesses skills are installed for */
50
+ targets: z.array(SkillTargetSchema).min(1).default(["claude"]),
51
+ /** Install directory per target; the skills.json registry sits next to each */
52
+ installDirs: SkillsInstallDirsSchema.default(() => SkillsInstallDirsSchema.parse({})),
53
+ });
54
+ export const SkillsConfigSchema = PackageMetaSchema.extend({
55
+ settings: SkillsSettingsSchema.default(() => SkillsSettingsSchema.parse({})),
56
+ });
57
+ // ---------------------------------------------------------------------------
58
+ // Root merged config schema
59
+ // ---------------------------------------------------------------------------
60
+ export const G3nConfigSchema = z.object({
61
+ core: CoreConfigSchema.default(() => CoreConfigSchema.parse({})),
62
+ g3nui: G3nuiConfigSchema.default(() => G3nuiConfigSchema.parse({})),
63
+ g3nerate: G3nerateConfigSchema.default(() => G3nerateConfigSchema.parse({})),
64
+ skills: SkillsConfigSchema.default(() => SkillsConfigSchema.parse({})),
65
+ });
66
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAM,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,OAAO,EAAM,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;CAC9C,CAAC,CAAC;AAEH,wEAAwE;AACxE,MAA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C9E,4BAA4B;AAC5B,8EAA8E;AAE9E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAM,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpE,KAAK,EAAK,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtE,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5E,MAAM,EAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;CACzE,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Hashes a file's contents using SHA-256.
3
+ * Uses Bun's native file API + Web Crypto — no external dependencies.
4
+ *
5
+ * @param filePath - Absolute or relative path to the file
6
+ * @returns Lowercase hex SHA-256 digest
7
+ */
8
+ export declare function hashFile(filePath: string): Promise<string>;
9
+ /**
10
+ * Hashes an arbitrary string using SHA-256.
11
+ * Useful for hashing in-memory content before writing to disk.
12
+ *
13
+ * @param content - String to hash
14
+ * @returns Lowercase hex SHA-256 digest
15
+ */
16
+ export declare function hashString(content: string): Promise<string>;
17
+ /**
18
+ * Short (first 12 chars) SHA-256 hash of a file — for display purposes.
19
+ */
20
+ export declare function hashFileShort(filePath: string): Promise<string>;
21
+ /**
22
+ * Short (first 12 chars) SHA-256 hash of a string — for display purposes.
23
+ */
24
+ export declare function hashStringShort(content: string): Promise<string>;
25
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/hash/hash.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMhE;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMjE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAErE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtE"}
@@ -0,0 +1,44 @@
1
+ if ("window" in globalThis) {
2
+ throw new Error("@g3nomaly/core hash utilities are CLI-only");
3
+ }
4
+ /**
5
+ * Hashes a file's contents using SHA-256.
6
+ * Uses Bun's native file API + Web Crypto — no external dependencies.
7
+ *
8
+ * @param filePath - Absolute or relative path to the file
9
+ * @returns Lowercase hex SHA-256 digest
10
+ */
11
+ export async function hashFile(filePath) {
12
+ const file = Bun.file(filePath);
13
+ const buffer = await file.arrayBuffer();
14
+ const hashBuffer = await crypto.subtle.digest("SHA-256", buffer);
15
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
16
+ return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
17
+ }
18
+ /**
19
+ * Hashes an arbitrary string using SHA-256.
20
+ * Useful for hashing in-memory content before writing to disk.
21
+ *
22
+ * @param content - String to hash
23
+ * @returns Lowercase hex SHA-256 digest
24
+ */
25
+ export async function hashString(content) {
26
+ const encoder = new TextEncoder();
27
+ const buffer = encoder.encode(content);
28
+ const hashBuffer = await crypto.subtle.digest("SHA-256", buffer);
29
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
30
+ return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
31
+ }
32
+ /**
33
+ * Short (first 12 chars) SHA-256 hash of a file — for display purposes.
34
+ */
35
+ export async function hashFileShort(filePath) {
36
+ return (await hashFile(filePath)).substring(0, 12);
37
+ }
38
+ /**
39
+ * Short (first 12 chars) SHA-256 hash of a string — for display purposes.
40
+ */
41
+ export async function hashStringShort(content) {
42
+ return (await hashString(content)).substring(0, 12);
43
+ }
44
+ //# sourceMappingURL=hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/hash/hash.ts"],"names":[],"mappings":"AAAA,IAAI,QAAQ,IAAI,UAAU,EAAE,CAAC;IAC3B,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IACxC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACzD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAe;IAC9C,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACzD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,OAAO,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAe;IACnD,OAAO,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { hashFile, hashString, hashFileShort, hashStringShort } from "./hash";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hash/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { hashFile, hashString, hashFileShort, hashStringShort } from "./hash";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hash/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { findPackageRoot } from "./paths";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ // packages/core/src/paths/index.ts
2
+ export { findPackageRoot } from "./paths";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Nearest directory at or above `fromDir` that holds a `package.json`.
3
+ * Pass `import.meta.dir` to get the root of the package the caller lives in,
4
+ * from `src/` and `dist/` alike.
5
+ *
6
+ * @throws when no package.json exists on the way up to the filesystem root
7
+ */
8
+ export declare function findPackageRoot(fromDir: string): string;
9
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQvD"}
@@ -0,0 +1,21 @@
1
+ // packages/core/src/paths/paths.ts
2
+ import { existsSync } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ /**
5
+ * Nearest directory at or above `fromDir` that holds a `package.json`.
6
+ * Pass `import.meta.dir` to get the root of the package the caller lives in,
7
+ * from `src/` and `dist/` alike.
8
+ *
9
+ * @throws when no package.json exists on the way up to the filesystem root
10
+ */
11
+ export function findPackageRoot(fromDir) {
12
+ let dir = fromDir;
13
+ while (!existsSync(join(dir, "package.json"))) {
14
+ const parent = dirname(dir);
15
+ if (parent === dir)
16
+ throw new Error(`no package.json found above ${fromDir}`);
17
+ dir = parent;
18
+ }
19
+ return dir;
20
+ }
21
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,GAAG,GAAG,OAAO,CAAC;IAClB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;QAC9E,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,12 @@
1
+ export * from "./types";
2
+ export * from "./registry.handlers";
3
+ export * from "./registry.store";
4
+ export * from "./registry.mutations";
5
+ export * from "./registry.selectors";
6
+ export * from "./registry.template";
7
+ export * from "./registry.io";
8
+ /**
9
+ * Purposfully a custom registry store. To reduce dependencies. Still follows the same pattern as the tanstack store design skill. Though it could still be improved since it is still missing a lot of default operators.
10
+ * Nevertheless, this stores doesn't need reactive updates. Hence, once more the, part of why it is a custom store.
11
+ */
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAE7B;;;GAGG"}
@@ -0,0 +1,12 @@
1
+ export * from "./types";
2
+ export * from "./registry.handlers";
3
+ export * from "./registry.store";
4
+ export * from "./registry.mutations";
5
+ export * from "./registry.selectors";
6
+ export * from "./registry.template";
7
+ export * from "./registry.io";
8
+ /**
9
+ * Purposfully a custom registry store. To reduce dependencies. Still follows the same pattern as the tanstack store design skill. Though it could still be improved since it is still missing a lot of default operators.
10
+ * Nevertheless, this stores doesn't need reactive updates. Hence, once more the, part of why it is a custom store.
11
+ */
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAE7B;;;GAGG"}
@@ -0,0 +1,9 @@
1
+ import type { BaseRegistry, BaseRegistryEntry } from "./types";
2
+ export interface RegistryHandler<T extends BaseRegistryEntry = BaseRegistryEntry> {
3
+ extensions: string[];
4
+ serialize: (data: BaseRegistry<T>) => string;
5
+ deserialize: (raw: string) => BaseRegistry<T>;
6
+ }
7
+ export declare const tsHandler: RegistryHandler<any>;
8
+ export declare const jsonHandler: RegistryHandler<any>;
9
+ //# sourceMappingURL=registry.handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.handlers.d.ts","sourceRoot":"","sources":["../../src/registry/registry.handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE9D,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IAC9E,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,CAAA;IAC5C,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,GAAG,CAO1C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,eAAe,CAAC,GAAG,CAI5C,CAAA"}
@@ -0,0 +1,13 @@
1
+ export const tsHandler = {
2
+ extensions: ["ts"],
3
+ serialize: (data) => `export const registry = ${JSON.stringify(data, null, 2)} as const\n`,
4
+ deserialize: () => {
5
+ throw new Error("TS handler deserializes via dynamic import — use load()");
6
+ },
7
+ };
8
+ export const jsonHandler = {
9
+ extensions: ["json"],
10
+ serialize: (data) => JSON.stringify(data, null, 2),
11
+ deserialize: (raw) => JSON.parse(raw),
12
+ };
13
+ //# sourceMappingURL=registry.handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.handlers.js","sourceRoot":"","sources":["../../src/registry/registry.handlers.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,SAAS,GAAyB;IAC7C,UAAU,EAAE,CAAC,IAAI,CAAC;IAClB,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAClB,2BAA2B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,aAAa;IACvE,WAAW,EAAE,GAAG,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;IAC5E,CAAC;CACF,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CACtC,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { BaseRegistryEntry } from "./types";
2
+ import type { RegistryStore } from "./registry.store";
3
+ import type { RegistryHandler } from "./registry.handlers";
4
+ /**
5
+ * name alias for load() when you want to specify an explicit filePath. Otherwise identical behavior.
6
+ */
7
+ export declare function loadFrom<T extends BaseRegistryEntry>(registry: RegistryStore<T>, filePath: string): Promise<void>;
8
+ export declare function load<T extends BaseRegistryEntry>(registry: RegistryStore<T>, filePath?: string): Promise<void>;
9
+ /**
10
+ * Flushes the store to its already-bound filePath.
11
+ * Sorts entries alphabetically for deterministic output.
12
+ *
13
+ * @throws If the store has no bound filePath.
14
+ */
15
+ export declare function flush<T extends BaseRegistryEntry>(registry: RegistryStore<T>, handler?: RegistryHandler<T>): void;
16
+ /**
17
+ * Writes the store to an explicit path.
18
+ * Sorts entries alphabetically for deterministic output.
19
+ * Does not affect the store's bound filePath.
20
+ */
21
+ export declare function writeTo<T extends BaseRegistryEntry>(registry: RegistryStore<T>, filePath: string, handler?: RegistryHandler<T>): void;
22
+ //# sourceMappingURL=registry.io.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.io.d.ts","sourceRoot":"","sources":["../../src/registry/registry.io.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAwB1D;;GAEG;AACH,wBAAsB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EACxD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAEf;AAYD,wBAAsB,IAAI,CAAC,CAAC,SAAS,iBAAiB,EACpD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAMD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,iBAAiB,EAC/C,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC3B,IAAI,CASN;AAMD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,iBAAiB,EACjD,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC3B,IAAI,CAGN"}