@superblocksteam/gateway 2.0.161 → 2.0.162-next.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.
- package/README.md +135 -39
- package/dist/agents/resolve-orchestrator-url.d.ts +18 -0
- package/dist/agents/resolve-orchestrator-url.js +64 -1
- package/dist/agents/resolve-orchestrator-url.js.map +1 -1
- 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 +1333 -477
- 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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { strToU8, zipSync } from "fflate";
|
|
2
|
+
import { IMPORT_SOURCE_FILES_MAX_BYTES } from "./types.js";
|
|
3
|
+
/** Paths come from the model, so anything that would not extract as a relative path is rejected. */
|
|
4
|
+
function normalizeSourcePath(sourcePath) {
|
|
5
|
+
const portablePath = sourcePath.replaceAll("\\", "/");
|
|
6
|
+
if (portablePath.startsWith("/") ||
|
|
7
|
+
/^[a-zA-Z]:/.test(portablePath) ||
|
|
8
|
+
portablePath.includes("\0")) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const segments = portablePath
|
|
12
|
+
.split("/")
|
|
13
|
+
.filter((segment) => segment !== "" && segment !== ".");
|
|
14
|
+
if (segments.length === 0 || segments.includes("..")) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return segments.join("/");
|
|
18
|
+
}
|
|
19
|
+
export function archiveSourceFiles(files) {
|
|
20
|
+
// Null prototype so a path like "__proto__" or "toString" is stored, not swallowed.
|
|
21
|
+
const entries = Object.create(null);
|
|
22
|
+
let sourceBytes = 0;
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
const normalized = normalizeSourcePath(file.path);
|
|
25
|
+
if (!normalized) {
|
|
26
|
+
return {
|
|
27
|
+
kind: "error",
|
|
28
|
+
message: `Source file path must be a safe relative path: "${file.path}".`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (Object.hasOwn(entries, normalized)) {
|
|
32
|
+
return {
|
|
33
|
+
kind: "error",
|
|
34
|
+
message: `Source file path is duplicated: "${normalized}".`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (Buffer.byteLength(normalized) > 0xffff) {
|
|
38
|
+
return {
|
|
39
|
+
kind: "error",
|
|
40
|
+
message: `Source file path is too long: "${normalized}".`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
sourceBytes += Buffer.byteLength(file.content);
|
|
44
|
+
if (sourceBytes > IMPORT_SOURCE_FILES_MAX_BYTES) {
|
|
45
|
+
return {
|
|
46
|
+
kind: "error",
|
|
47
|
+
message: `Source files are ${sourceBytes} bytes before compression; the gateway inline source limit is ${IMPORT_SOURCE_FILES_MAX_BYTES} bytes (1 MB).`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
entries[normalized] = strToU8(file.content);
|
|
51
|
+
}
|
|
52
|
+
return { bytes: zipSync(entries), kind: "ok" };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=source-files-archive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-files-archive.js","sourceRoot":"","sources":["../../src/capabilities/source-files-archive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAM3D,oGAAoG;AACpG,SAAS,mBAAmB,CAAC,UAAkB;IAC7C,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtD,IACE,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC;QAC5B,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC;QAC/B,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC3B,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,YAAY;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,KAA+C;IAE/C,oFAAoF;IACpF,MAAM,OAAO,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChE,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,mDAAmD,IAAI,CAAC,IAAI,IAAI;aAC1E,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;YACvC,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,oCAAoC,UAAU,IAAI;aAC5D,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;YAC3C,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,kCAAkC,UAAU,IAAI;aAC1D,CAAC;QACJ,CAAC;QACD,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,WAAW,GAAG,6BAA6B,EAAE,CAAC;YAChD,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,oBAAoB,WAAW,iEAAiE,6BAA6B,gBAAgB;aACvJ,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { BrowserDriverContract } from "../capture/browser-contract.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LostEventRange } from "../events/types.js";
|
|
4
|
-
export type { CallerChannel, CallerRef } from "../resume/types.js";
|
|
2
|
+
import type { CheckpointFailure, CheckpointWarning, TurnUpdate } from "../sabs/session-peer.js";
|
|
5
3
|
export type CallerKind = "mcp";
|
|
6
4
|
/**
|
|
7
5
|
* The caller behind a capability invocation.
|
|
@@ -42,12 +40,14 @@ export type AuthElicitation = {
|
|
|
42
40
|
* any session with more than one of them.
|
|
43
41
|
*/
|
|
44
42
|
export type CapabilityError = {
|
|
43
|
+
/** Absent only when the call failed before it had an application at all. */
|
|
44
|
+
agentInstructions?: string;
|
|
45
45
|
/** Absent only when the call failed before it had an application at all. */
|
|
46
46
|
applicationId?: string;
|
|
47
47
|
code: string;
|
|
48
48
|
kind: "error";
|
|
49
49
|
message: string;
|
|
50
|
-
/** Set when
|
|
50
|
+
/** Set when the host has a concrete way to recover from this failure. */
|
|
51
51
|
pendingAction?: PendingAppAction;
|
|
52
52
|
};
|
|
53
53
|
export type CapabilityResult<T> = {
|
|
@@ -67,7 +67,9 @@ export type GenerationStatus = "cancelled" | "completed"
|
|
|
67
67
|
* The turn never ran to an outcome because the live-edit session did not: it
|
|
68
68
|
* went away mid-flight, or it never opened at all. Distinct from `timeout`:
|
|
69
69
|
* the turn did not run out of time, the thing that was to run it was not
|
|
70
|
-
* there
|
|
70
|
+
* there. Mid-turn deaths are retryable. Failed opens are not when reconnecting
|
|
71
|
+
* would reach the same wedged session; only a just-created app is safe to
|
|
72
|
+
* recreate.
|
|
71
73
|
*/
|
|
72
74
|
| "live_edit_terminated"
|
|
73
75
|
/** The job ended without writing a file or leaving a draft. */
|
|
@@ -81,13 +83,40 @@ export type GenerationStatus = "cancelled" | "completed"
|
|
|
81
83
|
* sends no `progressToken` — Claude Desktop — can show anything mid-build.
|
|
82
84
|
*/
|
|
83
85
|
export type TurnWait = "ack" | "turn";
|
|
86
|
+
/**
|
|
87
|
+
* Durable org-scoped file returned by `upload_artifact`.
|
|
88
|
+
*
|
|
89
|
+
* `mediaType` is any type Superblocks attachments accept, not only the two
|
|
90
|
+
* archive types: an image or a log uploads as itself rather than being wrapped
|
|
91
|
+
* in a zip it would have to be decoded back out of.
|
|
92
|
+
*/
|
|
93
|
+
export type ArtifactDescriptor = {
|
|
94
|
+
fileName: string;
|
|
95
|
+
id: string;
|
|
96
|
+
mediaType: string;
|
|
97
|
+
storageKey: string;
|
|
98
|
+
};
|
|
99
|
+
export type UploadArtifactInput = {
|
|
100
|
+
files?: Array<{
|
|
101
|
+
content: string;
|
|
102
|
+
path: string;
|
|
103
|
+
}>;
|
|
104
|
+
/** Path or file name on the gateway host. */
|
|
105
|
+
filePath?: string;
|
|
106
|
+
/** Test-fixture transport only; real archives should use filePath. */
|
|
107
|
+
zipBase64?: string;
|
|
108
|
+
};
|
|
109
|
+
export type UploadArtifactResult = {
|
|
110
|
+
artifact: ArtifactDescriptor;
|
|
111
|
+
summary: string;
|
|
112
|
+
};
|
|
84
113
|
/**
|
|
85
114
|
* Where a build stands.
|
|
86
115
|
*
|
|
87
116
|
* `unknown` means the gateway is not following a turn for this app: it finished
|
|
88
117
|
* and was already reported, or nothing was ever started here.
|
|
89
118
|
*/
|
|
90
|
-
export type BuildStatus = "building" | "cancelled"
|
|
119
|
+
export type BuildStatus = "building" | "cancelled" | "checkpoint_failed"
|
|
91
120
|
/**
|
|
92
121
|
* Clark is working but out of the gateway's sight — polling cannot report it,
|
|
93
122
|
* and only the editor can. Ends the poll loop instead of running it out.
|
|
@@ -109,17 +138,37 @@ export type BuildStatus = "building" | "cancelled"
|
|
|
109
138
|
* added later, which is how a dead live edit came to be reported as `ready`
|
|
110
139
|
* in the first place; this way the compiler stops the next one.
|
|
111
140
|
*/
|
|
112
|
-
export declare function buildStatusOf(generationStatus: GenerationStatus): BuildStatus;
|
|
141
|
+
export declare function buildStatusOf(generationStatus: GenerationStatus, checkpointFailure?: CheckpointFailure): BuildStatus;
|
|
142
|
+
/**
|
|
143
|
+
* How a `check_app_progress` poll reads as a build status.
|
|
144
|
+
*
|
|
145
|
+
* Running and unknown map directly. A finished poll uses {@link buildStatusOf},
|
|
146
|
+
* except a successful checkpoint that paused for missing integrations: that is
|
|
147
|
+
* a decision, even when generationStatus is still `completed`.
|
|
148
|
+
*/
|
|
149
|
+
export declare function progressStatusOf(update: TurnUpdate): BuildStatus;
|
|
113
150
|
export type StartAppInput = {
|
|
151
|
+
artifacts?: ArtifactDescriptor[];
|
|
114
152
|
branch?: string;
|
|
115
153
|
idempotencyKey: string;
|
|
116
154
|
/** Defaults to PLAN (editor parity). Pass BUILD to skip planning. */
|
|
117
155
|
mode?: "BUILD" | "PLAN";
|
|
118
156
|
name?: string;
|
|
119
157
|
prompt: string;
|
|
158
|
+
/** The failed app this one replaces; permits only this one fresh attempt. */
|
|
159
|
+
replacesApplicationId?: string;
|
|
120
160
|
wait?: TurnWait;
|
|
121
161
|
};
|
|
122
162
|
export type DecisionPayload = {
|
|
163
|
+
integrations: Array<{
|
|
164
|
+
configuration: Record<string, unknown>;
|
|
165
|
+
/** The plugin's configuration form, so the host needs no lookup. */
|
|
166
|
+
configurationSchema?: Record<string, unknown>;
|
|
167
|
+
name?: string;
|
|
168
|
+
pluginId: string;
|
|
169
|
+
}>;
|
|
170
|
+
kind: "missing_integrations";
|
|
171
|
+
} | {
|
|
123
172
|
kind: "multi_choice";
|
|
124
173
|
messageId?: string;
|
|
125
174
|
options: string[];
|
|
@@ -134,6 +183,7 @@ export type StartAppResult = {
|
|
|
134
183
|
/** Clark's chat lines since the previous report, oldest first. */
|
|
135
184
|
activity?: string[];
|
|
136
185
|
applicationId: string;
|
|
186
|
+
branch?: string;
|
|
137
187
|
/** Host-driver steer. Tokens never belong here. */
|
|
138
188
|
browser?: BrowserDriverContract;
|
|
139
189
|
/**
|
|
@@ -141,6 +191,8 @@ export type StartAppResult = {
|
|
|
141
191
|
* nothing to commit or the checkpoint did not land.
|
|
142
192
|
*/
|
|
143
193
|
checkpointCommitId?: string;
|
|
194
|
+
checkpointFailure?: CheckpointFailure;
|
|
195
|
+
checkpointWarning?: CheckpointWarning;
|
|
144
196
|
/** Absent while the build is still running (`wait: "ack"`). */
|
|
145
197
|
reply?: string;
|
|
146
198
|
/** Present when status is needs_decision. */
|
|
@@ -152,6 +204,7 @@ export type StartAppResult = {
|
|
|
152
204
|
/** Mode this turn ran in, so the caller can say whether Clark is planning. */
|
|
153
205
|
mode?: "BUILD" | "PLAN";
|
|
154
206
|
name: string;
|
|
207
|
+
pendingAction?: PendingAppAction;
|
|
155
208
|
/** Mid-turn testApi / testIntegration outcomes when the turn finished. */
|
|
156
209
|
recentRuns?: RecentToolRun[];
|
|
157
210
|
status: BuildStatus;
|
|
@@ -160,83 +213,55 @@ export type StartAppResult = {
|
|
|
160
213
|
};
|
|
161
214
|
export type CheckAppProgressInput = {
|
|
162
215
|
applicationId?: string;
|
|
163
|
-
|
|
164
|
-
* Resume from an explicit position instead of the one stored for this
|
|
165
|
-
* caller. Only needed when a caller keeps its own place — an omitted cursor
|
|
166
|
-
* reads from wherever the gateway last left this caller.
|
|
167
|
-
*/
|
|
168
|
-
cursor?: EventCursor;
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* Machine-readable pacing, so a caller polls on the gateway's terms rather
|
|
172
|
-
* than on a number the model invented.
|
|
173
|
-
*
|
|
174
|
-
* Every long-running result carries a poll interval whether or not the host
|
|
175
|
-
* supports progress notifications: a host that ignores progress still has to be
|
|
176
|
-
* told when to come back.
|
|
177
|
-
*/
|
|
178
|
-
export type PollPacing = {
|
|
179
|
-
/** Cursor to resume from. Stable JSON; hand it back verbatim. */
|
|
180
|
-
cursor?: EventCursor;
|
|
181
|
-
/** How long to wait before asking again. Zero once nothing is in flight. */
|
|
182
|
-
nextPollAfterMs: number;
|
|
183
|
-
/**
|
|
184
|
-
* What is left of the turn budget before the gateway gives up on it.
|
|
185
|
-
*
|
|
186
|
-
* Present only while this gateway is following the turn itself and can see
|
|
187
|
-
* its clock, which is the only case where the number means anything. It used
|
|
188
|
-
* to be sent unconditionally, so a poll of an app with no turn at all
|
|
189
|
-
* answered with the full budget next to a zero elapsed - a fresh,
|
|
190
|
-
* fully-funded turn, asserted about nothing (ENG-5808).
|
|
191
|
-
*
|
|
192
|
-
* Absent does not mean "nothing is running": a build read out of the
|
|
193
|
-
* persisted stream reports `building` without a budget, because the turn is
|
|
194
|
-
* running somewhere this process cannot time it.
|
|
195
|
-
* {@link PollPacing.nextPollAfterMs} and the status are what say whether to
|
|
196
|
-
* keep polling.
|
|
197
|
-
*/
|
|
198
|
-
remainingTurnBudgetMs?: number;
|
|
199
|
-
/**
|
|
200
|
-
* Producers whose retained history had already passed the resumed cursor.
|
|
201
|
-
* Present only when something was actually lost.
|
|
202
|
-
*/
|
|
203
|
-
staleStreams?: LostEventRange[];
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* A nonterminal warning that a build has gone quiet, raised well before the
|
|
207
|
-
* turn budget runs out so a caller can say something rather than sit on a
|
|
208
|
-
* silent poll loop until it times out.
|
|
209
|
-
*/
|
|
210
|
-
export type StallHint = {
|
|
211
|
-
/** How long the build has been running without saying anything new. */
|
|
212
|
-
quietMs: number;
|
|
213
|
-
reason: "long_quiet";
|
|
216
|
+
branch?: string;
|
|
214
217
|
};
|
|
215
|
-
export type CheckAppProgressResult =
|
|
218
|
+
export type CheckAppProgressResult = {
|
|
216
219
|
/** Clark's chat lines since the previous poll, oldest first. */
|
|
217
220
|
activity: string[];
|
|
221
|
+
/**
|
|
222
|
+
* Next step for the calling agent, when present. Produced by a host-specific
|
|
223
|
+
* decision instruction (status needs_decision) or a relay reminder on a
|
|
224
|
+
* building poll that carried new Superblocks lines.
|
|
225
|
+
*/
|
|
226
|
+
agentInstructions?: string;
|
|
218
227
|
applicationId: string;
|
|
219
|
-
|
|
220
|
-
elapsedSeconds: number;
|
|
228
|
+
branch?: string;
|
|
221
229
|
/** See StartAppResult.checkpointCommitId. */
|
|
222
230
|
checkpointCommitId?: string;
|
|
223
|
-
|
|
224
|
-
|
|
231
|
+
checkpointFailure?: CheckpointFailure;
|
|
232
|
+
checkpointWarning?: CheckpointWarning;
|
|
225
233
|
/** Present when status is needs_decision. */
|
|
226
234
|
decision?: DecisionPayload;
|
|
227
235
|
editUrl: string;
|
|
236
|
+
/** How long Clark has been on this turn, so a quiet poll still has news. */
|
|
237
|
+
elapsedSeconds: number;
|
|
228
238
|
/** Present once the turn has finished. */
|
|
229
239
|
generationStatus?: GenerationStatus;
|
|
230
|
-
/**
|
|
231
|
-
|
|
240
|
+
/**
|
|
241
|
+
* Who owes the next move, once the turn is waiting on one. Present on the
|
|
242
|
+
* polling path as well as on `get_app`, because a host without form
|
|
243
|
+
* elicitation answers a decision from this loop and nowhere else.
|
|
244
|
+
*/
|
|
245
|
+
pendingAction?: PendingAppAction;
|
|
232
246
|
/** Recent mid-turn testApi / testIntegration outcomes, oldest first. */
|
|
233
247
|
recentRuns?: RecentToolRun[];
|
|
248
|
+
/** Present once the turn has finished. */
|
|
249
|
+
reply?: string;
|
|
234
250
|
/** Emitted once per quiet spell, never in place of a terminal answer. */
|
|
235
251
|
stallHint?: StallHint;
|
|
236
252
|
status: BuildStatus;
|
|
237
|
-
/**
|
|
253
|
+
/** Whether this turn has produced content the editor can render. */
|
|
238
254
|
viewStatus?: "ready" | "unknown";
|
|
239
255
|
};
|
|
256
|
+
/**
|
|
257
|
+
* A nonterminal warning that a build has gone quiet so a caller can report
|
|
258
|
+
* the silence while continuing to poll.
|
|
259
|
+
*/
|
|
260
|
+
export type StallHint = {
|
|
261
|
+
/** How long the build has been running without saying anything new. */
|
|
262
|
+
quietMs: number;
|
|
263
|
+
reason: "long_quiet";
|
|
264
|
+
};
|
|
240
265
|
/**
|
|
241
266
|
* One mid-turn testApi or testIntegration result surfaced to MCP clients.
|
|
242
267
|
* Output/error strings are truncated so tool results stay readable.
|
|
@@ -250,6 +275,7 @@ export type RecentToolRun = {
|
|
|
250
275
|
};
|
|
251
276
|
export type EditAppInput = {
|
|
252
277
|
applicationId?: string;
|
|
278
|
+
artifacts?: ArtifactDescriptor[];
|
|
253
279
|
branch?: string;
|
|
254
280
|
idempotencyKey: string;
|
|
255
281
|
/** Defaults to PLAN. Approve forces BUILD with planContext.approved. */
|
|
@@ -268,10 +294,13 @@ export type EditAppResult = {
|
|
|
268
294
|
/** Clark's chat lines since the previous report, oldest first. */
|
|
269
295
|
activity?: string[];
|
|
270
296
|
applicationId: string;
|
|
297
|
+
branch?: string;
|
|
271
298
|
/** Host-driver steer. Tokens never belong here. */
|
|
272
299
|
browser?: BrowserDriverContract;
|
|
273
300
|
/** See StartAppResult.checkpointCommitId. */
|
|
274
301
|
checkpointCommitId?: string;
|
|
302
|
+
checkpointFailure?: CheckpointFailure;
|
|
303
|
+
checkpointWarning?: CheckpointWarning;
|
|
275
304
|
/** Absent while the build is still running (`wait: "ack"`). */
|
|
276
305
|
reply?: string;
|
|
277
306
|
/** Present when status is needs_decision. */
|
|
@@ -284,6 +313,7 @@ export type EditAppResult = {
|
|
|
284
313
|
* approved, so the caller can see it does not need to re-send mode.
|
|
285
314
|
*/
|
|
286
315
|
mode?: "BUILD" | "PLAN";
|
|
316
|
+
pendingAction?: PendingAppAction;
|
|
287
317
|
/** Mid-turn testApi / testIntegration outcomes when the turn finished. */
|
|
288
318
|
recentRuns?: RecentToolRun[];
|
|
289
319
|
status: BuildStatus;
|
|
@@ -306,6 +336,7 @@ export type PreviewAppInput = {
|
|
|
306
336
|
};
|
|
307
337
|
export type PreviewAppResult = {
|
|
308
338
|
applicationId: string;
|
|
339
|
+
branch?: string;
|
|
309
340
|
browser?: BrowserDriverContract;
|
|
310
341
|
/**
|
|
311
342
|
* True when preview URLs are returned but Gateway cannot screenshot because
|
|
@@ -314,6 +345,7 @@ export type PreviewAppResult = {
|
|
|
314
345
|
needsBrowserDriver?: boolean;
|
|
315
346
|
/** Commit that was built and is being previewed. */
|
|
316
347
|
commitId: string;
|
|
348
|
+
directoryHash: string;
|
|
317
349
|
/** Editor URL for the same app (MCP App Open editor button). */
|
|
318
350
|
editUrl: string;
|
|
319
351
|
/** Display name, so callers can say more than a UUID. Absent when unknown. */
|
|
@@ -333,32 +365,30 @@ export type PreviewAppResult = {
|
|
|
333
365
|
* capture was skipped (still building) or soft-failed.
|
|
334
366
|
*/
|
|
335
367
|
screenshotBase64?: string;
|
|
368
|
+
/** Why a ready preview could not be screenshotted. */
|
|
369
|
+
screenshotUnavailableReason?: string;
|
|
336
370
|
/**
|
|
337
|
-
* `building` means
|
|
338
|
-
*
|
|
371
|
+
* `building` means SABS has not finished building this commit yet.
|
|
372
|
+
* Poll get_preview_status with this commit and directory hash.
|
|
339
373
|
*/
|
|
340
374
|
status: "building" | "ready";
|
|
341
375
|
};
|
|
376
|
+
export type PreviewStatusInput = {
|
|
377
|
+
applicationId: string;
|
|
378
|
+
branch?: string;
|
|
379
|
+
commitId: string;
|
|
380
|
+
directoryHash: string;
|
|
381
|
+
wait?: boolean;
|
|
382
|
+
};
|
|
383
|
+
export type PreviewStatusResult = PreviewStatusInput & {
|
|
384
|
+
editUrl: string;
|
|
385
|
+
status: "building" | "failed" | "ready";
|
|
386
|
+
};
|
|
342
387
|
export type GetAppInput = {
|
|
343
388
|
applicationId?: string;
|
|
344
389
|
branch?: string;
|
|
345
|
-
/**
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Whether to wait for the preview build.
|
|
349
|
-
*
|
|
350
|
-
* A boolean, and deliberately not the {@link TurnWait} the prompt
|
|
351
|
-
* capabilities take: this decides how long *this call* blocks on a build,
|
|
352
|
-
* while `wait: "ack"` decides how far a prompt follows the turn it starts.
|
|
353
|
-
* Conflating them would make `wait: "ack"` mean something here, where there
|
|
354
|
-
* is no turn to acknowledge.
|
|
355
|
-
*
|
|
356
|
-
* `false` starts or observes the build and returns straight away with
|
|
357
|
-
* `status: "building"` and pacing to poll on. `true` (the default) waits,
|
|
358
|
-
* but never past the host's tool-call ceiling — it returns `building` with
|
|
359
|
-
* the same pacing rather than holding the call open.
|
|
360
|
-
*/
|
|
361
|
-
wait?: boolean;
|
|
390
|
+
/** Whether to capture a screenshot. Defaults to true. */
|
|
391
|
+
includeScreenshot?: boolean;
|
|
362
392
|
};
|
|
363
393
|
/**
|
|
364
394
|
* What has to happen before this app has anything worth previewing. Present
|
|
@@ -366,20 +396,37 @@ export type GetAppInput = {
|
|
|
366
396
|
* says why.
|
|
367
397
|
*/
|
|
368
398
|
export type PendingAppAction =
|
|
399
|
+
/** Superblocks requested a datasource the MCP host must create. */
|
|
400
|
+
"create_integration"
|
|
369
401
|
/** Clark asked a multi_choice question; answer it with `edit_app`. */
|
|
370
|
-
"answer_question"
|
|
402
|
+
| "answer_question"
|
|
371
403
|
/** Clark proposed a plan; `edit_app` with `planAction: "approve"` builds it. */
|
|
372
404
|
| "approve_plan"
|
|
405
|
+
/**
|
|
406
|
+
* Clark is waiting on the user, and the gateway cannot say what it is
|
|
407
|
+
* asking: the turn ended on a decision it streamed as ordinary chat text,
|
|
408
|
+
* so nothing structured was captured and no plan was remembered either.
|
|
409
|
+
*
|
|
410
|
+
* A distinct value because the alternative was reporting `answer_question`
|
|
411
|
+
* with no question attached, which told the caller to put a decision to the
|
|
412
|
+
* user that it had no way to see - and re-reading only returned the same
|
|
413
|
+
* thing (ENG-5910). The honest answer is that this one has to be finished in
|
|
414
|
+
* the editor.
|
|
415
|
+
*/
|
|
416
|
+
| "decide_in_editor"
|
|
417
|
+
/** The build finished, but its checkpoint failed; inspect it in the editor. */
|
|
418
|
+
| "open_editor"
|
|
419
|
+
/** A newly created app is wedged; recreate it with `start_app`. */
|
|
420
|
+
| "start_new_app"
|
|
373
421
|
/** The last turn ended without writing anything; `edit_app` starts it over. */
|
|
374
422
|
| "retry_build"
|
|
375
|
-
/** The import failed before writing anything; `import_app` retries it. */
|
|
376
|
-
| "retry_import"
|
|
377
423
|
/** A turn is in flight; follow it with `check_app_progress`. */
|
|
378
424
|
| "wait_for_build";
|
|
379
|
-
export type GetAppResult =
|
|
425
|
+
export type GetAppResult = {
|
|
380
426
|
applicationId: string;
|
|
427
|
+
branch?: string;
|
|
381
428
|
browser?: BrowserDriverContract;
|
|
382
|
-
|
|
429
|
+
checkpointFailure?: CheckpointFailure;
|
|
383
430
|
/** The question or plan Clark is waiting on, when status is needs_decision. */
|
|
384
431
|
decision?: DecisionPayload;
|
|
385
432
|
editUrl: string;
|
|
@@ -388,16 +435,41 @@ export type GetAppResult = Partial<PollPacing> & {
|
|
|
388
435
|
openableViaHttps?: boolean;
|
|
389
436
|
/** Set whenever no preview was built; says what unblocks one. */
|
|
390
437
|
pendingAction?: PendingAppAction;
|
|
438
|
+
/** Why the last turn left nothing to preview, when that reason is known. */
|
|
439
|
+
reply?: string;
|
|
391
440
|
needsBrowserDriver?: boolean;
|
|
441
|
+
/** Live editor preview opened in fullscreen mode. */
|
|
392
442
|
previewUrl?: string;
|
|
393
443
|
publishUrl?: string;
|
|
394
444
|
screenshotBase64?: string;
|
|
445
|
+
screenshotUnavailableReason?: string;
|
|
395
446
|
/**
|
|
396
447
|
* `cancelled`, `live_edit_terminated`, `no_changes` and `timeout` mean the
|
|
397
448
|
* last turn left nothing to show, so no preview was built for it.
|
|
398
449
|
*/
|
|
399
|
-
status: "building" | "cancelled" | "live_edit_terminated" | "needs_decision" | "no_changes" | "ready" | "timeout"
|
|
400
|
-
|
|
450
|
+
status: "building" | "cancelled" | "checkpoint_failed" | "detached" | "live_edit_terminated" | "needs_decision" | "no_changes" | "ready" | "timeout";
|
|
451
|
+
};
|
|
452
|
+
export type AskUserInput = {
|
|
453
|
+
applicationId?: string;
|
|
454
|
+
branch?: string;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* What the decision card renders. The card cannot read AppState, so the plan
|
|
458
|
+
* or question travels here in full — a form built from a summary would ask the
|
|
459
|
+
* user to approve something other than what Superblocks proposed.
|
|
460
|
+
*/
|
|
461
|
+
export type AskUserResult = {
|
|
462
|
+
applicationId: string;
|
|
463
|
+
branch?: string;
|
|
464
|
+
/** Absent when nothing is waiting on the user; `status` says what is. */
|
|
465
|
+
decision?: DecisionPayload;
|
|
466
|
+
editUrl: string;
|
|
467
|
+
/** Display name, so the card says more than a UUID. */
|
|
468
|
+
name?: string;
|
|
469
|
+
pendingAction?: PendingAppAction;
|
|
470
|
+
/** Superblocks' own words on the turn that stopped. */
|
|
471
|
+
reply?: string;
|
|
472
|
+
status: BuildStatus;
|
|
401
473
|
};
|
|
402
474
|
export type PublishAppInput = {
|
|
403
475
|
applicationId?: string;
|
|
@@ -406,21 +478,46 @@ export type PublishAppInput = {
|
|
|
406
478
|
idempotencyKey: string;
|
|
407
479
|
prompt: string;
|
|
408
480
|
};
|
|
481
|
+
export type CheckPublishProgressInput = {
|
|
482
|
+
applicationId?: string;
|
|
483
|
+
/**
|
|
484
|
+
* Which commit's deploy to follow. Defaults to the one `publish_app` queued
|
|
485
|
+
* for this application, so a caller that did not carry the id back can still
|
|
486
|
+
* follow its own publish.
|
|
487
|
+
*/
|
|
488
|
+
commitId?: string;
|
|
489
|
+
};
|
|
409
490
|
export type PublishAppResult = {
|
|
410
491
|
applicationId: string;
|
|
411
492
|
commitId: string;
|
|
412
|
-
/**
|
|
413
|
-
|
|
493
|
+
/** How long the rollout has been running, so a quiet poll still has news. */
|
|
494
|
+
elapsedSeconds?: number;
|
|
495
|
+
publishDetailsUrl: string;
|
|
414
496
|
publishUrl: string;
|
|
415
|
-
|
|
497
|
+
/**
|
|
498
|
+
* `deployed` once the app is live. `publishing` means the deploy was
|
|
499
|
+
* accepted and is still running: the publish itself succeeded, and only the
|
|
500
|
+
* rollout is outstanding. It used to be reported as a `publish_timeout`
|
|
501
|
+
* error, because the call blocked on the rollout until it outlived the
|
|
502
|
+
* host's tool-call ceiling (ENG-6172).
|
|
503
|
+
*/
|
|
504
|
+
status: "deployed" | "publishing";
|
|
416
505
|
};
|
|
417
506
|
/**
|
|
418
|
-
* Gateway MCP/HTTP import rejects archives above this size
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
507
|
+
* Gateway MCP/HTTP import rejects archives above this size, matching the
|
|
508
|
+
* Superblocks archive attachment upload cap. Larger ZIPs often include
|
|
509
|
+
* `node_modules` (or similar); those belong outside the export — deps are
|
|
510
|
+
* installed on or after import.
|
|
511
|
+
*/
|
|
512
|
+
export declare const IMPORT_ZIP_MAX_BYTES: number;
|
|
513
|
+
/**
|
|
514
|
+
* Ceiling on inline `files` payloads, which the model writes out itself rather
|
|
515
|
+
* than naming a file the gateway reads. It stays well below
|
|
516
|
+
* {@link IMPORT_ZIP_MAX_BYTES} for the same reason `zipBase64` does: an archive
|
|
517
|
+
* cap sized for bytes on disk is meaningless for content a model has to emit
|
|
518
|
+
* one token at a time.
|
|
422
519
|
*/
|
|
423
|
-
export declare const
|
|
520
|
+
export declare const IMPORT_SOURCE_FILES_MAX_BYTES = 1048576;
|
|
424
521
|
/**
|
|
425
522
|
* Ceiling on an inline `zipBase64` payload, far below
|
|
426
523
|
* {@link IMPORT_ZIP_MAX_BYTES} because base64 is not a transport a model can
|
|
@@ -430,22 +527,3 @@ export declare const IMPORT_ZIP_MAX_BYTES = 1048576;
|
|
|
430
527
|
* carries test fixtures.
|
|
431
528
|
*/
|
|
432
529
|
export declare const IMPORT_ZIP_BASE64_MAX_CHARS = 8192;
|
|
433
|
-
/** Third-party import source ids Clark uses for migration prompts and billing. */
|
|
434
|
-
export type ImportAppSource = "chatgpt" | "claude" | "claude-design" | "lovable" | "replit" | "streamlit" | "v0" | "zip";
|
|
435
|
-
export type ImportAppInput = {
|
|
436
|
-
applicationId?: string;
|
|
437
|
-
branch?: string;
|
|
438
|
-
idempotencyKey: string;
|
|
439
|
-
/** Defaults to PLAN. */
|
|
440
|
-
mode?: "BUILD" | "PLAN";
|
|
441
|
-
name?: string;
|
|
442
|
-
/** Extra intent appended after the migration template (e.g. harden security). */
|
|
443
|
-
prompt?: string;
|
|
444
|
-
source?: ImportAppSource | string;
|
|
445
|
-
wait?: TurnWait;
|
|
446
|
-
/** Absolute path on the gateway host; mutually exclusive with zipBase64. */
|
|
447
|
-
zipBase64?: string;
|
|
448
|
-
zipPath?: string;
|
|
449
|
-
};
|
|
450
|
-
/** Same shape as {@link StartAppResult}: import creates an app then starts Clark. */
|
|
451
|
-
export type ImportAppResult = StartAppResult;
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
* added later, which is how a dead live edit came to be reported as `ready`
|
|
7
7
|
* in the first place; this way the compiler stops the next one.
|
|
8
8
|
*/
|
|
9
|
-
export function buildStatusOf(generationStatus) {
|
|
9
|
+
export function buildStatusOf(generationStatus, checkpointFailure) {
|
|
10
|
+
if (checkpointFailure) {
|
|
11
|
+
return "checkpoint_failed";
|
|
12
|
+
}
|
|
10
13
|
switch (generationStatus) {
|
|
11
14
|
case "cancelled":
|
|
12
15
|
return "cancelled";
|
|
@@ -29,12 +32,48 @@ export function buildStatusOf(generationStatus) {
|
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
35
|
+
* How a `check_app_progress` poll reads as a build status.
|
|
36
|
+
*
|
|
37
|
+
* Running and unknown map directly. A finished poll uses {@link buildStatusOf},
|
|
38
|
+
* except a successful checkpoint that paused for missing integrations: that is
|
|
39
|
+
* a decision, even when generationStatus is still `completed`.
|
|
40
|
+
*/
|
|
41
|
+
export function progressStatusOf(update) {
|
|
42
|
+
switch (update.status) {
|
|
43
|
+
case "running":
|
|
44
|
+
return "building";
|
|
45
|
+
case "unknown":
|
|
46
|
+
return "unknown";
|
|
47
|
+
case "finished":
|
|
48
|
+
return finishedProgressStatus(update);
|
|
49
|
+
default: {
|
|
50
|
+
const unhandled = update;
|
|
51
|
+
return unhandled;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function finishedProgressStatus(update) {
|
|
56
|
+
if (!update.checkpointFailure &&
|
|
57
|
+
update.decision?.kind === "missing_integrations") {
|
|
58
|
+
return "needs_decision";
|
|
59
|
+
}
|
|
60
|
+
return buildStatusOf(update.generationStatus, update.checkpointFailure);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gateway MCP/HTTP import rejects archives above this size, matching the
|
|
64
|
+
* Superblocks archive attachment upload cap. Larger ZIPs often include
|
|
65
|
+
* `node_modules` (or similar); those belong outside the export — deps are
|
|
66
|
+
* installed on or after import.
|
|
67
|
+
*/
|
|
68
|
+
export const IMPORT_ZIP_MAX_BYTES = 50 * 1024 * 1024;
|
|
69
|
+
/**
|
|
70
|
+
* Ceiling on inline `files` payloads, which the model writes out itself rather
|
|
71
|
+
* than naming a file the gateway reads. It stays well below
|
|
72
|
+
* {@link IMPORT_ZIP_MAX_BYTES} for the same reason `zipBase64` does: an archive
|
|
73
|
+
* cap sized for bytes on disk is meaningless for content a model has to emit
|
|
74
|
+
* one token at a time.
|
|
36
75
|
*/
|
|
37
|
-
export const
|
|
76
|
+
export const IMPORT_SOURCE_FILES_MAX_BYTES = 1_048_576;
|
|
38
77
|
/**
|
|
39
78
|
* Ceiling on an inline `zipBase64` payload, far below
|
|
40
79
|
* {@link IMPORT_ZIP_MAX_BYTES} because base64 is not a transport a model can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/capabilities/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/capabilities/types.ts"],"names":[],"mappings":"AA8JA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,gBAAkC,EAClC,iBAAqC;IAErC,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,QAAQ,gBAAgB,EAAE,CAAC;QACzB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB,KAAK,WAAW;YACd,OAAO,OAAO,CAAC;QACjB,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;QACpB,KAAK,sBAAsB;YACzB,OAAO,sBAAsB,CAAC;QAChC,KAAK,gBAAgB;YACnB,OAAO,gBAAgB,CAAC;QAC1B,KAAK,YAAY;YACf,OAAO,YAAY,CAAC;QACtB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,SAAS,GAAU,gBAAgB,CAAC;YAC1C,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IACjD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,SAAS;YACZ,OAAO,UAAU,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,SAAS,GAAU,MAAM,CAAC;YAChC,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAC7B,MAAmD;IAEnD,IACE,CAAC,MAAM,CAAC,iBAAiB;QACzB,MAAM,CAAC,QAAQ,EAAE,IAAI,KAAK,sBAAsB,EAChD,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC1E,CAAC;AAuYD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC"}
|