@abraca/mcp 1.1.0 → 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
@@ -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);