@burdenoff/microfe-stewards 2026.1201.2 → 2026.1201.3
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/dev/liveDeskMocks.d.ts +2 -0
- package/dist/dev/shellGateway.d.ts +9 -0
- package/dist/dev/shellPermissions.d.ts +9 -0
- package/dist/generated/global-types.d.ts +398 -7
- package/dist/generated/wspace-operations.d.ts +183 -0
- package/dist/generated/wspace-operations.js +107 -39
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +1789 -15
- package/dist/generated/wspace-types.js +7 -5
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/stewards/components/ControlBanner.d.ts +7 -0
- package/dist/stewards/components/ControlBanner.js +21 -0
- package/dist/stewards/components/ControlBanner.js.map +1 -0
- package/dist/stewards/components/LiveDeskPanel.d.ts +17 -0
- package/dist/stewards/components/LiveDeskPanel.js +120 -0
- package/dist/stewards/components/LiveDeskPanel.js.map +1 -0
- package/dist/stewards/i18n/en.d.ts +46 -0
- package/dist/stewards/i18n/en.js +46 -0
- package/dist/stewards/i18n/en.js.map +1 -1
- package/dist/stewards/live/DeskCanvas.d.ts +20 -0
- package/dist/stewards/live/DeskCanvas.js +95 -0
- package/dist/stewards/live/DeskCanvas.js.map +1 -0
- package/dist/stewards/live/DeskStreamConnection.d.ts +123 -0
- package/dist/stewards/live/DeskStreamConnection.js +239 -0
- package/dist/stewards/live/DeskStreamConnection.js.map +1 -0
- package/dist/stewards/live/backoff.d.ts +2 -0
- package/dist/stewards/live/backoff.js +8 -0
- package/dist/stewards/live/backoff.js.map +1 -0
- package/dist/stewards/live/browserConnection.d.ts +20 -0
- package/dist/stewards/live/browserConnection.js +40 -0
- package/dist/stewards/live/browserConnection.js.map +1 -0
- package/dist/stewards/live/describeStream.d.ts +15 -0
- package/dist/stewards/live/describeStream.js +78 -0
- package/dist/stewards/live/describeStream.js.map +1 -0
- package/dist/stewards/live/mintPass.d.ts +9 -0
- package/dist/stewards/live/mintPass.js +59 -0
- package/dist/stewards/live/mintPass.js.map +1 -0
- package/dist/stewards/live/protocol.d.ts +81 -0
- package/dist/stewards/live/protocol.js +88 -0
- package/dist/stewards/live/protocol.js.map +1 -0
- package/dist/stewards/live/useDeskStream.d.ts +17 -0
- package/dist/stewards/live/useDeskStream.js +25 -0
- package/dist/stewards/live/useDeskStream.js.map +1 -0
- package/dist/stewards/pages/StewardRunPage.js +26 -20
- package/dist/stewards/pages/StewardRunPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StreamBanner } from '../live/describeStream';
|
|
2
|
+
import { StewardsT } from '../i18n/useStewardsT';
|
|
3
|
+
/** The control banner. Announced politely so a screen reader hears control change hands. */
|
|
4
|
+
export declare function ControlBanner({ banner, t }: {
|
|
5
|
+
banner: StreamBanner;
|
|
6
|
+
t: StewardsT;
|
|
7
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
// src/stewards/components/ControlBanner.tsx
|
|
3
|
+
function n({ banner: n, t: r }) {
|
|
4
|
+
let i = n.tone === "success" ? "bg-(--color-status-success-subtle) text-(color:--color-status-success-text)" : n.tone === "warning" ? "bg-(--color-status-warning-subtle) text-(color:--color-status-warning-text)" : n.tone === "error" ? "bg-(--color-status-error-subtle) text-(color:--color-status-error-text)" : "bg-(--color-status-info-subtle) text-(color:--color-status-info-text)";
|
|
5
|
+
return /* @__PURE__ */ t("div", {
|
|
6
|
+
role: n.tone === "error" ? "alert" : "status",
|
|
7
|
+
"aria-live": n.tone === "error" ? "assertive" : "polite",
|
|
8
|
+
"data-testid": "control-banner",
|
|
9
|
+
className: `rounded-md p-3 text-sm ${i}`,
|
|
10
|
+
children: [/* @__PURE__ */ e("p", {
|
|
11
|
+
className: "font-medium",
|
|
12
|
+
children: r(n.titleKey, n.params)
|
|
13
|
+
}), n.bodyKey && /* @__PURE__ */ e("p", {
|
|
14
|
+
className: "mt-0.5",
|
|
15
|
+
children: r(n.bodyKey)
|
|
16
|
+
})]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export { n as ControlBanner };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=ControlBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlBanner.js","names":["ControlBanner","tone","banner","t"],"sources":["../../../src/stewards/components/ControlBanner.tsx"],"sourcesContent":["import type { StreamBanner } from '../live/describeStream';\nimport type { StewardsT } from '../i18n/useStewardsT';\n\n/** The control banner. Announced politely so a screen reader hears control change hands. */\nexport function ControlBanner({ banner, t }: { banner: StreamBanner; t: StewardsT }) {\n const tone =\n banner.tone === 'success'\n ? 'bg-(--color-status-success-subtle) text-(color:--color-status-success-text)'\n : banner.tone === 'warning'\n ? 'bg-(--color-status-warning-subtle) text-(color:--color-status-warning-text)'\n : banner.tone === 'error'\n ? 'bg-(--color-status-error-subtle) text-(color:--color-status-error-text)'\n : 'bg-(--color-status-info-subtle) text-(color:--color-status-info-text)';\n return (\n <div\n role={banner.tone === 'error' ? 'alert' : 'status'}\n aria-live={banner.tone === 'error' ? 'assertive' : 'polite'}\n data-testid=\"control-banner\"\n className={`rounded-md p-3 text-sm ${tone}`}\n >\n <p className=\"font-medium\">{t(banner.titleKey, banner.params)}</p>\n {banner.bodyKey && <p className=\"mt-0.5\">{t(banner.bodyKey)}</p>}\n </div>\n );\n}\n"],"mappings":";;AAIA,SAAgBA,EAAc,EAAE,WAAQ,QAA6C;CACnF,IAAMC,IACJC,EAAO,SAAS,YACZ,gFACAA,EAAO,SAAS,YACd,gFACAA,EAAO,SAAS,UACd,4EACA;CACV,OACE,kBAAC,OAAD;EACE,MAAMA,EAAO,SAAS,UAAU,UAAU;EAC1C,aAAWA,EAAO,SAAS,UAAU,cAAc;EACnD,eAAY;EACZ,WAAW,0BAA0BD;EAJvC,UAAA,CAME,kBAAC,KAAD;GAAG,WAAU;GAAe,UAAAE,EAAED,EAAO,UAAUA,EAAO,MAAM;EAAK,CAAA,GAChEA,EAAO,WAAW,kBAAC,KAAD;GAAG,WAAU;GAAU,UAAAC,EAAED,EAAO,OAAO;EAAK,CAAA,CAC5D;;AAET"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BotmanorStewardRunStatus } from '../../generated/wspace-types';
|
|
2
|
+
interface LiveDeskPanelProps {
|
|
3
|
+
runId: string;
|
|
4
|
+
status: BotmanorStewardRunStatus;
|
|
5
|
+
/** `botmanor-steward:execute`: needed to take over and hand back. Watching needs only read. */
|
|
6
|
+
canExecute: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Live view of a run's desk with Take over and Hand back (BOFF-16552).
|
|
10
|
+
*
|
|
11
|
+
* Watching is opt-in: nothing connects until the person asks, except when they already hold the
|
|
12
|
+
* run (a page reload mid-takeover), where the stream is the point of being here. Taking over
|
|
13
|
+
* pauses the Steward and reconnects in control mode; handing back closes the stream and queues
|
|
14
|
+
* the run to continue from its checkpoint.
|
|
15
|
+
*/
|
|
16
|
+
export declare function LiveDeskPanel({ runId, status, canExecute }: LiveDeskPanelProps): import('react').JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useGetBotmanorStewardRunTakeoverQuery as e, useHandBackBotmanorStewardRunMutation as t, useTakeOverBotmanorStewardRunMutation as n } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { BotmanorStewardRunStatus as r } from "../../generated/wspace-types.js";
|
|
3
|
+
import { useStewardsT as i } from "../i18n/useStewardsT.js";
|
|
4
|
+
import { DeskCanvas as a } from "../live/DeskCanvas.js";
|
|
5
|
+
import { describeStream as o } from "../live/describeStream.js";
|
|
6
|
+
import { useDeskStream as s } from "../live/useDeskStream.js";
|
|
7
|
+
import { ControlBanner as c } from "./ControlBanner.js";
|
|
8
|
+
import { Alert as l, Button as u, Card as d } from "./ui.js";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { useCallback as m, useEffect as h, useState as g } from "react";
|
|
11
|
+
import { useAuthTokenOrNull as _ } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
|
+
// src/stewards/components/LiveDeskPanel.tsx
|
|
13
|
+
var v = 5e3, y = /* @__PURE__ */ new Set([
|
|
14
|
+
r.Queued,
|
|
15
|
+
r.Running,
|
|
16
|
+
r.WaitingApproval
|
|
17
|
+
]);
|
|
18
|
+
function b({ runId: a, status: b, canExecute: S }) {
|
|
19
|
+
let C = i(), w = _()?.userId ?? null, T = s(a), { start: E, stop: D, state: O } = T, k = e({
|
|
20
|
+
variables: { id: a },
|
|
21
|
+
fetchPolicy: "cache-and-network",
|
|
22
|
+
pollInterval: v
|
|
23
|
+
}).data?.getBotmanorStewardRun?.takenOverBy ?? null, [A, j] = n(), [M, N] = t(), P = b === r.WaitingTakeover && k !== null && k === w, F = P ? "control" : "view", [I, L] = g(!1), [R, z] = g(!1), B = I || P;
|
|
24
|
+
h(() => {
|
|
25
|
+
B ? E(F) : D();
|
|
26
|
+
}, [
|
|
27
|
+
B,
|
|
28
|
+
F,
|
|
29
|
+
E,
|
|
30
|
+
D
|
|
31
|
+
]);
|
|
32
|
+
let V = m(() => {
|
|
33
|
+
z(!1), A({ variables: { id: a } }).then(() => L(!0)).catch(() => void 0);
|
|
34
|
+
}, [a, A]), H = m(() => {
|
|
35
|
+
M({ variables: { id: a } }).then(() => {
|
|
36
|
+
L(!1), z(!0);
|
|
37
|
+
}).catch(() => void 0);
|
|
38
|
+
}, [a, M]), U = o(O, P), W = O.phase === "live", G = O.phase === "ended" || O.phase === "failed", K = S && !P && y.has(b), q = j.error ?? N.error;
|
|
39
|
+
return /* @__PURE__ */ f(d, {
|
|
40
|
+
title: C("stewards.desk.title"),
|
|
41
|
+
hint: C("stewards.desk.hint"),
|
|
42
|
+
children: /* @__PURE__ */ p("div", {
|
|
43
|
+
className: "flex flex-col gap-3",
|
|
44
|
+
children: [
|
|
45
|
+
!B && !R && /* @__PURE__ */ f("p", {
|
|
46
|
+
className: "text-sm text-(color:--color-text-secondary)",
|
|
47
|
+
children: C("stewards.desk.intro")
|
|
48
|
+
}),
|
|
49
|
+
R && !B && /* @__PURE__ */ f(l, {
|
|
50
|
+
tone: "success",
|
|
51
|
+
children: C("stewards.desk.handedBack")
|
|
52
|
+
}),
|
|
53
|
+
U && /* @__PURE__ */ f(c, {
|
|
54
|
+
banner: U,
|
|
55
|
+
t: C
|
|
56
|
+
}),
|
|
57
|
+
B && O.phase !== "idle" && !G && /* @__PURE__ */ f(x, {
|
|
58
|
+
stream: T,
|
|
59
|
+
state: O,
|
|
60
|
+
interactive: W && O.mode === "control"
|
|
61
|
+
}),
|
|
62
|
+
q && /* @__PURE__ */ p(l, { children: [
|
|
63
|
+
C("stewards.desk.actionError"),
|
|
64
|
+
" ",
|
|
65
|
+
q.message
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ p("div", {
|
|
68
|
+
className: "flex flex-wrap gap-2",
|
|
69
|
+
children: [
|
|
70
|
+
!B && /* @__PURE__ */ f(u, {
|
|
71
|
+
variant: "primary",
|
|
72
|
+
onClick: () => L(!0),
|
|
73
|
+
children: C("stewards.desk.watch")
|
|
74
|
+
}),
|
|
75
|
+
B && !P && !G && /* @__PURE__ */ f(u, {
|
|
76
|
+
onClick: () => L(!1),
|
|
77
|
+
children: C("stewards.desk.stopWatching")
|
|
78
|
+
}),
|
|
79
|
+
B && G && /* @__PURE__ */ f(u, {
|
|
80
|
+
variant: "primary",
|
|
81
|
+
onClick: () => E(F),
|
|
82
|
+
children: O.reason === "idle" || O.reason === "leaseEnded" ? C("stewards.desk.watchAgain") : C("stewards.desk.reconnect")
|
|
83
|
+
}),
|
|
84
|
+
K && /* @__PURE__ */ f(u, {
|
|
85
|
+
disabled: j.loading,
|
|
86
|
+
onClick: V,
|
|
87
|
+
children: j.loading ? C("stewards.desk.takingOver") : C("stewards.desk.takeOver")
|
|
88
|
+
}),
|
|
89
|
+
S && P && /* @__PURE__ */ f(u, {
|
|
90
|
+
variant: "primary",
|
|
91
|
+
disabled: N.loading,
|
|
92
|
+
onClick: H,
|
|
93
|
+
children: N.loading ? C("stewards.desk.handingBack") : C("stewards.desk.handBack")
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function x({ stream: e, state: t, interactive: n }) {
|
|
102
|
+
let r = i();
|
|
103
|
+
return /* @__PURE__ */ p("div", {
|
|
104
|
+
className: "flex flex-col gap-1",
|
|
105
|
+
children: [/* @__PURE__ */ f(a, {
|
|
106
|
+
registerSink: e.setFrameSink,
|
|
107
|
+
interactive: n,
|
|
108
|
+
send: e.send,
|
|
109
|
+
label: t.mode === "control" ? r("stewards.desk.canvasLabelControl") : r("stewards.desk.canvasLabelView"),
|
|
110
|
+
hint: r("stewards.desk.controlHint")
|
|
111
|
+
}), t.phase === "live" && !t.hasFrame && /* @__PURE__ */ f("p", {
|
|
112
|
+
className: "text-xs text-(color:--color-text-secondary)",
|
|
113
|
+
role: "status",
|
|
114
|
+
children: r("stewards.desk.waitingFrame")
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
export { b as LiveDeskPanel };
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=LiveDeskPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveDeskPanel.js","names":["TAKEOVER_POLL_MS","TAKEOVER_FROM","BotmanorStewardRunStatus","LiveDeskPanel","t","useStewardsT","userId","useAuthTokenOrNull","stream","useDeskStream","runId","takenOverBy","useGetBotmanorStewardRunTakeoverQuery","takeOver","takeOverState","useTakeOverBotmanorStewardRunMutation","handBack","handBackState","useHandBackBotmanorStewardRunMutation","iAmInControl","status","desiredMode","watching","setWatching","useState","handedBack","setHandedBack","active","start","stop","doTakeOver","useCallback","doHandBack","banner","describeStream","state","live","stopped","canTakeOver","canExecute","actionError","Card","Alert","ControlBanner","DeskScreen","Button","DeskCanvas"],"sources":["../../../src/stewards/components/LiveDeskPanel.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { useAuthTokenOrNull } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n useGetBotmanorStewardRunTakeoverQuery,\n useHandBackBotmanorStewardRunMutation,\n useTakeOverBotmanorStewardRunMutation,\n} from '../../generated/wspace-operations';\nimport { BotmanorStewardRunStatus } from '../../generated/wspace-types';\nimport { useStewardsT } from '../i18n/useStewardsT';\nimport { DeskCanvas } from '../live/DeskCanvas';\nimport { describeStream } from '../live/describeStream';\nimport type { StreamState } from '../live/DeskStreamConnection';\nimport { useDeskStream } from '../live/useDeskStream';\nimport { ControlBanner } from './ControlBanner';\nimport { Alert, Button, Card } from './ui';\n\n/** How often to look for a takeover made by someone else while the panel is open. */\nconst TAKEOVER_POLL_MS = 5000;\n\nconst TAKEOVER_FROM: ReadonlySet<BotmanorStewardRunStatus> = new Set([\n BotmanorStewardRunStatus.Queued,\n BotmanorStewardRunStatus.Running,\n BotmanorStewardRunStatus.WaitingApproval,\n]);\n\ninterface LiveDeskPanelProps {\n runId: string;\n status: BotmanorStewardRunStatus;\n /** `botmanor-steward:execute`: needed to take over and hand back. Watching needs only read. */\n canExecute: boolean;\n}\n\n/**\n * Live view of a run's desk with Take over and Hand back (BOFF-16552).\n *\n * Watching is opt-in: nothing connects until the person asks, except when they already hold the\n * run (a page reload mid-takeover), where the stream is the point of being here. Taking over\n * pauses the Steward and reconnects in control mode; handing back closes the stream and queues\n * the run to continue from its checkpoint.\n */\nexport function LiveDeskPanel({ runId, status, canExecute }: LiveDeskPanelProps) {\n const t = useStewardsT();\n const userId = useAuthTokenOrNull()?.userId ?? null;\n const stream = useDeskStream(runId);\n const { start, stop, state } = stream;\n\n const takeoverQuery = useGetBotmanorStewardRunTakeoverQuery({\n variables: { id: runId },\n fetchPolicy: 'cache-and-network',\n pollInterval: TAKEOVER_POLL_MS,\n });\n const takenOverBy = takeoverQuery.data?.getBotmanorStewardRun?.takenOverBy ?? null;\n const [takeOver, takeOverState] = useTakeOverBotmanorStewardRunMutation();\n const [handBack, handBackState] = useHandBackBotmanorStewardRunMutation();\n\n const waiting = status === BotmanorStewardRunStatus.WaitingTakeover;\n // The server names who holds the run. Compare it with the signed-in person.\n const iAmInControl = waiting && takenOverBy !== null && takenOverBy === userId;\n const desiredMode = iAmInControl ? 'control' : 'view';\n\n const [watching, setWatching] = useState(false);\n const [handedBack, setHandedBack] = useState(false);\n const active = watching || iAmInControl;\n\n // Connect when wanted, and reconnect in the right mode when control changes hands.\n useEffect(() => {\n if (active) start(desiredMode);\n else stop();\n }, [active, desiredMode, start, stop]);\n\n const doTakeOver = useCallback(() => {\n setHandedBack(false);\n void takeOver({ variables: { id: runId } })\n .then(() => setWatching(true))\n .catch(() => undefined);\n }, [runId, takeOver]);\n\n const doHandBack = useCallback(() => {\n void handBack({ variables: { id: runId } })\n .then(() => {\n setWatching(false);\n setHandedBack(true);\n })\n .catch(() => undefined);\n }, [runId, handBack]);\n\n const banner = describeStream(state, iAmInControl);\n const live = state.phase === 'live';\n const stopped = state.phase === 'ended' || state.phase === 'failed';\n const canTakeOver = canExecute && !iAmInControl && TAKEOVER_FROM.has(status);\n const actionError = takeOverState.error ?? handBackState.error;\n\n return (\n <Card title={t('stewards.desk.title')} hint={t('stewards.desk.hint')}>\n <div className=\"flex flex-col gap-3\">\n {!active && !handedBack && (\n <p className=\"text-sm text-(color:--color-text-secondary)\">{t('stewards.desk.intro')}</p>\n )}\n {handedBack && !active && <Alert tone=\"success\">{t('stewards.desk.handedBack')}</Alert>}\n {banner && <ControlBanner banner={banner} t={t} />}\n {active && state.phase !== 'idle' && !stopped && (\n <DeskScreen\n stream={stream}\n state={state}\n interactive={live && state.mode === 'control'}\n />\n )}\n {actionError && (\n <Alert>\n {t('stewards.desk.actionError')} {actionError.message}\n </Alert>\n )}\n <div className=\"flex flex-wrap gap-2\">\n {!active && (\n <Button variant=\"primary\" onClick={() => setWatching(true)}>\n {t('stewards.desk.watch')}\n </Button>\n )}\n {active && !iAmInControl && !stopped && (\n <Button onClick={() => setWatching(false)}>{t('stewards.desk.stopWatching')}</Button>\n )}\n {active && stopped && (\n <Button variant=\"primary\" onClick={() => start(desiredMode)}>\n {state.reason === 'idle' || state.reason === 'leaseEnded'\n ? t('stewards.desk.watchAgain')\n : t('stewards.desk.reconnect')}\n </Button>\n )}\n {canTakeOver && (\n <Button disabled={takeOverState.loading} onClick={doTakeOver}>\n {takeOverState.loading ? t('stewards.desk.takingOver') : t('stewards.desk.takeOver')}\n </Button>\n )}\n {canExecute && iAmInControl && (\n <Button variant=\"primary\" disabled={handBackState.loading} onClick={doHandBack}>\n {handBackState.loading ? t('stewards.desk.handingBack') : t('stewards.desk.handBack')}\n </Button>\n )}\n </div>\n </div>\n </Card>\n );\n}\n\nfunction DeskScreen({\n stream,\n state,\n interactive,\n}: {\n stream: ReturnType<typeof useDeskStream>;\n state: StreamState;\n interactive: boolean;\n}) {\n const t = useStewardsT();\n return (\n <div className=\"flex flex-col gap-1\">\n <DeskCanvas\n registerSink={stream.setFrameSink}\n interactive={interactive}\n send={stream.send}\n label={\n state.mode === 'control'\n ? t('stewards.desk.canvasLabelControl')\n : t('stewards.desk.canvasLabelView')\n }\n hint={t('stewards.desk.controlHint')}\n />\n {state.phase === 'live' && !state.hasFrame && (\n <p className=\"text-xs text-(color:--color-text-secondary)\" role=\"status\">\n {t('stewards.desk.waitingFrame')}\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAMA,IAAmB,KAEnBC,oBAAuD,IAAI,IAAI;CACnEC,EAAyB;CACzBA,EAAyB;CACzBA,EAAyB;AAC3B,CAAC;AAiBD,SAAgBC,EAAc,EAAE,UAAO,WAAQ,iBAAkC;CAC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AC0B,GAAD;OAAQ,SAAQ;OAAU,UAAU5B,EAAc;OAAS,SAASe;OACjE,UAAAf,EAAc,UAAUb,EAAE,2BAA2B,IAAIA,EAAE,wBAAwB;MAC9E,CAAA;KAEP;;GACF;;CACD,CAAA;AAEV;AAEA,SAASwC,EAAW,EAClB,WACA,UACA,kBAKC;CACD,IAAMxC,IAAIC,EAAa;CACvB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACyC,GAAD;GACE,cAActC,EAAO;GACR;GACb,MAAMA,EAAO;GACb,OACE2B,EAAM,SAAS,YACX/B,EAAE,kCAAkC,IACpCA,EAAE,+BAA+B;GAEvC,MAAMA,EAAE,2BAA2B;EACpC,CAAA,GACA+B,EAAM,UAAU,UAAU,CAACA,EAAM,YAChC,kBAAC,KAAD;GAAG,WAAU;GAA8C,MAAK;GAC7D,UAAA/B,EAAE,4BAA4B;EAC9B,CAAA,CAEF;;AAET"}
|
|
@@ -344,6 +344,52 @@ export declare const enTranslations: {
|
|
|
344
344
|
readonly loadError: "Could not load the daybook.";
|
|
345
345
|
readonly running: "running";
|
|
346
346
|
};
|
|
347
|
+
readonly desk: {
|
|
348
|
+
readonly title: "Live desk";
|
|
349
|
+
readonly hint: "What the Steward sees and does on its desk";
|
|
350
|
+
readonly intro: "Watch the Steward work on its desk. You can take over for a sign-in, a CAPTCHA or a one-time code.";
|
|
351
|
+
readonly watch: "Watch live";
|
|
352
|
+
readonly stopWatching: "Stop watching";
|
|
353
|
+
readonly takeOver: "Take over";
|
|
354
|
+
readonly takingOver: "Taking over…";
|
|
355
|
+
readonly handBack: "Hand back";
|
|
356
|
+
readonly handingBack: "Handing back…";
|
|
357
|
+
readonly watchAgain: "Watch again";
|
|
358
|
+
readonly reconnect: "Reconnect";
|
|
359
|
+
readonly canvasLabelView: "Live view of the Steward desk. View only.";
|
|
360
|
+
readonly canvasLabelControl: "Live view of the Steward desk. You are in control; keyboard and pointer go to the desk.";
|
|
361
|
+
readonly controlHint: "Keyboard and pointer go to the desk while it has focus. Press Tab to leave it.";
|
|
362
|
+
readonly waitingFrame: "Waiting for the desk to send its first image…";
|
|
363
|
+
readonly bannerSteward: "Steward in control";
|
|
364
|
+
readonly bannerStewardBody: "You are watching. The Steward is working on the desk.";
|
|
365
|
+
readonly bannerYou: "You are in control";
|
|
366
|
+
readonly bannerYouBody: "The Steward is paused. What you type goes to the desk and is never recorded. Hand back when you are done.";
|
|
367
|
+
readonly bannerOther: "Another person is in control";
|
|
368
|
+
readonly bannerOtherBody: "The Steward is paused while they work on the desk.";
|
|
369
|
+
readonly bannerConnecting: "Connecting to the desk…";
|
|
370
|
+
readonly bannerReconnecting: "Connection lost. Reconnecting (attempt {attempt})…";
|
|
371
|
+
readonly endedLease: "The desk session ended";
|
|
372
|
+
readonly endedLeaseBody: "Nobody holds the desk any more, so the stream was closed.";
|
|
373
|
+
readonly endedLeaseControlBody: "Your control of the desk ended. Hand back to let the Steward continue, or take over again.";
|
|
374
|
+
readonly endedIdle: "Stream closed after a period of inactivity";
|
|
375
|
+
readonly endedIdleBody: "Nothing was sent for a while, so the stream was closed to protect the desk.";
|
|
376
|
+
readonly failedForbidden: "You cannot view this desk";
|
|
377
|
+
readonly failedForbiddenBody: "Only the Steward's owner and its approvers can watch or take over its desk.";
|
|
378
|
+
readonly failedNotFound: "The desk is not available";
|
|
379
|
+
readonly failedNotFoundBody: "The desk or its session was not found. The run may not have started on a desk yet.";
|
|
380
|
+
readonly failedSignIn: "Please sign in again";
|
|
381
|
+
readonly failedSignInBody: "Your session could not be confirmed for the live view. Sign in again, then reconnect.";
|
|
382
|
+
readonly failedBadRequest: "The live view could not start";
|
|
383
|
+
readonly failedBadRequestBody: "The desk stream sent something unexpected. Try again in a moment.";
|
|
384
|
+
readonly failedTooMany: "Too many open desk streams";
|
|
385
|
+
readonly failedTooManyBody: "Close another live view, then reconnect.";
|
|
386
|
+
readonly failedUnavailable: "The desk stream is unavailable";
|
|
387
|
+
readonly failedUnavailableBody: "The connection kept dropping or the desk is not streaming. Try again in a moment.";
|
|
388
|
+
readonly failedMint: "The live view could not be opened";
|
|
389
|
+
readonly failedMintBody: "The request for a live view was refused. The run may not be on a desk right now.";
|
|
390
|
+
readonly handedBack: "You handed control back. The Steward will continue from its last checkpoint.";
|
|
391
|
+
readonly actionError: "The action did not go through.";
|
|
392
|
+
};
|
|
347
393
|
readonly run: {
|
|
348
394
|
readonly title: "Run";
|
|
349
395
|
readonly steward: "Steward";
|
package/dist/stewards/i18n/en.js
CHANGED
|
@@ -336,6 +336,52 @@ var e = { stewards: {
|
|
|
336
336
|
loadError: "Could not load the daybook.",
|
|
337
337
|
running: "running"
|
|
338
338
|
},
|
|
339
|
+
desk: {
|
|
340
|
+
title: "Live desk",
|
|
341
|
+
hint: "What the Steward sees and does on its desk",
|
|
342
|
+
intro: "Watch the Steward work on its desk. You can take over for a sign-in, a CAPTCHA or a one-time code.",
|
|
343
|
+
watch: "Watch live",
|
|
344
|
+
stopWatching: "Stop watching",
|
|
345
|
+
takeOver: "Take over",
|
|
346
|
+
takingOver: "Taking over…",
|
|
347
|
+
handBack: "Hand back",
|
|
348
|
+
handingBack: "Handing back…",
|
|
349
|
+
watchAgain: "Watch again",
|
|
350
|
+
reconnect: "Reconnect",
|
|
351
|
+
canvasLabelView: "Live view of the Steward desk. View only.",
|
|
352
|
+
canvasLabelControl: "Live view of the Steward desk. You are in control; keyboard and pointer go to the desk.",
|
|
353
|
+
controlHint: "Keyboard and pointer go to the desk while it has focus. Press Tab to leave it.",
|
|
354
|
+
waitingFrame: "Waiting for the desk to send its first image…",
|
|
355
|
+
bannerSteward: "Steward in control",
|
|
356
|
+
bannerStewardBody: "You are watching. The Steward is working on the desk.",
|
|
357
|
+
bannerYou: "You are in control",
|
|
358
|
+
bannerYouBody: "The Steward is paused. What you type goes to the desk and is never recorded. Hand back when you are done.",
|
|
359
|
+
bannerOther: "Another person is in control",
|
|
360
|
+
bannerOtherBody: "The Steward is paused while they work on the desk.",
|
|
361
|
+
bannerConnecting: "Connecting to the desk…",
|
|
362
|
+
bannerReconnecting: "Connection lost. Reconnecting (attempt {attempt})…",
|
|
363
|
+
endedLease: "The desk session ended",
|
|
364
|
+
endedLeaseBody: "Nobody holds the desk any more, so the stream was closed.",
|
|
365
|
+
endedLeaseControlBody: "Your control of the desk ended. Hand back to let the Steward continue, or take over again.",
|
|
366
|
+
endedIdle: "Stream closed after a period of inactivity",
|
|
367
|
+
endedIdleBody: "Nothing was sent for a while, so the stream was closed to protect the desk.",
|
|
368
|
+
failedForbidden: "You cannot view this desk",
|
|
369
|
+
failedForbiddenBody: "Only the Steward's owner and its approvers can watch or take over its desk.",
|
|
370
|
+
failedNotFound: "The desk is not available",
|
|
371
|
+
failedNotFoundBody: "The desk or its session was not found. The run may not have started on a desk yet.",
|
|
372
|
+
failedSignIn: "Please sign in again",
|
|
373
|
+
failedSignInBody: "Your session could not be confirmed for the live view. Sign in again, then reconnect.",
|
|
374
|
+
failedBadRequest: "The live view could not start",
|
|
375
|
+
failedBadRequestBody: "The desk stream sent something unexpected. Try again in a moment.",
|
|
376
|
+
failedTooMany: "Too many open desk streams",
|
|
377
|
+
failedTooManyBody: "Close another live view, then reconnect.",
|
|
378
|
+
failedUnavailable: "The desk stream is unavailable",
|
|
379
|
+
failedUnavailableBody: "The connection kept dropping or the desk is not streaming. Try again in a moment.",
|
|
380
|
+
failedMint: "The live view could not be opened",
|
|
381
|
+
failedMintBody: "The request for a live view was refused. The run may not be on a desk right now.",
|
|
382
|
+
handedBack: "You handed control back. The Steward will continue from its last checkpoint.",
|
|
383
|
+
actionError: "The action did not go through."
|
|
384
|
+
},
|
|
339
385
|
run: {
|
|
340
386
|
title: "Run",
|
|
341
387
|
steward: "Steward",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","names":["enTranslations"],"sources":["../../../src/stewards/i18n/en.ts"],"sourcesContent":["/**\n * English strings for microfe-stewards. Keys are dot-notation; the host's\n * I18nProvider resolves them against the translations it loads, and `useStewardsT`\n * falls back to this object when the host has no entry (or no provider).\n * Register it with the shell's `fallbackTranslations`.\n */\nexport const enTranslations = {\n stewards: {\n nav: { label: 'Stewards' },\n common: {\n back: 'Back',\n cancel: 'Cancel',\n loading: 'Loading…',\n retry: 'Try again',\n none: 'None',\n noCap: 'No cap',\n never: 'Never',\n credits: 'credits',\n unknown: 'Unknown',\n forbiddenTitle: 'You do not have access',\n forbiddenBody: 'Your role does not allow you to view Stewards in this workspace.',\n disabledTitle: 'Stewards are not enabled',\n disabledBody: 'Stewards are not turned on for this workspace yet.',\n errorTitle: 'Something went wrong',\n notFoundTitle: 'Not found',\n notFoundBody: 'This steward or run does not exist, or you cannot see it.',\n },\n enums: {\n status: { DRAFT: 'Draft', ACTIVE: 'Active', PAUSED: 'Paused', ARCHIVED: 'Archived' },\n autonomy: { OBSERVE: 'Observe', ASK: 'Ask', GUIDED: 'Guided', TRUSTED: 'Trusted' },\n autonomyHelp: {\n OBSERVE:\n 'Read only, by construction. Can look, summarise and report; no outward actions exist.',\n ASK: 'Every outward action asks a person first.',\n GUIDED:\n 'A reviewer model decides each outward action against the charter; when unsure it asks you.',\n TRUSTED:\n 'Your standing rules apply first, then the reviewer model. Still bounded by budgets.',\n },\n desk: {\n NONE: 'No desk',\n BROWSER: 'Browser only',\n CLOUD: 'Cloud desk',\n OWN_MACHINE: 'Own machine',\n },\n deskHelp: {\n NONE: 'Works through connectors and tools only.',\n BROWSER: 'A managed browser. The agent needs the Web browsing capability.',\n CLOUD: 'A cloud desktop. The agent needs the Computer use capability.',\n OWN_MACHINE: 'A machine you connect. The agent needs the Computer use capability.',\n },\n egress: {\n PUBLIC: 'Any public site',\n ALLOW_LIST: 'Only the sites I list',\n BLOCKED: 'No web access',\n },\n runStatus: {\n PROPOSED: 'Proposed',\n QUEUED: 'Queued',\n RUNNING: 'Running',\n WAITING_APPROVAL: 'Waiting for approval',\n WAITING_TAKEOVER: 'Waiting for a person',\n PAUSED_BUDGET: 'Paused — budget',\n COMPLETED: 'Completed',\n FAILED: 'Failed',\n CANCELLED: 'Cancelled',\n STOPPED: 'Stopped',\n },\n trigger: {\n OWNER_CHAT: 'Owner chat',\n SCHEDULE: 'Schedule',\n WEBHOOK: 'Webhook',\n APP_EVENT: 'App event',\n PLATFORM_EVENT: 'Platform event',\n CHANNEL_MESSAGE: 'Channel message',\n WATCH: 'Watch',\n PROACTIVE: 'Proactive',\n API: 'API',\n WORKFLOW: 'Workflow',\n A2A: 'Agent to agent',\n },\n trust: {\n OWNER: 'Owner',\n MEMBER: 'Member',\n SYSTEM: 'System',\n EXTERNAL: 'External content',\n UNTRUSTED: 'Untrusted content',\n },\n stepKind: {\n MODEL_CALL: 'Model call',\n TOOL_CALL: 'Connector tool',\n DESK_ACTION: 'Desk action',\n APPROVAL_WAIT: 'Approval wait',\n TAKEOVER: 'Takeover',\n SUB_RUN: 'Sub-run',\n MEMORY_WRITE: 'Memory write',\n NOTE: 'Note',\n },\n verdict: {\n ALLOWED: 'Allowed',\n ASKED: 'Asked',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n BLOCKED_DRY_RUN: 'Dry run',\n FAILED: 'Failed',\n SKIPPED: 'Skipped',\n },\n approvalStatus: {\n PENDING: 'Pending',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n EXPIRED: 'Expired',\n CANCELLED: 'Cancelled',\n },\n scope: {\n ONCE: 'Once',\n RUN: 'This run',\n DUTY: 'This duty',\n TIME_LIMITED: 'Time-limited',\n STANDING: 'Standing',\n },\n },\n tools: {\n 'desk:screenshot': 'Screenshot',\n 'desk:snapshot': 'Read the screen structure',\n 'desk:click': 'Click',\n 'desk:type': 'Type',\n 'desk:key': 'Press keys',\n 'desk:scroll': 'Scroll',\n 'desk:navigate': 'Open a URL',\n 'desk:focus_window': 'Switch window',\n 'desk:secret_fill': 'Fill a stored secret',\n 'desk:shell': 'Run shell commands',\n 'desk:read_file': 'Read files',\n 'desk:write_file': 'Write files',\n 'platform:current_time': 'Check the time',\n 'platform:notify_owner': 'Notify the owner',\n },\n budget: {\n credits: 'AI credits',\n deskMinutes: 'Desk minutes',\n steps: 'Steps',\n wallSeconds: 'Wall-clock seconds',\n connectorSpendMinor: 'Connector spend (minor units)',\n perRun: 'Per run',\n perDay: 'Per day',\n total: 'Total',\n limit: 'Limit',\n invalid: 'Enter a number of 0 or more for {name} (whole numbers, except credits).',\n hint: 'Run stops when any limit is hit. Leave a box empty for no cap at that level.',\n },\n fixed: {\n title: 'Always asks a person — can’t be loosened',\n badge: 'Fixed',\n password: 'Password and security-setting changes',\n payment: 'Entering payment details',\n otp: 'Reading one-time codes',\n external: 'Messages to people outside the workspace',\n },\n list: {\n title: 'Stewards',\n subtitle:\n 'Agents with a charter, duties and a desk — they work on a schedule or on events, inside the limits you set.',\n newSteward: 'New steward',\n statusFilter: 'Status',\n allStatuses: 'All',\n tableLabel: 'Stewards',\n colSteward: 'Steward',\n colStatus: 'Status',\n colAutonomy: 'Autonomy',\n colDesk: 'Desk',\n colLastRun: 'Last run',\n colToday: 'Today · spend / daily cap',\n colWaiting: 'Waiting',\n neverRun: 'Never run',\n tileActive: 'Active stewards',\n tileWaiting: 'Waiting for approval',\n tileWaitingHint: 'Approval requests across stewards',\n tileSpend: 'Credits used today',\n empty: 'No stewards yet.',\n emptyFiltered: 'No stewards match this status.',\n emptyHint: 'Make one of your agents a steward to give it a charter and a desk.',\n loadError: 'Could not load stewards.',\n },\n wizard: {\n title: 'New steward',\n stepOf: 'Step {step} of {total}',\n steps: { agent: 'Agent', charter: 'Charter', desk: 'Desk', review: 'Review' },\n next: 'Continue',\n create: 'Create steward',\n creating: 'Creating…',\n agentTitle: 'Base agent',\n agentHelp: 'A steward is an existing agent plus a charter, duties and a desk.',\n pickExisting: 'Use an existing agent',\n createNew: 'Create a new agent',\n noAgents: 'No active agents available. Create one here.',\n agentSearch: 'Search agents',\n agentName: 'Agent name',\n agentPrompt: 'What is this agent for?',\n agentPromptHelp: 'Becomes the agent’s system prompt. You can refine it later.',\n capabilities: 'Capabilities',\n capabilityHelp: 'Capabilities decide which desks the agent can use.',\n capWeb: 'Web browsing',\n capComputer: 'Computer use',\n charterTitle: 'Charter',\n charterHelp:\n 'Plain-language rules, one per line. The reviewer model checks them on every outward action.',\n charterLabel: 'Charter rules',\n charterPlaceholder:\n 'Only summarise ledgers from the Finance folder; never edit source sheets.\\nSend the weekly summary only to finance@example.com.',\n charterRequired: 'Write at least one rule.',\n autonomyTitle: 'Autonomy level',\n autonomyHint: 'Can be lowered at any time; raising it is logged.',\n autonomyLockedByAdmin: 'A workspace admin limits stewards to {level}.',\n toolsTitle: 'Allowed tools & connectors',\n toolsCount: '{count} selected',\n deskTitle: 'Desk',\n deskHelp: 'Where the steward may work on a screen.',\n deskNeeds:\n 'This agent does not have the {capability} capability, so this desk may be refused.',\n egressTitle: 'Web access from the desk',\n allowedHosts: 'Allowed sites',\n allowedHostsHelp: 'One per line: example.com, or *.example.com for its subdomains.',\n reviewTitle: 'Review',\n reviewBody: 'The steward starts as a draft. Activate it from its page when you are ready.',\n reviewAgent: 'Agent',\n reviewAutonomy: 'Autonomy',\n reviewDesk: 'Desk',\n reviewTools: 'Tools',\n reviewBudget: 'Daily AI credits',\n createError: 'Could not create the steward.',\n newAgentError: 'Could not create the agent.',\n },\n detail: {\n owner: 'Base agent',\n tabs: { overview: 'Overview', charter: 'Charter', daybook: 'Daybook' },\n version: 'Charter v{version}, edited {when}',\n pause: 'Pause steward',\n resume: 'Resume',\n activate: 'Activate',\n archive: 'Archive',\n runNow: 'Run now',\n running: 'Starting…',\n runTitle: 'Run now',\n runPrompt: 'What should the steward do?',\n runPromptPlaceholder: 'Check the shared inbox and summarise what needs me today.',\n runDry: 'Dry run — record what it would do, without doing it',\n runStart: 'Start run',\n runError: 'Could not start the run.',\n statusError: 'Could not change the status.',\n overviewToday: 'Today',\n overviewRecent: 'Recent runs',\n noRuns: 'No runs yet.',\n openApprovals: 'Open approvals ({count})',\n archived: 'This steward is archived and cannot be changed.',\n colRun: 'Run',\n colStarted: 'Started',\n colTrigger: 'Trigger',\n },\n charter: {\n rulesTitle: 'Rules',\n rulesHint: 'Plain language — checked by the reviewer model on every outward action',\n rulesLabel: 'Charter rules',\n autonomyTitle: 'Autonomy & budgets',\n usage: 'Today',\n toolsTitle: 'Allowed tools',\n toolsHint: 'An empty list means the steward has no tools.',\n groupLook: 'Look at the screen',\n groupAct: 'Act on the screen',\n groupFiles: 'Files and shell',\n groupPlatform: 'BotManor tools',\n customTitle: 'Connectors and workflows',\n customHint:\n 'One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.',\n customInvalid: 'Not a valid tool key: {key}',\n connectionsLabel: 'Allowed connection ids',\n connectionsHint: 'One id per line.',\n dryRun: 'Dry-run mode',\n dryRunHelp: 'Plan and record actions without executing outward ones.',\n deskTitle: 'Desk web access',\n timezone: 'Time zone',\n timezoneHelp: 'Daily budgets and the daybook count days in this time zone.',\n rulesSection: 'Standing approval rules',\n rulesSectionHint: 'Apply at the Trusted level. Revoke one and the steward asks again.',\n rulesEmpty:\n 'No standing rules. Approving a request with a duty, time-limited or standing scope creates one.',\n colTool: 'Tool',\n colDestination: 'Destination',\n colPurpose: 'Purpose',\n colLimit: 'Limit',\n colExpires: 'Expires',\n revoke: 'Revoke',\n save: 'Save charter',\n saving: 'Saving…',\n saved: 'Charter saved as version {version}.',\n saveError: 'Could not save the charter.',\n unsaved: 'You have unsaved changes.',\n discard: 'Discard changes',\n historyTitle: 'Version history',\n historyCurrent: 'Version {version} — current',\n historyEdited: 'Last edited {when}',\n historySession: 'Saved in this session',\n historyNote:\n 'Every save bumps the version and is recorded on each step it governs. Earlier versions are not listed yet.',\n archivedLocked: 'Archived stewards cannot be edited.',\n forbiddenSave: 'You can read this charter but not change it.',\n },\n daybook: {\n title: 'Daybook',\n prev: 'Previous day',\n next: 'Next day',\n today: 'Today',\n allTriggers: 'All triggers',\n allStatuses: 'All statuses',\n colTime: 'Time',\n colTrigger: 'Trigger',\n colRun: 'Run',\n colStatus: 'Status',\n colSteps: 'Steps',\n colCredits: 'Credits',\n colDuration: 'Duration',\n empty: 'No runs on this day.',\n summary: 'Day summary',\n runs: 'Runs',\n runsBreakdown: '{completed} completed · {failed} failed',\n approvals: 'Approvals',\n approvalsBreakdown: 'asked / granted · {pending} pending',\n spendVsCap: 'Spend vs daily cap',\n stepsVsCap: 'Steps vs daily cap',\n attention: 'Needs attention',\n attentionEmpty: 'Nothing needs attention.',\n dryRun: 'Dry run',\n loadError: 'Could not load the daybook.',\n running: 'running',\n },\n run: {\n title: 'Run',\n steward: 'Steward',\n trigger: 'Trigger',\n autonomy: 'Autonomy',\n started: 'Started',\n stopRun: 'Stop run',\n stopping: 'Stopping…',\n retry: 'Retry',\n retryDry: 'Run again as dry run',\n retryLive: 'Run again live',\n retryLiveConfirm:\n 'A live run repeats real desk actions, such as sends or purchases, and cannot be undone. Use a dry run first unless you are sure.',\n retryLiveConfirmAction: 'Run live',\n retryBlockedActive: 'Another run of this steward is still in progress.',\n retryBlockedStatus: 'Activate the steward before running it again.',\n retrying: 'Starting…',\n retryError: 'Could not start the new run.',\n cancelError: 'Could not stop the run.',\n dryBadge: 'Dry run',\n trustTitle: 'Trust level',\n trustDegraded: 'Lowered during the run',\n trustSame: 'Unchanged during the run',\n budgetTitle: 'Run budget — credits',\n stepsTitle: 'Steps',\n verdictsTitle: 'Policy verdicts',\n verdictsLegend: 'allowed · asked · denied',\n stepsHeading: 'Execution steps',\n stepsOrdered: 'ordered',\n noSteps: 'No steps recorded yet.',\n colNumber: '#',\n colStep: 'Step',\n colVerdict: 'Verdict',\n colCredits: 'Credits',\n colTime: 'Time',\n stepDetail: 'Step {seq} · {tool}',\n pickStep: 'Select a step to see its details.',\n arguments: 'Arguments (redacted)',\n noArguments: 'No arguments.',\n result: 'Result',\n screenshot: 'Desk screenshot',\n screenshotNone: 'No desk for this step.',\n screenshotRef: 'Screenshot file {id}',\n screenshotError: 'The screenshot could not be loaded.',\n screenshotAlt: 'Desk screenshot for this step',\n trail: 'Policy decision',\n trailVerdict: 'Verdict',\n trailReasons: 'Reasons',\n trailClassification: 'Classification',\n trailTrust: 'Trust',\n trailApproval: 'Approval request {id}',\n trailRule: 'Standing rule {id}',\n trailDryRun: 'Recorded in dry-run mode; nothing was executed.',\n cost: 'Cost',\n deskSeconds: 'Desk time',\n approvalsTitle: 'Approvals this run asked for',\n stopReason: 'Stopped: {reason}',\n live: 'Live updates on',\n polling: 'Live updates unavailable — refreshing every few seconds.',\n loadError: 'Could not load the run.',\n },\n },\n} as const;\n"],"mappings":";AAMA,IAAaA,IAAiB,EAC5B,UAAU;CACR,KAAK,EAAE,OAAO,WAAW;CACzB,QAAQ;EACN,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,MAAM;EACN,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;EACT,gBAAgB;EAChB,eAAe;EACf,eAAe;EACf,cAAc;EACd,YAAY;EACZ,eAAe;EACf,cAAc;CAChB;CACA,OAAO;EACL,QAAQ;GAAE,OAAO;GAAS,QAAQ;GAAU,QAAQ;GAAU,UAAU;EAAW;EACnF,UAAU;GAAE,SAAS;GAAW,KAAK;GAAO,QAAQ;GAAU,SAAS;EAAU;EACjF,cAAc;GACZ,SACE;GACF,KAAK;GACL,QACE;GACF,SACE;EACJ;EACA,MAAM;GACJ,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,QAAQ;GACN,QAAQ;GACR,YAAY;GACZ,SAAS;EACX;EACA,WAAW;GACT,UAAU;GACV,QAAQ;GACR,SAAS;GACT,kBAAkB;GAClB,kBAAkB;GAClB,eAAe;GACf,WAAW;GACX,QAAQ;GACR,WAAW;GACX,SAAS;EACX;EACA,SAAS;GACP,YAAY;GACZ,UAAU;GACV,SAAS;GACT,WAAW;GACX,gBAAgB;GAChB,iBAAiB;GACjB,OAAO;GACP,WA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ACP,WAAW;EACX,SAAS;EACT,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,eAAe;EACf,gBAAgB;EAChB,aACE;EACF,gBAAgB;EAChB,eAAe;CACjB;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;EACb,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,WAAW;EACX,UAAU;EACV,YAAY;EACZ,aAAa;EACb,OAAO;EACP,SAAS;EACT,MAAM;EACN,eAAe;EACf,WAAW;EACX,oBAAoB;EACpB,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,gBAAgB;EAChB,QAAQ;EACR,WAAW;EACX,SAAS;CACX;CACA,KAAK;EACH,OAAO;EACP,SAAS;EACT,SAAS;EACT,UAAU;EACV,SAAS;EACT,SAAS;EACT,UAAU;EACV,OAAO;EACP,UAAU;EACV,WAAW;EACX,kBACE;EACF,wBAAwB;EACxB,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,YAAY;EACZ,aAAa;EACb,UAAU;EACV,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,YAAY;EACZ,eAAe;EACf,gBAAgB;EAChB,cAAc;EACd,cAAc;EACd,SAAS;EACT,WAAW;EACX,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,UAAU;EACV,WAAW;EACX,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,eAAe;EACf,OAAO;EACP,cAAc;EACd,cAAc;EACd,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,YAAY;EACZ,MAAM;EACN,SAAS;EACT,WAAW;CACb;AACF,EACF"}
|
|
1
|
+
{"version":3,"file":"en.js","names":["enTranslations"],"sources":["../../../src/stewards/i18n/en.ts"],"sourcesContent":["/**\n * English strings for microfe-stewards. Keys are dot-notation; the host's\n * I18nProvider resolves them against the translations it loads, and `useStewardsT`\n * falls back to this object when the host has no entry (or no provider).\n * Register it with the shell's `fallbackTranslations`.\n */\nexport const enTranslations = {\n stewards: {\n nav: { label: 'Stewards' },\n common: {\n back: 'Back',\n cancel: 'Cancel',\n loading: 'Loading…',\n retry: 'Try again',\n none: 'None',\n noCap: 'No cap',\n never: 'Never',\n credits: 'credits',\n unknown: 'Unknown',\n forbiddenTitle: 'You do not have access',\n forbiddenBody: 'Your role does not allow you to view Stewards in this workspace.',\n disabledTitle: 'Stewards are not enabled',\n disabledBody: 'Stewards are not turned on for this workspace yet.',\n errorTitle: 'Something went wrong',\n notFoundTitle: 'Not found',\n notFoundBody: 'This steward or run does not exist, or you cannot see it.',\n },\n enums: {\n status: { DRAFT: 'Draft', ACTIVE: 'Active', PAUSED: 'Paused', ARCHIVED: 'Archived' },\n autonomy: { OBSERVE: 'Observe', ASK: 'Ask', GUIDED: 'Guided', TRUSTED: 'Trusted' },\n autonomyHelp: {\n OBSERVE:\n 'Read only, by construction. Can look, summarise and report; no outward actions exist.',\n ASK: 'Every outward action asks a person first.',\n GUIDED:\n 'A reviewer model decides each outward action against the charter; when unsure it asks you.',\n TRUSTED:\n 'Your standing rules apply first, then the reviewer model. Still bounded by budgets.',\n },\n desk: {\n NONE: 'No desk',\n BROWSER: 'Browser only',\n CLOUD: 'Cloud desk',\n OWN_MACHINE: 'Own machine',\n },\n deskHelp: {\n NONE: 'Works through connectors and tools only.',\n BROWSER: 'A managed browser. The agent needs the Web browsing capability.',\n CLOUD: 'A cloud desktop. The agent needs the Computer use capability.',\n OWN_MACHINE: 'A machine you connect. The agent needs the Computer use capability.',\n },\n egress: {\n PUBLIC: 'Any public site',\n ALLOW_LIST: 'Only the sites I list',\n BLOCKED: 'No web access',\n },\n runStatus: {\n PROPOSED: 'Proposed',\n QUEUED: 'Queued',\n RUNNING: 'Running',\n WAITING_APPROVAL: 'Waiting for approval',\n WAITING_TAKEOVER: 'Waiting for a person',\n PAUSED_BUDGET: 'Paused — budget',\n COMPLETED: 'Completed',\n FAILED: 'Failed',\n CANCELLED: 'Cancelled',\n STOPPED: 'Stopped',\n },\n trigger: {\n OWNER_CHAT: 'Owner chat',\n SCHEDULE: 'Schedule',\n WEBHOOK: 'Webhook',\n APP_EVENT: 'App event',\n PLATFORM_EVENT: 'Platform event',\n CHANNEL_MESSAGE: 'Channel message',\n WATCH: 'Watch',\n PROACTIVE: 'Proactive',\n API: 'API',\n WORKFLOW: 'Workflow',\n A2A: 'Agent to agent',\n },\n trust: {\n OWNER: 'Owner',\n MEMBER: 'Member',\n SYSTEM: 'System',\n EXTERNAL: 'External content',\n UNTRUSTED: 'Untrusted content',\n },\n stepKind: {\n MODEL_CALL: 'Model call',\n TOOL_CALL: 'Connector tool',\n DESK_ACTION: 'Desk action',\n APPROVAL_WAIT: 'Approval wait',\n TAKEOVER: 'Takeover',\n SUB_RUN: 'Sub-run',\n MEMORY_WRITE: 'Memory write',\n NOTE: 'Note',\n },\n verdict: {\n ALLOWED: 'Allowed',\n ASKED: 'Asked',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n BLOCKED_DRY_RUN: 'Dry run',\n FAILED: 'Failed',\n SKIPPED: 'Skipped',\n },\n approvalStatus: {\n PENDING: 'Pending',\n APPROVED: 'Approved',\n DENIED: 'Denied',\n EXPIRED: 'Expired',\n CANCELLED: 'Cancelled',\n },\n scope: {\n ONCE: 'Once',\n RUN: 'This run',\n DUTY: 'This duty',\n TIME_LIMITED: 'Time-limited',\n STANDING: 'Standing',\n },\n },\n tools: {\n 'desk:screenshot': 'Screenshot',\n 'desk:snapshot': 'Read the screen structure',\n 'desk:click': 'Click',\n 'desk:type': 'Type',\n 'desk:key': 'Press keys',\n 'desk:scroll': 'Scroll',\n 'desk:navigate': 'Open a URL',\n 'desk:focus_window': 'Switch window',\n 'desk:secret_fill': 'Fill a stored secret',\n 'desk:shell': 'Run shell commands',\n 'desk:read_file': 'Read files',\n 'desk:write_file': 'Write files',\n 'platform:current_time': 'Check the time',\n 'platform:notify_owner': 'Notify the owner',\n },\n budget: {\n credits: 'AI credits',\n deskMinutes: 'Desk minutes',\n steps: 'Steps',\n wallSeconds: 'Wall-clock seconds',\n connectorSpendMinor: 'Connector spend (minor units)',\n perRun: 'Per run',\n perDay: 'Per day',\n total: 'Total',\n limit: 'Limit',\n invalid: 'Enter a number of 0 or more for {name} (whole numbers, except credits).',\n hint: 'Run stops when any limit is hit. Leave a box empty for no cap at that level.',\n },\n fixed: {\n title: 'Always asks a person — can’t be loosened',\n badge: 'Fixed',\n password: 'Password and security-setting changes',\n payment: 'Entering payment details',\n otp: 'Reading one-time codes',\n external: 'Messages to people outside the workspace',\n },\n list: {\n title: 'Stewards',\n subtitle:\n 'Agents with a charter, duties and a desk — they work on a schedule or on events, inside the limits you set.',\n newSteward: 'New steward',\n statusFilter: 'Status',\n allStatuses: 'All',\n tableLabel: 'Stewards',\n colSteward: 'Steward',\n colStatus: 'Status',\n colAutonomy: 'Autonomy',\n colDesk: 'Desk',\n colLastRun: 'Last run',\n colToday: 'Today · spend / daily cap',\n colWaiting: 'Waiting',\n neverRun: 'Never run',\n tileActive: 'Active stewards',\n tileWaiting: 'Waiting for approval',\n tileWaitingHint: 'Approval requests across stewards',\n tileSpend: 'Credits used today',\n empty: 'No stewards yet.',\n emptyFiltered: 'No stewards match this status.',\n emptyHint: 'Make one of your agents a steward to give it a charter and a desk.',\n loadError: 'Could not load stewards.',\n },\n wizard: {\n title: 'New steward',\n stepOf: 'Step {step} of {total}',\n steps: { agent: 'Agent', charter: 'Charter', desk: 'Desk', review: 'Review' },\n next: 'Continue',\n create: 'Create steward',\n creating: 'Creating…',\n agentTitle: 'Base agent',\n agentHelp: 'A steward is an existing agent plus a charter, duties and a desk.',\n pickExisting: 'Use an existing agent',\n createNew: 'Create a new agent',\n noAgents: 'No active agents available. Create one here.',\n agentSearch: 'Search agents',\n agentName: 'Agent name',\n agentPrompt: 'What is this agent for?',\n agentPromptHelp: 'Becomes the agent’s system prompt. You can refine it later.',\n capabilities: 'Capabilities',\n capabilityHelp: 'Capabilities decide which desks the agent can use.',\n capWeb: 'Web browsing',\n capComputer: 'Computer use',\n charterTitle: 'Charter',\n charterHelp:\n 'Plain-language rules, one per line. The reviewer model checks them on every outward action.',\n charterLabel: 'Charter rules',\n charterPlaceholder:\n 'Only summarise ledgers from the Finance folder; never edit source sheets.\\nSend the weekly summary only to finance@example.com.',\n charterRequired: 'Write at least one rule.',\n autonomyTitle: 'Autonomy level',\n autonomyHint: 'Can be lowered at any time; raising it is logged.',\n autonomyLockedByAdmin: 'A workspace admin limits stewards to {level}.',\n toolsTitle: 'Allowed tools & connectors',\n toolsCount: '{count} selected',\n deskTitle: 'Desk',\n deskHelp: 'Where the steward may work on a screen.',\n deskNeeds:\n 'This agent does not have the {capability} capability, so this desk may be refused.',\n egressTitle: 'Web access from the desk',\n allowedHosts: 'Allowed sites',\n allowedHostsHelp: 'One per line: example.com, or *.example.com for its subdomains.',\n reviewTitle: 'Review',\n reviewBody: 'The steward starts as a draft. Activate it from its page when you are ready.',\n reviewAgent: 'Agent',\n reviewAutonomy: 'Autonomy',\n reviewDesk: 'Desk',\n reviewTools: 'Tools',\n reviewBudget: 'Daily AI credits',\n createError: 'Could not create the steward.',\n newAgentError: 'Could not create the agent.',\n },\n detail: {\n owner: 'Base agent',\n tabs: { overview: 'Overview', charter: 'Charter', daybook: 'Daybook' },\n version: 'Charter v{version}, edited {when}',\n pause: 'Pause steward',\n resume: 'Resume',\n activate: 'Activate',\n archive: 'Archive',\n runNow: 'Run now',\n running: 'Starting…',\n runTitle: 'Run now',\n runPrompt: 'What should the steward do?',\n runPromptPlaceholder: 'Check the shared inbox and summarise what needs me today.',\n runDry: 'Dry run — record what it would do, without doing it',\n runStart: 'Start run',\n runError: 'Could not start the run.',\n statusError: 'Could not change the status.',\n overviewToday: 'Today',\n overviewRecent: 'Recent runs',\n noRuns: 'No runs yet.',\n openApprovals: 'Open approvals ({count})',\n archived: 'This steward is archived and cannot be changed.',\n colRun: 'Run',\n colStarted: 'Started',\n colTrigger: 'Trigger',\n },\n charter: {\n rulesTitle: 'Rules',\n rulesHint: 'Plain language — checked by the reviewer model on every outward action',\n rulesLabel: 'Charter rules',\n autonomyTitle: 'Autonomy & budgets',\n usage: 'Today',\n toolsTitle: 'Allowed tools',\n toolsHint: 'An empty list means the steward has no tools.',\n groupLook: 'Look at the screen',\n groupAct: 'Act on the screen',\n groupFiles: 'Files and shell',\n groupPlatform: 'BotManor tools',\n customTitle: 'Connectors and workflows',\n customHint:\n 'One key per line: mcp:<connection>:<tool>, node:<provider>:<operation>, workflow:<id>.',\n customInvalid: 'Not a valid tool key: {key}',\n connectionsLabel: 'Allowed connection ids',\n connectionsHint: 'One id per line.',\n dryRun: 'Dry-run mode',\n dryRunHelp: 'Plan and record actions without executing outward ones.',\n deskTitle: 'Desk web access',\n timezone: 'Time zone',\n timezoneHelp: 'Daily budgets and the daybook count days in this time zone.',\n rulesSection: 'Standing approval rules',\n rulesSectionHint: 'Apply at the Trusted level. Revoke one and the steward asks again.',\n rulesEmpty:\n 'No standing rules. Approving a request with a duty, time-limited or standing scope creates one.',\n colTool: 'Tool',\n colDestination: 'Destination',\n colPurpose: 'Purpose',\n colLimit: 'Limit',\n colExpires: 'Expires',\n revoke: 'Revoke',\n save: 'Save charter',\n saving: 'Saving…',\n saved: 'Charter saved as version {version}.',\n saveError: 'Could not save the charter.',\n unsaved: 'You have unsaved changes.',\n discard: 'Discard changes',\n historyTitle: 'Version history',\n historyCurrent: 'Version {version} — current',\n historyEdited: 'Last edited {when}',\n historySession: 'Saved in this session',\n historyNote:\n 'Every save bumps the version and is recorded on each step it governs. Earlier versions are not listed yet.',\n archivedLocked: 'Archived stewards cannot be edited.',\n forbiddenSave: 'You can read this charter but not change it.',\n },\n daybook: {\n title: 'Daybook',\n prev: 'Previous day',\n next: 'Next day',\n today: 'Today',\n allTriggers: 'All triggers',\n allStatuses: 'All statuses',\n colTime: 'Time',\n colTrigger: 'Trigger',\n colRun: 'Run',\n colStatus: 'Status',\n colSteps: 'Steps',\n colCredits: 'Credits',\n colDuration: 'Duration',\n empty: 'No runs on this day.',\n summary: 'Day summary',\n runs: 'Runs',\n runsBreakdown: '{completed} completed · {failed} failed',\n approvals: 'Approvals',\n approvalsBreakdown: 'asked / granted · {pending} pending',\n spendVsCap: 'Spend vs daily cap',\n stepsVsCap: 'Steps vs daily cap',\n attention: 'Needs attention',\n attentionEmpty: 'Nothing needs attention.',\n dryRun: 'Dry run',\n loadError: 'Could not load the daybook.',\n running: 'running',\n },\n desk: {\n title: 'Live desk',\n hint: 'What the Steward sees and does on its desk',\n intro:\n 'Watch the Steward work on its desk. You can take over for a sign-in, a CAPTCHA or a one-time code.',\n watch: 'Watch live',\n stopWatching: 'Stop watching',\n takeOver: 'Take over',\n takingOver: 'Taking over…',\n handBack: 'Hand back',\n handingBack: 'Handing back…',\n watchAgain: 'Watch again',\n reconnect: 'Reconnect',\n canvasLabelView: 'Live view of the Steward desk. View only.',\n canvasLabelControl:\n 'Live view of the Steward desk. You are in control; keyboard and pointer go to the desk.',\n controlHint: 'Keyboard and pointer go to the desk while it has focus. Press Tab to leave it.',\n waitingFrame: 'Waiting for the desk to send its first image…',\n bannerSteward: 'Steward in control',\n bannerStewardBody: 'You are watching. The Steward is working on the desk.',\n bannerYou: 'You are in control',\n bannerYouBody:\n 'The Steward is paused. What you type goes to the desk and is never recorded. Hand back when you are done.',\n bannerOther: 'Another person is in control',\n bannerOtherBody: 'The Steward is paused while they work on the desk.',\n bannerConnecting: 'Connecting to the desk…',\n bannerReconnecting: 'Connection lost. Reconnecting (attempt {attempt})…',\n endedLease: 'The desk session ended',\n endedLeaseBody: 'Nobody holds the desk any more, so the stream was closed.',\n endedLeaseControlBody:\n 'Your control of the desk ended. Hand back to let the Steward continue, or take over again.',\n endedIdle: 'Stream closed after a period of inactivity',\n endedIdleBody: 'Nothing was sent for a while, so the stream was closed to protect the desk.',\n failedForbidden: 'You cannot view this desk',\n failedForbiddenBody:\n \"Only the Steward's owner and its approvers can watch or take over its desk.\",\n failedNotFound: 'The desk is not available',\n failedNotFoundBody:\n 'The desk or its session was not found. The run may not have started on a desk yet.',\n failedSignIn: 'Please sign in again',\n failedSignInBody:\n 'Your session could not be confirmed for the live view. Sign in again, then reconnect.',\n failedBadRequest: 'The live view could not start',\n failedBadRequestBody: 'The desk stream sent something unexpected. Try again in a moment.',\n failedTooMany: 'Too many open desk streams',\n failedTooManyBody: 'Close another live view, then reconnect.',\n failedUnavailable: 'The desk stream is unavailable',\n failedUnavailableBody:\n 'The connection kept dropping or the desk is not streaming. Try again in a moment.',\n failedMint: 'The live view could not be opened',\n failedMintBody:\n 'The request for a live view was refused. The run may not be on a desk right now.',\n handedBack: 'You handed control back. The Steward will continue from its last checkpoint.',\n actionError: 'The action did not go through.',\n },\n run: {\n title: 'Run',\n steward: 'Steward',\n trigger: 'Trigger',\n autonomy: 'Autonomy',\n started: 'Started',\n stopRun: 'Stop run',\n stopping: 'Stopping…',\n retry: 'Retry',\n retryDry: 'Run again as dry run',\n retryLive: 'Run again live',\n retryLiveConfirm:\n 'A live run repeats real desk actions, such as sends or purchases, and cannot be undone. Use a dry run first unless you are sure.',\n retryLiveConfirmAction: 'Run live',\n retryBlockedActive: 'Another run of this steward is still in progress.',\n retryBlockedStatus: 'Activate the steward before running it again.',\n retrying: 'Starting…',\n retryError: 'Could not start the new run.',\n cancelError: 'Could not stop the run.',\n dryBadge: 'Dry run',\n trustTitle: 'Trust level',\n trustDegraded: 'Lowered during the run',\n trustSame: 'Unchanged during the run',\n budgetTitle: 'Run budget — credits',\n stepsTitle: 'Steps',\n verdictsTitle: 'Policy verdicts',\n verdictsLegend: 'allowed · asked · denied',\n stepsHeading: 'Execution steps',\n stepsOrdered: 'ordered',\n noSteps: 'No steps recorded yet.',\n colNumber: '#',\n colStep: 'Step',\n colVerdict: 'Verdict',\n colCredits: 'Credits',\n colTime: 'Time',\n stepDetail: 'Step {seq} · {tool}',\n pickStep: 'Select a step to see its details.',\n arguments: 'Arguments (redacted)',\n noArguments: 'No arguments.',\n result: 'Result',\n screenshot: 'Desk screenshot',\n screenshotNone: 'No desk for this step.',\n screenshotRef: 'Screenshot file {id}',\n screenshotError: 'The screenshot could not be loaded.',\n screenshotAlt: 'Desk screenshot for this step',\n trail: 'Policy decision',\n trailVerdict: 'Verdict',\n trailReasons: 'Reasons',\n trailClassification: 'Classification',\n trailTrust: 'Trust',\n trailApproval: 'Approval request {id}',\n trailRule: 'Standing rule {id}',\n trailDryRun: 'Recorded in dry-run mode; nothing was executed.',\n cost: 'Cost',\n deskSeconds: 'Desk time',\n approvalsTitle: 'Approvals this run asked for',\n stopReason: 'Stopped: {reason}',\n live: 'Live updates on',\n polling: 'Live updates unavailable — refreshing every few seconds.',\n loadError: 'Could not load the run.',\n },\n },\n} as const;\n"],"mappings":";AAMA,IAAaA,IAAiB,EAC5B,UAAU;CACR,KAAK,EAAE,OAAO,WAAW;CACzB,QAAQ;EACN,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,MAAM;EACN,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;EACT,gBAAgB;EAChB,eAAe;EACf,eAAe;EACf,cAAc;EACd,YAAY;EACZ,eAAe;EACf,cAAc;CAChB;CACA,OAAO;EACL,QAAQ;GAAE,OAAO;GAAS,QAAQ;GAAU,QAAQ;GAAU,UAAU;EAAW;EACnF,UAAU;GAAE,SAAS;GAAW,KAAK;GAAO,QAAQ;GAAU,SAAS;EAAU;EACjF,cAAc;GACZ,SACE;GACF,KAAK;GACL,QACE;GACF,SACE;EACJ;EACA,MAAM;GACJ,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,UAAU;GACR,MAAM;GACN,SAAS;GACT,OAAO;GACP,aAAa;EACf;EACA,QAAQ;GACN,QAAQ;GACR,YAAY;GACZ,SAAS;EACX;EACA,WAAW;GACT,UAAU;GACV,QAAQ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EACV,SAAS;EACT,SAAS;EACT,UAAU;EACV,OAAO;EACP,UAAU;EACV,WAAW;EACX,kBACE;EACF,wBAAwB;EACxB,oBAAoB;EACpB,oBAAoB;EACpB,UAAU;EACV,YAAY;EACZ,aAAa;EACb,UAAU;EACV,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,YAAY;EACZ,eAAe;EACf,gBAAgB;EAChB,cAAc;EACd,cAAc;EACd,SAAS;EACT,WAAW;EACX,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,UAAU;EACV,WAAW;EACX,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,iBAAiB;EACjB,eAAe;EACf,OAAO;EACP,cAAc;EACd,cAAc;EACd,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,WAAW;EACX,aAAa;EACb,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,YAAY;EACZ,MAAM;EACN,SAAS;EACT,WAAW;CACb;AACF,EACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FrameSink } from './useDeskStream';
|
|
2
|
+
interface DeskCanvasProps {
|
|
3
|
+
/** Receives a function that paints one desk frame; called with null on unmount. */
|
|
4
|
+
registerSink: (sink: FrameSink | null) => void;
|
|
5
|
+
/** Control mode: forward the person's pointer and keys to the desk. */
|
|
6
|
+
interactive: boolean;
|
|
7
|
+
send: (frame: string) => boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
hint: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Paints the desk's screen frames and, in control mode, turns pointer and key events into input.
|
|
13
|
+
*
|
|
14
|
+
* Keystrokes can be a password or a one-time code. They go straight from the event to `send`:
|
|
15
|
+
* no state, no ref, no log, no copy. Tab is not forwarded, so the keyboard can always leave the
|
|
16
|
+
* desk. Frames are decoded newest-first and older ones are skipped, so a slow device never falls
|
|
17
|
+
* behind.
|
|
18
|
+
*/
|
|
19
|
+
export declare function DeskCanvas({ registerSink, interactive, send, label, hint }: DeskCanvasProps): import('react').JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { encodeInput as e, normalisePoint as t, sniffImageMime as n } from "./protocol.js";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect as a, useRef as o } from "react";
|
|
4
|
+
// src/stewards/live/DeskCanvas.tsx
|
|
5
|
+
var s = 50;
|
|
6
|
+
function c({ registerSink: c, interactive: l, send: u, label: d, hint: f }) {
|
|
7
|
+
let p = o(null), m = o(0);
|
|
8
|
+
a(() => {
|
|
9
|
+
let e = !1, t = null, r = !1, i = async (e) => {
|
|
10
|
+
let t = n(new Uint8Array(e, 0, Math.min(16, e.byteLength))), i = p.current;
|
|
11
|
+
if (!t || !i || e.byteLength > 16777216) return;
|
|
12
|
+
let a;
|
|
13
|
+
try {
|
|
14
|
+
a = await createImageBitmap(new Blob([e], { type: t }));
|
|
15
|
+
} catch {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
r || ((i.width !== a.width || i.height !== a.height) && (i.width = a.width, i.height = a.height), i.getContext("2d")?.drawImage(a, 0, 0)), a.close();
|
|
19
|
+
}, a = async () => {
|
|
20
|
+
if (!e) {
|
|
21
|
+
for (e = !0; t && !r;) {
|
|
22
|
+
let e = t;
|
|
23
|
+
t = null, await i(e);
|
|
24
|
+
}
|
|
25
|
+
e = !1;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return c((e) => {
|
|
29
|
+
t = e, a();
|
|
30
|
+
}), () => {
|
|
31
|
+
r = !0, t = null, c(null);
|
|
32
|
+
};
|
|
33
|
+
}, [c]), a(() => {
|
|
34
|
+
let n = p.current;
|
|
35
|
+
if (!n || !l) return;
|
|
36
|
+
let r = (r) => {
|
|
37
|
+
r.preventDefault();
|
|
38
|
+
let i = t(n.getBoundingClientRect(), r.clientX, r.clientY);
|
|
39
|
+
u(e({
|
|
40
|
+
type: "wheel",
|
|
41
|
+
...i,
|
|
42
|
+
dx: r.deltaX,
|
|
43
|
+
dy: r.deltaY
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
return n.addEventListener("wheel", r, { passive: !1 }), () => n.removeEventListener("wheel", r);
|
|
47
|
+
}, [l, u]);
|
|
48
|
+
let h = (n, r) => {
|
|
49
|
+
if (!l) return;
|
|
50
|
+
let i = {
|
|
51
|
+
type: "pointer",
|
|
52
|
+
action: n,
|
|
53
|
+
...t(r.currentTarget.getBoundingClientRect(), r.clientX, r.clientY),
|
|
54
|
+
button: r.button
|
|
55
|
+
};
|
|
56
|
+
u(e(i));
|
|
57
|
+
}, g = (t, n) => {
|
|
58
|
+
l && n.key !== "Tab" && (n.preventDefault(), u(e({
|
|
59
|
+
type: "key",
|
|
60
|
+
action: t,
|
|
61
|
+
key: n.key,
|
|
62
|
+
code: n.code
|
|
63
|
+
})));
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ i("div", {
|
|
66
|
+
className: "flex flex-col gap-1",
|
|
67
|
+
children: [/* @__PURE__ */ r("canvas", {
|
|
68
|
+
ref: p,
|
|
69
|
+
tabIndex: l ? 0 : -1,
|
|
70
|
+
role: "img",
|
|
71
|
+
"aria-label": d,
|
|
72
|
+
"data-testid": "desk-canvas",
|
|
73
|
+
className: `block h-auto w-full rounded-md border border-(color:--color-border-seam) bg-(--color-bg-sunken) focus-visible:outline-2 focus-visible:outline-(color:--color-focus-ring) ${l ? "cursor-crosshair" : ""}`,
|
|
74
|
+
onPointerDown: (e) => {
|
|
75
|
+
e.currentTarget.focus(), h("down", e);
|
|
76
|
+
},
|
|
77
|
+
onPointerUp: (e) => h("up", e),
|
|
78
|
+
onPointerMove: (e) => {
|
|
79
|
+
let t = performance.now();
|
|
80
|
+
t - m.current < s || (m.current = t, h("move", e));
|
|
81
|
+
},
|
|
82
|
+
onKeyDown: (e) => g("down", e),
|
|
83
|
+
onKeyUp: (e) => g("up", e),
|
|
84
|
+
onContextMenu: (e) => {
|
|
85
|
+
l && e.preventDefault();
|
|
86
|
+
}
|
|
87
|
+
}), l && /* @__PURE__ */ r("p", {
|
|
88
|
+
className: "text-xs text-(color:--color-text-secondary)",
|
|
89
|
+
children: f
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export { c as DeskCanvas };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=DeskCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeskCanvas.js","names":["MOVE_INTERVAL_MS","DeskCanvas","canvasRef","useRef","lastMoveAt","useEffect","decoding","latest","disposed","paint","mime","sniffImageMime","buffer","canvas","bitmap","drain","next","registerSink","frame","interactive","onWheel","point","normalisePoint","event","encodeInput","send","pointer","input","key","label","now","hint"],"sources":["../../../src/stewards/live/DeskCanvas.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport {\n encodeInput,\n MAX_FRAME_BYTES,\n normalisePoint,\n sniffImageMime,\n type DeskInput,\n} from './protocol';\nimport type { FrameSink } from './useDeskStream';\n\n/** Most pointer-move messages per second; a click or key is never throttled. */\nconst MOVE_INTERVAL_MS = 50;\n\ninterface DeskCanvasProps {\n /** Receives a function that paints one desk frame; called with null on unmount. */\n registerSink: (sink: FrameSink | null) => void;\n /** Control mode: forward the person's pointer and keys to the desk. */\n interactive: boolean;\n send: (frame: string) => boolean;\n label: string;\n hint: string;\n}\n\n/**\n * Paints the desk's screen frames and, in control mode, turns pointer and key events into input.\n *\n * Keystrokes can be a password or a one-time code. They go straight from the event to `send`:\n * no state, no ref, no log, no copy. Tab is not forwarded, so the keyboard can always leave the\n * desk. Frames are decoded newest-first and older ones are skipped, so a slow device never falls\n * behind.\n */\nexport function DeskCanvas({ registerSink, interactive, send, label, hint }: DeskCanvasProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const lastMoveAt = useRef(0);\n\n useEffect(() => {\n let decoding = false;\n let latest: ArrayBuffer | null = null;\n let disposed = false;\n\n const paint = async (buffer: ArrayBuffer): Promise<void> => {\n const mime = sniffImageMime(new Uint8Array(buffer, 0, Math.min(16, buffer.byteLength)));\n const canvas = canvasRef.current;\n if (!mime || !canvas || buffer.byteLength > MAX_FRAME_BYTES) return;\n let bitmap: ImageBitmap;\n try {\n bitmap = await createImageBitmap(new Blob([buffer], { type: mime }));\n } catch {\n return; // A frame that does not decode is skipped; the next one repaints.\n }\n if (disposed) {\n bitmap.close();\n return;\n }\n if (canvas.width !== bitmap.width || canvas.height !== bitmap.height) {\n canvas.width = bitmap.width;\n canvas.height = bitmap.height;\n }\n canvas.getContext('2d')?.drawImage(bitmap, 0, 0);\n bitmap.close();\n };\n\n const drain = async (): Promise<void> => {\n if (decoding) return;\n decoding = true;\n while (latest && !disposed) {\n const next = latest;\n latest = null;\n await paint(next);\n }\n decoding = false;\n };\n\n registerSink((frame) => {\n latest = frame;\n void drain();\n });\n return () => {\n disposed = true;\n latest = null;\n registerSink(null);\n };\n }, [registerSink]);\n\n // Wheel needs a non-passive listener to stop the page scrolling while the desk scrolls.\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || !interactive) return;\n const onWheel = (event: WheelEvent) => {\n event.preventDefault();\n const point = normalisePoint(canvas.getBoundingClientRect(), event.clientX, event.clientY);\n send(encodeInput({ type: 'wheel', ...point, dx: event.deltaX, dy: event.deltaY }));\n };\n canvas.addEventListener('wheel', onWheel, { passive: false });\n return () => canvas.removeEventListener('wheel', onWheel);\n }, [interactive, send]);\n\n const pointer = (\n action: 'move' | 'down' | 'up',\n event: React.PointerEvent<HTMLCanvasElement>\n ) => {\n if (!interactive) return;\n const point = normalisePoint(\n event.currentTarget.getBoundingClientRect(),\n event.clientX,\n event.clientY\n );\n const input: DeskInput = { type: 'pointer', action, ...point, button: event.button };\n send(encodeInput(input));\n };\n\n const key = (action: 'down' | 'up', event: React.KeyboardEvent<HTMLCanvasElement>) => {\n if (!interactive || event.key === 'Tab') return;\n event.preventDefault();\n send(encodeInput({ type: 'key', action, key: event.key, code: event.code }));\n };\n\n return (\n <div className=\"flex flex-col gap-1\">\n <canvas\n ref={canvasRef}\n tabIndex={interactive ? 0 : -1}\n role=\"img\"\n aria-label={label}\n data-testid=\"desk-canvas\"\n className={`block h-auto w-full rounded-md border border-(color:--color-border-seam) bg-(--color-bg-sunken) focus-visible:outline-2 focus-visible:outline-(color:--color-focus-ring) ${interactive ? 'cursor-crosshair' : ''}`}\n onPointerDown={(e) => {\n e.currentTarget.focus();\n pointer('down', e);\n }}\n onPointerUp={(e) => pointer('up', e)}\n onPointerMove={(e) => {\n const now = performance.now();\n if (now - lastMoveAt.current < MOVE_INTERVAL_MS) return;\n lastMoveAt.current = now;\n pointer('move', e);\n }}\n onKeyDown={(e) => key('down', e)}\n onKeyUp={(e) => key('up', e)}\n onContextMenu={(e) => {\n if (interactive) e.preventDefault();\n }}\n />\n {interactive && <p className=\"text-xs text-(color:--color-text-secondary)\">{hint}</p>}\n </div>\n );\n}\n"],"mappings":";;;;AAWA,IAAMA,IAAmB;AAoBzB,SAAgBC,EAAW,EAAE,iBAAc,gBAAa,SAAM,UAAO,WAAyB;CAC5F,IAAMC,IAAYC,EAA0B,IAAI,GAC1CC,IAAaD,EAAO,CAAC;CAoD3B,AAlDAE,QAAgB;EACd,IAAIC,IAAW,IACXC,IAA6B,MAC7BC,IAAW,IAETC,IAAQ,OAAO,MAAuC;GAC1D,IAAMC,IAAOC,EAAe,IAAI,WAAWC,GAAQ,GAAG,KAAK,IAAI,IAAIA,EAAO,UAAU,CAAC,CAAC,GAChFC,IAASX,EAAU;GACzB,IAAI,CAACQ,KAAQ,CAACG,KAAUD,EAAO,aAAA,UAA8B;GAC7D,IAAIE;GACJ,IAAI;IACF,IAAS,MAAM,kBAAkB,IAAI,KAAK,CAACF,CAAM,GAAG,EAAE,MAAMF,EAAK,CAAC,CAAC;GACrE,QAAQ;IACN;GACF;GACA,AAAIF,OAIAK,EAAO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