@feltdb/feltkit 0.3.11 → 0.3.13

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 (146) hide show
  1. package/README.md +4 -3
  2. package/dist/app.d.ts +98 -3
  3. package/dist/app.js +63 -0
  4. package/dist/app.js.map +1 -1
  5. package/dist/appboundry/build.d.ts +39 -1
  6. package/dist/appboundry/build.js +57 -6
  7. package/dist/appboundry/build.js.map +1 -1
  8. package/dist/appboundry/guest.js +46 -5
  9. package/dist/appboundry/guest.js.map +1 -1
  10. package/dist/appboundry/host.d.ts +24 -5
  11. package/dist/appboundry/host.js +234 -141
  12. package/dist/appboundry/host.js.map +1 -1
  13. package/dist/appboundry/runtime.d.ts +44 -0
  14. package/dist/appboundry/runtime.js +99 -0
  15. package/dist/appboundry/runtime.js.map +1 -0
  16. package/dist/cli/entry.d.ts +1 -0
  17. package/dist/cli/entry.js +4 -0
  18. package/dist/cli/entry.js.map +1 -0
  19. package/dist/cli/main.d.ts +5 -0
  20. package/dist/cli/main.js +550 -13
  21. package/dist/cli/main.js.map +1 -1
  22. package/dist/cli/test-reporter.d.ts +9 -0
  23. package/dist/cli/test-reporter.js +26 -0
  24. package/dist/cli/test-reporter.js.map +1 -0
  25. package/dist/client/index.d.ts +3 -0
  26. package/dist/client/index.js +3 -0
  27. package/dist/client/index.js.map +1 -1
  28. package/dist/dashboard/assets/index-BSnW2DC-.js +15 -0
  29. package/dist/dashboard/assets/{index-91I1zDK-.css → index-BXTNQAg1.css} +1 -1
  30. package/dist/dashboard/index.html +3 -3
  31. package/dist/docs.d.ts +12 -0
  32. package/dist/docs.js +42 -0
  33. package/dist/docs.js.map +1 -0
  34. package/dist/errors.d.ts +15 -0
  35. package/dist/errors.js +9 -0
  36. package/dist/errors.js.map +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/platform/changes.d.ts +340 -0
  40. package/dist/platform/changes.js +355 -0
  41. package/dist/platform/changes.js.map +1 -0
  42. package/dist/platform/deployments.d.ts +653 -0
  43. package/dist/platform/deployments.js +532 -0
  44. package/dist/platform/deployments.js.map +1 -0
  45. package/dist/platform/operations.d.ts +74 -0
  46. package/dist/platform/operations.js +198 -0
  47. package/dist/platform/operations.js.map +1 -0
  48. package/dist/platform/platform.d.ts +78 -0
  49. package/dist/platform/platform.js +264 -0
  50. package/dist/platform/platform.js.map +1 -0
  51. package/dist/platform/server.d.ts +25 -0
  52. package/dist/platform/server.js +165 -0
  53. package/dist/platform/server.js.map +1 -0
  54. package/dist/platform/source.d.ts +27 -0
  55. package/dist/platform/source.js +142 -0
  56. package/dist/platform/source.js.map +1 -0
  57. package/dist/runtime/activity.d.ts +25 -0
  58. package/dist/runtime/activity.js +38 -12
  59. package/dist/runtime/activity.js.map +1 -1
  60. package/dist/runtime/agent.d.ts +16 -0
  61. package/dist/runtime/agent.js +92 -28
  62. package/dist/runtime/agent.js.map +1 -1
  63. package/dist/runtime/backup-environment.d.ts +32 -0
  64. package/dist/runtime/backup-environment.js +92 -0
  65. package/dist/runtime/backup-environment.js.map +1 -0
  66. package/dist/runtime/backup.d.ts +129 -0
  67. package/dist/runtime/backup.js +344 -0
  68. package/dist/runtime/backup.js.map +1 -0
  69. package/dist/runtime/capabilities.js +4 -2
  70. package/dist/runtime/capabilities.js.map +1 -1
  71. package/dist/runtime/changes.js +2 -2
  72. package/dist/runtime/changes.js.map +1 -1
  73. package/dist/runtime/contract.js +4 -3
  74. package/dist/runtime/contract.js.map +1 -1
  75. package/dist/runtime/data.d.ts +36 -5
  76. package/dist/runtime/data.js +165 -55
  77. package/dist/runtime/data.js.map +1 -1
  78. package/dist/runtime/decisions.js +2 -1
  79. package/dist/runtime/decisions.js.map +1 -1
  80. package/dist/runtime/instance.js +17 -0
  81. package/dist/runtime/instance.js.map +1 -1
  82. package/dist/runtime/integrations.js +14 -6
  83. package/dist/runtime/integrations.js.map +1 -1
  84. package/dist/runtime/loader.js +28 -4
  85. package/dist/runtime/loader.js.map +1 -1
  86. package/dist/runtime/migration-context.d.ts +25 -0
  87. package/dist/runtime/migration-context.js +69 -0
  88. package/dist/runtime/migration-context.js.map +1 -0
  89. package/dist/runtime/outbox.d.ts +6 -82
  90. package/dist/runtime/outbox.js +14 -59
  91. package/dist/runtime/outbox.js.map +1 -1
  92. package/dist/runtime/readiness.js +18 -1
  93. package/dist/runtime/readiness.js.map +1 -1
  94. package/dist/runtime/runtime.d.ts +84 -8
  95. package/dist/runtime/runtime.js +372 -131
  96. package/dist/runtime/runtime.js.map +1 -1
  97. package/dist/runtime/services.d.ts +41 -5
  98. package/dist/runtime/services.js +49 -4
  99. package/dist/runtime/services.js.map +1 -1
  100. package/dist/runtime/sessions.js +4 -3
  101. package/dist/runtime/sessions.js.map +1 -1
  102. package/dist/runtime/state-contract.d.ts +167 -0
  103. package/dist/runtime/state-contract.js +438 -0
  104. package/dist/runtime/state-contract.js.map +1 -0
  105. package/dist/runtime/transactions.d.ts +199 -0
  106. package/dist/runtime/transactions.js +246 -0
  107. package/dist/runtime/transactions.js.map +1 -0
  108. package/dist/schema.d.ts +13 -1
  109. package/dist/schema.js +21 -2
  110. package/dist/schema.js.map +1 -1
  111. package/dist/server/admin.d.ts +3 -2
  112. package/dist/server/admin.js +62 -10
  113. package/dist/server/admin.js.map +1 -1
  114. package/dist/server/index.d.ts +6 -1
  115. package/dist/server/index.js +90 -9
  116. package/dist/server/index.js.map +1 -1
  117. package/dist/server/mcp.js +1 -1
  118. package/dist/server/mcp.js.map +1 -1
  119. package/dist/server/project.d.ts +5 -0
  120. package/dist/server/project.js +13 -2
  121. package/dist/server/project.js.map +1 -1
  122. package/dist/testing/index.d.ts +10 -3
  123. package/dist/testing/index.js +33 -7
  124. package/dist/testing/index.js.map +1 -1
  125. package/docs/AGENT-OPERATIONS.md +515 -0
  126. package/docs/APPBOUNDRY.md +240 -0
  127. package/docs/ARCHITECTURE.md +126 -0
  128. package/docs/BACKUP.md +115 -0
  129. package/docs/GUARANTEES.md +457 -0
  130. package/docs/PATH-TO-PRODUCTION.md +117 -0
  131. package/docs/README.md +15 -0
  132. package/docs/SECURITY.md +182 -0
  133. package/docs/TRANSACTIONS.md +216 -0
  134. package/docs/UPSTREAM-GAPS.md +270 -0
  135. package/docs/WHY-FELTKIT.md +64 -0
  136. package/docs/assets/feltkit-logo-dark.png +0 -0
  137. package/docs/assets/feltkit-logo.png +0 -0
  138. package/package.json +10 -8
  139. package/skills/.claude-plugin/marketplace.json +1 -1
  140. package/skills/.claude-plugin/plugin.json +3 -3
  141. package/skills/feltkit-agent/SKILL.md +9 -5
  142. package/skills/feltkit-build/SKILL.md +16 -4
  143. package/skills/feltkit-data/SKILL.md +20 -3
  144. package/skills/feltkit-services/SKILL.md +13 -7
  145. package/dist/dashboard/assets/index-BhFOquA7.js +0 -15
  146. package/dist/dashboard/theme.js +0 -11
@@ -0,0 +1,653 @@
1
+ import type { StateFirstDB } from "@feltdb/core";
2
+ import type { Caller } from "./changes.js";
3
+ export declare const ENVIRONMENTS = "feltkit.platform.environments";
4
+ export declare const DEPLOYMENTS = "feltkit.platform.deployments";
5
+ export declare const DEPLOYMENT_EVENTS = "feltkit.platform.deployment-events";
6
+ type Env = Record<string, string>;
7
+ type Cli = (cwd: string, args: string[], env?: Env) => Promise<{
8
+ code: number;
9
+ json: unknown;
10
+ stderr: string;
11
+ stdout: string;
12
+ }>;
13
+ export type DeployFault = (point: "deploy.built" | "deploy.started" | "deploy.verified", detail: {
14
+ release: string;
15
+ deploymentId: string;
16
+ pid?: number;
17
+ }) => void;
18
+ export declare function alive(pid: number | null | undefined): boolean;
19
+ export interface LiveReport {
20
+ ok: boolean;
21
+ status: string;
22
+ application: string;
23
+ environment: string;
24
+ pid: number;
25
+ startedAt: string;
26
+ deployment: {
27
+ id: string | null;
28
+ revision: string | null;
29
+ };
30
+ bundleSha256: string | null;
31
+ state: {
32
+ ok: boolean;
33
+ mode: string;
34
+ location: string;
35
+ schema?: {
36
+ status: string;
37
+ version: number | null;
38
+ hash: string | null;
39
+ migrations: number;
40
+ lastAppliedAt: string | null;
41
+ };
42
+ error?: string;
43
+ };
44
+ }
45
+ interface DeploymentRecord {
46
+ id: string;
47
+ project: string;
48
+ environment: string;
49
+ kind: "deploy" | "change";
50
+ source: {
51
+ revision: string;
52
+ contentDigest: string | null;
53
+ changeId: string | null;
54
+ tests?: unknown;
55
+ };
56
+ status: "deploying" | "live" | "superseded" | "failed" | "rolled_back" | "degraded";
57
+ stage: string;
58
+ release: string;
59
+ previous: {
60
+ deploymentId: string;
61
+ revision: string;
62
+ bundleSha256: string;
63
+ } | null;
64
+ artifact: {
65
+ application: string;
66
+ bundleSha256: string;
67
+ schemaHash: string | null;
68
+ verification: {
69
+ kind: "isolated-boot";
70
+ passed: boolean;
71
+ at: string;
72
+ };
73
+ } | null;
74
+ candidate: {
75
+ pid: number;
76
+ port: number;
77
+ startedAt: string;
78
+ } | null;
79
+ live: {
80
+ verifiedAt: string;
81
+ checks: Array<{
82
+ check: string;
83
+ ok: boolean;
84
+ expected?: unknown;
85
+ actual?: unknown;
86
+ }>;
87
+ report: LiveReport | null;
88
+ } | null;
89
+ backup: string | null;
90
+ rollback: Record<string, unknown> | null;
91
+ error: {
92
+ stage: string;
93
+ code: string;
94
+ message: string;
95
+ } | null;
96
+ receipt: Record<string, unknown> | null;
97
+ by: string;
98
+ decisionId: string;
99
+ requestId: string;
100
+ startedAt: string;
101
+ finishedAt: string | null;
102
+ events: number;
103
+ __version?: number;
104
+ }
105
+ export interface DeploymentsOptions {
106
+ cli: Cli;
107
+ /** The command that runs FeltKit's CLI: [executable, ...leading arguments]. */
108
+ command: () => string[];
109
+ projectDir: (project: string) => string;
110
+ /** How long a started process has to become ready and verifiable. */
111
+ readinessTimeoutMs?: number;
112
+ fault?: DeployFault;
113
+ }
114
+ export declare class Deployments {
115
+ #private;
116
+ readonly ready: Promise<{
117
+ recovered: string[];
118
+ }>;
119
+ constructor(db: StateFirstDB, options: DeploymentsOptions);
120
+ static volume(projectDir: string): string;
121
+ /** Stop a process: SIGTERM (FeltKit closes its runtime and releases the volume), then SIGKILL. */
122
+ stopProcess(pid: number | null | undefined): Promise<void>;
123
+ probe(url: string, token: string): Promise<{
124
+ status: number;
125
+ report: LiveReport | null;
126
+ error?: string;
127
+ }>;
128
+ /**
129
+ * Deploy the project's source as it is now (`source.revision`, checked by the caller) to local
130
+ * production. Returns the receipt, or throws after rolling back.
131
+ */
132
+ deploy(input: {
133
+ project: string;
134
+ projectDir: string;
135
+ environment: string;
136
+ kind: "deploy" | "change";
137
+ source: DeploymentRecord["source"];
138
+ }, caller: Caller): Promise<{
139
+ deployment: {
140
+ id: string;
141
+ project: string;
142
+ environment: string;
143
+ kind: "deploy" | "change";
144
+ source: {
145
+ revision: string;
146
+ contentDigest: string | null;
147
+ changeId: string | null;
148
+ tests?: unknown;
149
+ };
150
+ status: "deploying" | "live" | "superseded" | "failed" | "rolled_back" | "degraded";
151
+ stage: string;
152
+ release: string;
153
+ previous: {
154
+ deploymentId: string;
155
+ revision: string;
156
+ bundleSha256: string;
157
+ } | null;
158
+ artifact: {
159
+ application: string;
160
+ bundleSha256: string;
161
+ schemaHash: string | null;
162
+ verification: {
163
+ kind: "isolated-boot";
164
+ passed: boolean;
165
+ at: string;
166
+ };
167
+ } | null;
168
+ candidate: {
169
+ pid: number;
170
+ port: number;
171
+ startedAt: string;
172
+ } | null;
173
+ live: {
174
+ verifiedAt: string;
175
+ checks: Array<{
176
+ check: string;
177
+ ok: boolean;
178
+ expected?: unknown;
179
+ actual?: unknown;
180
+ }>;
181
+ report: LiveReport | null;
182
+ } | null;
183
+ backup: string | null;
184
+ rollback: Record<string, unknown> | null;
185
+ error: {
186
+ stage: string;
187
+ code: string;
188
+ message: string;
189
+ } | null;
190
+ receipt: Record<string, unknown> | null;
191
+ by: string;
192
+ decisionId: string;
193
+ requestId: string;
194
+ startedAt: string;
195
+ finishedAt: string | null;
196
+ events: number;
197
+ };
198
+ receipt: {
199
+ id: string;
200
+ kind: string;
201
+ project: string;
202
+ environment: string;
203
+ deploymentId: string;
204
+ changeId: string | null;
205
+ source: {
206
+ revision: string;
207
+ contentDigest: string | null;
208
+ };
209
+ artifact: {
210
+ release: string;
211
+ bundleSha256: string;
212
+ schemaHash: string | null;
213
+ verification: {
214
+ kind: "isolated-boot";
215
+ passed: boolean;
216
+ at: string;
217
+ };
218
+ };
219
+ live: {
220
+ verification: {
221
+ kind: string;
222
+ verifiedAt: string;
223
+ checks: ({
224
+ check: string;
225
+ ok: boolean;
226
+ expected: string;
227
+ actual: string | null;
228
+ } | {
229
+ check: string;
230
+ ok: boolean;
231
+ expected: string;
232
+ actual: string | undefined;
233
+ })[];
234
+ };
235
+ pid: number;
236
+ url: string;
237
+ startedAt: string;
238
+ application: string;
239
+ state: {
240
+ location: string;
241
+ mode: string;
242
+ };
243
+ };
244
+ health: {
245
+ status: string;
246
+ at: string;
247
+ };
248
+ migration: {
249
+ before: {
250
+ version: number | null;
251
+ hash: string | null;
252
+ migrations: number;
253
+ } | null;
254
+ after: {
255
+ version: number | null;
256
+ hash: string | null;
257
+ migrations: number;
258
+ } | null;
259
+ applied: boolean;
260
+ lastAppliedAt: string | null;
261
+ };
262
+ previous: {
263
+ deploymentId: string;
264
+ revision: string;
265
+ bundleSha256: string;
266
+ } | null;
267
+ authorizedBy: {
268
+ principal: string;
269
+ type: import("../index.js").PrincipalType;
270
+ decisionId: string;
271
+ };
272
+ issuedAt: string;
273
+ meaning: string;
274
+ };
275
+ replayed: boolean;
276
+ }>;
277
+ /** The current live deployment's receipt, if `revision` is what runs and it still verifies. */
278
+ current(project: string, environment: string, revision: string, projectDir: string): Promise<{
279
+ deployment: {
280
+ id: string;
281
+ project: string;
282
+ environment: string;
283
+ kind: "deploy" | "change";
284
+ source: {
285
+ revision: string;
286
+ contentDigest: string | null;
287
+ changeId: string | null;
288
+ tests?: unknown;
289
+ };
290
+ status: "deploying" | "live" | "superseded" | "failed" | "rolled_back" | "degraded";
291
+ stage: string;
292
+ release: string;
293
+ previous: {
294
+ deploymentId: string;
295
+ revision: string;
296
+ bundleSha256: string;
297
+ } | null;
298
+ artifact: {
299
+ application: string;
300
+ bundleSha256: string;
301
+ schemaHash: string | null;
302
+ verification: {
303
+ kind: "isolated-boot";
304
+ passed: boolean;
305
+ at: string;
306
+ };
307
+ } | null;
308
+ candidate: {
309
+ pid: number;
310
+ port: number;
311
+ startedAt: string;
312
+ } | null;
313
+ live: {
314
+ verifiedAt: string;
315
+ checks: Array<{
316
+ check: string;
317
+ ok: boolean;
318
+ expected?: unknown;
319
+ actual?: unknown;
320
+ }>;
321
+ report: LiveReport | null;
322
+ } | null;
323
+ backup: string | null;
324
+ rollback: Record<string, unknown> | null;
325
+ error: {
326
+ stage: string;
327
+ code: string;
328
+ message: string;
329
+ } | null;
330
+ receipt: Record<string, unknown> | null;
331
+ by: string;
332
+ decisionId: string;
333
+ requestId: string;
334
+ startedAt: string;
335
+ finishedAt: string | null;
336
+ events: number;
337
+ };
338
+ receipt: Record<string, unknown>;
339
+ replayed: boolean;
340
+ } | null>;
341
+ view(dep: DeploymentRecord): {
342
+ id: string;
343
+ project: string;
344
+ environment: string;
345
+ kind: "deploy" | "change";
346
+ source: {
347
+ revision: string;
348
+ contentDigest: string | null;
349
+ changeId: string | null;
350
+ tests?: unknown;
351
+ };
352
+ status: "deploying" | "live" | "superseded" | "failed" | "rolled_back" | "degraded";
353
+ stage: string;
354
+ release: string;
355
+ previous: {
356
+ deploymentId: string;
357
+ revision: string;
358
+ bundleSha256: string;
359
+ } | null;
360
+ artifact: {
361
+ application: string;
362
+ bundleSha256: string;
363
+ schemaHash: string | null;
364
+ verification: {
365
+ kind: "isolated-boot";
366
+ passed: boolean;
367
+ at: string;
368
+ };
369
+ } | null;
370
+ candidate: {
371
+ pid: number;
372
+ port: number;
373
+ startedAt: string;
374
+ } | null;
375
+ live: {
376
+ verifiedAt: string;
377
+ checks: Array<{
378
+ check: string;
379
+ ok: boolean;
380
+ expected?: unknown;
381
+ actual?: unknown;
382
+ }>;
383
+ report: LiveReport | null;
384
+ } | null;
385
+ backup: string | null;
386
+ rollback: Record<string, unknown> | null;
387
+ error: {
388
+ stage: string;
389
+ code: string;
390
+ message: string;
391
+ } | null;
392
+ receipt: Record<string, unknown> | null;
393
+ by: string;
394
+ decisionId: string;
395
+ requestId: string;
396
+ startedAt: string;
397
+ finishedAt: string | null;
398
+ events: number;
399
+ };
400
+ status(project: string, environment: string): Promise<{
401
+ environment: {
402
+ project: string;
403
+ environment: string;
404
+ status: "degraded" | "none" | "deploying" | "live";
405
+ port: number | null;
406
+ active: {
407
+ deploymentId: string;
408
+ release: string;
409
+ revision: string;
410
+ bundleSha256: string;
411
+ pid: number;
412
+ port: number;
413
+ url: string;
414
+ startedAt: string;
415
+ schema: {
416
+ version: number | null;
417
+ hash: string | null;
418
+ migrations: number;
419
+ } | null;
420
+ } | null;
421
+ inProgress: string | null;
422
+ last: {
423
+ deploymentId: string;
424
+ outcome: string;
425
+ at: string;
426
+ } | null;
427
+ degraded: {
428
+ reason: string;
429
+ at: string;
430
+ deploymentId: string;
431
+ } | null;
432
+ };
433
+ inProgress: {
434
+ id: string;
435
+ project: string;
436
+ environment: string;
437
+ kind: "deploy" | "change";
438
+ source: {
439
+ revision: string;
440
+ contentDigest: string | null;
441
+ changeId: string | null;
442
+ tests?: unknown;
443
+ };
444
+ status: "deploying" | "live" | "superseded" | "failed" | "rolled_back" | "degraded";
445
+ stage: string;
446
+ release: string;
447
+ previous: {
448
+ deploymentId: string;
449
+ revision: string;
450
+ bundleSha256: string;
451
+ } | null;
452
+ artifact: {
453
+ application: string;
454
+ bundleSha256: string;
455
+ schemaHash: string | null;
456
+ verification: {
457
+ kind: "isolated-boot";
458
+ passed: boolean;
459
+ at: string;
460
+ };
461
+ } | null;
462
+ candidate: {
463
+ pid: number;
464
+ port: number;
465
+ startedAt: string;
466
+ } | null;
467
+ live: {
468
+ verifiedAt: string;
469
+ checks: Array<{
470
+ check: string;
471
+ ok: boolean;
472
+ expected?: unknown;
473
+ actual?: unknown;
474
+ }>;
475
+ report: LiveReport | null;
476
+ } | null;
477
+ backup: string | null;
478
+ rollback: Record<string, unknown> | null;
479
+ error: {
480
+ stage: string;
481
+ code: string;
482
+ message: string;
483
+ } | null;
484
+ receipt: Record<string, unknown> | null;
485
+ by: string;
486
+ decisionId: string;
487
+ requestId: string;
488
+ startedAt: string;
489
+ finishedAt: string | null;
490
+ events: number;
491
+ } | null;
492
+ latest: {
493
+ history: {
494
+ [k: string]: unknown;
495
+ }[];
496
+ id: string;
497
+ project: string;
498
+ environment: string;
499
+ kind: "deploy" | "change";
500
+ source: {
501
+ revision: string;
502
+ contentDigest: string | null;
503
+ changeId: string | null;
504
+ tests?: unknown;
505
+ };
506
+ status: "deploying" | "live" | "superseded" | "failed" | "rolled_back" | "degraded";
507
+ stage: string;
508
+ release: string;
509
+ previous: {
510
+ deploymentId: string;
511
+ revision: string;
512
+ bundleSha256: string;
513
+ } | null;
514
+ artifact: {
515
+ application: string;
516
+ bundleSha256: string;
517
+ schemaHash: string | null;
518
+ verification: {
519
+ kind: "isolated-boot";
520
+ passed: boolean;
521
+ at: string;
522
+ };
523
+ } | null;
524
+ candidate: {
525
+ pid: number;
526
+ port: number;
527
+ startedAt: string;
528
+ } | null;
529
+ live: {
530
+ verifiedAt: string;
531
+ checks: Array<{
532
+ check: string;
533
+ ok: boolean;
534
+ expected?: unknown;
535
+ actual?: unknown;
536
+ }>;
537
+ report: LiveReport | null;
538
+ } | null;
539
+ backup: string | null;
540
+ rollback: Record<string, unknown> | null;
541
+ error: {
542
+ stage: string;
543
+ code: string;
544
+ message: string;
545
+ } | null;
546
+ receipt: Record<string, unknown> | null;
547
+ by: string;
548
+ decisionId: string;
549
+ requestId: string;
550
+ startedAt: string;
551
+ finishedAt: string | null;
552
+ events: number;
553
+ } | null;
554
+ deployments: {
555
+ id: string;
556
+ kind: "deploy" | "change";
557
+ status: "failed" | "degraded" | "superseded" | "deploying" | "live" | "rolled_back";
558
+ stage: string;
559
+ revision: string;
560
+ changeId: string | null;
561
+ startedAt: string;
562
+ finishedAt: string | null;
563
+ error: {
564
+ stage: string;
565
+ code: string;
566
+ message: string;
567
+ } | null;
568
+ receiptId: string | null;
569
+ }[];
570
+ }>;
571
+ inspect(project: string, environment: string): Promise<{
572
+ runtime: {
573
+ health: string;
574
+ deploymentId: string | null;
575
+ revision: string | null;
576
+ bundleSha256: string | null;
577
+ matchesRecord: boolean;
578
+ pid: number;
579
+ startedAt: string;
580
+ schema: {
581
+ status: string;
582
+ version: number | null;
583
+ hash: string | null;
584
+ migrations: number;
585
+ lastAppliedAt: string | null;
586
+ } | null;
587
+ stateLocation: string;
588
+ state: string;
589
+ checkedAt: string;
590
+ } | {
591
+ error: string;
592
+ state: string;
593
+ checkedAt: string;
594
+ } | {
595
+ state: string;
596
+ checkedAt: string;
597
+ };
598
+ project: string;
599
+ environment: string;
600
+ status: "degraded" | "none" | "deploying" | "live";
601
+ port: number | null;
602
+ active: {
603
+ deploymentId: string;
604
+ release: string;
605
+ revision: string;
606
+ bundleSha256: string;
607
+ pid: number;
608
+ port: number;
609
+ url: string;
610
+ startedAt: string;
611
+ schema: {
612
+ version: number | null;
613
+ hash: string | null;
614
+ migrations: number;
615
+ } | null;
616
+ } | null;
617
+ inProgress: string | null;
618
+ last: {
619
+ deploymentId: string;
620
+ outcome: string;
621
+ at: string;
622
+ } | null;
623
+ degraded: {
624
+ reason: string;
625
+ at: string;
626
+ deploymentId: string;
627
+ } | null;
628
+ }>;
629
+ logs(project: string, environment: string, options: {
630
+ lines?: number;
631
+ deployment?: string;
632
+ }): Promise<{
633
+ deploymentId: null;
634
+ lines: never[];
635
+ truncated: boolean;
636
+ bytes?: undefined;
637
+ } | {
638
+ deploymentId: string;
639
+ lines: never[];
640
+ truncated: boolean;
641
+ bytes?: undefined;
642
+ } | {
643
+ deploymentId: string;
644
+ lines: string[];
645
+ truncated: boolean;
646
+ bytes: number;
647
+ }>;
648
+ /** Stop an environment's running deployment (tests; the operator's `kill <pid>` does the same). */
649
+ stop(project: string, environment: string): Promise<void>;
650
+ /** Stop every environment's running deployment (tests and shutdown scripts). */
651
+ stopAll(): Promise<void>;
652
+ }
653
+ export {};