@av-pi-studio/workbench 0.0.122 → 0.0.124
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/README.md +16 -4
- package/dist/chunks/{BinaryFallbackViewer-EznEIpRC.js → BinaryFallbackViewer-ua5VmtNP.js} +1 -1
- package/dist/chunks/{ChatPanel-DgJlK-yP.js → ChatPanel-9mV7jLOD.js} +3 -3
- package/dist/chunks/{CodeView-klpk8qD0.js → CodeView--Yo9YYpl.js} +2 -2
- package/dist/chunks/{FilePanel-Beg5Fs8X.js → FilePanel-CBNc1csX.js} +2 -2
- package/dist/chunks/HtmlViewer-BjvrS29T.js +539 -0
- package/dist/chunks/{ImageViewer-BLrsKWwI.js → ImageViewer-DQFVe58O.js} +1 -1
- package/dist/chunks/{MarkdownFileViewer-DxJJlrsv.js → MarkdownFileViewer-BEaGxGyd.js} +4 -4
- package/dist/chunks/{ModelProvidersPanel-C3TXoq1L.js → ModelProvidersPanel-CUdM6FMu.js} +2 -2
- package/dist/chunks/{MoleculeViewerPanel-BAWs5F2j.js → MoleculeViewerPanel-DhkadYBP.js} +3 -3
- package/dist/chunks/{PdfViewer-B_kiY-Tw.js → PdfViewer-PKAEVwco.js} +2 -2
- package/dist/chunks/{SaveFileButton-Bsz3wG4a.js → SaveFileButton-qwf_ewMX.js} +1 -1
- package/dist/chunks/SettingsDialog-ChDFOPih.js +454 -0
- package/dist/chunks/{SkillsPanel-BB5_yrcx.js → SkillsPanel-DP72YesV.js} +1 -1
- package/dist/chunks/{TerminalPanel-DgH4re05.js → TerminalPanel-BKnfLGNl.js} +1 -1
- package/dist/chunks/{TextViewer-BiwFYLLc.js → TextViewer-ZT99BjEP.js} +2 -2
- package/dist/chunks/{VideoViewer-BSGjTTQR.js → VideoViewer-C_gj8A0b.js} +1 -1
- package/dist/chunks/{ViewersPanel-BYHmKfOh.js → ViewersPanel-CTRov7NQ.js} +1 -1
- package/dist/chunks/external-link-BsgjS-QP.js +24 -0
- package/dist/chunks/{href-resolution-AtzN0oCd.js → href-resolution-AG-Co7Sm.js} +1 -1
- package/dist/chunks/index-CitLJdIo.js +7415 -0
- package/dist/chunks/{markdown-CypQ7TkY.js → markdown-CVWWeRbe.js} +97 -90
- package/dist/chunks/{use-file-download-zheHRdGQ.js → use-file-download-DbQCEsRG.js} +1 -1
- package/dist/chunks/{use-file-watch-CyVeSj2A.js → use-file-watch-CrgiCMCF.js} +1 -1
- package/dist/chunks/{use-provider-auth-list-jNjjSAD_.js → use-provider-auth-list-Bcdz9-zE.js} +1 -1
- package/dist/features/connection/ConnectionBar.d.ts +4 -0
- package/dist/features/connection/DaemonSwitcher.d.ts +16 -0
- package/dist/features/connection/daemon-switcher-presentation.d.ts +69 -0
- package/dist/features/connection/outdated-daemon.d.ts +17 -0
- package/dist/features/connection/use-outdated-daemon-notice.d.ts +26 -0
- package/dist/features/daemons/DaemonForm.d.ts +18 -0
- package/dist/features/daemons/DaemonsScreen.d.ts +17 -0
- package/dist/features/daemons/connect-current.d.ts +19 -0
- package/dist/features/daemons/daemon-form-actions.d.ts +27 -0
- package/dist/features/daemons/daemon-form.d.ts +103 -0
- package/dist/features/daemons/daemon-lifecycle.d.ts +58 -0
- package/dist/features/daemons/daemon-presentation.d.ts +46 -0
- package/dist/features/daemons/daemons-screen-actions.d.ts +37 -0
- package/dist/features/daemons/daemons-screen-view.d.ts +62 -0
- package/dist/features/daemons/daemons-store.d.ts +30 -0
- package/dist/features/daemons/use-daemon-lifecycle.d.ts +3 -0
- package/dist/features/daemons/use-daemons.d.ts +8 -0
- package/dist/features/files/preview-mounts.d.ts +25 -0
- package/dist/features/sessions/RenameSessionDialog.d.ts +8 -0
- package/dist/features/sessions/rename-title.d.ts +6 -0
- package/dist/features/sessions/session-actions.d.ts +6 -5
- package/dist/hooks/use-connection.d.ts +17 -5
- package/dist/host/browser-files.d.ts +2 -2
- package/dist/host/browser-host.d.ts +6 -1
- package/dist/host/types.d.ts +149 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/connection/connect-failure.d.ts +14 -0
- package/dist/lib/connection/connection-store.d.ts +7 -1
- package/dist/stores/session-rename-store.d.ts +13 -0
- package/dist/styles.css +1 -1
- package/dist/timeline/FileLink.d.ts +4 -2
- package/dist/timeline/external-href.d.ts +9 -0
- package/package.json +4 -4
- package/dist/chunks/HtmlViewer-KGQcSEm3.js +0 -490
- package/dist/chunks/SettingsDialog-AHnoT7nN.js +0 -471
- package/dist/chunks/index-QzeFcHmH.js +0 -6261
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { jsx as a, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import { useState as k, useEffect as I, memo as
|
|
2
|
+
import { useState as k, useEffect as I, memo as C, useMemo as _ } from "react";
|
|
3
3
|
import P from "react-markdown";
|
|
4
4
|
import V from "rehype-katex";
|
|
5
5
|
import $ from "remark-gfm";
|
|
6
6
|
import j from "remark-math";
|
|
7
7
|
import "katex/dist/katex.min.css";
|
|
8
|
-
import { W as D, u as y, X as A, Y as B, g as U, i as v, Z as
|
|
8
|
+
import { W as D, u as y, X as A, Y as B, g as U, i as v, Z as x, f as M, D as O } from "./index-CitLJdIo.js";
|
|
9
9
|
import { createHighlighter as z } from "shiki";
|
|
10
|
-
import { r as S } from "./href-resolution-
|
|
10
|
+
import { r as S } from "./href-resolution-AG-Co7Sm.js";
|
|
11
11
|
import { Spinner as G } from "@av-pi-studio/ui-library";
|
|
12
|
+
import { E as K } from "./external-link-BsgjS-QP.js";
|
|
12
13
|
const T = "github-dark";
|
|
13
14
|
let h = null;
|
|
14
|
-
const
|
|
15
|
-
function
|
|
15
|
+
const E = /* @__PURE__ */ new Set(["plaintext"]);
|
|
16
|
+
function Q() {
|
|
16
17
|
return h || (h = z({ themes: [T], langs: ["plaintext"] })), h;
|
|
17
18
|
}
|
|
18
|
-
async function
|
|
19
|
-
if (
|
|
19
|
+
async function W(r, e) {
|
|
20
|
+
if (E.has(e)) return e;
|
|
20
21
|
try {
|
|
21
|
-
return await r.loadLanguage(e),
|
|
22
|
+
return await r.loadLanguage(e), E.add(e), e;
|
|
22
23
|
} catch {
|
|
23
24
|
return "plaintext";
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
async function Y(r, e) {
|
|
27
|
-
const n = await
|
|
28
|
+
const n = await Q(), t = await W(n, e);
|
|
28
29
|
return n.codeToHtml(r, { lang: t, theme: T });
|
|
29
30
|
}
|
|
30
31
|
const N = {
|
|
@@ -55,34 +56,34 @@ function q() {
|
|
|
55
56
|
e[n] = r.getPropertyValue(n);
|
|
56
57
|
return Z(e);
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
-
prose:
|
|
60
|
-
streaming:
|
|
61
|
-
inlineCode:
|
|
62
|
-
mermaid:
|
|
63
|
-
mermaidError:
|
|
64
|
-
mermaidErrorMessage:
|
|
65
|
-
inlineImage:
|
|
66
|
-
inlineImageSkeleton:
|
|
67
|
-
inlineImageFallback:
|
|
68
|
-
},
|
|
59
|
+
const X = "piwb-markdown_prose_4ADyQ", J = "piwb-markdown_streaming_k9s8Q", ee = "piwb-markdown_inlineCode_RghPb", re = "piwb-markdown_mermaid_B9Blp", ne = "piwb-markdown_mermaidError_44zNo", te = "piwb-markdown_mermaidErrorMessage__6nf4", ie = "piwb-markdown_inlineImage_fN8VC", oe = "piwb-markdown_inlineImageSkeleton_o9LuV", ae = "piwb-markdown_inlineImageFallback_RQqnv", m = {
|
|
60
|
+
prose: X,
|
|
61
|
+
streaming: J,
|
|
62
|
+
inlineCode: ee,
|
|
63
|
+
mermaid: re,
|
|
64
|
+
mermaidError: ne,
|
|
65
|
+
mermaidErrorMessage: te,
|
|
66
|
+
inlineImage: ie,
|
|
67
|
+
inlineImageSkeleton: oe,
|
|
68
|
+
inlineImageFallback: ae
|
|
69
|
+
}, se = {
|
|
69
70
|
"http:": !0,
|
|
70
71
|
"https:": !0,
|
|
71
72
|
"data:": !0,
|
|
72
73
|
"blob:": !0
|
|
73
74
|
}, le = /^([a-zA-Z][a-zA-Z0-9+.-]*):/;
|
|
74
|
-
function
|
|
75
|
+
function ce(r, e, n) {
|
|
75
76
|
const t = r.trim();
|
|
76
77
|
if (!t) return { kind: "unresolvable" };
|
|
77
78
|
const i = t.split(/[?#]/, 1)[0];
|
|
78
79
|
if (!i) return { kind: "unresolvable" };
|
|
79
80
|
const o = le.exec(i);
|
|
80
81
|
if (o)
|
|
81
|
-
return `${o[1].toLowerCase()}:` in
|
|
82
|
-
const
|
|
83
|
-
return
|
|
82
|
+
return `${o[1].toLowerCase()}:` in se ? { kind: "remote" } : { kind: "unresolvable" };
|
|
83
|
+
const s = S(r, e, n);
|
|
84
|
+
return s ? D(s) !== "image" ? { kind: "unresolvable" } : { kind: "local", path: s } : { kind: "unresolvable" };
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function me(r, e, n, t) {
|
|
86
87
|
return r.kind === "remote" ? { kind: "remote", src: n || "", alt: t } : r.kind === "unresolvable" ? { kind: "unresolvable", fallbackText: t || n || "(image)" } : e.status === "loading" || e.status === "idle" ? { kind: "loading" } : e.status === "ready" ? { kind: "ready", objectUrl: e.objectUrl, alt: t, path: r.path } : { kind: "error", fallbackText: t || r.path || "(image)" };
|
|
87
88
|
}
|
|
88
89
|
function L(r, e, n) {
|
|
@@ -91,7 +92,7 @@ function L(r, e, n) {
|
|
|
91
92
|
targetPaneId: e ?? void 0
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function ue(r, e, n) {
|
|
95
96
|
if (!r || !e) {
|
|
96
97
|
n({ status: "idle" });
|
|
97
98
|
return;
|
|
@@ -108,117 +109,123 @@ function me(r, e, n) {
|
|
|
108
109
|
t = !0, B(r);
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function de(r) {
|
|
112
113
|
const e = y((o) => o.client), n = y((o) => o.daemon), [t, i] = k({ status: "idle" });
|
|
113
|
-
return I(() =>
|
|
114
|
+
return I(() => ue(r, e && n ? (s) => U().files.openForView(s) : null, i), [e, n, r]), t;
|
|
114
115
|
}
|
|
115
|
-
const
|
|
116
|
+
const fe = C(function({
|
|
116
117
|
src: e,
|
|
117
118
|
alt: n,
|
|
118
119
|
assetBase: t,
|
|
119
120
|
owningPaneId: i,
|
|
120
121
|
workspaceCwd: o
|
|
121
122
|
}) {
|
|
122
|
-
const
|
|
123
|
-
() =>
|
|
124
|
-
[e, t,
|
|
125
|
-
), c =
|
|
126
|
-
if (
|
|
127
|
-
return /* @__PURE__ */ a("img", { src:
|
|
128
|
-
if (
|
|
129
|
-
return /* @__PURE__ */ a("code", { className: m.inlineImageFallback, children:
|
|
130
|
-
if (
|
|
123
|
+
const s = v(), u = _(
|
|
124
|
+
() => ce(e || "", t, s),
|
|
125
|
+
[e, t, s]
|
|
126
|
+
), c = de(u.kind === "local" ? u.path : null), l = me(u, c, e, n);
|
|
127
|
+
if (l.kind === "remote")
|
|
128
|
+
return /* @__PURE__ */ a("img", { src: l.src, alt: l.alt, className: m.inlineImage });
|
|
129
|
+
if (l.kind === "unresolvable" || l.kind === "error")
|
|
130
|
+
return /* @__PURE__ */ a("code", { className: m.inlineImageFallback, children: l.fallbackText });
|
|
131
|
+
if (l.kind === "loading")
|
|
131
132
|
return /* @__PURE__ */ a("div", { className: m.inlineImageSkeleton, children: /* @__PURE__ */ a(G, { size: "sm" }) });
|
|
132
133
|
const f = L(t, i ?? null, o ?? null), g = () => {
|
|
133
|
-
|
|
134
|
+
M(l.path, f.workspaceCwd, f.targetPaneId);
|
|
134
135
|
};
|
|
135
136
|
return /* @__PURE__ */ a(
|
|
136
137
|
"img",
|
|
137
138
|
{
|
|
138
|
-
src:
|
|
139
|
-
alt:
|
|
139
|
+
src: l.objectUrl,
|
|
140
|
+
alt: l.alt,
|
|
140
141
|
className: m.inlineImage,
|
|
141
|
-
title:
|
|
142
|
+
title: l.path,
|
|
142
143
|
draggable: !0,
|
|
143
|
-
onDragStart:
|
|
144
|
+
onDragStart: x(l.path),
|
|
144
145
|
onClick: g,
|
|
145
146
|
style: { cursor: "pointer" }
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
149
|
});
|
|
149
|
-
function
|
|
150
|
+
function ge(r) {
|
|
151
|
+
const e = r.trim();
|
|
152
|
+
return e === "" ? "none" : e.startsWith("#") ? "in-page" : "url";
|
|
153
|
+
}
|
|
154
|
+
function pe(r, e, n) {
|
|
150
155
|
const t = r.trim();
|
|
151
156
|
if (!t) return { kind: "external" };
|
|
152
157
|
if (t.startsWith("#")) return { kind: "external" };
|
|
153
158
|
const i = S(r, e, n);
|
|
154
159
|
return i ? { kind: "local", path: i } : { kind: "external" };
|
|
155
160
|
}
|
|
156
|
-
function
|
|
157
|
-
const o = v(),
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
function ke({ href: r, children: e, assetBase: n, owningPaneId: t, workspaceCwd: i }) {
|
|
162
|
+
const o = v(), s = pe(r ?? "", n, o);
|
|
163
|
+
if (s.kind === "external") {
|
|
164
|
+
const l = ge(r ?? "");
|
|
165
|
+
return l === "none" ? /* @__PURE__ */ a("span", { children: e }) : l === "in-page" ? /* @__PURE__ */ a("a", { href: r, children: e }) : /* @__PURE__ */ a(K, { href: r ?? "", children: e });
|
|
166
|
+
}
|
|
167
|
+
const u = s.path, c = L(n, t, i);
|
|
161
168
|
return /* @__PURE__ */ a(
|
|
162
169
|
"a",
|
|
163
170
|
{
|
|
164
171
|
href: r,
|
|
165
172
|
draggable: !0,
|
|
166
|
-
onDragStart:
|
|
167
|
-
onClick: (
|
|
168
|
-
|
|
173
|
+
onDragStart: x(u),
|
|
174
|
+
onClick: (l) => {
|
|
175
|
+
l.preventDefault(), M(u, c.workspaceCwd, c.targetPaneId);
|
|
169
176
|
},
|
|
170
177
|
children: e
|
|
171
178
|
}
|
|
172
179
|
);
|
|
173
180
|
}
|
|
174
|
-
const H = /^ {0,3}([-*+]|\d{1,9}[.)])(\s|$)/,
|
|
175
|
-
function
|
|
181
|
+
const H = /^ {0,3}([-*+]|\d{1,9}[.)])(\s|$)/, he = /^(\s*)(`{3,}|~{3,})(.*)$/;
|
|
182
|
+
function be(r) {
|
|
176
183
|
return H.test(r[0] ?? "");
|
|
177
184
|
}
|
|
178
|
-
function
|
|
185
|
+
function we(r, e) {
|
|
179
186
|
for (let n = e; n < r.length; n++)
|
|
180
187
|
if ((r[n] ?? "").trim() !== "") return n;
|
|
181
188
|
return -1;
|
|
182
189
|
}
|
|
183
|
-
function
|
|
190
|
+
function Ie(r) {
|
|
184
191
|
if (!r) return { blocks: [], tail: "" };
|
|
185
192
|
const e = r.split(`
|
|
186
193
|
`), n = [];
|
|
187
|
-
let t = [], i = null, o = !1,
|
|
194
|
+
let t = [], i = null, o = !1, s = !1;
|
|
188
195
|
const u = () => {
|
|
189
196
|
const c = t.join(`
|
|
190
197
|
`).trim();
|
|
191
198
|
c && n.push(c), t = [];
|
|
192
199
|
};
|
|
193
200
|
for (let c = 0; c < e.length; c++) {
|
|
194
|
-
const
|
|
201
|
+
const l = e[c] ?? "", f = l.trim();
|
|
195
202
|
if (i !== null) {
|
|
196
|
-
if (t.push(
|
|
203
|
+
if (t.push(l), i.test(f)) {
|
|
197
204
|
const d = o;
|
|
198
205
|
i = null, o = !1, d && u();
|
|
199
206
|
}
|
|
200
207
|
continue;
|
|
201
208
|
}
|
|
202
|
-
const g =
|
|
203
|
-
if (g && !
|
|
209
|
+
const g = he.exec(l);
|
|
210
|
+
if (g && !s) {
|
|
204
211
|
const d = g[2];
|
|
205
|
-
i = new RegExp(`^[${d[0]}]{${d.length},}$`), o = g[1] === "", t.push(
|
|
212
|
+
i = new RegExp(`^[${d[0]}]{${d.length},}$`), o = g[1] === "", t.push(l);
|
|
206
213
|
continue;
|
|
207
214
|
}
|
|
208
215
|
if (f === "" && t.length === 0) continue;
|
|
209
|
-
if ((f.split("$$").length - 1) % 2 === 1 && (
|
|
210
|
-
const d =
|
|
216
|
+
if ((f.split("$$").length - 1) % 2 === 1 && (s = !s), f === "" && !s) {
|
|
217
|
+
const d = we(e, c + 1), p = d === -1 ? null : e[d] ?? "", R = p !== null && !/^\s/.test(p), F = p !== null && H.test(p) && be(t);
|
|
211
218
|
if (R && !F) {
|
|
212
219
|
u(), c = d - 1;
|
|
213
220
|
continue;
|
|
214
221
|
}
|
|
215
222
|
}
|
|
216
|
-
t.push(
|
|
223
|
+
t.push(l);
|
|
217
224
|
}
|
|
218
225
|
return { blocks: n, tail: t.join(`
|
|
219
226
|
`) };
|
|
220
227
|
}
|
|
221
|
-
function
|
|
228
|
+
function ye({ language: r, code: e }) {
|
|
222
229
|
const [n, t] = k(null);
|
|
223
230
|
return I(() => {
|
|
224
231
|
let i = !1;
|
|
@@ -229,7 +236,7 @@ function we({ language: r, code: e }) {
|
|
|
229
236
|
};
|
|
230
237
|
}, [e, r]), n ? /* @__PURE__ */ a("div", { className: m.prose, dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ a("pre", { children: /* @__PURE__ */ a("code", { children: e }) });
|
|
231
238
|
}
|
|
232
|
-
function
|
|
239
|
+
function Ee({ code: r }) {
|
|
233
240
|
const [e] = k(() => `mermaid-${O()}`), [n, t] = k({ status: "pending" });
|
|
234
241
|
return I(() => {
|
|
235
242
|
let i = !1;
|
|
@@ -243,8 +250,8 @@ function Ie({ code: r }) {
|
|
|
243
250
|
securityLevel: "strict",
|
|
244
251
|
fontFamily: "var(--pi-font-ui)"
|
|
245
252
|
});
|
|
246
|
-
const { svg:
|
|
247
|
-
i || t({ status: "ready", svg:
|
|
253
|
+
const { svg: s } = await o.render(e, r);
|
|
254
|
+
i || t({ status: "ready", svg: s });
|
|
248
255
|
} catch (o) {
|
|
249
256
|
i || t({
|
|
250
257
|
status: "error",
|
|
@@ -262,18 +269,18 @@ function Ie({ code: r }) {
|
|
|
262
269
|
/* @__PURE__ */ a("pre", { children: /* @__PURE__ */ a("code", { children: r }) })
|
|
263
270
|
] }) : /* @__PURE__ */ a("pre", { children: /* @__PURE__ */ a("code", { children: r }) });
|
|
264
271
|
}
|
|
265
|
-
function
|
|
272
|
+
function Ce({ className: r, children: e, ...n }) {
|
|
266
273
|
const t = /language-(\w+)/.exec(r ?? ""), i = !!t, o = String(e).replace(/\n$/, "");
|
|
267
274
|
if (i && t) {
|
|
268
|
-
const
|
|
269
|
-
return
|
|
275
|
+
const s = t[1] ?? "plaintext";
|
|
276
|
+
return s === "mermaid" ? /* @__PURE__ */ a(Ee, { code: o }) : /* @__PURE__ */ a(ye, { language: s, code: o });
|
|
270
277
|
}
|
|
271
278
|
return /* @__PURE__ */ a("code", { className: m.inlineCode, ...n, children: e });
|
|
272
279
|
}
|
|
273
|
-
function
|
|
280
|
+
function _e({ className: r, children: e, ...n }) {
|
|
274
281
|
return /language-(\w+)/.test(r ?? "") ? /* @__PURE__ */ a("pre", { children: /* @__PURE__ */ a("code", { children: String(e).replace(/\n$/, "") }) }) : /* @__PURE__ */ a("code", { className: m.inlineCode, ...n, children: e });
|
|
275
282
|
}
|
|
276
|
-
const
|
|
283
|
+
const ve = [$, j], xe = [V], Me = [], w = C(function({
|
|
277
284
|
text: e,
|
|
278
285
|
assetBase: n = null,
|
|
279
286
|
owningPaneId: t = null,
|
|
@@ -283,23 +290,23 @@ const Ee = [$, j], _e = [V], ve = [], w = E(function({
|
|
|
283
290
|
return /* @__PURE__ */ a(
|
|
284
291
|
P,
|
|
285
292
|
{
|
|
286
|
-
remarkPlugins:
|
|
287
|
-
rehypePlugins: o ?
|
|
293
|
+
remarkPlugins: ve,
|
|
294
|
+
rehypePlugins: o ? Me : xe,
|
|
288
295
|
components: {
|
|
289
|
-
code: o ?
|
|
290
|
-
img: (
|
|
291
|
-
|
|
296
|
+
code: o ? _e : Ce,
|
|
297
|
+
img: (s) => /* @__PURE__ */ a(
|
|
298
|
+
fe,
|
|
292
299
|
{
|
|
293
|
-
...
|
|
300
|
+
...s,
|
|
294
301
|
assetBase: n,
|
|
295
302
|
owningPaneId: t,
|
|
296
303
|
workspaceCwd: i
|
|
297
304
|
}
|
|
298
305
|
),
|
|
299
|
-
a: (
|
|
300
|
-
|
|
306
|
+
a: (s) => /* @__PURE__ */ a(
|
|
307
|
+
ke,
|
|
301
308
|
{
|
|
302
|
-
...
|
|
309
|
+
...s,
|
|
303
310
|
assetBase: n,
|
|
304
311
|
owningPaneId: t,
|
|
305
312
|
workspaceCwd: i
|
|
@@ -310,7 +317,7 @@ const Ee = [$, j], _e = [V], ve = [], w = E(function({
|
|
|
310
317
|
}
|
|
311
318
|
);
|
|
312
319
|
});
|
|
313
|
-
function
|
|
320
|
+
function Be({ text: r, assetBase: e, owningPaneId: n, workspaceCwd: t }) {
|
|
314
321
|
return /* @__PURE__ */ a("div", { className: m.prose, children: /* @__PURE__ */ a(
|
|
315
322
|
w,
|
|
316
323
|
{
|
|
@@ -321,13 +328,13 @@ function je({ text: r, assetBase: e, owningPaneId: n, workspaceCwd: t }) {
|
|
|
321
328
|
}
|
|
322
329
|
) });
|
|
323
330
|
}
|
|
324
|
-
function
|
|
325
|
-
const { blocks: i, tail: o } = _(() =>
|
|
331
|
+
function Ue({ text: r, assetBase: e, owningPaneId: n, workspaceCwd: t }) {
|
|
332
|
+
const { blocks: i, tail: o } = _(() => Ie(r), [r]);
|
|
326
333
|
return /* @__PURE__ */ b("div", { className: `${m.prose} ${m.streaming}`, children: [
|
|
327
|
-
i.map((
|
|
334
|
+
i.map((s, u) => /* @__PURE__ */ a(
|
|
328
335
|
w,
|
|
329
336
|
{
|
|
330
|
-
text:
|
|
337
|
+
text: s,
|
|
331
338
|
assetBase: e,
|
|
332
339
|
owningPaneId: n,
|
|
333
340
|
workspaceCwd: t
|
|
@@ -347,7 +354,7 @@ function De({ text: r, assetBase: e, owningPaneId: n, workspaceCwd: t }) {
|
|
|
347
354
|
] });
|
|
348
355
|
}
|
|
349
356
|
export {
|
|
350
|
-
|
|
351
|
-
|
|
357
|
+
Be as M,
|
|
358
|
+
Ue as S,
|
|
352
359
|
L as r
|
|
353
360
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as i, useEffect as l } from "react";
|
|
2
2
|
import { useQuery as c } from "@tanstack/react-query";
|
|
3
|
-
import { u as a, g as f, r as m } from "./index-
|
|
3
|
+
import { u as a, g as f, r as m } from "./index-CitLJdIo.js";
|
|
4
4
|
function y(r, n) {
|
|
5
5
|
return n && r && r !== n && r.release(), n;
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as h, useEffect as p } from "react";
|
|
2
|
-
import { u as w } from "./index-
|
|
2
|
+
import { u as w } from "./index-CitLJdIo.js";
|
|
3
3
|
function b(e) {
|
|
4
4
|
return typeof e == "object" && e !== null && "type" in e && e.type === "file_changed" && "path" in e && typeof e.path == "string";
|
|
5
5
|
}
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* `parsePairingUrl` and routes through the relay transport automatically; the password field is
|
|
14
14
|
* ignored in that case (the pairing link's key is itself the credential). The 220px field can't
|
|
15
15
|
* show that as placeholder text, so it lives in the field's `title` tooltip.
|
|
16
|
+
*
|
|
17
|
+
* When the host has a daemon registry (`host.daemons`, the desktop app) the pill becomes the daemon
|
|
18
|
+
* switcher (`DaemonSwitcher.tsx`) and the url/password fields and the Connect button are not drawn;
|
|
19
|
+
* Disconnect and Retry stay. State shape: `daemon-switcher-presentation.ts`.
|
|
16
20
|
*/
|
|
17
21
|
export declare function ConnectionBar(): import("react").JSX.Element;
|
|
18
22
|
//# sourceMappingURL=ConnectionBar.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DaemonSwitcher — the connection bar's status pill when the host has a daemon registry: a button
|
|
3
|
+
* showing the current entry's name and connection status that opens a list of entries (pick one to
|
|
4
|
+
* switch) ending in "Manage daemons…". Built on the design system's `DropdownMenu` chrome, so the
|
|
5
|
+
* trigger and the list are keyboard operable (Enter/Space/ArrowDown opens, arrows move, Esc closes).
|
|
6
|
+
*
|
|
7
|
+
* What is shown and what a choice does is decided in `daemon-switcher-presentation.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import type { ConnectionState } from "@av-pi-studio/client";
|
|
10
|
+
import { type DaemonSwitcherView } from "./daemon-switcher-presentation.js";
|
|
11
|
+
export declare function DaemonSwitcher({ view, currentId, status, }: {
|
|
12
|
+
view: DaemonSwitcherView;
|
|
13
|
+
currentId: string | null;
|
|
14
|
+
status: ConnectionState;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=DaemonSwitcher.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The connection bar's daemon switcher as pure data: what the control shows (the current entry's
|
|
3
|
+
* name and status), what its list holds, and what choosing a row does. Used instead of the
|
|
4
|
+
* address/password fields when the host has a registry (`host.daemons`); `ConnectionBar.tsx` only
|
|
5
|
+
* binds it to the stores and the DOM.
|
|
6
|
+
*
|
|
7
|
+
* Status is the one `connectionBarView` draws, except for the local entry while its daemon is not
|
|
8
|
+
* running: then the local state's own label is shown ("Starting…"), because a socket that has not
|
|
9
|
+
* been dialed yet has nothing to say.
|
|
10
|
+
*/
|
|
11
|
+
import type { ConnectionState } from "@av-pi-studio/client";
|
|
12
|
+
import type { DaemonsSnapshot } from "../daemons/use-daemons.js";
|
|
13
|
+
import { type ConnectionBarAction, type ConnectionBarKind } from "./connection-presentation.js";
|
|
14
|
+
export declare const NO_DAEMON_LABEL = "No daemon selected";
|
|
15
|
+
export declare const MANAGE_DAEMONS_LABEL = "Manage daemons\u2026";
|
|
16
|
+
export interface DaemonSwitcherItem {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
/** "Local", "Direct" or "Relay". */
|
|
20
|
+
kindLabel: string;
|
|
21
|
+
current: boolean;
|
|
22
|
+
/** A relay entry whose pairing link stopped working: the list says so beside its name. */
|
|
23
|
+
linkInvalid: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** What the bar's action button does; `null` action: no button. */
|
|
26
|
+
export type DaemonSwitcherActionIntent = "disconnect" | "retry";
|
|
27
|
+
export type SwitcherAction = ConnectionBarAction & {
|
|
28
|
+
intent: DaemonSwitcherActionIntent;
|
|
29
|
+
};
|
|
30
|
+
export interface DaemonSwitcherView {
|
|
31
|
+
kind: ConnectionBarKind;
|
|
32
|
+
/** The current entry's name, or "No daemon selected". Ellipsised by the DOM, never cut here. */
|
|
33
|
+
name: string;
|
|
34
|
+
/** The status after the name; null when there is no current entry. */
|
|
35
|
+
statusLabel: string | null;
|
|
36
|
+
/** Full, never-truncated text for the native `title` tooltip. */
|
|
37
|
+
title: string;
|
|
38
|
+
/** Every entry in registry order, the current one marked. */
|
|
39
|
+
items: DaemonSwitcherItem[];
|
|
40
|
+
action: SwitcherAction | null;
|
|
41
|
+
}
|
|
42
|
+
export type DaemonChoice =
|
|
43
|
+
/** The current entry while connected. */
|
|
44
|
+
{
|
|
45
|
+
kind: "nothing";
|
|
46
|
+
}
|
|
47
|
+
/** The current entry while not connected: ask the registry again and dial. */
|
|
48
|
+
| {
|
|
49
|
+
kind: "reconnect";
|
|
50
|
+
} | {
|
|
51
|
+
kind: "switch";
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
export declare function daemonSwitcherView(input: {
|
|
55
|
+
snapshot: DaemonsSnapshot;
|
|
56
|
+
status: ConnectionState;
|
|
57
|
+
error: string | null;
|
|
58
|
+
/** Relay entries marked "pairing link no longer valid"; none when omitted. */
|
|
59
|
+
invalidLinks?: ReadonlySet<string>;
|
|
60
|
+
}): DaemonSwitcherView;
|
|
61
|
+
/** What choosing `id` in the list does. Switching reloads the page, so it is never done in place. */
|
|
62
|
+
export declare function daemonChoice(input: {
|
|
63
|
+
currentId: string | null;
|
|
64
|
+
id: string;
|
|
65
|
+
status: ConnectionState;
|
|
66
|
+
}): DaemonChoice;
|
|
67
|
+
/** The toast text for a `switchTo` that rejected. */
|
|
68
|
+
export declare function switchFailureMessage(error: unknown): string;
|
|
69
|
+
//# sourceMappingURL=daemon-switcher-presentation.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The outdated-daemon notice's decision (sprint-110/task-006): given the host's
|
|
3
|
+
* `app.minDaemonVersion` and the version a daemon reported in `server_info`, answer "no notice"
|
|
4
|
+
* or the notice's text. Pure; `use-outdated-daemon-notice.ts` decides when to ask and shows the toast.
|
|
5
|
+
*/
|
|
6
|
+
/** How a user brings an old daemon up to date. */
|
|
7
|
+
export declare const DAEMON_UPDATE_HINT = "Update it with `npm i -g @av-pi-studio/cli`, then restart the daemon.";
|
|
8
|
+
/** `[major, minor, patch]`, or `null` for anything that is not a semantic version. A pre-release or
|
|
9
|
+
* build suffix is ignored: `0.0.119-beta.1` counts as `0.0.119`. */
|
|
10
|
+
export declare function parseVersion(version: string): [number, number, number] | null;
|
|
11
|
+
/**
|
|
12
|
+
* The notice for a daemon that reported `reported` (absent when the daemon sent none), or `null`
|
|
13
|
+
* when none is due: no usable minimum, or the daemon meets it. An unparsable `reported` counts as
|
|
14
|
+
* absent; an unparsable minimum cannot be compared against, so it counts as no minimum.
|
|
15
|
+
*/
|
|
16
|
+
export declare function outdatedDaemonNotice(minVersion: string | undefined, reported: string | undefined): string | null;
|
|
17
|
+
//# sourceMappingURL=outdated-daemon.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shows the outdated-daemon notice (`outdated-daemon.ts`) as a toast, once per established
|
|
3
|
+
* connection (sprint-110/task-006). A connection is "established" while the status is `open` and
|
|
4
|
+
* the handshake's `server_info` is in the store: the first `open` of a `connect()` precedes the
|
|
5
|
+
* store receiving `server_info`, so `open` alone would read no version. Each rise into that state
|
|
6
|
+
* (the first connect, and every reconnect after a drop) gets one notice; re-renders and further
|
|
7
|
+
* store changes while it holds get none. Nothing is watched when the host sets no minimum.
|
|
8
|
+
*/
|
|
9
|
+
import { type ConnectionState } from "@av-pi-studio/client";
|
|
10
|
+
import { type ServerInfoPayload } from "@av-pi-studio/protocol";
|
|
11
|
+
/** Whether the previous look at the connection found it established. */
|
|
12
|
+
export interface EstablishedTracker {
|
|
13
|
+
established: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Records the connection's current state in `tracker`; the notice text on the rise into
|
|
16
|
+
* "established" if one is due, otherwise `null`. */
|
|
17
|
+
export declare function noticeOnEstablish(tracker: EstablishedTracker, minVersion: string, status: ConnectionState, serverInfo: ServerInfoPayload | null): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Watches the connection store and calls `show` with the notice for each established connection
|
|
20
|
+
* that is older than `minVersion`. Checks the current state first, then every change. Returns the
|
|
21
|
+
* unsubscribe. Without a `minVersion` (a browser host) it subscribes to nothing.
|
|
22
|
+
*/
|
|
23
|
+
export declare function watchOutdatedDaemon(tracker: EstablishedTracker, minVersion: string | undefined, show: (notice: string) => void): () => void;
|
|
24
|
+
/** Mount once, inside the workbench shell. Does nothing without `app.minDaemonVersion`. */
|
|
25
|
+
export declare function useOutdatedDaemonNotice(): void;
|
|
26
|
+
//# sourceMappingURL=use-outdated-daemon-notice.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The add/edit form of the Daemons screen. What it shows, checks and sends is `daemon-form.ts`;
|
|
3
|
+
* what Save does against the host is `daemon-form-actions.ts`. This only holds the typed values.
|
|
4
|
+
*
|
|
5
|
+
* Values live in this component's state only: it unmounts when the form closes, which drops what
|
|
6
|
+
* was typed. A stored password or pairing link is never put in a field; the password field shows a
|
|
7
|
+
* "saved" marker instead, and the link field is a replacement that starts empty.
|
|
8
|
+
*/
|
|
9
|
+
import { type HostDaemons } from "../../host/types.js";
|
|
10
|
+
import { type FormMode } from "./daemon-form.js";
|
|
11
|
+
export declare function DaemonForm({ daemons, mode, onClose, onSaved, }: {
|
|
12
|
+
daemons: HostDaemons;
|
|
13
|
+
mode: FormMode;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** The change was saved. `reconnect`: the current entry now dials something else. */
|
|
16
|
+
onSaved: (reconnect: boolean) => void;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=DaemonForm.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DaemonsScreen — the modal that lists the registry's entries, drives the local daemon, holds the
|
|
3
|
+
* two daemon settings and removes entries (`swe/features/desktop-daemon-registry.md` § Public
|
|
4
|
+
* contract 4). Mounted once in `WorkspaceShell`; renders nothing when the host has no registry
|
|
5
|
+
* (the browser). Open/closed state and the error shown in the banner live in `useDaemonsStore`;
|
|
6
|
+
* what each row offers and what the banner says is `daemons-screen-view.ts`; what a button does
|
|
7
|
+
* against the host is `daemons-screen-actions.ts`.
|
|
8
|
+
*
|
|
9
|
+
* Add and Edit swap the list for `DaemonForm` (`daemon-form.ts` decides what it checks and sends).
|
|
10
|
+
* After a saved change that alters what the current entry dials, the screen offers "Reconnect
|
|
11
|
+
* now"; nothing reconnects by itself.
|
|
12
|
+
*
|
|
13
|
+
* Focus is the `Dialog` primitive's: it moves in on open, Escape and the close button dismiss, and
|
|
14
|
+
* focus returns to what had it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function DaemonsScreen(): import("react").JSX.Element | null;
|
|
17
|
+
//# sourceMappingURL=DaemonsScreen.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Connect to the current registry entry" as one decision, shared by boot, the connection bar's
|
|
3
|
+
* Retry and the Daemons screen's "Reconnect now". Pure over injected dependencies, like
|
|
4
|
+
* `applyConnectIntent`.
|
|
5
|
+
*
|
|
6
|
+
* The intent carries a secret: it goes to `connect` and nowhere else, and is never logged.
|
|
7
|
+
*/
|
|
8
|
+
import { type HostDaemons } from "../../host/types.js";
|
|
9
|
+
import { type ConnectOptions } from "../../lib/connection/connection-store.js";
|
|
10
|
+
import { type DaemonFailure } from "./daemon-presentation.js";
|
|
11
|
+
export interface ConnectCurrentDeps {
|
|
12
|
+
connect(options: ConnectOptions): void;
|
|
13
|
+
/** `resolveCurrent` resolved: whatever failure was held no longer applies. */
|
|
14
|
+
resolved(): void;
|
|
15
|
+
/** `resolveCurrent` rejected: nothing is dialed. */
|
|
16
|
+
rejected(failure: DaemonFailure): void;
|
|
17
|
+
}
|
|
18
|
+
export declare function connectCurrent(daemons: Pick<HostDaemons, "resolveCurrent">, deps: ConnectCurrentDeps): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=connect-current.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the add/edit form's Save does against the host: check the form, call `add` or `update` with
|
|
3
|
+
* only what the form decided, and say where a refusal goes. None throws.
|
|
4
|
+
*
|
|
5
|
+
* Plain functions over `HostDaemons`, unit-testable with the in-memory registry.
|
|
6
|
+
*/
|
|
7
|
+
import { type DaemonEntryView, type HostDaemons } from "../../host/types.js";
|
|
8
|
+
import { type FormErrors, type FormFields } from "./daemon-form.js";
|
|
9
|
+
export type SubmitOutcome =
|
|
10
|
+
/** Saved (or, for an edit with nothing changed, nothing to save). */
|
|
11
|
+
{
|
|
12
|
+
status: "saved";
|
|
13
|
+
reconnect: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Stopped in the form or refused by the host: the form stays open with these messages. */
|
|
16
|
+
| {
|
|
17
|
+
status: "refused";
|
|
18
|
+
errors: FormErrors;
|
|
19
|
+
};
|
|
20
|
+
/** Check, then add. The host is not called when the form fails its own checks. */
|
|
21
|
+
export declare function submitAdd(daemons: HostDaemons, fields: FormFields): Promise<SubmitOutcome>;
|
|
22
|
+
/**
|
|
23
|
+
* Check, then update with the changed fields only; nothing changed means no call. `reconnect` is
|
|
24
|
+
* set when the saved entry is the current one and the change alters what is dialed.
|
|
25
|
+
*/
|
|
26
|
+
export declare function submitEdit(daemons: HostDaemons, entry: DaemonEntryView, fields: FormFields): Promise<SubmitOutcome>;
|
|
27
|
+
//# sourceMappingURL=daemon-form-actions.d.ts.map
|