@lace-cloud/host 0.37.1 → 0.38.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.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { MessageBridge } from '@lace-cloud/proto';
1
+ import { MessageBridge, Bundle, Reason } from '@lace-cloud/proto';
2
2
  export { Diagnostic, EngineIdentityMismatchError } from '@lace-cloud/proto';
3
3
  import * as grpc from '@grpc/grpc-js';
4
4
  import { Metadata, ServiceError, Client, ClientUnaryCall, CallOptions, ClientReadableStream, ChannelCredentials, ClientOptions } from '@grpc/grpc-js';
@@ -226,24 +226,24 @@ interface Any {
226
226
  /** Must be a valid serialized protocol buffer of the above specified type. */
227
227
  value: Buffer;
228
228
  }
229
- declare const Any: MessageFns$4<Any>;
230
- type Builtin$4 = Date | Function | Uint8Array | string | number | boolean | undefined;
231
- type DeepPartial$4<T> = T extends Builtin$4 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$4<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$4<U>> : T extends {} ? {
232
- [K in keyof T]?: DeepPartial$4<T[K]>;
229
+ declare const Any: MessageFns$3<Any>;
230
+ type Builtin$3 = Date | Function | Uint8Array | string | number | boolean | undefined;
231
+ type DeepPartial$3<T> = T extends Builtin$3 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$3<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$3<U>> : T extends {} ? {
232
+ [K in keyof T]?: DeepPartial$3<T[K]>;
233
233
  } : Partial<T>;
234
- type KeysOfUnion$4<T> = T extends T ? keyof T : never;
235
- type Exact$4<P, I extends P> = P extends Builtin$4 ? P : P & {
236
- [K in keyof P]: Exact$4<P[K], I[K]>;
234
+ type KeysOfUnion$3<T> = T extends T ? keyof T : never;
235
+ type Exact$3<P, I extends P> = P extends Builtin$3 ? P : P & {
236
+ [K in keyof P]: Exact$3<P[K], I[K]>;
237
237
  } & {
238
- [K in Exclude<keyof I, KeysOfUnion$4<P>>]: never;
238
+ [K in Exclude<keyof I, KeysOfUnion$3<P>>]: never;
239
239
  };
240
- interface MessageFns$4<T> {
240
+ interface MessageFns$3<T> {
241
241
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
242
242
  decode(input: BinaryReader | Uint8Array, length?: number): T;
243
243
  fromJSON(object: any): T;
244
244
  toJSON(message: T): unknown;
245
- create<I extends Exact$4<DeepPartial$4<T>, I>>(base?: I): T;
246
- fromPartial<I extends Exact$4<DeepPartial$4<T>, I>>(object: I): T;
245
+ create<I extends Exact$3<DeepPartial$3<T>, I>>(base?: I): T;
246
+ fromPartial<I extends Exact$3<DeepPartial$3<T>, I>>(object: I): T;
247
247
  }
248
248
 
249
249
  /**
@@ -274,38 +274,7 @@ interface Status {
274
274
  */
275
275
  details: Any[];
276
276
  }
277
- declare const Status: MessageFns$3<Status>;
278
- type Builtin$3 = Date | Function | Uint8Array | string | number | boolean | undefined;
279
- type DeepPartial$3<T> = T extends Builtin$3 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$3<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$3<U>> : T extends {} ? {
280
- [K in keyof T]?: DeepPartial$3<T[K]>;
281
- } : Partial<T>;
282
- type KeysOfUnion$3<T> = T extends T ? keyof T : never;
283
- type Exact$3<P, I extends P> = P extends Builtin$3 ? P : P & {
284
- [K in keyof P]: Exact$3<P[K], I[K]>;
285
- } & {
286
- [K in Exclude<keyof I, KeysOfUnion$3<P>>]: never;
287
- };
288
- interface MessageFns$3<T> {
289
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
290
- decode(input: BinaryReader | Uint8Array, length?: number): T;
291
- fromJSON(object: any): T;
292
- toJSON(message: T): unknown;
293
- create<I extends Exact$3<DeepPartial$3<T>, I>>(base?: I): T;
294
- fromPartial<I extends Exact$3<DeepPartial$3<T>, I>>(object: I): T;
295
- }
296
-
297
- /**
298
- * A generic empty message that you can re-use to avoid defining duplicated
299
- * empty messages in your APIs. A typical example is to use it as the request
300
- * or the response type of an API method. For instance:
301
- *
302
- * service Foo {
303
- * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
304
- * }
305
- */
306
- interface Empty {
307
- }
308
- declare const Empty: MessageFns$2<Empty>;
277
+ declare const Status: MessageFns$2<Status>;
309
278
  type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
310
279
  type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {} ? {
311
280
  [K in keyof T]?: DeepPartial$2<T[K]>;
@@ -326,362 +295,17 @@ interface MessageFns$2<T> {
326
295
  }
327
296
 
328
297
  /**
329
- * Reason is the one vocabulary of what a failure asks of the developer.
330
- * The engine attaches it to a refused RPC as a `ReasonDetail` in the
331
- * status' error details, and a command's failure document names it; a
332
- * client branches on it, never on the message's text. A failure the API
333
- * decided carries the API's own code (`ReasonDetail.api_code`), and a
334
- * reason only where that code has one: every code that asks the developer
335
- * to sign in again is `REASON_UNAUTHENTICATED`.
298
+ * A generic empty message that you can re-use to avoid defining duplicated
299
+ * empty messages in your APIs. A typical example is to use it as the request
300
+ * or the response type of an API method. For instance:
336
301
  *
337
- * The vocabulary is a file of its own, in the engine's package, generated
338
- * into a Go package of its own (internal/kernel/reason/pb): every CLI package
339
- * that refuses with a reason names it from there, the execution side's
340
- * included, without linking the engine's wire. service.proto imports it.
341
- */
342
- declare enum Reason {
343
- REASON_UNSPECIFIED = 0,
344
- /**
345
- * REASON_NOT_LACE_FORM - Placement: the resolved tree's own certification verdict is not Lace-form.
346
- * module convert and module import: lacification cannot take the tree to
347
- * lace shape; the report names each managed resource and the IR gap holding it.
348
- */
349
- REASON_NOT_LACE_FORM = 1,
350
- /** REASON_HASH_MISMATCH - Placement: the downloaded tree does not hash to what the registry vouched for. */
351
- REASON_HASH_MISMATCH = 2,
352
- /** REASON_REGISTRY_UNAVAILABLE - Placement: the registry could not be reached or answered with no verdict. */
353
- REASON_REGISTRY_UNAVAILABLE = 3,
354
- /** REASON_ROOT_LOCKED - SessionOpen: the root's canvas is open in another window. */
355
- REASON_ROOT_LOCKED = 4,
356
- /** REASON_UNSAVED - Generate: the session has unsaved edits; save first. */
357
- REASON_UNSAVED = 5,
358
- /** REASON_CONFLICT - Generate: the tree moved under the session's base; Keep or Reload first. */
359
- REASON_CONFLICT = 6,
360
- /**
361
- * REASON_SOURCE_REFUSED - Every mutation, save, discard and generate: the session's source tf is refused
362
- * (`BundleState.source_refused`).
363
- * module convert and module import: the tree's tf does not parse, has a
364
- * non-empty residual report, or its Bundle fails its own validation.
365
- * module validate, stack apply / stack destroy / registry register: a
366
- * source the command reads does not parse; apply, destroy and register
367
- * check it before the certification.
368
- */
369
- REASON_SOURCE_REFUSED = 7,
370
- /**
371
- * REASON_NOT_GIT_REPOSITORY - Generate, module convert, module import and module fmt: the authoring
372
- * root is not inside a git working tree.
373
- * stack create --source: the directory is not inside a git working tree,
374
- * so it has no place in a repository to bind the stack to.
375
- */
376
- REASON_NOT_GIT_REPOSITORY = 8,
377
- /** REASON_GENERATE_IN_PROGRESS - Generate: a Generate is already running on the session. */
378
- REASON_GENERATE_IN_PROGRESS = 9,
379
- /** REASON_NO_ORGANIZATION - A scoped command: no organization is selected. */
380
- REASON_NO_ORGANIZATION = 10,
381
- /** REASON_NO_TEAM - A team-scoped command: no team is selected in the organization. */
382
- REASON_NO_TEAM = 11,
383
- /**
384
- * REASON_NO_CERTIFICATION - stack apply / stack destroy / registry register: the root has no
385
- * certification.
386
- */
387
- REASON_NO_CERTIFICATION = 12,
388
- /**
389
- * REASON_STALE_CERTIFICATION - stack apply / stack destroy / registry register: the certification
390
- * does not certify the tree on disk — the tree changed since validate,
391
- * another lace version wrote it, or its files are torn or mixed from two
392
- * validates. Running validate again replaces it.
393
- */
394
- REASON_STALE_CERTIFICATION = 13,
395
- /**
396
- * REASON_TOOL_MISSING - module scan / module docs / module fmt / module validate / module
397
- * convert / module import / stack preview / stack apply / stack destroy:
398
- * the tool the command runs (tfsec, terraform-docs, the pinned terraform)
399
- * is not available. convert and module import run the pinned terraform
400
- * through the validate each closes on, apply and destroy through their
401
- * local plan.
402
- */
403
- REASON_TOOL_MISSING = 14,
404
- /**
405
- * REASON_CROSS_SCOPE - ApplyAction: a wire whose source and target are owned by different
406
- * modules crosses a group's boundary, which no single-scope edit makes.
407
- * It is a refusal of the batch's content, carried on its GraphError.
408
- * ReadWiringCandidates: a read whose two scopes differ, refused
409
- * (FailedPrecondition) as such a wire is.
410
- */
411
- REASON_CROSS_SCOPE = 15,
412
- /**
413
- * REASON_UNAUTHENTICATED - The developer must sign in: a command or a placement that needs
414
- * credentials finds none (no `lace login`, no LACE_TOKEN), decided
415
- * before any request; or the API refuses the ones sent with its code
416
- * `unauthenticated`, which `ReasonDetail.api_code` then names.
417
- */
418
- REASON_UNAUTHENTICATED = 16,
419
- /**
420
- * REASON_IMPORT_RESIDUAL - module import: a resource in the statefile has no import id the CLI
421
- * derives. The failure names each in `importResiduals`; --allow-partial
422
- * writes the import without them. Nothing was written.
423
- */
424
- REASON_IMPORT_RESIDUAL = 17,
425
- /**
426
- * REASON_STACK_HAS_STATE - module import: the stack's state already holds resources, and import
427
- * adopts into an empty stack. Nothing was read or written.
428
- */
429
- REASON_STACK_HAS_STATE = 18,
430
- /**
431
- * REASON_NO_ORIGIN_REMOTE - stack create --source: the directory's repository has no `origin`
432
- * remote, whose URL is the repository a stack's source binding names.
433
- */
434
- REASON_NO_ORIGIN_REMOTE = 19,
435
- /**
436
- * REASON_IMPORT_UNDECLARED - module import: the statefile holds resources the converted tree does not
437
- * declare, named in the failure's `addresses`; an import block adopts
438
- * only a resource the tree declares. Nothing was written.
439
- */
440
- REASON_IMPORT_UNDECLARED = 20,
441
- /**
442
- * REASON_ALREADY_IMPORTED - module import: the tree already imports resources the statefile holds,
443
- * named in the failure's `addresses`; terraform refuses two imports of
444
- * one address. Nothing was written.
445
- */
446
- REASON_ALREADY_IMPORTED = 21,
447
- /**
448
- * REASON_NO_LOCKFILE - stack apply / stack destroy / stack preview: the root keeps no
449
- * `.terraform.lock.hcl`; `lace module lock` writes it.
450
- */
451
- REASON_NO_LOCKFILE = 22,
452
- /** REASON_NO_COMMIT - stack create --source: the directory's repository has no commit yet. */
453
- REASON_NO_COMMIT = 23,
454
- /**
455
- * REASON_STALE_WORKING_STATE - Discard and Restore: the session's working IR is no longer the one the
456
- * caller showed the developer (`BundleState.working_digest`) -- another
457
- * holder edited, undid or redid since. Restore also: the saved IR or source
458
- * tree is no longer the one the backup was captured against. Nothing was
459
- * discarded or restored; re-read the state and ask again.
460
- */
461
- REASON_STALE_WORKING_STATE = 24,
462
- UNRECOGNIZED = -1
463
- }
464
-
465
- interface Bundle {
466
- /**
467
- * The format of this encoding: "2.0", at which every Expression carries
468
- * the module references the engine read from it. The engine writes every
469
- * Bundle at it; an encoding of an earlier version carries none.
470
- */
471
- schema_version: string;
472
- kind: string;
473
- entry: string;
474
- modules: {
475
- [key: string]: Module;
476
- };
477
- }
478
- declare const Bundle: MessageFns$1<Bundle>;
479
- interface Module {
480
- id: string;
481
- version: string;
482
- source: Source | undefined;
483
- interface: Interface | undefined;
484
- modules: Use[];
485
- resources: Resource[];
486
- locals: Local[];
487
- exports: Exports | undefined;
488
- terraform: TerraformBlock | undefined;
489
- providers: ProviderConfig[];
490
- /** top-level directives: moved {}, import {} */
491
- top_level_blocks: Block[];
492
- }
493
- declare const Module: MessageFns$1<Module>;
494
- interface Interface {
495
- inputs: InputDef$1[];
496
- outputs: OutputDef$1[];
497
- }
498
- declare const Interface: MessageFns$1<Interface>;
499
- interface InputDef$1 {
500
- name: string;
501
- /**
502
- * The type constraint the variable's type line spells, as written; empty
503
- * for a variable with no type line. `any` is a type line of its own.
504
- */
505
- type: string;
506
- required: boolean;
507
- description: string;
508
- default_value: any | undefined;
509
- validation: ValidationBlock$1[];
510
- sensitive: boolean;
511
- /** unset = default (true); explicit false is meaningful */
512
- nullable?: boolean | undefined;
513
- /** unset = default (false); explicit true is meaningful */
514
- ephemeral?: boolean | undefined;
515
- }
516
- declare const InputDef$1: MessageFns$1<InputDef$1>;
517
- interface ValidationBlock$1 {
518
- condition: string;
519
- error_message: string;
520
- }
521
- declare const ValidationBlock$1: MessageFns$1<ValidationBlock$1>;
522
- interface OutputDef$1 {
523
- name: string;
524
- /**
525
- * The type of the child output the output's export reads; empty when
526
- * nothing types it. An output block declares no type.
527
- */
528
- type: string;
529
- description: string;
530
- sensitive: boolean;
531
- depends_on: string[];
532
- }
533
- declare const OutputDef$1: MessageFns$1<OutputDef$1>;
534
- interface Source {
535
- kind: string;
536
- repo: string;
537
- subdir: string;
538
- ref: string;
539
- }
540
- declare const Source: MessageFns$1<Source>;
541
- interface Local {
542
- name: string;
543
- value: Binding | undefined;
544
- }
545
- declare const Local: MessageFns$1<Local>;
546
- interface Use {
547
- id: string;
548
- module: string;
549
- inputs: {
550
- [key: string]: Binding;
551
- };
552
- depends_on: string[];
553
- /** count meta-argument */
554
- count: Binding | undefined;
555
- /** for_each meta-argument */
556
- for_each: Binding | undefined;
557
- /**
558
- * A module call's `providers = {}` map (child-local name → root ref).
559
- * Each entry targets the child's default provider slot for that name;
560
- * this map has no way to target an aliased child slot.
561
- */
562
- providers: {
563
- [key: string]: string;
564
- };
565
- }
566
- declare const Use: MessageFns$1<Use>;
567
- interface Resource {
568
- id: string;
569
- kind: string;
570
- type: string;
571
- inputs: {
572
- [key: string]: Binding;
573
- };
574
- depends_on: string[];
575
- /** nested blocks (ingress, lifecycle, dynamic, …) */
576
- blocks: Block[];
577
- /** count meta-argument */
578
- count: Binding | undefined;
579
- /** for_each meta-argument */
580
- for_each: Binding | undefined;
581
- /** provider meta-argument, e.g. "aws.west" */
582
- provider_ref: string;
583
- }
584
- declare const Resource: MessageFns$1<Resource>;
585
- /**
586
- * Block is a recursive nested block (within a resource, or top-level moved/
587
- * import). Attributes are ordered (declaration order) so regenerated HCL is
588
- * byte-deterministic.
589
- */
590
- interface Block {
591
- type: string;
592
- labels: string[];
593
- attributes: NamedBinding[];
594
- blocks: Block[];
595
- }
596
- declare const Block: MessageFns$1<Block>;
597
- /** NamedBinding is an ordered (name, value) attribute within a Block. */
598
- interface NamedBinding {
599
- name: string;
600
- value: Binding | undefined;
601
- }
602
- declare const NamedBinding: MessageFns$1<NamedBinding>;
603
- interface Exports {
604
- outputs: {
605
- [key: string]: OutputExport;
606
- };
607
- }
608
- declare const Exports: MessageFns$1<Exports>;
609
- interface OutputExport {
610
- out: OutputRef | undefined;
611
- lit: any | undefined;
612
- var: string;
613
- expr: Expression | undefined;
614
- }
615
- declare const OutputExport: MessageFns$1<OutputExport>;
616
- interface Binding {
617
- lit?: any | undefined;
618
- var?: string | undefined;
619
- out?: OutputRef | undefined;
620
- expr?: Expression | undefined;
621
- }
622
- declare const Binding: MessageFns$1<Binding>;
623
- interface OutputRef {
624
- module: string;
625
- name: string;
626
- }
627
- declare const OutputRef: MessageFns$1<OutputRef>;
628
- interface Expression {
629
- lang: string;
630
- value: string;
631
- /**
632
- * The module calls `value` reads, in source order: what the engine's
633
- * one reader of references reads from the parse of `value`. The engine
634
- * fills them each time it encodes an Expression and reads none back, so
635
- * a consumer takes a reference from here and never from `value`.
636
- */
637
- module_references: ModuleReference[];
638
- }
639
- declare const Expression: MessageFns$1<Expression>;
640
- /** ModuleReference is one module.<call> an expression reads. */
641
- interface ModuleReference {
642
- /** The call read: module.<call>. */
643
- call: string;
644
- /**
645
- * The output read off the call: the first attribute after the call and
646
- * any instance key in the text, module.<call>.<output> or
647
- * module.<call>[0].<output>. Unset when the reference reads the whole
648
- * call: module.<call> alone, through a splat, or by a key an expression
649
- * computes.
650
- */
651
- output?: string | undefined;
652
- /** An instance key follows the call: [0], ["k"] or [<expression>]. */
653
- instance_key: boolean;
654
- /** A splat follows the call or its instance key: [*] or .*. */
655
- splat: boolean;
656
- }
657
- declare const ModuleReference: MessageFns$1<ModuleReference>;
658
- /**
659
- * A module's terraform block as the IR holds it. It holds no backend: Lace
660
- * manages state, and a backend block is a fact about the files.
302
+ * service Foo {
303
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
304
+ * }
661
305
  */
662
- interface TerraformBlock {
663
- required_version: string;
664
- required_providers: {
665
- [key: string]: ProviderRequirement;
666
- };
667
- }
668
- declare const TerraformBlock: MessageFns$1<TerraformBlock>;
669
- interface ProviderRequirement {
670
- source: string;
671
- version: string;
672
- configuration_aliases: string[];
673
- }
674
- declare const ProviderRequirement: MessageFns$1<ProviderRequirement>;
675
- interface ProviderConfig {
676
- name: string;
677
- alias: string;
678
- config: {
679
- [key: string]: Binding;
680
- };
681
- /** nested config blocks (default_tags, assume_role, …) */
682
- blocks: Block[];
306
+ interface Empty {
683
307
  }
684
- declare const ProviderConfig: MessageFns$1<ProviderConfig>;
308
+ declare const Empty: MessageFns$1<Empty>;
685
309
  type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
686
310
  type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {} ? {
687
311
  [K in keyof T]?: DeepPartial$1<T[K]>;