@mgamadeus/ddd-agents 0.5.12 → 0.5.13
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/dist/chat.js +11 -9
- package/dist/chat.js.map +1 -1
- package/dist/chunks/{ConversationMessageInputComposerWidgets-CGP-oxpk.js → ConversationMessageInputComposerWidgets-B3Zf69rD.js} +6 -6
- package/dist/chunks/{ConversationMessageInputComposerWidgets-CGP-oxpk.js.map → ConversationMessageInputComposerWidgets-B3Zf69rD.js.map} +1 -1
- package/dist/chunks/{WebSearchResultsConversationWidget-DdlLDOLK.js → WebSearchResultsConversationWidget-887v8Wen.js} +2 -2
- package/dist/chunks/{WebSearchResultsConversationWidget-DdlLDOLK.js.map → WebSearchResultsConversationWidget-887v8Wen.js.map} +1 -1
- package/dist/chunks/{canvas-reducers-DEq2Udt2.js → canvas-reducers-CwFA3rQ6.js} +2 -2
- package/dist/chunks/{canvas-reducers-DEq2Udt2.js.map → canvas-reducers-CwFA3rQ6.js.map} +1 -1
- package/dist/chunks/{canvas-title-slot-context-DZ0l2daI.js → canvas-title-slot-context-DK4sfhkl.js} +4 -4
- package/dist/chunks/{canvas-title-slot-context-DZ0l2daI.js.map → canvas-title-slot-context-DK4sfhkl.js.map} +1 -1
- package/dist/chunks/{canvasBodies-nwpKEfiA.js → canvasBodies-C7qqThc9.js} +4 -4
- package/dist/chunks/{canvasBodies-nwpKEfiA.js.map → canvasBodies-C7qqThc9.js.map} +1 -1
- package/dist/chunks/{canvasStorage-BW4VDRos.js → canvasStorage-i2wKVSBf.js} +2 -2
- package/dist/chunks/{canvasStorage-BW4VDRos.js.map → canvasStorage-i2wKVSBf.js.map} +1 -1
- package/dist/chunks/{link-navigation-lCSYZSv7.js → link-navigation-CNX8Am2L.js} +6 -4
- package/dist/chunks/link-navigation-CNX8Am2L.js.map +1 -0
- package/dist/chunks/{widget-image-readiness-signal-BTSBUkFK.js → widget-image-readiness-signal-C58JkCQA.js} +2 -2
- package/dist/chunks/{widget-image-readiness-signal-BTSBUkFK.js.map → widget-image-readiness-signal-C58JkCQA.js.map} +1 -1
- package/dist/chunks/{widget-name-resolver-Uhp0sE9E.js → widget-name-resolver-BVEuAsW5.js} +3 -3
- package/dist/chunks/{widget-name-resolver-Uhp0sE9E.js.map → widget-name-resolver-BVEuAsW5.js.map} +1 -1
- package/dist/client-testing.js +4 -4
- package/dist/image-render.js +7 -7
- package/dist/index.js +6 -6
- package/dist/kit.js +2 -2
- package/dist/preview.js +7 -7
- package/dist/provider.js +1 -1
- package/dist/renderer.js +9 -9
- package/dist/types/provider/components/types.d.ts +6 -1
- package/dist/widgets.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/link-navigation-lCSYZSv7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvasBodies-nwpKEfiA.js","sources":["../../src/renderer/canvas/use-anchor-widget-payload.ts","../../src/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvas.tsx","../../src/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvasBody.tsx","../../src/widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvas.tsx","../../src/widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvasBody.tsx","../../src/widgets/EntityMentionConversationWidget/shared/use-entity-mention-composer.ts","../../src/widgets/EntityMentionConversationWidget/EntityMentionAskButton/EntityMentionAskButton.tsx","../../src/kit/entity-detail/entity-detail-bodies.ts","../../src/kit/entity-detail/EntityDetailCanvasBody.tsx","../../src/kit/map-full-screen/MapFullScreenCanvasBody.tsx","../../src/renderer/canvas/canvasBodies.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { CanvasState } from \"./canvas-state\";\nimport { payloadHashOfInstanceId } from \"./canvas-state\";\nimport { findWidgetFenceByPayloadHash, findWidgetFencesInMarkdown } from \"./find-widget-fences-in-markdown\";\n\n/**\n * The payload string of the widget a message-anchored canvas was opened from: the fence of `widgetName` in the anchor\n * message whose payload hash the canvas instance id carries (`canvasInstanceIdForMessagePayload`); when the instance\n * id carries no hash (one canvas per message), the first fence of that name. Undefined for a page anchor, a missing\n * anchor message, or a message that no longer carries the fence — the body then renders nothing.\n */\nexport const useAnchorWidgetPayload = (\n canvas: CanvasState,\n anchorMessageMarkdown: string | null,\n widgetName: string,\n): string | undefined =>\n useMemo(() => {\n if (canvas.anchor.kind !== \"message\" || anchorMessageMarkdown === null) return undefined;\n const payloadHash = payloadHashOfInstanceId(canvas.instanceId);\n if (payloadHash !== undefined) {\n return findWidgetFenceByPayloadHash(anchorMessageMarkdown, widgetName, payloadHash)?.payload;\n }\n return findWidgetFencesInMarkdown(anchorMessageMarkdown).find((fence) => fence.name === widgetName)?.payload;\n }, [canvas.anchor, canvas.instanceId, anchorMessageMarkdown, widgetName]);\n","import { ConversationSearchResultsList, Text } from \"../../provider/components\";\nimport React from \"react\";\nimport { parseConversationSearchResultsPayload } from \"./shared/conversation-search-results-widget-payload\";\n\ntype ConversationSearchResultsCanvasProps = {\n query: string;\n groups: ReturnType<typeof parseConversationSearchResultsPayload>[\"groups\"];\n onOpenConversation: (conversationId: number, messageId?: number) => void;\n};\n\n// Canvas body styles — the same as every list canvas body, so the full-screen panel behaves the same:\n// a full-height flex column whose inner area SCROLLS (scrollStyle: flex 1 + overflowY auto — without it the content\n// overflows the panel with no scrollbar), plus a horizontal inset (contentStyle) because the results list is built\n// for the narrow inline chat column where the bubble provides the gutter — in the canvas there is no bubble, so it would\n// otherwise render edge-to-edge.\nconst canvasStyle: React.CSSProperties = {\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: 0,\n background: \"var(--agents-bg)\",\n};\nconst scrollStyle: React.CSSProperties = {\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n};\nconst contentStyle: React.CSSProperties = {\n padding: \"16px 24px 24px\",\n};\n\n/** The canvas body — a titled wrapper around the same grouped results, scrollable + inset like the other canvas widgets. */\nexport const ConversationSearchResultsCanvas = (props: ConversationSearchResultsCanvasProps) => (\n <div style={canvasStyle} data-testid=\"conversation-search-results-widget-canvas\">\n <div style={scrollStyle}>\n <div style={contentStyle} data-testid=\"conversation-search-results-widget-canvas-results\">\n <Text\n role=\"title\"\n replacements={{ query: props.query }}\n testId=\"conversation-search-results-widget-canvas-title\"\n >\n {'Search results for \"%query%\"'}\n </Text>\n <ConversationSearchResultsList groups={props.groups} query={props.query} onOpenConversation={props.onOpenConversation} />\n </div>\n </div>\n </div>\n);\n","import React, { useMemo } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { useConversationWidgetContext } from \"../../renderer/ConversationWidgetCallbacksContext\";\nimport { useAnchorWidgetPayload } from \"../../renderer/canvas/use-anchor-widget-payload\";\nimport { parseConversationSearchResultsPayload } from \"./shared/conversation-search-results-widget-payload\";\nimport { ConversationSearchResultsCanvas } from \"./ConversationSearchResultsCanvas\";\n\n/**\n * The `conversationSearchResults` CANVAS BODY (`canvasBodies.tsx`): re-reads the `ConversationSearchResults` fence of\n * the anchor message — the same payload the inline widget rendered from — and shows the grouped results. Nothing was\n * stored for it but the pointer. Renders nothing when the anchor message no longer carries the fence.\n */\nexport const ConversationSearchResultsCanvasBody = ({ canvas, anchorMessageMarkdown }: CanvasBodyProps) => {\n const { onOpenConversation } = useConversationWidgetContext();\n const payload = useAnchorWidgetPayload(canvas, anchorMessageMarkdown, \"ConversationSearchResults\");\n const parsed = useMemo(\n () => (payload === undefined ? null : parseConversationSearchResultsPayload(payload)),\n [payload],\n );\n if (parsed === null || parsed.groups.length === 0) return null;\n return (\n <ConversationSearchResultsCanvas\n query={parsed.query}\n groups={parsed.groups}\n onOpenConversation={(conversationId, messageId) => onOpenConversation?.(conversationId, messageId)}\n />\n );\n};\n","import { Text } from \"../../provider/components\";\nimport React from \"react\";\nimport { WebSearchResultSource } from \"./shared/web-search-results-widget-payload\";\nimport { WebSearchAnswer } from \"./WebSearchAnswer\";\nimport { WebSearchSourcesList } from \"./WebSearchSourcesList\";\n\ntype WebSearchResultsCanvasProps = {\n query: string;\n answer: string;\n sources: WebSearchResultSource[];\n provider?: string;\n};\n\n// Canvas body styles — mirror the ConversationSearchResults / listReviews drawer widgets: a full-height flex column\n// whose inner area SCROLLS (flex 1 + overflowY auto) with a horizontal inset (there is no chat bubble gutter in the canvas).\nconst canvasStyle: React.CSSProperties = {\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: 0,\n background: \"var(--agents-bg)\",\n};\nconst scrollStyle: React.CSSProperties = { flex: 1, minHeight: 0, overflowY: \"auto\" };\nconst contentStyle: React.CSSProperties = { padding: \"16px 24px 24px\" };\n\n/** The canvas body — the full answer + sources, scrollable + inset like the other canvas widgets. */\nexport const WebSearchResultsCanvas = (props: WebSearchResultsCanvasProps) => (\n <div style={canvasStyle} data-testid=\"web-search-results-widget-canvas\">\n <div style={scrollStyle}>\n <div style={contentStyle}>\n {props.query ? (\n <Text\n role=\"title\"\n replacements={{ query: props.query }}\n testId=\"web-search-results-widget-canvas-title\"\n >\n {'\"%query%\"'}\n </Text>\n ) : (\n <Text role=\"title\" testId=\"web-search-results-widget-canvas-title\">\n Web search\n </Text>\n )}\n <div style={{ marginTop: 12 }}>\n <WebSearchAnswer answer={props.answer} />\n </div>\n <WebSearchSourcesList\n sources={props.sources}\n provider={props.provider}\n testId=\"web-search-results-widget-canvas\"\n />\n </div>\n </div>\n </div>\n);\n","import React, { useMemo } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { useAnchorWidgetPayload } from \"../../renderer/canvas/use-anchor-widget-payload\";\nimport { parseWebSearchResultsPayload } from \"./shared/web-search-results-widget-payload\";\nimport { WebSearchResultsCanvas } from \"./WebSearchResultsCanvas\";\n\n/**\n * The `webSearchResults` CANVAS BODY (`canvasBodies.tsx`): re-reads the `WebSearchResults` fence of the anchor message\n * — the answer and its cited sources the inline widget rendered from — and shows them in the canvas. Renders nothing\n * when the anchor message no longer carries the fence.\n */\nexport const WebSearchResultsCanvasBody = ({ canvas, anchorMessageMarkdown }: CanvasBodyProps) => {\n const payload = useAnchorWidgetPayload(canvas, anchorMessageMarkdown, \"WebSearchResults\");\n const parsed = useMemo(() => (payload === undefined ? null : parseWebSearchResultsPayload(payload)), [payload]);\n if (parsed === null || (parsed.answer.trim() === \"\" && parsed.sources.length === 0)) return null;\n return (\n <WebSearchResultsCanvas\n query={parsed.query}\n answer={parsed.answer}\n sources={parsed.sources}\n provider={parsed.provider}\n />\n );\n};\n","import { useCallback } from \"react\";\nimport { useConversationWidgetContext } from \"../../../renderer/ConversationWidgetCallbacksContext\";\nimport {\n buildEntityMentionFields,\n ENTITY_MENTION_WIDGET_NAME,\n entityMentionKey,\n EntityMentionTarget,\n MAX_ENTITY_MENTIONS_PER_MESSAGE,\n normalizeEntityMentionFields,\n toEntityMentionWireFields,\n} from \"./entity-mention\";\n\nexport interface UseEntityMentionComposerResult {\n /** Whether this entity is already mentioned in the composer. */\n isMentioned: (target: EntityMentionTarget) => boolean;\n /**\n * Puts the entity into the composer as an `EntityMention` chip — once per entity (a second click is a no-op); past\n * {@link MAX_ENTITY_MENTIONS_PER_MESSAGE} the new entity takes the place of the oldest mention (one write: a remove\n * and an add in one event would both read the list before either). Sends nothing: the owner writes the question.\n * Returns false for a target that names no entity.\n */\n mentionEntity: (target: EntityMentionTarget) => boolean;\n}\n\n/**\n * The opener side of the `EntityMention` composer widget: what the detail panel's \"Ask about this\"\n * button calls. Reads and writes the composer widgets of the chat's widget context; the composer strip renders them.\n */\nexport const useEntityMentionComposer = (): UseEntityMentionComposerResult => {\n const { composerWidgets, addComposerWidget, replaceComposerWidgetFields } = useConversationWidgetContext();\n\n const findMentionWidgets = useCallback(\n () => composerWidgets.filter((composerWidget) => composerWidget.widgetName === ENTITY_MENTION_WIDGET_NAME),\n [composerWidgets],\n );\n\n const isMentioned = useCallback(\n (target: EntityMentionTarget) => {\n const mention = buildEntityMentionFields(target);\n if (mention === null) return false;\n return findMentionWidgets().some((composerWidget) => {\n const heldMention = normalizeEntityMentionFields(composerWidget.fields);\n return heldMention !== null && entityMentionKey(heldMention) === entityMentionKey(mention);\n });\n },\n [findMentionWidgets],\n );\n\n const mentionEntity = useCallback(\n (target: EntityMentionTarget) => {\n const mention = buildEntityMentionFields(target);\n if (mention === null) return false;\n if (isMentioned(target)) return true;\n const mentionWidgets = findMentionWidgets();\n if (mentionWidgets.length >= MAX_ENTITY_MENTIONS_PER_MESSAGE) {\n replaceComposerWidgetFields(mentionWidgets[0].composerWidgetId, toEntityMentionWireFields(mention));\n } else {\n addComposerWidget(ENTITY_MENTION_WIDGET_NAME, toEntityMentionWireFields(mention));\n }\n return true;\n },\n [isMentioned, findMentionWidgets, replaceComposerWidgetFields, addComposerWidget],\n );\n\n return { isMentioned, mentionEntity };\n};\n","import { useIsEmailWidgetRender } from \"../../../renderer/ConversationWidgetRenderContext\";\nimport { ConversationWidgetButton } from \"../../_shared/ConversationWidgetButton\";\nimport type { EntityMentionTarget } from \"../shared/entity-mention\";\nimport { useEntityMentionComposer } from \"../shared/use-entity-mention-composer\";\n\nexport interface EntityMentionAskButtonProps extends EntityMentionTarget {\n testId?: string;\n}\n\n/**\n * The detail panel's \"Ask about this\" button (ChatGPT's \"Anschlussfrage stellen\"):\n * puts the entity into the chat input as an `EntityMention` chip and sends NOTHING — the owner writes the question,\n * the chip rides in that message as a fence, and the backend reads which entity the question is about. Not a\n * next-step CTA: it posts no prompt. A second click on the same entity changes nothing; the\n * label turns into \"Added to your message\". Mounted by the `entityDetail` canvas (the shell or a domain body) with\n * the entity the panel shows; renders nothing in the e-mail capture or for a target that names no entity.\n */\nexport const EntityMentionAskButton = (props: EntityMentionAskButtonProps) => {\n const { entityType, entityId, label, agentSpaceKey, testId = \"entity-mention-ask\" } = props;\n const isEmailRender = useIsEmailWidgetRender();\n const { isMentioned, mentionEntity } = useEntityMentionComposer();\n const target = { entityType, entityId, label, agentSpaceKey };\n if (isEmailRender) return null;\n const isAlreadyMentioned = isMentioned(target);\n return (\n <ConversationWidgetButton\n variant=\"primary\"\n size=\"medium\"\n icon={isAlreadyMentioned ? \"check\" : \"message\"}\n disabled={isAlreadyMentioned}\n onClick={() => mentionEntity(target)}\n testId={testId}\n >\n {isAlreadyMentioned ? \"Added to your message\" : \"Ask about this\"}\n </ConversationWidgetButton>\n );\n};\n","import type React from \"react\";\nimport { createContext, useContext } from \"react\";\n\n/**\n * The bodies of the `entityDetail` canvas, one per entity type: every `*.entity-detail-body.tsx` below\n * `widgets/` that exports `entityDetailBody` registers itself by folder glob — an entity type is added with\n * the backend `<Type>EntityReferenceResolver` and this one file, and edits no list. A second body for one entity type\n * is a build error (thrown at module load).\n */\n\nexport interface EntityDetailBodyProps {\n entityType: string;\n /** The id as the backend resolved it (a row id or an external id). */\n entityId: string;\n /** The key of the agent space the chat is scoped to, for a body whose read endpoint is agent-space-scoped. */\n agentSpaceKey?: number;\n}\n\nexport interface EntityDetailBodyDefinition {\n /** The backend resolver's `ENTITY_TYPE`. */\n entityType: string;\n /** Self-hydrates the entity by id through its own read endpoint (the endpoint's entity rights apply). */\n component: React.ComponentType<EntityDetailBodyProps>;\n}\n\nconst bodyModules = import.meta.glob<{ entityDetailBody?: EntityDetailBodyDefinition }>(\n [\"../../widgets/**/*.entity-detail-body.tsx\", \"../**/*.entity-detail-body.tsx\"],\n { eager: true },\n);\n\nexport const buildEntityDetailBodyRegistry = (\n definitions: EntityDetailBodyDefinition[],\n): Readonly<Record<string, EntityDetailBodyDefinition>> => {\n const registry: Record<string, EntityDetailBodyDefinition> = {};\n for (const definition of definitions) {\n if (Object.prototype.hasOwnProperty.call(registry, definition.entityType)) {\n throw new Error(`Two entity detail bodies register the entity type \"${definition.entityType}\".`);\n }\n registry[definition.entityType] = definition;\n }\n return registry;\n};\n\n/** The body definitions a set of `*.entity-detail-body.tsx` modules export (the package's or an app's glob). */\nexport const readEntityDetailBodyDefinitions = (\n modules: Record<string, { entityDetailBody?: EntityDetailBodyDefinition }>,\n): EntityDetailBodyDefinition[] =>\n Object.values(modules)\n .map((bodyModule) => bodyModule.entityDetailBody)\n .filter((definition): definition is EntityDetailBodyDefinition => definition !== undefined);\n\n/** Entity type → body: the package's folder, then what an app registers (`registerEntityDetailBodies`). */\nexport const entityDetailBodies: Record<string, EntityDetailBodyDefinition> = {\n ...buildEntityDetailBodyRegistry(readEntityDetailBodyDefinitions(bodyModules)),\n};\n\n/** Adds an app's entity detail bodies. Runs outside React, before the first render; an entity type registers once. */\nexport const registerEntityDetailBodies = (definitions: readonly EntityDetailBodyDefinition[]): void => {\n Object.assign(\n entityDetailBodies,\n buildEntityDetailBodyRegistry([...Object.values(entityDetailBodies), ...definitions]),\n );\n};\n\n/** The body registered for one entity type (the package's or an app's), or undefined when none is. */\nexport const getEntityDetailBody = (entityType: string): EntityDetailBodyDefinition | undefined =>\n Object.prototype.hasOwnProperty.call(entityDetailBodies, entityType) ? entityDetailBodies[entityType] : undefined;\n\n/** The registry the canvas body uses — the folder's by default; a spec or a story may provide stubs. */\nexport const EntityDetailBodiesContext =\n createContext<Readonly<Record<string, EntityDetailBodyDefinition>>>(entityDetailBodies);\n\nexport const useEntityDetailBodies = () => useContext(EntityDetailBodiesContext);\n","import { Text } from \"../../provider/components\";\nimport { useCallback, useState } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { readEntityDetailInstanceId } from \"../../renderer/canvas/entity-detail-instance\";\nimport { EntityMentionAskButton } from \"../../widgets/EntityMentionConversationWidget/EntityMentionAskButton/EntityMentionAskButton\";\nimport { useEntityDetailBodies } from \"./entity-detail-bodies\";\nimport { EntityDetailNameReportContext } from \"./entity-detail-name\";\nimport styles from \"./EntityDetailCanvasBody.module.scss\";\n\n/**\n * The `entityDetail` CANVAS BODY (`canvasBodies.tsx`): the shell around one entity's detail. It reads\n * WHICH entity from the canvas instance id (`entityDetail:<entityType>:<id>`) and mounts the body registered for that\n * entity type; the body self-hydrates by id. An entity type without a body renders a short notice instead of nothing,\n * so a click never lands on an empty pane. \"Ask about this\" stays at the pane's foot while the detail scrolls and\n * names the entity in its chip once the body reported the name (`useReportEntityDetailName`).\n */\nexport const EntityDetailCanvasBody = ({ canvas, agentSpaceKey }: CanvasBodyProps) => {\n const bodies = useEntityDetailBodies();\n const [reportedEntity, setReportedEntity] = useState<{ instanceId: string; name: string | undefined }>();\n const reportEntityName = useCallback(\n (entityName: string | undefined) => setReportedEntity({ instanceId: canvas.instanceId, name: entityName }),\n [canvas.instanceId],\n );\n const target = readEntityDetailInstanceId(canvas.instanceId);\n if (target === undefined) return null;\n const definition = Object.prototype.hasOwnProperty.call(bodies, target.entityType)\n ? bodies[target.entityType]\n : undefined;\n if (!definition) {\n return (\n <div className={styles.entityDetail} data-testid=\"entity-detail-canvas\">\n <Text role=\"help\" color=\"var(--agents-fg-light)\" testId=\"entity-detail-canvas-unsupported\">\n {\"This detail cannot be shown here yet.\"}\n </Text>\n </div>\n );\n }\n const Body = definition.component;\n // A name reported for the previous entity never labels the next one's chip.\n const entityName = reportedEntity?.instanceId === canvas.instanceId ? reportedEntity.name : undefined;\n return (\n <div className={styles.entityDetail} data-testid=\"entity-detail-canvas\">\n <EntityDetailNameReportContext.Provider value={reportEntityName}>\n <Body entityType={target.entityType} entityId={target.entityId} agentSpaceKey={agentSpaceKey} />\n </EntityDetailNameReportContext.Provider>\n <div className={styles.entityDetailFooter}>\n <EntityMentionAskButton\n entityType={target.entityType}\n entityId={target.entityId}\n label={entityName}\n agentSpaceKey={agentSpaceKey}\n />\n </div>\n </div>\n );\n};\n","import { Text } from \"../../provider/components\";\nimport { useCallback, useMemo } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { useConversationWidgetContext } from \"../../renderer/ConversationWidgetCallbacksContext\";\nimport {\n canvasInstanceIdForEntityDetail,\n readOpenEntityActionTarget,\n} from \"../../renderer/canvas/entity-detail-instance\";\nimport type {\n ComposedViewAction,\n ComposedViewTree,\n} from \"../../renderer/widget-tree/composed-view-tree\";\nimport type { ExpressionValue } from \"../../renderer/widget-tree/expression/evaluate-expression\";\nimport { ComposedViewRenderer } from \"../ComposedViewRenderer\";\nimport { findMapNodeInMarkdown, readMapNodeKeyOfInstanceId } from \"../components/map/map-full-screen-instance\";\nimport { MapPresentationContext } from \"../components/map/map-presentation-context\";\nimport mapStyles from \"../components/map/Map.module.scss\";\nimport { useAgentsEnvironment } from \"../../provider/AgentsProvider\";\n\n/** The body reports nothing of its own: the inline block already reported this map to the model. */\nconst ignoreRenderReport = () => {};\n\n/**\n * The `mapFullScreen` CANVAS BODY (`canvasBodies.tsx`): one `Map` node of the anchor\n * message, full screen — the map filling the pane beside the list of its points. It finds the node through the\n * message's `ComposedView` fences and the node key its instance id carries (`map-full-screen-instance.ts`), then\n * renders it through the same `ComposedViewRenderer` with the node's own tree, so its bindings (`$data`, `$from`,\n * `$source`, `$computed`, `$state` at its initial value) and its actions resolve exactly as inline; the\n * `MapPresentationContext` switches the node to its full-screen layout. A point's `openEntity` action opens the\n * `entityDetail` canvas on the same anchor message (it replaces this canvas, as a click on an inline point would).\n */\nexport const MapFullScreenCanvasBody = (props: CanvasBodyProps) => {\n const { canvas, anchorMessageMarkdown, agentSpaceKey } = props;\n const { openCanvas } = useConversationWidgetContext();\n const { onOpenEntity: openEntityOnHostRoute } = useAgentsEnvironment();\n const mapNodeKey = readMapNodeKeyOfInstanceId(canvas.instanceId);\n\n const mapTree = useMemo<ComposedViewTree | undefined>(() => {\n if (anchorMessageMarkdown === null || mapNodeKey === undefined) return undefined;\n const mapNodeInComposedView = findMapNodeInMarkdown(anchorMessageMarkdown, mapNodeKey);\n if (!mapNodeInComposedView) return undefined;\n // The map alone, with its tree's state, data, computed values and actions; the tree's findings were the inline\n // block's to report.\n return { ...mapNodeInComposedView.tree, title: null, view: mapNodeInComposedView.mapNode, findings: [] };\n }, [anchorMessageMarkdown, mapNodeKey]);\n\n const anchor = canvas.anchor;\n const onOpenEntity = useCallback(\n (action: ComposedViewAction, currentRow?: ExpressionValue) => {\n const target = readOpenEntityActionTarget(action, currentRow);\n if (target === undefined) return;\n // The host opens the entity on a route of its own (`AgentsEnvironment.onOpenEntity`) instead of the canvas.\n if (openEntityOnHostRoute?.(target) === true) return;\n if (anchor.kind !== \"message\") return;\n openCanvas({\n canvasId: \"entityDetail\",\n instanceId: canvasInstanceIdForEntityDetail(target),\n anchor,\n origin: \"widgetClick\",\n justDelivered: false,\n });\n },\n [openCanvas, anchor, openEntityOnHostRoute],\n );\n\n if (!mapTree) {\n return (\n <div\n className={mapStyles.fullScreenNotice}\n data-canvas-instance={canvas.instanceId}\n data-testid=\"map-full-screen-canvas-unavailable\"\n >\n <Text role=\"help\" color=\"var(--agents-fg-light)\">\n {\"This map is no longer available.\"}\n </Text>\n </div>\n );\n }\n return (\n <div\n className={mapStyles.fullScreenBody}\n data-canvas-instance={canvas.instanceId}\n data-testid=\"map-full-screen-canvas\"\n >\n <MapPresentationContext.Provider value=\"fullScreen\">\n <ComposedViewRenderer\n tree={mapTree}\n interactive\n isEmailRender={false}\n messageId={anchor.kind === \"message\" ? anchor.messageId : undefined}\n agentSpaceKey={agentSpaceKey}\n onReport={ignoreRenderReport}\n onOpenEntity={onOpenEntity}\n testId=\"map-full-screen-canvas-view\"\n />\n </MapPresentationContext.Provider>\n </div>\n );\n};\n","import type React from \"react\";\nimport type { CanvasId } from \"./canvas-behaviours\";\nimport type { CanvasBodyProps } from \"./canvas-body-props\";\nimport { ConversationSearchResultsCanvasBody } from \"../../widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvasBody\";\nimport { WebSearchResultsCanvasBody } from \"../../widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvasBody\";\nimport { EntityDetailCanvasBody } from \"../../kit/entity-detail/EntityDetailCanvasBody\";\nimport { MapFullScreenCanvasBody } from \"../../kit/map-full-screen/MapFullScreenCanvasBody\";\n\nexport type { CanvasBodyProps } from \"./canvas-body-props\";\nexport { canvasFeatureFlagOf } from \"./canvas-feature-flags\";\n\n/**\n * THE CANVAS BODIES — canvas id → the React component the shell mounts in the canvas pane. The one module that knows\n * both the canvas ids and React components, and it is imported ONLY by `CanvasPane` (the shell), never by\n * the slice, the behaviours or a widget — that is the import layering that keeps the store-init temporal-dead-zone\n * cycle away. The bodies themselves are small: a body that hosts a heavy page (an app's list page or editor)\n * lazy-loads that page, exactly as its widget did. Every canvas has a body; nothing\n * else hands the pane a rendered node.\n *\n * The package's own bodies are listed here; an app adds the bodies of its canvases with `registerCanvasBodies` before\n * the first render. The object is filled in place, so the shell reads every registration.\n */\nexport const canvasBodies = {\n conversationSearchResults: ConversationSearchResultsCanvasBody,\n webSearchResults: WebSearchResultsCanvasBody,\n entityDetail: EntityDetailCanvasBody,\n mapFullScreen: MapFullScreenCanvasBody,\n} as Record<CanvasId, React.ComponentType<CanvasBodyProps>>;\n\n/** Adds an app's canvas bodies (canvas id → body). Runs outside React, before the first render. */\nexport const registerCanvasBodies = (\n bodies: Readonly<Partial<Record<CanvasId, React.ComponentType<CanvasBodyProps>>>>,\n): void => {\n Object.assign(canvasBodies, bodies);\n};\n"],"names":["canvasStyle","scrollStyle","contentStyle","entityName"],"mappings":";;;;;;;AAWO,MAAM,yBAAyB,CACpC,QACA,uBACA,eAEA,QAAQ,MAAM;AACZ,MAAI,OAAO,OAAO,SAAS,aAAa,0BAA0B,KAAM,QAAO;AAC/E,QAAM,cAAc,wBAAwB,OAAO,UAAU;AAC7D,MAAI,gBAAgB,QAAW;AAC7B,WAAO,6BAA6B,uBAAuB,YAAY,WAAW,GAAG;AAAA,EACvF;AACA,SAAO,2BAA2B,qBAAqB,EAAE,KAAK,CAAC,UAAU,MAAM,SAAS,UAAU,GAAG;AACvG,GAAG,CAAC,OAAO,QAAQ,OAAO,YAAY,uBAAuB,UAAU,CAAC;ACR1E,MAAMA,gBAAmC;AAAA,EACvC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SA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AAAA,IAAA;AAAA,EAAA;AAGN;AC5EO,MAAM,eAAe;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,eAAe;AACjB;AAGO,MAAM,uBAAuB,CAClC,WACS;AACT,SAAO,OAAO,cAAc,MAAM;AACpC;"}
|
|
1
|
+
{"version":3,"file":"canvasBodies-C7qqThc9.js","sources":["../../src/renderer/canvas/use-anchor-widget-payload.ts","../../src/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvas.tsx","../../src/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvasBody.tsx","../../src/widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvas.tsx","../../src/widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvasBody.tsx","../../src/widgets/EntityMentionConversationWidget/shared/use-entity-mention-composer.ts","../../src/widgets/EntityMentionConversationWidget/EntityMentionAskButton/EntityMentionAskButton.tsx","../../src/kit/entity-detail/entity-detail-bodies.ts","../../src/kit/entity-detail/EntityDetailCanvasBody.tsx","../../src/kit/map-full-screen/MapFullScreenCanvasBody.tsx","../../src/renderer/canvas/canvasBodies.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { CanvasState } from \"./canvas-state\";\nimport { payloadHashOfInstanceId } from \"./canvas-state\";\nimport { findWidgetFenceByPayloadHash, findWidgetFencesInMarkdown } from \"./find-widget-fences-in-markdown\";\n\n/**\n * The payload string of the widget a message-anchored canvas was opened from: the fence of `widgetName` in the anchor\n * message whose payload hash the canvas instance id carries (`canvasInstanceIdForMessagePayload`); when the instance\n * id carries no hash (one canvas per message), the first fence of that name. Undefined for a page anchor, a missing\n * anchor message, or a message that no longer carries the fence — the body then renders nothing.\n */\nexport const useAnchorWidgetPayload = (\n canvas: CanvasState,\n anchorMessageMarkdown: string | null,\n widgetName: string,\n): string | undefined =>\n useMemo(() => {\n if (canvas.anchor.kind !== \"message\" || anchorMessageMarkdown === null) return undefined;\n const payloadHash = payloadHashOfInstanceId(canvas.instanceId);\n if (payloadHash !== undefined) {\n return findWidgetFenceByPayloadHash(anchorMessageMarkdown, widgetName, payloadHash)?.payload;\n }\n return findWidgetFencesInMarkdown(anchorMessageMarkdown).find((fence) => fence.name === widgetName)?.payload;\n }, [canvas.anchor, canvas.instanceId, anchorMessageMarkdown, widgetName]);\n","import { ConversationSearchResultsList, Text } from \"../../provider/components\";\nimport React from \"react\";\nimport { parseConversationSearchResultsPayload } from \"./shared/conversation-search-results-widget-payload\";\n\ntype ConversationSearchResultsCanvasProps = {\n query: string;\n groups: ReturnType<typeof parseConversationSearchResultsPayload>[\"groups\"];\n onOpenConversation: (conversationId: number, messageId?: number) => void;\n};\n\n// Canvas body styles — the same as every list canvas body, so the full-screen panel behaves the same:\n// a full-height flex column whose inner area SCROLLS (scrollStyle: flex 1 + overflowY auto — without it the content\n// overflows the panel with no scrollbar), plus a horizontal inset (contentStyle) because the results list is built\n// for the narrow inline chat column where the bubble provides the gutter — in the canvas there is no bubble, so it would\n// otherwise render edge-to-edge.\nconst canvasStyle: React.CSSProperties = {\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: 0,\n background: \"var(--agents-bg)\",\n};\nconst scrollStyle: React.CSSProperties = {\n flex: 1,\n minHeight: 0,\n overflowY: \"auto\",\n};\nconst contentStyle: React.CSSProperties = {\n padding: \"16px 24px 24px\",\n};\n\n/** The canvas body — a titled wrapper around the same grouped results, scrollable + inset like the other canvas widgets. */\nexport const ConversationSearchResultsCanvas = (props: ConversationSearchResultsCanvasProps) => (\n <div style={canvasStyle} data-testid=\"conversation-search-results-widget-canvas\">\n <div style={scrollStyle}>\n <div style={contentStyle} data-testid=\"conversation-search-results-widget-canvas-results\">\n <Text\n role=\"title\"\n replacements={{ query: props.query }}\n testId=\"conversation-search-results-widget-canvas-title\"\n >\n {'Search results for \"%query%\"'}\n </Text>\n <ConversationSearchResultsList groups={props.groups} query={props.query} onOpenConversation={props.onOpenConversation} />\n </div>\n </div>\n </div>\n);\n","import React, { useMemo } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { useConversationWidgetContext } from \"../../renderer/ConversationWidgetCallbacksContext\";\nimport { useAnchorWidgetPayload } from \"../../renderer/canvas/use-anchor-widget-payload\";\nimport { parseConversationSearchResultsPayload } from \"./shared/conversation-search-results-widget-payload\";\nimport { ConversationSearchResultsCanvas } from \"./ConversationSearchResultsCanvas\";\n\n/**\n * The `conversationSearchResults` CANVAS BODY (`canvasBodies.tsx`): re-reads the `ConversationSearchResults` fence of\n * the anchor message — the same payload the inline widget rendered from — and shows the grouped results. Nothing was\n * stored for it but the pointer. Renders nothing when the anchor message no longer carries the fence.\n */\nexport const ConversationSearchResultsCanvasBody = ({ canvas, anchorMessageMarkdown }: CanvasBodyProps) => {\n const { onOpenConversation } = useConversationWidgetContext();\n const payload = useAnchorWidgetPayload(canvas, anchorMessageMarkdown, \"ConversationSearchResults\");\n const parsed = useMemo(\n () => (payload === undefined ? null : parseConversationSearchResultsPayload(payload)),\n [payload],\n );\n if (parsed === null || parsed.groups.length === 0) return null;\n return (\n <ConversationSearchResultsCanvas\n query={parsed.query}\n groups={parsed.groups}\n onOpenConversation={(conversationId, messageId) => onOpenConversation?.(conversationId, messageId)}\n />\n );\n};\n","import { Text } from \"../../provider/components\";\nimport React from \"react\";\nimport { WebSearchResultSource } from \"./shared/web-search-results-widget-payload\";\nimport { WebSearchAnswer } from \"./WebSearchAnswer\";\nimport { WebSearchSourcesList } from \"./WebSearchSourcesList\";\n\ntype WebSearchResultsCanvasProps = {\n query: string;\n answer: string;\n sources: WebSearchResultSource[];\n provider?: string;\n};\n\n// Canvas body styles — mirror the ConversationSearchResults / listReviews drawer widgets: a full-height flex column\n// whose inner area SCROLLS (flex 1 + overflowY auto) with a horizontal inset (there is no chat bubble gutter in the canvas).\nconst canvasStyle: React.CSSProperties = {\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n minHeight: 0,\n background: \"var(--agents-bg)\",\n};\nconst scrollStyle: React.CSSProperties = { flex: 1, minHeight: 0, overflowY: \"auto\" };\nconst contentStyle: React.CSSProperties = { padding: \"16px 24px 24px\" };\n\n/** The canvas body — the full answer + sources, scrollable + inset like the other canvas widgets. */\nexport const WebSearchResultsCanvas = (props: WebSearchResultsCanvasProps) => (\n <div style={canvasStyle} data-testid=\"web-search-results-widget-canvas\">\n <div style={scrollStyle}>\n <div style={contentStyle}>\n {props.query ? (\n <Text\n role=\"title\"\n replacements={{ query: props.query }}\n testId=\"web-search-results-widget-canvas-title\"\n >\n {'\"%query%\"'}\n </Text>\n ) : (\n <Text role=\"title\" testId=\"web-search-results-widget-canvas-title\">\n Web search\n </Text>\n )}\n <div style={{ marginTop: 12 }}>\n <WebSearchAnswer answer={props.answer} />\n </div>\n <WebSearchSourcesList\n sources={props.sources}\n provider={props.provider}\n testId=\"web-search-results-widget-canvas\"\n />\n </div>\n </div>\n </div>\n);\n","import React, { useMemo } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { useAnchorWidgetPayload } from \"../../renderer/canvas/use-anchor-widget-payload\";\nimport { parseWebSearchResultsPayload } from \"./shared/web-search-results-widget-payload\";\nimport { WebSearchResultsCanvas } from \"./WebSearchResultsCanvas\";\n\n/**\n * The `webSearchResults` CANVAS BODY (`canvasBodies.tsx`): re-reads the `WebSearchResults` fence of the anchor message\n * — the answer and its cited sources the inline widget rendered from — and shows them in the canvas. Renders nothing\n * when the anchor message no longer carries the fence.\n */\nexport const WebSearchResultsCanvasBody = ({ canvas, anchorMessageMarkdown }: CanvasBodyProps) => {\n const payload = useAnchorWidgetPayload(canvas, anchorMessageMarkdown, \"WebSearchResults\");\n const parsed = useMemo(() => (payload === undefined ? null : parseWebSearchResultsPayload(payload)), [payload]);\n if (parsed === null || (parsed.answer.trim() === \"\" && parsed.sources.length === 0)) return null;\n return (\n <WebSearchResultsCanvas\n query={parsed.query}\n answer={parsed.answer}\n sources={parsed.sources}\n provider={parsed.provider}\n />\n );\n};\n","import { useCallback } from \"react\";\nimport { useConversationWidgetContext } from \"../../../renderer/ConversationWidgetCallbacksContext\";\nimport {\n buildEntityMentionFields,\n ENTITY_MENTION_WIDGET_NAME,\n entityMentionKey,\n EntityMentionTarget,\n MAX_ENTITY_MENTIONS_PER_MESSAGE,\n normalizeEntityMentionFields,\n toEntityMentionWireFields,\n} from \"./entity-mention\";\n\nexport interface UseEntityMentionComposerResult {\n /** Whether this entity is already mentioned in the composer. */\n isMentioned: (target: EntityMentionTarget) => boolean;\n /**\n * Puts the entity into the composer as an `EntityMention` chip — once per entity (a second click is a no-op); past\n * {@link MAX_ENTITY_MENTIONS_PER_MESSAGE} the new entity takes the place of the oldest mention (one write: a remove\n * and an add in one event would both read the list before either). Sends nothing: the owner writes the question.\n * Returns false for a target that names no entity.\n */\n mentionEntity: (target: EntityMentionTarget) => boolean;\n}\n\n/**\n * The opener side of the `EntityMention` composer widget: what the detail panel's \"Ask about this\"\n * button calls. Reads and writes the composer widgets of the chat's widget context; the composer strip renders them.\n */\nexport const useEntityMentionComposer = (): UseEntityMentionComposerResult => {\n const { composerWidgets, addComposerWidget, replaceComposerWidgetFields } = useConversationWidgetContext();\n\n const findMentionWidgets = useCallback(\n () => composerWidgets.filter((composerWidget) => composerWidget.widgetName === ENTITY_MENTION_WIDGET_NAME),\n [composerWidgets],\n );\n\n const isMentioned = useCallback(\n (target: EntityMentionTarget) => {\n const mention = buildEntityMentionFields(target);\n if (mention === null) return false;\n return findMentionWidgets().some((composerWidget) => {\n const heldMention = normalizeEntityMentionFields(composerWidget.fields);\n return heldMention !== null && entityMentionKey(heldMention) === entityMentionKey(mention);\n });\n },\n [findMentionWidgets],\n );\n\n const mentionEntity = useCallback(\n (target: EntityMentionTarget) => {\n const mention = buildEntityMentionFields(target);\n if (mention === null) return false;\n if (isMentioned(target)) return true;\n const mentionWidgets = findMentionWidgets();\n if (mentionWidgets.length >= MAX_ENTITY_MENTIONS_PER_MESSAGE) {\n replaceComposerWidgetFields(mentionWidgets[0].composerWidgetId, toEntityMentionWireFields(mention));\n } else {\n addComposerWidget(ENTITY_MENTION_WIDGET_NAME, toEntityMentionWireFields(mention));\n }\n return true;\n },\n [isMentioned, findMentionWidgets, replaceComposerWidgetFields, addComposerWidget],\n );\n\n return { isMentioned, mentionEntity };\n};\n","import { useIsEmailWidgetRender } from \"../../../renderer/ConversationWidgetRenderContext\";\nimport { ConversationWidgetButton } from \"../../_shared/ConversationWidgetButton\";\nimport type { EntityMentionTarget } from \"../shared/entity-mention\";\nimport { useEntityMentionComposer } from \"../shared/use-entity-mention-composer\";\n\nexport interface EntityMentionAskButtonProps extends EntityMentionTarget {\n testId?: string;\n}\n\n/**\n * The detail panel's \"Ask about this\" button (ChatGPT's \"Anschlussfrage stellen\"):\n * puts the entity into the chat input as an `EntityMention` chip and sends NOTHING — the owner writes the question,\n * the chip rides in that message as a fence, and the backend reads which entity the question is about. Not a\n * next-step CTA: it posts no prompt. A second click on the same entity changes nothing; the\n * label turns into \"Added to your message\". Mounted by the `entityDetail` canvas (the shell or a domain body) with\n * the entity the panel shows; renders nothing in the e-mail capture or for a target that names no entity.\n */\nexport const EntityMentionAskButton = (props: EntityMentionAskButtonProps) => {\n const { entityType, entityId, label, agentSpaceKey, testId = \"entity-mention-ask\" } = props;\n const isEmailRender = useIsEmailWidgetRender();\n const { isMentioned, mentionEntity } = useEntityMentionComposer();\n const target = { entityType, entityId, label, agentSpaceKey };\n if (isEmailRender) return null;\n const isAlreadyMentioned = isMentioned(target);\n return (\n <ConversationWidgetButton\n variant=\"primary\"\n size=\"medium\"\n icon={isAlreadyMentioned ? \"check\" : \"message\"}\n disabled={isAlreadyMentioned}\n onClick={() => mentionEntity(target)}\n testId={testId}\n >\n {isAlreadyMentioned ? \"Added to your message\" : \"Ask about this\"}\n </ConversationWidgetButton>\n );\n};\n","import type React from \"react\";\nimport { createContext, useContext } from \"react\";\n\n/**\n * The bodies of the `entityDetail` canvas, one per entity type: every `*.entity-detail-body.tsx` below\n * `widgets/` that exports `entityDetailBody` registers itself by folder glob — an entity type is added with\n * the backend `<Type>EntityReferenceResolver` and this one file, and edits no list. A second body for one entity type\n * is a build error (thrown at module load).\n */\n\nexport interface EntityDetailBodyProps {\n entityType: string;\n /** The id as the backend resolved it (a row id or an external id). */\n entityId: string;\n /** The key of the agent space the chat is scoped to, for a body whose read endpoint is agent-space-scoped. */\n agentSpaceKey?: number;\n}\n\nexport interface EntityDetailBodyDefinition {\n /** The backend resolver's `ENTITY_TYPE`. */\n entityType: string;\n /** Self-hydrates the entity by id through its own read endpoint (the endpoint's entity rights apply). */\n component: React.ComponentType<EntityDetailBodyProps>;\n}\n\nconst bodyModules = import.meta.glob<{ entityDetailBody?: EntityDetailBodyDefinition }>(\n [\"../../widgets/**/*.entity-detail-body.tsx\", \"../**/*.entity-detail-body.tsx\"],\n { eager: true },\n);\n\nexport const buildEntityDetailBodyRegistry = (\n definitions: EntityDetailBodyDefinition[],\n): Readonly<Record<string, EntityDetailBodyDefinition>> => {\n const registry: Record<string, EntityDetailBodyDefinition> = {};\n for (const definition of definitions) {\n if (Object.prototype.hasOwnProperty.call(registry, definition.entityType)) {\n throw new Error(`Two entity detail bodies register the entity type \"${definition.entityType}\".`);\n }\n registry[definition.entityType] = definition;\n }\n return registry;\n};\n\n/** The body definitions a set of `*.entity-detail-body.tsx` modules export (the package's or an app's glob). */\nexport const readEntityDetailBodyDefinitions = (\n modules: Record<string, { entityDetailBody?: EntityDetailBodyDefinition }>,\n): EntityDetailBodyDefinition[] =>\n Object.values(modules)\n .map((bodyModule) => bodyModule.entityDetailBody)\n .filter((definition): definition is EntityDetailBodyDefinition => definition !== undefined);\n\n/** Entity type → body: the package's folder, then what an app registers (`registerEntityDetailBodies`). */\nexport const entityDetailBodies: Record<string, EntityDetailBodyDefinition> = {\n ...buildEntityDetailBodyRegistry(readEntityDetailBodyDefinitions(bodyModules)),\n};\n\n/** Adds an app's entity detail bodies. Runs outside React, before the first render; an entity type registers once. */\nexport const registerEntityDetailBodies = (definitions: readonly EntityDetailBodyDefinition[]): void => {\n Object.assign(\n entityDetailBodies,\n buildEntityDetailBodyRegistry([...Object.values(entityDetailBodies), ...definitions]),\n );\n};\n\n/** The body registered for one entity type (the package's or an app's), or undefined when none is. */\nexport const getEntityDetailBody = (entityType: string): EntityDetailBodyDefinition | undefined =>\n Object.prototype.hasOwnProperty.call(entityDetailBodies, entityType) ? entityDetailBodies[entityType] : undefined;\n\n/** The registry the canvas body uses — the folder's by default; a spec or a story may provide stubs. */\nexport const EntityDetailBodiesContext =\n createContext<Readonly<Record<string, EntityDetailBodyDefinition>>>(entityDetailBodies);\n\nexport const useEntityDetailBodies = () => useContext(EntityDetailBodiesContext);\n","import { Text } from \"../../provider/components\";\nimport { useCallback, useState } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { readEntityDetailInstanceId } from \"../../renderer/canvas/entity-detail-instance\";\nimport { EntityMentionAskButton } from \"../../widgets/EntityMentionConversationWidget/EntityMentionAskButton/EntityMentionAskButton\";\nimport { useEntityDetailBodies } from \"./entity-detail-bodies\";\nimport { EntityDetailNameReportContext } from \"./entity-detail-name\";\nimport styles from \"./EntityDetailCanvasBody.module.scss\";\n\n/**\n * The `entityDetail` CANVAS BODY (`canvasBodies.tsx`): the shell around one entity's detail. It reads\n * WHICH entity from the canvas instance id (`entityDetail:<entityType>:<id>`) and mounts the body registered for that\n * entity type; the body self-hydrates by id. An entity type without a body renders a short notice instead of nothing,\n * so a click never lands on an empty pane. \"Ask about this\" stays at the pane's foot while the detail scrolls and\n * names the entity in its chip once the body reported the name (`useReportEntityDetailName`).\n */\nexport const EntityDetailCanvasBody = ({ canvas, agentSpaceKey }: CanvasBodyProps) => {\n const bodies = useEntityDetailBodies();\n const [reportedEntity, setReportedEntity] = useState<{ instanceId: string; name: string | undefined }>();\n const reportEntityName = useCallback(\n (entityName: string | undefined) => setReportedEntity({ instanceId: canvas.instanceId, name: entityName }),\n [canvas.instanceId],\n );\n const target = readEntityDetailInstanceId(canvas.instanceId);\n if (target === undefined) return null;\n const definition = Object.prototype.hasOwnProperty.call(bodies, target.entityType)\n ? bodies[target.entityType]\n : undefined;\n if (!definition) {\n return (\n <div className={styles.entityDetail} data-testid=\"entity-detail-canvas\">\n <Text role=\"help\" color=\"var(--agents-fg-light)\" testId=\"entity-detail-canvas-unsupported\">\n {\"This detail cannot be shown here yet.\"}\n </Text>\n </div>\n );\n }\n const Body = definition.component;\n // A name reported for the previous entity never labels the next one's chip.\n const entityName = reportedEntity?.instanceId === canvas.instanceId ? reportedEntity.name : undefined;\n return (\n <div className={styles.entityDetail} data-testid=\"entity-detail-canvas\">\n <EntityDetailNameReportContext.Provider value={reportEntityName}>\n <Body entityType={target.entityType} entityId={target.entityId} agentSpaceKey={agentSpaceKey} />\n </EntityDetailNameReportContext.Provider>\n <div className={styles.entityDetailFooter}>\n <EntityMentionAskButton\n entityType={target.entityType}\n entityId={target.entityId}\n label={entityName}\n agentSpaceKey={agentSpaceKey}\n />\n </div>\n </div>\n );\n};\n","import { Text } from \"../../provider/components\";\nimport { useCallback, useMemo } from \"react\";\nimport type { CanvasBodyProps } from \"../../renderer/canvas/canvas-body-props\";\nimport { useConversationWidgetContext } from \"../../renderer/ConversationWidgetCallbacksContext\";\nimport {\n canvasInstanceIdForEntityDetail,\n readOpenEntityActionTarget,\n} from \"../../renderer/canvas/entity-detail-instance\";\nimport type {\n ComposedViewAction,\n ComposedViewTree,\n} from \"../../renderer/widget-tree/composed-view-tree\";\nimport type { ExpressionValue } from \"../../renderer/widget-tree/expression/evaluate-expression\";\nimport { ComposedViewRenderer } from \"../ComposedViewRenderer\";\nimport { findMapNodeInMarkdown, readMapNodeKeyOfInstanceId } from \"../components/map/map-full-screen-instance\";\nimport { MapPresentationContext } from \"../components/map/map-presentation-context\";\nimport mapStyles from \"../components/map/Map.module.scss\";\nimport { useAgentsEnvironment } from \"../../provider/AgentsProvider\";\n\n/** The body reports nothing of its own: the inline block already reported this map to the model. */\nconst ignoreRenderReport = () => {};\n\n/**\n * The `mapFullScreen` CANVAS BODY (`canvasBodies.tsx`): one `Map` node of the anchor\n * message, full screen — the map filling the pane beside the list of its points. It finds the node through the\n * message's `ComposedView` fences and the node key its instance id carries (`map-full-screen-instance.ts`), then\n * renders it through the same `ComposedViewRenderer` with the node's own tree, so its bindings (`$data`, `$from`,\n * `$source`, `$computed`, `$state` at its initial value) and its actions resolve exactly as inline; the\n * `MapPresentationContext` switches the node to its full-screen layout. A point's `openEntity` action opens the\n * `entityDetail` canvas on the same anchor message (it replaces this canvas, as a click on an inline point would).\n */\nexport const MapFullScreenCanvasBody = (props: CanvasBodyProps) => {\n const { canvas, anchorMessageMarkdown, agentSpaceKey } = props;\n const { openCanvas } = useConversationWidgetContext();\n const { onOpenEntity: openEntityOnHostRoute } = useAgentsEnvironment();\n const mapNodeKey = readMapNodeKeyOfInstanceId(canvas.instanceId);\n\n const mapTree = useMemo<ComposedViewTree | undefined>(() => {\n if (anchorMessageMarkdown === null || mapNodeKey === undefined) return undefined;\n const mapNodeInComposedView = findMapNodeInMarkdown(anchorMessageMarkdown, mapNodeKey);\n if (!mapNodeInComposedView) return undefined;\n // The map alone, with its tree's state, data, computed values and actions; the tree's findings were the inline\n // block's to report.\n return { ...mapNodeInComposedView.tree, title: null, view: mapNodeInComposedView.mapNode, findings: [] };\n }, [anchorMessageMarkdown, mapNodeKey]);\n\n const anchor = canvas.anchor;\n const onOpenEntity = useCallback(\n (action: ComposedViewAction, currentRow?: ExpressionValue) => {\n const target = readOpenEntityActionTarget(action, currentRow);\n if (target === undefined) return;\n // The host opens the entity on a route of its own (`AgentsEnvironment.onOpenEntity`) instead of the canvas.\n if (openEntityOnHostRoute?.(target) === true) return;\n if (anchor.kind !== \"message\") return;\n openCanvas({\n canvasId: \"entityDetail\",\n instanceId: canvasInstanceIdForEntityDetail(target),\n anchor,\n origin: \"widgetClick\",\n justDelivered: false,\n });\n },\n [openCanvas, anchor, openEntityOnHostRoute],\n );\n\n if (!mapTree) {\n return (\n <div\n className={mapStyles.fullScreenNotice}\n data-canvas-instance={canvas.instanceId}\n data-testid=\"map-full-screen-canvas-unavailable\"\n >\n <Text role=\"help\" color=\"var(--agents-fg-light)\">\n {\"This map is no longer available.\"}\n </Text>\n </div>\n );\n }\n return (\n <div\n className={mapStyles.fullScreenBody}\n data-canvas-instance={canvas.instanceId}\n data-testid=\"map-full-screen-canvas\"\n >\n <MapPresentationContext.Provider value=\"fullScreen\">\n <ComposedViewRenderer\n tree={mapTree}\n interactive\n isEmailRender={false}\n messageId={anchor.kind === \"message\" ? anchor.messageId : undefined}\n agentSpaceKey={agentSpaceKey}\n onReport={ignoreRenderReport}\n onOpenEntity={onOpenEntity}\n testId=\"map-full-screen-canvas-view\"\n />\n </MapPresentationContext.Provider>\n </div>\n );\n};\n","import type React from \"react\";\nimport type { CanvasId } from \"./canvas-behaviours\";\nimport type { CanvasBodyProps } from \"./canvas-body-props\";\nimport { ConversationSearchResultsCanvasBody } from \"../../widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvasBody\";\nimport { WebSearchResultsCanvasBody } from \"../../widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvasBody\";\nimport { EntityDetailCanvasBody } from \"../../kit/entity-detail/EntityDetailCanvasBody\";\nimport { MapFullScreenCanvasBody } from \"../../kit/map-full-screen/MapFullScreenCanvasBody\";\n\nexport type { CanvasBodyProps } from \"./canvas-body-props\";\nexport { canvasFeatureFlagOf } from \"./canvas-feature-flags\";\n\n/**\n * THE CANVAS BODIES — canvas id → the React component the shell mounts in the canvas pane. The one module that knows\n * both the canvas ids and React components, and it is imported ONLY by `CanvasPane` (the shell), never by\n * the slice, the behaviours or a widget — that is the import layering that keeps the store-init temporal-dead-zone\n * cycle away. The bodies themselves are small: a body that hosts a heavy page (an app's list page or editor)\n * lazy-loads that page, exactly as its widget did. Every canvas has a body; nothing\n * else hands the pane a rendered node.\n *\n * The package's own bodies are listed here; an app adds the bodies of its canvases with `registerCanvasBodies` before\n * the first render. The object is filled in place, so the shell reads every registration.\n */\nexport const canvasBodies = {\n conversationSearchResults: ConversationSearchResultsCanvasBody,\n webSearchResults: WebSearchResultsCanvasBody,\n entityDetail: EntityDetailCanvasBody,\n mapFullScreen: MapFullScreenCanvasBody,\n} as Record<CanvasId, React.ComponentType<CanvasBodyProps>>;\n\n/** Adds an app's canvas bodies (canvas id → body). Runs outside React, before the first render. */\nexport const registerCanvasBodies = (\n bodies: Readonly<Partial<Record<CanvasId, React.ComponentType<CanvasBodyProps>>>>,\n): void => {\n Object.assign(canvasBodies, bodies);\n};\n"],"names":["canvasStyle","scrollStyle","contentStyle","entityName"],"mappings":";;;;;;;AAWO,MAAM,yBAAyB,CACpC,QACA,uBACA,eAEA,QAAQ,MAAM;AACZ,MAAI,OAAO,OAAO,SAAS,aAAa,0BAA0B,KAAM,QAAO;AAC/E,QAAM,cAAc,wBAAwB,OAAO,UAAU;AAC7D,MAAI,gBAAgB,QAAW;AAC7B,WAAO,6BAA6B,uBAAuB,YAAY,WAAW,GAAG;AAAA,EACvF;AACA,SAAO,2BAA2B,qBAAqB,EAAE,KAAK,CAAC,UAAU,MAAM,SAAS,UAAU,GAAG;AACvG,GAAG,CAAC,OAAO,QAAQ,OAAO,YAAY,uBAAuB,UAAU,CAAC;ACR1E,MAAMA,gBAAmC;AAAA,EACvC,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,eAAe;AAAA,EACf,WAAW;AAAA,EACX,YAAY;AACd;AACA,MAAMC,gBAAmC;AAAA,EACvC,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW;AACb;AACA,MAAMC,iBAAoC;AAAA,EACxC,SAAS;AACX;AAGO,MAAM,kCAAkC,CAAC,8BAC7C,OAAA,EAAI,OAAOF,eAAa,eAAY,6CACnC,UAAA,oBAAC,OAAA,EAAI,OAAOC,e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ConversationWidget-
|
|
2
|
+
import { i as isCanvasId } from "./WebSearchResultsConversationWidget-887v8Wen.js";
|
|
3
3
|
const CANVAS_STORAGE_KEY_PREFIX = "agent.canvas.";
|
|
4
4
|
const canvasStorageKey = (conversationId) => `${CANVAS_STORAGE_KEY_PREFIX}${conversationId}`;
|
|
5
5
|
const isPositiveInteger = (value) => typeof value === "number" && Number.isInteger(value) && value > 0;
|
|
@@ -62,4 +62,4 @@ export {
|
|
|
62
62
|
readStoredCanvas as r,
|
|
63
63
|
storeOpenCanvas as s
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=canvasStorage-
|
|
65
|
+
//# sourceMappingURL=canvasStorage-i2wKVSBf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvasStorage-
|
|
1
|
+
{"version":3,"file":"canvasStorage-i2wKVSBf.js","sources":["../../src/renderer/canvas/canvasStorage.ts"],"sourcesContent":["import { isCanvasId } from \"./canvas-behaviours\";\nimport type { CanvasAnchor, CanvasState } from \"./canvas-state\";\n\n/**\n * Where the open canvas of a conversation is remembered across a reload: `sessionStorage`, per conversation, holding\n * the POINTER only — which canvas, which anchor, which instance, and the entity a body created. Never\n * content: the anchor message's fence supplies the body's data on restore. Tab-local by design (the canvas is viewing\n * state of this tab); a new tab starts with no canvas.\n *\n * Written on every change of the open canvas for ANY lifetime, cleared when the canvas closes; on read the pointer is\n * validated shape by shape — a stale id or a mangled entry reads as \"nothing stored\". Every accessor is try/catch-\n * guarded: a private window, blocked site data or a preview context can throw on the accessor itself.\n */\nexport interface StoredCanvasPointer {\n readonly canvasId: CanvasState[\"canvasId\"];\n readonly anchor: CanvasAnchor;\n readonly instanceId: string;\n readonly createdEntityId?: number;\n}\n\nconst CANVAS_STORAGE_KEY_PREFIX = \"agent.canvas.\";\n\nconst canvasStorageKey = (conversationId: number): string => `${CANVAS_STORAGE_KEY_PREFIX}${conversationId}`;\n\nconst isPositiveInteger = (value: unknown): value is number =>\n typeof value === \"number\" && Number.isInteger(value) && value > 0;\n\nconst parseAnchor = (value: unknown): CanvasAnchor | null => {\n if (typeof value !== \"object\" || value === null) return null;\n const candidate = value as { kind?: unknown; messageId?: unknown; agentSpaceKey?: unknown };\n if (candidate.kind === \"message\" && isPositiveInteger(candidate.messageId)) {\n return { kind: \"message\", messageId: candidate.messageId };\n }\n if (candidate.kind === \"page\" && isPositiveInteger(candidate.agentSpaceKey)) {\n return { kind: \"page\", agentSpaceKey: candidate.agentSpaceKey };\n }\n return null;\n};\n\n/** Validate an untrusted value into a pointer, or null. Exported for the spec and for the shell's restore path. */\nexport const parseStoredCanvasPointer = (value: unknown): StoredCanvasPointer | null => {\n if (typeof value !== \"object\" || value === null) return null;\n const candidate = value as { canvasId?: unknown; anchor?: unknown; instanceId?: unknown; createdEntityId?: unknown };\n const anchor = parseAnchor(candidate.anchor);\n if (!isCanvasId(candidate.canvasId) || anchor === null) return null;\n if (typeof candidate.instanceId !== \"string\" || candidate.instanceId.length === 0) return null;\n return {\n canvasId: candidate.canvasId,\n anchor,\n instanceId: candidate.instanceId,\n ...(isPositiveInteger(candidate.createdEntityId) ? { createdEntityId: candidate.createdEntityId } : {}),\n };\n};\n\n/** Remember the canvas open in this conversation. No-op without a conversation id (a cold chat has none yet). */\nexport const storeOpenCanvas = (conversationId: number | undefined, canvas: CanvasState): void => {\n if (conversationId === undefined) return;\n const pointer: StoredCanvasPointer = {\n canvasId: canvas.canvasId,\n anchor: canvas.anchor,\n instanceId: canvas.instanceId,\n ...(canvas.createdEntityId !== undefined ? { createdEntityId: canvas.createdEntityId } : {}),\n };\n try {\n window.sessionStorage.setItem(canvasStorageKey(conversationId), JSON.stringify(pointer));\n } catch {\n // Storage unavailable — the canvas then simply does not survive the reload.\n }\n};\n\n/** The canvas that was open in this conversation, validated, or null (nothing stored, stale, or storage unusable). */\nexport const readStoredCanvas = (conversationId: number | undefined): StoredCanvasPointer | null => {\n if (conversationId === undefined) return null;\n try {\n const raw = window.sessionStorage.getItem(canvasStorageKey(conversationId));\n if (raw === null) return null;\n return parseStoredCanvasPointer(JSON.parse(raw));\n } catch {\n return null;\n }\n};\n\n/** Forget the canvas of this conversation — it closed, or its anchor is no longer among the loaded messages. */\nexport const clearStoredCanvas = (conversationId: number | undefined): void => {\n if (conversationId === undefined) return;\n try {\n window.sessionStorage.removeItem(canvasStorageKey(conversationId));\n } catch {\n // Storage unavailable — nothing was stored either.\n }\n};\n"],"names":[],"mappings":";;AAoBA,MAAM,4BAA4B;AAElC,MAAM,mBAAmB,CAAC,mBAAmC,GAAG,yBAAyB,GAAG,cAAc;AAE1G,MAAM,oBAAoB,CAAC,UACzB,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,QAAQ;AAElE,MAAM,cAAc,CAAC,UAAwC;AAC3D,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,YAAY;AAClB,MAAI,UAAU,SAAS,aAAa,kBAAkB,UAAU,SAAS,GAAG;AAC1E,WAAO,EAAE,MAAM,WAAW,WAAW,UAAU,UAAA;AAAA,EACjD;AACA,MAAI,UAAU,SAAS,UAAU,kBAAkB,UAAU,aAAa,GAAG;AAC3E,WAAO,EAAE,MAAM,QAAQ,eAAe,UAAU,cAAA;AAAA,EAClD;AACA,SAAO;AACT;AAGO,MAAM,2BAA2B,CAAC,UAA+C;AACtF,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,YAAY;AAClB,QAAM,SAAS,YAAY,UAAU,MAAM;AAC3C,MAAI,CAAC,WAAW,UAAU,QAAQ,KAAK,WAAW,KAAM,QAAO;AAC/D,MAAI,OAAO,UAAU,eAAe,YAAY,UAAU,WAAW,WAAW,EAAG,QAAO;AAC1F,SAAO;AAAA,IACL,UAAU,UAAU;AAAA,IACpB;AAAA,IACA,YAAY,UAAU;AAAA,IACtB,GAAI,kBAAkB,UAAU,eAAe,IAAI,EAAE,iBAAiB,UAAU,oBAAoB,CAAA;AAAA,EAAC;AAEzG;AAGO,MAAM,kBAAkB,CAAC,gBAAoC,WAA8B;AAChG,MAAI,mBAAmB,OAAW;AAClC,QAAM,UAA+B;AAAA,IACnC,UAAU,OAAO;AAAA,IACjB,QAAQ,OAAO;AAAA,IACf,YAAY,OAAO;AAAA,IACnB,GAAI,OAAO,oBAAoB,SAAY,EAAE,iBAAiB,OAAO,oBAAoB,CAAA;AAAA,EAAC;AAE5F,MAAI;AACF,WAAO,eAAe,QAAQ,iBAAiB,cAAc,GAAG,KAAK,UAAU,OAAO,CAAC;AAAA,EACzF,QAAQ;AAAA,EAER;AACF;AAGO,MAAM,mBAAmB,CAAC,mBAAmE;AAClG,MAAI,mBAAmB,OAAW,QAAO;AACzC,MAAI;AACF,UAAM,MAAM,OAAO,eAAe,QAAQ,iBAAiB,cAAc,CAAC;AAC1E,QAAI,QAAQ,KAAM,QAAO;AACzB,WAAO,yBAAyB,KAAK,MAAM,GAAG,CAAC;AAAA,EACjD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,MAAM,oBAAoB,CAAC,mBAA6C;AAC7E,MAAI,mBAAmB,OAAW;AAClC,MAAI;AACF,WAAO,eAAe,WAAW,iBAAiB,cAAc,CAAC;AAAA,EACnE,QAAQ;AAAA,EAER;AACF;"}
|
|
@@ -417,6 +417,8 @@ const DefaultSplitView = (props) => {
|
|
|
417
417
|
const [splitViewWidth, observeSplitView] = useElementWidth();
|
|
418
418
|
const coversMain = coversBelowWidth !== void 0 && splitViewWidth !== null && splitViewWidth < coversBelowWidth;
|
|
419
419
|
const isMainCovered = isSideOpen && coversMain;
|
|
420
|
+
const floatsReopenOverMain = coversMain && !isSideOpen && !sideToggle?.mainPaneShowsReopen;
|
|
421
|
+
const togglesFloat = isMainCovered || floatsReopenOverMain;
|
|
420
422
|
const toggleLabel = useTranslatedText(isSideOpen ? "Close canvas" : "Re-open canvas");
|
|
421
423
|
const sidePaneRef = useRef(null);
|
|
422
424
|
const lastFocusedInMainRef = useRef(null);
|
|
@@ -435,12 +437,12 @@ const DefaultSplitView = (props) => {
|
|
|
435
437
|
"button",
|
|
436
438
|
{
|
|
437
439
|
type: "button",
|
|
438
|
-
className: classNames("agents-split-view__toggle",
|
|
440
|
+
className: classNames("agents-split-view__toggle", togglesFloat && "agents-split-view__toggle--floating"),
|
|
439
441
|
onClick: sideToggle.onToggle,
|
|
440
442
|
"aria-expanded": isSideOpen,
|
|
441
443
|
"aria-label": toggleLabel,
|
|
442
444
|
title: toggleLabel,
|
|
443
|
-
style:
|
|
445
|
+
style: togglesFloat ? { position: "absolute", top: 8, insetInlineEnd: 8, zIndex: 21 } : void 0,
|
|
444
446
|
children: /* @__PURE__ */ jsx(DefaultIcon, { name: isSideOpen ? "closeCanvas" : "maximize", size: "small" })
|
|
445
447
|
}
|
|
446
448
|
) : null;
|
|
@@ -497,7 +499,7 @@ const DefaultSplitView = (props) => {
|
|
|
497
499
|
children: side.content
|
|
498
500
|
}
|
|
499
501
|
) : null,
|
|
500
|
-
|
|
502
|
+
togglesFloat ? toggleButton : null
|
|
501
503
|
]
|
|
502
504
|
}
|
|
503
505
|
);
|
|
@@ -1225,4 +1227,4 @@ export {
|
|
|
1225
1227
|
appendAnotherAgentSpaceToOwnerText as y,
|
|
1226
1228
|
buildUnnamedAgentSpaceLabel as z
|
|
1227
1229
|
};
|
|
1228
|
-
//# sourceMappingURL=link-navigation-
|
|
1230
|
+
//# sourceMappingURL=link-navigation-CNX8Am2L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-navigation-CNX8Am2L.js","sources":["../../src/renderer/widget-hydration/widget-hydration.reducer.ts","../../src/renderer/widget-hydration/widget-hydration-state-store.ts","../../src/provider/components/markdown-image-source.ts","../../src/provider/class-names.ts","../../src/provider/components/default-components.tsx","../../src/provider/environment.ts","../../src/provider/AgentsProvider.tsx","../../src/provider/components/index.tsx","../../src/provider/link-navigation.tsx"],"sourcesContent":["import type { AgentsStateAction } from \"../../provider/environment\";\nimport { WidgetHydrationSliceState, WidgetMemory } from \"./widget-hydration.types\";\n\n/**\n * The widget hydration state: one memory per hydration key. A plain reducer under the key\n * `AIExtensionsWidgetHydration` of a state store: the app's own (`AgentsEnvironment.stateStore`, the host application mounts it in\n * its Redux store) or, without one, the package's default store (`widget-hydration-state-store.ts`).\n */\n\nconst SLICE_NAME = \"widgetHydrationSlice\";\n\nconst emptyMemory = (): WidgetMemory => {\n return {\n data: null,\n status: \"idle\",\n error: null,\n loadingInstanceId: null,\n inFlight: false,\n requestId: 0,\n lastLoadedAt: null,\n };\n};\n\nconst initialState: WidgetHydrationSliceState = {\n widgets: {},\n};\n\nconst readMemory = (state: WidgetHydrationSliceState, key: string): WidgetMemory => state.widgets[key] ?? emptyMemory();\n\nconst withMemory = (state: WidgetHydrationSliceState, key: string, memory: WidgetMemory): WidgetHydrationSliceState => ({\n ...state,\n widgets: { ...state.widgets, [key]: memory },\n});\n\n/** Does a result still belong to the request the memory tracks? (0 = the memory was reset since.) */\nconst isCurrentRequest = (memory: WidgetMemory, requestId: number): boolean =>\n memory.requestId === 0 || memory.requestId === requestId;\n\ninterface MemoryEnsuredPayload {\n key: string;\n}\ninterface InstanceAttachedPayload {\n key: string;\n instanceId: string;\n}\ninterface HydrationStartedPayload {\n key: string;\n instanceId: string;\n requestId: number;\n}\ninterface HydrationSucceededPayload {\n key: string;\n requestId: number;\n data: unknown;\n}\ninterface HydrationFailedPayload {\n key: string;\n requestId: number;\n error: string;\n}\ninterface WidgetResetPayload {\n key: string;\n}\n\nconst actionType = (name: string): string => `${SLICE_NAME}/${name}`;\n\n/** The action creators (the action types are the ones the former Redux Toolkit slice used). */\nexport const WidgetHydrationSlice = {\n memoryEnsured: (payload: MemoryEnsuredPayload): AgentsStateAction => ({ type: actionType(\"memoryEnsured\"), payload }),\n instanceAttached: (payload: InstanceAttachedPayload): AgentsStateAction => ({\n type: actionType(\"instanceAttached\"),\n payload,\n }),\n hydrationStarted: (payload: HydrationStartedPayload): AgentsStateAction => ({\n type: actionType(\"hydrationStarted\"),\n payload,\n }),\n hydrationSucceeded: (payload: HydrationSucceededPayload): AgentsStateAction => ({\n type: actionType(\"hydrationSucceeded\"),\n payload,\n }),\n hydrationFailed: (payload: HydrationFailedPayload): AgentsStateAction => ({\n type: actionType(\"hydrationFailed\"),\n payload,\n }),\n widgetReset: (payload: WidgetResetPayload): AgentsStateAction => ({ type: actionType(\"widgetReset\"), payload }),\n allWidgetsReset: (): AgentsStateAction => ({ type: actionType(\"allWidgetsReset\") }),\n};\n\nexport const WidgetHydrationReducer = (\n state: WidgetHydrationSliceState = initialState,\n action: AgentsStateAction,\n): WidgetHydrationSliceState => {\n switch (action.type) {\n case actionType(\"memoryEnsured\"): {\n const { key } = action.payload as MemoryEnsuredPayload;\n return state.widgets[key] ? state : withMemory(state, key, emptyMemory());\n }\n case actionType(\"instanceAttached\"): {\n const { key, instanceId } = action.payload as InstanceAttachedPayload;\n return withMemory(state, key, { ...readMemory(state, key), loadingInstanceId: instanceId });\n }\n case actionType(\"hydrationStarted\"): {\n const { key, instanceId, requestId } = action.payload as HydrationStartedPayload;\n return withMemory(state, key, {\n ...readMemory(state, key),\n status: \"loading\",\n error: null,\n inFlight: true,\n loadingInstanceId: instanceId,\n requestId,\n });\n }\n case actionType(\"hydrationSucceeded\"): {\n const { key, requestId, data } = action.payload as HydrationSucceededPayload;\n const memory = readMemory(state, key);\n if (!isCurrentRequest(memory, requestId)) return state.widgets[key] ? state : withMemory(state, key, memory);\n return withMemory(state, key, {\n ...memory,\n status: \"success\",\n error: null,\n inFlight: false,\n data,\n loadingInstanceId: null,\n requestId,\n lastLoadedAt: Date.now(),\n });\n }\n case actionType(\"hydrationFailed\"): {\n const { key, requestId, error } = action.payload as HydrationFailedPayload;\n const memory = readMemory(state, key);\n if (!isCurrentRequest(memory, requestId)) return state.widgets[key] ? state : withMemory(state, key, memory);\n return withMemory(state, key, {\n ...memory,\n status: \"error\",\n error,\n inFlight: false,\n loadingInstanceId: null,\n requestId,\n });\n }\n case actionType(\"widgetReset\"): {\n const { key } = action.payload as WidgetResetPayload;\n if (!(key in state.widgets)) return state;\n const { [key]: removedMemory, ...remainingWidgets } = state.widgets;\n return { ...state, widgets: remainingWidgets };\n }\n case actionType(\"allWidgetsReset\"):\n return { ...state, widgets: {} };\n default:\n return state;\n }\n};\n","import { useSyncExternalStore } from \"react\";\nimport type { AgentsStateAction, AgentsStateStore } from \"../../provider/environment\";\nimport { WidgetHydrationReducer } from \"./widget-hydration.reducer\";\nimport type { WidgetHydrationSliceState } from \"./widget-hydration.types\";\n\n/** The state of the package's default store: the widget hydration state under the key package code reads. */\nexport interface AgentsWidgetHydrationState {\n AIExtensionsWidgetHydration: WidgetHydrationSliceState;\n}\n\n/**\n * The package's own state store (widget hydration is one store per app): the widget hydration reducer\n * behind `useSyncExternalStore`, no Redux. Package code reads and dispatches through it whenever the app supplies no\n * `AgentsEnvironment.stateStore` (the host application supplies its Redux store, which mounts the same reducer). Actions the\n * reducer does not know (the app's \"a chat surface is open\" action) change nothing.\n */\nexport class AgentsWidgetHydrationStateContainer implements AgentsStateStore {\n protected state: AgentsWidgetHydrationState = {\n AIExtensionsWidgetHydration: WidgetHydrationReducer(undefined, { type: \"agents/widgetHydrationStoreCreated\" }),\n };\n protected readonly listeners = new Set<() => void>();\n\n getState = (): AgentsWidgetHydrationState => this.state;\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n dispatch = (action: AgentsStateAction): AgentsStateAction => {\n const nextHydrationState = WidgetHydrationReducer(this.state.AIExtensionsWidgetHydration, action);\n if (nextHydrationState === this.state.AIExtensionsWidgetHydration) return action;\n this.state = { AIExtensionsWidgetHydration: nextHydrationState };\n for (const notifyListener of [...this.listeners]) notifyListener();\n return action;\n };\n\n /** `AgentsStateStore.useSelector`: one value of the state, re-rendering when it changes. */\n useSelector = <Selected,>(selector: (state: AgentsWidgetHydrationState) => Selected): Selected => {\n const readSelectedValue = () => selector(this.state);\n return useSyncExternalStore(this.subscribe, readSelectedValue, readSelectedValue);\n };\n\n /** `AgentsStateStore.useDispatch`. */\n useDispatch = (): ((action: AgentsStateAction) => AgentsStateAction) => this.dispatch;\n}\n\n/** A new widget hydration store (a test, a second app on one page). */\nexport const createAgentsWidgetHydrationStateStore = (): AgentsStateStore =>\n new AgentsWidgetHydrationStateContainer();\n\nlet defaultStateStore: AgentsStateStore | null = null;\n\n/** The one default store of the page, created on first use. */\nexport const getDefaultAgentsStateStore = (): AgentsStateStore => {\n defaultStateStore ??= createAgentsWidgetHydrationStateStore();\n return defaultStateStore;\n};\n","/**\n * Whether a Markdown image in model text may load its source. Model text is foreign: an image of any host would let a\n * page or a document the agent read make the browser send what the model knows to that host (the data rides in the\n * URL). Allowed: the page's own origin (a relative URL included), `blob:` URLs, inline `data:image/…` raster images and\n * the hosts the app lists in `AgentsEnvironment.markdownImageHosts` (`cdn.example.com`, or `*.example.com` for every\n * subdomain). Everything else renders as a link the owner may open.\n */\nexport const isAllowedMarkdownImageSource = (\n source: string,\n pageOrigin: string | undefined,\n allowedHosts: readonly string[] | undefined,\n): boolean => {\n const trimmedSource = source.trim();\n if (trimmedSource === \"\") {\n return false;\n }\n if (/^data:image\\/(png|jpe?g|gif|webp);/i.test(trimmedSource)) {\n return true;\n }\n let sourceUrl: URL;\n try {\n sourceUrl = new URL(trimmedSource, pageOrigin ?? \"http://invalid.invalid\");\n } catch {\n return false;\n }\n if (sourceUrl.protocol === \"blob:\") {\n return true;\n }\n if (sourceUrl.protocol !== \"https:\" && sourceUrl.protocol !== \"http:\") {\n return false;\n }\n if (pageOrigin !== undefined && sourceUrl.origin === pageOrigin) {\n return true;\n }\n if (sourceUrl.protocol !== \"https:\") {\n return false;\n }\n const sourceHost = sourceUrl.hostname.toLowerCase();\n return (allowedHosts ?? []).some((allowedHost) => {\n const normalizedHost = allowedHost.trim().toLowerCase();\n if (normalizedHost.startsWith(\"*.\")) {\n const parentHost = normalizedHost.slice(2);\n return sourceHost.endsWith(`.${parentHost}`);\n }\n return normalizedHost !== \"\" && sourceHost === normalizedHost;\n });\n};\n","type ClassNameValue = string | undefined | null | false | Readonly<Record<string, boolean | undefined | null>>;\n\n/** The class names one argument contributes: a set string, or every key of an object whose value is truthy. */\nconst readClassNamesOfValue = (value: ClassNameValue): string[] => {\n if (typeof value === \"string\") return value.length > 0 ? [value] : [];\n if (!value) return [];\n return Object.keys(value).filter((className) => className.length > 0 && Boolean(value[className]));\n};\n\n/**\n * Joins the class names that are set, skipping empty and falsy values; an object adds each key whose value is truthy\n * (`classNames(styles.card, { [styles.selected]: isSelected })`), in argument order, as the `classnames` package does.\n */\nexport const classNames = (...args: ClassNameValue[]): string => args.flatMap(readClassNamesOfValue).join(\" \");\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport ReactMarkdown, { type Components } from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport type { PluggableList } from \"unified\";\nimport type {\n AgentsButtonProps,\n AgentsCheckboxProps,\n AgentsComponents,\n AgentsConversationSearchResultsListProps,\n AgentsHeroRowProps,\n AgentsHeroValueProps,\n AgentsMarkdownProps,\n AgentsSegmentBarProps,\n AgentsSkeletonTextProps,\n AgentsStatusBadgeStatus,\n AgentsStatusChipProps,\n AgentsStatusChipTone,\n AgentsWidgetFeatureGateProps,\n AgentsWidgetTextProps,\n AgentsDateInputProps,\n AgentsGlowFrameProps,\n AgentsIconProps,\n AgentsInteractiveSurfaceProps,\n AgentsLoadingSpinnerProps,\n AgentsMapMarkerProps,\n AgentsMapProps,\n AgentsModalLayerProps,\n AgentsProgressBarProps,\n AgentsRadioGroupProps,\n AgentsRangeSliderProps,\n AgentsSelectProps,\n AgentsSkeletonProps,\n AgentsSplitViewProps,\n AgentsStatusBadgeProps,\n AgentsTabsProps,\n AgentsTextAreaProps,\n AgentsTextInputProps,\n AgentsTextProps,\n AgentsTextReplacements,\n AgentsTooltipProps,\n AgentsTrendDeltaProps,\n} from \"./types\";\nimport { useAgentsEnvironment, useAgentsTexts } from \"../AgentsProvider\";\nimport { isAllowedMarkdownImageSource } from \"./markdown-image-source\";\nimport { classNames } from \"../class-names\";\n\nconst TEXT_ELEMENT_BY_ROLE = {\n title: \"h4\",\n intro: \"p\",\n body: \"span\",\n help: \"span\",\n caption: \"span\",\n} as const;\n\n/** `--token` stands for `var(--token)`; any other value is a CSS colour. */\nconst readCssColor = (color: string | undefined): string | undefined =>\n color?.startsWith(\"--\") ? `var(${color})` : color;\n\nconst readPlainReplacements = (replacements?: AgentsTextReplacements): Record<string, string | number> => {\n const plainReplacements: Record<string, string | number> = {};\n for (const [name, value] of Object.entries(replacements ?? {})) {\n if (typeof value === \"string\" || typeof value === \"number\") plainReplacements[name] = value;\n }\n return plainReplacements;\n};\n\nconst useTranslatedText = (\n text: string | undefined,\n translate = true,\n replacements?: AgentsTextReplacements,\n context?: string,\n): string | undefined => {\n const texts = useAgentsTexts();\n if (text === undefined) return undefined;\n return translate ? texts.translate(text, readPlainReplacements(replacements), context) : text;\n};\n\n/** The package's own text: an element per role, styled by `agents-text--*` classes of the package stylesheet. */\nconst DefaultText = (props: AgentsTextProps) => {\n const {\n children,\n role = \"body\",\n weight,\n color,\n translate = true,\n replacements,\n context,\n ellipsis,\n display,\n textAlign,\n textWrap,\n allowNewLines,\n headingLevel,\n ariaHidden,\n className,\n testId,\n } = props;\n const texts = useAgentsTexts();\n const Element = TEXT_ELEMENT_BY_ROLE[role];\n const content =\n typeof children === \"string\" && translate\n ? texts.translate(children, readPlainReplacements(replacements), context)\n : children;\n return (\n <Element\n data-testid={testId}\n role={headingLevel ? \"heading\" : undefined}\n aria-level={headingLevel}\n aria-hidden={ariaHidden || undefined}\n className={classNames(\n \"agents-text\",\n `agents-text--${role}`,\n weight && `agents-text--weight-${weight}`,\n ellipsis && \"agents-text--ellipsis\",\n allowNewLines && \"agents-text--new-lines\",\n className,\n )}\n style={{\n color: readCssColor(color),\n display,\n textAlign,\n whiteSpace: textWrap === \"nowrap\" || ellipsis ? \"nowrap\" : allowNewLines ? \"pre-line\" : undefined,\n }}\n >\n {content}\n </Element>\n );\n};\n\nconst DefaultIcon = (props: AgentsIconProps) => {\n const { name, hostIconName, size, pixelSize, color, className, style } = props;\n const iconName = name ?? hostIconName;\n return (\n <span\n aria-hidden\n data-icon={iconName}\n className={classNames(\"agents-icon\", size && `agents-icon--${size}`, className)}\n style={{ color: readCssColor(color), ...(pixelSize ? { width: pixelSize, height: pixelSize } : null), ...style }}\n />\n );\n};\n\nconst DefaultButton = (props: AgentsButtonProps) => {\n const {\n children,\n variant = \"primary\",\n size = \"medium\",\n onClick,\n disabled,\n isLoading,\n rounded,\n pressed,\n onDark,\n blurred,\n inverted,\n icon,\n iconPosition = \"left\",\n htmlType = \"button\",\n fullWidth,\n wrapsLabel,\n translate,\n replacements,\n className,\n testId,\n ariaLabel,\n } = props;\n const label = useTranslatedText(children, translate, replacements);\n return (\n <button\n type={htmlType}\n aria-label={ariaLabel}\n aria-pressed={pressed}\n aria-busy={isLoading || undefined}\n disabled={disabled || isLoading}\n data-testid={testId}\n onClick={onClick}\n className={classNames(\n \"agents-button\",\n `agents-button--${variant}`,\n `agents-button--${size}`,\n rounded && \"agents-button--rounded\",\n pressed && \"agents-button--pressed\",\n onDark && \"agents-button--on-dark\",\n blurred && \"agents-button--blurred\",\n inverted && \"agents-button--inverted\",\n fullWidth && \"agents-button--full-width\",\n wrapsLabel && \"agents-button--wraps-label\",\n className,\n )}\n >\n {icon && iconPosition === \"left\" ? <DefaultIcon name={icon} size=\"small\" /> : null}\n {label}\n {icon && iconPosition === \"right\" ? <DefaultIcon name={icon} size=\"small\" /> : null}\n </button>\n );\n};\n\nconst DefaultInteractiveSurface = (props: AgentsInteractiveSurfaceProps) => {\n const { children, hoverable, className, style, testId } = props;\n return (\n <div\n data-testid={testId}\n className={classNames(\"agents-interactive-surface\", hoverable && \"agents-interactive-surface--hoverable\", className)}\n style={style}\n >\n {children}\n </div>\n );\n};\n\nconst DefaultSkeleton = (props: AgentsSkeletonProps) => {\n const { width, height, borderRadius = 4, className, style } = props;\n return (\n <div\n aria-hidden\n className={classNames(\"agents-skeleton\", className)}\n style={{ width, height, borderRadius, ...style }}\n />\n );\n};\n\nconst DefaultLoadingSpinner = (_props: AgentsLoadingSpinnerProps) => (\n <span role=\"progressbar\" aria-busy className=\"agents-loading-spinner\" />\n);\n\nconst DefaultTooltip = (props: AgentsTooltipProps) => {\n const { children, text, replacements, placement = \"top\", dark } = props;\n const [isShown, setIsShown] = useState(false);\n const shownText = useTranslatedText(text, true, replacements);\n return (\n <span\n className=\"agents-tooltip\"\n style={{ position: \"relative\", display: \"inline-flex\" }}\n onMouseEnter={() => setIsShown(true)}\n onMouseLeave={() => setIsShown(false)}\n onFocus={() => setIsShown(true)}\n onBlur={() => setIsShown(false)}\n >\n {children}\n {shownText && isShown ? (\n <span\n role=\"tooltip\"\n className={classNames(\"agents-tooltip__panel\", `agents-tooltip__panel--${placement}`, dark && \"agents-tooltip__panel--dark\")}\n style={{ position: \"absolute\", bottom: \"100%\", left: \"50%\", transform: \"translateX(-50%)\" }}\n >\n {shownText}\n </span>\n ) : null}\n </span>\n );\n};\n\nconst DefaultGlowFrame = (props: AgentsGlowFrameProps) => {\n const { children, className, color, borderRadius, borderWidth } = props;\n return (\n <div\n className={classNames(\"agents-glow-frame\", className)}\n style={{ borderRadius, borderWidth, borderStyle: borderWidth ? \"solid\" : undefined, borderColor: color }}\n >\n {children}\n </div>\n );\n};\n\nconst DefaultProgressBar = (props: AgentsProgressBarProps) => {\n const { value, height, color, indeterminate } = props;\n return (\n <progress\n className=\"agents-progress-bar\"\n max={100}\n value={indeterminate ? undefined : value}\n style={{ height, accentColor: color, width: \"100%\" }}\n />\n );\n};\n\n/** The width of an element, followed with a `ResizeObserver`; null until it is laid out. */\nconst useElementWidth = (): [number | null, (element: HTMLElement | null) => void] => {\n const [width, setWidth] = useState<number | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n const observeElement = useCallback((element: HTMLElement | null) => {\n resizeObserverRef.current?.disconnect();\n resizeObserverRef.current = null;\n if (element === null) return;\n const initialWidth = element.getBoundingClientRect().width;\n setWidth(initialWidth > 0 ? initialWidth : null);\n if (typeof ResizeObserver === \"undefined\") return;\n resizeObserverRef.current = new ResizeObserver((entries) => {\n const entry = entries[entries.length - 1];\n if (entry && entry.contentRect.width > 0) setWidth(entry.contentRect.width);\n });\n resizeObserverRef.current.observe(element);\n }, []);\n return [width, observeElement];\n};\n\n/**\n * Two panes side by side. Below `coversBelowWidth` — measured on the split view's own box, so a narrow chat column in a\n * wide window counts as narrow — the open side pane covers the main pane instead of narrowing it.\n *\n * While the side pane covers the main pane: it takes the full width of the split, sits in its own stacking context\n * above the main pane's layers with an opaque background, the covered main pane is inert (no Tab, hidden from\n * assistive technology), the focus moves into the side pane and back to where it was in the main pane when the side\n * pane stops covering it, and the toggle floats over the side pane's top end. Below `coversBelowWidth` with the side\n * pane closed there is no divider: the toggle floats over the main pane's top end as the re-open control, unless the\n * main pane shows its own (`sideToggle.mainPaneShowsReopen`). Side by side the toggle is the strip on the divider. The\n * toggle carries a translated name (`Close canvas` / `Re-open canvas`) and an icon.\n */\nconst DefaultSplitView = (props: AgentsSplitViewProps) => {\n const { isSideOpen, coversBelowWidth, main, side, sideToggle } = props;\n const [splitViewWidth, observeSplitView] = useElementWidth();\n const coversMain = coversBelowWidth !== undefined && splitViewWidth !== null && splitViewWidth < coversBelowWidth;\n const isMainCovered = isSideOpen && coversMain;\n // Narrow and closed: no divider to carry the toggle, so it floats over the chat — the only way back to the canvas\n // unless the chat shows its own re-open control.\n const floatsReopenOverMain = coversMain && !isSideOpen && !sideToggle?.mainPaneShowsReopen;\n const togglesFloat = isMainCovered || floatsReopenOverMain;\n const toggleLabel = useTranslatedText(isSideOpen ? \"Close canvas\" : \"Re-open canvas\");\n const sidePaneRef = useRef<HTMLDivElement>(null);\n const lastFocusedInMainRef = useRef<HTMLElement | null>(null);\n\n // The covered main pane is inert, so a focus inside it would fall to the page: it moves into the side pane, and back\n // to the element last focused in the main pane (the control that opened the side pane) once the main pane is free.\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n if (isMainCovered) {\n const sidePane = sidePaneRef.current;\n if (sidePane && !sidePane.contains(document.activeElement)) sidePane.focus({ preventScroll: true });\n return;\n }\n const lastFocusedInMain = lastFocusedInMainRef.current;\n const focusIsLost = document.activeElement === null || document.activeElement === document.body;\n if (focusIsLost && lastFocusedInMain?.isConnected) lastFocusedInMain.focus({ preventScroll: true });\n }, [isMainCovered]);\n\n const toggleButton = sideToggle ? (\n <button\n type=\"button\"\n className={classNames(\"agents-split-view__toggle\", togglesFloat && \"agents-split-view__toggle--floating\")}\n onClick={sideToggle.onToggle}\n aria-expanded={isSideOpen}\n aria-label={toggleLabel}\n title={toggleLabel}\n style={togglesFloat ? { position: \"absolute\", top: 8, insetInlineEnd: 8, zIndex: 21 } : undefined}\n >\n <DefaultIcon name={isSideOpen ? \"closeCanvas\" : \"maximize\"} size=\"small\" />\n </button>\n ) : null;\n\n return (\n <div\n ref={observeSplitView}\n className={classNames(\"agents-split-view\", coversMain && \"agents-split-view--covering\")}\n style={{\n display: \"flex\",\n width: \"100%\",\n height: \"100%\",\n position: \"relative\",\n overflow: isMainCovered ? \"hidden\" : undefined,\n }}\n >\n <div\n className=\"agents-split-view__main\"\n style={{\n width: isSideOpen && !coversMain ? (main.narrowedWidth ?? main.width) : isMainCovered ? \"100%\" : main.width,\n background: main.background,\n isolation: isMainCovered ? \"isolate\" : undefined,\n }}\n inert={isMainCovered}\n aria-hidden={isMainCovered ? true : undefined}\n onFocusCapture={(event) => {\n lastFocusedInMainRef.current = event.target as HTMLElement;\n }}\n >\n {main.content}\n </div>\n {!coversMain ? toggleButton : null}\n {isSideOpen ? (\n <div\n ref={sidePaneRef}\n className=\"agents-split-view__side\"\n tabIndex={isMainCovered ? -1 : undefined}\n style={\n isMainCovered\n ? {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n maxWidth: \"100%\",\n boxSizing: \"border-box\",\n borderLeft: \"none\",\n overflowX: \"hidden\",\n outline: \"none\",\n isolation: \"isolate\",\n zIndex: 20,\n background: side.background ?? \"var(--agents-bg-surface)\",\n }\n : { width: side.narrowedWidth ?? side.width, background: side.background }\n }\n >\n {side.content}\n </div>\n ) : null}\n {togglesFloat ? toggleButton : null}\n </div>\n );\n};\n\nconst DefaultTrendDelta = (props: AgentsTrendDeltaProps) => {\n const { current, previous = 0, higherIsBetter = true, format } = props;\n const change = current - previous;\n const magnitude = Math.abs(change);\n const isGood = change === 0 ? undefined : (change > 0) === higherIsBetter;\n return (\n <span\n className={classNames(\n \"agents-trend-delta\",\n isGood === true && \"agents-trend-delta--good\",\n isGood === false && \"agents-trend-delta--bad\",\n )}\n >\n {change > 0 ? \"▲ \" : change < 0 ? \"▼ \" : \"\"}\n {format ? format(magnitude) : String(magnitude)}\n </span>\n );\n};\n\nconst DefaultCheckbox = (props: AgentsCheckboxProps) => {\n const { checked, disabled, label, translate, onChange, testId } = props;\n const translatedLabel = useTranslatedText(typeof label === \"string\" ? label : undefined, translate);\n return (\n <label className=\"agents-checkbox\" data-testid={testId}>\n <input type=\"checkbox\" checked={checked ?? false} disabled={disabled} onChange={onChange} />\n {typeof label === \"string\" ? translatedLabel : label}\n </label>\n );\n};\n\nconst DefaultTextInput = (props: AgentsTextInputProps) => {\n const { id, value, type = \"text\", label, placeholder, maxLength, onChange, testId } = props;\n const translatedLabel = useTranslatedText(label);\n return (\n <label className=\"agents-text-input\">\n {translatedLabel ? <span className=\"agents-text-input__label\">{translatedLabel}</span> : null}\n <input\n id={id}\n type={type}\n value={value ?? \"\"}\n placeholder={placeholder}\n maxLength={maxLength}\n data-testid={testId}\n onChange={(event) => onChange?.(event.target.value)}\n />\n </label>\n );\n};\n\nconst DefaultTextArea = (props: AgentsTextAreaProps) => {\n const { id, value, label, placeholder, maxLength, rows, minRows, showsCounter, autoFocus, onChange, testId } = props;\n const translatedLabel = useTranslatedText(label);\n return (\n <label className=\"agents-text-area\">\n {translatedLabel ? <span className=\"agents-text-area__label\">{translatedLabel}</span> : null}\n <textarea\n id={id}\n value={value ?? \"\"}\n placeholder={placeholder}\n maxLength={maxLength}\n rows={rows ?? minRows}\n autoFocus={autoFocus}\n data-testid={testId}\n onChange={(event) => onChange?.(event.target.value)}\n />\n {showsCounter && maxLength ? (\n <span className=\"agents-text-area__counter\">{`${(value ?? \"\").length} / ${maxLength}`}</span>\n ) : null}\n </label>\n );\n};\n\nconst DefaultRangeSlider = (props: AgentsRangeSliderProps) => {\n const { value, min, max, step, onMove, onRelease } = props;\n return (\n <input\n type=\"range\"\n className=\"agents-range-slider\"\n value={value}\n min={min}\n max={max}\n step={step}\n onChange={(event) => onMove?.(Number(event.target.value))}\n onPointerUp={(event) => onRelease?.(Number(event.currentTarget.value))}\n onKeyUp={(event) => onRelease?.(Number(event.currentTarget.value))}\n />\n );\n};\n\nconst toIsoDay = (timestamp: number | undefined): string | undefined => {\n if (timestamp === undefined) return undefined;\n const day = new Date(timestamp);\n const month = String(day.getMonth() + 1).padStart(2, \"0\");\n const dayOfMonth = String(day.getDate()).padStart(2, \"0\");\n return `${day.getFullYear()}-${month}-${dayOfMonth}`;\n};\n\nconst DefaultDateInput = (props: AgentsDateInputProps) => {\n const { value, minDate, maxDate, onChange } = props;\n return (\n <input\n type=\"date\"\n className=\"agents-date-input\"\n value={toIsoDay(value) ?? \"\"}\n min={toIsoDay(minDate)}\n max={toIsoDay(maxDate)}\n onChange={(event) => {\n const [year, month, day] = event.target.value.split(\"-\").map(Number);\n onChange?.(event.target.value ? new Date(year, month - 1, day).getTime() : null);\n }}\n />\n );\n};\n\nconst DefaultRadioGroup = (props: AgentsRadioGroupProps) => {\n const { name, value, options, direction = \"column\", onChange } = props;\n return (\n <div className=\"agents-radio-group\" style={{ display: \"flex\", flexDirection: direction }}>\n {options.map((option) => (\n <label key={option.value} className=\"agents-radio-group__option\">\n <input\n type=\"radio\"\n name={name}\n value={option.value}\n checked={option.value === value}\n disabled={option.disabled}\n onChange={() => onChange(option.value)}\n />\n {option.label}\n </label>\n ))}\n </div>\n );\n};\n\nconst DefaultSelect = (props: AgentsSelectProps) => {\n const { id, value, options, placeholder, onChange, testId } = props;\n return (\n <select\n id={id}\n className=\"agents-select\"\n value={value}\n data-testid={testId}\n onChange={(event) => onChange(event.target.value)}\n >\n {placeholder !== undefined ? (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n ) : null}\n {options.map((option) => (\n <option key={option.value} value={option.value} disabled={option.disabled} title={option.description}>\n {option.label}\n </option>\n ))}\n </select>\n );\n};\n\nconst DefaultTabs = (props: AgentsTabsProps) => {\n const { options, value, onChange, ariaLabel } = props;\n return (\n <div role=\"tablist\" aria-label={ariaLabel} className=\"agents-tabs\">\n {options\n .filter((option) => !option.disabled)\n .map((option) => (\n <button\n key={option.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={option.value === value}\n data-testid={option.testId}\n className={classNames(\"agents-tabs__tab\", option.value === value && \"agents-tabs__tab--selected\")}\n onClick={() => onChange(option.value)}\n >\n {option.label}\n </button>\n ))}\n </div>\n );\n};\n\nconst DefaultStatusBadge = (props: AgentsStatusBadgeProps) => {\n const { status, text, translate, size, className } = props;\n const shownText = useTranslatedText(text, translate);\n return (\n <span\n className={classNames(\n \"agents-status-badge\",\n `agents-status-badge--${status}`,\n size && `agents-status-badge--${size}`,\n className,\n )}\n >\n {shownText}\n </span>\n );\n};\n\n/** No map without the app's map: a placeholder that says so. */\nconst DefaultMap = (props: AgentsMapProps) => {\n const { className, testId } = props;\n const noMapText = useTranslatedText(\"No map available.\");\n return (\n <div className={classNames(\"agents-map-placeholder\", className)} data-testid={testId} data-map=\"none\">\n {noMapText}\n </div>\n );\n};\n\nconst DefaultMapMarker = (_props: AgentsMapMarkerProps) => null;\n\nconst DefaultModalLayer = (props: AgentsModalLayerProps) => {\n const { children } = props;\n return <>{children}</>;\n};\n\nconst DefaultHeroRow = (props: AgentsHeroRowProps) => {\n const { children, className } = props;\n return (\n <div data-hero-row=\"\" className={classNames(\"agents-hero-row\", className)}>\n {children}\n </div>\n );\n};\n\nconst DefaultHeroValue = (props: AgentsHeroValueProps) => {\n const { children, color } = props;\n return (\n <span data-hero=\"\" data-hero-value=\"\" className=\"agents-hero-value\" style={{ color: readCssColor(color) }}>\n {children}\n </span>\n );\n};\n\nconst DefaultWidgetText = (props: AgentsWidgetTextProps) => {\n const {\n children,\n variant = \"inherit\",\n tone,\n color,\n weight,\n uppercase,\n tabular,\n strikethrough,\n inline = variant === \"inherit\",\n translate = typeof children === \"string\",\n context,\n replacements,\n className,\n testId,\n } = props;\n const texts = useAgentsTexts();\n const plainReplacements: Record<string, string | number> = {};\n for (const [name, value] of Object.entries(replacements ?? {})) {\n if (value !== null && value !== undefined) plainReplacements[name] = value;\n }\n const content =\n typeof children === \"string\" && translate ? texts.translate(children, plainReplacements, context) : children;\n const Element = inline ? \"span\" : \"div\";\n return (\n <Element\n data-testid={testId}\n className={classNames(\n \"agents-widget-text\",\n `agents-widget-text--${variant}`,\n tone && !color && `agents-widget-text--${tone}`,\n weight && `agents-widget-text--weight-${weight}`,\n uppercase && \"agents-widget-text--uppercase\",\n tabular && \"agents-widget-text--tabular\",\n strikethrough && \"agents-widget-text--strikethrough\",\n className,\n )}\n style={color ? { color: readCssColor(color) } : undefined}\n >\n {content}\n </Element>\n );\n};\n\nconst DefaultSkeletonText = (props: AgentsSkeletonTextProps) => {\n const { width = \"4.5em\", height = \"1em\", className } = props;\n return (\n <span\n aria-hidden\n className={classNames(\"agents-skeleton\", className)}\n style={{ display: \"inline-block\", width, height, borderRadius: 999 }}\n />\n );\n};\n\nconst STATUS_BADGE_STATUS_BY_CHIP_TONE: Record<AgentsStatusChipTone, AgentsStatusBadgeStatus> = {\n success: \"success\",\n warning: \"warning\",\n danger: \"danger\",\n neutral: \"neutral\",\n info: \"info\",\n error: \"danger\",\n};\n\nconst DefaultStatusChip = (props: AgentsStatusChipProps) => {\n const { tone = \"neutral\", children, compact = false, translate = true } = props;\n return (\n <DefaultStatusBadge\n status={STATUS_BADGE_STATUS_BY_CHIP_TONE[tone]}\n text={children}\n translate={translate}\n size=\"small\"\n hideIcon={compact || tone !== \"error\"}\n />\n );\n};\n\nconst DefaultSegmentBar = (props: AgentsSegmentBarProps) => {\n const { segments, height = 6, className, loading = false, testId } = props;\n const total = segments.reduce((sum, segment) => sum + Math.max(0, segment.value), 0);\n return (\n <div\n className={classNames(\"agents-segment-bar\", className)}\n style={{ display: \"flex\", height, borderRadius: height, overflow: \"hidden\" }}\n data-segment-bar=\"\"\n data-testid={testId}\n >\n {total > 0 || loading\n ? segments.map((segment, segmentIndex) => (\n <div\n key={segmentIndex}\n style={{\n width: loading\n ? `${100 / segments.length}%`\n : `${(Math.max(0, segment.value) / total) * 100}%`,\n background: segment.color,\n opacity: segment.muted || loading ? 0.5 : undefined,\n }}\n />\n ))\n : null}\n </div>\n );\n};\n\nconst NO_MARKDOWN_PLUGINS: PluggableList = [];\n\n/**\n * An image of model text loads only from an allowed source (`isAllowedMarkdownImageSource`: the page's origin, inline\n * raster data, `AgentsEnvironment.markdownImageHosts`); any other becomes a link the owner may open. Drops an image\n * without a source: streamed Markdown emits a partial ` => {\n const { src, node, ...otherProps } = imageProps;\n const { markdownImageHosts } = useAgentsEnvironment();\n if (!src) {\n return null;\n }\n const pageOrigin = typeof window !== \"undefined\" ? window.location.origin : undefined;\n if (isAllowedMarkdownImageSource(src, pageOrigin, markdownImageHosts)) {\n return <img src={src} {...otherProps} />;\n }\n return (\n <a href={src} target=\"_blank\" rel=\"noopener noreferrer nofollow\" referrerPolicy=\"no-referrer\">\n {otherProps.alt || src}\n </a>\n );\n};\n\nconst DefaultMarkdown = (props: AgentsMarkdownProps) => {\n const { markdown, color, remarkPlugins = NO_MARKDOWN_PLUGINS, rehypePlugins = NO_MARKDOWN_PLUGINS, components } = props;\n const markdownComponents = useMemo(() => ({ img: MarkdownImage, ...components }) as Components, [components]);\n const markdownRemarkPlugins = useMemo(() => [remarkGfm, ...remarkPlugins], [remarkPlugins]);\n return (\n <div style={{ color }} className=\"agents-markdown\" data-markdown-blocks-root>\n <ReactMarkdown\n remarkPlugins={markdownRemarkPlugins}\n rehypePlugins={rehypePlugins}\n components={markdownComponents}\n >\n {markdown}\n </ReactMarkdown>\n </div>\n );\n};\n\n/** Without an app gate every widget is available. */\nconst DefaultWidgetFeatureGate = (props: AgentsWidgetFeatureGateProps) => {\n const { children } = props;\n return <>{children}</>;\n};\n\nconst DefaultConversationSearchResultsList = (props: AgentsConversationSearchResultsListProps) => {\n const { groups, onOpenConversation } = props;\n return (\n <ul className=\"agents-conversation-search-results\">\n {groups.map((group, groupIndex) => (\n <li key={group.conversationId ?? groupIndex} className=\"agents-conversation-search-results__group\">\n <DefaultText role=\"body\" weight=\"bold\" translate={false}>\n {group.title ?? \"\"}\n </DefaultText>\n {group.hits.map((hit, hitIndex) => (\n <button\n key={hit.messageId ?? hitIndex}\n type=\"button\"\n className=\"agents-conversation-search-results__hit\"\n onClick={() => {\n if (group.conversationId !== undefined) onOpenConversation(group.conversationId, hit.messageId);\n }}\n >\n <DefaultText role=\"help\" translate={false}>\n {hit.excerpt ?? \"\"}\n </DefaultText>\n </button>\n ))}\n </li>\n ))}\n </ul>\n );\n};\n\n/** The package default of every replaceable component. */\nexport const DEFAULT_AGENTS_COMPONENTS: AgentsComponents = {\n Text: DefaultText,\n Button: DefaultButton,\n Icon: DefaultIcon,\n InteractiveSurface: DefaultInteractiveSurface,\n Skeleton: DefaultSkeleton,\n LoadingSpinner: DefaultLoadingSpinner,\n Tooltip: DefaultTooltip,\n GlowFrame: DefaultGlowFrame,\n ProgressBar: DefaultProgressBar,\n SplitView: DefaultSplitView,\n TrendDelta: DefaultTrendDelta,\n Checkbox: DefaultCheckbox,\n TextInput: DefaultTextInput,\n TextArea: DefaultTextArea,\n RangeSlider: DefaultRangeSlider,\n DateInput: DefaultDateInput,\n RadioGroup: DefaultRadioGroup,\n Select: DefaultSelect,\n Tabs: DefaultTabs,\n StatusBadge: DefaultStatusBadge,\n Map: DefaultMap,\n MapMarker: DefaultMapMarker,\n ModalLayer: DefaultModalLayer,\n HeroRow: DefaultHeroRow,\n HeroValue: DefaultHeroValue,\n WidgetText: DefaultWidgetText,\n SkeletonText: DefaultSkeletonText,\n StatusChip: DefaultStatusChip,\n SegmentBar: DefaultSegmentBar,\n Markdown: DefaultMarkdown,\n WidgetFeatureGate: DefaultWidgetFeatureGate,\n ConversationSearchResultsList: DefaultConversationSearchResultsList,\n};\n","import type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport type { AgentsComponents } from \"./components/types\";\nimport type { ConversationWidgetStatePartition } from \"../renderer/conversation-widget-state-partition\";\nimport type { ChatAssistantCategory } from \"../chat/chat-assistant-identity\";\nimport type { AgentChatActivityTiming } from \"../chat/controller/chat-activity-timing\";\nimport type { ComposedNodeSchemaApplicationPart } from \"../renderer/widget-tree/composed-node-schema\";\nimport type { CanvasBehaviour } from \"../renderer/canvas/canvas-behaviours\";\nimport type { OpenEntityActionTarget } from \"../renderer/canvas/entity-detail-instance\";\n\n/** Translates interface copy. The key is the English source text. */\nexport interface AgentsTexts {\n translate: (key: string, replacements?: Record<string, string | number>, context?: string) => string;\n}\n\n/** One image of a gallery the app opens over the page. */\nexport interface AgentsGalleryImage {\n /** Identifies the image within the gallery. */\n id: string;\n url: string;\n name?: string;\n}\n\n/**\n * An action the package dispatches into the state store. The index signature is the shape of redux 5's\n * `UnknownAction`, so a host store that registers the package's reducers keeps the action type react-redux 9 expects.\n */\nexport interface AgentsStateAction {\n type: string;\n payload?: unknown;\n [extraProps: string]: unknown;\n}\n\n/**\n * A state store as React hooks: the package keeps its widget hydration state in it, and an app's older chat state\n * partitions are read through it (`defaultChatStatePartition`). Without an app store the package uses its own.\n */\nexport interface AgentsStateStore {\n useSelector: <Selected>(selector: (state: any) => Selected) => Selected;\n useDispatch: () => (action: AgentsStateAction) => unknown;\n}\n\n/** The owner's language and the active agent space's date and time settings. Every field may be missing. */\nexport interface AgentsOwnerSettings {\n /** The owner's language (`de`). */\n languageCode?: string | null;\n /** The owner's locale (`de-DE`). */\n locale?: string | null;\n /** The date locale of the active agent space (`de-DE`). */\n dateLocale?: string | null;\n /** The time zone of the active agent space. */\n timeZone?: string | null;\n /** The active agent space writes times with AM/PM. */\n usesAmPm?: boolean | null;\n}\n\n/** What the error card of a reached budget offers (the error card's upgrade data). */\nexport interface AgentsBudgetLimit {\n /** An upgrade lifts the limit: the card offers it. */\n canUpgrade: boolean;\n /** Opens the app's upgrade flow. */\n openUpgrade: () => void;\n /** The app presents the budget as a fair-use allowance (the card uses that wording). */\n showsFairUseWording: boolean;\n}\n\n/** The badge of a named assistant's icon (its intro card, its openings). */\nexport interface AgentsAssistantIconBadgeProps {\n /** The icon's name in the app's icon set (`ChatAssistantIdentity.iconClass`). */\n iconName: string;\n color: string;\n backgroundColor: string;\n /** Larger on the intro card than on an opening. */\n isLarge?: boolean;\n}\n\n/** The background of a chat with a named assistant's category (or with none, the overview of every category). */\nexport interface AgentsAssistantBackgroundProps {\n category?: ChatAssistantCategory;\n /** The category's alias; undefined for a chat without a category. */\n categoryAlias?: string;\n}\n\n/** The state of the app's map script loader. */\nexport interface AgentsMapsLoaderState {\n isLoaded: boolean;\n loadError: Error | undefined;\n languageCode: string | undefined;\n}\n\n/**\n * Further names of the sandbox and readiness signals that an app declares beside the package's own (`AGENTS_VISUALIZATION`,\n * `--agents-*`, `__AGENTS_WIDGET_IMAGE_V1__`, `__AGENTS_WIDGET_PREVIEW_V1__`): the names its stored visualization scripts,\n * its skill texts or its headless capture already use. Every list is optional; the package's names always exist.\n */\nexport type AgentsSandboxLegacyAliases = {\n /** Further names of the sandbox global, e.g. the name stored scripts of the app read. */\n visualizationGlobalNames?: string[];\n /** Further prefixes of the frame's theme variables, e.g. `--app-` (each variable is set under every prefix). */\n themeVariablePrefixes?: string[];\n /** Further names of the image-capture readiness signal on `window`. */\n imageReadinessGlobalNames?: string[];\n /** Further names of the preview readiness signal on `window`. */\n previewReadinessGlobalNames?: string[];\n};\n\n/**\n * Everything an app supplies to the package. Every member is optional: the package has a default for each.\n * An app sets it once at start (`setAgentsEnvironment`) or per subtree (`AgentsProvider`); the functions are read\n * from the app-wide environment only.\n */\nexport interface AgentsEnvironment {\n /**\n * The state store hooks (see `AgentsStateStore`). Default: the package's own widget hydration store (one per page,\n * `createAgentsWidgetHydrationStateStore`). An app supplies its own to keep the hydration state in its store\n * (host application: its Redux store, which mounts `WidgetHydrationReducer` under `AIExtensionsWidgetHydration`).\n */\n stateStore?: AgentsStateStore;\n /**\n * The partition of the app's own chat state a widget provider reads when its host passes neither a chat store nor a\n * partition (host application: the AI-Extensions chat's slice). Default: none — such a provider keeps a store of its own.\n */\n defaultChatStatePartition?: ConversationWidgetStatePartition;\n /** A React hook returning the owner's settings. Default: none known (the browser's language stands in). */\n useOwnerSettings?: () => AgentsOwnerSettings;\n /**\n * A React hook returning the key of the agent space the owner works in. The key of an agent space is what the\n * client knows it by: the id of the space, unless the app's backend hands out another key\n * (`AgentSpace::getWidgetSelfHydrationKey()`). Default: no agent space.\n */\n useActiveAgentSpaceKey?: () => number | undefined;\n /** Reads the display name of an agent space (the header of a widget of another agent space). Default: no name. */\n readAgentSpaceName?: (agentSpaceKey: number, signal: AbortSignal) => Promise<string | undefined>;\n /**\n * The field of a widget block that carries the key of the block's agent space, as the app's backend writes it\n * (`WidgetBlockFieldNames::WIDGET_SELF_HYDRATION_KEY`). An app whose stored conversations use another field name\n * declares it here and in its backend class. Default: `agentSpaceId`.\n */\n widgetSelfHydrationKeyFieldName?: string;\n /**\n * The owner's text for a click on a widget of another agent space than the active one: returns the text with the\n * suffix the app's backend reads that agent space from\n * (`WidgetBlockFieldNames::OWNER_TEXT_SUFFIX_PATTERN_OF_ANOTHER_SPACE`). Default: the text unchanged.\n */\n appendAnotherAgentSpaceToOwnerText?: (ownerText: string, anotherAgentSpaceKey: number) => string;\n /** The label of an agent space whose name is not known. Default: `#<key>`. */\n buildUnnamedAgentSpaceLabel?: (agentSpaceKey: number) => string;\n /**\n * The sentence that tells the owner that a widget shows another agent space than the active one; `agentSpaceLabel`\n * is its name or the label above. Default: a sentence that names no kind of agent space.\n */\n buildWidgetOfAnotherAgentSpaceExplanation?: (agentSpaceLabel: string) => string;\n /** The name the owner knows the agent by, for the interface texts that name it. Default: `the assistant`. */\n agentDisplayName?: string;\n /**\n * The timing of every chat's activity reads and working indicator, for the fields a chat's own `activityTiming`\n * leaves out (`AgentChatActivityTiming`). Default: the package's values (one activity read per 3 s, a line at least\n * 2.2 s beside the face). A host with a realtime push that writes `activityUpdatedAt` lowers the read window.\n */\n chatActivityTiming?: AgentChatActivityTiming;\n /** A React hook returning what the error card of a reached budget offers. Default: no upgrade, the plain wording. */\n useBudgetLimit?: () => AgentsBudgetLimit;\n /** A React hook returning the map script loader's state. Default: no maps. */\n useMapsLoader?: () => AgentsMapsLoaderState;\n /**\n * The action that tells the app whether an agent chat surface is open (dispatched into the state store when the\n * first surface mounts and the last unmounts). Default: nothing is dispatched.\n */\n buildChatSurfaceOpenChangedAction?: (isOpen: boolean) => AgentsStateAction;\n /**\n * Hosts an image in model text may load from, besides the page's own origin and inline raster data: `cdn.example.com`\n * or `*.example.com` (https only). Model text is foreign; an image of any other host renders as a link, so a page the\n * agent read cannot make the browser send data to its host. Default: none.\n */\n markdownImageHosts?: readonly string[];\n components?: Partial<AgentsComponents>;\n texts?: AgentsTexts;\n /**\n * Prepares a plain text (a model's words, a business name) for the app's `Text`, `Button` and `StatusBadge`\n * replacements, which may read a string as markup. Default: the text unchanged.\n */\n escapePlainTextForText?: (text: string) => string;\n /**\n * Decides where a link of the package goes — every anchor (Markdown links, sources, kit links) and every link the\n * package opens by code (a video's watch page, an `openUrl` action, a gallery image without a lightbox). `event` is\n * the click, null when there is none. Return true when the host navigated itself (an in-app route; the package then\n * does nothing), false to let the package open the link in a new tab. Default: every link opens in a new tab.\n */\n onNavigate?: (href: string, event: MouseEvent | null) => boolean;\n /**\n * Opens the entity of an `openEntity` action (a composed view's row, a map point) on a host route instead of the\n * `entityDetail` canvas. Return true when the host opened it, false to open the canvas. Default: the canvas.\n */\n onOpenEntity?: (target: OpenEntityActionTarget) => boolean;\n /** Opens the images in the app's lightbox, starting at `startIndex`. Default: the start image in a new tab. */\n openImageGallery?: (images: AgentsGalleryImage[], startIndex: number) => void;\n /** Reports a widget that crashed while rendering. Default: nothing (the crash is logged to the console). */\n reportWidgetCrash?: (widgetName: string, error: Error, errorInfo: ErrorInfo) => void;\n /**\n * The footer under an assistant message (host application: the admin's forensics panel, which gates itself). Receives the\n * message as the message view got it. Default: none.\n */\n MessageFooter?: ComponentType<{ message?: unknown }>;\n /**\n * The colour theme class of a named assistant's category (the assistant identity and theme). Default:\n * none — the generic chat colours.\n */\n readAssistantThemeClassName?: (categoryAlias: string) => string;\n /** The badge of a named assistant's icon. Default: none. */\n AssistantIconBadge?: ComponentType<AgentsAssistantIconBadgeProps>;\n /** The chat's own background when the host paints none (host application: the category illustrations). Default: none. */\n AssistantBackground?: ComponentType<AgentsAssistantBackgroundProps>;\n /**\n * Wraps the body of an open canvas (host application: page components inside a canvas must not mirror their filters into\n * the page URL). Default: no wrapper.\n */\n CanvasBodyContainer?: ComponentType<{ children: ReactNode }>;\n /**\n * Tells the app that a turn of the agent runs in an open chat (the host application keeps the tab \"ambient active\" then);\n * returns the release the chat calls when the turn ends. Default: nothing.\n */\n reportRunningTurn?: () => () => void;\n /**\n * Further names of the CustomVisualization sandbox (its global, its theme variable prefixes) and of the image and\n * preview readiness signals, beside the package's own names (see `AgentsSandboxLegacyAliases`). An app whose stored\n * scripts or capture read older names declares them here. Default: none — only the package's names exist.\n */\n sandboxLegacyAliases?: AgentsSandboxLegacyAliases;\n /**\n * The app's part of the ComposedView node schema: the node types, widgets (which embed, at which size), data sources\n * and entity types its own classes declare, as its backend generates them beside the package's\n * `composed-node-schema.json`. The tree readers and the kit read the package's schema with this part added\n * (`getComposedNodeSchema`). Default: none — only the package's own types exist.\n */\n composedNodeSchemaApplicationPart?: ComposedNodeSchemaApplicationPart;\n /**\n * The path prefix of the app's API reads a live widget image capture lets through (same origin, GET only, sent with\n * the capture's bearer; every other request of the capture fails it). Default: `/api/`.\n */\n widgetImageCaptureReadPathPrefix?: string;\n /**\n * The app's widgets that draw a Google map: a widget image capture of one of them, or of a `ComposedView` that embeds\n * one, may load the Maps SDK (the narrow transport exception of the capture; the twin of the backend's list that opens\n * the capture page's CSP). A `ComposedView` holding a `Map` node always may. Default: none.\n */\n googleMapWidgetNames?: string[];\n /**\n * Further `signalSource`s a widget click of the app posts (`injectSignal`), beside the package's own\n * (`FRONTEND_WIDGET_CLICK`, `OWNER_ACTION_CONFIRM`): the message list reads every one of them as the owner's answer to\n * a widget, so an answered widget never comes back interactive after a reload. Default: none.\n */\n furtherWidgetClickSignalSources?: string[];\n /**\n * The canvases of the app's widgets (canvas id → behaviour), beside the package's own (`packageCanvasBehaviours`):\n * every canvas an app widget lists in `opensCanvases`. The app registers each one's body with `registerCanvasBodies`\n * and, when gated, its requirement with `registerCanvasFeatureFlags`. A package canvas id here is ignored. Default:\n * none.\n */\n furtherCanvasBehaviours?: Readonly<Record<string, CanvasBehaviour>>;\n}\n\nlet appEnvironment: AgentsEnvironment = {};\nconst environmentListeners = new Set<() => void>();\n\n/** Sets the app-wide environment. Call it once before the first render; a later call re-renders the readers. */\nexport const setAgentsEnvironment = (environment: AgentsEnvironment): void => {\n appEnvironment = environment;\n for (const notifyListener of environmentListeners) notifyListener();\n};\n\nexport const getAgentsEnvironment = (): AgentsEnvironment => appEnvironment;\n\nexport const subscribeToAgentsEnvironment = (listener: () => void): (() => void) => {\n environmentListeners.add(listener);\n return () => {\n environmentListeners.delete(listener);\n };\n};\n\nconst substitutePlaceholders = (key: string, replacements?: Record<string, string | number>): string =>\n replacements\n ? key.replace(/%([A-Za-z0-9_]+)%/g, (placeholder, name: string) =>\n name in replacements ? String(replacements[name]) : placeholder,\n )\n : key;\n\n/** The package default: the English key with its placeholders substituted. */\nexport const DEFAULT_AGENTS_TEXTS: AgentsTexts = { translate: substitutePlaceholders };\n\n/** Translates an interface text through the app-wide environment, for a string a component hands on (a label). */\nexport const translateText = (key: string, replacements?: Record<string, string | number>, context?: string): string =>\n (appEnvironment.texts ?? DEFAULT_AGENTS_TEXTS).translate(key, replacements, context);\n\n/** A plain text as the app's text components take it (`AgentsEnvironment.escapePlainTextForText`). */\nexport const escapePlainTextForText = (text: string): string =>\n appEnvironment.escapePlainTextForText ? appEnvironment.escapePlainTextForText(text) : text;\n\n/** Opens an image gallery over the page (`AgentsEnvironment.openImageGallery`). */\nexport const openImageGallery = (images: AgentsGalleryImage[], startIndex: number): void => {\n if (appEnvironment.openImageGallery) {\n appEnvironment.openImageGallery(images, startIndex);\n return;\n }\n const startImage = images[startIndex];\n if (!startImage) return;\n if (appEnvironment.onNavigate?.(startImage.url, null) === true) return;\n window.open(startImage.url, \"_blank\", \"noopener,noreferrer\");\n};\n\n/** The block field of the package's backend default (`WidgetBlockFieldNames::WIDGET_SELF_HYDRATION_KEY`). */\nexport const DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME = \"agentSpaceId\";\n\n/** The field of a widget block that carries the key of its agent space (`AgentsEnvironment.widgetSelfHydrationKeyFieldName`). */\nexport const getWidgetSelfHydrationKeyFieldName = (): string =>\n appEnvironment.widgetSelfHydrationKeyFieldName ?? DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME;\n\n/** The owner's text for a click on a widget of another agent space (`AgentsEnvironment.appendAnotherAgentSpaceToOwnerText`). */\nexport const appendAnotherAgentSpaceToOwnerText = (ownerText: string, anotherAgentSpaceKey: number): string =>\n appEnvironment.appendAnotherAgentSpaceToOwnerText\n ? appEnvironment.appendAnotherAgentSpaceToOwnerText(ownerText, anotherAgentSpaceKey)\n : ownerText;\n\n/** The label of an agent space without a known name (`AgentsEnvironment.buildUnnamedAgentSpaceLabel`). */\nexport const buildUnnamedAgentSpaceLabel = (agentSpaceKey: number): string =>\n appEnvironment.buildUnnamedAgentSpaceLabel ? appEnvironment.buildUnnamedAgentSpaceLabel(agentSpaceKey) : `#${agentSpaceKey}`;\n\n/** The sentence under a widget of another agent space (`AgentsEnvironment.buildWidgetOfAnotherAgentSpaceExplanation`). */\nexport const buildWidgetOfAnotherAgentSpaceExplanation = (agentSpaceLabel: string): string =>\n appEnvironment.buildWidgetOfAnotherAgentSpaceExplanation\n ? appEnvironment.buildWidgetOfAnotherAgentSpaceExplanation(agentSpaceLabel)\n : translateText(\"This widget shows data for %label%, not for what you currently have selected.\", {\n label: agentSpaceLabel,\n });\n\n/** The further sandbox and readiness names the app declares (`AgentsEnvironment.sandboxLegacyAliases`). */\nexport const getSandboxLegacyAliases = (): AgentsSandboxLegacyAliases => appEnvironment.sandboxLegacyAliases ?? {};\n\n/** The package default of `AgentsEnvironment.widgetImageCaptureReadPathPrefix`. */\nexport const DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX = \"/api/\";\n\n/** The path prefix of the API reads a live widget image capture lets through (`AgentsEnvironment.widgetImageCaptureReadPathPrefix`). */\nexport const getWidgetImageCaptureReadPathPrefix = (): string =>\n appEnvironment.widgetImageCaptureReadPathPrefix ?? DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX;\n\n/** The app's widgets that draw a Google map (`AgentsEnvironment.googleMapWidgetNames`). */\nexport const getGoogleMapWidgetNames = (): readonly string[] => appEnvironment.googleMapWidgetNames ?? [];\n\n/** The app's further widget click signal sources (`AgentsEnvironment.furtherWidgetClickSignalSources`). */\nexport const getFurtherWidgetClickSignalSources = (): readonly string[] =>\n appEnvironment.furtherWidgetClickSignalSources ?? [];\n\n/** The canvases of the app's widgets (`AgentsEnvironment.furtherCanvasBehaviours`). */\nexport const getFurtherCanvasBehaviours = (): Readonly<Record<string, CanvasBehaviour>> =>\n appEnvironment.furtherCanvasBehaviours ?? {};\n\n/** The name the owner knows the agent by (`AgentsEnvironment.agentDisplayName`). */\nexport const getAgentDisplayName = (): string => appEnvironment.agentDisplayName ?? translateText(\"the assistant\");\n\n/** Reports a running turn of an open chat (`AgentsEnvironment.reportRunningTurn`); returns the release. */\nexport const reportRunningTurn = (): (() => void) | undefined => appEnvironment.reportRunningTurn?.();\n\n/** Reports a crashed widget (`AgentsEnvironment.reportWidgetCrash`). */\nexport const reportWidgetCrash = (widgetName: string, error: Error, errorInfo: ErrorInfo): void => {\n appEnvironment.reportWidgetCrash?.(widgetName, error, errorInfo);\n};\n","import { createContext, type ReactNode, useContext, useMemo, useSyncExternalStore } from \"react\";\nimport type { AgentsConversationClient } from \"../client/AgentsConversationClient\";\nimport { AgentsConversationClientProvider } from \"../client/AgentsConversationClientContext\";\nimport { getDefaultAgentsStateStore } from \"../renderer/widget-hydration/widget-hydration-state-store\";\nimport { DEFAULT_AGENTS_COMPONENTS } from \"./components/default-components\";\nimport type { AgentsComponents } from \"./components/types\";\nimport {\n type AgentsBudgetLimit,\n type AgentsEnvironment,\n type AgentsMapsLoaderState,\n type AgentsOwnerSettings,\n type AgentsStateAction,\n type AgentsTexts,\n DEFAULT_AGENTS_TEXTS,\n getAgentsEnvironment,\n subscribeToAgentsEnvironment,\n} from \"./environment\";\n\nconst AgentsEnvironmentContext = createContext<AgentsEnvironment | null>(null);\n\nexport interface AgentsProviderProps {\n /** The subtree's environment; members it leaves out fall back to the app-wide one, then to the defaults. */\n environment?: AgentsEnvironment;\n /** The conversation client the chat below reads and sends through (the one required input of a chat). */\n client?: AgentsConversationClient;\n children: ReactNode;\n}\n\nconst NO_SUBTREE_ENVIRONMENT: AgentsEnvironment = {};\n\n/**\n * Supplies an environment and the conversation client to one subtree. `<AgentsProvider client={client}><AgentChat />\n * </AgentsProvider>` is a whole chat with the package defaults.\n */\nexport const AgentsProvider = (props: AgentsProviderProps) => {\n const { environment = NO_SUBTREE_ENVIRONMENT, client, children } = props;\n const environmentTree = <AgentsEnvironmentContext.Provider value={environment}>{children}</AgentsEnvironmentContext.Provider>;\n return client ? (\n <AgentsConversationClientProvider client={client}>{environmentTree}</AgentsConversationClientProvider>\n ) : (\n environmentTree\n );\n};\n\nconst useAppEnvironment = (): AgentsEnvironment =>\n useSyncExternalStore(subscribeToAgentsEnvironment, getAgentsEnvironment, getAgentsEnvironment);\n\n/** The components package code renders: the subtree's replacements over the app's over the package defaults. */\nexport const useAgentsComponents = (): AgentsComponents => {\n const subtreeEnvironment = useContext(AgentsEnvironmentContext);\n const appEnvironment = useAppEnvironment();\n return useMemo(\n () => ({ ...DEFAULT_AGENTS_COMPONENTS, ...appEnvironment.components, ...subtreeEnvironment?.components }),\n [appEnvironment, subtreeEnvironment],\n );\n};\n\nexport const useAgentsTexts = (): AgentsTexts => {\n const subtreeEnvironment = useContext(AgentsEnvironmentContext);\n const appEnvironment = useAppEnvironment();\n return subtreeEnvironment?.texts ?? appEnvironment.texts ?? DEFAULT_AGENTS_TEXTS;\n};\n\n/** The environment of this subtree: its own members over the app-wide ones. */\nexport const useAgentsEnvironment = (): AgentsEnvironment => {\n const subtreeEnvironment = useContext(AgentsEnvironmentContext);\n const appEnvironment = useAppEnvironment();\n return useMemo(\n () => (subtreeEnvironment ? { ...appEnvironment, ...subtreeEnvironment } : appEnvironment),\n [appEnvironment, subtreeEnvironment],\n );\n};\n\n/** The app's state store, else the package's own widget hydration store. */\nconst readStateStore = (environment: AgentsEnvironment) => environment.stateStore ?? getDefaultAgentsStateStore();\n\n/** Reads from the state store (`AgentsEnvironment.stateStore`, else the package's default store). */\nexport const useAgentsStateSelector = <Selected,>(selector: (state: any) => Selected): Selected =>\n readStateStore(useAgentsEnvironment()).useSelector(selector);\n\n/** The dispatch of the state store (`AgentsEnvironment.stateStore`, else the package's default store). */\nexport const useAgentsStateDispatch = (): ((action: AgentsStateAction) => unknown) =>\n readStateStore(useAgentsEnvironment()).useDispatch();\n\nconst NO_OWNER_SETTINGS: AgentsOwnerSettings = {};\nconst useNoOwnerSettings = (): AgentsOwnerSettings => NO_OWNER_SETTINGS;\n\n/** The owner's language and the active agent space's date and time settings (`AgentsEnvironment.useOwnerSettings`). */\nexport const useAgentsOwnerSettings = (): AgentsOwnerSettings => {\n const useOwnerSettings = useAgentsEnvironment().useOwnerSettings ?? useNoOwnerSettings;\n return useOwnerSettings();\n};\n\nconst useNoActiveAgentSpaceKey = (): number | undefined => undefined;\n\n/** The key of the agent space the owner works in (`AgentsEnvironment.useActiveAgentSpaceKey`). */\nexport const useAgentsActiveAgentSpaceKey = (): number | undefined => {\n const useActiveAgentSpaceKey = useAgentsEnvironment().useActiveAgentSpaceKey ?? useNoActiveAgentSpaceKey;\n return useActiveAgentSpaceKey();\n};\n\nconst NO_MAPS: AgentsMapsLoaderState = {\n isLoaded: false,\n loadError: new Error(\"The agents environment has no maps loader.\"),\n languageCode: undefined,\n};\nconst useNoMapsLoader = (): AgentsMapsLoaderState => NO_MAPS;\n\n/** The map script loader's state (`AgentsEnvironment.useMapsLoader`). */\nexport const useAgentsMapsLoader = (): AgentsMapsLoaderState => {\n const useMapsLoader = useAgentsEnvironment().useMapsLoader ?? useNoMapsLoader;\n return useMapsLoader();\n};\n\nconst NO_BUDGET_UPGRADE: AgentsBudgetLimit = { canUpgrade: false, openUpgrade: () => undefined, showsFairUseWording: false };\nconst useNoBudgetLimit = (): AgentsBudgetLimit => NO_BUDGET_UPGRADE;\n\n/** What the error card of a reached budget offers (`AgentsEnvironment.useBudgetLimit`). */\nexport const useAgentsBudgetLimit = (): AgentsBudgetLimit => {\n const useBudgetLimit = useAgentsEnvironment().useBudgetLimit ?? useNoBudgetLimit;\n return useBudgetLimit();\n};\n","import { useAgentsComponents } from \"../AgentsProvider\";\nimport type {\n AgentsButtonProps,\n AgentsCheckboxProps,\n AgentsDateInputProps,\n AgentsGlowFrameProps,\n AgentsIconProps,\n AgentsInteractiveSurfaceProps,\n AgentsLoadingSpinnerProps,\n AgentsMapMarkerProps,\n AgentsMapProps,\n AgentsModalLayerProps,\n AgentsProgressBarProps,\n AgentsRadioGroupProps,\n AgentsRangeSliderProps,\n AgentsSelectProps,\n AgentsSkeletonProps,\n AgentsSplitViewProps,\n AgentsStatusBadgeProps,\n AgentsTabsProps,\n AgentsTextAreaProps,\n AgentsTextInputProps,\n AgentsTextProps,\n AgentsTooltipProps,\n AgentsTrendDeltaProps,\n AgentsHeroRowProps,\n AgentsHeroValueProps,\n AgentsWidgetTextProps,\n AgentsSkeletonTextProps,\n AgentsStatusChipProps,\n AgentsSegmentBarProps,\n AgentsMarkdownProps,\n AgentsWidgetFeatureGateProps,\n AgentsConversationSearchResultsListProps,\n} from \"./types\";\n\n/**\n * The components package code imports. Each renders the app's replacement when the environment has one, else the\n * package default — package code never imports an app's component library.\n */\nexport const Text = (props: AgentsTextProps) => {\n const { Text: TextComponent } = useAgentsComponents();\n return <TextComponent {...props} />;\n};\n\nexport const Button = (props: AgentsButtonProps) => {\n const { Button: ButtonComponent } = useAgentsComponents();\n return <ButtonComponent {...props} />;\n};\n\nexport const Icon = (props: AgentsIconProps) => {\n const { Icon: IconComponent } = useAgentsComponents();\n return <IconComponent {...props} />;\n};\n\nexport const InteractiveSurface = (props: AgentsInteractiveSurfaceProps) => {\n const { InteractiveSurface: InteractiveSurfaceComponent } = useAgentsComponents();\n return <InteractiveSurfaceComponent {...props} />;\n};\n\nexport const Skeleton = (props: AgentsSkeletonProps) => {\n const { Skeleton: SkeletonComponent } = useAgentsComponents();\n return <SkeletonComponent {...props} />;\n};\n\nexport const LoadingSpinner = (props: AgentsLoadingSpinnerProps) => {\n const { LoadingSpinner: LoadingSpinnerComponent } = useAgentsComponents();\n return <LoadingSpinnerComponent {...props} />;\n};\n\nexport const Tooltip = (props: AgentsTooltipProps) => {\n const { Tooltip: TooltipComponent } = useAgentsComponents();\n return <TooltipComponent {...props} />;\n};\n\nexport const GlowFrame = (props: AgentsGlowFrameProps) => {\n const { GlowFrame: GlowFrameComponent } = useAgentsComponents();\n return <GlowFrameComponent {...props} />;\n};\n\nexport const ProgressBar = (props: AgentsProgressBarProps) => {\n const { ProgressBar: ProgressBarComponent } = useAgentsComponents();\n return <ProgressBarComponent {...props} />;\n};\n\nexport const SplitView = (props: AgentsSplitViewProps) => {\n const { SplitView: SplitViewComponent } = useAgentsComponents();\n return <SplitViewComponent {...props} />;\n};\n\nexport const TrendDelta = (props: AgentsTrendDeltaProps) => {\n const { TrendDelta: TrendDeltaComponent } = useAgentsComponents();\n return <TrendDeltaComponent {...props} />;\n};\n\nexport const Checkbox = (props: AgentsCheckboxProps) => {\n const { Checkbox: CheckboxComponent } = useAgentsComponents();\n return <CheckboxComponent {...props} />;\n};\n\nexport const TextInput = (props: AgentsTextInputProps) => {\n const { TextInput: TextInputComponent } = useAgentsComponents();\n return <TextInputComponent {...props} />;\n};\n\nexport const TextArea = (props: AgentsTextAreaProps) => {\n const { TextArea: TextAreaComponent } = useAgentsComponents();\n return <TextAreaComponent {...props} />;\n};\n\nexport const RangeSlider = (props: AgentsRangeSliderProps) => {\n const { RangeSlider: RangeSliderComponent } = useAgentsComponents();\n return <RangeSliderComponent {...props} />;\n};\n\nexport const DateInput = (props: AgentsDateInputProps) => {\n const { DateInput: DateInputComponent } = useAgentsComponents();\n return <DateInputComponent {...props} />;\n};\n\nexport const RadioGroup = (props: AgentsRadioGroupProps) => {\n const { RadioGroup: RadioGroupComponent } = useAgentsComponents();\n return <RadioGroupComponent {...props} />;\n};\n\nexport const Select = (props: AgentsSelectProps) => {\n const { Select: SelectComponent } = useAgentsComponents();\n return <SelectComponent {...props} />;\n};\n\nexport const Tabs = (props: AgentsTabsProps) => {\n const { Tabs: TabsComponent } = useAgentsComponents();\n return <TabsComponent {...props} />;\n};\n\nexport const StatusBadge = (props: AgentsStatusBadgeProps) => {\n const { StatusBadge: StatusBadgeComponent } = useAgentsComponents();\n return <StatusBadgeComponent {...props} />;\n};\n\nexport const Map = (props: AgentsMapProps) => {\n const { Map: MapComponent } = useAgentsComponents();\n return <MapComponent {...props} />;\n};\n\nexport const MapMarker = (props: AgentsMapMarkerProps) => {\n const { MapMarker: MapMarkerComponent } = useAgentsComponents();\n return <MapMarkerComponent {...props} />;\n};\n\nexport const ModalLayer = (props: AgentsModalLayerProps) => {\n const { ModalLayer: ModalLayerComponent } = useAgentsComponents();\n return <ModalLayerComponent {...props} />;\n};\n\nexport const HeroRow = (props: AgentsHeroRowProps) => {\n const { HeroRow: HeroRowComponent } = useAgentsComponents();\n return <HeroRowComponent {...props} />;\n};\n\nexport const HeroValue = (props: AgentsHeroValueProps) => {\n const { HeroValue: HeroValueComponent } = useAgentsComponents();\n return <HeroValueComponent {...props} />;\n};\n\nexport const WidgetText = (props: AgentsWidgetTextProps) => {\n const { WidgetText: WidgetTextComponent } = useAgentsComponents();\n return <WidgetTextComponent {...props} />;\n};\n\nexport const SkeletonText = (props: AgentsSkeletonTextProps) => {\n const { SkeletonText: SkeletonTextComponent } = useAgentsComponents();\n return <SkeletonTextComponent {...props} />;\n};\n\nexport const StatusChip = (props: AgentsStatusChipProps) => {\n const { StatusChip: StatusChipComponent } = useAgentsComponents();\n return <StatusChipComponent {...props} />;\n};\n\nexport const SegmentBar = (props: AgentsSegmentBarProps) => {\n const { SegmentBar: SegmentBarComponent } = useAgentsComponents();\n return <SegmentBarComponent {...props} />;\n};\n\nexport const Markdown = (props: AgentsMarkdownProps) => {\n const { Markdown: MarkdownComponent } = useAgentsComponents();\n return <MarkdownComponent {...props} />;\n};\n\nexport const WidgetFeatureGate = (props: AgentsWidgetFeatureGateProps) => {\n const { WidgetFeatureGate: WidgetFeatureGateComponent } = useAgentsComponents();\n return <WidgetFeatureGateComponent {...props} />;\n};\n\nexport const ConversationSearchResultsList = (props: AgentsConversationSearchResultsListProps) => {\n const { ConversationSearchResultsList: ConversationSearchResultsListComponent } = useAgentsComponents();\n return <ConversationSearchResultsListComponent {...props} />;\n};\n\nexport type * from \"./types\";\nexport { AGENTS_ICON_NAMES, isAgentsIconName } from \"./icon-names\";\n","import { type AnchorHTMLAttributes, type MouseEvent as ReactMouseEvent, useMemo } from \"react\";\nimport { useAgentsEnvironment } from \"./AgentsProvider\";\nimport type { AgentsEnvironment } from \"./environment\";\n\n/** Opens a link the package's default way: a new tab, without opener or referrer. */\nconst openInNewTab = (href: string): void => {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n};\n\n/**\n * Opens a link through the environment's `onNavigate` (the host decides: an in-app route, a new tab, nothing), else in\n * a new tab. `event` is the click that asked for it, when there is one.\n */\nexport const openLinkThroughEnvironment = (\n environment: Pick<AgentsEnvironment, \"onNavigate\">,\n href: string,\n event: MouseEvent | null,\n): void => {\n if (environment.onNavigate?.(href, event) === true) return;\n openInNewTab(href);\n};\n\nconst readNativeEvent = (event: ReactMouseEvent | MouseEvent | undefined): MouseEvent | null =>\n event === undefined ? null : \"nativeEvent\" in event ? event.nativeEvent : event;\n\n/** How package code opens a link: through the host's `onNavigate`, else in a new tab. */\nexport interface AgentsLinkNavigation {\n /** Opens `href` (a link opened by code, e.g. a button: the package's `window.open` places). */\n openLink: (href: string, event?: ReactMouseEvent | MouseEvent) => void;\n /**\n * The click handler of an anchor that opens in a new tab: hands the click to the host's `onNavigate` and keeps the\n * browser from following the anchor when the host took it.\n */\n handleLinkClick: (event: ReactMouseEvent<HTMLAnchorElement>, href?: string) => void;\n}\n\n/** The link navigation of this subtree (`AgentsEnvironment.onNavigate`). */\nexport const useAgentsLinkNavigation = (): AgentsLinkNavigation => {\n const { onNavigate } = useAgentsEnvironment();\n return useMemo(\n () => ({\n openLink: (href, event) => openLinkThroughEnvironment({ onNavigate }, href, readNativeEvent(event)),\n handleLinkClick: (event, href) => {\n const target = href ?? event.currentTarget.getAttribute(\"href\") ?? \"\";\n if (!target || !onNavigate) return;\n if (onNavigate(target, event.nativeEvent) === true) event.preventDefault();\n },\n }),\n [onNavigate],\n );\n};\n\nexport type AgentsLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** The hast node react-markdown passes to a custom component; never put on the DOM element. */\n node?: unknown;\n};\n\n/**\n * The anchor every package link renders: a new tab without opener or referrer, unless the host's `onNavigate` takes\n * the click (an in-app route). A host's own widget uses it for the same behaviour.\n */\nexport const AgentsLink = (props: AgentsLinkProps) => {\n const { node, href, onClick, children, ...anchorProps } = props;\n const { handleLinkClick } = useAgentsLinkNavigation();\n return (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n {...anchorProps}\n href={href}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && href) handleLinkClick(event, href);\n }}\n >\n {children}\n </a>\n );\n};\n"],"names":["appEnvironment"],"mappings":";;;;;;AASA,MAAM,aAAa;AAEnB,MAAM,cAAc,MAAoB;AACtC,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,mBAAmB;AAAA,IACnB,UAAU;AAAA,IACV,WAAW;AAAA,IACX,cAAc;AAAA,EAAA;AAElB;AAEA,MAAM,eAA0C;AAAA,EAC9C,SAAS,CAAA;AACX;AAEA,MAAM,aAAa,CAAC,OAAkC,QAA8B,MAAM,QAAQ,GAAG,KAAK,YAAA;AAE1G,MAAM,aAAa,CAAC,OAAkC,KAAa,YAAqD;AAAA,EACtH,GAAG;AAAA,EACH,SAAS,EAAE,GAAG,MAAM,SAAS,CAAC,GAAG,GAAG,OAAA;AACtC;AAGA,MAAM,mBAAmB,CAAC,QAAsB,cAC9C,OAAO,cAAc,KAAK,OAAO,cAAc;AA4BjD,MAAM,aAAa,CAAC,SAAyB,GAAG,UAAU,IAAI,IAAI;AAG3D,MAAM,uBAAuB;AAAA,EAClC,eAAe,CAAC,aAAsD,EAAE,MAAM,WAAW,eAAe,GAAG;EAC3G,kBAAkB,CAAC,aAAyD;AAAA,IAC1E,MAAM,WAAW,kBAAkB;AAAA,IACnC;AAAA,EAAA;AAAA,EAEF,kBAAkB,CAAC,aAAyD;AAAA,IAC1E,MAAM,WAAW,kBAAkB;AAAA,IACnC;AAAA,EAAA;AAAA,EAEF,oBAAoB,CAAC,aAA2D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AC,UAAU,CAAC,WAAY;AAC5B,YAAI,WAAW,QAAQ,MAAM,WAAW,MAAM,YAAY,eAAA;AAAA,MAC5D;AAAA,IAAA;AAAA,IAEF,CAAC,UAAU;AAAA,EAAA;AAEf;AAWO,MAAM,aAAa,CAAC,UAA2B;AACpD,QAAM,EAAE,MAAM,MAAM,SAAS,UAAU,GAAG,gBAAgB;AAC1D,QAAM,EAAE,gBAAA,IAAoB,wBAAA;AAC5B,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,KAAI;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,SAAS,CAAC,UAAU;AAClB,kBAAU,KAAK;AACf,YAAI,CAAC,MAAM,oBAAoB,KAAM,iBAAgB,OAAO,IAAI;AAAA,MAClE;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { V as getSandboxLegacyAliases } from "./link-navigation-
|
|
2
|
+
import { V as getSandboxLegacyAliases } from "./link-navigation-CNX8Am2L.js";
|
|
3
3
|
const WIDGET_IMAGE_READINESS_GLOBAL_NAME = "__AGENTS_WIDGET_IMAGE_V1__";
|
|
4
4
|
const readWidgetImageReadinessGlobalNames = () => [
|
|
5
5
|
WIDGET_IMAGE_READINESS_GLOBAL_NAME,
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
publishWidgetImageReadiness as p,
|
|
23
23
|
readWidgetImageReadiness as r
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=widget-image-readiness-signal-
|
|
25
|
+
//# sourceMappingURL=widget-image-readiness-signal-C58JkCQA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-image-readiness-signal-
|
|
1
|
+
{"version":3,"file":"widget-image-readiness-signal-C58JkCQA.js","sources":["../../src/image-render/widget-image-readiness-signal.ts"],"sourcesContent":["import { getSandboxLegacyAliases } from \"../provider/environment\";\nimport type { WidgetImageReadiness } from \"./widget-image-render.types\";\n\n/** The `window` property the image capture waits on. */\nexport const WIDGET_IMAGE_READINESS_GLOBAL_NAME = \"__AGENTS_WIDGET_IMAGE_V1__\";\n\ntype WindowSignals = Record<string, WidgetImageReadiness | undefined>;\n\n/**\n * Every name the image readiness signal is published under: the package's own, then each name the app declares\n * (`AgentsEnvironment.sandboxLegacyAliases.imageReadinessGlobalNames`) — read at each publish, so an app may declare\n * them after a readiness was created.\n */\nexport const readWidgetImageReadinessGlobalNames = (): string[] => [\n WIDGET_IMAGE_READINESS_GLOBAL_NAME,\n ...(getSandboxLegacyAliases().imageReadinessGlobalNames ?? []).filter(\n (aliasName) => aliasName !== WIDGET_IMAGE_READINESS_GLOBAL_NAME,\n ),\n];\n\n/** Publishes (or with `undefined` clears) the image readiness signal under every name. */\nexport const publishWidgetImageReadiness = (readiness: WidgetImageReadiness | undefined): void => {\n const windowSignals = window as unknown as WindowSignals;\n for (const globalName of readWidgetImageReadinessGlobalNames()) windowSignals[globalName] = readiness;\n};\n\n/**\n * The published image readiness signal. A `failed` value under ANY name wins — the app's own capture code may have\n * written it under a name it declared — otherwise the value under the package's name, otherwise the first value found.\n */\nexport const readWidgetImageReadiness = (): WidgetImageReadiness | undefined => {\n const windowSignals = window as unknown as WindowSignals;\n const publishedSignals = readWidgetImageReadinessGlobalNames()\n .map((globalName) => windowSignals[globalName])\n .filter((signal): signal is WidgetImageReadiness => signal !== undefined && signal !== null);\n return publishedSignals.find((signal) => signal.state === \"failed\") ?? publishedSignals[0];\n};\n"],"names":[],"mappings":";;AAIO,MAAM,qCAAqC;AAS3C,MAAM,sCAAsC,MAAgB;AAAA,EACjE;AAAA,EACA,IAAI,wBAAA,EAA0B,6BAA6B,CAAA,GAAI;AAAA,IAC7D,CAAC,cAAc,cAAc;AAAA,EAAA;AAEjC;AAGO,MAAM,8BAA8B,CAAC,cAAsD;AAChG,QAAM,gBAAgB;AACtB,aAAW,cAAc,oCAAA,EAAuC,eAAc,UAAU,IAAI;AAC9F;AAMO,MAAM,2BAA2B,MAAwC;AAC9E,QAAM,gBAAgB;AACtB,QAAM,mBAAmB,oCAAA,EACtB,IAAI,CAAC,eAAe,cAAc,UAAU,CAAC,EAC7C,OAAO,CAAC,WAA2C,WAAW,UAAa,WAAW,IAAI;AAC7F,SAAO,iBAAiB,KAAK,CAAC,WAAW,OAAO,UAAU,QAAQ,KAAK,iBAAiB,CAAC;AAC3F;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { useReducer, useRef, useCallback, useMemo, useEffect, useState, useContext, createContext, useLayoutEffect, useId, useSyncExternalStore, Fragment as Fragment$1 } from "react";
|
|
4
|
-
import { g as registerWidgetHydrator, aw as SkeletonLine, aE as WidgetSurface, aC as WidgetKpiValue, Y as readWidgetAgentSpaceKeyAttribute, W as WidgetRenderReportContext, z as buildWidgetAgentSpaceKeyProps, bh as readTextNodeContent, bi as readAllowedValue, a0 as useConversationWidgetContext, M as ModelText, ap as DonePill, bg as ConversationWidgetButton, $ as shortStringHash, a6 as WidgetImageReadinessContext, U as messageAnchor, t as ConversationWidgetActions, bj as useReportTextNodeRenderState, bk as readTextNodeRenderState, ax as SkeletonPill, bl as buildFaviconUrl, bm as readSiteHostname, av as SkeletonCircle, bn as readSafeHttpUrl, a3 as useWidgetHydration, a1 as useIsEmailWidgetRender, a2 as useReportWidgetRenderStatus, ah as ClockConversationWidget, ai as ConceptExplainerConversationWidget, ak as CurrencyConverterConversationWidget, al as CustomVisualizationConversationWidget, aq as DriveFilesConversationWidget, bo as registerDriveFilesHydrator, bc as normalizeEntityMentionFields, as as EntityMentionConversationWidget, aG as WritingDraftConversationWidget, az as SuggestedActions, at as MultiChoiceConversationWidget, au as QuickRepliesConversationWidget, aA as ToolTraceConversationWidget, aj as ConversationSearchResultsConversationWidget, aB as WebSearchResultsConversationWidget } from "./WebSearchResultsConversationWidget-
|
|
5
|
-
import { Y as getWidgetSelfHydrationKeyFieldName, N as getAgentsEnvironment, J as escapePlainTextForText, s as Text, I as Icon, a8 as useAgentsOwnerSettings, F as classNames, a6 as useAgentsLinkNavigation, B as Button, A as AgentsLink, S as SegmentBar, w as TrendDelta, x as WidgetText, a1 as translateText, $ as reportWidgetCrash, W as WidgetFeatureGate, h as InteractiveSurface, C as Checkbox, f as DateInput, u as TextInput, R as RadioGroup, m as Select, l as RangeSlider, T as Tabs, t as TextArea, M as Map$1, i as MapMarker, a7 as useAgentsMapsLoader, n as Skeleton, Z as openImageGallery, q as StatusBadge, j as Markdown, a5 as useAgentsEnvironment } from "./link-navigation-
|
|
4
|
+
import { g as registerWidgetHydrator, aw as SkeletonLine, aE as WidgetSurface, aC as WidgetKpiValue, Y as readWidgetAgentSpaceKeyAttribute, W as WidgetRenderReportContext, z as buildWidgetAgentSpaceKeyProps, bh as readTextNodeContent, bi as readAllowedValue, a0 as useConversationWidgetContext, M as ModelText, ap as DonePill, bg as ConversationWidgetButton, $ as shortStringHash, a6 as WidgetImageReadinessContext, U as messageAnchor, t as ConversationWidgetActions, bj as useReportTextNodeRenderState, bk as readTextNodeRenderState, ax as SkeletonPill, bl as buildFaviconUrl, bm as readSiteHostname, av as SkeletonCircle, bn as readSafeHttpUrl, a3 as useWidgetHydration, a1 as useIsEmailWidgetRender, a2 as useReportWidgetRenderStatus, ah as ClockConversationWidget, ai as ConceptExplainerConversationWidget, ak as CurrencyConverterConversationWidget, al as CustomVisualizationConversationWidget, aq as DriveFilesConversationWidget, bo as registerDriveFilesHydrator, bc as normalizeEntityMentionFields, as as EntityMentionConversationWidget, aG as WritingDraftConversationWidget, az as SuggestedActions, at as MultiChoiceConversationWidget, au as QuickRepliesConversationWidget, aA as ToolTraceConversationWidget, aj as ConversationSearchResultsConversationWidget, aB as WebSearchResultsConversationWidget } from "./WebSearchResultsConversationWidget-887v8Wen.js";
|
|
5
|
+
import { Y as getWidgetSelfHydrationKeyFieldName, N as getAgentsEnvironment, J as escapePlainTextForText, s as Text, I as Icon, a8 as useAgentsOwnerSettings, F as classNames, a6 as useAgentsLinkNavigation, B as Button, A as AgentsLink, S as SegmentBar, w as TrendDelta, x as WidgetText, a1 as translateText, $ as reportWidgetCrash, W as WidgetFeatureGate, h as InteractiveSurface, C as Checkbox, f as DateInput, u as TextInput, R as RadioGroup, m as Select, l as RangeSlider, T as Tabs, t as TextArea, M as Map$1, i as MapMarker, a7 as useAgentsMapsLoader, n as Skeleton, Z as openImageGallery, q as StatusBadge, j as Markdown, a5 as useAgentsEnvironment } from "./link-navigation-CNX8Am2L.js";
|
|
6
6
|
import ReactApexChartImport from "react-apexcharts";
|
|
7
7
|
import { i as isAgentsIconName } from "./icon-names-Di6c4zLo.js";
|
|
8
8
|
import { unified } from "unified";
|
|
@@ -9753,4 +9753,4 @@ export {
|
|
|
9753
9753
|
getConversationWidgetRegistryRevision as y,
|
|
9754
9754
|
readComposedViewTree as z
|
|
9755
9755
|
};
|
|
9756
|
-
//# sourceMappingURL=widget-name-resolver-
|
|
9756
|
+
//# sourceMappingURL=widget-name-resolver-BVEuAsW5.js.map
|