unfazed 0.6.0 → 0.8.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 (54) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +299 -78
  3. package/REFERENCE.md +284 -0
  4. package/dist/cli/login.d.ts +129 -0
  5. package/dist/cli/login.js +596 -0
  6. package/dist/cli/login.js.map +1 -0
  7. package/dist/cli/workflow.d.ts +31 -0
  8. package/dist/cli/workflow.js +157 -0
  9. package/dist/cli/workflow.js.map +1 -0
  10. package/dist/cli.d.ts +2 -0
  11. package/dist/cli.js +173 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/client.d.ts +26 -5
  14. package/dist/client.js +93 -48
  15. package/dist/client.js.map +1 -1
  16. package/dist/credentials.d.ts +123 -0
  17. package/dist/credentials.js +317 -0
  18. package/dist/credentials.js.map +1 -0
  19. package/dist/errors.d.ts +64 -0
  20. package/dist/errors.js +95 -0
  21. package/dist/errors.js.map +1 -1
  22. package/dist/generated/gql.d.ts +78 -2
  23. package/dist/generated/gql.js +21 -2
  24. package/dist/generated/gql.js.map +1 -1
  25. package/dist/generated/graphql.d.ts +505 -6
  26. package/dist/generated/graphql.js +439 -2
  27. package/dist/generated/graphql.js.map +1 -1
  28. package/dist/index.d.ts +25 -6
  29. package/dist/index.js +23 -5
  30. package/dist/index.js.map +1 -1
  31. package/dist/operations.d.ts +116 -5
  32. package/dist/operations.js +379 -7
  33. package/dist/operations.js.map +1 -1
  34. package/dist/reference.d.ts +18 -0
  35. package/dist/reference.generated.d.ts +2 -0
  36. package/dist/reference.generated.js +5 -0
  37. package/dist/reference.generated.js.map +1 -0
  38. package/dist/reference.js +38 -0
  39. package/dist/reference.js.map +1 -0
  40. package/dist/remote/app.js +2 -1
  41. package/dist/remote/app.js.map +1 -1
  42. package/dist/remote/world.d.ts +2 -2
  43. package/dist/remote/world.js +32 -16
  44. package/dist/remote/world.js.map +1 -1
  45. package/dist/unfazed.d.ts +545 -68
  46. package/dist/unfazed.js +688 -64
  47. package/dist/unfazed.js.map +1 -1
  48. package/dist/wait.d.ts +7 -0
  49. package/dist/wait.js.map +1 -1
  50. package/dist/workflow/nitro.js +5 -3
  51. package/dist/workflow/nitro.js.map +1 -1
  52. package/package.json +22 -6
  53. package/schema/SOURCE.json +4 -4
  54. package/schema/schema.graphqls +1628 -30
@@ -18,15 +18,35 @@ export declare const ListWorkspacesDocument: import("./index.js").TypedDocumentS
18
18
  /**
19
19
  * Deleting a workspace, with the deployment cascade made explicit.
20
20
  *
21
- * `withDeployments` is not decoration: without it the server REFUSES while the
22
- * workspace has any deployment history at all — including FAILED records —
23
- * with `workspace %q still has deployments; delete them first`. A workspace
24
- * that was ever deployed is therefore undeletable through the bare mutation,
25
- * so the SDK always sends the flag and lets the caller choose the value.
21
+ * Without `withDeployments` the server REFUSES while the workspace has any
22
+ * deployment record at all — FAILED ones included — with `workspace %q still
23
+ * has deployments; delete them first`. With it, the delete takes down every
24
+ * app the workspace serves, so `confirmAliases` must name exactly those apps
25
+ * (`Workspace.liveApps`); a missing or extra alias refuses the delete, deletes
26
+ * nothing, and the error lists the live apps. The SDK always sends the flag
27
+ * and never fills in the aliases: the caller names what goes.
26
28
  */
27
29
  export declare const DeleteWorkspaceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteWorkspaceMutation, {
28
30
  workspaceID: string | number;
29
31
  withDeployments?: boolean | null | undefined | undefined;
32
+ confirmAliases?: string | string[] | null | undefined;
33
+ }>;
34
+ /**
35
+ * The apps a workspace serves right now: what `deleteWorkspace` with
36
+ * `withDeployments` takes offline, and exactly the list its `confirmAliases`
37
+ * must name. `workspace` is null when the id is absent or not the caller's.
38
+ */
39
+ export declare const WorkspaceLiveAppsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWorkspaceLiveAppsQuery, {
40
+ id: string | number;
41
+ }>;
42
+ /**
43
+ * Deleting ONE app of a workspace: every deployment of the alias there, its
44
+ * App State, app-scoped env and secrets, and integration bindings. The
45
+ * workspace, its files and its other apps keep serving.
46
+ */
47
+ export declare const DeleteAppDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeleteAppMutation, {
48
+ workspaceID: string | number;
49
+ alias: string;
30
50
  }>;
31
51
  export declare const WriteTextFileDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWriteTextFileMutation, {
32
52
  workspaceID: string | number;
@@ -38,6 +58,82 @@ export declare const WriteBase64FileDocument: import("./index.js").TypedDocument
38
58
  path: string;
39
59
  contentBase64: string;
40
60
  }>;
61
+ /** The commit a file write made on an app with platform git (MCP's `commit`). */
62
+ export declare const FileCommitFieldsFragment: import("./index.js").TypedDocumentString<import("./index.js").FileCommitFieldsFragment, unknown>;
63
+ /**
64
+ * The batch write (MCP `write_workspace_files`): every file in ONE request
65
+ * and, on an app with platform git, ONE commit for the whole call.
66
+ */
67
+ export declare const WriteFilesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWriteFilesMutation, {
68
+ workspaceID: string | number;
69
+ files: Array<import("./index.js").WorkspaceFileWriteInput> | import("./index.js").WorkspaceFileWriteInput;
70
+ commitMessage?: string | null | undefined | undefined;
71
+ }>;
72
+ /** One page of an app's platform git history, newest first (MCP `list_commits`). */
73
+ export declare const AppCommitsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkAppCommitsQuery, {
74
+ workspaceID: string | number;
75
+ limit?: number | null | undefined | undefined;
76
+ before?: string | null | undefined | undefined;
77
+ }>;
78
+ /** Only what `waitForCommit` reads: whether writes still wait, and the head. */
79
+ export declare const AppCommitsWaitingDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkAppCommitsWaitingQuery, {
80
+ workspaceID: string | number;
81
+ }>;
82
+ /**
83
+ * The app's git link as the last import left it: what `restoreVersion` waits
84
+ * on, since the deploy a restore queues is an import of the branch head.
85
+ */
86
+ export declare const WorkspaceGitSourceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWorkspaceGitSourceQuery, {
87
+ id: string | number;
88
+ }>;
89
+ /** One commit with its diff (MCP `get_commit`). */
90
+ export declare const AppCommitDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkAppCommitQuery, {
91
+ workspaceID: string | number;
92
+ sha: string;
93
+ }>;
94
+ /** Give the app back an earlier commit's files (MCP `restore_version`). */
95
+ export declare const RestoreVersionDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRestoreVersionMutation, {
96
+ workspaceID: string | number;
97
+ sha: string;
98
+ expectedHead?: string | null | undefined | undefined;
99
+ message?: string | null | undefined | undefined;
100
+ }>;
101
+ /** A service app's error group, as MCP `list_errors` shows it. */
102
+ export declare const AppErrorGroupFieldsFragment: import("./index.js").TypedDocumentString<import("./index.js").AppErrorGroupFieldsFragment, unknown>;
103
+ export declare const AppErrorsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkAppErrorsQuery, {
104
+ workspaceID: string | number;
105
+ alias: string;
106
+ status?: string | null | undefined | undefined;
107
+ limit?: number | null | undefined | undefined;
108
+ cursor?: string | null | undefined | undefined;
109
+ }>;
110
+ export declare const AppErrorGroupDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkAppErrorGroupQuery, {
111
+ workspaceID: string | number;
112
+ alias: string;
113
+ groupID: string | number;
114
+ }>;
115
+ export declare const ResolveErrorGroupDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkResolveErrorGroupMutation, {
116
+ input: import("./index.js").AppErrorGroupInput;
117
+ }>;
118
+ export declare const MuteErrorGroupDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkMuteErrorGroupMutation, {
119
+ input: import("./index.js").AppErrorGroupInput;
120
+ }>;
121
+ export declare const ReopenErrorGroupDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkReopenErrorGroupMutation, {
122
+ input: import("./index.js").AppErrorGroupInput;
123
+ }>;
124
+ /** The event types pollEvents/waitForEvents read (MCP `list_event_types`). */
125
+ export declare const EventTypesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkEventTypesQuery, {
126
+ [x: string]: never;
127
+ }>;
128
+ /** MCP `poll_events`: the same feed, cursors and filters. */
129
+ export declare const PollEventsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkPollEventsQuery, {
130
+ input?: import("./index.js").PlatformEventsInput | null | undefined;
131
+ }>;
132
+ /** MCP `wait_for_events`: pollEvents that blocks server-side (at most 50 s). */
133
+ export declare const WaitForEventsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWaitForEventsQuery, {
134
+ input?: import("./index.js").PlatformEventsInput | null | undefined;
135
+ timeoutSeconds?: number | null | undefined | undefined;
136
+ }>;
41
137
  export declare const ListFilesDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkListFilesQuery, {
42
138
  input: import("./index.js").ListWorkspaceFilesInput;
43
139
  }>;
@@ -88,10 +184,25 @@ export declare const ServiceLogsDocument: import("./index.js").TypedDocumentStri
88
184
  deploymentID: string | number;
89
185
  tailBytes?: number | null | undefined | undefined;
90
186
  }>;
187
+ /**
188
+ * Deployment events with their metadata: the timing events
189
+ * (`deployment.phases`, `deployment.build_finished`) carry their phases there
190
+ * as `*_ms` fields, which `parseDeploymentTimings` turns into numbers.
191
+ */
91
192
  export declare const DeploymentEventsDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkDeploymentEventsQuery, {
92
193
  deploymentID: string | number;
93
194
  limit?: number | null | undefined | undefined;
94
195
  }>;
196
+ /**
197
+ * The server-side wait (MCP `wait_for_deployment`): the control plane blocks
198
+ * until the deployment leaves BUILDING — woken by the deploy pipeline itself,
199
+ * not a timer — or its budget (at most 50 s) runs out. One round trip after
200
+ * READY instead of a poll interval, and the full deployment in the answer.
201
+ */
202
+ export declare const WaitForDeploymentDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkWaitForDeploymentQuery, {
203
+ id: string | number;
204
+ timeoutSeconds?: number | null | undefined | undefined;
205
+ }>;
95
206
  export declare const RestartServiceDocument: import("./index.js").TypedDocumentString<import("./index.js").SdkRestartServiceMutation, {
96
207
  deploymentID: string | number;
97
208
  }>;
@@ -100,19 +100,66 @@ export const ListWorkspacesDocument = graphql(`
100
100
  /**
101
101
  * Deleting a workspace, with the deployment cascade made explicit.
102
102
  *
103
- * `withDeployments` is not decoration: without it the server REFUSES while the
104
- * workspace has any deployment history at all — including FAILED records —
105
- * with `workspace %q still has deployments; delete them first`. A workspace
106
- * that was ever deployed is therefore undeletable through the bare mutation,
107
- * so the SDK always sends the flag and lets the caller choose the value.
103
+ * Without `withDeployments` the server REFUSES while the workspace has any
104
+ * deployment record at all — FAILED ones included — with `workspace %q still
105
+ * has deployments; delete them first`. With it, the delete takes down every
106
+ * app the workspace serves, so `confirmAliases` must name exactly those apps
107
+ * (`Workspace.liveApps`); a missing or extra alias refuses the delete, deletes
108
+ * nothing, and the error lists the live apps. The SDK always sends the flag
109
+ * and never fills in the aliases: the caller names what goes.
108
110
  */
109
111
  export const DeleteWorkspaceDocument = graphql(`
110
- mutation SdkDeleteWorkspace($workspaceID: ID!, $withDeployments: Boolean) {
111
- deleteWorkspace(input: { workspaceID: $workspaceID, withDeployments: $withDeployments }) {
112
+ mutation SdkDeleteWorkspace(
113
+ $workspaceID: ID!
114
+ $withDeployments: Boolean
115
+ $confirmAliases: [String!]
116
+ ) {
117
+ deleteWorkspace(
118
+ input: {
119
+ workspaceID: $workspaceID
120
+ withDeployments: $withDeployments
121
+ confirmAliases: $confirmAliases
122
+ }
123
+ ) {
112
124
  ok
113
125
  }
114
126
  }
115
127
  `);
128
+ /**
129
+ * The apps a workspace serves right now: what `deleteWorkspace` with
130
+ * `withDeployments` takes offline, and exactly the list its `confirmAliases`
131
+ * must name. `workspace` is null when the id is absent or not the caller's.
132
+ */
133
+ export const WorkspaceLiveAppsDocument = graphql(`
134
+ query SdkWorkspaceLiveApps($id: ID!) {
135
+ workspace(id: $id) {
136
+ id
137
+ liveApps {
138
+ alias
139
+ deploymentID
140
+ domains
141
+ }
142
+ }
143
+ }
144
+ `);
145
+ /**
146
+ * Deleting ONE app of a workspace: every deployment of the alias there, its
147
+ * App State, app-scoped env and secrets, and integration bindings. The
148
+ * workspace, its files and its other apps keep serving.
149
+ */
150
+ export const DeleteAppDocument = graphql(`
151
+ mutation SdkDeleteApp($workspaceID: ID!, $alias: String!) {
152
+ deleteApp(input: { workspaceID: $workspaceID, alias: $alias }) {
153
+ ok
154
+ alias
155
+ deployments
156
+ domains
157
+ envEntries
158
+ skippedOnSync
159
+ otherApps
160
+ }
161
+ }
162
+ `);
116
163
  export const WriteTextFileDocument = graphql(`
117
164
  mutation SdkWriteTextFile($workspaceID: ID!, $path: String!, $text: String!) {
118
165
  writeWorkspaceTextFile(input: { workspaceID: $workspaceID, path: $path, text: $text }) {
@@ -141,6 +188,307 @@ export const WriteBase64FileDocument = graphql(`
141
188
  }
142
189
  }
143
190
  `);
191
+ /** The commit a file write made on an app with platform git (MCP's `commit`). */
192
+ export const FileCommitFieldsFragment = graphql(`
193
+ fragment FileCommitFields on FileCommit {
194
+ sha
195
+ branch
196
+ message
197
+ committed
198
+ waiting
199
+ waitingCount
200
+ deploys
201
+ conflicts
202
+ writeSHA
203
+ paused
204
+ }
205
+ `);
206
+ /**
207
+ * The batch write (MCP `write_workspace_files`): every file in ONE request
208
+ * and, on an app with platform git, ONE commit for the whole call.
209
+ */
210
+ export const WriteFilesDocument = graphql(`
211
+ mutation SdkWriteFiles(
212
+ $workspaceID: ID!
213
+ $files: [WorkspaceFileWriteInput!]!
214
+ $commitMessage: String
215
+ ) {
216
+ writeWorkspaceFiles(
217
+ input: { workspaceID: $workspaceID, files: $files, commitMessage: $commitMessage }
218
+ ) {
219
+ workspaceID
220
+ written
221
+ failed
222
+ totalBytes
223
+ files {
224
+ path
225
+ ok
226
+ error
227
+ file {
228
+ path
229
+ sizeBytes
230
+ size
231
+ sha256
232
+ updatedAt
233
+ }
234
+ }
235
+ commit {
236
+ ...FileCommitFields
237
+ }
238
+ }
239
+ }
240
+ `);
241
+ /** One page of an app's platform git history, newest first (MCP `list_commits`). */
242
+ export const AppCommitsDocument = graphql(`
243
+ query SdkAppCommits($workspaceID: ID!, $limit: Int, $before: String) {
244
+ appCommits(workspaceID: $workspaceID, limit: $limit, before: $before) {
245
+ branch
246
+ head
247
+ nextBefore
248
+ autoDeploy
249
+ waitingCommits
250
+ waitingSince
251
+ commits {
252
+ sha
253
+ message
254
+ authorName
255
+ authorEmail
256
+ authoredAt
257
+ filesChanged
258
+ deployedTo
259
+ }
260
+ deployed {
261
+ alias
262
+ sha
263
+ deploymentID
264
+ }
265
+ }
266
+ }
267
+ `);
268
+ /** Only what `waitForCommit` reads: whether writes still wait, and the head. */
269
+ export const AppCommitsWaitingDocument = graphql(`
270
+ query SdkAppCommitsWaiting($workspaceID: ID!) {
271
+ appCommits(workspaceID: $workspaceID, limit: 1) {
272
+ branch
273
+ head
274
+ waitingCommits
275
+ waitingSince
276
+ }
277
+ }
278
+ `);
279
+ /**
280
+ * The app's git link as the last import left it: what `restoreVersion` waits
281
+ * on, since the deploy a restore queues is an import of the branch head.
282
+ */
283
+ export const WorkspaceGitSourceDocument = graphql(`
284
+ query SdkWorkspaceGitSource($id: ID!) {
285
+ workspace(id: $id) {
286
+ id
287
+ gitSource {
288
+ branch
289
+ autoDeploy
290
+ deployAlias
291
+ lastImportedCommit
292
+ lastImportedAt
293
+ lastImportStatus
294
+ lastImportError
295
+ }
296
+ }
297
+ }
298
+ `);
299
+ /** One commit with its diff (MCP `get_commit`). */
300
+ export const AppCommitDocument = graphql(`
301
+ query SdkAppCommit($workspaceID: ID!, $sha: String!) {
302
+ appCommit(workspaceID: $workspaceID, sha: $sha) {
303
+ commit {
304
+ sha
305
+ message
306
+ authorName
307
+ authorEmail
308
+ authoredAt
309
+ filesChanged
310
+ deployedTo
311
+ }
312
+ files {
313
+ path
314
+ status
315
+ }
316
+ patch
317
+ truncated
318
+ additions
319
+ deletions
320
+ }
321
+ }
322
+ `);
323
+ /** Give the app back an earlier commit's files (MCP `restore_version`). */
324
+ export const RestoreVersionDocument = graphql(`
325
+ mutation SdkRestoreVersion(
326
+ $workspaceID: ID!
327
+ $sha: String!
328
+ $expectedHead: String
329
+ $message: String
330
+ ) {
331
+ restoreAppVersion(
332
+ input: { workspaceID: $workspaceID, sha: $sha, expectedHead: $expectedHead, message: $message }
333
+ ) {
334
+ sha
335
+ committed
336
+ deploys
337
+ message
338
+ branch
339
+ deployAlias
340
+ restoredFrom
341
+ parent
342
+ }
343
+ }
344
+ `);
345
+ /** A service app's error group, as MCP `list_errors` shows it. */
346
+ export const AppErrorGroupFieldsFragment = graphql(`
347
+ fragment AppErrorGroupFields on AppErrorGroup {
348
+ id
349
+ title
350
+ type
351
+ culprit
352
+ level
353
+ status
354
+ count
355
+ storedEvents
356
+ firstSeen
357
+ lastSeen
358
+ firstDeploymentID
359
+ firstGitCommit
360
+ lastDeploymentID
361
+ lastGitCommit
362
+ resolvedInDeploymentID
363
+ resolvedAt
364
+ mutedAt
365
+ regressedAt
366
+ }
367
+ `);
368
+ export const AppErrorsDocument = graphql(`
369
+ query SdkAppErrors(
370
+ $workspaceID: ID!
371
+ $alias: String!
372
+ $status: String
373
+ $limit: Int
374
+ $cursor: String
375
+ ) {
376
+ appErrors(
377
+ workspaceID: $workspaceID
378
+ alias: $alias
379
+ status: $status
380
+ limit: $limit
381
+ cursor: $cursor
382
+ ) {
383
+ groups {
384
+ ...AppErrorGroupFields
385
+ }
386
+ nextCursor
387
+ note
388
+ }
389
+ }
390
+ `);
391
+ export const AppErrorGroupDocument = graphql(`
392
+ query SdkAppErrorGroup($workspaceID: ID!, $alias: String!, $groupID: ID!) {
393
+ appErrorGroup(workspaceID: $workspaceID, alias: $alias, groupID: $groupID) {
394
+ group {
395
+ ...AppErrorGroupFields
396
+ }
397
+ latestEvent
398
+ firstEvent {
399
+ eventID
400
+ at
401
+ deploymentID
402
+ level
403
+ }
404
+ recentEvents {
405
+ eventID
406
+ at
407
+ deploymentID
408
+ level
409
+ }
410
+ deployments {
411
+ deploymentID
412
+ gitCommit
413
+ current
414
+ count
415
+ firstSeen
416
+ lastSeen
417
+ }
418
+ fatal
419
+ vmID
420
+ }
421
+ }
422
+ `);
423
+ export const ResolveErrorGroupDocument = graphql(`
424
+ mutation SdkResolveErrorGroup($input: AppErrorGroupInput!) {
425
+ resolveAppErrorGroup(input: $input) {
426
+ ...AppErrorGroupFields
427
+ }
428
+ }
429
+ `);
430
+ export const MuteErrorGroupDocument = graphql(`
431
+ mutation SdkMuteErrorGroup($input: AppErrorGroupInput!) {
432
+ muteAppErrorGroup(input: $input) {
433
+ ...AppErrorGroupFields
434
+ }
435
+ }
436
+ `);
437
+ export const ReopenErrorGroupDocument = graphql(`
438
+ mutation SdkReopenErrorGroup($input: AppErrorGroupInput!) {
439
+ reopenAppErrorGroup(input: $input) {
440
+ ...AppErrorGroupFields
441
+ }
442
+ }
443
+ `);
444
+ /** The event types pollEvents/waitForEvents read (MCP `list_event_types`). */
445
+ export const EventTypesDocument = graphql(`
446
+ query SdkEventTypes {
447
+ platformEventTypes {
448
+ name
449
+ description
450
+ delivery
451
+ inputSchema
452
+ payloadSchema
453
+ }
454
+ }
455
+ `);
456
+ /** MCP `poll_events`: the same feed, cursors and filters. */
457
+ export const PollEventsDocument = graphql(`
458
+ query SdkPollEvents($input: PlatformEventsInput) {
459
+ pollEvents(input: $input) {
460
+ cursor
461
+ truncated
462
+ hasMore
463
+ nextPollMs
464
+ timedOut
465
+ events {
466
+ eventID
467
+ name
468
+ timestamp
469
+ data
470
+ }
471
+ }
472
+ }
473
+ `);
474
+ /** MCP `wait_for_events`: pollEvents that blocks server-side (at most 50 s). */
475
+ export const WaitForEventsDocument = graphql(`
476
+ query SdkWaitForEvents($input: PlatformEventsInput, $timeoutSeconds: Int) {
477
+ waitForEvents(input: $input, timeoutSeconds: $timeoutSeconds) {
478
+ cursor
479
+ truncated
480
+ hasMore
481
+ nextPollMs
482
+ timedOut
483
+ events {
484
+ eventID
485
+ name
486
+ timestamp
487
+ data
488
+ }
489
+ }
490
+ }
491
+ `);
144
492
  export const ListFilesDocument = graphql(`
145
493
  query SdkListFiles($input: ListWorkspaceFilesInput!) {
146
494
  workspaceFilesPage(input: $input) {
@@ -307,6 +655,11 @@ export const ServiceLogsDocument = graphql(`
307
655
  }
308
656
  }
309
657
  `);
658
+ /**
659
+ * Deployment events with their metadata: the timing events
660
+ * (`deployment.phases`, `deployment.build_finished`) carry their phases there
661
+ * as `*_ms` fields, which `parseDeploymentTimings` turns into numbers.
662
+ */
310
663
  export const DeploymentEventsDocument = graphql(`
311
664
  query SdkDeploymentEvents($deploymentID: ID!, $limit: Int) {
312
665
  deploymentEvents(deploymentID: $deploymentID, limit: $limit) {
@@ -317,10 +670,29 @@ export const DeploymentEventsDocument = graphql(`
317
670
  severity
318
671
  message
319
672
  vmID
673
+ metadata
320
674
  createdAt
321
675
  }
322
676
  }
323
677
  `);
678
+ /**
679
+ * The server-side wait (MCP `wait_for_deployment`): the control plane blocks
680
+ * until the deployment leaves BUILDING — woken by the deploy pipeline itself,
681
+ * not a timer — or its budget (at most 50 s) runs out. One round trip after
682
+ * READY instead of a poll interval, and the full deployment in the answer.
683
+ */
684
+ export const WaitForDeploymentDocument = graphql(`
685
+ query SdkWaitForDeployment($id: ID!, $timeoutSeconds: Int) {
686
+ waitForDeployment(id: $id, timeoutSeconds: $timeoutSeconds) {
687
+ timedOut
688
+ waitedMs
689
+ placement
690
+ deployment {
691
+ ...DeploymentFields
692
+ }
693
+ }
694
+ }
695
+ `);
324
696
  export const RestartServiceDocument = graphql(`
325
697
  mutation SdkRestartService($deploymentID: ID!) {
326
698
  restartService(input: { deploymentID: $deploymentID }) {