@ghl-ai/aw 0.1.44-beta.2 → 0.1.44-beta.3

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/c4/index.mjs CHANGED
@@ -35,6 +35,7 @@ export {
35
35
  REQUIRED_ENFORCEMENT_PHRASES,
36
36
  REQUIRED_STAGE_MARKERS_CLAUDE,
37
37
  REQUIRED_STAGE_MARKERS_CURSOR,
38
+ REQUIRED_MCP_FALLBACK_MARKERS,
38
39
  SLIM_CARD_CLAUDE,
39
40
  SLIM_CARD_CURSOR,
40
41
  buildSlimRouterCard,
package/c4/slimRouter.mjs CHANGED
@@ -47,6 +47,94 @@ export const REQUIRED_STAGE_MARKERS_CURSOR = [
47
47
  'Hard Gate',
48
48
  ];
49
49
 
50
+ /* MCP fallback markers — must be present on every cloud-harness card.
51
+ * Cursor Cloud only honors MCPs added via the dashboard; if the native
52
+ * `mcp_ghl-ai_*` surface is missing, the agent must reach ghl-ai via
53
+ * direct JSON-RPC over HTTP. These substrings let the slim-card validator
54
+ * fail loudly if a future edit accidentally drops the section. */
55
+ export const REQUIRED_MCP_FALLBACK_MARKERS = [
56
+ 'MCP fallback',
57
+ 'services.leadconnectorhq.com/agentic-workspace/mcp',
58
+ 'GITHUB_PAT',
59
+ 'Bearer',
60
+ 'tools/list',
61
+ 'tools/call',
62
+ 'text/event-stream',
63
+ ];
64
+
65
+ /* ─────────────────────────────────────────────────────────────────────────
66
+ * MCP fallback sections — appended to both slim cards. Cursor variant adds
67
+ * the dashboard-upgrade hint (cursor.com/agents); Claude variant omits it
68
+ * (Claude Code Web reads ~/.claude/settings.json::mcpServers natively).
69
+ * ───────────────────────────────────────────────────────────────────────── */
70
+
71
+ const MCP_FALLBACK_CURSOR = `
72
+ ## MCP fallback — cloud harness only (use ONLY if native MCP is missing)
73
+
74
+ \`aw c4\` registers \`ghl-ai\` in \`~/.cursor/mcp.json\`, but Cursor Cloud
75
+ agents only honor MCPs added via the dashboard
76
+ (\`cursor.com/dashboard?tab=integrations\` for Team plans, or the MCP
77
+ dropdown at \`cursor.com/agents\` for personal). When \`mcp_ghl-ai_*\`
78
+ tools are missing from your tool surface, fall back to direct HTTP
79
+ JSON-RPC.
80
+
81
+ - Endpoint: \`https://services.leadconnectorhq.com/agentic-workspace/mcp\`
82
+ - Headers: \`Authorization: Bearer $GITHUB_PAT\`,
83
+ \`Content-Type: application/json\`,
84
+ \`Accept: application/json, text/event-stream\`
85
+ - Protocol: JSON-RPC 2.0 — call \`tools/list\` to discover, then
86
+ \`tools/call\` with \`{ name, arguments }\`. SSE responses arrive as
87
+ \`data: <json>\` lines; parse the first JSON payload.
88
+
89
+ Example (list GKE clusters):
90
+
91
+ \`\`\`bash
92
+ curl -sS -X POST \\
93
+ https://services.leadconnectorhq.com/agentic-workspace/mcp \\
94
+ -H "Authorization: Bearer $GITHUB_PAT" \\
95
+ -H "Content-Type: application/json" \\
96
+ -H "Accept: application/json, text/event-stream" \\
97
+ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
98
+ "params":{"name":"gcp_kube-list-clusters",
99
+ "arguments":{"location":"-"}}}'
100
+ \`\`\`
101
+
102
+ Security: NEVER echo, log, or print \`$GITHUB_PAT\` — it is sensitive.
103
+ Use this fallback ONLY when the native MCP tools are unavailable.
104
+ `;
105
+
106
+ const MCP_FALLBACK_CLAUDE = `
107
+ ## MCP fallback (use ONLY if native MCP is missing)
108
+
109
+ \`aw c4\` registers \`ghl-ai\` in \`~/.claude/settings.json::mcpServers\`.
110
+ If the \`mcp_ghl-ai_*\` tool surface is unavailable in this runtime,
111
+ fall back to direct HTTP JSON-RPC.
112
+
113
+ - Endpoint: \`https://services.leadconnectorhq.com/agentic-workspace/mcp\`
114
+ - Headers: \`Authorization: Bearer $GITHUB_PAT\`,
115
+ \`Content-Type: application/json\`,
116
+ \`Accept: application/json, text/event-stream\`
117
+ - Protocol: JSON-RPC 2.0 — call \`tools/list\` to discover, then
118
+ \`tools/call\` with \`{ name, arguments }\`. SSE responses arrive as
119
+ \`data: <json>\` lines; parse the first JSON payload.
120
+
121
+ Example (list GKE clusters):
122
+
123
+ \`\`\`bash
124
+ curl -sS -X POST \\
125
+ https://services.leadconnectorhq.com/agentic-workspace/mcp \\
126
+ -H "Authorization: Bearer $GITHUB_PAT" \\
127
+ -H "Content-Type: application/json" \\
128
+ -H "Accept: application/json, text/event-stream" \\
129
+ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
130
+ "params":{"name":"gcp_kube-list-clusters",
131
+ "arguments":{"location":"-"}}}'
132
+ \`\`\`
133
+
134
+ Security: NEVER echo, log, or print \`$GITHUB_PAT\` — it is sensitive.
135
+ Use this fallback ONLY when the native MCP tools are unavailable.
136
+ `;
137
+
50
138
  /* ─────────────────────────────────────────────────────────────────────────
51
139
  * Card text — copied verbatim from spec.md::§"Slim card content".
52
140
  * Trailing newline is intentional: Claude/Cursor parse the file as a single
@@ -118,7 +206,7 @@ Platform rules live under \`.aw/.aw_rules/platform/\` — search in this order:
118
206
  \`~/.aw/.aw_registry/.aw_rules/platform/\`. Read \`universal/AGENTS.md\` and
119
207
  \`security/AGENTS.md\` first, then the touched-domain \`AGENTS.md\` plus
120
208
  \`references/*.md\` on demand.
121
- `;
209
+ ${MCP_FALLBACK_CLAUDE}`;
122
210
 
123
211
  export const SLIM_CARD_CURSOR = `# AW Router (Compact) — using-aw-skills
124
212
 
@@ -185,7 +273,7 @@ Platform rules live under \`.aw/.aw_rules/platform/\` — search in this order:
185
273
  \`~/.aw/.aw_registry/.aw_rules/platform/\`. Read \`universal/AGENTS.md\` and
186
274
  \`security/AGENTS.md\` first, then the touched-domain \`AGENTS.md\` plus
187
275
  \`references/*.md\` on demand.
188
- `;
276
+ ${MCP_FALLBACK_CURSOR}`;
189
277
 
190
278
  /* ─────────────────────────────────────────────────────────────────────────
191
279
  * Hook scripts — embedded as bash one-liners that emit fixed JSON envelopes.
@@ -276,6 +364,11 @@ export function buildSlimRouterCard(harness) {
276
364
  throw new Error(`Slim card for ${harness} missing stage marker: "${marker}"`);
277
365
  }
278
366
  }
367
+ for (const marker of REQUIRED_MCP_FALLBACK_MARKERS) {
368
+ if (!card.includes(marker)) {
369
+ throw new Error(`Slim card for ${harness} missing MCP fallback marker: "${marker}"`);
370
+ }
371
+ }
279
372
 
280
373
  return { card, bytes };
281
374
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.44-beta.2",
3
+ "version": "0.1.44-beta.3",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": {