@abraca/mcp 2.47.0 → 2.49.0

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.
@@ -12808,6 +12808,7 @@ const DISCONNECTED = {
12808
12808
  agentColor: "hsl(270, 80%, 60%)",
12809
12809
  getTreeMap: () => null,
12810
12810
  getTrashMap: () => null,
12811
+ refreshSpaces: async () => [],
12811
12812
  getDocSummary: () => null,
12812
12813
  getEnabledPluginNames: () => [],
12813
12814
  setActiveToolCall: () => {},
@@ -20298,6 +20299,21 @@ var AbracadabraMCPServer = class AbracadabraMCPServer {
20298
20299
  get spaces() {
20299
20300
  return this._spaces;
20300
20301
  }
20302
+ /**
20303
+ * Re-fetch the server's top-level `kind="space"` docs and refresh the
20304
+ * cached `_spaces` snapshot. {@link connect} only takes the snapshot once,
20305
+ * so a space created/seeded after connect (or removed) would otherwise stay
20306
+ * invisible to `list_spaces` until a full reconnect. Tools that surface the
20307
+ * space list should call this first so they reflect server truth.
20308
+ */
20309
+ async refreshSpaces() {
20310
+ if (!this.client) return this._spaces;
20311
+ try {
20312
+ const { spaces } = pickEntrySpace(await this.client.listChildren());
20313
+ this._spaces = spaces;
20314
+ } catch {}
20315
+ return this._spaces;
20316
+ }
20301
20317
  get rootDocument() {
20302
20318
  return this._activeConnection?.doc ?? null;
20303
20319
  }
@@ -22916,7 +22932,7 @@ function registerTreeTools(mcp, server, validator = null) {
22916
22932
  });
22917
22933
  mcp.tool("list_spaces", "List all Spaces available on the server. Spaces are top-level documents (direct children of the server root) tagged with kind=\"space\". Returns id, label, public_access, and active flag. Use switch_space to navigate.", {}, async () => {
22918
22934
  server.setActiveToolCall({ name: "list_spaces" });
22919
- const spaces = server.spaces;
22935
+ const spaces = await server.refreshSpaces();
22920
22936
  if (!spaces.length) return { content: [{
22921
22937
  type: "text",
22922
22938
  text: "No spaces available — create one to get started."