@superblocksteam/gateway 2.0.174 → 2.0.175-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.
Files changed (212) hide show
  1. package/README.md +43 -18
  2. package/dist/agents/resolve-orchestrator-url.d.ts +1 -0
  3. package/dist/agents/resolve-orchestrator-url.d.ts.map +1 -0
  4. package/dist/capabilities/integration-metadata.d.ts +1 -0
  5. package/dist/capabilities/integration-metadata.d.ts.map +1 -0
  6. package/dist/capabilities/lifecycle.d.ts +2 -0
  7. package/dist/capabilities/lifecycle.d.ts.map +1 -0
  8. package/dist/capabilities/lifecycle.js +10 -6
  9. package/dist/capabilities/lifecycle.js.map +1 -1
  10. package/dist/capabilities/live-state-attaches.d.ts +1 -0
  11. package/dist/capabilities/live-state-attaches.d.ts.map +1 -0
  12. package/dist/capabilities/query-integration.d.ts +1 -0
  13. package/dist/capabilities/query-integration.d.ts.map +1 -0
  14. package/dist/capabilities/source-files-archive.d.ts +1 -0
  15. package/dist/capabilities/source-files-archive.d.ts.map +1 -0
  16. package/dist/capabilities/tool-permission-reply.d.ts +1 -0
  17. package/dist/capabilities/tool-permission-reply.d.ts.map +1 -0
  18. package/dist/capabilities/types.d.ts +1 -0
  19. package/dist/capabilities/types.d.ts.map +1 -0
  20. package/dist/capture/browser-contract.d.ts +1 -0
  21. package/dist/capture/browser-contract.d.ts.map +1 -0
  22. package/dist/capture/browser-instructions.d.ts +1 -0
  23. package/dist/capture/browser-instructions.d.ts.map +1 -0
  24. package/dist/capture/capture-library-probe.d.ts +1 -0
  25. package/dist/capture/capture-library-probe.d.ts.map +1 -0
  26. package/dist/capture/capture-library.d.ts +1 -0
  27. package/dist/capture/capture-library.d.ts.map +1 -0
  28. package/dist/capture/classify-library-paint.d.ts +1 -0
  29. package/dist/capture/classify-library-paint.d.ts.map +1 -0
  30. package/dist/capture/cowork-editor-url.d.ts +1 -0
  31. package/dist/capture/cowork-editor-url.d.ts.map +1 -0
  32. package/dist/capture/host-mcp-scan.d.ts +1 -0
  33. package/dist/capture/host-mcp-scan.d.ts.map +1 -0
  34. package/dist/capture/library-parent-script.d.ts +1 -0
  35. package/dist/capture/library-parent-script.d.ts.map +1 -0
  36. package/dist/capture/mode.d.ts +1 -0
  37. package/dist/capture/mode.d.ts.map +1 -0
  38. package/dist/config.d.ts +7 -0
  39. package/dist/config.d.ts.map +1 -0
  40. package/dist/config.js +1 -0
  41. package/dist/config.js.map +1 -1
  42. package/dist/deadline.d.ts +1 -0
  43. package/dist/deadline.d.ts.map +1 -0
  44. package/dist/debug.d.ts +1 -0
  45. package/dist/debug.d.ts.map +1 -0
  46. package/dist/deps.d.ts +4 -3
  47. package/dist/deps.d.ts.map +1 -0
  48. package/dist/health/readiness.d.ts +1 -0
  49. package/dist/health/readiness.d.ts.map +1 -0
  50. package/dist/http/main.d.ts +3 -0
  51. package/dist/http/main.d.ts.map +1 -0
  52. package/dist/http/main.js +8 -0
  53. package/dist/http/main.js.map +1 -0
  54. package/dist/http/serve.d.ts +26 -0
  55. package/dist/http/serve.d.ts.map +1 -0
  56. package/dist/http/serve.js +255 -0
  57. package/dist/http/serve.js.map +1 -0
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/integrations/filters.d.ts +1 -0
  61. package/dist/integrations/filters.d.ts.map +1 -0
  62. package/dist/integrations/filters.js +1 -16
  63. package/dist/integrations/filters.js.map +1 -1
  64. package/dist/integrations/map.d.ts +10 -4
  65. package/dist/integrations/map.d.ts.map +1 -0
  66. package/dist/integrations/map.js +8 -6
  67. package/dist/integrations/map.js.map +1 -1
  68. package/dist/integrations/profile-key.d.ts +1 -0
  69. package/dist/integrations/profile-key.d.ts.map +1 -0
  70. package/dist/integrations/read-only-postgres-query.d.ts +1 -0
  71. package/dist/integrations/read-only-postgres-query.d.ts.map +1 -0
  72. package/dist/integrations/resolve-profile.d.ts +1 -0
  73. package/dist/integrations/resolve-profile.d.ts.map +1 -0
  74. package/dist/main.d.ts +1 -0
  75. package/dist/main.d.ts.map +1 -0
  76. package/dist/orchestrator/client.d.ts +1 -0
  77. package/dist/orchestrator/client.d.ts.map +1 -0
  78. package/dist/playwright/ensure-chromium.d.ts +1 -0
  79. package/dist/playwright/ensure-chromium.d.ts.map +1 -0
  80. package/dist/preview/capture-screenshot.d.ts +1 -0
  81. package/dist/preview/capture-screenshot.d.ts.map +1 -0
  82. package/dist/preview/capture-screenshot.js +1 -1
  83. package/dist/preview/capture-screenshot.js.map +1 -1
  84. package/dist/preview/viewer-url.d.ts +1 -0
  85. package/dist/preview/viewer-url.d.ts.map +1 -0
  86. package/dist/process/fault-barrier.d.ts +1 -0
  87. package/dist/process/fault-barrier.d.ts.map +1 -0
  88. package/dist/sabs/agent-facing-text.d.ts +1 -0
  89. package/dist/sabs/agent-facing-text.d.ts.map +1 -0
  90. package/dist/sabs/app-state.d.ts +3 -0
  91. package/dist/sabs/app-state.d.ts.map +1 -0
  92. package/dist/sabs/app-state.js +5 -0
  93. package/dist/sabs/app-state.js.map +1 -1
  94. package/dist/sabs/awaited-decision.d.ts +1 -0
  95. package/dist/sabs/awaited-decision.d.ts.map +1 -0
  96. package/dist/sabs/browser-context.d.ts +1 -0
  97. package/dist/sabs/browser-context.d.ts.map +1 -0
  98. package/dist/sabs/editor-client-methods.d.ts +1 -0
  99. package/dist/sabs/editor-client-methods.d.ts.map +1 -0
  100. package/dist/sabs/editor-client-methods.js +5 -3
  101. package/dist/sabs/editor-client-methods.js.map +1 -1
  102. package/dist/sabs/editor-socket.d.ts +1 -0
  103. package/dist/sabs/editor-socket.d.ts.map +1 -0
  104. package/dist/sabs/recent-tool-runs.d.ts +1 -0
  105. package/dist/sabs/recent-tool-runs.d.ts.map +1 -0
  106. package/dist/sabs/session-peer.d.ts +8 -0
  107. package/dist/sabs/session-peer.d.ts.map +1 -0
  108. package/dist/sabs/streamed-reply.d.ts +1 -0
  109. package/dist/sabs/streamed-reply.d.ts.map +1 -0
  110. package/dist/sabs/turn-collector.d.ts +1 -0
  111. package/dist/sabs/turn-collector.d.ts.map +1 -0
  112. package/dist/sabs/websocket-session-peer.d.ts +2 -0
  113. package/dist/sabs/websocket-session-peer.d.ts.map +1 -0
  114. package/dist/sabs/websocket-session-peer.js +5 -0
  115. package/dist/sabs/websocket-session-peer.js.map +1 -1
  116. package/dist/security/constant-time.d.ts +1 -0
  117. package/dist/security/constant-time.d.ts.map +1 -0
  118. package/dist/server/client.d.ts +10 -0
  119. package/dist/server/client.d.ts.map +1 -0
  120. package/dist/server/client.js +9 -0
  121. package/dist/server/client.js.map +1 -1
  122. package/dist/server/identity-reads.d.ts +1 -0
  123. package/dist/server/identity-reads.d.ts.map +1 -0
  124. package/dist/start.d.ts +6 -1
  125. package/dist/start.d.ts.map +1 -0
  126. package/dist/start.js +22 -9
  127. package/dist/start.js.map +1 -1
  128. package/dist/stores/memory.d.ts +1 -0
  129. package/dist/stores/memory.d.ts.map +1 -0
  130. package/dist/stores/types.d.ts +1 -0
  131. package/dist/stores/types.d.ts.map +1 -0
  132. package/dist/telemetry/mcp-client.d.ts +1 -0
  133. package/dist/telemetry/mcp-client.d.ts.map +1 -0
  134. package/dist/telemetry/mcp-usage.d.ts +22 -0
  135. package/dist/telemetry/mcp-usage.d.ts.map +1 -0
  136. package/dist/telemetry/mcp-usage.js +102 -0
  137. package/dist/telemetry/mcp-usage.js.map +1 -0
  138. package/dist/telemetry/metrics.d.ts +4 -0
  139. package/dist/telemetry/metrics.d.ts.map +1 -0
  140. package/dist/telemetry/metrics.js +11 -0
  141. package/dist/telemetry/metrics.js.map +1 -1
  142. package/dist/telemetry/runtime.d.ts +3 -1
  143. package/dist/telemetry/runtime.d.ts.map +1 -0
  144. package/dist/telemetry/runtime.js +12 -5
  145. package/dist/telemetry/runtime.js.map +1 -1
  146. package/dist/transports/mcp/admin-tools.d.ts +4 -7
  147. package/dist/transports/mcp/admin-tools.d.ts.map +1 -0
  148. package/dist/transports/mcp/admin-tools.js +5 -51
  149. package/dist/transports/mcp/admin-tools.js.map +1 -1
  150. package/dist/transports/mcp/app-status-html.d.ts +1 -0
  151. package/dist/transports/mcp/app-status-html.d.ts.map +1 -0
  152. package/dist/transports/mcp/client-presentation.d.ts +1 -0
  153. package/dist/transports/mcp/client-presentation.d.ts.map +1 -0
  154. package/dist/transports/mcp/decision-card-html.d.ts +1 -0
  155. package/dist/transports/mcp/decision-card-html.d.ts.map +1 -0
  156. package/dist/transports/mcp/decision-elicitation.d.ts +1 -0
  157. package/dist/transports/mcp/decision-elicitation.d.ts.map +1 -0
  158. package/dist/transports/mcp/dispatch-probe.d.ts +1 -0
  159. package/dist/transports/mcp/dispatch-probe.d.ts.map +1 -0
  160. package/dist/transports/mcp/editor-document-probe.d.ts +1 -0
  161. package/dist/transports/mcp/editor-document-probe.d.ts.map +1 -0
  162. package/dist/transports/mcp/editor-integration-setup-url.d.ts +1 -0
  163. package/dist/transports/mcp/editor-integration-setup-url.d.ts.map +1 -0
  164. package/dist/transports/mcp/format-tool-content.d.ts +1 -0
  165. package/dist/transports/mcp/format-tool-content.d.ts.map +1 -0
  166. package/dist/transports/mcp/instructions/index.d.ts +1 -0
  167. package/dist/transports/mcp/instructions/index.d.ts.map +1 -0
  168. package/dist/transports/mcp/instructions/result.d.ts +1 -0
  169. package/dist/transports/mcp/instructions/result.d.ts.map +1 -0
  170. package/dist/transports/mcp/instructions/tools/ask-user.d.ts +1 -0
  171. package/dist/transports/mcp/instructions/tools/ask-user.d.ts.map +1 -0
  172. package/dist/transports/mcp/instructions/tools/build-app.d.ts +1 -0
  173. package/dist/transports/mcp/instructions/tools/build-app.d.ts.map +1 -0
  174. package/dist/transports/mcp/instructions/tools/check-app-progress.d.ts +1 -0
  175. package/dist/transports/mcp/instructions/tools/check-app-progress.d.ts.map +1 -0
  176. package/dist/transports/mcp/instructions/tools/check-publish-progress.d.ts +1 -0
  177. package/dist/transports/mcp/instructions/tools/check-publish-progress.d.ts.map +1 -0
  178. package/dist/transports/mcp/instructions/tools/copy.d.ts +1 -0
  179. package/dist/transports/mcp/instructions/tools/copy.d.ts.map +1 -0
  180. package/dist/transports/mcp/instructions/tools/create-integration.d.ts +1 -0
  181. package/dist/transports/mcp/instructions/tools/create-integration.d.ts.map +1 -0
  182. package/dist/transports/mcp/instructions/tools/edit-app.d.ts +1 -0
  183. package/dist/transports/mcp/instructions/tools/edit-app.d.ts.map +1 -0
  184. package/dist/transports/mcp/instructions/tools/get-app.d.ts +1 -0
  185. package/dist/transports/mcp/instructions/tools/get-app.d.ts.map +1 -0
  186. package/dist/transports/mcp/instructions/tools/get-integration-metadata.d.ts +1 -0
  187. package/dist/transports/mcp/instructions/tools/get-integration-metadata.d.ts.map +1 -0
  188. package/dist/transports/mcp/instructions/tools/index.d.ts +1 -0
  189. package/dist/transports/mcp/instructions/tools/index.d.ts.map +1 -0
  190. package/dist/transports/mcp/instructions/tools/publish-app.d.ts +1 -0
  191. package/dist/transports/mcp/instructions/tools/publish-app.d.ts.map +1 -0
  192. package/dist/transports/mcp/instructions/tools/start-app.d.ts +1 -0
  193. package/dist/transports/mcp/instructions/tools/start-app.d.ts.map +1 -0
  194. package/dist/transports/mcp/instructions/tools/upload-artifact.d.ts +1 -0
  195. package/dist/transports/mcp/instructions/tools/upload-artifact.d.ts.map +1 -0
  196. package/dist/transports/mcp/mcp-app-brand-css.d.ts +1 -0
  197. package/dist/transports/mcp/mcp-app-brand-css.d.ts.map +1 -0
  198. package/dist/transports/mcp/mount.d.ts +3 -13
  199. package/dist/transports/mcp/mount.d.ts.map +1 -0
  200. package/dist/transports/mcp/mount.js +73 -38
  201. package/dist/transports/mcp/mount.js.map +1 -1
  202. package/dist/transports/mcp/native-browser-presence.d.ts +1 -0
  203. package/dist/transports/mcp/native-browser-presence.d.ts.map +1 -0
  204. package/dist/transports/mcp/plan-approval.d.ts +1 -0
  205. package/dist/transports/mcp/plan-approval.d.ts.map +1 -0
  206. package/dist/transports/mcp/progress-notifier.d.ts +1 -0
  207. package/dist/transports/mcp/progress-notifier.d.ts.map +1 -0
  208. package/dist/transports/mcp/session-directory.d.ts +1 -0
  209. package/dist/transports/mcp/session-directory.d.ts.map +1 -0
  210. package/dist/transports/mcp/tool-names.d.ts +1 -0
  211. package/dist/transports/mcp/tool-names.d.ts.map +1 -0
  212. package/package.json +22 -19
package/README.md CHANGED
@@ -135,20 +135,20 @@ Restart the MCP host after `setup` and after every rebuild below.
135
135
 
136
136
  ### Rebuild after source changes
137
137
 
138
- Cursor MCP still goes through oclif `dist/index.js`. CLI esbuild inlines
139
- `@superblocksteam/gateway`, so a Gateway `tsc` alone does not update the
140
- process the host spawns.
138
+ Cursor MCP goes through oclif `dist/index.js`, which loads
139
+ `@superblocksteam/gateway` and `@superblocksteam/shared` from their own `dist/`.
140
+ Rebuild the package you changed.
141
141
 
142
142
  | You changed | Rebuild |
143
143
  | --------------------------------------------------------------- | ---------------------------------------------- |
144
144
  | `packages/shared` (types Gateway imports, e.g. SocketHeartbeat) | `pnpm --filter @superblocksteam/shared build` |
145
145
  | `packages/gateway/src` | `pnpm --filter @superblocksteam/gateway build` |
146
- | Gateway, CLI serve wiring, or anything oclif esbuild inlines | `pnpm --filter @superblocksteam/cli build` |
146
+ | CLI serve wiring (`packages/cli/packages/cli/src`) | `pnpm --filter @superblocksteam/cli build` |
147
147
 
148
- A typical Gateway capture change is shared (if types moved), then Gateway,
149
- then CLI. Then restart Cursor.
148
+ A typical Gateway capture change is shared (if types moved), then Gateway.
149
+ Then restart Cursor.
150
150
 
151
- Proof the new bundle is live: Gateway stderr logs
151
+ Proof the new build is live: Gateway stderr logs
152
152
  `gateway live canvas capture uses libraryBrowserContext (testingEnabled does not gate it)`
153
153
  at boot. A crash that `@superblocksteam/shared` does not export
154
154
  `SocketHeartbeat` means shared `dist/` is stale.
@@ -335,17 +335,42 @@ exports over OTLP through the authenticated Server `/api/v1/metrics` proxy
335
335
  (same path and policy as traces). `service.name=gateway` and
336
336
  `deployment.environment.name` ride on the SDK resource, not on each data point.
337
337
 
338
- | Metric | Labels |
339
- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
340
- | `gateway.identity.read.outcomes` | `gateway.outcome`: `cached`, `resolved`, `refused`, `credential_error`, `breaker_open`, `caller_timeout`, `outage` |
341
- | `gateway.server.read_retry.outcomes` | `gateway.server.read_retry.outcome`, `gateway.server.read_retry.cause`, `gateway.server.read_retry.operation` |
342
- | `gateway.clark.facts_flag_bootstrap.outcomes` | `gateway.clark.facts_flag_bootstrap.outcome`: `enabled`, `disabled`, `invalid` |
343
- | `gateway.integration_profile.resolutions` | `gateway.profile.source`, `gateway.profile.reason`, `gateway.profile.scope` |
344
- | `gateway.mcp.tool_calls` | `tool.name`, `tool.status`, `mcp.client.name` |
345
- | `gateway.mcp.tool_call_duration_seconds` | same as `gateway.mcp.tool_calls` |
346
- | `gateway.checkpoint.outcomes` | `gateway.checkpoint.outcome` |
347
- | `gateway.process.faults` | `gateway.fault.kind`, `gateway.fault.fatal` |
348
- | `gateway.readiness.verdicts` | `gateway.readiness.probe`, `gateway.readiness.ready`, `gateway.readiness.dispatch`, `gateway.readiness.upstream` |
338
+ | Metric | Labels |
339
+ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
340
+ | `gateway.identity.read.outcomes` | `gateway.outcome`: `cached`, `resolved`, `refused`, `credential_error`, `breaker_open`, `caller_timeout`, `outage` |
341
+ | `gateway.server.read_retry.outcomes` | `gateway.server.read_retry.outcome`, `gateway.server.read_retry.cause`, `gateway.server.read_retry.operation` |
342
+ | `gateway.clark.facts_flag_bootstrap.outcomes` | `gateway.clark.facts_flag_bootstrap.outcome`: `enabled`, `disabled`, `invalid` |
343
+ | `gateway.integration_profile.resolutions` | `gateway.profile.source`, `gateway.profile.reason`, `gateway.profile.scope` |
344
+ | `gateway.mcp.tool_calls` | `tool.name`, `tool.status`, `mcp.client.name` |
345
+ | `gateway.mcp.tool_call_duration_seconds` | same as `gateway.mcp.tool_calls` |
346
+ | `gateway.mcp.usage_delivery` | `gateway.mcp.usage_delivery.outcome`: `accepted`, `failed`; `gateway.mcp.usage_delivery.reason`: bounded delivery reason |
347
+ | `gateway.mcp.usage_delivery.attempts` | none; counted before dispatch, independently of delivery settlement |
348
+ | `gateway.checkpoint.outcomes` | `gateway.checkpoint.outcome` |
349
+ | `gateway.process.faults` | `gateway.fault.kind`, `gateway.fault.fatal` |
350
+ | `gateway.readiness.verdicts` | `gateway.readiness.probe`, `gateway.readiness.ready`, `gateway.readiness.dispatch`, `gateway.readiness.upstream` |
351
+
352
+ Usage delivery reasons are `none` for accepted events, or `authentication`,
353
+ `http_error`, `invalid_request`, `network`, `rate_limited`, `server_error`,
354
+ `timeout`, `unknown`, and `unsupported` for failures. Activity ingestion shares
355
+ the Server's authenticated per-user API allowance of 120 requests per minute
356
+ per process; each tool operation sends two events. A confirmed plan refusal
357
+ has activity outcome `not_entitled` and is excluded from warehouse adoption.
358
+ Started and finished events can arrive in either order; the warehouse pairs
359
+ them by authenticated principal and operation ID.
360
+
361
+ The attempts counter includes deliveries still in flight; compare it with the
362
+ accepted and failed counts over the same interval in a long-lived process.
363
+ All these counters require telemetry export. Abrupt process exit can lose
364
+ both an activity event and its counters, so this is not an end-to-end loss
365
+ rate or a durable delivery guarantee.
366
+
367
+ Schema rejections use the Server's existing request warning with bounded
368
+ `builder.mcp.validation.issues` field/code pairs. It inherits authenticated
369
+ request context; rejected values and unknown field names are omitted. Each
370
+ phase is sent once with no automatic retry, and the Server quota also applies
371
+ to invalid activity. Deploy the Server schema before gateways that send new
372
+ outcomes; the delivery counter classifies skew as `invalid_request` or
373
+ `unsupported`.
349
374
 
350
375
  Locally, the Server forwards the proxy to the OTel collector on `:4318`. The
351
376
  workspace `just up` (any profile) starts the LGTM stack from
@@ -56,3 +56,4 @@ export declare function orchestratorUrlDependsOnProfile(input: {
56
56
  * "No active agent found".
57
57
  */
58
58
  export declare function pickOrchestratorBaseUrl(input: PickOrchestratorBaseUrlInput): string;
59
+ //# sourceMappingURL=resolve-orchestrator-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-orchestrator-url.d.ts","sourceRoot":"","sources":["../../src/agents/resolve-orchestrator-url.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,IAAI,CAAC;AActC,wBAAgB,wCAAwC,CACtD,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,GAAG,SAAS,CAoBpB;AA4CD;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,MAAM,EACX,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAqBR;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,OAAO,CAQV;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,4BAA4B,GAClC,MAAM,CA6CR"}
@@ -29,3 +29,4 @@ export type GetIntegrationMetadataResult = {
29
29
  };
30
30
  export declare function getIntegrationMetadata(context: CapabilityContext, input: GetIntegrationMetadataInput): Promise<CapabilityResult<GetIntegrationMetadataResult>>;
31
31
  export {};
32
+ //# sourceMappingURL=integration-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-metadata.d.ts","sourceRoot":"","sources":["../../src/capabilities/integration-metadata.ts"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAM5C,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,OAAO,EAAE,sBAAsB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA0DF,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,CAAC,CAkKzD"}
@@ -10,6 +10,7 @@ import type { LiveStateAttaches } from "./live-state-attaches.js";
10
10
  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";
11
11
  export { IMPORT_ZIP_MAX_BYTES } from "./types.js";
12
12
  export type CapabilityContext = {
13
+ mcpClientName?: string;
13
14
  config: GatewayConfig;
14
15
  /** Injected so turn and stall thresholds are testable without real time. */
15
16
  now?: () => number;
@@ -124,3 +125,4 @@ export declare function publishApp(ctx: CapabilityContext, input: PublishAppInpu
124
125
  * changing clock so repeated calls remain useful without outliving the host.
125
126
  */
126
127
  export declare function checkPublishProgress(ctx: CapabilityContext, input: CheckPublishProgressInput): Promise<CapabilityResult<PublishAppResult>>;
128
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/capabilities/lifecycle.ts"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,kCAAkC,CAAC;AAM1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAML,KAAK,WAAW,EAIjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAEV,aAAa,EACb,cAAc,EACd,eAAe,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9B,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAiN7C;AAED,+EAA+E;AAC/E,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CA8EhD;AA2bD;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAC3B,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAsE1C;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAyFzC;AA2GD,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAsBpC;AAED,wBAAsB,UAAU,CAC9B,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAsB7C;AAyED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CA8N7C"}
@@ -766,6 +766,7 @@ function turnSummary(turn) {
766
766
  async function promptInput(ctx, input) {
767
767
  return {
768
768
  apiKey: ctx.principal.apiKey,
769
+ mcpClientName: ctx.mcpClientName,
769
770
  applicationId: input.applicationId,
770
771
  ...(input.attachments ? { attachments: input.attachments } : {}),
771
772
  ...(input.branch ? { branch: input.branch } : {}),
@@ -1544,19 +1545,22 @@ function tooLargeError(size) {
1544
1545
  * out, so it accepts anything attachments support rather than archives alone.
1545
1546
  * The other two routes are text channels and stay archive-shaped.
1546
1547
  */
1547
- async function resolveImportArchive(input, searchDirs) {
1548
+ async function resolveImportArchive(input, config) {
1548
1549
  const hasFiles = Boolean(input.files?.length);
1549
- const hasPath = Boolean(input.filePath?.trim());
1550
+ // Hosted, the disk is the microVM's own, never the user's files.
1551
+ const hasPath = !config.hosted && Boolean(input.filePath?.trim());
1550
1552
  const hasBase64 = Boolean(input.zipBase64?.trim());
1551
1553
  if (Number(hasFiles) + Number(hasPath) + Number(hasBase64) !== 1) {
1552
1554
  return {
1553
1555
  kind: "error",
1554
1556
  code: "import_zip_required",
1555
- message: "Provide exactly one of files, filePath (a path or file name on the gateway host), or zipBase64.",
1557
+ message: config.hosted
1558
+ ? "Provide exactly one of files or zipBase64."
1559
+ : "Provide exactly one of files, filePath (a path or file name on the gateway host), or zipBase64.",
1556
1560
  };
1557
1561
  }
1558
1562
  if (hasPath) {
1559
- return resolveFileByPath(input.filePath.trim(), searchDirs);
1563
+ return resolveFileByPath(input.filePath.trim(), config.importSearchDirs);
1560
1564
  }
1561
1565
  let bytes;
1562
1566
  if (hasFiles) {
@@ -1565,7 +1569,7 @@ async function resolveImportArchive(input, searchDirs) {
1565
1569
  return {
1566
1570
  kind: "error",
1567
1571
  code: "import_files_invalid",
1568
- message: `"${binaryFile.path}" is not a text file, and files entries are archived as the text they contain: base64 in there uploads as base64 characters wearing a "${path.extname(binaryFile.path)}" name. Pass filePath with the file's name instead, so the gateway reads its real bytes.`,
1572
+ message: `"${binaryFile.path}" is not a text file, and files entries are archived as the text they contain: base64 in there uploads as base64 characters wearing a "${path.extname(binaryFile.path)}" name. ${config.hosted ? "Put it in a ZIP and pass that as zipBase64 instead, so its real bytes are uploaded. A ZIP too large for zipBase64 cannot be uploaded on this connection yet." : "Pass filePath with the file's name instead, so the gateway reads its real bytes."}`,
1569
1573
  };
1570
1574
  }
1571
1575
  const archive = archiveSourceFiles(input.files);
@@ -1689,7 +1693,7 @@ export async function uploadArtifact(ctx, input) {
1689
1693
  if (principalResult.kind !== "ok") {
1690
1694
  return principalResult;
1691
1695
  }
1692
- const archiveResult = await resolveImportArchive(input, ctx.config.importSearchDirs);
1696
+ const archiveResult = await resolveImportArchive(input, ctx.config);
1693
1697
  if (archiveResult.kind !== "ok") {
1694
1698
  return archiveResult;
1695
1699
  }