@schlenkr/ragents 0.1.10 → 0.1.12
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/README.md +1 -1
- package/apps/server/package.json +1 -1
- package/apps/server/src/access-projection.ts +6 -6
- 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 +38 -38
- 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 +27 -27
- package/apps/server/src/profile/compose.ts +12 -7
- package/apps/server/src/profile/plugin-discovery.ts +14 -14
- 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 +62 -57
- 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-CpPi6QLr.js} +1 -1
- package/apps/web/dist/assets/main-DJmCHGzM.js +11 -0
- package/apps/web/dist/assets/mermaid-HWGCJPDP-q-mf1kLN.js +608 -0
- package/apps/web/dist/assets/runPanel-nk_aMxSn.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 +91 -91
- 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/QuasselHost.tsx +1 -1
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +8 -4
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/bundles/ragents.todo/server/index.js +5 -8
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/bundles/ragents.workspace/server/index.js +83 -83
- 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 +3725 -552
- 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-storage.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 +44 -44
- package/packages/workspace-executor/src/errors.ts +1 -1
- package/packages/workspace-executor/src/executor.ts +16 -16
- package/packages/workspace-executor/src/files.ts +31 -31
- package/packages/workspace-executor/src/index.ts +1 -1
- 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 +36 -36
- 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 +3 -3
- 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 +3 -3
- package/plugins/ragents.orchestration/web/ActorChatControls.tsx +4 -5
- 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/contract.ts +0 -3
- 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 +63 -63
- 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 +50 -50
- 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 +31 -31
- 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 +49 -49
- 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
package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js.map → chunk-KMZWOVTI.js.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../plugins/ragents.documents/contract.ts"],
|
|
4
|
-
"sourcesContent": ["import { Type, type Static } from \"typebox\";\nimport { defineOperation } from \"@ragents/engine/src/rpc/contract\";\n\nexport const documentsApiPrefix = \"/api/plugins/ragents.documents\";\n\nconst fileEntry = Type.Object({\n path: Type.String({ minLength: 1 }),\n size: Type.Integer({ minimum: 0 }),\n modifiedAt: Type.String({ minLength: 1 }),\n}, { additionalProperties: false });\n\nconst filesListing = Type.Object({\n groups: Type.Array(Type.Object({\n directory: Type.String({ minLength: 1 }),\n files: Type.Array(fileEntry),\n }, { additionalProperties: false })),\n loose: Type.Array(fileEntry),\n truncated: Type.Boolean(),\n}, { additionalProperties: false });\n\nexport type RunFileEntry = Static<typeof fileEntry>;\n\nexport type RunFilesListing = Static<typeof filesListing>;\n\nexport const documentsContracts = {\n files: defineOperation({\n id: \"ragents.documents.files\",\n description: \"
|
|
5
|
-
"mappings": ";;;;AAAA,SAAS,YAAyB;AAClC,SAAS,uBAAuB;AAEzB,IAAM,qBAAqB;AAElC,IAAM,YAAY,KAAK,OAAO;AAAA,EAC5B,MAAM,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAAA,EAClC,MAAM,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC;AAAA,EACjC,YAAY,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAC1C,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAElC,IAAM,eAAe,KAAK,OAAO;AAAA,EAC/B,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,IAC7B,WAAW,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAAA,IACvC,OAAO,KAAK,MAAM,SAAS;AAAA,EAC7B,GAAG,EAAE,sBAAsB,MAAM,CAAC,CAAC;AAAA,EACnC,OAAO,KAAK,MAAM,SAAS;AAAA,EAC3B,WAAW,KAAK,QAAQ;AAC1B,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAM3B,IAAM,qBAAqB;AAAA,EAChC,OAAO,gBAAgB;AAAA,IACrB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,QAAQ,CAAC,WAAW;AAAA,IACpB,OAAO,KAAK,OAAO;AAAA,MACjB,OAAO,KAAK,OAAO,EAAE,WAAW,GAAG,WAAW,IAAI,aAAa,
|
|
4
|
+
"sourcesContent": ["import { Type, type Static } from \"typebox\";\nimport { defineOperation } from \"@ragents/engine/src/rpc/contract\";\n\nexport const documentsApiPrefix = \"/api/plugins/ragents.documents\";\n\nconst fileEntry = Type.Object({\n path: Type.String({ minLength: 1 }),\n size: Type.Integer({ minimum: 0 }),\n modifiedAt: Type.String({ minLength: 1 }),\n}, { additionalProperties: false });\n\nconst filesListing = Type.Object({\n groups: Type.Array(Type.Object({\n directory: Type.String({ minLength: 1 }),\n files: Type.Array(fileEntry),\n }, { additionalProperties: false })),\n loose: Type.Array(fileEntry),\n truncated: Type.Boolean(),\n}, { additionalProperties: false });\n\nexport type RunFileEntry = Static<typeof fileEntry>;\n\nexport type RunFilesListing = Static<typeof filesListing>;\n\nexport const documentsContracts = {\n files: defineOperation({\n id: \"ragents.documents.files\",\n description: \"A run's file store as groups and loose files. Right: runs.read.\",\n rights: [\"runs.read\"],\n input: Type.Object({\n runId: Type.String({ minLength: 1, maxLength: 64, description: \"Run id\" }),\n }, { additionalProperties: false }),\n result: filesListing,\n }),\n};\n"],
|
|
5
|
+
"mappings": ";;;;AAAA,SAAS,YAAyB;AAClC,SAAS,uBAAuB;AAEzB,IAAM,qBAAqB;AAElC,IAAM,YAAY,KAAK,OAAO;AAAA,EAC5B,MAAM,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAAA,EAClC,MAAM,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC;AAAA,EACjC,YAAY,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAC1C,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAElC,IAAM,eAAe,KAAK,OAAO;AAAA,EAC/B,QAAQ,KAAK,MAAM,KAAK,OAAO;AAAA,IAC7B,WAAW,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAAA,IACvC,OAAO,KAAK,MAAM,SAAS;AAAA,EAC7B,GAAG,EAAE,sBAAsB,MAAM,CAAC,CAAC;AAAA,EACnC,OAAO,KAAK,MAAM,SAAS;AAAA,EAC3B,WAAW,KAAK,QAAQ;AAC1B,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAM3B,IAAM,qBAAqB;AAAA,EAChC,OAAO,gBAAgB;AAAA,IACrB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,QAAQ,CAAC,WAAW;AAAA,IACpB,OAAO,KAAK,OAAO;AAAA,MACjB,OAAO,KAAK,OAAO,EAAE,WAAW,GAAG,WAAW,IAAI,aAAa,SAAS,CAAC;AAAA,IAC3E,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAAA,IAClC,QAAQ;AAAA,EACV,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ const require = __ragentsCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
documentsApiPrefix,
|
|
5
5
|
documentsContracts
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-KMZWOVTI.js";
|
|
7
7
|
|
|
8
8
|
// server/index.ts
|
|
9
9
|
import path5 from "node:path";
|
|
@@ -16,23 +16,23 @@ import { defineRunFunction } from "@ragents/engine";
|
|
|
16
16
|
import { alwaysAvailable } from "@ragents/host/plugin-support/tool-availability.js";
|
|
17
17
|
var documentWriteToolMetadata = {
|
|
18
18
|
name: "document_write",
|
|
19
|
-
label: "
|
|
19
|
+
label: "Store document",
|
|
20
20
|
nativeTool: true,
|
|
21
|
-
description: "
|
|
22
|
-
longDescription: '
|
|
21
|
+
description: "Stores a file with the given content in this run's file store.",
|
|
22
|
+
longDescription: 'Documents, reports and intermediate products belong in the file store, not in the working directory - that only holds what belongs to the task itself. The user sees the store in the "Documents" area, grouped by subdirectory. To put a file from the workspace into the store, read it first with read and pass the content here as content. The store is not a bash path: it does not live in the workspace and can only be written through this tool.'
|
|
23
23
|
};
|
|
24
24
|
var relativeStorePath = (value) => {
|
|
25
25
|
const normalized = value.replace(/^\.\//, "");
|
|
26
26
|
if (path.isAbsolute(normalized) || normalized.split("/").includes("..") || normalized.trim() === "") {
|
|
27
|
-
throw new Error("path
|
|
27
|
+
throw new Error("path must be relative to the file store, without a leading / and without ..");
|
|
28
28
|
}
|
|
29
29
|
return normalized;
|
|
30
30
|
};
|
|
31
31
|
var createDocumentWriteTool = (filesFor) => defineRunFunction({
|
|
32
32
|
...documentWriteToolMetadata,
|
|
33
33
|
schema: Type.Object({
|
|
34
|
-
path: Type.String({ minLength: 1, description: "
|
|
35
|
-
content: Type.String({ description: "
|
|
34
|
+
path: Type.String({ minLength: 1, description: "Path in the file store, e.g. topic/report.md" }),
|
|
35
|
+
content: Type.String({ description: "The complete content of the file" })
|
|
36
36
|
}, { additionalProperties: false }),
|
|
37
37
|
resultSchema: Type.String(),
|
|
38
38
|
available: alwaysAvailable,
|
|
@@ -42,7 +42,7 @@ var createDocumentWriteTool = (filesFor) => defineRunFunction({
|
|
|
42
42
|
const target = path.join(await filesFor(scope.caller.runId), relative);
|
|
43
43
|
await mkdir(path.dirname(target), { recursive: true });
|
|
44
44
|
await writeFile(target, input.content, "utf8");
|
|
45
|
-
return `
|
|
45
|
+
return `Stored in the file store: ${relative} (${Buffer.byteLength(input.content, "utf8")} bytes)`;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -76,7 +76,7 @@ var mediaTypes = {
|
|
|
76
76
|
};
|
|
77
77
|
var visibleEntries = async (directory) => {
|
|
78
78
|
const entries = await readdir(directory, { withFileTypes: true });
|
|
79
|
-
return entries.filter((entry) => !entry.name.startsWith(".") && !entry.isSymbolicLink()).sort((left, right) => left.name.localeCompare(right.name, "
|
|
79
|
+
return entries.filter((entry) => !entry.name.startsWith(".") && !entry.isSymbolicLink()).sort((left, right) => left.name.localeCompare(right.name, "en-US"));
|
|
80
80
|
};
|
|
81
81
|
var collectFiles = async (directory, relative, budget) => {
|
|
82
82
|
const files = [];
|
|
@@ -114,11 +114,11 @@ var listingOf = async (root) => {
|
|
|
114
114
|
};
|
|
115
115
|
var resolveInside = async (root, relative) => {
|
|
116
116
|
if (!relative || relative.includes("\0") || relative.includes("\\") || path2.isAbsolute(relative) || relative.split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
|
|
117
|
-
throw new Error("
|
|
117
|
+
throw new Error("Invalid file path");
|
|
118
118
|
}
|
|
119
119
|
const rootReal = await realpath(root);
|
|
120
120
|
const real = await realpath(path2.join(rootReal, relative));
|
|
121
|
-
if (real !== rootReal && !real.startsWith(rootReal + path2.sep)) throw new Error("
|
|
121
|
+
if (real !== rootReal && !real.startsWith(rootReal + path2.sep)) throw new Error("Invalid file path");
|
|
122
122
|
return real;
|
|
123
123
|
};
|
|
124
124
|
var runFileExists = async (root, relative) => {
|
|
@@ -138,7 +138,7 @@ var createFileContentRoute = (options) => ({
|
|
|
138
138
|
matches: (request, url) => request.method === "GET" && contentPattern.test(url.pathname),
|
|
139
139
|
handle: async ({ response, request, url }) => {
|
|
140
140
|
const match = url.pathname.match(contentPattern);
|
|
141
|
-
if (!match) throw new Error("
|
|
141
|
+
if (!match) throw new Error("Invalid documents route");
|
|
142
142
|
const [, runId] = match;
|
|
143
143
|
await guardedJsonRoute({
|
|
144
144
|
response,
|
|
@@ -149,7 +149,7 @@ var createFileContentRoute = (options) => ({
|
|
|
149
149
|
const relative = url.searchParams.get("path") ?? "";
|
|
150
150
|
const file = await resolveInside(await options.filesFor(runId), relative);
|
|
151
151
|
const info = await lstat(file);
|
|
152
|
-
if (!info.isFile()) throw new Error("
|
|
152
|
+
if (!info.isFile()) throw new Error("Invalid file path");
|
|
153
153
|
const content = await readFile(file);
|
|
154
154
|
response.writeHead(200, {
|
|
155
155
|
"Cache-Control": "no-store",
|
|
@@ -166,16 +166,16 @@ var createFileContentRoute = (options) => ({
|
|
|
166
166
|
import { facesOperator } from "@ragents/host/plugin-support/tool-availability.js";
|
|
167
167
|
var showDocumentToolMetadata = {
|
|
168
168
|
name: "show_document",
|
|
169
|
-
label: "
|
|
169
|
+
label: "Show document",
|
|
170
170
|
nativeTool: true,
|
|
171
|
-
description: "
|
|
172
|
-
longDescription: "
|
|
171
|
+
description: "Shows documents completely in the interface; file paths only apply to this run's file store.",
|
|
172
|
+
longDescription: "ALWAYS use this tool when the user wants to see the content of a file or a longer document - instead of copying or paraphrasing the content in the chat answer. path only shows a file from this run's file store, NOT from your working directory. Everything else - files of the working directory and content you produced yourself - goes through content; if the content comes from a file, take it VERBATIM from the last read or write result, never retyped from memory."
|
|
173
173
|
};
|
|
174
|
-
var sourceRule = "content
|
|
175
|
-
var titleSchema = Type2.String({ description: "
|
|
174
|
+
var sourceRule = "content and path exclude each other: valid are { title, content, format } for self-produced content and files of the working directory, and { title, path, format } for files of the file store - exactly one of the two must be set.";
|
|
175
|
+
var titleSchema = Type2.String({ description: "Title of the display, e.g. the file name" });
|
|
176
176
|
var formatSchema = Type2.Optional(Type2.Union(
|
|
177
177
|
[Type2.Literal("markdown"), Type2.Literal("text"), Type2.Literal("html")],
|
|
178
|
-
{ description: "
|
|
178
|
+
{ description: "Rendering, default markdown" }
|
|
179
179
|
));
|
|
180
180
|
var documentSource = (input) => {
|
|
181
181
|
if (input.content === void 0 === (input.path === void 0)) throw new Error(sourceRule);
|
|
@@ -186,10 +186,10 @@ var createShowDocumentTool = (filesFor) => defineRunFunction2({
|
|
|
186
186
|
schema: Type2.Object({
|
|
187
187
|
title: titleSchema,
|
|
188
188
|
content: Type2.Optional(Type2.String({
|
|
189
|
-
description: "
|
|
189
|
+
description: "The complete content - for files from the working directory and for self-produced content, i.e. everything that is not in the file store. " + sourceRule
|
|
190
190
|
})),
|
|
191
191
|
path: Type2.Optional(Type2.String({
|
|
192
|
-
description: "
|
|
192
|
+
description: "File from this run's file store, relative to the store (e.g. topic/file.md). Only files stored there can be shown this way - for paths of the working directory use content. The content is shown directly from the file and never has to be retyped. " + sourceRule
|
|
193
193
|
})),
|
|
194
194
|
format: formatSchema
|
|
195
195
|
}, { additionalProperties: false }),
|
|
@@ -198,15 +198,15 @@ var createShowDocumentTool = (filesFor) => defineRunFunction2({
|
|
|
198
198
|
run: async ({ caller }, _toolCallId, input) => {
|
|
199
199
|
const source = documentSource(input);
|
|
200
200
|
if (source.kind === "content")
|
|
201
|
-
return `
|
|
201
|
+
return `Shown to the user: ${input.title}`;
|
|
202
202
|
const path6 = source.path;
|
|
203
203
|
if (path6.startsWith("/") || path6.split("/").includes(".."))
|
|
204
|
-
throw new Error("path
|
|
204
|
+
throw new Error("path must be relative to the file store, without a leading / and without ..");
|
|
205
205
|
if (!await runFileExists(await filesFor(caller.runId), path6))
|
|
206
206
|
throw new Error(
|
|
207
|
-
`${source.path}
|
|
207
|
+
`${source.path} is not in this run's file store. Only files of the file store can be shown via path - for files from the working directory and for self-produced content, pass the content via content.`
|
|
208
208
|
);
|
|
209
|
-
return `
|
|
209
|
+
return `Shown to the user: ${input.title} (file ${path6} from the file store)`;
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
|
|
@@ -244,7 +244,7 @@ var RunDocumentStore = class {
|
|
|
244
244
|
this.#options = options;
|
|
245
245
|
}
|
|
246
246
|
async directoryFor(runId) {
|
|
247
|
-
if (!isRunId(runId)) throw new Error(`
|
|
247
|
+
if (!isRunId(runId)) throw new Error(`Invalid run id: ${runId}`);
|
|
248
248
|
const directory = this.#options.externalRoot ? path4.join(this.#options.externalRoot, runId) : this.#options.sessionDirectory(runId);
|
|
249
249
|
await mkdir2(directory, { recursive: true });
|
|
250
250
|
return directory;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../plugins/ragents.documents/server/index.ts", "../../../plugins/ragents.documents/server/document-write-tool.ts", "../../../plugins/ragents.documents/server/show-document-tool.ts", "../../../plugins/ragents.documents/server/files-route.ts", "../../../plugins/ragents.documents/server/tool-contributor.ts", "../../../plugins/ragents.documents/server/config.ts", "../../../plugins/ragents.documents/server/store.ts"],
|
|
4
|
-
"sourcesContent": ["import path from \"node:path\";\nimport type { RAgentsPlugin } from \"@ragents/engine\";\nimport { createDocumentToolContributor } from \"./tool-contributor.js\";\nimport { documentsApiPrefix } from \"../contract.js\";\nimport { createFileContentRoute, createFilesMethod } from \"./files-route.js\";\nimport { ragentsDocumentsConfig, ragentsDocumentsConfigDescriptors } from \"./config.js\";\nimport { RunDocumentStore } from \"./store.js\";\nimport { pluginAsset } from \"@ragents/host/plugin-support/plugin-folder.js\";\nimport type { PluginModule } from \"@ragents/host/plugin-support/plugin-module.js\";\nimport { boundToTools, handlebarsPrompt } from \"@ragents/host/plugin-support/prompt.js\";\nimport { documentStoreToken } from \"@ragents/host/ragents/document-store.js\";\nimport { runGuardToken } from \"@ragents/host/ragents/host-services.js\";\n\nconst documentsPlugin: RAgentsPlugin = {\n manifest: { id: \"ragents.documents\" },\n register: (host) => {\n const store = new RunDocumentStore({\n sessionDirectory: (runId) => host.storage.session(runId, \"documents\"),\n sessionsDirectoryPattern: path.join(host.storage.sessionsRoot, \"{runId}\", \"plugins\", host.manifest.id, \"documents\"),\n externalRoot: ragentsDocumentsConfig.externalRoot,\n });\n const filesFor = (runId: string) => store.directoryFor(runId);\n host.provide(documentStoreToken, store);\n host.config(...ragentsDocumentsConfigDescriptors);\n host.clientConfig({ routePrefix: documentsApiPrefix });\n host.functions(createDocumentToolContributor(filesFor));\n host.prompts(boundToTools({ ...handlebarsPrompt(\"ragents.documents.prompt\", 400, pluginAsset(\"ragents.documents\", \"prompt.hbs\")), delivery: \"initial\" }, \"document_write\"));\n const files = { filesFor, ensureSession: host.service(runGuardToken) };\n host.methods(createFilesMethod(files));\n host.http(createFileContentRoute(files));\n },\n};\n\nexport const plugin: PluginModule = {\n requires: [\"ragents.orchestration\"],\n create: () => documentsPlugin,\n};\n", "import { mkdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Type } from \"typebox\";\nimport { defineRunFunction, type RunFunction } from \"@ragents/engine\";\nimport { alwaysAvailable } from \"@ragents/host/plugin-support/tool-availability.js\";\n\nexport const documentWriteToolMetadata = {\n name: \"document_write\",\n label: \"Dokument ablegen\",\n nativeTool: true,\n description: \"Legt eine Datei mit dem \u00FCbergebenen Inhalt in der Dateiablage dieses Runs ab.\",\n longDescription: \"Dokumente, Berichte und Zwischenprodukte geh\u00F6ren in die Dateiablage, nicht ins \"\n + \"Arbeitsverzeichnis - dort steht nur, was zum Auftrag selbst geh\u00F6rt. Der Benutzer sieht die \"\n + \"Ablage im Bereich \\\"Dokumente\\\", nach Unterordnern gruppiert. Soll eine Datei aus dem \"\n + \"Arbeitsbereich in die Ablage, lies sie zuerst mit read und \u00FCbergib den Inhalt hier als content. \"\n + \"Die Ablage ist kein Bash-Pfad: sie liegt nicht im Arbeitsbereich und ist nur \u00FCber dieses Werkzeug \"\n + \"beschreibbar.\",\n} as const;\n\nconst relativeStorePath = (value: string): string => {\n const normalized = value.replace(/^\\.\\//, \"\");\n if (path.isAbsolute(normalized) || normalized.split(\"/\").includes(\"..\") || normalized.trim() === \"\") {\n throw new Error(\"path muss relativ zur Dateiablage sein, ohne f\u00FChrenden / und ohne ..\");\n }\n return normalized;\n};\n\nexport const createDocumentWriteTool = (filesFor: (runId: string) => Promise<string>): RunFunction =>\n defineRunFunction({\n ...documentWriteToolMetadata,\n schema: Type.Object({\n path: Type.String({ minLength: 1, description: \"Pfad in der Dateiablage, etwa thema/bericht.md\" }),\n content: Type.String({ description: \"Der vollst\u00E4ndige Inhalt der Datei\" }),\n }, { additionalProperties: false }),\n resultSchema: Type.String(),\n available: alwaysAvailable,\n executionMode: \"sequential\",\n run: async (scope, _toolCallId, input) => {\n const relative = relativeStorePath(input.path);\n const target = path.join(await filesFor(scope.caller.runId), relative);\n await mkdir(path.dirname(target), { recursive: true });\n await writeFile(target, input.content, \"utf8\");\n return `In der Dateiablage abgelegt: ${relative} (${Buffer.byteLength(input.content, \"utf8\")} Byte)`;\n },\n });\n", "import { Type } from \"typebox\";\nimport { defineRunFunction, type RunFunction } from \"@ragents/engine\";\nimport { runFileExists } from \"./files-route.js\";\nimport { facesOperator } from \"@ragents/host/plugin-support/tool-availability.js\";\n\nexport const showDocumentToolMetadata = {\n name: \"show_document\",\n label: \"Dokument anzeigen\",\n nativeTool: true,\n description: \"Zeigt Dokumente vollst\u00E4ndig in der Oberfl\u00E4che; Dateipfade gelten nur f\u00FCr die Dateiablage dieses Runs.\",\n longDescription: \"Nutze dieses Werkzeug IMMER, wenn der Benutzer den \"\n + \"Inhalt einer Datei oder ein l\u00E4ngeres Dokument sehen m\u00F6chte - statt den Inhalt in die \"\n + \"Chat-Antwort zu kopieren oder zu paraphrasieren. path zeigt ausschlie\u00DFlich eine Datei aus \"\n + \"der Dateiablage dieses Runs an, NICHT aus deinem Arbeitsverzeichnis. \"\n + \"Alles andere - Dateien des Arbeitsverzeichnisses und selbst erzeugte Inhalte - geht \u00FCber \"\n + \"content; stammt der Inhalt aus einer Datei, \u00FCbernimm ihn dort W\u00D6RTLICH aus dem letzten \"\n + \"read- oder write-Ergebnis, niemals aus dem Ged\u00E4chtnis neu getippt.\",\n} as const;\n\nconst sourceRule = \"content und path schlie\u00DFen einander aus: g\u00FCltig sind { title, content, format } f\u00FCr \"\n + \"selbst erzeugte Inhalte und Dateien des Arbeitsverzeichnisses und { title, path, format } f\u00FCr Dateien \"\n + \"der Dateiablage - genau eines von beiden muss gesetzt sein.\";\n\nconst titleSchema = Type.String({ description: \"Titel der Anzeige, z.B. der Dateiname\" });\nconst formatSchema = Type.Optional(Type.Union(\n [Type.Literal(\"markdown\"), Type.Literal(\"text\"), Type.Literal(\"html\")],\n { description: \"Darstellung, Default markdown\" }));\n\nconst documentSource = (input: { content?: string; path?: string }):\n | { kind: \"content\" }\n | { kind: \"file\"; path: string } => {\n if ((input.content === undefined) === (input.path === undefined)) throw new Error(sourceRule);\n\n return input.path === undefined ? { kind: \"content\" } : { kind: \"file\", path: input.path };\n};\n\nexport const createShowDocumentTool = (filesFor: (runId: string) => Promise<string>): RunFunction =>\n defineRunFunction({\n ...showDocumentToolMetadata,\n schema: Type.Object({\n title: titleSchema,\n content: Type.Optional(Type.String({\n description: \"Der vollst\u00E4ndige Inhalt - f\u00FCr Dateien aus dem Arbeitsverzeichnis und f\u00FCr \"\n + \"selbst erzeugte Inhalte, also alles, was nicht in der Dateiablage liegt. \" + sourceRule,\n })),\n path: Type.Optional(Type.String({\n description: \"Datei aus der Dateiablage dieses Runs, relativ zur Ablage (z.B. thema/datei.md). \"\n + \"Nur dort abgelegte Dateien sind so anzeigbar - f\u00FCr Pfade des Arbeitsverzeichnisses \"\n + \"content nutzen. Der Inhalt wird direkt aus der Datei angezeigt und muss nie \"\n + \"abgetippt werden. \" + sourceRule,\n })),\n format: formatSchema,\n }, { additionalProperties: false }),\n resultSchema: Type.String(),\n available: facesOperator,\n run: async ({ caller }, _toolCallId, input) => {\n const source = documentSource(input);\n\n if (source.kind === \"content\")\n return `Dem Benutzer angezeigt: ${input.title}`;\n\n const path = source.path;\n if (path.startsWith(\"/\") || path.split(\"/\").includes(\"..\"))\n throw new Error(\"path muss relativ zur Dateiablage sein, ohne f\u00FChrenden / und ohne ..\");\n if (!await runFileExists(await filesFor(caller.runId), path))\n throw new Error(\n `${source.path} liegt nicht in der Dateiablage dieses Runs. \u00DCber path sind nur Dateien der `\n + \"Dateiablage anzeigbar - f\u00FCr Dateien aus dem Arbeitsverzeichnis und f\u00FCr selbst erzeugte \"\n + \"Inhalte den Inhalt \u00FCber content \u00FCbergeben.\",\n );\n return `Dem Benutzer angezeigt: ${input.title} (Datei ${path} aus der Dateiablage)`;\n },\n });\n", "import { lstat, readdir, readFile, realpath } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { implement, type HttpRouteContribution, type MethodContribution } from \"@ragents/engine\";\nimport { guardedJsonRoute } from \"@ragents/host/plugin-support/http.js\";\nimport { documentsContracts, type RunFileEntry, type RunFilesListing } from \"../contract.js\";\n\n\nconst contentPattern = /^\\/api\\/plugins\\/ragents\\.documents\\/runs\\/([A-Za-z0-9_-]{1,64})\\/files\\/content$/;\n\nconst MAX_ENTRIES = 1000;\n\nconst mediaTypes: Record<string, string> = {\n \".md\": \"text/markdown; charset=utf-8\",\n \".markdown\": \"text/markdown; charset=utf-8\",\n \".html\": \"text/html; charset=utf-8\",\n \".htm\": \"text/html; charset=utf-8\",\n \".txt\": \"text/plain; charset=utf-8\",\n \".log\": \"text/plain; charset=utf-8\",\n \".csv\": \"text/csv; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".svg\": \"image/svg+xml\",\n \".webp\": \"image/webp\",\n \".pdf\": \"application/pdf\",\n};\n\nconst visibleEntries = async (directory: string) => {\n const entries = await readdir(directory, { withFileTypes: true });\n return entries\n .filter((entry) => !entry.name.startsWith(\".\") && !entry.isSymbolicLink())\n .sort((left, right) => left.name.localeCompare(right.name, \"de\"));\n};\n\nconst collectFiles = async (\n directory: string,\n relative: string,\n budget: { remaining: number },\n): Promise<RunFileEntry[]> => {\n const files: RunFileEntry[] = [];\n for (const entry of await visibleEntries(directory)) {\n if (budget.remaining <= 0) break;\n const absolute = path.join(directory, entry.name);\n const entryPath = relative ? `${relative}/${entry.name}` : entry.name;\n if (entry.isDirectory()) {\n files.push(...await collectFiles(absolute, entryPath, budget));\n } else if (entry.isFile()) {\n const info = await lstat(absolute);\n files.push({ path: entryPath, size: info.size, modifiedAt: info.mtime.toISOString() });\n budget.remaining -= 1;\n }\n }\n return files;\n};\n\nconst listingOf = async (root: string): Promise<RunFilesListing> => {\n const budget = { remaining: MAX_ENTRIES };\n const groups: RunFilesListing[\"groups\"] = [];\n const loose: RunFileEntry[] = [];\n for (const entry of await visibleEntries(root)) {\n if (entry.name === \"_apps\") continue;\n const absolute = path.join(root, entry.name);\n if (entry.isDirectory()) {\n const files = await collectFiles(absolute, \"\", budget);\n if (files.length > 0) groups.push({ directory: entry.name, files });\n } else if (entry.isFile() && budget.remaining > 0) {\n const info = await lstat(absolute);\n loose.push({ path: entry.name, size: info.size, modifiedAt: info.mtime.toISOString() });\n budget.remaining -= 1;\n }\n }\n return { groups, loose, truncated: budget.remaining <= 0 };\n};\n\nconst resolveInside = async (root: string, relative: string): Promise<string> => {\n if (!relative || relative.includes(\"\\0\") || relative.includes(\"\\\\\") || path.isAbsolute(relative)\n || relative.split(\"/\").some((segment) => segment === \"\" || segment === \".\" || segment === \"..\")) {\n throw new Error(\"Ung\u00FCltiger Dateipfad\");\n }\n const rootReal = await realpath(root);\n const real = await realpath(path.join(rootReal, relative));\n if (real !== rootReal && !real.startsWith(rootReal + path.sep)) throw new Error(\"Ung\u00FCltiger Dateipfad\");\n return real;\n};\n\nexport const runFileExists = async (root: string, relative: string): Promise<boolean> => {\n try {\n return (await lstat(await resolveInside(root, relative))).isFile();\n } catch {\n return false;\n }\n};\n\nexport interface FilesRouteOptions {\n filesFor: (runId: string) => Promise<string>;\n ensureSession: (runId: string) => void;\n}\n\nexport const createFilesMethod = (options: FilesRouteOptions): MethodContribution =>\n implement(documentsContracts.files, async ({ runId }) => {\n options.ensureSession(runId);\n return listingOf(await options.filesFor(runId));\n });\n\n/** Der Inhalt bleibt Auslieferung: ein GET mit dem Medientyp der Datei. */\nexport const createFileContentRoute = (options: FilesRouteOptions): HttpRouteContribution => ({\n id: \"ragents.documents.files-content\",\n isApiPath: (pathname) => contentPattern.test(pathname),\n matches: (request, url) => request.method === \"GET\" && contentPattern.test(url.pathname),\n handle: async ({ response, request, url }) => {\n const match = url.pathname.match(contentPattern);\n if (!match) throw new Error(\"Ung\u00FCltige Dokumente-Route\");\n const [, runId] = match;\n await guardedJsonRoute({\n response,\n request,\n ensureSession: () => options.ensureSession(runId),\n errorStatus: 404,\n handle: async () => {\n const relative = url.searchParams.get(\"path\") ?? \"\";\n const file = await resolveInside(await options.filesFor(runId), relative);\n const info = await lstat(file);\n if (!info.isFile()) throw new Error(\"Ung\u00FCltiger Dateipfad\");\n const content = await readFile(file);\n response.writeHead(200, {\n \"Cache-Control\": \"no-store\",\n \"Content-Type\": mediaTypes[path.extname(relative).toLowerCase()] ?? \"application/octet-stream\",\n \"Content-Length\": content.byteLength,\n });\n response.end(content);\n },\n });\n },\n});\n", "import type { ToolContributor } from \"@ragents/engine\";\nimport { createDocumentWriteTool, documentWriteToolMetadata } from \"./document-write-tool.js\";\nimport { createShowDocumentTool, showDocumentToolMetadata } from \"./show-document-tool.js\";\nimport { toolDescriptorFrom } from \"@ragents/host/plugin-support/agent-tool.js\";\nimport { alwaysAvailable, facesOperator } from \"@ragents/host/plugin-support/tool-availability.js\";\n\nexport const createDocumentToolContributor = (\n filesFor: (runId: string) => Promise<string>,\n): ToolContributor => ({\n name: \"ragents.documents\",\n descriptors: [\n toolDescriptorFrom(showDocumentToolMetadata, facesOperator),\n toolDescriptorFrom(documentWriteToolMetadata, alwaysAvailable),\n ],\n tools: () => [createShowDocumentTool(filesFor), createDocumentWriteTool(filesFor)],\n});\n", "import path from \"node:path\";\nimport { declaredEnvironment } from \"@ragents/host/plugin-support/plugin-config.js\";\n\nexport const ragentsDocumentsConfigDescriptors = [\n { key: \"DOCUMENTS_DIR\", source: \"environment\" },\n] as const;\n\nconst env = declaredEnvironment(ragentsDocumentsConfigDescriptors);\n\nconst externalRoot = env.optional(\"DOCUMENTS_DIR\");\n\nexport const ragentsDocumentsConfig = Object.freeze({\n externalRoot: externalRoot ? path.resolve(externalRoot) : undefined,\n});\n", "import { mkdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { isRunId } from \"@ragents/engine\";\nimport type { DocumentStore, DocumentStoreDescription } from \"@ragents/host/ragents/document-store.js\";\n\nexport interface RunDocumentStoreOptions {\n sessionDirectory: (runId: string) => string;\n sessionsDirectoryPattern: string;\n externalRoot: string | undefined;\n}\n\nexport class RunDocumentStore implements DocumentStore {\n readonly #options: RunDocumentStoreOptions;\n\n constructor(options: RunDocumentStoreOptions) {\n this.#options = options;\n }\n\n async directoryFor(runId: string): Promise<string> {\n if (!isRunId(runId)) throw new Error(`Ung\u00FCltige Run-ID: ${runId}`);\n const directory = this.#options.externalRoot\n ? path.join(this.#options.externalRoot, runId)\n : this.#options.sessionDirectory(runId);\n await mkdir(directory, { recursive: true });\n return directory;\n }\n\n describe(): DocumentStoreDescription {\n return {\n directoryPattern: this.#options.externalRoot\n ? path.join(this.#options.externalRoot, \"{runId}\")\n : this.#options.sessionsDirectoryPattern,\n };\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAAA,OAAOA,WAAU;;;ACAjB,SAAS,OAAO,iBAAiB;AACjC,OAAO,UAAU;AACjB,SAAS,YAAY;AACrB,SAAS,yBAA2C;AACpD,SAAS,uBAAuB;AAEzB,IAAM,4BAA4B;AAAA,EACvC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,iBAAiB;AAMnB;AAEA,IAAM,oBAAoB,CAAC,UAA0B;AACnD,QAAM,aAAa,MAAM,QAAQ,SAAS,EAAE;AAC5C,MAAI,KAAK,WAAW,UAAU,KAAK,WAAW,MAAM,GAAG,EAAE,SAAS,IAAI,KAAK,WAAW,KAAK,MAAM,IAAI;AACnG,UAAM,IAAI,MAAM,
|
|
4
|
+
"sourcesContent": ["import path from \"node:path\";\nimport type { RAgentsPlugin } from \"@ragents/engine\";\nimport { createDocumentToolContributor } from \"./tool-contributor.js\";\nimport { documentsApiPrefix } from \"../contract.js\";\nimport { createFileContentRoute, createFilesMethod } from \"./files-route.js\";\nimport { ragentsDocumentsConfig, ragentsDocumentsConfigDescriptors } from \"./config.js\";\nimport { RunDocumentStore } from \"./store.js\";\nimport { pluginAsset } from \"@ragents/host/plugin-support/plugin-folder.js\";\nimport type { PluginModule } from \"@ragents/host/plugin-support/plugin-module.js\";\nimport { boundToTools, handlebarsPrompt } from \"@ragents/host/plugin-support/prompt.js\";\nimport { documentStoreToken } from \"@ragents/host/ragents/document-store.js\";\nimport { runGuardToken } from \"@ragents/host/ragents/host-services.js\";\n\nconst documentsPlugin: RAgentsPlugin = {\n manifest: { id: \"ragents.documents\" },\n register: (host) => {\n const store = new RunDocumentStore({\n sessionDirectory: (runId) => host.storage.session(runId, \"documents\"),\n sessionsDirectoryPattern: path.join(host.storage.sessionsRoot, \"{runId}\", \"plugins\", host.manifest.id, \"documents\"),\n externalRoot: ragentsDocumentsConfig.externalRoot,\n });\n const filesFor = (runId: string) => store.directoryFor(runId);\n host.provide(documentStoreToken, store);\n host.config(...ragentsDocumentsConfigDescriptors);\n host.clientConfig({ routePrefix: documentsApiPrefix });\n host.functions(createDocumentToolContributor(filesFor));\n host.prompts(boundToTools({ ...handlebarsPrompt(\"ragents.documents.prompt\", 400, pluginAsset(\"ragents.documents\", \"prompt.hbs\")), delivery: \"initial\" }, \"document_write\"));\n const files = { filesFor, ensureSession: host.service(runGuardToken) };\n host.methods(createFilesMethod(files));\n host.http(createFileContentRoute(files));\n },\n};\n\nexport const plugin: PluginModule = {\n requires: [\"ragents.orchestration\"],\n create: () => documentsPlugin,\n};\n", "import { mkdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Type } from \"typebox\";\nimport { defineRunFunction, type RunFunction } from \"@ragents/engine\";\nimport { alwaysAvailable } from \"@ragents/host/plugin-support/tool-availability.js\";\n\nexport const documentWriteToolMetadata = {\n name: \"document_write\",\n label: \"Store document\",\n nativeTool: true,\n description: \"Stores a file with the given content in this run's file store.\",\n longDescription: \"Documents, reports and intermediate products belong in the file store, not in the \"\n + \"working directory - that only holds what belongs to the task itself. The user sees the \"\n + \"store in the \\\"Documents\\\" area, grouped by subdirectory. To put a file from the \"\n + \"workspace into the store, read it first with read and pass the content here as content. \"\n + \"The store is not a bash path: it does not live in the workspace and can only be written \"\n + \"through this tool.\",\n} as const;\n\nconst relativeStorePath = (value: string): string => {\n const normalized = value.replace(/^\\.\\//, \"\");\n if (path.isAbsolute(normalized) || normalized.split(\"/\").includes(\"..\") || normalized.trim() === \"\") {\n throw new Error(\"path must be relative to the file store, without a leading / and without ..\");\n }\n return normalized;\n};\n\nexport const createDocumentWriteTool = (filesFor: (runId: string) => Promise<string>): RunFunction =>\n defineRunFunction({\n ...documentWriteToolMetadata,\n schema: Type.Object({\n path: Type.String({ minLength: 1, description: \"Path in the file store, e.g. topic/report.md\" }),\n content: Type.String({ description: \"The complete content of the file\" }),\n }, { additionalProperties: false }),\n resultSchema: Type.String(),\n available: alwaysAvailable,\n executionMode: \"sequential\",\n run: async (scope, _toolCallId, input) => {\n const relative = relativeStorePath(input.path);\n const target = path.join(await filesFor(scope.caller.runId), relative);\n await mkdir(path.dirname(target), { recursive: true });\n await writeFile(target, input.content, \"utf8\");\n return `Stored in the file store: ${relative} (${Buffer.byteLength(input.content, \"utf8\")} bytes)`;\n },\n });\n", "import { Type } from \"typebox\";\nimport { defineRunFunction, type RunFunction } from \"@ragents/engine\";\nimport { runFileExists } from \"./files-route.js\";\nimport { facesOperator } from \"@ragents/host/plugin-support/tool-availability.js\";\n\nexport const showDocumentToolMetadata = {\n name: \"show_document\",\n label: \"Show document\",\n nativeTool: true,\n description: \"Shows documents completely in the interface; file paths only apply to this run's file store.\",\n longDescription: \"ALWAYS use this tool when the user wants to see the \"\n + \"content of a file or a longer document - instead of copying or paraphrasing the content in the \"\n + \"chat answer. path only shows a file from \"\n + \"this run's file store, NOT from your working directory. \"\n + \"Everything else - files of the working directory and content you produced yourself - goes through \"\n + \"content; if the content comes from a file, take it VERBATIM from the last \"\n + \"read or write result, never retyped from memory.\",\n} as const;\n\nconst sourceRule = \"content and path exclude each other: valid are { title, content, format } for \"\n + \"self-produced content and files of the working directory, and { title, path, format } for files \"\n + \"of the file store - exactly one of the two must be set.\";\n\nconst titleSchema = Type.String({ description: \"Title of the display, e.g. the file name\" });\nconst formatSchema = Type.Optional(Type.Union(\n [Type.Literal(\"markdown\"), Type.Literal(\"text\"), Type.Literal(\"html\")],\n { description: \"Rendering, default markdown\" }));\n\nconst documentSource = (input: { content?: string; path?: string }):\n | { kind: \"content\" }\n | { kind: \"file\"; path: string } => {\n if ((input.content === undefined) === (input.path === undefined)) throw new Error(sourceRule);\n\n return input.path === undefined ? { kind: \"content\" } : { kind: \"file\", path: input.path };\n};\n\nexport const createShowDocumentTool = (filesFor: (runId: string) => Promise<string>): RunFunction =>\n defineRunFunction({\n ...showDocumentToolMetadata,\n schema: Type.Object({\n title: titleSchema,\n content: Type.Optional(Type.String({\n description: \"The complete content - for files from the working directory and for \"\n + \"self-produced content, i.e. everything that is not in the file store. \" + sourceRule,\n })),\n path: Type.Optional(Type.String({\n description: \"File from this run's file store, relative to the store (e.g. topic/file.md). \"\n + \"Only files stored there can be shown this way - for paths of the working directory \"\n + \"use content. The content is shown directly from the file and never has to be \"\n + \"retyped. \" + sourceRule,\n })),\n format: formatSchema,\n }, { additionalProperties: false }),\n resultSchema: Type.String(),\n available: facesOperator,\n run: async ({ caller }, _toolCallId, input) => {\n const source = documentSource(input);\n\n if (source.kind === \"content\")\n return `Shown to the user: ${input.title}`;\n\n const path = source.path;\n if (path.startsWith(\"/\") || path.split(\"/\").includes(\"..\"))\n throw new Error(\"path must be relative to the file store, without a leading / and without ..\");\n if (!await runFileExists(await filesFor(caller.runId), path))\n throw new Error(\n `${source.path} is not in this run's file store. Only files of the `\n + \"file store can be shown via path - for files from the working directory and for self-produced \"\n + \"content, pass the content via content.\",\n );\n return `Shown to the user: ${input.title} (file ${path} from the file store)`;\n },\n });\n", "import { lstat, readdir, readFile, realpath } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { implement, type HttpRouteContribution, type MethodContribution } from \"@ragents/engine\";\nimport { guardedJsonRoute } from \"@ragents/host/plugin-support/http.js\";\nimport { documentsContracts, type RunFileEntry, type RunFilesListing } from \"../contract.js\";\n\n\nconst contentPattern = /^\\/api\\/plugins\\/ragents\\.documents\\/runs\\/([A-Za-z0-9_-]{1,64})\\/files\\/content$/;\n\nconst MAX_ENTRIES = 1000;\n\nconst mediaTypes: Record<string, string> = {\n \".md\": \"text/markdown; charset=utf-8\",\n \".markdown\": \"text/markdown; charset=utf-8\",\n \".html\": \"text/html; charset=utf-8\",\n \".htm\": \"text/html; charset=utf-8\",\n \".txt\": \"text/plain; charset=utf-8\",\n \".log\": \"text/plain; charset=utf-8\",\n \".csv\": \"text/csv; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".svg\": \"image/svg+xml\",\n \".webp\": \"image/webp\",\n \".pdf\": \"application/pdf\",\n};\n\nconst visibleEntries = async (directory: string) => {\n const entries = await readdir(directory, { withFileTypes: true });\n return entries\n .filter((entry) => !entry.name.startsWith(\".\") && !entry.isSymbolicLink())\n .sort((left, right) => left.name.localeCompare(right.name, \"en-US\"));\n};\n\nconst collectFiles = async (\n directory: string,\n relative: string,\n budget: { remaining: number },\n): Promise<RunFileEntry[]> => {\n const files: RunFileEntry[] = [];\n for (const entry of await visibleEntries(directory)) {\n if (budget.remaining <= 0) break;\n const absolute = path.join(directory, entry.name);\n const entryPath = relative ? `${relative}/${entry.name}` : entry.name;\n if (entry.isDirectory()) {\n files.push(...await collectFiles(absolute, entryPath, budget));\n } else if (entry.isFile()) {\n const info = await lstat(absolute);\n files.push({ path: entryPath, size: info.size, modifiedAt: info.mtime.toISOString() });\n budget.remaining -= 1;\n }\n }\n return files;\n};\n\nconst listingOf = async (root: string): Promise<RunFilesListing> => {\n const budget = { remaining: MAX_ENTRIES };\n const groups: RunFilesListing[\"groups\"] = [];\n const loose: RunFileEntry[] = [];\n for (const entry of await visibleEntries(root)) {\n if (entry.name === \"_apps\") continue;\n const absolute = path.join(root, entry.name);\n if (entry.isDirectory()) {\n const files = await collectFiles(absolute, \"\", budget);\n if (files.length > 0) groups.push({ directory: entry.name, files });\n } else if (entry.isFile() && budget.remaining > 0) {\n const info = await lstat(absolute);\n loose.push({ path: entry.name, size: info.size, modifiedAt: info.mtime.toISOString() });\n budget.remaining -= 1;\n }\n }\n return { groups, loose, truncated: budget.remaining <= 0 };\n};\n\nconst resolveInside = async (root: string, relative: string): Promise<string> => {\n if (!relative || relative.includes(\"\\0\") || relative.includes(\"\\\\\") || path.isAbsolute(relative)\n || relative.split(\"/\").some((segment) => segment === \"\" || segment === \".\" || segment === \"..\")) {\n throw new Error(\"Invalid file path\");\n }\n const rootReal = await realpath(root);\n const real = await realpath(path.join(rootReal, relative));\n if (real !== rootReal && !real.startsWith(rootReal + path.sep)) throw new Error(\"Invalid file path\");\n return real;\n};\n\nexport const runFileExists = async (root: string, relative: string): Promise<boolean> => {\n try {\n return (await lstat(await resolveInside(root, relative))).isFile();\n } catch {\n return false;\n }\n};\n\nexport interface FilesRouteOptions {\n filesFor: (runId: string) => Promise<string>;\n ensureSession: (runId: string) => void;\n}\n\nexport const createFilesMethod = (options: FilesRouteOptions): MethodContribution =>\n implement(documentsContracts.files, async ({ runId }) => {\n options.ensureSession(runId);\n return listingOf(await options.filesFor(runId));\n });\n\n/** Content stays plain delivery: a GET with the file's media type. */\nexport const createFileContentRoute = (options: FilesRouteOptions): HttpRouteContribution => ({\n id: \"ragents.documents.files-content\",\n isApiPath: (pathname) => contentPattern.test(pathname),\n matches: (request, url) => request.method === \"GET\" && contentPattern.test(url.pathname),\n handle: async ({ response, request, url }) => {\n const match = url.pathname.match(contentPattern);\n if (!match) throw new Error(\"Invalid documents route\");\n const [, runId] = match;\n await guardedJsonRoute({\n response,\n request,\n ensureSession: () => options.ensureSession(runId),\n errorStatus: 404,\n handle: async () => {\n const relative = url.searchParams.get(\"path\") ?? \"\";\n const file = await resolveInside(await options.filesFor(runId), relative);\n const info = await lstat(file);\n if (!info.isFile()) throw new Error(\"Invalid file path\");\n const content = await readFile(file);\n response.writeHead(200, {\n \"Cache-Control\": \"no-store\",\n \"Content-Type\": mediaTypes[path.extname(relative).toLowerCase()] ?? \"application/octet-stream\",\n \"Content-Length\": content.byteLength,\n });\n response.end(content);\n },\n });\n },\n});\n", "import type { ToolContributor } from \"@ragents/engine\";\nimport { createDocumentWriteTool, documentWriteToolMetadata } from \"./document-write-tool.js\";\nimport { createShowDocumentTool, showDocumentToolMetadata } from \"./show-document-tool.js\";\nimport { toolDescriptorFrom } from \"@ragents/host/plugin-support/agent-tool.js\";\nimport { alwaysAvailable, facesOperator } from \"@ragents/host/plugin-support/tool-availability.js\";\n\nexport const createDocumentToolContributor = (\n filesFor: (runId: string) => Promise<string>,\n): ToolContributor => ({\n name: \"ragents.documents\",\n descriptors: [\n toolDescriptorFrom(showDocumentToolMetadata, facesOperator),\n toolDescriptorFrom(documentWriteToolMetadata, alwaysAvailable),\n ],\n tools: () => [createShowDocumentTool(filesFor), createDocumentWriteTool(filesFor)],\n});\n", "import path from \"node:path\";\nimport { declaredEnvironment } from \"@ragents/host/plugin-support/plugin-config.js\";\n\nexport const ragentsDocumentsConfigDescriptors = [\n { key: \"DOCUMENTS_DIR\", source: \"environment\" },\n] as const;\n\nconst env = declaredEnvironment(ragentsDocumentsConfigDescriptors);\n\nconst externalRoot = env.optional(\"DOCUMENTS_DIR\");\n\nexport const ragentsDocumentsConfig = Object.freeze({\n externalRoot: externalRoot ? path.resolve(externalRoot) : undefined,\n});\n", "import { mkdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { isRunId } from \"@ragents/engine\";\nimport type { DocumentStore, DocumentStoreDescription } from \"@ragents/host/ragents/document-store.js\";\n\nexport interface RunDocumentStoreOptions {\n sessionDirectory: (runId: string) => string;\n sessionsDirectoryPattern: string;\n externalRoot: string | undefined;\n}\n\nexport class RunDocumentStore implements DocumentStore {\n readonly #options: RunDocumentStoreOptions;\n\n constructor(options: RunDocumentStoreOptions) {\n this.#options = options;\n }\n\n async directoryFor(runId: string): Promise<string> {\n if (!isRunId(runId)) throw new Error(`Invalid run id: ${runId}`);\n const directory = this.#options.externalRoot\n ? path.join(this.#options.externalRoot, runId)\n : this.#options.sessionDirectory(runId);\n await mkdir(directory, { recursive: true });\n return directory;\n }\n\n describe(): DocumentStoreDescription {\n return {\n directoryPattern: this.#options.externalRoot\n ? path.join(this.#options.externalRoot, \"{runId}\")\n : this.#options.sessionsDirectoryPattern,\n };\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["path", "Type", "defineRunFunction", "path", "path", "Type", "defineRunFunction", "path", "alwaysAvailable", "facesOperator", "path", "mkdir", "path", "path"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
["--background","--card","--foreground","--primary","[scrollbar-width:thin]","
|
|
1
|
+
["--background","--card","--foreground","--primary","[scrollbar-width:thin]","activate","active","activeId","activeTabId","additionalProperties","alive","alt","and","are","args","aria-expanded","aria-hidden","aria-label","aria-pressed","aria-pressed:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))]","aria-pressed:border-primary/50","artifact","as","bg-[color-mix(in_srgb,var(--background)_95%,var(--primary))]","bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))]","bg-[color-mix(in_srgb,var(--foreground)_9%,var(--background))]","bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))]","bg-[color-mix(in_srgb,var(--primary)_16%,var(--background))]","bg-card","bg-destructive/8","bg-primary/12","bg-white","bin","binary","block","boolean","border","border-0","border-b","border-b-border-soft","border-border","border-border-soft","border-l","border-primary/25","border-t-0","border-x-0","break-words","button","cache","catch","cause","chat","chatDocumentFrom","className","collect","configuredPlugin","const","contains","content","contentUrl","contribution","conversations","copyClass","count","createContext","createdAt","currentColor","cx","cy","data-[status=error]:border-destructive/45","data-status","date","day","defineOperation","description","descriptor","destructive","directory","document","documentMessages","documentMessagesFrom","documents","documentsApiPrefix","documentsContracts","documentsFrom","docx","dot","download","duration-100","else","en-US","entityPresenters","entry","error","eslint-disable-next-line","export","false","fetchRunFiles","file","fileDocument","fileEntry","filePath","files","filesListing","fill","flex","flex-1","flex-col","focus-visible:border-primary/50","focus-visible:outline-2","focus-visible:outline-offset-2","focus-visible:outline-primary/55","font-bold","font-semibold","for","format","formatByExtension","formatBytes","formatFromName","formatLabels","formatOf","formatTime","from","full","function","gap-0","gap-0.5","gap-1","gap-2","gap-2.5","gap-3","gap-3.5","gap-px","gif","grid","grid-cols-[14px_26px_minmax(0,1fr)_auto]","grid-cols-[24px_minmax(0,1fr)_auto]","grid-cols-[42px_minmax(0,1fr)_auto]","grid-cols-[auto_minmax(0,1fr)_auto]","group-data-[status=error]/call:text-destructive","group-hover/entry:opacity-100","group/call","group/entry","groupBadgeClass","groups","gz","h-12","h-full","handle","handles","height","hour","hover:-translate-y-px","hover:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))]","hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]","hover:bg-primary/7","hover:border-primary/50","hover:border-primary/55","hover:shadow-md","href","htm","html","icon","icon-sm","id","if","image","import","in","input","instanceof","interface","is","isError","iso","items-center","jpeg","jpg","json","justify-center","key","kind","label","leading-[1.35]","leading-[1.65]","leading-[1.6]","length","let","library","line","lineCount","lines","list-none","listing","load","loaded","loose","lucide-react","m9","markdown","matter","max-[620px]:gap-2.5","max-[620px]:grid-cols-[38px_minmax(0,1fr)_auto]","max-[620px]:h-11","max-[620px]:px-2.5","max-[620px]:py-2.5","max-[620px]:sr-only","max-[620px]:w-[38px]","max-w-full","maxLength","md","mediaType","message","messages","meta","metaClass","min-h-0","min-h-30","min-h-full","min-w-0","minLength","minimum","minute","ml-[23px]","modifiedAt","month","more","mt-0.5","mt-1.5","name","needsRunView","new","next","no-store","none","not","number","onClick","onClose","onOpen","onOpenChange","onSelect","only","opacity-0","open","order","outline","overflow-y-auto","overview","p-0","p-7","p-9","parts","path","pathArgumentsFrom","pathDocumentFrom","pathDocumentsFromMessages","pb-10","pb-4.5","pdf","per","pl-2.5","plugin","png","preview","pt-2.5","pt-5","px-2","px-2.5","px-3.5","px-[clamp(18px,4vw,54px)]","px-workspace-inset","py-2","py-2.5","py-3","py-4","quassel","quassel/events","react","react-hooks/exhaustive-deps","read","readable","readonly","ready","rebuilt","relative","render","result","resultSection","results","return","reveal","rights","role","rotate-90","round","rounded-[10px]","rounded-[9px]","rounded-full","rounded-lg","rounded-none","rounded-panel","rounded-xl","routePrefix","rpc","run","runFileContentUrl","runId","running","s","sandbox","scope","secondary","sections","sectionsFrom","selection","session","setCache","setCollapsed","setError","setListing","setModalOpen","shadow-pop","shadow-sm","showCloseButton","show_document","shown","shrink-0","size","size-3","size-7","size-8","sm","sourceClass","src","srcDoc","state","status","statusLabel","store","string","stroke","strokeLinecap","strokeLinejoin","strokeWidth","sum","svg","tabId","tabular-nums","tar","text","text-[0.62rem]","text-[0.68rem]","text-[0.72rem]","text-[0.76rem]","text-[0.79rem]","text-[0.7rem]","text-[0.82rem]","text-[0.84rem]","text-[0.85rem]","text-[12px]","text-[13.5px]","text-[13px]","text-foreground","text-left","text-muted-foreground","text-primary","text-sm","textual","than","the","these","this","throw","timer","title","titleClass","to","toggle","tool","toolName","toolPresenters","tracking-[0.02em]","tracking-[0.05em]","transition-[background-color,border-color,box-shadow,transform]","transition-colors","transition-opacity","transition-transform","truncate","truncated","try","type","typebox","typeof","undefined","unknown","uppercase","url","useDocumentContent","useRunFiles","useRunFilesContext","useState","value","variant","view","viewBox","void","w-[42px]","w-[min(100%,620px)]","w-[min(1080px,calc(100%-2*clamp(16px,5vw,72px)))]","w-full","webPlugin","webp","whitespace-pre-wrap","width","workspaceTabs","xlsx","xml","yet","zip"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var u=(e,a)=>{let r=globalThis.__ragentsHostModules?.[e];if(r===void 0)throw new Error(`Der Host stellt ${e} nicht bereit`);if(!(a in r))throw new Error(`Der Host stellt ${a} aus ${e} nicht bereit; das Bundle ist gegen einen neueren Host gebaut`);return r[a]};var D=u("react","createContext");var S=u("react","createElement");var B=u("react","forwardRef");var X=u("react","useCallback");var M=u("react","useContext");var P=u("react","useEffect");var C=u("react","useMemo");var g=u("react","useState");var ne=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ce(e,a,r=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ne(e),size:24,node:a,...r.length>0?{aliases:r}:{}}}var pe=e=>{let a="",r=!1;for(let o of e){if(o==="-"||o==="_"||o<=" "){r=a.length>0;continue}a.length===0?a+=o.toLowerCase():a+=r?o.toUpperCase():o,r=!1}return a};var me=e=>{let a=pe(e);return a.charAt(0).toUpperCase()+a.slice(1)};var F=(...e)=>e.filter((a,r,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===r).join(" ").trim();var h={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 K(e){return e!=null}function Le(e,a={}){let r=a.attributeNames??{},o=m=>r[m]??m,d=e.size??e.width??h.width,l=e.size??e.height??h.height,f=e.aliases?.filter(m=>typeof m=="string"&&m.trim()!=="").map(m=>`lucide-${m}`)??[],n=[...e.name?[`lucide-${e.name}`]:[],...f],L=a.className?.split(" ").filter(Boolean)??[],c=a.includeDefaultClasses===!1?F(...L):F("lucide",...n,...L),x=a.absoluteStrokeWidth?Number(a.strokeWidth??h["stroke-width"])*Number(e.size??e.width??h.width)/Number(a.size??a.width??h.width):a.strokeWidth??h["stroke-width"];return["svg",{...Object.entries(h).reduce((m,[p,w])=>(m[o(p)]=w,m),{}),..."color"in a&&a.color&&{[o("stroke")]:a.color},..."size"in a&&K(a.size)&&{[o("width")]:a.size,[o("height")]:a.size},..."width"in a&&K(a.width)&&{[o("width")]:a.width},..."height"in a&&K(a.height)&&{[o("height")]:a.height},[o("stroke-width")]:x,...c&&{[o("class")]:c},[o("viewBox")]:`0 0 ${d} ${l}`,...a.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(m=>{let[p,w,E]=m,G=a.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...w}:w;return E?[p,G,E]:[p,G]})]}function xe(e,a={}){return Le(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Ie=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var je=D({});var Ce=()=>M(je);var ge=B(({color:e,size:a,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:l,nonScalingStroke:f,className:n="",children:L,iconNode:c=[],icon:x={node:c,aliases:[],size:24},...s},m)=>{let{size:p=24,strokeWidth:w=2,absoluteStrokeWidth:E=!1,nonScalingStroke:G=!1,color:Ve="currentColor",className:ze=""}=Ce()??{},Ne=!!L||Ie(s),[Xe,Ke,Ze=[]]=xe(x,{color:e??Ve,width:r??a??p,height:o??a??p,strokeWidth:d??w,absoluteStrokeWidth:l??E,nonScalingStroke:f??G,className:F(ze,n),hasA11yProp:Ne,attributes:s});return S(Xe,{ref:m,...Ke},[...Ze.map(([_e,Qe])=>S(_e,Qe)),...Array.isArray(L)?L:[L]])});function W(e,a=[],r=[]){let o=typeof e=="string"?ce(e,a,r):e,d=B(({className:l,...f},n)=>S(ge,{ref:n,icon:o,className:l,...f}));return o.name&&(d.displayName=me(o.name)),d}var he={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};he.node;var y=W(he);var Se={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Se.node;var b=W(Se);var Z=u("@ragents/web/ui","Alert");var R=u("@ragents/web/ui","Badge");var A=u("@ragents/web/ui","Button");var _=u("@ragents/web/ui","Dialog");var Q=u("@ragents/web/ui","DialogContent");var j=u("@ragents/web/ui","DialogTitle");var T=u("@ragents/web/ui","Empty");var J=u("@ragents/web/ui","EmptyContent");var V=u("@ragents/web/ui","EmptyDescription");var q=u("@ragents/web/ui","EmptyHeader");var v=u("@ragents/web/ui","EmptyMedia");var U=u("@ragents/web/ui","EmptyTitle");var z=u("@ragents/web/ui","Spinner");var $=u("quassel","Markdown");var N=u("@ragents/web/lib/format","formatBytes");var Y=u("@ragents/web/SourceCode","SourceCode");var O=u("react/jsx-runtime","Fragment");var t=u("react/jsx-runtime","jsx");var i=u("react/jsx-runtime","jsxs");var ke="grid min-w-0 gap-px",Je="truncate text-[0.82rem] font-semibold",we="text-[0.68rem] text-muted-foreground tabular-nums",$e="min-w-0 p-0 text-[12px] whitespace-pre-wrap break-words",ee="flex size-7 items-center justify-center rounded-[9px] text-[0.62rem] font-bold tracking-[0.02em]",ae={markdown:"Markdown",text:"Text",html:"HTML",image:"Bild",binary:"Datei"},Ye={".md":"markdown",".markdown":"markdown",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".pdf":"binary",".zip":"binary",".gz":"binary",".tar":"binary",".xlsx":"binary",".docx":"binary",".bin":"binary"},te=e=>{let a=e.lastIndexOf(".");return a<0?"text":Ye[e.slice(a).toLowerCase()]??"text"},Pe=e=>e.includes("html")?"html":e.includes("markdown")?"markdown":e.startsWith("image/")?"image":e.startsWith("text/")||e.includes("json")||e.includes("xml")?"text":"binary",Ae=e=>{let a=new Date(e);return Number.isNaN(a.getTime())?e:a.toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})},De=(e,a={})=>[...new Map([...Object.values(a).flat(),...e].filter(r=>r.tool?.name==="show_document").map(r=>[r.tool.id,r])).values()],oe=e=>e.flatMap(a=>{let r=a.tool;if(r?.name!=="show_document")return[];try{let o=JSON.parse(r.arguments);if(typeof o.title!="string"||typeof o.content!="string")return[];let d=o.format==="text"||o.format==="html"?o.format:"markdown";return[{id:r.id,title:o.title,content:o.content,format:d}]}catch{return[]}}),Be=e=>{let[a,r]=g({}),o=e?.format==="markdown"||e?.format==="text"||e?.format==="html",d=e?.content===void 0&&o?e?.contentUrl:void 0;if(P(()=>{if(!d||a[d])return;let l=!0;return fetch(d,{cache:"no-store"}).then(async f=>{if(!f.ok)throw new Error(`Status ${f.status}`);return f.text()}).then(f=>l&&r(n=>({...n,[d]:{text:f}}))).catch(f=>l&&r(n=>({...n,[d]:{error:f instanceof Error?f.message:String(f)}}))),()=>{l=!1}},[d,a]),!!e)return e.content!==void 0?{text:e.content}:o?d?a[d]:void 0:{text:""}};function Me({active:e,document:a,onOpen:r,status:o}){let d=C(()=>a.content?a.content.split(/\r\n|\r|\n/).length:0,[a.content]),l=o==="error"?"Fehler":o==="running"?"Wird ge\xF6ffnet":e?"Ge\xF6ffnet":"\xD6ffnen";return i("button",{"aria-pressed":e,className:"group/call grid w-[min(100%,620px)] grid-cols-[42px_minmax(0,1fr)_auto] items-center gap-3 rounded-xl border border-border bg-[color-mix(in_srgb,var(--background)_95%,var(--primary))] px-3.5 py-3 text-left shadow-sm transition-[background-color,border-color,box-shadow,transform] duration-100 hover:-translate-y-px hover:border-primary/50 hover:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] hover:shadow-md focus-visible:border-primary/50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/55 aria-pressed:border-primary/50 aria-pressed:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] data-[status=error]:border-destructive/45 max-[620px]:grid-cols-[38px_minmax(0,1fr)_auto] max-[620px]:gap-2.5 max-[620px]:px-2.5 max-[620px]:py-2.5","data-status":o,onClick:r,type:"button",children:[t("span",{className:"flex h-12 w-[42px] items-center justify-center rounded-lg border border-primary/25 bg-primary/12 text-primary group-data-[status=error]/call:text-destructive max-[620px]:h-11 max-[620px]:w-[38px]",children:t(H,{size:22})}),i("span",{className:"flex min-w-0 flex-col gap-0.5",children:[t("span",{className:"text-[0.62rem] font-semibold tracking-[0.05em] text-primary uppercase",children:"Dokument"}),t("strong",{className:"truncate text-[0.84rem] leading-[1.35]",title:a.title,children:a.title}),i("span",{className:"text-[0.7rem] leading-[1.35] text-muted-foreground",children:[ae[a.format],", ",d.toLocaleString("de-DE")," ",d===1?"Zeile":"Zeilen"]})]}),i("span",{className:"flex items-center gap-1 text-[0.7rem] font-semibold text-primary group-data-[status=error]/call:text-destructive",children:[t("span",{className:"max-[620px]:sr-only",children:l}),o==="running"?t(z,{className:"size-3"}):o==="error"?t(Te,{}):t(Re,{})]})]})}function Fe({document:e,stand:a}){return e.format==="image"&&e.contentUrl?t("img",{alt:e.title,className:"block max-w-full rounded-lg border border-border",src:e.contentUrl}):e.format==="binary"&&e.contentUrl?i(T,{className:"min-h-30 gap-2 p-7",children:[i(q,{children:[t(v,{children:t(H,{})}),t(U,{children:"Keine Vorschau f\xFCr dieses Format"})]}),t(J,{children:t(A,{render:t("a",{download:e.title,href:e.contentUrl}),size:"sm",variant:"outline",children:"Herunterladen"})})]}):a?"error"in a?t(T,{className:"min-h-30 gap-2 p-7",children:i(q,{children:[t(v,{children:t(Te,{})}),t(U,{children:"Inhalt nicht lesbar"}),t(V,{children:a.error})]})}):e.format==="html"?t("iframe",{className:"h-full min-h-full w-full border-0 bg-white",sandbox:"",srcDoc:a.text,title:e.title}):e.format==="text"?t(Y,{className:$e,content:a.text,path:e.title}):t($,{text:a.text}):i("div",{className:"flex items-center justify-center gap-2.5 p-9 text-[0.76rem] text-muted-foreground",children:[t(z,{className:"size-3"}),t("span",{children:"Wird geladen"})]})}function ye({document:e}){let a=[ae[e.format],e.size!==void 0?N(e.size):void 0,e.createdAt?Ae(e.createdAt):void 0,e.meta].filter(Boolean);return i(O,{children:[t("strong",{className:Je,title:e.title,children:e.title}),t("span",{className:we,children:a.join(" \xB7 ")})]})}function ea({document:e,onClose:a}){let r=Be(e);return t(_,{open:!0,onOpenChange:o=>{o||a()},children:i(Q,{className:"w-[min(1080px,calc(100%-2*clamp(16px,5vw,72px)))] gap-0 rounded-panel border border-border bg-card p-0 shadow-pop",scope:"run",showCloseButton:!1,size:"full",children:[i("header",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-b border-border px-3.5 py-3",children:[t("span",{className:"flex size-8 items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary",children:t(H,{size:20})}),t(j,{className:ke,render:t("span",{}),children:t(ye,{document:e})}),t(A,{"aria-label":"Schlie\xDFen",className:"rounded-full",onClick:a,size:"icon",title:"Schlie\xDFen",variant:"outline",children:t(b,{})})]}),t("div",{className:"min-h-0 flex-1 overflow-y-auto px-[clamp(18px,4vw,54px)] pt-5 pb-10 text-[13.5px] leading-[1.65]",children:t(Fe,{document:e,stand:r})})]})})}function be({activeId:e,sections:a,truncated:r,onSelect:o}){let d=a.flatMap(s=>s.documents).find(s=>s.id===e),l=Be(d),[f,n]=g(!1),[L,c]=g(()=>new Set),x=X(s=>{c(m=>{let p=new Set(m);return p.has(s)?p.delete(s):p.add(s),p})},[]);return P(()=>{d||n(!1)},[d]),a.every(s=>s.documents.length===0)?t(T,{className:"h-full gap-2 p-7",children:i(q,{children:[t(v,{children:t(H,{})}),t(U,{children:"Noch keine Dokumente"}),t(V,{children:"Dateien aus der Ablage des Runs, Ergebnisse und im Chat gezeigte Dokumente sammeln sich hier."})]})}):d?i("div",{className:"flex h-full min-h-0 flex-col",children:[i("header",{className:"grid shrink-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-2.5",children:[t(A,{"aria-label":"Zur\xFCck zur \xDCbersicht",onClick:()=>o(void 0),size:"icon-sm",title:"Zur\xFCck zur \xDCbersicht",variant:"outline",children:t(y,{})}),t("span",{className:ke,children:t(ye,{document:d})}),t(A,{onClick:()=>n(!0),size:"sm",variant:"outline",children:"Gro\xDF"})]}),t("div",{className:"min-h-0 flex-1 overflow-y-auto px-workspace-inset py-4 text-[13px] leading-[1.6]",children:t(Fe,{document:d,stand:l})}),f&&t(ea,{document:d,onClose:()=>n(!1)})]}):i("div",{className:"flex h-full flex-col gap-3.5 overflow-y-auto px-workspace-inset pt-2.5 pb-4.5 [scrollbar-width:thin]",children:[a.filter(s=>s.documents.length>0).map(s=>{let m=!L.has(s.id);return i("section",{children:[i("button",{"aria-expanded":m,className:"grid w-full grid-cols-[14px_26px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg px-2 py-2 text-left hover:bg-primary/7",onClick:()=>x(s.id),type:"button",children:[t("span",{"aria-hidden":!0,className:`flex text-muted-foreground transition-transform duration-150${m?" rotate-90":""}`,children:t(aa,{})}),s.kind==="ablage"&&t("span",{"aria-hidden":!0,className:`${ee} bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))] text-[0.85rem] text-foreground`,children:"#"}),s.kind==="ergebnisse"&&t("span",{"aria-hidden":!0,className:`${ee} bg-[color-mix(in_srgb,var(--primary)_16%,var(--background))] text-primary`,children:t(oa,{})}),s.kind==="chat"&&t("span",{"aria-hidden":!0,className:`${ee} bg-[color-mix(in_srgb,var(--foreground)_9%,var(--background))] text-muted-foreground`,children:t(ta,{})}),t("span",{className:"truncate text-sm font-semibold",title:s.label,children:s.label}),t(R,{className:"tabular-nums",variant:"secondary",children:s.documents.length})]}),m&&t("div",{className:"ml-[23px] border-l border-border-soft pl-2.5",children:t("ul",{className:"mt-0.5 list-none",children:s.documents.map(p=>t("li",{children:i("button",{className:"group/entry mt-1.5 grid w-full grid-cols-[24px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg border border-border bg-card px-2.5 py-2.5 text-left transition-colors duration-100 hover:border-primary/55 hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]",onClick:()=>o(p.id),type:"button",children:[t("span",{className:"flex text-primary",children:t(H,{size:18})}),i("span",{className:"grid min-w-0 gap-0.5",children:[t("strong",{className:"truncate text-[0.79rem] font-semibold",title:p.title,children:p.title}),t("small",{className:we,children:[ae[p.format],p.size!==void 0?N(p.size):void 0,p.createdAt?Ae(p.createdAt):void 0,p.meta].filter(Boolean).join(" \xB7 ")})]}),t("span",{"aria-hidden":!0,className:"flex text-muted-foreground opacity-0 transition-opacity duration-100 group-hover/entry:opacity-100",children:t(Re,{})})]})},p.id))})})]},s.id)}),r&&t("p",{className:"text-[0.72rem] text-muted-foreground",children:"Die Ablage enth\xE4lt mehr Dateien, als hier angezeigt werden."})]})}function H({size:e=28}){return i("svg",{"aria-hidden":!0,fill:"none",height:e,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:e,children:[t("path",{d:"M6 3h8l4 4v14H6z"}),t("path",{d:"M14 3v5h4M9 13h6M9 17h4"})]})}function Re(){return t("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:t("path",{d:"m9 18 6-6-6-6"})})}function aa(){return t("svg",{"aria-hidden":!0,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"12",children:t("path",{d:"m9 18 6-6-6-6"})})}function ta(){return t("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:t("path",{d:"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.4A8 8 0 1 1 21 12z"})})}function oa(){return t("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:t("path",{d:"M20 6 9 17l-5-5"})})}function Te(){return i("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:[t("circle",{cx:"12",cy:"12",r:"9"}),t("path",{d:"M12 7v6M12 17h.01"})]})}var ue=u("@ragents/web/rpc","rpc");var I=u("typebox","Type");var re=u("@ragents/engine/src/rpc/contract","defineOperation");var qe=I.Object({path:I.String({minLength:1}),size:I.Integer({minimum:0}),modifiedAt:I.String({minLength:1})},{additionalProperties:!1}),ua=I.Object({groups:I.Array(I.Object({directory:I.String({minLength:1}),files:I.Array(qe)},{additionalProperties:!1})),loose:I.Array(qe),truncated:I.Boolean()},{additionalProperties:!1}),ve={files:re({id:"ragents.documents.files",description:"Die Dateiablage eines Runs als Gruppen und lose Dateien. Recht: runs.read.",rights:["runs.read"],input:I.Object({runId:I.String({minLength:1,maxLength:64,description:"Kennung des Runs"})},{additionalProperties:!1}),result:ua})};var de=(e,a,r)=>`${e}/runs/${encodeURIComponent(a)}/files/content?path=${encodeURIComponent(r)}`,Ue=e=>ue.call(ve.files,{runId:e});var le=u("@ragents/web/run-view","runArtifactContentUrl");var fe=u("@ragents/web/run-view","runViewFrom");var se=u("@ragents/web/PluginRegistry","pluginRoutePrefixFrom");var ra="ragents.documents",k="ragents.documents.library",da=e=>{if(e.name==="show_document")try{let a=JSON.parse(e.arguments);return typeof a.title!="string"||typeof a.path!="string"||typeof a.content=="string"?void 0:{title:a.title,path:a.path,...typeof a.format=="string"?{format:a.format}:{}}}catch{return}},Ee=(e,a,r)=>{let o=da(e);if(!o)return;let d=o.format==="markdown"||o.format==="text"||o.format==="html"?o.format:te(o.path);return{id:e.id,title:o.title,format:d,contentUrl:de(a,r,o.path)}},Ge=(e,a,r)=>oe([{key:e.id,role:"tool",text:e.name,tool:e}])[0]??Ee(e,a,r),la=(e,a,r)=>e.flatMap(o=>{let d=o.tool;if(!d)return[];let l=Ee(d,a,r);return l?[l]:[]}),We=D(void 0),Oe=()=>{let e=M(We);if(!e)throw new Error("Dokumente-Plugin ist nicht aktiv");return e},fa=e=>{let[a,r]=g(),[o,d]=g(),l=e.session.id;return P(()=>{let f=!0,n=()=>{Ue(l).then(c=>{f&&(r(c),d(void 0))}).catch(c=>f&&d(c instanceof Error?c.message:String(c)))};if(n(),!e.running)return()=>{f=!1};let L=setInterval(n,5e3);return()=>{f=!1,clearInterval(L)}},[l,e.running]),C(()=>({listing:a,error:o}),[a,o])};function sa({children:e,session:a}){let r=fa(a);return t(We.Provider,{value:r,children:e})}var ia=(e,a)=>{let r=new Map(a.actors.map(o=>[o.id,o.handle]));return{id:"ergebnisse",label:"Ergebnisse",kind:"ergebnisse",documents:a.artifacts.map(o=>{let d=r.get(o.createdBy);return{id:o.id,title:o.title,format:Pe(o.mediaType),contentUrl:le(e,o.id),createdAt:o.createdAt,size:o.size,...d?{meta:`@${d}`}:{}}})}},He=(e,a,r)=>{let o=a.session.id,d=fe(a.runView),l=(c,x)=>{let s=c?`${c}/${x.path}`:x.path;return{id:`file:${s}`,title:x.path,format:te(x.path),contentUrl:`${de(e,o,s)}&v=${encodeURIComponent(x.modifiedAt)}`,createdAt:x.modifiedAt,size:x.size}},f=[...(r?.groups??[]).map(c=>({id:`ablage/${c.directory}`,label:c.directory,kind:"ablage",documents:c.files.map(x=>l(c.directory,x))})),...r&&r.loose.length>0?[{id:"ablage",label:"Ablage",kind:"ablage",documents:r.loose.map(c=>l(void 0,c))}]:[],...d&&d.artifacts.length>0?[ia(o,d)]:[]],n=De(a.messages,a.actorConversations),L=[...oe(n),...la(n,e,a.session.id)];return L.length>0&&f.push({id:"chat",label:"Im Chat gezeigt",kind:"chat",documents:L}),{sections:f,truncated:r?.truncated??!1}},na=e=>{function a({navigation:o,selection:d,session:l}){let{listing:f,error:n}=Oe(),{sections:L,truncated:c}=C(()=>He(e,l,f),[l.messages,l.actorConversations,l.runView,l.session.id,f]);return i(O,{children:[n&&t(Z,{className:"shrink-0 rounded-none border-x-0 border-t-0 border-b-border-soft bg-destructive/8 px-2.5 py-2 text-[0.68rem]",variant:"destructive",children:n}),t(be,{activeId:typeof d=="string"?d:void 0,sections:L,truncated:c,onSelect:x=>o.openTab(k,x??null)})]})}function r({session:o}){let{listing:d}=Oe(),{sections:l}=C(()=>He(e,o,d),[o.messages,o.actorConversations,o.runView,o.session.id,d]),f=l.reduce((n,L)=>n+L.documents.length,0);return f>0?t(R,{className:"tabular-nums",variant:"secondary",children:f}):null}return{DocumentsPanelContribution:a,DocumentsBadge:r}};function ca({navigation:e,session:a,tool:r,routePrefix:o}){let d=Ge(r,o,a.session.id);if(!d)return null;let l=r.isError?"error":r.result===void 0?"running":"ready";return t(Me,{active:e.activeTabId===k&&e.selectionFor(k)===d.id,document:d,onOpen:()=>e.openTab(k,d.id),status:l})}function pa(){return t("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:t("path",{d:"M6 3h8l4 4v14H6zM14 3v5h4M9 13h6M9 17h4"})})}var ma=(e,a)=>{let{DocumentsPanelContribution:r,DocumentsBadge:o}=na(a);return{...e,needsRunView:!0,SessionProvider:sa,workspaceTabs:[{id:k,label:"Dokumente",order:200,Icon:pa,Panel:r,Badge:o}],toolPresenters:[{toolName:"show_document",Inline:d=>t(ca,{...d,routePrefix:a}),reveal:(d,l)=>Ge(d,a,l.session.id)?{tabId:k,selection:d.id}:void 0}],entityPresenters:[{reveal:d=>d.type==="artifact"?{tabId:k,selection:d.id}:void 0}]}},ie={id:ra},gu={...ie,activate:e=>ma(ie,se(ie.id,e))};export{ra as DOCUMENTS_PLUGIN_ID,k as DOCUMENTS_TAB_ID,gu as webPlugin};
|
|
1
|
+
var u=(e,a)=>{let r=globalThis.__ragentsHostModules?.[e];if(r===void 0)throw new Error(`The host does not provide ${e}`);if(!(a in r))throw new Error(`The host does not provide ${a} from ${e}; the bundle was built against a newer host`);return r[a]};var D=u("react","createContext");var S=u("react","createElement");var B=u("react","forwardRef");var X=u("react","useCallback");var M=u("react","useContext");var P=u("react","useEffect");var C=u("react","useMemo");var g=u("react","useState");var ne=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ce(e,a,r=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:ne(e),size:24,node:a,...r.length>0?{aliases:r}:{}}}var pe=e=>{let a="",r=!1;for(let o of e){if(o==="-"||o==="_"||o<=" "){r=a.length>0;continue}a.length===0?a+=o.toLowerCase():a+=r?o.toUpperCase():o,r=!1}return a};var me=e=>{let a=pe(e);return a.charAt(0).toUpperCase()+a.slice(1)};var F=(...e)=>e.filter((a,r,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===r).join(" ").trim();var h={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 K(e){return e!=null}function Le(e,a={}){let r=a.attributeNames??{},o=m=>r[m]??m,d=e.size??e.width??h.width,l=e.size??e.height??h.height,f=e.aliases?.filter(m=>typeof m=="string"&&m.trim()!=="").map(m=>`lucide-${m}`)??[],n=[...e.name?[`lucide-${e.name}`]:[],...f],L=a.className?.split(" ").filter(Boolean)??[],c=a.includeDefaultClasses===!1?F(...L):F("lucide",...n,...L),x=a.absoluteStrokeWidth?Number(a.strokeWidth??h["stroke-width"])*Number(e.size??e.width??h.width)/Number(a.size??a.width??h.width):a.strokeWidth??h["stroke-width"];return["svg",{...Object.entries(h).reduce((m,[p,w])=>(m[o(p)]=w,m),{}),..."color"in a&&a.color&&{[o("stroke")]:a.color},..."size"in a&&K(a.size)&&{[o("width")]:a.size,[o("height")]:a.size},..."width"in a&&K(a.width)&&{[o("width")]:a.width},..."height"in a&&K(a.height)&&{[o("height")]:a.height},[o("stroke-width")]:x,...c&&{[o("class")]:c},[o("viewBox")]:`0 0 ${d} ${l}`,...a.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(m=>{let[p,w,E]=m,G=a.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...w}:w;return E?[p,G,E]:[p,G]})]}function xe(e,a={}){return Le(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var Ie=e=>{for(let a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1};var je=D({});var Ce=()=>M(je);var ge=B(({color:e,size:a,width:r,height:o,strokeWidth:d,absoluteStrokeWidth:l,nonScalingStroke:f,className:n="",children:L,iconNode:c=[],icon:x={node:c,aliases:[],size:24},...s},m)=>{let{size:p=24,strokeWidth:w=2,absoluteStrokeWidth:E=!1,nonScalingStroke:G=!1,color:Ve="currentColor",className:Ne=""}=Ce()??{},ze=!!L||Ie(s),[Xe,Ke,Ze=[]]=xe(x,{color:e??Ve,width:r??a??p,height:o??a??p,strokeWidth:d??w,absoluteStrokeWidth:l??E,nonScalingStroke:f??G,className:F(Ne,n),hasA11yProp:ze,attributes:s});return S(Xe,{ref:m,...Ke},[...Ze.map(([_e,Qe])=>S(_e,Qe)),...Array.isArray(L)?L:[L]])});function W(e,a=[],r=[]){let o=typeof e=="string"?ce(e,a,r):e,d=B(({className:l,...f},n)=>S(ge,{ref:n,icon:o,className:l,...f}));return o.name&&(d.displayName=me(o.name)),d}var he={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};he.node;var y=W(he);var Se={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};Se.node;var b=W(Se);var Z=u("@ragents/web/ui","Alert");var R=u("@ragents/web/ui","Badge");var A=u("@ragents/web/ui","Button");var _=u("@ragents/web/ui","Dialog");var Q=u("@ragents/web/ui","DialogContent");var j=u("@ragents/web/ui","DialogTitle");var T=u("@ragents/web/ui","Empty");var J=u("@ragents/web/ui","EmptyContent");var V=u("@ragents/web/ui","EmptyDescription");var q=u("@ragents/web/ui","EmptyHeader");var v=u("@ragents/web/ui","EmptyMedia");var U=u("@ragents/web/ui","EmptyTitle");var N=u("@ragents/web/ui","Spinner");var $=u("quassel","Markdown");var z=u("@ragents/web/lib/format","formatBytes");var Y=u("@ragents/web/SourceCode","SourceCode");var O=u("react/jsx-runtime","Fragment");var t=u("react/jsx-runtime","jsx");var i=u("react/jsx-runtime","jsxs");var ke="grid min-w-0 gap-px",Je="truncate text-[0.82rem] font-semibold",we="text-[0.68rem] text-muted-foreground tabular-nums",$e="min-w-0 p-0 text-[12px] whitespace-pre-wrap break-words",ee="flex size-7 items-center justify-center rounded-[9px] text-[0.62rem] font-bold tracking-[0.02em]",ae={markdown:"Markdown",text:"Text",html:"HTML",image:"Image",binary:"File"},Ye={".md":"markdown",".markdown":"markdown",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".pdf":"binary",".zip":"binary",".gz":"binary",".tar":"binary",".xlsx":"binary",".docx":"binary",".bin":"binary"},te=e=>{let a=e.lastIndexOf(".");return a<0?"text":Ye[e.slice(a).toLowerCase()]??"text"},Pe=e=>e.includes("html")?"html":e.includes("markdown")?"markdown":e.startsWith("image/")?"image":e.startsWith("text/")||e.includes("json")||e.includes("xml")?"text":"binary",Ae=e=>{let a=new Date(e);return Number.isNaN(a.getTime())?e:a.toLocaleString("en-US",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})},De=(e,a={})=>[...new Map([...Object.values(a).flat(),...e].filter(r=>r.tool?.name==="show_document").map(r=>[r.tool.id,r])).values()],oe=e=>e.flatMap(a=>{let r=a.tool;if(r?.name!=="show_document")return[];try{let o=JSON.parse(r.arguments);if(typeof o.title!="string"||typeof o.content!="string")return[];let d=o.format==="text"||o.format==="html"?o.format:"markdown";return[{id:r.id,title:o.title,content:o.content,format:d}]}catch{return[]}}),Be=e=>{let[a,r]=g({}),o=e?.format==="markdown"||e?.format==="text"||e?.format==="html",d=e?.content===void 0&&o?e?.contentUrl:void 0;if(P(()=>{if(!d||a[d])return;let l=!0;return fetch(d,{cache:"no-store"}).then(async f=>{if(!f.ok)throw new Error(`Status ${f.status}`);return f.text()}).then(f=>l&&r(n=>({...n,[d]:{text:f}}))).catch(f=>l&&r(n=>({...n,[d]:{error:f instanceof Error?f.message:String(f)}}))),()=>{l=!1}},[d,a]),!!e)return e.content!==void 0?{text:e.content}:o?d?a[d]:void 0:{text:""}};function Me({active:e,document:a,onOpen:r,status:o}){let d=C(()=>a.content?a.content.split(/\r\n|\r|\n/).length:0,[a.content]),l=o==="error"?"Error":o==="running"?"Opening":e?"Opened":"Open";return i("button",{"aria-pressed":e,className:"group/call grid w-[min(100%,620px)] grid-cols-[42px_minmax(0,1fr)_auto] items-center gap-3 rounded-xl border border-border bg-[color-mix(in_srgb,var(--background)_95%,var(--primary))] px-3.5 py-3 text-left shadow-sm transition-[background-color,border-color,box-shadow,transform] duration-100 hover:-translate-y-px hover:border-primary/50 hover:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] hover:shadow-md focus-visible:border-primary/50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/55 aria-pressed:border-primary/50 aria-pressed:bg-[color-mix(in_srgb,var(--background)_91%,var(--primary))] data-[status=error]:border-destructive/45 max-[620px]:grid-cols-[38px_minmax(0,1fr)_auto] max-[620px]:gap-2.5 max-[620px]:px-2.5 max-[620px]:py-2.5","data-status":o,onClick:r,type:"button",children:[t("span",{className:"flex h-12 w-[42px] items-center justify-center rounded-lg border border-primary/25 bg-primary/12 text-primary group-data-[status=error]/call:text-destructive max-[620px]:h-11 max-[620px]:w-[38px]",children:t(H,{size:22})}),i("span",{className:"flex min-w-0 flex-col gap-0.5",children:[t("span",{className:"text-[0.62rem] font-semibold tracking-[0.05em] text-primary uppercase",children:"Document"}),t("strong",{className:"truncate text-[0.84rem] leading-[1.35]",title:a.title,children:a.title}),i("span",{className:"text-[0.7rem] leading-[1.35] text-muted-foreground",children:[ae[a.format],", ",d.toLocaleString("en-US")," ",d===1?"line":"lines"]})]}),i("span",{className:"flex items-center gap-1 text-[0.7rem] font-semibold text-primary group-data-[status=error]/call:text-destructive",children:[t("span",{className:"max-[620px]:sr-only",children:l}),o==="running"?t(N,{className:"size-3"}):o==="error"?t(Te,{}):t(Re,{})]})]})}function Fe({document:e,loaded:a}){return e.format==="image"&&e.contentUrl?t("img",{alt:e.title,className:"block max-w-full rounded-lg border border-border",src:e.contentUrl}):e.format==="binary"&&e.contentUrl?i(T,{className:"min-h-30 gap-2 p-7",children:[i(q,{children:[t(v,{children:t(H,{})}),t(U,{children:"No preview for this format"})]}),t(J,{children:t(A,{render:t("a",{download:e.title,href:e.contentUrl}),size:"sm",variant:"outline",children:"Download"})})]}):a?"error"in a?t(T,{className:"min-h-30 gap-2 p-7",children:i(q,{children:[t(v,{children:t(Te,{})}),t(U,{children:"Content not readable"}),t(V,{children:a.error})]})}):e.format==="html"?t("iframe",{className:"h-full min-h-full w-full border-0 bg-white",sandbox:"",srcDoc:a.text,title:e.title}):e.format==="text"?t(Y,{className:$e,content:a.text,path:e.title}):t($,{text:a.text}):i("div",{className:"flex items-center justify-center gap-2.5 p-9 text-[0.76rem] text-muted-foreground",children:[t(N,{className:"size-3"}),t("span",{children:"Loading"})]})}function ye({document:e}){let a=[ae[e.format],e.size!==void 0?z(e.size):void 0,e.createdAt?Ae(e.createdAt):void 0,e.meta].filter(Boolean);return i(O,{children:[t("strong",{className:Je,title:e.title,children:e.title}),t("span",{className:we,children:a.join(" \xB7 ")})]})}function ea({document:e,onClose:a}){let r=Be(e);return t(_,{open:!0,onOpenChange:o=>{o||a()},children:i(Q,{className:"w-[min(1080px,calc(100%-2*clamp(16px,5vw,72px)))] gap-0 rounded-panel border border-border bg-card p-0 shadow-pop",scope:"run",showCloseButton:!1,size:"full",children:[i("header",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-b border-border px-3.5 py-3",children:[t("span",{className:"flex size-8 items-center justify-center rounded-[10px] bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary",children:t(H,{size:20})}),t(j,{className:ke,render:t("span",{}),children:t(ye,{document:e})}),t(A,{"aria-label":"Close",className:"rounded-full",onClick:a,size:"icon",title:"Close",variant:"outline",children:t(b,{})})]}),t("div",{className:"min-h-0 flex-1 overflow-y-auto px-[clamp(18px,4vw,54px)] pt-5 pb-10 text-[13.5px] leading-[1.65]",children:t(Fe,{document:e,loaded:r})})]})})}function be({activeId:e,sections:a,truncated:r,onSelect:o}){let d=a.flatMap(s=>s.documents).find(s=>s.id===e),l=Be(d),[f,n]=g(!1),[L,c]=g(()=>new Set),x=X(s=>{c(m=>{let p=new Set(m);return p.has(s)?p.delete(s):p.add(s),p})},[]);return P(()=>{d||n(!1)},[d]),a.every(s=>s.documents.length===0)?t(T,{className:"h-full gap-2 p-7",children:i(q,{children:[t(v,{children:t(H,{})}),t(U,{children:"No documents yet"}),t(V,{children:"Files from the run's store, results, and documents shown in chat collect here."})]})}):d?i("div",{className:"flex h-full min-h-0 flex-col",children:[i("header",{className:"grid shrink-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border-soft px-workspace-inset py-2.5",children:[t(A,{"aria-label":"Back to overview",onClick:()=>o(void 0),size:"icon-sm",title:"Back to overview",variant:"outline",children:t(y,{})}),t("span",{className:ke,children:t(ye,{document:d})}),t(A,{onClick:()=>n(!0),size:"sm",variant:"outline",children:"Large"})]}),t("div",{className:"min-h-0 flex-1 overflow-y-auto px-workspace-inset py-4 text-[13px] leading-[1.6]",children:t(Fe,{document:d,loaded:l})}),f&&t(ea,{document:d,onClose:()=>n(!1)})]}):i("div",{className:"flex h-full flex-col gap-3.5 overflow-y-auto px-workspace-inset pt-2.5 pb-4.5 [scrollbar-width:thin]",children:[a.filter(s=>s.documents.length>0).map(s=>{let m=!L.has(s.id);return i("section",{children:[i("button",{"aria-expanded":m,className:"grid w-full grid-cols-[14px_26px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg px-2 py-2 text-left hover:bg-primary/7",onClick:()=>x(s.id),type:"button",children:[t("span",{"aria-hidden":!0,className:`flex text-muted-foreground transition-transform duration-150${m?" rotate-90":""}`,children:t(aa,{})}),s.kind==="store"&&t("span",{"aria-hidden":!0,className:`${ee} bg-[color-mix(in_srgb,var(--foreground)_8%,var(--background))] text-[0.85rem] text-foreground`,children:"#"}),s.kind==="results"&&t("span",{"aria-hidden":!0,className:`${ee} bg-[color-mix(in_srgb,var(--primary)_16%,var(--background))] text-primary`,children:t(oa,{})}),s.kind==="chat"&&t("span",{"aria-hidden":!0,className:`${ee} bg-[color-mix(in_srgb,var(--foreground)_9%,var(--background))] text-muted-foreground`,children:t(ta,{})}),t("span",{className:"truncate text-sm font-semibold",title:s.label,children:s.label}),t(R,{className:"tabular-nums",variant:"secondary",children:s.documents.length})]}),m&&t("div",{className:"ml-[23px] border-l border-border-soft pl-2.5",children:t("ul",{className:"mt-0.5 list-none",children:s.documents.map(p=>t("li",{children:i("button",{className:"group/entry mt-1.5 grid w-full grid-cols-[24px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-lg border border-border bg-card px-2.5 py-2.5 text-left transition-colors duration-100 hover:border-primary/55 hover:bg-[color-mix(in_srgb,var(--primary)_7%,var(--card))]",onClick:()=>o(p.id),type:"button",children:[t("span",{className:"flex text-primary",children:t(H,{size:18})}),i("span",{className:"grid min-w-0 gap-0.5",children:[t("strong",{className:"truncate text-[0.79rem] font-semibold",title:p.title,children:p.title}),t("small",{className:we,children:[ae[p.format],p.size!==void 0?z(p.size):void 0,p.createdAt?Ae(p.createdAt):void 0,p.meta].filter(Boolean).join(" \xB7 ")})]}),t("span",{"aria-hidden":!0,className:"flex text-muted-foreground opacity-0 transition-opacity duration-100 group-hover/entry:opacity-100",children:t(Re,{})})]})},p.id))})})]},s.id)}),r&&t("p",{className:"text-[0.72rem] text-muted-foreground",children:"The store contains more files than are shown here."})]})}function H({size:e=28}){return i("svg",{"aria-hidden":!0,fill:"none",height:e,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:e,children:[t("path",{d:"M6 3h8l4 4v14H6z"}),t("path",{d:"M14 3v5h4M9 13h6M9 17h4"})]})}function Re(){return t("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:t("path",{d:"m9 18 6-6-6-6"})})}function aa(){return t("svg",{"aria-hidden":!0,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"12",children:t("path",{d:"m9 18 6-6-6-6"})})}function ta(){return t("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:t("path",{d:"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.4A8 8 0 1 1 21 12z"})})}function oa(){return t("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:t("path",{d:"M20 6 9 17l-5-5"})})}function Te(){return i("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:[t("circle",{cx:"12",cy:"12",r:"9"}),t("path",{d:"M12 7v6M12 17h.01"})]})}var ue=u("@ragents/web/rpc","rpc");var I=u("typebox","Type");var re=u("@ragents/engine/src/rpc/contract","defineOperation");var qe=I.Object({path:I.String({minLength:1}),size:I.Integer({minimum:0}),modifiedAt:I.String({minLength:1})},{additionalProperties:!1}),ua=I.Object({groups:I.Array(I.Object({directory:I.String({minLength:1}),files:I.Array(qe)},{additionalProperties:!1})),loose:I.Array(qe),truncated:I.Boolean()},{additionalProperties:!1}),ve={files:re({id:"ragents.documents.files",description:"A run's file store as groups and loose files. Right: runs.read.",rights:["runs.read"],input:I.Object({runId:I.String({minLength:1,maxLength:64,description:"Run id"})},{additionalProperties:!1}),result:ua})};var de=(e,a,r)=>`${e}/runs/${encodeURIComponent(a)}/files/content?path=${encodeURIComponent(r)}`,Ue=e=>ue.call(ve.files,{runId:e});var le=u("@ragents/web/run-view","runArtifactContentUrl");var fe=u("@ragents/web/run-view","runViewFrom");var se=u("@ragents/web/PluginRegistry","pluginRoutePrefixFrom");var ra="ragents.documents",k="ragents.documents.library",da=e=>{if(e.name==="show_document")try{let a=JSON.parse(e.arguments);return typeof a.title!="string"||typeof a.path!="string"||typeof a.content=="string"?void 0:{title:a.title,path:a.path,...typeof a.format=="string"?{format:a.format}:{}}}catch{return}},Ee=(e,a,r)=>{let o=da(e);if(!o)return;let d=o.format==="markdown"||o.format==="text"||o.format==="html"?o.format:te(o.path);return{id:e.id,title:o.title,format:d,contentUrl:de(a,r,o.path)}},Ge=(e,a,r)=>oe([{key:e.id,role:"tool",text:e.name,tool:e}])[0]??Ee(e,a,r),la=(e,a,r)=>e.flatMap(o=>{let d=o.tool;if(!d)return[];let l=Ee(d,a,r);return l?[l]:[]}),We=D(void 0),Oe=()=>{let e=M(We);if(!e)throw new Error("Documents plugin is not active");return e},fa=e=>{let[a,r]=g(),[o,d]=g(),l=e.session.id;return P(()=>{let f=!0,n=()=>{Ue(l).then(c=>{f&&(r(c),d(void 0))}).catch(c=>f&&d(c instanceof Error?c.message:String(c)))};if(n(),!e.running)return()=>{f=!1};let L=setInterval(n,5e3);return()=>{f=!1,clearInterval(L)}},[l,e.running]),C(()=>({listing:a,error:o}),[a,o])};function sa({children:e,session:a}){let r=fa(a);return t(We.Provider,{value:r,children:e})}var ia=(e,a)=>{let r=new Map(a.actors.map(o=>[o.id,o.handle]));return{id:"results",label:"Results",kind:"results",documents:a.artifacts.map(o=>{let d=r.get(o.createdBy);return{id:o.id,title:o.title,format:Pe(o.mediaType),contentUrl:le(e,o.id),createdAt:o.createdAt,size:o.size,...d?{meta:`@${d}`}:{}}})}},He=(e,a,r)=>{let o=a.session.id,d=fe(a.runView),l=(c,x)=>{let s=c?`${c}/${x.path}`:x.path;return{id:`file:${s}`,title:x.path,format:te(x.path),contentUrl:`${de(e,o,s)}&v=${encodeURIComponent(x.modifiedAt)}`,createdAt:x.modifiedAt,size:x.size}},f=[...(r?.groups??[]).map(c=>({id:`store/${c.directory}`,label:c.directory,kind:"store",documents:c.files.map(x=>l(c.directory,x))})),...r&&r.loose.length>0?[{id:"store",label:"Store",kind:"store",documents:r.loose.map(c=>l(void 0,c))}]:[],...d&&d.artifacts.length>0?[ia(o,d)]:[]],n=De(a.messages,a.actorConversations),L=[...oe(n),...la(n,e,a.session.id)];return L.length>0&&f.push({id:"chat",label:"Shown in chat",kind:"chat",documents:L}),{sections:f,truncated:r?.truncated??!1}},na=e=>{function a({navigation:o,selection:d,session:l}){let{listing:f,error:n}=Oe(),{sections:L,truncated:c}=C(()=>He(e,l,f),[l.messages,l.actorConversations,l.runView,l.session.id,f]);return i(O,{children:[n&&t(Z,{className:"shrink-0 rounded-none border-x-0 border-t-0 border-b-border-soft bg-destructive/8 px-2.5 py-2 text-[0.68rem]",variant:"destructive",children:n}),t(be,{activeId:typeof d=="string"?d:void 0,sections:L,truncated:c,onSelect:x=>o.openTab(k,x??null)})]})}function r({session:o}){let{listing:d}=Oe(),{sections:l}=C(()=>He(e,o,d),[o.messages,o.actorConversations,o.runView,o.session.id,d]),f=l.reduce((n,L)=>n+L.documents.length,0);return f>0?t(R,{className:"tabular-nums",variant:"secondary",children:f}):null}return{DocumentsPanelContribution:a,DocumentsBadge:r}};function ca({navigation:e,session:a,tool:r,routePrefix:o}){let d=Ge(r,o,a.session.id);if(!d)return null;let l=r.isError?"error":r.result===void 0?"running":"ready";return t(Me,{active:e.activeTabId===k&&e.selectionFor(k)===d.id,document:d,onOpen:()=>e.openTab(k,d.id),status:l})}function pa(){return t("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:t("path",{d:"M6 3h8l4 4v14H6zM14 3v5h4M9 13h6M9 17h4"})})}var ma=(e,a)=>{let{DocumentsPanelContribution:r,DocumentsBadge:o}=na(a);return{...e,needsRunView:!0,SessionProvider:sa,workspaceTabs:[{id:k,label:"Documents",order:200,Icon:pa,Panel:r,Badge:o}],toolPresenters:[{toolName:"show_document",Inline:d=>t(ca,{...d,routePrefix:a}),reveal:(d,l)=>Ge(d,a,l.session.id)?{tabId:k,selection:d.id}:void 0}],entityPresenters:[{reveal:d=>d.type==="artifact"?{tabId:k,selection:d.id}:void 0}]}},ie={id:ra},gu={...ie,activate:e=>ma(ie,se(ie.id,e))};export{ra as DOCUMENTS_PLUGIN_ID,k as DOCUMENTS_TAB_ID,gu as webPlugin};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:
|