@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,305 @@
1
+ import {
2
+ MIT_MATERIAL_SPECS2,
3
+ getMitItemSpec2
4
+ } from "./chunk-2qgndrap.js";
5
+ import {
6
+ searchMitItems2,
7
+ auditSceneMitProvenance2,
8
+ getMitAssetInventorySummary2,
9
+ buildMitAssetsBom2,
10
+ toMitAssetsPascalBom2,
11
+ formatMitAssetsBomCsv2
12
+ } from "./chunk-vzmjt9dz.js";
13
+
14
+ // src/agent-operations.ts
15
+ import { refuse } from "@pascal-app/core/agent-tools";
16
+ function asRecord(nodes) {
17
+ return nodes;
18
+ }
19
+ function resolveLevelId(nodes, requested, ctx) {
20
+ if (typeof requested === "string" && requested.trim()) {
21
+ const id = requested.trim();
22
+ const node = nodes[id];
23
+ return node?.type === "level" ? id : null;
24
+ }
25
+ if (ctx?.activeLevelId) {
26
+ const node = nodes[ctx.activeLevelId];
27
+ if (node?.type === "level")
28
+ return ctx.activeLevelId;
29
+ }
30
+ for (const [id, raw] of Object.entries(nodes)) {
31
+ if (raw && typeof raw === "object" && raw.type === "level") {
32
+ return id;
33
+ }
34
+ }
35
+ return null;
36
+ }
37
+ function nextNodeId(prefix, nodes) {
38
+ let i = 1;
39
+ while (Object.hasOwn(nodes, `${prefix}_${i}`))
40
+ i += 1;
41
+ return `${prefix}_${i}`;
42
+ }
43
+ function finiteRound3(v) {
44
+ const n = Number(v);
45
+ return Number.isFinite(n) ? round3(n) : 0;
46
+ }
47
+ function clampBounded(value, fallback, min, max) {
48
+ const raw = typeof value === "number" && Number.isFinite(value) ? value : fallback;
49
+ return round3(Math.min(max, Math.max(min, raw)));
50
+ }
51
+ function round3(n) {
52
+ return Math.round(n * 1000) / 1000;
53
+ }
54
+ var mitAssetsAgentOperations = {
55
+ mit_search_items: (_nodes, input) => {
56
+ const raw = input ?? {};
57
+ const query = typeof raw.query === "string" ? raw.query : "";
58
+ const category = typeof raw.category === "string" ? raw.category : undefined;
59
+ const limit = typeof raw.limit === "number" && Number.isFinite(raw.limit) ? Math.min(200, Math.max(1, Math.round(raw.limit))) : 50;
60
+ const results = searchMitItems2(query, category, limit);
61
+ return {
62
+ result: {
63
+ count: results.length,
64
+ inventory: getMitAssetInventorySummary2(),
65
+ items: results.map((s) => ({
66
+ slug: s.slug,
67
+ catalogId: s.catalogId,
68
+ name: s.name,
69
+ category: s.category,
70
+ dimensions: s.dimensions,
71
+ attachTo: s.attachTo,
72
+ license: "MIT"
73
+ }))
74
+ }
75
+ };
76
+ },
77
+ mit_list_materials: (_nodes, input) => {
78
+ const raw = input ?? {};
79
+ const category = typeof raw.category === "string" ? raw.category : undefined;
80
+ const query = typeof raw.query === "string" ? raw.query.trim().toLowerCase() : "";
81
+ const matches = MIT_MATERIAL_SPECS2.filter((m) => {
82
+ if (category && m.category !== category)
83
+ return false;
84
+ if (query && !`${m.id} ${m.category} ${m.pattern}`.toLowerCase().includes(query))
85
+ return false;
86
+ return true;
87
+ });
88
+ return {
89
+ result: {
90
+ count: matches.length,
91
+ materials: matches.map((m) => ({
92
+ id: m.id,
93
+ category: m.category,
94
+ pattern: m.pattern,
95
+ previewColor: m.previewColor,
96
+ ktx2Count: m.ktx2Files.length,
97
+ webpCount: m.webpFiles.length,
98
+ license: "MIT"
99
+ }))
100
+ }
101
+ };
102
+ },
103
+ mit_audit_scene: (nodes, input) => {
104
+ const raw = input ?? {};
105
+ const mitBaseUrl = typeof raw.mitBaseUrl === "string" ? raw.mitBaseUrl : "";
106
+ const audit = auditSceneMitProvenance2(asRecord(nodes), mitBaseUrl);
107
+ return { result: audit };
108
+ },
109
+ mit_place_item: (nodes, input, ctx) => {
110
+ const raw = input ?? {};
111
+ const nodeMap = asRecord(nodes);
112
+ const slug = typeof raw.slug === "string" ? raw.slug.trim() : "sofa";
113
+ const spec = getMitItemSpec2(slug);
114
+ if (!spec) {
115
+ refuse("unknown_mit_slug", `Unknown MIT item slug "${slug}". Call mit_search_items to list all 155 supported slugs.`);
116
+ }
117
+ const levelId = resolveLevelId(nodeMap, raw.levelId, ctx);
118
+ if (!levelId) {
119
+ refuse("missing_level", "No target level found in scene.");
120
+ }
121
+ const pos = Array.isArray(raw.position) && raw.position.length === 3 ? [
122
+ finiteRound3(raw.position[0]),
123
+ finiteRound3(raw.position[1]),
124
+ finiteRound3(raw.position[2])
125
+ ] : [0, 0, 0];
126
+ const rotation = finiteRound3(raw.rotation);
127
+ const widthM = clampBounded(raw.widthM, spec.dimensions[0], 0.04, 20);
128
+ const heightM = clampBounded(raw.heightM, spec.dimensions[1], 0.01, 20);
129
+ const depthM = clampBounded(raw.depthM, spec.dimensions[2], 0.02, 20);
130
+ const accentColor = typeof raw.accentColor === "string" && /^#[0-9a-fA-F]{6}$/.test(raw.accentColor) ? raw.accentColor : "#5c7285";
131
+ const id = nextNodeId("mititm", nodeMap);
132
+ const node = {
133
+ object: "node",
134
+ id,
135
+ type: "mit-assets:item",
136
+ name: typeof raw.name === "string" && raw.name.trim() ? raw.name.trim() : spec.name,
137
+ parentId: levelId,
138
+ visible: true,
139
+ metadata: {},
140
+ slug: spec.slug,
141
+ category: spec.category,
142
+ position: pos,
143
+ rotation,
144
+ widthM,
145
+ heightM,
146
+ depthM,
147
+ accentColor,
148
+ quantity: 1,
149
+ license: "MIT"
150
+ };
151
+ return {
152
+ changes: { create: [{ node, parentId: levelId }] },
153
+ result: {
154
+ createdId: id,
155
+ slug: spec.slug,
156
+ name: spec.name,
157
+ dimensions: [widthM, heightM, depthM],
158
+ license: "MIT"
159
+ }
160
+ };
161
+ },
162
+ mit_replace_scene_items: (nodes, input) => {
163
+ const raw = input ?? {};
164
+ const nodeMap = asRecord(nodes);
165
+ const dryRun = Boolean(raw.dryRun);
166
+ const mitBaseUrl = typeof raw.mitBaseUrl === "string" ? raw.mitBaseUrl : "";
167
+ const audit = auditSceneMitProvenance2(nodeMap, mitBaseUrl);
168
+ const replaceable = audit.findings.filter((f) => (f.code === "EXTERNAL_SUPABASE_ASSET" || f.code === "BUNDLED_UNLICENSED_ITEM") && f.matchedSlug);
169
+ if (dryRun || replaceable.length === 0) {
170
+ return {
171
+ result: {
172
+ dryRun,
173
+ convertedCount: 0,
174
+ candidateCount: replaceable.length,
175
+ candidates: replaceable.map((f) => ({
176
+ nodeId: f.nodeId,
177
+ matchedSlug: f.matchedSlug,
178
+ currentUrl: f.currentUrl
179
+ }))
180
+ }
181
+ };
182
+ }
183
+ const create = [];
184
+ const update = [];
185
+ const del = [];
186
+ const converted = [];
187
+ const oldToNewId = new Map;
188
+ const simulated = { ...nodeMap };
189
+ for (const finding of replaceable) {
190
+ const existing = nodeMap[finding.nodeId];
191
+ const spec = finding.matchedSlug ? getMitItemSpec2(finding.matchedSlug) : undefined;
192
+ if (!existing || !spec)
193
+ continue;
194
+ const parentId = typeof existing.parentId === "string" && existing.parentId.length > 0 ? existing.parentId : null;
195
+ const pos = Array.isArray(existing.position) && existing.position.length === 3 ? existing.position.map((v) => finiteRound3(v)) : [0, 0, 0];
196
+ const rotY = Array.isArray(existing.rotation) && existing.rotation.length === 3 ? finiteRound3(existing.rotation[1]) : finiteRound3(existing.rotation);
197
+ const assetObj = existing.asset && typeof existing.asset === "object" ? existing.asset : null;
198
+ const assetDims = Array.isArray(assetObj?.dimensions) && assetObj.dimensions.length === 3 ? assetObj.dimensions.map((v) => Number(v)) : null;
199
+ const existingScale = Array.isArray(existing.scale) && existing.scale.length === 3 ? existing.scale.map((v) => typeof v === "number" && Number.isFinite(v) && Math.abs(v) > 0 ? Math.abs(v) : 1) : [1, 1, 1];
200
+ const baseW = assetDims && Number.isFinite(assetDims[0]) && assetDims[0] > 0 ? assetDims[0] : spec.dimensions[0];
201
+ const baseH = assetDims && Number.isFinite(assetDims[1]) && assetDims[1] > 0 ? assetDims[1] : spec.dimensions[1];
202
+ const baseD = assetDims && Number.isFinite(assetDims[2]) && assetDims[2] > 0 ? assetDims[2] : spec.dimensions[2];
203
+ const preservedMetadata = existing.metadata && typeof existing.metadata === "object" && !Array.isArray(existing.metadata) ? { ...existing.metadata } : {};
204
+ const preservedQty = typeof existing.quantity === "number" && Number.isFinite(existing.quantity) && existing.quantity >= 1 ? Math.min(500, Math.round(existing.quantity)) : 1;
205
+ const preservedPrice = typeof existing.unitPriceOverrideUsd === "number" && Number.isFinite(existing.unitPriceOverrideUsd) && existing.unitPriceOverrideUsd >= 0 ? existing.unitPriceOverrideUsd : undefined;
206
+ const newId = nextNodeId("mititm", simulated);
207
+ simulated[newId] = { id: newId };
208
+ oldToNewId.set(finding.nodeId, newId);
209
+ const newNode = {
210
+ object: "node",
211
+ id: newId,
212
+ type: "mit-assets:item",
213
+ name: typeof existing.name === "string" && existing.name.trim() ? existing.name : spec.name,
214
+ parentId,
215
+ visible: existing.visible !== false,
216
+ metadata: preservedMetadata,
217
+ slug: spec.slug,
218
+ category: spec.category,
219
+ position: pos,
220
+ rotation: rotY,
221
+ widthM: clampBounded(baseW * existingScale[0], spec.dimensions[0], 0.04, 20),
222
+ heightM: clampBounded(baseH * existingScale[1], spec.dimensions[1], 0.01, 20),
223
+ depthM: clampBounded(baseD * existingScale[2], spec.dimensions[2], 0.02, 20),
224
+ accentColor: "#5c7285",
225
+ quantity: preservedQty,
226
+ ...preservedPrice !== undefined ? { unitPriceOverrideUsd: preservedPrice } : {},
227
+ license: "MIT"
228
+ };
229
+ create.push(parentId !== null ? { node: newNode, parentId } : { node: newNode });
230
+ del.push(finding.nodeId);
231
+ converted.push({ oldId: finding.nodeId, newId, slug: spec.slug });
232
+ }
233
+ for (const entry of create) {
234
+ const n = entry.node;
235
+ if (n.parentId && oldToNewId.has(n.parentId)) {
236
+ const remapped = oldToNewId.get(n.parentId);
237
+ n.parentId = remapped;
238
+ entry.parentId = remapped;
239
+ }
240
+ }
241
+ const createdById = new Map(create.map((e) => [String(e.node.id), e]));
242
+ const orderedCreate = [];
243
+ const visited = new Set;
244
+ const visiting = new Set;
245
+ const visit = (id) => {
246
+ if (visited.has(id) || visiting.has(id))
247
+ return;
248
+ const entry = createdById.get(id);
249
+ if (!entry)
250
+ return;
251
+ visiting.add(id);
252
+ const pId = entry.node.parentId;
253
+ if (pId && createdById.has(pId))
254
+ visit(pId);
255
+ visiting.delete(id);
256
+ visited.add(id);
257
+ orderedCreate.push(entry);
258
+ };
259
+ for (const id of createdById.keys())
260
+ visit(id);
261
+ for (const [childId, rawChild] of Object.entries(nodeMap)) {
262
+ if (oldToNewId.has(childId) || !rawChild || typeof rawChild !== "object")
263
+ continue;
264
+ const pId = rawChild.parentId;
265
+ if (typeof pId === "string" && oldToNewId.has(pId)) {
266
+ update.push({
267
+ id: childId,
268
+ data: { parentId: oldToNewId.get(pId) }
269
+ });
270
+ }
271
+ }
272
+ return {
273
+ ...converted.length > 0 ? { changes: { create: orderedCreate, ...update.length > 0 ? { update } : {}, delete: del } } : {},
274
+ result: {
275
+ dryRun: false,
276
+ convertedCount: converted.length,
277
+ converted
278
+ }
279
+ };
280
+ },
281
+ mit_schedule_bom: (nodes, input) => {
282
+ const raw = input ?? {};
283
+ const markupPct = typeof raw.markupPct === "number" && Number.isFinite(raw.markupPct) ? raw.markupPct : 0;
284
+ const salesTaxPct = typeof raw.salesTaxPct === "number" && Number.isFinite(raw.salesTaxPct) ? raw.salesTaxPct : 0;
285
+ const includeMappedPascalItems = raw.includeMappedPascalItems !== false;
286
+ const includeCsv = raw.includeCsv !== false;
287
+ const bom = buildMitAssetsBom2(asRecord(nodes), {
288
+ markupPct,
289
+ salesTaxPct,
290
+ includeMappedPascalItems
291
+ });
292
+ return {
293
+ result: {
294
+ bom,
295
+ pascalBomFragment: toMitAssetsPascalBom2(bom),
296
+ ...includeCsv ? { csv: formatMitAssetsBomCsv2(bom) } : {}
297
+ }
298
+ };
299
+ }
300
+ };
301
+ var agent_operations_default = mitAssetsAgentOperations;
302
+ export {
303
+ agent_operations_default as default,
304
+ mitAssetsAgentOperations
305
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Pure Zod-only Agent Tool Contracts (`@kruschdev/pascal-plugin-mit-assets/agent-tools`).
3
+ * Conforms to Pascal DECISIONS.md E-016: zero Three.js, React, viewer, or editor imports.
4
+ */
5
+ import type { PluginAgentTools } from '@pascal-app/core/agent-tools';
6
+ export declare const mitAssetsAgentTools: PluginAgentTools;
7
+ export default mitAssetsAgentTools;
@@ -0,0 +1,128 @@
1
+ import {
2
+ MIT_ITEM_SPECS2,
3
+ MIT_MATERIAL_SPECS2,
4
+ MIT_SFX_SPECS2
5
+ } from "./chunk-2qgndrap.js";
6
+
7
+ // src/agent-tools.ts
8
+ import { z } from "zod";
9
+ var ITEM_CATEGORIES = [
10
+ "furniture",
11
+ "appliance",
12
+ "bathroom",
13
+ "kitchen",
14
+ "outdoor",
15
+ "architectural"
16
+ ];
17
+ var MATERIAL_CATEGORIES = [
18
+ "concrete",
19
+ "fabric",
20
+ "flooring",
21
+ "leather",
22
+ "metal",
23
+ "roofing",
24
+ "siding",
25
+ "wood"
26
+ ];
27
+ var Vec3 = z.tuple([z.number().finite(), z.number().finite(), z.number().finite()]);
28
+ var mitAssetsAgentTools = {
29
+ pluginId: "krusch:mit-assets",
30
+ apiVersion: 1,
31
+ version: "0.1.0",
32
+ instructions: `100% clean-room MIT asset replacement plugin solving pascalorg/editor#1327: ${MIT_ITEM_SPECS2.length} parametric 3D procedural items, ${MIT_MATERIAL_SPECS2.length} procedural PBR material packs (.ktx2/.webp), ${MIT_SFX_SPECS2.length} synthesized DSP SFX cues, and procedural Radiance RGBE sunset HDRI.`,
33
+ skills: [
34
+ {
35
+ name: "mit-commercial-asset-migration",
36
+ summary: "Audit a Pascal scene for non-MIT Supabase/bundled assets and replace them with 100% MIT procedural nodes or drop-in asset URLs",
37
+ body: [
38
+ "1. Call `mit_audit_scene` to scan the active scene for external Supabase or unattributed bundled asset URLs.",
39
+ "2. Call `mit_search_items` or `mit_list_materials` to inspect the 155 MIT 3D items and 68 MIT PBR material packs.",
40
+ "3. Call `mit_place_item` to insert a clean-room MIT procedural `mit-assets:item` node directly into a level.",
41
+ "4. Call `mit_replace_scene_items` to convert existing Supabase/bundled `item` nodes into clean-room MIT `mit-assets:item` nodes in a single undo step."
42
+ ].join(`
43
+ `)
44
+ }
45
+ ],
46
+ tools: [
47
+ {
48
+ name: "mit_search_items",
49
+ title: `Search ${MIT_ITEM_SPECS2.length} clean-room MIT 3D items`,
50
+ description: "Search all 155 clean-room MIT procedural 3D item replacements matching Pascal Editor items/ and CATALOG_ITEMS.",
51
+ runsIn: "operation",
52
+ input: {
53
+ query: z.string().default(""),
54
+ category: z.enum(ITEM_CATEGORIES).optional(),
55
+ limit: z.number().int().min(1).max(200).default(50)
56
+ },
57
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
58
+ },
59
+ {
60
+ name: "mit_list_materials",
61
+ title: `List ${MIT_MATERIAL_SPECS2.length} clean-room MIT PBR material packs`,
62
+ description: "List procedural PBR texture packs (albedo, normal, roughness, AO, metallic) replacing apps/editor/public/material/.",
63
+ runsIn: "operation",
64
+ input: {
65
+ category: z.enum(MATERIAL_CATEGORIES).optional(),
66
+ query: z.string().default("")
67
+ },
68
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
69
+ },
70
+ {
71
+ name: "mit_audit_scene",
72
+ title: "Audit scene for non-MIT / external Supabase assets",
73
+ description: "Scan every node in the active Pascal scene to detect external Supabase URLs or bundled unlicensed assets and report 1:1 MIT replacements.",
74
+ runsIn: "operation",
75
+ input: {
76
+ mitBaseUrl: z.string().default("")
77
+ },
78
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
79
+ },
80
+ {
81
+ name: "mit_place_item",
82
+ title: "Place a clean-room MIT procedural 3D item",
83
+ description: "Insert a self-contained clean-room MIT `mit-assets:item` node (zero external GLB fetch required) on a level.",
84
+ runsIn: "operation",
85
+ input: {
86
+ levelId: z.string().optional(),
87
+ slug: z.string().min(1).default("sofa"),
88
+ name: z.string().optional(),
89
+ position: Vec3.optional(),
90
+ rotation: z.number().finite().default(0),
91
+ widthM: z.number().finite().min(0.04).max(20).optional(),
92
+ heightM: z.number().finite().min(0.01).max(20).optional(),
93
+ depthM: z.number().finite().min(0.02).max(20).optional(),
94
+ accentColor: z.string().regex(/^#[0-9a-fA-F]{6}$/).optional()
95
+ },
96
+ annotations: { destructiveHint: false, idempotentHint: false }
97
+ },
98
+ {
99
+ name: "mit_replace_scene_items",
100
+ title: "Replace non-MIT item nodes with clean-room MIT nodes",
101
+ description: "Convert scene `item` nodes referencing Pascal Supabase or bundled /items/ GLBs into clean-room MIT `mit-assets:item` nodes (preserving position, rotation, dimensions, and parent level).",
102
+ runsIn: "operation",
103
+ input: {
104
+ dryRun: z.boolean().default(false),
105
+ mitBaseUrl: z.string().default("")
106
+ },
107
+ annotations: { destructiveHint: true, idempotentHint: true }
108
+ },
109
+ {
110
+ name: "mit_schedule_bom",
111
+ title: "Generate priced Real-SKU CSI BOM & CSV for MIT assets",
112
+ description: "Compile placed mit-assets:item nodes (and optional mapped Pascal items + material quantities) into a real-world SKU priced BOM, pascal-bom/1.1 fragment, and formula-safe CSV.",
113
+ runsIn: "operation",
114
+ input: {
115
+ markupPct: z.number().finite().min(0).max(100).default(0),
116
+ salesTaxPct: z.number().finite().min(0).max(25).default(0),
117
+ includeMappedPascalItems: z.boolean().default(true),
118
+ includeCsv: z.boolean().default(true)
119
+ },
120
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
121
+ }
122
+ ]
123
+ };
124
+ var agent_tools_default = mitAssetsAgentTools;
125
+ export {
126
+ agent_tools_default as default,
127
+ mitAssetsAgentTools
128
+ };
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Pure headless MIT Asset Provenance & Commercial Readiness Audit (`src/audit.ts`).
3
+ * Scans any Pascal scene graph to identify non-MIT / external Supabase / unattributed
4
+ * asset URLs and maps them 1:1 to clean-room MIT replacements in `@kruschdev/pascal-plugin-mit-assets`.
5
+ *
6
+ * Strictly pure TypeScript: zero React, Three.js, viewer, editor, or node:* imports.
7
+ */
8
+ import { type MitItemSpec } from './manifest';
9
+ export type MitAuditFindingSeverity = 'info' | 'warning' | 'action-required';
10
+ export type MitAuditFinding = {
11
+ readonly nodeId: string;
12
+ readonly nodeType: string;
13
+ readonly severity: MitAuditFindingSeverity;
14
+ readonly code: 'EXTERNAL_SUPABASE_ASSET' | 'BUNDLED_UNLICENSED_ITEM' | 'BUNDLED_UNLICENSED_MATERIAL' | 'MIT_PROCEDURAL_NODE' | 'UNMAPPED_CUSTOM_URL';
15
+ readonly currentUrl: string;
16
+ readonly matchedSlug?: string;
17
+ readonly mitReplacementUrl?: string;
18
+ readonly message: string;
19
+ };
20
+ export type MitSceneAuditSummary = {
21
+ readonly totalNodesScanned: number;
22
+ readonly mitCleanCount: number;
23
+ readonly replaceableCount: number;
24
+ readonly unmappedCount: number;
25
+ readonly commercialReady: boolean;
26
+ readonly findings: readonly MitAuditFinding[];
27
+ readonly inventory: {
28
+ readonly items: number;
29
+ readonly materials: number;
30
+ readonly sfx: number;
31
+ readonly hdri: number;
32
+ };
33
+ };
34
+ export type MitCatalogItemEntry = {
35
+ readonly id: string;
36
+ readonly slug: string;
37
+ readonly category: string;
38
+ readonly name: string;
39
+ readonly tags: readonly string[];
40
+ readonly thumbnail: string;
41
+ readonly src: string;
42
+ readonly floorPlanUrl: string;
43
+ readonly dimensions: readonly [number, number, number];
44
+ readonly offset: readonly [number, number, number];
45
+ readonly rotation: readonly [number, number, number];
46
+ readonly scale: readonly [number, number, number];
47
+ readonly attachTo?: 'wall' | 'wall-side' | 'ceiling';
48
+ readonly surface?: {
49
+ readonly height: number;
50
+ };
51
+ readonly license: 'MIT';
52
+ };
53
+ export declare function normalizeBaseUrl(baseUrl: string): string;
54
+ export declare function resolveMitItemUrl(slug: string, baseUrl?: string): string;
55
+ export declare function resolveMitThumbnailUrl(slug: string, baseUrl?: string): string;
56
+ export declare function resolveMitFloorPlanUrl(slug: string, baseUrl?: string): string;
57
+ /**
58
+ * Drop-in MIT replacement for `@pascal-app/editor`'s `CATALOG_ITEMS` array.
59
+ * Points every item at self-hosted MIT paths (`${baseUrl}/items/<slug>/...`) instead of Supabase.
60
+ */
61
+ export declare function buildMitCatalogItems(baseUrl?: string, includePublicOnly?: boolean): MitCatalogItemEntry[];
62
+ export declare function searchMitItems(query?: string, category?: MitItemSpec['category'], limit?: number): MitItemSpec[];
63
+ /**
64
+ * Audits a Pascal scene node map (`Record<string, unknown>`) for non-MIT asset URLs
65
+ * (e.g. Pascal's Supabase item URLs or unattributed `/items/` and `/material/` paths)
66
+ * and computes exact 1:1 clean-room MIT replacement paths.
67
+ */
68
+ export declare function auditSceneMitProvenance(nodes: Readonly<Record<string, unknown>>, mitBaseUrl?: string): MitSceneAuditSummary;
69
+ export declare function getMitAssetInventorySummary(): {
70
+ license: "MIT";
71
+ issueReference: string;
72
+ items: number;
73
+ catalogItems: number;
74
+ publicItems: number;
75
+ materials: number;
76
+ sfx: number;
77
+ hdri: "/hdri/venice_sunset_1k.hdr";
78
+ };