@mulmoclaude/core 6.0.1 → 7.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 (43) hide show
  1. package/dist/collection/index.cjs +1 -1
  2. package/dist/collection/index.js +1 -1
  3. package/dist/collection/registry/server/index.cjs +6 -6
  4. package/dist/collection/registry/server/index.js +6 -6
  5. package/dist/collection/server/index.cjs +1 -1
  6. package/dist/collection/server/index.js +1 -1
  7. package/dist/collection-watchers/index.cjs +2 -2
  8. package/dist/collection-watchers/index.js +2 -2
  9. package/dist/feeds/server/index.cjs +4 -4
  10. package/dist/feeds/server/index.js +4 -4
  11. package/dist/files/index.cjs +11 -31
  12. package/dist/files/index.cjs.map +1 -1
  13. package/dist/files/index.d.ts +1 -0
  14. package/dist/files/index.js +4 -28
  15. package/dist/files/index.js.map +1 -1
  16. package/dist/files/withinRoot.d.ts +7 -0
  17. package/dist/google/index.cjs +3 -3
  18. package/dist/google/index.js +3 -3
  19. package/dist/plugin-vue/index.cjs +181 -267
  20. package/dist/plugin-vue/index.cjs.map +1 -1
  21. package/dist/plugin-vue/index.js +181 -267
  22. package/dist/plugin-vue/index.js.map +1 -1
  23. package/dist/remote-host/server/index.cjs +1 -1
  24. package/dist/remote-host/server/index.js +1 -1
  25. package/dist/{server-CQ88wv71.cjs → server-CnCUBmSn.cjs} +5 -5
  26. package/dist/{server-CQ88wv71.cjs.map → server-CnCUBmSn.cjs.map} +1 -1
  27. package/dist/{server-Dh7pgRRg.js → server-Dp5KWarO.js} +5 -5
  28. package/dist/{server-Dh7pgRRg.js.map → server-Dp5KWarO.js.map} +1 -1
  29. package/dist/whisper/index.cjs +1 -1
  30. package/dist/whisper/index.js +1 -1
  31. package/dist/wiki/index.cjs +1 -1
  32. package/dist/wiki/index.js +1 -1
  33. package/dist/wiki/server/fs.d.ts +0 -2
  34. package/dist/wiki/server/index.cjs +64 -47
  35. package/dist/wiki/server/index.cjs.map +1 -1
  36. package/dist/wiki/server/index.js +65 -48
  37. package/dist/wiki/server/index.js.map +1 -1
  38. package/dist/wiki/server/locations.d.ts +10 -0
  39. package/dist/withinRoot-Bbj6E-Lf.js +84 -0
  40. package/dist/withinRoot-Bbj6E-Lf.js.map +1 -0
  41. package/dist/withinRoot-FLjxC8oP.cjs +121 -0
  42. package/dist/withinRoot-FLjxC8oP.cjs.map +1 -0
  43. package/package.json +9 -9
@@ -0,0 +1,10 @@
1
+ export interface WikiReadLocations {
2
+ /** `<workspace>/data/wiki/pages` as the caller spelled it: resolved page paths handed back are joined onto this. */
3
+ pagesDir: string;
4
+ /** The workspace's realpath: every read re-checks against it after opening. */
5
+ workspaceReal: string | null;
6
+ pagesReal: string | null;
7
+ indexReal: string | null;
8
+ logReal: string | null;
9
+ }
10
+ export declare function wikiReadLocations(workspace: string): WikiReadLocations;
@@ -0,0 +1,84 @@
1
+ import { closeSync, constants, fstatSync, lstatSync, openSync, readFileSync, realpathSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { open } from "node:fs/promises";
4
+ // src/files/safe.ts
5
+ /** True for a `not found` filesystem error (ENOENT) — lets callers treat a
6
+ * missing file as an empty/default result instead of a thrown error. */
7
+ function isEnoent(err) {
8
+ return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
9
+ }
10
+ /** Realpath-based read-time containment: resolve `relPath` against the root's
11
+ * realpath and require the target's realpath to stay inside it. Returns null
12
+ * on ENOENT or traversal (symlink escapes included). `rootReal` MUST already
13
+ * be a realpath. The one implementation for host and plugins (#2461) — this
14
+ * security-critical primitive must not drift per consumer. */
15
+ function resolveWithinRoot(rootReal, relPath) {
16
+ const normalized = path.normalize(relPath || "");
17
+ const resolvedReal = realpathOrNull(path.resolve(rootReal, normalized));
18
+ if (resolvedReal === null) return null;
19
+ if (resolvedReal !== rootReal && !resolvedReal.startsWith(rootReal + path.sep)) return null;
20
+ return resolvedReal;
21
+ }
22
+ function realpathOrNull(absPath) {
23
+ try {
24
+ return realpathSync(absPath);
25
+ } catch {
26
+ return null;
27
+ }
28
+ }
29
+ // src/files/withinRoot.ts
30
+ var READ_FLAGS = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);
31
+ function isWithinRoot(rootReal, candidateReal) {
32
+ const rel = path.relative(rootReal, candidateReal);
33
+ return rel !== ".." && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel);
34
+ }
35
+ function realpathSyncOrNull(absPath) {
36
+ try {
37
+ return realpathSync.native(absPath);
38
+ } catch (err) {
39
+ return isEnoent(err) ? null : jsRealpathOrNull(absPath);
40
+ }
41
+ }
42
+ function jsRealpathOrNull(absPath) {
43
+ try {
44
+ return realpathSync(absPath);
45
+ } catch {
46
+ return null;
47
+ }
48
+ }
49
+ function isOpenedFileInside(rootReal, absPath, opened) {
50
+ const real = realpathSyncOrNull(absPath);
51
+ if (real === null || !isWithinRoot(rootReal, real) || !opened.isFile()) return false;
52
+ const onDisk = lstatSync(real, { bigint: true });
53
+ return onDisk.isFile() && onDisk.dev === opened.dev && onDisk.ino === opened.ino;
54
+ }
55
+ /** Text of a regular file inside `rootReal` (a realpath), or null when it is missing, leads outside, is a FIFO or
56
+ * other non-file, or is unreadable. */
57
+ async function readTextWithinRoot(rootReal, absPath) {
58
+ try {
59
+ const handle = await open(absPath, READ_FLAGS);
60
+ try {
61
+ return isOpenedFileInside(rootReal, absPath, await handle.stat({ bigint: true })) ? await handle.readFile("utf-8") : null;
62
+ } finally {
63
+ await handle.close();
64
+ }
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+ /** Sync twin of `readTextWithinRoot`. */
70
+ function readTextWithinRootSync(rootReal, absPath) {
71
+ try {
72
+ const descriptor = openSync(absPath, READ_FLAGS);
73
+ try {
74
+ return isOpenedFileInside(rootReal, absPath, fstatSync(descriptor, { bigint: true })) ? readFileSync(descriptor, "utf-8") : null;
75
+ } finally {
76
+ closeSync(descriptor);
77
+ }
78
+ } catch {
79
+ return null;
80
+ }
81
+ }
82
+ export { isEnoent as a, realpathSyncOrNull as i, readTextWithinRoot as n, resolveWithinRoot as o, readTextWithinRootSync as r, isWithinRoot as t };
83
+
84
+ //# sourceMappingURL=withinRoot-Bbj6E-Lf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withinRoot-Bbj6E-Lf.js","names":[],"sources":["../src/files/safe.ts","../src/files/withinRoot.ts"],"sourcesContent":["import { realpathSync } from \"node:fs\";\nimport path from \"node:path\";\n\n/** True for a `not found` filesystem error (ENOENT) — lets callers treat a\n * missing file as an empty/default result instead of a thrown error. */\nexport function isEnoent(err: unknown): boolean {\n return typeof err === \"object\" && err !== null && \"code\" in err && err.code === \"ENOENT\";\n}\n\n/** Realpath-based read-time containment: resolve `relPath` against the root's\n * realpath and require the target's realpath to stay inside it. Returns null\n * on ENOENT or traversal (symlink escapes included). `rootReal` MUST already\n * be a realpath. The one implementation for host and plugins (#2461) — this\n * security-critical primitive must not drift per consumer. */\nexport function resolveWithinRoot(rootReal: string, relPath: string): string | null {\n const normalized = path.normalize(relPath || \"\");\n const resolved = path.resolve(rootReal, normalized);\n const resolvedReal = realpathOrNull(resolved);\n if (resolvedReal === null) return null;\n if (resolvedReal !== rootReal && !resolvedReal.startsWith(rootReal + path.sep)) {\n return null;\n }\n return resolvedReal;\n}\n\nfunction realpathOrNull(absPath: string): string | null {\n try {\n return realpathSync(absPath);\n } catch {\n return null;\n }\n}\n","// Synchronous containment and whole-file reads for callers that cannot await (prompt assembly, the wiki engine's\n// sync readers). The read opens first and then proves where the path leads, like `openVerifiedWithinScope`.\n\nimport type { BigIntStats } from \"node:fs\";\nimport { closeSync, constants, fstatSync, lstatSync, openSync, readFileSync, realpathSync } from \"node:fs\";\nimport { open } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { isEnoent } from \"./safe.js\";\n\n// A FIFO must not block the server, and a link is refused at open where the OS can; both flags are undefined on\n// Windows, where the check after the open is what refuses a link out.\nconst READ_FLAGS = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);\n\n// `path.relative` rather than a `rootReal + sep` prefix, which a root at a filesystem root (`/`, `C:\\`) would fail.\nexport function isWithinRoot(rootReal: string, candidateReal: string): boolean {\n const rel = path.relative(rootReal, candidateReal);\n return rel !== \"..\" && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel);\n}\n\n// Native first: the JS realpath keeps a link's letter case, so on a case-insensitive disk an inside link looks outside.\n// The JS one is the fallback for drives where the native call throws (EISDIR on some Windows RAM disks).\nexport function realpathSyncOrNull(absPath: string): string | null {\n try {\n return realpathSync.native(absPath);\n } catch (err) {\n return isEnoent(err) ? null : jsRealpathOrNull(absPath);\n }\n}\n\nfunction jsRealpathOrNull(absPath: string): string | null {\n try {\n return realpathSync(absPath);\n } catch {\n return null;\n }\n}\n\n// Checked after the open, so a folder or file swapped for a link out between the caller's check and the open, or\n// swapped back before this check, is refused: where the path leads now must be inside and be the opened file.\nfunction isOpenedFileInside(rootReal: string, absPath: string, opened: BigIntStats): boolean {\n const real = realpathSyncOrNull(absPath);\n if (real === null || !isWithinRoot(rootReal, real) || !opened.isFile()) return false;\n const onDisk = lstatSync(real, { bigint: true });\n return onDisk.isFile() && onDisk.dev === opened.dev && onDisk.ino === opened.ino;\n}\n\n/** Text of a regular file inside `rootReal` (a realpath), or null when it is missing, leads outside, is a FIFO or\n * other non-file, or is unreadable. */\nexport async function readTextWithinRoot(rootReal: string, absPath: string): Promise<string | null> {\n try {\n const handle = await open(absPath, READ_FLAGS);\n try {\n return isOpenedFileInside(rootReal, absPath, await handle.stat({ bigint: true })) ? await handle.readFile(\"utf-8\") : null;\n } finally {\n await handle.close();\n }\n } catch {\n return null;\n }\n}\n\n/** Sync twin of `readTextWithinRoot`. */\nexport function readTextWithinRootSync(rootReal: string, absPath: string): string | null {\n try {\n const descriptor = openSync(absPath, READ_FLAGS);\n try {\n return isOpenedFileInside(rootReal, absPath, fstatSync(descriptor, { bigint: true })) ? readFileSync(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,QAAQ,KAAK,CAAC;CAC/C,OAAO,OAAO,OAAO,KAAK,OAAO,QAAQ,OAAO,OAAO,OAAO,QAAQ,OAAO;AAC/E;;;AAIA,eAAsB,mBAAmB,UAAkB,SAAyC;CAClG,IAAI;EACF,MAAM,SAAS,MAAM,KAAK,SAAS,UAAU;EAC7C,IAAI;GACF,OAAO,mBAAmB,UAAU,SAAS,MAAM,OAAO,KAAK,EAAE,QAAQ,KAAK,CAAC,CAAC,IAAI,MAAM,OAAO,SAAS,OAAO,IAAI;EACvH,UAAU;GACR,MAAM,OAAO,MAAM;EACrB;CACF,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,uBAAuB,UAAkB,SAAgC;CACvF,IAAI;EACF,MAAM,aAAa,SAAS,SAAS,UAAU;EAC/C,IAAI;GACF,OAAO,mBAAmB,UAAU,SAAS,UAAU,YAAY,EAAE,QAAQ,KAAK,CAAC,CAAC,IAAI,aAAa,YAAY,OAAO,IAAI;EAC9H,UAAU;GACR,UAAU,UAAU;EACtB;CACF,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -0,0 +1,121 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
2
+ let node_fs = require("node:fs");
3
+ let node_path = require("node:path");
4
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
5
+ let node_fs_promises = require("node:fs/promises");
6
+ // src/files/safe.ts
7
+ /** True for a `not found` filesystem error (ENOENT) — lets callers treat a
8
+ * missing file as an empty/default result instead of a thrown error. */
9
+ function isEnoent(err) {
10
+ return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
11
+ }
12
+ /** Realpath-based read-time containment: resolve `relPath` against the root's
13
+ * realpath and require the target's realpath to stay inside it. Returns null
14
+ * on ENOENT or traversal (symlink escapes included). `rootReal` MUST already
15
+ * be a realpath. The one implementation for host and plugins (#2461) — this
16
+ * security-critical primitive must not drift per consumer. */
17
+ function resolveWithinRoot(rootReal, relPath) {
18
+ const normalized = node_path.default.normalize(relPath || "");
19
+ const resolvedReal = realpathOrNull(node_path.default.resolve(rootReal, normalized));
20
+ if (resolvedReal === null) return null;
21
+ if (resolvedReal !== rootReal && !resolvedReal.startsWith(rootReal + node_path.default.sep)) return null;
22
+ return resolvedReal;
23
+ }
24
+ function realpathOrNull(absPath) {
25
+ try {
26
+ return (0, node_fs.realpathSync)(absPath);
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+ // src/files/withinRoot.ts
32
+ var READ_FLAGS = node_fs.constants.O_RDONLY | (node_fs.constants.O_NOFOLLOW ?? 0) | (node_fs.constants.O_NONBLOCK ?? 0);
33
+ function isWithinRoot(rootReal, candidateReal) {
34
+ const rel = node_path.default.relative(rootReal, candidateReal);
35
+ return rel !== ".." && !rel.startsWith(`..${node_path.default.sep}`) && !node_path.default.isAbsolute(rel);
36
+ }
37
+ function realpathSyncOrNull(absPath) {
38
+ try {
39
+ return node_fs.realpathSync.native(absPath);
40
+ } catch (err) {
41
+ return isEnoent(err) ? null : jsRealpathOrNull(absPath);
42
+ }
43
+ }
44
+ function jsRealpathOrNull(absPath) {
45
+ try {
46
+ return (0, node_fs.realpathSync)(absPath);
47
+ } catch {
48
+ return null;
49
+ }
50
+ }
51
+ function isOpenedFileInside(rootReal, absPath, opened) {
52
+ const real = realpathSyncOrNull(absPath);
53
+ if (real === null || !isWithinRoot(rootReal, real) || !opened.isFile()) return false;
54
+ const onDisk = (0, node_fs.lstatSync)(real, { bigint: true });
55
+ return onDisk.isFile() && onDisk.dev === opened.dev && onDisk.ino === opened.ino;
56
+ }
57
+ /** Text of a regular file inside `rootReal` (a realpath), or null when it is missing, leads outside, is a FIFO or
58
+ * other non-file, or is unreadable. */
59
+ async function readTextWithinRoot(rootReal, absPath) {
60
+ try {
61
+ const handle = await (0, node_fs_promises.open)(absPath, READ_FLAGS);
62
+ try {
63
+ return isOpenedFileInside(rootReal, absPath, await handle.stat({ bigint: true })) ? await handle.readFile("utf-8") : null;
64
+ } finally {
65
+ await handle.close();
66
+ }
67
+ } catch {
68
+ return null;
69
+ }
70
+ }
71
+ /** Sync twin of `readTextWithinRoot`. */
72
+ function readTextWithinRootSync(rootReal, absPath) {
73
+ try {
74
+ const descriptor = (0, node_fs.openSync)(absPath, READ_FLAGS);
75
+ try {
76
+ return isOpenedFileInside(rootReal, absPath, (0, node_fs.fstatSync)(descriptor, { bigint: true })) ? (0, node_fs.readFileSync)(descriptor, "utf-8") : null;
77
+ } finally {
78
+ (0, node_fs.closeSync)(descriptor);
79
+ }
80
+ } catch {
81
+ return null;
82
+ }
83
+ }
84
+ Object.defineProperty(exports, "isEnoent", {
85
+ enumerable: true,
86
+ get: function() {
87
+ return isEnoent;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "isWithinRoot", {
91
+ enumerable: true,
92
+ get: function() {
93
+ return isWithinRoot;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "readTextWithinRoot", {
97
+ enumerable: true,
98
+ get: function() {
99
+ return readTextWithinRoot;
100
+ }
101
+ });
102
+ Object.defineProperty(exports, "readTextWithinRootSync", {
103
+ enumerable: true,
104
+ get: function() {
105
+ return readTextWithinRootSync;
106
+ }
107
+ });
108
+ Object.defineProperty(exports, "realpathSyncOrNull", {
109
+ enumerable: true,
110
+ get: function() {
111
+ return realpathSyncOrNull;
112
+ }
113
+ });
114
+ Object.defineProperty(exports, "resolveWithinRoot", {
115
+ enumerable: true,
116
+ get: function() {
117
+ return resolveWithinRoot;
118
+ }
119
+ });
120
+
121
+ //# sourceMappingURL=withinRoot-FLjxC8oP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withinRoot-FLjxC8oP.cjs","names":["path","realpathSync","constants","path","realpathSync","lstatSync","open","openSync","fstatSync","readFileSync"],"sources":["../src/files/safe.ts","../src/files/withinRoot.ts"],"sourcesContent":["import { realpathSync } from \"node:fs\";\nimport path from \"node:path\";\n\n/** True for a `not found` filesystem error (ENOENT) — lets callers treat a\n * missing file as an empty/default result instead of a thrown error. */\nexport function isEnoent(err: unknown): boolean {\n return typeof err === \"object\" && err !== null && \"code\" in err && err.code === \"ENOENT\";\n}\n\n/** Realpath-based read-time containment: resolve `relPath` against the root's\n * realpath and require the target's realpath to stay inside it. Returns null\n * on ENOENT or traversal (symlink escapes included). `rootReal` MUST already\n * be a realpath. The one implementation for host and plugins (#2461) — this\n * security-critical primitive must not drift per consumer. */\nexport function resolveWithinRoot(rootReal: string, relPath: string): string | null {\n const normalized = path.normalize(relPath || \"\");\n const resolved = path.resolve(rootReal, normalized);\n const resolvedReal = realpathOrNull(resolved);\n if (resolvedReal === null) return null;\n if (resolvedReal !== rootReal && !resolvedReal.startsWith(rootReal + path.sep)) {\n return null;\n }\n return resolvedReal;\n}\n\nfunction realpathOrNull(absPath: string): string | null {\n try {\n return realpathSync(absPath);\n } catch {\n return null;\n }\n}\n","// Synchronous containment and whole-file reads for callers that cannot await (prompt assembly, the wiki engine's\n// sync readers). The read opens first and then proves where the path leads, like `openVerifiedWithinScope`.\n\nimport type { BigIntStats } from \"node:fs\";\nimport { closeSync, constants, fstatSync, lstatSync, openSync, readFileSync, realpathSync } from \"node:fs\";\nimport { open } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { isEnoent } from \"./safe.js\";\n\n// A FIFO must not block the server, and a link is refused at open where the OS can; both flags are undefined on\n// Windows, where the check after the open is what refuses a link out.\nconst READ_FLAGS = constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);\n\n// `path.relative` rather than a `rootReal + sep` prefix, which a root at a filesystem root (`/`, `C:\\`) would fail.\nexport function isWithinRoot(rootReal: string, candidateReal: string): boolean {\n const rel = path.relative(rootReal, candidateReal);\n return rel !== \"..\" && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel);\n}\n\n// Native first: the JS realpath keeps a link's letter case, so on a case-insensitive disk an inside link looks outside.\n// The JS one is the fallback for drives where the native call throws (EISDIR on some Windows RAM disks).\nexport function realpathSyncOrNull(absPath: string): string | null {\n try {\n return realpathSync.native(absPath);\n } catch (err) {\n return isEnoent(err) ? null : jsRealpathOrNull(absPath);\n }\n}\n\nfunction jsRealpathOrNull(absPath: string): string | null {\n try {\n return realpathSync(absPath);\n } catch {\n return null;\n }\n}\n\n// Checked after the open, so a folder or file swapped for a link out between the caller's check and the open, or\n// swapped back before this check, is refused: where the path leads now must be inside and be the opened file.\nfunction isOpenedFileInside(rootReal: string, absPath: string, opened: BigIntStats): boolean {\n const real = realpathSyncOrNull(absPath);\n if (real === null || !isWithinRoot(rootReal, real) || !opened.isFile()) return false;\n const onDisk = lstatSync(real, { bigint: true });\n return onDisk.isFile() && onDisk.dev === opened.dev && onDisk.ino === opened.ino;\n}\n\n/** Text of a regular file inside `rootReal` (a realpath), or null when it is missing, leads outside, is a FIFO or\n * other non-file, or is unreadable. */\nexport async function readTextWithinRoot(rootReal: string, absPath: string): Promise<string | null> {\n try {\n const handle = await open(absPath, READ_FLAGS);\n try {\n return isOpenedFileInside(rootReal, absPath, await handle.stat({ bigint: true })) ? await handle.readFile(\"utf-8\") : null;\n } finally {\n await handle.close();\n }\n } catch {\n return null;\n }\n}\n\n/** Sync twin of `readTextWithinRoot`. */\nexport function readTextWithinRootSync(rootReal: string, absPath: string): string | null {\n try {\n const descriptor = openSync(absPath, READ_FLAGS);\n try {\n return isOpenedFileInside(rootReal, absPath, fstatSync(descriptor, { bigint: true })) ? readFileSync(descriptor, \"utf-8\") : null;\n } finally {\n closeSync(descriptor);\n }\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;;;;AAKA,SAAgB,SAAS,KAAuB;CAC9C,OAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,UAAU,OAAO,IAAI,SAAS;AAClF;;;;;;AAOA,SAAgB,kBAAkB,UAAkB,SAAgC;CAClF,MAAM,aAAaA,UAAAA,QAAK,UAAU,WAAW,EAAE;CAE/C,MAAM,eAAe,eADJA,UAAAA,QAAK,QAAQ,UAAU,UACJ,CAAQ;CAC5C,IA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AS,UAAU;EAC7C,IAAI;GACF,OAAO,mBAAmB,UAAU,SAAS,MAAM,OAAO,KAAK,EAAE,QAAQ,KAAK,CAAC,CAAC,IAAI,MAAM,OAAO,SAAS,OAAO,IAAI;EACvH,UAAU;GACR,MAAM,OAAO,MAAM;EACrB;CACF,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,uBAAuB,UAAkB,SAAgC;CACvF,IAAI;EACF,MAAM,cAAA,GAAaC,QAAAA,SAAAA,CAAS,SAAS,UAAU;EAC/C,IAAI;GACF,OAAO,mBAAmB,UAAU,UAAA,GAASC,QAAAA,UAAAA,CAAU,YAAY,EAAE,QAAQ,KAAK,CAAC,CAAC,KAAA,GAAIC,QAAAA,aAAAA,CAAa,YAAY,OAAO,IAAI;EAC9H,UAAU;GACR,CAAA,GAAA,QAAA,UAAA,CAAU,UAAU;EACtB;CACF,QAAQ;EACN,OAAO;CACT;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulmoclaude/core",
3
- "version": "6.0.1",
3
+ "version": "7.1.0",
4
4
  "description": "Shared server-side core for MulmoClaude and MulmoTerminal — the always-shipped-together subsystems consolidated behind subpath exports so the two hosts can't drift. Server-only except the browser-safe ./artifacts, ./whisper/client, ./workspace-setup/slug, ./translation/client, ./remote-view, ./remote-host and ./plugin-vue entries. All host specifics are injected.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -230,20 +230,20 @@
230
230
  "lint": "eslint src test"
231
231
  },
232
232
  "dependencies": {
233
- "@duckdb/node-api": "^1.5.6-r.1",
233
+ "@duckdb/node-api": "^2.0.0-r.1",
234
234
  "@gui-chat-plugin/common": "^0.1.0",
235
235
  "@mulmoclaude/common": "^1.6.0",
236
236
  "@mulmoclaude/markdown-utils": "^3.0.2",
237
- "dompurify": "^3.4.17",
238
- "fast-xml-parser": "^5.11.2",
239
- "google-auth-library": "^11.3.1",
237
+ "dompurify": "^3.4.18",
238
+ "fast-xml-parser": "^5.12.1",
239
+ "google-auth-library": "^11.3.4",
240
240
  "iconv-lite": "^0.7.3",
241
241
  "js-yaml": "^5.5.0",
242
242
  "zod": "^4.6.7"
243
243
  },
244
244
  "peerDependencies": {
245
245
  "@receptron/task-scheduler": "^1.0.3",
246
- "firebase": "^12.0.0",
246
+ "firebase": "^13.0.0",
247
247
  "gui-chat-protocol": "^2.3.0",
248
248
  "vue": "^3.5.0",
249
249
  "vue-i18n": "^11.4.4"
@@ -265,10 +265,10 @@
265
265
  "gui-chat-protocol": "^2.3.0",
266
266
  "tsx": "^4.23.15",
267
267
  "typescript": "^6.0.3",
268
- "vite": "^8.3.5",
268
+ "vite": "^8.3.7",
269
269
  "vite-plugin-dts": "^5.1.2",
270
- "vue": "^3.5.43",
271
- "vue-i18n": "^11.4.17"
270
+ "vue": "^3.5.45",
271
+ "vue-i18n": "^11.4.18"
272
272
  },
273
273
  "license": "MIT",
274
274
  "keywords": [