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
|
@@ -2,6 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
3
|
import { parse } from "yaml";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
+
import { gitEnv } from "../../core/harness/git-env.js";
|
|
5
6
|
const run = promisify(execFile);
|
|
6
7
|
export const RUNBOOK_CHARS = 32_000;
|
|
7
8
|
const GIT_BYTES = 4 * 1024 * 1024;
|
|
@@ -13,6 +14,7 @@ async function git(repo, args, signal) {
|
|
|
13
14
|
throw new Error("the run recorded no commit");
|
|
14
15
|
signal?.throwIfAborted();
|
|
15
16
|
const child = run("git", ["-C", repo.dir, ...args], {
|
|
17
|
+
env: gitEnv({ source: "none" }),
|
|
16
18
|
maxBuffer: GIT_BYTES,
|
|
17
19
|
windowsHide: true,
|
|
18
20
|
timeout: RUNBOOK_GIT_MS,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ARTIFACT_HTML_CHARS } from "@prismalens/contracts/schemas";
|
|
2
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { withRules } from "./rules.js";
|
|
5
|
+
import { ANYWHERE } from "./serves.js";
|
|
6
|
+
export function artifactTools(data) {
|
|
7
|
+
return [
|
|
8
|
+
defineHarnessTool({
|
|
9
|
+
name: "artifact_publish",
|
|
10
|
+
title: "Show the operator an HTML page",
|
|
11
|
+
description: withRules(`Publish one self-contained HTML page into this run, for something prose shows badly: a table of findings, a timeline, a chart drawn in inline SVG. Inline CSS and SVG only: scripts do not run and nothing is fetched, so external images, fonts and links will not load. Up to ${ARTIFACT_HTML_CHARS} characters. The operator sees it where you published it and can open it larger. Use it for a table, a timeline or a chart.`, "prose or a report: answer in your message."),
|
|
12
|
+
group: "record",
|
|
13
|
+
effect: "record",
|
|
14
|
+
serves: ANYWHERE,
|
|
15
|
+
input: z.object({
|
|
16
|
+
title: z.string().trim().min(1).max(120),
|
|
17
|
+
html: z.string().min(1).max(ARTIFACT_HTML_CHARS),
|
|
18
|
+
}),
|
|
19
|
+
run: async ({ title, html }, ctx) => {
|
|
20
|
+
const r = await data.publish(ctx.runId, { title, html });
|
|
21
|
+
if (!("error" in r))
|
|
22
|
+
return { value: { id: r.id, published: true } };
|
|
23
|
+
return r.ended
|
|
24
|
+
? fail("run_ended", r.error, "Stop publishing; finish your answer.")
|
|
25
|
+
: fail("invalid_input", r.error, "Put the rest in fewer pages, or in your report.");
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { SECRET_ENV_NAME } from "@prismalens/contracts";
|
|
2
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { withRules } from "./rules.js";
|
|
5
|
+
import { ANYWHERE } from "./serves.js";
|
|
6
|
+
export const ASK_DOCK = { shipped: false };
|
|
7
|
+
export const TOOL_ASKS = Symbol("TOOL_ASKS");
|
|
8
|
+
export const ELICITING_AGENTS = ["claude-code", "codex"];
|
|
9
|
+
const PREVIEW_MAX = 4_000;
|
|
10
|
+
const option = z.object({
|
|
11
|
+
label: z.string().trim().min(1).max(200),
|
|
12
|
+
description: z.string().trim().max(1_000).optional(),
|
|
13
|
+
preview: z.string().max(PREVIEW_MAX).optional(),
|
|
14
|
+
});
|
|
15
|
+
const question = z.object({
|
|
16
|
+
question: z.string().trim().min(1).max(2_000),
|
|
17
|
+
header: z.string().trim().max(40).optional(),
|
|
18
|
+
multiSelect: z.boolean().default(false),
|
|
19
|
+
options: z.array(option).min(2).max(4),
|
|
20
|
+
});
|
|
21
|
+
export function askQuestions(input) {
|
|
22
|
+
return input.map((q, i) => ({
|
|
23
|
+
id: `q${i + 1}`,
|
|
24
|
+
prompt: q.question,
|
|
25
|
+
...(q.header ? { header: q.header } : {}),
|
|
26
|
+
multiSelect: q.multiSelect,
|
|
27
|
+
allowOther: true,
|
|
28
|
+
required: true,
|
|
29
|
+
options: q.options.map((o, j) => ({
|
|
30
|
+
id: `o${j + 1}`,
|
|
31
|
+
label: o.label,
|
|
32
|
+
...(o.description ? { description: o.description } : {}),
|
|
33
|
+
...(o.preview ? { preview: o.preview } : {}),
|
|
34
|
+
})),
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
export function askTools(data) {
|
|
38
|
+
const base = {
|
|
39
|
+
group: "core",
|
|
40
|
+
effect: "ask",
|
|
41
|
+
};
|
|
42
|
+
return [
|
|
43
|
+
defineHarnessTool({
|
|
44
|
+
...base,
|
|
45
|
+
name: "ask_user",
|
|
46
|
+
title: "Ask the user",
|
|
47
|
+
description: withRules("Ask the user 1 to 4 questions, each with 2 to 4 options; put the option you recommend first. Use it only for a decision that is genuinely the user's, which you cannot settle from the code, the data or a sensible default. Each question must stand alone: the user may see it without your other text. An option's `preview` (at most 4,000 characters) shows beside it, for code or a layout to compare. The user can always answer in their own words instead. This returns at once; the answer arrives later as a message from the user, so end your turn or carry on with other work.", "a credential: use secret_request."),
|
|
48
|
+
serves: {
|
|
49
|
+
...ANYWHERE,
|
|
50
|
+
attended: true,
|
|
51
|
+
dock: true,
|
|
52
|
+
notFor: ELICITING_AGENTS,
|
|
53
|
+
},
|
|
54
|
+
input: z.object({ questions: z.array(question).min(1).max(4) }),
|
|
55
|
+
run: async ({ questions }, ctx) => {
|
|
56
|
+
const r = await data.question(ctx.runId, askQuestions(questions));
|
|
57
|
+
if ("error" in r)
|
|
58
|
+
return fail("run_ended", r.error, "Decide without the user's answer.");
|
|
59
|
+
return {
|
|
60
|
+
value: {
|
|
61
|
+
askId: r.askId,
|
|
62
|
+
status: "asked",
|
|
63
|
+
note: "The answer arrives as a message from the user.",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
defineHarnessTool({
|
|
69
|
+
...base,
|
|
70
|
+
name: "secret_request",
|
|
71
|
+
title: "Ask the user for a secret",
|
|
72
|
+
description: withRules("Ask the user for one credential you need, such as an API token. Use it when a task needs a secret you were not given. Name it as the environment variable you will read (capitals, digits and _) and say in `reason` what it is for. The user types it into PrismaLens, never into this conversation: you never see the value, and it is set as that environment variable the next time this session opens. After calling, end your turn; the thread continues with the variable set once the user gives it. Never print the variable's value.", "a question or a choice: use ask_user."),
|
|
73
|
+
serves: { ...ANYWHERE, attended: true, dock: true },
|
|
74
|
+
input: z.object({
|
|
75
|
+
name: z.string().trim().regex(SECRET_ENV_NAME),
|
|
76
|
+
reason: z.string().trim().min(1).max(500),
|
|
77
|
+
}),
|
|
78
|
+
run: async (input, ctx) => {
|
|
79
|
+
const r = await data.secret(ctx.runId, input);
|
|
80
|
+
if ("error" in r)
|
|
81
|
+
return fail("invalid_input", r.error, "Call again with another variable name, or carry on without it.");
|
|
82
|
+
return {
|
|
83
|
+
value: {
|
|
84
|
+
requestId: r.requestId,
|
|
85
|
+
env: r.name,
|
|
86
|
+
status: "asked",
|
|
87
|
+
note: `End your turn. The value will be in $${r.name} when the session opens again.`,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=asks.js.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { defineHarnessTool, fail, RESULT_CHARS, } from "@prismalens/integrations/harness";
|
|
2
|
+
import { extractText, getDocumentProxy } from "unpdf";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { withRules } from "./rules.js";
|
|
5
|
+
const FILE_SUBJECTS = {
|
|
6
|
+
subjects: ["incident", "project", "service", "none"],
|
|
7
|
+
};
|
|
8
|
+
export const ATTACHMENT_READ_CHARS = 32_000;
|
|
9
|
+
export const ATTACHMENT_READ_BYTES = 18_000;
|
|
10
|
+
function fitted(head, whole, offset = 0, length = ATTACHMENT_READ_CHARS) {
|
|
11
|
+
const text = whole.slice(offset);
|
|
12
|
+
const shown = (n) => {
|
|
13
|
+
const end = offset + n;
|
|
14
|
+
return {
|
|
15
|
+
...head,
|
|
16
|
+
offset,
|
|
17
|
+
text: text.slice(0, n),
|
|
18
|
+
total: whole.length,
|
|
19
|
+
truncated: end < whole.length,
|
|
20
|
+
...(end < whole.length
|
|
21
|
+
? {
|
|
22
|
+
note: `Characters ${offset} to ${end} of ${whole.length}; call again with offset ${end} for more.`,
|
|
23
|
+
}
|
|
24
|
+
: {}),
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const fits = (n) => JSON.stringify(shown(n), null, 1).length <= RESULT_CHARS;
|
|
28
|
+
let hi = Math.min(text.length, length, ATTACHMENT_READ_CHARS);
|
|
29
|
+
if (fits(hi))
|
|
30
|
+
return shown(hi);
|
|
31
|
+
let lo = 0;
|
|
32
|
+
while (lo < hi) {
|
|
33
|
+
const mid = Math.ceil((lo + hi) / 2);
|
|
34
|
+
if (fits(mid))
|
|
35
|
+
lo = mid;
|
|
36
|
+
else
|
|
37
|
+
hi = mid - 1;
|
|
38
|
+
}
|
|
39
|
+
return shown(lo);
|
|
40
|
+
}
|
|
41
|
+
const isText = (mime) => mime.startsWith("text/") || /[/+-](json|ya?ml|xml|csv)$/.test(mime);
|
|
42
|
+
const PDF = "application/pdf";
|
|
43
|
+
function byteChunk(head, id, bytes, offset = 0, length = ATTACHMENT_READ_BYTES) {
|
|
44
|
+
const end = Math.min(bytes.length, offset + Math.min(length, ATTACHMENT_READ_BYTES));
|
|
45
|
+
const truncated = end < bytes.length;
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
name: head.name,
|
|
49
|
+
mimeType: head.mimeType,
|
|
50
|
+
size: head.size,
|
|
51
|
+
encoding: "base64",
|
|
52
|
+
offset,
|
|
53
|
+
total: bytes.length,
|
|
54
|
+
data: Buffer.from(bytes.subarray(offset, end)).toString("base64"),
|
|
55
|
+
truncated,
|
|
56
|
+
...(truncated
|
|
57
|
+
? {
|
|
58
|
+
note: `Bytes ${offset} to ${end} of ${bytes.length}; call again with offset ${end} for more.`,
|
|
59
|
+
}
|
|
60
|
+
: {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export async function pdfText(bytes) {
|
|
64
|
+
const pdf = await getDocumentProxy(new Uint8Array(bytes));
|
|
65
|
+
const { text } = await extractText(pdf, { mergePages: true });
|
|
66
|
+
return text.trim() ? text : null;
|
|
67
|
+
}
|
|
68
|
+
export function attachmentTools(data) {
|
|
69
|
+
return [
|
|
70
|
+
defineHarnessTool({
|
|
71
|
+
name: "attachments_list",
|
|
72
|
+
title: "Files attached to this thread",
|
|
73
|
+
description: withRules("The files the operator attached to this run's incident, or to this thread when it has no incident, newest first: id, name, mime type, size in bytes and when. Read a text one with attachment_read. Use it when the operator says they attached something.", "images, which the prompt already carries."),
|
|
74
|
+
group: "knowledge",
|
|
75
|
+
effect: "read",
|
|
76
|
+
serves: FILE_SUBJECTS,
|
|
77
|
+
input: z.object({}),
|
|
78
|
+
run: async (_input, ctx) => {
|
|
79
|
+
const r = await data.list(ctx.runId);
|
|
80
|
+
return r
|
|
81
|
+
? { value: r }
|
|
82
|
+
: fail("not_found", "This thread has no files to list.", "Answer from the message and its files.");
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
defineHarnessTool({
|
|
86
|
+
name: "attachment_read",
|
|
87
|
+
title: "Read an attached file",
|
|
88
|
+
description: withRules(`One file attachments_list returned, by id (a prismalens://attachment/<id> link names the same id). Text, JSON, YAML, XML and CSV come back as text, and a PDF as its text, at most ${ATTACHMENT_READ_CHARS} characters per call. Any other file comes back as base64 bytes, at most ${ATTACHMENT_READ_BYTES} per call. Pass offset (and length) to read the next chunk. Use it after attachments_list.`, "images the operator's prompt already carries."),
|
|
89
|
+
group: "knowledge",
|
|
90
|
+
effect: "read",
|
|
91
|
+
serves: FILE_SUBJECTS,
|
|
92
|
+
input: z.object({
|
|
93
|
+
id: z.string().trim().min(1).max(200),
|
|
94
|
+
offset: z.number().int().min(0).optional(),
|
|
95
|
+
length: z.number().int().min(1).max(ATTACHMENT_READ_CHARS).optional(),
|
|
96
|
+
}),
|
|
97
|
+
run: async ({ id: given, offset, length }, ctx) => {
|
|
98
|
+
const id = given.replace(/^prismalens:\/\/attachment\//, "");
|
|
99
|
+
const found = await data.read(ctx.runId, id);
|
|
100
|
+
if (!found)
|
|
101
|
+
return fail("not_found", `No attachment "${id}" on this thread.`, "Call attachments_list and pass an id exactly as it returned it.");
|
|
102
|
+
const pdf = found.mimeType === PDF && !!found.bytes;
|
|
103
|
+
if (!isText(found.mimeType) && !pdf) {
|
|
104
|
+
const bytes = await found.bytes?.();
|
|
105
|
+
if (!bytes)
|
|
106
|
+
return fail("not_found", `The file for "${found.name}" is no longer stored.`, "Continue without it, or choose another attachment from attachments_list.");
|
|
107
|
+
return { value: byteChunk(found, id, bytes, offset, length) };
|
|
108
|
+
}
|
|
109
|
+
const text = pdf
|
|
110
|
+
? await found
|
|
111
|
+
.bytes?.()
|
|
112
|
+
.then((b) => (b ? pdfText(b).catch(() => null) : null))
|
|
113
|
+
: await found.text();
|
|
114
|
+
if (text == null)
|
|
115
|
+
return fail("not_found", `The file for "${found.name}" is no longer stored.`, "Continue without it, or choose another attachment from attachments_list.");
|
|
116
|
+
return {
|
|
117
|
+
value: fitted({
|
|
118
|
+
id,
|
|
119
|
+
name: found.name,
|
|
120
|
+
mimeType: found.mimeType,
|
|
121
|
+
size: found.size,
|
|
122
|
+
}, text ?? "", offset, length),
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=attachments.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { withRules } from "./rules.js";
|
|
4
|
+
import { INCIDENT_ONLY, SCOPED } from "./serves.js";
|
|
5
|
+
const noIncident = () => fail("not_found", "This run has no incident recorded.", "Continue from the alerts in your prompt.");
|
|
6
|
+
export function historyTools(data) {
|
|
7
|
+
return [
|
|
8
|
+
defineHarnessTool({
|
|
9
|
+
name: "incidents_similar",
|
|
10
|
+
title: "Past incidents like this one",
|
|
11
|
+
description: withRules("The past incidents PrismaLens scored most like this run's incident, best first: number, title, service, status, when resolved, the cause the operator recorded if any, the stored similarity score (0 to 100) and what it matched on. Use it to find a precedent, then read its threads with thread_list.", "this incident's own threads: use thread_list."),
|
|
12
|
+
group: "knowledge",
|
|
13
|
+
effect: "read",
|
|
14
|
+
serves: INCIDENT_ONLY,
|
|
15
|
+
input: z.object({
|
|
16
|
+
limit: z.number().int().min(1).max(20).default(5),
|
|
17
|
+
}),
|
|
18
|
+
run: async ({ limit }, ctx) => {
|
|
19
|
+
const r = await data.similar(ctx.runId, limit);
|
|
20
|
+
return r ? { value: r } : noIncident();
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
defineHarnessTool({
|
|
24
|
+
name: "fixes_list",
|
|
25
|
+
title: "Fixes proposed on past investigations",
|
|
26
|
+
description: withRules("Fixes and recommendations from past investigations on this thread's incident services, or its project or service, newest first: title, detail, incident, status (applied, rejected, deferred, pending), priority, when applied and the latest fix-check verdict if any. Use it to see what was proposed and whether it worked.", "applying a fix: propose it to the user."),
|
|
27
|
+
group: "knowledge",
|
|
28
|
+
effect: "read",
|
|
29
|
+
serves: SCOPED,
|
|
30
|
+
input: z.object({
|
|
31
|
+
limit: z.number().int().min(1).max(50).default(10),
|
|
32
|
+
}),
|
|
33
|
+
run: async ({ limit }, ctx) => {
|
|
34
|
+
const r = await data.fixes(ctx.runId, limit);
|
|
35
|
+
return r
|
|
36
|
+
? { value: r }
|
|
37
|
+
: fail("not_found", "This thread has no project, service or incident to read fixes for.", "Answer without past fixes.");
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { withRules } from "./rules.js";
|
|
4
|
+
import { INCIDENT_ONLY } from "./serves.js";
|
|
5
|
+
const DAY_MS = 24 * 3_600_000;
|
|
6
|
+
const WINDOW_MS = 7 * DAY_MS;
|
|
7
|
+
const limit = z.number().int().min(1).max(50).default(10);
|
|
8
|
+
const time = z.iso.datetime({ offset: true });
|
|
9
|
+
export function incidentTools(data) {
|
|
10
|
+
return [
|
|
11
|
+
defineHarnessTool({
|
|
12
|
+
name: "timeline_read",
|
|
13
|
+
title: "This incident's timeline",
|
|
14
|
+
description: withRules("The timeline PrismaLens keeps for this run's incident, oldest first: type, who wrote it (operator, agent or system), text and time. Returns the latest `limit` entries and the total. Use it to see what the operator and earlier runs did.", "change events: use changes_list."),
|
|
15
|
+
group: "knowledge",
|
|
16
|
+
effect: "read",
|
|
17
|
+
serves: INCIDENT_ONLY,
|
|
18
|
+
input: z.object({ limit }),
|
|
19
|
+
run: async ({ limit }, ctx) => {
|
|
20
|
+
const t = await data.timeline(ctx.runId, limit);
|
|
21
|
+
return t
|
|
22
|
+
? { value: t }
|
|
23
|
+
: fail("not_found", "This run has no incident recorded, so there is no timeline.", "Continue from the alerts in your prompt.");
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
defineHarnessTool({
|
|
27
|
+
name: "changes_list",
|
|
28
|
+
title: "Changes and deploys in a window",
|
|
29
|
+
description: withRules("Change and deploy events PrismaLens recorded, newest first: type, source, time, service, description, environment, version. Defaults to this thread's services, from a day before its incident started (or a day ago) until now. `from` and `to` are ISO times and the window is at most 7 days. Use it to find what changed before a failure.", "the incident's notes: use timeline_read."),
|
|
30
|
+
group: "knowledge",
|
|
31
|
+
effect: "read",
|
|
32
|
+
serves: { subjects: ["incident", "service", "schedule"] },
|
|
33
|
+
input: z.object({
|
|
34
|
+
services: z
|
|
35
|
+
.array(z.string().trim().min(1).max(200))
|
|
36
|
+
.min(1)
|
|
37
|
+
.max(20)
|
|
38
|
+
.optional(),
|
|
39
|
+
from: time.optional(),
|
|
40
|
+
to: time.optional(),
|
|
41
|
+
limit,
|
|
42
|
+
}),
|
|
43
|
+
run: async ({ services, from, to, limit }, ctx) => {
|
|
44
|
+
const scope = await data.scope(ctx.runId);
|
|
45
|
+
const names = services ?? scope?.services ?? [];
|
|
46
|
+
if (!names.length)
|
|
47
|
+
return fail("not_found", "This thread has no service recorded.", "Pass `services` with names from service_get.");
|
|
48
|
+
const now = Date.now();
|
|
49
|
+
const base = (scope?.triggeredAt ? Date.parse(scope.triggeredAt) : now) - DAY_MS;
|
|
50
|
+
const start = from
|
|
51
|
+
? Date.parse(from)
|
|
52
|
+
: to
|
|
53
|
+
? Math.max(base, Date.parse(to) - WINDOW_MS)
|
|
54
|
+
: base;
|
|
55
|
+
const end = to ? Date.parse(to) : Math.min(now, start + WINDOW_MS);
|
|
56
|
+
if (end <= start)
|
|
57
|
+
return fail("invalid_input", "The window ends before it starts.", "Pass `from` earlier than `to`.");
|
|
58
|
+
if (end - start > WINDOW_MS)
|
|
59
|
+
return fail("invalid_input", "The window is longer than 7 days.", "Narrow `from` and `to` to at most 7 days; call again for another window.");
|
|
60
|
+
const window = {
|
|
61
|
+
from: new Date(start).toISOString(),
|
|
62
|
+
to: new Date(end).toISOString(),
|
|
63
|
+
};
|
|
64
|
+
const r = await data.changes({ services: names, ...window, limit });
|
|
65
|
+
if (r.unknown.length)
|
|
66
|
+
return fail("not_found", `PrismaLens has no service named ${r.unknown.map((n) => `"${n}"`).join(", ")}.`, "Use service names from service_get, or omit `services` for this thread's.");
|
|
67
|
+
return {
|
|
68
|
+
value: { window, services: names, changes: r.changes },
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=incident.js.map
|
|
@@ -1,13 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HarnessRegistry, } from "@prismalens/integrations/harness";
|
|
2
|
+
import { artifactTools } from "./artifacts.js";
|
|
3
|
+
import { askTools } from "./asks.js";
|
|
4
|
+
import { attachmentTools } from "./attachments.js";
|
|
5
|
+
import { historyTools } from "./history.js";
|
|
6
|
+
import { incidentTools } from "./incident.js";
|
|
2
7
|
import { knowledgeTools, } from "./knowledge.js";
|
|
8
|
+
import { proposeTools } from "./propose.js";
|
|
9
|
+
import { recordTools } from "./record.js";
|
|
10
|
+
import { reportTools } from "./report.js";
|
|
11
|
+
import { runTools } from "./run.js";
|
|
3
12
|
import { runbookTools } from "./runbooks.js";
|
|
4
|
-
|
|
5
|
-
|
|
13
|
+
import { serviceTools } from "./services.js";
|
|
14
|
+
import { threadTreeTools } from "./thread-tree.js";
|
|
15
|
+
import { threadTools } from "./threads.js";
|
|
16
|
+
import { watchTools } from "./watches.js";
|
|
17
|
+
export { ASK_DOCK, ELICITING_AGENTS, TOOL_ASKS, } from "./asks.js";
|
|
18
|
+
export { THREAD_WATCHES } from "./watches.js";
|
|
19
|
+
export function gatewayTools(data) {
|
|
20
|
+
const registry = new HarnessRegistry();
|
|
6
21
|
for (const tool of [
|
|
7
22
|
...knowledgeTools((q) => data.searchInvestigations(q), data.incident),
|
|
8
23
|
...runbookTools(data.runbooks),
|
|
24
|
+
...recordTools(data.findings),
|
|
25
|
+
...artifactTools(data.artifacts),
|
|
26
|
+
...threadTools(data.threads),
|
|
27
|
+
...incidentTools(data.incidentRecord),
|
|
28
|
+
...serviceTools(data.service),
|
|
29
|
+
...runTools(data.runStatus),
|
|
30
|
+
...reportTools(),
|
|
31
|
+
...attachmentTools(data.attachments),
|
|
32
|
+
...historyTools(data.history),
|
|
33
|
+
...threadTreeTools(data.tree),
|
|
34
|
+
...proposeTools(data.proposals),
|
|
35
|
+
...askTools(data.asks),
|
|
36
|
+
...watchTools(data.watches),
|
|
9
37
|
])
|
|
10
38
|
registry.register(tool);
|
|
11
|
-
return registry;
|
|
39
|
+
return registry.list();
|
|
12
40
|
}
|
|
13
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { withRules } from "./rules.js";
|
|
4
|
+
import { INCIDENT_ONLY, SCOPED } from "./serves.js";
|
|
3
5
|
export function knowledgeTools(search, incident) {
|
|
4
6
|
return [
|
|
5
|
-
|
|
7
|
+
defineHarnessTool({
|
|
6
8
|
name: "incident_get",
|
|
7
9
|
title: "Look up an incident",
|
|
8
|
-
description: "An incident PrismaLens recorded: title, status, severity and service, with the alerts, deploy and change events PrismaLens recorded for its services from a day before it started. Without `number`, the incident this run investigates.",
|
|
10
|
+
description: withRules("An incident PrismaLens recorded: title, status, severity and service, with the alerts, deploy and change events PrismaLens recorded for its services from a day before it started. Without `number`, the incident this run investigates. Use it first on an incident thread.", "project or service threads, which have no incident."),
|
|
11
|
+
group: "core",
|
|
12
|
+
effect: "read",
|
|
13
|
+
serves: INCIDENT_ONLY,
|
|
9
14
|
input: z.object({
|
|
10
15
|
number: z.number().int().min(1).optional(),
|
|
11
16
|
}),
|
|
12
|
-
category: "knowledge",
|
|
13
|
-
openWorld: false,
|
|
14
17
|
run: async ({ number }, ctx) => {
|
|
15
18
|
const found = await incident({
|
|
16
19
|
runId: ctx.runId,
|
|
@@ -18,20 +21,25 @@ export function knowledgeTools(search, incident) {
|
|
|
18
21
|
});
|
|
19
22
|
return found
|
|
20
23
|
? { value: found }
|
|
21
|
-
:
|
|
24
|
+
: fail("not_found", number
|
|
25
|
+
? `PrismaLens has no incident #${number}.`
|
|
26
|
+
: "This run has no incident recorded.", number
|
|
27
|
+
? "Call incident_get without `number` for the incident this run investigates."
|
|
28
|
+
: "Continue from the alerts in your prompt.");
|
|
22
29
|
},
|
|
23
30
|
}),
|
|
24
|
-
|
|
31
|
+
defineHarnessTool({
|
|
25
32
|
name: "investigations_search",
|
|
26
33
|
title: "Search past investigations",
|
|
27
|
-
description: "Past PrismaLens investigations matching a text query, newest first. `agentFinding` is what the agent concluded; `operatorRecordedCause` is what the operator recorded as the real cause, and wins where they differ.",
|
|
34
|
+
description: withRules("Past PrismaLens investigations matching a text query, newest first. `agentFinding` is what the agent concluded; `operatorRecordedCause` is what the operator recorded as the real cause, and wins where they differ. Use it to find earlier causes of a symptom.", "this run's own findings."),
|
|
35
|
+
group: "knowledge",
|
|
36
|
+
effect: "read",
|
|
37
|
+
serves: SCOPED,
|
|
28
38
|
input: z.object({
|
|
29
39
|
query: z.string().trim().min(1).max(200),
|
|
30
40
|
service: z.string().trim().min(1).max(200).optional(),
|
|
31
41
|
limit: z.number().int().min(1).max(20).default(5),
|
|
32
42
|
}),
|
|
33
|
-
category: "knowledge",
|
|
34
|
-
openWorld: false,
|
|
35
43
|
run: async ({ query, service, limit }, ctx) => ({
|
|
36
44
|
value: await search({
|
|
37
45
|
query,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ProposalChangeSchema, } from "@prismalens/contracts/schemas";
|
|
2
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { withRules } from "./rules.js";
|
|
5
|
+
import { ANYWHERE } from "./serves.js";
|
|
6
|
+
export function proposeTools(data) {
|
|
7
|
+
return [
|
|
8
|
+
defineHarnessTool({
|
|
9
|
+
name: "propose_action",
|
|
10
|
+
title: "Propose a change to the user",
|
|
11
|
+
description: withRules("Put a card in front of the user for one change PrismaLens makes for them: a thread-tree setting, a scheduled prompt on this thread's project or service, linking a project to a service, or adding a project. Use it when the change needs the user's say. Nothing changes until they click Apply; the card shows `why`. Asynchronous: do not poll or ask again.", "changes you can make in your own workspace, or anything outside PrismaLens."),
|
|
12
|
+
group: "record",
|
|
13
|
+
effect: "record",
|
|
14
|
+
serves: ANYWHERE,
|
|
15
|
+
input: z.object({
|
|
16
|
+
change: ProposalChangeSchema,
|
|
17
|
+
why: z.string().trim().min(1).max(1_000),
|
|
18
|
+
}),
|
|
19
|
+
run: async ({ change, why }, ctx) => {
|
|
20
|
+
const r = await data.propose(ctx.runId, change, why);
|
|
21
|
+
if ("error" in r && r.invalid)
|
|
22
|
+
return fail("invalid_input", r.error, "Propose a value inside the setting's range, or none.");
|
|
23
|
+
if ("error" in r)
|
|
24
|
+
return fail("limit_reached", r.error, "Wait for the user to apply or dismiss the open cards before proposing more.");
|
|
25
|
+
return {
|
|
26
|
+
value: {
|
|
27
|
+
proposalId: r.id,
|
|
28
|
+
state: r.state,
|
|
29
|
+
next: "The user applies or dismisses it on the card; you hear nothing more unless they tell you.",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=propose.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { EvidenceDirectionSchema, HypothesisStatusSchema, } from "@prismalens/contracts/schemas";
|
|
2
|
+
import { defineHarnessTool, fail, } from "@prismalens/integrations/harness";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { withRules } from "./rules.js";
|
|
5
|
+
import { FOR_A_REPORT } from "./serves.js";
|
|
6
|
+
const EVIDENCE_ID = z
|
|
7
|
+
.string()
|
|
8
|
+
.trim()
|
|
9
|
+
.regex(/^e\d{1,4}$/);
|
|
10
|
+
const HYPOTHESIS_ID = z
|
|
11
|
+
.string()
|
|
12
|
+
.trim()
|
|
13
|
+
.regex(/^rh\d{1,4}$/);
|
|
14
|
+
function refused(error) {
|
|
15
|
+
if (/not live/i.test(error))
|
|
16
|
+
return fail("run_ended", error, "Stop recording; finish your answer with what you found.");
|
|
17
|
+
if (/^No recorded/.test(error))
|
|
18
|
+
return fail("not_found", error, "Record the missing item first, or drop the ids it names.");
|
|
19
|
+
return fail("invalid_input", error, "Stop recording more of these; put the rest in your report.");
|
|
20
|
+
}
|
|
21
|
+
export function recordTools(data) {
|
|
22
|
+
const base = {
|
|
23
|
+
group: "record",
|
|
24
|
+
effect: "record",
|
|
25
|
+
serves: FOR_A_REPORT,
|
|
26
|
+
};
|
|
27
|
+
return [
|
|
28
|
+
defineHarnessTool({
|
|
29
|
+
...base,
|
|
30
|
+
name: "evidence_record",
|
|
31
|
+
title: "Record evidence",
|
|
32
|
+
description: withRules("Record one piece of evidence as you find it; the run view shows it at once. `quote` is text copied exactly from a tool output you saw in this run, or from the file at `path` in the run's workspace. PrismaLens looks the quote up itself: one it cannot find is kept as unanchored and never counts as verified. Returns the evidence id (e1, e2…) that hypothesis_record links. Use it whenever a tool output supports or refutes something.", "guesses: record those as hypotheses."),
|
|
33
|
+
input: z.object({
|
|
34
|
+
observation: z.string().trim().min(1).max(1_000),
|
|
35
|
+
source: z.string().trim().min(1).max(500),
|
|
36
|
+
quote: z.string().trim().min(4).max(2_000),
|
|
37
|
+
direction: EvidenceDirectionSchema.default("supports"),
|
|
38
|
+
path: z.string().trim().min(1).max(1_000).optional(),
|
|
39
|
+
}),
|
|
40
|
+
run: async (input, ctx) => {
|
|
41
|
+
const r = await data.recordEvidence(ctx.runId, input);
|
|
42
|
+
if ("error" in r)
|
|
43
|
+
return refused(r.error);
|
|
44
|
+
return {
|
|
45
|
+
value: {
|
|
46
|
+
id: r.id,
|
|
47
|
+
anchor: r.anchor,
|
|
48
|
+
...(r.anchor
|
|
49
|
+
? {}
|
|
50
|
+
: {
|
|
51
|
+
note: r.path
|
|
52
|
+
? "The quote is not in that file; it is recorded unanchored."
|
|
53
|
+
: "No tool output this run saw holds the quote yet; it is recorded unanchored and looked up again when the report is written.",
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
defineHarnessTool({
|
|
60
|
+
...base,
|
|
61
|
+
name: "hypothesis_record",
|
|
62
|
+
title: "Record a hypothesis",
|
|
63
|
+
description: withRules("Record a hypothesis, or update one by its `id` (rh1, rh2…), as your thinking changes; the run view shows it at once. `evidence` lists ids evidence_record returned; on an update it replaces the list, and leaving it out keeps it. Give the hypothesis the same `id` in your report, so the report joins its recorded evidence. Use it when your thinking changes.", "evidence: record that with evidence_record."),
|
|
64
|
+
input: z.object({
|
|
65
|
+
id: HYPOTHESIS_ID.optional(),
|
|
66
|
+
statement: z.string().trim().min(1).max(1_000),
|
|
67
|
+
status: HypothesisStatusSchema,
|
|
68
|
+
evidence: z.array(EVIDENCE_ID).max(50).optional(),
|
|
69
|
+
parentId: HYPOTHESIS_ID.optional(),
|
|
70
|
+
}),
|
|
71
|
+
run: async (input, ctx) => {
|
|
72
|
+
const r = await data.recordHypothesis(ctx.runId, input);
|
|
73
|
+
return "error" in r
|
|
74
|
+
? refused(r.error)
|
|
75
|
+
: { value: { id: r.id, evidence: r.evidenceIds } };
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { parseReport } from "@prismalens/engine";
|
|
2
|
+
import { defineHarnessTool, } from "@prismalens/integrations/harness";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { withRules } from "./rules.js";
|
|
5
|
+
import { FOR_A_REPORT } from "./serves.js";
|
|
6
|
+
function problemsOf(failure) {
|
|
7
|
+
if (failure.reason !== "schema")
|
|
8
|
+
return [{ field: "report", expected: failure.detail }];
|
|
9
|
+
return failure.detail.split("; ").map((issue) => {
|
|
10
|
+
const at = issue.indexOf(": ");
|
|
11
|
+
return at < 0
|
|
12
|
+
? { field: "report", expected: issue }
|
|
13
|
+
: { field: issue.slice(0, at), expected: issue.slice(at + 2) };
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function reportTools() {
|
|
17
|
+
return [
|
|
18
|
+
defineHarnessTool({
|
|
19
|
+
name: "report_validate",
|
|
20
|
+
title: "Check your final report",
|
|
21
|
+
description: withRules("Check your final report before you finish; PrismaLens rejects a report that fails this. Pass the full final answer you intend to give, including its fenced json block. Returns valid, or each field that fails and what it expects. Use it once, just before you finish.", "drafts mid-investigation."),
|
|
22
|
+
group: "knowledge",
|
|
23
|
+
effect: "read",
|
|
24
|
+
serves: FOR_A_REPORT,
|
|
25
|
+
input: z.object({ report: z.string().min(1).max(200_000) }),
|
|
26
|
+
run: async ({ report }) => {
|
|
27
|
+
const parsed = parseReport(report);
|
|
28
|
+
return {
|
|
29
|
+
value: parsed.ok
|
|
30
|
+
? { valid: true }
|
|
31
|
+
: {
|
|
32
|
+
valid: false,
|
|
33
|
+
problems: problemsOf(parsed),
|
|
34
|
+
next: "Fix each field, then call report_validate again with the whole answer.",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=report.js.map
|