@schlenkr/ragents 0.1.10 → 0.1.11
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/access-projection.ts +4 -4
- package/apps/server/src/access-service.ts +3 -3
- package/apps/server/src/access-session.ts +19 -19
- package/apps/server/src/api/contracts.ts +29 -29
- package/apps/server/src/api/core-methods.ts +17 -17
- package/apps/server/src/api/delivery.ts +2 -2
- package/apps/server/src/api/reference.ts +27 -27
- package/apps/server/src/api/rights.ts +18 -18
- package/apps/server/src/chat-handler.ts +5 -5
- package/apps/server/src/config-definition.ts +37 -10
- package/apps/server/src/config-file.ts +49 -49
- package/apps/server/src/config.ts +2 -0
- package/apps/server/src/data-directory.ts +2 -2
- package/apps/server/src/external-access.ts +1 -1
- package/apps/server/src/folder-install.ts +1 -1
- package/apps/server/src/help-files.ts +1 -1
- package/apps/server/src/host-api.json +6 -1
- package/apps/server/src/host-api.ts +3 -2
- package/apps/server/src/host-record.ts +3 -3
- package/apps/server/src/host-resolution-hooks.mjs +4 -4
- package/apps/server/src/host-version.ts +17 -17
- package/apps/server/src/host-web.ts +5 -5
- package/apps/server/src/main.ts +6 -6
- package/apps/server/src/missing-environment.ts +6 -6
- package/apps/server/src/parent-watch.ts +4 -4
- package/apps/server/src/plugin-build/build.ts +31 -31
- package/apps/server/src/plugin-build/host-api-names.ts +7 -7
- package/apps/server/src/plugin-build/plugin-description.ts +15 -15
- package/apps/server/src/plugin-build/typecheck.ts +1 -1
- package/apps/server/src/plugin-support/actor-programs/app-project.ts +19 -19
- package/apps/server/src/plugin-support/actor-programs/client-compiler.ts +4 -4
- package/apps/server/src/plugin-support/actor-programs/client-contracts.ts +11 -11
- package/apps/server/src/plugin-support/actor-programs/contract.ts +17 -17
- package/apps/server/src/plugin-support/actor-programs/runtime-libraries.ts +1 -1
- package/apps/server/src/plugin-support/actor-programs/workflow/index.ts +5 -5
- package/apps/server/src/plugin-support/actor-programs/workflow/prompt-reader.ts +2 -2
- package/apps/server/src/plugin-support/chat-display-policy.ts +2 -2
- package/apps/server/src/plugin-support/front-matter.ts +6 -6
- package/apps/server/src/plugin-support/http.ts +2 -2
- package/apps/server/src/plugin-support/language-server/contract.ts +8 -8
- package/apps/server/src/plugin-support/language-server/plugin.ts +2 -2
- package/apps/server/src/plugin-support/language-server/snapshot-method.ts +1 -1
- package/apps/server/src/plugin-support/language-server/tools.ts +11 -11
- package/apps/server/src/plugin-support/model-aliases.ts +30 -20
- package/apps/server/src/plugin-support/model-choice.ts +15 -15
- package/apps/server/src/plugin-support/model-completion.ts +44 -23
- package/apps/server/src/plugin-support/model-providers.ts +170 -0
- package/apps/server/src/plugin-support/model-upstreams.ts +1 -1
- package/apps/server/src/plugin-support/native-typescript-child.ts +4 -4
- package/apps/server/src/plugin-support/native-typescript-executor.ts +12 -12
- package/apps/server/src/plugin-support/plugin-config.ts +3 -3
- package/apps/server/src/plugin-support/plugin-folder.ts +2 -2
- package/apps/server/src/plugin-support/plugins-root.ts +2 -2
- package/apps/server/src/plugin-support/process-sandbox.ts +39 -39
- package/apps/server/src/plugin-support/product-model-settings-contract.ts +3 -3
- package/apps/server/src/plugin-support/product-model-settings.ts +10 -10
- package/apps/server/src/plugin-support/product-relay.ts +9 -9
- package/apps/server/src/plugin-support/product-start-options.ts +4 -4
- package/apps/server/src/plugin-support/prompt.ts +1 -1
- package/apps/server/src/plugin-support/provision.ts +8 -8
- package/apps/server/src/plugin-support/run-scripts.ts +17 -17
- package/apps/server/src/plugin-support/skills.ts +18 -18
- package/apps/server/src/plugin-support/start-entries-contract.ts +17 -17
- package/apps/server/src/plugin-support/start-options-contract.ts +5 -5
- package/apps/server/src/plugin-support/system-prompts.ts +11 -11
- package/apps/server/src/plugin-support/thinking-level.ts +2 -2
- package/apps/server/src/plugin-support/tool-availability.ts +2 -2
- package/apps/server/src/plugin-support/workspace-ownership.ts +5 -5
- package/apps/server/src/plugin-support/workspace-sandbox-host.ts +37 -37
- package/apps/server/src/plugin-support/zip.ts +7 -7
- package/apps/server/src/profile/bundle-manifest.ts +17 -17
- package/apps/server/src/profile/compose.ts +12 -7
- package/apps/server/src/profile/plugin-discovery.ts +12 -12
- package/apps/server/src/profile/provisioning.ts +5 -5
- package/apps/server/src/profile-target.ts +10 -10
- package/apps/server/src/protocol.ts +2 -2
- package/apps/server/src/provider.ts +61 -56
- package/apps/server/src/ragents/actor-chat-history.ts +8 -8
- package/apps/server/src/ragents/chat-text-positions.ts +2 -2
- package/apps/server/src/ragents/coordinator.ts +2 -2
- package/apps/server/src/ragents/engine.ts +23 -23
- package/apps/server/src/ragents/global-chat.ts +8 -8
- package/apps/server/src/ragents/host-services.ts +6 -3
- package/apps/server/src/ragents/journal-chat-events.ts +1 -1
- package/apps/server/src/ragents/run-owner.ts +2 -2
- package/apps/server/src/ragents/session.ts +49 -49
- package/apps/server/src/ragents/typescript-tools.ts +12 -12
- package/apps/server/src/ragents/workspace-runtime.ts +28 -28
- package/apps/server/src/rpc/dispatcher.ts +19 -19
- package/apps/server/src/rpc/http-transport.ts +11 -11
- package/apps/server/src/rpc/stdio-transport.ts +3 -3
- package/apps/server/src/run-preparation-input.ts +5 -5
- package/apps/server/src/run-preparation.ts +24 -24
- package/apps/server/src/run-transfer.ts +39 -39
- package/apps/server/src/server.ts +48 -48
- package/apps/server/src/settings.ts +1 -1
- package/apps/server/src/startup.ts +3 -3
- package/apps/server/src/title-compactor.ts +9 -9
- package/apps/server/src/title-settings.ts +3 -3
- package/apps/server/src/web-bundles.ts +2 -2
- package/apps/server/src/web-stylesheet.ts +2 -2
- package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-BO4wLQtE.js → highlighted-body-KPVGNVTW-BfNSGxjB.js} +1 -1
- package/apps/web/dist/assets/main-D6bsKcIK.js +11 -0
- package/apps/web/dist/assets/mermaid-HWGCJPDP-DROEqEeg.js +608 -0
- package/apps/web/dist/assets/runPanel-Dumuuqry.js +21 -0
- package/apps/web/dist/help/guide-access.html +5 -5
- package/apps/web/dist/help/guide-access.md +2 -2
- package/apps/web/dist/help/guide-clients.html +53 -54
- package/apps/web/dist/help/guide-clients.md +50 -51
- package/apps/web/dist/help/guide-distributed.html +12 -7
- package/apps/web/dist/help/guide-distributed.md +9 -4
- package/apps/web/dist/help/guide-functions.html +3 -3
- package/apps/web/dist/help/guide-getting-started.html +24 -15
- package/apps/web/dist/help/guide-getting-started.md +22 -12
- package/apps/web/dist/help/guide-ideas.html +3 -3
- package/apps/web/dist/help/guide-plugins.html +5 -4
- package/apps/web/dist/help/guide-plugins.md +2 -1
- package/apps/web/dist/help/guide-programs.html +3 -3
- package/apps/web/dist/help/guide-runtime.html +6 -6
- package/apps/web/dist/help/guide-runtime.md +3 -3
- package/apps/web/dist/help/guide.html +3 -3
- package/apps/web/dist/help/index.html +196 -144
- package/apps/web/dist/help/mini-app.css +6 -0
- package/apps/web/dist/help/mini-app.js +14 -14
- package/apps/web/dist/host-web.json +90 -90
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/run-panel.html +3 -3
- package/apps/web/package.json +1 -1
- package/apps/web/src/AccessContext.tsx +15 -15
- package/apps/web/src/App.tsx +13 -13
- package/apps/web/src/DiffCode.tsx +2 -2
- package/apps/web/src/HelpDialog.tsx +3 -3
- package/apps/web/src/Overview.tsx +13 -13
- package/apps/web/src/PluginActivation.ts +1 -1
- package/apps/web/src/PluginChat.tsx +15 -15
- package/apps/web/src/PluginFailureNotice.tsx +1 -1
- package/apps/web/src/PluginRegistry.tsx +44 -44
- package/apps/web/src/RunPreparationChat.tsx +11 -11
- package/apps/web/src/RunStore.ts +1 -1
- package/apps/web/src/SessionList.tsx +14 -14
- package/apps/web/src/SettingsModal.tsx +112 -112
- package/apps/web/src/StartOptions.tsx +11 -11
- package/apps/web/src/StartSelection.tsx +11 -11
- package/apps/web/src/StartTiles.tsx +8 -8
- package/apps/web/src/SurfaceShortcuts.tsx +3 -3
- package/apps/web/src/ThemeSettings.tsx +8 -8
- package/apps/web/src/TitleModelSettings.tsx +13 -13
- package/apps/web/src/WorkspacePanel.tsx +9 -9
- package/apps/web/src/access-session.ts +4 -4
- package/apps/web/src/access-token.ts +5 -5
- package/apps/web/src/actor-conversation.ts +3 -3
- package/apps/web/src/actor-programs/client-ui/DataTable.tsx +8 -8
- package/apps/web/src/actor-programs/client-ui/FilePicker.tsx +4 -4
- package/apps/web/src/actor-programs/client-ui/FlowDiagram.tsx +13 -13
- package/apps/web/src/actor-programs/client-ui/Viewers.tsx +4 -4
- package/apps/web/src/actor-programs/client-ui/WorkflowDiagram.tsx +1 -1
- package/apps/web/src/actor-programs/client-ui/file-contracts.d.ts +4 -4
- package/apps/web/src/actor-programs/client-ui/file-selection.ts +1 -1
- package/apps/web/src/actor-programs/client-ui/viewer-contracts.d.ts +3 -3
- package/apps/web/src/api.ts +7 -7
- package/apps/web/src/chat/StoppedActorNotice.tsx +5 -5
- package/apps/web/src/chat/chat-target.ts +3 -3
- package/apps/web/src/chat/requests.ts +2 -2
- package/apps/web/src/chat/useAttachmentCapabilities.ts +2 -2
- package/apps/web/src/chat-view-settings.tsx +5 -6
- package/apps/web/src/diff-view.css +1 -1
- package/apps/web/src/highlighting.css +1 -1
- package/apps/web/src/language-server/language-server-plugin.tsx +30 -30
- package/apps/web/src/lib/labels.ts +6 -6
- package/apps/web/src/main.tsx +4 -4
- package/apps/web/src/offered-machines.ts +2 -2
- package/apps/web/src/page-opener.tsx +1 -1
- package/apps/web/src/panel/ConnectionsPage.tsx +23 -23
- package/apps/web/src/panel/LoginForm.tsx +6 -6
- package/apps/web/src/panel/PanelDialogs.tsx +22 -22
- package/apps/web/src/panel/PanelHeader.tsx +2 -2
- package/apps/web/src/panel/PanelPage.tsx +1 -1
- package/apps/web/src/panel/RunLine.tsx +4 -4
- package/apps/web/src/panel/RunsPage.tsx +15 -15
- package/apps/web/src/panel/StartPage.tsx +26 -26
- package/apps/web/src/panel/connection-state.ts +9 -9
- package/apps/web/src/panel/contract.ts +28 -28
- package/apps/web/src/panel.tsx +1 -1
- package/apps/web/src/plugin-bootstrap.ts +5 -5
- package/apps/web/src/product/ModelControl.tsx +3 -3
- package/apps/web/src/product/ProductModelSettings.tsx +16 -16
- package/apps/web/src/product/SystemPromptControl.tsx +11 -11
- package/apps/web/src/product/model-settings.ts +2 -2
- package/apps/web/src/rpc/client.ts +16 -16
- package/apps/web/src/rpc.ts +1 -1
- package/apps/web/src/run-overview.ts +1 -1
- package/apps/web/src/run-panel/RunPanelApp.tsx +39 -39
- package/apps/web/src/run-panel/RunPanelHeader.tsx +6 -6
- package/apps/web/src/run-panel/RunPanelMenu.tsx +6 -6
- package/apps/web/src/run-panel/RunPanelRail.tsx +4 -4
- package/apps/web/src/run-panel/RunPanelWorkspace.tsx +3 -3
- package/apps/web/src/run-panel/clipboard.ts +3 -3
- package/apps/web/src/run-panel/host-contract.ts +5 -5
- package/apps/web/src/run-panel/host.ts +15 -15
- package/apps/web/src/run-panel/input-bridge.ts +1 -1
- package/apps/web/src/run-panel/run-panel-location.ts +5 -5
- package/apps/web/src/run-panel/use-session-list.ts +1 -1
- package/apps/web/src/run-panel/workspace-state.ts +3 -3
- package/apps/web/src/run-panel.tsx +4 -4
- package/apps/web/src/run-preparation.ts +2 -2
- package/apps/web/src/run-view.ts +3 -3
- package/apps/web/src/settings-contributions.ts +32 -32
- package/apps/web/src/theme.ts +9 -9
- package/apps/web/src/title-model-settings.ts +6 -6
- package/apps/web/src/ui/ListDetail.tsx +9 -9
- package/apps/web/src/ui/dialog.tsx +2 -2
- package/apps/web/src/ui/modal-controller.ts +3 -3
- package/apps/web/src/ui/modal.tsx +2 -2
- package/apps/web/src/ui/popover.tsx +1 -1
- package/apps/web/src/ui/relative-time.ts +8 -8
- package/apps/web/src/ui/startup-notice.tsx +2 -2
- package/apps/web/src/ui/state-icon.tsx +1 -1
- package/apps/web/src/ui/state-vocabulary.ts +16 -16
- package/apps/web/src/ui/stop-button.tsx +2 -2
- package/bundles/ragents.activity/ragents-bundle.json +2 -2
- package/bundles/ragents.activity/web/classes.json +1 -1
- package/bundles/ragents.activity/web/index.js +1 -1
- package/bundles/ragents.activity/web/index.js.map +2 -2
- package/bundles/ragents.actor-programs/ragents-bundle.json +2 -2
- package/bundles/ragents.actor-programs/server/index.js +225 -225
- package/bundles/ragents.actor-programs/server/index.js.map +2 -2
- package/bundles/ragents.actor-programs/web/classes.json +1 -1
- package/bundles/ragents.actor-programs/web/index.js +1 -1
- package/bundles/ragents.actor-programs/web/index.js.map +3 -3
- package/bundles/ragents.ask/ragents-bundle.json +2 -2
- package/bundles/ragents.ask/server/chunks/{chunk-PDJO75SQ.js → chunk-YOV27MAR.js} +2 -2
- package/bundles/ragents.ask/server/chunks/chunk-YOV27MAR.js.map +7 -0
- package/bundles/ragents.ask/server/exports/server/contract.js +1 -1
- package/bundles/ragents.ask/server/index.js +23 -23
- package/bundles/ragents.ask/server/index.js.map +2 -2
- package/bundles/ragents.ask/web/chunks/{chunk-WFN4374U.js → chunk-D6NNB5DS.js} +1 -1
- package/bundles/ragents.ask/web/chunks/chunk-D6NNB5DS.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/{chunk-MBRPS477.js → chunk-IQBHK7MV.js} +2 -2
- package/bundles/ragents.ask/web/chunks/{chunk-MBRPS477.js.map → chunk-IQBHK7MV.js.map} +3 -3
- package/bundles/ragents.ask/web/chunks/chunk-PWFIAMX4.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-PWFIAMX4.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/chunk-QHGKEESD.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-QHGKEESD.js.map +7 -0
- package/bundles/ragents.ask/web/classes.json +1 -1
- package/bundles/ragents.ask/web/exports/ask-payload.js +1 -1
- package/bundles/ragents.ask/web/exports/web/QuestionCard.js +1 -1
- package/bundles/ragents.ask/web/exports/web/api.js +1 -1
- package/bundles/ragents.ask/web/index.js +1 -1
- package/bundles/ragents.ask/web/index.js.map +2 -2
- package/bundles/ragents.browser/executor/index.mjs +35 -35
- package/bundles/ragents.browser/executor/index.mjs.map +2 -2
- package/bundles/ragents.browser/ragents-bundle.json +2 -2
- package/bundles/ragents.browser/server/chunks/{chunk-CWLX4VA5.js → chunk-PYEISBNE.js} +1 -1
- package/bundles/ragents.browser/server/chunks/{chunk-CWLX4VA5.js.map → chunk-PYEISBNE.js.map} +1 -1
- package/bundles/ragents.browser/server/exports/server/contract.js +1 -1
- package/bundles/ragents.browser/server/index.js +31 -31
- package/bundles/ragents.browser/server/index.js.map +2 -2
- package/bundles/ragents.browser/skills/browser-testing/SKILL.md +30 -30
- package/bundles/ragents.documents/prompt.hbs +1 -1
- package/bundles/ragents.documents/ragents-bundle.json +2 -2
- package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js → chunk-KMZWOVTI.js} +3 -3
- package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js.map → chunk-KMZWOVTI.js.map} +2 -2
- package/bundles/ragents.documents/server/exports/contract.js +1 -1
- package/bundles/ragents.documents/server/index.js +26 -26
- package/bundles/ragents.documents/server/index.js.map +2 -2
- package/bundles/ragents.documents/web/classes.json +1 -1
- package/bundles/ragents.documents/web/index.js +1 -1
- package/bundles/ragents.documents/web/index.js.map +3 -3
- package/bundles/ragents.lsp-fsharp/executor/index.mjs +4 -4
- package/bundles/ragents.lsp-fsharp/executor/index.mjs.map +2 -2
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +2 -2
- package/bundles/ragents.lsp-fsharp/server/index.js +5 -5
- package/bundles/ragents.lsp-fsharp/server/index.js.map +2 -2
- package/bundles/ragents.lsp-fsharp/web/index.js +1 -1
- package/bundles/ragents.lsp-fsharp/web/index.js.map +2 -2
- package/bundles/ragents.lsp-roslyn/executor/index.mjs +3 -3
- package/bundles/ragents.lsp-roslyn/executor/index.mjs.map +2 -2
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +2 -2
- package/bundles/ragents.lsp-roslyn/server/index.js +17 -17
- package/bundles/ragents.lsp-roslyn/server/index.js.map +2 -2
- package/bundles/ragents.lsp-roslyn/web/index.js +1 -1
- package/bundles/ragents.lsp-roslyn/web/index.js.map +2 -2
- package/bundles/ragents.lsp-typescript/executor/index.mjs +2 -2
- package/bundles/ragents.lsp-typescript/executor/index.mjs.map +2 -2
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +2 -2
- package/bundles/ragents.lsp-typescript/server/index.js.map +1 -1
- package/bundles/ragents.lsp-typescript/web/index.js +1 -1
- package/bundles/ragents.lsp-typescript/web/index.js.map +2 -2
- package/bundles/ragents.model-relay/ragents-bundle.json +7 -3
- package/bundles/ragents.model-relay/server/index.js +25 -21
- package/bundles/ragents.model-relay/server/index.js.map +2 -2
- package/bundles/ragents.orchestration/ragents-bundle.json +2 -2
- package/bundles/ragents.orchestration/server/index.js +28 -28
- package/bundles/ragents.orchestration/server/index.js.map +2 -2
- package/bundles/ragents.orchestration/web/chunks/{chunk-OSKPH6SZ.js → chunk-CFMJD5ZI.js} +2 -2
- package/bundles/ragents.orchestration/web/chunks/chunk-HOBLI364.js +2 -0
- package/bundles/ragents.orchestration/web/chunks/{chunk-OQYCNYXN.js.map → chunk-HOBLI364.js.map} +2 -2
- package/bundles/ragents.orchestration/web/chunks/{chunk-ODMMQGX2.js → chunk-UCIMT2R4.js} +2 -2
- package/bundles/ragents.orchestration/web/classes.json +1 -1
- package/bundles/ragents.orchestration/web/exports/web/program-slot.js +1 -1
- package/bundles/ragents.orchestration/web/exports/web/surface-entities.js +1 -1
- package/bundles/ragents.orchestration/web/index.js +8 -8
- package/bundles/ragents.orchestration/web/index.js.map +2 -2
- package/bundles/ragents.overseer/ragents-bundle.json +2 -2
- package/bundles/ragents.overseer/server/index.js +98 -98
- package/bundles/ragents.overseer/server/index.js.map +2 -2
- package/bundles/ragents.overseer/web/classes.json +1 -1
- package/bundles/ragents.overseer/web/index.js +1 -1
- package/bundles/ragents.overseer/web/index.js.map +2 -2
- package/bundles/ragents.processes/ragents-bundle.json +2 -2
- package/bundles/ragents.processes/server/index.js +11 -11
- package/bundles/ragents.processes/server/index.js.map +2 -2
- package/bundles/ragents.processes/web/classes.json +1 -1
- package/bundles/ragents.processes/web/index.js +3 -3
- package/bundles/ragents.processes/web/index.js.map +2 -2
- package/bundles/ragents.product/ragents-bundle.json +2 -2
- package/bundles/ragents.product/server/index.js +12 -13
- package/bundles/ragents.product/server/index.js.map +2 -2
- package/bundles/ragents.product/web/classes.json +1 -1
- package/bundles/ragents.product/web/index.js +1 -1
- package/bundles/ragents.product/web/index.js.map +2 -2
- package/bundles/ragents.profile-distribution/ragents-bundle.json +2 -2
- package/bundles/ragents.profile-distribution/server/index.js +31 -31
- package/bundles/ragents.profile-distribution/server/index.js.map +2 -2
- package/bundles/ragents.reference/ragents-bundle.json +2 -2
- package/bundles/ragents.reference/run-scripts/balcony-wizard/RUN.md +19 -19
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +2 -2
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +14 -14
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +2 -2
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +49 -49
- package/bundles/ragents.reference/run-scripts/balcony-wizard/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/balcony-wizard/src/server.ts +9 -9
- package/bundles/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +9 -9
- package/bundles/ragents.reference/run-scripts/conversation-circle/RUN.md +7 -7
- package/bundles/ragents.reference/run-scripts/conversation-circle/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/conversation-circle/src/server.ts +13 -13
- package/bundles/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
- package/bundles/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +8 -8
- package/bundles/ragents.reference/run-scripts/learning-afternoon/RUN.md +16 -16
- package/bundles/ragents.reference/run-scripts/learning-afternoon/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -1
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +3 -3
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -1
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/server.ts +9 -9
- package/bundles/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +39 -39
- package/bundles/ragents.reference/run-scripts/moderated-round/RUN.md +7 -7
- package/bundles/ragents.reference/run-scripts/moderated-round/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/moderated-round/src/server.ts +9 -9
- package/bundles/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
- package/bundles/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +6 -6
- package/bundles/ragents.reference/run-scripts/shared-actor-list/RUN.md +12 -12
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +2 -2
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +3 -3
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +4 -4
- package/bundles/ragents.reference/run-scripts/shared-actor-list/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/shared-actor-list/src/server.ts +11 -11
- package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
- package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +13 -13
- package/bundles/ragents.reference/run-scripts/word-game/RUN.md +18 -18
- package/bundles/ragents.reference/run-scripts/word-game/package.json +2 -2
- package/bundles/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
- package/bundles/ragents.reference/run-scripts/word-game/src/contract.ts +2 -2
- package/bundles/ragents.reference/run-scripts/word-game/src/server.ts +16 -16
- package/bundles/ragents.reference/run-scripts/word-game/tests/program.test.ts +39 -39
- package/bundles/ragents.reference/skills/100-shared-actor-list/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/110-all-card-slots/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/150-editorial-workbench/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/160-learning-companion/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/170-photo-collection/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/180-decision-workbench/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/190-review-queue/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/20-circle-of-four/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/210-moderator-handover/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/220-actor-approval-list/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/230-shared-state-views/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/240-live-result-list/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/250-balcony-wizard/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/35-actor-input-fifo/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/40-subscription-matrix/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/50-subscription-removal/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/70-headless-counter/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/75-lsp-demo/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/80-actor-text-analysis/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/90-actor-notes/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/95-hello-world/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/decision-brief/SKILL.md +24 -24
- package/bundles/ragents.reference/skills/learning-sprint/SKILL.md +24 -24
- package/bundles/ragents.reference/web/classes.json +1 -1
- package/bundles/ragents.reference/web/index.js +1 -1
- package/bundles/ragents.reference/web/index.js.map +2 -2
- package/bundles/ragents.todo/ragents-bundle.json +2 -2
- package/bundles/ragents.todo/server/index.js +5 -5
- package/bundles/ragents.todo/server/index.js.map +2 -2
- package/bundles/ragents.todo/web/classes.json +1 -1
- package/bundles/ragents.todo/web/index.js +1 -1
- package/bundles/ragents.todo/web/index.js.map +2 -2
- package/bundles/ragents.transcript/ragents-bundle.json +2 -2
- package/bundles/ragents.transcript/server/index.js +11 -11
- package/bundles/ragents.transcript/server/index.js.map +2 -2
- package/bundles/ragents.watch/ragents-bundle.json +2 -2
- package/bundles/ragents.watch/server/index.js +48 -48
- package/bundles/ragents.watch/server/index.js.map +2 -2
- package/bundles/ragents.workspace/ragents-bundle.json +2 -2
- package/bundles/ragents.workspace/server/index.js +81 -81
- package/bundles/ragents.workspace/server/index.js.map +2 -2
- package/bundles/ragents.workspace/web/classes.json +1 -1
- package/bundles/ragents.workspace/web/index.js +1 -1
- package/bundles/ragents.workspace/web/index.js.map +2 -2
- package/package.json +4 -4
- package/packages/agent/dist/core/model-runtime.d.ts +7 -2
- package/packages/agent/dist/index.d.ts +1 -1
- package/packages/agent/dist/loop/agent-loop.d.ts +2 -2
- package/packages/agent/src/core/compaction/utils.ts +1 -1
- package/packages/agent/src/core/model-runtime.ts +45 -5
- package/packages/agent/src/index.ts +1 -1
- package/packages/agent/src/loop/agent-loop.ts +2 -2
- package/packages/ai/dist/models.d.ts +1 -0
- package/packages/ai/dist/models.generated.d.ts +4544 -983
- package/packages/ai/dist/providers/openrouter.models.d.ts +4544 -983
- package/packages/ai/src/api/ai-sdk.ts +33 -7
- package/packages/ai/src/api-registry.ts +1 -1
- package/packages/ai/src/index.ts +2 -2
- package/packages/ai/src/models.generated.ts +1 -1
- package/packages/ai/src/models.ts +1 -1
- package/packages/ai/src/providers/openrouter.models.ts +3723 -550
- package/packages/ragents/src/access.ts +12 -12
- package/packages/ragents/src/agents/actor-input.ts +33 -33
- package/packages/ragents/src/agents/catalog.ts +1 -1
- package/packages/ragents/src/agents/delivery.ts +17 -17
- package/packages/ragents/src/agents/plugins.ts +1 -1
- package/packages/ragents/src/agents/scheduler.ts +7 -7
- package/packages/ragents/src/agents/schemas.ts +1 -1
- package/packages/ragents/src/agents/tool-orientation.ts +4 -4
- package/packages/ragents/src/agents/tools.ts +20 -20
- package/packages/ragents/src/agents/toolset.ts +5 -5
- package/packages/ragents/src/agents/workspaces.ts +1 -1
- package/packages/ragents/src/domain/events.ts +1 -1
- package/packages/ragents/src/domain/model.ts +5 -5
- package/packages/ragents/src/drivers/agent-runtime.ts +1 -1
- package/packages/ragents/src/drivers/agent-turn.ts +4 -4
- package/packages/ragents/src/drivers/agent.ts +2 -2
- package/packages/ragents/src/drivers/attachments.ts +4 -4
- package/packages/ragents/src/http/contracts.ts +14 -14
- package/packages/ragents/src/http/methods.ts +6 -6
- package/packages/ragents/src/plugin-host.ts +119 -119
- package/packages/ragents/src/plugin-types.ts +16 -16
- package/packages/ragents/src/rpc/contract.ts +5 -5
- package/packages/ragents/src/rpc/contribution.ts +2 -2
- package/packages/ragents/src/rpc/peer.ts +11 -11
- package/packages/ragents/src/rpc/protocol.ts +2 -2
- package/packages/ragents/src/runtime/decisions/turns.ts +1 -1
- package/packages/ragents/src/runtime/journal.ts +10 -10
- package/packages/ragents/src/runtime/orchestration.ts +8 -8
- package/packages/ragents/src/runtime/stop.ts +2 -2
- package/packages/ragents/src/script/mediators.ts +35 -35
- package/packages/ragents/src/typescript/async-compiler.ts +14 -14
- package/packages/ragents/src/typescript/compiler-worker.ts +2 -2
- package/packages/ragents/src/typescript/compiler.ts +7 -7
- package/packages/ragents/src/typescript/snippet.ts +5 -5
- package/packages/workspace-executor/src/bash-launch.ts +13 -13
- package/packages/workspace-executor/src/commands.ts +18 -18
- package/packages/workspace-executor/src/context.ts +15 -15
- package/packages/workspace-executor/src/contributions.ts +35 -35
- package/packages/workspace-executor/src/errors.ts +1 -1
- package/packages/workspace-executor/src/executor.ts +15 -15
- package/packages/workspace-executor/src/files.ts +30 -30
- package/packages/workspace-executor/src/language-server/contract.ts +2 -2
- package/packages/workspace-executor/src/language-server/diagnostics.ts +4 -4
- package/packages/workspace-executor/src/language-server/host.ts +35 -35
- package/packages/workspace-executor/src/language-server/json-rpc.ts +4 -4
- package/packages/workspace-executor/src/language-server/module.ts +11 -11
- package/packages/workspace-executor/src/language-server/roots.ts +3 -3
- package/packages/workspace-executor/src/language-server/session.ts +15 -15
- package/packages/workspace-executor/src/language-server/workspace-solutions.ts +2 -2
- package/packages/workspace-executor/src/managed-process.ts +12 -12
- package/packages/workspace-executor/src/module.ts +8 -8
- package/packages/workspace-executor/src/modules.ts +3 -3
- package/packages/workspace-executor/src/paths.ts +11 -11
- package/packages/workspace-executor/src/process-sandbox.ts +3 -3
- package/packages/workspace-executor/src/processes/module.ts +3 -3
- package/packages/workspace-executor/src/processes/process-table.ts +20 -20
- package/packages/workspace-executor/src/processes/scanner.ts +3 -3
- package/packages/workspace-executor/src/processes/snapshot.ts +2 -2
- package/packages/workspace-executor/src/processes/terminator.ts +13 -13
- package/packages/workspace-executor/src/run-folders.ts +3 -3
- package/packages/workspace-executor/src/safe-environment.ts +4 -4
- package/packages/workspace-executor/src/sandbox-tools.ts +28 -28
- package/packages/workspace-executor/src/session-ident.ts +2 -2
- package/packages/workspace-executor/src/shell-platform.ts +2 -2
- package/packages/workspace-executor/src/tools.ts +5 -5
- package/plugins/ragents.activity/web/ActivityHeader.tsx +3 -3
- package/plugins/ragents.activity/web/activity.ts +2 -2
- package/plugins/ragents.actor-programs/server/access-projections.ts +1 -1
- package/plugins/ragents.actor-programs/server/agent-tools.ts +2 -2
- package/plugins/ragents.actor-programs/server/capability-resolver.ts +3 -3
- package/plugins/ragents.actor-programs/server/controls-template.ts +46 -46
- package/plugins/ragents.actor-programs/server/controls-tool.ts +4 -4
- package/plugins/ragents.actor-programs/server/limits.ts +3 -3
- package/plugins/ragents.actor-programs/server/methods.ts +1 -1
- package/plugins/ragents.actor-programs/server/project-diagnostics.ts +8 -8
- package/plugins/ragents.actor-programs/server/routes.ts +8 -8
- package/plugins/ragents.actor-programs/server/runtime.ts +90 -90
- package/plugins/ragents.actor-programs/server/templates.ts +59 -59
- package/plugins/ragents.actor-programs/server/test-report.ts +5 -5
- package/plugins/ragents.actor-programs/server/tool-contributor.ts +1 -1
- package/plugins/ragents.actor-programs/web/ActorViewFrame.tsx +17 -17
- package/plugins/ragents.actor-programs/web/AppsPanel.tsx +26 -26
- package/plugins/ragents.actor-programs/web/EmbeddedApps.tsx +3 -3
- package/plugins/ragents.actor-programs/web/FullscreenHost.tsx +2 -2
- package/plugins/ragents.actor-programs/web/FunctionForm.tsx +16 -16
- package/plugins/ragents.actor-programs/web/ProgramSource.tsx +5 -5
- package/plugins/ragents.actor-programs/web/api.ts +36 -36
- package/plugins/ragents.actor-programs/web/bridge.ts +8 -8
- package/plugins/ragents.actor-programs/web/chat-state.ts +4 -4
- package/plugins/ragents.actor-programs/web/context.ts +1 -1
- package/plugins/ragents.actor-programs/web/function-input.ts +6 -6
- package/plugins/ragents.actor-programs/web/index.tsx +1 -1
- package/plugins/ragents.actor-programs/web/program-state.ts +4 -4
- package/plugins/ragents.ask/ask-payload.ts +1 -1
- package/plugins/ragents.ask/contract.ts +5 -5
- package/plugins/ragents.ask/server/answer-method.ts +1 -1
- package/plugins/ragents.ask/server/ask-service.ts +9 -9
- package/plugins/ragents.ask/server/ask-tool.ts +10 -10
- package/plugins/ragents.ask/server/contract.ts +5 -5
- package/plugins/ragents.ask/web/AskActionView.tsx +1 -1
- package/plugins/ragents.ask/web/QuestionCard.tsx +22 -22
- package/plugins/ragents.ask/web/index.tsx +2 -2
- package/plugins/ragents.browser/executor/contract.ts +6 -6
- package/plugins/ragents.browser/executor/index.ts +1 -1
- package/plugins/ragents.browser/executor/module.ts +6 -6
- package/plugins/ragents.browser/executor/pages.ts +32 -32
- package/plugins/ragents.browser/executor/playwright.ts +8 -8
- package/plugins/ragents.browser/provision.ts +7 -7
- package/plugins/ragents.browser/server/browser.ts +14 -14
- package/plugins/ragents.browser/server/contract.ts +1 -1
- package/plugins/ragents.browser/server/index.ts +1 -1
- package/plugins/ragents.browser/server/tools.ts +14 -14
- package/plugins/ragents.browser/skills/browser-testing/SKILL.md +30 -30
- package/plugins/ragents.documents/contract.ts +2 -2
- package/plugins/ragents.documents/prompt.hbs +1 -1
- package/plugins/ragents.documents/server/document-write-tool.ts +12 -12
- package/plugins/ragents.documents/server/files-route.ts +6 -6
- package/plugins/ragents.documents/server/show-document-tool.ts +26 -26
- package/plugins/ragents.documents/server/store.ts +1 -1
- package/plugins/ragents.documents/web/DocumentViewer.tsx +37 -37
- package/plugins/ragents.documents/web/index.tsx +11 -11
- package/plugins/ragents.lsp-fsharp/executor.ts +7 -7
- package/plugins/ragents.lsp-fsharp/provision.ts +7 -7
- package/plugins/ragents.lsp-roslyn/executor.ts +5 -5
- package/plugins/ragents.lsp-roslyn/provision.ts +4 -4
- package/plugins/ragents.lsp-roslyn/server/index.ts +5 -5
- package/plugins/ragents.lsp-roslyn/server/solution-on-start.ts +13 -13
- package/plugins/ragents.lsp-typescript/executor.ts +3 -3
- package/plugins/ragents.model-relay/server/config.ts +6 -2
- package/plugins/ragents.model-relay/server/index.ts +2 -2
- package/plugins/ragents.model-relay/server/relay.ts +23 -22
- package/plugins/ragents.orchestration/contract.ts +8 -8
- package/plugins/ragents.orchestration/server/index.ts +4 -4
- package/plugins/ragents.orchestration/server/run-stop-tool.ts +3 -3
- package/plugins/ragents.orchestration/server/surface-tool.ts +5 -5
- package/plugins/ragents.orchestration/tiled-layout.ts +11 -11
- package/plugins/ragents.orchestration/web/ActorChat.tsx +2 -2
- package/plugins/ragents.orchestration/web/ActorChatControls.tsx +4 -4
- package/plugins/ragents.orchestration/web/ActorChatPreview.tsx +1 -1
- package/plugins/ragents.orchestration/web/ActorPopout.tsx +1 -1
- package/plugins/ragents.orchestration/web/ActorShortcut.tsx +6 -6
- package/plugins/ragents.orchestration/web/ActorSurfaceControls.tsx +15 -15
- package/plugins/ragents.orchestration/web/Center.tsx +5 -5
- package/plugins/ragents.orchestration/web/DocumentsSection.tsx +2 -2
- package/plugins/ragents.orchestration/web/ExecutionsPanel.tsx +15 -15
- package/plugins/ragents.orchestration/web/FlowInspector.tsx +103 -103
- package/plugins/ragents.orchestration/web/JournalStatus.tsx +11 -11
- package/plugins/ragents.orchestration/web/MaterialBody.tsx +2 -2
- package/plugins/ragents.orchestration/web/StopRunButton.tsx +6 -6
- package/plugins/ragents.orchestration/web/TiledSurface.tsx +9 -9
- package/plugins/ragents.orchestration/web/actor-header-settings.ts +5 -5
- package/plugins/ragents.orchestration/web/constants.ts +2 -2
- package/plugins/ragents.orchestration/web/executions.ts +6 -6
- package/plugins/ragents.orchestration/web/format.ts +1 -1
- package/plugins/ragents.orchestration/web/index.tsx +2 -2
- package/plugins/ragents.orchestration/web/run-panel/AddresseeControl.tsx +7 -7
- package/plugins/ragents.orchestration/web/run-panel/AddresseeTree.tsx +8 -8
- package/plugins/ragents.orchestration/web/run-panel/RunPanel.tsx +22 -22
- package/plugins/ragents.orchestration/web/run-panel/RunPanelSettings.tsx +7 -7
- package/plugins/ragents.orchestration/web/run-panel/addressee-tree.ts +13 -13
- package/plugins/ragents.orchestration/web/run-panel/run-panel-actors.ts +3 -3
- package/plugins/ragents.orchestration/web/run-panel/run-panel-settings.ts +2 -2
- package/plugins/ragents.orchestration/web/run-panel/run-panel-startup.ts +3 -3
- package/plugins/ragents.orchestration/web/run-panel/run-panel-state.ts +7 -7
- package/plugins/ragents.orchestration/web/run-panel/sheet-status.ts +9 -9
- package/plugins/ragents.orchestration/web/surface-startup.ts +8 -8
- package/plugins/ragents.orchestration/web/surface-view-settings.ts +1 -1
- package/plugins/ragents.orchestration/web/tiled-view-settings.ts +1 -1
- package/plugins/ragents.overseer/contract.ts +20 -20
- package/plugins/ragents.overseer/server/api.ts +6 -6
- package/plugins/ragents.overseer/server/coordinator-prompt.ts +10 -10
- package/plugins/ragents.overseer/server/coordinator.ts +4 -4
- package/plugins/ragents.overseer/server/index.ts +24 -24
- package/plugins/ragents.overseer/server/orientation.ts +8 -8
- package/plugins/ragents.overseer/server/quick-answer.ts +9 -9
- package/plugins/ragents.overseer/server/run-directory.ts +5 -5
- package/plugins/ragents.overseer/server/settings.ts +6 -6
- package/plugins/ragents.overseer/server/user-location.ts +16 -16
- package/plugins/ragents.overseer/web/ModelSettings.tsx +9 -9
- package/plugins/ragents.overseer/web/index.tsx +20 -20
- package/plugins/ragents.overseer/web/model-settings.ts +1 -1
- package/plugins/ragents.overseer/web/quick-answers.ts +2 -2
- package/plugins/ragents.processes/contract.ts +5 -5
- package/plugins/ragents.processes/server/methods.ts +4 -4
- package/plugins/ragents.processes/server/observer.ts +8 -8
- package/plugins/ragents.processes/server/run-processes.ts +2 -2
- package/plugins/ragents.processes/web/ProcessHeader.tsx +10 -10
- package/plugins/ragents.processes/web/processes.ts +10 -10
- package/plugins/ragents.product/server/config.ts +1 -1
- package/plugins/ragents.product/server/index.ts +4 -4
- package/plugins/ragents.product/server/runtime.ts +9 -10
- package/plugins/ragents.product/web/index.tsx +1 -1
- package/plugins/ragents.profile-distribution/contract.ts +10 -10
- package/plugins/ragents.profile-distribution/server/archive.ts +20 -20
- package/plugins/ragents.profile-distribution/server/config.ts +2 -2
- package/plugins/ragents.profile-distribution/server/index.ts +4 -4
- package/plugins/ragents.reference/examples.ts +27 -27
- package/plugins/ragents.reference/run-scripts/balcony-wizard/RUN.md +19 -19
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +2 -2
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +14 -14
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +2 -2
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +49 -49
- package/plugins/ragents.reference/run-scripts/balcony-wizard/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/balcony-wizard/src/server.ts +9 -9
- package/plugins/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +9 -9
- package/plugins/ragents.reference/run-scripts/conversation-circle/RUN.md +7 -7
- package/plugins/ragents.reference/run-scripts/conversation-circle/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/conversation-circle/src/server.ts +13 -13
- package/plugins/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +8 -8
- package/plugins/ragents.reference/run-scripts/learning-afternoon/RUN.md +16 -16
- package/plugins/ragents.reference/run-scripts/learning-afternoon/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +3 -3
- package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/server.ts +9 -9
- package/plugins/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +39 -39
- package/plugins/ragents.reference/run-scripts/moderated-round/RUN.md +7 -7
- package/plugins/ragents.reference/run-scripts/moderated-round/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/moderated-round/src/server.ts +9 -9
- package/plugins/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +6 -6
- package/plugins/ragents.reference/run-scripts/shared-actor-list/RUN.md +12 -12
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +2 -2
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +3 -3
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +4 -4
- package/plugins/ragents.reference/run-scripts/shared-actor-list/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/shared-actor-list/src/server.ts +11 -11
- package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +13 -13
- package/plugins/ragents.reference/run-scripts/word-game/RUN.md +18 -18
- package/plugins/ragents.reference/run-scripts/word-game/package.json +2 -2
- package/plugins/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
- package/plugins/ragents.reference/run-scripts/word-game/src/contract.ts +2 -2
- package/plugins/ragents.reference/run-scripts/word-game/src/server.ts +16 -16
- package/plugins/ragents.reference/run-scripts/word-game/tests/program.test.ts +39 -39
- package/plugins/ragents.reference/skills/100-shared-actor-list/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/110-all-card-slots/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/150-editorial-workbench/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/160-learning-companion/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/170-photo-collection/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/180-decision-workbench/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/190-review-queue/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/20-circle-of-four/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/210-moderator-handover/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/220-actor-approval-list/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/230-shared-state-views/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/240-live-result-list/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/250-balcony-wizard/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/35-actor-input-fifo/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/40-subscription-matrix/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/50-subscription-removal/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/70-headless-counter/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/75-lsp-demo/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/80-actor-text-analysis/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/90-actor-notes/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/95-hello-world/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/decision-brief/SKILL.md +24 -24
- package/plugins/ragents.reference/skills/learning-sprint/SKILL.md +24 -24
- package/plugins/ragents.reference/walkthroughs.ts +128 -128
- package/plugins/ragents.reference/web/StartGuides.tsx +23 -23
- package/plugins/ragents.todo/server/todo-tool.ts +6 -6
- package/plugins/ragents.todo/web/TodoSection.tsx +1 -1
- package/plugins/ragents.transcript/server/transcript.ts +11 -11
- package/plugins/ragents.watch/server/condition.ts +4 -4
- package/plugins/ragents.watch/server/functions.ts +27 -27
- package/plugins/ragents.watch/server/observation.ts +2 -2
- package/plugins/ragents.watch/server/service.ts +14 -14
- package/plugins/ragents.workspace/client/transport.ts +1 -1
- package/plugins/ragents.workspace/client/workspace-client.ts +54 -54
- package/plugins/ragents.workspace/contract.ts +46 -46
- package/plugins/ragents.workspace/server/binding.ts +20 -20
- package/plugins/ragents.workspace/server/browse-route.ts +8 -8
- package/plugins/ragents.workspace/server/clients.ts +42 -42
- package/plugins/ragents.workspace/server/config.ts +7 -7
- package/plugins/ragents.workspace/server/index.ts +3 -3
- package/plugins/ragents.workspace/server/runtime.ts +26 -26
- package/plugins/ragents.workspace/server/shell-platform.ts +1 -1
- package/plugins/ragents.workspace/web/FileBrowser.tsx +10 -10
- package/plugins/ragents.workspace/web/WorkspaceBinding.tsx +24 -24
- package/plugins/ragents.workspace/web/index.tsx +1 -1
- package/ragents.config.core.ts +1 -1
- package/ragents.config.developer.ts +3 -3
- package/ragents.config.showcase.ts +2 -2
- package/scripts/agent/agent-cli.ts +96 -96
- package/scripts/agent/journal.ts +5 -5
- package/scripts/agent/turn-control.ts +4 -4
- package/scripts/package/build-package.ts +29 -29
- package/scripts/package/host-links.mjs +3 -3
- package/scripts/package/publish-package.ts +29 -29
- package/scripts/package/ragents.mjs +19 -19
- package/scripts/plugin/build-builtin-plugins.ts +5 -5
- package/scripts/plugin/plugin-cli.ts +14 -14
- package/scripts/provision/run-provision.ts +14 -15
- package/scripts/remote/connect.ts +46 -46
- package/scripts/remote/start.ts +18 -18
- package/scripts/workspace-client/run-workspace-client.ts +23 -23
- package/apps/web/dist/assets/main-DnnqWHkH.js +0 -11
- package/apps/web/dist/assets/mermaid-HWGCJPDP-BLLeth5_.js +0 -568
- package/apps/web/dist/assets/runPanel-DPm7s3KM.js +0 -21
- package/bundles/ragents.ask/server/chunks/chunk-PDJO75SQ.js.map +0 -7
- package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js +0 -2
- package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js.map +0 -7
- package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js +0 -2
- package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js.map +0 -7
- package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js.map +0 -7
- package/bundles/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js +0 -2
- /package/bundles/ragents.orchestration/web/chunks/{chunk-OSKPH6SZ.js.map → chunk-CFMJD5ZI.js.map} +0 -0
- /package/bundles/ragents.orchestration/web/chunks/{chunk-ODMMQGX2.js.map → chunk-UCIMT2R4.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
["!error","!latest","--background","--border","--card","--primary","@container","@max-[470px]:grid-cols-[34px_minmax(0,1fr)_14px]","@max-[470px]:hidden","@reviewer","[&>[data-slot=host-confirmation]]:flex-[0_1_auto]","[&>[data-slot=host-confirmation]]:max-h-[65%]","[&>[data-slot=host-confirmation]]:overflow-auto","[&_small]:col-start-2","[&_small]:font-normal","[&_small]:text-[0.61rem]","[&_small]:text-muted-foreground","[animation-duration:1.2s]","[overflow-wrap:anywhere]","[scrollbar-width:thin]","a","abgebrochen","abgeschlossen","abort","absolute","accent-primary","access","action","actionError","actionId","actionIds","actions","activate","active","activeActorInvocations","activeActors","activeInvocations","activeKey","actor","actor-programs","actorByHandle","actorChatMessages","actorFunctionInput","actorFunctionParameterTypes","actorHandle","actorId","actorProgramApps","actorProgramContracts","actorProgramSourceFileFrom","actorProgramSourceFrom","actorProgramSourceReference","actorProgramSourceView","actorProgramSurfaceElements","actorProgramViews","actorProgramsListingFrom","actorProgramsRevision","actors","after:absolute","after:bg-primary","after:bottom-0","after:content-['']","after:h-[3px]","after:inset-x-0","after:pointer-events-none","aktiv","alert","allow","allow-downloads","allow-forms","allow-scripts","als","anchorActorId","angeforderte","animate-fade-pulse","answer","answerQuestion","any","anzeigen","api","app","appId","appIds","appRef","apps","aria-description","aria-expanded","aria-hidden","aria-label","aria-live","as","ask/ask-payload","askedBy","async","attachBridge","attachmentCapabilities","attachmentCapabilitiesError","attachments","auf","aufrufen","aus","ausblenden","await","base","before:absolute","before:border-border-strong","before:border-dashed","before:border-l","before:bottom-1/4","before:content-['']","before:left-0","before:pointer-events-none","before:top-1/4","bei","bereits","bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))]","bg-accent","bg-background","bg-background/70","bg-card","bg-destructive","bg-foreground/4","bg-glass-app","bg-muted-foreground/55","bg-primary","bg-primary/12","bg-primary/9","bg-success","bg-transparent","bg-warning","bg-warning-soft","bis","boolean","border","border-0","border-[color-mix(in_srgb,var(--primary)_48%,var(--border))]","border-b","border-border","border-border-soft","border-info/25","border-input","border-r","border-r-0","brauchen","bridgeConnectedRef","bridgeGenerationRef","bridgeReady","bridgeToken","bubbles","busy","button","byteLength","camera","canArrange","canInspect","cancelable","cancelled","canvas","capabilities","captured","card","cardSections","case","catch","caught","cause","changed","chat","chat-ack","chat-send","chat-state","chat-unwatch","chat-watch","chatCapabilities","chatSnapshotOf","checkbox","className","closeBridge","closeFullscreen","closeRef","cn","common","compact","configuredPlugin","confirm","confirmation","confirmationAction","confirmationInvocation","connect","connected","const","content","contentWindow","controller","controllerRef","conversationError","createActorProgramsApi","createContext","createdAt","current","currentActorListing","currentColor","currentViews","cursor-pointer","darf","data","data-slot","default","defaultValue","dem","den","depth","der","des","description","descriptor","destructive","detail","die","diese","diesem","diesen","dieses","disabled","disposed","doppelte","draggable","driver","effectAllowed","eigenen","ein","eine","einen","einer","eines","else","embedded","encodes","entity","entry","entryIconClass","entspricht","er","erforderlich","error","erscheinen","erstellte","escape","eslint-disable-next-line","event","executeRequest","exists","expandedByDefault","export","failed","failure","false","fehlgeschlagen","fehlt","field","files","fill","finally","finish","finished","finishedAt","flex","flex-1","flex-[0_0_28px]","flex-[0_0_31px]","flex-col","flex-none","flex-wrap","focus-visible:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]","focus-visible:border-[color-mix(in_srgb,var(--primary)_52%,var(--border))]","focus-visible:outline-2","focus-visible:outline-offset-2","focus-visible:outline-primary/52","focus-within:bg-accent","font-[650]","font-bold","font-mono","font-normal","font-semibold","for","form","frame","frame-ready","frameBase","frameError","frameUrl","fresh","from","fulfilled","full","fullscreen","fullscreenAppId","function","functionId","functionInvocation","gap-0","gap-0.5","gap-1.5","gap-2","gap-2.5","gap-3","gap-3.5","gap-[22px]","gap-[3px]","gap-[7px]","gap-[9px]","gap-px","gap-x-1.5","geladen","generation","geolocation","gesendet","gestartet","gestoppt","get-state","getAttachmentCapabilities","getrennt","grid","grid-cols-2","grid-cols-[34px_minmax(0,1fr)_auto_14px]","grid-cols-[42px_minmax(0,1fr)]","grid-cols-[8px_auto_minmax(0,1fr)]","grid-cols-[auto_minmax(0,1fr)]","grid-cols-[minmax(0,1fr)]","group","h-7","h-8","h-[31px]","h-[calc(100%-2*clamp(16px,2vw,24px))]","h-full","handle","handleLoad","handlePortMessage","hast","hat","headClass","height","host-confirmation","hostInput","hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]","hover:bg-accent","hover:border-[color-mix(in_srgb,var(--primary)_52%,var(--border))]","hover:not-disabled:bg-transparent","human","icon","icon-sm","id","idFrom","ids","if","iframeRef","ihre","ihrem","im","import","in","includeFunctions","initialFocus","initialLoaded","input","inputWithinLimit","inset-0","inspect","installed","installedApp","installedBy","installiert","installierte","installierten","instanceof","integer","interface","invocation","invocationId","invocationIds","invocationSignature","invocationTime","invocations","invoke","invokeActorFunction","invokeFunction","is","isJsonValue","isRecord","ist","items-center","items-start","items-stretch","json","justify-center","justify-items-start","kann","kein","keine","key","keyOf","keydown","kind","konnten","label","latest","latestInvocation","leading-[1.45]","leer","length","let","line","list","listing","load","loadRevision","loading","lucide-react","m-0","m9","m9.5","markTones","max-h-[320px]","max-h-[340px]","max-w-[132px]","max-w-[214px]","max-w-full","mb-1","mb-2","md:text-sm","mehr","message","messages","microphone","min-h-0","min-h-8","min-w-0","minted","ml-2","moduleId","moduleRevision","motion-reduce:animate-none","move","mt-1","multi","muss","muted","name","names","needsAnswer","needsRunView","neu","new","next","nicht","nimmt","no-referrer","noch","none","nothing","null","number","oder","of","ok","oldest","on","onAnswer","onClick","onDragStart","onOpenChange","onSubmit","once","onmessage","onmessageerror","open","openFullscreen","optionalString","options","or","order","order-1","origin","outline","output","overflow-auto","overflow-hidden","overflow-y-auto","owner","ownerId","p-0","p-2.5","parameter","parameters","parseParameter","parsed","path","pb-5","pb-7","pending","pendingConfirmationFor","pendingConfirmationInvocationId","pendingPort","per","pl-4","place-items-center","placeholder","placement","placements","platziert","pluginId","pluginStates","polite","poll","port","portRef","postError","pr-3","presentation","primary","pro","program","programActors","programChatNotice","pt-3","pt-[18px]","publish","purpose","px-2","px-2.5","px-[11px]","px-[9px]","px-workspace-inset","py-1","py-2","py-2.5","py-[5px]","py-[9px]","quassel/events","question","queued","quick-list","quickIconClass","raw","rawPlacements","react","react-hooks/exhaustive-deps","readActorInvocation","readOnly","readRight","readonly","ready","reason","receiveReady","recentRequestIdsRef","reduce","ref","referrerPolicy","refresh","rejected","relative","relayFrameInput","render","replaceInvocation","request","requestId","requestIdFrom","required","requiredString","resize-y","resolveChatActor","result","results","return","revision","role","round","rounded-[10px]","rounded-full","rounded-lg","rounded-md","routePrefix","rows","rpc","run","run-app","runActorFrom","runAppActionFrom","runAppFrom","runAppInvocationFrom","runAppPlacementFrom","runId","runScriptToolFrom","runToolParameterFrom","runToolTargetFrom","runView","runViewFrom","running","runs","s","sandbox","saved","scope","script","secondary","sectionLabelClass","segment","sein","selbst","select","selectClass","selected","selectedName","selection","sendActorMessage","sendChatState","sendState","sentInvocationsRef","sentStateRef","session","sessionHeaders","sessionRef","setActionError","setActivePath","setBridgeReady","setBusy","setError","setExpanded","setFrameError","setFullscreen","setInvocation","setListing","setState","setSubmitting","shadow-[0_0_0_4px_color-mix(in_srgb,var(--primary)_12%,transparent)]","showCloseButton","signal","signature","sind","size","size-[30px]","size-[34px]","size-[42px]","size-[7px]","slot","sm","snapshot","source","sourceHash","src","src/server.ts","stage","startedAt","state","stateSignature","states","status","step","stopped","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","submit","succeeded","success","surface","surfaceElements","switch","target","targetLabel","targets","text","text-[0.61rem]","text-[0.63rem]","text-[0.66rem]","text-[0.67rem]","text-[0.68rem]","text-[0.69rem]","text-[0.72rem]","text-[0.74rem]","text-[0.75rem]","text-[0.7rem]","text-[0.82rem]","text-[0.8rem]","text-[0.9rem]","text-[1.05rem]","text-base","text-destructive","text-foreground","text-info","text-left","text-muted-foreground","text-primary","text-sm","text-xs","the","theme","themeRef","throw","tiled","timeout","timer","title","token","tone","tool","tools","tracking-[0.075em]","transition-[background-color,border-color]","true","truncate","try","type","typeof","unbekannte","unbekannten","und","undefined","unique","unknown","unlesbare","unterbrochen","updates","uppercase","url","useAccess","useActorPrograms","useContext","useMemo","useOptionalActorPrograms","useRef","useResolvedTheme","useState","useSurfaceEntities","uses","validateRunAppBridgeRequest","validation","value","values","variant","verarbeitet","verbunden","verlassen","version","versuchen","verweist","verwendet","view","viewBox","visible","visibleApps","visibleStatus","void","von","w-[38px]","w-[calc(100%-2*clamp(16px,2vw,24px))]","w-full","waitForPoll","watchedChats","webPlugin","werden","while","whitespace-nowrap","whitespace-pre-wrap","width","wie","wird","withAccessToken","workspaceTabs","writable","writableRef","write","wurde","zu","zum","zur"]
|
|
1
|
+
["!error","!latest","--background","--border","--card","--primary","@container","@max-[470px]:grid-cols-[34px_minmax(0,1fr)_14px]","@max-[470px]:hidden","@reviewer","[&>[data-slot=host-confirmation]]:flex-[0_1_auto]","[&>[data-slot=host-confirmation]]:max-h-[65%]","[&>[data-slot=host-confirmation]]:overflow-auto","[&_small]:col-start-2","[&_small]:font-normal","[&_small]:text-[0.61rem]","[&_small]:text-muted-foreground","[animation-duration:1.2s]","[overflow-wrap:anywhere]","[scrollbar-width:thin]","a","abort","absolute","accent-primary","accepts","access","action","actionError","actionId","actionIds","actions","activate","active","activeActorInvocations","activeActors","activeInvocations","activeKey","actor","actor-programs","actorByHandle","actorChatMessages","actorFunctionInput","actorFunctionParameterTypes","actorHandle","actorId","actorProgramApps","actorProgramContracts","actorProgramSourceFileFrom","actorProgramSourceFrom","actorProgramSourceReference","actorProgramSourceView","actorProgramSurfaceElements","actorProgramViews","actorProgramsListingFrom","actorProgramsRevision","actors","after:absolute","after:bg-primary","after:bottom-0","after:content-['']","after:h-[3px]","after:inset-x-0","after:pointer-events-none","agent","agents","alert","allow","allow-downloads","allow-forms","allow-scripts","already","an","anchorActorId","and","animate-fade-pulse","answer","answerQuestion","any","api","app","appId","appIds","appRef","appear","apps","are","aria-description","aria-expanded","aria-hidden","aria-label","aria-live","as","ask/ask-payload","askedBy","async","at","attachBridge","attachmentCapabilities","attachmentCapabilitiesError","attachments","available","await","base","be","been","before:absolute","before:border-border-strong","before:border-dashed","before:border-l","before:bottom-1/4","before:content-['']","before:left-0","before:pointer-events-none","before:top-1/4","belongs","bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))]","bg-accent","bg-background","bg-background/70","bg-card","bg-destructive","bg-foreground/4","bg-glass-app","bg-muted-foreground/55","bg-primary","bg-primary/12","bg-primary/9","bg-success","bg-transparent","bg-warning","bg-warning-soft","boolean","border","border-0","border-[color-mix(in_srgb,var(--primary)_48%,var(--border))]","border-b","border-border","border-border-soft","border-info/25","border-input","border-r","border-r-0","bridge","bridgeConnectedRef","bridgeGenerationRef","bridgeReady","bridgeToken","bubbles","build","busy","button","by","byteLength","call","camera","canArrange","canInspect","cancelable","cancelled","cannot","canvas","capabilities","captured","card","cardSections","case","catch","caught","cause","changed","chat","chat-ack","chat-send","chat-state","chat-unwatch","chat-watch","chatCapabilities","chatSnapshotOf","checkbox","className","click","close","closeBridge","closeFullscreen","closeRef","cn","code","common","compact","completed","configuredPlugin","confirm","confirmation","confirmationAction","confirmationInvocation","connect","connected","connection","const","contains","content","contentWindow","contract","controller","controllerRef","conversationError","could","createActorProgramsApi","createContext","created","createdAt","current","currentActorListing","currentColor","currentViews","cursor-pointer","data","data-slot","decision","default","defaultValue","depth","description","descriptor","destructive","detail","did","disabled","disconnected","disposed","does","draggable","driver","duplicate","effectAllowed","else","embedded","empty","encodes","enter","entity","entries","entry","entryIconClass","error","escape","eslint-disable-next-line","event","executeRequest","execution","exists","expandedByDefault","export","failed","failure","false","field","file","files","fill","finally","finish","finished","finishedAt","flex","flex-1","flex-[0_0_28px]","flex-[0_0_31px]","flex-col","flex-none","flex-wrap","focus-visible:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]","focus-visible:border-[color-mix(in_srgb,var(--primary)_52%,var(--border))]","focus-visible:outline-2","focus-visible:outline-offset-2","focus-visible:outline-primary/52","focus-within:bg-accent","font-[650]","font-bold","font-mono","font-normal","font-semibold","for","form","frame","frame-ready","frameBase","frameError","frameUrl","fresh","from","fulfilled","full","fullscreen","fullscreenAppId","function","functionId","functionInvocation","functions","gap-0","gap-0.5","gap-1.5","gap-2","gap-2.5","gap-3","gap-3.5","gap-[22px]","gap-[3px]","gap-[7px]","gap-[9px]","gap-px","gap-x-1.5","generation","geolocation","get-state","getAttachmentCapabilities","grid","grid-cols-2","grid-cols-[34px_minmax(0,1fr)_auto_14px]","grid-cols-[42px_minmax(0,1fr)]","grid-cols-[8px_auto_minmax(0,1fr)]","grid-cols-[auto_minmax(0,1fr)]","grid-cols-[minmax(0,1fr)]","group","h-7","h-8","h-[31px]","h-[calc(100%-2*clamp(16px,2vw,24px))]","h-full","handle","handleLoad","handlePortMessage","has","hash","have","headClass","height","host","host-confirmation","hostInput","hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]","hover:bg-accent","hover:border-[color-mix(in_srgb,var(--primary)_52%,var(--border))]","hover:not-disabled:bg-transparent","human","icon","icon-sm","id","idFrom","identifier","identifiers","ids","if","iframeRef","import","in","includeFunctions","initialFocus","initialLoaded","input","inputWithinLimit","inset-0","inspect","installed","installedApp","installedBy","instanceof","integer","interface","interrupted","invalid","invocation","invocationId","invocationIds","invocationSignature","invocationTime","invocations","invoke","invokeActorFunction","invokeFunction","is","isJsonValue","isRecord","it","items-center","items-start","items-stretch","its","json","justify-center","justify-items-start","key","keyOf","keydown","kind","label","large","latest","latestInvocation","leading-[1.45]","left","length","let","line","list","listing","load","loadRevision","loaded","loading","longer","lucide-react","m-0","m9","m9.5","mapping","markTones","match","max-h-[320px]","max-h-[340px]","max-w-[132px]","max-w-[214px]","max-w-full","mb-1","mb-2","md:text-sm","message","messages","microphone","min-h-0","min-h-8","min-w-0","mini-app","minted","missing","ml-2","model","moduleId","moduleRevision","more","motion-reduce:animate-none","move","mt-1","multi","must","muted","name","names","need","needs","needsAnswer","needsRunView","new","next","no","no-referrer","none","not","nothing","null","number","object","of","ok","oldest","on","onAnswer","onClick","onDragStart","onOpenChange","onSubmit","once","one","onmessage","onmessageerror","onto","open","openFullscreen","optionalString","options","or","orchestration","order","order-1","origin","outline","output","overflow-auto","overflow-hidden","overflow-y-auto","overview","own","owner","ownerId","p-0","p-2.5","page","parameter","parameters","parseParameter","parsed","passed","path","pb-5","pb-7","pending","pendingConfirmationFor","pendingConfirmationInvocationId","pendingPort","per","pl-4","place-items-center","placed","placeholder","placement","placements","pluginId","pluginStates","polite","poll","port","portRef","postError","pr-3","presentation","primary","program","programActors","programChatNotice","programs","provider","pt-3","pt-[18px]","publish","purpose","px-2","px-2.5","px-[11px]","px-[9px]","px-workspace-inset","py-1","py-2","py-2.5","py-[5px]","py-[9px]","quassel/events","question","queued","quick-list","quickIconClass","raw","rawPlacements","react","react-hooks/exhaustive-deps","read-only","readActorInvocation","readOnly","readRight","readonly","ready","reason","receiveReady","recentRequestIdsRef","reduce","ref","referrerPolicy","refers","refresh","rejected","relative","relayFrameInput","render","replaceInvocation","request","requestId","requestIdFrom","requested","required","requiredString","resize-y","resolveChatActor","restarted","result","results","return","revision","role","round","rounded-[10px]","rounded-full","rounded-lg","rounded-md","routePrefix","rows","rpc","run","run-app","runActorFrom","runAppActionFrom","runAppFrom","runAppInvocationFrom","runAppPlacementFrom","runId","runScriptToolFrom","runToolParameterFrom","runToolTargetFrom","runView","runViewFrom","running","runs","s","sandbox","saved","scope","script","secondary","sectionLabelClass","segment","select","selectClass","selected","selectedName","selection","selects","sendActorMessage","sendChatState","sendState","sent","sentInvocationsRef","sentStateRef","session","sessionHeaders","sessionRef","setActionError","setActivePath","setBridgeReady","setBusy","setError","setExpanded","setFrameError","setFullscreen","setInvocation","setListing","setState","setSubmitting","shadow-[0_0_0_4px_color-mix(in_srgb,var(--primary)_12%,transparent)]","showCloseButton","signal","signature","size","size-[30px]","size-[34px]","size-[42px]","size-[7px]","slot","sm","snapshot","source","sourceHash","src","src/server.ts","stage","startedAt","state","stateSignature","states","status","step","stopped","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","submit","succeeded","success","such","surface","surfaceElements","switch","target","targetLabel","targets","text","text-[0.61rem]","text-[0.63rem]","text-[0.66rem]","text-[0.67rem]","text-[0.68rem]","text-[0.69rem]","text-[0.72rem]","text-[0.74rem]","text-[0.75rem]","text-[0.7rem]","text-[0.82rem]","text-[0.8rem]","text-[0.9rem]","text-[1.05rem]","text-base","text-destructive","text-foreground","text-info","text-left","text-muted-foreground","text-primary","text-sm","text-xs","than","the","theme","themeRef","this","throw","tile","tiled","timeout","timer","title","to","token","tone","too","tool","tools","tracking-[0.075em]","transition-[background-color,border-color]","true","truncate","try","type","typeof","undefined","unique","unknown","unreadable","unsupported","until","updates","uppercase","url","useAccess","useActorPrograms","useContext","useMemo","useOptionalActorPrograms","useRef","useResolvedTheme","useState","useSurfaceEntities","used","uses","valid","validateRunAppBridgeRequest","validation","value","values","variant","version","view","viewBox","views","visible","visibleApps","visibleStatus","void","w-[38px]","w-[calc(100%-2*clamp(16px,2vw,24px))]","w-full","waitForPoll","was","watchedChats","webPlugin","while","whitespace-nowrap","whitespace-pre-wrap","width","withAccessToken","workspaceTabs","writable","writableRef","write","yet","your"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var s=(e,a)=>{let t=globalThis.__ragentsHostModules?.[e];if(t===void 0)throw new Error(`Der Host stellt ${e} nicht bereit`);if(!(a in t))throw new Error(`Der Host stellt ${a} aus ${e} nicht bereit; das Bundle ist gegen einen neueren Host gebaut`);return t[a]};var ta=s("@ragents/web/PluginRegistry","pluginRoutePrefixFrom");var oa=s("@ragents/web/PluginRegistry","useSurfaceController");var k=s("@ragents/web/lib/guards","isRecord");var de=s("@ragents/web/rpc","rpc");var ra=s("@ragents/web/access-token","withAccessToken");var ua=s("@ragents/host/plugin-support/actor-programs/contract","ACTOR_INVOCATIONS_STATE_ID");var ee=s("@ragents/host/plugin-support/actor-programs/contract","ACTOR_PROGRAMS_STATE_ID");var ke=s("@ragents/host/plugin-support/actor-programs/contract","ACTOR_STATE_ID");var se=s("@ragents/host/plugin-support/actor-programs/contract","actorProgramContracts");var za=["string","number","integer","boolean","string[]","number[]","json"];var da=8,sa=20*1024*1024,Nt=29*1024*1024,_a=(e,a)=>{let t=a.trim().toLowerCase();return t?t==="video/quicktime"?"video/mov":t:{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",svg:"image/svg+xml",pdf:"application/pdf",mp4:"video/mp4",webm:"video/webm",mov:"video/mov",mpeg:"video/mpeg",mpg:"video/mpeg",txt:"text/plain",md:"text/markdown",csv:"text/csv",tsv:"text/tab-separated-values",json:"application/json",jsonl:"application/x-ndjson",xml:"application/xml",yaml:"application/yaml",yml:"application/yaml",ts:"text/plain",tsx:"text/plain",js:"application/javascript",py:"text/plain",cs:"text/plain",fs:"text/plain",html:"text/html",css:"text/css",log:"text/plain"}[e.split(".").at(-1)?.toLowerCase()??""]??"application/octet-stream"},la=e=>{if(e===void 0)return[];if(!Array.isArray(e)||e.length>da)throw new Error(`Anh\xE4nge m\xFCssen eine Liste mit h\xF6chstens ${da} Dateien sein.`);let a=0;return e.map((t,o)=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Anhang ${o+1} ist ung\xFCltig.`);let{name:r,mediaType:d,data:l}=t;if(typeof r!="string"||!r.trim()||r.length>255||/[/\\\u0000-\u001f\u007f]/.test(r)||r==="."||r==="..")throw new Error(`Anhang ${o+1} ben\xF6tigt einen g\xFCltigen Dateinamen ohne Pfad.`);let c=typeof d=="string"?_a(r,d):"";if(!/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/i.test(c))throw new Error(`Anhang ${r} ben\xF6tigt einen g\xFCltigen MIME-Typ.`);if(typeof l=="string"&&l.length>Math.ceil(sa/3)*4)throw new Error("Anh\xE4nge d\xFCrfen zusammen h\xF6chstens 20 MiB gro\xDF sein.");if(typeof l!="string"||l.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(l))throw new Error(`Anhang ${r} enth\xE4lt ung\xFCltiges Base64.`);let f=l.endsWith("==")?2:l.endsWith("=")?1:0;if(f&&("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(l[l.length-f-1])&(f===2?15:3))!==0)throw new Error(`Anhang ${r} enth\xE4lt nichtkanonisches Base64.`);if(a+=l.length/4*3-f,a>sa)throw new Error("Anh\xE4nge d\xFCrfen zusammen h\xF6chstens 20 MiB gro\xDF sein.");return{name:r,mediaType:c,data:l}})};var E=1,Za="ragents.app.frame-ready",Ja="ragents.app.connected",$a="ragents.app.ready",Qa="ragents.app.theme",Xa="ragents.app.invoke",Xe="ragents.app.get-state",ja="ragents.app.state",fa="ragents.app.invocation",Ya="ragents.app.error",ia="ragents.app.chat-watch",na="ragents.app.chat-unwatch",Pe="ragents.app.chat-send",et="ragents.app.chat-state",ca="ragents.app.chat-ack",at=/^[A-Za-z0-9_-]{1,64}$/,Vt=64*1024,Gt=24,ae=(e,a=0)=>a>Gt?!1:e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.every(t=>ae(t,a+1)):k(e)?Object.entries(e).every(([t,o])=>t.length<=256&&ae(o,a+1)):!1,Wt=e=>typeof e=="string"&&at.test(e)?e:void 0,Ka=e=>{try{return new TextEncoder().encode(JSON.stringify(e)).byteLength<=Vt}catch{return!1}},tt=e=>{if(!k(e))return{ok:!1,error:"Die App-Nachricht ist kein Objekt"};let a=Wt(e.requestId);if(!a)return{ok:!1,error:"Die App-Nachricht enth\xE4lt keine g\xFCltige requestId"};if(e.version!==E)return{ok:!1,requestId:a,error:"Die App verwendet eine nicht unterst\xFCtzte Bridge-Version"};if(e.type===Xe)return{ok:!0,request:{type:Xe,version:E,requestId:a}};if(e.type===ia||e.type===na||e.type===Pe){if(typeof e.actor!="string"||!/^@?[\p{L}\p{N}_-]{1,64}$/u.test(e.actor))return{ok:!1,requestId:a,error:"Das Chat-Ziel muss primary oder ein Actor-Handle wie @reviewer sein"};let t={version:E,requestId:a,actor:e.actor};if(e.type!==Pe)return{ok:!0,request:{...t,type:e.type}};let o;try{o=la(e.attachments)}catch(r){return{ok:!1,requestId:a,error:r instanceof Error?r.message:String(r)}}return typeof e.text!="string"||!e.text.trim()&&!o.length||!Ka(e.text)?{ok:!1,requestId:a,error:"Die Chat-Nachricht ist leer oder zu gro\xDF"}:{ok:!0,request:{...t,type:Pe,text:e.text.trim(),...o.length?{attachments:o}:{}}}}return e.type!==Xa?{ok:!1,requestId:a,error:"Die App-Nachricht hat einen unbekannten Typ"}:typeof e.actionId!="string"||!at.test(e.actionId)?{ok:!1,requestId:a,error:"Die App-Nachricht enth\xE4lt keine g\xFCltige actionId"}:!ae(e.input)||!Ka(e.input)?{ok:!1,requestId:a,error:"Die Eingabe der App-Aktion ist kein g\xFCltiger JSON-Wert oder zu gro\xDF"}:{ok:!0,request:{type:Xa,version:E,requestId:a,actionId:e.actionId,input:e.input}}};var zt=/^[A-Za-z0-9_-]{1,100}$/,_t=/^[A-Za-z0-9_-]{1,130}$/,Xt=/^[a-f0-9]{64}$/,Kt=new Set(za),A=(e,a)=>{if(typeof e!="string"||!e.trim())throw new Error(`${a} fehlt oder ist leer`);return e},ot=(e,a)=>{if(e!==void 0){if(typeof e!="string")throw new Error(`${a} ist kein Text`);return e}},le=(e,a)=>{let t=A(e,a);if(!zt.test(t))throw new Error(`${a} ist keine g\xFCltige Kennung`);return t},me=(e,a,t)=>{let o=e.map(a);if(new Set(o).size!==o.length)throw new Error(`${t} enth\xE4lt doppelte Kennungen`);return e},Zt=e=>{if(!k(e))throw new Error("Eine App-Aktion ist kein Objekt");if(e.confirmation!==null&&typeof e.confirmation!="string")throw new Error("confirmation einer App-Aktion muss Text oder null sein");if(typeof e.confirmation=="string"&&!e.confirmation.trim())throw new Error("confirmation einer App-Aktion darf nicht leer sein");return{id:le(e.id,"action.id"),label:A(e.label,"action.label"),...e.description!==void 0?{description:ot(e.description,"action.description")}:{},confirmation:e.confirmation}},ye=e=>{if(!k(e))throw new Error("Eine App-Ausf\xFChrung ist kein Objekt");if(!Array.isArray(e.output)||e.output.some(t=>typeof t!="string"))throw new Error("output einer App-Ausf\xFChrung ist keine Textliste");let a={id:le(e.id,"invocation.id"),actorId:A(e.actorId,"invocation.actorId"),actorHandle:A(e.actorHandle,"invocation.actorHandle"),appId:A(e.appId,"invocation.appId"),actionId:le(e.actionId,"invocation.actionId"),revision:A(e.revision,"invocation.revision"),output:e.output,createdAt:A(e.createdAt,"invocation.createdAt"),requestId:le(e.requestId,"invocation.requestId")};switch(e.status){case"queued":return{...a,status:"queued"};case"running":return{...a,status:"running",startedAt:A(e.startedAt,"invocation.startedAt")};case"succeeded":{if(!ae(e.result))throw new Error("result einer App-Ausf\xFChrung ist kein JSON-Wert");return{...a,status:"succeeded",startedAt:A(e.startedAt,"invocation.startedAt"),finishedAt:A(e.finishedAt,"invocation.finishedAt"),result:e.result}}case"failed":case"cancelled":return{...a,status:e.status,...e.startedAt!==void 0?{startedAt:A(e.startedAt,"invocation.startedAt")}:{},finishedAt:A(e.finishedAt,"invocation.finishedAt"),error:A(e.error,"invocation.error")};default:throw new Error("status einer App-Ausf\xFChrung ist ung\xFCltig")}},Jt=e=>{if(!k(e))throw new Error("Eine App-Platzierung ist kein Objekt");if(e.kind==="canvas")return{kind:"canvas",anchorActorId:A(e.anchorActorId,"placement.anchorActorId")};throw new Error("kind einer App-Platzierung muss canvas sein")},$t=e=>{if(!k(e))throw new Error("Eine App ist kein Objekt");if(!Array.isArray(e.actions))throw new Error("actions einer App ist keine Liste");if(!Array.isArray(e.invocations))throw new Error("invocations einer App ist keine Liste");let a=e.placements??[];if(!Array.isArray(a))throw new Error("placements einer App ist keine Liste");if(!k(e.state)||e.state.version!==1||!Number.isSafeInteger(e.state.revision)||!ae(e.state.values))throw new Error("state einer Ansicht entspricht nicht dem Zustandvertrag");let t=me(e.actions.map(Zt),f=>f.id,"actions"),o=me(e.invocations.map(ye),f=>f.id,"invocations"),r=new Set(t.map(f=>f.id));if(o.some(f=>!r.has(f.actionId)))throw new Error("Eine App-Ausf\xFChrung verweist auf eine unbekannte Aktion");if(e.visible!==void 0&&typeof e.visible!="boolean")throw new Error("visible einer App ist kein Wahrheitswert");if(a.length>1)throw new Error("placements einer App enth\xE4lt mehr als eine Platzierung");let d=a.map(Jt),l=A(e.id,"view.id");if(!_t.test(l))throw new Error("view.id ist keine g\xFCltige Kennung");let c=A(e.actorId,"view.actorId");if(d.some(f=>f.anchorActorId!==c))throw new Error("Die Ansicht muss bei ihrem eigenen Actor platziert sein");return{id:l,actorId:c,actorHandle:A(e.actorHandle,"view.actorHandle"),visible:e.visible!==!1,title:A(e.title,"app.title"),...e.description!==void 0?{description:ot(e.description,"app.description")}:{},revision:A(e.revision,"app.revision"),actions:t,placements:d,state:{version:1,revision:e.state.revision,values:e.state.values},invocations:o}},Qt=e=>{if(!k(e))throw new Error("Ein Werkzeugparameter ist kein Objekt");if(typeof e.type!="string"||!Kt.has(e.type))throw new Error("type eines Werkzeugparameters ist ung\xFCltig");if(typeof e.required!="boolean")throw new Error("required eines Werkzeugparameters ist kein Wahrheitswert");return{name:le(e.name,"parameter.name"),description:A(e.description,"parameter.description"),type:e.type,required:e.required}},jt=e=>{if(!k(e))throw new Error("Ein Werkzeugziel ist kein Objekt");if(e.handle!==null&&typeof e.handle!="string")throw new Error("handle eines Werkzeugziels muss Text oder null sein");return{actorId:A(e.actorId,"target.actorId"),handle:e.handle}},Yt=e=>{if(!k(e))throw new Error("Ein Script-Werkzeug ist kein Objekt");if(!Array.isArray(e.parameters))throw new Error("parameters eines Script-Werkzeugs ist keine Liste");if(!Array.isArray(e.targets))throw new Error("targets eines Script-Werkzeugs ist keine Liste");let a=A(e.sourceHash,"tool.sourceHash");if(!Xt.test(a))throw new Error("sourceHash eines Script-Werkzeugs ist ung\xFCltig");return{actorId:A(e.actorId,"tool.actorId"),actorHandle:A(e.actorHandle,"tool.actorHandle"),functionId:le(e.functionId,"tool.functionId"),revision:A(e.revision,"tool.revision"),moduleId:le(e.moduleId,"tool.moduleId"),name:le(e.name,"tool.name"),description:A(e.description,"tool.description"),parameters:me(e.parameters.map(Qt),t=>t.name,"parameters"),card:e.card===!0,sourceHash:a,targets:me(e.targets.map(jt),t=>t.actorId,"targets"),installedBy:A(e.installedBy,"tool.installedBy")}},eo=e=>{if(!k(e))throw new Error("Eine Quelldatei ist kein Objekt");if(typeof e.content!="string")throw new Error("content einer Quelldatei ist kein Text");return{path:A(e.path,"source.path"),content:e.content}},ao=e=>{if(!k(e)||!Array.isArray(e.files))throw new Error("Die Quellenliste entspricht nicht dem Vertrag");return me(e.files.map(eo),a=>a.path,"files")},to=e=>{if(!k(e)||!Array.isArray(e.apps)||!Array.isArray(e.tools))throw new Error("Die Liste der Actor-Programme entspricht nicht dem Vertrag");return{apps:me(e.apps.map($t),a=>a.id,"apps"),tools:me(e.tools.map(Yt),a=>a.name,"tools")}},pa=e=>encodeURIComponent(e),oo=(e,a)=>`${e}/runs/${pa(a)}/apps`,rt=e=>({list:async(a,t)=>to(await de.call(se.apps,{runId:a},{signal:t})),source:async(a,t,o)=>ao(await de.call(se.source,{runId:a,moduleId:t},{signal:o})),frameUrl:(a,t,o)=>ra(`${oo(e,a)}/${pa(t)}/frame?revision=${pa(o)}`),invoke:async(a,t,o,r,d,l,c)=>ye(await de.call(se.action,{runId:a,appId:t,revision:o,actionId:r,requestId:d,input:l},{signal:c})),invocation:async(a,t,o,r)=>ye(await de.call(se.invocation,{runId:a,appId:t,invocationId:o},{signal:r})),invokeFunction:async(a,t,o,r,d,l,c)=>ye(await de.call(se.function,{runId:a,actorHandle:t,revision:o,functionId:r,requestId:d,input:l},{signal:c})),functionInvocation:async(a,t,o,r)=>ye(await de.call(se.functionInvocation,{runId:a,actorHandle:t,invocationId:o},{signal:r}))});var Q=s("@ragents/web/AccessContext","useAccess");var be=s("react","createContext");var Le=s("react","createElement");var Re=s("react","forwardRef");var G=s("react","useCallback");var Te=s("react","useContext");var W=s("react","useEffect");var ma=s("react","useLayoutEffect");var j=s("react","useMemo");var B=s("react","useRef");var M=s("react","useState");var ut=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function dt(e,a,t=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ut(e),size:24,node:a,...t.length>0?{aliases:t}:{}}}var st=e=>{let a="",t=!1;for(let o of e){if(o==="-"||o==="_"||o<=" "){t=a.length>0;continue}a.length===0?a+=o.toLowerCase():a+=t?o.toUpperCase():o,t=!1}return a};var lt=e=>{let a=st(e);return a.charAt(0).toUpperCase()+a.slice(1)};var Be=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim();var fe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function La(e){return e!=null}function ft(e,a={}){let t=a.attributeNames??{},o=n=>t[n]??n,r=e.size??e.width??fe.width,d=e.size??e.height??fe.height,l=e.aliases?.filter(n=>typeof n=="string"&&n.trim()!=="").map(n=>`lucide-${n}`)??[],c=[...e.name?[`lucide-${e.name}`]:[],...l],f=a.className?.split(" ").filter(Boolean)??[],C=a.includeDefaultClasses===!1?Be(...f):Be("lucide",...c,...f),g=a.absoluteStrokeWidth?Number(a.strokeWidth??fe["stroke-width"])*Number(e.size??e.width??fe.width)/Number(a.size??a.width??fe.width):a.strokeWidth??fe["stroke-width"];return["svg",{...Object.entries(fe).reduce((n,[x,y])=>(n[o(x)]=y,n),{}),..."color"in a&&a.color&&{[o("stroke")]:a.color},..."size"in a&&La(a.size)&&{[o("width")]:a.size,[o("height")]:a.size},..."width"in a&&La(a.width)&&{[o("width")]:a.width},..."height"in a&&La(a.height)&&{[o("height")]:a.height},[o("stroke-width")]:g,...C&&{[o("class")]:C},[o("viewBox")]:`0 0 ${r} ${d}`,...a.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(n=>{let[x,y,H]=n,v=a.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...y}:y;return H?[x,v,H]:[x,v]})]}function it(e,a={}){return ft(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var nt=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var ro=be({});var ct=()=>Te(ro);var pt=Re(({color:e,size:a,width:t,height:o,strokeWidth:r,absoluteStrokeWidth:d,nonScalingStroke:l,className:c="",children:f,iconNode:C=[],icon:g={node:C,aliases:[],size:24},...m},n)=>{let{size:x=24,strokeWidth:y=2,absoluteStrokeWidth:H=!1,nonScalingStroke:v=!1,color:q="currentColor",className:I=""}=ct()??{},D=!!f||nt(m),[N,K,Z=[]]=it(g,{color:e??q,width:t??a??x,height:o??a??x,strokeWidth:r??y,absoluteStrokeWidth:d??H,nonScalingStroke:l??v,className:Be(I,c),hasA11yProp:D,attributes:m});return Le(N,{ref:n,...K},[...Z.map(([Ce,b])=>Le(Ce,b)),...Array.isArray(f)?f:[f]])});function he(e,a=[],t=[]){let o=typeof e=="string"?dt(e,a,t):e,r=Re(({className:d,...l},c)=>Le(pt,{ref:c,icon:o,className:d,...l}));return o.name&&(r.displayName=lt(o.name)),r}var mt={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};mt.node;var De=he(mt);var Lt={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Lt.node;var Fe=he(Lt);var xt={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};xt.node;var Me=he(xt);var ve=s("@ragents/web/ui","Alert");var Ke=s("@ragents/web/ui","Badge");var _=s("@ragents/web/ui","Button");var xa=s("@ragents/web/ui","Dialog");var Ia=s("@ragents/web/ui","DialogContent");var ga=s("@ragents/web/ui","DialogTitle");var qe=s("@ragents/web/ui","Empty");var Ze=s("@ragents/web/ui","EmptyContent");var Ee=s("@ragents/web/ui","EmptyDescription");var Oe=s("@ragents/web/ui","EmptyHeader");var Ue=s("@ragents/web/ui","EmptyMedia");var He=s("@ragents/web/ui","EmptyTitle");var Ca=s("@ragents/web/ui","Input");var xe=s("@ragents/web/ui","Spinner");var ha=s("@ragents/web/ui","Textarea");var U=s("@ragents/web/ui","cn");var Sa=s("@ragents/web/Toolbar","ToolbarCopy");var Je=s("@ragents/web/Toolbar","ToolbarItem");var wa=s("@ragents/web/Toolbar","ToolbarLabel");var Aa=s("@ragents/web/Toolbar","ToolbarText");import{askPayloadOf as io,ASK_PLUGIN_ID as no}from"/plugins/ragents.ask/web/exports/ask-payload.js";import{answerQuestion as co}from"/plugins/ragents.ask/web/exports/web/api.js";import{QuestionCard as po}from"/plugins/ragents.ask/web/exports/web/QuestionCard.js";var ka=s("@ragents/web/run-view","runActorFrom");var Y=s("@ragents/web/run-view","runViewFrom");import{useSurfaceEntities as mo}from"/plugins/ragents.orchestration/web/exports/web/surface-entities.js";import{SURFACE_TILE_DRAG_TYPE as Lo}from"/plugins/ragents.orchestration/web/exports/web/tile-docking.js";import{ProgramSlotContext as xo}from"/plugins/ragents.orchestration/web/exports/web/program-slot.js";var Pa=s("@ragents/web/SourceCode","SourceCode");var It=(e,a)=>{let o=Y(e)?.pluginStates.find(d=>d.pluginId===ee&&d.scope.kind==="actor"&&d.scope.actorId===a);if(!o||!k(o.state)||o.state.program===null)return;let r=o.state.program;if(!k(r)||r.actorId!==a||typeof r.name!="string"||typeof r.revision!="string")throw new Error("Die Quellcode-Zuordnung des Actor-Programms ist ung\xFCltig.");return{name:r.name,revision:r.revision}},ya=e=>{let a=Y(e);return a?a.pluginStates.flatMap(t=>{if(t.pluginId!==ee||t.scope.kind!=="actor")return[];let o=t.scope.actorId,r=a.actors.find(l=>l.id===o);if(!r||r.kind==="human"||r.lifecycle?.kind==="stopped")return[];if(!k(t.state)||!k(t.state.program))return[];let d=t.state.program;if(d.actorId!==r.id||d.actorHandle!==r.handle||typeof d.revision!="string"||!Array.isArray(d.views))throw new Error(`Das Ansichtsprogramm von @${r.handle} ist ung\xFCltig.`);return d.views.map(l=>{if(!k(l)||typeof l.id!="string"||typeof l.title!="string")throw new Error(`Eine Ansicht von @${r.handle} ist ung\xFCltig.`);return{id:l.id,title:l.title,actorId:r.id,actorHandle:r.handle,revision:d.revision,app:l}})}):[]},gt=(e,a)=>{let t=Y(a);if(!e||!t)return;let o=new Map(ya(t).map(d=>[d.id,d])),r=new Set(t.actors.filter(d=>d.kind!=="human"&&d.lifecycle?.kind!=="stopped").map(d=>d.id));return{...e,apps:e.apps.flatMap(d=>{let l=o.get(d.id);if(!l||l.actorId!==d.actorId||l.revision!==d.revision)return[];let c=t.pluginStates.find(C=>C.pluginId===ke&&C.scope.kind==="actor"&&C.scope.actorId===d.actorId),f=c?c.state:d.state.values;if(!ae(f))throw new Error(`Der Zustand von @${d.actorHandle} ist kein JSON-Wert.`);return[{...d,visible:l.app.visible!==!1,state:{...d.state,values:f}}]}),tools:e.tools.filter(d=>r.has(d.actorId)&&t.pluginStates.some(l=>l.pluginId===ee&&l.scope.kind==="actor"&&l.scope.actorId===d.actorId&&k(l.state)&&k(l.state.program)&&l.state.program.revision===d.revision))}};var Ne=s("react/jsx-runtime","Fragment");var u=s("react/jsx-runtime","jsx");var p=s("react/jsx-runtime","jsxs");function ba({api:e,moduleId:a,runId:t,revision:o,expandedByDefault:r=!1}){let[d,l]=M(r),[c,f]=M({kind:"loading"}),[C,g]=M();W(()=>{if(!d)return;let n=new AbortController;return f({kind:"loading"}),e.source(t,a,n.signal).then(x=>{n.signal.aborted||(f({kind:"ready",files:x}),g(x.find(y=>y.path==="src/server.ts")?.path??x.find(y=>/\.tsx?$/.test(y.path))?.path??x[0]?.path))},x=>{n.signal.aborted||f({kind:"error",message:x instanceof Error?x.message:String(x)})}),()=>n.abort()},[e,d,a,t,o]);let m=c.kind==="ready"?c.files.find(n=>n.path===C)??c.files[0]:void 0;return p("section",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] justify-items-start gap-2",children:[u("h3",{className:"text-xs font-semibold text-muted-foreground",children:"Quellcode"}),!d&&u(_,{onClick:()=>l(!0),size:"sm",variant:"outline",children:"Quellcode anzeigen"}),d&&p(Ne,{children:[u("p",{className:"text-[0.67rem] text-muted-foreground",children:"Quelle des installierten Builds"}),c.kind==="loading"&&p("p",{className:"flex items-center gap-2 text-[0.72rem] text-muted-foreground",children:[u(xe,{"aria-hidden":!0,"aria-label":void 0,role:void 0}),u("span",{children:"Quellcode wird geladen"})]}),c.kind==="error"&&u(ve,{className:"w-full",variant:"destructive",children:c.message}),c.kind==="ready"&&u("div",{className:"flex flex-wrap gap-1.5",children:c.files.map(n=>u("button",{className:U("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.path===m?.path&&"border-[color-mix(in_srgb,var(--primary)_48%,var(--border))] bg-primary/9 text-foreground"),onClick:()=>g(n.path),type:"button",children:n.path},n.path))}),m&&u(Pa,{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:m.content,path:m.path}),!r&&u(_,{onClick:()=>l(!1),size:"sm",variant:"outline",children:"Quellcode ausblenden"})]})]})}var Ct=(e,a,t)=>{let o=It(a,t);return o&&u(ba,{api:e,expandedByDefault:!0,moduleId:o.name,revision:o.revision,runId:a.id},`${a.id}:${t}:${o.revision}`)};var uo=e=>new Promise((a,t)=>{e.throwIfAborted();let r=setTimeout(()=>{e.removeEventListener("abort",d),a()},350),d=()=>{clearTimeout(r),t(e.reason)};e.addEventListener("abort",d,{once:!0})}),ht=async(e,a,t,o,r,d)=>{let l=await e.invokeFunction(a,t.actorHandle,t.revision,t.functionId,crypto.randomUUID().replaceAll("-",""),o,r);for(d(l);l.status==="queued"||l.status==="running";)await uo(r),l=await e.functionInvocation(a,t.actorHandle,l.id,r),d(l);return l};var so=(e,a)=>{let t=String(a.get(e.name)??"");if(e.type==="boolean")return e.required?a.has(e.name):t===""?void 0:t==="true";if(t===""&&!e.required)return;if(e.type==="string")return t;if(!t.trim())throw new Error(`${e.name}: Bitte einen Wert eingeben.`);if(e.type==="number"||e.type==="integer"){let r=Number(t);if(!Number.isFinite(r)||e.type==="integer"&&!Number.isInteger(r))throw new Error(`${e.name} ist keine g\xFCltige ${e.type==="integer"?"Ganzzahl":"Zahl"}.`);return r}if(e.type==="string[]"&&!t.trimStart().startsWith("["))return t.split(/\r?\n|,/).map(r=>r.trim()).filter(Boolean);let o;try{o=JSON.parse(t)}catch{throw new Error(`${e.name}: Bitte g\xFCltiges JSON eingeben.`)}if(!ae(o))throw new Error(`${e.name}: Kein g\xFCltiger JSON-Wert.`);if(e.type==="string[]"&&(!Array.isArray(o)||!o.every(r=>typeof r=="string")))throw new Error(`${e.name}: Bitte eine Liste aus Texten eingeben.`);if(e.type==="number[]"&&(!Array.isArray(o)||!o.every(r=>typeof r=="number")))throw new Error(`${e.name}: Bitte eine JSON-Liste aus Zahlen eingeben.`);return o},St=(e,a)=>Object.fromEntries(e.flatMap(t=>{let o=so(t,a);return o===void 0?[]:[[t.name,o]]}));var lo="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";function $e({session:e,tool:a,detail:t=!1}){let o=Q().can("runs.write"),{api:r,refresh:d,runId:l}=X(),[c,f]=M(),[C,g]=M(!1),[m,n]=M(),x=B(void 0);W(()=>()=>x.current?.abort(),[]);let y=m?Ie(e,{invocations:[m]}):void 0,H=async I=>{if(I.preventDefault(),x.current||!o)return;let D=new AbortController;x.current=D,f(void 0),n(void 0);try{let N=St(a.parameters,new FormData(I.currentTarget));g(!0),await ht(r,l,a,N,D.signal,K=>{D.signal.aborted||n(K)}),D.signal.aborted||await d()}catch(N){D.signal.aborted||f(N instanceof Error?N.message:String(N))}finally{D.signal.aborted||g(!1),x.current===D&&(x.current=void 0)}},v=y?"Best\xE4tigung erforderlich":m?.status==="queued"?"Wartet auf Ausf\xFChrung":m?.status==="running"?"Funktion l\xE4uft":m?.status==="succeeded"?"Ausgef\xFChrt":m?.status==="cancelled"?"Abgebrochen":m?.status==="failed"?"Fehlgeschlagen":C?"Aufruf wird gesendet":void 0,q=c??(m?.status==="failed"||m?.status==="cancelled"?m.error:void 0);return p("div",{className:"grid min-w-0 gap-2.5",children:[p("form",{"aria-label":`${a.name} aufrufen`,className:U("grid",t?"gap-3.5":"gap-2"),onSubmit:I=>{H(I)},children:[a.parameters.length===0&&t&&u("p",{children:"Diese Funktion ben\xF6tigt keine Parameter."}),a.parameters.map(I=>p("label",{className:U("grid gap-[3px] font-[650] text-foreground [&_small]:text-[0.61rem] [&_small]:font-normal [&_small]:text-muted-foreground",t?"text-[0.8rem]":"text-[0.68rem]",I.type==="boolean"&&I.required&&"grid-cols-[auto_minmax(0,1fr)] items-center gap-x-1.5 [&_small]:col-start-2"),children:[I.type==="boolean"&&I.required&&u("input",{"aria-description":I.description,className:"m-0 accent-primary",disabled:!o||C,name:I.name,type:"checkbox"}),p("span",{children:[I.name,I.required?" *":"",t&&p("small",{className:"ml-2",children:[I.type,I.required?"":" (optional)"]})]}),I.type==="boolean"?!I.required&&p("select",{className:lo,disabled:!o||C,name:I.name,defaultValue:"",children:[u("option",{value:"",children:"Nicht \xFCbergeben"}),u("option",{value:"true",children:"Ja"}),u("option",{value:"false",children:"Nein"})]}):I.type==="json"||I.type==="string[]"||I.type==="number[]"||t&&I.type==="string"?u(ha,{"aria-description":I.description,className:"min-h-8 resize-y font-normal",disabled:!o||C,name:I.name,placeholder:I.description,required:I.required,rows:2}):u(Ca,{"aria-description":I.description,className:"font-normal",disabled:!o||C,name:I.name,placeholder:I.description,required:I.required,step:I.type==="integer"?"1":I.type==="number"?"any":void 0,type:I.type==="integer"||I.type==="number"?"number":"text"}),(t||I.type==="boolean")&&u("small",{children:I.description}),I.type==="json"&&u("small",{children:"Als JSON eingeben."}),I.type==="number[]"&&u("small",{children:"Als JSON-Liste eingeben, z. B. [1, 2, 3]."}),I.type==="string[]"&&u("small",{children:"Ein Eintrag pro Zeile oder als JSON-Liste."})]},I.name)),p("div",{className:"flex flex-wrap items-center gap-2",children:[u(_,{disabled:!o||C,type:"submit",children:C?"Wird ausgef\xFChrt ...":"Ausf\xFChren"}),v&&u("span",{className:"text-[0.63rem] text-muted-foreground",role:"status",children:v})]})]}),y&&u(Se,{action:y,session:e},y.id),q&&u("p",{className:"text-destructive [overflow-wrap:anywhere]",role:"alert",children:q}),m?.status==="succeeded"&&!c&&p("section",{"aria-label":"Ergebnis",className:"grid min-w-0 gap-2",children:[u("h3",{children:"Ergebnis"}),u("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]",children:typeof m.result=="string"?m.result:JSON.stringify(m.result,null,2)})]})]})}function wt(){return u("svg",{"aria-hidden":!0,fill:"none",height:"14",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 24 24",width:"14",children:u("path",{d:"M9 3H3v6M15 3h6v6M3 15v6h6M21 15v6h-6"})})}var At=e=>{let a=Y(e),t=new Set(a?.pluginStates.filter(o=>o.pluginId===ee&&o.scope.kind==="actor").map(o=>o.scope.kind==="actor"?o.scope.actorId:"")??[]);return JSON.stringify({actors:a?.actors.filter(o=>t.has(o.id)).map(o=>[o.id,o.handle,o.lifecycle?.kind==="stopped"]).sort(([o],[r])=>String(o).localeCompare(String(r)))??[],states:(a?.pluginStates??[]).filter(o=>o.pluginId===ee||o.pluginId===ua||o.pluginId===ke&&o.scope.kind==="actor"&&t.has(o.scope.actorId)).map(o=>[`${o.pluginId}:${o.scope.kind==="actor"?o.scope.actorId:"run"}`,o.state]).sort(([o],[r])=>String(o).localeCompare(String(r)))})};var Pt=(e,a=!0)=>{let t=new Set(e.map(r=>r.id)),o=new Map;for(let r of e)for(let d of r.invocations)if(d.status==="queued"||d.status==="running"){if(!a&&!t.has(d.appId))continue;o.set(`${d.actorId}/${d.id}`,t.has(d.appId)?{kind:"app",appId:d.appId,invocationId:d.id}:{kind:"function",actorHandle:d.actorHandle,invocationId:d.id})}return[...o.entries()].sort(([r],[d])=>r.localeCompare(d)).map(([,r])=>r)},yt=(e,a,t,o)=>t.kind==="app"?e.invocation(a,t.appId,t.invocationId,o):e.functionInvocation(a,t.actorHandle,t.invocationId,o),kt=e=>{let a=e.status==="queued"?e.createdAt:e.status==="running"?e.startedAt:e.finishedAt,t=Date.parse(a);return Number.isNaN(t)?0:t},bt=e=>e.invocations.reduce((a,t)=>!a||kt(t)>=kt(a)?t:a,void 0);var Ra=be(void 0),fo=()=>Te(Ra),X=()=>{let e=fo();if(!e)throw new Error("Der Actor-Programm-Provider ist nicht aktiv");return e};var Ge="ragents.actor-programs.tools",Rt="flex size-[34px] items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary",Io="grid flex-none grid-cols-[auto_minmax(0,1fr)] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-[9px]",Tt="mb-2 text-[0.66rem] tracking-[0.075em] text-muted-foreground uppercase",go="grid size-[30px] flex-none place-items-center rounded-lg border border-info/25 bg-glass-app text-info",Dt=new Set(["queued","running"]),Co=700,Bt=(e,a)=>e&&{...e,apps:e.apps.map(t=>{if(t.actorId!==a.actorId||t.revision!==a.revision)return t;let o=t.invocations.some(r=>r.id===a.id);return{...t,invocations:o?t.invocations.map(r=>r.id===a.id?a:r):[...t.invocations,a]}})};function Ft({api:e,children:a,session:t}){let o=t.session.id,r=Q().can("runs.inspect"),[d,l]=M(),c=j(()=>gt(d,t.runView),[d,t.runView]),[f,C]=M(),[g,m]=M(),n=ge(t).filter(b=>b.app.visible!==!1),x=g?.runId===o&&n.some(b=>b.id===g.appId)?g.appId:void 0,y=G(()=>m(void 0),[]),H=G(b=>{if(!ge(t).some(P=>P.id===b&&P.app.visible!==!1))throw new Error("Die Actor-Ansicht ist nicht auf der Fl\xE4che verf\xFCgbar.");m({runId:o,appId:b})},[o,t]);W(()=>{g&&!x&&m(void 0)},[g,x]);let v=B(0),q=G(async()=>{let b=++v.current;try{let P=await e.list(o);if(b!==v.current)return;l(P),C(void 0)}catch(P){if(b!==v.current)return;C(P instanceof Error?P.message:String(P))}},[e,o]),I=j(()=>At(t.runView),[t.runView]);W(()=>(l(void 0),C(void 0),()=>{v.current+=1}),[o]),W(()=>{q()},[I,q]);let D=j(()=>Pt(c?.apps??[],r),[r,c]),N=D.length>0?JSON.stringify(D):"";W(()=>{if(!N)return;let b=D,P=!1,z,J,ie=async()=>{J=new AbortController;let te=await Promise.allSettled(b.map(async O=>({target:O,invocation:await yt(e,o,O,J?.signal)})));if(P)return;let oe=te.flatMap(O=>O.status==="fulfilled"?[O.value]:[]);oe.length>0&&(l(O=>oe.reduce(($,We)=>Bt($,We.invocation),O)),C(void 0));let re=te.find(O=>O.status==="rejected");re&&C(re.reason instanceof Error?re.reason.message:String(re.reason)),oe.some(O=>!Dt.has(O.invocation.status))?await q():P||(z=window.setTimeout(()=>{ie()},Co))};return z=window.setTimeout(()=>{ie()},250),()=>{P=!0,z!==void 0&&window.clearTimeout(z),J?.abort()}},[N,e,q,o]);let K=G(async(b,P,z,J,ie)=>{v.current+=1;let te=await e.invoke(o,b,P,z,J,ie);return v.current+=1,l(oe=>Bt(oe,te)),te},[e,o]),Z=j(()=>({api:e,error:f,fullscreenAppId:x,invoke:K,listing:c,openFullscreen:H,closeFullscreen:y,refresh:q,runId:o}),[e,f,x,K,c,H,y,q,o]),Ce=j(()=>({runId:o,needsAnswer:(b,P)=>{let z=c?.apps.find(J=>J.id===P);return z!==void 0&&Ie(b,z)!==void 0},openFullscreen:H,source:(b,P)=>Ct(e,b,P)}),[e,c,H,o]);return u(Ra.Provider,{value:Z,children:u(xo.Provider,{value:Ce,children:a})})}var ge=e=>ya(e.runView),Ie=(e,a)=>{let t=Y(e.runView);if(!t)return;let o=new Set(a.invocations.filter(r=>Dt.has(r.status)).map(r=>r.id));return t.actions.find(r=>r.owner===no&&r.status==="pending"&&r.askedBy===t.ownerId&&r.parameters.source===ee&&o.has(r.parameters.invocationId))};function Se({action:e,session:a}){let t=Q(),[o,r]=M(!1),[d,l]=M(),c=async f=>{if(!o){r(!0),l(void 0);try{await co(a.session.id,e.id,f)}catch(C){l(C instanceof Error?C.message:String(C)),r(!1)}}};return p("section",{"aria-label":"Host-Best\xE4tigung",className:"grid flex-none gap-2 border-b border-border-soft bg-warning-soft px-workspace-inset py-2.5","data-slot":"host-confirmation",children:[p("header",{className:"grid gap-0.5",children:[u("strong",{className:"text-[0.72rem] text-foreground",children:"Best\xE4tigung im Host"}),u("span",{className:"text-xs text-muted-foreground",children:"Die App kann diese Entscheidung nicht selbst beantworten."})]}),o?u("p",{className:"text-xs text-muted-foreground",children:"Antwort wird verarbeitet"}):u(po,{onAnswer:t.can("runs.write")?f=>{c(f)}:void 0,question:io(e.payload)??{question:e.title,options:[],multi:!1},text:e.title}),d&&u("p",{className:"text-xs text-destructive",role:"alert",children:d})]})}var ho=e=>e.handle?`@${e.handle}`:e.actorId;function Mt({active:e,navigation:a,selection:t,session:o}){let{api:r,error:d,listing:l,refresh:c,runId:f}=X(),C=typeof t=="string"?t:void 0,g=l?.tools.find(m=>m.name===C);return!l&&!d?p("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-muted-foreground",children:[u(xe,{"aria-hidden":!0,"aria-label":void 0,role:void 0}),u("span",{children:"Funktionen werden geladen"})]}):l?C&&!g?p(qe,{children:[p(Oe,{children:[u(Ue,{children:u(Ve,{})}),u(He,{children:"Funktion nicht mehr verf\xFCgbar"}),u(Ee,{children:"Das ausgew\xE4hlte Actor-Funktion ist in diesem Run nicht mehr installiert."})]}),u(Ze,{children:u(_,{onClick:()=>a.openTab(Ge,null),variant:"outline",children:"Zur \xDCbersicht"})})]}):g?p("div",{className:"flex h-full min-h-0 flex-col",children:[p("header",{className:Io,children:[u(_,{"aria-label":"Zur\xFCck zur Funktions\xFCbersicht",onClick:()=>a.openTab(Ge,null),size:"icon-sm",title:"Zur\xFCck zur Funktions\xFCbersicht",variant:"outline",children:u(De,{})}),p("span",{className:"grid min-w-0 gap-px",children:[u("strong",{className:"truncate text-[0.82rem] font-semibold",title:g.name,children:g.name}),p("small",{className:"truncate text-xs text-muted-foreground",children:["Funktion von @",g.actorHandle]})]})]}),p("div",{className:"flex min-h-0 flex-col gap-[22px] overflow-y-auto px-workspace-inset pt-[18px] pb-7",children:[p("div",{className:"grid grid-cols-[42px_minmax(0,1fr)] items-start gap-3",children:[u("span",{className:U(Rt,"size-[42px] bg-accent"),children:u(Ve,{size:22})}),p("div",{children:[u("h2",{className:"text-[1.05rem] text-foreground",children:g.name}),u("p",{className:"mt-1 text-[0.74rem] leading-[1.45] text-muted-foreground",children:g.description})]})]}),p("section",{children:[u("h3",{className:Tt,children:"Verf\xFCgbar f\xFCr"}),u("div",{className:"flex flex-wrap gap-1.5",children:g.targets.map(m=>u("span",{className:"rounded-full bg-primary/9 px-2 py-1 text-xs text-foreground",children:ho(m)},m.actorId))})]}),p("section",{children:[u("h3",{className:Tt,children:"Parameter"}),e&&u($e,{detail:!0,session:o,tool:g},`${f}:${g.actorId}:${g.functionId}:${g.revision}`)]}),u(ba,{api:r,moduleId:g.moduleId,revision:g.revision,runId:f}),u("dl",{className:"grid grid-cols-2 gap-2",children:[{label:"Programm",value:g.moduleId,title:void 0},{label:"Quellhash",value:g.sourceHash.slice(0,12),title:g.sourceHash}].map(m=>p("div",{className:"grid gap-[3px] rounded-lg bg-foreground/4 px-2.5 py-2",children:[u("dt",{className:"text-[0.61rem] text-muted-foreground uppercase",children:m.label}),u("dd",{className:"truncate font-mono text-xs text-foreground",title:m.title,children:m.value})]},m.label))})]})]}):l.tools.length===0?u(qe,{children:p(Oe,{children:[u(Ue,{children:u(Ve,{})}),u(He,{children:"Noch keine Funktionen"}),u(Ee,{children:"Von Agenten erstellte Actor-Funktionen dieses Runs erscheinen hier."})]})}):p("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]",children:[d&&u(ve,{className:"mb-1",role:"status",variant:"destructive",children:d}),l.tools.map(m=>p("button",{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]",onClick:()=>a.openTab(Ge,m.name),type:"button",children:[u("span",{className:Rt,children:u(Ve,{size:20})}),p("span",{className:"grid min-w-0 gap-0.5",children:[u("strong",{className:"truncate text-[0.8rem] font-semibold",children:m.name}),u("small",{className:"truncate text-[0.69rem] text-muted-foreground",children:m.description})]}),p(Ke,{className:"max-w-[132px] truncate @max-[470px]:hidden",variant:"secondary",children:[m.targets.length," ",m.targets.length===1?"Agent":"Agenten"]}),u(So,{})]},m.name))]}):p(qe,{children:[p(Oe,{children:[u(Ue,{children:u(Ve,{})}),u(He,{children:"Funktionen konnten nicht geladen werden"}),u(Ee,{children:d})]}),u(Ze,{children:u(_,{onClick:()=>{c()},variant:"outline",children:"Erneut versuchen"})})]})}function vt({session:e}){let a=Q().can("runs.inspect"),t=oa(),o=mo(e.session.id),{closeFullscreen:r,fullscreenAppId:d,openFullscreen:l}=X(),c=ge(e).filter(f=>f.app.visible!==!1);return c.length===0?null:u("nav",{"aria-label":"Actor-Ansichten",className:"flex min-w-0 flex-none items-stretch",children:c.map(f=>p("div",{role:"group","aria-label":f.title,className:U("relative flex flex-none items-stretch border-r border-border hover:bg-accent focus-within:bg-accent",d===f.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-['']"),children:[p(Je,{as:"button",className:"max-w-[214px] border-r-0 font-bold hover:not-disabled:bg-transparent",draggable:a,onDragStart:C=>{if(!a){C.preventDefault();return}C.dataTransfer.setData(Lo,`app:${f.id}`),C.dataTransfer.effectAllowed="move",r()},onClick:()=>{if(!t)throw new Error("Die App-Zug\xE4nge brauchen den Fl\xE4chen-Controller des Orchestrierungs-Plugins.");r(),t.acceptSelection({type:"run-app",id:f.id})},"aria-label":`Mini-App: ${f.title} von @${f.actorHandle}`,title:`Mini-App: ${f.title} von @${f.actorHandle}${a?". Zum Andocken auf eine Kachel ziehen.":""}`,type:"button",children:[u("span",{className:U(go,!o.has(`app:${f.id}`)&&"bg-transparent"),children:u(Fe,{size:20})}),p(Sa,{children:[p(wa,{children:["@",f.actorHandle]}),u(Aa,{children:f.title})]})]}),u(Je,{as:"button","aria-expanded":d===f.id,"aria-label":`${f.title} ${d===f.id?"Vollansicht schlie\xDFen":"in Vollansicht \xF6ffnen"}`,title:`${f.title} ${d===f.id?"Vollansicht schlie\xDFen":"in Vollansicht \xF6ffnen"}`,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-['']",onClick:()=>d===f.id?r():l(f.id),type:"button",children:u(wt,{})})]},`app:${f.id}`))})}function qt(){let{listing:e}=X();return e&&e.tools.length>0?u(Ke,{variant:"secondary",children:e.tools.length}):null}function Ve({size:e=28}){return p("svg",{"aria-hidden":!0,fill:"none",height:e,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 24 24",width:e,children:[u("path",{d:"M14.5 6.5 17.5 3.5l3 3-3 3"}),u("path",{d:"m9.5 17.5-3 3-3-3 3-3"}),u("path",{d:"M13 5H9a4 4 0 0 0-4 4v5.5M11 19h4a4 4 0 0 0 4-4V9.5"})]})}function So(){return u("svg",{"aria-hidden":!0,fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",viewBox:"0 0 24 24",width:"14",children:u("path",{d:"m9 18 6-6-6-6"})})}var Ta=s("@ragents/web/run-panel/input-bridge","hostInputEnabled");var Ba=s("@ragents/web/run-panel/input-bridge","isRunPanelKeyboardMessage");var Da=s("@ragents/web/run-panel/input-bridge","relayFrameInput");var Fa=s("@ragents/web/theme","useResolvedTheme");var Ma=s("@ragents/web/api","sendActorMessage");var va=s("@ragents/engine/src/http/contracts","actorByHandle");var qa=s("@ragents/web/actor-conversation","actorChatMessages");var Ea=s("@ragents/web/chat/chat-target","programChatNotice");var Qe=(e,a)=>{let t=Y(e.runView);if(!t||t.id!==e.session.id)throw new Error("Die Run-Ansicht f\xFCr diesen Chat ist noch nicht verf\xFCgbar");let o=a==="primary"?t.actors.find(r=>r.id===t.primaryActorId):va(t.actors,a);if(!o||o.kind==="human"){let r=t.actors.filter(d=>d.kind!=="human").map(d=>`@${d.handle}`).join(", ");throw new Error(`Das Chat-Ziel ist nicht verf\xFCgbar. Erlaubt sind primary und: ${r||"noch keine Actors"}`)}return{view:t,actor:o}},Oa=(e,a)=>{try{let{view:t,actor:o}=Qe(e,a),r=o.id===t.primaryActorId,d=o.kind==="script"?Ea:e.conversationError??(e.connected?o.lifecycle?.kind==="stopped"?`@${o.handle} gestoppt: ${o.lifecycle.reason}. Er nimmt keine Eingaben an, bis er neu gestartet wird`:void 0:"Die Verbindung zum Run ist unterbrochen");return{owner:o.id,messages:qa(t,o,e.messages,e.actorConversations?.[o.id]),running:r?e.running:o.lifecycle?.kind==="running",...o.kind==="script"?{readOnly:!0}:{},...d?{error:d}:{}}}catch(t){return{messages:[],running:!1,error:t instanceof Error?t.message:String(t)}}};var Ua=s("@ragents/web/chat/useAttachmentCapabilities","getAttachmentCapabilities");var wo=new Set(["queued","running"]),Ao=512,Ha=e=>JSON.stringify(e),ko={success:"bg-success",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",confirm:"bg-warning",error:"bg-destructive"};function je({api:e,app:a,invoke:t,pendingConfirmationInvocationId:o,presentation:r,runId:d,session:l}){let c=Q(),f=Fa(),C=B(f);C.current=f;let g=B(c.can("runs.write"));g.current=c.can("runs.write");let m=B(null),n=B(void 0),x=B(0),y=B(!1),H=B(a),v=B(l);v.current=l;let q=B(new Map),I=B(new Map),D=B(new Set),N=B(""),K=B(new Map),[Z,Ce]=M(!1),[b,P]=M(),[z,J]=M(),[ie,te]=M([]);H.current=a;let oe=j(()=>e.frameUrl(d,a.id,a.revision),[e,a.id,a.revision,d]),re=j(()=>crypto.randomUUID().replaceAll("-",""),[oe]),ne=G(()=>{x.current+=1,y.current=!1,n.current?.close(),n.current=void 0,q.current.clear(),I.current.clear(),Ce(!1),te([])},[]),O=G((L,i,w)=>{let T=x.current,F=R=>{if(T!==x.current||L!==n.current||!q.current.has(i))return;let S=Oa(v.current,i),ue={...S,...R,readOnly:S.readOnly===!0||!g.current},h=JSON.stringify(ue);w===void 0&&q.current.get(i)===h||(q.current.set(i,h),L.postMessage({type:et,version:E,actor:i,snapshot:ue,...w?{requestId:w}:{}}))};try{let R=v.current,S=Qe(R,i).actor,ue=JSON.stringify([R.session.id,S.id,S.execution?.driver]),h=I.current.get(ue);if(!h){let V=Ua(R.session.id,S.id).then(pe=>({attachmentCapabilities:pe}),pe=>({attachmentCapabilitiesError:pe instanceof Error?pe.message:String(pe)}));h={pending:V},I.current.set(ue,h);let aa=h;V.then(pe=>{aa.result=pe})}F(h.result??{attachmentCapabilitiesError:"Modellf\xE4higkeiten werden gepr\xFCft ..."}),h.result||h.pending.then(F)}catch(R){F({attachmentCapabilitiesError:R instanceof Error?R.message:String(R)})}},[]),$=G((L,i,w)=>{L.postMessage({type:Ya,version:E,...i?{requestId:i}:{},message:w})},[]),We=G(async(L,i,w,T)=>{if(!(w!==x.current||i!==n.current)){J(void 0),te(F=>[...F,L.requestId]);try{if(!g.current)throw new Error("Du hast Lesezugriff auf diese Actor-Ansicht.");let F=await t(T.id,T.revision,L.actionId,L.requestId,L.input);if(w!==x.current||i!==n.current)return;K.current.set(F.id,Ha(F)),i.postMessage({type:fa,version:E,requestId:L.requestId,invocation:F})}catch(F){if(w!==x.current||i!==n.current)return;let R=F instanceof Error?F.message:String(F);J(R),$(i,L.requestId,R)}finally{w===x.current&&i===n.current&&te(F=>F.filter(R=>R!==L.requestId))}}},[t,$]),ze=G((L,i)=>{let w=H.current;L.postMessage({type:ja,version:E,...i?{requestId:i}:{},state:w.state??null})},[]),Va=G((L,i,w,T)=>{if(w!==x.current||i!==n.current||Da(window,L,h=>{w===x.current&&i===n.current&&i.postMessage(h)}))return;let F=L;if(F?.type===Ja&&F.version===E){y.current=!0,P(void 0),Ce(!0);return}let R=tt(L);if(!R.ok){$(i,R.requestId,R.error);return}let{request:S}=R;if(D.current.has(S.requestId)){$(i,S.requestId,"Diese requestId wurde bereits verwendet");return}if(D.current.add(S.requestId),D.current.size>Ao){let h=D.current.values().next().value;h!==void 0&&D.current.delete(h)}if(S.type===ia){q.current.set(S.actor,""),O(i,S.actor,S.requestId);return}if(S.type===na){q.current.delete(S.actor),i.postMessage({type:ca,version:E,requestId:S.requestId});return}if(S.type===Pe){(async()=>{try{if(!g.current)throw new Error("Du hast Lesezugriff auf diesen Chat.");let h=v.current,V=Oa(h,S.actor);if(V.error)throw new Error(V.error);let{actor:aa}=Qe(h,S.actor);await Ma(h.session.id,aa.id,S.text,S.attachments),w===x.current&&i===n.current&&i.postMessage({type:ca,version:E,requestId:S.requestId})}catch(h){w===x.current&&i===n.current&&$(i,S.requestId,h instanceof Error?h.message:String(h))}})();return}if(S.type===Xe){ze(i,S.requestId);return}if(!T.actions.find(h=>h.id===S.actionId)){$(i,S.requestId,"Die angeforderte App-Aktion ist nicht installiert");return}We(S,i,w,T)},[We,$,O,ze]),Ye=G((L,i)=>{if(n.current){L.close();return}ne();let w=x.current;n.current=L,L.onmessage=T=>Va(T.data,L,w,i),L.onmessageerror=()=>{w===x.current&&L===n.current&&$(L,void 0,"Die App hat eine unlesbare Nachricht gesendet")},L.start(),D.current=new Set,N.current=JSON.stringify(i.state??null),K.current=new Map(i.invocations.map(T=>[T.id,Ha(T)])),L.postMessage({type:$a,version:E,theme:C.current,hostInput:Ta(window),app:{id:i.id,actorId:i.actorId,actorHandle:i.actorHandle,title:i.title,description:i.description,actions:i.actions},actor:{id:i.actorId,handle:i.actorHandle},state:i.state??null,invocations:i.invocations}),P(void 0)},[ne,Va,$]);ma(()=>{let L=m.current;if(!L)return;ne(),J(void 0),P(void 0);let i=H.current,w=!1,T,F=h=>{w?Ye(h,i):T=h},R=h=>{let V=h.data;if(h.source===L.contentWindow&&h.origin==="null"&&V?.type==="ragents.app.escape"&&V.version===E&&V.token===re){window.dispatchEvent(new KeyboardEvent("keydown",{...Ba(V.keyboard)?V.keyboard.event:{key:"Escape"},bubbles:!0,cancelable:!0}));return}if(!(h.source!==L.contentWindow||h.origin!=="null"||V?.type!==Za||V.version!==E||V.token!==re||h.ports.length!==1)){if(T||n.current){h.ports[0].close();return}F(h.ports[0])}},S=()=>{if(!w){if(w=!0,T){let h=T;T=void 0,Ye(h,i)}return}T?.close(),T=void 0,ne(),P("Die App hat ihre installierte Seite verlassen und wurde getrennt.")};window.addEventListener("message",R),L.addEventListener("load",S),L.src=`${oe}#ragentsBridge=${encodeURIComponent(re)}`;let ue=window.setTimeout(()=>{y.current||P("Die App hat keine g\xFCltige Host-Bridge ge\xF6ffnet.")},5e3);return()=>{window.clearTimeout(ue),window.removeEventListener("message",R),L.removeEventListener("load",S),T?.close(),ne()}},[Ye,re,ne,oe]),W(()=>{Z&&n.current?.postMessage({type:Qa,version:E,theme:f})},[Z,f]),W(()=>{if(!Z)return;let L=JSON.stringify(a.state??null);if(L!==N.current){N.current=L;let i=n.current;i&&ze(i)}a.invocations.forEach(i=>{let w=Ha(i);K.current.get(i.id)!==w&&(K.current.set(i.id,w),n.current?.postMessage({type:fa,version:E,invocation:i}))})},[a.invocations,a.state,Z,ze]),W(()=>{if(!(!Z||!n.current))for(let L of q.current.keys())O(n.current,L)},[Z,O,l]);let ce=bt(a),ea=a.invocations.filter(L=>wo.has(L.status)),Ga=ea.find(L=>L.id===o),Wa=Ga?a.actions.find(L=>L.id===Ga.actionId):void 0,_e=b?{tone:"error",title:"App getrennt",detail:b}:ie.length>0?{tone:"running",title:"Aktion wird gestartet",detail:`${ie.length} Anfrage(n)`}:Wa?{tone:"confirm",title:"Wartet auf Deine Best\xE4tigung",detail:Wa.label}:ea.length>0?{tone:"running",title:"Aktion l\xE4uft",detail:ea.map(L=>a.actions.find(i=>i.id===L.actionId)?.label.trim()||(c.can("runs.inspect")?L.actionId:"")).filter(Boolean).join(", ")}:z?{tone:"error",title:"Aktion fehlgeschlagen",detail:z}:ce?.status==="failed"?{tone:"error",title:"Letzte Aktion fehlgeschlagen",detail:ce.error}:ce?.status==="cancelled"?{tone:"muted",title:"Letzte Aktion abgebrochen",detail:ce.actionId}:ce?.status==="succeeded"?{tone:"success",title:"Letzte Aktion abgeschlossen",detail:ce.output.at(-1)??ce.actionId}:Z?void 0:{tone:"muted",title:"App wird geladen",detail:"Bridge noch nicht verbunden"},we=_e&&(r==="fullscreen"?_e.tone==="error":_e.tone!=="success")?_e:void 0,Ae=r!=="fullscreen";return p("div",{className:"flex min-h-0 flex-1 flex-col",children:[u("div",{"aria-live":"polite",role:"status",className:U("grid min-w-0 items-center overflow-hidden text-xs text-muted-foreground",Ae?"order-1 h-7 flex-[0_0_28px] grid-cols-[auto_minmax(0,1fr)] gap-1.5 px-workspace-inset py-1":"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]"),children:we&&p(Ne,{children:[!Ae&&u("span",{className:U("size-[7px] rounded-full bg-muted-foreground/55",ko[we.tone])}),u("strong",{className:U("font-semibold whitespace-nowrap text-foreground",Ae?"text-[0.63rem]":"text-[0.7rem]"),children:we.title}),u("span",{className:"truncate",title:we.detail,children:we.detail})]})}),u("div",{className:U("relative flex min-h-0 flex-1 overflow-hidden",Ae?"bg-transparent":"bg-background"),children:u("iframe",{allow:"camera 'none'; geolocation 'none'; microphone 'none'",className:U("absolute inset-0 h-full w-full min-h-0 min-w-0 border-0",Ae?"bg-transparent":"bg-background"),ref:m,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-forms allow-downloads","aria-label":a.title,title:""})})]})}function Et({session:e}){let{api:a,closeFullscreen:t,error:o,fullscreenAppId:r,invoke:d,listing:l,runId:c}=X(),f=B(null);if(!r)return null;let C=ge(e).find(x=>x.id===r&&x.app.visible!==!1);if(!C)return null;let g=l?.apps.find(x=>x.id===r),m=C.title,n=g?Ie(e,g):void 0;return u(xa,{open:!0,onOpenChange:x=>{x||t()},children:p(Ia,{className:"h-[calc(100%-2*clamp(16px,2vw,24px))] w-[calc(100%-2*clamp(16px,2vw,24px))] gap-0 bg-background p-0",initialFocus:f,scope:"surface",showCloseButton:!1,size:"full",children:[p("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card py-2 pr-3 pl-4",children:[u(ga,{className:"min-w-0 flex-1 truncate text-[0.9rem]",render:u("h2",{}),children:m}),u(_,{"aria-label":`${m} Vollansicht schlie\xDFen`,className:"rounded-full",onClick:t,ref:f,size:"icon",title:`${m} Vollansicht schlie\xDFen`,variant:"outline",children:u(Me,{})})]}),p("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",children:[n&&u(Se,{action:n,session:e},n.id),g?u(je,{api:a,app:g,invoke:d,pendingConfirmationInvocationId:n?.parameters.invocationId,presentation:"fullscreen",runId:c,session:e}):u("p",{className:"flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground",role:o?"alert":"status",children:o??"Actor-Ansicht wird geladen"})]})]})},`${c}:${r}`)}function Ot({actor:e,session:a}){let t=Q().can("runs.inspect"),{listing:o}=X(),r=ka(e);if(!t||r.lifecycle?.kind==="stopped")return null;let d=o?.tools.filter(l=>l.card&&l.actorId===r.id)??[];return d.length===0?null:u("section",{className:"grid min-w-0 gap-[9px]",children:d.map(l=>p("article",{"aria-label":l.name,className:"min-w-0",children:[u("strong",{children:l.name}),u($e,{session:a,tool:l})]},`${a.session.id}:${l.actorId}:${l.functionId}:${l.revision}`))})}var Ut=e=>ge(e).flatMap(a=>{let t=a.app.placements,o=Array.isArray(t)?t.find(d=>k(d)&&d.kind==="canvas"):void 0,r=k(o)?o:void 0;if(r&&typeof r.anchorActorId!="string")throw new Error(`Die Fl\xE4chenplatzierung der Actor-Ansicht ${a.title} ist ung\xFCltig`);if(r&&r.anchorActorId!==a.actorId)throw new Error(`Die Ansicht ${a.title} geh\xF6rt zu @${a.actorHandle}.`);return[{id:a.id,title:a.title,visible:a.app.visible!==!1,anchorActorId:a.actorId,data:{actorId:a.actorId,actorHandle:a.actorHandle},entity:{type:"run-app",id:a.id}}]});function Ht({definition:e,session:a}){let{api:t,invoke:o,listing:r,runId:d}=X(),l=r?.apps.find(g=>g.id===e.id),c=l?Ie(a,l):void 0,f=e.title??e.id,C=l?u(je,{api:t,app:l,invoke:o,pendingConfirmationInvocationId:c?.parameters.invocationId,presentation:"tiled",runId:d,session:a}):p("div",{className:"flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground",children:[u(xe,{"aria-hidden":!0,"aria-label":void 0,role:void 0}),u("span",{children:"Actor-Ansicht wird geladen"})]});return u("article",{"aria-label":f,className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:p("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",children:[c&&u(Se,{action:c,session:a},c.id),C]})})}var Po="ragents.actor-programs";function yo(){return p("svg",{"aria-hidden":!0,fill:"none",height:"15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 24 24",width:"15",children:[u("path",{d:"M14.5 6.5 17.5 3.5l3 3-3 3"}),u("path",{d:"m9.5 17.5-3 3-3-3 3-3"}),u("path",{d:"M13 5H9a4 4 0 0 0-4 4v5.5M11 19h4a4 4 0 0 0 4-4V9.5"})]})}var bo=(e,a)=>{let t=rt(a);function o({children:r,session:d}){return p(Ft,{api:t,session:d,children:[r,u(Et,{session:d})]})}return{...e,needsRunView:!0,SessionProvider:o,sessionHeaders:[{id:"ragents.actor-programs.quick-list",placement:"surface",order:250,Header:vt}],cardSections:[{id:"ragents.actor-programs.tools",order:400,Section:Ot}],surfaceElements:[{id:"ragents.actor-programs.apps",order:400,select:Ut,Element:Ht}],workspaceTabs:[{readRight:"runs.inspect",id:Ge,label:"Funktionen",order:251,Icon:yo,Panel:Mt,Badge:qt}]}},Na={id:Po},Ef={...Na,activate:e=>bo(Na,ta(Na.id,e))};export{Po as ACTOR_PROGRAMS_PLUGIN_ID,Ef as webPlugin};
|
|
1
|
+
var s=(e,a)=>{let t=globalThis.__ragentsHostModules?.[e];if(t===void 0)throw new Error(`The host does not provide ${e}`);if(!(a in t))throw new Error(`The host does not provide ${a} from ${e}; the bundle was built against a newer host`);return t[a]};var ta=s("@ragents/web/PluginRegistry","pluginRoutePrefixFrom");var oa=s("@ragents/web/PluginRegistry","useSurfaceController");var P=s("@ragents/web/lib/guards","isRecord");var de=s("@ragents/web/rpc","rpc");var ra=s("@ragents/web/access-token","withAccessToken");var ua=s("@ragents/host/plugin-support/actor-programs/contract","ACTOR_INVOCATIONS_STATE_ID");var ee=s("@ragents/host/plugin-support/actor-programs/contract","ACTOR_PROGRAMS_STATE_ID");var Pe=s("@ragents/host/plugin-support/actor-programs/contract","ACTOR_STATE_ID");var se=s("@ragents/host/plugin-support/actor-programs/contract","actorProgramContracts");var _a=["string","number","integer","boolean","string[]","number[]","json"];var da=8,sa=20*1024*1024,Nt=29*1024*1024,za=(e,a)=>{let t=a.trim().toLowerCase();return t?t==="video/quicktime"?"video/mov":t:{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",svg:"image/svg+xml",pdf:"application/pdf",mp4:"video/mp4",webm:"video/webm",mov:"video/mov",mpeg:"video/mpeg",mpg:"video/mpeg",txt:"text/plain",md:"text/markdown",csv:"text/csv",tsv:"text/tab-separated-values",json:"application/json",jsonl:"application/x-ndjson",xml:"application/xml",yaml:"application/yaml",yml:"application/yaml",ts:"text/plain",tsx:"text/plain",js:"application/javascript",py:"text/plain",cs:"text/plain",fs:"text/plain",html:"text/html",css:"text/css",log:"text/plain"}[e.split(".").at(-1)?.toLowerCase()??""]??"application/octet-stream"},la=e=>{if(e===void 0)return[];if(!Array.isArray(e)||e.length>da)throw new Error(`Attachments must be a list of at most ${da} files.`);let a=0;return e.map((t,o)=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Attachment ${o+1} is invalid.`);let{name:r,mediaType:d,data:l}=t;if(typeof r!="string"||!r.trim()||r.length>255||/[/\\\u0000-\u001f\u007f]/.test(r)||r==="."||r==="..")throw new Error(`Attachment ${o+1} needs a valid file name without a path.`);let c=typeof d=="string"?za(r,d):"";if(!/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/i.test(c))throw new Error(`Attachment ${r} needs a valid MIME type.`);if(typeof l=="string"&&l.length>Math.ceil(sa/3)*4)throw new Error("Attachments may be at most 20 MiB in total.");if(typeof l!="string"||l.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(l))throw new Error(`Attachment ${r} contains invalid Base64.`);let f=l.endsWith("==")?2:l.endsWith("=")?1:0;if(f&&("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(l[l.length-f-1])&(f===2?15:3))!==0)throw new Error(`Attachment ${r} contains non-canonical Base64.`);if(a+=l.length/4*3-f,a>sa)throw new Error("Attachments may be at most 20 MiB in total.");return{name:r,mediaType:c,data:l}})};var U=1,Ja="ragents.app.frame-ready",$a="ragents.app.connected",Za="ragents.app.ready",Qa="ragents.app.theme",Xa="ragents.app.invoke",Xe="ragents.app.get-state",ja="ragents.app.state",fa="ragents.app.invocation",Ya="ragents.app.error",ia="ragents.app.chat-watch",na="ragents.app.chat-unwatch",ke="ragents.app.chat-send",et="ragents.app.chat-state",ca="ragents.app.chat-ack",at=/^[A-Za-z0-9_-]{1,64}$/,Vt=64*1024,Gt=24,ae=(e,a=0)=>a>Gt?!1:e===null||typeof e=="string"||typeof e=="boolean"?!0:typeof e=="number"?Number.isFinite(e):Array.isArray(e)?e.every(t=>ae(t,a+1)):P(e)?Object.entries(e).every(([t,o])=>t.length<=256&&ae(o,a+1)):!1,Wt=e=>typeof e=="string"&&at.test(e)?e:void 0,Ka=e=>{try{return new TextEncoder().encode(JSON.stringify(e)).byteLength<=Vt}catch{return!1}},tt=e=>{if(!P(e))return{ok:!1,error:"The app message is not an object"};let a=Wt(e.requestId);if(!a)return{ok:!1,error:"The app message contains no valid requestId"};if(e.version!==U)return{ok:!1,requestId:a,error:"The app uses an unsupported bridge version"};if(e.type===Xe)return{ok:!0,request:{type:Xe,version:U,requestId:a}};if(e.type===ia||e.type===na||e.type===ke){if(typeof e.actor!="string"||!/^@?[\p{L}\p{N}_-]{1,64}$/u.test(e.actor))return{ok:!1,requestId:a,error:"The chat target must be primary or an actor handle such as @reviewer"};let t={version:U,requestId:a,actor:e.actor};if(e.type!==ke)return{ok:!0,request:{...t,type:e.type}};let o;try{o=la(e.attachments)}catch(r){return{ok:!1,requestId:a,error:r instanceof Error?r.message:String(r)}}return typeof e.text!="string"||!e.text.trim()&&!o.length||!Ka(e.text)?{ok:!1,requestId:a,error:"The chat message is empty or too large"}:{ok:!0,request:{...t,type:ke,text:e.text.trim(),...o.length?{attachments:o}:{}}}}return e.type!==Xa?{ok:!1,requestId:a,error:"The app message has an unknown type"}:typeof e.actionId!="string"||!at.test(e.actionId)?{ok:!1,requestId:a,error:"The app message contains no valid actionId"}:!ae(e.input)||!Ka(e.input)?{ok:!1,requestId:a,error:"The input of the app action is not a valid JSON value or too large"}:{ok:!0,request:{type:Xa,version:U,requestId:a,actionId:e.actionId,input:e.input}}};var _t=/^[A-Za-z0-9_-]{1,100}$/,zt=/^[A-Za-z0-9_-]{1,130}$/,Xt=/^[a-f0-9]{64}$/,Kt=new Set(_a),A=(e,a)=>{if(typeof e!="string"||!e.trim())throw new Error(`${a} is missing or empty`);return e},ot=(e,a)=>{if(e!==void 0){if(typeof e!="string")throw new Error(`${a} is not text`);return e}},le=(e,a)=>{let t=A(e,a);if(!_t.test(t))throw new Error(`${a} is not a valid identifier`);return t},me=(e,a,t)=>{let o=e.map(a);if(new Set(o).size!==o.length)throw new Error(`${t} contains duplicate identifiers`);return e},Jt=e=>{if(!P(e))throw new Error("An app action is not an object");if(e.confirmation!==null&&typeof e.confirmation!="string")throw new Error("confirmation of an app action must be text or null");if(typeof e.confirmation=="string"&&!e.confirmation.trim())throw new Error("confirmation of an app action must not be empty");return{id:le(e.id,"action.id"),label:A(e.label,"action.label"),...e.description!==void 0?{description:ot(e.description,"action.description")}:{},confirmation:e.confirmation}},ye=e=>{if(!P(e))throw new Error("An app execution is not an object");if(!Array.isArray(e.output)||e.output.some(t=>typeof t!="string"))throw new Error("output of an app execution is not a text list");let a={id:le(e.id,"invocation.id"),actorId:A(e.actorId,"invocation.actorId"),actorHandle:A(e.actorHandle,"invocation.actorHandle"),appId:A(e.appId,"invocation.appId"),actionId:le(e.actionId,"invocation.actionId"),revision:A(e.revision,"invocation.revision"),output:e.output,createdAt:A(e.createdAt,"invocation.createdAt"),requestId:le(e.requestId,"invocation.requestId")};switch(e.status){case"queued":return{...a,status:"queued"};case"running":return{...a,status:"running",startedAt:A(e.startedAt,"invocation.startedAt")};case"succeeded":{if(!ae(e.result))throw new Error("result of an app execution is not a JSON value");return{...a,status:"succeeded",startedAt:A(e.startedAt,"invocation.startedAt"),finishedAt:A(e.finishedAt,"invocation.finishedAt"),result:e.result}}case"failed":case"cancelled":return{...a,status:e.status,...e.startedAt!==void 0?{startedAt:A(e.startedAt,"invocation.startedAt")}:{},finishedAt:A(e.finishedAt,"invocation.finishedAt"),error:A(e.error,"invocation.error")};default:throw new Error("status of an app execution is invalid")}},$t=e=>{if(!P(e))throw new Error("An app placement is not an object");if(e.kind==="canvas")return{kind:"canvas",anchorActorId:A(e.anchorActorId,"placement.anchorActorId")};throw new Error("kind of an app placement must be canvas")},Zt=e=>{if(!P(e))throw new Error("An app is not an object");if(!Array.isArray(e.actions))throw new Error("actions of an app is not a list");if(!Array.isArray(e.invocations))throw new Error("invocations of an app is not a list");let a=e.placements??[];if(!Array.isArray(a))throw new Error("placements of an app is not a list");if(!P(e.state)||e.state.version!==1||!Number.isSafeInteger(e.state.revision)||!ae(e.state.values))throw new Error("state of a view does not match the state contract");let t=me(e.actions.map(Jt),f=>f.id,"actions"),o=me(e.invocations.map(ye),f=>f.id,"invocations"),r=new Set(t.map(f=>f.id));if(o.some(f=>!r.has(f.actionId)))throw new Error("An app execution refers to an unknown action");if(e.visible!==void 0&&typeof e.visible!="boolean")throw new Error("visible of an app is not a boolean");if(a.length>1)throw new Error("placements of an app contains more than one placement");let d=a.map($t),l=A(e.id,"view.id");if(!zt.test(l))throw new Error("view.id is not a valid identifier");let c=A(e.actorId,"view.actorId");if(d.some(f=>f.anchorActorId!==c))throw new Error("The view must be placed at its own actor");return{id:l,actorId:c,actorHandle:A(e.actorHandle,"view.actorHandle"),visible:e.visible!==!1,title:A(e.title,"app.title"),...e.description!==void 0?{description:ot(e.description,"app.description")}:{},revision:A(e.revision,"app.revision"),actions:t,placements:d,state:{version:1,revision:e.state.revision,values:e.state.values},invocations:o}},Qt=e=>{if(!P(e))throw new Error("A tool parameter is not an object");if(typeof e.type!="string"||!Kt.has(e.type))throw new Error("type of a tool parameter is invalid");if(typeof e.required!="boolean")throw new Error("required of a tool parameter is not a boolean");return{name:le(e.name,"parameter.name"),description:A(e.description,"parameter.description"),type:e.type,required:e.required}},jt=e=>{if(!P(e))throw new Error("A tool target is not an object");if(e.handle!==null&&typeof e.handle!="string")throw new Error("handle of a tool target must be text or null");return{actorId:A(e.actorId,"target.actorId"),handle:e.handle}},Yt=e=>{if(!P(e))throw new Error("A script tool is not an object");if(!Array.isArray(e.parameters))throw new Error("parameters of a script tool is not a list");if(!Array.isArray(e.targets))throw new Error("targets of a script tool is not a list");let a=A(e.sourceHash,"tool.sourceHash");if(!Xt.test(a))throw new Error("sourceHash of a script tool is invalid");return{actorId:A(e.actorId,"tool.actorId"),actorHandle:A(e.actorHandle,"tool.actorHandle"),functionId:le(e.functionId,"tool.functionId"),revision:A(e.revision,"tool.revision"),moduleId:le(e.moduleId,"tool.moduleId"),name:le(e.name,"tool.name"),description:A(e.description,"tool.description"),parameters:me(e.parameters.map(Qt),t=>t.name,"parameters"),card:e.card===!0,sourceHash:a,targets:me(e.targets.map(jt),t=>t.actorId,"targets"),installedBy:A(e.installedBy,"tool.installedBy")}},eo=e=>{if(!P(e))throw new Error("A source file is not an object");if(typeof e.content!="string")throw new Error("content of a source file is not text");return{path:A(e.path,"source.path"),content:e.content}},ao=e=>{if(!P(e)||!Array.isArray(e.files))throw new Error("The source list does not match the contract");return me(e.files.map(eo),a=>a.path,"files")},to=e=>{if(!P(e)||!Array.isArray(e.apps)||!Array.isArray(e.tools))throw new Error("The list of actor programs does not match the contract");return{apps:me(e.apps.map(Zt),a=>a.id,"apps"),tools:me(e.tools.map(Yt),a=>a.name,"tools")}},pa=e=>encodeURIComponent(e),oo=(e,a)=>`${e}/runs/${pa(a)}/apps`,rt=e=>({list:async(a,t)=>to(await de.call(se.apps,{runId:a},{signal:t})),source:async(a,t,o)=>ao(await de.call(se.source,{runId:a,moduleId:t},{signal:o})),frameUrl:(a,t,o)=>ra(`${oo(e,a)}/${pa(t)}/frame?revision=${pa(o)}`),invoke:async(a,t,o,r,d,l,c)=>ye(await de.call(se.action,{runId:a,appId:t,revision:o,actionId:r,requestId:d,input:l},{signal:c})),invocation:async(a,t,o,r)=>ye(await de.call(se.invocation,{runId:a,appId:t,invocationId:o},{signal:r})),invokeFunction:async(a,t,o,r,d,l,c)=>ye(await de.call(se.function,{runId:a,actorHandle:t,revision:o,functionId:r,requestId:d,input:l},{signal:c})),functionInvocation:async(a,t,o,r)=>ye(await de.call(se.functionInvocation,{runId:a,actorHandle:t,invocationId:o},{signal:r}))});var Q=s("@ragents/web/AccessContext","useAccess");var be=s("react","createContext");var Le=s("react","createElement");var Te=s("react","forwardRef");var G=s("react","useCallback");var Re=s("react","useContext");var W=s("react","useEffect");var ma=s("react","useLayoutEffect");var j=s("react","useMemo");var B=s("react","useRef");var D=s("react","useState");var ut=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function dt(e,a,t=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ut(e),size:24,node:a,...t.length>0?{aliases:t}:{}}}var st=e=>{let a="",t=!1;for(let o of e){if(o==="-"||o==="_"||o<=" "){t=a.length>0;continue}a.length===0?a+=o.toLowerCase():a+=t?o.toUpperCase():o,t=!1}return a};var lt=e=>{let a=st(e);return a.charAt(0).toUpperCase()+a.slice(1)};var Be=(...e)=>e.filter((a,t,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===t).join(" ").trim();var fe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function La(e){return e!=null}function ft(e,a={}){let t=a.attributeNames??{},o=n=>t[n]??n,r=e.size??e.width??fe.width,d=e.size??e.height??fe.height,l=e.aliases?.filter(n=>typeof n=="string"&&n.trim()!=="").map(n=>`lucide-${n}`)??[],c=[...e.name?[`lucide-${e.name}`]:[],...l],f=a.className?.split(" ").filter(Boolean)??[],C=a.includeDefaultClasses===!1?Be(...f):Be("lucide",...c,...f),g=a.absoluteStrokeWidth?Number(a.strokeWidth??fe["stroke-width"])*Number(e.size??e.width??fe.width)/Number(a.size??a.width??fe.width):a.strokeWidth??fe["stroke-width"];return["svg",{...Object.entries(fe).reduce((n,[x,y])=>(n[o(x)]=y,n),{}),..."color"in a&&a.color&&{[o("stroke")]:a.color},..."size"in a&&La(a.size)&&{[o("width")]:a.size,[o("height")]:a.size},..."width"in a&&La(a.width)&&{[o("width")]:a.width},..."height"in a&&La(a.height)&&{[o("height")]:a.height},[o("stroke-width")]:g,...C&&{[o("class")]:C},[o("viewBox")]:`0 0 ${r} ${d}`,...a.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(n=>{let[x,y,E]=n,v=a.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...y}:y;return E?[x,v,E]:[x,v]})]}function it(e,a={}){return ft(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var nt=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var ro=be({});var ct=()=>Re(ro);var pt=Te(({color:e,size:a,width:t,height:o,strokeWidth:r,absoluteStrokeWidth:d,nonScalingStroke:l,className:c="",children:f,iconNode:C=[],icon:g={node:C,aliases:[],size:24},...m},n)=>{let{size:x=24,strokeWidth:y=2,absoluteStrokeWidth:E=!1,nonScalingStroke:v=!1,color:q="currentColor",className:I=""}=ct()??{},M=!!f||nt(m),[N,K,J=[]]=it(g,{color:e??q,width:t??a??x,height:o??a??x,strokeWidth:r??y,absoluteStrokeWidth:d??E,nonScalingStroke:l??v,className:Be(I,c),hasA11yProp:M,attributes:m});return Le(N,{ref:n,...K},[...J.map(([Ce,b])=>Le(Ce,b)),...Array.isArray(f)?f:[f]])});function he(e,a=[],t=[]){let o=typeof e=="string"?dt(e,a,t):e,r=Te(({className:d,...l},c)=>Le(pt,{ref:c,icon:o,className:d,...l}));return o.name&&(r.displayName=lt(o.name)),r}var mt={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};mt.node;var Me=he(mt);var Lt={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Lt.node;var Fe=he(Lt);var xt={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};xt.node;var De=he(xt);var ve=s("@ragents/web/ui","Alert");var Ke=s("@ragents/web/ui","Badge");var z=s("@ragents/web/ui","Button");var xa=s("@ragents/web/ui","Dialog");var Ia=s("@ragents/web/ui","DialogContent");var ga=s("@ragents/web/ui","DialogTitle");var qe=s("@ragents/web/ui","Empty");var Je=s("@ragents/web/ui","EmptyContent");var Ue=s("@ragents/web/ui","EmptyDescription");var He=s("@ragents/web/ui","EmptyHeader");var Oe=s("@ragents/web/ui","EmptyMedia");var Ee=s("@ragents/web/ui","EmptyTitle");var Ca=s("@ragents/web/ui","Input");var xe=s("@ragents/web/ui","Spinner");var ha=s("@ragents/web/ui","Textarea");var O=s("@ragents/web/ui","cn");var Sa=s("@ragents/web/Toolbar","ToolbarCopy");var $e=s("@ragents/web/Toolbar","ToolbarItem");var wa=s("@ragents/web/Toolbar","ToolbarLabel");var Aa=s("@ragents/web/Toolbar","ToolbarText");import{askPayloadOf as io,ASK_PLUGIN_ID as no}from"/plugins/ragents.ask/web/exports/ask-payload.js";import{answerQuestion as co}from"/plugins/ragents.ask/web/exports/web/api.js";import{QuestionCard as po}from"/plugins/ragents.ask/web/exports/web/QuestionCard.js";var Pa=s("@ragents/web/run-view","runActorFrom");var Y=s("@ragents/web/run-view","runViewFrom");import{useSurfaceEntities as mo}from"/plugins/ragents.orchestration/web/exports/web/surface-entities.js";import{SURFACE_TILE_DRAG_TYPE as Lo}from"/plugins/ragents.orchestration/web/exports/web/tile-docking.js";import{ProgramSlotContext as xo}from"/plugins/ragents.orchestration/web/exports/web/program-slot.js";var ka=s("@ragents/web/SourceCode","SourceCode");var It=(e,a)=>{let o=Y(e)?.pluginStates.find(d=>d.pluginId===ee&&d.scope.kind==="actor"&&d.scope.actorId===a);if(!o||!P(o.state)||o.state.program===null)return;let r=o.state.program;if(!P(r)||r.actorId!==a||typeof r.name!="string"||typeof r.revision!="string")throw new Error("The source code mapping of the actor program is invalid.");return{name:r.name,revision:r.revision}},ya=e=>{let a=Y(e);return a?a.pluginStates.flatMap(t=>{if(t.pluginId!==ee||t.scope.kind!=="actor")return[];let o=t.scope.actorId,r=a.actors.find(l=>l.id===o);if(!r||r.kind==="human"||r.lifecycle?.kind==="stopped")return[];if(!P(t.state)||!P(t.state.program))return[];let d=t.state.program;if(d.actorId!==r.id||d.actorHandle!==r.handle||typeof d.revision!="string"||!Array.isArray(d.views))throw new Error(`The view program of @${r.handle} is invalid.`);return d.views.map(l=>{if(!P(l)||typeof l.id!="string"||typeof l.title!="string")throw new Error(`A view of @${r.handle} is invalid.`);return{id:l.id,title:l.title,actorId:r.id,actorHandle:r.handle,revision:d.revision,app:l}})}):[]},gt=(e,a)=>{let t=Y(a);if(!e||!t)return;let o=new Map(ya(t).map(d=>[d.id,d])),r=new Set(t.actors.filter(d=>d.kind!=="human"&&d.lifecycle?.kind!=="stopped").map(d=>d.id));return{...e,apps:e.apps.flatMap(d=>{let l=o.get(d.id);if(!l||l.actorId!==d.actorId||l.revision!==d.revision)return[];let c=t.pluginStates.find(C=>C.pluginId===Pe&&C.scope.kind==="actor"&&C.scope.actorId===d.actorId),f=c?c.state:d.state.values;if(!ae(f))throw new Error(`The state of @${d.actorHandle} is not a JSON value.`);return[{...d,visible:l.app.visible!==!1,state:{...d.state,values:f}}]}),tools:e.tools.filter(d=>r.has(d.actorId)&&t.pluginStates.some(l=>l.pluginId===ee&&l.scope.kind==="actor"&&l.scope.actorId===d.actorId&&P(l.state)&&P(l.state.program)&&l.state.program.revision===d.revision))}};var Ne=s("react/jsx-runtime","Fragment");var u=s("react/jsx-runtime","jsx");var p=s("react/jsx-runtime","jsxs");function ba({api:e,moduleId:a,runId:t,revision:o,expandedByDefault:r=!1}){let[d,l]=D(r),[c,f]=D({kind:"loading"}),[C,g]=D();W(()=>{if(!d)return;let n=new AbortController;return f({kind:"loading"}),e.source(t,a,n.signal).then(x=>{n.signal.aborted||(f({kind:"ready",files:x}),g(x.find(y=>y.path==="src/server.ts")?.path??x.find(y=>/\.tsx?$/.test(y.path))?.path??x[0]?.path))},x=>{n.signal.aborted||f({kind:"error",message:x instanceof Error?x.message:String(x)})}),()=>n.abort()},[e,d,a,t,o]);let m=c.kind==="ready"?c.files.find(n=>n.path===C)??c.files[0]:void 0;return p("section",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] justify-items-start gap-2",children:[u("h3",{className:"text-xs font-semibold text-muted-foreground",children:"Source code"}),!d&&u(z,{onClick:()=>l(!0),size:"sm",variant:"outline",children:"Show source code"}),d&&p(Ne,{children:[u("p",{className:"text-[0.67rem] text-muted-foreground",children:"Source of the installed build"}),c.kind==="loading"&&p("p",{className:"flex items-center gap-2 text-[0.72rem] text-muted-foreground",children:[u(xe,{"aria-hidden":!0,"aria-label":void 0,role:void 0}),u("span",{children:"Loading source code"})]}),c.kind==="error"&&u(ve,{className:"w-full",variant:"destructive",children:c.message}),c.kind==="ready"&&u("div",{className:"flex flex-wrap gap-1.5",children:c.files.map(n=>u("button",{className:O("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.path===m?.path&&"border-[color-mix(in_srgb,var(--primary)_48%,var(--border))] bg-primary/9 text-foreground"),onClick:()=>g(n.path),type:"button",children:n.path},n.path))}),m&&u(ka,{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:m.content,path:m.path}),!r&&u(z,{onClick:()=>l(!1),size:"sm",variant:"outline",children:"Hide source code"})]})]})}var Ct=(e,a,t)=>{let o=It(a,t);return o&&u(ba,{api:e,expandedByDefault:!0,moduleId:o.name,revision:o.revision,runId:a.id},`${a.id}:${t}:${o.revision}`)};var uo=e=>new Promise((a,t)=>{e.throwIfAborted();let r=setTimeout(()=>{e.removeEventListener("abort",d),a()},350),d=()=>{clearTimeout(r),t(e.reason)};e.addEventListener("abort",d,{once:!0})}),ht=async(e,a,t,o,r,d)=>{let l=await e.invokeFunction(a,t.actorHandle,t.revision,t.functionId,crypto.randomUUID().replaceAll("-",""),o,r);for(d(l);l.status==="queued"||l.status==="running";)await uo(r),l=await e.functionInvocation(a,t.actorHandle,l.id,r),d(l);return l};var so=(e,a)=>{let t=String(a.get(e.name)??"");if(e.type==="boolean")return e.required?a.has(e.name):t===""?void 0:t==="true";if(t===""&&!e.required)return;if(e.type==="string")return t;if(!t.trim())throw new Error(`${e.name}: Please enter a value.`);if(e.type==="number"||e.type==="integer"){let r=Number(t);if(!Number.isFinite(r)||e.type==="integer"&&!Number.isInteger(r))throw new Error(`${e.name} is not a valid ${e.type==="integer"?"integer":"number"}.`);return r}if(e.type==="string[]"&&!t.trimStart().startsWith("["))return t.split(/\r?\n|,/).map(r=>r.trim()).filter(Boolean);let o;try{o=JSON.parse(t)}catch{throw new Error(`${e.name}: Please enter valid JSON.`)}if(!ae(o))throw new Error(`${e.name}: Not a valid JSON value.`);if(e.type==="string[]"&&(!Array.isArray(o)||!o.every(r=>typeof r=="string")))throw new Error(`${e.name}: Please enter a list of texts.`);if(e.type==="number[]"&&(!Array.isArray(o)||!o.every(r=>typeof r=="number")))throw new Error(`${e.name}: Please enter a JSON list of numbers.`);return o},St=(e,a)=>Object.fromEntries(e.flatMap(t=>{let o=so(t,a);return o===void 0?[]:[[t.name,o]]}));var lo="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";function Ze({session:e,tool:a,detail:t=!1}){let o=Q().can("runs.write"),{api:r,refresh:d,runId:l}=X(),[c,f]=D(),[C,g]=D(!1),[m,n]=D(),x=B(void 0);W(()=>()=>x.current?.abort(),[]);let y=m?Ie(e,{invocations:[m]}):void 0,E=async I=>{if(I.preventDefault(),x.current||!o)return;let M=new AbortController;x.current=M,f(void 0),n(void 0);try{let N=St(a.parameters,new FormData(I.currentTarget));g(!0),await ht(r,l,a,N,M.signal,K=>{M.signal.aborted||n(K)}),M.signal.aborted||await d()}catch(N){M.signal.aborted||f(N instanceof Error?N.message:String(N))}finally{M.signal.aborted||g(!1),x.current===M&&(x.current=void 0)}},v=y?"Confirmation required":m?.status==="queued"?"Waiting for execution":m?.status==="running"?"Function running":m?.status==="succeeded"?"Executed":m?.status==="cancelled"?"Cancelled":m?.status==="failed"?"Failed":C?"Sending call":void 0,q=c??(m?.status==="failed"||m?.status==="cancelled"?m.error:void 0);return p("div",{className:"grid min-w-0 gap-2.5",children:[p("form",{"aria-label":`Call ${a.name}`,className:O("grid",t?"gap-3.5":"gap-2"),onSubmit:I=>{E(I)},children:[a.parameters.length===0&&t&&u("p",{children:"This function needs no parameters."}),a.parameters.map(I=>p("label",{className:O("grid gap-[3px] font-[650] text-foreground [&_small]:text-[0.61rem] [&_small]:font-normal [&_small]:text-muted-foreground",t?"text-[0.8rem]":"text-[0.68rem]",I.type==="boolean"&&I.required&&"grid-cols-[auto_minmax(0,1fr)] items-center gap-x-1.5 [&_small]:col-start-2"),children:[I.type==="boolean"&&I.required&&u("input",{"aria-description":I.description,className:"m-0 accent-primary",disabled:!o||C,name:I.name,type:"checkbox"}),p("span",{children:[I.name,I.required?" *":"",t&&p("small",{className:"ml-2",children:[I.type,I.required?"":" (optional)"]})]}),I.type==="boolean"?!I.required&&p("select",{className:lo,disabled:!o||C,name:I.name,defaultValue:"",children:[u("option",{value:"",children:"Not passed"}),u("option",{value:"true",children:"Yes"}),u("option",{value:"false",children:"No"})]}):I.type==="json"||I.type==="string[]"||I.type==="number[]"||t&&I.type==="string"?u(ha,{"aria-description":I.description,className:"min-h-8 resize-y font-normal",disabled:!o||C,name:I.name,placeholder:I.description,required:I.required,rows:2}):u(Ca,{"aria-description":I.description,className:"font-normal",disabled:!o||C,name:I.name,placeholder:I.description,required:I.required,step:I.type==="integer"?"1":I.type==="number"?"any":void 0,type:I.type==="integer"||I.type==="number"?"number":"text"}),(t||I.type==="boolean")&&u("small",{children:I.description}),I.type==="json"&&u("small",{children:"Enter as JSON."}),I.type==="number[]"&&u("small",{children:"Enter as a JSON list, e.g. [1, 2, 3]."}),I.type==="string[]"&&u("small",{children:"One entry per line or as a JSON list."})]},I.name)),p("div",{className:"flex flex-wrap items-center gap-2",children:[u(z,{disabled:!o||C,type:"submit",children:C?"Running ...":"Run"}),v&&u("span",{className:"text-[0.63rem] text-muted-foreground",role:"status",children:v})]})]}),y&&u(Se,{action:y,session:e},y.id),q&&u("p",{className:"text-destructive [overflow-wrap:anywhere]",role:"alert",children:q}),m?.status==="succeeded"&&!c&&p("section",{"aria-label":"Result",className:"grid min-w-0 gap-2",children:[u("h3",{children:"Result"}),u("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]",children:typeof m.result=="string"?m.result:JSON.stringify(m.result,null,2)})]})]})}function wt(){return u("svg",{"aria-hidden":!0,fill:"none",height:"14",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 24 24",width:"14",children:u("path",{d:"M9 3H3v6M15 3h6v6M3 15v6h6M21 15v6h-6"})})}var At=e=>{let a=Y(e),t=new Set(a?.pluginStates.filter(o=>o.pluginId===ee&&o.scope.kind==="actor").map(o=>o.scope.kind==="actor"?o.scope.actorId:"")??[]);return JSON.stringify({actors:a?.actors.filter(o=>t.has(o.id)).map(o=>[o.id,o.handle,o.lifecycle?.kind==="stopped"]).sort(([o],[r])=>String(o).localeCompare(String(r)))??[],states:(a?.pluginStates??[]).filter(o=>o.pluginId===ee||o.pluginId===ua||o.pluginId===Pe&&o.scope.kind==="actor"&&t.has(o.scope.actorId)).map(o=>[`${o.pluginId}:${o.scope.kind==="actor"?o.scope.actorId:"run"}`,o.state]).sort(([o],[r])=>String(o).localeCompare(String(r)))})};var kt=(e,a=!0)=>{let t=new Set(e.map(r=>r.id)),o=new Map;for(let r of e)for(let d of r.invocations)if(d.status==="queued"||d.status==="running"){if(!a&&!t.has(d.appId))continue;o.set(`${d.actorId}/${d.id}`,t.has(d.appId)?{kind:"app",appId:d.appId,invocationId:d.id}:{kind:"function",actorHandle:d.actorHandle,invocationId:d.id})}return[...o.entries()].sort(([r],[d])=>r.localeCompare(d)).map(([,r])=>r)},yt=(e,a,t,o)=>t.kind==="app"?e.invocation(a,t.appId,t.invocationId,o):e.functionInvocation(a,t.actorHandle,t.invocationId,o),Pt=e=>{let a=e.status==="queued"?e.createdAt:e.status==="running"?e.startedAt:e.finishedAt,t=Date.parse(a);return Number.isNaN(t)?0:t},bt=e=>e.invocations.reduce((a,t)=>!a||Pt(t)>=Pt(a)?t:a,void 0);var Ta=be(void 0),fo=()=>Re(Ta),X=()=>{let e=fo();if(!e)throw new Error("The actor program provider is not active");return e};var Ge="ragents.actor-programs.tools",Tt="flex size-[34px] items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary",Io="grid flex-none grid-cols-[auto_minmax(0,1fr)] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-[9px]",Rt="mb-2 text-[0.66rem] tracking-[0.075em] text-muted-foreground uppercase",go="grid size-[30px] flex-none place-items-center rounded-lg border border-info/25 bg-glass-app text-info",Mt=new Set(["queued","running"]),Co=700,Bt=(e,a)=>e&&{...e,apps:e.apps.map(t=>{if(t.actorId!==a.actorId||t.revision!==a.revision)return t;let o=t.invocations.some(r=>r.id===a.id);return{...t,invocations:o?t.invocations.map(r=>r.id===a.id?a:r):[...t.invocations,a]}})};function Ft({api:e,children:a,session:t}){let o=t.session.id,r=Q().can("runs.inspect"),[d,l]=D(),c=j(()=>gt(d,t.runView),[d,t.runView]),[f,C]=D(),[g,m]=D(),n=ge(t).filter(b=>b.app.visible!==!1),x=g?.runId===o&&n.some(b=>b.id===g.appId)?g.appId:void 0,y=G(()=>m(void 0),[]),E=G(b=>{if(!ge(t).some(k=>k.id===b&&k.app.visible!==!1))throw new Error("The actor view is not available on the surface.");m({runId:o,appId:b})},[o,t]);W(()=>{g&&!x&&m(void 0)},[g,x]);let v=B(0),q=G(async()=>{let b=++v.current;try{let k=await e.list(o);if(b!==v.current)return;l(k),C(void 0)}catch(k){if(b!==v.current)return;C(k instanceof Error?k.message:String(k))}},[e,o]),I=j(()=>At(t.runView),[t.runView]);W(()=>(l(void 0),C(void 0),()=>{v.current+=1}),[o]),W(()=>{q()},[I,q]);let M=j(()=>kt(c?.apps??[],r),[r,c]),N=M.length>0?JSON.stringify(M):"";W(()=>{if(!N)return;let b=M,k=!1,_,$,ie=async()=>{$=new AbortController;let te=await Promise.allSettled(b.map(async H=>({target:H,invocation:await yt(e,o,H,$?.signal)})));if(k)return;let oe=te.flatMap(H=>H.status==="fulfilled"?[H.value]:[]);oe.length>0&&(l(H=>oe.reduce((Z,We)=>Bt(Z,We.invocation),H)),C(void 0));let re=te.find(H=>H.status==="rejected");re&&C(re.reason instanceof Error?re.reason.message:String(re.reason)),oe.some(H=>!Mt.has(H.invocation.status))?await q():k||(_=window.setTimeout(()=>{ie()},Co))};return _=window.setTimeout(()=>{ie()},250),()=>{k=!0,_!==void 0&&window.clearTimeout(_),$?.abort()}},[N,e,q,o]);let K=G(async(b,k,_,$,ie)=>{v.current+=1;let te=await e.invoke(o,b,k,_,$,ie);return v.current+=1,l(oe=>Bt(oe,te)),te},[e,o]),J=j(()=>({api:e,error:f,fullscreenAppId:x,invoke:K,listing:c,openFullscreen:E,closeFullscreen:y,refresh:q,runId:o}),[e,f,x,K,c,E,y,q,o]),Ce=j(()=>({runId:o,needsAnswer:(b,k)=>{let _=c?.apps.find($=>$.id===k);return _!==void 0&&Ie(b,_)!==void 0},openFullscreen:E,source:(b,k)=>Ct(e,b,k)}),[e,c,E,o]);return u(Ta.Provider,{value:J,children:u(xo.Provider,{value:Ce,children:a})})}var ge=e=>ya(e.runView),Ie=(e,a)=>{let t=Y(e.runView);if(!t)return;let o=new Set(a.invocations.filter(r=>Mt.has(r.status)).map(r=>r.id));return t.actions.find(r=>r.owner===no&&r.status==="pending"&&r.askedBy===t.ownerId&&r.parameters.source===ee&&o.has(r.parameters.invocationId))};function Se({action:e,session:a}){let t=Q(),[o,r]=D(!1),[d,l]=D(),c=async f=>{if(!o){r(!0),l(void 0);try{await co(a.session.id,e.id,f)}catch(C){l(C instanceof Error?C.message:String(C)),r(!1)}}};return p("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",children:[p("header",{className:"grid gap-0.5",children:[u("strong",{className:"text-[0.72rem] text-foreground",children:"Confirmation in the host"}),u("span",{className:"text-xs text-muted-foreground",children:"The app cannot answer this decision itself."})]}),o?u("p",{className:"text-xs text-muted-foreground",children:"Processing answer"}):u(po,{onAnswer:t.can("runs.write")?f=>{c(f)}:void 0,question:io(e.payload)??{question:e.title,options:[],multi:!1},text:e.title}),d&&u("p",{className:"text-xs text-destructive",role:"alert",children:d})]})}var ho=e=>e.handle?`@${e.handle}`:e.actorId;function Dt({active:e,navigation:a,selection:t,session:o}){let{api:r,error:d,listing:l,refresh:c,runId:f}=X(),C=typeof t=="string"?t:void 0,g=l?.tools.find(m=>m.name===C);return!l&&!d?p("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-muted-foreground",children:[u(xe,{"aria-hidden":!0,"aria-label":void 0,role:void 0}),u("span",{children:"Loading functions"})]}):l?C&&!g?p(qe,{children:[p(He,{children:[u(Oe,{children:u(Ve,{})}),u(Ee,{children:"Function no longer available"}),u(Ue,{children:"The selected actor function is no longer installed in this run."})]}),u(Je,{children:u(z,{onClick:()=>a.openTab(Ge,null),variant:"outline",children:"To overview"})})]}):g?p("div",{className:"flex h-full min-h-0 flex-col",children:[p("header",{className:Io,children:[u(z,{"aria-label":"Back to function overview",onClick:()=>a.openTab(Ge,null),size:"icon-sm",title:"Back to function overview",variant:"outline",children:u(Me,{})}),p("span",{className:"grid min-w-0 gap-px",children:[u("strong",{className:"truncate text-[0.82rem] font-semibold",title:g.name,children:g.name}),p("small",{className:"truncate text-xs text-muted-foreground",children:["Function of @",g.actorHandle]})]})]}),p("div",{className:"flex min-h-0 flex-col gap-[22px] overflow-y-auto px-workspace-inset pt-[18px] pb-7",children:[p("div",{className:"grid grid-cols-[42px_minmax(0,1fr)] items-start gap-3",children:[u("span",{className:O(Tt,"size-[42px] bg-accent"),children:u(Ve,{size:22})}),p("div",{children:[u("h2",{className:"text-[1.05rem] text-foreground",children:g.name}),u("p",{className:"mt-1 text-[0.74rem] leading-[1.45] text-muted-foreground",children:g.description})]})]}),p("section",{children:[u("h3",{className:Rt,children:"Available to"}),u("div",{className:"flex flex-wrap gap-1.5",children:g.targets.map(m=>u("span",{className:"rounded-full bg-primary/9 px-2 py-1 text-xs text-foreground",children:ho(m)},m.actorId))})]}),p("section",{children:[u("h3",{className:Rt,children:"Parameter"}),e&&u(Ze,{detail:!0,session:o,tool:g},`${f}:${g.actorId}:${g.functionId}:${g.revision}`)]}),u(ba,{api:r,moduleId:g.moduleId,revision:g.revision,runId:f}),u("dl",{className:"grid grid-cols-2 gap-2",children:[{label:"Program",value:g.moduleId,title:void 0},{label:"Source hash",value:g.sourceHash.slice(0,12),title:g.sourceHash}].map(m=>p("div",{className:"grid gap-[3px] rounded-lg bg-foreground/4 px-2.5 py-2",children:[u("dt",{className:"text-[0.61rem] text-muted-foreground uppercase",children:m.label}),u("dd",{className:"truncate font-mono text-xs text-foreground",title:m.title,children:m.value})]},m.label))})]})]}):l.tools.length===0?u(qe,{children:p(He,{children:[u(Oe,{children:u(Ve,{})}),u(Ee,{children:"No functions yet"}),u(Ue,{children:"Actor functions created by agents in this run appear here."})]})}):p("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]",children:[d&&u(ve,{className:"mb-1",role:"status",variant:"destructive",children:d}),l.tools.map(m=>p("button",{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]",onClick:()=>a.openTab(Ge,m.name),type:"button",children:[u("span",{className:Tt,children:u(Ve,{size:20})}),p("span",{className:"grid min-w-0 gap-0.5",children:[u("strong",{className:"truncate text-[0.8rem] font-semibold",children:m.name}),u("small",{className:"truncate text-[0.69rem] text-muted-foreground",children:m.description})]}),p(Ke,{className:"max-w-[132px] truncate @max-[470px]:hidden",variant:"secondary",children:[m.targets.length," ",m.targets.length===1?"agent":"agents"]}),u(So,{})]},m.name))]}):p(qe,{children:[p(He,{children:[u(Oe,{children:u(Ve,{})}),u(Ee,{children:"Functions could not be loaded"}),u(Ue,{children:d})]}),u(Je,{children:u(z,{onClick:()=>{c()},variant:"outline",children:"Retry"})})]})}function vt({session:e}){let a=Q().can("runs.inspect"),t=oa(),o=mo(e.session.id),{closeFullscreen:r,fullscreenAppId:d,openFullscreen:l}=X(),c=ge(e).filter(f=>f.app.visible!==!1);return c.length===0?null:u("nav",{"aria-label":"Actor views",className:"flex min-w-0 flex-none items-stretch",children:c.map(f=>p("div",{role:"group","aria-label":f.title,className:O("relative flex flex-none items-stretch border-r border-border hover:bg-accent focus-within:bg-accent",d===f.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-['']"),children:[p($e,{as:"button",className:"max-w-[214px] border-r-0 font-bold hover:not-disabled:bg-transparent",draggable:a,onDragStart:C=>{if(!a){C.preventDefault();return}C.dataTransfer.setData(Lo,`app:${f.id}`),C.dataTransfer.effectAllowed="move",r()},onClick:()=>{if(!t)throw new Error("The app entries need the surface controller of the orchestration plugin.");r(),t.acceptSelection({type:"run-app",id:f.id})},"aria-label":`Mini-app: ${f.title} of @${f.actorHandle}`,title:`Mini-app: ${f.title} of @${f.actorHandle}${a?". Drag onto a tile to dock.":""}`,type:"button",children:[u("span",{className:O(go,!o.has(`app:${f.id}`)&&"bg-transparent"),children:u(Fe,{size:20})}),p(Sa,{children:[p(wa,{children:["@",f.actorHandle]}),u(Aa,{children:f.title})]})]}),u($e,{as:"button","aria-expanded":d===f.id,"aria-label":`${f.title} ${d===f.id?"close full view":"open in full view"}`,title:`${f.title} ${d===f.id?"close full view":"open in full view"}`,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-['']",onClick:()=>d===f.id?r():l(f.id),type:"button",children:u(wt,{})})]},`app:${f.id}`))})}function qt(){let{listing:e}=X();return e&&e.tools.length>0?u(Ke,{variant:"secondary",children:e.tools.length}):null}function Ve({size:e=28}){return p("svg",{"aria-hidden":!0,fill:"none",height:e,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 24 24",width:e,children:[u("path",{d:"M14.5 6.5 17.5 3.5l3 3-3 3"}),u("path",{d:"m9.5 17.5-3 3-3-3 3-3"}),u("path",{d:"M13 5H9a4 4 0 0 0-4 4v5.5M11 19h4a4 4 0 0 0 4-4V9.5"})]})}function So(){return u("svg",{"aria-hidden":!0,fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",viewBox:"0 0 24 24",width:"14",children:u("path",{d:"m9 18 6-6-6-6"})})}var Ra=s("@ragents/web/run-panel/input-bridge","hostInputEnabled");var Ba=s("@ragents/web/run-panel/input-bridge","isRunPanelKeyboardMessage");var Ma=s("@ragents/web/run-panel/input-bridge","relayFrameInput");var Fa=s("@ragents/web/theme","useResolvedTheme");var Da=s("@ragents/web/api","sendActorMessage");var va=s("@ragents/engine/src/http/contracts","actorByHandle");var qa=s("@ragents/web/actor-conversation","actorChatMessages");var Ua=s("@ragents/web/chat/chat-target","programChatNotice");var Qe=(e,a)=>{let t=Y(e.runView);if(!t||t.id!==e.session.id)throw new Error("The run view for this chat is not available yet");let o=a==="primary"?t.actors.find(r=>r.id===t.primaryActorId):va(t.actors,a);if(!o||o.kind==="human"){let r=t.actors.filter(d=>d.kind!=="human").map(d=>`@${d.handle}`).join(", ");throw new Error(`The chat target is not available. Allowed are primary and: ${r||"no actors yet"}`)}return{view:t,actor:o}},Ha=(e,a)=>{try{let{view:t,actor:o}=Qe(e,a),r=o.id===t.primaryActorId,d=o.kind==="script"?Ua:e.conversationError??(e.connected?o.lifecycle?.kind==="stopped"?`@${o.handle} stopped: ${o.lifecycle.reason}. It accepts no input until it is restarted`:void 0:"The connection to the run is interrupted");return{owner:o.id,messages:qa(t,o,e.messages,e.actorConversations?.[o.id]),running:r?e.running:o.lifecycle?.kind==="running",...o.kind==="script"?{readOnly:!0}:{},...d?{error:d}:{}}}catch(t){return{messages:[],running:!1,error:t instanceof Error?t.message:String(t)}}};var Oa=s("@ragents/web/chat/useAttachmentCapabilities","getAttachmentCapabilities");var wo=new Set(["queued","running"]),Ao=512,Ea=e=>JSON.stringify(e),Po={success:"bg-success",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",confirm:"bg-warning",error:"bg-destructive"};function je({api:e,app:a,invoke:t,pendingConfirmationInvocationId:o,presentation:r,runId:d,session:l}){let c=Q(),f=Fa(),C=B(f);C.current=f;let g=B(c.can("runs.write"));g.current=c.can("runs.write");let m=B(null),n=B(void 0),x=B(0),y=B(!1),E=B(a),v=B(l);v.current=l;let q=B(new Map),I=B(new Map),M=B(new Set),N=B(""),K=B(new Map),[J,Ce]=D(!1),[b,k]=D(),[_,$]=D(),[ie,te]=D([]);E.current=a;let oe=j(()=>e.frameUrl(d,a.id,a.revision),[e,a.id,a.revision,d]),re=j(()=>crypto.randomUUID().replaceAll("-",""),[oe]),ne=G(()=>{x.current+=1,y.current=!1,n.current?.close(),n.current=void 0,q.current.clear(),I.current.clear(),Ce(!1),te([])},[]),H=G((L,i,w)=>{let R=x.current,F=T=>{if(R!==x.current||L!==n.current||!q.current.has(i))return;let S=Ha(v.current,i),ue={...S,...T,readOnly:S.readOnly===!0||!g.current},h=JSON.stringify(ue);w===void 0&&q.current.get(i)===h||(q.current.set(i,h),L.postMessage({type:et,version:U,actor:i,snapshot:ue,...w?{requestId:w}:{}}))};try{let T=v.current,S=Qe(T,i).actor,ue=JSON.stringify([T.session.id,S.id,S.execution?.driver]),h=I.current.get(ue);if(!h){let V=Oa(T.session.id,S.id).then(pe=>({attachmentCapabilities:pe}),pe=>({attachmentCapabilitiesError:pe instanceof Error?pe.message:String(pe)}));h={pending:V},I.current.set(ue,h);let aa=h;V.then(pe=>{aa.result=pe})}F(h.result??{attachmentCapabilitiesError:"Checking model capabilities ..."}),h.result||h.pending.then(F)}catch(T){F({attachmentCapabilitiesError:T instanceof Error?T.message:String(T)})}},[]),Z=G((L,i,w)=>{L.postMessage({type:Ya,version:U,...i?{requestId:i}:{},message:w})},[]),We=G(async(L,i,w,R)=>{if(!(w!==x.current||i!==n.current)){$(void 0),te(F=>[...F,L.requestId]);try{if(!g.current)throw new Error("You have read-only access to this actor view.");let F=await t(R.id,R.revision,L.actionId,L.requestId,L.input);if(w!==x.current||i!==n.current)return;K.current.set(F.id,Ea(F)),i.postMessage({type:fa,version:U,requestId:L.requestId,invocation:F})}catch(F){if(w!==x.current||i!==n.current)return;let T=F instanceof Error?F.message:String(F);$(T),Z(i,L.requestId,T)}finally{w===x.current&&i===n.current&&te(F=>F.filter(T=>T!==L.requestId))}}},[t,Z]),_e=G((L,i)=>{let w=E.current;L.postMessage({type:ja,version:U,...i?{requestId:i}:{},state:w.state??null})},[]),Va=G((L,i,w,R)=>{if(w!==x.current||i!==n.current||Ma(window,L,h=>{w===x.current&&i===n.current&&i.postMessage(h)}))return;let F=L;if(F?.type===$a&&F.version===U){y.current=!0,k(void 0),Ce(!0);return}let T=tt(L);if(!T.ok){Z(i,T.requestId,T.error);return}let{request:S}=T;if(M.current.has(S.requestId)){Z(i,S.requestId,"This requestId has already been used");return}if(M.current.add(S.requestId),M.current.size>Ao){let h=M.current.values().next().value;h!==void 0&&M.current.delete(h)}if(S.type===ia){q.current.set(S.actor,""),H(i,S.actor,S.requestId);return}if(S.type===na){q.current.delete(S.actor),i.postMessage({type:ca,version:U,requestId:S.requestId});return}if(S.type===ke){(async()=>{try{if(!g.current)throw new Error("You have read-only access to this chat.");let h=v.current,V=Ha(h,S.actor);if(V.error)throw new Error(V.error);let{actor:aa}=Qe(h,S.actor);await Da(h.session.id,aa.id,S.text,S.attachments),w===x.current&&i===n.current&&i.postMessage({type:ca,version:U,requestId:S.requestId})}catch(h){w===x.current&&i===n.current&&Z(i,S.requestId,h instanceof Error?h.message:String(h))}})();return}if(S.type===Xe){_e(i,S.requestId);return}if(!R.actions.find(h=>h.id===S.actionId)){Z(i,S.requestId,"The requested app action is not installed");return}We(S,i,w,R)},[We,Z,H,_e]),Ye=G((L,i)=>{if(n.current){L.close();return}ne();let w=x.current;n.current=L,L.onmessage=R=>Va(R.data,L,w,i),L.onmessageerror=()=>{w===x.current&&L===n.current&&Z(L,void 0,"The app sent an unreadable message")},L.start(),M.current=new Set,N.current=JSON.stringify(i.state??null),K.current=new Map(i.invocations.map(R=>[R.id,Ea(R)])),L.postMessage({type:Za,version:U,theme:C.current,hostInput:Ra(window),app:{id:i.id,actorId:i.actorId,actorHandle:i.actorHandle,title:i.title,description:i.description,actions:i.actions},actor:{id:i.actorId,handle:i.actorHandle},state:i.state??null,invocations:i.invocations}),k(void 0)},[ne,Va,Z]);ma(()=>{let L=m.current;if(!L)return;ne(),$(void 0),k(void 0);let i=E.current,w=!1,R,F=h=>{w?Ye(h,i):R=h},T=h=>{let V=h.data;if(h.source===L.contentWindow&&h.origin==="null"&&V?.type==="ragents.app.escape"&&V.version===U&&V.token===re){window.dispatchEvent(new KeyboardEvent("keydown",{...Ba(V.keyboard)?V.keyboard.event:{key:"Escape"},bubbles:!0,cancelable:!0}));return}if(!(h.source!==L.contentWindow||h.origin!=="null"||V?.type!==Ja||V.version!==U||V.token!==re||h.ports.length!==1)){if(R||n.current){h.ports[0].close();return}F(h.ports[0])}},S=()=>{if(!w){if(w=!0,R){let h=R;R=void 0,Ye(h,i)}return}R?.close(),R=void 0,ne(),k("The app left its installed page and was disconnected.")};window.addEventListener("message",T),L.addEventListener("load",S),L.src=`${oe}#ragentsBridge=${encodeURIComponent(re)}`;let ue=window.setTimeout(()=>{y.current||k("The app did not open a valid host bridge.")},5e3);return()=>{window.clearTimeout(ue),window.removeEventListener("message",T),L.removeEventListener("load",S),R?.close(),ne()}},[Ye,re,ne,oe]),W(()=>{J&&n.current?.postMessage({type:Qa,version:U,theme:f})},[J,f]),W(()=>{if(!J)return;let L=JSON.stringify(a.state??null);if(L!==N.current){N.current=L;let i=n.current;i&&_e(i)}a.invocations.forEach(i=>{let w=Ea(i);K.current.get(i.id)!==w&&(K.current.set(i.id,w),n.current?.postMessage({type:fa,version:U,invocation:i}))})},[a.invocations,a.state,J,_e]),W(()=>{if(!(!J||!n.current))for(let L of q.current.keys())H(n.current,L)},[J,H,l]);let ce=bt(a),ea=a.invocations.filter(L=>wo.has(L.status)),Ga=ea.find(L=>L.id===o),Wa=Ga?a.actions.find(L=>L.id===Ga.actionId):void 0,ze=b?{tone:"error",title:"App disconnected",detail:b}:ie.length>0?{tone:"running",title:"Starting action",detail:`${ie.length} request(s)`}:Wa?{tone:"confirm",title:"Waiting for your confirmation",detail:Wa.label}:ea.length>0?{tone:"running",title:"Action running",detail:ea.map(L=>a.actions.find(i=>i.id===L.actionId)?.label.trim()||(c.can("runs.inspect")?L.actionId:"")).filter(Boolean).join(", ")}:_?{tone:"error",title:"Action failed",detail:_}:ce?.status==="failed"?{tone:"error",title:"Last action failed",detail:ce.error}:ce?.status==="cancelled"?{tone:"muted",title:"Last action cancelled",detail:ce.actionId}:ce?.status==="succeeded"?{tone:"success",title:"Last action completed",detail:ce.output.at(-1)??ce.actionId}:J?void 0:{tone:"muted",title:"Loading app",detail:"Bridge not connected yet"},we=ze&&(r==="fullscreen"?ze.tone==="error":ze.tone!=="success")?ze:void 0,Ae=r!=="fullscreen";return p("div",{className:"flex min-h-0 flex-1 flex-col",children:[u("div",{"aria-live":"polite",role:"status",className:O("grid min-w-0 items-center overflow-hidden text-xs text-muted-foreground",Ae?"order-1 h-7 flex-[0_0_28px] grid-cols-[auto_minmax(0,1fr)] gap-1.5 px-workspace-inset py-1":"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]"),children:we&&p(Ne,{children:[!Ae&&u("span",{className:O("size-[7px] rounded-full bg-muted-foreground/55",Po[we.tone])}),u("strong",{className:O("font-semibold whitespace-nowrap text-foreground",Ae?"text-[0.63rem]":"text-[0.7rem]"),children:we.title}),u("span",{className:"truncate",title:we.detail,children:we.detail})]})}),u("div",{className:O("relative flex min-h-0 flex-1 overflow-hidden",Ae?"bg-transparent":"bg-background"),children:u("iframe",{allow:"camera 'none'; geolocation 'none'; microphone 'none'",className:O("absolute inset-0 h-full w-full min-h-0 min-w-0 border-0",Ae?"bg-transparent":"bg-background"),ref:m,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-forms allow-downloads","aria-label":a.title,title:""})})]})}function Ut({session:e}){let{api:a,closeFullscreen:t,error:o,fullscreenAppId:r,invoke:d,listing:l,runId:c}=X(),f=B(null);if(!r)return null;let C=ge(e).find(x=>x.id===r&&x.app.visible!==!1);if(!C)return null;let g=l?.apps.find(x=>x.id===r),m=C.title,n=g?Ie(e,g):void 0;return u(xa,{open:!0,onOpenChange:x=>{x||t()},children:p(Ia,{className:"h-[calc(100%-2*clamp(16px,2vw,24px))] w-[calc(100%-2*clamp(16px,2vw,24px))] gap-0 bg-background p-0",initialFocus:f,scope:"surface",showCloseButton:!1,size:"full",children:[p("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card py-2 pr-3 pl-4",children:[u(ga,{className:"min-w-0 flex-1 truncate text-[0.9rem]",render:u("h2",{}),children:m}),u(z,{"aria-label":`Close ${m} full view`,className:"rounded-full",onClick:t,ref:f,size:"icon",title:`Close ${m} full view`,variant:"outline",children:u(De,{})})]}),p("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",children:[n&&u(Se,{action:n,session:e},n.id),g?u(je,{api:a,app:g,invoke:d,pendingConfirmationInvocationId:n?.parameters.invocationId,presentation:"fullscreen",runId:c,session:e}):u("p",{className:"flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground",role:o?"alert":"status",children:o??"Loading actor view"})]})]})},`${c}:${r}`)}function Ht({actor:e,session:a}){let t=Q().can("runs.inspect"),{listing:o}=X(),r=Pa(e);if(!t||r.lifecycle?.kind==="stopped")return null;let d=o?.tools.filter(l=>l.card&&l.actorId===r.id)??[];return d.length===0?null:u("section",{className:"grid min-w-0 gap-[9px]",children:d.map(l=>p("article",{"aria-label":l.name,className:"min-w-0",children:[u("strong",{children:l.name}),u(Ze,{session:a,tool:l})]},`${a.session.id}:${l.actorId}:${l.functionId}:${l.revision}`))})}var Ot=e=>ge(e).flatMap(a=>{let t=a.app.placements,o=Array.isArray(t)?t.find(d=>P(d)&&d.kind==="canvas"):void 0,r=P(o)?o:void 0;if(r&&typeof r.anchorActorId!="string")throw new Error(`The surface placement of the actor view ${a.title} is invalid`);if(r&&r.anchorActorId!==a.actorId)throw new Error(`The view ${a.title} belongs to @${a.actorHandle}.`);return[{id:a.id,title:a.title,visible:a.app.visible!==!1,anchorActorId:a.actorId,data:{actorId:a.actorId,actorHandle:a.actorHandle},entity:{type:"run-app",id:a.id}}]});function Et({definition:e,session:a}){let{api:t,invoke:o,listing:r,runId:d}=X(),l=r?.apps.find(g=>g.id===e.id),c=l?Ie(a,l):void 0,f=e.title??e.id,C=l?u(je,{api:t,app:l,invoke:o,pendingConfirmationInvocationId:c?.parameters.invocationId,presentation:"tiled",runId:d,session:a}):p("div",{className:"flex flex-1 items-center justify-center gap-2 text-[0.7rem] text-muted-foreground",children:[u(xe,{"aria-hidden":!0,"aria-label":void 0,role:void 0}),u("span",{children:"Loading actor view"})]});return u("article",{"aria-label":f,className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:p("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",children:[c&&u(Se,{action:c,session:a},c.id),C]})})}var ko="ragents.actor-programs";function yo(){return p("svg",{"aria-hidden":!0,fill:"none",height:"15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 24 24",width:"15",children:[u("path",{d:"M14.5 6.5 17.5 3.5l3 3-3 3"}),u("path",{d:"m9.5 17.5-3 3-3-3 3-3"}),u("path",{d:"M13 5H9a4 4 0 0 0-4 4v5.5M11 19h4a4 4 0 0 0 4-4V9.5"})]})}var bo=(e,a)=>{let t=rt(a);function o({children:r,session:d}){return p(Ft,{api:t,session:d,children:[r,u(Ut,{session:d})]})}return{...e,needsRunView:!0,SessionProvider:o,sessionHeaders:[{id:"ragents.actor-programs.quick-list",placement:"surface",order:250,Header:vt}],cardSections:[{id:"ragents.actor-programs.tools",order:400,Section:Ht}],surfaceElements:[{id:"ragents.actor-programs.apps",order:400,select:Ot,Element:Et}],workspaceTabs:[{readRight:"runs.inspect",id:Ge,label:"Functions",order:251,Icon:yo,Panel:Dt,Badge:qt}]}},Na={id:ko},Uf={...Na,activate:e=>bo(Na,ta(Na.id,e))};export{ko as ACTOR_PROGRAMS_PLUGIN_ID,Uf as webPlugin};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:
|