prismalens 0.5.3 → 0.5.4
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 +7 -5
- package/THIRD_PARTY_NOTICES.txt +381 -3
- package/dist/{chunk-2BLEMVIB.js → chunk-7JTFOLGT.js} +9 -4
- package/dist/{chunk-32MOXOOZ.js → chunk-IEPD6EMA.js} +15 -7
- package/dist/{chunk-2SF6M3PV.js → chunk-IJ2EB73U.js} +10 -0
- package/dist/{chunk-B34NMVBM.js → chunk-JK7AMZSE.js} +34 -1
- package/dist/{chunk-7JF4AL64.js → chunk-NXTEM2HN.js} +3 -2
- package/dist/src/cli/doctor.js +53 -184
- package/dist/src/cli/pair.js +8 -3
- package/dist/src/cli/service-unit.js +1 -1
- package/dist/src/cli/service.js +4 -4
- package/dist/src/cli/tailscale.js +3 -1
- package/dist/src/cli/up-console.js +7 -3
- package/dist/src/cli/up.js +23 -4
- package/dist/src/cli/upgrade-trial.js +1 -1
- package/dist/src/cli/upgrade.js +4 -4
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@agentclientprotocol/sdk/2.1.0/LICENSE +191 -0
- package/node_modules/@prismalens/agent-adapters/THIRD_PARTY_LICENSES/@anthropic-ai/claude-agent-sdk/README.md +2 -2
- package/node_modules/@prismalens/agent-adapters/dist/adapters/bundled.json +6 -6
- package/node_modules/@prismalens/agent-adapters/dist/adapters/claude-agent-acp.mjs +3840 -1504
- package/node_modules/@prismalens/agent-adapters/dist/adapters/codex-acp.mjs +3247 -1158
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/README.md +2 -2
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +81 -86
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +76 -83
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-07pvccxf.mjs +43 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-0rjxgk9e.mjs +18 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-fpeb751h.mjs +33 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-jf0rbr11.mjs +17 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core.d.ts +1 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -21
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +19 -24
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +23 -28
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/package.json +7 -7
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +11 -0
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +139 -36
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +68 -73
- package/node_modules/@prismalens/agent-adapters/package.json +1 -1
- package/node_modules/@prismalens/agent-host/dist/launch.js +81 -12
- package/node_modules/@prismalens/agent-host/dist/probe.js +76 -24
- package/node_modules/@prismalens/agent-host/dist/registry/agents.js +17 -1
- package/node_modules/@prismalens/agent-host/dist/workspace/git.js +20 -5
- package/node_modules/@prismalens/agent-host/dist/workspace/index.js +26 -4
- package/node_modules/@prismalens/api/dist/src/app.module.js +14 -0
- package/node_modules/@prismalens/api/dist/src/core/auth/auth.guard.js +7 -3
- package/node_modules/@prismalens/api/dist/src/core/auth/instance-identity.js +12 -0
- package/node_modules/@prismalens/api/dist/src/core/auth/operator.controller.js +1 -1
- package/node_modules/@prismalens/api/dist/src/core/auth/owner.js +18 -0
- package/node_modules/@prismalens/api/dist/src/core/auth/pairing.controller.js +11 -7
- package/node_modules/@prismalens/api/dist/src/core/harness/git-credential.js +18 -0
- package/node_modules/@prismalens/api/dist/src/core/harness/git-env.js +3 -20
- package/node_modules/@prismalens/api/dist/src/core/harness/git-spawn.js +22 -4
- package/node_modules/@prismalens/api/dist/src/core/harness/harness.service.js +81 -1
- package/node_modules/@prismalens/api/dist/src/core/harness/ready-harness.js +26 -0
- package/node_modules/@prismalens/api/dist/src/core/harness/repo-source.service.js +46 -9
- package/node_modules/@prismalens/api/dist/src/core/harness/run-worktree.js +22 -5
- package/node_modules/@prismalens/api/dist/src/core/lifecycle/admission.service.js +35 -0
- package/node_modules/@prismalens/api/dist/src/core/lifecycle/restart-exit.js +8 -0
- package/node_modules/@prismalens/api/dist/src/core/lifecycle/runtime-lifecycle.module.js +28 -0
- package/node_modules/@prismalens/api/dist/src/core/lifecycle/runtime-lifecycle.service.js +186 -0
- package/node_modules/@prismalens/api/dist/src/core/lifecycle/workspace-lock-shutdown.service.js +4 -0
- package/node_modules/@prismalens/api/dist/src/core/live/live-changes.js +25 -12
- package/node_modules/@prismalens/api/dist/src/core/prisma/prisma.service.js +54 -0
- package/node_modules/@prismalens/api/dist/src/core/settings/about.service.js +17 -3
- package/node_modules/@prismalens/api/dist/src/core/settings/diagnostics.service.js +61 -0
- package/node_modules/@prismalens/api/dist/src/core/settings/settings.controller.js +52 -15
- package/node_modules/@prismalens/api/dist/src/core/settings/settings.module.js +3 -1
- package/node_modules/@prismalens/api/dist/src/core/settings/settings.service.js +0 -4
- package/node_modules/@prismalens/api/dist/src/core/settings/update-handoff.js +201 -0
- package/node_modules/@prismalens/api/dist/src/core/settings/update.service.js +373 -0
- package/node_modules/@prismalens/api/dist/src/core/telemetry/telemetry.service.js +16 -7
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/checkout-lease.js +203 -0
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/checkout-status.js +125 -0
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/dispatch.service.js +962 -81
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/dispatcher.js +66 -22
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/event-bus.js +6 -0
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/folder-lock.js +140 -0
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/harness-receipt.js +312 -0
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/in-process-runner.js +27 -5
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/investigation-run.js +683 -60
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/job-store.js +72 -9
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/pre-run-context.js +7 -1
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/restart-recovery.js +112 -0
- package/node_modules/@prismalens/api/dist/src/infrastructure/dispatch/run-abort.js +2 -0
- package/node_modules/@prismalens/api/dist/src/main.js +16 -3
- package/node_modules/@prismalens/api/dist/src/middlewares/cross-site.middleware.js +79 -0
- package/node_modules/@prismalens/api/dist/src/middlewares/host-allowlist.middleware.js +18 -3
- package/node_modules/@prismalens/api/dist/src/modules/alerts/alert-pull.service.js +20 -8
- package/node_modules/@prismalens/api/dist/src/modules/alerts/alerts.service.js +12 -3
- package/node_modules/@prismalens/api/dist/src/modules/asks/asks.contract.js +6 -0
- package/node_modules/@prismalens/api/dist/src/modules/asks/asks.service.js +303 -0
- package/node_modules/@prismalens/api/dist/src/modules/composer/composer.controller.js +64 -0
- package/node_modules/@prismalens/api/dist/src/modules/composer/composer.module.js +54 -0
- package/node_modules/@prismalens/api/dist/src/modules/composer/drafts.service.js +169 -0
- package/node_modules/@prismalens/api/dist/src/modules/delivery/report-delivery.controller.js +5 -1
- package/node_modules/@prismalens/api/dist/src/modules/events/events.service.js +27 -1
- package/node_modules/@prismalens/api/dist/src/modules/fixes/fixes.service.js +12 -4
- package/node_modules/@prismalens/api/dist/src/modules/gateway/gateway.service.js +1034 -80
- package/node_modules/@prismalens/api/dist/src/modules/gateway/runbooks.js +2 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/artifacts.js +30 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/asks.js +94 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/attachments.js +128 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/history.js +42 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/incident.js +74 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/index.js +32 -4
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/knowledge.js +18 -10
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/propose.js +36 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/record.js +80 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/report.js +41 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/rules.js +3 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/run.js +24 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/runbooks.js +18 -12
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/serves.js +11 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/services.js +24 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/thread-tree.js +99 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/threads.js +85 -0
- package/node_modules/@prismalens/api/dist/src/modules/gateway/tools/watches.js +75 -0
- package/node_modules/@prismalens/api/dist/src/modules/images/image-fetch.js +100 -0
- package/node_modules/@prismalens/api/dist/src/modules/images/images.controller.js +50 -0
- package/node_modules/@prismalens/api/dist/src/modules/images/images.module.js +22 -0
- package/node_modules/@prismalens/api/dist/src/modules/images/images.service.js +211 -0
- package/node_modules/@prismalens/api/dist/src/modules/incidents/incidents.controller.js +75 -34
- package/node_modules/@prismalens/api/dist/src/modules/incidents/incidents.module.js +2 -0
- package/node_modules/@prismalens/api/dist/src/modules/incidents/incidents.service.js +89 -46
- package/node_modules/@prismalens/api/dist/src/modules/integrations/host-repositories.service.js +76 -0
- package/node_modules/@prismalens/api/dist/src/modules/integrations/integrations.controller.js +67 -7
- package/node_modules/@prismalens/api/dist/src/modules/integrations/integrations.module.js +4 -1
- package/node_modules/@prismalens/api/dist/src/modules/integrations/telemetry-snapshot.service.js +11 -1
- package/node_modules/@prismalens/api/dist/src/modules/investigations/attachments.service.js +157 -49
- package/node_modules/@prismalens/api/dist/src/modules/investigations/context-pack.service.js +39 -7
- package/node_modules/@prismalens/api/dist/src/modules/investigations/dto/investigation-result.dto.js +3 -3
- package/node_modules/@prismalens/api/dist/src/modules/investigations/investigation-trigger.service.js +4 -1
- package/node_modules/@prismalens/api/dist/src/modules/investigations/investigations.controller.js +301 -21
- package/node_modules/@prismalens/api/dist/src/modules/investigations/investigations.module.js +17 -0
- package/node_modules/@prismalens/api/dist/src/modules/investigations/investigations.service.js +165 -30
- package/node_modules/@prismalens/api/dist/src/modules/investigations/promotion.js +5 -0
- package/node_modules/@prismalens/api/dist/src/modules/investigations/run-scope.js +31 -0
- package/node_modules/@prismalens/api/dist/src/modules/investigations/run-views.js +333 -0
- package/node_modules/@prismalens/api/dist/src/modules/investigations/subagent-sessions.js +28 -0
- package/node_modules/@prismalens/api/dist/src/modules/investigations/tool-asks.service.js +193 -0
- package/node_modules/@prismalens/api/dist/src/modules/investigations/worktree-changes.js +324 -0
- package/node_modules/@prismalens/api/dist/src/modules/openapi/build-spec.js +42 -0
- package/node_modules/@prismalens/api/dist/src/modules/openapi/openapi.controller.js +8 -87
- package/node_modules/@prismalens/api/dist/src/modules/overlay/overlay.service.js +36 -24
- package/node_modules/@prismalens/api/dist/src/modules/push/ask-state.js +6 -3
- package/node_modules/@prismalens/api/dist/src/modules/push/push-outbox.js +4 -1
- package/node_modules/@prismalens/api/dist/src/modules/push/push.service.js +13 -3
- package/node_modules/@prismalens/api/dist/src/modules/references/file-list.js +135 -0
- package/node_modules/@prismalens/api/dist/src/modules/references/monitoring.provider.js +200 -0
- package/node_modules/@prismalens/api/dist/src/modules/references/ranking.js +42 -0
- package/node_modules/@prismalens/api/dist/src/modules/references/records.provider.js +463 -0
- package/node_modules/@prismalens/api/dist/src/modules/references/reference-provider.js +9 -0
- package/node_modules/@prismalens/api/dist/src/modules/references/references.service.js +341 -0
- package/node_modules/@prismalens/api/dist/src/modules/references/work-items.provider.js +83 -0
- package/node_modules/@prismalens/api/dist/src/modules/repositories/folder-browser.js +150 -0
- package/node_modules/@prismalens/api/dist/src/modules/repositories/project-scripts.js +100 -0
- package/node_modules/@prismalens/api/dist/src/modules/repositories/repo-icon-scan.js +180 -0
- package/node_modules/@prismalens/api/dist/src/modules/repositories/repositories.controller.js +51 -4
- package/node_modules/@prismalens/api/dist/src/modules/repositories/repositories.module.js +5 -3
- package/node_modules/@prismalens/api/dist/src/modules/repositories/repositories.service.js +91 -15
- package/node_modules/@prismalens/api/dist/src/modules/repositories/repository-icon.service.js +271 -0
- package/node_modules/@prismalens/api/dist/src/modules/repositories/serialize-repository.js +5 -3
- package/node_modules/@prismalens/api/dist/src/modules/repositories/start-git.js +204 -0
- package/node_modules/@prismalens/api/dist/src/modules/run-workspaces/editors.js +122 -0
- package/node_modules/@prismalens/api/dist/src/modules/run-workspaces/run-workspaces.controller.js +15 -16
- package/node_modules/@prismalens/api/dist/src/modules/run-workspaces/run-workspaces.service.js +29 -1
- package/node_modules/@prismalens/api/dist/src/modules/schedules/allowed-asks.js +17 -0
- package/node_modules/@prismalens/api/dist/src/modules/schedules/decide.js +54 -0
- package/node_modules/@prismalens/api/dist/src/modules/schedules/recurrence.js +85 -0
- package/node_modules/@prismalens/api/dist/src/modules/schedules/schedule-text.js +111 -0
- package/node_modules/@prismalens/api/dist/src/modules/schedules/schedules.controller.js +83 -0
- package/node_modules/@prismalens/api/dist/src/modules/schedules/schedules.module.js +23 -0
- package/node_modules/@prismalens/api/dist/src/modules/schedules/schedules.service.js +898 -0
- package/node_modules/@prismalens/api/dist/src/modules/services/services.controller.js +24 -5
- package/node_modules/@prismalens/api/dist/src/modules/services/services.module.js +2 -1
- package/node_modules/@prismalens/api/dist/src/modules/services/services.service.js +11 -6
- package/node_modules/@prismalens/api/dist/src/modules/terminal/local-request.js +61 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/pty.js +75 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/terminal-gate.js +57 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/terminal-key-issue.js +22 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/terminal-socket.js +162 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/terminal.controller.js +94 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/terminal.module.js +20 -0
- package/node_modules/@prismalens/api/dist/src/modules/terminal/terminal.service.js +54 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/pending-actions.service.js +465 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/proposals.service.js +234 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/put-off.js +19 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/thread-tree.controller.js +68 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/thread-tree.module.js +46 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/thread-tree.service.js +972 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/tree-gateway.service.js +85 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/tree-io.service.js +98 -0
- package/node_modules/@prismalens/api/dist/src/modules/thread-tree/tree-settings.service.js +49 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/links.service.js +258 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/pr-hosts.js +359 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/pr-url.js +74 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/pull-requests.service.js +471 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/thread-context-settings.controller.js +58 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/thread-context-settings.js +28 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/thread-context.service.js +250 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/thread-sections.js +82 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/thread-titles.js +56 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/thread-watches.service.js +329 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/threads.controller.js +81 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/threads.module.js +53 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/threads.service.js +623 -0
- package/node_modules/@prismalens/api/dist/src/modules/threads/work-items.js +171 -0
- package/node_modules/@prismalens/api/dist/src/modules/timeline/timeline.service.js +2 -0
- package/node_modules/@prismalens/api/dist/src/modules/wakes/agent-wakes.js +17 -0
- package/node_modules/@prismalens/api/dist/src/modules/wakes/session-lifecycle.service.js +376 -0
- package/node_modules/@prismalens/api/dist/src/modules/wakes/session.js +124 -0
- package/node_modules/@prismalens/api/dist/src/modules/wakes/wakes.module.js +28 -0
- package/node_modules/@prismalens/api/dist/src/modules/wakes/wakes.service.js +129 -0
- package/node_modules/@prismalens/api/dist/src/modules/webhooks/dto/generic-webhook.dto.js +12 -0
- package/node_modules/@prismalens/api/dist/src/modules/webhooks/webhooks.controller.js +7 -1
- package/node_modules/@prismalens/api/dist/src/modules/webhooks/webhooks.module.js +2 -0
- package/node_modules/@prismalens/api/dist/src/modules/webhooks/webhooks.service.js +103 -41
- package/node_modules/@prismalens/api/dist/src/shared/utils/literal-like.js +5 -0
- package/node_modules/@prismalens/api/public/THIRD_PARTY_NOTICES.txt +381 -3
- package/node_modules/@prismalens/api/public/assets/AddProjectDialog-BEBKziDJ.js +1 -0
- package/node_modules/@prismalens/api/public/assets/AgentDetail-DNNZ2RSQ.js +6 -0
- package/node_modules/@prismalens/api/public/assets/AlertsBlank-M7HkWlgo.js +1 -0
- package/node_modules/@prismalens/api/public/assets/Composer-MAXlRLhF.js +1 -0
- package/node_modules/@prismalens/api/public/assets/CopyButton-DKP5JHET.js +1 -0
- package/node_modules/@prismalens/api/public/assets/HelperThread-BmGnmkL5.js +1 -0
- package/node_modules/@prismalens/api/public/assets/Hint-BCpVhAvV.js +1 -0
- package/node_modules/@prismalens/api/public/assets/HomeComposer-BI6Vhge8.js +1 -0
- package/node_modules/@prismalens/api/public/assets/HypothesesCard-HKxfxVbG.js +1 -0
- package/node_modules/@prismalens/api/public/assets/IncidentHeader-BIYafwD0.js +2 -0
- package/node_modules/@prismalens/api/public/assets/KeptWorkspaces-ozJb7lRG.js +1 -0
- package/node_modules/@prismalens/api/public/assets/MergeDialog-DRjChRQQ.js +1 -0
- package/node_modules/@prismalens/api/public/assets/NewThread-HisGwIRc.js +2 -0
- package/node_modules/@prismalens/api/public/assets/PageHeader-CL1AN9BA.js +1 -0
- package/node_modules/@prismalens/api/public/assets/PanelShell-BHpdPx3P.js +1 -0
- package/node_modules/@prismalens/api/public/assets/ProjectList-lAMigyat.js +1 -0
- package/node_modules/@prismalens/api/public/assets/ResolveDialog-DbMNHrwo.js +1 -0
- package/node_modules/@prismalens/api/public/assets/RingTick-DkMvLoUV.js +1 -0
- package/node_modules/@prismalens/api/public/assets/Row-B3HLhwlw.js +1 -0
- package/node_modules/@prismalens/api/public/assets/RunStrip-CLaYEj2D.js +1 -0
- package/node_modules/@prismalens/api/public/assets/RunsMenu-CD4Yy4jT.js +1 -0
- package/node_modules/@prismalens/api/public/assets/ScheduleDialog-DPYtmK0g.js +2 -0
- package/node_modules/@prismalens/api/public/assets/ServiceFormDialog-9-qDnObk.js +1 -0
- package/node_modules/@prismalens/api/public/assets/SettingsFrame-D4eE2n4w.js +1 -0
- package/node_modules/@prismalens/api/public/assets/State-CCKzehkH.js +1 -0
- package/node_modules/@prismalens/api/public/assets/SubagentPane-exGNOprU.js +1574 -0
- package/node_modules/@prismalens/api/public/assets/TickDot-m_aEzdkj.js +1 -0
- package/node_modules/@prismalens/api/public/assets/Transcript-2ke3pjya.js +159 -0
- package/node_modules/@prismalens/api/public/assets/TriggerCard-BIAznpA9.js +1 -0
- package/node_modules/@prismalens/api/public/assets/WebhookCopy-C8w9xwD6.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{WorkspaceFields-CiyyjkGf.js → WorkspaceFields-DCSJCThm.js} +6 -6
- package/node_modules/@prismalens/api/public/assets/___design-8brlEBqd.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_authenticated-BETuqAeS.js +22 -0
- package/node_modules/@prismalens/api/public/assets/_authenticated-BVT266zx.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_authenticated-BrP-ENHg.css +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-B8v8uWe_.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-BeO8QWfB.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-Cnh_sXTf.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-Crvjv3cl.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-DiQnst4D.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-VgE-Xeq5.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id-y5y3CxjT.js +1 -0
- package/node_modules/@prismalens/api/public/assets/_id_.runs._runId-U4P5LH-M.js +1 -0
- package/node_modules/@prismalens/api/public/assets/alerts-BI1l8Cxn.js +1 -0
- package/node_modules/@prismalens/api/public/assets/app-DmCziBS9.css +2 -0
- package/node_modules/@prismalens/api/public/assets/automation-FhFtuS5_.js +1 -0
- package/node_modules/@prismalens/api/public/assets/boxes-Dh2QZfJa.js +1 -0
- package/node_modules/@prismalens/api/public/assets/button-DmIfWVZ8.js +1 -0
- package/node_modules/@prismalens/api/public/assets/check-DfKru7HJ.js +1 -0
- package/node_modules/@prismalens/api/public/assets/chevron-left-DWLaEwl8.js +1 -0
- package/node_modules/@prismalens/api/public/assets/chevron-right-tPbGnTHi.js +1 -0
- package/node_modules/@prismalens/api/public/assets/circle-BqIhGHXt.js +1 -0
- package/node_modules/@prismalens/api/public/assets/command-chip-5Lf0FARB.js +1 -0
- package/node_modules/@prismalens/api/public/assets/conversation-CXkaesO_.js +1 -0
- package/node_modules/@prismalens/api/public/assets/copy-BUnkkIK-.js +1 -0
- package/node_modules/@prismalens/api/public/assets/desktop-Bqso9PNq.js +9 -0
- package/node_modules/@prismalens/api/public/assets/{device-name-uZQ3wSgk.js → device-name-CZPntaj6.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/dist-CQz4Osl1.js +1 -0
- package/node_modules/@prismalens/api/public/assets/dist-CYLssYEL.js +1 -0
- package/node_modules/@prismalens/api/public/assets/dropdown-menu-Db9u3UIb.js +1 -0
- package/node_modules/@prismalens/api/public/assets/ellipsis-d1vABf4v.js +1 -0
- package/node_modules/@prismalens/api/public/assets/evidence-files-C9UcJR1J.js +1 -0
- package/node_modules/@prismalens/api/public/assets/fixes-CgjsPkfr.js +1 -0
- package/node_modules/@prismalens/api/public/assets/folder-git-2-DRsiaeAx.js +1 -0
- package/node_modules/@prismalens/api/public/assets/globe-D2S-zGel.js +1 -0
- package/node_modules/@prismalens/api/public/assets/harness-CokJrRXZ.js +55 -0
- package/node_modules/@prismalens/api/public/assets/highlighted-body-JLMTFACH-B_v9yJZa.js +1 -0
- package/node_modules/@prismalens/api/public/assets/incidents-B0KnIveX.js +1 -0
- package/node_modules/@prismalens/api/public/assets/index-DZMj9YK4.js +23 -0
- package/node_modules/@prismalens/api/public/assets/input-CXxt1dAV.js +1 -0
- package/node_modules/@prismalens/api/public/assets/key-CjFGD02m.js +1 -0
- package/node_modules/@prismalens/api/public/assets/lazyRouteComponent-DkcTE9Kh.js +1 -0
- package/node_modules/@prismalens/api/public/assets/live-refresh-C5Jfxdxb.js +1 -0
- package/node_modules/@prismalens/api/public/assets/mermaid-WFAXDIZX-CqliGVff.js +1 -0
- package/node_modules/@prismalens/api/public/assets/needs-find-DPugLWCN.js +1 -0
- package/node_modules/@prismalens/api/public/assets/new-Ci475pgf.js +1 -0
- package/node_modules/@prismalens/api/public/assets/pair-CobM73_c.js +1 -0
- package/node_modules/@prismalens/api/public/assets/pencil-BwNhunJy.js +1 -0
- package/node_modules/@prismalens/api/public/assets/plus-DWSahnrj.js +1 -0
- package/node_modules/@prismalens/api/public/assets/preload-helper-BLdHbfdN.js +1 -0
- package/node_modules/@prismalens/api/public/assets/projects-CIckRlw8.js +1 -0
- package/node_modules/@prismalens/api/public/assets/record-context-CoIOStXx.js +1 -0
- package/node_modules/@prismalens/api/public/assets/restart-40l7XMmi.js +1 -0
- package/node_modules/@prismalens/api/public/assets/route-Bg17GbpR.js +1 -0
- package/node_modules/@prismalens/api/public/assets/route-DX3TI7JD.js +1 -0
- package/node_modules/@prismalens/api/public/assets/route-Dvao2bBW.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{route-CCkTDfa6.js → route-ah1SnYbH.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/run-details-DTzMO1X0.js +1 -0
- package/node_modules/@prismalens/api/public/assets/run-labels-ubQZmnqd.js +2 -0
- package/node_modules/@prismalens/api/public/assets/select-98_n4DVz.js +1 -0
- package/node_modules/@prismalens/api/public/assets/service-detail.utils-ulWHS1Ao.js +1 -0
- package/node_modules/@prismalens/api/public/assets/service-lanes-BfHIrySn.js +1 -0
- package/node_modules/@prismalens/api/public/assets/services-CZQMzqYj.js +1 -0
- package/node_modules/@prismalens/api/public/assets/settings-QPxeIS82.js +1 -0
- package/node_modules/@prismalens/api/public/assets/source-words-B5oOdiQU.js +4 -0
- package/node_modules/@prismalens/api/public/assets/state-tone-DEsvSFn6.js +1 -0
- package/node_modules/@prismalens/api/public/assets/strip-inline-markdown-d6Movgzo.js +1 -0
- package/node_modules/@prismalens/api/public/assets/switch-DpPkkZxw.js +1 -0
- package/node_modules/@prismalens/api/public/assets/theme-provider-C9jvt7JX.js +1 -0
- package/node_modules/@prismalens/api/public/assets/threads-BqAHgCGd.js +1 -0
- package/node_modules/@prismalens/api/public/assets/tick-copy-B7dbIrfQ.js +1 -0
- package/node_modules/@prismalens/api/public/assets/trigger-DVo1oKMX.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{use-back-VWIQYM2j.js → use-back-R0oWqfab.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/use-operator-BH6GxjAY.js +1 -0
- package/node_modules/@prismalens/api/public/assets/use-repositories-orpc-c6hPOKjE.js +41 -0
- package/node_modules/@prismalens/api/public/assets/use-threads-orpc-rBrvQXJf.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useInvestigationRun-xdB0R08B.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useLocation-CXMqJKgu.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{useSearch-Bq5sxYI3.js → useMatch-B0f9tdXB.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/useQueries-CGpidxif.js +1 -0
- package/node_modules/@prismalens/api/public/assets/useSearch-BBl0vmEJ.js +1 -0
- package/node_modules/@prismalens/api/public/index.html +5 -3
- package/node_modules/@prismalens/auth/dist/index.js +2 -1
- package/node_modules/@prismalens/auth/dist/pairing.js +31 -6
- package/node_modules/@prismalens/auth/dist/terminal-key.js +25 -0
- package/node_modules/@prismalens/config/dist/acp-registry.json +151 -103
- package/node_modules/@prismalens/config/dist/index.js +3 -0
- package/node_modules/@prismalens/config/dist/providers/harness.js +61 -6
- package/node_modules/@prismalens/config/dist/utils/app-data.js +14 -13
- package/node_modules/@prismalens/config/dist/utils/background-service.js +9 -4
- package/node_modules/@prismalens/config/dist/utils/diagnostics.js +247 -0
- package/node_modules/@prismalens/config/dist/utils/node-version.js +29 -0
- package/node_modules/@prismalens/config/dist/utils/update-install.js +160 -0
- package/node_modules/@prismalens/contracts/dist/contracts/composer.js +70 -0
- package/node_modules/@prismalens/contracts/dist/contracts/incidents.js +3 -2
- package/node_modules/@prismalens/contracts/dist/contracts/index.js +16 -0
- package/node_modules/@prismalens/contracts/dist/contracts/investigations.js +184 -2
- package/node_modules/@prismalens/contracts/dist/contracts/live.js +8 -1
- package/node_modules/@prismalens/contracts/dist/contracts/pairing.js +6 -0
- package/node_modules/@prismalens/contracts/dist/contracts/push.js +1 -1
- package/node_modules/@prismalens/contracts/dist/contracts/repositories.js +41 -1
- package/node_modules/@prismalens/contracts/dist/contracts/run-workspaces.js +11 -0
- package/node_modules/@prismalens/contracts/dist/contracts/schedules.js +84 -0
- package/node_modules/@prismalens/contracts/dist/contracts/settings.js +99 -1
- package/node_modules/@prismalens/contracts/dist/contracts/sources.js +19 -19
- package/node_modules/@prismalens/contracts/dist/contracts/terminal.js +43 -0
- package/node_modules/@prismalens/contracts/dist/contracts/thread-tree.js +87 -0
- package/node_modules/@prismalens/contracts/dist/contracts/threads.js +239 -0
- package/node_modules/@prismalens/contracts/dist/schemas/ask-projection.js +107 -0
- package/node_modules/@prismalens/contracts/dist/schemas/asks.js +211 -0
- package/node_modules/@prismalens/contracts/dist/schemas/composer.js +139 -0
- package/node_modules/@prismalens/contracts/dist/schemas/context-pack.js +6 -2
- package/node_modules/@prismalens/contracts/dist/schemas/impact.js +2 -0
- package/node_modules/@prismalens/contracts/dist/schemas/incident.js +29 -2
- package/node_modules/@prismalens/contracts/dist/schemas/index.js +12 -0
- package/node_modules/@prismalens/contracts/dist/schemas/investigation.js +642 -39
- package/node_modules/@prismalens/contracts/dist/schemas/pull-request.js +176 -0
- package/node_modules/@prismalens/contracts/dist/schemas/recommendation.js +2 -1
- package/node_modules/@prismalens/contracts/dist/schemas/references.js +104 -0
- package/node_modules/@prismalens/contracts/dist/schemas/repository.js +69 -2
- package/node_modules/@prismalens/contracts/dist/schemas/run-views.js +168 -0
- package/node_modules/@prismalens/contracts/dist/schemas/schedule.js +172 -0
- package/node_modules/@prismalens/contracts/dist/schemas/service.js +4 -1
- package/node_modules/@prismalens/contracts/dist/schemas/settings.js +101 -1
- package/node_modules/@prismalens/contracts/dist/schemas/source-type.js +25 -1
- package/node_modules/@prismalens/contracts/dist/schemas/subagents.js +31 -0
- package/node_modules/@prismalens/contracts/dist/schemas/terminal.js +78 -0
- package/node_modules/@prismalens/contracts/dist/schemas/thread-context.js +222 -0
- package/node_modules/@prismalens/contracts/dist/schemas/thread-tree.js +172 -0
- package/node_modules/@prismalens/contracts/dist/schemas/thread.js +159 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/internal/class.js +4 -4
- package/node_modules/@prismalens/database/dist/prisma/generated/internal/prismaNamespace.js +231 -1
- package/node_modules/@prismalens/database/dist/prisma/generated/models/CheckoutLease.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ComposerDraft.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/PendingAction.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/PrWatch.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/Proposal.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/PullRequest.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ReferenceUse.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/Schedule.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ScheduleEvent.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ScheduleTick.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/SecretRequested.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/SubagentSession.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ThreadMessage.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ThreadWait.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ThreadWake.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/ToolAsk.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/generated/models/TreeAllowance.js +2 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261028083515_scheduled_tasks/migration.sql +148 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261102044114_investigation_service_set_null/migration.sql +57 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261102202000_thread_subjects/migration.sql +78 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261103010000_thread_list/migration.sql +3 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261103090000_thread_titles/migration.sql +2 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261103200000_helper_place/migration.sql +2 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261104010000_project_kinds/migration.sql +3 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261104200000_schedule_subjects/migration.sql +41 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261107100000_composer/migration.sql +40 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261107110000_session_wake/migration.sql +26 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261107120000_thread_context/migration.sql +32 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261107130000_app_sources/migration.sql +4 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261107140000_thread_tree/migration.sql +166 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261108100000_subagents/migration.sql +51 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/20261108110000_in_place/migration.sql +15 -0
- package/node_modules/@prismalens/database/dist/prisma/sqlite/schema/app.prisma +391 -7
- package/node_modules/@prismalens/engine/dist/adapter/acp-adapter.js +380 -31
- package/node_modules/@prismalens/engine/dist/index.js +2 -0
- package/node_modules/@prismalens/engine/dist/launch/policy.js +29 -9
- package/node_modules/@prismalens/engine/dist/run/conductor.js +5 -1
- package/node_modules/@prismalens/engine/dist/run/elicitation.js +244 -0
- package/node_modules/@prismalens/engine/dist/run/fence.js +23 -5
- package/node_modules/@prismalens/engine/dist/run/findings.js +203 -0
- package/node_modules/@prismalens/engine/dist/run/handoff.js +86 -2
- package/node_modules/@prismalens/engine/dist/run/harness-doctor.js +46 -6
- package/node_modules/@prismalens/engine/dist/run/investigate.js +403 -57
- package/node_modules/@prismalens/engine/dist/run/local-default.js +13 -4
- package/node_modules/@prismalens/engine/dist/run/permission.js +192 -14
- package/node_modules/@prismalens/engine/dist/run/prompt.js +126 -12
- package/node_modules/@prismalens/engine/dist/run/redact.js +52 -0
- package/node_modules/@prismalens/engine/dist/run/usage-limit.js +91 -9
- package/node_modules/@prismalens/engine/dist/runner/acp-client.js +238 -16
- package/node_modules/@prismalens/integrations/dist/engine/oauth2-flow.js +12 -0
- package/node_modules/@prismalens/integrations/dist/harness/index.js +8 -0
- package/node_modules/@prismalens/integrations/dist/harness/mcp-server.js +60 -0
- package/node_modules/@prismalens/integrations/dist/harness/registry.js +127 -0
- package/node_modules/@prismalens/integrations/dist/harness/replay.js +67 -0
- package/node_modules/@prismalens/integrations/dist/harness/search.js +113 -0
- package/node_modules/@prismalens/integrations/dist/harness/tool.js +64 -0
- package/node_modules/@prismalens/integrations/dist/index.js +2 -0
- package/node_modules/@prismalens/integrations/dist/providers/host-repositories.js +193 -0
- package/node_modules/@prismalens/integrations/package.json +4 -0
- package/package.json +12 -5
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-4pv47a2z.mjs +0 -27
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-bz5kkzv0.mjs +0 -40
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-c86d180z.mjs +0 -52
- package/node_modules/@prismalens/agent-adapters/node_modules/@anthropic-ai/claude-agent-sdk/core-pzfwbvz7.mjs +0 -26
- package/node_modules/@prismalens/api/dist/src/modules/gateway/mcp-delivery.js +0 -39
- package/node_modules/@prismalens/api/public/assets/Field-BQic-QnX.js +0 -1
- package/node_modules/@prismalens/api/public/assets/Hint-B9ocVmjH.js +0 -41
- package/node_modules/@prismalens/api/public/assets/KeptWorkspaces-mrbq8M-h.js +0 -1
- package/node_modules/@prismalens/api/public/assets/MergeDialog-BO_TSjSe.js +0 -1
- package/node_modules/@prismalens/api/public/assets/NewIncident-DWw1jRp3.js +0 -1
- package/node_modules/@prismalens/api/public/assets/PageHeader-DmwtlO5o.js +0 -1
- package/node_modules/@prismalens/api/public/assets/ResolveDialog-nVfxRJOp.js +0 -1
- package/node_modules/@prismalens/api/public/assets/RunsMenu-DrVYxtD6.js +0 -3
- package/node_modules/@prismalens/api/public/assets/ServiceFormDialog-CM8ibEPP.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_authenticated-BIX9FmcY.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_authenticated-g2XLlfqP.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-Bs75xuEI.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-CbGZLynL.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-D7TdCttn.js +0 -1
- package/node_modules/@prismalens/api/public/assets/_id-asM5UbQq.js +0 -1
- package/node_modules/@prismalens/api/public/assets/alerts-C2Ii6YGg.js +0 -1
- package/node_modules/@prismalens/api/public/assets/app-DpX-DlR8.css +0 -2
- package/node_modules/@prismalens/api/public/assets/button-BX6aOWvu.js +0 -1
- package/node_modules/@prismalens/api/public/assets/conversation-MWIw1Mcu.js +0 -461
- package/node_modules/@prismalens/api/public/assets/desktop-CcO1sAJv.js +0 -63
- package/node_modules/@prismalens/api/public/assets/dist-NPKXzqzH.js +0 -1
- package/node_modules/@prismalens/api/public/assets/dropdown-menu-C2eZATbR.js +0 -1
- package/node_modules/@prismalens/api/public/assets/fixes-qbD9HTI7.js +0 -1
- package/node_modules/@prismalens/api/public/assets/format-time-CGRUxfR2.js +0 -1
- package/node_modules/@prismalens/api/public/assets/get-error-message-XWlcOfOx.js +0 -1
- package/node_modules/@prismalens/api/public/assets/highlighted-body-JLMTFACH-DrFHe1nT.js +0 -1
- package/node_modules/@prismalens/api/public/assets/incident-attention-DvrvH6ZE.js +0 -1
- package/node_modules/@prismalens/api/public/assets/incidents-tNIOIUJ9.js +0 -1
- package/node_modules/@prismalens/api/public/assets/index-Bkua5FuI.js +0 -26
- package/node_modules/@prismalens/api/public/assets/loader-circle-BxgKP4dD.js +0 -1
- package/node_modules/@prismalens/api/public/assets/mermaid-WFAXDIZX-BJN6kGuM.js +0 -1
- package/node_modules/@prismalens/api/public/assets/pair-CyzQzNhd.js +0 -1
- package/node_modules/@prismalens/api/public/assets/plus-C-sWiVlr.js +0 -1
- package/node_modules/@prismalens/api/public/assets/route-9A2eeVtZ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/route-BpObCIuc.js +0 -1
- package/node_modules/@prismalens/api/public/assets/route-CAqkvl37.js +0 -1
- package/node_modules/@prismalens/api/public/assets/services-B9GdE4hP.js +0 -1
- package/node_modules/@prismalens/api/public/assets/settings-DsCNpTCk.js +0 -1
- package/node_modules/@prismalens/api/public/assets/state-tone-B3RGc3XM.js +0 -1
- package/node_modules/@prismalens/api/public/assets/switch-UJRRev_z.js +0 -3
- package/node_modules/@prismalens/api/public/assets/use-first-open-rsFZV7FY.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useInvestigationRun-7torOSoz.js +0 -1
- package/node_modules/@prismalens/api/public/assets/useLocation-D-akr70j.js +0 -1
|
@@ -5,10 +5,63 @@
|
|
|
5
5
|
* the floor, the row's provider keys from the host, the user's stored values, the
|
|
6
6
|
* row's own env, then the caller's overrides; refusals run over the result (#916).
|
|
7
7
|
*/
|
|
8
|
-
import { chmodSync, mkdirSync, writeFileSync } from "node:fs";
|
|
9
|
-
import { dirname, join } from "node:path";
|
|
8
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
9
|
+
import { dirname, join, win32 } from "node:path";
|
|
10
10
|
import { AgentHostError } from "./errors.js";
|
|
11
11
|
import { AGENT_REGISTRY, isJsonObject, isSafeGatewayUrl, mergeConfigPatch, resolveLevel, } from "./registry/index.js";
|
|
12
|
+
/** `value` set at `path` inside `obj`, the objects on the way created or copied. */
|
|
13
|
+
function setPath(obj, path, value) {
|
|
14
|
+
const [head, ...rest] = path;
|
|
15
|
+
if (!head)
|
|
16
|
+
return obj;
|
|
17
|
+
const next = isJsonObject(obj[head]) ? obj[head] : {};
|
|
18
|
+
return { ...obj, [head]: rest.length ? setPath(next, rest, value) : value };
|
|
19
|
+
}
|
|
20
|
+
/** The row's sub-agent keys for the limits set: env values, and patches to its config files. */
|
|
21
|
+
export function subagentLimitLayers(row, limits, env) {
|
|
22
|
+
const out = {
|
|
23
|
+
env: {},
|
|
24
|
+
files: {},
|
|
25
|
+
};
|
|
26
|
+
const keys = [
|
|
27
|
+
[row.subagentLimits?.depth, limits?.depth],
|
|
28
|
+
[row.subagentLimits?.concurrency, limits?.concurrency],
|
|
29
|
+
];
|
|
30
|
+
for (const [key, value] of keys) {
|
|
31
|
+
if (!key || value === undefined)
|
|
32
|
+
continue;
|
|
33
|
+
if ("env" in key)
|
|
34
|
+
out.env[key.env] = String(value);
|
|
35
|
+
else if ("jsonEnv" in key) {
|
|
36
|
+
const base = out.env[key.jsonEnv] ?? env[key.jsonEnv];
|
|
37
|
+
out.env[key.jsonEnv] = JSON.stringify(setPath(userConfigEnv(key.jsonEnv, base), key.path, value));
|
|
38
|
+
}
|
|
39
|
+
else
|
|
40
|
+
out.files[key.configFile] = setPath(out.files[key.configFile] ?? {}, key.path, value);
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The `.exe` an npm `.cmd` shim runs, else `path`. The companion is handed to an adapter that
|
|
46
|
+
* spawns it without a shell, and Node refuses a `.cmd` that way (CVE-2024-27980, #1013).
|
|
47
|
+
*/
|
|
48
|
+
export function shimTarget(path, platform = process.platform) {
|
|
49
|
+
if (platform !== "win32" || !/\.(cmd|bat)$/i.test(path))
|
|
50
|
+
return path;
|
|
51
|
+
let shim;
|
|
52
|
+
try {
|
|
53
|
+
shim = readFileSync(path, "utf8");
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return path;
|
|
57
|
+
}
|
|
58
|
+
const exe = [...shim.matchAll(/"%dp0%\\([^"]+\.exe)"/gi)]
|
|
59
|
+
.map((m) => m[1])
|
|
60
|
+
.filter((rel) => !/^node\.exe$/i.test(rel))
|
|
61
|
+
.at(-1);
|
|
62
|
+
const target = exe && win32.join(win32.dirname(path), exe);
|
|
63
|
+
return target && existsSync(target) ? target : path;
|
|
64
|
+
}
|
|
12
65
|
/**
|
|
13
66
|
* Own-secret isolation (ADR-0009): the child gets a bare-minimum shell env, never
|
|
14
67
|
* the host's verbatim. Copied from the engine's `SAFE_ENV_ALLOWLIST`.
|
|
@@ -50,6 +103,12 @@ export const GITHUB_TOKEN_VARS = [
|
|
|
50
103
|
"GH_ENTERPRISE_TOKEN",
|
|
51
104
|
"GITHUB_ENTERPRISE_TOKEN",
|
|
52
105
|
];
|
|
106
|
+
/** Other ways to authenticate a push: the SSH agent and askpass programs; dropped with the tokens (#1020). */
|
|
107
|
+
export const GIT_AUTH_VARS = [
|
|
108
|
+
"SSH_AUTH_SOCK",
|
|
109
|
+
"SSH_ASKPASS",
|
|
110
|
+
"GIT_ASKPASS",
|
|
111
|
+
];
|
|
53
112
|
/** Case-insensitive: Windows env names are, so `prismalens_x` reaches a child as `PRISMALENS_X`. */
|
|
54
113
|
function refusal(names = [], prefixes = []) {
|
|
55
114
|
const upNames = new Set(names.map((n) => n.toUpperCase()));
|
|
@@ -149,7 +208,7 @@ export function planLaunch(input) {
|
|
|
149
208
|
dataDir: join(input.runDir, "home"),
|
|
150
209
|
cwd: input.cwd,
|
|
151
210
|
...(input.launch.companionPath
|
|
152
|
-
? { companionPath: input.launch.companionPath }
|
|
211
|
+
? { companionPath: shimTarget(input.launch.companionPath) }
|
|
153
212
|
: {}),
|
|
154
213
|
...(input.launch.shipped ? { shipped: true } : {}),
|
|
155
214
|
...(input.gateway && row.gatewayDelivery ? { gateway: input.gateway } : {}),
|
|
@@ -160,12 +219,11 @@ export function planLaunch(input) {
|
|
|
160
219
|
if (value !== undefined)
|
|
161
220
|
env[key] = value;
|
|
162
221
|
}
|
|
163
|
-
for (const layer of [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
])
|
|
222
|
+
for (const layer of [stored, input.launch.env ?? {}, row.acpEnv(runEnv)])
|
|
223
|
+
overlay(env, layer);
|
|
224
|
+
// After the user's own values, so a JSON env such as CODEX_CONFIG keeps what they set in it.
|
|
225
|
+
const limits = subagentLimitLayers(row, input.subagents, env);
|
|
226
|
+
for (const layer of [limits.env, input.overrides ?? {}])
|
|
169
227
|
overlay(env, layer);
|
|
170
228
|
const own = policy.floor?.mode === "inherit-minus-own-secrets"
|
|
171
229
|
? policy.floor.ownSecrets
|
|
@@ -176,8 +234,11 @@ export function planLaunch(input) {
|
|
|
176
234
|
delete env[key];
|
|
177
235
|
const dirs = [runEnv.configDir, runEnv.dataDir];
|
|
178
236
|
if (policy.github === "exclude") {
|
|
179
|
-
|
|
180
|
-
|
|
237
|
+
// Windows env names are case-insensitive: `gh_token` reaches the child as GH_TOKEN (#1020).
|
|
238
|
+
const token = refusal([...GITHUB_TOKEN_VARS, ...GIT_AUTH_VARS]);
|
|
239
|
+
for (const key of Object.keys(env))
|
|
240
|
+
if (token(key))
|
|
241
|
+
delete env[key];
|
|
181
242
|
const ghDir = join(input.runDir, "gh");
|
|
182
243
|
env.GH_CONFIG_DIR = ghDir;
|
|
183
244
|
dirs.push(ghDir);
|
|
@@ -213,7 +274,15 @@ export function planLaunch(input) {
|
|
|
213
274
|
? userConfigEnv(row.configEnv.key, env[row.configEnv.key])
|
|
214
275
|
: {};
|
|
215
276
|
const patch = level?.configPatch?.(mergeConfigPatch(input.userConfig ?? {}, inline));
|
|
216
|
-
const planned = levelFiles(row.configFiles?.(runEnv) ?? {}, patch)
|
|
277
|
+
const planned = Object.fromEntries(Object.entries(levelFiles(row.configFiles?.(runEnv) ?? {}, patch)).map(([rel, content]) => {
|
|
278
|
+
const limit = limits.files[rel];
|
|
279
|
+
return [
|
|
280
|
+
rel,
|
|
281
|
+
limit
|
|
282
|
+
? JSON.stringify(mergeConfigPatch(JSON.parse(content), limit), null, 2)
|
|
283
|
+
: content,
|
|
284
|
+
];
|
|
285
|
+
}));
|
|
217
286
|
if (row.configEnv && planned[row.configEnv.file] !== undefined) {
|
|
218
287
|
const { file, key } = row.configEnv;
|
|
219
288
|
const run = JSON.parse(planned[file]);
|
|
@@ -17,7 +17,30 @@ export const PROBE_OUTCOMES = [
|
|
|
17
17
|
];
|
|
18
18
|
/** ACP's auth_required error code. */
|
|
19
19
|
const AUTH_REQUIRED = -32000;
|
|
20
|
-
|
|
20
|
+
/** Spawn plus `initialize` (a cold first start passed 10 s), then `session/new` (Codex took 22 s on a slow network) (#1013). */
|
|
21
|
+
export const PROBE_BUDGETS_MS = {
|
|
22
|
+
initialize: 30_000,
|
|
23
|
+
session: 60_000,
|
|
24
|
+
};
|
|
25
|
+
const KEY = String.raw `[A-Z][A-Z0-9_]*_API_KEY\b`;
|
|
26
|
+
/** `KEY is not set`, or `set one of: KEY`: the key and the gap side by side, never just in one message. */
|
|
27
|
+
const UNSET_KEY = [
|
|
28
|
+
new RegExp(String.raw `\b${KEY}\s+(?:is\s+|was\s+)?(?:not set|unset|missing|required|empty)\b`),
|
|
29
|
+
new RegExp(String.raw `(?:^|[\s(:,])(?:[Ss]et|[Mm]issing|[Nn]o|[Pp]rovide|[Rr]equires?)\s+(?:(?:one|any) of\s*:?\s*)?${KEY}`),
|
|
30
|
+
];
|
|
31
|
+
/** A launch the agent refused: a bad flag or a usage line, whatever else it printed. */
|
|
32
|
+
const FATAL_LAUNCH = /unrecognized|unknown (?:flag|option|argument|command)|usage:|invalid option/i;
|
|
33
|
+
/**
|
|
34
|
+
* An auth signal: ACP's auth_required in words, or a clause naming an unset provider key,
|
|
35
|
+
* in text with no fatal launch error anywhere in `texts`; that error always means failed to start.
|
|
36
|
+
*/
|
|
37
|
+
export function namesSignIn(text, ...texts) {
|
|
38
|
+
if ([text, ...texts].some((t) => FATAL_LAUNCH.test(t)))
|
|
39
|
+
return false;
|
|
40
|
+
if (/auth_required|authentication required/i.test(text))
|
|
41
|
+
return true;
|
|
42
|
+
return UNSET_KEY.some((re) => re.test(text));
|
|
43
|
+
}
|
|
21
44
|
function oneLine(text) {
|
|
22
45
|
return text.replace(/\s*\r?\n\s*/g, " ").trim();
|
|
23
46
|
}
|
|
@@ -67,7 +90,7 @@ function signedOut(init) {
|
|
|
67
90
|
}
|
|
68
91
|
const methodsOf = (methods) => (methods ?? []).map((m) => ({ id: m.id, name: m.name }));
|
|
69
92
|
export async function probeAgent(input) {
|
|
70
|
-
const
|
|
93
|
+
const budgets = { ...PROBE_BUDGETS_MS, ...input.budgets };
|
|
71
94
|
const result = {
|
|
72
95
|
outcome: "failed-to-start",
|
|
73
96
|
agentInfo: null,
|
|
@@ -97,10 +120,19 @@ export async function probeAgent(input) {
|
|
|
97
120
|
};
|
|
98
121
|
}
|
|
99
122
|
let stderr = "";
|
|
123
|
+
// The tail keeps 2 KB; a fatal launch error is caught as it arrives, before help text pushes it out.
|
|
124
|
+
let fatal = null;
|
|
100
125
|
child.stderr.setEncoding("utf8");
|
|
101
126
|
child.stderr.on("data", (chunk) => {
|
|
127
|
+
const seen = stderr.slice(-128) + chunk;
|
|
128
|
+
fatal ??= seen.split(/\r?\n/).find((l) => FATAL_LAUNCH.test(l)) ?? null;
|
|
102
129
|
stderr = (stderr + chunk).slice(-2048);
|
|
103
130
|
});
|
|
131
|
+
const startFailed = () => {
|
|
132
|
+
const tail = oneLine(stderr);
|
|
133
|
+
const head = fatal ? oneLine(fatal) : "";
|
|
134
|
+
return head && !tail.includes(head) ? `${head} … ${tail}` : tail;
|
|
135
|
+
};
|
|
104
136
|
child.stdin.on("error", () => { });
|
|
105
137
|
let timer;
|
|
106
138
|
const died = new Promise((resolve) => {
|
|
@@ -110,9 +142,6 @@ export async function probeAgent(input) {
|
|
|
110
142
|
});
|
|
111
143
|
child.once("close", () => resolve("died"));
|
|
112
144
|
});
|
|
113
|
-
const deadline = new Promise((resolve) => {
|
|
114
|
-
timer = setTimeout(() => resolve("timeout"), timeoutMs);
|
|
115
|
-
});
|
|
116
145
|
let pushed = null;
|
|
117
146
|
const connection = client({ name: "prismalens-probe" })
|
|
118
147
|
// No prompt turn is sent, so no ask can arrive; refuse any that does.
|
|
@@ -129,30 +158,45 @@ export async function probeAgent(input) {
|
|
|
129
158
|
}
|
|
130
159
|
})
|
|
131
160
|
.connect(ndJsonStream(Writable.toWeb(child.stdin), Readable.toWeb(child.stdout)));
|
|
132
|
-
const
|
|
161
|
+
const exited = async (ms) => {
|
|
162
|
+
let grace;
|
|
163
|
+
await Promise.race([
|
|
164
|
+
died,
|
|
165
|
+
new Promise((resolve) => {
|
|
166
|
+
grace = setTimeout(resolve, ms);
|
|
167
|
+
}),
|
|
168
|
+
]);
|
|
169
|
+
clearTimeout(grace);
|
|
170
|
+
};
|
|
171
|
+
const race = async (call, ms) => {
|
|
133
172
|
call.catch(() => { });
|
|
173
|
+
clearTimeout(timer);
|
|
174
|
+
const deadline = new Promise((resolve) => {
|
|
175
|
+
timer = setTimeout(() => resolve("timeout"), ms);
|
|
176
|
+
});
|
|
134
177
|
return Promise.race([call, died, deadline]);
|
|
135
178
|
};
|
|
136
|
-
const ended = (why) =>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
179
|
+
const ended = (why, step, ms) => {
|
|
180
|
+
if (why === "timeout")
|
|
181
|
+
return {
|
|
182
|
+
...result,
|
|
183
|
+
outcome: "no-answer",
|
|
184
|
+
detail: `${step}: no answer in ${Math.max(1, Math.round(ms / 1000))}s`,
|
|
185
|
+
};
|
|
186
|
+
const detail = startFailed() || null;
|
|
187
|
+
return detail && !fatal && namesSignIn(detail)
|
|
188
|
+
? { ...result, outcome: "sign-in-needed", authRequired: true, detail }
|
|
189
|
+
: { ...result, outcome: "failed-to-start", detail };
|
|
190
|
+
};
|
|
147
191
|
try {
|
|
148
192
|
const init = await race(connection.agent.request(methods.agent.initialize, {
|
|
149
193
|
protocolVersion: PROTOCOL_VERSION,
|
|
150
194
|
clientCapabilities: {
|
|
151
195
|
fs: { readTextFile: false, writeTextFile: false },
|
|
152
196
|
},
|
|
153
|
-
}));
|
|
197
|
+
}), budgets.initialize);
|
|
154
198
|
if (init === "died" || init === "timeout")
|
|
155
|
-
return ended(init);
|
|
199
|
+
return ended(init, "initialize", budgets.initialize);
|
|
156
200
|
result.raw.initialize = init;
|
|
157
201
|
result.agentInfo = init.agentInfo
|
|
158
202
|
? {
|
|
@@ -170,9 +214,9 @@ export async function probeAgent(input) {
|
|
|
170
214
|
cwd: input.cwd,
|
|
171
215
|
mcpServers: input.mcpServers ?? [],
|
|
172
216
|
...(meta ? { _meta: meta } : {}),
|
|
173
|
-
}));
|
|
217
|
+
}), budgets.session);
|
|
174
218
|
if (session === "died" || session === "timeout")
|
|
175
|
-
return ended(session);
|
|
219
|
+
return ended(session, "session/new", budgets.session);
|
|
176
220
|
result.raw.session = session;
|
|
177
221
|
const wait = input.authStatusWaitMs ?? 0;
|
|
178
222
|
if (wait > 0 &&
|
|
@@ -203,23 +247,31 @@ export async function probeAgent(input) {
|
|
|
203
247
|
detail: oneLine(err.message),
|
|
204
248
|
};
|
|
205
249
|
const message = err instanceof Error ? err.message : String(err);
|
|
206
|
-
|
|
250
|
+
// A closed connection is the child exiting; its stderr may still be in flight.
|
|
251
|
+
if (!(err instanceof RequestError))
|
|
252
|
+
await exited(1_000);
|
|
253
|
+
const said = fatal
|
|
254
|
+
? undefined
|
|
255
|
+
: [message, stderr].find((t) => namesSignIn(t, message, stderr));
|
|
256
|
+
if (said)
|
|
207
257
|
return {
|
|
208
258
|
...result,
|
|
209
259
|
outcome: "sign-in-needed",
|
|
210
260
|
authRequired: true,
|
|
211
|
-
detail: oneLine(
|
|
261
|
+
detail: oneLine(said),
|
|
212
262
|
};
|
|
213
263
|
return {
|
|
214
264
|
...result,
|
|
215
265
|
outcome: "failed-to-start",
|
|
216
|
-
detail:
|
|
266
|
+
detail: startFailed() || oneLine(message),
|
|
217
267
|
};
|
|
218
268
|
}
|
|
219
269
|
finally {
|
|
220
270
|
clearTimeout(timer);
|
|
221
271
|
if (child.exitCode === null && child.signalCode === null)
|
|
222
272
|
killProcessTree(child, "SIGKILL");
|
|
273
|
+
// Windows keeps a running child's cwd locked, so the caller can only remove it after this.
|
|
274
|
+
await exited(5_000);
|
|
223
275
|
}
|
|
224
276
|
}
|
|
225
277
|
//# sourceMappingURL=probe.js.map
|
|
@@ -27,7 +27,8 @@ export const AGENT_REGISTRY = {
|
|
|
27
27
|
id: "opencode",
|
|
28
28
|
label: "OpenCode",
|
|
29
29
|
binary: "opencode",
|
|
30
|
-
|
|
30
|
+
// No directory flag: OpenCode 2.x exits on one; the spawn and session/new name the folder (#1013).
|
|
31
|
+
acpArgs: () => ["acp"],
|
|
31
32
|
// The user's XDG_CONFIG_HOME and OPENCODE_CONFIG_DIR stay theirs; the run's config loads last, inline (#791, #817).
|
|
32
33
|
acpEnv: () => ({}),
|
|
33
34
|
configEnv: { file: "opencode.json", key: "OPENCODE_CONFIG_CONTENT" },
|
|
@@ -74,6 +75,12 @@ export const AGENT_REGISTRY = {
|
|
|
74
75
|
modeMechanism: "acp",
|
|
75
76
|
modelVia: "acp",
|
|
76
77
|
resume: true,
|
|
78
|
+
subagentLimits: {
|
|
79
|
+
depth: {
|
|
80
|
+
configFile: "opencode.json",
|
|
81
|
+
path: ["experimental", "subagent_depth"],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
77
84
|
},
|
|
78
85
|
"claude-code": {
|
|
79
86
|
id: "claude-code",
|
|
@@ -137,6 +144,10 @@ export const AGENT_REGISTRY = {
|
|
|
137
144
|
signInAtFirstTurn: true,
|
|
138
145
|
resume: true,
|
|
139
146
|
configDir: { envKey: "CLAUDE_CONFIG_DIR", shownDefault: "~/.claude" },
|
|
147
|
+
subagentLimits: {
|
|
148
|
+
depth: { env: "CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH" },
|
|
149
|
+
concurrency: { env: "CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS" },
|
|
150
|
+
},
|
|
140
151
|
},
|
|
141
152
|
codex: {
|
|
142
153
|
id: "codex",
|
|
@@ -176,6 +187,11 @@ export const AGENT_REGISTRY = {
|
|
|
176
187
|
modelVia: "acp",
|
|
177
188
|
resume: true,
|
|
178
189
|
configDir: { envKey: "CODEX_HOME", shownDefault: "~/.codex" },
|
|
190
|
+
// codex-acp takes Codex's `agents.max_depth` / `max_threads` through CODEX_CONFIG, not `-c` (README, Runtime options).
|
|
191
|
+
subagentLimits: {
|
|
192
|
+
depth: { jsonEnv: "CODEX_CONFIG", path: ["agents", "max_depth"] },
|
|
193
|
+
concurrency: { jsonEnv: "CODEX_CONFIG", path: ["agents", "max_threads"] },
|
|
194
|
+
},
|
|
179
195
|
},
|
|
180
196
|
gemini: {
|
|
181
197
|
id: "gemini",
|
|
@@ -30,16 +30,28 @@ const STRIP_EXACT = new Set([
|
|
|
30
30
|
"LANGUAGE",
|
|
31
31
|
]);
|
|
32
32
|
const STRIP_PREFIX = ["GIT_TRACE", "GIT_CONFIG_KEY_", "GIT_CONFIG_VALUE_"];
|
|
33
|
-
/**
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The one filter every git child's env goes through, in agent-host and the API (#1020):
|
|
35
|
+
* repo-local, trace and config-override variables are dropped whatever their case, since
|
|
36
|
+
* Windows reads `git_dir` as GIT_DIR, and so is any git name not written in upper case.
|
|
37
|
+
*/
|
|
38
|
+
export function gitChildEnv(parent) {
|
|
35
39
|
const env = {};
|
|
36
40
|
for (const [key, value] of Object.entries(parent)) {
|
|
37
|
-
|
|
41
|
+
const name = key.toUpperCase();
|
|
42
|
+
if (value === undefined || STRIP_EXACT.has(name))
|
|
38
43
|
continue;
|
|
39
|
-
if (STRIP_PREFIX.some((p) =>
|
|
44
|
+
if (STRIP_PREFIX.some((p) => name.startsWith(p)))
|
|
45
|
+
continue;
|
|
46
|
+
if (name.startsWith("GIT_") && name !== key)
|
|
40
47
|
continue;
|
|
41
48
|
env[key] = value;
|
|
42
49
|
}
|
|
50
|
+
return env;
|
|
51
|
+
}
|
|
52
|
+
/** The env of a git child: no prompt, English messages, and the credential only when one is passed. */
|
|
53
|
+
export function gitEnv(parent, credential) {
|
|
54
|
+
const env = gitChildEnv(parent);
|
|
43
55
|
Object.assign(env, {
|
|
44
56
|
GIT_TERMINAL_PROMPT: "0",
|
|
45
57
|
// Set but empty: git sees an askpass and runs nothing.
|
|
@@ -66,9 +78,11 @@ export function gitEnv(parent, credential) {
|
|
|
66
78
|
}
|
|
67
79
|
return env;
|
|
68
80
|
}
|
|
81
|
+
/** An agent can write `core.fsmonitor` into a worktree's config; git would run it on our next status. */
|
|
82
|
+
export const NO_FSMONITOR = ["-c", "core.fsmonitor="];
|
|
69
83
|
export async function git(args, opts) {
|
|
70
84
|
try {
|
|
71
|
-
const { stdout } = await run("git", args, {
|
|
85
|
+
const { stdout } = await run("git", [...NO_FSMONITOR, ...args], {
|
|
72
86
|
cwd: opts.cwd,
|
|
73
87
|
env: opts.env,
|
|
74
88
|
timeout: opts.timeoutMs ?? GIT_TIMEOUT_MS,
|
|
@@ -88,6 +102,7 @@ export async function git(args, opts) {
|
|
|
88
102
|
export async function hasCommit(repo, commit, opts) {
|
|
89
103
|
try {
|
|
90
104
|
await run("git", [
|
|
105
|
+
...NO_FSMONITOR,
|
|
91
106
|
"rev-parse",
|
|
92
107
|
"--verify",
|
|
93
108
|
"--quiet",
|
|
@@ -10,7 +10,7 @@ import { basename, dirname, isAbsolute, join, normalize, resolve, sep, } from "n
|
|
|
10
10
|
import { AgentHostError } from "../errors.js";
|
|
11
11
|
import { git, gitEnv, gitOk, hasCommit } from "./git.js";
|
|
12
12
|
import { commandFor, runHook, SETUP_SILENCE_MS, TEARDOWN_CAP_MS, } from "./hooks.js";
|
|
13
|
-
export { gitEnv } from "./git.js";
|
|
13
|
+
export { gitChildEnv, gitEnv } from "./git.js";
|
|
14
14
|
export { commandFor, runHook, SETUP_SILENCE_MS, TEARDOWN_CAP_MS, } from "./hooks.js";
|
|
15
15
|
export const DEFAULT_KEPT_PER_PROJECT = 10;
|
|
16
16
|
export const REMOVED_REASONS = [
|
|
@@ -74,6 +74,21 @@ function lockOf(dir, side) {
|
|
|
74
74
|
return side?.lock ?? null;
|
|
75
75
|
}
|
|
76
76
|
/** Uncommitted tracked changes or untracked non-ignored files; ignored files never count (#925). */
|
|
77
|
+
/** Worktree adds still running, by repository; each waits for the one before it. */
|
|
78
|
+
const adding = new Map();
|
|
79
|
+
async function oneAddAtATime(repo, work) {
|
|
80
|
+
const before = adding.get(repo) ?? Promise.resolve();
|
|
81
|
+
const run = before.catch(() => { }).then(work);
|
|
82
|
+
const settled = run.catch(() => { });
|
|
83
|
+
adding.set(repo, settled);
|
|
84
|
+
try {
|
|
85
|
+
return await run;
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
if (adding.get(repo) === settled)
|
|
89
|
+
adding.delete(repo);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
77
92
|
export async function isChanged(dir, env) {
|
|
78
93
|
const out = await git(["status", "--porcelain", "--untracked-files=all"], {
|
|
79
94
|
cwd: dir,
|
|
@@ -270,7 +285,8 @@ export async function createWorkspace(input) {
|
|
|
270
285
|
: ["--detach"];
|
|
271
286
|
// --no-checkout then reset keeps the user's post-checkout hook from firing; the path is
|
|
272
287
|
// ours, so double force re-adds one a crash left registered, even locked (#918).
|
|
273
|
-
|
|
288
|
+
// One add per repository at a time: concurrent adds race on .git/worktrees/<name>.
|
|
289
|
+
await oneAddAtATime(source.repo, () => git([
|
|
274
290
|
"worktree",
|
|
275
291
|
"add",
|
|
276
292
|
...branchArgs,
|
|
@@ -279,7 +295,7 @@ export async function createWorkspace(input) {
|
|
|
279
295
|
"-f",
|
|
280
296
|
dir,
|
|
281
297
|
source.commit,
|
|
282
|
-
], { cwd: source.repo, env, ...sig });
|
|
298
|
+
], { cwd: source.repo, env, ...sig }));
|
|
283
299
|
await git([
|
|
284
300
|
"-c",
|
|
285
301
|
"core.longpaths=true",
|
|
@@ -644,7 +660,13 @@ export async function resumeWorkspace(input) {
|
|
|
644
660
|
if (current !== null && !current.startsWith(input.lockPrefix))
|
|
645
661
|
return null;
|
|
646
662
|
const lock = `${input.lockPrefix}${input.lockLabel ?? input.id} ${randomUUID().slice(0, 8)}`;
|
|
647
|
-
const { keptAt: _kept, lock: _old, ...
|
|
663
|
+
const { keptAt: _kept, lock: _old, ...kept } = side;
|
|
664
|
+
const { project: _project, ...bare } = kept;
|
|
665
|
+
const rest = input.project === undefined
|
|
666
|
+
? kept
|
|
667
|
+
: input.project === null
|
|
668
|
+
? bare
|
|
669
|
+
: { ...bare, project: input.project };
|
|
648
670
|
const admin = linkedGitDir(dir);
|
|
649
671
|
const common = admin ? commonDirOf(admin) : null;
|
|
650
672
|
if (admin && common) {
|
|
@@ -39,6 +39,7 @@ function staticModule() {
|
|
|
39
39
|
];
|
|
40
40
|
}
|
|
41
41
|
import { AuthGuard, AuthModule } from "./core/auth/index.js";
|
|
42
|
+
import { RuntimeLifecycleModule } from "./core/lifecycle/runtime-lifecycle.module.js";
|
|
42
43
|
import { WorkspaceLockShutdownService } from "./core/lifecycle/workspace-lock-shutdown.service.js";
|
|
43
44
|
import { LiveModule } from "./core/live/live.module.js";
|
|
44
45
|
import { PrismaModule } from "./core/prisma/prisma.module.js";
|
|
@@ -52,6 +53,7 @@ import { AlertsModule } from "./modules/alerts/alerts.module.js";
|
|
|
52
53
|
import { ChangesModule } from "./modules/changes/changes.module.js";
|
|
53
54
|
import { EventsModule } from "./modules/events/events.module.js";
|
|
54
55
|
import { FixesModule } from "./modules/fixes/fixes.module.js";
|
|
56
|
+
import { ImagesModule } from "./modules/images/images.module.js";
|
|
55
57
|
import { ImpactModule } from "./modules/impact/impact.module.js";
|
|
56
58
|
import { IncidentsModule } from "./modules/incidents/incidents.module.js";
|
|
57
59
|
import { IntegrationsModule } from "./modules/integrations/integrations.module.js";
|
|
@@ -60,8 +62,13 @@ import { OpenAPIModule } from "./modules/openapi/openapi.module.js";
|
|
|
60
62
|
import { PushModule } from "./modules/push/push.module.js";
|
|
61
63
|
import { RecommendationsModule } from "./modules/recommendations/recommendations.module.js";
|
|
62
64
|
import { RepositoriesModule } from "./modules/repositories/repositories.module.js";
|
|
65
|
+
import { SchedulesModule } from "./modules/schedules/schedules.module.js";
|
|
63
66
|
import { ServicesModule } from "./modules/services/services.module.js";
|
|
67
|
+
import { TerminalModule } from "./modules/terminal/terminal.module.js";
|
|
68
|
+
import { ThreadTreeModule } from "./modules/thread-tree/thread-tree.module.js";
|
|
69
|
+
import { ThreadsModule } from "./modules/threads/threads.module.js";
|
|
64
70
|
import { TimelineModule } from "./modules/timeline/timeline.module.js";
|
|
71
|
+
import { WakesModule } from "./modules/wakes/wakes.module.js";
|
|
65
72
|
import { WebhooksModule } from "./modules/webhooks/webhooks.module.js";
|
|
66
73
|
import { resolveServiceVersion } from "./shared/utils/service-version.js";
|
|
67
74
|
const orpcLogger = new Logger({ context: "oRPC" });
|
|
@@ -128,18 +135,25 @@ AppModule = __decorate([
|
|
|
128
135
|
SetupModule,
|
|
129
136
|
SettingsModule,
|
|
130
137
|
TelemetryModule,
|
|
138
|
+
RuntimeLifecycleModule,
|
|
131
139
|
HealthModule,
|
|
132
140
|
DispatchModule,
|
|
133
141
|
LiveModule,
|
|
134
142
|
...staticModule(),
|
|
135
143
|
EventsModule,
|
|
144
|
+
SchedulesModule,
|
|
145
|
+
WakesModule,
|
|
136
146
|
ServicesModule,
|
|
137
147
|
RepositoriesModule,
|
|
148
|
+
ImagesModule,
|
|
138
149
|
AlertsModule,
|
|
139
150
|
AlertMappingModule,
|
|
140
151
|
IncidentsModule,
|
|
141
152
|
InvestigationsModule,
|
|
142
153
|
TimelineModule,
|
|
154
|
+
TerminalModule,
|
|
155
|
+
ThreadsModule,
|
|
156
|
+
ThreadTreeModule,
|
|
143
157
|
ChangesModule,
|
|
144
158
|
ImpactModule,
|
|
145
159
|
FixesModule,
|
|
@@ -7,8 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { Injectable, UnauthorizedException, } from "@nestjs/common";
|
|
10
|
+
import { ForbiddenException, Injectable, ServiceUnavailableException, UnauthorizedException, } from "@nestjs/common";
|
|
11
11
|
import { Reflector } from "@nestjs/core";
|
|
12
|
+
import { READ_SCOPE } from "@prismalens/auth";
|
|
12
13
|
import { OperatorResolver } from "./operator.resolver.js";
|
|
13
14
|
import { IS_PUBLIC_KEY } from "./public.decorator.js";
|
|
14
15
|
let AuthGuard = class AuthGuard {
|
|
@@ -37,14 +38,17 @@ let AuthGuard = class AuthGuard {
|
|
|
37
38
|
}
|
|
38
39
|
throw new UnauthorizedException("Authentication required");
|
|
39
40
|
}
|
|
41
|
+
if (!resolution.operator.device.scopes.includes(READ_SCOPE))
|
|
42
|
+
throw new ForbiddenException("This device can't view runs.");
|
|
40
43
|
request.operator = resolution.operator;
|
|
41
44
|
return true;
|
|
42
45
|
}
|
|
43
46
|
catch (error) {
|
|
44
|
-
if (error instanceof UnauthorizedException
|
|
47
|
+
if (error instanceof UnauthorizedException ||
|
|
48
|
+
error instanceof ForbiddenException) {
|
|
45
49
|
throw error;
|
|
46
50
|
}
|
|
47
|
-
throw new
|
|
51
|
+
throw new ServiceUnavailableException("PrismaLens could not check this device just now. Try again in a moment.");
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
};
|
|
@@ -30,6 +30,18 @@ let InstanceIdentity = class InstanceIdentity {
|
|
|
30
30
|
return publicUrl.startsWith("https://");
|
|
31
31
|
return this.config.get("PRISMALENS_PROTOCOL") === "https";
|
|
32
32
|
}
|
|
33
|
+
secureFor(request) {
|
|
34
|
+
if (this.secureCookies)
|
|
35
|
+
return true;
|
|
36
|
+
if (request.socket?.encrypted)
|
|
37
|
+
return true;
|
|
38
|
+
const proto = request.headers["x-forwarded-proto"];
|
|
39
|
+
const peer = request.socket?.remoteAddress ?? "";
|
|
40
|
+
const loopbackPeer = peer === "::1" ||
|
|
41
|
+
peer.startsWith("127.") ||
|
|
42
|
+
peer.startsWith("::ffff:127.");
|
|
43
|
+
return loopbackPeer && String(proto).split(",")[0]?.trim() === "https";
|
|
44
|
+
}
|
|
33
45
|
};
|
|
34
46
|
InstanceIdentity = __decorate([
|
|
35
47
|
Injectable(),
|
|
@@ -28,7 +28,7 @@ let OperatorController = class OperatorController {
|
|
|
28
28
|
const resolution = await this.operator.resolveWithReason(request);
|
|
29
29
|
const operator = resolution.operator;
|
|
30
30
|
if (operator && operator.credential.via !== "bearer") {
|
|
31
|
-
request.res?.append("Set-Cookie", deviceCookieHeader(this.instance.deviceCookie, operator.credential.token, this.instance.
|
|
31
|
+
request.res?.append("Set-Cookie", deviceCookieHeader(this.instance.deviceCookie, operator.credential.token, this.instance.secureFor(request)));
|
|
32
32
|
}
|
|
33
33
|
return {
|
|
34
34
|
via: operator?.via ?? null,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ORPCError } from "@orpc/nest";
|
|
2
|
+
import { ACCESS_SCOPE, OPERATE_SCOPE } from "@prismalens/auth";
|
|
3
|
+
export const OWNER_ONLY = "Only the owner can do this.";
|
|
4
|
+
export function isOwner(request) {
|
|
5
|
+
return !!request?.operator?.device.scopes.includes(ACCESS_SCOPE);
|
|
6
|
+
}
|
|
7
|
+
export const VIEW_ONLY = "This device can view and answer, not start runs.";
|
|
8
|
+
export function requireOperate(request) {
|
|
9
|
+
const scopes = request?.operator?.device.scopes;
|
|
10
|
+
if (!scopes?.includes(OPERATE_SCOPE))
|
|
11
|
+
throw new ORPCError("FORBIDDEN", { message: VIEW_ONLY });
|
|
12
|
+
}
|
|
13
|
+
export function requireOwner(request, message = OWNER_ONLY) {
|
|
14
|
+
if (!isOwner(request))
|
|
15
|
+
throw new ORPCError("FORBIDDEN", { message });
|
|
16
|
+
return request.operator?.device.id ?? null;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=owner.js.map
|