@hiai-gg/docsmint 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +26 -23
  2. package/{packages/sdk/dist → dist}/client.d.ts +16 -1
  3. package/{packages/sdk/dist → dist}/client.js +25 -1
  4. package/dist/frontend/DatePicker-BcMD49PV.js +275 -0
  5. package/dist/frontend/SettingsDialog-DiAyhzw0.js +4852 -0
  6. package/dist/frontend/ShareDialog-DaZf1raY.js +1317 -0
  7. package/dist/frontend/api/categories.d.ts +10 -0
  8. package/dist/frontend/api/categories.js +2 -0
  9. package/dist/frontend/api/documents.d.ts +10 -0
  10. package/dist/frontend/api/documents.js +2 -0
  11. package/dist/frontend/api/folders.d.ts +10 -0
  12. package/dist/frontend/api/folders.js +2 -0
  13. package/dist/frontend/api/settings.d.ts +8 -0
  14. package/dist/frontend/api/settings.js +2 -0
  15. package/dist/frontend/api/tags.d.ts +11 -0
  16. package/dist/frontend/api/tags.js +2 -0
  17. package/dist/frontend/categories-BE6ZpZl8.js +61 -0
  18. package/dist/frontend/client-B9hzI0W8.js +76 -0
  19. package/dist/frontend/client-C6QQGb0e.js +2766 -0
  20. package/dist/frontend/components/settings.d.ts +2 -0
  21. package/dist/frontend/components/settings.js +2 -0
  22. package/dist/frontend/components/sidebar.d.ts +2 -0
  23. package/dist/frontend/components/sidebar.js +4569 -0
  24. package/dist/frontend/context-DbnW5yib.js +31 -0
  25. package/dist/frontend/dashboard.d.ts +2 -0
  26. package/dist/frontend/dashboard.js +2152 -0
  27. package/dist/frontend/documents-DFVS9SsL.js +83 -0
  28. package/dist/frontend/extension.d.ts +2 -0
  29. package/dist/frontend/extension.js +10 -0
  30. package/dist/frontend/folders-CGe9diAG.js +91 -0
  31. package/dist/frontend/frontend.css +2 -0
  32. package/dist/frontend/i18n.d.ts +5 -0
  33. package/dist/frontend/i18n.js +8 -0
  34. package/dist/frontend/input-ieWIt8I7.js +257 -0
  35. package/dist/frontend/messages-CTGAsqFu.js +1106 -0
  36. package/dist/frontend/resolve-Bl6xmJl_.js +2068 -0
  37. package/dist/frontend/schemas-DwtKylCJ.js +3002 -0
  38. package/dist/frontend/search.d.ts +2 -0
  39. package/dist/frontend/search.js +1001 -0
  40. package/dist/frontend/settings-PCrOtied.js +1313 -0
  41. package/dist/frontend/shared-document.d.ts +3 -0
  42. package/dist/frontend/shared-document.js +193 -0
  43. package/dist/frontend/tag-C5xrg-bb.js +53 -0
  44. package/dist/frontend/tag-store.svelte-B3839FYq.js +6152 -0
  45. package/dist/frontend/tags-DVXTut0p.js +48 -0
  46. package/dist/frontend/theme.d.ts +4 -0
  47. package/dist/frontend/theme.js +8 -0
  48. package/dist/frontend/theme.svelte-ei0QxXa8.js +49 -0
  49. package/dist/index.d.ts +7 -0
  50. package/dist/index.js +3 -0
  51. package/dist/lifecycle.d.ts +90 -0
  52. package/dist/lifecycle.js +99 -0
  53. package/{packages/sdk/dist → dist}/types.d.ts +5 -0
  54. package/dist/workspace.d.ts +21 -0
  55. package/dist/workspace.js +66 -0
  56. package/package.json +70 -36
  57. package/packages/cli/src/index.ts +1 -1
  58. package/packages/db/src/schema.ts +41 -0
  59. package/packages/mcp-server/src/index.ts +1 -1
  60. package/frontend/src/lib/components/editor/shared-document.ts +0 -237
  61. package/frontend/src/lib/extensions/context.ts +0 -60
  62. package/frontend/src/lib/extensions/doc-tabs.ts +0 -18
  63. package/frontend/src/lib/extensions/resolve.ts +0 -48
  64. package/frontend/src/lib/extensions/types.ts +0 -202
  65. package/frontend/src/lib/hosts/DocsmintSharedDocumentHost.svelte +0 -65
  66. package/frontend/src/lib/hosts/HiaiDocsDashboardHost.svelte +0 -1007
  67. package/frontend/src/lib/hosts/HiaiDocsExtensionProvider.svelte +0 -20
  68. package/frontend/src/lib/hosts/HiaiDocsSearchHost.svelte +0 -996
  69. package/frontend/src/lib/hosts/index.ts +0 -25
  70. package/frontend/src/lib/index.ts +0 -65
  71. package/frontend/src/lib/stores/doc-tab-registry.svelte.ts +0 -68
  72. package/packages/sdk/dist/index.d.ts +0 -3
  73. package/packages/sdk/dist/index.js +0 -1
  74. /package/{packages/sdk/dist → dist}/types.js +0 -0
@@ -0,0 +1,10 @@
1
+
2
+ export type CategoryDto = Readonly<Record<string, unknown>>;
3
+ export declare const createCategoryInputSchema: unknown;
4
+ export declare const updateCategoryInputSchema: unknown;
5
+ export declare function listCategories(...args: readonly unknown[]): Promise<readonly CategoryDto[]>;
6
+ export declare function createCategory(...args: readonly unknown[]): Promise<CategoryDto>;
7
+ export declare function updateCategory(...args: readonly unknown[]): Promise<CategoryDto>;
8
+ export declare function deleteCategory(...args: readonly unknown[]): Promise<unknown>;
9
+ export declare function setDocumentCategory(...args: readonly unknown[]): Promise<unknown>;
10
+ export declare function setFolderCategory(...args: readonly unknown[]): Promise<unknown>;
@@ -0,0 +1,2 @@
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../categories-BE6ZpZl8.js";
2
+ export { s as createCategory, r as createCategoryInputSchema, a as deleteCategory, n as listCategories, e as setDocumentCategory, i as setFolderCategory, o as updateCategory, t as updateCategoryInputSchema };
@@ -0,0 +1,10 @@
1
+
2
+ export type DocumentDto = Readonly<Record<string, unknown>>;
3
+ export declare function listDocuments(...args: readonly unknown[]): Promise<readonly DocumentDto[]>;
4
+ export declare function getDocument(...args: readonly unknown[]): Promise<DocumentDto>;
5
+ export declare function createDocument(...args: readonly unknown[]): Promise<DocumentDto>;
6
+ export declare function updateDocument(...args: readonly unknown[]): Promise<DocumentDto>;
7
+ export declare function deleteDocument(...args: readonly unknown[]): Promise<unknown>;
8
+ export declare function importDocument(...args: readonly unknown[]): Promise<DocumentDto>;
9
+ export declare function importDocuments(...args: readonly unknown[]): Promise<readonly DocumentDto[]>;
10
+ export declare function clearDocumentsCache(...args: readonly unknown[]): void;
@@ -0,0 +1,2 @@
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../documents-DFVS9SsL.js";
2
+ export { s as clearDocumentsCache, r as createDocument, a as deleteDocument, n as getDocument, e as importDocument, i as importDocuments, o as listDocuments, t as updateDocument };
@@ -0,0 +1,10 @@
1
+
2
+ export type FolderDto = Readonly<Record<string, unknown>>;
3
+ export declare function listFolders(...args: readonly unknown[]): Promise<readonly FolderDto[]>;
4
+ export declare function getFolder(...args: readonly unknown[]): Promise<FolderDto>;
5
+ export declare function getFolderPath(...args: readonly unknown[]): Promise<readonly FolderDto[]>;
6
+ export declare function createFolder(...args: readonly unknown[]): Promise<FolderDto>;
7
+ export declare function updateFolder(...args: readonly unknown[]): Promise<FolderDto>;
8
+ export declare function deleteFolder(...args: readonly unknown[]): Promise<unknown>;
9
+ export declare function duplicateDocument(...args: readonly unknown[]): Promise<unknown>;
10
+ export declare function deleteDocument(...args: readonly unknown[]): Promise<unknown>;
@@ -0,0 +1,2 @@
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../folders-CGe9diAG.js";
2
+ export { s as createFolder, r as deleteDocument, a as deleteFolder, n as duplicateDocument, e as getFolder, i as getFolderPath, o as listFolders, t as updateFolder };
@@ -0,0 +1,8 @@
1
+
2
+ export type ProfileDto = Readonly<Record<string, unknown>>;
3
+ export type EmbeddingConfigDto = Readonly<Record<string, unknown>>;
4
+ export declare function getProfile(...args: readonly unknown[]): Promise<ProfileDto>;
5
+ export declare function updateProfile(...args: readonly unknown[]): Promise<ProfileDto>;
6
+ export declare function getEmbeddingConfig(...args: readonly unknown[]): Promise<EmbeddingConfigDto>;
7
+ export declare function updateEmbeddingConfig(...args: readonly unknown[]): Promise<EmbeddingConfigDto>;
8
+ export declare function deleteAccount(...args: readonly unknown[]): Promise<unknown>;
@@ -0,0 +1,2 @@
1
+ import { a as e, i as t, n, r, t as i } from "../settings-PCrOtied.js";
2
+ export { i as deleteAccount, n as getEmbeddingConfig, r as getProfile, t as updateEmbeddingConfig, e as updateProfile };
@@ -0,0 +1,11 @@
1
+
2
+ export type TagDto = Readonly<Record<string, unknown>>;
3
+ export declare const createTagInputSchema: unknown;
4
+ export declare const updateTagInputSchema: unknown;
5
+ export declare function listTags(...args: readonly unknown[]): Promise<readonly TagDto[]>;
6
+ export declare function getTag(...args: readonly unknown[]): Promise<TagDto>;
7
+ export declare function createTag(...args: readonly unknown[]): Promise<TagDto>;
8
+ export declare function updateTag(...args: readonly unknown[]): Promise<TagDto>;
9
+ export declare function deleteTag(...args: readonly unknown[]): Promise<unknown>;
10
+ export declare function addTagToDocument(...args: readonly unknown[]): Promise<unknown>;
11
+ export declare function removeTagFromDocument(...args: readonly unknown[]): Promise<unknown>;
@@ -0,0 +1,2 @@
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../tags-DVXTut0p.js";
2
+ export { c as addTagToDocument, i as createTag, o as createTagInputSchema, n as deleteTag, e as getTag, a as listTags, s as removeTagFromDocument, t as updateTag, r as updateTagInputSchema };
@@ -0,0 +1,61 @@
1
+ import { t as e } from "./client-B9hzI0W8.js";
2
+ import { a as t, i as n, n as r, r as i, t as a } from "./schemas-DwtKylCJ.js";
3
+ //#region src/lib/api/categories.ts
4
+ var o = n({
5
+ name: t().trim().min(1, "Name is required").max(255, "Name must be 255 characters or less"),
6
+ apiMode: a([
7
+ "unavailable",
8
+ "global",
9
+ "general",
10
+ "category"
11
+ ]).optional(),
12
+ apiPermissionRead: r().optional(),
13
+ apiPermissionEdit: r().optional(),
14
+ apiPermissionWrite: r().optional()
15
+ }), s = n({
16
+ name: t().trim().min(1, "Name is required").max(255, "Name must be 255 characters or less").optional(),
17
+ order: i().int().nonnegative().optional(),
18
+ apiMode: a([
19
+ "unavailable",
20
+ "global",
21
+ "general",
22
+ "category"
23
+ ]).optional(),
24
+ apiPermissionRead: r().optional(),
25
+ apiPermissionEdit: r().optional(),
26
+ apiPermissionWrite: r().optional()
27
+ });
28
+ function c(t) {
29
+ return e("/api/categories", {}, t);
30
+ }
31
+ function l(t) {
32
+ let n = o.parse(typeof t == "string" ? { name: t } : t);
33
+ return e("/api/categories", {
34
+ method: "POST",
35
+ body: JSON.stringify(n)
36
+ });
37
+ }
38
+ function u(t, n) {
39
+ let r = s.parse(n);
40
+ return e(`/api/categories/${encodeURIComponent(t)}`, {
41
+ method: "PATCH",
42
+ body: JSON.stringify(r)
43
+ });
44
+ }
45
+ function d(t) {
46
+ return e(`/api/categories/${encodeURIComponent(t)}`, { method: "DELETE" });
47
+ }
48
+ function f(t, n) {
49
+ return e(`/api/documents/${encodeURIComponent(t)}`, {
50
+ method: "PATCH",
51
+ body: JSON.stringify({ categoryId: n })
52
+ });
53
+ }
54
+ function p(t, n) {
55
+ return e(`/api/folders/${encodeURIComponent(t)}`, {
56
+ method: "PATCH",
57
+ body: JSON.stringify({ categoryId: n })
58
+ });
59
+ }
60
+ //#endregion
61
+ export { f as a, s as c, c as i, o as n, p as o, d as r, u as s, l as t };
@@ -0,0 +1,76 @@
1
+ //#region src/lib/api/client.ts
2
+ var e = class extends Error {
3
+ status;
4
+ constructor(e, t) {
5
+ super(e), this.name = "ApiError", this.status = t;
6
+ }
7
+ }, t = class extends Error {
8
+ timeoutMs;
9
+ constructor(e) {
10
+ super(`Request timed out after ${e}ms`), this.timeoutMs = e, this.name = "ApiTimeoutError";
11
+ }
12
+ }, n = class extends Error {
13
+ constructor(e) {
14
+ super(typeof e == "string" ? e : "Request aborted"), this.name = "ApiAbortError";
15
+ }
16
+ }, r = 0, i = [500, 1e3];
17
+ function a(e, t) {
18
+ return new Promise((n, r) => {
19
+ let i = setTimeout(n, e);
20
+ t.signal.addEventListener("abort", () => {
21
+ clearTimeout(i), r(new DOMException("Aborted during retry backoff", "AbortError"));
22
+ }, { once: !0 });
23
+ });
24
+ }
25
+ function o(e) {
26
+ if (!e) return null;
27
+ let t = e.trim();
28
+ if (t.length === 0) return null;
29
+ let n = Number(t);
30
+ return !Number.isFinite(n) || n < 0 ? null : n * 1e3;
31
+ }
32
+ async function s(s, l = {}, u = fetch) {
33
+ let { timeout: d = 1e4, body: f, maxRetries: p = r, ...m } = l, h = new AbortController(), g = !1, _ = setTimeout(() => {
34
+ g = !0, h.abort();
35
+ }, d), v = m.signal ?? null, y = () => h.abort();
36
+ v && (v.aborted ? h.abort() : v.addEventListener("abort", y, { once: !0 }));
37
+ let b = {}, x = typeof f == "object" && !!f && !(f instanceof FormData) && !(f instanceof Blob) && !(f instanceof ArrayBuffer) && !(f instanceof ReadableStream) && !(f instanceof URLSearchParams) && !ArrayBuffer.isView(f), S = f == null ? f : x ? JSON.stringify(f) : f;
38
+ f && !(f instanceof FormData) && (b["Content-Type"] = "application/json");
39
+ try {
40
+ let t = async () => {
41
+ let t = await u(s, {
42
+ ...m,
43
+ body: S,
44
+ signal: h.signal,
45
+ headers: {
46
+ ...b,
47
+ ...m.headers
48
+ },
49
+ credentials: "include"
50
+ });
51
+ if (t.status === 429) throw new c(t.headers.get("Retry-After"));
52
+ if (!t.ok) throw new e((await t.json().catch(() => ({ error: t.statusText }))).error ?? `HTTP ${t.status}`, t.status);
53
+ return t.json();
54
+ };
55
+ for (let e = 0; e <= p; e++) try {
56
+ return await t();
57
+ } catch (t) {
58
+ if (!(t instanceof c) || e === p) throw t;
59
+ let n = o(t.retryAfter), r = i[e] ?? i[i.length - 1];
60
+ await a(Math.min(n ?? r, 1e4), h);
61
+ }
62
+ throw Error("apiFetch: exhausted retries without resolving");
63
+ } catch (r) {
64
+ throw r instanceof DOMException && r.name === "AbortError" ? g ? new t(d) : new n(r.message) : r instanceof c ? new e("Too Many Requests", 429) : r;
65
+ } finally {
66
+ clearTimeout(_), v && v.removeEventListener("abort", y);
67
+ }
68
+ }
69
+ var c = class extends Error {
70
+ retryAfter;
71
+ constructor(e) {
72
+ super("Retry after 429"), this.retryAfter = e, this.name = "Retry429Error";
73
+ }
74
+ };
75
+ //#endregion
76
+ export { s as t };