@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.
- package/dist/abracadabra-mcp.cjs +42 -11
- package/dist/abracadabra-mcp.cjs.map +1 -1
- package/dist/abracadabra-mcp.esm.js +42 -11
- package/dist/abracadabra-mcp.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/hook-bridge.ts +6 -2
- package/src/server.ts +48 -12
|
@@ -19503,17 +19503,30 @@ var AbracadabraMCPServer = class {
|
|
|
19503
19503
|
this._serverInfo = await this.client.serverInfo();
|
|
19504
19504
|
let initialDocId = this._serverInfo.index_doc_id ?? null;
|
|
19505
19505
|
try {
|
|
19506
|
-
|
|
19507
|
-
|
|
19506
|
+
const roots = await this.client.listRootDocuments();
|
|
19507
|
+
this._spaces = roots.map(docToSpaceMeta);
|
|
19508
|
+
const hub = roots.find((d) => d.is_hub);
|
|
19508
19509
|
if (hub) {
|
|
19509
|
-
initialDocId = hub.
|
|
19510
|
-
console.error(`[abracadabra-mcp]
|
|
19511
|
-
} else if (
|
|
19512
|
-
initialDocId =
|
|
19513
|
-
console.error(`[abracadabra-mcp]
|
|
19510
|
+
initialDocId = hub.id;
|
|
19511
|
+
console.error(`[abracadabra-mcp] Root documents discovered. Hub: ${hub.label ?? hub.id} (${hub.id})`);
|
|
19512
|
+
} else if (roots.length > 0) {
|
|
19513
|
+
initialDocId = roots[0].id;
|
|
19514
|
+
console.error(`[abracadabra-mcp] No hub, using first root doc: ${roots[0].label ?? roots[0].id} (${roots[0].id})`);
|
|
19514
19515
|
}
|
|
19515
19516
|
} catch {
|
|
19516
|
-
|
|
19517
|
+
try {
|
|
19518
|
+
this._spaces = await this.client.listSpaces();
|
|
19519
|
+
const hub = this._spaces.find((s) => s.is_hub);
|
|
19520
|
+
if (hub) {
|
|
19521
|
+
initialDocId = hub.doc_id;
|
|
19522
|
+
console.error(`[abracadabra-mcp] Spaces extension active. Hub space: ${hub.name} (${hub.doc_id})`);
|
|
19523
|
+
} else if (this._spaces.length > 0) {
|
|
19524
|
+
initialDocId = this._spaces[0].doc_id;
|
|
19525
|
+
console.error(`[abracadabra-mcp] Spaces active but no hub, using first space: ${this._spaces[0].name} (${this._spaces[0].doc_id})`);
|
|
19526
|
+
}
|
|
19527
|
+
} catch {
|
|
19528
|
+
console.error("[abracadabra-mcp] Neither /docs?root=true nor /spaces available, using index_doc_id");
|
|
19529
|
+
}
|
|
19517
19530
|
}
|
|
19518
19531
|
if (!initialDocId) throw new Error("No entry point found: server has neither spaces nor index_doc_id configured.");
|
|
19519
19532
|
this._rootDocId = initialDocId;
|
|
@@ -19785,7 +19798,7 @@ var AbracadabraMCPServer = class {
|
|
|
19785
19798
|
provider.awareness.setLocalStateField("activeToolCall", null);
|
|
19786
19799
|
provider.awareness.setLocalStateField("statusContext", null);
|
|
19787
19800
|
this._stopTypingInterval();
|
|
19788
|
-
},
|
|
19801
|
+
}, 3e4);
|
|
19789
19802
|
}
|
|
19790
19803
|
/** Re-send typing indicator every 2s so dashboard keeps showing it (expires at 3s). */
|
|
19791
19804
|
_startTypingInterval(channel) {
|
|
@@ -19844,6 +19857,24 @@ var AbracadabraMCPServer = class {
|
|
|
19844
19857
|
console.error("[abracadabra-mcp] Shutdown complete");
|
|
19845
19858
|
}
|
|
19846
19859
|
};
|
|
19860
|
+
/** Map a DocumentMeta (from /docs?root=true) to the SpaceMeta shape for compat. */
|
|
19861
|
+
function docToSpaceMeta(doc) {
|
|
19862
|
+
const publicAccess = doc.public_access;
|
|
19863
|
+
let visibility = "private";
|
|
19864
|
+
if (publicAccess && publicAccess !== "none") visibility = "public";
|
|
19865
|
+
return {
|
|
19866
|
+
id: doc.id,
|
|
19867
|
+
doc_id: doc.id,
|
|
19868
|
+
name: doc.label ?? doc.id,
|
|
19869
|
+
description: doc.description ?? null,
|
|
19870
|
+
visibility,
|
|
19871
|
+
is_hub: doc.is_hub ?? false,
|
|
19872
|
+
owner_id: doc.owner_id ?? null,
|
|
19873
|
+
created_at: 0,
|
|
19874
|
+
updated_at: doc.updated_at ?? 0,
|
|
19875
|
+
public_access: publicAccess ?? null
|
|
19876
|
+
};
|
|
19877
|
+
}
|
|
19847
19878
|
|
|
19848
19879
|
//#endregion
|
|
19849
19880
|
//#region packages/mcp/src/tools/tree.ts
|
|
@@ -22759,7 +22790,7 @@ var HookBridge = class {
|
|
|
22759
22790
|
}
|
|
22760
22791
|
onPostToolUse(payload) {
|
|
22761
22792
|
if ((payload.tool_name ?? "").startsWith("mcp__abracadabra__")) return;
|
|
22762
|
-
this.server.
|
|
22793
|
+
this.server.setAutoStatus("thinking");
|
|
22763
22794
|
}
|
|
22764
22795
|
onSubagentStart(payload) {
|
|
22765
22796
|
const agentType = payload.agent_type ?? "agent";
|
|
@@ -22770,7 +22801,7 @@ var HookBridge = class {
|
|
|
22770
22801
|
this.server.setAutoStatus("thinking");
|
|
22771
22802
|
}
|
|
22772
22803
|
onSubagentStop(_payload) {
|
|
22773
|
-
this.server.
|
|
22804
|
+
this.server.setAutoStatus("thinking");
|
|
22774
22805
|
}
|
|
22775
22806
|
onStop() {
|
|
22776
22807
|
this.server.setAutoStatus(null);
|