@schlenkr/ragents 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/server/package.json +1 -1
- package/apps/server/src/access-projection.ts +9 -39
- package/apps/server/src/access-service.ts +3 -3
- package/apps/server/src/access-session.ts +19 -19
- package/apps/server/src/api/contracts.ts +32 -29
- package/apps/server/src/api/core-methods.ts +21 -19
- package/apps/server/src/api/delivery.ts +2 -2
- package/apps/server/src/api/reference.ts +27 -27
- package/apps/server/src/api/rights.ts +18 -18
- package/apps/server/src/chat-handler.ts +5 -5
- package/apps/server/src/config-definition.ts +37 -10
- package/apps/server/src/config-file.ts +49 -49
- package/apps/server/src/config.ts +2 -0
- package/apps/server/src/data-directory.ts +2 -2
- package/apps/server/src/external-access.ts +1 -1
- package/apps/server/src/folder-install.ts +1 -1
- package/apps/server/src/help-files.ts +1 -1
- package/apps/server/src/host-api.json +8 -1
- package/apps/server/src/host-api.ts +3 -2
- package/apps/server/src/host-record.ts +3 -3
- package/apps/server/src/host-resolution-hooks.mjs +4 -4
- package/apps/server/src/host-version.ts +17 -17
- package/apps/server/src/host-web.ts +5 -5
- package/apps/server/src/main.ts +6 -6
- package/apps/server/src/missing-environment.ts +6 -6
- package/apps/server/src/parent-watch.ts +4 -4
- package/apps/server/src/plugin-build/build.ts +31 -31
- package/apps/server/src/plugin-build/host-api-names.ts +7 -7
- package/apps/server/src/plugin-build/plugin-description.ts +15 -15
- package/apps/server/src/plugin-build/typecheck.ts +1 -1
- package/apps/server/src/plugin-support/actor-programs/app-project.ts +19 -19
- package/apps/server/src/plugin-support/actor-programs/client-compiler.ts +4 -4
- package/apps/server/src/plugin-support/actor-programs/client-contracts.ts +11 -11
- package/apps/server/src/plugin-support/actor-programs/contract.ts +17 -17
- package/apps/server/src/plugin-support/actor-programs/runtime-libraries.ts +1 -1
- package/apps/server/src/plugin-support/actor-programs/workflow/index.ts +5 -5
- package/apps/server/src/plugin-support/actor-programs/workflow/prompt-reader.ts +2 -2
- package/apps/server/src/plugin-support/chat-display-policy.ts +2 -2
- package/apps/server/src/plugin-support/front-matter.ts +6 -6
- package/apps/server/src/plugin-support/http.ts +2 -2
- package/apps/server/src/plugin-support/language-server/contract.ts +8 -8
- package/apps/server/src/plugin-support/language-server/plugin.ts +2 -2
- package/apps/server/src/plugin-support/language-server/snapshot-method.ts +1 -1
- package/apps/server/src/plugin-support/language-server/tools.ts +11 -11
- package/apps/server/src/plugin-support/model-aliases.ts +30 -20
- package/apps/server/src/plugin-support/model-choice.ts +15 -15
- package/apps/server/src/plugin-support/model-completion.ts +44 -23
- package/apps/server/src/plugin-support/model-providers.ts +170 -0
- package/apps/server/src/plugin-support/model-upstreams.ts +1 -1
- package/apps/server/src/plugin-support/native-typescript-child.ts +4 -4
- package/apps/server/src/plugin-support/native-typescript-executor.ts +12 -12
- package/apps/server/src/plugin-support/plugin-config.ts +3 -3
- package/apps/server/src/plugin-support/plugin-folder.ts +2 -2
- package/apps/server/src/plugin-support/plugins-root.ts +2 -2
- package/apps/server/src/plugin-support/process-sandbox.ts +48 -47
- package/apps/server/src/plugin-support/product-model-settings-contract.ts +3 -3
- package/apps/server/src/plugin-support/product-model-settings.ts +10 -10
- package/apps/server/src/plugin-support/product-relay.ts +9 -9
- package/apps/server/src/plugin-support/product-start-options.ts +4 -4
- package/apps/server/src/plugin-support/prompt.ts +1 -1
- package/apps/server/src/plugin-support/provision.ts +8 -8
- package/apps/server/src/plugin-support/run-scripts.ts +17 -17
- package/apps/server/src/plugin-support/skills.ts +18 -18
- package/apps/server/src/plugin-support/start-entries-contract.ts +17 -17
- package/apps/server/src/plugin-support/start-options-contract.ts +5 -5
- package/apps/server/src/plugin-support/system-prompts.ts +11 -11
- package/apps/server/src/plugin-support/thinking-level.ts +2 -2
- package/apps/server/src/plugin-support/tool-availability.ts +2 -2
- package/apps/server/src/plugin-support/workspace-ownership.ts +5 -5
- package/apps/server/src/plugin-support/workspace-sandbox-host.ts +37 -37
- package/apps/server/src/plugin-support/zip.ts +7 -7
- package/apps/server/src/profile/bundle-manifest.ts +17 -17
- package/apps/server/src/profile/compose.ts +12 -7
- package/apps/server/src/profile/plugin-discovery.ts +12 -12
- package/apps/server/src/profile/provisioning.ts +5 -5
- package/apps/server/src/profile-target.ts +10 -10
- package/apps/server/src/protocol.ts +2 -2
- package/apps/server/src/provider.ts +63 -58
- package/apps/server/src/ragents/actor-chat-history.ts +8 -8
- package/apps/server/src/ragents/chat-text-positions.ts +2 -2
- package/apps/server/src/ragents/coordinator.ts +2 -2
- package/apps/server/src/ragents/engine.ts +25 -24
- package/apps/server/src/ragents/global-chat.ts +14 -8
- package/apps/server/src/ragents/host-services.ts +6 -3
- package/apps/server/src/ragents/journal-chat-events.ts +1 -1
- package/apps/server/src/ragents/run-owner.ts +2 -2
- package/apps/server/src/ragents/session.ts +49 -49
- package/apps/server/src/ragents/typescript-tools.ts +12 -12
- package/apps/server/src/ragents/workspace-runtime.ts +28 -28
- package/apps/server/src/rpc/dispatcher.ts +19 -19
- package/apps/server/src/rpc/http-transport.ts +11 -11
- package/apps/server/src/rpc/stdio-transport.ts +3 -3
- package/apps/server/src/run-preparation-input.ts +5 -5
- package/apps/server/src/run-preparation.ts +24 -24
- package/apps/server/src/run-transfer.ts +39 -39
- package/apps/server/src/server.ts +51 -49
- package/apps/server/src/settings.ts +1 -1
- package/apps/server/src/startup.ts +3 -3
- package/apps/server/src/title-compactor.ts +9 -9
- package/apps/server/src/title-settings.ts +3 -3
- package/apps/server/src/web-bundles.ts +2 -2
- package/apps/server/src/web-stylesheet.ts +2 -2
- package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-xXXhTDbh.js → highlighted-body-KPVGNVTW-BfNSGxjB.js} +1 -1
- package/apps/web/dist/assets/main-D6bsKcIK.js +11 -0
- package/apps/web/dist/assets/mermaid-HWGCJPDP-DROEqEeg.js +608 -0
- package/apps/web/dist/assets/runPanel-Dumuuqry.js +21 -0
- package/apps/web/dist/help/guide-access.html +5 -5
- package/apps/web/dist/help/guide-access.md +2 -2
- package/apps/web/dist/help/guide-clients.html +64 -55
- package/apps/web/dist/help/guide-clients.md +62 -52
- package/apps/web/dist/help/guide-distributed.html +12 -7
- package/apps/web/dist/help/guide-distributed.md +9 -4
- package/apps/web/dist/help/guide-functions.html +3 -3
- package/apps/web/dist/help/guide-getting-started.html +24 -15
- package/apps/web/dist/help/guide-getting-started.md +22 -12
- package/apps/web/dist/help/guide-ideas.html +3 -3
- package/apps/web/dist/help/guide-plugins.html +5 -4
- package/apps/web/dist/help/guide-plugins.md +2 -1
- package/apps/web/dist/help/guide-programs.html +3 -3
- package/apps/web/dist/help/guide-runtime.html +6 -6
- package/apps/web/dist/help/guide-runtime.md +3 -3
- package/apps/web/dist/help/guide.html +3 -3
- package/apps/web/dist/help/index.html +1997 -942
- package/apps/web/dist/help/mini-app.css +30 -0
- package/apps/web/dist/help/mini-app.js +14 -14
- package/apps/web/dist/host-web.json +90 -90
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/run-panel.html +3 -3
- package/apps/web/package.json +1 -1
- package/apps/web/src/AccessContext.tsx +15 -15
- package/apps/web/src/App.tsx +13 -13
- package/apps/web/src/DiffCode.tsx +2 -2
- package/apps/web/src/HelpDialog.tsx +3 -3
- package/apps/web/src/Overview.tsx +13 -13
- package/apps/web/src/PluginActivation.ts +1 -1
- package/apps/web/src/PluginChat.tsx +15 -15
- package/apps/web/src/PluginFailureNotice.tsx +1 -1
- package/apps/web/src/PluginRegistry.tsx +44 -44
- package/apps/web/src/RunPreparationChat.tsx +11 -11
- package/apps/web/src/RunStore.ts +1 -1
- package/apps/web/src/SessionList.tsx +14 -14
- package/apps/web/src/SettingsModal.tsx +112 -112
- package/apps/web/src/StartOptions.tsx +11 -11
- package/apps/web/src/StartSelection.tsx +11 -11
- package/apps/web/src/StartTiles.tsx +8 -8
- package/apps/web/src/SurfaceShortcuts.tsx +3 -3
- package/apps/web/src/ThemeSettings.tsx +8 -8
- package/apps/web/src/TitleModelSettings.tsx +13 -13
- package/apps/web/src/WorkspacePanel.tsx +9 -9
- package/apps/web/src/access-session.ts +4 -4
- package/apps/web/src/access-token.ts +5 -5
- package/apps/web/src/actor-conversation.ts +3 -3
- package/apps/web/src/actor-programs/client-ui/DataTable.tsx +8 -8
- package/apps/web/src/actor-programs/client-ui/FilePicker.tsx +4 -4
- package/apps/web/src/actor-programs/client-ui/FlowDiagram.tsx +13 -13
- package/apps/web/src/actor-programs/client-ui/Viewers.tsx +4 -4
- package/apps/web/src/actor-programs/client-ui/WorkflowDiagram.tsx +1 -1
- package/apps/web/src/actor-programs/client-ui/file-contracts.d.ts +4 -4
- package/apps/web/src/actor-programs/client-ui/file-selection.ts +1 -1
- package/apps/web/src/actor-programs/client-ui/viewer-contracts.d.ts +3 -3
- package/apps/web/src/api.ts +7 -7
- package/apps/web/src/chat/StoppedActorNotice.tsx +5 -5
- package/apps/web/src/chat/chat-target.ts +3 -3
- package/apps/web/src/chat/requests.ts +2 -2
- package/apps/web/src/chat/useAttachmentCapabilities.ts +2 -2
- package/apps/web/src/chat-view-settings.tsx +5 -6
- package/apps/web/src/diff-view.css +1 -1
- package/apps/web/src/highlighting.css +1 -1
- package/apps/web/src/language-server/language-server-plugin.tsx +30 -30
- package/apps/web/src/lib/labels.ts +6 -6
- package/apps/web/src/main.tsx +4 -4
- package/apps/web/src/offered-machines.ts +2 -2
- package/apps/web/src/page-opener.tsx +1 -1
- package/apps/web/src/panel/ConnectionsPage.tsx +26 -23
- package/apps/web/src/panel/LoginForm.tsx +6 -6
- package/apps/web/src/panel/PanelDialogs.tsx +22 -22
- package/apps/web/src/panel/PanelHeader.tsx +2 -2
- package/apps/web/src/panel/PanelPage.tsx +1 -1
- package/apps/web/src/panel/RunLine.tsx +4 -4
- package/apps/web/src/panel/RunsPage.tsx +15 -15
- package/apps/web/src/panel/StartPage.tsx +29 -26
- package/apps/web/src/panel/connection-state.ts +9 -9
- package/apps/web/src/panel/contract.ts +34 -27
- package/apps/web/src/panel.tsx +1 -1
- package/apps/web/src/plugin-bootstrap.ts +5 -5
- package/apps/web/src/product/ModelControl.tsx +3 -3
- package/apps/web/src/product/ProductModelSettings.tsx +16 -16
- package/apps/web/src/product/SystemPromptControl.tsx +11 -11
- package/apps/web/src/product/model-settings.ts +2 -2
- package/apps/web/src/rpc/client.ts +16 -16
- package/apps/web/src/rpc.ts +1 -1
- package/apps/web/src/run-overview.ts +1 -1
- package/apps/web/src/run-panel/RunPanelApp.tsx +39 -39
- package/apps/web/src/run-panel/RunPanelHeader.tsx +6 -6
- package/apps/web/src/run-panel/RunPanelMenu.tsx +6 -6
- package/apps/web/src/run-panel/RunPanelRail.tsx +4 -4
- package/apps/web/src/run-panel/RunPanelWorkspace.tsx +3 -3
- package/apps/web/src/run-panel/clipboard.ts +3 -3
- package/apps/web/src/run-panel/host-contract.ts +5 -5
- package/apps/web/src/run-panel/host.ts +15 -15
- package/apps/web/src/run-panel/input-bridge.ts +1 -1
- package/apps/web/src/run-panel/run-panel-location.ts +5 -5
- package/apps/web/src/run-panel/use-session-list.ts +1 -1
- package/apps/web/src/run-panel/workspace-state.ts +3 -3
- package/apps/web/src/run-panel.tsx +4 -4
- package/apps/web/src/run-preparation.ts +2 -2
- package/apps/web/src/run-view.ts +3 -3
- package/apps/web/src/settings-contributions.ts +32 -32
- package/apps/web/src/theme.ts +9 -9
- package/apps/web/src/title-model-settings.ts +6 -6
- package/apps/web/src/ui/ListDetail.tsx +9 -9
- package/apps/web/src/ui/dialog.tsx +2 -2
- package/apps/web/src/ui/modal-controller.ts +3 -3
- package/apps/web/src/ui/modal.tsx +2 -2
- package/apps/web/src/ui/popover.tsx +1 -1
- package/apps/web/src/ui/relative-time.ts +8 -8
- package/apps/web/src/ui/startup-notice.tsx +2 -2
- package/apps/web/src/ui/state-icon.tsx +1 -1
- package/apps/web/src/ui/state-vocabulary.ts +16 -16
- package/apps/web/src/ui/stop-button.tsx +2 -2
- package/bundles/ragents.activity/ragents-bundle.json +2 -2
- package/bundles/ragents.activity/web/classes.json +1 -1
- package/bundles/ragents.activity/web/index.js +1 -1
- package/bundles/ragents.activity/web/index.js.map +2 -2
- package/bundles/ragents.actor-programs/ragents-bundle.json +2 -2
- package/bundles/ragents.actor-programs/server/index.js +256 -228
- package/bundles/ragents.actor-programs/server/index.js.map +4 -4
- package/bundles/ragents.actor-programs/web/classes.json +1 -1
- package/bundles/ragents.actor-programs/web/index.js +1 -1
- package/bundles/ragents.actor-programs/web/index.js.map +3 -3
- package/bundles/ragents.ask/ragents-bundle.json +2 -4
- package/bundles/ragents.ask/server/chunks/{chunk-PDJO75SQ.js → chunk-YOV27MAR.js} +2 -2
- package/bundles/ragents.ask/server/chunks/chunk-YOV27MAR.js.map +7 -0
- package/bundles/ragents.ask/server/exports/server/contract.js +1 -1
- package/bundles/ragents.ask/server/index.js +23 -23
- package/bundles/ragents.ask/server/index.js.map +2 -2
- package/bundles/ragents.ask/web/chunks/{chunk-WFN4374U.js → chunk-D6NNB5DS.js} +1 -1
- package/bundles/ragents.ask/web/chunks/chunk-D6NNB5DS.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/{chunk-V7W3QDVS.js → chunk-IQBHK7MV.js} +2 -2
- package/bundles/ragents.ask/web/chunks/{chunk-V7W3QDVS.js.map → chunk-IQBHK7MV.js.map} +4 -4
- package/bundles/ragents.ask/web/chunks/chunk-PWFIAMX4.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-PWFIAMX4.js.map +7 -0
- package/bundles/ragents.ask/web/chunks/chunk-QHGKEESD.js +2 -0
- package/bundles/ragents.ask/web/chunks/chunk-QHGKEESD.js.map +7 -0
- package/bundles/ragents.ask/web/classes.json +1 -1
- package/bundles/ragents.ask/web/exports/ask-payload.js +1 -1
- package/bundles/ragents.ask/web/exports/web/QuestionCard.js +1 -1
- package/bundles/ragents.ask/web/exports/web/api.js +1 -1
- package/bundles/ragents.ask/web/index.js +1 -1
- package/bundles/ragents.ask/web/index.js.map +4 -4
- package/bundles/ragents.browser/executor/index.mjs +35 -35
- package/bundles/ragents.browser/executor/index.mjs.map +2 -2
- package/bundles/ragents.browser/ragents-bundle.json +2 -2
- package/bundles/ragents.browser/server/chunks/{chunk-CWLX4VA5.js → chunk-PYEISBNE.js} +1 -1
- package/bundles/ragents.browser/server/chunks/{chunk-CWLX4VA5.js.map → chunk-PYEISBNE.js.map} +1 -1
- package/bundles/ragents.browser/server/exports/server/contract.js +1 -1
- package/bundles/ragents.browser/server/index.js +31 -31
- package/bundles/ragents.browser/server/index.js.map +2 -2
- package/bundles/ragents.browser/skills/browser-testing/SKILL.md +30 -30
- package/bundles/ragents.documents/prompt.hbs +1 -1
- package/bundles/ragents.documents/ragents-bundle.json +2 -2
- package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js → chunk-KMZWOVTI.js} +3 -3
- package/bundles/ragents.documents/server/chunks/{chunk-QIECRZ7C.js.map → chunk-KMZWOVTI.js.map} +2 -2
- package/bundles/ragents.documents/server/exports/contract.js +1 -1
- package/bundles/ragents.documents/server/index.js +26 -26
- package/bundles/ragents.documents/server/index.js.map +2 -2
- package/bundles/ragents.documents/web/classes.json +1 -1
- package/bundles/ragents.documents/web/index.js +1 -1
- package/bundles/ragents.documents/web/index.js.map +3 -3
- package/bundles/ragents.lsp-fsharp/executor/index.mjs +4 -4
- package/bundles/ragents.lsp-fsharp/executor/index.mjs.map +2 -2
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +2 -2
- package/bundles/ragents.lsp-fsharp/server/index.js +5 -5
- package/bundles/ragents.lsp-fsharp/server/index.js.map +2 -2
- package/bundles/ragents.lsp-fsharp/web/index.js +1 -1
- package/bundles/ragents.lsp-fsharp/web/index.js.map +2 -2
- package/bundles/ragents.lsp-roslyn/executor/index.mjs +3 -3
- package/bundles/ragents.lsp-roslyn/executor/index.mjs.map +2 -2
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +2 -2
- package/bundles/ragents.lsp-roslyn/server/index.js +17 -17
- package/bundles/ragents.lsp-roslyn/server/index.js.map +2 -2
- package/bundles/ragents.lsp-roslyn/web/index.js +1 -1
- package/bundles/ragents.lsp-roslyn/web/index.js.map +2 -2
- package/bundles/ragents.lsp-typescript/executor/index.mjs +2 -2
- package/bundles/ragents.lsp-typescript/executor/index.mjs.map +2 -2
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +2 -2
- package/bundles/ragents.lsp-typescript/server/index.js.map +1 -1
- package/bundles/ragents.lsp-typescript/web/index.js +1 -1
- package/bundles/ragents.lsp-typescript/web/index.js.map +2 -2
- package/bundles/ragents.model-relay/ragents-bundle.json +7 -3
- package/bundles/ragents.model-relay/server/index.js +25 -21
- package/bundles/ragents.model-relay/server/index.js.map +2 -2
- package/bundles/ragents.orchestration/ragents-bundle.json +2 -2
- package/bundles/ragents.orchestration/server/index.js +28 -28
- package/bundles/ragents.orchestration/server/index.js.map +2 -2
- package/bundles/ragents.orchestration/web/chunks/{chunk-OSKPH6SZ.js → chunk-CFMJD5ZI.js} +2 -2
- package/bundles/ragents.orchestration/web/chunks/chunk-HOBLI364.js +2 -0
- package/bundles/ragents.orchestration/web/chunks/{chunk-OQYCNYXN.js.map → chunk-HOBLI364.js.map} +2 -2
- package/bundles/ragents.orchestration/web/chunks/{chunk-ODMMQGX2.js → chunk-UCIMT2R4.js} +2 -2
- package/bundles/ragents.orchestration/web/classes.json +1 -1
- package/bundles/ragents.orchestration/web/exports/web/program-slot.js +1 -1
- package/bundles/ragents.orchestration/web/exports/web/surface-entities.js +1 -1
- package/bundles/ragents.orchestration/web/index.js +8 -8
- package/bundles/ragents.orchestration/web/index.js.map +3 -3
- package/bundles/ragents.overseer/ragents-bundle.json +2 -2
- package/bundles/ragents.overseer/server/index.js +99 -99
- package/bundles/ragents.overseer/server/index.js.map +2 -2
- package/bundles/ragents.overseer/web/classes.json +1 -1
- package/bundles/ragents.overseer/web/index.js +1 -1
- package/bundles/ragents.overseer/web/index.js.map +2 -2
- package/bundles/ragents.processes/ragents-bundle.json +2 -2
- package/bundles/ragents.processes/server/index.js +11 -11
- package/bundles/ragents.processes/server/index.js.map +2 -2
- package/bundles/ragents.processes/web/classes.json +1 -1
- package/bundles/ragents.processes/web/index.js +3 -3
- package/bundles/ragents.processes/web/index.js.map +2 -2
- package/bundles/ragents.product/ragents-bundle.json +2 -2
- package/bundles/ragents.product/server/index.js +12 -13
- package/bundles/ragents.product/server/index.js.map +2 -2
- package/bundles/ragents.product/web/classes.json +1 -1
- package/bundles/ragents.product/web/index.js +1 -1
- package/bundles/ragents.product/web/index.js.map +2 -2
- package/bundles/ragents.profile-distribution/ragents-bundle.json +2 -2
- package/bundles/ragents.profile-distribution/server/index.js +31 -31
- package/bundles/ragents.profile-distribution/server/index.js.map +2 -2
- package/bundles/ragents.reference/ragents-bundle.json +2 -2
- package/bundles/ragents.reference/run-scripts/balcony-wizard/RUN.md +19 -19
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +2 -2
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +14 -14
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +2 -2
- package/bundles/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +49 -49
- package/bundles/ragents.reference/run-scripts/balcony-wizard/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/balcony-wizard/src/server.ts +9 -9
- package/bundles/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +9 -9
- package/bundles/ragents.reference/run-scripts/conversation-circle/RUN.md +7 -7
- package/bundles/ragents.reference/run-scripts/conversation-circle/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/conversation-circle/src/server.ts +13 -13
- package/bundles/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
- package/bundles/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +8 -8
- package/bundles/ragents.reference/run-scripts/learning-afternoon/RUN.md +16 -16
- package/bundles/ragents.reference/run-scripts/learning-afternoon/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -1
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +3 -3
- package/bundles/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -1
- package/bundles/ragents.reference/run-scripts/learning-afternoon/src/server.ts +9 -9
- package/bundles/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +39 -39
- package/bundles/ragents.reference/run-scripts/moderated-round/RUN.md +7 -7
- package/bundles/ragents.reference/run-scripts/moderated-round/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/moderated-round/src/server.ts +9 -9
- package/bundles/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
- package/bundles/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +6 -6
- package/bundles/ragents.reference/run-scripts/shared-actor-list/RUN.md +12 -12
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +2 -2
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +3 -3
- package/bundles/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +4 -4
- package/bundles/ragents.reference/run-scripts/shared-actor-list/package.json +1 -1
- package/bundles/ragents.reference/run-scripts/shared-actor-list/src/server.ts +11 -11
- package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
- package/bundles/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +13 -13
- package/bundles/ragents.reference/run-scripts/word-game/RUN.md +18 -18
- package/bundles/ragents.reference/run-scripts/word-game/package.json +2 -2
- package/bundles/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
- package/bundles/ragents.reference/run-scripts/word-game/src/contract.ts +2 -2
- package/bundles/ragents.reference/run-scripts/word-game/src/server.ts +16 -16
- package/bundles/ragents.reference/run-scripts/word-game/tests/program.test.ts +39 -39
- package/bundles/ragents.reference/skills/100-shared-actor-list/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/110-all-card-slots/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/150-editorial-workbench/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/160-learning-companion/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/170-photo-collection/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/180-decision-workbench/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/190-review-queue/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/20-circle-of-four/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/210-moderator-handover/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/220-actor-approval-list/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/230-shared-state-views/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/240-live-result-list/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/250-balcony-wizard/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/35-actor-input-fifo/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/40-subscription-matrix/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/50-subscription-removal/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/70-headless-counter/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/75-lsp-demo/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/80-actor-text-analysis/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/90-actor-notes/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/95-hello-world/SKILL.md +5 -5
- package/bundles/ragents.reference/skills/decision-brief/SKILL.md +24 -24
- package/bundles/ragents.reference/skills/learning-sprint/SKILL.md +24 -24
- package/bundles/ragents.reference/web/classes.json +1 -1
- package/bundles/ragents.reference/web/index.js +1 -1
- package/bundles/ragents.reference/web/index.js.map +2 -2
- package/bundles/ragents.todo/ragents-bundle.json +2 -2
- package/bundles/ragents.todo/server/index.js +5 -5
- package/bundles/ragents.todo/server/index.js.map +2 -2
- package/bundles/ragents.todo/web/classes.json +1 -1
- package/bundles/ragents.todo/web/index.js +1 -1
- package/bundles/ragents.todo/web/index.js.map +2 -2
- package/bundles/ragents.transcript/ragents-bundle.json +2 -2
- package/bundles/ragents.transcript/server/index.js +11 -11
- package/bundles/ragents.transcript/server/index.js.map +2 -2
- package/bundles/ragents.watch/ragents-bundle.json +2 -2
- package/bundles/ragents.watch/server/index.js +48 -48
- package/bundles/ragents.watch/server/index.js.map +2 -2
- package/bundles/ragents.workspace/ragents-bundle.json +2 -2
- package/bundles/ragents.workspace/server/index.js +83 -81
- package/bundles/ragents.workspace/server/index.js.map +2 -2
- package/bundles/ragents.workspace/web/classes.json +1 -1
- package/bundles/ragents.workspace/web/index.js +1 -1
- package/bundles/ragents.workspace/web/index.js.map +2 -2
- package/package.json +4 -4
- package/packages/agent/dist/core/model-runtime.d.ts +7 -2
- package/packages/agent/dist/core/tools/bash.d.ts +1 -1
- package/packages/agent/dist/index.d.ts +1 -1
- package/packages/agent/dist/loop/agent-loop.d.ts +2 -2
- package/packages/agent/src/core/compaction/utils.ts +1 -1
- package/packages/agent/src/core/model-runtime.ts +45 -5
- package/packages/agent/src/core/tools/bash.ts +1 -1
- package/packages/agent/src/index.ts +1 -1
- package/packages/agent/src/loop/agent-loop.ts +2 -2
- package/packages/ai/dist/models.d.ts +1 -0
- package/packages/ai/dist/models.generated.d.ts +4544 -983
- package/packages/ai/dist/providers/openrouter.models.d.ts +4544 -983
- package/packages/ai/src/api/ai-sdk.ts +33 -7
- package/packages/ai/src/api-registry.ts +1 -1
- package/packages/ai/src/index.ts +2 -2
- package/packages/ai/src/models.generated.ts +1 -1
- package/packages/ai/src/models.ts +1 -1
- package/packages/ai/src/providers/openrouter.models.ts +3723 -550
- package/packages/ragents/src/access.ts +12 -12
- package/packages/ragents/src/agents/actor-input.ts +33 -33
- package/packages/ragents/src/agents/catalog.ts +1 -1
- package/packages/ragents/src/agents/delivery.ts +17 -17
- package/packages/ragents/src/agents/plugins.ts +1 -1
- package/packages/ragents/src/agents/scheduler.ts +7 -7
- package/packages/ragents/src/agents/schemas.ts +1 -1
- package/packages/ragents/src/agents/tool-orientation.ts +4 -4
- package/packages/ragents/src/agents/tools.ts +20 -20
- package/packages/ragents/src/agents/toolset.ts +5 -5
- package/packages/ragents/src/agents/workspaces.ts +1 -1
- package/packages/ragents/src/domain/events.ts +1 -1
- package/packages/ragents/src/domain/model.ts +5 -5
- package/packages/ragents/src/drivers/agent-runtime.ts +1 -1
- package/packages/ragents/src/drivers/agent-turn.ts +4 -4
- package/packages/ragents/src/drivers/agent.ts +2 -2
- package/packages/ragents/src/drivers/attachments.ts +4 -4
- package/packages/ragents/src/http/contracts.ts +14 -14
- package/packages/ragents/src/http/methods.ts +6 -6
- package/packages/ragents/src/index.ts +1 -0
- package/packages/ragents/src/plugin-host.ts +162 -116
- package/packages/ragents/src/plugin-types.ts +29 -10
- package/packages/ragents/src/rpc/contract.ts +5 -5
- package/packages/ragents/src/rpc/contribution.ts +2 -2
- package/packages/ragents/src/rpc/peer.ts +11 -11
- package/packages/ragents/src/rpc/protocol.ts +2 -2
- package/packages/ragents/src/runtime/decisions/turns.ts +1 -1
- package/packages/ragents/src/runtime/journal.ts +10 -10
- package/packages/ragents/src/runtime/orchestration.ts +8 -8
- package/packages/ragents/src/runtime/stop.ts +2 -2
- package/packages/ragents/src/script/mediators.ts +35 -35
- package/packages/ragents/src/typescript/async-compiler.ts +14 -14
- package/packages/ragents/src/typescript/compiler-worker.ts +2 -2
- package/packages/ragents/src/typescript/compiler.ts +7 -7
- package/packages/ragents/src/typescript/snippet.ts +5 -5
- package/packages/workspace-executor/src/bash-launch.ts +13 -13
- package/packages/workspace-executor/src/commands.ts +18 -18
- package/packages/workspace-executor/src/context.ts +15 -15
- package/packages/workspace-executor/src/contributions.ts +35 -35
- package/packages/workspace-executor/src/errors.ts +1 -1
- package/packages/workspace-executor/src/executor.ts +15 -15
- package/packages/workspace-executor/src/files.ts +30 -30
- package/packages/workspace-executor/src/language-server/contract.ts +2 -2
- package/packages/workspace-executor/src/language-server/diagnostics.ts +4 -4
- package/packages/workspace-executor/src/language-server/host.ts +35 -35
- package/packages/workspace-executor/src/language-server/json-rpc.ts +4 -4
- package/packages/workspace-executor/src/language-server/module.ts +11 -11
- package/packages/workspace-executor/src/language-server/roots.ts +3 -3
- package/packages/workspace-executor/src/language-server/session.ts +15 -15
- package/packages/workspace-executor/src/language-server/workspace-solutions.ts +2 -2
- package/packages/workspace-executor/src/managed-process.ts +35 -7
- package/packages/workspace-executor/src/module.ts +8 -8
- package/packages/workspace-executor/src/modules.ts +3 -3
- package/packages/workspace-executor/src/paths.ts +11 -11
- package/packages/workspace-executor/src/process-sandbox.ts +3 -3
- package/packages/workspace-executor/src/processes/module.ts +3 -3
- package/packages/workspace-executor/src/processes/process-table.ts +20 -20
- package/packages/workspace-executor/src/processes/scanner.ts +3 -3
- package/packages/workspace-executor/src/processes/snapshot.ts +2 -2
- package/packages/workspace-executor/src/processes/terminator.ts +13 -13
- package/packages/workspace-executor/src/run-folders.ts +3 -3
- package/packages/workspace-executor/src/safe-environment.ts +4 -4
- package/packages/workspace-executor/src/sandbox-tools.ts +37 -31
- package/packages/workspace-executor/src/session-ident.ts +2 -2
- package/packages/workspace-executor/src/shell-platform.ts +2 -2
- package/packages/workspace-executor/src/tools.ts +5 -5
- package/plugins/ragents.activity/web/ActivityHeader.tsx +3 -3
- package/plugins/ragents.activity/web/activity.ts +2 -2
- package/plugins/ragents.actor-programs/server/access-projections.ts +31 -0
- package/plugins/ragents.actor-programs/server/agent-tools.ts +2 -2
- package/plugins/ragents.actor-programs/server/capability-resolver.ts +3 -3
- package/plugins/ragents.actor-programs/server/controls-template.ts +46 -46
- package/plugins/ragents.actor-programs/server/controls-tool.ts +4 -4
- package/plugins/ragents.actor-programs/server/index.ts +2 -0
- package/plugins/ragents.actor-programs/server/limits.ts +3 -3
- package/plugins/ragents.actor-programs/server/methods.ts +1 -1
- package/plugins/ragents.actor-programs/server/project-diagnostics.ts +8 -8
- package/plugins/ragents.actor-programs/server/routes.ts +8 -8
- package/plugins/ragents.actor-programs/server/runtime.ts +90 -90
- package/plugins/ragents.actor-programs/server/templates.ts +59 -59
- package/plugins/ragents.actor-programs/server/test-report.ts +5 -5
- package/plugins/ragents.actor-programs/server/tool-contributor.ts +1 -1
- package/plugins/ragents.actor-programs/web/ActorViewFrame.tsx +17 -17
- package/plugins/ragents.actor-programs/web/AppsPanel.tsx +26 -26
- package/plugins/ragents.actor-programs/web/EmbeddedApps.tsx +3 -3
- package/plugins/ragents.actor-programs/web/FullscreenHost.tsx +2 -2
- package/plugins/ragents.actor-programs/web/FunctionForm.tsx +16 -16
- package/plugins/ragents.actor-programs/web/ProgramSource.tsx +5 -5
- package/plugins/ragents.actor-programs/web/api.ts +36 -36
- package/plugins/ragents.actor-programs/web/bridge.ts +8 -8
- package/plugins/ragents.actor-programs/web/chat-state.ts +4 -4
- package/plugins/ragents.actor-programs/web/context.ts +1 -1
- package/plugins/ragents.actor-programs/web/function-input.ts +6 -6
- package/plugins/ragents.actor-programs/web/index.tsx +1 -1
- package/plugins/ragents.actor-programs/web/program-state.ts +4 -4
- package/plugins/ragents.ask/ask-payload.ts +1 -1
- package/plugins/ragents.ask/contract.ts +5 -5
- package/plugins/ragents.ask/server/answer-method.ts +1 -1
- package/plugins/ragents.ask/server/ask-service.ts +9 -9
- package/plugins/ragents.ask/server/ask-tool.ts +10 -10
- package/plugins/ragents.ask/server/contract.ts +5 -5
- package/plugins/ragents.ask/web/AskActionView.tsx +1 -1
- package/plugins/ragents.ask/web/QuestionCard.tsx +22 -22
- package/plugins/ragents.ask/web/index.tsx +2 -8
- package/plugins/ragents.browser/executor/contract.ts +6 -6
- package/plugins/ragents.browser/executor/index.ts +1 -1
- package/plugins/ragents.browser/executor/module.ts +6 -6
- package/plugins/ragents.browser/executor/pages.ts +32 -32
- package/plugins/ragents.browser/executor/playwright.ts +8 -8
- package/plugins/ragents.browser/provision.ts +7 -7
- package/plugins/ragents.browser/server/browser.ts +14 -14
- package/plugins/ragents.browser/server/contract.ts +1 -1
- package/plugins/ragents.browser/server/index.ts +1 -1
- package/plugins/ragents.browser/server/tools.ts +14 -14
- package/plugins/ragents.browser/skills/browser-testing/SKILL.md +30 -30
- package/plugins/ragents.documents/contract.ts +2 -2
- package/plugins/ragents.documents/prompt.hbs +1 -1
- package/plugins/ragents.documents/server/document-write-tool.ts +12 -12
- package/plugins/ragents.documents/server/files-route.ts +6 -6
- package/plugins/ragents.documents/server/show-document-tool.ts +26 -26
- package/plugins/ragents.documents/server/store.ts +1 -1
- package/plugins/ragents.documents/web/DocumentViewer.tsx +37 -37
- package/plugins/ragents.documents/web/index.tsx +11 -11
- package/plugins/ragents.lsp-fsharp/executor.ts +7 -7
- package/plugins/ragents.lsp-fsharp/provision.ts +7 -7
- package/plugins/ragents.lsp-roslyn/executor.ts +5 -5
- package/plugins/ragents.lsp-roslyn/provision.ts +4 -4
- package/plugins/ragents.lsp-roslyn/server/index.ts +5 -5
- package/plugins/ragents.lsp-roslyn/server/solution-on-start.ts +13 -13
- package/plugins/ragents.lsp-typescript/executor.ts +3 -3
- package/plugins/ragents.model-relay/server/config.ts +6 -2
- package/plugins/ragents.model-relay/server/index.ts +2 -2
- package/plugins/ragents.model-relay/server/relay.ts +23 -22
- package/plugins/ragents.orchestration/contract.ts +8 -8
- package/plugins/ragents.orchestration/server/index.ts +4 -4
- package/plugins/ragents.orchestration/server/run-stop-tool.ts +3 -3
- package/plugins/ragents.orchestration/server/surface-tool.ts +5 -5
- package/plugins/ragents.orchestration/tiled-layout.ts +11 -11
- package/plugins/ragents.orchestration/web/ActorChat.tsx +2 -2
- package/plugins/ragents.orchestration/web/ActorChatControls.tsx +4 -4
- package/plugins/ragents.orchestration/web/ActorChatPreview.tsx +1 -1
- package/plugins/ragents.orchestration/web/ActorPopout.tsx +1 -1
- package/plugins/ragents.orchestration/web/ActorShortcut.tsx +6 -6
- package/plugins/ragents.orchestration/web/ActorSurfaceControls.tsx +15 -15
- package/plugins/ragents.orchestration/web/ActorTile.tsx +1 -1
- package/plugins/ragents.orchestration/web/Center.tsx +5 -5
- package/plugins/ragents.orchestration/web/DocumentsSection.tsx +2 -2
- package/plugins/ragents.orchestration/web/ExecutionsPanel.tsx +15 -15
- package/plugins/ragents.orchestration/web/FlowInspector.tsx +103 -103
- package/plugins/ragents.orchestration/web/JournalStatus.tsx +11 -11
- package/plugins/ragents.orchestration/web/MaterialBody.tsx +2 -2
- package/plugins/ragents.orchestration/web/StopRunButton.tsx +6 -6
- package/plugins/ragents.orchestration/web/TiledSurface.tsx +9 -9
- package/plugins/ragents.orchestration/web/actor-header-settings.ts +5 -5
- package/plugins/ragents.orchestration/web/constants.ts +2 -2
- package/plugins/ragents.orchestration/web/executions.ts +6 -6
- package/plugins/ragents.orchestration/web/format.ts +1 -1
- package/plugins/ragents.orchestration/web/index.tsx +2 -2
- package/plugins/ragents.orchestration/web/run-panel/AddresseeControl.tsx +7 -7
- package/plugins/ragents.orchestration/web/run-panel/AddresseeTree.tsx +8 -8
- package/plugins/ragents.orchestration/web/run-panel/RunPanel.tsx +29 -28
- package/plugins/ragents.orchestration/web/run-panel/RunPanelSettings.tsx +7 -7
- package/plugins/ragents.orchestration/web/run-panel/addressee-tree.ts +13 -13
- package/plugins/ragents.orchestration/web/run-panel/run-panel-actors.ts +3 -3
- package/plugins/ragents.orchestration/web/run-panel/run-panel-settings.ts +2 -2
- package/plugins/ragents.orchestration/web/run-panel/run-panel-startup.ts +3 -3
- package/plugins/ragents.orchestration/web/run-panel/run-panel-state.ts +7 -7
- package/plugins/ragents.orchestration/web/run-panel/sheet-status.ts +10 -10
- package/plugins/ragents.orchestration/web/surface-startup.ts +8 -8
- package/plugins/ragents.orchestration/web/surface-view-settings.ts +1 -1
- package/plugins/ragents.orchestration/web/tiled-view-settings.ts +1 -1
- package/plugins/ragents.overseer/contract.ts +20 -20
- package/plugins/ragents.overseer/server/api.ts +8 -8
- package/plugins/ragents.overseer/server/coordinator-prompt.ts +10 -10
- package/plugins/ragents.overseer/server/coordinator.ts +4 -4
- package/plugins/ragents.overseer/server/index.ts +24 -24
- package/plugins/ragents.overseer/server/orientation.ts +8 -8
- package/plugins/ragents.overseer/server/quick-answer.ts +9 -9
- package/plugins/ragents.overseer/server/run-directory.ts +5 -5
- package/plugins/ragents.overseer/server/settings.ts +6 -6
- package/plugins/ragents.overseer/server/user-location.ts +16 -16
- package/plugins/ragents.overseer/web/ModelSettings.tsx +9 -9
- package/plugins/ragents.overseer/web/index.tsx +20 -20
- package/plugins/ragents.overseer/web/model-settings.ts +1 -1
- package/plugins/ragents.overseer/web/quick-answers.ts +2 -2
- package/plugins/ragents.processes/contract.ts +5 -5
- package/plugins/ragents.processes/server/methods.ts +4 -4
- package/plugins/ragents.processes/server/observer.ts +8 -8
- package/plugins/ragents.processes/server/run-processes.ts +2 -2
- package/plugins/ragents.processes/web/ProcessHeader.tsx +10 -10
- package/plugins/ragents.processes/web/processes.ts +10 -10
- package/plugins/ragents.product/server/config.ts +1 -1
- package/plugins/ragents.product/server/index.ts +4 -4
- package/plugins/ragents.product/server/runtime.ts +9 -10
- package/plugins/ragents.product/web/index.tsx +1 -1
- package/plugins/ragents.profile-distribution/contract.ts +10 -10
- package/plugins/ragents.profile-distribution/server/archive.ts +20 -20
- package/plugins/ragents.profile-distribution/server/config.ts +2 -2
- package/plugins/ragents.profile-distribution/server/index.ts +4 -4
- package/plugins/ragents.reference/examples.ts +27 -27
- package/plugins/ragents.reference/run-scripts/balcony-wizard/RUN.md +19 -19
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/package.json +2 -2
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/client.tsx +14 -14
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/src/conversation.ts +2 -2
- package/plugins/ragents.reference/run-scripts/balcony-wizard/actors/balcony-app/tests/conversation.test.ts +49 -49
- package/plugins/ragents.reference/run-scripts/balcony-wizard/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/balcony-wizard/src/server.ts +9 -9
- package/plugins/ragents.reference/run-scripts/balcony-wizard/tests/program.test.ts +9 -9
- package/plugins/ragents.reference/run-scripts/conversation-circle/RUN.md +7 -7
- package/plugins/ragents.reference/run-scripts/conversation-circle/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/conversation-circle/src/server.ts +13 -13
- package/plugins/ragents.reference/run-scripts/conversation-circle/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/conversation-circle/tests/program.test.ts +8 -8
- package/plugins/ragents.reference/run-scripts/learning-afternoon/RUN.md +16 -16
- package/plugins/ragents.reference/run-scripts/learning-afternoon/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/experiment.md +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/helper.md +3 -3
- package/plugins/ragents.reference/run-scripts/learning-afternoon/prompts/quiz.md +1 -1
- package/plugins/ragents.reference/run-scripts/learning-afternoon/src/server.ts +9 -9
- package/plugins/ragents.reference/run-scripts/learning-afternoon/tests/program.test.ts +39 -39
- package/plugins/ragents.reference/run-scripts/moderated-round/RUN.md +7 -7
- package/plugins/ragents.reference/run-scripts/moderated-round/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/moderated-round/src/server.ts +9 -9
- package/plugins/ragents.reference/run-scripts/moderated-round/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/moderated-round/tests/program.test.ts +6 -6
- package/plugins/ragents.reference/run-scripts/shared-actor-list/RUN.md +12 -12
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/package.json +2 -2
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/src/contract.ts +3 -3
- package/plugins/ragents.reference/run-scripts/shared-actor-list/actors/shared-list/tests/program.test.ts +4 -4
- package/plugins/ragents.reference/run-scripts/shared-actor-list/package.json +1 -1
- package/plugins/ragents.reference/run-scripts/shared-actor-list/src/server.ts +11 -11
- package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/helpers.ts +1 -1
- package/plugins/ragents.reference/run-scripts/shared-actor-list/tests/program.test.ts +13 -13
- package/plugins/ragents.reference/run-scripts/word-game/RUN.md +18 -18
- package/plugins/ragents.reference/run-scripts/word-game/package.json +2 -2
- package/plugins/ragents.reference/run-scripts/word-game/src/client.tsx +1 -1
- package/plugins/ragents.reference/run-scripts/word-game/src/contract.ts +2 -2
- package/plugins/ragents.reference/run-scripts/word-game/src/server.ts +16 -16
- package/plugins/ragents.reference/run-scripts/word-game/tests/program.test.ts +39 -39
- package/plugins/ragents.reference/skills/100-shared-actor-list/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/110-all-card-slots/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/150-editorial-workbench/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/160-learning-companion/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/170-photo-collection/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/180-decision-workbench/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/190-review-queue/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/20-circle-of-four/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/200-typescript-diagnostics/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/210-moderator-handover/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/220-actor-approval-list/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/230-shared-state-views/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/240-live-result-list/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/250-balcony-wizard/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/30-llm-without-runtime-knowledge/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/35-actor-input-fifo/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/40-subscription-matrix/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/50-subscription-removal/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/60-stop-in-the-circle/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/65-artifact-least-privilege/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/70-headless-counter/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/75-lsp-demo/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/80-actor-text-analysis/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/90-actor-notes/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/95-hello-world/SKILL.md +5 -5
- package/plugins/ragents.reference/skills/decision-brief/SKILL.md +24 -24
- package/plugins/ragents.reference/skills/learning-sprint/SKILL.md +24 -24
- package/plugins/ragents.reference/walkthroughs.ts +128 -128
- package/plugins/ragents.reference/web/StartGuides.tsx +23 -23
- package/plugins/ragents.todo/server/todo-tool.ts +6 -6
- package/plugins/ragents.todo/web/TodoSection.tsx +1 -1
- package/plugins/ragents.transcript/server/transcript.ts +11 -11
- package/plugins/ragents.watch/server/condition.ts +4 -4
- package/plugins/ragents.watch/server/functions.ts +27 -27
- package/plugins/ragents.watch/server/observation.ts +2 -2
- package/plugins/ragents.watch/server/service.ts +14 -14
- package/plugins/ragents.workspace/client/transport.ts +1 -1
- package/plugins/ragents.workspace/client/workspace-client.ts +62 -49
- package/plugins/ragents.workspace/contract.ts +46 -46
- package/plugins/ragents.workspace/server/binding.ts +20 -20
- package/plugins/ragents.workspace/server/browse-route.ts +8 -8
- package/plugins/ragents.workspace/server/clients.ts +42 -42
- package/plugins/ragents.workspace/server/config.ts +8 -5
- package/plugins/ragents.workspace/server/index.ts +5 -4
- package/plugins/ragents.workspace/server/runtime.ts +26 -26
- package/plugins/ragents.workspace/server/shell-platform.ts +1 -1
- package/plugins/ragents.workspace/web/FileBrowser.tsx +10 -10
- package/plugins/ragents.workspace/web/WorkspaceBinding.tsx +24 -24
- package/plugins/ragents.workspace/web/index.tsx +1 -1
- package/ragents.config.core.ts +1 -1
- package/ragents.config.developer.ts +3 -3
- package/ragents.config.showcase.ts +2 -2
- package/scripts/agent/agent-cli.ts +96 -96
- package/scripts/agent/journal.ts +5 -5
- package/scripts/agent/turn-control.ts +4 -4
- package/scripts/package/build-package.ts +29 -29
- package/scripts/package/host-links.mjs +3 -3
- package/scripts/package/publish-package.ts +29 -29
- package/scripts/package/ragents.mjs +19 -19
- package/scripts/plugin/build-builtin-plugins.ts +5 -5
- package/scripts/plugin/plugin-cli.ts +14 -14
- package/scripts/provision/run-provision.ts +14 -15
- package/scripts/remote/connect.ts +46 -46
- package/scripts/remote/start.ts +18 -18
- package/scripts/workspace-client/run-workspace-client.ts +23 -23
- package/apps/web/dist/assets/main-C7JeZFjs.js +0 -6
- package/apps/web/dist/assets/mermaid-HWGCJPDP-DfsU5ofC.js +0 -478
- package/apps/web/dist/assets/runPanel-ZT6TPDLM.js +0 -21
- package/bundles/ragents.ask/server/chunks/chunk-PDJO75SQ.js.map +0 -7
- package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js +0 -2
- package/bundles/ragents.ask/web/chunks/chunk-4VXWWEG7.js.map +0 -7
- package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js +0 -2
- package/bundles/ragents.ask/web/chunks/chunk-VUBJDIKQ.js.map +0 -7
- package/bundles/ragents.ask/web/chunks/chunk-WFN4374U.js.map +0 -7
- package/bundles/ragents.orchestration/web/chunks/chunk-OQYCNYXN.js +0 -2
- package/plugins/ragents.ask/web/QuestionSection.tsx +0 -48
- /package/bundles/ragents.orchestration/web/chunks/{chunk-OSKPH6SZ.js.map → chunk-CFMJD5ZI.js.map} +0 -0
- /package/bundles/ragents.orchestration/web/chunks/{chunk-ODMMQGX2.js.map → chunk-UCIMT2R4.js.map} +0 -0
|
@@ -55,7 +55,7 @@ const NEW_FILE_AGE_MS = 10_000;
|
|
|
55
55
|
const uriOf = (absolutePath: string): string => pathToFileURL(absolutePath).href;
|
|
56
56
|
|
|
57
57
|
const timeoutError = (label: string, what: string, timeoutMs: number): Error =>
|
|
58
|
-
new Error(`${label}: ${what}
|
|
58
|
+
new Error(`${label}: ${what} not within ${Math.round(timeoutMs / 1000)} s`);
|
|
59
59
|
|
|
60
60
|
export const withTimeout = <T>(promise: Promise<T>, timeoutMs: number, error: () => Error): Promise<T> =>
|
|
61
61
|
new Promise((resolve, reject) => {
|
|
@@ -108,14 +108,14 @@ export class LanguageServerSession {
|
|
|
108
108
|
onStderr: (chunk) => {
|
|
109
109
|
this.#stderr = (this.#stderr + chunk.toString("utf8")).slice(-STDERR_TAIL);
|
|
110
110
|
},
|
|
111
|
-
onExit: (code) => this.#ended(`
|
|
111
|
+
onExit: (code) => this.#ended(`code ${code ?? "signal"}`),
|
|
112
112
|
onError: (error) => {
|
|
113
113
|
this.#service.kill("SIGKILL");
|
|
114
|
-
this.#ended(`
|
|
114
|
+
this.#ended(`error: ${error.message}`);
|
|
115
115
|
},
|
|
116
116
|
});
|
|
117
117
|
const output = this.#service.stdin;
|
|
118
|
-
if (!output) throw new Error(`${launch.label}:
|
|
118
|
+
if (!output) throw new Error(`${launch.label}: standard input is missing`);
|
|
119
119
|
this.#connection = new JsonRpcConnection({
|
|
120
120
|
label: launch.label,
|
|
121
121
|
input: this.#input,
|
|
@@ -161,7 +161,7 @@ export class LanguageServerSession {
|
|
|
161
161
|
},
|
|
162
162
|
}),
|
|
163
163
|
timeoutMs,
|
|
164
|
-
() => timeoutError(launch.label, "
|
|
164
|
+
() => timeoutError(launch.label, "initialized", timeoutMs),
|
|
165
165
|
) as { capabilities?: Record<string, unknown> };
|
|
166
166
|
session.#serverCapabilities = result.capabilities ?? {};
|
|
167
167
|
session.#connection.notify("initialized", {});
|
|
@@ -201,7 +201,7 @@ export class LanguageServerSession {
|
|
|
201
201
|
return withTimeout(
|
|
202
202
|
new Promise<unknown>((resolve, reject) => {
|
|
203
203
|
if (this.#exitReason !== undefined) {
|
|
204
|
-
reject(new Error(`${this.label}
|
|
204
|
+
reject(new Error(`${this.label} is no longer running (${this.#exitReason})${this.#stderrHint()}`));
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
const onExit = (error: Error) => {
|
|
@@ -226,7 +226,7 @@ export class LanguageServerSession {
|
|
|
226
226
|
this.#assertRunning();
|
|
227
227
|
const extension = path.extname(absolutePath).toLowerCase();
|
|
228
228
|
const languageId = this.#launch.languages[extension];
|
|
229
|
-
if (!languageId) throw new Error(`${this.label}
|
|
229
|
+
if (!languageId) throw new Error(`${this.label} does not know the extension ${extension || "(none)"}`);
|
|
230
230
|
const uri = uriOf(absolutePath);
|
|
231
231
|
const text = await readFile(absolutePath, "utf8");
|
|
232
232
|
const settleMs = this.#launch.newFileSettleMs;
|
|
@@ -257,16 +257,16 @@ export class LanguageServerSession {
|
|
|
257
257
|
await withTimeout(
|
|
258
258
|
this.#connection.request("shutdown", null),
|
|
259
259
|
SHUTDOWN_TIMEOUT_MS,
|
|
260
|
-
() => timeoutError(this.label, "shutdown
|
|
260
|
+
() => timeoutError(this.label, "shutdown answered", SHUTDOWN_TIMEOUT_MS),
|
|
261
261
|
);
|
|
262
262
|
this.#connection.notify("exit", null);
|
|
263
263
|
} catch {
|
|
264
264
|
}
|
|
265
|
-
await withTimeout(this.#service.finished, SHUTDOWN_TIMEOUT_MS, () => new Error("
|
|
265
|
+
await withTimeout(this.#service.finished, SHUTDOWN_TIMEOUT_MS, () => new Error("continue")).catch(() => {
|
|
266
266
|
this.#service.kill("SIGKILL");
|
|
267
267
|
});
|
|
268
268
|
await this.#service.finished.catch(() => undefined);
|
|
269
|
-
this.#connection.close(new Error(`${this.label}
|
|
269
|
+
this.#connection.close(new Error(`${this.label} was ended`));
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
async #isYoung(absolutePath: string): Promise<boolean> {
|
|
@@ -277,7 +277,7 @@ export class LanguageServerSession {
|
|
|
277
277
|
#ended(reason: string): void {
|
|
278
278
|
if (this.#exitReason !== undefined) return;
|
|
279
279
|
this.#exitReason = reason;
|
|
280
|
-
const error = new Error(`${this.label}
|
|
280
|
+
const error = new Error(`${this.label} was ended (${reason})${this.#stderrHint()}`);
|
|
281
281
|
this.#connection.close(error);
|
|
282
282
|
this.#input.destroy();
|
|
283
283
|
for (const listener of [...this.#exitListeners]) listener(error);
|
|
@@ -296,7 +296,7 @@ export class LanguageServerSession {
|
|
|
296
296
|
|
|
297
297
|
#assertRunning(): void {
|
|
298
298
|
if (this.#exitReason !== undefined) {
|
|
299
|
-
throw new Error(`${this.label}
|
|
299
|
+
throw new Error(`${this.label} is no longer running (${this.#exitReason})${this.#stderrHint()}`);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
|
|
@@ -345,7 +345,7 @@ export class LanguageServerSession {
|
|
|
345
345
|
...(identifier === undefined ? {} : { identifier }),
|
|
346
346
|
}),
|
|
347
347
|
Math.max(1, deadline - Date.now()),
|
|
348
|
-
() => timeoutError(this.label, "
|
|
348
|
+
() => timeoutError(this.label, "diagnostics delivered", timeoutMs),
|
|
349
349
|
) as { kind?: string; items?: Diagnostic[] } | null;
|
|
350
350
|
return result?.items ?? [];
|
|
351
351
|
} catch (error) {
|
|
@@ -370,7 +370,7 @@ export class LanguageServerSession {
|
|
|
370
370
|
entry !== undefined && entry.receivedAt >= closedAt;
|
|
371
371
|
if (!confirmed(this.#published.get(uri)) && !await this.#waitForPublish(uri, confirmed, CLOSE_PUBLISH_TIMEOUT_MS)) {
|
|
372
372
|
this.#assertRunning();
|
|
373
|
-
throw timeoutError(this.label, "didClose
|
|
373
|
+
throw timeoutError(this.label, "didClose confirmed", CLOSE_PUBLISH_TIMEOUT_MS);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
|
|
@@ -401,7 +401,7 @@ export class LanguageServerSession {
|
|
|
401
401
|
entry !== undefined && entry.receivedAt >= sentAt && (entry.version === undefined || entry.version >= version);
|
|
402
402
|
if (!matches(this.#published.get(uri)) && !await this.#waitForPublish(uri, matches, timeoutMs)) {
|
|
403
403
|
this.#assertRunning();
|
|
404
|
-
throw timeoutError(this.label, "
|
|
404
|
+
throw timeoutError(this.label, "diagnostics delivered", timeoutMs);
|
|
405
405
|
}
|
|
406
406
|
const settleDeadline = Date.now() + SETTLE_LIMIT_MS;
|
|
407
407
|
while (Date.now() < settleDeadline && await this.#waitForPublish(uri, matches, SETTLE_MS)) continue;
|
|
@@ -52,7 +52,7 @@ const gitSolutions = async (context: WorkspaceProcessContext, extensions: readon
|
|
|
52
52
|
"ls-files", "-z", "--cached", "--others", "--exclude-standard", "--",
|
|
53
53
|
...extensions.map((extension) => `:(icase)*${extension}`),
|
|
54
54
|
]);
|
|
55
|
-
if (listed.code !== 0) throw new Error(`git ls-files
|
|
55
|
+
if (listed.code !== 0) throw new Error(`git ls-files failed with code ${listed.code}`);
|
|
56
56
|
return listed.output.split("\0").filter(Boolean);
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -70,7 +70,7 @@ const directorySolutions = async (root: string, extensions: readonly string[], r
|
|
|
70
70
|
return nested.flat();
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
/**
|
|
73
|
+
/** Without a Git working directory it searches the folder itself, six levels deep and without hidden folders. */
|
|
74
74
|
export const workspaceSolutions = async (
|
|
75
75
|
context: WorkspaceProcessContext,
|
|
76
76
|
extensions: readonly string[],
|
|
@@ -2,6 +2,7 @@ import { execFile, spawn, type ChildProcess } from "node:child_process";
|
|
|
2
2
|
import { readdir, readFile } from "node:fs/promises";
|
|
3
3
|
import type { Writable } from "node:stream";
|
|
4
4
|
import { killProcessTree } from "@ragents/agent";
|
|
5
|
+
import { bashLaunch } from "./bash-launch.js";
|
|
5
6
|
|
|
6
7
|
const PROCESS_GROUP_JOIN_TIMEOUT_MS = 5_000;
|
|
7
8
|
const PROCESS_GROUP_POLL_MS = 25;
|
|
@@ -72,11 +73,38 @@ export const processExists = (pid: number): boolean => {
|
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
/** Windows
|
|
76
|
+
/** Windows knows no process group and no SIGKILL: the tree goes through taskkill /T /F, and without a promise to wait. */
|
|
76
77
|
export const stopProcessTree = (pid: number): void => {
|
|
77
78
|
if (processExists(pid)) killProcessTree(pid);
|
|
78
79
|
};
|
|
79
80
|
|
|
81
|
+
/** Marks the processes of a bash call on Windows: MSYS does not attach the children of the bash to its Windows process tree, so taskkill /T does not reach them. */
|
|
82
|
+
export const MSYS_CALL_ENV = "RAGENTS_BASH_CALL";
|
|
83
|
+
|
|
84
|
+
/** The Windows ids of all MSYS processes in the process groups in which a process carries the marker, even after the bash itself has ended. */
|
|
85
|
+
const msysGroupScript = (marker: string): string => [
|
|
86
|
+
"groups=' '",
|
|
87
|
+
`for d in /proc/[0-9]*; do tr '\\0' '\\n' < "$d/environ" 2>/dev/null | grep -qxF '${MSYS_CALL_ENV}=${marker}' && groups="$groups$(cat "$d/pgid") "; done`,
|
|
88
|
+
`for d in /proc/[0-9]*; do case "$groups" in *" $(cat "$d/pgid" 2>/dev/null) "*) cat "$d/winpid" 2>/dev/null;; esac; done`,
|
|
89
|
+
].join("\n");
|
|
90
|
+
|
|
91
|
+
const execFileText = (file: string, args: readonly string[], env?: NodeJS.ProcessEnv): Promise<{ stdout: string; error: Error | null }> =>
|
|
92
|
+
new Promise((resolve) => {
|
|
93
|
+
execFile(file, [...args], { env, windowsHide: true, timeout: 15_000 }, (error, stdout) => resolve({ stdout, error }));
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
/** Ends on Windows everything that a bash call with this marker started, including the native trees below it. */
|
|
97
|
+
export const stopMsysCall = async (bash: string, env: NodeJS.ProcessEnv, marker: string): Promise<void> => {
|
|
98
|
+
const launch = bashLaunch({ bash, rg: undefined }, msysGroupScript(marker), env, "win32");
|
|
99
|
+
const listing = await execFileText(launch.command, launch.args, launch.env);
|
|
100
|
+
if (listing.error) throw new Error(`The processes of the bash call could not be determined: ${listing.error.message}`);
|
|
101
|
+
const winpids = [...new Set(listing.stdout.split(/\s+/).filter((pid) => /^\d+$/.test(pid)))];
|
|
102
|
+
if (winpids.length === 0) return;
|
|
103
|
+
await execFileText("taskkill", ["/F", "/T", ...winpids.flatMap((pid) => ["/PID", pid])]);
|
|
104
|
+
const alive = winpids.filter((pid) => processExists(Number(pid)));
|
|
105
|
+
if (alive.length > 0) throw new Error(`The processes ${alive.join(", ")} of the bash call keep running after taskkill`);
|
|
106
|
+
};
|
|
107
|
+
|
|
80
108
|
const darwinProcessGroupExists = (pid: number): Promise<boolean> =>
|
|
81
109
|
new Promise((resolve, reject) => {
|
|
82
110
|
execFile("/bin/ps", ["-axo", "pgid=,stat="], { timeout: 5_000, maxBuffer: 4 * 1024 * 1024 }, (error, stdout) => {
|
|
@@ -86,7 +114,7 @@ const darwinProcessGroupExists = (pid: number): Promise<boolean> =>
|
|
|
86
114
|
}
|
|
87
115
|
const rows = stdout.split("\n").map((line) => /^\s*(\d+)\s*(\S*)\s*$/.exec(line)).filter((row) => row !== null);
|
|
88
116
|
if (rows.length === 0) {
|
|
89
|
-
reject(new Error(`macOS
|
|
117
|
+
reject(new Error(`macOS process group ${pid}: invalid process list: ${stdout.slice(0, 200)}`));
|
|
90
118
|
return;
|
|
91
119
|
}
|
|
92
120
|
resolve(rows.some((row) => Number(row[1]) === pid && !row[2].startsWith("Z")));
|
|
@@ -164,7 +192,7 @@ const joinProcessGroup = async (
|
|
|
164
192
|
while (await processGroupExists(pid)) {
|
|
165
193
|
if (Date.now() >= deadline) {
|
|
166
194
|
throw new ProcessGroupJoinError(
|
|
167
|
-
`${label}:
|
|
195
|
+
`${label}: process group ${pid} could not be ended`,
|
|
168
196
|
);
|
|
169
197
|
}
|
|
170
198
|
await new Promise<void>((finish) => setTimeout(finish, PROCESS_GROUP_POLL_MS));
|
|
@@ -173,7 +201,7 @@ const joinProcessGroup = async (
|
|
|
173
201
|
if (error instanceof ProcessGroupJoinError) throw error;
|
|
174
202
|
const detail = error instanceof Error ? error.message : String(error);
|
|
175
203
|
throw new ProcessGroupJoinError(
|
|
176
|
-
`${label}:
|
|
204
|
+
`${label}: process group ${pid} could not be checked: ${detail}`,
|
|
177
205
|
);
|
|
178
206
|
}
|
|
179
207
|
};
|
|
@@ -184,7 +212,7 @@ export const runManagedProcess = (options: ManagedProcessOptions): Promise<Manag
|
|
|
184
212
|
const reason = options.signal?.reason;
|
|
185
213
|
return reason instanceof Error
|
|
186
214
|
? reason
|
|
187
|
-
: new Error(`${options.label}
|
|
215
|
+
: new Error(`${options.label} was cancelled`);
|
|
188
216
|
};
|
|
189
217
|
if (options.signal?.aborted) {
|
|
190
218
|
reject(abortError());
|
|
@@ -219,7 +247,7 @@ export const runManagedProcess = (options: ManagedProcessOptions): Promise<Manag
|
|
|
219
247
|
terminationTimer = setTimeout(() => {
|
|
220
248
|
sendSignal("SIGKILL");
|
|
221
249
|
processError ??= new ProcessGroupJoinError(
|
|
222
|
-
`${options.label}:
|
|
250
|
+
`${options.label}: process group ${pid ?? "unknown"} exceeded the termination grace period`,
|
|
223
251
|
);
|
|
224
252
|
child.stdout?.destroy();
|
|
225
253
|
child.stderr?.destroy();
|
|
@@ -322,7 +350,7 @@ export const startManagedService = (options: ManagedServiceOptions): ManagedServ
|
|
|
322
350
|
finished,
|
|
323
351
|
exited: () => exited,
|
|
324
352
|
send: (message) => new Promise<void>((resolve, reject) => {
|
|
325
|
-
if (!child.connected) return reject(new Error(`${options.label}: IPC
|
|
353
|
+
if (!child.connected) return reject(new Error(`${options.label}: IPC connection is closed`));
|
|
326
354
|
child.send(message as import("node:child_process").Serializable, (error) => error ? reject(error) : resolve());
|
|
327
355
|
}),
|
|
328
356
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import type { WorkspaceProcessContext } from "./context.js";
|
|
2
2
|
import type { OperationFootprint } from "./paths.js";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/** A call of an operation: the run, the input and what the caller passes along. */
|
|
5
5
|
export interface WorkspaceOperationCall {
|
|
6
6
|
readonly runId: string;
|
|
7
7
|
readonly input: unknown;
|
|
8
8
|
readonly toolCallId: string | undefined;
|
|
9
9
|
readonly signal: AbortSignal | undefined;
|
|
10
|
-
/**
|
|
10
|
+
/** Reports a JSON value as progress; missing if the caller wants no progress. */
|
|
11
11
|
readonly progress: ((value: unknown) => void) | undefined;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export type WorkspaceOperation = (call: WorkspaceOperationCall) => Promise<unknown>;
|
|
15
15
|
|
|
16
|
-
/**
|
|
16
|
+
/** A building block of the executor: named operations and its share of the cleanup. */
|
|
17
17
|
export interface WorkspaceExecutorModule {
|
|
18
18
|
readonly operations: Readonly<Record<string, WorkspaceOperation>>;
|
|
19
|
-
/**
|
|
19
|
+
/** The footprint of an input per operation; without an entry it addresses no specific root. Never throws, not even for invalid input. */
|
|
20
20
|
readonly footprints?: Readonly<Record<string, (input: unknown) => OperationFootprint>>;
|
|
21
|
-
/**
|
|
21
|
+
/** An annotation for a file just written, such as the diagnostics of a language server. */
|
|
22
22
|
readonly annotate?: (runId: string, absolutePath: string) => Promise<string | undefined>;
|
|
23
|
-
/**
|
|
23
|
+
/** Releases what the module holds for a run. */
|
|
24
24
|
readonly stopRun?: (runId: string) => Promise<void>;
|
|
25
|
-
/**
|
|
25
|
+
/** Releases everything; afterwards nobody calls the module anymore, it may reject later calls with a cause. */
|
|
26
26
|
readonly shutdown?: () => Promise<void>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/**
|
|
29
|
+
/** What a module gets from the executor: the context of a run on this machine and the annotations of all modules. */
|
|
30
30
|
export interface WorkspaceModuleHost {
|
|
31
31
|
readonly contextFor: (runId: string) => Promise<WorkspaceProcessContext>;
|
|
32
32
|
readonly annotate: (runId: string, absolutePath: string) => Promise<string | undefined>;
|
|
@@ -8,13 +8,13 @@ import { runFolderModule } from "./run-folders.js";
|
|
|
8
8
|
import { sandboxToolsModule } from "./sandbox-tools.js";
|
|
9
9
|
|
|
10
10
|
export interface WorkspaceExecutorModuleOptions {
|
|
11
|
-
/**
|
|
11
|
+
/** The new folder of a run on this machine; only a workspace knows it, on the server the host creates it. */
|
|
12
12
|
runFolder?: (runId: string) => string;
|
|
13
|
-
/**
|
|
13
|
+
/** The contributions of the plugins, built for this machine; server and workspace get the same ones. */
|
|
14
14
|
contributions: readonly WorkspaceExecutorParts[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/** The modules of an executor: its own and what the contributions of the plugins add. */
|
|
18
18
|
export const workspaceExecutorModules = (options: WorkspaceExecutorModuleOptions): readonly WorkspaceModuleFactory[] => [
|
|
19
19
|
sandboxToolsModule,
|
|
20
20
|
languageServerModule(options.contributions.flatMap((parts) => parts.languageServers ?? [])),
|
|
@@ -4,12 +4,12 @@ import { WorkspaceOperationError } from "./errors.js";
|
|
|
4
4
|
|
|
5
5
|
export interface ResolvedWorkspaceRoot {
|
|
6
6
|
directory: string;
|
|
7
|
-
/** `@name`,
|
|
7
|
+
/** `@name`, for a root under a shared alias `@name/<folder>`. */
|
|
8
8
|
alias?: string;
|
|
9
9
|
environmentVariable?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/**
|
|
12
|
+
/** Which roots the input of an operation addresses: the aliases of additional roots and whether a path without an alias names the root of the run. */
|
|
13
13
|
export interface AddressedRoots {
|
|
14
14
|
readonly aliases: readonly string[];
|
|
15
15
|
readonly runRoot: boolean;
|
|
@@ -17,17 +17,17 @@ export interface AddressedRoots {
|
|
|
17
17
|
|
|
18
18
|
export const NO_ROOTS: AddressedRoots = { aliases: [], runRoot: false };
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/** What a caller must know about an input without knowing its shape: the roots it addresses and the running time it requires itself. */
|
|
21
21
|
export interface OperationFootprint {
|
|
22
22
|
readonly roots: AddressedRoots;
|
|
23
23
|
readonly durationMs?: number;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
26
|
+
/** The alias a path starts with is its first segment, if that starts with @. */
|
|
27
27
|
export const aliasOf = (location: string): string | undefined =>
|
|
28
28
|
location.startsWith("@") ? location.split("/")[0] : undefined;
|
|
29
29
|
|
|
30
|
-
/**
|
|
30
|
+
/** The roots that fields of an input name as paths, a list with every entry: a path with an alias its root, every other one the root of the run. */
|
|
31
31
|
export const rootsOfFields = (input: unknown, ...keys: readonly string[]): AddressedRoots => {
|
|
32
32
|
const fields: Readonly<Record<string, unknown>> = typeof input === "object" && input !== null ? input as Record<string, unknown> : {};
|
|
33
33
|
const named = keys.flatMap((key) => [fields[key]].flat()).filter((entry): entry is string => typeof entry === "string");
|
|
@@ -35,7 +35,7 @@ export const rootsOfFields = (input: unknown, ...keys: readonly string[]): Addre
|
|
|
35
35
|
return { aliases: [...new Set(aliases)], runRoot: named.some((entry) => aliasOf(entry) === undefined) };
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
/**
|
|
38
|
+
/** The root that a path with an alias names, and the rest below it; without a matching alias none. */
|
|
39
39
|
export const aliasedRoot = (
|
|
40
40
|
requested: string,
|
|
41
41
|
aliases: Readonly<Record<string, string>>,
|
|
@@ -44,14 +44,14 @@ export const aliasedRoot = (
|
|
|
44
44
|
return found && { directory: found[1], rest: requested.slice(found[0].length + 1) };
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
/**
|
|
47
|
+
/** For a shared alias like `@skills` also names the folder below it, because only both together determine a root. */
|
|
48
48
|
export const unknownAliasError = (requested: string, aliases: Readonly<Record<string, string>>): WorkspaceOperationError => {
|
|
49
49
|
const [first, second] = requested.split("/");
|
|
50
50
|
const known = Object.keys(aliases);
|
|
51
51
|
const named = second !== undefined && known.some((alias) => alias.startsWith(`${first}/`)) ? `${first}/${second}` : first;
|
|
52
52
|
return new WorkspaceOperationError(
|
|
53
53
|
"workspace-alias-unknown",
|
|
54
|
-
`
|
|
54
|
+
`Unknown working directory alias: ${named} (known: ${known.length > 0 ? known.join(", ") : "none"})`,
|
|
55
55
|
400,
|
|
56
56
|
);
|
|
57
57
|
};
|
|
@@ -72,7 +72,7 @@ export const resolvedWorkspacePath = async (filename: string): Promise<string> =
|
|
|
72
72
|
const code = (error as NodeJS.ErrnoException).code;
|
|
73
73
|
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
|
|
74
74
|
const info = await lstat(candidate).catch(() => undefined);
|
|
75
|
-
if (info?.isSymbolicLink()) throw new Error(`
|
|
75
|
+
if (info?.isSymbolicLink()) throw new Error(`Path outside the working directory: ${filename}`);
|
|
76
76
|
const parent = path.dirname(candidate);
|
|
77
77
|
if (parent === candidate) throw error;
|
|
78
78
|
rest.unshift(path.basename(candidate));
|
|
@@ -81,7 +81,7 @@ export const resolvedWorkspacePath = async (filename: string): Promise<string> =
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
/**
|
|
84
|
+
/** Whether the path lies in the root or is the root itself; also for a drive root like `/` or `C:\`. */
|
|
85
85
|
export const containsWorkspacePath = (root: string, filename: string): boolean => {
|
|
86
86
|
const relative = path.relative(root, filename);
|
|
87
87
|
return relative === "" || (relative !== ".." && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative));
|
|
@@ -90,6 +90,6 @@ export const containsWorkspacePath = (root: string, filename: string): boolean =
|
|
|
90
90
|
export const allowedWorkspacePath = async (filename: string, roots: readonly string[]): Promise<string> => {
|
|
91
91
|
const absolute = await resolvedWorkspacePath(filename);
|
|
92
92
|
const canonicalRoots = await Promise.all(roots.map(resolvedWorkspacePath));
|
|
93
|
-
if (!canonicalRoots.some((root) => containsWorkspacePath(root, absolute))) throw new Error(`
|
|
93
|
+
if (!canonicalRoots.some((root) => containsWorkspacePath(root, absolute))) throw new Error(`Path outside the working directory: ${filename}`);
|
|
94
94
|
return absolute;
|
|
95
95
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { WorkspaceProcessContext } from "./context.js";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/** A program with its arguments, as it is started. */
|
|
4
4
|
export interface ProcessLaunch {
|
|
5
5
|
readonly command: string;
|
|
6
6
|
readonly args: readonly string[];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/** How an executor puts the processes of a run into its sandbox; the context carries it, every start asks it. */
|
|
10
10
|
export interface ProcessSandbox {
|
|
11
11
|
readonly wrap: (launch: ProcessLaunch) => Promise<ProcessLaunch>;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/** The start of a process in the context of a run: wrapped with a sandbox, unchanged without one. */
|
|
15
15
|
export const sandboxedLaunch = (context: WorkspaceProcessContext, launch: ProcessLaunch): Promise<ProcessLaunch> =>
|
|
16
16
|
context.sandbox ? context.sandbox.wrap(launch) : Promise.resolve(launch);
|
|
@@ -11,17 +11,17 @@ export const PROCESS_OPERATIONS = {
|
|
|
11
11
|
} as const;
|
|
12
12
|
|
|
13
13
|
export interface ProcessModuleOptions {
|
|
14
|
-
/**
|
|
14
|
+
/** The process table of this machine; without a value the one of the platform, resolved only at the call. */
|
|
15
15
|
table?: () => ProcessTable;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const processIdOf = (input: unknown): string => {
|
|
19
19
|
const value = (input as { processId?: unknown } | null)?.processId;
|
|
20
|
-
if (typeof value !== "string") throw new WorkspaceOperationError("invalid-process", "
|
|
20
|
+
if (typeof value !== "string") throw new WorkspaceOperationError("invalid-process", "Invalid process reference", 400);
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
/**
|
|
24
|
+
/** The marked processes of a run on this machine; without a process table (Windows) the stop only clears the bash trees. */
|
|
25
25
|
export const processModule = (options: ProcessModuleOptions = {}): WorkspaceModuleFactory => () => {
|
|
26
26
|
const table = options.table ?? (() => processTableForPlatform());
|
|
27
27
|
const cleansUp = options.table !== undefined || hasProcessTable();
|
|
@@ -45,8 +45,8 @@ const runCommand = async (file: string, args: string[], toleratedExitCodes: read
|
|
|
45
45
|
} catch (error) {
|
|
46
46
|
const failure = error as Error & { code?: number | string; stdout?: string; stderr?: string };
|
|
47
47
|
if (typeof failure.code === "number" && toleratedExitCodes.includes(failure.code)) return failure.stdout ?? "";
|
|
48
|
-
if (failure.code === "ENOENT") throw new Error(`${file}
|
|
49
|
-
throw new Error(`${file} ${args[0]}
|
|
48
|
+
if (failure.code === "ENOENT") throw new Error(`${file} is not installed; the process monitor needs it`);
|
|
49
|
+
throw new Error(`${file} ${args[0]} failed: ${(failure.stderr || failure.message).trim()}`);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -59,7 +59,7 @@ const MARKER_TOKEN = new RegExp(`(?:^|\\s)${RUN_MARKER_ENV}=(\\S+)`);
|
|
|
59
59
|
|
|
60
60
|
export class ProcessChangedError extends Error {
|
|
61
61
|
constructor(readonly pid: number) {
|
|
62
|
-
super(`
|
|
62
|
+
super(`Process ${pid} changed during the environment query`);
|
|
63
63
|
this.name = "ProcessChangedError";
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -67,7 +67,7 @@ export class ProcessChangedError extends Error {
|
|
|
67
67
|
export const parseDarwinProcessTable = (text: string): ProcessRecord[] =>
|
|
68
68
|
text.split("\n").filter((line) => line.trim() !== "").map((line) => {
|
|
69
69
|
const match = DARWIN_TABLE_LINE.exec(line);
|
|
70
|
-
if (!match) throw new Error(`
|
|
70
|
+
if (!match) throw new Error(`Unreadable process line from ps: ${line}`);
|
|
71
71
|
return {
|
|
72
72
|
pid: Number(match[1]),
|
|
73
73
|
ppid: Number(match[2]),
|
|
@@ -126,7 +126,7 @@ export const parseLsofListeners = (text: string): Map<number, WorkspaceProcessPo
|
|
|
126
126
|
const darwinCommands = (text: string): Map<number, string> => new Map(text.split("\n")
|
|
127
127
|
.filter((line) => line.trim() !== "").map((line) => {
|
|
128
128
|
const match = /^\s*(\d+)\s+(.*)$/.exec(line);
|
|
129
|
-
if (!match) throw new Error("
|
|
129
|
+
if (!match) throw new Error("Unreadable command line from ps");
|
|
130
130
|
return [Number(match[1]), match[2]];
|
|
131
131
|
}));
|
|
132
132
|
|
|
@@ -191,7 +191,7 @@ const explainAccess = (error: unknown, pid: number, what: string): Error => {
|
|
|
191
191
|
const code = (error as NodeJS.ErrnoException).code;
|
|
192
192
|
if (code === "EACCES" || code === "EPERM") {
|
|
193
193
|
return new Error(
|
|
194
|
-
`${what}
|
|
194
|
+
`${what} of process ${pid} is not readable (${code}); as root the process monitor needs CAP_SYS_PTRACE`,
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
197
|
return error instanceof Error ? error : new Error(String(error));
|
|
@@ -209,7 +209,7 @@ export const parseLinuxStat = (text: string): LinuxStat => {
|
|
|
209
209
|
const open = text.indexOf("(");
|
|
210
210
|
const close = text.lastIndexOf(")");
|
|
211
211
|
const fields = open >= 0 && close > open ? text.slice(close + 2).trim().split(" ") : [];
|
|
212
|
-
if (fields.length < 20) throw new Error(`
|
|
212
|
+
if (fields.length < 20) throw new Error(`Unreadable stat line: ${text.trim()}`);
|
|
213
213
|
return {
|
|
214
214
|
comm: text.slice(open + 1, close),
|
|
215
215
|
state: fields[0],
|
|
@@ -260,7 +260,7 @@ export const addressFromHex = (hex: string): string => {
|
|
|
260
260
|
if (groups.every((group) => group === 0)) return WILDCARD;
|
|
261
261
|
return formatIpv6(groups);
|
|
262
262
|
}
|
|
263
|
-
throw new Error(`
|
|
263
|
+
throw new Error(`Unknown address form in /proc/net/tcp: ${hex}`);
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
export interface LinuxListener {
|
|
@@ -271,7 +271,7 @@ export interface LinuxListener {
|
|
|
271
271
|
export const parseLinuxTcpTable = (text: string): LinuxListener[] =>
|
|
272
272
|
text.split("\n").slice(1).filter((line) => line.trim() !== "").flatMap((line) => {
|
|
273
273
|
const fields = line.trim().split(/\s+/);
|
|
274
|
-
if (fields.length < 10) throw new Error(`
|
|
274
|
+
if (fields.length < 10) throw new Error(`Unreadable line in /proc/net/tcp: ${line.trim()}`);
|
|
275
275
|
if (fields[3] !== "0A") return [];
|
|
276
276
|
const [hexAddress, hexPort] = fields[1].split(":");
|
|
277
277
|
return [{ inode: fields[9], port: { port: parseInt(hexPort, 16), address: addressFromHex(hexAddress) } }];
|
|
@@ -297,7 +297,7 @@ const readLinuxRecord = async (proc: string, pid: number): Promise<ProcessRecord
|
|
|
297
297
|
const parsed = parseLinuxStat(stat);
|
|
298
298
|
if (parsed.state === "Z") return undefined;
|
|
299
299
|
const uid = Number(/^Uid:\s+(\d+)/m.exec(status)?.[1]);
|
|
300
|
-
if (!Number.isInteger(uid)) throw new Error(`${proc}/${pid}/status
|
|
300
|
+
if (!Number.isInteger(uid)) throw new Error(`${proc}/${pid}/status names no Uid`);
|
|
301
301
|
const args = cmdline.toString("utf8").split("\0").filter((argument) => argument !== "");
|
|
302
302
|
return {
|
|
303
303
|
pid,
|
|
@@ -315,7 +315,7 @@ const readLinuxMarker = async (proc: string, pid: number, asRoot: boolean): Prom
|
|
|
315
315
|
environ = await readFile(`${proc}/${pid}/environ`);
|
|
316
316
|
} catch (error) {
|
|
317
317
|
if (isGone(error) || (isDenied(error) && !asRoot)) return undefined;
|
|
318
|
-
throw explainAccess(error, pid, "
|
|
318
|
+
throw explainAccess(error, pid, "The environment");
|
|
319
319
|
}
|
|
320
320
|
const prefix = `${RUN_MARKER_ENV}=`;
|
|
321
321
|
const entry = environ.toString("utf8").split("\0").find((candidate) => candidate.startsWith(prefix));
|
|
@@ -344,7 +344,7 @@ const linuxSocketInodes = async (proc: string, pid: number, asRoot: boolean): Pr
|
|
|
344
344
|
names = await readdir(directory);
|
|
345
345
|
} catch (error) {
|
|
346
346
|
if (isGone(error) || (isDenied(error) && !asRoot)) return [];
|
|
347
|
-
throw explainAccess(error, pid, "
|
|
347
|
+
throw explainAccess(error, pid, "The file descriptors");
|
|
348
348
|
}
|
|
349
349
|
const inodes: string[] = [];
|
|
350
350
|
for (const name of names) {
|
|
@@ -353,7 +353,7 @@ const linuxSocketInodes = async (proc: string, pid: number, asRoot: boolean): Pr
|
|
|
353
353
|
target = await readlink(`${directory}/${name}`);
|
|
354
354
|
} catch (error) {
|
|
355
355
|
if (isGone(error) || (isDenied(error) && !asRoot)) continue;
|
|
356
|
-
throw explainAccess(error, pid, "
|
|
356
|
+
throw explainAccess(error, pid, "The file descriptors");
|
|
357
357
|
}
|
|
358
358
|
const match = /^socket:\[(\d+)\]$/.exec(target);
|
|
359
359
|
if (match) inodes.push(match[1]);
|
|
@@ -362,13 +362,13 @@ const linuxSocketInodes = async (proc: string, pid: number, asRoot: boolean): Pr
|
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
export interface LinuxProcessTableOptions {
|
|
365
|
-
/**
|
|
365
|
+
/** The folder of the process files; tests name their own. */
|
|
366
366
|
readonly proc?: string;
|
|
367
|
-
/**
|
|
367
|
+
/** As root a locked environment is a missing right; otherwise one of our own processes made itself unreadable. */
|
|
368
368
|
readonly asRoot?: boolean;
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
/**
|
|
371
|
+
/** Without root the table reads only our own processes; one that made itself unreadable (PR_SET_DUMPABLE, such as a Chrome helper or ssh-agent) carries no recognizable marker. */
|
|
372
372
|
export const linuxProcessTable = (options: LinuxProcessTableOptions = {}): ProcessTable => {
|
|
373
373
|
const proc = options.proc ?? "/proc";
|
|
374
374
|
const asRoot = options.asRoot ?? process.getuid?.() === 0;
|
|
@@ -403,7 +403,7 @@ export const linuxProcessTable = (options: LinuxProcessTableOptions = {}): Proce
|
|
|
403
403
|
};
|
|
404
404
|
};
|
|
405
405
|
|
|
406
|
-
/**
|
|
406
|
+
/** Only macOS and Linux have a process table from which run markers can be read. */
|
|
407
407
|
export const hasProcessTable = (platform: NodeJS.Platform = process.platform): boolean =>
|
|
408
408
|
platform === "darwin" || platform === "linux";
|
|
409
409
|
|
|
@@ -411,8 +411,8 @@ export const processTableForPlatform = (platform: NodeJS.Platform = process.plat
|
|
|
411
411
|
if (platform === "darwin") return darwinProcessTable();
|
|
412
412
|
if (platform === "linux") return linuxProcessTable();
|
|
413
413
|
if (platform === "win32") {
|
|
414
|
-
throw new Error("
|
|
415
|
-
+ "
|
|
414
|
+
throw new Error("There is no process table on Windows: for runs working on this machine the process monitor "
|
|
415
|
+
+ "shows and ends nothing. The tools of the workspace do not need it.");
|
|
416
416
|
}
|
|
417
|
-
throw new Error(`
|
|
417
|
+
throw new Error(`The process monitor does not know the platform ${platform} (only darwin and linux)`);
|
|
418
418
|
};
|
|
@@ -22,7 +22,7 @@ interface Scan {
|
|
|
22
22
|
|
|
23
23
|
const keyOf = (record: ProcessRecord): string => `${record.pid}:${record.startKey}`;
|
|
24
24
|
|
|
25
|
-
/**
|
|
25
|
+
/** Reads the marked processes of this machine; concurrent queries of several runs share one table scan. */
|
|
26
26
|
export class ProcessScanner {
|
|
27
27
|
readonly #options: ProcessScannerOptions;
|
|
28
28
|
readonly #now: () => Date;
|
|
@@ -52,7 +52,7 @@ export class ProcessScanner {
|
|
|
52
52
|
ports,
|
|
53
53
|
firstSeen: (record) => {
|
|
54
54
|
const seen = scan.firstSeen.get(record.pid);
|
|
55
|
-
if (!seen) throw new Error(`
|
|
55
|
+
if (!seen) throw new Error(`Process ${record.pid} without a first sighting`);
|
|
56
56
|
return seen;
|
|
57
57
|
},
|
|
58
58
|
}),
|
|
@@ -71,7 +71,7 @@ export class ProcessScanner {
|
|
|
71
71
|
return uid === undefined || uid === 0 || record.uid === uid;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/**
|
|
74
|
+
/** The environment of a process is read only once; an error while doing so is not remembered. */
|
|
75
75
|
async #scan(): Promise<Scan> {
|
|
76
76
|
const table = this.#options.table();
|
|
77
77
|
const records = await table.list();
|