@mgamadeus/ddd-agents 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -8
- package/boundary.json +15 -1
- package/dist/admin-chat-widgets.js +158 -0
- package/dist/admin-chat-widgets.js.map +1 -0
- package/dist/admin.js +90 -63
- package/dist/admin.js.map +1 -1
- package/dist/chat.js +16 -16
- package/dist/chat.js.map +1 -1
- package/dist/chunks/AgentScheduleOrderDraftPanel-DM6pz_hc.js +304 -0
- package/dist/chunks/AgentScheduleOrderDraftPanel-DM6pz_hc.js.map +1 -0
- package/dist/chunks/{ConversationMarkdown-DNQcVuz-.js → ConversationMarkdown-W8NzeAT1.js} +5 -5
- package/dist/chunks/{ConversationMarkdown-DNQcVuz-.js.map → ConversationMarkdown-W8NzeAT1.js.map} +1 -1
- package/dist/chunks/{ConversationMessageInputComposerWidgets-BlpIule7.js → ConversationMessageInputComposerWidgets-BH7axorv.js} +6 -6
- package/dist/chunks/{ConversationMessageInputComposerWidgets-BlpIule7.js.map → ConversationMessageInputComposerWidgets-BH7axorv.js.map} +1 -1
- package/dist/chunks/{VoiceBarsIcon-eODB_UTI.js → VoiceBarsIcon-CT2HQSBH.js} +4 -4
- package/dist/chunks/{VoiceBarsIcon-eODB_UTI.js.map → VoiceBarsIcon-CT2HQSBH.js.map} +1 -1
- package/dist/chunks/{WebSearchResultsConversationWidget-l9Aek_lG.js → WebSearchResultsConversationWidget-BM624Fcx.js} +71 -62
- package/dist/chunks/WebSearchResultsConversationWidget-BM624Fcx.js.map +1 -0
- package/dist/chunks/{agents-http-trace-mappers-rsbGAf2_.js → agents-http-trace-mappers-CuGZOFu-.js} +53 -14
- package/dist/chunks/agents-http-trace-mappers-CuGZOFu-.js.map +1 -0
- package/dist/chunks/{browser-request-interception-D678IemW.js → browser-request-interception-BnOQWLaJ.js} +2 -2
- package/dist/chunks/{browser-request-interception-D678IemW.js.map → browser-request-interception-BnOQWLaJ.js.map} +1 -1
- package/dist/chunks/{canvas-label-context-C1Pc_Ldo.js → canvas-label-context-BKRsrpye.js} +3 -3
- package/dist/chunks/{canvas-label-context-C1Pc_Ldo.js.map → canvas-label-context-BKRsrpye.js.map} +1 -1
- package/dist/chunks/{canvas-reducers-BYArW_Ji.js → canvas-reducers-CZaOPvdt.js} +2 -2
- package/dist/chunks/{canvas-reducers-BYArW_Ji.js.map → canvas-reducers-CZaOPvdt.js.map} +1 -1
- package/dist/chunks/{canvasBodies-BpLPp-S8.js → canvasBodies-CMqo5eHg.js} +4 -4
- package/dist/chunks/{canvasBodies-BpLPp-S8.js.map → canvasBodies-CMqo5eHg.js.map} +1 -1
- package/dist/chunks/{canvasStorage-DSspwRMg.js → canvasStorage-ceJ7yaBd.js} +2 -2
- package/dist/chunks/{canvasStorage-DSspwRMg.js.map → canvasStorage-ceJ7yaBd.js.map} +1 -1
- package/dist/chunks/{content-from-unified-diff-DWyBHRSy.js → content-from-unified-diff-BKdgop63.js} +39 -5
- package/dist/chunks/content-from-unified-diff-BKdgop63.js.map +1 -0
- package/dist/chunks/{contract-DtFmOk91.js → contract-CQ6PO_e8.js} +2 -2
- package/dist/chunks/{contract-DtFmOk91.js.map → contract-CQ6PO_e8.js.map} +1 -1
- package/dist/chunks/{conversation-Cbrqtx-_.js → conversation-VosmRbsr.js} +4 -2
- package/dist/chunks/{conversation-Cbrqtx-_.js.map → conversation-VosmRbsr.js.map} +1 -1
- package/dist/chunks/conversation-trace-fVeh6Lg6.js.map +1 -1
- package/dist/chunks/{widget-name-resolver-DXIE9JUr.js → conversationWidgetRegistry-BW-U_RvC.js} +810 -530
- package/dist/chunks/conversationWidgetRegistry-BW-U_RvC.js.map +1 -0
- package/dist/chunks/{index-DZovGMpG.js → index-DAEGct6X.js} +61 -61
- package/dist/chunks/index-DAEGct6X.js.map +1 -0
- package/dist/chunks/{link-navigation-a_sRfmsj.js → link-navigation-DQWyeNkx.js} +2 -2
- package/dist/chunks/{link-navigation-a_sRfmsj.js.map → link-navigation-DQWyeNkx.js.map} +1 -1
- package/dist/chunks/{withPollingChangeSubscription-Cz3Diolr.js → withPollingChangeSubscription-Ct8kjmlL.js} +19 -2
- package/dist/chunks/withPollingChangeSubscription-Ct8kjmlL.js.map +1 -0
- package/dist/client-testing.js +39 -5
- package/dist/client-testing.js.map +1 -1
- package/dist/client.js +43 -14
- package/dist/client.js.map +1 -1
- package/dist/contract.js +4 -3
- package/dist/files/i18n-keys.json +619 -15
- package/dist/files/widgets/DriveFilesConversationWidget/DriveFilesConversationWidget.md +4 -2
- package/dist/files/widgets/OwnerStepConfirmationConversationWidget/OwnerStepConfirmationConversationWidget.md +54 -0
- package/dist/files/widgets/OwnerStepConfirmationConversationWidget/owner-step-confirmation.preview-fixtures.json +16 -0
- package/dist/image-render.js +8 -8
- package/dist/index.js +16 -16
- package/dist/kit.js +2 -2
- package/dist/preview.js +124 -117
- package/dist/preview.js.map +1 -1
- package/dist/provider.js +2 -2
- package/dist/renderer.js +53 -52
- package/dist/styles.css +46 -0
- package/dist/types/admin/schedules/AgentScheduleOrderDraftPanel.d.ts +45 -0
- package/dist/types/admin/schedules/AgentSchedulesPanel.d.ts +11 -3
- package/dist/types/admin/schedules/agent-schedules-api.d.ts +38 -2
- package/dist/types/admin/schedules/agent-schedules-format.d.ts +22 -1
- package/dist/types/admin/schedules/agent-schedules-types.d.ts +91 -1
- package/dist/types/admin-chat-widgets/ScheduleOrderApprovalConversationWidget.d.ts +37 -0
- package/dist/types/admin-chat-widgets/registerScheduleOrderApprovalWidget.d.ts +11 -0
- package/dist/types/chat/trace/TurnMetaLine.d.ts +5 -3
- package/dist/types/chat/trace/trace-counts.d.ts +2 -0
- package/dist/types/chat/trace/trace-types.d.ts +4 -0
- package/dist/types/client/AgentsConversationClient.d.ts +17 -1
- package/dist/types/client/http/agents-http-mappers.d.ts +4 -2
- package/dist/types/client/http/agents-http-trace-wire.d.ts +2 -0
- package/dist/types/client/http/agents-http-wire.d.ts +24 -0
- package/dist/types/client/testing/createInMemoryAgentsConversationClient.d.ts +13 -1
- package/dist/types/contract/conversation-trace.d.ts +4 -0
- package/dist/types/contract/conversation.d.ts +43 -0
- package/dist/types/entries/admin-chat-widgets.d.ts +2 -0
- package/dist/types/entries/admin.d.ts +4 -2
- package/dist/types/entries/renderer.d.ts +1 -1
- package/dist/types/renderer/widget-tree/composed-node-schema.d.ts +20 -3
- package/dist/types/widgets/DriveFilesConversationWidget/shared/drive-files.d.ts +3 -1
- package/dist/voice.js +2 -2
- package/dist/widgets.js +4 -4
- package/package.json +7 -1
- package/public-api.json +39 -0
- package/dist/chunks/WebSearchResultsConversationWidget-l9Aek_lG.js.map +0 -1
- package/dist/chunks/agents-http-trace-mappers-rsbGAf2_.js.map +0 -1
- package/dist/chunks/content-from-unified-diff-DWyBHRSy.js.map +0 -1
- package/dist/chunks/index-DZovGMpG.js.map +0 -1
- package/dist/chunks/widget-name-resolver-DXIE9JUr.js.map +0 -1
- package/dist/chunks/withPollingChangeSubscription-Cz3Diolr.js.map +0 -1
package/dist/preview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sources":["../src/preview/preview-stub-components.tsx","../src/preview/widget-preview-app-hooks.ts","../src/renderer/_agent-space/declared-agent-space-key-field-name.ts","../src/preview/widget-preview-fixtures.ts","../src/preview/WidgetPreviewHost.tsx","../src/preview/widget-preview-signal.ts","../src/preview/widget-preview-readiness.ts","../src/preview/widget-preview-requests.ts","../src/preview/widget-preview-hydration.ts","../src/widgets/EntityMentionConversationWidget/stories/EntityMentionAskFlowStory.tsx"],"sourcesContent":["import { Text } from \"../provider/components\";\nimport type {\n ComposedViewComponentDefinition,\n ComposedViewComponentProps,\n} from \"../kit/composed-view-component-types\";\nimport {\n buildComposedViewComponentRegistry,\n composedViewComponents,\n} from \"../kit/composed-view-components\";\nimport { WidgetSurface } from \"../widgets/_shared/modern\";\nimport styles from \"./WidgetPreview.module.scss\";\n\n/**\n * Stand-ins for kit node types that have a schema but no component yet — only the preview uses\n * them, and only for a fixture that asks (`stubComposedViewComponents`). A real component always wins.\n */\nconst formatDuration = (durationSeconds: unknown): string | null => {\n if (typeof durationSeconds !== \"number\" || !Number.isFinite(durationSeconds) || durationSeconds < 0) return null;\n const minutes = Math.floor(durationSeconds / 60);\n const seconds = Math.floor(durationSeconds % 60);\n return `${minutes}:${String(seconds).padStart(2, \"0\")}`;\n};\n\nconst StubVideo = ({ props }: ComposedViewComponentProps) => {\n const duration = formatDuration(props.durationSeconds);\n return (\n <WidgetSurface level=\"flat\" compact>\n <div className={styles.stubVideo}>\n {typeof props.thumbnail === \"string\" ? (\n <img className={styles.stubVideoThumbnail} src={props.thumbnail} alt=\"\" />\n ) : null}\n <div className={styles.stubVideoText}>\n <Text role=\"body\" weight=\"bold\" translate={false}>\n {typeof props.title === \"string\" ? props.title : \"\"}\n </Text>\n <Text role=\"caption\" color=\"var(--agents-fg-light)\" translate={false}>\n {[typeof props.channel === \"string\" ? props.channel : null, duration].filter(Boolean).join(\" · \")}\n </Text>\n </div>\n </div>\n </WidgetSurface>\n );\n};\n\nconst PREVIEW_STUB_COMPONENTS: ComposedViewComponentDefinition[] = [{ nodeType: \"Video\", component: StubVideo }];\n\n/** The folder registry with a stub for every node type that has no component of its own. */\nexport const buildPreviewComposedViewComponents = () =>\n buildComposedViewComponentRegistry([\n ...Object.values(composedViewComponents),\n ...PREVIEW_STUB_COMPONENTS.filter(\n (stub) => !Object.prototype.hasOwnProperty.call(composedViewComponents, stub.nodeType),\n ),\n ]);\n","import { getAgentsEnvironment, setAgentsEnvironment } from \"../provider/environment\";\n\n/** What a widget handed to the app during a preview: the action and its target as one line. */\nexport type WidgetPreviewAppActionLogger = (text: string) => void;\n\nlet previewAppActionLogger: WidgetPreviewAppActionLogger | null = null;\n\n/**\n * Stand-ins for the app hooks a widget needs to render at all (`startConversationInPersonalSpace`,\n * `openConnectionPermissions`): outside the chat no app opens a space or its settings, so the preview logs the action\n * instead. A hook the app set stays the app's. Idempotent; the preview page keeps them while it lives.\n */\nexport const installWidgetPreviewAppHooks = (onAppAction: WidgetPreviewAppActionLogger): void => {\n previewAppActionLogger = onAppAction;\n const environment = getAgentsEnvironment();\n if (environment.startConversationInPersonalSpace && environment.openConnectionPermissions) return;\n setAgentsEnvironment({\n ...environment,\n startConversationInPersonalSpace:\n environment.startConversationInPersonalSpace ??\n ((ownerText: string) => previewAppActionLogger?.(`start in personal space: ${ownerText}`)),\n openConnectionPermissions:\n environment.openConnectionPermissions ??\n ((target) => previewAppActionLogger?.(`open connection permissions: ${JSON.stringify(target)}`)),\n });\n};\n","import {\n DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME,\n getWidgetSelfHydrationKeyFieldName,\n} from \"../../provider/environment\";\n\nconst DEFAULT_FIELD_NAME_PATTERN = new RegExp(`\\\\b${DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME}\\\\b`, \"g\");\n\n/**\n * A fixture of the package as the app reads it. The package's fixtures name the key of a block's agent space with the\n * package default field (`agentSpaceId`): as a key of an object, as a field in a block's JSON, as an attribute of a\n * block's markdown. An app that declares another field name (`AgentsEnvironment.widgetSelfHydrationKeyFieldName`)\n * reads every occurrence under its own name, so a fixture is mapped once, when it is loaded. Without a declaration\n * the fixture is returned as it is.\n */\nexport const mapFixtureToDeclaredAgentSpaceKeyFieldName = <Fixture>(fixture: Fixture): Fixture => {\n const declaredFieldName = getWidgetSelfHydrationKeyFieldName();\n if (declaredFieldName === DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME || fixture === undefined) return fixture;\n return JSON.parse(JSON.stringify(fixture).replace(DEFAULT_FIELD_NAME_PATTERN, declaredFieldName)) as Fixture;\n};\n","import { mapFixtureToDeclaredAgentSpaceKeyFieldName } from \"../renderer/_agent-space/declared-agent-space-key-field-name\";\nimport type { WidgetPreviewFixture, WidgetPreviewFixtureFile } from \"./widget-preview.types\";\n\n/**\n * Every `*.preview-fixtures.json` below the package's `widgets/` and `kit/`, by wire name — read by folder glob, so the\n * fixtures of a widget are added as one new file next to it; an app adds the fixtures of its widgets with\n * `registerWidgetPreviewFixtureFiles`. Imports nothing from the app, so the preview entry can read it before the\n * request transport is installed.\n */\nconst fixtureModules = import.meta.glob<WidgetPreviewFixtureFile>(\n [\"../widgets/**/*.preview-fixtures.json\", \"../kit/**/*.preview-fixtures.json\"],\n {\n eager: true,\n import: \"default\",\n },\n);\n\nconst sortByWireName = (fixtureFiles: WidgetPreviewFixtureFile[]): WidgetPreviewFixtureFile[] =>\n fixtureFiles.sort((first, second) => first.wireName.localeCompare(second.wireName));\n\n/** Every fixture file, sorted by wire name; filled in place by `registerWidgetPreviewFixtureFiles`. */\nexport const widgetPreviewFixtureFiles: WidgetPreviewFixtureFile[] = sortByWireName(Object.values(fixtureModules));\n\n/** Adds an app's fixture files (its glob stays in its code). Runs before the preview reads a fixture. */\nexport const registerWidgetPreviewFixtureFiles = (fixtureFiles: readonly WidgetPreviewFixtureFile[]): void => {\n widgetPreviewFixtureFiles.push(...fixtureFiles);\n sortByWireName(widgetPreviewFixtureFiles);\n};\n\n/**\n * The fixtures of a widget from EVERY file naming it — a `ComposedView` component can add its own file next to it\n * instead of editing the widget's — or an empty list. A fixture an app registers under the name of a package fixture\n * of the same widget replaces it in place (an app's copy with its own entity types and endpoints). Each is read under\n * the agent space key field the app declares (`mapFixtureToDeclaredAgentSpaceKeyFieldName`; the package's files name\n * `agentSpaceId`), at call time: an app installs its environment after this module is loaded.\n */\nexport const findWidgetPreviewFixtures = (widgetName: string): readonly WidgetPreviewFixture[] => {\n const fixturesByName = new Map<string, WidgetPreviewFixture>();\n for (const fixtureFile of widgetPreviewFixtureFiles) {\n if (fixtureFile.wireName !== widgetName) continue;\n for (const fixture of fixtureFile.fixtures) fixturesByName.set(fixture.name, fixture);\n }\n return [...fixturesByName.values()].map(mapFixtureToDeclaredAgentSpaceKeyFieldName);\n};\n\n/** One named fixture, or undefined. */\nexport const findWidgetPreviewFixture = (widgetName: string, fixtureName: string): WidgetPreviewFixture | undefined =>\n findWidgetPreviewFixtures(widgetName).find((fixture) => fixture.name === fixtureName);\n\n/** The fence the fixture stands for — what a canvas body re-reads as its anchor message. */\nexport const buildWidgetPreviewFence = (widgetName: string, fixture: WidgetPreviewFixture): string =>\n \"```widget\\n\" + JSON.stringify({ type: widgetName, ...fixture.payload }) + \"\\n```\";\n","import { Text } from \"../provider/components\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { conversationWidgetRegistry } from \"../renderer/conversationWidgetRegistry\";\nimport { resolveWidgetName } from \"../renderer/widget-name-resolver\";\nimport {\n buildWidgetAgentSpaceKeyProps,\n readWidgetAgentSpaceKeyAttribute,\n} from \"../renderer/_agent-space/widget-agent-space-key-attribute\";\nimport {\n CanvasOpenRequestFromOpener,\n ConversationWidgetCallbacks,\n StandaloneConversationWidgetProvider,\n} from \"../renderer/ConversationWidgetContext\";\nimport { ConversationWidgetRenderContext } from \"../renderer/ConversationWidgetRenderContext\";\nimport { ConversationWidgetErrorBoundary } from \"../renderer/ConversationWidgetErrorBoundary\";\nimport {\n WidgetRenderReporter,\n WidgetRenderReportContext,\n} from \"../renderer/render-report/widget-render-report\";\nimport type { CanvasState } from \"../renderer/canvas/canvas-state\";\nimport { canvasBodies } from \"../renderer/canvas/canvasBodies\";\nimport { canvasBehaviourOf } from \"../renderer/canvas/canvas-behaviours\";\nimport { decideCanvasOpen } from \"../renderer/canvas/decide-canvas-open\";\nimport { CANVAS_VIABLE_MIN_WIDTH } from \"../widgets/CanvasLauncherWidget/use-canvas-viable\";\nimport { WidgetImageRenderContext } from \"../image-render/WidgetImageRenderContext\";\nimport { ComposedViewComponentsContext } from \"../kit/composed-view-components\";\nimport { buildPreviewComposedViewComponents } from \"./preview-stub-components\";\nimport { installWidgetPreviewAppHooks } from \"./widget-preview-app-hooks\";\nimport { buildWidgetPreviewFence } from \"./widget-preview-fixtures\";\nimport type { WidgetPreviewReadiness } from \"./widget-preview-readiness\";\nimport type { WidgetPreviewBootstrap, WidgetPreviewFixture } from \"./widget-preview.types\";\nimport styles from \"./WidgetPreview.module.scss\";\n\n/**\n * The widget preview host: ONE widget from ONE fixture, outside the chat, in the mode the script\n * asks for. Unlike the e-mail capture host it keeps a working canvas pane (an `openCanvas` request mounts the canvas\n * body beside the widget, its anchor message being the fixture's fence) and a composer log (what the widget sent,\n * prefilled or signalled), so the interactions of the ChatGPT reference can be driven and checked. The app mounts it in\n * its store (the capture's store state); every request is served from the fixture (`widget-preview-requests.ts`). The fixture's\n * `hydration` is the capture's frozen hydration only in `email` mode; `interactive` and `replay` serve it through the\n * preview's hydrators (`widget-preview-hydration.ts`), so the widget runs as in the chat (a canvas auto-opens).\n */\n\n/** The key of the agent space a fixture without its own renders for. */\nexport const PREVIEW_AGENT_SPACE_KEY = 1;\nconst PREVIEW_MESSAGE_ID = 1;\n\ninterface ComposerLogEntry {\n kind: \"message\" | \"prefill\" | \"signal\" | \"app\";\n text: string;\n}\n\nexport interface WidgetPreviewProps {\n bootstrap: WidgetPreviewBootstrap;\n fixture: WidgetPreviewFixture;\n readiness: WidgetPreviewReadiness;\n hasHydrationError: () => boolean;\n}\n\nexport const WidgetPreview = (props: WidgetPreviewProps) => {\n const { bootstrap, fixture, readiness, hasHydrationError } = props;\n const widgetRef = useRef<HTMLDivElement>(null);\n const widgetName = resolveWidgetName(bootstrap.widgetName);\n const entry = conversationWidgetRegistry.widgets.find((widget) => widget.name === widgetName);\n const [canvas, setCanvas] = useState<CanvasState | null>(null);\n const [composerLog, setComposerLog] = useState<ComposerLogEntry[]>([]);\n const agentSpaceKey = Number(readWidgetAgentSpaceKeyAttribute(fixture) ?? PREVIEW_AGENT_SPACE_KEY);\n const fence = useMemo(\n () => buildWidgetPreviewFence(widgetName ?? bootstrap.widgetName, fixture),\n [widgetName, bootstrap.widgetName, fixture],\n );\n const isEmail = bootstrap.mode === \"email\";\n const isInteractive = bootstrap.mode === \"interactive\";\n // The capture context switches every widget to its static e-mail branch (no canvas, no auto-open): e-mail mode only.\n const frozenHydration =\n isEmail && fixture.hydration && Object.keys(fixture.hydration).length > 0 ? fixture.hydration : null;\n\n useEffect(() => {\n if (!entry) readiness.fail(\"UNKNOWN_WIDGET\");\n // The whole page document: the canvas pane and a modal (the lightbox renders into the modal root) settle too.\n else if (widgetRef.current) return readiness.observe(document.body, widgetRef.current, hasHydrationError);\n }, [entry, readiness, hasHydrationError]);\n // The block's render report reaches the readiness as in the chat it reaches the collector.\n const renderReporter = useMemo<WidgetRenderReporter>(() => ({ report: readiness.recordRenderReport }), [readiness]);\n\n const appendComposerLog = useCallback(\n (kind: ComposerLogEntry[\"kind\"], text: string) => setComposerLog((entries) => [...entries, { kind, text }]),\n [],\n );\n // Before the widget renders: a widget that needs an app hook (a connection widget) renders with a stand-in that logs.\n installWidgetPreviewAppHooks((text) => appendComposerLog(\"app\", text));\n // The chat's opening rule decides, as in the conversation slice: a live delivery on a narrow window does not take\n // over for a canvas without an overlay, so the narrow shot shows the inline rows and the \"Open in canvas\" card.\n const openCanvas = useCallback((request: CanvasOpenRequestFromOpener) => {\n setCanvas((current) => {\n const decision = decideCanvasOpen(canvasBehaviourOf(request.canvasId), current, null, {\n ...request,\n viewportViable: window.innerWidth >= CANVAS_VIABLE_MIN_WIDTH,\n hostHasCanvasSurface: true,\n });\n if (decision.kind === \"ignore\") return current;\n return {\n canvasId: request.canvasId,\n instanceId: request.instanceId,\n anchor: request.anchor,\n origin: request.origin,\n mountGeneration: (current?.mountGeneration ?? 0) + 1,\n };\n });\n }, []);\n const callbacks = useMemo<Partial<ConversationWidgetCallbacks>>(\n () => ({\n canvas,\n hostHasCanvasSurface: !isEmail,\n openCanvas: isEmail ? () => {} : openCanvas,\n closeCanvas: () => setCanvas(null),\n chatAgentSpaceKey: agentSpaceKey,\n messages: [],\n sendMessageToChat: (text: string) => appendComposerLog(\"message\", text),\n prefillComposer: (text: string) => appendComposerLog(\"prefill\", text),\n injectSignal: (text: string) => {\n appendComposerLog(\"signal\", text);\n return Promise.resolve(true);\n },\n }),\n [canvas, isEmail, openCanvas, agentSpaceKey, appendComposerLog],\n );\n\n if (!entry) return null;\n const WidgetComponent = entry.component;\n const CanvasBody = canvas ? canvasBodies[canvas.canvasId] : null;\n const widget = (\n <ConversationWidgetErrorBoundary widgetName={entry.name} onCrash={readiness.recordWidgetCrash}>\n <WidgetRenderReportContext.Provider value={renderReporter}>\n <WidgetComponent\n payload={JSON.stringify(fixture.payload)}\n {...buildWidgetAgentSpaceKeyProps(String(agentSpaceKey))}\n interactive={isInteractive}\n fresh={isInteractive}\n justDelivered={isInteractive}\n messageId={String(PREVIEW_MESSAGE_ID)}\n openedByPage={false}\n />\n </WidgetRenderReportContext.Provider>\n </ConversationWidgetErrorBoundary>\n );\n return (\n <StandaloneConversationWidgetProvider callbacks={callbacks}>\n <ConversationWidgetRenderContext.Provider value={isEmail ? \"email\" : \"conversation\"}>\n <WidgetImageRenderContext.Provider value={frozenHydration}>\n <div className={styles.page} data-testid=\"widget-preview-page\">\n <div className={styles.chatColumn} data-testid=\"widget-preview-frame\">\n <div\n ref={widgetRef}\n className={styles.widget}\n data-testid=\"widget-preview-widget\"\n inert={isEmail || undefined}\n >\n {fixture.stubComposedViewComponents ? (\n <ComposedViewComponentsContext.Provider value={buildPreviewComposedViewComponents()}>\n {widget}\n </ComposedViewComponentsContext.Provider>\n ) : (\n widget\n )}\n </div>\n {composerLog.length > 0 ? (\n <div className={styles.composerLog} data-testid=\"widget-preview-composer-log\">\n {composerLog.map((composerEntry, entryIndex) => (\n <Text\n key={entryIndex}\n role=\"caption\"\n translate={false}\n className={styles.composerEntry}\n >\n {`${composerEntry.kind}: ${composerEntry.text}`}\n </Text>\n ))}\n </div>\n ) : null}\n </div>\n {canvas && CanvasBody ? (\n <div className={styles.canvasPane} data-testid=\"widget-preview-canvas\" data-canvas-id={canvas.canvasId}>\n <CanvasBody\n key={`${canvas.instanceId}#${canvas.mountGeneration}`}\n canvas={canvas}\n agentSpaceKey={agentSpaceKey}\n anchorMessageMarkdown={fence}\n />\n </div>\n ) : null}\n </div>\n </WidgetImageRenderContext.Provider>\n </ConversationWidgetRenderContext.Provider>\n </StandaloneConversationWidgetProvider>\n );\n};\n","import { getSandboxLegacyAliases } from \"../provider/environment\";\nimport type { WidgetPreviewSignal } from \"./widget-preview.types\";\n\n/** The `window` property a preview script waits on. */\nexport const WIDGET_PREVIEW_SIGNAL_GLOBAL_NAME = \"__AGENTS_WIDGET_PREVIEW_V1__\";\n\ntype WindowSignals = Record<string, WidgetPreviewSignal | undefined>;\n\n/**\n * Every name the preview signal is published under: the package's own, then each name the app declares\n * (`AgentsEnvironment.sandboxLegacyAliases.previewReadinessGlobalNames`), read at each publish.\n */\nexport const readWidgetPreviewSignalGlobalNames = (): string[] => [\n WIDGET_PREVIEW_SIGNAL_GLOBAL_NAME,\n ...(getSandboxLegacyAliases().previewReadinessGlobalNames ?? []).filter(\n (aliasName) => aliasName !== WIDGET_PREVIEW_SIGNAL_GLOBAL_NAME,\n ),\n];\n\n/** Publishes (or with `undefined` clears) the preview signal under every name. */\nexport const publishWidgetPreviewSignal = (signal: WidgetPreviewSignal | undefined): void => {\n const windowSignals = window as unknown as WindowSignals;\n for (const globalName of readWidgetPreviewSignalGlobalNames()) windowSignals[globalName] = signal;\n};\n","import { publishWidgetImageReadiness } from \"../image-render/widget-image-readiness-signal\";\nimport type { WidgetRenderReportEntry } from \"../renderer/render-report/widget-render-report\";\nimport { publishWidgetPreviewSignal } from \"./widget-preview-signal\";\nimport type { WidgetPreviewExpectedState, WidgetPreviewSignal } from \"./widget-preview.types\";\n\n/** A loading placeholder: the component library's `Skeleton` (its test id; its class is a hashed module name) and the kit's own. */\nconst SKELETON_SELECTOR = '[data-testid=\"Skeleton\"], [class*=\"Skeleton\"], [class*=\"skeleton\"]';\nconst LOADING_SELECTOR = `[aria-busy=\"true\"], [role=\"progressbar\"]:not([aria-valuenow]), ${SKELETON_SELECTOR}`;\n/** The DOM must stay unchanged this long before the preview counts as settled. */\nconst SETTLE_MS = 400;\n\n/**\n * Whether a loading marker is actually rendered: the component library's `ImgWithLoader` keeps its Skeleton in the DOM inside a\n * `display: none` wrapper once the image has loaded, so a marker under a hidden ancestor is no loading state. Without\n * a layout engine (jsdom: no client rects for any element) every marker counts as before.\n */\nconst hasRenderedLoadingMarker = (element: HTMLElement): boolean => {\n const markers = Array.from(element.querySelectorAll(LOADING_SELECTOR));\n if (markers.length === 0) return false;\n const hasLayout = element.getClientRects().length > 0;\n return !hasLayout || markers.some((marker) => marker.getClientRects().length > 0);\n};\n\n/**\n * The state an element shows — the same loading markers the e-mail capture refuses to shoot. `hasError` is true when\n * the widget is known to be in an error: a failed hydration, a crash caught by the error boundary, or a request the\n * fixture failed on purpose — a widget that renders nothing on an error would otherwise read as `empty`.\n * `renderReport` is the block's own render report when the widget sent one: `failed` reads as `error`,\n * `pending` as `loading` and `empty` as `empty` — a widget that shows one muted line (\"No data to show.\") for its empty\n * state is empty, whatever text the line holds.\n */\nexport const observeWidgetPreviewState = (\n element: HTMLElement,\n hasError: boolean,\n renderReport?: WidgetRenderReportEntry,\n): WidgetPreviewExpectedState => {\n if (hasError || renderReport?.status === \"failed\") return \"error\";\n if (renderReport?.status === \"pending\") return \"loading\";\n if (hasRenderedLoadingMarker(element)) return \"loading\";\n if (renderReport?.status === \"empty\") return \"empty\";\n if (!element.textContent?.trim() && !element.querySelector(\"img,svg,canvas,iframe\")) return \"empty\";\n return \"data\";\n};\n\n/**\n * A mutation the settle ignores: a style or attribute change inside a loading placeholder — the component library's `Skeleton`\n * animates its shimmer by rewriting its style every frame, so a loading fixture would never be still otherwise.\n */\nconst isSkeletonAnimation = (mutation: MutationRecord): boolean => {\n if (mutation.type !== \"attributes\") return false;\n const target = mutation.target;\n return target instanceof Element && target.closest(SKELETON_SELECTOR) !== null;\n};\n\n/**\n * The preview's ready signal: after every change it waits until the DOM is still for `SETTLE_MS`, then publishes what\n * it shows — `window.__AGENTS_WIDGET_PREVIEW_V1__` (observed against the fixture's expected state, with every request\n * the fixture had no response for) and the e-mail capture's `window.__AGENTS_WIDGET_IMAGE_V1__` (`ready` when the\n * expected state was reached), so the same script conventions work for both. Both are also published under the names\n * the app declares (`AgentsEnvironment.sandboxLegacyAliases`).\n */\nexport const createWidgetPreviewReadiness = (expectedState: WidgetPreviewExpectedState) => {\n const missingResponses: string[] = [];\n const failedRequests: string[] = [];\n let widgetCrashed = false;\n let renderReport: WidgetRenderReportEntry | undefined;\n let scheduleSettleAgain: () => void = () => {};\n let revision = 0;\n const publish = (\n signal: Omit<\n WidgetPreviewSignal,\n \"version\" | \"missingResponses\" | \"failedRequests\" | \"widgetCrashed\" | \"expectedState\"\n >,\n ) => {\n publishWidgetPreviewSignal({\n version: 1,\n expectedState,\n missingResponses: [...missingResponses],\n failedRequests: [...failedRequests],\n widgetCrashed,\n ...(renderReport ? { renderReport } : {}),\n ...signal,\n });\n document.documentElement.dataset.widgetPreviewState = signal.state;\n };\n publish({ state: \"loading\", revision });\n\n const fail = (errorCode: string) => {\n publish({ state: \"failed\", revision, error_code: errorCode });\n publishWidgetImageReadiness({ version: 1, state: \"failed\", error_code: errorCode });\n };\n\n const recordMissingResponse = (requestKey: string) => {\n if (!missingResponses.includes(requestKey)) missingResponses.push(requestKey);\n };\n\n /** A request (or a preview hydration) the fixture answered with a failing `__status`. */\n const recordFailedRequest = (requestKey: string) => {\n if (!failedRequests.includes(requestKey)) failedRequests.push(requestKey);\n };\n\n /** The error boundary caught the widget (`ConversationWidgetErrorBoundary` `onCrash`). */\n const recordWidgetCrash = () => {\n widgetCrashed = true;\n };\n\n /** The block's render report (`WidgetRenderReportContext` of the host); a new status settles again. */\n const recordRenderReport = (entry: WidgetRenderReportEntry) => {\n renderReport = entry;\n scheduleSettleAgain();\n };\n\n const settle = (element: HTMLElement, hasHydrationError: () => boolean) => {\n const hasError = hasHydrationError() || widgetCrashed || failedRequests.length > 0;\n const observedState = observeWidgetPreviewState(element, hasError, renderReport);\n const { x, y, width, height } = element.getBoundingClientRect();\n const rect = { x, y, width, height };\n revision += 1;\n const expectedStateReached = observedState === expectedState;\n publish({ state: \"settled\", revision, observedState, expectedStateReached, rect });\n publishWidgetImageReadiness(\n expectedStateReached\n ? { version: 1, state: \"ready\", rect }\n : {\n version: 1,\n state: \"failed\",\n error_code: `EXPECTED_${expectedState.toUpperCase()}_SAW_${observedState.toUpperCase()}`,\n rect,\n },\n );\n };\n\n /**\n * Watches `watchedElement` (the whole preview document, so an interaction that changes only the canvas pane or opens\n * a modal settles too)\n * and classifies `widgetElement` (the widget alone, the screenshot); returns the disposer.\n */\n const observe = (watchedElement: HTMLElement, widgetElement: HTMLElement, hasHydrationError: () => boolean) => {\n let settleTimer: ReturnType<typeof setTimeout> | null = null;\n const scheduleSettle = () => {\n if (settleTimer !== null) clearTimeout(settleTimer);\n settleTimer = setTimeout(() => settle(widgetElement, hasHydrationError), SETTLE_MS);\n };\n const mutationObserver = new MutationObserver((mutations) => {\n if (mutations.some((mutation) => !isSkeletonAnimation(mutation))) scheduleSettle();\n });\n mutationObserver.observe(watchedElement, {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true,\n });\n scheduleSettleAgain = scheduleSettle;\n scheduleSettle();\n return () => {\n mutationObserver.disconnect();\n scheduleSettleAgain = () => {};\n if (settleTimer !== null) clearTimeout(settleTimer);\n };\n };\n\n return { observe, fail, recordMissingResponse, recordFailedRequest, recordWidgetCrash, recordRenderReport };\n};\n\nexport type WidgetPreviewReadiness = ReturnType<typeof createWidgetPreviewReadiness>;\n","import { createHeaderlessResponse, interceptXMLHttpRequests, isFetchRequest } from \"../request-interception/browser-request-interception\";\nimport type { WidgetPreviewResponse } from \"./widget-preview.types\";\n\n/** The key a fixture response is stored under: method, path and the sorted query (`GET /api/example/…?a=1&b=2`). */\nexport const widgetPreviewRequestKey = (method: string, url: URL): string => {\n const sortedUrl = new URL(url.toString());\n sortedUrl.searchParams.sort();\n return `${method.toUpperCase()} ${sortedUrl.pathname}${sortedUrl.search}`;\n};\n\n/** The app's own error log: answered empty and never reported — a fixture's error state must not count as a gap. */\nconst SILENTLY_ANSWERED_PATHS = [\"/rest_api/v1/log\"];\nconst isSilentlyAnswered = (url: URL): boolean => SILENTLY_ANSWERED_PATHS.includes(url.pathname);\n\nexport const isStatusResponse = (response: unknown): response is { __status: number; __body?: unknown } =>\n typeof response === \"object\" &&\n response !== null &&\n typeof (response as { __status?: unknown }).__status === \"number\";\nexport const isPendingResponse = (response: unknown): boolean =>\n typeof response === \"object\" && response !== null && (response as { __pending?: unknown }).__pending === true;\n\n/** A fixture answer as an `XMLHttpRequest` reads it; a status a `Response` cannot carry fails like a network error. */\nconst xhrAnswer = (body: unknown, status: number): Response => {\n if (status < 200 || status > 599) throw new TypeError(`preview response ${status}`);\n if ([204, 205, 304].includes(status)) return createHeaderlessResponse(null, status);\n return createHeaderlessResponse(JSON.stringify(body), status, status === 200 ? \"OK\" : \"\");\n};\n\n/**\n * Serves every request of the preview — `XMLHttpRequest` (the transport of axios's browser adapter) and `fetch` — from\n * the fixture: a known request gets its body (a copy), a `__status` entry fails with that status (a status of 400 or\n * more is reported as a failed request — the error state the fixture asked for), a `__pending` entry never answers (the\n * loading state), and anything else — an unknown read, a write the fixture does not answer — fails as a missing\n * response and is reported. A write is answered only when the fixture names it (`\"POST /api/example/…\"`, e.g. a\n * widget's fire-and-forget measurement event). Nothing reaches a server.\n */\nexport const installWidgetPreviewRequests = (\n responses: Record<string, WidgetPreviewResponse>,\n onMissingResponse: (requestKey: string) => void,\n onFailedRequest: (requestKey: string) => void = () => {},\n): (() => void) => {\n // XMLHttpRequest: a missing response fails like a network error (no response), a `__status` entry answers with its\n // status and `__body`.\n const restoreXMLHttpRequest = interceptXMLHttpRequests(async (request) => {\n if (isSilentlyAnswered(request.url)) return xhrAnswer({}, 200);\n const requestKey = widgetPreviewRequestKey(request.method, request.url);\n const response = Object.prototype.hasOwnProperty.call(responses, requestKey) ? responses[requestKey] : undefined;\n if (response === undefined) {\n onMissingResponse(requestKey);\n throw new Error(`no preview response for ${requestKey}`);\n }\n if (isPendingResponse(response)) return new Promise<Response>(() => {});\n if (isStatusResponse(response)) {\n if (response.__status >= 400) onFailedRequest(requestKey);\n return xhrAnswer(response.__body ?? null, response.__status);\n }\n return xhrAnswer(response, 200);\n });\n // `fetch` is answered the same way (a few modules bypass the XMLHttpRequest client); a missing response is a 404,\n // reported. A `Request` of another realm is read by its brand, not by `instanceof`.\n const originalFetch = window.fetch;\n window.fetch = async (input: RequestInfo | URL, init?: RequestInit) => {\n const fromRequest = isFetchRequest(input) ? input : undefined;\n const method = (init?.method ?? (fromRequest ? fromRequest.method : \"GET\")).toLowerCase();\n const url = new URL(fromRequest ? fromRequest.url : String(input), window.location.origin);\n if (isSilentlyAnswered(url)) return new Response(\"{}\", { status: 200 });\n const requestKey = widgetPreviewRequestKey(method, url);\n const response = Object.prototype.hasOwnProperty.call(responses, requestKey) ? responses[requestKey] : undefined;\n if (response === undefined) {\n onMissingResponse(requestKey);\n return new Response(null, { status: 404 });\n }\n if (isPendingResponse(response)) return new Promise<Response>(() => {});\n if (isStatusResponse(response)) {\n if (response.__status >= 400) onFailedRequest(requestKey);\n return new Response(JSON.stringify(response.__body ?? null), { status: response.__status });\n }\n return new Response(JSON.stringify(response), { status: 200, headers: { \"Content-Type\": \"application/json\" } });\n };\n return () => {\n restoreXMLHttpRequest();\n window.fetch = originalFetch;\n };\n};\n","import {\n getWidgetHydrator,\n listWidgetHydratorTypes,\n registerWidgetHydrator,\n unregisterWidgetHydrator,\n} from \"../renderer/widget-hydration/widget-hydration.registry\";\nimport type { RegisteredWidget } from \"../renderer/widget-hydration/widget-hydration.types\";\nimport { isPendingResponse, isStatusResponse } from \"./widget-preview-requests\";\nimport type { WidgetPreviewResponse } from \"./widget-preview.types\";\n\n/** The fixture's entry for one hydration: the exact derived key first, then the hydrator type (as the capture reads). */\nconst findFixtureHydration = (\n hydration: Record<string, WidgetPreviewResponse>,\n type: string,\n key: string,\n): { found: boolean; value?: WidgetPreviewResponse; hydrationKey: string } => {\n if (Object.prototype.hasOwnProperty.call(hydration, key))\n return { found: true, value: hydration[key], hydrationKey: key };\n if (Object.prototype.hasOwnProperty.call(hydration, type))\n return { found: true, value: hydration[type], hydrationKey: type };\n return { found: false, hydrationKey: key };\n};\n\n/** One fixture value as a hydrator result: a copy of the body, a failing `__status`, or a `__pending` that never ends. */\nconst answerFromFixture = (\n value: WidgetPreviewResponse,\n hydrationKey: string,\n onFailedRequest: (requestKey: string) => void,\n): Promise<unknown> => {\n if (isPendingResponse(value)) return new Promise(() => {});\n if (isStatusResponse(value)) {\n onFailedRequest(`HYDRATION ${hydrationKey}`);\n return Promise.reject(new Error(`preview hydration ${value.__status}`));\n }\n return Promise.resolve(structuredClone(value));\n};\n\n/**\n * The preview's hydration transport for the `interactive` and `replay` modes: every registered hydrator is replaced by\n * one that answers from the fixture's `hydration` (by derived key, else by type) and otherwise runs the real hydrator,\n * whose requests the request transport answers from `responses`. The widget therefore runs its live code path —\n * `useWidgetHydration` with the store's hydration slice, no frozen capture context — so a self-hydrating canvas widget\n * auto-opens its canvas like in the chat (`CanvasLauncherWidget`). The `email` mode keeps the capture's frozen hydration.\n * Returns the disposer that puts the real hydrators back.\n */\nexport const installWidgetPreviewHydration = (\n hydration: Record<string, WidgetPreviewResponse>,\n onFailedRequest: (requestKey: string) => void,\n): (() => void) => {\n const replacedHydrators = new Map<string, RegisteredWidget<unknown, unknown>>();\n for (const type of listWidgetHydratorTypes()) {\n const registered = getWidgetHydrator<unknown, unknown>(type);\n if (!registered) continue;\n replacedHydrators.set(type, registered);\n unregisterWidgetHydrator(type);\n registerWidgetHydrator<unknown, unknown>(type, {\n ...registered,\n hydrator: (payload, context) => {\n const fixtureHydration = findFixtureHydration(hydration, type, registered.deriveKey(type, payload));\n return fixtureHydration.found\n ? answerFromFixture(fixtureHydration.value, fixtureHydration.hydrationKey, onFailedRequest)\n : registered.hydrator(payload, context);\n },\n });\n }\n return () => {\n for (const [type, registered] of replacedHydrators) {\n unregisterWidgetHydrator(type);\n registerWidgetHydrator(type, registered);\n }\n };\n};\n","import { Text } from \"../../../provider/components\";\nimport { ConversationWidgetProvider } from \"../../../renderer/ConversationWidgetContext\";\nimport { ConversationMessageInputComposerWidgets } from \"../../../chat/ConversationMessageInput/ConversationMessageInputComposerWidgets/ConversationMessageInputComposerWidgets\";\nimport { EntityMentionAskButton } from \"../EntityMentionAskButton/EntityMentionAskButton\";\nimport styles from \"./EntityMentionAskFlowStory.module.scss\";\n\nconst ENTITIES = [\n { entityType: \"competitor\", entityId: \"8812\", label: \"Altes Gasthaus Leve\", agentSpaceKey: 1 },\n { entityType: \"competitor\", entityId: \"9001\", label: \"Kleiner Kiepenkerl\", agentSpaceKey: 1 },\n];\n\n/**\n * The \"Ask about this\" flow for the story and the browser check: a stand-in for the detail panel's\n * footer (the `entityDetail` shell is the canvas shell's, the bodies come from the entity types) with the real button, and the real\n * composer strip of the chat input, so a click shows the chip where the owner types.\n */\nexport const EntityMentionAskFlowStory = (props: { maxWidth?: number }) => (\n <ConversationWidgetProvider callbacks={{}}>\n <div className={styles.page} style={{ maxWidth: props.maxWidth ?? 720 }}>\n {ENTITIES.map((entity) => (\n <div key={entity.entityId} className={styles.panel}>\n <Text role=\"intro\" weight=\"bold\" translate={false}>\n {entity.label}\n </Text>\n <Text role=\"help\" color=\"var(--agents-fg-light)\" translate={false}>\n {\"detail panel body\"}\n </Text>\n <div className={styles.footer}>\n <EntityMentionAskButton {...entity} testId={`entity-mention-ask-${entity.entityId}`} />\n </div>\n </div>\n ))}\n <div className={styles.composer} data-testid=\"story-composer\">\n <ConversationMessageInputComposerWidgets testId=\"story-input\" />\n <Text role=\"help\" color=\"var(--agents-fg-lightest)\" translate={false}>\n {\"Ask anything…\"}\n </Text>\n </div>\n </div>\n </ConversationWidgetProvider>\n);\n"],"names":["styles","widget","composerLog","composerEntry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Q,OAAO,uBAAuB,eAAe,EAAA;AAAA,EAC3F,EAAE,YAAY,cAAc,UAAU,QAAQ,OAAO,sBAAsB,eAAe,EAAA;AAC5F;AAOO,MAAM,4BAA4B,CAAC,8BACvC,4BAAA,EAA2B,WAAW,CAAA,GACrC,UAAA,qBAAC,SAAI,WAAW,OAAO,MAAM,OAAO,EAAE,UAAU,MAAM,YAAY,OAC/D,UAAA;AAAA,EAAA,SAAS,IAAI,CAAC,gCACZ,OAAA,EAA0B,WAAW,OAAO,OAC3C,UAAA;AAAA,IAAA,oBAAC,MAAA,EAAK,MAAK,SAAQ,QAAO,QAAO,WAAW,OACzC,iBAAO,MAAA,CACV;AAAA,IACA,oBAAC,QAAK,MAAK,QAAO,OAAM,0BAAyB,WAAW,OACzD,UAAA,oBAAA,CACH;AAAA,IACA,oBAAC,OAAA,EAAI,WAAW,OAAO,QACrB,UAAA,oBAAC,wBAAA,EAAwB,GAAG,QAAQ,QAAQ,sBAAsB,OAAO,QAAQ,IAAI,EAAA,CACvF;AAAA,EAAA,KATQ,OAAO,QAUjB,CACD;AAAA,uBACA,OAAA,EAAI,WAAW,OAAO,UAAU,eAAY,kBAC3C,UAAA;AAAA,IAAA,oBAAC,yCAAA,EAAwC,QAAO,cAAA,CAAc;AAAA,IAC9D,oBAAC,QAAK,MAAK,QAAO,OAAM,6BAA4B,WAAW,OAC5D,UAAA,gBAAA,CACH;AAAA,EAAA,EAAA,CACF;AAAA,EAAA,CACF,EAAA,CACF;"}
|
|
1
|
+
{"version":3,"file":"preview.js","sources":["../src/preview/preview-stub-components.tsx","../src/preview/widget-preview-app-hooks.ts","../src/renderer/_agent-space/declared-agent-space-key-field-name.ts","../src/preview/widget-preview-fixtures.ts","../src/preview/WidgetPreviewHost.tsx","../src/preview/widget-preview-signal.ts","../src/preview/widget-preview-readiness.ts","../src/preview/widget-preview-requests.ts","../src/preview/widget-preview-hydration.ts","../src/widgets/EntityMentionConversationWidget/stories/EntityMentionAskFlowStory.tsx"],"sourcesContent":["import { Text } from \"../provider/components\";\nimport type {\n ComposedViewComponentDefinition,\n ComposedViewComponentProps,\n} from \"../kit/composed-view-component-types\";\nimport {\n buildComposedViewComponentRegistry,\n composedViewComponents,\n} from \"../kit/composed-view-components\";\nimport { WidgetSurface } from \"../widgets/_shared/modern\";\nimport styles from \"./WidgetPreview.module.scss\";\n\n/**\n * Stand-ins for kit node types that have a schema but no component yet — only the preview uses\n * them, and only for a fixture that asks (`stubComposedViewComponents`). A real component always wins.\n */\nconst formatDuration = (durationSeconds: unknown): string | null => {\n if (typeof durationSeconds !== \"number\" || !Number.isFinite(durationSeconds) || durationSeconds < 0) return null;\n const minutes = Math.floor(durationSeconds / 60);\n const seconds = Math.floor(durationSeconds % 60);\n return `${minutes}:${String(seconds).padStart(2, \"0\")}`;\n};\n\nconst StubVideo = ({ props }: ComposedViewComponentProps) => {\n const duration = formatDuration(props.durationSeconds);\n return (\n <WidgetSurface level=\"flat\" compact>\n <div className={styles.stubVideo}>\n {typeof props.thumbnail === \"string\" ? (\n <img className={styles.stubVideoThumbnail} src={props.thumbnail} alt=\"\" />\n ) : null}\n <div className={styles.stubVideoText}>\n <Text role=\"body\" weight=\"bold\" translate={false}>\n {typeof props.title === \"string\" ? props.title : \"\"}\n </Text>\n <Text role=\"caption\" color=\"var(--agents-fg-light)\" translate={false}>\n {[typeof props.channel === \"string\" ? props.channel : null, duration].filter(Boolean).join(\" · \")}\n </Text>\n </div>\n </div>\n </WidgetSurface>\n );\n};\n\nconst PREVIEW_STUB_COMPONENTS: ComposedViewComponentDefinition[] = [{ nodeType: \"Video\", component: StubVideo }];\n\n/** The folder registry with a stub for every node type that has no component of its own. */\nexport const buildPreviewComposedViewComponents = () =>\n buildComposedViewComponentRegistry([\n ...Object.values(composedViewComponents),\n ...PREVIEW_STUB_COMPONENTS.filter(\n (stub) => !Object.prototype.hasOwnProperty.call(composedViewComponents, stub.nodeType),\n ),\n ]);\n","import { getAgentsEnvironment, setAgentsEnvironment } from \"../provider/environment\";\n\n/** What a widget handed to the app during a preview: the action and its target as one line. */\nexport type WidgetPreviewAppActionLogger = (text: string) => void;\n\nlet previewAppActionLogger: WidgetPreviewAppActionLogger | null = null;\n\n/**\n * Stand-ins for the app hooks a widget needs to render at all (`startConversationInPersonalSpace`,\n * `openConnectionPermissions`): outside the chat no app opens a space or its settings, so the preview logs the action\n * instead. A hook the app set stays the app's. Idempotent; the preview page keeps them while it lives.\n */\nexport const installWidgetPreviewAppHooks = (onAppAction: WidgetPreviewAppActionLogger): void => {\n previewAppActionLogger = onAppAction;\n const environment = getAgentsEnvironment();\n if (environment.startConversationInPersonalSpace && environment.openConnectionPermissions) return;\n setAgentsEnvironment({\n ...environment,\n startConversationInPersonalSpace:\n environment.startConversationInPersonalSpace ??\n ((ownerText: string) => previewAppActionLogger?.(`start in personal space: ${ownerText}`)),\n openConnectionPermissions:\n environment.openConnectionPermissions ??\n ((target) => previewAppActionLogger?.(`open connection permissions: ${JSON.stringify(target)}`)),\n });\n};\n","import {\n DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME,\n getWidgetSelfHydrationKeyFieldName,\n} from \"../../provider/environment\";\n\nconst DEFAULT_FIELD_NAME_PATTERN = new RegExp(`\\\\b${DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME}\\\\b`, \"g\");\n\n/**\n * A fixture of the package as the app reads it. The package's fixtures name the key of a block's agent space with the\n * package default field (`agentSpaceId`): as a key of an object, as a field in a block's JSON, as an attribute of a\n * block's markdown. An app that declares another field name (`AgentsEnvironment.widgetSelfHydrationKeyFieldName`)\n * reads every occurrence under its own name, so a fixture is mapped once, when it is loaded. Without a declaration\n * the fixture is returned as it is.\n */\nexport const mapFixtureToDeclaredAgentSpaceKeyFieldName = <Fixture>(fixture: Fixture): Fixture => {\n const declaredFieldName = getWidgetSelfHydrationKeyFieldName();\n if (declaredFieldName === DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME || fixture === undefined) return fixture;\n return JSON.parse(JSON.stringify(fixture).replace(DEFAULT_FIELD_NAME_PATTERN, declaredFieldName)) as Fixture;\n};\n","import { mapFixtureToDeclaredAgentSpaceKeyFieldName } from \"../renderer/_agent-space/declared-agent-space-key-field-name\";\nimport type { WidgetPreviewFixture, WidgetPreviewFixtureFile } from \"./widget-preview.types\";\n\n/**\n * Every `*.preview-fixtures.json` below the package's `widgets/` and `kit/`, by wire name — read by folder glob, so the\n * fixtures of a widget are added as one new file next to it; an app adds the fixtures of its widgets with\n * `registerWidgetPreviewFixtureFiles`. Imports nothing from the app, so the preview entry can read it before the\n * request transport is installed.\n */\nconst fixtureModules = import.meta.glob<WidgetPreviewFixtureFile>(\n [\"../widgets/**/*.preview-fixtures.json\", \"../kit/**/*.preview-fixtures.json\"],\n {\n eager: true,\n import: \"default\",\n },\n);\n\nconst sortByWireName = (fixtureFiles: WidgetPreviewFixtureFile[]): WidgetPreviewFixtureFile[] =>\n fixtureFiles.sort((first, second) => first.wireName.localeCompare(second.wireName));\n\n/** Every fixture file, sorted by wire name; filled in place by `registerWidgetPreviewFixtureFiles`. */\nexport const widgetPreviewFixtureFiles: WidgetPreviewFixtureFile[] = sortByWireName(Object.values(fixtureModules));\n\n/** Adds an app's fixture files (its glob stays in its code). Runs before the preview reads a fixture. */\nexport const registerWidgetPreviewFixtureFiles = (fixtureFiles: readonly WidgetPreviewFixtureFile[]): void => {\n widgetPreviewFixtureFiles.push(...fixtureFiles);\n sortByWireName(widgetPreviewFixtureFiles);\n};\n\n/**\n * The fixtures of a widget from EVERY file naming it — a `ComposedView` component can add its own file next to it\n * instead of editing the widget's — or an empty list. A fixture an app registers under the name of a package fixture\n * of the same widget replaces it in place (an app's copy with its own entity types and endpoints). Each is read under\n * the agent space key field the app declares (`mapFixtureToDeclaredAgentSpaceKeyFieldName`; the package's files name\n * `agentSpaceId`), at call time: an app installs its environment after this module is loaded.\n */\nexport const findWidgetPreviewFixtures = (widgetName: string): readonly WidgetPreviewFixture[] => {\n const fixturesByName = new Map<string, WidgetPreviewFixture>();\n for (const fixtureFile of widgetPreviewFixtureFiles) {\n if (fixtureFile.wireName !== widgetName) continue;\n for (const fixture of fixtureFile.fixtures) fixturesByName.set(fixture.name, fixture);\n }\n return [...fixturesByName.values()].map(mapFixtureToDeclaredAgentSpaceKeyFieldName);\n};\n\n/** One named fixture, or undefined. */\nexport const findWidgetPreviewFixture = (widgetName: string, fixtureName: string): WidgetPreviewFixture | undefined =>\n findWidgetPreviewFixtures(widgetName).find((fixture) => fixture.name === fixtureName);\n\n/** The fence the fixture stands for — what a canvas body re-reads as its anchor message. */\nexport const buildWidgetPreviewFence = (widgetName: string, fixture: WidgetPreviewFixture): string =>\n \"```widget\\n\" + JSON.stringify({ type: widgetName, ...fixture.payload }) + \"\\n```\";\n","import { Text } from \"../provider/components\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { conversationWidgetRegistry } from \"../renderer/conversationWidgetRegistry\";\nimport { resolveWidgetName } from \"../renderer/widget-name-resolver\";\nimport {\n buildWidgetAgentSpaceKeyProps,\n readWidgetAgentSpaceKeyAttribute,\n} from \"../renderer/_agent-space/widget-agent-space-key-attribute\";\nimport {\n CanvasOpenRequestFromOpener,\n ConversationWidgetCallbacks,\n StandaloneConversationWidgetProvider,\n} from \"../renderer/ConversationWidgetContext\";\nimport { ConversationWidgetRenderContext } from \"../renderer/ConversationWidgetRenderContext\";\nimport { ConversationWidgetErrorBoundary } from \"../renderer/ConversationWidgetErrorBoundary\";\nimport {\n WidgetRenderReporter,\n WidgetRenderReportContext,\n} from \"../renderer/render-report/widget-render-report\";\nimport type { CanvasState } from \"../renderer/canvas/canvas-state\";\nimport { canvasBodies } from \"../renderer/canvas/canvasBodies\";\nimport { canvasBehaviourOf } from \"../renderer/canvas/canvas-behaviours\";\nimport { decideCanvasOpen } from \"../renderer/canvas/decide-canvas-open\";\nimport { CANVAS_VIABLE_MIN_WIDTH } from \"../widgets/CanvasLauncherWidget/use-canvas-viable\";\nimport { WidgetImageRenderContext } from \"../image-render/WidgetImageRenderContext\";\nimport { ComposedViewComponentsContext } from \"../kit/composed-view-components\";\nimport { buildPreviewComposedViewComponents } from \"./preview-stub-components\";\nimport { installWidgetPreviewAppHooks } from \"./widget-preview-app-hooks\";\nimport { buildWidgetPreviewFence } from \"./widget-preview-fixtures\";\nimport type { WidgetPreviewReadiness } from \"./widget-preview-readiness\";\nimport type { WidgetPreviewBootstrap, WidgetPreviewFixture } from \"./widget-preview.types\";\nimport styles from \"./WidgetPreview.module.scss\";\n\n/**\n * The widget preview host: ONE widget from ONE fixture, outside the chat, in the mode the script\n * asks for. Unlike the e-mail capture host it keeps a working canvas pane (an `openCanvas` request mounts the canvas\n * body beside the widget, its anchor message being the fixture's fence) and a composer log (what the widget sent,\n * prefilled or signalled), so the interactions of the ChatGPT reference can be driven and checked. The app mounts it in\n * its store (the capture's store state); every request is served from the fixture (`widget-preview-requests.ts`). The fixture's\n * `hydration` is the capture's frozen hydration only in `email` mode; `interactive` and `replay` serve it through the\n * preview's hydrators (`widget-preview-hydration.ts`), so the widget runs as in the chat (a canvas auto-opens).\n */\n\n/** The key of the agent space a fixture without its own renders for. */\nexport const PREVIEW_AGENT_SPACE_KEY = 1;\nconst PREVIEW_MESSAGE_ID = 1;\n\ninterface ComposerLogEntry {\n kind: \"message\" | \"prefill\" | \"signal\" | \"app\";\n text: string;\n}\n\nexport interface WidgetPreviewProps {\n bootstrap: WidgetPreviewBootstrap;\n fixture: WidgetPreviewFixture;\n readiness: WidgetPreviewReadiness;\n hasHydrationError: () => boolean;\n}\n\nexport const WidgetPreview = (props: WidgetPreviewProps) => {\n const { bootstrap, fixture, readiness, hasHydrationError } = props;\n const widgetRef = useRef<HTMLDivElement>(null);\n const widgetName = resolveWidgetName(bootstrap.widgetName);\n const entry = conversationWidgetRegistry.widgets.find((widget) => widget.name === widgetName);\n const [canvas, setCanvas] = useState<CanvasState | null>(null);\n const [composerLog, setComposerLog] = useState<ComposerLogEntry[]>([]);\n const agentSpaceKey = Number(readWidgetAgentSpaceKeyAttribute(fixture) ?? PREVIEW_AGENT_SPACE_KEY);\n const fence = useMemo(\n () => buildWidgetPreviewFence(widgetName ?? bootstrap.widgetName, fixture),\n [widgetName, bootstrap.widgetName, fixture],\n );\n const isEmail = bootstrap.mode === \"email\";\n const isInteractive = bootstrap.mode === \"interactive\";\n // The capture context switches every widget to its static e-mail branch (no canvas, no auto-open): e-mail mode only.\n const frozenHydration =\n isEmail && fixture.hydration && Object.keys(fixture.hydration).length > 0 ? fixture.hydration : null;\n\n useEffect(() => {\n if (!entry) readiness.fail(\"UNKNOWN_WIDGET\");\n // The whole page document: the canvas pane and a modal (the lightbox renders into the modal root) settle too.\n else if (widgetRef.current) return readiness.observe(document.body, widgetRef.current, hasHydrationError);\n }, [entry, readiness, hasHydrationError]);\n // The block's render report reaches the readiness as in the chat it reaches the collector.\n const renderReporter = useMemo<WidgetRenderReporter>(() => ({ report: readiness.recordRenderReport }), [readiness]);\n\n const appendComposerLog = useCallback(\n (kind: ComposerLogEntry[\"kind\"], text: string) => setComposerLog((entries) => [...entries, { kind, text }]),\n [],\n );\n // Before the widget renders: a widget that needs an app hook (a connection widget) renders with a stand-in that logs.\n installWidgetPreviewAppHooks((text) => appendComposerLog(\"app\", text));\n // The chat's opening rule decides, as in the conversation slice: a live delivery on a narrow window does not take\n // over for a canvas without an overlay, so the narrow shot shows the inline rows and the \"Open in canvas\" card.\n const openCanvas = useCallback((request: CanvasOpenRequestFromOpener) => {\n setCanvas((current) => {\n const decision = decideCanvasOpen(canvasBehaviourOf(request.canvasId), current, null, {\n ...request,\n viewportViable: window.innerWidth >= CANVAS_VIABLE_MIN_WIDTH,\n hostHasCanvasSurface: true,\n });\n if (decision.kind === \"ignore\") return current;\n return {\n canvasId: request.canvasId,\n instanceId: request.instanceId,\n anchor: request.anchor,\n origin: request.origin,\n mountGeneration: (current?.mountGeneration ?? 0) + 1,\n };\n });\n }, []);\n const callbacks = useMemo<Partial<ConversationWidgetCallbacks>>(\n () => ({\n canvas,\n hostHasCanvasSurface: !isEmail,\n openCanvas: isEmail ? () => {} : openCanvas,\n closeCanvas: () => setCanvas(null),\n chatAgentSpaceKey: agentSpaceKey,\n messages: [],\n sendMessageToChat: (text: string) => appendComposerLog(\"message\", text),\n prefillComposer: (text: string) => appendComposerLog(\"prefill\", text),\n injectSignal: (text: string) => {\n appendComposerLog(\"signal\", text);\n return Promise.resolve(true);\n },\n }),\n [canvas, isEmail, openCanvas, agentSpaceKey, appendComposerLog],\n );\n\n if (!entry) return null;\n const WidgetComponent = entry.component;\n const CanvasBody = canvas ? canvasBodies[canvas.canvasId] : null;\n const widget = (\n <ConversationWidgetErrorBoundary widgetName={entry.name} onCrash={readiness.recordWidgetCrash}>\n <WidgetRenderReportContext.Provider value={renderReporter}>\n <WidgetComponent\n payload={JSON.stringify(fixture.payload)}\n {...buildWidgetAgentSpaceKeyProps(String(agentSpaceKey))}\n interactive={isInteractive}\n fresh={isInteractive}\n justDelivered={isInteractive}\n messageId={String(PREVIEW_MESSAGE_ID)}\n openedByPage={false}\n />\n </WidgetRenderReportContext.Provider>\n </ConversationWidgetErrorBoundary>\n );\n return (\n <StandaloneConversationWidgetProvider callbacks={callbacks}>\n <ConversationWidgetRenderContext.Provider value={isEmail ? \"email\" : \"conversation\"}>\n <WidgetImageRenderContext.Provider value={frozenHydration}>\n <div className={styles.page} data-testid=\"widget-preview-page\">\n <div className={styles.chatColumn} data-testid=\"widget-preview-frame\">\n <div\n ref={widgetRef}\n className={styles.widget}\n data-testid=\"widget-preview-widget\"\n inert={isEmail || undefined}\n >\n {fixture.stubComposedViewComponents ? (\n <ComposedViewComponentsContext.Provider value={buildPreviewComposedViewComponents()}>\n {widget}\n </ComposedViewComponentsContext.Provider>\n ) : (\n widget\n )}\n </div>\n {composerLog.length > 0 ? (\n <div className={styles.composerLog} data-testid=\"widget-preview-composer-log\">\n {composerLog.map((composerEntry, entryIndex) => (\n <Text\n key={entryIndex}\n role=\"caption\"\n translate={false}\n className={styles.composerEntry}\n >\n {`${composerEntry.kind}: ${composerEntry.text}`}\n </Text>\n ))}\n </div>\n ) : null}\n </div>\n {canvas && CanvasBody ? (\n <div className={styles.canvasPane} data-testid=\"widget-preview-canvas\" data-canvas-id={canvas.canvasId}>\n <CanvasBody\n key={`${canvas.instanceId}#${canvas.mountGeneration}`}\n canvas={canvas}\n agentSpaceKey={agentSpaceKey}\n anchorMessageMarkdown={fence}\n />\n </div>\n ) : null}\n </div>\n </WidgetImageRenderContext.Provider>\n </ConversationWidgetRenderContext.Provider>\n </StandaloneConversationWidgetProvider>\n );\n};\n","import { getSandboxLegacyAliases } from \"../provider/environment\";\nimport type { WidgetPreviewSignal } from \"./widget-preview.types\";\n\n/** The `window` property a preview script waits on. */\nexport const WIDGET_PREVIEW_SIGNAL_GLOBAL_NAME = \"__AGENTS_WIDGET_PREVIEW_V1__\";\n\ntype WindowSignals = Record<string, WidgetPreviewSignal | undefined>;\n\n/**\n * Every name the preview signal is published under: the package's own, then each name the app declares\n * (`AgentsEnvironment.sandboxLegacyAliases.previewReadinessGlobalNames`), read at each publish.\n */\nexport const readWidgetPreviewSignalGlobalNames = (): string[] => [\n WIDGET_PREVIEW_SIGNAL_GLOBAL_NAME,\n ...(getSandboxLegacyAliases().previewReadinessGlobalNames ?? []).filter(\n (aliasName) => aliasName !== WIDGET_PREVIEW_SIGNAL_GLOBAL_NAME,\n ),\n];\n\n/** Publishes (or with `undefined` clears) the preview signal under every name. */\nexport const publishWidgetPreviewSignal = (signal: WidgetPreviewSignal | undefined): void => {\n const windowSignals = window as unknown as WindowSignals;\n for (const globalName of readWidgetPreviewSignalGlobalNames()) windowSignals[globalName] = signal;\n};\n","import { publishWidgetImageReadiness } from \"../image-render/widget-image-readiness-signal\";\nimport type { WidgetRenderReportEntry } from \"../renderer/render-report/widget-render-report\";\nimport { publishWidgetPreviewSignal } from \"./widget-preview-signal\";\nimport type { WidgetPreviewExpectedState, WidgetPreviewSignal } from \"./widget-preview.types\";\n\n/** A loading placeholder: the component library's `Skeleton` (its test id; its class is a hashed module name) and the kit's own. */\nconst SKELETON_SELECTOR = '[data-testid=\"Skeleton\"], [class*=\"Skeleton\"], [class*=\"skeleton\"]';\nconst LOADING_SELECTOR = `[aria-busy=\"true\"], [role=\"progressbar\"]:not([aria-valuenow]), ${SKELETON_SELECTOR}`;\n/** The DOM must stay unchanged this long before the preview counts as settled. */\nconst SETTLE_MS = 400;\n\n/**\n * Whether a loading marker is actually rendered: the component library's `ImgWithLoader` keeps its Skeleton in the DOM inside a\n * `display: none` wrapper once the image has loaded, so a marker under a hidden ancestor is no loading state. Without\n * a layout engine (jsdom: no client rects for any element) every marker counts as before.\n */\nconst hasRenderedLoadingMarker = (element: HTMLElement): boolean => {\n const markers = Array.from(element.querySelectorAll(LOADING_SELECTOR));\n if (markers.length === 0) return false;\n const hasLayout = element.getClientRects().length > 0;\n return !hasLayout || markers.some((marker) => marker.getClientRects().length > 0);\n};\n\n/**\n * The state an element shows — the same loading markers the e-mail capture refuses to shoot. `hasError` is true when\n * the widget is known to be in an error: a failed hydration, a crash caught by the error boundary, or a request the\n * fixture failed on purpose — a widget that renders nothing on an error would otherwise read as `empty`.\n * `renderReport` is the block's own render report when the widget sent one: `failed` reads as `error`,\n * `pending` as `loading` and `empty` as `empty` — a widget that shows one muted line (\"No data to show.\") for its empty\n * state is empty, whatever text the line holds.\n */\nexport const observeWidgetPreviewState = (\n element: HTMLElement,\n hasError: boolean,\n renderReport?: WidgetRenderReportEntry,\n): WidgetPreviewExpectedState => {\n if (hasError || renderReport?.status === \"failed\") return \"error\";\n if (renderReport?.status === \"pending\") return \"loading\";\n if (hasRenderedLoadingMarker(element)) return \"loading\";\n if (renderReport?.status === \"empty\") return \"empty\";\n if (!element.textContent?.trim() && !element.querySelector(\"img,svg,canvas,iframe\")) return \"empty\";\n return \"data\";\n};\n\n/**\n * A mutation the settle ignores: a style or attribute change inside a loading placeholder — the component library's `Skeleton`\n * animates its shimmer by rewriting its style every frame, so a loading fixture would never be still otherwise.\n */\nconst isSkeletonAnimation = (mutation: MutationRecord): boolean => {\n if (mutation.type !== \"attributes\") return false;\n const target = mutation.target;\n return target instanceof Element && target.closest(SKELETON_SELECTOR) !== null;\n};\n\n/**\n * The preview's ready signal: after every change it waits until the DOM is still for `SETTLE_MS`, then publishes what\n * it shows — `window.__AGENTS_WIDGET_PREVIEW_V1__` (observed against the fixture's expected state, with every request\n * the fixture had no response for) and the e-mail capture's `window.__AGENTS_WIDGET_IMAGE_V1__` (`ready` when the\n * expected state was reached), so the same script conventions work for both. Both are also published under the names\n * the app declares (`AgentsEnvironment.sandboxLegacyAliases`).\n */\nexport const createWidgetPreviewReadiness = (expectedState: WidgetPreviewExpectedState) => {\n const missingResponses: string[] = [];\n const failedRequests: string[] = [];\n let widgetCrashed = false;\n let renderReport: WidgetRenderReportEntry | undefined;\n let scheduleSettleAgain: () => void = () => {};\n let revision = 0;\n const publish = (\n signal: Omit<\n WidgetPreviewSignal,\n \"version\" | \"missingResponses\" | \"failedRequests\" | \"widgetCrashed\" | \"expectedState\"\n >,\n ) => {\n publishWidgetPreviewSignal({\n version: 1,\n expectedState,\n missingResponses: [...missingResponses],\n failedRequests: [...failedRequests],\n widgetCrashed,\n ...(renderReport ? { renderReport } : {}),\n ...signal,\n });\n document.documentElement.dataset.widgetPreviewState = signal.state;\n };\n publish({ state: \"loading\", revision });\n\n const fail = (errorCode: string) => {\n publish({ state: \"failed\", revision, error_code: errorCode });\n publishWidgetImageReadiness({ version: 1, state: \"failed\", error_code: errorCode });\n };\n\n const recordMissingResponse = (requestKey: string) => {\n if (!missingResponses.includes(requestKey)) missingResponses.push(requestKey);\n };\n\n /** A request (or a preview hydration) the fixture answered with a failing `__status`. */\n const recordFailedRequest = (requestKey: string) => {\n if (!failedRequests.includes(requestKey)) failedRequests.push(requestKey);\n };\n\n /** The error boundary caught the widget (`ConversationWidgetErrorBoundary` `onCrash`). */\n const recordWidgetCrash = () => {\n widgetCrashed = true;\n };\n\n /** The block's render report (`WidgetRenderReportContext` of the host); a new status settles again. */\n const recordRenderReport = (entry: WidgetRenderReportEntry) => {\n renderReport = entry;\n scheduleSettleAgain();\n };\n\n const settle = (element: HTMLElement, hasHydrationError: () => boolean) => {\n const hasError = hasHydrationError() || widgetCrashed || failedRequests.length > 0;\n const observedState = observeWidgetPreviewState(element, hasError, renderReport);\n const { x, y, width, height } = element.getBoundingClientRect();\n const rect = { x, y, width, height };\n revision += 1;\n const expectedStateReached = observedState === expectedState;\n publish({ state: \"settled\", revision, observedState, expectedStateReached, rect });\n publishWidgetImageReadiness(\n expectedStateReached\n ? { version: 1, state: \"ready\", rect }\n : {\n version: 1,\n state: \"failed\",\n error_code: `EXPECTED_${expectedState.toUpperCase()}_SAW_${observedState.toUpperCase()}`,\n rect,\n },\n );\n };\n\n /**\n * Watches `watchedElement` (the whole preview document, so an interaction that changes only the canvas pane or opens\n * a modal settles too)\n * and classifies `widgetElement` (the widget alone, the screenshot); returns the disposer.\n */\n const observe = (watchedElement: HTMLElement, widgetElement: HTMLElement, hasHydrationError: () => boolean) => {\n let settleTimer: ReturnType<typeof setTimeout> | null = null;\n const scheduleSettle = () => {\n if (settleTimer !== null) clearTimeout(settleTimer);\n settleTimer = setTimeout(() => settle(widgetElement, hasHydrationError), SETTLE_MS);\n };\n const mutationObserver = new MutationObserver((mutations) => {\n if (mutations.some((mutation) => !isSkeletonAnimation(mutation))) scheduleSettle();\n });\n mutationObserver.observe(watchedElement, {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true,\n });\n scheduleSettleAgain = scheduleSettle;\n scheduleSettle();\n return () => {\n mutationObserver.disconnect();\n scheduleSettleAgain = () => {};\n if (settleTimer !== null) clearTimeout(settleTimer);\n };\n };\n\n return { observe, fail, recordMissingResponse, recordFailedRequest, recordWidgetCrash, recordRenderReport };\n};\n\nexport type WidgetPreviewReadiness = ReturnType<typeof createWidgetPreviewReadiness>;\n","import { createHeaderlessResponse, interceptXMLHttpRequests, isFetchRequest } from \"../request-interception/browser-request-interception\";\nimport type { WidgetPreviewResponse } from \"./widget-preview.types\";\n\n/** The key a fixture response is stored under: method, path and the sorted query (`GET /api/example/…?a=1&b=2`). */\nexport const widgetPreviewRequestKey = (method: string, url: URL): string => {\n const sortedUrl = new URL(url.toString());\n sortedUrl.searchParams.sort();\n return `${method.toUpperCase()} ${sortedUrl.pathname}${sortedUrl.search}`;\n};\n\n/** The app's own error log: answered empty and never reported — a fixture's error state must not count as a gap. */\nconst SILENTLY_ANSWERED_PATHS = [\"/rest_api/v1/log\"];\nconst isSilentlyAnswered = (url: URL): boolean => SILENTLY_ANSWERED_PATHS.includes(url.pathname);\n\nexport const isStatusResponse = (response: unknown): response is { __status: number; __body?: unknown } =>\n typeof response === \"object\" &&\n response !== null &&\n typeof (response as { __status?: unknown }).__status === \"number\";\nexport const isPendingResponse = (response: unknown): boolean =>\n typeof response === \"object\" && response !== null && (response as { __pending?: unknown }).__pending === true;\n\n/** A fixture answer as an `XMLHttpRequest` reads it; a status a `Response` cannot carry fails like a network error. */\nconst xhrAnswer = (body: unknown, status: number): Response => {\n if (status < 200 || status > 599) throw new TypeError(`preview response ${status}`);\n if ([204, 205, 304].includes(status)) return createHeaderlessResponse(null, status);\n return createHeaderlessResponse(JSON.stringify(body), status, status === 200 ? \"OK\" : \"\");\n};\n\n/**\n * Serves every request of the preview — `XMLHttpRequest` (the transport of axios's browser adapter) and `fetch` — from\n * the fixture: a known request gets its body (a copy), a `__status` entry fails with that status (a status of 400 or\n * more is reported as a failed request — the error state the fixture asked for), a `__pending` entry never answers (the\n * loading state), and anything else — an unknown read, a write the fixture does not answer — fails as a missing\n * response and is reported. A write is answered only when the fixture names it (`\"POST /api/example/…\"`, e.g. a\n * widget's fire-and-forget measurement event). Nothing reaches a server.\n */\nexport const installWidgetPreviewRequests = (\n responses: Record<string, WidgetPreviewResponse>,\n onMissingResponse: (requestKey: string) => void,\n onFailedRequest: (requestKey: string) => void = () => {},\n): (() => void) => {\n // XMLHttpRequest: a missing response fails like a network error (no response), a `__status` entry answers with its\n // status and `__body`.\n const restoreXMLHttpRequest = interceptXMLHttpRequests(async (request) => {\n if (isSilentlyAnswered(request.url)) return xhrAnswer({}, 200);\n const requestKey = widgetPreviewRequestKey(request.method, request.url);\n const response = Object.prototype.hasOwnProperty.call(responses, requestKey) ? responses[requestKey] : undefined;\n if (response === undefined) {\n onMissingResponse(requestKey);\n throw new Error(`no preview response for ${requestKey}`);\n }\n if (isPendingResponse(response)) return new Promise<Response>(() => {});\n if (isStatusResponse(response)) {\n if (response.__status >= 400) onFailedRequest(requestKey);\n return xhrAnswer(response.__body ?? null, response.__status);\n }\n return xhrAnswer(response, 200);\n });\n // `fetch` is answered the same way (a few modules bypass the XMLHttpRequest client); a missing response is a 404,\n // reported. A `Request` of another realm is read by its brand, not by `instanceof`.\n const originalFetch = window.fetch;\n window.fetch = async (input: RequestInfo | URL, init?: RequestInit) => {\n const fromRequest = isFetchRequest(input) ? input : undefined;\n const method = (init?.method ?? (fromRequest ? fromRequest.method : \"GET\")).toLowerCase();\n const url = new URL(fromRequest ? fromRequest.url : String(input), window.location.origin);\n if (isSilentlyAnswered(url)) return new Response(\"{}\", { status: 200 });\n const requestKey = widgetPreviewRequestKey(method, url);\n const response = Object.prototype.hasOwnProperty.call(responses, requestKey) ? responses[requestKey] : undefined;\n if (response === undefined) {\n onMissingResponse(requestKey);\n return new Response(null, { status: 404 });\n }\n if (isPendingResponse(response)) return new Promise<Response>(() => {});\n if (isStatusResponse(response)) {\n if (response.__status >= 400) onFailedRequest(requestKey);\n return new Response(JSON.stringify(response.__body ?? null), { status: response.__status });\n }\n return new Response(JSON.stringify(response), { status: 200, headers: { \"Content-Type\": \"application/json\" } });\n };\n return () => {\n restoreXMLHttpRequest();\n window.fetch = originalFetch;\n };\n};\n","import {\n getWidgetHydrator,\n listWidgetHydratorTypes,\n registerWidgetHydrator,\n unregisterWidgetHydrator,\n} from \"../renderer/widget-hydration/widget-hydration.registry\";\nimport type { RegisteredWidget } from \"../renderer/widget-hydration/widget-hydration.types\";\nimport { isPendingResponse, isStatusResponse } from \"./widget-preview-requests\";\nimport type { WidgetPreviewResponse } from \"./widget-preview.types\";\n\n/** The fixture's entry for one hydration: the exact derived key first, then the hydrator type (as the capture reads). */\nconst findFixtureHydration = (\n hydration: Record<string, WidgetPreviewResponse>,\n type: string,\n key: string,\n): { found: boolean; value?: WidgetPreviewResponse; hydrationKey: string } => {\n if (Object.prototype.hasOwnProperty.call(hydration, key))\n return { found: true, value: hydration[key], hydrationKey: key };\n if (Object.prototype.hasOwnProperty.call(hydration, type))\n return { found: true, value: hydration[type], hydrationKey: type };\n return { found: false, hydrationKey: key };\n};\n\n/** One fixture value as a hydrator result: a copy of the body, a failing `__status`, or a `__pending` that never ends. */\nconst answerFromFixture = (\n value: WidgetPreviewResponse,\n hydrationKey: string,\n onFailedRequest: (requestKey: string) => void,\n): Promise<unknown> => {\n if (isPendingResponse(value)) return new Promise(() => {});\n if (isStatusResponse(value)) {\n onFailedRequest(`HYDRATION ${hydrationKey}`);\n return Promise.reject(new Error(`preview hydration ${value.__status}`));\n }\n return Promise.resolve(structuredClone(value));\n};\n\n/**\n * The preview's hydration transport for the `interactive` and `replay` modes: every registered hydrator is replaced by\n * one that answers from the fixture's `hydration` (by derived key, else by type) and otherwise runs the real hydrator,\n * whose requests the request transport answers from `responses`. The widget therefore runs its live code path —\n * `useWidgetHydration` with the store's hydration slice, no frozen capture context — so a self-hydrating canvas widget\n * auto-opens its canvas like in the chat (`CanvasLauncherWidget`). The `email` mode keeps the capture's frozen hydration.\n * Returns the disposer that puts the real hydrators back.\n */\nexport const installWidgetPreviewHydration = (\n hydration: Record<string, WidgetPreviewResponse>,\n onFailedRequest: (requestKey: string) => void,\n): (() => void) => {\n const replacedHydrators = new Map<string, RegisteredWidget<unknown, unknown>>();\n for (const type of listWidgetHydratorTypes()) {\n const registered = getWidgetHydrator<unknown, unknown>(type);\n if (!registered) continue;\n replacedHydrators.set(type, registered);\n unregisterWidgetHydrator(type);\n registerWidgetHydrator<unknown, unknown>(type, {\n ...registered,\n hydrator: (payload, context) => {\n const fixtureHydration = findFixtureHydration(hydration, type, registered.deriveKey(type, payload));\n return fixtureHydration.found\n ? answerFromFixture(fixtureHydration.value, fixtureHydration.hydrationKey, onFailedRequest)\n : registered.hydrator(payload, context);\n },\n });\n }\n return () => {\n for (const [type, registered] of replacedHydrators) {\n unregisterWidgetHydrator(type);\n registerWidgetHydrator(type, registered);\n }\n };\n};\n","import { Text } from \"../../../provider/components\";\nimport { ConversationWidgetProvider } from \"../../../renderer/ConversationWidgetContext\";\nimport { ConversationMessageInputComposerWidgets } from \"../../../chat/ConversationMessageInput/ConversationMessageInputComposerWidgets/ConversationMessageInputComposerWidgets\";\nimport { EntityMentionAskButton } from \"../EntityMentionAskButton/EntityMentionAskButton\";\nimport styles from \"./EntityMentionAskFlowStory.module.scss\";\n\nconst ENTITIES = [\n { entityType: \"competitor\", entityId: \"8812\", label: \"Altes Gasthaus Leve\", agentSpaceKey: 1 },\n { entityType: \"competitor\", entityId: \"9001\", label: \"Kleiner Kiepenkerl\", agentSpaceKey: 1 },\n];\n\n/**\n * The \"Ask about this\" flow for the story and the browser check: a stand-in for the detail panel's\n * footer (the `entityDetail` shell is the canvas shell's, the bodies come from the entity types) with the real button, and the real\n * composer strip of the chat input, so a click shows the chip where the owner types.\n */\nexport const EntityMentionAskFlowStory = (props: { maxWidth?: number }) => (\n <ConversationWidgetProvider callbacks={{}}>\n <div className={styles.page} style={{ maxWidth: props.maxWidth ?? 720 }}>\n {ENTITIES.map((entity) => (\n <div key={entity.entityId} className={styles.panel}>\n <Text role=\"intro\" weight=\"bold\" translate={false}>\n {entity.label}\n </Text>\n <Text role=\"help\" color=\"var(--agents-fg-light)\" translate={false}>\n {\"detail panel body\"}\n </Text>\n <div className={styles.footer}>\n <EntityMentionAskButton {...entity} testId={`entity-mention-ask-${entity.entityId}`} />\n </div>\n </div>\n ))}\n <div className={styles.composer} data-testid=\"story-composer\">\n <ConversationMessageInputComposerWidgets testId=\"story-input\" />\n <Text role=\"help\" color=\"var(--agents-fg-lightest)\" translate={false}>\n {\"Ask anything…\"}\n </Text>\n </div>\n </div>\n </ConversationWidgetProvider>\n);\n"],"names":["styles","widget","composerLog","composerEntry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,iBAAiB,CAAC,oBAA4C;AAClE,MAAI,OAAO,oBAAoB,YAAY,CAAC,OAAO,SAAS,eAAe,KAAK,kBAAkB,EAAG,QAAO;AAC5G,QAAM,UAAU,KAAK,MAAM,kBAAkB,EAAE;AAC/C,QAAM,UAAU,KAAK,MAAM,kBAAkB,EAAE;AAC/C,SAAO,GAAG,OAAO,IAAI,OAAO,OAAO,EAAE,SAAS,GAAG,GAAG,CAAC;AACvD;AAEA,MAAM,YAAY,CAAC,EAAE,YAAwC;AAC3D,QAAM,WAAW,eAAe,MAAM,eAAe;AACrD,SACE,oBAAC,eAAA,EAAc,OAAM,QAAO,SAAO,MACjC,UAAA,qBAAC,OAAA,EAAI,WAAWA,SAAO,WACpB,UAAA;AAAA,IAAA,OAAO,MAAM,cAAc,WAC1B,oBAAC,OAAA,EAAI,WAAWA,SAAO,oBAAoB,KAAK,MAAM,WAAW,KAAI,IAAG,IACtE;AAAA,IACJ,qBAAC,OAAA,EAAI,WAAWA,SAAO,eACrB,UAAA;AAAA,MAAA,oBAAC,MAAA,EAAK,MAAK,QAAO,QAAO,QAAO,WAAW,OACxC,UAAA,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ,IACnD;AAAA,MACA,oBAAC,QAAK,MAAK,WAAU,OAAM,0BAAyB,WAAW,OAC5D,UAAA,CAAC,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU,MAAM,QAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,EAAA,CAClG;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;AAE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
1
1
|
"use client";
|
|
2
2
|
import { A, i } from "./chunks/icon-names-C5PeVvkJ.js";
|
|
3
3
|
import { A as A2, f } from "./chunks/host-color-scheme-Jhb7JZR7.js";
|
|
4
|
-
import { A as A3, u } from "./chunks/link-navigation-
|
|
5
|
-
import { A as A4, B, C, a, D, b, c, d, e, G, H, f as f2, I, g, L, M, h, i as i2, j, P, R, k, S, l, m, n, o, p, q, T, r, s, t, u as u2, v, W, w, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 } from "./chunks/index-
|
|
4
|
+
import { A as A3, u } from "./chunks/link-navigation-DQWyeNkx.js";
|
|
5
|
+
import { A as A4, B, C, a, D, b, c, d, e, G, H, f as f2, I, g, L, M, h, i as i2, j, P, R, k, S, l, m, n, o, p, q, T, r, s, t, u as u2, v, W, w, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 } from "./chunks/index-DAEGct6X.js";
|
|
6
6
|
import { u as u3, a as a10 } from "./chunks/AgentsConversationClientContext-B_UJSLXU.js";
|
|
7
7
|
export {
|
|
8
8
|
A as AGENTS_ICON_NAMES,
|
package/dist/renderer.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { C, a, M, W, b, c, d, p, s } from "./chunks/ConversationMarkdown-
|
|
3
|
-
import { m as findWidgetFenceByPayloadHash, n as findWidgetFencesInMarkdown } from "./chunks/
|
|
4
|
-
import { o, p as p2, q, t, v, w, j, x, y, z, B, D, F, G } from "./chunks/
|
|
5
|
-
import {
|
|
6
|
-
import { C as C2,
|
|
7
|
-
import { C as C3, a as a7, d as d2, g, i as i2, r, u as u2, b as
|
|
8
|
-
import { c as c2, u as u3 } from "./chunks/canvasBodies-
|
|
2
|
+
import { C, a, M, W, b, c, d, p, s } from "./chunks/ConversationMarkdown-W8NzeAT1.js";
|
|
3
|
+
import { m as findWidgetFenceByPayloadHash, n as findWidgetFencesInMarkdown } from "./chunks/conversationWidgetRegistry-BW-U_RvC.js";
|
|
4
|
+
import { o, p as p2, q, t, v, w, j, x, y, z, B, D, F, G, H } from "./chunks/conversationWidgetRegistry-BW-U_RvC.js";
|
|
5
|
+
import { p as useResolvedConversationWidgetAgentSpaceKey, q as payloadHashOfInstanceId } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
|
|
6
|
+
import { C as C2, t as t2, v as v2, w as w2, x as x2, y as y2, z as z2, A, B as B2, D as D2, L, R, S, W as W2, E, k, F as F2, G as G2, H as H2, I, J, K, N, O, P, Q, T, m, U, V, i, X, b as b2, Y, Z, _, $, a0, j as j2, a1, s as s2, a2, o as o2, a as a3, a3 as a32, u, a4, a5, a6 } from "./chunks/WebSearchResultsConversationWidget-BM624Fcx.js";
|
|
7
|
+
import { C as C3, a as a7, d as d2, g, i as i2, r, u as u2, b as b3 } from "./chunks/canvas-label-context-BKRsrpye.js";
|
|
8
|
+
import { c as c2, u as u3 } from "./chunks/canvasBodies-CMqo5eHg.js";
|
|
9
9
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
10
|
-
import { m as Skeleton } from "./chunks/index-
|
|
11
|
-
import { aa, ab, ac, ad, ae } from "./chunks/index-
|
|
10
|
+
import { m as Skeleton } from "./chunks/index-DAEGct6X.js";
|
|
11
|
+
import { aa, ab, ac, ad, ae } from "./chunks/index-DAEGct6X.js";
|
|
12
12
|
import { useMemo } from "react";
|
|
13
|
-
import { a as a8, b as
|
|
13
|
+
import { a as a8, b as b4, c as c3, d as d3, e } from "./chunks/canvas-reducers-CZaOPvdt.js";
|
|
14
14
|
import { a as a9 } from "./chunks/canvas-feature-flags-Cn8xBliA.js";
|
|
15
15
|
const pickSection = (payloadValue, fallback) => {
|
|
16
16
|
return payloadValue ?? fallback.data ?? void 0;
|
|
@@ -99,21 +99,21 @@ const withConversationWidgetVariant = (base, rawPayload) => {
|
|
|
99
99
|
export {
|
|
100
100
|
aa as AgentsWidgetHydrationStateContainer,
|
|
101
101
|
C2 as CANVAS_BOXED_INSET_PX,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
t2 as CANVAS_FILLS_SCREEN_WIDTH_PERCENT,
|
|
103
|
+
v2 as CANVAS_MIN_WIDTH_PX,
|
|
104
|
+
w2 as CHAT_COLUMN_MIN_WIDTH_PX,
|
|
105
105
|
C3 as CanvasLabelContext,
|
|
106
106
|
a7 as CanvasTitleSlotContext,
|
|
107
107
|
C as ConversationMarkdown,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
x2 as ConversationWidgetActions,
|
|
109
|
+
y2 as ConversationWidgetAgentSpaceFrame,
|
|
110
|
+
z2 as ConversationWidgetAgentSpaceHeader,
|
|
111
|
+
A as ConversationWidgetContext,
|
|
112
112
|
o as ConversationWidgetErrorBoundary,
|
|
113
113
|
p2 as ConversationWidgetFeatureGate,
|
|
114
114
|
ConversationWidgetGateSkeleton,
|
|
115
115
|
a as ConversationWidgetHost,
|
|
116
|
-
|
|
116
|
+
B2 as ConversationWidgetRenderContext,
|
|
117
117
|
D2 as DEFAULT_CANVAS_WIDTH_PERCENT,
|
|
118
118
|
L as LEGACY_CARD_CLICK_ORIGIN,
|
|
119
119
|
M as MarkdownLink,
|
|
@@ -125,81 +125,82 @@ export {
|
|
|
125
125
|
W2 as WidgetRenderReportContext,
|
|
126
126
|
q as addComposedNodeSchemaApplicationPart,
|
|
127
127
|
a8 as applyClearCanvas,
|
|
128
|
-
|
|
128
|
+
b4 as applyCloseCanvas,
|
|
129
129
|
c3 as applyOpenCanvas,
|
|
130
130
|
d3 as applyResetCanvasForNewTurn,
|
|
131
131
|
e as applySetCanvasCreatedEntityId,
|
|
132
132
|
b as buildComposerWidgetFenceBlock,
|
|
133
133
|
c as buildMessageTextWithComposerWidgets,
|
|
134
|
-
|
|
134
|
+
E as buildWidgetAgentSpaceKeyProps,
|
|
135
135
|
d as buildWidgetRenderReportSignal,
|
|
136
|
-
|
|
136
|
+
k as canvasBehaviourOf,
|
|
137
137
|
c2 as canvasBodies,
|
|
138
138
|
a9 as canvasFeatureFlagOf,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
F2 as canvasInstanceIdForActiveAgentSpace,
|
|
140
|
+
G2 as canvasInstanceIdForAgentSpace,
|
|
141
|
+
H2 as canvasInstanceIdForEntity,
|
|
142
|
+
I as canvasInstanceIdForMessage,
|
|
143
|
+
J as canvasInstanceIdForMessagePayload,
|
|
144
|
+
K as canvasInstanceIdForReference,
|
|
145
|
+
N as canvasKindOpenerWidgetNamesOf,
|
|
146
|
+
O as canvasWidthPercentOf,
|
|
147
147
|
t as closestWidgetNames,
|
|
148
148
|
v as composedNodeSchema,
|
|
149
149
|
w as composedViewTreeToWire,
|
|
150
150
|
j as conversationWidgetRegistry,
|
|
151
151
|
ad as createAgentsWidgetHydrationStateStore,
|
|
152
152
|
d2 as deepLinkableWidgetNameForCanvas,
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
P as defaultConversationWidgetCallbacks,
|
|
154
|
+
Q as entityIdOfInstanceId,
|
|
155
155
|
findWidgetFenceByPayloadHash,
|
|
156
156
|
findWidgetFencesInMarkdown,
|
|
157
157
|
x as getComposedNodeSchema,
|
|
158
158
|
y as getConversationWidgetRegistryRevision,
|
|
159
|
-
|
|
159
|
+
T as getDeclaredCanvasIds,
|
|
160
160
|
ae as getDefaultAgentsStateStore,
|
|
161
161
|
g as getWidgetClickSignalSources,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
m as getWidgetHydrator,
|
|
163
|
+
U as hasWidgetHydrator,
|
|
164
|
+
V as isCanvasAnchorLoaded,
|
|
165
165
|
i as isCanvasId,
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
X as isCanvasReference,
|
|
167
|
+
b2 as isPackageCanvasId,
|
|
168
168
|
isSectionIncomplete,
|
|
169
169
|
isSectionLoading,
|
|
170
170
|
i2 as isWidgetClickSignalSource,
|
|
171
171
|
mergeSection,
|
|
172
172
|
mergeSectionValues,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
Y as messageAnchor,
|
|
174
|
+
Z as packageCanvasBehaviours,
|
|
175
|
+
_ as pageAnchor,
|
|
176
176
|
p as parseWidgetRenderReportSignal,
|
|
177
177
|
payloadHashOfInstanceId,
|
|
178
178
|
pickSection,
|
|
179
179
|
z as readComposedViewTree,
|
|
180
180
|
B as readConversationWidgetRegistrations,
|
|
181
181
|
D as readOpenEntityActionTarget,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
$ as readWidgetAgentSpaceKeyAttribute,
|
|
183
|
+
a0 as referenceOfCanvasInstanceId,
|
|
184
|
+
F as registerComposedNodeSchemaPart,
|
|
185
|
+
j2 as registerWidgetHydrator,
|
|
186
|
+
G as resolveCanonicalWidgetName,
|
|
186
187
|
r as resolveDeepLinkableWidget,
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
H as resolveWidgetName,
|
|
189
|
+
a1 as sameCanvasAnchor,
|
|
189
190
|
s2 as sameCanvasIdentity,
|
|
190
191
|
sectionCoversKeys,
|
|
191
|
-
|
|
192
|
+
a2 as shortStringHash,
|
|
192
193
|
s as splitComposerWidgetFencesFromMessageText,
|
|
193
|
-
|
|
194
|
+
o2 as unregisterWidgetHydrator,
|
|
194
195
|
useAnchorWidgetAgentSpaceKey,
|
|
195
196
|
useAnchorWidgetFenceAgentSpaceKey,
|
|
196
197
|
u3 as useAnchorWidgetPayload,
|
|
197
198
|
u2 as useCanvasLabel,
|
|
198
|
-
|
|
199
|
+
b3 as useCanvasTitleSlot,
|
|
199
200
|
useConversationWidgetAgentSpaceFallback,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
a3 as useConversationWidgetContext,
|
|
202
|
+
a32 as useIsEmailWidgetRender,
|
|
203
|
+
u as useReportWidgetRenderStatus,
|
|
203
204
|
useResolvedConversationWidgetAgentSpaceKey,
|
|
204
205
|
a4 as useWidgetHydration,
|
|
205
206
|
a5 as useWidgetMemory,
|
package/dist/styles.css
CHANGED
|
@@ -4500,6 +4500,52 @@ thead + tbody .agents_row_VBlQR-:first-child {
|
|
|
4500
4500
|
.agents_actions_FU-EZk {
|
|
4501
4501
|
display: flex;
|
|
4502
4502
|
justify-content: flex-end;
|
|
4503
|
+
}.agents_root_D6NTnE {
|
|
4504
|
+
display: flex;
|
|
4505
|
+
flex-direction: column;
|
|
4506
|
+
gap: 0.75rem;
|
|
4507
|
+
min-width: 0;
|
|
4508
|
+
overflow-wrap: anywhere;
|
|
4509
|
+
}
|
|
4510
|
+
|
|
4511
|
+
.agents_header_dq-7zJ {
|
|
4512
|
+
display: flex;
|
|
4513
|
+
flex-wrap: wrap;
|
|
4514
|
+
align-items: flex-start;
|
|
4515
|
+
justify-content: space-between;
|
|
4516
|
+
gap: 0.5rem 0.75rem;
|
|
4517
|
+
min-width: 0;
|
|
4518
|
+
}
|
|
4519
|
+
|
|
4520
|
+
.agents_lines_br3wa7 {
|
|
4521
|
+
display: flex;
|
|
4522
|
+
flex: 1 1 200px;
|
|
4523
|
+
flex-direction: column;
|
|
4524
|
+
gap: 0.25rem;
|
|
4525
|
+
min-width: 0;
|
|
4526
|
+
}
|
|
4527
|
+
|
|
4528
|
+
.agents_statusChip_7YV86B {
|
|
4529
|
+
flex: none;
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4532
|
+
.agents_notice_rEZyPI {
|
|
4533
|
+
padding: 0.5rem 0.75rem;
|
|
4534
|
+
border-left: 0.25rem solid var(--agents-divider-gl);
|
|
4535
|
+
background: var(--agents-bg-var);
|
|
4536
|
+
}
|
|
4537
|
+
|
|
4538
|
+
.agents_result_vs3nDg {
|
|
4539
|
+
padding-top: 0.5rem;
|
|
4540
|
+
border-top: 0.0625rem solid var(--agents-divider-gl);
|
|
4541
|
+
min-width: 0;
|
|
4542
|
+
}
|
|
4543
|
+
|
|
4544
|
+
.agents_actions_bM3uYK {
|
|
4545
|
+
display: flex;
|
|
4546
|
+
flex-wrap: wrap;
|
|
4547
|
+
justify-content: flex-end;
|
|
4548
|
+
gap: 0.5rem;
|
|
4503
4549
|
}.agents_entityDetail_QEy9QH {
|
|
4504
4550
|
display: flex;
|
|
4505
4551
|
flex-direction: column;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AgentSchedulesApi } from "./agent-schedules-api";
|
|
2
|
+
import type { AgentScheduleOrderPermission, AgentScheduleOrderPermissionWords } from "./agent-schedules-types";
|
|
3
|
+
/** The package's default run (`Schedule.Run`): a run purpose that is none or this one reads as the standard run. */
|
|
4
|
+
export declare const DEFAULT_SCHEDULE_RUN_PURPOSE = "Schedule.Run";
|
|
5
|
+
/** The host's words for the parts of an order; each absent or answering null keeps the package's words. Already translated. */
|
|
6
|
+
export interface AgentScheduleOrderTexts {
|
|
7
|
+
/** The cron expression of a recurring task in words ("Every Monday at 08:00"); the expression stays the tooltip. */
|
|
8
|
+
describeCronSchedule?: (expression: string) => string | null;
|
|
9
|
+
/** How the runs work, by run purpose (none = `Schedule.Run`); default "Standard run", else the purpose's name. */
|
|
10
|
+
describeRunPurpose?: (runPurpose: string | null) => string | null;
|
|
11
|
+
/**
|
|
12
|
+
* The words of one permission, given the whole permission as the server delivers it (action class, connection,
|
|
13
|
+
* external-recipients flag, the server's English `description` with the limits). Null keeps the package's words: a
|
|
14
|
+
* translated name per package action class (`AGENT_SCHEDULE_ORDER_ACTION_CLASSES`, else "Permission"), below it the
|
|
15
|
+
* connection and the server's `description` unchanged (the limits are shown as the server words them until the draft
|
|
16
|
+
* carries them as fields). A `label` replaces the name, a `detail` the server's description, a `connection` the
|
|
17
|
+
* package's "Connection #N".
|
|
18
|
+
*/
|
|
19
|
+
describePermission?: (permission: AgentScheduleOrderPermission) => AgentScheduleOrderPermissionWords | null;
|
|
20
|
+
/** The name the owner knows the agent by ("%agentName% runs the task exactly as shown."); default "The agent". */
|
|
21
|
+
agentName?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AgentScheduleOrderDraftPanelProps extends AgentScheduleOrderTexts {
|
|
24
|
+
/** `createAgentSchedulesApi(…)` of the host. */
|
|
25
|
+
api: AgentSchedulesApi;
|
|
26
|
+
scheduleId: number;
|
|
27
|
+
/**
|
|
28
|
+
* The hash of the draft this view was opened for (the chat widget's): the draft is shown only while the stored one
|
|
29
|
+
* still has it; a newer draft is announced and shown only after "Show the new draft". Absent: the first draft read.
|
|
30
|
+
*/
|
|
31
|
+
shownDraftHash?: string | null;
|
|
32
|
+
/** False: no button works (a widget of an old message). Default true. */
|
|
33
|
+
interactive?: boolean;
|
|
34
|
+
/** False: approving is off. Default true; an `@mgamadeus/ddd-admin-ui` `WriteAccessProvider` above narrows it too. */
|
|
35
|
+
writesAllowed?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The signed-in account: when set and not the schedule's owner, the panel says who approves instead of offering the
|
|
38
|
+
* button (the server refuses anyone but the owner anyway).
|
|
39
|
+
*/
|
|
40
|
+
viewerAccountId?: number | null;
|
|
41
|
+
/** After the approval took effect. */
|
|
42
|
+
onApproved?: () => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const AgentScheduleOrderDraftPanel: ({ api, scheduleId, shownDraftHash, interactive, writesAllowed, viewerAccountId, onApproved, describeCronSchedule, describeRunPurpose, describePermission, agentName, className, }: AgentScheduleOrderDraftPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,8 @@ import { type PageLinkComponent } from "@mgamadeus/ddd-admin-ui/primitives";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import type { AgentSchedulesApi } from "./agent-schedules-api";
|
|
4
4
|
import type { AgentSchedulePlace, AgentSchedulesScope } from "./agent-schedules-types";
|
|
5
|
-
|
|
5
|
+
import { type AgentScheduleOrderTexts } from "./AgentScheduleOrderDraftPanel";
|
|
6
|
+
export interface AgentSchedulesPanelProps extends Pick<AgentScheduleOrderTexts, "describeRunPurpose" | "describePermission" | "agentName"> {
|
|
6
7
|
/** `createAgentSchedulesApi(…)` of the host. */
|
|
7
8
|
api: AgentSchedulesApi;
|
|
8
9
|
/** Only the schedules of places of this kind (a kind the application names), and with `recordId` of this record. */
|
|
@@ -30,6 +31,11 @@ export interface AgentSchedulesPanelProps {
|
|
|
30
31
|
/** The schedule whose runs are open, when the host keeps it (the URL); with it pass `onSelectSchedule`. */
|
|
31
32
|
selectedScheduleId?: number | null;
|
|
32
33
|
onSelectSchedule?: (scheduleId: number | null) => void;
|
|
34
|
+
/**
|
|
35
|
+
* The signed-in account: in the approval dialog of a schedule waiting for approval, a viewer who is not its owner
|
|
36
|
+
* reads who approves instead of the button (the server refuses anyone but the owner).
|
|
37
|
+
*/
|
|
38
|
+
viewerAccountId?: number | null;
|
|
33
39
|
/** The card's heading; default "Schedules". Already translated. */
|
|
34
40
|
title?: ReactNode;
|
|
35
41
|
className?: string;
|
|
@@ -38,6 +44,8 @@ export interface AgentSchedulesPanelProps {
|
|
|
38
44
|
* The agent's schedules as a table: where a schedule lives, its label and task, its timing (cron expression or
|
|
39
45
|
* one-time moment, with its time zone), its state, the last and the next run and how the newest run ended. A row's
|
|
40
46
|
* menu opens the runs, edits the schedule, pauses or resumes it, runs it now or deletes it; each entry shows only when
|
|
41
|
-
* the schedule allows it now, and a delete or a run asks first.
|
|
47
|
+
* the schedule allows it now, and a delete or a run asks first. A schedule waiting for approval (`PENDING_APPROVAL`)
|
|
48
|
+
* offers "Review and approve": its order in a dialog (`AgentScheduleOrderDraftPanel`), approved with the hash of what
|
|
49
|
+
* is shown.
|
|
42
50
|
*/
|
|
43
|
-
export declare const AgentSchedulesPanel: ({ api, placeKind, recordId, scope, buildAccountHref, writesAllowed, linkComponent, buildConversationHref, describePlace, describeCronSchedule, selectedScheduleId, onSelectSchedule, title, className, }: AgentSchedulesPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare const AgentSchedulesPanel: ({ api, placeKind, recordId, scope, buildAccountHref, writesAllowed, linkComponent, buildConversationHref, describePlace, describeCronSchedule, describeRunPurpose, describePermission, agentName, viewerAccountId, selectedScheduleId, onSelectSchedule, title, className, }: AgentSchedulesPanelProps) => import("react/jsx-runtime").JSX.Element;
|