@hiai-gg/docsmint 0.3.7 → 0.3.8

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 (196) hide show
  1. package/backend/src/lib/logger.ts +45 -15
  2. package/dist/backend/index.js +238 -150
  3. package/dist/frontend/CategoryDialog-DphkZqIB.js +611 -0
  4. package/dist/frontend/ConfirmDialog-BLF3x_hr.js +214 -0
  5. package/dist/frontend/CreateSnapshotDialog-D5vPvFTL.js +216 -0
  6. package/dist/frontend/DatePicker-CLNTdvTk.js +259 -0
  7. package/dist/frontend/DeleteDialog-DxYFJivN.js +174 -0
  8. package/dist/frontend/FolderDialog-CRVZM2Oi.js +250 -0
  9. package/dist/frontend/FolderNode-C2zG7uii.js +298 -0
  10. package/dist/frontend/FolderTreeSelector-CyB8y2Sm.js +103 -0
  11. package/dist/frontend/Icon-CooFj4Ee.js +64 -0
  12. package/dist/frontend/SettingsDialog-DCM4-N6_.js +1016 -0
  13. package/dist/frontend/ShareDialog-DYu3RKQu.js +165 -0
  14. package/dist/frontend/TagCreateDialog-DXQs2bL9.js +260 -0
  15. package/dist/frontend/camera-iKXDOOWT.js +29 -0
  16. package/dist/frontend/check-D-UuvBuh.js +25 -0
  17. package/dist/frontend/chevron-down-CiPtYyFh.js +25 -0
  18. package/dist/frontend/circle-check-tSPE1V6t.js +29 -0
  19. package/dist/frontend/clock-DJHbHZb8.js +29 -0
  20. package/dist/frontend/{bundle-mjs-CP6Owz-8.js → clsx-C7bIvsDS.js} +16 -1
  21. package/dist/frontend/components/category-dialog.js +1 -1
  22. package/dist/frontend/components/create-snapshot-dialog.js +1 -1
  23. package/dist/frontend/components/delete-dialog.js +1 -1
  24. package/dist/frontend/components/editor/document-editor.js +1364 -1353
  25. package/dist/frontend/components/editor/document-title.js +25 -25
  26. package/dist/frontend/components/editor/markdown-toggle.js +45 -45
  27. package/dist/frontend/components/folder-node.js +1 -1
  28. package/dist/frontend/components/folder-tree-selector.js +1 -1
  29. package/dist/frontend/components/save-as-dialog.js +169 -151
  30. package/dist/frontend/components/settings.js +1 -1
  31. package/dist/frontend/components/share-dialog.js +1 -1
  32. package/dist/frontend/components/sidebar.js +1161 -1153
  33. package/dist/frontend/components/tag-create-dialog.js +1 -1
  34. package/dist/frontend/components/version-history.js +188 -187
  35. package/dist/frontend/copy-GppwRMjX.js +32 -0
  36. package/dist/frontend/dashboard.js +1188 -1156
  37. package/dist/frontend/dialog-D6NxYVmy.js +213 -0
  38. package/dist/frontend/doc-tabs.js +2 -2
  39. package/dist/frontend/ellipsis-vertical-P9MHvCps.js +530 -0
  40. package/dist/frontend/extension.js +8 -8
  41. package/dist/frontend/{floating-layer-anchor-C51M4l6v.js → floating-layer-anchor-CPwucTfd.js} +1414 -1412
  42. package/dist/frontend/folder-DeWhnD7O.js +45 -0
  43. package/dist/frontend/folder-refresh.js +1 -1
  44. package/dist/frontend/input-B5Rak-5G.js +23 -0
  45. package/dist/frontend/keyboard.js +1 -1
  46. package/dist/frontend/{keyboard.svelte-D7H8DihC.js → keyboard.svelte-CApmX0vl.js} +53 -53
  47. package/dist/frontend/label-CW9rxoAb.js +30 -0
  48. package/dist/frontend/{loader-circle-Bk-WFz9g.js → loader-circle-BA6aLO71.js} +86 -85
  49. package/dist/frontend/rotate-ccw-B4Q7brmV.js +25 -0
  50. package/dist/frontend/search.js +680 -654
  51. package/dist/frontend/select-value-sF86Geyh.js +1446 -0
  52. package/dist/frontend/shared-document.js +94 -94
  53. package/dist/frontend/subfolders-refresh-store.svelte-B2dKVmgz.js +65 -0
  54. package/dist/frontend/tag-HxRazVN_.js +54 -0
  55. package/dist/frontend/tag-store.svelte-CqrUXo0o.js +29 -0
  56. package/dist/frontend/textarea-i1720bE7.js +23 -0
  57. package/dist/frontend/theme.js +1 -1
  58. package/dist/frontend/theme.svelte-DKfCy12k.js +49 -0
  59. package/dist/frontend/{utils-C0OW2678.js → utils-CffiyuTo.js} +2 -3
  60. package/dist/frontend/{utils-D8kmM3ub.js → utils-hzdMVeCv.js} +2 -3
  61. package/dist/frontend/utils.js +1 -1
  62. package/dist/frontend/x-CzBsnJ2x.js +25 -0
  63. package/dist/frontend-ssr/api/attachments.js +2 -0
  64. package/dist/frontend-ssr/api/categories.js +2 -0
  65. package/dist/frontend-ssr/api/documents.js +2 -0
  66. package/dist/frontend-ssr/api/folders.js +2 -0
  67. package/dist/frontend-ssr/api/settings.js +2 -0
  68. package/dist/frontend-ssr/api/share.js +2 -0
  69. package/dist/frontend-ssr/api/tags.js +2 -0
  70. package/dist/frontend-ssr/assets/CategoryDialog-C2xaZKHq.js +584 -0
  71. package/dist/frontend-ssr/assets/ConfirmDialog-DjMFKc0V.js +420 -0
  72. package/dist/frontend-ssr/assets/CreateSnapshotDialog-BRw1xJW1.js +214 -0
  73. package/dist/frontend-ssr/assets/DatePicker-DnXniwlZ.js +312 -0
  74. package/dist/frontend-ssr/assets/DeleteDialog-BCfZy3Zn.js +154 -0
  75. package/dist/frontend-ssr/assets/FolderDialog-Dq7I2cKZ.js +429 -0
  76. package/dist/frontend-ssr/assets/FolderNode-DRfBfpft.js +171 -0
  77. package/dist/frontend-ssr/assets/FolderTreeSelector-DZNZ2oI6.js +147 -0
  78. package/dist/frontend-ssr/assets/Icon-B0Zqppjo.js +231 -0
  79. package/dist/frontend-ssr/assets/SettingsDialog-CX8Noa8A.js +1107 -0
  80. package/dist/frontend-ssr/assets/ShareDialog-Cge49ZdJ.js +54 -0
  81. package/dist/frontend-ssr/assets/TagCreateDialog-EAChgBF-.js +264 -0
  82. package/dist/frontend-ssr/assets/api-keys-DFqX39MT.js +35 -0
  83. package/dist/frontend-ssr/assets/attachments-CWBxE3Vz.js +85 -0
  84. package/dist/frontend-ssr/assets/auth-client-x26kqY8Z.js +1286 -0
  85. package/dist/frontend-ssr/assets/camera-CdxscTw-.js +84 -0
  86. package/dist/frontend-ssr/assets/categories-AOqgcsn4.js +75 -0
  87. package/dist/frontend-ssr/assets/chevron-down-CSSNGNh_.js +80 -0
  88. package/dist/frontend-ssr/assets/chevron-right-B4p7Sk6X.js +80 -0
  89. package/dist/frontend-ssr/assets/circle-check-CI1v4vYh.js +84 -0
  90. package/dist/frontend-ssr/assets/client-DZMkDkDn.js +129 -0
  91. package/dist/frontend-ssr/assets/clipboard-CXOaoz2W.js +30 -0
  92. package/dist/frontend-ssr/assets/clock-IL-eX2di.js +84 -0
  93. package/dist/frontend-ssr/assets/context-jz1GGEUi.js +45 -0
  94. package/dist/frontend-ssr/assets/copy-CjV57nGQ.js +87 -0
  95. package/dist/frontend-ssr/assets/db-CnxeO66n.js +65 -0
  96. package/dist/frontend-ssr/assets/dialog-BOV1u6zP.js +157 -0
  97. package/dist/frontend-ssr/assets/dndzone-DMvTO_Jz.js +2114 -0
  98. package/dist/frontend-ssr/assets/document-drop-coordinator-CEaYACsC.js +109 -0
  99. package/dist/frontend-ssr/assets/documents-BnOTRdTY.js +108 -0
  100. package/dist/frontend-ssr/assets/editorExtensions-DUzwndMy.js +186 -0
  101. package/dist/frontend-ssr/assets/ellipsis-vertical-C-0hgkZn.js +555 -0
  102. package/dist/frontend-ssr/assets/floating-layer-anchor-uzw9K8qN.js +6114 -0
  103. package/dist/frontend-ssr/assets/folder-DChhG7qN.js +80 -0
  104. package/dist/frontend-ssr/assets/folders-CTfbS24J.js +127 -0
  105. package/dist/frontend-ssr/assets/identity-B3uHoDtf.js +99 -0
  106. package/dist/frontend-ssr/assets/input-DezGsU3y.js +19 -0
  107. package/dist/frontend-ssr/assets/keyboard.svelte-BgF47N3L.js +174 -0
  108. package/dist/frontend-ssr/assets/label-Bj8-TfFN.js +21 -0
  109. package/dist/frontend-ssr/assets/loader-circle-DZsrZ-er.js +80 -0
  110. package/dist/frontend-ssr/assets/markdown-CjqvGi5W.js +20 -0
  111. package/dist/frontend-ssr/assets/messages-DhXqlcJI.js +11125 -0
  112. package/dist/frontend-ssr/assets/resolve-BqHozBXl.js +32 -0
  113. package/dist/frontend-ssr/assets/rotate-ccw-BlgWwaiq.js +80 -0
  114. package/dist/frontend-ssr/assets/select-value-DngdSmLI.js +1526 -0
  115. package/dist/frontend-ssr/assets/settings-E6qSAWM2.js +64 -0
  116. package/dist/frontend-ssr/assets/share-BTBJelxA.js +30 -0
  117. package/dist/frontend-ssr/assets/subfolders-refresh-store.svelte-DAh4gT16.js +77 -0
  118. package/dist/frontend-ssr/assets/tag-GZEuGWk1.js +166 -0
  119. package/dist/frontend-ssr/assets/tag-store.svelte-DPodKj6Z.js +21 -0
  120. package/dist/frontend-ssr/assets/tags-BId2wdYd.js +49 -0
  121. package/dist/frontend-ssr/assets/textarea-Dev-qSEc.js +21 -0
  122. package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +67 -0
  123. package/dist/frontend-ssr/assets/utils-DtlPPXpJ.js +9 -0
  124. package/dist/frontend-ssr/assets/utils-DvZnctjz.js +23 -0
  125. package/dist/frontend-ssr/collaboration.js +39 -0
  126. package/dist/frontend-ssr/components/category-dialog.js +2 -0
  127. package/dist/frontend-ssr/components/create-snapshot-dialog.js +2 -0
  128. package/dist/frontend-ssr/components/delete-dialog.js +2 -0
  129. package/dist/frontend-ssr/components/editor/document-editor.js +2499 -0
  130. package/dist/frontend-ssr/components/editor/document-title.js +11 -0
  131. package/dist/frontend-ssr/components/editor/docx-serializer.js +186 -0
  132. package/dist/frontend-ssr/components/editor/extensions.js +2 -0
  133. package/dist/frontend-ssr/components/editor/markdown-toggle.js +20 -0
  134. package/dist/frontend-ssr/components/editor/markdown.js +2 -0
  135. package/dist/frontend-ssr/components/folder-node.js +2 -0
  136. package/dist/frontend-ssr/components/folder-tree-selector.js +2 -0
  137. package/dist/frontend-ssr/components/save-as-dialog.js +280 -0
  138. package/dist/frontend-ssr/components/settings.js +2 -0
  139. package/dist/frontend-ssr/components/share-dialog.js +2 -0
  140. package/dist/frontend-ssr/components/sidebar.js +2033 -0
  141. package/dist/frontend-ssr/components/tag-create-dialog.js +2 -0
  142. package/dist/frontend-ssr/components/version-history.js +370 -0
  143. package/dist/frontend-ssr/dashboard.js +2542 -0
  144. package/dist/frontend-ssr/doc-tabs.js +23 -0
  145. package/dist/frontend-ssr/document-drop-coordinator.js +2 -0
  146. package/dist/frontend-ssr/extension.js +13 -0
  147. package/dist/frontend-ssr/folder-refresh.js +2 -0
  148. package/dist/frontend-ssr/i18n.js +10 -0
  149. package/dist/frontend-ssr/keyboard.js +2 -0
  150. package/dist/frontend-ssr/offline/identity.js +2 -0
  151. package/dist/frontend-ssr/search.js +332 -0
  152. package/dist/frontend-ssr/shared-document.js +273 -0
  153. package/dist/frontend-ssr/theme.js +9 -0
  154. package/dist/frontend-ssr/types.js +1 -0
  155. package/dist/frontend-ssr/utils/clipboard.js +2 -0
  156. package/dist/frontend-ssr/utils/dndzone.js +2 -0
  157. package/dist/frontend-ssr/utils.js +2 -0
  158. package/package.json +22 -1
  159. package/packages/cli/src/index.ts +1 -1
  160. package/packages/db/src/schema.ts +3 -0
  161. package/packages/mcp-server/src/index.ts +1 -1
  162. package/dist/frontend/CategoryDialog--rIE7FrH.js +0 -580
  163. package/dist/frontend/ConfirmDialog-Cpzyb55f.js +0 -212
  164. package/dist/frontend/CreateSnapshotDialog-CmkV-n2A.js +0 -216
  165. package/dist/frontend/DatePicker-Byynca7V.js +0 -257
  166. package/dist/frontend/DeleteDialog-ap6nOywZ.js +0 -174
  167. package/dist/frontend/FolderDialog-DmN_trV0.js +0 -247
  168. package/dist/frontend/FolderNode-C4B8a2fd.js +0 -317
  169. package/dist/frontend/FolderTreeSelector-D6ijiZTA.js +0 -100
  170. package/dist/frontend/Icon-DtNo0N1U.js +0 -64
  171. package/dist/frontend/SettingsDialog-2kTaTXAs.js +0 -992
  172. package/dist/frontend/ShareDialog-BBDGNF5n.js +0 -165
  173. package/dist/frontend/TagCreateDialog-DiLZnJo4.js +0 -258
  174. package/dist/frontend/camera-B7dAOd4s.js +0 -28
  175. package/dist/frontend/check-CDwRlG9T.js +0 -24
  176. package/dist/frontend/chevron-down-B7ZrjUmT.js +0 -24
  177. package/dist/frontend/circle-check-CDqeMB2d.js +0 -28
  178. package/dist/frontend/client-Bc5Fzx40.js +0 -2785
  179. package/dist/frontend/clock-Ck5Sn-Zl.js +0 -28
  180. package/dist/frontend/clsx-nmtDPO_P.js +0 -16
  181. package/dist/frontend/copy-CMAA6GP0.js +0 -31
  182. package/dist/frontend/dialog-BDkiG42a.js +0 -213
  183. package/dist/frontend/disclose-version-5I57E3LD.js +0 -3
  184. package/dist/frontend/ellipsis-vertical-BBuPldbW.js +0 -519
  185. package/dist/frontend/folder-TQjKY4yn.js +0 -44
  186. package/dist/frontend/index-client-jobkrWVL.js +0 -86
  187. package/dist/frontend/input-CBI6p4Xl.js +0 -23
  188. package/dist/frontend/label-C-GkhEp4.js +0 -30
  189. package/dist/frontend/rotate-ccw-CleZtJ5D.js +0 -24
  190. package/dist/frontend/select-value-CvrWRkXW.js +0 -1436
  191. package/dist/frontend/subfolders-refresh-store.svelte-BsheoQma.js +0 -65
  192. package/dist/frontend/tag-Dx3SmucJ.js +0 -53
  193. package/dist/frontend/tag-store.svelte-CIaF4sdZ.js +0 -29
  194. package/dist/frontend/textarea-Dfp78XlL.js +0 -23
  195. package/dist/frontend/theme.svelte-CROg1Hi5.js +0 -49
  196. package/dist/frontend/x-DaTdeDXv.js +0 -24
@@ -0,0 +1,64 @@
1
+ import { n as apiFetch } from "./client-DZMkDkDn.js";
2
+ import { t as authClient } from "./auth-client-x26kqY8Z.js";
3
+ //#region src/lib/api/settings.ts
4
+ async function getProfile() {
5
+ try {
6
+ const session = await apiFetch("/api/auth/get-session");
7
+ if (session.user?.name || session.user?.email) return session.user;
8
+ } catch {}
9
+ const { data } = await authClient.getSession();
10
+ if (data?.user) return {
11
+ id: data.user.id ?? "",
12
+ name: data.user.name ?? "User",
13
+ email: data.user.email ?? "",
14
+ avatar: null
15
+ };
16
+ return {
17
+ id: "",
18
+ name: "User",
19
+ email: "",
20
+ avatar: null
21
+ };
22
+ }
23
+ async function updateProfile(data) {
24
+ return apiFetch("/api/auth/update-user", {
25
+ method: "POST",
26
+ body: JSON.stringify({ name: data.name })
27
+ });
28
+ }
29
+ var EMBEDDING_KEY = "hiai-docs:embedding-config";
30
+ function getEmbeddingConfig() {
31
+ if (typeof window === "undefined") return {
32
+ baseUrl: "",
33
+ apiKey: "",
34
+ model: "",
35
+ fallbackBaseUrl: null,
36
+ fallbackApiKey: null,
37
+ fallbackModel: null
38
+ };
39
+ try {
40
+ const stored = localStorage.getItem(EMBEDDING_KEY);
41
+ if (stored) return JSON.parse(stored);
42
+ } catch {}
43
+ return {
44
+ baseUrl: "",
45
+ apiKey: "",
46
+ model: "",
47
+ fallbackBaseUrl: null,
48
+ fallbackApiKey: null,
49
+ fallbackModel: null
50
+ };
51
+ }
52
+ function updateEmbeddingConfig(data) {
53
+ const updated = {
54
+ ...getEmbeddingConfig(),
55
+ ...data
56
+ };
57
+ localStorage.setItem(EMBEDDING_KEY, JSON.stringify(updated));
58
+ return updated;
59
+ }
60
+ async function deleteAccount() {
61
+ await apiFetch("/api/auth/delete-user", { method: "POST" });
62
+ }
63
+ //#endregion
64
+ export { updateProfile as a, updateEmbeddingConfig as i, getEmbeddingConfig as n, getProfile as r, deleteAccount as t };
@@ -0,0 +1,30 @@
1
+ import { n as apiFetch } from "./client-DZMkDkDn.js";
2
+ //#region src/lib/api/share.ts
3
+ function createShareLink(data) {
4
+ if (!data.documentId && !data.folderId && !data.categoryId) return Promise.reject(/* @__PURE__ */ new Error("createShareLink: documentId, folderId, or categoryId is required"));
5
+ return apiFetch("/api/share", {
6
+ method: "POST",
7
+ body: JSON.stringify(data)
8
+ });
9
+ }
10
+ function listShareLinks(params) {
11
+ return apiFetch(`/api/share${params?.documentId ? `?documentId=${params.documentId}` : ""}`);
12
+ }
13
+ function getShareLink(token) {
14
+ if (!token) return Promise.reject(/* @__PURE__ */ new Error("getShareLink: token is required"));
15
+ return apiFetch(`/api/share/${token}`);
16
+ }
17
+ function revokeShareLink(id) {
18
+ return apiFetch(`/api/share/${id}`, { method: "DELETE" });
19
+ }
20
+ function addGuest(linkId, email) {
21
+ return apiFetch(`/api/share/${linkId}/guests`, {
22
+ method: "POST",
23
+ body: JSON.stringify({ email })
24
+ });
25
+ }
26
+ function removeGuest(linkId, email) {
27
+ return apiFetch(`/api/share/${linkId}/guests/${encodeURIComponent(email)}`, { method: "DELETE" });
28
+ }
29
+ //#endregion
30
+ export { removeGuest as a, listShareLinks as i, createShareLink as n, revokeShareLink as o, getShareLink as r, addGuest as t };
@@ -0,0 +1,77 @@
1
+ import "svelte/internal/server";
2
+ //#region src/lib/stores/subfolders-refresh-store.svelte.ts
3
+ var refreshNonces = {};
4
+ var foldersRegistry = {};
5
+ var documentsRegistry = {};
6
+ var documentPlacementNonce = 0;
7
+ var latestDocumentPlacement = null;
8
+ var pendingDocumentPlacements = {};
9
+ var globalFolderRefreshNonce = 0;
10
+ function refreshFolders() {
11
+ globalFolderRefreshNonce++;
12
+ }
13
+ function getGlobalFolderRefreshNonce() {
14
+ return globalFolderRefreshNonce;
15
+ }
16
+ function bumpSubfoldersRefresh(folderId) {
17
+ refreshNonces[folderId] = (refreshNonces[folderId] ?? 0) + 1;
18
+ }
19
+ function getSubfoldersRefresh(folderId) {
20
+ return refreshNonces[folderId] ?? 0;
21
+ }
22
+ function registerFolder(id, parentId, categoryId, order) {
23
+ foldersRegistry[id] = {
24
+ parentId,
25
+ categoryId,
26
+ order
27
+ };
28
+ }
29
+ function getFolderFromRegistry(id) {
30
+ return foldersRegistry[id];
31
+ }
32
+ function registerDocument(id, folderId, categoryId) {
33
+ documentsRegistry[id] = {
34
+ folderId,
35
+ categoryId
36
+ };
37
+ }
38
+ /**
39
+ * Publishes an optimistic document move to every mounted navigation surface.
40
+ * The nonce makes repeated moves of the same document observable to Svelte.
41
+ */
42
+ function publishDocumentPlacement(id, folderId, categoryId) {
43
+ registerDocument(id, folderId, categoryId);
44
+ const version = ++documentPlacementNonce;
45
+ latestDocumentPlacement = {
46
+ id,
47
+ folderId,
48
+ categoryId,
49
+ version
50
+ };
51
+ pendingDocumentPlacements[id] = {
52
+ folderId,
53
+ categoryId,
54
+ version
55
+ };
56
+ return version;
57
+ }
58
+ function acknowledgeDocumentPlacement(id, version) {
59
+ if (pendingDocumentPlacements[id]?.version === version) delete pendingDocumentPlacements[id];
60
+ }
61
+ function supersedePendingDocumentPlacement(id) {
62
+ delete pendingDocumentPlacements[id];
63
+ }
64
+ function getPendingDocumentPlacement(id) {
65
+ return pendingDocumentPlacements[id];
66
+ }
67
+ function getDocumentPlacementNonce() {
68
+ return documentPlacementNonce;
69
+ }
70
+ function getLatestDocumentPlacement() {
71
+ return latestDocumentPlacement;
72
+ }
73
+ function getDocumentFromRegistry(id) {
74
+ return documentsRegistry[id];
75
+ }
76
+ //#endregion
77
+ export { getFolderFromRegistry as a, getPendingDocumentPlacement as c, refreshFolders as d, registerDocument as f, getDocumentPlacementNonce as i, getSubfoldersRefresh as l, supersedePendingDocumentPlacement as m, bumpSubfoldersRefresh as n, getGlobalFolderRefreshNonce as o, registerFolder as p, getDocumentFromRegistry as r, getLatestDocumentPlacement as s, acknowledgeDocumentPlacement as t, publishDocumentPlacement as u };
@@ -0,0 +1,166 @@
1
+ import { t as Icon } from "./Icon-B0Zqppjo.js";
2
+ import * as $ from "svelte/internal/server";
3
+ //#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/search.svelte
4
+ function Search($$renderer, $$props) {
5
+ const $$sanitized_props = $.sanitize_props($$props);
6
+ /**
7
+ * @license lucide-svelte v1.0.1 - ISC
8
+ *
9
+ * ISC License
10
+ *
11
+ * Copyright (c) 2026 Lucide Icons and Contributors
12
+ *
13
+ * Permission to use, copy, modify, and/or distribute this software for any
14
+ * purpose with or without fee is hereby granted, provided that the above
15
+ * copyright notice and this permission notice appear in all copies.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
18
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
20
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
23
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
+ *
25
+ * ---
26
+ *
27
+ * The following Lucide icons are derived from the Feather project:
28
+ *
29
+ * airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
30
+ *
31
+ * The MIT License (MIT) (for the icons listed above)
32
+ *
33
+ * Copyright (c) 2013-present Cole Bemis
34
+ *
35
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ * of this software and associated documentation files (the "Software"), to deal
37
+ * in the Software without restriction, including without limitation the rights
38
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ * copies of the Software, and to permit persons to whom the Software is
40
+ * furnished to do so, subject to the following conditions:
41
+ *
42
+ * The above copyright notice and this permission notice shall be included in all
43
+ * copies or substantial portions of the Software.
44
+ *
45
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51
+ * SOFTWARE.
52
+ *
53
+ */
54
+ Icon($$renderer, $.spread_props([
55
+ { name: "search" },
56
+ $$sanitized_props,
57
+ {
58
+ /**
59
+ * @component @name Search
60
+ * @description Lucide SVG icon component, renders SVG Element with children.
61
+ *
62
+ * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEgMjEtNC4zNC00LjM0IiAvPgogIDxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/search
63
+ * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
64
+ *
65
+ * @param {Object} props - Lucide icons props and any valid SVG attribute
66
+ * @returns {FunctionalComponent} Svelte component
67
+ *
68
+ */
69
+ iconNode: [["path", { "d": "m21 21-4.34-4.34" }], ["circle", {
70
+ "cx": "11",
71
+ "cy": "11",
72
+ "r": "8"
73
+ }]],
74
+ children: ($$renderer) => {
75
+ $$renderer.push(`<!--[-->`);
76
+ $.slot($$renderer, $$props, "default", {}, null);
77
+ $$renderer.push(`<!--]-->`);
78
+ },
79
+ $$slots: { default: true }
80
+ }
81
+ ]));
82
+ }
83
+ //#endregion
84
+ //#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/tag.svelte
85
+ function Tag($$renderer, $$props) {
86
+ const $$sanitized_props = $.sanitize_props($$props);
87
+ /**
88
+ * @license lucide-svelte v1.0.1 - ISC
89
+ *
90
+ * ISC License
91
+ *
92
+ * Copyright (c) 2026 Lucide Icons and Contributors
93
+ *
94
+ * Permission to use, copy, modify, and/or distribute this software for any
95
+ * purpose with or without fee is hereby granted, provided that the above
96
+ * copyright notice and this permission notice appear in all copies.
97
+ *
98
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
99
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
100
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
101
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
102
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
103
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
104
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
105
+ *
106
+ * ---
107
+ *
108
+ * The following Lucide icons are derived from the Feather project:
109
+ *
110
+ * airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
111
+ *
112
+ * The MIT License (MIT) (for the icons listed above)
113
+ *
114
+ * Copyright (c) 2013-present Cole Bemis
115
+ *
116
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
117
+ * of this software and associated documentation files (the "Software"), to deal
118
+ * in the Software without restriction, including without limitation the rights
119
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
120
+ * copies of the Software, and to permit persons to whom the Software is
121
+ * furnished to do so, subject to the following conditions:
122
+ *
123
+ * The above copyright notice and this permission notice shall be included in all
124
+ * copies or substantial portions of the Software.
125
+ *
126
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
127
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
128
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
129
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
130
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
131
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
132
+ * SOFTWARE.
133
+ *
134
+ */
135
+ Icon($$renderer, $.spread_props([
136
+ { name: "tag" },
137
+ $$sanitized_props,
138
+ {
139
+ /**
140
+ * @component @name Tag
141
+ * @description Lucide SVG icon component, renders SVG Element with children.
142
+ *
143
+ * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuNTg2IDIuNTg2QTIgMiAwIDAgMCAxMS4xNzIgMkg0YTIgMiAwIDAgMC0yIDJ2Ny4xNzJhMiAyIDAgMCAwIC41ODYgMS40MTRsOC43MDQgOC43MDRhMi40MjYgMi40MjYgMCAwIDAgMy40MiAwbDYuNTgtNi41OGEyLjQyNiAyLjQyNiAwIDAgMCAwLTMuNDJ6IiAvPgogIDxjaXJjbGUgY3g9IjcuNSIgY3k9IjcuNSIgcj0iLjUiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/tag
144
+ * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
145
+ *
146
+ * @param {Object} props - Lucide icons props and any valid SVG attribute
147
+ * @returns {FunctionalComponent} Svelte component
148
+ *
149
+ */
150
+ iconNode: [["path", { "d": "M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z" }], ["circle", {
151
+ "cx": "7.5",
152
+ "cy": "7.5",
153
+ "r": ".5",
154
+ "fill": "currentColor"
155
+ }]],
156
+ children: ($$renderer) => {
157
+ $$renderer.push(`<!--[-->`);
158
+ $.slot($$renderer, $$props, "default", {}, null);
159
+ $$renderer.push(`<!--]-->`);
160
+ },
161
+ $$slots: { default: true }
162
+ }
163
+ ]));
164
+ }
165
+ //#endregion
166
+ export { Search as n, Tag as t };
@@ -0,0 +1,21 @@
1
+ import { t as clearDocumentsCache } from "./documents-BnOTRdTY.js";
2
+ import "svelte/internal/server";
3
+ //#region src/lib/stores/tag-store.svelte.ts
4
+ var tagRefreshNonce = 0;
5
+ function refreshTags() {
6
+ tagRefreshNonce++;
7
+ }
8
+ var docRefreshNonce = 0;
9
+ function refreshDocs() {
10
+ clearDocumentsCache();
11
+ docRefreshNonce++;
12
+ }
13
+ var selectedTagId = null;
14
+ function setSelectedTag(id, name = null) {
15
+ selectedTagId = id;
16
+ }
17
+ function getSelectedTag() {
18
+ return selectedTagId;
19
+ }
20
+ //#endregion
21
+ export { setSelectedTag as i, refreshDocs as n, refreshTags as r, getSelectedTag as t };
@@ -0,0 +1,49 @@
1
+ import { n as apiFetch } from "./client-DZMkDkDn.js";
2
+ import { z } from "zod";
3
+ //#region src/lib/api/tags.ts
4
+ var createTagInputSchema = z.object({
5
+ name: z.string().trim().min(1, "Name is required").max(50, "Name must be 50 characters or less"),
6
+ color: z.string().max(20, "Color must be 20 characters or less").optional()
7
+ });
8
+ var updateTagInputSchema = z.object({
9
+ name: z.string().trim().min(1, "Name is required").max(50, "Name must be 50 characters or less").optional(),
10
+ color: z.string().max(20, "Color must be 20 characters or less").optional()
11
+ });
12
+ async function listTags(fetcher) {
13
+ return apiFetch("/api/tags", {}, fetcher);
14
+ }
15
+ function getTag(id) {
16
+ return apiFetch(`/api/tags/${id}`);
17
+ }
18
+ function createTag(name, color) {
19
+ const input = createTagInputSchema.parse({
20
+ name,
21
+ color
22
+ });
23
+ return apiFetch("/api/tags", {
24
+ method: "POST",
25
+ body: JSON.stringify(input)
26
+ });
27
+ }
28
+ function updateTag(id, data) {
29
+ const input = updateTagInputSchema.parse(data);
30
+ return apiFetch(`/api/tags/${id}`, {
31
+ method: "PATCH",
32
+ body: JSON.stringify(input)
33
+ });
34
+ }
35
+ function deleteTag(id) {
36
+ return apiFetch(`/api/tags/${id}`, { method: "DELETE" });
37
+ }
38
+ function addTagToDocument(documentId, tagId) {
39
+ const input = z.object({ tagId: z.string().uuid() }).parse({ tagId });
40
+ return apiFetch(`/api/documents/${documentId}/tags`, {
41
+ method: "POST",
42
+ body: JSON.stringify(input)
43
+ });
44
+ }
45
+ function removeTagFromDocument(documentId, tagId) {
46
+ return apiFetch(`/api/documents/${documentId}/tags/${tagId}`, { method: "DELETE" });
47
+ }
48
+ //#endregion
49
+ export { getTag as a, updateTag as c, deleteTag as i, updateTagInputSchema as l, createTag as n, listTags as o, createTagInputSchema as r, removeTagFromDocument as s, addTagToDocument as t };
@@ -0,0 +1,21 @@
1
+ import { t as cn } from "./utils-DtlPPXpJ.js";
2
+ import * as $ from "svelte/internal/server";
3
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/textarea/textarea.svelte
4
+ function Textarea($$renderer, $$props) {
5
+ $$renderer.component(($$renderer) => {
6
+ let { ref = null, class: className, value = "", $$slots, $$events, ...restProps } = $$props;
7
+ $$renderer.push(`<textarea${$.attributes({
8
+ class: $.clsx(cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className)),
9
+ ...restProps
10
+ })}>`);
11
+ const $$body = $.escape(value);
12
+ if ($$body) $$renderer.push(`${$$body}`);
13
+ $$renderer.push(`</textarea>`);
14
+ $.bind_props($$props, {
15
+ ref,
16
+ value
17
+ });
18
+ });
19
+ }
20
+ //#endregion
21
+ export { Textarea as t };
@@ -0,0 +1,67 @@
1
+ import "svelte/internal/server";
2
+ import { browser } from "$app/environment";
3
+ //#region src/lib/stores/theme.svelte.ts
4
+ var STORAGE_KEY = "hiai-docs-theme";
5
+ var listeners = /* @__PURE__ */ new Set();
6
+ function readStored() {
7
+ if (!browser) return "system";
8
+ const value = localStorage.getItem(STORAGE_KEY);
9
+ if (value === "light" || value === "dark" || value === "system") return value;
10
+ return "system";
11
+ }
12
+ function systemPrefersDark() {
13
+ if (!browser) return false;
14
+ return window.matchMedia("(prefers-color-scheme: dark)").matches;
15
+ }
16
+ function resolveIsDark(theme) {
17
+ if (theme === "dark") return true;
18
+ if (theme === "light") return false;
19
+ return systemPrefersDark();
20
+ }
21
+ function applyTheme(theme) {
22
+ if (!browser) return;
23
+ const isDark = resolveIsDark(theme);
24
+ document.documentElement.classList.toggle("dark", isDark);
25
+ const favicon = document.querySelector("#app-favicon");
26
+ if (favicon) favicon.href = isDark ? "/favicon_white.ico" : "/favicon.ico";
27
+ }
28
+ function notify() {
29
+ for (const listener of listeners) listener();
30
+ }
31
+ var theme = "system";
32
+ var resolvedIsDark = false;
33
+ var initialized = false;
34
+ function initTheme() {
35
+ if (!browser || initialized) return;
36
+ initialized = true;
37
+ theme = readStored();
38
+ resolvedIsDark = resolveIsDark(theme);
39
+ applyTheme(theme);
40
+ const mql = window.matchMedia("(prefers-color-scheme: dark)");
41
+ const onSystemChange = () => {
42
+ if (theme !== "system") return;
43
+ resolvedIsDark = mql.matches;
44
+ applyTheme("system");
45
+ notify();
46
+ };
47
+ mql.addEventListener("change", onSystemChange);
48
+ }
49
+ function setTheme(value) {
50
+ theme = value;
51
+ if (browser) localStorage.setItem(STORAGE_KEY, value);
52
+ resolvedIsDark = resolveIsDark(value);
53
+ applyTheme(value);
54
+ notify();
55
+ }
56
+ var themeStore = {
57
+ get value() {
58
+ return theme;
59
+ },
60
+ get isDark() {
61
+ return resolvedIsDark;
62
+ },
63
+ init: initTheme,
64
+ set: setTheme
65
+ };
66
+ //#endregion
67
+ export { themeStore as t };
@@ -0,0 +1,9 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ //#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/lib/utils.js
4
+ /** Merge Tailwind class names, resolving conflicts (shadcn-svelte convention). */
5
+ function cn(...inputs) {
6
+ return twMerge(clsx(inputs));
7
+ }
8
+ //#endregion
9
+ export { cn as t };
@@ -0,0 +1,23 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ //#region src/lib/utils.ts
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+ /** Format an ISO timestamp as a human-readable relative time string. */
8
+ function formatRelativeTime(isoDate) {
9
+ const diffMs = Date.now() - new Date(isoDate).getTime();
10
+ const seconds = Math.floor(diffMs / 1e3);
11
+ if (seconds < 60) return "just now";
12
+ const minutes = Math.floor(seconds / 60);
13
+ if (minutes < 60) return `${minutes}m ago`;
14
+ const hours = Math.floor(minutes / 60);
15
+ if (hours < 24) return `${hours}h ago`;
16
+ const days = Math.floor(hours / 24);
17
+ if (days < 30) return `${days}d ago`;
18
+ const months = Math.floor(days / 30);
19
+ if (months < 12) return `${months}mo ago`;
20
+ return `${Math.floor(months / 12)}y ago`;
21
+ }
22
+ //#endregion
23
+ export { formatRelativeTime as n, cn as t };
@@ -0,0 +1,39 @@
1
+ import { WebsocketProvider } from "y-websocket";
2
+ import * as Y from "yjs";
3
+ //#region src/lib/collaboration.ts
4
+ var activeSession = null;
5
+ function startCollaboration(documentId, accessToken, onUpdate) {
6
+ stopCollaboration();
7
+ const doc = new Y.Doc();
8
+ const provider = new WebsocketProvider(`${window.location.protocol === "https:" ? "wss:" : "ws:"}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : ""}/api/ws/collab/${documentId}?token=${encodeURIComponent(accessToken)}`, documentId, doc, {
9
+ connect: true,
10
+ params: { token: accessToken }
11
+ });
12
+ provider.on("sync", (_synced) => {});
13
+ provider.on("status", (_status) => {});
14
+ provider.on("connection-close", () => {});
15
+ const updateHandler = onUpdate;
16
+ if (updateHandler) doc.on("update", updateHandler);
17
+ activeSession = {
18
+ provider,
19
+ doc,
20
+ destroy: () => {
21
+ if (updateHandler) doc.off("update", updateHandler);
22
+ provider.disconnect();
23
+ provider.destroy();
24
+ doc.destroy();
25
+ }
26
+ };
27
+ return activeSession;
28
+ }
29
+ function stopCollaboration() {
30
+ if (activeSession) {
31
+ activeSession.destroy();
32
+ activeSession = null;
33
+ }
34
+ }
35
+ function getActiveSession() {
36
+ return activeSession;
37
+ }
38
+ //#endregion
39
+ export { getActiveSession, startCollaboration, stopCollaboration };
@@ -0,0 +1,2 @@
1
+ import { t as CategoryDialog } from "../assets/CategoryDialog-C2xaZKHq.js";
2
+ export { CategoryDialog };
@@ -0,0 +1,2 @@
1
+ import { t as CreateSnapshotDialog } from "../assets/CreateSnapshotDialog-BRw1xJW1.js";
2
+ export { CreateSnapshotDialog };
@@ -0,0 +1,2 @@
1
+ import { t as DeleteDialog } from "../assets/DeleteDialog-BCfZy3Zn.js";
2
+ export { DeleteDialog };