@hanzo/dev 4.2.0 → 4.2.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.
- package/dist/{BinaryViewer-CmFUK4zZ.js → BinaryViewer-CeQaKnXQ.js} +19 -19
- package/dist/{ChatMarkdown-nvEI7iCv.js → ChatMarkdown-DqKVAYd6.js} +2460 -2460
- package/dist/{DevicePanel-v5e3sEIf.js → DevicePanel-D-pksK3r.js} +532 -532
- package/dist/{DeviceStreamView-CCIfmbxH.js → DeviceStreamView-DsCoOzDV.js} +377 -377
- package/dist/{DiffCommentAnnotation-BPTN_2a6.js → DiffCommentAnnotation-CCtanhmq.js} +227 -227
- package/dist/{DiffFileTree-B_br90vY.js → DiffFileTree-BhEDIwzm.js} +13 -13
- package/dist/{DiffPanel-V5R5TPuK.js → DiffPanel-BPZ6Ru_G.js} +328 -328
- package/dist/{DiffWorkerPoolProvider-BwFR-Fc9.js → DiffWorkerPoolProvider-8Qh-Y5iP.js} +3 -3
- package/dist/{DocumentPages-VSn83vty.js → DocumentPages-MN1xyIRb.js} +3 -3
- package/dist/{ExpandedImageDialog-CAorLacL.js → ExpandedImageDialog-tCY2TFXU.js} +404 -404
- package/dist/{FileExplorerPane-CeHulcPz.js → FileExplorerPane-BgJw-BA4.js} +4 -4
- package/dist/{FilePreviewPanel-BVNLvWOc.js → FilePreviewPanel-DHteid8j.js} +1089 -1089
- package/dist/{FontFilePreview-Dj8Blcay.js → FontFilePreview-COxgoDy5.js} +2 -2
- package/dist/{FontViewer-CLDdwhSr.js → FontViewer-jxARaj1f.js} +5 -5
- package/dist/{HanzoConnectAccountPages-BEzYfu2l.js → HanzoConnectAccountPages-BM2mB27b.js} +357 -357
- package/dist/{HanzoConnectSidebarSignIn-BhD6-Up5.js → HanzoConnectSidebarSignIn-BSOkKAjH.js} +3 -3
- package/dist/{Icons-CvSmt8vD.js → Icons-CdegMw5l.js} +1 -1
- package/dist/{LargeTextViewer-DfFnYGCw.js → LargeTextViewer-BX5-yWcy.js} +8 -8
- package/dist/{MermaidDiagram-CTolIzQD.js → MermaidDiagram-sVLnox7j.js} +8 -8
- package/dist/{MermaidFilePreview-CP2zP4FU.js → MermaidFilePreview-BqB2exZU.js} +2 -2
- package/dist/{MermaidViewer-BDfYkS9E.js → MermaidViewer-B0WYx1jk.js} +3 -3
- package/dist/{NotebookPreview-Cybs5uM0.js → NotebookPreview-B_7pSd7A.js} +10 -10
- package/dist/{OfficeFilePreview-7JsmSoKU.js → OfficeFilePreview-BJsNoaju.js} +2 -2
- package/dist/{OfficeViewer-CJoojlJK.js → OfficeViewer-TgdFnOtV.js} +10 -10
- package/dist/{OpenInPicker-BIMWUxBP.js → OpenInPicker-B3gPcFs6.js} +287 -287
- package/dist/{OpenXmlOfficeViewer-C24Kj8DM.js → OpenXmlOfficeViewer-C18a0NFP.js} +4 -4
- package/dist/{PdfViewer-Cf1iD759.js → PdfViewer-BanXvPmz.js} +16 -16
- package/dist/{PreviewFaviconIcon-zFOuzIxe.js → PreviewFaviconIcon-Dzjf4QXZ.js} +892 -892
- package/dist/{PreviewImage-oY5YnuTr.js → PreviewImage-Ct8eWJb8.js} +3 -3
- package/dist/{PreviewImageContent-n6eLzY99.js → PreviewImageContent-Dd8dzt9u.js} +3 -3
- package/dist/{PreviewPanel-Bo4Lt02m.js → PreviewPanel-BnsoHObW.js} +489 -489
- package/dist/{PreviewPanelShell-DhXLeN5j.js → PreviewPanelShell-Dezxjg0T.js} +71 -71
- package/dist/{ProjectIconPickerDialog-D0kFzt8f.js → ProjectIconPickerDialog-LomrzROv.js} +29 -29
- package/dist/{ProjectMonogram-D35xrrXQ.js → ProjectMonogram-D21--FQY.js} +1 -1
- package/dist/{ProviderAuthTerminal-DfsXnu7A.js → ProviderAuthTerminal-CYalqlUB.js} +3 -3
- package/dist/{PullRequestCodeTab-Dv_0kVad.js → PullRequestCodeTab-Jt9jdq55.js} +476 -476
- package/dist/{PullRequestReviewAnnotation-LeuwO-iH.js → PullRequestReviewAnnotation-xg3n0doV.js} +334 -334
- package/dist/{ReadOnlySourcePreview-D__IA5g1.js → ReadOnlySourcePreview-BYlRPbKI.js} +5 -5
- package/dist/{RelativeTime-BMRprQS8.js → RelativeTime-DQhoNsWZ.js} +2 -2
- package/dist/{RightPanelResizeHandle-BLbSz-gk.js → RightPanelResizeHandle-PumvYb9P.js} +2 -2
- package/dist/{ThemeEditorPanel-CUDdsRsE.js → ThemeEditorPanel-BmXXpaCI.js} +196 -196
- package/dist/{ThreadTerminalDrawer-BF3Ix0q_.js → ThreadTerminalDrawer-Cf4l2axO.js} +461 -461
- package/dist/{VirtualTablePreview-dajviAfu.js → VirtualTablePreview-mA6DOFwb.js} +1 -1
- package/dist/{anchoredCopyToast-DnUtg1n_.js → anchoredCopyToast-BVa_dlBU.js} +2 -2
- package/dist/{assetUrls-DkY7vXfM.js → assetUrls-D8lRk7Xd.js} +45 -45
- package/dist/{browserLinkTarget-CA46wnQC.js → browserLinkTarget-CCzAioAu.js} +18 -18
- package/dist/builder/api/models.d.ts +2 -0
- package/dist/builder/api/models.js +6 -1
- package/dist/builder/api/sandbox.d.ts +2 -0
- package/dist/builder/api/sandbox.js +3 -1
- package/dist/builder/desk.d.ts +6 -0
- package/dist/builder/desk.js +79 -14
- package/dist/builder/mind.d.ts +5 -5
- package/dist/builder/mind.js +35 -14
- package/dist/builder/pane.d.ts +1 -1
- package/dist/builder/pane.js +1 -1
- package/dist/builder/panel.js +5 -5
- package/dist/builder/preview-fallback.d.ts +47 -0
- package/dist/builder/preview-fallback.js +341 -0
- package/dist/{changedFileKind-D6QYvIez.js → changedFileKind-OIp-fuQd.js} +5 -5
- package/dist/{collapsible-DFT41MdC.js → collapsible-CDT6JKbk.js} +1 -1
- package/dist/{color-picker-CshqBbpY.js → color-picker-kSVcH92L.js} +16 -16
- package/dist/core.d.ts +38 -0
- package/dist/core.js +1 -1
- package/dist/{decodeImagePreview-DnfFEjhw.js → decodeImagePreview-DbkSuh7q.js} +2 -2
- package/dist/{delimitedPreview-BiEpdYOj.js → delimitedPreview-DbbXcqOT.js} +1 -1
- package/dist/{dialog-DhQtWGRa.js → dialog-EmpqFZiK.js} +40 -40
- package/dist/{embed-c030vUqM.js → embed-CzXFS50X.js} +39626 -38922
- package/dist/{empty-Bm5EzcG8.js → empty-ChM6gdzn.js} +1 -1
- package/dist/{errors-DrFQSJW3.js → errors-D8_Zn8KN.js} +2 -2
- package/dist/{fileContextMenu-BBo91omq.js → fileContextMenu-hdALQktP.js} +54 -54
- package/dist/{fileExplorerLabel-AikEChiS.js → fileExplorerLabel-DMdkA7jY.js} +507 -507
- package/dist/{fileSurfaceChrome-Cqkvn8RQ.js → fileSurfaceChrome-BDyKklTq.js} +26 -26
- package/dist/{hanzoWebAnalytics-CCxpTzcI.js → hanzoWebAnalytics-B1eETW-7.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/{input-group-DEJEuwc9.js → input-group-BZ_QN-y7.js} +1 -1
- package/dist/{keybindings-C5tK_GAk.js → keybindings-D0pBlT1k.js} +7812 -7806
- package/dist/keymap.js +1 -1
- package/dist/{lucideIconByName-DUaXKH0V.js → lucideIconByName-CXY44V8P.js} +6835 -6848
- package/dist/{mediaReference-Bt_mh-ag.js → mediaReference-3wc4ZfY8.js} +95 -95
- package/dist/mediaSource-jW5c7b4r.js +70 -0
- package/dist/{modelPickerVisibility-Jue3CLfc.js → modelPickerVisibility-DBTc5r1G.js} +1 -1
- package/dist/{network-BbwqRm8c.js → network-wuXD7-is.js} +1 -1
- package/dist/{popover-anNQdce7.js → popover-BAyP2Tdr.js} +1 -1
- package/dist/{presentation-D9mVPBHm.js → presentation-68y8EAuH.js} +299 -299
- package/dist/{previewFailureMessages-BKpsSGX5.js → previewFailureMessages-CFguipaK.js} +3 -3
- package/dist/query-BPk2W3QN.js +63 -0
- package/dist/{readBinaryPreview-BAQ4fFjm.js → readBinaryPreview-DgDAUfzQ.js} +2 -2
- package/dist/{refresh-icon-BYx64to1.js → refresh-icon-Vo5ImiQL.js} +1 -1
- package/dist/{scroll-area-ChvX8uOh.js → scroll-area-CEoyjC7h.js} +1 -1
- package/dist/{select-DumYjny_.js → select-DLFnkZsI.js} +2 -2
- package/dist/{session-_kmiSv2A.js → session-Decc4Fo5.js} +1063 -1063
- package/dist/{skeleton-CJqwfMSF.js → skeleton-BOKpAZv6.js} +1 -1
- package/dist/{switch-COwevwaq.js → switch-DjpPjtQN.js} +2 -2
- package/dist/{themePalette-Dl_7omVL.js → themePalette-C-GtwwqV.js} +977 -977
- package/dist/{threadSearch-BHyWwcV3.js → threadSearch-sHEENLiT.js} +162 -162
- package/dist/{toggle-CEO6qTxB.js → toggle-B4F0EEtI.js} +1 -1
- package/dist/{toggle-group-BHovdMDl.js → toggle-group-l8hRPswr.js} +2 -2
- package/dist/{use-atom-command-ByoYq_K6.js → use-atom-command-XemtT1Gv.js} +1 -1
- package/dist/{useAriaLabelledBy-DPSISlnL.js → useAriaLabelledBy-CibvSz-b.js} +1 -1
- package/dist/{useFileMetadata-e7zsixVX.js → useFileMetadata-ChvPTfBY.js} +33 -33
- package/dist/{useFloatingRootContext-CJ9stHca.js → useFloatingRootContext-ppoGvqar.js} +1 -1
- package/dist/{useLiveRefresh-BkKJKXhH.js → useLiveRefresh-aHkPuz6N.js} +172 -172
- package/dist/{useNextRenderData-CyUmSAgz.js → useNextRenderData-Jm142a1q.js} +1 -1
- package/dist/{useSettings-DYG9Dmro.js → useSettings-Due4XCTB.js} +139 -139
- package/dist/{useTextFieldSpeech-COa9XcRx.js → useTextFieldSpeech-XN9r-f-r.js} +1404 -1404
- package/dist/useTheme-B9hvAuzL.js +411 -0
- package/dist/{utils-515nQ17G.js → utils-DtKQl-D3.js} +6184 -6172
- package/dist/{wizard-i86ViMRc.js → wizard-DjD4UNew.js} +3 -3
- package/dist/{workspaceFocus-BV1_9KiH.js → workspaceFocus-MR1plm6A.js} +144 -144
- package/dist/{zap-e0OsRjBR.js → zap-iwsUKtvA.js} +30 -17
- package/package.json +17 -17
- package/dist/mediaSource-zI7JWid4.js +0 -70
- package/dist/query-BxrrBAp6.js +0 -63
- package/dist/useTheme-D2ZM1gvV.js +0 -376
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gr as e, hr as t, yr as n } from "./utils-
|
|
1
|
+
import { gr as e, hr as t, yr as n } from "./utils-DtKQl-D3.js";
|
|
2
2
|
import { t as r } from "./observeResize-DRQ9DVLE.js";
|
|
3
3
|
import { useEffect as i, useEffectEvent as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
|
|
4
4
|
import { c as l } from "react/compiler-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as e, n as t } from "./messages-yqmY7G5x.js";
|
|
2
|
-
import {
|
|
3
|
-
import { o as r } from "./presentation-
|
|
2
|
+
import { Ld as n } from "./utils-DtKQl-D3.js";
|
|
3
|
+
import { o as r } from "./presentation-68y8EAuH.js";
|
|
4
4
|
// ../../packages/client-runtime/src/mediaActions.ts
|
|
5
5
|
function i(e, t = e) {
|
|
6
6
|
return n(t) ? e.replaceAll("/", "\\") : e;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as e, m as t, t as n, zn as r } from "./session-
|
|
1
|
+
import { d as e, m as t, t as n, zn as r } from "./session-Decc4Fo5.js";
|
|
2
2
|
import { c as i, n as a, s as o } from "./messages-yqmY7G5x.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Bo as m, Z as h, go as g } from "./keybindings-
|
|
5
|
-
import { Gt as _, Ht as v, Kt as y, Ut as b, Wt as x, Y as S } from "./themePalette-
|
|
6
|
-
import { A as
|
|
7
|
-
import { r as O } from "./presentation-
|
|
8
|
-
import { n as k } from "./query-
|
|
3
|
+
import { Ef as s, Kh as c, S_ as l, hf as u, lf as d, qh as f, xg as p } from "./utils-DtKQl-D3.js";
|
|
4
|
+
import { Bo as m, Z as h, go as g } from "./keybindings-D0pBlT1k.js";
|
|
5
|
+
import { Gt as _, Ht as v, Kt as y, Ut as b, Wt as x, Y as S } from "./themePalette-C-GtwwqV.js";
|
|
6
|
+
import { A as C, D as ee, M as w, O as T, k as E, w as D } from "./mediaReference-3wc4ZfY8.js";
|
|
7
|
+
import { r as O } from "./presentation-68y8EAuH.js";
|
|
8
|
+
import { n as k } from "./query-BPk2W3QN.js";
|
|
9
9
|
import { useContext as A } from "react";
|
|
10
10
|
import { c as j } from "react/compiler-runtime";
|
|
11
11
|
// ../../packages/shared/src/searchRanking.ts
|
|
@@ -74,13 +74,13 @@ function R(e, t) {
|
|
|
74
74
|
}
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function z(e, t, n) {
|
|
78
78
|
if (n <= 0) return;
|
|
79
79
|
let r = R(e, t);
|
|
80
80
|
e.length < n ? e.splice(r, 0, t) : r >= n || (e.splice(r, 0, t), e.pop());
|
|
81
81
|
}
|
|
82
82
|
// ../../packages/client-runtime/src/state/filesystem.ts
|
|
83
|
-
var
|
|
83
|
+
var te = 5e3;
|
|
84
84
|
function B(e, t = o) {
|
|
85
85
|
if (e.sessionError !== null) return {
|
|
86
86
|
canReadFiles: !1,
|
|
@@ -102,11 +102,11 @@ function B(e, t = o) {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
function V(e, t = "", n = !0) {
|
|
105
|
-
let r = n && w(e, t), i = r ?
|
|
105
|
+
let r = n && w(e, t), i = r ? ee(e) : "";
|
|
106
106
|
return {
|
|
107
107
|
isBrowsing: r,
|
|
108
108
|
directoryPath: i,
|
|
109
|
-
filterQuery: r && !
|
|
109
|
+
filterQuery: r && !C(e) ? T(e) : "",
|
|
110
110
|
parentPath: r ? E(i) : null,
|
|
111
111
|
canBrowseUp: r && D(i)
|
|
112
112
|
};
|
|
@@ -187,7 +187,7 @@ function K(e) {
|
|
|
187
187
|
browse: d(e, {
|
|
188
188
|
label: "environment-data:filesystem:browse",
|
|
189
189
|
tag: h.filesystemBrowse,
|
|
190
|
-
idleTtlMs:
|
|
190
|
+
idleTtlMs: te,
|
|
191
191
|
staleTimeMs: 0
|
|
192
192
|
})
|
|
193
193
|
};
|
|
@@ -207,37 +207,37 @@ function J(e, t) {
|
|
|
207
207
|
}
|
|
208
208
|
// src/state/use-atom-query-runner.ts
|
|
209
209
|
function Y(e, t) {
|
|
210
|
-
let n = j(7), r = A(
|
|
211
|
-
return n[0] !== i || n[1] !== e || n[2] !== s || n[3] !== r || n[4] !== o || n[5] !== a ? (
|
|
210
|
+
let n = j(7), r = A(f), i = typeof t == "string" ? t : t?.label, a = typeof t == "string" ? !0 : t?.reportFailure ?? !0, o = typeof t == "string" ? !0 : t?.reportDefect ?? !0, s = typeof t == "string" ? !1 : t?.refresh ?? !1, c;
|
|
211
|
+
return n[0] !== i || n[1] !== e || n[2] !== s || n[3] !== r || n[4] !== o || n[5] !== a ? (c = (t) => {
|
|
212
212
|
let n = e(t);
|
|
213
|
-
return
|
|
213
|
+
return u(r, n, {
|
|
214
214
|
label: i ?? n.label?.[0] ?? "atom query",
|
|
215
215
|
reportFailure: a,
|
|
216
216
|
reportDefect: o,
|
|
217
217
|
refresh: s
|
|
218
218
|
});
|
|
219
|
-
}, n[0] = i, n[1] = e, n[2] = s, n[3] = r, n[4] = o, n[5] = a, n[6] =
|
|
219
|
+
}, n[0] = i, n[1] = e, n[2] = s, n[3] = r, n[4] = o, n[5] = a, n[6] = c) : c = n[6], c;
|
|
220
220
|
}
|
|
221
221
|
// src/assets/assetUrls.ts
|
|
222
222
|
var X = _(S.createUrl);
|
|
223
223
|
function Z(t, n, r) {
|
|
224
|
-
let i = j(16), a = J(t,
|
|
224
|
+
let i = j(16), a = J(t, l()), o;
|
|
225
225
|
i[0] !== n || i[1] !== a ? (o = x(n, a), i[0] = n, i[1] = a, i[2] = o) : o = i[2];
|
|
226
|
-
let
|
|
227
|
-
i[3] !==
|
|
226
|
+
let s = o, u = e(t), d;
|
|
227
|
+
i[3] !== s || i[4] !== t || i[5] !== n || i[6] !== r ? (d = s !== null || t === null || n === null ? v : r === void 0 ? S.createUrl({
|
|
228
228
|
environmentId: t,
|
|
229
229
|
input: { resource: n }
|
|
230
230
|
}) : X({
|
|
231
231
|
environmentId: t,
|
|
232
232
|
input: { resource: n },
|
|
233
233
|
revision: r
|
|
234
|
-
}), i[3] =
|
|
235
|
-
let
|
|
236
|
-
if (
|
|
237
|
-
let
|
|
238
|
-
i[8] !==
|
|
234
|
+
}), i[3] = s, i[4] = t, i[5] = n, i[6] = r, i[7] = d) : d = i[7];
|
|
235
|
+
let f = c(d);
|
|
236
|
+
if (s !== null) return s;
|
|
237
|
+
let p = u._tag === "Some" ? u.value.httpBaseUrl : null, m;
|
|
238
|
+
i[8] !== f || i[9] !== p ? (m = b(f, p), i[8] = f, i[9] = p, i[10] = m) : m = i[10];
|
|
239
239
|
let h;
|
|
240
|
-
i[11] ===
|
|
240
|
+
i[11] === f.waiting ? h = i[12] : (h = f.waiting ? { waiting: !0 } : {}, i[11] = f.waiting, i[12] = h);
|
|
241
241
|
let g;
|
|
242
242
|
return i[13] !== m || i[14] !== h ? (g = {
|
|
243
243
|
...m,
|
|
@@ -250,45 +250,45 @@ function Q(t, n) {
|
|
|
250
250
|
reportFailure: !1,
|
|
251
251
|
refresh: !0
|
|
252
252
|
}, r[0] = o) : o = r[0];
|
|
253
|
-
let
|
|
254
|
-
return r[1] !== t || r[2] !== a || r[3] !==
|
|
253
|
+
let c = Y(S.createUrl, o), l;
|
|
254
|
+
return r[1] !== t || r[2] !== a || r[3] !== c || r[4] !== n ? (l = async () => {
|
|
255
255
|
if (t === null || n === null || a === null) return null;
|
|
256
|
-
let e = await
|
|
256
|
+
let e = await c({
|
|
257
257
|
environmentId: t,
|
|
258
258
|
input: { resource: n }
|
|
259
259
|
});
|
|
260
|
-
if (e._tag === "Failure") throw
|
|
260
|
+
if (e._tag === "Failure") throw s(e);
|
|
261
261
|
return y(a, e.value.relativeUrl);
|
|
262
|
-
}, r[1] = t, r[2] = a, r[3] =
|
|
262
|
+
}, r[1] = t, r[2] = a, r[3] = c, r[4] = n, r[5] = l) : l = r[5], l;
|
|
263
263
|
}
|
|
264
264
|
function ne(t, n) {
|
|
265
265
|
let r = j(13), i = e(t), { canReadFiles: a } = J(t), o;
|
|
266
266
|
r[0] !== a || r[1] !== n ? (o = a ? n : n.filter(ie), r[0] = a, r[1] = n, r[2] = o) : o = r[2];
|
|
267
|
-
let
|
|
268
|
-
r[3] !==
|
|
267
|
+
let s = o, l;
|
|
268
|
+
r[3] !== s || r[4] !== t ? (l = S.createUrls({
|
|
269
269
|
environmentId: t,
|
|
270
|
-
resources:
|
|
271
|
-
}), r[3] =
|
|
272
|
-
let
|
|
270
|
+
resources: s
|
|
271
|
+
}), r[3] = s, r[4] = t, r[5] = l) : l = r[5];
|
|
272
|
+
let u = c(l);
|
|
273
273
|
if (i._tag === "None") {
|
|
274
274
|
let e;
|
|
275
275
|
return r[6] === n ? e = r[7] : (e = n.map(re), r[6] = n, r[7] = e), e;
|
|
276
276
|
}
|
|
277
|
-
let
|
|
278
|
-
if (r[8] !== a || r[9] !== i.value || r[10] !== n || r[11] !==
|
|
279
|
-
|
|
277
|
+
let d;
|
|
278
|
+
if (r[8] !== a || r[9] !== i.value || r[10] !== n || r[11] !== u) {
|
|
279
|
+
d = [];
|
|
280
280
|
let e = 0;
|
|
281
281
|
for (let t of n) {
|
|
282
282
|
if (!a && $(t)) {
|
|
283
|
-
|
|
283
|
+
d.push(null);
|
|
284
284
|
continue;
|
|
285
285
|
}
|
|
286
|
-
let n =
|
|
287
|
-
e += 1,
|
|
286
|
+
let n = u[e];
|
|
287
|
+
e += 1, d.push(n && p(n) ? y(i.value.httpBaseUrl, n.value.relativeUrl) : null);
|
|
288
288
|
}
|
|
289
|
-
r[8] = a, r[9] = i.value, r[10] = n, r[11] =
|
|
290
|
-
} else
|
|
291
|
-
return
|
|
289
|
+
r[8] = a, r[9] = i.value, r[10] = n, r[11] = u, r[12] = d;
|
|
290
|
+
} else d = r[12];
|
|
291
|
+
return d;
|
|
292
292
|
}
|
|
293
293
|
function re() {
|
|
294
294
|
return null;
|
|
@@ -299,4 +299,4 @@ function ie(e) {
|
|
|
299
299
|
function $(e) {
|
|
300
300
|
return e._tag === "workspace-file" || e._tag === "media-file" || e._tag === "draft-workspace-file" || e._tag === "native-app-icon" && e.app._tag === "app-path";
|
|
301
301
|
}
|
|
302
|
-
export { q as a, W as c, U as d,
|
|
302
|
+
export { q as a, W as c, U as d, z as f, Y as i, H as l, I as m, Z as n, J as o, M as p, ne as r, G as s, Q as t, V as u };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as e } from "./session-
|
|
1
|
+
import { i as e } from "./session-Decc4Fo5.js";
|
|
2
2
|
import { c as t, n } from "./messages-yqmY7G5x.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Ed as l, Fo as u, Gt as d, Gy as f, Jd as ee, Pu as te, W as p, Wt as m, _p as ne, ad as re, ef as ie, fy as ae, hp as oe, id as se, kd as ce, pp as le, qu as ue, vg as h, wd as g, xo as de, zu as fe } from "./keybindings-
|
|
5
|
-
import "./themePalette-
|
|
6
|
-
import { S as pe, b as me, h as he } from "./mediaReference-
|
|
7
|
-
import { Q as ge, ln as _e } from "./threadSearch-
|
|
8
|
-
import { n as ve, r as ye } from "./useSettings-
|
|
9
|
-
import { N as be } from "./presentation-
|
|
10
|
-
import { t as xe } from "./use-atom-command-
|
|
3
|
+
import { Qd as r, _f as i, ac as a, cc as o, hg as s, uc as c } from "./utils-DtKQl-D3.js";
|
|
4
|
+
import { Ed as l, Fo as u, Gt as d, Gy as f, Jd as ee, Pu as te, W as p, Wt as m, _p as ne, ad as re, ef as ie, fy as ae, hp as oe, id as se, kd as ce, pp as le, qu as ue, vg as h, wd as g, xo as de, zu as fe } from "./keybindings-D0pBlT1k.js";
|
|
5
|
+
import "./themePalette-C-GtwwqV.js";
|
|
6
|
+
import { S as pe, b as me, h as he } from "./mediaReference-3wc4ZfY8.js";
|
|
7
|
+
import { Q as ge, ln as _e } from "./threadSearch-sHEENLiT.js";
|
|
8
|
+
import { n as ve, r as ye } from "./useSettings-Due4XCTB.js";
|
|
9
|
+
import { N as be } from "./presentation-68y8EAuH.js";
|
|
10
|
+
import { t as xe } from "./use-atom-command-XemtT1Gv.js";
|
|
11
11
|
import { c as _ } from "react/compiler-runtime";
|
|
12
12
|
// ../../packages/shared/src/commandOutput.ts
|
|
13
13
|
var Se = ne("2026-10-08T00:00:00Z"), Ce = ee(ie(l({
|
|
@@ -672,34 +672,34 @@ function Ht(e) {
|
|
|
672
672
|
function Ut(e) {
|
|
673
673
|
let t = new Set(e), n = null;
|
|
674
674
|
try {
|
|
675
|
-
n =
|
|
675
|
+
n = a(Q, d);
|
|
676
676
|
} catch (e) {
|
|
677
677
|
console.warn("Could not read the preferred editor.", e);
|
|
678
678
|
}
|
|
679
679
|
if (n && t.has(n)) return n;
|
|
680
680
|
let r = m.find((e) => t.has(e.id))?.id ?? null;
|
|
681
681
|
if (r) try {
|
|
682
|
-
|
|
682
|
+
o(Q, r, d);
|
|
683
683
|
} catch (e) {
|
|
684
684
|
console.warn("Could not save the preferred editor.", e);
|
|
685
685
|
}
|
|
686
686
|
return r ?? null;
|
|
687
687
|
}
|
|
688
|
-
function Wt(r,
|
|
688
|
+
function Wt(r, a, o) {
|
|
689
689
|
let c = _(6), l;
|
|
690
690
|
c[0] === Symbol.for("react.memo_cache_sentinel") ? (l = { reportFailure: !1 }, c[0] = l) : l = c[0];
|
|
691
691
|
let d = xe(_e.openInEditor, l), f;
|
|
692
|
-
return c[1] !==
|
|
692
|
+
return c[1] !== a || c[2] !== r || c[3] !== d || c[4] !== o ? (f = async (c) => {
|
|
693
693
|
if (r === null) return s(h(new $({ targetPath: c })));
|
|
694
694
|
if (!e(r, "orchestration:operate")) return s(h(new u({
|
|
695
695
|
requiredScope: de,
|
|
696
696
|
message: n(t("This connection cannot open an editor on this environment."))
|
|
697
697
|
})));
|
|
698
|
-
let l = Ut(
|
|
698
|
+
let l = Ut(a);
|
|
699
699
|
if (!l) return s(h(new Vt({
|
|
700
700
|
environmentId: r,
|
|
701
701
|
targetPath: c,
|
|
702
|
-
availableEditorIds:
|
|
702
|
+
availableEditorIds: a
|
|
703
703
|
})));
|
|
704
704
|
let f = /^file:\/\//iu.test(c) ? me(c) : null, { line: ee, column: te } = f ? pe("", f.hash) : {}, p = await d({
|
|
705
705
|
environmentId: r,
|
|
@@ -710,11 +710,11 @@ function Wt(r, i, a) {
|
|
|
710
710
|
column: te
|
|
711
711
|
} } : {},
|
|
712
712
|
editor: l,
|
|
713
|
-
...
|
|
713
|
+
...o ? { projectRoot: o } : {}
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
|
-
return
|
|
717
|
-
}, c[1] =
|
|
716
|
+
return i(p, () => l);
|
|
717
|
+
}, c[1] = a, c[2] = r, c[3] = d, c[4] = o, c[5] = f) : f = c[5], f;
|
|
718
718
|
}
|
|
719
719
|
// src/browser/browserLinkTarget.ts
|
|
720
720
|
function Gt(e) {
|
|
@@ -12,6 +12,8 @@ import { type ModelCatalogEntry } from '@hanzo/ui/models/catalog';
|
|
|
12
12
|
import { type Target } from './call.ts';
|
|
13
13
|
export { ENSO } from '@hanzo/ui/models/catalog';
|
|
14
14
|
export type Model = ModelCatalogEntry;
|
|
15
|
+
/** Whether a catalog entry is the retired `Enso Free` tier (never surfaced). */
|
|
16
|
+
export declare function isRemovedEnsoFree(m: Pick<Model, 'id' | 'name'>): boolean;
|
|
15
17
|
export declare function models(t: Target): Promise<Model[]>;
|
|
16
18
|
/** The payer's plan usage, as `GET /v1/ai/limits` answers it: what a picker marks paused. */
|
|
17
19
|
export declare function limits(t: Target, signal?: AbortSignal): Promise<unknown>;
|
|
@@ -11,8 +11,13 @@
|
|
|
11
11
|
import { parseModels } from '@hanzo/ui/models/catalog';
|
|
12
12
|
import { call } from './call.js';
|
|
13
13
|
export { ENSO } from '@hanzo/ui/models/catalog';
|
|
14
|
+
/** Whether a catalog entry is the retired `Enso Free` tier (never surfaced). */
|
|
15
|
+
export function isRemovedEnsoFree(m) {
|
|
16
|
+
const id = m.id.trim().toLowerCase().replace(/^hanzo\//, '');
|
|
17
|
+
return id === 'enso-free' || id === 'enso_free' || (m.name ?? '').trim().toLowerCase() === 'enso free';
|
|
18
|
+
}
|
|
14
19
|
export async function models(t) {
|
|
15
|
-
return parseModels(await call(t, 'GET', '/v1/models'));
|
|
20
|
+
return parseModels(await call(t, 'GET', '/v1/models')).filter((m) => !isRemovedEnsoFree(m));
|
|
16
21
|
}
|
|
17
22
|
/** The payer's plan usage, as `GET /v1/ai/limits` answers it: what a picker marks paused. */
|
|
18
23
|
export function limits(t, signal) {
|
|
@@ -83,6 +83,8 @@ export interface Node {
|
|
|
83
83
|
names: string[];
|
|
84
84
|
/** A file's text, or '' when it is binary or past the view cap. */
|
|
85
85
|
text: string;
|
|
86
|
+
/** Base64 bytes when binary and within the view cap (used for inline image previews). */
|
|
87
|
+
base64?: string;
|
|
86
88
|
binary: boolean;
|
|
87
89
|
truncated: boolean;
|
|
88
90
|
}
|
|
@@ -202,7 +202,8 @@ export async function read(t, sandbox, path) {
|
|
|
202
202
|
const o = (await call(t, 'POST', '/v1/sandbox/read', { id: sandbox, path })) ?? {};
|
|
203
203
|
const dir = o.dir === true;
|
|
204
204
|
const names = Array.isArray(o.entries) ? o.entries.filter((n) => typeof n === 'string').sort() : [];
|
|
205
|
-
const
|
|
205
|
+
const rawB64 = !dir && typeof o.data === 'string' ? o.data : '';
|
|
206
|
+
const bytes = rawB64 ? decode(rawB64) : new Uint8Array();
|
|
206
207
|
const binary = bytes.includes(0);
|
|
207
208
|
const truncated = bytes.length > CAP;
|
|
208
209
|
return {
|
|
@@ -210,6 +211,7 @@ export async function read(t, sandbox, path) {
|
|
|
210
211
|
dir,
|
|
211
212
|
names,
|
|
212
213
|
text: binary || truncated ? '' : new TextDecoder().decode(bytes),
|
|
214
|
+
...(binary && !truncated && rawB64 ? { base64: rawB64 } : {}),
|
|
213
215
|
binary,
|
|
214
216
|
truncated,
|
|
215
217
|
};
|
package/dist/builder/desk.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DropdownMenuProps } from '@hanzo/ui';
|
|
2
|
+
import { type FallbackPreview } from './preview-fallback.ts';
|
|
2
3
|
import type { Event } from './api/sessions.ts';
|
|
3
4
|
import type { Deck, Tabs } from './tabs.ts';
|
|
4
5
|
/** A run's panel before anyone has arranged it: Preview chosen first so live output opens immediately. */
|
|
@@ -46,3 +47,8 @@ export declare function Desk({ id, repo, branch, base, environment, mode, pr, ti
|
|
|
46
47
|
/** Reserve space for the host shell's top-right corner buttons. */
|
|
47
48
|
topRightInset?: boolean;
|
|
48
49
|
}): import("react").JSX.Element;
|
|
50
|
+
/** Inline renderer for session-edited files and project README.md when no dev server is listening. */
|
|
51
|
+
export declare function FallbackPreviewBody({ preview, device }: {
|
|
52
|
+
preview: FallbackPreview;
|
|
53
|
+
device: 'desktop' | 'mobile';
|
|
54
|
+
}): import("react").JSX.Element;
|
package/dist/builder/desk.js
CHANGED
|
@@ -14,12 +14,14 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
14
14
|
*/
|
|
15
15
|
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
16
16
|
import { useI18n } from '@hanzo/i18n/react';
|
|
17
|
-
import { Check, Circle, ExternalLink, Folder, GitBranch, GitPullRequest, Globe, Info, Laptop, Maximize2, MoreHorizontal, Play, RefreshCcw, Square, SquareTerminal, Upload, X } from '@hanzogui/lucide-icons-2';
|
|
17
|
+
import { Check, Circle, ExternalLink, FileText, Folder, GitBranch, GitPullRequest, Globe, Info, Laptop, Maximize2, MoreHorizontal, Play, RefreshCcw, Square, SquareTerminal, Upload, X } from '@hanzogui/lucide-icons-2';
|
|
18
18
|
import { Button, DropdownMenu, Switch } from '@hanzo/ui';
|
|
19
19
|
import { Console, DEVICES, PreviewFrame, Views } from '@hanzo/ui/agents';
|
|
20
20
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
21
21
|
import { RING } from './pane.js';
|
|
22
|
+
import { resolveFallbackPreview, svgPreviewDocument } from './preview-fallback.js';
|
|
22
23
|
import { cacheBustUrl, hasUnpublishedEdits, previewRevision, resolvePreviewSource } from './preview-url.js';
|
|
24
|
+
import { Prose } from './prose.js';
|
|
23
25
|
import { read as readChanges } from './api/changes.js';
|
|
24
26
|
import { read as readEnvironment } from './api/environment.js';
|
|
25
27
|
import { park, ports as listening, preview, sandbox as look, serve, served, stay, wake } from './api/sandbox.js';
|
|
@@ -64,7 +66,7 @@ export function Desk({ id, repo, branch, base, environment, mode, pr, title, pro
|
|
|
64
66
|
id: 'preview',
|
|
65
67
|
label: say('Preview'),
|
|
66
68
|
bleed: true,
|
|
67
|
-
render: () => (_jsx(Browser, { sandbox: sandbox, held: held, site: site, live: live, repo: repo, events: events, published: published, sessionStatus: sessionStatus, hasChanges: unpublished, onPublish: onPublish, onEnvironment: environ })),
|
|
69
|
+
render: () => (_jsx(Browser, { session: id, sandbox: sandbox, held: held, site: site, live: live, repo: repo, branch: branch, base: base, events: events, published: published, sessionStatus: sessionStatus, hasChanges: unpublished, onPublish: onPublish, onEnvironment: environ })),
|
|
68
70
|
},
|
|
69
71
|
{
|
|
70
72
|
id: 'artifacts',
|
|
@@ -101,10 +103,10 @@ export function Desk({ id, repo, branch, base, environment, mode, pr, title, pro
|
|
|
101
103
|
: pid === 'preview'
|
|
102
104
|
? say('Preview')
|
|
103
105
|
: k.label;
|
|
104
|
-
return (_jsxs(YStack, { minW: 0, minH: 0, borderLeftWidth: idx % 2 === 1 ? 1 : 0, borderTopWidth: idx >= 2 ? 1 : 0, "$max-lg": { borderLeftWidth: 0, borderTopWidth: idx > 0 ? 1 : 0 }, borderColor: "$borderColor", display: "grid", gridTemplateRows: "auto minmax(0, 1fr)", children: [_jsxs(XStack, { px: "$2.5", py: "$1
|
|
106
|
+
return (_jsxs(YStack, { minW: 0, minH: 0, borderLeftWidth: idx % 2 === 1 ? 1 : 0, borderTopWidth: idx >= 2 ? 1 : 0, "$max-lg": { borderLeftWidth: 0, borderTopWidth: idx > 0 ? 1 : 0 }, borderColor: "$borderColor", display: "grid", gridTemplateRows: "auto minmax(0, 1fr)", children: [_jsxs(XStack, { px: "$2.5", py: "$1", gap: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", height: 40, minH: 40, style: idx === 1 && (topRightInset ?? !sheet) ? { paddingInlineEnd: 'calc(10px + var(--hanzo-shell-top-right-inset, 0px))' } : undefined, children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", numberOfLines: 1, children: headerTitle }), onExpandSplitPane ? (_jsx(XStack, { render: "button", "aria-label": say('Expand {pane}', { pane: k.label }), ...{ title: say('Expand {pane}', { pane: k.label }) }, onClick: () => onExpandSplitPane(pid), minW: 30, minH: 30, items: "center", justify: "center", rounded: "$2", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(Maximize2, { size: 13, opacity: 0.7 }) })) : null, onCloseSplitPane ? (_jsx(XStack, { render: "button", "aria-label": say('Close {pane}', { pane: k.label }), ...{ title: say('Close {pane}', { pane: k.label }) }, onClick: () => onCloseSplitPane(pid), minW: 30, minH: 30, items: "center", justify: "center", rounded: "$2", hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(X, { size: 14, opacity: 0.7 }) })) : null] }), _jsx(YStack, { flex: 1, minH: 0, overflow: k.bleed ? 'hidden' : 'scroll', ...(k.bleed ? null : { p: '$3' }), children: k.render() })] }, pid));
|
|
105
107
|
}) })) : (_jsx(Panel, { side: side, kinds: kinds, sheet: sheet, topRightInset: topRightInset, onHide: onHide, label: say('Session details'),
|
|
106
108
|
// An empty tab offers what this session made: its site and its pull request.
|
|
107
|
-
suggested: [...(site ? [{ title: name || site, url: site }] : []), ...(pr.href ? [{ title: say('Pull request {pr}', { pr: pr.label }), url: pr.href }] : [])], bar: sandbox ? _jsx(Held, { box: box, live: live, devMode: devMode }) : null, menu: _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": say('Session actions'),
|
|
109
|
+
suggested: [...(site ? [{ title: name || site, url: site }] : []), ...(pr.href ? [{ title: say('Pull request {pr}', { pr: pr.label }), url: pr.href }] : [])], bar: sandbox ? _jsx(Held, { box: box, live: live, devMode: devMode }) : null, menu: _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": say('Session actions'), width: 28, height: 28, items: "center", justify: "center", rounded: 8, hoverStyle: { bg: '$hover' }, children: _jsx(MoreHorizontal, { size: 15 }) }), items: [...menu, { key: 'details', label: say('Details'), icon: _jsx(Info, { size: 16 }), onSelect: environ }] }) }));
|
|
108
110
|
if (envColumn && !sheet) {
|
|
109
111
|
return (_jsxs(XStack, { flex: 1, minW: 0, minH: 0, width: "100%", height: "100%", children: [_jsx(EnvironmentInspection, { id: id, repo: repo, name: name, branch: branch, environment: environment, pr: pr, title: title, events: events, live: live, devMode: devMode, onOpenEnvironment: environ, onOpenDiff: () => side.open({ kind: 'diff', title: devMode ? say('Diff') : say('Changes') }) }), _jsx(YStack, { flex: 1, minW: 0, minH: 0, borderLeftWidth: 1, borderColor: "$borderColor", children: panelNode })] }));
|
|
110
112
|
}
|
|
@@ -211,7 +213,7 @@ const SAYS = {
|
|
|
211
213
|
* looking. A preview that lost its sandbox (409) is opened again, at most twice
|
|
212
214
|
* in a while; any other status is said, and Retry is the person's.
|
|
213
215
|
*/
|
|
214
|
-
function Browser({ sandbox, held, site, live, repo, events, published, sessionStatus, hasChanges, onPublish, onEnvironment, }) {
|
|
216
|
+
function Browser({ session, sandbox, held, site, live, repo, branch, base, events, published, sessionStatus, hasChanges, onPublish, onEnvironment, }) {
|
|
215
217
|
const { t: say } = useI18n();
|
|
216
218
|
const t = useTarget();
|
|
217
219
|
const [open, setOpen] = useState([]);
|
|
@@ -356,7 +358,7 @@ function Browser({ sandbox, held, site, live, repo, events, published, sessionSt
|
|
|
356
358
|
});
|
|
357
359
|
const showingSandbox = hasSandboxPreview && resolved.kind === 'sandbox';
|
|
358
360
|
if (!showingSandbox) {
|
|
359
|
-
return (_jsxs(_Fragment, { children: [dialog, _jsx(Site, { site: site, rev: rev, onReload: () => setRev((n) => n + 1), live: live, held: held, serving: serving, events: events, hasChanges: hasChanges, hasSandboxPreview: hasSandboxPreview, onUseSandbox: hasSandboxPreview ? () => setPreferLive(false) : undefined, onStart: startable ? () => void start() : undefined, onPublish: onPublish, onEnvironment: repo ? onEnvironment : undefined })] }));
|
|
361
|
+
return (_jsxs(_Fragment, { children: [dialog, _jsx(Site, { session: session, sandbox: sandbox, repo: repo, branch: branch, base: base, site: site, rev: rev, onReload: () => setRev((n) => n + 1), live: live, held: held, serving: serving, events: events, hasChanges: hasChanges, hasSandboxPreview: hasSandboxPreview, onUseSandbox: hasSandboxPreview ? () => setPreferLive(false) : undefined, onStart: startable ? () => void start() : undefined, onPublish: onPublish, onEnvironment: repo ? onEnvironment : undefined })] }));
|
|
360
362
|
}
|
|
361
363
|
const host = open.find((p) => p.port === port)?.host ?? '';
|
|
362
364
|
const framedSrc = src ? cacheBustUrl(src, rev) : '';
|
|
@@ -378,29 +380,92 @@ const WATCH = 120_000;
|
|
|
378
380
|
const WATCHING = 3_000;
|
|
379
381
|
/**
|
|
380
382
|
* Where the run published its work, framed, with its address, a reload and the
|
|
381
|
-
* page in a tab of its own; or
|
|
382
|
-
*
|
|
383
|
+
* page in a tab of its own; or, when nothing is serving yet, an automatic
|
|
384
|
+
* inline preview of the session's most recently edited file or the project's
|
|
385
|
+
* README.md (falling back to a quiet "No files yet" state only when there are
|
|
386
|
+
* genuinely zero files).
|
|
383
387
|
*/
|
|
384
|
-
function Site({ site, rev, onReload, live, held, serving, events, hasChanges, hasSandboxPreview, onUseSandbox, onStart, onPublish, onEnvironment, }) {
|
|
388
|
+
function Site({ session, sandbox, repo, branch, base, site, rev, onReload, live, held, serving, events, hasChanges, hasSandboxPreview, onUseSandbox, onStart, onPublish, onEnvironment, }) {
|
|
385
389
|
const { t } = useI18n();
|
|
390
|
+
const host = useHost();
|
|
391
|
+
const target = useTarget();
|
|
392
|
+
const signed = Boolean(host.person);
|
|
393
|
+
const running = Boolean(sandbox) && held === 'running';
|
|
386
394
|
const progress = live ? steps(events) : [];
|
|
387
395
|
const frame = useRef(null);
|
|
388
396
|
const [device, setDevice] = useState('desktop');
|
|
389
397
|
const [dock, setDock] = useKept('hanzo.build.dock', 36);
|
|
390
398
|
const [lines, setLines] = useState([]);
|
|
399
|
+
const [fallback, setFallback] = useState(null);
|
|
400
|
+
const [fallbackLoading, setFallbackLoading] = useState(false);
|
|
391
401
|
const onBridge = (e) => {
|
|
392
402
|
if (e.type === 'preview:console')
|
|
393
403
|
setLines((was) => [...was.slice(-400), { id: `p${was.length}-${Date.now()}`, level: e.level, text: e.text, source: 'page' }]);
|
|
394
404
|
};
|
|
405
|
+
// When no live server or published site is serving, load the session's latest edited file or project README.
|
|
406
|
+
useEffect(() => {
|
|
407
|
+
if (site) {
|
|
408
|
+
setFallback(null);
|
|
409
|
+
setFallbackLoading(false);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const ctrl = new AbortController();
|
|
413
|
+
setFallbackLoading(true);
|
|
414
|
+
void resolveFallbackPreview({
|
|
415
|
+
target,
|
|
416
|
+
session,
|
|
417
|
+
sandbox,
|
|
418
|
+
running,
|
|
419
|
+
signed,
|
|
420
|
+
repo,
|
|
421
|
+
branch,
|
|
422
|
+
base,
|
|
423
|
+
events,
|
|
424
|
+
signal: ctrl.signal,
|
|
425
|
+
})
|
|
426
|
+
.then((found) => {
|
|
427
|
+
if (!ctrl.signal.aborted)
|
|
428
|
+
setFallback(found);
|
|
429
|
+
})
|
|
430
|
+
.catch(() => {
|
|
431
|
+
if (!ctrl.signal.aborted)
|
|
432
|
+
setFallback(null);
|
|
433
|
+
})
|
|
434
|
+
.finally(() => {
|
|
435
|
+
if (!ctrl.signal.aborted)
|
|
436
|
+
setFallbackLoading(false);
|
|
437
|
+
});
|
|
438
|
+
return () => ctrl.abort();
|
|
439
|
+
}, [site, target, session, sandbox, running, signed, repo, branch, base, rev, events.length]);
|
|
395
440
|
const framedSite = site ? cacheBustUrl(site, rev) : '';
|
|
441
|
+
const showDeviceToggle = Boolean(site) || fallback?.format === 'html';
|
|
442
|
+
const fallbackPillLabel = fallback ? fallback.path : '';
|
|
396
443
|
return (_jsxs(YStack, { flex: 1, minH: 0, children: [_jsxs(XStack, { px: "$2", py: "$1.5", gap: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", minW: 0, children: [_jsx(XStack, { render: "button", "aria-label": t('Reload the page'), ...{ title: t('Reload the page') }, onPress: () => {
|
|
397
444
|
onReload();
|
|
398
445
|
frame.current?.reload();
|
|
399
|
-
}, p: "$1.5", rounded: "$2", shrink: 0, hoverStyle: { bg: '$hover' }, children: _jsx(RefreshCcw, { size: 14 }) }), site ? (_jsxs(XStack, { "data-slot": "preview-mode", "data-kind": "live", items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 999, bg: "$edge", borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Globe, { size: 11, opacity: 0.75 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: t('Live site') })] })) : null, _jsx(SizableText, { flex: 1, minW: 0, size: "$1", color: "$soft", numberOfLines: 1, style: mono, children: site
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
446
|
+
}, p: "$1.5", rounded: "$2", shrink: 0, hoverStyle: { bg: '$hover' }, children: _jsx(RefreshCcw, { size: 14 }) }), site ? (_jsxs(XStack, { "data-slot": "preview-mode", "data-kind": "live", items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 999, bg: "$edge", borderWidth: 1, borderColor: "$borderColor", shrink: 0, children: [_jsx(Globe, { size: 11, opacity: 0.75 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: t('Live site') })] })) : fallback ? (_jsxs(XStack, { "data-slot": "preview-mode", "data-kind": fallback.source === 'readme' ? 'readme' : 'file', items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: 999, bg: "$edge", borderWidth: 1, borderColor: "$borderColor", shrink: 1, minW: 0, maxW: 260, children: [_jsx(FileText, { size: 11, opacity: 0.75 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, style: mono, children: fallbackPillLabel })] })) : null, _jsx(SizableText, { flex: 1, minW: 0, size: "$1", color: "$soft", numberOfLines: 1, style: mono, children: site ? site : fallback ? '' : fallbackLoading ? t('Loading preview…') : t('No files yet') }), onUseSandbox ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onUseSandbox, shrink: 0, children: t('Sandbox preview') })) : onStart ? (_jsxs(XStack, { render: "button", "aria-label": site ? t('Start sandbox preview') : t('Start dev server'), onPress: onStart, items: "center", gap: "$1", px: "$2", height: 28, rounded: "$2", borderWidth: 1, borderColor: "var(--border-strong)", shrink: 0, hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: [_jsx(Play, { size: 12 }), _jsx(SizableText, { size: "$1", color: "$ink", numberOfLines: 1, children: serving?.up ? t('Starting…') : site ? t('Sandbox preview') : t('Start dev server') })] })) : null, onPublish ? (_jsxs(Button, { size: "sm", variant: "primary", onPress: onPublish, shrink: 0, children: [_jsx(Upload, { size: 13 }), _jsx(SizableText, { size: "$1", color: "inherit", children: t('Publish') })] })) : null, showDeviceToggle ? (_jsx(Views, { views: DEVICES, value: device, onChange: (d) => setDevice(d), label: t('Device'), labels: "none" })) : null, site ? (_jsx(Out, { href: site, label: t('Open in browser'), children: _jsx(OpenOut, { label: t('Open in browser') }) })) : null] }), site && hasChanges && !live && !hasSandboxPreview ? (_jsxs(XStack, { "data-slot": "preview-stale-banner", px: "$2.5", py: "$1.5", gap: "$2", items: "center", bg: "$sunken", borderBottomWidth: 1, borderColor: "$borderColor", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$soft", flex: 1, minW: 140, children: t('Showing the deployed live site — edits in this session are not published yet.') }), onStart ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onStart, children: t('Start preview') })) : null, onPublish ? (_jsx(Button, { size: "sm", variant: "primary", onPress: onPublish, children: t('Publish changes') })) : null] })) : null, !site && serving ? (_jsxs(YStack, { "data-slot": "preview-serving-banner", px: "$3", py: "$2", gap: "$1.5", bg: "$sunken", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(SizableText, { size: "$1", color: "$ink", role: "status", flex: 1, minW: 140, children: serving.why || (serving.command ? t('Starting {command}…', { command: serving.command }) : t('Starting the dev server…')) }), serving.why && onStart ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onStart, children: t('Try again') })) : null, serving.why && onEnvironment ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onEnvironment, children: t('Set a start command') })) : null] }), serving.log ? _jsx(Tail, { log: serving.log }) : null] })) : null, site ? (_jsxs(_Fragment, { children: [_jsx(PreviewFrame, { ref: frame, src: framedSite, title: t('Where this session is published'), device: device, onBridge: onBridge }), _jsx(Console, { lines: lines, height: dock, onHeight: setDock, onClear: () => setLines([]), label: t('Console') })] })) : fallback ? (_jsx(FallbackPreviewBody, { preview: fallback, device: device })) : (_jsxs(YStack, { "data-slot": "preview-empty", flex: 1, items: "center", justify: "center", gap: "$2.5", p: "$6", children: [_jsx(FileText, { size: 24, opacity: 0.35 }), _jsx(SizableText, { size: "$3", color: "$ink", children: fallbackLoading ? t('Loading preview…') : t('No files yet') }), progress.length ? (_jsx(YStack, { render: "ol", "aria-label": t('Live session steps'), gap: "$2", m: 0, p: 0, width: "100%", maxW: 340, children: progress.map((step) => (_jsxs(XStack, { render: "li", borderWidth: 1, borderColor: "$borderColor", bg: "$sunken", rounded: "$3", p: "$2.5", gap: "$2", items: "center", children: [step.done ? _jsx(Check, { size: 15, "aria-hidden": true }) : _jsx(Circle, { size: 15, "aria-hidden": true }), _jsx(SizableText, { size: "$2", flex: 1, children: step.name }), _jsx(SizableText, { size: "$1", color: "$soft", children: step.done ? t('Finished') : t('Running') })] }, step.name))) })) : null, !serving && onStart ? (_jsx(Button, { size: "sm", variant: "outline", onPress: onStart, children: t('Start dev server') })) : null] }))] }));
|
|
447
|
+
}
|
|
448
|
+
/** Inline renderer for session-edited files and project README.md when no dev server is listening. */
|
|
449
|
+
export function FallbackPreviewBody({ preview, device }) {
|
|
450
|
+
if (preview.format === 'markdown') {
|
|
451
|
+
return (_jsx(YStack, { "data-slot": "preview-fallback", "data-format": "markdown", flex: 1, minH: 0, overflow: "scroll", px: "$5", py: "$4", children: _jsx(YStack, { maxW: 760, width: "100%", mx: "auto", children: _jsx(Prose, { text: preview.text }) }) }));
|
|
452
|
+
}
|
|
453
|
+
if (preview.format === 'html' || preview.format === 'svg') {
|
|
454
|
+
const srcDoc = preview.format === 'svg' ? svgPreviewDocument(preview.text) : preview.text;
|
|
455
|
+
return (_jsx(YStack, { "data-slot": "preview-fallback", "data-format": preview.format, flex: 1, minH: 0, items: "center", justify: "center", bg: "$sunken", children: _jsx("iframe", { srcDoc: srcDoc, title: preview.path, sandbox: "allow-scripts", style: {
|
|
456
|
+
border: 0,
|
|
457
|
+
width: preview.format === 'html' && device === 'mobile' ? 390 : '100%',
|
|
458
|
+
maxWidth: '100%',
|
|
459
|
+
height: '100%',
|
|
460
|
+
display: 'block',
|
|
461
|
+
background: preview.format === 'html' ? '#fff' : 'transparent',
|
|
462
|
+
} }) }));
|
|
463
|
+
}
|
|
464
|
+
if (preview.format === 'image' && preview.imageUrl) {
|
|
465
|
+
return (_jsx(YStack, { "data-slot": "preview-fallback", "data-format": "image", flex: 1, minH: 0, items: "center", justify: "center", p: "$4", overflow: "scroll", children: _jsx("img", { src: preview.imageUrl, alt: preview.path, style: { maxWidth: '100%', maxHeight: '100%', objectFit: 'contain', borderRadius: 6 } }) }));
|
|
466
|
+
}
|
|
467
|
+
const codeLines = preview.text.replace(/\r\n?/g, '\n').split('\n');
|
|
468
|
+
return (_jsx(YStack, { "data-slot": "preview-fallback", "data-format": "code", flex: 1, minH: 0, overflow: "scroll", px: "$3", py: "$3", bg: "$background", children: codeLines.map((line, idx) => (_jsxs(XStack, { gap: "$3", items: "flex-start", children: [_jsx(SizableText, { size: "$1", color: "$soft", width: 36, shrink: 0, text: "end", fontFamily: "$mono", opacity: 0.55, fontVariant: ['tabular-nums'], style: { userSelect: 'none' }, children: String(idx + 1) }), _jsx(SizableText, { flex: 1, minW: 0, size: "$1", color: "$ink", fontFamily: "$mono", "$platform-web": { whiteSpace: 'pre-wrap', wordBreak: 'break-word' }, children: line || ' ' })] }, idx))) }));
|
|
404
469
|
}
|
|
405
470
|
/** The last lines a server wrote, as it wrote them. */
|
|
406
471
|
function Tail({ log }) {
|
package/dist/builder/mind.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Modes } from '@hanzo/ui/chat';
|
|
2
2
|
import { type Target } from './api/call.ts';
|
|
3
3
|
import { type Model } from './api/models.ts';
|
|
4
|
-
export type Effort = 'auto' | 'low' | 'high' | 'max';
|
|
5
|
-
/** The efforts a Dev run offers,
|
|
4
|
+
export type Effort = 'auto' | 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
5
|
+
/** The efforts a Dev run offers, matching every reasoning level tracked across models. Marked English, drawn through `t`. */
|
|
6
6
|
export declare const EFFORTS: {
|
|
7
|
-
id:
|
|
7
|
+
id: Effort;
|
|
8
8
|
label: string;
|
|
9
9
|
note: string;
|
|
10
10
|
}[];
|
|
11
|
-
/** The effort a coding run names (apps/coding takes low, medium or high)
|
|
11
|
+
/** The effort a coding run names (apps/coding takes low, medium or high). */
|
|
12
12
|
export declare const level: (effort: Effort) => 'low' | 'medium' | 'high';
|
|
13
13
|
/** What a person chose: the model (Enso routes) and the effort. */
|
|
14
14
|
export interface Choice {
|
|
@@ -54,7 +54,7 @@ export interface Catalog {
|
|
|
54
54
|
* the reason in the chooser — never the platform's own words.
|
|
55
55
|
*/
|
|
56
56
|
export declare function useCatalog(t: Target): Catalog;
|
|
57
|
-
/** Whether `model` is one this plan may send: on Free, Enso Auto
|
|
57
|
+
/** Whether `model` is one this plan may send: on Free, Enso Auto and Enso Flash only (never Enso Free or other paid models). */
|
|
58
58
|
export declare function grants(free: boolean, model: string): boolean;
|
|
59
59
|
/**
|
|
60
60
|
* Whether the plan and the prepaid balance (cents, null where unknown) let `id` be
|