@opengeni/react 1.4.0 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/accounts.js +2 -0
- package/dist/accounts.js.map +1 -1
- package/dist/artifacts-document.js +5 -4
- package/dist/artifacts-presentation.js +5 -4
- package/dist/artifacts-spreadsheet.js +4 -3
- package/dist/artifacts.js +14 -13
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-5EEAS3IU.js +17 -0
- package/dist/chat-interactive-block-ZFHOKTMS.js +12 -0
- package/dist/{chunk-WEHMPOXK.js → chunk-2DDJ6YH6.js} +3 -1
- package/dist/{chunk-WEHMPOXK.js.map → chunk-2DDJ6YH6.js.map} +1 -1
- package/dist/{chunk-C5X5AJXK.js → chunk-2HVLQ26H.js} +5 -4
- package/dist/{chunk-C5X5AJXK.js.map → chunk-2HVLQ26H.js.map} +1 -1
- package/dist/{chunk-HDJWDK7W.js → chunk-2OQA3CPB.js} +300 -166
- package/dist/{chunk-HDJWDK7W.js.map → chunk-2OQA3CPB.js.map} +1 -1
- package/dist/{chunk-A4UJB2MM.js → chunk-32CGLXW2.js} +4 -3
- package/dist/{chunk-A4UJB2MM.js.map → chunk-32CGLXW2.js.map} +1 -1
- package/dist/{chunk-5CVXZA3Y.js → chunk-45NUOSXQ.js} +3 -2
- package/dist/{chunk-5CVXZA3Y.js.map → chunk-45NUOSXQ.js.map} +1 -1
- package/dist/{chunk-WUISZ3WU.js → chunk-53KJBGPZ.js} +5 -4
- package/dist/{chunk-WUISZ3WU.js.map → chunk-53KJBGPZ.js.map} +1 -1
- package/dist/{chunk-MBMPHOMA.js → chunk-55DXD22O.js} +3 -2
- package/dist/{chunk-MBMPHOMA.js.map → chunk-55DXD22O.js.map} +1 -1
- package/dist/{chunk-JT4JW7BC.js → chunk-5I4VRWBB.js} +3 -1
- package/dist/{chunk-JT4JW7BC.js.map → chunk-5I4VRWBB.js.map} +1 -1
- package/dist/{chunk-UK4TINKT.js → chunk-B27E3V37.js} +3 -1
- package/dist/{chunk-UK4TINKT.js.map → chunk-B27E3V37.js.map} +1 -1
- package/dist/{chunk-J6DBS4T3.js → chunk-BNKV5ZLF.js} +5 -4
- package/dist/{chunk-J6DBS4T3.js.map → chunk-BNKV5ZLF.js.map} +1 -1
- package/dist/{chunk-YM2DE7BQ.js → chunk-C5BF4L26.js} +13 -12
- package/dist/{chunk-YM2DE7BQ.js.map → chunk-C5BF4L26.js.map} +1 -1
- package/dist/{chunk-YBXQDQFX.js → chunk-C7CMD56T.js} +6 -5
- package/dist/{chunk-YBXQDQFX.js.map → chunk-C7CMD56T.js.map} +1 -1
- package/dist/{chunk-UGLEYEMP.js → chunk-CM7LVUKC.js} +3 -1
- package/dist/{chunk-UGLEYEMP.js.map → chunk-CM7LVUKC.js.map} +1 -1
- package/dist/{chunk-JVYQRRC4.js → chunk-CVYCLFMH.js} +3 -1
- package/dist/{chunk-JVYQRRC4.js.map → chunk-CVYCLFMH.js.map} +1 -1
- package/dist/{chunk-LJ2UTJJE.js → chunk-EAOSEIXB.js} +182 -97
- package/dist/chunk-EAOSEIXB.js.map +1 -0
- package/dist/{chunk-Y2PRMYLC.js → chunk-G3U2A6GS.js} +3 -2
- package/dist/{chunk-Y2PRMYLC.js.map → chunk-G3U2A6GS.js.map} +1 -1
- package/dist/{chunk-WZMYFJD3.js → chunk-G6YRCIYJ.js} +16 -7
- package/dist/{chunk-WZMYFJD3.js.map → chunk-G6YRCIYJ.js.map} +1 -1
- package/dist/{chunk-B3V6TG77.js → chunk-GC3PH6N7.js} +3 -1
- package/dist/{chunk-B3V6TG77.js.map → chunk-GC3PH6N7.js.map} +1 -1
- package/dist/{chunk-CJUO7J5Z.js → chunk-HXYOSSQO.js} +3 -2
- package/dist/{chunk-CJUO7J5Z.js.map → chunk-HXYOSSQO.js.map} +1 -1
- package/dist/{chunk-GYVRFZDY.js → chunk-I6OY3MWC.js} +310 -115
- package/dist/chunk-I6OY3MWC.js.map +1 -0
- package/dist/{chunk-BRM6FVZA.js → chunk-IEE7WCLN.js} +4 -3
- package/dist/{chunk-BRM6FVZA.js.map → chunk-IEE7WCLN.js.map} +1 -1
- package/dist/{chunk-DYWBUX5Q.js → chunk-IMSUVYQB.js} +6 -5
- package/dist/{chunk-DYWBUX5Q.js.map → chunk-IMSUVYQB.js.map} +1 -1
- package/dist/{chunk-LN6TCXD3.js → chunk-IUHHPMAX.js} +184 -48
- package/dist/chunk-IUHHPMAX.js.map +1 -0
- package/dist/{chunk-SGKD2OCN.js → chunk-IYQCWGU5.js} +6 -5
- package/dist/{chunk-SGKD2OCN.js.map → chunk-IYQCWGU5.js.map} +1 -1
- package/dist/{chunk-J2QWVSQY.js → chunk-JH7V627O.js} +8 -7
- package/dist/{chunk-J2QWVSQY.js.map → chunk-JH7V627O.js.map} +1 -1
- package/dist/{chunk-EESD3PY3.js → chunk-JHTIMBOL.js} +6 -5
- package/dist/{chunk-EESD3PY3.js.map → chunk-JHTIMBOL.js.map} +1 -1
- package/dist/{chunk-LNIRAOA3.js → chunk-L2J3PU7A.js} +7 -6
- package/dist/{chunk-LNIRAOA3.js.map → chunk-L2J3PU7A.js.map} +1 -1
- package/dist/{chunk-ZYRGEKWS.js → chunk-LJUMYUBO.js} +3 -1
- package/dist/{chunk-ZYRGEKWS.js.map → chunk-LJUMYUBO.js.map} +1 -1
- package/dist/{chunk-4RVYOY4O.js → chunk-LSW2OJVV.js} +4 -3
- package/dist/{chunk-4RVYOY4O.js.map → chunk-LSW2OJVV.js.map} +1 -1
- package/dist/{chunk-UTRTG6LH.js → chunk-LVS3MH5T.js} +3 -1
- package/dist/{chunk-UTRTG6LH.js.map → chunk-LVS3MH5T.js.map} +1 -1
- package/dist/chunk-M357MHH3.js +2 -0
- package/dist/{chunk-WRHIZYZF.js → chunk-MEQM4LI3.js} +6 -5
- package/dist/{chunk-WRHIZYZF.js.map → chunk-MEQM4LI3.js.map} +1 -1
- package/dist/chunk-NX4ADH73.js +14 -0
- package/dist/chunk-NX4ADH73.js.map +1 -0
- package/dist/{chunk-XCHWDJ22.js → chunk-OGTTUYNT.js} +3 -1
- package/dist/{chunk-XCHWDJ22.js.map → chunk-OGTTUYNT.js.map} +1 -1
- package/dist/{chunk-GIMRELBW.js → chunk-OYQQJL3J.js} +3 -1
- package/dist/{chunk-GIMRELBW.js.map → chunk-OYQQJL3J.js.map} +1 -1
- package/dist/{chunk-RSI7XYXL.js → chunk-PBCZL4JP.js} +6 -5
- package/dist/{chunk-RSI7XYXL.js.map → chunk-PBCZL4JP.js.map} +1 -1
- package/dist/{chunk-I7IWRQLN.js → chunk-PHBFJCEU.js} +17 -11
- package/dist/chunk-PHBFJCEU.js.map +1 -0
- package/dist/{chunk-3CTRFMAK.js → chunk-PKCAYHDC.js} +5 -4
- package/dist/{chunk-3CTRFMAK.js.map → chunk-PKCAYHDC.js.map} +1 -1
- package/dist/{chunk-K3HQAKQX.js → chunk-PMV53IMM.js} +3 -1
- package/dist/{chunk-K3HQAKQX.js.map → chunk-PMV53IMM.js.map} +1 -1
- package/dist/{chunk-YQEAA6LT.js → chunk-QHUE7E4N.js} +3 -2
- package/dist/{chunk-YQEAA6LT.js.map → chunk-QHUE7E4N.js.map} +1 -1
- package/dist/{chunk-OA6HFRQP.js → chunk-QMMCJGFI.js} +4 -3
- package/dist/{chunk-OA6HFRQP.js.map → chunk-QMMCJGFI.js.map} +1 -1
- package/dist/{chunk-YV4L3ILF.js → chunk-QV3DJVRZ.js} +3 -1
- package/dist/{chunk-YV4L3ILF.js.map → chunk-QV3DJVRZ.js.map} +1 -1
- package/dist/{chunk-447JLCBU.js → chunk-S2QH6EZ5.js} +3 -1
- package/dist/{chunk-447JLCBU.js.map → chunk-S2QH6EZ5.js.map} +1 -1
- package/dist/{chunk-PNY3JKBJ.js → chunk-SFH43JT2.js} +5 -4
- package/dist/{chunk-PNY3JKBJ.js.map → chunk-SFH43JT2.js.map} +1 -1
- package/dist/{chunk-AWZLIMKX.js → chunk-T46QZH3E.js} +3 -1
- package/dist/{chunk-AWZLIMKX.js.map → chunk-T46QZH3E.js.map} +1 -1
- package/dist/{chunk-5J4FOW6Q.js → chunk-TNEZNMSN.js} +3 -1
- package/dist/{chunk-5J4FOW6Q.js.map → chunk-TNEZNMSN.js.map} +1 -1
- package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
- package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
- package/dist/{chunk-H5X55XH7.js → chunk-UDPH5SLV.js} +4 -3
- package/dist/{chunk-H5X55XH7.js.map → chunk-UDPH5SLV.js.map} +1 -1
- package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
- package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
- package/dist/{chunk-5F4WR7X7.js → chunk-XS67YG5R.js} +3 -1
- package/dist/{chunk-5F4WR7X7.js.map → chunk-XS67YG5R.js.map} +1 -1
- package/dist/{chunk-TKOTKRWY.js → chunk-XTD7TZHW.js} +3 -1
- package/dist/{chunk-TKOTKRWY.js.map → chunk-XTD7TZHW.js.map} +1 -1
- package/dist/{chunk-A2PI6UMY.js → chunk-YSRBFJMQ.js} +3 -1
- package/dist/{chunk-A2PI6UMY.js.map → chunk-YSRBFJMQ.js.map} +1 -1
- package/dist/chunk-YVFRBXST.js +1420 -0
- package/dist/chunk-YVFRBXST.js.map +1 -0
- package/dist/{chunk-SCOTPE2I.js → chunk-YYLBXXTE.js} +3 -1
- package/dist/{chunk-SCOTPE2I.js.map → chunk-YYLBXXTE.js.map} +1 -1
- package/dist/{chunk-RHREZ7BO.js → chunk-ZUWF4NF7.js} +3 -1
- package/dist/{chunk-RHREZ7BO.js.map → chunk-ZUWF4NF7.js.map} +1 -1
- package/dist/clipboard.js +3 -2
- package/dist/components/composer-transcription-control.d.ts +4 -0
- package/dist/components/session-conversation.d.ts +6 -0
- package/dist/composer-voice-events.d.ts +8 -0
- package/dist/composer.js +15 -13
- package/dist/computer-viewer-ELNLZGHI.js +20 -0
- package/dist/connect.js +15 -12
- package/dist/connect.js.map +1 -1
- package/dist/desktop.js +6 -5
- package/dist/desktop.js.map +1 -1
- package/dist/diffs.js +2 -1
- package/dist/diffs.js.map +1 -1
- package/dist/editor.js +4 -3
- package/dist/editor.js.map +1 -1
- package/dist/embedded-voice-NIL4RDX3.js +69 -0
- package/dist/embedded-voice-NIL4RDX3.js.map +1 -0
- package/dist/{fleet-decision-row-YZ3ZKWMM.js → fleet-decision-row-SI63O5V4.js} +3 -1
- package/dist/{fleet-decision-row-YZ3ZKWMM.js.map → fleet-decision-row-SI63O5V4.js.map} +1 -1
- package/dist/hooks/use-client-config-flags.d.ts +6 -0
- package/dist/hooks/use-computer-session.d.ts +2 -0
- package/dist/hooks/use-realtime-voice-models.d.ts +9 -0
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/index.js +47 -45
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +14 -13
- package/dist/interaction.js.map +1 -1
- package/dist/{latest-question-GPYM2JNU.js → latest-question-2POFPYNB.js} +5 -4
- package/dist/{latest-question-GPYM2JNU.js.map → latest-question-2POFPYNB.js.map} +1 -1
- package/dist/machines.js +8 -7
- package/dist/{markdown-table-layout-QXSLK4BY.js → markdown-table-layout-DQ4DRNVT.js} +3 -1
- package/dist/{markdown-table-layout-QXSLK4BY.js.map → markdown-table-layout-DQ4DRNVT.js.map} +1 -1
- package/dist/model-policy-picker-menu-WRNSRFQC.js +15 -0
- package/dist/model-policy.js +2 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
- package/dist/{platform-activity-row-627BFZ46.js → platform-activity-row-PJJVATTZ.js} +3 -1
- package/dist/{platform-activity-row-627BFZ46.js.map → platform-activity-row-PJJVATTZ.js.map} +1 -1
- package/dist/{queue-surface-implementation-ZHFI5JBP.js → queue-surface-implementation-67FS7FUI.js} +10 -9
- package/dist/{queue-surface-implementation-ZHFI5JBP.js.map → queue-surface-implementation-67FS7FUI.js.map} +1 -1
- package/dist/realtime/embedded-voice.d.ts +20 -0
- package/dist/realtime.js +22 -1353
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-34CJJNOY.js +21 -0
- package/dist/session-ui.js +32 -30
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +10 -9
- package/dist/sites.js +2 -1
- package/dist/terminal.js +6 -5
- package/dist/terminal.js.map +1 -1
- package/dist/{timeline-annotation-markers-GNDHTGBD.js → timeline-annotation-markers-U3G66KUD.js} +5 -4
- package/dist/{timeline-annotation-markers-GNDHTGBD.js.map → timeline-annotation-markers-U3G66KUD.js.map} +1 -1
- package/dist/{timeline-annotation-selection-DMLMM2TX.js → timeline-annotation-selection-BI7QTPTZ.js} +4 -3
- package/dist/{timeline-annotation-selection-DMLMM2TX.js.map → timeline-annotation-selection-BI7QTPTZ.js.map} +1 -1
- package/dist/{timeline-annotations-dialog-ELRDBHTS.js → timeline-annotations-dialog-FOMHSDTE.js} +7 -6
- package/dist/{timeline-annotations-dialog-ELRDBHTS.js.map → timeline-annotations-dialog-FOMHSDTE.js.map} +1 -1
- package/dist/usage.js +6 -5
- package/dist/usage.js.map +1 -1
- package/dist/voice-recording-owner.d.ts +7 -0
- package/package.json +3 -3
- package/src/components/composer-transcription-control.tsx +109 -27
- package/src/components/computer-viewer.tsx +139 -30
- package/src/components/markdown.tsx +7 -2
- package/src/components/message-timeline.tsx +10 -1
- package/src/components/session-conversation.tsx +44 -0
- package/src/components/session-list.tsx +1 -1
- package/src/components/session-proxy-scope.tsx +26 -5
- package/src/composer-voice-events.ts +12 -0
- package/src/connection-discovery.tsx +4 -1
- package/src/hooks/use-browser-session.ts +445 -168
- package/src/hooks/use-client-config-flags.ts +8 -0
- package/src/hooks/use-computer-session.ts +334 -98
- package/src/hooks/use-goal.ts +12 -1
- package/src/hooks/use-realtime-voice-models.ts +67 -0
- package/src/hooks/use-voice-input.ts +109 -18
- package/src/realtime/embedded-voice.tsx +81 -0
- package/src/realtime/realtime-control.tsx +82 -17
- package/src/voice-recording-owner.ts +22 -0
- package/styles/compiled.css +77 -18
- package/styles/index.css +49 -0
- package/styles/responsive.css +61 -4
- package/styles/session-capability.css +1 -1
- package/dist/browser-viewer-SHYKQRNX.js +0 -16
- package/dist/chat-interactive-block-UGBTNB3L.js +0 -11
- package/dist/chunk-GYVRFZDY.js.map +0 -1
- package/dist/chunk-I7IWRQLN.js.map +0 -1
- package/dist/chunk-IWIDV7SB.js +0 -1
- package/dist/chunk-LJ2UTJJE.js.map +0 -1
- package/dist/chunk-LN6TCXD3.js.map +0 -1
- package/dist/computer-viewer-6SRGWRUX.js +0 -19
- package/dist/model-policy-picker-menu-DXHUL73H.js +0 -14
- package/dist/sandbox-files-GORZOUUJ.js +0 -20
- /package/dist/{browser-viewer-SHYKQRNX.js.map → browser-viewer-5EEAS3IU.js.map} +0 -0
- /package/dist/{chat-interactive-block-UGBTNB3L.js.map → chat-interactive-block-ZFHOKTMS.js.map} +0 -0
- /package/dist/{chunk-IWIDV7SB.js.map → chunk-M357MHH3.js.map} +0 -0
- /package/dist/{computer-viewer-6SRGWRUX.js.map → computer-viewer-ELNLZGHI.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-DXHUL73H.js.map → model-policy-picker-menu-WRNSRFQC.js.map} +0 -0
- /package/dist/{sandbox-files-GORZOUUJ.js.map → sandbox-files-34CJJNOY.js.map} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
cn
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TXS65BB2.js";
|
|
4
5
|
|
|
5
6
|
// src/components/artifacts/artifact-surface.tsx
|
|
6
7
|
import {
|
|
@@ -159,4 +160,4 @@ export {
|
|
|
159
160
|
EditableArtifactMessage,
|
|
160
161
|
asEditableArtifactError
|
|
161
162
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
163
|
+
//# sourceMappingURL=chunk-G3U2A6GS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/artifacts/artifact-surface.tsx","../src/components/artifacts/editable-artifact-ui.tsx"],"sourcesContent":["import {\n FileSpreadsheetIcon,\n FileTextIcon,\n LoaderCircleIcon,\n PresentationIcon,\n} from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nimport { cn } from \"../../lib/cn\";\n\nexport type ArtifactModality = \"spreadsheet\" | \"document\" | \"presentation\";\n\nexport type ArtifactSurfaceProps = {\n modality: ArtifactModality;\n title: string;\n /** An embedding host may already provide the artifact title and navigation. */\n showHeader?: boolean | undefined;\n subtitle?: ReactNode | undefined;\n actions?: ReactNode | undefined;\n children: ReactNode;\n footer?: ReactNode | undefined;\n busy?: boolean | undefined;\n className?: string | undefined;\n};\n\nconst MODALITY_LABEL: Record<ArtifactModality, string> = {\n spreadsheet: \"Spreadsheet\",\n document: \"Document\",\n presentation: \"Presentation\",\n};\n\nfunction ModalityIcon({ modality }: { modality: ArtifactModality }) {\n switch (modality) {\n case \"spreadsheet\":\n return <FileSpreadsheetIcon className=\"size-4\" />;\n case \"document\":\n return <FileTextIcon className=\"size-4\" />;\n case \"presentation\":\n return <PresentationIcon className=\"size-4\" />;\n }\n}\n\n/**\n * Modality-neutral artifact chrome. It deliberately owns no file, session, or\n * persistence state: hosts can use the same surface for a local draft, a\n * durable OpenGeni artifact, or a collaborative projection.\n */\nexport function ArtifactSurface({\n modality,\n title,\n showHeader = true,\n subtitle,\n actions,\n children,\n footer,\n busy = false,\n className,\n}: ArtifactSurfaceProps) {\n return (\n <section\n aria-label={`${MODALITY_LABEL[modality]}: ${title}`}\n aria-busy={busy || undefined}\n data-og-artifact-modality={modality}\n className={cn(\n \"og-root flex h-full min-h-0 min-w-0 flex-col overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1 text-og-fg shadow-og-md\",\n className,\n )}\n >\n {showHeader ? (\n <header className=\"flex min-h-11 shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-2 px-3\">\n <span\n aria-hidden\n className=\"grid size-7 shrink-0 place-items-center rounded-og-sm bg-og-surface-3 text-og-fg-muted\"\n >\n <ModalityIcon modality={modality} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <h2 className=\"truncate text-og-base font-medium text-og-fg\">{title}</h2>\n {subtitle ? (\n <div className=\"truncate text-og-xs text-og-fg-muted\">{subtitle}</div>\n ) : null}\n </div>\n {busy ? (\n <LoaderCircleIcon\n aria-label=\"Updating artifact\"\n className=\"size-4 shrink-0 animate-spin text-og-fg-muted\"\n />\n ) : null}\n {actions ? <div className=\"flex shrink-0 items-center gap-1\">{actions}</div> : null}\n </header>\n ) : (\n <>\n {typeof subtitle === \"string\" || typeof subtitle === \"number\" ? (\n <span role=\"status\" className=\"sr-only\">\n {subtitle}\n </span>\n ) : null}\n {actions ? (\n <div className=\"flex shrink-0 items-center justify-end gap-1 border-b border-og-border px-3 py-1\">\n {actions}\n </div>\n ) : null}\n </>\n )}\n\n <div className=\"min-h-0 min-w-0 flex-1\">{children}</div>\n\n {footer ? (\n <footer className=\"shrink-0 border-t border-og-border bg-og-surface-2\">{footer}</footer>\n ) : null}\n </section>\n );\n}\n","import type {\n EditableArtifactSession,\n EditableArtifactSyncView,\n} from \"@opengeni/sdk/editable-artifacts\";\nimport { useEffect, useState } from \"react\";\n\nexport function useEditableArtifactView(\n session: EditableArtifactSession,\n): EditableArtifactSyncView {\n const [view, setView] = useState(() => session.getView());\n useEffect(() => {\n setView(session.getView());\n return session.subscribe(setView);\n }, [session]);\n return view;\n}\n\n/** Changes whenever the Worker-resident speculative projection may have changed. */\nexport function editableArtifactProjectionKey(view: EditableArtifactSyncView): string {\n return [\n view.state,\n view.cursor,\n view.headSequence,\n view.pendingTransactions,\n view.blockedPending.map((entry) => `${entry.clientTransactionId}:${entry.code}`).join(\",\"),\n ].join(\":\");\n}\n\nexport function editableArtifactStatusLabel(view: EditableArtifactSyncView): string {\n switch (view.state) {\n case \"idle\":\n case \"connecting\":\n return \"Connecting…\";\n case \"syncing\":\n case \"resyncing\":\n return \"Syncing…\";\n case \"reconnecting\":\n return \"Reconnecting…\";\n case \"unsupported\":\n return \"This artifact version is not supported\";\n case \"failed\":\n if (editableArtifactAccessRevoked(view)) {\n return \"You no longer have access to this artifact\";\n }\n return view.lastError?.message ?? \"Could not open this artifact\";\n case \"closed\":\n return \"Artifact session closed\";\n case \"live\":\n return view.writable ? \"Live\" : \"Live · Read only\";\n }\n}\n\n/** Revoked read authority must hide any projection retained before invalidation. */\nexport function editableArtifactAccessRevoked(view: EditableArtifactSyncView): boolean {\n if (view.state !== \"failed\" || !view.lastError) return false;\n return (view.lastError as Error & Readonly<{ code?: unknown }>).code === \"permission_changed\";\n}\n\nexport function EditableArtifactMessage({\n title,\n detail,\n retry,\n retryLabel = \"Retry\",\n}: {\n title: string;\n detail: string;\n retry?: (() => void) | undefined;\n retryLabel?: string | undefined;\n}) {\n return (\n <div className=\"grid h-full min-h-56 place-items-center bg-og-bg p-6 text-center\">\n <div>\n <p className=\"text-og-base font-medium text-og-fg\">{title}</p>\n <p className=\"mt-1 max-w-lg text-og-sm text-og-fg-muted\">{detail}</p>\n {retry ? (\n <button\n type=\"button\"\n onClick={retry}\n className=\"mt-3 rounded-og-sm border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-1.5 text-og-sm font-medium hover:bg-og-primary-hover outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent\"\n >\n {retryLabel}\n </button>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport function asEditableArtifactError(cause: unknown, fallback: string): Error {\n return cause instanceof Error ? cause : new Error(fallback);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/artifacts/artifact-surface.tsx","../src/components/artifacts/editable-artifact-ui.tsx"],"sourcesContent":["import {\n FileSpreadsheetIcon,\n FileTextIcon,\n LoaderCircleIcon,\n PresentationIcon,\n} from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nimport { cn } from \"../../lib/cn\";\n\nexport type ArtifactModality = \"spreadsheet\" | \"document\" | \"presentation\";\n\nexport type ArtifactSurfaceProps = {\n modality: ArtifactModality;\n title: string;\n /** An embedding host may already provide the artifact title and navigation. */\n showHeader?: boolean | undefined;\n subtitle?: ReactNode | undefined;\n actions?: ReactNode | undefined;\n children: ReactNode;\n footer?: ReactNode | undefined;\n busy?: boolean | undefined;\n className?: string | undefined;\n};\n\nconst MODALITY_LABEL: Record<ArtifactModality, string> = {\n spreadsheet: \"Spreadsheet\",\n document: \"Document\",\n presentation: \"Presentation\",\n};\n\nfunction ModalityIcon({ modality }: { modality: ArtifactModality }) {\n switch (modality) {\n case \"spreadsheet\":\n return <FileSpreadsheetIcon className=\"size-4\" />;\n case \"document\":\n return <FileTextIcon className=\"size-4\" />;\n case \"presentation\":\n return <PresentationIcon className=\"size-4\" />;\n }\n}\n\n/**\n * Modality-neutral artifact chrome. It deliberately owns no file, session, or\n * persistence state: hosts can use the same surface for a local draft, a\n * durable OpenGeni artifact, or a collaborative projection.\n */\nexport function ArtifactSurface({\n modality,\n title,\n showHeader = true,\n subtitle,\n actions,\n children,\n footer,\n busy = false,\n className,\n}: ArtifactSurfaceProps) {\n return (\n <section\n aria-label={`${MODALITY_LABEL[modality]}: ${title}`}\n aria-busy={busy || undefined}\n data-og-artifact-modality={modality}\n className={cn(\n \"og-root flex h-full min-h-0 min-w-0 flex-col overflow-hidden rounded-og-lg border border-og-border bg-og-surface-1 text-og-fg shadow-og-md\",\n className,\n )}\n >\n {showHeader ? (\n <header className=\"flex min-h-11 shrink-0 items-center gap-2 border-b border-og-border bg-og-surface-2 px-3\">\n <span\n aria-hidden\n className=\"grid size-7 shrink-0 place-items-center rounded-og-sm bg-og-surface-3 text-og-fg-muted\"\n >\n <ModalityIcon modality={modality} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <h2 className=\"truncate text-og-base font-medium text-og-fg\">{title}</h2>\n {subtitle ? (\n <div className=\"truncate text-og-xs text-og-fg-muted\">{subtitle}</div>\n ) : null}\n </div>\n {busy ? (\n <LoaderCircleIcon\n aria-label=\"Updating artifact\"\n className=\"size-4 shrink-0 animate-spin text-og-fg-muted\"\n />\n ) : null}\n {actions ? <div className=\"flex shrink-0 items-center gap-1\">{actions}</div> : null}\n </header>\n ) : (\n <>\n {typeof subtitle === \"string\" || typeof subtitle === \"number\" ? (\n <span role=\"status\" className=\"sr-only\">\n {subtitle}\n </span>\n ) : null}\n {actions ? (\n <div className=\"flex shrink-0 items-center justify-end gap-1 border-b border-og-border px-3 py-1\">\n {actions}\n </div>\n ) : null}\n </>\n )}\n\n <div className=\"min-h-0 min-w-0 flex-1\">{children}</div>\n\n {footer ? (\n <footer className=\"shrink-0 border-t border-og-border bg-og-surface-2\">{footer}</footer>\n ) : null}\n </section>\n );\n}\n","import type {\n EditableArtifactSession,\n EditableArtifactSyncView,\n} from \"@opengeni/sdk/editable-artifacts\";\nimport { useEffect, useState } from \"react\";\n\nexport function useEditableArtifactView(\n session: EditableArtifactSession,\n): EditableArtifactSyncView {\n const [view, setView] = useState(() => session.getView());\n useEffect(() => {\n setView(session.getView());\n return session.subscribe(setView);\n }, [session]);\n return view;\n}\n\n/** Changes whenever the Worker-resident speculative projection may have changed. */\nexport function editableArtifactProjectionKey(view: EditableArtifactSyncView): string {\n return [\n view.state,\n view.cursor,\n view.headSequence,\n view.pendingTransactions,\n view.blockedPending.map((entry) => `${entry.clientTransactionId}:${entry.code}`).join(\",\"),\n ].join(\":\");\n}\n\nexport function editableArtifactStatusLabel(view: EditableArtifactSyncView): string {\n switch (view.state) {\n case \"idle\":\n case \"connecting\":\n return \"Connecting…\";\n case \"syncing\":\n case \"resyncing\":\n return \"Syncing…\";\n case \"reconnecting\":\n return \"Reconnecting…\";\n case \"unsupported\":\n return \"This artifact version is not supported\";\n case \"failed\":\n if (editableArtifactAccessRevoked(view)) {\n return \"You no longer have access to this artifact\";\n }\n return view.lastError?.message ?? \"Could not open this artifact\";\n case \"closed\":\n return \"Artifact session closed\";\n case \"live\":\n return view.writable ? \"Live\" : \"Live · Read only\";\n }\n}\n\n/** Revoked read authority must hide any projection retained before invalidation. */\nexport function editableArtifactAccessRevoked(view: EditableArtifactSyncView): boolean {\n if (view.state !== \"failed\" || !view.lastError) return false;\n return (view.lastError as Error & Readonly<{ code?: unknown }>).code === \"permission_changed\";\n}\n\nexport function EditableArtifactMessage({\n title,\n detail,\n retry,\n retryLabel = \"Retry\",\n}: {\n title: string;\n detail: string;\n retry?: (() => void) | undefined;\n retryLabel?: string | undefined;\n}) {\n return (\n <div className=\"grid h-full min-h-56 place-items-center bg-og-bg p-6 text-center\">\n <div>\n <p className=\"text-og-base font-medium text-og-fg\">{title}</p>\n <p className=\"mt-1 max-w-lg text-og-sm text-og-fg-muted\">{detail}</p>\n {retry ? (\n <button\n type=\"button\"\n onClick={retry}\n className=\"mt-3 rounded-og-sm border border-og-primary-border bg-og-primary text-og-primary-fg px-3 py-1.5 text-og-sm font-medium hover:bg-og-primary-hover outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent\"\n >\n {retryLabel}\n </button>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport function asEditableArtifactError(cause: unknown, fallback: string): Error {\n return cause instanceof Error ? cause : new Error(fallback);\n}\n"],"mappings":";;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA6BM,SAyDL,UAzDK,KA0CH,YA1CG;AATb,IAAM,iBAAmD;AAAA,EACvD,aAAa;AAAA,EACb,UAAU;AAAA,EACV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A;AAAA,EACA,aAAa;AACf,GAKG;AACD,SACE,gBAAAD,KAAC,SAAI,WAAU,oEACb,0BAAAC,MAAC,SACC;AAAA,oBAAAD,KAAC,OAAE,WAAU,uCAAuC,iBAAM;AAAA,IAC1D,gBAAAA,KAAC,OAAE,WAAU,6CAA6C,kBAAO;AAAA,IAChE,QACC,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,WAAU;AAAA,QAET;AAAA;AAAA,IACH,IACE;AAAA,KACN,GACF;AAEJ;AAEO,SAAS,wBAAwB,OAAgB,UAAyB;AAC/E,SAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,QAAQ;AAC5D;","names":["jsx","jsxs"]}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import {
|
|
2
3
|
buildTimeline,
|
|
3
4
|
groupTimeline,
|
|
4
5
|
sessionStatusFromEvents
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QMMCJGFI.js";
|
|
6
7
|
import {
|
|
7
8
|
useDebouncedCallback,
|
|
8
9
|
useMutationRunner,
|
|
9
10
|
usePageLiveActivity,
|
|
10
11
|
usePolledValue,
|
|
11
12
|
useSessionEventTrigger
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QHUE7E4N.js";
|
|
13
14
|
import {
|
|
14
15
|
normalizeError,
|
|
15
16
|
useErrorMessage
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CM7LVUKC.js";
|
|
17
18
|
import {
|
|
18
19
|
useEmbeddedFileAttachments,
|
|
19
20
|
useEmbeddedGoal,
|
|
20
21
|
useEmbeddedHumanInputSession,
|
|
21
22
|
useEmbeddedSession,
|
|
22
23
|
useEmbeddedSessionRead
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XTD7TZHW.js";
|
|
24
25
|
|
|
25
26
|
// src/human-input.ts
|
|
26
27
|
function isActionableHumanInputRequest(request, nowMs = Date.now()) {
|
|
@@ -891,7 +892,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
891
892
|
let generation = navigationGenerationRef.current;
|
|
892
893
|
const current = () => ownsNavigation() && generation === navigationGenerationRef.current;
|
|
893
894
|
try {
|
|
894
|
-
const { resolveLatestQuestion } = await import("./latest-question-
|
|
895
|
+
const { resolveLatestQuestion } = await import("./latest-question-2POFPYNB.js");
|
|
895
896
|
if (!current()) return null;
|
|
896
897
|
const destination = await resolveLatestQuestion({
|
|
897
898
|
client,
|
|
@@ -2272,6 +2273,7 @@ function useGoal(sessionId, options = {}) {
|
|
|
2272
2273
|
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
2273
2274
|
const generation = useRef7(0);
|
|
2274
2275
|
const targetKeyRef = useRef7(null);
|
|
2276
|
+
const goalAbsentRef = useRef7(false);
|
|
2275
2277
|
const loadAbort = useRef7(null);
|
|
2276
2278
|
const retireLoads = useCallback7(() => {
|
|
2277
2279
|
generation.current += 1;
|
|
@@ -2291,6 +2293,7 @@ function useGoal(sessionId, options = {}) {
|
|
|
2291
2293
|
signal: controller.signal
|
|
2292
2294
|
});
|
|
2293
2295
|
if (ticket === generation.current) {
|
|
2296
|
+
goalAbsentRef.current = false;
|
|
2294
2297
|
setGoal(fetched);
|
|
2295
2298
|
setError(null);
|
|
2296
2299
|
setLoading(false);
|
|
@@ -2300,6 +2303,7 @@ function useGoal(sessionId, options = {}) {
|
|
|
2300
2303
|
return;
|
|
2301
2304
|
}
|
|
2302
2305
|
if (cause instanceof OpenGeniApiError && cause.status === 404) {
|
|
2306
|
+
goalAbsentRef.current = true;
|
|
2303
2307
|
setGoal(null);
|
|
2304
2308
|
setError(null);
|
|
2305
2309
|
} else {
|
|
@@ -2314,6 +2318,7 @@ function useGoal(sessionId, options = {}) {
|
|
|
2314
2318
|
const targetKey = `${workspaceId} ${sessionId ?? ""}`;
|
|
2315
2319
|
if (targetKeyRef.current !== targetKey) {
|
|
2316
2320
|
targetKeyRef.current = targetKey;
|
|
2321
|
+
goalAbsentRef.current = false;
|
|
2317
2322
|
setGoal(null);
|
|
2318
2323
|
setError(null);
|
|
2319
2324
|
}
|
|
@@ -2363,7 +2368,11 @@ function useGoal(sessionId, options = {}) {
|
|
|
2363
2368
|
sharedFeed
|
|
2364
2369
|
]);
|
|
2365
2370
|
const scheduleRefresh = useDebouncedCallback(() => void load());
|
|
2366
|
-
|
|
2371
|
+
const isRefreshEvent = useCallback7(
|
|
2372
|
+
(event) => goalAbsentRef.current ? isGoalEvent(event) : isGoalRefreshEvent(event),
|
|
2373
|
+
[]
|
|
2374
|
+
);
|
|
2375
|
+
useSessionEventTrigger(client, workspaceId, sessionId, isRefreshEvent, scheduleRefresh, {
|
|
2367
2376
|
enabled,
|
|
2368
2377
|
...sharedEvents !== void 0 ? { events: sharedEvents } : {}
|
|
2369
2378
|
});
|
|
@@ -2505,4 +2514,4 @@ export {
|
|
|
2505
2514
|
useGoal,
|
|
2506
2515
|
conversationTimeline
|
|
2507
2516
|
};
|
|
2508
|
-
//# sourceMappingURL=chunk-
|
|
2517
|
+
//# sourceMappingURL=chunk-G6YRCIYJ.js.map
|