@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
3
  "sources": ["ragents-host-read:read", "ragents-host-value:typebox#Type", "ragents-host-value:@ragents/engine/src/rpc/contract#defineChannel", "ragents-host-value:@ragents/engine/src/rpc/contract#defineOperation", "ragents-host-value:@ragents/engine/src/http/contracts#openJson", "../../../plugins/ragents.processes/contract.ts", "ragents-host-value:react#useEffect", "ragents-host-value:react#useLayoutEffect", "ragents-host-value:react#useRef", "ragents-host-value:react#useState", "ragents-host-value:@ragents/web/AccessContext#useAccess", "ragents-host-value:@ragents/web/ui#Dialog", "ragents-host-value:@ragents/web/ui#DialogBody", "ragents-host-value:@ragents/web/ui#DialogContent", "ragents-host-value:@ragents/web/ui#DialogHeader", "ragents-host-value:@ragents/web/ui#DialogTitle", "ragents-host-value:@ragents/web/ui#StopButton", "ragents-host-value:@ragents/web/ui#cn", "ragents-host-value:@ragents/web/Toolbar#ToolbarCopy", "ragents-host-value:@ragents/web/Toolbar#ToolbarItem", "ragents-host-value:@ragents/web/Toolbar#ToolbarLabel", "ragents-host-value:@ragents/web/Toolbar#ToolbarText", "ragents-host-value:@ragents/web/rpc#rpc", "ragents-host-value:@ragents/web/lib/guards#isRecord", "../../../plugins/ragents.processes/web/processes.ts", "ragents-host-value:react/jsx-runtime#Fragment", "ragents-host-value:react/jsx-runtime#jsx", "ragents-host-value:react/jsx-runtime#jsxs", "../../../plugins/ragents.processes/web/ProcessHeader.tsx", "../../../plugins/ragents.processes/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(\"typebox\", \"Type\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/rpc/contract\", \"defineChannel\");\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/http/contracts\", \"openJson\");\n", "import { Type } from \"typebox\";\nimport { defineChannel, defineOperation } from \"@ragents/engine/src/rpc/contract\";\nimport { openJson } from \"@ragents/engine/src/http/contracts\";\n\nexport const PROCESSES_PLUGIN_ID = \"ragents.processes\";\n\nexport interface RunProcessPort {\n port: number;\n address: string;\n}\n\nexport type RunProcessOrigin = \"tool-call\" | \"background\";\n\nexport interface RunProcess {\n id: string;\n pid: number;\n label: string;\n command: string;\n origin: RunProcessOrigin;\n ports: RunProcessPort[];\n seenSince: string;\n}\n\nexport interface RunProcessSnapshot {\n runId: string;\n observedAt: string;\n processes: RunProcess[];\n}\n\nexport type RunProcessMessage =\n | { kind: \"snapshot\"; snapshot: RunProcessSnapshot }\n | { kind: \"error\"; error: string };\n\nconst runId = Type.String({ minLength: 1, maxLength: 64, description: \"Run id\" });\n\nexport const processesContracts = {\n snapshot: defineOperation({\n id: \"ragents.processes.snapshot\",\n description: \"The observed processes of a run with their open ports. Rights: runs.read and ragents.processes.read.\",\n rights: [\"runs.read\", \"ragents.processes.read\"],\n input: Type.Object({ runId }, { additionalProperties: false }),\n result: openJson<RunProcessSnapshot>(\"RunProcessSnapshot\"),\n }),\n stop: defineOperation({\n id: \"ragents.processes.stop\",\n description: \"End a process of the run. Rights: runs.read, runs.write and runs.inspect.\",\n rights: [\"runs.read\", \"runs.write\", \"runs.inspect\"],\n input: Type.Object({\n runId,\n processId: Type.String({ pattern: \"^[1-9][0-9]*-[a-f0-9]{64}$\", description: \"Process id from the snapshot\" }),\n }, { additionalProperties: false }),\n result: Type.Null(),\n }),\n live: defineChannel({\n id: \"ragents.processes\",\n description: \"The live state of a run's process monitoring. Rights: runs.read and ragents.processes.read.\",\n rights: [\"runs.read\", \"ragents.processes.read\"],\n params: Type.Object({ runId }, { additionalProperties: false }),\n message: openJson<RunProcessMessage>(\"RunProcessMessage\"),\n }),\n};\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\", \"useLayoutEffect\");\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(\"@ragents/web/AccessContext\", \"useAccess\");\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\", \"DialogBody\");\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\", \"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\", \"StopButton\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"cn\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarCopy\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarItem\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarLabel\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarText\");\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/lib/guards\", \"isRecord\");\n", "import { isRecord } from \"@ragents/web/lib/guards\";\nimport type { RunProcess, RunProcessMessage, RunProcessPort, RunProcessSnapshot } from \"../contract\";\n\nexport const VISIBLE_PROCESSES = 4;\n\nconst ORIGINS = [\"tool-call\", \"background\"] as const;\n\nconst portFrom = (value: unknown): RunProcessPort => {\n if (!isRecord(value) || typeof value.port !== \"number\" || typeof value.address !== \"string\") {\n throw new Error(\"A port entry of the process monitoring is unreadable\");\n }\n return { port: value.port, address: value.address };\n};\n\nconst processFrom = (value: unknown): RunProcess => {\n if (!isRecord(value) || typeof value.id !== \"string\" || !value.id || typeof value.pid !== \"number\" || typeof value.label !== \"string\"\n || typeof value.command !== \"string\" || typeof value.seenSince !== \"string\"\n || !ORIGINS.includes(value.origin as RunProcess[\"origin\"]) || !Array.isArray(value.ports)) {\n throw new Error(\"A process entry of the process monitoring is unreadable\");\n }\n return {\n id: value.id,\n pid: value.pid,\n label: value.label,\n command: value.command,\n origin: value.origin as RunProcess[\"origin\"],\n ports: value.ports.map(portFrom),\n seenSince: value.seenSince,\n };\n};\n\nconst snapshotFrom = (value: unknown): RunProcessSnapshot => {\n if (!isRecord(value) || typeof value.runId !== \"string\" || typeof value.observedAt !== \"string\"\n || !Array.isArray(value.processes)) {\n throw new Error(\"The process monitoring snapshot is unreadable\");\n }\n return { runId: value.runId, observedAt: value.observedAt, processes: value.processes.map(processFrom) };\n};\n\nexport const messageFrom = (value: unknown): RunProcessMessage => {\n if (!isRecord(value)) throw new Error(\"The process monitoring message is unreadable\");\n if (value.kind === \"error\" && typeof value.error === \"string\") return { kind: \"error\", error: value.error };\n if (value.kind === \"snapshot\") return { kind: \"snapshot\", snapshot: snapshotFrom(value.snapshot) };\n throw new Error(\"The process monitoring message has an unknown kind\");\n};\n\nexport const serviceUrl = (hostname: string, port: number): string =>\n `http://${hostname.includes(\":\") ? `[${hostname}]` : hostname}:${port}/`;\n\nexport const kindLabel = (process: RunProcess): string => process.ports.length > 0 ? \"Service\" : \"Process\";\n\nconst originText = (origin: RunProcess[\"origin\"]): string =>\n origin === \"background\" ? \"keeps running in the background\" : \"runs in a tool call\";\n\nconst timeText = (iso: string): string => {\n const parsed = new Date(iso);\n return Number.isNaN(parsed.getTime()) ? iso : parsed.toLocaleTimeString(\"en-US\");\n};\n\nexport const titleOf = (process: RunProcess): string => {\n const ports = process.ports.length > 0\n ? `\\nListening on ${process.ports.map((port) => `${port.address}:${port.port}`).join(\", \")}`\n : \"\";\n return `${process.command}\\nPID ${process.pid}, ${originText(process.origin)}, observed since ${timeText(process.seenSince)}${ports}`;\n};\n\nexport interface VisibleProcesses {\n shown: readonly RunProcess[];\n hidden: number;\n}\n\nexport const visibleProcesses = (processes: readonly RunProcess[]): VisibleProcesses => ({\n shown: processes.slice(0, VISIBLE_PROCESSES),\n hidden: Math.max(0, processes.length - VISIBLE_PROCESSES),\n});\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 { useEffect, useLayoutEffect, useRef, useState, type ComponentType, type FocusEvent } from \"react\";\nimport { useAccess } from \"@ragents/web/AccessContext\";\nimport type { SessionHeaderContext } from \"@ragents/web/PluginRegistry\";\nimport { Dialog, DialogBody, DialogContent, DialogHeader, DialogTitle, StopButton, cn } from \"@ragents/web/ui\";\nimport { ToolbarCopy, ToolbarItem, ToolbarLabel, ToolbarText } from \"@ragents/web/Toolbar\";\nimport { rpc } from \"@ragents/web/rpc\";\nimport { processesContracts, type RunProcess, type RunProcessSnapshot } from \"../contract\";\nimport { kindLabel, messageFrom, serviceUrl, titleOf, visibleProcesses } from \"./processes\";\n\ninterface ProcessWatchState {\n snapshot: RunProcessSnapshot | undefined;\n error: string | undefined;\n}\n\nconst idle: ProcessWatchState = { snapshot: undefined, error: undefined };\n\nconst pillClass = \"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\";\nconst portClass = \"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\";\nconst stopClass = \"size-5 min-w-5 rounded-full p-0.75 [&_svg]:size-2.5\";\n\nconst useRunProcesses = (runId: string): ProcessWatchState => {\n const [state, setState] = useState<ProcessWatchState>(idle);\n useEffect(() => {\n setState(idle);\n return rpc.subscribe(processesContracts.live, { runId }, (data) => {\n try {\n const message = messageFrom(data);\n if (message.kind === \"snapshot\" && message.snapshot.runId !== runId) throw new Error(\"The process snapshot belongs to another run\");\n setState((current) => message.kind === \"snapshot\"\n ? { snapshot: message.snapshot, error: undefined }\n : { snapshot: current.snapshot, error: message.error });\n } catch (caught) {\n setState((current) => ({ ...current, error: caught instanceof Error ? caught.message : String(caught) }));\n }\n }, (message) => setState((current) => ({ ...current, error: message })));\n }, [runId]);\n return state;\n};\n\nfunction IconProcess() {\n return <svg aria-hidden fill=\"none\" height=\"12\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"12\">\n <rect height=\"16\" rx=\"2\" width=\"18\" x=\"3\" y=\"4\" />\n <path d=\"m7 9 3 3-3 3M13 15h4\" />\n </svg>;\n}\n\ninterface StopState { busy?: boolean; error?: string }\n\nfunction ProcessPill({ process, state, writable, onStop, toolbar = false }: { process: RunProcess; state?: StopState; writable: boolean; onStop: () => void; toolbar?: boolean }) {\n const stop = <StopButton busy={state?.busy === true} className={stopClass} disabled={!writable || state?.busy}\n label={state?.busy ? `Stopping ${process.label}` : `Stop ${process.label}`}\n onClick={onStop} size=\"icon-xs\"\n title={!writable ? \"Write or inspect rights are missing to stop\" : state?.busy ? \"Stopping ...\" : `Stop ${process.label}`} />;\n const ports = process.ports.map((port) => <a className={portClass} href={serviceUrl(window.location.hostname, port.port)}\n key={`${port.address}:${port.port}`} rel=\"noreferrer\" target=\"_blank\" title={`Open ${port.address}:${port.port} in a new tab`}>\n :{port.port}\n </a>);\n return <div className={cn(\"flex min-w-0 flex-col\", toolbar ? \"flex-none self-stretch max-md:not-first:hidden\" : \"w-full\")} data-process-id={process.id}>\n {toolbar\n ? <ToolbarItem className=\"max-w-none flex-1 data-[origin=background]:[border-right-style:dashed]\" data-origin={process.origin} title={titleOf(process)}>\n <IconProcess />\n <ToolbarCopy className=\"w-35 flex-none\">\n <ToolbarLabel>{kindLabel(process)}</ToolbarLabel>\n <ToolbarText>{process.label}</ToolbarText>\n </ToolbarCopy>\n {ports}\n {stop}\n </ToolbarItem>\n : <span className={cn(pillClass, \"w-full\")} data-origin={process.origin} title={titleOf(process)}>\n <IconProcess />\n <em className=\"flex-none text-[0.56rem] font-bold uppercase not-italic tracking-[0.035em]\">{kindLabel(process)}</em>\n <span className=\"min-w-0 flex-1 overflow-hidden text-ellipsis text-foreground\">{process.label}</span>\n {ports}\n {stop}\n </span>}\n {state?.error && <span className={cn(\"text-[0.65rem] text-destructive\", toolbar ? \"max-w-62 overflow-hidden text-ellipsis whitespace-nowrap\" : \"[overflow-wrap:anywhere]\")}\n role=\"alert\" title={state.error}>{state.error}</span>}\n </div>;\n}\n\nfunction ProcessHeaderContent({ runId }: { runId: string }) {\n const access = useAccess();\n const writable = access.can(\"runs.write\") && access.can(\"runs.inspect\");\n const state = useRunProcesses(runId);\n const [stops, setStops] = useState<Record<string, StopState>>({});\n const [allOpen, setAllOpen] = useState(false);\n const requests = useRef(new Map<string, AbortController>());\n const rootRef = useRef<HTMLDivElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const focused = useRef<HTMLElement>(null);\n const fallback = useRef<HTMLElement>(null);\n const processes = state.snapshot?.processes ?? [];\n const { shown, hidden } = visibleProcesses(processes);\n useEffect(() => {\n const active = requests.current;\n return () => { for (const controller of active.values()) controller.abort(); active.clear(); };\n }, []);\n useLayoutEffect(() => {\n if (!focused.current || focused.current.isConnected || document.activeElement !== document.body) return;\n const target = (allOpen ? dialogRef.current : rootRef.current)?.querySelector<HTMLElement>(\"button:not(:disabled), a[href]\")\n ?? (allOpen ? dialogRef.current : null) ?? fallback.current;\n focused.current = null;\n target?.focus({ preventScroll: true });\n }, [state.snapshot, allOpen]);\n const rememberFocus = (event: FocusEvent<HTMLElement>) => {\n if (!(event.target instanceof HTMLElement)) return;\n focused.current = event.target;\n const header = rootRef.current?.closest(\"header\");\n fallback.current = [...(header?.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\") ?? [])]\n .find((element) => !rootRef.current?.contains(element)) ?? null;\n };\n const stop = async (process: RunProcess) => {\n if (!writable || requests.current.has(process.id) || stops[process.id]?.busy) return;\n const controller = new AbortController();\n requests.current.set(process.id, controller);\n setStops((current) => ({ ...current, [process.id]: { busy: true } }));\n try {\n await rpc.call(processesContracts.stop, { runId, processId: process.id }, { signal: controller.signal });\n } catch (cause) {\n if (!controller.signal.aborted) setStops((current) => ({ ...current, [process.id]: { error: cause instanceof Error ? cause.message : String(cause) } }));\n } finally { requests.current.delete(process.id); }\n };\n const renderProcess = (process: RunProcess, toolbar = false) => <ProcessPill key={process.id} process={process} state={stops[process.id]} writable={writable} toolbar={toolbar} onStop={() => { void stop(process); }} />;\n if (shown.length === 0 && state.error === undefined && !allOpen) return null;\n return <>\n <div aria-label=\"Processes and ports of the run\" className=\"flex min-w-0 flex-none items-stretch self-stretch\" ref={rootRef} onFocusCapture={rememberFocus}>\n {shown.map((process) => renderProcess(process, true))}\n {(processes.length > 1 || allOpen) && <ToolbarItem as=\"button\" className=\"md:data-[hidden=false]:hidden\" data-hidden={hidden > 0 || allOpen} type=\"button\" onClick={() => setAllOpen(true)} title=\"Show all processes of the run\">\n <span className=\"max-md:hidden\">{hidden > 0 ? `+${hidden} more` : \"Processes\"}</span><span className=\"hidden max-md:inline\">All {processes.length}</span>\n </ToolbarItem>}\n {state.error !== undefined && <ToolbarItem className=\"w-42 text-destructive\" role=\"status\" title={state.error}><ToolbarCopy><ToolbarLabel>Processes</ToolbarLabel><ToolbarText>Monitoring disrupted</ToolbarText></ToolbarCopy></ToolbarItem>}\n </div>\n {allOpen && <Dialog open onOpenChange={(open) => {\n if (open) return;\n setAllOpen(false);\n if (processes.length === 0) requestAnimationFrame(() => fallback.current?.focus({ preventScroll: true }));\n }}>\n <DialogContent scope=\"run\">\n <DialogHeader><DialogTitle>Processes and ports</DialogTitle></DialogHeader>\n <DialogBody className=\"flex flex-col gap-3 outline-none\" ref={dialogRef} tabIndex={-1} onFocusCapture={rememberFocus}>\n {processes.length > 0 ? processes.map((process) => renderProcess(process)) : <p role=\"status\">No active processes.</p>}\n {state.error !== undefined && <p className=\"text-destructive\" role=\"alert\">{state.error}</p>}\n </DialogBody>\n </DialogContent>\n </Dialog>}\n </>;\n}\n\nexport const processHeader = (): ComponentType<SessionHeaderContext> =>\n function ProcessHeader({ session }: SessionHeaderContext) {\n const access = useAccess();\n return access.can(\"runs.read\") && access.can(\"ragents.processes.read\")\n ? <ProcessHeaderContent key={session.session.id} runId={session.session.id} /> : null;\n };\n", "import {\n type WebPlugin,\n type WebPluginDescriptor,\n} from \"@ragents/web/PluginRegistry\";\nimport { PROCESSES_PLUGIN_ID } from \"../contract\";\nimport { processHeader } from \"./ProcessHeader\";\n\nconst configuredPlugin = (descriptor: WebPluginDescriptor): WebPlugin => ({\n ...descriptor,\n sessionHeaders: [{\n readRight: \"ragents.processes.read\",\n requiresWorkspace: true,\n id: \"ragents.processes.live\",\n order: 110,\n Header: processHeader(),\n }],\n});\n\nconst descriptor: WebPluginDescriptor = { id: PROCESSES_PLUGIN_ID };\n\nexport const webPlugin: WebPlugin = {\n ...descriptor,\n activate: () => configuredPlugin(descriptor),\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,UAAW,MAAM,ECArC,IAAOC,EAAQC,EAAK,mCAAoC,eAAe,ECAvE,IAAOC,EAAQC,EAAK,mCAAoC,iBAAiB,ECAzE,IAAOC,EAAQC,EAAK,qCAAsC,UAAU,ECG7D,IAAMC,EAAsB,oBA6B7BC,EAAQC,EAAK,OAAO,CAAE,UAAW,EAAG,UAAW,GAAI,YAAa,QAAS,CAAC,EAEnEC,EAAqB,CAChC,SAAUC,EAAgB,CACxB,GAAI,6BACJ,YAAa,uGACb,OAAQ,CAAC,YAAa,wBAAwB,EAC9C,MAAOF,EAAK,OAAO,CAAE,MAAAD,CAAM,EAAG,CAAE,qBAAsB,EAAM,CAAC,EAC7D,OAAQI,EAA6B,o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GAAI,yBACJ,MAAO,IACP,OAAQC,GAAc,CACxB,CAAC,CACH,GAEMD,GAAkC,CAAE,GAAIE,CAAoB,EAErDC,GAAuB,CAClC,GAAGH,GACH,SAAU,IAAMD,GAAiBC,EAAU,CAC7C",
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(\"typebox\", \"Type\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/rpc/contract\", \"defineChannel\");\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/http/contracts\", \"openJson\");\n", "import { Type } from \"typebox\";\nimport { defineChannel, defineOperation } from \"@ragents/engine/src/rpc/contract\";\nimport { openJson } from \"@ragents/engine/src/http/contracts\";\n\nexport const PROCESSES_PLUGIN_ID = \"ragents.processes\";\n\nexport interface RunProcessPort {\n port: number;\n address: string;\n}\n\nexport type RunProcessOrigin = \"tool-call\" | \"background\";\n\nexport interface RunProcess {\n id: string;\n pid: number;\n label: string;\n command: string;\n origin: RunProcessOrigin;\n ports: RunProcessPort[];\n seenSince: string;\n}\n\nexport interface RunProcessSnapshot {\n runId: string;\n observedAt: string;\n processes: RunProcess[];\n}\n\nexport type RunProcessMessage =\n | { kind: \"snapshot\"; snapshot: RunProcessSnapshot }\n | { kind: \"error\"; error: string };\n\nconst runId = Type.String({ minLength: 1, maxLength: 64, description: \"Run id\" });\n\nexport const processesContracts = {\n snapshot: defineOperation({\n id: \"ragents.processes.snapshot\",\n description: \"The observed processes of a run with their open ports. Rights: runs.read and ragents.processes.read.\",\n rights: [\"runs.read\", \"ragents.processes.read\"],\n input: Type.Object({ runId }, { additionalProperties: false }),\n result: openJson<RunProcessSnapshot>(\"RunProcessSnapshot\"),\n }),\n stop: defineOperation({\n id: \"ragents.processes.stop\",\n description: \"End a process of the run. Rights: runs.read, runs.write and runs.inspect.\",\n rights: [\"runs.read\", \"runs.write\", \"runs.inspect\"],\n input: Type.Object({\n runId,\n processId: Type.String({ pattern: \"^[1-9][0-9]*-[a-f0-9]{64}$\", description: \"Process id from the snapshot\" }),\n }, { additionalProperties: false }),\n result: Type.Null(),\n }),\n live: defineChannel({\n id: \"ragents.processes\",\n description: \"The live state of a run's process monitoring. Rights: runs.read and ragents.processes.read.\",\n rights: [\"runs.read\", \"ragents.processes.read\"],\n params: Type.Object({ runId }, { additionalProperties: false }),\n message: openJson<RunProcessMessage>(\"RunProcessMessage\"),\n }),\n};\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\", \"useLayoutEffect\");\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(\"@ragents/web/AccessContext\", \"useAccess\");\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\", \"DialogBody\");\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\", \"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\", \"StopButton\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"cn\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarCopy\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarItem\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarLabel\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/Toolbar\", \"ToolbarText\");\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/lib/guards\", \"isRecord\");\n", "import { isRecord } from \"@ragents/web/lib/guards\";\nimport type { RunProcess, RunProcessMessage, RunProcessPort, RunProcessSnapshot } from \"../contract\";\n\nexport const VISIBLE_PROCESSES = 4;\n\nconst ORIGINS = [\"tool-call\", \"background\"] as const;\n\nconst portFrom = (value: unknown): RunProcessPort => {\n if (!isRecord(value) || typeof value.port !== \"number\" || typeof value.address !== \"string\") {\n throw new Error(\"A port entry of the process monitoring is unreadable\");\n }\n return { port: value.port, address: value.address };\n};\n\nconst processFrom = (value: unknown): RunProcess => {\n if (!isRecord(value) || typeof value.id !== \"string\" || !value.id || typeof value.pid !== \"number\" || typeof value.label !== \"string\"\n || typeof value.command !== \"string\" || typeof value.seenSince !== \"string\"\n || !ORIGINS.includes(value.origin as RunProcess[\"origin\"]) || !Array.isArray(value.ports)) {\n throw new Error(\"A process entry of the process monitoring is unreadable\");\n }\n return {\n id: value.id,\n pid: value.pid,\n label: value.label,\n command: value.command,\n origin: value.origin as RunProcess[\"origin\"],\n ports: value.ports.map(portFrom),\n seenSince: value.seenSince,\n };\n};\n\nconst snapshotFrom = (value: unknown): RunProcessSnapshot => {\n if (!isRecord(value) || typeof value.runId !== \"string\" || typeof value.observedAt !== \"string\"\n || !Array.isArray(value.processes)) {\n throw new Error(\"The process monitoring snapshot is unreadable\");\n }\n return { runId: value.runId, observedAt: value.observedAt, processes: value.processes.map(processFrom) };\n};\n\nexport const messageFrom = (value: unknown): RunProcessMessage => {\n if (!isRecord(value)) throw new Error(\"The process monitoring message is unreadable\");\n if (value.kind === \"error\" && typeof value.error === \"string\") return { kind: \"error\", error: value.error };\n if (value.kind === \"snapshot\") return { kind: \"snapshot\", snapshot: snapshotFrom(value.snapshot) };\n throw new Error(\"The process monitoring message has an unknown kind\");\n};\n\nexport const serviceUrl = (hostname: string, port: number): string =>\n `http://${hostname.includes(\":\") ? `[${hostname}]` : hostname}:${port}/`;\n\nexport const kindLabel = (process: RunProcess): string => process.ports.length > 0 ? \"Service\" : \"Process\";\n\nconst originText = (origin: RunProcess[\"origin\"]): string =>\n origin === \"background\" ? \"keeps running in the background\" : \"runs in a tool call\";\n\nconst timeText = (iso: string): string => {\n const parsed = new Date(iso);\n return Number.isNaN(parsed.getTime()) ? iso : parsed.toLocaleTimeString();\n};\n\nexport const titleOf = (process: RunProcess): string => {\n const ports = process.ports.length > 0\n ? `\\nListening on ${process.ports.map((port) => `${port.address}:${port.port}`).join(\", \")}`\n : \"\";\n return `${process.command}\\nPID ${process.pid}, ${originText(process.origin)}, observed since ${timeText(process.seenSince)}${ports}`;\n};\n\nexport interface VisibleProcesses {\n shown: readonly RunProcess[];\n hidden: number;\n}\n\nexport const visibleProcesses = (processes: readonly RunProcess[]): VisibleProcesses => ({\n shown: processes.slice(0, VISIBLE_PROCESSES),\n hidden: Math.max(0, processes.length - VISIBLE_PROCESSES),\n});\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 { useEffect, useLayoutEffect, useRef, useState, type ComponentType, type FocusEvent } from \"react\";\nimport { useAccess } from \"@ragents/web/AccessContext\";\nimport type { SessionHeaderContext } from \"@ragents/web/PluginRegistry\";\nimport { Dialog, DialogBody, DialogContent, DialogHeader, DialogTitle, StopButton, cn } from \"@ragents/web/ui\";\nimport { ToolbarCopy, ToolbarItem, ToolbarLabel, ToolbarText } from \"@ragents/web/Toolbar\";\nimport { rpc } from \"@ragents/web/rpc\";\nimport { processesContracts, type RunProcess, type RunProcessSnapshot } from \"../contract\";\nimport { kindLabel, messageFrom, serviceUrl, titleOf, visibleProcesses } from \"./processes\";\n\ninterface ProcessWatchState {\n snapshot: RunProcessSnapshot | undefined;\n error: string | undefined;\n}\n\nconst idle: ProcessWatchState = { snapshot: undefined, error: undefined };\n\nconst pillClass = \"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\";\nconst portClass = \"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\";\nconst stopClass = \"size-5 min-w-5 rounded-full p-0.75 [&_svg]:size-2.5\";\n\nconst useRunProcesses = (runId: string): ProcessWatchState => {\n const [state, setState] = useState<ProcessWatchState>(idle);\n useEffect(() => {\n setState(idle);\n return rpc.subscribe(processesContracts.live, { runId }, (data) => {\n try {\n const message = messageFrom(data);\n if (message.kind === \"snapshot\" && message.snapshot.runId !== runId) throw new Error(\"The process snapshot belongs to another run\");\n setState((current) => message.kind === \"snapshot\"\n ? { snapshot: message.snapshot, error: undefined }\n : { snapshot: current.snapshot, error: message.error });\n } catch (caught) {\n setState((current) => ({ ...current, error: caught instanceof Error ? caught.message : String(caught) }));\n }\n }, (message) => setState((current) => ({ ...current, error: message })));\n }, [runId]);\n return state;\n};\n\nfunction IconProcess() {\n return <svg aria-hidden fill=\"none\" height=\"12\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"12\">\n <rect height=\"16\" rx=\"2\" width=\"18\" x=\"3\" y=\"4\" />\n <path d=\"m7 9 3 3-3 3M13 15h4\" />\n </svg>;\n}\n\ninterface StopState { busy?: boolean; error?: string }\n\nfunction ProcessPill({ process, state, writable, onStop, toolbar = false }: { process: RunProcess; state?: StopState; writable: boolean; onStop: () => void; toolbar?: boolean }) {\n const stop = <StopButton busy={state?.busy === true} className={stopClass} disabled={!writable || state?.busy}\n label={state?.busy ? `Stopping ${process.label}` : `Stop ${process.label}`}\n onClick={onStop} size=\"icon-xs\"\n title={!writable ? \"Write or inspect rights are missing to stop\" : state?.busy ? \"Stopping ...\" : `Stop ${process.label}`} />;\n const ports = process.ports.map((port) => <a className={portClass} href={serviceUrl(window.location.hostname, port.port)}\n key={`${port.address}:${port.port}`} rel=\"noreferrer\" target=\"_blank\" title={`Open ${port.address}:${port.port} in a new tab`}>\n :{port.port}\n </a>);\n return <div className={cn(\"flex min-w-0 flex-col\", toolbar ? \"flex-none self-stretch max-md:not-first:hidden\" : \"w-full\")} data-process-id={process.id}>\n {toolbar\n ? <ToolbarItem className=\"max-w-none flex-1 data-[origin=background]:[border-right-style:dashed]\" data-origin={process.origin} title={titleOf(process)}>\n <IconProcess />\n <ToolbarCopy className=\"w-35 flex-none\">\n <ToolbarLabel>{kindLabel(process)}</ToolbarLabel>\n <ToolbarText>{process.label}</ToolbarText>\n </ToolbarCopy>\n {ports}\n {stop}\n </ToolbarItem>\n : <span className={cn(pillClass, \"w-full\")} data-origin={process.origin} title={titleOf(process)}>\n <IconProcess />\n <em className=\"flex-none text-[0.56rem] font-bold uppercase not-italic tracking-[0.035em]\">{kindLabel(process)}</em>\n <span className=\"min-w-0 flex-1 overflow-hidden text-ellipsis text-foreground\">{process.label}</span>\n {ports}\n {stop}\n </span>}\n {state?.error && <span className={cn(\"text-[0.65rem] text-destructive\", toolbar ? \"max-w-62 overflow-hidden text-ellipsis whitespace-nowrap\" : \"[overflow-wrap:anywhere]\")}\n role=\"alert\" title={state.error}>{state.error}</span>}\n </div>;\n}\n\nfunction ProcessHeaderContent({ runId }: { runId: string }) {\n const access = useAccess();\n const writable = access.can(\"runs.write\") && access.can(\"runs.inspect\");\n const state = useRunProcesses(runId);\n const [stops, setStops] = useState<Record<string, StopState>>({});\n const [allOpen, setAllOpen] = useState(false);\n const requests = useRef(new Map<string, AbortController>());\n const rootRef = useRef<HTMLDivElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const focused = useRef<HTMLElement>(null);\n const fallback = useRef<HTMLElement>(null);\n const processes = state.snapshot?.processes ?? [];\n const { shown, hidden } = visibleProcesses(processes);\n useEffect(() => {\n const active = requests.current;\n return () => { for (const controller of active.values()) controller.abort(); active.clear(); };\n }, []);\n useLayoutEffect(() => {\n if (!focused.current || focused.current.isConnected || document.activeElement !== document.body) return;\n const target = (allOpen ? dialogRef.current : rootRef.current)?.querySelector<HTMLElement>(\"button:not(:disabled), a[href]\")\n ?? (allOpen ? dialogRef.current : null) ?? fallback.current;\n focused.current = null;\n target?.focus({ preventScroll: true });\n }, [state.snapshot, allOpen]);\n const rememberFocus = (event: FocusEvent<HTMLElement>) => {\n if (!(event.target instanceof HTMLElement)) return;\n focused.current = event.target;\n const header = rootRef.current?.closest(\"header\");\n fallback.current = [...(header?.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\") ?? [])]\n .find((element) => !rootRef.current?.contains(element)) ?? null;\n };\n const stop = async (process: RunProcess) => {\n if (!writable || requests.current.has(process.id) || stops[process.id]?.busy) return;\n const controller = new AbortController();\n requests.current.set(process.id, controller);\n setStops((current) => ({ ...current, [process.id]: { busy: true } }));\n try {\n await rpc.call(processesContracts.stop, { runId, processId: process.id }, { signal: controller.signal });\n } catch (cause) {\n if (!controller.signal.aborted) setStops((current) => ({ ...current, [process.id]: { error: cause instanceof Error ? cause.message : String(cause) } }));\n } finally { requests.current.delete(process.id); }\n };\n const renderProcess = (process: RunProcess, toolbar = false) => <ProcessPill key={process.id} process={process} state={stops[process.id]} writable={writable} toolbar={toolbar} onStop={() => { void stop(process); }} />;\n if (shown.length === 0 && state.error === undefined && !allOpen) return null;\n return <>\n <div aria-label=\"Processes and ports of the run\" className=\"flex min-w-0 flex-none items-stretch self-stretch\" ref={rootRef} onFocusCapture={rememberFocus}>\n {shown.map((process) => renderProcess(process, true))}\n {(processes.length > 1 || allOpen) && <ToolbarItem as=\"button\" className=\"md:data-[hidden=false]:hidden\" data-hidden={hidden > 0 || allOpen} type=\"button\" onClick={() => setAllOpen(true)} title=\"Show all processes of the run\">\n <span className=\"max-md:hidden\">{hidden > 0 ? `+${hidden} more` : \"Processes\"}</span><span className=\"hidden max-md:inline\">All {processes.length}</span>\n </ToolbarItem>}\n {state.error !== undefined && <ToolbarItem className=\"w-42 text-destructive\" role=\"status\" title={state.error}><ToolbarCopy><ToolbarLabel>Processes</ToolbarLabel><ToolbarText>Monitoring disrupted</ToolbarText></ToolbarCopy></ToolbarItem>}\n </div>\n {allOpen && <Dialog open onOpenChange={(open) => {\n if (open) return;\n setAllOpen(false);\n if (processes.length === 0) requestAnimationFrame(() => fallback.current?.focus({ preventScroll: true }));\n }}>\n <DialogContent scope=\"run\">\n <DialogHeader><DialogTitle>Processes and ports</DialogTitle></DialogHeader>\n <DialogBody className=\"flex flex-col gap-3 outline-none\" ref={dialogRef} tabIndex={-1} onFocusCapture={rememberFocus}>\n {processes.length > 0 ? processes.map((process) => renderProcess(process)) : <p role=\"status\">No active processes.</p>}\n {state.error !== undefined && <p className=\"text-destructive\" role=\"alert\">{state.error}</p>}\n </DialogBody>\n </DialogContent>\n </Dialog>}\n </>;\n}\n\nexport const processHeader = (): ComponentType<SessionHeaderContext> =>\n function ProcessHeader({ session }: SessionHeaderContext) {\n const access = useAccess();\n return access.can(\"runs.read\") && access.can(\"ragents.processes.read\")\n ? <ProcessHeaderContent key={session.session.id} runId={session.session.id} /> : null;\n };\n", "import {\n type WebPlugin,\n type WebPluginDescriptor,\n} from \"@ragents/web/PluginRegistry\";\nimport { PROCESSES_PLUGIN_ID } from \"../contract\";\nimport { processHeader } from \"./ProcessHeader\";\n\nconst configuredPlugin = (descriptor: WebPluginDescriptor): WebPlugin => ({\n ...descriptor,\n sessionHeaders: [{\n readRight: \"ragents.processes.read\",\n requiresWorkspace: true,\n id: \"ragents.processes.live\",\n order: 110,\n Header: processHeader(),\n }],\n});\n\nconst descriptor: WebPluginDescriptor = { id: PROCESSES_PLUGIN_ID };\n\nexport const webPlugin: WebPlugin = {\n ...descriptor,\n activate: () => configuredPlugin(descriptor),\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,UAAW,MAAM,ECArC,IAAOC,EAAQC,EAAK,mCAAoC,eAAe,ECAvE,IAAOC,EAAQC,EAAK,mCAAoC,iBAAiB,ECAzE,IAAOC,EAAQC,EAAK,qCAAsC,UAAU,ECG7D,IAAMC,EAAsB,oBA6B7BC,EAAQC,EAAK,OAAO,CAAE,UAAW,EAAG,UAAW,GAAI,YAAa,QAAS,CAAC,EAEnEC,EAAqB,CAChC,SAAUC,EAAgB,CACxB,GAAI,6BACJ,YAAa,uGACb,OAAQ,CAAC,YAAa,wBAAwB,EAC9C,MAAOF,EAAK,OAAO,CAAE,MAAAD,CAAM,EAAG,CAAE,qBAAsB,EAAM,CAAC,EAC7D,OAAQI,EAA6B,oBAAoB,CAC3D,CAAC,EACD,KAAMD,EAAgB,CACpB,GAAI,yBACJ,YAAa,4EACb,OAAQ,CAAC,YAAa,aAAc,cAAc,EAClD,MAAOF,EAAK,OAAO,CACjB,MAAAD,EACA,UAAWC,EAAK,OAAO,CAAE,QAAS,6BAA8B,YAAa,8BAA+B,CAAC,CAC/G,EAAG,C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EAAA,CAAa,qBAAS,EAAef,EAACiB,EAAA,CAAY,gCAAoB,GAAc,EAAc,GACjO,EACCM,GAAWvB,EAAC8C,EAAA,CAAO,KAAI,GAAC,aAAeC,GAAS,CAC3CA,IACJvB,EAAW,EAAK,EACZO,EAAU,SAAW,GAAG,sBAAsB,IAAMD,EAAS,SAAS,MAAM,CAAE,cAAe,EAAK,CAAC,CAAC,EAC1G,EACE,SAAA/B,EAACiD,EAAA,CAAc,MAAM,MACnB,UAAAhD,EAACiD,EAAA,CAAa,SAAAjD,EAACkD,EAAA,CAAY,+BAAmB,EAAc,EAC5DnD,EAACoD,EAAA,CAAW,UAAU,mCAAmC,IAAKvB,EAAW,SAAU,GAAI,eAAgBW,EACpG,UAAAR,EAAU,OAAS,EAAIA,EAAU,IAAK7B,GAAY0C,EAAc1C,CAAO,CAAC,EAAIF,EAAC,KAAE,KAAK,SAAS,gCAAoB,EACjHb,EAAM,QAAU,QAAaa,EAAC,KAAE,UAAU,mBAAmB,KAAK,QAAS,SAAAb,EAAM,MAAM,GAC1F,GACF,EACF,GACF,CACF,CAEO,IAAMiE,GAAgB,IAC3B,SAAuB,CAAE,QAAAC,CAAQ,EAAyB,CACxD,IAAMlC,EAASC,EAAU,EACzB,OAAOD,EAAO,IAAI,WAAW,GAAKA,EAAO,IAAI,wBAAwB,EACjEnB,EAACkB,GAAA,CAA8C,MAAOmC,EAAQ,QAAQ,IAA3CA,EAAQ,QAAQ,EAA+B,EAAK,IACrF,EClJF,IAAMC,GAAoBC,IAAgD,CACxE,GAAGA,EACH,eAAgB,CAAC,CACf,UAAW,yBACX,kBAAmB,GACnB,GAAI,yBACJ,MAAO,IACP,OAAQC,GAAc,CACxB,CAAC,CACH,GAEMD,GAAkC,CAAE,GAAIE,CAAoB,EAErDC,GAAuB,CAClC,GAAGH,GACH,SAAU,IAAMD,GAAiBC,EAAU,CAC7C",
6
6
  "names": ["read", "specifier", "name", "module", "typebox_Type_default", "read", "contract_defineChannel_default", "read", "contract_defineOperation_default", "read", "contracts_openJson_default", "read", "PROCESSES_PLUGIN_ID", "runId", "typebox_Type_default", "processesContracts", "contract_defineOperation_default", "contracts_openJson_default", "contract_defineChannel_default", "react_useEffect_default", "read", "react_useLayoutEffect_default", "read", "react_useRef_default", "read", "react_useState_default", "read", "AccessContext_useAccess_default", "read", "ui_Dialog_default", "read", "ui_DialogBody_default", "read", "ui_DialogContent_default", "read", "ui_DialogHeader_default", "read", "ui_DialogTitle_default", "read", "ui_StopButton_default", "read", "ui_cn_default", "read", "Toolbar_ToolbarCopy_default", "read", "Toolbar_ToolbarItem_default", "read", "Toolbar_ToolbarLabel_default", "read", "Toolbar_ToolbarText_default", "read", "rpc_rpc_default", "read", "guards_isRecord_default", "read", "VISIBLE_PROCESSES", "ORIGINS", "portFrom", "value", "guards_isRecord_default", "processFrom", "snapshotFrom", "messageFrom", "serviceUrl", "hostname", "port", "kindLabel", "process", "originText", "origin", "timeText", "iso", "parsed", "titleOf", "ports", "visibleProcesses", "processes", "jsx_runtime_Fragment_default", "read", "jsx_runtime_jsx_default", "read", "jsx_runtime_jsxs_default", "read", "idle", "pillClass", "portClass", "stopClass", "useRunProcesses", "runId", "state", "setState", "react_useState_default", "react_useEffect_default", "rpc_rpc_default", "processesContracts", "data", "message", "messageFrom", "current", "caught", "IconProcess", "jsx_runtime_jsxs_default", "jsx_runtime_jsx_default", "ProcessPill", "process", "writable", "onStop", "toolbar", "stop", "ui_StopButton_default", "ports", "port", "serviceUrl", "ui_cn_default", "Toolbar_ToolbarItem_default", "titleOf", "Toolbar_ToolbarCopy_default", "Toolbar_ToolbarLabel_default", "kindLabel", "Toolbar_ToolbarText_default", "ProcessHeaderContent", "access", "AccessContext_useAccess_default", "stops", "setStops", "allOpen", "setAllOpen", "requests", "react_useRef_default", "rootRef", "dialogRef", "focused", "fallback", "processes", "shown", "hidden", "visibleProcesses", "active", "controller", "react_useLayoutEffect_default", "target", "rememberFocus", "event", "header", "element", "cause", "renderProcess", "jsx_runtime_Fragment_default", "ui_Dialog_default", "open", "ui_DialogContent_default", "ui_DialogHeader_default", "ui_DialogTitle_default", "ui_DialogBody_default", "processHeader", "session", "configuredPlugin", "descriptor", "processHeader", "PROCESSES_PLUGIN_ID", "webPlugin"]
7
7
  }
@@ -136,8 +136,8 @@
136
136
  ]
137
137
  }
138
138
  },
139
- "revision": "53498a6dbf25ada77b6dcdf7bb1d188c16229a85c7ddeeafa10e6335a8230954",
140
- "sourceRevision": "f937fbba39f6d0ab90e55e494976d0d650054b722212d7e25cf8ddb835f91492",
139
+ "revision": "db9370b7b3449c44be49986b074806351b857c430963aa878e209d2d5c9ba4f8",
140
+ "sourceRevision": "b86182fd6493e5628df38ed1669e857bd16742645380f76bacd7514446be3514",
141
141
  "server": "server/index.js",
142
142
  "web": {
143
143
  "entry": "web/index.js",
@@ -1 +1 @@
1
- ["--accent","--destructive","--row-indent","--warning","[&>svg]:rotate-90","a","about","absolutePath","additionalProperties","adjusts","alert","alive","all","already","always","an","and","animate-spin","any","appear","are","aria-hidden","aria-label","as","async","at","available","await","back","bash","be","becomes","before","below","bg-destructive/8","binary","binding","bindingFrom","bindingOf","binds","blue","boolean","border-b-border-soft","border-border-soft","border-t","border-t-0","border-x-0","bound","break-words","brings","browse","browseTarget","bundle","busy","by","byExtension","byName","bytes","call","called","caller","calling","calls","cannot","carry","case","catch","cause","change","changed","channels","choice","chooseFolder","chooseMachine","chooseOffered","chosen","chosenRoot","cjs","className","client","clientDescription","clientId","clientInfoSchema","clientRegistrationSchema","clients","commit","connected","connection","const","contain","content","contributes","contribution","contributions","creates","cs","csproj","css","cts","current","currentColor","cwd","data-selected","data-selected:bg-primary/12","data-selected:text-primary","default","defineOperation","depth","description","destructive","different","directory","disabled","do","dockerfile","does","draft","each","else","empty","emptyHints","en-US","entries","entry","env","errorClass","even","event","every","exactly","excludes","execute","executor","executorContributions","executorVersion","existing","exists","expanded","expandedRef","export","extends","extension","fails","false","fetchBrowseListing","fetchBrowsePreview","fields","file","fileIconFor","fileToneClass","files","fill","finally","finds","flex","flex-1","flex-col","flex-none","flex-wrap","folder","folderChoices","folderDraft","folderOf","folders","font-medium","font-mono","font-normal","font-semibold","for","fresh","freshLabelOf","freshLabelsOf","freshServerBinding","from","fromKind","frozen","fs","fsproj","fsx","full","function","gap-1","gap-1.5","gap-2","ghost","gif","git","gitignore","gone","green","gz","h-7","h-auto","h-full","hasExactly","hbs","height","here","hidden","holds","host","hostname","htm","html","htmlFor","ico","icon","id","if","immutable","implementedBy","import","in","indent","ini","inline-flex","input","inspect","instanceof","interface","into","is","isClientInfo","isFolder","isFreshFolder","isFreshLabels","isMachine","isRecord","isWorkspaceBinding","it","items","items-center","items-end","items-start","its","itself","journal","journals","jpeg","jpg","js","json","jsx","justify-center","justify-start","key","keyRef","keys","kind","know","label","labelClass","labels","large","leading-[1.45]","left","length","let","list","listing","load","loads","location","lock","looks","lucide-react","machine","machineDraft","machineOf","machines","mapped","mapping","marker","max-w-full","maxItems","maxLength","may","md","message","messageOf","metadata","min-h-0","min-h-30","min-w-0","min-w-[15rem]","minLength","missing","mjs","model","modifiedAt","module","moment","mts","muted","name","named","needs","neither","new","next","nextFolder","nextMachine","nextPath","none","nor","not","nothing","null","number","object","observed","of","offered","offers","older","on","onBlur","onChange","onClick","onKeyDown","onPressedChange","onValueChange","one","only","open","openFile","openJson","operation","option","optionId","or","orange","order","other","otherExecutorRegistration","out","outline","overflow-auto","overflow-hidden","own","p-7","params","parse","parsed","path","pathId","pathOf","pattern","pb-1.5","pb-2","pb-2.5","pdf","per","pink","pl-(--row-indent)","pl-px","placeholder","platform","plugin","plugins","png","pr-2.5","presentation","presentationFrom","pressed","preview","previewSourceClass","previewable","process","progress","prompt","provide","pt-0","pt-0.5","px","px-2.5","py","py-1","py-1.5","py-2","py-[3px]","raw","reachable","react","read","readRight","readonly","reason","records","red","register","rejects","releases","renderLevel","renew","reports","request","rest","result","results","return","revision","rg","right","rights","ripgrep","role","root","rootLabels","rootListing","roots","round","rounded-none","rowClass","rpc","rules","run","runId","runsDirectory","s","same","sameBinding","sandbox","saved","says","search","selected","sends","server","serverFolders","session","sessionMetadata","setDraft","setError","setExpanded","setFolder","setListings","setMachine","setPending","setPreview","setReload","setRoot","setSelected","setShowHidden","setValue","sh","shape","showHidden","shrink-0","sign-in","signed-in","size","size-3","size-3.5","sizeLabel","sln","slnx","sm","so","start","startOptions","state","stateKey","stays","stop","storage","store","stored","storedWorkspaceBinding","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","subfolder","such","summary","svg","switch","tabular-nums","tar","targets","tasks","teal","text","text-[0.64rem]","text-[0.66rem]","text-[0.68rem]","text-[0.72rem]","text-[0.75rem]","text-[0.7rem]","text-[color-mix(in_srgb,var(--destructive)_65%,var(--accent))]","text-[color-mix(in_srgb,var(--warning)_75%,var(--destructive))]","text-destructive","text-info","text-left","text-muted-foreground","text-primary","text-sm","text-success","text-teal","text-warning","text-xs","that","the","there","this","through","throw","timeLabel","timer","title","to","toggleDirectory","toml","tone","too","tool","toolCallId","treeMemory","truncate","truncated","try","ts","tsx","txt","type","typebox","typeof","unambiguously","undefined","under","unknown","unreadable","unregister","unsubscribe","useState","users","value","variant","version","viewBox","violet","visible","void","w-3","w-full","way","webPlugin","webp","were","what","where","whether","which","whitespace-pre-wrap","whose","width","with","without","working","workspace","workspace-binding","workspace-executor-version","workspaceBindingSummary","workspaceClientContracts","workspaceContracts","workspaceFolderChoices","workspaceMachineChoices","workspaceMetadataFrom","workspaceTabs","workstation","workstations","write","yaml","yellow","yml","your","zip","zsh"]
1
+ ["--accent","--destructive","--row-indent","--warning","[&>svg]:rotate-90","a","about","absolutePath","additionalProperties","adjusts","alert","alive","all","already","always","an","and","animate-spin","any","appear","are","aria-hidden","aria-label","as","async","at","available","await","back","bash","be","becomes","before","below","bg-destructive/8","binary","binding","bindingFrom","bindingOf","binds","blue","boolean","border-b-border-soft","border-border-soft","border-t","border-t-0","border-x-0","bound","break-words","brings","browse","browseTarget","bundle","busy","by","byExtension","byName","bytes","call","called","caller","calling","calls","cannot","carry","case","catch","cause","change","changed","channels","choice","chooseFolder","chooseMachine","chooseOffered","chosen","chosenRoot","cjs","className","client","clientDescription","clientId","clientInfoSchema","clientRegistrationSchema","clients","commit","connected","connection","const","contain","content","contributes","contribution","contributions","creates","cs","csproj","css","cts","current","currentColor","cwd","data-selected","data-selected:bg-primary/12","data-selected:text-primary","default","defineOperation","depth","description","destructive","different","directory","disabled","do","dockerfile","does","draft","each","else","empty","emptyHints","entries","entry","env","errorClass","even","event","every","exactly","excludes","execute","executor","executorContributions","executorVersion","existing","exists","expanded","expandedRef","export","extends","extension","fails","false","fetchBrowseListing","fetchBrowsePreview","fields","file","fileIconFor","fileToneClass","files","fill","finally","finds","flex","flex-1","flex-col","flex-none","flex-wrap","folder","folderChoices","folderDraft","folderOf","folders","font-medium","font-mono","font-normal","font-semibold","for","fresh","freshLabelOf","freshLabelsOf","freshServerBinding","from","fromKind","frozen","fs","fsproj","fsx","full","function","gap-1","gap-1.5","gap-2","ghost","gif","git","gitignore","gone","green","gz","h-7","h-auto","h-full","hasExactly","hbs","height","here","hidden","holds","host","hostname","htm","html","htmlFor","ico","icon","id","if","immutable","implementedBy","import","in","indent","ini","inline-flex","input","inspect","instanceof","interface","into","is","isClientInfo","isFolder","isFreshFolder","isFreshLabels","isMachine","isRecord","isWorkspaceBinding","it","items","items-center","items-end","items-start","its","itself","journal","journals","jpeg","jpg","js","json","jsx","justify-center","justify-start","key","keyRef","keys","kind","know","label","labelClass","labels","large","leading-[1.45]","left","length","let","list","listing","load","loads","location","lock","looks","lucide-react","machine","machineDraft","machineOf","machines","mapped","mapping","marker","max-w-full","maxItems","maxLength","may","md","message","messageOf","metadata","min-h-0","min-h-30","min-w-0","min-w-[15rem]","minLength","missing","mjs","model","modifiedAt","module","moment","mts","muted","name","named","needs","neither","new","next","nextFolder","nextMachine","nextPath","none","nor","not","nothing","null","number","object","observed","of","offered","offers","older","on","onBlur","onChange","onClick","onKeyDown","onPressedChange","onValueChange","one","only","open","openFile","openJson","operation","option","optionId","or","orange","order","other","otherExecutorRegistration","out","outline","overflow-auto","overflow-hidden","own","p-7","params","parse","parsed","path","pathId","pathOf","pattern","pb-1.5","pb-2","pb-2.5","pdf","per","pink","pl-(--row-indent)","pl-px","placeholder","platform","plugin","plugins","png","pr-2.5","presentation","presentationFrom","pressed","preview","previewSourceClass","previewable","process","progress","prompt","provide","pt-0","pt-0.5","px","px-2.5","py","py-1","py-1.5","py-2","py-[3px]","raw","reachable","react","read","readRight","readonly","reason","records","red","register","rejects","releases","renderLevel","renew","reports","request","rest","result","results","return","revision","rg","right","rights","ripgrep","role","root","rootLabels","rootListing","roots","round","rounded-none","rowClass","rpc","rules","run","runId","runsDirectory","s","same","sameBinding","sandbox","saved","says","search","selected","sends","server","serverFolders","session","sessionMetadata","setDraft","setError","setExpanded","setFolder","setListings","setMachine","setPending","setPreview","setReload","setRoot","setSelected","setShowHidden","setValue","sh","shape","showHidden","shrink-0","sign-in","signed-in","size","size-3","size-3.5","sizeLabel","sln","slnx","sm","so","start","startOptions","state","stateKey","stays","stop","storage","store","stored","storedWorkspaceBinding","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","subfolder","such","summary","svg","switch","tabular-nums","tar","targets","tasks","teal","text","text-[0.64rem]","text-[0.66rem]","text-[0.68rem]","text-[0.72rem]","text-[0.75rem]","text-[0.7rem]","text-[color-mix(in_srgb,var(--destructive)_65%,var(--accent))]","text-[color-mix(in_srgb,var(--warning)_75%,var(--destructive))]","text-destructive","text-info","text-left","text-muted-foreground","text-primary","text-sm","text-success","text-teal","text-warning","text-xs","that","the","there","this","through","throw","timeLabel","timer","title","to","toggleDirectory","toml","tone","too","tool","toolCallId","treeMemory","truncate","truncated","try","ts","tsx","txt","type","typebox","typeof","unambiguously","undefined","under","unknown","unreadable","unregister","unsubscribe","useState","users","value","variant","version","viewBox","violet","visible","void","w-3","w-full","way","webPlugin","webp","were","what","where","whether","which","whitespace-pre-wrap","whose","width","with","without","working","workspace","workspace-binding","workspace-executor-version","workspaceBindingSummary","workspaceClientContracts","workspaceContracts","workspaceFolderChoices","workspaceMachineChoices","workspaceMetadataFrom","workspaceTabs","workstation","workstations","write","yaml","yellow","yml","your","zip","zsh"]
@@ -1,4 +1,4 @@
1
- var t=(e,a)=>{let o=globalThis.__ragentsHostModules?.[e];if(o===void 0)throw new Error(`The host does not provide ${e}`);if(!(a in o))throw new Error(`The host does not provide ${a} from ${e}; the bundle was built against a newer host`);return o[a]};var l=t("typebox","Type");var ye=t("@ragents/engine/src/http/contracts","openJson");var Ee=t("@ragents/engine/src/rpc/contract","defineChannel");var z=t("@ragents/engine/src/rpc/contract","defineOperation");var ca="ragents.workspace",pa=["workspace","files"],ma="ragents.workspace.binding",La="ragents.workspace",ot=()=>({machine:"server",folder:"fresh"}),rt=/^[A-Za-z0-9_-]{8,64}$/,xa=l.String({pattern:"^[A-Za-z0-9_-]{8,64}$",description:"Stable ID of the workstation"}),Ge=l.String({minLength:1,maxLength:64,description:"Version of the executor that the workstation brings"}),ut=/^[a-z0-9]+(?:[.-][a-z0-9]+)*$/,Ia=l.Array(l.Object({plugin:l.String({pattern:ut.source,maxLength:128,description:"ID of the plugin"}),revision:l.String({pattern:"^[0-9a-f]{64}$",description:"SHA-256 of the contribution file"})},{additionalProperties:!1}),{maxItems:64,description:"The plugins' contributions to the executor, in the order of the server's plugin list"}),Me={label:l.String({minLength:1,maxLength:120}),hostname:l.String({minLength:1}),platform:l.String({minLength:1}),folders:l.Array(l.String({minLength:1}),{maxItems:32}),runsDirectory:l.String({minLength:1,description:"Absolute folder under which the workstation creates the new folders per run"}),ripgrep:l.Boolean({description:"Whether the workstation's bash finds rg"})},na=l.Object({id:l.String(),...Me},{additionalProperties:!1}),dt=l.Object({id:xa,...Me,executor:Ge,contributions:Ia},{additionalProperties:!1}),lt=l.Object({label:Me.label,executor:Ge},{description:"Sign-in with a different executor version in any shape; the server rejects it with workspace-executor-version"}),st=l.String({minLength:1,description:"Absolute path in the bound folder"});var jt={execute:z({id:"ragents.workspace.client.execute",description:"Run an operation of the executor on the workstation, such as a tool, a file query, or the process display; the result is its value, progress its JSON value. stop releases what the workstation holds for the run.",implementedBy:"client",input:l.Object({runId:l.String({minLength:1,maxLength:64,description:"ID of the run"}),operation:l.String({minLength:1,maxLength:64,description:"Name of the operation, such as read, bash, roslyn_open, files.list, or stop"}),toolCallId:l.Optional(l.String({minLength:1,maxLength:200,description:"Only for a tool call of the model"})),cwd:st,env:l.Record(l.String(),l.String(),{description:"What the server contributes: run marker and git rules of the sandbox"}),input:l.Unknown({description:"The input of the operation"})},{additionalProperties:!1}),result:l.Object({value:l.Unknown()},{additionalProperties:!1})})},De={runId:l.String({minLength:1,maxLength:64,description:"ID of the run"}),root:l.Union([l.Literal("workspace"),l.Literal("files")]),path:l.String({description:"Path below the root; empty is the root itself"})},de={browse:{list:z({id:"ragents.workspace.browse.list",description:"List a directory in the workspace or in the file store of a run.",rights:["runs.read","runs.inspect"],input:l.Object(De,{additionalProperties:!1}),result:ye("BrowseListing")}),preview:z({id:"ragents.workspace.browse.preview",description:"Preview a file as text; files that are too large or binary state the reason instead.",rights:["runs.read","runs.inspect"],input:l.Object(De,{additionalProperties:!1}),result:ye("BrowsePreview")})},channels:{browse:Ee({id:"ragents.workspace.browse",description:"Reports every change below the observed root of a run.",rights:["runs.read","runs.inspect"],params:l.Object({runId:De.runId,root:De.root},{additionalProperties:!1}),message:l.Object({changed:l.Literal(!0)},{additionalProperties:!1})})},clients:{list:z({id:"ragents.workspace.clients.list",description:"The caller's signed-in workstations; other users' workstations do not appear even with runs.read.all.",rights:["runs.read"],input:l.Object({},{additionalProperties:!1}),result:l.Array(na)}),contributions:z({id:"ragents.workspace.clients.contributions",description:"The plugins' contributions to the executor that a workstation loads before sign-in and reports back with it. A workstation with a different executor version fails on its version; other fields do not matter.",rights:["runs.write"],input:l.Object({label:Me.label,executor:Ge}),result:Ia}),register:z({id:"ragents.workspace.clients.register",description:"Sign in a workstation or renew its folders; the connection of this request becomes its return path and needs an event stream. A workstation with a different executor version fails on its version before the rest of the shape matters.",rights:["runs.write"],input:l.Union([dt,lt]),result:na}),unregister:z({id:"ragents.workspace.clients.unregister",description:"Sign out one of your own workstations; open tasks fail.",rights:["runs.write"],input:l.Object({id:xa},{additionalProperties:!1}),result:l.Null()})}},be=e=>typeof e=="object"&&e!==null,j=(e,a)=>Object.keys(e).length===a.length&&a.every(o=>Object.hasOwn(e,o)),ft=e=>e==="server"||be(e)&&j(e,["client","label"])&&typeof e.client=="string"&&rt.test(e.client)&&typeof e.label=="string",it=e=>e==="fresh"?!0:!be(e)||typeof e.path!="string"||e.path.length===0?!1:j(e,["path"])||j(e,["path","fresh"])&&e.fresh===!0,Fe=e=>be(e)&&j(e,["machine","folder"])&&ft(e.machine)&&it(e.folder)&&!(e.machine==="server"&&typeof e.folder=="object"&&"fresh"in e.folder),Ve=e=>e==="fresh"||"fresh"in e,nt=e=>{switch(e.kind){case"fresh":return j(e,["kind"])?ot():void 0;case"path":return j(e,["kind","path"])?{machine:"server",folder:{path:e.path}}:void 0;case"client":return j(e,["kind","client","label","path"])?{machine:{client:e.client,label:e.label},folder:{path:e.path}}:void 0;default:return}},Ca=e=>{if(Fe(e))return e;let a=be(e)&&Object.hasOwn(e,"kind")?nt(e):void 0;return Fe(a)?a:void 0},Re="Empty folder per run",ct=(e,a)=>(e.machine==="server"?a.server:a.client)??Re,ha=(e,a)=>{let{machine:o,folder:d}=e,x=ct(e,a),B=d==="fresh"?x:"fresh"in d?`${d.path} (${x})`:d.path;return o==="server"?B:`${o.label}: ${B}`};var ze=t("@ragents/web/ui","Alert");var Te=t("@ragents/web/ui","Button");var Ne=t("@ragents/web/ui","Empty");var Xe=t("@ragents/web/ui","EmptyDescription");var Ke=t("@ragents/web/ui","EmptyHeader");var Ze=t("@ragents/web/ui","EmptyMedia");var _e=t("@ragents/web/ui","EmptyTitle");var je=t("@ragents/web/ui","Input");var Qe=t("@ragents/web/ui","Label");var le=t("@ragents/web/ui","Select");var se=t("@ragents/web/ui","SelectContent");var fe=t("@ragents/web/ui","SelectItem");var ie=t("@ragents/web/ui","SelectTrigger");var ne=t("@ragents/web/ui","SelectValue");var ve=t("@ragents/web/ui","Toggle");var Je=t("react","createContext");var Q=t("react","createElement");var ce=t("react","forwardRef");var $e=t("react","useContext");var te=t("react","useEffect");var Ye=t("react","useId");var qe=t("react","useMemo");var pe=t("react","useRef");var A=t("react","useState");var ga=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function Sa(e,a,o=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ga(e),size:24,node:a,...o.length>0?{aliases:o}:{}}}var ka=e=>{let a="",o=!1;for(let d of e){if(d==="-"||d==="_"||d<=" "){o=a.length>0;continue}a.length===0?a+=d.toLowerCase():a+=o?d.toUpperCase():d,o=!1}return a};var wa=e=>{let a=ka(e);return a.charAt(0).toUpperCase()+a.slice(1)};var me=(...e)=>e.filter((a,o,d)=>!!a&&a.trim()!==""&&d.indexOf(a)===o).join(" ").trim();var N={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function ea(e){return e!=null}function Pa(e,a={}){let o=a.attributeNames??{},d=c=>o[c]??c,x=e.size??e.width??N.width,B=e.size??e.height??N.height,S=e.aliases?.filter(c=>typeof c=="string"&&c.trim()!=="").map(c=>`lucide-${c}`)??[],H=[...e.name?[`lucide-${e.name}`]:[],...S],p=a.className?.split(" ").filter(Boolean)??[],y=a.includeDefaultClasses===!1?me(...p):me("lucide",...H,...p),M=a.absoluteStrokeWidth?Number(a.strokeWidth??N["stroke-width"])*Number(e.size??e.width??N.width)/Number(a.size??a.width??N.width):a.strokeWidth??N["stroke-width"];return["svg",{...Object.entries(N).reduce((c,[h,i])=>(c[d(h)]=i,c),{}),..."color"in a&&a.color&&{[d("stroke")]:a.color},..."size"in a&&ea(a.size)&&{[d("width")]:a.size,[d("height")]:a.size},..."width"in a&&ea(a.width)&&{[d("width")]:a.width},..."height"in a&&ea(a.height)&&{[d("height")]:a.height},[d("stroke-width")]:M,...y&&{[d("class")]:y},[d("viewBox")]:`0 0 ${x} ${B}`,...a.hasA11yProp===!1?{[d("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(c=>{let[h,i,k]=c,m=a.nonScalingStroke?{[d("vector-effect")]:"non-scaling-stroke",...i}:i;return k?[h,m,k]:[h,m]})]}function Aa(e,a={}){return Pa(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Ba=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var pt=Je({});var ya=()=>$e(pt);var Da=ce(({color:e,size:a,width:o,height:d,strokeWidth:x,absoluteStrokeWidth:B,nonScalingStroke:S,className:H="",children:p,iconNode:y=[],icon:M={node:y,aliases:[],size:24},...O},c)=>{let{size:h=24,strokeWidth:i=2,absoluteStrokeWidth:k=!1,nonScalingStroke:m=!1,color:w="currentColor",className:Z=""}=ya()??{},b=!!p||Ba(O),[ae,F,re=[]]=Aa(M,{color:e??w,width:o??a??h,height:d??a??h,strokeWidth:x??i,absoluteStrokeWidth:B??k,nonScalingStroke:S??m,className:me(Z,H),hasA11yProp:b,attributes:O});return Q(ae,{ref:c,...F},[...re.map(([W,E])=>Q(W,E)),...Array.isArray(p)?p:[p]])});function f(e,a=[],o=[]){let d=typeof e=="string"?Sa(e,a,o):e,x=ce(({className:B,...S},H)=>Q(Da,{ref:H,icon:d,className:B,...S}));return d.name&&(x.displayName=wa(d.name)),x}var Fa={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};Fa.node;var U=f(Fa);var Ma={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Ma.node;var Le=f(Ma);var ba={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};ba.node;var xe=f(ba);var Ra={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Ra.node;var Ie=f(Ra);var Ta={name:"file-archive",size:24,node:[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]};Ta.node;var J=f(Ta);var va={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};va.node;var L=f(va);var qa={name:"file-cog",size:24,node:[["path",{d:"M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z",key:"1ckgky"}],["path",{d:"M20 8v12a2 2 0 0 1-2 2h-4.182",key:"1726p0"}],["path",{d:"m3.305 19.53.923-.382",key:"ao1pio"}],["path",{d:"M4 10.592V4a2 2 0 0 1 2-2h8",key:"1foop0"}],["path",{d:"m4.228 16.852-.924-.383",key:"1fv9zy"}],["path",{d:"m5.852 15.228-.383-.923",key:"1a9hc2"}],["path",{d:"m5.852 20.772-.383.924",key:"1sh9ke"}],["path",{d:"m8.148 15.228.383-.923",key:"4yu6lf"}],["path",{d:"m8.53 21.696-.382-.924",key:"18b0s9"}],["path",{d:"m9.773 16.852.922-.383",key:"ti6xop"}],["path",{d:"m9.773 19.148.922.383",key:"rws47d"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],aliases:["file-cog-2"]};qa.node;var C=f(qa);var Oa={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};Oa.node;var q=f(Oa);var Ua={name:"file-terminal",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]]};Ua.node;var $=f(Ua);var Ha={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};Ha.node;var Y=f(Ha);var Wa={name:"file",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]};Wa.node;var Ce=f(Wa);var Ea={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};Ea.node;var ee=f(Ea);var Ga={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};Ga.node;var X=f(Ga);var Va={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};Va.node;var he=f(Va);var za={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};za.node;var ge=f(za);var aa=t("@ragents/web/PluginRegistry","workspaceAccessible");var oe=t("@ragents/web/rpc","rpc");var ta=(e,a,o)=>oe.call(de.browse.list,{runId:e,root:a,path:o}),oa=(e,a,o)=>oe.call(de.browse.preview,{runId:e,root:a,path:o});var Na={blue:"text-info",yellow:"text-warning",green:"text-success",teal:"text-teal",orange:"text-[color-mix(in_srgb,var(--warning)_75%,var(--destructive))]",pink:"text-[color-mix(in_srgb,var(--destructive)_65%,var(--accent))]",violet:"text-primary",red:"text-destructive",muted:"text-muted-foreground"},mt={ts:{Icon:L,tone:"blue"},tsx:{Icon:L,tone:"blue"},mts:{Icon:L,tone:"blue"},cts:{Icon:L,tone:"blue"},js:{Icon:L,tone:"yellow"},jsx:{Icon:L,tone:"yellow"},mjs:{Icon:L,tone:"yellow"},cjs:{Icon:L,tone:"yellow"},cs:{Icon:L,tone:"green"},fs:{Icon:L,tone:"teal"},fsx:{Icon:L,tone:"teal"},py:{Icon:L,tone:"green"},json:{Icon:U,tone:"yellow"},md:{Icon:Y,tone:"violet"},txt:{Icon:Y,tone:"muted"},pdf:{Icon:Y,tone:"red"},html:{Icon:L,tone:"orange"},htm:{Icon:L,tone:"orange"},hbs:{Icon:L,tone:"orange"},css:{Icon:he,tone:"pink"},png:{Icon:q,tone:"violet"},jpg:{Icon:q,tone:"violet"},jpeg:{Icon:q,tone:"violet"},gif:{Icon:q,tone:"violet"},webp:{Icon:q,tone:"violet"},svg:{Icon:q,tone:"violet"},ico:{Icon:q,tone:"violet"},sh:{Icon:$,tone:"green"},zsh:{Icon:$,tone:"green"},bash:{Icon:$,tone:"green"},yml:{Icon:C,tone:"muted"},yaml:{Icon:C,tone:"muted"},toml:{Icon:C,tone:"muted"},ini:{Icon:C,tone:"muted"},csproj:{Icon:C,tone:"blue"},fsproj:{Icon:C,tone:"teal"},sln:{Icon:C,tone:"blue"},slnx:{Icon:C,tone:"blue"},zip:{Icon:J,tone:"orange"},gz:{Icon:J,tone:"orange"},tar:{Icon:J,tone:"orange"},lock:{Icon:C,tone:"muted"}},Lt={"package.json":{Icon:U,tone:"green"},"pnpm-lock.yaml":{Icon:C,tone:"muted"},"tsconfig.json":{Icon:U,tone:"blue"},".gitignore":{Icon:C,tone:"muted"},dockerfile:{Icon:C,tone:"teal"}},Xa=(e,a,o)=>{if(a==="directory")return{Icon:o?ee:X,tone:"muted"};let d=Lt[e.toLowerCase()];if(d)return d;let x=e.includes(".")?e.toLowerCase().split(".").at(-1)??"":"";return mt[x]??{Icon:Ce,tone:"muted"}};var ra=t("@ragents/web/SourceCode","SourceCode");var ua=t("react/jsx-runtime","Fragment");var r=t("react/jsx-runtime","jsx");var n=t("react/jsx-runtime","jsxs");var xt="h-auto w-full justify-start gap-1.5 rounded-none py-[3px] pr-2.5 pl-(--row-indent) text-[0.7rem] font-normal data-selected:bg-primary/12 data-selected:text-primary",It="min-w-0 px-2.5 pt-0 pb-2.5 text-xs leading-[1.45] whitespace-pre-wrap break-words",Ka=e=>({"--row-indent":`${8+e*12}px`}),Ct={workspace:"Working directory",files:"File storage"},ht={workspace:"There is nothing in the run's working directory yet.",files:"There is nothing in the run's file storage yet."},da=e=>e instanceof Error?e.message:String(e),Za=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,gt=e=>{let a=new Date(e);return Number.isNaN(a.getTime())?e:a.toLocaleString("en-US")};function _a({active:e,session:a}){let o=a.session.id,d=pe(new Map),x=aa(a.session),B=x?pa:["files"],[S,H]=A("workspace"),p=x?S:"files",y=`${o}|${p}`,[M,O]=A(()=>new Map),[c,h]=A(()=>new Set),[i,k]=A(),[m,w]=A(),[Z,b]=A(),[ae,F]=A(!1),[re,W]=A(0),[E,We]=A(!1),we=pe(c);we.current=c;let u=pe(y);te(()=>{if(u.current===y)return;u.current=y;let s=d.current.get(y);O(new Map),h(s?.expanded??new Set),k(s?.selected),w(void 0),b(void 0)},[y]),te(()=>{d.current.set(y,{expanded:c,selected:i})},[c,p,o,i,y]),te(()=>{if(!e||i===void 0||m!==void 0)return;let s=!0;return oa(o,p,i).then(I=>s&&w(I)).catch(()=>s&&k(void 0)),()=>{s=!1}},[e,m,p,o,i]),te(()=>{if(!e)return;let s=!0,I,P=!1,ue=async V=>{if(!P){P=!0,V&&F(!0);try{let _=["",...we.current],Pe=await Promise.all(_.map(async D=>({directory:D,listing:await ta(o,p,D).catch(Be=>D===""?Promise.reject(Be):null)})));if(!s)return;let Ae=Pe.filter(D=>D.listing===null).map(D=>D.directory);O(new Map(Pe.filter(D=>D.listing!==null).map(D=>[D.directory,D.listing]))),Ae.length>0&&h(D=>new Set([...D].filter(Be=>!Ae.some(ia=>Be===ia||Be.startsWith(`${ia}/`))))),b(void 0)}catch(_){s&&b(da(_))}finally{P=!1,s&&(V&&F(!1),I!==void 0&&window.clearTimeout(I),I=window.setTimeout(()=>{ue(!1)},3e4))}}},g=oe.subscribe(de.channels.browse,{runId:o,root:p},()=>{ue(!1)});return ue(!0),()=>{s=!1,g(),I!==void 0&&window.clearTimeout(I)}},[e,re,p,o]);let T=s=>{h(I=>{let P=new Set(I);return P.has(s)?P.delete(s):P.add(s),P}),!M.has(s)&&(F(!0),ta(o,p,s).then(I=>{O(P=>new Map(P).set(s,I)),b(void 0)}).catch(I=>b(da(I))).finally(()=>F(!1)))},G=s=>{k(s),w(void 0),F(!0),oa(o,p,s).then(I=>{w(I),b(void 0)}).catch(I=>b(da(I))).finally(()=>F(!1))},v=(s,I)=>{let P=M.get(s);if(!P)return null;let ue=E?P.entries:P.entries.filter(g=>!g.name.startsWith("."));return n(ua,{children:[ue.map(g=>{let V=s?`${s}/${g.name}`:g.name,_=c.has(V),{Icon:Pe,tone:Ae}=Xa(g.name,g.kind,_);return n("div",{children:[n(Te,{className:xt,"data-selected":i===V,onClick:()=>g.kind==="directory"?T(V):G(V),style:Ka(I),title:`${g.name} - ${Za(g.size)} - ${gt(g.modifiedAt)}`,variant:"ghost",children:[r("span",{className:`inline-flex w-3 flex-none items-center justify-center text-muted-foreground${_?" [&>svg]:rotate-90":""}`,children:g.kind==="directory"?r(Le,{size:11,strokeWidth:2}):null}),r(Pe,{"aria-hidden":!0,className:`flex-none ${Na[Ae]}`,size:14,strokeWidth:1.7}),r("span",{className:"min-w-0 flex-1 truncate text-left font-mono",children:g.name}),g.kind==="file"&&r("span",{className:"flex-none text-[0.64rem] text-muted-foreground tabular-nums",children:Za(g.size)})]}),g.kind==="directory"&&_&&v(V,I+1)]},V)}),P.truncated&&r("div",{className:"py-1 pr-2.5 pl-(--row-indent) text-[0.64rem] text-muted-foreground",style:Ka(I),children:"Further entries are not listed."})]})},R=M.get("");return n("div",{className:"flex h-full min-h-0 flex-col",children:[n("header",{className:"flex items-center gap-2 px-2.5 py-2",children:[r("div",{className:"flex min-w-0 flex-1 gap-1",children:B.map(s=>r(ve,{onPressedChange:()=>H(s),pressed:s===p,size:"sm",variant:"outline",children:Ct[s]},s))}),n("div",{className:"flex items-center gap-1",children:[r(ve,{"aria-label":E?"Hide hidden entries":"Show hidden entries",onPressedChange:We,pressed:E,size:"sm",title:E?"Hide hidden entries":"Show hidden entries",children:E?r(Ie,{size:15,strokeWidth:1.8}):r(xe,{size:15,strokeWidth:1.8})}),r(Te,{"aria-label":"Refresh files",onClick:()=>W(s=>s+1),size:"icon",title:"Refresh",variant:"ghost",children:r(ge,{className:ae?"animate-spin":void 0,size:15,strokeWidth:1.8})})]})]}),Z&&r(ze,{className:"shrink-0 rounded-none border-x-0 border-t-0 border-b-border-soft bg-destructive/8 px-2.5 py-2 text-[0.68rem]",variant:"destructive",children:Z}),R&&r("div",{className:"truncate px-2.5 pt-0.5 pb-1.5 font-mono text-[0.66rem] text-muted-foreground",title:R.location,children:R.location}),R&&R.entries.length===0&&r(Ne,{className:"min-h-30 flex-none gap-2 p-7",children:n(Ke,{children:[r(Ze,{children:r(ee,{size:15,strokeWidth:1.7})}),r(_e,{children:"No files"}),r(Xe,{children:ht[p]})]})}),r("div",{className:"min-h-0 flex-1 overflow-auto pb-2",children:v("",0)}),i&&n("div",{className:"flex min-h-0 flex-1 flex-col border-t border-border-soft",children:[r("div",{className:"truncate px-2.5 py-1.5 font-mono text-[0.66rem] text-muted-foreground",title:i,children:i}),m&&!m.previewable&&r("div",{className:"px-2.5 pb-2 text-[0.68rem] text-muted-foreground",children:m.reason}),m&&m.previewable&&r("div",{className:"min-h-0 flex-1 overflow-auto",children:r(ra,{className:It,content:m.content,path:i})})]})]})}var Oe=t("@ragents/web/Toolbar","ToolbarCopy");var Se=t("@ragents/web/Toolbar","ToolbarItem");var Ue=t("@ragents/web/Toolbar","ToolbarLabel");var ke=t("@ragents/web/Toolbar","ToolbarText");var K="server",ja="text-[0.75rem] text-destructive",He="text-[0.66rem] font-medium text-muted-foreground",Ja=e=>e instanceof Error?e.message:String(e),St=e=>{let a=e;return typeof a=="object"&&a!==null&&typeof a.id=="string"&&typeof a.label=="string"&&typeof a.hostname=="string"&&typeof a.platform=="string"&&Array.isArray(a.folders)&&a.folders.every(o=>typeof o=="string")&&typeof a.runsDirectory=="string"&&typeof a.ripgrep=="boolean"},$a=e=>{let a=e;return typeof a=="object"&&a!==null&&typeof a.server=="string"&&(a.client===null||typeof a.client=="string")},kt=(e,a)=>{let o=e;if(typeof o!="object"||o===null||o.kind!=="workspace-binding"||!Array.isArray(o.clients)||!o.clients.every(St)||!$a(o.fresh)||typeof o.serverFolders!="boolean")throw new Error(`The start option ${a} does not provide a workspace presentation`);return{kind:"workspace-binding",clients:o.clients,fresh:o.fresh,serverFolders:o.serverFolders}},Ya=(e,a)=>{let o=Ca(e);if(!o)throw new Error(`The value of the start option ${a} is not a workspace binding`);return o},la=e=>e.machine===K?K:e.machine.client,sa=e=>Ve(e.folder)?"fresh":"existing",fa=e=>{let{folder:a}=e;return Ve(a)?"":a.path},wt=(e,a)=>la(e)===la(a)&&sa(e)===sa(a)&&fa(e)===fa(a),Pt=(e,a,o)=>{let{machine:d}=a,x=o==="all"?e.clients:[],B=d===K||x.some(S=>S.id===d.client)?[]:[{value:d.client,label:e.clients.some(S=>S.id===d.client)?`Workstation ${d.label}`:`Workstation ${d.label} (not connected)`}];return[{value:K,label:"Server"},...x.map(S=>({value:S.id,label:`Workstation ${S.label}`})),...B]},Qa=(e,a)=>{let o={value:"existing",label:"Existing folder"};return a===K?[{value:"fresh",label:e.fresh.server},...e.serverFolders?[o]:[]]:[...e.fresh.client===null?[]:[{value:"fresh",label:e.fresh.client}],o]},At=e=>{let a=e;if(!(typeof a!="object"||a===null||typeof a.summary!="string"||!Fe(a.binding)))return{binding:a.binding,summary:a.summary}},Bt=e=>{try{return{presentation:kt(e.presentation,e.id),binding:Ya(e.value,e.id)}}catch(a){return{message:Ja(a)}}};function et({disabled:e,error:a,machines:o,option:d,setValue:x}){let[B,S]=A(void 0),[H,p]=A(void 0),[y,M]=A(void 0),O=Ye(),c=qe(()=>Bt(d),[d]);if("message"in c)return r("p",{className:ja,role:"alert",children:c.message});let{presentation:h,binding:i}=c,k=B??la(i),m=H??sa(i),w=y??fa(i),Z=Pt(h,i,o),b=Qa(h,k),ae=h.clients.find(u=>u.id===k),F=m==="existing"?ae?.folders.map(u=>({value:u,label:u}))??[]:[],re=(u,T,G)=>{let v=h.clients.find(s=>s.id===u)?.label??(i.machine!==K&&i.machine.client===u?i.machine.label:u),R=u===K?K:{client:u,label:v};return T==="fresh"?{machine:R,folder:"fresh"}:G===""?void 0:{machine:R,folder:{path:G}}},W=(u,T,G)=>{let v=re(u,T,G);v&&!wt(v,i)&&x(v)},E=u=>{let T=Qa(h,u).map(R=>R.value),G=T.includes(m)?m:T[0],v=w===""?h.clients.find(R=>R.id===u)?.folders[0]??"":w;S(u),p(G),M(v),W(u,G,v)},We=u=>{let T=w===""?ae?.folders[0]??"":w;p(u),M(T),W(k,u,T)},we=u=>{M(u),W(k,m,u)};return n("div",{className:"flex w-full flex-col items-start gap-2",children:[r("span",{className:"text-[0.72rem] font-semibold text-muted-foreground",children:"Workspace"}),n("div",{className:"flex w-full flex-wrap items-end gap-2",children:[n("div",{className:"flex flex-col gap-1",children:[r("span",{className:He,children:"Machine"}),n(le,{disabled:e,items:Z,onValueChange:u=>{u!==null&&E(u)},value:k,children:[r(ie,{"aria-label":"Workspace machine",className:"min-w-0 max-w-full",size:"sm",children:r(ne,{})}),r(se,{children:Z.map(u=>r(fe,{value:u.value,children:u.label},u.value))})]})]}),n("div",{className:"flex flex-col gap-1",children:[r("span",{className:He,children:"Folder"}),n(le,{disabled:e,items:b,onValueChange:u=>{u!==null&&We(u)},value:m,children:[r(ie,{"aria-label":"Workspace folder",className:"min-w-0 max-w-full",size:"sm",children:r(ne,{})}),r(se,{children:b.map(u=>r(fe,{value:u.value,children:u.label},u.value))})]})]}),m==="existing"&&n("div",{className:"flex min-w-[15rem] flex-1 flex-col gap-1",children:[r(Qe,{className:He,htmlFor:O,children:"Absolute path"}),r(je,{className:"h-7 text-sm",disabled:e,id:O,onBlur:()=>W(k,m,w),onChange:u=>M(u.target.value),onKeyDown:u=>{u.key==="Enter"&&W(k,m,w)},placeholder:"/Users/name/project",value:w})]}),F.length>0&&n("div",{className:"flex flex-col gap-1",children:[r("span",{className:He,children:"Offered folder"}),n(le,{disabled:e,items:F,onValueChange:u=>{u!==null&&we(u)},value:F.some(u=>u.value===w)?w:null,children:[r(ie,{"aria-label":"Offered folder",className:"min-w-0 max-w-full",size:"sm",children:r(ne,{placeholder:"Apply"})}),r(se,{children:F.map(u=>r(fe,{value:u.value,children:u.label},u.value))})]})]})]}),a&&r("p",{className:ja,role:"alert",children:a})]})}var yt=e=>{let a=e;return typeof a=="object"&&a!==null&&$a(a.fresh)?a.fresh:{server:Re,client:Re}};function at({option:e}){if(!e.locked)return null;let a;try{a=Ya(e.value,e.id)}catch(d){return r(Se,{title:Ja(d),children:r(ke,{children:"Workspace unreadable"})})}let o=ha(a,yt(e.presentation));return r(Se,{title:`Workspace: ${o}`,children:n(Oe,{children:[r(Ue,{children:"Workspace"}),r(ke,{children:o})]})})}function tt({placement:e,session:a}){let o=At(a.metadata?.[La]);if(!o)return null;if(e==="list"){let{machine:d,folder:x}=o.binding;return d==="server"&&x==="fresh"?null:n("span",{className:"flex max-w-full items-center gap-1.5 overflow-hidden pl-px text-xs text-muted-foreground",title:`Workspace: ${o.summary}`,children:[r(X,{"aria-hidden":!0,className:"size-3 flex-none"}),r("span",{className:"truncate",children:o.summary})]})}return n(Se,{title:`Workspace: ${o.summary}`,children:[r(X,{"aria-hidden":!0,className:"size-3.5"}),n(Oe,{children:[r(Ue,{children:"Workspace"}),r(ke,{children:o.summary})]})]})}var Dt="ragents.workspace.files";function Ft(){return n("svg",{"aria-hidden":!0,fill:"none",height:"15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 24 24",width:"15",children:[r("path",{d:"M3 6.5A1.5 1.5 0 0 1 4.5 5h4L10 7h9.5A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z"}),r("path",{d:"M3 11h18"})]})}var Nd={id:ca,workspaceTabs:[{readRight:"runs.inspect",id:Dt,label:"Files",order:260,Icon:Ft,Panel:_a}],startOptions:[{id:ma,Control:et,Badge:at}],sessionMetadata:[{id:"ragents.workspace.binding",order:90,Metadata:tt}]};export{Dt as WORKSPACE_FILES_TAB_ID,Nd as webPlugin};
1
+ var t=(e,a)=>{let o=globalThis.__ragentsHostModules?.[e];if(o===void 0)throw new Error(`The host does not provide ${e}`);if(!(a in o))throw new Error(`The host does not provide ${a} from ${e}; the bundle was built against a newer host`);return o[a]};var l=t("typebox","Type");var ye=t("@ragents/engine/src/http/contracts","openJson");var Ee=t("@ragents/engine/src/rpc/contract","defineChannel");var z=t("@ragents/engine/src/rpc/contract","defineOperation");var ca="ragents.workspace",pa=["workspace","files"],ma="ragents.workspace.binding",La="ragents.workspace",ot=()=>({machine:"server",folder:"fresh"}),rt=/^[A-Za-z0-9_-]{8,64}$/,xa=l.String({pattern:"^[A-Za-z0-9_-]{8,64}$",description:"Stable ID of the workstation"}),Ge=l.String({minLength:1,maxLength:64,description:"Version of the executor that the workstation brings"}),ut=/^[a-z0-9]+(?:[.-][a-z0-9]+)*$/,Ia=l.Array(l.Object({plugin:l.String({pattern:ut.source,maxLength:128,description:"ID of the plugin"}),revision:l.String({pattern:"^[0-9a-f]{64}$",description:"SHA-256 of the contribution file"})},{additionalProperties:!1}),{maxItems:64,description:"The plugins' contributions to the executor, in the order of the server's plugin list"}),Me={label:l.String({minLength:1,maxLength:120}),hostname:l.String({minLength:1}),platform:l.String({minLength:1}),folders:l.Array(l.String({minLength:1}),{maxItems:32}),runsDirectory:l.String({minLength:1,description:"Absolute folder under which the workstation creates the new folders per run"}),ripgrep:l.Boolean({description:"Whether the workstation's bash finds rg"})},na=l.Object({id:l.String(),...Me},{additionalProperties:!1}),dt=l.Object({id:xa,...Me,executor:Ge,contributions:Ia},{additionalProperties:!1}),lt=l.Object({label:Me.label,executor:Ge},{description:"Sign-in with a different executor version in any shape; the server rejects it with workspace-executor-version"}),st=l.String({minLength:1,description:"Absolute path in the bound folder"});var jt={execute:z({id:"ragents.workspace.client.execute",description:"Run an operation of the executor on the workstation, such as a tool, a file query, or the process display; the result is its value, progress its JSON value. stop releases what the workstation holds for the run.",implementedBy:"client",input:l.Object({runId:l.String({minLength:1,maxLength:64,description:"ID of the run"}),operation:l.String({minLength:1,maxLength:64,description:"Name of the operation, such as read, bash, roslyn_open, files.list, or stop"}),toolCallId:l.Optional(l.String({minLength:1,maxLength:200,description:"Only for a tool call of the model"})),cwd:st,env:l.Record(l.String(),l.String(),{description:"What the server contributes: run marker and git rules of the sandbox"}),input:l.Unknown({description:"The input of the operation"})},{additionalProperties:!1}),result:l.Object({value:l.Unknown()},{additionalProperties:!1})})},De={runId:l.String({minLength:1,maxLength:64,description:"ID of the run"}),root:l.Union([l.Literal("workspace"),l.Literal("files")]),path:l.String({description:"Path below the root; empty is the root itself"})},de={browse:{list:z({id:"ragents.workspace.browse.list",description:"List a directory in the workspace or in the file store of a run.",rights:["runs.read","runs.inspect"],input:l.Object(De,{additionalProperties:!1}),result:ye("BrowseListing")}),preview:z({id:"ragents.workspace.browse.preview",description:"Preview a file as text; files that are too large or binary state the reason instead.",rights:["runs.read","runs.inspect"],input:l.Object(De,{additionalProperties:!1}),result:ye("BrowsePreview")})},channels:{browse:Ee({id:"ragents.workspace.browse",description:"Reports every change below the observed root of a run.",rights:["runs.read","runs.inspect"],params:l.Object({runId:De.runId,root:De.root},{additionalProperties:!1}),message:l.Object({changed:l.Literal(!0)},{additionalProperties:!1})})},clients:{list:z({id:"ragents.workspace.clients.list",description:"The caller's signed-in workstations; other users' workstations do not appear even with runs.read.all.",rights:["runs.read"],input:l.Object({},{additionalProperties:!1}),result:l.Array(na)}),contributions:z({id:"ragents.workspace.clients.contributions",description:"The plugins' contributions to the executor that a workstation loads before sign-in and reports back with it. A workstation with a different executor version fails on its version; other fields do not matter.",rights:["runs.write"],input:l.Object({label:Me.label,executor:Ge}),result:Ia}),register:z({id:"ragents.workspace.clients.register",description:"Sign in a workstation or renew its folders; the connection of this request becomes its return path and needs an event stream. A workstation with a different executor version fails on its version before the rest of the shape matters.",rights:["runs.write"],input:l.Union([dt,lt]),result:na}),unregister:z({id:"ragents.workspace.clients.unregister",description:"Sign out one of your own workstations; open tasks fail.",rights:["runs.write"],input:l.Object({id:xa},{additionalProperties:!1}),result:l.Null()})}},be=e=>typeof e=="object"&&e!==null,j=(e,a)=>Object.keys(e).length===a.length&&a.every(o=>Object.hasOwn(e,o)),ft=e=>e==="server"||be(e)&&j(e,["client","label"])&&typeof e.client=="string"&&rt.test(e.client)&&typeof e.label=="string",it=e=>e==="fresh"?!0:!be(e)||typeof e.path!="string"||e.path.length===0?!1:j(e,["path"])||j(e,["path","fresh"])&&e.fresh===!0,Fe=e=>be(e)&&j(e,["machine","folder"])&&ft(e.machine)&&it(e.folder)&&!(e.machine==="server"&&typeof e.folder=="object"&&"fresh"in e.folder),Ve=e=>e==="fresh"||"fresh"in e,nt=e=>{switch(e.kind){case"fresh":return j(e,["kind"])?ot():void 0;case"path":return j(e,["kind","path"])?{machine:"server",folder:{path:e.path}}:void 0;case"client":return j(e,["kind","client","label","path"])?{machine:{client:e.client,label:e.label},folder:{path:e.path}}:void 0;default:return}},Ca=e=>{if(Fe(e))return e;let a=be(e)&&Object.hasOwn(e,"kind")?nt(e):void 0;return Fe(a)?a:void 0},Re="Empty folder per run",ct=(e,a)=>(e.machine==="server"?a.server:a.client)??Re,ha=(e,a)=>{let{machine:o,folder:d}=e,x=ct(e,a),B=d==="fresh"?x:"fresh"in d?`${d.path} (${x})`:d.path;return o==="server"?B:`${o.label}: ${B}`};var ze=t("@ragents/web/ui","Alert");var Te=t("@ragents/web/ui","Button");var Ne=t("@ragents/web/ui","Empty");var Xe=t("@ragents/web/ui","EmptyDescription");var Ke=t("@ragents/web/ui","EmptyHeader");var Ze=t("@ragents/web/ui","EmptyMedia");var _e=t("@ragents/web/ui","EmptyTitle");var je=t("@ragents/web/ui","Input");var Qe=t("@ragents/web/ui","Label");var le=t("@ragents/web/ui","Select");var se=t("@ragents/web/ui","SelectContent");var fe=t("@ragents/web/ui","SelectItem");var ie=t("@ragents/web/ui","SelectTrigger");var ne=t("@ragents/web/ui","SelectValue");var ve=t("@ragents/web/ui","Toggle");var Je=t("react","createContext");var Q=t("react","createElement");var ce=t("react","forwardRef");var $e=t("react","useContext");var te=t("react","useEffect");var Ye=t("react","useId");var qe=t("react","useMemo");var pe=t("react","useRef");var A=t("react","useState");var ga=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function Sa(e,a,o=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ga(e),size:24,node:a,...o.length>0?{aliases:o}:{}}}var ka=e=>{let a="",o=!1;for(let d of e){if(d==="-"||d==="_"||d<=" "){o=a.length>0;continue}a.length===0?a+=d.toLowerCase():a+=o?d.toUpperCase():d,o=!1}return a};var wa=e=>{let a=ka(e);return a.charAt(0).toUpperCase()+a.slice(1)};var me=(...e)=>e.filter((a,o,d)=>!!a&&a.trim()!==""&&d.indexOf(a)===o).join(" ").trim();var N={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function ea(e){return e!=null}function Pa(e,a={}){let o=a.attributeNames??{},d=c=>o[c]??c,x=e.size??e.width??N.width,B=e.size??e.height??N.height,S=e.aliases?.filter(c=>typeof c=="string"&&c.trim()!=="").map(c=>`lucide-${c}`)??[],H=[...e.name?[`lucide-${e.name}`]:[],...S],p=a.className?.split(" ").filter(Boolean)??[],y=a.includeDefaultClasses===!1?me(...p):me("lucide",...H,...p),M=a.absoluteStrokeWidth?Number(a.strokeWidth??N["stroke-width"])*Number(e.size??e.width??N.width)/Number(a.size??a.width??N.width):a.strokeWidth??N["stroke-width"];return["svg",{...Object.entries(N).reduce((c,[h,i])=>(c[d(h)]=i,c),{}),..."color"in a&&a.color&&{[d("stroke")]:a.color},..."size"in a&&ea(a.size)&&{[d("width")]:a.size,[d("height")]:a.size},..."width"in a&&ea(a.width)&&{[d("width")]:a.width},..."height"in a&&ea(a.height)&&{[d("height")]:a.height},[d("stroke-width")]:M,...y&&{[d("class")]:y},[d("viewBox")]:`0 0 ${x} ${B}`,...a.hasA11yProp===!1?{[d("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(c=>{let[h,i,k]=c,m=a.nonScalingStroke?{[d("vector-effect")]:"non-scaling-stroke",...i}:i;return k?[h,m,k]:[h,m]})]}function Aa(e,a={}){return Pa(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Ba=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var pt=Je({});var ya=()=>$e(pt);var Da=ce(({color:e,size:a,width:o,height:d,strokeWidth:x,absoluteStrokeWidth:B,nonScalingStroke:S,className:H="",children:p,iconNode:y=[],icon:M={node:y,aliases:[],size:24},...O},c)=>{let{size:h=24,strokeWidth:i=2,absoluteStrokeWidth:k=!1,nonScalingStroke:m=!1,color:w="currentColor",className:Z=""}=ya()??{},b=!!p||Ba(O),[ae,F,re=[]]=Aa(M,{color:e??w,width:o??a??h,height:d??a??h,strokeWidth:x??i,absoluteStrokeWidth:B??k,nonScalingStroke:S??m,className:me(Z,H),hasA11yProp:b,attributes:O});return Q(ae,{ref:c,...F},[...re.map(([W,E])=>Q(W,E)),...Array.isArray(p)?p:[p]])});function f(e,a=[],o=[]){let d=typeof e=="string"?Sa(e,a,o):e,x=ce(({className:B,...S},H)=>Q(Da,{ref:H,icon:d,className:B,...S}));return d.name&&(x.displayName=wa(d.name)),x}var Fa={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};Fa.node;var U=f(Fa);var Ma={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Ma.node;var Le=f(Ma);var ba={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};ba.node;var xe=f(ba);var Ra={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Ra.node;var Ie=f(Ra);var Ta={name:"file-archive",size:24,node:[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]};Ta.node;var J=f(Ta);var va={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};va.node;var L=f(va);var qa={name:"file-cog",size:24,node:[["path",{d:"M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z",key:"1ckgky"}],["path",{d:"M20 8v12a2 2 0 0 1-2 2h-4.182",key:"1726p0"}],["path",{d:"m3.305 19.53.923-.382",key:"ao1pio"}],["path",{d:"M4 10.592V4a2 2 0 0 1 2-2h8",key:"1foop0"}],["path",{d:"m4.228 16.852-.924-.383",key:"1fv9zy"}],["path",{d:"m5.852 15.228-.383-.923",key:"1a9hc2"}],["path",{d:"m5.852 20.772-.383.924",key:"1sh9ke"}],["path",{d:"m8.148 15.228.383-.923",key:"4yu6lf"}],["path",{d:"m8.53 21.696-.382-.924",key:"18b0s9"}],["path",{d:"m9.773 16.852.922-.383",key:"ti6xop"}],["path",{d:"m9.773 19.148.922.383",key:"rws47d"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],aliases:["file-cog-2"]};qa.node;var C=f(qa);var Oa={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};Oa.node;var q=f(Oa);var Ua={name:"file-terminal",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]]};Ua.node;var $=f(Ua);var Ha={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};Ha.node;var Y=f(Ha);var Wa={name:"file",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]};Wa.node;var Ce=f(Wa);var Ea={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};Ea.node;var ee=f(Ea);var Ga={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};Ga.node;var X=f(Ga);var Va={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};Va.node;var he=f(Va);var za={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};za.node;var ge=f(za);var aa=t("@ragents/web/PluginRegistry","workspaceAccessible");var oe=t("@ragents/web/rpc","rpc");var ta=(e,a,o)=>oe.call(de.browse.list,{runId:e,root:a,path:o}),oa=(e,a,o)=>oe.call(de.browse.preview,{runId:e,root:a,path:o});var Na={blue:"text-info",yellow:"text-warning",green:"text-success",teal:"text-teal",orange:"text-[color-mix(in_srgb,var(--warning)_75%,var(--destructive))]",pink:"text-[color-mix(in_srgb,var(--destructive)_65%,var(--accent))]",violet:"text-primary",red:"text-destructive",muted:"text-muted-foreground"},mt={ts:{Icon:L,tone:"blue"},tsx:{Icon:L,tone:"blue"},mts:{Icon:L,tone:"blue"},cts:{Icon:L,tone:"blue"},js:{Icon:L,tone:"yellow"},jsx:{Icon:L,tone:"yellow"},mjs:{Icon:L,tone:"yellow"},cjs:{Icon:L,tone:"yellow"},cs:{Icon:L,tone:"green"},fs:{Icon:L,tone:"teal"},fsx:{Icon:L,tone:"teal"},py:{Icon:L,tone:"green"},json:{Icon:U,tone:"yellow"},md:{Icon:Y,tone:"violet"},txt:{Icon:Y,tone:"muted"},pdf:{Icon:Y,tone:"red"},html:{Icon:L,tone:"orange"},htm:{Icon:L,tone:"orange"},hbs:{Icon:L,tone:"orange"},css:{Icon:he,tone:"pink"},png:{Icon:q,tone:"violet"},jpg:{Icon:q,tone:"violet"},jpeg:{Icon:q,tone:"violet"},gif:{Icon:q,tone:"violet"},webp:{Icon:q,tone:"violet"},svg:{Icon:q,tone:"violet"},ico:{Icon:q,tone:"violet"},sh:{Icon:$,tone:"green"},zsh:{Icon:$,tone:"green"},bash:{Icon:$,tone:"green"},yml:{Icon:C,tone:"muted"},yaml:{Icon:C,tone:"muted"},toml:{Icon:C,tone:"muted"},ini:{Icon:C,tone:"muted"},csproj:{Icon:C,tone:"blue"},fsproj:{Icon:C,tone:"teal"},sln:{Icon:C,tone:"blue"},slnx:{Icon:C,tone:"blue"},zip:{Icon:J,tone:"orange"},gz:{Icon:J,tone:"orange"},tar:{Icon:J,tone:"orange"},lock:{Icon:C,tone:"muted"}},Lt={"package.json":{Icon:U,tone:"green"},"pnpm-lock.yaml":{Icon:C,tone:"muted"},"tsconfig.json":{Icon:U,tone:"blue"},".gitignore":{Icon:C,tone:"muted"},dockerfile:{Icon:C,tone:"teal"}},Xa=(e,a,o)=>{if(a==="directory")return{Icon:o?ee:X,tone:"muted"};let d=Lt[e.toLowerCase()];if(d)return d;let x=e.includes(".")?e.toLowerCase().split(".").at(-1)??"":"";return mt[x]??{Icon:Ce,tone:"muted"}};var ra=t("@ragents/web/SourceCode","SourceCode");var ua=t("react/jsx-runtime","Fragment");var r=t("react/jsx-runtime","jsx");var n=t("react/jsx-runtime","jsxs");var xt="h-auto w-full justify-start gap-1.5 rounded-none py-[3px] pr-2.5 pl-(--row-indent) text-[0.7rem] font-normal data-selected:bg-primary/12 data-selected:text-primary",It="min-w-0 px-2.5 pt-0 pb-2.5 text-xs leading-[1.45] whitespace-pre-wrap break-words",Ka=e=>({"--row-indent":`${8+e*12}px`}),Ct={workspace:"Working directory",files:"File storage"},ht={workspace:"There is nothing in the run's working directory yet.",files:"There is nothing in the run's file storage yet."},da=e=>e instanceof Error?e.message:String(e),Za=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`,gt=e=>{let a=new Date(e);return Number.isNaN(a.getTime())?e:a.toLocaleString()};function _a({active:e,session:a}){let o=a.session.id,d=pe(new Map),x=aa(a.session),B=x?pa:["files"],[S,H]=A("workspace"),p=x?S:"files",y=`${o}|${p}`,[M,O]=A(()=>new Map),[c,h]=A(()=>new Set),[i,k]=A(),[m,w]=A(),[Z,b]=A(),[ae,F]=A(!1),[re,W]=A(0),[E,We]=A(!1),we=pe(c);we.current=c;let u=pe(y);te(()=>{if(u.current===y)return;u.current=y;let s=d.current.get(y);O(new Map),h(s?.expanded??new Set),k(s?.selected),w(void 0),b(void 0)},[y]),te(()=>{d.current.set(y,{expanded:c,selected:i})},[c,p,o,i,y]),te(()=>{if(!e||i===void 0||m!==void 0)return;let s=!0;return oa(o,p,i).then(I=>s&&w(I)).catch(()=>s&&k(void 0)),()=>{s=!1}},[e,m,p,o,i]),te(()=>{if(!e)return;let s=!0,I,P=!1,ue=async V=>{if(!P){P=!0,V&&F(!0);try{let _=["",...we.current],Pe=await Promise.all(_.map(async D=>({directory:D,listing:await ta(o,p,D).catch(Be=>D===""?Promise.reject(Be):null)})));if(!s)return;let Ae=Pe.filter(D=>D.listing===null).map(D=>D.directory);O(new Map(Pe.filter(D=>D.listing!==null).map(D=>[D.directory,D.listing]))),Ae.length>0&&h(D=>new Set([...D].filter(Be=>!Ae.some(ia=>Be===ia||Be.startsWith(`${ia}/`))))),b(void 0)}catch(_){s&&b(da(_))}finally{P=!1,s&&(V&&F(!1),I!==void 0&&window.clearTimeout(I),I=window.setTimeout(()=>{ue(!1)},3e4))}}},g=oe.subscribe(de.channels.browse,{runId:o,root:p},()=>{ue(!1)});return ue(!0),()=>{s=!1,g(),I!==void 0&&window.clearTimeout(I)}},[e,re,p,o]);let T=s=>{h(I=>{let P=new Set(I);return P.has(s)?P.delete(s):P.add(s),P}),!M.has(s)&&(F(!0),ta(o,p,s).then(I=>{O(P=>new Map(P).set(s,I)),b(void 0)}).catch(I=>b(da(I))).finally(()=>F(!1)))},G=s=>{k(s),w(void 0),F(!0),oa(o,p,s).then(I=>{w(I),b(void 0)}).catch(I=>b(da(I))).finally(()=>F(!1))},v=(s,I)=>{let P=M.get(s);if(!P)return null;let ue=E?P.entries:P.entries.filter(g=>!g.name.startsWith("."));return n(ua,{children:[ue.map(g=>{let V=s?`${s}/${g.name}`:g.name,_=c.has(V),{Icon:Pe,tone:Ae}=Xa(g.name,g.kind,_);return n("div",{children:[n(Te,{className:xt,"data-selected":i===V,onClick:()=>g.kind==="directory"?T(V):G(V),style:Ka(I),title:`${g.name} - ${Za(g.size)} - ${gt(g.modifiedAt)}`,variant:"ghost",children:[r("span",{className:`inline-flex w-3 flex-none items-center justify-center text-muted-foreground${_?" [&>svg]:rotate-90":""}`,children:g.kind==="directory"?r(Le,{size:11,strokeWidth:2}):null}),r(Pe,{"aria-hidden":!0,className:`flex-none ${Na[Ae]}`,size:14,strokeWidth:1.7}),r("span",{className:"min-w-0 flex-1 truncate text-left font-mono",children:g.name}),g.kind==="file"&&r("span",{className:"flex-none text-[0.64rem] text-muted-foreground tabular-nums",children:Za(g.size)})]}),g.kind==="directory"&&_&&v(V,I+1)]},V)}),P.truncated&&r("div",{className:"py-1 pr-2.5 pl-(--row-indent) text-[0.64rem] text-muted-foreground",style:Ka(I),children:"Further entries are not listed."})]})},R=M.get("");return n("div",{className:"flex h-full min-h-0 flex-col",children:[n("header",{className:"flex items-center gap-2 px-2.5 py-2",children:[r("div",{className:"flex min-w-0 flex-1 gap-1",children:B.map(s=>r(ve,{onPressedChange:()=>H(s),pressed:s===p,size:"sm",variant:"outline",children:Ct[s]},s))}),n("div",{className:"flex items-center gap-1",children:[r(ve,{"aria-label":E?"Hide hidden entries":"Show hidden entries",onPressedChange:We,pressed:E,size:"sm",title:E?"Hide hidden entries":"Show hidden entries",children:E?r(Ie,{size:15,strokeWidth:1.8}):r(xe,{size:15,strokeWidth:1.8})}),r(Te,{"aria-label":"Refresh files",onClick:()=>W(s=>s+1),size:"icon",title:"Refresh",variant:"ghost",children:r(ge,{className:ae?"animate-spin":void 0,size:15,strokeWidth:1.8})})]})]}),Z&&r(ze,{className:"shrink-0 rounded-none border-x-0 border-t-0 border-b-border-soft bg-destructive/8 px-2.5 py-2 text-[0.68rem]",variant:"destructive",children:Z}),R&&r("div",{className:"truncate px-2.5 pt-0.5 pb-1.5 font-mono text-[0.66rem] text-muted-foreground",title:R.location,children:R.location}),R&&R.entries.length===0&&r(Ne,{className:"min-h-30 flex-none gap-2 p-7",children:n(Ke,{children:[r(Ze,{children:r(ee,{size:15,strokeWidth:1.7})}),r(_e,{children:"No files"}),r(Xe,{children:ht[p]})]})}),r("div",{className:"min-h-0 flex-1 overflow-auto pb-2",children:v("",0)}),i&&n("div",{className:"flex min-h-0 flex-1 flex-col border-t border-border-soft",children:[r("div",{className:"truncate px-2.5 py-1.5 font-mono text-[0.66rem] text-muted-foreground",title:i,children:i}),m&&!m.previewable&&r("div",{className:"px-2.5 pb-2 text-[0.68rem] text-muted-foreground",children:m.reason}),m&&m.previewable&&r("div",{className:"min-h-0 flex-1 overflow-auto",children:r(ra,{className:It,content:m.content,path:i})})]})]})}var Oe=t("@ragents/web/Toolbar","ToolbarCopy");var Se=t("@ragents/web/Toolbar","ToolbarItem");var Ue=t("@ragents/web/Toolbar","ToolbarLabel");var ke=t("@ragents/web/Toolbar","ToolbarText");var K="server",ja="text-[0.75rem] text-destructive",He="text-[0.66rem] font-medium text-muted-foreground",Ja=e=>e instanceof Error?e.message:String(e),St=e=>{let a=e;return typeof a=="object"&&a!==null&&typeof a.id=="string"&&typeof a.label=="string"&&typeof a.hostname=="string"&&typeof a.platform=="string"&&Array.isArray(a.folders)&&a.folders.every(o=>typeof o=="string")&&typeof a.runsDirectory=="string"&&typeof a.ripgrep=="boolean"},$a=e=>{let a=e;return typeof a=="object"&&a!==null&&typeof a.server=="string"&&(a.client===null||typeof a.client=="string")},kt=(e,a)=>{let o=e;if(typeof o!="object"||o===null||o.kind!=="workspace-binding"||!Array.isArray(o.clients)||!o.clients.every(St)||!$a(o.fresh)||typeof o.serverFolders!="boolean")throw new Error(`The start option ${a} does not provide a workspace presentation`);return{kind:"workspace-binding",clients:o.clients,fresh:o.fresh,serverFolders:o.serverFolders}},Ya=(e,a)=>{let o=Ca(e);if(!o)throw new Error(`The value of the start option ${a} is not a workspace binding`);return o},la=e=>e.machine===K?K:e.machine.client,sa=e=>Ve(e.folder)?"fresh":"existing",fa=e=>{let{folder:a}=e;return Ve(a)?"":a.path},wt=(e,a)=>la(e)===la(a)&&sa(e)===sa(a)&&fa(e)===fa(a),Pt=(e,a,o)=>{let{machine:d}=a,x=o==="all"?e.clients:[],B=d===K||x.some(S=>S.id===d.client)?[]:[{value:d.client,label:e.clients.some(S=>S.id===d.client)?`Workstation ${d.label}`:`Workstation ${d.label} (not connected)`}];return[{value:K,label:"Server"},...x.map(S=>({value:S.id,label:`Workstation ${S.label}`})),...B]},Qa=(e,a)=>{let o={value:"existing",label:"Existing folder"};return a===K?[{value:"fresh",label:e.fresh.server},...e.serverFolders?[o]:[]]:[...e.fresh.client===null?[]:[{value:"fresh",label:e.fresh.client}],o]},At=e=>{let a=e;if(!(typeof a!="object"||a===null||typeof a.summary!="string"||!Fe(a.binding)))return{binding:a.binding,summary:a.summary}},Bt=e=>{try{return{presentation:kt(e.presentation,e.id),binding:Ya(e.value,e.id)}}catch(a){return{message:Ja(a)}}};function et({disabled:e,error:a,machines:o,option:d,setValue:x}){let[B,S]=A(void 0),[H,p]=A(void 0),[y,M]=A(void 0),O=Ye(),c=qe(()=>Bt(d),[d]);if("message"in c)return r("p",{className:ja,role:"alert",children:c.message});let{presentation:h,binding:i}=c,k=B??la(i),m=H??sa(i),w=y??fa(i),Z=Pt(h,i,o),b=Qa(h,k),ae=h.clients.find(u=>u.id===k),F=m==="existing"?ae?.folders.map(u=>({value:u,label:u}))??[]:[],re=(u,T,G)=>{let v=h.clients.find(s=>s.id===u)?.label??(i.machine!==K&&i.machine.client===u?i.machine.label:u),R=u===K?K:{client:u,label:v};return T==="fresh"?{machine:R,folder:"fresh"}:G===""?void 0:{machine:R,folder:{path:G}}},W=(u,T,G)=>{let v=re(u,T,G);v&&!wt(v,i)&&x(v)},E=u=>{let T=Qa(h,u).map(R=>R.value),G=T.includes(m)?m:T[0],v=w===""?h.clients.find(R=>R.id===u)?.folders[0]??"":w;S(u),p(G),M(v),W(u,G,v)},We=u=>{let T=w===""?ae?.folders[0]??"":w;p(u),M(T),W(k,u,T)},we=u=>{M(u),W(k,m,u)};return n("div",{className:"flex w-full flex-col items-start gap-2",children:[r("span",{className:"text-[0.72rem] font-semibold text-muted-foreground",children:"Workspace"}),n("div",{className:"flex w-full flex-wrap items-end gap-2",children:[n("div",{className:"flex flex-col gap-1",children:[r("span",{className:He,children:"Machine"}),n(le,{disabled:e,items:Z,onValueChange:u=>{u!==null&&E(u)},value:k,children:[r(ie,{"aria-label":"Workspace machine",className:"min-w-0 max-w-full",size:"sm",children:r(ne,{})}),r(se,{children:Z.map(u=>r(fe,{value:u.value,children:u.label},u.value))})]})]}),n("div",{className:"flex flex-col gap-1",children:[r("span",{className:He,children:"Folder"}),n(le,{disabled:e,items:b,onValueChange:u=>{u!==null&&We(u)},value:m,children:[r(ie,{"aria-label":"Workspace folder",className:"min-w-0 max-w-full",size:"sm",children:r(ne,{})}),r(se,{children:b.map(u=>r(fe,{value:u.value,children:u.label},u.value))})]})]}),m==="existing"&&n("div",{className:"flex min-w-[15rem] flex-1 flex-col gap-1",children:[r(Qe,{className:He,htmlFor:O,children:"Absolute path"}),r(je,{className:"h-7 text-sm",disabled:e,id:O,onBlur:()=>W(k,m,w),onChange:u=>M(u.target.value),onKeyDown:u=>{u.key==="Enter"&&W(k,m,w)},placeholder:"/Users/name/project",value:w})]}),F.length>0&&n("div",{className:"flex flex-col gap-1",children:[r("span",{className:He,children:"Offered folder"}),n(le,{disabled:e,items:F,onValueChange:u=>{u!==null&&we(u)},value:F.some(u=>u.value===w)?w:null,children:[r(ie,{"aria-label":"Offered folder",className:"min-w-0 max-w-full",size:"sm",children:r(ne,{placeholder:"Apply"})}),r(se,{children:F.map(u=>r(fe,{value:u.value,children:u.label},u.value))})]})]})]}),a&&r("p",{className:ja,role:"alert",children:a})]})}var yt=e=>{let a=e;return typeof a=="object"&&a!==null&&$a(a.fresh)?a.fresh:{server:Re,client:Re}};function at({option:e}){if(!e.locked)return null;let a;try{a=Ya(e.value,e.id)}catch(d){return r(Se,{title:Ja(d),children:r(ke,{children:"Workspace unreadable"})})}let o=ha(a,yt(e.presentation));return r(Se,{title:`Workspace: ${o}`,children:n(Oe,{children:[r(Ue,{children:"Workspace"}),r(ke,{children:o})]})})}function tt({placement:e,session:a}){let o=At(a.metadata?.[La]);if(!o)return null;if(e==="list"){let{machine:d,folder:x}=o.binding;return d==="server"&&x==="fresh"?null:n("span",{className:"flex max-w-full items-center gap-1.5 overflow-hidden pl-px text-xs text-muted-foreground",title:`Workspace: ${o.summary}`,children:[r(X,{"aria-hidden":!0,className:"size-3 flex-none"}),r("span",{className:"truncate",children:o.summary})]})}return n(Se,{title:`Workspace: ${o.summary}`,children:[r(X,{"aria-hidden":!0,className:"size-3.5"}),n(Oe,{children:[r(Ue,{children:"Workspace"}),r(ke,{children:o.summary})]})]})}var Dt="ragents.workspace.files";function Ft(){return n("svg",{"aria-hidden":!0,fill:"none",height:"15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 24 24",width:"15",children:[r("path",{d:"M3 6.5A1.5 1.5 0 0 1 4.5 5h4L10 7h9.5A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z"}),r("path",{d:"M3 11h18"})]})}var Nd={id:ca,workspaceTabs:[{readRight:"runs.inspect",id:Dt,label:"Files",order:260,Icon:Ft,Panel:_a}],startOptions:[{id:ma,Control:et,Badge:at}],sessionMetadata:[{id:"ragents.workspace.binding",order:90,Metadata:tt}]};export{Dt as WORKSPACE_FILES_TAB_ID,Nd as webPlugin};
2
2
  /*! Bundled license information:
3
3
 
4
4
  lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs: