@reopt-ai/opt-devtool 1.0.0 → 1.0.2

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 (55) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +11 -2
  3. package/dist/brandapp/index.cjs +457 -363
  4. package/dist/brandapp/index.d.cts +80 -81
  5. package/dist/brandapp/index.d.ts +80 -81
  6. package/dist/brandapp/index.js +451 -361
  7. package/dist/datagrid/index.cjs +170 -180
  8. package/dist/datagrid/index.d.cts +9 -11
  9. package/dist/datagrid/index.d.ts +9 -11
  10. package/dist/datagrid/index.js +167 -179
  11. package/dist/editor/index.cjs +209 -228
  12. package/dist/editor/index.d.cts +9 -11
  13. package/dist/editor/index.d.ts +9 -11
  14. package/dist/editor/index.js +206 -227
  15. package/dist/harness/index.cjs +5 -12
  16. package/dist/harness/index.d.cts +14 -16
  17. package/dist/harness/index.d.ts +14 -16
  18. package/dist/harness/index.js +1 -11
  19. package/dist/harness-CJZXBH3w.js +528 -0
  20. package/dist/harness-CPOp9Wlj.cjs +582 -0
  21. package/dist/index.cjs +3619 -3782
  22. package/dist/index.d.cts +9 -17
  23. package/dist/index.d.ts +9 -17
  24. package/dist/index.js +3611 -3781
  25. package/dist/provider-Cjg2rSYG.js +110 -0
  26. package/dist/provider-H53ZWHCo.cjs +161 -0
  27. package/dist/theme/index.cjs +298 -12
  28. package/dist/theme/index.d.cts +26 -28
  29. package/dist/theme/index.d.ts +26 -28
  30. package/dist/theme/index.js +294 -11
  31. package/dist/theme-isolate-BOo3J259.js +42 -0
  32. package/dist/theme-isolate-D9AMkYrD.cjs +53 -0
  33. package/dist/types-BKmW0EBr.js +4 -0
  34. package/dist/types-Bz4DijhU.cjs +9 -0
  35. package/dist/types-D_lNT2Nr.d.cts +91 -0
  36. package/dist/types-D_lNT2Nr.d.ts +91 -0
  37. package/dist/ui/index.cjs +4 -8
  38. package/dist/ui/index.d.cts +3 -2
  39. package/dist/ui/index.d.ts +3 -2
  40. package/dist/ui/index.js +1 -7
  41. package/package.json +4 -4
  42. package/dist/chunk-4MJKIAXH.cjs +0 -65
  43. package/dist/chunk-5HRIQSVF.js +0 -32
  44. package/dist/chunk-6AGUYGVT.cjs +0 -77
  45. package/dist/chunk-EQPETYJJ.cjs +0 -32
  46. package/dist/chunk-H3F2WACS.cjs +0 -568
  47. package/dist/chunk-N7YO56TN.cjs +0 -25
  48. package/dist/chunk-SQ3E3QLA.cjs +0 -253
  49. package/dist/chunk-SW2FF6EV.js +0 -568
  50. package/dist/chunk-UJSIQF3A.js +0 -25
  51. package/dist/chunk-UQY5I3WS.js +0 -253
  52. package/dist/chunk-YCYIUFB4.js +0 -65
  53. package/dist/chunk-Z2KFRHSI.js +0 -77
  54. package/dist/index-Bakx4o8Z.d.cts +0 -91
  55. package/dist/index-Bakx4o8Z.d.ts +0 -91
@@ -1,391 +1,485 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
1
  "use client";
3
-
4
-
5
- var _chunk6AGUYGVTcjs = require('../chunk-6AGUYGVT.cjs');
6
- require('../chunk-N7YO56TN.cjs');
7
-
2
+ "use client";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const require_provider = require("../provider-H53ZWHCo.cjs");
5
+ let react = require("react");
6
+ react = require_provider.__toESM(react, 1);
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
8
  // src/brandapp/index.tsx
9
- var _react = require('react'); var React = _interopRequireWildcard(_react);
10
- var _jsxruntime = require('react/jsx-runtime');
11
- var STATUS_STYLES = {
12
- connected: "bg-emerald-400",
13
- configured: "bg-blue-400",
14
- missing: "bg-red-400",
15
- warning: "bg-amber-300",
16
- error: "bg-red-400",
17
- unknown: "bg-white/25"
9
+ const STATUS_STYLES = {
10
+ connected: "bg-emerald-400",
11
+ configured: "bg-blue-400",
12
+ missing: "bg-red-400",
13
+ warning: "bg-amber-300",
14
+ error: "bg-red-400",
15
+ unknown: "bg-white/25"
18
16
  };
19
- var STATUS_TEXT_STYLES = {
20
- connected: "text-emerald-300",
21
- configured: "text-blue-300",
22
- missing: "text-red-300",
23
- warning: "text-amber-300",
24
- error: "text-red-300",
25
- unknown: "text-white/45"
17
+ const STATUS_TEXT_STYLES = {
18
+ connected: "text-emerald-300",
19
+ configured: "text-blue-300",
20
+ missing: "text-red-300",
21
+ warning: "text-amber-300",
22
+ error: "text-red-300",
23
+ unknown: "text-white/45"
26
24
  };
27
25
  function statusLabel(status) {
28
- return status != null ? status : "unknown";
26
+ return status !== null && status !== void 0 ? status : "unknown";
29
27
  }
28
+ /** Summarize required Brandapp env vars for status badges and diagnostics. */
30
29
  function getBrandappRequiredEnvSummary(env) {
31
- const required = (env != null ? env : []).filter((item) => item.required);
32
- return {
33
- total: required.length,
34
- present: required.filter((item) => item.present).length,
35
- missing: required.filter((item) => !item.present).map((item) => item.name)
36
- };
30
+ const required = (env !== null && env !== void 0 ? env : []).filter((item) => item.required);
31
+ return {
32
+ total: required.length,
33
+ present: required.filter((item) => item.present).length,
34
+ missing: required.filter((item) => !item.present).map((item) => item.name)
35
+ };
37
36
  }
37
+ /** Resolve the top-level Brandapp snapshot status from all reported signals. */
38
38
  function getBrandappSnapshotStatus(snapshot) {
39
- var _a, _b, _c, _d, _e;
40
- const requiredEnv = getBrandappRequiredEnvSummary(snapshot.env);
41
- const statuses = [
42
- (_a = snapshot.auth) == null ? void 0 : _a.status,
43
- (_b = snapshot.eav) == null ? void 0 : _b.status,
44
- (_c = snapshot.ai) == null ? void 0 : _c.status,
45
- ...((_d = snapshot.features) != null ? _d : []).map((feature) => feature.status),
46
- ...((_e = snapshot.routes) != null ? _e : []).map((route) => route.status)
47
- ];
48
- if (statuses.includes("error")) {
49
- return "error";
50
- }
51
- if (requiredEnv.missing.length > 0 || statuses.includes("missing")) {
52
- return "missing";
53
- }
54
- if (statuses.includes("warning")) {
55
- return "warning";
56
- }
57
- if (statuses.includes("connected")) {
58
- return "connected";
59
- }
60
- if (statuses.includes("configured")) {
61
- return "configured";
62
- }
63
- return "unknown";
39
+ var _snapshot$auth, _snapshot$eav, _snapshot$ai, _snapshot$features, _snapshot$routes;
40
+ const requiredEnv = getBrandappRequiredEnvSummary(snapshot.env);
41
+ const statuses = [
42
+ (_snapshot$auth = snapshot.auth) === null || _snapshot$auth === void 0 ? void 0 : _snapshot$auth.status,
43
+ (_snapshot$eav = snapshot.eav) === null || _snapshot$eav === void 0 ? void 0 : _snapshot$eav.status,
44
+ (_snapshot$ai = snapshot.ai) === null || _snapshot$ai === void 0 ? void 0 : _snapshot$ai.status,
45
+ ...((_snapshot$features = snapshot.features) !== null && _snapshot$features !== void 0 ? _snapshot$features : []).map((feature) => feature.status),
46
+ ...((_snapshot$routes = snapshot.routes) !== null && _snapshot$routes !== void 0 ? _snapshot$routes : []).map((route) => route.status)
47
+ ];
48
+ if (statuses.includes("error")) return "error";
49
+ if (requiredEnv.missing.length > 0 || statuses.includes("missing")) return "missing";
50
+ if (statuses.includes("warning")) return "warning";
51
+ if (statuses.includes("connected")) return "connected";
52
+ if (statuses.includes("configured")) return "configured";
53
+ return "unknown";
64
54
  }
65
55
  function formatDate(value) {
66
- if (value === void 0) {
67
- return "-";
68
- }
69
- const date = typeof value === "number" ? new Date(value) : new Date(value);
70
- if (Number.isNaN(date.getTime())) {
71
- return String(value);
72
- }
73
- return date.toLocaleString();
56
+ if (value === void 0) return "-";
57
+ const date = typeof value === "number" ? new Date(value) : new Date(value);
58
+ if (Number.isNaN(date.getTime())) return String(value);
59
+ return date.toLocaleString();
74
60
  }
75
61
  function formatOptional(value) {
76
- if (value === null || value === void 0 || value === "") {
77
- return "-";
78
- }
79
- return String(value);
62
+ if (value === null || value === void 0 || value === "") return "-";
63
+ return String(value);
80
64
  }
81
- function StatusDot({
82
- status,
83
- label
84
- }) {
85
- const resolved = status != null ? status : "unknown";
86
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "inline-flex items-center gap-1.5", children: [
87
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
88
- "span",
89
- {
90
- className: `inline-block h-1.5 w-1.5 rounded-full ${STATUS_STYLES[resolved]}`
91
- }
92
- ),
93
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: STATUS_TEXT_STYLES[resolved], children: label })
94
- ] });
65
+ function StatusDot({ status, label }) {
66
+ const resolved = status !== null && status !== void 0 ? status : "unknown";
67
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
68
+ className: "inline-flex items-center gap-1.5",
69
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `inline-block h-1.5 w-1.5 rounded-full ${STATUS_STYLES[resolved]}` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
70
+ className: STATUS_TEXT_STYLES[resolved],
71
+ children: label
72
+ })]
73
+ });
95
74
  }
96
- function InfoRow({
97
- label,
98
- value
99
- }) {
100
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid min-w-0 grid-cols-[5.75rem_minmax(0,1fr)] items-center gap-1 rounded-md bg-white/[0.035] px-2 py-1", children: [
101
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate text-[9px] font-semibold tracking-wide text-white/35 uppercase", children: label }),
102
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "min-w-0 truncate rounded bg-black/20 px-1.5 py-0.5 text-right font-mono text-[10px] text-white/78", children: formatOptional(value) })
103
- ] });
75
+ function InfoRow({ label, value }) {
76
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
77
+ className: "grid min-w-0 grid-cols-[5.75rem_minmax(0,1fr)] items-center gap-1 rounded-md bg-white/[0.035] px-2 py-1",
78
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
79
+ className: "truncate text-[9px] font-semibold tracking-wide text-white/35 uppercase",
80
+ children: label
81
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
82
+ className: "min-w-0 truncate rounded bg-black/20 px-1.5 py-0.5 text-right font-mono text-[10px] text-white/78",
83
+ children: formatOptional(value)
84
+ })]
85
+ });
104
86
  }
105
- function CollapsibleGroup({
106
- title,
107
- trailing,
108
- defaultOpen = true,
109
- children
110
- }) {
111
- const [open, setOpen] = React.useState(defaultOpen);
112
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "overflow-hidden rounded-lg bg-white/[0.025]", children: [
113
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
114
- "button",
115
- {
116
- type: "button",
117
- tabIndex: -1,
118
- onClick: () => setOpen((current) => !current),
119
- className: "flex w-full items-center justify-between gap-2 bg-white/[0.045] px-2.5 py-1.5 text-left transition-colors hover:bg-white/[0.065]",
120
- "aria-expanded": open,
121
- children: [
122
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex min-w-0 items-center gap-1.5", children: [
123
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[9px] text-white/35", children: open ? "\u25BE" : "\u25B8" }),
124
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate text-[10px] font-semibold text-emerald-400", children: title })
125
- ] }),
126
- trailing
127
- ]
128
- }
129
- ),
130
- open ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-2.5 py-2", children }) : null
131
- ] });
87
+ function CollapsibleGroup({ title, trailing, defaultOpen = true, children }) {
88
+ const [open, setOpen] = react.useState(defaultOpen);
89
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
90
+ className: "overflow-hidden rounded-lg bg-white/[0.025]",
91
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
92
+ type: "button",
93
+ tabIndex: -1,
94
+ onClick: () => setOpen((current) => !current),
95
+ className: "flex w-full items-center justify-between gap-2 bg-white/[0.045] px-2.5 py-1.5 text-left transition-colors hover:bg-white/[0.065]",
96
+ "aria-expanded": open,
97
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
98
+ className: "flex min-w-0 items-center gap-1.5",
99
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
100
+ className: "text-[9px] text-white/35",
101
+ children: open ? "▾" : "▸"
102
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
103
+ className: "truncate text-[10px] font-semibold text-emerald-400",
104
+ children: title
105
+ })]
106
+ }), trailing]
107
+ }), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
108
+ className: "px-2.5 py-2",
109
+ children
110
+ }) : null]
111
+ });
132
112
  }
133
113
  function SummaryPanel({ snapshot }) {
134
- const requiredEnv = getBrandappRequiredEnvSummary(snapshot.env);
135
- const status = getBrandappSnapshotStatus(snapshot);
136
- const statusText = statusLabel(status);
137
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "rounded-lg bg-white/[0.05] px-2.5 py-2", children: [
138
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-2", children: [
139
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status, label: `Brandapp ${statusText}` }),
140
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rounded bg-black/20 px-1.5 py-0.5 font-mono text-[9px] text-white/55", children: [
141
- "env ",
142
- requiredEnv.present,
143
- "/",
144
- requiredEnv.total
145
- ] })
146
- ] }),
147
- requiredEnv.missing.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-1.5 flex flex-wrap gap-1", children: requiredEnv.missing.map((name) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
148
- "span",
149
- {
150
- className: "rounded bg-red-500/15 px-1.5 py-0.5 font-mono text-[9px] text-red-200",
151
- children: [
152
- "missing ",
153
- name
154
- ]
155
- },
156
- name
157
- )) }) : null
158
- ] });
114
+ const requiredEnv = getBrandappRequiredEnvSummary(snapshot.env);
115
+ const status = getBrandappSnapshotStatus(snapshot);
116
+ const statusText = statusLabel(status);
117
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
118
+ className: "rounded-lg bg-white/[0.05] px-2.5 py-2",
119
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
120
+ className: "flex items-center justify-between gap-2",
121
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
122
+ status,
123
+ label: `Brandapp ${statusText}`
124
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
125
+ className: "rounded bg-black/20 px-1.5 py-0.5 font-mono text-[9px] text-white/55",
126
+ children: [
127
+ "env ",
128
+ requiredEnv.present,
129
+ "/",
130
+ requiredEnv.total
131
+ ]
132
+ })]
133
+ }), requiredEnv.missing.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
134
+ className: "mt-1.5 flex flex-wrap gap-1",
135
+ children: requiredEnv.missing.map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
136
+ className: "rounded bg-red-500/15 px-1.5 py-0.5 font-mono text-[9px] text-red-200",
137
+ children: ["missing ", name]
138
+ }, name))
139
+ }) : null]
140
+ });
159
141
  }
160
- function FeatureList({
161
- features
162
- }) {
163
- if (!features || features.length === 0) {
164
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[10px] text-white/40", children: "No feature signals." });
165
- }
166
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-1", children: features.map((feature) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
167
- "div",
168
- {
169
- className: "grid min-w-0 grid-cols-[6.5rem_minmax(0,1fr)] items-start gap-1 rounded-md bg-white/[0.035] px-2 py-1",
170
- children: [
171
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "min-w-0 truncate", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status: feature.status, label: feature.label }) }),
172
- feature.detail ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "min-w-0 truncate rounded bg-black/20 px-1.5 py-0.5 font-mono text-[9px] text-white/55", children: feature.detail }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rounded bg-black/20 px-1.5 py-0.5 font-mono text-[9px] text-white/35", children: "-" })
173
- ]
174
- },
175
- feature.id
176
- )) });
142
+ function FeatureList({ features }) {
143
+ if (!features || features.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
144
+ className: "text-[10px] text-white/40",
145
+ children: "No feature signals."
146
+ });
147
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
148
+ className: "flex flex-col gap-1",
149
+ children: features.map((feature) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
150
+ className: "grid min-w-0 grid-cols-[6.5rem_minmax(0,1fr)] items-start gap-1 rounded-md bg-white/[0.035] px-2 py-1",
151
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
152
+ className: "min-w-0 truncate",
153
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
154
+ status: feature.status,
155
+ label: feature.label
156
+ })
157
+ }), feature.detail ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
158
+ className: "min-w-0 truncate rounded bg-black/20 px-1.5 py-0.5 font-mono text-[9px] text-white/55",
159
+ children: feature.detail
160
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
161
+ className: "rounded bg-black/20 px-1.5 py-0.5 font-mono text-[9px] text-white/35",
162
+ children: "-"
163
+ })]
164
+ }, feature.id))
165
+ });
177
166
  }
178
- function EnvList({
179
- env
180
- }) {
181
- if (!env || env.length === 0) {
182
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[10px] text-white/40", children: "No env signals." });
183
- }
184
- const requiredEnv = getBrandappRequiredEnvSummary(env);
185
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-1", children: [
186
- requiredEnv.missing.length > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rounded bg-red-500/12 px-2 py-1 text-[10px] text-red-200", children: [
187
- "Missing required env: ",
188
- requiredEnv.missing.join(", ")
189
- ] }) : null,
190
- env.map((item) => {
191
- var _a, _b;
192
- const status = item.present ? "configured" : item.required ? "missing" : "unknown";
193
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
194
- "div",
195
- {
196
- className: "grid grid-cols-[minmax(0,1fr)_minmax(4.5rem,auto)] gap-1 rounded-md bg-white/[0.035] px-2 py-1",
197
- children: [
198
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "min-w-0", children: [
199
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 items-center gap-1.5", children: [
200
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status, label: item.name }),
201
- item.required ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rounded bg-amber-400/12 px-1 py-0.5 text-[8px] text-amber-300", children: "required" }) : null
202
- ] }),
203
- item.note ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate pl-3 text-[9px] text-white/35", children: item.note }) : null
204
- ] }),
205
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "min-w-0 truncate rounded bg-black/20 px-1.5 py-0.5 text-right font-mono text-[9px] text-white/55", children: (_b = (_a = item.maskedValue) != null ? _a : item.scope) != null ? _b : "" })
206
- ]
207
- },
208
- item.name
209
- );
210
- })
211
- ] });
167
+ function EnvList({ env }) {
168
+ if (!env || env.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
169
+ className: "text-[10px] text-white/40",
170
+ children: "No env signals."
171
+ });
172
+ const requiredEnv = getBrandappRequiredEnvSummary(env);
173
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
174
+ className: "flex flex-col gap-1",
175
+ children: [requiredEnv.missing.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
176
+ className: "rounded bg-red-500/12 px-2 py-1 text-[10px] text-red-200",
177
+ children: ["Missing required env: ", requiredEnv.missing.join(", ")]
178
+ }) : null, env.map((item) => {
179
+ var _ref, _item$maskedValue;
180
+ const status = item.present ? "configured" : item.required ? "missing" : "unknown";
181
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
182
+ className: "grid grid-cols-[minmax(0,1fr)_minmax(4.5rem,auto)] gap-1 rounded-md bg-white/[0.035] px-2 py-1",
183
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
184
+ className: "min-w-0",
185
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
186
+ className: "flex min-w-0 items-center gap-1.5",
187
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
188
+ status,
189
+ label: item.name
190
+ }), item.required ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
191
+ className: "rounded bg-amber-400/12 px-1 py-0.5 text-[8px] text-amber-300",
192
+ children: "required"
193
+ }) : null]
194
+ }), item.note ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
195
+ className: "truncate pl-3 text-[9px] text-white/35",
196
+ children: item.note
197
+ }) : null]
198
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
199
+ className: "min-w-0 truncate rounded bg-black/20 px-1.5 py-0.5 text-right font-mono text-[9px] text-white/55",
200
+ children: (_ref = (_item$maskedValue = item.maskedValue) !== null && _item$maskedValue !== void 0 ? _item$maskedValue : item.scope) !== null && _ref !== void 0 ? _ref : ""
201
+ })]
202
+ }, item.name);
203
+ })]
204
+ });
212
205
  }
213
- function RouteList({
214
- routes
215
- }) {
216
- if (!routes || routes.length === 0) {
217
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[10px] text-white/40", children: "No route signals." });
218
- }
219
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-1", children: routes.map((route) => {
220
- var _a, _b, _c;
221
- const status = (_a = route.status) != null ? _a : "unknown";
222
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
223
- "div",
224
- {
225
- className: "min-w-0 rounded-md bg-white/[0.035] px-2 py-1",
226
- children: [
227
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid min-w-0 grid-cols-[3.25rem_minmax(0,1fr)] items-center gap-1", children: [
228
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "min-w-0 truncate", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status, label: (_c = route.method) != null ? _c : "GET" }) }),
229
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate rounded bg-black/20 px-1.5 py-0.5 font-mono text-[10px] text-white/75", children: route.path })
230
- ] }),
231
- route.statusCode !== void 0 || route.latencyMs !== void 0 || route.lastCheckedAt !== void 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-1 flex flex-wrap gap-1 pl-[3.75rem]", children: [
232
- route.statusCode !== void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rounded bg-black/20 px-1.5 py-0.5 text-[9px] text-white/45", children: route.statusCode }) : null,
233
- route.latencyMs !== void 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rounded bg-black/20 px-1.5 py-0.5 text-[9px] text-white/45", children: [
234
- route.latencyMs,
235
- "ms"
236
- ] }) : null,
237
- route.lastCheckedAt !== void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rounded bg-black/20 px-1.5 py-0.5 text-[9px] text-white/40", children: formatDate(route.lastCheckedAt) }) : null
238
- ] }) : null,
239
- route.description ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate pl-3 text-[9px] text-white/35", children: route.description }) : null
240
- ]
241
- },
242
- `${(_b = route.method) != null ? _b : "GET"} ${route.path}`
243
- );
244
- }) });
206
+ function RouteList({ routes }) {
207
+ if (!routes || routes.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
208
+ className: "text-[10px] text-white/40",
209
+ children: "No route signals."
210
+ });
211
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
212
+ className: "flex flex-col gap-1",
213
+ children: routes.map((route) => {
214
+ var _route$status, _route$method, _route$method2;
215
+ const status = (_route$status = route.status) !== null && _route$status !== void 0 ? _route$status : "unknown";
216
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
217
+ className: "min-w-0 rounded-md bg-white/[0.035] px-2 py-1",
218
+ children: [
219
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
220
+ className: "grid min-w-0 grid-cols-[3.25rem_minmax(0,1fr)] items-center gap-1",
221
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
222
+ className: "min-w-0 truncate",
223
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
224
+ status,
225
+ label: (_route$method2 = route.method) !== null && _route$method2 !== void 0 ? _route$method2 : "GET"
226
+ })
227
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
228
+ className: "truncate rounded bg-black/20 px-1.5 py-0.5 font-mono text-[10px] text-white/75",
229
+ children: route.path
230
+ })]
231
+ }),
232
+ route.statusCode !== void 0 || route.latencyMs !== void 0 || route.lastCheckedAt !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
233
+ className: "mt-1 flex flex-wrap gap-1 pl-[3.75rem]",
234
+ children: [
235
+ route.statusCode !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
236
+ className: "rounded bg-black/20 px-1.5 py-0.5 text-[9px] text-white/45",
237
+ children: route.statusCode
238
+ }) : null,
239
+ route.latencyMs !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
240
+ className: "rounded bg-black/20 px-1.5 py-0.5 text-[9px] text-white/45",
241
+ children: [route.latencyMs, "ms"]
242
+ }) : null,
243
+ route.lastCheckedAt !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
244
+ className: "rounded bg-black/20 px-1.5 py-0.5 text-[9px] text-white/40",
245
+ children: formatDate(route.lastCheckedAt)
246
+ }) : null
247
+ ]
248
+ }) : null,
249
+ route.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
250
+ className: "truncate pl-3 text-[9px] text-white/35",
251
+ children: route.description
252
+ }) : null
253
+ ]
254
+ }, `${(_route$method = route.method) !== null && _route$method !== void 0 ? _route$method : "GET"} ${route.path}`);
255
+ })
256
+ });
245
257
  }
246
258
  function formatEntityMetric(entity) {
247
- if (entity.recordCount !== void 0) {
248
- return `${entity.recordCount} rows`;
249
- }
250
- if (entity.attributeCount !== void 0) {
251
- return `${entity.attributeCount} attrs`;
252
- }
253
- if (entity.synced) {
254
- return "synced";
255
- }
256
- return entity.id;
259
+ if (entity.recordCount !== void 0) return `${entity.recordCount} rows`;
260
+ if (entity.attributeCount !== void 0) return `${entity.attributeCount} attrs`;
261
+ if (entity.synced) return "synced";
262
+ return entity.id;
257
263
  }
258
264
  function EavPanel({ eav }) {
259
- if (!eav) {
260
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[10px] text-white/40", children: "No EAV signal." });
261
- }
262
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-1.5", children: [
263
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2", children: [
264
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "status", value: statusLabel(eav.status) }),
265
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "schema", value: eav.schemaHash }),
266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "lockfile", value: eav.lockfileHash }),
267
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "sync", value: formatDate(eav.lastSyncAt) })
268
- ] }),
269
- eav.entities && eav.entities.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-1", children: eav.entities.slice(0, 6).map((entity) => {
270
- var _a, _b;
271
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
272
- "div",
273
- {
274
- className: "grid grid-cols-[minmax(0,1fr)_auto] gap-1 rounded-md bg-white/[0.035] px-2 py-1 text-[10px]",
275
- children: [
276
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "truncate text-white/70", children: (_b = (_a = entity.label) != null ? _a : entity.name) != null ? _b : entity.id }),
277
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rounded bg-black/20 px-1.5 py-0.5 font-mono text-white/55", children: formatEntityMetric(entity) })
278
- ]
279
- },
280
- entity.id
281
- );
282
- }) }) : null
283
- ] });
265
+ if (!eav) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
266
+ className: "text-[10px] text-white/40",
267
+ children: "No EAV signal."
268
+ });
269
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
270
+ className: "flex flex-col gap-1.5",
271
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
272
+ className: "grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2",
273
+ children: [
274
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
275
+ label: "status",
276
+ value: statusLabel(eav.status)
277
+ }),
278
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
279
+ label: "schema",
280
+ value: eav.schemaHash
281
+ }),
282
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
283
+ label: "lockfile",
284
+ value: eav.lockfileHash
285
+ }),
286
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
287
+ label: "sync",
288
+ value: formatDate(eav.lastSyncAt)
289
+ })
290
+ ]
291
+ }), eav.entities && eav.entities.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
292
+ className: "flex flex-col gap-1",
293
+ children: eav.entities.slice(0, 6).map((entity) => {
294
+ var _ref2, _entity$label;
295
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
296
+ className: "grid grid-cols-[minmax(0,1fr)_auto] gap-1 rounded-md bg-white/[0.035] px-2 py-1 text-[10px]",
297
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
298
+ className: "truncate text-white/70",
299
+ children: (_ref2 = (_entity$label = entity.label) !== null && _entity$label !== void 0 ? _entity$label : entity.name) !== null && _ref2 !== void 0 ? _ref2 : entity.id
300
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
301
+ className: "rounded bg-black/20 px-1.5 py-0.5 font-mono text-white/55",
302
+ children: formatEntityMetric(entity)
303
+ })]
304
+ }, entity.id);
305
+ })
306
+ }) : null]
307
+ });
284
308
  }
285
- function BrandappDevtoolPanel({
286
- snapshot
287
- }) {
288
- var _a, _b, _c, _d, _e, _f, _g, _h;
289
- if (!snapshot) {
290
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[11px] text-white/55", children: "Waiting for Brandapp SDK snapshot." });
291
- }
292
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-3 text-[11px]", children: [
293
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SummaryPanel, { snapshot }),
294
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollapsibleGroup, { title: "Identity", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2", children: [
295
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "brandappId", value: snapshot.brandappId }),
296
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "clientId", value: snapshot.clientId }),
297
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "baseUrl", value: snapshot.baseUrl }),
298
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "sdk", value: snapshot.sdkVersion }),
299
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "env", value: snapshot.environment }),
300
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "updated", value: formatDate(snapshot.updatedAt) })
301
- ] }) }),
302
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, CollapsibleGroup, { title: "Connection", children: [
303
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-x-3 gap-y-1.5 text-white/70", children: [
304
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status: (_a = snapshot.auth) == null ? void 0 : _a.status, label: "Auth" }),
305
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status: (_b = snapshot.eav) == null ? void 0 : _b.status, label: "EAV" }),
306
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { status: (_c = snapshot.ai) == null ? void 0 : _c.status, label: "AI" }),
307
- ((_d = snapshot.auth) == null ? void 0 : _d.session) ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-white/45", children: [
308
- "session: ",
309
- snapshot.auth.session
310
- ] }) : null
311
- ] }),
312
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-1 grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2", children: [
313
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "provider", value: (_e = snapshot.auth) == null ? void 0 : _e.provider }),
314
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "callback", value: (_f = snapshot.auth) == null ? void 0 : _f.callbackPath }),
315
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "user", value: (_g = snapshot.auth) == null ? void 0 : _g.userId }),
316
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "org", value: (_h = snapshot.auth) == null ? void 0 : _h.organizationId })
317
- ] })
318
- ] }),
319
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollapsibleGroup, { title: "Features", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FeatureList, { features: snapshot.features }) }),
320
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollapsibleGroup, { title: "Environment", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EnvList, { env: snapshot.env }) }),
321
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollapsibleGroup, { title: "EAV", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EavPanel, { eav: snapshot.eav }) }),
322
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollapsibleGroup, { title: "Routes", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RouteList, { routes: snapshot.routes }) }),
323
- snapshot.ai ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, CollapsibleGroup, { title: "AI", children: [
324
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2", children: [
325
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "status", value: statusLabel(snapshot.ai.status) }),
326
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "route", value: snapshot.ai.routePath }),
327
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "model", value: snapshot.ai.defaultModel }),
328
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoRow, { label: "credits", value: snapshot.ai.creditBalance })
329
- ] }),
330
- snapshot.ai.models && snapshot.ai.models.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-1 flex flex-wrap gap-1", children: snapshot.ai.models.map((model) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
331
- "span",
332
- {
333
- className: "rounded bg-white/[0.055] px-1.5 py-0.5 text-[9px] text-white/60",
334
- children: model
335
- },
336
- model
337
- )) }) : null
338
- ] }) : null,
339
- snapshot.notes && snapshot.notes.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CollapsibleGroup, { title: "Notes", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-1 text-[10px] text-white/50", children: snapshot.notes.map((note, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
340
- "div",
341
- {
342
- className: "rounded bg-white/[0.035] px-2 py-1",
343
- children: note
344
- },
345
- `${index}-${note}`
346
- )) }) }) : null
347
- ] });
309
+ function BrandappDevtoolPanel({ snapshot }) {
310
+ var _snapshot$auth2, _snapshot$eav2, _snapshot$ai2, _snapshot$auth3, _snapshot$auth4, _snapshot$auth5, _snapshot$auth6, _snapshot$auth7;
311
+ if (!snapshot) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
312
+ className: "text-[11px] text-white/55",
313
+ children: "Waiting for Brandapp SDK snapshot."
314
+ });
315
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
316
+ className: "flex flex-col gap-3 text-[11px]",
317
+ children: [
318
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryPanel, { snapshot }),
319
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleGroup, {
320
+ title: "Identity",
321
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
322
+ className: "grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2",
323
+ children: [
324
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
325
+ label: "brandappId",
326
+ value: snapshot.brandappId
327
+ }),
328
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
329
+ label: "clientId",
330
+ value: snapshot.clientId
331
+ }),
332
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
333
+ label: "baseUrl",
334
+ value: snapshot.baseUrl
335
+ }),
336
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
337
+ label: "sdk",
338
+ value: snapshot.sdkVersion
339
+ }),
340
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
341
+ label: "env",
342
+ value: snapshot.environment
343
+ }),
344
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
345
+ label: "updated",
346
+ value: formatDate(snapshot.updatedAt)
347
+ })
348
+ ]
349
+ })
350
+ }),
351
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CollapsibleGroup, {
352
+ title: "Connection",
353
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
354
+ className: "flex flex-wrap gap-x-3 gap-y-1.5 text-white/70",
355
+ children: [
356
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
357
+ status: (_snapshot$auth2 = snapshot.auth) === null || _snapshot$auth2 === void 0 ? void 0 : _snapshot$auth2.status,
358
+ label: "Auth"
359
+ }),
360
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
361
+ status: (_snapshot$eav2 = snapshot.eav) === null || _snapshot$eav2 === void 0 ? void 0 : _snapshot$eav2.status,
362
+ label: "EAV"
363
+ }),
364
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
365
+ status: (_snapshot$ai2 = snapshot.ai) === null || _snapshot$ai2 === void 0 ? void 0 : _snapshot$ai2.status,
366
+ label: "AI"
367
+ }),
368
+ ((_snapshot$auth3 = snapshot.auth) === null || _snapshot$auth3 === void 0 ? void 0 : _snapshot$auth3.session) ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
369
+ className: "text-white/45",
370
+ children: ["session: ", snapshot.auth.session]
371
+ }) : null
372
+ ]
373
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
374
+ className: "mt-1 grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2",
375
+ children: [
376
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
377
+ label: "provider",
378
+ value: (_snapshot$auth4 = snapshot.auth) === null || _snapshot$auth4 === void 0 ? void 0 : _snapshot$auth4.provider
379
+ }),
380
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
381
+ label: "callback",
382
+ value: (_snapshot$auth5 = snapshot.auth) === null || _snapshot$auth5 === void 0 ? void 0 : _snapshot$auth5.callbackPath
383
+ }),
384
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
385
+ label: "user",
386
+ value: (_snapshot$auth6 = snapshot.auth) === null || _snapshot$auth6 === void 0 ? void 0 : _snapshot$auth6.userId
387
+ }),
388
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
389
+ label: "org",
390
+ value: (_snapshot$auth7 = snapshot.auth) === null || _snapshot$auth7 === void 0 ? void 0 : _snapshot$auth7.organizationId
391
+ })
392
+ ]
393
+ })]
394
+ }),
395
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleGroup, {
396
+ title: "Features",
397
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FeatureList, { features: snapshot.features })
398
+ }),
399
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleGroup, {
400
+ title: "Environment",
401
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EnvList, { env: snapshot.env })
402
+ }),
403
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleGroup, {
404
+ title: "EAV",
405
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EavPanel, { eav: snapshot.eav })
406
+ }),
407
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleGroup, {
408
+ title: "Routes",
409
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RouteList, { routes: snapshot.routes })
410
+ }),
411
+ snapshot.ai ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CollapsibleGroup, {
412
+ title: "AI",
413
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
414
+ className: "grid gap-x-3 gap-y-1 text-[10px] md:grid-cols-2",
415
+ children: [
416
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
417
+ label: "status",
418
+ value: statusLabel(snapshot.ai.status)
419
+ }),
420
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
421
+ label: "route",
422
+ value: snapshot.ai.routePath
423
+ }),
424
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
425
+ label: "model",
426
+ value: snapshot.ai.defaultModel
427
+ }),
428
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoRow, {
429
+ label: "credits",
430
+ value: snapshot.ai.creditBalance
431
+ })
432
+ ]
433
+ }), snapshot.ai.models && snapshot.ai.models.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
434
+ className: "mt-1 flex flex-wrap gap-1",
435
+ children: snapshot.ai.models.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
436
+ className: "rounded bg-white/[0.055] px-1.5 py-0.5 text-[9px] text-white/60",
437
+ children: model
438
+ }, model))
439
+ }) : null]
440
+ }) : null,
441
+ snapshot.notes && snapshot.notes.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleGroup, {
442
+ title: "Notes",
443
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
444
+ className: "flex flex-col gap-1 text-[10px] text-white/50",
445
+ children: snapshot.notes.map((note, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
446
+ className: "rounded bg-white/[0.035] px-2 py-1",
447
+ children: note
448
+ }, `${index}-${note}`))
449
+ })
450
+ }) : null
451
+ ]
452
+ });
348
453
  }
349
- function useBrandappDevtoolBridge({
350
- id,
351
- label,
352
- order = 10,
353
- snapshot: controlledSnapshot
354
- }) {
355
- const isControlled = controlledSnapshot !== void 0;
356
- const [uncontrolledSnapshot, setUncontrolledSnapshot] = React.useState(controlledSnapshot != null ? controlledSnapshot : null);
357
- const snapshot = isControlled ? controlledSnapshot : uncontrolledSnapshot;
358
- const inspect = React.useCallback(
359
- (nextSnapshot) => {
360
- if (!isControlled) {
361
- setUncontrolledSnapshot(nextSnapshot);
362
- }
363
- },
364
- [isControlled]
365
- );
366
- const clear = React.useCallback(() => {
367
- if (!isControlled) {
368
- setUncontrolledSnapshot(null);
369
- }
370
- }, [isControlled]);
371
- const plugin = React.useMemo(
372
- () => ({
373
- id,
374
- label,
375
- order,
376
- tab: "brandapp",
377
- renderPanel: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BrandappDevtoolPanel, { snapshot })
378
- }),
379
- [id, label, order, snapshot]
380
- );
381
- _chunk6AGUYGVTcjs.useOptDevtoolPlugin.call(void 0, plugin);
382
- return {
383
- inspect,
384
- clear
385
- };
454
+ /** Register a Brandapp SDK integration panel in opt-devtool. */
455
+ function useBrandappDevtoolBridge({ id, label, order = 10, snapshot: controlledSnapshot }) {
456
+ const isControlled = controlledSnapshot !== void 0;
457
+ const [uncontrolledSnapshot, setUncontrolledSnapshot] = react.useState(controlledSnapshot !== null && controlledSnapshot !== void 0 ? controlledSnapshot : null);
458
+ const snapshot = isControlled ? controlledSnapshot : uncontrolledSnapshot;
459
+ const inspect = react.useCallback((nextSnapshot) => {
460
+ if (!isControlled) setUncontrolledSnapshot(nextSnapshot);
461
+ }, [isControlled]);
462
+ const clear = react.useCallback(() => {
463
+ if (!isControlled) setUncontrolledSnapshot(null);
464
+ }, [isControlled]);
465
+ const plugin = react.useMemo(() => ({
466
+ id,
467
+ label,
468
+ order,
469
+ tab: "brandapp",
470
+ renderPanel: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BrandappDevtoolPanel, { snapshot })
471
+ }), [
472
+ id,
473
+ label,
474
+ order,
475
+ snapshot
476
+ ]);
477
+ require_provider.useOptDevtoolPlugin(plugin);
478
+ return {
479
+ inspect,
480
+ clear
481
+ };
386
482
  }
387
-
388
-
389
-
390
-
391
- exports.getBrandappRequiredEnvSummary = getBrandappRequiredEnvSummary; exports.getBrandappSnapshotStatus = getBrandappSnapshotStatus; exports.useBrandappDevtoolBridge = useBrandappDevtoolBridge;
483
+ exports.getBrandappRequiredEnvSummary = getBrandappRequiredEnvSummary;
484
+ exports.getBrandappSnapshotStatus = getBrandappSnapshotStatus;
485
+ exports.useBrandappDevtoolBridge = useBrandappDevtoolBridge;