@superblocksteam/gateway 2.0.161 → 2.0.162-next.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.
- package/README.md +135 -39
- package/dist/capabilities/lifecycle.d.ts +46 -29
- package/dist/capabilities/lifecycle.js +1731 -843
- package/dist/capabilities/lifecycle.js.map +1 -1
- package/dist/capabilities/query-integration.d.ts +14 -0
- package/dist/capabilities/query-integration.js +172 -0
- package/dist/capabilities/query-integration.js.map +1 -0
- package/dist/capabilities/source-files-archive.d.ts +11 -0
- package/dist/capabilities/source-files-archive.js +54 -0
- package/dist/capabilities/source-files-archive.js.map +1 -0
- package/dist/capabilities/types.d.ts +197 -119
- package/dist/capabilities/types.js +45 -6
- package/dist/capabilities/types.js.map +1 -1
- package/dist/capture/browser-contract.d.ts +15 -5
- package/dist/capture/browser-contract.js +13 -3
- package/dist/capture/browser-contract.js.map +1 -1
- package/dist/capture/browser-instructions.d.ts +3 -2
- package/dist/capture/browser-instructions.js +3 -2
- package/dist/capture/browser-instructions.js.map +1 -1
- package/dist/capture/mode.d.ts +8 -1
- package/dist/capture/mode.js +22 -2
- package/dist/capture/mode.js.map +1 -1
- package/dist/config.d.ts +22 -23
- package/dist/config.js +13 -12
- package/dist/config.js.map +1 -1
- package/dist/deps.d.ts +7 -7
- package/dist/index.d.ts +2 -4
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/integrations/read-only-postgres-query.d.ts +2 -0
- package/dist/integrations/read-only-postgres-query.js +164 -0
- package/dist/integrations/read-only-postgres-query.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/playwright/ensure-chromium.d.ts +5 -7
- package/dist/playwright/ensure-chromium.js +13 -13
- package/dist/playwright/ensure-chromium.js.map +1 -1
- package/dist/preview/capture-screenshot.d.ts +30 -4
- package/dist/preview/capture-screenshot.js +67 -17
- package/dist/preview/capture-screenshot.js.map +1 -1
- package/dist/preview/viewer-url.js +3 -1
- package/dist/preview/viewer-url.js.map +1 -1
- package/dist/process/fault-barrier.js +1 -1
- package/dist/process/fault-barrier.js.map +1 -1
- package/dist/sabs/agent-facing-text.d.ts +2 -0
- package/dist/sabs/agent-facing-text.js +56 -2
- package/dist/sabs/agent-facing-text.js.map +1 -1
- package/dist/sabs/app-state.d.ts +126 -0
- package/dist/sabs/app-state.js +332 -0
- package/dist/sabs/app-state.js.map +1 -0
- package/dist/sabs/awaited-decision.d.ts +49 -0
- package/dist/sabs/awaited-decision.js +129 -0
- package/dist/sabs/awaited-decision.js.map +1 -0
- package/dist/sabs/editor-client-methods.d.ts +23 -5
- package/dist/sabs/editor-client-methods.js +45 -4
- package/dist/sabs/editor-client-methods.js.map +1 -1
- package/dist/sabs/editor-socket.d.ts +85 -0
- package/dist/sabs/editor-socket.js +67 -0
- package/dist/sabs/editor-socket.js.map +1 -0
- package/dist/sabs/session-peer.d.ts +119 -82
- package/dist/sabs/session-peer.js +10 -1
- package/dist/sabs/session-peer.js.map +1 -1
- package/dist/sabs/streamed-reply.d.ts +45 -0
- package/dist/sabs/streamed-reply.js +125 -0
- package/dist/sabs/streamed-reply.js.map +1 -0
- package/dist/sabs/turn-collector.d.ts +50 -35
- package/dist/sabs/turn-collector.js +110 -176
- package/dist/sabs/turn-collector.js.map +1 -1
- package/dist/sabs/websocket-session-peer.d.ts +104 -69
- package/dist/sabs/websocket-session-peer.js +1329 -475
- package/dist/sabs/websocket-session-peer.js.map +1 -1
- package/dist/server/client.d.ts +41 -9
- package/dist/server/client.js +126 -21
- package/dist/server/client.js.map +1 -1
- package/dist/start.d.ts +1 -1
- package/dist/start.js +30 -8
- package/dist/start.js.map +1 -1
- package/dist/stores/memory.d.ts +46 -0
- package/dist/stores/memory.js +163 -0
- package/dist/stores/memory.js.map +1 -0
- package/dist/stores/types.d.ts +92 -0
- package/dist/stores/types.js +11 -0
- package/dist/stores/types.js.map +1 -0
- package/dist/telemetry/mcp-client.d.ts +6 -1
- package/dist/telemetry/mcp-client.js +100 -4
- package/dist/telemetry/mcp-client.js.map +1 -1
- package/dist/telemetry/metrics.d.ts +12 -3
- package/dist/telemetry/metrics.js +60 -14
- package/dist/telemetry/metrics.js.map +1 -1
- package/dist/telemetry/runtime.js +4 -6
- package/dist/telemetry/runtime.js.map +1 -1
- package/dist/transports/mcp/admin-tools.d.ts +8 -0
- package/dist/transports/mcp/admin-tools.js +115 -4
- package/dist/transports/mcp/admin-tools.js.map +1 -1
- package/dist/transports/mcp/app-status-html.d.ts +4 -8
- package/dist/transports/mcp/app-status-html.js +336 -128
- package/dist/transports/mcp/app-status-html.js.map +1 -1
- package/dist/transports/mcp/client-presentation.d.ts +16 -0
- package/dist/transports/mcp/client-presentation.js +13 -0
- package/dist/transports/mcp/client-presentation.js.map +1 -0
- package/dist/transports/mcp/cowork-editor-url.d.ts +6 -0
- package/dist/transports/mcp/cowork-editor-url.js +10 -0
- package/dist/transports/mcp/cowork-editor-url.js.map +1 -0
- package/dist/transports/mcp/decision-card-html.d.ts +26 -0
- package/dist/transports/mcp/decision-card-html.js +876 -0
- package/dist/transports/mcp/decision-card-html.js.map +1 -0
- package/dist/transports/mcp/decision-elicitation.d.ts +42 -0
- package/dist/transports/mcp/decision-elicitation.js +59 -0
- package/dist/transports/mcp/decision-elicitation.js.map +1 -1
- package/dist/transports/mcp/editor-document-probe.d.ts +4 -0
- package/dist/transports/mcp/editor-document-probe.js +35 -0
- package/dist/transports/mcp/editor-document-probe.js.map +1 -0
- package/dist/transports/mcp/editor-integration-setup-url.d.ts +14 -0
- package/dist/transports/mcp/editor-integration-setup-url.js +29 -0
- package/dist/transports/mcp/editor-integration-setup-url.js.map +1 -0
- package/dist/transports/mcp/format-tool-content.d.ts +13 -18
- package/dist/transports/mcp/format-tool-content.js +172 -13
- package/dist/transports/mcp/format-tool-content.js.map +1 -1
- package/dist/transports/mcp/instructions/index.d.ts +23 -0
- package/dist/transports/mcp/instructions/index.js +81 -0
- package/dist/transports/mcp/instructions/index.js.map +1 -0
- package/dist/transports/mcp/instructions/result.d.ts +18 -0
- package/dist/transports/mcp/instructions/result.js +58 -0
- package/dist/transports/mcp/instructions/result.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/ask-user.d.ts +2 -0
- package/dist/transports/mcp/instructions/tools/ask-user.js +20 -0
- package/dist/transports/mcp/instructions/tools/ask-user.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/build-app.d.ts +4 -0
- package/dist/transports/mcp/instructions/tools/build-app.js +54 -0
- package/dist/transports/mcp/instructions/tools/build-app.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/check-app-progress.d.ts +3 -0
- package/dist/transports/mcp/instructions/tools/check-app-progress.js +79 -0
- package/dist/transports/mcp/instructions/tools/check-app-progress.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/check-publish-progress.d.ts +3 -0
- package/dist/transports/mcp/instructions/tools/check-publish-progress.js +23 -0
- package/dist/transports/mcp/instructions/tools/check-publish-progress.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/copy.d.ts +18 -0
- package/dist/transports/mcp/instructions/tools/copy.js +49 -0
- package/dist/transports/mcp/instructions/tools/copy.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/create-integration.d.ts +4 -0
- package/dist/transports/mcp/instructions/tools/create-integration.js +41 -0
- package/dist/transports/mcp/instructions/tools/create-integration.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/edit-app.d.ts +3 -0
- package/dist/transports/mcp/instructions/tools/edit-app.js +18 -0
- package/dist/transports/mcp/instructions/tools/edit-app.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/get-app.d.ts +3 -0
- package/dist/transports/mcp/instructions/tools/get-app.js +49 -0
- package/dist/transports/mcp/instructions/tools/get-app.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/get-integration-metadata.d.ts +2 -0
- package/dist/transports/mcp/instructions/tools/get-integration-metadata.js +13 -0
- package/dist/transports/mcp/instructions/tools/get-integration-metadata.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/index.d.ts +7 -0
- package/dist/transports/mcp/instructions/tools/index.js +31 -0
- package/dist/transports/mcp/instructions/tools/index.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/publish-app.d.ts +3 -0
- package/dist/transports/mcp/instructions/tools/publish-app.js +23 -0
- package/dist/transports/mcp/instructions/tools/publish-app.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/start-app.d.ts +3 -0
- package/dist/transports/mcp/instructions/tools/start-app.js +22 -0
- package/dist/transports/mcp/instructions/tools/start-app.js.map +1 -0
- package/dist/transports/mcp/instructions/tools/upload-artifact.d.ts +2 -0
- package/dist/transports/mcp/instructions/tools/upload-artifact.js +13 -0
- package/dist/transports/mcp/instructions/tools/upload-artifact.js.map +1 -0
- package/dist/transports/mcp/mcp-app-brand-css.d.ts +1 -0
- package/dist/transports/mcp/mcp-app-brand-css.js +180 -0
- package/dist/transports/mcp/mcp-app-brand-css.js.map +1 -0
- package/dist/transports/mcp/mount.d.ts +14 -1
- package/dist/transports/mcp/mount.js +729 -172
- package/dist/transports/mcp/mount.js.map +1 -1
- package/dist/transports/mcp/native-browser-presence.d.ts +45 -0
- package/dist/transports/mcp/native-browser-presence.js +158 -0
- package/dist/transports/mcp/native-browser-presence.js.map +1 -0
- package/dist/transports/mcp/plan-approval.d.ts +44 -0
- package/dist/transports/mcp/plan-approval.js +179 -0
- package/dist/transports/mcp/plan-approval.js.map +1 -0
- package/dist/transports/mcp/session-directory.d.ts +7 -0
- package/dist/transports/mcp/session-directory.js +18 -0
- package/dist/transports/mcp/session-directory.js.map +1 -0
- package/dist/transports/mcp/tool-names.d.ts +2 -0
- package/dist/transports/mcp/tool-names.js +2 -0
- package/dist/transports/mcp/tool-names.js.map +1 -0
- package/package.json +16 -7
- package/skills/superblocks-build/SKILL.md +59 -0
- package/skills/superblocks-import/SKILL.md +125 -0
- package/dist/capabilities/import-prompt.d.ts +0 -11
- package/dist/capabilities/import-prompt.js +0 -96
- package/dist/capabilities/import-prompt.js.map +0 -1
- package/dist/capabilities/persisted-progress.d.ts +0 -46
- package/dist/capabilities/persisted-progress.js +0 -246
- package/dist/capabilities/persisted-progress.js.map +0 -1
- package/dist/events/cursor.d.ts +0 -43
- package/dist/events/cursor.js +0 -78
- package/dist/events/cursor.js.map +0 -1
- package/dist/events/memory-event-store.d.ts +0 -34
- package/dist/events/memory-event-store.js +0 -110
- package/dist/events/memory-event-store.js.map +0 -1
- package/dist/events/merge.d.ts +0 -23
- package/dist/events/merge.js +0 -97
- package/dist/events/merge.js.map +0 -1
- package/dist/events/normalized-collector.d.ts +0 -62
- package/dist/events/normalized-collector.js +0 -156
- package/dist/events/normalized-collector.js.map +0 -1
- package/dist/events/schema.d.ts +0 -9
- package/dist/events/schema.js +0 -93
- package/dist/events/schema.js.map +0 -1
- package/dist/events/snapshot.d.ts +0 -32
- package/dist/events/snapshot.js +0 -57
- package/dist/events/snapshot.js.map +0 -1
- package/dist/events/stream-key.d.ts +0 -2
- package/dist/events/stream-key.js +0 -31
- package/dist/events/stream-key.js.map +0 -1
- package/dist/events/types.d.ts +0 -179
- package/dist/events/types.js +0 -66
- package/dist/events/types.js.map +0 -1
- package/dist/resume/memory-progress-store.d.ts +0 -39
- package/dist/resume/memory-progress-store.js +0 -82
- package/dist/resume/memory-progress-store.js.map +0 -1
- package/dist/resume/memory-recent-app-store.d.ts +0 -14
- package/dist/resume/memory-recent-app-store.js +0 -27
- package/dist/resume/memory-recent-app-store.js.map +0 -1
- package/dist/resume/memory-turn-store.d.ts +0 -18
- package/dist/resume/memory-turn-store.js +0 -73
- package/dist/resume/memory-turn-store.js.map +0 -1
- package/dist/resume/progress-key.d.ts +0 -21
- package/dist/resume/progress-key.js +0 -58
- package/dist/resume/progress-key.js.map +0 -1
- package/dist/resume/stores.d.ts +0 -14
- package/dist/resume/stores.js +0 -18
- package/dist/resume/stores.js.map +0 -1
- package/dist/resume/types.d.ts +0 -124
- package/dist/resume/types.js +0 -13
- package/dist/resume/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Standalone Superblocks entry point for a **single MCP connector** (Admin + Builder)
|
|
4
4
|
over **stdio**, running as the already-logged-in Superblocks CLI user.
|
|
5
5
|
|
|
6
|
-
Builder tools (`
|
|
7
|
-
`
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
Builder tools (`upload_artifact`, `start_app`, `edit_app`,
|
|
7
|
+
`check_app_progress`, `ask_user`, `get_app`, `build_app`,
|
|
8
|
+
`get_preview_status`, `get_integration_metadata`, `publish_app`) plus customer
|
|
9
|
+
Admin tools from `@superblocksteam/mcp-server` share this process.
|
|
10
|
+
|
|
11
|
+
The MCP host owns process lifecycle: it spawns `superblocks mcp serve`. The
|
|
12
|
+
unified Gateway has no foreground HTTP `/mcp`, no OAuth resource server, and no
|
|
13
|
+
linked-grant exchange. Personal API keys here are the CLI session
|
|
13
14
|
(`~/.superblocks/auth.json` / `SUPERBLOCKS_AUTH_FILE` / `just worktree auth`).
|
|
14
15
|
|
|
15
16
|
Scope notes:
|
|
@@ -22,6 +23,56 @@ Scope notes:
|
|
|
22
23
|
- No Slack wrapper (ENG-5596).
|
|
23
24
|
- Orchestrator URL is discovered from Server agent inventory, not configured here.
|
|
24
25
|
|
|
26
|
+
## Claude Code plugin
|
|
27
|
+
|
|
28
|
+
Add the Superblocks marketplace and install the plugin from inside Claude Code:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
/plugin marketplace add https://unpkg.com/@superblocksteam/cli@beta/.claude-plugin/marketplace.json
|
|
32
|
+
/plugin install superblocks@superblocks
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The plugin includes Gateway and the `superblocks-import` skill. When prompted,
|
|
36
|
+
enter a Superblocks personal API key and your Superblocks instance URL. Claude
|
|
37
|
+
stores the API key in secure storage. The npm-backed plugin requires Node.js 24
|
|
38
|
+
or newer and npm 10 or newer.
|
|
39
|
+
|
|
40
|
+
## Claude Cowork plugin
|
|
41
|
+
|
|
42
|
+
For a local desktop Cowork session:
|
|
43
|
+
|
|
44
|
+
1. Install Node.js 24 or newer and npm 10 or newer.
|
|
45
|
+
2. Download [the Cowork plugin](https://unpkg.com/@superblocksteam/cli@beta/dist/superblocks.plugin).
|
|
46
|
+
3. Open `Customize > Plugins`, choose upload, and select the plugin file.
|
|
47
|
+
4. Enter a Superblocks personal API key and your Superblocks instance URL.
|
|
48
|
+
|
|
49
|
+
The plugin starts Gateway on the desktop. It is unavailable in cloud Cowork
|
|
50
|
+
sessions, which cannot run local MCP servers.
|
|
51
|
+
|
|
52
|
+
### Organization-managed rollout
|
|
53
|
+
|
|
54
|
+
Owners and Primary Owners on Team and Enterprise plans can distribute the
|
|
55
|
+
plugin from `Organization settings > Plugins`:
|
|
56
|
+
|
|
57
|
+
1. Enable Cowork and Skills for the organization.
|
|
58
|
+
2. Save a copy of `superblocks.plugin` with a `.zip` suffix. Organization
|
|
59
|
+
uploads require a valid `.zip` smaller than 50 MB.
|
|
60
|
+
3. Choose `Add plugins > Upload a file`, then create a marketplace or add the
|
|
61
|
+
archive to an existing one.
|
|
62
|
+
4. Set the plugin to `Installed by default` or `Required` and confirm its
|
|
63
|
+
version in the marketplace.
|
|
64
|
+
|
|
65
|
+
Upload a new archive with the same plugin name to replace the current version.
|
|
66
|
+
Members receive it on their next session or plugin refresh. To deprecate it, set
|
|
67
|
+
it to `Not available`; to remove it, delete it from the marketplace. Rollback
|
|
68
|
+
behavior is not documented by Anthropic; validate re-uploading a retained older
|
|
69
|
+
archive in a test marketplace before relying on it.
|
|
70
|
+
|
|
71
|
+
Superblocks supplies the archive and Gateway runtime. Claude organization Owners
|
|
72
|
+
control marketplace distribution and installation policy. Each member supplies
|
|
73
|
+
their Superblocks credentials; each desktop still needs Node.js, npm, and
|
|
74
|
+
permission to run local MCP servers. See [Anthropic's organization plugin guide](https://support.claude.com/en/articles/13837433-manage-plugins-for-your-organization).
|
|
75
|
+
|
|
25
76
|
## Internal review
|
|
26
77
|
|
|
27
78
|
```bash
|
|
@@ -29,26 +80,38 @@ Scope notes:
|
|
|
29
80
|
superblocks login
|
|
30
81
|
|
|
31
82
|
# Write a stdio MCP entry into the client config
|
|
32
|
-
superblocks
|
|
83
|
+
superblocks mcp setup --client claude
|
|
33
84
|
# or: --client cursor / --client claude-desktop / --client generic
|
|
34
85
|
|
|
35
|
-
# Restart the MCP host. It spawns Gateway; do not run
|
|
86
|
+
# Restart the MCP host. It spawns Gateway; do not run mcp serve yourself.
|
|
36
87
|
```
|
|
37
88
|
|
|
89
|
+
`--client claude` also copies `skills/superblocks-import/SKILL.md` to
|
|
90
|
+
`~/.claude/skills/superblocks-import/`. `--client cursor` copies it to
|
|
91
|
+
`~/.cursor/skills/superblocks-import/`. Claude Desktop and generic clients
|
|
92
|
+
have no Agent Skills dir; they rely on the short MCP migration fallback.
|
|
93
|
+
Restart the host after setup so skills reload.
|
|
94
|
+
|
|
38
95
|
`setup` writes an absolute spawn so the host does not depend on cwd.
|
|
39
96
|
Published `bin/run.js` is the MCP `command` (its `node` shebang applies).
|
|
40
97
|
Worktree `bin/dev.js` is launched with `tsx` and without `--watch`: the
|
|
41
98
|
dev shebang is a file-watcher, which would kill stdio on source edits and
|
|
42
|
-
corrupt JSON-RPC on stdout. When `SUPERBLOCKS_AUTH_FILE`
|
|
43
|
-
|
|
44
|
-
`
|
|
99
|
+
corrupt JSON-RPC on stdout. When `SUPERBLOCKS_AUTH_FILE` is set (worktree
|
|
100
|
+
auth), it is copied into the MCP `env` block. Gateway derives both control
|
|
101
|
+
plane and remote UI URLs from `superblocksBaseUrl` in that auth file.
|
|
45
102
|
|
|
46
|
-
Optional:
|
|
47
|
-
captures. Omit it;
|
|
103
|
+
Optional: `mcp setup --with-screenshots` downloads Playwright Chromium for
|
|
104
|
+
preview captures. Omit it; MCP setup still succeeds.
|
|
48
105
|
|
|
49
106
|
## Local run
|
|
50
107
|
|
|
51
|
-
The MCP host spawns Gateway. Do not run `
|
|
108
|
+
The MCP host spawns Gateway's default stdio transport. Do not run `mcp serve`
|
|
109
|
+
without `--transport http` in a TTY. The legacy Admin-only HTTP transport
|
|
110
|
+
remains available for compatibility:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
SUPERBLOCKS_MCP_HTTP_TOKEN=<token> superblocks mcp serve --transport http --port 8484
|
|
114
|
+
```
|
|
52
115
|
|
|
53
116
|
Against a remote Superblocks domain (EE / SaaS IR):
|
|
54
117
|
|
|
@@ -56,13 +119,14 @@ Against a remote Superblocks domain (EE / SaaS IR):
|
|
|
56
119
|
cd packages/cli/packages/cli
|
|
57
120
|
./bin/dev.js config set domain <host>
|
|
58
121
|
./bin/dev.js login
|
|
59
|
-
./bin/dev.js
|
|
122
|
+
./bin/dev.js mcp setup --client claude
|
|
60
123
|
```
|
|
61
124
|
|
|
62
125
|
Against a local control plane, start the stack first (`just up <worktree>`),
|
|
63
|
-
then login and `
|
|
126
|
+
then login and `mcp setup` the same way.
|
|
64
127
|
|
|
65
|
-
`superblocks
|
|
128
|
+
The standalone `superblocks-mcp` Admin-only server is deprecated; prefer
|
|
129
|
+
`superblocks mcp setup`.
|
|
66
130
|
|
|
67
131
|
## Worktree MCP (Cursor / Claude)
|
|
68
132
|
|
|
@@ -73,7 +137,7 @@ Log in and run setup from the worktree CLI (not a globally installed `superblock
|
|
|
73
137
|
cd packages/cli/packages/cli
|
|
74
138
|
./bin/dev.js config set domain <host>
|
|
75
139
|
./bin/dev.js login
|
|
76
|
-
./bin/dev.js
|
|
140
|
+
./bin/dev.js mcp setup --client cursor
|
|
77
141
|
# or: --client claude
|
|
78
142
|
```
|
|
79
143
|
|
|
@@ -87,12 +151,11 @@ for Cursor, `~/.claude.json` for Claude Code):
|
|
|
87
151
|
"command": "/absolute/path/to/tsx/cli.mjs",
|
|
88
152
|
"args": [
|
|
89
153
|
"/absolute/path/to/packages/cli/packages/cli/bin/dev.js",
|
|
90
|
-
"
|
|
154
|
+
"mcp",
|
|
91
155
|
"serve"
|
|
92
156
|
],
|
|
93
157
|
"env": {
|
|
94
|
-
"SUPERBLOCKS_AUTH_FILE": "/absolute/path/to/worktree/.superblocks/auth.json"
|
|
95
|
-
"SUPERBLOCKS_BASE_URL": "https://your-control-plane"
|
|
158
|
+
"SUPERBLOCKS_AUTH_FILE": "/absolute/path/to/worktree/.superblocks/auth.json"
|
|
96
159
|
}
|
|
97
160
|
}
|
|
98
161
|
}
|
|
@@ -101,8 +164,9 @@ for Cursor, `~/.claude.json` for Claude Code):
|
|
|
101
164
|
|
|
102
165
|
`command` is `tsx` without `--watch`: the `bin/dev.js` shebang is a file
|
|
103
166
|
watcher, which would kill stdio on source edits and corrupt JSON-RPC on
|
|
104
|
-
stdout. `env` only copies the CLI session
|
|
105
|
-
`
|
|
167
|
+
stdout. `env` only copies the worktree CLI session path
|
|
168
|
+
(`SUPERBLOCKS_AUTH_FILE`). Gateway reads `superblocksBaseUrl` from that file.
|
|
169
|
+
Do not add `SUPERBLOCKS_GATEWAY_FROM_SOURCE`.
|
|
106
170
|
Optional stderr tees (`2>> ~/.cursor/superblocks-gateway.err`) are host
|
|
107
171
|
specific; `setup` does not write them.
|
|
108
172
|
|
|
@@ -146,11 +210,43 @@ package only the customer Admin surface. Builder tools are not registered.
|
|
|
146
210
|
|
|
147
211
|
## MCP tools
|
|
148
212
|
|
|
149
|
-
After `
|
|
150
|
-
`edit_app`, `check_app_progress`, `
|
|
151
|
-
`
|
|
152
|
-
|
|
153
|
-
|
|
213
|
+
After `mcp setup`, restart Claude Code or Cursor and call `upload_artifact`,
|
|
214
|
+
`start_app`, `edit_app`, `check_app_progress`, `ask_user`, `get_app`,
|
|
215
|
+
`build_app`, `get_preview_status`, `get_integration_metadata`, and
|
|
216
|
+
`publish_app`.
|
|
217
|
+
|
|
218
|
+
`upload_artifact` accepts any file the gateway can read through `filePath` -
|
|
219
|
+
an archive, an image, a PDF, or a log - or source the MCP client is writing out
|
|
220
|
+
itself through `files: [{ path, content }]`. `files` is archived as text, so
|
|
221
|
+
binary belongs on the `filePath` route, where the bytes never pass through the
|
|
222
|
+
model. Pass its returned artifact to `start_app` or `edit_app`; retries reuse
|
|
223
|
+
the same artifact and application IDs.
|
|
224
|
+
|
|
225
|
+
`ask_user` is what a turn ending on a plan or a question goes through. Hosts
|
|
226
|
+
with form elicitation never need it - `check_app_progress` puts the decision as
|
|
227
|
+
a native picker and answers Superblocks itself. Hosts without one (Claude
|
|
228
|
+
Desktop) get an MCP App: the plan with Build it / Change something beside it, or
|
|
229
|
+
the question with a button per option. The answer is posted back as the user's
|
|
230
|
+
own message (`ui/message`), so the host's agent loop continues as if they had
|
|
231
|
+
typed it. The decision is in the tool result as data either way, and the server
|
|
232
|
+
instructions require the host to write it out in chat as well - a host that
|
|
233
|
+
renders the card shows it instead of the tool text, and one that renders nothing
|
|
234
|
+
shows only the text.
|
|
235
|
+
|
|
236
|
+
`get_app` returns the current live development view without creating a commit or
|
|
237
|
+
starting a build. `build_app` is the explicit versioned-preview operation: use
|
|
238
|
+
it only when the user asks to build a commit preview, never automatically after
|
|
239
|
+
`start_app`, `edit_app`, or `get_app`. It creates a commit and starts or reuses
|
|
240
|
+
the build for that content, but does not publish the app or change its
|
|
241
|
+
permissions. If it returns `building`, carry its `applicationId`, `commitId`,
|
|
242
|
+
`directoryHash`, and optional `branch` into `get_preview_status`; do not call
|
|
243
|
+
`build_app` again to poll. The original `previewUrl` is the URL to use once the
|
|
244
|
+
status becomes `ready`. Call `publish_app` only when the user explicitly asks
|
|
245
|
+
to deploy the app.
|
|
246
|
+
|
|
247
|
+
`get_integration_metadata` reads tables, columns, and types from a connected
|
|
248
|
+
integration; use `search`, `limit`, and `offset` for large results. It needs no
|
|
249
|
+
application: without one it mints an
|
|
154
250
|
`integrations:build` token scoped to that single integration. Pass
|
|
155
251
|
`applicationId` only for an integration owned by one application, such as a
|
|
156
252
|
Native DB, which is invisible without app context.
|
|
@@ -159,25 +255,25 @@ the org-wide lookup by id, so it answers `integration_not_permitted` without
|
|
|
159
255
|
build permission on that integration and `integration_not_supported` for a
|
|
160
256
|
plugin Clark cannot use as a tool.
|
|
161
257
|
`get_integration_config_schema` is the create-integration form, not live data.
|
|
162
|
-
See `.env.example` for optional configuration.
|
|
163
258
|
|
|
164
259
|
## Env
|
|
165
260
|
|
|
166
261
|
See `.env.example`. Stores are in-memory only. Identity comes from the CLI
|
|
167
262
|
session, not from these variables.
|
|
168
263
|
|
|
169
|
-
| Variable
|
|
170
|
-
|
|
|
171
|
-
| `SUPERBLOCKS_SERVER_URL`
|
|
172
|
-
| `GATEWAY_PROFILE_KEY`
|
|
173
|
-
| `GATEWAY_LOCAL_AGENT`
|
|
174
|
-
| `GATEWAY_ADMIN_TOOLS_ONLY`
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
264
|
+
| Variable | Purpose |
|
|
265
|
+
| ---------------------------- | ---------------------------------------------------------- |
|
|
266
|
+
| `SUPERBLOCKS_SERVER_URL` | Control plane URL (default from `auth.json` or localhost). |
|
|
267
|
+
| `GATEWAY_PROFILE_KEY` | Integration profile key (default `default`). |
|
|
268
|
+
| `GATEWAY_LOCAL_AGENT` | Cloud-Prem laptop agent mode. |
|
|
269
|
+
| `GATEWAY_ADMIN_TOOLS_ONLY` | Admin tools only; skip Builder surface. |
|
|
270
|
+
| `GATEWAY_IMPORT_SEARCH_DIRS` | Fallback folders for bare or sandbox attachment paths. |
|
|
271
|
+
| `SUPERBLOCKS_AUTH_FILE` | Worktree-local CLI session (from `just worktree auth`). |
|
|
272
|
+
| `NODE_DEBUG=gateway` | Tool call stacks and conditional-flow logs on stderr. |
|
|
177
273
|
|
|
178
274
|
Gateway debug logs include tool names, result states, decision branches, and
|
|
179
275
|
entry-point stacks. They intentionally omit credentials, prompts, answers, and
|
|
180
|
-
result payloads. Run `superblocks
|
|
276
|
+
result payloads. Run `superblocks mcp setup --client <client> --debug`, then
|
|
181
277
|
restart the MCP host. Re-run setup without `--debug` to turn them off.
|
|
182
278
|
|
|
183
279
|
## Remote traceability
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
+
import { type HostBrowserTools } from "../capture/browser-contract.js";
|
|
1
2
|
import type { CaptureLibraryScreenshot } from "../capture/capture-library.js";
|
|
2
3
|
import type { GatewayConfig } from "../config.js";
|
|
3
|
-
import type
|
|
4
|
-
import type {
|
|
5
|
-
import
|
|
6
|
-
import type { SessionPeer } from "../sabs/session-peer.js";
|
|
4
|
+
import { type CapturePreviewScreenshot } from "../preview/capture-screenshot.js";
|
|
5
|
+
import type { AppState } from "../sabs/app-state.js";
|
|
6
|
+
import { type SessionPeer } from "../sabs/session-peer.js";
|
|
7
7
|
import type { SuperblocksServerClient } from "../server/client.js";
|
|
8
|
-
import type {
|
|
8
|
+
import type { ProgressStore, RecentAppStore, StepUpTurnStore } from "../stores/types.js";
|
|
9
|
+
import type { CapabilityResult, CheckAppProgressInput, CheckAppProgressResult, CheckPublishProgressInput, EditAppInput, EditAppResult, AskUserInput, AskUserResult, GetAppInput, GetAppResult, PreviewAppInput, PreviewAppResult, PreviewStatusInput, PreviewStatusResult, Principal, ProgressEvent, PublishAppInput, PublishAppResult, ResolvedPrincipal, StartAppInput, StartAppResult, UploadArtifactInput, UploadArtifactResult } from "./types.js";
|
|
9
10
|
export { IMPORT_ZIP_MAX_BYTES } from "./types.js";
|
|
10
11
|
export type CapabilityContext = {
|
|
11
|
-
/**
|
|
12
|
-
* Who is polling, for resume. Absent on one-shot capability calls that do
|
|
13
|
-
* not poll, in which case no cursor is kept.
|
|
14
|
-
*/
|
|
15
|
-
caller?: CallerRef;
|
|
16
12
|
config: GatewayConfig;
|
|
17
|
-
/**
|
|
18
|
-
* Durable history of the live-edit session. This is what a caller reads
|
|
19
|
-
* when there is no local turn to ask — after a restart, on another replica,
|
|
20
|
-
* or from a channel that never started the build.
|
|
21
|
-
*/
|
|
22
|
-
events?: EventStore;
|
|
23
|
-
/** Injected so pacing and stall thresholds are testable without real time. */
|
|
13
|
+
/** Injected so turn and stall thresholds are testable without real time. */
|
|
24
14
|
now?: () => number;
|
|
25
15
|
onProgress?: (event: ProgressEvent) => void;
|
|
26
16
|
onPrincipalResolved?: (principal: ResolvedPrincipal) => void;
|
|
27
17
|
principal: Principal;
|
|
28
|
-
/**
|
|
29
|
-
|
|
18
|
+
/** Per-application facts that outlive any one turn. */
|
|
19
|
+
appState: AppState;
|
|
20
|
+
/** When each build last spoke, and whether its silence was reported. */
|
|
21
|
+
progress?: ProgressStore;
|
|
30
22
|
recentApps: RecentAppStore;
|
|
31
23
|
/**
|
|
32
24
|
* Optional headless capture of the live library iframe (pitcherURL). Injected
|
|
@@ -39,11 +31,16 @@ export type CapabilityContext = {
|
|
|
39
31
|
* Injected in tests; defaults to Playwright in the MCP transport.
|
|
40
32
|
*/
|
|
41
33
|
capturePreviewScreenshot?: CapturePreviewScreenshot;
|
|
34
|
+
/**
|
|
35
|
+
* What the connected host can drive a browser with. Only a transport knows
|
|
36
|
+
* which client it is talking to; absent, the contract says "unknown".
|
|
37
|
+
*/
|
|
38
|
+
hostBrowserTools?: HostBrowserTools;
|
|
42
39
|
server: SuperblocksServerClient;
|
|
43
40
|
sessionPeer: SessionPeer;
|
|
44
41
|
/** The caller gave up on this call (an MCP cancellation, a closed request). */
|
|
45
42
|
signal?: AbortSignal;
|
|
46
|
-
|
|
43
|
+
stepUpTurns: StepUpTurnStore;
|
|
47
44
|
};
|
|
48
45
|
/**
|
|
49
46
|
* Resolves the Superblocks user behind the CLI session this Gateway was
|
|
@@ -54,16 +51,19 @@ export type CapabilityContext = {
|
|
|
54
51
|
* so it surfaces as an error rather than an interactive-auth elicitation.
|
|
55
52
|
*/
|
|
56
53
|
export declare function ensurePrincipal(ctx: CapabilityContext): Promise<CapabilityResult<ResolvedPrincipal>>;
|
|
57
|
-
export declare function resolveApplicationId(ctx: CapabilityContext, principal: ResolvedPrincipal, applicationId: string | undefined
|
|
58
|
-
export declare function startApp(ctx: CapabilityContext, input: StartAppInput): Promise<CapabilityResult<StartAppResult>>;
|
|
54
|
+
export declare function resolveApplicationId(ctx: CapabilityContext, principal: ResolvedPrincipal, applicationId: string | undefined,
|
|
59
55
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
56
|
+
* `unambiguous` declines to guess while a second application is also in
|
|
57
|
+
* play. Reserved for calls that write: acting on the wrong application is
|
|
58
|
+
* cheap to undo for a status poll and not cheap at all for an edit.
|
|
63
59
|
*/
|
|
64
|
-
|
|
60
|
+
options?: {
|
|
61
|
+
unambiguous?: boolean;
|
|
62
|
+
}): Promise<CapabilityResult<string>>;
|
|
63
|
+
export declare function startApp(ctx: CapabilityContext, input: StartAppInput): Promise<CapabilityResult<StartAppResult>>;
|
|
64
|
+
export declare function uploadArtifact(ctx: CapabilityContext, input: UploadArtifactInput): Promise<CapabilityResult<UploadArtifactResult>>;
|
|
65
65
|
export declare function checkAppProgress(ctx: CapabilityContext, input: CheckAppProgressInput): Promise<CapabilityResult<CheckAppProgressResult>>;
|
|
66
|
-
export declare function editApp(ctx: CapabilityContext, input: EditAppInput): Promise<CapabilityResult<EditAppResult>>;
|
|
66
|
+
export declare function editApp(ctx: CapabilityContext, input: EditAppInput, approvedPlan?: object): Promise<CapabilityResult<EditAppResult>>;
|
|
67
67
|
/**
|
|
68
68
|
* Shows the app's current work on a real URL without deploying it - the
|
|
69
69
|
* editor's Preview button, driven from here.
|
|
@@ -76,9 +76,26 @@ export declare function editApp(ctx: CapabilityContext, input: EditAppInput): Pr
|
|
|
76
76
|
* second one.
|
|
77
77
|
*/
|
|
78
78
|
export declare function previewApp(ctx: CapabilityContext, input: PreviewAppInput): Promise<CapabilityResult<PreviewAppResult>>;
|
|
79
|
+
/** Read the build backing an existing commit preview without creating work. */
|
|
80
|
+
export declare function getPreviewStatus(ctx: CapabilityContext, input: PreviewStatusInput): Promise<CapabilityResult<PreviewStatusResult>>;
|
|
81
|
+
/**
|
|
82
|
+
* Opens the decision card: what Superblocks asked, for the user to answer as a
|
|
83
|
+
* form rather than by typing an approval the host has to interpret.
|
|
84
|
+
*
|
|
85
|
+
* Its own tool because an MCP App is bound to one, and `check_app_progress`
|
|
86
|
+
* must stay text-only - a card tool reopens its card on every poll, so putting
|
|
87
|
+
* this on the poll loop would flash a blank form through a whole build.
|
|
88
|
+
*/
|
|
89
|
+
export declare function askUser(ctx: CapabilityContext, input: AskUserInput): Promise<CapabilityResult<AskUserResult>>;
|
|
79
90
|
/**
|
|
80
|
-
*
|
|
81
|
-
* ensured (default). Captures a screenshot whenever the preview is ready.
|
|
91
|
+
* Read the app's current live editor view without committing or building it.
|
|
82
92
|
*/
|
|
83
93
|
export declare function getApp(ctx: CapabilityContext, input: GetAppInput): Promise<CapabilityResult<GetAppResult>>;
|
|
84
94
|
export declare function publishApp(ctx: CapabilityContext, input: PublishAppInput): Promise<CapabilityResult<PublishAppResult>>;
|
|
95
|
+
/**
|
|
96
|
+
* Where a publish handed back as `publishing` has got to.
|
|
97
|
+
*
|
|
98
|
+
* Each call watches for a bounded slice of the rollout, then hands back a
|
|
99
|
+
* changing clock so repeated calls remain useful without outliving the host.
|
|
100
|
+
*/
|
|
101
|
+
export declare function checkPublishProgress(ctx: CapabilityContext, input: CheckPublishProgressInput): Promise<CapabilityResult<PublishAppResult>>;
|