@miadi/stateloom-mcp 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/server.js +7 -2
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -47,6 +47,11 @@ import { resolveProjectSwitch } from "./projectSwitch.js";
47
47
  const BRIDGE_URL = envAlias("BRIDGE_URL");
48
48
  const AGENT_NAME = envAlias("AGENT_NAME");
49
49
  const BRIDGE_TOKEN = envAlias("BRIDGE_TOKEN");
50
+ // The canvas address for a document (chart_1785683055671): when the agent
51
+ // re-points the loom, the human gets a link to LOOK at the same document —
52
+ // the `?doc=` parameter is resolved and allowlist-guarded by the web side.
53
+ const CANVAS_URL = envAlias("CANVAS_URL") ?? `http://127.0.0.1:${envAlias("WEB_PORT") ?? "4598"}`;
54
+ const canvasLink = (path) => `${CANVAS_URL}/?doc=${encodeURIComponent(path)}`;
50
55
  // ─── File-backed shared store ────────────────────────────────────────
51
56
  // Both web/ and mcp/ resolve the same path from STATELOOM_PROJECT_FILE
52
57
  // (legacy twin SMCRAFT_PROJECT_FILE still honored).
@@ -808,7 +813,7 @@ function buildServer() {
808
813
  content: [
809
814
  {
810
815
  type: "text",
811
- text: `Active document: ${r.path}\nPrevious: ${r.previous}\n${summary}\n${bridgeNote}`,
816
+ text: `Active document: ${r.path}\nPrevious: ${r.previous}\n${summary}\n${bridgeNote}\nCanvas: ${canvasLink(r.path)}`,
812
817
  },
813
818
  ],
814
819
  };
@@ -832,7 +837,7 @@ function buildServer() {
832
837
  : "bridge not configured (STATELOOM_BRIDGE_URL unset)";
833
838
  return {
834
839
  content: [
835
- { type: "text", text: `Active document: ${PROJECT_FILE}\n${summary}\n${bridgeNote}` },
840
+ { type: "text", text: `Active document: ${PROJECT_FILE}\n${summary}\n${bridgeNote}\nCanvas: ${canvasLink(PROJECT_FILE)}` },
836
841
  ],
837
842
  };
838
843
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miadi/stateloom-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server for miadi-stateloom (formerly smcraft-mcp) — lets LLM agents design state machines through conversation",
5
5
  "repository": {
6
6
  "type": "git",