@snaptrude/plugin-core 0.9.11 → 0.9.12

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,13 @@
1
1
  # @snaptrude/plugin-core
2
2
 
3
+ ## 0.9.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 6e4a055: added param comps
8
+ - 8e37e1f: `design.family`: `prepare` and `flex` warnings gain the `proportion` code — parts thinner than 0.5 mm, parts or a family larger than 50 m, a family smaller than 10 mm, each naming the parts — and `flex` now returns `warnings`.
9
+ - 2a06dd9: `design.family`: `prepare`, `flex` and `getParameters` accept a `snapshot` option and return a `snapshot` block — an isolated offscreen picture of the family (iso, front, right, top tiles with a dimension line) as a PNG data URL, so an agent can look at what it built before reporting.
10
+
3
11
  ## 0.9.11
4
12
 
5
13
  ### Patch Changes
package/api-manifest.json CHANGED
@@ -4413,12 +4413,13 @@
4413
4413
  {
4414
4414
  "path": "design.create.smartLayout",
4415
4415
  "namespace": "design.create",
4416
- "summary": "Place a **smart layout** — apply a saved smart-layout template from the team/user library (walls, floors, spaces, furniture, doors, windows) onto one or more target ROOM/DEPARTMENT spaces, adapting orientation and fit to each target.",
4416
+ "summary": "Place a **smart layout** — clone an in-scene template cluster (walls, furniture, doors, windows, floors) into one or more target ROOM/DEPARTMENT spaces, adapting orientation and fit to each target.",
4417
4417
  "examplePrompts": [
4418
- "Apply this saved layout template to the selected rooms",
4419
- "Place the \"Meeting Room A\" template into these two spaces",
4420
- "Fill every office with my saved desk-cluster layout",
4421
- "Use a template from my library to lay out this room\n\n# Example\n```ts\nconst targets = await snaptrude.design.query.listSpaces({ isSelected: true })\nconst [template] = await snaptrude.design.smartLayouts.listCatalog()\nconst result = await snaptrude.design.create.smartLayout({\ntemplateId: template.id,\ntargets,\n})\nconsole.log(\"placed walls:\", result.created.walls.length, \"skipped:\", result.skippedWalls)\n```"
4418
+ "Copy this room's layout into the selected rooms",
4419
+ "Apply this furniture arrangement to the other offices",
4420
+ "Replicate this template into these two spaces",
4421
+ "Place this desk cluster into every meeting room",
4422
+ "Use this room as a template for the rooms I selected but keep them visible\n\n# Example\n```ts\nconst [templateRoom, ...targets] = await snaptrude.design.query.listSpaces({ isSelected: true })\nconst result = await snaptrude.design.create.smartLayout({\ntemplateComponents: [templateRoom],\ntargets,\n})\nconsole.log(\"placed walls:\", result.created.walls.length, \"skipped:\", result.skippedWalls)\n\n// …or clone a saved group by its id (from core.groups.list)\nconst { groups } = await snaptrude.core.groups.list()\nawait snaptrude.design.create.smartLayout({ templateGroup: groups[0].id, targets })\n```"
4422
4423
  ],
4423
4424
  "argsType": "PluginSmartLayoutArgs",
4424
4425
  "resultType": "PluginSmartLayoutResult"
@@ -4738,6 +4739,103 @@
4738
4739
  "argsType": "PluginDesignListErasableEdgesArgs",
4739
4740
  "resultType": "ErasableEdgeRef[]"
4740
4741
  },
4742
+ {
4743
+ "path": "design.family.create",
4744
+ "namespace": "design.family",
4745
+ "summary": "Commit the prepared bundle to the project's parametric-definition library, so it survives the session and appears in the Families panel.",
4746
+ "examplePrompts": [
4747
+ "Save this as a family called Vertical Louvre",
4748
+ "Add it to my library\n\n# Example\n```ts\nconst { definitionId } = await snaptrude.design.family.create({ name: \"Louvre Screen\" })\n```"
4749
+ ],
4750
+ "argsType": "PluginDesignFamilyCreateArgs",
4751
+ "resultType": "PluginFamilyCreateResult"
4752
+ },
4753
+ {
4754
+ "path": "design.family.flex",
4755
+ "namespace": "design.family",
4756
+ "summary": "Re-run the prepared family's recipe at new parameter values.",
4757
+ "examplePrompts": [
4758
+ "Change it to 6 bays",
4759
+ "Show me what happens with 20 blades\n\n# Example\n```ts\nconst { changed } = await snaptrude.design.family.flex({ values: { bays: 6 } })\nconsole.log(`removed ${changed.removed}, rebuilt ${changed.rebuilt}`)\n```"
4760
+ ],
4761
+ "argsType": "PluginDesignFamilyFlexArgs",
4762
+ "resultType": "PluginFamilyFlexResult"
4763
+ },
4764
+ {
4765
+ "path": "design.family.get",
4766
+ "namespace": "design.family",
4767
+ "summary": "The prepared family's spec bundle, or `null` when nothing is prepared.",
4768
+ "examplePrompts": [],
4769
+ "argsType": null,
4770
+ "resultType": "PluginFamilyBundle | null"
4771
+ },
4772
+ {
4773
+ "path": "design.family.getParameters",
4774
+ "namespace": "design.family",
4775
+ "summary": "Read a placed component's current parameter values and its sheet.",
4776
+ "examplePrompts": [
4777
+ "What size is that table?",
4778
+ "Show me the parameters on this partition\n\n# Example\n```ts\nconst { values, parameters } = await snaptrude.design.family.getParameters({ component })\n```"
4779
+ ],
4780
+ "argsType": "PluginDesignFamilyGetParametersArgs",
4781
+ "resultType": "PluginFamilyInstanceParameters | null"
4782
+ },
4783
+ {
4784
+ "path": "design.family.getReference",
4785
+ "namespace": "design.family",
4786
+ "summary": "Read the family-spec DSL reference: grammar, the op table, the expression whitelist, the coordinate convention, the repair contract, and a worked example taken from a registered family.",
4787
+ "examplePrompts": [
4788
+ "How do I write a parametric family spec?",
4789
+ "Show me the family DSL\n\n# Example\n```ts\nconst { reference } = await snaptrude.design.family.getReference()\n```"
4790
+ ],
4791
+ "argsType": null,
4792
+ "resultType": "PluginFamilyReference"
4793
+ },
4794
+ {
4795
+ "path": "design.family.list",
4796
+ "namespace": "design.family",
4797
+ "summary": "Every parametric family registered in this session — native and imported.",
4798
+ "examplePrompts": [
4799
+ "What families are available?\n\n# Example\n```ts\nconst families = await snaptrude.design.family.list()\n```"
4800
+ ],
4801
+ "argsType": null,
4802
+ "resultType": "PluginFamilySummary[]"
4803
+ },
4804
+ {
4805
+ "path": "design.family.place",
4806
+ "namespace": "design.family",
4807
+ "summary": "Put a family into the model — either the prepared draft or any family from {@linkcode PluginDesignFamilyApi.list}.",
4808
+ "examplePrompts": [
4809
+ "Place it in the model",
4810
+ "Put a louvre screen at the origin",
4811
+ "Copy that table two metres to the right\n\n# Example\n```ts\n// positioned — geometry exists when this resolves\nconst { component } = await snaptrude.design.family.place({\nid: \"revit:gypsum-stud-partition~90ad72\",\nposition: { x: 0, y: 0, z: 0 },\nrotation: 90,\n})\nawait snaptrude.design.transform.move([component], { x: 2, y: 0, z: 0 })\n\n// interactive — the user clicks\nawait snaptrude.design.family.place()\n```"
4812
+ ],
4813
+ "argsType": "PluginDesignFamilyPlaceArgs",
4814
+ "resultType": "PluginFamilyPlaceResult"
4815
+ },
4816
+ {
4817
+ "path": "design.family.prepare",
4818
+ "namespace": "design.family",
4819
+ "summary": "Validate, compile and preview a family spec. Nothing is committed to the model or the library — call {@linkcode PluginDesignFamilyApi.place} or {@linkcode PluginDesignFamilyApi.create} for that.",
4820
+ "examplePrompts": [
4821
+ "Make a louvre screen with adjustable blade count and tilt",
4822
+ "Design a curtain wall panel family with 8 bays",
4823
+ "Create a railing family I can adjust\n\n# Example\n```ts\nconst r = await snaptrude.design.family.prepare({ bundle })\nif (!r.ok) console.error(r.errors[0].path, r.errors[0].message)\n```"
4824
+ ],
4825
+ "argsType": "PluginDesignFamilyPrepareArgs",
4826
+ "resultType": "PluginFamilyPrepareResult"
4827
+ },
4828
+ {
4829
+ "path": "design.family.setParameters",
4830
+ "namespace": "design.family",
4831
+ "summary": "Change a placed component's parameters and rebuild its geometry in place.",
4832
+ "examplePrompts": [
4833
+ "Make that table seat 8",
4834
+ "Change the stud spacing to 400\n\n# Example\n```ts\nawait snaptrude.design.family.setParameters({ component, values: { seats: 8 } })\n```"
4835
+ ],
4836
+ "argsType": "PluginDesignFamilySetParametersArgs",
4837
+ "resultType": "PluginFamilyInstanceParameters"
4838
+ },
4741
4839
  {
4742
4840
  "path": "design.furniture.exists",
4743
4841
  "namespace": "design.furniture",
@@ -5671,67 +5769,6 @@
5671
5769
  "argsType": "PluginSelectionFilter",
5672
5770
  "resultType": "PluginDesignChangeResult"
5673
5771
  },
5674
- {
5675
- "path": "design.smartLayouts.create",
5676
- "namespace": "design.smartLayouts",
5677
- "summary": "**Create** a smart-layout template in the library from an in-scene component cluster (walls, floors, furniture, doors, windows) — the save side of `design.create.smartLayout`.",
5678
- "examplePrompts": [
5679
- "Save this room's layout as a template",
5680
- "Add the selected furniture cluster to my template library",
5681
- "Save this arrangement as \"Meeting Room A\" under Offices\n\n# Example\n```ts\nconst selected = await snaptrude.design.selection.list()\nconst item = await snaptrude.design.smartLayouts.create({\ncomponents: selected,\nname: \"Meeting Room A\",\n})\nconsole.log(\"saved:\", item.id, item.name)\n```"
5682
- ],
5683
- "argsType": "PluginSmartLayoutCreateArgs",
5684
- "resultType": "PluginSmartLayoutCatalogItem"
5685
- },
5686
- {
5687
- "path": "design.smartLayouts.exists",
5688
- "namespace": "design.smartLayouts",
5689
- "summary": "Test whether a saved smart-layout template exists for the given catalog id.",
5690
- "examplePrompts": [
5691
- "Is this layout template still in the library?",
5692
- "Check whether this template id exists",
5693
- "Verify the template is available before placing it\n\n# Example\n```ts\nconst [entry] = await snaptrude.design.smartLayouts.listCatalog()\nconst stillAvailable = await snaptrude.design.smartLayouts.exists(entry.id)\nconsole.log(stillAvailable ? \"safe to place\" : \"removed from library\")\n```"
5694
- ],
5695
- "argsType": "string",
5696
- "resultType": "boolean"
5697
- },
5698
- {
5699
- "path": "design.smartLayouts.getCatalogItem",
5700
- "namespace": "design.smartLayouts",
5701
- "summary": "Get a single saved smart-layout template by its catalog id.",
5702
- "examplePrompts": [
5703
- "Get the details of this saved layout template",
5704
- "Look up the template with this id",
5705
- "What's the floor area of this saved template?\n\n# Example\n```ts\nconst [entry] = await snaptrude.design.smartLayouts.listCatalog()\nconst item = await snaptrude.design.smartLayouts.getCatalogItem(entry.id)\nif (item) console.log(item.name, item.categoryId)\n```"
5706
- ],
5707
- "argsType": "string",
5708
- "resultType": "PluginSmartLayoutCatalogItem | null"
5709
- },
5710
- {
5711
- "path": "design.smartLayouts.listCatalog",
5712
- "namespace": "design.smartLayouts",
5713
- "summary": "List the saved smart-layout templates of the ambient library scope, optionally restricted to one category.",
5714
- "examplePrompts": [
5715
- "What layout templates can I place?",
5716
- "List every saved smart layout in my library",
5717
- "Show the templates in the \"Meeting Rooms\" category",
5718
- "Browse the smart layout catalog\n\n# Example\n```ts\nconst items = await snaptrude.design.smartLayouts.listCatalog()\nfor (const item of items) console.log(item.id, item.name, item.area)\n```"
5719
- ],
5720
- "argsType": "string",
5721
- "resultType": "PluginSmartLayoutCatalogItem[]"
5722
- },
5723
- {
5724
- "path": "design.smartLayouts.listCatalogGroups",
5725
- "namespace": "design.smartLayouts",
5726
- "summary": "List the smart-layout template categories of the ambient library scope. The implicit `Default` bucket is always present and listed first; the rest follow alphabetically.",
5727
- "examplePrompts": [
5728
- "What smart layout categories does my library have?",
5729
- "List the template categories",
5730
- "Which buckets can I save a layout template into?\n\n# Example\n```ts\nconst groups = await snaptrude.design.smartLayouts.listCatalogGroups()\nfor (const g of groups) console.log(g.id, g.label)\n```"
5731
- ],
5732
- "argsType": null,
5733
- "resultType": "PluginSmartLayoutCatalogGroup[]"
5734
- },
5735
5772
  {
5736
5773
  "path": "design.transform.align",
5737
5774
  "namespace": "design.transform",