@lead-routing/cli 0.8.5 → 0.8.7

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/index.js CHANGED
@@ -300,8 +300,8 @@ function renderDockerCompose(c) {
300
300
  image: ghcr.io/atgatzby/lead-routing-mcp:latest
301
301
  restart: unless-stopped
302
302
  environment:
303
- APP_URL: http://web:3000
304
- ENGINE_URL: http://engine:3001
303
+ APP_URL: ${c.mcpAppUrl ?? "http://web:3000"}
304
+ ENGINE_URL: ${c.mcpEngineUrl ?? "http://engine:3001"}
305
305
  API_TOKEN: ${c.mcpApiToken ?? ""}
306
306
  WEBHOOK_SECRET: ${c.mcpWebhookSecret ?? ""}
307
307
  CRM_TYPE: ${c.mcpCrmType ?? "salesforce"}
@@ -610,6 +610,8 @@ function generateFiles(cfg, sshCfg, license = { licenseTier: "free" }, agentApi)
610
610
  langfuseSalt: agentApi?.langfuseSalt,
611
611
  managedMcp: !!agentApi,
612
612
  mcpUrl: cfg.mcpUrl,
613
+ mcpAppUrl: cfg.appUrl,
614
+ mcpEngineUrl: cfg.engineUrl,
613
615
  mcpWebhookSecret: cfg.engineWebhookSecret,
614
616
  mcpCrmType: cfg.crmType
615
617
  });
@@ -1703,6 +1705,21 @@ Click "Connect HubSpot" to authorize the integration.`,
1703
1705
  JSON.stringify(mcpConfig, null, 2),
1704
1706
  "utf-8"
1705
1707
  );
1708
+ if (apiToken) {
1709
+ try {
1710
+ const composePath = join5(dir, "docker-compose.yml");
1711
+ const composeContent = readFileSync4(composePath, "utf-8");
1712
+ const updated = composeContent.replace(
1713
+ /API_TOKEN:\s*.*/,
1714
+ `API_TOKEN: ${apiToken}`
1715
+ );
1716
+ writeFileSync4(composePath, updated, "utf-8");
1717
+ await uploadFiles(ssh, dir, remoteDir);
1718
+ await ssh.exec(`cd ${remoteDir} && docker compose up -d --force-recreate mcp 2>&1`);
1719
+ log7.success("MCP container updated with API token");
1720
+ } catch {
1721
+ }
1722
+ }
1706
1723
  note3(
1707
1724
  "Connect Lead Routing to Claude Code with one command:\n\n" + chalk2.cyan("claude mcp add lead-routing -- npx -y @lead-routing/mcp"),
1708
1725
  "Claude Code MCP"
@@ -0,0 +1,76 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "FlowStatus" AS ENUM ('DRAFT', 'ACTIVE', 'INACTIVE');
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "FlowNodeType" AS ENUM ('ENTRY', 'DECISION', 'BRANCH_DECISION', 'MATCH', 'ASSIGNMENT', 'UPDATE_FIELD', 'CREATE_TASK', 'FILTER', 'DEFAULT');
6
+
7
+ -- AlterTable
8
+ ALTER TABLE "organizations" ADD COLUMN "routingMode" JSONB;
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "routing_logs" ADD COLUMN "flowId" TEXT,
12
+ ADD COLUMN "flowNodePath" JSONB;
13
+
14
+ -- CreateTable
15
+ CREATE TABLE "routing_flows" (
16
+ "id" TEXT NOT NULL,
17
+ "orgId" TEXT NOT NULL,
18
+ "objectType" "SfdcObjectType" NOT NULL,
19
+ "name" TEXT NOT NULL DEFAULT 'Untitled Flow',
20
+ "status" "FlowStatus" NOT NULL DEFAULT 'DRAFT',
21
+ "triggerEvent" "TriggerEvent" NOT NULL DEFAULT 'BOTH',
22
+ "isDryRun" BOOLEAN NOT NULL DEFAULT false,
23
+ "version" INTEGER NOT NULL DEFAULT 1,
24
+ "publishedAt" TIMESTAMP(3),
25
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
26
+ "updatedAt" TIMESTAMP(3) NOT NULL,
27
+
28
+ CONSTRAINT "routing_flows_pkey" PRIMARY KEY ("id")
29
+ );
30
+
31
+ -- CreateTable
32
+ CREATE TABLE "flow_nodes" (
33
+ "id" TEXT NOT NULL,
34
+ "flowId" TEXT NOT NULL,
35
+ "type" "FlowNodeType" NOT NULL,
36
+ "label" TEXT,
37
+ "positionX" DOUBLE PRECISION NOT NULL DEFAULT 0,
38
+ "positionY" DOUBLE PRECISION NOT NULL DEFAULT 0,
39
+ "config" JSONB,
40
+ "sortOrder" INTEGER NOT NULL DEFAULT 0,
41
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
42
+ "updatedAt" TIMESTAMP(3) NOT NULL,
43
+
44
+ CONSTRAINT "flow_nodes_pkey" PRIMARY KEY ("id")
45
+ );
46
+
47
+ -- CreateTable
48
+ CREATE TABLE "flow_edges" (
49
+ "id" TEXT NOT NULL,
50
+ "flowId" TEXT NOT NULL,
51
+ "fromId" TEXT NOT NULL,
52
+ "toId" TEXT NOT NULL,
53
+ "label" TEXT,
54
+ "sortOrder" INTEGER NOT NULL DEFAULT 0,
55
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
56
+
57
+ CONSTRAINT "flow_edges_pkey" PRIMARY KEY ("id")
58
+ );
59
+
60
+ -- CreateIndex
61
+ CREATE UNIQUE INDEX "routing_flows_orgId_objectType_key" ON "routing_flows"("orgId", "objectType");
62
+
63
+ -- AddForeignKey
64
+ ALTER TABLE "routing_flows" ADD CONSTRAINT "routing_flows_orgId_fkey" FOREIGN KEY ("orgId") REFERENCES "organizations"("id") ON DELETE CASCADE ON UPDATE CASCADE;
65
+
66
+ -- AddForeignKey
67
+ ALTER TABLE "flow_nodes" ADD CONSTRAINT "flow_nodes_flowId_fkey" FOREIGN KEY ("flowId") REFERENCES "routing_flows"("id") ON DELETE CASCADE ON UPDATE CASCADE;
68
+
69
+ -- AddForeignKey
70
+ ALTER TABLE "flow_edges" ADD CONSTRAINT "flow_edges_flowId_fkey" FOREIGN KEY ("flowId") REFERENCES "routing_flows"("id") ON DELETE CASCADE ON UPDATE CASCADE;
71
+
72
+ -- AddForeignKey
73
+ ALTER TABLE "flow_edges" ADD CONSTRAINT "flow_edges_fromId_fkey" FOREIGN KEY ("fromId") REFERENCES "flow_nodes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
74
+
75
+ -- AddForeignKey
76
+ ALTER TABLE "flow_edges" ADD CONSTRAINT "flow_edges_toId_fkey" FOREIGN KEY ("toId") REFERENCES "flow_nodes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,3 @@
1
+ -- AlterTable
2
+ ALTER TABLE "flow_edges" ADD COLUMN "sourceHandle" TEXT;
3
+ ALTER TABLE "flow_edges" ADD COLUMN "targetHandle" TEXT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lead-routing/cli",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "Self-hosted deployment CLI for Lead Routing",
5
5
  "homepage": "https://github.com/lead-routing/lead-routing",
6
6
  "keywords": [