@burdenoff/microfe-vibecontrols 2026.1117.2 → 2026.1123.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/components/agents/OpenInBrowserEditorButton.js +94 -95
- package/dist/components/agents/PluginUIPanel.js +122 -116
- package/dist/components/gitops/VibeGitOpsTab.js +150 -147
- package/dist/components/scorecard/ScorecardPanel.js +79 -69
- package/dist/components/sessions/TerminalIframe.js +37 -17
- package/dist/components/sessions/TerminalPanel.js +2 -2
- package/dist/pages/SessionDetailsPage.js +495 -492
- package/dist/pages/SessionsPage.js +962 -961
- package/dist/pages/SharedSessionPage.js +27 -25
- package/dist/utils/iframeUrl.d.ts +26 -0
- package/dist/utils/iframeUrl.js +63 -0
- package/package.json +1 -1
|
@@ -2,18 +2,19 @@ import { VIBE_PERMISSIONS as e } from "../../constants/permissions.js";
|
|
|
2
2
|
import { useTr as t } from "../../shared/hooks/useTr.js";
|
|
3
3
|
import { useAgentCodeServerStartMutation as n, useAgentCodeServerStatusLazyQuery as r, useAgentCodeServerStopMutation as i, useMintAgentCapabilityMutation as a } from "../../generated/wspace-operations.js";
|
|
4
4
|
import { AgentCapabilityScope as o } from "../../generated/wspace-types.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { getSafeTunnelIframeUrl as s } from "../../utils/iframeUrl.js";
|
|
6
|
+
import { useCallback as c, useEffect as l, useState as u } from "react";
|
|
7
|
+
import { AlertCircle as d, Check as f, Code as p, Loader2 as m, X as h } from "lucide-react";
|
|
8
|
+
import { usePermissions as g } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
9
10
|
// src/components/agents/OpenInBrowserEditorButton.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
let t = (await
|
|
14
|
-
agentId:
|
|
11
|
+
var y = "default";
|
|
12
|
+
function b({ agentId: l, tunnelUrl: h, profile: _, workspacePath: v, mode: b = "newtab", onIframeUrl: x }) {
|
|
13
|
+
let S = t(), { hasPermission: C } = g(), w = C(e.AGENT_MUTATE), T = C(e.AGENT_INVOKE), [E, D] = u("idle"), [O, k] = u(null), [A] = r({ fetchPolicy: "network-only" }), [j] = n(), [M] = i(), [N] = a(), P = c(async (e) => {
|
|
14
|
+
let t = (await A({ variables: {
|
|
15
|
+
agentId: l,
|
|
15
16
|
profile: e,
|
|
16
|
-
name:
|
|
17
|
+
name: y
|
|
17
18
|
} })).data?.agentCodeServerStatus;
|
|
18
19
|
if (!t) return {
|
|
19
20
|
effective: null,
|
|
@@ -31,117 +32,115 @@ function y({ agentId: c, tunnelUrl: m, profile: g, workspacePath: _, mode: y = "
|
|
|
31
32
|
status: t.data ?? {},
|
|
32
33
|
missing: !1
|
|
33
34
|
};
|
|
34
|
-
}, [
|
|
35
|
-
if (!
|
|
36
|
-
|
|
35
|
+
}, [A, l]), F = c(async () => {
|
|
36
|
+
if (!w || !T) {
|
|
37
|
+
k(S("common.noPermission", "You do not have permission")), D("error");
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
if (!
|
|
40
|
-
|
|
40
|
+
if (!l || !h) {
|
|
41
|
+
k("Agent not selected"), D("error");
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
k(null);
|
|
44
45
|
let e = null;
|
|
45
|
-
|
|
46
|
+
b !== "iframe" && (e = window.open("about:blank", "_blank"), e && (e.opener = null));
|
|
46
47
|
try {
|
|
47
|
-
|
|
48
|
-
let t =
|
|
48
|
+
D("checking");
|
|
49
|
+
let t = _ === "default" ? ["default"] : [_, "default"], n = null, r = null;
|
|
49
50
|
for (let e of t) {
|
|
50
|
-
let { effective: t, status: i, missing: a } = await
|
|
51
|
+
let { effective: t, status: i, missing: a } = await P(e);
|
|
51
52
|
if (!a && t) {
|
|
52
53
|
n = t, r = i;
|
|
53
54
|
break;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
if (!n || !r || !r.installed) throw Error(
|
|
57
|
+
if (!n || !r || !r.installed) throw Error(S("vibecontrols.agents.editor.notInstalled", "Code-server isn't installed on this agent. Install it from the Plugins tab to enable Open Editor."));
|
|
57
58
|
if (!r.running) {
|
|
58
|
-
|
|
59
|
-
let e = (await
|
|
60
|
-
agentId:
|
|
59
|
+
D("starting");
|
|
60
|
+
let e = (await j({ variables: {
|
|
61
|
+
agentId: l,
|
|
61
62
|
profile: n,
|
|
62
|
-
name:
|
|
63
|
-
...
|
|
63
|
+
name: y,
|
|
64
|
+
...v ? { path: v } : {}
|
|
64
65
|
} })).data?.agentCodeServerStart;
|
|
65
66
|
if (!e?.ok) throw Error(e?.error || `Start failed: HTTP ${e?.status ?? 0}`);
|
|
66
67
|
await new Promise((e) => setTimeout(e, 1e3));
|
|
67
|
-
} else if (
|
|
68
|
-
|
|
69
|
-
agentId:
|
|
68
|
+
} else if (v) {
|
|
69
|
+
D("starting"), await M({ variables: {
|
|
70
|
+
agentId: l,
|
|
70
71
|
profile: n,
|
|
71
|
-
name:
|
|
72
|
+
name: y
|
|
72
73
|
} });
|
|
73
|
-
let e = (await
|
|
74
|
-
agentId:
|
|
74
|
+
let e = (await j({ variables: {
|
|
75
|
+
agentId: l,
|
|
75
76
|
profile: n,
|
|
76
|
-
name:
|
|
77
|
-
path:
|
|
77
|
+
name: y,
|
|
78
|
+
path: v
|
|
78
79
|
} })).data?.agentCodeServerStart;
|
|
79
80
|
if (!e?.ok) throw Error(e?.error || `Restart failed: HTTP ${e?.status ?? 0}`);
|
|
80
81
|
await new Promise((e) => setTimeout(e, 1e3));
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
-
let i = (await
|
|
84
|
-
agentId:
|
|
83
|
+
D("ready");
|
|
84
|
+
let i = (await N({ variables: {
|
|
85
|
+
agentId: l,
|
|
85
86
|
profile: n,
|
|
86
87
|
scope: o.IframePlugin,
|
|
87
|
-
resourceId: `code-server:${
|
|
88
|
+
resourceId: `code-server:${y}`,
|
|
88
89
|
ttlSeconds: 60
|
|
89
90
|
} })).data?.mintAgentCapability?.token;
|
|
90
91
|
if (!i) throw Error("Failed to mint editor capability");
|
|
91
|
-
let a =
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
else if (!window.open(a, "_blank")) throw Error(x("vibecontrols.agents.editor.popupBlocked", "Your browser blocked the editor tab. Allow pop-ups for this site, then click Open Editor again."));
|
|
95
|
-
setTimeout(() => E("idle"), 2e3);
|
|
92
|
+
let a = h.replace(/\/$/, ""), c = s(`${a}/code-server/?vt=${encodeURIComponent(i)}`);
|
|
93
|
+
if (!c) throw Error("Invalid editor URL");
|
|
94
|
+
b === "iframe" && x ? x(c) : e && !e.closed ? e.location.replace(c) : window.open(c, "_blank", "noopener,noreferrer"), setTimeout(() => D("idle"), 2e3);
|
|
96
95
|
} catch (t) {
|
|
97
|
-
e && !e.closed && e.close(),
|
|
96
|
+
e && !e.closed && e.close(), k(t instanceof Error ? t.message : "Failed to open editor"), D("error");
|
|
98
97
|
}
|
|
99
98
|
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
g,
|
|
99
|
+
l,
|
|
100
|
+
h,
|
|
103
101
|
_,
|
|
104
|
-
|
|
102
|
+
v,
|
|
105
103
|
b,
|
|
106
104
|
x,
|
|
107
|
-
|
|
105
|
+
S,
|
|
108
106
|
w,
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
T,
|
|
108
|
+
P,
|
|
111
109
|
j,
|
|
112
|
-
M
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
case "
|
|
117
|
-
case "
|
|
118
|
-
case "
|
|
119
|
-
case "
|
|
120
|
-
|
|
110
|
+
M,
|
|
111
|
+
N
|
|
112
|
+
]), I = !w || !T || !l || !h || E !== "idle" && E !== "error" && E !== "ready", L = (() => {
|
|
113
|
+
switch (E) {
|
|
114
|
+
case "checking": return S("vibecontrols.agents.editor.checking", "Checking...");
|
|
115
|
+
case "installing": return S("vibecontrols.agents.editor.installing", "Installing...");
|
|
116
|
+
case "starting": return S("vibecontrols.agents.editor.starting", "Starting...");
|
|
117
|
+
case "ready": return S("vibecontrols.agents.editor.opened", "Opened");
|
|
118
|
+
case "error": return S("vibecontrols.agents.editor.retry", "Retry");
|
|
119
|
+
default: return S("vibecontrols.agents.editor.openEditor", "Open Editor");
|
|
121
120
|
}
|
|
122
|
-
})(),
|
|
123
|
-
switch (
|
|
121
|
+
})(), R = (() => {
|
|
122
|
+
switch (E) {
|
|
124
123
|
case "checking":
|
|
125
124
|
case "installing":
|
|
126
|
-
case "starting": return
|
|
127
|
-
case "ready": return
|
|
128
|
-
case "error": return
|
|
129
|
-
default: return
|
|
125
|
+
case "starting": return m;
|
|
126
|
+
case "ready": return f;
|
|
127
|
+
case "error": return d;
|
|
128
|
+
default: return p;
|
|
130
129
|
}
|
|
131
|
-
})(),
|
|
130
|
+
})(), z = E === "checking" || E === "installing" || E === "starting";
|
|
132
131
|
return {
|
|
133
|
-
launch:
|
|
134
|
-
state:
|
|
135
|
-
errorMsg:
|
|
136
|
-
dismissError:
|
|
137
|
-
label:
|
|
138
|
-
Icon:
|
|
139
|
-
isSpinning:
|
|
140
|
-
isDisabled:
|
|
132
|
+
launch: F,
|
|
133
|
+
state: E,
|
|
134
|
+
errorMsg: O,
|
|
135
|
+
dismissError: c(() => k(null), []),
|
|
136
|
+
label: L,
|
|
137
|
+
Icon: R,
|
|
138
|
+
isSpinning: z,
|
|
139
|
+
isDisabled: I
|
|
141
140
|
};
|
|
142
141
|
}
|
|
143
|
-
function
|
|
144
|
-
let
|
|
142
|
+
function x({ agentId: e, tunnelUrl: n, profile: r, workspacePath: i, mode: a = "newtab", onIframeUrl: o, className: s }) {
|
|
143
|
+
let c = t(), { launch: u, state: f, errorMsg: p, dismissError: m, label: g, Icon: y, isSpinning: x, isDisabled: S } = b({
|
|
145
144
|
agentId: e,
|
|
146
145
|
tunnelUrl: n,
|
|
147
146
|
profile: r,
|
|
@@ -149,49 +148,49 @@ function b({ agentId: e, tunnelUrl: n, profile: r, workspacePath: i, mode: a = "
|
|
|
149
148
|
mode: a,
|
|
150
149
|
onIframeUrl: o
|
|
151
150
|
}), C = f === "error" && !!p;
|
|
152
|
-
return
|
|
151
|
+
return l(() => {
|
|
153
152
|
if (!C) return;
|
|
154
153
|
let e = (e) => {
|
|
155
|
-
e.key === "Escape" &&
|
|
154
|
+
e.key === "Escape" && m();
|
|
156
155
|
};
|
|
157
156
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
158
|
-
}, [C,
|
|
157
|
+
}, [C, m]), /* @__PURE__ */ v("div", {
|
|
159
158
|
className: "relative inline-flex",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ v("button", {
|
|
161
160
|
type: "button",
|
|
162
|
-
onClick: () => void
|
|
161
|
+
onClick: () => void u(),
|
|
163
162
|
disabled: S,
|
|
164
|
-
"aria-label":
|
|
163
|
+
"aria-label": g,
|
|
165
164
|
"aria-busy": x,
|
|
166
165
|
className: `flex items-center gap-1.5 px-2.5 py-1.5 sm:px-3 sm:py-2 max-md:min-h-11 text-xs sm:text-sm rounded-md transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus ${f === "error" ? "bg-status-error-bg-subtle text-status-error-text hover:opacity-80" : f === "ready" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-primary hover:bg-bg-elevated"} ${s || ""}`,
|
|
167
166
|
title: p || "Open VS Code in browser via code-server",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ _(y, {
|
|
169
168
|
"aria-hidden": "true",
|
|
170
169
|
className: `size-3.5 sm:size-4 ${x ? "animate-spin" : ""}`
|
|
171
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ _("span", {
|
|
172
171
|
className: "hidden sm:inline",
|
|
173
|
-
children:
|
|
172
|
+
children: g
|
|
174
173
|
})]
|
|
175
|
-
}), C && /* @__PURE__ */
|
|
174
|
+
}), C && /* @__PURE__ */ _("div", {
|
|
176
175
|
role: "alert",
|
|
177
176
|
className: "absolute top-full right-0 mt-1.5 z-50 w-72 max-w-[calc(100vw-2rem)] rounded-md border border-status-error-border bg-bg-surface p-3 text-xs leading-relaxed text-status-error-text whitespace-normal break-words shadow-[var(--shadow-elevation-2)]",
|
|
178
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ v("div", {
|
|
179
178
|
className: "flex items-start gap-2",
|
|
180
179
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ _(d, {
|
|
182
181
|
className: "mt-0.5 size-4 shrink-0",
|
|
183
182
|
"aria-hidden": "true"
|
|
184
183
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ _("span", {
|
|
186
185
|
className: "min-w-0 flex-1",
|
|
187
186
|
children: p
|
|
188
187
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ _("button", {
|
|
190
189
|
type: "button",
|
|
191
|
-
onClick:
|
|
192
|
-
"aria-label":
|
|
190
|
+
onClick: m,
|
|
191
|
+
"aria-label": c("vibecontrols.agents.editor.close", "Close"),
|
|
193
192
|
className: "-m-1 inline-flex size-6 shrink-0 items-center justify-center rounded-button text-status-error-text transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
194
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ _(h, {
|
|
195
194
|
className: "size-3.5",
|
|
196
195
|
"aria-hidden": "true"
|
|
197
196
|
})
|
|
@@ -201,4 +200,4 @@ function b({ agentId: e, tunnelUrl: n, profile: r, workspacePath: i, mode: a = "
|
|
|
201
200
|
})]
|
|
202
201
|
});
|
|
203
202
|
}
|
|
204
|
-
export {
|
|
203
|
+
export { x as OpenInBrowserEditorButton, b as useBrowserEditorLauncher };
|