@abraca/mcp 1.0.25 → 1.1.1

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.
@@ -19507,17 +19507,30 @@ var AbracadabraMCPServer = class {
19507
19507
  this._serverInfo = await this.client.serverInfo();
19508
19508
  let initialDocId = this._serverInfo.index_doc_id ?? null;
19509
19509
  try {
19510
- this._spaces = await this.client.listSpaces();
19511
- const hub = this._spaces.find((s) => s.is_hub);
19510
+ const roots = await this.client.listRootDocuments();
19511
+ this._spaces = roots.map(docToSpaceMeta);
19512
+ const hub = roots.find((d) => d.is_hub);
19512
19513
  if (hub) {
19513
- initialDocId = hub.doc_id;
19514
- console.error(`[abracadabra-mcp] Spaces extension active. Hub space: ${hub.name} (${hub.doc_id})`);
19515
- } else if (this._spaces.length > 0) {
19516
- initialDocId = this._spaces[0].doc_id;
19517
- console.error(`[abracadabra-mcp] Spaces active but no hub, using first space: ${this._spaces[0].name} (${this._spaces[0].doc_id})`);
19514
+ initialDocId = hub.id;
19515
+ console.error(`[abracadabra-mcp] Root documents discovered. Hub: ${hub.label ?? hub.id} (${hub.id})`);
19516
+ } else if (roots.length > 0) {
19517
+ initialDocId = roots[0].id;
19518
+ console.error(`[abracadabra-mcp] No hub, using first root doc: ${roots[0].label ?? roots[0].id} (${roots[0].id})`);
19518
19519
  }
19519
19520
  } catch {
19520
- console.error("[abracadabra-mcp] Spaces extension not available, using index_doc_id");
19521
+ try {
19522
+ this._spaces = await this.client.listSpaces();
19523
+ const hub = this._spaces.find((s) => s.is_hub);
19524
+ if (hub) {
19525
+ initialDocId = hub.doc_id;
19526
+ console.error(`[abracadabra-mcp] Spaces extension active. Hub space: ${hub.name} (${hub.doc_id})`);
19527
+ } else if (this._spaces.length > 0) {
19528
+ initialDocId = this._spaces[0].doc_id;
19529
+ console.error(`[abracadabra-mcp] Spaces active but no hub, using first space: ${this._spaces[0].name} (${this._spaces[0].doc_id})`);
19530
+ }
19531
+ } catch {
19532
+ console.error("[abracadabra-mcp] Neither /docs?root=true nor /spaces available, using index_doc_id");
19533
+ }
19521
19534
  }
19522
19535
  if (!initialDocId) throw new Error("No entry point found: server has neither spaces nor index_doc_id configured.");
19523
19536
  this._rootDocId = initialDocId;
@@ -19789,7 +19802,7 @@ var AbracadabraMCPServer = class {
19789
19802
  provider.awareness.setLocalStateField("activeToolCall", null);
19790
19803
  provider.awareness.setLocalStateField("statusContext", null);
19791
19804
  this._stopTypingInterval();
19792
- }, 1e4);
19805
+ }, 3e4);
19793
19806
  }
19794
19807
  /** Re-send typing indicator every 2s so dashboard keeps showing it (expires at 3s). */
19795
19808
  _startTypingInterval(channel) {
@@ -19848,6 +19861,24 @@ var AbracadabraMCPServer = class {
19848
19861
  console.error("[abracadabra-mcp] Shutdown complete");
19849
19862
  }
19850
19863
  };
19864
+ /** Map a DocumentMeta (from /docs?root=true) to the SpaceMeta shape for compat. */
19865
+ function docToSpaceMeta(doc) {
19866
+ const publicAccess = doc.public_access;
19867
+ let visibility = "private";
19868
+ if (publicAccess && publicAccess !== "none") visibility = "public";
19869
+ return {
19870
+ id: doc.id,
19871
+ doc_id: doc.id,
19872
+ name: doc.label ?? doc.id,
19873
+ description: doc.description ?? null,
19874
+ visibility,
19875
+ is_hub: doc.is_hub ?? false,
19876
+ owner_id: doc.owner_id ?? null,
19877
+ created_at: 0,
19878
+ updated_at: doc.updated_at ?? 0,
19879
+ public_access: publicAccess ?? null
19880
+ };
19881
+ }
19851
19882
 
19852
19883
  //#endregion
19853
19884
  //#region packages/mcp/src/tools/tree.ts
@@ -20005,7 +20036,7 @@ function registerTreeTools(mcp, server) {
20005
20036
  mcp.tool("create_document", "Create a new document in the tree. Returns the new document ID.", {
20006
20037
  parentId: zod.z.string().optional().describe("Parent document ID. Omit for top-level pages. Use a document ID for nested/child pages."),
20007
20038
  label: zod.z.string().describe("Display name / title for the document."),
20008
- type: zod.z.string().optional().describe("Page type — sets how this document renders. \"doc\" (rich text), \"kanban\" (columns → cards), \"table\" (columns → cells, positional rows), \"calendar\" (events with datetimeStart/End), \"timeline\" (epics → tasks with dateStart/End + taskProgress), \"checklist\" (tasks with checked/priority, unlimited nesting), \"outline\" (nested items, unlimited depth), \"gallery\" (image/media items), \"map\" (markers/lines with geoLat/geoLng), \"graph\" (knowledge graph nodes), \"dashboard\" (positioned widgets with deskX/deskY/deskMode), \"mindmap\" (connected nodes), \"spatial\" (3D objects with spShape/spX/spY/spZ), \"media\" (audio/video tracks), \"slides\" (slide deck), \"whiteboard\" (freeform canvas). Omit to inherit parent view. Only set on the parent page, NEVER on child items."),
20039
+ type: zod.z.string().optional().describe("Page type — sets how this document renders. \"doc\" (rich text), \"kanban\" (columns → cards), \"table\" (columns → rows with custom fields), \"calendar\" (events with datetimeStart/End), \"timeline\" (epics → tasks with dateStart/End + taskProgress), \"checklist\" (tasks with checked/priority, unlimited nesting), \"outline\" (nested items, unlimited depth), \"gallery\" (visual grid with covers/ratings), \"map\" (markers/lines with geoLat/geoLng), \"graph\" (force-directed knowledge graph), \"dashboard\" (positioned widgets with deskX/deskY/deskMode), \"spatial\" (3D scene with spShape/spX/spY/spZ), \"media\" (audio/video player with playlists), \"slides\" (presentation with transitions), \"chart\" (bar/line/donut/treemap from data points or aggregation), \"sheets\" (spreadsheet with formulas and formatting), \"overview\" (space home — activity and stats), \"call\" (video call room, no children). Omit to inherit parent view. Only set on the parent page, NEVER on child items."),
20009
20040
  meta: zod.z.record(zod.z.unknown()).optional().describe("Initial metadata (PageMeta fields: color as hex string, icon as Lucide kebab-case name like \"star\"/\"code-2\"/\"users\" — never emoji, dateStart, dateEnd, priority 0-4, tags array, etc). Omit icon entirely to use page type default.")
20010
20041
  }, async ({ parentId, label, type, meta }) => {
20011
20042
  server.setAutoStatus("creating");
@@ -20163,7 +20194,7 @@ function registerTreeTools(mcp, server) {
20163
20194
  });
20164
20195
  mcp.tool("change_document_type", "Change the page type view of a document (data is preserved).", {
20165
20196
  id: zod.z.string().describe("Document ID."),
20166
- type: zod.z.string().describe("New page type (e.g. \"doc\", \"kanban\", \"table\", \"calendar\", \"outline\", \"gallery\", \"slides\", \"timeline\", \"whiteboard\", \"map\", \"dashboard\", \"mindmap\", \"graph\").")
20197
+ type: zod.z.string().describe("New page type: \"doc\", \"kanban\", \"table\", \"calendar\", \"timeline\", \"checklist\", \"outline\", \"gallery\", \"map\", \"graph\", \"dashboard\", \"spatial\", \"media\", \"slides\", \"chart\", \"sheets\", \"overview\", \"call\".")
20167
20198
  }, async ({ id, type }) => {
20168
20199
  server.setAutoStatus("writing");
20169
20200
  server.setActiveToolCall({
@@ -21544,7 +21575,7 @@ function registerMetaTools(mcp, server) {
21544
21575
  });
21545
21576
  mcp.tool("update_metadata", "Update metadata fields on a document. Merges the provided fields into existing metadata.", {
21546
21577
  docId: zod.z.string().describe("Document ID."),
21547
- meta: zod.z.record(zod.z.unknown()).describe("Metadata fields to update (merged with existing). Universal keys: color (hex), icon (Lucide kebab-case — NEVER emoji), dateStart/dateEnd, datetimeStart/datetimeEnd, allDay, tags (string[]), checked (bool), priority (0=none,1=low,2=med,3=high,4=urgent), status, rating (0-5), url, email, phone, number, unit, subtitle, note, taskProgress (0-100), members ({id,label}[]), coverUploadId. Geo/Map: geoType (\"marker\"|\"line\"|\"measure\"), geoLat, geoLng, geoDescription. Spatial 3D: spShape (\"box\"|\"sphere\"|\"cylinder\"|\"cone\"|\"plane\"|\"torus\"|\"glb\"), spX/spY/spZ, spRX/spRY/spRZ, spSX/spSY/spSZ, spColor, spOpacity (0-100). Dashboard: deskX, deskY, deskZ, deskMode (\"icon\"|\"widget-sm\"|\"widget-lg\"). Renderer config (on the page doc itself): kanbanColumnWidth, galleryColumns, galleryAspect, calendarView, calendarWeekStart, tableMode, showRefEdges. Set a key to null to clear it.")
21578
+ meta: zod.z.record(zod.z.unknown()).describe("Metadata fields to update (merged with existing). Universal keys: color (hex), icon (Lucide kebab-case — NEVER emoji), dateStart/dateEnd, datetimeStart/datetimeEnd, allDay, tags (string[]), checked (bool), priority (0=none,1=low,2=med,3=high,4=urgent), status, rating (0-5), url, email, phone, number, unit, subtitle, note, taskProgress (0-100), members ({id,label}[]), coverUploadId. Geo/Map: geoType (\"marker\"|\"line\"|\"measure\"), geoLat, geoLng, geoDescription. Spatial 3D: spShape (\"box\"|\"sphere\"|\"cylinder\"|\"cone\"|\"plane\"|\"torus\"|\"glb\"), spX/spY/spZ, spRX/spRY/spRZ, spSX/spSY/spSZ, spColor, spOpacity (0-100). Dashboard: deskX, deskY, deskZ, deskMode (\"icon\"|\"widget-sm\"|\"widget-lg\"). Slides: slidesTransition (\"none\"|\"fade\"|\"slide\"), slidesTheme (\"dark\"|\"light\"). Chart: chartType (\"bar\"|\"stacked bar\"|\"line\"|\"donut\"|\"treemap\"), chartMetric, chartColorScheme, chartLimit, chartShowLegend, chartShowValues. Sheets: sheetsDefaultColWidth, sheetsDefaultRowHeight, sheetsShowGridlines, sheetsFreezeRows, sheetsFreezeCols. Cell formatting: bold, italic, textColor, bgColor, align, formula. Renderer config (on the page doc itself): kanbanColumnWidth, galleryColumns, galleryAspect, galleryCardStyle, galleryShowLabels, gallerySortBy, calendarView, calendarWeekStart, calendarShowWeekNumbers, tableMode, tableSortDir, checklistFilter, checklistSort, mapShowLabels, spatialGridVisible, showRefEdges, mediaRepeat, mediaShuffle. Set a key to null to clear it.")
21548
21579
  }, async ({ docId, meta }) => {
21549
21580
  server.setAutoStatus("writing", docId);
21550
21581
  server.setActiveToolCall({
@@ -22766,7 +22797,7 @@ var HookBridge = class {
22766
22797
  }
22767
22798
  onPostToolUse(payload) {
22768
22799
  if ((payload.tool_name ?? "").startsWith("mcp__abracadabra__")) return;
22769
- this.server.setActiveToolCall(null);
22800
+ this.server.setAutoStatus("thinking");
22770
22801
  }
22771
22802
  onSubagentStart(payload) {
22772
22803
  const agentType = payload.agent_type ?? "agent";
@@ -22777,7 +22808,7 @@ var HookBridge = class {
22777
22808
  this.server.setAutoStatus("thinking");
22778
22809
  }
22779
22810
  onSubagentStop(_payload) {
22780
- this.server.setActiveToolCall(null);
22811
+ this.server.setAutoStatus("thinking");
22781
22812
  }
22782
22813
  onStop() {
22783
22814
  this.server.setAutoStatus(null);