@lace-cloud/proto 0.37.0 → 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
@@ -51,15 +51,15 @@ declare const GROUP_HEADER_HEIGHT = 32;
51
51
  declare const COLLAPSED_GROUP_WIDTH = 220;
52
52
  /** The inputs a folded card draws: those it needs (required) and those a
53
53
  * wire feeds; the rest fold behind "+N more". */
54
- declare function visibleInputs(inputs: readonly NodePin$1[]): NodePin$1[];
54
+ declare function visibleInputs(inputs: readonly NodePin[]): NodePin[];
55
55
  /** How many pin rows a folded card draws: its visible inputs, plus one for
56
56
  * "+N more" when some fold, against its outputs. */
57
- declare function nodeRows(node: Pick<RenderNode$1, 'inputs' | 'outputs'>): number;
57
+ declare function nodeRows(node: Pick<RenderNode, 'inputs' | 'outputs'>): number;
58
58
  /** A module card's extent as ModuleNode draws it, folded. */
59
- declare function nodeSize(node: Pick<RenderNode$1, 'inputs' | 'outputs'>): Size;
59
+ declare function nodeSize(node: Pick<RenderNode, 'inputs' | 'outputs'>): Size;
60
60
  /** Where on a folded card an input's wire lands, from the card's top: the
61
61
  * centre of its row, or of the header when the input is folded away. */
62
- declare function inputPinY(node: Pick<RenderNode$1, 'inputs'>, name: string): number;
62
+ declare function inputPinY(node: Pick<RenderNode, 'inputs'>, name: string): number;
63
63
  /** The extent of a set of boxes: the least box that holds them all; an
64
64
  * empty one at the origin when there are none. A group's box is its
65
65
  * content's extent with its padding (`groupBoxSize`). */
@@ -70,7 +70,7 @@ declare function groupBoxSize(content: Size): Size;
70
70
  /** A collapsed group's card: its header, then its interface's pins
71
71
  * (`groupPins`), inputs on the left rail and outputs on the right, a row
72
72
  * per pin of the longer rail. */
73
- declare function collapsedGroupSize(pins: Pick<RenderGroup$1, 'inputs' | 'outputs'>): Size;
73
+ declare function collapsedGroupSize(pins: Pick<RenderGroup, 'inputs' | 'outputs'>): Size;
74
74
  /** Where on a collapsed group's card the pin of row `row` of either rail is
75
75
  * centred, from the card's top. */
76
76
  declare function groupPinY(row: number): number;
@@ -78,24 +78,24 @@ declare function groupPinY(row: number): number;
78
78
  * input's row, which the group draws at the same height collapsed or
79
79
  * expanded, or of its header when the input is not one of its interface's
80
80
  * (a meta-argument). */
81
- declare function groupInputPinY(group: Pick<RenderGroup$1, 'inputs'>, name: string): number;
81
+ declare function groupInputPinY(group: Pick<RenderGroup, 'inputs'>, name: string): number;
82
82
  /** What a group draws: its card while collapsed; its `box` while expanded. */
83
- declare function groupFootprint(group: Pick<RenderGroup$1, 'collapsed' | 'inputs' | 'outputs'>, box: Size): Size;
83
+ declare function groupFootprint(group: Pick<RenderGroup, 'collapsed' | 'inputs' | 'outputs'>, box: Size): Size;
84
84
  /** Everything a group can draw from one anchor, collapsed or expanded: the
85
85
  * larger, in width and in height, of its card (from its interface's pins)
86
86
  * and its `box`. A paste keeps a pasted group's reach clear of everything
87
87
  * its scope draws; Group steps a fresh group's reach past what the layout
88
88
  * keeps before it, and the layout steps what comes after it down past it. */
89
- declare function groupReach(pins: Pick<RenderGroup$1, 'inputs' | 'outputs'>, box: Size): Size;
89
+ declare function groupReach(pins: Pick<RenderGroup, 'inputs' | 'outputs'>, box: Size): Size;
90
90
 
91
- type CanvasView$1 = {
91
+ type CanvasView = {
92
92
  module_name: string;
93
- nodes: RenderNode$1[];
94
- edges: RenderEdge$1[];
93
+ nodes: RenderNode[];
94
+ edges: RenderEdge[];
95
95
  can_undo: boolean;
96
96
  can_redo: boolean;
97
97
  unsaved: boolean;
98
- groups: RenderGroup$1[];
98
+ groups: RenderGroup[];
99
99
  conflict?: Conflict;
100
100
  ungenerated: boolean;
101
101
  };
@@ -103,21 +103,21 @@ type Conflict = {
103
103
  base_tree_hash: string;
104
104
  tree_hash: string;
105
105
  };
106
- type RenderGroup$1 = {
106
+ type RenderGroup = {
107
107
  id: string;
108
108
  label: string;
109
109
  node_ids: string[];
110
110
  collapsed: boolean;
111
111
  module_key?: string;
112
- inputs?: NodePin$1[];
113
- outputs?: NodePin$1[];
112
+ inputs?: NodePin[];
113
+ outputs?: NodePin[];
114
114
  position: XY;
115
115
  size: Size;
116
116
  origin: XY;
117
117
  call_wired?: boolean;
118
118
  meta_wired?: MetaArgument[];
119
119
  };
120
- type RenderNode$1 = {
120
+ type RenderNode = {
121
121
  id: string;
122
122
  label: string;
123
123
  kind: 'module' | 'resource' | 'data';
@@ -127,14 +127,14 @@ type RenderNode$1 = {
127
127
  x: number;
128
128
  y: number;
129
129
  };
130
- inputs: NodePin$1[];
131
- outputs: NodePin$1[];
130
+ inputs: NodePin[];
131
+ outputs: NodePin[];
132
132
  call_wired?: boolean;
133
133
  meta_wired?: MetaArgument[];
134
134
  };
135
135
  declare const META_ARGUMENTS: readonly ["count", "for_each"];
136
136
  type MetaArgument = (typeof META_ARGUMENTS)[number];
137
- type NodePin$1 = {
137
+ type NodePin = {
138
138
  name: string;
139
139
  type: string;
140
140
  type_family?: string;
@@ -143,7 +143,7 @@ type NodePin$1 = {
143
143
  description?: string;
144
144
  sensitive?: boolean;
145
145
  };
146
- type RenderEdge$1 = {
146
+ type RenderEdge = {
147
147
  id: string;
148
148
  source: string;
149
149
  target: string;
@@ -326,7 +326,7 @@ declare enum Reason {
326
326
  /** REASON_CONFLICT - Generate: the tree moved under the session's base; Keep or Reload first. */
327
327
  REASON_CONFLICT = 6,
328
328
  /**
329
- * REASON_SOURCE_REFUSED - Every mutation, save and generate: the session's source tf is refused
329
+ * REASON_SOURCE_REFUSED - Every mutation, save, discard and generate: the session's source tf is refused
330
330
  * (`BundleState.source_refused`).
331
331
  * module convert and module import: the tree's tf does not parse, has a
332
332
  * non-empty residual report, or its Bundle fails its own validation.
@@ -419,8 +419,24 @@ declare enum Reason {
419
419
  REASON_NO_LOCKFILE = 22,
420
420
  /** REASON_NO_COMMIT - stack create --source: the directory's repository has no commit yet. */
421
421
  REASON_NO_COMMIT = 23,
422
+ /**
423
+ * REASON_STALE_WORKING_STATE - Discard and Restore: the session's working IR is no longer the one the
424
+ * caller showed the developer (`BundleState.working_digest`) -- another
425
+ * holder edited, undid or redid since. Restore also: the saved IR or source
426
+ * tree is no longer the one the backup was captured against. Nothing was
427
+ * discarded or restored; re-read the state and ask again.
428
+ */
429
+ REASON_STALE_WORKING_STATE = 24,
430
+ /**
431
+ * REASON_NO_STACK - A command that names a stack (an id, team/slug, or a slug in the
432
+ * selected team): the ref names no stack the caller can read. Pass the
433
+ * ref of a stack that exists; `lace stack list` lists them.
434
+ */
435
+ REASON_NO_STACK = 25,
422
436
  UNRECOGNIZED = -1
423
437
  }
438
+ declare function reasonFromJSON(object: any): Reason;
439
+ declare function reasonToJSON(object: Reason): string;
424
440
 
425
441
  interface Bundle {
426
442
  /**
@@ -661,13 +677,6 @@ interface MessageFns$1<T> {
661
677
  fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
662
678
  }
663
679
 
664
- declare enum NodeKind {
665
- NODE_KIND_UNSPECIFIED = 0,
666
- NODE_KIND_MODULE = 1,
667
- NODE_KIND_RESOURCE = 2,
668
- NODE_KIND_DATA = 3,
669
- UNRECOGNIZED = -1
670
- }
671
680
  /**
672
681
  * ReasonDetail rides a refused RPC's status as its one error detail:
673
682
  * `grpc-status-details-bin` over gRPC, `details[]` over Connect. A
@@ -685,103 +694,6 @@ interface ReasonDetail {
685
694
  request_id: string;
686
695
  }
687
696
  declare const ReasonDetail: MessageFns<ReasonDetail>;
688
- interface CanvasView {
689
- module_name: string;
690
- nodes: RenderNode[];
691
- edges: RenderEdge[];
692
- can_undo: boolean;
693
- can_redo: boolean;
694
- unsaved: boolean;
695
- groups: RenderGroup[];
696
- }
697
- declare const CanvasView: MessageFns<CanvasView>;
698
- /**
699
- * RenderGroup represents an expand/collapse container on the canvas.
700
- * One `group` on the canvas corresponds to either a child Use whose
701
- * target module has its own sub-modules, or a user-created group
702
- * produced via CreateGroupAction.
703
- *
704
- * A group's behaviour:
705
- * - Registry drops whose target has sub-modules: module_key names
706
- * that target; inputs/outputs mirror its declared Interface.
707
- * - User-created groups (via "Group" canvas action): module_key is
708
- * empty; inputs/outputs are derived from crossing edges by the
709
- * webview.
710
- *
711
- * Groups arrive collapsed (collapsed=true) across all creation paths
712
- * for consistency. Expand/collapse is a pure view toggle that never
713
- * changes the IR or generated .tf — ungroup is the destructive
714
- * dissolve action.
715
- */
716
- interface RenderGroup {
717
- id: string;
718
- label: string;
719
- node_ids: string[];
720
- collapsed: boolean;
721
- /**
722
- * Bundle source identifier (e.g. "aws/examples/iam_stack@v1.0.0")
723
- * for groups backed by a registry drop; empty for user-created
724
- * local groups.
725
- */
726
- module_key: string;
727
- /**
728
- * Boundary input pins — what the group's target accepts from its
729
- * parent scope. Rendered on the left rail when collapsed; derived
730
- * from the target's Interface.Inputs (module-backed groups) or the
731
- * crossing edges (user-created groups).
732
- */
733
- inputs: NodePin[];
734
- /**
735
- * Boundary output pins — what the group's target exposes to its
736
- * parent scope. Rendered on the right rail when collapsed; derived
737
- * from the target's Exports (module-backed groups) or outgoing
738
- * crossing edges (user-created groups).
739
- */
740
- outputs: NodePin[];
741
- }
742
- declare const RenderGroup: MessageFns<RenderGroup>;
743
- interface RenderNode {
744
- id: string;
745
- label: string;
746
- kind: NodeKind;
747
- module_key: string;
748
- icon_url: string;
749
- position: Position | undefined;
750
- inputs: NodePin[];
751
- outputs: NodePin[];
752
- }
753
- declare const RenderNode: MessageFns<RenderNode>;
754
- /**
755
- * NodePin is a compact handle descriptor rendered on the canvas. One pin is
756
- * emitted per input variable (left rail) and per output (right rail) so the
757
- * webview can draw Blender-style per-variable connection handles.
758
- */
759
- interface NodePin {
760
- name: string;
761
- /** HCL type string, e.g. "string", "list(object)" */
762
- type: string;
763
- /** inputs only; always false for outputs */
764
- required: boolean;
765
- /** input has an Out binding, or output feeds >=1 edge */
766
- wired: boolean;
767
- description: string;
768
- /** outputs only */
769
- sensitive: boolean;
770
- }
771
- declare const NodePin: MessageFns<NodePin>;
772
- interface RenderEdge {
773
- id: string;
774
- source: string;
775
- target: string;
776
- source_output: string;
777
- target_input: string;
778
- }
779
- declare const RenderEdge: MessageFns<RenderEdge>;
780
- interface Position {
781
- x: number;
782
- y: number;
783
- }
784
- declare const Position: MessageFns<Position>;
785
697
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
786
698
  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 {} ? {
787
699
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -897,12 +809,19 @@ declare class EngineIdentityMismatchError extends Error {
897
809
  */
898
810
  declare function checkEngineIdentity(engine: EngineIdentity): void;
899
811
 
812
+ type AddressParts = {
813
+ modules: string[];
814
+ resource: string;
815
+ };
816
+ declare function splitAddress(address: string): AddressParts;
817
+ declare function moduleCallPath(address: string): string;
818
+
900
819
  declare function deriveNodeConfig(bundle: Bundle, instanceId: string): NodeConfig | null;
901
820
  declare function deriveSettingsConfig(bundle: Bundle, moduleKey: string): SettingsConfig | null;
902
821
 
903
- declare function nodeIdForAddress(view: Pick<CanvasView$1, 'nodes' | 'groups'>, address: string): string | null;
822
+ declare function nodeIdForAddress(view: Pick<CanvasView, 'nodes' | 'groups'>, address: string): string | null;
904
823
 
905
- declare function nodeIdForDiagnostic(view: Pick<CanvasView$1, 'nodes' | 'groups'>, diagnostic: Diagnostic): string | null;
824
+ declare function nodeIdForDiagnostic(view: Pick<CanvasView, 'nodes' | 'groups'>, diagnostic: Diagnostic): string | null;
906
825
 
907
826
  type ProjectionMeta = {
908
827
  moduleName?: string;
@@ -913,7 +832,7 @@ type ProjectionMeta = {
913
832
  ungenerated?: boolean;
914
833
  };
915
834
  declare const EMPTY_BUNDLE: Bundle;
916
- declare function projectCanvasView(bundle: Bundle, arrangement: CanvasArrangement | undefined, meta: ProjectionMeta): CanvasView$1;
835
+ declare function projectCanvasView(bundle: Bundle, arrangement: CanvasArrangement | undefined, meta: ProjectionMeta): CanvasView;
917
836
 
918
837
  /**
919
838
  * stepDown moves a box of `size` at `at` down its column, just past whatever
@@ -960,7 +879,6 @@ type LayoutItem = {
960
879
  /** The y, from the item's top, a wire into `input` lands at. */
961
880
  pinY?: (input: string) => number;
962
881
  };
963
- declare function resolveScopePositionsByDepth(ids: string[], arrangementNodes: CanvasArrangement[string]['nodes'], edges: readonly LayoutEdge[]): Map<string, XY>;
964
882
  /**
965
883
  * layoutByDepth places a scope's items — cards and group boxes, each by its
966
884
  * drawn extent — and returns every item's top-left in the scope's frame.
@@ -993,7 +911,7 @@ declare function resolveScopePositionsByDepth(ids: string[], arrangementNodes: C
993
911
  */
994
912
  declare function layoutByDepth(items: readonly LayoutItem[], stored: ReadonlyMap<string, XY>, edges: readonly LayoutEdge[]): Map<string, XY>;
995
913
 
996
- type Frames = Pick<CanvasView$1, 'groups'>;
914
+ type Frames = Pick<CanvasView, 'groups'>;
997
915
  /** Where a group's box is drawn, from its members' origin and how far its
998
916
  * members reach up and left of that origin (`min`, never above 0): the
999
917
  * group's padding up and left of their top-left. With no reach it is the
@@ -1007,16 +925,16 @@ declare function originAt(box: XY, min?: XY): XY;
1007
925
  /** Where the instance at `canvasPath` is drawn, in canvas coordinates: its
1008
926
  * card's top-left, or its group's box's; undefined when the view draws no
1009
927
  * such instance. */
1010
- declare function drawnAt(view: Pick<CanvasView$1, 'nodes' | 'groups'>, canvasPath: string): XY | undefined;
928
+ declare function drawnAt(view: Pick<CanvasView, 'nodes' | 'groups'>, canvasPath: string): XY | undefined;
1011
929
  /** What the instance at `canvasPath` draws, in canvas coordinates: its
1012
930
  * card, or its group's card while collapsed and box while expanded
1013
931
  * (`groupFootprint`); undefined when the view draws no such instance. */
1014
- declare function drawnRect(view: Pick<CanvasView$1, 'nodes' | 'groups'>, canvasPath: string): Rect | undefined;
932
+ declare function drawnRect(view: Pick<CanvasView, 'nodes' | 'groups'>, canvasPath: string): Rect | undefined;
1015
933
  /** Everything the instance at `canvasPath` can draw from where it is drawn,
1016
934
  * in canvas coordinates: a card's rect, or a group's rect by its reach,
1017
935
  * collapsed or expanded alike (`groupReach`); undefined when the view draws
1018
936
  * no such instance. */
1019
- declare function reachRect(view: Pick<CanvasView$1, 'nodes' | 'groups'>, canvasPath: string): Rect | undefined;
937
+ declare function reachRect(view: Pick<CanvasView, 'nodes' | 'groups'>, canvasPath: string): Rect | undefined;
1020
938
  /** Where the frame starts that the instance at `canvasPath` is stored in:
1021
939
  * its group's members' origin, or the canvas's (0,0) in the entry scope. */
1022
940
  declare function frameOf(view: Frames, canvasPath: string): XY;
@@ -1045,7 +963,7 @@ type ParsedModuleKey = {
1045
963
  };
1046
964
  declare function parseModuleKey(key: string): ParsedModuleKey;
1047
965
 
1048
- declare function groupPins(target: Module): Required<Pick<RenderGroup$1, 'inputs' | 'outputs'>>;
966
+ declare function groupPins(target: Module): Required<Pick<RenderGroup, 'inputs' | 'outputs'>>;
1049
967
 
1050
968
  type InstanceChild = {
1051
969
  id: string;
@@ -1063,9 +981,6 @@ type InstanceAddress = {
1063
981
  id: string;
1064
982
  };
1065
983
  declare function instanceAddress(bundle: Bundle, id: string): InstanceAddress;
1066
- declare function resolveScopePath(bundle: Bundle, path: string): string | null;
1067
-
1068
- declare const CanvasViewProto: MessageFns<CanvasView>;
1069
984
 
1070
- export { BRIDGE_METHODS, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, CanvasViewProto, EMPTY_BUNDLE, ENGINE_CONTRACT, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, EngineIdentityMismatchError, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, META_ARGUMENTS, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, apiFields, boxAt, callText, checkEngineIdentity, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinText, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, resolveInstance, resolveScopePath, resolveScopePositionsByDepth, splitPath, stepDown, visibleInputs };
1071
- export type { BlockConfig, BridgeMethod, BridgeRequest, BridgeResponse, CanvasArrangement, CanvasView$1 as CanvasView, Conflict, DeepPartial$1 as DeepPartial, Diagnostic, EngineIdentity, EngineMethod, EngineStreamMethod, HostOnlyMethod, InstanceAddress, InstanceChild, KeepKey, LayoutEdge, LayoutItem, MessageBridge, MetaArgument, NodeConfig, NodePin$1 as NodePin, ParsedModuleKey, ProjectionMeta, ProtoDiagnosticLike, Rect, RenderEdge$1 as RenderEdge, RenderGroup$1 as RenderGroup, RenderInput, RenderNode$1 as RenderNode, RenderOutput, ResourceConfig, ScopedInstance, SettingsConfig, Size, ViewportIntent, XY };
985
+ export { BRIDGE_METHODS, Bundle, COLLAPSED_GROUP_WIDTH, CONNECT_CODE_NAMES, EMPTY_BUNDLE, ENGINE_CONTRACT, ENGINE_METHODS, ENGINE_PROTOCOL_VERSION, ENGINE_STREAM_METHODS, EngineIdentityMismatchError, GROUP_HEADER_HEIGHT, GROUP_PADDING, HOST_ONLY_METHODS, META_ARGUMENTS, Module, NODE_HEADER_HEIGHT, NODE_ROW_HEIGHT, NODE_WIDTH, Reason, Resource, Use, apiFields, boxAt, callText, checkEngineIdentity, collapsedGroupSize, convertDiagnostic, deriveNodeConfig, deriveSettingsConfig, drawnAt, drawnRect, extentOf, frameOf, freeSlot, groupBoxSize, groupFootprint, groupInputPinY, groupPinText, groupPinY, groupPins, groupReach, inputPinY, instanceAddress, joinPath, keepOrder, layoutByDepth, localIn, moduleCallPath, nodeIdForAddress, nodeIdForDiagnostic, nodeRows, nodeSize, originAt, parseModuleKey, projectCanvasView, reachRect, reasonFromJSON, reasonToJSON, resolveInstance, splitAddress, splitPath, stepDown, visibleInputs };
986
+ export type { AddressParts, BlockConfig, BridgeMethod, BridgeRequest, BridgeResponse, CanvasArrangement, CanvasView, Conflict, DeepPartial$1 as DeepPartial, Diagnostic, EngineIdentity, EngineMethod, EngineStreamMethod, HostOnlyMethod, InstanceAddress, InstanceChild, KeepKey, LayoutEdge, LayoutItem, MessageBridge, MetaArgument, NodeConfig, NodePin, ParsedModuleKey, ProjectionMeta, ProtoDiagnosticLike, Rect, RenderEdge, RenderGroup, RenderInput, RenderNode, RenderOutput, ResourceConfig, ScopedInstance, SettingsConfig, Size, ViewportIntent, XY };