@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,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mit-assets:item` — Clean-Room MIT Procedural 3D Asset Node.
|
|
3
|
+
* Strictly editor-free & React-free so `@kruschdev/pascal-plugin-mit-assets/render` stays viewer-pure.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
BaseNode,
|
|
8
|
+
type FloorplanGeometry,
|
|
9
|
+
type GeometryContext,
|
|
10
|
+
type NodeDefinition,
|
|
11
|
+
type NodePort,
|
|
12
|
+
type ParametricDescriptor,
|
|
13
|
+
nodeType,
|
|
14
|
+
objectId,
|
|
15
|
+
} from '@pascal-app/core'
|
|
16
|
+
import { Group } from 'three'
|
|
17
|
+
import { z } from 'zod'
|
|
18
|
+
import { buildMitItemCad } from '../cad/index'
|
|
19
|
+
import { getMitItemSpec } from '../manifest'
|
|
20
|
+
|
|
21
|
+
export const MitAssetsItemNode = BaseNode.extend({
|
|
22
|
+
id: objectId('mititm'),
|
|
23
|
+
type: nodeType('mit-assets:item'),
|
|
24
|
+
slug: z.string().min(1).default('sofa'),
|
|
25
|
+
category: z
|
|
26
|
+
.enum(['furniture', 'appliance', 'bathroom', 'kitchen', 'outdoor', 'architectural'])
|
|
27
|
+
.default('furniture'),
|
|
28
|
+
position: z.tuple([z.number().finite(), z.number().finite(), z.number().finite()]).default([0, 0, 0]),
|
|
29
|
+
rotation: z.number().finite().default(0),
|
|
30
|
+
widthM: z.number().finite().min(0.04).max(20).default(2.06),
|
|
31
|
+
heightM: z.number().finite().min(0.01).max(20).default(0.74),
|
|
32
|
+
depthM: z.number().finite().min(0.02).max(20).default(1.01),
|
|
33
|
+
accentColor: z.string().regex(/^#[0-9a-fA-F]{6}$/).default('#5c7285'),
|
|
34
|
+
quantity: z.number().int().min(1).max(500).default(1),
|
|
35
|
+
unitPriceOverrideUsd: z.number().finite().min(0).optional(),
|
|
36
|
+
license: z.literal('MIT').default('MIT'),
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
export type MitAssetsItemNode = z.infer<typeof MitAssetsItemNode>
|
|
40
|
+
|
|
41
|
+
export function getMitAssetsItemPorts(node: MitAssetsItemNode): NodePort[] {
|
|
42
|
+
const [x, y, zPos] = node.position
|
|
43
|
+
return [{ id: 'base-center', position: [x, y, zPos], direction: [0, 1, 0], diameter: 0.05 }]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function hexStringToInt(hex: string): number {
|
|
47
|
+
const cleaned = hex.replace(/^#/, '')
|
|
48
|
+
const parsed = Number.parseInt(cleaned, 16)
|
|
49
|
+
return Number.isFinite(parsed) ? parsed : 0x5c7285
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function buildMitAssetsItemGeometry(
|
|
53
|
+
node: MitAssetsItemNode,
|
|
54
|
+
_ctx?: GeometryContext,
|
|
55
|
+
): Group {
|
|
56
|
+
const spec = getMitItemSpec(node.slug)
|
|
57
|
+
const slug = spec?.slug ?? 'sofa'
|
|
58
|
+
return buildMitItemCad(slug, {
|
|
59
|
+
widthM: node.widthM,
|
|
60
|
+
heightM: node.heightM,
|
|
61
|
+
depthM: node.depthM,
|
|
62
|
+
accentHex: hexStringToInt(node.accentColor),
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function buildMitAssetsItemFloorplan(
|
|
67
|
+
node: MitAssetsItemNode,
|
|
68
|
+
_ctx?: GeometryContext,
|
|
69
|
+
): FloorplanGeometry {
|
|
70
|
+
const cx = node.position[0]
|
|
71
|
+
const cz = node.position[2]
|
|
72
|
+
const cos = Math.cos(node.rotation)
|
|
73
|
+
const sin = Math.sin(node.rotation)
|
|
74
|
+
const hw = node.widthM / 2
|
|
75
|
+
const hd = node.depthM / 2
|
|
76
|
+
const stroke = '#16a34a'
|
|
77
|
+
|
|
78
|
+
const localCorners: readonly (readonly [number, number])[] = [
|
|
79
|
+
[-hw, -hd],
|
|
80
|
+
[hw, -hd],
|
|
81
|
+
[hw, hd],
|
|
82
|
+
[-hw, hd],
|
|
83
|
+
]
|
|
84
|
+
const corners: [number, number][] = localCorners.map(([lx, lz]) => [
|
|
85
|
+
cx + lx * cos + lz * sin,
|
|
86
|
+
cz - lx * sin + lz * cos,
|
|
87
|
+
])
|
|
88
|
+
return {
|
|
89
|
+
kind: 'group',
|
|
90
|
+
children: [{ kind: 'polygon', points: corners, stroke, strokeWidth: 0.025, fill: '#16a34a22' }],
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const mitAssetsItemParametrics: ParametricDescriptor<MitAssetsItemNode> = {
|
|
95
|
+
groups: [
|
|
96
|
+
{
|
|
97
|
+
label: 'Dimensions',
|
|
98
|
+
fields: [
|
|
99
|
+
{ key: 'widthM', kind: 'number', label: 'Width', unit: 'm', min: 0.04, max: 20, step: 0.05 },
|
|
100
|
+
{ key: 'heightM', kind: 'number', label: 'Height', unit: 'm', min: 0.01, max: 20, step: 0.05 },
|
|
101
|
+
{ key: 'depthM', kind: 'number', label: 'Depth', unit: 'm', min: 0.02, max: 20, step: 0.05 },
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: 'Appearance & BOM',
|
|
106
|
+
fields: [
|
|
107
|
+
{ key: 'accentColor', kind: 'color', label: 'Accent Finish' },
|
|
108
|
+
{ key: 'quantity', kind: 'number', label: 'Quantity', min: 1, max: 500, step: 1 },
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: 'Position',
|
|
113
|
+
fields: [{ key: 'position', kind: 'vec3', label: 'Position' }],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const mitAssetsItemRenderDefinition: NodeDefinition<typeof MitAssetsItemNode> = {
|
|
119
|
+
kind: 'mit-assets:item',
|
|
120
|
+
schemaVersion: 1,
|
|
121
|
+
schema: MitAssetsItemNode,
|
|
122
|
+
category: 'furnish',
|
|
123
|
+
defaults: () => ({
|
|
124
|
+
object: 'node',
|
|
125
|
+
parentId: null,
|
|
126
|
+
visible: true,
|
|
127
|
+
metadata: {},
|
|
128
|
+
name: 'Sofa',
|
|
129
|
+
slug: 'sofa',
|
|
130
|
+
category: 'furniture',
|
|
131
|
+
position: [0, 0, 0],
|
|
132
|
+
rotation: 0,
|
|
133
|
+
widthM: 2.06,
|
|
134
|
+
heightM: 0.74,
|
|
135
|
+
depthM: 1.01,
|
|
136
|
+
accentColor: '#5c7285',
|
|
137
|
+
quantity: 1,
|
|
138
|
+
license: 'MIT',
|
|
139
|
+
}),
|
|
140
|
+
capabilities: {
|
|
141
|
+
selectable: { hitVolume: 'bbox' },
|
|
142
|
+
movable: { axes: ['x', 'y', 'z'], gridSnap: true },
|
|
143
|
+
rotatable: { axes: ['y'], snapAngles: [Math.PI / 4] },
|
|
144
|
+
duplicable: true,
|
|
145
|
+
deletable: true,
|
|
146
|
+
snappable: {},
|
|
147
|
+
},
|
|
148
|
+
geometry: buildMitAssetsItemGeometry,
|
|
149
|
+
geometryKey: (n) => JSON.stringify([n.slug, n.widthM, n.heightM, n.depthM, n.accentColor]),
|
|
150
|
+
floorplan: buildMitAssetsItemFloorplan,
|
|
151
|
+
parametrics: mitAssetsItemParametrics,
|
|
152
|
+
presentation: {
|
|
153
|
+
label: 'Clean-Room MIT 3D Item',
|
|
154
|
+
description:
|
|
155
|
+
'100% clean-room MIT procedural 3D item replacing bundled Pascal Editor items/ & CATALOG_ITEMS with real-world SKU pricing.',
|
|
156
|
+
icon: { kind: 'iconify', name: 'lucide:shield-check' },
|
|
157
|
+
paletteSection: 'furnish',
|
|
158
|
+
},
|
|
159
|
+
mcp: {
|
|
160
|
+
description:
|
|
161
|
+
'Clean-room MIT procedural 3D item supporting all 155 Pascal Editor item slugs with real-world SKU & BOM pricing.',
|
|
162
|
+
},
|
|
163
|
+
}
|
package/src/render.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only viewer entry (`@kruschdev/pascal-plugin-mit-assets/render`).
|
|
3
|
+
* Strictly editor-free: zero `@pascal-app/editor` or `next` imports (verified by `bun run check:render`).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AnyNodeDefinition, Plugin } from '@pascal-app/core'
|
|
7
|
+
import { mitAssetsItemRenderDefinition } from './nodes/mit-item'
|
|
8
|
+
|
|
9
|
+
export const MIT_ASSETS_PLUGIN_ID = 'krusch:mit-assets' as const
|
|
10
|
+
export const MIT_ASSETS_SCHEDULE_VIEW_ID = 'krusch:mit-assets:audit' as const
|
|
11
|
+
|
|
12
|
+
export const mitAssetsRenderPlugin: Plugin = {
|
|
13
|
+
id: MIT_ASSETS_PLUGIN_ID,
|
|
14
|
+
apiVersion: 1,
|
|
15
|
+
nodes: [mitAssetsItemRenderDefinition as unknown as AnyNodeDefinition],
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default mitAssetsRenderPlugin
|
|
19
|
+
export {
|
|
20
|
+
MitAssetsItemNode,
|
|
21
|
+
mitAssetsItemRenderDefinition,
|
|
22
|
+
buildMitAssetsItemGeometry,
|
|
23
|
+
buildMitAssetsItemFloorplan,
|
|
24
|
+
getMitAssetsItemPorts,
|
|
25
|
+
} from './nodes/mit-item'
|