@lace-cloud/proto 0.16.2 → 0.17.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,5 +1,17 @@
1
1
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
2
 
3
+ type ProtoDiagnosticLike = {
4
+ severity: number;
5
+ message: string;
6
+ file: string;
7
+ line: number;
8
+ column: number;
9
+ module_key?: string;
10
+ instance_id?: string;
11
+ input_name?: string;
12
+ address?: string;
13
+ };
14
+
3
15
  interface Bundle {
4
16
  schema_version: string;
5
17
  kind: string;
@@ -7,14 +19,6 @@ interface Bundle {
7
19
  modules: {
8
20
  [key: string]: Module;
9
21
  };
10
- environments: {
11
- [key: string]: {
12
- [key: string]: any;
13
- } | undefined;
14
- };
15
- environment_backends: {
16
- [key: string]: BackendConfig;
17
- };
18
22
  }
19
23
  declare const Bundle: MessageFns$1<Bundle>;
20
24
  interface Module {
@@ -33,43 +37,42 @@ interface Module {
33
37
  }
34
38
  declare const Module: MessageFns$1<Module>;
35
39
  interface Interface {
36
- inputs: InputDef$1[];
37
- outputs: OutputDef$1[];
40
+ inputs: InputDef[];
41
+ outputs: OutputDef[];
38
42
  }
39
43
  declare const Interface: MessageFns$1<Interface>;
40
- interface InputDef$1 {
44
+ interface InputDef {
41
45
  name: string;
42
46
  type: string;
43
47
  required: boolean;
44
48
  description: string;
45
49
  default_value: any | undefined;
46
- validation: ValidationBlock$1[];
50
+ validation: ValidationBlock[];
47
51
  sensitive: boolean;
48
52
  /** unset = default (true); explicit false is meaningful */
49
53
  nullable?: boolean | undefined;
50
54
  /** unset = default (false); explicit true is meaningful */
51
55
  ephemeral?: boolean | undefined;
52
56
  }
53
- declare const InputDef$1: MessageFns$1<InputDef$1>;
54
- interface ValidationBlock$1 {
57
+ declare const InputDef: MessageFns$1<InputDef>;
58
+ interface ValidationBlock {
55
59
  condition: string;
56
60
  error_message: string;
57
61
  }
58
- declare const ValidationBlock$1: MessageFns$1<ValidationBlock$1>;
59
- interface OutputDef$1 {
62
+ declare const ValidationBlock: MessageFns$1<ValidationBlock>;
63
+ interface OutputDef {
60
64
  name: string;
61
65
  type: string;
62
66
  description: string;
63
67
  sensitive: boolean;
64
68
  depends_on: string[];
65
69
  }
66
- declare const OutputDef$1: MessageFns$1<OutputDef$1>;
70
+ declare const OutputDef: MessageFns$1<OutputDef>;
67
71
  interface Source {
68
72
  kind: string;
69
73
  repo: string;
70
74
  subdir: string;
71
75
  ref: string;
72
- organization: string;
73
76
  }
74
77
  declare const Source: MessageFns$1<Source>;
75
78
  interface Local {
@@ -195,63 +198,6 @@ interface ProviderConfig {
195
198
  blocks: Block[];
196
199
  }
197
200
  declare const ProviderConfig: MessageFns$1<ProviderConfig>;
198
- /**
199
- * PolicyResolution is the wire-shape of a Lace policy evaluation result.
200
- * Mirrors `apps/cli/internal/policy.Resolution` + relevant DecisionLog
201
- * fields. Used both by the Subscribe stream's authoring-time preview
202
- * and by the PreviewPolicyResolution RPC for counterfactual queries.
203
- *
204
- * `mode` is one of: auto_apply, lightweight_audit, awaiting_approval,
205
- * policy_blocked.
206
- */
207
- interface PolicyResolution {
208
- mode: string;
209
- policy_id: string;
210
- rules_fired: string[];
211
- reason: string;
212
- approval_mode: string;
213
- condition_trace: PolicyConditionTrace[];
214
- /**
215
- * True when the resolution was computed against synthetic
216
- * authoring-time input (no real terraform plan). Drives the
217
- * "Preview" UI affordance in the canvas sidebar.
218
- */
219
- is_authoring_time_preview: boolean;
220
- }
221
- declare const PolicyResolution: MessageFns$1<PolicyResolution>;
222
- /**
223
- * PolicyConditionTrace is one rule's contribution to the resolution:
224
- * whether it fired plus the per-predicate breakdown that produced the
225
- * fire/no-fire outcome. Mirrors `apps/cli/internal/policy.ConditionTrace`.
226
- */
227
- interface PolicyConditionTrace {
228
- policy_id: string;
229
- label: string;
230
- fired: boolean;
231
- predicates: PolicyPredicateTrace[];
232
- }
233
- declare const PolicyConditionTrace: MessageFns$1<PolicyConditionTrace>;
234
- /**
235
- * PolicyPredicateTrace is one predicate within a condition. `predicate`
236
- * names the predicate kind (resourceDestroyGte, attributePath,
237
- * riskFormula, etc.). `evaluated` is a JSON-encoded scalar (Evaluated
238
- * is `any` on the Go side; proto carries it as string for portability).
239
- *
240
- * `cannot_evaluate` distinguishes "predicate honestly evaluated false"
241
- * (cannot_evaluate=false, fired=false) from "input did not contain the
242
- * data this predicate needs" (cannot_evaluate=true, fired=false). The
243
- * latter is the common case in canvas authoring-time preview where no
244
- * real terraform plan exists, but it can also surface in authoritative
245
- * eval if a plan is genuinely missing an expected attribute path —
246
- * either way the audit log gains fidelity.
247
- */
248
- interface PolicyPredicateTrace {
249
- predicate: string;
250
- fired: boolean;
251
- evaluated: string;
252
- cannot_evaluate: boolean;
253
- }
254
- declare const PolicyPredicateTrace: MessageFns$1<PolicyPredicateTrace>;
255
201
  type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
256
202
  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 {} ? {
257
203
  [K in keyof T]?: DeepPartial$1<T[K]>;
@@ -271,441 +217,31 @@ interface MessageFns$1<T> {
271
217
  fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
272
218
  }
273
219
 
274
- declare enum NodeKind {
275
- NODE_KIND_UNSPECIFIED = 0,
276
- NODE_KIND_MODULE = 1,
277
- NODE_KIND_RESOURCE = 2,
278
- NODE_KIND_DATA = 3,
279
- UNRECOGNIZED = -1
280
- }
281
- declare enum InputMode {
282
- INPUT_MODE_UNSPECIFIED = 0,
283
- INPUT_MODE_EMPTY = 1,
284
- INPUT_MODE_LITERAL = 2,
285
- INPUT_MODE_VARIABLE = 3,
286
- INPUT_MODE_EXPRESSION = 4,
287
- INPUT_MODE_WIRED = 5,
288
- UNRECOGNIZED = -1
289
- }
290
- interface OutputExportEntry {
291
- name: string;
292
- source_instance: string;
293
- source_output: string;
294
- }
295
- declare const OutputExportEntry: MessageFns<OutputExportEntry>;
296
- /**
297
- * BundleState is the authoritative session state over the wire: the
298
- * Bundle IR + session-undo metadata. Consumers (VS Code extension,
299
- * portal, tests) project this locally via the canvas package's
300
- * `projectCanvasView(bundle, arrangement?, meta)` to produce a
301
- * renderable CanvasView — `arrangement` (node positions, group
302
- * collapse/label) is consumer-owned view state and never travels here.
303
- *
304
- * Not to be confused with the `bundle_snapshot` API entity, which is
305
- * the content-addressed immutable archival form in D1 + R2. BundleState
306
- * is a live, per-session wire shape.
307
- */
308
- interface BundleState {
309
- bundle: Bundle | undefined;
310
- can_undo: boolean;
311
- can_redo: boolean;
312
- is_dirty: boolean;
313
- }
314
- declare const BundleState: MessageFns<BundleState>;
315
- interface CanvasView$1 {
220
+ type CanvasView$1 = {
316
221
  module_name: string;
317
222
  nodes: RenderNode$1[];
318
223
  edges: RenderEdge$1[];
319
- errors: RenderError$1[];
320
- can_undo: boolean;
321
- can_redo: boolean;
322
- is_dirty: boolean;
323
- groups: RenderGroup$1[];
324
- }
325
- declare const CanvasView$1: MessageFns<CanvasView$1>;
326
- /**
327
- * RenderGroup represents an expand/collapse container on the canvas.
328
- * One `group` on the canvas corresponds to either a child Use whose
329
- * target module has its own sub-modules, or a user-created group
330
- * produced via CreateGroupAction.
331
- *
332
- * A group's behaviour:
333
- * - Registry drops whose target has sub-modules: module_key names
334
- * that target; inputs/outputs mirror its declared Interface.
335
- * - User-created groups (via "Group" canvas action): module_key is
336
- * empty; inputs/outputs are derived from crossing edges by the
337
- * webview.
338
- *
339
- * Groups arrive collapsed (collapsed=true) across all creation paths
340
- * for consistency. Expand/collapse is a pure view toggle that never
341
- * changes the IR or generated .tf — ungroup is the destructive
342
- * dissolve action.
343
- */
344
- interface RenderGroup$1 {
345
- id: string;
346
- label: string;
347
- node_ids: string[];
348
- collapsed: boolean;
349
- /**
350
- * Bundle source identifier (e.g. "aws/examples/iam_stack@v1.0.0")
351
- * for groups backed by a registry drop; empty for user-created
352
- * local groups.
353
- */
354
- module_key: string;
355
- /**
356
- * Boundary input pins — what the group's target accepts from its
357
- * parent scope. Rendered on the left rail when collapsed; derived
358
- * from the target's Interface.Inputs (module-backed groups) or the
359
- * crossing edges (user-created groups).
360
- */
361
- inputs: NodePin$1[];
362
- /**
363
- * Boundary output pins — what the group's target exposes to its
364
- * parent scope. Rendered on the right rail when collapsed; derived
365
- * from the target's Exports (module-backed groups) or outgoing
366
- * crossing edges (user-created groups).
367
- */
368
- outputs: NodePin$1[];
369
- }
370
- declare const RenderGroup$1: MessageFns<RenderGroup$1>;
371
- interface RenderNode$1 {
372
- id: string;
373
- label: string;
374
- kind: NodeKind;
375
- module_key: string;
376
- icon_url: string;
377
- position: Position | undefined;
378
- has_errors: boolean;
379
- error_messages: string[];
380
- inputs: NodePin$1[];
381
- outputs: NodePin$1[];
382
- }
383
- declare const RenderNode$1: MessageFns<RenderNode$1>;
384
- /**
385
- * NodePin is a compact handle descriptor rendered on the canvas. One pin is
386
- * emitted per input variable (left rail) and per output (right rail) so the
387
- * webview can draw Blender-style per-variable connection handles.
388
- */
389
- interface NodePin$1 {
390
- name: string;
391
- /** HCL type string, e.g. "string", "list(object)" */
392
- type: string;
393
- /** inputs only; always false for outputs */
394
- required: boolean;
395
- /** input has an Out binding, or output feeds >=1 edge */
396
- wired: boolean;
397
- description: string;
398
- /** outputs only */
399
- sensitive: boolean;
400
- }
401
- declare const NodePin$1: MessageFns<NodePin$1>;
402
- interface RenderEdge$1 {
403
- id: string;
404
- source: string;
405
- target: string;
406
- source_output: string;
407
- target_input: string;
408
- }
409
- declare const RenderEdge$1: MessageFns<RenderEdge$1>;
410
- interface RenderInput$1 {
411
- name: string;
412
- type: string;
413
- required: boolean;
414
- description: string;
415
- default_value: any | undefined;
416
- validation: ValidationBlock | undefined;
417
- mode: InputMode;
418
- value: any | undefined;
419
- variable: string;
420
- expression: string;
421
- wired_source: string;
422
- }
423
- declare const RenderInput$1: MessageFns<RenderInput$1>;
424
- interface RenderOutput$1 {
425
- name: string;
426
- type: string;
427
- description: string;
428
- sensitive: boolean;
429
- }
430
- declare const RenderOutput$1: MessageFns<RenderOutput$1>;
431
- interface NodeConfig$1 {
432
- instance_id: string;
433
- inputs: RenderInput$1[];
434
- outputs: RenderOutput$1[];
435
- sibling_ids: string[];
436
- depends_on: string[];
437
- available_variables: VariableRef[];
438
- /** A module call's `providers = {}` map (child-local name → root ref). */
439
- providers: {
440
- [key: string]: string;
441
- };
442
- }
443
- declare const NodeConfig$1: MessageFns<NodeConfig$1>;
444
- interface VariableRef {
445
- name: string;
446
- type: string;
447
- }
448
- declare const VariableRef: MessageFns<VariableRef>;
449
- interface EdgeConfig$1 {
450
- source_instance: string;
451
- target_instance: string;
452
- source_outputs: RenderOutput$1[];
453
- target_unbound_inputs: RenderInput$1[];
454
- }
455
- declare const EdgeConfig$1: MessageFns<EdgeConfig$1>;
456
- interface SettingsConfig$1 {
457
- terraform: TerraformView | undefined;
458
- providers: ProviderView[];
459
- locals: LocalView[];
460
- environments: {
461
- [key: string]: {
462
- [key: string]: any;
463
- } | undefined;
464
- };
465
- environment_backends: {
466
- [key: string]: BackendView;
467
- };
468
- /**
469
- * Interface — the entry module's curated public surface, surfaced to
470
- * the UnifiedSettingsPanel's Module > Interface accordion. Inputs are
471
- * the composition's `var.xxx` declarations (auto-derived on first
472
- * generate, edited by hand thereafter). Exports name which child
473
- * outputs are surfaced to consumers; output_defs carries the matching
474
- * type/description/sensitive metadata.
475
- */
476
- variables: InputDef[];
477
- exports: OutputExportEntry[];
478
- output_defs: OutputDef[];
479
- }
480
- declare const SettingsConfig$1: MessageFns<SettingsConfig$1>;
481
- interface TerraformView {
482
- required_version: string;
483
- required_providers: ProviderReqView[];
484
- backend: BackendView | undefined;
485
- }
486
- declare const TerraformView: MessageFns<TerraformView>;
487
- interface ProviderReqView {
488
- name: string;
489
- source: string;
490
- version: string;
491
- /**
492
- * Provider references the module declares it accepts from its caller
493
- * (`configuration_aliases = [aws.src, aws.dst]`). Each entry is a `name` or
494
- * `name.alias` reference, re-emitted unquoted; carried so the panel neither
495
- * drops nor corrupts the construct.
496
- */
497
- configuration_aliases: string[];
498
- }
499
- declare const ProviderReqView: MessageFns<ProviderReqView>;
500
- interface BackendView {
501
- type: string;
502
- config: {
503
- [key: string]: any | undefined;
504
- };
505
- }
506
- declare const BackendView: MessageFns<BackendView>;
507
- interface ProviderView {
508
- name: string;
509
- alias: string;
510
- config: {
511
- [key: string]: string;
512
- };
513
- /**
514
- * Nested config blocks (default_tags, assume_role, …). Full-fidelity,
515
- * read-only echo: the panel renders and round-trips these verbatim but does
516
- * not structurally edit them, deliberately mixing tiers with the flattened,
517
- * editable `config` map above (see ProvidersPanel). Reuses state.proto's
518
- * recursive Block so no HCL is re-serialized on the wire.
519
- */
520
- blocks: Block[];
521
- }
522
- declare const ProviderView: MessageFns<ProviderView>;
523
- interface LocalView {
524
- name: string;
525
- mode: string;
526
- value_display: string;
527
- }
528
- declare const LocalView: MessageFns<LocalView>;
529
- interface RenderError$1 {
530
- instance_id: string;
531
- input_name: string;
532
- message: string;
533
- }
534
- declare const RenderError$1: MessageFns<RenderError$1>;
535
- interface Position {
536
- x: number;
537
- y: number;
538
- }
539
- declare const Position: MessageFns<Position>;
540
- interface InputDef {
541
- name: string;
542
- type: string;
543
- required: boolean;
544
- description: string;
545
- default_value: any | undefined;
546
- validation: ValidationBlock[];
547
- /** unset = default (false); explicit true is meaningful */
548
- ephemeral?: boolean | undefined;
549
- /** unset = default (true); explicit false is meaningful */
550
- nullable?: boolean | undefined;
551
- sensitive: boolean;
552
- }
553
- declare const InputDef: MessageFns<InputDef>;
554
- interface ValidationBlock {
555
- condition: string;
556
- error_message: string;
557
- }
558
- declare const ValidationBlock: MessageFns<ValidationBlock>;
559
- interface OutputDef {
560
- name: string;
561
- type: string;
562
- description: string;
563
- sensitive: boolean;
564
- depends_on: string[];
565
- }
566
- declare const OutputDef: MessageFns<OutputDef>;
567
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
568
- type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
569
- [K in keyof T]?: DeepPartial<T[K]>;
570
- } : Partial<T>;
571
- type KeysOfUnion<T> = T extends T ? keyof T : never;
572
- type Exact<P, I extends P> = P extends Builtin ? P : P & {
573
- [K in keyof P]: Exact<P[K], I[K]>;
574
- } & {
575
- [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
576
- };
577
- interface MessageFns<T> {
578
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
579
- decode(input: BinaryReader | Uint8Array, length?: number): T;
580
- fromJSON(object: any): T;
581
- toJSON(message: T): unknown;
582
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
583
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
584
- }
585
-
586
- type ProtoDiagnosticLike = {
587
- severity: number;
588
- message: string;
589
- file: string;
590
- line: number;
591
- column: number;
592
- instance_id?: string;
593
- address?: string;
594
- };
595
- type ProtoRenderInputLike = {
596
- name: string;
597
- type: string;
598
- required: boolean;
599
- description: string;
600
- default_value?: unknown;
601
- validation?: {
602
- condition: string;
603
- error_message: string;
604
- } | ValidationBlock;
605
- mode: number;
606
- value?: unknown;
607
- variable: string;
608
- expression: string;
609
- wired_source: string;
610
- };
611
- type ProtoRenderNodeLike = {
612
- id: string;
613
- label: string;
614
- kind: number;
615
- module_key: string;
616
- icon_url: string;
617
- position?: {
618
- x: number;
619
- y: number;
620
- } | Position;
621
- has_errors: boolean;
622
- error_messages: string[];
623
- inputs: NodePin$1[];
624
- outputs: NodePin$1[];
625
- };
626
- type ProtoRenderErrorLike = {
627
- instance_id: string;
628
- input_name: string;
629
- message: string;
630
- };
631
- type ProtoCanvasViewLike = {
632
- module_name: string;
633
- nodes: ProtoRenderNodeLike[];
634
- edges: RenderEdge$1[];
635
- errors: ProtoRenderErrorLike[];
636
224
  can_undo: boolean;
637
225
  can_redo: boolean;
638
- is_dirty: boolean;
226
+ unsaved: boolean;
639
227
  groups: RenderGroup$1[];
228
+ conflict?: Conflict;
229
+ ungenerated: boolean;
640
230
  };
641
- type ProtoNodeConfigLike = {
642
- instance_id: string;
643
- inputs: ProtoRenderInputLike[];
644
- outputs: RenderOutput$1[];
645
- sibling_ids: string[];
646
- depends_on: string[];
647
- providers: Record<string, string>;
648
- available_variables: VariableRef[];
649
- };
650
- type ProtoEdgeConfigLike = {
651
- source_instance: string;
652
- target_instance: string;
653
- source_outputs: RenderOutput$1[];
654
- target_unbound_inputs: ProtoRenderInputLike[];
655
- };
656
- type ProtoInputDefLike = {
657
- name: string;
658
- type: string;
659
- required: boolean;
660
- description: string;
661
- default_value?: unknown;
662
- validation?: ValidationBlock[];
663
- ephemeral?: boolean;
664
- nullable?: boolean;
665
- sensitive?: boolean;
666
- };
667
- type ProtoOutputDefLike = {
668
- name: string;
669
- type: string;
670
- description: string;
671
- sensitive: boolean;
672
- depends_on?: string[];
673
- };
674
- type ProtoOutputExportEntryLike = {
675
- name: string;
676
- source_instance: string;
677
- source_output: string;
678
- };
679
- type ProtoSettingsConfigLike = {
680
- terraform?: TerraformView;
681
- providers: ProviderView[];
682
- locals: LocalView[];
683
- environments: Record<string, Record<string, unknown> | undefined>;
684
- variables: ProtoInputDefLike[];
685
- exports: ProtoOutputExportEntryLike[];
686
- output_defs: ProtoOutputDefLike[];
687
- };
688
-
689
- type CanvasView = {
690
- module_name: string;
691
- nodes: RenderNode[];
692
- edges: RenderEdge[];
693
- errors: RenderError[];
694
- can_undo: boolean;
695
- can_redo: boolean;
696
- is_dirty: boolean;
697
- groups: RenderGroup[];
231
+ type Conflict = {
232
+ base_tree_hash: string;
233
+ tree_hash: string;
698
234
  };
699
- type RenderGroup = {
235
+ type RenderGroup$1 = {
700
236
  id: string;
701
237
  label: string;
702
238
  node_ids: string[];
703
239
  collapsed: boolean;
704
240
  module_key?: string;
705
- inputs?: NodePin[];
706
- outputs?: NodePin[];
241
+ inputs?: NodePin$1[];
242
+ outputs?: NodePin$1[];
707
243
  };
708
- type RenderNode = {
244
+ type RenderNode$1 = {
709
245
  id: string;
710
246
  label: string;
711
247
  kind: 'module' | 'resource' | 'data';
@@ -715,12 +251,10 @@ type RenderNode = {
715
251
  x: number;
716
252
  y: number;
717
253
  };
718
- has_errors: boolean;
719
- error_messages: string[];
720
- inputs: NodePin[];
721
- outputs: NodePin[];
254
+ inputs: NodePin$1[];
255
+ outputs: NodePin$1[];
722
256
  };
723
- type NodePin = {
257
+ type NodePin$1 = {
724
258
  name: string;
725
259
  type: string;
726
260
  type_family?: string;
@@ -729,7 +263,7 @@ type NodePin = {
729
263
  description?: string;
730
264
  sensitive?: boolean;
731
265
  };
732
- type RenderEdge = {
266
+ type RenderEdge$1 = {
733
267
  id: string;
734
268
  source: string;
735
269
  target: string;
@@ -770,12 +304,6 @@ type NodeConfig = {
770
304
  type: string;
771
305
  }>;
772
306
  };
773
- type EdgeConfig = {
774
- source_instance: string;
775
- target_instance: string;
776
- source_outputs: RenderOutput[];
777
- target_unbound_inputs: RenderInput[];
778
- };
779
307
  type SettingsConfig = {
780
308
  terraform: {
781
309
  required_version: string;
@@ -797,7 +325,6 @@ type SettingsConfig = {
797
325
  mode: string;
798
326
  value_display: string;
799
327
  }>;
800
- environments: Record<string, Record<string, unknown>>;
801
328
  variables: Array<{
802
329
  name: string;
803
330
  type: string;
@@ -825,15 +352,12 @@ type SettingsConfig = {
825
352
  depends_on?: string[];
826
353
  }>;
827
354
  };
828
- type RenderError = {
829
- instance_id?: string;
830
- input_name?: string;
831
- message: string;
832
- };
833
355
  type Diagnostic = {
834
356
  severity: 'error' | 'warning' | 'info';
835
357
  message: string;
358
+ module_key?: string;
836
359
  instance_id?: string;
360
+ input_name?: string;
837
361
  address?: string;
838
362
  file?: string;
839
363
  line?: number;
@@ -851,42 +375,56 @@ type ViewportIntent = {
851
375
  duration?: number;
852
376
  };
853
377
 
854
- type HostToWebview = {
855
- command: 'loadState';
856
- state: BundleState;
857
- viewportIntent?: ViewportIntent;
378
+ declare function convertDiagnostic(d: ProtoDiagnosticLike): Diagnostic;
379
+
380
+ declare const ENGINE_METHODS: readonly ["Initialize", "SessionOpen", "TestSessionOpen", "SessionSave", "SessionClose", "SessionGenerate", "SessionResolveConflict", "ApplyAction", "CancelInvoke"];
381
+ declare const ENGINE_STREAM_METHODS: readonly ["Subscribe", "Invoke"];
382
+ type EngineMethod = (typeof ENGINE_METHODS)[number];
383
+ type EngineStreamMethod = (typeof ENGINE_STREAM_METHODS)[number];
384
+ type BridgeMethod = Exclude<EngineMethod, 'TestSessionOpen'>;
385
+ declare const BRIDGE_METHODS: BridgeMethod[];
386
+ type BridgeRequest = {
387
+ kind: 'unary';
388
+ id: string;
389
+ method: BridgeMethod;
390
+ request: unknown;
858
391
  } | {
859
- command: 'generateProgress';
860
- phase: GeneratePhase;
392
+ kind: 'stream';
393
+ id: string;
394
+ method: EngineStreamMethod;
395
+ request: unknown;
861
396
  } | {
862
- command: 'generateSuccess';
863
- files?: string[];
397
+ kind: 'abort';
398
+ id: string;
399
+ };
400
+ type BridgeResponse = {
401
+ kind: 'result';
402
+ id: string;
403
+ response: unknown;
864
404
  } | {
865
- command: 'generateError';
866
- message: string;
867
- diagnostics?: Diagnostic[];
405
+ kind: 'event';
406
+ id: string;
407
+ event: unknown;
868
408
  } | {
869
- command: 'policyResolution';
870
- resolution: PolicyResolution;
409
+ kind: 'end';
410
+ id: string;
871
411
  } | {
872
- command: 'engineResult';
873
- requestId: string;
874
- result?: unknown;
875
- error?: string;
412
+ kind: 'error';
413
+ id: string;
414
+ code: string;
415
+ message: string;
416
+ };
417
+ type MessageBridge = {
418
+ post(m: BridgeRequest | BridgeResponse): void;
419
+ onMessage(f: (m: unknown) => void): () => void;
876
420
  };
877
421
 
878
- declare function convertNodeKind(value: number): 'module' | 'resource' | 'data';
879
- declare function convertInputMode(value: number): 'empty' | 'literal' | 'variable' | 'expression' | 'wired';
880
- declare function convertDiagnosticSeverity(value: number): 'error' | 'warning' | 'info';
881
- declare function modeToInputMode(mode: string): number;
882
- declare function convertRenderInput(input: ProtoRenderInputLike): RenderInput;
883
- declare function convertRenderNode(node: ProtoRenderNodeLike): RenderNode;
884
- declare function convertRenderError(error: ProtoRenderErrorLike): RenderError;
885
- declare function convertCanvasView(proto: ProtoCanvasViewLike): CanvasView;
886
- declare function convertNodeConfig(proto: ProtoNodeConfigLike): NodeConfig;
887
- declare function convertEdgeConfig(proto: ProtoEdgeConfigLike): EdgeConfig;
888
- declare function convertSettingsConfig(proto: ProtoSettingsConfigLike): SettingsConfig;
889
- declare function convertDiagnostic(d: ProtoDiagnosticLike): Diagnostic;
422
+ declare function deriveNodeConfig(bundle: Bundle, instanceId: string): NodeConfig | null;
423
+ declare function deriveSettingsConfig(bundle: Bundle): SettingsConfig;
424
+
425
+ declare function nodeIdForAddress(view: Pick<CanvasView$1, 'nodes' | 'groups'>, address: string): string | null;
426
+
427
+ declare function nodeIdForDiagnostic(view: Pick<CanvasView$1, 'nodes' | 'groups'>, diagnostic: Diagnostic): string | null;
890
428
 
891
429
  type XY = {
892
430
  x: number;
@@ -910,9 +448,12 @@ type ProjectionMeta = {
910
448
  moduleName?: string;
911
449
  canUndo: boolean;
912
450
  canRedo: boolean;
913
- isDirty: boolean;
451
+ unsaved: boolean;
452
+ conflict?: Conflict;
453
+ ungenerated?: boolean;
914
454
  };
915
- declare function projectCanvasView(bundle: Bundle, arrangement: CanvasArrangement | undefined, meta: ProjectionMeta): CanvasView;
455
+ declare const EMPTY_BUNDLE: Bundle;
456
+ declare function projectCanvasView(bundle: Bundle, arrangement: CanvasArrangement | undefined, meta: ProjectionMeta): CanvasView$1;
916
457
 
917
458
  declare function resolveScopePositions(ids: string[], arrangementNodes: CanvasArrangement[string]['nodes']): Map<string, XY>;
918
459
  declare function resolveScopePositionsByDepth(ids: string[], arrangementNodes: CanvasArrangement[string]['nodes'], edges: readonly LayoutEdge[]): Map<string, XY>;
@@ -930,9 +471,129 @@ declare function parseModuleKey(key: string): ParsedModuleKey;
930
471
 
931
472
  declare function resolveScopePath(bundle: Bundle, path: string): string | null;
932
473
 
933
- declare const CanvasViewProto: MessageFns<CanvasView$1>;
934
- declare const NodeConfigProto: MessageFns<NodeConfig$1>;
935
- declare const EdgeConfigProto: MessageFns<EdgeConfig$1>;
936
- declare const SettingsConfigProto: MessageFns<SettingsConfig$1>;
474
+ declare enum NodeKind {
475
+ NODE_KIND_UNSPECIFIED = 0,
476
+ NODE_KIND_MODULE = 1,
477
+ NODE_KIND_RESOURCE = 2,
478
+ NODE_KIND_DATA = 3,
479
+ UNRECOGNIZED = -1
480
+ }
481
+ interface CanvasView {
482
+ module_name: string;
483
+ nodes: RenderNode[];
484
+ edges: RenderEdge[];
485
+ can_undo: boolean;
486
+ can_redo: boolean;
487
+ unsaved: boolean;
488
+ groups: RenderGroup[];
489
+ }
490
+ declare const CanvasView: MessageFns<CanvasView>;
491
+ /**
492
+ * RenderGroup represents an expand/collapse container on the canvas.
493
+ * One `group` on the canvas corresponds to either a child Use whose
494
+ * target module has its own sub-modules, or a user-created group
495
+ * produced via CreateGroupAction.
496
+ *
497
+ * A group's behaviour:
498
+ * - Registry drops whose target has sub-modules: module_key names
499
+ * that target; inputs/outputs mirror its declared Interface.
500
+ * - User-created groups (via "Group" canvas action): module_key is
501
+ * empty; inputs/outputs are derived from crossing edges by the
502
+ * webview.
503
+ *
504
+ * Groups arrive collapsed (collapsed=true) across all creation paths
505
+ * for consistency. Expand/collapse is a pure view toggle that never
506
+ * changes the IR or generated .tf — ungroup is the destructive
507
+ * dissolve action.
508
+ */
509
+ interface RenderGroup {
510
+ id: string;
511
+ label: string;
512
+ node_ids: string[];
513
+ collapsed: boolean;
514
+ /**
515
+ * Bundle source identifier (e.g. "aws/examples/iam_stack@v1.0.0")
516
+ * for groups backed by a registry drop; empty for user-created
517
+ * local groups.
518
+ */
519
+ module_key: string;
520
+ /**
521
+ * Boundary input pins — what the group's target accepts from its
522
+ * parent scope. Rendered on the left rail when collapsed; derived
523
+ * from the target's Interface.Inputs (module-backed groups) or the
524
+ * crossing edges (user-created groups).
525
+ */
526
+ inputs: NodePin[];
527
+ /**
528
+ * Boundary output pins — what the group's target exposes to its
529
+ * parent scope. Rendered on the right rail when collapsed; derived
530
+ * from the target's Exports (module-backed groups) or outgoing
531
+ * crossing edges (user-created groups).
532
+ */
533
+ outputs: NodePin[];
534
+ }
535
+ declare const RenderGroup: MessageFns<RenderGroup>;
536
+ interface RenderNode {
537
+ id: string;
538
+ label: string;
539
+ kind: NodeKind;
540
+ module_key: string;
541
+ icon_url: string;
542
+ position: Position | undefined;
543
+ inputs: NodePin[];
544
+ outputs: NodePin[];
545
+ }
546
+ declare const RenderNode: MessageFns<RenderNode>;
547
+ /**
548
+ * NodePin is a compact handle descriptor rendered on the canvas. One pin is
549
+ * emitted per input variable (left rail) and per output (right rail) so the
550
+ * webview can draw Blender-style per-variable connection handles.
551
+ */
552
+ interface NodePin {
553
+ name: string;
554
+ /** HCL type string, e.g. "string", "list(object)" */
555
+ type: string;
556
+ /** inputs only; always false for outputs */
557
+ required: boolean;
558
+ /** input has an Out binding, or output feeds >=1 edge */
559
+ wired: boolean;
560
+ description: string;
561
+ /** outputs only */
562
+ sensitive: boolean;
563
+ }
564
+ declare const NodePin: MessageFns<NodePin>;
565
+ interface RenderEdge {
566
+ id: string;
567
+ source: string;
568
+ target: string;
569
+ source_output: string;
570
+ target_input: string;
571
+ }
572
+ declare const RenderEdge: MessageFns<RenderEdge>;
573
+ interface Position {
574
+ x: number;
575
+ y: number;
576
+ }
577
+ declare const Position: MessageFns<Position>;
578
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
579
+ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
580
+ [K in keyof T]?: DeepPartial<T[K]>;
581
+ } : Partial<T>;
582
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
583
+ type Exact<P, I extends P> = P extends Builtin ? P : P & {
584
+ [K in keyof P]: Exact<P[K], I[K]>;
585
+ } & {
586
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
587
+ };
588
+ interface MessageFns<T> {
589
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
590
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
591
+ fromJSON(object: any): T;
592
+ toJSON(message: T): unknown;
593
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
594
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
595
+ }
596
+
597
+ declare const CanvasViewProto: MessageFns<CanvasView>;
937
598
 
938
- export { Bundle, type CanvasArrangement, type CanvasView, CanvasViewProto, type DeepPartial$1 as DeepPartial, type Diagnostic, type EdgeConfig, EdgeConfigProto, type GeneratePhase, type HostToWebview, type NodeConfig, NodeConfigProto, type NodePin, type ParsedModuleKey, type ProjectionMeta, type ProtoCanvasViewLike, type ProtoDiagnosticLike, type ProtoEdgeConfigLike, type ProtoInputDefLike, type ProtoNodeConfigLike, type ProtoOutputDefLike, type ProtoOutputExportEntryLike, type ProtoRenderErrorLike, type ProtoRenderInputLike, type ProtoRenderNodeLike, type ProtoSettingsConfigLike, type RenderEdge, type RenderError, type RenderGroup, type RenderInput, type RenderNode, type RenderOutput, type SettingsConfig, SettingsConfigProto, type ViewportIntent, type XY, convertCanvasView, convertDiagnostic, convertDiagnosticSeverity, convertEdgeConfig, convertInputMode, convertNodeConfig, convertNodeKind, convertRenderError, convertRenderInput, convertRenderNode, convertSettingsConfig, modeToInputMode, parseModuleKey, projectCanvasView, resolveScopePath, resolveScopePositions, resolveScopePositionsByDepth };
599
+ export { BRIDGE_METHODS, type BridgeMethod, type BridgeRequest, type BridgeResponse, Bundle, type CanvasArrangement, type CanvasView$1 as CanvasView, CanvasViewProto, type Conflict, type DeepPartial$1 as DeepPartial, type Diagnostic, EMPTY_BUNDLE, ENGINE_METHODS, ENGINE_STREAM_METHODS, type EngineMethod, type EngineStreamMethod, type GeneratePhase, type MessageBridge, type NodeConfig, type NodePin$1 as NodePin, type ParsedModuleKey, type ProjectionMeta, type ProtoDiagnosticLike, type RenderEdge$1 as RenderEdge, type RenderGroup$1 as RenderGroup, type RenderInput, type RenderNode$1 as RenderNode, type RenderOutput, type SettingsConfig, type ViewportIntent, type XY, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, nodeIdForAddress, nodeIdForDiagnostic, parseModuleKey, projectCanvasView, resolveScopePath, resolveScopePositions, resolveScopePositionsByDepth };