@schlenkr/ragents 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/apps/server/src/provider.ts +8 -2
  2. package/apps/server/src/title-compactor.ts +1 -1
  3. package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-CpPi6QLr.js → highlighted-body-KPVGNVTW-BslIwn_y.js} +1 -1
  4. package/apps/web/dist/assets/main-BUN8m8SW.js +11 -0
  5. package/apps/web/dist/assets/{mermaid-HWGCJPDP-q-mf1kLN.js → mermaid-HWGCJPDP-B1erZlFM.js} +4 -4
  6. package/apps/web/dist/assets/{runPanel-nk_aMxSn.js → runPanel-s8gGpr9M.js} +1 -1
  7. package/apps/web/dist/help/mini-app.css +9 -0
  8. package/apps/web/dist/host-web.json +7 -7
  9. package/apps/web/dist/index.html +2 -2
  10. package/apps/web/dist/run-panel.html +2 -2
  11. package/apps/web/src/App.tsx +12 -1
  12. package/apps/web/src/PluginRegistry.tsx +2 -2
  13. package/apps/web/src/SessionList.tsx +7 -6
  14. package/apps/web/src/SettingsModal.tsx +3 -3
  15. package/apps/web/src/actor-programs/client-ui/FilePicker.tsx +1 -1
  16. package/apps/web/src/api.ts +2 -0
  17. package/apps/web/src/run-overview.ts +1 -1
  18. package/apps/web/src/ui/relative-time.ts +1 -1
  19. package/bundles/ragents.documents/ragents-bundle.json +2 -2
  20. package/bundles/ragents.documents/web/classes.json +1 -1
  21. package/bundles/ragents.documents/web/index.js +1 -1
  22. package/bundles/ragents.documents/web/index.js.map +2 -2
  23. package/bundles/ragents.orchestration/ragents-bundle.json +2 -2
  24. package/bundles/ragents.orchestration/web/index.js +3 -3
  25. package/bundles/ragents.orchestration/web/index.js.map +2 -2
  26. package/bundles/ragents.overseer/ragents-bundle.json +4 -3
  27. package/bundles/ragents.overseer/web/classes.json +1 -1
  28. package/bundles/ragents.overseer/web/index.js +1 -1
  29. package/bundles/ragents.overseer/web/index.js.map +4 -4
  30. package/bundles/ragents.processes/ragents-bundle.json +2 -2
  31. package/bundles/ragents.processes/web/classes.json +1 -1
  32. package/bundles/ragents.processes/web/index.js +1 -1
  33. package/bundles/ragents.processes/web/index.js.map +2 -2
  34. package/bundles/ragents.workspace/ragents-bundle.json +2 -2
  35. package/bundles/ragents.workspace/web/classes.json +1 -1
  36. package/bundles/ragents.workspace/web/index.js +1 -1
  37. package/bundles/ragents.workspace/web/index.js.map +2 -2
  38. package/package.json +2 -2
  39. package/plugins/ragents.documents/web/DocumentViewer.tsx +2 -2
  40. package/plugins/ragents.orchestration/web/ExecutionsPanel.tsx +1 -1
  41. package/plugins/ragents.orchestration/web/FlowInspector.tsx +1 -1
  42. package/plugins/ragents.orchestration/web/JournalStatus.tsx +1 -1
  43. package/plugins/ragents.orchestration/web/format.ts +1 -1
  44. package/plugins/ragents.overseer/web/index.tsx +51 -3
  45. package/plugins/ragents.processes/web/processes.ts +1 -1
  46. package/plugins/ragents.workspace/web/FileBrowser.tsx +1 -1
  47. package/apps/web/dist/assets/main-DJmCHGzM.js +0 -11
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["ragents-host-read:read", "ragents-host-value:@ragents/web/AccessContext#useAccess", "ragents-host-value:@ragents/web/ui#Button", "ragents-host-value:@ragents/web/ui#Dialog", "ragents-host-value:@ragents/web/ui#DialogContent", "ragents-host-value:@ragents/web/ui#DialogDescription", "ragents-host-value:@ragents/web/ui#DialogFooter", "ragents-host-value:@ragents/web/ui#DialogHeader", "ragents-host-value:@ragents/web/ui#DialogTitle", "ragents-host-value:@ragents/web/ui#Popover", "ragents-host-value:@ragents/web/ui#PopoverContent", "ragents-host-value:@ragents/web/ui#Select", "ragents-host-value:@ragents/web/ui#SelectContent", "ragents-host-value:@ragents/web/ui#SelectItem", "ragents-host-value:@ragents/web/ui#SelectTrigger", "ragents-host-value:@ragents/web/ui#SelectValue", "ragents-host-value:@ragents/web/ui/dialog#RunModalContext", "ragents-host-value:react#createContext", "ragents-host-value:react#createElement", "ragents-host-value:react#forwardRef", "ragents-host-value:react#useCallback", "ragents-host-value:react#useContext", "ragents-host-value:react#useEffect", "ragents-host-value:react#useMemo", "ragents-host-value:react#useRef", "ragents-host-value:react#useState", "ragents-host-value:react#useSyncExternalStore", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toKebabCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toLucideIconData.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toCamelCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toPascalCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/mergeClasses.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/defaultAttributes.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconNode.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconForReact.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/hasA11yProp.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/context.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/Icon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/createLucideIcon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/x.ts", "ragents-host-value:quassel#ChatInputToolbar", "ragents-host-value:quassel#ChatMessages", "ragents-host-value:@ragents/web/chat/useChat#useChat", "ragents-host-value:@ragents/web/chat/useAttachmentCapabilities#useAttachmentCapabilities", "ragents-host-value:@ragents/web/PluginRegistry#ChatStepsProvider", "ragents-host-value:@ragents/web/chat-view-settings#ChatViewSwitches", "ragents-host-value:@ragents/web/chat-view-settings#useChatViewSettings", "ragents-host-value:@ragents/web/toolLine#withToolSummaries", "ragents-host-value:@ragents/web/rpc#rpc", "ragents-host-value:@ragents/web/api#interruptActorTurn", "ragents-host-value:@ragents/engine/src/http/contracts#runContracts", "ragents-host-value:@ragents/web/run-view#runViewFrom", "ragents-host-value:typebox#Type", "ragents-host-value:@ragents/engine/src/rpc/contract#defineOperation", "ragents-host-value:@ragents/engine/src/domain/events#eventTypeMap", "../../../plugins/ragents.overseer/contract.ts", "ragents-host-value:@ragents/web/lib/labels#thinkingLabel", "../../../plugins/ragents.overseer/web/model-settings.ts", "ragents-host-value:react/jsx-runtime#Fragment", "ragents-host-value:react/jsx-runtime#jsx", "ragents-host-value:react/jsx-runtime#jsxs", "../../../plugins/ragents.overseer/web/ModelSettings.tsx", "../../../plugins/ragents.overseer/web/chat-display.ts", "../../../plugins/ragents.overseer/web/quick-answers.ts", "../../../plugins/ragents.overseer/web/index.tsx"],
4
- "sourcesContent": ["export const read = (specifier, name) => {\n const module = globalThis[\"__ragentsHostModules\"]?.[specifier];\n if (module === undefined) throw new Error(`The host does not provide ${specifier}`);\n if (!(name in module)) throw new Error(`The host does not provide ${name} from ${specifier}; the bundle was built against a newer host`);\n return module[name];\n};", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/AccessContext\", \"useAccess\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Button\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Dialog\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogDescription\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogFooter\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogHeader\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Popover\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"PopoverContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Select\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectItem\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectTrigger\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectValue\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui/dialog\", \"RunModalContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createElement\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"forwardRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useCallback\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useMemo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useState\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useSyncExternalStore\");\n", "/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string?.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n", "import { toKebabCase } from './toKebabCase';\nimport type { LucideIconData, LucideIconNode } from '../build/types';\n\n/**\n * Converts legacy `(name, iconNode, aliases?)` icon arguments into icon data object format.\n */\nexport function toLucideIconData(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases: string[] = [],\n): LucideIconData {\n if (iconNode == null) {\n throw new Error('[lucide]: iconNode is required when icon name is used');\n }\n\n return {\n name: toKebabCase(iconName),\n size: 24,\n node: iconNode,\n ...(aliases.length > 0 ? { aliases } : {}),\n };\n}\n", "/**\n * Converts string to camel case\n *\n * @param {string} string\n * @returns {string} A camelized string\n */\nexport const toCamelCase = <T extends string>(string: T) => {\n let out = '';\n let upperNext = false;\n\n for (const ch of string) {\n if (ch === '-' || ch === '_' || ch <= ' ') {\n upperNext = out.length > 0;\n continue;\n }\n\n if (out.length === 0) {\n out += ch.toLowerCase();\n } else {\n out += upperNext ? ch.toUpperCase() : ch;\n }\n\n upperNext = false;\n }\n\n return out as string;\n};\n", "import { CamelToPascal } from '../utility-types';\nimport { toCamelCase } from './toCamelCase';\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = toCamelCase(string);\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n", "/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return (\n Boolean(className) &&\n (className as string).trim() !== '' &&\n array.indexOf(className) === index\n );\n })\n .join(' ')\n .trim();\n", "const defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n} as const;\n\nexport default defaultAttributes;\n", "import type { LucideBuildParams, LucideIconData, LucideIconNode, SVGProps } from './types';\nimport defaultAttributes from './defaultAttributes';\nimport { mergeClasses } from '../utils/mergeClasses';\n\nfunction isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Creates a Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconNode(icon: LucideIconData, params: LucideBuildParams = {}): LucideIconNode {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName: string) =>\n attributeNames[attributeName] ?? attributeName;\n\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes['width'];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes['height'];\n const aliasClassNames =\n icon.aliases\n ?.filter((alias: string): alias is string => typeof alias === 'string' && alias.trim() !== '')\n .map((alias: string) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...(icon.name ? [`lucide-${icon.name}`] : []), ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(' ').filter(Boolean) ?? [];\n const className =\n params.includeDefaultClasses === false\n ? mergeClasses(...classNamesFromClassName)\n : mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);\n\n const calculatedStrokeWidth = params.absoluteStrokeWidth\n ? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *\n Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /\n Number(params.size ?? params.width ?? defaultAttributes['width'])\n : (params.strokeWidth ?? defaultAttributes['stroke-width']);\n\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {} as SVGProps),\n ...('color' in params &&\n params.color && {\n [getAttributeName('stroke')]: params.color,\n }),\n ...('size' in params &&\n isDefined(params.size) && {\n [getAttributeName('width')]: params.size,\n [getAttributeName('height')]: params.size,\n }),\n ...('width' in params &&\n isDefined(params.width) && {\n [getAttributeName('width')]: params.width,\n }),\n ...('height' in params &&\n isDefined(params.height) && {\n [getAttributeName('height')]: params.height,\n }),\n [getAttributeName('stroke-width')]: calculatedStrokeWidth,\n ...(className && {\n [getAttributeName('class')]: className,\n }),\n [getAttributeName('viewBox')]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...(params.hasA11yProp === false\n ? {\n [getAttributeName('aria-hidden')]: 'true',\n }\n : {}),\n ...('attributes' in params && params.attributes),\n };\n\n return [\n 'svg',\n attributes,\n icon.node.map((child): LucideIconNode => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke\n ? { [getAttributeName('vector-effect')]: 'non-scaling-stroke', ...attrs }\n : attrs;\n\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n }),\n ];\n}\n\nexport default buildLucideIconNode;\n", "import buildLucideIconNode from './buildLucideIconNode';\nimport type { LucideBuildParams, LucideIconData, LucideIconNode } from './types';\n\n/**\n * Creates a React-compatible Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconForReact(\n icon: LucideIconData,\n params: LucideBuildParams = {},\n): LucideIconNode {\n return buildLucideIconNode(icon, {\n ...params,\n attributeNames: {\n ...params.attributeNames,\n class: 'className',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'vector-effect': 'vectorEffect',\n },\n });\n}\n\nexport default buildLucideIconForReact;\n", "/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props: object) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n\n return false;\n};\n", "'use client';\n\nimport { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';\nimport { LucideProps } from './types';\n\ntype LucideConfig = {\n size: number;\n color: string;\n strokeWidth: number;\n /**\n * @deprecated Use `nonScalingStroke` instead.\n */\n absoluteStrokeWidth: boolean;\n nonScalingStroke: boolean;\n className: string;\n};\n\nconst LucideContext = createContext<LucideProps>({});\n\ntype LucideProviderProps = {\n children: ReactNode;\n} & Partial<LucideConfig>;\n\nexport function LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n}: LucideProviderProps) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className],\n );\n\n return createElement(LucideContext.Provider, { value }, children);\n}\n\nexport const useLucideContext = () => useContext(LucideContext);\n", "'use client';\n\nimport { createElement, forwardRef } from 'react';\nimport { buildLucideIconForReact, hasA11yProp, mergeClasses } from '@lucide/shared';\nimport { LucideIconData, LucideIconNode, LucideProps } from './types';\nimport { useLucideContext } from './context';\n\ntype IconComponentProps = LucideProps &\n (\n | {\n iconNode: LucideIconNode[];\n icon?: never;\n }\n | {\n icon: LucideIconData;\n iconNode?: never;\n }\n );\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {boolean} props.nonScalingStroke - Whether to use non scaling strokes\n * @param {string} props.className - The class name of the icon\n * @param {LucideIconNode[]} props.children - The children of the icon\n * @param {LucideIconNode[]} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color,\n size,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className = '',\n children,\n iconNode = [],\n icon = {\n node: iconNode,\n aliases: [],\n size: 24,\n },\n ...rest\n },\n ref,\n ) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n nonScalingStroke: contextNonScalingStroke = false,\n color: contextColor = 'currentColor',\n className: contextClass = '',\n } = useLucideContext() ?? {};\n\n const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);\n\n const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {\n color: color ?? contextColor,\n width: width ?? size ?? contextSize,\n height: height ?? size ?? contextSize,\n strokeWidth: strokeWidth ?? contextStrokeWidth,\n absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,\n nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,\n className: mergeClasses(contextClass, className),\n hasA11yProp: hasAccessibleProp,\n attributes: rest,\n });\n\n return createElement(\n name,\n {\n ref,\n ...svgAttributes,\n },\n [\n ...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n", "import { createElement, forwardRef } from 'react';\nimport { toLucideIconData, toPascalCase } from '@lucide/shared';\nimport { LucideIcon, LucideIconData, LucideIconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Creates a Lucide icon component from icon data.\n *\n * @param icon Icon data object.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(icon: LucideIconData): LucideIcon;\n\n/**\n * Creates a Lucide icon component from the legacy icon arguments.\n *\n * @param iconName Icon name.\n * @param iconNode Icon node.\n * @param aliases Optional icon aliases.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases?: string[],\n): LucideIcon;\n\nfunction createLucideIcon(\n iconDataOrName: LucideIconData | string,\n iconNode: LucideIconNode[] = [],\n aliases: string[] = [],\n): LucideIcon {\n const iconData =\n typeof iconDataOrName === 'string'\n ? toLucideIconData(iconDataOrName, iconNode, aliases)\n : iconDataOrName;\n\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n icon: iconData,\n className,\n ...props,\n }),\n );\n\n if (iconData.name) {\n Component.displayName = toPascalCase(iconData.name);\n }\n\n return Component;\n}\n\nexport default createLucideIcon;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'x',\n size: 24,\n node: [\n ['path', { d: 'M18 6 6 18', key: '1bl5f8' }],\n ['path', { d: 'm6 6 12 12', key: 'd8bk6v' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst X = createLucideIcon(__iconData);\n\nexport default X;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"ChatInputToolbar\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"ChatMessages\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat/useChat\", \"useChat\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat/useAttachmentCapabilities\", \"useAttachmentCapabilities\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/PluginRegistry\", \"ChatStepsProvider\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat-view-settings\", \"ChatViewSwitches\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat-view-settings\", \"useChatViewSettings\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/toolLine\", \"withToolSummaries\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/rpc\", \"rpc\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/api\", \"interruptActorTurn\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/http/contracts\", \"runContracts\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runViewFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"typebox\", \"Type\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/rpc/contract\", \"defineOperation\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/domain/events\", \"eventTypeMap\");\n", "import { Type, type TSchema } from \"typebox\";\nimport { defineOperation } from \"@ragents/engine/src/rpc/contract\";\nimport { eventTypeMap, type EventType } from \"@ragents/engine/src/domain/events\";\n\nexport const OVERSEER_PLUGIN_ID = \"ragents.overseer\";\nexport const QUICK_ANSWER_MAX_LENGTH = 240;\n\nexport interface QuickAnswerState {\n kind: \"quick-answer\";\n question: string;\n text: string;\n}\n\nexport const overseerPermissions = [\n { id: \"ragents.overseer.read\", description: \"View the global coordinator and its model selection.\" },\n { id: \"ragents.overseer.write\", description: \"Give tasks to the global coordinator and reset its conversation.\" },\n] as const;\n\nexport interface OverseerModelSelection {\n provider: string;\n model: string;\n thinking: string;\n}\n\nexport interface OverseerSettings extends OverseerModelSelection {\n models: Array<{ id: string; provider: string; label: string; thinking: string[] }>;\n}\n\nconst object = <P extends Record<string, TSchema>>(properties: P) => Type.Object(properties, { additionalProperties: false });\nconst text = () => Type.String({ minLength: 1, pattern: \"\\\\S\" });\nconst empty = object({});\nconst jsonObject = Type.Record(Type.String(), Type.Any());\nconst eventType = Type.Unsafe<EventType>(Type.Union(Object.keys(eventTypeMap).map((name) => Type.Literal(name))));\nconst run = Type.String({ minLength: 1, maxLength: 512, description: \"Run ID, unique title or stable reference such as Run 1.\" });\nconst identityFields = { runId: Type.String(), title: Type.String(), reference: Type.String() };\nconst runSummary = object({ ...identityFields, createdAt: Type.Optional(Type.Number()), updatedAt: Type.Number(), running: Type.Optional(Type.Boolean()), metadata: Type.Optional(jsonObject) });\nconst accepted = object({ ...identityFields, accepted: Type.Literal(true) });\nconst commonStart = { title: text(), options: Type.Optional(jsonObject) };\nconst createInput = Type.Union([\n object({ ...commonStart, message: text() }),\n object({ ...commonStart, script: text(), input: Type.Optional(Type.Any()) }),\n object({ ...commonStart, packageDirectory: Type.String({ minLength: 1, description: \"Absolute path of a RUN.md/setup.ts/tests.json package on the server. A local shell client inserts its actually existing package path; this is not an upload.\" }), input: Type.Optional(Type.Any()) }),\n]);\nconst domainObject = (name: string, source = \"packages/ragents/src/domain/model.ts\") => Type.Object({}, {\n additionalProperties: true, \"x-typescript-type\": name, \"x-source\": source,\n description: `Unabridged domain value ${name}; nested fields are deliberately an open JSON schema here.`,\n});\nconst eventSchema = object({\n eventId: Type.String(), runId: Type.String(), sequence: Type.Integer({ minimum: 1 }), schemaVersion: Type.Literal(3),\n occurredAt: Type.String(), actorId: Type.String(), commandId: Type.String(),\n correlationId: Type.Union([Type.String(), Type.Null()]), causationId: Type.Union([Type.String(), Type.Null()]),\n type: eventType, payload: domainObject(\"EventPayloads[EventType]\", \"packages/ragents/src/domain/events.ts\"),\n});\nconst viewSchema = object({\n id: Type.String(), revision: Type.Integer(), title: Type.String(), ownerId: Type.String(),\n primaryActorId: Type.Union([Type.String(), Type.Null()]), createdAt: Type.String(),\n forkedFrom: Type.Union([object({ runId: Type.String(), sequence: Type.Integer() }), Type.Null()]),\n actors: Type.Array(domainObject(\"Actor\")), inputs: Type.Array(domainObject(\"ActorInput\")), turns: Type.Array(domainObject(\"Turn\")),\n subscriptions: Type.Array(domainObject(\"EventSubscription\")), pluginStates: Type.Array(domainObject(\"PluginState\")),\n actions: Type.Array(domainObject(\"Action\")), artifacts: Type.Array(domainObject(\"Artifact\")),\n});\nconst modelSelection = object({ provider: text(), model: text(), thinking: text() });\nconst settingsResult = object({\n provider: Type.String(), model: Type.String(), thinking: Type.String(),\n models: Type.Array(object({ id: Type.String(), provider: Type.String(), label: Type.String(), thinking: Type.Array(Type.String()) })),\n});\n\n/** Run management, model selection and conversation reset of the global coordinator. */\nexport const overseerContracts = {\n listRuns: defineOperation({\n id: \"ragents.overseer.listRuns\",\n description: \"List the runs the caller sees, with stable references; the global coordinators are not part of this list.\",\n rights: [\"runs.read\"],\n input: empty,\n result: Type.Array(runSummary),\n }),\n createRun: defineOperation({\n id: \"ragents.overseer.createRun\",\n description: \"Create a run with a server-side ID and title. Exactly one start form: message, installed script (id or unique title), or packageDirectory (existing local run script package). input is only allowed with script/packageDirectory. options selects start options such as ragents.startOptions.select, each only with its own rights. The result waits for preparation, check, test and installation; accepted does not yet confirm a finished model result.\",\n rights: [\"runs.read\", \"runs.write\", \"runs.create\"],\n input: createInput,\n result: accepted,\n }),\n readRun: defineOperation({\n id: \"ragents.overseer.readRun\",\n description: \"Read the current unabridged RunView; nested domain values are documented as open JSON objects.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: object({ run }),\n result: viewSchema,\n }),\n readEvents: defineOperation({\n id: \"ragents.overseer.readEvents\",\n description: \"Read the complete journal page by page in sequence order. As long as hasMore is true, use nextAfter as after of the next request. type filters an exact event type.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: object({\n run,\n after: Type.Optional(Type.Integer({ minimum: 0, default: 0 })),\n limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 200, default: 50 })),\n type: Type.Optional(eventType),\n }),\n result: object({ ...identityFields, events: Type.Array(eventSchema), nextAfter: Type.Integer({ minimum: 0 }), hasMore: Type.Boolean() }),\n }),\n sendMessage: defineOperation({\n id: \"ragents.overseer.sendMessage\",\n description: \"Enqueue a chat message for the primary LLM actor; TypeScript as primary is rejected with actor-chat-unsupported. The result only confirms the enqueueing, neither processing nor completion. A running turn is not replaced by it.\",\n rights: [\"runs.read\", \"runs.write\"],\n input: object({ run, message: text() }),\n result: accepted,\n }),\n stopRun: defineOperation({\n id: \"ragents.overseer.stopRun\",\n description: \"Stop the run through its normal stop boundary and wait for the cleanup; the conversation is kept.\",\n rights: [\"runs.read\", \"runs.write\"],\n input: object({ run }),\n result: object({ ...identityFields, stopped: Type.Literal(true) }),\n }),\n readCatalog: defineOperation({\n id: \"ragents.overseer.readCatalog\",\n description: \"Read installed templates and start options with input schemas, default values and selectability. createRun starts messages, installed scripts or local packages via packageDirectory. Skills provide editable tasks for message; name the skill as the work instruction.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: empty,\n result: object({\n entries: Type.Array(Type.Object({ id: Type.String(), title: Type.String(), description: Type.String(), action: Type.Union([Type.Literal(\"skill\"), Type.Literal(\"script\")]) }, { additionalProperties: true, \"x-typescript-type\": \"PublicStartEntry\" })),\n options: Type.Array(object({ id: Type.String(), schema: jsonObject, value: Type.Any(), selectable: Type.Boolean(), presentation: Type.Any() })),\n }),\n }),\n readReference: defineOperation({\n id: \"ragents.overseer.readReference\",\n description: \"Read a readable reference of all registered methods and channels directly from their contracts.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: empty,\n result: Type.String(),\n }),\n readOpenRpc: defineOperation({\n id: \"ragents.overseer.readOpenRpc\",\n description: \"Read OpenRPC 1.3 directly from the same contracts.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: empty,\n result: jsonObject,\n }),\n settings: {\n read: defineOperation({\n id: \"ragents.overseer.settings.read\",\n description: \"Read the global coordinator's model selection with the available model catalog.\",\n rights: [\"ragents.overseer.read\"],\n input: empty,\n result: settingsResult,\n }),\n save: defineOperation({\n id: \"ragents.overseer.settings.save\",\n description: \"Set the global coordinator's model selection; it applies from the next answer on.\",\n rights: [\"ragents.overseer.read\", \"ragents.overseer.write\", \"settings.write\"],\n input: modelSelection,\n result: settingsResult,\n }),\n },\n coordinator: defineOperation({\n id: \"ragents.overseer.coordinator\",\n description: \"Read the run ID of your own global coordinator: one per signed-in user, exactly one without sign-in.\",\n rights: [\"ragents.overseer.read\"],\n input: empty,\n result: object({ runId: Type.String() }),\n }),\n reset: defineOperation({\n id: \"ragents.overseer.reset\",\n description: \"Reset the conversation of your own global coordinator including its model context; the model selection, other users' coordinators and all runs are kept.\",\n rights: [\"ragents.overseer.read\", \"ragents.overseer.write\"],\n input: object({ confirm: Type.Literal(true, { description: \"The conversation reset must be confirmed explicitly.\" }) }),\n result: Type.Null(),\n }),\n} as const;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/lib/labels\", \"thinkingLabel\");\n", "import { rpc } from \"@ragents/web/rpc\";\nimport { overseerContracts, type OverseerModelSelection, type OverseerSettings } from \"../contract\";\n\ntype SettingsState =\n | { status: \"loading\"; settings?: undefined; error?: undefined }\n | { status: \"failed\"; settings?: undefined; error: string }\n | { status: \"ready\" | \"saving\"; settings: OverseerSettings; error?: string };\n\nexport interface ModelSettingsApi {\n read: () => Promise<OverseerSettings>;\n save: (selection: OverseerModelSelection) => Promise<OverseerSettings>;\n}\n\nconst rpcApi: ModelSettingsApi = {\n read: () => rpc.call(overseerContracts.settings.read, {}),\n save: (selection) => rpc.call(overseerContracts.settings.save, selection),\n};\n\nexport function createModelSettingsStore(api: ModelSettingsApi = rpcApi) {\n let state: SettingsState = { status: \"loading\" };\n let revision = 0;\n let loading: Promise<void> | undefined;\n const listeners = new Set<() => void>();\n const publish = (next: SettingsState) => {\n state = next;\n for (const listener of listeners) listener();\n };\n const failure = (cause: unknown) => {\n const error = cause instanceof Error ? cause.message : String(cause);\n publish(state.settings ? { status: \"ready\", settings: state.settings, error } : { status: \"failed\", error });\n };\n const load = (): Promise<void> => {\n if (loading) return loading;\n if (state.status === \"saving\") return Promise.resolve();\n const started = revision;\n if (!state.settings) publish({ status: \"loading\" });\n loading = api.read().then((settings) => {\n if (revision === started) publish({ status: \"ready\", settings });\n }).catch((cause: unknown) => {\n if (revision === started) failure(cause);\n }).finally(() => { loading = undefined; });\n return loading;\n };\n const save = async (selection: OverseerModelSelection): Promise<void> => {\n if (!state.settings || state.status === \"saving\") throw new Error(\"Wait until the settings are ready\");\n revision += 1;\n publish({ status: \"saving\", settings: state.settings });\n try {\n publish({ status: \"ready\", settings: await api.save(selection) });\n } catch (cause) {\n failure(cause);\n throw cause;\n }\n };\n return { read: () => state, load, save, subscribe: (listener: () => void) => {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n } };\n}\n\nexport const modelSettingsStore = createModelSettingsStore();\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"Fragment\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsx\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsxs\");\n", "import { useAccess } from \"@ragents/web/AccessContext\";\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"@ragents/web/ui\";\nimport { useEffect, useSyncExternalStore, type ReactNode } from \"react\";\nimport { thinkingLabel } from \"@ragents/web/lib/labels\";\nimport { modelSettingsStore } from \"./model-settings\";\nimport type { OverseerModelSelection } from \"../contract\";\n\nexport function useModelSettings(active = true) {\n const state = useSyncExternalStore(modelSettingsStore.subscribe, modelSettingsStore.read);\n useEffect(() => { if (active) void modelSettingsStore.load(); }, [active]);\n return state;\n}\n\nconst selectionKey = (provider: string, model: string) => JSON.stringify([provider, model]);\n\nconst noteClass = \"mt-2 text-[0.73rem] text-muted-foreground\";\nconst errorClass = \"mt-2 flex flex-wrap items-center gap-2 text-[0.8rem] text-destructive\";\nconst triggerClass = \"min-w-0 max-w-[min(320px,100%)]\";\n\nexport function ModelSettings({ active = true, compact = false, disabled = false, actions }: { active?: boolean; compact?: boolean; disabled?: boolean; actions?: ReactNode }) {\n const access = useAccess();\n const readable = access.can(\"ragents.overseer.read\");\n const writable = access.can(\"ragents.overseer.write\") && access.can(\"settings.write\");\n const state = useModelSettings(active && readable);\n const settings = state.settings;\n const model = settings?.models.find((entry) => entry.id === settings.model && entry.provider === settings.provider);\n const save = (selection: OverseerModelSelection) => { void modelSettingsStore.save(selection).catch(() => {}); };\n const modelOptions = settings?.models.map((entry) => ({ value: selectionKey(entry.provider, entry.id), label: entry.label })) ?? [];\n const thinkingOptions = model?.thinking.map((level) => ({ value: level, label: thinkingLabel(level) })) ?? [];\n if (!readable) return null;\n return (\n <section aria-label=\"Model of the global coordinator\" className={compact ? \"min-w-0 flex-1\" : \"min-w-0\"}>\n <div className={compact ? \"flex flex-nowrap items-center gap-2 max-md:gap-1\" : \"flex flex-wrap items-center gap-2.5\"}>\n {settings && model ? <>\n <Select\n disabled={!writable || disabled || state.status === \"saving\"}\n items={modelOptions}\n value={selectionKey(settings.provider, settings.model)}\n onValueChange={(key) => {\n const next = settings.models.find((entry) => selectionKey(entry.provider, entry.id) === key);\n if (!next) throw new Error(\"The selected model is no longer available\");\n const thinking = next.thinking.includes(settings.thinking) ? settings.thinking : next.thinking[0];\n if (!thinking) throw new Error(\"No reasoning level is configured for the model\");\n save({ provider: next.provider, model: next.id, thinking });\n }}\n >\n <SelectTrigger aria-label=\"Model\" className={`${triggerClass} ${compact ? \"flex-1\" : \"flex-[0_1_auto]\"}`} size={compact ? \"sm\" : \"default\"}><SelectValue /></SelectTrigger>\n <SelectContent>{modelOptions.map((option) => <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>)}</SelectContent>\n </Select>\n <Select\n disabled={!writable || disabled || state.status === \"saving\" || model.thinking.length < 2}\n items={thinkingOptions}\n value={settings.thinking}\n onValueChange={(thinking) => { if (thinking !== null) save({ provider: settings.provider, model: settings.model, thinking }); }}\n >\n <SelectTrigger aria-label={compact ? \"Reasoning\" : \"Reasoning level\"} className={`${triggerClass} flex-none`} size={compact ? \"sm\" : \"default\"}><SelectValue /></SelectTrigger>\n <SelectContent>{thinkingOptions.map((option) => <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>)}</SelectContent>\n </Select>\n </> : state.status === \"loading\" ? <p className={`${noteClass} min-w-0 flex-[0_1_auto]`} role=\"status\">Loading models ...</p>\n : !state.error && <p className={`${errorClass} min-w-0 flex-[0_1_auto]`} role=\"alert\">The stored model is missing from the model catalog.</p>}\n {actions && <div className=\"ml-auto flex-none\">{actions}</div>}\n </div>\n {settings && model && (!compact || state.status === \"saving\") && <p className={noteClass} role=\"status\">{state.status === \"saving\" ? \"Saving ...\" : \"Applies from the next answer on. The conversation history is kept.\"}</p>}\n {state.error && <div className={errorClass} role=\"alert\">\n <span>{state.error}</span>\n <Button onClick={() => { void modelSettingsStore.load(); }} variant=\"outline\">Reload</Button>\n </div>}\n </section>\n );\n}\n", "import type { ChatDisplayPolicy } from \"@ragents/web/PluginRegistry\";\n\nexport const overseerChatStorageKeyPrefix = \"ragents.overseer.chat-steps\";\n\nexport const overseerChatDisplayPolicy: ChatDisplayPolicy = {\n modes: { coordinator: \"grouped\", agents: \"grouped\" },\n stepsVisible: true,\n stepsExpandable: true,\n selectable: true,\n};\n", "import type { ChatEvent } from \"quassel/events\";\nimport { OVERSEER_PLUGIN_ID, QUICK_ANSWER_MAX_LENGTH } from \"../contract\";\n\nexport interface QuickAnswerNotice {\n id: string;\n question: string;\n text: string;\n}\n\nconst validText = (value: unknown): value is string => typeof value === \"string\" && !!value.trim()\n && value.length <= QUICK_ANSWER_MAX_LENGTH && !/[\\r\\n]/.test(value);\n\nexport function createQuickAnswers() {\n let conversationId: string | null | undefined;\n let initialized = false;\n let replaying = true;\n let seenSequence = 0;\n let replaySequence = 0;\n let pending: QuickAnswerNotice | undefined;\n return {\n event(event: ChatEvent): QuickAnswerNotice | undefined {\n if (event.kind === \"reset\") {\n if (event.reason === \"conversation-reset\" || (conversationId != null && conversationId !== event.conversationId)) {\n seenSequence = 0;\n initialized = true;\n }\n conversationId = event.conversationId;\n replaying = true;\n replaySequence = seenSequence;\n pending = undefined;\n }\n if (event.kind === \"replay-end\") {\n conversationId = event.conversationId;\n replaying = false;\n seenSequence = replaySequence;\n const notice = initialized ? pending : undefined;\n initialized = true;\n pending = undefined;\n return notice;\n }\n if (event.kind !== \"plugin\" || event.pluginId !== OVERSEER_PLUGIN_ID || event.type !== \"state-replaced\") return;\n const payload = event.payload;\n if (!payload || typeof payload !== \"object\" || !(\"state\" in payload)) return;\n if (!(\"scope\" in payload) || !payload.scope || typeof payload.scope !== \"object\"\n || !(\"kind\" in payload.scope) || payload.scope.kind !== \"run\") return;\n const state = payload.state;\n if (!state || typeof state !== \"object\" || !(\"kind\" in state) || state.kind !== \"quick-answer\") return;\n if (!event.journal || !event.journal.eventId?.trim() || !event.journal.conversationId?.trim()\n || !Number.isSafeInteger(event.journal.sequence) || event.journal.sequence <= 0) {\n throw new Error(\"The journal position of the quick answer is invalid.\");\n }\n if (conversationId != null && conversationId !== event.journal.conversationId) return;\n conversationId = event.journal.conversationId;\n if (event.journal.sequence <= (replaying ? replaySequence : seenSequence)) return;\n if (replaying && !initialized) { replaySequence = event.journal.sequence; return; }\n const question = \"question\" in state ? state.question : undefined;\n const text = \"text\" in state ? state.text : undefined;\n if (!validText(question) || !validText(text)) throw new Error(\"The quick question or quick answer is invalid.\");\n const notice = { id: event.journal.eventId, question, text };\n if (replaying) { replaySequence = event.journal.sequence; pending = notice; }\n else { seenSequence = event.journal.sequence; return notice; }\n },\n };\n}\n", "import { useAccess } from \"@ragents/web/AccessContext\";\nimport { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Popover, PopoverContent } from \"@ragents/web/ui\";\nimport { RunModalContext } from \"@ragents/web/ui/dialog\";\nimport { XIcon } from \"lucide-react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { ChatMessages, ChatInputToolbar, type ChatInputHandle, type ChatEvent } from \"quassel\";\nimport { useChat } from \"@ragents/web/chat/useChat\";\nimport { useAttachmentCapabilities } from \"@ragents/web/chat/useAttachmentCapabilities\";\nimport { ChatStepsProvider, type OverviewPanelContext, type WebPlugin } from \"@ragents/web/PluginRegistry\";\nimport { ChatViewSwitches, useChatViewSettings } from \"@ragents/web/chat-view-settings\";\nimport { withToolSummaries } from \"@ragents/web/toolLine\";\nimport { rpc } from \"@ragents/web/rpc\";\nimport { interruptActorTurn } from \"@ragents/web/api\";\nimport { runContracts } from \"@ragents/engine/src/http/contracts\";\nimport { runViewFrom } from \"@ragents/web/run-view\";\nimport { OVERSEER_PLUGIN_ID, overseerContracts } from \"../contract\";\nimport { ModelSettings, useModelSettings } from \"./ModelSettings\";\nimport { overseerChatDisplayPolicy, overseerChatStorageKeyPrefix } from \"./chat-display\";\nimport { createQuickAnswers, type QuickAnswerNotice } from \"./quick-answers\";\n\nconst toolbarClass = \"flex h-header max-w-[720px] min-w-[190px] flex-[0_1_570px] items-center gap-1 border-r border-border bg-[color-mix(in_srgb,var(--primary)_4%,var(--card))] px-2 py-1 data-open:bg-accent max-md:min-w-[130px] max-md:flex-[0_1_210px] max-md:px-1 max-md:data-open:grow\";\nconst noteClass = \"mx-4 my-2 flex-none text-[0.8rem] text-muted-foreground\";\n\n/** Interrupts only the coordinator's running turn; the run and its other actors keep running. */\nconst interruptCoordinator = async (runId: string) => {\n const coordinator = runViewFrom(await rpc.call(runContracts.view, { runId }))?.primaryActorId;\n if (!coordinator) throw new Error(\"The global coordinator is not available\");\n await interruptActorTurn(runId, coordinator);\n};\nconst errorClass = \"mx-4 my-2 flex-none text-[0.8rem] text-destructive\";\n\n/** Every user has their own coordinator; only the server knows its id. */\nfunction OverseerToolbar(context: OverviewPanelContext) {\n const user = useAccess().user?.id;\n const [coordinator, setCoordinator] = useState<{ runId?: string; error?: string }>({});\n useEffect(() => {\n let current = true;\n setCoordinator({});\n rpc.call(overseerContracts.coordinator, {}).then(\n ({ runId }) => { if (current) setCoordinator({ runId }); },\n (cause: unknown) => { if (current) setCoordinator({ error: cause instanceof Error ? cause.message : String(cause) }); },\n );\n return () => { current = false; };\n }, [user]);\n if (!coordinator.runId) {\n return <div className={toolbarClass} data-slot=\"overseer-toolbar\" role=\"status\">\n {coordinator.error && <span className=\"text-[0.7rem] font-bold text-destructive\" title={coordinator.error} aria-label={coordinator.error}>!</span>}\n </div>;\n }\n return <ChatStepsProvider policy={overseerChatDisplayPolicy} storageKeyPrefix={overseerChatStorageKeyPrefix}>\n <OverseerConversation key={coordinator.runId} {...context} runId={coordinator.runId} />\n </ChatStepsProvider>;\n}\n\nfunction OverseerConversation({ open, onOpen, onClose, onBusy, userLocation, runId }: OverviewPanelContext & { runId: string }) {\n const writable = useAccess().can(\"ragents.overseer.write\");\n const [activated, setActivated] = useState(false);\n const [confirmReset, setConfirmReset] = useState(false);\n const [resetting, setResetting] = useState(false);\n const resetPending = useRef(false);\n const resetObserved = useRef(false);\n const composer = useRef<ChatInputHandle>(null);\n const anchor = useRef<HTMLDivElement>(null);\n const dropdown = useRef<HTMLElement>(null);\n const suppressFocus = useRef(false);\n const [detailsContainer, setDetailsContainer] = useState<HTMLDivElement | null>(null);\n const [scroller, setScroller] = useState<HTMLDivElement | null>(null);\n const conversationId = useRef<string | null | undefined>(undefined);\n const [dialogContainer, setDialogContainer] = useState<HTMLElement | null>(null);\n const cancelReset = useRef<HTMLButtonElement>(null);\n const setDropdown = useCallback((element: HTMLElement | null) => { dropdown.current = element; setDialogContainer(element); }, []);\n const [quickAnswers] = useState(createQuickAnswers);\n const [quickAnswer, setQuickAnswer] = useState<QuickAnswerNotice>();\n const panelOpen = useRef(open);\n panelOpen.current = open;\n const [error, setError] = useState<string>();\n const [composerError, setComposerError] = useState<string>();\n const clearConversation = useCallback(() => {\n composer.current?.reset();\n setConfirmReset(false);\n setError(undefined);\n setQuickAnswer(undefined);\n }, []);\n const onEvent = useCallback((event: ChatEvent) => {\n const notice = quickAnswers.event(event);\n if (event.kind === \"reset\") {\n if (event.reason === \"conversation-reset\" || (conversationId.current != null && conversationId.current !== event.conversationId)) {\n if (resetPending.current) resetObserved.current = true;\n clearConversation();\n }\n conversationId.current = event.conversationId;\n }\n if (event.kind === \"replay-end\") conversationId.current = event.conversationId;\n if (notice && !panelOpen.current) setQuickAnswer(notice);\n }, [clearConversation, quickAnswers]);\n const chat = useChat(runId, onEvent, activated);\n const chatView = useChatViewSettings(runId, \"primary\", \"coordinator\");\n const modelState = useModelSettings(open);\n const attachments = useAttachmentCapabilities(runId, \"primary\", JSON.stringify(modelState.settings && [modelState.settings.provider, modelState.settings.model]));\n const messages = useMemo(() => withToolSummaries(chat.messages), [chat.messages]);\n const requestOpen = () => { suppressFocus.current = false; setQuickAnswer(undefined); onOpen(); };\n useEffect(() => { if (open) { setActivated(true); setQuickAnswer(undefined); } }, [open]);\n useEffect(() => onBusy(chat.running), [chat.running, onBusy]);\n const belowHeader = useCallback(() => {\n const element = anchor.current;\n if (!element) return null;\n const boundary = element.closest(\"header\") ?? element;\n return { contextElement: element, getBoundingClientRect: () => {\n const bounds = element.getBoundingClientRect();\n return new DOMRect(bounds.left, boundary.getBoundingClientRect().bottom, bounds.width, 0);\n } };\n }, []);\n const dismiss = (reason: string, event: Event) => {\n if (confirmReset) return;\n if (reason === \"outside-press\") {\n if (event.target instanceof Node && anchor.current?.contains(event.target)) return;\n onClose();\n return;\n }\n if (reason !== \"escape-key\") return;\n suppressFocus.current = !(document.activeElement instanceof HTMLTextAreaElement && anchor.current?.contains(document.activeElement));\n onClose();\n composer.current?.focus();\n };\n\n const perform = (work: () => Promise<void>) => {\n setError(undefined);\n void work().catch((cause: unknown) => setError(cause instanceof Error ? cause.message : String(cause)));\n };\n const reset = async () => {\n if (resetPending.current) return;\n resetPending.current = true;\n resetObserved.current = false;\n setResetting(true);\n setError(undefined);\n try {\n await rpc.call(overseerContracts.reset, { confirm: true });\n clearConversation();\n } catch (cause) {\n if (!resetObserved.current) setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n resetPending.current = false;\n setResetting(false);\n }\n };\n const connectionNote = activated && !chat.connected ? \"No connection. Your draft is kept; sending is disabled.\" : undefined;\n const problem = error ?? composerError ?? modelState.error ?? connectionNote;\n return <div className={toolbarClass} data-open={open} data-slot=\"overseer-toolbar\" ref={anchor}\n onFocus={(event) => {\n if (!(event.target instanceof HTMLTextAreaElement)) return;\n if (suppressFocus.current) suppressFocus.current = false;\n else onOpen();\n }}\n onKeyDown={(event) => {\n if (event.defaultPrevented) return;\n if (!open && event.target instanceof HTMLTextAreaElement && (event.key.length === 1 || event.key === \"Enter\")) requestOpen();\n }}>\n <div className=\"min-w-0 flex-1\" onClick={(event) => { if (event.target instanceof HTMLTextAreaElement) requestOpen(); }}>\n <ChatInputToolbar {...attachments} detailsContainer={detailsContainer} layout=\"toolbar\" handleRef={composer}\n inputAriaControls=\"overseer-dropdown\"\n disabled={!writable || resetting || confirmReset} sendDisabled={!chat.connected || modelState.status === \"saving\" || resetting}\n maxRows={2} rows={1} onErrorChange={setComposerError} onSend={(text, attachments) => chat.send(text, attachments, userLocation)}\n onStop={writable && chat.running ? () => { if (!resetPending.current) perform(() => interruptCoordinator(runId)); } : undefined}\n running={chat.running}\n texts={{ placeholder: \"Global coordinator\", steeringPlaceholder: \"Global coordinator\" }}\n toolbarRight={<ModelSettings active={open} compact disabled={resetting} actions={\n <Button aria-label=\"Reset conversation\" aria-busy={resetting} disabled={!writable || resetting || !chat.connected} onClick={() => setConfirmReset(true)} size=\"sm\" variant=\"outline\">\n {resetting ? \"Resetting ...\" : \"Reset\"}\n </Button>\n } />}\n toolbarLeft={<ChatViewSwitches className=\"max-md:[&>span]:hidden\" settings={chatView} />}\n />\n </div>\n <span className=\"flex min-w-0 flex-none items-center justify-end gap-1.5 empty:hidden\" role=\"status\" aria-live=\"polite\">\n {chat.running && <span className=\"sr-only\">Working</span>}\n {problem && <span className=\"text-[0.7rem] font-bold text-destructive\" title={problem} aria-label={problem}>!</span>}\n </span>\n <Popover modal={false} open={quickAnswer !== undefined}>\n <PopoverContent align=\"start\" anchor={belowHeader} aria-atomic=\"true\" aria-live=\"polite\" className=\"flex max-w-[calc(100vw-16px)] flex-row items-start gap-1 p-1.5 text-[0.76rem]\" collisionPadding={8}\n finalFocus={false} initialFocus={false} role=\"status\" side=\"bottom\"\n style={{ width: \"min(max(calc(var(--anchor-width) * 2), 480px), var(--available-width))\" }}>\n {quickAnswer && <>\n <Button className=\"h-auto min-w-0 flex-1 justify-start rounded-lg px-2.5 py-2 text-left text-[0.76rem] leading-[1.45] font-normal whitespace-normal [overflow-wrap:anywhere]\" variant=\"ghost\" aria-label={`Open history: ${quickAnswer.question} ${quickAnswer.text}`}\n onClick={() => {\n requestOpen();\n if (writable) composer.current?.focus();\n else requestAnimationFrame(() => scroller?.focus());\n }}><span className=\"grid min-w-0 gap-1\"><span className=\"text-muted-foreground\">{quickAnswer.question}</span><strong className=\"font-semibold\">{quickAnswer.text}</strong></span></Button>\n <Button aria-label=\"Close quick answer\" className=\"mt-1 flex-none rounded-full\" onClick={() => setQuickAnswer(undefined)} size=\"icon-sm\" title=\"Close quick answer\" variant=\"ghost\"><XIcon /></Button>\n </>}\n </PopoverContent>\n </Popover>\n <Popover modal={false} open={open} onOpenChange={(next, details) => { if (!next) dismiss(details.reason, details.event); }}>\n <PopoverContent align=\"start\" anchor={belowHeader} aria-label=\"Global coordinator\" className=\"flex min-h-0 flex-col gap-0 overflow-hidden rounded-t-none rounded-b-panel border-t-2 border-t-primary p-0\" collisionPadding={8}\n finalFocus={false} id=\"overseer-dropdown\" initialFocus={false} keepMounted ref={setDropdown} role=\"region\" side=\"bottom\"\n style={{ width: \"min(760px, var(--available-width))\", height: \"min(650px, var(--available-height))\" }}>\n <div className=\"flex-none border-b border-border-soft\" data-tone=\"overseer-details\" ref={setDetailsContainer} />\n {confirmReset && dialogContainer && <RunModalContext.Provider value={dialogContainer}>\n <Dialog open onOpenChange={(next) => { if (!next && !resetting) setConfirmReset(false); }} modal=\"trap-focus\" disablePointerDismissal>\n <DialogContent initialFocus={cancelReset} onBackdropClick={() => { if (!resetting) setConfirmReset(false); }} scope=\"run\" showCloseButton={false} size=\"small\">\n <DialogHeader>\n <DialogTitle>Reset conversation?</DialogTitle>\n <DialogDescription>History and model context are deleted. Running answers are stopped.</DialogDescription>\n </DialogHeader>\n <p>Your runs and the model choice are kept.</p>\n {error && <p className=\"text-[0.8rem] text-destructive\" role=\"alert\">{error}</p>}\n <DialogFooter>\n <Button ref={cancelReset} disabled={resetting} onClick={() => setConfirmReset(false)} variant=\"outline\">Cancel</Button>\n <Button disabled={resetting} onClick={() => { void reset(); }} variant=\"destructive\">\n {resetting ? \"Resetting ...\" : \"Reset conversation\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </RunModalContext.Provider>}\n {!writable && <p className={noteClass}>You have read access to this conversation.</p>}\n {connectionNote && <p className={noteClass} role=\"status\">{connectionNote}</p>}\n {error && <p className={errorClass} role=\"alert\">{error}</p>}\n <ChatMessages announce={false} className=\"min-h-16! flex-1\" scrollerRef={setScroller}\n detailMode={chatView.detailMode}\n emptyState={<div className=\"m-auto max-w-[480px] p-8 text-[0.9rem] leading-[1.6] text-muted-foreground max-md:p-5\"><strong className=\"text-foreground\">One chat for the whole workshop</strong><p>Write your task in the title bar above. Answers about your runs and ongoing work appear here.</p></div>}\n messages={messages} running={chat.running} showTimestamps={chatView.showTimestamps} stepsExpandable={chatView.stepsExpandable}\n />\n </PopoverContent>\n </Popover>\n </div>;\n}\n\nexport const webPlugin: WebPlugin = {\n id: OVERSEER_PLUGIN_ID,\n settings: [{ category: \"models\", order: 10, readRight: \"ragents.overseer.read\", id: `${OVERSEER_PLUGIN_ID}.model`, label: \"Global coordinator\", Settings: ModelSettings }],\n overviewPanels: [{ id: `${OVERSEER_PLUGIN_ID}.chat`, placement: \"toolbar\", order: 100, readRight: \"ragents.overseer.read\", Panel: OverseerToolbar }],\n};\n"],
5
- "mappings": "AAAO,IAAMA,EAAO,CAACC,EAAWC,IAAS,CACvC,IAAMC,EAAS,WAAW,uBAA0BF,CAAS,EAC7D,GAAIE,IAAW,OAAW,MAAM,IAAI,MAAM,6BAA6BF,CAAS,EAAE,EAClF,GAAI,EAAEC,KAAQC,GAAS,MAAM,IAAI,MAAM,6BAA6BD,CAAI,SAASD,CAAS,6CAA6C,EACvI,OAAOE,EAAOD,CAAI,CACpB,ECJA,IAAOE,EAAQC,EAAK,6BAA8B,WAAW,ECA7D,IAAOC,EAAQC,EAAK,kBAAmB,QAAQ,ECA/C,IAAOC,GAAQC,EAAK,kBAAmB,QAAQ,ECA/C,IAAOC,GAAQC,EAAK,kBAAmB,eAAe,ECAtD,IAAOC,GAAQC,EAAK,kBAAmB,mBAAmB,ECA1D,IAAOC,GAAQC,EAAK,kBAAmB,cAAc,ECArD,IAAOC,GAAQC,EAAK,kBAAmB,cAAc,ECArD,IAAOC,GAAQC,EAAK,kBAAmB,aAAa,ECApD,IAAOC,GAAQC,EAAK,kBAAmB,SAAS,ECAhD,IAAOC,GAAQC,EAAK,kBAAmB,gBAAgB,ECAvD,IAAOC,GAAQC,EAAK,kBAAmB,QAAQ,ECA/C,IAAOC,GAAQC,EAAK,kBAAmB,eAAe,ECAtD,IAAOC,GAAQC,EAAK,kBAAmB,YAAY,ECAnD,IAAOC,GAAQC,EAAK,kBAAmB,eAAe,ECAtD,IAAOC,GAAQC,EAAK,kBAAmB,aAAa,ECApD,IAAOC,GAAQC,EAAK,yBAA0B,iBAAiB,ECA/D,IAAOC,GAAQC,EAAK,QAAS,eAAe,ECA5C,IAAOC,EA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A,CAAkB,SAAU,MAAO,qBAAsB,SAAUlB,EAAc,CAAC,EACzK,eAAgB,CAAC,CAAE,GAAI,GAAGkB,CAAkB,QAAS,UAAW,UAAW,MAAO,IAAK,UAAW,wBAAyB,MAAOrG,EAAgB,CAAC,CACrJ",
6
- "names": ["read", "specifier", "name", "module", "AccessContext_useAccess_default", "read", "ui_Button_default", "read", "ui_Dialog_default", "read", "ui_DialogContent_default", "read", "ui_DialogDescription_default", "read", "ui_DialogFooter_default", "read", "ui_DialogHeader_default", "read", "ui_DialogTitle_default", "read", "ui_Popover_default", "read", "ui_PopoverContent_default", "read", "ui_Select_default", "read", "ui_SelectContent_default", "read", "ui_SelectItem_default", "read", "ui_SelectTrigger_default", "read", "ui_SelectValue_default", "read", "dialog_RunModalContext_default", "read", "react_createContext_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_useCallback_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useMemo_default", "read", "react_useRef_default", "read", "react_useState_default", "read", "react_useSyncExternalStore_default", "read", "toKebabCase", "string", "toLucideIconData", "iconName", "iconNode", "aliases", "toKebabCase", "toCamelCase", "string", "out", "upperNext", "ch", "toPascalCase", "string", "camelCase", "toCamelCase", "mergeClasses", "classes", "className", "index", "array", "defaultAttributes", "isDefined", "value", "buildLucideIconNode", "icon", "params", "attributeNames", "getAttributeName", "attributeName", "viewBoxWidth", "defaultAttributes", "viewBoxHeight", "aliasClassNames", "alias", "iconClassNames", "classNamesFromClassName", "className", "mergeClasses", "calculatedStrokeWidth", "attrs", "attrName", "child", "name", "children", "nextAttrs", "buildLucideIconForReact", "icon", "params", "buildLucideIconNode", "hasA11yProp", "props", "prop", "LucideContext", "react_createContext_default", "useLucideContext", "react_useContext_default", "LucideContext", "Icon", "react_forwardRef_default", "color", "size", "width", "height", "strokeWidth", "absoluteStrokeWidth", "nonScalingStroke", "className", "children", "iconNode", "icon", "rest", "ref", "contextSize", "contextStrokeWidth", "contextAbsoluteStrokeWidth", "contextNonScalingStroke", "contextColor", "contextClass", "useLucideContext", "hasAccessibleProp", "hasA11yProp", "name", "svgAttributes", "builtIconNode", "buildLucideIconForReact", "mergeClasses", "react_createElement_default", "tag", "attrs", "createLucideIcon", "iconDataOrName", "iconNode", "aliases", "iconData", "toLucideIconData", "Component", "react_forwardRef_default", "className", "props", "ref", "react_createElement_default", "Icon", "toPascalCase", "__iconData", "X", "createLucideIcon", "quassel_ChatInputToolbar_default", "read", "quassel_ChatMessages_default", "read", "useChat_useChat_default", "read", "useAttachmentCapabilities_useAttachmentCapabilities_default", "read", "PluginRegistry_ChatStepsProvider_default", "read", "chat_view_settings_ChatViewSwitches_default", "read", "chat_view_settings_useChatViewSettings_default", "read", "toolLine_withToolSummaries_default", "read", "rpc_rpc_default", "read", "api_interruptActorTurn_default", "read", "contracts_runContracts_default", "read", "run_view_runViewFrom_default", "read", "typebox_Type_default", "read", "contract_defineOperation_default", "read", "events_eventTypeMap_default", "read", "OVERSEER_PLUGIN_ID", "QUICK_ANSWER_MAX_LENGTH", "object", "properties", "typebox_Type_default", "text", "empty", "jsonObject", "eventType", "events_eventTypeMap_default", "name", "run", "identityFields", "runSummary", "accepted", "commonStart", "createInput", "domainObject", "source", "eventSchema", "viewSchema", "modelSelection", "settingsResult", "overseerContracts", "contract_defineOperation_default", "labels_thinkingLabel_default", "read", "rpcApi", "rpc_rpc_default", "overseerContracts", "selection", "createModelSettingsStore", "api", "state", "revision", "loading", "listeners", "publish", "next", "listener", "failure", "cause", "error", "started", "settings", "modelSettingsStore", "jsx_runtime_Fragment_default", "read", "jsx_runtime_jsx_default", "read", "jsx_runtime_jsxs_default", "read", "useModelSettings", "active", "state", "react_useSyncExternalStore_default", "modelSettingsStore", "react_useEffect_default", "selectionKey", "provider", "model", "noteClass", "errorClass", "triggerClass", "ModelSettings", "compact", "disabled", "actions", "access", "AccessContext_useAccess_default", "readable", "writable", "settings", "entry", "save", "selection", "modelOptions", "thinkingOptions", "level", "labels_thinkingLabel_default", "jsx_runtime_jsxs_default", "jsx_runtime_Fragment_default", "ui_Select_default", "key", "next", "thinking", "jsx_runtime_jsx_default", "ui_SelectTrigger_default", "ui_SelectValue_default", "ui_SelectContent_default", "option", "ui_SelectItem_default", "ui_Button_default", "overseerChatStorageKeyPrefix", "overseerChatDisplayPolicy", "validText", "value", "QUICK_ANSWER_MAX_LENGTH", "createQuickAnswers", "conversationId", "initialized", "replaying", "seenSequence", "replaySequence", "pending", "event", "notice", "OVERSEER_PLUGIN_ID", "payload", "state", "question", "text", "toolbarClass", "noteClass", "interruptCoordinator", "runId", "coordinator", "run_view_runViewFrom_default", "rpc_rpc_default", "contracts_runContracts_default", "api_interruptActorTurn_default", "errorClass", "OverseerToolbar", "context", "user", "AccessContext_useAccess_default", "setCoordinator", "react_useState_default", "react_useEffect_default", "current", "overseerContracts", "cause", "jsx_runtime_jsx_default", "PluginRegistry_ChatStepsProvider_default", "overseerChatDisplayPolicy", "overseerChatStorageKeyPrefix", "OverseerConversation", "open", "onOpen", "onClose", "onBusy", "userLocation", "writable", "activated", "setActivated", "confirmReset", "setConfirmReset", "resetting", "setResetting", "resetPending", "react_useRef_default", "resetObserved", "composer", "anchor", "dropdown", "suppressFocus", "detailsContainer", "setDetailsContainer", "scroller", "setScroller", "conversationId", "dialogContainer", "setDialogContainer", "cancelReset", "setDropdown", "react_useCallback_default", "element", "quickAnswers", "createQuickAnswers", "quickAnswer", "setQuickAnswer", "panelOpen", "error", "setError", "composerError", "setComposerError", "clearConversation", "onEvent", "event", "notice", "chat", "useChat_useChat_default", "chatView", "chat_view_settings_useChatViewSettings_default", "modelState", "useModelSettings", "attachments", "useAttachmentCapabilities_useAttachmentCapabilities_default", "messages", "react_useMemo_default", "toolLine_withToolSummaries_default", "requestOpen", "belowHeader", "boundary", "bounds", "dismiss", "reason", "perform", "work", "reset", "connectionNote", "problem", "jsx_runtime_jsxs_default", "quassel_ChatInputToolbar_default", "text", "ModelSettings", "ui_Button_default", "chat_view_settings_ChatViewSwitches_default", "ui_Popover_default", "ui_PopoverContent_default", "jsx_runtime_Fragment_default", "X", "next", "details", "dialog_RunModalContext_default", "ui_Dialog_default", "ui_DialogContent_default", "ui_DialogHeader_default", "ui_DialogTitle_default", "ui_DialogDescription_default", "ui_DialogFooter_default", "quassel_ChatMessages_default", "webPlugin", "OVERSEER_PLUGIN_ID"]
3
+ "sources": ["ragents-host-read:read", "ragents-host-value:@ragents/web/AccessContext#useAccess", "ragents-host-value:@ragents/web/ui#Button", "ragents-host-value:@ragents/web/ui#Dialog", "ragents-host-value:@ragents/web/ui#DialogContent", "ragents-host-value:@ragents/web/ui#DialogDescription", "ragents-host-value:@ragents/web/ui#DialogFooter", "ragents-host-value:@ragents/web/ui#DialogHeader", "ragents-host-value:@ragents/web/ui#DialogTitle", "ragents-host-value:@ragents/web/ui#Popover", "ragents-host-value:@ragents/web/ui#PopoverContent", "ragents-host-value:@ragents/web/ui#Select", "ragents-host-value:@ragents/web/ui#SelectContent", "ragents-host-value:@ragents/web/ui#SelectItem", "ragents-host-value:@ragents/web/ui#SelectTrigger", "ragents-host-value:@ragents/web/ui#SelectValue", "ragents-host-value:@ragents/web/ui/dialog#RunModalContext", "ragents-host-value:react#createContext", "ragents-host-value:react#createElement", "ragents-host-value:react#forwardRef", "ragents-host-value:react#useCallback", "ragents-host-value:react#useContext", "ragents-host-value:react#useEffect", "ragents-host-value:react#useMemo", "ragents-host-value:react#useRef", "ragents-host-value:react#useState", "ragents-host-value:react#useSyncExternalStore", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toKebabCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toLucideIconData.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toCamelCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toPascalCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/mergeClasses.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/defaultAttributes.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconNode.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconForReact.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/hasA11yProp.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/context.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/Icon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/createLucideIcon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/x.ts", "ragents-host-value:quassel#ChatInputToolbar", "ragents-host-value:quassel#ChatMessages", "ragents-host-value:quassel#ChatPanel", "ragents-host-value:@ragents/web/chat/useChat#useChat", "ragents-host-value:@ragents/web/chat/useAttachmentCapabilities#useAttachmentCapabilities", "ragents-host-value:@ragents/web/PluginRegistry#ChatStepsProvider", "ragents-host-value:@ragents/web/chat-view-settings#ChatViewSwitches", "ragents-host-value:@ragents/web/chat-view-settings#useChatViewSettings", "ragents-host-value:@ragents/web/toolLine#withToolSummaries", "ragents-host-value:@ragents/web/rpc#rpc", "ragents-host-value:@ragents/web/api#interruptActorTurn", "ragents-host-value:@ragents/engine/src/http/contracts#runContracts", "ragents-host-value:@ragents/web/run-view#runViewFrom", "ragents-host-value:typebox#Type", "ragents-host-value:@ragents/engine/src/rpc/contract#defineOperation", "ragents-host-value:@ragents/engine/src/domain/events#eventTypeMap", "../../../plugins/ragents.overseer/contract.ts", "ragents-host-value:@ragents/web/lib/labels#thinkingLabel", "../../../plugins/ragents.overseer/web/model-settings.ts", "ragents-host-value:react/jsx-runtime#Fragment", "ragents-host-value:react/jsx-runtime#jsx", "ragents-host-value:react/jsx-runtime#jsxs", "../../../plugins/ragents.overseer/web/ModelSettings.tsx", "../../../plugins/ragents.overseer/web/chat-display.ts", "../../../plugins/ragents.overseer/web/quick-answers.ts", "../../../plugins/ragents.overseer/web/index.tsx"],
4
+ "sourcesContent": ["export const read = (specifier, name) => {\n const module = globalThis[\"__ragentsHostModules\"]?.[specifier];\n if (module === undefined) throw new Error(`The host does not provide ${specifier}`);\n if (!(name in module)) throw new Error(`The host does not provide ${name} from ${specifier}; the bundle was built against a newer host`);\n return module[name];\n};", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/AccessContext\", \"useAccess\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Button\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Dialog\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogDescription\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogFooter\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogHeader\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Popover\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"PopoverContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Select\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectItem\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectTrigger\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"SelectValue\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui/dialog\", \"RunModalContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createElement\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"forwardRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useCallback\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useMemo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useState\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useSyncExternalStore\");\n", "/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string?.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n", "import { toKebabCase } from './toKebabCase';\nimport type { LucideIconData, LucideIconNode } from '../build/types';\n\n/**\n * Converts legacy `(name, iconNode, aliases?)` icon arguments into icon data object format.\n */\nexport function toLucideIconData(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases: string[] = [],\n): LucideIconData {\n if (iconNode == null) {\n throw new Error('[lucide]: iconNode is required when icon name is used');\n }\n\n return {\n name: toKebabCase(iconName),\n size: 24,\n node: iconNode,\n ...(aliases.length > 0 ? { aliases } : {}),\n };\n}\n", "/**\n * Converts string to camel case\n *\n * @param {string} string\n * @returns {string} A camelized string\n */\nexport const toCamelCase = <T extends string>(string: T) => {\n let out = '';\n let upperNext = false;\n\n for (const ch of string) {\n if (ch === '-' || ch === '_' || ch <= ' ') {\n upperNext = out.length > 0;\n continue;\n }\n\n if (out.length === 0) {\n out += ch.toLowerCase();\n } else {\n out += upperNext ? ch.toUpperCase() : ch;\n }\n\n upperNext = false;\n }\n\n return out as string;\n};\n", "import { CamelToPascal } from '../utility-types';\nimport { toCamelCase } from './toCamelCase';\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = toCamelCase(string);\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n", "/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return (\n Boolean(className) &&\n (className as string).trim() !== '' &&\n array.indexOf(className) === index\n );\n })\n .join(' ')\n .trim();\n", "const defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n} as const;\n\nexport default defaultAttributes;\n", "import type { LucideBuildParams, LucideIconData, LucideIconNode, SVGProps } from './types';\nimport defaultAttributes from './defaultAttributes';\nimport { mergeClasses } from '../utils/mergeClasses';\n\nfunction isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Creates a Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconNode(icon: LucideIconData, params: LucideBuildParams = {}): LucideIconNode {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName: string) =>\n attributeNames[attributeName] ?? attributeName;\n\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes['width'];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes['height'];\n const aliasClassNames =\n icon.aliases\n ?.filter((alias: string): alias is string => typeof alias === 'string' && alias.trim() !== '')\n .map((alias: string) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...(icon.name ? [`lucide-${icon.name}`] : []), ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(' ').filter(Boolean) ?? [];\n const className =\n params.includeDefaultClasses === false\n ? mergeClasses(...classNamesFromClassName)\n : mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);\n\n const calculatedStrokeWidth = params.absoluteStrokeWidth\n ? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *\n Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /\n Number(params.size ?? params.width ?? defaultAttributes['width'])\n : (params.strokeWidth ?? defaultAttributes['stroke-width']);\n\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {} as SVGProps),\n ...('color' in params &&\n params.color && {\n [getAttributeName('stroke')]: params.color,\n }),\n ...('size' in params &&\n isDefined(params.size) && {\n [getAttributeName('width')]: params.size,\n [getAttributeName('height')]: params.size,\n }),\n ...('width' in params &&\n isDefined(params.width) && {\n [getAttributeName('width')]: params.width,\n }),\n ...('height' in params &&\n isDefined(params.height) && {\n [getAttributeName('height')]: params.height,\n }),\n [getAttributeName('stroke-width')]: calculatedStrokeWidth,\n ...(className && {\n [getAttributeName('class')]: className,\n }),\n [getAttributeName('viewBox')]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...(params.hasA11yProp === false\n ? {\n [getAttributeName('aria-hidden')]: 'true',\n }\n : {}),\n ...('attributes' in params && params.attributes),\n };\n\n return [\n 'svg',\n attributes,\n icon.node.map((child): LucideIconNode => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke\n ? { [getAttributeName('vector-effect')]: 'non-scaling-stroke', ...attrs }\n : attrs;\n\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n }),\n ];\n}\n\nexport default buildLucideIconNode;\n", "import buildLucideIconNode from './buildLucideIconNode';\nimport type { LucideBuildParams, LucideIconData, LucideIconNode } from './types';\n\n/**\n * Creates a React-compatible Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconForReact(\n icon: LucideIconData,\n params: LucideBuildParams = {},\n): LucideIconNode {\n return buildLucideIconNode(icon, {\n ...params,\n attributeNames: {\n ...params.attributeNames,\n class: 'className',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'vector-effect': 'vectorEffect',\n },\n });\n}\n\nexport default buildLucideIconForReact;\n", "/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props: object) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n\n return false;\n};\n", "'use client';\n\nimport { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';\nimport { LucideProps } from './types';\n\ntype LucideConfig = {\n size: number;\n color: string;\n strokeWidth: number;\n /**\n * @deprecated Use `nonScalingStroke` instead.\n */\n absoluteStrokeWidth: boolean;\n nonScalingStroke: boolean;\n className: string;\n};\n\nconst LucideContext = createContext<LucideProps>({});\n\ntype LucideProviderProps = {\n children: ReactNode;\n} & Partial<LucideConfig>;\n\nexport function LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n}: LucideProviderProps) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className],\n );\n\n return createElement(LucideContext.Provider, { value }, children);\n}\n\nexport const useLucideContext = () => useContext(LucideContext);\n", "'use client';\n\nimport { createElement, forwardRef } from 'react';\nimport { buildLucideIconForReact, hasA11yProp, mergeClasses } from '@lucide/shared';\nimport { LucideIconData, LucideIconNode, LucideProps } from './types';\nimport { useLucideContext } from './context';\n\ntype IconComponentProps = LucideProps &\n (\n | {\n iconNode: LucideIconNode[];\n icon?: never;\n }\n | {\n icon: LucideIconData;\n iconNode?: never;\n }\n );\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {boolean} props.nonScalingStroke - Whether to use non scaling strokes\n * @param {string} props.className - The class name of the icon\n * @param {LucideIconNode[]} props.children - The children of the icon\n * @param {LucideIconNode[]} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color,\n size,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className = '',\n children,\n iconNode = [],\n icon = {\n node: iconNode,\n aliases: [],\n size: 24,\n },\n ...rest\n },\n ref,\n ) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n nonScalingStroke: contextNonScalingStroke = false,\n color: contextColor = 'currentColor',\n className: contextClass = '',\n } = useLucideContext() ?? {};\n\n const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);\n\n const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {\n color: color ?? contextColor,\n width: width ?? size ?? contextSize,\n height: height ?? size ?? contextSize,\n strokeWidth: strokeWidth ?? contextStrokeWidth,\n absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,\n nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,\n className: mergeClasses(contextClass, className),\n hasA11yProp: hasAccessibleProp,\n attributes: rest,\n });\n\n return createElement(\n name,\n {\n ref,\n ...svgAttributes,\n },\n [\n ...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n", "import { createElement, forwardRef } from 'react';\nimport { toLucideIconData, toPascalCase } from '@lucide/shared';\nimport { LucideIcon, LucideIconData, LucideIconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Creates a Lucide icon component from icon data.\n *\n * @param icon Icon data object.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(icon: LucideIconData): LucideIcon;\n\n/**\n * Creates a Lucide icon component from the legacy icon arguments.\n *\n * @param iconName Icon name.\n * @param iconNode Icon node.\n * @param aliases Optional icon aliases.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases?: string[],\n): LucideIcon;\n\nfunction createLucideIcon(\n iconDataOrName: LucideIconData | string,\n iconNode: LucideIconNode[] = [],\n aliases: string[] = [],\n): LucideIcon {\n const iconData =\n typeof iconDataOrName === 'string'\n ? toLucideIconData(iconDataOrName, iconNode, aliases)\n : iconDataOrName;\n\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n icon: iconData,\n className,\n ...props,\n }),\n );\n\n if (iconData.name) {\n Component.displayName = toPascalCase(iconData.name);\n }\n\n return Component;\n}\n\nexport default createLucideIcon;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'x',\n size: 24,\n node: [\n ['path', { d: 'M18 6 6 18', key: '1bl5f8' }],\n ['path', { d: 'm6 6 12 12', key: 'd8bk6v' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst X = createLucideIcon(__iconData);\n\nexport default X;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"ChatInputToolbar\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"ChatMessages\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"quassel\", \"ChatPanel\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat/useChat\", \"useChat\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat/useAttachmentCapabilities\", \"useAttachmentCapabilities\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/PluginRegistry\", \"ChatStepsProvider\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat-view-settings\", \"ChatViewSwitches\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat-view-settings\", \"useChatViewSettings\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/toolLine\", \"withToolSummaries\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/rpc\", \"rpc\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/api\", \"interruptActorTurn\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/http/contracts\", \"runContracts\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runViewFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"typebox\", \"Type\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/rpc/contract\", \"defineOperation\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/domain/events\", \"eventTypeMap\");\n", "import { Type, type TSchema } from \"typebox\";\nimport { defineOperation } from \"@ragents/engine/src/rpc/contract\";\nimport { eventTypeMap, type EventType } from \"@ragents/engine/src/domain/events\";\n\nexport const OVERSEER_PLUGIN_ID = \"ragents.overseer\";\nexport const QUICK_ANSWER_MAX_LENGTH = 240;\n\nexport interface QuickAnswerState {\n kind: \"quick-answer\";\n question: string;\n text: string;\n}\n\nexport const overseerPermissions = [\n { id: \"ragents.overseer.read\", description: \"View the global coordinator and its model selection.\" },\n { id: \"ragents.overseer.write\", description: \"Give tasks to the global coordinator and reset its conversation.\" },\n] as const;\n\nexport interface OverseerModelSelection {\n provider: string;\n model: string;\n thinking: string;\n}\n\nexport interface OverseerSettings extends OverseerModelSelection {\n models: Array<{ id: string; provider: string; label: string; thinking: string[] }>;\n}\n\nconst object = <P extends Record<string, TSchema>>(properties: P) => Type.Object(properties, { additionalProperties: false });\nconst text = () => Type.String({ minLength: 1, pattern: \"\\\\S\" });\nconst empty = object({});\nconst jsonObject = Type.Record(Type.String(), Type.Any());\nconst eventType = Type.Unsafe<EventType>(Type.Union(Object.keys(eventTypeMap).map((name) => Type.Literal(name))));\nconst run = Type.String({ minLength: 1, maxLength: 512, description: \"Run ID, unique title or stable reference such as Run 1.\" });\nconst identityFields = { runId: Type.String(), title: Type.String(), reference: Type.String() };\nconst runSummary = object({ ...identityFields, createdAt: Type.Optional(Type.Number()), updatedAt: Type.Number(), running: Type.Optional(Type.Boolean()), metadata: Type.Optional(jsonObject) });\nconst accepted = object({ ...identityFields, accepted: Type.Literal(true) });\nconst commonStart = { title: text(), options: Type.Optional(jsonObject) };\nconst createInput = Type.Union([\n object({ ...commonStart, message: text() }),\n object({ ...commonStart, script: text(), input: Type.Optional(Type.Any()) }),\n object({ ...commonStart, packageDirectory: Type.String({ minLength: 1, description: \"Absolute path of a RUN.md/setup.ts/tests.json package on the server. A local shell client inserts its actually existing package path; this is not an upload.\" }), input: Type.Optional(Type.Any()) }),\n]);\nconst domainObject = (name: string, source = \"packages/ragents/src/domain/model.ts\") => Type.Object({}, {\n additionalProperties: true, \"x-typescript-type\": name, \"x-source\": source,\n description: `Unabridged domain value ${name}; nested fields are deliberately an open JSON schema here.`,\n});\nconst eventSchema = object({\n eventId: Type.String(), runId: Type.String(), sequence: Type.Integer({ minimum: 1 }), schemaVersion: Type.Literal(3),\n occurredAt: Type.String(), actorId: Type.String(), commandId: Type.String(),\n correlationId: Type.Union([Type.String(), Type.Null()]), causationId: Type.Union([Type.String(), Type.Null()]),\n type: eventType, payload: domainObject(\"EventPayloads[EventType]\", \"packages/ragents/src/domain/events.ts\"),\n});\nconst viewSchema = object({\n id: Type.String(), revision: Type.Integer(), title: Type.String(), ownerId: Type.String(),\n primaryActorId: Type.Union([Type.String(), Type.Null()]), createdAt: Type.String(),\n forkedFrom: Type.Union([object({ runId: Type.String(), sequence: Type.Integer() }), Type.Null()]),\n actors: Type.Array(domainObject(\"Actor\")), inputs: Type.Array(domainObject(\"ActorInput\")), turns: Type.Array(domainObject(\"Turn\")),\n subscriptions: Type.Array(domainObject(\"EventSubscription\")), pluginStates: Type.Array(domainObject(\"PluginState\")),\n actions: Type.Array(domainObject(\"Action\")), artifacts: Type.Array(domainObject(\"Artifact\")),\n});\nconst modelSelection = object({ provider: text(), model: text(), thinking: text() });\nconst settingsResult = object({\n provider: Type.String(), model: Type.String(), thinking: Type.String(),\n models: Type.Array(object({ id: Type.String(), provider: Type.String(), label: Type.String(), thinking: Type.Array(Type.String()) })),\n});\n\n/** Run management, model selection and conversation reset of the global coordinator. */\nexport const overseerContracts = {\n listRuns: defineOperation({\n id: \"ragents.overseer.listRuns\",\n description: \"List the runs the caller sees, with stable references; the global coordinators are not part of this list.\",\n rights: [\"runs.read\"],\n input: empty,\n result: Type.Array(runSummary),\n }),\n createRun: defineOperation({\n id: \"ragents.overseer.createRun\",\n description: \"Create a run with a server-side ID and title. Exactly one start form: message, installed script (id or unique title), or packageDirectory (existing local run script package). input is only allowed with script/packageDirectory. options selects start options such as ragents.startOptions.select, each only with its own rights. The result waits for preparation, check, test and installation; accepted does not yet confirm a finished model result.\",\n rights: [\"runs.read\", \"runs.write\", \"runs.create\"],\n input: createInput,\n result: accepted,\n }),\n readRun: defineOperation({\n id: \"ragents.overseer.readRun\",\n description: \"Read the current unabridged RunView; nested domain values are documented as open JSON objects.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: object({ run }),\n result: viewSchema,\n }),\n readEvents: defineOperation({\n id: \"ragents.overseer.readEvents\",\n description: \"Read the complete journal page by page in sequence order. As long as hasMore is true, use nextAfter as after of the next request. type filters an exact event type.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: object({\n run,\n after: Type.Optional(Type.Integer({ minimum: 0, default: 0 })),\n limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 200, default: 50 })),\n type: Type.Optional(eventType),\n }),\n result: object({ ...identityFields, events: Type.Array(eventSchema), nextAfter: Type.Integer({ minimum: 0 }), hasMore: Type.Boolean() }),\n }),\n sendMessage: defineOperation({\n id: \"ragents.overseer.sendMessage\",\n description: \"Enqueue a chat message for the primary LLM actor; TypeScript as primary is rejected with actor-chat-unsupported. The result only confirms the enqueueing, neither processing nor completion. A running turn is not replaced by it.\",\n rights: [\"runs.read\", \"runs.write\"],\n input: object({ run, message: text() }),\n result: accepted,\n }),\n stopRun: defineOperation({\n id: \"ragents.overseer.stopRun\",\n description: \"Stop the run through its normal stop boundary and wait for the cleanup; the conversation is kept.\",\n rights: [\"runs.read\", \"runs.write\"],\n input: object({ run }),\n result: object({ ...identityFields, stopped: Type.Literal(true) }),\n }),\n readCatalog: defineOperation({\n id: \"ragents.overseer.readCatalog\",\n description: \"Read installed templates and start options with input schemas, default values and selectability. createRun starts messages, installed scripts or local packages via packageDirectory. Skills provide editable tasks for message; name the skill as the work instruction.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: empty,\n result: object({\n entries: Type.Array(Type.Object({ id: Type.String(), title: Type.String(), description: Type.String(), action: Type.Union([Type.Literal(\"skill\"), Type.Literal(\"script\")]) }, { additionalProperties: true, \"x-typescript-type\": \"PublicStartEntry\" })),\n options: Type.Array(object({ id: Type.String(), schema: jsonObject, value: Type.Any(), selectable: Type.Boolean(), presentation: Type.Any() })),\n }),\n }),\n readReference: defineOperation({\n id: \"ragents.overseer.readReference\",\n description: \"Read a readable reference of all registered methods and channels directly from their contracts.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: empty,\n result: Type.String(),\n }),\n readOpenRpc: defineOperation({\n id: \"ragents.overseer.readOpenRpc\",\n description: \"Read OpenRPC 1.3 directly from the same contracts.\",\n rights: [\"runs.read\", \"runs.inspect\"],\n input: empty,\n result: jsonObject,\n }),\n settings: {\n read: defineOperation({\n id: \"ragents.overseer.settings.read\",\n description: \"Read the global coordinator's model selection with the available model catalog.\",\n rights: [\"ragents.overseer.read\"],\n input: empty,\n result: settingsResult,\n }),\n save: defineOperation({\n id: \"ragents.overseer.settings.save\",\n description: \"Set the global coordinator's model selection; it applies from the next answer on.\",\n rights: [\"ragents.overseer.read\", \"ragents.overseer.write\", \"settings.write\"],\n input: modelSelection,\n result: settingsResult,\n }),\n },\n coordinator: defineOperation({\n id: \"ragents.overseer.coordinator\",\n description: \"Read the run ID of your own global coordinator: one per signed-in user, exactly one without sign-in.\",\n rights: [\"ragents.overseer.read\"],\n input: empty,\n result: object({ runId: Type.String() }),\n }),\n reset: defineOperation({\n id: \"ragents.overseer.reset\",\n description: \"Reset the conversation of your own global coordinator including its model context; the model selection, other users' coordinators and all runs are kept.\",\n rights: [\"ragents.overseer.read\", \"ragents.overseer.write\"],\n input: object({ confirm: Type.Literal(true, { description: \"The conversation reset must be confirmed explicitly.\" }) }),\n result: Type.Null(),\n }),\n} as const;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/lib/labels\", \"thinkingLabel\");\n", "import { rpc } from \"@ragents/web/rpc\";\nimport { overseerContracts, type OverseerModelSelection, type OverseerSettings } from \"../contract\";\n\ntype SettingsState =\n | { status: \"loading\"; settings?: undefined; error?: undefined }\n | { status: \"failed\"; settings?: undefined; error: string }\n | { status: \"ready\" | \"saving\"; settings: OverseerSettings; error?: string };\n\nexport interface ModelSettingsApi {\n read: () => Promise<OverseerSettings>;\n save: (selection: OverseerModelSelection) => Promise<OverseerSettings>;\n}\n\nconst rpcApi: ModelSettingsApi = {\n read: () => rpc.call(overseerContracts.settings.read, {}),\n save: (selection) => rpc.call(overseerContracts.settings.save, selection),\n};\n\nexport function createModelSettingsStore(api: ModelSettingsApi = rpcApi) {\n let state: SettingsState = { status: \"loading\" };\n let revision = 0;\n let loading: Promise<void> | undefined;\n const listeners = new Set<() => void>();\n const publish = (next: SettingsState) => {\n state = next;\n for (const listener of listeners) listener();\n };\n const failure = (cause: unknown) => {\n const error = cause instanceof Error ? cause.message : String(cause);\n publish(state.settings ? { status: \"ready\", settings: state.settings, error } : { status: \"failed\", error });\n };\n const load = (): Promise<void> => {\n if (loading) return loading;\n if (state.status === \"saving\") return Promise.resolve();\n const started = revision;\n if (!state.settings) publish({ status: \"loading\" });\n loading = api.read().then((settings) => {\n if (revision === started) publish({ status: \"ready\", settings });\n }).catch((cause: unknown) => {\n if (revision === started) failure(cause);\n }).finally(() => { loading = undefined; });\n return loading;\n };\n const save = async (selection: OverseerModelSelection): Promise<void> => {\n if (!state.settings || state.status === \"saving\") throw new Error(\"Wait until the settings are ready\");\n revision += 1;\n publish({ status: \"saving\", settings: state.settings });\n try {\n publish({ status: \"ready\", settings: await api.save(selection) });\n } catch (cause) {\n failure(cause);\n throw cause;\n }\n };\n return { read: () => state, load, save, subscribe: (listener: () => void) => {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n } };\n}\n\nexport const modelSettingsStore = createModelSettingsStore();\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"Fragment\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsx\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react/jsx-runtime\", \"jsxs\");\n", "import { useAccess } from \"@ragents/web/AccessContext\";\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"@ragents/web/ui\";\nimport { useEffect, useSyncExternalStore, type ReactNode } from \"react\";\nimport { thinkingLabel } from \"@ragents/web/lib/labels\";\nimport { modelSettingsStore } from \"./model-settings\";\nimport type { OverseerModelSelection } from \"../contract\";\n\nexport function useModelSettings(active = true) {\n const state = useSyncExternalStore(modelSettingsStore.subscribe, modelSettingsStore.read);\n useEffect(() => { if (active) void modelSettingsStore.load(); }, [active]);\n return state;\n}\n\nconst selectionKey = (provider: string, model: string) => JSON.stringify([provider, model]);\n\nconst noteClass = \"mt-2 text-[0.73rem] text-muted-foreground\";\nconst errorClass = \"mt-2 flex flex-wrap items-center gap-2 text-[0.8rem] text-destructive\";\nconst triggerClass = \"min-w-0 max-w-[min(320px,100%)]\";\n\nexport function ModelSettings({ active = true, compact = false, disabled = false, actions }: { active?: boolean; compact?: boolean; disabled?: boolean; actions?: ReactNode }) {\n const access = useAccess();\n const readable = access.can(\"ragents.overseer.read\");\n const writable = access.can(\"ragents.overseer.write\") && access.can(\"settings.write\");\n const state = useModelSettings(active && readable);\n const settings = state.settings;\n const model = settings?.models.find((entry) => entry.id === settings.model && entry.provider === settings.provider);\n const save = (selection: OverseerModelSelection) => { void modelSettingsStore.save(selection).catch(() => {}); };\n const modelOptions = settings?.models.map((entry) => ({ value: selectionKey(entry.provider, entry.id), label: entry.label })) ?? [];\n const thinkingOptions = model?.thinking.map((level) => ({ value: level, label: thinkingLabel(level) })) ?? [];\n if (!readable) return null;\n return (\n <section aria-label=\"Model of the global coordinator\" className={compact ? \"min-w-0 flex-1\" : \"min-w-0\"}>\n <div className={compact ? \"flex flex-nowrap items-center gap-2 max-md:gap-1\" : \"flex flex-wrap items-center gap-2.5\"}>\n {settings && model ? <>\n <Select\n disabled={!writable || disabled || state.status === \"saving\"}\n items={modelOptions}\n value={selectionKey(settings.provider, settings.model)}\n onValueChange={(key) => {\n const next = settings.models.find((entry) => selectionKey(entry.provider, entry.id) === key);\n if (!next) throw new Error(\"The selected model is no longer available\");\n const thinking = next.thinking.includes(settings.thinking) ? settings.thinking : next.thinking[0];\n if (!thinking) throw new Error(\"No reasoning level is configured for the model\");\n save({ provider: next.provider, model: next.id, thinking });\n }}\n >\n <SelectTrigger aria-label=\"Model\" className={`${triggerClass} ${compact ? \"flex-1\" : \"flex-[0_1_auto]\"}`} size={compact ? \"sm\" : \"default\"}><SelectValue /></SelectTrigger>\n <SelectContent>{modelOptions.map((option) => <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>)}</SelectContent>\n </Select>\n <Select\n disabled={!writable || disabled || state.status === \"saving\" || model.thinking.length < 2}\n items={thinkingOptions}\n value={settings.thinking}\n onValueChange={(thinking) => { if (thinking !== null) save({ provider: settings.provider, model: settings.model, thinking }); }}\n >\n <SelectTrigger aria-label={compact ? \"Reasoning\" : \"Reasoning level\"} className={`${triggerClass} flex-none`} size={compact ? \"sm\" : \"default\"}><SelectValue /></SelectTrigger>\n <SelectContent>{thinkingOptions.map((option) => <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>)}</SelectContent>\n </Select>\n </> : state.status === \"loading\" ? <p className={`${noteClass} min-w-0 flex-[0_1_auto]`} role=\"status\">Loading models ...</p>\n : !state.error && <p className={`${errorClass} min-w-0 flex-[0_1_auto]`} role=\"alert\">The stored model is missing from the model catalog.</p>}\n {actions && <div className=\"ml-auto flex-none\">{actions}</div>}\n </div>\n {settings && model && (!compact || state.status === \"saving\") && <p className={noteClass} role=\"status\">{state.status === \"saving\" ? \"Saving ...\" : \"Applies from the next answer on. The conversation history is kept.\"}</p>}\n {state.error && <div className={errorClass} role=\"alert\">\n <span>{state.error}</span>\n <Button onClick={() => { void modelSettingsStore.load(); }} variant=\"outline\">Reload</Button>\n </div>}\n </section>\n );\n}\n", "import type { ChatDisplayPolicy } from \"@ragents/web/PluginRegistry\";\n\nexport const overseerChatStorageKeyPrefix = \"ragents.overseer.chat-steps\";\n\nexport const overseerChatDisplayPolicy: ChatDisplayPolicy = {\n modes: { coordinator: \"grouped\", agents: \"grouped\" },\n stepsVisible: true,\n stepsExpandable: true,\n selectable: true,\n};\n", "import type { ChatEvent } from \"quassel/events\";\nimport { OVERSEER_PLUGIN_ID, QUICK_ANSWER_MAX_LENGTH } from \"../contract\";\n\nexport interface QuickAnswerNotice {\n id: string;\n question: string;\n text: string;\n}\n\nconst validText = (value: unknown): value is string => typeof value === \"string\" && !!value.trim()\n && value.length <= QUICK_ANSWER_MAX_LENGTH && !/[\\r\\n]/.test(value);\n\nexport function createQuickAnswers() {\n let conversationId: string | null | undefined;\n let initialized = false;\n let replaying = true;\n let seenSequence = 0;\n let replaySequence = 0;\n let pending: QuickAnswerNotice | undefined;\n return {\n event(event: ChatEvent): QuickAnswerNotice | undefined {\n if (event.kind === \"reset\") {\n if (event.reason === \"conversation-reset\" || (conversationId != null && conversationId !== event.conversationId)) {\n seenSequence = 0;\n initialized = true;\n }\n conversationId = event.conversationId;\n replaying = true;\n replaySequence = seenSequence;\n pending = undefined;\n }\n if (event.kind === \"replay-end\") {\n conversationId = event.conversationId;\n replaying = false;\n seenSequence = replaySequence;\n const notice = initialized ? pending : undefined;\n initialized = true;\n pending = undefined;\n return notice;\n }\n if (event.kind !== \"plugin\" || event.pluginId !== OVERSEER_PLUGIN_ID || event.type !== \"state-replaced\") return;\n const payload = event.payload;\n if (!payload || typeof payload !== \"object\" || !(\"state\" in payload)) return;\n if (!(\"scope\" in payload) || !payload.scope || typeof payload.scope !== \"object\"\n || !(\"kind\" in payload.scope) || payload.scope.kind !== \"run\") return;\n const state = payload.state;\n if (!state || typeof state !== \"object\" || !(\"kind\" in state) || state.kind !== \"quick-answer\") return;\n if (!event.journal || !event.journal.eventId?.trim() || !event.journal.conversationId?.trim()\n || !Number.isSafeInteger(event.journal.sequence) || event.journal.sequence <= 0) {\n throw new Error(\"The journal position of the quick answer is invalid.\");\n }\n if (conversationId != null && conversationId !== event.journal.conversationId) return;\n conversationId = event.journal.conversationId;\n if (event.journal.sequence <= (replaying ? replaySequence : seenSequence)) return;\n if (replaying && !initialized) { replaySequence = event.journal.sequence; return; }\n const question = \"question\" in state ? state.question : undefined;\n const text = \"text\" in state ? state.text : undefined;\n if (!validText(question) || !validText(text)) throw new Error(\"The quick question or quick answer is invalid.\");\n const notice = { id: event.journal.eventId, question, text };\n if (replaying) { replaySequence = event.journal.sequence; pending = notice; }\n else { seenSequence = event.journal.sequence; return notice; }\n },\n };\n}\n", "import { useAccess } from \"@ragents/web/AccessContext\";\nimport { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Popover, PopoverContent } from \"@ragents/web/ui\";\nimport { RunModalContext } from \"@ragents/web/ui/dialog\";\nimport { XIcon } from \"lucide-react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { ChatMessages, ChatInputToolbar, ChatPanel, type ChatInputHandle, type ChatEvent } from \"quassel\";\nimport { useChat } from \"@ragents/web/chat/useChat\";\nimport { useAttachmentCapabilities } from \"@ragents/web/chat/useAttachmentCapabilities\";\nimport { ChatStepsProvider, type OverviewPanelContext, type WebPlugin } from \"@ragents/web/PluginRegistry\";\nimport { ChatViewSwitches, useChatViewSettings } from \"@ragents/web/chat-view-settings\";\nimport { withToolSummaries } from \"@ragents/web/toolLine\";\nimport { rpc } from \"@ragents/web/rpc\";\nimport { interruptActorTurn } from \"@ragents/web/api\";\nimport { runContracts } from \"@ragents/engine/src/http/contracts\";\nimport { runViewFrom } from \"@ragents/web/run-view\";\nimport { OVERSEER_PLUGIN_ID, overseerContracts } from \"../contract\";\nimport { ModelSettings, useModelSettings } from \"./ModelSettings\";\nimport { overseerChatDisplayPolicy, overseerChatStorageKeyPrefix } from \"./chat-display\";\nimport { createQuickAnswers, type QuickAnswerNotice } from \"./quick-answers\";\n\nconst toolbarClass = \"flex h-header max-w-[720px] min-w-[190px] flex-[0_1_570px] items-center gap-1 border-r border-border bg-[color-mix(in_srgb,var(--primary)_4%,var(--card))] px-2 py-1 data-open:bg-accent max-md:min-w-[130px] max-md:flex-[0_1_210px] max-md:px-1 max-md:data-open:grow\";\nconst noteClass = \"mx-4 my-2 flex-none text-[0.8rem] text-muted-foreground\";\n\n/** Interrupts only the coordinator's running turn; the run and its other actors keep running. */\nconst interruptCoordinator = async (runId: string) => {\n const coordinator = runViewFrom(await rpc.call(runContracts.view, { runId }))?.primaryActorId;\n if (!coordinator) throw new Error(\"The global coordinator is not available\");\n await interruptActorTurn(runId, coordinator);\n};\nconst errorClass = \"mx-4 my-2 flex-none text-[0.8rem] text-destructive\";\n\n/** Every user has their own coordinator; only the server knows its id. */\nfunction useCoordinator() {\n const user = useAccess().user?.id;\n const [coordinator, setCoordinator] = useState<{ runId?: string; error?: string }>({});\n useEffect(() => {\n let current = true;\n setCoordinator({});\n rpc.call(overseerContracts.coordinator, {}).then(\n ({ runId }) => { if (current) setCoordinator({ runId }); },\n (cause: unknown) => { if (current) setCoordinator({ error: cause instanceof Error ? cause.message : String(cause) }); },\n );\n return () => { current = false; };\n }, [user]);\n return coordinator;\n}\n\nfunction OverseerToolbar(context: OverviewPanelContext) {\n const coordinator = useCoordinator();\n if (!coordinator.runId) {\n return <div className={toolbarClass} data-slot=\"overseer-toolbar\" role=\"status\">\n {coordinator.error && <span className=\"text-[0.7rem] font-bold text-destructive\" title={coordinator.error} aria-label={coordinator.error}>!</span>}\n </div>;\n }\n return <ChatStepsProvider policy={overseerChatDisplayPolicy} storageKeyPrefix={overseerChatStorageKeyPrefix}>\n <OverseerConversation key={coordinator.runId} {...context} runId={coordinator.runId} />\n </ChatStepsProvider>;\n}\n\nfunction OverseerConversation({ open, onOpen, onClose, onBusy, userLocation, runId }: OverviewPanelContext & { runId: string }) {\n const writable = useAccess().can(\"ragents.overseer.write\");\n const [activated, setActivated] = useState(false);\n const [confirmReset, setConfirmReset] = useState(false);\n const [resetting, setResetting] = useState(false);\n const resetPending = useRef(false);\n const resetObserved = useRef(false);\n const composer = useRef<ChatInputHandle>(null);\n const anchor = useRef<HTMLDivElement>(null);\n const dropdown = useRef<HTMLElement>(null);\n const suppressFocus = useRef(false);\n const [detailsContainer, setDetailsContainer] = useState<HTMLDivElement | null>(null);\n const [scroller, setScroller] = useState<HTMLDivElement | null>(null);\n const conversationId = useRef<string | null | undefined>(undefined);\n const [dialogContainer, setDialogContainer] = useState<HTMLElement | null>(null);\n const cancelReset = useRef<HTMLButtonElement>(null);\n const setDropdown = useCallback((element: HTMLElement | null) => { dropdown.current = element; setDialogContainer(element); }, []);\n const [quickAnswers] = useState(createQuickAnswers);\n const [quickAnswer, setQuickAnswer] = useState<QuickAnswerNotice>();\n const panelOpen = useRef(open);\n panelOpen.current = open;\n const [error, setError] = useState<string>();\n const [composerError, setComposerError] = useState<string>();\n const clearConversation = useCallback(() => {\n composer.current?.reset();\n setConfirmReset(false);\n setError(undefined);\n setQuickAnswer(undefined);\n }, []);\n const onEvent = useCallback((event: ChatEvent) => {\n const notice = quickAnswers.event(event);\n if (event.kind === \"reset\") {\n if (event.reason === \"conversation-reset\" || (conversationId.current != null && conversationId.current !== event.conversationId)) {\n if (resetPending.current) resetObserved.current = true;\n clearConversation();\n }\n conversationId.current = event.conversationId;\n }\n if (event.kind === \"replay-end\") conversationId.current = event.conversationId;\n if (notice && !panelOpen.current) setQuickAnswer(notice);\n }, [clearConversation, quickAnswers]);\n const chat = useChat(runId, onEvent, activated);\n const chatView = useChatViewSettings(runId, \"primary\", \"coordinator\");\n const modelState = useModelSettings(open);\n const attachments = useAttachmentCapabilities(runId, \"primary\", JSON.stringify(modelState.settings && [modelState.settings.provider, modelState.settings.model]));\n const messages = useMemo(() => withToolSummaries(chat.messages), [chat.messages]);\n const requestOpen = () => { suppressFocus.current = false; setQuickAnswer(undefined); onOpen(); };\n useEffect(() => { if (open) { setActivated(true); setQuickAnswer(undefined); } }, [open]);\n useEffect(() => onBusy(chat.running), [chat.running, onBusy]);\n const belowHeader = useCallback(() => {\n const element = anchor.current;\n if (!element) return null;\n const boundary = element.closest(\"header\") ?? element;\n return { contextElement: element, getBoundingClientRect: () => {\n const bounds = element.getBoundingClientRect();\n return new DOMRect(bounds.left, boundary.getBoundingClientRect().bottom, bounds.width, 0);\n } };\n }, []);\n const dismiss = (reason: string, event: Event) => {\n if (confirmReset) return;\n if (reason === \"outside-press\") {\n if (event.target instanceof Node && anchor.current?.contains(event.target)) return;\n onClose();\n return;\n }\n if (reason !== \"escape-key\") return;\n suppressFocus.current = !(document.activeElement instanceof HTMLTextAreaElement && anchor.current?.contains(document.activeElement));\n onClose();\n composer.current?.focus();\n };\n\n const perform = (work: () => Promise<void>) => {\n setError(undefined);\n void work().catch((cause: unknown) => setError(cause instanceof Error ? cause.message : String(cause)));\n };\n const reset = async () => {\n if (resetPending.current) return;\n resetPending.current = true;\n resetObserved.current = false;\n setResetting(true);\n setError(undefined);\n try {\n await rpc.call(overseerContracts.reset, { confirm: true });\n clearConversation();\n } catch (cause) {\n if (!resetObserved.current) setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n resetPending.current = false;\n setResetting(false);\n }\n };\n const connectionNote = activated && !chat.connected ? \"No connection. Your draft is kept; sending is disabled.\" : undefined;\n const problem = error ?? composerError ?? modelState.error ?? connectionNote;\n return <div className={toolbarClass} data-open={open} data-slot=\"overseer-toolbar\" ref={anchor}\n onFocus={(event) => {\n if (!(event.target instanceof HTMLTextAreaElement)) return;\n if (suppressFocus.current) suppressFocus.current = false;\n else onOpen();\n }}\n onKeyDown={(event) => {\n if (event.defaultPrevented) return;\n if (!open && event.target instanceof HTMLTextAreaElement && (event.key.length === 1 || event.key === \"Enter\")) requestOpen();\n }}>\n <div className=\"min-w-0 flex-1\" onClick={(event) => { if (event.target instanceof HTMLTextAreaElement) requestOpen(); }}>\n <ChatInputToolbar {...attachments} detailsContainer={detailsContainer} layout=\"toolbar\" handleRef={composer}\n inputAriaControls=\"overseer-dropdown\"\n disabled={!writable || resetting || confirmReset} sendDisabled={!chat.connected || modelState.status === \"saving\" || resetting}\n maxRows={2} rows={1} onErrorChange={setComposerError} onSend={(text, attachments) => chat.send(text, attachments, userLocation)}\n onStop={writable && chat.running ? () => { if (!resetPending.current) perform(() => interruptCoordinator(runId)); } : undefined}\n running={chat.running}\n texts={{ placeholder: \"Global coordinator\", steeringPlaceholder: \"Global coordinator\" }}\n toolbarRight={<ModelSettings active={open} compact disabled={resetting} actions={\n <Button aria-label=\"Reset conversation\" aria-busy={resetting} disabled={!writable || resetting || !chat.connected} onClick={() => setConfirmReset(true)} size=\"sm\" variant=\"outline\">\n {resetting ? \"Resetting ...\" : \"Reset\"}\n </Button>\n } />}\n toolbarLeft={<ChatViewSwitches className=\"max-md:[&>span]:hidden\" settings={chatView} />}\n />\n </div>\n <span className=\"flex min-w-0 flex-none items-center justify-end gap-1.5 empty:hidden\" role=\"status\" aria-live=\"polite\">\n {chat.running && <span className=\"sr-only\">Working</span>}\n {problem && <span className=\"text-[0.7rem] font-bold text-destructive\" title={problem} aria-label={problem}>!</span>}\n </span>\n <Popover modal={false} open={quickAnswer !== undefined}>\n <PopoverContent align=\"start\" anchor={belowHeader} aria-atomic=\"true\" aria-live=\"polite\" className=\"flex max-w-[calc(100vw-16px)] flex-row items-start gap-1 p-1.5 text-[0.76rem]\" collisionPadding={8}\n finalFocus={false} initialFocus={false} role=\"status\" side=\"bottom\"\n style={{ width: \"min(max(calc(var(--anchor-width) * 2), 480px), var(--available-width))\" }}>\n {quickAnswer && <>\n <Button className=\"h-auto min-w-0 flex-1 justify-start rounded-lg px-2.5 py-2 text-left text-[0.76rem] leading-[1.45] font-normal whitespace-normal [overflow-wrap:anywhere]\" variant=\"ghost\" aria-label={`Open history: ${quickAnswer.question} ${quickAnswer.text}`}\n onClick={() => {\n requestOpen();\n if (writable) composer.current?.focus();\n else requestAnimationFrame(() => scroller?.focus());\n }}><span className=\"grid min-w-0 gap-1\"><span className=\"text-muted-foreground\">{quickAnswer.question}</span><strong className=\"font-semibold\">{quickAnswer.text}</strong></span></Button>\n <Button aria-label=\"Close quick answer\" className=\"mt-1 flex-none rounded-full\" onClick={() => setQuickAnswer(undefined)} size=\"icon-sm\" title=\"Close quick answer\" variant=\"ghost\"><XIcon /></Button>\n </>}\n </PopoverContent>\n </Popover>\n <Popover modal={false} open={open} onOpenChange={(next, details) => { if (!next) dismiss(details.reason, details.event); }}>\n <PopoverContent align=\"start\" anchor={belowHeader} aria-label=\"Global coordinator\" className=\"flex min-h-0 flex-col gap-0 overflow-hidden rounded-t-none rounded-b-panel border-t-2 border-t-primary p-0\" collisionPadding={8}\n finalFocus={false} id=\"overseer-dropdown\" initialFocus={false} keepMounted ref={setDropdown} role=\"region\" side=\"bottom\"\n style={{ width: \"min(760px, var(--available-width))\", height: \"min(650px, var(--available-height))\" }}>\n <div className=\"flex-none border-b border-border-soft\" data-tone=\"overseer-details\" ref={setDetailsContainer} />\n {confirmReset && dialogContainer && <RunModalContext.Provider value={dialogContainer}>\n <Dialog open onOpenChange={(next) => { if (!next && !resetting) setConfirmReset(false); }} modal=\"trap-focus\" disablePointerDismissal>\n <DialogContent initialFocus={cancelReset} onBackdropClick={() => { if (!resetting) setConfirmReset(false); }} scope=\"run\" showCloseButton={false} size=\"small\">\n <DialogHeader>\n <DialogTitle>Reset conversation?</DialogTitle>\n <DialogDescription>History and model context are deleted. Running answers are stopped.</DialogDescription>\n </DialogHeader>\n <p>Your runs and the model choice are kept.</p>\n {error && <p className=\"text-[0.8rem] text-destructive\" role=\"alert\">{error}</p>}\n <DialogFooter>\n <Button ref={cancelReset} disabled={resetting} onClick={() => setConfirmReset(false)} variant=\"outline\">Cancel</Button>\n <Button disabled={resetting} onClick={() => { void reset(); }} variant=\"destructive\">\n {resetting ? \"Resetting ...\" : \"Reset conversation\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </RunModalContext.Provider>}\n {!writable && <p className={noteClass}>You have read access to this conversation.</p>}\n {connectionNote && <p className={noteClass} role=\"status\">{connectionNote}</p>}\n {error && <p className={errorClass} role=\"alert\">{error}</p>}\n <ChatMessages announce={false} className=\"min-h-16! flex-1\" scrollerRef={setScroller}\n detailMode={chatView.detailMode}\n emptyState={<div className=\"m-auto max-w-[480px] p-8 text-[0.9rem] leading-[1.6] text-muted-foreground max-md:p-5\"><strong className=\"text-foreground\">One chat for the whole workshop</strong><p>Write your task in the title bar above. Answers about your runs and ongoing work appear here.</p></div>}\n messages={messages} running={chat.running} showTimestamps={chatView.showTimestamps} stepsExpandable={chatView.stepsExpandable}\n />\n </PopoverContent>\n </Popover>\n </div>;\n}\n\n/** The coordinator's chat fills the main area while no run is open. */\nfunction OverseerIdleView({ userLocation }: OverviewPanelContext) {\n const coordinator = useCoordinator();\n if (!coordinator.runId) {\n return <p className={coordinator.error ? \"m-auto p-6 text-center text-destructive\" : \"m-auto p-6 text-center text-muted-foreground\"} role=\"status\">\n {coordinator.error ?? \"Connecting to the global coordinator ...\"}\n </p>;\n }\n return <ChatStepsProvider policy={overseerChatDisplayPolicy} storageKeyPrefix={overseerChatStorageKeyPrefix}>\n <OverseerIdleChat key={coordinator.runId} runId={coordinator.runId} userLocation={userLocation} />\n </ChatStepsProvider>;\n}\n\nfunction OverseerIdleChat({ runId, userLocation }: { runId: string; userLocation: OverviewPanelContext[\"userLocation\"] }) {\n const writable = useAccess().can(\"ragents.overseer.write\");\n const chat = useChat(runId);\n const chatView = useChatViewSettings(runId, \"primary\", \"coordinator\");\n const modelState = useModelSettings();\n const attachments = useAttachmentCapabilities(runId, \"primary\", JSON.stringify(modelState.settings && [modelState.settings.provider, modelState.settings.model]));\n const messages = useMemo(() => withToolSummaries(chat.messages), [chat.messages]);\n const [error, setError] = useState<string>();\n const problem = error ?? (chat.connected ? undefined : \"No connection. Your draft is kept; sending is disabled.\");\n return <ChatPanel className=\"flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden\" maxWidth=\"880px\"\n composer={<div className=\"[--qsl-input-card-radius:var(--radius-lg)]\">\n {problem && <p className=\"text-[0.8rem] text-destructive\" role=\"alert\">{problem}</p>}\n <ChatInputToolbar {...attachments} disabled={!writable} sendDisabled={!chat.connected || modelState.status === \"saving\"} maxRows={6} rows={1}\n onErrorChange={setError} onSend={(text, attachments) => chat.send(text, attachments, userLocation)}\n onStop={writable && chat.running ? () => { setError(undefined); void interruptCoordinator(runId).catch((cause: unknown) => setError(cause instanceof Error ? cause.message : String(cause))); } : undefined}\n running={chat.running}\n texts={{ placeholder: writable ? \"Ask the global coordinator\" : \"Read access to the global coordinator\", steeringPlaceholder: \"Ask the global coordinator\" }}\n toolbarLeft={<ChatViewSwitches settings={chatView} />}\n />\n </div>}>\n <ChatMessages detailMode={chatView.detailMode}\n emptyState={<div className=\"m-auto max-w-[480px] p-8 text-center text-[0.9rem] leading-[1.6] text-muted-foreground max-md:p-5\"><strong className=\"text-foreground\">Global coordinator</strong><p>No run is open. Ask about your runs or give a task; open or start a run through the overview at the top left.</p></div>}\n messages={messages} running={chat.running} showTimestamps={chatView.showTimestamps} stepsExpandable={chatView.stepsExpandable}\n />\n </ChatPanel>;\n}\n\nexport const webPlugin: WebPlugin = {\n id: OVERSEER_PLUGIN_ID,\n settings: [{ category: \"models\", order: 10, readRight: \"ragents.overseer.read\", id: `${OVERSEER_PLUGIN_ID}.model`, label: \"Global coordinator\", Settings: ModelSettings }],\n overviewPanels: [\n { id: `${OVERSEER_PLUGIN_ID}.chat`, placement: \"toolbar\", order: 100, readRight: \"ragents.overseer.read\", Panel: OverseerToolbar },\n { id: `${OVERSEER_PLUGIN_ID}.idle`, placement: \"idle\", order: 100, readRight: \"ragents.overseer.read\", Panel: OverseerIdleView },\n ],\n};\n"],
5
+ "mappings": "AAAO,IAAMA,EAAO,CAACC,EAAWC,IAAS,CACvC,IAAMC,EAAS,WAAW,uBAA0BF,CAAS,EAC7D,GAAIE,IAAW,OAAW,MAAM,IAAI,MAAM,6BAA6BF,CAAS,EAAE,EAClF,GAAI,EAAEC,KAAQC,GAAS,MAAM,IAAI,MAAM,6BAA6BD,CAAI,SAASD,CAAS,6CAA6C,EACvI,OAAOE,EAAOD,CAAI,CACpB,ECJA,IAAOE,EAAQC,EAAK,6BAA8B,WAAW,ECA7D,IAAOC,EAAQC,EAAK,kBAAmB,QAAQ,ECA/C,IAAOC,GAAQC,EAAK,kBAAmB,QAAQ,ECA/C,IAAOC,GAAQC,EAAK,kBAAmB,eAAe,ECAtD,IAAOC,GAAQC,EAAK,kBAAmB,mBAAmB,ECA1D,IAAOC,GAAQC,EAAK,kBAAmB,cAAc,ECArD,IAAOC,GAAQC,EAAK,kBAAmB,cAAc,ECArD,IAAOC,GAAQC,EAAK,kBAAmB,aAAa,ECApD,IAAOC,GAAQC,EAAK,kBAAmB,SAAS,ECAhD,IAAOC,GAAQC,EAAK,kBAAmB,gBAAgB,ECAvD,IAAOC,GAAQC,EAAK,kBAAmB,QAAQ,ECA/C,IAAOC,GAAQC,EAAK,kBAAmB,eAAe,ECAtD,IAAOC,GAAQC,EAAK,kBAAmB,YAAY,ECAnD,IAAOC,GAAQC,EAAK,kBAAmB,eAAe,ECAtD,IAAOC,GAAQC,EAAK,kBAAmB,aAAa,ECApD,IAAOC,GAAQC,EAAK,yBAA0B,iBAAiB,ECA/D,IAAO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K,KAAKwB,EAAMlB,EAAa7C,CAAY,EACjG,OAAQC,GAAYsC,EAAK,QAAU,IAAM,CAAEP,EAAS,MAAS,EAAQ5D,GAAqBC,CAAK,EAAE,MAAOe,GAAmB4C,EAAS5C,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAAC,CAAC,CAAG,EAAI,OAClM,QAASmD,EAAK,QACd,MAAO,CAAE,YAAatC,EAAW,6BAA+B,wCAAyC,oBAAqB,4BAA6B,EAC3J,YAAaV,EAAC2E,GAAA,CAAiB,SAAUzB,EAAU,EACrD,GACF,EACA,SAAAlD,EAACyF,GAAA,CAAa,WAAYvC,EAAS,WACjC,WAAYoB,EAAC,OAAI,UAAU,oGAAoG,UAAAtE,EAAC,UAAO,UAAU,kBAAkB,8BAAkB,EAASA,EAAC,KAAE,yHAA6G,GAAI,EAClT,SAAUwD,EAAU,QAASR,EAAK,QAAS,eAAgBE,EAAS,eAAgB,gBAAiBA,EAAS,gBAChH,EACF,CACF,CAEO,IAAM2C,GAAuB,CAClC,GAAIC,EACJ,SAAU,CAAC,CAAE,SAAU,SAAU,MAAO,GAAI,UAAW,wBAAyB,GAAI,GAAGA,CAAkB,SAAU,MAAO,qBAAsB,SAAUrB,EAAc,CAAC,EACzK,eAAgB,CACd,CAAE,GAAI,GAAGqB,CAAkB,QAAS,UAAW,UAAW,MAAO,IAAK,UAAW,wBAAyB,MAAOhG,EAAgB,EACjI,CAAE,GAAI,GAAGgG,CAAkB,QAAS,UAAW,OAAQ,MAAO,IAAK,UAAW,wBAAyB,MAAOJ,EAAiB,CACjI,CACF",
6
+ "names": ["read", "specifier", "name", "module", "AccessContext_useAccess_default", "read", "ui_Button_default", "read", "ui_Dialog_default", "read", "ui_DialogContent_default", "read", "ui_DialogDescription_default", "read", "ui_DialogFooter_default", "read", "ui_DialogHeader_default", "read", "ui_DialogTitle_default", "read", "ui_Popover_default", "read", "ui_PopoverContent_default", "read", "ui_Select_default", "read", "ui_SelectContent_default", "read", "ui_SelectItem_default", "read", "ui_SelectTrigger_default", "read", "ui_SelectValue_default", "read", "dialog_RunModalContext_default", "read", "react_createContext_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_useCallback_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useMemo_default", "read", "react_useRef_default", "read", "react_useState_default", "read", "react_useSyncExternalStore_default", "read", "toKebabCase", "string", "toLucideIconData", "iconName", "iconNode", "aliases", "toKebabCase", "toCamelCase", "string", "out", "upperNext", "ch", "toPascalCase", "string", "camelCase", "toCamelCase", "mergeClasses", "classes", "className", "index", "array", "defaultAttributes", "isDefined", "value", "buildLucideIconNode", "icon", "params", "attributeNames", "getAttributeName", "attributeName", "viewBoxWidth", "defaultAttributes", "viewBoxHeight", "aliasClassNames", "alias", "iconClassNames", "classNamesFromClassName", "className", "mergeClasses", "calculatedStrokeWidth", "attrs", "attrName", "child", "name", "children", "nextAttrs", "buildLucideIconForReact", "icon", "params", "buildLucideIconNode", "hasA11yProp", "props", "prop", "LucideContext", "react_createContext_default", "useLucideContext", "react_useContext_default", "LucideContext", "Icon", "react_forwardRef_default", "color", "size", "width", "height", "strokeWidth", "absoluteStrokeWidth", "nonScalingStroke", "className", "children", "iconNode", "icon", "rest", "ref", "contextSize", "contextStrokeWidth", "contextAbsoluteStrokeWidth", "contextNonScalingStroke", "contextColor", "contextClass", "useLucideContext", "hasAccessibleProp", "hasA11yProp", "name", "svgAttributes", "builtIconNode", "buildLucideIconForReact", "mergeClasses", "react_createElement_default", "tag", "attrs", "createLucideIcon", "iconDataOrName", "iconNode", "aliases", "iconData", "toLucideIconData", "Component", "react_forwardRef_default", "className", "props", "ref", "react_createElement_default", "Icon", "toPascalCase", "__iconData", "X", "createLucideIcon", "quassel_ChatInputToolbar_default", "read", "quassel_ChatMessages_default", "read", "quassel_ChatPanel_default", "read", "useChat_useChat_default", "read", "useAttachmentCapabilities_useAttachmentCapabilities_default", "read", "PluginRegistry_ChatStepsProvider_default", "read", "chat_view_settings_ChatViewSwitches_default", "read", "chat_view_settings_useChatViewSettings_default", "read", "toolLine_withToolSummaries_default", "read", "rpc_rpc_default", "read", "api_interruptActorTurn_default", "read", "contracts_runContracts_default", "read", "run_view_runViewFrom_default", "read", "typebox_Type_default", "read", "contract_defineOperation_default", "read", "events_eventTypeMap_default", "read", "OVERSEER_PLUGIN_ID", "QUICK_ANSWER_MAX_LENGTH", "object", "properties", "typebox_Type_default", "text", "empty", "jsonObject", "eventType", "events_eventTypeMap_default", "name", "run", "identityFields", "runSummary", "accepted", "commonStart", "createInput", "domainObject", "source", "eventSchema", "viewSchema", "modelSelection", "settingsResult", "overseerContracts", "contract_defineOperation_default", "labels_thinkingLabel_default", "read", "rpcApi", "rpc_rpc_default", "overseerContracts", "selection", "createModelSettingsStore", "api", "state", "revision", "loading", "listeners", "publish", "next", "listener", "failure", "cause", "error", "started", "settings", "modelSettingsStore", "jsx_runtime_Fragment_default", "read", "jsx_runtime_jsx_default", "read", "jsx_runtime_jsxs_default", "read", "useModelSettings", "active", "state", "react_useSyncExternalStore_default", "modelSettingsStore", "react_useEffect_default", "selectionKey", "provider", "model", "noteClass", "errorClass", "triggerClass", "ModelSettings", "compact", "disabled", "actions", "access", "AccessContext_useAccess_default", "readable", "writable", "settings", "entry", "save", "selection", "modelOptions", "thinkingOptions", "level", "labels_thinkingLabel_default", "jsx_runtime_jsxs_default", "jsx_runtime_Fragment_default", "ui_Select_default", "key", "next", "thinking", "jsx_runtime_jsx_default", "ui_SelectTrigger_default", "ui_SelectValue_default", "ui_SelectContent_default", "option", "ui_SelectItem_default", "ui_Button_default", "overseerChatStorageKeyPrefix", "overseerChatDisplayPolicy", "validText", "value", "QUICK_ANSWER_MAX_LENGTH", "createQuickAnswers", "conversationId", "initialized", "replaying", "seenSequence", "replaySequence", "pending", "event", "notice", "OVERSEER_PLUGIN_ID", "payload", "state", "question", "text", "toolbarClass", "noteClass", "interruptCoordinator", "runId", "coordinator", "run_view_runViewFrom_default", "rpc_rpc_default", "contracts_runContracts_default", "api_interruptActorTurn_default", "errorClass", "useCoordinator", "user", "AccessContext_useAccess_default", "setCoordinator", "react_useState_default", "react_useEffect_default", "current", "overseerContracts", "cause", "OverseerToolbar", "context", "jsx_runtime_jsx_default", "PluginRegistry_ChatStepsProvider_default", "overseerChatDisplayPolicy", "overseerChatStorageKeyPrefix", "OverseerConversation", "open", "onOpen", "onClose", "onBusy", "userLocation", "writable", "activated", "setActivated", "confirmReset", "setConfirmReset", "resetting", "setResetting", "resetPending", "react_useRef_default", "resetObserved", "composer", "anchor", "dropdown", "suppressFocus", "detailsContainer", "setDetailsContainer", "scroller", "setScroller", "conversationId", "dialogContainer", "setDialogContainer", "cancelReset", "setDropdown", "react_useCallback_default", "element", "quickAnswers", "createQuickAnswers", "quickAnswer", "setQuickAnswer", "panelOpen", "error", "setError", "composerError", "setComposerError", "clearConversation", "onEvent", "event", "notice", "chat", "useChat_useChat_default", "chatView", "chat_view_settings_useChatViewSettings_default", "modelState", "useModelSettings", "attachments", "useAttachmentCapabilities_useAttachmentCapabilities_default", "messages", "react_useMemo_default", "toolLine_withToolSummaries_default", "requestOpen", "belowHeader", "boundary", "bounds", "dismiss", "reason", "perform", "work", "reset", "connectionNote", "problem", "jsx_runtime_jsxs_default", "quassel_ChatInputToolbar_default", "text", "ModelSettings", "ui_Button_default", "chat_view_settings_ChatViewSwitches_default", "ui_Popover_default", "ui_PopoverContent_default", "jsx_runtime_Fragment_default", "X", "next", "details", "dialog_RunModalContext_default", "ui_Dialog_default", "ui_DialogContent_default", "ui_DialogHeader_default", "ui_DialogTitle_default", "ui_DialogDescription_default", "ui_DialogFooter_default", "quassel_ChatMessages_default", "OverseerIdleView", "OverseerIdleChat", "quassel_ChatPanel_default", "webPlugin", "OVERSEER_PLUGIN_ID"]
7
7
  }
@@ -77,8 +77,8 @@
77
77
  ]
78
78
  }
79
79
  },
80
- "revision": "20b117e1256a01bb0a9d5308095b133cfa1eaabeb3b1038664119c59772c4f5e",
81
- "sourceRevision": "8398be042f5a78670c52ec1d479c47bdd4292234fc77ee6dc05f4fd6442df908",
80
+ "revision": "e602a8711818533fc7372c5cb2ca51ae55362079d9944da008db9084621b5ccc",
81
+ "sourceRevision": "a909e413bfca6b57bc468300f5a50b2bc85a5d8354a5a0f7dde760f38614cf76",
82
82
  "server": "server/index.js",
83
83
  "web": {
84
84
  "entry": "web/index.js",
@@ -1 +1 @@
1
- ["[&>svg]:flex-none","[&_svg]:size-2.5","[overflow-wrap:anywhere]","a","access","activate","active","activeElement","additionalProperties","address","alert","all","allOpen","an","and","another","are","aria-hidden","aria-label","as","async","await","background","belongs","bg-card/78","bg-primary/14","boolean","border","border-border-soft","busy","button","call","catch","caught","cause","className","cn","command","configuredPlugin","const","controller","current","currentColor","data-[origin=background]:[border-right-style:dashed]","data-[origin=background]:border-dashed","data-hidden","data-origin","data-process-id","defineOperation","description","descriptor","dialogRef","disabled","disrupted","en-US","entry","error","event","export","fallback","false","fill","finally","flex","flex-1","flex-col","flex-none","focus-visible:bg-primary/28","focused","font-bold","font-medium","for","from","function","gap-1.5","gap-3","h-6","has","header","height","hidden","hostname","hover:bg-primary/28","href","icon-xs","id","idle","if","import","in","inline-flex","input","inspect","instanceof","interface","is","isConnected","isRecord","iso","items-center","items-stretch","keeps","key","kind","kindLabel","label","length","live","m7","max-md:hidden","max-md:inline","max-md:not-first:hidden","max-w-62","max-w-none","maxLength","md:data-[hidden=false]:hidden","message","messageFrom","min-w-0","min-w-5","minLength","missing","monitoring","more","new","none","noreferrer","not-italic","number","observed","observedAt","of","on","onClick","onFocusCapture","onOpenChange","onStop","open","openJson","or","order","origin","originText","outline-none","overflow-hidden","p-0.75","params","parsed","pattern","pid","pillClass","pl-2.5","port","portClass","portFrom","ports","pr-0.5","preventScroll","process","processFrom","processHeader","processId","processes","processesContracts","px-1.5","py-px","querySelector","querySelectorAll","react","read","readRight","readonly","ref","rel","rememberFocus","renderProcess","requests","requiresWorkspace","result","return","rights","role","rootRef","round","rounded-full","rpc","run","runId","running","runs","rx","s","scope","seenSince","self-stretch","serviceUrl","session","sessionHeaders","setAllOpen","setState","setStops","shown","signal","since","size","size-5","snapshot","snapshotFrom","state","status","stop","stopClass","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","tab","tabIndex","tabular-nums","target","text-[0.56rem]","text-[0.65rem]","text-destructive","text-ellipsis","text-foreground","text-muted-foreground","text-xs","the","their","throw","timeText","title","titleOf","to","tool","tool-call","toolbar","tracking-[0.035em]","true","try","type","typebox","typeof","undefined","underline","underline-offset-2","unknown","unreadable","uppercase","useAccess","useRef","useRunProcesses","useState","value","viewBox","visibleProcesses","void","w-35","w-42","w-full","webPlugin","whitespace-nowrap","width","with","writable","write"]
1
+ ["[&>svg]:flex-none","[&_svg]:size-2.5","[overflow-wrap:anywhere]","a","access","activate","active","activeElement","additionalProperties","address","alert","all","allOpen","an","and","another","are","aria-hidden","aria-label","as","async","await","background","belongs","bg-card/78","bg-primary/14","boolean","border","border-border-soft","busy","button","call","catch","caught","cause","className","cn","command","configuredPlugin","const","controller","current","currentColor","data-[origin=background]:[border-right-style:dashed]","data-[origin=background]:border-dashed","data-hidden","data-origin","data-process-id","defineOperation","description","descriptor","dialogRef","disabled","disrupted","entry","error","event","export","fallback","false","fill","finally","flex","flex-1","flex-col","flex-none","focus-visible:bg-primary/28","focused","font-bold","font-medium","for","from","function","gap-1.5","gap-3","h-6","has","header","height","hidden","hostname","hover:bg-primary/28","href","icon-xs","id","idle","if","import","in","inline-flex","input","inspect","instanceof","interface","is","isConnected","isRecord","iso","items-center","items-stretch","keeps","key","kind","kindLabel","label","length","live","m7","max-md:hidden","max-md:inline","max-md:not-first:hidden","max-w-62","max-w-none","maxLength","md:data-[hidden=false]:hidden","message","messageFrom","min-w-0","min-w-5","minLength","missing","monitoring","more","new","none","noreferrer","not-italic","number","observed","observedAt","of","on","onClick","onFocusCapture","onOpenChange","onStop","open","openJson","or","order","origin","originText","outline-none","overflow-hidden","p-0.75","params","parsed","pattern","pid","pillClass","pl-2.5","port","portClass","portFrom","ports","pr-0.5","preventScroll","process","processFrom","processHeader","processId","processes","processesContracts","px-1.5","py-px","querySelector","querySelectorAll","react","read","readRight","readonly","ref","rel","rememberFocus","renderProcess","requests","requiresWorkspace","result","return","rights","role","rootRef","round","rounded-full","rpc","run","runId","running","runs","rx","s","scope","seenSince","self-stretch","serviceUrl","session","sessionHeaders","setAllOpen","setState","setStops","shown","signal","since","size","size-5","snapshot","snapshotFrom","state","status","stop","stopClass","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","tab","tabIndex","tabular-nums","target","text-[0.56rem]","text-[0.65rem]","text-destructive","text-ellipsis","text-foreground","text-muted-foreground","text-xs","the","their","throw","timeText","title","titleOf","to","tool","tool-call","toolbar","tracking-[0.035em]","true","try","type","typebox","typeof","undefined","underline","underline-offset-2","unknown","unreadable","uppercase","useAccess","useRef","useRunProcesses","useState","value","viewBox","visibleProcesses","void","w-35","w-42","w-full","webPlugin","whitespace-nowrap","width","with","writable","write"]
@@ -1,4 +1,4 @@
1
- var t=(e,r)=>{let s=globalThis.__ragentsHostModules?.[e];if(s===void 0)throw new Error(`The host does not provide ${e}`);if(!(r in s))throw new Error(`The host does not provide ${r} from ${e}; the bundle was built against a newer host`);return s[r]};var m=t("typebox","Type");var F=t("@ragents/engine/src/rpc/contract","defineChannel");var C=t("@ragents/engine/src/rpc/contract","defineOperation");var S=t("@ragents/engine/src/http/contracts","openJson");var X="ragents.processes",M=m.String({minLength:1,maxLength:64,description:"Run id"}),H={snapshot:C({id:"ragents.processes.snapshot",description:"The observed processes of a run with their open ports. Rights: runs.read and ragents.processes.read.",rights:["runs.read","ragents.processes.read"],input:m.Object({runId:M},{additionalProperties:!1}),result:S("RunProcessSnapshot")}),stop:C({id:"ragents.processes.stop",description:"End a process of the run. Rights: runs.read, runs.write and runs.inspect.",rights:["runs.read","runs.write","runs.inspect"],input:m.Object({runId:M,processId:m.String({pattern:"^[1-9][0-9]*-[a-f0-9]{64}$",description:"Process id from the snapshot"})},{additionalProperties:!1}),result:m.Null()}),live:F({id:"ragents.processes",description:"The live state of a run's process monitoring. Rights: runs.read and ragents.processes.read.",rights:["runs.read","ragents.processes.read"],params:m.Object({runId:M},{additionalProperties:!1}),message:S("RunProcessMessage")})};var w=t("react","useEffect");var U=t("react","useLayoutEffect");var c=t("react","useRef");var I=t("react","useState");var D=t("@ragents/web/AccessContext","useAccess");var $=t("@ragents/web/ui","Dialog");var B=t("@ragents/web/ui","DialogBody");var j=t("@ragents/web/ui","DialogContent");var W=t("@ragents/web/ui","DialogHeader");var V=t("@ragents/web/ui","DialogTitle");var _=t("@ragents/web/ui","StopButton");var h=t("@ragents/web/ui","cn");var E=t("@ragents/web/Toolbar","ToolbarCopy");var y=t("@ragents/web/Toolbar","ToolbarItem");var A=t("@ragents/web/Toolbar","ToolbarLabel");var L=t("@ragents/web/Toolbar","ToolbarText");var O=t("@ragents/web/rpc","rpc");var b=t("@ragents/web/lib/guards","isRecord");var Y=4,le=["tool-call","background"],de=e=>{if(!b(e)||typeof e.port!="number"||typeof e.address!="string")throw new Error("A port entry of the process monitoring is unreadable");return{port:e.port,address:e.address}},pe=e=>{if(!b(e)||typeof e.id!="string"||!e.id||typeof e.pid!="number"||typeof e.label!="string"||typeof e.command!="string"||typeof e.seenSince!="string"||!le.includes(e.origin)||!Array.isArray(e.ports))throw new Error("A process entry of the process monitoring is unreadable");return{id:e.id,pid:e.pid,label:e.label,command:e.command,origin:e.origin,ports:e.ports.map(de),seenSince:e.seenSince}},ue=e=>{if(!b(e)||typeof e.runId!="string"||typeof e.observedAt!="string"||!Array.isArray(e.processes))throw new Error("The process monitoring snapshot is unreadable");return{runId:e.runId,observedAt:e.observedAt,processes:e.processes.map(pe)}},Z=e=>{if(!b(e))throw new Error("The process monitoring message is unreadable");if(e.kind==="error"&&typeof e.error=="string")return{kind:"error",error:e.error};if(e.kind==="snapshot")return{kind:"snapshot",snapshot:ue(e.snapshot)};throw new Error("The process monitoring message has an unknown kind")},ee=(e,r)=>`http://${e.includes(":")?`[${e}]`:e}:${r}/`,K=e=>e.ports.length>0?"Service":"Process",ie=e=>e==="background"?"keeps running in the background":"runs in a tool call",me=e=>{let r=new Date(e);return Number.isNaN(r.getTime())?e:r.toLocaleTimeString("en-US")},z=e=>{let r=e.ports.length>0?`
1
+ var t=(e,r)=>{let s=globalThis.__ragentsHostModules?.[e];if(s===void 0)throw new Error(`The host does not provide ${e}`);if(!(r in s))throw new Error(`The host does not provide ${r} from ${e}; the bundle was built against a newer host`);return s[r]};var m=t("typebox","Type");var F=t("@ragents/engine/src/rpc/contract","defineChannel");var C=t("@ragents/engine/src/rpc/contract","defineOperation");var S=t("@ragents/engine/src/http/contracts","openJson");var X="ragents.processes",M=m.String({minLength:1,maxLength:64,description:"Run id"}),H={snapshot:C({id:"ragents.processes.snapshot",description:"The observed processes of a run with their open ports. Rights: runs.read and ragents.processes.read.",rights:["runs.read","ragents.processes.read"],input:m.Object({runId:M},{additionalProperties:!1}),result:S("RunProcessSnapshot")}),stop:C({id:"ragents.processes.stop",description:"End a process of the run. Rights: runs.read, runs.write and runs.inspect.",rights:["runs.read","runs.write","runs.inspect"],input:m.Object({runId:M,processId:m.String({pattern:"^[1-9][0-9]*-[a-f0-9]{64}$",description:"Process id from the snapshot"})},{additionalProperties:!1}),result:m.Null()}),live:F({id:"ragents.processes",description:"The live state of a run's process monitoring. Rights: runs.read and ragents.processes.read.",rights:["runs.read","ragents.processes.read"],params:m.Object({runId:M},{additionalProperties:!1}),message:S("RunProcessMessage")})};var w=t("react","useEffect");var U=t("react","useLayoutEffect");var c=t("react","useRef");var I=t("react","useState");var D=t("@ragents/web/AccessContext","useAccess");var $=t("@ragents/web/ui","Dialog");var B=t("@ragents/web/ui","DialogBody");var j=t("@ragents/web/ui","DialogContent");var W=t("@ragents/web/ui","DialogHeader");var V=t("@ragents/web/ui","DialogTitle");var _=t("@ragents/web/ui","StopButton");var h=t("@ragents/web/ui","cn");var E=t("@ragents/web/Toolbar","ToolbarCopy");var y=t("@ragents/web/Toolbar","ToolbarItem");var A=t("@ragents/web/Toolbar","ToolbarLabel");var L=t("@ragents/web/Toolbar","ToolbarText");var O=t("@ragents/web/rpc","rpc");var b=t("@ragents/web/lib/guards","isRecord");var Y=4,le=["tool-call","background"],de=e=>{if(!b(e)||typeof e.port!="number"||typeof e.address!="string")throw new Error("A port entry of the process monitoring is unreadable");return{port:e.port,address:e.address}},pe=e=>{if(!b(e)||typeof e.id!="string"||!e.id||typeof e.pid!="number"||typeof e.label!="string"||typeof e.command!="string"||typeof e.seenSince!="string"||!le.includes(e.origin)||!Array.isArray(e.ports))throw new Error("A process entry of the process monitoring is unreadable");return{id:e.id,pid:e.pid,label:e.label,command:e.command,origin:e.origin,ports:e.ports.map(de),seenSince:e.seenSince}},ue=e=>{if(!b(e)||typeof e.runId!="string"||typeof e.observedAt!="string"||!Array.isArray(e.processes))throw new Error("The process monitoring snapshot is unreadable");return{runId:e.runId,observedAt:e.observedAt,processes:e.processes.map(pe)}},Z=e=>{if(!b(e))throw new Error("The process monitoring message is unreadable");if(e.kind==="error"&&typeof e.error=="string")return{kind:"error",error:e.error};if(e.kind==="snapshot")return{kind:"snapshot",snapshot:ue(e.snapshot)};throw new Error("The process monitoring message has an unknown kind")},ee=(e,r)=>`http://${e.includes(":")?`[${e}]`:e}:${r}/`,K=e=>e.ports.length>0?"Service":"Process",ie=e=>e==="background"?"keeps running in the background":"runs in a tool call",me=e=>{let r=new Date(e);return Number.isNaN(r.getTime())?e:r.toLocaleTimeString()},z=e=>{let r=e.ports.length>0?`
2
2
  Listening on ${e.ports.map(s=>`${s.address}:${s.port}`).join(", ")}`:"";return`${e.command}
3
3
  PID ${e.pid}, ${ie(e.origin)}, observed since ${me(e.seenSince)}${r}`},te=e=>({shown:e.slice(0,Y),hidden:Math.max(0,e.length-Y)});var q=t("react/jsx-runtime","Fragment");var a=t("react/jsx-runtime","jsx");var n=t("react/jsx-runtime","jsxs");var re={snapshot:void 0,error:void 0},xe="inline-flex h-6 min-w-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-border-soft bg-card/78 pl-2.5 pr-0.5 text-xs font-medium text-muted-foreground data-[origin=background]:border-dashed [&>svg]:flex-none",ce="flex-none rounded-full bg-primary/14 px-1.5 py-px text-foreground tabular-nums underline underline-offset-2 hover:bg-primary/28 focus-visible:bg-primary/28",ge="size-5 min-w-5 rounded-full p-0.75 [&_svg]:size-2.5",be=e=>{let[r,s]=I(re);return w(()=>(s(re),O.subscribe(H.live,{runId:e},l=>{try{let f=Z(l);if(f.kind==="snapshot"&&f.snapshot.runId!==e)throw new Error("The process snapshot belongs to another run");s(p=>f.kind==="snapshot"?{snapshot:f.snapshot,error:void 0}:{snapshot:p.snapshot,error:f.error})}catch(f){s(p=>({...p,error:f instanceof Error?f.message:String(f)}))}},l=>s(f=>({...f,error:l})))),[e]),r};function oe(){return n("svg",{"aria-hidden":!0,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",viewBox:"0 0 24 24",width:"12",children:[a("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),a("path",{d:"m7 9 3 3-3 3M13 15h4"})]})}function Ie({process:e,state:r,writable:s,onStop:l,toolbar:f=!1}){let p=a(_,{busy:r?.busy===!0,className:ge,disabled:!s||r?.busy,label:r?.busy?`Stopping ${e.label}`:`Stop ${e.label}`,onClick:l,size:"icon-xs",title:s?r?.busy?"Stopping ...":`Stop ${e.label}`:"Write or inspect rights are missing to stop"}),d=e.ports.map(u=>n("a",{className:ce,href:ee(window.location.hostname,u.port),rel:"noreferrer",target:"_blank",title:`Open ${u.address}:${u.port} in a new tab`,children:[":",u.port]},`${u.address}:${u.port}`));return n("div",{className:h("flex min-w-0 flex-col",f?"flex-none self-stretch max-md:not-first:hidden":"w-full"),"data-process-id":e.id,children:[f?n(y,{className:"max-w-none flex-1 data-[origin=background]:[border-right-style:dashed]","data-origin":e.origin,title:z(e),children:[a(oe,{}),n(E,{className:"w-35 flex-none",children:[a(A,{children:K(e)}),a(L,{children:e.label})]}),d,p]}):n("span",{className:h(xe,"w-full"),"data-origin":e.origin,title:z(e),children:[a(oe,{}),a("em",{className:"flex-none text-[0.56rem] font-bold uppercase not-italic tracking-[0.035em]",children:K(e)}),a("span",{className:"min-w-0 flex-1 overflow-hidden text-ellipsis text-foreground",children:e.label}),d,p]}),r?.error&&a("span",{className:h("text-[0.65rem] text-destructive",f?"max-w-62 overflow-hidden text-ellipsis whitespace-nowrap":"[overflow-wrap:anywhere]"),role:"alert",title:r.error,children:r.error})]})}function he({runId:e}){let r=D(),s=r.can("runs.write")&&r.can("runs.inspect"),l=be(e),[f,p]=I({}),[d,u]=I(!1),T=c(new Map),P=c(null),k=c(null),R=c(null),N=c(null),g=l.snapshot?.processes??[],{shown:G,hidden:v}=te(g);w(()=>{let o=T.current;return()=>{for(let i of o.values())i.abort();o.clear()}},[]),U(()=>{if(!R.current||R.current.isConnected||document.activeElement!==document.body)return;let o=(d?k.current:P.current)?.querySelector("button:not(:disabled), a[href]")??(d?k.current:null)??N.current;R.current=null,o?.focus({preventScroll:!0})},[l.snapshot,d]);let J=o=>{if(!(o.target instanceof HTMLElement))return;R.current=o.target;let i=P.current?.closest("header");N.current=[...i?.querySelectorAll("button:not(:disabled), a[href]")??[]].find(x=>!P.current?.contains(x))??null},fe=async o=>{if(!s||T.current.has(o.id)||f[o.id]?.busy)return;let i=new AbortController;T.current.set(o.id,i),p(x=>({...x,[o.id]:{busy:!0}}));try{await O.call(H.stop,{runId:e,processId:o.id},{signal:i.signal})}catch(x){i.signal.aborted||p(ne=>({...ne,[o.id]:{error:x instanceof Error?x.message:String(x)}}))}finally{T.current.delete(o.id)}},Q=(o,i=!1)=>a(Ie,{process:o,state:f[o.id],writable:s,toolbar:i,onStop:()=>{fe(o)}},o.id);return G.length===0&&l.error===void 0&&!d?null:n(q,{children:[n("div",{"aria-label":"Processes and ports of the run",className:"flex min-w-0 flex-none items-stretch self-stretch",ref:P,onFocusCapture:J,children:[G.map(o=>Q(o,!0)),(g.length>1||d)&&n(y,{as:"button",className:"md:data-[hidden=false]:hidden","data-hidden":v>0||d,type:"button",onClick:()=>u(!0),title:"Show all processes of the run",children:[a("span",{className:"max-md:hidden",children:v>0?`+${v} more`:"Processes"}),n("span",{className:"hidden max-md:inline",children:["All ",g.length]})]}),l.error!==void 0&&a(y,{className:"w-42 text-destructive",role:"status",title:l.error,children:n(E,{children:[a(A,{children:"Processes"}),a(L,{children:"Monitoring disrupted"})]})})]}),d&&a($,{open:!0,onOpenChange:o=>{o||(u(!1),g.length===0&&requestAnimationFrame(()=>N.current?.focus({preventScroll:!0})))},children:n(j,{scope:"run",children:[a(W,{children:a(V,{children:"Processes and ports"})}),n(B,{className:"flex flex-col gap-3 outline-none",ref:k,tabIndex:-1,onFocusCapture:J,children:[g.length>0?g.map(o=>Q(o)):a("p",{role:"status",children:"No active processes."}),l.error!==void 0&&a("p",{className:"text-destructive",role:"alert",children:l.error})]})]})})]})}var ae=()=>function({session:r}){let s=D();return s.can("runs.read")&&s.can("ragents.processes.read")?a(he,{runId:r.session.id},r.session.id):null};var ye=e=>({...e,sessionHeaders:[{readRight:"ragents.processes.read",requiresWorkspace:!0,id:"ragents.processes.live",order:110,Header:ae()}]}),se={id:X},gr={...se,activate:()=>ye(se)};export{gr as webPlugin};
4
4
  //# sourceMappingURL=/plugins/ragents.processes/web/index.js.map