@open-mercato/cezar 0.19.0-pr1908.4332 → 0.19.0-pr1908.4707
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 +3 -2
- package/dist/agent-config/account-identity.js +3 -0
- package/dist/agent-config/account-identity.js.map +1 -1
- package/dist/agent-config/catalog.d.ts +7 -1
- package/dist/agent-config/catalog.js +174 -4
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/gemini.d.ts +8 -0
- package/dist/agent-config/model-settings/gemini.js +16 -0
- package/dist/agent-config/model-settings/gemini.js.map +1 -0
- package/dist/agent-config/model-settings/kimi.d.ts +7 -0
- package/dist/agent-config/model-settings/kimi.js +13 -0
- package/dist/agent-config/model-settings/kimi.js.map +1 -0
- package/dist/agent-config/model-settings/omp.d.ts +11 -0
- package/dist/agent-config/model-settings/omp.js +17 -0
- package/dist/agent-config/model-settings/omp.js.map +1 -0
- package/dist/agent-config/model-settings/shared.d.ts +6 -0
- package/dist/agent-config/model-settings/shared.js +17 -3
- package/dist/agent-config/model-settings/shared.js.map +1 -1
- package/dist/agent-config/models.js +6 -0
- package/dist/agent-config/models.js.map +1 -1
- package/dist/agent-config/validate.js +15 -0
- package/dist/agent-config/validate.js.map +1 -1
- package/dist/automations/automation-cli.d.ts +2 -0
- package/dist/automations/automation-cli.js +82 -2
- package/dist/automations/automation-cli.js.map +1 -1
- package/dist/automations/deferred-start.d.ts +5 -4
- package/dist/automations/deferred-start.js +5 -1
- package/dist/automations/deferred-start.js.map +1 -1
- package/dist/automations/paused-work.d.ts +24 -0
- package/dist/automations/paused-work.js +61 -0
- package/dist/automations/paused-work.js.map +1 -0
- package/dist/automations/pr-head.d.ts +3 -0
- package/dist/automations/pr-head.js +8 -4
- package/dist/automations/pr-head.js.map +1 -1
- package/dist/automations/prompts.js +1 -0
- package/dist/automations/prompts.js.map +1 -1
- package/dist/automations/store.d.ts +16 -0
- package/dist/automations/store.js +44 -0
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/task-template.js +1 -0
- package/dist/automations/task-template.js.map +1 -1
- package/dist/automations/templates.js +1 -0
- package/dist/automations/templates.js.map +1 -1
- package/dist/automations/types.d.ts +24 -0
- package/dist/automations/types.js +2 -0
- package/dist/automations/types.js.map +1 -1
- package/dist/automations/validate-input.d.ts +188 -0
- package/dist/automations/validate-input.js +85 -0
- package/dist/automations/validate-input.js.map +1 -0
- package/dist/config.d.ts +12 -5
- package/dist/config.js +4 -12
- package/dist/config.js.map +1 -1
- package/dist/contract/agent-config.d.ts +9 -0
- package/dist/contract/agent-profiles.d.ts +74 -20
- package/dist/contract/agent.d.ts +12 -0
- package/dist/contract/artifacts.d.ts +138 -0
- package/dist/contract/assets.d.ts +83 -0
- package/dist/contract/automations.d.ts +158 -0
- package/dist/contract/dashboard-costs.d.ts +2 -0
- package/dist/contract/dashboard.d.ts +8 -0
- package/dist/contract/deferred-start.d.ts +33 -0
- package/dist/contract/dispatch.d.ts +9 -0
- package/dist/contract/events.d.ts +6 -0
- package/dist/contract/github.d.ts +13 -0
- package/dist/contract/health.d.ts +12 -0
- package/dist/contract/impact.d.ts +134 -0
- package/dist/contract/index.d.ts +6 -0
- package/dist/contract/index.js +2955 -2547
- package/dist/contract/managers.d.ts +79 -0
- package/dist/contract/runners.d.ts +15 -0
- package/dist/contract/runs.d.ts +292 -0
- package/dist/contract/skills.d.ts +67 -0
- package/dist/contract/telemetry.d.ts +5 -1
- package/dist/contract/transfer.d.ts +1932 -0
- package/dist/contract/workflows.d.ts +87 -0
- package/dist/contract/workspace-layouts.d.ts +6 -0
- package/dist/contract/workspace.d.ts +111 -37
- package/dist/core/agent-env.js +43 -1
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-errors.d.ts +3 -0
- package/dist/core/agent-errors.js +13 -0
- package/dist/core/agent-errors.js.map +1 -1
- package/dist/core/agent-model-policy.d.ts +1 -1
- package/dist/core/agent-model-policy.js +1 -1
- package/dist/core/agent-model-policy.js.map +1 -1
- package/dist/core/agent-profiles.d.ts +19 -3
- package/dist/core/agent-profiles.js +27 -3
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/agent-runner.d.ts +44 -10
- package/dist/core/agent-runner.js +21 -7
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/antigravity-runner.js +2 -1
- package/dist/core/antigravity-runner.js.map +1 -1
- package/dist/core/backend-detect.d.ts +3 -2
- package/dist/core/backend-detect.js +80 -1
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.js +30 -3
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/claude-model-catalog.d.ts +6 -1
- package/dist/core/claude-model-catalog.js +20 -0
- package/dist/core/claude-model-catalog.js.map +1 -1
- package/dist/core/claude-usage-status.d.ts +8 -0
- package/dist/core/claude-usage-status.js +48 -0
- package/dist/core/claude-usage-status.js.map +1 -0
- package/dist/core/codex-app-server-runner.d.ts +8 -0
- package/dist/core/codex-app-server-runner.js +84 -13
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-model-catalog.js +42 -0
- package/dist/core/codex-model-catalog.js.map +1 -1
- package/dist/core/codex-ui-mapper.d.ts +7 -0
- package/dist/core/codex-ui-mapper.js +12 -2
- package/dist/core/codex-ui-mapper.js.map +1 -1
- package/dist/core/copilot-acp-runner.js +5 -1
- package/dist/core/copilot-acp-runner.js.map +1 -1
- package/dist/core/cursor-agent-runner.js +5 -1
- package/dist/core/cursor-agent-runner.js.map +1 -1
- package/dist/core/gemini-acp-runner.d.ts +37 -0
- package/dist/core/gemini-acp-runner.js +537 -0
- package/dist/core/gemini-acp-runner.js.map +1 -0
- package/dist/core/gemini-credentials.d.ts +21 -0
- package/dist/core/gemini-credentials.js +80 -0
- package/dist/core/gemini-credentials.js.map +1 -0
- package/dist/core/gemini-sessions.d.ts +18 -0
- package/dist/core/gemini-sessions.js +41 -0
- package/dist/core/gemini-sessions.js.map +1 -0
- package/dist/core/gemini-ui-mapper.d.ts +30 -0
- package/dist/core/gemini-ui-mapper.js +80 -0
- package/dist/core/gemini-ui-mapper.js.map +1 -0
- package/dist/core/junie-runner.js +2 -1
- package/dist/core/junie-runner.js.map +1 -1
- package/dist/core/kimi-home.d.ts +7 -0
- package/dist/core/kimi-home.js +13 -0
- package/dist/core/kimi-home.js.map +1 -0
- package/dist/core/kimi-model-catalog.d.ts +17 -0
- package/dist/core/kimi-model-catalog.js +45 -0
- package/dist/core/kimi-model-catalog.js.map +1 -0
- package/dist/core/kimi-runner.d.ts +90 -0
- package/dist/core/kimi-runner.js +874 -0
- package/dist/core/kimi-runner.js.map +1 -0
- package/dist/core/kimi-ui-mapper.d.ts +71 -0
- package/dist/core/kimi-ui-mapper.js +399 -0
- package/dist/core/kimi-ui-mapper.js.map +1 -0
- package/dist/core/model-identity.js +11 -0
- package/dist/core/model-identity.js.map +1 -1
- package/dist/core/model-presets.js +10 -0
- package/dist/core/model-presets.js.map +1 -1
- package/dist/core/omp-rpc-runner.d.ts +41 -0
- package/dist/core/omp-rpc-runner.js +451 -0
- package/dist/core/omp-rpc-runner.js.map +1 -0
- package/dist/core/omp-ui-mapper.d.ts +56 -0
- package/dist/core/omp-ui-mapper.js +468 -0
- package/dist/core/omp-ui-mapper.js.map +1 -0
- package/dist/core/opencode-http.d.ts +2 -0
- package/dist/core/opencode-http.js +2 -2
- package/dist/core/opencode-http.js.map +1 -1
- package/dist/core/opencode-server-runner.d.ts +3 -1
- package/dist/core/opencode-server-runner.js +197 -25
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/opencode-v2-events.d.ts +11 -0
- package/dist/core/opencode-v2-events.js +105 -0
- package/dist/core/opencode-v2-events.js.map +1 -0
- package/dist/core/pi-runner.js +5 -1
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/private-mcp.d.ts +1 -1
- package/dist/core/private-mcp.js +2 -2
- package/dist/core/private-mcp.js.map +1 -1
- package/dist/core/process-signals.d.ts +29 -0
- package/dist/core/process-signals.js +85 -0
- package/dist/core/process-signals.js.map +1 -0
- package/dist/core/provider-auth.d.ts +25 -2
- package/dist/core/provider-auth.js +132 -12
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/runner-factory.d.ts +1 -0
- package/dist/core/runner-factory.js +38 -1
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-model-catalog.d.ts +8 -0
- package/dist/core/runner-model-catalog.js +3 -0
- package/dist/core/runner-model-catalog.js.map +1 -1
- package/dist/core/tool-display.js +2 -0
- package/dist/core/tool-display.js.map +1 -1
- package/dist/core/ui-events.d.ts +1 -1
- package/dist/core/usage-limit.d.ts +2 -2
- package/dist/core/usage-limit.js +5 -3
- package/dist/core/usage-limit.js.map +1 -1
- package/dist/data-gitignore.d.ts +1 -1
- package/dist/data-gitignore.js +1 -0
- package/dist/data-gitignore.js.map +1 -1
- package/dist/dispatch/engine.d.ts +4 -0
- package/dist/dispatch/engine.js +9 -0
- package/dist/dispatch/engine.js.map +1 -1
- package/dist/e2e-setup.d.ts +8 -3
- package/dist/e2e-setup.js +31 -16
- package/dist/e2e-setup.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +5 -5
- package/dist/handoff.js.map +1 -1
- package/dist/impact/demo-review.json +781 -0
- package/dist/impact/diff.d.ts +21 -0
- package/dist/impact/diff.js +81 -0
- package/dist/impact/diff.js.map +1 -0
- package/dist/impact/evidence.d.ts +67 -0
- package/dist/impact/evidence.js +238 -0
- package/dist/impact/evidence.js.map +1 -0
- package/dist/impact/impact-cli.d.ts +12 -0
- package/dist/impact/impact-cli.js +141 -0
- package/dist/impact/impact-cli.js.map +1 -0
- package/dist/impact/launch.d.ts +46 -0
- package/dist/impact/launch.js +145 -0
- package/dist/impact/launch.js.map +1 -0
- package/dist/impact/model.d.ts +551 -0
- package/dist/impact/model.js +188 -0
- package/dist/impact/model.js.map +1 -0
- package/dist/impact/publish.d.ts +30 -0
- package/dist/impact/publish.js +119 -0
- package/dist/impact/publish.js.map +1 -0
- package/dist/impact/render.d.ts +41 -0
- package/dist/impact/render.js +109 -0
- package/dist/impact/render.js.map +1 -0
- package/dist/impact/template.html +670 -0
- package/dist/impact/validate.d.ts +25 -0
- package/dist/impact/validate.js +273 -0
- package/dist/impact/validate.js.map +1 -0
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/managers/engine.js +5 -2
- package/dist/managers/engine.js.map +1 -1
- package/dist/pack-check.d.ts +1 -0
- package/dist/pack-check.js +14 -0
- package/dist/pack-check.js.map +1 -1
- package/dist/paths.d.ts +6 -0
- package/dist/paths.js +19 -1
- package/dist/paths.js.map +1 -1
- package/dist/runs/agent-error-telemetry.js +7 -4
- package/dist/runs/agent-error-telemetry.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +25 -6
- package/dist/runs/agent-tmpdir.js +136 -25
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/artifacts.d.ts +52 -0
- package/dist/runs/artifacts.js +243 -0
- package/dist/runs/artifacts.js.map +1 -0
- package/dist/runs/event-history.d.ts +12 -0
- package/dist/runs/event-history.js +61 -0
- package/dist/runs/event-history.js.map +1 -1
- package/dist/runs/project-assets.d.ts +9 -0
- package/dist/runs/project-assets.js +57 -0
- package/dist/runs/project-assets.js.map +1 -0
- package/dist/runs/review-gate.d.ts +10 -0
- package/dist/runs/review-gate.js +12 -0
- package/dist/runs/review-gate.js.map +1 -1
- package/dist/runs/store.d.ts +70 -4
- package/dist/runs/store.js +139 -26
- package/dist/runs/store.js.map +1 -1
- package/dist/server/agent-setup.d.ts +1 -1
- package/dist/server/agent-setup.js +2 -1
- package/dist/server/agent-setup.js.map +1 -1
- package/dist/server/artifacts.d.ts +33 -0
- package/dist/server/artifacts.js +133 -0
- package/dist/server/artifacts.js.map +1 -0
- package/dist/server/dashboard.d.ts +5 -0
- package/dist/server/forge/github-assets.d.ts +7 -0
- package/dist/server/forge/github-assets.js +100 -0
- package/dist/server/forge/github-assets.js.map +1 -0
- package/dist/server/forge/github.d.ts +11 -0
- package/dist/server/forge/github.js +42 -0
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/open-in-app.js +3 -0
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/provider-action-gate.js +12 -4
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/server.d.ts +10012 -6701
- package/dist/server/server.js +353 -193
- package/dist/server/server.js.map +1 -1
- package/dist/server/star-count.d.ts +5 -5
- package/dist/server/star-count.js +5 -5
- package/dist/server/star-count.js.map +1 -1
- package/dist/server-install/steps.js +1 -0
- package/dist/server-install/steps.js.map +1 -1
- package/dist/skills-provision.js +7 -1
- package/dist/skills-provision.js.map +1 -1
- package/dist/skills.d.ts +10 -6
- package/dist/skills.js +11 -6
- package/dist/skills.js.map +1 -1
- package/dist/transfer/automations-file.d.ts +46 -0
- package/dist/transfer/automations-file.js +172 -0
- package/dist/transfer/automations-file.js.map +1 -0
- package/dist/transfer/config-bundle.d.ts +100 -0
- package/dist/transfer/config-bundle.js +430 -0
- package/dist/transfer/config-bundle.js.map +1 -0
- package/dist/webhooks/outbox.js +83 -63
- package/dist/webhooks/outbox.js.map +1 -1
- package/dist/workflows/graph.d.ts +27 -0
- package/dist/workflows/load.js +2 -2
- package/dist/workflows/load.js.map +1 -1
- package/dist/workflows/resume-fallback.d.ts +13 -6
- package/dist/workflows/resume-fallback.js +26 -6
- package/dist/workflows/resume-fallback.js.map +1 -1
- package/dist/workflows/run.d.ts +121 -10
- package/dist/workflows/run.js +363 -61
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/templates.d.ts +27 -16
- package/dist/workflows/templates.js +17 -0
- package/dist/workflows/templates.js.map +1 -1
- package/dist/workflows/types.d.ts +21 -0
- package/dist/workflows/types.js +3 -1
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.d.ts +27 -15
- package/dist/workspace/agent-accounts.js +4 -14
- package/dist/workspace/agent-accounts.js.map +1 -1
- package/dist/workspace/agent-profiles.js +3 -0
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.d.ts +12 -6
- package/dist/workspace/config.js +3 -13
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/dashboard-costs.d.ts +1 -0
- package/dist/workspace/dashboard-costs.js +1 -0
- package/dist/workspace/dashboard-costs.js.map +1 -1
- package/dist/workspace/dashboard-insights.d.ts +1 -0
- package/dist/workspace/dashboard-insights.js +5 -2
- package/dist/workspace/dashboard-insights.js.map +1 -1
- package/dist/workspace/dashboard-overview.js +2 -0
- package/dist/workspace/dashboard-overview.js.map +1 -1
- package/dist/workspace/dashboard.d.ts +1 -0
- package/package.json +5 -4
- package/scripts/check-pack.mjs +3 -2
- package/scripts/copy-assets.mjs +17 -0
- package/scripts/mock-claude.mjs +106 -1
- package/scripts/mock-gemini-acp.mjs +195 -0
- package/scripts/mock-kimi-acp.mjs +126 -0
- package/scripts/mock-omp-rpc.mjs +194 -0
- package/skills/change-impact/SKILL.md +117 -0
- package/skills/change-impact/references/analysis-contract.md +141 -0
- package/skills/change-impact/references/public-api.md +92 -0
- package/skills/change-impact/references/visual-contract.md +71 -0
- package/web/dist/assets/{active-forge-DEmP_h4r.js → active-forge-DO2AaQ-s.js} +1 -1
- package/web/dist/assets/agent-task-pickers-CZpw4vcZ.js +1 -0
- package/web/dist/assets/{alert-dialog-BZkKvKiu.js → alert-dialog-BihfE0uZ.js} +1 -1
- package/web/dist/assets/arrow-down-DACdHKjc.js +1 -0
- package/web/dist/assets/arrow-left-BtT8zuL0.js +1 -0
- package/web/dist/assets/arrow-up-BAPSgozC.js +1 -0
- package/web/dist/assets/ask-answer-Co3javaA.js +1 -0
- package/web/dist/assets/{ask-card-CfNUHYt9.js → ask-card-DLtNyMH_.js} +2 -2
- package/web/dist/assets/assets-view-CLCckPll.js +1 -0
- package/web/dist/assets/{automation-format-BPrWgGBz.js → automation-format-BXwiLf2G.js} +1 -1
- package/web/dist/assets/automations-route-JizzZrRf.js +1 -0
- package/web/dist/assets/blink-1oEUjxch.webp +0 -0
- package/web/dist/assets/blink-B4Y4PYCR.webp +0 -0
- package/web/dist/assets/blink-BpqW08tf.webp +0 -0
- package/web/dist/assets/blink-C380t2a5.webp +0 -0
- package/web/dist/assets/blink-CLn5VMYQ.webp +0 -0
- package/web/dist/assets/blink-Cn_tI5Yd.webp +0 -0
- package/web/dist/assets/blink-D4EaTnc2.webp +0 -0
- package/web/dist/assets/blink-DY4Sm5aw.webp +0 -0
- package/web/dist/assets/blink-mcM10OfP.webp +0 -0
- package/web/dist/assets/body-CXEwT_gR.webp +0 -0
- package/web/dist/assets/body-D-UrLURv.webp +0 -0
- package/web/dist/assets/body-D7Q8eJDv.webp +0 -0
- package/web/dist/assets/body-DdNSx4-d.webp +0 -0
- package/web/dist/assets/body-DlFNtp32.webp +0 -0
- package/web/dist/assets/body-EreQeu3g.webp +0 -0
- package/web/dist/assets/body-Goc64z5o.webp +0 -0
- package/web/dist/assets/body-_FLmHm_q.webp +0 -0
- package/web/dist/assets/body-v5xTmq5E.webp +0 -0
- package/web/dist/assets/{bot-qZRkHkDp.js → bot-Cm-PLA1M.js} +1 -1
- package/web/dist/assets/{button-BrxohNcK.js → button-BqkA8Ovk.js} +1 -1
- package/web/dist/assets/{centered-state-CSW_o4N7.js → centered-state-CquGIOsq.js} +1 -1
- package/web/dist/assets/check-B1z-_MCO.js +1 -0
- package/web/dist/assets/chevron-left-CDAxCC2p.js +1 -0
- package/web/dist/assets/chevron-right-DPaV033p.js +1 -0
- package/web/dist/assets/chunk-KS7C4IRE-DtL2Gzw3.js +3 -0
- package/web/dist/assets/{circle-alert-COKQc-87.js → circle-alert-B7VNkPC2.js} +1 -1
- package/web/dist/assets/circle-check-LWKCYKhA.js +1 -0
- package/web/dist/assets/{collapsible-BJ0sxcz9.js → collapsible-BuSDxSYs.js} +1 -1
- package/web/dist/assets/command-CfdVVS0V.js +1 -0
- package/web/dist/assets/{commit-list-HXZj01RO.js → commit-list-D5Nuv2HC.js} +1 -1
- package/web/dist/assets/compare-variants-BBOnUKfp.js +1 -0
- package/web/dist/assets/composer-BPIW4tmM.js +18 -0
- package/web/dist/assets/composer-attachments-DyC9yyGs.js +3 -0
- package/web/dist/assets/concerned-BIuYysOA.webp +0 -0
- package/web/dist/assets/concerned-BWTrkjRS.webp +0 -0
- package/web/dist/assets/concerned-BW_ywmzK.webp +0 -0
- package/web/dist/assets/concerned-CXQVACqJ.webp +0 -0
- package/web/dist/assets/concerned-DdsJa1t2.webp +0 -0
- package/web/dist/assets/concerned-Dlln-1nu.webp +0 -0
- package/web/dist/assets/concerned-DrSCYUQV.webp +0 -0
- package/web/dist/assets/concerned-TOjmS1qX.webp +0 -0
- package/web/dist/assets/concerned-tIx9dV3J.webp +0 -0
- package/web/dist/assets/dashboard-B_ytEQ_y.js +44 -0
- package/web/dist/assets/diff-BQScRHXz.js +3 -0
- package/web/dist/assets/diff-stat-CxDTnfya.js +1 -0
- package/web/dist/assets/diff-view-8m9Rnct7.js +13 -0
- package/web/dist/assets/{directional-usage-BtjgT5nc.js → directional-usage-BerE4wJK.js} +1 -1
- package/web/dist/assets/dist-Br4Ra_c5.js +1 -0
- package/web/dist/assets/{download-DH68Y5Vz.js → download-HBguClwD.js} +1 -1
- package/web/dist/assets/dropdown-menu-CDv5Teql.js +1 -0
- package/web/dist/assets/excited-8dK2gfAF.webp +0 -0
- package/web/dist/assets/excited-B-w6ozXs.webp +0 -0
- package/web/dist/assets/excited-B4Sch7Ub.webp +0 -0
- package/web/dist/assets/excited-BPQk8ECE.webp +0 -0
- package/web/dist/assets/excited-BRFi0cue.webp +0 -0
- package/web/dist/assets/excited-BvbUAHvw.webp +0 -0
- package/web/dist/assets/excited-CCH-VUDr.webp +0 -0
- package/web/dist/assets/excited-TMExhEMj.webp +0 -0
- package/web/dist/assets/excited-cSRbau5J.webp +0 -0
- package/web/dist/assets/{external-link-BVYdhpSK.js → external-link-Bclznsu3.js} +1 -1
- package/web/dist/assets/file-preview-DQ7iQhe0.js +2 -0
- package/web/dist/assets/{file-DYpKJvYs.js → file-rCLi_p-R.js} +1 -1
- package/web/dist/assets/file-tree-Bm38qEZP.js +1 -0
- package/web/dist/assets/focused-XMnI1Trp.webp +0 -0
- package/web/dist/assets/{folder-CeFUSrsO.js → folder-leteY9jH.js} +1 -1
- package/web/dist/assets/follow-up-engine-Q1EcpRpB.js +1 -0
- package/web/dist/assets/git-pull-request-CURFMFaU.js +1 -0
- package/web/dist/assets/{git-pull-request-draft-DL1VMp1L.js → git-pull-request-draft-BZgJrUou.js} +1 -1
- package/web/dist/assets/git-tab-loading-CF0flOMS.js +1 -0
- package/web/dist/assets/github-DcvXvc4J.js +1 -0
- package/web/dist/assets/happy-B7LJPne_.webp +0 -0
- package/web/dist/assets/happy-CCpAho8w.webp +0 -0
- package/web/dist/assets/happy-Ch9wxHii.webp +0 -0
- package/web/dist/assets/happy-CnoCjXOf.webp +0 -0
- package/web/dist/assets/happy-DVeEwiyo.webp +0 -0
- package/web/dist/assets/happy-URIT6hFl.webp +0 -0
- package/web/dist/assets/happy-ZufSdCLm.webp +0 -0
- package/web/dist/assets/happy-kfLwwDLp.webp +0 -0
- package/web/dist/assets/happy-nVffy2Sx.webp +0 -0
- package/web/dist/assets/{host-usage-o1rC0TiP.js → host-usage-CX8OXl8q.js} +1 -1
- package/web/dist/assets/icon-tooltip-BMkyRHLt.js +1 -0
- package/web/dist/assets/impact-control-Deh1F44q.js +1 -0
- package/web/dist/assets/impact-model-Dj6tIycu.js +1 -0
- package/web/dist/assets/index-DuW72uFI.js +33 -0
- package/web/dist/assets/index-jRkTI5kE.css +2 -0
- package/web/dist/assets/{input-BxjGaO_P.js → input-BO795Un9.js} +1 -1
- package/web/dist/assets/laptop-D2EKUOdE.webp +0 -0
- package/web/dist/assets/layers-YoqiEcNh.js +1 -0
- package/web/dist/assets/layout-cards-Cvq2XaJL.js +1 -0
- package/web/dist/assets/{layout-grid-C4d5rrDE.js → layout-grid-CSvbdC6i.js} +1 -1
- package/web/dist/assets/left-BBmAC9hS.webp +0 -0
- package/web/dist/assets/left-BUX98ijg.webp +0 -0
- package/web/dist/assets/left-CCrTs359.webp +0 -0
- package/web/dist/assets/left-CxWtAZHp.webp +0 -0
- package/web/dist/assets/left-DDCoVDRG.webp +0 -0
- package/web/dist/assets/left-DFGwPnRL.webp +0 -0
- package/web/dist/assets/left-D_qxT7z_.webp +0 -0
- package/web/dist/assets/left-QXVHT2zO.webp +0 -0
- package/web/dist/assets/left-S_rwAL-X.webp +0 -0
- package/web/dist/assets/leg-left-0EW5L4pu.webp +0 -0
- package/web/dist/assets/leg-left-BGo9dZbQ.webp +0 -0
- package/web/dist/assets/leg-left-BZ8ETYLj.webp +0 -0
- package/web/dist/assets/leg-left-BahG1x_b.webp +0 -0
- package/web/dist/assets/leg-left-C-DJQ3Pt.webp +0 -0
- package/web/dist/assets/leg-left-C6ZvH8fW.webp +0 -0
- package/web/dist/assets/leg-left-DsfFyCf7.webp +0 -0
- package/web/dist/assets/leg-left-Iq6VC-OZ.webp +0 -0
- package/web/dist/assets/leg-left-rVU9cV-d.webp +0 -0
- package/web/dist/assets/leg-right-2MnCGKHj.webp +0 -0
- package/web/dist/assets/leg-right-BCgv_Tjj.webp +0 -0
- package/web/dist/assets/leg-right-BOxKTHZ9.webp +0 -0
- package/web/dist/assets/leg-right-BeDSbUV7.webp +0 -0
- package/web/dist/assets/leg-right-BwrF93s6.webp +0 -0
- package/web/dist/assets/leg-right-CU-y_n5h.webp +0 -0
- package/web/dist/assets/leg-right-DKSfNi2y.webp +0 -0
- package/web/dist/assets/leg-right-Dq0ze2e4.webp +0 -0
- package/web/dist/assets/leg-right-t34e1CvD.webp +0 -0
- package/web/dist/assets/lib-BQXq3kEf.js +1 -0
- package/web/dist/assets/loader-circle-DjzuGw6j.js +1 -0
- package/web/dist/assets/manager-chat-C4QqN-w6.js +1 -0
- package/web/dist/assets/manager-index-BGNDfiIy.js +1 -0
- package/web/dist/assets/manager-new-Dek6H9Bg.js +2 -0
- package/web/dist/assets/managers-Dufza9IX.js +1 -0
- package/web/dist/assets/{markdown-Di8pirEb.js → markdown-CP2EQDsL.js} +1 -1
- package/web/dist/assets/{markdown-rDA5iFAU.js → markdown-YWy3FUHK.js} +2 -2
- package/web/dist/assets/mascot-picker-0_LGzV_f.js +1 -0
- package/web/dist/assets/{message-square-CstvkIHe.js → message-square-beq8DjLH.js} +1 -1
- package/web/dist/assets/new-task-form-BgMiEphZ.js +2 -0
- package/web/dist/assets/pencil-RUM53auZ.js +1 -0
- package/web/dist/assets/picker-pill-BO6YUs1F.js +1 -0
- package/web/dist/assets/play-Cj3p2Q5t.js +1 -0
- package/web/dist/assets/plus-Bdmhj8CR.js +1 -0
- package/web/dist/assets/portrait-BJ2e30PF.webp +0 -0
- package/web/dist/assets/portrait-BeDbYw8Z.webp +0 -0
- package/web/dist/assets/portrait-Bq7D7LzX.webp +0 -0
- package/web/dist/assets/portrait-C6HtaggP.webp +0 -0
- package/web/dist/assets/portrait-CcOzDXGs.webp +0 -0
- package/web/dist/assets/portrait-D44z6yep.webp +0 -0
- package/web/dist/assets/portrait-DHLQRy13.webp +0 -0
- package/web/dist/assets/portrait-DU3qlTxc.webp +0 -0
- package/web/dist/assets/portrait-q94U_uD6.webp +0 -0
- package/web/dist/assets/project-router-xmadY-N9.js +1 -0
- package/web/dist/assets/queries-ba5qZ3kd.js +1 -0
- package/web/dist/assets/reasoning-effort-pill-B8Z1RaXL.js +1 -0
- package/web/dist/assets/reference-chip-C9pVQk05.js +1 -0
- package/web/dist/assets/reference-conflict-action-DxUm18aD.js +1 -0
- package/web/dist/assets/repo-git-DFf8ZGZv.js +1 -0
- package/web/dist/assets/right-BFOa1Ihi.webp +0 -0
- package/web/dist/assets/right-BLsBZrK1.webp +0 -0
- package/web/dist/assets/right-BVU3rYuj.webp +0 -0
- package/web/dist/assets/right-BbES4jIG.webp +0 -0
- package/web/dist/assets/right-C2klSA-G.webp +0 -0
- package/web/dist/assets/right-Cte2BTL5.webp +0 -0
- package/web/dist/assets/right-Dz7jYN17.webp +0 -0
- package/web/dist/assets/right-W2oGaUHb.webp +0 -0
- package/web/dist/assets/right-XJjUU0AU.webp +0 -0
- package/web/dist/assets/run-actions-CLIUiXwS.js +1 -0
- package/web/dist/assets/{run-diff-CFHlmgGA.js → run-diff-CxS_a1EO.js} +2 -2
- package/web/dist/assets/{save-C4TDysfG.js → save-zfKVAo2Y.js} +1 -1
- package/web/dist/assets/{scroll-within-D3mqUngk.js → scroll-within-DhWf-4MN.js} +1 -1
- package/web/dist/assets/search-CCE2KMtX.js +1 -0
- package/web/dist/assets/{search-x-BkezzsKh.js → search-x-BxcYdvqm.js} +1 -1
- package/web/dist/assets/{settings-2-DIHmg7wZ.js → settings-2-B0yYRU0q.js} +1 -1
- package/web/dist/assets/sheet-DxqNqi5S.js +1 -0
- package/web/dist/assets/skills-BmQ9hZ2c.js +1 -0
- package/web/dist/assets/sortable.esm-Dj7Kk-Wk.js +5 -0
- package/web/dist/assets/square--LrBHma0.js +1 -0
- package/web/dist/assets/standing-C42GacCE.webp +0 -0
- package/web/dist/assets/standing-C5Tul1Nv.webp +0 -0
- package/web/dist/assets/standing-CUU2Jka6.webp +0 -0
- package/web/dist/assets/standing-Ca5nprIS.webp +0 -0
- package/web/dist/assets/standing-CgOaMKRT.webp +0 -0
- package/web/dist/assets/standing-ClF4PE2-.webp +0 -0
- package/web/dist/assets/standing-CoS9fBjb.webp +0 -0
- package/web/dist/assets/standing-DZrhVTuG.webp +0 -0
- package/web/dist/assets/standing-MhG0Chks.webp +0 -0
- package/web/dist/assets/status-dot-Dxb9pPsK.js +1 -0
- package/web/dist/assets/tabs-CmEFauE4.js +1 -0
- package/web/dist/assets/{tag-B56iP2zA.js → tag-TWBVKabJ.js} +1 -1
- package/web/dist/assets/task-commits-sdhrDSta.js +1 -0
- package/web/dist/assets/{task-graph-ZjFyDrAV.js → task-graph-DqXUw-PM.js} +1 -1
- package/web/dist/assets/task-notes-ur3eZYQs.js +1 -0
- package/web/dist/assets/task-workspace-BvamqKbw.js +28 -0
- package/web/dist/assets/terminal-CmRAOyqu.js +1 -0
- package/web/dist/assets/terminal-drawer-BiRjtnip.js +1 -0
- package/web/dist/assets/{terminal-pane-CeYi-FvS.js → terminal-pane-YnSc_Vhs.js} +2 -2
- package/web/dist/assets/{textarea-BXN4nZ0d.js → textarea-C58jseO-.js} +1 -1
- package/web/dist/assets/toaster-5ad4wwJ9.js +1 -0
- package/web/dist/assets/tooltip-45rfBiq8.js +1 -0
- package/web/dist/assets/tracker-CcyqVPEo.js +4 -0
- package/web/dist/assets/triangle-alert-C1mTIqxM.js +1 -0
- package/web/dist/assets/typing-left-BWPbVi7e.webp +0 -0
- package/web/dist/assets/typing-right-HDY0V90O.webp +0 -0
- package/web/dist/assets/{upload-D_kW6AjR.js → upload-C2gxSnMR.js} +1 -1
- package/web/dist/assets/use-now-DD2atNhs.js +1 -0
- package/web/dist/assets/utils-Br_dqwn-.js +60 -0
- package/web/dist/assets/{workflow-j8scU63W.js → workflow-WvO4bTRt.js} +1 -1
- package/web/dist/assets/workflow-graph-B2oESW5u.js +13 -0
- package/web/dist/assets/worktree-lifecycle-BxYvSKsA.js +1 -0
- package/web/dist/assets/{worktree-lifecycle-operation-mYB7KCpQ.js → worktree-lifecycle-operation-BRID04bW.js} +1 -1
- package/web/dist/assets/x-CZSnHsZ4.js +1 -0
- package/web/dist/assets/{zoomable-image-CW-pQ6ZO.js → zoomable-image-DCITEnK-.js} +1 -1
- package/web/dist/index.html +70 -60
- package/web/dist/assets/agent-task-pickers-8skJH9bS.js +0 -1
- package/web/dist/assets/arrow-down-cBTb_EjO.js +0 -1
- package/web/dist/assets/arrow-left-BvR1Oqhc.js +0 -1
- package/web/dist/assets/arrow-up-Cn0IS81u.js +0 -1
- package/web/dist/assets/ask-answer-Cfb0vEFv.js +0 -1
- package/web/dist/assets/automations-route-B4axw9eb.js +0 -1
- package/web/dist/assets/check-B5omShEO.js +0 -1
- package/web/dist/assets/chevron-left-D74_-PJ_.js +0 -1
- package/web/dist/assets/chevron-right-C3fLn_fF.js +0 -1
- package/web/dist/assets/circle-check-j6r9xbE5.js +0 -1
- package/web/dist/assets/compare-variants-CDrFR7P_.js +0 -1
- package/web/dist/assets/composer-GntpkeQD.js +0 -18
- package/web/dist/assets/composer-attachments-Xa-qW8Eq.js +0 -3
- package/web/dist/assets/dashboard-CJW-Xk7f.js +0 -44
- package/web/dist/assets/diff-RPASOQVF.js +0 -3
- package/web/dist/assets/diff-view-Ckaab4uQ.js +0 -13
- package/web/dist/assets/file-preview-DOSEbcqV.js +0 -2
- package/web/dist/assets/git-tab-loading-DhclV71X.js +0 -1
- package/web/dist/assets/git-toolbar-Bk-3i42V.js +0 -1
- package/web/dist/assets/github-TdBnzj-H.js +0 -1
- package/web/dist/assets/icon-tooltip-CUJLXOxf.js +0 -1
- package/web/dist/assets/index-CDhEdFaZ.js +0 -33
- package/web/dist/assets/index-Dk1VTlxY.css +0 -2
- package/web/dist/assets/layout-cards-BYOEsNbu.js +0 -1
- package/web/dist/assets/lib-D2__YoPr.js +0 -1
- package/web/dist/assets/loader-circle-DCpZCAyT.js +0 -1
- package/web/dist/assets/manager-chat-B1Taq3Eg.js +0 -1
- package/web/dist/assets/manager-index-COwisKDf.js +0 -1
- package/web/dist/assets/manager-new-BdJPiBs2.js +0 -2
- package/web/dist/assets/manager-pickers-CvYpd5cU.js +0 -1
- package/web/dist/assets/managers-CDiETPHi.js +0 -1
- package/web/dist/assets/pencil-DWtoOm2f.js +0 -1
- package/web/dist/assets/picker-pill-DQICTO2N.js +0 -1
- package/web/dist/assets/play-BYwEI1EA.js +0 -1
- package/web/dist/assets/plus-BPopgSYQ.js +0 -1
- package/web/dist/assets/popover-DzdYqnHw.js +0 -1
- package/web/dist/assets/project-router-CmpQcVZp.js +0 -1
- package/web/dist/assets/queries-DOHu2y2B.js +0 -1
- package/web/dist/assets/reference-chip-ty5g_OLC.js +0 -1
- package/web/dist/assets/reference-conflict-action-B2LrO-o3.js +0 -1
- package/web/dist/assets/repo-git-CyoBxHfP.js +0 -1
- package/web/dist/assets/sheet-7RYAcp_E.js +0 -1
- package/web/dist/assets/skills-BBqk5FoM.js +0 -1
- package/web/dist/assets/sortable.esm-O2daV3YI.js +0 -5
- package/web/dist/assets/square-BPbl10lx.js +0 -1
- package/web/dist/assets/status-dot-C_5ryAFi.js +0 -1
- package/web/dist/assets/tabs-EEnYYrJF.js +0 -1
- package/web/dist/assets/task-commits-DFalvqkF.js +0 -1
- package/web/dist/assets/task-notes-DRDKGsIw.js +0 -1
- package/web/dist/assets/task-workspace-D2ak5sTE.js +0 -28
- package/web/dist/assets/terminal-B-JX8x9P.js +0 -1
- package/web/dist/assets/terminal-drawer-S0cBMANF.js +0 -1
- package/web/dist/assets/toaster-DrFdGtNN.js +0 -3
- package/web/dist/assets/tooltip-p6YPEpXC.js +0 -1
- package/web/dist/assets/tracker-CFDEuaFt.js +0 -4
- package/web/dist/assets/triangle-alert-Crbc2knA.js +0 -1
- package/web/dist/assets/use-now-DQpgbshl.js +0 -1
- package/web/dist/assets/utils-Df_1kJEk.js +0 -60
- package/web/dist/assets/workflow-graph-Cye5SBdg.js +0 -13
- package/web/dist/assets/worktree-lifecycle-Da61xsLH.js +0 -1
- package/web/dist/assets/x-sQR-jRBj.js +0 -1
package/dist/server/server.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadGithubAsset } from './forge/github-assets.js';
|
|
1
2
|
import { createWebhookRoutes } from './webhooks.js';
|
|
2
3
|
import { WebhookCoordinator } from '../webhooks/coordinator.js';
|
|
3
4
|
import { webhooksEnabled } from '../webhooks/service.js';
|
|
@@ -20,6 +21,7 @@ import { createManagerInputSchema, managerActionDecisionInputSchema, managerActi
|
|
|
20
21
|
import { ManagerEngine } from '../managers/engine.js';
|
|
21
22
|
import { ManagerStore } from '../managers/store.js';
|
|
22
23
|
import { publishProjectGithubInputSchema } from '../contract/index.js';
|
|
24
|
+
import { automationsExportQuerySchema, automationImportPreviewInputSchema, automationImportInputSchema, configBundleExportQuerySchema, configBundlePreviewInputSchema, configBundleImportInputSchema } from '../contract/index.js';
|
|
23
25
|
import { deleteRunLayouts, readRunLayouts, writeRunLayouts } from '../runs/layouts.js';
|
|
24
26
|
import { discoverCommands, installCommand } from './terminal/commands.js';
|
|
25
27
|
import { effectiveStartApp, readStartApp, writeStartApp } from '../start-app.js';
|
|
@@ -36,10 +38,14 @@ import { TrackerPoller } from '../automations/tracker-poller.js';
|
|
|
36
38
|
import { ProjectAutomationScheduler, ProjectTrackerAutomationScheduler, WorkspaceAutomationScheduler } from '../automations/scheduler.js';
|
|
37
39
|
import { ScheduleRunner } from '../automations/schedule-runner.js';
|
|
38
40
|
import { automationStats } from '../automations/stats.js';
|
|
41
|
+
import { automationWork, pauseHoldsDispatch, queuedToCancel } from '../automations/paused-work.js';
|
|
39
42
|
import { automationTemplatesOf } from '../automations/templates.js';
|
|
43
|
+
import { exportAutomations, planAutomationImport } from '../transfer/automations-file.js';
|
|
44
|
+
import { applyConfigBundle, buildConfigBundle, planConfigBundle, projectRemote } from '../transfer/config-bundle.js';
|
|
45
|
+
import { automationEditableSchema, automationInputIssue, automationKindIssue, oncePassedIssue } from '../automations/validate-input.js';
|
|
40
46
|
import { AutomationLaunchOutcome, launchAutomationRun, launchScheduledRun, launchTrackerAutomationRun, rebaselineIdleAutomations, reconcileAutomationReceipts, validateAutomationPrompt } from '../automations/task-template.js';
|
|
41
|
-
import { automationEventSchema,
|
|
42
|
-
import {
|
|
47
|
+
import { automationEventSchema, automationLogResultSchema, isGithubAutomation, isTrackerAutomation, isScheduleAutomation, } from '../automations/types.js';
|
|
48
|
+
import { trackerAutomationOptionsSchema, trackerAutomationOptionsQuerySchema, schedulesOf, nextScheduleOccurrence, localTimeZone } from '../contract/index.js';
|
|
43
49
|
import { access, constants as fsConstants, lstat, mkdir, readFile, realpath, stat, unlink, writeFile } from 'node:fs/promises';
|
|
44
50
|
import { basename, dirname, join, posix, resolve, sep } from 'node:path';
|
|
45
51
|
import { fileURLToPath } from 'node:url';
|
|
@@ -52,13 +58,12 @@ import { jsonZodValidator, multipartZodValidator, paramZodValidator, queryZodVal
|
|
|
52
58
|
import { getAgentFallbackPolicyQuerySchema, putAgentFallbackPolicySchema } from '../contract/index.js';
|
|
53
59
|
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
|
|
54
60
|
import { z } from 'zod';
|
|
55
|
-
import { PROMPT_TEMPLATE_TEXT_MAX, automationListPreferencesSchema, setWorkspaceUiStateInputSchema, setWorkspaceConfigInputSchema, designProxyRequestSchema, workspaceBrandingLogoResponseSchema, githubListQuerySchema, } from '../contract/index.js';
|
|
61
|
+
import { PROMPT_TEMPLATE_TEXT_MAX, automationListPreferencesSchema, setWorkspaceUiStateInputSchema, setWorkspaceConfigInputSchema, designProxyRequestSchema, workspaceBrandingLogoResponseSchema, githubAssetInputSchema, githubListQuerySchema, } from '../contract/index.js';
|
|
56
62
|
// A contract VALUE, like `workspaceUiStateSchema` in workspace/migrations.ts — the request
|
|
57
63
|
// schema this route validates with is the same one the client compiles against.
|
|
58
|
-
import { ATTACHMENT_IMAGES_TOO_LARGE, ATTACHMENT_UPLOAD_MISSING, attachmentInputSchema, attachmentListSchema, continueInputSchema, deleteUploadResponseSchema, isImageMediaType, MAX_ATTACHMENTS_TOTAL_BASE64, stagedUploadSchema, uploadIdParamSchema, modelDiscoveryRunnerSchema, openProjectInSchema, registerProjectInputSchema, updateProjectInputSchema, } from '../contract/index.js';
|
|
59
|
-
import { dispatchInputSchema,
|
|
64
|
+
import { ATTACHMENT_IMAGES_TOO_LARGE, ATTACHMENT_UPLOAD_MISSING, attachmentInputSchema, attachmentListSchema, continueInputSchema, createRunInputSchema, deleteUploadResponseSchema, isImageMediaType, MAX_ATTACHMENTS_TOTAL_BASE64, stagedUploadSchema, uploadIdParamSchema, modelDiscoveryRunnerSchema, openProjectInSchema, startTodoInputSchema, registerProjectInputSchema, updateProjectInputSchema, } from '../contract/index.js';
|
|
65
|
+
import { dispatchInputSchema, dispatchReportSchema } from '../contract/index.js';
|
|
60
66
|
import { phoneDeviceParamSchema, phonePairingParamSchema, renamePhoneInputSchema, setRelayAddressInputSchema, testRelayAddressInputSchema } from '../contract/index.js';
|
|
61
|
-
import { hasTaskOrAttachments, TASK_OR_ATTACHMENTS_ISSUE } from '../contract/index.js';
|
|
62
67
|
import { detectEnvironment } from '../core/backend-detect.js';
|
|
63
68
|
import { resolveCursorAgentBin } from '../core/cursor-bin.js';
|
|
64
69
|
import { resolveAntigravityBin } from '../core/antigravity-runner.js';
|
|
@@ -71,6 +76,7 @@ import { discoverCursorModels } from '../core/cursor-model-catalog.js';
|
|
|
71
76
|
import { discoverAntigravityModels } from '../core/antigravity-model-catalog.js';
|
|
72
77
|
import { discoverOpencodeModels } from '../core/opencode-model-catalog.js';
|
|
73
78
|
import { discoverJunieModels } from '../core/junie-model-catalog.js';
|
|
79
|
+
import { discoverKimiModels } from '../core/kimi-model-catalog.js';
|
|
74
80
|
import { PROVIDER_IDS, ProviderAuthService, providerAuthChecksDisabled, } from '../core/provider-auth.js';
|
|
75
81
|
import { applyProviderEnablement } from '../core/provider-availability.js';
|
|
76
82
|
import { LOGIN_WATCH_OFFSETS_MS, reportInconclusiveProbe, trackLoginNotOpened, trackLoginOpened, trackUpdateOpened, watchLogin, } from './provider-telemetry.js';
|
|
@@ -91,13 +97,19 @@ import { DesignProxies } from './preview/design-proxy.js';
|
|
|
91
97
|
import { getTeamSkillsCached, isSafeRef, refreshTeamSkills, safeRemoteFor, waitForTeamSkills } from '../skills-remote.js';
|
|
92
98
|
import { appendHandoffHeartbeat, handoffProgressExcerpt, readHandoff } from '../handoff.js';
|
|
93
99
|
import { markStarted, onTodosChanged, readTodos, removeTodo, todoTaskText } from '../todos.js';
|
|
100
|
+
import { artifactsDir } from '../runs/store.js';
|
|
101
|
+
import { artifactsCdnEnabled, existingVersionDir, findArtifact, scanArtifacts } from '../runs/artifacts.js';
|
|
102
|
+
import { artifactHeaders, artifactsBaseUrl, artifactsFrame, openArtifact } from './artifacts.js';
|
|
103
|
+
import { newestSubjectRun, parseSubjectQuery, resolveImpactSubject, subjectStale } from '../impact/launch.js';
|
|
104
|
+
import { listProjectAssets } from '../runs/project-assets.js';
|
|
105
|
+
import { ASSESS_IMPACT_WORKFLOW } from '../workflows/templates.js';
|
|
94
106
|
import { onRunFrames } from './run-frames.js';
|
|
95
|
-
import { HistoryCursorError, deriveRunContextEvents, readEventsAfterLiveCursor, readRunHistoryPage,
|
|
107
|
+
import { HistoryCursorError, deriveRunContextEvents, readEventsAfterLiveCursor, readRunHistoryPage, readEventsTail, validateLiveCursor, } from '../runs/event-history.js';
|
|
96
108
|
import { byLastActivityDesc, compareIsoDesc, lastActivityAt, readRunIndexFromDisk } from '../runs/run-index.js';
|
|
97
109
|
import { isV2WireEventType } from '../runs/ui-event-sink.js';
|
|
98
110
|
import { onRunDeleted, onRunEvent } from './sse-subscriptions.js';
|
|
99
111
|
import { countRunDraftImages, deleteRunDraftImage, deleteRunDraftSurface, readRunDraftImage, readRunDrafts, writeRunDraftImage, writeRunDraftSurface, } from '../runs/drafts.js';
|
|
100
|
-
import { draftImageInputSchema, draftImageParamSchema, draftSurfaceParamSchema, DRAFT_MAX_IMAGES, runEventsQuerySchema, runHistoryQuerySchema, runIdParamSchema, setRunDraftInputSchema, repoFileQuerySchema, } from '../contract/index.js';
|
|
112
|
+
import { draftImageInputSchema, draftImageParamSchema, draftSurfaceParamSchema, DRAFT_MAX_IMAGES, runEventsQuerySchema, runHistoryQuerySchema, runIdParamSchema, artifactNameParamSchema, artifactNestedParamSchema, artifactFileQuerySchema, artifactsBySubjectQuerySchema, startImpactSchema, setRunDraftInputSchema, repoFileQuerySchema, } from '../contract/index.js';
|
|
101
113
|
import { setFallbackProviderCheck, toPastedContent } from '../workflows/run.js';
|
|
102
114
|
import { foldedLength, imageChars, MAX_FOLDED_TASK_CHARS, MAX_QUEUED_ATTACHMENTS, QUEUED_IMAGES_TOO_LARGE, queuedImageChars, queuedStackRefusal, } from '../workflows/queued-bounds.js';
|
|
103
115
|
import { checkoutGitStatus } from '../workflows/landing.js';
|
|
@@ -136,7 +148,7 @@ import { GH_LOGIN_MISSING, createDryRunGithubLogin, createGithubLogin } from './
|
|
|
136
148
|
import { suggestRepositories } from './repo-suggestions.js';
|
|
137
149
|
import { ProjectContextError, ProjectContexts } from './project-context.js';
|
|
138
150
|
import { fetchRepo, pullRepo, pushRepo, repoSyncStatus, syncRepo } from './repo-sync.js';
|
|
139
|
-
import { reviewGateEnabled } from '../runs/review-gate.js';
|
|
151
|
+
import { assessedWithoutChanges, reviewGateEnabled } from '../runs/review-gate.js';
|
|
140
152
|
import { readUiState, uiStatePath } from '../ui-state.js';
|
|
141
153
|
import { agentHomePaths, cezarHomeDir, expandTilde, isAbsolutePath } from '../paths.js';
|
|
142
154
|
import { renameWithRetry } from '../fs-rename.js';
|
|
@@ -155,7 +167,7 @@ import { openInTerminal } from './open-in-terminal.js';
|
|
|
155
167
|
import { agentSetupRoutes } from './agent-setup-routes.js';
|
|
156
168
|
import { agentCliRunner, detectOpenTargets, openFileInDefaultApp, openInApp, withResolvedClaudeBin, } from './open-in-app.js';
|
|
157
169
|
import { createDraftPr } from './pr.js';
|
|
158
|
-
import { findBranchPr, resolvePrTarget } from './forge/github.js';
|
|
170
|
+
import { findBranchPr, peekPrHeadSha, resolvePrTarget } from './forge/github.js';
|
|
159
171
|
import { DEFAULT_TELEMETRY_URL, TELEMETRY_POLICY_VERSION, deviceSid, loadTelemetryConsent, reportError, setTelemetryConsent, telemetryBlockedBy, track, } from '../telemetry.js';
|
|
160
172
|
import { automationLabel } from '../feature-telemetry.js';
|
|
161
173
|
import { setTelemetryConsentInputSchema, telemetryErrorInputSchema, telemetryEventInputSchema, telemetryPageInputSchema, } from '../contract/index.js';
|
|
@@ -251,63 +263,6 @@ const providerEnabledSchema = z.object({ enabled: z.boolean() }).strict();
|
|
|
251
263
|
const providerRetrySchema = z.object({
|
|
252
264
|
authFailureId: z.string().min(1).max(128),
|
|
253
265
|
}).strict();
|
|
254
|
-
const automationEditableSchema = z
|
|
255
|
-
.object({
|
|
256
|
-
name: z.string().trim().min(1).max(200),
|
|
257
|
-
description: z.string().max(2_000).optional(),
|
|
258
|
-
enabled: z.boolean().optional(),
|
|
259
|
-
/** Omitted on create = `github`; omitted on update = the stored kind (spec 2026-09-14). */
|
|
260
|
-
kind: z.enum(['github', 'schedule', 'tracker']).optional(),
|
|
261
|
-
events: z.array(automationEventSchema).min(1).max(7).optional(),
|
|
262
|
-
intervalSeconds: z.number().int().min(60).max(86_400).optional(),
|
|
263
|
-
filters: automationFiltersSchema.optional(),
|
|
264
|
-
trackerTrigger: trackerTriggerSchema.optional(),
|
|
265
|
-
schedule: automationScheduleSchema.optional(),
|
|
266
|
-
schedules: automationSchedulesSchema.optional(),
|
|
267
|
-
task: automationTaskSchema,
|
|
268
|
-
})
|
|
269
|
-
.strict();
|
|
270
|
-
/**
|
|
271
|
-
* The kind rules the storage schema also enforces, answered as a 400 message rather than a zod
|
|
272
|
-
* issue path (spec 2026-09-14 § Data Model): a poll needs its three keys; a schedule needs its
|
|
273
|
-
* schedule and carries no GitHub filter.
|
|
274
|
-
*/
|
|
275
|
-
function automationKindIssue(body, kind) {
|
|
276
|
-
const timingIssue = automationScheduleIssue(body, kind);
|
|
277
|
-
if (timingIssue)
|
|
278
|
-
return timingIssue;
|
|
279
|
-
// Tracker automations have no create/edit route yet (2026-09-19): hand-authored into
|
|
280
|
-
// `automations.json` only. Refuse explicitly rather than misapplying the GitHub filter rules
|
|
281
|
-
// below to one that reaches this far (e.g. a PUT that omits `kind` on an existing tracker row).
|
|
282
|
-
if (kind === 'tracker')
|
|
283
|
-
return body.trackerTrigger ? null : 'Choose an event to finish configuring this automation';
|
|
284
|
-
if (kind === 'schedule') {
|
|
285
|
-
if (body.events || body.filters || body.intervalSeconds !== undefined || body.trackerTrigger)
|
|
286
|
-
return 'a scheduled automation has no GitHub filter';
|
|
287
|
-
return null;
|
|
288
|
-
}
|
|
289
|
-
if (!body.events?.length)
|
|
290
|
-
return 'a GitHub automation needs at least one event';
|
|
291
|
-
if (body.intervalSeconds === undefined)
|
|
292
|
-
return 'a GitHub automation needs a poll interval';
|
|
293
|
-
if (!body.filters)
|
|
294
|
-
return 'a GitHub automation needs its bounded filter';
|
|
295
|
-
if (body.schedule)
|
|
296
|
-
return 'a GitHub automation has no schedule';
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* A one-time schedule can only be ENABLED while its instant is still ahead (#771): enabling one
|
|
301
|
-
* that has passed would arm nothing and sit "enabled" forever. Saved paused, it is a draft and is
|
|
302
|
-
* accepted; Run now still works on it.
|
|
303
|
-
*/
|
|
304
|
-
function oncePassedIssue(schedule, enabled, now = Date.now()) {
|
|
305
|
-
if (!enabled || schedule?.type !== 'once')
|
|
306
|
-
return null;
|
|
307
|
-
if (nextOccurrence(schedule, now, localTimeZone()) !== null)
|
|
308
|
-
return null;
|
|
309
|
-
return `the one-time schedule (${scheduleLabel(schedule)}, ${localTimeZone()}) is not in the future; pick a later time`;
|
|
310
|
-
}
|
|
311
266
|
const automationCreateSchema = automationEditableSchema.extend({ enable: z.boolean().optional() });
|
|
312
267
|
const automationUpdateSchema = automationEditableSchema.extend({ expectedRevision: z.number().int().positive() });
|
|
313
268
|
const automationCheckRequestSchema = z.object({ mode: z.enum(['preview', 'execute']) }).strict();
|
|
@@ -420,78 +375,11 @@ const streamSSENoBuffer = (c, cb, onError) => {
|
|
|
420
375
|
res.headers.set('X-Accel-Buffering', 'no');
|
|
421
376
|
return res;
|
|
422
377
|
};
|
|
423
|
-
// A run starts from a named workflow OR an inline chain of steps (spec 008 —
|
|
424
|
-
// the approved plan is posted as-is, never written to a file).
|
|
425
|
-
const startRunSchema = z
|
|
426
|
-
.object({
|
|
427
|
-
workflow: z.string().min(1).optional(),
|
|
428
|
-
steps: z.array(workflowStepSchema).min(1).max(8).optional(),
|
|
429
|
-
// The primary agent prompt handed to the spawned runner. Bounded like the
|
|
430
|
-
// other prompt fields (`systemPrompt` 20k, message `text` 100k) so an
|
|
431
|
-
// unbounded body can't be piped into a spawned process (#429). 100k chars
|
|
432
|
-
// (~25k tokens) is well past any hand-written task. May be empty when attachments carry the
|
|
433
|
-
// task (telemetry 18c930de) — the refine below requires one or the other.
|
|
434
|
-
task: z.string().max(100_000, 'must be at most 100000 characters'),
|
|
435
|
-
model: z.string().optional(),
|
|
436
|
-
// Agent backend for this task (falls back to config `defaultRunner`).
|
|
437
|
-
runner: z.enum(RUNNER_IDS).optional(),
|
|
438
|
-
// Agent account for this task (spec 2026-07-29-agent-profiles). Falls back to the project's
|
|
439
|
-
// own selection, then the discovered default. Bounded like a profile id in the workspace
|
|
440
|
-
// schema, so a value this route accepts can never be degraded away by the next load.
|
|
441
|
-
agentProfile: z.string().max(64).optional(),
|
|
442
|
-
// Parallel variants (spec 010): ×2/×3 runs the task as 2–3 competing
|
|
443
|
-
// agents in separate worktrees; the user compares diffs and picks one.
|
|
444
|
-
variants: z.number().int().min(1).max(3).optional(),
|
|
445
|
-
// Composer worktree opt-out (#worktree-toggle): false runs in the repo
|
|
446
|
-
// working tree. Ignored when variants > 1.
|
|
447
|
-
worktree: z.boolean().optional(),
|
|
448
|
-
// With worktree:false, switch the checkout to a branch forked from base first
|
|
449
|
-
// (spec 2026-10-19-repo-git-sync); `branch` names it.
|
|
450
|
-
newBranch: z.boolean().optional(),
|
|
451
|
-
branch: z.string().trim().min(1).max(200).optional(),
|
|
452
|
-
// A read-only Ask task (spec 2026-10-20-trunk-based-projects): in place, no lease, no writes.
|
|
453
|
-
readOnly: z.boolean().optional(),
|
|
454
|
-
// Autonomous mode (#autonomous): the run never parks at `waiting` — it
|
|
455
|
-
// auto-continues until the agent signals done. No "needs you" is raised.
|
|
456
|
-
autonomous: z.boolean().optional(),
|
|
457
|
-
// Generate follow-up inbox entries (spec 007, #444). Honoured only while
|
|
458
|
-
// the `followups` capability is on (#471) — off, the server pins it to
|
|
459
|
-
// false whatever the client asked for. Omitted still means "enabled" for
|
|
460
|
-
// old clients, but only within an already-enabled server. The handoff
|
|
461
|
-
// journal is unaffected either way.
|
|
462
|
-
generateFollowups: z.boolean().optional(),
|
|
463
|
-
// Per-run system-prompt override (R2 2.3) — programmatic callers only
|
|
464
|
-
// (bookmarklets, scripts); deliberately NOT a composer-UI control. Wins
|
|
465
|
-
// over the config.json default; whitespace-only degrades to absent.
|
|
466
|
-
systemPrompt: z
|
|
467
|
-
.string()
|
|
468
|
-
.trim()
|
|
469
|
-
.max(20_000, 'must be at most 20000 characters')
|
|
470
|
-
.optional()
|
|
471
|
-
.transform((s) => (s ? s : undefined)),
|
|
472
|
-
// Attachments pasted into the new-task form — same shape and limits as a
|
|
473
|
-
// live-session message; delivered with the first agent step's opening.
|
|
474
|
-
images: attachmentListSchema.optional(),
|
|
475
|
-
// Inbox follow-up (#374): the todo the composer was prefilled from
|
|
476
|
-
// (`/new?skill=&ref=&todo=t1`). On a successful start the entry is marked
|
|
477
|
-
// started — the same bookkeeping POST /api/todos/:id/start does, so the
|
|
478
|
-
// audit trail survives the composer detour. Bounded like every other
|
|
479
|
-
// string here; a todo id is a short generated key.
|
|
480
|
-
todoId: z.string().min(1).max(200, 'must be at most 200 characters').optional(),
|
|
481
|
-
// The composer's Dispatch toggle (spec 2026-09-10-dispatch): this task is the root of a
|
|
482
|
-
// dispatch tree, within the user's limits. Dropped — not refused — when the capability is
|
|
483
|
-
// off: the task itself is still perfectly valid as an ordinary run.
|
|
484
|
-
dispatch: dispatchIntentSchema.optional(),
|
|
485
|
-
})
|
|
486
|
-
.refine((b) => Boolean(b.workflow) !== Boolean(b.steps), {
|
|
487
|
-
message: 'provide either "workflow" or "steps", not both',
|
|
488
|
-
})
|
|
489
|
-
.refine(hasTaskOrAttachments, TASK_OR_ATTACHMENTS_ISSUE);
|
|
490
378
|
const pickSchema = z.object({
|
|
491
379
|
runId: z.string().min(1),
|
|
492
380
|
});
|
|
493
381
|
const planSchema = z.object({
|
|
494
|
-
// Same bound as `
|
|
382
|
+
// Same bound as `createRunInputSchema.task` — this flows into `planChain` (#429).
|
|
495
383
|
task: z.string().trim().min(1).max(100_000, 'must be at most 100000 characters'),
|
|
496
384
|
});
|
|
497
385
|
// A saved workflow carries full `steps` OR the builder's `skills` stack
|
|
@@ -779,6 +667,8 @@ const archiveSchema = z.object({
|
|
|
779
667
|
// `POST /api/v1/runs/:id/pin` (#935) — no body pins; `{pinned:false}` unpins. The archive
|
|
780
668
|
// route's shape, deliberately: it is the same kind of per-task flag, and a second spelling for
|
|
781
669
|
// "absent means do the thing" would be one more rule for a client to remember.
|
|
670
|
+
/** Cap on a fresh cursorless SSE replay; older events stay reachable through `history` (#882). */
|
|
671
|
+
const INITIAL_REPLAY_MAX_BYTES = 1_500_000;
|
|
782
672
|
const pinSchema = z.object({
|
|
783
673
|
pinned: z.boolean().optional(),
|
|
784
674
|
surface: taskActionSurfaceSchema.optional(),
|
|
@@ -788,6 +678,8 @@ const pinSchema = z.object({
|
|
|
788
678
|
// attachments, ≤ MAX_ATTACHMENTS_TOTAL_BASE64 in total); the ui-state PUT gets a much tighter cap since
|
|
789
679
|
// it only ever carries small GUI prefs.
|
|
790
680
|
const GLOBAL_BODY_LIMIT = 32 * 1024 * 1024; // 32 MiB
|
|
681
|
+
/** Export/import files (spec 2026-11-04-automations-and-config-export-import). */
|
|
682
|
+
const TRANSFER_BODY_LIMIT = 5 * 1024 * 1024;
|
|
791
683
|
// JSON like every other refusal (#1735): the bare "Payload Too Large" text told the cockpit nothing.
|
|
792
684
|
const bodyTooLarge = (c) => c.json({ error: `request body too large — the server accepts at most ${GLOBAL_BODY_LIMIT / 1024 / 1024} MiB per request` }, 413);
|
|
793
685
|
const UI_STATE_BODY_LIMIT = 128 * 1024; // 128 KiB
|
|
@@ -1011,6 +903,7 @@ export function createApp(deps) {
|
|
|
1011
903
|
junie: { discover: () => discoverJunieModels({ cwd: bootRoot }) },
|
|
1012
904
|
cursor: { discover: () => discoverCursorModels() },
|
|
1013
905
|
antigravity: { discover: () => discoverAntigravityModels() },
|
|
906
|
+
kimi: { discover: () => discoverKimiModels() },
|
|
1014
907
|
},
|
|
1015
908
|
});
|
|
1016
909
|
const providerAuth = deps.providerAuth
|
|
@@ -1719,7 +1612,7 @@ export function createApp(deps) {
|
|
|
1719
1612
|
// `modelDiscoveryRunnerSchema` is the contract's own list of the runners with an
|
|
1720
1613
|
// authoritative host-local catalog (#794, #784), so the client compiles against exactly what
|
|
1721
1614
|
// this validates. A runner absent from it has no discovery path and this 400s.
|
|
1722
|
-
.get('/models', queryZodValidator(z.object({ runner: z.union([z.string(), z.array(z.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema) }), { message: 'runner must be claude, codex, opencode, cursor, junie, or
|
|
1615
|
+
.get('/models', queryZodValidator(z.object({ runner: z.union([z.string(), z.array(z.string()).transform((v) => v[0])]).pipe(modelDiscoveryRunnerSchema) }), { message: 'runner must be claude, codex, opencode, cursor, junie, antigravity, or kimi' }), async (c) => {
|
|
1723
1616
|
const query = { data: c.req.valid('query') };
|
|
1724
1617
|
return c.json(await modelCatalog.get(query.data.runner));
|
|
1725
1618
|
});
|
|
@@ -1850,7 +1743,7 @@ export function createApp(deps) {
|
|
|
1850
1743
|
workspaceEvents.emit('provider-status', row);
|
|
1851
1744
|
return c.json(result);
|
|
1852
1745
|
})
|
|
1853
|
-
.post('/providers/connect', jsonZodValidator(providerConnectSchema, { message:
|
|
1746
|
+
.post('/providers/connect', jsonZodValidator(providerConnectSchema, { message: `provider must be one of ${RUNNER_IDS.join(', ')}` }), async (c) => {
|
|
1854
1747
|
const body = { data: c.req.valid('json') };
|
|
1855
1748
|
const sid = deviceSid(c.req.header('x-cezar-sid'));
|
|
1856
1749
|
const provider = body.data.provider;
|
|
@@ -1983,6 +1876,7 @@ export function createApp(deps) {
|
|
|
1983
1876
|
...(profile.provider === 'codex' ? { codex: profile.path } : {}),
|
|
1984
1877
|
...(profile.provider === 'opencode' ? { opencodeConfig: profile.path } : {}),
|
|
1985
1878
|
...(profile.provider === 'cursor' ? { cursor: profile.path } : {}),
|
|
1879
|
+
...(profile.provider === 'omp' ? { omp: profile.path } : {}),
|
|
1986
1880
|
...(profile.provider === 'pi' ? { pi: profile.path } : {}),
|
|
1987
1881
|
};
|
|
1988
1882
|
const defs = listConfigFiles().filter((def) => def.scope === 'user' && def.runners.includes(profile.provider));
|
|
@@ -3901,6 +3795,10 @@ export function createApp(deps) {
|
|
|
3901
3795
|
const account = await resolveWorkspaceProfile(runner, task.agentProfile);
|
|
3902
3796
|
return 'error' in account ? account.error : null;
|
|
3903
3797
|
};
|
|
3798
|
+
const automationChecks = (project) => ({
|
|
3799
|
+
trackerTriggerIssue: (trigger) => trackerTriggerIssue(project, trigger),
|
|
3800
|
+
accountIssue: (task) => automationAccountIssue(project.root, task),
|
|
3801
|
+
});
|
|
3904
3802
|
const requireAutomations = async (c, next) => {
|
|
3905
3803
|
if (!capabilities().automations)
|
|
3906
3804
|
return c.json({ error: AUTOMATIONS_OFF }, 409);
|
|
@@ -4030,28 +3928,63 @@ export function createApp(deps) {
|
|
|
4030
3928
|
stats: stats.week,
|
|
4031
3929
|
automations,
|
|
4032
3930
|
});
|
|
3931
|
+
})
|
|
3932
|
+
// Export / import (spec 2026-11-04-automations-and-config-export-import). Registered ahead of
|
|
3933
|
+
// `/automations/:id` so `export` is never read as an id.
|
|
3934
|
+
.get('/automations/export', queryZodValidator(automationsExportQuerySchema), (c) => {
|
|
3935
|
+
const project = c.get('project');
|
|
3936
|
+
const ids = c.req.valid('query').ids?.split(',').map((id) => id.trim()).filter(Boolean);
|
|
3937
|
+
const file = exportAutomations(project.automationStore.list(), { ids, cezarVersion: deps.version });
|
|
3938
|
+
const slug = basename(project.root).replace(/[^A-Za-z0-9._-]+/g, '-') || 'project';
|
|
3939
|
+
return c.json(file, 200, {
|
|
3940
|
+
'Content-Disposition': `attachment; filename="cezar-automations-${slug}-${file.exportedAt.slice(0, 10)}.json"`,
|
|
3941
|
+
});
|
|
3942
|
+
})
|
|
3943
|
+
.use('/automations/import', bodyLimit({ maxSize: TRANSFER_BODY_LIMIT, onError: bodyTooLarge }))
|
|
3944
|
+
.use('/automations/import/*', bodyLimit({ maxSize: TRANSFER_BODY_LIMIT, onError: bodyTooLarge }))
|
|
3945
|
+
.post('/automations/import/preview', jsonZodValidator(automationImportPreviewInputSchema), async (c) => {
|
|
3946
|
+
const project = c.get('project');
|
|
3947
|
+
const { file, resolutions } = c.req.valid('json');
|
|
3948
|
+
const plan = await planAutomationImport(file, resolutions, project.automationStore.list(), {
|
|
3949
|
+
localHandoff: capabilities().localHandoff, checks: automationChecks(project),
|
|
3950
|
+
});
|
|
3951
|
+
return c.json({ rows: plan.rows, planDigest: plan.planDigest });
|
|
3952
|
+
})
|
|
3953
|
+
.post('/automations/import', jsonZodValidator(automationImportInputSchema), async (c) => {
|
|
3954
|
+
const project = c.get('project');
|
|
3955
|
+
const { file, resolutions, planDigest } = c.req.valid('json');
|
|
3956
|
+
const plan = await planAutomationImport(file, resolutions, project.automationStore.list(), {
|
|
3957
|
+
localHandoff: capabilities().localHandoff, checks: automationChecks(project),
|
|
3958
|
+
});
|
|
3959
|
+
if (plan.planDigest !== planDigest)
|
|
3960
|
+
return c.json({ error: 'the project changed since the preview — review again' }, 409);
|
|
3961
|
+
const blocked = plan.rows.find((row) => row.action !== 'skip' && row.issues.length);
|
|
3962
|
+
if (blocked)
|
|
3963
|
+
return c.json({ error: `"${blocked.name}" cannot be imported: ${blocked.issues[0]}` }, 409);
|
|
3964
|
+
let result;
|
|
3965
|
+
try {
|
|
3966
|
+
result = project.automationStore.importMany({ creates: plan.creates, replaces: plan.replaces });
|
|
3967
|
+
}
|
|
3968
|
+
catch (error) {
|
|
3969
|
+
return c.json({ error: error instanceof Error ? error.message : String(error) }, 409);
|
|
3970
|
+
}
|
|
3971
|
+
for (const automation of [...result.created, ...result.replaced])
|
|
3972
|
+
emitAutomationChange(project, automation.id, automation.revision);
|
|
3973
|
+
if (result.created.length || result.replaced.length)
|
|
3974
|
+
automationsChanged();
|
|
3975
|
+
return c.json({
|
|
3976
|
+
created: result.created.map((automation) => automation.id),
|
|
3977
|
+
replaced: result.replaced.map((automation) => automation.id),
|
|
3978
|
+
skipped: plan.rows.filter((row) => row.action === 'skip').length,
|
|
3979
|
+
}, 201);
|
|
4033
3980
|
})
|
|
4034
3981
|
.post('/automations', jsonZodValidator(() => automationCreateSchema), async (c) => {
|
|
4035
3982
|
const { automationStore } = c.get('project');
|
|
4036
3983
|
const parsed = { data: c.req.valid('json') };
|
|
4037
3984
|
const kind = parsed.data.kind ?? 'github';
|
|
4038
|
-
const
|
|
4039
|
-
if (
|
|
4040
|
-
return c.json({ error:
|
|
4041
|
-
if (kind === 'tracker') {
|
|
4042
|
-
const issue = await trackerTriggerIssue(c.get('project'), parsed.data.trackerTrigger);
|
|
4043
|
-
if (issue)
|
|
4044
|
-
return c.json({ error: issue }, 400);
|
|
4045
|
-
}
|
|
4046
|
-
const passedIssue = oncePassedIssue(schedulesOf(parsed.data)[0], parsed.data.enable === true);
|
|
4047
|
-
if (passedIssue)
|
|
4048
|
-
return c.json({ error: passedIssue }, 400);
|
|
4049
|
-
const promptIssue = validateAutomationPrompt(parsed.data.task.prompt, kind);
|
|
4050
|
-
if (promptIssue)
|
|
4051
|
-
return c.json({ error: promptIssue }, 400);
|
|
4052
|
-
const accountIssue = await automationAccountIssue(c.get('project').root, parsed.data.task);
|
|
4053
|
-
if (accountIssue)
|
|
4054
|
-
return c.json({ error: accountIssue }, 400);
|
|
3985
|
+
const issue = await automationInputIssue(parsed.data, kind, parsed.data.enable === true, automationChecks(c.get('project')));
|
|
3986
|
+
if (issue)
|
|
3987
|
+
return c.json({ error: issue }, 400);
|
|
4055
3988
|
const { enable, ...input } = parsed.data;
|
|
4056
3989
|
try {
|
|
4057
3990
|
const automation = automationStore.create({ ...input, kind, enabled: enable === true }, undefined, enable ? definition => armAutomation(automationStore, definition) : undefined);
|
|
@@ -4287,6 +4220,25 @@ export function createApp(deps) {
|
|
|
4287
4220
|
if (current.enabled)
|
|
4288
4221
|
track('automation_toggled', { label: 'paused' }, { sid: deviceSid(c.req.header('x-cezar-sid')) });
|
|
4289
4222
|
return c.json({ automation });
|
|
4223
|
+
})
|
|
4224
|
+
// What a pause leaves running (#1980): the queued and active tasks of its trees.
|
|
4225
|
+
.get('/automations/:id/work', (c) => {
|
|
4226
|
+
const project = c.get('project');
|
|
4227
|
+
if (!project.automationStore.get(c.req.param('id')))
|
|
4228
|
+
return c.json({ error: 'not found' }, 404);
|
|
4229
|
+
return c.json(automationWork(project.store.listRuns(), c.req.param('id')));
|
|
4230
|
+
})
|
|
4231
|
+
// The explicit control for that pending work: cancel is durable, so a restart cannot revive it.
|
|
4232
|
+
// A queued parent with running children is kept — cancelling it would stop them too.
|
|
4233
|
+
.post('/automations/:id/cancel-queued', (c) => {
|
|
4234
|
+
const project = c.get('project');
|
|
4235
|
+
if (!project.automationStore.get(c.req.param('id')))
|
|
4236
|
+
return c.json({ error: 'not found' }, 404);
|
|
4237
|
+
const { cancel, keep } = queuedToCancel(project.store.listRuns(), c.req.param('id'));
|
|
4238
|
+
const cancelled = [];
|
|
4239
|
+
for (const id of cancel)
|
|
4240
|
+
(project.manager.cancel(id) ? cancelled : keep).push(id);
|
|
4241
|
+
return c.json({ cancelled, kept: keep });
|
|
4290
4242
|
})
|
|
4291
4243
|
// The body is validated as MIDDLEWARE, which is what puts it in the route type — and moves
|
|
4292
4244
|
// the 400 ahead of this route's 404: `POST /automations/<unknown>/check` with a malformed
|
|
@@ -4538,8 +4490,10 @@ export function createApp(deps) {
|
|
|
4538
4490
|
/** Create ONE child of run `:id`. Refusals (cap, budget, settled parent) are 409 with the
|
|
4539
4491
|
* reason — the same text the parent's transcript notes. */
|
|
4540
4492
|
.post('/runs/:id/dispatch', jsonZodValidator(dispatchInputSchema), (c) => {
|
|
4541
|
-
const { manager } = c.get('project');
|
|
4542
|
-
const outcome = manager.dispatch(c.req.param('id'), c.req.valid('json')
|
|
4493
|
+
const { manager, automationStore } = c.get('project');
|
|
4494
|
+
const outcome = manager.dispatch(c.req.param('id'), c.req.valid('json'), {
|
|
4495
|
+
automationPaused: (id) => pauseHoldsDispatch(automationStore.get(id)),
|
|
4496
|
+
});
|
|
4543
4497
|
if ('refused' in outcome)
|
|
4544
4498
|
return c.json({ error: outcome.refused }, 409);
|
|
4545
4499
|
return c.json(outcome, 201);
|
|
@@ -4580,6 +4534,21 @@ export function createApp(deps) {
|
|
|
4580
4534
|
console.warn(`[cezar] could not mark inbox entry ${todoId} started: ${String(err)}`);
|
|
4581
4535
|
}
|
|
4582
4536
|
};
|
|
4537
|
+
/** Both artifact-file routes: `name` is a listed name, flat or `<folder>/<file>`. */
|
|
4538
|
+
const serveArtifact = async (c, id, name, v) => {
|
|
4539
|
+
const { dataDir, store } = c.get('project');
|
|
4540
|
+
if (!store.getRun(id))
|
|
4541
|
+
return c.json({ error: 'not found' }, 404);
|
|
4542
|
+
const runDir = artifactsDir(dataDir, id);
|
|
4543
|
+
const dir = v === undefined ? runDir : await existingVersionDir(runDir, Number(v));
|
|
4544
|
+
if (!dir)
|
|
4545
|
+
return c.json({ error: 'artifact not found' }, 404);
|
|
4546
|
+
const artifact = await findArtifact(dir, name);
|
|
4547
|
+
const stream = artifact ? await openArtifact(dir, name) : null;
|
|
4548
|
+
if (!artifact || !stream)
|
|
4549
|
+
return c.json({ error: 'artifact not found' }, 404);
|
|
4550
|
+
return c.body(stream, 200, artifactHeaders(artifact, artifactsCdnEnabled(), artifactsBaseUrl(c.req.url)));
|
|
4551
|
+
};
|
|
4583
4552
|
// ---- chained family: runs lifecycle + artifacts (project-scoped) ----
|
|
4584
4553
|
const runsRoutes = new Hono()
|
|
4585
4554
|
// `workflowDef` is ~1.3 MB per run; the list leaves it out (`?full=1` opts back in, GET /runs/:id is always complete).
|
|
@@ -4666,10 +4635,10 @@ export function createApp(deps) {
|
|
|
4666
4635
|
const run = c.get('project').store.setUnread(c.req.param('id'));
|
|
4667
4636
|
return run ? c.json(run) : c.json({ error: 'not found' }, 404);
|
|
4668
4637
|
})
|
|
4669
|
-
.post('/runs', jsonZodValidator(
|
|
4638
|
+
.post('/runs', jsonZodValidator(createRunInputSchema), async (c) => {
|
|
4670
4639
|
const { root: repoRoot, dataDir, manager } = c.get('project');
|
|
4671
4640
|
const parsed = { data: c.req.valid('json') };
|
|
4672
|
-
if (agentModelsLocked(repoRoot) && parsed.data.model?.trim()) {
|
|
4641
|
+
if (agentModelsLocked(repoRoot) && (parsed.data.model?.trim() || parsed.data.reasoningEffort?.trim())) {
|
|
4673
4642
|
return c.json({ error: AGENT_MODELS_LOCKED_ERROR }, 409);
|
|
4674
4643
|
}
|
|
4675
4644
|
let workflow;
|
|
@@ -4722,6 +4691,7 @@ export function createApp(deps) {
|
|
|
4722
4691
|
const input = {
|
|
4723
4692
|
task: parsed.data.task,
|
|
4724
4693
|
model: parsed.data.model,
|
|
4694
|
+
reasoningEffort: parsed.data.reasoningEffort,
|
|
4725
4695
|
runner: parsed.data.runner,
|
|
4726
4696
|
agentProfile: parsed.data.agentProfile,
|
|
4727
4697
|
images,
|
|
@@ -5009,7 +4979,7 @@ export function createApp(deps) {
|
|
|
5009
4979
|
});
|
|
5010
4980
|
})
|
|
5011
4981
|
// "Continue" (spec 003): reopen a finished run's session in-process.
|
|
5012
|
-
.post('/runs/:id/continue', jsonZodValidator(
|
|
4982
|
+
.post('/runs/:id/continue', jsonZodValidator(continueInputSchema, { absent: ({}) }), async (c) => {
|
|
5013
4983
|
const { root: repoRoot, store, manager } = c.get('project');
|
|
5014
4984
|
const id = c.req.param('id');
|
|
5015
4985
|
const run = store.getRun(id);
|
|
@@ -5025,7 +4995,7 @@ export function createApp(deps) {
|
|
|
5025
4995
|
return c.json(receipt.prior);
|
|
5026
4996
|
let answered;
|
|
5027
4997
|
try {
|
|
5028
|
-
if (agentModelsLocked(repoRoot) && parsed.data.model?.trim()) {
|
|
4998
|
+
if (agentModelsLocked(repoRoot) && (parsed.data.model?.trim() || parsed.data.reasoningEffort?.trim())) {
|
|
5029
4999
|
return c.json({ error: AGENT_MODELS_LOCKED_ERROR }, 409);
|
|
5030
5000
|
}
|
|
5031
5001
|
const blocked = await providerActionError([providerForExistingRun(run, parsed.data.runner)], {
|
|
@@ -5054,6 +5024,7 @@ export function createApp(deps) {
|
|
|
5054
5024
|
images,
|
|
5055
5025
|
runner: parsed.data.runner,
|
|
5056
5026
|
model: parsed.data.model,
|
|
5027
|
+
reasoningEffort: parsed.data.reasoningEffort,
|
|
5057
5028
|
agentProfile: parsed.data.agentProfile,
|
|
5058
5029
|
});
|
|
5059
5030
|
if (!result.ok)
|
|
@@ -5331,6 +5302,93 @@ export function createApp(deps) {
|
|
|
5331
5302
|
if (!result.ok)
|
|
5332
5303
|
return c.json({ error: result.error }, 409);
|
|
5333
5304
|
return c.json({ paths: result.paths, truncated: result.truncated });
|
|
5305
|
+
})
|
|
5306
|
+
// Run artifacts (spec 2026-10-22-html-artifacts-and-impact § Serving): what the agent wrote
|
|
5307
|
+
// into `.ai/cezar/artifacts/<runId>/`, listed fresh on every request.
|
|
5308
|
+
.get('/runs/:id/artifacts', paramZodValidator(runIdParamSchema), async (c) => {
|
|
5309
|
+
const { dataDir, store } = c.get('project');
|
|
5310
|
+
const { id } = c.req.valid('param');
|
|
5311
|
+
if (!store.getRun(id))
|
|
5312
|
+
return c.json({ error: 'not found' }, 404);
|
|
5313
|
+
return c.json(await scanArtifacts(artifactsDir(dataDir, id)));
|
|
5314
|
+
})
|
|
5315
|
+
// One artifact's bytes. `findArtifact` (the scan's own rules, uncapped) is the traversal guard:
|
|
5316
|
+
// only regular, non-dot files at the top or in a real folder, never through a symlink.
|
|
5317
|
+
// `?v=<n>` serves kept revision n (spec R4) from `.versions/<n>/`, same guard, same headers.
|
|
5318
|
+
.get('/runs/:id/artifacts/:name', paramZodValidator(artifactNameParamSchema), queryZodValidator(artifactFileQuerySchema), async (c) => {
|
|
5319
|
+
const { id, name } = c.req.valid('param');
|
|
5320
|
+
return serveArtifact(c, id, name, c.req.valid('query').v);
|
|
5321
|
+
})
|
|
5322
|
+
// A file one folder down, at the URL a page's relative `<img src="shots/a.png">` resolves to.
|
|
5323
|
+
.get('/runs/:id/artifacts/:dir/:name', paramZodValidator(artifactNestedParamSchema), queryZodValidator(artifactFileQuerySchema), async (c) => {
|
|
5324
|
+
const { id, dir, name } = c.req.valid('param');
|
|
5325
|
+
return serveArtifact(c, id, `${dir}/${name}`, c.req.valid('query').v);
|
|
5326
|
+
})
|
|
5327
|
+
// Assess Impact (spec 2026-10-22-html-artifacts-and-impact § Serving): the server resolves and
|
|
5328
|
+
// pins the subject (`impact/launch.ts`), then starts the `assess-impact` workflow on it.
|
|
5329
|
+
.post('/impact', jsonZodValidator(startImpactSchema), async (c) => {
|
|
5330
|
+
const { root: repoRoot, store, manager } = c.get('project');
|
|
5331
|
+
const body = c.req.valid('json');
|
|
5332
|
+
if (agentModelsLocked(repoRoot) && body.model?.trim())
|
|
5333
|
+
return c.json({ error: AGENT_MODELS_LOCKED_ERROR }, 409);
|
|
5334
|
+
const workflow = (await loadWorkflows(repoRoot)).workflows.find((w) => w.name === ASSESS_IMPACT_WORKFLOW.name) ?? ASSESS_IMPACT_WORKFLOW;
|
|
5335
|
+
const fallback = body.runner ?? (await loadConfig(repoRoot)).defaultRunner;
|
|
5336
|
+
const blocked = await providerActionError(providersRequiredByWorkflow(workflow, fallback), {
|
|
5337
|
+
repoRoot,
|
|
5338
|
+
profileFor: (provider) => (provider === fallback ? body.agentProfile : undefined),
|
|
5339
|
+
});
|
|
5340
|
+
if (blocked)
|
|
5341
|
+
return c.json({ error: blocked }, 409);
|
|
5342
|
+
if (body.agentProfile !== undefined) {
|
|
5343
|
+
const account = await resolveWorkspaceProfile(fallback, body.agentProfile);
|
|
5344
|
+
if ('error' in account)
|
|
5345
|
+
return c.json({ error: account.error }, 400);
|
|
5346
|
+
}
|
|
5347
|
+
const resolved = await resolveImpactSubject(repoRoot, body.subject);
|
|
5348
|
+
if (!resolved.ok)
|
|
5349
|
+
return c.json({ error: resolved.error }, resolved.status);
|
|
5350
|
+
const { launch } = resolved;
|
|
5351
|
+
const run = manager.startRun(workflow, {
|
|
5352
|
+
task: launch.task,
|
|
5353
|
+
model: body.model,
|
|
5354
|
+
runner: body.runner,
|
|
5355
|
+
agentProfile: body.agentProfile,
|
|
5356
|
+
subject: launch.subject,
|
|
5357
|
+
...(launch.forkRef ? { forkRef: launch.forkRef } : {}),
|
|
5358
|
+
deviceSid: deviceSid(c.req.header('x-cezar-sid')),
|
|
5359
|
+
});
|
|
5360
|
+
if (launch.note)
|
|
5361
|
+
store.appendEvent(run.id, { type: 'note', message: launch.note });
|
|
5362
|
+
return c.json({ runId: run.id }, 201);
|
|
5363
|
+
})
|
|
5364
|
+
// "Open impact" for a PR or a spec: the newest run with that subject, its artifacts, and
|
|
5365
|
+
// whether the subject moved since (`stale`, null when it cannot be told).
|
|
5366
|
+
.get('/artifacts', queryZodValidator(artifactsBySubjectQuerySchema), async (c) => {
|
|
5367
|
+
const { root: repoRoot, dataDir, store } = c.get('project');
|
|
5368
|
+
const run = newestSubjectRun(store.listRuns(), parseSubjectQuery(c.req.valid('query').subject));
|
|
5369
|
+
if (!run?.subject) {
|
|
5370
|
+
const none = [];
|
|
5371
|
+
return c.json({ run: null, subject: null, artifacts: none, truncated: false, stale: null });
|
|
5372
|
+
}
|
|
5373
|
+
const [listing, stale] = await Promise.all([
|
|
5374
|
+
scanArtifacts(artifactsDir(dataDir, run.id)),
|
|
5375
|
+
subjectStale(repoRoot, run.subject),
|
|
5376
|
+
]);
|
|
5377
|
+
return c.json({
|
|
5378
|
+
run: { id: run.id, status: run.status, title: run.titleSummary ?? run.title, createdAt: run.createdAt },
|
|
5379
|
+
subject: run.subject,
|
|
5380
|
+
artifacts: listing.artifacts,
|
|
5381
|
+
truncated: listing.truncated,
|
|
5382
|
+
...(listing.versions?.length ? { versions: listing.versions } : {}),
|
|
5383
|
+
stale,
|
|
5384
|
+
});
|
|
5385
|
+
})
|
|
5386
|
+
// The project Assets page (spec 2026-10-22-html-artifacts-and-impact, Phase 3). A PR's head is
|
|
5387
|
+
// read from cache only: a list route never calls GitHub, so an uncached PR is `stale: null`.
|
|
5388
|
+
.get('/assets', async (c) => {
|
|
5389
|
+
const { root: repoRoot, dataDir, store } = c.get('project');
|
|
5390
|
+
const listing = await listProjectAssets(dataDir, store.listRuns(), (subject) => subjectStale(repoRoot, subject, { prHeadSha: async (root, number) => peekPrHeadSha(root, number) ?? null }));
|
|
5391
|
+
return c.json(listing);
|
|
5334
5392
|
})
|
|
5335
5393
|
// Files tab: directory listing (path omitted or a dir) or file content
|
|
5336
5394
|
// (size-capped, binary flagged). Traversal-safe — readWorktreePath rejects
|
|
@@ -5539,6 +5597,10 @@ export function createApp(deps) {
|
|
|
5539
5597
|
error: 'no worktree/branch to publish — this task ran in the repo working tree',
|
|
5540
5598
|
}, 400);
|
|
5541
5599
|
}
|
|
5600
|
+
// An impact run that changed nothing has nothing to propose (spec 2026-10-22 Q11).
|
|
5601
|
+
if (run.subject && assessedWithoutChanges(run, await worktreeDiff(run.worktreePath, run.baseBranch ?? 'HEAD'))) {
|
|
5602
|
+
return c.json({ error: 'this task assessed impact and changed nothing — there is no pull request to open' }, 409);
|
|
5603
|
+
}
|
|
5542
5604
|
// One publish per run at a time: a cockpit re-asking after its response was lost (telemetry
|
|
5543
5605
|
// 9119d21a) joins the publish still running instead of racing its autosave commit and push.
|
|
5544
5606
|
const key = `${dataDir}\0${id}`;
|
|
@@ -5991,7 +6053,7 @@ export function createApp(deps) {
|
|
|
5991
6053
|
* That position is the whole point. The route's contract is that an unknown id 404s before the
|
|
5992
6054
|
* body is looked at, and Hono only records a body in the route type when it is validated as
|
|
5993
6055
|
* MIDDLEWARE — which necessarily runs before the handler. Registering this guard first satisfies
|
|
5994
|
-
* both: the documented status order is unchanged, and `
|
|
6056
|
+
* both: the documented status order is unchanged, and `startTodoInputSchema` becomes visible to
|
|
5995
6057
|
* `AppType` (and so to `hc`) instead of being parsed invisibly inside the handler.
|
|
5996
6058
|
*
|
|
5997
6059
|
* Deliberately NOT annotated with a return type: the inferred one carries the two typed
|
|
@@ -6030,12 +6092,12 @@ export function createApp(deps) {
|
|
|
6030
6092
|
// `absent`/`malformed` options: no body at all is `undefined` (the pre-#401 bodyless POST,
|
|
6031
6093
|
// which the optional schema accepts → 201), a truncated payload is `null` (which it rejects
|
|
6032
6094
|
// → 400, rather than passing as "no body" and silently starting a run).
|
|
6033
|
-
.post('/todos/:id/start', todoMustExist, jsonZodValidator(
|
|
6095
|
+
.post('/todos/:id/start', todoMustExist, jsonZodValidator(startTodoInputSchema, { absent: undefined, malformed: null }), async (c) => {
|
|
6034
6096
|
const { root: repoRoot, dataDir, manager } = c.get('project');
|
|
6035
6097
|
const id = c.req.param('id');
|
|
6036
6098
|
const todo = c.get('todo');
|
|
6037
6099
|
const parsed = { data: c.req.valid('json') };
|
|
6038
|
-
if (agentModelsLocked(repoRoot) && parsed.data?.model?.trim()) {
|
|
6100
|
+
if (agentModelsLocked(repoRoot) && (parsed.data?.model?.trim() || parsed.data?.reasoningEffort?.trim())) {
|
|
6039
6101
|
return c.json({ error: AGENT_MODELS_LOCKED_ERROR }, 409);
|
|
6040
6102
|
}
|
|
6041
6103
|
if (todo.startedTaskId)
|
|
@@ -6074,6 +6136,7 @@ export function createApp(deps) {
|
|
|
6074
6136
|
task,
|
|
6075
6137
|
runner: parsed.data?.runner,
|
|
6076
6138
|
model: parsed.data?.model,
|
|
6139
|
+
reasoningEffort: parsed.data?.reasoningEffort,
|
|
6077
6140
|
origin: 'inbox',
|
|
6078
6141
|
deviceSid: deviceSid(c.req.header('x-cezar-sid')),
|
|
6079
6142
|
});
|
|
@@ -6133,9 +6196,21 @@ export function createApp(deps) {
|
|
|
6133
6196
|
offEvent();
|
|
6134
6197
|
offRun();
|
|
6135
6198
|
});
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6199
|
+
// Cursorless: read newest-first from the file end so the cost is the bytes returned (#882).
|
|
6200
|
+
// A fresh connect is capped and flagged; a resume (`afterSeq`/`Last-Event-ID`) gets its whole
|
|
6201
|
+
// gap, since a reconnecting client has no way to fill a hole it was never told about.
|
|
6202
|
+
let replay;
|
|
6203
|
+
if (query.cursor)
|
|
6204
|
+
replay = await readEventsAfterLiveCursor(eventsPath, query.cursor);
|
|
6205
|
+
else {
|
|
6206
|
+
const maxBytes = requestedAfter > 0 ? Number.POSITIVE_INFINITY : INITIAL_REPLAY_MAX_BYTES;
|
|
6207
|
+
const tail = await readEventsTail(eventsPath, { afterSeq: requestedAfter, maxBytes });
|
|
6208
|
+
if (tail.truncated) {
|
|
6209
|
+
const frame = { firstSeq: tail.events[0]?.seq ?? 0, afterSeq: requestedAfter };
|
|
6210
|
+
await stream.writeSSE({ event: 'history-truncated', data: JSON.stringify(frame) });
|
|
6211
|
+
}
|
|
6212
|
+
replay = { events: tail.events, boundarySeq: 0 };
|
|
6213
|
+
}
|
|
6139
6214
|
maxSeq = Math.max(maxSeq, replay.boundarySeq);
|
|
6140
6215
|
for await (const event of replay.events) {
|
|
6141
6216
|
if (stream.aborted)
|
|
@@ -6197,10 +6272,13 @@ export function createApp(deps) {
|
|
|
6197
6272
|
}
|
|
6198
6273
|
void stream.writeSSE({ event: 'usage', data: JSON.stringify(owned) });
|
|
6199
6274
|
});
|
|
6275
|
+
const onArtifacts = (listing) => void stream.writeSSE({ event: 'artifacts', data: JSON.stringify(artifactsFrame(listing)) });
|
|
6200
6276
|
const offRun = onRunFrames(store, (_run, frames) => void stream.writeSSE({ event: 'run', data: frames.record() }));
|
|
6277
|
+
store.on('artifacts', onArtifacts);
|
|
6201
6278
|
const offDeleted = onRunDeleted(store, onDeleted);
|
|
6202
6279
|
stream.onAbort(() => {
|
|
6203
6280
|
offRun();
|
|
6281
|
+
store.off('artifacts', onArtifacts);
|
|
6204
6282
|
offDeleted();
|
|
6205
6283
|
offTodos();
|
|
6206
6284
|
offUsage();
|
|
@@ -6247,11 +6325,14 @@ export function createApp(deps) {
|
|
|
6247
6325
|
const payload = { ...event, projectId: project };
|
|
6248
6326
|
void stream.writeSSE({ event: 'worktree-lifecycle', data: JSON.stringify(payload) });
|
|
6249
6327
|
});
|
|
6328
|
+
const onArtifacts = (listing) => void stream.writeSSE({ event: 'artifacts', data: JSON.stringify(artifactsFrame(listing, project)) });
|
|
6329
|
+
store.on('artifacts', onArtifacts);
|
|
6250
6330
|
const offDeleted = onRunDeleted(store, onDeleted);
|
|
6251
6331
|
attached.set(project, {
|
|
6252
6332
|
store,
|
|
6253
6333
|
detach: () => {
|
|
6254
6334
|
offRun();
|
|
6335
|
+
store.off('artifacts', onArtifacts);
|
|
6255
6336
|
offDeleted();
|
|
6256
6337
|
offTodos();
|
|
6257
6338
|
offLifecycle?.();
|
|
@@ -6501,6 +6582,68 @@ export function createApp(deps) {
|
|
|
6501
6582
|
return c.json({ error: failed.error }, failed.status);
|
|
6502
6583
|
return c.body(null, 204);
|
|
6503
6584
|
});
|
|
6585
|
+
// ---- chained family: configuration bundle (workspace-level) ----
|
|
6586
|
+
// Spec 2026-11-04-automations-and-config-export-import, Phase 2. Reads project files directly
|
|
6587
|
+
// instead of building contexts: an export or a preview must not prune worktrees or resume runs.
|
|
6588
|
+
const bundleProjects = async () => (await listProjects().catch(() => []))
|
|
6589
|
+
.filter((project) => project.status !== 'missing')
|
|
6590
|
+
.map((project) => ({ id: project.id, name: project.name || basename(project.root), root: project.root }));
|
|
6591
|
+
const bundleSecretNames = async (scope) => (await secretStore.list(scope).catch(() => ({ secrets: [] }))).secrets.map((entry) => entry.name);
|
|
6592
|
+
const planBundle = async (input) => {
|
|
6593
|
+
const registered = await Promise.all((await bundleProjects()).map(async (project) => ({ ...project, remote: await projectRemote(project.root) })));
|
|
6594
|
+
const { bundle, ...choices } = input;
|
|
6595
|
+
return planConfigBundle(bundle, choices, registered, {
|
|
6596
|
+
automations: capabilities().automations,
|
|
6597
|
+
localHandoff: capabilities().localHandoff,
|
|
6598
|
+
checksFor: (project) => automationChecks({ root: project.root, dataDir: join(project.root, '.ai', 'cezar') }),
|
|
6599
|
+
});
|
|
6600
|
+
};
|
|
6601
|
+
const transferRoutes = new Hono()
|
|
6602
|
+
.get('/workspace/config-bundle', queryZodValidator(configBundleExportQuerySchema), async (c) => {
|
|
6603
|
+
// Absent = every project; present but empty = the workspace settings alone.
|
|
6604
|
+
const wanted = c.req.valid('query').projects?.split(',').map((id) => id.trim()).filter(Boolean);
|
|
6605
|
+
const projects = (await bundleProjects()).filter((project) => !wanted || wanted.includes(project.id));
|
|
6606
|
+
const bundle = await buildConfigBundle(projects, { automations: capabilities().automations, secretNames: bundleSecretNames }, { cezarVersion: deps.version });
|
|
6607
|
+
return c.json(bundle, 200, {
|
|
6608
|
+
'Content-Disposition': `attachment; filename="cezar-config-${bundle.exportedAt.slice(0, 10)}.json"`,
|
|
6609
|
+
});
|
|
6610
|
+
})
|
|
6611
|
+
.use('/workspace/config-bundle/*', bodyLimit({ maxSize: TRANSFER_BODY_LIMIT, onError: bodyTooLarge }))
|
|
6612
|
+
.post('/workspace/config-bundle/preview', jsonZodValidator(configBundlePreviewInputSchema), async (c) => {
|
|
6613
|
+
return c.json((await planBundle(c.req.valid('json'))).preview);
|
|
6614
|
+
})
|
|
6615
|
+
.post('/workspace/config-bundle/import', jsonZodValidator(configBundleImportInputSchema), async (c) => {
|
|
6616
|
+
// A bundle can carry `requiredChecks` and automation check steps: local-machine only, like agent-config writes.
|
|
6617
|
+
if (!capabilities().localHandoff)
|
|
6618
|
+
return c.json({ error: 'importing a configuration bundle is only available on a local cockpit' }, 409);
|
|
6619
|
+
const { planDigest, ...input } = c.req.valid('json');
|
|
6620
|
+
const plan = await planBundle(input);
|
|
6621
|
+
if (plan.preview.planDigest !== planDigest)
|
|
6622
|
+
return c.json({ error: 'the configuration changed since the preview — review again' }, 409);
|
|
6623
|
+
const blocked = plan.preview.sections.find((section) => section.selected && section.issues.length);
|
|
6624
|
+
if (blocked)
|
|
6625
|
+
return c.json({ error: `${blocked.id} cannot be applied: ${blocked.issues[0]}` }, 409);
|
|
6626
|
+
const imported = [];
|
|
6627
|
+
let applied;
|
|
6628
|
+
try {
|
|
6629
|
+
applied = await applyConfigBundle(plan, {
|
|
6630
|
+
onAutomations: (projectId, definitions) => {
|
|
6631
|
+
for (const definition of definitions)
|
|
6632
|
+
imported.push({ project: projectId, automationId: definition.id, revision: definition.revision });
|
|
6633
|
+
},
|
|
6634
|
+
});
|
|
6635
|
+
}
|
|
6636
|
+
catch (error) {
|
|
6637
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
6638
|
+
// A launch holding the automation lease, or a concurrent edit, is a retryable conflict — as on the automations import.
|
|
6639
|
+
return c.json({ error: message }, /mutation conflict|revision conflict/.test(message) ? 409 : 500);
|
|
6640
|
+
}
|
|
6641
|
+
for (const event of imported)
|
|
6642
|
+
workspaceEvents.emit('automation-change', event);
|
|
6643
|
+
if (imported.length)
|
|
6644
|
+
automationsChanged();
|
|
6645
|
+
return c.json({ applied }, 200);
|
|
6646
|
+
});
|
|
6504
6647
|
const trackerRoutes = new Hono()
|
|
6505
6648
|
.get('/tracker/task', async (c) => {
|
|
6506
6649
|
const project = c.get('project');
|
|
@@ -6667,6 +6810,13 @@ export function createApp(deps) {
|
|
|
6667
6810
|
return c.json(result, 200);
|
|
6668
6811
|
});
|
|
6669
6812
|
const githubRoutes = new Hono()
|
|
6813
|
+
// POST deliberately uses the existing CSRF guard and the API client's hosted credentials.
|
|
6814
|
+
// JSON raster data cannot execute on the cockpit origin or leak signed redirect URLs.
|
|
6815
|
+
.post('/github/asset', jsonZodValidator(githubAssetInputSchema), async (c) => {
|
|
6816
|
+
c.header('Cache-Control', 'no-store');
|
|
6817
|
+
c.header('X-Content-Type-Options', 'nosniff');
|
|
6818
|
+
return c.json(await loadGithubAsset(c.get('project').root, c.req.valid('json').url));
|
|
6819
|
+
})
|
|
6670
6820
|
.get('/github',
|
|
6671
6821
|
// `limit` stays a bare string: the handler's `Number.parseInt`/`Number.isFinite` fallback to
|
|
6672
6822
|
// 30 already accepts `?limit=banana`, and a numeric schema would 400 it instead.
|
|
@@ -7664,6 +7814,7 @@ export function createApp(deps) {
|
|
|
7664
7814
|
archived: run.archived,
|
|
7665
7815
|
...(run.autoResumeAt !== undefined ? { autoResumeAt: run.autoResumeAt } : {}),
|
|
7666
7816
|
...(run.awaitingAnswerSince !== undefined ? { awaitingAnswerSince: run.awaitingAnswerSince } : {}),
|
|
7817
|
+
...(run.idleClosedAt !== undefined ? { idleClosedAt: run.idleClosedAt } : {}),
|
|
7667
7818
|
workflow: run.workflow,
|
|
7668
7819
|
...(run.branch !== undefined ? { branch: run.branch } : {}),
|
|
7669
7820
|
...(run.diffStat !== undefined ? { diffStat: run.diffStat } : {}),
|
|
@@ -8092,6 +8243,7 @@ export function createApp(deps) {
|
|
|
8092
8243
|
.route('/', previewRoutes)
|
|
8093
8244
|
.route('/', workspaceConfigRoutes)
|
|
8094
8245
|
.route('/', workspaceSecretsRoutes)
|
|
8246
|
+
.route('/', transferRoutes)
|
|
8095
8247
|
.route('/', githubLoginRoutes)
|
|
8096
8248
|
.route('/', fsBrowseRoutes)
|
|
8097
8249
|
.route('/', automationChecksRoutes)
|
|
@@ -8472,35 +8624,43 @@ export function quoteResumeBin(bin) {
|
|
|
8472
8624
|
* guarantee than escaping, and platform-independent. Ids are UUID/CLI-minted
|
|
8473
8625
|
* today; this keeps a future source safe.
|
|
8474
8626
|
*/
|
|
8627
|
+
/** One resume recipe per runner — a runner without one is a type error here, not a silent `null`. */
|
|
8628
|
+
const RESUME_COMMANDS = {
|
|
8629
|
+
claude: (sessionId) => `claude --resume ${sessionId}`,
|
|
8630
|
+
codex: (sessionId) => `codex resume ${sessionId}`,
|
|
8631
|
+
opencode: (sessionId) => `opencode --session ${sessionId}`,
|
|
8632
|
+
cursor: (sessionId) => {
|
|
8633
|
+
const bin = quoteResumeBin(resolveCursorAgentBin());
|
|
8634
|
+
return bin === null ? null : `${bin} --resume ${sessionId}`;
|
|
8635
|
+
},
|
|
8636
|
+
antigravity: (sessionId) => {
|
|
8637
|
+
const bin = quoteResumeBin(resolveAntigravityBin());
|
|
8638
|
+
return bin === null ? null : `${bin} --conversation ${sessionId}`;
|
|
8639
|
+
},
|
|
8640
|
+
pi: (sessionId) => `pi --session ${sessionId}`,
|
|
8641
|
+
// Verified live (`junie --help`, 26.9.22): `--resume` alone reopens the LAST session;
|
|
8642
|
+
// the target session is named by the separate `--session-id=<id>` flag, not a positional
|
|
8643
|
+
// argument (junie's positional slot is `[<task>]`) — `junie --resume ${sessionId}` would
|
|
8644
|
+
// silently resume the wrong session and read the id as a task prompt instead.
|
|
8645
|
+
junie: (sessionId) => `junie --resume --session-id=${sessionId}`,
|
|
8646
|
+
// `--resume <id>` takes a session id, a task id or an id prefix (`copilot --help`, 1.0.88).
|
|
8647
|
+
copilot: (sessionId) => `copilot --resume ${sessionId}`,
|
|
8648
|
+
// The RPC session id is omp's own session id, which `--resume` accepts
|
|
8649
|
+
// (`omp --mode rpc --resume <id>` spawns the same process resumed).
|
|
8650
|
+
omp: (sessionId) => `omp --resume ${sessionId}`,
|
|
8651
|
+
// The ACP session id is the id of Gemini's own chat recording, which `--resume` accepts.
|
|
8652
|
+
gemini: (sessionId) => `gemini --resume ${sessionId}`,
|
|
8653
|
+
// `-S, --session [id]` resumes that session; bare `--session` opens a picker (`kimi --help`, 2.3.2).
|
|
8654
|
+
kimi: (sessionId) => `kimi --session ${sessionId}`,
|
|
8655
|
+
};
|
|
8475
8656
|
export function resumeCommand(runner, sessionId) {
|
|
8476
8657
|
if (!isSafeSessionId(sessionId))
|
|
8477
8658
|
return null;
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
return `junie --resume --session-id=${sessionId}`;
|
|
8485
|
-
case 'codex':
|
|
8486
|
-
return `codex resume ${sessionId}`;
|
|
8487
|
-
case 'opencode':
|
|
8488
|
-
return `opencode --session ${sessionId}`;
|
|
8489
|
-
case 'cursor': {
|
|
8490
|
-
const bin = quoteResumeBin(resolveCursorAgentBin());
|
|
8491
|
-
return bin === null ? null : `${bin} --resume ${sessionId}`;
|
|
8492
|
-
}
|
|
8493
|
-
case 'antigravity': {
|
|
8494
|
-
const bin = quoteResumeBin(resolveAntigravityBin());
|
|
8495
|
-
return bin === null ? null : `${bin} --conversation ${sessionId}`;
|
|
8496
|
-
}
|
|
8497
|
-
case 'pi':
|
|
8498
|
-
return `pi --session ${sessionId}`;
|
|
8499
|
-
case 'copilot':
|
|
8500
|
-
// `--resume <id>` takes a session id, a task id or an id prefix (`copilot --help`, 1.0.88).
|
|
8501
|
-
return `copilot --resume ${sessionId}`;
|
|
8502
|
-
default:
|
|
8503
|
-
return `claude --resume ${sessionId}`;
|
|
8504
|
-
}
|
|
8659
|
+
// A record from before runners existed, or the legacy spelling, is a Claude session.
|
|
8660
|
+
const id = runner === undefined || runner === 'claude-cli' ? 'claude' : runner;
|
|
8661
|
+
// A runner id this version does not know (a downgraded record) has no recipe here.
|
|
8662
|
+
if (!RUNNER_IDS.includes(id))
|
|
8663
|
+
return null;
|
|
8664
|
+
return RESUME_COMMANDS[id](sessionId);
|
|
8505
8665
|
}
|
|
8506
8666
|
//# sourceMappingURL=server.js.map
|