@burdenoff/microfe-stewards 2026.1204.3 → 2026.1205.1
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/generated/global-types.d.ts +611 -171
- package/dist/generated/wspace-operations.d.ts +331 -4
- package/dist/generated/wspace-operations.js +239 -138
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +10638 -696
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/stewards/components/OwnMachineDeskCard.d.ts +20 -0
- package/dist/stewards/components/OwnMachineDeskCard.js +418 -0
- package/dist/stewards/components/OwnMachineDeskCard.js.map +1 -0
- package/dist/stewards/i18n/en.d.ts +48 -0
- package/dist/stewards/i18n/en.js +49 -1
- package/dist/stewards/i18n/en.js.map +1 -1
- package/dist/stewards/pages/StewardCharterPage.js +156 -150
- package/dist/stewards/pages/StewardCharterPage.js.map +1 -1
- package/dist/stewards/permissions/stewardPermissions.d.ts +11 -0
- package/dist/stewards/permissions/stewardPermissions.js +4 -1
- package/dist/stewards/permissions/stewardPermissions.js.map +1 -1
- package/dist/stewards/permissions/useStewardPermissions.d.ts +8 -0
- package/dist/stewards/permissions/useStewardPermissions.js +15 -8
- package/dist/stewards/permissions/useStewardPermissions.js.map +1 -1
- package/dist/stewards/utils/charterForm.d.ts +3 -0
- package/dist/stewards/utils/charterForm.js +12 -0
- package/dist/stewards/utils/charterForm.js.map +1 -1
- package/dist/stewards/utils/ownMachine.d.ts +83 -0
- package/dist/stewards/utils/ownMachine.js +63 -0
- package/dist/stewards/utils/ownMachine.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The machine an OWN_MACHINE steward works on (BOFF-18623): the owner's
|
|
3
|
+
* VibeControls machines, which ones have granted this steward, and the chosen
|
|
4
|
+
* one. The owner can grant a machine to the steward here
|
|
5
|
+
* (`grantVibecontrolsAgentToSteward`), revoke the grant, choose a granted
|
|
6
|
+
* machine (`setBotmanorStewardOwnMachineDesk`) or clear the choice
|
|
7
|
+
* (`clearBotmanorStewardOwnMachineDesk`). Only the steward's owner sees these
|
|
8
|
+
* controls, because the services refuse anyone else; their refusals (no
|
|
9
|
+
* grant, machine in use, changed concurrently, check unavailable) are shown
|
|
10
|
+
* with the service's own message. Refresh, and the tab regaining focus,
|
|
11
|
+
* reload the desk, the machines and the grants. The gateway stays the
|
|
12
|
+
* enforcement point.
|
|
13
|
+
*/
|
|
14
|
+
export declare function OwnMachineDeskCard({ stewardId, ownerActorId, canUpdate, vibecontrolsUrl, }: {
|
|
15
|
+
stewardId: string;
|
|
16
|
+
ownerActorId: string;
|
|
17
|
+
/** The viewer holds botmanor-steward:update and the steward is not archived. */
|
|
18
|
+
canUpdate: boolean;
|
|
19
|
+
vibecontrolsUrl?: string;
|
|
20
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useId as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
3
|
+
import { toCurrentEstateAppUrl as o } from "@burdenoff/fe-libs/shared/config";
|
|
4
|
+
import { useAuthTokenOrNull as s } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
|
+
import { ListStewardOwnMachineAgentsDocument as c, ListStewardOwnMachineGrantsDocument as l, useClearBotmanorStewardOwnMachineDeskMutation as u, useGetBotmanorStewardOwnMachineDeskQuery as d, useGrantStewardOwnMachineMutation as f, useRevokeStewardOwnMachineGrantMutation as p, useSetBotmanorStewardOwnMachineDeskMutation as m } from "../../generated/wspace-operations.js";
|
|
6
|
+
import { useStewardsT as h } from "../i18n/useStewardsT.js";
|
|
7
|
+
import { useMachineAbilities as g } from "../permissions/useStewardPermissions.js";
|
|
8
|
+
import { DEFAULT_VIBECONTROLS_URL as ee, GRANT_DAY_OPTIONS as _, activeGrantFor as v, canManageOwnMachine as te, chunk as y, grantExpiry as b, hasNextMachinePage as x, machinesNeedingGrantLookup as S, nextGrantExpiryAt as C, normaliseAllowedApps as w, ownMachineRows as ne } from "../utils/ownMachine.js";
|
|
9
|
+
import { FIELD_INLINE as T } from "./fieldClasses.js";
|
|
10
|
+
import { LinesField as E } from "./LinesField.js";
|
|
11
|
+
import { Alert as D, Badge as O, Button as k, Card as re } from "./ui.js";
|
|
12
|
+
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
13
|
+
// src/stewards/components/OwnMachineDeskCard.tsx
|
|
14
|
+
async function N(e, t, n) {
|
|
15
|
+
let { data: r } = await e.query({
|
|
16
|
+
query: l,
|
|
17
|
+
variables: {
|
|
18
|
+
stewardId: t,
|
|
19
|
+
agentId: n
|
|
20
|
+
},
|
|
21
|
+
fetchPolicy: "network-only"
|
|
22
|
+
});
|
|
23
|
+
return r?.vibecontrolsStewardGrants ?? [];
|
|
24
|
+
}
|
|
25
|
+
var P = {
|
|
26
|
+
agents: void 0,
|
|
27
|
+
grants: void 0,
|
|
28
|
+
error: void 0,
|
|
29
|
+
loading: !1,
|
|
30
|
+
truncated: !1,
|
|
31
|
+
unchecked: /* @__PURE__ */ new Set()
|
|
32
|
+
};
|
|
33
|
+
function ie(n, r, o, s) {
|
|
34
|
+
let l = a(), u = `${n}|${r}|${o ?? ""}`, [d, f] = i(0), [p, m] = i(void 0), h = e(() => {
|
|
35
|
+
s && (m((e) => e && {
|
|
36
|
+
...e,
|
|
37
|
+
loading: !0
|
|
38
|
+
}), f((e) => e + 1));
|
|
39
|
+
}, [s]);
|
|
40
|
+
t(() => {
|
|
41
|
+
if (!s) return;
|
|
42
|
+
let e = !1, t = (e) => N(l, n, e);
|
|
43
|
+
return (async () => {
|
|
44
|
+
let n = [], i = !0;
|
|
45
|
+
for (let t = 0; t < 100 && !e; t += 1) {
|
|
46
|
+
let { data: e } = await l.query({
|
|
47
|
+
query: c,
|
|
48
|
+
variables: { pagination: {
|
|
49
|
+
limit: 100,
|
|
50
|
+
offset: t * 100
|
|
51
|
+
} },
|
|
52
|
+
fetchPolicy: "network-only"
|
|
53
|
+
}), r = e?.vibecontrolsAgents ?? [];
|
|
54
|
+
if (n.push(...r), !x(r.length)) {
|
|
55
|
+
i = !1;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
let a = e ? [] : [...await t()], { lookup: o, unchecked: s } = S(n, a, r), u = new Set(s);
|
|
60
|
+
for (let n of y(o, 8)) {
|
|
61
|
+
if (e) break;
|
|
62
|
+
(await Promise.allSettled(n.map((e) => t(e)))).forEach((e, t) => {
|
|
63
|
+
e.status === "fulfilled" ? a.push(...e.value) : u.add(n[t]);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
agents: n,
|
|
68
|
+
grants: a,
|
|
69
|
+
truncated: i,
|
|
70
|
+
unchecked: u
|
|
71
|
+
};
|
|
72
|
+
})().then(({ agents: t, grants: n, truncated: r, unchecked: i }) => {
|
|
73
|
+
e || m({
|
|
74
|
+
scope: u,
|
|
75
|
+
agents: t,
|
|
76
|
+
grants: n,
|
|
77
|
+
error: void 0,
|
|
78
|
+
loading: !1,
|
|
79
|
+
truncated: r,
|
|
80
|
+
unchecked: i
|
|
81
|
+
});
|
|
82
|
+
}, (t) => {
|
|
83
|
+
e || m({
|
|
84
|
+
...P,
|
|
85
|
+
scope: u,
|
|
86
|
+
error: t instanceof Error ? t : Error(String(t))
|
|
87
|
+
});
|
|
88
|
+
}), () => {
|
|
89
|
+
e = !0;
|
|
90
|
+
};
|
|
91
|
+
}, [
|
|
92
|
+
l,
|
|
93
|
+
u,
|
|
94
|
+
n,
|
|
95
|
+
r,
|
|
96
|
+
s,
|
|
97
|
+
d
|
|
98
|
+
]);
|
|
99
|
+
let g = e(async (e) => {
|
|
100
|
+
let t = await N(l, n, e);
|
|
101
|
+
m((n) => {
|
|
102
|
+
if (!n || n.scope !== u) return n;
|
|
103
|
+
let r = new Set(n.unchecked);
|
|
104
|
+
return r.delete(e), {
|
|
105
|
+
...n,
|
|
106
|
+
grants: [...n.grants ?? [], ...t],
|
|
107
|
+
unchecked: r
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
}, [
|
|
111
|
+
l,
|
|
112
|
+
n,
|
|
113
|
+
u
|
|
114
|
+
]);
|
|
115
|
+
return s ? !p || p.scope !== u ? {
|
|
116
|
+
...P,
|
|
117
|
+
loading: !0,
|
|
118
|
+
reload: h,
|
|
119
|
+
checkAgent: g
|
|
120
|
+
} : {
|
|
121
|
+
...p,
|
|
122
|
+
reload: h,
|
|
123
|
+
checkAgent: g
|
|
124
|
+
} : {
|
|
125
|
+
...P,
|
|
126
|
+
reload: h,
|
|
127
|
+
checkAgent: g
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function F({ stewardId: n, ownerActorId: c, canUpdate: l, vibecontrolsUrl: _ = o(ee) }) {
|
|
131
|
+
let y = h(), x = s()?.userId ?? null, S = te(x, c, l), { canReadMachines: T, canGrantMachines: E } = g(), O = S && E, A = d({
|
|
132
|
+
variables: { stewardId: n },
|
|
133
|
+
fetchPolicy: "cache-and-network"
|
|
134
|
+
}), P = ie(n, c, x, T), [F, I] = m(), [ce, le] = u(), [ue, de] = f(), [fe, pe] = p(), [L, R] = i(7), [z, me] = i([]), [B, V] = i(null), [H, U] = i(!1), W = r("");
|
|
135
|
+
t(() => {
|
|
136
|
+
W.current = `${n}|${c}|${x ?? ""}|${String(O)}`;
|
|
137
|
+
}), t(() => () => {
|
|
138
|
+
W.current = "";
|
|
139
|
+
}, []);
|
|
140
|
+
let G = A.refetch, K = P.reload, q = e(() => {
|
|
141
|
+
G().catch(() => void 0), K();
|
|
142
|
+
}, [G, K]);
|
|
143
|
+
t(() => {
|
|
144
|
+
let e = () => q();
|
|
145
|
+
return window.addEventListener("focus", e), () => window.removeEventListener("focus", e);
|
|
146
|
+
}, [q]);
|
|
147
|
+
let J = A.data?.botmanorStewardOwnMachineDesk ?? null, Y = P.grants ?? [], X = ne(P.agents ?? [], Y, c, J?.agentId ?? null), Z = I.loading || le.loading, he = Z || H || de.loading || pe.loading || P.loading, ge = P.agents !== void 0 && P.grants !== void 0, _e = X.find((e) => e.chosen)?.agent.name, [ve, ye] = i(0), Q = C(Y);
|
|
148
|
+
t(() => {
|
|
149
|
+
if (Q === null) return;
|
|
150
|
+
let e = Math.min(Math.max(Q - Date.now(), 0) + 1e3, 2 ** 31 - 1), t = window.setTimeout(() => ye((e) => e + 1), e);
|
|
151
|
+
return () => window.clearTimeout(t);
|
|
152
|
+
}, [Q, ve]);
|
|
153
|
+
let $ = async (e) => {
|
|
154
|
+
V(null);
|
|
155
|
+
try {
|
|
156
|
+
await e();
|
|
157
|
+
} catch (e) {
|
|
158
|
+
V(e instanceof Error ? e : Error(String(e)));
|
|
159
|
+
}
|
|
160
|
+
q();
|
|
161
|
+
}, be = (e) => void $(() => F({ variables: { input: {
|
|
162
|
+
stewardId: n,
|
|
163
|
+
agentId: e
|
|
164
|
+
} } })), xe = () => void $(() => ce({ variables: { stewardId: n } })), Se = a(), Ce = async (e) => {
|
|
165
|
+
if (H) return;
|
|
166
|
+
U(!0), V(null);
|
|
167
|
+
let t = W.current;
|
|
168
|
+
if (w(z, 1e400).length > 64) V(Error(y("stewards.ownMachine.tooManyApps", { max: 64 }))), U(!1);
|
|
169
|
+
else try {
|
|
170
|
+
let r = await N(Se, n, e);
|
|
171
|
+
if (!t || W.current !== t) return;
|
|
172
|
+
if (r.some((e) => e.status === "ACTIVE")) throw Error(y("stewards.ownMachine.alreadyGranted"));
|
|
173
|
+
await ue({ variables: { input: {
|
|
174
|
+
stewardId: n,
|
|
175
|
+
agentId: e,
|
|
176
|
+
allowedApps: w(z),
|
|
177
|
+
expiresAt: b(L)
|
|
178
|
+
} } });
|
|
179
|
+
} catch (e) {
|
|
180
|
+
V(e instanceof Error ? e : Error(String(e)));
|
|
181
|
+
} finally {
|
|
182
|
+
U(!1), q();
|
|
183
|
+
}
|
|
184
|
+
}, we = P.checkAgent;
|
|
185
|
+
return /* @__PURE__ */ j(re, {
|
|
186
|
+
title: y("stewards.ownMachine.title"),
|
|
187
|
+
hint: y("stewards.ownMachine.hint"),
|
|
188
|
+
children: /* @__PURE__ */ M("div", {
|
|
189
|
+
className: "flex flex-col gap-3 text-sm",
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ M("p", {
|
|
192
|
+
className: "text-(color:--color-text-secondary)",
|
|
193
|
+
children: [
|
|
194
|
+
y(S ? "stewards.ownMachine.ownerHelp" : "stewards.ownMachine.viewerHelp"),
|
|
195
|
+
" ",
|
|
196
|
+
/* @__PURE__ */ j("a", {
|
|
197
|
+
href: _,
|
|
198
|
+
target: "_blank",
|
|
199
|
+
rel: "noreferrer noopener",
|
|
200
|
+
className: "text-(color:--color-accent-primary) underline",
|
|
201
|
+
children: y("stewards.ownMachine.openVibeControls")
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ j(ae, {
|
|
206
|
+
error: A.error,
|
|
207
|
+
loading: A.loading && !A.data,
|
|
208
|
+
current: J,
|
|
209
|
+
name: _e,
|
|
210
|
+
canClear: S,
|
|
211
|
+
busy: Z,
|
|
212
|
+
onClear: xe
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ j("div", {
|
|
215
|
+
className: "flex flex-wrap items-center gap-3",
|
|
216
|
+
children: /* @__PURE__ */ j(k, {
|
|
217
|
+
disabled: P.loading || A.loading,
|
|
218
|
+
onClick: q,
|
|
219
|
+
children: y("stewards.ownMachine.refresh")
|
|
220
|
+
})
|
|
221
|
+
}),
|
|
222
|
+
O && /* @__PURE__ */ j(oe, {
|
|
223
|
+
stewardId: n,
|
|
224
|
+
days: L,
|
|
225
|
+
onDays: R,
|
|
226
|
+
apps: z,
|
|
227
|
+
onApps: me
|
|
228
|
+
}),
|
|
229
|
+
T ? /* @__PURE__ */ j(se, {
|
|
230
|
+
error: P.error,
|
|
231
|
+
listed: ge,
|
|
232
|
+
truncated: P.truncated,
|
|
233
|
+
rows: X,
|
|
234
|
+
unchecked: P.unchecked,
|
|
235
|
+
ownerActorId: c,
|
|
236
|
+
onCheck: (e) => {
|
|
237
|
+
V(null), we(e).catch((e) => V(e instanceof Error ? e : Error(String(e))));
|
|
238
|
+
},
|
|
239
|
+
manage: S,
|
|
240
|
+
grantControls: O,
|
|
241
|
+
busy: he,
|
|
242
|
+
onChoose: be,
|
|
243
|
+
onGrant: (e) => void Ce(e),
|
|
244
|
+
onRevoke: (e) => {
|
|
245
|
+
let t = v(Y, e);
|
|
246
|
+
t ? $(() => fe({ variables: { id: t.id } })) : q();
|
|
247
|
+
}
|
|
248
|
+
}) : /* @__PURE__ */ j("p", {
|
|
249
|
+
className: "text-(color:--color-text-secondary)",
|
|
250
|
+
children: y("stewards.ownMachine.noMachineAccess")
|
|
251
|
+
}),
|
|
252
|
+
B && /* @__PURE__ */ j(D, { children: B.message })
|
|
253
|
+
]
|
|
254
|
+
})
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function ae({ error: e, loading: t, current: n, name: r, canClear: i, busy: a, onClear: o }) {
|
|
258
|
+
let s = h();
|
|
259
|
+
if (e) return /* @__PURE__ */ j(D, { children: e.message });
|
|
260
|
+
if (t) return /* @__PURE__ */ j("p", {
|
|
261
|
+
role: "status",
|
|
262
|
+
className: "text-(color:--color-text-secondary)",
|
|
263
|
+
children: s("stewards.ownMachine.loadingDesk")
|
|
264
|
+
});
|
|
265
|
+
if (!n) return /* @__PURE__ */ j("p", {
|
|
266
|
+
className: "text-(color:--color-text-secondary)",
|
|
267
|
+
children: s("stewards.ownMachine.none")
|
|
268
|
+
});
|
|
269
|
+
let c = n.state === "IN_USE";
|
|
270
|
+
return /* @__PURE__ */ M("div", {
|
|
271
|
+
className: "flex flex-wrap items-center gap-2",
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ j("span", {
|
|
274
|
+
className: "text-(color:--color-text-secondary)",
|
|
275
|
+
children: s("stewards.ownMachine.current")
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ j("strong", {
|
|
278
|
+
className: "text-(color:--color-text-primary)",
|
|
279
|
+
children: r ?? n.agentId
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ j(O, {
|
|
282
|
+
tone: c ? "warning" : "success",
|
|
283
|
+
children: s(c ? "stewards.ownMachine.inUse" : "stewards.ownMachine.ready")
|
|
284
|
+
}),
|
|
285
|
+
i && /* @__PURE__ */ j(k, {
|
|
286
|
+
variant: "danger",
|
|
287
|
+
disabled: a,
|
|
288
|
+
onClick: o,
|
|
289
|
+
children: s("stewards.ownMachine.clear")
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
function oe({ stewardId: e, days: t, onDays: r, apps: i, onApps: a }) {
|
|
295
|
+
let o = h(), s = `own-machine-apps-${e}-${n()}`;
|
|
296
|
+
return /* @__PURE__ */ M("div", {
|
|
297
|
+
className: "flex flex-col gap-2 text-(color:--color-text-secondary)",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ M("label", {
|
|
300
|
+
className: "flex items-center gap-2",
|
|
301
|
+
children: [o("stewards.ownMachine.grantFor"), /* @__PURE__ */ j("select", {
|
|
302
|
+
className: T,
|
|
303
|
+
value: t,
|
|
304
|
+
onChange: (e) => {
|
|
305
|
+
let t = _.find((t) => t === Number(e.target.value));
|
|
306
|
+
t && r(t);
|
|
307
|
+
},
|
|
308
|
+
children: _.map((e) => /* @__PURE__ */ j("option", {
|
|
309
|
+
value: e,
|
|
310
|
+
children: o("stewards.ownMachine.days", { days: e })
|
|
311
|
+
}, e))
|
|
312
|
+
})]
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ j("label", {
|
|
315
|
+
htmlFor: s,
|
|
316
|
+
children: o("stewards.ownMachine.allowedApps")
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ j(E, {
|
|
319
|
+
id: s,
|
|
320
|
+
className: "min-h-16",
|
|
321
|
+
label: o("stewards.ownMachine.allowedApps"),
|
|
322
|
+
value: i,
|
|
323
|
+
onChange: a
|
|
324
|
+
}),
|
|
325
|
+
/* @__PURE__ */ j("span", {
|
|
326
|
+
className: "text-xs",
|
|
327
|
+
children: o("stewards.ownMachine.allowedAppsHelp")
|
|
328
|
+
})
|
|
329
|
+
]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
function se({ error: e, listed: t, truncated: n, rows: r, ...i }) {
|
|
333
|
+
let a = h();
|
|
334
|
+
return /* @__PURE__ */ M(A, { children: [
|
|
335
|
+
e && /* @__PURE__ */ j(D, { children: e.message }),
|
|
336
|
+
!t && !e && /* @__PURE__ */ j("p", {
|
|
337
|
+
role: "status",
|
|
338
|
+
className: "text-(color:--color-text-secondary)",
|
|
339
|
+
children: a("stewards.ownMachine.loadingMachines")
|
|
340
|
+
}),
|
|
341
|
+
t && r.length === 0 && /* @__PURE__ */ j("p", {
|
|
342
|
+
className: "text-(color:--color-text-secondary)",
|
|
343
|
+
children: a("stewards.ownMachine.empty")
|
|
344
|
+
}),
|
|
345
|
+
n && /* @__PURE__ */ j("p", {
|
|
346
|
+
className: "text-(color:--color-text-secondary)",
|
|
347
|
+
children: a("stewards.ownMachine.truncated")
|
|
348
|
+
}),
|
|
349
|
+
r.length > 0 && /* @__PURE__ */ j("ul", {
|
|
350
|
+
className: "flex flex-col gap-2",
|
|
351
|
+
"aria-label": a("stewards.ownMachine.listLabel"),
|
|
352
|
+
children: r.map((e) => /* @__PURE__ */ j(I, {
|
|
353
|
+
row: e,
|
|
354
|
+
...i
|
|
355
|
+
}, e.agent.id))
|
|
356
|
+
})
|
|
357
|
+
] });
|
|
358
|
+
}
|
|
359
|
+
function I({ row: { agent: e, granted: t, chosen: n }, unchecked: r, ownerActorId: i, onCheck: a, manage: o, grantControls: s, busy: c, onChoose: l, onGrant: u, onRevoke: d }) {
|
|
360
|
+
let f = h(), p = !t && r.has(e.id);
|
|
361
|
+
return /* @__PURE__ */ M("li", {
|
|
362
|
+
className: "flex flex-wrap items-center gap-2 rounded-md border border-(color:--color-border-seam) p-2",
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ j("strong", {
|
|
365
|
+
className: "text-(color:--color-text-primary)",
|
|
366
|
+
children: e.name
|
|
367
|
+
}),
|
|
368
|
+
/* @__PURE__ */ j("span", {
|
|
369
|
+
className: "text-xs text-(color:--color-text-secondary)",
|
|
370
|
+
children: e.hostname
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ j(O, {
|
|
373
|
+
tone: e.isActive ? "success" : "neutral",
|
|
374
|
+
children: e.isActive ? f("stewards.ownMachine.active") : f("stewards.ownMachine.inactive")
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ j(O, {
|
|
377
|
+
tone: t ? "info" : "neutral",
|
|
378
|
+
children: f(t ? "stewards.ownMachine.granted" : p ? "stewards.ownMachine.grantUnknown" : "stewards.ownMachine.notGranted")
|
|
379
|
+
}),
|
|
380
|
+
n && /* @__PURE__ */ j(O, {
|
|
381
|
+
tone: "accent",
|
|
382
|
+
children: f("stewards.ownMachine.chosen")
|
|
383
|
+
}),
|
|
384
|
+
(s || o) && p && /* @__PURE__ */ j(k, {
|
|
385
|
+
disabled: c,
|
|
386
|
+
"aria-label": f("stewards.ownMachine.checkNamed", { name: e.name }),
|
|
387
|
+
onClick: () => a(e.id),
|
|
388
|
+
children: f("stewards.ownMachine.check")
|
|
389
|
+
}),
|
|
390
|
+
s && !t && !p && e.ownerUserId === i && /* @__PURE__ */ j(k, {
|
|
391
|
+
disabled: c,
|
|
392
|
+
"aria-label": f("stewards.ownMachine.grantNamed", { name: e.name }),
|
|
393
|
+
onClick: () => u(e.id),
|
|
394
|
+
children: f("stewards.ownMachine.grant")
|
|
395
|
+
}),
|
|
396
|
+
o && t && !n && /* @__PURE__ */ j(k, {
|
|
397
|
+
variant: "primary",
|
|
398
|
+
disabled: c,
|
|
399
|
+
"aria-label": f("stewards.ownMachine.useNamed", { name: e.name }),
|
|
400
|
+
onClick: () => l(e.id),
|
|
401
|
+
children: f("stewards.ownMachine.use")
|
|
402
|
+
}),
|
|
403
|
+
s && t && /* @__PURE__ */ j(k, {
|
|
404
|
+
disabled: c,
|
|
405
|
+
"aria-label": f("stewards.ownMachine.revokeNamed", { name: e.name }),
|
|
406
|
+
onClick: () => d(e.id),
|
|
407
|
+
children: f("stewards.ownMachine.revoke")
|
|
408
|
+
}),
|
|
409
|
+
e.lastHeartbeat && /* @__PURE__ */ j("span", {
|
|
410
|
+
className: "text-xs text-(color:--color-text-secondary)",
|
|
411
|
+
children: f("stewards.ownMachine.lastSeen", { when: new Date(e.lastHeartbeat).toLocaleString() })
|
|
412
|
+
})
|
|
413
|
+
]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
export { F as OwnMachineDeskCard };
|
|
417
|
+
|
|
418
|
+
//# sourceMappingURL=OwnMachineDeskCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnMachineDeskCard.js","names":["_jsx","_jsxs","_Fragment","useCallback","useEffect","useId","useRef","useState","useApolloClient","toCurrentEstateAppUrl","useAuthTokenOrNull","ListStewardOwnMachineAgentsDocument","ListStewardOwnMachineGrantsDocument","useClearBotmanorStewardOwnMachineDeskMutation","useGetBotmanorStewardOwnMachineDeskQuery","useGrantStewardOwnMachineMutation","useRevokeStewardOwnMachineGrantMutation","useSetBotmanorStewardOwnMachineDeskMutation","useStewardsT","useMachineAbilities","DEFAULT_VIBECONTROLS_URL","GRANT_DAY_OPTIONS","activeGrantFor","canManageOwnMachine","chunk","grantExpiry","hasNextMachinePage","machinesNeedingGrantLookup","nextGrantExpiryAt","normaliseAllowedApps","ownMachineRows","FIELD_INLINE","LinesField","Alert","Badge","Button","Card","Fragment","jsx","jsxs","fetchStewardGrants","client","stewardId","agentId","data","EMPTY_MACHINES","useOwnMachineData","ownerActorId","viewerId","enabled","scope","nonce","setNonce","state","setState","reload","prev","n","cancelled","queryGrants","agents","truncated","page","batch","grants","lookup","unchecked","notChecked","result","err","checkAgent","found","OwnMachineDeskCard","canUpdate","vibecontrolsUrl","t","manage","canReadMachines","canGrantMachines","grantControls","desk","machines","choose","chooseState","clear","clearState","grant","grantState","revoke","revokeState","grantDays","setGrantDays","allowedApps","setAllowedApps","actionError","setActionError","granting","setGranting","scopeRef","refetchDesk","reloadMachines","refresh","onFocus","current","rows","deskBusy","busy","listed","chosenName","r","expiryTick","setExpiryTick","nextExpiry","delay","id","run","action","onChoose","onClear","onGrant","startedIn","existing","g","CurrentDesk","GrantOptions","MachineList","active","error","loading","name","canClear","inUse","days","onDays","apps","onApps","appsId","next","d","actions","row","MachineRow","agent","granted","chosen","onCheck","onRevoke","unknown"],"sources":["../../../src/stewards/components/OwnMachineDeskCard.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useRef, useState } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { toCurrentEstateAppUrl } from '@burdenoff/fe-libs/shared/config';\nimport { useAuthTokenOrNull } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n ListStewardOwnMachineAgentsDocument,\n type ListStewardOwnMachineAgentsQuery,\n type ListStewardOwnMachineAgentsQueryVariables,\n ListStewardOwnMachineGrantsDocument,\n type ListStewardOwnMachineGrantsQuery,\n type ListStewardOwnMachineGrantsQueryVariables,\n type StewardOwnMachineGrantFieldsFragment,\n useClearBotmanorStewardOwnMachineDeskMutation,\n useGetBotmanorStewardOwnMachineDeskQuery,\n useGrantStewardOwnMachineMutation,\n useRevokeStewardOwnMachineGrantMutation,\n useSetBotmanorStewardOwnMachineDeskMutation,\n} from '../../generated/wspace-operations';\nimport { useStewardsT } from '../i18n/useStewardsT';\nimport { useMachineAbilities } from '../permissions/useStewardPermissions';\nimport {\n activeGrantFor,\n canManageOwnMachine,\n DEFAULT_VIBECONTROLS_URL,\n GRANT_DAY_OPTIONS,\n grantExpiry,\n chunk,\n GRANT_LOOKUP_CONCURRENCY,\n machinesNeedingGrantLookup,\n MAX_ALLOWED_APPS,\n normaliseAllowedApps,\n hasNextMachinePage,\n nextGrantExpiryAt,\n OWN_MACHINE_MAX_PAGES,\n OWN_MACHINE_PAGE_SIZE,\n ownMachineRows,\n type GrantDays,\n type OwnMachineAgent,\n type OwnMachineRow,\n} from '../utils/ownMachine';\nimport { FIELD_INLINE } from './fieldClasses';\nimport { LinesField } from './LinesField';\nimport { Alert, Badge, Button, Card } from './ui';\n\ntype Grant = StewardOwnMachineGrantFieldsFragment;\n\ninterface MachinesState {\n agents: OwnMachineAgent[] | undefined;\n grants: Grant[] | undefined;\n error: Error | undefined;\n loading: boolean;\n /** More machine pages exist than were read (OWN_MACHINE_MAX_PAGES). */\n truncated: boolean;\n /** Owner machines whose grant could not be checked (past GRANT_LOOKUP_LIMIT). */\n unchecked: ReadonlySet<string>;\n}\n\n/** The steward's grants, or one machine's when `agentId` is given; always from the network. */\nasync function fetchStewardGrants(\n client: ReturnType<typeof useApolloClient>,\n stewardId: string,\n agentId?: string\n): Promise<Grant[]> {\n const { data } = await client.query<\n ListStewardOwnMachineGrantsQuery,\n ListStewardOwnMachineGrantsQueryVariables\n >({\n query: ListStewardOwnMachineGrantsDocument,\n variables: { stewardId, agentId },\n fetchPolicy: 'network-only',\n });\n return data?.vibecontrolsStewardGrants ?? [];\n}\n\nconst EMPTY_MACHINES: MachinesState = {\n agents: undefined,\n grants: undefined,\n error: undefined,\n loading: false,\n truncated: false,\n unchecked: new Set(),\n};\n\n/**\n * Every VibeControls machine the viewer can see in the workspace, page by\n * page, and the steward's live grants. The agents query has no owner filter,\n * so the owner's machines can sit on any page. The grants list is capped by\n * the service before it drops expired rows, so a shorter list can still miss\n * a live grant: each of the owner's machines without a live grant in the list\n * is looked up on its own (at most GRANT_LOOKUP_LIMIT). Data is keyed by\n * steward and owner, so another steward's grants are never shown or acted on;\n * a superseded load stops before its next request.\n */\nfunction useOwnMachineData(\n stewardId: string,\n ownerActorId: string,\n viewerId: string | null,\n enabled: boolean\n): MachinesState & { reload: () => void; checkAgent: (agentId: string) => Promise<void> } {\n const client = useApolloClient();\n const scope = `${stewardId}|${ownerActorId}|${viewerId ?? ''}`;\n const [nonce, setNonce] = useState(0);\n const [state, setState] = useState<(MachinesState & { scope: string }) | undefined>(undefined);\n const reload = useCallback(() => {\n if (!enabled) return;\n setState((prev) => (prev ? { ...prev, loading: true } : prev));\n setNonce((n) => n + 1);\n }, [enabled]);\n useEffect(() => {\n if (!enabled) return undefined;\n let cancelled = false;\n const queryGrants = (agentId?: string) => fetchStewardGrants(client, stewardId, agentId);\n const load = async () => {\n const agents: OwnMachineAgent[] = [];\n let truncated = true;\n for (let page = 0; page < OWN_MACHINE_MAX_PAGES && !cancelled; page += 1) {\n const { data } = await client.query<\n ListStewardOwnMachineAgentsQuery,\n ListStewardOwnMachineAgentsQueryVariables\n >({\n query: ListStewardOwnMachineAgentsDocument,\n variables: {\n pagination: { limit: OWN_MACHINE_PAGE_SIZE, offset: page * OWN_MACHINE_PAGE_SIZE },\n },\n fetchPolicy: 'network-only',\n });\n const batch = data?.vibecontrolsAgents ?? [];\n agents.push(...batch);\n if (!hasNextMachinePage(batch.length)) {\n truncated = false;\n break;\n }\n }\n // A locally owned copy: Apollo may freeze its result arrays.\n const grants = cancelled ? [] : [...(await queryGrants())];\n const { lookup, unchecked } = machinesNeedingGrantLookup(agents, grants, ownerActorId);\n // A failed lookup leaves only that machine unchecked; the rest still show.\n const notChecked = new Set(unchecked);\n for (const batch of chunk(lookup, GRANT_LOOKUP_CONCURRENCY)) {\n if (cancelled) break;\n const found = await Promise.allSettled(batch.map((agentId) => queryGrants(agentId)));\n found.forEach((result, n) => {\n if (result.status === 'fulfilled') grants.push(...result.value);\n else notChecked.add(batch[n] as string);\n });\n }\n return { agents, grants, truncated, unchecked: notChecked };\n };\n load().then(\n ({ agents, grants, truncated, unchecked }) => {\n if (!cancelled)\n setState({\n scope,\n agents,\n grants,\n error: undefined,\n loading: false,\n truncated,\n unchecked,\n });\n },\n (err: unknown) => {\n if (cancelled) return;\n setState({\n ...EMPTY_MACHINES,\n scope,\n error: err instanceof Error ? err : new Error(String(err)),\n });\n }\n );\n return () => {\n cancelled = true;\n };\n }, [client, scope, stewardId, ownerActorId, enabled, nonce]);\n const checkAgent = useCallback(\n async (agentId: string) => {\n const found = await fetchStewardGrants(client, stewardId, agentId);\n setState((prev) => {\n if (!prev || prev.scope !== scope) return prev;\n const unchecked = new Set(prev.unchecked);\n unchecked.delete(agentId);\n return { ...prev, grants: [...(prev.grants ?? []), ...found], unchecked };\n });\n },\n [client, stewardId, scope]\n );\n if (!enabled) return { ...EMPTY_MACHINES, reload, checkAgent };\n // Until this steward's first answer, nothing from another steward is shown.\n if (!state || state.scope !== scope)\n return { ...EMPTY_MACHINES, loading: true, reload, checkAgent };\n return { ...state, reload, checkAgent };\n}\n\n/**\n * The machine an OWN_MACHINE steward works on (BOFF-18623): the owner's\n * VibeControls machines, which ones have granted this steward, and the chosen\n * one. The owner can grant a machine to the steward here\n * (`grantVibecontrolsAgentToSteward`), revoke the grant, choose a granted\n * machine (`setBotmanorStewardOwnMachineDesk`) or clear the choice\n * (`clearBotmanorStewardOwnMachineDesk`). Only the steward's owner sees these\n * controls, because the services refuse anyone else; their refusals (no\n * grant, machine in use, changed concurrently, check unavailable) are shown\n * with the service's own message. Refresh, and the tab regaining focus,\n * reload the desk, the machines and the grants. The gateway stays the\n * enforcement point.\n */\nexport function OwnMachineDeskCard({\n stewardId,\n ownerActorId,\n canUpdate,\n vibecontrolsUrl = toCurrentEstateAppUrl(DEFAULT_VIBECONTROLS_URL),\n}: {\n stewardId: string;\n ownerActorId: string;\n /** The viewer holds botmanor-steward:update and the steward is not archived. */\n canUpdate: boolean;\n vibecontrolsUrl?: string;\n}) {\n const t = useStewardsT();\n const viewerId = useAuthTokenOrNull()?.userId ?? null;\n const manage = canManageOwnMachine(viewerId, ownerActorId, canUpdate);\n const { canReadMachines, canGrantMachines } = useMachineAbilities();\n const grantControls = manage && canGrantMachines;\n const desk = useGetBotmanorStewardOwnMachineDeskQuery({\n variables: { stewardId },\n fetchPolicy: 'cache-and-network',\n });\n const machines = useOwnMachineData(stewardId, ownerActorId, viewerId, canReadMachines);\n const [choose, chooseState] = useSetBotmanorStewardOwnMachineDeskMutation();\n const [clear, clearState] = useClearBotmanorStewardOwnMachineDeskMutation();\n const [grant, grantState] = useGrantStewardOwnMachineMutation();\n const [revoke, revokeState] = useRevokeStewardOwnMachineGrantMutation();\n const [grantDays, setGrantDays] = useState<GrantDays>(7);\n const [allowedApps, setAllowedApps] = useState<string[]>([]);\n const [actionError, setActionError] = useState<Error | null>(null);\n // Held from the grant's pre-check to the end of its mutation, so two clicks\n // cannot both pass the check.\n const [granting, setGranting] = useState(false);\n // The context a grant's pre-check ran in; a grant is not sent into another.\n const scopeRef = useRef('');\n useEffect(() => {\n scopeRef.current = `${stewardId}|${ownerActorId}|${viewerId ?? ''}|${String(grantControls)}`;\n });\n // An unmounted card sends nothing more.\n useEffect(\n () => () => {\n scopeRef.current = '';\n },\n []\n );\n\n const refetchDesk = desk.refetch;\n const reloadMachines = machines.reload;\n const refresh = useCallback(() => {\n void refetchDesk().catch(() => undefined);\n reloadMachines();\n }, [refetchDesk, reloadMachines]);\n useEffect(() => {\n const onFocus = () => refresh();\n window.addEventListener('focus', onFocus);\n return () => window.removeEventListener('focus', onFocus);\n }, [refresh]);\n\n const current = desk.data?.botmanorStewardOwnMachineDesk ?? null;\n const grants = machines.grants ?? [];\n const rows = ownMachineRows(\n machines.agents ?? [],\n grants,\n ownerActorId,\n current?.agentId ?? null\n );\n // Clearing needs only the desk; row actions also wait for the refresh after\n // a change, so a stale row is never acted on.\n const deskBusy = chooseState.loading || clearState.loading;\n const busy =\n deskBusy || granting || grantState.loading || revokeState.loading || machines.loading;\n const listed = machines.agents !== undefined && machines.grants !== undefined;\n const chosenName = rows.find((r) => r.chosen)?.agent.name;\n\n // Re-render when the next grant expires, so its row offers Grant again.\n const [expiryTick, setExpiryTick] = useState(0);\n const nextExpiry = nextGrantExpiryAt(grants);\n useEffect(() => {\n if (nextExpiry === null) return undefined;\n // setTimeout holds at most 2^31-1 ms; a later expiry re-arms on the next render.\n const delay = Math.min(Math.max(nextExpiry - Date.now(), 0) + 1000, 2 ** 31 - 1);\n // Each tick re-runs this effect, so a capped wait is rescheduled.\n const id = window.setTimeout(() => setExpiryTick((n) => n + 1), delay);\n return () => window.clearTimeout(id);\n }, [nextExpiry, expiryTick]);\n\n const run = async (action: () => Promise<unknown>) => {\n setActionError(null);\n try {\n await action();\n } catch (err) {\n setActionError(err instanceof Error ? err : new Error(String(err)));\n }\n refresh();\n };\n const onChoose = (agentId: string) =>\n void run(() => choose({ variables: { input: { stewardId, agentId } } }));\n const onClear = () => void run(() => clear({ variables: { stewardId } }));\n const client = useApolloClient();\n const onGrant = async (agentId: string) => {\n if (granting) return;\n setGranting(true);\n setActionError(null);\n const startedIn = scopeRef.current;\n if (normaliseAllowedApps(allowedApps, Infinity).length > MAX_ALLOWED_APPS) {\n setActionError(new Error(t('stewards.ownMachine.tooManyApps', { max: MAX_ALLOWED_APPS })));\n setGranting(false);\n return;\n }\n try {\n // The list may be stale (renewed elsewhere, or expired by the clock): a\n // second grant would replace the live one's apps and expiry, so check\n // first, trusting the service's status rather than this browser's clock.\n const existing = await fetchStewardGrants(client, stewardId, agentId);\n // The steward or viewer changed meanwhile: do not send a grant into a\n // context the check did not cover.\n if (!startedIn || scopeRef.current !== startedIn) return;\n if (existing.some((g) => g.status === 'ACTIVE'))\n throw new Error(t('stewards.ownMachine.alreadyGranted'));\n await grant({\n variables: {\n input: {\n stewardId,\n agentId,\n allowedApps: normaliseAllowedApps(allowedApps),\n expiresAt: grantExpiry(grantDays),\n },\n },\n });\n } catch (err) {\n setActionError(err instanceof Error ? err : new Error(String(err)));\n } finally {\n setGranting(false);\n refresh();\n }\n };\n const checkAgent = machines.checkAgent;\n const onCheck = (agentId: string) => {\n setActionError(null);\n checkAgent(agentId).catch((err: unknown) =>\n setActionError(err instanceof Error ? err : new Error(String(err)))\n );\n };\n const onRevoke = (agentId: string) => {\n const active = activeGrantFor(grants, agentId);\n if (active) void run(() => revoke({ variables: { id: active.id } }));\n else refresh();\n };\n\n return (\n <Card title={t('stewards.ownMachine.title')} hint={t('stewards.ownMachine.hint')}>\n <div className=\"flex flex-col gap-3 text-sm\">\n <p className=\"text-(color:--color-text-secondary)\">\n {manage ? t('stewards.ownMachine.ownerHelp') : t('stewards.ownMachine.viewerHelp')}{' '}\n <a\n href={vibecontrolsUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"text-(color:--color-accent-primary) underline\"\n >\n {t('stewards.ownMachine.openVibeControls')}\n </a>\n </p>\n\n <CurrentDesk\n error={desk.error}\n loading={desk.loading && !desk.data}\n current={current}\n name={chosenName}\n canClear={manage}\n busy={deskBusy}\n onClear={onClear}\n />\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <Button disabled={machines.loading || desk.loading} onClick={refresh}>\n {t('stewards.ownMachine.refresh')}\n </Button>\n </div>\n {grantControls && (\n <GrantOptions\n stewardId={stewardId}\n days={grantDays}\n onDays={setGrantDays}\n apps={allowedApps}\n onApps={setAllowedApps}\n />\n )}\n\n {canReadMachines ? (\n <MachineList\n error={machines.error}\n listed={listed}\n truncated={machines.truncated}\n rows={rows}\n unchecked={machines.unchecked}\n ownerActorId={ownerActorId}\n onCheck={onCheck}\n manage={manage}\n grantControls={grantControls}\n busy={busy}\n onChoose={onChoose}\n onGrant={(agentId) => void onGrant(agentId)}\n onRevoke={onRevoke}\n />\n ) : (\n <p className=\"text-(color:--color-text-secondary)\">\n {t('stewards.ownMachine.noMachineAccess')}\n </p>\n )}\n {actionError && <Alert>{actionError.message}</Alert>}\n </div>\n </Card>\n );\n}\n\n/** The machine the steward works on now, with Clear for the owner. */\nfunction CurrentDesk({\n error,\n loading,\n current,\n name,\n canClear,\n busy,\n onClear,\n}: {\n error: Error | undefined;\n loading: boolean;\n current: { agentId: string; state: string } | null;\n name: string | undefined;\n canClear: boolean;\n busy: boolean;\n onClear: () => void;\n}) {\n const t = useStewardsT();\n if (error) return <Alert>{error.message}</Alert>;\n if (loading)\n return (\n <p role=\"status\" className=\"text-(color:--color-text-secondary)\">\n {t('stewards.ownMachine.loadingDesk')}\n </p>\n );\n if (!current)\n return <p className=\"text-(color:--color-text-secondary)\">{t('stewards.ownMachine.none')}</p>;\n const inUse = current.state === 'IN_USE';\n return (\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-(color:--color-text-secondary)\">\n {t('stewards.ownMachine.current')}\n </span>\n <strong className=\"text-(color:--color-text-primary)\">{name ?? current.agentId}</strong>\n <Badge tone={inUse ? 'warning' : 'success'}>\n {inUse ? t('stewards.ownMachine.inUse') : t('stewards.ownMachine.ready')}\n </Badge>\n {canClear && (\n <Button variant=\"danger\" disabled={busy} onClick={onClear}>\n {t('stewards.ownMachine.clear')}\n </Button>\n )}\n </div>\n );\n}\n\n/** How long a new grant lasts, and the apps it allows. */\nfunction GrantOptions({\n stewardId,\n days,\n onDays,\n apps,\n onApps,\n}: {\n stewardId: string;\n days: GrantDays;\n onDays: (days: GrantDays) => void;\n apps: string[];\n onApps: (apps: string[]) => void;\n}) {\n const t = useStewardsT();\n const appsId = `own-machine-apps-${stewardId}-${useId()}`;\n return (\n <div className=\"flex flex-col gap-2 text-(color:--color-text-secondary)\">\n <label className=\"flex items-center gap-2\">\n {t('stewards.ownMachine.grantFor')}\n <select\n className={FIELD_INLINE}\n value={days}\n onChange={(e) => {\n const next = GRANT_DAY_OPTIONS.find((d) => d === Number(e.target.value));\n if (next) onDays(next);\n }}\n >\n {GRANT_DAY_OPTIONS.map((d) => (\n <option key={d} value={d}>\n {t('stewards.ownMachine.days', { days: d })}\n </option>\n ))}\n </select>\n </label>\n <label htmlFor={appsId}>{t('stewards.ownMachine.allowedApps')}</label>\n <LinesField\n id={appsId}\n className=\"min-h-16\"\n label={t('stewards.ownMachine.allowedApps')}\n value={apps}\n onChange={onApps}\n />\n <span className=\"text-xs\">{t('stewards.ownMachine.allowedAppsHelp')}</span>\n </div>\n );\n}\n\ninterface RowActions {\n /** Machines whose grant was not checked: no grant action is offered on them. */\n unchecked: ReadonlySet<string>;\n /** The steward's owner: only a machine they own can be granted by them. */\n ownerActorId: string;\n onCheck: (agentId: string) => void;\n manage: boolean;\n /** The owner may also grant and revoke (agent:update). */\n grantControls: boolean;\n busy: boolean;\n onChoose: (agentId: string) => void;\n onGrant: (agentId: string) => void;\n onRevoke: (agentId: string) => void;\n}\n\n/** The owner's machines with their grant state and what the viewer may do. */\nfunction MachineList({\n error,\n listed,\n truncated,\n rows,\n ...actions\n}: {\n error: Error | undefined;\n listed: boolean;\n truncated: boolean;\n rows: OwnMachineRow[];\n} & RowActions) {\n const t = useStewardsT();\n return (\n <>\n {error && <Alert>{error.message}</Alert>}\n {!listed && !error && (\n <p role=\"status\" className=\"text-(color:--color-text-secondary)\">\n {t('stewards.ownMachine.loadingMachines')}\n </p>\n )}\n {listed && rows.length === 0 && (\n <p className=\"text-(color:--color-text-secondary)\">{t('stewards.ownMachine.empty')}</p>\n )}\n {truncated && (\n <p className=\"text-(color:--color-text-secondary)\">{t('stewards.ownMachine.truncated')}</p>\n )}\n {rows.length > 0 && (\n <ul className=\"flex flex-col gap-2\" aria-label={t('stewards.ownMachine.listLabel')}>\n {rows.map((row) => (\n <MachineRow key={row.agent.id} row={row} {...actions} />\n ))}\n </ul>\n )}\n </>\n );\n}\n\nfunction MachineRow({\n row: { agent, granted, chosen },\n unchecked,\n ownerActorId,\n onCheck,\n manage,\n grantControls,\n busy,\n onChoose,\n onGrant,\n onRevoke,\n}: { row: OwnMachineRow } & RowActions) {\n const t = useStewardsT();\n // A grant the service list may have left out is not known: granting could replace it.\n const unknown = !granted && unchecked.has(agent.id);\n return (\n <li className=\"flex flex-wrap items-center gap-2 rounded-md border border-(color:--color-border-seam) p-2\">\n <strong className=\"text-(color:--color-text-primary)\">{agent.name}</strong>\n <span className=\"text-xs text-(color:--color-text-secondary)\">{agent.hostname}</span>\n <Badge tone={agent.isActive ? 'success' : 'neutral'}>\n {agent.isActive ? t('stewards.ownMachine.active') : t('stewards.ownMachine.inactive')}\n </Badge>\n <Badge tone={granted ? 'info' : 'neutral'}>\n {granted\n ? t('stewards.ownMachine.granted')\n : unknown\n ? t('stewards.ownMachine.grantUnknown')\n : t('stewards.ownMachine.notGranted')}\n </Badge>\n {chosen && <Badge tone=\"accent\">{t('stewards.ownMachine.chosen')}</Badge>}\n {(grantControls || manage) && unknown && (\n <Button\n disabled={busy}\n aria-label={t('stewards.ownMachine.checkNamed', { name: agent.name })}\n onClick={() => onCheck(agent.id)}\n >\n {t('stewards.ownMachine.check')}\n </Button>\n )}\n {grantControls && !granted && !unknown && agent.ownerUserId === ownerActorId && (\n <Button\n disabled={busy}\n aria-label={t('stewards.ownMachine.grantNamed', { name: agent.name })}\n onClick={() => onGrant(agent.id)}\n >\n {t('stewards.ownMachine.grant')}\n </Button>\n )}\n {manage && granted && !chosen && (\n <Button\n variant=\"primary\"\n disabled={busy}\n aria-label={t('stewards.ownMachine.useNamed', { name: agent.name })}\n onClick={() => onChoose(agent.id)}\n >\n {t('stewards.ownMachine.use')}\n </Button>\n )}\n {grantControls && granted && (\n <Button\n disabled={busy}\n aria-label={t('stewards.ownMachine.revokeNamed', { name: agent.name })}\n onClick={() => onRevoke(agent.id)}\n >\n {t('stewards.ownMachine.revoke')}\n </Button>\n )}\n {agent.lastHeartbeat && (\n <span className=\"text-xs text-(color:--color-text-secondary)\">\n {t('stewards.ownMachine.lastSeen', {\n when: new Date(agent.lastHeartbeat).toLocaleString(),\n })}\n </span>\n )}\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,eAAewC,EACbC,GACAC,GACAC,GACkB;CAClB,IAAM,EAAEC,YAAS,MAAMH,EAAO,MAG5B;EACA,OAAO7B;EACP,WAAW;GAAE8B;GAAWC;EAAQ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AE,mCAAmC,EAAE,MAAMmE,EAAM,KAAK,CAAC;IACrE,eAAeI,EAASJ,EAAM,EAAE;IAE/B,UAAAnE,EAAE,4BAA4B;GACzB,CAAA;GAETmE,EAAM,iBACL9I,kBAAC,QAAD;IAAM,WAAU;IACb,UAAA2E,EAAE,gCAAgC,EACjC,MAAM,IAAI,KAAKmE,EAAM,aAAa,CAAC,CAAC,eAAe,EACrD,CAAC;GACG,CAAA;EAEN;;AAER"}
|
|
@@ -136,6 +136,13 @@ export declare const enTranslations: {
|
|
|
136
136
|
readonly 'desk:write_file': "Write files";
|
|
137
137
|
readonly 'platform:current_time': "Check the time";
|
|
138
138
|
readonly 'platform:notify_owner': "Notify the owner";
|
|
139
|
+
readonly 'workqueue:list': "See the work queues";
|
|
140
|
+
readonly 'workqueue:add': "Add work items";
|
|
141
|
+
readonly 'workqueue:lease': "Take the next work item";
|
|
142
|
+
readonly 'workqueue:extend': "Keep working on an item longer";
|
|
143
|
+
readonly 'workqueue:complete': "Mark a work item done";
|
|
144
|
+
readonly 'workqueue:fail': "Report a work item as failed";
|
|
145
|
+
readonly 'workflow-run:read': "Read the result of a workflow run (review tasks)";
|
|
139
146
|
};
|
|
140
147
|
readonly budget: {
|
|
141
148
|
readonly credits: "AI credits";
|
|
@@ -267,6 +274,46 @@ export declare const enTranslations: {
|
|
|
267
274
|
readonly colStarted: "Started";
|
|
268
275
|
readonly colTrigger: "Trigger";
|
|
269
276
|
};
|
|
277
|
+
readonly ownMachine: {
|
|
278
|
+
readonly title: "Own machine";
|
|
279
|
+
readonly hint: "The VibeControls machine this steward works on";
|
|
280
|
+
readonly ownerHelp: "Only your own machines are listed. Grant a machine to this steward, then choose it. You can also manage your machines in VibeControls.";
|
|
281
|
+
readonly viewerHelp: "Only the steward's owner can grant or choose a machine. Machines are managed in VibeControls.";
|
|
282
|
+
readonly grantFor: "Grant for";
|
|
283
|
+
readonly days: "{days} days";
|
|
284
|
+
readonly grant: "Grant to this steward";
|
|
285
|
+
readonly grantNamed: "Grant {name} to this steward";
|
|
286
|
+
readonly revoke: "Revoke grant";
|
|
287
|
+
readonly revokeNamed: "Revoke the grant on {name}";
|
|
288
|
+
readonly allowedApps: "Apps the steward may use on a granted machine";
|
|
289
|
+
readonly allowedAppsHelp: "One app name or platform id per line (for example a macOS bundle id). Desktop actions in other apps are refused; browser and workspace-folder actions are not limited by this list.";
|
|
290
|
+
readonly openVibeControls: "Open VibeControls";
|
|
291
|
+
readonly loadingDesk: "Loading the machine…";
|
|
292
|
+
readonly current: "Works on";
|
|
293
|
+
readonly inUse: "In use by a run";
|
|
294
|
+
readonly ready: "Not in use by a run";
|
|
295
|
+
readonly none: "No machine chosen yet.";
|
|
296
|
+
readonly clear: "Clear";
|
|
297
|
+
readonly refresh: "Refresh";
|
|
298
|
+
readonly loadingMachines: "Loading your machines…";
|
|
299
|
+
readonly empty: "You have no VibeControls machines in this workspace.";
|
|
300
|
+
readonly truncated: "Only the first machines in this workspace are listed.";
|
|
301
|
+
readonly listLabel: "Your machines";
|
|
302
|
+
readonly active: "Active";
|
|
303
|
+
readonly inactive: "Inactive";
|
|
304
|
+
readonly noMachineAccess: "Your role cannot see VibeControls machines in this workspace.";
|
|
305
|
+
readonly granted: "Granted";
|
|
306
|
+
readonly notGranted: "Not granted";
|
|
307
|
+
readonly grantUnknown: "Grant not checked";
|
|
308
|
+
readonly check: "Check grant";
|
|
309
|
+
readonly tooManyApps: "A grant allows at most {max} apps. Shorten the list and grant again.";
|
|
310
|
+
readonly checkNamed: "Check the grant on {name}";
|
|
311
|
+
readonly alreadyGranted: "This machine already has a live grant for this steward. Revoke it first to change its apps or length.";
|
|
312
|
+
readonly chosen: "Chosen";
|
|
313
|
+
readonly use: "Use this machine";
|
|
314
|
+
readonly useNamed: "Use {name}";
|
|
315
|
+
readonly lastSeen: "Last seen {when}";
|
|
316
|
+
};
|
|
270
317
|
readonly charter: {
|
|
271
318
|
readonly rulesTitle: "Rules";
|
|
272
319
|
readonly rulesHint: "Plain language — checked by the reviewer model on every outward action";
|
|
@@ -279,6 +326,7 @@ export declare const enTranslations: {
|
|
|
279
326
|
readonly groupAct: "Act on the screen";
|
|
280
327
|
readonly groupFiles: "Files and shell";
|
|
281
328
|
readonly groupPlatform: "BotManor tools";
|
|
329
|
+
readonly groupWorkQueues: "FluidGrids work queues and review tasks";
|
|
282
330
|
readonly customTitle: "Connectors and workflows";
|
|
283
331
|
readonly customHint: "One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.";
|
|
284
332
|
readonly customInvalid: "Not a valid tool key: {key}";
|
package/dist/stewards/i18n/en.js
CHANGED
|
@@ -135,7 +135,14 @@ var t = { stewards: {
|
|
|
135
135
|
"desk:read_file": "Read files",
|
|
136
136
|
"desk:write_file": "Write files",
|
|
137
137
|
"platform:current_time": "Check the time",
|
|
138
|
-
"platform:notify_owner": "Notify the owner"
|
|
138
|
+
"platform:notify_owner": "Notify the owner",
|
|
139
|
+
"workqueue:list": "See the work queues",
|
|
140
|
+
"workqueue:add": "Add work items",
|
|
141
|
+
"workqueue:lease": "Take the next work item",
|
|
142
|
+
"workqueue:extend": "Keep working on an item longer",
|
|
143
|
+
"workqueue:complete": "Mark a work item done",
|
|
144
|
+
"workqueue:fail": "Report a work item as failed",
|
|
145
|
+
"workflow-run:read": "Read the result of a workflow run (review tasks)"
|
|
139
146
|
},
|
|
140
147
|
budget: {
|
|
141
148
|
credits: "AI credits",
|
|
@@ -267,6 +274,46 @@ var t = { stewards: {
|
|
|
267
274
|
colStarted: "Started",
|
|
268
275
|
colTrigger: "Trigger"
|
|
269
276
|
},
|
|
277
|
+
ownMachine: {
|
|
278
|
+
title: "Own machine",
|
|
279
|
+
hint: "The VibeControls machine this steward works on",
|
|
280
|
+
ownerHelp: "Only your own machines are listed. Grant a machine to this steward, then choose it. You can also manage your machines in VibeControls.",
|
|
281
|
+
viewerHelp: "Only the steward's owner can grant or choose a machine. Machines are managed in VibeControls.",
|
|
282
|
+
grantFor: "Grant for",
|
|
283
|
+
days: "{days} days",
|
|
284
|
+
grant: "Grant to this steward",
|
|
285
|
+
grantNamed: "Grant {name} to this steward",
|
|
286
|
+
revoke: "Revoke grant",
|
|
287
|
+
revokeNamed: "Revoke the grant on {name}",
|
|
288
|
+
allowedApps: "Apps the steward may use on a granted machine",
|
|
289
|
+
allowedAppsHelp: "One app name or platform id per line (for example a macOS bundle id). Desktop actions in other apps are refused; browser and workspace-folder actions are not limited by this list.",
|
|
290
|
+
openVibeControls: "Open VibeControls",
|
|
291
|
+
loadingDesk: "Loading the machine…",
|
|
292
|
+
current: "Works on",
|
|
293
|
+
inUse: "In use by a run",
|
|
294
|
+
ready: "Not in use by a run",
|
|
295
|
+
none: "No machine chosen yet.",
|
|
296
|
+
clear: "Clear",
|
|
297
|
+
refresh: "Refresh",
|
|
298
|
+
loadingMachines: "Loading your machines…",
|
|
299
|
+
empty: "You have no VibeControls machines in this workspace.",
|
|
300
|
+
truncated: "Only the first machines in this workspace are listed.",
|
|
301
|
+
listLabel: "Your machines",
|
|
302
|
+
active: "Active",
|
|
303
|
+
inactive: "Inactive",
|
|
304
|
+
noMachineAccess: "Your role cannot see VibeControls machines in this workspace.",
|
|
305
|
+
granted: "Granted",
|
|
306
|
+
notGranted: "Not granted",
|
|
307
|
+
grantUnknown: "Grant not checked",
|
|
308
|
+
check: "Check grant",
|
|
309
|
+
tooManyApps: "A grant allows at most {max} apps. Shorten the list and grant again.",
|
|
310
|
+
checkNamed: "Check the grant on {name}",
|
|
311
|
+
alreadyGranted: "This machine already has a live grant for this steward. Revoke it first to change its apps or length.",
|
|
312
|
+
chosen: "Chosen",
|
|
313
|
+
use: "Use this machine",
|
|
314
|
+
useNamed: "Use {name}",
|
|
315
|
+
lastSeen: "Last seen {when}"
|
|
316
|
+
},
|
|
270
317
|
charter: {
|
|
271
318
|
rulesTitle: "Rules",
|
|
272
319
|
rulesHint: "Plain language — checked by the reviewer model on every outward action",
|
|
@@ -279,6 +326,7 @@ var t = { stewards: {
|
|
|
279
326
|
groupAct: "Act on the screen",
|
|
280
327
|
groupFiles: "Files and shell",
|
|
281
328
|
groupPlatform: "BotManor tools",
|
|
329
|
+
groupWorkQueues: "FluidGrids work queues and review tasks",
|
|
282
330
|
customTitle: "Connectors and workflows",
|
|
283
331
|
customHint: "One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.",
|
|
284
332
|
customInvalid: "Not a valid tool key: {key}",
|