@opengeni/react 7.4.0-canary.36855269964001 → 7.4.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.
Files changed (157) hide show
  1. package/README.md +3 -48
  2. package/dist/artifacts-document.js +2 -3
  3. package/dist/artifacts-presentation.js +2 -3
  4. package/dist/artifacts-spreadsheet.js +2 -2
  5. package/dist/artifacts.d.ts +0 -1
  6. package/dist/artifacts.js +1402 -505
  7. package/dist/artifacts.js.map +1 -1
  8. package/dist/{browser-viewer-R6KK5VKR.js → browser-viewer-2E6R2Y4W.js} +4 -4
  9. package/dist/{chunk-WUISZ3WU.js → chunk-3E2AITTZ.js} +28 -32
  10. package/dist/{chunk-WUISZ3WU.js.map → chunk-3E2AITTZ.js.map} +1 -1
  11. package/dist/{chunk-PWUILT2U.js → chunk-5AZSK6MV.js} +2 -2
  12. package/dist/{chunk-Y2PRMYLC.js → chunk-DUEBTL3N.js} +3 -4
  13. package/dist/{chunk-Y2PRMYLC.js.map → chunk-DUEBTL3N.js.map} +1 -1
  14. package/dist/{chunk-7UAMYXJY.js → chunk-KNDIXZN6.js} +18 -25
  15. package/dist/{chunk-7UAMYXJY.js.map → chunk-KNDIXZN6.js.map} +1 -1
  16. package/dist/{chunk-P4G6K2E2.js → chunk-L4OSXQ6H.js} +884 -1119
  17. package/dist/chunk-L4OSXQ6H.js.map +1 -0
  18. package/dist/{chunk-LLIH7Q4B.js → chunk-S5JQ4R22.js} +19 -47
  19. package/dist/chunk-S5JQ4R22.js.map +1 -0
  20. package/dist/{chunk-A4UJB2MM.js → chunk-SEEVCT36.js} +2 -2
  21. package/dist/{chunk-UXJCQ5GH.js → chunk-UDD6DLLT.js} +1 -6
  22. package/dist/chunk-UDD6DLLT.js.map +1 -0
  23. package/dist/chunk-UGMKPUEM.js +299 -0
  24. package/dist/chunk-UGMKPUEM.js.map +1 -0
  25. package/dist/{chunk-ZCZHKJKZ.js → chunk-USXVQACU.js} +3 -3
  26. package/dist/{chunk-VABBF52G.js → chunk-V2ABIVYJ.js} +6 -70
  27. package/dist/chunk-V2ABIVYJ.js.map +1 -0
  28. package/dist/{chunk-TVO6GXR6.js → chunk-X4HIN6TV.js} +162 -71
  29. package/dist/chunk-X4HIN6TV.js.map +1 -0
  30. package/dist/{chunk-IIDEIBMC.js → chunk-XEJEOAOV.js} +38 -49
  31. package/dist/chunk-XEJEOAOV.js.map +1 -0
  32. package/dist/{chunk-ZKLCPBWN.js → chunk-Y3QTZN2F.js} +5 -5
  33. package/dist/{chunk-73BUNGLF.js → chunk-YZ3YYMOM.js} +1 -1
  34. package/dist/components/artifacts/editable-artifact-ui.d.ts +1 -2
  35. package/dist/components/artifacts/index.d.ts +0 -7
  36. package/dist/components/browser-select-control.d.ts +1 -3
  37. package/dist/components/message-timeline.d.ts +1 -18
  38. package/dist/components/open-geni-links.d.ts +0 -16
  39. package/dist/components/session-conversation.d.ts +1 -20
  40. package/dist/composer.js +3 -3
  41. package/dist/{computer-viewer-DJHPSP2J.js → computer-viewer-WMJE6OA3.js} +3 -3
  42. package/dist/connect.js +6 -7
  43. package/dist/connect.js.map +1 -1
  44. package/dist/hooks/latest-question.d.ts +1 -1
  45. package/dist/index.d.ts +2 -5
  46. package/dist/index.js +28 -39
  47. package/dist/index.js.map +1 -1
  48. package/dist/interaction.js +4 -4
  49. package/dist/{latest-question-KGCDK3XX.js → latest-question-QB4EUCW5.js} +3 -3
  50. package/dist/lib/format.d.ts +0 -3
  51. package/dist/machines.js +2 -2
  52. package/dist/{markdown-table-layout-QXSLK4BY.js → markdown-table-layout-PFUEZ2U4.js} +5 -37
  53. package/dist/markdown-table-layout-PFUEZ2U4.js.map +1 -0
  54. package/dist/{sandbox-files-4PMXDSDV.js → sandbox-files-PXPIZAFG.js} +2 -2
  55. package/dist/session-ui.d.ts +2 -5
  56. package/dist/session-ui.js +13 -23
  57. package/dist/session-ui.js.map +1 -1
  58. package/dist/session.js +3 -3
  59. package/dist/sites.js +289 -4
  60. package/dist/sites.js.map +1 -1
  61. package/dist/timeline/types.d.ts +1 -7
  62. package/dist/{timeline-annotation-selection-DMLMM2TX.js → timeline-annotation-selection-ODLVF4OI.js} +1 -6
  63. package/dist/timeline-annotation-selection-ODLVF4OI.js.map +1 -0
  64. package/package.json +3 -7
  65. package/src/artifacts.ts +0 -37
  66. package/src/components/artifacts/editable-artifact-ui.tsx +1 -3
  67. package/src/components/artifacts/editable-artifact-workbench.tsx +2 -5
  68. package/src/components/artifacts/editable-document.tsx +36 -34
  69. package/src/components/artifacts/editable-presentation.tsx +16 -21
  70. package/src/components/artifacts/index.ts +0 -41
  71. package/src/components/browser-select-control.tsx +1 -4
  72. package/src/components/browser-viewer.tsx +22 -81
  73. package/src/components/computer-viewer.tsx +23 -51
  74. package/src/components/markdown-table-layout.ts +5 -49
  75. package/src/components/markdown.tsx +2 -5
  76. package/src/components/message-timeline.tsx +434 -515
  77. package/src/components/open-geni-links.tsx +0 -24
  78. package/src/components/session-conversation.tsx +20 -131
  79. package/src/components/timeline-annotation-selection.tsx +0 -7
  80. package/src/hooks/use-available-models.ts +1 -1
  81. package/src/index.ts +0 -9
  82. package/src/lib/format.ts +0 -13
  83. package/src/session-ui.ts +0 -9
  84. package/src/timeline/projection.ts +4 -78
  85. package/src/timeline/types.ts +0 -7
  86. package/styles/compiled.css +0 -325
  87. package/dist/chat-interactive-block-VAGABN7J.js +0 -11
  88. package/dist/chunk-5CVXZA3Y.js +0 -292
  89. package/dist/chunk-5CVXZA3Y.js.map +0 -1
  90. package/dist/chunk-B3V6TG77.js +0 -41
  91. package/dist/chunk-B3V6TG77.js.map +0 -1
  92. package/dist/chunk-IIDEIBMC.js.map +0 -1
  93. package/dist/chunk-LLIH7Q4B.js.map +0 -1
  94. package/dist/chunk-P4G6K2E2.js.map +0 -1
  95. package/dist/chunk-RAIQYITC.js +0 -1772
  96. package/dist/chunk-RAIQYITC.js.map +0 -1
  97. package/dist/chunk-SCOTPE2I.js +0 -589
  98. package/dist/chunk-SCOTPE2I.js.map +0 -1
  99. package/dist/chunk-TVO6GXR6.js.map +0 -1
  100. package/dist/chunk-UXJCQ5GH.js.map +0 -1
  101. package/dist/chunk-VABBF52G.js.map +0 -1
  102. package/dist/chunk-WEHMPOXK.js +0 -39
  103. package/dist/chunk-WEHMPOXK.js.map +0 -1
  104. package/dist/chunk-XCHWDJ22.js +0 -107
  105. package/dist/chunk-XCHWDJ22.js.map +0 -1
  106. package/dist/components/artifacts/artifact-chrome.d.ts +0 -120
  107. package/dist/components/artifacts/artifact-sandbox.d.ts +0 -27
  108. package/dist/components/artifacts/chat-interactive-block.d.ts +0 -29
  109. package/dist/components/artifacts/deferred-chat-media.d.ts +0 -15
  110. package/dist/components/artifacts/editable-artifact-view.d.ts +0 -46
  111. package/dist/components/artifacts/latest-task-runner.d.ts +0 -15
  112. package/dist/components/artifacts/session-artifact-viewer.d.ts +0 -39
  113. package/dist/components/artifacts/site-view.d.ts +0 -23
  114. package/dist/components/timeline-pill-geometry.d.ts +0 -6
  115. package/dist/components/timeline-pill-placement.d.ts +0 -18
  116. package/dist/components/usage-limit-notice.d.ts +0 -49
  117. package/dist/components/usage-member-list.d.ts +0 -91
  118. package/dist/components/usage-meter.d.ts +0 -73
  119. package/dist/hooks/use-usage.d.ts +0 -40
  120. package/dist/markdown-table-layout-QXSLK4BY.js.map +0 -1
  121. package/dist/sandbox-files-4PMXDSDV.js.map +0 -1
  122. package/dist/timeline/allowance-exhausted-row.d.ts +0 -24
  123. package/dist/timeline-annotation-selection-DMLMM2TX.js.map +0 -1
  124. package/dist/timeline-pill-geometry-2G6EK47V.js +0 -73
  125. package/dist/timeline-pill-geometry-2G6EK47V.js.map +0 -1
  126. package/dist/usage/allowance-copy.d.ts +0 -25
  127. package/dist/usage/summary.d.ts +0 -35
  128. package/dist/usage.d.ts +0 -13
  129. package/dist/usage.js +0 -1073
  130. package/dist/usage.js.map +0 -1
  131. package/src/components/artifacts/artifact-chrome.tsx +0 -413
  132. package/src/components/artifacts/artifact-sandbox.tsx +0 -185
  133. package/src/components/artifacts/chat-interactive-block.tsx +0 -260
  134. package/src/components/artifacts/deferred-chat-media.tsx +0 -67
  135. package/src/components/artifacts/editable-artifact-view.tsx +0 -187
  136. package/src/components/artifacts/latest-task-runner.ts +0 -49
  137. package/src/components/artifacts/session-artifact-viewer.tsx +0 -376
  138. package/src/components/artifacts/site-view.tsx +0 -116
  139. package/src/components/timeline-pill-geometry.ts +0 -112
  140. package/src/components/timeline-pill-placement.ts +0 -81
  141. package/src/components/usage-limit-notice.tsx +0 -179
  142. package/src/components/usage-member-list.tsx +0 -792
  143. package/src/components/usage-meter.tsx +0 -382
  144. package/src/hooks/use-usage.ts +0 -100
  145. package/src/timeline/allowance-exhausted-row.tsx +0 -86
  146. package/src/usage/allowance-copy.ts +0 -64
  147. package/src/usage/summary.ts +0 -93
  148. package/src/usage.ts +0 -50
  149. /package/dist/{browser-viewer-R6KK5VKR.js.map → browser-viewer-2E6R2Y4W.js.map} +0 -0
  150. /package/dist/{chunk-PWUILT2U.js.map → chunk-5AZSK6MV.js.map} +0 -0
  151. /package/dist/{chunk-A4UJB2MM.js.map → chunk-SEEVCT36.js.map} +0 -0
  152. /package/dist/{chunk-ZCZHKJKZ.js.map → chunk-USXVQACU.js.map} +0 -0
  153. /package/dist/{chunk-ZKLCPBWN.js.map → chunk-Y3QTZN2F.js.map} +0 -0
  154. /package/dist/{chunk-73BUNGLF.js.map → chunk-YZ3YYMOM.js.map} +0 -0
  155. /package/dist/{chat-interactive-block-VAGABN7J.js.map → computer-viewer-WMJE6OA3.js.map} +0 -0
  156. /package/dist/{latest-question-KGCDK3XX.js.map → latest-question-QB4EUCW5.js.map} +0 -0
  157. /package/dist/{computer-viewer-DJHPSP2J.js.map → sandbox-files-PXPIZAFG.js.map} +0 -0
@@ -1,107 +0,0 @@
1
- // src/components/open-geni-links.tsx
2
- import { createContext, useContext, useMemo } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- var OpenGeniLinkContext = createContext(null);
5
- function chainLinkResolvers(...resolvers) {
6
- const active = resolvers.filter(
7
- (resolver) => Boolean(resolver)
8
- );
9
- if (active.length === 0) return null;
10
- if (active.length === 1) return active[0];
11
- return (target) => {
12
- for (const resolver of active) {
13
- const resolution = resolver(target);
14
- if (resolution) return resolution;
15
- }
16
- return null;
17
- };
18
- }
19
- function OpenGeniLinkProvider({
20
- resolveLink,
21
- children
22
- }) {
23
- const parent = useContext(OpenGeniLinkContext);
24
- const value = useMemo(() => chainLinkResolvers(resolveLink, parent), [resolveLink, parent]);
25
- return /* @__PURE__ */ jsx(OpenGeniLinkContext.Provider, { value, children });
26
- }
27
- function useOpenGeniLinkResolver() {
28
- return useContext(OpenGeniLinkContext);
29
- }
30
- var SANDBOX_DOWNLOAD_MAX_BYTES = 25 * 1024 * 1024;
31
- function saveBlob(blob, filename) {
32
- const url = URL.createObjectURL(blob);
33
- const link = document.createElement("a");
34
- link.href = url;
35
- link.download = filename;
36
- link.rel = "noopener";
37
- document.body.append(link);
38
- link.click();
39
- link.remove();
40
- setTimeout(() => URL.revokeObjectURL(url), 6e4);
41
- }
42
- function openUrl(url) {
43
- const link = document.createElement("a");
44
- link.href = url;
45
- link.rel = "noopener noreferrer";
46
- link.target = "_blank";
47
- document.body.append(link);
48
- link.click();
49
- link.remove();
50
- }
51
- function base64Bytes(content) {
52
- const binary = atob(content);
53
- const bytes = new Uint8Array(binary.length);
54
- for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
55
- return bytes;
56
- }
57
- function sessionLinkResolver(input) {
58
- const { client, workspaceId, sessionId } = input;
59
- return (target) => {
60
- if (target.kind === "file") {
61
- if (target.workspaceId !== null && target.workspaceId !== workspaceId) return null;
62
- if (typeof client.createFileDownloadUrl !== "function") return null;
63
- return {
64
- open: async () => {
65
- const { url } = await client.createFileDownloadUrl(workspaceId, target.fileId, {
66
- sessionId
67
- });
68
- openUrl(url);
69
- }
70
- };
71
- }
72
- if (target.kind === "sandbox-file") {
73
- if (input.sandboxFiles === false) return null;
74
- if (typeof client.fsRead !== "function") return null;
75
- return {
76
- open: async () => {
77
- const file = await client.fsRead(workspaceId, sessionId, {
78
- path: target.path,
79
- encoding: "base64",
80
- maxBytes: SANDBOX_DOWNLOAD_MAX_BYTES
81
- });
82
- if (file.truncated) throw new Error("File is too large to download here.");
83
- const name = file.path.split(/[\\/]/u).at(-1) || "download";
84
- const bytes = file.encoding === "base64" ? base64Bytes(file.content) : new TextEncoder().encode(file.content);
85
- saveBlob(new Blob([bytes], { type: "application/octet-stream" }), name);
86
- }
87
- };
88
- }
89
- return null;
90
- };
91
- }
92
- function viewerLinkResolver(input) {
93
- return (target) => {
94
- if (target.kind !== "editable-artifact" && target.kind !== "site") return null;
95
- if (target.workspaceId !== input.workspaceId) return null;
96
- return { open: () => input.open({ kind: target.kind, artifactId: target.artifactId }) };
97
- };
98
- }
99
-
100
- export {
101
- chainLinkResolvers,
102
- OpenGeniLinkProvider,
103
- useOpenGeniLinkResolver,
104
- sessionLinkResolver,
105
- viewerLinkResolver
106
- };
107
- //# sourceMappingURL=chunk-XCHWDJ22.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/open-geni-links.tsx"],"sourcesContent":["import type { OpenGeniClient, OpenGeniLinkTarget } from \"@opengeni/sdk\";\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\n\nexport type { OpenGeniLinkTarget };\n\n/**\n * How the host opens one OpenGeni object an agent linked in chat Markdown.\n *\n * - `{ href }` renders a real link (new tab) — use it for a host page URL.\n * - `{ open }` renders a button that runs the action (download, open a panel,\n * client-side navigation) with loading and retry states.\n * - `null` / `undefined` means \"not handled here\": the next resolver is asked,\n * and when none handles it the text renders as an unavailable reference —\n * never as a navigation that would 404 inside the host.\n */\nexport type OpenGeniLinkResolution =\n | { href: string; open?: undefined }\n | { open: () => void | Promise<void>; href?: undefined };\n\nexport type OpenGeniLinkResolver = (\n target: OpenGeniLinkTarget,\n) => OpenGeniLinkResolution | null | undefined;\n\nconst OpenGeniLinkContext = createContext<OpenGeniLinkResolver | null>(null);\n\n/** First resolver that handles a target wins. */\nexport function chainLinkResolvers(\n ...resolvers: ReadonlyArray<OpenGeniLinkResolver | null | undefined>\n): OpenGeniLinkResolver | null {\n const active = resolvers.filter((resolver): resolver is OpenGeniLinkResolver =>\n Boolean(resolver),\n );\n if (active.length === 0) return null;\n if (active.length === 1) return active[0]!;\n return (target) => {\n for (const resolver of active) {\n const resolution = resolver(target);\n if (resolution) return resolution;\n }\n return null;\n };\n}\n\n/**\n * Resolve OpenGeni object links (`artifact:`, `sandbox:`, editable artifacts,\n * Sites) for every {@link Markdown} body below. An inner provider is asked\n * before an outer one, so a host can override a single kind and keep defaults.\n */\nexport function OpenGeniLinkProvider({\n resolveLink,\n children,\n}: {\n resolveLink: OpenGeniLinkResolver | null | undefined;\n children: ReactNode;\n}) {\n const parent = useContext(OpenGeniLinkContext);\n const value = useMemo(() => chainLinkResolvers(resolveLink, parent), [resolveLink, parent]);\n return <OpenGeniLinkContext.Provider value={value}>{children}</OpenGeniLinkContext.Provider>;\n}\n\n/** The effective resolver from the nearest {@link OpenGeniLinkProvider}. */\nexport function useOpenGeniLinkResolver(): OpenGeniLinkResolver | null {\n return useContext(OpenGeniLinkContext);\n}\n\n// Every sandbox read the proxy forwards is bounded by the API's own maximum.\nconst SANDBOX_DOWNLOAD_MAX_BYTES = 25 * 1024 * 1024;\n\ntype SessionLinkClient = Partial<Pick<OpenGeniClient, \"createFileDownloadUrl\" | \"fsRead\">>;\n\nfunction saveBlob(blob: Blob, filename: string): void {\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n link.rel = \"noopener\";\n document.body.append(link);\n link.click();\n link.remove();\n setTimeout(() => URL.revokeObjectURL(url), 60_000);\n}\n\nfunction openUrl(url: string): void {\n // A signed download URL is attachment-disposition; an anchor click keeps the\n // page and survives popup blockers after the awaited URL request.\n const link = document.createElement(\"a\");\n link.href = url;\n link.rel = \"noopener noreferrer\";\n link.target = \"_blank\";\n document.body.append(link);\n link.click();\n link.remove();\n}\n\nfunction base64Bytes(content: string): Uint8Array<ArrayBuffer> {\n const binary = atob(content);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);\n return bytes;\n}\n\n/**\n * Default resolver for a session conversation that talks to OpenGeni through\n * the normal SDK client (for example behind `createSessionProxyHandler`):\n *\n * - `artifact:<file>` downloads the retained file through a short-lived URL.\n * - `sandbox:<path>` downloads when enabled by the host proxy capability.\n *\n * Editable artifacts and Sites have no default: they need a host surface\n * (see `@opengeni/react/artifacts/*` and `@opengeni/react/sites`), so they stay\n * unavailable until the host resolves them.\n */\nexport function sessionLinkResolver(input: {\n client: SessionLinkClient;\n workspaceId: string;\n sessionId: string;\n sandboxFiles?: boolean;\n}): OpenGeniLinkResolver {\n const { client, workspaceId, sessionId } = input;\n return (target) => {\n if (target.kind === \"file\") {\n if (target.workspaceId !== null && target.workspaceId !== workspaceId) return null;\n if (typeof client.createFileDownloadUrl !== \"function\") return null;\n return {\n open: async () => {\n const { url } = await client.createFileDownloadUrl!(workspaceId, target.fileId, {\n sessionId,\n });\n openUrl(url);\n },\n };\n }\n if (target.kind === \"sandbox-file\") {\n if (input.sandboxFiles === false) return null;\n if (typeof client.fsRead !== \"function\") return null;\n return {\n open: async () => {\n const file = await client.fsRead!(workspaceId, sessionId, {\n path: target.path,\n encoding: \"base64\",\n maxBytes: SANDBOX_DOWNLOAD_MAX_BYTES,\n });\n if (file.truncated) throw new Error(\"File is too large to download here.\");\n const name = file.path.split(/[\\\\/]/u).at(-1) || \"download\";\n const bytes =\n file.encoding === \"base64\"\n ? base64Bytes(file.content)\n : new TextEncoder().encode(file.content);\n saveBlob(new Blob([bytes], { type: \"application/octet-stream\" }), name);\n },\n };\n }\n return null;\n };\n}\n\n/** An editable artifact or Site to open in a host-mounted viewer. */\nexport type OpenGeniViewerTarget = Readonly<{\n kind: \"editable-artifact\" | \"site\";\n artifactId: string;\n /** The link text the agent wrote, until the viewer loads the real title. */\n title?: string | undefined;\n}>;\n\n/**\n * \"Open in host viewer\": resolve agent links to editable artifacts and Sites\n * in this workspace to `open(target)`, for example to mount\n * `SessionArtifactViewer` beside the conversation. Other targets fall through.\n */\nexport function viewerLinkResolver(input: {\n workspaceId: string;\n open: (target: OpenGeniViewerTarget) => void;\n}): OpenGeniLinkResolver {\n return (target) => {\n if (target.kind !== \"editable-artifact\" && target.kind !== \"site\") return null;\n if (target.workspaceId !== input.workspaceId) return null;\n return { open: () => input.open({ kind: target.kind, artifactId: target.artifactId }) };\n };\n}\n"],"mappings":"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","names":[]}
@@ -1,120 +0,0 @@
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 {};
@@ -1,27 +0,0 @@
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;
@@ -1,29 +0,0 @@
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;
@@ -1,15 +0,0 @@
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;
@@ -1,46 +0,0 @@
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,15 +0,0 @@
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;
@@ -1,39 +0,0 @@
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;
@@ -1,23 +0,0 @@
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 +0,0 @@
1
- import type { TimelinePillPlacement } from "./timeline-pill-placement.js";
2
- /**
3
- * Hit-testing for useTimelinePillPlacement, loaded only once a pill shows so it
4
- * stays out of a session's first load.
5
- */
6
- export declare function choosePlacement(pill: HTMLElement, frame: HTMLElement, scroller: HTMLElement, preference: readonly TimelinePillPlacement[], current: TimelinePillPlacement): TimelinePillPlacement;
@@ -1,18 +0,0 @@
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
- /**
5
- * Floating pills (Jump to latest, Latest question) sit over the scrolling
6
- * conversation. Slide one sideways, never up or down, when its spot would cover
7
- * a control: a link, a button, or the label and chevron of a full-width row
8
- * such as the active turn's "Working" header. Plain prose may sit under a pill;
9
- * controls may not. Only the pill moves — the scroller's size, padding, and
10
- * scroll position never change — so timeline anchoring stays untouched.
11
- */
12
- export declare function useTimelinePillPlacement({ pillRef, scrollerRef, active, preference, }: {
13
- pillRef: RefObject<HTMLElement | null>;
14
- scrollerRef: RefObject<HTMLElement | null>;
15
- active: boolean;
16
- /** Placements in order of preference; the first is the resting position. */
17
- preference: readonly TimelinePillPlacement[];
18
- }): TimelinePillPlacement;
@@ -1,49 +0,0 @@
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 {};
@@ -1,91 +0,0 @@
1
- import type { MemberAllowanceDefault, MemberAllowanceRule, MemberAllowanceUsage, WorkspaceUsageResponse } from "@opengeni/sdk/usage-allowances";
2
- /** How a member is named in the list. Usage rows carry only a subject id. */
3
- export type UsageMemberIdentity = {
4
- name: string;
5
- /** A second line: an email, a role, or "You". */
6
- detail?: string | null | undefined;
7
- };
8
- /**
9
- * Opt in to fixed-amount limits. Amounts are USD micros on the wire; your
10
- * format/parse decide the unit people type ("$50.00", "500 credits").
11
- */
12
- export type UsageAmountFormat = {
13
- format: (micros: number) => string;
14
- /** Returns micros, or null when the text is not a valid amount. */
15
- parse: (text: string) => number | null;
16
- /** Shown before the input, for example "$". */
17
- prefix?: string | undefined;
18
- /** The amount input's step in the person's unit. */
19
- step?: number | undefined;
20
- };
21
- export type UsageMemberListLabels = {
22
- listLabel: string;
23
- used: (percent: string) => string;
24
- noLimitUsed: string;
25
- amounts: (used: string, limit: string) => string;
26
- nearLimit: string;
27
- limitReached: string;
28
- limit: string;
29
- defaultEqualShare: (percent: string) => string;
30
- defaultNone: string;
31
- defaultShare: (percent: string) => string;
32
- defaultAmount: (amount: string) => string;
33
- share: (percent: string) => string;
34
- amount: (amount: string) => string;
35
- fixedAmountHidden: string;
36
- edit: (name: string) => string;
37
- editorTitle: (name: string) => string;
38
- optionDefault: string;
39
- optionShare: string;
40
- optionAmount: string;
41
- fixedAmountHint: string;
42
- shareSlider: string;
43
- shareInput: string;
44
- amountInput: string;
45
- equalShareMultiple: (multiple: string) => string;
46
- sameAsEqualShare: string;
47
- atBudget: (amount: string) => string;
48
- save: string;
49
- saving: string;
50
- cancel: string;
51
- saveFailed: string;
52
- invalidAmount: string;
53
- totalWithin: (percent: string) => string;
54
- totalOver: (percent: string) => string;
55
- oversubscribedHelp: string;
56
- unlimitedMembers: (count: number) => string;
57
- empty: string;
58
- };
59
- export declare const DEFAULT_USAGE_MEMBER_LIST_LABELS: UsageMemberListLabels;
60
- export type UsageMemberListProps = {
61
- /** The full roster for one period (`getAllUsage` / every `getUsage` page). */
62
- usage: WorkspaceUsageResponse;
63
- /** The workspace's `memberDefault`, to name what "default" means. */
64
- memberDefault?: MemberAllowanceDefault | null | undefined;
65
- /** Name a member. Defaults to the external id, then the subject id. */
66
- describe?: ((member: MemberAllowanceUsage) => UsageMemberIdentity) | undefined;
67
- /**
68
- * Save a member's rule (`null` restores the default). Omit for a read-only
69
- * list. Run it on your backend: member limits need workspace admin authority.
70
- */
71
- onChangeRule?: ((member: MemberAllowanceUsage, rule: MemberAllowanceRule) => Promise<void>) | undefined;
72
- /** Opt in to amounts and fixed-amount limits. Shares only without it. */
73
- amounts?: UsageAmountFormat | undefined;
74
- labels?: Partial<UsageMemberListLabels> | undefined;
75
- /** Draw the list's own border. Turn off inside a card that already has one. */
76
- framed?: boolean | undefined;
77
- className?: string | undefined;
78
- };
79
- /** Words for a member's current limit, from their override or the default. */
80
- export declare function describeMemberLimit(member: Pick<MemberAllowanceUsage, "rule" | "limit">, context: {
81
- memberDefault: MemberAllowanceDefault | null | undefined;
82
- shareBase: number;
83
- amounts?: UsageAmountFormat | undefined;
84
- labels?: Partial<UsageMemberListLabels> | undefined;
85
- }): string;
86
- /**
87
- * Every member's usage against their own limit, with an optional editor:
88
- * a share-of-budget slider (default), a fixed amount, or the workspace
89
- * default. Oversubscription is shown, never blocked.
90
- */
91
- export declare function UsageMemberList({ usage, memberDefault, describe, onChangeRule, amounts, labels: overrides, framed, className, }: UsageMemberListProps): import("react").JSX.Element;