@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.
- package/ASSETS.md +298 -0
- package/LICENSE +21 -0
- package/README.md +71 -2
- package/dist/agent-operations.d.ts +8 -0
- package/dist/agent-operations.js +305 -0
- package/dist/agent-tools.d.ts +7 -0
- package/dist/agent-tools.js +128 -0
- package/dist/audit.d.ts +78 -0
- package/dist/bin/pascal-mit-assets.js +5238 -0
- package/dist/bom.d.ts +123 -0
- package/dist/cad/appliance-mep-builders.d.ts +7 -0
- package/dist/cad/furniture-builders.d.ts +9 -0
- package/dist/cad/index.d.ts +48 -0
- package/dist/cad/index.js +23 -0
- package/dist/cad/kitchen-bath-builders.d.ts +9 -0
- package/dist/cad/outdoor-fenestration-builders.d.ts +8 -0
- package/dist/cad/primitives.d.ts +56 -0
- package/dist/cad/props-vehicles-builders.d.ts +8 -0
- package/dist/chunk-2qgndrap.js +5200 -0
- package/dist/chunk-6hzyh6qv.js +346 -0
- package/dist/chunk-f72r2bmp.js +84 -0
- package/dist/chunk-hqgm57dv.js +310 -0
- package/dist/chunk-kgwk6kan.js +150 -0
- package/dist/chunk-raafkn3w.js +286 -0
- package/dist/chunk-vzmjt9dz.js +4380 -0
- package/dist/chunk-xhkwv6t4.js +5080 -0
- package/dist/hdri/index.d.ts +1 -0
- package/dist/hdri/index.js +322 -0
- package/dist/hdri/sky.d.ts +26 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +198 -0
- package/dist/manifest.d.ts +46 -0
- package/dist/materials/index.d.ts +10 -0
- package/dist/materials/index.js +1464 -0
- package/dist/materials/ktx2.d.ts +10 -0
- package/dist/materials/noise.d.ts +89 -0
- package/dist/materials/patterns.d.ts +15 -0
- package/dist/nodes/mit-item.d.ts +76 -0
- package/dist/render.d.ts +10 -0
- package/dist/render.js +24 -0
- package/dist/scripts/build-assets.js +17129 -0
- package/dist/sfx/index.d.ts +1 -0
- package/dist/sfx/index.js +1223 -0
- package/dist/sfx/synth.d.ts +25 -0
- package/dist/sku-crosswalk.d.ts +46 -0
- package/dist/ui/chat-card.d.ts +7 -0
- package/dist/ui/host-panel.d.ts +1 -0
- package/dist/ui/inspector-card.d.ts +4 -0
- package/dist/ui/schedule-view.d.ts +1 -0
- package/package.json +135 -4
- package/src/agent-operations.ts +373 -0
- package/src/agent-tools.ts +136 -0
- package/src/audit.ts +356 -0
- package/src/bom.ts +512 -0
- package/src/cad/appliance-mep-builders.ts +1336 -0
- package/src/cad/furniture-builders.ts +1622 -0
- package/src/cad/index.ts +993 -0
- package/src/cad/kitchen-bath-builders.ts +1189 -0
- package/src/cad/outdoor-fenestration-builders.ts +1499 -0
- package/src/cad/primitives.ts +286 -0
- package/src/cad/props-vehicles-builders.ts +1065 -0
- package/src/hdri/index.ts +5 -0
- package/src/hdri/sky.ts +481 -0
- package/src/index.ts +127 -0
- package/src/manifest.ts +5296 -0
- package/src/materials/index.ts +56 -0
- package/src/materials/ktx2.ts +138 -0
- package/src/materials/noise.ts +417 -0
- package/src/materials/patterns.ts +1507 -0
- package/src/nodes/mit-item.ts +163 -0
- package/src/render.ts +25 -0
- package/src/sfx/index.ts +6 -0
- package/src/sfx/synth.ts +1495 -0
- package/src/sku-crosswalk.ts +3868 -0
- package/src/ui/chat-card.tsx +93 -0
- package/src/ui/host-panel.tsx +330 -0
- package/src/ui/inspector-card.tsx +213 -0
- package/src/ui/schedule-view.tsx +188 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useScene } from '@pascal-app/editor'
|
|
4
|
+
import { useMemo, useState } from 'react'
|
|
5
|
+
import { auditSceneMitProvenance } from '../audit'
|
|
6
|
+
import { buildMitAssetsBom, formatMitAssetsBomCsv } from '../bom'
|
|
7
|
+
|
|
8
|
+
export default function MitAssetsScheduleView() {
|
|
9
|
+
const nodes = useScene((s) => s.nodes)
|
|
10
|
+
const [copied, setCopied] = useState(false)
|
|
11
|
+
|
|
12
|
+
const audit = useMemo(
|
|
13
|
+
() => auditSceneMitProvenance(nodes as unknown as Record<string, unknown>),
|
|
14
|
+
[nodes],
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
const bom = useMemo(
|
|
18
|
+
() => buildMitAssetsBom(nodes as unknown as Record<string, unknown>),
|
|
19
|
+
[nodes],
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
const copyCsv = async () => {
|
|
23
|
+
const csv = formatMitAssetsBomCsv(bom)
|
|
24
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard) {
|
|
25
|
+
await navigator.clipboard.writeText(csv)
|
|
26
|
+
setCopied(true)
|
|
27
|
+
setTimeout(() => setCopied(false), 1800)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div style={{ padding: 20, display: 'flex', flexDirection: 'column', gap: 18, fontSize: 13, overflowY: 'auto', height: '100%' }}>
|
|
33
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: 10 }}>
|
|
34
|
+
<div>
|
|
35
|
+
<h2 style={{ margin: 0, fontSize: 18 }}>MIT Asset Provenance & Real-SKU BOM</h2>
|
|
36
|
+
<p style={{ margin: '4px 0 0', opacity: 0.75 }}>
|
|
37
|
+
Clean-room MIT replacement coverage for pascalorg/editor#1327 ({audit.inventory.items} 3D items,{' '}
|
|
38
|
+
{audit.inventory.materials} PBR material packs, {audit.inventory.sfx} SFX cues, 1 procedural HDRI).
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
<span
|
|
42
|
+
style={{
|
|
43
|
+
padding: '6px 12px',
|
|
44
|
+
borderRadius: 6,
|
|
45
|
+
fontWeight: 700,
|
|
46
|
+
background: audit.commercialReady ? '#166534' : '#92400e',
|
|
47
|
+
color: '#fff',
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{audit.commercialReady
|
|
51
|
+
? 'COMMERCIAL MIT READY'
|
|
52
|
+
: `${audit.replaceableCount + audit.unmappedCount} NON-MIT ASSETS DETECTED`}
|
|
53
|
+
</span>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(140px, 1fr))', gap: 10 }}>
|
|
57
|
+
<div style={{ padding: 12, borderRadius: 6, border: '1px solid #27272a' }}>
|
|
58
|
+
<div style={{ fontSize: 11, opacity: 0.7 }}>Nodes Scanned</div>
|
|
59
|
+
<div style={{ fontSize: 22, fontWeight: 700 }}>{audit.totalNodesScanned}</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div style={{ padding: 12, borderRadius: 6, border: '1px solid #27272a' }}>
|
|
62
|
+
<div style={{ fontSize: 11, opacity: 0.7 }}>Clean MIT Nodes</div>
|
|
63
|
+
<div style={{ fontSize: 22, fontWeight: 700, color: '#22c55e' }}>{audit.mitCleanCount}</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div style={{ padding: 12, borderRadius: 6, border: '1px solid #27272a' }}>
|
|
66
|
+
<div style={{ fontSize: 11, opacity: 0.7 }}>1:1 Replaceable</div>
|
|
67
|
+
<div style={{ fontSize: 22, fontWeight: 700, color: '#f59e0b' }}>{audit.replaceableCount}</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div style={{ padding: 12, borderRadius: 6, border: '1px solid #27272a' }}>
|
|
70
|
+
<div style={{ fontSize: 11, opacity: 0.7 }}>Unmapped URLs</div>
|
|
71
|
+
<div style={{ fontSize: 22, fontWeight: 700, color: '#ef4444' }}>{audit.unmappedCount}</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div style={{ padding: 12, borderRadius: 6, border: '1px solid #27272a' }}>
|
|
74
|
+
<div style={{ fontSize: 11, opacity: 0.7 }}>Priced BOM Subtotal</div>
|
|
75
|
+
<div style={{ fontSize: 22, fontWeight: 700, color: '#22c55e' }}>
|
|
76
|
+
${bom.materialSubtotalUsd.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div>
|
|
82
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
|
|
83
|
+
<h3 style={{ margin: 0, fontSize: 14 }}>
|
|
84
|
+
Real-World Manufacturer SKU Schedule ({bom.lines.length} line{bom.lines.length === 1 ? '' : 's'})
|
|
85
|
+
</h3>
|
|
86
|
+
<button
|
|
87
|
+
type="button"
|
|
88
|
+
disabled={bom.lines.length === 0}
|
|
89
|
+
onClick={() => void copyCsv()}
|
|
90
|
+
style={{
|
|
91
|
+
padding: '4px 10px',
|
|
92
|
+
borderRadius: 4,
|
|
93
|
+
border: '1px solid #3f3f46',
|
|
94
|
+
background: 'transparent',
|
|
95
|
+
color: 'inherit',
|
|
96
|
+
fontSize: 11,
|
|
97
|
+
cursor: bom.lines.length === 0 ? 'not-allowed' : 'pointer',
|
|
98
|
+
opacity: bom.lines.length === 0 ? 0.5 : 1,
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
{copied ? 'Copied CSV' : 'Copy BOM CSV'}
|
|
102
|
+
</button>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div style={{ overflowX: 'auto' }}>
|
|
106
|
+
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: 12 }}>
|
|
107
|
+
<thead>
|
|
108
|
+
<tr style={{ textAlign: 'left', borderBottom: '1px solid #3f3f46' }}>
|
|
109
|
+
<th style={{ padding: 8 }}>CSI</th>
|
|
110
|
+
<th style={{ padding: 8 }}>SKU / Manufacturer</th>
|
|
111
|
+
<th style={{ padding: 8 }}>Description</th>
|
|
112
|
+
<th style={{ padding: 8, textAlign: 'right' }}>Qty</th>
|
|
113
|
+
<th style={{ padding: 8, textAlign: 'right' }}>Unit USD</th>
|
|
114
|
+
<th style={{ padding: 8, textAlign: 'right' }}>Extended USD</th>
|
|
115
|
+
</tr>
|
|
116
|
+
</thead>
|
|
117
|
+
<tbody>
|
|
118
|
+
{bom.lines.length === 0 ? (
|
|
119
|
+
<tr>
|
|
120
|
+
<td colSpan={6} style={{ padding: 14, textAlign: 'center', opacity: 0.7 }}>
|
|
121
|
+
Place any MIT Assets item from the sidebar to generate a priced real-world SKU BOM.
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
) : (
|
|
125
|
+
bom.lines.map((line) => (
|
|
126
|
+
<tr key={`${line.sku}-${line.slug}`} style={{ borderBottom: '1px solid #27272a' }}>
|
|
127
|
+
<td style={{ padding: 8, fontFamily: 'monospace', whiteSpace: 'nowrap' }}>{line.csiDivision}</td>
|
|
128
|
+
<td style={{ padding: 8, whiteSpace: 'nowrap' }}>
|
|
129
|
+
<strong>{line.manufacturer}</strong> · {line.sku}
|
|
130
|
+
</td>
|
|
131
|
+
<td style={{ padding: 8 }}>{line.name}</td>
|
|
132
|
+
<td style={{ padding: 8, textAlign: 'right', whiteSpace: 'nowrap' }}>
|
|
133
|
+
{line.quantity} {line.unitOfMeasure}
|
|
134
|
+
</td>
|
|
135
|
+
<td style={{ padding: 8, textAlign: 'right', whiteSpace: 'nowrap' }}>
|
|
136
|
+
${line.unitPriceUsd.toFixed(2)}
|
|
137
|
+
</td>
|
|
138
|
+
<td style={{ padding: 8, textAlign: 'right', fontWeight: 600, whiteSpace: 'nowrap' }}>
|
|
139
|
+
${line.extendedUsd.toFixed(2)}
|
|
140
|
+
</td>
|
|
141
|
+
</tr>
|
|
142
|
+
))
|
|
143
|
+
)}
|
|
144
|
+
</tbody>
|
|
145
|
+
</table>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div>
|
|
150
|
+
<h3 style={{ margin: '0 0 8px', fontSize: 14 }}>Provenance Audit Findings</h3>
|
|
151
|
+
<div style={{ overflowX: 'auto' }}>
|
|
152
|
+
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: 12 }}>
|
|
153
|
+
<thead>
|
|
154
|
+
<tr style={{ textAlign: 'left', borderBottom: '1px solid #3f3f46' }}>
|
|
155
|
+
<th style={{ padding: 8 }}>Node ID</th>
|
|
156
|
+
<th style={{ padding: 8 }}>Code</th>
|
|
157
|
+
<th style={{ padding: 8 }}>Matched Slug</th>
|
|
158
|
+
<th style={{ padding: 8 }}>Current URL</th>
|
|
159
|
+
<th style={{ padding: 8 }}>MIT Replacement</th>
|
|
160
|
+
</tr>
|
|
161
|
+
</thead>
|
|
162
|
+
<tbody>
|
|
163
|
+
{audit.findings.length === 0 ? (
|
|
164
|
+
<tr>
|
|
165
|
+
<td colSpan={5} style={{ padding: 16, textAlign: 'center', opacity: 0.7 }}>
|
|
166
|
+
No external or bundled non-MIT asset URLs found in the current scene.
|
|
167
|
+
</td>
|
|
168
|
+
</tr>
|
|
169
|
+
) : (
|
|
170
|
+
audit.findings.map((f, idx) => (
|
|
171
|
+
<tr key={`${f.nodeId}-${f.code}-${f.currentUrl}-${idx}`} style={{ borderBottom: '1px solid #27272a' }}>
|
|
172
|
+
<td style={{ padding: 8 }}>{f.nodeId}</td>
|
|
173
|
+
<td style={{ padding: 8 }}>{f.code}</td>
|
|
174
|
+
<td style={{ padding: 8 }}>{f.matchedSlug ?? '—'}</td>
|
|
175
|
+
<td style={{ padding: 8, wordBreak: 'break-all' }}>{f.currentUrl}</td>
|
|
176
|
+
<td style={{ padding: 8, wordBreak: 'break-all' }}>
|
|
177
|
+
{f.mitReplacementUrl ?? (f.code === 'MIT_PROCEDURAL_NODE' ? 'Procedural MIT' : '—')}
|
|
178
|
+
</td>
|
|
179
|
+
</tr>
|
|
180
|
+
))
|
|
181
|
+
)}
|
|
182
|
+
</tbody>
|
|
183
|
+
</table>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
)
|
|
188
|
+
}
|