poe-code 4.0.46-beta.1 → 4.0.47

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 @@
1
+ export * from "../packages/config-mutations/dist/testing.js";
@@ -0,0 +1,536 @@
1
+ // packages/config-mutations/src/testing/mock-fs.ts
2
+ import path from "node:path";
3
+ var DEFAULT_HOME_DIR = "/home/test";
4
+ function createMockFs(initialFiles, homeDir = DEFAULT_HOME_DIR) {
5
+ const files = {};
6
+ const directories = /* @__PURE__ */ new Set();
7
+ if (initialFiles) {
8
+ for (const [filePath, content] of Object.entries(initialFiles)) {
9
+ const absolutePath = expandPath(filePath, homeDir);
10
+ files[absolutePath] = content;
11
+ const parentDir = path.dirname(absolutePath);
12
+ addDirectoryTree(parentDir, directories);
13
+ }
14
+ }
15
+ addDirectoryTree(homeDir, directories);
16
+ const mockFs = {
17
+ files,
18
+ directories,
19
+ exists(filePath) {
20
+ const absolutePath = expandPath(filePath, homeDir);
21
+ return absolutePath in files || directories.has(absolutePath);
22
+ },
23
+ getContent(filePath) {
24
+ const absolutePath = expandPath(filePath, homeDir);
25
+ return files[absolutePath];
26
+ },
27
+ async readFile(filePath, encoding) {
28
+ const absolutePath = expandPath(filePath, homeDir);
29
+ if (!(absolutePath in files)) {
30
+ const error = new Error(`ENOENT: no such file or directory, open '${absolutePath}'`);
31
+ error.code = "ENOENT";
32
+ throw error;
33
+ }
34
+ const content = files[absolutePath];
35
+ if (encoding) {
36
+ return content;
37
+ }
38
+ return Buffer.from(content, "utf8");
39
+ },
40
+ async writeFile(filePath, content, options) {
41
+ const absolutePath = expandPath(filePath, homeDir);
42
+ if (options?.flag === "wx" && absolutePath in files) {
43
+ const error = new Error(`EEXIST: file already exists, open '${absolutePath}'`);
44
+ error.code = "EEXIST";
45
+ throw error;
46
+ }
47
+ const parentDir = path.dirname(absolutePath);
48
+ if (!directories.has(parentDir)) {
49
+ const error = new Error(`ENOENT: no such file or directory, open '${absolutePath}'`);
50
+ error.code = "ENOENT";
51
+ throw error;
52
+ }
53
+ if (typeof content === "string") {
54
+ files[absolutePath] = content;
55
+ } else if (Buffer.isBuffer(content)) {
56
+ files[absolutePath] = content.toString("utf8");
57
+ } else {
58
+ files[absolutePath] = Buffer.from(
59
+ content.buffer,
60
+ content.byteOffset,
61
+ content.byteLength
62
+ ).toString("utf8");
63
+ }
64
+ },
65
+ async mkdir(dirPath, options) {
66
+ const absolutePath = expandPath(dirPath, homeDir);
67
+ if (options?.recursive) {
68
+ addDirectoryTree(absolutePath, directories);
69
+ } else {
70
+ const parentDir = path.dirname(absolutePath);
71
+ if (parentDir !== absolutePath && !directories.has(parentDir)) {
72
+ const error = new Error(`ENOENT: no such file or directory, mkdir '${absolutePath}'`);
73
+ error.code = "ENOENT";
74
+ throw error;
75
+ }
76
+ directories.add(absolutePath);
77
+ }
78
+ },
79
+ async unlink(filePath) {
80
+ const absolutePath = expandPath(filePath, homeDir);
81
+ if (!(absolutePath in files)) {
82
+ const error = new Error(`ENOENT: no such file or directory, unlink '${absolutePath}'`);
83
+ error.code = "ENOENT";
84
+ throw error;
85
+ }
86
+ delete files[absolutePath];
87
+ },
88
+ async rename(oldPath, newPath) {
89
+ const absoluteOldPath = expandPath(oldPath, homeDir);
90
+ const absoluteNewPath = expandPath(newPath, homeDir);
91
+ if (!(absoluteOldPath in files)) {
92
+ const error = new Error(`ENOENT: no such file or directory, rename '${absoluteOldPath}'`);
93
+ error.code = "ENOENT";
94
+ throw error;
95
+ }
96
+ files[absoluteNewPath] = files[absoluteOldPath];
97
+ delete files[absoluteOldPath];
98
+ },
99
+ async stat(filePath) {
100
+ const absolutePath = expandPath(filePath, homeDir);
101
+ if (absolutePath in files) {
102
+ return { mode: 420 };
103
+ }
104
+ if (directories.has(absolutePath)) {
105
+ return { mode: 493 };
106
+ }
107
+ const error = new Error(`ENOENT: no such file or directory, stat '${absolutePath}'`);
108
+ error.code = "ENOENT";
109
+ throw error;
110
+ },
111
+ async lstat(filePath) {
112
+ const absolutePath = expandPath(filePath, homeDir);
113
+ if (absolutePath in files || directories.has(absolutePath)) {
114
+ return { isSymbolicLink: () => false };
115
+ }
116
+ const error = new Error(`ENOENT: no such file or directory, lstat '${absolutePath}'`);
117
+ error.code = "ENOENT";
118
+ throw error;
119
+ },
120
+ async readdir(dirPath) {
121
+ const absolutePath = expandPath(dirPath, homeDir);
122
+ if (absolutePath in files) {
123
+ const error = new Error(`ENOTDIR: not a directory, scandir '${absolutePath}'`);
124
+ error.code = "ENOTDIR";
125
+ throw error;
126
+ }
127
+ if (!directories.has(absolutePath)) {
128
+ const error = new Error(`ENOENT: no such file or directory, scandir '${absolutePath}'`);
129
+ error.code = "ENOENT";
130
+ throw error;
131
+ }
132
+ const entries = /* @__PURE__ */ new Set();
133
+ for (const filePath of Object.keys(files)) {
134
+ if (path.dirname(filePath) === absolutePath) {
135
+ entries.add(path.basename(filePath));
136
+ }
137
+ }
138
+ for (const dir of directories) {
139
+ if (dir !== absolutePath && path.dirname(dir) === absolutePath) {
140
+ entries.add(path.basename(dir));
141
+ }
142
+ }
143
+ return Array.from(entries);
144
+ },
145
+ async chmod(filePath, mode) {
146
+ void mode;
147
+ const absolutePath = expandPath(filePath, homeDir);
148
+ if (!(absolutePath in files) && !directories.has(absolutePath)) {
149
+ const error = new Error(`ENOENT: no such file or directory, chmod '${absolutePath}'`);
150
+ error.code = "ENOENT";
151
+ throw error;
152
+ }
153
+ }
154
+ };
155
+ return mockFs;
156
+ }
157
+ function expandPath(inputPath, homeDir) {
158
+ if (inputPath.startsWith("~/")) {
159
+ return path.join(homeDir, inputPath.slice(2));
160
+ }
161
+ if (inputPath === "~") {
162
+ return homeDir;
163
+ }
164
+ if (inputPath.startsWith("~")) {
165
+ return path.join(homeDir, inputPath.slice(1));
166
+ }
167
+ return inputPath;
168
+ }
169
+ function addDirectoryTree(dirPath, directories) {
170
+ const parts = dirPath.split(path.sep).filter(Boolean);
171
+ let current = "/";
172
+ directories.add(current);
173
+ for (const part of parts) {
174
+ current = path.join(current, part);
175
+ directories.add(current);
176
+ }
177
+ }
178
+
179
+ // packages/config-mutations/src/formats/json.ts
180
+ import * as jsonc from "jsonc-parser";
181
+
182
+ // packages/config-mutations/src/formats/object.ts
183
+ function cloneConfigObject(value) {
184
+ const result = {};
185
+ for (const [key, entry] of Object.entries(value)) {
186
+ setConfigEntry(result, key, cloneConfigValue(entry));
187
+ }
188
+ return result;
189
+ }
190
+ function setConfigEntry(target, key, value) {
191
+ Object.defineProperty(target, key, {
192
+ configurable: true,
193
+ enumerable: true,
194
+ writable: true,
195
+ value
196
+ });
197
+ }
198
+ function hasConfigEntry(target, key) {
199
+ return Object.prototype.hasOwnProperty.call(target, key);
200
+ }
201
+ function cloneConfigValue(value) {
202
+ if (Array.isArray(value)) {
203
+ return value.map((entry) => cloneConfigValue(entry));
204
+ }
205
+ if (value && typeof value === "object" && !(value instanceof Date)) {
206
+ return cloneConfigObject(value);
207
+ }
208
+ return value;
209
+ }
210
+
211
+ // packages/config-mutations/src/formats/json.ts
212
+ function isConfigObject(value) {
213
+ return typeof value === "object" && value !== null && !Array.isArray(value);
214
+ }
215
+ function detectIndent(content) {
216
+ const match = content.match(/^[\t ]+/m);
217
+ if (match) {
218
+ return match[0];
219
+ }
220
+ return " ";
221
+ }
222
+ function parse2(content) {
223
+ if (!content || content.trim() === "") {
224
+ return {};
225
+ }
226
+ const errors = [];
227
+ const parsed = jsonc.parse(content, errors, {
228
+ allowTrailingComma: true,
229
+ disallowComments: false
230
+ });
231
+ if (errors.length > 0) {
232
+ throw new Error(`JSON parse error: ${jsonc.printParseErrorCode(errors[0].error)}`);
233
+ }
234
+ if (parsed === null || parsed === void 0) {
235
+ return {};
236
+ }
237
+ if (!isConfigObject(parsed)) {
238
+ throw new Error("Expected JSON object.");
239
+ }
240
+ return cloneConfigObject(parsed);
241
+ }
242
+ function serialize(obj) {
243
+ return `${JSON.stringify(obj, null, 2)}
244
+ `;
245
+ }
246
+ function merge(base, patch) {
247
+ const result = cloneConfigObject(base);
248
+ for (const [key, value] of Object.entries(patch)) {
249
+ if (value === void 0) {
250
+ continue;
251
+ }
252
+ const existing = hasConfigEntry(result, key) ? result[key] : void 0;
253
+ if (isConfigObject(existing) && isConfigObject(value)) {
254
+ setConfigEntry(result, key, merge(existing, value));
255
+ continue;
256
+ }
257
+ setConfigEntry(result, key, value);
258
+ }
259
+ return result;
260
+ }
261
+ function configValuesEqual(left, right) {
262
+ return JSON.stringify(left) === JSON.stringify(right);
263
+ }
264
+ function prune(obj, shape) {
265
+ let changed = false;
266
+ const result = cloneConfigObject(obj);
267
+ for (const [key, pattern] of Object.entries(shape)) {
268
+ if (!hasConfigEntry(result, key)) {
269
+ continue;
270
+ }
271
+ const current = result[key];
272
+ if (isConfigObject(pattern) && Object.keys(pattern).length === 0) {
273
+ delete result[key];
274
+ changed = true;
275
+ continue;
276
+ }
277
+ if (isConfigObject(pattern) && isConfigObject(current)) {
278
+ const { changed: childChanged, result: childResult } = prune(
279
+ current,
280
+ pattern
281
+ );
282
+ if (childChanged) {
283
+ changed = true;
284
+ }
285
+ if (Object.keys(childResult).length === 0) {
286
+ delete result[key];
287
+ } else {
288
+ setConfigEntry(result, key, childResult);
289
+ }
290
+ continue;
291
+ }
292
+ if (isConfigObject(pattern) && Object.keys(pattern).length > 0) {
293
+ continue;
294
+ }
295
+ delete result[key];
296
+ changed = true;
297
+ }
298
+ return { changed, result };
299
+ }
300
+ function modifyAtPath(content, path2, value) {
301
+ const indent = detectIndent(content);
302
+ const formattingOptions = {
303
+ tabSize: indent === " " ? 1 : indent.length,
304
+ insertSpaces: indent !== " ",
305
+ eol: "\n"
306
+ };
307
+ const edits = jsonc.modify(content, path2, value, { formattingOptions });
308
+ let result = jsonc.applyEdits(content, edits);
309
+ if (!result.endsWith("\n")) {
310
+ result += "\n";
311
+ }
312
+ return result;
313
+ }
314
+ function removeAtPath(content, path2) {
315
+ return modifyAtPath(content, path2, void 0);
316
+ }
317
+ function serializeUpdate(content, current, next) {
318
+ let result = content || "{}";
319
+ result = applyObjectUpdate(result, [], current, next);
320
+ if (!result.endsWith("\n")) {
321
+ result += "\n";
322
+ }
323
+ return result;
324
+ }
325
+ function applyObjectUpdate(content, path2, current, next) {
326
+ let result = content;
327
+ for (const key of Object.keys(current)) {
328
+ if (!hasConfigEntry(next, key)) {
329
+ result = removeAtPath(result, [...path2, key]);
330
+ }
331
+ }
332
+ for (const [key, nextValue] of Object.entries(next)) {
333
+ const nextPath = [...path2, key];
334
+ const hasCurrent = hasConfigEntry(current, key);
335
+ const currentValue = hasCurrent ? current[key] : void 0;
336
+ if (hasCurrent && isConfigObject(currentValue) && isConfigObject(nextValue)) {
337
+ result = applyObjectUpdate(result, nextPath, currentValue, nextValue);
338
+ continue;
339
+ }
340
+ if (!hasCurrent || !configValuesEqual(currentValue, nextValue)) {
341
+ result = modifyAtPath(result, nextPath, nextValue);
342
+ }
343
+ }
344
+ return result;
345
+ }
346
+ var jsonFormat = {
347
+ parse: parse2,
348
+ serialize,
349
+ serializeUpdate,
350
+ merge,
351
+ prune
352
+ };
353
+
354
+ // packages/config-mutations/src/formats/toml.ts
355
+ import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
356
+ function isConfigObject2(value) {
357
+ return typeof value === "object" && value !== null && !Array.isArray(value);
358
+ }
359
+ function parse3(content) {
360
+ if (!content || content.trim() === "") {
361
+ return {};
362
+ }
363
+ const parsed = parseToml(content);
364
+ if (!isConfigObject2(parsed)) {
365
+ throw new Error("Expected TOML document to be a table.");
366
+ }
367
+ return cloneConfigObject(parsed);
368
+ }
369
+ function serialize2(obj) {
370
+ const serialized = stringifyToml(obj);
371
+ return serialized.endsWith("\n") ? serialized : `${serialized}
372
+ `;
373
+ }
374
+ function merge2(base, patch) {
375
+ const result = cloneConfigObject(base);
376
+ for (const [key, value] of Object.entries(patch)) {
377
+ if (value === void 0) {
378
+ continue;
379
+ }
380
+ const existing = hasConfigEntry(result, key) ? result[key] : void 0;
381
+ if (isConfigObject2(existing) && isConfigObject2(value)) {
382
+ setConfigEntry(result, key, merge2(existing, value));
383
+ continue;
384
+ }
385
+ setConfigEntry(result, key, value);
386
+ }
387
+ return result;
388
+ }
389
+ function prune2(obj, shape) {
390
+ let changed = false;
391
+ const result = cloneConfigObject(obj);
392
+ for (const [key, pattern] of Object.entries(shape)) {
393
+ if (!hasConfigEntry(result, key)) {
394
+ continue;
395
+ }
396
+ const current = result[key];
397
+ if (isConfigObject2(pattern) && Object.keys(pattern).length === 0) {
398
+ delete result[key];
399
+ changed = true;
400
+ continue;
401
+ }
402
+ if (isConfigObject2(pattern) && isConfigObject2(current)) {
403
+ const { changed: childChanged, result: childResult } = prune2(
404
+ current,
405
+ pattern
406
+ );
407
+ if (childChanged) {
408
+ changed = true;
409
+ }
410
+ if (Object.keys(childResult).length === 0) {
411
+ delete result[key];
412
+ } else {
413
+ setConfigEntry(result, key, childResult);
414
+ }
415
+ continue;
416
+ }
417
+ if (!isConfigObject2(pattern) || Object.keys(pattern).length === 0) {
418
+ delete result[key];
419
+ changed = true;
420
+ }
421
+ }
422
+ return { changed, result };
423
+ }
424
+ var tomlFormat = {
425
+ parse: parse3,
426
+ serialize: serialize2,
427
+ merge: merge2,
428
+ prune: prune2
429
+ };
430
+
431
+ // packages/config-mutations/src/formats/yaml.ts
432
+ import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
433
+ function isConfigObject3(value) {
434
+ return typeof value === "object" && value !== null && !Array.isArray(value);
435
+ }
436
+ function parse4(content) {
437
+ if (!content || content.trim() === "") {
438
+ return {};
439
+ }
440
+ const parsed = parseYaml(content);
441
+ if (parsed === null || parsed === void 0) {
442
+ return {};
443
+ }
444
+ if (!isConfigObject3(parsed)) {
445
+ throw new Error("Expected YAML object.");
446
+ }
447
+ return cloneConfigObject(parsed);
448
+ }
449
+ function serialize3(obj) {
450
+ const serialized = stringifyYaml(obj);
451
+ return serialized.endsWith("\n") ? serialized : `${serialized}
452
+ `;
453
+ }
454
+ function merge3(base, patch) {
455
+ const result = cloneConfigObject(base);
456
+ for (const [key, value] of Object.entries(patch)) {
457
+ if (value === void 0) {
458
+ continue;
459
+ }
460
+ const existing = hasConfigEntry(result, key) ? result[key] : void 0;
461
+ if (isConfigObject3(existing) && isConfigObject3(value)) {
462
+ setConfigEntry(result, key, merge3(existing, value));
463
+ continue;
464
+ }
465
+ setConfigEntry(result, key, value);
466
+ }
467
+ return result;
468
+ }
469
+ function prune3(obj, shape) {
470
+ let changed = false;
471
+ const result = cloneConfigObject(obj);
472
+ for (const [key, pattern] of Object.entries(shape)) {
473
+ if (!hasConfigEntry(result, key)) {
474
+ continue;
475
+ }
476
+ const current = result[key];
477
+ if (isConfigObject3(pattern) && Object.keys(pattern).length === 0) {
478
+ delete result[key];
479
+ changed = true;
480
+ continue;
481
+ }
482
+ if (isConfigObject3(pattern) && isConfigObject3(current)) {
483
+ const { changed: childChanged, result: childResult } = prune3(current, pattern);
484
+ if (childChanged) {
485
+ changed = true;
486
+ }
487
+ if (Object.keys(childResult).length === 0) {
488
+ delete result[key];
489
+ } else {
490
+ setConfigEntry(result, key, childResult);
491
+ }
492
+ continue;
493
+ }
494
+ if (!isConfigObject3(pattern) || Object.keys(pattern).length === 0) {
495
+ delete result[key];
496
+ changed = true;
497
+ }
498
+ }
499
+ return { changed, result };
500
+ }
501
+ var yamlFormat = {
502
+ parse: parse4,
503
+ serialize: serialize3,
504
+ merge: merge3,
505
+ prune: prune3
506
+ };
507
+
508
+ // packages/config-mutations/src/testing/format-utils.ts
509
+ function parseToml2(content) {
510
+ return tomlFormat.parse(content);
511
+ }
512
+ function serializeToml(obj) {
513
+ return tomlFormat.serialize(obj);
514
+ }
515
+ function parseJson(content) {
516
+ return jsonFormat.parse(content);
517
+ }
518
+ function serializeJson(obj) {
519
+ return jsonFormat.serialize(obj);
520
+ }
521
+ function parseYaml2(content) {
522
+ return yamlFormat.parse(content);
523
+ }
524
+ function serializeYaml(obj) {
525
+ return yamlFormat.serialize(obj);
526
+ }
527
+ export {
528
+ createMockFs,
529
+ parseJson,
530
+ parseToml2 as parseToml,
531
+ parseYaml2 as parseYaml,
532
+ serializeJson,
533
+ serializeToml,
534
+ serializeYaml
535
+ };
536
+ //# sourceMappingURL=config-testing.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../packages/config-mutations/src/testing/mock-fs.ts", "../packages/config-mutations/src/formats/json.ts", "../packages/config-mutations/src/formats/object.ts", "../packages/config-mutations/src/formats/toml.ts", "../packages/config-mutations/src/formats/yaml.ts", "../packages/config-mutations/src/testing/format-utils.ts"],
4
+ "sourcesContent": ["import path from \"node:path\";\nimport type { FileSystem } from \"../types.js\";\n\nexport interface MockFileSystem extends FileSystem {\n /** Current file contents, keyed by absolute path */\n files: Record<string, string>;\n /** Created directories */\n directories: Set<string>;\n /** Check if a path exists (file or directory) */\n exists(path: string): boolean;\n /** Get file content or undefined if not found */\n getContent(path: string): string | undefined;\n /** Read file with encoding overloads for compatibility */\n readFile(path: string, encoding: BufferEncoding): Promise<string>;\n readFile(path: string): Promise<Buffer>;\n}\n\nexport interface MockFsOptions {\n /** Initial files - paths can use ~ which will be expanded to homeDir */\n [path: string]: string;\n}\n\nconst DEFAULT_HOME_DIR = \"/home/test\";\n\n/**\n * Create an in-memory mock filesystem for testing mutations.\n *\n * @param initialFiles - Initial files to populate the filesystem with\n * @param homeDir - Home directory for ~ expansion (defaults to /home/test)\n */\nexport function createMockFs(\n initialFiles?: MockFsOptions,\n homeDir: string = DEFAULT_HOME_DIR\n): MockFileSystem {\n const files: Record<string, string> = {};\n const directories = new Set<string>();\n\n // Initialize with provided files\n if (initialFiles) {\n for (const [filePath, content] of Object.entries(initialFiles)) {\n const absolutePath = expandPath(filePath, homeDir);\n files[absolutePath] = content;\n\n // Ensure parent directories exist\n const parentDir = path.dirname(absolutePath);\n addDirectoryTree(parentDir, directories);\n }\n }\n\n // Ensure home directory exists\n addDirectoryTree(homeDir, directories);\n\n const mockFs = {\n files,\n directories,\n\n exists(filePath: string): boolean {\n const absolutePath = expandPath(filePath, homeDir);\n return absolutePath in files || directories.has(absolutePath);\n },\n\n getContent(filePath: string): string | undefined {\n const absolutePath = expandPath(filePath, homeDir);\n return files[absolutePath];\n },\n\n async readFile(filePath: string, encoding?: BufferEncoding): Promise<string | Buffer> {\n const absolutePath = expandPath(filePath, homeDir);\n if (!(absolutePath in files)) {\n const error = new Error(`ENOENT: no such file or directory, open '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n const content = files[absolutePath]!;\n if (encoding) {\n return content;\n }\n return Buffer.from(content, \"utf8\");\n },\n\n async writeFile(\n filePath: string,\n content: string | NodeJS.ArrayBufferView,\n options?: { encoding?: BufferEncoding; flag?: string }\n ): Promise<void> {\n const absolutePath = expandPath(filePath, homeDir);\n\n if (options?.flag === \"wx\" && absolutePath in files) {\n const error = new Error(`EEXIST: file already exists, open '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"EEXIST\";\n throw error;\n }\n\n // Ensure parent directory exists\n const parentDir = path.dirname(absolutePath);\n if (!directories.has(parentDir)) {\n const error = new Error(`ENOENT: no such file or directory, open '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n\n if (typeof content === \"string\") {\n files[absolutePath] = content;\n } else if (Buffer.isBuffer(content)) {\n files[absolutePath] = content.toString(\"utf8\");\n } else {\n files[absolutePath] = Buffer.from(\n content.buffer,\n content.byteOffset,\n content.byteLength\n ).toString(\"utf8\");\n }\n },\n\n async mkdir(dirPath: string, options?: { recursive: boolean }): Promise<void> {\n const absolutePath = expandPath(dirPath, homeDir);\n\n if (options?.recursive) {\n addDirectoryTree(absolutePath, directories);\n } else {\n // Check parent exists\n const parentDir = path.dirname(absolutePath);\n if (parentDir !== absolutePath && !directories.has(parentDir)) {\n const error = new Error(`ENOENT: no such file or directory, mkdir '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n directories.add(absolutePath);\n }\n },\n\n async unlink(filePath: string): Promise<void> {\n const absolutePath = expandPath(filePath, homeDir);\n if (!(absolutePath in files)) {\n const error = new Error(`ENOENT: no such file or directory, unlink '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n delete files[absolutePath];\n },\n\n async rename(oldPath: string, newPath: string): Promise<void> {\n const absoluteOldPath = expandPath(oldPath, homeDir);\n const absoluteNewPath = expandPath(newPath, homeDir);\n if (!(absoluteOldPath in files)) {\n const error = new Error(`ENOENT: no such file or directory, rename '${absoluteOldPath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n files[absoluteNewPath] = files[absoluteOldPath]!;\n delete files[absoluteOldPath];\n },\n\n async stat(filePath: string): Promise<{ mode?: number }> {\n const absolutePath = expandPath(filePath, homeDir);\n if (absolutePath in files) {\n return { mode: 0o644 };\n }\n if (directories.has(absolutePath)) {\n return { mode: 0o755 };\n }\n const error = new Error(`ENOENT: no such file or directory, stat '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n },\n\n async lstat(filePath: string): Promise<{ isSymbolicLink(): boolean }> {\n const absolutePath = expandPath(filePath, homeDir);\n if (absolutePath in files || directories.has(absolutePath)) {\n return { isSymbolicLink: () => false };\n }\n const error = new Error(`ENOENT: no such file or directory, lstat '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n },\n\n async readdir(dirPath: string): Promise<string[]> {\n const absolutePath = expandPath(dirPath, homeDir);\n\n if (absolutePath in files) {\n const error = new Error(`ENOTDIR: not a directory, scandir '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOTDIR\";\n throw error;\n }\n\n if (!directories.has(absolutePath)) {\n const error = new Error(`ENOENT: no such file or directory, scandir '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n\n const entries = new Set<string>();\n for (const filePath of Object.keys(files)) {\n if (path.dirname(filePath) === absolutePath) {\n entries.add(path.basename(filePath));\n }\n }\n for (const dir of directories) {\n if (dir !== absolutePath && path.dirname(dir) === absolutePath) {\n entries.add(path.basename(dir));\n }\n }\n\n return Array.from(entries);\n },\n\n async chmod(filePath: string, mode: number): Promise<void> {\n void mode; // In mock fs, we don't actually store mode changes\n const absolutePath = expandPath(filePath, homeDir);\n if (!(absolutePath in files) && !directories.has(absolutePath)) {\n const error = new Error(`ENOENT: no such file or directory, chmod '${absolutePath}'`);\n (error as NodeJS.ErrnoException).code = \"ENOENT\";\n throw error;\n }\n // Mode change is a no-op in mock fs but we don't throw\n }\n };\n\n return mockFs as MockFileSystem;\n}\n\n/**\n * Expand ~ to homeDir in a path.\n */\nfunction expandPath(inputPath: string, homeDir: string): string {\n if (inputPath.startsWith(\"~/\")) {\n return path.join(homeDir, inputPath.slice(2));\n }\n if (inputPath === \"~\") {\n return homeDir;\n }\n if (inputPath.startsWith(\"~\")) {\n // ~something (not ~/) - treat as relative path from home\n return path.join(homeDir, inputPath.slice(1));\n }\n return inputPath;\n}\n\n/**\n * Add a directory and all its parent directories to the set.\n */\nfunction addDirectoryTree(dirPath: string, directories: Set<string>): void {\n const parts = dirPath.split(path.sep).filter(Boolean);\n let current = \"/\";\n directories.add(current);\n\n for (const part of parts) {\n current = path.join(current, part);\n directories.add(current);\n }\n}\n", "import * as jsonc from \"jsonc-parser\";\nimport type { ConfigFormat, ConfigObject, ConfigValue } from \"../types.js\";\nimport { cloneConfigObject, hasConfigEntry, setConfigEntry } from \"./object.js\";\n\nfunction isConfigObject(value: unknown): value is ConfigObject {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction detectIndent(content: string): string {\n const match = content.match(/^[\\t ]+/m);\n if (match) {\n return match[0];\n }\n return \" \";\n}\n\nfunction parse(content: string): ConfigObject {\n if (!content || content.trim() === \"\") {\n return {};\n }\n const errors: jsonc.ParseError[] = [];\n const parsed = jsonc.parse(content, errors, {\n allowTrailingComma: true,\n disallowComments: false\n });\n if (errors.length > 0) {\n throw new Error(`JSON parse error: ${jsonc.printParseErrorCode(errors[0].error)}`);\n }\n if (parsed === null || parsed === undefined) {\n return {};\n }\n if (!isConfigObject(parsed)) {\n throw new Error(\"Expected JSON object.\");\n }\n return cloneConfigObject(parsed);\n}\n\nfunction serialize(obj: ConfigObject): string {\n return `${JSON.stringify(obj, null, 2)}\\n`;\n}\n\nfunction merge(base: ConfigObject, patch: ConfigObject): ConfigObject {\n const result = cloneConfigObject(base);\n for (const [key, value] of Object.entries(patch)) {\n if (value === undefined) {\n continue;\n }\n const existing = hasConfigEntry(result, key) ? result[key] : undefined;\n if (isConfigObject(existing) && isConfigObject(value)) {\n setConfigEntry(result, key, merge(existing, value));\n continue;\n }\n setConfigEntry(result, key, value as ConfigValue);\n }\n return result;\n}\n\nfunction configValuesEqual(left: ConfigValue | undefined, right: ConfigValue | undefined): boolean {\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\nfunction prune(\n obj: ConfigObject,\n shape: ConfigObject\n): { changed: boolean; result: ConfigObject } {\n let changed = false;\n const result = cloneConfigObject(obj);\n\n for (const [key, pattern] of Object.entries(shape)) {\n if (!hasConfigEntry(result, key)) {\n continue;\n }\n\n const current = result[key];\n\n // Empty object pattern means \"delete this key entirely\"\n if (isConfigObject(pattern) && Object.keys(pattern).length === 0) {\n delete result[key];\n changed = true;\n continue;\n }\n\n // Non-empty object pattern with object current: recurse\n if (isConfigObject(pattern) && isConfigObject(current)) {\n const { changed: childChanged, result: childResult } = prune(\n current,\n pattern\n );\n if (childChanged) {\n changed = true;\n }\n if (Object.keys(childResult).length === 0) {\n delete result[key];\n } else {\n setConfigEntry(result, key, childResult);\n }\n continue;\n }\n\n if (isConfigObject(pattern) && Object.keys(pattern).length > 0) {\n continue;\n }\n\n delete result[key];\n changed = true;\n }\n\n return { changed, result };\n}\n\n/**\n * Modify JSON content at a specific path while preserving comments and formatting.\n * Uses jsonc-parser's modify() for targeted updates.\n *\n * @param content - The original JSON content (may include comments)\n * @param path - JSON path array, e.g. [\"mcpServers\", \"my-server\"]\n * @param value - The value to set (or undefined to remove)\n * @returns The modified JSON content with comments preserved\n */\nfunction modifyAtPath(\n content: string,\n path: (string | number)[],\n value: ConfigValue | undefined\n): string {\n const indent = detectIndent(content);\n const formattingOptions: jsonc.FormattingOptions = {\n tabSize: indent === \"\\t\" ? 1 : indent.length,\n insertSpaces: indent !== \"\\t\",\n eol: \"\\n\"\n };\n\n const edits = jsonc.modify(content, path, value, { formattingOptions });\n let result = jsonc.applyEdits(content, edits);\n\n if (!result.endsWith(\"\\n\")) {\n result += \"\\n\";\n }\n\n return result;\n}\n\n/**\n * Merge a patch into JSON content while preserving comments and formatting.\n * Uses jsonc.modify() for each top-level key to preserve existing comments.\n *\n * @param content - The original JSON content (may include comments)\n * @param patch - Object with values to merge\n * @returns The modified JSON content with comments preserved\n */\nfunction mergePreservingComments(\n content: string,\n patch: ConfigObject\n): string {\n const current = parse(content);\n return serializeUpdate(content || \"{}\", current, merge(current, patch));\n}\n\n/**\n * Remove a key from JSON content while preserving comments and formatting.\n *\n * @param content - The original JSON content\n * @param path - JSON path array to the key to remove\n * @returns The modified JSON content with comments preserved\n */\nfunction removeAtPath(content: string, path: (string | number)[]): string {\n return modifyAtPath(content, path, undefined);\n}\n\nfunction serializeUpdate(\n content: string,\n current: ConfigObject,\n next: ConfigObject\n): string {\n let result = content || \"{}\";\n result = applyObjectUpdate(result, [], current, next);\n\n if (!result.endsWith(\"\\n\")) {\n result += \"\\n\";\n }\n\n return result;\n}\n\nfunction applyObjectUpdate(\n content: string,\n path: (string | number)[],\n current: ConfigObject,\n next: ConfigObject\n): string {\n let result = content;\n\n for (const key of Object.keys(current)) {\n if (!hasConfigEntry(next, key)) {\n result = removeAtPath(result, [...path, key]);\n }\n }\n\n for (const [key, nextValue] of Object.entries(next)) {\n const nextPath = [...path, key];\n const hasCurrent = hasConfigEntry(current, key);\n const currentValue = hasCurrent ? current[key] : undefined;\n\n if (hasCurrent && isConfigObject(currentValue) && isConfigObject(nextValue)) {\n result = applyObjectUpdate(result, nextPath, currentValue, nextValue);\n continue;\n }\n\n if (!hasCurrent || !configValuesEqual(currentValue, nextValue)) {\n result = modifyAtPath(result, nextPath, nextValue as ConfigValue);\n }\n }\n\n return result;\n}\n\nexport {\n detectIndent,\n modifyAtPath,\n mergePreservingComments,\n removeAtPath,\n serializeUpdate\n};\n\nexport const jsonFormat: ConfigFormat = {\n parse,\n serialize,\n serializeUpdate,\n merge,\n prune\n};\n", "import type { ConfigObject, ConfigValue } from \"../types.js\";\n\nexport function cloneConfigObject(value: ConfigObject): ConfigObject {\n const result: ConfigObject = {};\n for (const [key, entry] of Object.entries(value)) {\n setConfigEntry(result, key, cloneConfigValue(entry));\n }\n return result;\n}\n\nexport function setConfigEntry(target: ConfigObject, key: string, value: ConfigValue): void {\n Object.defineProperty(target, key, {\n configurable: true,\n enumerable: true,\n writable: true,\n value\n });\n}\n\nexport function hasConfigEntry(target: ConfigObject, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(target, key);\n}\n\nfunction cloneConfigValue(value: ConfigValue): ConfigValue {\n if (Array.isArray(value)) {\n return value.map((entry) => cloneConfigValue(entry));\n }\n if (value && typeof value === \"object\" && !(value instanceof Date)) {\n return cloneConfigObject(value as ConfigObject);\n }\n return value;\n}\n", "import { parse as parseToml, stringify as stringifyToml } from \"smol-toml\";\nimport type { ConfigFormat, ConfigObject, ConfigValue } from \"../types.js\";\nimport { cloneConfigObject, hasConfigEntry, setConfigEntry } from \"./object.js\";\n\nfunction isConfigObject(value: unknown): value is ConfigObject {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parse(content: string): ConfigObject {\n if (!content || content.trim() === \"\") {\n return {};\n }\n const parsed = parseToml(content);\n if (!isConfigObject(parsed)) {\n throw new Error(\"Expected TOML document to be a table.\");\n }\n return cloneConfigObject(parsed as ConfigObject);\n}\n\nfunction serialize(obj: ConfigObject): string {\n const serialized = stringifyToml(obj);\n return serialized.endsWith(\"\\n\") ? serialized : `${serialized}\\n`;\n}\n\nfunction merge(base: ConfigObject, patch: ConfigObject): ConfigObject {\n const result = cloneConfigObject(base);\n for (const [key, value] of Object.entries(patch)) {\n if (value === undefined) {\n continue;\n }\n const existing = hasConfigEntry(result, key) ? result[key] : undefined;\n if (isConfigObject(existing) && isConfigObject(value)) {\n setConfigEntry(result, key, merge(existing, value));\n continue;\n }\n setConfigEntry(result, key, value as ConfigValue);\n }\n return result;\n}\n\nfunction prune(\n obj: ConfigObject,\n shape: ConfigObject\n): { changed: boolean; result: ConfigObject } {\n let changed = false;\n const result = cloneConfigObject(obj);\n\n for (const [key, pattern] of Object.entries(shape)) {\n if (!hasConfigEntry(result, key)) {\n continue;\n }\n\n const current = result[key];\n\n // Empty object pattern means \"delete this key entirely\"\n if (isConfigObject(pattern) && Object.keys(pattern).length === 0) {\n delete result[key];\n changed = true;\n continue;\n }\n\n // Non-empty object pattern with object current: recurse\n if (isConfigObject(pattern) && isConfigObject(current)) {\n const { changed: childChanged, result: childResult } = prune(\n current,\n pattern\n );\n if (childChanged) {\n changed = true;\n }\n if (Object.keys(childResult).length === 0) {\n delete result[key];\n } else {\n setConfigEntry(result, key, childResult);\n }\n continue;\n }\n\n if (!isConfigObject(pattern) || Object.keys(pattern).length === 0) {\n delete result[key];\n changed = true;\n }\n }\n\n return { changed, result };\n}\n\nexport const tomlFormat: ConfigFormat = {\n parse,\n serialize,\n merge,\n prune\n};\n", "import { parse as parseYaml, stringify as stringifyYaml } from \"yaml\";\nimport type { ConfigFormat, ConfigObject, ConfigValue } from \"../types.js\";\nimport { cloneConfigObject, hasConfigEntry, setConfigEntry } from \"./object.js\";\n\nfunction isConfigObject(value: unknown): value is ConfigObject {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parse(content: string): ConfigObject {\n if (!content || content.trim() === \"\") {\n return {};\n }\n const parsed = parseYaml(content);\n if (parsed === null || parsed === undefined) {\n return {};\n }\n if (!isConfigObject(parsed)) {\n throw new Error(\"Expected YAML object.\");\n }\n return cloneConfigObject(parsed);\n}\n\nfunction serialize(obj: ConfigObject): string {\n const serialized = stringifyYaml(obj);\n return serialized.endsWith(\"\\n\") ? serialized : `${serialized}\\n`;\n}\n\nfunction merge(base: ConfigObject, patch: ConfigObject): ConfigObject {\n const result = cloneConfigObject(base);\n for (const [key, value] of Object.entries(patch)) {\n if (value === undefined) {\n continue;\n }\n const existing = hasConfigEntry(result, key) ? result[key] : undefined;\n if (isConfigObject(existing) && isConfigObject(value)) {\n setConfigEntry(result, key, merge(existing, value));\n continue;\n }\n setConfigEntry(result, key, value as ConfigValue);\n }\n return result;\n}\n\nfunction prune(\n obj: ConfigObject,\n shape: ConfigObject\n): { changed: boolean; result: ConfigObject } {\n let changed = false;\n const result = cloneConfigObject(obj);\n\n for (const [key, pattern] of Object.entries(shape)) {\n if (!hasConfigEntry(result, key)) {\n continue;\n }\n\n const current = result[key];\n\n if (isConfigObject(pattern) && Object.keys(pattern).length === 0) {\n delete result[key];\n changed = true;\n continue;\n }\n\n if (isConfigObject(pattern) && isConfigObject(current)) {\n const { changed: childChanged, result: childResult } = prune(current, pattern);\n if (childChanged) {\n changed = true;\n }\n if (Object.keys(childResult).length === 0) {\n delete result[key];\n } else {\n setConfigEntry(result, key, childResult);\n }\n continue;\n }\n\n if (!isConfigObject(pattern) || Object.keys(pattern).length === 0) {\n delete result[key];\n changed = true;\n }\n }\n\n return { changed, result };\n}\n\nexport const yamlFormat: ConfigFormat = {\n parse,\n serialize,\n merge,\n prune\n};\n", "import type { ConfigObject } from \"../types.js\";\nimport { jsonFormat } from \"../formats/json.js\";\nimport { tomlFormat } from \"../formats/toml.js\";\nimport { yamlFormat } from \"../formats/yaml.js\";\n\nexport function parseToml(content: string): ConfigObject {\n return tomlFormat.parse(content);\n}\n\nexport function serializeToml(obj: ConfigObject): string {\n return tomlFormat.serialize(obj);\n}\n\nexport function parseJson(content: string): ConfigObject {\n return jsonFormat.parse(content);\n}\n\nexport function serializeJson(obj: ConfigObject): string {\n return jsonFormat.serialize(obj);\n}\n\nexport function parseYaml(content: string): ConfigObject {\n return yamlFormat.parse(content);\n}\n\nexport function serializeYaml(obj: ConfigObject): string {\n return yamlFormat.serialize(obj);\n}\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AAsBjB,IAAM,mBAAmB;AAQlB,SAAS,aACd,cACA,UAAkB,kBACF;AAChB,QAAM,QAAgC,CAAC;AACvC,QAAM,cAAc,oBAAI,IAAY;AAGpC,MAAI,cAAc;AAChB,eAAW,CAAC,UAAU,OAAO,KAAK,OAAO,QAAQ,YAAY,GAAG;AAC9D,YAAM,eAAe,WAAW,UAAU,OAAO;AACjD,YAAM,YAAY,IAAI;AAGtB,YAAM,YAAY,KAAK,QAAQ,YAAY;AAC3C,uBAAiB,WAAW,WAAW;AAAA,IACzC;AAAA,EACF;AAGA,mBAAiB,SAAS,WAAW;AAErC,QAAM,SAAS;AAAA,IACb;AAAA,IACA;AAAA,IAEA,OAAO,UAA2B;AAChC,YAAM,eAAe,WAAW,UAAU,OAAO;AACjD,aAAO,gBAAgB,SAAS,YAAY,IAAI,YAAY;AAAA,IAC9D;AAAA,IAEA,WAAW,UAAsC;AAC/C,YAAM,eAAe,WAAW,UAAU,OAAO;AACjD,aAAO,MAAM,YAAY;AAAA,IAC3B;AAAA,IAEA,MAAM,SAAS,UAAkB,UAAqD;AACpF,YAAM,eAAe,WAAW,UAAU,OAAO;AACjD,UAAI,EAAE,gBAAgB,QAAQ;AAC5B,cAAM,QAAQ,IAAI,MAAM,4CAA4C,YAAY,GAAG;AACnF,QAAC,MAAgC,OAAO;AACxC,cAAM;AAAA,MACR;AACA,YAAM,UAAU,MAAM,YAAY;AAClC,UAAI,UAAU;AACZ,eAAO;AAAA,MACT;AACA,aAAO,OAAO,KAAK,SAAS,MAAM;AAAA,IACpC;AAAA,IAEA,MAAM,UACJ,UACA,SACA,SACe;A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,QAAQ,GAAG,GAAG;AAChC;AAAA,IACF;AAEA,UAAM,UAAU,OAAO,GAAG;AAE1B,QAAIJ,gBAAe,OAAO,KAAK,OAAO,KAAK,OAAO,EAAE,WAAW,GAAG;AAChE,aAAO,OAAO,GAAG;AACjB,gBAAU;AACV;AAAA,IACF;AAEA,QAAIA,gBAAe,OAAO,KAAKA,gBAAe,OAAO,GAAG;AACtD,YAAM,EAAE,SAAS,cAAc,QAAQ,YAAY,IAAII,OAAM,SAAS,OAAO;AAC7E,UAAI,cAAc;AAChB,kBAAU;AAAA,MACZ;AACA,UAAI,OAAO,KAAK,WAAW,EAAE,WAAW,GAAG;AACzC,eAAO,OAAO,GAAG;AAAA,MACnB,OAAO;AACL,uBAAe,QAAQ,KAAK,WAAW;AAAA,MACzC;AACA;AAAA,IACF;AAEA,QAAI,CAACJ,gBAAe,OAAO,KAAK,OAAO,KAAK,OAAO,EAAE,WAAW,GAAG;AACjE,aAAO,OAAO,GAAG;AACjB,gBAAU;AAAA,IACZ;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,OAAO;AAC3B;AAEO,IAAM,aAA2B;AAAA,EACtC,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACF;;;ACrFO,SAASC,WAAU,SAA+B;AACvD,SAAO,WAAW,MAAM,OAAO;AACjC;AAEO,SAAS,cAAc,KAA2B;AACvD,SAAO,WAAW,UAAU,GAAG;AACjC;AAEO,SAAS,UAAU,SAA+B;AACvD,SAAO,WAAW,MAAM,OAAO;AACjC;AAEO,SAAS,cAAc,KAA2B;AACvD,SAAO,WAAW,UAAU,GAAG;AACjC;AAEO,SAASC,WAAU,SAA+B;AACvD,SAAO,WAAW,MAAM,OAAO;AACjC;AAEO,SAAS,cAAc,KAA2B;AACvD,SAAO,WAAW,UAAU,GAAG;AACjC;",
6
+ "names": ["parse", "path", "path", "parse", "isConfigObject", "parse", "serialize", "merge", "prune", "isConfigObject", "parse", "serialize", "merge", "prune", "parseToml", "parseYaml"]
7
+ }
@@ -0,0 +1 @@
1
+ export * from "../packages/poe-code-config/dist/index.js";