@schlenkr/ragents 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/server/package.json +1 -1
- package/apps/server/src/api/contracts.ts +19 -1
- package/apps/server/src/api/core-methods.ts +12 -0
- package/apps/server/src/chat-handler.ts +19 -0
- package/apps/server/src/host-api.json +2 -0
- package/apps/server/src/host-api.ts +2 -2
- package/apps/server/src/plugin-build/build.ts +1 -1
- package/apps/server/src/plugin-support/actor-programs/app-project.ts +61 -17
- package/apps/server/src/plugin-support/actor-programs/contract.ts +18 -1
- package/apps/server/src/plugin-support/actor-programs/service.ts +22 -1
- package/apps/server/src/plugin-support/plugin-folder.ts +14 -1
- package/apps/server/src/plugin-support/run-scripts.ts +27 -2
- package/apps/server/src/profile/compose.ts +2 -0
- package/apps/server/src/provider.ts +23 -4
- package/apps/server/src/ragents/chat-projection.ts +7 -0
- package/apps/server/src/ragents/global-chat.ts +5 -1
- package/apps/server/src/ragents/run-script-tools.ts +66 -0
- package/apps/server/src/ragents/session.ts +122 -60
- package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-BslIwn_y.js → highlighted-body-KPVGNVTW-BwD4uYEe.js} +1 -1
- package/apps/web/dist/assets/{main-BUN8m8SW.js → main-KBrc5Q77.js} +1 -1
- package/apps/web/dist/assets/{mermaid-HWGCJPDP-B1erZlFM.js → mermaid-HWGCJPDP-CSCkaArr.js} +88 -88
- package/apps/web/dist/assets/runPanel-BjG5NBKm.js +26 -0
- package/apps/web/dist/help/guide-clients.html +21 -4
- package/apps/web/dist/help/guide-clients.md +23 -4
- package/apps/web/dist/help/guide-plugins.html +12 -2
- package/apps/web/dist/help/guide-plugins.md +9 -2
- package/apps/web/dist/help/guide-programs.html +8 -2
- package/apps/web/dist/help/guide-programs.md +9 -2
- package/apps/web/dist/help/guide-runtime.html +3 -2
- package/apps/web/dist/help/guide-runtime.md +3 -2
- package/apps/web/dist/help/index.html +1 -1
- package/apps/web/dist/help/mini-app.css +7 -2
- package/apps/web/dist/host-web.json +6 -6
- package/apps/web/dist/index.html +2 -2
- package/apps/web/dist/run-panel.html +2 -2
- package/apps/web/package.json +1 -1
- package/apps/web/src/run-panel/RunPanelApp.tsx +1 -1
- package/apps/web/src/run-panel/RunPanelMenu.tsx +47 -11
- package/bundles/ragents.activity/ragents-bundle.json +1 -1
- package/bundles/ragents.actor-programs/ragents-bundle.json +4 -2
- package/bundles/ragents.actor-programs/server/index.js +437 -24
- package/bundles/ragents.actor-programs/server/index.js.map +4 -4
- package/bundles/ragents.actor-programs/web/index.js.map +1 -1
- package/bundles/ragents.ask/ragents-bundle.json +2 -2
- package/bundles/ragents.ask/server/index.js +1 -0
- package/bundles/ragents.ask/server/index.js.map +2 -2
- package/bundles/ragents.browser/ragents-bundle.json +1 -1
- package/bundles/ragents.documents/ragents-bundle.json +1 -1
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +1 -1
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +1 -1
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +1 -1
- package/bundles/ragents.model-relay/ragents-bundle.json +1 -1
- package/bundles/ragents.orchestration/ragents-bundle.json +7 -4
- package/bundles/ragents.orchestration/server/chunks/chunk-QS3WJ3D7.js +11 -0
- package/bundles/ragents.orchestration/server/chunks/chunk-QS3WJ3D7.js.map +7 -0
- package/bundles/ragents.orchestration/server/exports/server/contract.js +9 -0
- package/bundles/ragents.orchestration/server/exports/server/contract.js.map +7 -0
- package/bundles/ragents.orchestration/server/index.js +49 -3
- package/bundles/ragents.orchestration/server/index.js.map +2 -2
- package/bundles/ragents.orchestration/surface.hbs +5 -0
- package/bundles/ragents.overseer/ragents-bundle.json +1 -1
- package/bundles/ragents.processes/ragents-bundle.json +1 -1
- package/bundles/ragents.product/ragents-bundle.json +1 -1
- package/bundles/ragents.profile-distribution/ragents-bundle.json +1 -1
- package/bundles/ragents.reference/actors/notebook/package.json +16 -0
- package/bundles/ragents.reference/actors/notebook/src/client.tsx +31 -0
- package/bundles/ragents.reference/actors/notebook/src/server.ts +27 -0
- package/bundles/ragents.reference/actors/notebook/tests/program.test.ts +27 -0
- package/bundles/ragents.reference/ragents-bundle.json +4 -3
- package/bundles/ragents.reference/run-scripts/quick-note/RUN.md +14 -0
- package/bundles/ragents.reference/run-scripts/quick-note/package.json +9 -0
- package/bundles/ragents.reference/run-scripts/quick-note/src/server.ts +29 -0
- package/bundles/ragents.reference/run-scripts/quick-note/tests/program.test.ts +43 -0
- package/bundles/ragents.reference/run-scripts/run-roster/RUN.md +19 -0
- package/bundles/ragents.reference/run-scripts/run-roster/package.json +9 -0
- package/bundles/ragents.reference/run-scripts/run-roster/src/server.ts +26 -0
- package/bundles/ragents.reference/run-scripts/run-roster/tests/program.test.ts +47 -0
- package/bundles/ragents.todo/ragents-bundle.json +1 -1
- package/bundles/ragents.transcript/ragents-bundle.json +1 -1
- package/bundles/ragents.watch/ragents-bundle.json +1 -1
- package/bundles/ragents.workspace/ragents-bundle.json +1 -1
- package/package.json +3 -3
- package/packages/ragents/src/domain/vocabulary.ts +4 -0
- package/packages/ragents/src/index.ts +3 -1
- package/packages/ragents/src/plugin-host.ts +62 -10
- package/packages/ragents/src/plugin-types.ts +11 -0
- package/packages/ragents/src/runtime/guards.ts +2 -1
- package/packages/ragents/src/typescript/async-compiler.ts +11 -1
- package/plugins/ragents.actor-programs/server/index.ts +3 -0
- package/plugins/ragents.actor-programs/server/runtime.ts +424 -28
- package/plugins/ragents.actor-programs/server/script-state.ts +54 -0
- package/plugins/ragents.actor-programs/server/tool-contributor.ts +2 -0
- package/plugins/ragents.ask/server/ask-tool.ts +1 -0
- package/plugins/ragents.orchestration/ragents-plugin.json +1 -0
- package/plugins/ragents.orchestration/server/contract.ts +14 -0
- package/plugins/ragents.orchestration/server/index.ts +4 -1
- package/plugins/ragents.orchestration/server/surface-tool.ts +58 -2
- package/plugins/ragents.orchestration/surface.hbs +5 -0
- package/plugins/ragents.reference/actors/notebook/package.json +16 -0
- package/plugins/ragents.reference/actors/notebook/src/client.tsx +31 -0
- package/plugins/ragents.reference/actors/notebook/src/server.ts +27 -0
- package/plugins/ragents.reference/actors/notebook/tests/program.test.ts +27 -0
- package/plugins/ragents.reference/run-scripts/quick-note/RUN.md +14 -0
- package/plugins/ragents.reference/run-scripts/quick-note/package.json +9 -0
- package/plugins/ragents.reference/run-scripts/quick-note/src/server.ts +29 -0
- package/plugins/ragents.reference/run-scripts/quick-note/tests/program.test.ts +43 -0
- package/plugins/ragents.reference/run-scripts/run-roster/RUN.md +19 -0
- package/plugins/ragents.reference/run-scripts/run-roster/package.json +9 -0
- package/plugins/ragents.reference/run-scripts/run-roster/src/server.ts +26 -0
- package/plugins/ragents.reference/run-scripts/run-roster/tests/program.test.ts +47 -0
- package/scripts/agent/agent-cli.ts +46 -2
- package/scripts/package/ragents.mjs +3 -1
- package/apps/web/dist/assets/runPanel-s8gGpr9M.js +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["ragents-host-read:read", "ragents-host-value:@ragents/web/PluginRegistry#pluginRoutePrefixFrom", "ragents-host-value:@ragents/web/PluginRegistry#useSurfaceController", "ragents-host-value:@ragents/web/lib/guards#isRecord", "ragents-host-value:@ragents/web/rpc#rpc", "ragents-host-value:@ragents/web/access-token#withAccessToken", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#ACTOR_INVOCATIONS_STATE_ID", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#ACTOR_PROGRAMS_STATE_ID", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#ACTOR_STATE_ID", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#actorProgramContracts", "../../../plugins/ragents.actor-programs/parameter-types.ts", "../../../node_modules/.pnpm/quassel@0.4.
|
|
3
|
+
"sources": ["ragents-host-read:read", "ragents-host-value:@ragents/web/PluginRegistry#pluginRoutePrefixFrom", "ragents-host-value:@ragents/web/PluginRegistry#useSurfaceController", "ragents-host-value:@ragents/web/lib/guards#isRecord", "ragents-host-value:@ragents/web/rpc#rpc", "ragents-host-value:@ragents/web/access-token#withAccessToken", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#ACTOR_INVOCATIONS_STATE_ID", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#ACTOR_PROGRAMS_STATE_ID", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#ACTOR_STATE_ID", "ragents-host-value:@ragents/host/plugin-support/actor-programs/contract#actorProgramContracts", "../../../plugins/ragents.actor-programs/parameter-types.ts", "../../../node_modules/.pnpm/quassel@0.4.2_@types+react@19.2.18_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/src/chat-attachments.ts", "../../../node_modules/.pnpm/quassel@0.4.2_@types+react@19.2.18_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/src/events.ts", "../../../plugins/ragents.actor-programs/web/bridge.ts", "../../../plugins/ragents.actor-programs/web/api.ts", "ragents-host-value:@ragents/web/AccessContext#useAccess", "ragents-host-value:react#createContext", "ragents-host-value:react#createElement", "ragents-host-value:react#forwardRef", "ragents-host-value:react#useCallback", "ragents-host-value:react#useContext", "ragents-host-value:react#useEffect", "ragents-host-value:react#useLayoutEffect", "ragents-host-value:react#useMemo", "ragents-host-value:react#useRef", "ragents-host-value:react#useState", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toKebabCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toLucideIconData.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toCamelCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/toPascalCase.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/mergeClasses.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/defaultAttributes.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconNode.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/build/buildLucideIconForReact.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/shared/src/utils/hasA11yProp.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/context.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/Icon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/createLucideIcon.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/arrow-left.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/layout-grid.ts", "../../../node_modules/.pnpm/lucide-react@1.46.0_react@19.2.8/node_modules/lucide-react/src/icons/x.ts", "ragents-host-value:@ragents/web/ui#Alert", "ragents-host-value:@ragents/web/ui#Badge", "ragents-host-value:@ragents/web/ui#Button", "ragents-host-value:@ragents/web/ui#Dialog", "ragents-host-value:@ragents/web/ui#DialogContent", "ragents-host-value:@ragents/web/ui#DialogTitle", "ragents-host-value:@ragents/web/ui#Empty", "ragents-host-value:@ragents/web/ui#EmptyContent", "ragents-host-value:@ragents/web/ui#EmptyDescription", "ragents-host-value:@ragents/web/ui#EmptyHeader", "ragents-host-value:@ragents/web/ui#EmptyMedia", "ragents-host-value:@ragents/web/ui#EmptyTitle", "ragents-host-value:@ragents/web/ui#Input", "ragents-host-value:@ragents/web/ui#Spinner", "ragents-host-value:@ragents/web/ui#Textarea", "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", "../../../plugins/ragents.actor-programs/web/AppsPanel.tsx", "ragents-host-value:@ragents/web/run-view#runActorFrom", "ragents-host-value:@ragents/web/run-view#runViewFrom", "ragents-host-value:@ragents/web/SourceCode#SourceCode", "../../../plugins/ragents.actor-programs/web/program-state.ts", "ragents-host-value:react/jsx-runtime#Fragment", "ragents-host-value:react/jsx-runtime#jsx", "ragents-host-value:react/jsx-runtime#jsxs", "../../../plugins/ragents.actor-programs/web/ProgramSource.tsx", "../../../plugins/ragents.actor-programs/web/function-call.ts", "../../../plugins/ragents.actor-programs/web/function-input.ts", "../../../plugins/ragents.actor-programs/web/FunctionForm.tsx", "../../../plugins/ragents.actor-programs/web/ExpandIcon.tsx", "../../../plugins/ragents.actor-programs/web/state-revision.ts", "../../../plugins/ragents.actor-programs/web/invocations.ts", "../../../plugins/ragents.actor-programs/web/context.ts", "ragents-host-value:@ragents/web/run-panel/input-bridge#hostInputEnabled", "ragents-host-value:@ragents/web/run-panel/input-bridge#isRunPanelKeyboardMessage", "ragents-host-value:@ragents/web/run-panel/input-bridge#relayFrameInput", "ragents-host-value:@ragents/web/theme#useResolvedTheme", "ragents-host-value:@ragents/web/api#sendActorMessage", "ragents-host-value:@ragents/engine/src/http/contracts#actorByHandle", "ragents-host-value:@ragents/web/actor-conversation#actorChatMessages", "ragents-host-value:@ragents/web/chat/chat-target#programChatNotice", "../../../plugins/ragents.actor-programs/web/chat-state.ts", "ragents-host-value:@ragents/web/chat/useAttachmentCapabilities#getAttachmentCapabilities", "../../../plugins/ragents.actor-programs/web/ActorViewFrame.tsx", "../../../plugins/ragents.actor-programs/web/FullscreenHost.tsx", "../../../plugins/ragents.actor-programs/web/EmbeddedApps.tsx", "../../../plugins/ragents.actor-programs/web/index.tsx"],
|
|
4
4
|
"sourcesContent": ["export const read = (specifier, name) => {\n const module = globalThis[\"__ragentsHostModules\"]?.[specifier];\n if (module === undefined) throw new Error(`The host does not provide ${specifier}`);\n if (!(name in module)) throw new Error(`The host does not provide ${name} from ${specifier}; the bundle was built against a newer host`);\n return module[name];\n};", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/PluginRegistry\", \"pluginRoutePrefixFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/PluginRegistry\", \"useSurfaceController\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/lib/guards\", \"isRecord\");\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/access-token\", \"withAccessToken\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/host/plugin-support/actor-programs/contract\", \"ACTOR_INVOCATIONS_STATE_ID\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/host/plugin-support/actor-programs/contract\", \"ACTOR_PROGRAMS_STATE_ID\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/host/plugin-support/actor-programs/contract\", \"ACTOR_STATE_ID\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/host/plugin-support/actor-programs/contract\", \"actorProgramContracts\");\n", "export const actorFunctionParameterTypes = [\"string\", \"number\", \"integer\", \"boolean\", \"string[]\", \"number[]\", \"json\"] as const;\n\nexport type ActorFunctionParameterType = typeof actorFunctionParameterTypes[number];\n", "import type { ChatAttachmentInput } from \"./events\";\n\nexport const MAX_CHAT_ATTACHMENTS = 8;\nexport const MAX_CHAT_ATTACHMENT_BYTES = 20 * 1024 * 1024;\nexport const MAX_CHAT_REQUEST_BYTES = 29 * 1024 * 1024;\n\nexport const chatAttachmentMediaType = (name: string, mediaType: string): string => {\n const explicit = mediaType.trim().toLowerCase();\n if (explicit) return explicit === \"video/quicktime\" ? \"video/mov\" : explicit;\n const types: Record<string, string> = {\n png: \"image/png\", jpg: \"image/jpeg\", jpeg: \"image/jpeg\", gif: \"image/gif\", webp: \"image/webp\",\n avif: \"image/avif\", svg: \"image/svg+xml\", pdf: \"application/pdf\",\n mp4: \"video/mp4\", webm: \"video/webm\", mov: \"video/mov\", mpeg: \"video/mpeg\", mpg: \"video/mpeg\",\n txt: \"text/plain\", md: \"text/markdown\", csv: \"text/csv\", tsv: \"text/tab-separated-values\",\n json: \"application/json\", jsonl: \"application/x-ndjson\", xml: \"application/xml\",\n yaml: \"application/yaml\", yml: \"application/yaml\", ts: \"text/plain\", tsx: \"text/plain\",\n js: \"application/javascript\", py: \"text/plain\", cs: \"text/plain\", fs: \"text/plain\",\n html: \"text/html\", css: \"text/css\", log: \"text/plain\",\n };\n return types[name.split(\".\").at(-1)?.toLowerCase() ?? \"\"] ?? \"application/octet-stream\";\n};\n\nexport const parseChatAttachments = (value: unknown): ChatAttachmentInput[] => {\n if (value === undefined) return [];\n if (!Array.isArray(value) || value.length > MAX_CHAT_ATTACHMENTS) {\n throw new Error(`Attachments must be a list of at most ${MAX_CHAT_ATTACHMENTS} files.`);\n }\n let total = 0;\n return value.map((entry, index) => {\n if (!entry || typeof entry !== \"object\" || Array.isArray(entry)) throw new Error(`Attachment ${index + 1} is invalid.`);\n const { name, mediaType, data } = entry as Record<string, unknown>;\n if (typeof name !== \"string\" || !name.trim() || name.length > 255 || /[/\\\\\\u0000-\\u001f\\u007f]/.test(name)\n || name === \".\" || name === \"..\") throw new Error(`Attachment ${index + 1} needs a valid file name without a path.`);\n const normalizedType = typeof mediaType === \"string\" ? chatAttachmentMediaType(name, mediaType) : \"\";\n if (!/^[a-z0-9!#$&^_.+-]+\\/[a-z0-9!#$&^_.+-]+$/i.test(normalizedType)) {\n throw new Error(`Attachment ${name} needs a valid MIME type.`);\n }\n if (typeof data === \"string\" && data.length > Math.ceil(MAX_CHAT_ATTACHMENT_BYTES / 3) * 4)\n throw new Error(\"Attachments may be at most 20 MiB in total.\");\n if (typeof data !== \"string\" || data.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(data)) {\n throw new Error(`Attachment ${name} contains invalid Base64.`);\n }\n const padding = data.endsWith(\"==\") ? 2 : data.endsWith(\"=\") ? 1 : 0;\n const alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n if (padding && (alphabet.indexOf(data[data.length - padding - 1]) & (padding === 2 ? 15 : 3)) !== 0) {\n throw new Error(`Attachment ${name} contains non-canonical Base64.`);\n }\n total += data.length / 4 * 3 - padding;\n if (total > MAX_CHAT_ATTACHMENT_BYTES) throw new Error(\"Attachments may be at most 20 MiB in total.\");\n return { name, mediaType: normalizedType, data };\n });\n};\n", "export type Role = \"user\" | \"assistant\" | \"thinking\" | \"tool\" | \"system\" | \"action\";\n\nexport interface ChatAttachmentInput {\n name: string;\n mediaType: string;\n data: string;\n}\n\nexport interface ChatAttachment {\n name: string;\n mediaType: string;\n size: number;\n url: string;\n}\n\nexport interface ChatAttachmentCapabilities {\n input: readonly string[];\n model: string;\n}\n\nexport interface ToolInfo {\n id: string;\n name: string;\n arguments: string;\n result?: string;\n isError?: boolean;\n}\n\nexport interface ChatTextCursor {\n conversationId: string;\n sequence: number;\n /** Accumulated non-whitespace UTF-16 units in the turn anchored by sequence. */\n offset: number;\n}\n\nexport interface ChatJournalCursor {\n conversationId: string;\n eventId: string;\n sequence: number;\n}\n\n/**\n * An action waiting for input from the user. Shape and content of `payload` and `result`\n * belong to the plugin in `owner`; a set `status` means: done, the card is a record.\n */\nexport interface PendingAction {\n actionId: string;\n owner: string | null;\n payload: unknown;\n status?: \"approved\" | \"dismissed\";\n result?: unknown;\n}\n\nexport interface Message {\n key: string;\n role: Role;\n /** Sender identifier for display; independent of role and bubble label. */\n sender?: string;\n text: string;\n textCursor?: ChatTextCursor;\n closed?: boolean;\n attachments?: ChatAttachment[];\n tool?: ToolInfo;\n action?: PendingAction;\n /** ISO timestamp of the message; display optional (ChatMessages showTimestamps). */\n at?: string;\n /** The ActorInput behind an incoming message; the steering mark hangs on it. */\n inputId?: string;\n /** The message was fed into an already running turn instead of starting its own. */\n steered?: boolean;\n /** Colored speech bubble instead of running text, e.g. for multi-party conversations. */\n bubble?: { color: string; side: \"start\" | \"end\"; label?: string };\n}\n\nexport interface ChatStartupStatus {\n status: \"preparing\" | \"failed\";\n message: string;\n}\n\nexport type ChatEvent =\n | { kind: \"reset\"; reason?: \"conversation-reset\"; conversationId: string | null }\n | { kind: \"replay-end\"; conversationId: string | null }\n | { kind: \"user\"; text: string; inputId?: string; at?: string; attachments?: ChatAttachment[] }\n | { kind: \"steered\"; inputId: string }\n | { kind: \"text\"; delta: string; at?: string; cursor: ChatTextCursor }\n | { kind: \"thinking\"; delta: string; at?: string }\n | { kind: \"tool\"; id: string; name: string; arguments: string; label?: string; at?: string }\n | { kind: \"tool-result\"; id: string; result: string; isError?: boolean }\n | { kind: \"action\"; actionId: string; owner: string | null; text: string; payload: unknown; at?: string }\n | { kind: \"action-resolved\"; actionId: string; status: \"approved\" | \"dismissed\"; result: unknown }\n | { kind: \"system\"; text: string; at?: string }\n | { kind: \"status\"; running: boolean; startup?: ChatStartupStatus }\n | { kind: \"turn-done\" }\n | { kind: \"plugin\"; pluginId: string; type: string; payload?: unknown; at?: string; journal?: ChatJournalCursor };\n\nlet keyCounter = 0;\n\n// crypto.randomUUID is missing outside secure contexts, e.g. for a host served over http.\nconst newKey = (): string => typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\"\n ? crypto.randomUUID()\n : `qsl-${Date.now().toString(36)}-${(keyCounter += 1).toString(36)}`;\n\nfunction openMessageIndex(messages: Message[]): number {\n for (let index = messages.length - 1; index >= 0; index--) {\n const message = messages[index];\n if (!message.closed && (message.role === \"assistant\" || message.role === \"thinking\")) return index;\n }\n return -1;\n}\n\nfunction closeOpen(messages: Message[]): Message[] {\n const index = openMessageIndex(messages);\n if (index === -1) {\n return messages;\n }\n return messages.map((message, position) => position === index ? { ...message, closed: true } : message);\n}\n\nfunction appendDelta(messages: Message[], role: Role, delta: string, at?: string, textCursor?: ChatTextCursor): Message[] {\n const index = openMessageIndex(messages);\n const current = messages[index];\n if (current && current.role === role\n && current.textCursor?.conversationId === textCursor?.conversationId\n && current.textCursor?.sequence === textCursor?.sequence) {\n return messages.map((message, position) => position === index\n ? { ...message, text: message.text + delta, ...(textCursor ? { textCursor } : {}) }\n : message);\n }\n return [...closeOpen(messages), { key: newKey(), role, text: delta, at, ...(textCursor ? { textCursor } : {}) }];\n}\n\n/** Incoming messages leave the running output block open. */\nexport function applyEvent(messages: Message[], event: ChatEvent): Message[] {\n switch (event.kind) {\n case \"reset\":\n return [];\n case \"user\":\n return [...messages, { key: newKey(), role: \"user\", text: event.text, closed: true, at: event.at,\n ...(event.inputId ? { inputId: event.inputId } : {}),\n ...(event.attachments?.length ? { attachments: event.attachments } : {}) }];\n case \"steered\":\n return messages.map((message) => message.inputId === event.inputId ? { ...message, steered: true } : message);\n case \"text\":\n return appendDelta(messages, \"assistant\", event.delta, event.at, event.cursor);\n case \"thinking\":\n return appendDelta(messages, \"thinking\", event.delta, event.at);\n case \"tool\":\n return [\n ...closeOpen(messages),\n {\n key: newKey(),\n role: \"tool\",\n text: event.label ?? event.name,\n closed: true,\n tool: { id: event.id, name: event.name, arguments: event.arguments },\n at: event.at,\n },\n ];\n case \"tool-result\": {\n const index = messages.map((message) => message.tool?.id).lastIndexOf(event.id);\n return messages.map((message, position) =>\n position === index && message.tool\n ? { ...message, tool: { ...message.tool, result: event.result, isError: event.isError } }\n : message,\n );\n }\n case \"action\":\n return [\n ...closeOpen(messages),\n {\n key: newKey(),\n role: \"action\",\n text: event.text,\n closed: true,\n action: { actionId: event.actionId, owner: event.owner, payload: event.payload },\n at: event.at,\n },\n ];\n case \"action-resolved\":\n return messages.map((message) =>\n message.action?.actionId === event.actionId\n ? { ...message, action: { ...message.action, status: event.status, result: event.result } }\n : message,\n );\n case \"system\":\n return [...closeOpen(messages), { key: newKey(), role: \"system\", text: event.text, closed: true, at: event.at }];\n case \"turn-done\":\n return closeOpen(messages);\n default:\n return messages;\n }\n}\n\nexport function prettyJson(value: string): string {\n try {\n return JSON.stringify(JSON.parse(value), null, 2);\n } catch {\n return value;\n }\n}\n\nexport function compactToolLine(tool: ToolInfo): string {\n const args = tool.arguments.replace(/\\s+/g, \" \").trim();\n const line = args && args !== \"{}\" ? `${tool.name} ${args}` : tool.name;\n return line.length > 160 ? `${line.slice(0, 160)} ...` : line;\n}\n\nexport { MAX_CHAT_ATTACHMENTS, MAX_CHAT_ATTACHMENT_BYTES, MAX_CHAT_REQUEST_BYTES, chatAttachmentMediaType, parseChatAttachments } from \"./chat-attachments\";\n", "import { isRecord } from \"@ragents/web/lib/guards\";\nimport { parseChatAttachments, type ChatAttachmentInput } from \"quassel/events\";\n\nexport const RUN_APP_BRIDGE_VERSION = 1;\n\nexport const RUN_APP_FRAME_READY = \"ragents.app.frame-ready\";\nexport const RUN_APP_CONNECTED = \"ragents.app.connected\";\nexport const RUN_APP_READY = \"ragents.app.ready\";\nexport const RUN_APP_THEME = \"ragents.app.theme\";\nexport const RUN_APP_INVOKE = \"ragents.app.invoke\";\nexport const RUN_APP_GET_STATE = \"ragents.app.get-state\";\nexport const RUN_APP_STATE = \"ragents.app.state\";\nexport const RUN_APP_INVOCATION = \"ragents.app.invocation\";\nexport const RUN_APP_ERROR = \"ragents.app.error\";\nexport const RUN_APP_CHAT_WATCH = \"ragents.app.chat-watch\";\nexport const RUN_APP_CHAT_UNWATCH = \"ragents.app.chat-unwatch\";\nexport const RUN_APP_CHAT_SEND = \"ragents.app.chat-send\";\nexport const RUN_APP_CHAT_STATE = \"ragents.app.chat-state\";\nexport const RUN_APP_CHAT_ACK = \"ragents.app.chat-ack\";\n\nexport type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\n\nexport interface RunAppInvokeRequest {\n type: typeof RUN_APP_INVOKE;\n version: typeof RUN_APP_BRIDGE_VERSION;\n requestId: string;\n actionId: string;\n input: JsonValue;\n}\n\nexport interface RunAppGetStateRequest {\n type: typeof RUN_APP_GET_STATE;\n version: typeof RUN_APP_BRIDGE_VERSION;\n requestId: string;\n}\n\nexport type RunAppChatRequest = {\n version: typeof RUN_APP_BRIDGE_VERSION;\n requestId: string;\n actor: string;\n} & (\n | { type: typeof RUN_APP_CHAT_WATCH }\n | { type: typeof RUN_APP_CHAT_UNWATCH }\n | { type: typeof RUN_APP_CHAT_SEND; text: string; attachments?: ChatAttachmentInput[] }\n);\n\nexport type RunAppBridgeRequest = RunAppInvokeRequest | RunAppGetStateRequest | RunAppChatRequest;\n\nexport type RunAppBridgeValidation =\n | { ok: true; request: RunAppBridgeRequest }\n | { ok: false; requestId?: string; error: string };\n\nconst ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;\nconst MAX_INPUT_LENGTH = 64 * 1024;\nconst MAX_DEPTH = 24;\n\nexport const isJsonValue = (value: unknown, depth = 0): value is JsonValue => {\n if (depth > MAX_DEPTH) return false;\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n if (typeof value === \"number\") return Number.isFinite(value);\n if (Array.isArray(value)) return value.every((entry) => isJsonValue(entry, depth + 1));\n if (!isRecord(value)) return false;\n return Object.entries(value).every(([key, entry]) => key.length <= 256 && isJsonValue(entry, depth + 1));\n};\n\nconst requestIdFrom = (value: unknown): string | undefined =>\n typeof value === \"string\" && ID_PATTERN.test(value) ? value : undefined;\n\nconst inputWithinLimit = (value: JsonValue): boolean => {\n try {\n return new TextEncoder().encode(JSON.stringify(value)).byteLength <= MAX_INPUT_LENGTH;\n } catch {\n return false;\n }\n};\n\nexport const validateRunAppBridgeRequest = (value: unknown): RunAppBridgeValidation => {\n if (!isRecord(value)) return { ok: false, error: \"The app message is not an object\" };\n const requestId = requestIdFrom(value.requestId);\n if (!requestId) return { ok: false, error: \"The app message contains no valid requestId\" };\n if (value.version !== RUN_APP_BRIDGE_VERSION) {\n return { ok: false, requestId, error: \"The app uses an unsupported bridge version\" };\n }\n if (value.type === RUN_APP_GET_STATE) {\n return { ok: true, request: { type: RUN_APP_GET_STATE, version: RUN_APP_BRIDGE_VERSION, requestId } };\n }\n if (value.type === RUN_APP_CHAT_WATCH || value.type === RUN_APP_CHAT_UNWATCH || value.type === RUN_APP_CHAT_SEND) {\n if (typeof value.actor !== \"string\" || !/^@?[\\p{L}\\p{N}_-]{1,64}$/u.test(value.actor)) {\n return { ok: false, requestId, error: \"The chat target must be primary or an actor handle such as @reviewer\" };\n }\n const common = { version: RUN_APP_BRIDGE_VERSION, requestId, actor: value.actor } as const;\n if (value.type !== RUN_APP_CHAT_SEND) return { ok: true, request: { ...common, type: value.type } };\n let attachments: ChatAttachmentInput[];\n try { attachments = parseChatAttachments(value.attachments); } catch (cause) {\n return { ok: false, requestId, error: cause instanceof Error ? cause.message : String(cause) };\n }\n if (typeof value.text !== \"string\" || (!value.text.trim() && !attachments.length) || !inputWithinLimit(value.text)) {\n return { ok: false, requestId, error: \"The chat message is empty or too large\" };\n }\n return { ok: true, request: { ...common, type: RUN_APP_CHAT_SEND, text: value.text.trim(), ...(attachments.length ? { attachments } : {}) } };\n }\n if (value.type !== RUN_APP_INVOKE) {\n return { ok: false, requestId, error: \"The app message has an unknown type\" };\n }\n if (typeof value.actionId !== \"string\" || !ID_PATTERN.test(value.actionId)) {\n return { ok: false, requestId, error: \"The app message contains no valid actionId\" };\n }\n if (!isJsonValue(value.input) || !inputWithinLimit(value.input)) {\n return { ok: false, requestId, error: \"The input of the app action is not a valid JSON value or too large\" };\n }\n return {\n ok: true,\n request: {\n type: RUN_APP_INVOKE,\n version: RUN_APP_BRIDGE_VERSION,\n requestId,\n actionId: value.actionId,\n input: value.input,\n },\n };\n};\n", "import { isRecord } from \"@ragents/web/lib/guards\";\nimport { rpc } from \"@ragents/web/rpc\";\nimport { withAccessToken } from \"@ragents/web/access-token\";\nimport { actorProgramContracts } from \"@ragents/host/plugin-support/actor-programs/contract\";\nimport {\n actorFunctionParameterTypes,\n type ActorFunctionParameterType,\n} from \"../parameter-types\";\nimport { isJsonValue, type JsonValue } from \"./bridge\";\n\nexport type RunAppInvocationStatus = \"queued\" | \"running\" | \"succeeded\" | \"failed\" | \"cancelled\";\n\nexport interface RunAppAction {\n id: string;\n label: string;\n description?: string;\n confirmation: string | null;\n}\n\nexport type RunAppPlacement = { kind: \"canvas\"; anchorActorId: string };\n\nexport type RunAppInvocation = {\n id: string;\n actorId: string;\n actorHandle: string;\n appId: string;\n actionId: string;\n revision: string;\n output: string[];\n createdAt: string;\n requestId: string;\n} & (\n | { status: \"queued\" }\n | { status: \"running\"; startedAt: string }\n | { status: \"succeeded\"; startedAt: string; finishedAt: string; result: JsonValue }\n | { status: \"failed\" | \"cancelled\"; startedAt?: string; finishedAt: string; error: string }\n);\n\nexport interface RunApp {\n id: string;\n actorId: string;\n actorHandle: string;\n visible?: boolean;\n title: string;\n description?: string;\n revision: string;\n actions: RunAppAction[];\n placements: RunAppPlacement[];\n state: { version: 1; revision: number; values: JsonValue };\n invocations: RunAppInvocation[];\n}\n\nexport interface RunToolParameter {\n name: string;\n description: string;\n type: ActorFunctionParameterType;\n required: boolean;\n}\n\nexport interface RunToolTarget {\n actorId: string;\n handle: string | null;\n}\n\nexport interface RunScriptTool {\n actorId: string;\n actorHandle: string;\n functionId: string;\n revision: string;\n moduleId: string;\n name: string;\n description: string;\n parameters: RunToolParameter[];\n card: boolean;\n sourceHash: string;\n targets: RunToolTarget[];\n installedBy: string;\n}\n\nexport interface ActorProgramSourceFile {\n path: string;\n content: string;\n}\n\nexport interface ActorProgramsListing {\n apps: RunApp[];\n tools: RunScriptTool[];\n}\n\nexport interface ActorProgramsApi {\n list: (runId: string, signal?: AbortSignal) => Promise<ActorProgramsListing>;\n source: (runId: string, moduleId: string, signal?: AbortSignal) => Promise<ActorProgramSourceFile[]>;\n frameUrl: (runId: string, appId: string, revision: string) => string;\n invoke: (\n runId: string,\n appId: string,\n revision: string,\n actionId: string,\n requestId: string,\n input: JsonValue,\n signal?: AbortSignal,\n ) => Promise<RunAppInvocation>;\n invocation: (runId: string, appId: string, invocationId: string, signal?: AbortSignal) => Promise<RunAppInvocation>;\n invokeFunction: (runId: string, actorHandle: string, revision: string, functionId: string, requestId: string, input: JsonValue, signal?: AbortSignal) => Promise<RunAppInvocation>;\n functionInvocation: (runId: string, actorHandle: string, invocationId: string, signal?: AbortSignal) => Promise<RunAppInvocation>;\n}\n\nconst ID_PATTERN = /^[A-Za-z0-9_-]{1,100}$/;\nconst VIEW_ID_PATTERN = /^[A-Za-z0-9_-]{1,130}$/;\nconst HASH_PATTERN = /^[a-f0-9]{64}$/;\nconst PARAMETER_TYPES = new Set<RunToolParameter[\"type\"]>(actorFunctionParameterTypes);\n\nconst requiredString = (value: unknown, field: string): string => {\n if (typeof value !== \"string\" || !value.trim()) throw new Error(`${field} is missing or empty`);\n return value;\n};\n\nconst optionalString = (value: unknown, field: string): string | undefined => {\n if (value === undefined) return undefined;\n if (typeof value !== \"string\") throw new Error(`${field} is not text`);\n return value;\n};\n\nconst idFrom = (value: unknown, field: string): string => {\n const id = requiredString(value, field);\n if (!ID_PATTERN.test(id)) throw new Error(`${field} is not a valid identifier`);\n return id;\n};\n\nconst unique = <T,>(values: T[], keyOf: (value: T) => string, label: string): T[] => {\n const ids = values.map(keyOf);\n if (new Set(ids).size !== ids.length) throw new Error(`${label} contains duplicate identifiers`);\n return values;\n};\n\nexport const runAppActionFrom = (value: unknown): RunAppAction => {\n if (!isRecord(value)) throw new Error(\"An app action is not an object\");\n if (value.confirmation !== null && typeof value.confirmation !== \"string\") {\n throw new Error(\"confirmation of an app action must be text or null\");\n }\n if (typeof value.confirmation === \"string\" && !value.confirmation.trim()) {\n throw new Error(\"confirmation of an app action must not be empty\");\n }\n return {\n id: idFrom(value.id, \"action.id\"),\n label: requiredString(value.label, \"action.label\"),\n ...(value.description !== undefined\n ? { description: optionalString(value.description, \"action.description\") as string }\n : {}),\n confirmation: value.confirmation,\n };\n};\n\nexport const runAppInvocationFrom = (value: unknown): RunAppInvocation => {\n if (!isRecord(value)) throw new Error(\"An app execution is not an object\");\n if (!Array.isArray(value.output) || value.output.some((line) => typeof line !== \"string\")) {\n throw new Error(\"output of an app execution is not a text list\");\n }\n const base = {\n id: idFrom(value.id, \"invocation.id\"),\n actorId: requiredString(value.actorId, \"invocation.actorId\"),\n actorHandle: requiredString(value.actorHandle, \"invocation.actorHandle\"),\n appId: requiredString(value.appId, \"invocation.appId\"),\n actionId: idFrom(value.actionId, \"invocation.actionId\"),\n revision: requiredString(value.revision, \"invocation.revision\"),\n output: value.output as string[],\n createdAt: requiredString(value.createdAt, \"invocation.createdAt\"),\n requestId: idFrom(value.requestId, \"invocation.requestId\"),\n };\n switch (value.status) {\n case \"queued\":\n return { ...base, status: \"queued\" };\n case \"running\":\n return { ...base, status: \"running\", startedAt: requiredString(value.startedAt, \"invocation.startedAt\") };\n case \"succeeded\": {\n if (!isJsonValue(value.result)) throw new Error(\"result of an app execution is not a JSON value\");\n return {\n ...base,\n status: \"succeeded\",\n startedAt: requiredString(value.startedAt, \"invocation.startedAt\"),\n finishedAt: requiredString(value.finishedAt, \"invocation.finishedAt\"),\n result: value.result,\n };\n }\n case \"failed\":\n case \"cancelled\":\n return {\n ...base,\n status: value.status,\n ...(value.startedAt !== undefined\n ? { startedAt: requiredString(value.startedAt, \"invocation.startedAt\") }\n : {}),\n finishedAt: requiredString(value.finishedAt, \"invocation.finishedAt\"),\n error: requiredString(value.error, \"invocation.error\"),\n };\n default:\n throw new Error(\"status of an app execution is invalid\");\n }\n};\n\nconst runAppPlacementFrom = (value: unknown): RunAppPlacement => {\n if (!isRecord(value)) throw new Error(\"An app placement is not an object\");\n if (value.kind === \"canvas\") {\n return {\n kind: \"canvas\",\n anchorActorId: requiredString(value.anchorActorId, \"placement.anchorActorId\"),\n };\n }\n throw new Error(\"kind of an app placement must be canvas\");\n};\n\nexport const runAppFrom = (value: unknown): RunApp => {\n if (!isRecord(value)) throw new Error(\"An app is not an object\");\n if (!Array.isArray(value.actions)) throw new Error(\"actions of an app is not a list\");\n if (!Array.isArray(value.invocations)) throw new Error(\"invocations of an app is not a list\");\n const rawPlacements = value.placements ?? [];\n if (!Array.isArray(rawPlacements)) throw new Error(\"placements of an app is not a list\");\n if (!isRecord(value.state) || value.state.version !== 1 || !Number.isSafeInteger(value.state.revision) || !isJsonValue(value.state.values)) throw new Error(\"state of a view does not match the state contract\");\n const actions = unique(value.actions.map(runAppActionFrom), (action) => action.id, \"actions\");\n const invocations = unique(\n value.invocations.map(runAppInvocationFrom),\n (invocation) => invocation.id,\n \"invocations\",\n );\n const actionIds = new Set(actions.map((action) => action.id));\n if (invocations.some((invocation) => !actionIds.has(invocation.actionId))) {\n throw new Error(\"An app execution refers to an unknown action\");\n }\n if (value.visible !== undefined && typeof value.visible !== \"boolean\") throw new Error(\"visible of an app is not a boolean\");\n if (rawPlacements.length > 1) throw new Error(\"placements of an app contains more than one placement\");\n const placements = rawPlacements.map(runAppPlacementFrom);\n const id = requiredString(value.id, \"view.id\");\n if (!VIEW_ID_PATTERN.test(id)) throw new Error(\"view.id is not a valid identifier\");\n const actorId = requiredString(value.actorId, \"view.actorId\");\n if (placements.some((placement) => placement.anchorActorId !== actorId)) throw new Error(\"The view must be placed at its own actor\");\n return {\n id,\n actorId,\n actorHandle: requiredString(value.actorHandle, \"view.actorHandle\"),\n visible: value.visible !== false,\n title: requiredString(value.title, \"app.title\"),\n ...(value.description !== undefined\n ? { description: optionalString(value.description, \"app.description\") as string }\n : {}),\n revision: requiredString(value.revision, \"app.revision\"),\n actions,\n placements,\n state: { version: 1, revision: value.state.revision as number, values: value.state.values },\n invocations,\n };\n};\n\nconst runToolParameterFrom = (value: unknown): RunToolParameter => {\n if (!isRecord(value)) throw new Error(\"A tool parameter is not an object\");\n if (typeof value.type !== \"string\" || !PARAMETER_TYPES.has(value.type as RunToolParameter[\"type\"])) {\n throw new Error(\"type of a tool parameter is invalid\");\n }\n if (typeof value.required !== \"boolean\") throw new Error(\"required of a tool parameter is not a boolean\");\n return {\n name: idFrom(value.name, \"parameter.name\"),\n description: requiredString(value.description, \"parameter.description\"),\n type: value.type as RunToolParameter[\"type\"],\n required: value.required,\n };\n};\n\nconst runToolTargetFrom = (value: unknown): RunToolTarget => {\n if (!isRecord(value)) throw new Error(\"A tool target is not an object\");\n if (value.handle !== null && typeof value.handle !== \"string\") {\n throw new Error(\"handle of a tool target must be text or null\");\n }\n return {\n actorId: requiredString(value.actorId, \"target.actorId\"),\n handle: value.handle,\n };\n};\n\nexport const runScriptToolFrom = (value: unknown): RunScriptTool => {\n if (!isRecord(value)) throw new Error(\"A script tool is not an object\");\n if (!Array.isArray(value.parameters)) throw new Error(\"parameters of a script tool is not a list\");\n if (!Array.isArray(value.targets)) throw new Error(\"targets of a script tool is not a list\");\n const sourceHash = requiredString(value.sourceHash, \"tool.sourceHash\");\n if (!HASH_PATTERN.test(sourceHash)) throw new Error(\"sourceHash of a script tool is invalid\");\n return {\n actorId: requiredString(value.actorId, \"tool.actorId\"),\n actorHandle: requiredString(value.actorHandle, \"tool.actorHandle\"),\n functionId: idFrom(value.functionId, \"tool.functionId\"),\n revision: requiredString(value.revision, \"tool.revision\"),\n moduleId: idFrom(value.moduleId, \"tool.moduleId\"),\n name: idFrom(value.name, \"tool.name\"),\n description: requiredString(value.description, \"tool.description\"),\n parameters: unique(value.parameters.map(runToolParameterFrom), (parameter) => parameter.name, \"parameters\"),\n card: value.card === true,\n sourceHash,\n targets: unique(value.targets.map(runToolTargetFrom), (target) => target.actorId, \"targets\"),\n installedBy: requiredString(value.installedBy, \"tool.installedBy\"),\n };\n};\n\nconst actorProgramSourceFileFrom = (value: unknown): ActorProgramSourceFile => {\n if (!isRecord(value)) throw new Error(\"A source file is not an object\");\n if (typeof value.content !== \"string\") throw new Error(\"content of a source file is not text\");\n return {\n path: requiredString(value.path, \"source.path\"),\n content: value.content,\n };\n};\n\nexport const actorProgramSourceFrom = (value: unknown): ActorProgramSourceFile[] => {\n if (!isRecord(value) || !Array.isArray(value.files)) throw new Error(\"The source list does not match the contract\");\n return unique(value.files.map(actorProgramSourceFileFrom), (file) => file.path, \"files\");\n};\n\nexport const actorProgramsListingFrom = (value: unknown): ActorProgramsListing => {\n if (!isRecord(value) || !Array.isArray(value.apps) || !Array.isArray(value.tools)) {\n throw new Error(\"The list of actor programs does not match the contract\");\n }\n return {\n apps: unique(value.apps.map(runAppFrom), (app) => app.id, \"apps\"),\n tools: unique(value.tools.map(runScriptToolFrom), (tool) => tool.name, \"tools\"),\n };\n};\n\nconst segment = (value: string): string => encodeURIComponent(value);\n\nconst frameBase = (routePrefix: string, runId: string): string =>\n `${routePrefix}/runs/${segment(runId)}/apps`;\n\nexport const createActorProgramsApi = (routePrefix: string): ActorProgramsApi => ({\n list: async (runId, signal) =>\n actorProgramsListingFrom(await rpc.call(actorProgramContracts.apps, { runId }, { signal })),\n source: async (runId, moduleId, signal) =>\n actorProgramSourceFrom(await rpc.call(actorProgramContracts.source, { runId, moduleId }, { signal })),\n frameUrl: (runId, appId, revision) =>\n withAccessToken(`${frameBase(routePrefix, runId)}/${segment(appId)}/frame?revision=${segment(revision)}`),\n invoke: async (runId, appId, revision, actionId, requestId, input, signal) =>\n runAppInvocationFrom(await rpc.call(actorProgramContracts.action, { runId, appId, revision, actionId, requestId, input }, { signal })),\n invocation: async (runId, appId, invocationId, signal) =>\n runAppInvocationFrom(await rpc.call(actorProgramContracts.invocation, { runId, appId, invocationId }, { signal })),\n invokeFunction: async (runId, actorHandle, revision, functionId, requestId, input, signal) =>\n runAppInvocationFrom(await rpc.call(actorProgramContracts.function, { runId, actorHandle, revision, functionId, requestId, input }, { signal })),\n functionInvocation: async (runId, actorHandle, invocationId, signal) =>\n runAppInvocationFrom(await rpc.call(actorProgramContracts.functionInvocation, { runId, actorHandle, invocationId }, { signal })),\n});\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(\"react\", \"createContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"createElement\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"forwardRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useCallback\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useContext\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useLayoutEffect\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useMemo\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useRef\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"react\", \"useState\");\n", "/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string?.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n", "import { toKebabCase } from './toKebabCase';\nimport type { LucideIconData, LucideIconNode } from '../build/types';\n\n/**\n * Converts legacy `(name, iconNode, aliases?)` icon arguments into icon data object format.\n */\nexport function toLucideIconData(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases: string[] = [],\n): LucideIconData {\n if (iconNode == null) {\n throw new Error('[lucide]: iconNode is required when icon name is used');\n }\n\n return {\n name: toKebabCase(iconName),\n size: 24,\n node: iconNode,\n ...(aliases.length > 0 ? { aliases } : {}),\n };\n}\n", "/**\n * Converts string to camel case\n *\n * @param {string} string\n * @returns {string} A camelized string\n */\nexport const toCamelCase = <T extends string>(string: T) => {\n let out = '';\n let upperNext = false;\n\n for (const ch of string) {\n if (ch === '-' || ch === '_' || ch <= ' ') {\n upperNext = out.length > 0;\n continue;\n }\n\n if (out.length === 0) {\n out += ch.toLowerCase();\n } else {\n out += upperNext ? ch.toUpperCase() : ch;\n }\n\n upperNext = false;\n }\n\n return out as string;\n};\n", "import { CamelToPascal } from '../utility-types';\nimport { toCamelCase } from './toCamelCase';\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = toCamelCase(string);\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n", "/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return (\n Boolean(className) &&\n (className as string).trim() !== '' &&\n array.indexOf(className) === index\n );\n })\n .join(' ')\n .trim();\n", "const defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n} as const;\n\nexport default defaultAttributes;\n", "import type { LucideBuildParams, LucideIconData, LucideIconNode, SVGProps } from './types';\nimport defaultAttributes from './defaultAttributes';\nimport { mergeClasses } from '../utils/mergeClasses';\n\nfunction isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Creates a Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconNode(icon: LucideIconData, params: LucideBuildParams = {}): LucideIconNode {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName: string) =>\n attributeNames[attributeName] ?? attributeName;\n\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes['width'];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes['height'];\n const aliasClassNames =\n icon.aliases\n ?.filter((alias: string): alias is string => typeof alias === 'string' && alias.trim() !== '')\n .map((alias: string) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...(icon.name ? [`lucide-${icon.name}`] : []), ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(' ').filter(Boolean) ?? [];\n const className =\n params.includeDefaultClasses === false\n ? mergeClasses(...classNamesFromClassName)\n : mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);\n\n const calculatedStrokeWidth = params.absoluteStrokeWidth\n ? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *\n Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /\n Number(params.size ?? params.width ?? defaultAttributes['width'])\n : (params.strokeWidth ?? defaultAttributes['stroke-width']);\n\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {} as SVGProps),\n ...('color' in params &&\n params.color && {\n [getAttributeName('stroke')]: params.color,\n }),\n ...('size' in params &&\n isDefined(params.size) && {\n [getAttributeName('width')]: params.size,\n [getAttributeName('height')]: params.size,\n }),\n ...('width' in params &&\n isDefined(params.width) && {\n [getAttributeName('width')]: params.width,\n }),\n ...('height' in params &&\n isDefined(params.height) && {\n [getAttributeName('height')]: params.height,\n }),\n [getAttributeName('stroke-width')]: calculatedStrokeWidth,\n ...(className && {\n [getAttributeName('class')]: className,\n }),\n [getAttributeName('viewBox')]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...(params.hasA11yProp === false\n ? {\n [getAttributeName('aria-hidden')]: 'true',\n }\n : {}),\n ...('attributes' in params && params.attributes),\n };\n\n return [\n 'svg',\n attributes,\n icon.node.map((child): LucideIconNode => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke\n ? { [getAttributeName('vector-effect')]: 'non-scaling-stroke', ...attrs }\n : attrs;\n\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n }),\n ];\n}\n\nexport default buildLucideIconNode;\n", "import buildLucideIconNode from './buildLucideIconNode';\nimport type { LucideBuildParams, LucideIconData, LucideIconNode } from './types';\n\n/**\n * Creates a React-compatible Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconForReact(\n icon: LucideIconData,\n params: LucideBuildParams = {},\n): LucideIconNode {\n return buildLucideIconNode(icon, {\n ...params,\n attributeNames: {\n ...params.attributeNames,\n class: 'className',\n 'stroke-width': 'strokeWidth',\n 'stroke-linecap': 'strokeLinecap',\n 'stroke-linejoin': 'strokeLinejoin',\n 'vector-effect': 'vectorEffect',\n },\n });\n}\n\nexport default buildLucideIconForReact;\n", "/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props: object) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n\n return false;\n};\n", "'use client';\n\nimport { createContext, createElement, type ReactNode, useContext, useMemo } from 'react';\nimport { LucideProps } from './types';\n\ntype LucideConfig = {\n size: number;\n color: string;\n strokeWidth: number;\n /**\n * @deprecated Use `nonScalingStroke` instead.\n */\n absoluteStrokeWidth: boolean;\n nonScalingStroke: boolean;\n className: string;\n};\n\nconst LucideContext = createContext<LucideProps>({});\n\ntype LucideProviderProps = {\n children: ReactNode;\n} & Partial<LucideConfig>;\n\nexport function LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n}: LucideProviderProps) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className,\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className],\n );\n\n return createElement(LucideContext.Provider, { value }, children);\n}\n\nexport const useLucideContext = () => useContext(LucideContext);\n", "'use client';\n\nimport { createElement, forwardRef } from 'react';\nimport { buildLucideIconForReact, hasA11yProp, mergeClasses } from '@lucide/shared';\nimport { LucideIconData, LucideIconNode, LucideProps } from './types';\nimport { useLucideContext } from './context';\n\ntype IconComponentProps = LucideProps &\n (\n | {\n iconNode: LucideIconNode[];\n icon?: never;\n }\n | {\n icon: LucideIconData;\n iconNode?: never;\n }\n );\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {boolean} props.nonScalingStroke - Whether to use non scaling strokes\n * @param {string} props.className - The class name of the icon\n * @param {LucideIconNode[]} props.children - The children of the icon\n * @param {LucideIconNode[]} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color,\n size,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className = '',\n children,\n iconNode = [],\n icon = {\n node: iconNode,\n aliases: [],\n size: 24,\n },\n ...rest\n },\n ref,\n ) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n nonScalingStroke: contextNonScalingStroke = false,\n color: contextColor = 'currentColor',\n className: contextClass = '',\n } = useLucideContext() ?? {};\n\n const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);\n\n const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {\n color: color ?? contextColor,\n width: width ?? size ?? contextSize,\n height: height ?? size ?? contextSize,\n strokeWidth: strokeWidth ?? contextStrokeWidth,\n absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,\n nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,\n className: mergeClasses(contextClass, className),\n hasA11yProp: hasAccessibleProp,\n attributes: rest,\n });\n\n return createElement(\n name,\n {\n ref,\n ...svgAttributes,\n },\n [\n ...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n", "import { createElement, forwardRef } from 'react';\nimport { toLucideIconData, toPascalCase } from '@lucide/shared';\nimport { LucideIcon, LucideIconData, LucideIconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Creates a Lucide icon component from icon data.\n *\n * @param icon Icon data object.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(icon: LucideIconData): LucideIcon;\n\n/**\n * Creates a Lucide icon component from the legacy icon arguments.\n *\n * @param iconName Icon name.\n * @param iconNode Icon node.\n * @param aliases Optional icon aliases.\n * @returns Lucide icon component.\n */\nfunction createLucideIcon(\n iconName: string,\n iconNode: LucideIconNode[],\n aliases?: string[],\n): LucideIcon;\n\nfunction createLucideIcon(\n iconDataOrName: LucideIconData | string,\n iconNode: LucideIconNode[] = [],\n aliases: string[] = [],\n): LucideIcon {\n const iconData =\n typeof iconDataOrName === 'string'\n ? toLucideIconData(iconDataOrName, iconNode, aliases)\n : iconDataOrName;\n\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n icon: iconData,\n className,\n ...props,\n }),\n );\n\n if (iconData.name) {\n Component.displayName = toPascalCase(iconData.name);\n }\n\n return Component;\n}\n\nexport default createLucideIcon;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'arrow-left',\n size: 24,\n node: [\n ['path', { d: 'm12 19-7-7 7-7', key: '1l729n' }],\n ['path', { d: 'M19 12H5', key: 'x3x0zl' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name ArrowLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/arrow-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowLeft = createLucideIcon(__iconData);\n\nexport default ArrowLeft;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'layout-grid',\n size: 24,\n node: [\n ['rect', { width: '7', height: '7', x: '3', y: '3', rx: '1', key: '1g98yp' }],\n ['rect', { width: '7', height: '7', x: '14', y: '3', rx: '1', key: '6d4xhi' }],\n ['rect', { width: '7', height: '7', x: '14', y: '14', rx: '1', key: 'nxv5o0' }],\n ['rect', { width: '7', height: '7', x: '3', y: '14', rx: '1', key: '1bb6yr' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name LayoutGrid\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/layout-grid\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst LayoutGrid = createLucideIcon(__iconData);\n\nexport default LayoutGrid;\n", "import createLucideIcon from '../createLucideIcon';\nimport type { LucideIconNode, LucideIconData } from '../types';\n\nexport const __iconData: LucideIconData = {\n name: 'x',\n size: 24,\n node: [\n ['path', { d: 'M18 6 6 18', key: '1bl5f8' }],\n ['path', { d: 'm6 6 12 12', key: 'd8bk6v' }],\n ],\n};\n\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode: LucideIconNode[] = __iconData.node;\n\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst X = createLucideIcon(__iconData);\n\nexport default X;\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Alert\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Badge\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Button\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Dialog\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"DialogTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Empty\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyContent\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyDescription\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyHeader\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyMedia\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"EmptyTitle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Input\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Spinner\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/ui\", \"Textarea\");\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 { useAccess } from \"@ragents/web/AccessContext\";\nimport { ArrowLeftIcon, LayoutGridIcon } from \"lucide-react\";\nimport { Alert, Badge, Button, cn, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Spinner } from \"@ragents/web/ui\";\nimport { ToolbarCopy, ToolbarItem, ToolbarLabel, ToolbarText } from \"@ragents/web/Toolbar\";\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport { askPayloadOf, ASK_PLUGIN_ID } from \"@ragents/plugins/ragents.ask/ask-payload\";\nimport { answerQuestion } from \"@ragents/plugins/ragents.ask/web/api\";\nimport { QuestionCard } from \"@ragents/plugins/ragents.ask/web/QuestionCard\";\nimport { ACTOR_PROGRAMS_STATE_ID } from \"@ragents/host/plugin-support/actor-programs/contract\";\nimport {\n useSurfaceController,\n type SessionContext,\n type SessionHeaderContext,\n type WorkspaceTabContext,\n} from \"@ragents/web/PluginRegistry\";\nimport { runViewFrom, type RunAction } from \"@ragents/web/run-view\";\nimport { useSurfaceEntities } from \"@ragents/plugins/ragents.orchestration/web/surface-entities\";\nimport { SURFACE_TILE_DRAG_TYPE } from \"@ragents/plugins/ragents.orchestration/web/tile-docking\";\nimport { ProgramSlotContext, type ProgramSlot } from \"@ragents/plugins/ragents.orchestration/web/program-slot\";\nimport {\n type RunApp,\n type RunAppInvocation,\n type ActorProgramsApi,\n type ActorProgramsListing,\n type RunScriptTool,\n} from \"./api\";\nimport type { JsonValue } from \"./bridge\";\nimport { actorProgramSourceView, ProgramSource } from \"./ProgramSource\";\nimport { FunctionForm } from \"./FunctionForm\";\nimport { ExpandIcon } from \"./ExpandIcon\";\nimport { actorProgramsRevision } from \"./state-revision\";\nimport { actorProgramViews, currentActorListing } from \"./program-state\";\nimport { activeActorInvocations, readActorInvocation } from \"./invocations\";\nimport { ActorProgramsContext, useActorPrograms, type ActorProgramsContextValue } from \"./context\";\n\nexport { useActorPrograms, type ActorProgramsContextValue } from \"./context\";\n\nexport const RUN_TOOLS_TAB_ID = \"ragents.actor-programs.tools\";\n\nconst entryIconClass = \"flex size-[34px] items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary\";\nconst headClass = \"grid flex-none grid-cols-[auto_minmax(0,1fr)] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-[9px]\";\nconst sectionLabelClass = \"mb-2 text-[0.66rem] tracking-[0.075em] text-muted-foreground uppercase\";\nconst quickIconClass = \"grid size-[30px] flex-none place-items-center rounded-lg border border-info/25 bg-glass-app text-info\";\n\nconst ACTIVE_STATUSES = new Set([\"queued\", \"running\"]);\nconst POLL_INTERVAL = 700;\n\nconst replaceInvocation = (\n listing: ActorProgramsListing | undefined,\n invocation: RunAppInvocation,\n): ActorProgramsListing | undefined => listing && ({\n ...listing,\n apps: listing.apps.map((app) => {\n if (app.actorId !== invocation.actorId || app.revision !== invocation.revision) return app;\n const exists = app.invocations.some((entry) => entry.id === invocation.id);\n return {\n ...app,\n invocations: exists\n ? app.invocations.map((entry) => entry.id === invocation.id ? invocation : entry)\n : [...app.invocations, invocation],\n };\n }),\n});\n\nexport function ActorProgramsProvider({\n api,\n children,\n session,\n}: PropsWithChildren<{ api: ActorProgramsApi; session: SessionContext }>) {\n const runId = session.session.id;\n const canInspect = useAccess().can(\"runs.inspect\");\n const [storedListing, setListing] = useState<ActorProgramsListing>();\n const listing = useMemo(() => currentActorListing(storedListing, session.runView), [storedListing, session.runView]);\n const [error, setError] = useState<string>();\n const [fullscreen, setFullscreen] = useState<{ runId: string; appId: string }>();\n const visibleApps = actorProgramApps(session).filter((app) => app.app.visible !== false);\n const fullscreenAppId = fullscreen?.runId === runId && visibleApps.some((app) => app.id === fullscreen.appId)\n ? fullscreen.appId : undefined;\n const closeFullscreen = useCallback(() => setFullscreen(undefined), []);\n const openFullscreen = useCallback((appId: string) => {\n if (!actorProgramApps(session).some((app) => app.id === appId && app.app.visible !== false)) {\n throw new Error(\"The actor view is not available on the surface.\");\n }\n setFullscreen({ runId, appId });\n }, [runId, session]);\n useEffect(() => { if (fullscreen && !fullscreenAppId) setFullscreen(undefined); }, [fullscreen, fullscreenAppId]);\n const loadRevision = useRef(0);\n\n const refresh = useCallback(async () => {\n const revision = ++loadRevision.current;\n try {\n const next = await api.list(runId);\n if (revision !== loadRevision.current) return;\n setListing(next);\n setError(undefined);\n } catch (caught) {\n if (revision !== loadRevision.current) return;\n setError(caught instanceof Error ? caught.message : String(caught));\n }\n }, [api, runId]);\n\n const moduleRevision = useMemo(() => actorProgramsRevision(session.runView), [session.runView]);\n useEffect(() => {\n setListing(undefined);\n setError(undefined);\n return () => { loadRevision.current += 1; };\n }, [runId]);\n useEffect(() => { void refresh(); }, [moduleRevision, refresh]);\n\n const activeInvocations = useMemo(() => activeActorInvocations(listing?.apps ?? [], canInspect), [canInspect, listing]);\n const activeKey = activeInvocations.length > 0 ? JSON.stringify(activeInvocations) : \"\";\n\n useEffect(() => {\n if (!activeKey) return;\n const targets = activeInvocations;\n let disposed = false;\n let timer: number | undefined;\n let controller: AbortController | undefined;\n\n const poll = async () => {\n controller = new AbortController();\n const results = await Promise.allSettled(targets.map(async (target) => ({\n target,\n invocation: await readActorInvocation(api, runId, target, controller?.signal),\n })));\n if (disposed) return;\n const updates = results.flatMap((result) => result.status === \"fulfilled\" ? [result.value] : []);\n if (updates.length > 0) {\n setListing((current) => updates.reduce((next, update) => replaceInvocation(next, update.invocation), current));\n setError(undefined);\n }\n const failed = results.find((result): result is PromiseRejectedResult => result.status === \"rejected\");\n if (failed) setError(failed.reason instanceof Error ? failed.reason.message : String(failed.reason));\n const finished = updates.some((update) => !ACTIVE_STATUSES.has(update.invocation.status));\n if (finished) {\n await refresh();\n } else if (!disposed) {\n timer = window.setTimeout(() => void poll(), POLL_INTERVAL);\n }\n };\n\n timer = window.setTimeout(() => void poll(), 250);\n return () => {\n disposed = true;\n if (timer !== undefined) window.clearTimeout(timer);\n controller?.abort();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- activeKey encodes activeInvocations; the poll uses the captured targets\n }, [activeKey, api, refresh, runId]);\n\n const invoke = useCallback(async (\n appId: string,\n revision: string,\n actionId: string,\n requestId: string,\n input: JsonValue,\n ) => {\n loadRevision.current += 1;\n const invocation = await api.invoke(runId, appId, revision, actionId, requestId, input);\n loadRevision.current += 1;\n setListing((current) => replaceInvocation(current, invocation));\n return invocation;\n }, [api, runId]);\n\n const value = useMemo<ActorProgramsContextValue>(() => ({\n api,\n error,\n fullscreenAppId,\n invoke,\n listing,\n openFullscreen,\n closeFullscreen,\n refresh,\n runId,\n }), [api, error, fullscreenAppId, invoke, listing, openFullscreen, closeFullscreen, refresh, runId]);\n const slot = useMemo<ProgramSlot>(() => ({\n runId,\n needsAnswer: (session, appId) => {\n const app = listing?.apps.find((candidate) => candidate.id === appId);\n return app !== undefined && pendingConfirmationFor(session, app) !== undefined;\n },\n openFullscreen,\n source: (view, actorId) => actorProgramSourceView(api, view, actorId),\n }), [api, listing, openFullscreen, runId]);\n return <ActorProgramsContext.Provider value={value}>\n <ProgramSlotContext.Provider value={slot}>{children}</ProgramSlotContext.Provider>\n </ActorProgramsContext.Provider>;\n}\n\nexport const actorProgramApps = (session: SessionContext) => actorProgramViews(session.runView);\n\nexport const pendingConfirmationFor = (\n session: SessionContext,\n app: Pick<RunApp, \"invocations\">,\n): RunAction | undefined => {\n const view = runViewFrom(session.runView);\n if (!view) return undefined;\n const invocationIds = new Set(app.invocations\n .filter((invocation) => ACTIVE_STATUSES.has(invocation.status))\n .map((invocation) => invocation.id));\n return view.actions.find((action) => action.owner === ASK_PLUGIN_ID\n && action.status === \"pending\"\n && action.askedBy === view.ownerId\n && action.parameters.source === ACTOR_PROGRAMS_STATE_ID\n && invocationIds.has(action.parameters.invocationId));\n};\n\nexport function HostConfirmation({ action, session }: { action: RunAction; session: SessionContext }) {\n const access = useAccess();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string>();\n\n const answer = async (text: string) => {\n if (busy) return;\n setBusy(true);\n setError(undefined);\n try {\n await answerQuestion(session.session.id, action.id, text);\n } catch (caught) {\n setError(caught instanceof Error ? caught.message : String(caught));\n setBusy(false);\n }\n };\n\n return (\n <section aria-label=\"Host confirmation\" className=\"grid flex-none gap-2 border-b border-border-soft bg-warning-soft px-workspace-inset py-2.5\" data-slot=\"host-confirmation\">\n <header className=\"grid gap-0.5\">\n <strong className=\"text-[0.72rem] text-foreground\">Confirmation in the host</strong>\n <span className=\"text-xs text-muted-foreground\">The app cannot answer this decision itself.</span>\n </header>\n {busy\n ? <p className=\"text-xs text-muted-foreground\">Processing answer</p>\n : (\n <QuestionCard\n onAnswer={access.can(\"runs.write\") ? (text: string) => void answer(text) : undefined}\n question={askPayloadOf(action.payload) ?? { question: action.title, options: [], multi: false }}\n text={action.title}\n />\n )}\n {error && <p className=\"text-xs text-destructive\" role=\"alert\">{error}</p>}\n </section>\n );\n}\n\nconst targetLabel = (target: RunScriptTool[\"targets\"][number]): string =>\n target.handle ? `@${target.handle}` : target.actorId;\n\nexport function ToolsPanel({ active, navigation, selection, session }: WorkspaceTabContext) {\n const { api, error, listing, refresh, runId } = useActorPrograms();\n const selectedName = typeof selection === \"string\" ? selection : undefined;\n const selected = listing?.tools.find((tool) => tool.name === selectedName);\n\n if (!listing && !error) {\n return (\n <div className=\"flex h-full items-center justify-center gap-2.5 text-sm text-muted-foreground\">\n <Spinner aria-hidden aria-label={undefined} role={undefined} />\n <span>Loading functions</span>\n </div>\n );\n }\n if (!listing) {\n return (\n <Empty>\n <EmptyHeader>\n <EmptyMedia><IconTools /></EmptyMedia>\n <EmptyTitle>Functions could not be loaded</EmptyTitle>\n <EmptyDescription>{error}</EmptyDescription>\n </EmptyHeader>\n <EmptyContent>\n <Button onClick={() => void refresh()} variant=\"outline\">Retry</Button>\n </EmptyContent>\n </Empty>\n );\n }\n if (selectedName && !selected) {\n return (\n <Empty>\n <EmptyHeader>\n <EmptyMedia><IconTools /></EmptyMedia>\n <EmptyTitle>Function no longer available</EmptyTitle>\n <EmptyDescription>The selected actor function is no longer installed in this run.</EmptyDescription>\n </EmptyHeader>\n <EmptyContent>\n <Button onClick={() => navigation.openTab(RUN_TOOLS_TAB_ID, null)} variant=\"outline\">\n To overview\n </Button>\n </EmptyContent>\n </Empty>\n );\n }\n if (selected) {\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n <header className={headClass}>\n <Button aria-label=\"Back to function overview\" onClick={() => navigation.openTab(RUN_TOOLS_TAB_ID, null)} size=\"icon-sm\" title=\"Back to function overview\" variant=\"outline\">\n <ArrowLeftIcon />\n </Button>\n <span className=\"grid min-w-0 gap-px\">\n <strong className=\"truncate text-[0.82rem] font-semibold\" title={selected.name}>{selected.name}</strong>\n <small className=\"truncate text-xs text-muted-foreground\">Function of @{selected.actorHandle}</small>\n </span>\n </header>\n <div className=\"flex min-h-0 flex-col gap-[22px] overflow-y-auto px-workspace-inset pt-[18px] pb-7\">\n <div className=\"grid grid-cols-[42px_minmax(0,1fr)] items-start gap-3\">\n <span className={cn(entryIconClass, \"size-[42px] bg-accent\")}><IconTools size={22} /></span>\n <div>\n <h2 className=\"text-[1.05rem] text-foreground\">{selected.name}</h2>\n <p className=\"mt-1 text-[0.74rem] leading-[1.45] text-muted-foreground\">{selected.description}</p>\n </div>\n </div>\n <section>\n <h3 className={sectionLabelClass}>Available to</h3>\n <div className=\"flex flex-wrap gap-1.5\">\n {selected.targets.map((target) => <span className=\"rounded-full bg-primary/9 px-2 py-1 text-xs text-foreground\" key={target.actorId}>{targetLabel(target)}</span>)}\n </div>\n </section>\n <section>\n <h3 className={sectionLabelClass}>Parameter</h3>\n {active && <FunctionForm detail key={`${runId}:${selected.actorId}:${selected.functionId}:${selected.revision}`} session={session} tool={selected} />}\n </section>\n <ProgramSource api={api} moduleId={selected.moduleId} revision={selected.revision} runId={runId} />\n <dl className=\"grid grid-cols-2 gap-2\">\n {[{ label: \"Program\", value: selected.moduleId, title: undefined },\n { label: \"Source hash\", value: selected.sourceHash.slice(0, 12), title: selected.sourceHash }].map((fact) => (\n <div className=\"grid gap-[3px] rounded-lg bg-foreground/4 px-2.5 py-2\" key={fact.label}>\n <dt className=\"text-[0.61rem] text-muted-foreground uppercase\">{fact.label}</dt>\n <dd className=\"truncate font-mono text-xs text-foreground\" title={fact.title}>{fact.value}</dd>\n </div>\n ))}\n </dl>\n </div>\n </div>\n );\n }\n if (listing.tools.length === 0) {\n return (\n <Empty>\n <EmptyHeader>\n <EmptyMedia><IconTools /></EmptyMedia>\n <EmptyTitle>No functions yet</EmptyTitle>\n <EmptyDescription>Actor functions created by agents in this run appear here.</EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n }\n\n return (\n <div className=\"@container flex h-full min-h-0 flex-col gap-2 overflow-y-auto px-workspace-inset pt-3 pb-5 [scrollbar-width:thin]\">\n {error && <Alert className=\"mb-1\" role=\"status\" variant=\"destructive\">{error}</Alert>}\n {listing.tools.map((tool) => (\n <button\n className=\"grid w-full cursor-pointer grid-cols-[34px_minmax(0,1fr)_auto_14px] items-center gap-2.5 rounded-lg border border-border bg-card px-[11px] py-2.5 text-left text-foreground transition-[background-color,border-color] hover:border-[color-mix(in_srgb,var(--primary)_52%,var(--border))] hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))] focus-visible:border-[color-mix(in_srgb,var(--primary)_52%,var(--border))] focus-visible:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/52 @max-[470px]:grid-cols-[34px_minmax(0,1fr)_14px]\"\n key={tool.name}\n onClick={() => navigation.openTab(RUN_TOOLS_TAB_ID, tool.name)}\n type=\"button\"\n >\n <span className={entryIconClass}><IconTools size={20} /></span>\n <span className=\"grid min-w-0 gap-0.5\">\n <strong className=\"truncate text-[0.8rem] font-semibold\">{tool.name}</strong>\n <small className=\"truncate text-[0.69rem] text-muted-foreground\">{tool.description}</small>\n </span>\n <Badge className=\"max-w-[132px] truncate @max-[470px]:hidden\" variant=\"secondary\">\n {tool.targets.length} {tool.targets.length === 1 ? \"agent\" : \"agents\"}\n </Badge>\n <IconOpen />\n </button>\n ))}\n </div>\n );\n}\n\n/** A click on a mini-app selects its tile on the surface; the surface is the surface controller of the orchestration plugin. */\nexport function ActorProgramsHeader({ session }: SessionHeaderContext) {\n const canArrange = useAccess().can(\"runs.inspect\");\n const surface = useSurfaceController();\n const stage = useSurfaceEntities(session.session.id);\n const { closeFullscreen, fullscreenAppId, openFullscreen } = useActorPrograms();\n const apps = actorProgramApps(session).filter((app) => app.app.visible !== false);\n if (apps.length === 0) return null;\n\n return (\n <nav aria-label=\"Actor views\" className=\"flex min-w-0 flex-none items-stretch\">\n {apps.map((app) => (\n <div role=\"group\" aria-label={app.title} key={`app:${app.id}`}\n className={cn(\"relative flex flex-none items-stretch border-r border-border hover:bg-accent focus-within:bg-accent\",\n fullscreenAppId === app.id && \"bg-primary/12 after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-[3px] after:bg-primary after:content-['']\")}>\n <ToolbarItem\n as=\"button\"\n className=\"max-w-[214px] border-r-0 font-bold hover:not-disabled:bg-transparent\"\n draggable={canArrange}\n onDragStart={(event) => {\n if (!canArrange) { event.preventDefault(); return; }\n event.dataTransfer.setData(SURFACE_TILE_DRAG_TYPE, `app:${app.id}`);\n event.dataTransfer.effectAllowed = \"move\";\n closeFullscreen();\n }}\n onClick={() => {\n if (!surface) throw new Error(\"The app entries need the surface controller of the orchestration plugin.\");\n closeFullscreen();\n surface.acceptSelection({ type: \"run-app\", id: app.id });\n }}\n aria-label={`Mini-app: ${app.title} of @${app.actorHandle}`}\n title={`Mini-app: ${app.title} of @${app.actorHandle}${canArrange ? \". Drag onto a tile to dock.\" : \"\"}`}\n type=\"button\"\n >\n <span className={cn(quickIconClass, !stage.has(`app:${app.id}`) && \"bg-transparent\")}><LayoutGridIcon size={20} /></span>\n <ToolbarCopy><ToolbarLabel>@{app.actorHandle}</ToolbarLabel><ToolbarText>{app.title}</ToolbarText></ToolbarCopy>\n </ToolbarItem>\n <ToolbarItem as=\"button\" aria-expanded={fullscreenAppId === app.id} aria-label={`${app.title} ${fullscreenAppId === app.id ? \"close full view\" : \"open in full view\"}`}\n title={`${app.title} ${fullscreenAppId === app.id ? \"close full view\" : \"open in full view\"}`}\n className=\"relative w-[38px] justify-center border-r-0 p-0 hover:not-disabled:bg-transparent before:pointer-events-none before:absolute before:top-1/4 before:bottom-1/4 before:left-0 before:border-l before:border-dashed before:border-border-strong before:content-['']\"\n onClick={() => fullscreenAppId === app.id ? closeFullscreen() : openFullscreen(app.id)} type=\"button\">\n <ExpandIcon />\n </ToolbarItem>\n </div>\n ))}\n </nav>\n );\n}\n\nexport function ToolsBadge() {\n const { listing } = useActorPrograms();\n return listing && listing.tools.length > 0\n ? <Badge variant=\"secondary\">{listing.tools.length}</Badge>\n : null;\n}\n\nfunction IconTools({ size = 28 }: { size?: number }) {\n return (\n <svg aria-hidden fill=\"none\" height={size} stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.6\" viewBox=\"0 0 24 24\" width={size}>\n <path d=\"M14.5 6.5 17.5 3.5l3 3-3 3\" />\n <path d=\"m9.5 17.5-3 3-3-3 3-3\" />\n <path d=\"M13 5H9a4 4 0 0 0-4 4v5.5M11 19h4a4 4 0 0 0 4-4V9.5\" />\n </svg>\n );\n}\n\nfunction IconOpen() {\n return (\n <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.8\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runActorFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-view\", \"runViewFrom\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/SourceCode\", \"SourceCode\");\n", "import { ACTOR_PROGRAMS_STATE_ID, ACTOR_STATE_ID } from \"@ragents/host/plugin-support/actor-programs/contract\";\nimport { isRecord } from \"@ragents/web/lib/guards\";\nimport { runViewFrom } from \"@ragents/web/run-view\";\nimport type { ActorProgramsListing } from \"./api\";\nimport { isJsonValue } from \"./bridge\";\n\nexport interface ActorProgramView {\n id: string;\n title: string;\n actorId: string;\n actorHandle: string;\n revision: string;\n app: Record<string, unknown>;\n}\n\nexport const actorProgramSourceReference = (runView: unknown, actorId: string): { name: string; revision: string } | undefined => {\n const view = runViewFrom(runView);\n const entry = view?.pluginStates.find((entry) => entry.pluginId === ACTOR_PROGRAMS_STATE_ID\n && entry.scope.kind === \"actor\" && entry.scope.actorId === actorId);\n if (!entry || !isRecord(entry.state) || entry.state.program === null) return undefined;\n const program = entry.state.program;\n if (!isRecord(program) || program.actorId !== actorId || typeof program.name !== \"string\" || typeof program.revision !== \"string\") {\n throw new Error(\"The source code mapping of the actor program is invalid.\");\n }\n return { name: program.name, revision: program.revision };\n};\n\nexport const actorProgramViews = (runView: unknown): ActorProgramView[] => {\n const view = runViewFrom(runView);\n if (!view) return [];\n return view.pluginStates.flatMap((entry): ActorProgramView[] => {\n if (entry.pluginId !== ACTOR_PROGRAMS_STATE_ID || entry.scope.kind !== \"actor\") return [];\n const actorId = entry.scope.actorId;\n const actor = view.actors.find((actor) => actor.id === actorId);\n if (!actor || actor.kind === \"human\" || actor.lifecycle?.kind === \"stopped\") return [];\n if (!isRecord(entry.state) || !isRecord(entry.state.program)) return [];\n const program = entry.state.program;\n if (program.actorId !== actor.id || program.actorHandle !== actor.handle || typeof program.revision !== \"string\" || !Array.isArray(program.views)) {\n throw new Error(`The view program of @${actor.handle} is invalid.`);\n }\n return program.views.map((app) => {\n if (!isRecord(app) || typeof app.id !== \"string\" || typeof app.title !== \"string\") throw new Error(`A view of @${actor.handle} is invalid.`);\n return { id: app.id, title: app.title, actorId: actor.id, actorHandle: actor.handle, revision: program.revision as string, app };\n });\n });\n};\n\nexport const currentActorListing = (listing: ActorProgramsListing | undefined, runView: unknown): ActorProgramsListing | undefined => {\n const view = runViewFrom(runView);\n if (!listing || !view) return undefined;\n const currentViews = new Map(actorProgramViews(view).map((entry) => [entry.id, entry]));\n const activeActors = new Set(view.actors.filter((actor) => actor.kind !== \"human\" && actor.lifecycle?.kind !== \"stopped\").map((actor) => actor.id));\n return {\n ...listing,\n apps: listing.apps.flatMap((app) => {\n const current = currentViews.get(app.id);\n if (!current || current.actorId !== app.actorId || current.revision !== app.revision) return [];\n const state = view.pluginStates.find((entry) => entry.pluginId === ACTOR_STATE_ID && entry.scope.kind === \"actor\" && entry.scope.actorId === app.actorId);\n const values = state ? state.state : app.state.values;\n if (!isJsonValue(values)) throw new Error(`The state of @${app.actorHandle} is not a JSON value.`);\n return [{ ...app, visible: current.app.visible !== false,\n state: { ...app.state, values } }];\n }),\n tools: listing.tools.filter((tool) => activeActors.has(tool.actorId) && view.pluginStates.some((entry) =>\n entry.pluginId === ACTOR_PROGRAMS_STATE_ID && entry.scope.kind === \"actor\" && entry.scope.actorId === tool.actorId\n && isRecord(entry.state) && isRecord(entry.state.program) && entry.state.program.revision === tool.revision)),\n };\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, useState, type ReactNode } from \"react\";\nimport { SourceCode } from \"@ragents/web/SourceCode\";\nimport { Alert, Button, cn, Spinner } from \"@ragents/web/ui\";\nimport type { RunView } from \"@ragents/web/run-view\";\nimport type { ActorProgramSourceFile, ActorProgramsApi } from \"./api\";\nimport { actorProgramSourceReference } from \"./program-state\";\n\ntype SourceState =\n | { kind: \"loading\" }\n | { kind: \"ready\"; files: ActorProgramSourceFile[] }\n | { kind: \"error\"; message: string };\n\nexport function ProgramSource({ api, moduleId, runId, revision, expandedByDefault = false }: {\n api: ActorProgramsApi;\n moduleId: string;\n runId: string;\n revision?: string;\n expandedByDefault?: boolean;\n}) {\n const [expanded, setExpanded] = useState(expandedByDefault);\n const [state, setState] = useState<SourceState>({ kind: \"loading\" });\n const [activePath, setActivePath] = useState<string>();\n\n useEffect(() => {\n if (!expanded) return undefined;\n const controller = new AbortController();\n setState({ kind: \"loading\" });\n api.source(runId, moduleId, controller.signal).then(\n (files) => {\n if (controller.signal.aborted) return;\n setState({ kind: \"ready\", files });\n setActivePath(files.find((file) => file.path === \"src/server.ts\")?.path ?? files.find((file) => /\\.tsx?$/.test(file.path))?.path ?? files[0]?.path);\n },\n (caught: unknown) => {\n if (controller.signal.aborted) return;\n setState({ kind: \"error\", message: caught instanceof Error ? caught.message : String(caught) });\n },\n );\n return () => controller.abort();\n }, [api, expanded, moduleId, runId, revision]);\n\n const active = state.kind === \"ready\"\n ? state.files.find((file) => file.path === activePath) ?? state.files[0]\n : undefined;\n\n return (\n <section className=\"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] justify-items-start gap-2\">\n <h3 className=\"text-xs font-semibold text-muted-foreground\">Source code</h3>\n {!expanded && (\n <Button onClick={() => setExpanded(true)} size=\"sm\" variant=\"outline\">Show source code</Button>\n )}\n {expanded && (\n <>\n <p className=\"text-[0.67rem] text-muted-foreground\">Source of the installed build</p>\n {state.kind === \"loading\" && (\n <p className=\"flex items-center gap-2 text-[0.72rem] text-muted-foreground\">\n <Spinner aria-hidden aria-label={undefined} role={undefined} />\n <span>Loading source code</span>\n </p>\n )}\n {state.kind === \"error\" && <Alert className=\"w-full\" variant=\"destructive\">{state.message}</Alert>}\n {state.kind === \"ready\" && (\n <div className=\"flex flex-wrap gap-1.5\">\n {state.files.map((file) => (\n <button\n className={cn(\"max-w-full cursor-pointer rounded-lg border border-border-soft bg-background/70 px-[9px] py-1 text-left font-mono text-[0.66rem] text-muted-foreground [overflow-wrap:anywhere]\",\n file.path === active?.path && \"border-[color-mix(in_srgb,var(--primary)_48%,var(--border))] bg-primary/9 text-foreground\")}\n key={file.path}\n onClick={() => setActivePath(file.path)}\n type=\"button\"\n >\n {file.path}\n </button>\n ))}\n </div>\n )}\n {active && <SourceCode className=\"h-full max-h-[340px] w-full min-h-0 min-w-0 overflow-auto rounded-lg border border-border-soft bg-background/70\" content={active.content} path={active.path} />}\n {!expandedByDefault && <Button onClick={() => setExpanded(false)} size=\"sm\" variant=\"outline\">Hide source code</Button>}\n </>\n )}\n </section>\n );\n}\n\n/** The installed source of the actor's program, or nothing if the actor runs none. */\nexport const actorProgramSourceView = (api: ActorProgramsApi, view: RunView, actorId: string): ReactNode => {\n const program = actorProgramSourceReference(view, actorId);\n return program && <ProgramSource api={api} expandedByDefault key={`${view.id}:${actorId}:${program.revision}`}\n moduleId={program.name} revision={program.revision} runId={view.id} />;\n};\n", "import type { RunAppInvocation, ActorProgramsApi, RunScriptTool } from \"./api\";\nimport type { JsonValue } from \"./bridge\";\n\nconst waitForPoll = (signal: AbortSignal): Promise<void> => new Promise((resolve, reject) => {\n signal.throwIfAborted();\n const finish = (): void => { signal.removeEventListener(\"abort\", abort); resolve(); };\n const timer = setTimeout(finish, 350);\n const abort = (): void => { clearTimeout(timer); reject(signal.reason); };\n signal.addEventListener(\"abort\", abort, { once: true });\n});\n\nexport const invokeActorFunction = async (\n api: ActorProgramsApi,\n runId: string,\n tool: Pick<RunScriptTool, \"actorHandle\" | \"functionId\" | \"revision\">,\n input: JsonValue,\n signal: AbortSignal,\n changed: (invocation: RunAppInvocation) => void,\n): Promise<RunAppInvocation> => {\n let invocation = await api.invokeFunction(runId, tool.actorHandle, tool.revision, tool.functionId, crypto.randomUUID().replaceAll(\"-\", \"\"), input, signal);\n changed(invocation);\n while (invocation.status === \"queued\" || invocation.status === \"running\") {\n await waitForPoll(signal);\n invocation = await api.functionInvocation(runId, tool.actorHandle, invocation.id, signal);\n changed(invocation);\n }\n return invocation;\n};\n", "import type { RunToolParameter } from \"./api\";\nimport { isJsonValue, type JsonValue } from \"./bridge\";\n\nconst parseParameter = (parameter: RunToolParameter, form: FormData): JsonValue | undefined => {\n const raw = String(form.get(parameter.name) ?? \"\");\n if (parameter.type === \"boolean\") {\n if (parameter.required) return form.has(parameter.name);\n return raw === \"\" ? undefined : raw === \"true\";\n }\n if (raw === \"\" && !parameter.required) return undefined;\n if (parameter.type === \"string\") return raw;\n if (!raw.trim()) throw new Error(`${parameter.name}: Please enter a value.`);\n if (parameter.type === \"number\" || parameter.type === \"integer\") {\n const value = Number(raw);\n if (!Number.isFinite(value) || parameter.type === \"integer\" && !Number.isInteger(value)) {\n throw new Error(`${parameter.name} is not a valid ${parameter.type === \"integer\" ? \"integer\" : \"number\"}.`);\n }\n return value;\n }\n if (parameter.type === \"string[]\" && !raw.trimStart().startsWith(\"[\")) {\n return raw.split(/\\r?\\n|,/).map((entry) => entry.trim()).filter(Boolean);\n }\n let value: unknown;\n try { value = JSON.parse(raw); }\n catch { throw new Error(`${parameter.name}: Please enter valid JSON.`); }\n if (!isJsonValue(value)) throw new Error(`${parameter.name}: Not a valid JSON value.`);\n if (parameter.type === \"string[]\" && (!Array.isArray(value) || !value.every((entry) => typeof entry === \"string\"))) {\n throw new Error(`${parameter.name}: Please enter a list of texts.`);\n }\n if (parameter.type === \"number[]\" && (!Array.isArray(value) || !value.every((entry) => typeof entry === \"number\"))) {\n throw new Error(`${parameter.name}: Please enter a JSON list of numbers.`);\n }\n return value;\n};\n\nexport const actorFunctionInput = (parameters: readonly RunToolParameter[], form: FormData): Record<string, JsonValue> =>\n Object.fromEntries(parameters.flatMap((parameter) => {\n const value = parseParameter(parameter, form);\n return value === undefined ? [] : [[parameter.name, value]];\n }));\n", "import { useEffect, useRef, useState, type FormEvent } from \"react\";\nimport { useAccess } from \"@ragents/web/AccessContext\";\nimport { Button, cn, Input, Textarea } from \"@ragents/web/ui\";\nimport type { SessionContext } from \"@ragents/web/PluginRegistry\";\nimport type { RunAppInvocation, RunScriptTool } from \"./api\";\nimport { HostConfirmation, pendingConfirmationFor, useActorPrograms } from \"./AppsPanel\";\nimport { invokeActorFunction } from \"./function-call\";\nimport { actorFunctionInput } from \"./function-input\";\n\nconst selectClass = \"h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base font-normal md:text-sm\";\n\nexport function FunctionForm({ session, tool, detail = false }: {\n session: SessionContext;\n tool: RunScriptTool;\n detail?: boolean;\n}) {\n const writable = useAccess().can(\"runs.write\");\n const { api, refresh, runId } = useActorPrograms();\n const [error, setError] = useState<string>();\n const [busy, setBusy] = useState(false);\n const [invocation, setInvocation] = useState<RunAppInvocation>();\n const controllerRef = useRef<AbortController | undefined>(undefined);\n useEffect(() => () => controllerRef.current?.abort(), []);\n const confirmation = invocation ? pendingConfirmationFor(session, { invocations: [invocation] }) : undefined;\n\n const submit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (controllerRef.current || !writable) return;\n const controller = new AbortController();\n controllerRef.current = controller;\n setError(undefined);\n setInvocation(undefined);\n try {\n const input = actorFunctionInput(tool.parameters, new FormData(event.currentTarget));\n setBusy(true);\n await invokeActorFunction(api, runId, tool, input, controller.signal, (current) => {\n if (!controller.signal.aborted) setInvocation(current);\n });\n if (!controller.signal.aborted) await refresh();\n } catch (caught) {\n if (!controller.signal.aborted) setError(caught instanceof Error ? caught.message : String(caught));\n } finally {\n if (!controller.signal.aborted) setBusy(false);\n if (controllerRef.current === controller) controllerRef.current = undefined;\n }\n };\n\n const status = confirmation ? \"Confirmation required\"\n : invocation?.status === \"queued\" ? \"Waiting for execution\"\n : invocation?.status === \"running\" ? \"Function running\"\n : invocation?.status === \"succeeded\" ? \"Executed\"\n : invocation?.status === \"cancelled\" ? \"Cancelled\"\n : invocation?.status === \"failed\" ? \"Failed\"\n : busy ? \"Sending call\" : undefined;\n const failure = error ?? (invocation?.status === \"failed\" || invocation?.status === \"cancelled\" ? invocation.error : undefined);\n\n return (\n <div className=\"grid min-w-0 gap-2.5\">\n <form aria-label={`Call ${tool.name}`} className={cn(\"grid\", detail ? \"gap-3.5\" : \"gap-2\")} onSubmit={(event) => void submit(event)}>\n {tool.parameters.length === 0 && detail && <p>This function needs no parameters.</p>}\n {tool.parameters.map((parameter) => (\n <label className={cn(\"grid gap-[3px] font-[650] text-foreground [&_small]:text-[0.61rem] [&_small]:font-normal [&_small]:text-muted-foreground\",\n detail ? \"text-[0.8rem]\" : \"text-[0.68rem]\",\n parameter.type === \"boolean\" && parameter.required && \"grid-cols-[auto_minmax(0,1fr)] items-center gap-x-1.5 [&_small]:col-start-2\")} key={parameter.name}>\n {parameter.type === \"boolean\" && parameter.required && <input aria-description={parameter.description} className=\"m-0 accent-primary\" disabled={!writable || busy} name={parameter.name} type=\"checkbox\" />}\n <span>{parameter.name}{parameter.required ? \" *\" : \"\"}{detail && <small className=\"ml-2\">{parameter.type}{parameter.required ? \"\" : \" (optional)\"}</small>}</span>\n {parameter.type === \"boolean\"\n ? !parameter.required && <select className={selectClass} disabled={!writable || busy} name={parameter.name} defaultValue=\"\"><option value=\"\">Not passed</option><option value=\"true\">Yes</option><option value=\"false\">No</option></select>\n : parameter.type === \"json\" || parameter.type === \"string[]\" || parameter.type === \"number[]\" || detail && parameter.type === \"string\"\n ? <Textarea aria-description={parameter.description} className=\"min-h-8 resize-y font-normal\" disabled={!writable || busy} name={parameter.name} placeholder={parameter.description} required={parameter.required} rows={2} />\n : <Input\n aria-description={parameter.description}\n className=\"font-normal\"\n disabled={!writable || busy}\n name={parameter.name}\n placeholder={parameter.description}\n required={parameter.required}\n step={parameter.type === \"integer\" ? \"1\" : parameter.type === \"number\" ? \"any\" : undefined}\n type={parameter.type === \"integer\" || parameter.type === \"number\" ? \"number\" : \"text\"}\n />}\n {(detail || parameter.type === \"boolean\") && <small>{parameter.description}</small>}\n {parameter.type === \"json\" && <small>Enter as JSON.</small>}\n {parameter.type === \"number[]\" && <small>Enter as a JSON list, e.g. [1, 2, 3].</small>}\n {parameter.type === \"string[]\" && <small>One entry per line or as a JSON list.</small>}\n </label>\n ))}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button disabled={!writable || busy} type=\"submit\">{busy ? \"Running ...\" : \"Run\"}</Button>\n {status && <span className=\"text-[0.63rem] text-muted-foreground\" role=\"status\">{status}</span>}\n </div>\n </form>\n {confirmation && <HostConfirmation action={confirmation} key={confirmation.id} session={session} />}\n {failure && <p className=\"text-destructive [overflow-wrap:anywhere]\" role=\"alert\">{failure}</p>}\n {invocation?.status === \"succeeded\" && !error && (\n <section aria-label=\"Result\" className=\"grid min-w-0 gap-2\">\n <h3>Result</h3>\n <pre className=\"max-h-[320px] overflow-auto rounded-md border border-border-soft bg-card p-2.5 text-[0.75rem] whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]\">{typeof invocation.result === \"string\" ? invocation.result : JSON.stringify(invocation.result, null, 2)}</pre>\n </section>\n )}\n </div>\n );\n}\n", "export function ExpandIcon() {\n return <svg aria-hidden fill=\"none\" height=\"14\" stroke=\"currentColor\" strokeWidth=\"1.7\" viewBox=\"0 0 24 24\" width=\"14\">\n <path d=\"M9 3H3v6M15 3h6v6M3 15v6h6M21 15v6h-6\" />\n </svg>;\n}\n", "import { ACTOR_PROGRAMS_STATE_ID, ACTOR_INVOCATIONS_STATE_ID, ACTOR_STATE_ID } from \"@ragents/host/plugin-support/actor-programs/contract\";\nimport { runViewFrom } from \"@ragents/web/run-view\";\n\nexport const actorProgramsRevision = (runView: unknown): string => {\n const view = runViewFrom(runView);\n const programActors = new Set(view?.pluginStates.filter((entry) => entry.pluginId === ACTOR_PROGRAMS_STATE_ID && entry.scope.kind === \"actor\")\n .map((entry) => entry.scope.kind === \"actor\" ? entry.scope.actorId : \"\") ?? []);\n return JSON.stringify({\n actors: view?.actors.filter((actor) => programActors.has(actor.id)).map((actor) => [actor.id, actor.handle, actor.lifecycle?.kind === \"stopped\"]).sort(([left], [right]) => String(left).localeCompare(String(right))) ?? [],\n states: (view?.pluginStates ?? [])\n .filter((entry) => entry.pluginId === ACTOR_PROGRAMS_STATE_ID || entry.pluginId === ACTOR_INVOCATIONS_STATE_ID\n || entry.pluginId === ACTOR_STATE_ID && entry.scope.kind === \"actor\" && programActors.has(entry.scope.actorId))\n .map((entry) => [`${entry.pluginId}:${entry.scope.kind === \"actor\" ? entry.scope.actorId : \"run\"}`, entry.state])\n .sort(([left], [right]) => String(left).localeCompare(String(right))),\n });\n};\n", "import type { ActorProgramsApi, RunApp, RunAppInvocation } from \"./api\";\n\ntype InvocationTarget = { invocationId: string } & (\n | { kind: \"app\"; appId: string }\n | { kind: \"function\"; actorHandle: string }\n);\n\nexport const activeActorInvocations = (apps: readonly RunApp[], includeFunctions = true): InvocationTarget[] => {\n const appIds = new Set(apps.map((app) => app.id));\n const active = new Map<string, InvocationTarget>();\n for (const app of apps) for (const invocation of app.invocations) {\n if (invocation.status === \"queued\" || invocation.status === \"running\") {\n if (!includeFunctions && !appIds.has(invocation.appId)) continue;\n active.set(`${invocation.actorId}/${invocation.id}`, appIds.has(invocation.appId)\n ? { kind: \"app\", appId: invocation.appId, invocationId: invocation.id }\n : { kind: \"function\", actorHandle: invocation.actorHandle, invocationId: invocation.id });\n }\n }\n return [...active.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([, target]) => target);\n};\n\nexport const readActorInvocation = (\n api: ActorProgramsApi,\n runId: string,\n target: InvocationTarget,\n signal?: AbortSignal,\n): Promise<RunAppInvocation> => target.kind === \"app\"\n ? api.invocation(runId, target.appId, target.invocationId, signal)\n : api.functionInvocation(runId, target.actorHandle, target.invocationId, signal);\n\nexport const invocationTime = (invocation: RunAppInvocation): number => {\n const raw = invocation.status === \"queued\"\n ? invocation.createdAt\n : invocation.status === \"running\"\n ? invocation.startedAt\n : invocation.finishedAt;\n const parsed = Date.parse(raw);\n return Number.isNaN(parsed) ? 0 : parsed;\n};\n\nexport const latestInvocation = (app: RunApp): RunAppInvocation | undefined =>\n app.invocations.reduce<RunAppInvocation | undefined>((latest, invocation) =>\n !latest || invocationTime(invocation) >= invocationTime(latest) ? invocation : latest, undefined);\n", "import { createContext, useContext } from \"react\";\nimport type { ActorProgramsApi, ActorProgramsListing, RunAppInvocation } from \"./api\";\nimport type { JsonValue } from \"./bridge\";\n\nexport interface ActorProgramsContextValue {\n api: ActorProgramsApi;\n error: string | undefined;\n fullscreenAppId: string | undefined;\n listing: ActorProgramsListing | undefined;\n openFullscreen: (appId: string) => void;\n closeFullscreen: () => void;\n refresh: () => Promise<void>;\n invoke: (\n appId: string,\n revision: string,\n actionId: string,\n requestId: string,\n input: JsonValue,\n ) => Promise<RunAppInvocation>;\n runId: string;\n}\n\nexport const ActorProgramsContext = createContext<ActorProgramsContextValue | undefined>(undefined);\nexport const useOptionalActorPrograms = () => useContext(ActorProgramsContext);\n\nexport const useActorPrograms = (): ActorProgramsContextValue => {\n const value = useOptionalActorPrograms();\n if (!value) throw new Error(\"The actor program provider is not active\");\n return value;\n};\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-panel/input-bridge\", \"hostInputEnabled\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-panel/input-bridge\", \"isRunPanelKeyboardMessage\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/run-panel/input-bridge\", \"relayFrameInput\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/theme\", \"useResolvedTheme\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/api\", \"sendActorMessage\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/engine/src/http/contracts\", \"actorByHandle\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/actor-conversation\", \"actorChatMessages\");\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat/chat-target\", \"programChatNotice\");\n", "import { actorByHandle } from \"@ragents/engine/src/http/contracts\";\nimport type { SessionContext } from \"@ragents/web/PluginRegistry\";\nimport type { ChatSnapshot } from \"@ragents/web/actor-programs/client-ui/contracts\";\nimport { actorChatMessages } from \"@ragents/web/actor-conversation\";\nimport { runViewFrom } from \"@ragents/web/run-view\";\nimport { programChatNotice } from \"@ragents/web/chat/chat-target\";\n\nexport const resolveChatActor = (session: SessionContext, target: string) => {\n const view = runViewFrom(session.runView);\n if (!view || view.id !== session.session.id) throw new Error(\"The run view for this chat is not available yet\");\n const actor = target === \"primary\"\n ? view.actors.find((entry) => entry.id === view.primaryActorId)\n : actorByHandle(view.actors, target);\n if (!actor || actor.kind === \"human\") {\n const names = view.actors.filter((entry) => entry.kind !== \"human\").map((entry) => `@${entry.handle}`).join(\", \");\n throw new Error(`The chat target is not available. Allowed are primary and: ${names || \"no actors yet\"}`);\n }\n return { view, actor };\n};\n\nexport const chatSnapshotOf = (session: SessionContext, target: string): ChatSnapshot => {\n try {\n const { view, actor } = resolveChatActor(session, target);\n const primary = actor.id === view.primaryActorId;\n const error = actor.kind === \"script\" ? programChatNotice : session.conversationError ?? (!session.connected\n ? \"The connection to the run is interrupted\"\n : actor.lifecycle?.kind === \"stopped\" ? `@${actor.handle} stopped: ${actor.lifecycle.reason}. It accepts no input until it is restarted` : undefined);\n return {\n owner: actor.id,\n messages: actorChatMessages(view, actor, session.messages, session.actorConversations?.[actor.id]),\n running: primary ? session.running : actor.lifecycle?.kind === \"running\",\n ...(actor.kind === \"script\" ? { readOnly: true } : {}),\n ...(error ? { error } : {}),\n };\n } catch (error) {\n return { messages: [], running: false, error: error instanceof Error ? error.message : String(error) };\n }\n};\n", "import { read } from \"ragents-host-read:read\";\nexport default read(\"@ragents/web/chat/useAttachmentCapabilities\", \"getAttachmentCapabilities\");\n", "import { hostInputEnabled, isRunPanelKeyboardMessage, relayFrameInput } from \"@ragents/web/run-panel/input-bridge\";\nimport { useAccess } from \"@ragents/web/AccessContext\";\nimport { cn } from \"@ragents/web/ui\";\nimport { useResolvedTheme } from \"@ragents/web/theme\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { RunApp, RunAppInvocation, ActorProgramsApi } from \"./api\";\nimport { latestInvocation } from \"./invocations\";\nimport type { SessionContext } from \"@ragents/web/PluginRegistry\";\nimport { sendActorMessage } from \"@ragents/web/api\";\nimport { chatSnapshotOf, resolveChatActor } from \"./chat-state\";\nimport { getAttachmentCapabilities } from \"@ragents/web/chat/useAttachmentCapabilities\";\nimport type { ChatSnapshot } from \"@ragents/web/actor-programs/client-ui/contracts\";\nimport {\n RUN_APP_BRIDGE_VERSION,\n RUN_APP_CHAT_ACK,\n RUN_APP_CHAT_SEND,\n RUN_APP_CHAT_STATE,\n RUN_APP_CHAT_UNWATCH,\n RUN_APP_CHAT_WATCH,\n RUN_APP_CONNECTED,\n RUN_APP_ERROR,\n RUN_APP_FRAME_READY,\n RUN_APP_GET_STATE,\n RUN_APP_INVOCATION,\n RUN_APP_READY,\n RUN_APP_STATE,\n RUN_APP_THEME,\n validateRunAppBridgeRequest,\n type JsonValue,\n type RunAppInvokeRequest,\n} from \"./bridge\";\n\ninterface ActorViewFrameProps {\n api: ActorProgramsApi;\n app: RunApp;\n invoke: (\n appId: string,\n revision: string,\n actionId: string,\n requestId: string,\n input: JsonValue,\n ) => Promise<RunAppInvocation>;\n pendingConfirmationInvocationId?: string;\n presentation: \"embedded\" | \"fullscreen\" | \"tiled\";\n runId: string;\n session: SessionContext;\n}\n\nconst ACTIVE_STATUSES = new Set([\"queued\", \"running\"]);\nconst REQUEST_ID_HISTORY_LIMIT = 512;\n\nconst invocationSignature = (invocation: RunAppInvocation): string => JSON.stringify(invocation);\n\nconst markTones: Record<string, string> = {\n success: \"bg-success\",\n running: \"bg-primary shadow-[0_0_0_4px_color-mix(in_srgb,var(--primary)_12%,transparent)] animate-fade-pulse [animation-duration:1.2s] motion-reduce:animate-none\",\n confirm: \"bg-warning\",\n error: \"bg-destructive\",\n};\n\nexport function ActorViewFrame({\n api,\n app,\n invoke,\n pendingConfirmationInvocationId,\n presentation,\n runId,\n session,\n}: ActorViewFrameProps) {\n const access = useAccess();\n const theme = useResolvedTheme();\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const writableRef = useRef(access.can(\"runs.write\"));\n writableRef.current = access.can(\"runs.write\");\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const portRef = useRef<MessagePort | undefined>(undefined);\n const bridgeGenerationRef = useRef(0);\n const bridgeConnectedRef = useRef(false);\n const appRef = useRef(app);\n const sessionRef = useRef(session);\n sessionRef.current = session;\n const watchedChats = useRef(new Map<string, string>());\n const chatCapabilities = useRef(new Map<string, { result?: Pick<ChatSnapshot, \"attachmentCapabilities\" | \"attachmentCapabilitiesError\">; pending: Promise<Pick<ChatSnapshot, \"attachmentCapabilities\" | \"attachmentCapabilitiesError\">> }>());\n const recentRequestIdsRef = useRef(new Set<string>());\n const sentStateRef = useRef(\"\");\n const sentInvocationsRef = useRef(new Map<string, string>());\n const [bridgeReady, setBridgeReady] = useState(false);\n const [frameError, setFrameError] = useState<string>();\n const [actionError, setActionError] = useState<string>();\n const [submitting, setSubmitting] = useState<string[]>([]);\n appRef.current = app;\n const frameUrl = useMemo(() => api.frameUrl(runId, app.id, app.revision), [api, app.id, app.revision, runId]);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- a fresh token is minted per frame url on purpose\n const bridgeToken = useMemo(() => crypto.randomUUID().replaceAll(\"-\", \"\"), [frameUrl]);\n\n const closeBridge = useCallback(() => {\n bridgeGenerationRef.current += 1;\n bridgeConnectedRef.current = false;\n portRef.current?.close();\n portRef.current = undefined;\n watchedChats.current.clear();\n chatCapabilities.current.clear();\n setBridgeReady(false);\n setSubmitting([]);\n }, []);\n\n const sendChatState = useCallback((port: MessagePort, actor: string, requestId?: string) => {\n const generation = bridgeGenerationRef.current;\n const publish = (capabilities: Pick<ChatSnapshot, \"attachmentCapabilities\" | \"attachmentCapabilitiesError\">) => {\n if (generation !== bridgeGenerationRef.current || port !== portRef.current || !watchedChats.current.has(actor)) return;\n const chat = chatSnapshotOf(sessionRef.current, actor);\n const snapshot = { ...chat, ...capabilities, readOnly: chat.readOnly === true || !writableRef.current };\n const signature = JSON.stringify(snapshot);\n if (requestId === undefined && watchedChats.current.get(actor) === signature) return;\n watchedChats.current.set(actor, signature);\n port.postMessage({ type: RUN_APP_CHAT_STATE, version: RUN_APP_BRIDGE_VERSION, actor, snapshot, ...(requestId ? { requestId } : {}) });\n };\n try {\n const current = sessionRef.current;\n const target = resolveChatActor(current, actor).actor;\n const key = JSON.stringify([current.session.id, target.id, target.execution?.driver]);\n let entry = chatCapabilities.current.get(key);\n if (!entry) {\n const pending = getAttachmentCapabilities(current.session.id, target.id).then(\n (attachmentCapabilities) => ({ attachmentCapabilities }),\n (cause: unknown) => ({ attachmentCapabilitiesError: cause instanceof Error ? cause.message : String(cause) }),\n );\n entry = { pending };\n chatCapabilities.current.set(key, entry);\n const saved = entry;\n void pending.then((result) => { saved.result = result; });\n }\n publish(entry.result ?? { attachmentCapabilitiesError: \"Checking model capabilities ...\" });\n if (!entry.result) void entry.pending.then(publish);\n } catch (cause) {\n publish({ attachmentCapabilitiesError: cause instanceof Error ? cause.message : String(cause) });\n }\n }, []);\n\n const postError = useCallback((port: MessagePort, requestId: string | undefined, message: string) => {\n port.postMessage({\n type: RUN_APP_ERROR,\n version: RUN_APP_BRIDGE_VERSION,\n ...(requestId ? { requestId } : {}),\n message,\n });\n }, []);\n\n const executeRequest = useCallback(async (\n request: RunAppInvokeRequest,\n port: MessagePort,\n generation: number,\n installedApp: Pick<RunApp, \"id\" | \"revision\">,\n ) => {\n if (generation !== bridgeGenerationRef.current || port !== portRef.current) return;\n setActionError(undefined);\n setSubmitting((current) => [...current, request.requestId]);\n try {\n if (!writableRef.current) throw new Error(\"You have read-only access to this actor view.\");\n const invocation = await invoke(\n installedApp.id,\n installedApp.revision,\n request.actionId,\n request.requestId,\n request.input,\n );\n if (generation !== bridgeGenerationRef.current || port !== portRef.current) return;\n sentInvocationsRef.current.set(invocation.id, invocationSignature(invocation));\n port.postMessage({\n type: RUN_APP_INVOCATION,\n version: RUN_APP_BRIDGE_VERSION,\n requestId: request.requestId,\n invocation,\n });\n } catch (caught) {\n if (generation !== bridgeGenerationRef.current || port !== portRef.current) return;\n const message = caught instanceof Error ? caught.message : String(caught);\n setActionError(message);\n postError(port, request.requestId, message);\n } finally {\n if (generation === bridgeGenerationRef.current && port === portRef.current) {\n setSubmitting((current) => current.filter((requestId) => requestId !== request.requestId));\n }\n }\n }, [invoke, postError]);\n\n const sendState = useCallback((port: MessagePort, requestId?: string) => {\n const current = appRef.current;\n port.postMessage({\n type: RUN_APP_STATE,\n version: RUN_APP_BRIDGE_VERSION,\n ...(requestId ? { requestId } : {}),\n state: current.state ?? null,\n });\n }, []);\n\n const handlePortMessage = useCallback((\n value: unknown,\n port: MessagePort,\n generation: number,\n installedApp: RunApp,\n ) => {\n if (generation !== bridgeGenerationRef.current || port !== portRef.current) return;\n if (relayFrameInput(window, value, (message) => {\n if (generation === bridgeGenerationRef.current && port === portRef.current) port.postMessage(message);\n })) return;\n const message = value as { type?: unknown; version?: unknown } | null;\n if (message?.type === RUN_APP_CONNECTED && message.version === RUN_APP_BRIDGE_VERSION) {\n bridgeConnectedRef.current = true;\n setFrameError(undefined);\n setBridgeReady(true);\n return;\n }\n const validation = validateRunAppBridgeRequest(value);\n if (!validation.ok) {\n postError(port, validation.requestId, validation.error);\n return;\n }\n const { request } = validation;\n if (recentRequestIdsRef.current.has(request.requestId)) {\n postError(port, request.requestId, \"This requestId has already been used\");\n return;\n }\n recentRequestIdsRef.current.add(request.requestId);\n if (recentRequestIdsRef.current.size > REQUEST_ID_HISTORY_LIMIT) {\n const oldest = recentRequestIdsRef.current.values().next().value;\n if (oldest !== undefined) recentRequestIdsRef.current.delete(oldest);\n }\n if (request.type === RUN_APP_CHAT_WATCH) {\n watchedChats.current.set(request.actor, \"\");\n sendChatState(port, request.actor, request.requestId);\n return;\n }\n if (request.type === RUN_APP_CHAT_UNWATCH) {\n watchedChats.current.delete(request.actor);\n port.postMessage({ type: RUN_APP_CHAT_ACK, version: RUN_APP_BRIDGE_VERSION, requestId: request.requestId });\n return;\n }\n if (request.type === RUN_APP_CHAT_SEND) {\n void (async () => {\n try {\n if (!writableRef.current) throw new Error(\"You have read-only access to this chat.\");\n const current = sessionRef.current;\n const snapshot = chatSnapshotOf(current, request.actor);\n if (snapshot.error) throw new Error(snapshot.error);\n const { actor } = resolveChatActor(current, request.actor);\n await sendActorMessage(current.session.id, actor.id, request.text, request.attachments);\n if (generation === bridgeGenerationRef.current && port === portRef.current) {\n port.postMessage({ type: RUN_APP_CHAT_ACK, version: RUN_APP_BRIDGE_VERSION, requestId: request.requestId });\n }\n } catch (error) {\n if (generation === bridgeGenerationRef.current && port === portRef.current) {\n postError(port, request.requestId, error instanceof Error ? error.message : String(error));\n }\n }\n })();\n return;\n }\n if (request.type === RUN_APP_GET_STATE) {\n sendState(port, request.requestId);\n return;\n }\n const action = installedApp.actions.find((entry) => entry.id === request.actionId);\n if (!action) {\n postError(port, request.requestId, \"The requested app action is not installed\");\n return;\n }\n void executeRequest(request, port, generation, installedApp);\n }, [executeRequest, postError, sendChatState, sendState]);\n\n const attachBridge = useCallback((port: MessagePort, installedApp: RunApp) => {\n if (portRef.current) {\n port.close();\n return;\n }\n closeBridge();\n const generation = bridgeGenerationRef.current;\n portRef.current = port;\n port.onmessage = (event) => handlePortMessage(event.data, port, generation, installedApp);\n port.onmessageerror = () => {\n if (generation === bridgeGenerationRef.current && port === portRef.current) {\n postError(port, undefined, \"The app sent an unreadable message\");\n }\n };\n port.start();\n recentRequestIdsRef.current = new Set();\n sentStateRef.current = JSON.stringify(installedApp.state ?? null);\n sentInvocationsRef.current = new Map(installedApp.invocations.map((invocation) => [\n invocation.id,\n invocationSignature(invocation),\n ]));\n port.postMessage({\n type: RUN_APP_READY,\n version: RUN_APP_BRIDGE_VERSION,\n theme: themeRef.current,\n hostInput: hostInputEnabled(window),\n app: {\n id: installedApp.id,\n actorId: installedApp.actorId,\n actorHandle: installedApp.actorHandle,\n title: installedApp.title,\n description: installedApp.description,\n actions: installedApp.actions,\n },\n actor: { id: installedApp.actorId, handle: installedApp.actorHandle },\n state: installedApp.state ?? null,\n invocations: installedApp.invocations,\n });\n setFrameError(undefined);\n }, [closeBridge, handlePortMessage, postError]);\n\n useLayoutEffect(() => {\n const frame = iframeRef.current;\n if (!frame) return;\n closeBridge();\n setActionError(undefined);\n setFrameError(undefined);\n const installedApp = appRef.current;\n let initialLoaded = false;\n let pendingPort: MessagePort | undefined;\n const connect = (port: MessagePort) => {\n if (initialLoaded) attachBridge(port, installedApp);\n else pendingPort = port;\n };\n const receiveReady = (event: MessageEvent<unknown>) => {\n const data = event.data as { type?: unknown; version?: unknown; token?: unknown; keyboard?: unknown } | null;\n if (event.source === frame.contentWindow && event.origin === \"null\"\n && data?.type === \"ragents.app.escape\" && data.version === RUN_APP_BRIDGE_VERSION\n && data.token === bridgeToken) {\n window.dispatchEvent(new KeyboardEvent(\"keydown\", { ...(isRunPanelKeyboardMessage(data.keyboard) ? data.keyboard.event : { key: \"Escape\" }), bubbles: true, cancelable: true }));\n return;\n }\n if (event.source !== frame.contentWindow\n || event.origin !== \"null\"\n || data?.type !== RUN_APP_FRAME_READY\n || data.version !== RUN_APP_BRIDGE_VERSION\n || data.token !== bridgeToken\n || event.ports.length !== 1) return;\n if (pendingPort || portRef.current) {\n event.ports[0]!.close();\n return;\n }\n connect(event.ports[0]!);\n };\n const handleLoad = () => {\n if (!initialLoaded) {\n initialLoaded = true;\n if (pendingPort) {\n const port = pendingPort;\n pendingPort = undefined;\n attachBridge(port, installedApp);\n }\n return;\n }\n pendingPort?.close();\n pendingPort = undefined;\n closeBridge();\n setFrameError(\"The app left its installed page and was disconnected.\");\n };\n window.addEventListener(\"message\", receiveReady);\n frame.addEventListener(\"load\", handleLoad);\n frame.src = `${frameUrl}#ragentsBridge=${encodeURIComponent(bridgeToken)}`;\n const timeout = window.setTimeout(() => {\n if (!bridgeConnectedRef.current) setFrameError(\"The app did not open a valid host bridge.\");\n }, 5_000);\n return () => {\n window.clearTimeout(timeout);\n window.removeEventListener(\"message\", receiveReady);\n frame.removeEventListener(\"load\", handleLoad);\n pendingPort?.close();\n closeBridge();\n };\n }, [attachBridge, bridgeToken, closeBridge, frameUrl]);\n\n useEffect(() => {\n if (!bridgeReady) return;\n portRef.current?.postMessage({ type: RUN_APP_THEME, version: RUN_APP_BRIDGE_VERSION, theme });\n }, [bridgeReady, theme]);\n\n useEffect(() => {\n if (!bridgeReady) return;\n const stateSignature = JSON.stringify(app.state ?? null);\n if (stateSignature !== sentStateRef.current) {\n sentStateRef.current = stateSignature;\n const port = portRef.current;\n if (port) sendState(port);\n }\n app.invocations.forEach((invocation) => {\n const signature = invocationSignature(invocation);\n if (sentInvocationsRef.current.get(invocation.id) === signature) return;\n sentInvocationsRef.current.set(invocation.id, signature);\n portRef.current?.postMessage({\n type: RUN_APP_INVOCATION,\n version: RUN_APP_BRIDGE_VERSION,\n invocation,\n });\n });\n }, [app.invocations, app.state, bridgeReady, sendState]);\n\n useEffect(() => {\n if (!bridgeReady || !portRef.current) return;\n for (const actor of watchedChats.current.keys()) sendChatState(portRef.current, actor);\n }, [bridgeReady, sendChatState, session]);\n\n const latest = latestInvocation(app);\n const active = app.invocations.filter((invocation) => ACTIVE_STATUSES.has(invocation.status));\n const confirmationInvocation = active.find((invocation) => invocation.id === pendingConfirmationInvocationId);\n const confirmationAction = confirmationInvocation\n ? app.actions.find((action) => action.id === confirmationInvocation.actionId)\n : undefined;\n const status = frameError\n ? { tone: \"error\", title: \"App disconnected\", detail: frameError }\n : submitting.length > 0\n ? { tone: \"running\", title: \"Starting action\", detail: `${submitting.length} request(s)` }\n : confirmationAction\n ? { tone: \"confirm\", title: \"Waiting for your confirmation\", detail: confirmationAction.label }\n : active.length > 0\n ? { tone: \"running\", title: \"Action running\", detail: active.map((invocation) =>\n app.actions.find((action) => action.id === invocation.actionId)?.label.trim()\n || (access.can(\"runs.inspect\") ? invocation.actionId : \"\")).filter(Boolean).join(\", \") }\n : actionError\n ? { tone: \"error\", title: \"Action failed\", detail: actionError }\n : latest?.status === \"failed\"\n ? { tone: \"error\", title: \"Last action failed\", detail: latest.error }\n : latest?.status === \"cancelled\"\n ? { tone: \"muted\", title: \"Last action cancelled\", detail: latest.actionId }\n : latest?.status === \"succeeded\"\n ? {\n tone: \"success\",\n title: \"Last action completed\",\n detail: latest.output.at(-1) ?? latest.actionId,\n }\n : bridgeReady\n ? undefined\n : { tone: \"muted\", title: \"Loading app\", detail: \"Bridge not connected yet\" };\n\n const visibleStatus = status && (presentation === \"fullscreen\" ? status.tone === \"error\" : status.tone !== \"success\") ? status : undefined;\n\n const compact = presentation !== \"fullscreen\";\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div aria-live=\"polite\" role=\"status\"\n className={cn(\"grid min-w-0 items-center overflow-hidden text-xs text-muted-foreground\",\n compact\n ? \"order-1 h-7 flex-[0_0_28px] grid-cols-[auto_minmax(0,1fr)] gap-1.5 px-workspace-inset py-1\"\n : \"h-[31px] flex-[0_0_31px] grid-cols-[8px_auto_minmax(0,1fr)] gap-[7px] border-b border-border-soft px-workspace-inset py-[5px]\")}>\n {visibleStatus && <>\n {!compact && <span className={cn(\"size-[7px] rounded-full bg-muted-foreground/55\", markTones[visibleStatus.tone])} />}\n <strong className={cn(\"font-semibold whitespace-nowrap text-foreground\", compact ? \"text-[0.63rem]\" : \"text-[0.7rem]\")}>{visibleStatus.title}</strong>\n <span className=\"truncate\" title={visibleStatus.detail}>{visibleStatus.detail}</span>\n </>}\n </div>\n <div className={cn(\"relative flex min-h-0 flex-1 overflow-hidden\", compact ? \"bg-transparent\" : \"bg-background\")}>\n <iframe\n allow=\"camera 'none'; geolocation 'none'; microphone 'none'\"\n className={cn(\"absolute inset-0 h-full w-full min-h-0 min-w-0 border-0\", compact ? \"bg-transparent\" : \"bg-background\")}\n ref={iframeRef}\n referrerPolicy=\"no-referrer\"\n sandbox=\"allow-scripts allow-forms allow-downloads\"\n aria-label={app.title}\n title=\"\"\n />\n </div>\n </div>\n );\n}\n", "import { useRef } from \"react\";\nimport { XIcon } from \"lucide-react\";\nimport type { SessionContext } from \"@ragents/web/PluginRegistry\";\nimport { Button, Dialog, DialogContent, DialogTitle } from \"@ragents/web/ui\";\nimport { HostConfirmation, pendingConfirmationFor, actorProgramApps, useActorPrograms } from \"./AppsPanel\";\nimport { ActorViewFrame } from \"./ActorViewFrame\";\n\nexport function FullscreenHost({ session }: { session: SessionContext }) {\n const { api, closeFullscreen, error, fullscreenAppId, invoke, listing, runId } = useActorPrograms();\n const closeRef = useRef<HTMLButtonElement>(null);\n if (!fullscreenAppId) return null;\n const entry = actorProgramApps(session).find((candidate) => candidate.id === fullscreenAppId && candidate.app.visible !== false);\n if (!entry) return null;\n const app = listing?.apps.find((candidate) => candidate.id === fullscreenAppId);\n const title = entry.title;\n const confirmation = app ? pendingConfirmationFor(session, app) : undefined;\n return <Dialog key={`${runId}:${fullscreenAppId}`} open onOpenChange={(open) => { if (!open) closeFullscreen(); }}>\n <DialogContent className=\"h-[calc(100%-2*clamp(16px,2vw,24px))] w-[calc(100%-2*clamp(16px,2vw,24px))] gap-0 bg-background p-0\" initialFocus={closeRef} scope=\"surface\" showCloseButton={false} size=\"full\">\n <header className=\"flex flex-none items-center gap-3 border-b border-border bg-card py-2 pr-3 pl-4\">\n <DialogTitle className=\"min-w-0 flex-1 truncate text-[0.9rem]\" render={<h2 />}>{title}</DialogTitle>\n <Button aria-label={`Close ${title} full view`} className=\"rounded-full\" onClick={closeFullscreen} ref={closeRef} size=\"icon\" title={`Close ${title} full view`} variant=\"outline\"><XIcon /></Button>\n </header>\n <div className=\"flex min-h-0 flex-1 flex-col overflow-hidden [&>[data-slot=host-confirmation]]:max-h-[65%] [&>[data-slot=host-confirmation]]:flex-[0_1_auto] [&>[data-slot=host-confirmation]]:overflow-auto\">\n {confirmation && <HostConfirmation action={confirmation} key={confirmation.id} session={session} />}\n {app ? <ActorViewFrame api={api} app={app} invoke={invoke} pendingConfirmationInvocationId={confirmation?.parameters.invocationId}\n presentation=\"fullscreen\" runId={runId} session={session} />\n : <p className=\"flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground\" role={error ? \"alert\" : \"status\"}>{error ?? \"Loading actor view\"}</p>}\n </div>\n </DialogContent>\n </Dialog>;\n}\n", "import { useAccess } from \"@ragents/web/AccessContext\";\nimport { Spinner } from \"@ragents/web/ui\";\nimport { isRecord } from \"@ragents/web/lib/guards\";\nimport { runActorFrom } from \"@ragents/web/run-view\";\nimport type {\n SurfaceElementContext,\n SurfaceElementDefinition,\n CardSectionContext,\n SessionContext,\n} from \"@ragents/web/PluginRegistry\";\nimport { HostConfirmation, pendingConfirmationFor, actorProgramApps, useActorPrograms } from \"./AppsPanel\";\nimport { ActorViewFrame } from \"./ActorViewFrame\";\nimport { FunctionForm } from \"./FunctionForm\";\n\nexport function ActorProgramToolCardSection({ actor, session }: CardSectionContext) {\n const inspect = useAccess().can(\"runs.inspect\");\n const { listing } = useActorPrograms();\n const owner = runActorFrom(actor);\n if (!inspect || owner.lifecycle?.kind === \"stopped\") return null;\n const tools = listing?.tools.filter((tool) => tool.card && tool.actorId === owner.id) ?? [];\n if (tools.length === 0) return null;\n return (\n <section className=\"grid min-w-0 gap-[9px]\">\n {tools.map((tool) => (\n <article aria-label={tool.name} className=\"min-w-0\" key={`${session.session.id}:${tool.actorId}:${tool.functionId}:${tool.revision}`}>\n <strong>{tool.name}</strong>\n <FunctionForm session={session} tool={tool} />\n </article>\n ))}\n </section>\n );\n}\n\nexport const actorProgramSurfaceElements = (session: SessionContext): readonly SurfaceElementDefinition[] =>\n actorProgramApps(session).flatMap((module): SurfaceElementDefinition[] => {\n const rawPlacements = module.app.placements;\n const placement = Array.isArray(rawPlacements) ? rawPlacements.find((entry) => isRecord(entry) && entry.kind === \"canvas\") : undefined;\n const surface = isRecord(placement) ? placement : undefined;\n if (surface && typeof surface.anchorActorId !== \"string\") {\n throw new Error(`The surface placement of the actor view ${module.title} is invalid`);\n }\n if (surface && surface.anchorActorId !== module.actorId) throw new Error(`The view ${module.title} belongs to @${module.actorHandle}.`);\n return [{\n id: module.id,\n title: module.title,\n visible: module.app.visible !== false,\n anchorActorId: module.actorId,\n data: { actorId: module.actorId, actorHandle: module.actorHandle },\n entity: { type: \"run-app\", id: module.id },\n }];\n });\n\nexport function ActorProgramSurfaceElement({ definition, session }: SurfaceElementContext) {\n const { api, invoke, listing, runId } = useActorPrograms();\n const app = listing?.apps.find((candidate) => candidate.id === definition.id);\n const confirmation = app ? pendingConfirmationFor(session, app) : undefined;\n const title = definition.title ?? definition.id;\n const frame = app ? (\n <ActorViewFrame\n api={api}\n app={app}\n invoke={invoke}\n pendingConfirmationInvocationId={confirmation?.parameters.invocationId}\n presentation=\"tiled\"\n runId={runId}\n session={session}\n />\n ) : (\n <div className=\"flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground\">\n <Spinner aria-hidden aria-label={undefined} role={undefined} />\n <span>Loading actor view</span>\n </div>\n );\n return (\n <article aria-label={title} className=\"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden\">\n <div className=\"flex min-h-0 flex-1 flex-col overflow-hidden [&>[data-slot=host-confirmation]]:max-h-[65%] [&>[data-slot=host-confirmation]]:flex-[0_1_auto] [&>[data-slot=host-confirmation]]:overflow-auto\">\n {confirmation && <HostConfirmation action={confirmation} key={confirmation.id} session={session} />}\n {frame}\n </div>\n </article>\n );\n}\n", "import {\n pluginRoutePrefixFrom,\n type SessionProviderProps,\n type WebPlugin,\n type WebPluginDescriptor,\n} from \"@ragents/web/PluginRegistry\";\nimport { createActorProgramsApi } from \"./api\";\nimport {\n RUN_TOOLS_TAB_ID,\n ActorProgramsHeader,\n ActorProgramsProvider,\n ToolsBadge,\n ToolsPanel,\n} from \"./AppsPanel\";\nimport { FullscreenHost } from \"./FullscreenHost\";\nimport {\n ActorProgramSurfaceElement,\n ActorProgramToolCardSection,\n actorProgramSurfaceElements,\n} from \"./EmbeddedApps\";\n\nexport const ACTOR_PROGRAMS_PLUGIN_ID = \"ragents.actor-programs\";\n\nfunction IconTools() {\n return (\n <svg aria-hidden fill=\"none\" height=\"15\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.7\" viewBox=\"0 0 24 24\" width=\"15\">\n <path d=\"M14.5 6.5 17.5 3.5l3 3-3 3\" />\n <path d=\"m9.5 17.5-3 3-3-3 3-3\" />\n <path d=\"M13 5H9a4 4 0 0 0-4 4v5.5M11 19h4a4 4 0 0 0 4-4V9.5\" />\n </svg>\n );\n}\n\nconst configuredPlugin = (descriptor: WebPluginDescriptor, routePrefix: string): WebPlugin => {\n const api = createActorProgramsApi(routePrefix);\n\n function Provider({ children, session }: SessionProviderProps) {\n return (\n <ActorProgramsProvider api={api} session={session}>\n {children}\n <FullscreenHost session={session} />\n </ActorProgramsProvider>\n );\n }\n\n return {\n ...descriptor,\n needsRunView: true,\n SessionProvider: Provider,\n sessionHeaders: [{\n id: \"ragents.actor-programs.quick-list\",\n placement: \"surface\",\n order: 250,\n Header: ActorProgramsHeader,\n }],\n cardSections: [{\n id: \"ragents.actor-programs.tools\",\n order: 400,\n Section: ActorProgramToolCardSection,\n }],\n surfaceElements: [{\n id: \"ragents.actor-programs.apps\",\n order: 400,\n select: actorProgramSurfaceElements,\n Element: ActorProgramSurfaceElement,\n }],\n workspaceTabs: [\n {\n readRight: \"runs.inspect\",\n id: RUN_TOOLS_TAB_ID,\n label: \"Functions\",\n order: 251,\n Icon: IconTools,\n Panel: ToolsPanel,\n Badge: ToolsBadge,\n },\n ],\n };\n};\n\nconst descriptor: WebPluginDescriptor = { id: ACTOR_PROGRAMS_PLUGIN_ID };\n\nexport const webPlugin: WebPlugin = {\n ...descriptor,\n activate: (config) => configuredPlugin(descriptor, pluginRoutePrefixFrom(descriptor.id, config)),\n};\n"],
|
|
5
5
|
"mappings": "AAAO,IAAMA,EAAO,CAACC,EAAWC,IAAS,CACvC,IAAMC,EAAS,WAAW,uBAA0BF,CAAS,EAC7D,GAAIE,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AoC,QAAS3B,GAA1B2B,EAAa,EAAsB,EAChGG,GACH,EACF,CAEJ,CC5DO,IAAMI,GAA2B,yBAExC,SAASC,IAAY,CACnB,OACEC,EAAC,OAAI,cAAW,GAAC,KAAK,OAAO,OAAO,KAAK,OAAO,eAAe,cAAc,QAAQ,eAAe,QAAQ,YAAY,MAAM,QAAQ,YAAY,MAAM,KACtJ,UAAAC,EAAC,QAAK,EAAE,6BAA6B,EACrCA,EAAC,QAAK,EAAE,wBAAwB,EAChCA,EAAC,QAAK,EAAE,sDAAsD,GAChE,CAEJ,CAEA,IAAMC,GAAmB,CAACC,EAAiCC,IAAmC,CAC5F,IAAMC,EAAMC,GAAuBF,CAAW,EAE9C,SAASG,EAAS,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAyB,CAC7D,OACET,EAACU,GAAA,CAAsB,IAAKL,EAAK,QAASI,EACvC,UAAAD,EACDP,EAACU,GAAA,CAAe,QAASF,EAAS,GACpC,CAEJ,CAEA,MAAO,CACL,GAAGN,EACH,aAAc,GACd,gBAAiBI,EACjB,eAAgB,CAAC,CACf,GAAI,oCACJ,UAAW,UACX,MAAO,IACP,OAAQK,EACV,CAAC,EACD,aAAc,CAAC,CACb,GAAI,+BACJ,MAAO,IACP,QAASC,EACX,CAAC,EACD,gBAAiB,CAAC,CAChB,GAAI,8BACJ,MAAO,IACP,OAAQC,GACR,QAASC,EACX,CAAC,EACD,cAAe,CACb,CACE,UAAW,eACX,GAAIC,GACJ,MAAO,YACP,MAAO,IACP,KAAMjB,GACN,MAAOkB,GACP,MAAOC,EACT,CACF,CACF,CACF,EAEMf,GAAkC,CAAE,GAAIL,EAAyB,EAE1DqB,GAAuB,CAClC,GAAGhB,GACH,SAAWiB,GAAWlB,GAAiBC,GAAYkB,GAAsBlB,GAAW,GAAIiB,CAAM,CAAC,CACjG",
|
|
6
6
|
"names": ["read", "specifier", "name", "module", "PluginRegistry_pluginRoutePrefixFrom_default", "read", "PluginRegistry_useSurfaceController_default", "read", "guards_isRecord_default", "read", "rpc_rpc_default", "read", "access_token_withAccessToken_default", "read", "contract_ACTOR_INVOCATIONS_STATE_ID_default", "read", "contract_ACTOR_PROGRAMS_STATE_ID_default", "read", "contract_ACTOR_STATE_ID_default", "read", "contract_actorProgramContracts_default", "read", "actorFunctionParameterTypes", "MAX_CHAT_ATTACHMENTS", "MAX_CHAT_ATTACHMENT_BYTES", "MAX_CHAT_REQUEST_BYTES", "chatAttachmentMediaType", "name", "mediaType", "explicit", "parseChatAttachments", "value", "total", "entry", "index", "data", "normalizedType", "padding", "RUN_APP_BRIDGE_VERSION", "RUN_APP_FRAME_READY", "RUN_APP_CONNECTED", "RUN_APP_READY", "RUN_APP_THEME", "RUN_APP_INVOKE", "RUN_APP_GET_STATE", "RUN_APP_STATE", "RUN_APP_INVOCATION", "RUN_APP_ERROR", "RUN_APP_CHAT_WATCH", "RUN_APP_CHAT_UNWATCH", "RUN_APP_CHAT_SEND", "RUN_APP_CHAT_STATE", "RUN_APP_CHAT_ACK", "ID_PATTERN", "MAX_INPUT_LENGTH", "MAX_DEPTH", "isJsonValue", "value", "depth", "entry", "guards_isRecord_default", "key", "requestIdFrom", "inputWithinLimit", "validateRunAppBridgeRequest", "requestId", "common", "attachments", "parseChatAttachments", "cause", "ID_PATTERN", "VIEW_ID_PATTERN", "HASH_PATTERN", "PARAMETER_TYPES", "actorFunctionParameterTypes", "requiredString", "value", "field", "optionalString", "idFrom", "id", "unique", "values", "keyOf", "label", "ids", "runAppActionFrom", "guards_isRecord_default", "runAppInvocationFrom", "line", "base", "isJsonValue", "runAppPlacementFrom", "runAppFrom", "rawPlacements", "actions", "action", "invocations", "invocation", "actionIds", "placements", "actorId", "placement", "runToolParameterFrom", "runToolTargetFrom", "runScriptToolFrom", "sourceHash", "parameter", "target", "actorProgramSourceFileFrom", "actorProgramSourceFrom", "file", "actorProgramsListingFrom", "app", "tool", "segment", "frameBase", "routePrefix", "runId", "createActorProgramsApi", "signal", "rpc_rpc_default", "contract_actorProgramContracts_default", "moduleId", "appId", "revision", "access_token_withAccessToken_default", "actionId", "requestId", "input", "invocationId", "actorHandle", "functionId", "AccessContext_useAccess_default", "read", "react_createContext_default", "read", "react_createElement_default", "read", "react_forwardRef_default", "read", "react_useCallback_default", "read", "react_useContext_default", "read", "react_useEffect_default", "read", "react_useLayoutEffect_default", "read", "react_useMemo_default", "read", "react_useRef_default", "read", "react_useState_default", "read", "toKebabCase", "string", "toLucideIconData", "iconName", "iconNode", "aliases", "toKebabCase", "toCamelCase", "string", "out", "upperNext", "ch", "toPascalCase", "string", "camelCase", "toCamelCase", "mergeClasses", "classes", "className", "index", "array", "defaultAttributes", "isDefined", "value", "buildLucideIconNode", "icon", "params", "attributeNames", "getAttributeName", "attributeName", "viewBoxWidth", "defaultAttributes", "viewBoxHeight", "aliasClassNames", "alias", "iconClassNames", "classNamesFromClassName", "className", "mergeClasses", "calculatedStrokeWidth", "attrs", "attrName", "child", "name", "children", "nextAttrs", "buildLucideIconForReact", "icon", "params", "buildLucideIconNode", "hasA11yProp", "props", "prop", "LucideContext", "react_createContext_default", "useLucideContext", "react_useContext_default", "LucideContext", "Icon", "react_forwardRef_default", "color", "size", "width", "height", "strokeWidth", "absoluteStrokeWidth", "nonScalingStroke", "className", "children", "iconNode", "icon", "rest", "ref", "contextSize", "contextStrokeWidth", "contextAbsoluteStrokeWidth", "contextNonScalingStroke", "contextColor", "contextClass", "useLucideContext", "hasAccessibleProp", "hasA11yProp", "name", "svgAttributes", "builtIconNode", "buildLucideIconForReact", "mergeClasses", "react_createElement_default", "tag", "attrs", "createLucideIcon", "iconDataOrName", "iconNode", "aliases", "iconData", "toLucideIconData", "Component", "react_forwardRef_default", "className", "props", "ref", "react_createElement_default", "Icon", "toPascalCase", "__iconData", "ArrowLeft", "createLucideIcon", "__iconData", "LayoutGrid", "createLucideIcon", "__iconData", "X", "createLucideIcon", "ui_Alert_default", "read", "ui_Badge_default", "read", "ui_Button_default", "read", "ui_Dialog_default", "read", "ui_DialogContent_default", "read", "ui_DialogTitle_default", "read", "ui_Empty_default", "read", "ui_EmptyContent_default", "read", "ui_EmptyDescription_default", "read", "ui_EmptyHeader_default", "read", "ui_EmptyMedia_default", "read", "ui_EmptyTitle_default", "read", "ui_Input_default", "read", "ui_Spinner_default", "read", "ui_Textarea_default", "read", "ui_cn_default", "read", "Toolbar_ToolbarCopy_default", "read", "Toolbar_ToolbarItem_default", "read", "Toolbar_ToolbarLabel_default", "read", "Toolbar_ToolbarText_default", "read", "askPayloadOf", "ASK_PLUGIN_ID", "answerQuestion", "QuestionCard", "run_view_runActorFrom_default", "read", "run_view_runViewFrom_default", "read", "useSurfaceEntities", "SURFACE_TILE_DRAG_TYPE", "ProgramSlotContext", "SourceCode_SourceCode_default", "read", "actorProgramSourceReference", "runView", "actorId", "entry", "run_view_runViewFrom_default", "contract_ACTOR_PROGRAMS_STATE_ID_default", "guards_isRecord_default", "program", "actorProgramViews", "view", "actor", "app", "currentActorListing", "listing", "currentViews", "activeActors", "current", "state", "contract_ACTOR_STATE_ID_default", "values", "isJsonValue", "tool", "jsx_runtime_Fragment_default", "read", "jsx_runtime_jsx_default", "read", "jsx_runtime_jsxs_default", "read", "ProgramSource", "api", "moduleId", "runId", "revision", "expandedByDefault", "expanded", "setExpanded", "react_useState_default", "state", "setState", "activePath", "setActivePath", "react_useEffect_default", "controller", "files", "file", "caught", "active", "jsx_runtime_jsxs_default", "jsx_runtime_jsx_default", "ui_Button_default", "jsx_runtime_Fragment_default", "ui_Spinner_default", "ui_Alert_default", "ui_cn_default", "SourceCode_SourceCode_default", "actorProgramSourceView", "view", "actorId", "program", "actorProgramSourceReference", "waitForPoll", "signal", "resolve", "reject", "timer", "abort", "invokeActorFunction", "api", "runId", "tool", "input", "changed", "invocation", "parseParameter", "parameter", "form", "raw", "value", "entry", "isJsonValue", "actorFunctionInput", "parameters", "selectClass", "FunctionForm", "session", "tool", "detail", "writable", "AccessContext_useAccess_default", "api", "refresh", "runId", "useActorPrograms", "error", "setError", "react_useState_default", "busy", "setBusy", "invocation", "setInvocation", "controllerRef", "react_useRef_default", "react_useEffect_default", "confirmation", "pendingConfirmationFor", "submit", "event", "controller", "input", "actorFunctionInput", "invokeActorFunction", "current", "caught", "status", "failure", "jsx_runtime_jsxs_default", "ui_cn_default", "jsx_runtime_jsx_default", "parameter", "ui_Textarea_default", "ui_Input_default", "ui_Button_default", "HostConfirmation", "ExpandIcon", "jsx_runtime_jsx_default", "actorProgramsRevision", "runView", "view", "run_view_runViewFrom_default", "programActors", "entry", "contract_ACTOR_PROGRAMS_STATE_ID_default", "actor", "left", "right", "contract_ACTOR_INVOCATIONS_STATE_ID_default", "contract_ACTOR_STATE_ID_default", "activeActorInvocations", "apps", "includeFunctions", "appIds", "app", "active", "invocation", "left", "right", "target", "readActorInvocation", "api", "runId", "signal", "invocationTime", "raw", "parsed", "latestInvocation", "latest", "ActorProgramsContext", "react_createContext_default", "useOptionalActorPrograms", "react_useContext_default", "useActorPrograms", "value", "RUN_TOOLS_TAB_ID", "entryIconClass", "headClass", "sectionLabelClass", "quickIconClass", "ACTIVE_STATUSES", "POLL_INTERVAL", "replaceInvocation", "listing", "invocation", "app", "exists", "entry", "ActorProgramsProvider", "api", "children", "session", "runId", "canInspect", "AccessContext_useAccess_default", "storedListing", "setListing", "react_useState_default", "react_useMemo_default", "currentActorListing", "error", "setError", "fullscreen", "setFullscreen", "visibleApps", "actorProgramApps", "fullscreenAppId", "closeFullscreen", "react_useCallback_default", "openFullscreen", "appId", "react_useEffect_default", "loadRevision", "react_useRef_default", "refresh", "revision", "next", "caught", "moduleRevision", "actorProgramsRevision", "activeInvocations", "activeActorInvocations", "activeKey", "targets", "disposed", "timer", "controller", "poll", "results", "target", "readActorInvocation", "updates", "result", "current", "update", "failed", "invoke", "actionId", "requestId", "input", "value", "slot", "candidate", "pendingConfirmationFor", "view", "actorId", "actorProgramSourceView", "jsx_runtime_jsx_default", "ActorProgramsContext", "ProgramSlotContext", "actorProgramViews", "run_view_runViewFrom_default", "invocationIds", "action", "ASK_PLUGIN_ID", "contract_ACTOR_PROGRAMS_STATE_ID_default", "HostConfirmation", "access", "busy", "setBusy", "answer", "text", "answerQuestion", "jsx_runtime_jsxs_default", "QuestionCard", "askPayloadOf", "targetLabel", "ToolsPanel", "active", "navigation", "selection", "useActorPrograms", "selectedName", "selected", "tool", "ui_Spinner_default", "ui_Empty_default", "ui_EmptyHeader_default", "ui_EmptyMedia_default", "IconTools", "ui_EmptyTitle_default", "ui_EmptyDescription_default", "ui_EmptyContent_default", "ui_Button_default", "ArrowLeft", "ui_cn_default", "FunctionForm", "ProgramSource", "fact", "ui_Alert_default", "ui_Badge_default", "IconOpen", "ActorProgramsHeader", "canArrange", "surface", "PluginRegistry_useSurfaceController_default", "stage", "useSurfaceEntities", "apps", "Toolbar_ToolbarItem_default", "event", "SURFACE_TILE_DRAG_TYPE", "LayoutGrid", "Toolbar_ToolbarCopy_default", "Toolbar_ToolbarLabel_default", "Toolbar_ToolbarText_default", "ExpandIcon", "ToolsBadge", "size", "input_bridge_hostInputEnabled_default", "read", "input_bridge_isRunPanelKeyboardMessage_default", "read", "input_bridge_relayFrameInput_default", "read", "theme_useResolvedTheme_default", "read", "api_sendActorMessage_default", "read", "contracts_actorByHandle_default", "read", "actor_conversation_actorChatMessages_default", "read", "chat_target_programChatNotice_default", "read", "resolveChatActor", "session", "target", "view", "run_view_runViewFrom_default", "actor", "entry", "contracts_actorByHandle_default", "names", "chatSnapshotOf", "primary", "error", "chat_target_programChatNotice_default", "actor_conversation_actorChatMessages_default", "useAttachmentCapabilities_getAttachmentCapabilities_default", "read", "ACTIVE_STATUSES", "REQUEST_ID_HISTORY_LIMIT", "invocationSignature", "invocation", "markTones", "ActorViewFrame", "api", "app", "invoke", "pendingConfirmationInvocationId", "presentation", "runId", "session", "access", "AccessContext_useAccess_default", "theme", "theme_useResolvedTheme_default", "themeRef", "react_useRef_default", "writableRef", "iframeRef", "portRef", "bridgeGenerationRef", "bridgeConnectedRef", "appRef", "sessionRef", "watchedChats", "chatCapabilities", "recentRequestIdsRef", "sentStateRef", "sentInvocationsRef", "bridgeReady", "setBridgeReady", "react_useState_default", "frameError", "setFrameError", "actionError", "setActionError", "submitting", "setSubmitting", "frameUrl", "react_useMemo_default", "bridgeToken", "closeBridge", "react_useCallback_default", "sendChatState", "port", "actor", "requestId", "generation", "publish", "capabilities", "chat", "chatSnapshotOf", "snapshot", "signature", "RUN_APP_CHAT_STATE", "RUN_APP_BRIDGE_VERSION", "current", "target", "resolveChatActor", "key", "entry", "pending", "useAttachmentCapabilities_getAttachmentCapabilities_default", "attachmentCapabilities", "cause", "saved", "result", "postError", "message", "RUN_APP_ERROR", "executeRequest", "request", "installedApp", "RUN_APP_INVOCATION", "caught", "sendState", "RUN_APP_STATE", "handlePortMessage", "value", "input_bridge_relayFrameInput_default", "RUN_APP_CONNECTED", "validation", "validateRunAppBridgeRequest", "oldest", "RUN_APP_CHAT_WATCH", "RUN_APP_CHAT_UNWATCH", "RUN_APP_CHAT_ACK", "RUN_APP_CHAT_SEND", "api_sendActorMessage_default", "error", "RUN_APP_GET_STATE", "attachBridge", "event", "RUN_APP_READY", "input_bridge_hostInputEnabled_default", "react_useLayoutEffect_default", "frame", "initialLoaded", "pendingPort", "connect", "receiveReady", "data", "input_bridge_isRunPanelKeyboardMessage_default", "RUN_APP_FRAME_READY", "handleLoad", "timeout", "react_useEffect_default", "RUN_APP_THEME", "stateSignature", "latest", "latestInvocation", "active", "confirmationInvocation", "confirmationAction", "action", "status", "visibleStatus", "compact", "jsx_runtime_jsxs_default", "jsx_runtime_jsx_default", "ui_cn_default", "jsx_runtime_Fragment_default", "FullscreenHost", "session", "api", "closeFullscreen", "error", "fullscreenAppId", "invoke", "listing", "runId", "useActorPrograms", "closeRef", "react_useRef_default", "entry", "actorProgramApps", "candidate", "app", "title", "confirmation", "pendingConfirmationFor", "jsx_runtime_jsx_default", "ui_Dialog_default", "open", "jsx_runtime_jsxs_default", "ui_DialogContent_default", "ui_DialogTitle_default", "ui_Button_default", "X", "HostConfirmation", "ActorViewFrame", "ActorProgramToolCardSection", "actor", "session", "inspect", "AccessContext_useAccess_default", "listing", "useActorPrograms", "owner", "run_view_runActorFrom_default", "tools", "tool", "jsx_runtime_jsx_default", "jsx_runtime_jsxs_default", "FunctionForm", "actorProgramSurfaceElements", "actorProgramApps", "module", "rawPlacements", "placement", "entry", "guards_isRecord_default", "surface", "ActorProgramSurfaceElement", "definition", "api", "invoke", "runId", "app", "candidate", "confirmation", "pendingConfirmationFor", "title", "frame", "ActorViewFrame", "ui_Spinner_default", "HostConfirmation", "ACTOR_PROGRAMS_PLUGIN_ID", "IconTools", "jsx_runtime_jsxs_default", "jsx_runtime_jsx_default", "configuredPlugin", "descriptor", "routePrefix", "api", "createActorProgramsApi", "Provider", "children", "session", "ActorProgramsProvider", "FullscreenHost", "ActorProgramsHeader", "ActorProgramToolCardSection", "actorProgramSurfaceElements", "ActorProgramSurfaceElement", "RUN_TOOLS_TAB_ID", "ToolsPanel", "ToolsBadge", "webPlugin", "config", "PluginRegistry_pluginRoutePrefixFrom_default"]
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"revision": "
|
|
75
|
-
"sourceRevision": "
|
|
74
|
+
"revision": "0c115b8cade07b18dee1b1d11200bbc0427d98d13d0315d9bd47c8619ded8fbc",
|
|
75
|
+
"sourceRevision": "79645163f0f2b1d740c94f0d0fd881b5a55bee6bcf7af7b21b827b7254e7b4c5",
|
|
76
76
|
"server": "server/index.js",
|
|
77
77
|
"web": {
|
|
78
78
|
"entry": "web/index.js",
|
|
@@ -259,6 +259,7 @@ import { facesOperator } from "@ragents/host/plugin-support/tool-availability.js
|
|
|
259
259
|
var askToolMetadata = {
|
|
260
260
|
name: "ask_user",
|
|
261
261
|
label: "Question",
|
|
262
|
+
nativeTool: true,
|
|
262
263
|
description: "Asks the user for a required decision with answer options and waits for the answer.",
|
|
263
264
|
longDescription: "Always use this tool when you need a decision from the user (e.g. choosing a branch or a time range), instead of only asking the question as text. With multi=true the user may choose several options; the answer is then joined with '; '. Instead of choosing an option, the user can always answer freely - so expect the answer to be arbitrary text."
|
|
264
265
|
};
|