@distilled.cloud/celld 0.0.0-placeholder → 1.0.0-rc.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 (48) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +116 -0
  3. package/lib/endpoint.d.ts +11 -0
  4. package/lib/endpoint.d.ts.map +1 -0
  5. package/lib/endpoint.js +11 -0
  6. package/lib/endpoint.js.map +1 -0
  7. package/lib/errors.d.ts +24 -0
  8. package/lib/errors.d.ts.map +1 -0
  9. package/lib/errors.js +19 -0
  10. package/lib/errors.js.map +1 -0
  11. package/lib/index.d.ts +5 -0
  12. package/lib/index.d.ts.map +1 -0
  13. package/lib/index.js +5 -0
  14. package/lib/index.js.map +1 -0
  15. package/lib/protocol.d.ts +12 -0
  16. package/lib/protocol.d.ts.map +1 -0
  17. package/lib/protocol.js +33 -0
  18. package/lib/protocol.js.map +1 -0
  19. package/lib/response-validation.test.d.ts +4 -0
  20. package/lib/response-validation.test.d.ts.map +1 -0
  21. package/lib/response-validation.test.js +30 -0
  22. package/lib/response-validation.test.js.map +1 -0
  23. package/lib/services/index.d.ts +3 -0
  24. package/lib/services/index.d.ts.map +1 -0
  25. package/lib/services/index.js +4 -0
  26. package/lib/services/index.js.map +1 -0
  27. package/lib/services/node.d.ts +334 -0
  28. package/lib/services/node.d.ts.map +1 -0
  29. package/lib/services/node.js +340 -0
  30. package/lib/services/node.js.map +1 -0
  31. package/lib/services/runtime.d.ts +686 -0
  32. package/lib/services/runtime.d.ts.map +1 -0
  33. package/lib/services/runtime.js +553 -0
  34. package/lib/services/runtime.js.map +1 -0
  35. package/lib/traits.d.ts +3 -0
  36. package/lib/traits.d.ts.map +1 -0
  37. package/lib/traits.js +3 -0
  38. package/lib/traits.js.map +1 -0
  39. package/package.json +66 -7
  40. package/src/endpoint.ts +13 -0
  41. package/src/errors.ts +25 -0
  42. package/src/index.ts +8 -0
  43. package/src/protocol.ts +49 -0
  44. package/src/response-validation.test.ts +43 -0
  45. package/src/services/index.ts +3 -0
  46. package/src/services/node.ts +767 -0
  47. package/src/services/runtime.ts +1455 -0
  48. package/src/traits.ts +6 -0
@@ -0,0 +1,767 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from the Celld v0.6.0 source-derived Smithy specifications in specs/. Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as API from "@distilled.cloud/core/api";
4
+ import * as C from "@distilled.cloud/core/category";
5
+ import * as T from "../traits.ts";
6
+ import {
7
+ CelldProtocol,
8
+ type CelldOpError,
9
+ type CelldOpContext,
10
+ } from "../protocol.ts";
11
+
12
+ export type { CelldOpError, CelldOpContext };
13
+
14
+ /** An accepted eviction was interrupted by activity, an alarm, or node fencing. The message preserves cancelled: <reason>. */
15
+ export class EvictionCancelled
16
+ extends /*@__PURE__*/ T.applyErrorMatchers(
17
+ /*@__PURE__*/ S.TaggedError<EvictionCancelled>()("EvictionCancelled", {
18
+ message: S.String,
19
+ }),
20
+ [{ status: 409, message: { matches: "^cancelled: " } }],
21
+ ) {}
22
+
23
+ /** Eviction completion could not be established. The message preserves failed: <reason>; this does not authorize automatic replay. */
24
+ export class EvictionFailed
25
+ extends /*@__PURE__*/ T.applyErrorMatchers(
26
+ /*@__PURE__*/ S.TaggedError<EvictionFailed>()("EvictionFailed", {
27
+ message: S.String,
28
+ }),
29
+ [
30
+ { status: 500, message: { matches: "^failed: " } },
31
+ { status: 503, message: { matches: "^failed: " } },
32
+ ],
33
+ ) {}
34
+
35
+ /** Eviction was refused before admission. The message preserves refused: <reason> from the node error envelope. */
36
+ export class EvictionRefused
37
+ extends /*@__PURE__*/ T.applyErrorMatchers(
38
+ /*@__PURE__*/ S.TaggedError<EvictionRefused>()("EvictionRefused", {
39
+ message: S.String,
40
+ }),
41
+ [
42
+ { status: 409, message: { matches: "^refused: " } },
43
+ { status: 503, message: { matches: "^refused: " } },
44
+ ],
45
+ ) {}
46
+
47
+ export class MalformedScope
48
+ extends /*@__PURE__*/ T.applyErrorMatchers(
49
+ /*@__PURE__*/ S.TaggedError<MalformedScope>()("MalformedScope", {
50
+ message: S.String,
51
+ }),
52
+ [{ status: 400 }],
53
+ ) {}
54
+
55
+ export class NodeHasNoLease
56
+ extends /*@__PURE__*/ T.applyErrorMatchers(
57
+ /*@__PURE__*/ S.TaggedError<NodeHasNoLease>()("NodeHasNoLease", {
58
+ message: S.String,
59
+ }),
60
+ [{ status: 409, message: "this node publishes no lease" }],
61
+ ) {}
62
+
63
+ export class NodeUnavailable
64
+ extends /*@__PURE__*/ T.applyErrorMatchers(
65
+ /*@__PURE__*/ S.TaggedError<NodeUnavailable>()("NodeUnavailable", {
66
+ message: S.String,
67
+ }),
68
+ [{ status: 503 }],
69
+ ) {}
70
+
71
+ export class ReloadFailed
72
+ extends /*@__PURE__*/ T.applyErrorMatchers(
73
+ /*@__PURE__*/ S.TaggedError<ReloadFailed>()("ReloadFailed", {
74
+ message: S.String,
75
+ }).pipe(C.withBadRequestError),
76
+ [{ status: 422 }],
77
+ ) {}
78
+
79
+ export interface EvictCellRequest {
80
+ scope: string;
81
+ }
82
+ export const EvictCellRequest = /*@__PURE__*/ S.suspend(() =>
83
+ S.Struct({
84
+ scope: S.String.pipe(T.Label(), T.LabelEncoding({ preserve: ":$" })),
85
+ }).pipe(T.Http({ method: "POST", uri: "/evict/{scope}", code: 200 })),
86
+ ).annotate({
87
+ identifier: "EvictCellRequest",
88
+ }) as any as S.Schema<EvictCellRequest>;
89
+
90
+ export interface OkResponse {
91
+ ok: boolean;
92
+ }
93
+ export const OkResponse = /*@__PURE__*/ S.suspend(() =>
94
+ S.Struct({
95
+ ok: S.Boolean,
96
+ }),
97
+ ).annotate({ identifier: "OkResponse" }) as any as S.Schema<OkResponse>;
98
+
99
+ export interface GetNodeStateRequest {}
100
+ export const GetNodeStateRequest = /*@__PURE__*/ S.suspend(() =>
101
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/state", code: 200 })),
102
+ ).annotate({
103
+ identifier: "GetNodeStateRequest",
104
+ }) as any as S.Schema<GetNodeStateRequest>;
105
+
106
+ export type DocumentMap = { [key: string]: unknown | undefined };
107
+ export const DocumentMap = /*@__PURE__*/ S.Record(
108
+ S.String,
109
+ S.Unknown,
110
+ ) as any as S.Schema<DocumentMap>;
111
+
112
+ export type DocumentList = Array<unknown>;
113
+ export const DocumentList = /*@__PURE__*/ S.Array(
114
+ S.Unknown,
115
+ ) as any as S.Schema<DocumentList>;
116
+
117
+ /** Isolate pool census. heap_bytes and external_bytes sample isolates not held by a turn. */
118
+ export interface PoolCensus {
119
+ live: number;
120
+ live_empty: number;
121
+ retiring: number;
122
+ freed: number;
123
+ cells: number;
124
+ requests: number;
125
+ turns: number;
126
+ heap_bytes: number;
127
+ external_bytes: number;
128
+ }
129
+ export const PoolCensus = /*@__PURE__*/ S.suspend(() =>
130
+ S.Struct({
131
+ live: S.Number,
132
+ live_empty: S.Number,
133
+ retiring: S.Number,
134
+ freed: S.Number,
135
+ cells: S.Number,
136
+ requests: S.Number,
137
+ turns: S.Number,
138
+ heap_bytes: S.Number,
139
+ external_bytes: S.Number,
140
+ }),
141
+ ).annotate({ identifier: "PoolCensus" }) as any as S.Schema<PoolCensus>;
142
+
143
+ export type PoolCensuses = { [key: string]: PoolCensus | undefined };
144
+ export const PoolCensuses = /*@__PURE__*/ S.Record(
145
+ S.String,
146
+ PoolCensus,
147
+ ) as any as S.Schema<PoolCensuses>;
148
+
149
+ /** Current or draining deployment isolate pools, keyed by service or Worker script. */
150
+ export interface IsolateCensus {
151
+ stateless: PoolCensus;
152
+ services: PoolCensuses;
153
+ cells: PoolCensuses;
154
+ }
155
+ export const IsolateCensus = /*@__PURE__*/ S.suspend(() =>
156
+ S.Struct({
157
+ stateless: PoolCensus,
158
+ services: PoolCensuses,
159
+ cells: PoolCensuses,
160
+ }),
161
+ ).annotate({ identifier: "IsolateCensus" }) as any as S.Schema<IsolateCensus>;
162
+
163
+ export interface DeploymentGeneration {
164
+ generation: number;
165
+ version: string;
166
+ isolates: IsolateCensus;
167
+ }
168
+ export const DeploymentGeneration = /*@__PURE__*/ S.suspend(() =>
169
+ S.Struct({
170
+ generation: S.Number,
171
+ version: S.String,
172
+ isolates: IsolateCensus,
173
+ }),
174
+ ).annotate({
175
+ identifier: "DeploymentGeneration",
176
+ }) as any as S.Schema<DeploymentGeneration>;
177
+
178
+ export type DeploymentGenerations = Array<DeploymentGeneration>;
179
+ export const DeploymentGenerations = /*@__PURE__*/ S.Array(
180
+ DeploymentGeneration,
181
+ ) as any as S.Schema<DeploymentGenerations>;
182
+
183
+ export type LongMap = { [key: string]: number | undefined };
184
+ export const LongMap = /*@__PURE__*/ S.Record(
185
+ S.String,
186
+ S.Number,
187
+ ) as any as S.Schema<LongMap>;
188
+
189
+ export interface DeploymentState {
190
+ generation: number;
191
+ version: string;
192
+ prefix: string;
193
+ draining: DeploymentGenerations;
194
+ swapping: number;
195
+ cells: LongMap;
196
+ isolates: IsolateCensus;
197
+ }
198
+ export const DeploymentState = /*@__PURE__*/ S.suspend(() =>
199
+ S.Struct({
200
+ generation: S.Number,
201
+ version: S.String,
202
+ prefix: S.String,
203
+ draining: DeploymentGenerations,
204
+ swapping: S.Number,
205
+ cells: LongMap,
206
+ isolates: IsolateCensus,
207
+ }),
208
+ ).annotate({
209
+ identifier: "DeploymentState",
210
+ }) as any as S.Schema<DeploymentState>;
211
+
212
+ /** Jemalloc memory counters from the node snapshot, in bytes. */
213
+ export interface AllocatorStats {
214
+ allocated_bytes: number;
215
+ active_bytes: number;
216
+ resident_bytes: number;
217
+ mapped_bytes: number;
218
+ retained_bytes: number;
219
+ }
220
+ export const AllocatorStats = /*@__PURE__*/ S.suspend(() =>
221
+ S.Struct({
222
+ allocated_bytes: S.Number,
223
+ active_bytes: S.Number,
224
+ resident_bytes: S.Number,
225
+ mapped_bytes: S.Number,
226
+ retained_bytes: S.Number,
227
+ }),
228
+ ).annotate({ identifier: "AllocatorStats" }) as any as S.Schema<AllocatorStats>;
229
+
230
+ /** System allocator memory counters, in bytes. The node reports null when unavailable. */
231
+ export interface LibcMallocStats {
232
+ in_use_bytes: number;
233
+ free_bytes: number;
234
+ mmap_bytes: number;
235
+ arena_bytes: number;
236
+ }
237
+ export const LibcMallocStats = /*@__PURE__*/ S.suspend(() =>
238
+ S.Struct({
239
+ in_use_bytes: S.Number,
240
+ free_bytes: S.Number,
241
+ mmap_bytes: S.Number,
242
+ arena_bytes: S.Number,
243
+ }),
244
+ ).annotate({
245
+ identifier: "LibcMallocStats",
246
+ }) as any as S.Schema<LibcMallocStats>;
247
+
248
+ /** Node snapshot. Census detail is implementation-defined JSON. If the actor has stopped, the server instead returns only error="actor_stopped". */
249
+ export interface NodeState {
250
+ activating?: number;
251
+ activation_waiting?: number;
252
+ adopting?: number;
253
+ capacity_waiting?: number;
254
+ evicting?: number;
255
+ handed_off?: number;
256
+ handoff_failed?: number;
257
+ occupied?: number;
258
+ owned_cells?: number;
259
+ publishes?: number;
260
+ quiescing?: number;
261
+ rebalance_failed?: number;
262
+ rebalanced?: number;
263
+ releasing?: number;
264
+ remote_route_refreshes?: number;
265
+ restoring?: number;
266
+ stops?: number;
267
+ cgroup_current_bytes?: number | null;
268
+ cgroup_working_set_bytes?: number | null;
269
+ in_use_bytes?: number;
270
+ rss_bytes?: number;
271
+ ownership?: string;
272
+ phases?: DocumentMap;
273
+ published?: DocumentList;
274
+ residents?: DocumentList;
275
+ node_load?: unknown;
276
+ shedding?: unknown;
277
+ drainPins?: DocumentList;
278
+ deployment?: DeploymentState;
279
+ error?: string;
280
+ allocator?: AllocatorStats | null;
281
+ libc_malloc?: LibcMallocStats | null;
282
+ }
283
+ export const NodeState = /*@__PURE__*/ S.suspend(() =>
284
+ S.Struct({
285
+ activating: S.optional(S.Number),
286
+ activation_waiting: S.optional(S.Number),
287
+ adopting: S.optional(S.Number),
288
+ capacity_waiting: S.optional(S.Number),
289
+ evicting: S.optional(S.Number),
290
+ handed_off: S.optional(S.Number),
291
+ handoff_failed: S.optional(S.Number),
292
+ occupied: S.optional(S.Number),
293
+ owned_cells: S.optional(S.Number),
294
+ publishes: S.optional(S.Number),
295
+ quiescing: S.optional(S.Number),
296
+ rebalance_failed: S.optional(S.Number),
297
+ rebalanced: S.optional(S.Number),
298
+ releasing: S.optional(S.Number),
299
+ remote_route_refreshes: S.optional(S.Number),
300
+ restoring: S.optional(S.Number),
301
+ stops: S.optional(S.Number),
302
+ cgroup_current_bytes: S.optional(S.NullOr(S.Number)),
303
+ cgroup_working_set_bytes: S.optional(S.NullOr(S.Number)),
304
+ in_use_bytes: S.optional(S.Number),
305
+ rss_bytes: S.optional(S.Number),
306
+ ownership: S.optional(S.String),
307
+ phases: S.optional(DocumentMap),
308
+ published: S.optional(DocumentList),
309
+ residents: S.optional(DocumentList),
310
+ node_load: S.optional(S.Unknown),
311
+ shedding: S.optional(S.Unknown),
312
+ drainPins: S.optional(DocumentList),
313
+ deployment: S.optional(DeploymentState),
314
+ error: S.optional(S.String),
315
+ allocator: S.optional(S.NullOr(AllocatorStats)),
316
+ libc_malloc: S.optional(S.NullOr(LibcMallocStats)),
317
+ }),
318
+ ).annotate({ identifier: "NodeState" }) as any as S.Schema<NodeState>;
319
+
320
+ export interface PauseRebalancingRequest {}
321
+ export const PauseRebalancingRequest = /*@__PURE__*/ S.suspend(() =>
322
+ S.Struct({}).pipe(
323
+ T.Http({ method: "POST", uri: "/rebalance/pause", code: 200 }),
324
+ ),
325
+ ).annotate({
326
+ identifier: "PauseRebalancingRequest",
327
+ }) as any as S.Schema<PauseRebalancingRequest>;
328
+
329
+ export interface RebalanceResponse {
330
+ rebalance_paused: boolean;
331
+ }
332
+ export const RebalanceResponse = /*@__PURE__*/ S.suspend(() =>
333
+ S.Struct({
334
+ rebalance_paused: S.Boolean,
335
+ }),
336
+ ).annotate({
337
+ identifier: "RebalanceResponse",
338
+ }) as any as S.Schema<RebalanceResponse>;
339
+
340
+ export interface ReloadDeploymentRequest {}
341
+ export const ReloadDeploymentRequest = /*@__PURE__*/ S.suspend(() =>
342
+ S.Struct({}).pipe(T.Http({ method: "POST", uri: "/reload", code: 200 })),
343
+ ).annotate({
344
+ identifier: "ReloadDeploymentRequest",
345
+ }) as any as S.Schema<ReloadDeploymentRequest>;
346
+
347
+ export interface ReloadResponse {
348
+ ok: boolean;
349
+ outcome: string;
350
+ generation: number;
351
+ version: string;
352
+ prefix?: string;
353
+ }
354
+ export const ReloadResponse = /*@__PURE__*/ S.suspend(() =>
355
+ S.Struct({
356
+ ok: S.Boolean,
357
+ outcome: S.String,
358
+ generation: S.Number,
359
+ version: S.String,
360
+ prefix: S.optional(S.String),
361
+ }),
362
+ ).annotate({ identifier: "ReloadResponse" }) as any as S.Schema<ReloadResponse>;
363
+
364
+ export interface ResumeRebalancingRequest {}
365
+ export const ResumeRebalancingRequest = /*@__PURE__*/ S.suspend(() =>
366
+ S.Struct({}).pipe(
367
+ T.Http({ method: "POST", uri: "/rebalance/resume", code: 200 }),
368
+ ),
369
+ ).annotate({
370
+ identifier: "ResumeRebalancingRequest",
371
+ }) as any as S.Schema<ResumeRebalancingRequest>;
372
+
373
+ export interface RouteCellRequest {
374
+ scope: string;
375
+ }
376
+ export const RouteCellRequest = /*@__PURE__*/ S.suspend(() =>
377
+ S.Struct({
378
+ scope: S.String.pipe(T.Label(), T.LabelEncoding({ preserve: ":$" })),
379
+ }).pipe(T.Http({ method: "GET", uri: "/cell/{scope}", code: 200 })),
380
+ ).annotate({
381
+ identifier: "RouteCellRequest",
382
+ }) as any as S.Schema<RouteCellRequest>;
383
+
384
+ export interface RouteCellResponse {
385
+ route?: string;
386
+ cell?: string;
387
+ node?: string;
388
+ addr?: string;
389
+ epoch?: number;
390
+ peer_protocol?: number;
391
+ }
392
+ export const RouteCellResponse = /*@__PURE__*/ S.suspend(() =>
393
+ S.Struct({
394
+ route: S.optional(S.String),
395
+ cell: S.optional(S.String),
396
+ node: S.optional(S.String),
397
+ addr: S.optional(S.String),
398
+ epoch: S.optional(S.Number),
399
+ peer_protocol: S.optional(S.Number),
400
+ }),
401
+ ).annotate({
402
+ identifier: "RouteCellResponse",
403
+ }) as any as S.Schema<RouteCellResponse>;
404
+
405
+ export type ShutdownHandoff = "preserve";
406
+ export const ShutdownHandoff = S.String;
407
+
408
+ export interface ShutdownNodeRequest {
409
+ handoff?: ShutdownHandoff | (string & {});
410
+ }
411
+ export const ShutdownNodeRequest = /*@__PURE__*/ S.suspend(() =>
412
+ S.Struct({
413
+ handoff: S.optional(ShutdownHandoff.pipe(T.Query())),
414
+ }).pipe(T.Http({ method: "POST", uri: "/shutdown", code: 200 })),
415
+ ).annotate({
416
+ identifier: "ShutdownNodeRequest",
417
+ }) as any as S.Schema<ShutdownNodeRequest>;
418
+
419
+ export type StringList = Array<string>;
420
+ export const StringList = /*@__PURE__*/ S.Array(
421
+ S.String,
422
+ ) as any as S.Schema<StringList>;
423
+
424
+ export type ModuleKind = "wasm";
425
+ export const ModuleKind = S.String;
426
+
427
+ export interface ModuleRef {
428
+ name: string;
429
+ bytes: number;
430
+ sha256: string;
431
+ kind?: ModuleKind;
432
+ }
433
+ export const ModuleRef = /*@__PURE__*/ S.suspend(() =>
434
+ S.Struct({
435
+ name: S.String,
436
+ bytes: S.Number,
437
+ sha256: S.String,
438
+ kind: S.optional(ModuleKind),
439
+ }),
440
+ ).annotate({ identifier: "ModuleRef" }) as any as S.Schema<ModuleRef>;
441
+
442
+ export type ModuleRefs = Array<ModuleRef>;
443
+ export const ModuleRefs = /*@__PURE__*/ S.Array(
444
+ ModuleRef,
445
+ ) as any as S.Schema<ModuleRefs>;
446
+
447
+ export interface AssetManifestRef {
448
+ index: string;
449
+ sha256: string;
450
+ file_count: number;
451
+ total_bytes: number;
452
+ }
453
+ export const AssetManifestRef = /*@__PURE__*/ S.suspend(() =>
454
+ S.Struct({
455
+ index: S.String,
456
+ sha256: S.String,
457
+ file_count: S.Number,
458
+ total_bytes: S.Number,
459
+ }),
460
+ ).annotate({
461
+ identifier: "AssetManifestRef",
462
+ }) as any as S.Schema<AssetManifestRef>;
463
+
464
+ export interface QueueConsumerConfig {
465
+ queue: string;
466
+ max_batch_size: number;
467
+ max_batch_timeout: number;
468
+ max_retries: number;
469
+ dead_letter_queue?: string;
470
+ max_concurrency?: number;
471
+ retry_delay?: number;
472
+ }
473
+ export const QueueConsumerConfig = /*@__PURE__*/ S.suspend(() =>
474
+ S.Struct({
475
+ queue: S.String,
476
+ max_batch_size: S.Number,
477
+ max_batch_timeout: S.Number,
478
+ max_retries: S.Number,
479
+ dead_letter_queue: S.optional(S.String),
480
+ max_concurrency: S.optional(S.Number),
481
+ retry_delay: S.optional(S.Number),
482
+ }),
483
+ ).annotate({
484
+ identifier: "QueueConsumerConfig",
485
+ }) as any as S.Schema<QueueConsumerConfig>;
486
+
487
+ export type QueueConsumerConfigs = Array<QueueConsumerConfig>;
488
+ export const QueueConsumerConfigs = /*@__PURE__*/ S.Array(
489
+ QueueConsumerConfig,
490
+ ) as any as S.Schema<QueueConsumerConfigs>;
491
+
492
+ export interface ContainerSpec {
493
+ class_name: string;
494
+ image: string;
495
+ instance_type?: string;
496
+ max_instances?: number;
497
+ runtime?: string;
498
+ }
499
+ export const ContainerSpec = /*@__PURE__*/ S.suspend(() =>
500
+ S.Struct({
501
+ class_name: S.String,
502
+ image: S.String,
503
+ instance_type: S.optional(S.String),
504
+ max_instances: S.optional(S.Number),
505
+ runtime: S.optional(S.String),
506
+ }),
507
+ ).annotate({ identifier: "ContainerSpec" }) as any as S.Schema<ContainerSpec>;
508
+
509
+ export type ContainerSpecs = Array<ContainerSpec>;
510
+ export const ContainerSpecs = /*@__PURE__*/ S.Array(
511
+ ContainerSpec,
512
+ ) as any as S.Schema<ContainerSpecs>;
513
+
514
+ /** Deployment manifest stored at deploy/<script>/<version>/manifest.json. This is an object-storage contract, not an HTTP operation. main_module is null for asset-only deployments. */
515
+ export interface Manifest {
516
+ schema_version?: number;
517
+ version: string;
518
+ script_name: string;
519
+ do_classes: StringList;
520
+ sqlite_classes: StringList;
521
+ modules: ModuleRefs;
522
+ assets?: AssetManifestRef;
523
+ crons?: StringList;
524
+ queue_consumers?: QueueConsumerConfigs;
525
+ containers?: ContainerSpecs;
526
+ fence_image?: string;
527
+ required_features?: StringList;
528
+ raw_metadata: unknown;
529
+ main_module?: string | null;
530
+ }
531
+ export const Manifest = /*@__PURE__*/ S.suspend(() =>
532
+ S.Struct({
533
+ schema_version: S.optional(S.Number),
534
+ version: S.String,
535
+ script_name: S.String,
536
+ do_classes: StringList,
537
+ sqlite_classes: StringList,
538
+ modules: ModuleRefs,
539
+ assets: S.optional(AssetManifestRef),
540
+ crons: S.optional(StringList),
541
+ queue_consumers: S.optional(QueueConsumerConfigs),
542
+ containers: S.optional(ContainerSpecs),
543
+ fence_image: S.optional(S.String),
544
+ required_features: S.optional(StringList),
545
+ raw_metadata: S.Unknown,
546
+ main_module: S.optional(S.NullOr(S.String)),
547
+ }),
548
+ ).annotate({ identifier: "Manifest" }) as any as S.Schema<Manifest>;
549
+
550
+ export interface Rollout {
551
+ percent: number;
552
+ }
553
+ export const Rollout = /*@__PURE__*/ S.suspend(() =>
554
+ S.Struct({
555
+ percent: S.Number,
556
+ }),
557
+ ).annotate({ identifier: "Rollout" }) as any as S.Schema<Rollout>;
558
+
559
+ export interface DeployPointer {
560
+ script_name?: string;
561
+ version: string;
562
+ prefix: string;
563
+ rollout: Rollout;
564
+ }
565
+ export const DeployPointer = /*@__PURE__*/ S.suspend(() =>
566
+ S.Struct({
567
+ script_name: S.optional(S.String),
568
+ version: S.String,
569
+ prefix: S.String,
570
+ rollout: Rollout,
571
+ }),
572
+ ).annotate({ identifier: "DeployPointer" }) as any as S.Schema<DeployPointer>;
573
+
574
+ export interface AssetEntry {
575
+ sha256: string;
576
+ bytes: number;
577
+ content_type?: string;
578
+ }
579
+ export const AssetEntry = /*@__PURE__*/ S.suspend(() =>
580
+ S.Struct({
581
+ sha256: S.String,
582
+ bytes: S.Number,
583
+ content_type: S.optional(S.String),
584
+ }),
585
+ ).annotate({ identifier: "AssetEntry" }) as any as S.Schema<AssetEntry>;
586
+
587
+ export type AssetEntries = { [key: string]: AssetEntry | undefined };
588
+ export const AssetEntries = /*@__PURE__*/ S.Record(
589
+ S.String,
590
+ AssetEntry,
591
+ ) as any as S.Schema<AssetEntries>;
592
+
593
+ export type RunWorkerFirst = boolean | StringList;
594
+ export const RunWorkerFirst = /*@__PURE__*/ S.Union([
595
+ S.Boolean,
596
+ StringList,
597
+ ]) as any as S.Schema<RunWorkerFirst>;
598
+
599
+ export interface AssetConfig {
600
+ binding?: string;
601
+ html_handling?: string;
602
+ not_found_handling?: string;
603
+ run_worker_first?: RunWorkerFirst;
604
+ headers?: string;
605
+ redirects?: string;
606
+ compatibility_date?: string;
607
+ compatibility_flags?: StringList;
608
+ }
609
+ export const AssetConfig = /*@__PURE__*/ S.suspend(() =>
610
+ S.Struct({
611
+ binding: S.optional(S.String),
612
+ html_handling: S.optional(S.String),
613
+ not_found_handling: S.optional(S.String),
614
+ run_worker_first: S.optional(RunWorkerFirst),
615
+ headers: S.optional(S.String),
616
+ redirects: S.optional(S.String),
617
+ compatibility_date: S.optional(S.String),
618
+ compatibility_flags: S.optional(StringList),
619
+ }),
620
+ ).annotate({ identifier: "AssetConfig" }) as any as S.Schema<AssetConfig>;
621
+
622
+ export interface AssetIndex {
623
+ schema_version: number;
624
+ entries: AssetEntries;
625
+ config: AssetConfig;
626
+ }
627
+ export const AssetIndex = /*@__PURE__*/ S.suspend(() =>
628
+ S.Struct({
629
+ schema_version: S.Number,
630
+ entries: AssetEntries,
631
+ config: AssetConfig,
632
+ }),
633
+ ).annotate({ identifier: "AssetIndex" }) as any as S.Schema<AssetIndex>;
634
+
635
+ export interface QueueConsumerDeployment {
636
+ script_name: string;
637
+ version: string;
638
+ prefix: string;
639
+ }
640
+ export const QueueConsumerDeployment = /*@__PURE__*/ S.suspend(() =>
641
+ S.Struct({
642
+ script_name: S.String,
643
+ version: S.String,
644
+ prefix: S.String,
645
+ }),
646
+ ).annotate({
647
+ identifier: "QueueConsumerDeployment",
648
+ }) as any as S.Schema<QueueConsumerDeployment>;
649
+
650
+ export interface QueueConsumerAttachment {
651
+ schema_version: number;
652
+ queue: string;
653
+ consumer?: QueueConsumerDeployment;
654
+ }
655
+ export const QueueConsumerAttachment = /*@__PURE__*/ S.suspend(() =>
656
+ S.Struct({
657
+ schema_version: S.Number,
658
+ queue: S.String,
659
+ consumer: S.optional(QueueConsumerDeployment),
660
+ }),
661
+ ).annotate({
662
+ identifier: "QueueConsumerAttachment",
663
+ }) as any as S.Schema<QueueConsumerAttachment>;
664
+
665
+ export type EvictCellError =
666
+ | MalformedScope
667
+ | EvictionRefused
668
+ | EvictionCancelled
669
+ | EvictionFailed
670
+ | CelldOpError;
671
+ /** Wait for cell eviction to complete. Refusal or cancellation returns 409, unavailable admission or actor returns 503, and other failures return 500. Failure bodies contain {ok:false,error:{kind,reason}}. Use only a trusted internal listener. */
672
+ export const evictCell: API.OperationMethod<
673
+ EvictCellRequest,
674
+ OkResponse,
675
+ EvictCellError,
676
+ CelldOpContext
677
+ > = /*@__PURE__*/ API.make(() => ({
678
+ input: EvictCellRequest,
679
+ output: OkResponse,
680
+ errors: [MalformedScope, EvictionRefused, EvictionCancelled, EvictionFailed],
681
+ protocol: CelldProtocol,
682
+ }));
683
+
684
+ export type GetNodeStateError = CelldOpError;
685
+ /** Read the snapshot from the trusted internal listener. This endpoint is unauthenticated. */
686
+ export const getNodeState: API.OperationMethod<
687
+ GetNodeStateRequest,
688
+ NodeState,
689
+ GetNodeStateError,
690
+ CelldOpContext
691
+ > = /*@__PURE__*/ API.make(() => ({
692
+ input: GetNodeStateRequest,
693
+ output: NodeState,
694
+ errors: [],
695
+ protocol: CelldProtocol,
696
+ }));
697
+
698
+ export type PauseRebalancingError = NodeHasNoLease | CelldOpError;
699
+ export const pauseRebalancing: API.OperationMethod<
700
+ PauseRebalancingRequest,
701
+ RebalanceResponse,
702
+ PauseRebalancingError,
703
+ CelldOpContext
704
+ > = /*@__PURE__*/ API.make(() => ({
705
+ input: PauseRebalancingRequest,
706
+ output: RebalanceResponse,
707
+ errors: [NodeHasNoLease],
708
+ protocol: CelldProtocol,
709
+ }));
710
+
711
+ export type ReloadDeploymentError =
712
+ | ReloadFailed
713
+ | NodeUnavailable
714
+ | CelldOpError;
715
+ /** Force adoption of the existing object-store deployment pointer. This does not upload a deployment. A standalone node without a deployment watcher may wait indefinitely; set a request timeout. */
716
+ export const reloadDeployment: API.OperationMethod<
717
+ ReloadDeploymentRequest,
718
+ ReloadResponse,
719
+ ReloadDeploymentError,
720
+ CelldOpContext
721
+ > = /*@__PURE__*/ API.make(() => ({
722
+ input: ReloadDeploymentRequest,
723
+ output: ReloadResponse,
724
+ errors: [ReloadFailed, NodeUnavailable],
725
+ protocol: CelldProtocol,
726
+ }));
727
+
728
+ export type ResumeRebalancingError = NodeHasNoLease | CelldOpError;
729
+ export const resumeRebalancing: API.OperationMethod<
730
+ ResumeRebalancingRequest,
731
+ RebalanceResponse,
732
+ ResumeRebalancingError,
733
+ CelldOpContext
734
+ > = /*@__PURE__*/ API.make(() => ({
735
+ input: ResumeRebalancingRequest,
736
+ output: RebalanceResponse,
737
+ errors: [NodeHasNoLease],
738
+ protocol: CelldProtocol,
739
+ }));
740
+
741
+ export type RouteCellError = MalformedScope | NodeUnavailable | CelldOpError;
742
+ /** Resolve or activate a cell. A remote owner returns status 307 with routing information, not an HTTP Location redirect. */
743
+ export const routeCell: API.OperationMethod<
744
+ RouteCellRequest,
745
+ RouteCellResponse,
746
+ RouteCellError,
747
+ CelldOpContext
748
+ > = /*@__PURE__*/ API.make(() => ({
749
+ input: RouteCellRequest,
750
+ output: RouteCellResponse,
751
+ errors: [MalformedScope, NodeUnavailable],
752
+ protocol: CelldProtocol,
753
+ }));
754
+
755
+ export type ShutdownNodeError = CelldOpError;
756
+ /** Gracefully stop this node. handoff=preserve retains ownership for a same-node reload. Only call on a trusted internal listener. */
757
+ export const shutdownNode: API.OperationMethod<
758
+ ShutdownNodeRequest,
759
+ OkResponse,
760
+ ShutdownNodeError,
761
+ CelldOpContext
762
+ > = /*@__PURE__*/ API.make(() => ({
763
+ input: ShutdownNodeRequest,
764
+ output: OkResponse,
765
+ errors: [],
766
+ protocol: CelldProtocol,
767
+ }));