@schlenkr/ragents 0.1.4 → 0.1.6
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 +19 -11
- package/apps/server/package.json +8 -6
- package/apps/server/src/access-projection.ts +3 -3
- package/apps/server/src/access-service.ts +19 -8
- package/apps/server/src/access-session.ts +6 -2
- package/apps/server/src/api/contracts.ts +19 -18
- package/apps/server/src/api/core-methods.ts +45 -26
- package/apps/server/src/api/delivery.ts +4 -4
- package/apps/server/src/api/reference.ts +1 -1
- package/apps/server/src/api/rights.ts +86 -7
- package/apps/server/src/chat-context.ts +1 -1
- package/apps/server/src/chat-handler.ts +14 -7
- package/apps/server/src/config-file.ts +25 -6
- package/apps/server/src/config.ts +4 -4
- package/apps/server/src/data-directory.ts +1 -1
- package/apps/server/src/folder-install.ts +115 -0
- package/apps/server/src/host-api.json +1256 -0
- package/apps/server/src/host-api.ts +190 -0
- package/apps/server/src/host-resolution-hooks.mjs +50 -1
- package/apps/server/src/host-resolution.ts +26 -1
- package/apps/server/src/host-version.ts +41 -0
- package/apps/server/src/host-web.ts +59 -0
- package/apps/server/src/layout.ts +1 -1
- package/apps/server/src/main.ts +3 -2
- package/apps/server/src/missing-environment.ts +47 -0
- package/apps/server/src/parent-watch.ts +37 -0
- package/apps/server/src/plugin-build/build.ts +650 -0
- package/apps/server/src/plugin-build/host-api-names.ts +185 -0
- package/apps/server/src/plugin-build/plugin-description.ts +118 -0
- package/apps/server/src/plugin-build/typecheck.ts +66 -0
- package/{plugins/ragents.actor-programs/server → apps/server/src/plugin-support/actor-programs}/app-project.ts +16 -15
- package/{plugins/ragents.actor-programs/server → apps/server/src/plugin-support/actor-programs}/client-compiler.ts +4 -4
- package/{plugins/ragents.actor-programs/server → apps/server/src/plugin-support/actor-programs}/client-contracts.ts +4 -4
- package/apps/server/src/plugin-support/actor-programs/client-runtime.ts +27 -0
- package/{plugins/ragents.actor-programs → apps/server/src/plugin-support/actor-programs}/contract.ts +3 -3
- package/apps/server/src/plugin-support/actor-programs/service.ts +1 -1
- package/{plugins/ragents.actor-programs/server → apps/server/src/plugin-support/actor-programs}/tailwind.ts +2 -3
- package/{plugins/ragents.actor-programs → apps/server/src/plugin-support/actor-programs}/workflow/index.ts +48 -48
- package/apps/server/src/plugin-support/agent-tool.ts +10 -5
- package/apps/server/src/plugin-support/http.ts +1 -1
- package/apps/server/src/plugin-support/language-server/contract.ts +37 -6
- package/apps/server/src/plugin-support/language-server/plugin.ts +18 -8
- package/apps/server/src/plugin-support/language-server/snapshot-method.ts +32 -7
- package/apps/server/src/plugin-support/language-server/tools.ts +59 -15
- package/apps/server/src/plugin-support/model-aliases.ts +77 -0
- package/apps/server/src/plugin-support/model-choice.ts +17 -7
- package/apps/server/src/plugin-support/model-completion.ts +58 -0
- package/apps/server/src/plugin-support/model-upstreams.ts +2 -2
- package/apps/server/src/plugin-support/native-typescript-executor.ts +10 -7
- package/apps/server/src/plugin-support/plugin-config.ts +1 -1
- package/apps/server/src/plugin-support/plugin-folder.ts +4 -1
- package/apps/server/src/plugin-support/plugin-module.ts +1 -1
- package/apps/server/src/plugin-support/plugins-root.ts +6 -10
- package/apps/server/src/plugin-support/process-sandbox.ts +312 -0
- package/apps/server/src/plugin-support/product-model-settings-contract.ts +14 -5
- package/apps/server/src/plugin-support/product-model-settings.ts +10 -9
- package/{plugins/ragents.product/server/relay.ts → apps/server/src/plugin-support/product-relay.ts} +2 -2
- package/apps/server/src/plugin-support/product-start-options.ts +8 -3
- package/apps/server/src/plugin-support/prompt.ts +1 -1
- package/apps/server/src/plugin-support/provision.ts +6 -0
- package/apps/server/src/plugin-support/run-scripts.ts +16 -2
- package/apps/server/src/plugin-support/skills.ts +32 -16
- package/apps/server/src/plugin-support/start-entries-contract.ts +12 -3
- package/apps/server/src/plugin-support/start-options-contract.ts +5 -1
- package/apps/server/src/plugin-support/thinking-level.ts +6 -1
- package/apps/server/src/plugin-support/tool-availability.ts +1 -7
- package/apps/server/src/plugin-support/workspace-ownership.ts +12 -6
- package/apps/server/src/plugin-support/workspace-sandbox-host.ts +184 -37
- package/apps/server/src/profile/bundle-manifest.ts +183 -0
- package/apps/server/src/profile/compose.ts +19 -10
- package/apps/server/src/profile/plugin-discovery.ts +98 -46
- package/apps/server/src/profile/provisioning.ts +30 -26
- package/apps/server/src/profile-target.ts +3 -0
- package/apps/server/src/provider.ts +182 -99
- package/apps/server/src/ragents/actor-chat-history.ts +23 -22
- package/apps/server/src/ragents/chat-projection.ts +25 -14
- package/apps/server/src/ragents/chat-text-positions.ts +4 -4
- package/apps/server/src/ragents/coordinator.ts +27 -1
- package/apps/server/src/ragents/document-store.ts +1 -1
- package/apps/server/src/ragents/engine.ts +69 -36
- package/apps/server/src/ragents/global-chat.ts +26 -13
- package/apps/server/src/ragents/host-services.ts +15 -6
- package/apps/server/src/ragents/journal-chat-events.ts +31 -15
- package/apps/server/src/ragents/product-runtime.ts +1 -1
- package/apps/server/src/ragents/run-owner.ts +17 -0
- package/apps/server/src/ragents/runtime-bridge.ts +1 -1
- package/apps/server/src/ragents/session.ts +181 -82
- package/apps/server/src/ragents/start-option-state.ts +1 -1
- package/apps/server/src/ragents/typescript-tools.ts +35 -27
- package/apps/server/src/ragents/workspace-runtime.ts +74 -8
- package/apps/server/src/rpc/dispatcher.ts +17 -8
- package/apps/server/src/rpc/http-transport.ts +1 -3
- package/apps/server/src/rpc/stdio-transport.ts +1 -1
- package/apps/server/src/run-preparation-contract.ts +1 -1
- package/apps/server/src/run-preparation-input.ts +1 -1
- package/apps/server/src/run-preparation.ts +13 -20
- package/apps/server/src/run-transfer.ts +2 -2
- package/apps/server/src/server.ts +112 -33
- package/apps/server/src/settings.ts +7 -8
- package/apps/server/src/title-compactor.ts +5 -8
- package/apps/server/src/title-settings.ts +3 -3
- package/apps/server/src/web-bundles.ts +79 -0
- package/apps/server/src/web-stylesheet.ts +85 -0
- package/apps/server/tsconfig.json +4 -4
- package/apps/server/tsconfig.plugin.json +58 -0
- package/apps/web/dist/assets/highlighted-body-KPVGNVTW-B9qYBARS.js +1 -0
- package/apps/web/dist/assets/main-BCjvD2Hh.js +6 -0
- package/apps/web/dist/assets/mermaid-HWGCJPDP-BPn4aV2r.css +1 -0
- package/apps/web/dist/assets/mermaid-HWGCJPDP-CvYYFK_n.js +478 -0
- package/apps/web/dist/assets/runPanel-CG7kRMJh.js +21 -0
- package/apps/web/dist/help/guide-access.html +199 -0
- package/apps/web/dist/help/guide-access.md +84 -0
- package/apps/web/dist/help/guide-clients.html +421 -0
- package/apps/web/dist/help/guide-clients.md +336 -0
- package/apps/web/dist/help/guide-distributed.html +320 -0
- package/apps/web/dist/help/guide-distributed.md +225 -0
- package/apps/web/dist/help/guide-functions.html +231 -0
- package/apps/web/dist/help/guide-functions.md +127 -0
- package/apps/web/dist/help/guide-getting-started.html +230 -0
- package/apps/web/dist/help/guide-getting-started.md +123 -0
- package/apps/web/dist/help/guide-ideas.html +183 -0
- package/apps/web/dist/help/guide-ideas.md +71 -0
- package/apps/web/dist/help/guide-plugins.html +450 -0
- package/apps/web/dist/help/guide-plugins.md +341 -0
- package/apps/web/dist/help/guide-programs.html +359 -0
- package/apps/web/dist/help/guide-programs.md +271 -0
- package/apps/web/dist/help/guide-runtime.html +338 -0
- package/apps/web/dist/help/guide-runtime.md +225 -0
- package/apps/web/dist/help/guide.html +133 -0
- package/apps/web/dist/help/guide.md +13 -0
- package/apps/web/dist/help/homepage-bullets.js +12 -0
- package/apps/web/dist/help/homepage-distributed.js +261 -0
- package/apps/web/dist/help/homepage-plugins.js +30 -0
- package/apps/web/dist/help/homepage-scenes.js +368 -0
- package/apps/web/dist/help/homepage-stickers.js +69 -0
- package/apps/web/dist/help/homepage-story-nav.js +11 -0
- package/apps/web/dist/help/homepage-subnav.js +61 -0
- package/apps/web/dist/help/homepage.css +833 -0
- package/apps/web/dist/help/index.html +1167 -0
- package/apps/web/dist/help/mini-app.css +7056 -0
- package/apps/web/dist/help/mini-app.html +15 -0
- package/apps/web/dist/help/mini-app.js +131 -0
- package/apps/web/dist/help/screenshots/release-checklist-vscode.png +0 -0
- package/apps/web/dist/help/screenshots/release-checklist-web.png +0 -0
- package/apps/web/dist/help/scroll-vendor.js +73 -0
- package/apps/web/dist/help/site.css +63 -0
- package/apps/web/dist/help/site.js +103 -0
- package/apps/web/dist/host-web.json +143 -0
- package/apps/web/dist/index.html +15 -0
- package/apps/web/dist/run-panel.html +15 -0
- package/apps/web/package.json +2 -2
- package/apps/web/src/App.tsx +8 -6
- package/apps/web/src/Overview.tsx +5 -5
- package/apps/web/src/PluginActivation.ts +25 -5
- package/apps/web/src/PluginChat.tsx +163 -129
- package/apps/web/src/PluginFailureNotice.tsx +15 -0
- package/apps/web/src/PluginRegistry.tsx +106 -68
- package/apps/web/src/RunPreparationChat.tsx +40 -28
- package/apps/web/src/RunStore.ts +2 -2
- package/apps/web/src/SettingsModal.tsx +37 -37
- package/apps/web/src/StartOptions.tsx +81 -26
- package/apps/web/src/StartSelection.tsx +111 -0
- package/apps/web/src/StartTiles.tsx +73 -0
- package/apps/web/src/{CanvasShortcuts.tsx → SurfaceShortcuts.tsx} +2 -2
- package/apps/web/src/ThemeSettings.tsx +1 -1
- package/apps/web/src/WorkspacePanel.tsx +4 -4
- package/apps/web/src/access-session.ts +4 -1
- package/{plugins/ragents.orchestration/web → apps/web/src}/actor-conversation.ts +3 -3
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/DataTable.tsx +9 -9
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/FilePicker.tsx +4 -4
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/FlowDiagram.tsx +16 -14
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/FlowDiagramRenderer.tsx +3 -3
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/Form.tsx +12 -12
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/Layout.tsx +1 -1
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/MessageList.tsx +5 -5
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/Viewers.tsx +8 -7
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/WorkflowDiagram.tsx +1 -1
- package/apps/web/src/actor-programs/client-ui/chat-contracts.d.ts +64 -0
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/contracts.d.ts +2 -2
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/file-selection.ts +5 -5
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/index.tsx +22 -16
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/layout-contracts.d.ts +1 -1
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/message-list-contracts.d.ts +2 -2
- package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/workflow-diagram-contracts.d.ts +1 -1
- package/apps/web/src/api.ts +43 -22
- package/apps/web/src/chat/QuasselHost.tsx +12 -0
- package/apps/web/src/chat/StoppedActorNotice.tsx +39 -0
- package/apps/web/src/chat/chat-target.ts +14 -5
- package/apps/web/src/chat/requests.ts +13 -5
- package/apps/web/src/chat/useAttachmentCapabilities.ts +2 -2
- package/apps/web/src/chat/useChat.ts +8 -7
- package/apps/web/src/chat/user-location.ts +1 -1
- package/apps/web/src/chat-view-settings.tsx +49 -0
- package/apps/web/src/host-modules.ts +90 -0
- package/apps/web/src/language-server/api.ts +24 -0
- package/{plugins/ragents.lsp-roslyn/web → apps/web/src/language-server}/language-server-plugin.tsx +133 -6
- package/apps/web/src/main.tsx +4 -2
- package/apps/web/src/offered-machines.ts +11 -0
- package/apps/web/src/panel/ConnectionsPage.tsx +117 -0
- package/apps/web/src/panel/LoginForm.tsx +9 -9
- package/apps/web/src/panel/PanelDialogs.tsx +44 -27
- package/apps/web/src/panel/PanelHeader.tsx +11 -0
- package/apps/web/src/panel/PanelPage.tsx +8 -5
- package/apps/web/src/panel/RunLine.tsx +48 -0
- package/apps/web/src/panel/RunsPage.tsx +84 -0
- package/apps/web/src/panel/StartPage.tsx +163 -0
- package/apps/web/src/panel/connection-state.ts +40 -0
- package/apps/web/src/panel/contract.ts +64 -21
- package/apps/web/src/panel/page-props.ts +6 -0
- package/apps/web/src/plugin-bootstrap.ts +60 -31
- package/{plugins/ragents.product/web → apps/web/src/product}/ModelControl.tsx +3 -3
- package/{plugins/ragents.product/web → apps/web/src/product}/ProductModelSettings.tsx +7 -7
- package/{plugins/ragents.product/web → apps/web/src/product}/SystemPromptControl.tsx +3 -3
- package/{plugins/ragents.product/web → apps/web/src/product}/model-settings.ts +3 -3
- package/{plugins/ragents.product/web → apps/web/src/product}/start-options.tsx +2 -2
- package/apps/web/src/rpc/client.ts +28 -6
- package/apps/web/src/run-panel/RunPanelApp.tsx +334 -0
- package/apps/web/src/{column/ColumnRunHeader.tsx → run-panel/RunPanelHeader.tsx} +2 -2
- package/apps/web/src/{column/ColumnMenu.tsx → run-panel/RunPanelMenu.tsx} +4 -4
- package/apps/web/src/run-panel/RunPanelRail.tsx +38 -0
- package/apps/web/src/run-panel/RunPanelWorkspace.tsx +55 -0
- package/apps/web/src/{column → run-panel}/clipboard.ts +21 -10
- package/apps/web/src/run-panel/host-contract.ts +123 -0
- package/apps/web/src/{column → run-panel}/host.ts +31 -23
- package/apps/web/src/run-panel/input-bridge.ts +75 -0
- package/apps/web/src/run-panel/keyboard.ts +53 -0
- package/apps/web/src/run-panel/run-panel-location.ts +35 -0
- package/apps/web/src/{column → run-panel}/use-session-list.ts +3 -3
- package/apps/web/src/run-panel/workspace-state.ts +43 -0
- package/apps/web/src/{column.tsx → run-panel.tsx} +20 -13
- package/apps/web/src/run-preparation.ts +1 -1
- package/{plugins/ragents.orchestration/web → apps/web/src}/run-view.ts +25 -7
- package/apps/web/src/settings-contributions.ts +16 -18
- package/apps/web/src/title-model-settings.ts +1 -1
- package/apps/web/src/toolLine.ts +1 -1
- package/apps/web/src/ui/ListDetail.tsx +1 -1
- package/apps/web/src/ui/dialog.tsx +5 -5
- package/apps/web/src/ui/frame.css +1 -0
- package/apps/web/src/ui/index.ts +5 -0
- package/apps/web/src/ui/popover.tsx +2 -2
- package/apps/web/src/ui/quassel.css +41 -0
- package/apps/web/src/ui/relative-time.ts +36 -0
- package/apps/web/src/ui/startup-notice.tsx +22 -0
- package/apps/web/src/ui/state-icon.tsx +60 -0
- package/apps/web/src/ui/state-vocabulary.ts +31 -0
- package/apps/web/src/ui/stop-button.tsx +22 -0
- package/apps/web/src/ui/tailwind.css +2 -3
- package/apps/web/src/ui/theme.css +19 -19
- package/apps/web/tsconfig.json +4 -5
- package/apps/web/tsconfig.plugin.json +44 -0
- package/bundles/ragents.activity/ragents-bundle.json +38 -0
- package/bundles/ragents.activity/server/index.js +14 -0
- package/bundles/ragents.activity/server/index.js.map +7 -0
- package/bundles/ragents.activity/web/classes.json +1 -0
- package/bundles/ragents.activity/web/index.js +2 -0
- package/bundles/ragents.activity/web/index.js.map +7 -0
- package/bundles/ragents.actor-programs/prompt.hbs +80 -0
- package/bundles/ragents.actor-programs/ragents-bundle.json +214 -0
- package/bundles/ragents.actor-programs/server/index.js +2071 -0
- package/bundles/ragents.actor-programs/server/index.js.map +7 -0
- package/bundles/ragents.actor-programs/summary.hbs +17 -0
- package/bundles/ragents.actor-programs/web/classes.json +1 -0
- package/bundles/ragents.actor-programs/web/index.js +27 -0
- package/bundles/ragents.actor-programs/web/index.js.map +7 -0
- package/bundles/ragents.ask/ask.hbs +4 -0
- package/bundles/ragents.ask/ragents-bundle.json +97 -0
- package/bundles/ragents.ask/server/chunks/chunk-PDJO75SQ.js +13 -0
- package/bundles/ragents.ask/server/chunks/chunk-PDJO75SQ.js.map +7 -0
- package/bundles/ragents.ask/server/exports/server/contract.js +11 -0
- package/bundles/ragents.ask/server/exports/server/contract.js.map +7 -0
- package/bundles/ragents.ask/server/index.js +279 -0
- package/bundles/ragents.ask/server/index.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/chunk-HGFDGTNC.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-HGFDGTNC.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/chunk-V7W3QDVS.js +25 -0
- package/bundles/ragents.ask/web/chunks/chunk-V7W3QDVS.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js.map +7 -0
- package/bundles/ragents.ask/web/classes.json +1 -0
- package/bundles/ragents.ask/web/exports/ask-payload.js +2 -0
- package/bundles/ragents.ask/web/exports/ask-payload.js.map +7 -0
- package/bundles/ragents.ask/web/exports/web/QuestionCard.js +2 -0
- package/bundles/ragents.ask/web/exports/web/QuestionCard.js.map +7 -0
- package/bundles/ragents.ask/web/exports/web/api.js +2 -0
- package/bundles/ragents.ask/web/exports/web/api.js.map +7 -0
- package/bundles/ragents.ask/web/index.js +2 -0
- package/bundles/ragents.ask/web/index.js.map +7 -0
- package/bundles/ragents.browser/ragents-bundle.json +53 -0
- package/bundles/ragents.browser/server/chunks/chunk-2GKLLCBE.js +11 -0
- package/bundles/ragents.browser/server/chunks/chunk-2GKLLCBE.js.map +7 -0
- package/bundles/ragents.browser/server/exports/server/contract.js +9 -0
- package/bundles/ragents.browser/server/exports/server/contract.js.map +7 -0
- package/bundles/ragents.browser/server/index.js +479 -0
- package/bundles/ragents.browser/server/index.js.map +7 -0
- package/bundles/ragents.browser/skills/browser-testing/SKILL.md +38 -0
- package/bundles/ragents.documents/prompt.hbs +18 -0
- package/bundles/ragents.documents/ragents-bundle.json +120 -0
- package/bundles/ragents.documents/server/chunks/chunk-QIECRZ7C.js +37 -0
- package/bundles/ragents.documents/server/chunks/chunk-QIECRZ7C.js.map +7 -0
- package/bundles/ragents.documents/server/exports/contract.js +11 -0
- package/bundles/ragents.documents/server/exports/contract.js.map +7 -0
- package/bundles/ragents.documents/server/index.js +290 -0
- package/bundles/ragents.documents/server/index.js.map +7 -0
- package/bundles/ragents.documents/web/classes.json +1 -0
- package/bundles/ragents.documents/web/index.js +26 -0
- package/bundles/ragents.documents/web/index.js.map +7 -0
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +49 -0
- package/bundles/ragents.lsp-fsharp/server/index.js +82 -0
- package/bundles/ragents.lsp-fsharp/server/index.js.map +7 -0
- package/bundles/ragents.lsp-fsharp/web/classes.json +1 -0
- package/bundles/ragents.lsp-fsharp/web/index.js +2 -0
- package/bundles/ragents.lsp-fsharp/web/index.js.map +7 -0
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +61 -0
- package/bundles/ragents.lsp-roslyn/server/index.js +208 -0
- package/bundles/ragents.lsp-roslyn/server/index.js.map +7 -0
- package/bundles/ragents.lsp-roslyn/web/classes.json +1 -0
- package/bundles/ragents.lsp-roslyn/web/index.js +2 -0
- package/bundles/ragents.lsp-roslyn/web/index.js.map +7 -0
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +36 -0
- package/bundles/ragents.lsp-typescript/server/index.js +13 -0
- package/bundles/ragents.lsp-typescript/server/index.js.map +7 -0
- package/bundles/ragents.lsp-typescript/web/classes.json +1 -0
- package/bundles/ragents.lsp-typescript/web/index.js +2 -0
- package/bundles/ragents.lsp-typescript/web/index.js.map +7 -0
- package/bundles/ragents.model-relay/ragents-bundle.json +33 -0
- package/bundles/ragents.model-relay/server/index.js +230 -0
- package/bundles/ragents.model-relay/server/index.js.map +7 -0
- package/bundles/ragents.orchestration/orchestration.hbs +106 -0
- package/bundles/ragents.orchestration/ragents-bundle.json +194 -0
- package/bundles/ragents.orchestration/server/index.js +277 -0
- package/bundles/ragents.orchestration/server/index.js.map +7 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-ODMMQGX2.js +2 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-ODMMQGX2.js.map +7 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js +2 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js.map +7 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-OSKPH6SZ.js +2 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-OSKPH6SZ.js.map +7 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-XGPPQCZR.js +2 -0
- package/bundles/ragents.orchestration/web/chunks/chunk-XGPPQCZR.js.map +7 -0
- package/bundles/ragents.orchestration/web/classes.json +1 -0
- package/bundles/ragents.orchestration/web/exports/web/program-slot.js +2 -0
- package/bundles/ragents.orchestration/web/exports/web/program-slot.js.map +7 -0
- package/bundles/ragents.orchestration/web/exports/web/surface-entities.js +2 -0
- package/bundles/ragents.orchestration/web/exports/web/surface-entities.js.map +7 -0
- package/bundles/ragents.orchestration/web/exports/web/tile-docking.js +2 -0
- package/bundles/ragents.orchestration/web/exports/web/tile-docking.js.map +7 -0
- package/bundles/ragents.orchestration/web/index.js +51 -0
- package/bundles/ragents.orchestration/web/index.js.map +7 -0
- package/bundles/ragents.overseer/ragents-bundle.json +144 -0
- package/bundles/ragents.overseer/server/index.js +652 -0
- package/bundles/ragents.overseer/server/index.js.map +7 -0
- package/bundles/ragents.overseer/web/classes.json +1 -0
- package/bundles/ragents.overseer/web/index.js +25 -0
- package/bundles/ragents.overseer/web/index.js.map +7 -0
- package/bundles/ragents.processes/ragents-bundle.json +93 -0
- package/bundles/ragents.processes/server/index.js +204 -0
- package/bundles/ragents.processes/server/index.js.map +7 -0
- package/bundles/ragents.processes/web/classes.json +1 -0
- package/bundles/ragents.processes/web/index.js +4 -0
- package/bundles/ragents.processes/web/index.js.map +7 -0
- package/bundles/ragents.product/preamble.hbs +9 -0
- package/bundles/ragents.product/ragents-bundle.json +93 -0
- package/bundles/ragents.product/server/index.js +208 -0
- package/bundles/ragents.product/server/index.js.map +7 -0
- package/bundles/ragents.product/web/classes.json +1 -0
- package/bundles/ragents.product/web/index.js +2 -0
- package/bundles/ragents.product/web/index.js.map +7 -0
- package/bundles/ragents.profile-distribution/ragents-bundle.json +64 -0
- package/bundles/ragents.profile-distribution/server/index.js +241 -0
- package/bundles/ragents.profile-distribution/server/index.js.map +7 -0
- package/bundles/ragents.reference/ragents-bundle.json +39 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/RUN.md +27 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +10 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +80 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +82 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +154 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/package.json +9 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/src/server.ts +32 -0
- package/bundles/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +59 -0
- package/bundles/ragents.reference/run-scripts/conversation-circle/RUN.md +13 -0
- package/bundles/ragents.reference/run-scripts/conversation-circle/package.json +9 -0
- package/bundles/ragents.reference/run-scripts/conversation-circle/src/server.ts +81 -0
- package/bundles/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +26 -0
- package/bundles/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +34 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/RUN.md +24 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/package.json +10 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +5 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/client.tsx +27 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/server.ts +137 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/state.ts +38 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/view.tsx +42 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/workflow.ts +38 -0
- package/bundles/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +218 -0
- package/bundles/ragents.reference/run-scripts/moderated-round/RUN.md +12 -0
- package/bundles/ragents.reference/run-scripts/moderated-round/package.json +9 -0
- package/bundles/ragents.reference/run-scripts/moderated-round/src/server.ts +60 -0
- package/bundles/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +26 -0
- package/bundles/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +24 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/RUN.md +18 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +16 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/client.tsx +39 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +15 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/server.ts +14 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +13 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/package.json +9 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/src/server.ts +65 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +26 -0
- package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +42 -0
- package/bundles/ragents.reference/run-scripts/word-game/RUN.md +25 -0
- package/bundles/ragents.reference/run-scripts/word-game/package.json +11 -0
- package/bundles/ragents.reference/run-scripts/word-game/src/client.tsx +27 -0
- package/bundles/ragents.reference/run-scripts/word-game/src/contract.ts +23 -0
- package/bundles/ragents.reference/run-scripts/word-game/src/server.ts +105 -0
- package/bundles/ragents.reference/run-scripts/word-game/src/state.ts +22 -0
- package/bundles/ragents.reference/run-scripts/word-game/src/view.tsx +54 -0
- package/bundles/ragents.reference/run-scripts/word-game/tests/program.test.ts +252 -0
- package/bundles/ragents.reference/server/index.js +16 -0
- package/bundles/ragents.reference/server/index.js.map +7 -0
- package/bundles/ragents.reference/skills/100-shared-actor-list/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/110-all-card-slots/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/150-editorial-workbench/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/160-learning-companion/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/170-photo-collection/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/180-decision-workbench/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/190-review-queue/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/20-circle-of-four/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/210-moderator-handover/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/220-actor-approval-list/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/230-shared-state-views/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/240-live-result-list/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/250-balcony-wizard/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/35-actor-input-fifo/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/40-subscription-matrix/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/50-subscription-removal/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/70-headless-counter/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/75-lsp-demo/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/80-actor-text-analysis/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/90-actor-notes/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/95-hello-world/SKILL.md +12 -0
- package/bundles/ragents.reference/skills/decision-brief/SKILL.md +33 -0
- package/bundles/ragents.reference/skills/learning-sprint/SKILL.md +33 -0
- package/bundles/ragents.reference/web/classes.json +1 -0
- package/bundles/ragents.reference/web/index.js +2 -0
- package/bundles/ragents.reference/web/index.js.map +7 -0
- package/bundles/ragents.todo/ragents-bundle.json +48 -0
- package/bundles/ragents.todo/server/index.js +108 -0
- package/bundles/ragents.todo/server/index.js.map +7 -0
- package/bundles/ragents.todo/web/classes.json +1 -0
- package/bundles/ragents.todo/web/index.js +2 -0
- package/bundles/ragents.todo/web/index.js.map +7 -0
- package/bundles/ragents.transcript/ragents-bundle.json +34 -0
- package/bundles/ragents.transcript/server/index.js +102 -0
- package/bundles/ragents.transcript/server/index.js.map +7 -0
- package/bundles/ragents.watch/ragents-bundle.json +39 -0
- package/bundles/ragents.watch/server/chunks/chunk-FHAM6OML.js +11 -0
- package/bundles/ragents.watch/server/chunks/chunk-FHAM6OML.js.map +7 -0
- package/bundles/ragents.watch/server/chunks/chunk-RPBX3J4P.js +10 -0
- package/bundles/ragents.watch/server/chunks/chunk-RPBX3J4P.js.map +7 -0
- package/bundles/ragents.watch/server/exports/contract.js +9 -0
- package/bundles/ragents.watch/server/exports/contract.js.map +7 -0
- package/bundles/ragents.watch/server/exports/server/contract.js +9 -0
- package/bundles/ragents.watch/server/exports/server/contract.js.map +7 -0
- package/bundles/ragents.watch/server/index.js +482 -0
- package/bundles/ragents.watch/server/index.js.map +7 -0
- package/bundles/ragents.workspace/prompt.hbs +7 -0
- package/bundles/ragents.workspace/ragents-bundle.json +148 -0
- package/bundles/ragents.workspace/server/index.js +1049 -0
- package/bundles/ragents.workspace/server/index.js.map +7 -0
- package/bundles/ragents.workspace/web/classes.json +1 -0
- package/bundles/ragents.workspace/web/index.js +39 -0
- package/bundles/ragents.workspace/web/index.js.map +7 -0
- package/package.json +5 -16
- package/packages/agent/dist/core/agent-session-runtime.d.ts +33 -0
- package/packages/agent/dist/core/agent-session-services.d.ts +35 -0
- package/packages/agent/dist/core/agent-session.d.ts +234 -0
- package/packages/agent/dist/core/agent-settings.d.ts +27 -0
- package/packages/agent/dist/core/auth-guidance.d.ts +4 -0
- package/packages/agent/dist/core/compaction/compaction.d.ts +116 -0
- package/packages/agent/dist/core/compaction/index.d.ts +6 -0
- package/packages/agent/dist/core/compaction/utils.d.ts +39 -0
- package/packages/agent/dist/core/defaults.d.ts +3 -0
- package/packages/agent/dist/core/extensions/index.d.ts +11 -0
- package/packages/agent/dist/core/extensions/loader.d.ts +12 -0
- package/packages/agent/dist/core/extensions/runner.d.ts +39 -0
- package/packages/agent/dist/core/extensions/types.d.ts +156 -0
- package/packages/agent/dist/core/extensions/wrapper.d.ts +12 -0
- package/packages/agent/dist/core/messages.d.ts +37 -0
- package/packages/agent/dist/core/model-runtime.d.ts +32 -0
- package/packages/agent/dist/core/provider-composer.d.ts +25 -0
- package/packages/agent/dist/core/resource-loader.d.ts +39 -0
- package/packages/agent/dist/core/sdk.d.ts +38 -0
- package/packages/agent/dist/core/session-manager.d.ts +189 -0
- package/packages/agent/dist/core/skills.d.ts +20 -0
- package/packages/agent/dist/core/source-info.d.ts +16 -0
- package/packages/agent/dist/core/system-prompt.d.ts +21 -0
- package/packages/agent/dist/core/tools/bash.d.ts +63 -0
- package/packages/agent/dist/core/tools/edit-diff.d.ts +98 -0
- package/packages/agent/dist/core/tools/edit.d.ts +41 -0
- package/packages/agent/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/packages/agent/dist/core/tools/index.d.ts +5 -0
- package/packages/agent/dist/core/tools/output-accumulator.d.ts +58 -0
- package/packages/agent/dist/core/tools/path-utils.d.ts +8 -0
- package/packages/agent/dist/core/tools/read.d.ts +33 -0
- package/packages/agent/dist/core/tools/truncate.d.ts +61 -0
- package/packages/agent/dist/core/tools/write.d.ts +23 -0
- package/packages/agent/dist/index.d.ts +13 -0
- package/packages/agent/dist/loop/agent-loop.d.ts +13 -0
- package/packages/agent/dist/loop/agent.d.ts +103 -0
- package/packages/agent/dist/loop/index.d.ts +5 -0
- package/packages/agent/dist/loop/types.d.ts +333 -0
- package/packages/agent/dist/loop/uuid.d.ts +2 -0
- package/packages/agent/dist/utils/child-process.d.ts +17 -0
- package/packages/agent/dist/utils/exif-orientation.d.ts +5 -0
- package/packages/agent/dist/utils/frontmatter.d.ts +8 -0
- package/packages/agent/dist/utils/image-convert.d.ts +2 -0
- package/packages/agent/dist/utils/image-process.d.ts +18 -0
- package/packages/agent/dist/utils/image-resize-core.d.ts +30 -0
- package/packages/agent/dist/utils/image-resize-worker.d.ts +2 -0
- package/packages/agent/dist/utils/image-resize.d.ts +16 -0
- package/packages/agent/dist/utils/mime.d.ts +3 -0
- package/packages/agent/dist/utils/paths.d.ts +15 -0
- package/packages/agent/dist/utils/photon.d.ts +21 -0
- package/packages/agent/dist/utils/shell.d.ts +17 -0
- package/packages/agent/dist/utils/sleep.d.ts +5 -0
- package/packages/agent/package.json +3 -32
- package/packages/agent/src/core/agent-session-runtime.ts +15 -469
- package/packages/agent/src/core/agent-session-services.ts +17 -167
- package/packages/agent/src/core/agent-session.ts +154 -2403
- package/packages/agent/src/core/agent-settings.ts +20 -0
- package/packages/agent/src/core/auth-guidance.ts +0 -4
- package/packages/agent/src/core/compaction/compaction.ts +4 -33
- package/packages/agent/src/core/compaction/index.ts +0 -1
- package/packages/agent/src/core/compaction/utils.ts +2 -2
- package/packages/agent/src/core/defaults.ts +1 -1
- package/packages/agent/src/core/extensions/index.ts +6 -117
- package/packages/agent/src/core/extensions/loader.ts +21 -605
- package/packages/agent/src/core/extensions/runner.ts +48 -969
- package/packages/agent/src/core/extensions/types.ts +35 -1298
- package/packages/agent/src/core/extensions/wrapper.ts +13 -34
- package/packages/agent/src/core/messages.ts +5 -109
- package/packages/agent/src/core/model-runtime.ts +109 -467
- package/packages/agent/src/core/provider-composer.ts +21 -451
- package/packages/agent/src/core/resource-loader.ts +18 -822
- package/packages/agent/src/core/sdk.ts +46 -281
- package/packages/agent/src/core/session-manager.ts +11 -891
- package/packages/agent/src/core/skills.ts +8 -440
- package/packages/agent/src/core/source-info.ts +0 -12
- package/packages/agent/src/core/system-prompt.ts +2 -41
- package/packages/agent/src/core/tools/bash.ts +20 -32
- package/packages/agent/src/core/tools/edit-diff.ts +0 -60
- package/packages/agent/src/core/tools/edit.ts +2 -18
- package/packages/agent/src/core/tools/index.ts +4 -130
- package/packages/agent/src/core/tools/output-accumulator.ts +33 -5
- package/packages/agent/src/core/tools/path-utils.ts +2 -49
- package/packages/agent/src/core/tools/read.ts +4 -12
- package/packages/agent/src/core/tools/truncate.ts +0 -15
- package/packages/agent/src/core/tools/write.ts +1 -8
- package/packages/agent/src/index.ts +11 -272
- package/packages/{agent-core/src → agent/src/loop}/agent-loop.ts +127 -273
- package/packages/{agent-core/src → agent/src/loop}/agent.ts +12 -164
- package/packages/{agent-core/src → agent/src/loop}/types.ts +6 -105
- package/packages/agent/src/utils/child-process.ts +0 -13
- package/packages/agent/src/utils/image-convert.ts +0 -25
- package/packages/agent/src/utils/paths.ts +1 -71
- package/packages/agent/src/utils/shell.ts +13 -156
- package/packages/ai/dist/api/ai-sdk-messages.d.ts +9 -0
- package/packages/ai/dist/api/ai-sdk-transport.d.ts +13 -0
- package/packages/ai/dist/api/ai-sdk.d.ts +13 -0
- package/packages/ai/dist/api/ai-sdk.lazy.d.ts +3 -0
- package/packages/ai/dist/api/lazy.d.ts +15 -0
- package/packages/ai/dist/api/simple-options.d.ts +4 -0
- package/packages/ai/dist/api/transform-messages.d.ts +8 -0
- package/packages/ai/dist/api-registry.d.ts +25 -0
- package/packages/ai/dist/auth/context.d.ts +4 -0
- package/packages/ai/dist/auth/helpers.d.ts +4 -0
- package/packages/ai/dist/auth/resolve.d.ts +19 -0
- package/packages/ai/dist/auth/types.d.ts +51 -0
- package/packages/ai/dist/env-api-keys.d.ts +8 -0
- package/packages/ai/dist/index.d.ts +19 -0
- package/packages/ai/dist/models.d.ts +71 -0
- package/packages/ai/dist/models.generated.d.ts +8021 -0
- package/packages/ai/dist/providers/all.d.ts +15 -0
- package/packages/ai/dist/providers/faux.d.ts +97 -0
- package/packages/ai/dist/providers/openrouter.d.ts +3 -0
- package/packages/ai/dist/providers/openrouter.models.d.ts +8019 -0
- package/packages/ai/dist/types.d.ts +541 -0
- package/packages/ai/dist/utils/diagnostics.d.ts +13 -0
- package/packages/ai/dist/utils/error-body.d.ts +25 -0
- package/packages/ai/dist/utils/estimate.d.ts +17 -0
- package/packages/ai/dist/utils/event-stream.d.ts +21 -0
- package/packages/ai/dist/utils/headers.d.ts +2 -0
- package/packages/ai/dist/utils/json-parse.d.ts +16 -0
- package/packages/ai/dist/utils/overflow.d.ts +54 -0
- package/packages/ai/dist/utils/provider-env.d.ts +7 -0
- package/packages/ai/dist/utils/retry.d.ts +12 -0
- package/packages/ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/packages/ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/packages/ai/dist/utils/validation.d.ts +10 -0
- package/packages/ai/package.json +2 -6
- package/packages/ai/src/api/ai-sdk-transport.ts +2 -2
- package/packages/ai/src/api/simple-options.ts +0 -34
- package/packages/ai/src/api-registry.ts +1 -12
- package/packages/ai/src/auth/context.ts +1 -30
- package/packages/ai/src/auth/helpers.ts +3 -34
- package/packages/ai/src/auth/resolve.ts +10 -108
- package/packages/ai/src/auth/types.ts +9 -176
- package/packages/ai/src/index.ts +1 -13
- package/packages/ai/src/models.ts +41 -407
- package/packages/ai/src/providers/all.ts +3 -31
- package/packages/ai/src/providers/openrouter.models.ts +14 -0
- package/packages/ai/src/types.ts +0 -104
- package/packages/ai/src/utils/diagnostics.ts +0 -32
- package/packages/ai/src/utils/headers.ts +0 -11
- package/packages/ai/src/utils/overflow.ts +0 -7
- package/packages/ai/src/utils/validation.ts +0 -15
- package/packages/ragents/package.json +3 -6
- package/packages/ragents/src/access.ts +2 -1
- package/packages/ragents/src/agents/actor-input.ts +14 -18
- package/packages/ragents/src/agents/catalog.ts +3 -3
- package/packages/ragents/src/agents/plugins.ts +0 -4
- package/packages/ragents/src/agents/scheduler.ts +232 -78
- package/packages/ragents/src/agents/schemas.ts +1 -36
- package/packages/ragents/src/agents/tool-orientation.ts +1 -1
- package/packages/ragents/src/agents/tools.ts +72 -73
- package/packages/ragents/src/agents/toolset.ts +5 -5
- package/packages/ragents/src/agents/turn.ts +2 -14
- package/packages/ragents/src/agents/workspaces.ts +18 -0
- package/packages/ragents/src/domain/actor-reference.ts +22 -0
- package/packages/ragents/src/domain/driver.ts +0 -9
- package/packages/ragents/src/domain/event-semantics.ts +62 -74
- package/packages/ragents/src/domain/event-validation.ts +22 -21
- package/packages/ragents/src/domain/events.ts +19 -7
- package/packages/ragents/src/domain/json.ts +2 -0
- package/packages/ragents/src/domain/model.ts +40 -18
- package/packages/ragents/src/domain/projection.ts +43 -15
- package/packages/ragents/src/domain/schema-errors.ts +3 -3
- package/packages/ragents/src/drivers/agent-hooks.ts +40 -0
- package/packages/ragents/src/drivers/agent-runtime.ts +118 -186
- package/packages/ragents/src/drivers/agent.ts +5 -20
- package/packages/ragents/src/drivers/attachments.ts +4 -24
- package/packages/ragents/src/drivers/skill-preload.ts +4 -16
- package/packages/ragents/src/drivers/types.ts +20 -3
- package/packages/ragents/src/http/contracts.ts +16 -3
- package/packages/ragents/src/http/methods.ts +32 -33
- package/packages/ragents/src/index.ts +5 -15
- package/packages/ragents/src/plugin-host.ts +151 -105
- package/packages/ragents/src/plugin-types.ts +86 -23
- package/packages/ragents/src/rpc/peer.ts +6 -0
- package/packages/ragents/src/runtime/decisions/actions.ts +40 -37
- package/packages/ragents/src/runtime/decisions/actors.ts +90 -51
- package/packages/ragents/src/runtime/decisions/artifacts.ts +2 -2
- package/packages/ragents/src/runtime/decisions/inputs.ts +3 -3
- package/packages/ragents/src/runtime/decisions/subscriptions.ts +9 -7
- package/packages/ragents/src/runtime/decisions/turns.ts +37 -4
- package/packages/ragents/src/runtime/guards.ts +12 -21
- package/packages/ragents/src/runtime/journal-storage.ts +4 -2
- package/packages/ragents/src/runtime/journal.ts +1 -1
- package/packages/ragents/src/runtime/orchestration.ts +31 -14
- package/packages/ragents/src/runtime/serial-queue.ts +24 -0
- package/packages/ragents/src/runtime/stop.ts +19 -44
- package/packages/ragents/src/script/mediators.ts +4 -5
- package/packages/ragents/src/typescript/index.ts +2 -0
- package/packages/ragents/src/typescript/run-context.ts +10 -8
- package/packages/ragents/src/typescript/snippet.ts +7 -6
- package/packages/workspace-executor/package.json +2 -2
- package/packages/workspace-executor/src/bash-launch.ts +45 -0
- package/packages/workspace-executor/src/browser/contract.ts +71 -0
- package/packages/workspace-executor/src/browser/module.ts +74 -0
- package/packages/workspace-executor/src/browser/pages.ts +298 -0
- package/packages/workspace-executor/src/browser/playwright.ts +52 -0
- package/packages/workspace-executor/src/commands.ts +170 -0
- package/packages/workspace-executor/src/context.ts +34 -6
- package/packages/workspace-executor/src/errors.ts +12 -0
- package/packages/workspace-executor/src/executor.ts +62 -104
- package/packages/workspace-executor/src/files.ts +287 -0
- package/packages/workspace-executor/src/index.ts +82 -18
- package/packages/workspace-executor/src/language-server/adapters/roslyn.ts +1 -0
- package/packages/workspace-executor/src/language-server/contract.ts +14 -0
- package/packages/workspace-executor/src/language-server/host.ts +82 -26
- package/packages/workspace-executor/src/language-server/module.ts +107 -0
- package/packages/workspace-executor/src/language-server/workspace-solutions.ts +90 -0
- package/packages/workspace-executor/src/managed-process.ts +1 -1
- package/packages/workspace-executor/src/module.ts +35 -0
- package/packages/workspace-executor/src/modules.ts +25 -0
- package/packages/workspace-executor/src/paths.ts +57 -5
- package/packages/workspace-executor/src/process-sandbox.ts +16 -0
- package/packages/workspace-executor/src/processes/module.ts +48 -0
- package/{plugins/ragents.processes/server → packages/workspace-executor/src/processes}/process-table.ts +80 -57
- package/packages/workspace-executor/src/processes/scanner.ts +106 -0
- package/{plugins/ragents.processes/server → packages/workspace-executor/src/processes}/snapshot.ts +23 -11
- package/{plugins/ragents.processes/server → packages/workspace-executor/src/processes}/terminator.ts +19 -20
- package/packages/workspace-executor/src/run-folders.ts +33 -0
- package/packages/workspace-executor/src/safe-environment.ts +14 -0
- package/packages/workspace-executor/src/sandbox-tools.ts +206 -36
- package/packages/workspace-executor/src/shell-platform.ts +2 -2
- package/plugins/package.json +1 -1
- package/plugins/ragents.activity/ragents-plugin.json +3 -0
- package/plugins/ragents.activity/server/index.ts +2 -2
- package/plugins/ragents.activity/web/ActivityHeader.tsx +2 -2
- package/plugins/ragents.activity/web/activity.ts +1 -1
- package/plugins/ragents.activity/web/index.tsx +1 -1
- package/plugins/ragents.actor-programs/prompt.hbs +8 -7
- package/plugins/ragents.actor-programs/ragents-plugin.json +3 -0
- package/plugins/ragents.actor-programs/server/agent-tools.ts +3 -3
- package/{apps/server/src/plugin-support/actor-programs → plugins/ragents.actor-programs/server}/capability-resolver.ts +1 -16
- package/plugins/ragents.actor-programs/server/controls-template.ts +5 -18
- package/plugins/ragents.actor-programs/server/controls-tool.ts +8 -11
- package/plugins/ragents.actor-programs/server/index.ts +10 -10
- package/{apps/server/src/plugin-support/actor-programs → plugins/ragents.actor-programs/server}/limits.ts +4 -4
- package/plugins/ragents.actor-programs/server/methods.ts +2 -2
- package/{apps/server/src/plugin-support/actor-programs → plugins/ragents.actor-programs/server}/operations.ts +2 -4
- package/plugins/ragents.actor-programs/server/project-diagnostics.ts +65 -70
- package/plugins/ragents.actor-programs/server/prompts.ts +4 -4
- package/plugins/ragents.actor-programs/server/routes.ts +14 -8
- package/plugins/ragents.actor-programs/server/runtime.ts +132 -55
- package/plugins/ragents.actor-programs/server/templates.ts +35 -80
- package/plugins/ragents.actor-programs/server/test-report.ts +106 -0
- package/plugins/ragents.actor-programs/server/tool-contributor.ts +4 -4
- package/plugins/ragents.actor-programs/summary.hbs +1 -1
- package/plugins/ragents.actor-programs/web/ActorViewFrame.tsx +15 -10
- package/plugins/ragents.actor-programs/web/AppsPanel.tsx +47 -30
- package/plugins/ragents.actor-programs/web/EmbeddedApps.tsx +15 -17
- package/plugins/ragents.actor-programs/web/FullscreenHost.tsx +3 -3
- package/plugins/ragents.actor-programs/web/FunctionForm.tsx +3 -3
- package/plugins/ragents.actor-programs/web/ProgramSource.tsx +12 -3
- package/plugins/ragents.actor-programs/web/api.ts +5 -5
- package/plugins/ragents.actor-programs/web/bridge.ts +2 -3
- package/plugins/ragents.actor-programs/web/chat-state.ts +9 -8
- package/plugins/ragents.actor-programs/web/index.tsx +7 -17
- package/plugins/ragents.actor-programs/web/program-state.ts +3 -3
- package/plugins/ragents.actor-programs/web/state-revision.ts +2 -2
- package/plugins/ragents.ask/ask-payload.ts +25 -0
- package/plugins/ragents.ask/contract.ts +2 -2
- package/plugins/ragents.ask/ragents-plugin.json +7 -0
- package/plugins/ragents.ask/server/answer-method.ts +1 -1
- package/plugins/ragents.ask/server/ask-service.ts +43 -19
- package/plugins/ragents.ask/server/ask-tool.ts +2 -2
- package/plugins/ragents.ask/server/contract.ts +9 -1
- package/plugins/ragents.ask/server/index.ts +8 -10
- package/plugins/ragents.ask/server/tool-contributor.ts +3 -3
- package/plugins/ragents.ask/web/AskActionView.tsx +36 -0
- package/{apps/web/src/chat → plugins/ragents.ask/web}/QuestionCard.tsx +7 -5
- package/plugins/ragents.ask/web/QuestionSection.tsx +22 -21
- package/plugins/ragents.ask/web/api.ts +1 -1
- package/plugins/ragents.ask/web/index.tsx +11 -8
- package/plugins/ragents.browser/provision.ts +9 -8
- package/plugins/ragents.browser/ragents-plugin.json +6 -0
- package/plugins/ragents.browser/server/browser.ts +165 -286
- package/plugins/ragents.browser/server/contract.ts +8 -19
- package/plugins/ragents.browser/server/index.ts +8 -7
- package/plugins/ragents.browser/server/tools.ts +29 -37
- package/plugins/ragents.browser/skills/browser-testing/SKILL.md +3 -1
- package/plugins/ragents.documents/contract.ts +4 -2
- package/plugins/ragents.documents/ragents-plugin.json +6 -0
- package/plugins/ragents.documents/server/config.ts +1 -1
- package/plugins/ragents.documents/server/document-write-tool.ts +2 -2
- package/plugins/ragents.documents/server/files-route.ts +2 -3
- package/plugins/ragents.documents/server/index.ts +10 -11
- package/plugins/ragents.documents/server/show-document-tool.ts +2 -2
- package/plugins/ragents.documents/server/store.ts +3 -3
- package/plugins/ragents.documents/server/tool-contributor.ts +3 -3
- package/plugins/ragents.documents/web/DocumentViewer.tsx +5 -6
- package/plugins/ragents.documents/web/api.ts +1 -1
- package/plugins/ragents.documents/web/index.tsx +4 -4
- package/plugins/ragents.lsp-fsharp/provision.ts +2 -2
- package/plugins/ragents.lsp-fsharp/ragents-plugin.json +3 -0
- package/plugins/ragents.lsp-fsharp/server/index.ts +3 -3
- package/plugins/ragents.lsp-fsharp/web/index.tsx +1 -1
- package/plugins/ragents.lsp-roslyn/provision.ts +2 -2
- package/plugins/ragents.lsp-roslyn/ragents-plugin.json +3 -0
- package/plugins/ragents.lsp-roslyn/server/index.ts +47 -8
- package/plugins/ragents.lsp-roslyn/server/solution-on-start.ts +145 -0
- package/plugins/ragents.lsp-roslyn/web/index.tsx +1 -1
- package/plugins/ragents.lsp-typescript/ragents-plugin.json +3 -0
- package/plugins/ragents.lsp-typescript/server/index.ts +3 -3
- package/plugins/ragents.lsp-typescript/web/index.tsx +1 -1
- package/plugins/ragents.model-relay/ragents-plugin.json +3 -0
- package/plugins/ragents.model-relay/server/config.ts +5 -31
- package/plugins/ragents.model-relay/server/index.ts +5 -6
- package/plugins/ragents.model-relay/server/relay.ts +8 -9
- package/plugins/ragents.orchestration/contract.ts +13 -14
- package/plugins/ragents.orchestration/orchestration.hbs +4 -3
- package/plugins/ragents.orchestration/ragents-plugin.json +6 -0
- package/plugins/ragents.orchestration/server/index.ts +13 -16
- package/plugins/ragents.orchestration/server/run-stop-tool.ts +4 -4
- package/plugins/ragents.orchestration/server/{canvas-tool.ts → surface-tool.ts} +42 -43
- package/plugins/ragents.orchestration/surface.hbs +34 -0
- package/plugins/ragents.orchestration/tiled-layout.ts +16 -16
- package/plugins/ragents.orchestration/web/ActorChat.tsx +16 -14
- package/plugins/ragents.orchestration/web/ActorChatControls.tsx +23 -26
- package/plugins/ragents.orchestration/web/ActorChatPreview.tsx +5 -6
- package/plugins/ragents.orchestration/web/ActorPopout.tsx +7 -5
- package/plugins/ragents.orchestration/web/ActorShortcut.tsx +16 -16
- package/plugins/ragents.orchestration/web/{ActorCanvasControls.tsx → ActorSurfaceControls.tsx} +23 -28
- package/plugins/ragents.orchestration/web/ActorTile.tsx +2 -2
- package/plugins/ragents.orchestration/web/Center.tsx +47 -55
- package/plugins/ragents.orchestration/web/DocumentsSection.tsx +4 -4
- package/plugins/ragents.orchestration/web/ExecutionsPanel.tsx +7 -7
- package/plugins/ragents.orchestration/web/FlowInspector.tsx +24 -42
- package/plugins/ragents.orchestration/web/JournalStatus.tsx +8 -8
- package/plugins/ragents.orchestration/web/MaterialBody.tsx +5 -5
- package/plugins/ragents.orchestration/web/StopRunButton.tsx +6 -6
- package/plugins/ragents.orchestration/web/SurfaceStartup.tsx +8 -0
- package/plugins/ragents.orchestration/web/{CanvasTiles.tsx → SurfaceTiles.tsx} +18 -18
- package/plugins/ragents.orchestration/web/{TiledCanvas.tsx → TiledSurface.tsx} +22 -22
- package/plugins/ragents.orchestration/web/actor-header-settings.ts +2 -2
- package/plugins/ragents.orchestration/web/api.ts +4 -10
- package/plugins/ragents.orchestration/web/constants.ts +0 -1
- package/plugins/ragents.orchestration/web/executions.ts +3 -3
- package/plugins/ragents.orchestration/web/index.tsx +19 -124
- package/plugins/ragents.orchestration/web/program-slot.ts +14 -0
- package/plugins/ragents.orchestration/web/run-panel/AddresseeControl.tsx +95 -0
- package/plugins/ragents.orchestration/web/run-panel/AddresseeTree.tsx +109 -0
- package/plugins/ragents.orchestration/web/{column/RunColumn.tsx → run-panel/RunPanel.tsx} +211 -83
- package/plugins/ragents.orchestration/web/{column/ColumnSettings.tsx → run-panel/RunPanelSettings.tsx} +13 -13
- package/plugins/ragents.orchestration/web/run-panel/addressee-tree.ts +165 -0
- package/plugins/ragents.orchestration/web/{column/column-actors.ts → run-panel/run-panel-actors.ts} +14 -13
- package/plugins/ragents.orchestration/web/run-panel/run-panel-settings.ts +47 -0
- package/plugins/ragents.orchestration/web/run-panel/run-panel-startup.ts +30 -0
- package/plugins/ragents.orchestration/web/run-panel/run-panel-state.ts +71 -0
- package/plugins/ragents.orchestration/web/{column → run-panel}/sheet-status.ts +4 -4
- package/plugins/ragents.orchestration/web/{canvas-stage.ts → surface-entities.ts} +2 -2
- package/plugins/ragents.orchestration/web/{canvas-startup.ts → surface-startup.ts} +7 -10
- package/plugins/ragents.orchestration/web/surface-view-settings.ts +42 -0
- package/plugins/ragents.orchestration/web/tile-docking.ts +14 -14
- package/plugins/ragents.orchestration/web/tiled-view-settings.ts +26 -26
- package/plugins/ragents.overseer/contract.ts +20 -14
- package/plugins/ragents.overseer/ragents-plugin.json +3 -0
- package/plugins/ragents.overseer/server/api.ts +34 -23
- package/plugins/ragents.overseer/server/coordinator-prompt.ts +3 -3
- package/plugins/ragents.overseer/server/coordinator.ts +19 -0
- package/plugins/ragents.overseer/server/index.ts +39 -27
- package/plugins/ragents.overseer/server/orientation.ts +4 -5
- package/plugins/ragents.overseer/server/quick-answer.ts +5 -4
- package/plugins/ragents.overseer/server/reset-method.ts +4 -3
- package/plugins/ragents.overseer/server/run-directory.ts +5 -5
- package/plugins/ragents.overseer/server/settings-method.ts +1 -1
- package/plugins/ragents.overseer/server/settings.ts +6 -6
- package/plugins/ragents.overseer/server/user-location.ts +20 -19
- package/plugins/ragents.overseer/web/ModelSettings.tsx +4 -4
- package/plugins/ragents.overseer/web/chat-display.ts +1 -1
- package/plugins/ragents.overseer/web/index.tsx +51 -26
- 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/ragents-plugin.json +3 -0
- package/plugins/ragents.processes/server/index.ts +13 -19
- package/plugins/ragents.processes/server/methods.ts +18 -20
- package/plugins/ragents.processes/server/observer.ts +64 -104
- package/plugins/ragents.processes/server/run-processes.ts +24 -0
- package/plugins/ragents.processes/web/ProcessHeader.tsx +13 -16
- package/plugins/ragents.processes/web/index.tsx +2 -1
- package/plugins/ragents.processes/web/processes.ts +1 -1
- package/plugins/ragents.product/ragents-plugin.json +3 -0
- package/plugins/ragents.product/server/config.ts +12 -13
- package/plugins/ragents.product/server/index.ts +15 -16
- package/plugins/ragents.product/server/runtime.ts +2 -2
- package/plugins/ragents.product/web/index.tsx +3 -3
- package/plugins/ragents.profile-distribution/contract.ts +6 -9
- package/plugins/ragents.profile-distribution/ragents-plugin.json +3 -0
- package/plugins/ragents.profile-distribution/server/archive.ts +26 -51
- package/plugins/ragents.profile-distribution/server/config.ts +2 -2
- package/plugins/ragents.profile-distribution/server/index.ts +9 -16
- package/plugins/ragents.reference/examples.ts +1 -1
- package/plugins/ragents.reference/ragents-plugin.json +3 -0
- package/plugins/ragents.reference/run-scripts/balcony-wizard/RUN.md +2 -2
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +1 -1
- package/plugins/ragents.reference/run-scripts/balcony-wizard/src/server.ts +1 -1
- package/plugins/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +4 -4
- package/plugins/ragents.reference/run-scripts/conversation-circle/RUN.md +1 -1
- package/plugins/ragents.reference/run-scripts/conversation-circle/src/server.ts +1 -1
- package/plugins/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/RUN.md +2 -2
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/client.tsx +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/server.ts +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/state.ts +2 -2
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/view.tsx +11 -11
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/workflow.ts +15 -15
- package/plugins/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +3 -8
- package/plugins/ragents.reference/run-scripts/moderated-round/src/server.ts +1 -1
- 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 +2 -2
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/client.tsx +6 -6
- package/plugins/ragents.reference/run-scripts/shared-actor-list/src/server.ts +3 -3
- package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/word-game/RUN.md +1 -1
- package/plugins/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
- package/plugins/ragents.reference/run-scripts/word-game/src/server.ts +1 -2
- package/plugins/ragents.reference/run-scripts/word-game/src/state.ts +6 -6
- package/plugins/ragents.reference/run-scripts/word-game/src/view.tsx +14 -14
- package/plugins/ragents.reference/run-scripts/word-game/tests/program.test.ts +4 -5
- package/plugins/ragents.reference/server/index.ts +2 -2
- package/plugins/ragents.reference/skills/160-learning-companion/SKILL.md +1 -1
- package/plugins/ragents.reference/skills/240-live-result-list/SKILL.md +1 -1
- package/plugins/ragents.reference/skills/250-balcony-wizard/SKILL.md +1 -1
- package/plugins/ragents.reference/skills/90-actor-notes/SKILL.md +1 -1
- package/plugins/ragents.reference/skills/95-hello-world/SKILL.md +2 -2
- package/plugins/ragents.reference/skills/decision-brief/SKILL.md +2 -2
- package/plugins/ragents.reference/walkthroughs.ts +26 -26
- package/plugins/ragents.reference/web/StartGuides.tsx +2 -2
- package/plugins/ragents.reference/web/index.tsx +1 -1
- package/plugins/ragents.todo/ragents-plugin.json +3 -0
- package/plugins/ragents.todo/server/index.ts +2 -2
- package/plugins/ragents.todo/server/todo-tool.ts +4 -5
- package/plugins/ragents.todo/server/tool-contributor.ts +2 -2
- package/plugins/ragents.todo/web/TodoSection.tsx +3 -3
- package/plugins/ragents.todo/web/index.ts +1 -1
- package/plugins/ragents.transcript/ragents-plugin.json +3 -0
- package/plugins/ragents.transcript/server/index.ts +4 -4
- package/plugins/ragents.transcript/server/transcript.ts +2 -3
- package/plugins/ragents.watch/ragents-plugin.json +6 -0
- package/plugins/ragents.watch/server/condition.ts +2 -2
- package/plugins/ragents.watch/server/contract.ts +1 -1
- package/plugins/ragents.watch/server/functions.ts +3 -3
- package/plugins/ragents.watch/server/index.ts +3 -3
- package/plugins/ragents.watch/server/observation.ts +6 -6
- package/plugins/ragents.watch/server/service.ts +5 -5
- package/plugins/ragents.workspace/client/workspace-client.ts +129 -58
- package/plugins/ragents.workspace/contract.ts +98 -35
- package/plugins/ragents.workspace/prompt.hbs +1 -8
- package/plugins/ragents.workspace/ragents-plugin.json +3 -0
- package/plugins/ragents.workspace/server/binding.ts +122 -39
- package/plugins/ragents.workspace/server/browse-route.ts +96 -103
- package/plugins/ragents.workspace/server/clients.ts +236 -68
- package/plugins/ragents.workspace/server/config.ts +30 -0
- package/plugins/ragents.workspace/server/index.ts +61 -26
- package/plugins/ragents.workspace/server/runtime.ts +271 -46
- package/{apps/server/src/plugin-support → plugins/ragents.workspace/server}/shell-platform.ts +3 -5
- package/{apps/server/src/plugin-support → plugins/ragents.workspace/server}/workspace-tool-naming.ts +7 -1
- package/plugins/ragents.workspace/web/FileBrowser.tsx +11 -8
- package/plugins/ragents.workspace/web/WorkspaceBinding.tsx +115 -61
- package/plugins/ragents.workspace/web/api.ts +1 -1
- package/plugins/ragents.workspace/web/index.tsx +1 -1
- package/ragents.config.core.ts +2 -8
- package/ragents.config.showcase.ts +61 -0
- package/scripts/agent/agent-cli.ts +265 -107
- package/scripts/agent/journal.ts +3 -1
- package/scripts/agent/turn-control.ts +19 -0
- package/scripts/package/build-package.ts +70 -15
- package/scripts/package/ragents.mjs +4 -2
- package/scripts/plugin/build-builtin-plugins.ts +52 -0
- package/scripts/plugin/plugin-cli.ts +99 -0
- package/scripts/provision/run-provision.ts +20 -18
- package/scripts/remote/connect.ts +75 -53
- package/scripts/remote/start.ts +3 -4
- package/scripts/workspace-client/run-workspace-client.ts +15 -9
- package/apps/server/agent-home/settings.json +0 -3
- package/apps/server/src/chat-attachments.ts +0 -52
- package/apps/server/src/chat-events.ts +0 -185
- package/apps/server/src/plugin-support/asset-path.ts +0 -4
- package/apps/server/src/profile/plugin-list.ts +0 -19
- package/apps/server/src/web-build.ts +0 -82
- package/apps/web/column.html +0 -12
- package/apps/web/index.html +0 -12
- package/apps/web/src/StartSurface.tsx +0 -161
- package/apps/web/src/chat/ChatInputToolbar.tsx +0 -488
- package/apps/web/src/chat/ChatMessages.tsx +0 -666
- package/apps/web/src/chat/ChatPanel.tsx +0 -61
- package/apps/web/src/chat/DetailModeSwitch.tsx +0 -58
- package/apps/web/src/chat/Markdown.tsx +0 -104
- package/apps/web/src/chat/StepPopover.tsx +0 -82
- package/apps/web/src/chat/WorkingScenes.tsx +0 -235
- package/apps/web/src/chat/attachments.ts +0 -53
- package/apps/web/src/chat/chat-scroll.ts +0 -41
- package/apps/web/src/chat/texts.ts +0 -61
- package/apps/web/src/chat/types.ts +0 -26
- package/apps/web/src/column/ColumnApp.tsx +0 -234
- package/apps/web/src/column/column-location.ts +0 -30
- package/apps/web/src/column/host-contract.ts +0 -93
- package/apps/web/src/panel/OverviewPage.tsx +0 -215
- package/apps/web/src/panel/SettingsPage.tsx +0 -98
- package/apps/web/src/panel/target-state.ts +0 -78
- package/apps/web/src/plugin-discovery.ts +0 -5
- package/apps/web/src/virtual-plugins.d.ts +0 -3
- package/apps/web/vite.config.ts +0 -140
- package/packages/agent/src/config.ts +0 -161
- package/packages/agent/src/core/auth-storage.ts +0 -271
- package/packages/agent/src/core/bash-executor.ts +0 -156
- package/packages/agent/src/core/compaction/branch-summarization.ts +0 -372
- package/packages/agent/src/core/diagnostics.ts +0 -15
- package/packages/agent/src/core/event-bus.ts +0 -33
- package/packages/agent/src/core/exec.ts +0 -107
- package/packages/agent/src/core/experimental.ts +0 -3
- package/packages/agent/src/core/footer-data-provider.ts +0 -388
- package/packages/agent/src/core/http-dispatcher.ts +0 -106
- package/packages/agent/src/core/index.ts +0 -78
- package/packages/agent/src/core/model-config.ts +0 -287
- package/packages/agent/src/core/model-registry.ts +0 -126
- package/packages/agent/src/core/model-resolver.ts +0 -675
- package/packages/agent/src/core/output-guard.ts +0 -108
- package/packages/agent/src/core/package-manager.ts +0 -2441
- package/packages/agent/src/core/prompt-templates.ts +0 -284
- package/packages/agent/src/core/resolve-config-value.ts +0 -287
- package/packages/agent/src/core/runtime-credentials.ts +0 -48
- package/packages/agent/src/core/session-cwd.ts +0 -59
- package/packages/agent/src/core/settings-manager.ts +0 -1212
- package/packages/agent/src/core/slash-commands.ts +0 -41
- package/packages/agent/src/core/timings.ts +0 -50
- package/packages/agent/src/core/tools/tool-definition-wrapper.ts +0 -45
- package/packages/agent/src/core/trust-manager.ts +0 -244
- package/packages/agent/src/utils/ansi.ts +0 -60
- package/packages/agent/src/utils/fs-watch.ts +0 -30
- package/packages/agent/src/utils/git.ts +0 -226
- package/packages/agent/src/utils/json.ts +0 -6
- package/packages/agent/src/utils/tools-manager.ts +0 -63
- package/packages/agent-core/package.json +0 -32
- package/packages/ai/src/api/openrouter-images.lazy.ts +0 -10
- package/packages/ai/src/api/openrouter-images.ts +0 -98
- package/packages/ai/src/auth/credential-store.ts +0 -51
- package/packages/ai/src/compat/extension-oauth-types.ts +0 -45
- package/packages/ai/src/image-models.generated.ts +0 -533
- package/packages/ai/src/images-models.ts +0 -274
- package/packages/ai/src/models-store.ts +0 -38
- package/packages/ai/src/oauth.ts +0 -10
- package/packages/ai/src/providers/openrouter-images.ts +0 -14
- package/packages/ai/src/session-resources.ts +0 -24
- package/packages/ai/src/utils/abort-signals.ts +0 -41
- package/packages/ai/src/utils/deferred-tools.ts +0 -39
- package/packages/ai/src/utils/hash.ts +0 -13
- package/packages/ai/src/utils/node-http-proxy.ts +0 -112
- package/plugins/ragents.actor-programs/server/client-runtime.ts +0 -16
- package/plugins/ragents.ask/web/constants.ts +0 -1
- package/plugins/ragents.lsp-roslyn/web/api.ts +0 -10
- package/plugins/ragents.orchestration/web/CanvasStartup.tsx +0 -14
- package/plugins/ragents.orchestration/web/canvas-view-settings.ts +0 -42
- package/plugins/ragents.orchestration/web/column/AddresseeControl.tsx +0 -116
- package/plugins/ragents.orchestration/web/column/column-settings.ts +0 -47
- package/plugins/ragents.orchestration/web/column/column-state.ts +0 -68
- package/plugins/ragents.orchestration/web/contract.ts +0 -25
- package/plugins/ragents.product/model-settings-contract.ts +0 -10
- package/plugins/ragents.profile-distribution/server/web.ts +0 -24
- /package/{plugins/ragents.actor-programs/server → apps/server/src/plugin-support/actor-programs}/authoring-contracts.ts +0 -0
- /package/{plugins/ragents.actor-programs/server → apps/server/src/plugin-support/actor-programs}/runtime-libraries.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/server/src/plugin-support/actor-programs}/workflow/prompt-reader.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/file-contracts.d.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/flow-diagram-contracts.d.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/flow-diagram.css +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/form-contracts.d.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/frame-layout.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/table-contracts.d.ts +0 -0
- /package/{plugins/ragents.actor-programs → apps/web/src/actor-programs}/client-ui/viewer-contracts.d.ts +0 -0
- /package/{plugins/ragents.orchestration/canvas.hbs → bundles/ragents.orchestration/surface.hbs} +0 -0
- /package/packages/{agent-core/src → agent/src/loop}/index.ts +0 -0
- /package/packages/{agent-core/src → agent/src/loop}/uuid.ts +0 -0
|
@@ -0,0 +1,1049 @@
|
|
|
1
|
+
import { createRequire as __ragentsCreateRequire } from "node:module";
|
|
2
|
+
const require = __ragentsCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// server/index.ts
|
|
5
|
+
import path3 from "node:path";
|
|
6
|
+
import { DomainError as DomainError4 } from "@ragents/engine";
|
|
7
|
+
import { documentStoreToken } from "@ragents/host/ragents/document-store.js";
|
|
8
|
+
import { workspaceResolverToken, workspaceRuntimeToken } from "@ragents/host/ragents/workspace-runtime.js";
|
|
9
|
+
import { sandboxServicesToken } from "@ragents/host/plugin-support/workspace-sandbox-host.js";
|
|
10
|
+
import {
|
|
11
|
+
hostAddressToken,
|
|
12
|
+
runtimeProviderToken,
|
|
13
|
+
runGuardToken,
|
|
14
|
+
runWorkspaceProviderToken,
|
|
15
|
+
workspaceGuardToken
|
|
16
|
+
} from "@ragents/host/ragents/host-services.js";
|
|
17
|
+
import { pluginAsset } from "@ragents/host/plugin-support/plugin-folder.js";
|
|
18
|
+
import { ServerProcessSandbox } from "@ragents/host/plugin-support/process-sandbox.js";
|
|
19
|
+
import { boundToTools as boundToTools2, handlebarsPrompt } from "@ragents/host/plugin-support/prompt.js";
|
|
20
|
+
|
|
21
|
+
// server/shell-platform.ts
|
|
22
|
+
import { shellPlatformText } from "@ragents/workspace-executor";
|
|
23
|
+
import { boundToTools } from "@ragents/host/plugin-support/prompt.js";
|
|
24
|
+
var shellPlatformChapter = (platform) => `## Shell platform
|
|
25
|
+
|
|
26
|
+
${shellPlatformText(platform)}`;
|
|
27
|
+
var shellPlatformPrompt = (id, order, chapterFor) => boundToTools({
|
|
28
|
+
id,
|
|
29
|
+
order,
|
|
30
|
+
delivery: "initial",
|
|
31
|
+
render: () => shellPlatformChapter(process.platform),
|
|
32
|
+
...chapterFor ? { renderForRun: chapterFor } : {}
|
|
33
|
+
}, "bash");
|
|
34
|
+
|
|
35
|
+
// server/workspace-tool-naming.ts
|
|
36
|
+
var workspaceToolTable = {
|
|
37
|
+
manual: { read: [], write: [], execute: [] },
|
|
38
|
+
script: { read: [], write: [], execute: [] },
|
|
39
|
+
agent: { read: ["read"], write: ["edit", "write"], execute: ["bash"] }
|
|
40
|
+
};
|
|
41
|
+
var sandboxToolNaming = {
|
|
42
|
+
agentToolNames: (driver) => workspaceToolTable[driver]
|
|
43
|
+
};
|
|
44
|
+
var agentWorkspaceToolNames = [
|
|
45
|
+
...workspaceToolTable.agent.read,
|
|
46
|
+
...workspaceToolTable.agent.write,
|
|
47
|
+
...workspaceToolTable.agent.execute
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
// server/index.ts
|
|
51
|
+
import { startOptionScope } from "@ragents/host/ragents/start-option-state.js";
|
|
52
|
+
|
|
53
|
+
// contract.ts
|
|
54
|
+
import { Type } from "typebox";
|
|
55
|
+
import { openJson } from "@ragents/engine/src/http/contracts";
|
|
56
|
+
import { defineChannel, defineOperation } from "@ragents/engine/src/rpc/contract";
|
|
57
|
+
var WORKSPACE_BINDING_OPTION_ID = "ragents.workspace.binding";
|
|
58
|
+
var WORKSPACE_METADATA_ID = "ragents.workspace";
|
|
59
|
+
var freshServerBinding = () => ({ machine: "server", folder: "fresh" });
|
|
60
|
+
var WORKSPACE_CLIENT_ID_PATTERN = /^[A-Za-z0-9_-]{8,64}$/;
|
|
61
|
+
var clientId = Type.String({ pattern: "^[A-Za-z0-9_-]{8,64}$", description: "Stabile Kennung des Arbeitsplatzes" });
|
|
62
|
+
var executorVersion = Type.String({ minLength: 1, maxLength: 64, description: "Stand des Executors, den der Arbeitsplatz mitbringt" });
|
|
63
|
+
var clientDescription = {
|
|
64
|
+
label: Type.String({ minLength: 1, maxLength: 120 }),
|
|
65
|
+
hostname: Type.String({ minLength: 1 }),
|
|
66
|
+
platform: Type.String({ minLength: 1 }),
|
|
67
|
+
folders: Type.Array(Type.String({ minLength: 1 }), { maxItems: 32 }),
|
|
68
|
+
runsDirectory: Type.String({ minLength: 1, description: "Absoluter Ordner, unter dem der Arbeitsplatz die neuen Ordner je Run anlegt" })
|
|
69
|
+
};
|
|
70
|
+
var clientInfoSchema = Type.Object({
|
|
71
|
+
id: Type.String(),
|
|
72
|
+
...clientDescription
|
|
73
|
+
}, { additionalProperties: false });
|
|
74
|
+
var absolutePath = Type.String({ minLength: 1, description: "Absoluter Pfad im gebundenen Ordner" });
|
|
75
|
+
var WORKSPACE_CLIENT_STOP_OPERATION = "stop";
|
|
76
|
+
var workspaceClientContracts = {
|
|
77
|
+
execute: defineOperation({
|
|
78
|
+
id: "ragents.workspace.client.execute",
|
|
79
|
+
description: "Eine Operation des Executors auf dem Arbeitsplatz ausf\xFChren, etwa ein Werkzeug, eine Dateiabfrage oder die Prozessanzeige; das Ergebnis ist ihr Wert, Fortschritt ihr JSON-Wert. stop gibt frei, was der Arbeitsplatz f\xFCr den Run h\xE4lt.",
|
|
80
|
+
implementedBy: "client",
|
|
81
|
+
input: Type.Object({
|
|
82
|
+
runId: Type.String({ minLength: 1, maxLength: 64, description: "Kennung des Runs" }),
|
|
83
|
+
operation: Type.String({ minLength: 1, maxLength: 64, description: "Name der Operation, etwa read, bash, roslyn_open, files.list oder stop" }),
|
|
84
|
+
toolCallId: Type.Optional(Type.String({ minLength: 1, maxLength: 200, description: "Nur bei einem Werkzeugaufruf des Modells" })),
|
|
85
|
+
cwd: absolutePath,
|
|
86
|
+
env: Type.Record(Type.String(), Type.String(), { description: "Was der Server beitr\xE4gt: Run-Marker und Git-Regeln der Sandbox" }),
|
|
87
|
+
input: Type.Unknown({ description: "Die Eingabe der Operation" })
|
|
88
|
+
}, { additionalProperties: false }),
|
|
89
|
+
result: Type.Object({ value: Type.Unknown() }, { additionalProperties: false })
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
var browseTarget = {
|
|
93
|
+
runId: Type.String({ minLength: 1, maxLength: 64, description: "Kennung des Runs" }),
|
|
94
|
+
root: Type.Union([Type.Literal("workspace"), Type.Literal("files")]),
|
|
95
|
+
path: Type.String({ description: "Pfad unterhalb der Wurzel; leer ist die Wurzel selbst" })
|
|
96
|
+
};
|
|
97
|
+
var workspaceContracts = {
|
|
98
|
+
browse: {
|
|
99
|
+
list: defineOperation({
|
|
100
|
+
id: "ragents.workspace.browse.list",
|
|
101
|
+
description: "Ein Verzeichnis im Arbeitsverzeichnis oder in der Dateiablage eines Runs auflisten.",
|
|
102
|
+
rights: ["runs.read", "runs.inspect"],
|
|
103
|
+
input: Type.Object(browseTarget, { additionalProperties: false }),
|
|
104
|
+
result: openJson("BrowseListing")
|
|
105
|
+
}),
|
|
106
|
+
preview: defineOperation({
|
|
107
|
+
id: "ragents.workspace.browse.preview",
|
|
108
|
+
description: "Eine Datei als Text vorschauen; zu gro\xDFe und bin\xE4re Dateien nennen stattdessen den Grund.",
|
|
109
|
+
rights: ["runs.read", "runs.inspect"],
|
|
110
|
+
input: Type.Object(browseTarget, { additionalProperties: false }),
|
|
111
|
+
result: openJson("BrowsePreview")
|
|
112
|
+
})
|
|
113
|
+
},
|
|
114
|
+
channels: {
|
|
115
|
+
browse: defineChannel({
|
|
116
|
+
id: "ragents.workspace.browse",
|
|
117
|
+
description: "Meldet jede \xC4nderung unterhalb der beobachteten Wurzel eines Runs.",
|
|
118
|
+
rights: ["runs.read", "runs.inspect"],
|
|
119
|
+
params: Type.Object({ runId: browseTarget.runId, root: browseTarget.root }, { additionalProperties: false }),
|
|
120
|
+
message: Type.Object({ changed: Type.Literal(true) }, { additionalProperties: false })
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
clients: {
|
|
124
|
+
list: defineOperation({
|
|
125
|
+
id: "ragents.workspace.clients.list",
|
|
126
|
+
description: "Die angemeldeten Arbeitspl\xE4tze des Aufrufers; fremde erscheinen auch mit runs.read.all nicht.",
|
|
127
|
+
rights: ["runs.read"],
|
|
128
|
+
input: Type.Object({}, { additionalProperties: false }),
|
|
129
|
+
result: Type.Array(clientInfoSchema)
|
|
130
|
+
}),
|
|
131
|
+
register: defineOperation({
|
|
132
|
+
id: "ragents.workspace.clients.register",
|
|
133
|
+
description: "Einen Arbeitsplatz anmelden oder seine Ordner erneuern; die Verbindung dieser Anfrage wird sein R\xFCckweg und braucht einen Ereignisstrom.",
|
|
134
|
+
rights: ["runs.write"],
|
|
135
|
+
input: Type.Object({ id: clientId, ...clientDescription, executor: executorVersion }, { additionalProperties: false }),
|
|
136
|
+
result: clientInfoSchema
|
|
137
|
+
}),
|
|
138
|
+
unregister: defineOperation({
|
|
139
|
+
id: "ragents.workspace.clients.unregister",
|
|
140
|
+
description: "Einen eigenen Arbeitsplatz abmelden; offene Auftr\xE4ge scheitern.",
|
|
141
|
+
rights: ["runs.write"],
|
|
142
|
+
input: Type.Object({ id: clientId }, { additionalProperties: false }),
|
|
143
|
+
result: Type.Null()
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
148
|
+
var hasExactly = (value, keys) => Object.keys(value).length === keys.length && keys.every((key) => Object.hasOwn(value, key));
|
|
149
|
+
var isMachine = (value) => value === "server" || isRecord(value) && hasExactly(value, ["client", "label"]) && typeof value.client === "string" && WORKSPACE_CLIENT_ID_PATTERN.test(value.client) && typeof value.label === "string";
|
|
150
|
+
var isFolder = (value) => {
|
|
151
|
+
if (value === "fresh") return true;
|
|
152
|
+
if (!isRecord(value) || typeof value.path !== "string" || value.path.length === 0) return false;
|
|
153
|
+
return hasExactly(value, ["path"]) || hasExactly(value, ["path", "fresh"]) && value.fresh === true;
|
|
154
|
+
};
|
|
155
|
+
var isWorkspaceBinding = (value) => isRecord(value) && hasExactly(value, ["machine", "folder"]) && isMachine(value.machine) && isFolder(value.folder) && !(value.machine === "server" && typeof value.folder === "object" && "fresh" in value.folder);
|
|
156
|
+
var isFreshFolder = (folder) => folder === "fresh" || "fresh" in folder;
|
|
157
|
+
var fromKind = (value) => {
|
|
158
|
+
switch (value.kind) {
|
|
159
|
+
case "fresh":
|
|
160
|
+
return hasExactly(value, ["kind"]) ? freshServerBinding() : void 0;
|
|
161
|
+
case "path":
|
|
162
|
+
return hasExactly(value, ["kind", "path"]) ? { machine: "server", folder: { path: value.path } } : void 0;
|
|
163
|
+
case "client":
|
|
164
|
+
return hasExactly(value, ["kind", "client", "label", "path"]) ? { machine: { client: value.client, label: value.label }, folder: { path: value.path } } : void 0;
|
|
165
|
+
default:
|
|
166
|
+
return void 0;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
var storedWorkspaceBinding = (value) => {
|
|
170
|
+
if (isWorkspaceBinding(value)) return value;
|
|
171
|
+
const mapped = isRecord(value) && Object.hasOwn(value, "kind") ? fromKind(value) : void 0;
|
|
172
|
+
return isWorkspaceBinding(mapped) ? mapped : void 0;
|
|
173
|
+
};
|
|
174
|
+
var FRESH_WORKSPACE_LABEL = "Leerer Ordner je Run";
|
|
175
|
+
var freshLabelOf = (binding, labels) => (binding.machine === "server" ? labels.server : labels.client) ?? FRESH_WORKSPACE_LABEL;
|
|
176
|
+
var workspaceBindingSummary = (binding, labels) => {
|
|
177
|
+
const { machine, folder } = binding;
|
|
178
|
+
const fresh = freshLabelOf(binding, labels);
|
|
179
|
+
const where = folder === "fresh" ? fresh : "fresh" in folder ? `${folder.path} (${fresh})` : folder.path;
|
|
180
|
+
return machine === "server" ? where : `${machine.label}: ${where}`;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// server/binding.ts
|
|
184
|
+
import { statSync } from "node:fs";
|
|
185
|
+
import path from "node:path";
|
|
186
|
+
import { Type as Type2 } from "typebox";
|
|
187
|
+
import { DomainError } from "@ragents/engine";
|
|
188
|
+
import { storedStartOption } from "@ragents/host/ragents/start-option-state.js";
|
|
189
|
+
var machineSchema = Type2.Union([
|
|
190
|
+
Type2.Literal("server"),
|
|
191
|
+
Type2.Object({ client: Type2.String({ minLength: 8, maxLength: 64 }), label: Type2.String() }, { additionalProperties: false })
|
|
192
|
+
]);
|
|
193
|
+
var folderSchema = Type2.Union([
|
|
194
|
+
Type2.Literal("fresh"),
|
|
195
|
+
Type2.Object({ path: Type2.String({ minLength: 1 }), fresh: Type2.Optional(Type2.Literal(true)) }, { additionalProperties: false })
|
|
196
|
+
]);
|
|
197
|
+
var bindingSchema = Type2.Object({ machine: machineSchema, folder: folderSchema }, { additionalProperties: false });
|
|
198
|
+
var insideFolder = (folder, candidate) => {
|
|
199
|
+
const separator = folder.includes("\\") ? "\\" : "/";
|
|
200
|
+
const root = folder.endsWith(separator) ? folder.slice(0, -separator.length) : folder;
|
|
201
|
+
return candidate === root || candidate.startsWith(root + separator);
|
|
202
|
+
};
|
|
203
|
+
var workstationRunFolder = (runsDirectory, runId) => {
|
|
204
|
+
const separator = runsDirectory.includes("\\") ? "\\" : "/";
|
|
205
|
+
const root = runsDirectory.endsWith(separator) ? runsDirectory.slice(0, -separator.length) : runsDirectory;
|
|
206
|
+
return `${root}${separator}${runId}`;
|
|
207
|
+
};
|
|
208
|
+
var bindingOf = (state) => {
|
|
209
|
+
const stored = storedStartOption(state, WORKSPACE_BINDING_OPTION_ID);
|
|
210
|
+
if (stored === void 0) return freshServerBinding();
|
|
211
|
+
const binding = storedWorkspaceBinding(stored);
|
|
212
|
+
if (!binding || binding.machine !== "server" && binding.folder === "fresh") {
|
|
213
|
+
throw new Error(`Die gespeicherte Arbeitsbereich-Bindung ist ung\xFCltig: ${JSON.stringify(stored)}`);
|
|
214
|
+
}
|
|
215
|
+
return binding;
|
|
216
|
+
};
|
|
217
|
+
var isWorkstationBinding = (binding) => binding.machine !== "server" && binding.folder !== "fresh";
|
|
218
|
+
var workspaceOwnerOf = (state) => state?.ownerUserId ?? null;
|
|
219
|
+
var boundServerDirectory = (state) => {
|
|
220
|
+
const { machine, folder } = bindingOf(state);
|
|
221
|
+
return machine === "server" && folder !== "fresh" ? folder.path : null;
|
|
222
|
+
};
|
|
223
|
+
var serverDirectoryFolder = (directory) => {
|
|
224
|
+
if (!path.isAbsolute(directory)) throw new DomainError("workspace-path-relative", "Der Ordner muss ein absoluter Pfad sein.", 400);
|
|
225
|
+
const resolved = path.resolve(directory);
|
|
226
|
+
if (!statSync(resolved, { throwIfNoEntry: false })?.isDirectory()) {
|
|
227
|
+
throw new DomainError("workspace-path-missing", `Der Ordner ${resolved} existiert auf dem Server nicht.`, 400);
|
|
228
|
+
}
|
|
229
|
+
return { path: resolved };
|
|
230
|
+
};
|
|
231
|
+
var executorShellChapter = (registry, owner, binding) => {
|
|
232
|
+
const { machine } = binding;
|
|
233
|
+
if (machine === "server") return shellPlatformChapter(process.platform);
|
|
234
|
+
const client = registry.info(owner, machine.client);
|
|
235
|
+
return client ? shellPlatformChapter(client.platform) : `## Shell platform
|
|
236
|
+
|
|
237
|
+
The workstation ${machine.label} that holds this project is not registered right now, so the platform of its shell is unknown; the workspace tools fail until it connects again.`;
|
|
238
|
+
};
|
|
239
|
+
var workspaceLocation = (binding, location) => binding.machine === "server" ? location : `Arbeitsplatz ${binding.machine.label}: ${location}`;
|
|
240
|
+
var freshLabels = (contribution) => ({
|
|
241
|
+
server: contribution?.kind?.label ?? FRESH_WORKSPACE_LABEL,
|
|
242
|
+
client: contribution ? contribution.workstation?.label ?? null : FRESH_WORKSPACE_LABEL
|
|
243
|
+
});
|
|
244
|
+
var sessionMetadataOf = (state, contribution) => {
|
|
245
|
+
const binding = bindingOf(state);
|
|
246
|
+
return { binding, summary: workspaceBindingSummary(binding, freshLabels(contribution)) };
|
|
247
|
+
};
|
|
248
|
+
var unsupported = (message) => new DomainError("workspace-binding-unsupported", message, 400);
|
|
249
|
+
var workstationBinding = (client, folder, runId, labels) => {
|
|
250
|
+
const machine = { client: client.id, label: client.label };
|
|
251
|
+
if (isFreshFolder(folder)) {
|
|
252
|
+
if (labels.client === null) {
|
|
253
|
+
throw unsupported(`Einen neuen Ordner je Run gibt es hier nur auf dem Server (${labels.server}); w\xE4hle dort einen oder einen vorhandenen Ordner des Arbeitsplatzes.`);
|
|
254
|
+
}
|
|
255
|
+
return { machine, folder: { path: workstationRunFolder(client.runsDirectory, runId), fresh: true } };
|
|
256
|
+
}
|
|
257
|
+
if (!client.folders.some((offered) => insideFolder(offered, folder.path))) {
|
|
258
|
+
throw new DomainError("workspace-client-folder", `Der Arbeitsplatz ${client.label} bietet den Ordner ${folder.path} nicht an.`, 400);
|
|
259
|
+
}
|
|
260
|
+
return { machine, folder: { path: folder.path } };
|
|
261
|
+
};
|
|
262
|
+
var workspaceBindingOption = (registry, contribution) => ({
|
|
263
|
+
id: WORKSPACE_BINDING_OPTION_ID,
|
|
264
|
+
schema: bindingSchema,
|
|
265
|
+
selectable: () => true,
|
|
266
|
+
defaultValue: () => freshServerBinding(),
|
|
267
|
+
accept: (value, { runId, userId }) => {
|
|
268
|
+
if (!isWorkspaceBinding(value)) throw new DomainError("workspace-binding-invalid", "Die Arbeitsbereich-Bindung hat kein g\xFCltiges Format.", 400);
|
|
269
|
+
const labels = freshLabels(contribution());
|
|
270
|
+
const { machine, folder } = value;
|
|
271
|
+
if (machine === "server") {
|
|
272
|
+
if (folder === "fresh") return freshServerBinding();
|
|
273
|
+
if ("fresh" in folder) throw new DomainError("workspace-binding-invalid", "Einen neuen Ordner je Run legt auf dem Server der Host an; er hat keinen gew\xE4hlten Pfad.", 400);
|
|
274
|
+
if (!(contribution()?.kind?.serverFolders ?? true)) {
|
|
275
|
+
throw unsupported(`Ein vorhandener Ordner auf dem Serverrechner ist hier keine Bindung; w\xE4hle ${labels.server} oder einen Arbeitsplatz.`);
|
|
276
|
+
}
|
|
277
|
+
return { machine, folder: serverDirectoryFolder(folder.path) };
|
|
278
|
+
}
|
|
279
|
+
const client = registry.info(userId, machine.client);
|
|
280
|
+
if (!client) throw new DomainError("workspace-client-disconnected", `Der Arbeitsplatz ${machine.label || machine.client} ist nicht verbunden.`, 409);
|
|
281
|
+
return workstationBinding(client, folder, runId, labels);
|
|
282
|
+
},
|
|
283
|
+
describe: (_value, { userId }) => {
|
|
284
|
+
const presentation = {
|
|
285
|
+
kind: "workspace-binding",
|
|
286
|
+
clients: registry.list(userId),
|
|
287
|
+
fresh: freshLabels(contribution()),
|
|
288
|
+
serverFolders: contribution()?.kind?.serverFolders ?? true
|
|
289
|
+
};
|
|
290
|
+
return presentation;
|
|
291
|
+
},
|
|
292
|
+
ownerOnly: (value) => {
|
|
293
|
+
const binding = storedWorkspaceBinding(value);
|
|
294
|
+
return binding !== void 0 && binding.machine !== "server";
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// server/browse-route.ts
|
|
299
|
+
import {
|
|
300
|
+
implement,
|
|
301
|
+
implementChannel
|
|
302
|
+
} from "@ragents/engine";
|
|
303
|
+
import {
|
|
304
|
+
FILE_OPERATIONS,
|
|
305
|
+
listDirectory,
|
|
306
|
+
readTextFile,
|
|
307
|
+
watchDirectory
|
|
308
|
+
} from "@ragents/workspace-executor";
|
|
309
|
+
import { withDomainCause } from "@ragents/host/plugin-support/workspace-sandbox-host.js";
|
|
310
|
+
var onServer = async (operation) => {
|
|
311
|
+
try {
|
|
312
|
+
return await operation();
|
|
313
|
+
} catch (error) {
|
|
314
|
+
throw withDomainCause(error);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
var listingOf = async (options, runId, root, target) => {
|
|
318
|
+
if (root === "files") {
|
|
319
|
+
const listing2 = await onServer(async () => listDirectory(await options.documentsFor(runId), target));
|
|
320
|
+
return { root, ...listing2 };
|
|
321
|
+
}
|
|
322
|
+
const listing = await options.execute(runId, FILE_OPERATIONS.list, { path: target });
|
|
323
|
+
return { root, ...listing, location: options.locationOf(runId, listing.location) };
|
|
324
|
+
};
|
|
325
|
+
var previewOf = async (options, runId, root, target) => {
|
|
326
|
+
const text = root === "files" ? await onServer(async () => readTextFile(await options.documentsFor(runId), target)) : await options.execute(runId, FILE_OPERATIONS.read, { path: target });
|
|
327
|
+
return { root, ...text };
|
|
328
|
+
};
|
|
329
|
+
var ensureRoot = (options, access, runId, root) => {
|
|
330
|
+
if (root === "workspace") options.ensureWorkspaceAccess(access, runId);
|
|
331
|
+
else options.ensureSession(runId);
|
|
332
|
+
};
|
|
333
|
+
var createBrowseMethods = (options) => [
|
|
334
|
+
implement(workspaceContracts.browse.list, ({ runId, root, path: target }, { access }) => {
|
|
335
|
+
ensureRoot(options, access, runId, root);
|
|
336
|
+
return listingOf(options, runId, root, target);
|
|
337
|
+
}),
|
|
338
|
+
implement(workspaceContracts.browse.preview, ({ runId, root, path: target }, { access }) => {
|
|
339
|
+
ensureRoot(options, access, runId, root);
|
|
340
|
+
return previewOf(options, runId, root, target);
|
|
341
|
+
})
|
|
342
|
+
];
|
|
343
|
+
var WATCH_RETRY_MS = 5e3;
|
|
344
|
+
var watchWorkspace = (options, runId, changed) => new Promise((ready, failed) => {
|
|
345
|
+
const controller = new AbortController();
|
|
346
|
+
let opened = false;
|
|
347
|
+
let retry;
|
|
348
|
+
const stop = () => {
|
|
349
|
+
controller.abort();
|
|
350
|
+
clearTimeout(retry);
|
|
351
|
+
};
|
|
352
|
+
const start = () => {
|
|
353
|
+
let watching = false;
|
|
354
|
+
const ended = (error) => {
|
|
355
|
+
if (controller.signal.aborted) return;
|
|
356
|
+
if (!opened) {
|
|
357
|
+
failed(error ?? new Error("Die Beobachtung des Arbeitsbereichs endete, bevor sie stand"));
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
if (watching) changed();
|
|
361
|
+
retry = setTimeout(start, WATCH_RETRY_MS);
|
|
362
|
+
};
|
|
363
|
+
options.execute(runId, FILE_OPERATIONS.watch, {}, {
|
|
364
|
+
signal: controller.signal,
|
|
365
|
+
untilAborted: true,
|
|
366
|
+
onProgress: (value) => {
|
|
367
|
+
if (value.kind === "changed") changed();
|
|
368
|
+
else if (!watching) {
|
|
369
|
+
watching = true;
|
|
370
|
+
if (opened) changed();
|
|
371
|
+
else {
|
|
372
|
+
opened = true;
|
|
373
|
+
ready(stop);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}).then(() => ended(), ended);
|
|
378
|
+
};
|
|
379
|
+
start();
|
|
380
|
+
});
|
|
381
|
+
var createBrowseChannel = (options) => implementChannel(workspaceContracts.channels.browse, async ({ runId, root }, emit, { access }) => {
|
|
382
|
+
ensureRoot(options, access, runId, root);
|
|
383
|
+
const changed = () => emit({ changed: true });
|
|
384
|
+
if (root === "workspace") return watchWorkspace(options, runId, changed);
|
|
385
|
+
return onServer(async () => watchDirectory(await options.documentsFor(runId), { onChange: changed, onError: changed }));
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// server/clients.ts
|
|
389
|
+
import {
|
|
390
|
+
DomainError as DomainError2,
|
|
391
|
+
RPC_ERROR_CODES,
|
|
392
|
+
RpcError,
|
|
393
|
+
implement as implement2
|
|
394
|
+
} from "@ragents/engine";
|
|
395
|
+
import {
|
|
396
|
+
WORKSPACE_EXECUTOR_VERSION,
|
|
397
|
+
sandboxRunEnvironment
|
|
398
|
+
} from "@ragents/workspace-executor";
|
|
399
|
+
var CLIENT_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
400
|
+
var CLEANUP_TIMEOUT_MS = 1e4;
|
|
401
|
+
var STOP_RETRY_MS = 3e4;
|
|
402
|
+
var ownerOf = (access) => access.user?.id ?? null;
|
|
403
|
+
var timeoutFor = (options) => {
|
|
404
|
+
if (options.untilAborted) return {};
|
|
405
|
+
if (options.whenReachable) return { timeoutMs: CLEANUP_TIMEOUT_MS };
|
|
406
|
+
return { timeoutMs: CLIENT_TIMEOUT_MS + (options.durationMs ?? 0) };
|
|
407
|
+
};
|
|
408
|
+
var disconnected = (label, detail) => new DomainError2("workspace-client-disconnected", `Der Arbeitsplatz ${label} hat die Verbindung verloren: ${detail}`, 409);
|
|
409
|
+
var withClientCause = (cause, label) => {
|
|
410
|
+
if (!(cause instanceof RpcError)) return cause;
|
|
411
|
+
if (cause.code === RPC_ERROR_CODES.connectionClosed) return disconnected(label, cause.message);
|
|
412
|
+
if (cause.code === RPC_ERROR_CODES.timeout) {
|
|
413
|
+
return new DomainError2("workspace-client-timeout", `Der Arbeitsplatz ${label} hat nicht geantwortet: ${cause.message}`, 504);
|
|
414
|
+
}
|
|
415
|
+
if (cause.code === RPC_ERROR_CODES.application && cause.domainCode !== void 0 && cause.status !== void 0) {
|
|
416
|
+
return new DomainError2(cause.domainCode, cause.message, cause.status);
|
|
417
|
+
}
|
|
418
|
+
return cause;
|
|
419
|
+
};
|
|
420
|
+
var unreached = (cause) => cause instanceof DomainError2 && (cause.code === "workspace-client-disconnected" || cause.code === "workspace-client-timeout");
|
|
421
|
+
var messageOf = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
422
|
+
var keyOf = (owner, id) => JSON.stringify([owner, id]);
|
|
423
|
+
var assertMayRegister = (access, local) => {
|
|
424
|
+
if (local || access.enabled && access.user !== null) return;
|
|
425
|
+
throw new DomainError2(
|
|
426
|
+
"workspace-client-login-required",
|
|
427
|
+
"Dieser Server kennt keine Benutzeranmeldung; einen Arbeitsplatz nimmt er deshalb nur \xFCber eine Loopback-Verbindung an (etwa http://127.0.0.1 auf seinem eigenen Rechner). \xDCber das Netz braucht ein Arbeitsplatz ein Profil mit Benutzern.",
|
|
428
|
+
403
|
|
429
|
+
);
|
|
430
|
+
};
|
|
431
|
+
var WorkspaceClientRegistry = class {
|
|
432
|
+
#clients = /* @__PURE__ */ new Map();
|
|
433
|
+
/** Stopps, die den Arbeitsplatz noch nicht erreicht haben, je Arbeitsplatz und Run mit dem Ordner der Bindung. */
|
|
434
|
+
#pendingStops = /* @__PURE__ */ new Map();
|
|
435
|
+
#stopRetries = /* @__PURE__ */ new Map();
|
|
436
|
+
async register(id, description, executor, connection) {
|
|
437
|
+
if (connection.streamless) {
|
|
438
|
+
throw new DomainError2("stream-required", "Die Anmeldung eines Arbeitsplatzes braucht einen Ereignisstrom.", 409);
|
|
439
|
+
}
|
|
440
|
+
if (executor !== WORKSPACE_EXECUTOR_VERSION) {
|
|
441
|
+
throw new DomainError2(
|
|
442
|
+
"workspace-executor-version",
|
|
443
|
+
`Der Arbeitsplatz ${description.label} bringt den Executor ${executor} mit, der Server verlangt ${WORKSPACE_EXECUTOR_VERSION}.`,
|
|
444
|
+
409
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
const owner = connection.userId;
|
|
448
|
+
const key = keyOf(owner, id);
|
|
449
|
+
const previous = this.#clients.get(key);
|
|
450
|
+
previous?.release();
|
|
451
|
+
const info = { ...description, id };
|
|
452
|
+
const renewed = previous?.connection === connection;
|
|
453
|
+
const entry = {
|
|
454
|
+
info,
|
|
455
|
+
owner,
|
|
456
|
+
connection,
|
|
457
|
+
release: connection.onClose(() => this.#disconnected(key, connection)),
|
|
458
|
+
calls: renewed ? previous.calls : /* @__PURE__ */ new Set(),
|
|
459
|
+
stops: renewed ? previous.stops : /* @__PURE__ */ new Map()
|
|
460
|
+
};
|
|
461
|
+
this.#clients.set(key, entry);
|
|
462
|
+
if (previous && !renewed) this.#abandon(previous);
|
|
463
|
+
this.#deliverPendingStops(key);
|
|
464
|
+
return info;
|
|
465
|
+
}
|
|
466
|
+
/** Nur die Verbindung, die den Eintrag hält, meldet ihn ab; eine Abmeldung ohne Eintrag ist nach einer Trennung kein Fehler. */
|
|
467
|
+
unregister(owner, id, connection) {
|
|
468
|
+
const key = keyOf(owner, id);
|
|
469
|
+
const entry = this.#clients.get(key);
|
|
470
|
+
if (entry?.connection !== connection) return;
|
|
471
|
+
this.#remove(key, entry);
|
|
472
|
+
}
|
|
473
|
+
list(owner) {
|
|
474
|
+
return [...this.#clients.values()].filter((entry) => entry.owner === owner).map((entry) => entry.info);
|
|
475
|
+
}
|
|
476
|
+
info(owner, id) {
|
|
477
|
+
return this.#clients.get(keyOf(owner, id))?.info;
|
|
478
|
+
}
|
|
479
|
+
/** Die Runs, deren Stopp diesen Arbeitsplatz noch nicht erreicht hat. */
|
|
480
|
+
pendingStops(owner, id) {
|
|
481
|
+
return this.#pendingRuns(keyOf(owner, id));
|
|
482
|
+
}
|
|
483
|
+
/** Der Executor eines gebundenen Runs: dieselbe Schnittstelle wie im Server, nur über die Verbindung des Arbeitsplatzes seines Besitzers. */
|
|
484
|
+
executorFor(owner, id, label, cwd) {
|
|
485
|
+
const key = keyOf(owner, id);
|
|
486
|
+
const call = async (runId, operation, input, options) => {
|
|
487
|
+
if (options.untilAborted && !options.signal) throw new Error(`Die Operation ${operation} l\xE4uft bis zum Abbruch und braucht daf\xFCr ein Abbruchsignal`);
|
|
488
|
+
if (this.#pendingStops.get(key)?.has(runId)) {
|
|
489
|
+
if (options.whenReachable) return null;
|
|
490
|
+
if (this.#clients.has(key)) await this.#deliverStop(key, runId);
|
|
491
|
+
}
|
|
492
|
+
const entry = this.#clients.get(key);
|
|
493
|
+
if (!entry) {
|
|
494
|
+
if (options.whenReachable) return null;
|
|
495
|
+
throw new DomainError2("workspace-client-disconnected", `Der Arbeitsplatz ${label} ist nicht verbunden.`, 409);
|
|
496
|
+
}
|
|
497
|
+
try {
|
|
498
|
+
return await this.#send(entry, runId, operation, input, cwd, options);
|
|
499
|
+
} catch (cause) {
|
|
500
|
+
if (options.whenReachable && unreached(cause)) return null;
|
|
501
|
+
throw cause;
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
return {
|
|
505
|
+
version: WORKSPACE_EXECUTOR_VERSION,
|
|
506
|
+
execute: (runId, operation, input, options = {}) => call(runId, operation, input, options),
|
|
507
|
+
stopRun: async (runId) => {
|
|
508
|
+
this.#pendingStopsOf(key).set(runId, cwd);
|
|
509
|
+
await this.#deliverStop(key, runId);
|
|
510
|
+
},
|
|
511
|
+
shutdown: async () => void 0
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
shutdown() {
|
|
515
|
+
for (const entry of this.#clients.values()) {
|
|
516
|
+
entry.release();
|
|
517
|
+
this.#abandon(entry);
|
|
518
|
+
}
|
|
519
|
+
this.#clients.clear();
|
|
520
|
+
for (const timer of this.#stopRetries.values()) clearTimeout(timer);
|
|
521
|
+
this.#stopRetries.clear();
|
|
522
|
+
this.#pendingStops.clear();
|
|
523
|
+
}
|
|
524
|
+
/** Ein getrennter Arbeitsplatz verlässt die Registry; eine spätere Anmeldung über eine neue Verbindung bleibt stehen. */
|
|
525
|
+
#disconnected(key, connection) {
|
|
526
|
+
const entry = this.#clients.get(key);
|
|
527
|
+
if (entry?.connection !== connection) return;
|
|
528
|
+
this.#remove(key, entry);
|
|
529
|
+
}
|
|
530
|
+
#remove(key, entry) {
|
|
531
|
+
entry.release();
|
|
532
|
+
this.#clients.delete(key);
|
|
533
|
+
this.#abandon(entry);
|
|
534
|
+
}
|
|
535
|
+
/** Eine Verbindung, die niemand mehr hält, bekommt keine Antworten mehr zugestellt; ihre offenen Aufrufe scheitern sofort. */
|
|
536
|
+
#abandon(entry) {
|
|
537
|
+
for (const controller of entry.calls) controller.abort();
|
|
538
|
+
entry.calls.clear();
|
|
539
|
+
}
|
|
540
|
+
async #send(entry, runId, operation, input, cwd, options) {
|
|
541
|
+
const label = entry.info.label;
|
|
542
|
+
const abandoned = new AbortController();
|
|
543
|
+
entry.calls.add(abandoned);
|
|
544
|
+
const signal = options.signal ? AbortSignal.any([options.signal, abandoned.signal]) : abandoned.signal;
|
|
545
|
+
try {
|
|
546
|
+
const { value } = await Promise.race([
|
|
547
|
+
entry.connection.call(
|
|
548
|
+
workspaceClientContracts.execute,
|
|
549
|
+
{
|
|
550
|
+
runId,
|
|
551
|
+
operation,
|
|
552
|
+
...options.toolCallId ? { toolCallId: options.toolCallId } : {},
|
|
553
|
+
cwd,
|
|
554
|
+
env: sandboxRunEnvironment(runId),
|
|
555
|
+
input
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
signal,
|
|
559
|
+
...timeoutFor(options),
|
|
560
|
+
...options.onProgress ? { onProgress: options.onProgress } : {}
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
new Promise((_settle, fail) => abandoned.signal.addEventListener("abort", () => fail(disconnected(label, "eine neue Verbindung hat die Anmeldung abgel\xF6st")), { once: true }))
|
|
564
|
+
]);
|
|
565
|
+
return value;
|
|
566
|
+
} catch (cause) {
|
|
567
|
+
throw withClientCause(cause, label);
|
|
568
|
+
} finally {
|
|
569
|
+
entry.calls.delete(abandoned);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
#pendingStopsOf(key) {
|
|
573
|
+
const known = this.#pendingStops.get(key);
|
|
574
|
+
if (known) return known;
|
|
575
|
+
const created = /* @__PURE__ */ new Map();
|
|
576
|
+
this.#pendingStops.set(key, created);
|
|
577
|
+
return created;
|
|
578
|
+
}
|
|
579
|
+
/** Stellt einen ausstehenden Stopp zu; erreicht er den Arbeitsplatz nicht, bleibt er ausstehend, und die nächste Anmeldung holt ihn nach. */
|
|
580
|
+
#deliverStop(key, runId) {
|
|
581
|
+
const entry = this.#clients.get(key);
|
|
582
|
+
const cwd = this.#pendingStops.get(key)?.get(runId);
|
|
583
|
+
if (cwd === void 0) return Promise.resolve();
|
|
584
|
+
if (!entry) {
|
|
585
|
+
console.warn(`Der Stopp des Runs ${runId} erreicht seinen Arbeitsplatz erst bei dessen n\xE4chster Anmeldung.`);
|
|
586
|
+
return Promise.resolve();
|
|
587
|
+
}
|
|
588
|
+
const running = entry.stops.get(runId);
|
|
589
|
+
if (running) return running;
|
|
590
|
+
const delivery = this.#send(entry, runId, WORKSPACE_CLIENT_STOP_OPERATION, null, cwd, { whenReachable: true }).then(() => this.#stopDelivered(key, runId, cwd), (cause) => {
|
|
591
|
+
if (!unreached(cause)) {
|
|
592
|
+
this.#stopDelivered(key, runId, cwd);
|
|
593
|
+
throw cause;
|
|
594
|
+
}
|
|
595
|
+
console.warn(`Der Stopp des Runs ${runId} hat den Arbeitsplatz ${entry.info.label} nicht erreicht und bleibt ausstehend: ${messageOf(cause)}`);
|
|
596
|
+
this.#retryStops(key);
|
|
597
|
+
}).finally(() => entry.stops.delete(runId));
|
|
598
|
+
entry.stops.set(runId, delivery);
|
|
599
|
+
return delivery;
|
|
600
|
+
}
|
|
601
|
+
#stopDelivered(key, runId, cwd) {
|
|
602
|
+
const pending = this.#pendingStops.get(key);
|
|
603
|
+
if (pending?.get(runId) === cwd) pending.delete(runId);
|
|
604
|
+
if (pending?.size === 0) this.#pendingStops.delete(key);
|
|
605
|
+
}
|
|
606
|
+
#deliverPendingStops(key) {
|
|
607
|
+
for (const runId of this.#pendingRuns(key)) {
|
|
608
|
+
void this.#deliverStop(key, runId).catch((cause) => console.warn(`Der nachgeholte Stopp des Runs ${runId} ist gescheitert: ${messageOf(cause)}`));
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
#pendingRuns(key) {
|
|
612
|
+
return [...this.#pendingStops.get(key)?.keys() ?? []];
|
|
613
|
+
}
|
|
614
|
+
/** Ein Arbeitsplatz, der angemeldet bleibt, aber nicht antwortet, bekommt seine ausstehenden Stopps später noch einmal. */
|
|
615
|
+
#retryStops(key) {
|
|
616
|
+
if (this.#stopRetries.has(key)) return;
|
|
617
|
+
const timer = setTimeout(() => {
|
|
618
|
+
this.#stopRetries.delete(key);
|
|
619
|
+
if (this.#clients.has(key)) this.#deliverPendingStops(key);
|
|
620
|
+
}, STOP_RETRY_MS);
|
|
621
|
+
timer.unref();
|
|
622
|
+
this.#stopRetries.set(key, timer);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
var clientMethods = (registry) => [
|
|
626
|
+
implement2(workspaceContracts.clients.list, (_input, { access }) => registry.list(ownerOf(access))),
|
|
627
|
+
implement2(workspaceContracts.clients.register, ({ id, executor, ...description }, { access, connection, local }) => {
|
|
628
|
+
assertMayRegister(access, local);
|
|
629
|
+
return registry.register(id, description, executor, connection);
|
|
630
|
+
}),
|
|
631
|
+
implement2(workspaceContracts.clients.unregister, ({ id }, { access, connection }) => {
|
|
632
|
+
registry.unregister(ownerOf(access), id, connection);
|
|
633
|
+
return null;
|
|
634
|
+
})
|
|
635
|
+
];
|
|
636
|
+
|
|
637
|
+
// server/config.ts
|
|
638
|
+
import { declaredEnvironment } from "@ragents/host/plugin-support/plugin-config.js";
|
|
639
|
+
import { PROCESS_SANDBOX_DEFAULT_NETWORK } from "@ragents/host/plugin-support/process-sandbox.js";
|
|
640
|
+
var workspaceConfigDescriptors = [
|
|
641
|
+
{ key: "PROCESS_SANDBOX", source: "environment" },
|
|
642
|
+
{ key: "PROCESS_SANDBOX_NETWORK", source: "environment" },
|
|
643
|
+
{ key: "RAGENTS_BASH", source: "environment" }
|
|
644
|
+
];
|
|
645
|
+
var env = declaredEnvironment(workspaceConfigDescriptors);
|
|
646
|
+
var processSandboxSetting = () => {
|
|
647
|
+
const mode = env.optional("PROCESS_SANDBOX") ?? "on";
|
|
648
|
+
if (mode !== "on" && mode !== "off") {
|
|
649
|
+
throw new Error(`PROCESS_SANDBOX in der Sektion ragents.workspace ist "on" oder "off", nicht "${mode}"`);
|
|
650
|
+
}
|
|
651
|
+
const network = env.optional("PROCESS_SANDBOX_NETWORK") === void 0 ? PROCESS_SANDBOX_DEFAULT_NETWORK : env.list("PROCESS_SANDBOX_NETWORK");
|
|
652
|
+
return { enabled: mode === "on", network };
|
|
653
|
+
};
|
|
654
|
+
var bashSetting = () => env.optional("RAGENTS_BASH") || void 0;
|
|
655
|
+
|
|
656
|
+
// server/runtime.ts
|
|
657
|
+
import { mkdir, realpath } from "node:fs/promises";
|
|
658
|
+
import path2 from "node:path";
|
|
659
|
+
import { DomainError as DomainError3 } from "@ragents/engine";
|
|
660
|
+
import {
|
|
661
|
+
RUN_FOLDER_OPERATIONS
|
|
662
|
+
} from "@ragents/workspace-executor";
|
|
663
|
+
import { storedStartOption as storedStartOption2 } from "@ragents/host/ragents/start-option-state.js";
|
|
664
|
+
import { WorkspaceSandboxHost } from "@ragents/host/plugin-support/workspace-sandbox-host.js";
|
|
665
|
+
var runNotStarted = () => new DomainError3(
|
|
666
|
+
"run-not-started",
|
|
667
|
+
"Der Run ist noch nicht gestartet; das Arbeitsverzeichnis entsteht mit der ersten Nachricht.",
|
|
668
|
+
409
|
|
669
|
+
);
|
|
670
|
+
var lookAround = "Look around in it before you say anything about the project.";
|
|
671
|
+
var serverProjectDescription = (cwd) => [
|
|
672
|
+
"# Working directory",
|
|
673
|
+
"",
|
|
674
|
+
`Your working directory is \`${cwd}\` on the server: the project folder the user picked.`,
|
|
675
|
+
`It is a real project. Work inside it, keep its structure, and never delete or reorganize files unless you are asked to. ${lookAround}`
|
|
676
|
+
].join("\n");
|
|
677
|
+
var clientProjectDescription = (projectPath, label) => [
|
|
678
|
+
"# Working directory",
|
|
679
|
+
"",
|
|
680
|
+
`Your working directory is the project folder \`${projectPath}\` on the workstation "${label}", not on the server.`,
|
|
681
|
+
"Every workspace tool runs there, and a relative path refers to that folder.",
|
|
682
|
+
`It is a real project. Keep its structure, and never delete or reorganize files unless you are asked to. ${lookAround}`
|
|
683
|
+
].join("\n");
|
|
684
|
+
var freshWorkstationDescription = (folderPath, label) => [
|
|
685
|
+
"# Working directory",
|
|
686
|
+
"",
|
|
687
|
+
`Your working directory is \`${folderPath}\` on the workstation "${label}", not on the server: a folder of this run alone.`,
|
|
688
|
+
"Every workspace tool runs there, and a relative path refers to that folder.",
|
|
689
|
+
"It starts empty unless the profile prepared content in it. Look around in it before you say anything about what is already there."
|
|
690
|
+
].join("\n");
|
|
691
|
+
var freshDescription = (cwd) => [
|
|
692
|
+
"# Working directory",
|
|
693
|
+
"",
|
|
694
|
+
`Your working directory is \`${cwd}\`, a private folder of this conversation on the server.`,
|
|
695
|
+
"No other conversation sees it, and it starts empty unless the profile prepared content in it.",
|
|
696
|
+
"Look around in it before you say anything about what is already there."
|
|
697
|
+
].join("\n");
|
|
698
|
+
var listed = (entries) => entries.length === 1 ? entries[0] : `${entries.slice(0, -1).join(", ")} and ${entries.at(-1)}`;
|
|
699
|
+
var rootList = (roots) => listed(roots.map((root) => `\`${root.alias}\` (${root.writable ? "read and write" : "read only"})`));
|
|
700
|
+
var variableList = (roots) => listed(roots.flatMap((root) => root.environmentVariable === void 0 ? [] : [`\`$${root.environmentVariable}\` for \`${root.alias}\``]));
|
|
701
|
+
var hasVariables = (roots) => roots.some((root) => root.environmentVariable !== void 0);
|
|
702
|
+
var serverRootsDescription = (roots) => [
|
|
703
|
+
"## Roots besides the working directory",
|
|
704
|
+
"",
|
|
705
|
+
`This run also reaches ${rootList(roots)}. File tools and language servers take a path that starts with the alias, such as \`${roots[0].alias}/<path>\`; \`bash\` runs in such a root with that path as \`cwd\`.` + (hasVariables(roots) ? ` \`bash\` also has ${variableList(roots)}.` : "")
|
|
706
|
+
].join("\n");
|
|
707
|
+
var workstationRootsDescription = (roots) => [
|
|
708
|
+
"## Roots on the server",
|
|
709
|
+
"",
|
|
710
|
+
`This run also reaches roots on the server: ${rootList(roots)}. File tools and language servers reach them from the workstation as well: pass a path that starts with the alias, such as \`${roots[0].alias}/<path>\`. \`bash\` runs on the workstation; with a \`cwd\` that starts with an alias it runs on the server instead and sees only the server` + (hasVariables(roots) ? `, and only that bash has ${variableList(roots)}` : "") + ". One call reaches one machine: never combine a path with an alias and a path in the working directory in one call."
|
|
711
|
+
].join("\n");
|
|
712
|
+
var RunWorkspaceRuntime = class {
|
|
713
|
+
sandbox;
|
|
714
|
+
toolNaming = sandboxToolNaming;
|
|
715
|
+
transfer;
|
|
716
|
+
#options;
|
|
717
|
+
#nugetCacheDirectory;
|
|
718
|
+
/** Die neuen Ordner auf Arbeitsplätzen, die in diesem Serverlauf schon angelegt oder in Arbeit sind. */
|
|
719
|
+
#preparations = /* @__PURE__ */ new Map();
|
|
720
|
+
constructor(options) {
|
|
721
|
+
this.#options = options;
|
|
722
|
+
this.transfer = {
|
|
723
|
+
boundDirectory: (runId) => boundServerDirectory(options.runState(runId)),
|
|
724
|
+
assertDirectory: (directory) => void serverDirectoryFolder(directory),
|
|
725
|
+
rebind: (runId, directory) => options.storeBinding(runId, { machine: "server", folder: serverDirectoryFolder(directory) })
|
|
726
|
+
};
|
|
727
|
+
this.#nugetCacheDirectory = path2.join(options.globalDirectory, "nuget-cache");
|
|
728
|
+
this.sandbox = new WorkspaceSandboxHost({
|
|
729
|
+
contributorName: "ragents.workspace.sandbox",
|
|
730
|
+
workspaceFor: options.sessionWorkspaceFor,
|
|
731
|
+
identFor: () => Promise.resolve(void 0),
|
|
732
|
+
skillPaths: options.skillPaths,
|
|
733
|
+
storageRootFor: options.storageRootFor,
|
|
734
|
+
homeFor: (runId) => this.#homeFor(runId),
|
|
735
|
+
executorFor: (runId) => Promise.resolve(this.#executorFor(runId)),
|
|
736
|
+
serverDirectoryFor: (runId) => this.#serverDirectoryFor(runId),
|
|
737
|
+
...options.processSandbox ? { processSandbox: options.processSandbox } : {},
|
|
738
|
+
...options.bash === void 0 ? {} : { bash: options.bash }
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
/** Arbeit eines Runs, die auf dem Server läuft, während sein Arbeitsbereich auf einem Arbeitsplatz liegt. */
|
|
742
|
+
async #serverDirectoryFor(runId) {
|
|
743
|
+
const directory = this.#options.sessionDirectory(runId, "server");
|
|
744
|
+
await mkdir(directory, { recursive: true });
|
|
745
|
+
return realpath(directory);
|
|
746
|
+
}
|
|
747
|
+
async #homeFor(runId) {
|
|
748
|
+
const home = this.#options.sessionDirectory(runId, "home");
|
|
749
|
+
await mkdir(home, { recursive: true });
|
|
750
|
+
await mkdir(this.#nugetCacheDirectory, { recursive: true });
|
|
751
|
+
return { home, nugetPackages: this.#nugetCacheDirectory };
|
|
752
|
+
}
|
|
753
|
+
/** Auf einem Arbeitsplatz führt dessen Executor im Namen des Run-Eigentümers aus, sonst der des Servers. */
|
|
754
|
+
#executorFor(runId) {
|
|
755
|
+
const state = this.#options.runState(runId);
|
|
756
|
+
const binding = bindingOf(state);
|
|
757
|
+
if (!isWorkstationBinding(binding)) return void 0;
|
|
758
|
+
const { machine, folder } = binding;
|
|
759
|
+
const executor = this.#options.clients.executorFor(workspaceOwnerOf(state), machine.client, machine.label, folder.path);
|
|
760
|
+
return "fresh" in folder ? this.#preparing(state, binding, executor) : executor;
|
|
761
|
+
}
|
|
762
|
+
/** Vor dem ersten Auftrag eines Runs legt der Arbeitsplatz dessen neuen Ordner an; Aufräumen legt nie einen an. */
|
|
763
|
+
#preparing(state, binding, executor) {
|
|
764
|
+
return {
|
|
765
|
+
...executor,
|
|
766
|
+
execute: async (runId, operation, input, options = {}) => {
|
|
767
|
+
if (!options.whenReachable) await this.#prepared(runId, state, binding, executor);
|
|
768
|
+
return executor.execute(runId, operation, input, options);
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
#prepared(runId, state, binding, executor) {
|
|
773
|
+
const known = this.#preparations.get(runId);
|
|
774
|
+
if (known) return known;
|
|
775
|
+
const preparation = this.#prepare(runId, state, binding, executor).catch((error) => {
|
|
776
|
+
this.#preparations.delete(runId);
|
|
777
|
+
throw error;
|
|
778
|
+
});
|
|
779
|
+
this.#preparations.set(runId, preparation);
|
|
780
|
+
return preparation;
|
|
781
|
+
}
|
|
782
|
+
/** Nur ein eben angelegter Ordner bekommt die Schritte des Beitrags; scheitert einer, verschwindet er wieder, und der nächste Auftrag beginnt neu. */
|
|
783
|
+
async #prepare(runId, state, binding, executor) {
|
|
784
|
+
const { created } = await executor.execute(runId, RUN_FOLDER_OPERATIONS.create, null);
|
|
785
|
+
const steps = created ? this.#contribution()?.workstation?.prepare(this.#workstationContext(runId, state, binding)) ?? [] : [];
|
|
786
|
+
try {
|
|
787
|
+
await this.#runSteps(runId, executor, steps);
|
|
788
|
+
} catch (error) {
|
|
789
|
+
await executor.execute(runId, RUN_FOLDER_OPERATIONS.remove, null, { whenReachable: true });
|
|
790
|
+
throw error;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
async #runSteps(runId, executor, steps, options = {}) {
|
|
794
|
+
for (const step of steps) await executor.execute(runId, step.operation, step.input, options);
|
|
795
|
+
}
|
|
796
|
+
#workstationContext(runId, state, binding) {
|
|
797
|
+
const contribution = this.#contribution();
|
|
798
|
+
return {
|
|
799
|
+
runId,
|
|
800
|
+
path: binding.folder.path,
|
|
801
|
+
label: binding.machine.label,
|
|
802
|
+
choice: contribution && state ? this.#choiceFor(state, contribution) : null
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
async resolve(runId, emitSystem) {
|
|
806
|
+
const state = this.#options.runState(runId);
|
|
807
|
+
if (!state) throw runNotStarted();
|
|
808
|
+
const binding = bindingOf(state);
|
|
809
|
+
const { folder } = binding;
|
|
810
|
+
const onWorkstation = isWorkstationBinding(binding);
|
|
811
|
+
const workspace = onWorkstation ? this.#workstation(runId, state, binding, emitSystem) : isFreshFolder(folder) ? await this.#fresh(runId, state, emitSystem) : this.#bound(folder, emitSystem);
|
|
812
|
+
return this.#withRoots(workspace, onWorkstation);
|
|
813
|
+
}
|
|
814
|
+
/** Was der Prompt über Wurzeln sagt, hängt an der Maschine des Runs: nur eine Bash auf dem Server kennt ihre Variablen. */
|
|
815
|
+
async #withRoots(workspace, onWorkstation) {
|
|
816
|
+
const roots = await this.sandbox.serverRoots();
|
|
817
|
+
if (roots.length === 0) return workspace;
|
|
818
|
+
const described = onWorkstation ? workstationRootsDescription(roots) : serverRootsDescription(roots);
|
|
819
|
+
return { ...workspace, description: [workspace.description, described].filter(Boolean).join("\n\n") };
|
|
820
|
+
}
|
|
821
|
+
placementOf(runId) {
|
|
822
|
+
const { machine, folder } = bindingOf(this.#options.runState(runId));
|
|
823
|
+
const placement = {
|
|
824
|
+
machine: machine === "server" ? "server" : "client",
|
|
825
|
+
folder: isFreshFolder(folder) ? "fresh" : "existing"
|
|
826
|
+
};
|
|
827
|
+
const contribution = this.#contribution();
|
|
828
|
+
const contributed = placement.folder === "fresh" && (placement.machine === "server" || contribution?.workstation !== void 0);
|
|
829
|
+
const kind = contributed ? contribution?.kind?.id : void 0;
|
|
830
|
+
return kind === void 0 ? placement : { ...placement, kind };
|
|
831
|
+
}
|
|
832
|
+
async #fresh(runId, state, emitSystem) {
|
|
833
|
+
const resolver = this.#options.resolver();
|
|
834
|
+
const directory = resolver?.kind ? this.#options.sessionDirectory(runId, "workspace") : await this.#sessionWorkspace(runId);
|
|
835
|
+
if (!resolver) return this.#directory(directory, freshDescription(directory));
|
|
836
|
+
const { cwd, description, currentRoot, runOperation, ...rest } = await resolver.resolve({
|
|
837
|
+
runId,
|
|
838
|
+
directory,
|
|
839
|
+
choice: this.#choiceFor(state, resolver),
|
|
840
|
+
emitSystem
|
|
841
|
+
});
|
|
842
|
+
const resolved = path2.resolve(cwd);
|
|
843
|
+
return {
|
|
844
|
+
...this.#directory(resolved, description ?? freshDescription(resolved)),
|
|
845
|
+
...rest,
|
|
846
|
+
...currentRoot ? { currentRoot } : {},
|
|
847
|
+
...runOperation ? { runOperation } : {}
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
#bound(folder, emitSystem) {
|
|
851
|
+
const cwd = path2.resolve(folder.path);
|
|
852
|
+
const existing = async () => {
|
|
853
|
+
try {
|
|
854
|
+
return await realpath(cwd);
|
|
855
|
+
} catch {
|
|
856
|
+
throw new DomainError3("workspace-path-missing", `Der gebundene Ordner ${cwd} existiert auf dem Server nicht mehr.`, 409);
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
emitSystem(`Arbeitsbereich: ${cwd} (Projektordner auf dem Server)`);
|
|
860
|
+
return {
|
|
861
|
+
cwd,
|
|
862
|
+
description: serverProjectDescription(cwd),
|
|
863
|
+
currentRoot: existing,
|
|
864
|
+
runOperation: (operation) => operation()
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
/** Der Arbeitsbereich liegt auf dem Arbeitsplatz; der Server kennt nur seinen Pfad, und jeder lokale Griff darauf scheitert laut. */
|
|
868
|
+
#workstation(runId, state, binding, emitSystem) {
|
|
869
|
+
const { machine: { label }, folder } = binding;
|
|
870
|
+
const fresh = "fresh" in folder;
|
|
871
|
+
const workstation = this.#contribution()?.workstation;
|
|
872
|
+
emitSystem(fresh ? `Arbeitsbereich: ${folder.path} (${workstation?.label ?? FRESH_WORKSPACE_LABEL} auf dem Arbeitsplatz ${label})` : `Arbeitsbereich: ${folder.path} (Projektordner auf dem Arbeitsplatz ${label})`);
|
|
873
|
+
const remote = () => Promise.reject(new Error(
|
|
874
|
+
`Der Arbeitsbereich ${folder.path} liegt auf dem Arbeitsplatz ${label}, nicht auf dem Server; er ist nur \xFCber den Executor des Runs (SandboxServices.execute) erreichbar.`
|
|
875
|
+
));
|
|
876
|
+
const description = !fresh ? clientProjectDescription(folder.path, label) : workstation?.description?.(this.#workstationContext(runId, state, binding)) ?? freshWorkstationDescription(folder.path, label);
|
|
877
|
+
return {
|
|
878
|
+
cwd: folder.path,
|
|
879
|
+
description,
|
|
880
|
+
currentRoot: remote,
|
|
881
|
+
runOperation: (operation) => operation()
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
async #sessionWorkspace(runId) {
|
|
885
|
+
const directory = this.#options.sessionDirectory(runId, "workspace");
|
|
886
|
+
await mkdir(directory, { recursive: true });
|
|
887
|
+
return directory;
|
|
888
|
+
}
|
|
889
|
+
#directory(cwd, description, extraEnv) {
|
|
890
|
+
return {
|
|
891
|
+
cwd,
|
|
892
|
+
description,
|
|
893
|
+
...extraEnv ? { extraEnv } : {},
|
|
894
|
+
currentRoot: () => realpath(cwd),
|
|
895
|
+
runOperation: (operation) => operation()
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
#choiceFor(state, resolver) {
|
|
899
|
+
if (resolver.optionId === void 0) return null;
|
|
900
|
+
const choice = storedStartOption2(state, resolver.optionId);
|
|
901
|
+
if (choice === void 0) {
|
|
902
|
+
throw new Error(`Die Startoption ${resolver.optionId} des Workspace-Resolvers ist im Run nicht gespeichert`);
|
|
903
|
+
}
|
|
904
|
+
return choice;
|
|
905
|
+
}
|
|
906
|
+
describe() {
|
|
907
|
+
return {
|
|
908
|
+
mode: "per-run",
|
|
909
|
+
directoryPattern: this.#contribution()?.kind?.directoryPattern ?? path2.join(this.#options.sessionsDirectoryPattern, "workspace")
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
#contribution() {
|
|
913
|
+
return this.#options.resolver();
|
|
914
|
+
}
|
|
915
|
+
/** Auf dem Server gehört ein neuer Ordner samt Stopp und Löschen dem Beitrag; auf einem Arbeitsplatz räumt ihn der Host weg. */
|
|
916
|
+
#serverContributionFor(runId) {
|
|
917
|
+
const { machine, folder } = bindingOf(this.#options.runState(runId));
|
|
918
|
+
return machine === "server" && isFreshFolder(folder) ? this.#contribution() : void 0;
|
|
919
|
+
}
|
|
920
|
+
/** Ist der Arbeitsplatz nicht erreichbar, bleibt der Ordner dort mit Hinweis liegen; der Run ist trotzdem gelöscht. */
|
|
921
|
+
async #removeWorkstationFolder(runId) {
|
|
922
|
+
this.#preparations.delete(runId);
|
|
923
|
+
const state = this.#options.runState(runId);
|
|
924
|
+
const binding = bindingOf(state);
|
|
925
|
+
if (!isWorkstationBinding(binding) || !("fresh" in binding.folder)) return;
|
|
926
|
+
const { machine, folder } = binding;
|
|
927
|
+
const executor = this.#options.clients.executorFor(workspaceOwnerOf(state), machine.client, machine.label, folder.path);
|
|
928
|
+
const steps = this.#contribution()?.workstation?.release?.(this.#workstationContext(runId, state, binding)) ?? [];
|
|
929
|
+
await this.#runSteps(runId, executor, steps, { whenReachable: true });
|
|
930
|
+
if (await executor.execute(runId, RUN_FOLDER_OPERATIONS.remove, null, { whenReachable: true }) !== null) return;
|
|
931
|
+
console.warn(`Der Ordner ${folder.path} des Runs ${runId} bleibt auf dem Arbeitsplatz ${machine.label}, weil er nicht erreichbar war.`);
|
|
932
|
+
}
|
|
933
|
+
async deleteSession(runId) {
|
|
934
|
+
const contribution = this.#serverContributionFor(runId);
|
|
935
|
+
await this.stopSession(runId);
|
|
936
|
+
await this.#removeWorkstationFolder(runId);
|
|
937
|
+
await contribution?.deleteSession?.(runId);
|
|
938
|
+
}
|
|
939
|
+
stopSession(runId) {
|
|
940
|
+
const contribution = this.#serverContributionFor(runId);
|
|
941
|
+
const sandbox = () => this.sandbox.shutdown(runId);
|
|
942
|
+
return contribution?.stopSession ? contribution.stopSession(runId, sandbox) : sandbox();
|
|
943
|
+
}
|
|
944
|
+
async shutdown() {
|
|
945
|
+
await this.sandbox.shutdownAll();
|
|
946
|
+
this.#options.clients.shutdown();
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
// server/index.ts
|
|
951
|
+
var warnWithoutSandbox = () => {
|
|
952
|
+
console.warn('Prozess-Sandbox ausgeschaltet (PROCESS_SANDBOX: "off" in der Sektion ragents.workspace): Prozesse der Runs laufen auf dem Server ohne Sandbox.');
|
|
953
|
+
};
|
|
954
|
+
var ragentsWorkspacePlugin = (skillPaths) => ({
|
|
955
|
+
manifest: { id: "ragents.workspace" },
|
|
956
|
+
register: (host) => {
|
|
957
|
+
const sessionWorkspaceFor = host.service(runWorkspaceProviderToken);
|
|
958
|
+
const orchestration = host.service(runtimeProviderToken);
|
|
959
|
+
const runState = (runId) => {
|
|
960
|
+
try {
|
|
961
|
+
return orchestration().state(runId);
|
|
962
|
+
} catch (error) {
|
|
963
|
+
if (error instanceof DomainError4 && error.code === "run-not-found") return null;
|
|
964
|
+
throw error;
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
const documentsFor = (runId) => host.optionalService(documentStoreToken)?.directoryFor(runId) ?? Promise.resolve(void 0);
|
|
968
|
+
const documentsRoot = async (runId) => {
|
|
969
|
+
const directory = await documentsFor(runId);
|
|
970
|
+
if (!directory) throw new Error("In diesem Profil gibt es keine Dateiablage; das Plugin ragents.documents fehlt");
|
|
971
|
+
return directory;
|
|
972
|
+
};
|
|
973
|
+
const clients = new WorkspaceClientRegistry();
|
|
974
|
+
const contribution = () => host.optionalService(workspaceResolverToken);
|
|
975
|
+
host.config(...workspaceConfigDescriptors);
|
|
976
|
+
const sandboxSetting = processSandboxSetting();
|
|
977
|
+
const processSandbox = sandboxSetting.enabled ? new ServerProcessSandbox({
|
|
978
|
+
network: sandboxSetting.network,
|
|
979
|
+
serverAddress: host.service(hostAddressToken)(),
|
|
980
|
+
dataDirectory: path3.dirname(host.storage.sessionsRoot)
|
|
981
|
+
}) : void 0;
|
|
982
|
+
const bash = bashSetting();
|
|
983
|
+
const runtime = new RunWorkspaceRuntime({
|
|
984
|
+
clients,
|
|
985
|
+
...processSandbox ? { processSandbox } : {},
|
|
986
|
+
...bash === void 0 ? {} : { bash },
|
|
987
|
+
globalDirectory: host.storage.root(),
|
|
988
|
+
sessionDirectory: (runId, ...segments) => host.storage.session(runId, ...segments),
|
|
989
|
+
storageRootFor: (runId) => path3.join(host.storage.sessionsRoot, runId),
|
|
990
|
+
sessionsDirectoryPattern: path3.join(host.storage.sessionsRoot, "{runId}", "plugins", host.manifest.id),
|
|
991
|
+
sessionWorkspaceFor,
|
|
992
|
+
skillPaths,
|
|
993
|
+
resolver: contribution,
|
|
994
|
+
runState,
|
|
995
|
+
storeBinding: (runId, binding) => {
|
|
996
|
+
const state = orchestration().state(runId);
|
|
997
|
+
orchestration().replacePluginState(
|
|
998
|
+
{ actorId: state.ownerId, commandId: `workspace-binding:${runId}:${state.revision}` },
|
|
999
|
+
runId,
|
|
1000
|
+
{ pluginId: WORKSPACE_BINDING_OPTION_ID, scope: startOptionScope, state: binding }
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
host.provide(workspaceRuntimeToken, runtime);
|
|
1005
|
+
host.provide(sandboxServicesToken, runtime.sandbox);
|
|
1006
|
+
host.functions(runtime.sandbox.workspaceTools());
|
|
1007
|
+
const rules = handlebarsPrompt("ragents.workspace.prompt", 100, pluginAsset("ragents.workspace", "prompt.hbs"));
|
|
1008
|
+
host.prompts(
|
|
1009
|
+
boundToTools2({
|
|
1010
|
+
...rules,
|
|
1011
|
+
delivery: "initial",
|
|
1012
|
+
// Die Regeln gelten für die Arbeitsbereiche des Hosts; eine beigesteuerte Art beschreibt ihre eigenen.
|
|
1013
|
+
render: (context) => contribution()?.kind ? "" : rules.render(context)
|
|
1014
|
+
}, ...agentWorkspaceToolNames),
|
|
1015
|
+
shellPlatformPrompt("ragents.workspace.shell.prompt", 102, (runId) => {
|
|
1016
|
+
const state = runState(runId);
|
|
1017
|
+
return executorShellChapter(clients, workspaceOwnerOf(state), bindingOf(state));
|
|
1018
|
+
})
|
|
1019
|
+
);
|
|
1020
|
+
const browseOptions = {
|
|
1021
|
+
ensureSession: host.service(runGuardToken),
|
|
1022
|
+
ensureWorkspaceAccess: host.service(workspaceGuardToken),
|
|
1023
|
+
execute: runtime.sandbox.execute.bind(runtime.sandbox),
|
|
1024
|
+
documentsFor: documentsRoot,
|
|
1025
|
+
locationOf: (runId, location) => workspaceLocation(bindingOf(runState(runId)), location)
|
|
1026
|
+
};
|
|
1027
|
+
host.methods(...createBrowseMethods(browseOptions), ...clientMethods(clients));
|
|
1028
|
+
host.channels(createBrowseChannel(browseOptions));
|
|
1029
|
+
host.startOptions(workspaceBindingOption(clients, contribution));
|
|
1030
|
+
host.sessionMetadata({ id: WORKSPACE_METADATA_ID, describe: ({ runId }) => sessionMetadataOf(runState(runId), contribution()) });
|
|
1031
|
+
host.lifecycle({
|
|
1032
|
+
id: "ragents.workspace.lifecycle",
|
|
1033
|
+
initialize: () => processSandbox ? processSandbox.start() : warnWithoutSandbox(),
|
|
1034
|
+
stopSession: ({ runId }) => runtime.stopSession(runId),
|
|
1035
|
+
deleteSession: ({ runId }) => runtime.deleteSession(runId),
|
|
1036
|
+
shutdown: async () => {
|
|
1037
|
+
await runtime.shutdown();
|
|
1038
|
+
await processSandbox?.stop();
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
var plugin = {
|
|
1044
|
+
create: (host) => ragentsWorkspacePlugin(() => host.skills.global())
|
|
1045
|
+
};
|
|
1046
|
+
export {
|
|
1047
|
+
plugin
|
|
1048
|
+
};
|
|
1049
|
+
//# sourceMappingURL=index.js.map
|