@burdenoff/microfe-stewards 2026.1201.2 → 2026.1201.4
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/fixturesEditors.d.ts +4 -0
- 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 +1440 -4
- package/dist/generated/wspace-operations.js +550 -51
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +1789 -15
- package/dist/generated/wspace-types.js +15 -5
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/stewards/StewardsRoutes.d.ts +2 -2
- package/dist/stewards/StewardsRoutes.js +41 -26
- package/dist/stewards/StewardsRoutes.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/DutyEditor.d.ts +8 -0
- package/dist/stewards/components/DutyEditor.js +151 -0
- package/dist/stewards/components/DutyEditor.js.map +1 -0
- package/dist/stewards/components/FormField.d.ts +8 -0
- package/dist/stewards/components/FormField.js +23 -0
- package/dist/stewards/components/FormField.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/components/MemoryDiffView.d.ts +6 -0
- package/dist/stewards/components/MemoryDiffView.js +81 -0
- package/dist/stewards/components/MemoryDiffView.js.map +1 -0
- package/dist/stewards/components/ProposalsQueue.d.ts +5 -0
- package/dist/stewards/components/ProposalsQueue.js +106 -0
- package/dist/stewards/components/ProposalsQueue.js.map +1 -0
- package/dist/stewards/components/TeachRecorder.d.ts +12 -0
- package/dist/stewards/components/TeachRecorder.js +288 -0
- package/dist/stewards/components/TeachRecorder.js.map +1 -0
- package/dist/stewards/i18n/en.d.ts +276 -6
- package/dist/stewards/i18n/en.js +54 -3
- package/dist/stewards/i18n/en.js.map +1 -1
- package/dist/stewards/i18n/enEditors.d.ts +230 -0
- package/dist/stewards/i18n/enEditors.js +233 -0
- package/dist/stewards/i18n/enEditors.js.map +1 -0
- package/dist/stewards/index.js +4 -4
- 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/StewardDutiesPage.d.ts +1 -0
- package/dist/stewards/pages/StewardDutiesPage.js +221 -0
- package/dist/stewards/pages/StewardDutiesPage.js.map +1 -0
- package/dist/stewards/pages/StewardLayout.js +62 -45
- package/dist/stewards/pages/StewardLayout.js.map +1 -1
- package/dist/stewards/pages/StewardMemoryPage.d.ts +1 -0
- package/dist/stewards/pages/StewardMemoryPage.js +294 -0
- package/dist/stewards/pages/StewardMemoryPage.js.map +1 -0
- package/dist/stewards/pages/StewardPlaybooksPage.d.ts +1 -0
- package/dist/stewards/pages/StewardPlaybooksPage.js +360 -0
- package/dist/stewards/pages/StewardPlaybooksPage.js.map +1 -0
- package/dist/stewards/pages/StewardRunPage.js +26 -20
- package/dist/stewards/pages/StewardRunPage.js.map +1 -1
- package/dist/stewards/utils/dutyForm.d.ts +37 -0
- package/dist/stewards/utils/dutyForm.js +84 -0
- package/dist/stewards/utils/dutyForm.js.map +1 -0
- package/dist/stewards/utils/memory.d.ts +21 -0
- package/dist/stewards/utils/memory.js +29 -0
- package/dist/stewards/utils/memory.js.map +1 -0
- package/dist/stewards/utils/playbookForm.d.ts +41 -0
- package/dist/stewards/utils/playbookForm.js +67 -0
- package/dist/stewards/utils/playbookForm.js.map +1 -0
- package/dist/stewards/utils/recorder.d.ts +31 -0
- package/dist/stewards/utils/recorder.js +106 -0
- package/dist/stewards/utils/recorder.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CreateBotmanorStewardDeskControlDocument as e, CreateBotmanorStewardLiveViewDocument as t } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { BotmanorStewardDeskHolder as n } from "../../generated/wspace-types.js";
|
|
3
|
+
import { MintError as r } from "./DeskStreamConnection.js";
|
|
4
|
+
import { CombinedGraphQLErrors as i } from "@apollo/client";
|
|
5
|
+
// src/stewards/live/mintPass.ts
|
|
6
|
+
var a = /* @__PURE__ */ new Set([
|
|
7
|
+
"FORBIDDEN",
|
|
8
|
+
"UNAUTHORIZED",
|
|
9
|
+
"FEATURE_DISABLED",
|
|
10
|
+
"BAD_USER_INPUT",
|
|
11
|
+
"NOT_FOUND",
|
|
12
|
+
"CONFLICT"
|
|
13
|
+
]);
|
|
14
|
+
function o(e) {
|
|
15
|
+
let t = e instanceof Error ? e.message : "Could not get a live view pass";
|
|
16
|
+
if (i.is(e)) {
|
|
17
|
+
let n = e.errors.map((e) => e.extensions?.code), i = n.some((e) => e === "FORBIDDEN" || e === "UNAUTHORIZED"), o = n.some((e) => typeof e == "string" && a.has(e));
|
|
18
|
+
return new r(t, {
|
|
19
|
+
retryable: !o,
|
|
20
|
+
forbidden: i
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return new r(t, { retryable: !0 });
|
|
24
|
+
}
|
|
25
|
+
function s(e) {
|
|
26
|
+
let t = Date.parse(e.expiresAt);
|
|
27
|
+
return {
|
|
28
|
+
token: e.token,
|
|
29
|
+
relayPath: e.relayPath,
|
|
30
|
+
mode: e.mode === "CONTROL" ? "control" : "view",
|
|
31
|
+
expiresAtMs: Number.isFinite(t) ? t : 0,
|
|
32
|
+
holder: e.heldBy === n.Person ? "person" : "steward"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function c(n, r) {
|
|
36
|
+
return async (i) => {
|
|
37
|
+
try {
|
|
38
|
+
if (i === "control") {
|
|
39
|
+
let { data: t } = await n.mutate({
|
|
40
|
+
mutation: e,
|
|
41
|
+
variables: { runId: r }
|
|
42
|
+
});
|
|
43
|
+
if (!t) throw Error("No pass returned");
|
|
44
|
+
return s(t.createBotmanorStewardDeskControl);
|
|
45
|
+
}
|
|
46
|
+
let { data: a } = await n.mutate({
|
|
47
|
+
mutation: t,
|
|
48
|
+
variables: { runId: r }
|
|
49
|
+
});
|
|
50
|
+
if (!a) throw Error("No pass returned");
|
|
51
|
+
return s(a.createBotmanorStewardLiveView);
|
|
52
|
+
} catch (e) {
|
|
53
|
+
throw o(e);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export { c as createPassMinter };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=mintPass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintPass.js","names":["FINAL_CODES","toMintError","message","error","CombinedGraphQLErrors","codes","forbidden","c","final","MintError","toPass","expiresAtMs","payload","BotmanorStewardDeskHolder","createPassMinter","mode","client","CreateBotmanorStewardDeskControlDocument","data","CreateBotmanorStewardLiveViewDocument"],"sources":["../../../src/stewards/live/mintPass.ts"],"sourcesContent":["import type { ApolloClient } from '@apollo/client';\nimport { CombinedGraphQLErrors } from '@apollo/client';\nimport {\n CreateBotmanorStewardDeskControlDocument,\n CreateBotmanorStewardLiveViewDocument,\n type CreateBotmanorStewardDeskControlMutation,\n type CreateBotmanorStewardLiveViewMutation,\n} from '../../generated/wspace-operations';\nimport { BotmanorStewardDeskHolder } from '../../generated/wspace-types';\nimport { MintError, type StreamPass } from './DeskStreamConnection';\nimport type { StreamMode } from './protocol';\n\n/** GraphQL error codes where asking again cannot succeed: refusals, not hiccups. */\nconst FINAL_CODES = new Set([\n 'FORBIDDEN',\n 'UNAUTHORIZED',\n 'FEATURE_DISABLED',\n 'BAD_USER_INPUT',\n 'NOT_FOUND',\n 'CONFLICT',\n]);\n\nfunction toMintError(error: unknown): MintError {\n const message = error instanceof Error ? error.message : 'Could not get a live view pass';\n if (CombinedGraphQLErrors.is(error)) {\n const codes = error.errors.map((e) => e.extensions?.code);\n const forbidden = codes.some((c) => c === 'FORBIDDEN' || c === 'UNAUTHORIZED');\n const final = codes.some((c) => typeof c === 'string' && FINAL_CODES.has(c));\n return new MintError(message, { retryable: !final, forbidden });\n }\n // A network failure while minting is worth another try.\n return new MintError(message, { retryable: true });\n}\n\ntype PassPayload =\n | CreateBotmanorStewardLiveViewMutation['createBotmanorStewardLiveView']\n | CreateBotmanorStewardDeskControlMutation['createBotmanorStewardDeskControl'];\n\nfunction toPass(payload: PassPayload): StreamPass {\n const expiresAtMs = Date.parse(payload.expiresAt);\n return {\n token: payload.token,\n relayPath: payload.relayPath,\n mode: payload.mode === 'CONTROL' ? 'control' : 'view',\n expiresAtMs: Number.isFinite(expiresAtMs) ? expiresAtMs : 0,\n holder: payload.heldBy === BotmanorStewardDeskHolder.Person ? 'person' : 'steward',\n };\n}\n\n/**\n * Mints a one-use pass for the relay: `createBotmanorStewardDeskControl` for control (the caller\n * must have taken the run over) and `createBotmanorStewardLiveView` for watching. Mutations are\n * never cached, so a pass is never replayed from the Apollo cache.\n */\nexport function createPassMinter(client: ApolloClient, runId: string) {\n return async (mode: StreamMode): Promise<StreamPass> => {\n try {\n if (mode === 'control') {\n const { data } = await client.mutate<CreateBotmanorStewardDeskControlMutation>({\n mutation: CreateBotmanorStewardDeskControlDocument,\n variables: { runId },\n });\n if (!data) throw new Error('No pass returned');\n return toPass(data.createBotmanorStewardDeskControl);\n }\n const { data } = await client.mutate<CreateBotmanorStewardLiveViewMutation>({\n mutation: CreateBotmanorStewardLiveViewDocument,\n variables: { runId },\n });\n if (!data) throw new Error('No pass returned');\n return toPass(data.createBotmanorStewardLiveView);\n } catch (error) {\n throw toMintError(error);\n }\n };\n}\n"],"mappings":";;;;;AAaA,IAAMA,oBAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAASC,EAAY,GAA2B;CAC9C,IAAMC,IAAUC,aAAiB,QAAQA,EAAM,UAAU;CACzD,IAAIC,EAAsB,GAAGD,CAAK,GAAG;EACnC,IAAME,IAAQF,EAAM,OAAO,KAAK,MAAM,EAAE,YAAY,IAAI,GAClDG,IAAYD,EAAM,MAAM,MAAME,MAAM,eAAeA,MAAM,cAAc,GACvEC,IAAQH,EAAM,MAAM,MAAM,OAAOE,KAAM,YAAYP,EAAY,IAAIO,CAAC,CAAC;EAC3E,OAAO,IAAIE,EAAUP,GAAS;GAAE,WAAW,CAACM;GAAO;EAAU,CAAC;CAChE;CAEA,OAAO,IAAIC,EAAUP,GAAS,EAAE,WAAW,GAAK,CAAC;AACnD;AAMA,SAASQ,EAAO,GAAkC;CAChD,IAAMC,IAAc,KAAK,MAAMC,EAAQ,SAAS;CAChD,OAAO;EACL,OAAOA,EAAQ;EACf,WAAWA,EAAQ;EACnB,MAAMA,EAAQ,SAAS,YAAY,YAAY;EAC/C,aAAa,OAAO,SAASD,CAAW,IAAIA,IAAc;EAC1D,QAAQC,EAAQ,WAAWC,EAA0B,SAAS,WAAW;CAC3E;AACF;AAOA,SAAgBC,EAAiB,GAAsB,GAAe;CACpE,OAAO,OAAO,MAA0C;EACtD,IAAI;GACF,IAAIC,MAAS,WAAW;IACtB,IAAM,EAAE,YAAS,MAAMC,EAAO,OAAiD;KAC7E,UAAUC;KACV,WAAW,EAAE,SAAM;IACrB,CAAC;IACD,IAAI,CAACC,GAAM,MAAU,MAAM,kBAAkB;IAC7C,OAAOR,EAAOQ,EAAK,gCAAgC;GACrD;GACA,IAAM,EAAE,YAAS,MAAMF,EAAO,OAA8C;IAC1E,UAAUG;IACV,WAAW,EAAE,SAAM;GACrB,CAAC;GACD,IAAI,CAACD,GAAM,MAAU,MAAM,kBAAkB;GAC7C,OAAOR,EAAOQ,EAAK,6BAA6B;EAClD,SAASf,GAAO;GACd,MAAMF,EAAYE,CAAK;EACzB;CACF;AACF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contract of the gateway's `/steward-desk` relay (BOFF-16552), as the viewer sees it.
|
|
3
|
+
* Source of truth: wspace-public-gateway `docs/steward-desk-relay.md` and `src/steward-desk/relay.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Credentials travel in the first client frame because a browser WebSocket cannot set headers.
|
|
6
|
+
* Everything after `ready` is opaque desk traffic. The relay never inspects it, and neither does
|
|
7
|
+
* this module: input frames are built here and written to the socket, never stored or logged.
|
|
8
|
+
*/
|
|
9
|
+
/** The exact text the relay treats as a keepalive; any other client frame is desk input. */
|
|
10
|
+
export declare const KEEPALIVE_FRAME = "{\"type\":\"keepalive\"}";
|
|
11
|
+
export type StreamMode = 'view' | 'control';
|
|
12
|
+
/** Why a stream is not running, as the UI explains it. */
|
|
13
|
+
export type StreamEndReason = 'leaseEnded' | 'idle' | 'forbidden' | 'notFound' | 'signIn' | 'badRequest' | 'tooMany' | 'unavailable' | 'mintFailed';
|
|
14
|
+
/** What the viewer does after a close code. */
|
|
15
|
+
export type CloseAction = {
|
|
16
|
+
kind: 'ended';
|
|
17
|
+
reason: StreamEndReason;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'failed';
|
|
20
|
+
reason: StreamEndReason;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'renewOrSignIn';
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'reconnect';
|
|
25
|
+
};
|
|
26
|
+
/** Map a relay close code to the next step. Unknown and abnormal codes reconnect with backoff. */
|
|
27
|
+
export declare function classifyClose(code: number): CloseAction;
|
|
28
|
+
/**
|
|
29
|
+
* `wss://<gateway host><relayPath>`. The relay path comes from the API, so it is checked before a
|
|
30
|
+
* credential is sent to it: it must be an absolute path on the gateway, never another host.
|
|
31
|
+
* Returns null for anything else.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildRelayUrl(gatewayBaseUrl: string, relayPath: string): string | null;
|
|
34
|
+
export interface ConnectCredentials {
|
|
35
|
+
token: string;
|
|
36
|
+
authorization: string;
|
|
37
|
+
workspaceAuthorization: string;
|
|
38
|
+
}
|
|
39
|
+
/** The first frame. Built at send time so the pass is not kept around afterwards. */
|
|
40
|
+
export declare function connectFrame(credentials: ConnectCredentials): string;
|
|
41
|
+
export interface ReadyFrame {
|
|
42
|
+
mode: StreamMode;
|
|
43
|
+
expiresAt: number;
|
|
44
|
+
}
|
|
45
|
+
/** The relay's `ready` message, or null when the text is anything else. */
|
|
46
|
+
export declare function parseReady(text: string): ReadyFrame | null;
|
|
47
|
+
/** Longest binary frame the viewer will decode, matching the relay's own ceiling. */
|
|
48
|
+
export declare const MAX_FRAME_BYTES: number;
|
|
49
|
+
export type ImageMime = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
50
|
+
/** The image type of a binary frame from its leading bytes, or null when it is not an image. */
|
|
51
|
+
export declare function sniffImageMime(bytes: Uint8Array): ImageMime | null;
|
|
52
|
+
export type PointerAction = 'move' | 'down' | 'up';
|
|
53
|
+
export type DeskInput = {
|
|
54
|
+
type: 'pointer';
|
|
55
|
+
action: PointerAction;
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
button: number;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'wheel';
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
dx: number;
|
|
64
|
+
dy: number;
|
|
65
|
+
} | {
|
|
66
|
+
type: 'key';
|
|
67
|
+
action: 'down' | 'up';
|
|
68
|
+
key: string;
|
|
69
|
+
code: string;
|
|
70
|
+
};
|
|
71
|
+
/** A position inside the rendered screen, as a fraction of its width and height. */
|
|
72
|
+
export declare function normalisePoint(rect: {
|
|
73
|
+
left: number;
|
|
74
|
+
top: number;
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
}, clientX: number, clientY: number): {
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
};
|
|
81
|
+
export declare function encodeInput(input: DeskInput): string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// src/stewards/live/protocol.ts
|
|
2
|
+
var e = {
|
|
3
|
+
BAD_REQUEST: 4400,
|
|
4
|
+
UNAUTHORIZED: 4401,
|
|
5
|
+
FORBIDDEN: 4403,
|
|
6
|
+
NOT_FOUND: 4404,
|
|
7
|
+
IDLE: 4408,
|
|
8
|
+
LEASE_ENDED: 4410,
|
|
9
|
+
TOO_MANY: 4429,
|
|
10
|
+
UNAVAILABLE: 4503,
|
|
11
|
+
GATEWAY_RESTART: 1012
|
|
12
|
+
}, t = "{\"type\":\"keepalive\"}";
|
|
13
|
+
function n(t) {
|
|
14
|
+
switch (t) {
|
|
15
|
+
case e.LEASE_ENDED: return {
|
|
16
|
+
kind: "ended",
|
|
17
|
+
reason: "leaseEnded"
|
|
18
|
+
};
|
|
19
|
+
case e.IDLE: return {
|
|
20
|
+
kind: "ended",
|
|
21
|
+
reason: "idle"
|
|
22
|
+
};
|
|
23
|
+
case e.FORBIDDEN: return {
|
|
24
|
+
kind: "failed",
|
|
25
|
+
reason: "forbidden"
|
|
26
|
+
};
|
|
27
|
+
case e.NOT_FOUND: return {
|
|
28
|
+
kind: "failed",
|
|
29
|
+
reason: "notFound"
|
|
30
|
+
};
|
|
31
|
+
case e.BAD_REQUEST: return {
|
|
32
|
+
kind: "failed",
|
|
33
|
+
reason: "badRequest"
|
|
34
|
+
};
|
|
35
|
+
case e.UNAUTHORIZED: return { kind: "renewOrSignIn" };
|
|
36
|
+
default: return { kind: "reconnect" };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function r(e, t) {
|
|
40
|
+
if (!/^\/[A-Za-z0-9._~\-/]*$/.test(t) || t.includes("//") || t.split("/").some((e) => e === ".." || e === ".")) return null;
|
|
41
|
+
let n;
|
|
42
|
+
try {
|
|
43
|
+
n = new URL(e);
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return n.protocol !== "https:" && n.protocol !== "http:" ? null : `${n.protocol === "https:" ? "wss:" : "ws:"}//${n.host}${t}`;
|
|
48
|
+
}
|
|
49
|
+
function i(e) {
|
|
50
|
+
return JSON.stringify({
|
|
51
|
+
type: "connect",
|
|
52
|
+
...e
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function a(e) {
|
|
56
|
+
let t;
|
|
57
|
+
try {
|
|
58
|
+
t = JSON.parse(e);
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (typeof t != "object" || !t) return null;
|
|
63
|
+
let { type: n, mode: r, expiresAt: i } = t;
|
|
64
|
+
return n !== "ready" || r !== "view" && r !== "control" || typeof i != "number" || !Number.isFinite(i) ? null : {
|
|
65
|
+
mode: r,
|
|
66
|
+
expiresAt: i
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
var o = 16777216;
|
|
70
|
+
function s(e) {
|
|
71
|
+
return e.length >= 8 && e[0] === 137 && e[1] === 80 && e[2] === 78 && e[3] === 71 ? "image/png" : e.length >= 3 && e[0] === 255 && e[1] === 216 && e[2] === 255 ? "image/jpeg" : e.length >= 12 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ? "image/webp" : null;
|
|
72
|
+
}
|
|
73
|
+
var c = (e) => Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 0;
|
|
74
|
+
function l(e, t, n) {
|
|
75
|
+
return e.width <= 0 || e.height <= 0 ? {
|
|
76
|
+
x: 0,
|
|
77
|
+
y: 0
|
|
78
|
+
} : {
|
|
79
|
+
x: c((t - e.left) / e.width),
|
|
80
|
+
y: c((n - e.top) / e.height)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function u(e) {
|
|
84
|
+
return JSON.stringify(e);
|
|
85
|
+
}
|
|
86
|
+
export { t as KEEPALIVE_FRAME, o as MAX_FRAME_BYTES, r as buildRelayUrl, n as classifyClose, i as connectFrame, u as encodeInput, l as normalisePoint, a as parseReady, s as sniffImageMime };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","names":["RELAY_CLOSE","KEEPALIVE_FRAME","classifyClose","code","buildRelayUrl","relayPath","segment","base","gatewayBaseUrl","connectFrame","credentials","parseReady","value","text","type","mode","expiresAt","MAX_FRAME_BYTES","sniffImageMime","bytes","clamp01","n","normalisePoint","rect","clientX","clientY","encodeInput","input"],"sources":["../../../src/stewards/live/protocol.ts"],"sourcesContent":["/**\n * Wire contract of the gateway's `/steward-desk` relay (BOFF-16552), as the viewer sees it.\n * Source of truth: wspace-public-gateway `docs/steward-desk-relay.md` and `src/steward-desk/relay.ts`.\n *\n * Credentials travel in the first client frame because a browser WebSocket cannot set headers.\n * Everything after `ready` is opaque desk traffic. The relay never inspects it, and neither does\n * this module: input frames are built here and written to the socket, never stored or logged.\n */\n\n/** Close codes the relay uses. 1012 is a gateway restart. */\nconst RELAY_CLOSE = {\n BAD_REQUEST: 4400,\n UNAUTHORIZED: 4401,\n FORBIDDEN: 4403,\n NOT_FOUND: 4404,\n IDLE: 4408,\n LEASE_ENDED: 4410,\n TOO_MANY: 4429,\n UNAVAILABLE: 4503,\n GATEWAY_RESTART: 1012,\n} as const;\n\n/** The exact text the relay treats as a keepalive; any other client frame is desk input. */\nexport const KEEPALIVE_FRAME = '{\"type\":\"keepalive\"}';\n\nexport type StreamMode = 'view' | 'control';\n\n/** Why a stream is not running, as the UI explains it. */\nexport type StreamEndReason =\n | 'leaseEnded'\n | 'idle'\n | 'forbidden'\n | 'notFound'\n | 'signIn'\n | 'badRequest'\n | 'tooMany'\n | 'unavailable'\n | 'mintFailed';\n\n/** What the viewer does after a close code. */\nexport type CloseAction =\n | { kind: 'ended'; reason: StreamEndReason }\n | { kind: 'failed'; reason: StreamEndReason }\n | { kind: 'renewOrSignIn' }\n | { kind: 'reconnect' };\n\n/** Map a relay close code to the next step. Unknown and abnormal codes reconnect with backoff. */\nexport function classifyClose(code: number): CloseAction {\n switch (code) {\n case RELAY_CLOSE.LEASE_ENDED:\n return { kind: 'ended', reason: 'leaseEnded' };\n case RELAY_CLOSE.IDLE:\n return { kind: 'ended', reason: 'idle' };\n case RELAY_CLOSE.FORBIDDEN:\n return { kind: 'failed', reason: 'forbidden' };\n case RELAY_CLOSE.NOT_FOUND:\n return { kind: 'failed', reason: 'notFound' };\n case RELAY_CLOSE.BAD_REQUEST:\n return { kind: 'failed', reason: 'badRequest' };\n case RELAY_CLOSE.UNAUTHORIZED:\n return { kind: 'renewOrSignIn' };\n default:\n // 4429, 4503, 1006 (dropped), 1011, 1012 (gateway restart) and anything unknown.\n return { kind: 'reconnect' };\n }\n}\n\n/**\n * `wss://<gateway host><relayPath>`. The relay path comes from the API, so it is checked before a\n * credential is sent to it: it must be an absolute path on the gateway, never another host.\n * Returns null for anything else.\n */\nexport function buildRelayUrl(gatewayBaseUrl: string, relayPath: string): string | null {\n if (!/^\\/[A-Za-z0-9._~\\-/]*$/.test(relayPath) || relayPath.includes('//')) return null;\n if (relayPath.split('/').some((segment) => segment === '..' || segment === '.')) return null;\n let base: URL;\n try {\n base = new URL(gatewayBaseUrl);\n } catch {\n return null;\n }\n if (base.protocol !== 'https:' && base.protocol !== 'http:') return null;\n const protocol = base.protocol === 'https:' ? 'wss:' : 'ws:';\n return `${protocol}//${base.host}${relayPath}`;\n}\n\nexport interface ConnectCredentials {\n token: string;\n authorization: string;\n workspaceAuthorization: string;\n}\n\n/** The first frame. Built at send time so the pass is not kept around afterwards. */\nexport function connectFrame(credentials: ConnectCredentials): string {\n return JSON.stringify({ type: 'connect', ...credentials });\n}\n\nexport interface ReadyFrame {\n mode: StreamMode;\n expiresAt: number;\n}\n\n/** The relay's `ready` message, or null when the text is anything else. */\nexport function parseReady(text: string): ReadyFrame | null {\n let value: unknown;\n try {\n value = JSON.parse(text);\n } catch {\n return null;\n }\n if (typeof value !== 'object' || value === null) return null;\n const { type, mode, expiresAt } = value as Record<string, unknown>;\n if (type !== 'ready' || (mode !== 'view' && mode !== 'control')) return null;\n if (typeof expiresAt !== 'number' || !Number.isFinite(expiresAt)) return null;\n return { mode, expiresAt };\n}\n\n// ---------------------------------------------------------------------------\n// Desk frames and input\n//\n// The relay passes desk frames through untouched, so the format is agreed with the desk plugin\n// (BOFF-16145). This viewer renders a binary frame as one screen image (PNG, JPEG or WebP) and\n// ignores text frames it does not know. Input goes the other way as small JSON messages with\n// pointer positions normalised to 0..1 of the screen, so they do not depend on the image size.\n// ---------------------------------------------------------------------------\n\n/** Longest binary frame the viewer will decode, matching the relay's own ceiling. */\nexport const MAX_FRAME_BYTES = 16 * 1024 * 1024;\n\nexport type ImageMime = 'image/png' | 'image/jpeg' | 'image/webp';\n\n/** The image type of a binary frame from its leading bytes, or null when it is not an image. */\nexport function sniffImageMime(bytes: Uint8Array): ImageMime | null {\n if (\n bytes.length >= 8 &&\n bytes[0] === 0x89 &&\n bytes[1] === 0x50 &&\n bytes[2] === 0x4e &&\n bytes[3] === 0x47\n ) {\n return 'image/png';\n }\n if (bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {\n return 'image/jpeg';\n }\n if (\n bytes.length >= 12 &&\n bytes[0] === 0x52 && // R\n bytes[1] === 0x49 && // I\n bytes[2] === 0x46 && // F\n bytes[3] === 0x46 && // F\n bytes[8] === 0x57 && // W\n bytes[9] === 0x45 && // E\n bytes[10] === 0x42 && // B\n bytes[11] === 0x50 // P\n ) {\n return 'image/webp';\n }\n return null;\n}\n\nexport type PointerAction = 'move' | 'down' | 'up';\n\nexport type DeskInput =\n | { type: 'pointer'; action: PointerAction; x: number; y: number; button: number }\n | { type: 'wheel'; x: number; y: number; dx: number; dy: number }\n | { type: 'key'; action: 'down' | 'up'; key: string; code: string };\n\nconst clamp01 = (n: number): number => (Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0);\n\n/** A position inside the rendered screen, as a fraction of its width and height. */\nexport function normalisePoint(\n rect: { left: number; top: number; width: number; height: number },\n clientX: number,\n clientY: number\n): { x: number; y: number } {\n if (rect.width <= 0 || rect.height <= 0) return { x: 0, y: 0 };\n return {\n x: clamp01((clientX - rect.left) / rect.width),\n y: clamp01((clientY - rect.top) / rect.height),\n };\n}\n\nexport function encodeInput(input: DeskInput): string {\n return JSON.stringify(input);\n}\n"],"mappings":";AAUA,IAAMA,IAAc;CAClB,aAAa;CACb,cAAc;CACd,WAAW;CACX,WAAW;CACX,MAAM;CACN,aAAa;CACb,UAAU;CACV,aAAa;CACb,iBAAiB;AACnB,GAGaC,IAAkB;AAwB/B,SAAgBC,EAAc,GAA2B;CACvD,QAAQC,GAAR;EACE,KAAKH,EAAY,aACf,OAAO;GAAE,MAAM;GAAS,QAAQ;EAAa;EAC/C,KAAKA,EAAY,MACf,OAAO;GAAE,MAAM;GAAS,QAAQ;EAAO;EACzC,K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ACbA,EAAM,OAAO,KAEN,cAELA,EAAM,UAAU,KAAKA,EAAM,OAAO,OAAQA,EAAM,OAAO,OAAQA,EAAM,OAAO,MACvE,eAGPA,EAAM,UAAU,MAChBA,EAAM,OAAO,MACbA,EAAM,OAAO,MACbA,EAAM,OAAO,MACbA,EAAM,OAAO,MACbA,EAAM,OAAO,MACbA,EAAM,OAAO,MACbA,EAAM,QAAQ,MACdA,EAAM,QAAQ,KAEP,eAEF;AACT;AASA,IAAMC,KAAW,MAAuB,OAAO,SAASC,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGA,CAAC,CAAC,IAAI;AAG3F,SAAgBC,EACd,GACA,GACA,GAC0B;CAE1B,OADIC,EAAK,SAAS,KAAKA,EAAK,UAAU,IAAU;EAAE,GAAG;EAAG,GAAG;CAAE,IACtD;EACL,GAAGH,GAASI,IAAUD,EAAK,QAAQA,EAAK,KAAK;EAC7C,GAAGH,GAASK,IAAUF,EAAK,OAAOA,EAAK,MAAM;CAC/C;AACF;AAEA,SAAgBG,EAAY,GAA0B;CACpD,OAAO,KAAK,UAAUC,CAAK;AAC7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FrameSink } from './browserConnection';
|
|
2
|
+
import { StreamState } from './DeskStreamConnection';
|
|
3
|
+
import { StreamMode } from './protocol';
|
|
4
|
+
export type { FrameSink };
|
|
5
|
+
export interface DeskStream {
|
|
6
|
+
state: StreamState;
|
|
7
|
+
start: (mode: StreamMode) => void;
|
|
8
|
+
stop: () => void;
|
|
9
|
+
/** Write one input frame; false when the stream is not live control. */
|
|
10
|
+
send: (frame: string) => boolean;
|
|
11
|
+
/** Where desk frames go (the canvas). Frames are not kept in React state. */
|
|
12
|
+
setFrameSink: (sink: FrameSink | null) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Thin React binding over `DeskStreamConnection`: one connection per run, closed on unmount.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useDeskStream(runId: string): DeskStream;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createBrowserConnection as e } from "./browserConnection.js";
|
|
2
|
+
import { INITIAL_STREAM_STATE as t } from "./DeskStreamConnection.js";
|
|
3
|
+
import { useEffect as n, useMemo as r, useSyncExternalStore as i } from "react";
|
|
4
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
5
|
+
import { useAuthTokenOrNull as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
6
|
+
// src/stewards/live/useDeskStream.ts
|
|
7
|
+
function s(s) {
|
|
8
|
+
let c = a(), l = o(), u = r(() => e(c, s), [c, s]);
|
|
9
|
+
n(() => {
|
|
10
|
+
u.setSession(l);
|
|
11
|
+
}, [u, l]), n(() => () => u.connection.stop(), [u]);
|
|
12
|
+
let { connection: d } = u;
|
|
13
|
+
return {
|
|
14
|
+
state: i(d.subscribe, d.getState, () => t),
|
|
15
|
+
...r(() => ({
|
|
16
|
+
start: (e) => d.start(e),
|
|
17
|
+
stop: () => d.stop(),
|
|
18
|
+
send: (e) => d.send(e),
|
|
19
|
+
setFrameSink: u.setFrameSink
|
|
20
|
+
}), [d, u])
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export { s as useDeskStream };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=useDeskStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeskStream.js","names":["useDeskStream","client","useApolloClient","auth","useAuthTokenOrNull","bundle","useMemo","createBrowserConnection","runId","useEffect","useSyncExternalStore","connection","INITIAL_STREAM_STATE","mode","frame"],"sources":["../../../src/stewards/live/useDeskStream.ts"],"sourcesContent":["import { useEffect, useMemo, useSyncExternalStore } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useAuthTokenOrNull } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { createBrowserConnection, type FrameSink } from './browserConnection';\nimport { INITIAL_STREAM_STATE, type StreamState } from './DeskStreamConnection';\nimport type { StreamMode } from './protocol';\n\nexport type { FrameSink };\n\nexport interface DeskStream {\n state: StreamState;\n start: (mode: StreamMode) => void;\n stop: () => void;\n /** Write one input frame; false when the stream is not live control. */\n send: (frame: string) => boolean;\n /** Where desk frames go (the canvas). Frames are not kept in React state. */\n setFrameSink: (sink: FrameSink | null) => void;\n}\n\n/**\n * Thin React binding over `DeskStreamConnection`: one connection per run, closed on unmount.\n */\nexport function useDeskStream(runId: string): DeskStream {\n const client = useApolloClient();\n const auth = useAuthTokenOrNull();\n const bundle = useMemo(() => createBrowserConnection(client, runId), [client, runId]);\n\n useEffect(() => {\n bundle.setSession(auth);\n }, [bundle, auth]);\n useEffect(() => () => bundle.connection.stop(), [bundle]);\n\n const { connection } = bundle;\n const state = useSyncExternalStore(\n connection.subscribe,\n connection.getState,\n () => INITIAL_STREAM_STATE\n );\n // Stable identities: the panel's connect effect depends on `start` and `stop`.\n const actions = useMemo(\n () => ({\n start: (mode: StreamMode) => connection.start(mode),\n stop: () => connection.stop(),\n send: (frame: string) => connection.send(frame),\n setFrameSink: bundle.setFrameSink,\n }),\n [connection, bundle]\n );\n return { state, ...actions };\n}\n"],"mappings":";;;;;;AAsBA,SAAgBA,EAAc,GAA2B;CACvD,IAAMC,IAASC,EAAgB,GACzBC,IAAOC,EAAmB,GAC1BC,IAASC,QAAcC,EAAwBN,GAAQO,CAAK,GAAG,CAACP,GAAQO,CAAK,CAAC;CAKpF,AAHAC,QAAgB;EACd,EAAO,WAAWN,CAAI;CACxB,GAAG,CAACE,GAAQF,CAAI,CAAC,GACjBM,cAAsBJ,EAAO,WAAW,KAAK,GAAG,CAACA,CAAM,CAAC;CAExD,IAAM,EAAE,kBAAeA;CAgBvB,OAAO;EAAE,OAfKK,EACZC,EAAW,WACXA,EAAW,gBACLC,CAYC;EAAO,GATAN,SACP;GACL,QAAQ,MAAqBK,EAAW,MAAME,CAAI;GAClD,YAAYF,EAAW,KAAK;GAC5B,OAAO,MAAkBA,EAAW,KAAKG,CAAK;GAC9C,cAAcT,EAAO;EACvB,IACA,CAACM,GAAYN,CAAM,CAEF;CAAQ;AAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function StewardDutiesPage(): import('react').JSX.Element;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { useListBotmanorStewardDutiesQuery as e, useListBotmanorStewardPlaybooksQuery as t, useRotateBotmanorStewardDutyTokenMutation as n, useSetBotmanorStewardDutyStatusMutation as r } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { BotmanorStewardDutyKind as i, BotmanorStewardDutyStatus as a, BotmanorStewardPlaybookStatus as o } from "../../generated/wspace-types.js";
|
|
3
|
+
import { DutyEditor as s } from "../components/DutyEditor.js";
|
|
4
|
+
import { ProposalsQueue as c } from "../components/ProposalsQueue.js";
|
|
5
|
+
import { Alert as l, Badge as u, Button as d, Card as f, StateMessage as p } from "../components/ui.js";
|
|
6
|
+
import { useStewardsT as m } from "../i18n/useStewardsT.js";
|
|
7
|
+
import { useStewardAbilities as h } from "../permissions/useStewardPermissions.js";
|
|
8
|
+
import { clockTime as g, relativeTime as _ } from "../utils/dates.js";
|
|
9
|
+
import { usesEventType as v } from "../utils/dutyForm.js";
|
|
10
|
+
import { useStewardOutlet as y } from "./StewardLayout.js";
|
|
11
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
12
|
+
import { useState as S } from "react";
|
|
13
|
+
// src/stewards/pages/StewardDutiesPage.tsx
|
|
14
|
+
function C(e) {
|
|
15
|
+
let t = e.schedule?.cron, n = e.triggerConfig?.url, r = e.triggerConfig?.eventType;
|
|
16
|
+
return e.kind === i.Watch && typeof n == "string" ? `${n}${typeof t == "string" ? ` · ${t}` : ""}` : typeof t == "string" ? t : v(e.kind) && typeof r == "string" ? r : "";
|
|
17
|
+
}
|
|
18
|
+
function w() {
|
|
19
|
+
let i = m(), { steward: w } = y(), { canUpdate: T, canExecute: E } = h(), D = w.charter.timezone, [O, k] = S(null), [A, j] = S(null), { data: M, loading: N, error: P } = e({
|
|
20
|
+
variables: { stewardId: w.id },
|
|
21
|
+
fetchPolicy: "cache-and-network"
|
|
22
|
+
}), F = t({ variables: {
|
|
23
|
+
stewardId: w.id,
|
|
24
|
+
status: o.Active
|
|
25
|
+
} }), [I, L] = r({ refetchQueries: ["ListBotmanorStewardDuties"] }), [R, z] = n({ refetchQueries: ["ListBotmanorStewardDuties"] }), B = M?.listBotmanorStewardDuties ?? [], V = L.error ?? z.error, H = (e, t) => void I({ variables: {
|
|
26
|
+
id: e,
|
|
27
|
+
status: t
|
|
28
|
+
} }).catch(() => void 0), U = (e) => void R({ variables: { id: e } }).then((e) => j(e.data?.rotateBotmanorStewardDutyToken.token ?? null)).catch(() => void 0);
|
|
29
|
+
return /* @__PURE__ */ x("div", {
|
|
30
|
+
className: "flex flex-col gap-4",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ x(f, {
|
|
33
|
+
title: i("stewards.duties.title"),
|
|
34
|
+
hint: i("stewards.duties.hint"),
|
|
35
|
+
className: "flex flex-col",
|
|
36
|
+
children: [
|
|
37
|
+
T && O === null && /* @__PURE__ */ b("div", {
|
|
38
|
+
className: "mb-3",
|
|
39
|
+
children: /* @__PURE__ */ b(d, {
|
|
40
|
+
variant: "primary",
|
|
41
|
+
onClick: () => k("new"),
|
|
42
|
+
children: i("stewards.duties.new")
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
A && /* @__PURE__ */ x("div", {
|
|
46
|
+
className: "mb-3 flex flex-col gap-2",
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ x(l, {
|
|
49
|
+
tone: "info",
|
|
50
|
+
children: [
|
|
51
|
+
i("stewards.duties.tokenTitle"),
|
|
52
|
+
": ",
|
|
53
|
+
i("stewards.duties.tokenHint")
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ b("code", {
|
|
57
|
+
className: "rounded-md bg-(--color-bg-muted) p-2 font-mono text-xs break-all text-(color:--color-text-primary)",
|
|
58
|
+
children: A
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ b("div", { children: /* @__PURE__ */ b(d, {
|
|
61
|
+
onClick: () => j(null),
|
|
62
|
+
children: i("stewards.duties.tokenClose")
|
|
63
|
+
}) })
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
66
|
+
P ? /* @__PURE__ */ b(p, {
|
|
67
|
+
kind: "error",
|
|
68
|
+
title: i("stewards.common.errorTitle"),
|
|
69
|
+
body: P.message
|
|
70
|
+
}) : N && B.length === 0 ? /* @__PURE__ */ b(p, {
|
|
71
|
+
kind: "loading",
|
|
72
|
+
title: i("stewards.common.loading")
|
|
73
|
+
}) : B.length === 0 ? /* @__PURE__ */ b(p, {
|
|
74
|
+
kind: "empty",
|
|
75
|
+
title: i("stewards.duties.empty")
|
|
76
|
+
}) : /* @__PURE__ */ b("div", {
|
|
77
|
+
className: "overflow-x-auto",
|
|
78
|
+
children: /* @__PURE__ */ x("table", {
|
|
79
|
+
className: "w-full text-sm",
|
|
80
|
+
"aria-label": i("stewards.duties.title"),
|
|
81
|
+
children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ x("tr", {
|
|
82
|
+
className: "border-b border-(color:--color-border-seam) text-left text-xs text-(color:--color-text-secondary)",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ b("th", {
|
|
85
|
+
scope: "col",
|
|
86
|
+
className: "px-2 py-2 font-medium",
|
|
87
|
+
children: i("stewards.duties.colName")
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ b("th", {
|
|
90
|
+
scope: "col",
|
|
91
|
+
className: "px-2 py-2 font-medium",
|
|
92
|
+
children: i("stewards.duties.colTrigger")
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ b("th", {
|
|
95
|
+
scope: "col",
|
|
96
|
+
className: "px-2 py-2 font-medium",
|
|
97
|
+
children: i("stewards.duties.colNext")
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ b("th", {
|
|
100
|
+
scope: "col",
|
|
101
|
+
className: "px-2 py-2 font-medium",
|
|
102
|
+
children: i("stewards.duties.colLast")
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ b("th", {
|
|
105
|
+
scope: "col",
|
|
106
|
+
className: "px-2 py-2 font-medium",
|
|
107
|
+
children: i("stewards.duties.colStatus")
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ b("th", {
|
|
110
|
+
scope: "col",
|
|
111
|
+
className: "px-2 py-2"
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}) }), /* @__PURE__ */ b("tbody", { children: B.map((e) => /* @__PURE__ */ x("tr", {
|
|
115
|
+
className: "border-b border-(color:--color-border-seam) align-top",
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ x("td", {
|
|
118
|
+
className: "px-2 py-2 text-(color:--color-text-primary)",
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ b("div", {
|
|
121
|
+
className: "font-medium",
|
|
122
|
+
children: e.name
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ x("div", {
|
|
125
|
+
className: "flex gap-1 pt-1",
|
|
126
|
+
children: [e.dryRun && /* @__PURE__ */ b(u, { children: i("stewards.duties.dryRun") }), e.hasToken && /* @__PURE__ */ b(u, { children: i("stewards.duties.hasToken") })]
|
|
127
|
+
}),
|
|
128
|
+
e.lastError && /* @__PURE__ */ x("p", {
|
|
129
|
+
className: "pt-1 text-xs text-(color:--color-status-error-text)",
|
|
130
|
+
children: [
|
|
131
|
+
i("stewards.duties.lastError"),
|
|
132
|
+
": ",
|
|
133
|
+
e.lastError
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ x("td", {
|
|
139
|
+
className: "px-2 py-2 text-(color:--color-text-secondary)",
|
|
140
|
+
children: [/* @__PURE__ */ b("div", { children: i(`stewards.duties.kind.${e.kind}`) }), /* @__PURE__ */ b("div", {
|
|
141
|
+
className: "font-mono text-xs break-all",
|
|
142
|
+
children: C(e)
|
|
143
|
+
})]
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ b("td", {
|
|
146
|
+
className: "px-2 py-2 text-(color:--color-text-secondary) tabular-nums",
|
|
147
|
+
children: e.nextRunAt ? g(e.nextRunAt, D) : i("stewards.common.none")
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ b("td", {
|
|
150
|
+
className: "px-2 py-2 text-(color:--color-text-secondary)",
|
|
151
|
+
children: e.lastRunAt ? _(e.lastRunAt) : i("stewards.common.never")
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ b("td", {
|
|
154
|
+
className: "px-2 py-2",
|
|
155
|
+
children: /* @__PURE__ */ b(u, {
|
|
156
|
+
tone: e.status === a.Active ? "success" : "neutral",
|
|
157
|
+
children: i(`stewards.duties.status.${e.status}`)
|
|
158
|
+
})
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ b("td", {
|
|
161
|
+
className: "px-2 py-2",
|
|
162
|
+
children: T && /* @__PURE__ */ x("div", {
|
|
163
|
+
className: "flex flex-wrap justify-end gap-1",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ b(d, {
|
|
166
|
+
onClick: () => k(e),
|
|
167
|
+
children: i("stewards.duties.edit")
|
|
168
|
+
}),
|
|
169
|
+
e.status === a.Active ? /* @__PURE__ */ b(d, {
|
|
170
|
+
disabled: L.loading,
|
|
171
|
+
onClick: () => H(e.id, a.Paused),
|
|
172
|
+
children: i("stewards.duties.pause")
|
|
173
|
+
}) : e.status === a.Paused && /* @__PURE__ */ b(d, {
|
|
174
|
+
disabled: L.loading,
|
|
175
|
+
onClick: () => H(e.id, a.Active),
|
|
176
|
+
children: i("stewards.duties.resume")
|
|
177
|
+
}),
|
|
178
|
+
e.status !== a.Archived && /* @__PURE__ */ b(d, {
|
|
179
|
+
disabled: L.loading,
|
|
180
|
+
onClick: () => H(e.id, a.Archived),
|
|
181
|
+
children: i("stewards.duties.archive")
|
|
182
|
+
}),
|
|
183
|
+
v(e.kind) && /* @__PURE__ */ b(d, {
|
|
184
|
+
disabled: z.loading,
|
|
185
|
+
onClick: () => U(e.id),
|
|
186
|
+
children: i("stewards.duties.token")
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
})
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
}, e.id)) })]
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
V && /* @__PURE__ */ b("div", {
|
|
196
|
+
className: "mt-3",
|
|
197
|
+
children: /* @__PURE__ */ x(l, { children: [
|
|
198
|
+
i("stewards.duties.actionError"),
|
|
199
|
+
" ",
|
|
200
|
+
V.message
|
|
201
|
+
] })
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}),
|
|
205
|
+
O !== null && /* @__PURE__ */ b(s, {
|
|
206
|
+
stewardId: w.id,
|
|
207
|
+
timezone: D,
|
|
208
|
+
duty: O === "new" ? null : O,
|
|
209
|
+
playbooks: F.data?.listBotmanorStewardPlaybooks ?? [],
|
|
210
|
+
onClose: () => k(null)
|
|
211
|
+
}, O === "new" ? "new" : O.id),
|
|
212
|
+
/* @__PURE__ */ b(c, {
|
|
213
|
+
stewardId: w.id,
|
|
214
|
+
canAct: E
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
export { w as StewardDutiesPage };
|
|
220
|
+
|
|
221
|
+
//# sourceMappingURL=StewardDutiesPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StewardDutiesPage.js","names":["triggerSummary","cron","duty","\"cron\"","url","\"url\"","eventType","\"eventType\"","BotmanorStewardDutyKind","usesEventType","StewardDutiesPage","t","useStewardsT","useStewardOutlet","useStewardAbilities","timeZone","steward","editing","setEditing","useState","token","setToken","useListBotmanorStewardDutiesQuery","playbooks","useListBotmanorStewardPlaybooksQuery","BotmanorStewardPlaybookStatus","setStatus","statusState","useSetBotmanorStewardDutyStatusMutation","rotate","rotateState","useRotateBotmanorStewardDutyTokenMutation","duties","data","failure","change","newToken","r","Card","canUpdate","Button","Alert","error","StateMessage","loading","d","Badge","clockTime","relativeTime","BotmanorStewardDutyStatus","DutyEditor","ProposalsQueue","canExecute"],"sources":["../../../src/stewards/pages/StewardDutiesPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n useListBotmanorStewardDutiesQuery,\n useListBotmanorStewardPlaybooksQuery,\n useRotateBotmanorStewardDutyTokenMutation,\n useSetBotmanorStewardDutyStatusMutation,\n type StewardDutyFieldsFragment,\n} from '../../generated/wspace-operations';\nimport {\n BotmanorStewardDutyKind,\n BotmanorStewardDutyStatus,\n BotmanorStewardPlaybookStatus,\n} from '../../generated/wspace-types';\nimport { DutyEditor } from '../components/DutyEditor';\nimport { ProposalsQueue } from '../components/ProposalsQueue';\nimport { Alert, Badge, Button, Card, StateMessage } from '../components/ui';\nimport { useStewardsT } from '../i18n/useStewardsT';\nimport { useStewardAbilities } from '../permissions/useStewardPermissions';\nimport { clockTime, relativeTime } from '../utils/dates';\nimport { usesEventType } from '../utils/dutyForm';\nimport { useStewardOutlet } from './StewardLayout';\n\nfunction triggerSummary(duty: StewardDutyFieldsFragment): string {\n const cron = duty.schedule?.['cron'];\n const url = duty.triggerConfig?.['url'];\n const eventType = duty.triggerConfig?.['eventType'];\n if (duty.kind === BotmanorStewardDutyKind.Watch && typeof url === 'string')\n return `${url}${typeof cron === 'string' ? ` · ${cron}` : ''}`;\n if (typeof cron === 'string') return cron;\n if (usesEventType(duty.kind) && typeof eventType === 'string') return eventType;\n return '';\n}\n\nexport function StewardDutiesPage() {\n const t = useStewardsT();\n const { steward } = useStewardOutlet();\n const { canUpdate, canExecute } = useStewardAbilities();\n const timeZone = steward.charter.timezone;\n const [editing, setEditing] = useState<StewardDutyFieldsFragment | 'new' | null>(null);\n const [token, setToken] = useState<string | null>(null);\n const { data, loading, error } = useListBotmanorStewardDutiesQuery({\n variables: { stewardId: steward.id },\n fetchPolicy: 'cache-and-network',\n });\n const playbooks = useListBotmanorStewardPlaybooksQuery({\n variables: { stewardId: steward.id, status: BotmanorStewardPlaybookStatus.Active },\n });\n const [setStatus, statusState] = useSetBotmanorStewardDutyStatusMutation({\n refetchQueries: ['ListBotmanorStewardDuties'],\n });\n const [rotate, rotateState] = useRotateBotmanorStewardDutyTokenMutation({\n refetchQueries: ['ListBotmanorStewardDuties'],\n });\n const duties: StewardDutyFieldsFragment[] = data?.listBotmanorStewardDuties ?? [];\n const failure = statusState.error ?? rotateState.error;\n const change = (id: string, status: BotmanorStewardDutyStatus) =>\n void setStatus({ variables: { id, status } }).catch(() => undefined);\n const newToken = (id: string) =>\n void rotate({ variables: { id } })\n .then((r) => setToken(r.data?.rotateBotmanorStewardDutyToken.token ?? null))\n .catch(() => undefined);\n\n return (\n <div className=\"flex flex-col gap-4\">\n <Card\n title={t('stewards.duties.title')}\n hint={t('stewards.duties.hint')}\n className=\"flex flex-col\"\n >\n {canUpdate && editing === null && (\n <div className=\"mb-3\">\n <Button variant=\"primary\" onClick={() => setEditing('new')}>\n {t('stewards.duties.new')}\n </Button>\n </div>\n )}\n {token && (\n <div className=\"mb-3 flex flex-col gap-2\">\n <Alert tone=\"info\">\n {t('stewards.duties.tokenTitle')}: {t('stewards.duties.tokenHint')}\n </Alert>\n <code className=\"rounded-md bg-(--color-bg-muted) p-2 font-mono text-xs break-all text-(color:--color-text-primary)\">\n {token}\n </code>\n <div>\n <Button onClick={() => setToken(null)}>{t('stewards.duties.tokenClose')}</Button>\n </div>\n </div>\n )}\n {error ? (\n <StateMessage kind=\"error\" title={t('stewards.common.errorTitle')} body={error.message} />\n ) : loading && duties.length === 0 ? (\n <StateMessage kind=\"loading\" title={t('stewards.common.loading')} />\n ) : duties.length === 0 ? (\n <StateMessage kind=\"empty\" title={t('stewards.duties.empty')} />\n ) : (\n <div className=\"overflow-x-auto\">\n <table className=\"w-full text-sm\" aria-label={t('stewards.duties.title')}>\n <thead>\n <tr className=\"border-b border-(color:--color-border-seam) text-left text-xs text-(color:--color-text-secondary)\">\n <th scope=\"col\" className=\"px-2 py-2 font-medium\">\n {t('stewards.duties.colName')}\n </th>\n <th scope=\"col\" className=\"px-2 py-2 font-medium\">\n {t('stewards.duties.colTrigger')}\n </th>\n <th scope=\"col\" className=\"px-2 py-2 font-medium\">\n {t('stewards.duties.colNext')}\n </th>\n <th scope=\"col\" className=\"px-2 py-2 font-medium\">\n {t('stewards.duties.colLast')}\n </th>\n <th scope=\"col\" className=\"px-2 py-2 font-medium\">\n {t('stewards.duties.colStatus')}\n </th>\n <th scope=\"col\" className=\"px-2 py-2\" />\n </tr>\n </thead>\n <tbody>\n {duties.map((d) => (\n <tr key={d.id} className=\"border-b border-(color:--color-border-seam) align-top\">\n <td className=\"px-2 py-2 text-(color:--color-text-primary)\">\n <div className=\"font-medium\">{d.name}</div>\n <div className=\"flex gap-1 pt-1\">\n {d.dryRun && <Badge>{t('stewards.duties.dryRun')}</Badge>}\n {d.hasToken && <Badge>{t('stewards.duties.hasToken')}</Badge>}\n </div>\n {d.lastError && (\n <p className=\"pt-1 text-xs text-(color:--color-status-error-text)\">\n {t('stewards.duties.lastError')}: {d.lastError}\n </p>\n )}\n </td>\n <td className=\"px-2 py-2 text-(color:--color-text-secondary)\">\n <div>{t(`stewards.duties.kind.${d.kind}`)}</div>\n <div className=\"font-mono text-xs break-all\">{triggerSummary(d)}</div>\n </td>\n <td className=\"px-2 py-2 text-(color:--color-text-secondary) tabular-nums\">\n {d.nextRunAt ? clockTime(d.nextRunAt, timeZone) : t('stewards.common.none')}\n </td>\n <td className=\"px-2 py-2 text-(color:--color-text-secondary)\">\n {d.lastRunAt ? relativeTime(d.lastRunAt) : t('stewards.common.never')}\n </td>\n <td className=\"px-2 py-2\">\n <Badge\n tone={d.status === BotmanorStewardDutyStatus.Active ? 'success' : 'neutral'}\n >\n {t(`stewards.duties.status.${d.status}`)}\n </Badge>\n </td>\n <td className=\"px-2 py-2\">\n {canUpdate && (\n <div className=\"flex flex-wrap justify-end gap-1\">\n <Button onClick={() => setEditing(d)}>{t('stewards.duties.edit')}</Button>\n {d.status === BotmanorStewardDutyStatus.Active ? (\n <Button\n disabled={statusState.loading}\n onClick={() => change(d.id, BotmanorStewardDutyStatus.Paused)}\n >\n {t('stewards.duties.pause')}\n </Button>\n ) : (\n d.status === BotmanorStewardDutyStatus.Paused && (\n <Button\n disabled={statusState.loading}\n onClick={() => change(d.id, BotmanorStewardDutyStatus.Active)}\n >\n {t('stewards.duties.resume')}\n </Button>\n )\n )}\n {d.status !== BotmanorStewardDutyStatus.Archived && (\n <Button\n disabled={statusState.loading}\n onClick={() => change(d.id, BotmanorStewardDutyStatus.Archived)}\n >\n {t('stewards.duties.archive')}\n </Button>\n )}\n {usesEventType(d.kind) && (\n <Button disabled={rotateState.loading} onClick={() => newToken(d.id)}>\n {t('stewards.duties.token')}\n </Button>\n )}\n </div>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n {failure && (\n <div className=\"mt-3\">\n <Alert>\n {t('stewards.duties.actionError')} {failure.message}\n </Alert>\n </div>\n )}\n </Card>\n {editing !== null && (\n <DutyEditor\n key={editing === 'new' ? 'new' : editing.id}\n stewardId={steward.id}\n timezone={timeZone}\n duty={editing === 'new' ? null : editing}\n playbooks={playbooks.data?.listBotmanorStewardPlaybooks ?? []}\n onClose={() => setEditing(null)}\n />\n )}\n <ProposalsQueue stewardId={steward.id} canAct={canExecute} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAASA,EAAe,GAAyC;CAC/D,IAAMC,IAAOC,EAAK,UAAWC,MACvBC,IAAMF,EAAK,eAAgBG,KAC3BC,IAAYJ,EAAK,eAAgBK;CAKvC,OAJIL,EAAK,SAASM,EAAwB,SAAS,OAAOJ,KAAQ,WACzD,GAAGA,IAAM,OAAOH,KAAS,WAAW,MAAMA,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