@hiai-gg/docsmint 0.8.2 → 0.8.3

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 (36) hide show
  1. package/README.md +56 -57
  2. package/dist/backend/index.js +323 -231
  3. package/dist/client.js +7 -0
  4. package/dist/frontend/{HiAiEditor-BpmzvTCP.js → HiAiEditor-Dxqt8BUN.js} +2 -2
  5. package/dist/frontend/{SettingsDialog-2d6ZA4Ze.js → SettingsDialog-DnrPV8dM.js} +4 -4
  6. package/dist/frontend/{Sidebar-Db_ffhAb.js → Sidebar-BI_ccYTl.js} +1 -1
  7. package/dist/frontend/api/settings.js +1 -1
  8. package/dist/frontend/app-shell.js +2 -2
  9. package/dist/frontend/{auth-client-DCMne8vd.js → auth-client-Dc0mkuZH.js} +10 -10
  10. package/dist/frontend/components/editor/compact-editor.js +1 -1
  11. package/dist/frontend/components/editor/document-editor.js +1 -1
  12. package/dist/frontend/components/settings.js +1 -1
  13. package/dist/frontend/components/sidebar.js +1 -1
  14. package/dist/frontend/{db-CbFRFAm2.js → db-DUOtrCBC.js} +1 -1
  15. package/dist/frontend/{identity-O4lAuchv.js → identity-D_rjww-V.js} +1 -1
  16. package/dist/frontend/offline/identity.js +1 -1
  17. package/dist/frontend/{settings-DJW8JkdF.js → settings-CW_SR-EH.js} +1 -1
  18. package/dist/frontend-ssr/api/settings.js +1 -1
  19. package/dist/frontend-ssr/app-shell.js +2 -2
  20. package/dist/frontend-ssr/assets/{HiAiEditor-DCpulE6N.js → HiAiEditor-D-FYXUht.js} +2 -2
  21. package/dist/frontend-ssr/assets/{SettingsDialog-CpPxZahd.js → SettingsDialog-BaI2MU5d.js} +4 -4
  22. package/dist/frontend-ssr/assets/{Sidebar-BJ1XZ1DH.js → Sidebar-BpTS2uCa.js} +1 -1
  23. package/dist/frontend-ssr/assets/{auth-client-DzkZlSQ8.js → auth-client-Bo5Fg-sb.js} +13 -13
  24. package/dist/frontend-ssr/assets/{db-CUkQe9AU.js → db-DUKz2X3Z.js} +1 -1
  25. package/dist/frontend-ssr/assets/{identity-veXobEfE.js → identity-_M3U9lqe.js} +1 -1
  26. package/dist/frontend-ssr/assets/{settings-DwAcLGM1.js → settings-DaOQ4Gv2.js} +1 -1
  27. package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
  28. package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
  29. package/dist/frontend-ssr/components/settings.js +1 -1
  30. package/dist/frontend-ssr/components/sidebar.js +1 -1
  31. package/dist/frontend-ssr/offline/identity.js +1 -1
  32. package/dist/mcp-cli.js +4 -1
  33. package/dist/mcp-server.js +4 -1
  34. package/package.json +1 -1
  35. package/packages/cli/src/index.ts +1 -1
  36. package/server.json +2 -2
package/dist/client.js CHANGED
@@ -429,6 +429,13 @@ export class DocsClient {
429
429
  headers.set("X-Request-Id", requestContext.requestId);
430
430
  if (requestContext?.idempotencyKey)
431
431
  headers.set("Idempotency-Key", requestContext.idempotencyKey);
432
+ // Document creation supports replay on the server. Generate once before
433
+ // the retry loop so a lost response cannot create a second document.
434
+ if (method === "POST" &&
435
+ path === "/api/documents" &&
436
+ !headers.has("Idempotency-Key")) {
437
+ headers.set("Idempotency-Key", crypto.randomUUID());
438
+ }
432
439
  if (requestContext?.workspaceAssertion) {
433
440
  headers.set("X-Docsmint-Workspace-Context", requestContext.workspaceAssertion);
434
441
  }
@@ -14,8 +14,8 @@ import { t as je } from "./version_create_snapshot-3bu-0qzH.js";
14
14
  import { a as Me } from "./route-context-DYQlUfzL.js";
15
15
  import { a as Ne, n as Pe, o as Fe, r as Ie, s as Le, t as Re } from "./dialog-DC97Hnxo.js";
16
16
  import { t as ze } from "./input-CrlYAH2S.js";
17
- import { n as Be } from "./db-CbFRFAm2.js";
18
- import { a as Ve } from "./identity-O4lAuchv.js";
17
+ import { n as Be } from "./db-DUOtrCBC.js";
18
+ import { a as Ve } from "./identity-D_rjww-V.js";
19
19
  import { A as He, C as S, D as Ue, E as C, O as w, S as We, T as Ge, g as Ke, h as qe, j as Je, k as Ye, v as Xe, w as Ze, x as T } from "./lib-DYgslUw1.js";
20
20
  import { n as Qe, t as E } from "./dist-D7zL6zdU.js";
21
21
  import { h as $e, u as D } from "./keyboard.svelte-CApmX0vl.js";
@@ -8,14 +8,14 @@ import { t as D } from "./utils-B4LKx7VS.js";
8
8
  import { a as ne, i as re, n as ie, o as ae, r as oe, s as O, t as se } from "./dialog-DC97Hnxo.js";
9
9
  import { t as k } from "./input-CrlYAH2S.js";
10
10
  import { t as A } from "./label-B0syEfns.js";
11
- import { r as ce, t as le } from "./auth-client-DCMne8vd.js";
12
- import { a as ue, r as de } from "./settings-DJW8JkdF.js";
11
+ import { r as ce, t as le } from "./auth-client-Dc0mkuZH.js";
12
+ import { a as ue, r as de } from "./settings-CW_SR-EH.js";
13
13
  import { a as j, i as M, n as N, o as fe, s as P, t as F } from "./api-keys-DIwAdYkg.js";
14
14
  import { i as I } from "./categories-Bjcc41We.js";
15
15
  import { t as pe } from "./context-D0zPFXZ4.js";
16
16
  import { t as me } from "./resolve-BG4HgzpN.js";
17
- import { n as L, t as R } from "./db-CbFRFAm2.js";
18
- import { a as z, t as B } from "./identity-O4lAuchv.js";
17
+ import { n as L, t as R } from "./db-DUOtrCBC.js";
18
+ import { a as z, t as B } from "./identity-D_rjww-V.js";
19
19
  import { t as V } from "./editor-preferences.svelte-Bt_A9k7n.js";
20
20
  import { n as H, r as U, t as W } from "./search-preferences-B1GdbdUc.js";
21
21
  import { t as he } from "./theme.svelte-gLPpG6eU.js";
@@ -7,7 +7,7 @@ import { t as o } from "./copy-4H99lwAQ.js";
7
7
  import { t as s } from "./ellipsis-vertical-CObXWXZW.js";
8
8
  import { a as c, i as l, r as u, t as d } from "./share-context-DooXPYKd.js";
9
9
  import { t as f } from "./loader-circle-DnyUzAmN.js";
10
- import { t as p } from "./SettingsDialog-2d6ZA4Ze.js";
10
+ import { t as p } from "./SettingsDialog-DnrPV8dM.js";
11
11
  import { n as m, t as h } from "./tag-ChpMfbfa.js";
12
12
  import { t as g } from "./x-B2ifxSH7.js";
13
13
  import { t as _ } from "./action_cancel-Cuxsznzz.js";
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "../settings-DJW8JkdF.js";
1
+ import { a as e, i as t, n, r, t as i } from "../settings-CW_SR-EH.js";
2
2
  export { i as deleteAccount, n as getEmbeddingConfig, r as getProfile, t as updateEmbeddingConfig, e as updateProfile };
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./Icon-y7xxAIC6.js";
2
2
  import { n as t, t as n } from "./share-context-DooXPYKd.js";
3
- import { n as r } from "./SettingsDialog-2d6ZA4Ze.js";
4
- import { t as i } from "./Sidebar-Db_ffhAb.js";
3
+ import { n as r } from "./SettingsDialog-DnrPV8dM.js";
4
+ import { t as i } from "./Sidebar-BI_ccYTl.js";
5
5
  import { t as a } from "./scroll_to_top_aria-CvkNF_Hu.js";
6
6
  import { o, r as s } from "./route-context-DYQlUfzL.js";
7
7
  import { t as c } from "./editor-preferences.svelte-Bt_A9k7n.js";
@@ -1,4 +1,4 @@
1
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/broadcast-channel.mjs
1
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/broadcast-channel.mjs
2
2
  var e = Symbol.for("better-auth:broadcast-channel"), t = () => Math.floor(Date.now() / 1e3), n = class {
3
3
  listeners = /* @__PURE__ */ new Set();
4
4
  name;
@@ -132,7 +132,7 @@ var i = Symbol("clean"), a = [], o = 0, s = null, c = 4, l = globalThis.nanostor
132
132
  };
133
133
  });
134
134
  //#endregion
135
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/equality.mjs
135
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/equality.mjs
136
136
  function b(e) {
137
137
  if (typeof e != "object" || !e) return !1;
138
138
  let t = Object.getPrototypeOf(e);
@@ -159,7 +159,7 @@ function S(e, t) {
159
159
  });
160
160
  }
161
161
  //#endregion
162
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/focus-manager.mjs
162
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/focus-manager.mjs
163
163
  var C = Symbol.for("better-auth:focus-manager"), ee = class {
164
164
  listeners = /* @__PURE__ */ new Set();
165
165
  subscribe(e) {
@@ -184,7 +184,7 @@ function w() {
184
184
  return globalThis[C] || (globalThis[C] = new ee()), globalThis[C];
185
185
  }
186
186
  //#endregion
187
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/online-manager.mjs
187
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/online-manager.mjs
188
188
  var T = Symbol.for("better-auth:online-manager"), te = class {
189
189
  listeners = /* @__PURE__ */ new Set();
190
190
  isOnline = typeof navigator < "u" ? navigator.onLine : !0;
@@ -208,7 +208,7 @@ function E() {
208
208
  return globalThis[T] || (globalThis[T] = new te()), globalThis[T];
209
209
  }
210
210
  //#endregion
211
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/parser.mjs
211
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/parser.mjs
212
212
  var ne = {
213
213
  proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
214
214
  constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
@@ -270,7 +270,7 @@ function ce(e, t = { strict: !0 }) {
270
270
  return se(e, t);
271
271
  }
272
272
  //#endregion
273
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/session-refresh.mjs
273
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/session-refresh.mjs
274
274
  var O = () => Math.floor(Date.now() / 1e3), le = 5;
275
275
  function ue(e) {
276
276
  let { fetchSession: t, shouldPollSession: n = () => !0, sessionSignal: i, options: a = {} } = e, o = a.sessionOptions?.refetchInterval ?? 0, s = a.sessionOptions?.refetchOnWindowFocus ?? !0, c = a.sessionOptions?.refetchWhenOffline ?? !1, l = {
@@ -561,7 +561,7 @@ function xe(e) {
561
561
  return !be.includes(t.protocol);
562
562
  }
563
563
  //#endregion
564
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/fetch-plugins.mjs
564
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/fetch-plugins.mjs
565
565
  var Se = {
566
566
  id: "redirect",
567
567
  name: "Redirect",
@@ -1178,7 +1178,7 @@ var Z = async (e, t) => {
1178
1178
  };
1179
1179
  };
1180
1180
  //#endregion
1181
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/utils/is-atom.mjs
1181
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/utils/is-atom.mjs
1182
1182
  function it(e) {
1183
1183
  return typeof e == "object" && !!e && "get" in e && typeof e.get == "function" && "lc" in e && typeof e.lc == "number";
1184
1184
  }
@@ -1195,7 +1195,7 @@ function lt(e) {
1195
1195
  return ct(e).map((e) => e.toLowerCase()).join("-");
1196
1196
  }
1197
1197
  //#endregion
1198
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/proxy.mjs
1198
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/proxy.mjs
1199
1199
  function ut(e, t, n) {
1200
1200
  let r = t[e], { fetchOptions: i, query: a, ...o } = n || {};
1201
1201
  return r || (i?.method ? i.method : o && Object.keys(o).length > 0 ? "POST" : "GET");
@@ -1249,7 +1249,7 @@ function dt(e, t, n, r, i) {
1249
1249
  return a();
1250
1250
  }
1251
1251
  //#endregion
1252
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/vanilla.mjs
1252
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/vanilla.mjs
1253
1253
  function ft(e) {
1254
1254
  let { pluginPathMethods: t, pluginsActions: n, pluginsAtoms: r, hydrateSession: i, $fetch: a, atomListeners: o, $store: s } = rt(e), c = {};
1255
1255
  for (let [e, t] of Object.entries(r)) c[`use${at(e)}`] = t;
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../HiAiEditor-BpmzvTCP.js";
1
+ import { t as e } from "../../HiAiEditor-Dxqt8BUN.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region src/lib/components/editor/CompactEditor.svelte
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../HiAiEditor-BpmzvTCP.js";
1
+ import { t as e } from "../../HiAiEditor-Dxqt8BUN.js";
2
2
  export { e as DocsmintDocumentEditorHost };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../SettingsDialog-2d6ZA4Ze.js";
1
+ import { t as e } from "../SettingsDialog-DnrPV8dM.js";
2
2
  export { e as SettingsDialog };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../Sidebar-Db_ffhAb.js";
1
+ import { t as e } from "../Sidebar-BI_ccYTl.js";
2
2
  export { e as Sidebar };
@@ -1,5 +1,5 @@
1
1
  import { i as e, t } from "./rolldown-runtime-DArdT4gl.js";
2
- import { i as n } from "./identity-O4lAuchv.js";
2
+ import { i as n } from "./identity-D_rjww-V.js";
3
3
  //#endregion
4
4
  //#region ../node_modules/.bun/dexie@4.4.5/node_modules/dexie/import-wrapper-prod.mjs
5
5
  var r = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
@@ -1,4 +1,4 @@
1
- import { n as e } from "./auth-client-DCMne8vd.js";
1
+ import { n as e } from "./auth-client-Dc0mkuZH.js";
2
2
  //#region src/lib/offline/identity.ts
3
3
  var t = "hiai-docs:offline-owner-id", n = "hiai-docs:offline-binding", r = "hiai-docs:offline-access-enabled", i = 6048e5;
4
4
  function a() {
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "../identity-O4lAuchv.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../identity-D_rjww-V.js";
2
2
  export { a as disableOfflineAccess, n as enableOfflineAccess, i as offlineAccessEnabled, t as offlineDbName, e as resolveOfflineIdentity, r as resolveOfflineIdentityResolution };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./auth-client-DCMne8vd.js";
1
+ import { t as e } from "./auth-client-Dc0mkuZH.js";
2
2
  import { n as t } from "./client-GbtOH90i.js";
3
3
  //#region src/lib/api/settings.ts
4
4
  async function n() {
@@ -1,2 +1,2 @@
1
- import { a as updateProfile, i as updateEmbeddingConfig, n as getEmbeddingConfig, r as getProfile, t as deleteAccount } from "../assets/settings-DwAcLGM1.js";
1
+ import { a as updateProfile, i as updateEmbeddingConfig, n as getEmbeddingConfig, r as getProfile, t as deleteAccount } from "../assets/settings-DaOQ4Gv2.js";
2
2
  export { deleteAccount, getEmbeddingConfig, getProfile, updateEmbeddingConfig, updateProfile };
@@ -1,7 +1,7 @@
1
1
  import { t as Icon } from "./assets/Icon-Clqe8D8X.js";
2
2
  import { n as provideDocsmintShareAdapter, t as getDocsmintShareAdapter } from "./assets/share-context-BvXQrIIH.js";
3
- import { n as searchPreferences } from "./assets/SettingsDialog-CpPxZahd.js";
4
- import { t as Sidebar } from "./assets/Sidebar-BJ1XZ1DH.js";
3
+ import { n as searchPreferences } from "./assets/SettingsDialog-BaI2MU5d.js";
4
+ import { t as Sidebar } from "./assets/Sidebar-BpTS2uCa.js";
5
5
  import { t as scroll_to_top_aria } from "./assets/scroll_to_top_aria-BN4ZfOnM.js";
6
6
  import { o as provideDocsmintRequestAdapter, r as provideDocsmintRouteAdapter } from "./assets/route-context-BPRerEtZ.js";
7
7
  import { t as editorPreferences } from "./assets/editor-preferences.svelte-iI5jJM1x.js";
@@ -9,8 +9,8 @@ import { t as version_create_snapshot } from "./version_create_snapshot-COHzwjle
9
9
  import { a as getDocsmintRequestAdapter } from "./route-context-BPRerEtZ.js";
10
10
  import { a as Dialog_content, n as Dialog_header, o as Dialog, r as Dialog_footer, s as Button, t as Dialog_title } from "./dialog--tDgDGw9.js";
11
11
  import { t as Input } from "./input-BlAj7LzC.js";
12
- import { a as resolveOfflineIdentity } from "./identity-veXobEfE.js";
13
- import { n as getOfflineDB } from "./db-CUkQe9AU.js";
12
+ import { a as resolveOfflineIdentity } from "./identity-_M3U9lqe.js";
13
+ import { n as getOfflineDB } from "./db-DUKz2X3Z.js";
14
14
  import { n as createEditor, t as EditorContent } from "./dist-CshZmNmp.js";
15
15
  import { h as unregisterShortcut, u as registerShortcut } from "./keyboard.svelte-BgF47N3L.js";
16
16
  import { i as sanitizeEditorContent, r as removeUnavailableAttachmentImages } from "./editor-content-sanitizer-Gjm93iR-.js";
@@ -6,14 +6,14 @@ import { t as cn } from "./utils-BK35BJKQ.js";
6
6
  import { a as Dialog_content, i as Dialog_description, n as Dialog_header, o as Dialog, r as Dialog_footer, s as Button, t as Dialog_title } from "./dialog--tDgDGw9.js";
7
7
  import { t as Input } from "./input-BlAj7LzC.js";
8
8
  import { t as Label } from "./label-BRToaMg9.js";
9
- import { r as signOut } from "./auth-client-DzkZlSQ8.js";
10
- import { r as getProfile } from "./settings-DwAcLGM1.js";
9
+ import { r as signOut } from "./auth-client-Bo5Fg-sb.js";
10
+ import { r as getProfile } from "./settings-DaOQ4Gv2.js";
11
11
  import { a as listApiKeys, i as createGlobalApiKey, n as categoryIdFromScopes, o as revealCategoryApiKey, s as revokeApiKey, t as apiKeyClipboardValue } from "./api-keys-CHOrbU-Q.js";
12
12
  import { i as listCategories } from "./categories-C_dxFoHi.js";
13
13
  import { t as getFrontendExtensions } from "./context-Bi_mO-NS.js";
14
14
  import { t as resolveExtensions } from "./resolve-BqHozBXl.js";
15
- import { a as resolveOfflineIdentity, t as disableOfflineAccess } from "./identity-veXobEfE.js";
16
- import { n as getOfflineDB, t as deleteOfflineDB } from "./db-CUkQe9AU.js";
15
+ import { a as resolveOfflineIdentity, t as disableOfflineAccess } from "./identity-_M3U9lqe.js";
16
+ import { n as getOfflineDB, t as deleteOfflineDB } from "./db-DUKz2X3Z.js";
17
17
  import { t as editorPreferences } from "./editor-preferences.svelte-iI5jJM1x.js";
18
18
  import { t as themeStore } from "./theme.svelte-CGgnJc3k.js";
19
19
  import * as $ from "svelte/internal/server";
@@ -7,7 +7,7 @@ import { t as Copy } from "./copy-DRMKiRZ0.js";
7
7
  import { t as Ellipsis_vertical } from "./ellipsis-vertical-BErUuhWg.js";
8
8
  import { t as Folder } from "./folder-DszunwKc.js";
9
9
  import { t as Loader_circle } from "./loader-circle-BpRVrMZg.js";
10
- import { t as SettingsDialog } from "./SettingsDialog-CpPxZahd.js";
10
+ import { t as SettingsDialog } from "./SettingsDialog-BaI2MU5d.js";
11
11
  import { n as Search, t as Tag } from "./tag-DFh6nF9R.js";
12
12
  import { t as action_cancel } from "./action_cancel-OVgQDP5Q.js";
13
13
  import { a as action_copy_content, i as dashboard_title, n as folders_delete_title, t as sidebar_uncategorized } from "./sidebar_uncategorized-Dx-LTd5w.js";
@@ -3,7 +3,7 @@ import { env } from "@better-auth/core/env";
3
3
  import { BetterAuthError } from "@better-auth/core/error";
4
4
  import { isSafeUrlScheme } from "@better-auth/core/utils/url";
5
5
  import { capitalizeFirstLetter, toKebabCase } from "@better-auth/core/utils/string";
6
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/broadcast-channel.mjs
6
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/broadcast-channel.mjs
7
7
  var kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
8
8
  var now$1 = () => Math.floor(Date.now() / 1e3);
9
9
  var WindowBroadcastChannel = class {
@@ -46,7 +46,7 @@ function getGlobalBroadcastChannel(name = "better-auth.message") {
46
46
  return globalThis[kBroadcastChannel];
47
47
  }
48
48
  //#endregion
49
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/equality.mjs
49
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/equality.mjs
50
50
  function isPlainObject$1(value) {
51
51
  if (typeof value !== "object" || value === null) return false;
52
52
  const prototype = Object.getPrototypeOf(value);
@@ -86,7 +86,7 @@ function withEquality(store, isEqual) {
86
86
  });
87
87
  }
88
88
  //#endregion
89
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/focus-manager.mjs
89
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/focus-manager.mjs
90
90
  var kFocusManager = Symbol.for("better-auth:focus-manager");
91
91
  var WindowFocusManager = class {
92
92
  listeners = /* @__PURE__ */ new Set();
@@ -115,7 +115,7 @@ function getGlobalFocusManager() {
115
115
  return globalThis[kFocusManager];
116
116
  }
117
117
  //#endregion
118
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/online-manager.mjs
118
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/online-manager.mjs
119
119
  var kOnlineManager = Symbol.for("better-auth:online-manager");
120
120
  var WindowOnlineManager = class {
121
121
  listeners = /* @__PURE__ */ new Set();
@@ -147,7 +147,7 @@ function getGlobalOnlineManager() {
147
147
  return globalThis[kOnlineManager];
148
148
  }
149
149
  //#endregion
150
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/parser.mjs
150
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/parser.mjs
151
151
  var PROTO_POLLUTION_PATTERNS = {
152
152
  proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
153
153
  constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
@@ -216,7 +216,7 @@ function parseJSON(value, options = { strict: true }) {
216
216
  return betterJSONParse(value, options);
217
217
  }
218
218
  //#endregion
219
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/session-refresh.mjs
219
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/session-refresh.mjs
220
220
  var now = () => Math.floor(Date.now() / 1e3);
221
221
  /**
222
222
  * Rate limit: don't refetch on focus if a session request was made within this many seconds
@@ -343,7 +343,7 @@ function createSessionRefreshManager(opts) {
343
343
  };
344
344
  }
345
345
  //#endregion
346
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/utils/url.mjs
346
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/utils/url.mjs
347
347
  var SLASH_CHAR_CODE = "/".charCodeAt(0);
348
348
  function trimTrailingSlashes(value) {
349
349
  let end = value.length;
@@ -421,7 +421,7 @@ function getOrigin(url) {
421
421
  }
422
422
  }
423
423
  //#endregion
424
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/fetch-plugins.mjs
424
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/fetch-plugins.mjs
425
425
  var redirectPlugin = {
426
426
  id: "redirect",
427
427
  name: "Redirect",
@@ -436,7 +436,7 @@ var redirectPlugin = {
436
436
  } }
437
437
  };
438
438
  //#endregion
439
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/session-atom.mjs
439
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/session-atom.mjs
440
440
  var isServer = () => typeof window === "undefined";
441
441
  var SESSION_MOUNT_DEDUPE_INTERVAL = STORE_UNMOUNT_DELAY;
442
442
  function hydrateSessionAtom(sessionAtom, session) {
@@ -1114,7 +1114,7 @@ var betterFetch = async (url, options) => {
1114
1114
  };
1115
1115
  };
1116
1116
  //#endregion
1117
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/config.mjs
1117
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/config.mjs
1118
1118
  var resolvePublicAuthUrl = (basePath) => {
1119
1119
  if (typeof process === "undefined") return void 0;
1120
1120
  const path = basePath ?? "/api/auth";
@@ -1219,12 +1219,12 @@ var getClientConfig = (options, loadEnv) => {
1219
1219
  };
1220
1220
  };
1221
1221
  //#endregion
1222
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/utils/is-atom.mjs
1222
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/utils/is-atom.mjs
1223
1223
  function isAtom(value) {
1224
1224
  return typeof value === "object" && value !== null && "get" in value && typeof value.get === "function" && "lc" in value && typeof value.lc === "number";
1225
1225
  }
1226
1226
  //#endregion
1227
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/proxy.mjs
1227
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/proxy.mjs
1228
1228
  function getMethod(path, knownPathMethods, args) {
1229
1229
  const method = knownPathMethods[path];
1230
1230
  const { fetchOptions, query: _query, ...body } = args || {};
@@ -1299,7 +1299,7 @@ function createDynamicPathProxy(routes, client, knownPathMethods, atoms, atomLis
1299
1299
  return createProxy();
1300
1300
  }
1301
1301
  //#endregion
1302
- //#region ../node_modules/.bun/better-auth@1.7.2+a913405242b7eb5a/node_modules/better-auth/dist/client/vanilla.mjs
1302
+ //#region ../node_modules/.bun/better-auth@1.7.2+93880f1bde597d38/node_modules/better-auth/dist/client/vanilla.mjs
1303
1303
  function createAuthClient(options) {
1304
1304
  const { pluginPathMethods, pluginsActions, pluginsAtoms, hydrateSession, $fetch, atomListeners, $store } = getClientConfig(options);
1305
1305
  const resolvedHooks = {};
@@ -1,4 +1,4 @@
1
- import { i as offlineDbName } from "./identity-veXobEfE.js";
1
+ import { i as offlineDbName } from "./identity-_M3U9lqe.js";
2
2
  import Dexie from "dexie";
3
3
  //#region src/lib/db/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { n as getSession } from "./auth-client-DzkZlSQ8.js";
1
+ import { n as getSession } from "./auth-client-Bo5Fg-sb.js";
2
2
  //#region src/lib/offline/identity.ts
3
3
  var OWNER_ID_CACHE_KEY = "hiai-docs:offline-owner-id";
4
4
  var OFFLINE_BINDING_KEY = "hiai-docs:offline-binding";
@@ -1,4 +1,4 @@
1
- import { t as authClient } from "./auth-client-DzkZlSQ8.js";
1
+ import { t as authClient } from "./auth-client-Bo5Fg-sb.js";
2
2
  import { n as apiFetch } from "./client-rfwQYYHY.js";
3
3
  //#region src/lib/api/settings.ts
4
4
  async function getProfile() {
@@ -1,4 +1,4 @@
1
- import { t as HiAiEditor } from "../../assets/HiAiEditor-DCpulE6N.js";
1
+ import { t as HiAiEditor } from "../../assets/HiAiEditor-D-FYXUht.js";
2
2
  import "svelte/internal/server";
3
3
  //#region src/lib/components/editor/CompactEditor.svelte
4
4
  function CompactEditor($$renderer, $$props) {
@@ -1,2 +1,2 @@
1
- import { t as HiAiEditor } from "../../assets/HiAiEditor-DCpulE6N.js";
1
+ import { t as HiAiEditor } from "../../assets/HiAiEditor-D-FYXUht.js";
2
2
  export { HiAiEditor as DocsmintDocumentEditorHost };
@@ -1,2 +1,2 @@
1
- import { t as SettingsDialog } from "../assets/SettingsDialog-CpPxZahd.js";
1
+ import { t as SettingsDialog } from "../assets/SettingsDialog-BaI2MU5d.js";
2
2
  export { SettingsDialog };
@@ -1,2 +1,2 @@
1
- import { t as Sidebar } from "../assets/Sidebar-BJ1XZ1DH.js";
1
+ import { t as Sidebar } from "../assets/Sidebar-BpTS2uCa.js";
2
2
  export { Sidebar };
@@ -1,2 +1,2 @@
1
- import { a as resolveOfflineIdentity, i as offlineDbName, n as enableOfflineAccess, o as resolveOfflineIdentityResolution, r as offlineAccessEnabled, t as disableOfflineAccess } from "../assets/identity-veXobEfE.js";
1
+ import { a as resolveOfflineIdentity, i as offlineDbName, n as enableOfflineAccess, o as resolveOfflineIdentityResolution, r as offlineAccessEnabled, t as disableOfflineAccess } from "../assets/identity-_M3U9lqe.js";
2
2
  export { disableOfflineAccess, enableOfflineAccess, offlineAccessEnabled, offlineDbName, resolveOfflineIdentity, resolveOfflineIdentityResolution };
package/dist/mcp-cli.js CHANGED
@@ -378,6 +378,9 @@ class DocsClient {
378
378
  headers.set("X-Request-Id", requestContext.requestId);
379
379
  if (requestContext?.idempotencyKey)
380
380
  headers.set("Idempotency-Key", requestContext.idempotencyKey);
381
+ if (method === "POST" && path === "/api/documents" && !headers.has("Idempotency-Key")) {
382
+ headers.set("Idempotency-Key", crypto.randomUUID());
383
+ }
381
384
  if (requestContext?.workspaceAssertion) {
382
385
  headers.set("X-Docsmint-Workspace-Context", requestContext.workspaceAssertion);
383
386
  }
@@ -1049,7 +1052,7 @@ function registerDocsmintMcpCapabilities(server, client2) {
1049
1052
  registerExtendedCapabilities(server, client2, (handler11) => wrapHandler("extended", handler11));
1050
1053
  }
1051
1054
  function createDocsmintMcpServer(options = {}) {
1052
- const server = new McpServer({ name: "docsmint", version: "0.8.2" });
1055
+ const server = new McpServer({ name: "docsmint", version: "0.8.3" });
1053
1056
  const client2 = options.docsClient ? createMcpDocsClient(options.docsClient, options.requestContext) : options.client ?? createMcpDocsClient(createDefaultDocsClient(), options.requestContext);
1054
1057
  registerDocsmintMcpCapabilities(server, client2);
1055
1058
  return server;
@@ -374,6 +374,9 @@ class DocsClient {
374
374
  headers.set("X-Request-Id", requestContext.requestId);
375
375
  if (requestContext?.idempotencyKey)
376
376
  headers.set("Idempotency-Key", requestContext.idempotencyKey);
377
+ if (method === "POST" && path === "/api/documents" && !headers.has("Idempotency-Key")) {
378
+ headers.set("Idempotency-Key", crypto.randomUUID());
379
+ }
377
380
  if (requestContext?.workspaceAssertion) {
378
381
  headers.set("X-Docsmint-Workspace-Context", requestContext.workspaceAssertion);
379
382
  }
@@ -1045,7 +1048,7 @@ function registerDocsmintMcpCapabilities(server, client2) {
1045
1048
  registerExtendedCapabilities(server, client2, (handler11) => wrapHandler("extended", handler11));
1046
1049
  }
1047
1050
  function createDocsmintMcpServer(options = {}) {
1048
- const server = new McpServer({ name: "docsmint", version: "0.8.2" });
1051
+ const server = new McpServer({ name: "docsmint", version: "0.8.3" });
1049
1052
  const client2 = options.docsClient ? createMcpDocsClient(options.docsClient, options.requestContext) : options.client ?? createMcpDocsClient(createDefaultDocsClient(), options.requestContext);
1050
1053
  registerDocsmintMcpCapabilities(server, client2);
1051
1054
  return server;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hiai-gg/docsmint",
3
3
  "mcpName": "io.github.HiAi-gg/docsmint",
4
- "version": "0.8.2",
4
+ "version": "0.8.3",
5
5
  "type": "module",
6
6
  "browser": {
7
7
  "./dist/backend-launcher.js": false,
@@ -25,7 +25,7 @@ import { registerSearch } from './commands/search.js';
25
25
  import { registerSnapshot } from './commands/snapshot.js';
26
26
  import { registerUpdate } from './commands/update.js';
27
27
 
28
- const VERSION = '0.8.2';
28
+ const VERSION = '0.8.3';
29
29
 
30
30
  const program = new Command();
31
31
  program.name('docsmint').description('CLI for the DocsMint knowledge workspace').version(VERSION);
package/server.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "id": "1249550690",
11
11
  "subfolder": "packages/mcp-server"
12
12
  },
13
- "version": "0.8.2",
13
+ "version": "0.8.3",
14
14
  "icons": [
15
15
  {
16
16
  "src": "https://raw.githubusercontent.com/HiAi-gg/docsmint/main/frontend/static/logo-dark.png",
@@ -30,7 +30,7 @@
30
30
  "registryType": "npm",
31
31
  "registryBaseUrl": "https://registry.npmjs.org",
32
32
  "identifier": "@hiai-gg/docsmint",
33
- "version": "0.8.2",
33
+ "version": "0.8.3",
34
34
  "runtimeHint": "npx",
35
35
  "transport": {
36
36
  "type": "stdio"