@lace-cloud/canvas 0.6.5 → 0.7.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
@@ -204,6 +204,21 @@ interface CanvasEngine {
204
204
  setEnvironments(environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
205
205
  undo(): Promise<ApplyResult>;
206
206
  redo(): Promise<ApplyResult>;
207
+ /**
208
+ * Place a module from the registry onto the canvas. The engine fetches
209
+ * the module bundle from the registry, resolves its source, and drops
210
+ * it into the workspace at the given (or auto-computed) position.
211
+ */
212
+ placeModule(params: {
213
+ name: string;
214
+ system: string;
215
+ version: string;
216
+ organization?: string;
217
+ position?: {
218
+ x: number;
219
+ y: number;
220
+ };
221
+ }): Promise<ApplyResult>;
207
222
  createGroup(label: string, nodeIds: string[]): Promise<ApplyResult>;
208
223
  updateGroup(groupId: string, updates: {
209
224
  label?: string;
@@ -272,8 +287,12 @@ type AppProps = {
272
287
  * wire, generate) is hidden or blocked. Defaults to `false`.
273
288
  */
274
289
  readOnly?: boolean;
290
+ /** Base URL of the Lace registry API (e.g. https://lace.cloud). */
291
+ registryBaseUrl?: string;
292
+ /** API token for registry access. */
293
+ apiToken?: string;
275
294
  };
276
- declare function App({ engine, hostBridge, readOnly }: AppProps): react_jsx_runtime.JSX.Element;
295
+ declare function App({ engine, hostBridge, readOnly, registryBaseUrl, apiToken, }: AppProps): react_jsx_runtime.JSX.Element;
277
296
 
278
297
  type Props$9 = {
279
298
  title: string;
@@ -304,10 +323,11 @@ type ActionBarProps = {
304
323
  * button (no live policy session in read-only mode).
305
324
  */
306
325
  onOpenPolicy?: () => void;
326
+ onOpenRegistry?: () => void;
307
327
  showMiniMap: boolean;
308
328
  onToggleMiniMap: () => void;
309
329
  };
310
- declare function ActionBar({ readOnly, isGenerating, onSave, onUndo, onRedo, onClearGraph, onGenerate, onOpenSettings, onOpenPolicy, showMiniMap, onToggleMiniMap, }: ActionBarProps): react_jsx_runtime.JSX.Element;
330
+ declare function ActionBar({ readOnly, isGenerating, onSave, onUndo, onRedo, onClearGraph, onGenerate, onOpenSettings, onOpenPolicy, onOpenRegistry, showMiniMap, onToggleMiniMap, }: ActionBarProps): react_jsx_runtime.JSX.Element;
311
331
 
312
332
  type ContextMenuState = {
313
333
  x: number;
@@ -698,6 +718,16 @@ declare class PostMessageEngine implements CanvasEngine {
698
718
  setEnvironments(environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
699
719
  undo(): Promise<ApplyResult>;
700
720
  redo(): Promise<ApplyResult>;
721
+ placeModule(params: {
722
+ name: string;
723
+ system: string;
724
+ version: string;
725
+ organization?: string;
726
+ position?: {
727
+ x: number;
728
+ y: number;
729
+ };
730
+ }): Promise<ApplyResult>;
701
731
  createGroup(label: string, nodeIds: string[]): Promise<ApplyResult>;
702
732
  updateGroup(groupId: string, updates: {
703
733
  label?: string;
@@ -756,6 +786,8 @@ interface Module {
756
786
  exports: Exports | undefined;
757
787
  terraform: TerraformBlock | undefined;
758
788
  providers: ProviderConfig[];
789
+ /** top-level directives: moved {}, import {} */
790
+ top_level_blocks: Block[];
759
791
  }
760
792
  declare const Module: MessageFns<Module>;
761
793
  interface Interface {
@@ -770,6 +802,9 @@ interface InputDef {
770
802
  description: string;
771
803
  default_value: any | undefined;
772
804
  validation: ValidationBlock | undefined;
805
+ sensitive: boolean;
806
+ /** unset = default (true); explicit false is meaningful */
807
+ nullable?: boolean | undefined;
773
808
  }
774
809
  declare const InputDef: MessageFns<InputDef>;
775
810
  interface ValidationBlock {
@@ -814,8 +849,34 @@ interface Resource {
814
849
  [key: string]: Binding;
815
850
  };
816
851
  depends_on: string[];
852
+ /** nested blocks (ingress, lifecycle, dynamic, …) */
853
+ blocks: Block[];
854
+ /** count meta-argument */
855
+ count: Binding | undefined;
856
+ /** for_each meta-argument */
857
+ for_each: Binding | undefined;
858
+ /** provider meta-argument, e.g. "aws.west" */
859
+ provider_ref: string;
817
860
  }
818
861
  declare const Resource: MessageFns<Resource>;
862
+ /**
863
+ * Block is a recursive nested block (within a resource, or top-level moved/
864
+ * import). Attributes are ordered (declaration order) so regenerated HCL is
865
+ * byte-deterministic.
866
+ */
867
+ interface Block {
868
+ type: string;
869
+ labels: string[];
870
+ attributes: NamedBinding[];
871
+ blocks: Block[];
872
+ }
873
+ declare const Block: MessageFns<Block>;
874
+ /** NamedBinding is an ordered (name, value) attribute within a Block. */
875
+ interface NamedBinding {
876
+ name: string;
877
+ value: Binding | undefined;
878
+ }
879
+ declare const NamedBinding: MessageFns<NamedBinding>;
819
880
  interface Exports {
820
881
  outputs: {
821
882
  [key: string]: OutputExport;
@@ -872,6 +933,8 @@ interface ProviderConfig {
872
933
  config: {
873
934
  [key: string]: any | undefined;
874
935
  };
936
+ /** nested config blocks (default_tags, assume_role, …) */
937
+ blocks: Block[];
875
938
  }
876
939
  declare const ProviderConfig: MessageFns<ProviderConfig>;
877
940
  interface GraphLayout {
@@ -982,6 +1045,16 @@ declare class SnapshotCanvasEngine implements CanvasEngine {
982
1045
  setEnvironments(_environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
983
1046
  undo(): Promise<ApplyResult>;
984
1047
  redo(): Promise<ApplyResult>;
1048
+ placeModule(_params: {
1049
+ name: string;
1050
+ system: string;
1051
+ version: string;
1052
+ organization?: string;
1053
+ position?: {
1054
+ x: number;
1055
+ y: number;
1056
+ };
1057
+ }): Promise<ApplyResult>;
985
1058
  createGroup(_label: string, _nodeIds: string[]): Promise<ApplyResult>;
986
1059
  updateGroup(_groupId: string, _updates: {
987
1060
  label?: string;
package/dist/index.d.ts CHANGED
@@ -204,6 +204,21 @@ interface CanvasEngine {
204
204
  setEnvironments(environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
205
205
  undo(): Promise<ApplyResult>;
206
206
  redo(): Promise<ApplyResult>;
207
+ /**
208
+ * Place a module from the registry onto the canvas. The engine fetches
209
+ * the module bundle from the registry, resolves its source, and drops
210
+ * it into the workspace at the given (or auto-computed) position.
211
+ */
212
+ placeModule(params: {
213
+ name: string;
214
+ system: string;
215
+ version: string;
216
+ organization?: string;
217
+ position?: {
218
+ x: number;
219
+ y: number;
220
+ };
221
+ }): Promise<ApplyResult>;
207
222
  createGroup(label: string, nodeIds: string[]): Promise<ApplyResult>;
208
223
  updateGroup(groupId: string, updates: {
209
224
  label?: string;
@@ -272,8 +287,12 @@ type AppProps = {
272
287
  * wire, generate) is hidden or blocked. Defaults to `false`.
273
288
  */
274
289
  readOnly?: boolean;
290
+ /** Base URL of the Lace registry API (e.g. https://lace.cloud). */
291
+ registryBaseUrl?: string;
292
+ /** API token for registry access. */
293
+ apiToken?: string;
275
294
  };
276
- declare function App({ engine, hostBridge, readOnly }: AppProps): react_jsx_runtime.JSX.Element;
295
+ declare function App({ engine, hostBridge, readOnly, registryBaseUrl, apiToken, }: AppProps): react_jsx_runtime.JSX.Element;
277
296
 
278
297
  type Props$9 = {
279
298
  title: string;
@@ -304,10 +323,11 @@ type ActionBarProps = {
304
323
  * button (no live policy session in read-only mode).
305
324
  */
306
325
  onOpenPolicy?: () => void;
326
+ onOpenRegistry?: () => void;
307
327
  showMiniMap: boolean;
308
328
  onToggleMiniMap: () => void;
309
329
  };
310
- declare function ActionBar({ readOnly, isGenerating, onSave, onUndo, onRedo, onClearGraph, onGenerate, onOpenSettings, onOpenPolicy, showMiniMap, onToggleMiniMap, }: ActionBarProps): react_jsx_runtime.JSX.Element;
330
+ declare function ActionBar({ readOnly, isGenerating, onSave, onUndo, onRedo, onClearGraph, onGenerate, onOpenSettings, onOpenPolicy, onOpenRegistry, showMiniMap, onToggleMiniMap, }: ActionBarProps): react_jsx_runtime.JSX.Element;
311
331
 
312
332
  type ContextMenuState = {
313
333
  x: number;
@@ -698,6 +718,16 @@ declare class PostMessageEngine implements CanvasEngine {
698
718
  setEnvironments(environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
699
719
  undo(): Promise<ApplyResult>;
700
720
  redo(): Promise<ApplyResult>;
721
+ placeModule(params: {
722
+ name: string;
723
+ system: string;
724
+ version: string;
725
+ organization?: string;
726
+ position?: {
727
+ x: number;
728
+ y: number;
729
+ };
730
+ }): Promise<ApplyResult>;
701
731
  createGroup(label: string, nodeIds: string[]): Promise<ApplyResult>;
702
732
  updateGroup(groupId: string, updates: {
703
733
  label?: string;
@@ -756,6 +786,8 @@ interface Module {
756
786
  exports: Exports | undefined;
757
787
  terraform: TerraformBlock | undefined;
758
788
  providers: ProviderConfig[];
789
+ /** top-level directives: moved {}, import {} */
790
+ top_level_blocks: Block[];
759
791
  }
760
792
  declare const Module: MessageFns<Module>;
761
793
  interface Interface {
@@ -770,6 +802,9 @@ interface InputDef {
770
802
  description: string;
771
803
  default_value: any | undefined;
772
804
  validation: ValidationBlock | undefined;
805
+ sensitive: boolean;
806
+ /** unset = default (true); explicit false is meaningful */
807
+ nullable?: boolean | undefined;
773
808
  }
774
809
  declare const InputDef: MessageFns<InputDef>;
775
810
  interface ValidationBlock {
@@ -814,8 +849,34 @@ interface Resource {
814
849
  [key: string]: Binding;
815
850
  };
816
851
  depends_on: string[];
852
+ /** nested blocks (ingress, lifecycle, dynamic, …) */
853
+ blocks: Block[];
854
+ /** count meta-argument */
855
+ count: Binding | undefined;
856
+ /** for_each meta-argument */
857
+ for_each: Binding | undefined;
858
+ /** provider meta-argument, e.g. "aws.west" */
859
+ provider_ref: string;
817
860
  }
818
861
  declare const Resource: MessageFns<Resource>;
862
+ /**
863
+ * Block is a recursive nested block (within a resource, or top-level moved/
864
+ * import). Attributes are ordered (declaration order) so regenerated HCL is
865
+ * byte-deterministic.
866
+ */
867
+ interface Block {
868
+ type: string;
869
+ labels: string[];
870
+ attributes: NamedBinding[];
871
+ blocks: Block[];
872
+ }
873
+ declare const Block: MessageFns<Block>;
874
+ /** NamedBinding is an ordered (name, value) attribute within a Block. */
875
+ interface NamedBinding {
876
+ name: string;
877
+ value: Binding | undefined;
878
+ }
879
+ declare const NamedBinding: MessageFns<NamedBinding>;
819
880
  interface Exports {
820
881
  outputs: {
821
882
  [key: string]: OutputExport;
@@ -872,6 +933,8 @@ interface ProviderConfig {
872
933
  config: {
873
934
  [key: string]: any | undefined;
874
935
  };
936
+ /** nested config blocks (default_tags, assume_role, …) */
937
+ blocks: Block[];
875
938
  }
876
939
  declare const ProviderConfig: MessageFns<ProviderConfig>;
877
940
  interface GraphLayout {
@@ -982,6 +1045,16 @@ declare class SnapshotCanvasEngine implements CanvasEngine {
982
1045
  setEnvironments(_environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
983
1046
  undo(): Promise<ApplyResult>;
984
1047
  redo(): Promise<ApplyResult>;
1048
+ placeModule(_params: {
1049
+ name: string;
1050
+ system: string;
1051
+ version: string;
1052
+ organization?: string;
1053
+ position?: {
1054
+ x: number;
1055
+ y: number;
1056
+ };
1057
+ }): Promise<ApplyResult>;
985
1058
  createGroup(_label: string, _nodeIds: string[]): Promise<ApplyResult>;
986
1059
  updateGroup(_groupId: string, _updates: {
987
1060
  label?: string;