@opengeni/react 1.0.1 → 2.3.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -10
- package/dist/artifacts-spreadsheet.js +1 -1
- package/dist/artifacts.js +1 -1
- package/dist/browser-viewer-GXUICIAG.js +14 -0
- package/dist/{chunk-R3AZOAB5.js → chunk-4MDLEHXL.js} +9 -115
- package/dist/chunk-4MDLEHXL.js.map +1 -0
- package/dist/chunk-5YK2ZDIG.js +116 -0
- package/dist/chunk-5YK2ZDIG.js.map +1 -0
- package/dist/chunk-H5YGYNXS.js +329 -0
- package/dist/chunk-H5YGYNXS.js.map +1 -0
- package/dist/{chunk-7WCLAEFV.js → chunk-ICA6R6TW.js} +2 -2
- package/dist/{chunk-7WCLAEFV.js.map → chunk-ICA6R6TW.js.map} +1 -1
- package/dist/{chunk-IGC6A2ZI.js → chunk-JOAVA2TW.js} +589 -217
- package/dist/chunk-JOAVA2TW.js.map +1 -0
- package/dist/{chunk-Y7OEDUJ5.js → chunk-LS4POUTY.js} +1057 -426
- package/dist/chunk-LS4POUTY.js.map +1 -0
- package/dist/{chunk-5UQPNLIO.js → chunk-LTCHJ4MS.js} +9 -9
- package/dist/chunk-LTCHJ4MS.js.map +1 -0
- package/dist/{chunk-C5ZPSSS5.js → chunk-NEXLLTP4.js} +2 -1
- package/dist/{chunk-C5ZPSSS5.js.map → chunk-NEXLLTP4.js.map} +1 -1
- package/dist/chunk-QGBJ6GHG.js +2300 -0
- package/dist/chunk-QGBJ6GHG.js.map +1 -0
- package/dist/{chunk-6KLX2RH5.js → chunk-RSXJN73N.js} +365 -21
- package/dist/chunk-RSXJN73N.js.map +1 -0
- package/dist/{chunk-B6WPZSTT.js → chunk-SE4W4WQ3.js} +78 -16
- package/dist/chunk-SE4W4WQ3.js.map +1 -0
- package/dist/{chunk-MKPIAGVL.js → chunk-W6NFJXSA.js} +8 -19
- package/dist/chunk-W6NFJXSA.js.map +1 -0
- package/dist/{chunk-XBZWOM2K.js → chunk-X4A66EWZ.js} +8 -3
- package/dist/chunk-X4A66EWZ.js.map +1 -0
- package/dist/chunk-X4JAFD5R.js +3907 -0
- package/dist/chunk-X4JAFD5R.js.map +1 -0
- package/dist/{chunk-HA46CYQK.js → chunk-XXWH2JLC.js} +792 -206
- package/dist/chunk-XXWH2JLC.js.map +1 -0
- package/dist/client.d.ts +2 -2
- package/dist/components/browser-viewer.d.ts +7 -1
- package/dist/components/computer-viewer.d.ts +4 -1
- package/dist/components/enrollment-consent.d.ts +6 -3
- package/dist/components/file-browser.d.ts +7 -1
- package/dist/components/human-input-form.d.ts +1 -1
- package/dist/components/human-input-surface.d.ts +1 -1
- package/dist/components/machine-card.d.ts +4 -1
- package/dist/components/machines/machine-detail.d.ts +4 -1
- package/dist/components/machines/machine-operation-policy.d.ts +11 -0
- package/dist/components/machines-dashboard.d.ts +3 -1
- package/dist/components/markdown.d.ts +20 -1
- package/dist/components/message-timeline.d.ts +1 -1
- package/dist/components/model-policy-picker.d.ts +2 -0
- package/dist/components/pierre-file.d.ts +1 -1
- package/dist/components/sandbox-files.d.ts +8 -2
- package/dist/components/sandbox-workspace.d.ts +33 -3
- package/dist/components/session-chrome.d.ts +15 -3
- package/dist/components/workspace-dock.d.ts +6 -2
- package/dist/composer.js +5 -5
- package/dist/computer-viewer-ZOP4Q7A7.js +16 -0
- package/dist/computer-viewer-ZOP4Q7A7.js.map +1 -0
- package/dist/hooks/channel-cache.d.ts +23 -0
- package/dist/hooks/shared-machines-list.d.ts +14 -0
- package/dist/hooks/use-attached-browsers.d.ts +2 -1
- package/dist/hooks/use-channels.d.ts +1 -0
- package/dist/hooks/use-composer.d.ts +37 -9
- package/dist/hooks/use-machine-chip.d.ts +3 -3
- package/dist/hooks/use-machines.d.ts +19 -1
- package/dist/hooks/use-sandbox-files.d.ts +1 -0
- package/dist/hooks/use-session-background-commands.d.ts +14 -0
- package/dist/hooks/use-turn-queue.d.ts +12 -0
- package/dist/hooks/use-workspace-sessions.d.ts +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1096 -623
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +29 -181
- package/dist/interaction.js.map +1 -1
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/machines.d.ts +4 -2
- package/dist/machines.js +10 -2
- package/dist/model-policy.d.ts +1 -1
- package/dist/model-policy.js +1 -1
- package/dist/platform-activity-row-BJHUHXAT.js +169 -0
- package/dist/platform-activity-row-BJHUHXAT.js.map +1 -0
- package/dist/{queue-surface-implementation-2KVJTYXH.js → queue-surface-implementation-BSKUWHRI.js} +76 -16
- package/dist/queue-surface-implementation-BSKUWHRI.js.map +1 -0
- package/dist/realtime/realtime-control.d.ts +6 -3
- package/dist/realtime.js +36 -14
- package/dist/realtime.js.map +1 -1
- package/dist/session-ui.d.ts +1 -1
- package/dist/session-ui.js +6 -2
- package/dist/session.d.ts +2 -2
- package/dist/session.js +4 -4
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/platform-activity-row.d.ts +15 -0
- package/dist/timeline/screenshot-lightbox.d.ts +1 -1
- package/dist/timeline/shared.d.ts +4 -2
- package/dist/timeline/types.d.ts +50 -5
- package/dist/types/machines.d.ts +2 -2
- package/package.json +3 -3
- package/src/client.ts +12 -1
- package/src/components/artifacts/editable-spreadsheet.tsx +1 -1
- package/src/components/browser-viewer.tsx +361 -58
- package/src/components/chat-composer.tsx +1 -1
- package/src/components/composer.tsx +6 -6
- package/src/components/computer-viewer.tsx +368 -115
- package/src/components/enrollment-consent.tsx +64 -6
- package/src/components/file-browser.tsx +117 -2
- package/src/components/human-input-form.tsx +103 -59
- package/src/components/human-input-surface.tsx +1 -1
- package/src/components/machine-card.tsx +111 -0
- package/src/components/machine-input-display.ts +15 -0
- package/src/components/machines/machine-detail.tsx +47 -0
- package/src/components/machines/machine-operation-policy.tsx +179 -0
- package/src/components/machines-dashboard.tsx +6 -0
- package/src/components/markdown.tsx +174 -20
- package/src/components/message-timeline.tsx +215 -18
- package/src/components/model-policy-picker.tsx +9 -17
- package/src/components/pierre-file.tsx +1 -1
- package/src/components/queue-surface-implementation.tsx +82 -16
- package/src/components/sandbox-files.tsx +135 -19
- package/src/components/sandbox-workspace.tsx +204 -92
- package/src/components/session-chrome.tsx +415 -208
- package/src/components/session-status.tsx +1 -1
- package/src/components/user-message-body.tsx +168 -48
- package/src/components/workspace-dock.tsx +141 -175
- package/src/hooks/channel-cache.ts +104 -0
- package/src/hooks/shared-machines-list.ts +239 -0
- package/src/hooks/use-attached-browsers.ts +5 -1
- package/src/hooks/use-browser-frame-stream.ts +6 -1
- package/src/hooks/use-browser-session.ts +6 -4
- package/src/hooks/use-browser-sessions.ts +7 -1
- package/src/hooks/use-channels.ts +32 -10
- package/src/hooks/use-composer.ts +760 -291
- package/src/hooks/use-computer-frame-stream.ts +14 -9
- package/src/hooks/use-computer-session.ts +16 -14
- package/src/hooks/use-computer-sessions.ts +8 -1
- package/src/hooks/use-last-started-turn-policy.ts +1 -1
- package/src/hooks/use-machine-chip.ts +23 -6
- package/src/hooks/use-machines.ts +104 -6
- package/src/hooks/use-sandbox-files.ts +195 -140
- package/src/hooks/use-sandbox-git.ts +58 -29
- package/src/hooks/use-session-background-commands.ts +56 -0
- package/src/hooks/use-session-capabilities.ts +18 -0
- package/src/hooks/use-turn-queue.ts +111 -12
- package/src/hooks/use-workspace-sessions.ts +5 -1
- package/src/index.ts +26 -4
- package/src/lib/interaction-errors.ts +18 -0
- package/src/machines.ts +9 -1
- package/src/model-policy.ts +10 -2
- package/src/realtime/realtime-control.tsx +53 -17
- package/src/session-context.ts +1 -0
- package/src/session-ui.ts +6 -1
- package/src/session.ts +9 -1
- package/src/timeline/activity-rail.tsx +20 -75
- package/src/timeline/index.ts +4 -0
- package/src/timeline/platform-activity-row.tsx +201 -0
- package/src/timeline/projection.ts +529 -25
- package/src/timeline/screenshot-lightbox.tsx +48 -14
- package/src/timeline/shared.tsx +8 -2
- package/src/timeline/tool-renderers.tsx +104 -6
- package/src/timeline/turn-summary.tsx +6 -1
- package/src/timeline/types.ts +77 -2
- package/src/types/machines.ts +10 -0
- package/styles/compiled.css +115 -104
- package/dist/chunk-5UQPNLIO.js.map +0 -1
- package/dist/chunk-6KLX2RH5.js.map +0 -1
- package/dist/chunk-B6WPZSTT.js.map +0 -1
- package/dist/chunk-HA46CYQK.js.map +0 -1
- package/dist/chunk-IGC6A2ZI.js.map +0 -1
- package/dist/chunk-LLOLUHVG.js +0 -5937
- package/dist/chunk-LLOLUHVG.js.map +0 -1
- package/dist/chunk-MKPIAGVL.js.map +0 -1
- package/dist/chunk-R3AZOAB5.js.map +0 -1
- package/dist/chunk-XBZWOM2K.js.map +0 -1
- package/dist/chunk-Y7OEDUJ5.js.map +0 -1
- package/dist/interactive-workbench-viewers-TOHBXJEE.js +0 -15
- package/dist/queue-surface-implementation-2KVJTYXH.js.map +0 -1
- /package/dist/{interactive-workbench-viewers-TOHBXJEE.js.map → browser-viewer-GXUICIAG.js.map} +0 -0
|
@@ -17,8 +17,11 @@ export type ComputerViewerProps = EmbeddedComputerInteractionClientOverride & {
|
|
|
17
17
|
/** Host navigation request for one exact ComputerSession. */
|
|
18
18
|
requestedComputerSessionId?: string | null | undefined;
|
|
19
19
|
requestedComputerRequestId?: string | number | null | undefined;
|
|
20
|
+
/** Restore and report the Desktop session selected in this task's dock. */
|
|
21
|
+
initialComputerSessionId?: string | null | undefined;
|
|
22
|
+
onComputerSessionIdChange?: ((computerSessionId: string | null) => void) | undefined;
|
|
20
23
|
};
|
|
21
24
|
/** Full ComputerSession surface: workspace discovery, peer switching, app/window/
|
|
22
25
|
* screen navigation, semantic controls, exact-frame input, and live media. */
|
|
23
|
-
export declare function ComputerViewer({ sessionId, enabled, className, onNotify, webSocketFactory, renderEmpty, requestedComputerSessionId, requestedComputerRequestId, ...override }: ComputerViewerProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
26
|
+
export declare function ComputerViewer({ sessionId, enabled, className, onNotify, webSocketFactory, renderEmpty, requestedComputerSessionId, requestedComputerRequestId, initialComputerSessionId, onComputerSessionIdChange, ...override }: ComputerViewerProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
24
27
|
export declare function computerKey(event: Pick<KeyboardEvent<HTMLTextAreaElement>, "altKey" | "ctrlKey" | "key" | "metaKey" | "shiftKey">): string | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResourceAuthorityScope } from "@opengeni/sdk";
|
|
1
2
|
/** The machine identity surfaced to the approver, from the device-flow start. */
|
|
2
3
|
export type EnrollmentConsentMachine = {
|
|
3
4
|
/** Human-friendly name (hostname by default). */
|
|
@@ -16,8 +17,10 @@ export type EnrollmentConsentProps = {
|
|
|
16
17
|
userCode: string;
|
|
17
18
|
machine: EnrollmentConsentMachine;
|
|
18
19
|
phase?: EnrollmentConsentPhase | undefined;
|
|
19
|
-
/**
|
|
20
|
-
|
|
20
|
+
/** Whether this caller may publish the machine to the whole organization. */
|
|
21
|
+
allowOrganizationScope?: boolean | undefined;
|
|
22
|
+
/** Approve with the chosen screen-control consent and explicit access scope. */
|
|
23
|
+
onApprove?: ((allowScreenControl: boolean, scope: ResourceAuthorityScope) => void) | undefined;
|
|
21
24
|
onDeny?: (() => void) | undefined;
|
|
22
25
|
/** Error message when phase === "error". */
|
|
23
26
|
errorMessage?: string | undefined;
|
|
@@ -30,4 +33,4 @@ export type EnrollmentConsentProps = {
|
|
|
30
33
|
* The danger framing is deliberate (§18 hardening: whole-machine = loud consent),
|
|
31
34
|
* never buried. Renders review / approving / approved / denied / error phases.
|
|
32
35
|
*/
|
|
33
|
-
export declare function EnrollmentConsent({ userCode, machine, phase, onApprove, onDeny, errorMessage, className, }: EnrollmentConsentProps): import("react").JSX.Element;
|
|
36
|
+
export declare function EnrollmentConsent({ userCode, machine, phase, allowOrganizationScope, onApprove, onDeny, errorMessage, className, }: EnrollmentConsentProps): import("react").JSX.Element;
|
|
@@ -11,6 +11,12 @@ export type FileBrowserProps = {
|
|
|
11
11
|
/** Selection callback for the preview pane. */
|
|
12
12
|
onSelectFile?: ((path: string) => void) | undefined;
|
|
13
13
|
selectedPath?: string | undefined;
|
|
14
|
+
/** Deliberately reveal this selected path by lazily opening every loaded
|
|
15
|
+
* ancestor and scrolling its row into view. The path is opaque and is never
|
|
16
|
+
* normalized or re-rooted here. */
|
|
17
|
+
revealPath?: string | undefined;
|
|
18
|
+
/** Increment/change to reveal the same path again after a user collapses it. */
|
|
19
|
+
revealPathRequestId?: string | number | undefined;
|
|
14
20
|
/** Render-prop to theme/replace a row entirely (the Pierre-swap escape hatch). */
|
|
15
21
|
renderNode?: ((node: FileTreeNode, depth: number, expanded: boolean) => ReactNode) | undefined;
|
|
16
22
|
/** Shown when the tree is empty (no files / not loaded yet). */
|
|
@@ -44,4 +50,4 @@ export type FileBrowserProps = {
|
|
|
44
50
|
* `renderNode` is still honoured as the Pierre-swap escape hatch for the row
|
|
45
51
|
* chrome; the manager scaffolding (toolbar, dnd, menu, inline inputs) wraps it.
|
|
46
52
|
*/
|
|
47
|
-
export declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): import("react").JSX.Element;
|
|
53
|
+
export declare function FileBrowser({ result, fallback, onSelectFile, selectedPath, revealPath, revealPathRequestId, renderNode, emptyState, editable, confirmDelete, className, }: FileBrowserProps): import("react").JSX.Element;
|
|
@@ -50,7 +50,7 @@ export type HumanInputFormProps = {
|
|
|
50
50
|
* options, sticky ask/submit chrome. Hosts can replace title/description or
|
|
51
51
|
* use `useHumanInputRequests` headlessly.
|
|
52
52
|
*/
|
|
53
|
-
export declare function HumanInputForm(
|
|
53
|
+
export declare function HumanInputForm(props: HumanInputFormProps): import("react").JSX.Element;
|
|
54
54
|
export declare function answersFromDrafts(questions: HumanInputQuestion[], drafts: Record<string, HumanInputAnswerDraft>, messageOverrides?: Partial<HumanInputFormMessages>): {
|
|
55
55
|
answers: HumanInputAnswer[];
|
|
56
56
|
errors: Record<string, string>;
|
|
@@ -12,7 +12,7 @@ export type HumanInputSurfaceProps = {
|
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* One decision shell for pending structured human-input requests. Parallel
|
|
15
|
-
* freezes are shown one at a time (oldest first) as “N of M”;
|
|
15
|
+
* freezes are shown one at a time (oldest first) as “N of M”; Send answers/Skip
|
|
16
16
|
* settles the active request and the next remaining set advances automatically
|
|
17
17
|
* when the authoritative pending list updates.
|
|
18
18
|
*/
|
|
@@ -5,6 +5,9 @@ export type MachineCardProps = {
|
|
|
5
5
|
onAttach?: ((machine: MachineView) => void) | undefined;
|
|
6
6
|
/** Whether an attach/swap is currently in flight (disables the affordance). */
|
|
7
7
|
attaching?: boolean | undefined;
|
|
8
|
+
/** Start/retry the exact signed Connected Machine agent update. */
|
|
9
|
+
onUpdateAgent?: ((machine: MachineView) => void) | undefined;
|
|
10
|
+
updatingAgent?: boolean | undefined;
|
|
8
11
|
/** Short recent history (e.g. 15m) — drives the card's CPU trend + preview. */
|
|
9
12
|
series?: MetricSample[] | undefined;
|
|
10
13
|
/** Open the full per-machine telemetry detail. Makes the whole card actionable. */
|
|
@@ -18,4 +21,4 @@ export type MachineCardProps = {
|
|
|
18
21
|
* freshness, and attach/swap. The whole card opens the telemetry detail when
|
|
19
22
|
* `onOpenDetail` is wired. The session's active sandbox carries an accent edge.
|
|
20
23
|
*/
|
|
21
|
-
export declare function MachineCard({ machine, onAttach, attaching, series, onOpenDetail, now, className, }: MachineCardProps): import("react").JSX.Element;
|
|
24
|
+
export declare function MachineCard({ machine, onAttach, attaching, onUpdateAgent, updatingAgent, series, onOpenDetail, now, className, }: MachineCardProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MachineView, MetricSample } from "../../types/machines.js";
|
|
2
2
|
import { type MetricWindow } from "./series.js";
|
|
3
|
+
import type { UpdateMachineOperationPolicyRequest } from "@opengeni/sdk";
|
|
3
4
|
export type MachineDetailProps = {
|
|
4
5
|
machine: MachineView;
|
|
5
6
|
/** Downsampled history for the active window (from `fetchSeries`). */
|
|
@@ -10,7 +11,9 @@ export type MachineDetailProps = {
|
|
|
10
11
|
onBack?: (() => void) | undefined;
|
|
11
12
|
/** Open the workspace-admin removal confirmation for a self-hosted machine. */
|
|
12
13
|
onRemove?: ((machine: MachineView) => void) | undefined;
|
|
14
|
+
onUpdateOperationPolicy?: ((machine: MachineView, request: UpdateMachineOperationPolicyRequest) => Promise<unknown>) | undefined;
|
|
15
|
+
updatingOperationPolicy?: boolean | undefined;
|
|
13
16
|
now?: number | undefined;
|
|
14
17
|
className?: string | undefined;
|
|
15
18
|
};
|
|
16
|
-
export declare function MachineDetail({ machine, series, window, onWindowChange, loadingSeries, onBack, onRemove, now, className, }: MachineDetailProps): import("react").JSX.Element;
|
|
19
|
+
export declare function MachineDetail({ machine, series, window, onWindowChange, loadingSeries, onBack, onRemove, onUpdateOperationPolicy, updatingOperationPolicy, now, className, }: MachineDetailProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MachineOperationPolicy, UpdateMachineOperationPolicyRequest } from "@opengeni/sdk";
|
|
2
|
+
export type MachineOperationPolicyEditorProps = {
|
|
3
|
+
policy: MachineOperationPolicy;
|
|
4
|
+
memorySupported: boolean;
|
|
5
|
+
cpuSupported: boolean;
|
|
6
|
+
saving?: boolean | undefined;
|
|
7
|
+
onSave: (request: UpdateMachineOperationPolicyRequest) => Promise<unknown> | unknown;
|
|
8
|
+
};
|
|
9
|
+
/** Exact editor for the optional per-enrollment command resource policy. Blank
|
|
10
|
+
* values remain genuinely unrestricted; CPU is a period-independent ratio. */
|
|
11
|
+
export declare function MachineOperationPolicyEditor({ policy, memorySupported, cpuSupported, saving, onSave, }: MachineOperationPolicyEditorProps): import("react").JSX.Element;
|
|
@@ -9,6 +9,8 @@ export type MachinesDashboardProps = {
|
|
|
9
9
|
onAttach?: ((machine: MachineView) => void) | undefined;
|
|
10
10
|
/** The sandbox id currently being attached/swapped to (disables that card). */
|
|
11
11
|
attachingSandboxId?: string | null | undefined;
|
|
12
|
+
onUpdateAgent?: ((machine: MachineView) => void) | undefined;
|
|
13
|
+
updatingEnrollmentId?: string | null | undefined;
|
|
12
14
|
/** Short recent history per machine (keyed by sandboxId) — drives card sparklines. */
|
|
13
15
|
seriesByMachine?: Record<string, MetricSample[]> | undefined;
|
|
14
16
|
/** Open the per-machine telemetry detail (makes each card actionable). */
|
|
@@ -27,4 +29,4 @@ export type MachinesDashboardProps = {
|
|
|
27
29
|
* machines → connect CTA), a load error, and the populated grid. The component
|
|
28
30
|
* is purely presentational — feed it `MachinesResponse` data via `useMachines`.
|
|
29
31
|
*/
|
|
30
|
-
export declare function MachinesDashboard({ machines, activeSandboxId, loading, error, onAttach, attachingSandboxId, seriesByMachine, onOpenDetail, now, onEnroll, onRefresh, className, }: MachinesDashboardProps): import("react").JSX.Element;
|
|
32
|
+
export declare function MachinesDashboard({ machines, activeSandboxId, loading, error, onAttach, attachingSandboxId, onUpdateAgent, updatingEnrollmentId, seriesByMachine, onOpenDetail, now, onEnroll, onRefresh, className, }: MachinesDashboardProps): import("react").JSX.Element;
|
|
@@ -24,8 +24,27 @@ export type MarkdownProps = {
|
|
|
24
24
|
* transition — that blinked the whole document).
|
|
25
25
|
*/
|
|
26
26
|
streaming?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Open a session-local file link in the host's Files surface. The path is the
|
|
29
|
+
* exact decoded `sandbox:` payload; `line`, when present, is 1-based.
|
|
30
|
+
*/
|
|
31
|
+
onSandboxFile?: ((path: string, line?: number) => void | Promise<void>) | undefined;
|
|
32
|
+
};
|
|
33
|
+
/** Exact target path plus optional 1-based line from a markdown href. */
|
|
34
|
+
export type SandboxFileLocation = {
|
|
35
|
+
path: string;
|
|
36
|
+
line: number | null;
|
|
27
37
|
};
|
|
28
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Parse an OpenGeni `sandbox:` application href (plus the historical bare
|
|
40
|
+
* `/workspace/...` form). The decoded path is intentionally opaque here:
|
|
41
|
+
* target selection, path policy, and filesystem authority belong to the
|
|
42
|
+
* session-aware host and its FileSystem boundary.
|
|
43
|
+
*/
|
|
44
|
+
export declare function sandboxFileLocationFromHref(href: string | undefined): SandboxFileLocation | null;
|
|
45
|
+
/** Return the exact decoded path for a supported sandbox-link href. */
|
|
46
|
+
export declare function sandboxFilePathFromHref(href: string | undefined): string | null;
|
|
47
|
+
declare function MarkdownImpl({ children, className, streaming, onSandboxFile }: MarkdownProps): import("react").JSX.Element;
|
|
29
48
|
/** Memoized so streaming re-renders of the parent don't re-parse settled bodies. */
|
|
30
49
|
export declare const Markdown: import("react").MemoExoticComponent<typeof MarkdownImpl>;
|
|
31
50
|
export {};
|
|
@@ -51,7 +51,7 @@ export type MessageTimelineProps = {
|
|
|
51
51
|
toolRegistry?: ToolRegistry | undefined;
|
|
52
52
|
/** Resolve opaque retained screenshot receipts through the authenticated host SDK. */
|
|
53
53
|
loadRetainedScreenshot?: RetainedScreenshotLoader | undefined;
|
|
54
|
-
/** Resolve permanent
|
|
54
|
+
/** Resolve permanent workspace image/file receipts through the authenticated host SDK. */
|
|
55
55
|
loadRetainedArtifact?: RetainedArtifactLoader | undefined;
|
|
56
56
|
/** Mint short-lived native playback sources for retained generated videos. */
|
|
57
57
|
loadVideoArtifactPlayback?: VideoArtifactPlaybackLoader | undefined;
|
|
@@ -41,6 +41,8 @@ export type ModelPolicyPickerProps = {
|
|
|
41
41
|
sessionKey?: string | undefined;
|
|
42
42
|
/** Prefer bottom on new-chat surfaces and top for bottom-docked composers. */
|
|
43
43
|
menuSide?: "top" | "bottom" | undefined;
|
|
44
|
+
/** Hide latency controls on surfaces whose saved policy does not include latency. */
|
|
45
|
+
allowLatencyMode?: boolean | undefined;
|
|
44
46
|
/** Classes for the portalled menu surface. Prefer --og-* tokens for theming. */
|
|
45
47
|
contentClassName?: string | undefined;
|
|
46
48
|
/** Inline styles for the portalled menu, applied after inherited --og-* tokens. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
export type PierreFileProps = {
|
|
3
|
-
/**
|
|
3
|
+
/** Target path (used for the header + language inference). */
|
|
4
4
|
path: string;
|
|
5
5
|
/** The decoded text contents. */
|
|
6
6
|
contents: string;
|
|
@@ -19,8 +19,14 @@ export type SandboxFilesProps = {
|
|
|
19
19
|
* dock warms the box on this so the save lands fast; opening/reading never fires
|
|
20
20
|
* it. Browsing the tree/diff must not warm a box. */
|
|
21
21
|
onEditIntent?: (() => void) | undefined;
|
|
22
|
-
/**
|
|
22
|
+
/** Restore the file last viewed in this task. Invalid/missing paths still
|
|
23
|
+
* surface the ordinary file-view error instead of changing files silently. */
|
|
24
|
+
initialSelectedPath?: string | null | undefined;
|
|
25
|
+
onSelectedPathChange?: ((path: string | null) => void) | undefined;
|
|
26
|
+
/** A deliberate file-open path routed here by the parent workspace. */
|
|
23
27
|
requestedPath?: string | undefined;
|
|
28
|
+
/** 1-based line to reveal after `requestedPath` opens. */
|
|
29
|
+
requestedLine?: number | null | undefined;
|
|
24
30
|
/** Identity for one guarded-file request. Increment this when the same path is
|
|
25
31
|
* deliberately requested again; it also lets a pending request be consumed
|
|
26
32
|
* without overriding later manual tree navigation. Defaults to the path. */
|
|
@@ -46,4 +52,4 @@ export type SandboxFilesProps = {
|
|
|
46
52
|
* surface deliberately does NOT replicate the changed-files list, and does not
|
|
47
53
|
* diff here — one job per tab). The agent commits; the human reviews.
|
|
48
54
|
*/
|
|
49
|
-
export declare function SandboxFiles({ files, git, fileSystemAvailable, usePierre, editable, onEditIntent, requestedPath, requestedPathRequestId, requestedPathReady, workspaceResting, workspaceWaking, liveWorkspaceReady, onWakeWorkspace, themeType, className, }: SandboxFilesProps): import("react").JSX.Element;
|
|
55
|
+
export declare function SandboxFiles({ files, git, fileSystemAvailable, usePierre, editable, onEditIntent, initialSelectedPath, onSelectedPathChange, requestedPath, requestedLine, requestedPathRequestId, requestedPathReady, workspaceResting, workspaceWaking, liveWorkspaceReady, onWakeWorkspace, themeType, className, }: SandboxFilesProps): import("react").JSX.Element;
|
|
@@ -38,7 +38,7 @@ export declare function initialWorkspaceTab(events: SessionEvent[] | undefined,
|
|
|
38
38
|
export type WorkspaceMachine = {
|
|
39
39
|
/** Whether at least one built-in workbench surface is enabled. */
|
|
40
40
|
enabled: boolean;
|
|
41
|
-
/** The derived live/waking/offline chip model. */
|
|
41
|
+
/** The derived live/waking/sleeping-or-offline chip model. */
|
|
42
42
|
chip: MachineChip;
|
|
43
43
|
/** The machine these surfaces are bound to (the Modal group box or a
|
|
44
44
|
* self-hosted machine), or null while the fleet is still resolving. */
|
|
@@ -72,14 +72,25 @@ export type UseSandboxWorkspaceTabsOptions = ClientOverride & {
|
|
|
72
72
|
browserWebSocketFactory?: BrowserFrameWebSocketFactory | undefined;
|
|
73
73
|
/** Alternate Computer frame transport for non-browser runtimes and deterministic tests. */
|
|
74
74
|
computerWebSocketFactory?: ComputerFrameWebSocketFactory | undefined;
|
|
75
|
+
/** Host-owned setup page or store listing for attaching an existing Chrome profile. */
|
|
76
|
+
browserExtensionSetupUrl?: string | undefined;
|
|
75
77
|
/** File requested by a Changes guard. The Files surface defers the read until
|
|
76
78
|
* the sandbox is live, then reveals this path. */
|
|
77
79
|
requestedFilePath?: string | null | undefined;
|
|
78
80
|
/** Unique identity for `requestedFilePath`, including repeated requests for the
|
|
79
81
|
* same path. */
|
|
80
82
|
requestedFileRequestId?: string | number | null | undefined;
|
|
83
|
+
/** 1-based line to reveal after `requestedFilePath` opens. */
|
|
84
|
+
requestedFileLine?: number | null | undefined;
|
|
81
85
|
/** Route a guarded diff into the host's Files tab. */
|
|
82
86
|
onOpenFile?: ((path: string) => void) | undefined;
|
|
87
|
+
/** Restore and report navigation inside the built-in workbench surfaces. */
|
|
88
|
+
initialFilePath?: string | null | undefined;
|
|
89
|
+
onFilePathChange?: ((path: string | null) => void) | undefined;
|
|
90
|
+
initialBrowserSessionId?: string | null | undefined;
|
|
91
|
+
onBrowserSessionIdChange?: ((browserSessionId: string | null) => void) | undefined;
|
|
92
|
+
initialComputerSessionId?: string | null | undefined;
|
|
93
|
+
onComputerSessionIdChange?: ((computerSessionId: string | null) => void) | undefined;
|
|
83
94
|
/** Navigate the host dock to one exact linked ComputerSession. */
|
|
84
95
|
onOpenComputerSession?: ((computerSessionId: string) => void) | undefined;
|
|
85
96
|
requestedComputerSessionId?: string | null | undefined;
|
|
@@ -89,7 +100,8 @@ export type UseSandboxWorkspaceTabsResult = {
|
|
|
89
100
|
/** Changes | Files | Terminal | Browser | Desktop (capability-gated where noted). */
|
|
90
101
|
tabs: WorkspaceTab[];
|
|
91
102
|
/** The source-driven default tab: Changes when the first authoritative capture
|
|
92
|
-
*
|
|
103
|
+
* has changes, else Files (a host `initialTab` overrides). Choosing a tab
|
|
104
|
+
* never performs hidden live workspace I/O.
|
|
93
105
|
* null while that source resolves, or permanently when neither Changes nor
|
|
94
106
|
* Files is enabled; the choice latches once. */
|
|
95
107
|
defaultTab: string | null;
|
|
@@ -119,14 +131,32 @@ export type SandboxWorkspaceProps = ClientOverride & {
|
|
|
119
131
|
/** Host tabs injected AFTER the workbench tabs (e.g. a "Debug" tab). */
|
|
120
132
|
trailingTabs?: WorkspaceTab[] | undefined;
|
|
121
133
|
/** Override the pre-paint default tab (e.g. a host landing tab id). When
|
|
122
|
-
* omitted the workbench decides from
|
|
134
|
+
* omitted the workbench decides from the durable workspace capture. */
|
|
123
135
|
initialTab?: string | undefined;
|
|
136
|
+
onActiveTabChange?: ((activeTab: string) => void) | undefined;
|
|
137
|
+
initialFilePath?: string | null | undefined;
|
|
138
|
+
onFilePathChange?: ((path: string | null) => void) | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Host request to open a workspace file (and optional line) in Files. A new
|
|
141
|
+
* `requestId` re-opens even the same path.
|
|
142
|
+
*/
|
|
143
|
+
openFileRequest?: {
|
|
144
|
+
path: string;
|
|
145
|
+
line?: number | null;
|
|
146
|
+
requestId: number;
|
|
147
|
+
} | null | undefined;
|
|
148
|
+
initialBrowserSessionId?: string | null | undefined;
|
|
149
|
+
onBrowserSessionIdChange?: ((browserSessionId: string | null) => void) | undefined;
|
|
150
|
+
initialComputerSessionId?: string | null | undefined;
|
|
151
|
+
onComputerSessionIdChange?: ((computerSessionId: string | null) => void) | undefined;
|
|
124
152
|
/** Host-routed notifications (no toast dependency in the package). */
|
|
125
153
|
onNotify?: ((notification: WorkspaceNotification) => void) | undefined;
|
|
126
154
|
/** Alternate Browser frame transport for non-browser runtimes and deterministic tests. */
|
|
127
155
|
browserWebSocketFactory?: BrowserFrameWebSocketFactory | undefined;
|
|
128
156
|
/** Alternate Computer frame transport for non-browser runtimes and deterministic tests. */
|
|
129
157
|
computerWebSocketFactory?: ComputerFrameWebSocketFactory | undefined;
|
|
158
|
+
/** Host-owned setup page or store listing for attaching an existing Chrome profile. */
|
|
159
|
+
browserExtensionSetupUrl?: string | undefined;
|
|
130
160
|
/** Controlled collapsed state for hosts with their own dock toggle. */
|
|
131
161
|
collapsed?: boolean | undefined;
|
|
132
162
|
onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
|
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
* Inbox has no product dismiss API; pass `onDismissIncoming` when the host
|
|
29
29
|
* wants a visible action (dev harness may use a local dummy).
|
|
30
30
|
*
|
|
31
|
-
* Segment switches keep the panel shell mounted and crossfade content
|
|
32
|
-
*
|
|
31
|
+
* Segment switches keep the panel shell mounted and crossfade content. The
|
|
32
|
+
* shell uses one CSS grid-track transition for deliberate open/close actions;
|
|
33
|
+
* live queue reconciliation never feeds measurements back into layout.
|
|
33
34
|
*/
|
|
34
35
|
import type { SessionGoal } from "@opengeni/sdk";
|
|
35
36
|
import { type ReactNode } from "react";
|
|
@@ -64,7 +65,18 @@ export type SessionChromeProps = {
|
|
|
64
65
|
defaultActive?: SessionChromeSignalId | null | undefined;
|
|
65
66
|
onActiveChange?: ((next: SessionChromeSignalId | null) => void) | undefined;
|
|
66
67
|
};
|
|
67
|
-
type GoalPillState = "pursuing" | "scheduled" | "blocked" | "held" | "paused" | "invariant_broken" | "completed";
|
|
68
|
+
type GoalPillState = "pursuing" | "waiting" | "scheduled" | "blocked" | "held" | "paused" | "invariant_broken" | "completed";
|
|
69
|
+
type GoalPillRecord = Pick<SessionGoal, "status" | "pausedReason"> & {
|
|
70
|
+
continuation?: SessionGoal["continuation"] | null | undefined;
|
|
71
|
+
};
|
|
72
|
+
/** Pill label, with the pause reason spelled out: "Paused · cap" / "Paused · manually". */
|
|
73
|
+
export declare function sessionChromeGoalPillLabel(state: GoalPillState, record: GoalPillRecord | null | undefined): string;
|
|
74
|
+
/**
|
|
75
|
+
* One human sentence explaining WHY the goal is not pursuing right now: the
|
|
76
|
+
* pause reason, the agent's own `goal_wait` hold (reason + deadline), or the
|
|
77
|
+
* next idle-backoff check time. Null when the state needs no explanation.
|
|
78
|
+
*/
|
|
79
|
+
export declare function sessionChromeGoalPillExplanation(state: GoalPillState, record: GoalPillRecord | null | undefined): string | null;
|
|
68
80
|
/** Select pill state from the goal's authoritative continuation projection. */
|
|
69
81
|
export declare function sessionChromeGoalPillState(goalStatus: "active" | "paused" | "completed", continuation: SessionGoal["continuation"] | null | undefined): GoalPillState;
|
|
70
82
|
export declare function SessionChrome({ queue, composer, goal, agentsPanel, agentsSignal, onDismissIncoming, readOnly, className, active: activeControlled, defaultActive, onActiveChange, }: SessionChromeProps): import("react").JSX.Element | null;
|
|
@@ -2,6 +2,10 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
export type WorkspaceTab = {
|
|
3
3
|
id: string;
|
|
4
4
|
label: ReactNode;
|
|
5
|
+
/** Optional icon used by the compact activity rail. */
|
|
6
|
+
icon?: ReactNode | undefined;
|
|
7
|
+
/** Accessible name when `label` is not plain text. */
|
|
8
|
+
ariaLabel?: string | undefined;
|
|
5
9
|
/** Rendered as the active surface. */
|
|
6
10
|
content: ReactNode;
|
|
7
11
|
/** A small badge after the label (e.g. dirty count, live pill). */
|
|
@@ -17,9 +21,9 @@ export type WorkspaceDockProps = {
|
|
|
17
21
|
/** Controlled collapsed state for hosts that expose their own dock toggle. */
|
|
18
22
|
collapsed?: boolean | undefined;
|
|
19
23
|
onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
|
|
20
|
-
/** Keep the
|
|
24
|
+
/** Keep the panel-local Hide workspace control when the host controls collapsed state. */
|
|
21
25
|
showCollapseControl?: boolean | undefined;
|
|
22
|
-
/** A status accessory pinned to the right of the
|
|
26
|
+
/** A status accessory pinned to the right of the workspace header, left of the
|
|
23
27
|
* maximize/collapse controls (e.g. the machine-state chip). Renders in both
|
|
24
28
|
* the docked header and the full-screen overlay header. */
|
|
25
29
|
headerAccessory?: ReactNode | undefined;
|
package/dist/composer.js
CHANGED
|
@@ -37,8 +37,8 @@ import {
|
|
|
37
37
|
useChatComposer,
|
|
38
38
|
useChatComposerController,
|
|
39
39
|
useVoiceInput
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
} from "./chunk-LTCHJ4MS.js";
|
|
41
|
+
import "./chunk-JOAVA2TW.js";
|
|
42
42
|
import {
|
|
43
43
|
BillingClassMark,
|
|
44
44
|
ModelPolicyPicker,
|
|
@@ -47,12 +47,12 @@ import {
|
|
|
47
47
|
PickerBackHeader,
|
|
48
48
|
PickerNavRow,
|
|
49
49
|
defaultModelPolicyPickerMessages
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-W6NFJXSA.js";
|
|
51
|
+
import "./chunk-X4A66EWZ.js";
|
|
52
52
|
import "./chunk-FK6VG4LL.js";
|
|
53
53
|
import "./chunk-VZTQ73XT.js";
|
|
54
54
|
import "./chunk-KZ73RL76.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-NEXLLTP4.js";
|
|
56
56
|
import "./chunk-LAKLF4PA.js";
|
|
57
57
|
import "./chunk-22KP6LR5.js";
|
|
58
58
|
export {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ComputerViewer,
|
|
3
|
+
computerKey
|
|
4
|
+
} from "./chunk-QGBJ6GHG.js";
|
|
5
|
+
import "./chunk-H5YGYNXS.js";
|
|
6
|
+
import "./chunk-4MDLEHXL.js";
|
|
7
|
+
import "./chunk-5YK2ZDIG.js";
|
|
8
|
+
import "./chunk-KZ73RL76.js";
|
|
9
|
+
import "./chunk-NEXLLTP4.js";
|
|
10
|
+
import "./chunk-22KP6LR5.js";
|
|
11
|
+
import "./chunk-JVYQRRC4.js";
|
|
12
|
+
export {
|
|
13
|
+
ComputerViewer,
|
|
14
|
+
computerKey
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=computer-viewer-ZOP4Q7A7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Channel } from "@opengeni/sdk";
|
|
2
|
+
import type { SessionClientLike } from "../client.js";
|
|
3
|
+
export type ChannelCacheSnapshot = Readonly<{
|
|
4
|
+
channels: readonly Channel[];
|
|
5
|
+
ready: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export type ChannelCacheStore = Readonly<{
|
|
8
|
+
getSnapshot: () => ChannelCacheSnapshot;
|
|
9
|
+
subscribe: (listener: () => void) => () => void;
|
|
10
|
+
beginLoad: () => number;
|
|
11
|
+
acceptLoad: (ticket: number, channels: readonly Channel[]) => void;
|
|
12
|
+
publishCreated: (channel: Channel) => void;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* One client/workspace cache shared by every useChannels consumer.
|
|
16
|
+
*
|
|
17
|
+
* List reads are ticketed so an older request cannot erase a newer result.
|
|
18
|
+
* A successful create remains layered over the latest server snapshot until a
|
|
19
|
+
* list request that started after that success reconciles it. Requests already
|
|
20
|
+
* in flight cannot make the project disappear between create and session start.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createChannelCacheStore(): ChannelCacheStore;
|
|
23
|
+
export declare function channelCacheFor(client: SessionClientLike, workspaceId: string): ChannelCacheStore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MachinesResponse } from "../types/machines.js";
|
|
2
|
+
export declare const EMPTY_MACHINES: MachinesResponse;
|
|
3
|
+
export type SharedMachinesSnapshot = {
|
|
4
|
+
data: MachinesResponse | null;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
error: Error | null;
|
|
7
|
+
};
|
|
8
|
+
export declare function refreshSharedMachinesList(shareKey: string): Promise<void>;
|
|
9
|
+
export declare function useSharedMachinesList(shareKey: string, load: (signal?: AbortSignal) => Promise<MachinesResponse>, options?: {
|
|
10
|
+
pollIntervalMs?: number | undefined;
|
|
11
|
+
enabled?: boolean | undefined;
|
|
12
|
+
}): SharedMachinesSnapshot & {
|
|
13
|
+
refresh: () => Promise<void>;
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AttachedBrowserDevice } from "@opengeni/sdk/interaction";
|
|
1
|
+
import type { AttachedBrowserBridge, AttachedBrowserDevice } from "@opengeni/sdk/interaction";
|
|
2
2
|
import type { EmbeddedBrowserInteractionClientLike } from "../client.js";
|
|
3
3
|
import { type EmbeddedBrowserInteractionClientOverride } from "../session-context.js";
|
|
4
4
|
export type UseAttachedBrowsersOptions = EmbeddedBrowserInteractionClientOverride & {
|
|
@@ -8,6 +8,7 @@ export type UseAttachedBrowsersOptions = EmbeddedBrowserInteractionClientOverrid
|
|
|
8
8
|
};
|
|
9
9
|
export type UseAttachedBrowsersResult = {
|
|
10
10
|
revision: number;
|
|
11
|
+
bridges: AttachedBrowserBridge[];
|
|
11
12
|
devices: AttachedBrowserDevice[];
|
|
12
13
|
loading: boolean;
|
|
13
14
|
refreshing: boolean;
|
|
@@ -11,6 +11,7 @@ export type UseChannelsResult = {
|
|
|
11
11
|
refresh: () => Promise<void>;
|
|
12
12
|
create: (request: CreateChannelRequest) => Promise<Channel | null>;
|
|
13
13
|
update: (channelId: string, request: UpdateChannelRequest) => Promise<Channel | null>;
|
|
14
|
+
reorder: (channelIds: string[]) => Promise<Channel[] | null>;
|
|
14
15
|
remove: (channelId: string) => Promise<boolean>;
|
|
15
16
|
/** Re-file a session into a channel; null moves it back to the inbox. */
|
|
16
17
|
moveSession: (sessionId: string, channelId: string | null) => Promise<Session | null>;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { type ComposerDraft, type DraftTimelineAnnotation, type EffectiveControlResumeOption, type EffectiveSessionControl, type ResourceRef, type SendMessageInput, type SessionEvent } from "@opengeni/sdk";
|
|
1
|
+
import { type ComposerDraft, type DraftTimelineAnnotation, type EffectiveControlResumeOption, type EffectiveSessionControl, type LatencyMode, type ReasoningEffort, type ResourceRef, type SendMessageInput, type SessionEvent } from "@opengeni/sdk";
|
|
2
2
|
import { type EmbeddedSessionClientOverride } from "../session-context.js";
|
|
3
3
|
import { type SessionEventFeedOptions } from "./internal.js";
|
|
4
|
-
export type
|
|
4
|
+
export type ComposerPolicy = {
|
|
5
|
+
model: string;
|
|
6
|
+
reasoningEffort: ReasoningEffort;
|
|
7
|
+
latencyMode: LatencyMode;
|
|
8
|
+
};
|
|
9
|
+
export type ComposerSendExtras = Omit<SendMessageInput, "text" | "clientEventId" | "annotations" | "model" | "reasoningEffort" | "latencyMode">;
|
|
5
10
|
export type UseComposerOptions = EmbeddedSessionClientOverride & SessionEventFeedOptions & {
|
|
6
11
|
/** Called synchronously after an ordinary Send is accepted by the local UI. */
|
|
7
12
|
onSubmitted?: ((text: string, input: SendMessageInput) => void) | undefined;
|
|
8
13
|
/** Called with the exact accepted wire input after a successful send. */
|
|
9
14
|
onSent?: ((text: string, input: SendMessageInput) => void) | undefined;
|
|
15
|
+
/** Called with the exact wire input after a delivery failure. */
|
|
16
|
+
onDeliveryError?: ((error: Error, input: SendMessageInput, delivery: "send" | "steer") => void) | undefined;
|
|
10
17
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* surrounding UI state (attachment pickers, model selectors, ...).
|
|
18
|
+
* Non-policy message fields merged into every send. Durable policy belongs
|
|
19
|
+
* to this composer draft; attachments and credentials may remain host-owned.
|
|
14
20
|
*/
|
|
15
21
|
sendExtras?: ComposerSendExtras | (() => ComposerSendExtras) | undefined;
|
|
16
22
|
/**
|
|
@@ -21,18 +27,25 @@ export type UseComposerOptions = EmbeddedSessionClientOverride & SessionEventFee
|
|
|
21
27
|
sendBlocked?: (() => boolean) | undefined;
|
|
22
28
|
/** Latest server-derived workstream control; bound into Send/Steer OCC. */
|
|
23
29
|
effectiveControl?: EffectiveSessionControl | null | undefined;
|
|
24
|
-
/**
|
|
25
|
-
|
|
30
|
+
/** Immediate user-visible destination for an ordinary Send before admission replies. */
|
|
31
|
+
sendDestination?: (() => "chat" | "queue") | undefined;
|
|
26
32
|
/** Disable remote composer-draft reads and writes for embedded hosts. */
|
|
27
33
|
draftPersistence?: "durable" | "disabled" | undefined;
|
|
34
|
+
/** Required explicit authority when durable draft persistence is disabled. */
|
|
35
|
+
initialPolicy?: ComposerPolicy | undefined;
|
|
28
36
|
};
|
|
29
37
|
export type ComposerOptimisticMessage = {
|
|
30
38
|
clientEventId: string;
|
|
39
|
+
delivery: "send" | "steer";
|
|
40
|
+
destination: "chat" | "queue";
|
|
31
41
|
text: string;
|
|
32
42
|
annotations: DraftTimelineAnnotation[];
|
|
33
43
|
resources: ResourceRef[];
|
|
34
44
|
occurredAt: string;
|
|
35
45
|
state: "sending" | "queued" | "failed";
|
|
46
|
+
turnId?: string | null | undefined;
|
|
47
|
+
triggerEventId?: string | null | undefined;
|
|
48
|
+
appliedQueueVersion?: number | null | undefined;
|
|
36
49
|
error?: string | undefined;
|
|
37
50
|
outcomeUnknown?: boolean | undefined;
|
|
38
51
|
};
|
|
@@ -68,11 +81,18 @@ export type ComposerState = {
|
|
|
68
81
|
resume: (reason?: string) => Promise<void>;
|
|
69
82
|
resumeScope: (option: EffectiveControlResumeOption) => Promise<void>;
|
|
70
83
|
resuming: boolean;
|
|
84
|
+
/** Mutation-confirmed control while the streamed queue projection catches up. */
|
|
85
|
+
effectiveControl?: EffectiveSessionControl | null | undefined;
|
|
71
86
|
draft: ComposerDraft | null;
|
|
72
87
|
draftRevision: number;
|
|
73
88
|
draftLoading: boolean;
|
|
74
89
|
draftSaving: boolean;
|
|
75
90
|
draftConflict: Error | null;
|
|
91
|
+
/** Exact policy owned by this actor/session composer. Null while hydrating. */
|
|
92
|
+
policy?: ComposerPolicy | null | undefined;
|
|
93
|
+
setModel?: ((model: string) => void) | undefined;
|
|
94
|
+
setReasoningEffort?: ((effort: ReasoningEffort) => void) | undefined;
|
|
95
|
+
setLatencyMode?: ((mode: LatencyMode) => void) | undefined;
|
|
76
96
|
/** Whether this controller owns a durable server-side draft. */
|
|
77
97
|
draftPersistence?: "durable" | "disabled" | undefined;
|
|
78
98
|
/** Apply an atomic queue Edit checkout without a second read. */
|
|
@@ -84,14 +104,22 @@ export type ComposerState = {
|
|
|
84
104
|
error: Error | null;
|
|
85
105
|
clearError: () => void;
|
|
86
106
|
};
|
|
107
|
+
export type ComposerControllerState = ComposerState & {
|
|
108
|
+
policy: ComposerPolicy | null;
|
|
109
|
+
setModel: (model: string) => void;
|
|
110
|
+
setReasoningEffort: (effort: ReasoningEffort) => void;
|
|
111
|
+
setLatencyMode: (mode: LatencyMode) => void;
|
|
112
|
+
};
|
|
87
113
|
export type ComposerSteeringState = {
|
|
88
|
-
phase: "submitting" | "accepted";
|
|
114
|
+
phase: "submitting" | "accepted" | "failed";
|
|
89
115
|
text: string;
|
|
90
116
|
clientEventId: string | null;
|
|
91
117
|
triggerEventId: string | null;
|
|
92
118
|
turnId: string | null;
|
|
93
119
|
/** True only when the accepted Steer durably interrupted a live attempt. */
|
|
94
120
|
stoppingPreviousAttempt?: boolean | undefined;
|
|
121
|
+
error?: string | undefined;
|
|
122
|
+
outcomeUnknown?: boolean | undefined;
|
|
95
123
|
};
|
|
96
124
|
/**
|
|
97
125
|
* Draft + send + Pause/Resume state for the chat composer — the only
|
|
@@ -99,7 +127,7 @@ export type ComposerSteeringState = {
|
|
|
99
127
|
* more hostile than losing a typed message); each send carries a generated
|
|
100
128
|
* `clientEventId` so retries stay idempotent server-side.
|
|
101
129
|
*/
|
|
102
|
-
export declare function useComposer(sessionId: string | null | undefined, options?: UseComposerOptions):
|
|
130
|
+
export declare function useComposer(sessionId: string | null | undefined, options?: UseComposerOptions): ComposerControllerState;
|
|
103
131
|
/** Events that can atomically replace or clear this subject's durable draft. */
|
|
104
132
|
export declare function isComposerDraftEvent(event: Pick<SessionEvent, "type">): boolean;
|
|
105
133
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { MachineState } from "@opengeni/sdk";
|
|
2
2
|
import type { SessionCapabilitiesState } from "./use-session-capabilities.js";
|
|
3
|
-
/** The one truthful machine indicator.
|
|
4
|
-
*
|
|
3
|
+
/** The one truthful machine indicator. Managed cold compute is sleeping; a
|
|
4
|
+
* Connected Machine that is genuinely unreachable remains offline. */
|
|
5
5
|
export type MachineChipState = "live" | "waking" | "offline";
|
|
6
6
|
export type MachineChip = {
|
|
7
7
|
state: MachineChipState;
|
|
8
|
-
/** A ready-to-render label ("Live" / "Waking…" / "
|
|
8
|
+
/** A ready-to-render label ("Live" / "Waking…" / "Sleeping · saved 3m ago"). */
|
|
9
9
|
label: string;
|
|
10
10
|
/** The capture time backing an offline/stale label (ISO), or null. M4 may
|
|
11
11
|
* reformat this; `label` already embeds a relative form. */
|