@open-mercato/cezar 0.19.0-pr1908.4332 → 0.19.0-pr1908.4683
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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ai as e,ao as t,ci as n,co as r,hr as i,ki as a,li as o,oo as s,so as c,uo as l}from"./queries-ba5qZ3kd.js";import{c as u}from"./utils-Br_dqwn-.js";var d={all:(e=u())=>[`worktree-lifecycle`,e],list:(e=u())=>[...d.all(e),`list`],detail:(e,t=u())=>[...d.all(t),`worktree`,e],operation:(e,t=u())=>[...d.all(t),`operation`,e],output:(e,t=u())=>[...d.all(t),`output`,e]};function f(){return t(),r({queryKey:d.list(),queryFn:async({signal:e})=>{let t=await a({limit:100},{signal:e}),n=new Map(t.worktrees.map(e=>[e.worktreeId,e])),r=new Set,i=t.nextCursor;for(;i&&!r.has(i);){r.add(i);let t=await a({limit:100,cursor:i},{signal:e});for(let e of t.worktrees)n.set(e.worktreeId,e);i=t.nextCursor}return{worktrees:[...n.values()]}}})}function p(n,i=!0){return t(),r({queryKey:d.detail(n),enabled:i,queryFn:({signal:t})=>e(n,{signal:t})})}function m(e){return t(),r({queryKey:d.operation(e),queryFn:({signal:t})=>n(e,{signal:t})})}function h(e,n){return t(),s({queryKey:d.output(e),enabled:n,initialPageParam:0,queryFn:({signal:t,pageParam:n})=>o(e,n,{signal:t}),getNextPageParam:e=>e.items.length>=100?e.nextSeq:void 0,maxPages:5})}function g(e){let n=l();t();let r=u();return c({mutationFn:t=>i(e,t),onSuccess:t=>{n.setQueryData(d.operation(e,r),t),n.invalidateQueries({queryKey:d.all(r)}),n.invalidateQueries({queryKey:[`runs`,r]}),n.invalidateQueries({queryKey:[`worktrees`,r]})},onError:()=>{n.invalidateQueries({queryKey:d.operation(e,r)})}})}export{p as a,h as i,g as n,f as o,m as r,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,i,n as a,r as o}from"./worktree-lifecycle-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,i,n as a,r as o}from"./worktree-lifecycle-BxYvSKsA.js";import{N as s,t as c}from"./button-BqkA8Ovk.js";import{t as l}from"./loader-circle-DjzuGw6j.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./alert-dialog-BihfE0uZ.js";import{t as v}from"./project-router-xmadY-N9.js";import{t as y}from"./centered-state-CquGIOsq.js";var b=s(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),x=s(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),S=s(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),C=`cezar:recent-tasks:v1`,w=null;function T(){if(w)return w;try{let e=JSON.parse(window.localStorage.getItem(C)??`[]`);w=Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{w=[]}return w}function E(){return T()}function D(e){let t=[e,...T().filter(t=>t!==e)].slice(0,30);w=t;try{window.localStorage.setItem(C,JSON.stringify(t))}catch{}}function O(e,t,n){let r=new Map(n.map((e,t)=>[e,t])),i=e.filter(e=>r.has(t(e)));return i.sort((e,n)=>r.get(t(e))-r.get(t(n))),[...i,...e.filter(e=>!r.has(t(e)))]}var k=null,A=null;function j(e){k=e}function M(e){k===e&&(k=null)}function N(e){return e!==void 0&&k?.runId===e?k:null}function P(e,t){A={runId:e,path:t}}function F(e){if(A?.runId!==e)return null;let{path:t}=A;return A=null,t}function I(e,t){if(!e)return;if(e.kind===`account-resume`)return`Waiting for this account's automatic resume`;t??=e.timeZone;let n=new Date(e.until);return`Waiting for usage limit reset · ${t?`${n.toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`,timeZone:t})} · ${t}`:n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`})}`}var L=n();function R(){return(0,L.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,L.jsx)(y,{icon:(0,L.jsx)(l,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}var z=e(t(),1),B={retry:`Retry`,"start-anyway":`Start task anyway`,"cancel-task":`Cancel task`,"keep-worktree":`Keep worktree`,"force-delete":`Force delete`,stop:`Stop scripts`},V=new Set([`start-anyway`,`cancel-task`,`keep-worktree`,`force-delete`]);function H(e,t){switch(e){case`force-delete`:return`Skip remaining cleanup commands and ${t.intent===`delete-task`?`delete this task and its worktree`:`remove this worktree`}? Containers, volumes, and other resources may remain. ${t.intent===`reclaim`?`The task branch is kept.`:`The managed task branch is removed.`}`;case`start-anyway`:return`Start the task with an incomplete environment? Remaining setup commands will be skipped.`;case`cancel-task`:return`Cancel this task? The worktree and resources already created are kept; cleanup remains explicit.`;case`keep-worktree`:return`Keep this worktree and suppress automatic cleanup for this generation? Some resources may already have been stopped.`;default:return``}}function U(e){return e.state===`completed`?e.phase===`setup`?`Worktree ready`:`Worktree cleanup complete`:e.state===`bypassed`?`Setup bypassed`:e.state===`kept`?`Worktree kept — automatic cleanup suppressed`:e.state===`cancelled`?`Task cancelled — worktree retained`:e.state===`needs_attention`||e.state===`interrupted`?e.phase===`setup`?`Setup needs attention`:`Cleanup needs attention`:e.state===`committing`?e.phase===`setup`?`Finishing worktree preparation`:`Removing worktree`:e.phase===`setup`?`Preparing worktree`:`Cleaning up worktree`}function W({operationId:e,worktreePath:t,taskTitle:n}){let r=o(e),s=a(e),[l,y]=(0,z.useState)(null),[b,x]=(0,z.useState)(!1),S=i(e,b),C=(0,z.useRef)(null),[w,T]=(0,z.useState)(Date.now()),E=r.data?.operation.state===`running`;if((0,z.useEffect)(()=>{if(!E)return;let e=setInterval(()=>T(Date.now()),1e3);return()=>clearInterval(e)},[E]),r.isPending)return(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading worktree operation…`});if(r.isError)return(0,L.jsxs)(`p`,{role:`alert`,className:`text-xs text-danger`,children:[`Worktree operation could not load: `,r.error.message]});let D=r.data.operation,O=async e=>{y(null);try{await s.mutateAsync({action:e,requestId:crypto.randomUUID(),expectedRevision:D.revision}),C.current?.focus()}catch{}},k=[...new Map((S.data?.pages.flatMap(e=>e.items)??[]).map(e=>[e.seq,e])).values()].sort((e,t)=>e.seq-t.seq),A=[`queued`,`running`,`committing`].includes(D.state),j=[`completed`,`bypassed`,`cancelled`,`kept`].includes(D.state);return(0,L.jsxs)(`section`,{"data-slot":`worktree-lifecycle-operation`,className:`rounded-lg border border-border bg-card p-3 text-sm`,children:[(0,L.jsx)(`h2`,{ref:C,tabIndex:-1,className:`font-medium outline-none`,"aria-live":`polite`,children:U(D)}),n?(0,L.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:n}):null,t?(0,L.jsx)(`p`,{className:`mt-1 break-all font-mono text-meta text-muted-foreground`,children:t}):null,D.phase===`setup`&&A?(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The agent starts after worktree preparation finishes.`}):null,D.error?j?(0,L.jsxs)(`details`,{className:`mt-2 break-words text-xs text-muted-foreground`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer`,children:`Previous operation error`}),(0,L.jsx)(`p`,{className:`mt-1`,children:D.error})]}):(0,L.jsxs)(`p`,{role:`alert`,className:`mt-2 break-words text-xs text-danger`,children:[D.failureStage===`commit`?`Scripts completed, but the worktree transition failed. `:``,D.error]}):null,(0,L.jsx)(`ol`,{className:`mt-3 space-y-2`,children:D.entries.map(e=>{let t=[...D.history].reverse().find(t=>t.entryId===e.entryId&&t.commandPreview===e.commandPreview),n=t?Math.max(0,Math.round(((t.finishedAt?Date.parse(t.finishedAt):w)-Date.parse(t.startedAt))/1e3)):void 0;return(0,L.jsxs)(`li`,{className:`rounded border border-border px-2 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-1 text-xs`,children:[(0,L.jsx)(`span`,{className:`break-words font-medium`,children:e.label}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.state.replaceAll(`-`,` `),e.attempt?` · attempt ${e.attempt}`:``,n===void 0?``:` · ${n}s`]})]}),(0,L.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-all text-meta text-muted-foreground`,children:e.commandPreview})]},e.entryId)})}),D.history.length?(0,L.jsxs)(`details`,{className:`mt-3 text-xs`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:[`Attempt history (`,D.history.length,`)`]}),(0,L.jsx)(`ol`,{className:`mt-2 space-y-2`,children:D.history.map(e=>(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`span`,{children:[e.label,` · attempt `,e.attempt,` · `,e.state]}),(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-all text-meta text-muted-foreground`,children:e.commandPreview}),e.reason?(0,L.jsx)(`p`,{className:`text-danger`,children:e.reason}):null]},e.id))})]}):null,D.allowedActions.includes(`retry`)?(0,L.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Retry loads current saved scripts. Unchanged completed commands stay completed; edited commands run again.`}):null,(0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[D.allowedActions.map(e=>(0,L.jsx)(c,{size:`sm`,variant:e===`force-delete`||e===`cancel-task`?`danger-ghost`:`outline`,disabled:s.isPending,onClick:()=>V.has(e)?y(e):void O(e),children:B[e]},e)),(0,L.jsx)(c,{size:`sm`,variant:`ghost`,asChild:!0,children:(0,L.jsx)(v,{to:`/settings/worktrees?operation=${encodeURIComponent(e)}`,children:`Edit scripts`})}),(0,L.jsx)(c,{size:`sm`,variant:`ghost`,"aria-expanded":b,onClick:()=>x(e=>!e),children:b?`Hide output`:`Show output`})]}),s.isError?(0,L.jsx)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:s.error.message}):null,b?(0,L.jsxs)(`div`,{className:`mt-3`,children:[S.isPending?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading output…`}):null,S.isError?(0,L.jsxs)(`p`,{role:`alert`,className:`text-xs text-danger`,children:[`Output could not load: `,S.error.message]}):null,S.data?.pages.some(e=>e.truncated)?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Some earlier output was truncated.`}):null,(0,L.jsx)(`pre`,{"aria-label":`Script output`,className:`max-h-64 overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-meta`,children:k.map(e=>e.text).join(``)||`No output recorded.`}),S.hasNextPage?(0,L.jsx)(c,{size:`sm`,variant:`ghost`,disabled:S.isFetchingNextPage,onClick:()=>void S.fetchNextPage(),children:`Load more output`}):null]}):null,(0,L.jsx)(_,{open:l!==null,onOpenChange:e=>{e||y(null)},children:(0,L.jsxs)(f,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(d,{children:l?B[l]:`Confirm action`}),(0,L.jsxs)(u,{children:[l?H(l,D):``,(0,L.jsx)(`span`,{className:`mt-2 block break-all font-medium`,children:n??t??`Worktree operation ${e}`})]})]}),(0,L.jsxs)(m,{children:[(0,L.jsx)(h,{children:`Go back`}),(0,L.jsx)(p,{onClick:()=>{l&&O(l)},children:l?B[l]:`Continue`})]})]})})]})}function G({worktreeId:e,operationId:t,worktreePath:n,taskTitle:i}){let a=r(e,!t),o=t??[...a.data?.worktree.history??[]].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))[0]?.id;return o?(0,L.jsx)(W,{operationId:o,worktreePath:n,taskTitle:i}):null}export{j as a,N as c,E as d,D as f,b as h,I as i,M as l,x as m,G as n,P as o,S as p,R as r,F as s,W as t,O as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e}from"./button-BqkA8Ovk.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{l as i,t as a}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{l as i,t as a}from"./utils-Br_dqwn-.js";var o=e(t(),1),s=e(n(),1),c=r();function l({src:e,alt:t=``,className:n,...r}){let[l,u]=(0,o.useState)(!1),d=i(e);return(0,o.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`img`,{...r,src:d,alt:t,loading:`lazy`,onClick:()=>u(!0),className:a(`cursor-zoom-in`,n)}),l?(0,s.createPortal)((0,c.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,"data-slot":`image-lightbox`,onClick:()=>u(!1),className:`fixed inset-0 z-[100] flex cursor-zoom-out items-center justify-center bg-black/80 p-4 backdrop-blur-sm`,children:(0,c.jsx)(`img`,{src:d,alt:t,className:`max-h-full max-w-full rounded-md object-contain shadow-2xl`})}),document.body):null]})}export{l as t};
|
package/web/dist/index.html
CHANGED
|
@@ -55,77 +55,87 @@
|
|
|
55
55
|
}
|
|
56
56
|
})()
|
|
57
57
|
</script>
|
|
58
|
-
<script type="module" crossorigin src="/assets/index-
|
|
58
|
+
<script type="module" crossorigin src="/assets/index-DuW72uFI.js"></script>
|
|
59
59
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
60
60
|
<link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
|
|
61
61
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-rHxsej31.js">
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/assets/utils-
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/assets/queries-
|
|
62
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-Br_dqwn-.js">
|
|
63
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-ba5qZ3kd.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
65
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
66
|
-
<link rel="modulepreload" crossorigin href="/assets/worktree-lifecycle-
|
|
67
|
-
<link rel="modulepreload" crossorigin href="/assets/managers-
|
|
68
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/sheet-
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/assets/sortable.esm-
|
|
65
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-DtL2Gzw3.js">
|
|
66
|
+
<link rel="modulepreload" crossorigin href="/assets/worktree-lifecycle-BxYvSKsA.js">
|
|
67
|
+
<link rel="modulepreload" crossorigin href="/assets/managers-Dufza9IX.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/button-BqkA8Ovk.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="/assets/x-CZSnHsZ4.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/sheet-DxqNqi5S.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/sortable.esm-Dj7Kk-Wk.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="/assets/use-desktop-BNN3U2y9.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/host-usage-
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/arrow-left-
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/circle-check-
|
|
76
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
77
|
-
<link rel="modulepreload" crossorigin href="/assets/git-pull-request-draft-
|
|
78
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
80
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/check-
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/terminal-B-JX8x9P.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/textarea-BXN4nZ0d.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/workflow-j8scU63W.js">
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/collapsible-BJ0sxcz9.js">
|
|
103
|
-
<link rel="modulepreload" crossorigin href="/assets/alert-dialog-BZkKvKiu.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/host-usage-CX8OXl8q.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/arrow-left-BtT8zuL0.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/circle-check-LWKCYKhA.js">
|
|
76
|
+
<link rel="modulepreload" crossorigin href="/assets/git-pull-request-CURFMFaU.js">
|
|
77
|
+
<link rel="modulepreload" crossorigin href="/assets/git-pull-request-draft-BZgJrUou.js">
|
|
78
|
+
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-C1mTIqxM.js">
|
|
79
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-Br4Ra_c5.js">
|
|
80
|
+
<link rel="modulepreload" crossorigin href="/assets/use-now-DD2atNhs.js">
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/status-dot-Dxb9pPsK.js">
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/assets/reference-chip-C9pVQk05.js">
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/bot-Cm-PLA1M.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/dropdown-menu-CDv5Teql.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/external-link-Bclznsu3.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/folder-leteY9jH.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/run-actions-CLIUiXwS.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/check-B1z-_MCO.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/pencil-RUM53auZ.js">
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/toaster-5ad4wwJ9.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/new-task-form-BgMiEphZ.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/ask-answer-Co3javaA.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/reference-conflict-action-DxUm18aD.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/project-router-xmadY-N9.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/active-forge-DO2AaQ-s.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/upload-C2gxSnMR.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/loader-circle-DjzuGw6j.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/tooltip-45rfBiq8.js">
|
|
104
99
|
<link rel="modulepreload" crossorigin href="/assets/format-DHK74MwW.js">
|
|
105
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/diff-stat-CxDTnfya.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/icon-tooltip-BMkyRHLt.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/impact-model-Dj6tIycu.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/layers-YoqiEcNh.js">
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/layout-grid-CSvbdC6i.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/search-x-BxcYdvqm.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/terminal-CmRAOyqu.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/textarea-C58jseO-.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/workflow-WvO4bTRt.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/collapsible-BuSDxSYs.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/alert-dialog-BihfE0uZ.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/composer-attachments-DyC9yyGs.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/directional-usage-BerE4wJK.js">
|
|
106
113
|
<link rel="modulepreload" crossorigin href="/assets/use-submit-shortcut-BJ10ZshV.js">
|
|
107
114
|
<link rel="modulepreload" crossorigin href="/assets/token-metrics-DXeuToH8.js">
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/search-CCE2KMtX.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/lib-BQXq3kEf.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/picker-pill-BO6YUs1F.js">
|
|
109
118
|
<link rel="modulepreload" crossorigin href="/assets/clipboard-DvCUPLwM.js">
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/centered-state-
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/git-tab-loading-
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/arrow-down-
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/worktree-lifecycle-operation-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/arrow-up-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/chevron-right-
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/file-
|
|
117
|
-
<link rel="modulepreload" crossorigin href="/assets/message-square-
|
|
118
|
-
<link rel="modulepreload" crossorigin href="/assets/plus-
|
|
119
|
-
<link rel="modulepreload" crossorigin href="/assets/square
|
|
120
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
121
|
-
<link rel="modulepreload" crossorigin href="/assets/composer-
|
|
122
|
-
<link rel="modulepreload" crossorigin href="/assets/play-
|
|
123
|
-
<link rel="modulepreload" crossorigin href="/assets/tabs-
|
|
124
|
-
<link rel="modulepreload" crossorigin href="/assets/input-
|
|
119
|
+
<link rel="modulepreload" crossorigin href="/assets/centered-state-CquGIOsq.js">
|
|
120
|
+
<link rel="modulepreload" crossorigin href="/assets/git-tab-loading-CF0flOMS.js">
|
|
121
|
+
<link rel="modulepreload" crossorigin href="/assets/arrow-down-DACdHKjc.js">
|
|
122
|
+
<link rel="modulepreload" crossorigin href="/assets/worktree-lifecycle-operation-BRID04bW.js">
|
|
123
|
+
<link rel="modulepreload" crossorigin href="/assets/arrow-up-BAPSgozC.js">
|
|
124
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-right-DPaV033p.js">
|
|
125
|
+
<link rel="modulepreload" crossorigin href="/assets/file-rCLi_p-R.js">
|
|
126
|
+
<link rel="modulepreload" crossorigin href="/assets/message-square-beq8DjLH.js">
|
|
127
|
+
<link rel="modulepreload" crossorigin href="/assets/plus-Bdmhj8CR.js">
|
|
128
|
+
<link rel="modulepreload" crossorigin href="/assets/square--LrBHma0.js">
|
|
129
|
+
<link rel="modulepreload" crossorigin href="/assets/command-CfdVVS0V.js">
|
|
130
|
+
<link rel="modulepreload" crossorigin href="/assets/composer-BPIW4tmM.js">
|
|
131
|
+
<link rel="modulepreload" crossorigin href="/assets/play-Cj3p2Q5t.js">
|
|
132
|
+
<link rel="modulepreload" crossorigin href="/assets/tabs-CmEFauE4.js">
|
|
133
|
+
<link rel="modulepreload" crossorigin href="/assets/input-BO795Un9.js">
|
|
134
|
+
<link rel="modulepreload" crossorigin href="/assets/reasoning-effort-pill-B8Z1RaXL.js">
|
|
125
135
|
<link rel="modulepreload" crossorigin href="/assets/lib-BxQXEXDF.js">
|
|
126
136
|
<link rel="modulepreload" crossorigin href="/assets/chunk-BO2N2NFS-Bde6epwZ.js">
|
|
127
|
-
<link rel="modulepreload" crossorigin href="/assets/markdown-
|
|
128
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-YWy3FUHK.js">
|
|
138
|
+
<link rel="stylesheet" crossorigin href="/assets/index-jRkTI5kE.css">
|
|
129
139
|
</head>
|
|
130
140
|
<body>
|
|
131
141
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-Df_1kJEk.js";import{k as i}from"./ask-answer-Cfb0vEFv.js";import{t as a}from"./check-B5omShEO.js";import{f as o}from"./tooltip-p6YPEpXC.js";import{f as s}from"./git-toolbar-Bk-3i42V.js";import{D as c,E as l,O as u,b as d,w as f}from"./composer-GntpkeQD.js";import{i as p,r as m,t as h}from"./popover-DzdYqnHw.js";import{t as g}from"./workflow-j8scU63W.js";import{t as _}from"./project-router-CmpQcVZp.js";import{a as v,c as y,i as b,n as x,o as S,s as C}from"./use-now-DQpgbshl.js";import{a as w}from"./picker-pill-DQICTO2N.js";import{u as T}from"./index-CDhEdFaZ.js";var E=n();function D({name:e,route:t,selected:n,list:i,detail:a}){return(0,E.jsxs)(`div`,{"data-route":t,className:`flex h-full min-h-0 items-stretch`,children:[(0,E.jsx)(`section`,{"data-slot":`${e}-list`,className:r(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,n?`hidden`:`flex`),children:i}),(0,E.jsx)(`section`,{"data-slot":`${e}-detail`,className:r(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,n?`flex`:`hidden md:flex`),children:a})]})}function O({resolved:e,dataSlot:t}){return e.providerPending||e.canRun?null:(0,E.jsxs)(`span`,{"data-slot":t,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[e.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,E.jsx)(_,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]})}var k=e(t(),1);function A({workflows:e,value:t,onChange:n,slotPrefix:i=`gh`}){let[s,l]=(0,k.useState)(!1),[d,f]=(0,k.useState)(``),_=(0,k.useRef)(null),T=c(e,d);return(0,E.jsxs)(h,{open:s,onOpenChange:e=>{l(e),e||f(``)},children:[(0,E.jsx)(p,{asChild:!0,children:(0,E.jsxs)(`button`,{type:`button`,"data-slot":`${i}-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(w,t&&`border-foreground/60 font-mono text-meta font-semibold text-foreground`),children:[(0,E.jsx)(g,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,E.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,E.jsx)(o,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,E.jsx)(m,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,E.jsxs)(x,{label:`Choose a workflow`,shouldFilter:!1,children:[(0,E.jsx)(S,{placeholder:`search workflows…`,value:d,onValueChange:f,onInput:()=>_.current?.scrollTo(0,0)}),(0,E.jsxs)(y,{ref:_,"data-slot":`${i}-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[T.length===0?(0,E.jsx)(b,{children:`Nothing matches.`}):null,(0,E.jsx)(v,{children:T.map(e=>{let r=t===e.name;return(0,E.jsxs)(C,{value:`workflow ${e.name}`,keywords:u(e.name,e.description),"data-slot":`${i}-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),l(!1)},children:[(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,E.jsx)(a,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function j({skills:e,skillUsage:t,selected:n,onToggle:c,maxSelections:g,slotPrefix:_=`gh`}){let[D,O]=(0,k.useState)(!1),[A,j]=(0,k.useState)(``),[M,N]=(0,k.useState)(null),P=(0,k.useRef)(null),{mostUsed:F,project:I,global:L}=f(l(e,A,t),t),R=(e,t)=>{let i=n.includes(e.name);return(0,E.jsxs)(C,{value:`skill ${e.name} ${e.path}`,keywords:u(e.name,e.description),"data-slot":`${_}-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,disabled:!i&&g!==void 0&&n.length>=g,onSelect:()=>c(e.name),children:[(0,E.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,E.jsx)(`button`,{type:`button`,"data-slot":`${_}-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),N(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,E.jsx)(s,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,E.jsx)(a,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(T,{skill:M,onClose:()=>N(null)}),(0,E.jsxs)(h,{open:D,onOpenChange:e=>{O(e),e||j(``)},children:[(0,E.jsx)(p,{asChild:!0,children:(0,E.jsxs)(`button`,{type:`button`,"data-slot":`${_}-skills-trigger`,"aria-label":`Choose skills`,className:r(w,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,E.jsx)(i,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,E.jsx)(o,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,E.jsx)(m,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,E.jsxs)(x,{label:`Choose skills`,shouldFilter:!1,children:[(0,E.jsx)(S,{placeholder:`search skills…`,value:A,onValueChange:j,onInput:()=>P.current?.scrollTo(0,0)}),(0,E.jsxs)(y,{ref:P,"data-slot":`${_}-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[F.length===0&&I.length===0&&L.length===0?(0,E.jsx)(b,{children:`Nothing matches.`}):null,F.length>0?(0,E.jsx)(v,{heading:`Most used`,children:F.map(e=>R(e,d(e)))}):null,I.length>0?(0,E.jsx)(v,{heading:`Project skills`,children:I.map(e=>R(e,!0))}):null,L.length>0?(0,E.jsx)(v,{heading:`Global`,children:L.map(e=>R(e,!1))}):null]})]})})]})]})}export{D as i,A as n,O as r,j as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ba as r,Bt as i,Ln as a,Q as o,Va as s,b as c,sr as l}from"./queries-DOHu2y2B.js";import{Tt as u}from"./utils-Df_1kJEk.js";import{N as d,t as f}from"./button-BrxohNcK.js";import{t as p}from"./bot-qZRkHkDp.js";import{c as m,i as h,n as g,r as _,u as v}from"./icon-tooltip-CUJLXOxf.js";import{t as y}from"./external-link-BVYdhpSK.js";import{t as ee}from"./folder-CeFUSrsO.js";import{tt as b}from"./composer-attachments-Xa-qW8Eq.js";var te=d(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),ne=d(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),re=d(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),x=d(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ie=d(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),S=d(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),C=d(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),w=d(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ae=d(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),oe=d(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),se=d(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),ce=d(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),le=d(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),T=d(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),E=d(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),D=d(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),O=d(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),k=d(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),A=e(t(),1),j={claude:`Claude Code`,codex:`Codex`,junie:`Junie`,opencode:`OpenCode`,cursor:`Cursor`,pi:`pi`,copilot:`GitHub Copilot CLI`,antigravity:`Antigravity`};function M(e){let t=e.currentStepId?e.steps.find(t=>t.id===e.currentStepId):void 0;if(t?.backend)return t.backend;if(e.runner)return e.runner;for(let t=e.steps.length-1;t>=0;--t){let n=e.steps[t]?.backend;if(n)return n}return`claude`}function N(e){return e.runner??`claude`}function P(e,t){let n=s(t,e);return n?.enabled===!1?{provider:e,usable:!1,reason:`${j[e]} is disabled. Enable it in Settings → Agents → Providers.`}:!n||!r(n)?{provider:e,usable:!1,reason:`${j[e]} credentials are unavailable. Authorize it in Settings → Agents → Providers.`}:{provider:e,usable:!0}}function ue(e,t){return P(M(e),t)}function de(e,t){return P(N(e),t)}function F(e){let t=o(),n=M(e);return t.isSuccess&&t.data?ue(e,t.data):{provider:n,usable:!0}}function fe(e){let t=o(),n=N(e);return t.isSuccess&&t.data?de(e,t.data):t.isError?{provider:n,usable:!1,reason:`Provider authentication could not be verified.`}:{provider:n,usable:!1,reason:`Checking agent providers…`}}var I=n(),L={folder:ee,terminal:D,vscode:re,cursor:se,zed:k,windsurf:O,sublime:S,idea:ie,pycharm:oe,webstorm:w,goland:le,rubymine:C,phpstorm:ne,clion:x,rider:te,"android-studio":T,xcode:ae,warp:ce,claude:p,codex:E,junie:p,opencode:p,pi:p,copilot:p,antigravity:p};function R(e){return e.icon&&L[e.icon]||y}var z=RegExp(`^cli:(${u.options.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})$`);function B(e){let t=z.exec(e);return t?t[1]:void 0}function V({choices:e,onPick:t,label:n=`Open in…`,title:r,triggerVariant:i=`ghost`,disabled:a=!1,leading:o,trailing:s,slot:c}){return(0,I.jsxs)(g,{children:[(0,I.jsx)(v,{asChild:!0,children:(0,I.jsxs)(f,{variant:i,size:`sm`,title:r,disabled:a,"data-slot":c,children:[(0,I.jsx)(y,{"aria-hidden":`true`}),n]})}),(0,I.jsxs)(_,{align:`end`,children:[o,o&&e.length>0?(0,I.jsx)(m,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=R(e);return(0,I.jsxs)(h,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,I.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),s]})]})}var pe=[`done`,`failed`,`cancelled`],me=[`done`,`failed`];function H(e){return e.status===`failed`&&e.autoResumeAt!==void 0}function U(e){return e.status===`failed`&&e.awaitingAnswerSince!==void 0}function W(e){return pe.includes(e)}function G(e){return e.archived||H(e)||U(e)||!me.includes(e.status)?!1:e.finishedAt!==void 0}function K(e){let t=e.finishedAt;return t===void 0||!G(e)?!1:e.seenAt===void 0||e.seenAt<t}function he(e){return H(e)||U(e)?!1:W(e.status)&&!K(e)}function ge(e){return e.reduce((e,t)=>K(t)?e+1:e,0)}function q(e){return e===`running`||e===`queued`||e===`waiting`}function _e(e){return!q(e.status)&&e.worktree!==!1&&!!e.worktreePath&&!e.worktreeReclaimedAt&&!e.worktreeLifecycle?.activeOperationId}function J(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}var ve=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/,Y={claude:`claude --resume`,codex:`codex resume`,opencode:`opencode --session`,cursor:`agent --resume`,junie:`junie --resume`,pi:`pi --session`,copilot:`copilot --resume`,antigravity:`agy --conversation`};function ye(e,t){if(ve.test(t))return e===`junie`?`${Y.junie} --session-id=${t}`:`${Y[e??`claude`]} ${t}`}function be(e){if(q(e.status)||e.worktreeLifecycle?.activeOperationId)return;let t=J(e);if(t===void 0)return;let n=ye(e.runner,t);if(n!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${n}`:n}function xe(e,t){let n=B(t);return!n||q(e.status)||e.worktreeLifecycle?.activeOperationId?!1:n===(e.runner??`claude`)&&J(e)!==void 0}function X(e){let t=q(e.status),n=J(e)!==void 0,r=!!e.worktreeLifecycle?.activeOperationId;return{finish:!r&&(e.status===`waiting`||e.status===`review`),continueRun:!r&&!t&&n,terminal:!r&&!t&&n,notes:!0,archive:!t,pin:!e.archived,markUnread:G(e)&&!K(e),markRead:G(e)&&K(e),promote:e.status===`queued`&&!e.archived,cancel:!r&&t,deleteRun:!r&&!t}}function Se(e){return e?`Resolve conflicts in PR ${e}`:`Resolve conflicts`}function Ce(e){return e?`Fix failing checks in PR ${e}`:`Fix failing checks`}function we(e){return e?`Commit and push`:`Commit`}function Te(){return`Push`}function Z(e){let t=e?.replace(/^origin\//,``);return t&&!/^[0-9a-f]{7,40}$/i.test(t)?t:void 0}function Ee(e,t){let n=Z(t);return`${e?`Create draft PR`:`Create PR`}${n?` against ${n}`:``}`}function De(e){let t=Z(e);return t?`Update branch from ${t}`:`Update branch`}function Oe(e,t){return`${e?`Create draft PR`:`Create PR`} against ${t} instead of landing: move these changes to a new branch, commit and push it, open the PR, then switch the checkout back to ${t}`}function ke(e){return`Update branch: pull the latest ${e} into the checkout (rebase, keeping these uncommitted changes)`}function Q(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function Ae(e,t){return a(e).get(t)}var je=[50,100,200,400,800,1e3,1e3,1e3,1e3],Me=e=>new Promise(t=>setTimeout(t,e));function Ne(e){return e instanceof l&&e.status===409&&e.message===`run is still active`}async function $(e,t=Me){for(let n=0;;n+=1)try{return await e()}catch(e){let r=je[n];if(!Ne(e)||r===void 0)throw e;await t(r)}}function Pe(e){return q(e.status)?`live`:X(e).continueRun?`resume`:`unavailable`}function Fe(e,t,n=`ask_answer`){let r=i(e.id,t),a=c(e.id,t),o=F(e),s=fe(e),[u,d]=(0,A.useState)(void 0),[f,p]=(0,A.useState)(!1),m=(0,A.useRef)(!1),h=Pe(e),g=h===`resume`?!s.usable:h===`live`&&!o.usable,_=h===`unavailable`?`no-session`:g?`provider`:void 0,v=_===`no-session`?`This session has ended and no agent session was recorded, so the answer cannot be delivered.`:_===`provider`?h===`resume`?s.reason:o.reason:void 0,y=e=>s.usable?a.mutateAsync({text:e}).then(e=>(b(n),e)):Promise.reject(Error(s.reason??`The run provider is unavailable.`));return{mode:h,blockedBy:_,reason:v,isPending:f||r.isPending||a.isPending,error:u,send:async t=>{if(_||m.current)return v;m.current=!0,p(!0),d(void 0);try{if(h===`resume`){await $(()=>y(t));return}try{await r.mutateAsync({text:t}),b(n)}catch(n){if(n instanceof l&&n.status===409&&J(e)!==void 0){await $(()=>y(t));return}throw n}return}catch(e){let t=e instanceof Error?e.message:String(e);return d(t),t}finally{m.current=!1,p(!1)}}}}export{T as A,V as C,k as D,F as E,x as M,D as O,ge as S,R as T,q as _,Ee as a,he as b,Oe as c,Te as d,Ae as f,De as g,X as h,we as i,w as j,E as k,ke as l,be as m,_e as n,Q as o,Se as p,xe as r,Ce as s,Fe as t,J as u,G as v,B as w,K as x,W as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,Br as i,F as a,Ga as o,Hi as s,Ht as c,Ka as l,Mt as u,Tr as d,Vr as f,Ya as p,aa as m,dt as h,hi as g,pi as _,qa as v,r as ee,rn as y,sr as te,wa as ne}from"./queries-DOHu2y2B.js";import{A as b,B as x,F as re,I as S,M as ie,N as C,P as ae,R as oe,V as se,c as w,j as ce,k as le,t as T}from"./utils-Df_1kJEk.js";import{g as ue,h as de,r as fe}from"./toaster-DrFdGtNN.js";import{a as E,c as pe,d as me,f as he,g as ge,i as _e,l as ve,o as ye,p as be,s as xe,t as Se,u as Ce}from"./sortable.esm-O2daV3YI.js";import{a as we,i as Te,o as Ee,r as De,t as Oe}from"./sheet-7RYAcp_E.js";import{N as D,t as O}from"./button-BrxohNcK.js";import{gt as ke}from"./git-tab-loading-DhclV71X.js";import{t as Ae}from"./arrow-down-cBTb_EjO.js";import{t as je}from"./arrow-left-BvR1Oqhc.js";import{m as Me,p as Ne}from"./worktree-lifecycle-operation-mYB7KCpQ.js";import{u as Pe}from"./reference-chip-ty5g_OLC.js";import{t as Fe}from"./arrow-up-Cn0IS81u.js";import{D as Ie}from"./ask-answer-Cfb0vEFv.js";import{a as k,c as A,d as Le,f as j,i as Re,l as ze,m as Be,n as Ve,o as He,p as Ue,r as We,s as Ge,t as Ke,u as M}from"./automation-format-BPrWgGBz.js";import{t as qe}from"./chevron-left-D74_-PJ_.js";import{f as Je}from"./tooltip-p6YPEpXC.js";import{t as Ye}from"./chevron-right-C3fLn_fF.js";import{c as Xe,i as N,n as Ze,r as Qe,u as $e}from"./icon-tooltip-CUJLXOxf.js";import{i as et}from"./reference-conflict-action-B2LrO-o3.js";import{f as tt}from"./git-toolbar-Bk-3i42V.js";import{n as nt,t as rt}from"./settings-2-DIHmg7wZ.js";import{C as it,a as at,c as ot,o as st}from"./composer-GntpkeQD.js";import{t as ct}from"./pencil-DWtoOm2f.js";import{t as lt}from"./play-BYwEI1EA.js";import{t as ut}from"./plus-BPopgSYQ.js";import{t as dt}from"./terminal-B-JX8x9P.js";import{n as ft,t as pt}from"./textarea-BXN4nZ0d.js";import{n as mt,r as ht,t as gt}from"./collapsible-BJ0sxcz9.js";import{a as _t,c as vt,i as yt,n as bt,o as xt,r as St,s as Ct,t as wt}from"./alert-dialog-BZkKvKiu.js";import{t as P}from"./input-BxjGaO_P.js";import{S as Tt}from"./composer-attachments-Xa-qW8Eq.js";import{t as F}from"./status-dot-C_5ryAFi.js";import{c as I,s as Et,t as L}from"./project-router-CmpQcVZp.js";import{t as Dt}from"./use-now-DQpgbshl.js";import{n as Ot}from"./format-DHK74MwW.js";import{r as kt}from"./directional-usage-BtjgT5nc.js";import{r as R,t as At}from"./picker-pill-DQICTO2N.js";import{t as jt}from"./centered-state-CSW_o4N7.js";import{$ as z,F as Mt,G as Nt,H as Pt,I as Ft,J as It,K as Lt,L as Rt,M as zt,N as Bt,P as Vt,Q as B,R as Ht,U as Ut,W as Wt,X as V,Y as Gt,Z as H,a as Kt,c as qt,dt as Jt,et as U,i as Yt,nt as Xt,p as Zt,pt as Qt,q as $t,rt as W,tt as G,z as en}from"./index-CDhEdFaZ.js";var tn=D(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),nn=D(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),rn=D(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),an=D(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),K=e(t(),1),q=n();function on({association:e,selected:t,onSelect:n,onRemove:r}){let i=o({queryKey:[`tracker`,w(),`label-suggestions`,e],initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>g({association:e,state:`all`,limit:50,cursor:t},{signal:n}),getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,retry:!1,staleTime:6e4}),a=i.data?.pages??[],s=a.at(-1),c=a.find(e=>!e.available),l=i.isError||!!c,u=[...new Set([...t,...l?[]:a.flatMap(e=>e.available?e.items.flatMap(e=>e.labels):[])])].filter(e=>t.includes(e)||e.length>0&&e.length<=200).sort((e,t)=>e.localeCompare(t));return(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,"aria-label":`Project label suggestions`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:`Required labels`}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`All selected labels must match. Leave unselected to allow any label.`}),(0,q.jsx)(`div`,{role:`group`,"aria-label":`Required labels`,className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,q.jsx)(R,{active:t.includes(e),"aria-pressed":t.includes(e),disabled:!t.includes(e)&&t.length>=100,onClick:()=>t.includes(e)?r(e):n(e),children:e},e))}),i.isFetching?(0,q.jsx)(`p`,{role:`status`,children:`Loading labels…`}):null,l?(0,q.jsxs)(`div`,{role:`alert`,children:[(0,q.jsx)(`p`,{children:`Could not load labels. Your selection is preserved.`}),(0,q.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void i.refetch(),children:`Retry label suggestions`})]}):(0,q.jsxs)(q.Fragment,{children:[!i.isPending&&!i.isFetching&&u.length===0?(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No labels found in the loaded tasks.`}):null,i.hasNextPage?(0,q.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,disabled:i.isFetching,onClick:()=>void i.fetchNextPage(),children:`Load labels from more tasks`}):null,!i.hasNextPage&&s?.available&&s.truncated?(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The provider returned a limited task list.`}):null]})]})}var sn=[`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`];function cn(e){return[{id:`task`,name:e,skill:e,prompt:`{{task}}`}]}function ln(e){let[t,...n]=e??[];return t&&n.length===0&&t.skill&&t.prompt===`{{task}}`?t.skill:null}function un(e){return e.skill?{source:`skill`,ref:e.skill}:e.workflow&&e.workflow!==`quick-task`?{source:`workflow`,ref:e.workflow}:null}function dn(e){return e?.source===`skill`?{skill:e.ref,workflow:Tt,customSteps:null}:{skill:null,workflow:e?.ref??`quick-task`,customSteps:null}}var fn=[2,5,10,15,30,60],pn=[1,2,4,6,8],mn={authors:``,assignees:``,anyLabels:``,allLabels:``,excludeLabels:``,changedLabels:``,reviewers:``,lookbackDays:7,maxRecords:25},hn={type:`daily`,hour:4,minute:0};function gn(){return{name:``,kind:`schedule`,schedule:{...hn},events:[`issue.opened`],intervalSeconds:300,filters:{...mn},prompt:``,workflow:Tt,skill:null,customSteps:null,runner:null,account:null,model:null,autonomous:!0,dispatch:!1,maxSubtasks:4,reviewChild:!0,enabled:!1}}var J=e=>(e??[]).join(`, `);function _n(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function vn(e){return{authors:J(e.authors),assignees:J(e.assignees),anyLabels:J(e.anyLabels),allLabels:J(e.allLabels),excludeLabels:J(e.excludeLabels),changedLabels:J(e.changedLabels),reviewers:J(e.reviewers),lookbackDays:e.lookbackDays,maxRecords:e.maxRecords}}function yn(e){let t=gn(),{task:n,filters:r}=e,i=ln(n.steps);return{...t,name:e.name,kind:e.kind,trackerTrigger:e.trackerTrigger,schedule:e.schedule?{...e.schedule}:t.schedule,schedules:e.schedules?.map(e=>({...e})),events:e.events?.length?[...e.events]:t.events,intervalSeconds:e.intervalSeconds??t.intervalSeconds,filters:r?vn(r):t.filters,prompt:n.prompt,workflow:n.workflow??t.workflow,skill:i,customSteps:n.steps&&!i?n.steps:null,runner:n.runner??null,account:n.agentProfile??null,model:n.model??null,autonomous:n.autonomous??!1,dispatch:n.dispatch!==void 0,maxSubtasks:n.dispatch?.maxSubtasks??t.maxSubtasks,reviewChild:n.dispatch?.reviewChild??t.reviewChild,enabled:e.enabled,...n.checkout===void 0?{}:{checkout:n.checkout},...n.allowForkHeads===void 0?{}:{allowForkHeads:n.allowForkHeads}}}function bn(e){return{name:e.name,kind:e.kind,...e.schedule?{schedule:e.schedule}:{},...e.schedules?{schedules:e.schedules}:{},...e.events?{events:e.events}:{},...e.intervalSeconds===void 0?{}:{intervalSeconds:e.intervalSeconds},...e.filters?{filters:e.filters}:{},prompt:e.task.prompt,...e.task.workflow?{workflow:e.task.workflow}:{},...e.task.steps?{steps:e.task.steps}:{},...e.task.runner?{runner:e.task.runner}:{},...e.task.model===void 0?{}:{model:e.task.model},...e.task.autonomous===void 0?{}:{autonomous:e.task.autonomous},...e.task.dispatch?{dispatch:e.task.dispatch}:{},...e.task.checkout?{checkout:e.task.checkout}:{},...e.task.allowForkHeads===void 0?{}:{allowForkHeads:e.task.allowForkHeads}}}var xn=e=>e===`claude`||e===`codex`||e===`junie`||e===`opencode`||e===`cursor`||e===`pi`||e===`copilot`||e===`antigravity`;function Sn(e,t){let n=ln(t.steps);return{...e,name:t.name,kind:t.kind,schedule:t.schedule?{...t.schedule}:e.schedule,schedules:t.schedules?.map(e=>({...e})),events:t.events?.length?[...t.events]:e.events,intervalSeconds:t.intervalSeconds??e.intervalSeconds,filters:t.filters?vn(t.filters):{...mn},prompt:t.prompt,...t.steps?{skill:n,customSteps:n?null:t.steps,workflow:Tt}:dn(t.workflow?{source:`workflow`,ref:t.workflow}:null),checkout:t.checkout,allowForkHeads:t.allowForkHeads,runner:t.runner!==void 0&&xn(t.runner)?t.runner:e.runner,account:t.runner!==void 0&&xn(t.runner)?null:e.account,model:t.model??e.model,autonomous:t.autonomous??e.autonomous,dispatch:t.dispatch!==void 0,maxSubtasks:t.dispatch?.maxSubtasks??e.maxSubtasks,reviewChild:t.dispatch?.reviewChild??e.reviewChild}}function Cn(e){let t=S(e);switch(t.type){case`hours`:return{type:`hours`,every:t.every};case`weekly`:return{type:`weekly`,hour:t.hour,minute:t.minute,day:t.day};case`once`:return{type:`once`,hour:t.hour,minute:t.minute,...t.date?{date:t.date}:{}};default:return{type:t.type,hour:t.hour,minute:t.minute}}}function wn(e){let t={prompt:e.prompt,...e.skill?{steps:cn(e.skill)}:e.customSteps?{steps:e.customSteps}:e.workflow?{workflow:e.workflow}:{},...e.runner?{runner:e.runner}:{},...e.account?{agentProfile:e.account}:{},...e.model?{model:e.model}:{},autonomous:e.autonomous,...e.dispatch?{dispatch:{maxSubtasks:e.maxSubtasks,reviewChild:e.reviewChild}}:{}};if(e.kind===`schedule`)return{name:e.name.trim(),kind:`schedule`,schedule:Cn(e.schedule),...e.schedules?{schedules:[e.schedule,...e.schedules.slice(1)].map(Cn)}:{},task:t};if(e.kind===`tracker`)return{name:e.name.trim(),kind:`tracker`,trackerTrigger:e.trackerTrigger,intervalSeconds:e.intervalSeconds,filters:{lookbackDays:Tn(e.filters.lookbackDays,1,90),maxRecords:Tn(e.filters.maxRecords,1,100)},task:t};let n=e.filters,r=(e,t)=>{let n=_n(e);return n.length>0?{[t]:n}:{}};return{name:e.name.trim(),kind:`github`,events:[...e.events],intervalSeconds:e.intervalSeconds,filters:{...r(n.authors,`authors`),...r(n.assignees,`assignees`),...r(n.anyLabels,`anyLabels`),...r(n.allLabels,`allLabels`),...r(n.excludeLabels,`excludeLabels`),...r(n.changedLabels,`changedLabels`),...r(n.reviewers,`reviewers`),lookbackDays:Tn(n.lookbackDays,1,90),maxRecords:Tn(n.maxRecords,1,100)},task:{...t,...e.checkout===void 0?{}:{checkout:e.checkout},...e.allowForkHeads===void 0?{}:{allowForkHeads:e.allowForkHeads}}}}function Tn(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function En(e){let t=wn(e);return{name:t.name,kind:e.kind,...t.trackerTrigger?{trackerTrigger:t.trackerTrigger}:{},...t.schedule?{schedule:t.schedule}:{},...t.schedules?{schedules:t.schedules}:{},...t.events?{events:t.events}:{},...t.intervalSeconds===void 0?{}:{intervalSeconds:t.intervalSeconds},...t.filters?{filters:t.filters}:{},task:t.task,...e.enabled?{enable:!0}:{}}}var Dn=`([a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38})`,On=RegExp(`\\b(?:user|author|by)\\s+(?:\`@?${Dn}\`|@${Dn}(?![\\w/-]))`,`gi`),kn=[`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`],An=new Set(`a an the this that these those any all each every some me my you your it its them their us our we he she they who whom which what someone anyone everyone others other pull pr prs issue issues review reviews reviewer reviewers request requests team teams user users human humans changes code now approval merge`.split(` `)),jn=`(?:\`@?${Dn}\`|@${Dn}(?![\\w/-]))`,Mn=RegExp(`\\breview(?:s|\\s+requests?)?\\s+(?:(?:is|are)\\s+)?(?:requested\\s+)?(?:for|from|of)\\s+(?:${jn}|${Dn}\\b(?![/@-]))`,`gi`),Nn=RegExp(`\\b(?:requested\\s+)?reviewer\\s+${jn}`,`gi`),Pn=RegExp(`${jn}\\s+(?:(?:is|are|gets?)\\s+)?requested\\s+as\\s+(?:a\\s+)?reviewer\\b`,`gi`);function Fn(e){if(e.kind!==`github`)return[];let t=new Set([e.filters.authors,e.filters.assignees,e.filters.reviewers].flatMap(_n).map(e=>e.replace(/^@/,``).toLowerCase())),n=new Map,r=(e,r)=>{let i=e?.toLowerCase();!e||!i||t.has(i)||n.has(i)||n.set(i,{login:e,field:r})};if(e.events?.some(e=>kn.includes(e)))for(let t of[Mn,Nn,Pn])for(let n of e.prompt.matchAll(t)){let e=n[1]??n[2]??n[3];e&&!An.has(e.toLowerCase())&&r(e,`reviewers`)}for(let t of e.prompt.matchAll(On))r(t[1]??t[2],`authors`);return[...n.values()]}function In(e){return e.includes(`issue.labeled`)||e.includes(`issue.unlabeled`)}var Ln=e=>[1,2,3,4,6,8,12].includes(e);function Rn({trigger:e,intervalSeconds:t,onChange:n,onValid:r}){let[i,a]=(0,K.useState)(``),s=w(),c=o({queryKey:[`tracker`,s,`automation-options`,``],initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>_({...t?{cursor:t}:{}},{signal:e}),getNextPageParam:e=>e.available?e.nextCursor:void 0,retry:!1}),l=o({queryKey:[`tracker`,s,`automation-options`,i],enabled:!!i&&c.data?.pages[0]?.available===!0,initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>_({...i?{search:i}:{},...t?{cursor:t}:{}},{signal:e}),getNextPageParam:e=>e.available?e.nextCursor:void 0,retry:!1}),u=i?l:c,d=c.data?.pages[0],f=d?.available?d:void 0,p=!!f&&!!e&&JSON.stringify(f.association)===JSON.stringify(e.association),m=!!e?.access&&p&&!!e?.events.length&&e.events.every(e=>f?.events.includes(e))&&(e.requiredLabels?.length??0)<=100&&(e.requiredLabels??[]).every(e=>e.length>0&&e.length<=200)&&(!e.events.includes(`issue.status_changed`)||!!e.targetStatusIds?.length)&&(!(e.events.includes(`issue.labeled`)||e.events.includes(`issue.unlabeled`))||!!e.changedLabelIds?.length);(0,K.useEffect)(()=>(r(m),()=>r(!1)),[m,r]);let h=u.data?.pages.flatMap(e=>e.available?[e]:[])??[],g=[...new Map(h.flatMap(e=>e.statuses).map(e=>[e.id,e])).values()],v=new Map((c.data?.pages.flatMap(e=>e.available?e.statuses:[])??[]).map(e=>[e.id,e.name])),ee=(e?.targetStatusIds??[]).filter(e=>!g.some(t=>t.id===e)),y=[...new Map(h.flatMap(e=>e.labels).map(e=>[e.id,e])).values()],te=e?.events.includes(`issue.status_changed`),ne=e?.events.some(e=>e===`issue.labeled`||e===`issue.unlabeled`),b=te&&ne?`Search tracker statuses and labels`:ne?`Search tracker labels`:`Search tracker statuses`;return(0,q.jsxs)(`div`,{"data-slot":`editor-tracker`,className:`flex flex-col gap-3 text-sm`,children:[c.isPending?(0,q.jsx)(`p`,{children:`Loading tracker events…`}):null,c.isError||d&&!d.available?(0,q.jsxs)(`div`,{role:`alert`,children:[(0,q.jsxs)(`p`,{children:[d&&!d.available?d.reason:`Could not load tracker events.`,` Check the project’s Issue tracker settings.`]}),(0,q.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void c.refetch(),children:`Retry`})]}):null,f?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{children:[f.association.kind===`jira`?`Jira`:`Linear`,` · `,f.association.externalName]}),e&&!p?(0,q.jsx)(`p`,{role:`alert`,children:`The tracker connection changed. Select an event again before saving.`}):null,e?null:(0,q.jsx)(`p`,{children:`Select an event to complete this automation.`}),(0,q.jsx)(`div`,{role:`group`,"aria-label":`Tracker events`,className:`flex flex-wrap gap-1.5`,children:f.events.map(t=>(0,q.jsx)(R,{active:p&&e?.events.includes(t),"aria-pressed":p&&e?.events.includes(t),onClick:()=>{let r=p?e.events:[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t],a=e?.access??(e?void 0:{version:1,writes:[]}),o={...p?e:{},...a?{access:a}:{},association:f.association,events:i};t===`issue.status_changed`&&!i.includes(t)&&delete o.targetStatusIds,n({trackerTrigger:o,...p?{}:{enabled:!1}})},children:t},t))}),p&&e?(0,q.jsx)(on,{association:f.association,selected:e.requiredLabels??[],onRemove:t=>n({trackerTrigger:{...e,requiredLabels:(e.requiredLabels??[]).filter(e=>e!==t)}}),onSelect:t=>n({trackerTrigger:{...e,requiredLabels:[...new Set([...e.requiredLabels??[],t])]}})},JSON.stringify(f.association)):null,(0,q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer`,children:`Integration details`}),(0,q.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,q.jsx)(`p`,{children:`Label choices come from loaded tasks in this project, including closed tasks. Saved selections remain available.`}),f.limitations.map(e=>(0,q.jsx)(`p`,{children:e},e))]})]}),e?.events.some(e=>e!==`issue.opened`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(P,{"aria-label":b,placeholder:b,value:i,onChange:e=>a(e.target.value)}),u.isFetching?(0,q.jsx)(`p`,{role:`status`,children:`Searching…`}):null,u.isError||u.data?.pages[0]&&!u.data.pages[0].available?(0,q.jsxs)(`div`,{role:`alert`,children:[`Could not load search results. `,(0,q.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void u.refetch(),children:`Retry search`})]}):null,!u.isFetching&&u.data?.pages[0]?.available&&te&&g.length===0?(0,q.jsx)(`p`,{children:`No matching statuses.`}):null,!u.isFetching&&u.data?.pages[0]?.available&&ne&&y.length===0?(0,q.jsx)(`p`,{children:`No matching labels.`}):null,e.events.includes(`issue.status_changed`)?(0,q.jsxs)(`div`,{role:`group`,"aria-label":`Target statuses`,className:`flex flex-wrap gap-1.5`,children:[g.map(t=>(0,q.jsx)(R,{active:e.targetStatusIds?.includes(t.id),"aria-pressed":e.targetStatusIds?.includes(t.id),onClick:()=>{let r=e.targetStatusIds??[];n({trackerTrigger:{...e,targetStatusIds:r.includes(t.id)?r.filter(e=>e!==t.id):[...r,t.id]}})},children:t.name},t.id)),ee.map(t=>(0,q.jsxs)(R,{active:!0,"aria-pressed":!0,onClick:()=>{n({trackerTrigger:{...e,targetStatusIds:(e.targetStatusIds??[]).filter(e=>e!==t)}})},children:[v.get(t)??t,` (not in current results)`]},t))]}):null,e.events.some(e=>e===`issue.labeled`||e===`issue.unlabeled`)?(0,q.jsx)(`div`,{role:`group`,"aria-label":`Changed labels`,className:`flex flex-wrap gap-1.5`,children:y.map(t=>(0,q.jsx)(R,{active:e.changedLabelIds?.includes(t.id),"aria-pressed":e.changedLabelIds?.includes(t.id),onClick:()=>{let r=e.changedLabelIds??[];n({trackerTrigger:{...e,changedLabelIds:r.includes(t.id)?r.filter(e=>e!==t.id):[...r,t.id]}})},children:t.name},t.id))}):null,u.hasNextPage?(0,q.jsx)(O,{variant:`outline`,size:`sm`,disabled:u.isFetchingNextPage,onClick:()=>void u.fetchNextPage(),children:`Load more`}):null]}):null]}):null,(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[`Check every`,(0,q.jsxs)(V,{value:String(t/60),onValueChange:e=>n({intervalSeconds:Number(e)*60}),children:[(0,q.jsx)(z,{"aria-label":`Tracker poll interval`,className:`w-28`,children:(0,q.jsx)(U,{})}),(0,q.jsx)(H,{children:fn.map(e=>(0,q.jsxs)(B,{value:String(e),children:[e,` min`]},e))})]})]}),e&&p?(0,q.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`legend`,{children:`Tracker access`}),e.access?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{children:`Fresh issue details and accessible comments are read by cezar. Attachments and custom fields are not included. Tokens stay with cezar.`}),[`comment`,`transition`].map(t=>(0,q.jsxs)(`label`,{className:`flex gap-2`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.access.writes.includes(t),onChange:r=>n({trackerTrigger:{...e,access:{version:1,writes:r.target.checked?[...e.access.writes,t]:e.access.writes.filter(e=>e!==t)}}})}),`Allow agent to `,t===`comment`?`post comments`:`change status`,` on this issue without further approval`]},t))]}):(0,q.jsxs)(`div`,{role:`alert`,children:[`This automation previously gave its agent a tracker token. Review the prompt: only reading this issue, comments and status transitions are now supported. Other operations need a revised workflow.`,(0,q.jsx)(O,{type:`button`,variant:`outline`,onClick:()=>n({trackerTrigger:{...e,access:{version:1,writes:[]}}}),children:`Confirm migration to read-only access`})]})]}):null,(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only events after enabling are eligible. Existing backlog is not launched. Use a token with minimal read permissions; grant provider write permissions only for selected write actions.`})]})}function zn({definition:e}){let t=Gt(e),n=(0,K.useMemo)(()=>It(e),[e]);return(0,q.jsxs)(j,{flush:!0,"data-slot":`copy-as-cli`,className:`px-3.5 py-3`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center`,children:[(0,q.jsx)(`span`,{className:`eyebrow text-soft-foreground`,children:`Copy as CLI`}),(0,q.jsxs)(O,{variant:`ghost`,size:`sm`,className:`ml-auto h-6`,onClick:()=>void Ut(n,t?$t:void 0),children:[(0,q.jsx)(ke,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})]}),(0,q.jsx)(`pre`,{className:`m-0 rounded-lg border border-border bg-card-2 px-2.5 py-2 font-mono text-meta leading-[1.6] break-words whitespace-pre-wrap text-muted-foreground`,children:n}),(0,q.jsx)(`p`,{className:`mt-2 mb-0 text-meta leading-[1.5] text-soft-foreground`,children:t?$t:(0,q.jsxs)(q.Fragment,{children:[`The same definition the cockpit saves — `,(0,q.jsx)(`code`,{className:`text-meta`,children:`cez automation schema`}),` prints its shape.`]})})]})}function Bn({available:e,enabled:t,maxSubtasks:n,reviewChild:r,onChange:i}){if(!e)return null;let a=pn.includes(n)?pn:[...pn,n].sort((e,t)=>e-t);return(0,q.jsxs)(`div`,{"data-slot":`editor-dispatch`,"data-enabled":t?`true`:void 0,title:`Let this run start its own subtasks with cez task create — each in a worktree forked off its branch, reporting back into the parent session.`,className:`flex flex-wrap items-center gap-2.5 border-t border-border pt-3 text-ui text-muted-foreground`,children:[(0,q.jsxs)(W,{className:`text-ui font-medium text-foreground`,children:[(0,q.jsx)(nt,{"aria-hidden":`true`,className:T(`size-3.5`,t?`text-violet`:`text-soft-foreground`)}),`Dispatch`,(0,q.jsx)(Xt,{"aria-label":`Dispatch`,checked:t,onCheckedChange:e=>i(e?{dispatch:!0}:{dispatch:!1,reviewChild:!1})})]}),t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`up to`,(0,q.jsxs)(V,{value:String(n),onValueChange:e=>i({maxSubtasks:Number(e)}),children:[(0,q.jsx)(z,{size:`sm`,"aria-label":`Max subtasks`,className:`h-7 px-2 text-label`,children:(0,q.jsx)(U,{})}),(0,q.jsx)(H,{children:a.map(e=>(0,q.jsx)(B,{value:String(e),children:e},e))})]}),`subtasks`]}),(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,q.jsxs)(W,{className:`text-ui font-normal text-muted-foreground`,children:[(0,q.jsx)(Xt,{size:`sm`,"aria-label":`Review child`,checked:r,onCheckedChange:e=>i({reviewChild:e})}),`review child`]}),(0,q.jsxs)(`span`,{"data-slot":`editor-dispatch-hint`,className:`ml-auto text-meta whitespace-nowrap text-soft-foreground`,children:[`≤ `,n+1,` agents`]})]}):null]})}var Vn={"pull_request.opened":`A pull request opens`,"issue.opened":`An issue opens`,"issue.labeled":`An issue gets a label`,"issue.unlabeled":`An issue loses a label`,"pull_request.reviewed":`A review is submitted`,"pull_request.review_requested":`A review is requested`,"pull_request.rereview_requested":`A re-review is requested`,"pull_request.closed":`A pull request closes`,"pull_request.merged":`A pull request merges`};function Hn({events:e,intervalSeconds:t,filters:n,onChange:r}){let i=[`authors`,`assignees`,`anyLabels`,`allLabels`,`excludeLabels`,`changedLabels`,`reviewers`].filter(e=>n[e].trim().length>0),[a,o]=(0,K.useState)(i.length>0||n.lookbackDays!==7||n.maxRecords!==25),s=(e,t)=>r({filters:{...n,[e]:t}}),c=t=>{let n=e.includes(t)?e.filter(e=>e!==t):[...e,t];r({events:sn.filter(e=>n.includes(e))})},l=In(e),u=l&&n.changedLabels.trim().length===0;return(0,q.jsxs)(`div`,{"data-slot":`editor-github`,className:`flex flex-col gap-4`,children:[(0,q.jsx)(`div`,{role:`group`,"aria-label":`GitHub events`,className:`flex flex-wrap gap-1.5`,children:sn.map(t=>(0,q.jsxs)(R,{active:e.includes(t),"aria-pressed":e.includes(t),"aria-label":t,title:t,className:`h-8 gap-2 px-3`,onClick:()=>c(t),children:[Vn[t],(0,q.jsx)(`span`,{className:`font-mono text-micro font-normal text-soft-foreground`,children:t})]},t))}),e.length===0?(0,q.jsx)(`p`,{className:`m-0 text-label text-danger`,children:`Pick at least one event.`}):null,(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-ui text-muted-foreground`,children:[`Checks GitHub every`,(0,q.jsxs)(V,{value:String(Math.round(t/60)),onValueChange:e=>r({intervalSeconds:Number(e)*60}),children:[(0,q.jsx)(z,{size:`sm`,"aria-label":`Poll interval`,className:`text-ui`,children:(0,q.jsx)(U,{})}),(0,q.jsx)(H,{children:fn.map(e=>(0,q.jsxs)(B,{value:String(e),children:[e,` min`]},e))})]}),(0,q.jsxs)(`span`,{children:[`while this cockpit is open, looking back `,n.lookbackDays,` days, at most `,n.maxRecords,` records.`]})]}),(0,q.jsxs)(`p`,{"data-slot":`editor-github-how`,className:`-mt-2 m-0 text-label text-soft-foreground`,children:[`Through your `,(0,q.jsx)(`code`,{className:`text-xs`,children:`gh`}),`. No webhook or public URL needed.`]}),(0,q.jsxs)(gt,{open:a,onOpenChange:o,children:[(0,q.jsx)(ht,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-1 text-ui text-muted-foreground hover:text-foreground`,children:[(0,q.jsx)(Je,{"aria-hidden":`true`,className:T(`size-3 transition-transform`,a?``:`-rotate-90`)}),`Filters`,u?(0,q.jsx)(`span`,{className:`text-danger`,children:`· changed labels required`}):i.length>0?(0,q.jsxs)(`span`,{className:`text-soft-foreground`,children:[`· `,i.length,` set`]}):(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`· authors, labels, reviewers`})]})}),(0,q.jsxs)(mt,{children:[(0,q.jsx)(`p`,{className:`m-0 pt-2 text-label text-soft-foreground`,children:`Only matching events start a task. Names in the prompt do not narrow it down; these do.`}),(0,q.jsxs)(`div`,{"data-slot":`editor-github-filters`,className:`grid grid-cols-1 gap-3 pt-3 sm:grid-cols-2`,children:[(0,q.jsx)(Y,{id:`filter-authors`,label:`Authors`,value:n.authors,onChange:e=>s(`authors`,e)}),(0,q.jsx)(Y,{id:`filter-assignees`,label:`Assignees`,value:n.assignees,onChange:e=>s(`assignees`,e)}),(0,q.jsx)(Y,{id:`filter-any-labels`,label:`Any of labels`,value:n.anyLabels,onChange:e=>s(`anyLabels`,e)}),(0,q.jsx)(Y,{id:`filter-all-labels`,label:`All of labels`,value:n.allLabels,onChange:e=>s(`allLabels`,e)}),(0,q.jsx)(Y,{id:`filter-exclude-labels`,label:`Exclude labels`,value:n.excludeLabels,onChange:e=>s(`excludeLabels`,e)}),(0,q.jsx)(Y,{id:`filter-changed-labels`,label:l?`Changed labels (required)`:`Changed labels`,value:n.changedLabels,invalid:u,onChange:e=>s(`changedLabels`,e)}),(0,q.jsx)(Y,{id:`filter-reviewers`,label:`Reviewers`,value:n.reviewers,onChange:e=>s(`reviewers`,e)}),(0,q.jsx)(Un,{id:`filter-lookback`,label:`Lookback days (1–90)`,value:n.lookbackDays,min:1,max:90,onChange:e=>s(`lookbackDays`,e)}),(0,q.jsx)(Un,{id:`filter-max-records`,label:`Max records (1–100)`,value:n.maxRecords,min:1,max:100,onChange:e=>s(`maxRecords`,e)})]})]})]})]})}function Y({id:e,label:t,value:n,invalid:r=!1,onChange:i}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsx)(W,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),(0,q.jsx)(P,{id:e,value:n,placeholder:`comma-separated`,"aria-invalid":r||void 0,onChange:e=>i(e.target.value),className:`h-8 text-ui`})]})}function Un({id:e,label:t,value:n,min:r,max:i,onChange:a}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsx)(W,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),(0,q.jsx)(P,{id:e,type:`number`,min:r,max:i,value:n,onChange:e=>a(Tn(Number(e.target.value),r,i)),className:`h-8 w-28 font-mono text-ui tabular-nums`})]})}function Wn({source:e,sourcesReady:t,skills:n,skillUsage:r,workflows:i,onSource:a,pick:o,onPick:s,baseBranch:c,autonomous:l,onAutonomous:u}){return(0,q.jsxs)(`div`,{"data-slot":`editor-run-as`,className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(qt,{source:e,ready:t,skills:n,skillUsage:r,workflows:i,onPick:a}),(0,q.jsx)(Zt,{pick:o,onChange:s,accounts:!0}),(0,q.jsx)(At,{slot:`editor-base-pill`,ariaLabel:`Base branch`,readOnly:!0,hint:`Every run branches off the project's base branch.`,label:(0,q.jsxs)(`span`,{className:`text-meta`,children:[`base: `,c??`…`]}),value:c??``,options:[],onPick:()=>void 0}),(0,q.jsx)(`span`,{className:`flex-1`}),(0,q.jsxs)(W,{className:`text-ui font-medium`,children:[`Autonomous`,(0,q.jsx)(Xt,{"aria-label":`Autonomous`,checked:l,onCheckedChange:u})]})]})}function Gn({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`branch-chip`,className:T(`inline-block rounded-md bg-muted px-1.5 py-0.5 font-mono text-meta leading-[1.3] font-medium whitespace-nowrap text-muted-foreground`,e),...t})}var Kn=[[`daily`,`Every day`],[`weekdays`,`Weekdays`],[`weekly`,`Weekly`],[`hours`,`Every N hours`],[`once`,`Once`]],qn=e=>String(e).padStart(2,`0`);function Jn(e){let t=Date.now()+864e5,n=x(t,e);return n?`${n.year}-${qn(n.month)}-${qn(n.day)}`:new Date(t).toISOString().slice(0,10)}function Yn({schedule:e,timeZone:t,onChange:n,allowOnce:r=!0}){let i=S(e),a=e=>{let{date:r,...a}=i,o={...a,...r?{date:r}:{},...e};o.type===`once`&&!o.date&&(o.date=Jn(t)),n(o)},o=i.type===`once`&&i.date!==null&&ae({type:`once`,date:i.date,hour:i.hour,minute:i.minute},Date.now(),t)===null;return(0,q.jsxs)(`div`,{"data-slot":`editor-schedule`,className:`flex flex-col gap-3.5`,children:[(0,q.jsx)(`div`,{role:`group`,"aria-label":`Schedule type`,className:`flex flex-wrap gap-1.5`,children:Kn.filter(([e])=>r||e!==`once`).map(([e,t])=>(0,q.jsx)(R,{active:i.type===e,"aria-pressed":i.type===e,onClick:()=>a({type:e}),children:t},e))}),i.type===`weekly`?(0,q.jsx)(`div`,{role:`group`,"aria-label":`Weekday`,className:`flex flex-wrap gap-1.5`,children:b.map((e,t)=>(0,q.jsx)(R,{active:i.day===t+1,"aria-pressed":i.day===t+1,className:`px-[9px]`,onClick:()=>a({day:t+1}),children:e},e))}):null,i.type===`once`?(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[`on`,(0,q.jsx)(P,{type:`date`,"aria-label":`Date`,value:i.date??``,onChange:e=>{e.target.value&&a({date:e.target.value})},className:`w-40 font-mono`})]}):null,i.type===`hours`?(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[`every`,(0,q.jsxs)(V,{value:String(i.every),onValueChange:e=>{let t=Number(e);Ln(t)&&a({every:t})},children:[(0,q.jsx)(z,{size:`sm`,"aria-label":`Every N hours`,className:`text-ui`,children:(0,q.jsx)(U,{})}),(0,q.jsx)(H,{children:le.map(e=>(0,q.jsxs)(B,{value:String(e),children:[e,` h`]},e))})]}),`starting at 00:00`]}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[`at`,(0,q.jsx)(P,{"aria-label":`Hour`,inputMode:`numeric`,value:qn(i.hour),onChange:e=>a({hour:Math.min(23,Math.max(0,Number(e.target.value)||0))}),className:`w-14 text-center font-mono`}),`:`,(0,q.jsx)(P,{"aria-label":`Minute`,inputMode:`numeric`,value:qn(i.minute),onChange:e=>a({minute:Math.min(59,Math.max(0,Number(e.target.value)||0))}),className:`w-14 text-center font-mono`}),(0,q.jsx)(`span`,{className:`font-mono text-xs`,children:t})]}),i.type===`once`?(0,q.jsx)(`p`,{"data-slot":`editor-once-note`,className:`m-0 text-xs ${o?`text-danger`:`text-soft-foreground`}`,children:o?`This time has passed — pick a later one to enable it.`:`Runs a single time, then pauses itself.`}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2.5 font-mono text-xs text-soft-foreground`,children:[(0,q.jsx)(`span`,{children:`cron`}),(0,q.jsx)(Gn,{"data-slot":`editor-cron`,children:ie(e)})]})]})}var Xn={schedule:[`{{date}}`,`{{project}}`],github:[`{{github.url}}`,`{{github.title}}`,`{{github.number}}`,`{{github.author}}`,`{{github.labels}}`,`{{date}}`,`{{project}}`],tracker:[`{{tracker.key}}`,`{{tracker.title}}`,`{{tracker.url}}`,`{{tracker.status}}`,`{{date}}`,`{{project}}`]};function Zn(e){return M({kind:e.kind,events:e.events,intervalSeconds:e.intervalSeconds,schedule:e.schedule,...e.trackerTrigger?{trackerTrigger:e.trackerTrigger}:{}})}function Qn(e,t){let n=Zn(e),r=un(e),i=[`${r?`${r.source===`skill`?`skill`:`workflow`} ${r.ref}`:`a quick task`} on ${e.runner??`the default agent`}${e.model?` (${e.model})`:``}`];return i.push(e.autonomous?`autonomous`:`pausing when it needs you`),t&&e.dispatch&&i.push(`up to ${e.maxSubtasks} subtasks`),`${n.charAt(0).toUpperCase()+n.slice(1)}: ${i.join(`, `)}.`}function $n(e,t){return e.kind===`schedule`?!0:e.kind===`tracker`?t:e.events.length>0&&(!In(e.events)||e.filters.changedLabels.trim().length>0)}function er(e,t){let n=[$n(e,t),e.prompt.trim().length>0,e.name.trim().length>0],r=n.indexOf(!1);return[{id:`when`,label:`When`},{id:`what`,label:`What`},{id:`live`,label:`Go live`}].map((e,t)=>({...e,state:n[t]&&(r===-1||t<r)?`done`:t===r||r===-1&&t===2?`current`:`next`}))}function tr({automationId:e,onRunNow:t,onLog:n,busy:r=!1,now:a}){let o=p(),s=w(),c=(0,K.useMemo)(()=>[s,`automation-log`,e],[s,e]),l=v({queryKey:c,queryFn:({signal:t})=>i(e,{signal:t})}),d=(0,K.useMemo)(()=>nr(l.data?.records??[]),[l.data?.records]),f=u((0,K.useMemo)(()=>{let e=new Set(d.map(e=>e.runId));return t=>t.filter(t=>e.has(t.id)).map(({id:e,title:t,status:n,costUsd:r})=>({id:e,title:t,status:n,costUsd:r}))},[d]));return(0,K.useEffect)(()=>ge((t,n)=>{if(t!==`automation-change`)return;let r=n;r?.automationId===e&&(s==="default"||r.project===void 0||r.project===s)&&o.invalidateQueries({queryKey:c})}),[e,s,o,c]),(0,q.jsxs)(j,{flush:!0,"data-slot":`recent-runs-card`,className:`min-w-0 px-3.5 py-3`,children:[(0,q.jsx)(`h2`,{className:`m-0 mb-2 text-meta font-semibold tracking-[.05em] uppercase text-soft-foreground`,children:`Recent runs`}),l.isPending?(0,q.jsx)(`p`,{role:`status`,className:`m-0 text-xs text-muted-foreground`,children:`Loading recent runs…`}):null,l.isError?(0,q.jsxs)(`div`,{role:`alert`,className:`text-xs text-muted-foreground`,children:[(0,q.jsx)(`p`,{className:`m-0`,children:l.data?`Could not refresh recent runs.`:`Could not load recent runs.`}),(0,q.jsx)(O,{variant:`ghost`,size:`sm`,disabled:l.isFetching,onClick:()=>void l.refetch(),children:`Retry`})]}):null,l.data&&d.length===0?(0,q.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No runs launched yet.`}):null,d.length>0?(0,q.jsx)(`ul`,{"aria-label":`Recent runs`,className:`m-0 list-none divide-y divide-border p-0`,children:d.map(e=>{let t=f.data?.find(t=>t.id===e.runId)??l.data?.runs[e.runId],n=t?.title||`Task ${e.runId.slice(0,8)}`;return(0,q.jsxs)(`li`,{className:`min-w-0 py-2 first:pt-0 last:pb-0`,children:[(0,q.jsx)(L,{to:`/tasks/${encodeURIComponent(e.runId)}`,title:n,className:`block truncate rounded-sm text-ui font-medium hover:underline focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,children:n}),(0,q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-meta text-muted-foreground`,children:[(0,q.jsx)(F,{"aria-hidden":`true`,tone:t?A(t.status):`neutral`}),(0,q.jsx)(`span`,{children:t?Ge(t.status):`Status unavailable`}),(0,q.jsx)(`time`,{dateTime:e.ts,title:e.ts,children:Ot(e.ts,a)}),null]})]},e.runId)})}):null,(0,q.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap gap-1.5`,children:[t?(0,q.jsxs)(O,{variant:`outline`,size:`sm`,disabled:r,onClick:t,children:[(0,q.jsx)(lt,{"aria-hidden":`true`,className:`size-3`}),`Run now`]}):null,n?(0,q.jsxs)(O,{variant:`ghost`,size:`sm`,onClick:n,children:[(0,q.jsx)(an,{"aria-hidden":`true`,className:`size-3`}),`View log`]}):null]})]})}function nr(e){let t=new Set;return[...e].sort((e,t)=>t.seq-e.seq).filter(e=>!e.runId||t.has(e.runId)?!1:(t.add(e.runId),!0)).slice(0,5)}var rr=864e5;function ir({kind:e,schedule:t,schedules:n,intervalSeconds:r,timeZone:i,now:a}){let[o,s]=(0,K.useState)(()=>Date.now());(0,K.useEffect)(()=>{if(a!==void 0)return;let e=setInterval(()=>s(Date.now()),6e4);return()=>clearInterval(e)},[a]);let c=a??o,l=(0,K.useMemo)(()=>{if(e!==`schedule`)return[];if(t.type===`once`){let e=re({schedule:t,schedules:n},c,i);return e===null?[]:[e]}return oe({schedule:t,schedules:n},c,c+9*rr,i,5)},[e,t,n,c,i]);return(0,q.jsxs)(j,{flush:!0,"data-slot":`next-runs-preview`,className:`pt-3 pb-2`,children:[(0,q.jsx)(`div`,{className:`px-3.5 pb-2 eyebrow text-soft-foreground`,children:e===`schedule`?t.type===`once`?`Runs once`:`Next 5 runs`:`How it polls`}),e===`schedule`?l.length===0?(0,q.jsx)(`p`,{className:`m-0 px-3.5 pb-1.5 text-label leading-[1.5] text-muted-foreground`,children:t.type===`once`?`This time has already passed.`:`Nothing in the next nine days.`}):l.map(e=>(0,q.jsxs)(`div`,{"data-slot":`next-run`,className:`flex gap-2.5 px-3.5 py-[5px] text-ui`,children:[(0,q.jsx)(`span`,{className:`w-[82px] shrink-0 font-mono text-xs font-medium whitespace-nowrap text-foreground tabular-nums`,children:We(e,i)}),(0,q.jsx)(`span`,{className:`text-meta whitespace-nowrap text-soft-foreground`,children:k(e,c)})]},e)):(0,q.jsx)(`p`,{className:`m-0 px-3.5 pb-1.5 text-label leading-[1.5] text-muted-foreground`,children:e===`tracker`?(0,q.jsxs)(q.Fragment,{children:[`Checks the project tracker every `,Math.round(r/60),` min while this cockpit is open. No webhook or public URL required.`]}):(0,q.jsxs)(q.Fragment,{children:[`Checks GitHub every `,Math.round(r/60),` min while this cockpit is open, through your `,(0,q.jsx)(`code`,{className:`text-xs`,children:`gh`}),`. No webhook or public URL required.`]})})]})}var ar=[{name:`Nightly dependency bump`,when:`Every day at 04:00`,kind:`schedule`,schedule:{type:`daily`,hour:4,minute:0},prompt:`Run npm outdated, bump patch and minor versions, run the test suite, open a draft PR if anything changed.`},{name:`Triage new issues`,when:`On issue.opened · every 5 min`,kind:`github`,events:[`issue.opened`],intervalSeconds:300,prompt:`Read {{github.url}}. Label it, add a repro or a clarification request. Never close it.`},{name:`Weekly changelog draft`,when:`Fridays at 16:00`,kind:`schedule`,schedule:{type:`weekly`,day:5,hour:16,minute:0},prompt:`Collect merged PRs since last week, write CHANGELOG entries, open a draft PR.`},{name:`Stale PR nudge`,when:`Every 6 hours`,kind:`schedule`,schedule:{type:`hours`,every:6},prompt:`Comment on PRs idle for 48h with what is blocking them.`},{name:`Flaky test hunt`,when:`Tuesdays at 02:00`,kind:`schedule`,schedule:{type:`weekly`,day:2,hour:2,minute:0},prompt:`Run the suite 5×, quarantine intermittent tests, open an issue per test.`,dispatch:{maxSubtasks:8,reviewChild:!0}},{name:`Security advisories`,when:`Every day at 06:00`,kind:`schedule`,schedule:{type:`daily`,hour:6,minute:0},prompt:`Run npm audit; for each high/critical advisory open a task with the upgrade path.`}],or=e=>[w(),`automation-templates`,e??``];function sr({onPick:e}){let[t,n]=(0,K.useState)(`builtin`),r=Et(),i=v({queryKey:or(r),queryFn:({signal:e})=>f(r,{signal:e}),enabled:t===`mine`}),a=t===`builtin`?ar.map(e=>({...e,key:e.name})):(i.data?.templates??[]).map(e=>({...bn(e),key:`${e.project.id}:${e.id}`,when:M(e),project:e.project.name}));return(0,q.jsxs)(j,{flush:!0,"data-slot":`template-palette`,className:`pb-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-end gap-3 border-b border-border px-4 pt-2.5`,children:[(0,q.jsxs)(`div`,{role:`tablist`,"aria-label":`Template source`,className:`flex shrink-0`,children:[(0,q.jsx)(cr,{active:t===`builtin`,onClick:()=>n(`builtin`),children:`Built-in`}),(0,q.jsx)(cr,{active:t===`mine`,onClick:()=>n(`mine`),children:`From your other projects`})]}),(0,q.jsx)(`span`,{className:`ml-auto min-w-0 overflow-hidden pb-2 text-xs text-ellipsis whitespace-nowrap text-soft-foreground`,children:t===`builtin`?`Built-in`:`Registered in ~/.cezar/config.json`})]}),t===`mine`&&i.isPending?(0,q.jsx)(`p`,{className:`px-4 pt-3 text-xs text-soft-foreground`,children:`Loading…`}):t===`mine`&&i.isError?(0,q.jsx)(`p`,{role:`alert`,className:`px-4 pt-3 text-xs text-danger`,children:i.error.message}):a.length===0?(0,q.jsx)(`p`,{className:`px-4 pt-3 text-xs text-soft-foreground`,children:`No automations in your other projects yet.`}):(0,q.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5 px-4 pt-3`,children:a.map(t=>(0,q.jsxs)(`div`,{"data-slot":`template-card`,className:`flex flex-col gap-1.5 rounded-[10px] border border-border bg-card-2 px-3 py-2.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-ui font-semibold`,children:[t.kind===`github`?(0,q.jsx)(G,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`}):(0,q.jsx)(Qt,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`}),(0,q.jsx)(`span`,{className:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,children:t.name}),t.project?(0,q.jsx)(Gn,{className:`ml-auto`,children:t.project}):null]}),(0,q.jsx)(`div`,{className:`font-mono text-meta text-muted-foreground`,children:t.when}),(0,q.jsx)(`div`,{className:`line-clamp-2 text-xs leading-[1.45] text-soft-foreground`,children:t.prompt}),(0,q.jsx)(O,{variant:`outline`,size:`sm`,className:`mt-0.5 self-start`,"aria-label":`Use this: ${t.name}`,onClick:()=>e(t),children:`Use this`})]},t.key))})]})}function cr({active:e,onClick:t,children:n}){return(0,q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e,onClick:t,className:T(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-ui font-medium`,e?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:n})}function lr(e){let t=e.toLowerCase();return/\b(events?|filters?|schedule|interval|changedlabels|changed labels|lookback|maxrecords)\b/.test(t)?`when`:/\b(prompt|workflow|runner|model|dispatch)\b/.test(t)?`what`:`top`}var ur={tracker:`Implement {{tracker.key}} and prepare a pull request.`,schedule:`What should the agent do each time? Say it the way you would in New task.`,github:`What should the agent do for each match? Say it the way you would in New task.`};function dr({data:e,automation:t,actions:n,initialKind:i,onBack:o,onSaved:s,onLog:l}){let u=p(),f=I(),m=a(),g=r(),_=y(),v=c(),ee=h(),b=i===`github`&&e?.available===!1?`schedule`:i,[x,re]=(0,K.useState)(()=>t?yn(t):b?{...gn(),kind:b,...b===`tracker`?{intervalSeconds:1800,enabled:!1}:{}}:gn()),[S,ie]=(0,K.useState)(!t&&!b),[C,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(!1),[w,ce]=(0,K.useState)(null),[le,T]=(0,K.useState)(!1),ue=(0,K.useRef)(null),de=t?.revision,fe=(0,K.useRef)(de);(0,K.useEffect)(()=>{!t||de===fe.current||(fe.current=de,re(yn(t)),T(!1),ce(null))},[t,de]);let E=e=>re(t=>({...t,...e})),pe=e?.timeZone??`UTC`,me=e?.available!==!1,he=m.data?.capabilities.dispatch===!0,ge=(0,K.useMemo)(()=>at(ot(g.data?.promptTemplates),m.data?.capabilities),[g.data?.promptTemplates,m.data?.capabilities]),_e=_.data?.workflows??[],ve=_e.map(e=>e.name),ye=v.data,be=(ye??[]).map(e=>e.name),xe=g.data?.skillUsage,Se=(0,K.useMemo)(()=>it(ye??[],xe),[ye,xe]),Ce=v.data!==void 0&&_.data!==void 0&&!g.isPending,we=ee.data?.baseBranch??ee.data?.info?.branch??void 0,Te=(0,K.useMemo)(()=>En(x),[x]),Ee=(0,K.useMemo)(()=>Fn(x),[x]),De=e=>Ee.filter(t=>t.field===e).map(e=>e.login),Oe=x.name.trim().length>0&&x.prompt.trim().length>0&&!oe&&(x.kind!==`tracker`||C),D=er(x,C),ke=Qn(x,he),Ae=e=>{let t=ue.current,n=t?.selectionStart??x.prompt.length,r=st(x.prompt,n,e);E({prompt:r.text}),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(r.caret,r.caret))})},Ne=e=>{let t=ue.current,n=t?.selectionStart??x.prompt.length,r=x.prompt.slice(0,n),i=x.prompt.slice(n),a=r.length>0&&!/\s$/.test(r)?` `:``,o=`${r}${a}${e}${i.length>0&&!/^\s/.test(i)?` `:``}${i}`,s=r.length+a.length+e.length;E({prompt:o}),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(s,s))})},Pe=async()=>{se(!0),ce(null),T(!1);try{let e=wn(x);t?await ne(t.id,{...e,enabled:x.enabled,expectedRevision:t.revision}):await d({...e,enable:x.enabled}),await u.invalidateQueries({queryKey:Pt()}),s()}catch(e){if(t&&e instanceof te&&e.status===409)T(!0);else{let t=e instanceof Error?e.message:String(e);ce({message:t,section:e instanceof te&&e.status===400?lr(t):`top`})}}finally{se(!1)}},Fe=()=>void u.invalidateQueries({queryKey:Pt()}),Ie=t?`Save changes`:x.enabled?`Save and enable`:`Save paused`,k=`Change the kind by creating a new automation`,A=!!t,Le=e=>{e!==x.kind&&E({kind:e,...e===`tracker`?{intervalSeconds:1800,enabled:!1}:{}})};return(0,q.jsxs)(`div`,{"data-route":`automations`,"data-slot":`automation-editor`,"data-onboarding":``,className:`flex min-h-full flex-col`,children:[(0,q.jsxs)(`header`,{className:`sticky top-0 z-10 flex min-h-14 shrink-0 flex-wrap items-center gap-3 border-b border-border bg-background px-5 max-md:py-2 md:h-14 md:flex-nowrap`,children:[(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back`,onClick:o,children:(0,q.jsx)(je,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,q.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:t?`Edit automation`:`New automation`}),t?(0,q.jsx)(kt,{dot:t.enabled?`success`:`neutral`,children:t.enabled?`enabled`:`paused`}):null,(0,q.jsx)(`span`,{className:`flex-1`}),t?null:(0,q.jsxs)(O,{variant:`ghost`,size:`sm`,"aria-expanded":S,"aria-label":S?`Hide templates`:`Start from a template`,onClick:()=>ie(e=>!e),children:[(0,q.jsx)(tn,{"aria-hidden":`true`,className:`size-3.5`}),(0,q.jsx)(`span`,{className:`max-md:hidden`,children:S?`Hide templates`:`Start from a template`})]}),(0,q.jsx)(O,{variant:`outline`,className:`font-normal`,onClick:o,children:`Cancel`}),(0,q.jsx)(O,{className:`font-normal`,disabled:!Oe,onClick:()=>void Pe(),children:Ie})]}),(0,q.jsx)(`div`,{className:`flex justify-center px-5 pb-16`,children:(0,q.jsxs)(`div`,{className:`flex w-full max-w-3xl flex-col items-center`,children:[(0,q.jsxs)(`div`,{"data-slot":`editor-strip`,className:`sticky top-14 z-10 flex w-full flex-wrap items-center gap-x-6 gap-y-1.5 border-b border-border bg-background/95 py-2.5 backdrop-blur max-md:static`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 max-md:basis-full`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-ui text-muted-foreground`,"aria-hidden":`true`,children:`Name`}),(0,q.jsx)(P,{"aria-label":`Name`,placeholder:`Nightly dependency bump`,value:x.name,onChange:e=>E({name:e.target.value}),className:`h-9 w-full max-w-md text-lead md:text-lead`})]}),(0,q.jsx)(Mt,{steps:D})]}),le||w?.section===`top`||S&&!t?(0,q.jsxs)(`div`,{className:`mt-6 flex w-full flex-col gap-4`,children:[le?(0,q.jsxs)(`div`,{role:`alert`,"data-slot":`editor-conflict`,className:`flex flex-wrap items-center gap-3 rounded-lg border border-danger/40 bg-danger/10 px-3.5 py-2.5 text-ui text-foreground`,children:[`Edited elsewhere — reload to see the latest version`,(0,q.jsx)(O,{variant:`outline`,size:`sm`,className:`ml-auto`,onClick:Fe,children:`Reload`})]}):null,w?.section===`top`?(0,q.jsx)(pr,{children:w.message}):null,S&&!t?(0,q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,q.jsx)(`p`,{className:`m-0 text-center text-ui text-muted-foreground`,children:`Start from a template, or fill in the three parts below.`}),(0,q.jsx)(sr,{onPick:e=>{let t=e.workflow&&ve.includes(e.workflow)?e.workflow:void 0,n=e.steps?.every(e=>!e.skill||be.includes(e.skill))?e.steps:void 0;re(r=>Sn(r,{...e,workflow:t,steps:n})),ie(!1)}})]}):null]}):null,(0,q.jsxs)(fr,{slot:`when`,title:`When`,why:A?`The trigger is fixed once saved; change it by creating a new automation.`:`What starts a run. Pick one, then say how often or on which change.`,children:[(0,q.jsxs)(`div`,{"data-slot":`editor-kind`,role:`group`,"aria-label":`Trigger`,className:`grid gap-3 sm:grid-cols-3`,children:[(0,q.jsx)(Rt,{value:`schedule`,title:`On a schedule`,description:`At a time you set.`,selected:x.kind===`schedule`,disabled:A&&x.kind!==`schedule`,reason:A&&x.kind!==`schedule`?k:void 0,onClick:()=>Le(`schedule`),picture:(0,q.jsx)(mr,{})}),(0,q.jsx)(Rt,{value:`github`,title:`When GitHub changes`,description:`A pull request, an issue, a review.`,selected:x.kind===`github`,disabled:!me||A&&x.kind!==`github`,reason:me?A&&x.kind!==`github`?k:void 0:e?.reason??`GitHub is unavailable`,onClick:()=>Le(`github`),picture:(0,q.jsx)(G,{className:`size-7 text-muted-foreground`,"aria-hidden":!0})}),(0,q.jsx)(Rt,{value:`tracker`,title:`When Jira / Linear changes`,description:`An issue is created or moves.`,selected:x.kind===`tracker`,disabled:A&&x.kind!==`tracker`,reason:A&&x.kind!==`tracker`?k:void 0,onClick:()=>Le(`tracker`),picture:(0,q.jsx)(hr,{})})]}),(0,q.jsx)(`div`,{className:`mt-5`,children:x.kind===`schedule`?(0,q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[[x.schedule,...x.schedules?.slice(1)??[]].map((e,t,n)=>(0,q.jsxs)(`fieldset`,{className:`min-w-0 rounded-md border p-3`,children:[(0,q.jsxs)(`legend`,{className:`px-1 text-xs text-muted-foreground`,children:[`Schedule `,t+1]}),(0,q.jsx)(Yn,{schedule:e,timeZone:pe,allowOnce:n.length===1,onChange:e=>{let r=n.map((n,r)=>r===t?e:n),i=r[0];i&&E({schedule:i,schedules:r.length>1?r:void 0})}}),n.length>1?(0,q.jsx)(O,{variant:`ghost`,size:`sm`,"aria-label":`Remove schedule ${t+1}`,onClick:()=>{let e=n.filter((e,n)=>n!==t),r=e[0];r&&E({schedule:r,schedules:e.length>1?e:void 0})},children:`Remove schedule`}):null]},t)),(0,q.jsx)(O,{variant:`outline`,size:`sm`,disabled:(x.schedules?.length??1)>=16||x.schedule.type===`once`,onClick:()=>E({schedules:[x.schedule,...x.schedules?.slice(1)??[],{type:`daily`,hour:4,minute:0}]}),children:`Add schedule`}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Times that coincide start one task. One-time schedules run on their own.`})]}):x.kind===`tracker`?(0,q.jsx)(Rn,{trigger:x.trackerTrigger,intervalSeconds:x.intervalSeconds,onChange:E,onValid:ae}):(0,q.jsx)(Hn,{events:x.events,intervalSeconds:x.intervalSeconds,filters:x.filters,onChange:e=>E(e)})}),x.kind===`schedule`?(0,q.jsx)(`div`,{className:`mt-5`,children:(0,q.jsx)(ir,{kind:x.kind,schedule:x.schedule,schedules:x.schedules,intervalSeconds:x.intervalSeconds,timeZone:pe})}):null,w?.section===`when`?(0,q.jsx)(pr,{children:w.message}):null]}),(0,q.jsxs)(fr,{slot:`what`,title:`What the agent does`,why:`The same words you would type into New task. Placeholders fill in per run.`,children:[(0,q.jsxs)(`div`,{"data-slot":`editor-placeholders`,className:`flex flex-wrap items-center gap-1.5 text-xs text-soft-foreground`,children:[`Insert`,Xn[x.kind].map(e=>(0,q.jsx)(R,{className:`h-6 font-mono text-meta`,title:`Insert ${e} at the caret`,onClick:()=>Ne(e),children:e},e))]}),(0,q.jsx)(pt,{ref:ue,"aria-label":`Prompt`,rows:5,placeholder:ur[x.kind],value:x.prompt,onChange:e=>E({prompt:e.target.value}),className:`mt-3 min-h-[120px] rounded-xl px-4 py-3 text-lead leading-[1.55] md:text-lead`}),(0,q.jsxs)(`div`,{"data-slot":`editor-prompt-templates`,className:`mt-3 flex flex-wrap items-center gap-1.5 text-xs text-soft-foreground`,children:[(0,q.jsx)(Me,{"aria-hidden":`true`,className:`size-3`}),`Prompt templates`,ge.map(e=>(0,q.jsx)(R,{className:`h-6 text-meta`,title:e.text,onClick:()=>Ae(e.text),children:e.label},e.id)),(0,q.jsx)(R,{dashed:!0,className:`h-6 text-meta`,icon:(0,q.jsx)(rt,{"aria-hidden":`true`,className:`size-3`}),onClick:()=>f(`${Kt(`project`,`instructions`)}#prompt-templates`),children:`Manage…`})]}),Ee.length>0?(0,q.jsxs)(`div`,{role:`status`,"data-slot":`editor-prompt-condition`,className:`mt-3 flex flex-wrap items-center gap-2 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-label text-foreground`,children:[(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`The prompt names `,Ee.map(({login:e})=>`@${e}`).join(`, `),`, but prompt text does not decide what launches — without a filter every matching event starts a task.`]}),[`authors`,`reviewers`].map(e=>De(e).length>0?(0,q.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>E({filters:{...x.filters,[e]:[..._n(x.filters[e]),...De(e)].join(`, `)}}),children:e===`authors`?`Add to Authors`:`Add to Reviewers`},e):null)]}):null,(0,q.jsx)(`div`,{className:`mt-5`,children:(0,q.jsx)(Wn,{source:un(x),sourcesReady:Ce,skills:Se,skillUsage:xe,workflows:_e,onSource:e=>E(dn(e)),pick:{runner:x.runner,model:x.model,account:x.account},onPick:e=>E({runner:e.runner,model:e.model,account:e.account}),baseBranch:we,autonomous:x.autonomous,onAutonomous:e=>E({autonomous:e})})}),(0,q.jsx)(`p`,{className:`mt-3 mb-0 text-xs leading-[1.5] text-soft-foreground`,children:`Each run is an ordinary cezar task in its own worktree — it queues behind the parallel cap like anything else and never auto-merges.`}),(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Bn,{available:he,enabled:x.dispatch,maxSubtasks:x.maxSubtasks,reviewChild:x.reviewChild,onChange:e=>E(e)})}),w?.section===`what`?(0,q.jsx)(pr,{children:w.message}):null]}),(0,q.jsxs)(fr,{slot:`live`,title:`Go live`,why:`Paused, it waits in the list where you can preview it. Enabled, it starts counting from now.`,children:[(0,q.jsx)(`p`,{"data-slot":`editor-summary`,className:`m-0 rounded-xl border border-violet/40 bg-violet/10 px-4 py-3 text-body text-foreground`,children:ke}),(0,q.jsxs)(W,{className:`mt-4 flex items-start gap-3 text-ui font-normal`,children:[(0,q.jsx)(Xt,{"aria-label":`Enabled`,checked:x.enabled,onCheckedChange:e=>E({enabled:e}),className:`mt-0.5`}),(0,q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{className:`text-body text-foreground`,children:`Enabled`}),(0,q.jsx)(`span`,{className:`text-label text-muted-foreground`,children:x.kind===`schedule`?x.enabled?`Runs at the next time listed above.`:`Saved paused. Enable it from the list, or Run now to try it once.`:`Counts from a current-time baseline; existing matches will not launch.`})]})]}),(0,q.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[(0,q.jsx)(zn,{definition:Te}),t&&t.kind!==`schedule`&&n?(0,q.jsx)(O,{variant:`outline`,className:`self-start font-normal`,disabled:n.busy,onClick:()=>void n.preview(t),children:`Preview saved matches`}):null,t?(0,q.jsx)(tr,{automationId:t.id,busy:n?.busy,onRunNow:n?()=>void n.runNow(t):void 0,onLog:l}):null]})]})]})})]})}function fr({slot:e,title:t,why:n,children:r}){return(0,q.jsxs)(`section`,{"data-slot":`editor-section`,"data-section":e,className:`mt-7 w-full border-t border-border pt-6 first-of-type:mt-6 first-of-type:border-t-0 first-of-type:pt-0`,children:[(0,q.jsx)(`h2`,{className:`text-xl font-light tracking-tight text-foreground`,children:t}),(0,q.jsx)(`p`,{className:`mt-1 mb-5 text-ui text-muted-foreground`,children:n}),r]})}function pr({children:e}){return(0,q.jsx)(`div`,{role:`alert`,className:T(`mt-3 rounded-lg border border-danger/40 bg-danger/10 px-3.5 py-2.5 text-ui text-foreground`),children:e})}function mr(){return(0,q.jsxs)(`span`,{className:`flex w-12 flex-col gap-1`,children:[(0,q.jsxs)(`span`,{className:`flex items-center justify-between rounded-md border border-violet bg-violet/15 px-1 py-0.5 font-mono text-[7px] text-foreground`,children:[`09:00`,(0,q.jsx)(`span`,{className:`size-1 rounded-full bg-violet`})]}),(0,q.jsxs)(`span`,{className:`flex items-center justify-between rounded-md border border-border px-1 py-0.5 font-mono text-[7px] text-muted-foreground`,children:[`16:00`,(0,q.jsx)(`span`,{className:`size-1 rounded-full bg-muted-foreground/50`})]})]})}function hr(){return(0,q.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-[7px]`,children:[(0,q.jsx)(`span`,{className:`rounded border border-border px-1 py-0.5 text-muted-foreground`,children:`To do`}),(0,q.jsx)(`span`,{className:`h-px w-1.5 bg-violet`}),(0,q.jsx)(`span`,{className:`rounded border border-violet bg-violet/15 px-1 py-0.5 text-foreground`,children:`Ready`})]})}function gr({automationId:e,automation:t,timeZone:n,onBack:r}){let a=I(),o=p(),s=w(),c=(0,K.useMemo)(()=>[s,`automation-log`,e],[s,e]),u=v({queryKey:c,queryFn:({signal:t})=>i(e,{signal:t})}),[d,f]=(0,K.useState)(`all`),[h,g]=(0,K.useState)(`all`);(0,K.useEffect)(()=>ge((t,n)=>{t===`automation-change`&&n.automationId===e&&o.invalidateQueries({queryKey:c})}),[e,o,c]);let _=l({mutationFn:e=>m(e),onSuccess:()=>o.invalidateQueries({queryKey:c}),onError:e=>fe(e instanceof Error?e.message:String(e),{tone:`danger`})}),ee=n??`UTC`,y=u.data?.records.filter(e=>(d===`all`||e.result===d)&&(h===`all`||e.event===h));return(0,q.jsxs)(`div`,{"data-route":`automations`,"data-slot":`automation-log`,className:`flex min-h-full flex-col`,children:[(0,q.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5`,children:[(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back`,onClick:r,children:(0,q.jsx)(je,{className:`size-[15px]`})}),(0,q.jsx)(`h1`,{className:`m-0 text-base font-semibold`,children:t?t.name:`Automation`}),(0,q.jsx)(`span`,{className:`text-ui text-muted-foreground`,children:`· execution log`}),(0,q.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-2`,children:[(0,q.jsxs)(V,{value:d,onValueChange:e=>f(e),children:[(0,q.jsx)(z,{size:`sm`,"aria-label":`Filter by result`,className:`text-label`,children:(0,q.jsx)(U,{placeholder:`All results`})}),(0,q.jsxs)(H,{children:[(0,q.jsx)(B,{value:`all`,children:`All results`}),_r.map(e=>(0,q.jsx)(B,{value:e,children:e},e))]})]}),(0,q.jsxs)(V,{value:h,onValueChange:e=>g(e),children:[(0,q.jsx)(z,{size:`sm`,"aria-label":`Filter by event`,className:`text-label`,children:(0,q.jsx)(U,{placeholder:`All events`})}),(0,q.jsxs)(H,{children:[(0,q.jsx)(B,{value:`all`,children:`All events`}),vr.map(e=>(0,q.jsx)(B,{value:e,children:e},e))]})]})]}),(0,q.jsxs)(O,{variant:`outline`,size:`sm`,onClick:()=>a(`/automations/${encodeURIComponent(e)}`),children:[(0,q.jsx)(ct,{className:`size-[13px]`}),`Edit`]})]}),(0,q.jsx)(`div`,{className:`flex justify-center p-5`,children:u.isError?(0,q.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,q.jsx)($,{text:u.error instanceof Error?u.error.message:String(u.error)})}):y===void 0?(0,q.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,q.jsx)($,{text:`Loading execution log…`})}):y.length===0?(0,q.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,q.jsx)($,{text:`No checks have run yet.`})}):(0,q.jsx)(j,{flush:!0,className:`w-full max-w-[820px]`,children:y.map((e,t)=>(0,q.jsx)(br,{record:e,run:e.runId===void 0?void 0:u.data?.runs[e.runId],last:t===y.length-1,timeZone:ee,retrying:_.isPending&&_.variables===e.receiptId,onRetry:e=>_.mutate(e)},e.seq))})})]})}var _r=[`launched`,`no-match`,`duplicate`,`rate-limited`,`error`,`baseline`,`preview`,`manual`,`catch-up`,`skipped`,`failed`],vr=[`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`];function yr(e){return e.result===`failed`&&e.runId===void 0?e.receiptId:void 0}function br({record:e,run:t,last:n,timeZone:r,retrying:i,onRetry:a}){let o=He(e.result),s=t?.children??[],c=yr(e);return(0,q.jsxs)(`div`,{"data-slot":`log-row`,"data-result":e.result,className:`grid grid-cols-[90px_110px_1fr_auto] items-center gap-x-3 gap-y-2 px-4 py-3 text-ui ${n?``:`border-b border-border`}`,children:[(0,q.jsx)(`span`,{className:`font-mono text-xs font-medium text-muted-foreground tabular-nums`,children:Re(e.ts,r)}),(0,q.jsx)(kt,{dot:o,className:`w-fit`,children:e.result}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap ${o===`danger`?`text-danger`:`text-muted-foreground`}`,title:e.reason,children:e.reason??``}),null,e.runId===void 0?c===void 0?(0,q.jsx)(`span`,{}):(0,q.jsxs)(O,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>a(c),children:[(0,q.jsx)(Jt,{className:`size-3`}),`Retry task`]}):(0,q.jsx)(O,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,q.jsxs)(L,{to:`/tasks/${encodeURIComponent(e.runId)}`,children:[`Open task`,(0,q.jsx)(Pe,{className:`size-3`})]})}),s.length>0?(0,q.jsx)(`div`,{className:`col-span-full flex flex-col gap-1 pl-3.5`,children:s.map(e=>(0,q.jsxs)(`div`,{"data-slot":`log-child`,className:`grid grid-cols-[14px_70px_1fr_auto] items-center gap-2.5 text-label`,children:[(0,q.jsx)(`span`,{className:`font-mono text-meta text-soft-foreground`,children:`└`}),(0,q.jsx)(`span`,{className:`w-fit rounded-full bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:e.kind??`implement`}),(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(F,{tone:A(e.status)}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.title})]}),null,(0,q.jsx)(O,{variant:`ghost`,size:`sm`,className:`h-6`,asChild:!0,children:(0,q.jsxs)(L,{to:`/tasks/${encodeURIComponent(e.runId)}`,children:[`Open`,(0,q.jsx)(Pe,{className:`size-[11px]`})]})})]},e.runId))}):null]})}function xr({data:e}){let t=I(),[n,r]=K.useState(!1),i=e.available===!1,a=e=>t(`/automations/new?kind=${e}`);return(0,q.jsxs)(Vt,{wide:!0,slot:`automations`,title:`Let the routine run itself`,why:`An automation is a prompt cezar turns into a task on its own: at a time you set, when something happens on GitHub, or when an issue moves in Jira or Linear.`,children:[(0,q.jsxs)(`div`,{"data-slot":`automation-triggers`,className:`mt-8 grid w-full gap-3 sm:grid-cols-3`,children:[(0,q.jsx)(zt,{title:`On a schedule`,description:`Every weekday at 9:00, Fridays at 16:00, every six hours.`,recommended:!0,onClick:()=>a(`schedule`),picture:(0,q.jsx)(Dr,{})}),(0,q.jsx)(zt,{title:`When GitHub changes`,description:i?`Sign in to the GitHub CLI first.`:`A new pull request, an issue labelled, a review requested.`,onClick:()=>i?t(`/github`):a(`github`),picture:i?(0,q.jsx)(G,{className:`size-9 text-muted-foreground`,"aria-hidden":!0}):(0,q.jsx)(Or,{})}),(0,q.jsx)(zt,{title:`When an issue moves`,description:`A Jira or Linear issue is created or changes status.`,onClick:()=>a(`tracker`),picture:(0,q.jsx)(kr,{})})]}),(0,q.jsx)(`ol`,{"data-slot":`automation-steps`,className:`mt-10 grid w-full gap-6 text-left sm:grid-cols-3`,children:Sr.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex gap-3`,children:[(0,q.jsx)(`span`,{className:`mt-0.5 grid size-6 shrink-0 place-items-center rounded-full border border-violet font-mono text-meta text-foreground`,"aria-hidden":`true`,children:t+1}),(0,q.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-lead text-foreground`,children:e.title}),(0,q.jsx)(`span`,{className:`text-label text-muted-foreground`,children:e.body})]})]},e.title))}),(0,q.jsxs)(`div`,{className:`mt-10 flex flex-col items-center gap-4`,children:[(0,q.jsx)(O,{asChild:!0,className:`font-normal`,children:(0,q.jsxs)(L,{to:`/automations/new`,children:[(0,q.jsx)(ut,{className:`size-[15px]`,"aria-hidden":`true`}),`New automation`]})}),(0,q.jsxs)(`button`,{type:`button`,className:en,onClick:()=>r(!0),children:[(0,q.jsx)(Ue,{className:`size-3.5`,"aria-hidden":`true`}),`See it in pictures`]})]}),n?(0,q.jsx)(wr,{onOpenChange:r}):null]})}var Sr=[{title:`Write it as a prompt`,body:`Say what the agent should do each time. Placeholders such as {{github.url}} or {{date}} fill in per run.`},{title:`Preview, then enable`,body:`A new automation starts paused. A poll shows what it would have matched, a schedule shows its next runs. Enable it when that looks right.`},{title:`Every run is a task`,body:`Each match starts an ordinary task in its own worktree. It ends at the review gate, never merges on its own, and the log keeps every run.`}];function Cr(){let[e,t]=K.useState(!1);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(O,{variant:`ghost`,size:`sm`,"data-slot":`automations-guide`,"aria-label":`How automations work`,className:`text-muted-foreground`,onClick:()=>t(!0),children:[(0,q.jsx)(Ue,{"aria-hidden":`true`,className:`size-3.5`}),(0,q.jsx)(`span`,{className:`max-md:hidden`,children:`How it works`})]}),e?(0,q.jsx)(wr,{onOpenChange:t}):null]})}function wr({onOpenChange:e}){let t=I();return(0,q.jsx)(Bt,{slot:`automations-guide-page`,title:`How automations work`,description:`Four things to know.`,pages:[{id:`prompt`,title:`A prompt that runs itself`,body:`An automation is the same thing you type into New task, kept and run for you. Placeholders fill in what changed: the pull request, the issue, the date.`,picture:(0,q.jsx)(Ar,{})},{id:`triggers`,title:`Three ways to start`,body:`On a schedule, when GitHub changes, or when an issue moves in Jira or Linear. A GitHub or tracker automation polls every few minutes and starts one task per match.`,picture:(0,q.jsx)(jr,{})},{id:`paused`,title:`Paused first, then live`,body:`A new automation is paused. Preview shows what it would have matched, or when it runs next. Enable it when that looks right, and pause it again any time.`,picture:(0,q.jsx)(Mr,{})},{id:`tasks`,title:`Every run is a task`,body:`Each run shows up in the task list like one you started yourself, in its own worktree, ending at the review gate. The automation’s log keeps every run.`,picture:(0,q.jsx)(Nr,{}),action:{label:`New automation`,onClick:()=>t(`/automations/new`)}}],onOpenChange:e})}var Tr=`flex items-center gap-2 rounded-md px-2 py-1 text-micro`;function Er({on:e=!0}){return(0,q.jsx)(`span`,{className:T(`flex h-3.5 w-6 items-center rounded-full px-0.5`,e?`justify-end bg-violet`:`justify-start bg-muted-foreground/40`),children:(0,q.jsx)(`span`,{className:`size-2.5 rounded-full bg-background`})})}function Dr(){return(0,q.jsx)(`span`,{className:`flex w-20 flex-col gap-1`,children:[`Mon 09:00`,`Fri 16:00`].map((e,t)=>(0,q.jsxs)(`span`,{className:T(`flex items-center justify-between rounded-md border px-1.5 py-1 font-mono text-[9px]`,t===0?`border-violet bg-violet/15 text-foreground`:`border-border text-muted-foreground`),children:[e,(0,q.jsx)(`span`,{className:T(`size-1.5 rounded-full`,t===0?`bg-violet`:`bg-muted-foreground/50`)})]},e))})}function Or(){return(0,q.jsxs)(`span`,{className:`flex w-20 flex-col gap-1.5`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-md border border-violet bg-violet/15 px-1.5 py-1`,children:[(0,q.jsx)(`span`,{className:`size-1.5 rounded-full bg-violet`}),(0,q.jsx)(`span`,{className:`h-1 flex-1 rounded bg-violet/60`}),(0,q.jsx)(`span`,{className:`rounded-sm bg-violet/40 px-1 text-[7px] text-foreground`,children:`PR`})]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-md border border-border px-1.5 py-1`,children:[(0,q.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`}),(0,q.jsx)(`span`,{className:`h-1 w-2/3 rounded bg-muted`})]})]})}function kr(){return(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[9px]`,children:[(0,q.jsx)(`span`,{className:`rounded-md border border-border px-1.5 py-1 text-muted-foreground`,children:`To do`}),(0,q.jsx)(`span`,{className:`h-px w-3 bg-violet`}),(0,q.jsx)(`span`,{className:`rounded-md border border-violet bg-violet/15 px-1.5 py-1 text-foreground`,children:`Ready`})]})}function Ar(){return(0,q.jsxs)(Ft,{bar:(0,q.jsx)(`span`,{className:`ml-3 text-micro text-soft-foreground`,children:`What to run`}),children:[(0,q.jsxs)(`p`,{className:`text-meta leading-relaxed text-foreground`,children:[`Review `,(0,q.jsx)(`span`,{className:`rounded-sm bg-violet/15 px-1 text-violet`,children:`{{github.url}}`}),` for real issues only and leave one comment per finding.`]}),(0,q.jsx)(`div`,{className:T(Ht,`mt-3 w-1/2`)})]})}function jr(){return(0,q.jsx)(Ft,{children:[`Every weekday at 9:00`,`When a pull request opens`,`When PROJ-42 reaches Ready`].map((e,t)=>(0,q.jsxs)(`div`,{style:{"--i":t},className:T(Tr,`tip-rise justify-between text-foreground`),children:[(0,q.jsx)(`span`,{children:e}),(0,q.jsx)(Er,{})]},e))})}function Mr(){return(0,q.jsxs)(Ft,{children:[(0,q.jsxs)(`div`,{className:T(Tr,`justify-between text-foreground`),children:[(0,q.jsx)(`span`,{children:`Triage new issues`}),(0,q.jsxs)(`span`,{className:`flex items-center gap-2 text-[9.5px] text-soft-foreground`,children:[`paused`,(0,q.jsx)(Er,{on:!1})]})]}),(0,q.jsx)(`div`,{style:{"--i":2},className:`tip-rise mt-2 rounded-md border border-violet/50 bg-violet/10 px-2 py-1.5 text-micro text-foreground`,children:`Preview: would have matched 3 issues this week`}),(0,q.jsxs)(`div`,{style:{"--i":5},className:T(Tr,`tip-rise mt-2 justify-between text-foreground`),children:[(0,q.jsx)(`span`,{children:`Triage new issues`}),(0,q.jsxs)(`span`,{className:`flex items-center gap-2 text-[9.5px] text-violet`,children:[`enabled`,(0,q.jsx)(Er,{})]})]})]})}function Nr(){return(0,q.jsx)(Ft,{bar:(0,q.jsx)(`span`,{className:`ml-3 text-micro text-soft-foreground`,children:`Tasks`}),children:[[`needs review`,`Triage issue 412: missing repro`,`text-violet`],[`running`,`Nightly dependency bump`,`text-success`],[`done`,`Weekly changelog draft`,`text-muted-foreground`]].map(([e,t,n],r)=>(0,q.jsxs)(`div`,{style:{"--i":r},className:T(Tr,`tip-rise text-foreground`),children:[(0,q.jsx)(`span`,{className:T(`w-16 shrink-0 text-[9.5px]`,n),children:e}),(0,q.jsx)(`span`,{className:`truncate`,children:t})]},t))})}function Pr({automation:e,actions:t}){let n=I(),[r,i]=(0,K.useState)(!1),a=e=>e.stopPropagation(),o=`/automations/${encodeURIComponent(e.id)}`;return(0,q.jsxs)(`span`,{"data-slot":`row-actions`,className:`inline-flex gap-0.5`,onClick:a,children:[e.kind===`schedule`?null:(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,title:`Preview matches`,"aria-label":`Preview matches`,disabled:t.busy,onClick:()=>void t.preview(e),children:(0,q.jsx)(tt,{className:`size-[13px]`})}),(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,title:`Run now`,"aria-label":`Run now`,disabled:t.busy,onClick:()=>void t.runNow(e),children:(0,q.jsx)(lt,{className:`size-[13px]`})}),(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,title:e.enabled?`Pause`:`Enable`,"aria-label":e.enabled?`Pause`:`Enable`,disabled:t.busy,onClick:()=>void t.toggleEnabled(e),children:e.enabled?(0,q.jsx)(nn,{className:`size-[13px]`}):(0,q.jsx)(rn,{className:`size-[13px]`})}),(0,q.jsxs)(Ze,{children:[(0,q.jsx)($e,{asChild:!0,children:(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`More`,children:(0,q.jsx)(et,{className:`size-3.5`})})}),(0,q.jsxs)(Qe,{align:`end`,className:`w-[200px]`,onClick:a,children:[(0,q.jsxs)(N,{onSelect:()=>n(o),children:[(0,q.jsx)(ct,{}),`Edit`]}),(0,q.jsxs)(N,{onSelect:()=>n(`${o}/log`),children:[(0,q.jsx)(an,{}),`View log`]}),(0,q.jsxs)(N,{onSelect:()=>void t.duplicate(e),children:[(0,q.jsx)(ke,{}),`Duplicate`]}),(0,q.jsxs)(N,{onSelect:()=>void t.copyCli(e),children:[(0,q.jsx)(dt,{}),`Copy as CLI`]}),(0,q.jsx)(Xe,{}),(0,q.jsxs)(N,{variant:`destructive`,onSelect:()=>i(!0),children:[(0,q.jsx)(ft,{}),`Delete`]})]})]}),(0,q.jsx)(wt,{open:r,onOpenChange:i,children:(0,q.jsxs)(yt,{onClick:a,children:[(0,q.jsxs)(Ct,{children:[(0,q.jsxs)(vt,{children:[`Delete “`,e.name,`”?`]}),(0,q.jsx)(_t,{children:`The automation is removed for good. Tasks it already launched and its execution log stay.`})]}),(0,q.jsxs)(xt,{children:[(0,q.jsx)(St,{children:`Cancel`}),(0,q.jsx)(bt,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>void t.remove(e),children:`Delete`})]})]})})]})}function Fr(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e:{},n=t.sort===`manual`||t.sort===`nextRun`?t.sort:`name`,r=new Set;if(Array.isArray(t.order))for(let e of t.order){if(typeof e!=`string`)continue;let t=e.trim();if(t&&t.length<=200&&r.add(t),r.size>=200)break}return{sort:n,order:[...r]}}function Ir(e,t,n){if(!e.enabled||e.kind!==`schedule`)return null;if(e.nextRunAt!==void 0){let t=Date.parse(e.nextRunAt);return Number.isFinite(t)?t:null}let r=`schedules`in e?e.schedules:void 0,i=null;for(let a of Array.isArray(r)?r:[e.schedule]){let e=ce.safeParse(a);if(!e.success)continue;let r=ae(e.data,n,t);r!==null&&Number.isFinite(r)&&(i===null||r<i)&&(i=r)}return i}var Lr=(e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id);function Rr(e,t,n,r){if(t.sort===`manual`){let n=new Map(t.order.map((e,t)=>[e,t])),r=e.filter(e=>!n.has(e.id)).sort(Lr),i=e.filter(e=>n.has(e.id)).sort((e,t)=>(n.get(e.id)??0)-(n.get(t.id)??0));return[...r,...i]}if(t.sort===`name`)return[...e].sort(Lr);let i=e=>{let t=Ir(e,n,r);return t===null?[e.enabled&&e.kind!==`schedule`?1:2,0]:[0,t]},a=new Map(e.map(e=>[e.id,i(e)]));return[...e].sort((e,t)=>{let n=a.get(e.id),r=a.get(t.id);return n===void 0||r===void 0?Lr(e,t):n[0]-r[0]||n[1]-r[1]||Lr(e,t)})}function zr(e,t,n){if(t<0||n<0||t>=e.length||n>=e.length||t===n)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}var X=`h-[38px] border-b border-border px-[10px] text-left eyebrow whitespace-nowrap text-soft-foreground`,Z=`h-12 border-b border-border px-[10px] text-ui leading-none whitespace-nowrap`,Br=`cz-auto-wide max-[1280px]:hidden`,Vr=(0,q.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`—`});function Hr({data:e,actions:t,now:n=Date.now(),automations:r=e.automations,reorder:i}){let a=he(me(ve,{activationConstraint:{distance:4}}),me(pe,{coordinateGetter:_e})),o=e=>{let t=r.findIndex(t=>t.id===e),n=r[t];return n?`${n.name}, position ${t+1} of ${r.length}`:`automation`};return(0,q.jsx)(xe,{sensors:a,collisionDetection:Ce,accessibility:{announcements:{onDragStart:({active:e})=>`Picked up ${o(e.id)}.`,onDragOver:({active:e,over:t})=>t?`${o(e.id)} moved to ${o(t.id)}.`:`No drop position.`,onDragEnd:({active:e,over:t})=>t?`${o(e.id)} dropped at ${o(t.id)}.`:`Order unchanged.`,onDragCancel:()=>`Reordering cancelled. The order is unchanged.`}},onDragEnd:({active:e,over:t})=>{if(!i?.enabled||t===null)return;let n=r.findIndex(t=>t.id===e.id),a=r.findIndex(e=>e.id===t.id);n>=0&&a>=0&&n!==a&&i.onMove(n,a)},children:(0,q.jsx)(j,{flush:!0,"data-slot":`automations-table`,className:`min-w-0 overflow-x-auto`,children:(0,q.jsxs)(`table`,{className:`w-full border-collapse [&_tbody_tr:last-child>td]:border-b-0`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[i?(0,q.jsx)(`th`,{className:X,children:`Order`}):null,(0,q.jsx)(`th`,{className:T(X,`pl-4`),children:`State`}),(0,q.jsx)(`th`,{className:X,children:`Automation`}),(0,q.jsx)(`th`,{className:X,children:`Trigger`}),(0,q.jsx)(`th`,{className:T(X,Br),children:`Runs as`}),(0,q.jsx)(`th`,{className:X,children:`Next run`}),(0,q.jsx)(`th`,{className:X,children:`Last run`}),(0,q.jsx)(`th`,{className:T(X,Br,`text-right`),children:`Runs 7d`}),null,(0,q.jsx)(`th`,{className:T(X,`pr-4`)})]})}),(0,q.jsx)(`tbody`,{children:(0,q.jsx)(Se,{items:r.map(e=>e.id),strategy:ye,children:r.map((a,o)=>(0,q.jsx)(Ur,{automation:a,actions:t,timeZone:e.timeZone,available:e.available,showCost:!1,now:n,position:o,total:r.length,...i?{reorder:i}:{}},a.id))})})]})})})}function Ur({automation:e,actions:t,timeZone:n,available:r,showCost:i,now:a,position:o,total:s,reorder:c}){let l=I(),u=E({id:e.id,disabled:!c?.enabled}),d=e.kind===`github`,f=d&&!r,p=e.task.dispatch,m=M(e),h=[e.task.workflow,e.task.runner].filter(Boolean),g=e=>e.stopPropagation();return(0,q.jsxs)(`tr`,{ref:u.setNodeRef,style:{transform:be.Transform.toString(u.transform),transition:u.transition},"data-slot":`automation-row`,"data-automation":e.id,"data-enabled":e.enabled?`true`:`false`,className:T(`cursor-pointer hover:bg-muted`,!e.enabled&&`opacity-60`),onClick:()=>l(`/automations/${encodeURIComponent(e.id)}`),children:[c?(0,q.jsx)(`td`,{className:T(Z,`w-px`),onClick:g,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,className:`touch-none cursor-grab`,ref:u.setActivatorNodeRef,...u.attributes,...u.listeners,"aria-label":`Reorder ${e.name}`,disabled:!c.enabled,children:(0,q.jsx)(Ne,{className:`size-3.5`})}),(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move ${e.name} up`,disabled:!c.enabled||o===0,onClick:()=>c.onMove(o,o-1),children:(0,q.jsx)(Fe,{className:`size-3.5`})}),(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move ${e.name} down`,disabled:!c.enabled||o===s-1,onClick:()=>c.onMove(o,o+1),children:(0,q.jsx)(Ae,{className:`size-3.5`})})]})}):null,(0,q.jsx)(`td`,{className:T(Z,`pl-4`),children:f?(0,q.jsx)(kt,{dot:`neutral`,children:`paused by capability`}):(0,q.jsx)(kt,{dot:e.enabled?`success`:`neutral`,pulse:e.enabled&&d,children:e.enabled?`enabled`:`paused`})}),(0,q.jsx)(`td`,{className:T(Z,`max-w-0 min-w-[200px]`),children:(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[d?(0,q.jsx)(G,{className:`size-3.5 shrink-0 text-soft-foreground`}):e.kind===`tracker`?(0,q.jsx)(Ie,{className:`size-3.5 shrink-0 text-soft-foreground`}):(0,q.jsx)(Qt,{className:`size-3.5 shrink-0 text-soft-foreground`}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ui font-medium text-ellipsis whitespace-nowrap`,children:e.name}),p?(0,q.jsxs)(`span`,{"data-slot":`dispatch-badge`,title:`dispatch · up to ${p.maxSubtasks??1} subtasks`,className:`inline-flex shrink-0 items-center gap-[3px] rounded-full bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:[(0,q.jsx)(nt,{className:`size-2.5`}),`×`,p.maxSubtasks??1]}):null,e.kind===`tracker`&&e.trackerTrigger&&!e.trackerTrigger.access?(0,q.jsx)(`span`,{"data-slot":`needs-review-badge`,title:`Tracker access changed: open this automation and review its access before it can run again`,className:`inline-flex shrink-0 items-center rounded-full bg-warning/15 px-1.5 py-px text-micro font-medium text-warning`,children:`Needs review`}):null]})}),(0,q.jsx)(`td`,{className:T(Z,`max-w-[260px] overflow-hidden font-mono text-xs text-ellipsis text-muted-foreground`),title:m,children:m}),(0,q.jsx)(`td`,{className:T(Z,Br,`text-xs text-muted-foreground`),children:h.length?(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[h.map((e,t)=>(0,q.jsxs)(`span`,{className:`contents`,children:[t>0?(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}):null,e]},e)),e.task.autonomous?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,q.jsx)(`span`,{title:`autonomous`,"data-slot":`autonomous-mark`,className:`inline-flex`,children:(0,q.jsx)(Ie,{"aria-hidden":`true`,className:`size-[11px] text-soft-foreground`})})]}):null]}):Vr}),(0,q.jsx)(`td`,{"data-slot":`next-run`,className:T(Z,`font-mono text-xs tabular-nums`,e.enabled?`text-foreground`:`text-soft-foreground`),children:Wr(e,n,a)}),(0,q.jsx)(`td`,{className:Z,children:e.lastRun?(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,q.jsx)(F,{tone:A(e.lastRun.status)}),(0,q.jsx)(`span`,{className:`text-label text-muted-foreground`,children:Ge(e.lastRun.status)}),(0,q.jsx)(`span`,{className:`text-meta text-soft-foreground`,children:Ot(e.lastRun.ts,a)}),(0,q.jsxs)(L,{to:`/tasks/${encodeURIComponent(e.lastRun.runId)}`,"data-slot":`task-link`,onClick:g,className:`inline-flex items-center gap-0.5 rounded-full border border-violet/40 px-1.5 py-px font-mono text-micro font-semibold text-violet`,children:[`task`,(0,q.jsx)(Pe,{className:`size-[9px]`})]})]}):Vr}),(0,q.jsx)(`td`,{className:T(Z,Br,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:e.runs7d}),i?(0,q.jsx)(`td`,{className:T(Z,Br,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:e.costUsd7d===void 0?Vr:Le(e.costUsd7d)}):null,(0,q.jsx)(`td`,{className:T(Z,`pr-3 text-right`),children:(0,q.jsx)(Pr,{automation:e,actions:t})})]})}function Wr(e,t,n){if(!e.enabled)return`—`;if(e.kind!==`schedule`)return`continuous`;let r=Ir(e,t,n);return r===null?`—`:We(r,t)||`—`}var Gr=new WeakMap;function Kr(){let e=p(),t=r(),n=w(),i=(0,K.useMemo)(()=>ee.uiState,[n]),a=Fr(t.data?.automationList),o=t=>{let r=e.getQueryData(i);if(r===void 0)return;let a=r.automationList,o={...typeof a==`object`&&a&&!Array.isArray(a)?a:{},...Fr(a),...t};e.setQueryData(i,{...r,automationList:o});let c=Gr.get(e);c===void 0&&(c=new Map,Gr.set(e,c));let l=c.get(n);l===void 0&&(l={sequence:0,chain:Promise.resolve()},c.set(n,l));let u=++l.sequence,d=l,f=l.chain.then(async()=>{let t=await s({automationList:o},n);u===d.sequence&&e.setQueryData(i,t)});l.chain=f.catch(t=>{fe(t instanceof Error?t.message:String(t),{tone:`danger`}),u===d.sequence&&e.invalidateQueries({queryKey:i})})};return{preferences:a,canSave:t.data!==void 0,loadError:t.isError&&t.data===void 0,retry:()=>{t.refetch()},setSort:e=>o({sort:e}),setOrder:e=>o({order:Fr({order:e}).order})}}function Q(e){return e.hour*60+e.minute}function qr(e,t,n=0){let r=x(e,t);if(!r)return null;let i=new Date(Date.UTC(r.year,r.month-1,r.day+n));return se(i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate(),0,0,t)}function Jr(e,t,n,r){let i=[];for(let a of e)if(!(a.kind!==`schedule`||!a.schedule))for(let e of oe(a,t,n,r)){let t=x(e,r);t&&i.push({automation:a,at:e,parts:t})}return i.sort((e,t)=>e.at-t.at)}function Yr(e){let t=new Map;return e.map(e=>{let n=Q(e.parts),r=t.get(n)??0;return t.set(n,r+1),{occurrence:e,stack:r}})}function Xr({automation:e,minute:t,stack:n=0,wide:r=!1}){let i=I(),a=C(Math.floor(t/60),t%60),o=[e.task.workflow,e.task.runner].filter(Boolean).join(` · `);return(0,q.jsxs)(`button`,{type:`button`,"data-slot":`event-block`,"data-automation":e.id,"data-enabled":e.enabled?`true`:`false`,title:`${e.name} · ${a}`,onClick:()=>i(`/automations/${encodeURIComponent(e.id)}`),className:T(`absolute right-[3px] left-[3px] flex cursor-pointer overflow-hidden rounded-[6px] border border-border bg-card text-left text-meta leading-[1.3] font-medium text-foreground shadow-xs`,r?`h-12 flex-col items-start gap-[3px] px-2 py-[5px]`:`h-6 flex-row items-center gap-1.5 px-1.5`,!e.enabled&&`opacity-50`),style:{top:t/60*34+1+26*n},children:[(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,q.jsx)(F,{tone:e.task.runner===`codex`?`violet`:`success`}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name})]}),r?(0,q.jsxs)(`span`,{className:`max-w-full overflow-hidden font-mono text-micro leading-[1.3] font-normal text-ellipsis whitespace-nowrap text-muted-foreground`,children:[a,o?` · ${o}`:``]}):null]})}function Zr(){return(0,q.jsx)(`div`,{"data-slot":`hour-gutter`,className:`w-12 shrink-0`,children:Array.from({length:24},(e,t)=>(0,q.jsx)(`div`,{className:`-translate-y-[6px] pr-2 text-right font-mono text-micro text-soft-foreground`,style:{height:34},children:t?C(t):``},t))})}function Qr({minute:e}){return(0,q.jsx)(`div`,{"aria-hidden":`true`,"data-slot":`now-line`,className:`absolute inset-x-0 z-[2] h-[2px] bg-primary`,style:{top:e/60*34},children:(0,q.jsx)(`span`,{className:`absolute -top-[3px] -left-[3px] size-[8px] rounded-full bg-primary`})})}function $r(){return(0,q.jsx)(q.Fragment,{children:Array.from({length:24},(e,t)=>(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-x-0 h-px bg-border`,style:{top:t*34}},t))})}function ei({automations:e}){let t=e.filter(e=>e.kind===`github`&&e.enabled);return t.length?(0,q.jsxs)(`div`,{"data-slot":`poll-band`,className:`grid grid-cols-[48px_minmax(0,1fr)] border-b border-border`,children:[(0,q.jsx)(`div`,{className:`py-2 pr-2 text-right font-mono text-micro text-soft-foreground`,children:`poll`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-1 border-l border-border px-2 py-1.5`,children:t.map(e=>(0,q.jsxs)(`div`,{"data-slot":`poll-row`,className:`flex h-[22px] min-w-0 items-center gap-2 overflow-hidden rounded-[6px] border border-violet/25 bg-violet/8 px-2 text-meta font-medium`,children:[(0,q.jsx)(G,{className:`size-3 shrink-0 text-violet`}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name}),(0,q.jsx)(`span`,{className:`overflow-hidden font-mono text-micro font-normal text-ellipsis whitespace-nowrap text-muted-foreground`,children:M(e)}),(0,q.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-micro font-normal whitespace-nowrap text-soft-foreground`,children:[e.runs7d,` runs`]})]},e.id))})]}):null}var ti=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function ni({data:e}){let t=Dt(6e4),n=I(),[r,i]=(0,K.useState)(0),a=e.timeZone,o=qr(t,a,r),s=qr(t,a,r+1),c=o===null?null:x(o,a),l=x(t,a);if(o===null||s===null||!c||!l)return(0,q.jsx)(`div`,{"data-slot":`day-view`,className:`p-5`,children:(0,q.jsxs)(`p`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:[`Cannot draw the day: unknown time zone “`,a,`”.`]})});let u=r===0,d=Yr(Jr(e.automations,o,s,a)),f=e.automations.filter(e=>e.kind===`github`&&e.enabled),p=`${Ve(c.weekday)} ${c.day} ${ti[c.month-1]??``}`;return(0,q.jsxs)(`div`,{"data-slot":`day-view`,className:`grid grid-cols-[minmax(0,1fr)_320px] items-start gap-4 p-5 max-md:grid-cols-1`,children:[(0,q.jsxs)(j,{flush:!0,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3.5 py-2.5`,children:[(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Previous day`,onClick:()=>i(e=>e-1),children:(0,q.jsx)(qe,{className:`size-3.5`})}),(0,q.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Next day`,onClick:()=>i(e=>e+1),children:(0,q.jsx)(Ye,{className:`size-3.5`})}),(0,q.jsx)(`span`,{"data-slot":`day-title`,className:`text-sm font-semibold whitespace-nowrap`,children:p}),u?(0,q.jsx)(kt,{dot:`success`,children:`today`}):null,(0,q.jsxs)(`span`,{className:`ml-auto text-xs whitespace-nowrap text-muted-foreground`,children:[d.length,` scheduled runs`,f.length?` · ${f.length} GitHub poll${f.length===1?``:`s`}`:``]})]}),(0,q.jsx)(ei,{automations:e.automations}),(0,q.jsxs)(`div`,{className:`flex max-h-[600px] overflow-y-auto`,children:[(0,q.jsx)(Zr,{}),(0,q.jsxs)(`div`,{"data-slot":`day-column`,"data-today":u?`true`:void 0,className:`relative flex-1 border-l border-border`,style:{height:816},children:[(0,q.jsx)($r,{}),u?(0,q.jsx)(Qr,{minute:Q(l)}):null,d.map(({occurrence:e,stack:t})=>(0,q.jsx)(Xr,{automation:e.automation,minute:Q(e.parts),stack:t,wide:!0},`${e.automation.id}-${e.at}`))]})]})]}),(0,q.jsxs)(j,{flush:!0,"data-slot":`agenda`,className:`py-3`,children:[(0,q.jsx)(`div`,{className:`px-3.5 pb-2 eyebrow text-soft-foreground`,children:`Agenda`}),f.map(e=>(0,q.jsxs)(`button`,{type:`button`,"data-slot":`agenda-poll`,onClick:()=>n(`/automations/${encodeURIComponent(e.id)}`),className:`grid w-full cursor-pointer grid-cols-[48px_1fr] gap-2.5 px-3.5 py-2 text-left hover:bg-muted`,children:[(0,q.jsx)(`span`,{className:`font-mono text-micro font-medium text-soft-foreground`,children:`poll`}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2 text-ui font-medium`,children:[(0,q.jsx)(G,{className:`size-3 shrink-0 text-violet`}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name})]}),(0,q.jsxs)(`span`,{className:`mt-0.5 block overflow-hidden font-mono text-meta leading-[1.4] text-ellipsis whitespace-nowrap text-soft-foreground`,children:[M(e),` · continuous`]})]})]},e.id)),d.map(({occurrence:e})=>{let r=e.at<t,{automation:i}=e;return(0,q.jsxs)(`button`,{type:`button`,"data-slot":`agenda-row`,"data-past":r?`true`:`false`,onClick:()=>n(`/automations/${encodeURIComponent(i.id)}`),className:`grid w-full cursor-pointer grid-cols-[48px_1fr] gap-2.5 px-3.5 py-2 text-left hover:bg-muted`,children:[(0,q.jsx)(`span`,{className:T(`font-mono text-xs font-medium tabular-nums`,r?`text-soft-foreground`:`text-foreground`),children:C(e.parts.hour,e.parts.minute)}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsxs)(`span`,{className:T(`flex items-center gap-2 text-ui font-medium`,r&&`text-muted-foreground`),children:[(0,q.jsx)(F,{tone:r&&i.lastRun?A(i.lastRun.status):`neutral`}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:i.name})]}),(0,q.jsx)(`span`,{className:`mt-0.5 block overflow-hidden text-meta leading-[1.4] text-ellipsis whitespace-nowrap text-soft-foreground`,children:i.task.prompt})]})]},`${i.id}-${e.at}`)}),d.length===0?(0,q.jsx)(`p`,{className:`px-3.5 py-2 text-label text-soft-foreground`,children:f.length?`Nothing scheduled — the GitHub polls above still run.`:`Nothing scheduled.`}):null]})]})}function ri(e,t,n,r=12){let i=[];for(let a of e)if(!(!a.enabled||a.kind!==`schedule`||!a.schedule))for(let e of oe(a,t,t+14*864e5,n,r))i.push({automation:a,at:e});return i.sort((e,t)=>e.at-t.at).slice(0,r)}function ii({open:e,onOpenChange:t,upcoming:n,pollCount:r,timeZone:i,now:a}){let o=I(),s=x(a,i);return(0,q.jsx)(Oe,{open:e,onOpenChange:t,children:(0,q.jsxs)(De,{side:`right`,"data-slot":`next-runs-rail`,"aria-describedby":void 0,className:`w-[360px] gap-0 sm:max-w-[360px]`,children:[(0,q.jsxs)(we,{className:`px-4 pt-4 pb-2`,children:[(0,q.jsxs)(Ee,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,q.jsx)(Be,{className:`size-4`}),`Next runs`]}),(0,q.jsx)(Te,{className:`sr-only`,children:`Upcoming scheduled runs, soonest first.`})]}),(0,q.jsxs)(`div`,{className:`overflow-y-auto`,children:[n.map((e,n)=>{let r=x(e.at,i),c=r!==null&&s!==null&&r.year===s.year&&r.month===s.month&&r.day===s.day,l=r?`${c?``:`${Ve(r.weekday)} `}${C(r.hour,r.minute)}`:``;return(0,q.jsxs)(`button`,{type:`button`,"data-slot":`next-run-row`,"data-automation":e.automation.id,onClick:()=>{t(!1),o(`/automations/${encodeURIComponent(e.automation.id)}`)},className:`grid w-full cursor-pointer grid-cols-[76px_1fr_auto] items-center gap-2 px-4 py-2 text-left text-ui hover:bg-muted`,children:[(0,q.jsx)(`span`,{className:`font-mono text-xs font-medium whitespace-nowrap text-muted-foreground tabular-nums`,children:l}),(0,q.jsx)(`span`,{className:`overflow-hidden text-ui font-medium text-ellipsis whitespace-nowrap`,children:e.automation.name}),(0,q.jsx)(`span`,{className:`text-meta whitespace-nowrap text-soft-foreground`,children:k(e.at,a)})]},`${e.automation.id}-${n}`)}),n.length===0?(0,q.jsx)(`p`,{className:`px-4 py-2 text-label text-soft-foreground`,children:`No scheduled runs in the next two weeks.`}):null,(0,q.jsxs)(`div`,{"data-slot":`next-runs-footer`,className:`mt-1.5 flex items-center gap-2 border-t border-border px-3.5 pt-2.5 pb-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(F,{tone:`pending`,pulse:!0}),r,` GitHub polls running continuously`]})]})]})})}function ai({stats:e,pollCount:t,upcoming:n,timeZone:r,railOpen:i,onOpenRail:a}){let o=n[0];return(0,q.jsxs)(`div`,{"data-slot":`stats-strip`,className:`flex flex-wrap items-center gap-4 text-label text-muted-foreground`,children:[(0,q.jsx)(`span`,{className:`eyebrow text-soft-foreground`,children:`This week`}),(0,q.jsx)(oi,{label:`runs`,value:String(e.runs)}),null,(0,q.jsx)(oi,{label:`failed`,value:String(e.failed),danger:e.failed>0}),(0,q.jsx)(oi,{label:`agent time`,value:Ke(e.agentSeconds)}),(0,q.jsxs)(`span`,{"data-slot":`stats-polls`,className:`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,q.jsx)(F,{tone:`pending`,pulse:!0}),t,` GitHub polls continuous`]}),(0,q.jsx)(`span`,{className:`flex-1`}),(0,q.jsxs)(`span`,{"data-slot":`stats-next`,className:`inline-flex min-w-0 shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,q.jsx)(Qt,{className:`size-[13px] text-soft-foreground`}),`next`,` `,(0,q.jsx)(`b`,{className:`font-mono text-label font-medium text-foreground`,children:o?ze(o.at,r):`—`}),` `,(0,q.jsx)(`span`,{className:`max-w-[180px] overflow-hidden text-ellipsis`,children:o?.automation.name??``})]}),(0,q.jsxs)(O,{variant:`outline`,size:`sm`,"aria-expanded":i,className:`shrink-0`,onClick:a,children:[(0,q.jsx)(Be,{className:`size-3.5`}),`Next runs`,(0,q.jsx)(`span`,{className:`font-mono text-meta font-medium text-muted-foreground`,children:n.length})]})]})}function oi({label:e,value:t,danger:n=!1}){return(0,q.jsxs)(`span`,{"data-slot":`stat`,"data-label":e,className:`inline-flex shrink-0 items-baseline gap-[5px] whitespace-nowrap`,children:[(0,q.jsx)(`b`,{className:T(`font-mono text-sm font-semibold tabular-nums`,n?`text-danger`:`text-foreground`),children:t}),e]})}var si=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function ci({data:e}){let t=Dt(6e4),n=e.timeZone,r=x(t,n),i=r?Array.from({length:8},(e,i)=>qr(t,n,i-(r.weekday-1))):[],a=i[0],o=i[7];if(!r||a==null||o==null)return(0,q.jsx)(`div`,{"data-slot":`week-view`,className:`p-5`,children:(0,q.jsxs)(`p`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:[`Cannot draw the week: unknown time zone “`,n,`”.`]})});let s=r.weekday-1,c=Jr(e.automations,a,o,n),l=si.map((e,t)=>{let r=i[t];return{label:e,dayOfMonth:r==null?null:x(r,n)?.day??null,isToday:t===s,blocks:Yr(c.filter(e=>e.parts.weekday-1===t))}});return(0,q.jsx)(`div`,{"data-slot":`week-view`,className:`p-5`,children:(0,q.jsxs)(j,{flush:!0,children:[(0,q.jsxs)(`div`,{className:`grid grid-cols-[48px_repeat(7,minmax(0,1fr))] border-b border-border`,children:[(0,q.jsx)(`div`,{}),l.map(e=>(0,q.jsxs)(`div`,{"data-slot":`week-day-header`,"data-today":e.isToday?`true`:void 0,className:T(`flex items-center gap-2 border-l border-border px-2 py-2.5 eyebrow`,e.isToday?`text-foreground`:`text-soft-foreground`),children:[e.label,(0,q.jsx)(`span`,{className:T(`rounded-full px-[7px] py-px text-ui font-medium tracking-normal normal-case`,e.isToday?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e.dayOfMonth??``})]},e.label))]}),(0,q.jsx)(ei,{automations:e.automations}),(0,q.jsxs)(`div`,{className:`flex max-h-[560px] overflow-y-auto`,children:[(0,q.jsx)(Zr,{}),l.map(e=>(0,q.jsxs)(`div`,{"data-slot":`week-column`,"data-today":e.isToday?`true`:void 0,className:T(`relative min-w-0 flex-1 border-l border-border`,e.isToday&&`bg-muted/35`),style:{height:816},children:[(0,q.jsx)($r,{}),e.isToday?(0,q.jsx)(Qr,{minute:Q(r)}):null,e.blocks.map(({occurrence:e,stack:t})=>(0,q.jsx)(Xr,{automation:e.automation,minute:Q(e.parts),stack:t},`${e.automation.id}-${e.at}`))]},e.label))]})]})})}function li(e){return[{value:`list`,label:`List`,...e===void 0?{}:{count:e}},{value:`week`,label:`Week`},{value:`day`,label:`Day`}]}function ui({data:e,error:t,actions:n,view:r,onViewChange:i}){let[a,o]=(0,K.useState)(!1),{preferences:s,canSave:c,loadError:l,retry:u,setSort:d,setOrder:f}=Kr(),p=Date.now(),m=e?ri(e.automations,p,e.timeZone,12):[],h=e?e.automations.filter(e=>e.kind===`github`&&e.enabled).length:0,g=e?Rr(e.automations,s,e.timeZone,p):[],_=g.length<=200;return(0,q.jsxs)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col`,children:[(0,q.jsxs)(`header`,{className:`sticky top-0 z-10 flex min-h-14 shrink-0 flex-wrap items-center gap-3 border-b border-border bg-background px-5 max-md:py-2 md:h-14 md:flex-nowrap`,children:[(0,q.jsx)(`h1`,{className:`text-base font-semibold`,children:`Automations`}),(0,q.jsx)(Yt,{slot:`automations-view`,label:`View`,value:r,options:li(e?.automations.length),onChange:i}),(0,q.jsx)(`div`,{className:`flex-1`}),e?(0,q.jsxs)(`span`,{"data-slot":`automations-status`,className:`inline-flex min-w-0 items-center gap-2 overflow-hidden text-label text-ellipsis whitespace-nowrap text-muted-foreground max-[1280px]:hidden`,children:[(0,q.jsx)(F,{tone:e.scheduler.state===`scheduled`?`success`:`neutral`}),e.scheduler.state===`scheduled`?`Scheduler running`:`Scheduler idle`,(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),e.available?`GitHub available`:`GitHub unavailable${e.reason?` · ${e.reason}`:``}`,(0,q.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,q.jsx)(`span`,{className:`font-mono text-xs`,children:e.timeZone})]}):null,(0,q.jsx)(Cr,{}),(0,q.jsx)(O,{asChild:!0,className:`shrink-0`,children:(0,q.jsxs)(L,{to:`/automations/new`,children:[(0,q.jsx)(ut,{className:`size-[15px]`}),`New automation`]})})]}),t===void 0?e?e.automations.length===0?(0,q.jsx)(`div`,{className:`flex flex-1 flex-col px-5`,children:(0,q.jsx)(xr,{data:e})}):r===`week`?(0,q.jsx)(ci,{data:e}):r===`day`?(0,q.jsx)(ni,{data:e}):(0,q.jsxs)(`div`,{"data-slot":`automations-list`,className:`flex flex-col gap-3 p-5`,children:[(0,q.jsx)(ai,{stats:e.stats,pollCount:h,upcoming:m,timeZone:e.timeZone,railOpen:a,onOpenRail:()=>o(!0)}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Sort`}),(0,q.jsx)(`fieldset`,{disabled:!c,"aria-label":`Automation sort`,className:`min-w-0`,children:(0,q.jsx)(Yt,{slot:`automations-sort`,label:`Sort automations`,value:s.sort,options:[{value:`manual`,label:`Manual`},{value:`name`,label:`Name`},{value:`nextRun`,label:`Next run`}],onChange:d})}),c?s.sort===`manual`?(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_?`Drag a handle or use Move up and down.`:`Manual placement supports up to 200 automations.`}):null:(0,q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[l?`Saved order unavailable.`:`Loading saved order…`,l?(0,q.jsx)(O,{size:`sm`,variant:`ghost`,onClick:u,children:`Retry`}):null]})]}),(0,q.jsx)(Hr,{data:e,automations:g,actions:n,now:p,...s.sort===`manual`?{reorder:{enabled:c&&_,onMove:(e,t)=>f(zr(g.map(e=>e.id),e,t))}}:{}}),(0,q.jsx)(ii,{open:a,onOpenChange:o,upcoming:m,pollCount:h,timeZone:e.timeZone,now:p})]}):(0,q.jsx)(`div`,{className:`p-5`,children:(0,q.jsx)($,{text:`Loading automations…`})}):(0,q.jsx)(`div`,{className:`p-5`,children:(0,q.jsx)($,{text:t})})]})}function di({mode:e=`list`}){let{automationId:t}=de(),n=I(),r=Nt(),i=Lt(r.known&&!r.off),a=i.data?{...i.data,automations:i.data.automations.filter(e=>!e.deferredStart)}:void 0,o=Wt(a),[s,c]=ue(),l=fi(s.get(`view`));if(!r.known)return(0,q.jsx)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col p-3 md:p-5`,children:(0,q.jsx)($,{text:`Loading automations…`})});if(r.off)return(0,q.jsx)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col p-3 md:p-5`,children:(0,q.jsx)(jt,{icon:(0,q.jsx)(Ie,{}),tone:`neutral`,title:`Automations are off`,subtitle:`This cockpit was started with CEZ_AUTOMATIONS=0. Unset it and restart the service to turn automations on.`,heading:`h2`})});let u=()=>n(`/automations`);if(e===`new`)return(0,q.jsx)(dr,{data:a,initialKind:pi(s.get(`kind`)),onBack:u,onSaved:u});if(e===`edit`){let e=a?.automations.find(e=>e.id===t);return a&&!e?(0,q.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,q.jsx)($,{text:`Automation not found.`})}):e?(0,q.jsx)(dr,{data:a,automation:e,actions:o,onBack:u,onSaved:u,onLog:()=>n(`/automations/${encodeURIComponent(e.id)}/log`)}):(0,q.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,q.jsx)($,{text:`Loading automation…`})})}if(e===`log`){let e=a?.automations.find(e=>e.id===t);return t?(0,q.jsx)(gr,{automationId:t,automation:e,timeZone:a?.timeZone,onBack:u}):(0,q.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,q.jsx)($,{text:`Automation not found.`})})}return(0,q.jsx)(ui,{data:a,error:i.error?String(i.error instanceof Error?i.error.message:i.error):void 0,actions:o,view:l,onViewChange:e=>c(t=>{let n=new URLSearchParams(t);return e===`list`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})})}function fi(e){return e===`week`||e===`day`?e:`list`}function pi(e){return e===`schedule`||e===`github`||e===`tracker`?e:void 0}function $({text:e}){return(0,q.jsx)(`div`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:e})}export{di as AutomationsRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./button-BrxohNcK.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r,Jn as i,Ka as a,Mt as o,P as s,Pn as c,Ya as l,_n as u,ji as d,pn as f,r as p,sr as m}from"./queries-DOHu2y2B.js";import{t as h}from"./utils-Df_1kJEk.js";import{h as g,r as _}from"./toaster-DrFdGtNN.js";import{t as v}from"./button-BrxohNcK.js";import{t as y}from"./check-B5omShEO.js";import{t as b}from"./chevron-right-C3fLn_fF.js";import{t as x}from"./search-x-BkezzsKh.js";import{n as S,r as C,t as w}from"./collapsible-BJ0sxcz9.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./alert-dialog-BZkKvKiu.js";import{c as N,t as P}from"./project-router-CmpQcVZp.js";import{r as F,t as I}from"./directional-usage-BtjgT5nc.js";import{t as L}from"./token-metrics-DXeuToH8.js";import{t as R}from"./centered-state-CSW_o4N7.js";import{t as z}from"./markdown-rDA5iFAU.js";import{S as B,ut as V}from"./index-CDhEdFaZ.js";import{t as H}from"./run-diff-CFHlmgGA.js";var U=e(t(),1),W=n();function G(){let{groupId:e}=g(),t=s(e),n=L(r().data),i=l();if((0,U.useEffect)(()=>{e&&i.invalidateQueries({queryKey:p.groups.detail(e)})},[i,e,(o().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,W.jsx)(B,{});if(t.isError){let e=t.error instanceof m&&t.error.status===404;return(0,W.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,W.jsx)(R,{icon:e?(0,W.jsx)(x,{}):(0,W.jsx)(V,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,W.jsx)(v,{asChild:!0,variant:`outline`,children:(0,W.jsx)(P,{to:`/`,children:`Back to tasks`})})})})}return(0,W.jsx)(K,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function K({groupId:e,variants:t,showTokens:n,showCost:r}){let i=N(),o=l(),[s,u]=(0,U.useState)(null),m=t.every(e=>f.has(e.status)),g=t[0]?c(t[0]):``,v=a({mutationFn:t=>d(e,t),onSuccess:(t,n)=>{o.invalidateQueries({queryKey:p.runs.all}),o.invalidateQueries({queryKey:p.groups.detail(e)}),i(`/tasks/${t.winner?.id??n}`)},onError:e=>_(e.message,{tone:`danger`})});return(0,W.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,W.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,W.jsx)(V,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,title:g,children:g})]}),(0,W.jsxs)(`p`,{className:`text-ui text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,W.jsx)(`div`,{"data-slot":`compare-columns`,className:h(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,W.jsx)(q,{variant:e,allTerminal:m,pickPending:v.isPending,onPick:()=>u(e),showTokens:n,showCost:r},e.id))}),(0,W.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,W.jsx)(J,{variant:e},e.id))}),(0,W.jsx)(M,{open:s!==null,onOpenChange:e=>!e&&u(null),children:(0,W.jsxs)(D,{children:[(0,W.jsxs)(j,{children:[(0,W.jsxs)(E,{children:[`Pick variant `,s?.variant,`?`]}),(0,W.jsxs)(T,{children:[`Variant `,s?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,W.jsxs)(k,{children:[(0,W.jsx)(A,{children:`Keep comparing`}),(0,W.jsxs)(O,{"data-slot":`confirm-pick`,onClick:()=>{s&&v.mutate(s.id),u(null)},children:[(0,W.jsx)(y,{"aria-hidden":`true`}),`Pick variant `,s?.variant]})]})]})})]})}function q({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:a,showCost:o}){let s=i(e),c=u(e.costUsd),l=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,W.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,W.jsx)(F,{dot:s.tone,pulse:s.pulse,children:s.label}),a&&l||o&&c?(0,W.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-meta text-soft-foreground`,children:[a?(0,W.jsx)(I,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,a&&l&&o&&c?(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,o&&c?(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:c}):null]}):null]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`eyebrow text-soft-foreground`,children:`git diff --stat`}),(0,W.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-meta leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`eyebrow text-soft-foreground`,children:`Progress`}),e.handoffExcerpt?(0,W.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-label text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,W.jsx)(z,{children:e.handoffExcerpt})}):(0,W.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,W.jsxs)(v,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,W.jsx)(y,{"aria-hidden":`true`}),`Pick this one`]})]})}function J({variant:e}){let[t,n]=(0,U.useState)(!1);return(0,W.jsxs)(w,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,W.jsxs)(C,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-ui font-medium hover:bg-muted/50`,children:[(0,W.jsx)(b,{className:h(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,W.jsx)(S,{children:(0,W.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,W.jsx)(H,{runId:e.id})})})]})}export{G as CompareVariantsRoute};
|