@lace-cloud/canvas 0.6.5 → 0.7.1

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 {
@@ -936,6 +999,14 @@ type SnapshotUrls = {
936
999
  layoutsUrl: string;
937
1000
  fetch?: typeof fetch;
938
1001
  meta?: SnapshotMeta;
1002
+ /**
1003
+ * Extra request headers sent with the bundle + layouts GETs. Same-origin
1004
+ * portal fetches carry the session cookie via `credentials: include`, but
1005
+ * the API still resolves org/team scope from `x-org-slug`/`x-team-slug`
1006
+ * headers — the caller must supply them here or the reads 400. Embed routes
1007
+ * authenticate via the token in the URL and omit this.
1008
+ */
1009
+ headers?: Record<string, string>;
939
1010
  };
940
1011
  type SnapshotCanvasEngineInput = SnapshotInProcess | SnapshotUrls;
941
1012
  declare class SnapshotCanvasEngine implements CanvasEngine {
@@ -982,6 +1053,16 @@ declare class SnapshotCanvasEngine implements CanvasEngine {
982
1053
  setEnvironments(_environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
983
1054
  undo(): Promise<ApplyResult>;
984
1055
  redo(): Promise<ApplyResult>;
1056
+ placeModule(_params: {
1057
+ name: string;
1058
+ system: string;
1059
+ version: string;
1060
+ organization?: string;
1061
+ position?: {
1062
+ x: number;
1063
+ y: number;
1064
+ };
1065
+ }): Promise<ApplyResult>;
985
1066
  createGroup(_label: string, _nodeIds: string[]): Promise<ApplyResult>;
986
1067
  updateGroup(_groupId: string, _updates: {
987
1068
  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 {
@@ -936,6 +999,14 @@ type SnapshotUrls = {
936
999
  layoutsUrl: string;
937
1000
  fetch?: typeof fetch;
938
1001
  meta?: SnapshotMeta;
1002
+ /**
1003
+ * Extra request headers sent with the bundle + layouts GETs. Same-origin
1004
+ * portal fetches carry the session cookie via `credentials: include`, but
1005
+ * the API still resolves org/team scope from `x-org-slug`/`x-team-slug`
1006
+ * headers — the caller must supply them here or the reads 400. Embed routes
1007
+ * authenticate via the token in the URL and omit this.
1008
+ */
1009
+ headers?: Record<string, string>;
939
1010
  };
940
1011
  type SnapshotCanvasEngineInput = SnapshotInProcess | SnapshotUrls;
941
1012
  declare class SnapshotCanvasEngine implements CanvasEngine {
@@ -982,6 +1053,16 @@ declare class SnapshotCanvasEngine implements CanvasEngine {
982
1053
  setEnvironments(_environments: Record<string, Record<string, unknown>>): Promise<ApplyResult>;
983
1054
  undo(): Promise<ApplyResult>;
984
1055
  redo(): Promise<ApplyResult>;
1056
+ placeModule(_params: {
1057
+ name: string;
1058
+ system: string;
1059
+ version: string;
1060
+ organization?: string;
1061
+ position?: {
1062
+ x: number;
1063
+ y: number;
1064
+ };
1065
+ }): Promise<ApplyResult>;
985
1066
  createGroup(_label: string, _nodeIds: string[]): Promise<ApplyResult>;
986
1067
  updateGroup(_groupId: string, _updates: {
987
1068
  label?: string;