@snaptrude/plugin-client 0.2.6 → 0.2.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @snaptrude/plugin-client
2
2
 
3
+ ## 0.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 445e0b8: Add Present-mode AI Inspiration plugin APIs under `snaptrude.documentation.aiInspiration`.
8
+ - Updated dependencies [445e0b8]
9
+ - @snaptrude/plugin-core@0.2.8
10
+
11
+ ## 0.2.7
12
+
13
+ ### Patch Changes
14
+
15
+ - c5afd9a: added adjacecny
16
+ - Updated dependencies [c5afd9a]
17
+ - @snaptrude/plugin-core@0.2.7
18
+
3
19
  ## 0.2.6
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,24 @@
1
+ import type { PluginAIInspirationCancelJobResult, PluginAIInspirationDeleteRecipeArgs, PluginAIInspirationDeleteRecipeResult, PluginAIInspirationExtractRecipeFromShapeArgs, PluginAIInspirationExtractionResult, PluginAIInspirationGenerateArgs, PluginAIInspirationGetJobResult, PluginAIInspirationGetModelCapabilitiesArgs, PluginAIInspirationGetModelCapabilitiesResult, PluginAIInspirationGetSelectionResult, PluginAIInspirationGetPresetCatalogResult, PluginAIInspirationGetWorkflowForShapeArgs, PluginAIInspirationGetWorkflowForShapeResult, PluginAIInspirationJobArgs, PluginAIInspirationListJobsResult, PluginAIInspirationListModelsResult, PluginAIInspirationListRecipesResult, PluginAIInspirationListSourcesArgs, PluginAIInspirationListSourcesResult, PluginAIInspirationRefineArgs, PluginAIInspirationRerunPlanResult, PluginAIInspirationRerunSelectedBranchArgs, PluginAIInspirationRunRecipeArgs, PluginAIInspirationRunResult, PluginAIInspirationSaveRecipeArgs, PluginAIInspirationSaveRecipeResult } from "@snaptrude/plugin-core";
2
+ import { PluginDocumentationAIInspirationApi } from "@snaptrude/plugin-core";
3
+ export declare class ClientDocumentationAIInspirationApi extends PluginDocumentationAIInspirationApi {
4
+ constructor();
5
+ listModels(): Promise<PluginAIInspirationListModelsResult>;
6
+ getModelCapabilities(args: PluginAIInspirationGetModelCapabilitiesArgs): Promise<PluginAIInspirationGetModelCapabilitiesResult>;
7
+ listSources(args: PluginAIInspirationListSourcesArgs): Promise<PluginAIInspirationListSourcesResult>;
8
+ getSelection(): Promise<PluginAIInspirationGetSelectionResult>;
9
+ getPresetCatalog(): Promise<PluginAIInspirationGetPresetCatalogResult>;
10
+ generate(args: PluginAIInspirationGenerateArgs): Promise<PluginAIInspirationRunResult>;
11
+ refine(args: PluginAIInspirationRefineArgs): Promise<PluginAIInspirationRunResult>;
12
+ getJob(args: PluginAIInspirationJobArgs): Promise<PluginAIInspirationGetJobResult>;
13
+ cancelJob(args: PluginAIInspirationJobArgs): Promise<PluginAIInspirationCancelJobResult>;
14
+ listJobs(): Promise<PluginAIInspirationListJobsResult>;
15
+ getWorkflowForShape(args: PluginAIInspirationGetWorkflowForShapeArgs): Promise<PluginAIInspirationGetWorkflowForShapeResult>;
16
+ getSelectedBranchRerunPlan(args: PluginAIInspirationGetWorkflowForShapeArgs): Promise<PluginAIInspirationRerunPlanResult>;
17
+ rerunSelectedBranch(args: PluginAIInspirationRerunSelectedBranchArgs): Promise<PluginAIInspirationRunResult>;
18
+ extractRecipeFromShape(args: PluginAIInspirationExtractRecipeFromShapeArgs): Promise<PluginAIInspirationExtractionResult>;
19
+ listRecipes(): Promise<PluginAIInspirationListRecipesResult>;
20
+ saveRecipe(args: PluginAIInspirationSaveRecipeArgs): Promise<PluginAIInspirationSaveRecipeResult>;
21
+ deleteRecipe(args: PluginAIInspirationDeleteRecipeArgs): Promise<PluginAIInspirationDeleteRecipeResult>;
22
+ runRecipe(args: PluginAIInspirationRunRecipeArgs): Promise<PluginAIInspirationRunResult>;
23
+ }
24
+ //# sourceMappingURL=aiInspiration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiInspiration.d.ts","sourceRoot":"","sources":["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0CAA0C,GAC/C,OAAO,CAAC,4CAA4C,CAAC;IAQ3C,0BAA0B,CACrC,IAAI,EAAE,0CAA0C,GAC/C,OAAO,CAAC,kCAAkC,CAAC;IAQjC,mBAAmB,CAC9B,IAAI,EAAE,0CAA0C,GAC/C,OAAO,CAAC,4BAA4B,CAAC;IAQ3B,sBAAsB,CACjC,IAAI,EAAE,6CAA6C,GAClD,OAAO,CAAC,mCAAmC,CAAC;IAQlC,WAAW,IAAI,OAAO,CAAC,oCAAoC,CAAC;IAK5D,UAAU,CACrB,IAAI,EAAE,iCAAiC,GACtC,OAAO,CAAC,mCAAmC,CAAC;IAQlC,YAAY,CACvB,IAAI,EAAE,mCAAmC,GACxC,OAAO,CAAC,qCAAqC,CAAC;IAQpC,SAAS,CACpB,IAAI,EAAE,gCAAgC,GACrC,OAAO,CAAC,4BAA4B,CAAC;CAOzC"}
@@ -0,0 +1,8 @@
1
+ import { PluginDocumentationApi } from "@snaptrude/plugin-core";
2
+ import { ClientDocumentationAIInspirationApi } from "./aiInspiration";
3
+ export declare class ClientDocumentationApi extends PluginDocumentationApi {
4
+ aiInspiration: ClientDocumentationAIInspirationApi;
5
+ constructor();
6
+ }
7
+ export * from "./aiInspiration";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/documentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAA;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACzD,aAAa,EAAE,mCAAmC,CAAA;;CAM1D;AAED,cAAc,iBAAiB,CAAA"}
@@ -2,6 +2,7 @@ import { ClientCoreApi } from "./core";
2
2
  import { ClientEntityApi } from "./entity";
3
3
  import { ClientToolsApi } from "./tools";
4
4
  import { ClientUnitsApi } from "./units";
5
+ import { ClientDocumentationApi } from "./documentation";
5
6
  import { PluginApi } from "@snaptrude/plugin-core";
6
7
  export declare class ClientPluginApi extends PluginApi {
7
8
  private static instance;
@@ -9,10 +10,12 @@ export declare class ClientPluginApi extends PluginApi {
9
10
  tools: ClientToolsApi;
10
11
  entity: ClientEntityApi;
11
12
  units: ClientUnitsApi;
13
+ documentation: ClientDocumentationApi;
12
14
  private constructor();
13
15
  static getInstance(): ClientPluginApi;
14
16
  }
15
17
  export * from "./core";
18
+ export * from "./documentation";
16
19
  export * from "./entity";
17
20
  export * from "./tools";
18
21
  export * from "./units";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IAEjC,IAAI,EAAE,aAAa,CAAA;IACnB,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;IAE5B,OAAO;IAQP,MAAM,CAAC,WAAW,IAAI,eAAe;CAMtC;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IAEjC,IAAI,EAAE,aAAa,CAAA;IACnB,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;IACrB,aAAa,EAAE,sBAAsB,CAAA;IAE5C,OAAO;IASP,MAAM,CAAC,WAAW,IAAI,eAAe;CAMtC;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
package/dist/index.cjs CHANGED
@@ -35,6 +35,8 @@ __export(index_exports, {
35
35
  ClientCoreApi: () => ClientCoreApi,
36
36
  ClientCurveApi: () => ClientCurveApi,
37
37
  ClientDepartmentApi: () => ClientDepartmentApi,
38
+ ClientDocumentationAIInspirationApi: () => ClientDocumentationAIInspirationApi,
39
+ ClientDocumentationApi: () => ClientDocumentationApi,
38
40
  ClientEntityApi: () => ClientEntityApi,
39
41
  ClientGeomApi: () => ClientGeomApi,
40
42
  ClientLineApi: () => ClientLineApi,
@@ -565,15 +567,148 @@ var ClientUnitsApi = class extends import_plugin_core19.PluginUnitsApi {
565
567
  }
566
568
  };
567
569
 
568
- // src/api/index.ts
570
+ // src/api/documentation/index.ts
571
+ var import_plugin_core21 = require("@snaptrude/plugin-core");
572
+
573
+ // src/api/documentation/aiInspiration.ts
569
574
  var import_plugin_core20 = require("@snaptrude/plugin-core");
570
- var ClientPluginApi = class _ClientPluginApi extends import_plugin_core20.PluginApi {
575
+ var ClientDocumentationAIInspirationApi = class extends import_plugin_core20.PluginDocumentationAIInspirationApi {
576
+ constructor() {
577
+ super();
578
+ }
579
+ async listModels() {
580
+ const hostApi = getHostApi();
581
+ return hostApi.call({ method: "documentation.aiInspiration.listModels" });
582
+ }
583
+ async getModelCapabilities(args) {
584
+ const hostApi = getHostApi();
585
+ return hostApi.call({
586
+ method: "documentation.aiInspiration.getModelCapabilities",
587
+ args
588
+ });
589
+ }
590
+ async listSources(args) {
591
+ const hostApi = getHostApi();
592
+ return hostApi.call({
593
+ method: "documentation.aiInspiration.listSources",
594
+ args
595
+ });
596
+ }
597
+ async getSelection() {
598
+ const hostApi = getHostApi();
599
+ return hostApi.call({ method: "documentation.aiInspiration.getSelection" });
600
+ }
601
+ async getPresetCatalog() {
602
+ const hostApi = getHostApi();
603
+ return hostApi.call({
604
+ method: "documentation.aiInspiration.getPresetCatalog"
605
+ });
606
+ }
607
+ async generate(args) {
608
+ const hostApi = getHostApi();
609
+ return hostApi.call({
610
+ method: "documentation.aiInspiration.generate",
611
+ args
612
+ });
613
+ }
614
+ async refine(args) {
615
+ const hostApi = getHostApi();
616
+ return hostApi.call({
617
+ method: "documentation.aiInspiration.refine",
618
+ args
619
+ });
620
+ }
621
+ async getJob(args) {
622
+ const hostApi = getHostApi();
623
+ return hostApi.call({
624
+ method: "documentation.aiInspiration.getJob",
625
+ args
626
+ });
627
+ }
628
+ async cancelJob(args) {
629
+ const hostApi = getHostApi();
630
+ return hostApi.call({
631
+ method: "documentation.aiInspiration.cancelJob",
632
+ args
633
+ });
634
+ }
635
+ async listJobs() {
636
+ const hostApi = getHostApi();
637
+ return hostApi.call({ method: "documentation.aiInspiration.listJobs" });
638
+ }
639
+ async getWorkflowForShape(args) {
640
+ const hostApi = getHostApi();
641
+ return hostApi.call({
642
+ method: "documentation.aiInspiration.getWorkflowForShape",
643
+ args
644
+ });
645
+ }
646
+ async getSelectedBranchRerunPlan(args) {
647
+ const hostApi = getHostApi();
648
+ return hostApi.call({
649
+ method: "documentation.aiInspiration.getSelectedBranchRerunPlan",
650
+ args
651
+ });
652
+ }
653
+ async rerunSelectedBranch(args) {
654
+ const hostApi = getHostApi();
655
+ return hostApi.call({
656
+ method: "documentation.aiInspiration.rerunSelectedBranch",
657
+ args
658
+ });
659
+ }
660
+ async extractRecipeFromShape(args) {
661
+ const hostApi = getHostApi();
662
+ return hostApi.call({
663
+ method: "documentation.aiInspiration.extractRecipeFromShape",
664
+ args
665
+ });
666
+ }
667
+ async listRecipes() {
668
+ const hostApi = getHostApi();
669
+ return hostApi.call({ method: "documentation.aiInspiration.listRecipes" });
670
+ }
671
+ async saveRecipe(args) {
672
+ const hostApi = getHostApi();
673
+ return hostApi.call({
674
+ method: "documentation.aiInspiration.saveRecipe",
675
+ args
676
+ });
677
+ }
678
+ async deleteRecipe(args) {
679
+ const hostApi = getHostApi();
680
+ return hostApi.call({
681
+ method: "documentation.aiInspiration.deleteRecipe",
682
+ args
683
+ });
684
+ }
685
+ async runRecipe(args) {
686
+ const hostApi = getHostApi();
687
+ return hostApi.call({
688
+ method: "documentation.aiInspiration.runRecipe",
689
+ args
690
+ });
691
+ }
692
+ };
693
+
694
+ // src/api/documentation/index.ts
695
+ var ClientDocumentationApi = class extends import_plugin_core21.PluginDocumentationApi {
696
+ constructor() {
697
+ super();
698
+ this.aiInspiration = new ClientDocumentationAIInspirationApi();
699
+ }
700
+ };
701
+
702
+ // src/api/index.ts
703
+ var import_plugin_core22 = require("@snaptrude/plugin-core");
704
+ var ClientPluginApi = class _ClientPluginApi extends import_plugin_core22.PluginApi {
571
705
  constructor() {
572
706
  super();
573
707
  this.core = new ClientCoreApi();
574
708
  this.tools = new ClientToolsApi();
575
709
  this.entity = new ClientEntityApi();
576
710
  this.units = new ClientUnitsApi();
711
+ this.documentation = new ClientDocumentationApi();
577
712
  }
578
713
  static getInstance() {
579
714
  if (!_ClientPluginApi.instance) {
@@ -650,6 +785,8 @@ var snaptrude = ClientPluginApi.getInstance();
650
785
  ClientCoreApi,
651
786
  ClientCurveApi,
652
787
  ClientDepartmentApi,
788
+ ClientDocumentationAIInspirationApi,
789
+ ClientDocumentationApi,
653
790
  ClientEntityApi,
654
791
  ClientGeomApi,
655
792
  ClientLineApi,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/buildableEnvelope.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/copy.ts","../src/api/tools/offset.ts","../src/api/units/index.ts","../src/api/index.ts","../src/plugin-worker.ts"],"sourcesContent":["import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n","import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n public buildableEnvelope: ClientBuildableEnvelopeApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n this.buildableEnvelope = new ClientBuildableEnvelopeApi()\n }\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginBuildableEnvelopeCreateArgs,\n PluginBuildableEnvelopeCreateResult,\n PluginBuildableEnvelopeUpdateArgs,\n PluginBuildableEnvelopeUpdateResult,\n PluginBuildableEnvelopeApi,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientBuildableEnvelopeApi extends PluginBuildableEnvelopeApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginBuildableEnvelopeCreateArgs\n ): Promise<PluginBuildableEnvelopeCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.create\",\n args,\n })\n }\n\n public async update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): Promise<PluginBuildableEnvelopeUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.update\",\n args,\n })\n }\n}\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateGeometryFromProfileArgs,\n PluginSpaceUpdateGeometryFromProfileResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n PluginSpaceBulkCreateArgs,\n PluginSpaceBulkCreateResult,\n PluginSpaceBulkUpdateArgs,\n PluginSpaceBulkUpdateResult,\n PluginSpaceBulkDeleteArgs,\n PluginSpaceBulkDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): Promise<PluginSpaceUpdateGeometryFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.updateGeometryFromProfile\",\n args: {\n spaceId,\n profile,\n extrudeHeight,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async bulkCreate({\n items,\n }: PluginSpaceBulkCreateArgs): Promise<PluginSpaceBulkCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkCreate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkUpdate({\n items,\n }: PluginSpaceBulkUpdateArgs): Promise<PluginSpaceBulkUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkUpdate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkDelete({\n spaceIds,\n }: PluginSpaceBulkDeleteArgs): Promise<PluginSpaceBulkDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkDelete\",\n args: {\n spaceIds,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport type {\n PluginCopyArgs,\n PluginCopyResult,\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\nimport { copy } from \"./copy\"\nimport { offset } from \"./offset\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n\n public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n return copy(args)\n }\n\n public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {\n return offset(args)\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import type { PluginCopyArgs, PluginCopyResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.copy\",\n args,\n })\n}\n","import type {\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function offset(\n args: PluginOffsetArgs,\n): Promise<PluginOffsetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.offset\",\n args,\n })\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,sBAA8B;;;ACA9B,IAAAC,sBAA8B;;;ACA9B,yBAA8B;AAEvB,IAAM,gBAAN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;AACZ,SAAK,UAAkB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEU,SAAS,QAAgB,SAAwB;AACzD;AAAC,IAAC,KAAK,QAAgC,GAAG,SAAS,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,WAAiB;AACzB;AAAC,IAAC,KAAK,QAAgC,UAAU,SAAS;AAAA,EAC5D;AAAA,EAEA,MAAM,OAAsB;AAC1B,YAAQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;AxBvFO,IAAM,YAAY,gBAAgB,YAAY;","names":["import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","Comlink"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/buildableEnvelope.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/copy.ts","../src/api/tools/offset.ts","../src/api/units/index.ts","../src/api/documentation/index.ts","../src/api/documentation/aiInspiration.ts","../src/api/index.ts","../src/plugin-worker.ts"],"sourcesContent":["import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n","import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n public buildableEnvelope: ClientBuildableEnvelopeApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n this.buildableEnvelope = new ClientBuildableEnvelopeApi()\n }\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginBuildableEnvelopeCreateArgs,\n PluginBuildableEnvelopeCreateResult,\n PluginBuildableEnvelopeUpdateArgs,\n PluginBuildableEnvelopeUpdateResult,\n PluginBuildableEnvelopeApi,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientBuildableEnvelopeApi extends PluginBuildableEnvelopeApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginBuildableEnvelopeCreateArgs\n ): Promise<PluginBuildableEnvelopeCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.create\",\n args,\n })\n }\n\n public async update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): Promise<PluginBuildableEnvelopeUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.update\",\n args,\n })\n }\n}\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateGeometryFromProfileArgs,\n PluginSpaceUpdateGeometryFromProfileResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n PluginSpaceBulkCreateArgs,\n PluginSpaceBulkCreateResult,\n PluginSpaceBulkUpdateArgs,\n PluginSpaceBulkUpdateResult,\n PluginSpaceBulkDeleteArgs,\n PluginSpaceBulkDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): Promise<PluginSpaceUpdateGeometryFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.updateGeometryFromProfile\",\n args: {\n spaceId,\n profile,\n extrudeHeight,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async bulkCreate({\n items,\n }: PluginSpaceBulkCreateArgs): Promise<PluginSpaceBulkCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkCreate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkUpdate({\n items,\n }: PluginSpaceBulkUpdateArgs): Promise<PluginSpaceBulkUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkUpdate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkDelete({\n spaceIds,\n }: PluginSpaceBulkDeleteArgs): Promise<PluginSpaceBulkDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkDelete\",\n args: {\n spaceIds,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport type {\n PluginCopyArgs,\n PluginCopyResult,\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\nimport { copy } from \"./copy\"\nimport { offset } from \"./offset\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n\n public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n return copy(args)\n }\n\n public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {\n return offset(args)\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import type { PluginCopyArgs, PluginCopyResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.copy\",\n args,\n })\n}\n","import type {\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function offset(\n args: PluginOffsetArgs,\n): Promise<PluginOffsetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.offset\",\n args,\n })\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { PluginDocumentationApi } from \"@snaptrude/plugin-core\"\nimport { ClientDocumentationAIInspirationApi } from \"./aiInspiration\"\n\nexport class ClientDocumentationApi extends PluginDocumentationApi {\n public aiInspiration: ClientDocumentationAIInspirationApi\n\n constructor() {\n super()\n this.aiInspiration = new ClientDocumentationAIInspirationApi()\n }\n}\n\nexport * from \"./aiInspiration\"\n","import type {\n PluginAIInspirationCancelJobResult,\n PluginAIInspirationDeleteRecipeArgs,\n PluginAIInspirationDeleteRecipeResult,\n PluginAIInspirationExtractRecipeFromShapeArgs,\n PluginAIInspirationExtractionResult,\n PluginAIInspirationGenerateArgs,\n PluginAIInspirationGetJobResult,\n PluginAIInspirationGetModelCapabilitiesArgs,\n PluginAIInspirationGetModelCapabilitiesResult,\n PluginAIInspirationGetSelectionResult,\n PluginAIInspirationGetPresetCatalogResult,\n PluginAIInspirationGetWorkflowForShapeArgs,\n PluginAIInspirationGetWorkflowForShapeResult,\n PluginAIInspirationJobArgs,\n PluginAIInspirationListJobsResult,\n PluginAIInspirationListModelsResult,\n PluginAIInspirationListRecipesResult,\n PluginAIInspirationListSourcesArgs,\n PluginAIInspirationListSourcesResult,\n PluginAIInspirationRefineArgs,\n PluginAIInspirationRerunPlanResult,\n PluginAIInspirationRerunSelectedBranchArgs,\n PluginAIInspirationRunRecipeArgs,\n PluginAIInspirationRunResult,\n PluginAIInspirationSaveRecipeArgs,\n PluginAIInspirationSaveRecipeResult,\n} from \"@snaptrude/plugin-core\"\nimport { PluginDocumentationAIInspirationApi } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDocumentationAIInspirationApi extends PluginDocumentationAIInspirationApi {\n constructor() {\n super()\n }\n\n public async listModels(): Promise<PluginAIInspirationListModelsResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listModels\" })\n }\n\n public async getModelCapabilities(\n args: PluginAIInspirationGetModelCapabilitiesArgs,\n ): Promise<PluginAIInspirationGetModelCapabilitiesResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getModelCapabilities\",\n args,\n })\n }\n\n public async listSources(\n args: PluginAIInspirationListSourcesArgs,\n ): Promise<PluginAIInspirationListSourcesResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.listSources\",\n args,\n })\n }\n\n public async getSelection(): Promise<PluginAIInspirationGetSelectionResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.getSelection\" })\n }\n\n public async getPresetCatalog(): Promise<PluginAIInspirationGetPresetCatalogResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getPresetCatalog\",\n })\n }\n\n public async generate(\n args: PluginAIInspirationGenerateArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.generate\",\n args,\n })\n }\n\n public async refine(\n args: PluginAIInspirationRefineArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.refine\",\n args,\n })\n }\n\n public async getJob(\n args: PluginAIInspirationJobArgs,\n ): Promise<PluginAIInspirationGetJobResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getJob\",\n args,\n })\n }\n\n public async cancelJob(\n args: PluginAIInspirationJobArgs,\n ): Promise<PluginAIInspirationCancelJobResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.cancelJob\",\n args,\n })\n }\n\n public async listJobs(): Promise<PluginAIInspirationListJobsResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listJobs\" })\n }\n\n public async getWorkflowForShape(\n args: PluginAIInspirationGetWorkflowForShapeArgs,\n ): Promise<PluginAIInspirationGetWorkflowForShapeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getWorkflowForShape\",\n args,\n })\n }\n\n public async getSelectedBranchRerunPlan(\n args: PluginAIInspirationGetWorkflowForShapeArgs,\n ): Promise<PluginAIInspirationRerunPlanResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getSelectedBranchRerunPlan\",\n args,\n })\n }\n\n public async rerunSelectedBranch(\n args: PluginAIInspirationRerunSelectedBranchArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.rerunSelectedBranch\",\n args,\n })\n }\n\n public async extractRecipeFromShape(\n args: PluginAIInspirationExtractRecipeFromShapeArgs,\n ): Promise<PluginAIInspirationExtractionResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.extractRecipeFromShape\",\n args,\n })\n }\n\n public async listRecipes(): Promise<PluginAIInspirationListRecipesResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listRecipes\" })\n }\n\n public async saveRecipe(\n args: PluginAIInspirationSaveRecipeArgs,\n ): Promise<PluginAIInspirationSaveRecipeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.saveRecipe\",\n args,\n })\n }\n\n public async deleteRecipe(\n args: PluginAIInspirationDeleteRecipeArgs,\n ): Promise<PluginAIInspirationDeleteRecipeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.deleteRecipe\",\n args,\n })\n }\n\n public async runRecipe(\n args: PluginAIInspirationRunRecipeArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.runRecipe\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { ClientDocumentationApi } from \"./documentation\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n public documentation: ClientDocumentationApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n this.documentation = new ClientDocumentationApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./documentation\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,sBAA8B;;;ACA9B,IAAAC,sBAA8B;;;ACA9B,yBAA8B;AAEvB,IAAM,gBAAN,cAA4B,iCAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,IAAAC,sBAA8B;AAEvB,IAAM,gBAAN,cAA4B,kCAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;AFFO,IAAM,gBAAN,cAA4B,kCAAc;AAAA,EAI/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Ac;AACZ,SAAK,UAAkB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEU,SAAS,QAAgB,SAAwB;AACzD;AAAC,IAAC,KAAK,QAAgC,GAAG,SAAS,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,WAAiB;AACzB;AAAC,IAAC,KAAK,QAAgC,UAAU,SAAS;AAAA,EAC5D;AAAA,EAEA,MAAM,OAAsB;AAC1B,YAAQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;A1BvFO,IAAM,YAAY,gBAAgB,YAAY;","names":["import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","import_plugin_core","Comlink"]}
package/dist/index.js CHANGED
@@ -520,6 +520,138 @@ var ClientUnitsApi = class extends PluginUnitsApi {
520
520
  }
521
521
  };
522
522
 
523
+ // src/api/documentation/index.ts
524
+ import { PluginDocumentationApi } from "@snaptrude/plugin-core";
525
+
526
+ // src/api/documentation/aiInspiration.ts
527
+ import { PluginDocumentationAIInspirationApi } from "@snaptrude/plugin-core";
528
+ var ClientDocumentationAIInspirationApi = class extends PluginDocumentationAIInspirationApi {
529
+ constructor() {
530
+ super();
531
+ }
532
+ async listModels() {
533
+ const hostApi = getHostApi();
534
+ return hostApi.call({ method: "documentation.aiInspiration.listModels" });
535
+ }
536
+ async getModelCapabilities(args) {
537
+ const hostApi = getHostApi();
538
+ return hostApi.call({
539
+ method: "documentation.aiInspiration.getModelCapabilities",
540
+ args
541
+ });
542
+ }
543
+ async listSources(args) {
544
+ const hostApi = getHostApi();
545
+ return hostApi.call({
546
+ method: "documentation.aiInspiration.listSources",
547
+ args
548
+ });
549
+ }
550
+ async getSelection() {
551
+ const hostApi = getHostApi();
552
+ return hostApi.call({ method: "documentation.aiInspiration.getSelection" });
553
+ }
554
+ async getPresetCatalog() {
555
+ const hostApi = getHostApi();
556
+ return hostApi.call({
557
+ method: "documentation.aiInspiration.getPresetCatalog"
558
+ });
559
+ }
560
+ async generate(args) {
561
+ const hostApi = getHostApi();
562
+ return hostApi.call({
563
+ method: "documentation.aiInspiration.generate",
564
+ args
565
+ });
566
+ }
567
+ async refine(args) {
568
+ const hostApi = getHostApi();
569
+ return hostApi.call({
570
+ method: "documentation.aiInspiration.refine",
571
+ args
572
+ });
573
+ }
574
+ async getJob(args) {
575
+ const hostApi = getHostApi();
576
+ return hostApi.call({
577
+ method: "documentation.aiInspiration.getJob",
578
+ args
579
+ });
580
+ }
581
+ async cancelJob(args) {
582
+ const hostApi = getHostApi();
583
+ return hostApi.call({
584
+ method: "documentation.aiInspiration.cancelJob",
585
+ args
586
+ });
587
+ }
588
+ async listJobs() {
589
+ const hostApi = getHostApi();
590
+ return hostApi.call({ method: "documentation.aiInspiration.listJobs" });
591
+ }
592
+ async getWorkflowForShape(args) {
593
+ const hostApi = getHostApi();
594
+ return hostApi.call({
595
+ method: "documentation.aiInspiration.getWorkflowForShape",
596
+ args
597
+ });
598
+ }
599
+ async getSelectedBranchRerunPlan(args) {
600
+ const hostApi = getHostApi();
601
+ return hostApi.call({
602
+ method: "documentation.aiInspiration.getSelectedBranchRerunPlan",
603
+ args
604
+ });
605
+ }
606
+ async rerunSelectedBranch(args) {
607
+ const hostApi = getHostApi();
608
+ return hostApi.call({
609
+ method: "documentation.aiInspiration.rerunSelectedBranch",
610
+ args
611
+ });
612
+ }
613
+ async extractRecipeFromShape(args) {
614
+ const hostApi = getHostApi();
615
+ return hostApi.call({
616
+ method: "documentation.aiInspiration.extractRecipeFromShape",
617
+ args
618
+ });
619
+ }
620
+ async listRecipes() {
621
+ const hostApi = getHostApi();
622
+ return hostApi.call({ method: "documentation.aiInspiration.listRecipes" });
623
+ }
624
+ async saveRecipe(args) {
625
+ const hostApi = getHostApi();
626
+ return hostApi.call({
627
+ method: "documentation.aiInspiration.saveRecipe",
628
+ args
629
+ });
630
+ }
631
+ async deleteRecipe(args) {
632
+ const hostApi = getHostApi();
633
+ return hostApi.call({
634
+ method: "documentation.aiInspiration.deleteRecipe",
635
+ args
636
+ });
637
+ }
638
+ async runRecipe(args) {
639
+ const hostApi = getHostApi();
640
+ return hostApi.call({
641
+ method: "documentation.aiInspiration.runRecipe",
642
+ args
643
+ });
644
+ }
645
+ };
646
+
647
+ // src/api/documentation/index.ts
648
+ var ClientDocumentationApi = class extends PluginDocumentationApi {
649
+ constructor() {
650
+ super();
651
+ this.aiInspiration = new ClientDocumentationAIInspirationApi();
652
+ }
653
+ };
654
+
523
655
  // src/api/index.ts
524
656
  import { PluginApi } from "@snaptrude/plugin-core";
525
657
  var ClientPluginApi = class _ClientPluginApi extends PluginApi {
@@ -529,6 +661,7 @@ var ClientPluginApi = class _ClientPluginApi extends PluginApi {
529
661
  this.tools = new ClientToolsApi();
530
662
  this.entity = new ClientEntityApi();
531
663
  this.units = new ClientUnitsApi();
664
+ this.documentation = new ClientDocumentationApi();
532
665
  }
533
666
  static getInstance() {
534
667
  if (!_ClientPluginApi.instance) {
@@ -604,6 +737,8 @@ export {
604
737
  ClientCoreApi,
605
738
  ClientCurveApi,
606
739
  ClientDepartmentApi,
740
+ ClientDocumentationAIInspirationApi,
741
+ ClientDocumentationApi,
607
742
  ClientEntityApi,
608
743
  ClientGeomApi,
609
744
  ClientLineApi,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/buildableEnvelope.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/copy.ts","../src/api/tools/offset.ts","../src/api/units/index.ts","../src/api/index.ts","../src/plugin-worker.ts","../src/index.ts"],"sourcesContent":["import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n public buildableEnvelope: ClientBuildableEnvelopeApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n this.buildableEnvelope = new ClientBuildableEnvelopeApi()\n }\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginBuildableEnvelopeCreateArgs,\n PluginBuildableEnvelopeCreateResult,\n PluginBuildableEnvelopeUpdateArgs,\n PluginBuildableEnvelopeUpdateResult,\n PluginBuildableEnvelopeApi,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientBuildableEnvelopeApi extends PluginBuildableEnvelopeApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginBuildableEnvelopeCreateArgs\n ): Promise<PluginBuildableEnvelopeCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.create\",\n args,\n })\n }\n\n public async update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): Promise<PluginBuildableEnvelopeUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.update\",\n args,\n })\n }\n}\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateGeometryFromProfileArgs,\n PluginSpaceUpdateGeometryFromProfileResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n PluginSpaceBulkCreateArgs,\n PluginSpaceBulkCreateResult,\n PluginSpaceBulkUpdateArgs,\n PluginSpaceBulkUpdateResult,\n PluginSpaceBulkDeleteArgs,\n PluginSpaceBulkDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): Promise<PluginSpaceUpdateGeometryFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.updateGeometryFromProfile\",\n args: {\n spaceId,\n profile,\n extrudeHeight,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async bulkCreate({\n items,\n }: PluginSpaceBulkCreateArgs): Promise<PluginSpaceBulkCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkCreate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkUpdate({\n items,\n }: PluginSpaceBulkUpdateArgs): Promise<PluginSpaceBulkUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkUpdate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkDelete({\n spaceIds,\n }: PluginSpaceBulkDeleteArgs): Promise<PluginSpaceBulkDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkDelete\",\n args: {\n spaceIds,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport type {\n PluginCopyArgs,\n PluginCopyResult,\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\nimport { copy } from \"./copy\"\nimport { offset } from \"./offset\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n\n public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n return copy(args)\n }\n\n public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {\n return offset(args)\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import type { PluginCopyArgs, PluginCopyResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.copy\",\n args,\n })\n}\n","import type {\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function offset(\n args: PluginOffsetArgs,\n): Promise<PluginOffsetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.offset\",\n args,\n })\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n","import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n"],"mappings":";AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;AAEv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,cAAa;AAmClB,IAAe,eAAf,MAA4B;AAAA,EAIjC,cAAc;AACZ,SAAK,UAAkB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEU,SAAS,QAAgB,SAAwB;AACzD;AAAC,IAAC,KAAK,QAAgC,GAAG,SAAS,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,WAAiB;AACzB;AAAC,IAAC,KAAK,QAAgC,UAAU,SAAS;AAAA,EAC5D;AAAA,EAEA,MAAM,OAAsB;AAC1B,YAAQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;ACvFO,IAAM,YAAY,gBAAgB,YAAY;","names":["Comlink"]}
1
+ {"version":3,"sources":["../src/api/core/index.ts","../src/api/core/math/index.ts","../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/geom/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/host-api.ts","../src/api/entity/index.ts","../src/api/entity/buildableEnvelope.ts","../src/api/entity/department.ts","../src/api/entity/referenceLine.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/tools/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/copy.ts","../src/api/tools/offset.ts","../src/api/units/index.ts","../src/api/documentation/index.ts","../src/api/documentation/aiInspiration.ts","../src/api/index.ts","../src/plugin-worker.ts","../src/index.ts"],"sourcesContent":["import { PluginCoreApi } from \"@snaptrude/plugin-core\"\nimport { ClientMathApi } from \"./math\"\nimport { ClientGeomApi } from \"./geom\"\n\nexport class ClientCoreApi extends PluginCoreApi {\n public math: ClientMathApi\n public geom: ClientGeomApi\n\n constructor() {\n super()\n this.math = new ClientMathApi()\n this.geom = new ClientGeomApi()\n }\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import { PluginMathApi } from \"@snaptrude/plugin-core\"\nimport { ClientVec3Api } from \"./vec3\"\nimport { ClientQuatApi } from \"./quat\"\n\nexport class ClientMathApi extends PluginMathApi {\n public vec3: ClientVec3Api\n public quat: ClientQuatApi\n\n constructor() {\n super()\n this.vec3 = new ClientVec3Api()\n this.quat = new ClientQuatApi()\n }\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import { PluginVec3Api } from \"@snaptrude/plugin-core\"\n\nexport class ClientVec3Api extends PluginVec3Api {\n constructor() {\n super()\n }\n}\n","import { PluginQuatApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientQuatApi extends PluginQuatApi {\n constructor() {\n super()\n }\n}\n","import { PluginGeomApi } from \"@snaptrude/plugin-core\"\nimport { ClientLineApi } from \"./line\"\nimport { ClientArcApi } from \"./arc\"\nimport { ClientCurveApi } from \"./curve\"\nimport { ClientProfileApi } from \"./profile\"\n\nexport class ClientGeomApi extends PluginGeomApi {\n public line: ClientLineApi\n public arc: ClientArcApi\n public curve: ClientCurveApi\n public profile: ClientProfileApi\n\n constructor() {\n super()\n this.line = new ClientLineApi()\n this.arc = new ClientArcApi()\n this.curve = new ClientCurveApi()\n this.profile = new ClientProfileApi()\n }\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginLineApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientLineApi extends PluginLineApi {\n constructor() {\n super()\n }\n}\n","import { PluginArcApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientArcApi extends PluginArcApi {\n constructor() {\n super()\n }\n}\n","import { PluginCurveApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientCurveApi extends PluginCurveApi {\n constructor() {\n super()\n }\n}\n","import { PluginProfileApi } from \"@snaptrude/plugin-core\"\nimport type { PProfile, PluginProfileFromLinePointsArgs } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../../host-api\"\n\nexport class ClientProfileApi extends PluginProfileApi {\n constructor() {\n super()\n }\n\n public async fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"core.geom.profile.fromLinePoints\",\n args,\n })\n }\n}\n","import * as Comlink from \"comlink\"\nimport type {\n PluginApiMethod,\n PluginApiCallPayload,\n PluginApiCallWrappedResult,\n PluginApiCallResult,\n} from \"@snaptrude/plugin-core\"\n\nexport interface HostApi {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallWrappedResult<M>>\n}\n\nexport interface HostApiWrapped {\n call<M extends PluginApiMethod>(\n payload: PluginApiCallPayload<M>\n ): Promise<PluginApiCallResult<M>>\n}\n\nexport function createHostApi(endpoint?: Comlink.Endpoint): HostApi {\n return Comlink.wrap<HostApi>(\n endpoint ?? (globalThis as unknown as Comlink.Endpoint)\n ) as unknown as HostApi\n}\n\nlet _instance: HostApi | null = null\n\nexport function getHostApi(): HostApiWrapped {\n if (!_instance) {\n _instance = createHostApi()\n }\n return {\n call: async <M extends PluginApiMethod>(payload: PluginApiCallPayload<M>): Promise<PluginApiCallResult<M>> => {\n if (!_instance) {\n throw new Error(\"Host API not initialized\")\n }\n return _instance.call(payload).then(result => {\n if (result.success) {\n return result.data\n } else {\n throw new Error(result.error)\n }\n })\n }\n }\n}\n","import { PluginEntityApi } from \"@snaptrude/plugin-core\"\nimport { ClientBuildableEnvelopeApi } from \"./buildableEnvelope\"\nimport { ClientDepartmentApi } from \"./department\"\nimport { ClientReferenceLineApi } from \"./referenceLine\"\nimport { ClientSpaceApi } from \"./space\"\nimport { ClientStoryApi } from \"./story\"\n\nexport class ClientEntityApi extends PluginEntityApi {\n public space: ClientSpaceApi\n public story: ClientStoryApi\n public referenceLine: ClientReferenceLineApi\n public department: ClientDepartmentApi\n public buildableEnvelope: ClientBuildableEnvelopeApi\n\n constructor() {\n super()\n this.space = new ClientSpaceApi()\n this.story = new ClientStoryApi()\n this.referenceLine = new ClientReferenceLineApi()\n this.department = new ClientDepartmentApi()\n this.buildableEnvelope = new ClientBuildableEnvelopeApi()\n }\n}\n\nexport * from \"./buildableEnvelope\"\nexport * from \"./department\"\nexport * from \"./referenceLine\"\nexport * from \"./space\"\nexport * from \"./story\"\n","import {\n PluginBuildableEnvelopeCreateArgs,\n PluginBuildableEnvelopeCreateResult,\n PluginBuildableEnvelopeUpdateArgs,\n PluginBuildableEnvelopeUpdateResult,\n PluginBuildableEnvelopeApi,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientBuildableEnvelopeApi extends PluginBuildableEnvelopeApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginBuildableEnvelopeCreateArgs\n ): Promise<PluginBuildableEnvelopeCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.create\",\n args,\n })\n }\n\n public async update(\n args: PluginBuildableEnvelopeUpdateArgs\n ): Promise<PluginBuildableEnvelopeUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.buildableEnvelope.update\",\n args,\n })\n }\n}\n","import {\n PluginDepartmentApi,\n PluginDepartmentCreateArgs,\n PluginDepartmentCreateResult,\n PluginDepartmentGetAllResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDepartmentApi extends PluginDepartmentApi {\n constructor() {\n super()\n }\n\n public async create(\n args: PluginDepartmentCreateArgs\n ): Promise<PluginDepartmentCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.create\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginDepartmentGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.department.getAll\",\n })\n }\n}\n","import {\n PluginReferenceLineApi,\n PluginReferenceLineCreateMultiArgs,\n PluginReferenceLineCreateMultiResult,\n PluginReferenceLineGetArgs,\n PluginReferenceLineGetResult,\n PluginReferenceLineGetAllResult,\n PluginReferenceLineDeleteArgs,\n PluginReferenceLineDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientReferenceLineApi extends PluginReferenceLineApi {\n constructor() {\n super()\n }\n\n public async createMulti(\n args: PluginReferenceLineCreateMultiArgs\n ): Promise<PluginReferenceLineCreateMultiResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.createMulti\",\n args,\n })\n }\n\n public async get(\n args: PluginReferenceLineGetArgs\n ): Promise<PluginReferenceLineGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.get\",\n args,\n })\n }\n\n public async getAll(): Promise<PluginReferenceLineGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.getAll\",\n })\n }\n\n public async delete(\n args: PluginReferenceLineDeleteArgs\n ): Promise<PluginReferenceLineDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.referenceLine.delete\",\n args,\n })\n }\n}\n","import {\n PluginSpaceApi,\n PluginSpaceCreateRectangularArgs,\n PluginSpaceCreateRectangularResult,\n PluginSpaceCreateFromProfileArgs,\n PluginSpaceCreateFromProfileResult,\n PluginSpaceDeleteArgs,\n PluginSpaceDeleteResult,\n PluginSpaceGetArgs,\n PluginSpaceGetResult,\n PluginSpaceGetAllResult,\n PluginSpaceUpdateGeometryFromProfileArgs,\n PluginSpaceUpdateGeometryFromProfileResult,\n PluginSpaceUpdateArgs,\n PluginSpaceUpdateResult,\n PluginSpaceBulkCreateArgs,\n PluginSpaceBulkCreateResult,\n PluginSpaceBulkUpdateArgs,\n PluginSpaceBulkUpdateResult,\n PluginSpaceBulkDeleteArgs,\n PluginSpaceBulkDeleteResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSpaceApi extends PluginSpaceApi {\n constructor() {\n super()\n }\n\n public async createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createRectangular\",\n args: {\n position,\n dimensions,\n },\n })\n }\n\n public async createFromProfile({\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.createFromProfile\",\n args: {\n profile,\n innerProfiles,\n extrudeHeight,\n position,\n },\n })\n }\n\n public async updateGeometryFromProfile({\n spaceId,\n profile,\n extrudeHeight,\n }: PluginSpaceUpdateGeometryFromProfileArgs): Promise<PluginSpaceUpdateGeometryFromProfileResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.updateGeometryFromProfile\",\n args: {\n spaceId,\n profile,\n extrudeHeight,\n },\n })\n }\n\n public async get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.get\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginSpaceGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.getAll\",\n })\n }\n\n public async delete({\n spaceId,\n }: PluginSpaceDeleteArgs): Promise<PluginSpaceDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.delete\",\n args: {\n spaceId,\n },\n })\n }\n\n public async update({\n spaceId,\n properties,\n }: PluginSpaceUpdateArgs): Promise<PluginSpaceUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.update\",\n args: {\n spaceId,\n properties,\n },\n })\n }\n\n public async bulkCreate({\n items,\n }: PluginSpaceBulkCreateArgs): Promise<PluginSpaceBulkCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkCreate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkUpdate({\n items,\n }: PluginSpaceBulkUpdateArgs): Promise<PluginSpaceBulkUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkUpdate\",\n args: {\n items,\n },\n })\n }\n\n public async bulkDelete({\n spaceIds,\n }: PluginSpaceBulkDeleteArgs): Promise<PluginSpaceBulkDeleteResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.space.bulkDelete\",\n args: {\n spaceIds,\n },\n })\n }\n}\n","import {\n PluginStoryApi,\n PluginStoryGetArgs,\n PluginStoryGetResult,\n PluginStoryGetAllResult,\n PluginStoryCreateArgs,\n PluginStoryCreateResult,\n PluginStoryUpdateArgs,\n PluginStoryUpdateResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientStoryApi extends PluginStoryApi {\n constructor() {\n super()\n }\n\n public async get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): Promise<PluginStoryGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.get\",\n args: {\n storyValue,\n properties,\n },\n })\n }\n\n public async getAll(): Promise<PluginStoryGetAllResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.getAll\",\n })\n }\n\n public async create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.create\",\n args: {\n storyValue,\n height,\n },\n })\n }\n\n public async update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"entity.story.update\",\n args: {\n storyValue,\n height,\n },\n })\n }\n}\n","import { PluginToolsApi } from \"@snaptrude/plugin-core\"\nimport type {\n PluginCopyArgs,\n PluginCopyResult,\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { ClientSelectionApi } from \"./selection\"\nimport { ClientTransformApi } from \"./transform\"\nimport { copy } from \"./copy\"\nimport { offset } from \"./offset\"\n\nexport class ClientToolsApi extends PluginToolsApi {\n public selection: ClientSelectionApi\n public transform: ClientTransformApi\n\n constructor() {\n super()\n this.selection = new ClientSelectionApi()\n this.transform = new ClientTransformApi()\n }\n\n public async copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n return copy(args)\n }\n\n public async offset(args: PluginOffsetArgs): Promise<PluginOffsetResult> {\n return offset(args)\n }\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginSelectionApi, PluginSelectionGetResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientSelectionApi extends PluginSelectionApi {\n constructor() {\n super()\n }\n\n public async get(): Promise<PluginSelectionGetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.selection.get\",\n })\n }\n}\n","import {\n PluginTransformApi,\n PluginMoveArgs,\n PluginRotateArgs,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientTransformApi extends PluginTransformApi {\n constructor() {\n super()\n }\n\n public async move({\n componentIds,\n displacement,\n }: PluginMoveArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.move\",\n args: {\n componentIds,\n displacement,\n },\n })\n }\n\n public async rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): Promise<void> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.transform.rotate\",\n args: {\n componentIds,\n angle,\n axis,\n pivot,\n },\n })\n }\n}\n","import type { PluginCopyArgs, PluginCopyResult } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function copy(args: PluginCopyArgs): Promise<PluginCopyResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.copy\",\n args,\n })\n}\n","import type {\n PluginOffsetArgs,\n PluginOffsetResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport async function offset(\n args: PluginOffsetArgs,\n): Promise<PluginOffsetResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"tools.offset\",\n args,\n })\n}\n","import {\n PluginUnitsApi,\n PluginUnitsConvertFromArgs,\n PluginUnitsConvertFromResult,\n PluginUnitsConvertToArgs,\n PluginUnitsConvertToResult,\n} from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientUnitsApi extends PluginUnitsApi {\n constructor() {\n super()\n }\n\n public async convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): Promise<PluginUnitsConvertFromResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertFrom\",\n args,\n })\n }\n\n public async convertTo(\n args: PluginUnitsConvertToArgs,\n ): Promise<PluginUnitsConvertToResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"units.convertTo\",\n args,\n })\n }\n}\n","import { PluginDocumentationApi } from \"@snaptrude/plugin-core\"\nimport { ClientDocumentationAIInspirationApi } from \"./aiInspiration\"\n\nexport class ClientDocumentationApi extends PluginDocumentationApi {\n public aiInspiration: ClientDocumentationAIInspirationApi\n\n constructor() {\n super()\n this.aiInspiration = new ClientDocumentationAIInspirationApi()\n }\n}\n\nexport * from \"./aiInspiration\"\n","import type {\n PluginAIInspirationCancelJobResult,\n PluginAIInspirationDeleteRecipeArgs,\n PluginAIInspirationDeleteRecipeResult,\n PluginAIInspirationExtractRecipeFromShapeArgs,\n PluginAIInspirationExtractionResult,\n PluginAIInspirationGenerateArgs,\n PluginAIInspirationGetJobResult,\n PluginAIInspirationGetModelCapabilitiesArgs,\n PluginAIInspirationGetModelCapabilitiesResult,\n PluginAIInspirationGetSelectionResult,\n PluginAIInspirationGetPresetCatalogResult,\n PluginAIInspirationGetWorkflowForShapeArgs,\n PluginAIInspirationGetWorkflowForShapeResult,\n PluginAIInspirationJobArgs,\n PluginAIInspirationListJobsResult,\n PluginAIInspirationListModelsResult,\n PluginAIInspirationListRecipesResult,\n PluginAIInspirationListSourcesArgs,\n PluginAIInspirationListSourcesResult,\n PluginAIInspirationRefineArgs,\n PluginAIInspirationRerunPlanResult,\n PluginAIInspirationRerunSelectedBranchArgs,\n PluginAIInspirationRunRecipeArgs,\n PluginAIInspirationRunResult,\n PluginAIInspirationSaveRecipeArgs,\n PluginAIInspirationSaveRecipeResult,\n} from \"@snaptrude/plugin-core\"\nimport { PluginDocumentationAIInspirationApi } from \"@snaptrude/plugin-core\"\nimport { getHostApi } from \"../../host-api\"\n\nexport class ClientDocumentationAIInspirationApi extends PluginDocumentationAIInspirationApi {\n constructor() {\n super()\n }\n\n public async listModels(): Promise<PluginAIInspirationListModelsResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listModels\" })\n }\n\n public async getModelCapabilities(\n args: PluginAIInspirationGetModelCapabilitiesArgs,\n ): Promise<PluginAIInspirationGetModelCapabilitiesResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getModelCapabilities\",\n args,\n })\n }\n\n public async listSources(\n args: PluginAIInspirationListSourcesArgs,\n ): Promise<PluginAIInspirationListSourcesResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.listSources\",\n args,\n })\n }\n\n public async getSelection(): Promise<PluginAIInspirationGetSelectionResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.getSelection\" })\n }\n\n public async getPresetCatalog(): Promise<PluginAIInspirationGetPresetCatalogResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getPresetCatalog\",\n })\n }\n\n public async generate(\n args: PluginAIInspirationGenerateArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.generate\",\n args,\n })\n }\n\n public async refine(\n args: PluginAIInspirationRefineArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.refine\",\n args,\n })\n }\n\n public async getJob(\n args: PluginAIInspirationJobArgs,\n ): Promise<PluginAIInspirationGetJobResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getJob\",\n args,\n })\n }\n\n public async cancelJob(\n args: PluginAIInspirationJobArgs,\n ): Promise<PluginAIInspirationCancelJobResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.cancelJob\",\n args,\n })\n }\n\n public async listJobs(): Promise<PluginAIInspirationListJobsResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listJobs\" })\n }\n\n public async getWorkflowForShape(\n args: PluginAIInspirationGetWorkflowForShapeArgs,\n ): Promise<PluginAIInspirationGetWorkflowForShapeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getWorkflowForShape\",\n args,\n })\n }\n\n public async getSelectedBranchRerunPlan(\n args: PluginAIInspirationGetWorkflowForShapeArgs,\n ): Promise<PluginAIInspirationRerunPlanResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.getSelectedBranchRerunPlan\",\n args,\n })\n }\n\n public async rerunSelectedBranch(\n args: PluginAIInspirationRerunSelectedBranchArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.rerunSelectedBranch\",\n args,\n })\n }\n\n public async extractRecipeFromShape(\n args: PluginAIInspirationExtractRecipeFromShapeArgs,\n ): Promise<PluginAIInspirationExtractionResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.extractRecipeFromShape\",\n args,\n })\n }\n\n public async listRecipes(): Promise<PluginAIInspirationListRecipesResult> {\n const hostApi = getHostApi()\n return hostApi.call({ method: \"documentation.aiInspiration.listRecipes\" })\n }\n\n public async saveRecipe(\n args: PluginAIInspirationSaveRecipeArgs,\n ): Promise<PluginAIInspirationSaveRecipeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.saveRecipe\",\n args,\n })\n }\n\n public async deleteRecipe(\n args: PluginAIInspirationDeleteRecipeArgs,\n ): Promise<PluginAIInspirationDeleteRecipeResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.deleteRecipe\",\n args,\n })\n }\n\n public async runRecipe(\n args: PluginAIInspirationRunRecipeArgs,\n ): Promise<PluginAIInspirationRunResult> {\n const hostApi = getHostApi()\n return hostApi.call({\n method: \"documentation.aiInspiration.runRecipe\",\n args,\n })\n }\n}\n","import { ClientCoreApi } from \"./core\"\nimport { ClientEntityApi } from \"./entity\"\nimport { ClientToolsApi } from \"./tools\"\nimport { ClientUnitsApi } from \"./units\"\nimport { ClientDocumentationApi } from \"./documentation\"\nimport { PluginApi } from \"@snaptrude/plugin-core\"\n\nexport class ClientPluginApi extends PluginApi {\n private static instance: ClientPluginApi\n\n public core: ClientCoreApi\n public tools: ClientToolsApi\n public entity: ClientEntityApi\n public units: ClientUnitsApi\n public documentation: ClientDocumentationApi\n\n private constructor() {\n super()\n this.core = new ClientCoreApi()\n this.tools = new ClientToolsApi()\n this.entity = new ClientEntityApi()\n this.units = new ClientUnitsApi()\n this.documentation = new ClientDocumentationApi()\n }\n\n static getInstance(): ClientPluginApi {\n if (!ClientPluginApi.instance) {\n ClientPluginApi.instance = new ClientPluginApi()\n }\n return ClientPluginApi.instance\n }\n}\n\nexport * from \"./core\"\nexport * from \"./documentation\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n","import * as Comlink from \"comlink\"\n\nexport interface UIMessage {\n action: string\n payload: unknown\n}\n\ninterface PluginConfig {\n pluginId: string\n}\n\n/**\n * Base class for Snaptrude plugin workers.\n *\n * Handles Comlink wiring, host communication, and the standard lifecycle\n * methods (`init`, `destroy`, `ping`, `onUIMessage`). Subclass this and\n * override only the methods you need — then call `start()` to expose the\n * worker API.\n *\n * The plugin ID is received automatically from the host during\n * initialization — no need to pass it manually.\n *\n * @example\n * ```ts\n * import { PluginWorker } from \"@snaptrude/plugin-client\";\n *\n * class MyPlugin extends PluginWorker {\n * async onUIMessage(message: UIMessage) {\n * // handle messages from the UI panel\n * }\n * }\n *\n * new MyPlugin().start();\n * ```\n */\nexport abstract class PluginWorker {\n protected pluginId!: string\n private hostAPI: Comlink.Remote<Record<string, unknown>>\n\n constructor() {\n this.hostAPI = Comlink.wrap<Record<string, unknown>>(\n self as unknown as Comlink.Endpoint\n )\n }\n\n protected sendToUI(action: string, payload: unknown): void {\n ;(this.hostAPI as Record<string, any>).ui.sendToUI({ action, payload })\n }\n\n /**\n * Signal the host that this plugin has finished its work and should be\n * stopped. Use this in headless (UI-less) plugins that run a task and\n * self-terminate.\n */\n protected complete(): void {\n ;(this.hostAPI as Record<string, any>).lifecycle.complete()\n }\n\n async init(): Promise<void> {\n console.log(this.pluginId, \"init() called\")\n console.log(this.pluginId, \"Initialization complete\")\n }\n\n async destroy(): Promise<void> {\n console.log(this.pluginId, \"destroy() called — cleaning up\")\n }\n\n async ping(): Promise<string> {\n return \"pong\"\n }\n\n async onUIMessage(_message: UIMessage): Promise<void> {\n // Override in subclass to handle UI messages\n }\n\n /**\n * Expose the worker API via Comlink and start listening.\n * Call this once after constructing the plugin instance.\n *\n * The host calls `init(config)` with `{ pluginId }`,\n * which is captured here to set `this.pluginId` before the\n * subclass's `init()` runs.\n */\n start(): void {\n Comlink.expose(\n {\n init: (config: PluginConfig) => {\n this.pluginId = config.pluginId\n return this.init()\n },\n destroy: () => this.destroy(),\n ping: () => this.ping(),\n onUIMessage: (message: UIMessage) => this.onUIMessage(message),\n },\n self as unknown as Comlink.Endpoint\n )\n console.log(\"Worker loaded, API exposed via Comlink\")\n }\n}\n","import { ClientPluginApi } from \"./api\"\n\nexport * from \"./api\"\nexport * from \"./host-api\"\nexport * from \"./plugin-worker\"\n\n/**\n * The Snaptrude plugin client API.\n *\n * The main entry point for plugins to interact with the Snaptrude platform.\n */\nexport const snaptrude = ClientPluginApi.getInstance()\n"],"mappings":";AAAA,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;AFFO,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAI/C,cAAc;AACZ,UAAM;AACN,SAAK,OAAO,IAAI,cAAc;AAC9B,SAAK,OAAO,IAAI,cAAc;AAAA,EAChC;AACF;;;AGbA,SAAS,qBAAqB;;;ACA9B,SAAS,qBAAqB;AAEvB,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,oBAAoB;AAEtB,IAAM,eAAN,cAA2B,aAAa;AAAA,EAC7C,cAAc;AACZ,UAAM;AAAA,EACR;AACF;;;ACNA,SAAS,sBAAsB;A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AQ,IAAI,KAAK,UAAU,eAAe;AAC1C,YAAQ,IAAI,KAAK,UAAU,yBAAyB;AAAA,EACtD;AAAA,EAEA,MAAM,UAAyB;AAC7B,YAAQ,IAAI,KAAK,UAAU,qCAAgC;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAwB;AAC5B,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,YAAY,UAAoC;AAAA,EAEtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,QAAc;AACZ,IAAQ;AAAA,MACN;AAAA,QACE,MAAM,CAAC,WAAyB;AAC9B,eAAK,WAAW,OAAO;AACvB,iBAAO,KAAK,KAAK;AAAA,QACnB;AAAA,QACA,SAAS,MAAM,KAAK,QAAQ;AAAA,QAC5B,MAAM,MAAM,KAAK,KAAK;AAAA,QACtB,aAAa,CAAC,YAAuB,KAAK,YAAY,OAAO;AAAA,MAC/D;AAAA,MACA;AAAA,IACF;AACA,YAAQ,IAAI,wCAAwC;AAAA,EACtD;AACF;;;ACvFO,IAAM,YAAY,gBAAgB,YAAY;","names":["Comlink"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snaptrude/plugin-client",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "comlink": "^4.4.2",
21
- "@snaptrude/plugin-core": "0.2.6"
21
+ "@snaptrude/plugin-core": "0.2.8"
22
22
  },
23
23
  "devDependencies": {
24
24
  "tsup": "^8.5.1",
@@ -0,0 +1,193 @@
1
+ import type {
2
+ PluginAIInspirationCancelJobResult,
3
+ PluginAIInspirationDeleteRecipeArgs,
4
+ PluginAIInspirationDeleteRecipeResult,
5
+ PluginAIInspirationExtractRecipeFromShapeArgs,
6
+ PluginAIInspirationExtractionResult,
7
+ PluginAIInspirationGenerateArgs,
8
+ PluginAIInspirationGetJobResult,
9
+ PluginAIInspirationGetModelCapabilitiesArgs,
10
+ PluginAIInspirationGetModelCapabilitiesResult,
11
+ PluginAIInspirationGetSelectionResult,
12
+ PluginAIInspirationGetPresetCatalogResult,
13
+ PluginAIInspirationGetWorkflowForShapeArgs,
14
+ PluginAIInspirationGetWorkflowForShapeResult,
15
+ PluginAIInspirationJobArgs,
16
+ PluginAIInspirationListJobsResult,
17
+ PluginAIInspirationListModelsResult,
18
+ PluginAIInspirationListRecipesResult,
19
+ PluginAIInspirationListSourcesArgs,
20
+ PluginAIInspirationListSourcesResult,
21
+ PluginAIInspirationRefineArgs,
22
+ PluginAIInspirationRerunPlanResult,
23
+ PluginAIInspirationRerunSelectedBranchArgs,
24
+ PluginAIInspirationRunRecipeArgs,
25
+ PluginAIInspirationRunResult,
26
+ PluginAIInspirationSaveRecipeArgs,
27
+ PluginAIInspirationSaveRecipeResult,
28
+ } from "@snaptrude/plugin-core"
29
+ import { PluginDocumentationAIInspirationApi } from "@snaptrude/plugin-core"
30
+ import { getHostApi } from "../../host-api"
31
+
32
+ export class ClientDocumentationAIInspirationApi extends PluginDocumentationAIInspirationApi {
33
+ constructor() {
34
+ super()
35
+ }
36
+
37
+ public async listModels(): Promise<PluginAIInspirationListModelsResult> {
38
+ const hostApi = getHostApi()
39
+ return hostApi.call({ method: "documentation.aiInspiration.listModels" })
40
+ }
41
+
42
+ public async getModelCapabilities(
43
+ args: PluginAIInspirationGetModelCapabilitiesArgs,
44
+ ): Promise<PluginAIInspirationGetModelCapabilitiesResult> {
45
+ const hostApi = getHostApi()
46
+ return hostApi.call({
47
+ method: "documentation.aiInspiration.getModelCapabilities",
48
+ args,
49
+ })
50
+ }
51
+
52
+ public async listSources(
53
+ args: PluginAIInspirationListSourcesArgs,
54
+ ): Promise<PluginAIInspirationListSourcesResult> {
55
+ const hostApi = getHostApi()
56
+ return hostApi.call({
57
+ method: "documentation.aiInspiration.listSources",
58
+ args,
59
+ })
60
+ }
61
+
62
+ public async getSelection(): Promise<PluginAIInspirationGetSelectionResult> {
63
+ const hostApi = getHostApi()
64
+ return hostApi.call({ method: "documentation.aiInspiration.getSelection" })
65
+ }
66
+
67
+ public async getPresetCatalog(): Promise<PluginAIInspirationGetPresetCatalogResult> {
68
+ const hostApi = getHostApi()
69
+ return hostApi.call({
70
+ method: "documentation.aiInspiration.getPresetCatalog",
71
+ })
72
+ }
73
+
74
+ public async generate(
75
+ args: PluginAIInspirationGenerateArgs,
76
+ ): Promise<PluginAIInspirationRunResult> {
77
+ const hostApi = getHostApi()
78
+ return hostApi.call({
79
+ method: "documentation.aiInspiration.generate",
80
+ args,
81
+ })
82
+ }
83
+
84
+ public async refine(
85
+ args: PluginAIInspirationRefineArgs,
86
+ ): Promise<PluginAIInspirationRunResult> {
87
+ const hostApi = getHostApi()
88
+ return hostApi.call({
89
+ method: "documentation.aiInspiration.refine",
90
+ args,
91
+ })
92
+ }
93
+
94
+ public async getJob(
95
+ args: PluginAIInspirationJobArgs,
96
+ ): Promise<PluginAIInspirationGetJobResult> {
97
+ const hostApi = getHostApi()
98
+ return hostApi.call({
99
+ method: "documentation.aiInspiration.getJob",
100
+ args,
101
+ })
102
+ }
103
+
104
+ public async cancelJob(
105
+ args: PluginAIInspirationJobArgs,
106
+ ): Promise<PluginAIInspirationCancelJobResult> {
107
+ const hostApi = getHostApi()
108
+ return hostApi.call({
109
+ method: "documentation.aiInspiration.cancelJob",
110
+ args,
111
+ })
112
+ }
113
+
114
+ public async listJobs(): Promise<PluginAIInspirationListJobsResult> {
115
+ const hostApi = getHostApi()
116
+ return hostApi.call({ method: "documentation.aiInspiration.listJobs" })
117
+ }
118
+
119
+ public async getWorkflowForShape(
120
+ args: PluginAIInspirationGetWorkflowForShapeArgs,
121
+ ): Promise<PluginAIInspirationGetWorkflowForShapeResult> {
122
+ const hostApi = getHostApi()
123
+ return hostApi.call({
124
+ method: "documentation.aiInspiration.getWorkflowForShape",
125
+ args,
126
+ })
127
+ }
128
+
129
+ public async getSelectedBranchRerunPlan(
130
+ args: PluginAIInspirationGetWorkflowForShapeArgs,
131
+ ): Promise<PluginAIInspirationRerunPlanResult> {
132
+ const hostApi = getHostApi()
133
+ return hostApi.call({
134
+ method: "documentation.aiInspiration.getSelectedBranchRerunPlan",
135
+ args,
136
+ })
137
+ }
138
+
139
+ public async rerunSelectedBranch(
140
+ args: PluginAIInspirationRerunSelectedBranchArgs,
141
+ ): Promise<PluginAIInspirationRunResult> {
142
+ const hostApi = getHostApi()
143
+ return hostApi.call({
144
+ method: "documentation.aiInspiration.rerunSelectedBranch",
145
+ args,
146
+ })
147
+ }
148
+
149
+ public async extractRecipeFromShape(
150
+ args: PluginAIInspirationExtractRecipeFromShapeArgs,
151
+ ): Promise<PluginAIInspirationExtractionResult> {
152
+ const hostApi = getHostApi()
153
+ return hostApi.call({
154
+ method: "documentation.aiInspiration.extractRecipeFromShape",
155
+ args,
156
+ })
157
+ }
158
+
159
+ public async listRecipes(): Promise<PluginAIInspirationListRecipesResult> {
160
+ const hostApi = getHostApi()
161
+ return hostApi.call({ method: "documentation.aiInspiration.listRecipes" })
162
+ }
163
+
164
+ public async saveRecipe(
165
+ args: PluginAIInspirationSaveRecipeArgs,
166
+ ): Promise<PluginAIInspirationSaveRecipeResult> {
167
+ const hostApi = getHostApi()
168
+ return hostApi.call({
169
+ method: "documentation.aiInspiration.saveRecipe",
170
+ args,
171
+ })
172
+ }
173
+
174
+ public async deleteRecipe(
175
+ args: PluginAIInspirationDeleteRecipeArgs,
176
+ ): Promise<PluginAIInspirationDeleteRecipeResult> {
177
+ const hostApi = getHostApi()
178
+ return hostApi.call({
179
+ method: "documentation.aiInspiration.deleteRecipe",
180
+ args,
181
+ })
182
+ }
183
+
184
+ public async runRecipe(
185
+ args: PluginAIInspirationRunRecipeArgs,
186
+ ): Promise<PluginAIInspirationRunResult> {
187
+ const hostApi = getHostApi()
188
+ return hostApi.call({
189
+ method: "documentation.aiInspiration.runRecipe",
190
+ args,
191
+ })
192
+ }
193
+ }
@@ -0,0 +1,13 @@
1
+ import { PluginDocumentationApi } from "@snaptrude/plugin-core"
2
+ import { ClientDocumentationAIInspirationApi } from "./aiInspiration"
3
+
4
+ export class ClientDocumentationApi extends PluginDocumentationApi {
5
+ public aiInspiration: ClientDocumentationAIInspirationApi
6
+
7
+ constructor() {
8
+ super()
9
+ this.aiInspiration = new ClientDocumentationAIInspirationApi()
10
+ }
11
+ }
12
+
13
+ export * from "./aiInspiration"
package/src/api/index.ts CHANGED
@@ -2,6 +2,7 @@ import { ClientCoreApi } from "./core"
2
2
  import { ClientEntityApi } from "./entity"
3
3
  import { ClientToolsApi } from "./tools"
4
4
  import { ClientUnitsApi } from "./units"
5
+ import { ClientDocumentationApi } from "./documentation"
5
6
  import { PluginApi } from "@snaptrude/plugin-core"
6
7
 
7
8
  export class ClientPluginApi extends PluginApi {
@@ -11,6 +12,7 @@ export class ClientPluginApi extends PluginApi {
11
12
  public tools: ClientToolsApi
12
13
  public entity: ClientEntityApi
13
14
  public units: ClientUnitsApi
15
+ public documentation: ClientDocumentationApi
14
16
 
15
17
  private constructor() {
16
18
  super()
@@ -18,6 +20,7 @@ export class ClientPluginApi extends PluginApi {
18
20
  this.tools = new ClientToolsApi()
19
21
  this.entity = new ClientEntityApi()
20
22
  this.units = new ClientUnitsApi()
23
+ this.documentation = new ClientDocumentationApi()
21
24
  }
22
25
 
23
26
  static getInstance(): ClientPluginApi {
@@ -29,6 +32,7 @@ export class ClientPluginApi extends PluginApi {
29
32
  }
30
33
 
31
34
  export * from "./core"
35
+ export * from "./documentation"
32
36
  export * from "./entity"
33
37
  export * from "./tools"
34
38
  export * from "./units"