react-semaphor 0.1.375 → 0.1.377
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/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +47 -43
- package/dist/brand-studio/index.cjs +4 -9
- package/dist/brand-studio/index.js +98 -108
- package/dist/chunks/{braces-C3-w6xDL.js → braces-C2uBgj3t.js} +1 -1
- package/dist/chunks/{braces-C8QqW4wu.js → braces-CkXyWzRh.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-DXgi7q5u.js → calendar-preferences-dialog-C55VOTIy.js} +6 -5
- package/dist/chunks/calendar-preferences-dialog-DAukJOaP.js +1 -0
- package/dist/chunks/catalog-field-grounding-BGW0hnB9.js +1 -0
- package/dist/chunks/catalog-field-grounding-DHXEI7cW.js +199 -0
- package/dist/chunks/{chevrons-up-down-DSvLu4Ye.js → chevrons-up-down-BnzChFLU.js} +1 -1
- package/dist/chunks/{chevrons-up-down-CnCSGY02.js → chevrons-up-down-W0nzHzx0.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Jwbmrcl_.js → dashboard-briefing-launcher-CUyeiL_T.js} +3141 -2372
- package/dist/chunks/dashboard-briefing-launcher-DMKfG_z3.js +111 -0
- package/dist/chunks/dashboard-controls-B4hxFc3Q.js +2279 -0
- package/dist/chunks/dashboard-controls-D4vI0wvU.js +52 -0
- package/dist/chunks/dashboard-json-DQnm6daE.js +1 -0
- package/dist/chunks/{dashboard-json-Cl1O3uh0.js → dashboard-json-pl1_mFqJ.js} +14 -13
- package/dist/chunks/{edit-dashboard-visual-B_0sbc43.js → edit-dashboard-visual-CF4aSsav.js} +4729 -4645
- package/dist/chunks/edit-dashboard-visual-CjTXY51a.js +178 -0
- package/dist/chunks/{index-BIks0ktd.js → index-B2kPleRS.js} +186 -181
- package/dist/chunks/{index-BSkBy5cH.js → index-Bn866BBY.js} +22824 -22664
- package/dist/chunks/layout-grid-BFmJ7vmH.js +16 -0
- package/dist/chunks/layout-grid-CTOW9oTg.js +6 -0
- package/dist/chunks/{palette-DUGktM-M.js → palette-DrhPeer-.js} +1 -1
- package/dist/chunks/{palette-D-f4-82S.js → palette-OFaniMPn.js} +1 -1
- package/dist/chunks/{save-D3YYinDz.js → save-BxWBiQv1.js} +1 -1
- package/dist/chunks/{save-kkBEBeLg.js → save-Dh6gSC4x.js} +1 -1
- package/dist/chunks/{switch-Dkx2qEOr.js → switch-C-fGjxjY.js} +2002 -1983
- package/dist/chunks/switch-D5xopzFD.js +168 -0
- package/dist/chunks/use-create-flow-overlay-state-Dg2ffpCE.js +21 -0
- package/dist/chunks/use-create-flow-overlay-state-DrKP0jWE.js +1968 -0
- package/dist/chunks/{validation-1V7bWmYw.js → validation-BHFaWDU-.js} +1 -1
- package/dist/chunks/{validation-DlrTIf1N.js → validation-bMedDBOo.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-builder/index.cjs +18 -13
- package/dist/data-app-builder/index.js +141 -131
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +22 -21
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +151 -151
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +84 -0
- package/dist/types/main.d.ts +8 -12
- package/package.json +1 -1
- package/dist/chunks/calendar-preferences-dialog-CsRzDpDs.js +0 -1
- package/dist/chunks/catalog-field-grounding-DoEBOXQd.js +0 -100
- package/dist/chunks/catalog-field-grounding-Du6mKDcF.js +0 -1
- package/dist/chunks/dashboard-briefing-launcher-C-G6vQTL.js +0 -106
- package/dist/chunks/dashboard-controls-DzGGNQxv.js +0 -2269
- package/dist/chunks/dashboard-controls-p7VKzWSb.js +0 -57
- package/dist/chunks/dashboard-json-CvPhMpbM.js +0 -1
- package/dist/chunks/edit-dashboard-visual-CSrdS10O.js +0 -178
- package/dist/chunks/resource-management-panel-IHbUOh2g.js +0 -6
- package/dist/chunks/resource-management-panel-tFjbtgPw.js +0 -1018
- package/dist/chunks/switch-fIkmwzUt.js +0 -168
- package/dist/chunks/use-create-flow-overlay-state-D-yGZTR3.js +0 -1647
- package/dist/chunks/use-create-flow-overlay-state-DbaUD5xc.js +0 -26
- package/dist/chunks/use-visual-utils-B5hwU_av.js +0 -1
- package/dist/chunks/use-visual-utils-Dj82r7DA.js +0 -340
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
|
|
2
2
|
import * as Yn from "react";
|
|
3
|
-
import { useContext as Zn, useState as x, useRef as oe, useMemo as
|
|
3
|
+
import { useContext as Zn, useState as x, useRef as oe, useMemo as ze, useEffect as W, useCallback as Ot } from "react";
|
|
4
4
|
import * as Xn from "react-dom/client";
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
5
|
+
import { ad as ea, ae as ta, af as Ir, ag as jr, ah as zr, ai as ra, aj as Wr, ak as Hr, al as Jr, am as Vr, an as _r, ao as Ur, ap as Gr, aq as na, ar as aa, as as oa, at as Ht, au as on, w as Kr, av as sa, aw as Vt, ax as _t, ay as sn, az as ia, aA as la, aB as da } from "../chunks/index-Bn866BBY.js";
|
|
6
|
+
import { c as $e, B as H, P as it, b as lt, d as dt, a1 as ca, a2 as ua, a3 as pa, a4 as ha, a5 as ma, X as Je, f as me, R as fa, e as Ut } from "../chunks/switch-C-fGjxjY.js";
|
|
7
7
|
import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
|
|
8
|
-
import { S as
|
|
8
|
+
import { S as ga } from "../chunks/save-Dh6gSC4x.js";
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v0.453.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const ba = $e("CloudUpload", [
|
|
16
16
|
["path", { d: "M12 13v8", key: "1l5pq0" }],
|
|
17
17
|
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
|
|
18
18
|
["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
|
|
@@ -23,7 +23,7 @@ const xa = Ve("CloudUpload", [
|
|
|
23
23
|
* This source code is licensed under the ISC license.
|
|
24
24
|
* See the LICENSE file in the root directory of this source tree.
|
|
25
25
|
*/
|
|
26
|
-
const
|
|
26
|
+
const xa = $e("Folder", [
|
|
27
27
|
[
|
|
28
28
|
"path",
|
|
29
29
|
{
|
|
@@ -38,7 +38,7 @@ const wa = Ve("Folder", [
|
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
const
|
|
41
|
+
const wa = $e("ImagePlus", [
|
|
42
42
|
["path", { d: "M16 5h6", key: "1vod17" }],
|
|
43
43
|
["path", { d: "M19 2v6", key: "4bpg5p" }],
|
|
44
44
|
["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
|
|
@@ -51,7 +51,7 @@ const ya = Ve("ImagePlus", [
|
|
|
51
51
|
* This source code is licensed under the ISC license.
|
|
52
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
53
|
*/
|
|
54
|
-
const
|
|
54
|
+
const ya = $e("MousePointer2", [
|
|
55
55
|
[
|
|
56
56
|
"path",
|
|
57
57
|
{
|
|
@@ -66,10 +66,20 @@ const va = Ve("MousePointer2", [
|
|
|
66
66
|
* This source code is licensed under the ISC license.
|
|
67
67
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
68
|
*/
|
|
69
|
-
const
|
|
69
|
+
const va = $e("PanelLeftClose", [
|
|
70
70
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
71
71
|
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
72
72
|
["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
|
|
73
|
+
]);
|
|
74
|
+
/**
|
|
75
|
+
* @license lucide-react v0.453.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/
|
|
80
|
+
const ka = $e("PanelLeft", [
|
|
81
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
82
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }]
|
|
73
83
|
]), Na = [
|
|
74
84
|
{
|
|
75
85
|
id: "customer-health",
|
|
@@ -149,7 +159,7 @@ const ka = Ve("PanelLeftClose", [
|
|
|
149
159
|
reasoningEffort: "low"
|
|
150
160
|
},
|
|
151
161
|
{ id: "gpt-4.1-mini", label: "GPT-4.1 mini", model: "gpt-4.1-mini" }
|
|
152
|
-
], Qr = "semaphor-data-app-builder-transcript", qr = "semaphor-data-app-builder-preview-url", Yr = "semaphor-data-app-builder-bridge-url", Zr = "semaphor-data-app-builder-project-dir",
|
|
162
|
+
], Qr = "semaphor-data-app-builder-transcript", qr = "semaphor-data-app-builder-preview-url", Yr = "semaphor-data-app-builder-bridge-url", Zr = "semaphor-data-app-builder-project-dir", Lt = "http://semaphor-data-app.localhost:8088", Xr = "http://localhost:8787", It = "/Users/rohit/code/sandbox/semaphor-data-apps/data-app", We = 3, Aa = 18, jt = 12;
|
|
153
163
|
function he(e, a) {
|
|
154
164
|
return `${e}:${a}`;
|
|
155
165
|
}
|
|
@@ -186,9 +196,9 @@ function Re(e) {
|
|
|
186
196
|
function Be(e) {
|
|
187
197
|
return e ? "omit" : "include";
|
|
188
198
|
}
|
|
189
|
-
function
|
|
199
|
+
function He(e) {
|
|
190
200
|
if (Array.isArray(e))
|
|
191
|
-
return e.map(
|
|
201
|
+
return e.map(He);
|
|
192
202
|
if (!e || typeof e != "object")
|
|
193
203
|
return e;
|
|
194
204
|
const a = {};
|
|
@@ -202,11 +212,11 @@ function We(e) {
|
|
|
202
212
|
contentsBase64: p,
|
|
203
213
|
...h
|
|
204
214
|
} = l;
|
|
205
|
-
return
|
|
215
|
+
return He(h);
|
|
206
216
|
});
|
|
207
217
|
return;
|
|
208
218
|
}
|
|
209
|
-
a[s] =
|
|
219
|
+
a[s] = He(d);
|
|
210
220
|
}
|
|
211
221
|
}), a;
|
|
212
222
|
}
|
|
@@ -261,9 +271,9 @@ async function $a(e, a) {
|
|
|
261
271
|
status: e.status,
|
|
262
272
|
ok: e.ok
|
|
263
273
|
}, h = (v) => {
|
|
264
|
-
var
|
|
274
|
+
var L;
|
|
265
275
|
const B = v.split(`
|
|
266
|
-
`), b = ((
|
|
276
|
+
`), b = ((L = B.find((F) => F.startsWith("event:"))) == null ? void 0 : L.slice(6).trim()) || "message", E = B.filter((F) => F.startsWith("data:")).map((F) => F.slice(5).trim()).join(`
|
|
267
277
|
`);
|
|
268
278
|
if (!E) return;
|
|
269
279
|
const j = JSON.parse(E);
|
|
@@ -368,7 +378,7 @@ async function Fa(e, {
|
|
|
368
378
|
throw new Error(
|
|
369
379
|
"Data App publish requires a saved draft and matching source revision."
|
|
370
380
|
);
|
|
371
|
-
const p =
|
|
381
|
+
const p = He(e.validationStatus);
|
|
372
382
|
l == null || l({
|
|
373
383
|
phase: "start",
|
|
374
384
|
label: "Starting publish session",
|
|
@@ -405,7 +415,7 @@ async function Fa(e, {
|
|
|
405
415
|
const b = await e.buildArtifacts({
|
|
406
416
|
signal: d,
|
|
407
417
|
onProgress: l
|
|
408
|
-
}), E =
|
|
418
|
+
}), E = He(
|
|
409
419
|
b.validationStatus
|
|
410
420
|
);
|
|
411
421
|
for (const [F, z] of b.assets.entries()) {
|
|
@@ -462,16 +472,16 @@ async function Fa(e, {
|
|
|
462
472
|
validationStatus: E
|
|
463
473
|
})
|
|
464
474
|
}
|
|
465
|
-
),
|
|
466
|
-
if (!j.ok || !((B =
|
|
475
|
+
), L = await O(j, "Data App publish complete");
|
|
476
|
+
if (!j.ok || !((B = L.version) != null && B.id))
|
|
467
477
|
throw new Error(
|
|
468
|
-
|
|
478
|
+
L.error || "Data App publish could not be completed."
|
|
469
479
|
);
|
|
470
480
|
return {
|
|
471
481
|
dataAppId: e.dataAppId,
|
|
472
|
-
versionId:
|
|
473
|
-
version:
|
|
474
|
-
publishedAt:
|
|
482
|
+
versionId: L.version.id,
|
|
483
|
+
version: L.version.version,
|
|
484
|
+
publishedAt: L.version.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
475
485
|
};
|
|
476
486
|
} catch (b) {
|
|
477
487
|
throw await fetch(ye(a, `/${e.dataAppId}/publish/fail`), {
|
|
@@ -615,7 +625,7 @@ function Oa(e) {
|
|
|
615
625
|
}
|
|
616
626
|
return s(a), a.children;
|
|
617
627
|
}
|
|
618
|
-
function
|
|
628
|
+
function La(e) {
|
|
619
629
|
return {
|
|
620
630
|
idle: "Working through your request",
|
|
621
631
|
context: "Reading app context",
|
|
@@ -626,7 +636,7 @@ function Ia(e) {
|
|
|
626
636
|
planning: "Planning the changes"
|
|
627
637
|
}[e];
|
|
628
638
|
}
|
|
629
|
-
function
|
|
639
|
+
function Ia(e) {
|
|
630
640
|
return {
|
|
631
641
|
idle: "Preparing the next step.",
|
|
632
642
|
context: "Reading the app and figuring out what to change.",
|
|
@@ -685,7 +695,7 @@ function Wa(e) {
|
|
|
685
695
|
`).slice(0, 2e3)
|
|
686
696
|
};
|
|
687
697
|
}
|
|
688
|
-
function
|
|
698
|
+
function Ve(e) {
|
|
689
699
|
var h;
|
|
690
700
|
const a = Array.isArray(e == null ? void 0 : e.sources) ? e.sources : [], s = Array.isArray(e == null ? void 0 : e.inputs) ? e.inputs : [], d = Array.isArray(e == null ? void 0 : e.views) ? e.views : [], l = Array.isArray(e == null ? void 0 : e.interactions) ? e.interactions : [], p = Array.isArray((h = e == null ? void 0 : e.layout) == null ? void 0 : h.sections) ? e.layout.sections : [];
|
|
691
701
|
return !!(e && (a.length > 0 || s.length > 0 || d.length > 0 || l.length > 0 || p.length > 0));
|
|
@@ -757,7 +767,7 @@ function st(e, a) {
|
|
|
757
767
|
return Array.from(s.values());
|
|
758
768
|
}
|
|
759
769
|
function Ga(e, a) {
|
|
760
|
-
return !a || !
|
|
770
|
+
return !a || !Ve(a) ? e : !e || !Ve(e) ? a : {
|
|
761
771
|
schemaVersion: "data-app-intent/v1",
|
|
762
772
|
app: {
|
|
763
773
|
title: a.app.title || e.app.title,
|
|
@@ -772,7 +782,7 @@ function Ga(e, a) {
|
|
|
772
782
|
};
|
|
773
783
|
}
|
|
774
784
|
function an(e, a) {
|
|
775
|
-
var S, f, R, v, B, b, E, j,
|
|
785
|
+
var S, f, R, v, B, b, E, j, L;
|
|
776
786
|
const s = e.slice(-12).map(Wa), d = e.slice().reverse().find(
|
|
777
787
|
(F) => {
|
|
778
788
|
var z;
|
|
@@ -785,8 +795,8 @@ function an(e, a) {
|
|
|
785
795
|
}
|
|
786
796
|
), p = (S = e.slice().reverse().find(
|
|
787
797
|
(F) => F.type === "assistant" && !!F.operation
|
|
788
|
-
)) == null ? void 0 : S.operation, h = (
|
|
789
|
-
(F) => F.type === "assistant" &&
|
|
798
|
+
)) == null ? void 0 : S.operation, h = (Ve(a) ? a : void 0) || ((f = e.slice().reverse().find(
|
|
799
|
+
(F) => F.type === "assistant" && Ve(F.intentManifest)
|
|
790
800
|
)) == null ? void 0 : f.intentManifest), g = [
|
|
791
801
|
(R = l == null ? void 0 : l.attachments) != null && R.length ? [
|
|
792
802
|
"Most recent selected/attached target:",
|
|
@@ -807,7 +817,7 @@ function an(e, a) {
|
|
|
807
817
|
prompt: d.prompt,
|
|
808
818
|
changedFiles: ((E = d.result) == null ? void 0 : E.changedFiles) || [],
|
|
809
819
|
summary: (j = d.result) == null ? void 0 : j.summary,
|
|
810
|
-
filePlan: (
|
|
820
|
+
filePlan: (L = d.result) == null ? void 0 : L.filePlan
|
|
811
821
|
} : void 0,
|
|
812
822
|
lastOperation: p,
|
|
813
823
|
intentManifest: h || void 0
|
|
@@ -818,7 +828,7 @@ function Ka({
|
|
|
818
828
|
selectedPath: a,
|
|
819
829
|
onSelect: s
|
|
820
830
|
}) {
|
|
821
|
-
const d =
|
|
831
|
+
const d = ze(() => Oa(e), [e]);
|
|
822
832
|
return d.length === 0 ? /* @__PURE__ */ r("div", { className: "rounded-[5px] border border-border bg-background p-2 text-[11px] text-muted-foreground", children: "No browser files loaded yet." }) : /* @__PURE__ */ r("div", { className: "space-y-0.5", children: d.map((l) => /* @__PURE__ */ r(
|
|
823
833
|
cn,
|
|
824
834
|
{
|
|
@@ -849,7 +859,7 @@ function cn({
|
|
|
849
859
|
children: [
|
|
850
860
|
l ? /* @__PURE__ */ c(re, { children: [
|
|
851
861
|
/* @__PURE__ */ r(_t, { className: "h-3 w-3 rotate-90 text-muted-foreground" }),
|
|
852
|
-
/* @__PURE__ */ r(
|
|
862
|
+
/* @__PURE__ */ r(xa, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
853
863
|
] }) : /* @__PURE__ */ c(re, { children: [
|
|
854
864
|
/* @__PURE__ */ r("span", { className: "h-3 w-3" }),
|
|
855
865
|
/* @__PURE__ */ r(Vt, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
@@ -983,24 +993,24 @@ function Ya({
|
|
|
983
993
|
projectName: g,
|
|
984
994
|
onRestart: S
|
|
985
995
|
}) {
|
|
986
|
-
var Or,
|
|
987
|
-
const [f, R] = x(
|
|
996
|
+
var Or, Lr;
|
|
997
|
+
const [f, R] = x(Lt), [v, B] = x(Xr), [b, E] = x(It), [j, L] = x(!1), [F, z] = x(Lt), [ve, Y] = x(0), [A] = x(p), [_e, ct] = x(
|
|
988
998
|
l || ""
|
|
989
|
-
), [ut, Ue] = x([]), [
|
|
999
|
+
), [ut, Ue] = x([]), [De, Pe] = x([]), [Z, ge] = x([]), [Qt, Ge] = x(null), [X, Ke] = x(!1), [ee, qt] = x(!1), [Fe, un] = x(!0), [pn, se] = x("idle"), [hn, ie] = x(null), [Yt, Zt] = x(null), [Xt, Qe] = x(() => Date.now()), [Me, er] = x(null), [pt, mn] = x("gpt-5.5-low"), q = oe(null), G = oe(null), ht = oe([]), mt = oe(null), ft = oe(null), tr = oe(null), [be, ke] = x(!1), [rr, le] = x(null), [nr, gt] = x(!1), [ar, or] = x(!1), [Te, bt] = x("idle"), [sr, ir] = x(
|
|
990
1000
|
null
|
|
991
1001
|
), [fn, lr] = x(""), [gn, dr] = x([]), [xt, cr] = x([]), [wt, ur] = x(null), [pr, bn] = x([]), [xn, wn] = x(null), [yt, hr] = x(null), [vt, mr] = x(null), [xe, qe] = x(
|
|
992
1002
|
d || null
|
|
993
|
-
), [Ye, kt] = x("idle"), [fr, Nt] = x("idle"), [gr, br] = x(null), [xr, wr] = x(null), [St, Ne] = x(null), [de, J] = x(null), [yr, Ze] = x(null), [Xe, At] = x(null), [Ct, et] = x(!1), [Rt, vr] = x(""), [kr, Bt] = x(null), [Nr, Sr] = x(!1),
|
|
1003
|
+
), [Ye, kt] = x("idle"), [fr, Nt] = x("idle"), [gr, br] = x(null), [xr, wr] = x(null), [St, Ne] = x(null), [de, J] = x(null), [yr, Ze] = x(null), [Xe, At] = x(null), [Ct, et] = x(!1), [Rt, vr] = x(""), [kr, Bt] = x(null), [Nr, Sr] = x(!1), Ee = oe(
|
|
994
1004
|
null
|
|
995
|
-
), $t = oe(null), Se = oe(null), Ar = (e == null ? void 0 : e.readStatus) || Ra, tt = (e == null ? void 0 : e.runTurn) || Ba, Dt = (e == null ? void 0 : e.saveDraft) || Da, yn = (e == null ? void 0 : e.loadApp) || Pa, Pt = (e == null ? void 0 : e.publish) || Fa, V =
|
|
1005
|
+
), $t = oe(null), Se = oe(null), Ar = (e == null ? void 0 : e.readStatus) || Ra, tt = (e == null ? void 0 : e.runTurn) || Ba, Dt = (e == null ? void 0 : e.saveDraft) || Da, yn = (e == null ? void 0 : e.loadApp) || Pa, Pt = (e == null ? void 0 : e.publish) || Fa, V = ze(() => Ca(pt), [pt]), vn = ze(
|
|
996
1006
|
() => Z.find(
|
|
997
1007
|
(t) => t.type === "run" && t.id === Qt
|
|
998
1008
|
),
|
|
999
1009
|
[Qt, Z]
|
|
1000
|
-
), Ft =
|
|
1010
|
+
), Ft = ze(
|
|
1001
1011
|
() => [...Z].reverse().find((t) => t.type === "run"),
|
|
1002
1012
|
[Z]
|
|
1003
|
-
), Mt =
|
|
1013
|
+
), Mt = ze(() => {
|
|
1004
1014
|
const t = F.includes("?") ? "&" : "?";
|
|
1005
1015
|
return `${F}${t}dataAppBuilderRefresh=${ve}`;
|
|
1006
1016
|
}, [F, ve]);
|
|
@@ -1018,11 +1028,11 @@ function Ya({
|
|
|
1018
1028
|
window.removeEventListener("blur", t);
|
|
1019
1029
|
};
|
|
1020
1030
|
}, [Ct]), W(() => {
|
|
1021
|
-
|
|
1022
|
-
const t = window.localStorage.getItem(he(qr, h)) ||
|
|
1031
|
+
L(!1);
|
|
1032
|
+
const t = window.localStorage.getItem(he(qr, h)) || Lt, n = window.localStorage.getItem(he(Yr, h)) || Xr, i = window.localStorage.getItem(he(Zr, h)) || It, o = window.localStorage.getItem(
|
|
1023
1033
|
he(Qr, h)
|
|
1024
1034
|
);
|
|
1025
|
-
if (R(t), z(t), B(n), E(i),
|
|
1035
|
+
if (R(t), z(t), B(n), E(i), L(!0), o)
|
|
1026
1036
|
try {
|
|
1027
1037
|
ge(JSON.parse(o));
|
|
1028
1038
|
} catch {
|
|
@@ -1169,10 +1179,10 @@ function Ya({
|
|
|
1169
1179
|
}, [be]), W(() => {
|
|
1170
1180
|
ke(!1), gt(!1), le(null);
|
|
1171
1181
|
}, [v, b, A]), W(() => {
|
|
1172
|
-
if (X || ee ||
|
|
1173
|
-
const [t, ...n] =
|
|
1174
|
-
|
|
1175
|
-
}, [X, ee,
|
|
1182
|
+
if (X || ee || De.length === 0) return;
|
|
1183
|
+
const [t, ...n] = De;
|
|
1184
|
+
Pe(n), Br(t);
|
|
1185
|
+
}, [X, ee, De]), W(() => {
|
|
1176
1186
|
let t = !1;
|
|
1177
1187
|
const n = new AbortController();
|
|
1178
1188
|
async function i() {
|
|
@@ -1201,7 +1211,7 @@ function Ya({
|
|
|
1201
1211
|
lr(n.html), dr(n.diagnostics), cr(n.warnings || []), ur(n.cssMode || null), Y((i) => i + 1);
|
|
1202
1212
|
},
|
|
1203
1213
|
[]
|
|
1204
|
-
),
|
|
1214
|
+
), Oe = Ot(
|
|
1205
1215
|
(t = G.current, n = Se.current) => {
|
|
1206
1216
|
var m;
|
|
1207
1217
|
if (!t) return;
|
|
@@ -1223,7 +1233,7 @@ function Ya({
|
|
|
1223
1233
|
try {
|
|
1224
1234
|
const i = await ot();
|
|
1225
1235
|
if (t) return;
|
|
1226
|
-
G.current = i, bt("ready"), await rt(i),
|
|
1236
|
+
G.current = i, bt("ready"), await rt(i), Oe(i);
|
|
1227
1237
|
} catch (i) {
|
|
1228
1238
|
if (t) return;
|
|
1229
1239
|
bt("failed"), ir(
|
|
@@ -1234,7 +1244,7 @@ function Ya({
|
|
|
1234
1244
|
return n(), () => {
|
|
1235
1245
|
t = !0;
|
|
1236
1246
|
};
|
|
1237
|
-
}, [A,
|
|
1247
|
+
}, [A, Oe, rt]);
|
|
1238
1248
|
function kn(t) {
|
|
1239
1249
|
const n = G.current;
|
|
1240
1250
|
hr(t), Se.current = t, mr(
|
|
@@ -1243,7 +1253,7 @@ function Ya({
|
|
|
1243
1253
|
}
|
|
1244
1254
|
async function Cr() {
|
|
1245
1255
|
const t = G.current;
|
|
1246
|
-
!t || X || (t.resetBrowserSandbox(), await rt(t),
|
|
1256
|
+
!t || X || (t.resetBrowserSandbox(), await rt(t), Oe(t), M(
|
|
1247
1257
|
"Browser Sandbox reset to the approved starter template. Existing generated browser files were replaced in local browser storage.",
|
|
1248
1258
|
"guidance"
|
|
1249
1259
|
));
|
|
@@ -1336,7 +1346,7 @@ function Ya({
|
|
|
1336
1346
|
);
|
|
1337
1347
|
}
|
|
1338
1348
|
function M(t, n = "default", i) {
|
|
1339
|
-
const o =
|
|
1349
|
+
const o = Ve(
|
|
1340
1350
|
i == null ? void 0 : i.intentManifest
|
|
1341
1351
|
) ? i == null ? void 0 : i.intentManifest : void 0;
|
|
1342
1352
|
ge((u) => [
|
|
@@ -1509,15 +1519,15 @@ function Ya({
|
|
|
1509
1519
|
};
|
|
1510
1520
|
}
|
|
1511
1521
|
function Tn(t, n) {
|
|
1512
|
-
|
|
1522
|
+
Pe(
|
|
1513
1523
|
(i) => i.map((o) => o.id === t ? { ...o, prompt: n } : o)
|
|
1514
1524
|
);
|
|
1515
1525
|
}
|
|
1516
1526
|
function En(t) {
|
|
1517
|
-
|
|
1527
|
+
Pe((n) => n.filter((i) => i.id !== t));
|
|
1518
1528
|
}
|
|
1519
1529
|
function On(t, n) {
|
|
1520
|
-
|
|
1530
|
+
Pe(
|
|
1521
1531
|
(i) => i.map(
|
|
1522
1532
|
(o) => o.id === t ? {
|
|
1523
1533
|
...o,
|
|
@@ -1567,7 +1577,7 @@ function Ya({
|
|
|
1567
1577
|
})
|
|
1568
1578
|
);
|
|
1569
1579
|
}
|
|
1570
|
-
async function
|
|
1580
|
+
async function Ln(t, n, i) {
|
|
1571
1581
|
var k, w, C, y;
|
|
1572
1582
|
(k = q.current) == null || k.abort();
|
|
1573
1583
|
const o = new AbortController(), u = Date.now();
|
|
@@ -1578,26 +1588,26 @@ function Ya({
|
|
|
1578
1588
|
try {
|
|
1579
1589
|
let N = G.current;
|
|
1580
1590
|
N || (N = await ot(), G.current = N);
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1591
|
+
const I = N.readBrowserSandboxWorkspaceContext(), $ = (C = (w = I.files) == null ? void 0 : w.editable) != null && C.length ? tn(
|
|
1592
|
+
I.files.editable,
|
|
1583
1593
|
Se.current,
|
|
1584
1594
|
t
|
|
1585
1595
|
) : ["src/App.tsx"], ce = N.readBrowserSandboxFiles($), Ae = ce.reduce(
|
|
1586
1596
|
(ne, te) => ne + te.contents.length,
|
|
1587
1597
|
0
|
|
1588
1598
|
);
|
|
1589
|
-
let Ce = ce,
|
|
1599
|
+
let Ce = ce, Le = [], ue = i, Q = null;
|
|
1590
1600
|
const pe = [];
|
|
1591
|
-
for (let ne = 0; ne <
|
|
1592
|
-
const te =
|
|
1601
|
+
for (let ne = 0; ne < We; ne += 1) {
|
|
1602
|
+
const te = Le.length > 0 || ne > 0, Ie = te ? `repair-${ne + 1}` : "initial";
|
|
1593
1603
|
K(n, te ? "repairing" : "generating");
|
|
1594
1604
|
const _ = ue || (await tt(
|
|
1595
1605
|
{
|
|
1596
1606
|
projectId: h,
|
|
1597
1607
|
message: t,
|
|
1598
1608
|
currentFiles: Ce,
|
|
1599
|
-
workspaceContext:
|
|
1600
|
-
diagnostics:
|
|
1609
|
+
workspaceContext: I,
|
|
1610
|
+
diagnostics: Le,
|
|
1601
1611
|
repair: te,
|
|
1602
1612
|
generationModel: V.model,
|
|
1603
1613
|
generationReasoningEffort: V.reasoningEffort,
|
|
@@ -1633,7 +1643,7 @@ function Ya({
|
|
|
1633
1643
|
};
|
|
1634
1644
|
if (we.ok) {
|
|
1635
1645
|
const P = await N.compileBrowserSandboxPreviewHtml();
|
|
1636
|
-
if (lr(P.html), dr(P.diagnostics), cr(P.warnings || []), ur(P.cssMode || null), Y((U) => U + 1),
|
|
1646
|
+
if (lr(P.html), dr(P.diagnostics), cr(P.warnings || []), ur(P.cssMode || null), Y((U) => U + 1), Oe(N), P.diagnostics.length > 0) {
|
|
1637
1647
|
const U = {
|
|
1638
1648
|
command: "browser sandbox preview compile",
|
|
1639
1649
|
durationMs: 0,
|
|
@@ -1656,14 +1666,14 @@ function Ya({
|
|
|
1656
1666
|
};
|
|
1657
1667
|
}
|
|
1658
1668
|
}
|
|
1659
|
-
if (Q = D, D.ok || ne ===
|
|
1669
|
+
if (Q = D, D.ok || ne === We - 1)
|
|
1660
1670
|
break;
|
|
1661
1671
|
const T = (y = D.changedFiles) != null && y.length ? D.changedFiles : _.files.map(
|
|
1662
1672
|
(P) => P.path
|
|
1663
1673
|
);
|
|
1664
1674
|
Ce = N.readBrowserSandboxFiles(
|
|
1665
1675
|
Array.from(/* @__PURE__ */ new Set([...$, ...T]))
|
|
1666
|
-
),
|
|
1676
|
+
), Le = [zt(D)];
|
|
1667
1677
|
}
|
|
1668
1678
|
if (!Q)
|
|
1669
1679
|
throw new Error("The browser runtime loop ended without a validation result.");
|
|
@@ -1677,9 +1687,9 @@ function Ya({
|
|
|
1677
1687
|
Q.ok ? "default" : "blocked"
|
|
1678
1688
|
);
|
|
1679
1689
|
} catch (N) {
|
|
1680
|
-
const
|
|
1690
|
+
const I = N instanceof DOMException && N.name === "AbortError", $ = I ? "Timed out waiting for the browser runtime loop." : N instanceof Error ? N.message : String(N);
|
|
1681
1691
|
nt(n, {
|
|
1682
|
-
status:
|
|
1692
|
+
status: I ? "cancelled" : "failed",
|
|
1683
1693
|
error: $,
|
|
1684
1694
|
result: {
|
|
1685
1695
|
ok: !1,
|
|
@@ -1695,7 +1705,7 @@ function Ya({
|
|
|
1695
1705
|
Ke(!1), Ge(null), q.current = null, window.clearTimeout(m);
|
|
1696
1706
|
}
|
|
1697
1707
|
}
|
|
1698
|
-
async function
|
|
1708
|
+
async function In(t, n, i) {
|
|
1699
1709
|
var k, w, C, y;
|
|
1700
1710
|
(k = q.current) == null || k.abort();
|
|
1701
1711
|
const o = new AbortController(), u = Date.now();
|
|
@@ -1704,7 +1714,7 @@ function Ya({
|
|
|
1704
1714
|
o.abort();
|
|
1705
1715
|
}, 18e4);
|
|
1706
1716
|
try {
|
|
1707
|
-
const N = v.replace(/\/$/, ""),
|
|
1717
|
+
const N = v.replace(/\/$/, ""), I = async (D) => {
|
|
1708
1718
|
const T = await fetch(`${N}/read-files`, {
|
|
1709
1719
|
method: "POST",
|
|
1710
1720
|
signal: o.signal,
|
|
@@ -1773,7 +1783,7 @@ function Ya({
|
|
|
1773
1783
|
P.error || "Bridge could not apply generated files."
|
|
1774
1784
|
);
|
|
1775
1785
|
return P;
|
|
1776
|
-
},
|
|
1786
|
+
}, Le = async () => {
|
|
1777
1787
|
const D = await fetch(`${N}/validate-typecheck`, {
|
|
1778
1788
|
method: "POST",
|
|
1779
1789
|
signal: o.signal,
|
|
@@ -1791,20 +1801,20 @@ function Ya({
|
|
|
1791
1801
|
}, ue = await $();
|
|
1792
1802
|
ue.projectRoot && E(ue.projectRoot);
|
|
1793
1803
|
let Q = (C = (w = ue.files) == null ? void 0 : w.editable) != null && C.length ? en(ue.files.editable) : ["src/App.tsx"];
|
|
1794
|
-
const pe = await
|
|
1804
|
+
const pe = await I(Q), ne = pe.reduce(
|
|
1795
1805
|
(D, T) => D + T.contents.length,
|
|
1796
1806
|
0
|
|
1797
1807
|
);
|
|
1798
1808
|
let te = [];
|
|
1799
1809
|
if (Ea(t)) {
|
|
1800
|
-
const D = await
|
|
1810
|
+
const D = await Le();
|
|
1801
1811
|
D.ok || (te = [
|
|
1802
1812
|
zt(D)
|
|
1803
1813
|
]);
|
|
1804
1814
|
}
|
|
1805
1815
|
let Ie = pe, _ = null;
|
|
1806
1816
|
const we = [];
|
|
1807
|
-
for (let D = 0; D <
|
|
1817
|
+
for (let D = 0; D < We; D += 1) {
|
|
1808
1818
|
const T = te.length > 0 || D > 0, P = T ? `repair-${D + 1}` : "initial";
|
|
1809
1819
|
K(n, T ? "repairing" : "generating");
|
|
1810
1820
|
const U = await Ae({
|
|
@@ -1818,7 +1828,7 @@ function Ya({
|
|
|
1818
1828
|
...U,
|
|
1819
1829
|
attemptLabel: P
|
|
1820
1830
|
});
|
|
1821
|
-
if (z(f), Y((
|
|
1831
|
+
if (z(f), Y((je) => je + 1), we.push(...ae.attempts || []), _ = {
|
|
1822
1832
|
...ae,
|
|
1823
1833
|
attempts: [...we],
|
|
1824
1834
|
filePlan: U.plan,
|
|
@@ -1827,16 +1837,16 @@ function Ya({
|
|
|
1827
1837
|
contextChars: ne,
|
|
1828
1838
|
generatedFileCount: U.files.length,
|
|
1829
1839
|
generatedChars: U.files.reduce(
|
|
1830
|
-
(
|
|
1840
|
+
(je, qn) => je + qn.contents.length,
|
|
1831
1841
|
0
|
|
1832
1842
|
),
|
|
1833
1843
|
repairAttempts: we.filter(
|
|
1834
|
-
(
|
|
1844
|
+
(je) => je.label.startsWith("repair")
|
|
1835
1845
|
).length
|
|
1836
1846
|
}
|
|
1837
|
-
}, K(n, "typechecking"), ae.ok || D ===
|
|
1847
|
+
}, K(n, "typechecking"), ae.ok || D === We - 1)
|
|
1838
1848
|
break;
|
|
1839
|
-
Ie = (((y = ae.changedFiles) == null ? void 0 : y.length) || 0) > 0 ? await
|
|
1849
|
+
Ie = (((y = ae.changedFiles) == null ? void 0 : y.length) || 0) > 0 ? await I(
|
|
1840
1850
|
Q = Array.from(
|
|
1841
1851
|
/* @__PURE__ */ new Set([
|
|
1842
1852
|
...Q,
|
|
@@ -1857,9 +1867,9 @@ function Ya({
|
|
|
1857
1867
|
_.ok ? "default" : "blocked"
|
|
1858
1868
|
);
|
|
1859
1869
|
} catch (N) {
|
|
1860
|
-
const
|
|
1870
|
+
const I = N instanceof DOMException && N.name === "AbortError", $ = I ? "Timed out waiting for the app-builder/bridge loop. The target app may still have updated through HMR." : N instanceof Error ? N.message : String(N);
|
|
1861
1871
|
nt(n, {
|
|
1862
|
-
status:
|
|
1872
|
+
status: I ? "cancelled" : "failed",
|
|
1863
1873
|
error: $,
|
|
1864
1874
|
result: {
|
|
1865
1875
|
ok: !1,
|
|
@@ -1963,7 +1973,7 @@ function Ya({
|
|
|
1963
1973
|
};
|
|
1964
1974
|
}
|
|
1965
1975
|
async function Mr(t) {
|
|
1966
|
-
var k, w, C, y, N,
|
|
1976
|
+
var k, w, C, y, N, I;
|
|
1967
1977
|
const { workspaceContext: n } = await Pr(t), i = v.replace(/\/$/, ""), o = await fetch(`${i}/source-snapshot`, {
|
|
1968
1978
|
method: "POST",
|
|
1969
1979
|
signal: t,
|
|
@@ -1995,7 +2005,7 @@ function Ya({
|
|
|
1995
2005
|
}
|
|
1996
2006
|
const u = (y = (C = n.files) == null ? void 0 : C.snapshot) != null && y.length ? n.files.snapshot : [
|
|
1997
2007
|
...((N = n.files) == null ? void 0 : N.source) || [],
|
|
1998
|
-
...((
|
|
2008
|
+
...((I = n.files) == null ? void 0 : I.root) || []
|
|
1999
2009
|
], m = await Et(
|
|
2000
2010
|
[...new Set(u.length ? u : ["src/App.tsx"])],
|
|
2001
2011
|
t
|
|
@@ -2137,8 +2147,8 @@ function Ya({
|
|
|
2137
2147
|
}
|
|
2138
2148
|
}
|
|
2139
2149
|
async function Er() {
|
|
2140
|
-
if (
|
|
2141
|
-
return
|
|
2150
|
+
if (Ee.current)
|
|
2151
|
+
return Ee.current;
|
|
2142
2152
|
if (!Dt)
|
|
2143
2153
|
return M(
|
|
2144
2154
|
"Save draft is not configured in this host yet.",
|
|
@@ -2194,10 +2204,10 @@ function Ya({
|
|
|
2194
2204
|
detail: u
|
|
2195
2205
|
}), M(`Save draft failed: ${u}`, "blocked"), null;
|
|
2196
2206
|
} finally {
|
|
2197
|
-
|
|
2207
|
+
Ee.current = null;
|
|
2198
2208
|
}
|
|
2199
2209
|
})();
|
|
2200
|
-
return
|
|
2210
|
+
return Ee.current = n, n;
|
|
2201
2211
|
}
|
|
2202
2212
|
async function Un(t) {
|
|
2203
2213
|
var u;
|
|
@@ -2224,7 +2234,7 @@ function Ya({
|
|
|
2224
2234
|
);
|
|
2225
2235
|
return;
|
|
2226
2236
|
}
|
|
2227
|
-
if (Ye === "saving" && !
|
|
2237
|
+
if (Ye === "saving" && !Ee.current) {
|
|
2228
2238
|
M("Save draft is already in progress.", "blocked");
|
|
2229
2239
|
return;
|
|
2230
2240
|
}
|
|
@@ -2427,7 +2437,7 @@ function Ya({
|
|
|
2427
2437
|
}), se("planning"), ie(
|
|
2428
2438
|
(k = (m = y.revision.plan) == null ? void 0 : m.files) != null && k.length ? `Preparing edits for ${y.revision.plan.files.length} file${y.revision.plan.files.length === 1 ? "" : "s"}.` : "Preparing the file edit and validation run."
|
|
2429
2439
|
);
|
|
2430
|
-
const N = fe("run"),
|
|
2440
|
+
const N = fe("run"), I = Date.now();
|
|
2431
2441
|
ge(($) => [
|
|
2432
2442
|
...$,
|
|
2433
2443
|
{
|
|
@@ -2436,10 +2446,10 @@ function Ya({
|
|
|
2436
2446
|
prompt: i,
|
|
2437
2447
|
status: "running",
|
|
2438
2448
|
steps: Ta(),
|
|
2439
|
-
createdAt:
|
|
2440
|
-
startedAt:
|
|
2449
|
+
createdAt: I,
|
|
2450
|
+
startedAt: I
|
|
2441
2451
|
}
|
|
2442
|
-
]), q.current = null, A === "browser" ?
|
|
2452
|
+
]), q.current = null, A === "browser" ? Ln(i, N, y.revision) : In(i, N, y.revision);
|
|
2443
2453
|
} catch (w) {
|
|
2444
2454
|
const C = w instanceof DOMException && w.name === "AbortError";
|
|
2445
2455
|
M(
|
|
@@ -2461,7 +2471,7 @@ function Ya({
|
|
|
2461
2471
|
createdAt: i
|
|
2462
2472
|
};
|
|
2463
2473
|
if (ct(""), Ue([]), X || ee) {
|
|
2464
|
-
|
|
2474
|
+
Pe((m) => [...m, u]);
|
|
2465
2475
|
return;
|
|
2466
2476
|
}
|
|
2467
2477
|
Br(u);
|
|
@@ -2473,9 +2483,9 @@ function Ya({
|
|
|
2473
2483
|
className: "h-full min-h-0 flex-1",
|
|
2474
2484
|
direction: "horizontal",
|
|
2475
2485
|
children: [
|
|
2476
|
-
|
|
2486
|
+
Fe ? /* @__PURE__ */ c(re, { children: [
|
|
2477
2487
|
/* @__PURE__ */ r(
|
|
2478
|
-
|
|
2488
|
+
Ir,
|
|
2479
2489
|
{
|
|
2480
2490
|
className: "min-w-[320px] max-w-[760px]",
|
|
2481
2491
|
defaultSize: 28,
|
|
@@ -2569,10 +2579,10 @@ function Ya({
|
|
|
2569
2579
|
onSubmit: Qn,
|
|
2570
2580
|
className: "border-t border-border p-3",
|
|
2571
2581
|
children: [
|
|
2572
|
-
|
|
2582
|
+
De.length > 0 ? /* @__PURE__ */ r(
|
|
2573
2583
|
no,
|
|
2574
2584
|
{
|
|
2575
|
-
turns:
|
|
2585
|
+
turns: De,
|
|
2576
2586
|
onDelete: En,
|
|
2577
2587
|
onRemoveAttachment: On,
|
|
2578
2588
|
onUpdatePrompt: Tn
|
|
@@ -2650,7 +2660,7 @@ function Ya({
|
|
|
2650
2660
|
return (t = tr.current) == null ? void 0 : t.click();
|
|
2651
2661
|
},
|
|
2652
2662
|
children: [
|
|
2653
|
-
/* @__PURE__ */ r(
|
|
2663
|
+
/* @__PURE__ */ r(wa, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2654
2664
|
"Screenshot"
|
|
2655
2665
|
]
|
|
2656
2666
|
}
|
|
@@ -2658,18 +2668,18 @@ function Ya({
|
|
|
2658
2668
|
}
|
|
2659
2669
|
)
|
|
2660
2670
|
] }),
|
|
2661
|
-
/* @__PURE__ */ c(
|
|
2671
|
+
/* @__PURE__ */ c(ca, { value: pt, onValueChange: mn, children: [
|
|
2662
2672
|
/* @__PURE__ */ r(
|
|
2663
|
-
|
|
2673
|
+
ua,
|
|
2664
2674
|
{
|
|
2665
2675
|
"aria-label": "Generation model",
|
|
2666
2676
|
title: "Model used to generate changes",
|
|
2667
2677
|
className: "h-7 w-auto gap-1.5 border-0 bg-transparent px-1.5 text-[11px] text-muted-foreground shadow-none hover:text-foreground focus:ring-0",
|
|
2668
|
-
children: /* @__PURE__ */ r(
|
|
2678
|
+
children: /* @__PURE__ */ r(pa, { placeholder: "Model" })
|
|
2669
2679
|
}
|
|
2670
2680
|
),
|
|
2671
|
-
/* @__PURE__ */ r(
|
|
2672
|
-
|
|
2681
|
+
/* @__PURE__ */ r(ha, { align: "start", children: Jt.map((t) => /* @__PURE__ */ r(
|
|
2682
|
+
ma,
|
|
2673
2683
|
{
|
|
2674
2684
|
value: t.id,
|
|
2675
2685
|
className: "text-[12px]",
|
|
@@ -2704,7 +2714,7 @@ function Ya({
|
|
|
2704
2714
|
return (t = q.current) == null ? void 0 : t.abort();
|
|
2705
2715
|
},
|
|
2706
2716
|
children: [
|
|
2707
|
-
/* @__PURE__ */ r(
|
|
2717
|
+
/* @__PURE__ */ r(Je, { className: "h-3 w-3" }),
|
|
2708
2718
|
"Stop"
|
|
2709
2719
|
]
|
|
2710
2720
|
}
|
|
@@ -2738,10 +2748,10 @@ function Ya({
|
|
|
2738
2748
|
)
|
|
2739
2749
|
] }) : null,
|
|
2740
2750
|
/* @__PURE__ */ r(
|
|
2741
|
-
|
|
2751
|
+
Ir,
|
|
2742
2752
|
{
|
|
2743
2753
|
className: "min-w-0",
|
|
2744
|
-
defaultSize:
|
|
2754
|
+
defaultSize: Fe ? 72 : 100,
|
|
2745
2755
|
minSize: 35,
|
|
2746
2756
|
order: 2,
|
|
2747
2757
|
children: /* @__PURE__ */ c("main", { className: "flex h-full min-w-0 flex-col bg-muted/40", children: [
|
|
@@ -2753,10 +2763,10 @@ function Ya({
|
|
|
2753
2763
|
variant: "ghost",
|
|
2754
2764
|
size: "xs",
|
|
2755
2765
|
className: "-ml-1 gap-1.5 px-1.5 text-muted-foreground",
|
|
2756
|
-
title:
|
|
2757
|
-
"aria-label":
|
|
2766
|
+
title: Fe ? "Hide chat" : "Show chat",
|
|
2767
|
+
"aria-label": Fe ? "Hide chat" : "Show chat",
|
|
2758
2768
|
onClick: () => un((t) => !t),
|
|
2759
|
-
children:
|
|
2769
|
+
children: Fe ? /* @__PURE__ */ r(va, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(ka, { className: "h-3.5 w-3.5" })
|
|
2760
2770
|
}
|
|
2761
2771
|
),
|
|
2762
2772
|
/* @__PURE__ */ c("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
@@ -2878,7 +2888,7 @@ function Ya({
|
|
|
2878
2888
|
disabled: X || ee,
|
|
2879
2889
|
title: "Reset the app to a blank development template",
|
|
2880
2890
|
children: [
|
|
2881
|
-
/* @__PURE__ */ r(
|
|
2891
|
+
/* @__PURE__ */ r(fa, { className: "h-3.5 w-3.5" }),
|
|
2882
2892
|
"Reset app"
|
|
2883
2893
|
]
|
|
2884
2894
|
}
|
|
@@ -2905,7 +2915,7 @@ function Ya({
|
|
|
2905
2915
|
title: "Save the current local source snapshot as a Semaphor draft",
|
|
2906
2916
|
onClick: () => void Er(),
|
|
2907
2917
|
children: [
|
|
2908
|
-
Ye === "saving" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(
|
|
2918
|
+
Ye === "saving" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ga, { className: "h-3.5 w-3.5" }),
|
|
2909
2919
|
"Save draft"
|
|
2910
2920
|
]
|
|
2911
2921
|
}
|
|
@@ -2921,7 +2931,7 @@ function Ya({
|
|
|
2921
2931
|
title: "Build, upload, and publish the current Data App",
|
|
2922
2932
|
onClick: () => void Gn(),
|
|
2923
2933
|
children: [
|
|
2924
|
-
fr === "publishing" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(
|
|
2934
|
+
fr === "publishing" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ba, { className: "h-3.5 w-3.5" }),
|
|
2925
2935
|
"Publish"
|
|
2926
2936
|
]
|
|
2927
2937
|
}
|
|
@@ -2937,7 +2947,7 @@ function Ya({
|
|
|
2937
2947
|
title: "Select an element in the preview and attach its DOM/React context",
|
|
2938
2948
|
onClick: () => be ? Fn() : void Pn(),
|
|
2939
2949
|
children: [
|
|
2940
|
-
ar ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(
|
|
2950
|
+
ar ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ya, { className: "h-3.5 w-3.5" }),
|
|
2941
2951
|
be ? "Cancel inspect" : "Inspect"
|
|
2942
2952
|
]
|
|
2943
2953
|
}
|
|
@@ -2951,7 +2961,7 @@ function Ya({
|
|
|
2951
2961
|
size: "xs",
|
|
2952
2962
|
className: "gap-1.5 text-muted-foreground",
|
|
2953
2963
|
children: [
|
|
2954
|
-
/* @__PURE__ */ r(
|
|
2964
|
+
/* @__PURE__ */ r(sa, { className: "h-3.5 w-3.5" }),
|
|
2955
2965
|
"Runtime",
|
|
2956
2966
|
A === "browser" && xt.length > 0 ? /* @__PURE__ */ r("span", { className: "text-[10px] text-amber-600", children: "CSS fallback" }) : null
|
|
2957
2967
|
]
|
|
@@ -2969,7 +2979,7 @@ function Ya({
|
|
|
2969
2979
|
{
|
|
2970
2980
|
label: "App Directory",
|
|
2971
2981
|
value: b,
|
|
2972
|
-
placeholder:
|
|
2982
|
+
placeholder: It,
|
|
2973
2983
|
onChange: E
|
|
2974
2984
|
}
|
|
2975
2985
|
),
|
|
@@ -2999,7 +3009,7 @@ function Ya({
|
|
|
2999
3009
|
variant: "outline",
|
|
3000
3010
|
size: "xs",
|
|
3001
3011
|
className: "h-6 shrink-0 text-[10.5px]",
|
|
3002
|
-
disabled: X || ee ||
|
|
3012
|
+
disabled: X || ee || Te !== "ready",
|
|
3003
3013
|
onClick: () => void Cr(),
|
|
3004
3014
|
children: "Reset"
|
|
3005
3015
|
}
|
|
@@ -3020,7 +3030,7 @@ function Ya({
|
|
|
3020
3030
|
title: "Reload the live preview",
|
|
3021
3031
|
"aria-label": "Reload the live preview",
|
|
3022
3032
|
onClick: () => {
|
|
3023
|
-
A === "browser" ? (rt(),
|
|
3033
|
+
A === "browser" ? (rt(), Oe()) : (z(f), Y((t) => t + 1));
|
|
3024
3034
|
},
|
|
3025
3035
|
children: /* @__PURE__ */ r(Kr, { className: "h-3.5 w-3.5" })
|
|
3026
3036
|
}
|
|
@@ -3032,7 +3042,7 @@ function Ya({
|
|
|
3032
3042
|
{
|
|
3033
3043
|
className: `flex items-start gap-2 rounded-[6px] border px-2.5 py-2 text-[11.5px] leading-relaxed ${de.state === "failed" ? "border-destructive/30 bg-destructive/10 text-destructive" : de.state === "done" ? "border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300" : "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/60 dark:bg-blue-950/30 dark:text-blue-300"}`,
|
|
3034
3044
|
children: [
|
|
3035
|
-
de.state === "running" ? /* @__PURE__ */ r(me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 animate-spin" }) : de.state === "done" ? /* @__PURE__ */ r(Ut, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ r(
|
|
3045
|
+
de.state === "running" ? /* @__PURE__ */ r(me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 animate-spin" }) : de.state === "done" ? /* @__PURE__ */ r(Ut, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ r(Je, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
|
|
3036
3046
|
/* @__PURE__ */ c("div", { className: "min-w-0", children: [
|
|
3037
3047
|
/* @__PURE__ */ r("div", { className: "font-medium", children: de.label }),
|
|
3038
3048
|
de.detail ? /* @__PURE__ */ r("div", { className: "mt-0.5 truncate opacity-80", children: de.detail }) : null
|
|
@@ -3040,13 +3050,13 @@ function Ya({
|
|
|
3040
3050
|
]
|
|
3041
3051
|
}
|
|
3042
3052
|
) }) : null,
|
|
3043
|
-
(A === "browser" && (
|
|
3044
|
-
A === "browser" &&
|
|
3045
|
-
A === "browser" &&
|
|
3053
|
+
(A === "browser" && (Te === "loading" || Te === "failed") || Me && !((Or = Me.appBuilder) != null && Or.hasOpenAiKey)) && /* @__PURE__ */ c("div", { className: "shrink-0 border-b border-border px-3 py-2", children: [
|
|
3054
|
+
A === "browser" && Te === "loading" && /* @__PURE__ */ r("p", { className: "text-[11px] leading-relaxed text-muted-foreground", children: "Loading the in-browser runtime…" }),
|
|
3055
|
+
A === "browser" && Te === "failed" && /* @__PURE__ */ c("div", { className: "rounded-[5px] border border-border bg-muted/40 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground", children: [
|
|
3046
3056
|
"Browser runtime is unavailable. Link or install semaphor-browser-runtime, or use the local bridge path.",
|
|
3047
3057
|
sr ? /* @__PURE__ */ r("pre", { className: "mt-1.5 whitespace-pre-wrap font-mono text-[10.5px] text-muted-foreground", children: sr }) : null
|
|
3048
3058
|
] }),
|
|
3049
|
-
|
|
3059
|
+
Me && !((Lr = Me.appBuilder) != null && Lr.hasOpenAiKey) && /* @__PURE__ */ r("div", { className: "rounded-[5px] border border-destructive/30 bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive", children: Me.error || "OPENAI_API_KEY is not configured." })
|
|
3050
3060
|
] }),
|
|
3051
3061
|
A === "browser" && gn.length > 0 && /* @__PURE__ */ r("div", { className: "shrink-0 border-b border-border px-3 py-1.5 text-[11px] text-amber-700 dark:text-amber-400", children: "Preview compiled with diagnostics. The next prompt can use them for repair." }),
|
|
3052
3062
|
/* @__PURE__ */ c("div", { className: "flex min-h-0 flex-1", children: [
|
|
@@ -3141,7 +3151,7 @@ function Za({ code: e, lang: a }) {
|
|
|
3141
3151
|
}
|
|
3142
3152
|
)
|
|
3143
3153
|
] }),
|
|
3144
|
-
/* @__PURE__ */ r("div", { className: "overflow-x-auto bg-background", children: /* @__PURE__ */ r(
|
|
3154
|
+
/* @__PURE__ */ r("div", { className: "overflow-x-auto bg-background", children: /* @__PURE__ */ r(la, { code: e, language: a || "tsx" }) })
|
|
3145
3155
|
] });
|
|
3146
3156
|
}
|
|
3147
3157
|
const Xa = /(\b[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*\.(?:tsx?|jsx?|mjs|cjs|css|scss|json|mdx?|html?|ya?ml|toml|sql|sh|py|rb|go|rs)\b)/g;
|
|
@@ -3307,7 +3317,7 @@ function Kt({
|
|
|
3307
3317
|
className: "rounded-[3px] p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3308
3318
|
onClick: () => a(e.id),
|
|
3309
3319
|
"aria-label": `Remove ${e.name}`,
|
|
3310
|
-
children: /* @__PURE__ */ r(
|
|
3320
|
+
children: /* @__PURE__ */ r(Je, { className: "h-3 w-3" })
|
|
3311
3321
|
}
|
|
3312
3322
|
) : null
|
|
3313
3323
|
] });
|
|
@@ -3405,7 +3415,7 @@ function lo({
|
|
|
3405
3415
|
}) {
|
|
3406
3416
|
const [s, d] = x(""), [l, p] = x("all"), h = s.trim().toLowerCase(), g = e.fields.filter((f) => {
|
|
3407
3417
|
var E, j;
|
|
3408
|
-
const R = (E = f.role) == null ? void 0 : E.toLowerCase(), v = (j = f.dataType) == null ? void 0 : j.toLowerCase(), B = l === "all" || l === "measures" && (R === "measure" || R === "metric") || l === "dimensions" && R === "dimension" || l === "dates" && (R === "date" || v === "date" || v === "timestamp") || l === "identifiers" && R === "identifier" || l === "calculated" && f.source === "calculated", b = !h || [f.name, f.label, f.role, f.dataType].filter((
|
|
3418
|
+
const R = (E = f.role) == null ? void 0 : E.toLowerCase(), v = (j = f.dataType) == null ? void 0 : j.toLowerCase(), B = l === "all" || l === "measures" && (R === "measure" || R === "metric") || l === "dimensions" && R === "dimension" || l === "dates" && (R === "date" || v === "date" || v === "timestamp") || l === "identifiers" && R === "identifier" || l === "calculated" && f.source === "calculated", b = !h || [f.name, f.label, f.role, f.dataType].filter((L) => typeof L == "string").some((L) => L.toLowerCase().includes(h));
|
|
3409
3419
|
return B && b;
|
|
3410
3420
|
}), S = [
|
|
3411
3421
|
{ id: "all", label: "All", count: e.counts.total },
|
|
@@ -3440,7 +3450,7 @@ function lo({
|
|
|
3440
3450
|
className: "h-7 w-7 text-muted-foreground",
|
|
3441
3451
|
"aria-label": "Close field inspector",
|
|
3442
3452
|
onClick: a,
|
|
3443
|
-
children: /* @__PURE__ */ r(
|
|
3453
|
+
children: /* @__PURE__ */ r(Je, { className: "h-3.5 w-3.5" })
|
|
3444
3454
|
}
|
|
3445
3455
|
)
|
|
3446
3456
|
] }),
|
|
@@ -3456,7 +3466,7 @@ function lo({
|
|
|
3456
3466
|
e.dataset.primaryDateField
|
|
3457
3467
|
] }) : null,
|
|
3458
3468
|
/* @__PURE__ */ c("label", { className: "mt-3 flex h-8 items-center gap-2 rounded-[5px] border border-border bg-background px-2", children: [
|
|
3459
|
-
/* @__PURE__ */ r(
|
|
3469
|
+
/* @__PURE__ */ r(ia, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
3460
3470
|
/* @__PURE__ */ r(
|
|
3461
3471
|
"input",
|
|
3462
3472
|
{
|
|
@@ -3511,7 +3521,7 @@ function co({
|
|
|
3511
3521
|
detail: a,
|
|
3512
3522
|
elapsedMs: s
|
|
3513
3523
|
}) {
|
|
3514
|
-
const d =
|
|
3524
|
+
const d = La(e), l = a || Ia(e);
|
|
3515
3525
|
return /* @__PURE__ */ c("div", { className: "max-w-[92%] rounded-[6px] rounded-bl-[2px] border border-border bg-background px-3 py-2.5", children: [
|
|
3516
3526
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
3517
3527
|
/* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground" }),
|
|
@@ -3656,12 +3666,12 @@ function po({
|
|
|
3656
3666
|
"attempt ",
|
|
3657
3667
|
(a || 0) + 1,
|
|
3658
3668
|
" / ",
|
|
3659
|
-
|
|
3669
|
+
We
|
|
3660
3670
|
] }) : /* @__PURE__ */ r("span", { children: Gt(e) }) })
|
|
3661
3671
|
] });
|
|
3662
3672
|
}
|
|
3663
3673
|
function ho({ state: e }) {
|
|
3664
|
-
return e === "done" ? /* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5 text-emerald-600" }) : e === "running" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin text-blue-600" }) : e === "blocked" ? /* @__PURE__ */ r(
|
|
3674
|
+
return e === "done" ? /* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5 text-emerald-600" }) : e === "running" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin text-blue-600" }) : e === "blocked" ? /* @__PURE__ */ r(Je, { className: "h-3.5 w-3.5 text-destructive" }) : /* @__PURE__ */ r(da, { className: "h-2.5 w-2.5 fill-zinc-300 stroke-none" });
|
|
3665
3675
|
}
|
|
3666
3676
|
export {
|
|
3667
3677
|
yo as DataAppBuilder
|