@hiai-gg/docsmint 2.0.2 → 2.0.4

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.
package/README.md CHANGED
@@ -83,7 +83,7 @@ is a separate listing.
83
83
  - **Choose how you run it.** Use [managed DocsMint](https://docsmint.com) or
84
84
  self-host the application, database, search, queues, and files.
85
85
 
86
- ## What's new in 2.0.2?
86
+ ## What's new in 2.0.4?
87
87
 
88
88
  Hosted MCP integrations can discover granted workspaces, including empty spaces, with
89
89
  `list_workspace_structure(kind="workspaces")` and select one with the optional
@@ -93,7 +93,7 @@ results and independent pagination. Existing single-scope calls remain compatibl
93
93
 
94
94
  The OSS frontend adopts SvelteKit 3; dependency updates resolve the current security
95
95
  audit findings. No database migration is required. See the
96
- [2.0.2 release notes](docs/release/v2.0.2-notes.md).
96
+ [2.0.4 release notes](docs/release/v2.0.4-notes.md).
97
97
 
98
98
  ## Previous release: 1.0.3
99
99
 
@@ -239821,7 +239821,7 @@ var swaggerConfig = {
239821
239821
  },
239822
239822
  info: {
239823
239823
  title: "DocsMint API",
239824
- version: "2.0.2",
239824
+ version: "2.0.4",
239825
239825
  description: "Self-hosted AI-native knowledge workspace and installable PWA with hybrid search, GraphRAG, REST, SDK, CLI, and MCP access for people and AI agents.",
239826
239826
  contact: { name: "HiAi-gg", url: "https://github.com/HiAi-gg/docsmint" },
239827
239827
  license: {
@@ -185,8 +185,17 @@ function D(e, t) {
185
185
  }
186
186
  p.delegate(["click"]);
187
187
  //#endregion
188
+ //#region src/lib/stores/mobile-sidebar-focus.ts
189
+ function O(e, t, n, r = requestAnimationFrame) {
190
+ r(() => {
191
+ if (n()) return;
192
+ let r = e?.isConnected ? e : t();
193
+ r?.isConnected && r.focus();
194
+ });
195
+ }
196
+ //#endregion
188
197
  //#region src/lib/stores/mobile-sidebar-gesture.ts
189
- function O(e = {}) {
198
+ function k(e = {}) {
190
199
  let t = e.edgeWidth ?? 36, n = e.openDistance ?? 40, r = e.scrollTolerance ?? 12, i = null, a = !1;
191
200
  return {
192
201
  start(e) {
@@ -208,21 +217,21 @@ function O(e = {}) {
208
217
  }
209
218
  //#endregion
210
219
  //#region src/lib/hosts/mutation-refresh.ts
211
- var k = {
220
+ var A = {
212
221
  documents: !1,
213
222
  folders: !1,
214
223
  tags: !1
215
224
  };
216
- function A(e, t) {
225
+ function j(e, t) {
217
226
  let n = (t?.method ?? (e instanceof Request ? e.method : "GET")).toUpperCase();
218
227
  if (![
219
228
  "POST",
220
229
  "PUT",
221
230
  "PATCH",
222
231
  "DELETE"
223
- ].includes(n)) return k;
232
+ ].includes(n)) return A;
224
233
  let r = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, i = new URL(r, "http://docsmint.local").pathname;
225
- return /\/keys(?:\/|$)/.test(i) ? k : /^\/api\/(?:v1\/)?tags(?:\/|$)/.test(i) || /^\/api\/(?:v1\/)?documents\/[^/]+\/tags(?:\/|$)/.test(i) ? {
234
+ return /\/keys(?:\/|$)/.test(i) ? A : /^\/api\/(?:v1\/)?tags(?:\/|$)/.test(i) || /^\/api\/(?:v1\/)?documents\/[^/]+\/tags(?:\/|$)/.test(i) ? {
226
235
  documents: !0,
227
236
  folders: !1,
228
237
  tags: !0
@@ -230,24 +239,24 @@ function A(e, t) {
230
239
  documents: !0,
231
240
  folders: !0,
232
241
  tags: !1
233
- } : k;
242
+ } : A;
234
243
  }
235
- function j(e) {
244
+ function M(e) {
236
245
  return e.documents || e.folders || e.tags;
237
246
  }
238
247
  //#endregion
239
248
  //#region src/lib/hosts/realtime-context.ts
240
- var M = Symbol("docsmint-realtime-adapter");
241
- function N(e) {
242
- g(M, e);
249
+ var N = Symbol("docsmint-realtime-adapter");
250
+ function P(e) {
251
+ g(N, e);
243
252
  }
244
- function P() {
245
- return m(M);
253
+ function F() {
254
+ return m(N);
246
255
  }
247
256
  //#endregion
248
257
  //#region src/lib/hosts/DocsmintAppShellHost.svelte
249
- var F = p.from_html("<div data-mobile-sidebar-edge=\"\" aria-hidden=\"true\" class=\"fixed inset-y-0 left-0 z-20 w-9 md:hidden\" style=\"touch-action: pan-y;\"></div>"), I = p.from_html("<button type=\"button\" tabindex=\"-1\" aria-label=\"Close navigation menu\" class=\"fixed inset-0 z-40 bg-black/50\"></button>"), L = p.from_html("<div class=\"flex h-screen\" data-docsmint-app-shell-host=\"\"><!> <main id=\"main-content\" class=\"relative flex-1 overflow-auto\"><!></main></div> <!> <!> <!>", 1), R = p.from_html("<!> <!>", 1);
250
- function z(e, n) {
258
+ var I = p.from_html("<div data-mobile-sidebar-edge=\"\" aria-hidden=\"true\" class=\"fixed inset-y-0 left-0 z-20 w-9 md:hidden\" style=\"touch-action: pan-y;\"></div>"), L = p.from_html("<button type=\"button\" tabindex=\"-1\" aria-label=\"Close navigation menu\" class=\"fixed inset-0 z-40 bg-black/50\"></button>"), R = p.from_html("<div class=\"flex h-screen\" data-docsmint-app-shell-host=\"\"><!> <main id=\"main-content\" class=\"relative flex-1 overflow-auto\"><!></main></div> <!> <!> <!>", 1), z = p.from_html("<!> <!>", 1);
259
+ function B(e, n) {
251
260
  p.push(n, !0);
252
261
  let a = p.prop(n, "request", 19, () => ({ fetch })), m = p.prop(n, "extensions", 19, () => ({}));
253
262
  s({
@@ -257,33 +266,33 @@ function z(e, n) {
257
266
  resolve: (e) => n.route.resolve(e),
258
267
  navigate: (e, t) => n.route.navigate?.(e, t)
259
268
  }), o({ fetch: async (...e) => {
260
- let t = await a().fetch(...e), n = A(e[0], e[1]);
261
- return t.ok && j(n) && (n.documents && u(), n.folders && l(), n.tags && d()), t;
269
+ let t = await a().fetch(...e), n = j(e[0], e[1]);
270
+ return t.ok && M(n) && (n.documents && u(), n.folders && l(), n.tags && d()), t;
262
271
  } });
263
272
  let h = _(() => n.realtime);
264
- h && N(h), t({ get displayMode() {
273
+ h && P(h), t({ get displayMode() {
265
274
  return n.share?.displayMode ?? "standalone";
266
275
  } }), c.init(), r.init();
267
- let g = p.state(null), v = p.state(null), y = p.state(null), b = p.state(!1), w = O();
276
+ let g = p.state(null), v = p.state(null), y = p.state(null), b = p.state(!1), w = k();
268
277
  function E(e) {
269
278
  w.start({
270
279
  x: e.clientX,
271
280
  y: e.clientY
272
281
  }), e.currentTarget.setPointerCapture(e.pointerId);
273
282
  }
274
- function k(e) {
283
+ function A(e) {
275
284
  w.move({
276
285
  x: e.clientX,
277
286
  y: e.clientY
278
287
  }) === "open" && (e.preventDefault(), S());
279
288
  }
280
- function M(e) {
289
+ function N(e) {
281
290
  w.end({
282
291
  x: e.clientX,
283
292
  y: e.clientY
284
293
  }) === "open" && S();
285
294
  }
286
- let P = [
295
+ let F = [
287
296
  "a[href]",
288
297
  "button:not([disabled])",
289
298
  "input:not([disabled])",
@@ -302,7 +311,7 @@ function z(e, n) {
302
311
  if (!p.get(b) || !x.open || !p.get(v)) return;
303
312
  let e = document.activeElement instanceof HTMLElement ? document.activeElement : p.get(y), t = document.body.style.overflow;
304
313
  document.body.style.overflow = "hidden";
305
- let n = () => Array.from(p.get(v)?.querySelectorAll(P) ?? []).filter((e) => !e.hasAttribute("disabled")), r = (e) => {
314
+ let n = () => Array.from(p.get(v)?.querySelectorAll(F) ?? []).filter((e) => !e.hasAttribute("disabled")), r = (e) => {
306
315
  let t = e.target instanceof Element ? e.target.closest("[role=\"dialog\"]") : null;
307
316
  if (t && t !== p.get(v)) return;
308
317
  if (e.key === "Escape") {
@@ -322,16 +331,16 @@ function z(e, n) {
322
331
  (n().at(0) ?? p.get(v))?.focus();
323
332
  });
324
333
  return () => {
325
- cancelAnimationFrame(i), document.removeEventListener("keydown", r), document.body.style.overflow = t, e?.isConnected && e.focus();
334
+ cancelAnimationFrame(i), document.removeEventListener("keydown", r), document.body.style.overflow = t, O(e, () => p.get(y), () => x.open);
326
335
  };
327
336
  });
328
- var z = R(), B = p.first_child(z);
329
- f(B, {
337
+ var B = z(), V = p.first_child(B);
338
+ f(V, {
330
339
  get extensions() {
331
340
  return m();
332
341
  },
333
342
  children: (e, t) => {
334
- var r = L(), a = p.first_child(r), o = p.child(a);
343
+ var r = R(), a = p.first_child(r), o = p.child(a);
335
344
  i(o, {
336
345
  get mobile() {
337
346
  return p.get(b);
@@ -358,14 +367,14 @@ function z(e, n) {
358
367
  }
359
368
  });
360
369
  var u = p.sibling(l, 2), d = (e) => {
361
- var t = F();
362
- p.delegated("pointerdown", t, E), p.delegated("pointermove", t, k), p.delegated("pointerup", t, M), p.event("pointercancel", t, () => w.cancel()), p.append(e, t);
370
+ var t = I();
371
+ p.delegated("pointerdown", t, E), p.delegated("pointermove", t, A), p.delegated("pointerup", t, N), p.event("pointercancel", t, () => w.cancel()), p.append(e, t);
363
372
  };
364
373
  p.if(u, (e) => {
365
374
  p.get(b) && !x.open && e(d);
366
375
  });
367
376
  var f = p.sibling(u, 2), m = (e) => {
368
- var t = I();
377
+ var t = L();
369
378
  p.delegated("click", t, function(...e) {
370
379
  C?.apply(this, e);
371
380
  }), p.append(e, t);
@@ -376,7 +385,7 @@ function z(e, n) {
376
385
  },
377
386
  $$slots: { default: !0 }
378
387
  });
379
- var V = p.sibling(B, 2), H = (e) => {
388
+ var H = p.sibling(V, 2), U = (e) => {
380
389
  {
381
390
  let t = p.derived(() => n.route.pathname.startsWith("/docs/"));
382
391
  D(e, {
@@ -389,9 +398,9 @@ function z(e, n) {
389
398
  });
390
399
  }
391
400
  };
392
- p.if(V, (e) => {
393
- c.showScrollToTop && e(H);
394
- }), p.append(e, z), p.pop();
401
+ p.if(H, (e) => {
402
+ c.showScrollToTop && e(U);
403
+ }), p.append(e, B), p.pop();
395
404
  }
396
405
  p.delegate([
397
406
  "pointerdown",
@@ -400,4 +409,4 @@ p.delegate([
400
409
  "click"
401
410
  ]);
402
411
  //#endregion
403
- export { z as DocsmintAppShellHost, P as getDocsmintRealtimeAdapter, n as getDocsmintShareAdapter };
412
+ export { B as DocsmintAppShellHost, F as getDocsmintRealtimeAdapter, n as getDocsmintShareAdapter };
package/dist/mcp-cli.js CHANGED
@@ -1043,7 +1043,17 @@ function withClientRoutingSchema(schema) {
1043
1043
  ...standard.jsonSchema,
1044
1044
  input: (options) => (() => {
1045
1045
  const published = hoistObjectUnionClosure(standard.jsonSchema.input(options));
1046
- return { ...published, properties: { ...published.properties, workspaceId: z2.toJSONSchema(selector) } };
1046
+ const routingProperty = z2.toJSONSchema(selector);
1047
+ return {
1048
+ ...published,
1049
+ properties: { ...published.properties, workspaceId: routingProperty },
1050
+ ...Array.isArray(published.oneOf) ? {
1051
+ oneOf: published.oneOf.map((branch) => ({
1052
+ ...branch,
1053
+ properties: { ...branch.properties, workspaceId: routingProperty }
1054
+ }))
1055
+ } : {}
1056
+ };
1047
1057
  })()
1048
1058
  }
1049
1059
  }
@@ -1398,7 +1408,7 @@ function registerDocsmintMcpCapabilities(server, client2, workspaceRouting) {
1398
1408
  registerPromptsAndResources(server, client2);
1399
1409
  }
1400
1410
  function createDocsmintMcpServer(options = {}) {
1401
- const server = new McpServer({ name: "docsmint", version: "2.0.2" });
1411
+ const server = new McpServer({ name: "docsmint", version: "2.0.4" });
1402
1412
  const client2 = options.docsClient ? createMcpDocsClient(options.docsClient, options.requestContext) : options.client ?? createMcpDocsClient(createDefaultDocsClient(), options.requestContext);
1403
1413
  registerDocsmintMcpCapabilities(server, client2, options.workspaceRouting);
1404
1414
  return server;
@@ -1041,7 +1041,17 @@ function withClientRoutingSchema(schema) {
1041
1041
  ...standard.jsonSchema,
1042
1042
  input: (options) => (() => {
1043
1043
  const published = hoistObjectUnionClosure(standard.jsonSchema.input(options));
1044
- return { ...published, properties: { ...published.properties, workspaceId: z2.toJSONSchema(selector) } };
1044
+ const routingProperty = z2.toJSONSchema(selector);
1045
+ return {
1046
+ ...published,
1047
+ properties: { ...published.properties, workspaceId: routingProperty },
1048
+ ...Array.isArray(published.oneOf) ? {
1049
+ oneOf: published.oneOf.map((branch) => ({
1050
+ ...branch,
1051
+ properties: { ...branch.properties, workspaceId: routingProperty }
1052
+ }))
1053
+ } : {}
1054
+ };
1045
1055
  })()
1046
1056
  }
1047
1057
  }
@@ -1430,7 +1440,7 @@ function registerDocsmintMcpCapabilities(server, client2, workspaceRouting) {
1430
1440
  registerPromptsAndResources(server, client2);
1431
1441
  }
1432
1442
  function createDocsmintMcpServer(options = {}) {
1433
- const server = new McpServer({ name: "docsmint", version: "2.0.2" });
1443
+ const server = new McpServer({ name: "docsmint", version: "2.0.4" });
1434
1444
  const client2 = options.docsClient ? createMcpDocsClient(options.docsClient, options.requestContext) : options.client ?? createMcpDocsClient(createDefaultDocsClient(), options.requestContext);
1435
1445
  registerDocsmintMcpCapabilities(server, client2, options.workspaceRouting);
1436
1446
  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": "2.0.2",
4
+ "version": "2.0.4",
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 = '2.0.2';
28
+ const VERSION = '2.0.4';
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": "2.0.2",
13
+ "version": "2.0.4",
14
14
  "icons": [
15
15
  {
16
16
  "src": "https://raw.githubusercontent.com/HiAi-gg/docsmint/main/frontend/static/logo-dark.png",
@@ -34,7 +34,7 @@
34
34
  "registryType": "npm",
35
35
  "registryBaseUrl": "https://registry.npmjs.org",
36
36
  "identifier": "@hiai-gg/docsmint",
37
- "version": "2.0.2",
37
+ "version": "2.0.4",
38
38
  "runtimeHint": "npx",
39
39
  "transport": {
40
40
  "type": "stdio"