@opengeni/react 7.4.0 → 7.5.0-canary.36927100590001
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 +124 -27
- package/dist/artifacts-document.js +3 -2
- package/dist/artifacts-presentation.js +3 -2
- package/dist/artifacts-spreadsheet.js +2 -2
- package/dist/artifacts.d.ts +1 -0
- package/dist/artifacts.js +516 -1413
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-2E6R2Y4W.js → browser-viewer-Z7S7QEJL.js} +6 -5
- package/dist/chat-interactive-block-UGBTNB3L.js +11 -0
- package/dist/{chunk-Y3QTZN2F.js → chunk-2VFNCX4E.js} +6 -6
- package/dist/{chunk-UDD6DLLT.js → chunk-3IJJEYW4.js} +15 -3
- package/dist/chunk-3IJJEYW4.js.map +1 -0
- package/dist/chunk-4RVYOY4O.js +379 -0
- package/dist/chunk-4RVYOY4O.js.map +1 -0
- package/dist/chunk-5CVXZA3Y.js +292 -0
- package/dist/chunk-5CVXZA3Y.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-5J4FOW6Q.js} +2 -10
- package/dist/chunk-5J4FOW6Q.js.map +1 -0
- package/dist/{chunk-KVERXCFY.js → chunk-5KYZIQFY.js} +40 -3
- package/dist/chunk-5KYZIQFY.js.map +1 -0
- package/dist/{chunk-KNDIXZN6.js → chunk-7UAMYXJY.js} +25 -18
- package/dist/{chunk-KNDIXZN6.js.map → chunk-7UAMYXJY.js.map} +1 -1
- package/dist/{chunk-SEEVCT36.js → chunk-A4UJB2MM.js} +2 -2
- package/dist/{chunk-X4HIN6TV.js → chunk-AFLPWUQ7.js} +71 -162
- package/dist/chunk-AFLPWUQ7.js.map +1 -0
- package/dist/chunk-B3V6TG77.js +41 -0
- package/dist/chunk-B3V6TG77.js.map +1 -0
- package/dist/{chunk-XEJEOAOV.js → chunk-B7WMS3CS.js} +51 -40
- package/dist/chunk-B7WMS3CS.js.map +1 -0
- package/dist/{chunk-S5JQ4R22.js → chunk-BDKR6BAR.js} +54 -24
- package/dist/chunk-BDKR6BAR.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-DYWBUX5Q.js} +24 -12
- package/dist/chunk-DYWBUX5Q.js.map +1 -0
- package/dist/{chunk-YZ3YYMOM.js → chunk-E3G7SAYZ.js} +252 -624
- package/dist/chunk-E3G7SAYZ.js.map +1 -0
- package/dist/chunk-JT4JW7BC.js +54 -0
- package/dist/chunk-JT4JW7BC.js.map +1 -0
- package/dist/{chunk-5AZSK6MV.js → chunk-LWNLETQT.js} +5 -5
- package/dist/{chunk-USXVQACU.js → chunk-M7LBYP63.js} +5 -4
- package/dist/{chunk-USXVQACU.js.map → chunk-M7LBYP63.js.map} +1 -1
- package/dist/{chunk-L4OSXQ6H.js → chunk-NBOHNRLJ.js} +1289 -1060
- package/dist/chunk-NBOHNRLJ.js.map +1 -0
- package/dist/chunk-RHREZ7BO.js +11 -0
- package/dist/chunk-RHREZ7BO.js.map +1 -0
- package/dist/chunk-SCOTPE2I.js +589 -0
- package/dist/chunk-SCOTPE2I.js.map +1 -0
- package/dist/chunk-WEHMPOXK.js +39 -0
- package/dist/chunk-WEHMPOXK.js.map +1 -0
- package/dist/chunk-WRHIZYZF.js +988 -0
- package/dist/chunk-WRHIZYZF.js.map +1 -0
- package/dist/{chunk-3E2AITTZ.js → chunk-WUISZ3WU.js} +32 -28
- package/dist/{chunk-3E2AITTZ.js.map → chunk-WUISZ3WU.js.map} +1 -1
- package/dist/chunk-XCHWDJ22.js +107 -0
- package/dist/chunk-XCHWDJ22.js.map +1 -0
- package/dist/{chunk-DUEBTL3N.js → chunk-Y2PRMYLC.js} +4 -3
- package/dist/{chunk-DUEBTL3N.js.map → chunk-Y2PRMYLC.js.map} +1 -1
- package/dist/chunk-YBXQDQFX.js +1772 -0
- package/dist/chunk-YBXQDQFX.js.map +1 -0
- package/dist/chunk-YV4L3ILF.js +9 -0
- package/dist/chunk-YV4L3ILF.js.map +1 -0
- package/dist/{chunk-V2ABIVYJ.js → chunk-ZXSEDZP7.js} +70 -6
- package/dist/chunk-ZXSEDZP7.js.map +1 -0
- package/dist/components/artifacts/artifact-chrome.d.ts +120 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +27 -0
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/editable-artifact-ui.d.ts +2 -1
- package/dist/components/artifacts/editable-artifact-view.d.ts +46 -0
- package/dist/components/artifacts/index.d.ts +7 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +23 -0
- package/dist/components/browser-select-control.d.ts +3 -1
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/message-timeline.d.ts +20 -3
- package/dist/components/open-geni-links.d.ts +16 -0
- package/dist/components/session-conversation.d.ts +20 -1
- package/dist/components/timeline-pill-geometry.d.ts +8 -0
- package/dist/components/timeline-pill-placement.d.ts +24 -0
- package/dist/components/usage-limit-notice.d.ts +49 -0
- package/dist/components/usage-member-list.d.ts +91 -0
- package/dist/components/usage-meter.d.ts +73 -0
- package/dist/composer.js +5 -5
- package/dist/{computer-viewer-WMJE6OA3.js → computer-viewer-KJWLH3GI.js} +7 -5
- package/dist/connect.js +7 -6
- package/dist/connect.js.map +1 -1
- package/dist/conversation-timeline.d.ts +1 -1
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +26 -0
- package/dist/desktop.js.map +1 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +21 -0
- package/dist/editor.js.map +1 -0
- package/dist/hooks/latest-question.d.ts +1 -1
- package/dist/hooks/use-composer.d.ts +4 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +460 -1386
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +8 -6
- package/dist/interaction.js.map +1 -1
- package/dist/{latest-question-QB4EUCW5.js → latest-question-IS445HOW.js} +3 -3
- package/dist/lib/format.d.ts +6 -1
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/machines.js +2 -2
- package/dist/{markdown-table-layout-PFUEZ2U4.js → markdown-table-layout-QXSLK4BY.js} +37 -5
- package/dist/markdown-table-layout-QXSLK4BY.js.map +1 -0
- package/dist/{queue-surface-implementation-IM2HD3SK.js → queue-surface-implementation-2CAQAIHM.js} +2 -2
- package/dist/realtime.js +3 -3
- package/dist/{sandbox-files-PXPIZAFG.js → sandbox-files-AEJTWGT4.js} +8 -5
- package/dist/sandbox-files-AEJTWGT4.js.map +1 -0
- package/dist/session-ui.d.ts +9 -2
- package/dist/session-ui.js +39 -20
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +4 -4
- package/dist/sites.js +4 -289
- package/dist/sites.js.map +1 -1
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +31 -0
- package/dist/terminal.js.map +1 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/genie-loading.d.ts +3 -1
- package/dist/timeline/types.d.ts +8 -1
- package/dist/{timeline-annotation-selection-ODLVF4OI.js → timeline-annotation-selection-DMLMM2TX.js} +6 -1
- package/dist/timeline-annotation-selection-DMLMM2TX.js.map +1 -0
- package/dist/timeline-pill-geometry-Z23V243M.js +110 -0
- package/dist/timeline-pill-geometry-Z23V243M.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +25 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +13 -0
- package/dist/usage.js +1073 -0
- package/dist/usage.js.map +1 -0
- package/package.json +19 -3
- package/src/artifacts.ts +37 -0
- package/src/components/artifacts/artifact-chrome.tsx +413 -0
- package/src/components/artifacts/artifact-sandbox.tsx +185 -0
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +67 -0
- package/src/components/artifacts/editable-artifact-ui.tsx +3 -1
- package/src/components/artifacts/editable-artifact-view.tsx +187 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +5 -2
- package/src/components/artifacts/editable-document.tsx +34 -36
- package/src/components/artifacts/editable-presentation.tsx +21 -16
- package/src/components/artifacts/index.ts +41 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/session-artifact-viewer.tsx +376 -0
- package/src/components/artifacts/site-view.tsx +116 -0
- package/src/components/browser-select-control.tsx +4 -1
- package/src/components/browser-viewer.tsx +81 -22
- package/src/components/code-editor.tsx +13 -16
- package/src/components/computer-viewer.tsx +51 -23
- package/src/components/desktop-viewer.tsx +1 -1
- package/src/components/markdown-table-layout.ts +49 -5
- package/src/components/markdown.tsx +5 -2
- package/src/components/message-timeline.tsx +557 -516
- package/src/components/open-geni-links.tsx +24 -0
- package/src/components/sandbox-terminal.tsx +48 -11
- package/src/components/session-chrome.tsx +22 -3
- package/src/components/session-conversation.tsx +195 -102
- package/src/components/timeline-annotation-selection.tsx +7 -0
- package/src/components/timeline-pill-geometry.ts +169 -0
- package/src/components/timeline-pill-placement.ts +99 -0
- package/src/components/usage-limit-notice.tsx +179 -0
- package/src/components/usage-member-list.tsx +792 -0
- package/src/components/usage-meter.tsx +382 -0
- package/src/conversation-timeline.ts +10 -2
- package/src/desktop.ts +24 -0
- package/src/editor.ts +13 -0
- package/src/hooks/use-available-models.ts +1 -1
- package/src/hooks/use-composer.ts +57 -2
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-usage.ts +100 -0
- package/src/index.ts +22 -0
- package/src/lib/format.ts +32 -6
- package/src/lib/workbench-peers.ts +62 -0
- package/src/session-ui.ts +22 -0
- package/src/terminal.ts +26 -0
- package/src/timeline/activity-rail.tsx +5 -3
- package/src/timeline/allowance-exhausted-row.tsx +86 -0
- package/src/timeline/genie-loading.tsx +16 -6
- package/src/timeline/projection.ts +78 -4
- package/src/timeline/types.ts +8 -0
- package/src/usage/allowance-copy.ts +64 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +50 -0
- package/styles/compiled.css +325 -0
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-KVERXCFY.js.map +0 -1
- package/dist/chunk-L4OSXQ6H.js.map +0 -1
- package/dist/chunk-S5JQ4R22.js.map +0 -1
- package/dist/chunk-UDD6DLLT.js.map +0 -1
- package/dist/chunk-UGMKPUEM.js +0 -299
- package/dist/chunk-UGMKPUEM.js.map +0 -1
- package/dist/chunk-V2ABIVYJ.js.map +0 -1
- package/dist/chunk-X4HIN6TV.js.map +0 -1
- package/dist/chunk-XEJEOAOV.js.map +0 -1
- package/dist/chunk-YZ3YYMOM.js.map +0 -1
- package/dist/markdown-table-layout-PFUEZ2U4.js.map +0 -1
- package/dist/timeline-annotation-selection-ODLVF4OI.js.map +0 -1
- /package/dist/{browser-viewer-2E6R2Y4W.js.map → browser-viewer-Z7S7QEJL.js.map} +0 -0
- /package/dist/{computer-viewer-WMJE6OA3.js.map → chat-interactive-block-UGBTNB3L.js.map} +0 -0
- /package/dist/{chunk-Y3QTZN2F.js.map → chunk-2VFNCX4E.js.map} +0 -0
- /package/dist/{chunk-SEEVCT36.js.map → chunk-A4UJB2MM.js.map} +0 -0
- /package/dist/{chunk-5AZSK6MV.js.map → chunk-LWNLETQT.js.map} +0 -0
- /package/dist/{sandbox-files-PXPIZAFG.js.map → computer-viewer-KJWLH3GI.js.map} +0 -0
- /package/dist/{latest-question-QB4EUCW5.js.map → latest-question-IS445HOW.js.map} +0 -0
- /package/dist/{queue-surface-implementation-IM2HD3SK.js.map → queue-surface-implementation-2CAQAIHM.js.map} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Shared chrome for artifact surfaces: the OpenGeni console and embedding hosts
|
|
4
|
+
* render the same header, controls, and load states. Class names use the
|
|
5
|
+
* package theme aliases, so the console's own Tailwind build and the compiled
|
|
6
|
+
* `.og-root` stylesheet resolve them identically.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactKind = "document" | "spreadsheet" | "presentation" | "site" | "image" | "file";
|
|
9
|
+
declare const BUTTON_VARIANT: {
|
|
10
|
+
readonly ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50";
|
|
11
|
+
readonly outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-border dark:bg-input/30 dark:hover:bg-input/50";
|
|
12
|
+
};
|
|
13
|
+
declare const BUTTON_SIZE: {
|
|
14
|
+
readonly sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5";
|
|
15
|
+
readonly icon: "size-9";
|
|
16
|
+
readonly "icon-sm": "size-8";
|
|
17
|
+
};
|
|
18
|
+
export declare function ArtifactButton({ variant, size, className, type, ...props }: ComponentProps<"button"> & {
|
|
19
|
+
variant?: keyof typeof BUTTON_VARIANT;
|
|
20
|
+
size?: keyof typeof BUTTON_SIZE;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export declare function ArtifactBadge({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
23
|
+
export declare const ArtifactSelect: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
24
|
+
export declare function artifactKindIcon(kind: ArtifactKind): ReactNode;
|
|
25
|
+
export declare function artifactKindSubtitle(kind: ArtifactKind): string;
|
|
26
|
+
type LoadErrorCopy = Readonly<Record<"unavailable" | "invalid" | "transient", {
|
|
27
|
+
title: string;
|
|
28
|
+
message: string;
|
|
29
|
+
}>>;
|
|
30
|
+
/**
|
|
31
|
+
* Every user-facing string in the artifact surfaces (inline Site preview, Site
|
|
32
|
+
* frame, viewer header and states). Hosts translate by passing a partial
|
|
33
|
+
* `labels` object; unspecified keys keep the English defaults.
|
|
34
|
+
*/
|
|
35
|
+
export type ArtifactLabels = Readonly<{
|
|
36
|
+
back: string;
|
|
37
|
+
close: string;
|
|
38
|
+
/** Header title and loading copy until an artifact's title is known. */
|
|
39
|
+
opening: string;
|
|
40
|
+
/** Header title when an artifact cannot be opened. */
|
|
41
|
+
artifact: string;
|
|
42
|
+
startingEditor: string;
|
|
43
|
+
kindSubtitle: (kind: ArtifactKind) => string;
|
|
44
|
+
live: string;
|
|
45
|
+
reloadSite: string;
|
|
46
|
+
openFullScreen: string;
|
|
47
|
+
editWithAgent: string;
|
|
48
|
+
editShort: string;
|
|
49
|
+
preview: string;
|
|
50
|
+
loadPreview: string;
|
|
51
|
+
loadSitePreview: string;
|
|
52
|
+
siteVersion: string;
|
|
53
|
+
savedVersion: string;
|
|
54
|
+
version: (revision: number) => string;
|
|
55
|
+
openSite: string;
|
|
56
|
+
loadingSite: string;
|
|
57
|
+
siteArchived: string;
|
|
58
|
+
siteUnpublished: string;
|
|
59
|
+
siteReferenceInvalid: string;
|
|
60
|
+
siteLoadFailed: string;
|
|
61
|
+
retry: string;
|
|
62
|
+
tryAgain: string;
|
|
63
|
+
toolCount: (count: number) => string;
|
|
64
|
+
toolsAvailable: (count: number) => string;
|
|
65
|
+
sourceFileCount: (count: number) => string;
|
|
66
|
+
viewingDisabled: {
|
|
67
|
+
title: string;
|
|
68
|
+
message: string;
|
|
69
|
+
};
|
|
70
|
+
editorsMissing: {
|
|
71
|
+
title: string;
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
siteErrors: LoadErrorCopy;
|
|
75
|
+
editableErrors: LoadErrorCopy;
|
|
76
|
+
reference: (id: string) => string;
|
|
77
|
+
}>;
|
|
78
|
+
export declare const DEFAULT_ARTIFACT_LABELS: ArtifactLabels;
|
|
79
|
+
/** Translate every artifact surface below; nested providers override outer ones. */
|
|
80
|
+
export declare function ArtifactLabelsProvider({ labels, children, }: {
|
|
81
|
+
labels: Partial<ArtifactLabels> | undefined;
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
}): import("react").JSX.Element;
|
|
84
|
+
export declare function useArtifactLabels(): ArtifactLabels;
|
|
85
|
+
/**
|
|
86
|
+
* One artifact header: optional Back, the kind tile, title (or a host-supplied
|
|
87
|
+
* title control), trailing actions, and optional Close. The console dock and
|
|
88
|
+
* embedded viewers share it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function ArtifactViewerHeader({ kind, title, subtitle, titleSlot, onBack, backLabel, actions, onClose, closeLabel, }: Readonly<{
|
|
91
|
+
/** `null` while the host does not know the modality yet. */
|
|
92
|
+
kind: ArtifactKind | null;
|
|
93
|
+
title: string;
|
|
94
|
+
subtitle?: string | undefined;
|
|
95
|
+
/** Replaces the title text, for example with a picker. */
|
|
96
|
+
titleSlot?: ReactNode;
|
|
97
|
+
onBack?: (() => void) | undefined;
|
|
98
|
+
backLabel?: string | undefined;
|
|
99
|
+
actions?: ReactNode;
|
|
100
|
+
onClose?: (() => void) | undefined;
|
|
101
|
+
closeLabel?: string | undefined;
|
|
102
|
+
}>): import("react").JSX.Element;
|
|
103
|
+
export declare function ArtifactLoading({ label }: {
|
|
104
|
+
label: string;
|
|
105
|
+
}): import("react").JSX.Element;
|
|
106
|
+
export declare function ArtifactProblem({ view, onRetry, }: {
|
|
107
|
+
view: ArtifactLoadErrorView;
|
|
108
|
+
onRetry?: (() => void) | undefined;
|
|
109
|
+
}): import("react").JSX.Element;
|
|
110
|
+
export type ArtifactLoadErrorKind = "site" | "editable";
|
|
111
|
+
export type ArtifactLoadErrorView = Readonly<{
|
|
112
|
+
title: string;
|
|
113
|
+
message: string;
|
|
114
|
+
retryable: boolean;
|
|
115
|
+
correlationId?: string;
|
|
116
|
+
}>;
|
|
117
|
+
/** Site/editor load copy. Never surfaces raw OpenGeni API status text. */
|
|
118
|
+
export declare function artifactLoadErrorView(error: unknown, kind: ArtifactLoadErrorKind, labels?: ArtifactLabels): ArtifactLoadErrorView;
|
|
119
|
+
export declare function artifactLoadErrorMessage(view: ArtifactLoadErrorView, labels?: ArtifactLabels): string;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type PublishedHtmlArtifactToolBridge } from "./published-html-artifact-frame.js";
|
|
3
|
+
export type ArtifactSandboxProps = {
|
|
4
|
+
html: string;
|
|
5
|
+
height?: number | undefined;
|
|
6
|
+
autoHeight?: boolean | undefined;
|
|
7
|
+
theme?: "light" | "dark" | undefined;
|
|
8
|
+
headerControls?: ReactNode | undefined;
|
|
9
|
+
title: string;
|
|
10
|
+
/** Hide the visible title/icon while retaining the accessible iframe title. */
|
|
11
|
+
showTitle?: boolean | undefined;
|
|
12
|
+
showLiveStatus?: boolean | undefined;
|
|
13
|
+
versionLabel?: string | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
editDisabled?: boolean | undefined;
|
|
16
|
+
onEdit?: (() => void) | undefined;
|
|
17
|
+
toolBridge?: PublishedHtmlArtifactToolBridge | undefined;
|
|
18
|
+
connectedToolCount?: number | undefined;
|
|
19
|
+
sourceFileCount?: number | undefined;
|
|
20
|
+
fill?: boolean | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The Site/preview frame chrome shared by the console and embedding hosts:
|
|
24
|
+
* title, version and tool badges, live status, reload, and a full-screen mode
|
|
25
|
+
* that escapes the host's scroll containers through the modal top layer.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ArtifactSandbox(props: ArtifactSandboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { OpenGeniClient, ToolGatewayIdentity } from "@opengeni/sdk";
|
|
2
|
+
import { type ArtifactLabels } from "./artifact-chrome.js";
|
|
3
|
+
import type { PublishedHtmlArtifactToolBridge } from "./published-html-artifact-frame.js";
|
|
4
|
+
/** Reads a Site needs to render; the console client, the SDK client, or a proxy. */
|
|
5
|
+
export type SiteSnapshotClient = Pick<OpenGeniClient, "getWorkspaceArtifact" | "getWorkspaceArtifactHtml"> & Partial<Pick<OpenGeniClient, "getWorkspaceArtifactContent">>;
|
|
6
|
+
/** The exact saved Site a tool bridge is pinned to (absent for inline HTML). */
|
|
7
|
+
export type SiteToolScope = {
|
|
8
|
+
artifactId: string;
|
|
9
|
+
siteVersionId: string;
|
|
10
|
+
requestedTools: readonly ToolGatewayIdentity[];
|
|
11
|
+
};
|
|
12
|
+
/** Host-owned Site API access. Omit it and Sites render without workspace tools. */
|
|
13
|
+
export type SiteToolBridgeFactory = (site?: SiteToolScope) => PublishedHtmlArtifactToolBridge | undefined;
|
|
14
|
+
export type ChatInteractiveBlockProps = {
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
kind: "html" | "site";
|
|
17
|
+
content: string;
|
|
18
|
+
client: SiteSnapshotClient;
|
|
19
|
+
toolBridge?: SiteToolBridgeFactory | undefined;
|
|
20
|
+
theme?: "light" | "dark" | undefined;
|
|
21
|
+
/** Translations for the preview's copy; defaults to English. */
|
|
22
|
+
labels?: Partial<ArtifactLabels> | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Inline preview for an assistant `opengeni-html` or `opengeni-site` fence, as
|
|
26
|
+
* the OpenGeni console renders it. "Open Site" goes through the nearest
|
|
27
|
+
* `resolveLink`, so a host decides where a Site opens.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ChatInteractiveBlock({ labels, ...props }: ChatInteractiveBlockProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Reserve the chat slot before starting expensive media work. Activation is
|
|
4
|
+
* one-way: scrolling away must not discard an interactive preview's state.
|
|
5
|
+
* The timeline parks at its initial tip in layout effects before this observer
|
|
6
|
+
* is attached, so historical previews above the entry viewport stay dormant.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DeferredChatMedia({ children, height, label, actionLabel, }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
height: number;
|
|
11
|
+
/** What is loading, as in "Load {label}". */
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
/** The complete (translated) activation label; overrides `label`. */
|
|
14
|
+
actionLabel?: string | undefined;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -5,9 +5,10 @@ export declare function editableArtifactProjectionKey(view: EditableArtifactSync
|
|
|
5
5
|
export declare function editableArtifactStatusLabel(view: EditableArtifactSyncView): string;
|
|
6
6
|
/** Revoked read authority must hide any projection retained before invalidation. */
|
|
7
7
|
export declare function editableArtifactAccessRevoked(view: EditableArtifactSyncView): boolean;
|
|
8
|
-
export declare function EditableArtifactMessage({ title, detail, retry, }: {
|
|
8
|
+
export declare function EditableArtifactMessage({ title, detail, retry, retryLabel, }: {
|
|
9
9
|
title: string;
|
|
10
10
|
detail: string;
|
|
11
11
|
retry?: (() => void) | undefined;
|
|
12
|
+
retryLabel?: string | undefined;
|
|
12
13
|
}): import("react").JSX.Element;
|
|
13
14
|
export declare function asEditableArtifactError(cause: unknown, fallback: string): Error;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { EditableArtifactResource } from "@opengeni/sdk/artifacts";
|
|
2
|
+
import { type CreateBrowserEditableArtifactSessionOptions, type EditableArtifactBrowserRuntime, type EditableArtifactCacheAuthority } from "@opengeni/sdk/editable-artifacts";
|
|
3
|
+
import { type ArtifactLoadErrorView } from "./artifact-chrome.js";
|
|
4
|
+
/**
|
|
5
|
+
* The browser kernels an editor needs, one per modality, plus the host-built
|
|
6
|
+
* Worker URL (for Vite: `@opengeni/sdk/editable-artifacts/worker?worker&url`).
|
|
7
|
+
* Kernels come from `@opengeni/artifact-kernel-wasm-{document,spreadsheet,presentation}`.
|
|
8
|
+
*/
|
|
9
|
+
export type EditableArtifactRuntimes = Readonly<{
|
|
10
|
+
document: Omit<EditableArtifactBrowserRuntime, "workerUrl" | "workerFactory">;
|
|
11
|
+
spreadsheet: Omit<EditableArtifactBrowserRuntime, "workerUrl" | "workerFactory">;
|
|
12
|
+
presentation: Omit<EditableArtifactBrowserRuntime, "workerUrl" | "workerFactory">;
|
|
13
|
+
workerUrl: string;
|
|
14
|
+
applicationOrigin?: string | undefined;
|
|
15
|
+
/** Loopback development only. */
|
|
16
|
+
allowInsecureDevelopmentAssets?: boolean | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
/** Everything needed to open one artifact for the current principal. */
|
|
19
|
+
export type OpenedEditableArtifact = Readonly<{
|
|
20
|
+
artifact: EditableArtifactResource;
|
|
21
|
+
authority: EditableArtifactCacheAuthority;
|
|
22
|
+
replicaId: string;
|
|
23
|
+
}>;
|
|
24
|
+
export type EditableArtifactViewProps = Readonly<{
|
|
25
|
+
/** Absolute API (or session proxy) base the live transport talks to. */
|
|
26
|
+
baseUrl: URL;
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
artifactId: string;
|
|
29
|
+
/** Resolve metadata, cache authority, and replica; called again on retry. */
|
|
30
|
+
open: (signal: AbortSignal) => Promise<OpenedEditableArtifact>;
|
|
31
|
+
runtimes: EditableArtifactRuntimes;
|
|
32
|
+
transport?: CreateBrowserEditableArtifactSessionOptions["transport"];
|
|
33
|
+
/** Show the editor's own title header (hosts with their own header hide it). */
|
|
34
|
+
showHeader?: boolean | undefined;
|
|
35
|
+
/** Re-open when this changes (for example the host's credential version). */
|
|
36
|
+
authorityKey?: string | undefined;
|
|
37
|
+
describeError?: ((error: unknown) => ArtifactLoadErrorView) | undefined;
|
|
38
|
+
onTitle?: ((title: string) => void) | undefined;
|
|
39
|
+
/** Loading copy; defaults to the `opening` label. */
|
|
40
|
+
loadingLabel?: string | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* One editable document, spreadsheet, or presentation with its first-party
|
|
44
|
+
* editor. The console dock/page and embedding hosts supply only data access.
|
|
45
|
+
*/
|
|
46
|
+
export declare function EditableArtifactView({ baseUrl, workspaceId, artifactId, open, runtimes, transport, showHeader, authorityKey, describeError, onTitle, loadingLabel, }: EditableArtifactViewProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export { ArtifactBadge, ArtifactLabelsProvider, DEFAULT_ARTIFACT_LABELS, useArtifactLabels, type ArtifactLabels, ArtifactButton, ArtifactLoading, ArtifactProblem, ArtifactSelect, ArtifactViewerHeader, artifactKindIcon, artifactKindSubtitle, artifactLoadErrorMessage, artifactLoadErrorView, type ArtifactKind, type ArtifactLoadErrorKind, type ArtifactLoadErrorView, } from "./artifact-chrome.js";
|
|
2
|
+
export { ArtifactSandbox, type ArtifactSandboxProps } from "./artifact-sandbox.js";
|
|
3
|
+
export { DeferredChatMedia } from "./deferred-chat-media.js";
|
|
4
|
+
export { ChatInteractiveBlock, type ChatInteractiveBlockProps, type SiteSnapshotClient, type SiteToolBridgeFactory, type SiteToolScope, } from "./chat-interactive-block.js";
|
|
5
|
+
export { SiteView, type SiteViewProps } from "./site-view.js";
|
|
6
|
+
export { EditableArtifactView, type EditableArtifactRuntimes, type EditableArtifactViewProps, type OpenedEditableArtifact, } from "./editable-artifact-view.js";
|
|
7
|
+
export { SessionArtifactViewer, type SessionArtifactTarget, type SessionArtifactViewerLabels, type SessionArtifactViewerProps, } from "./session-artifact-viewer.js";
|
|
1
8
|
export { ArtifactSurface, type ArtifactModality, type ArtifactSurfaceProps, } from "./artifact-surface.js";
|
|
2
9
|
export { PUBLISHED_HTML_ARTIFACT_IFRAME_SANDBOX, PublishedHtmlArtifactFrame, openGeniSiteBridgePortFromBootstrap, publishedHtmlArtifactDocument, type PublishedHtmlArtifactFrameProps, type PublishedHtmlArtifactToolBridge, } from "./published-html-artifact-frame.js";
|
|
3
10
|
export { SpreadsheetArtifactSurface, SpreadsheetGrid, SpreadsheetProjectionGrid, type SpreadsheetArtifactSurfaceProps, type SpreadsheetCommit, type SpreadsheetRangeCommit, type SpreadsheetGridProps, type SpreadsheetGridProjection, type SpreadsheetProjectionCell, type SpreadsheetProjectionGridProps, type SpreadsheetSelection, type SpreadsheetViewport, } from "./spreadsheet-grid.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs one task at a time; a task scheduled while another runs replaces any
|
|
3
|
+
* task still waiting, so only the newest request starts next. Editors use it
|
|
4
|
+
* for projection loads: replaying a long history emits one revision per
|
|
5
|
+
* committed transaction, and composing a projection for each of them at once
|
|
6
|
+
* would overrun the artifact Worker's bounded request queue.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createLatestTaskRunner(): (task: () => Promise<void>) => void;
|
|
9
|
+
/**
|
|
10
|
+
* One runner per artifact session. A composition still pending on a replaced
|
|
11
|
+
* session (for example one whose Worker stopped answering) must never hold up
|
|
12
|
+
* the next session's first load, so the runner is scoped to the session object
|
|
13
|
+
* rather than to the component.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useLatestTaskRunner(session: object): (task: () => Promise<void>) => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ClientOverride } from "../../session-context.js";
|
|
2
|
+
import { type ArtifactLabels } from "./artifact-chrome.js";
|
|
3
|
+
import { type EditableArtifactRuntimes } from "./editable-artifact-view.js";
|
|
4
|
+
import type { SiteToolBridgeFactory } from "./chat-interactive-block.js";
|
|
5
|
+
/** An artifact opened from a session: the targets agent links and Site previews name. */
|
|
6
|
+
export type SessionArtifactTarget = Readonly<{
|
|
7
|
+
kind: "editable-artifact";
|
|
8
|
+
artifactId: string;
|
|
9
|
+
title?: string | undefined;
|
|
10
|
+
} | {
|
|
11
|
+
kind: "site";
|
|
12
|
+
artifactId: string;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
/** Every string the viewer shows, including its Site frame and states. */
|
|
16
|
+
export type SessionArtifactViewerLabels = Partial<ArtifactLabels>;
|
|
17
|
+
export type SessionArtifactViewerProps = ClientOverride & Readonly<{
|
|
18
|
+
/** The conversation the artifact belongs to; the proxy only serves its artifacts. */
|
|
19
|
+
sessionId: string;
|
|
20
|
+
target: SessionArtifactTarget;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
/** Show a Back control, for example to return to the conversation on phones. */
|
|
23
|
+
onBack?: (() => void) | undefined;
|
|
24
|
+
/** Browser kernels and Worker for documents, spreadsheets, and presentations. */
|
|
25
|
+
editableRuntimes?: EditableArtifactRuntimes | undefined;
|
|
26
|
+
theme?: "light" | "dark" | undefined;
|
|
27
|
+
/** Host-owned Site API access; omit it and Sites render without workspace tools. */
|
|
28
|
+
siteToolBridge?: SiteToolBridgeFactory | undefined;
|
|
29
|
+
labels?: SessionArtifactViewerLabels | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* A host-mountable viewer for one editable artifact or Site from a session,
|
|
34
|
+
* with its own header (title, Back, Close). Mount it in any sized container
|
|
35
|
+
* (a side panel, a sheet); it fills it. Data flows through the provider's
|
|
36
|
+
* client and `createSessionProxyHandler({ artifacts: true })`, scoped to
|
|
37
|
+
* `sessionId`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function SessionArtifactViewer({ labels, ...props }: SessionArtifactViewerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SiteSnapshotClient, SiteToolBridgeFactory } from "./chat-interactive-block.js";
|
|
2
|
+
export type SiteViewProps = {
|
|
3
|
+
client: SiteSnapshotClient;
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
siteId: string;
|
|
6
|
+
/** Host-owned Site API access. Omit it and the Site renders without workspace tools. */
|
|
7
|
+
toolBridge?: SiteToolBridgeFactory | undefined;
|
|
8
|
+
theme?: "light" | "dark" | undefined;
|
|
9
|
+
/** Shown instead of the archived notice; the console links to its full page. */
|
|
10
|
+
archivedMessage?: string | undefined;
|
|
11
|
+
/** Show the Site title in the frame bar; hide it under a host header that already does. */
|
|
12
|
+
showTitle?: boolean | undefined;
|
|
13
|
+
/** Loading copy; defaults to "Loading Site…". */
|
|
14
|
+
loadingLabel?: string | undefined;
|
|
15
|
+
/** Called with the loaded title, for a host header. */
|
|
16
|
+
onTitle?: ((title: string) => void) | undefined;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A published Site filling its container: the console's session dock and an
|
|
21
|
+
* embedding host's artifact viewer render the same view.
|
|
22
|
+
*/
|
|
23
|
+
export declare function SiteView({ client, workspaceId, siteId, toolBridge, theme, archivedMessage, showTitle, loadingLabel, onTitle, className, }: SiteViewProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BrowserAction, BrowserActionReceipt, BrowserObservation } from "@opengeni/sdk/interaction";
|
|
2
2
|
/** Human fallback for native popup windows missing from Chromium page frames. */
|
|
3
3
|
export declare function BrowserSelectControl(props: {
|
|
4
|
+
/** Older controllers need an explicit read to discover native popup options. */
|
|
5
|
+
manualFallback?: boolean;
|
|
4
6
|
activation?: {
|
|
5
7
|
observation: BrowserObservation | null;
|
|
6
8
|
anchor: {
|
|
@@ -11,4 +13,4 @@ export declare function BrowserSelectControl(props: {
|
|
|
11
13
|
onDismiss?: () => void;
|
|
12
14
|
observe: () => Promise<BrowserObservation>;
|
|
13
15
|
act: (action: BrowserAction, observation: BrowserObservation) => Promise<BrowserActionReceipt>;
|
|
14
|
-
}): import("react").JSX.Element;
|
|
16
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
/** Language grammar loaders, keyed by the extension class we infer from the path. */
|
|
3
|
-
declare const LANGUAGE_LOADERS: Record<string, () => Promise<unknown>>;
|
|
4
2
|
/** Map a filename to a grammar key (or null for plain text — still fully editable). */
|
|
5
|
-
export declare function languageForPath(path: string):
|
|
3
|
+
export declare function languageForPath(path: string): string | null;
|
|
6
4
|
export type CodeEditorProps = {
|
|
7
5
|
/** Workspace-relative path — drives language inference (and the save target upstream). */
|
|
8
6
|
path: string;
|
|
@@ -62,4 +60,3 @@ export declare function reconcileEditorBuffer(current: EditorBufferState, incomi
|
|
|
62
60
|
* be saved back (which would corrupt it by writing the truncated prefix).
|
|
63
61
|
*/
|
|
64
62
|
export declare function CodeEditor({ path, initialContents, onSave, onOverwrite, onReload, onEditIntent, readOnly, themeType, loading, fallback, className, }: CodeEditorProps): import("react").JSX.Element;
|
|
65
|
-
export {};
|
|
@@ -15,7 +15,7 @@ export type DesktopViewerProps = {
|
|
|
15
15
|
/** Render the built-in Watching ⇄ Take control toggle (default true). */
|
|
16
16
|
showControlToggle?: boolean | undefined;
|
|
17
17
|
scaleViewport?: boolean | undefined;
|
|
18
|
-
/** Custom RFB factory (
|
|
18
|
+
/** Custom RFB factory; otherwise enableDesktopViewer() supplies lazy noVNC. */
|
|
19
19
|
rfbFactory?: DesktopRfbFactory | undefined;
|
|
20
20
|
/** Authenticated controller protocols for proxied RFB transports. */
|
|
21
21
|
webSocketProtocols?: string[] | undefined;
|
|
@@ -3,9 +3,12 @@ import { type GenieLoadingOptions } from "../timeline/genie-loading.js";
|
|
|
3
3
|
import type { DraftTimelineAnnotation, SessionEvent, SessionStatus } from "@opengeni/sdk";
|
|
4
4
|
import { type ReactNode } from "react";
|
|
5
5
|
import { type OlderHistoryLoader } from "../older-history.js";
|
|
6
|
+
import { type MarkdownProps } from "./markdown.js";
|
|
6
7
|
import { type OpenGeniLinkResolver } from "./open-geni-links.js";
|
|
7
8
|
import { type UserMessageDisclosureLabels } from "./user-message-body.js";
|
|
8
9
|
import { type AgentMessageItem, type AuthNeededItem, type TimelineGroup, type TimelineItem, type RetainedArtifactLoader, type RetainedScreenshotLoader, type VideoArtifactPlaybackLoader, type ToolRegistry, type TurnSummaryOptions, type UserMessageItem } from "../timeline/index.js";
|
|
10
|
+
import { type RenderAllowanceExhausted } from "../timeline/allowance-exhausted-row.js";
|
|
11
|
+
import type { AllowanceLabels } from "../usage/allowance-copy.js";
|
|
9
12
|
export type MessageTimelineProps = {
|
|
10
13
|
/** Exact durable search hit; clearing it removes highlighting without moving the reader. */
|
|
11
14
|
searchTarget?: TimelineSearchTarget | null | undefined;
|
|
@@ -23,6 +26,11 @@ export type MessageTimelineProps = {
|
|
|
23
26
|
renderMessageText?: ((text: string, item: AgentMessageItem | UserMessageItem, context: {
|
|
24
27
|
searchTarget: TimelineSearchTarget | null;
|
|
25
28
|
}) => ReactNode) | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Render assistant `opengeni-html` / `opengeni-site` fences in the default
|
|
31
|
+
* message renderer (`SessionConversation` supplies the inline Site preview).
|
|
32
|
+
*/
|
|
33
|
+
renderInteractiveBlock?: MarkdownProps["renderInteractiveBlock"];
|
|
26
34
|
/** Drill into a spawned worker session. */
|
|
27
35
|
onOpenSession?: ((sessionId: string) => void) | undefined;
|
|
28
36
|
/**
|
|
@@ -44,6 +52,15 @@ export type MessageTimelineProps = {
|
|
|
44
52
|
onReconnect?: ((item: AuthNeededItem) => void | Promise<void>) | undefined;
|
|
45
53
|
/** Host-owned inline connection setup. Return undefined to use the default recovery card. */
|
|
46
54
|
renderAuthNeeded?: ((item: AuthNeededItem) => ReactNode | undefined) | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Replace the "usage limit reached" row shown when a workspace or member
|
|
57
|
+
* usage allowance stops work (an `allowance_exhausted` refusal). Receives the
|
|
58
|
+
* typed refusal (scope, reset time) and the default row; return undefined to
|
|
59
|
+
* keep the default. Use it to point people at your own plan or admin page.
|
|
60
|
+
*/
|
|
61
|
+
renderAllowanceExhausted?: RenderAllowanceExhausted | undefined;
|
|
62
|
+
/** Replace the words of the default "usage limit reached" row. */
|
|
63
|
+
allowanceExhaustedLabels?: Partial<AllowanceLabels> | undefined;
|
|
47
64
|
/**
|
|
48
65
|
* Decide which durable authentication notices this timeline presents.
|
|
49
66
|
* Defaults to showing every notice. Embedded hosts can suppress notices for
|
|
@@ -121,8 +138,8 @@ export type MessageTimelineProps = {
|
|
|
121
138
|
* scrolls the in-memory window.
|
|
122
139
|
*/
|
|
123
140
|
onJumpToLatest?: (() => void | Promise<void>) | undefined;
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
141
|
+
/** @deprecated Retained for source compatibility; contextual prompt navigation
|
|
142
|
+
* uses only mounted prompts and never invokes this global resolver. */
|
|
126
143
|
onJumpToLatestQuestion?: (() => Promise<number | null>) | undefined;
|
|
127
144
|
/** Host-owned content appended after timeline groups, such as startup progress. */
|
|
128
145
|
trailingState?: ReactNode | undefined;
|
|
@@ -135,7 +152,7 @@ export type MessageTimelineProps = {
|
|
|
135
152
|
* cards, goal markers, and status transitions. Owns stick-to-bottom scrolling
|
|
136
153
|
* with a "jump to latest" affordance when the reader scrolls back.
|
|
137
154
|
*/
|
|
138
|
-
export declare function MessageTimeline({ resolveLink, userMessageDisclosureLabels, searchTarget, events, items, status: _status, renderMessageActions, renderMessageText, onOpenSession, onMemoryClick, onReconnect, renderAuthNeeded, shouldRenderAuthNeeded, resolveProviderLogo, toolRegistry, loadRetainedScreenshot, loadRetainedArtifact, loadVideoArtifactPlayback, computeLabel, genieLoading, turnSummary, autoFollow, onAnnotate, draftAnnotations, onDraftAnnotationSelect, hasOlder, loadingOlder, onLoadOlder, onJumpToStart, loadingOldest, hasNewer, loadingNewer, onLoadNewer, onJumpToLatest,
|
|
155
|
+
export declare function MessageTimeline({ resolveLink, renderInteractiveBlock, userMessageDisclosureLabels, searchTarget, events, items, status: _status, renderMessageActions, renderMessageText, onOpenSession, onMemoryClick, onReconnect, renderAuthNeeded, renderAllowanceExhausted, allowanceExhaustedLabels, shouldRenderAuthNeeded, resolveProviderLogo, toolRegistry, loadRetainedScreenshot, loadRetainedArtifact, loadVideoArtifactPlayback, computeLabel, genieLoading, turnSummary, autoFollow, onAnnotate, draftAnnotations, onDraftAnnotationSelect, hasOlder, loadingOlder, onLoadOlder, onJumpToStart, loadingOldest, hasNewer, loadingNewer, onLoadNewer, onJumpToLatest, trailingState, emptyState, className, }: MessageTimelineProps): import("react").JSX.Element;
|
|
139
156
|
/**
|
|
140
157
|
* Settled turns lift the final agent answer out as a sibling group. Include it
|
|
141
158
|
* in "Copy turn" when present so the chip copies the full assistant reply.
|
|
@@ -50,3 +50,19 @@ export declare function sessionLinkResolver(input: {
|
|
|
50
50
|
sessionId: string;
|
|
51
51
|
sandboxFiles?: boolean;
|
|
52
52
|
}): OpenGeniLinkResolver;
|
|
53
|
+
/** An editable artifact or Site to open in a host-mounted viewer. */
|
|
54
|
+
export type OpenGeniViewerTarget = Readonly<{
|
|
55
|
+
kind: "editable-artifact" | "site";
|
|
56
|
+
artifactId: string;
|
|
57
|
+
/** The link text the agent wrote, until the viewer loads the real title. */
|
|
58
|
+
title?: string | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* "Open in host viewer": resolve agent links to editable artifacts and Sites
|
|
62
|
+
* in this workspace to `open(target)`, for example to mount
|
|
63
|
+
* `SessionArtifactViewer` beside the conversation. Other targets fall through.
|
|
64
|
+
*/
|
|
65
|
+
export declare function viewerLinkResolver(input: {
|
|
66
|
+
workspaceId: string;
|
|
67
|
+
open: (target: OpenGeniViewerTarget) => void;
|
|
68
|
+
}): OpenGeniLinkResolver;
|
|
@@ -3,7 +3,7 @@ import { type ClientOverride } from "../session-context.js";
|
|
|
3
3
|
import { type ChatComposerProps } from "./chat-composer.js";
|
|
4
4
|
import { type HumanInputSurfaceProps } from "./human-input-surface.js";
|
|
5
5
|
import { type MessageTimelineProps } from "./message-timeline.js";
|
|
6
|
-
import { type OpenGeniLinkResolver } from "./open-geni-links.js";
|
|
6
|
+
import { type OpenGeniLinkResolver, type OpenGeniViewerTarget } from "./open-geni-links.js";
|
|
7
7
|
import type { UserMessageDisclosureLabels } from "./user-message-body.js";
|
|
8
8
|
export type SessionConversationProps = ClientOverride & {
|
|
9
9
|
sessionId: string;
|
|
@@ -16,8 +16,27 @@ export type SessionConversationProps = ClientOverride & {
|
|
|
16
16
|
* editable artifacts and Sites stay unavailable until the host resolves them.
|
|
17
17
|
*/
|
|
18
18
|
resolveLink?: OpenGeniLinkResolver | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Open agent links to editable artifacts and Sites in a host viewer, for
|
|
21
|
+
* example `SessionArtifactViewer` mounted beside the conversation. Asked
|
|
22
|
+
* after `resolveLink`.
|
|
23
|
+
*/
|
|
24
|
+
onOpenArtifact?: ((target: OpenGeniViewerTarget) => void) | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Inline previews for assistant `opengeni-site` / `opengeni-html` fences.
|
|
27
|
+
* Defaults to the OpenGeni preview (Site reads need the proxy's
|
|
28
|
+
* `artifacts` option); `false` shows the fence as code.
|
|
29
|
+
*/
|
|
30
|
+
renderInteractiveBlock?: MessageTimelineProps["renderInteractiveBlock"] | false;
|
|
19
31
|
/** Product-specific tool-call renderers; defaults to the built-in registry. */
|
|
20
32
|
toolRegistry?: MessageTimelineProps["toolRegistry"];
|
|
33
|
+
/**
|
|
34
|
+
* Replace the "usage limit reached" row for an `allowance_exhausted`
|
|
35
|
+
* refusal, for example to link your own plan or admin page.
|
|
36
|
+
*/
|
|
37
|
+
renderAllowanceExhausted?: MessageTimelineProps["renderAllowanceExhausted"];
|
|
38
|
+
/** Replace the words of the default "usage limit reached" row. */
|
|
39
|
+
allowanceExhaustedLabels?: MessageTimelineProps["allowanceExhaustedLabels"];
|
|
21
40
|
/**
|
|
22
41
|
* File attachments in the composer. Defaults to true; the attach control
|
|
23
42
|
* appears only when the deployment's client config enables file uploads.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimelinePillPlacement, TimelinePillPosition } from "./timeline-pill-placement.js";
|
|
2
|
+
/** The full contextual label may not fit beside a compact toolbar on phones. */
|
|
3
|
+
export declare function chooseQuestionPosition(pill: HTMLElement, frame: HTMLElement, scroller: HTMLElement, preference: readonly TimelinePillPlacement[], current: TimelinePillPosition): TimelinePillPosition;
|
|
4
|
+
/**
|
|
5
|
+
* Hit-testing for useTimelinePillPlacement, loaded only once a pill shows so it
|
|
6
|
+
* stays out of a session's first load.
|
|
7
|
+
*/
|
|
8
|
+
export declare function choosePlacement(pill: HTMLElement, frame: HTMLElement, scroller: HTMLElement, preference: readonly TimelinePillPlacement[], current: TimelinePillPlacement): TimelinePillPlacement;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/** Where a floating timeline pill sits along its edge of the conversation. */
|
|
3
|
+
export type TimelinePillPlacement = "start" | "center" | "end";
|
|
4
|
+
export type TimelinePillPosition = {
|
|
5
|
+
placement: TimelinePillPlacement;
|
|
6
|
+
offsetY: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Floating pills (Jump to latest, Back to your message) sit over the scrolling
|
|
10
|
+
* conversation. Prefer sliding one sideways when its spot would cover
|
|
11
|
+
* a control: a link, a button, or the label and chevron of a full-width row
|
|
12
|
+
* such as the active turn's "Working" header. Plain prose may sit under a pill;
|
|
13
|
+
* controls may not. The top contextual pill can also move below a toolbar when
|
|
14
|
+
* no horizontal slot fits. Only the pill moves — the scroller's size, padding, and
|
|
15
|
+
* scroll position never change — so timeline anchoring stays untouched.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTimelinePillPlacement({ pillRef, scrollerRef, active, preference, allowDownwardFallback, }: {
|
|
18
|
+
pillRef: RefObject<HTMLElement | null>;
|
|
19
|
+
scrollerRef: RefObject<HTMLElement | null>;
|
|
20
|
+
active: boolean;
|
|
21
|
+
/** Placements in order of preference; the first is the resting position. */
|
|
22
|
+
preference: readonly TimelinePillPlacement[];
|
|
23
|
+
allowDownwardFallback?: boolean;
|
|
24
|
+
}): TimelinePillPosition;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { UsageAllowancePeriod, WorkspaceUsageResponse } from "@opengeni/sdk/usage-allowances";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type UsageClientLike } from "../hooks/use-usage.js";
|
|
4
|
+
import { type AllowanceLabels } from "../usage/allowance-copy.js";
|
|
5
|
+
import { type UsageSummary } from "../usage/summary.js";
|
|
6
|
+
export type UsageLimitNoticeLabels = AllowanceLabels & {
|
|
7
|
+
/** "You've used 85% of your usage limit." */
|
|
8
|
+
memberWarning: (percent: string) => string;
|
|
9
|
+
/** "This workspace has used 85% of its usage budget." */
|
|
10
|
+
workspaceWarning: (percent: string) => string;
|
|
11
|
+
memberExhausted: string;
|
|
12
|
+
workspaceExhausted: string;
|
|
13
|
+
dismiss: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_USAGE_LIMIT_NOTICE_LABELS: UsageLimitNoticeLabels;
|
|
16
|
+
type NoticeBaseProps = {
|
|
17
|
+
labels?: Partial<UsageLimitNoticeLabels> | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Your own next step beside the message, for example an "Upgrade" or
|
|
20
|
+
* "Request more" button. Receives the summary so it can differ by scope.
|
|
21
|
+
*/
|
|
22
|
+
action?: ((summary: UsageSummary) => ReactNode) | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Remember a dismissed warning for this browser tab. The key should name the
|
|
25
|
+
* workspace; the period and scope are added for you, so a new warning (or a
|
|
26
|
+
* new period) shows again. Reaching the limit is never dismissible.
|
|
27
|
+
*/
|
|
28
|
+
dismissStorageKey?: string | undefined;
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
export type UsageLimitNoticeProps = NoticeBaseProps & {
|
|
32
|
+
/** A usage response you already loaded; omit it to read `/usage/me`. */
|
|
33
|
+
usage?: WorkspaceUsageResponse | null | undefined;
|
|
34
|
+
client?: UsageClientLike | undefined;
|
|
35
|
+
workspaceId?: string | undefined;
|
|
36
|
+
period?: UsageAllowancePeriod | undefined;
|
|
37
|
+
refreshKey?: unknown;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A calm line for the composer when a member is close to, or at, a usage
|
|
41
|
+
* limit: what happened, who can raise it, and when it resets. Renders nothing
|
|
42
|
+
* while usage is comfortable, unlimited, loading, or unreadable.
|
|
43
|
+
*/
|
|
44
|
+
export declare function UsageLimitNotice({ usage, client, workspaceId, period, refreshKey, ...view }: UsageLimitNoticeProps): import("react").JSX.Element;
|
|
45
|
+
/** Presentational notice for a summary you computed (`summarizeUsage`). */
|
|
46
|
+
export declare function UsageLimitNoticeView({ summary, labels: overrides, action, dismissStorageKey, className, }: NoticeBaseProps & {
|
|
47
|
+
summary: UsageSummary | null;
|
|
48
|
+
}): import("react").JSX.Element | null;
|
|
49
|
+
export {};
|