@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,346 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import"./chunk-2qgndrap.js";
|
|
3
|
+
import {
|
|
4
|
+
auditSceneMitProvenance2,
|
|
5
|
+
buildMitAssetsBom2,
|
|
6
|
+
formatMitAssetsBomCsv2
|
|
7
|
+
} from "./chunk-vzmjt9dz.js";
|
|
8
|
+
|
|
9
|
+
// src/ui/schedule-view.tsx
|
|
10
|
+
import { useScene } from "@pascal-app/editor";
|
|
11
|
+
import { useMemo, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function MitAssetsScheduleView() {
|
|
14
|
+
const nodes = useScene((s) => s.nodes);
|
|
15
|
+
const [copied, setCopied] = useState(false);
|
|
16
|
+
const audit = useMemo(() => auditSceneMitProvenance2(nodes), [nodes]);
|
|
17
|
+
const bom = useMemo(() => buildMitAssetsBom2(nodes), [nodes]);
|
|
18
|
+
const copyCsv = async () => {
|
|
19
|
+
const csv = formatMitAssetsBomCsv2(bom);
|
|
20
|
+
if (typeof navigator !== "undefined" && navigator.clipboard) {
|
|
21
|
+
await navigator.clipboard.writeText(csv);
|
|
22
|
+
setCopied(true);
|
|
23
|
+
setTimeout(() => setCopied(false), 1800);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
style: { padding: 20, display: "flex", flexDirection: "column", gap: 18, fontSize: 13, overflowY: "auto", height: "100%" },
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", {
|
|
30
|
+
style: { display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: 10 },
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", {
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx("h2", {
|
|
35
|
+
style: { margin: 0, fontSize: 18 },
|
|
36
|
+
children: "MIT Asset Provenance & Real-SKU BOM"
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsxs("p", {
|
|
39
|
+
style: { margin: "4px 0 0", opacity: 0.75 },
|
|
40
|
+
children: [
|
|
41
|
+
"Clean-room MIT replacement coverage for pascalorg/editor#1327 (",
|
|
42
|
+
audit.inventory.items,
|
|
43
|
+
" 3D items,",
|
|
44
|
+
" ",
|
|
45
|
+
audit.inventory.materials,
|
|
46
|
+
" PBR material packs, ",
|
|
47
|
+
audit.inventory.sfx,
|
|
48
|
+
" SFX cues, 1 procedural HDRI)."
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsx("span", {
|
|
54
|
+
style: {
|
|
55
|
+
padding: "6px 12px",
|
|
56
|
+
borderRadius: 6,
|
|
57
|
+
fontWeight: 700,
|
|
58
|
+
background: audit.commercialReady ? "#166534" : "#92400e",
|
|
59
|
+
color: "#fff"
|
|
60
|
+
},
|
|
61
|
+
children: audit.commercialReady ? "COMMERCIAL MIT READY" : `${audit.replaceableCount + audit.unmappedCount} NON-MIT ASSETS DETECTED`
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(140px, 1fr))", gap: 10 },
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsxs("div", {
|
|
69
|
+
style: { padding: 12, borderRadius: 6, border: "1px solid #27272a" },
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx("div", {
|
|
72
|
+
style: { fontSize: 11, opacity: 0.7 },
|
|
73
|
+
children: "Nodes Scanned"
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsx("div", {
|
|
76
|
+
style: { fontSize: 22, fontWeight: 700 },
|
|
77
|
+
children: audit.totalNodesScanned
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", {
|
|
82
|
+
style: { padding: 12, borderRadius: 6, border: "1px solid #27272a" },
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsx("div", {
|
|
85
|
+
style: { fontSize: 11, opacity: 0.7 },
|
|
86
|
+
children: "Clean MIT Nodes"
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx("div", {
|
|
89
|
+
style: { fontSize: 22, fontWeight: 700, color: "#22c55e" },
|
|
90
|
+
children: audit.mitCleanCount
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", {
|
|
95
|
+
style: { padding: 12, borderRadius: 6, border: "1px solid #27272a" },
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx("div", {
|
|
98
|
+
style: { fontSize: 11, opacity: 0.7 },
|
|
99
|
+
children: "1:1 Replaceable"
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ jsx("div", {
|
|
102
|
+
style: { fontSize: 22, fontWeight: 700, color: "#f59e0b" },
|
|
103
|
+
children: audit.replaceableCount
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsxs("div", {
|
|
108
|
+
style: { padding: 12, borderRadius: 6, border: "1px solid #27272a" },
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx("div", {
|
|
111
|
+
style: { fontSize: 11, opacity: 0.7 },
|
|
112
|
+
children: "Unmapped URLs"
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsx("div", {
|
|
115
|
+
style: { fontSize: 22, fontWeight: 700, color: "#ef4444" },
|
|
116
|
+
children: audit.unmappedCount
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ jsxs("div", {
|
|
121
|
+
style: { padding: 12, borderRadius: 6, border: "1px solid #27272a" },
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsx("div", {
|
|
124
|
+
style: { fontSize: 11, opacity: 0.7 },
|
|
125
|
+
children: "Priced BOM Subtotal"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ jsxs("div", {
|
|
128
|
+
style: { fontSize: 22, fontWeight: 700, color: "#22c55e" },
|
|
129
|
+
children: [
|
|
130
|
+
"$",
|
|
131
|
+
bom.materialSubtotalUsd.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
132
|
+
]
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsxs("div", {
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ jsxs("div", {
|
|
141
|
+
style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 },
|
|
142
|
+
children: [
|
|
143
|
+
/* @__PURE__ */ jsxs("h3", {
|
|
144
|
+
style: { margin: 0, fontSize: 14 },
|
|
145
|
+
children: [
|
|
146
|
+
"Real-World Manufacturer SKU Schedule (",
|
|
147
|
+
bom.lines.length,
|
|
148
|
+
" line",
|
|
149
|
+
bom.lines.length === 1 ? "" : "s",
|
|
150
|
+
")"
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ jsx("button", {
|
|
154
|
+
type: "button",
|
|
155
|
+
disabled: bom.lines.length === 0,
|
|
156
|
+
onClick: () => void copyCsv(),
|
|
157
|
+
style: {
|
|
158
|
+
padding: "4px 10px",
|
|
159
|
+
borderRadius: 4,
|
|
160
|
+
border: "1px solid #3f3f46",
|
|
161
|
+
background: "transparent",
|
|
162
|
+
color: "inherit",
|
|
163
|
+
fontSize: 11,
|
|
164
|
+
cursor: bom.lines.length === 0 ? "not-allowed" : "pointer",
|
|
165
|
+
opacity: bom.lines.length === 0 ? 0.5 : 1
|
|
166
|
+
},
|
|
167
|
+
children: copied ? "Copied CSV" : "Copy BOM CSV"
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ jsx("div", {
|
|
172
|
+
style: { overflowX: "auto" },
|
|
173
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
174
|
+
style: { width: "100%", borderCollapse: "collapse", fontSize: 12 },
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsx("thead", {
|
|
177
|
+
children: /* @__PURE__ */ jsxs("tr", {
|
|
178
|
+
style: { textAlign: "left", borderBottom: "1px solid #3f3f46" },
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx("th", {
|
|
181
|
+
style: { padding: 8 },
|
|
182
|
+
children: "CSI"
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx("th", {
|
|
185
|
+
style: { padding: 8 },
|
|
186
|
+
children: "SKU / Manufacturer"
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ jsx("th", {
|
|
189
|
+
style: { padding: 8 },
|
|
190
|
+
children: "Description"
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ jsx("th", {
|
|
193
|
+
style: { padding: 8, textAlign: "right" },
|
|
194
|
+
children: "Qty"
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ jsx("th", {
|
|
197
|
+
style: { padding: 8, textAlign: "right" },
|
|
198
|
+
children: "Unit USD"
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ jsx("th", {
|
|
201
|
+
style: { padding: 8, textAlign: "right" },
|
|
202
|
+
children: "Extended USD"
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
})
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ jsx("tbody", {
|
|
208
|
+
children: bom.lines.length === 0 ? /* @__PURE__ */ jsx("tr", {
|
|
209
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
210
|
+
colSpan: 6,
|
|
211
|
+
style: { padding: 14, textAlign: "center", opacity: 0.7 },
|
|
212
|
+
children: "Place any MIT Assets item from the sidebar to generate a priced real-world SKU BOM."
|
|
213
|
+
})
|
|
214
|
+
}) : bom.lines.map((line) => /* @__PURE__ */ jsxs("tr", {
|
|
215
|
+
style: { borderBottom: "1px solid #27272a" },
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ jsx("td", {
|
|
218
|
+
style: { padding: 8, fontFamily: "monospace", whiteSpace: "nowrap" },
|
|
219
|
+
children: line.csiDivision
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ jsxs("td", {
|
|
222
|
+
style: { padding: 8, whiteSpace: "nowrap" },
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ jsx("strong", {
|
|
225
|
+
children: line.manufacturer
|
|
226
|
+
}),
|
|
227
|
+
" · ",
|
|
228
|
+
line.sku
|
|
229
|
+
]
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ jsx("td", {
|
|
232
|
+
style: { padding: 8 },
|
|
233
|
+
children: line.name
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ jsxs("td", {
|
|
236
|
+
style: { padding: 8, textAlign: "right", whiteSpace: "nowrap" },
|
|
237
|
+
children: [
|
|
238
|
+
line.quantity,
|
|
239
|
+
" ",
|
|
240
|
+
line.unitOfMeasure
|
|
241
|
+
]
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsxs("td", {
|
|
244
|
+
style: { padding: 8, textAlign: "right", whiteSpace: "nowrap" },
|
|
245
|
+
children: [
|
|
246
|
+
"$",
|
|
247
|
+
line.unitPriceUsd.toFixed(2)
|
|
248
|
+
]
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ jsxs("td", {
|
|
251
|
+
style: { padding: 8, textAlign: "right", fontWeight: 600, whiteSpace: "nowrap" },
|
|
252
|
+
children: [
|
|
253
|
+
"$",
|
|
254
|
+
line.extendedUsd.toFixed(2)
|
|
255
|
+
]
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}, `${line.sku}-${line.slug}`))
|
|
259
|
+
})
|
|
260
|
+
]
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ jsxs("div", {
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ jsx("h3", {
|
|
268
|
+
style: { margin: "0 0 8px", fontSize: 14 },
|
|
269
|
+
children: "Provenance Audit Findings"
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ jsx("div", {
|
|
272
|
+
style: { overflowX: "auto" },
|
|
273
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
274
|
+
style: { width: "100%", borderCollapse: "collapse", fontSize: 12 },
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ jsx("thead", {
|
|
277
|
+
children: /* @__PURE__ */ jsxs("tr", {
|
|
278
|
+
style: { textAlign: "left", borderBottom: "1px solid #3f3f46" },
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsx("th", {
|
|
281
|
+
style: { padding: 8 },
|
|
282
|
+
children: "Node ID"
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ jsx("th", {
|
|
285
|
+
style: { padding: 8 },
|
|
286
|
+
children: "Code"
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ jsx("th", {
|
|
289
|
+
style: { padding: 8 },
|
|
290
|
+
children: "Matched Slug"
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ jsx("th", {
|
|
293
|
+
style: { padding: 8 },
|
|
294
|
+
children: "Current URL"
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ jsx("th", {
|
|
297
|
+
style: { padding: 8 },
|
|
298
|
+
children: "MIT Replacement"
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
})
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ jsx("tbody", {
|
|
304
|
+
children: audit.findings.length === 0 ? /* @__PURE__ */ jsx("tr", {
|
|
305
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
306
|
+
colSpan: 5,
|
|
307
|
+
style: { padding: 16, textAlign: "center", opacity: 0.7 },
|
|
308
|
+
children: "No external or bundled non-MIT asset URLs found in the current scene."
|
|
309
|
+
})
|
|
310
|
+
}) : audit.findings.map((f, idx) => /* @__PURE__ */ jsxs("tr", {
|
|
311
|
+
style: { borderBottom: "1px solid #27272a" },
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ jsx("td", {
|
|
314
|
+
style: { padding: 8 },
|
|
315
|
+
children: f.nodeId
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ jsx("td", {
|
|
318
|
+
style: { padding: 8 },
|
|
319
|
+
children: f.code
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ jsx("td", {
|
|
322
|
+
style: { padding: 8 },
|
|
323
|
+
children: f.matchedSlug ?? "—"
|
|
324
|
+
}),
|
|
325
|
+
/* @__PURE__ */ jsx("td", {
|
|
326
|
+
style: { padding: 8, wordBreak: "break-all" },
|
|
327
|
+
children: f.currentUrl
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ jsx("td", {
|
|
330
|
+
style: { padding: 8, wordBreak: "break-all" },
|
|
331
|
+
children: f.mitReplacementUrl ?? (f.code === "MIT_PROCEDURAL_NODE" ? "Procedural MIT" : "—")
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
}, `${f.nodeId}-${f.code}-${f.currentUrl}-${idx}`))
|
|
335
|
+
})
|
|
336
|
+
]
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
]
|
|
340
|
+
})
|
|
341
|
+
]
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
export {
|
|
345
|
+
MitAssetsScheduleView as default
|
|
346
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import"./chunk-2qgndrap.js";
|
|
3
|
+
import"./chunk-xhkwv6t4.js";
|
|
4
|
+
import {
|
|
5
|
+
MIT_ASSETS_SCHEDULE_VIEW_ID2
|
|
6
|
+
} from "./chunk-kgwk6kan.js";
|
|
7
|
+
|
|
8
|
+
// src/ui/chat-card.tsx
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function MitAssetsChatCard({
|
|
11
|
+
toolName,
|
|
12
|
+
output,
|
|
13
|
+
state,
|
|
14
|
+
actions,
|
|
15
|
+
result
|
|
16
|
+
}) {
|
|
17
|
+
const payload = output?.data ?? result;
|
|
18
|
+
const text = output?.text;
|
|
19
|
+
const error = output?.error;
|
|
20
|
+
const statusLabel = state === "running" ? "Running…" : state === "error" || error ? "Error" : state === "cancelled" ? "Cancelled" : "MIT";
|
|
21
|
+
const statusColor = state === "error" || error ? "#ef4444" : state === "running" ? "#f59e0b" : "#22c55e";
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
style: { padding: 10, borderRadius: 6, border: "1px solid #27272a", fontSize: 12 },
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", {
|
|
26
|
+
style: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
justifyContent: "space-between",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
marginBottom: 6,
|
|
31
|
+
gap: 8
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx("strong", {
|
|
35
|
+
children: toolName ?? "MIT Assets"
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ jsx("span", {
|
|
38
|
+
style: { color: statusColor, fontWeight: 600, fontSize: 11 },
|
|
39
|
+
children: statusLabel
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
43
|
+
error && /* @__PURE__ */ jsx("div", {
|
|
44
|
+
style: { color: "#ef4444", marginBottom: 6, fontSize: 11 },
|
|
45
|
+
children: error
|
|
46
|
+
}),
|
|
47
|
+
text && /* @__PURE__ */ jsx("div", {
|
|
48
|
+
style: { marginBottom: payload ? 6 : 0, opacity: 0.9, whiteSpace: "pre-wrap" },
|
|
49
|
+
children: text
|
|
50
|
+
}),
|
|
51
|
+
payload && /* @__PURE__ */ jsx("pre", {
|
|
52
|
+
style: {
|
|
53
|
+
margin: 0,
|
|
54
|
+
whiteSpace: "pre-wrap",
|
|
55
|
+
fontSize: 11,
|
|
56
|
+
opacity: 0.85,
|
|
57
|
+
maxHeight: 220,
|
|
58
|
+
overflowY: "auto"
|
|
59
|
+
},
|
|
60
|
+
children: JSON.stringify(payload, null, 2)
|
|
61
|
+
}),
|
|
62
|
+
actions && state === "done" && /* @__PURE__ */ jsx("div", {
|
|
63
|
+
style: { display: "flex", gap: 6, marginTop: 8 },
|
|
64
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: () => actions.openView(MIT_ASSETS_SCHEDULE_VIEW_ID2, { beside: true }),
|
|
67
|
+
style: {
|
|
68
|
+
padding: "3px 8px",
|
|
69
|
+
borderRadius: 4,
|
|
70
|
+
border: "1px solid #3f3f46",
|
|
71
|
+
background: "transparent",
|
|
72
|
+
color: "inherit",
|
|
73
|
+
fontSize: 11,
|
|
74
|
+
cursor: "pointer"
|
|
75
|
+
},
|
|
76
|
+
children: "Open Audit & BOM View"
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
MitAssetsChatCard as default
|
|
84
|
+
};
|