@kruschdev/pascal-plugin-mit-assets 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/ASSETS.md +298 -0
  2. package/LICENSE +21 -0
  3. package/README.md +71 -2
  4. package/dist/agent-operations.d.ts +8 -0
  5. package/dist/agent-operations.js +305 -0
  6. package/dist/agent-tools.d.ts +7 -0
  7. package/dist/agent-tools.js +128 -0
  8. package/dist/audit.d.ts +78 -0
  9. package/dist/bin/pascal-mit-assets.js +5238 -0
  10. package/dist/bom.d.ts +123 -0
  11. package/dist/cad/appliance-mep-builders.d.ts +7 -0
  12. package/dist/cad/furniture-builders.d.ts +9 -0
  13. package/dist/cad/index.d.ts +48 -0
  14. package/dist/cad/index.js +23 -0
  15. package/dist/cad/kitchen-bath-builders.d.ts +9 -0
  16. package/dist/cad/outdoor-fenestration-builders.d.ts +8 -0
  17. package/dist/cad/primitives.d.ts +56 -0
  18. package/dist/cad/props-vehicles-builders.d.ts +8 -0
  19. package/dist/chunk-2qgndrap.js +5200 -0
  20. package/dist/chunk-6hzyh6qv.js +346 -0
  21. package/dist/chunk-f72r2bmp.js +84 -0
  22. package/dist/chunk-hqgm57dv.js +310 -0
  23. package/dist/chunk-kgwk6kan.js +150 -0
  24. package/dist/chunk-raafkn3w.js +286 -0
  25. package/dist/chunk-vzmjt9dz.js +4380 -0
  26. package/dist/chunk-xhkwv6t4.js +5080 -0
  27. package/dist/hdri/index.d.ts +1 -0
  28. package/dist/hdri/index.js +322 -0
  29. package/dist/hdri/sky.d.ts +26 -0
  30. package/dist/index.d.ts +30 -0
  31. package/dist/index.js +198 -0
  32. package/dist/manifest.d.ts +46 -0
  33. package/dist/materials/index.d.ts +10 -0
  34. package/dist/materials/index.js +1464 -0
  35. package/dist/materials/ktx2.d.ts +10 -0
  36. package/dist/materials/noise.d.ts +89 -0
  37. package/dist/materials/patterns.d.ts +15 -0
  38. package/dist/nodes/mit-item.d.ts +76 -0
  39. package/dist/render.d.ts +10 -0
  40. package/dist/render.js +24 -0
  41. package/dist/scripts/build-assets.js +17129 -0
  42. package/dist/sfx/index.d.ts +1 -0
  43. package/dist/sfx/index.js +1223 -0
  44. package/dist/sfx/synth.d.ts +25 -0
  45. package/dist/sku-crosswalk.d.ts +46 -0
  46. package/dist/ui/chat-card.d.ts +7 -0
  47. package/dist/ui/host-panel.d.ts +1 -0
  48. package/dist/ui/inspector-card.d.ts +4 -0
  49. package/dist/ui/schedule-view.d.ts +1 -0
  50. package/package.json +135 -4
  51. package/src/agent-operations.ts +373 -0
  52. package/src/agent-tools.ts +136 -0
  53. package/src/audit.ts +356 -0
  54. package/src/bom.ts +512 -0
  55. package/src/cad/appliance-mep-builders.ts +1336 -0
  56. package/src/cad/furniture-builders.ts +1622 -0
  57. package/src/cad/index.ts +993 -0
  58. package/src/cad/kitchen-bath-builders.ts +1189 -0
  59. package/src/cad/outdoor-fenestration-builders.ts +1499 -0
  60. package/src/cad/primitives.ts +286 -0
  61. package/src/cad/props-vehicles-builders.ts +1065 -0
  62. package/src/hdri/index.ts +5 -0
  63. package/src/hdri/sky.ts +481 -0
  64. package/src/index.ts +127 -0
  65. package/src/manifest.ts +5296 -0
  66. package/src/materials/index.ts +56 -0
  67. package/src/materials/ktx2.ts +138 -0
  68. package/src/materials/noise.ts +417 -0
  69. package/src/materials/patterns.ts +1507 -0
  70. package/src/nodes/mit-item.ts +163 -0
  71. package/src/render.ts +25 -0
  72. package/src/sfx/index.ts +6 -0
  73. package/src/sfx/synth.ts +1495 -0
  74. package/src/sku-crosswalk.ts +3868 -0
  75. package/src/ui/chat-card.tsx +93 -0
  76. package/src/ui/host-panel.tsx +330 -0
  77. package/src/ui/inspector-card.tsx +213 -0
  78. package/src/ui/schedule-view.tsx +188 -0
@@ -0,0 +1,286 @@
1
+ "use client";
2
+ import {
3
+ MIT_ITEM_SPECS2,
4
+ getMitItemSpec2
5
+ } from "./chunk-2qgndrap.js";
6
+ import {
7
+ getMitItemSku2
8
+ } from "./chunk-vzmjt9dz.js";
9
+
10
+ // src/ui/inspector-card.tsx
11
+ import { useScene } from "@pascal-app/editor";
12
+ import { useEffect, useState } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ function safeFiniteDim(value, fallback, min, max) {
15
+ const n = typeof value === "number" ? value : Number(value);
16
+ if (!Number.isFinite(n))
17
+ return Math.min(max, Math.max(min, fallback));
18
+ return Math.min(max, Math.max(min, n));
19
+ }
20
+ function MitAssetsInspectorCard({ node }) {
21
+ const updateNodes = useScene((s) => s.updateNodes);
22
+ const raw = node;
23
+ const isMitItem = Boolean(raw && raw.type === "mit-assets:item");
24
+ const nodeId = isMitItem ? String(raw?.id ?? "") : "";
25
+ const slug = isMitItem ? String(raw?.slug ?? "sofa") : "sofa";
26
+ const spec = getMitItemSpec2(slug);
27
+ const skuRec = getMitItemSku2(slug);
28
+ const widthM = safeFiniteDim(raw?.widthM, spec?.dimensions[0] ?? 1, 0.04, 20);
29
+ const heightM = safeFiniteDim(raw?.heightM, spec?.dimensions[1] ?? 1, 0.01, 20);
30
+ const depthM = safeFiniteDim(raw?.depthM, spec?.dimensions[2] ?? 1, 0.02, 20);
31
+ const rawAccent = typeof raw?.accentColor === "string" ? raw.accentColor : "";
32
+ const accentColor = /^#[0-9a-fA-F]{6}$/.test(rawAccent) ? rawAccent : "#5c7285";
33
+ const [draftW, setDraftW] = useState(() => String(widthM));
34
+ const [draftH, setDraftH] = useState(() => String(heightM));
35
+ const [draftD, setDraftD] = useState(() => String(depthM));
36
+ useEffect(() => {
37
+ setDraftW(String(widthM));
38
+ setDraftH(String(heightM));
39
+ setDraftD(String(depthM));
40
+ }, [nodeId]);
41
+ useEffect(() => {
42
+ setDraftW((prev) => prev.trim() !== "" && Number(prev) === widthM ? prev : String(widthM));
43
+ }, [widthM]);
44
+ useEffect(() => {
45
+ setDraftH((prev) => prev.trim() !== "" && Number(prev) === heightM ? prev : String(heightM));
46
+ }, [heightM]);
47
+ useEffect(() => {
48
+ setDraftD((prev) => prev.trim() !== "" && Number(prev) === depthM ? prev : String(depthM));
49
+ }, [depthM]);
50
+ if (!isMitItem || !raw)
51
+ return null;
52
+ const patch = (updates) => {
53
+ updateNodes([{ id: nodeId, data: updates }]);
54
+ };
55
+ const inputStyle = {
56
+ padding: 4,
57
+ borderRadius: 4,
58
+ border: "1px solid #3f3f46",
59
+ background: "transparent",
60
+ color: "inherit"
61
+ };
62
+ return /* @__PURE__ */ jsxs("div", {
63
+ style: { display: "flex", flexDirection: "column", gap: 10, padding: "6px 10px 10px", fontSize: 12 },
64
+ children: [
65
+ /* @__PURE__ */ jsxs("div", {
66
+ style: { display: "flex", justifyContent: "space-between", alignItems: "center" },
67
+ children: [
68
+ /* @__PURE__ */ jsx("strong", {
69
+ children: "Clean-Room MIT Asset"
70
+ }),
71
+ /* @__PURE__ */ jsx("span", {
72
+ style: {
73
+ padding: "2px 6px",
74
+ borderRadius: 4,
75
+ background: "#166534",
76
+ color: "#dcfce7",
77
+ fontWeight: 600,
78
+ fontSize: 10
79
+ },
80
+ children: "MIT LICENSE"
81
+ })
82
+ ]
83
+ }),
84
+ /* @__PURE__ */ jsxs("label", {
85
+ style: { display: "flex", flexDirection: "column", gap: 4 },
86
+ children: [
87
+ /* @__PURE__ */ jsxs("span", {
88
+ children: [
89
+ "Item Slug (",
90
+ MIT_ITEM_SPECS2.length,
91
+ " available)"
92
+ ]
93
+ }),
94
+ /* @__PURE__ */ jsxs("select", {
95
+ value: slug,
96
+ onChange: (e) => {
97
+ const next = getMitItemSpec2(e.target.value);
98
+ if (!next)
99
+ return;
100
+ patch({
101
+ slug: next.slug,
102
+ name: next.name,
103
+ category: next.category,
104
+ widthM: Math.min(20, Math.max(0.04, next.dimensions[0])),
105
+ heightM: Math.min(20, Math.max(0.01, next.dimensions[1])),
106
+ depthM: Math.min(20, Math.max(0.02, next.dimensions[2]))
107
+ });
108
+ },
109
+ style: inputStyle,
110
+ children: [
111
+ !spec && /* @__PURE__ */ jsxs("option", {
112
+ value: slug,
113
+ children: [
114
+ slug,
115
+ " (custom)"
116
+ ]
117
+ }),
118
+ MIT_ITEM_SPECS2.map((item) => /* @__PURE__ */ jsxs("option", {
119
+ value: item.slug,
120
+ children: [
121
+ item.name,
122
+ " (",
123
+ item.slug,
124
+ ")"
125
+ ]
126
+ }, item.slug))
127
+ ]
128
+ })
129
+ ]
130
+ }),
131
+ /* @__PURE__ */ jsxs("div", {
132
+ style: { display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 6 },
133
+ children: [
134
+ /* @__PURE__ */ jsxs("label", {
135
+ style: { display: "flex", flexDirection: "column", gap: 2 },
136
+ children: [
137
+ /* @__PURE__ */ jsx("span", {
138
+ children: "W (m)"
139
+ }),
140
+ /* @__PURE__ */ jsx("input", {
141
+ type: "number",
142
+ step: 0.05,
143
+ min: 0.04,
144
+ max: 20,
145
+ value: draftW,
146
+ onChange: (e) => {
147
+ const str = e.target.value;
148
+ setDraftW(str);
149
+ if (str.trim() === "")
150
+ return;
151
+ const v = Number(str);
152
+ if (Number.isFinite(v) && v >= 0.04 && v <= 20)
153
+ patch({ widthM: v });
154
+ },
155
+ onBlur: () => setDraftW(String(widthM)),
156
+ style: inputStyle
157
+ })
158
+ ]
159
+ }),
160
+ /* @__PURE__ */ jsxs("label", {
161
+ style: { display: "flex", flexDirection: "column", gap: 2 },
162
+ children: [
163
+ /* @__PURE__ */ jsx("span", {
164
+ children: "H (m)"
165
+ }),
166
+ /* @__PURE__ */ jsx("input", {
167
+ type: "number",
168
+ step: 0.05,
169
+ min: 0.01,
170
+ max: 20,
171
+ value: draftH,
172
+ onChange: (e) => {
173
+ const str = e.target.value;
174
+ setDraftH(str);
175
+ if (str.trim() === "")
176
+ return;
177
+ const v = Number(str);
178
+ if (Number.isFinite(v) && v >= 0.01 && v <= 20)
179
+ patch({ heightM: v });
180
+ },
181
+ onBlur: () => setDraftH(String(heightM)),
182
+ style: inputStyle
183
+ })
184
+ ]
185
+ }),
186
+ /* @__PURE__ */ jsxs("label", {
187
+ style: { display: "flex", flexDirection: "column", gap: 2 },
188
+ children: [
189
+ /* @__PURE__ */ jsx("span", {
190
+ children: "D (m)"
191
+ }),
192
+ /* @__PURE__ */ jsx("input", {
193
+ type: "number",
194
+ step: 0.05,
195
+ min: 0.02,
196
+ max: 20,
197
+ value: draftD,
198
+ onChange: (e) => {
199
+ const str = e.target.value;
200
+ setDraftD(str);
201
+ if (str.trim() === "")
202
+ return;
203
+ const v = Number(str);
204
+ if (Number.isFinite(v) && v >= 0.02 && v <= 20)
205
+ patch({ depthM: v });
206
+ },
207
+ onBlur: () => setDraftD(String(depthM)),
208
+ style: inputStyle
209
+ })
210
+ ]
211
+ })
212
+ ]
213
+ }),
214
+ /* @__PURE__ */ jsxs("label", {
215
+ style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8 },
216
+ children: [
217
+ /* @__PURE__ */ jsx("span", {
218
+ children: "Accent Finish"
219
+ }),
220
+ /* @__PURE__ */ jsx("input", {
221
+ type: "color",
222
+ value: accentColor,
223
+ onChange: (e) => {
224
+ if (/^#[0-9a-fA-F]{6}$/.test(e.target.value)) {
225
+ patch({ accentColor: e.target.value });
226
+ }
227
+ }
228
+ })
229
+ ]
230
+ }),
231
+ skuRec && /* @__PURE__ */ jsxs("div", {
232
+ style: {
233
+ padding: 8,
234
+ borderRadius: 4,
235
+ border: "1px solid #27272a",
236
+ display: "flex",
237
+ flexDirection: "column",
238
+ gap: 2
239
+ },
240
+ children: [
241
+ /* @__PURE__ */ jsxs("div", {
242
+ style: { display: "flex", justifyContent: "space-between", fontWeight: 600 },
243
+ children: [
244
+ /* @__PURE__ */ jsxs("span", {
245
+ children: [
246
+ skuRec.manufacturer,
247
+ " · ",
248
+ skuRec.sku
249
+ ]
250
+ }),
251
+ /* @__PURE__ */ jsxs("span", {
252
+ style: { color: "#22c55e" },
253
+ children: [
254
+ "$",
255
+ skuRec.estUnitPriceUsd.toFixed(2),
256
+ "/",
257
+ skuRec.unitOfMeasure
258
+ ]
259
+ })
260
+ ]
261
+ }),
262
+ /* @__PURE__ */ jsx("div", {
263
+ style: { fontSize: 11, opacity: 0.8 },
264
+ children: skuRec.productName
265
+ }),
266
+ /* @__PURE__ */ jsxs("div", {
267
+ style: { fontSize: 10, opacity: 0.65 },
268
+ children: [
269
+ "CSI ",
270
+ skuRec.csiDivision,
271
+ " · ",
272
+ skuRec.catalogSku ? "Linked to @kruschdev/pascal-plugin-catalog" : "MIT SKU Crosswalk"
273
+ ]
274
+ })
275
+ ]
276
+ }),
277
+ /* @__PURE__ */ jsx("div", {
278
+ style: { opacity: 0.75, fontSize: 11 },
279
+ children: "Procedural Three.js geometry — zero third-party GLB dependencies. Commercial SaaS ready."
280
+ })
281
+ ]
282
+ });
283
+ }
284
+ export {
285
+ MitAssetsInspectorCard as default
286
+ };