@wjarka/cezarion 0.15.1 → 0.16.0
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 +167 -46
- package/dist/agent-config/catalog.d.ts +6 -2
- package/dist/agent-config/catalog.js +78 -3
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/shared.js +6 -3
- package/dist/agent-config/model-settings/shared.js.map +1 -1
- package/dist/agent-config/models.js +4 -0
- package/dist/agent-config/models.js.map +1 -1
- package/dist/agent-config/validate.js +6 -0
- package/dist/agent-config/validate.js.map +1 -1
- package/dist/artifacts/cli.js +10 -2
- package/dist/artifacts/cli.js.map +1 -1
- package/dist/automations/coordinator.d.ts +7 -0
- package/dist/automations/coordinator.js +22 -2
- package/dist/automations/coordinator.js.map +1 -1
- package/dist/automations/github-poller.d.ts +4 -4
- package/dist/automations/github-poller.js.map +1 -1
- package/dist/automations/schedule-runner.d.ts +130 -0
- package/dist/automations/schedule-runner.js +326 -0
- package/dist/automations/schedule-runner.js.map +1 -0
- package/dist/automations/scheduler.d.ts +38 -7
- package/dist/automations/scheduler.js +90 -22
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/automations/store.d.ts +80 -3
- package/dist/automations/store.js +208 -16
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/task-template.d.ts +42 -6
- package/dist/automations/task-template.js +152 -24
- package/dist/automations/task-template.js.map +1 -1
- package/dist/automations/types.d.ts +142 -6
- package/dist/automations/types.js +64 -6
- package/dist/automations/types.js.map +1 -1
- package/dist/autosave-holders.js +8 -12
- package/dist/autosave-holders.js.map +1 -1
- package/dist/ci-wait/client.d.ts +8 -1
- package/dist/ci-wait/client.js +43 -1
- package/dist/ci-wait/client.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +83 -4
- package/dist/ci-wait/controller.js +76 -11
- package/dist/ci-wait/controller.js.map +1 -1
- package/dist/ci-wait/errors.d.ts +7 -1
- package/dist/ci-wait/errors.js +36 -0
- package/dist/ci-wait/errors.js.map +1 -1
- package/dist/ci-wait/github.d.ts +2 -0
- package/dist/ci-wait/github.js +3 -1
- package/dist/ci-wait/github.js.map +1 -1
- package/dist/ci-wait/mcp.d.ts +2 -98
- package/dist/ci-wait/mcp.js +11 -25
- package/dist/ci-wait/mcp.js.map +1 -1
- package/dist/ci-wait/supervisor.d.ts +2 -1
- package/dist/ci-wait/supervisor.js +2 -1
- package/dist/ci-wait/supervisor.js.map +1 -1
- package/dist/ci-wait/tools.d.ts +307 -0
- package/dist/ci-wait/tools.js +63 -0
- package/dist/ci-wait/tools.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/contract/agent-config.d.ts +5 -0
- package/dist/contract/agent-profiles.d.ts +15 -0
- package/dist/contract/automation-schedule.d.ts +60 -0
- package/dist/contract/automations.d.ts +208 -36
- package/dist/contract/delegation.d.ts +96 -0
- package/dist/contract/discovery.d.ts +7 -0
- package/dist/contract/github.d.ts +1 -0
- package/dist/contract/health.d.ts +6 -0
- package/dist/contract/index.d.ts +3 -0
- package/dist/contract/index.js +1445 -745
- package/dist/contract/preview.d.ts +508 -0
- package/dist/contract/runs.d.ts +716 -15
- package/dist/contract/skills.d.ts +39 -0
- package/dist/contract/workflows.d.ts +6 -0
- package/dist/contract/workspace.d.ts +65 -0
- package/dist/contract/zoned-time.d.ts +35 -0
- package/dist/core/agent-env.d.ts +11 -0
- package/dist/core/agent-env.js +27 -5
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-profiles.js +7 -0
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/agent-runner.d.ts +49 -1
- package/dist/core/agent-runner.js +2 -1
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/backend-detect.d.ts +3 -2
- package/dist/core/backend-detect.js +27 -1
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +1 -0
- package/dist/core/claude-cli-runner.js +69 -19
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +1 -0
- package/dist/core/codex-app-server-runner.js +200 -25
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.d.ts +7 -3
- package/dist/core/codex-app-server-transport.js +11 -9
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/cursor-acp-runner.d.ts +1 -0
- package/dist/core/cursor-acp-runner.js +24 -9
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/core/host-model-catalog.js +2 -0
- package/dist/core/host-model-catalog.js.map +1 -1
- package/dist/core/managed-session.js +2 -0
- package/dist/core/managed-session.js.map +1 -1
- package/dist/core/model-identity.js +2 -0
- package/dist/core/model-identity.js.map +1 -1
- package/dist/core/model-presets.js +3 -0
- package/dist/core/model-presets.js.map +1 -1
- package/dist/core/omp-model-catalog.d.ts +43 -0
- package/dist/core/omp-model-catalog.js +205 -0
- package/dist/core/omp-model-catalog.js.map +1 -0
- package/dist/core/omp-runner.d.ts +73 -0
- package/dist/core/omp-runner.js +990 -0
- package/dist/core/omp-runner.js.map +1 -0
- package/dist/core/omp-ui-mapper.d.ts +106 -0
- package/dist/core/omp-ui-mapper.js +882 -0
- package/dist/core/omp-ui-mapper.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +18 -4
- package/dist/core/opencode-server-runner.js +337 -96
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/opencode-session-error.d.ts +11 -0
- package/dist/core/opencode-session-error.js +26 -0
- package/dist/core/opencode-session-error.js.map +1 -0
- package/dist/core/opencode-ui-mapper.js +4 -36
- package/dist/core/opencode-ui-mapper.js.map +1 -1
- package/dist/core/pi-runner.d.ts +1 -0
- package/dist/core/pi-runner.js +75 -12
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.d.ts +9 -2
- package/dist/core/provider-auth.js +43 -6
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/runner-factory.js +3 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-model-catalog.js +1 -0
- package/dist/core/runner-model-catalog.js.map +1 -1
- package/dist/core/runner-stderr.d.ts +2 -0
- package/dist/core/runner-stderr.js +20 -0
- package/dist/core/runner-stderr.js.map +1 -0
- package/dist/core/session-process.d.ts +22 -0
- package/dist/core/session-process.js +202 -0
- package/dist/core/session-process.js.map +1 -0
- package/dist/core/ui-events.d.ts +1 -1
- package/dist/core/usage-limit.js +3 -60
- package/dist/core/usage-limit.js.map +1 -1
- package/dist/data-gitignore.d.ts +6 -0
- package/dist/data-gitignore.js +57 -0
- package/dist/data-gitignore.js.map +1 -0
- package/dist/delegation/capacity.d.ts +19 -0
- package/dist/delegation/capacity.js +34 -0
- package/dist/delegation/capacity.js.map +1 -0
- package/dist/delegation/cli.js +13 -4
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversations.d.ts +4 -2
- package/dist/delegation/conversations.js +8 -12
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/credentials.d.ts +2 -0
- package/dist/delegation/credentials.js +10 -0
- package/dist/delegation/credentials.js.map +1 -1
- package/dist/delegation/destroy-observation.d.ts +42 -0
- package/dist/delegation/destroy-observation.js +115 -0
- package/dist/delegation/destroy-observation.js.map +1 -0
- package/dist/delegation/execution-identity.d.ts +6 -0
- package/dist/delegation/execution-identity.js +1 -1
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/policy.d.ts +3 -2
- package/dist/delegation/policy.js +7 -5
- package/dist/delegation/policy.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +57 -20
- package/dist/delegation/process-liveness.js +114 -92
- package/dist/delegation/process-liveness.js.map +1 -1
- package/dist/delegation/provision.js +6 -6
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/results.js +4 -2
- package/dist/delegation/results.js.map +1 -1
- package/dist/delegation/retry-backoff.d.ts +23 -0
- package/dist/delegation/retry-backoff.js +18 -0
- package/dist/delegation/retry-backoff.js.map +1 -0
- package/dist/delegation/routes.d.ts +64 -58
- package/dist/delegation/scratch-cleanup.d.ts +29 -0
- package/dist/delegation/scratch-cleanup.js +143 -0
- package/dist/delegation/scratch-cleanup.js.map +1 -0
- package/dist/delegation/service.d.ts +20 -1
- package/dist/delegation/service.js +233 -70
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +12 -6
- package/dist/delegation/workspace.d.ts +23 -4
- package/dist/delegation/workspace.js +147 -31
- package/dist/delegation/workspace.js.map +1 -1
- package/dist/git-worktree-lock-helper.js +8 -3
- package/dist/git-worktree-lock-helper.js.map +1 -1
- package/dist/git-worktree-lock.d.ts +6 -1
- package/dist/git-worktree-lock.js +10 -4
- package/dist/git-worktree-lock.js.map +1 -1
- package/dist/git-worktree-release.d.ts +20 -0
- package/dist/git-worktree-release.js +27 -0
- package/dist/git-worktree-release.js.map +1 -0
- package/dist/git-worktree.d.ts +8 -2
- package/dist/git-worktree.js +19 -2
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +1 -1
- package/dist/index.js +109 -76
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +5 -1
- package/dist/paths.js.map +1 -1
- package/dist/preview/cdp.d.ts +13 -0
- package/dist/preview/cdp.js +69 -0
- package/dist/preview/cdp.js.map +1 -0
- package/dist/preview/chromium.d.ts +75 -0
- package/dist/preview/chromium.js +394 -0
- package/dist/preview/chromium.js.map +1 -0
- package/dist/preview/dev-server.d.ts +68 -0
- package/dist/preview/dev-server.js +341 -0
- package/dist/preview/dev-server.js.map +1 -0
- package/dist/preview/host.d.ts +154 -0
- package/dist/preview/host.js +681 -0
- package/dist/preview/host.js.map +1 -0
- package/dist/preview/registration.d.ts +63 -0
- package/dist/preview/registration.js +109 -0
- package/dist/preview/registration.js.map +1 -0
- package/dist/preview/session.d.ts +73 -0
- package/dist/preview/session.js +347 -0
- package/dist/preview/session.js.map +1 -0
- package/dist/preview/url.d.ts +6 -0
- package/dist/preview/url.js +17 -0
- package/dist/preview/url.js.map +1 -0
- package/dist/runs/agent-tmpdir-removal.d.ts +15 -0
- package/dist/runs/agent-tmpdir-removal.js +60 -0
- package/dist/runs/agent-tmpdir-removal.js.map +1 -0
- package/dist/runs/agent-tmpdir.d.ts +12 -1
- package/dist/runs/agent-tmpdir.js +123 -34
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/delegation-state.d.ts +5 -1
- package/dist/runs/delegation-state.js +9 -0
- package/dist/runs/delegation-state.js.map +1 -1
- package/dist/runs/event-history.d.ts +4 -4
- package/dist/runs/event-history.js +97 -117
- package/dist/runs/event-history.js.map +1 -1
- package/dist/runs/history-compressor.d.ts +29 -0
- package/dist/runs/history-compressor.js +116 -0
- package/dist/runs/history-compressor.js.map +1 -0
- package/dist/runs/history-file.d.ts +36 -0
- package/dist/runs/history-file.js +463 -0
- package/dist/runs/history-file.js.map +1 -0
- package/dist/runs/human-ask-summary.js +18 -13
- package/dist/runs/human-ask-summary.js.map +1 -1
- package/dist/runs/legacy-index.d.ts +62 -0
- package/dist/runs/legacy-index.js +168 -0
- package/dist/runs/legacy-index.js.map +1 -0
- package/dist/runs/raw-record.d.ts +52 -0
- package/dist/runs/raw-record.js +145 -0
- package/dist/runs/raw-record.js.map +1 -0
- package/dist/runs/retention.d.ts +13 -6
- package/dist/runs/retention.js +42 -13
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/run-claims.d.ts +23 -0
- package/dist/runs/run-claims.js +24 -0
- package/dist/runs/run-claims.js.map +1 -0
- package/dist/runs/run-database.d.ts +385 -0
- package/dist/runs/run-database.js +930 -0
- package/dist/runs/run-database.js.map +1 -0
- package/dist/runs/run-index.d.ts +35 -9
- package/dist/runs/run-index.js +200 -25
- package/dist/runs/run-index.js.map +1 -1
- package/dist/runs/run-row.d.ts +44 -0
- package/dist/runs/run-row.js +84 -0
- package/dist/runs/run-row.js.map +1 -0
- package/dist/runs/run-search.d.ts +29 -0
- package/dist/runs/run-search.js +63 -0
- package/dist/runs/run-search.js.map +1 -0
- package/dist/runs/store-open-error.d.ts +24 -0
- package/dist/runs/store-open-error.js +61 -0
- package/dist/runs/store-open-error.js.map +1 -0
- package/dist/runs/store.d.ts +667 -32
- package/dist/runs/store.js +2153 -324
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/transcript-facts.d.ts +77 -0
- package/dist/runs/transcript-facts.js +302 -0
- package/dist/runs/transcript-facts.js.map +1 -0
- package/dist/runs/webhook.js +5 -4
- package/dist/runs/webhook.js.map +1 -1
- package/dist/runs/worker-execution.d.ts +22 -0
- package/dist/runs/worker-execution.js +30 -0
- package/dist/runs/worker-execution.js.map +1 -0
- package/dist/server/capabilities.d.ts +1 -0
- package/dist/server/capabilities.js +2 -0
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/cockpit-ownership.d.ts +8 -0
- package/dist/server/cockpit-ownership.js +19 -0
- package/dist/server/cockpit-ownership.js.map +1 -1
- package/dist/server/forge/github.d.ts +1 -4
- package/dist/server/forge/github.js +47 -23
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/git.js +1 -1
- package/dist/server/git.js.map +1 -1
- package/dist/server/open-in-app.js +1 -0
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/preview-socket.d.ts +36 -0
- package/dist/server/preview-socket.js +126 -0
- package/dist/server/preview-socket.js.map +1 -0
- package/dist/server/project-context.d.ts +31 -4
- package/dist/server/project-context.js +73 -9
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-action-gate.js +1 -0
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/repo-branches.d.ts +4 -3
- package/dist/server/repo-branches.js +5 -4
- package/dist/server/repo-branches.js.map +1 -1
- package/dist/server/server.d.ts +4500 -2727
- package/dist/server/server.js +651 -202
- package/dist/server/server.js.map +1 -1
- package/dist/server/upgrade-router.d.ts +23 -0
- package/dist/server/upgrade-router.js +53 -0
- package/dist/server/upgrade-router.js.map +1 -0
- package/dist/server/validators.d.ts +6 -1
- package/dist/server/validators.js +4 -4
- package/dist/server/validators.js.map +1 -1
- package/dist/server/ws.d.ts +16 -16
- package/dist/server/ws.js +56 -54
- package/dist/server/ws.js.map +1 -1
- package/dist/skills-remote.d.ts +14 -0
- package/dist/skills-remote.js +91 -15
- package/dist/skills-remote.js.map +1 -1
- package/dist/task-cli/cli.js +40 -16
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/task-cli/discovery.d.ts +4 -3
- package/dist/task-cli/discovery.js +4 -3
- package/dist/task-cli/discovery.js.map +1 -1
- package/dist/task-cli/http.d.ts +2 -0
- package/dist/task-cli/http.js +10 -4
- package/dist/task-cli/http.js.map +1 -1
- package/dist/task-cli/projections.d.ts +5 -2
- package/dist/task-cli/projections.js +13 -0
- package/dist/task-cli/projections.js.map +1 -1
- package/dist/task-cli/watch.d.ts +15 -2
- package/dist/task-cli/watch.js +31 -9
- package/dist/task-cli/watch.js.map +1 -1
- package/dist/ui-state.d.ts +4 -3
- package/dist/ui-state.js +8 -3
- package/dist/ui-state.js.map +1 -1
- package/dist/workflows/grouped-command.d.ts +31 -0
- package/dist/workflows/grouped-command.js +143 -0
- package/dist/workflows/grouped-command.js.map +1 -0
- package/dist/workflows/run.d.ts +223 -42
- package/dist/workflows/run.js +1316 -398
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +12 -0
- package/dist/workflows/types.js +20 -0
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.d.ts +5 -1
- package/dist/workspace/agent-accounts.js +1 -0
- package/dist/workspace/agent-accounts.js.map +1 -1
- package/dist/workspace/agent-profiles.js +1 -1
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.d.ts +3 -1
- package/dist/workspace/config.js +1 -0
- package/dist/workspace/config.js.map +1 -1
- package/dist/worktree-setup.d.ts +85 -0
- package/dist/worktree-setup.js +164 -0
- package/dist/worktree-setup.js.map +1 -0
- package/package.json +7 -5
- package/scripts/benchmark-run-store-fixture.ts +428 -0
- package/scripts/benchmark-run-store.ts +743 -0
- package/scripts/benchmark-stuck-destroys.ts +143 -0
- package/scripts/mock-autonomous.mjs +11 -0
- package/scripts/mock-ci-tool.mjs +20 -5
- package/scripts/mock-claude.mjs +110 -1
- package/scripts/mock-codex-app-server.mjs +117 -2
- package/scripts/mock-codex-coalesce-steer.mjs +59 -0
- package/scripts/mock-codex-reverse-steer.mjs +130 -0
- package/scripts/mock-cursor-acp.mjs +75 -1
- package/scripts/mock-omp-rpc.mjs +605 -0
- package/scripts/mock-opencode-serve.mjs +312 -22
- package/scripts/mock-pi-rpc.mjs +109 -3
- package/scripts/mock-runner-crash.mjs +42 -0
- package/scripts/mock-silent-tail.mjs +78 -0
- package/scripts/mock-turn-messages.mjs +5 -0
- package/scripts/omp-ci-wait.mjs +29 -0
- package/scripts/omp-restrict-delegation.yml +4 -0
- package/scripts/pi-ci-wait.mjs +12 -9
- package/scripts/seed-archive-profile.ts +3 -3
- package/web/dist/assets/agent-accounts-CFOBMVHc.js +1 -0
- package/web/dist/assets/alert-dialog-BrpNUwMt.js +1 -0
- package/web/dist/assets/app-window-CSHwDX9N.js +1 -0
- package/web/dist/assets/button-C_rd7CPp.js +43 -0
- package/web/dist/assets/compare-variants-D6WXhvXA.js +1 -0
- package/web/dist/assets/diff-DrEARXTV.js +3 -0
- package/web/dist/assets/diff-controls-B1-j7nFg.js +1 -0
- package/web/dist/assets/{diff-view-DPn6bQ5W.js → diff-view-DvGLjdTk.js} +3 -3
- package/web/dist/assets/dropdown-menu-BegOZFrj.js +1 -0
- package/web/dist/assets/format-DpNe3S0A.js +1 -0
- package/web/dist/assets/git-toolbar-Cw4ljmhB.js +1 -0
- package/web/dist/assets/github-CfV5sqL0.js +1 -0
- package/web/dist/assets/{image-preview-DJ8cgb1Z.js → image-preview-FOEfqpZP.js} +1 -1
- package/web/dist/assets/index-DgWWlOLy.js +13 -0
- package/web/dist/assets/index-fBFnuvxu.css +1 -0
- package/web/dist/assets/{nav-row-styles-3j64kH5s.js → nav-row-styles-vp2JbhuJ.js} +1 -1
- package/web/dist/assets/play-CmVAj_fu.js +1 -0
- package/web/dist/assets/popover-BohP6WTx.js +1 -0
- package/web/dist/assets/preview-pane-connected-qTA5KNoJ.js +3 -0
- package/web/dist/assets/preview-state-vuMviq6q.js +1 -0
- package/web/dist/assets/prompt-templates-Cubdut_C.js +15 -0
- package/web/dist/assets/repo-git-Cf4t5PD0.js +1 -0
- package/web/dist/assets/{run-diff-5-RRdcVz.js → run-diff-BpkUW37Z.js} +3 -3
- package/web/dist/assets/run-header-68WHf9wV.js +1 -0
- package/web/dist/assets/skills-DiVIgKeU.js +1 -0
- package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
- package/web/dist/assets/status-dot-CqTJHSP9.js +1 -0
- package/web/dist/assets/{tab-link-K0hjzEXR.js → tab-link-B07Hu4QX.js} +1 -1
- package/web/dist/assets/task-changes--lQF6EYf.js +1 -0
- package/web/dist/assets/task-commits-Cx0qy4DN.js +1 -0
- package/web/dist/assets/task-files-D50s-gKW.js +2 -0
- package/web/dist/assets/task-github-item-DaqmSwYT.js +1 -0
- package/web/dist/assets/task-thread-BPQ64lui.js +7 -0
- package/web/dist/assets/{task-thread-Bw_nQuTx.css → task-thread-zNE2Q9E-.css} +1 -1
- package/web/dist/assets/textarea-D20O4Pw0.js +1 -0
- package/web/dist/assets/thread-state-DWcFMrvb.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-BLIGmwbd.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Cy9eyyfL.js +1 -0
- package/web/dist/assets/{utils-fzNfbPzA.js → utils-JsL3ZsJf.js} +1 -1
- package/web/dist/assets/workflows-jwG7uxqi.js +11 -0
- package/web/dist/assets/{zoomable-image-CDmZ_Rtl.js → zoomable-image-BJJ64KGc.js} +1 -1
- package/web/dist/cezarion-lockup-dark.svg +1 -13
- package/web/dist/cezarion-lockup-light.svg +1 -13
- package/web/dist/cezarion-mark-dark.svg +1 -12
- package/web/dist/cezarion-mark-light.svg +1 -12
- package/web/dist/index.html +16 -21
- package/web/dist/assets/agent-accounts-CU2ZDv24.js +0 -1
- package/web/dist/assets/alert-dialog-C-xYE_dg.js +0 -43
- package/web/dist/assets/chevron-right-BENZ-1ZN.js +0 -1
- package/web/dist/assets/collapsible-DD9J91Iv.js +0 -1
- package/web/dist/assets/compare-variants-5FmqpFSN.js +0 -1
- package/web/dist/assets/diff-controls-Bj0YrioE.js +0 -1
- package/web/dist/assets/diff-rE8rm75J2.js +0 -3
- package/web/dist/assets/diff-stat-BKDCSVfJ.js +0 -1
- package/web/dist/assets/dropdown-menu-Ch5BYQh_.js +0 -1
- package/web/dist/assets/format-dBiNDNVe.js +0 -1
- package/web/dist/assets/git-toolbar-ClVvf5iF.js +0 -1
- package/web/dist/assets/github-BkNOyour.css +0 -1
- package/web/dist/assets/github-DeZMeMwJ.js +0 -1
- package/web/dist/assets/github-item-detail-W5F6GVjF.js +0 -1
- package/web/dist/assets/github-sidebar-model-DcMu-IK2.js +0 -1
- package/web/dist/assets/highlighter-CdHqIwFr.js +0 -3
- package/web/dist/assets/index-CatemBEL.js +0 -8
- package/web/dist/assets/index-MvfD8bZJ.css +0 -1
- package/web/dist/assets/markdown-zdKeLIYA.js +0 -2
- package/web/dist/assets/mobile-run-bar-BCfmFi8V.js +0 -1
- package/web/dist/assets/prompt-templates-CBPp39IU.js +0 -15
- package/web/dist/assets/reference-chip-D6owncJT.js +0 -1
- package/web/dist/assets/repo-git-CtdkZFey.js +0 -1
- package/web/dist/assets/run-header-BcjoDi0W.js +0 -1
- package/web/dist/assets/sheet-ChnYVrp1.js +0 -1
- package/web/dist/assets/skills-C8YKp2vr.js +0 -1
- package/web/dist/assets/task-changes-BW8YdWG8.js +0 -1
- package/web/dist/assets/task-commits-q2kB2y6L.js +0 -1
- package/web/dist/assets/task-files-pPL6_3Cr.js +0 -2
- package/web/dist/assets/task-github-item-BXF5R52U.js +0 -1
- package/web/dist/assets/task-thread-DtkFL3EC.js +0 -10
- package/web/dist/assets/textarea-DxlkE-Yd.js +0 -1
- package/web/dist/assets/token-metrics-DIAjrPlM.js +0 -1
- package/web/dist/assets/use-desktop-CrDny2uG.js +0 -1
- package/web/dist/assets/use-submit-shortcut-KWJsC906.js +0 -1
- package/web/dist/assets/workflows-TmcPEj2K.js +0 -11
- /package/web/dist/assets/{lib-BQXq3kEf2.js → lib-BQXq3kEf.js} +0 -0
|
@@ -1,15 +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{E as r,L as i,M as a,Rt as o,X as s,d as c,g as l,h as u,p as d}from"./alert-dialog-C-xYE_dg.js";import{O as f,t as p}from"./utils-fzNfbPzA.js";import{t as m}from"./createLucideIcon-BHp8sXmF.js";import{c as h,i as ee,p as g,r as te,s as _,t as v}from"./dropdown-menu-Ch5BYQh_.js";import{i as y,n as b,o as x,r as S,s as C}from"./textarea-DxlkE-Yd.js";var w=m(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),T=m(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),E=e(t(),1),D=`quick-task`;function O(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var k=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`},{id:`cursor`,label:`Cursor`,desc:`Cursor CLI (ACP)`}],A={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],cursor:[{id:``,label:`auto`,desc:`Use your Cursor default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`}]},j=[{value:``,label:`auto`,desc:`Harness default`},{value:`low`,label:`low`,desc:`Less reasoning, faster replies`},{value:`medium`,label:`medium`,desc:`Balanced reasoning`},{value:`high`,label:`high`,desc:`More reasoning for hard tasks`},{value:`xhigh`,label:`xhigh`,desc:`Extra-high reasoning`},{value:`max`,label:`max`,desc:`Maximum reasoning`}];function M(e,t,n){let r=e===`cursor`?[j[0]]:j,i=f(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[j[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=j.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function N(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var P=[`opencode`,`pi`];function F(e,t){return t===`cursor`||!e||A[t].some(t=>t.id===e)?!1:t!==`claude`&&[`claude-fable-5`,`claude-opus-4-8`,`claude-sonnet-5`,`claude-haiku-4-5`].includes(e)?!0:Object.entries(A).some(([n,r])=>n!==t&&!P.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function I(e,t,n=[]){let r=t?.runner===e?t.models:[],i=A[e]??A.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(f(e))for(let e of r)!e.id||o.has(e.id)||(o.add(e.id),a.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||o.has(t)||F(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var ne={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`};function L(e,t,n=!1,r=!1){if(!f(e))return;let i=ne[e];if(t?.stale)return`Using cached ${i} model list`;if(n||t?.source===`unavailable`)return`Latest ${i} models unavailable`;if(r&&!t)return`Loading ${i} models…`}function re(e){let t=k.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function ie(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function ae(e,t,n=!1){return!n&&e===t?void 0:e}function oe(e,t,n,r){let i=I(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function se(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function ce(e,t,n){return e&&se(e,t,n)?e:null}function le(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,variants:u,images:d,worktree:f,autonomous:p,generateFollowups:m,todoId:h}=e;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:i?void 0:r||void 0,effort:i?void 0:a||void 0,runner:ae(o,c,s),agentProfile:l||void 0,variants:u>1?u:void 0,images:d.length>0?[...d]:void 0,worktree:f===!1&&u<=1?!1:void 0,autonomous:p===!0||void 0,generateFollowups:m!==!1&&void 0,todoId:h||void 0}}function ue(e,t){return t?{...e,notify:!0}:e}function de(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}var R=n(),z=`inline-flex h-[26px] min-w-0 max-w-full items-center gap-1.5 rounded-full border border-control-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:border-dashed disabled:bg-muted`,fe=(0,R.jsx)(s,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`}),pe=(0,E.createContext)(null),B=e=>Number.parseFloat(e)||0;function me({pill:e,box:t,full:n}){let r=getComputedStyle(e),i=[...e.children].filter(e=>{if(e===t)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.position!==`absolute`});return i.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+B(r.columnGap)*i.length+n.getBoundingClientRect().width+B(r.paddingLeft)+B(r.paddingRight)+B(r.borderLeftWidth)+B(r.borderRightWidth)}function he(e){for(let t=e.parentElement;t;t=t.parentElement){let e=getComputedStyle(t).display;if(e===`grid`||e===`flex`)return t}return e.parentElement}function ge(e){let t=new Map;for(let n of e){let e=he(n.pill),r=t.get(e)??new Map,i=Math.round(n.pill.getBoundingClientRect().top);r.set(i,[...r.get(i)??[],n]),t.set(e,r)}for(let[e,n]of t){let t=getComputedStyle(e),r=e.clientWidth-B(t.paddingLeft)-B(t.paddingRight);for(let e of n.values())if(e.reduce((e,t)=>e+me(t),0)+B(t.columnGap)*(e.length-1)>r+.5)return!1}return!0}function _e({children:e}){let t=(0,E.useRef)(new Map),n=(0,E.useRef)(null),[r,i]=(0,E.useState)(!0),a=(0,E.useCallback)(()=>i(ge([...t.current.values()])),[]),o=(0,E.useCallback)((e,r)=>{if(t.current.set(e,r),typeof ResizeObserver<`u`){n.current??=new ResizeObserver(a);for(let e of[r.box,r.full,he(r.pill)])n.current.observe(e)}return a(),()=>{if(t.current.delete(e),typeof ResizeObserver<`u`)for(let e of[r.box,r.full])n.current?.unobserve(e);a()}},[a]);(0,E.useLayoutEffect)(()=>()=>n.current?.disconnect(),[]);let s=(0,E.useMemo)(()=>({register:o,showPrefixes:r}),[o,r]);return(0,R.jsx)(pe.Provider,{value:s,children:e})}function ve({field:e,children:t}){let n=(0,E.useRef)(null),r=(0,E.useRef)(null),i=(0,E.useContext)(pe),a=i?.register,o=(0,E.useId)(),[s,c]=(0,E.useState)(!0);(0,E.useLayoutEffect)(()=>{let e=n.current,t=r.current;if(a){let n=e.closest(`[data-slot$="pill"]`);return n?a(o,{pill:n,box:e,full:t}):void 0}let i=()=>c(t.getBoundingClientRect().width<=e.getBoundingClientRect().width+.5);if(i(),typeof ResizeObserver>`u`)return;let s=new ResizeObserver(i);return s.observe(e),s.observe(t),()=>s.disconnect()},[e,t,o,a]);let l=i!==null,u=l?i.showPrefixes:s,d=l&&!u;return(0,R.jsxs)(`span`,{ref:n,className:`relative min-w-0 overflow-hidden`,"aria-hidden":`true`,children:[(0,R.jsxs)(`span`,{ref:r,className:p(`invisible w-max whitespace-nowrap`,d?`absolute left-0 top-0`:`block`),children:[e,` · `,t]}),(0,R.jsxs)(`span`,{"data-slot":`picker-label`,className:p(`block truncate`,d?`relative`:`absolute inset-0`),children:[u?(0,R.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,` · `]}):null,t]})]})}function ye({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:c=!1,readOnly:l=!1,hint:u,disabledHint:d,status:f,searchPlaceholder:m,icon:y,fieldLabel:b=!1}){let[x,S]=(0,E.useState)(!1),[C,w]=(0,E.useState)(``),T=(0,E.useRef)(null),D=(0,E.useRef)(null),O=m?i.filter(e=>e.label.toLowerCase().includes(C.trim().toLowerCase())):i;(0,E.useEffect)(()=>{if(!x||!m)return;let e=window.setTimeout(()=>T.current?.focus());return()=>window.clearTimeout(e)},[x,m]);let k=e=>{T.current&&document.activeElement===T.current&&e.preventDefault()},A=y?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,j=b?`${t} · ${typeof n==`string`?n:i.find(e=>e.value===r)?.label??r}`:t,M=l?d??u:c?d:u,N=b?[j,M].filter(Boolean).join(` — `):M,P=(0,R.jsxs)(R.Fragment,{children:[y,b?(0,R.jsx)(ve,{field:t,children:n}):(0,R.jsx)(`span`,{className:`min-w-0 truncate`,title:typeof n==`string`?n:void 0,children:n})]});if(l)return(0,R.jsxs)(`span`,{"data-slot":e,"aria-label":j,title:N,className:p(z,A,`cursor-default hover:bg-card hover:text-muted-foreground`),children:[P,b?(0,R.jsx)(`span`,{className:`sr-only`,children:j}):null]});let F=(0,R.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":j,disabled:c,title:N,className:p(z,A),children:[P,y?(0,R.jsx)(s,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):fe]});return c?(0,R.jsx)(`span`,{title:N,className:`inline-flex min-w-0 max-w-full`,children:F}):(0,R.jsxs)(v,{open:x,onOpenChange:e=>{S(e),e||w(``)},children:[(0,R.jsx)(g,{asChild:!0,children:F}),(0,R.jsxs)(te,{ref:D,align:`start`,"data-testid":`${e}-menu`,children:[m?(0,R.jsxs)(`div`,{className:`mb-1 flex min-h-11 items-center gap-2 border-b border-border px-2`,children:[(0,R.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`input`,{ref:T,type:`search`,"aria-label":m,placeholder:m,value:C,onChange:e=>w(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=D.current?.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`);(e.key===`ArrowDown`?t?.[0]:t?.[t.length-1])?.focus()}else e.key!==`Escape`&&e.stopPropagation()},className:`h-11 w-48 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}):null,(0,R.jsx)(_,{value:r,onValueChange:a,children:O.map(e=>(0,R.jsx)(h,{value:e.value,className:p(`gap-2.5`,m&&`min-h-11`),onPointerMove:k,onPointerLeave:k,onKeyDown:t=>{T.current&&(t.key===`ArrowUp`&&e===O[0]||t.key===`Tab`&&t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),T.current.focus())},children:(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,R.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.label}),e.desc?(0,R.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),m&&O.length===0?(0,R.jsx)(`p`,{role:`status`,className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:`No matches found.`}):null,f?(0,R.jsx)(ee,{disabled:!0,onPointerMove:k,onPointerLeave:k,className:`border-t border-border text-[11px] text-muted-foreground`,children:f}):null]})]})}var V=(e,t)=>t===null?e:`${e}:${t}`;function be({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=k.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:V(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:V(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),u=a??o?.[t]??`default`,d=l.some(e=>e.value===V(t,u))?V(t,u):V(t,null);return(0,R.jsx)(ye,{icon:s,fieldLabel:c,slot:`runner-pill`,ariaLabel:`Runner`,label:l.find(e=>e.value===d)?.label??t,value:d,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:l})}var xe=1,Se=.9,Ce=.8,we=.17,H=.1,U=.999,Te=.9999,Ee=.99,De=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ke=/[\s-]/,Ae=/[\s-]/g;function W(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?xe:Ee;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=W(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=xe:De.test(e.charAt(l-1))?(d*=Ce,p=e.slice(i,l-1).match(Oe),p&&i>0&&(d*=U**+p.length)):ke.test(e.charAt(l-1))?(d*=Se,m=e.slice(i,l-1).match(Ae),m&&i>0&&(d*=U**+m.length)):(d*=we,i>0&&(d*=U**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Te)),(d<H&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=W(e,t,n,r,l+1,a+2,o),f*H>d&&(d=f*H)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function je(e){return e.toLowerCase().replace(Ae,` `)}function Me(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,W(e,t,je(e),je(t),0,0,{})}var G=`[cmdk-group=""]`,K=`[cmdk-group-items=""]`,Ne=`[cmdk-group-heading=""]`,Pe=`[cmdk-item=""]`,Fe=`${Pe}:not([aria-disabled="true"])`,Ie=`cmdk-item-select`,q=`data-value`,Le=(e,t,n)=>Me(e,t,n),Re=E.createContext(void 0),J=()=>E.useContext(Re),ze=E.createContext(void 0),Be=()=>E.useContext(ze),Ve=E.createContext(void 0),He=E.forwardRef((e,t)=>{let n=Z(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),i=Z(()=>new Set),o=Z(()=>new Map),s=Z(()=>new Map),c=Z(()=>new Set),l=$e(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:ee,disablePointerSelection:g=!1,vimBindings:te=!0,..._}=e,v=r(),y=r(),b=r(),x=E.useRef(null),S=tt();X(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,C.emit()}},[f]),X(()=>{S(6,A)},[]);let C=E.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),S(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=j()?.id,C.emit()}),r||S(5,A),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),w=E.useMemo(()=>({value:(e,t,r)=>{t!==s.current.get(e)?.value&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{D(),C.emit()}))},item:(e,t)=>(i.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),S(3,()=>{k(),D(),n.current.value||O(),C.emit()}),()=>{s.current.delete(e),i.current.delete(e),n.current.filtered.items.delete(e);let t=j();S(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),C.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=l.current?.filter??Le;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=x.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(K);t?t.appendChild(e.parentElement===t?e:e.closest(`${K} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${K} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${G}[${q}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(q);C.setState(`value`,e||void 0)}function k(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of i.current){let r=T(s.current.get(t)?.value??``,s.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of o.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(G)?.querySelector(Ne))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return x.current?.querySelector(`${Pe}[aria-selected="true"]`)}function M(){return Array.from(x.current?.querySelectorAll(Fe)||[])}function N(e){let t=M()[e];t&&C.setState(`value`,t.getAttribute(q))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(q))}function F(e){let t=j()?.closest(G),n;for(;t&&!n;)t=e>0?Ze(t,G):Qe(t,G),n=t?.querySelector(Fe);n?C.setState(`value`,n.getAttribute(q)):P(e)}let I=()=>N(M().length-1),ne=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return E.createElement(a.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:te&&e.ctrlKey&&ne(e);break;case`ArrowDown`:ne(e);break;case`p`:case`k`:te&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(Ie);t.dispatchEvent(e)}}}}},E.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:rt},u),$(e,e=>E.createElement(ze.Provider,{value:C},E.createElement(Re.Provider,{value:w},e))))}),Ue=E.forwardRef((e,t)=>{let n=r(),o=E.useRef(null),s=E.useContext(Ve),c=J(),l=$e(e),u=l.current?.forceMount??s?.forceMount;X(()=>{if(!u)return c.item(n,s?.id)},[u]);let d=et(n,o,[e.value,e.children,o],e.keywords),f=Be(),p=Q(e=>e.value&&e.value===d.current),m=Q(e=>u||c.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);E.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(Ie,h),()=>t.removeEventListener(Ie,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;ee(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function ee(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:g,value:te,onSelect:_,forceMount:v,keywords:y,...b}=e;return E.createElement(a.div,{ref:i(o,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!p,"data-disabled":!!g,"data-selected":!!p,onPointerMove:g||c.getDisablePointerSelection()?void 0:ee,onClick:g?void 0:h},e.children)}),We=E.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:s,...c}=e,l=r(),u=E.useRef(null),d=E.useRef(null),f=r(),p=J(),m=Q(e=>s||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));X(()=>p.group(l),[]),et(l,u,[e.value,e.heading,d]);let h=E.useMemo(()=>({id:l,forceMount:s}),[s]);return E.createElement(a.div,{ref:i(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&E.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),$(e,e=>E.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},E.createElement(Ve.Provider,{value:h},e))))}),Ge=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=E.useRef(null),s=Q(e=>!e.search);return!n&&!s?null:E.createElement(a.div,{ref:i(o,t),...r,"cmdk-separator":``,role:`separator`})}),Ke=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=Be(),s=Q(e=>e.search),c=Q(e=>e.selectedItemId),l=J();return E.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),E.createElement(a.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),qe=E.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...o}=e,s=E.useRef(null),c=E.useRef(null),l=Q(e=>e.selectedItemId),u=J();return E.useEffect(()=>{if(c.current&&s.current){let e=c.current,t=s.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),E.createElement(a.div,{ref:i(s,t),...o,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},$(e,e=>E.createElement(`div`,{ref:i(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),Je=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return E.createElement(c,{open:n,onOpenChange:r},E.createElement(l,{container:o},E.createElement(u,{"cmdk-overlay":``,className:i}),E.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},E.createElement(He,{ref:t,...s}))))}),Ye=E.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?E.createElement(a.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Xe=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return E.createElement(a.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>E.createElement(`div`,{"aria-hidden":!0},e)))}),Y=Object.assign(He,{List:qe,Item:Ue,Input:Ke,Group:We,Separator:Ge,Dialog:Je,Empty:Ye,Loading:Xe});function Ze(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Qe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $e(e){let t=E.useRef(e);return X(()=>{t.current=e}),t}var X=typeof window>`u`?E.useEffect:E.useLayoutEffect;function Z(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=Be(),n=()=>e(t.snapshot());return E.useSyncExternalStore(t.subscribe,n,n)}function et(e,t,n,r=[]){let i=E.useRef(),a=J();return X(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(q,s),i.current=s}),i}var tt=()=>{let[e,t]=E.useState(),n=Z(()=>new Map);return X(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function nt(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(nt(t),{ref:t.ref},n(t.props.children)):n(t)}var rt={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function it({className:e,...t}){return(0,R.jsx)(Y,{"data-slot":`command`,className:p(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function at({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,filter:a,...o}){return(0,R.jsxs)(b,{...o,children:[(0,R.jsxs)(x,{className:`sr-only`,children:[(0,R.jsx)(C,{children:e}),(0,R.jsx)(y,{children:t})]}),(0,R.jsx)(S,{className:p(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,R.jsx)(it,{filter:a,className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function ot({className:e,...t}){return(0,R.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 shrink-0 items-center gap-2 border-b px-3 max-md:h-[44px]`,children:[(0,R.jsx)(o,{className:`size-4 shrink-0 opacity-50`}),(0,R.jsx)(Y.Input,{"data-slot":`command-input`,className:p(`flex h-10 w-full rounded-md bg-transparent py-3 text-base md:text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function st({className:e,onPointerMoveCapture:t,...n}){return(0,R.jsx)(Y.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:p(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ct({...e}){return(0,R.jsx)(Y.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function lt({className:e,...t}){return(0,R.jsx)(Y.Group,{"data-slot":`command-group`,className:p(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function ut({className:e,...t}){return(0,R.jsx)(Y.Separator,{"data-slot":`command-separator`,className:p(`-mx-1 h-px bg-border`,e),...t})}function dt({className:e,...t}){return(0,R.jsx)(Y.Item,{"data-slot":`command-item`,className:p(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function ft({className:e,...t}){return(0,R.jsx)(`span`,{"data-slot":`command-shortcut`,className:p(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var pt=80,mt=2e3,ht=50,gt=200,_t=50,vt=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`}];function yt(e){return!!e&&typeof e==`object`}function bt(e){if(e===void 0||!Array.isArray(e))return vt.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!yt(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=xt(r.skills);if(n.push({id:e,label:i.slice(0,pt),text:a.slice(0,mt),...o.length>0?{skills:o}:{}}),n.length>=ht)break}return n}function xt(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,gt)),t.size>=_t))break}return[...t]}function St(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function Ct(e,t){return St(e,t).map(e=>e.text).join(`
|
|
2
|
-
|
|
3
|
-
`)}function wt(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function Tt(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Et(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
|
|
4
|
-
|
|
5
|
-
`)?``:i.endsWith(`
|
|
6
|
-
`)?`
|
|
7
|
-
`:`
|
|
8
|
-
|
|
9
|
-
`);let s=a.replace(/^[ \t]+/,``),c=``;return s.length>0&&(c=s.startsWith(`
|
|
10
|
-
|
|
11
|
-
`)?``:s.startsWith(`
|
|
12
|
-
`)?`
|
|
13
|
-
`:`
|
|
14
|
-
|
|
15
|
-
`),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}function Dt({prompt:e,base:t,selectionStart:n,focused:r,remembered:i}){return e===t?e.length:r&&n!=null||n!=null&&n>0?n:i??e.length}export{N as A,k as C,L as D,M as E,de as F,ue as I,T as L,ie as M,ce as N,I as O,ae as P,w as R,D as S,le as T,ye as _,bt as a,fe as b,it as c,lt as d,ot as f,ft as g,ut as h,Tt as i,oe as j,O as k,at as l,st as m,Ct as n,wt as o,dt as p,Et as r,Dt as s,vt as t,ct as u,_e as v,re as w,z as x,be 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{$ as r,Q as i,Qn as a,Ua as o,Yt as s,bt as c,et as l,hi as u,kt as d,mi as f,nt as p,tt as m,u as h,vt as g,xt as _,yt as v}from"./alert-dialog-C-xYE_dg.js";import{n as y,t as b}from"./utils-fzNfbPzA.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{i as S,n as C,r as w}from"./use-desktop-CrDny2uG.js";var T=x(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),E=x(`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`}]]),D=e(t(),1),O=n(),k=h(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function A({className:e,tone:t=`neutral`,shape:n=`filled`,pulse:r=!1,...i}){return(0,O.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":n,className:b(k({tone:t,shape:n,pulse:r,className:e})),...i,children:n===`workers`?(0,O.jsx)(T,{className:`size-[12px]`,"aria-hidden":`true`}):null})}var j=(0,D.createContext)(null);function M({children:e}){let[t,n]=(0,D.useState)(()=>new Map),r=(0,D.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,D.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=a((0,D.useMemo)(()=>[...t.values()].flat(),[t])),s=(0,D.useMemo)(()=>({publish:r,retract:i,lookup:o}),[r,i,o]);return(0,O.jsx)(j.Provider,{value:s,children:e})}var N=(0,D.createContext)(null);function P({projectId:e,repoBase:t,requests:n,children:r}){let i=(0,D.useContext)(j),o=(0,D.useContext)(N),s=(0,D.useId)();(0,D.useEffect)(()=>{if(i)return i.publish(s,n),()=>i.retract(s)},[i,s,n.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let c=a(i?F:n),l=i?.lookup??c,u=t??(o&&o.projectId===e?o.repoBase:void 0),d=(0,D.useMemo)(()=>({lookup:l,projectId:e,repoBase:u}),[l,e,u]);return(0,O.jsx)(N.Provider,{value:d,children:r})}var F=[];function I(e,t,n){let r=(0,D.useContext)(N),i=n??r?.projectId;return!r||!i||t===void 0?R:r.lookup({projectId:i,kind:e,number:t})}function L(){let e=(0,D.useContext)(N);return{projectId:e?.projectId,repoBase:e?.repoBase}}var R=Object.freeze({state:`idle`}),z={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,accent:`border-accent-strong/35 text-accent-text`,merged:`border-merged-strong/35 text-merged-text`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},B={success:`text-success`,danger:`text-danger`,accent:`text-merged-text`,merged:`text-merged-text`,info:`text-info`,neutral:`text-soft-foreground`,pending:`text-pending-strong`,conflict:`text-conflict`},V={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,accent:`hover:bg-accent-strong/10`,merged:`hover:bg-merged-strong/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},H={draft:c,"review-required":_,"changes-requested":d,"checks-pending":null,"checks-failing":p,ready:i,merged:g,closed:v,open:r,completed:i,"not-planned":m};function U({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:i,projectId:a,to:o,className:c,compact:l=!1,plain:d=!1,inert:p=!1}){let{kind:m,number:h,url:g}=e,_=I(m,h,a),v=n??_.status,x=u(v),S=m===`PR`&&(r??_.conflicting)===!0,C=S?f:x,w=d?b(`inline-flex items-center gap-1 rounded-[2px] text-inherit`,S&&`text-conflict font-medium`,!p&&`group/reference focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground`,c):b(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[12px] font-normal`,z[C?.tone??`accent`],c),T=X(_,C,S?x:void 0),E=d?h?`${m===`PR`?`PR `:``}#${h}`:m:h?`${!l&&m===`Issue`?`Issue `:``}#${h}`:m,D=m===`PR`?`pull request`:`issue`,k=`Open the ${D} for ${t}${C?` — ${C.label}`:``}`,A=d&&C?B[C.tone]:void 0,j=(0,O.jsxs)(O.Fragment,{children:[S?(0,O.jsx)(s,{className:b(`size-2.5 shrink-0`,A),"aria-hidden":`true`}):(0,O.jsx)($,{status:C?v:void 0,className:d?b(`size-2.5`,A):void 0}),d?(0,O.jsx)(`span`,{className:p?void 0:`underline-offset-2 group-hover/reference:underline group-focus-visible/reference:underline`,children:E}):E]});if(d&&p)return(0,O.jsx)(`span`,{"data-slot":m===`PR`?`pr-chip`:`issue-chip`,"data-status":v,"data-inert":`true`,...S?{"data-conflicting":`true`}:{},className:w,children:j});let M=!o&&(!g||!y(g))?(0,O.jsx)(`span`,{"data-slot":m===`PR`?`pr-chip`:`issue-chip`,"data-status":v,...S?{"data-conflicting":`true`}:{},"aria-label":C?`${D} ${E} — ${C.label}`:void 0,className:w,children:j}):(0,O.jsx)(W,{to:o,url:g,"data-slot":m===`PR`?`pr-chip`:`issue-chip`,"data-status":v,...S?{"data-conflicting":`true`}:{},title:T?void 0:g,"aria-label":k,className:d?w:b(w,V[C?.tone??`accent`]),children:j});if(!T)return M;let N=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`block font-medium`,children:[m===`PR`?`Pull request`:`Issue`,h?` #${h}`:``,` · `,T.headline]}),(0,O.jsx)(`span`,{className:`block`,children:T.detail}),T.also?(0,O.jsx)(`span`,{className:`block opacity-70`,children:T.also}):null,g&&y(g)?(0,O.jsx)(`span`,{className:`block opacity-70`,children:g.replace(/^https?:\/\//,``)}):null]});return(0,O.jsx)(Y,{chip:M,action:S?i:void 0,state:_.state,children:N})}function W({to:e,url:t,children:n,...r}){return e?(0,O.jsx)(o,{to:e,...r,children:n}):(0,O.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,...r,children:n})}var G=(0,D.createContext)(()=>{});function K(){return(0,D.useContext)(G)}var q=150,J=120;function Y({chip:e,action:t,state:n,children:r}){let[i,a]=(0,D.useState)(!1),o=(0,D.useRef)(null),s=(0,D.useRef)(null),c=(0,D.useRef)(void 0),l=(0,D.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,D.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,D.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,O.jsxs)(C,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,O.jsx)(w,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,q)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,J)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,O.jsxs)(S,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,J)},children:[(0,O.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,O.jsx)(G.Provider,{value:u,children:t}):null]})]})}function X(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${Z(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function Z(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Q({kind:e,number:t,className:n}){let r=I(e,t),i=u(r.status),a=e===`PR`&&r.conflicting===!0,o=a?f:i;if(!o)return null;let c=b(`size-2.5`,B[o.tone]);return(0,O.jsx)(`span`,{"data-slot":`reference-status-glyph`,"data-status":r.status,...a?{"data-conflicting":`true`}:{},"aria-hidden":`true`,className:b(`inline-flex items-center`,n),children:a?(0,O.jsx)(s,{className:b(`shrink-0`,c),"aria-hidden":`true`}):(0,O.jsx)($,{status:r.status,className:c})})}function $({status:e,className:t}){if(!e)return null;if(e===`checks-pending`)return(0,O.jsx)(l,{"data-slot":`status-dot`,"data-tone":`pending`,className:b(`size-3 animate-pulse motion-reduce:animate-none`,t),"aria-hidden":`true`});let n=H[e];return n?(0,O.jsx)(n,{className:b(`size-2.5 shrink-0`,t),"aria-hidden":`true`}):null}export{M as a,A as c,P as i,E as l,Q as n,L as o,K as r,I as s,U as t,T as u};
|
|
@@ -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{Ca as r,H as i,Ii as a,In as o,J as s,Jt as c,Lt as l,Nr as u,Pa as d,Ri as f,Sa as p,U as m,Ur as h,Yt as g,Z as _,_t as v,a as y,ar as b,c as x,ft as S,gt as C,hi as w,i as T,in as E,ir as D,it as ee,l as te,lt as O,mo as ne,n as k,no as re,o as A,or as ie,r as j,ro as M,s as N,so as P,sr as ae,st as oe,t as F,to as se,ua as ce,vt as le,yi as I,yr as ue,z as L}from"./alert-dialog-C-xYE_dg.js";import{s as R,t as z}from"./utils-fzNfbPzA.js";import{t as B}from"./createLucideIcon-BHp8sXmF.js";import{c as de,i as fe,s as pe,t as me}from"./reference-chip-D6owncJT.js";import{l as he,n as ge,y as _e}from"./nav-row-styles-3j64kH5s.js";import{n as V}from"./diff-controls-Bj0YrioE.js";import{i as ve,r as ye,t as be}from"./git-toolbar-ClVvf5iF.js";import{t as H}from"./use-desktop-CrDny2uG.js";import{t as U}from"./info-DA1x_4bz.js";import{f as xe,n as W,r as G}from"./format-dBiNDNVe.js";import{t as Se}from"./search-x-I9Q8pgUa.js";import{i as K,l as Ce,p as we,r as Te,t as Ee}from"./dropdown-menu-Ch5BYQh_.js";import{t as De}from"./diff-stat-BKDCSVfJ.js";import{C as q,I as Oe,L as J,S as ke,a as Ae,c as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,l as Le,m as Re,o as ze,p as Be,r as Ve,s as He,u as Ue,w as We}from"./index-CatemBEL.js";import{t as Y}from"./diff-rE8rm75J2.js";var X=e(t(),1);function Ge(e,t){let n=P(t),r=n.getQueryCache();return X.useSyncExternalStore(X.useCallback(e=>r.subscribe(ne.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}var Ke=B(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),qe=B(`git-pull-request-create`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v3`,key:`1jb6z3`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),Z=n();function Je(){let e=R(),t=D(),n=P(),r=Ge({queryKey:E.repo})>0,i=t.data?.info?t.data:null,a=Ve(e,i,`screen`);return(0,Z.jsxs)(`div`,{"data-route":`repo-git`,"data-slot":`git-screen`,className:ge,children:[(0,Z.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,Z.jsx)(`h1`,{className:z(he,`min-w-0 flex-1`),children:`Git`}),(0,Z.jsx)(`button`,{type:`button`,"data-slot":`git-screen-refresh`,"aria-label":`Refresh the repository`,title:`Refresh the repository`,disabled:r,onClick:()=>{n.invalidateQueries({queryKey:E.repo}),n.invalidateQueries({queryKey:E.worktrees})},className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,Z.jsx)(l,{size:17,"aria-hidden":`true`,className:z(`size-[17px]`,r&&`motion-safe:animate-spin`)})})]}),i?.info?(0,Z.jsx)(`div`,{className:`mb-[16px]`,children:(0,Z.jsx)(je,{scope:e,repo:i,info:i.info,variant:`screen`},e)}):t.isPending?(0,Z.jsx)(`p`,{"data-slot":`git-screen-loading`,role:`status`,className:`mb-[16px] px-[10px] text-[13px] text-soft-foreground`,children:`Loading the checkout…`}):t.isError?(0,Z.jsxs)(`p`,{"data-slot":`git-screen-error`,role:`alert`,className:`mb-[16px] px-[10px] text-[13px] text-danger`,children:[`Could not load the repository: `,t.error.message]}):(0,Z.jsx)(`p`,{"data-slot":`git-screen-not-git`,className:`mb-[16px] px-[10px] text-[13px] text-soft-foreground`,children:`Not a git repository.`}),t.isPending?null:(0,Z.jsx)(ze,{branch:i?.info?.branch??null,counts:a,variant:`screen`})]})}function Ye(){let e=ie(),t=H(),[n,r]=(0,X.useState)(`unified`),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(null),c=(0,X.useRef)(null),l=e.isError&&e.error instanceof I&&e.error.status===409,u=e.data?.files??[],d=(0,X.useMemo)(()=>ye(u),[u]),f=t?n:`unified`,p=!t||i;return(0,Z.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:e.data?`${e.data.stat.files} files changed ·`:`Uncommitted changes`}),e.data?(0,Z.jsx)(be,{stat:e.data.stat}):null,(0,Z.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,Z.jsx)(V,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})})]}),e.isPending?(0,Z.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,Z.jsx)(L,{icon:l?(0,Z.jsx)(O,{size:16}):(0,Z.jsx)(g,{size:16}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):u.length===0?(0,Z.jsx)(L,{icon:(0,Z.jsx)(O,{size:16}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:1rem] md:px-9`,children:[(0,Z.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 lg:w-[250px]`,children:[(0,Z.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Z.jsx)(ve,{root:d,selected:o,onSelect:e=>{s(e),c.current?.scrollToPath(e)}})]}),(0,Z.jsx)(Y,{files:u,viewRef:c,mode:f,wrap:p,className:`min-w-0 flex-1`})]})]})}function Xe({repo:e,info:t}){let{sha:n}=se(),r=e.log,i=(0,X.useMemo)(()=>Fe(r),[r]);if(n)return(0,Z.jsx)($e,{sha:n});let a=Be(e,t),o=a&&a.behind>0?(0,Z.jsx)(Qe,{info:t,tracking:a}):null;return r.length===0?(0,Z.jsxs)(Z.Fragment,{children:[o?(0,Z.jsx)(`div`,{className:`px-[8px] pt-[12px] md:px-[20px]`,children:o}):null,(0,Z.jsx)(L,{icon:(0,Z.jsx)(v,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`})]}):(0,Z.jsxs)(`div`,{"data-slot":`repo-commits`,className:`flex flex-col gap-[2px] px-[8px] pt-[12px] pb-[20px] md:px-[20px]`,children:[o,i.map(e=>(0,Z.jsxs)(`section`,{"data-slot":`repo-commit-day`,"aria-label":e.label,className:`flex flex-col`,children:[(0,Z.jsx)(`h2`,{className:`px-[10px] pt-[14px] pb-[4px] text-[11px] font-medium text-soft-foreground`,children:e.label}),(0,Z.jsx)(`ul`,{className:`flex flex-col`,children:e.commits.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-[52px] items-center gap-[14px] rounded-[6px] hover:bg-sidebar-row-hover`,children:[(0,Z.jsxs)(G,{to:`/git/commits/${e.hash}`,"data-slot":`commit-row`,"data-sha":e.hash,className:`flex min-h-[52px] min-w-0 flex-1 flex-col justify-center gap-[3px] rounded-[6px] px-[10px] py-[6px] focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Z.jsx)(`span`,{"data-slot":`commit-row-subject`,className:`truncate text-[13px] text-foreground`,children:e.subject}),(0,Z.jsxs)(`span`,{"data-slot":`commit-row-meta`,className:`flex min-w-0 items-center gap-[6px] text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono`,children:e.hash}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`· `,e.author,` · `,Pe(e.when)]})]})]}),(0,Z.jsx)(Ze,{source:e.source})]},e.hash))})]},e.label))]})}function Ze({source:e}){let t=`hidden max-w-[45%] shrink-0 items-center gap-[5px] pr-[10px] text-[11.5px] text-soft-foreground md:flex`;return e?(0,Z.jsxs)(G,{to:`/tasks/${e.runId}`,"data-slot":`commit-source`,"data-source":`task`,"aria-label":`From the task ${e.title}${e.prNumber===null?``:`, pull request #${e.prNumber}`}`,className:z(t,`rounded-[4px] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`),children:[e.prNumber===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(le,{"aria-hidden":`true`,className:`size-[11px] shrink-0 text-merged-text`}),(0,Z.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[`PR #`,e.prNumber]})]}),(0,Z.jsx)(s,{"aria-hidden":`true`,className:`size-[12px] shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]}):(0,Z.jsx)(`span`,{"data-slot":`commit-source`,"data-source":`unknown`,className:t,children:`no task found`})}function Qe({info:e,tracking:t}){let n=Ue(R(),e),r=(0,X.useRef)(null);return(0,Z.jsxs)(`div`,{"data-slot":`git-incoming`,className:`mb-[4px] flex min-h-[40px] items-center gap-[8px] rounded-[8px] border border-border px-[10px] py-[6px]`,children:[(0,Z.jsx)(Ke,{"aria-hidden":`true`,className:`size-[14px] shrink-0 text-inbox-count-foreground`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 text-[12.5px] text-muted-foreground`,children:[t.behind,` commit`,t.behind===1?``:`s`,` on `,t.ref,` `,t.behind===1?`is`:`are`,` not in your checkout yet`]}),(0,Z.jsxs)(`button`,{ref:r,type:`button`,"data-action":`repo-pull-incoming`,disabled:!n.hasRemote||n.pulling,onClick:()=>void n.pull(),className:`inline-flex h-[26px] shrink-0 items-center gap-[4px] rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:h-11 [&>svg]:size-[12px]`,children:[n.pulling?(0,Z.jsx)(xe,{"aria-hidden":`true`,className:`motion-safe:animate-spin`}):(0,Z.jsx)(i,{"aria-hidden":`true`}),`Pull`]}),(0,Z.jsx)(Le,{checkout:n,returnFocus:r})]})}function $e({sha:e}){let t=ae(e),n=H(),[r,i]=(0,X.useState)(`unified`),[a,o]=(0,X.useState)(!1),s=t.isError&&t.error instanceof I&&t.error.status===409,c=n?r:`unified`,l=!n||a;return(0,Z.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,Z.jsx)(te,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,Z.jsxs)(G,{to:n?`/git`:Me,children:[(0,Z.jsx)(m,{size:16,"aria-hidden":`true`}),`All recent commits`]})}),t.data?(0,Z.jsx)(De,{stat:t.data.stat}):null,(0,Z.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,Z.jsx)(V,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,Z.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,Z.jsx)(L,{icon:s?(0,Z.jsx)(Se,{}):(0,Z.jsx)(g,{size:16}),tone:s?`neutral`:`danger`,heading:`h2`,title:s?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,Z.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,Z.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,Z.jsx)(L,{icon:(0,Z.jsx)(v,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,Z.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:1rem] md:px-6`,children:(0,Z.jsx)(Y,{files:t.data.files,mode:c,wrap:l,className:`min-w-0`})})]})]})}var Q=`Squash-merged branches may show as not landed without GitHub`;function et(e){let t=[],n=[],r=[];for(let i of e)if(i.class===`orphan`)r.push(i);else if(i.class!==`not-landed`)continue;else i.pr&&(i.pr.state===`open`||i.pr.state===`draft`)?n.push(i):t.push(i);return[{key:`no-pr`,title:`No pull request`,note:`nobody sees this work until you act`,rows:t},{key:`pr-open`,title:`Pull request open`,rows:n},{key:`deleted`,title:`Task deleted`,note:`this branch is the only copy of the work`,rows:r}].filter(e=>e.rows.length>0)}function tt(e){return e.filter(e=>e.class===`active`&&e.runId!==null&&e.ahead>0&&(e.runStatus===`done`||e.runStatus===`failed`||e.runStatus===`cancelled`)).length}var nt={done:`success`,failed:`danger`,cancelled:`neutral`};function rt(){let e=b(),t=ue(),n=R(),[r,i]=(0,X.useState)(null);if(e.isPending)return(0,Z.jsx)(`p`,{"data-slot":`not-landed-loading`,role:`status`,className:`px-[28px] py-[20px] text-[13px] text-soft-foreground`,children:`Loading branches…`});if(e.isError)return(0,Z.jsx)(L,{icon:(0,Z.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not classify the branches`,subtitle:e.error.message});let a=et(e.data.branches),o=tt(e.data.branches),s=o>0?(0,Z.jsxs)(`p`,{"data-slot":`not-landed-retained`,className:`flex items-start gap-[6px] px-[10px] pt-[6px] text-[11.5px] leading-[17px] text-soft-foreground`,children:[(0,Z.jsx)(U,{"aria-hidden":`true`,className:`mt-[2.5px] size-[12px] shrink-0`}),(0,Z.jsxs)(`span`,{children:[o,` finished task`,o===1?` still has its`:`s still have their`,` worktree and commits not on the base, so `,o===1?`it is`:`they are`,` not listed here.`,` `,`They show here once the worktree is reclaimed in `,(0,Z.jsx)(G,{to:Ne.cleanup,className:`underline underline-offset-2 hover:text-foreground`,children:`Cleanup`}),`.`]})]}):null,c=new Map((t.data??[]).map(e=>[e.id,e.finishedAt]));return(0,Z.jsxs)(fe,{projectId:n,requests:a.flatMap(e=>e.rows).flatMap(e=>e.pr?[{projectId:n,kind:`PR`,number:e.pr.number}]:[]),children:[(0,Z.jsxs)(`div`,{"data-slot":`repo-not-landed`,className:`flex flex-col gap-[2px] px-[8px] pt-[12px] pb-[calc(90px+env(safe-area-inset-bottom))] md:px-[20px] md:pb-[20px]`,children:[e.data.prStateKnown?null:(0,Z.jsx)(it,{}),s,a.length===0?(0,Z.jsx)(L,{icon:(0,Z.jsx)(Oe,{size:16}),tone:`neutral`,heading:`h2`,title:o>0?`Nothing else waiting to land`:`Everything landed`,subtitle:o>0?`Every other finished task's commits are on the base branch, or it made none.`:`Every finished task's commits are on the base branch, or it made none.`}):(0,Z.jsxs)(Z.Fragment,{children:[a.map(e=>(0,Z.jsxs)(`section`,{"data-slot":`not-landed-group`,"data-group":e.key,"aria-label":e.title,className:`flex flex-col`,children:[(0,Z.jsxs)(`h2`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-[6px] px-[10px] pt-[14px] pb-[6px] text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,Z.jsx)(`span`,{children:e.rows.length}),e.note?(0,Z.jsxs)(`span`,{children:[`· `,e.note]}):null]}),(0,Z.jsx)(`ul`,{className:`flex flex-col`,children:e.rows.map(e=>(0,Z.jsx)(at,{entry:e,finishedAt:e.runId?c.get(e.runId):void 0,onDelete:()=>i(e)},e.name))})]},e.key)),(0,Z.jsxs)(`p`,{"data-slot":`not-landed-note`,className:`flex items-start gap-[6px] px-[10px] pt-[14px] text-[11.5px] leading-[17px] text-soft-foreground`,children:[(0,Z.jsx)(U,{"aria-hidden":`true`,className:`mt-[2.5px] size-[12px] shrink-0`}),`Delete branch is in each row's … menu. It confirms and names the commits it drops. Nothing on this list can be bulk-deleted.`]})]})]}),(0,Z.jsx)(st,{entry:r,onClose:()=>i(null)})]})}function it({className:e}){return(0,Z.jsxs)(`p`,{"data-slot":`git-no-forge`,className:z(`flex items-start gap-[6px] px-[10px] pt-[6px] text-[11.5px] leading-[17px] text-soft-foreground`,e),children:[(0,Z.jsx)(U,{"aria-hidden":`true`,className:`mt-[2.5px] size-[12px] shrink-0`}),Q,`.`]})}function at({entry:e,finishedAt:t,onDelete:n}){let r=P(),i=e.class===`orphan`,o=e.pr&&(e.pr.state===`open`||e.pr.state===`draft`)?e.pr:null,s=!i&&e.runId!==null&&!o,c=i?`No task · last commit “${e.lastCommit.subject}”`:e.title??e.name,l=W(t??e.lastCommit.at),u=i||!e.runStatus?l?`${l} ago`:``:`${e.runStatus}${l?` ${l} ago`:``}`,f=M({mutationFn:()=>a(e.runId),onSuccess:e=>{d(`Draft PR created — ${e.url}`),r.invalidateQueries({queryKey:E.repoBranches}),r.invalidateQueries({queryKey:E.runs.all})},onError:e=>d(e instanceof I&&e.manual?`${e.message} — ${e.manual}`:e.message,{tone:`danger`})}),p=()=>void navigator.clipboard.writeText(e.name).then(()=>d(`Copied ${e.name}`),()=>d(`Could not copy the branch name`,{tone:`danger`})),m=`inline-flex h-[28px] shrink-0 items-center gap-[5px] rounded-[6px] px-[10px] text-[12px] font-medium text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 [&>svg]:size-[12px]`;return(0,Z.jsxs)(`li`,{"data-slot":`not-landed-row`,"data-branch":e.name,"data-branch-class":e.class,className:`flex min-h-[56px] items-center gap-[12px] rounded-[6px] px-[10px] py-[6px] hover:bg-sidebar-row-hover`,children:[(0,Z.jsx)(`span`,{className:`flex size-[12px] shrink-0 items-center justify-center`,children:i?(0,Z.jsx)(_e,{"aria-label":`Task deleted`,className:`size-[12px] text-soft-foreground`}):(0,Z.jsx)(de,{tone:e.runStatus&&nt[e.runStatus]||`neutral`,"aria-label":e.runStatus??void 0})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[3px]`,children:[e.runId?(0,Z.jsx)(G,{to:`/tasks/${e.runId}`,"data-slot":`not-landed-title`,className:`min-w-0 truncate rounded-[2px] text-[13px] text-foreground hover:underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-ring`,children:c}):(0,Z.jsx)(`span`,{"data-slot":`not-landed-title`,className:`min-w-0 truncate text-[13px] text-muted-foreground`,title:c,children:c}),(0,Z.jsxs)(`span`,{"data-slot":`not-landed-meta`,className:`flex min-w-0 items-center gap-[6px] text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:e.name}),(0,Z.jsxs)(`span`,{className:`shrink-0`,children:[`· `,e.ahead,` commit`,e.ahead===1?``:`s`]}),e.diffStat?(0,Z.jsxs)(`span`,{className:`flex shrink-0 gap-[4px] tabular-nums`,children:[(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.diffStat.additions]}),(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.diffStat.deletions]})]}):null,u?(0,Z.jsxs)(`span`,{className:`truncate`,children:[`· `,u]}):null]})]}),e.pr?(0,Z.jsxs)(`span`,{"data-slot":`not-landed-pr`,className:`hidden shrink-0 items-center gap-[4px] text-[11.5px] text-muted-foreground md:flex`,children:[(0,Z.jsx)(me,{plain:!0,reference:{kind:`PR`,number:e.pr.number,url:e.pr.url},taskTitle:e.title??e.name,status:e.pr.state===`draft`?`draft`:e.pr.state===`closed`?`closed`:void 0}),(0,Z.jsx)(ot,{entry:e})]}):null,e.runId?(0,Z.jsx)(G,{to:`/tasks/${e.runId}`,"data-action":`not-landed-open`,className:z(m,`hidden border border-border hover:bg-muted md:inline-flex`),children:`Open task`}):null,s?(0,Z.jsxs)(`button`,{type:`button`,"data-action":`not-landed-create-pr`,disabled:f.isPending,onClick:()=>f.mutate(),className:z(m,`hidden bg-muted hover:brightness-110 md:inline-flex`),children:[(0,Z.jsx)(qe,{"aria-hidden":`true`}),f.isPending?`Creating…`:`Create draft PR`]}):null,i?(0,Z.jsxs)(`button`,{type:`button`,"data-action":`not-landed-copy`,onClick:p,className:z(m,`hidden border border-border hover:bg-muted md:inline-flex`),children:[(0,Z.jsx)(ee,{"aria-hidden":`true`}),`Copy branch`]}):null,(0,Z.jsxs)(Ee,{children:[(0,Z.jsx)(we,{"data-action":`not-landed-more`,"aria-label":`More actions for ${e.name}`,className:`flex size-[28px] shrink-0 items-center justify-center rounded-[6px] text-soft-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:size-11`,children:(0,Z.jsx)(oe,{"aria-hidden":`true`,className:`size-[14px]`})}),(0,Z.jsxs)(Te,{align:`end`,className:`w-52`,children:[e.runId?(0,Z.jsx)(K,{asChild:!0,className:`md:hidden`,children:(0,Z.jsx)(G,{to:`/tasks/${e.runId}`,children:`Open task`})}):null,s?(0,Z.jsx)(K,{className:`md:hidden`,disabled:f.isPending,onSelect:()=>f.mutate(),children:`Create draft PR`}):null,(0,Z.jsx)(K,{className:z(!i&&`md:hidden`),onSelect:p,children:`Copy branch`}),(0,Z.jsx)(Ce,{className:`md:hidden`}),(0,Z.jsx)(K,{"data-action":`not-landed-delete`,variant:`destructive`,onSelect:n,children:`Delete branch…`})]})]})]})}function ot({entry:e}){let t=w(pe(`PR`,e.pr?.number).status),n=e.pr?.state;return(0,Z.jsxs)(`span`,{"data-slot":`not-landed-pr-state`,children:[`· `,n===`draft`||n===`closed`?n:t?t.label.toLowerCase():`open`]})}function st({entry:e,onClose:t}){let n=P(),[r,i]=(0,X.useState)(``),a=(0,X.useId)(),o=M({mutationFn:e=>f({names:[e],confirm:e}),onSuccess:e=>{let t=e.dropped?.length??0;d(e.deleted.length>0?`Deleted ${e.deleted[0]}${t?` and ${t} commit${t===1?``:`s`} with it`:``}`:e.refused[0]?.reason??`Nothing was deleted`),n.invalidateQueries({queryKey:E.repo}),s()},onError:e=>d(e.message,{tone:`danger`})}),s=()=>{i(``),t()},c=e!==null&&r.trim()===e.name,l=e?`${e.ahead} commit${e.ahead===1?``:`s`}`:``;return(0,Z.jsx)(F,{open:e!==null,onOpenChange:e=>!e&&!o.isPending&&s(),children:(0,Z.jsxs)(T,{"data-slot":`delete-branch-dialog`,children:[(0,Z.jsxs)(N,{children:[(0,Z.jsxs)(x,{children:[`Delete `,e?.name,`?`]}),(0,Z.jsx)(y,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(`p`,{children:e?.class===`orphan`?`Its task was deleted, so this branch is the only copy of the work.`:(0,Z.jsxs)(Z.Fragment,{children:[`This drops the work of `,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:e?.title??e?.name}),`. It is not on the base branch`,e?.pr?``:` and no pull request carries it`,`.`]})}),(0,Z.jsxs)(`p`,{"data-slot":`delete-branch-dropped`,children:[l,` will be dropped`,e?.diffStat?` (+${e.diffStat.additions} −${e.diffStat.deletions})`:``,`, the latest “`,e?.lastCommit.subject,`”`,` `,`(`,(0,Z.jsx)(`span`,{className:`font-mono`,children:e?.lastCommit.sha.slice(0,7)}),`).`]})]})})]}),(0,Z.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),c&&e&&o.mutate(e.name)},className:`flex flex-col gap-[6px]`,children:[(0,Z.jsxs)(`label`,{htmlFor:a,className:`text-[12.5px] text-muted-foreground`,children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono text-foreground`,children:e?.name}),` to confirm`]}),(0,Z.jsx)(We,{id:a,"data-slot":`delete-branch-confirm`,autoComplete:`off`,spellCheck:!1,value:r,onChange:e=>i(e.target.value),className:`h-11 font-mono`})]}),(0,Z.jsxs)(A,{children:[(0,Z.jsx)(j,{className:`h-11`,disabled:o.isPending,children:`Keep it`}),(0,Z.jsx)(k,{"data-action":`delete-branch-confirm`,className:`h-11 bg-danger text-danger-foreground hover:brightness-[0.96]`,disabled:!c||o.isPending,onClick:t=>{t.preventDefault(),c&&e&&o.mutate(e.name)},children:o.isPending?`Deleting…`:`Delete branch`})]})]})})}function ct({base:e}){let t=b(),n=P(),[r,i]=(0,X.useState)({merged:!1,empty:!1}),[a,o]=(0,X.useState)(!1),s=(t.data?.branches??[]).filter(e=>e.class===`merged`),l=(t.data?.branches??[]).filter(e=>e.class===`empty`),u=[...s,...l],p=M({mutationFn:e=>f({names:e}),onSuccess:e=>{let t=e.refused.length;d(`Deleted ${e.deleted.length} branch${e.deleted.length===1?``:`es`}${t?`; kept ${t} that ${t===1?`is`:`are`} no longer safe to delete`:``}`),n.invalidateQueries({queryKey:E.repo})},onError:e=>{n.invalidateQueries({queryKey:E.repo}),d(e.message,{tone:`danger`})}});if(t.isPending)return(0,Z.jsx)(`p`,{"data-slot":`cleanup-branches-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading branches…`});if(t.isError)return(0,Z.jsxs)(`p`,{"data-slot":`cleanup-branches-error`,className:`text-[13px] text-danger`,children:[`Branches did not load: `,t.error.message]});let m=u.length,h=`branch${m===1?``:`es`}`;return(0,Z.jsxs)(`section`,{"data-slot":`cleanup-branches`,"aria-labelledby":`cleanup-branches-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsxs)(`h2`,{id:`cleanup-branches-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Branches safe to delete · `,m]}),(0,Z.jsxs)(`p`,{className:`text-[11.5px] leading-[17px] text-soft-foreground`,children:[`Their work is already on `,e,`, or they have none. Deleting loses nothing.`]})]}),(0,Z.jsxs)(`button`,{type:`button`,"data-action":`cleanup-branches-delete`,disabled:m===0||p.isPending,onClick:()=>o(!0),className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:hover:brightness-100 max-md:h-11 md:self-center`,children:[(0,Z.jsx)(c,{"aria-hidden":`true`,className:`size-[12px]`}),p.isPending?`Deleting…`:`Delete ${m} ${h}`]})]}),(0,Z.jsx)($,{kind:`merged`,title:`Merged into ${e}`,hint:t.data.prStateKnown?`including squash-merged PRs, read from the PR state`:Q.toLowerCase(),rows:s,open:r.merged,onToggle:()=>i(e=>({...e,merged:!e.merged}))}),(0,Z.jsx)($,{kind:`empty`,title:`Empty`,hint:`no commits beyond the fork point`,rows:l,open:r.empty,onToggle:()=>i(e=>({...e,empty:!e.empty}))}),(0,Z.jsx)(F,{open:a,onOpenChange:o,children:(0,Z.jsxs)(T,{children:[(0,Z.jsxs)(N,{children:[(0,Z.jsxs)(x,{children:[`Delete `,m,` `,h,`?`]}),(0,Z.jsxs)(y,{children:[s.length,` merged into `,e,` and `,l.length,` empty. Their work is already on `,e,`, or they have none. Anything that stopped being safe since this list loaded is kept.`]})]}),(0,Z.jsxs)(A,{children:[(0,Z.jsx)(j,{children:`Keep them`}),(0,Z.jsxs)(k,{"data-action":`cleanup-branches-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{p.mutate(u.map(e=>e.name)),o(!1)},children:[`Delete `,m,` `,h]})]})]})})]})}function $({kind:e,title:t,hint:n,rows:r,open:i,onToggle:a}){let o=`cleanup-branches-${e}`;return(0,Z.jsxs)(`div`,{"data-slot":`cleanup-branch-group`,"data-group":e,className:`border-b border-border last:border-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":o,disabled:r.length===0,onClick:a,className:`flex min-h-[44px] w-full items-center gap-[12px] px-[14px] py-[4px] text-left hover:bg-sidebar-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:hover:bg-transparent`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsxs)(`span`,{className:`truncate text-[12.5px] text-foreground`,children:[t,` · `,r.length]}),(0,Z.jsx)(`span`,{className:`truncate text-[11px] text-soft-foreground`,children:n})]}),r.length>0?(0,Z.jsx)(_,{"aria-hidden":`true`,className:z(`size-[13px] shrink-0 text-soft-foreground transition-transform motion-reduce:transition-none`,i&&`rotate-90`)}):null]}),i?(0,Z.jsx)(`ul`,{id:o,"aria-label":t,className:`flex flex-col pb-[6px]`,children:r.map(e=>(0,Z.jsxs)(`li`,{"data-slot":`cleanup-branch-row`,"data-branch":e.name,className:`flex min-h-[32px] items-center gap-[10px] px-[14px] pl-[26px] text-[11.5px]`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:e.name}),e.runId?(0,Z.jsx)(G,{to:`/tasks/${e.runId}`,className:`min-w-0 flex-1 truncate text-soft-foreground underline-offset-2 hover:text-foreground hover:underline`,children:e.title??`Open the task`}):(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-soft-foreground`,children:e.lastCommit.subject}),e.pr?(0,Z.jsxs)(`span`,{className:`shrink-0 text-soft-foreground`,children:[`PR #`,e.pr.number]}):null,(0,Z.jsx)(`span`,{className:`shrink-0 tabular-nums text-soft-foreground`,children:W(e.lastCommit.at)})]},e.name))}):null]})}function lt(){let e=u(),t=o().data?.targets.find(e=>e.id===`finder`),n=M({mutationFn:e=>ce(e,t.id),onError:e=>d(e.message,{tone:`danger`})}),i=P(),[a,s]=(0,X.useState)(!1),c=()=>Promise.all([i.invalidateQueries({queryKey:E.worktrees}),i.invalidateQueries({queryKey:E.repoBranches})]),l=M({mutationFn:e=>r(),onSuccess:(e,t)=>{c();let n=e.reclaimed.length,r=Math.max(0,t-n);d(n===0?r>0?`Nothing was reclaimed — the worktrees past the keep limit have uncommitted work or are in use`:`Nothing to reclaim — no finished worktrees exceed the keep limit`:`Reclaimed ${n} worktree${n===1?``:`s`} (branch kept)${r>0?` · ${r} kept: uncommitted work or in use`:``}`)},onError:e=>d(e.message,{tone:`danger`})}),f=M({mutationFn:e=>p(e.runId),onSuccess:(e,t)=>{c(),d(`Reclaimed the worktree of ${t.title} (branch kept)`)},onError:e=>{c(),d(e.message,{tone:`danger`})}});if(e.isPending)return(0,Z.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading worktrees…`});if(e.isError)return(0,Z.jsxs)(`p`,{"data-slot":`worktrees-error`,className:`text-[13px] text-danger`,children:[`Worktrees did not load: `,e.error.message]});let{worktrees:m,totalBytes:g,keep:_}=e.data,v=l.isPending||f.isPending,b=m.filter(e=>e.pastKeep),S=b.length>0,C=b.some(e=>e.sizeBytes===null)?null:b.reduce((e,t)=>e+(t.sizeBytes??0),0),w=S?C?`Reclaim ${h(C)} now`:`Reclaim ${b.length} now`:`Reclaim now`,D=g?h(g):null;return(0,Z.jsxs)(`section`,{"data-slot":`worktrees-panel`,"aria-labelledby":`worktrees-panel-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsxs)(`h2`,{id:`worktrees-panel-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Worktrees on disk`,D?` · ${D}`:``]}),(0,Z.jsxs)(`p`,{"data-slot":`worktrees-retention`,className:`text-[11.5px] leading-[17px] text-soft-foreground`,children:[_===0?`Retention is unlimited (`:`Retention keeps the newest ${_} finished checkout${_===1?``:`s`} (`,(0,Z.jsx)(G,{to:`/settings/worktrees`,"data-slot":`worktrees-retention-link`,className:`underline-offset-2 hover:text-foreground hover:underline`,children:`Settings › Worktrees`}),_===0?`), so nothing is reclaimed on its own.`:`) and reclaims the rest.`,` `,`Reclaim removes the directory only; the branch stays, so its work stays recoverable.`]})]}),(0,Z.jsxs)(`button`,{type:`button`,"data-action":`worktrees-reclaim-now`,disabled:v||!S,title:S?void 0:`Nothing past the keep limit to reclaim`,onClick:()=>s(!0),className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:hover:brightness-100 max-md:h-11 md:self-center`,children:[(0,Z.jsx)(J,{"aria-hidden":`true`,className:`size-[12px]`}),w]})]}),m.length===0?(0,Z.jsx)(`p`,{"data-slot":`worktrees-empty`,className:`px-[14px] py-[12px] text-[12.5px] text-soft-foreground`,children:`No task worktrees on disk.`}):(0,Z.jsx)(`ul`,{"aria-label":`Task worktrees on disk`,className:`flex flex-col`,children:m.map(e=>(0,Z.jsx)(ft,{worktree:e,keep:_,disabled:v,onOpen:t?()=>n.mutate(e.runId):void 0,opening:n.isPending,onReclaim:()=>f.mutate(e)},e.runId))}),(0,Z.jsx)(F,{open:a,onOpenChange:s,children:(0,Z.jsxs)(T,{children:[(0,Z.jsxs)(N,{children:[(0,Z.jsx)(x,{children:`Reclaim old worktrees?`}),(0,Z.jsxs)(y,{children:[b.length,` finished worktree`,b.length===1?``:`s`,` beyond the keep limit`,C?` (${h(C)})`:``,` `,b.length===1?`is`:`are`,` reclaimed now, directory only. Their branches are kept, so the work stays recoverable.`]})]}),(0,Z.jsxs)(A,{children:[(0,Z.jsx)(j,{children:`Keep them`}),(0,Z.jsx)(k,{"data-action":`worktrees-confirm`,onClick:()=>{l.mutate(b.length),s(!1)},children:w})]})]})})]})}var ut=new Set([`queued`,`running`,`waiting`,`review`]);function dt(e,t){return ut.has(e.status)||!e.reclaimable?{label:`in use`,tone:`in-use`}:e.pastKeep?{label:`reclaimable`,tone:`plain`}:{label:t>0?`kept · newest ${t}`:`kept`,tone:`plain`}}function ft({worktree:e,keep:t,disabled:n,onOpen:r,opening:i,onReclaim:a}){let o=dt(e,t),s=W(e.finishedAt??void 0),c=e.status===`review`?`at review`:s?`${e.status} ${s} ago`:e.status,l=(0,Z.jsx)(`span`,{"data-slot":`worktree-state`,"data-state":o.tone===`in-use`?`in-use`:e.pastKeep?`reclaimable`:`kept`,className:z(`text-[11.5px]`,o.tone===`in-use`?`text-status-running`:`text-soft-foreground`),children:o.label}),u=`flex size-[28px] shrink-0 items-center justify-center rounded-[6px] text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:size-11`;return(0,Z.jsxs)(`li`,{"data-slot":`worktree-row`,"data-run":e.runId,className:`flex min-h-[44px] items-center gap-[12px] border-b border-border px-[14px] py-[4px] last:border-0`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsx)(`span`,{className:`truncate text-[12.5px] text-foreground`,title:e.title,children:e.title}),(0,Z.jsxs)(`span`,{className:`truncate font-mono text-[10.5px] text-soft-foreground`,children:[e.branch??e.runId.slice(0,8),` · `,c,(0,Z.jsxs)(`span`,{className:`md:hidden`,children:[` · `,o.label]})]})]}),(0,Z.jsx)(`span`,{"data-slot":`worktree-size`,className:`shrink-0 text-[11.5px] tabular-nums text-muted-foreground`,children:e.sizeBytes===null?`—`:h(e.sizeBytes)||`0 kB`}),(0,Z.jsx)(`span`,{className:`hidden shrink-0 md:inline`,children:l}),r?(0,Z.jsx)(`button`,{type:`button`,className:u,"aria-label":`Open folder for ${e.title}`,title:`Open folder`,disabled:i,onClick:r,children:(0,Z.jsx)(S,{"aria-hidden":`true`,className:`size-[13px]`})}):null,o.tone===`in-use`?null:(0,Z.jsx)(`button`,{type:`button`,"data-action":`worktree-reclaim`,"aria-label":`Reclaim the worktree of ${e.title} (branch kept)`,title:`Reclaim the directory (branch kept)`,disabled:n,onClick:a,className:u,children:(0,Z.jsx)(J,{"aria-hidden":`true`,className:`size-[13px]`})})]})}function pt({section:e,index:t=!1}){let n=D(),r=H(),[i]=re();if(t&&!r&&i.get(`view`)!==`repo`)return(0,Z.jsx)(Je,{});if(n.isPending)return(0,Z.jsx)(ke,{});if(n.isError)return(0,Z.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(q,{}),(0,Z.jsx)(L,{icon:(0,Z.jsx)(g,{size:16}),tone:`danger`,title:`Could not load the repository`,subtitle:n.error.message})]});let a=n.data.info;return a?(0,Z.jsx)(mt,{repo:n.data,info:a,section:e}):(0,Z.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(q,{}),(0,Z.jsx)(L,{icon:(0,Z.jsx)(C,{size:16}),tone:`neutral`,title:`Not a git repository`,subtitle:`cezar is running outside a git repository — start it inside one to browse changes, commits and branches.`})]})}function mt({repo:e,info:t,section:n}){return(0,Z.jsxs)(`div`,{"data-route":`repo-git`,"data-git-section":n,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(q,{}),(0,Z.jsxs)(`header`,{"data-slot":`repo-header`,className:`flex flex-col gap-1 px-[18px] pt-[18px] md:min-h-[61px] md:flex-row md:items-center md:gap-[10px] md:border-b md:border-border md:px-7 md:py-4`,children:[(0,Z.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:He(n,t.branch)}),(0,Z.jsx)(`p`,{"data-slot":`repo-meta`,className:`min-w-0 truncate text-[12px] text-soft-foreground md:text-[11.5px]`,children:(0,Z.jsx)(ht,{repo:e,info:t,section:n})})]}),n===`main`?(0,Z.jsx)(Xe,{repo:e,info:t}):n===`not-landed`?(0,Z.jsx)(rt,{}):n===`cleanup`?(0,Z.jsxs)(`div`,{"data-slot":`repo-cleanup`,className:`flex flex-col gap-[16px] px-[18px] pt-[12px] pb-[calc(90px+env(safe-area-inset-bottom))] md:px-[20px] md:pb-[20px]`,children:[(0,Z.jsx)(lt,{}),(0,Z.jsx)(ct,{base:e.baseBranch??t.branch})]}):n===`branches`?(0,Z.jsx)(Ie,{repo:e,info:t}):(0,Z.jsx)(Ye,{})]})}function ht({repo:e,info:t,section:n}){let r=e.baseBranch??t.branch;switch(n){case`main`:return(0,Z.jsxs)(Z.Fragment,{children:[e.log.length===0?`no commits yet`:`latest ${e.log.length} commit${e.log.length===1?``:`s`} in the main checkout`,e.tracking?` · ${Re(e.tracking)}`:``]});case`not-landed`:return(0,Z.jsxs)(Z.Fragment,{children:[`finished tasks whose commits are not on `,r]});case`branches`:return(0,Z.jsx)(gt,{repo:e,info:t});case`changes`:return(0,Z.jsxs)(Z.Fragment,{children:[e.status.length,` uncommitted file`,e.status.length===1?``:`s`,` in the main checkout`]});case`cleanup`:return(0,Z.jsxs)(Z.Fragment,{children:[`nothing here can delete work that is not on `,r]})}}function gt({repo:e,info:t}){let n=Ae(e,b().data?.branches).length;return(0,Z.jsxs)(Z.Fragment,{children:[n,` branch`,n===1?``:`es`,` · on `,t.branch]})}export{pt as RepoGitRoute};
|
|
@@ -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{$ as r,$r as i,Do as a,Eo as o,Ft as s,Gr as c,Hn as l,Hr as u,In as d,J as f,Jn as p,Jr as m,Jt as h,K as g,Ln as _,Nn as v,On as ee,Pa as y,Pn as te,Q as b,Qa as ne,Rn as x,V as re,X as S,Xr as ie,Yr as C,Zn as ae,Zr as w,a as T,c as E,da as D,et as O,gr as k,gt as oe,hr as se,i as A,in as j,it as M,l as N,li as P,lr as ce,mn as le,n as F,nt as I,o as ue,qn as de,r as fe,ro as L,s as pe,si as me,so as he,st as ge,t as _e,ti as ve,tn as ye,tt as be,ua as xe,un as Se,wi as Ce,xt as we,yi as Te,yr as Ee,za as De,zi as Oe}from"./alert-dialog-C-xYE_dg.js";import{n as R,t as z}from"./utils-fzNfbPzA.js";import{t as ke}from"./createLucideIcon-BHp8sXmF.js";import{A as Ae,I as je,L as Me,M as Ne,N as Pe,S as Fe,_ as Ie,a as Le,b as Re,i as ze,j as B,k as Be,l as Ve,p as He,r as Ue,t as We,v as Ge,x as Ke}from"./mobile-run-bar-BCfmFi8V.js";import{c as qe,i as Je,l as Ye,n as Xe,t as Ze}from"./reference-chip-D6owncJT.js";import{a as Qe,i as $e,n as et,t as tt}from"./use-desktop-CrDny2uG.js";import{t as nt}from"./info-DA1x_4bz.js";import{f as rt,l as V,r as H,u as it}from"./format-dBiNDNVe.js";import{n as at,t as U}from"./tab-link-K0hjzEXR.js";import{n as ot,t as st}from"./agent-accounts-CU2ZDv24.js";import{a as W,i as G,l as ct,n as lt,p as K,r as q,t as J}from"./dropdown-menu-Ch5BYQh_.js";import{n as ut,r as dt,t as ft}from"./collapsible-DD9J91Iv.js";import{a as pt,i as mt,n as ht,o as gt,r as _t,s as vt,t as yt}from"./textarea-DxlkE-Yd.js";import{n as bt,t as xt}from"./markdown-zdKeLIYA.js";import{t as St}from"./diff-stat-BKDCSVfJ.js";import{n as Ct,t as wt}from"./token-metrics-DIAjrPlM.js";var Tt=ke(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Et=ke(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Dt=ke(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Y=e(t(),1),X=n();function Ot(e){let t=he();return L({mutationFn:t=>Ce(e,t),onSuccess:()=>t.invalidateQueries({queryKey:j.runs.all}),onError:e=>y(e.message,{tone:`danger`})})}function kt(e){return e.archived?`Unarchive`:`Archive task`}function At({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,X.jsx)(_e,{open:t,onOpenChange:n,children:(0,X.jsxs)(A,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,X.jsxs)(pe,{children:[(0,X.jsx)(E,{children:`Archive task?`}),(0,X.jsxs)(T,{children:[`Move “`,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,title:P(e),children:P(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,X.jsxs)(ue,{children:[(0,X.jsx)(fe,{children:`Cancel`}),(0,X.jsx)(F,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function jt({run:e,className:t,compactOnMobile:n=!1}){let[r,i]=(0,Y.useState)(!1),a=Ot(e.id),o=kt(e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(N,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":o,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:a.isPending,className:z(`h-11 gap-[7px] px-3`,n&&`max-md:size-11 max-md:px-0`,t),onClick:()=>e.archived?a.mutate(!1):i(!0),children:[e.archived?(0,X.jsx)(Me,{"aria-hidden":`true`}):(0,X.jsx)(re,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:z(n&&`max-md:sr-only`),children:o})]}),(0,X.jsx)(At,{run:e,open:r,onOpenChange:i,onConfirm:()=>{a.mutate(!0),i(!1)}})]})}function Mt({run:e}){let t=V(),n=de(),r=te(e.id),[i,a]=(0,Y.useState)(null),o=(n.data?.projects?.find(e=>e.id===(t??n.data?.bootProject)))?.webhook?.url,s=e.notify===!0;return!o&&!s?null:(0,X.jsxs)(X.Fragment,{children:[s?(0,X.jsxs)(J,{children:[(0,X.jsx)(K,{asChild:!0,children:(0,X.jsxs)(N,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":o?`Notifying ${B(o)} — webhook actions`:`Notifying — webhook actions`,title:o?B(o):void 0,children:[(0,X.jsx)(qe,{tone:`success`}),(0,X.jsx)(`span`,{children:`Notifying`}),(0,X.jsx)(S,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,X.jsxs)(q,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[o?(0,X.jsx)(W,{className:`truncate px-2 py-1.5 text-[11px] font-normal text-muted-foreground`,children:(0,X.jsx)(`span`,{title:B(o),children:`Task webhook`})}):null,o?(0,X.jsxs)(G,{className:`min-h-11`,onSelect:()=>a(`note`),children:[(0,X.jsx)(at,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,X.jsxs)(G,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>y(`Stopped notifying the webhook`),onError:e=>y(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,X.jsx)(Tt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,X.jsxs)(N,{variant:`outline`,size:`sm`,"data-action":`handoff`,className:`size-11 px-0 md:h-[30px] md:w-auto md:px-2.5`,"aria-label":`Hand off to webhook`,onClick:()=>a(`handoff`),children:[(0,X.jsx)(Ne,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),o?(0,X.jsx)(Nt,{mode:i,url:o,pending:r.isPending,onOpenChange:e=>!e&&a(null),onSubmit:e=>r.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{a(null),y(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>y(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null]})}function Nt({mode:e,url:t,pending:n,onOpenChange:r,onSubmit:i}){let a=(0,Y.useId)(),o=(0,Y.useId)(),[s,c]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{e!==null&&c(``)},[e]);let l=e===`note`,u=B(t);return(0,X.jsx)(ht,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,X.jsx)(_t,{"data-slot":`handoff-dialog`,className:`max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-xl max-sm:border-x-0 max-sm:border-b-0 max-sm:pb-[max(1.5rem,env(safe-area-inset-bottom))] max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100`,children:(0,X.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(s.trim())},children:[(0,X.jsxs)(gt,{className:`text-left`,children:[(0,X.jsx)(vt,{children:l?`Send a note to the webhook`:`Hand off to webhook`}),(0,X.jsx)(mt,{children:(0,X.jsx)(`span`,{"data-webhook-destination":``,title:u,children:l?`The bot gets this note with the task's current status.`:`The webhook will start receiving this task's status updates. Add a note for it (optional).`})})]}),(0,X.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:a,className:`text-[13px] font-medium`,children:`Note`}),(0,X.jsx)(yt,{id:a,"data-slot":`handoff-note`,"aria-describedby":o,rows:4,maxLength:1e5,className:`min-h-24`,placeholder:`e.g. Take over from here, ping me when the PR is green`,value:s,onChange:e=>c(e.target.value)}),(0,X.jsxs)(`p`,{id:o,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,X.jsx)(nt,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,X.jsxs)(pt,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,X.jsx)(N,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,X.jsxs)(N,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,X.jsx)(Ne,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function Pt({runId:e,children:t}){let n=ne(),r=(0,Y.useMemo)(()=>({runId:e}),[e]);return n?(0,X.jsx)(Ft,{runId:e,children:t}):(0,X.jsx)(bt.Provider,{value:r,children:t})}function Ft({runId:e,children:t}){let n=V(),r=(0,Y.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,X.jsx)(bt.Provider,{value:r,children:t})}function It(e,t,n,r){return n?r===`step`?`Step ${e} of ${t}`:`${e} of ${t} complete`:`${e} / ${t}`}function Lt({slot:e,icon:t,title:n,meta:r,open:i,onToggle:a,children:o}){return(0,X.jsxs)(`div`,{"data-slot":`run-activity-${e}`,"data-state":i?`open`:`collapsed`,className:`min-w-0 border-t border-border first:border-t-0`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:a,className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2 text-left hover:bg-muted/40`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center text-accent-text`,children:t}),(0,X.jsx)(`span`,{className:`min-w-0 shrink truncate text-[14px] font-semibold text-foreground`,children:n}),(0,X.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`min-w-0 shrink-[2] truncate text-[13px] text-muted-foreground tabular-nums`,children:r}),(0,X.jsx)(S,{"aria-hidden":!0,className:z(`ml-auto size-4 shrink-0 text-soft-foreground transition-transform`,i&&`rotate-180`)})]}),i?(0,X.jsx)(`div`,{"data-slot":`run-activity-body`,className:`min-w-0 border-t border-border/60 bg-muted/30 px-3.5 py-2.5`,children:o}):null]})}var Rt=`flex min-h-11 min-w-0 items-center rounded-md px-2 text-sm text-foreground hover:bg-muted break-words focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`;function zt({run:e}){return!e.delegation||e.delegation.role===`invalid`?null:(0,X.jsx)(Ht,{run:e})}function Bt(e,t){let n=e?.role===`root`?e.receipts.map(e=>e.workerId):[];return[...new Set([...n,...(t?.workers??[]).map(e=>e.workerId)])].slice(0,32)}function Vt(e){let t=e.delegation,n=t!==void 0&&t.role!==`invalid`,r=k(e.id,{enabled:n});if(!n||!t)return`complete`;if(!r.isSuccess)return r.isError||r.fetchStatus===`paused`?`unknown`:`pending`;let i=new Map(r.data.workers.map(e=>[e.workerId,e])),a=Bt(t,r.data).map(e=>{let t=i.get(e)?.status;return t===`done`||t===`cancelled`?`complete`:t===void 0||t===`failed`?`issue`:`pending`});return a.includes(`pending`)?`pending`:a.includes(`issue`)?`issue`:`complete`}function Ht({run:e}){let t=k(e.id),n=tt(),[r,i]=(0,Y.useState)(null),a=n||r===e.id,s=(0,Y.useId)(),c=Ee(),l=e.delegation,u=l?.role===`worker`?l.parentRunId:t.data?.parentRunId,d=new Map(t.data?.workers.map(e=>[e.workerId,e])),p=Bt(l,t.data),m=l&&l.role!==`invalid`?l.wait:void 0,h=o(l);return(0,X.jsxs)(`section`,{"aria-label":`Task relationships`,className:`min-w-0 border-t border-border py-2 text-sm text-muted-foreground`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 text-left text-xs md:hidden`,"aria-expanded":a,"aria-controls":s,onClick:()=>i(r===e.id?null:e.id),children:[(0,X.jsx)(oe,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),l?.role===`worker`?`Worker session`:`Parent`,(0,X.jsx)(f,{"aria-hidden":`true`,className:`ml-1 size-4`}),l?.role===`worker`?`Parent & workers`:p.length>0?`Workers ${p.length}`:t.isSuccess?`Workers 0`:t.isError?`Workers unavailable`:`Workers…`,(0,X.jsx)(S,{"aria-hidden":`true`,className:`ml-auto size-4 ${a?`rotate-180`:``}`})]}),l?.role===`worker`&&l.destroy?(0,X.jsx)(Z,{state:l.destroy}):null,m?(0,X.jsx)(Jt,{wait:m,dependencyLabel:h}):null,(0,X.jsxs)(`div`,{id:s,hidden:!a,children:[u?(0,X.jsx)(Yt,{id:u}):null,p.length>0?(0,X.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-1 overflow-y-auto`,children:p.map(e=>{let n=d.get(e),r=c.data?.find(t=>t.id===e);return(0,X.jsxs)(`li`,{className:`min-w-0 rounded-md bg-muted/40 px-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2`,children:[(0,X.jsx)(H,{to:`/tasks/${e}`,"aria-label":`Worker task ${e}`,className:Rt,children:r?P(r):`Worker ${e.slice(0,8)}`}),(0,X.jsx)(`span`,{className:`px-2 text-xs`,children:n?.status??(t.isSuccess?`Record unavailable or deleted`:`Status unavailable`)})]}),n?.destroy?(0,X.jsx)(Z,{state:n.destroy}):null]},e)})}):l?.role===`root`&&t.isSuccess?(0,X.jsx)(`p`,{className:`px-2`,children:`No workers`}):null,t.fetchStatus===`paused`?(0,X.jsx)(`p`,{role:`status`,className:`px-2`,children:`Offline — relationship details will refresh when connected.`}):t.isPending?(0,X.jsx)(`p`,{role:`status`,className:`px-2`,children:`Loading relationships…`}):null,t.isError?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-2`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,X.jsx)(N,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry relationships`})]}):null]})]})}function Ut({run:e,open:t,onToggle:n}){let r=k(e.id),i=Ee(),a=tt(),s=e.delegation,c=s?.role===`worker`?s.parentRunId:r.data?.parentRunId,l=new Map(r.data?.workers.map(e=>[e.workerId,e])),u=Bt(s,r.data),d=s&&s.role!==`invalid`?s.wait:void 0,f=o(s);return(0,X.jsx)(Lt,{slot:`workers`,icon:(0,X.jsx)(oe,{className:`size-4`}),title:`Workers`,meta:Wt({ids:u,workers:l,parentId:c,desktop:a,query:r}),open:t,onToggle:n,children:(0,X.jsxs)(`div`,{"aria-label":`Task relationships`,className:`min-w-0 text-[13px] text-muted-foreground`,role:`group`,children:[s?.role===`worker`&&s.destroy?(0,X.jsx)(Z,{state:s.destroy}):null,d?(0,X.jsx)(Jt,{wait:d,dependencyLabel:f}):null,c?(0,X.jsx)(Yt,{id:c}):null,u.length>0?(0,X.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-0.5 overflow-y-auto`,children:u.map(e=>{let t=l.get(e),n=i.data?.find(t=>t.id===e),a=t?Kt(t.status):r.isSuccess?`Record unavailable or deleted`:`Status unavailable`;return(0,X.jsxs)(`li`,{"data-slot":`worker-item`,"data-status":t?.status,className:`min-w-0`,children:[(0,X.jsxs)(H,{to:`/tasks/${e}`,"aria-label":`Worker task ${e}`,className:`group flex min-h-11 min-w-0 items-center gap-2.5 rounded-md px-1 text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,X.jsx)(Gt,{status:t?.status}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n?P(n):`Worker ${e.slice(0,8)}`}),(0,X.jsx)(`span`,{className:z(`max-w-[45%] shrink-0 truncate text-xs`,qt(t?.status)),children:a}),(0,X.jsx)(g,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground`})]}),t?.destroy?(0,X.jsx)(Z,{state:t.destroy}):null]},e)})}):s?.role===`root`&&r.isSuccess?(0,X.jsx)(`p`,{className:`px-1 py-1`,children:`No workers`}):null,r.fetchStatus===`paused`?(0,X.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Offline — relationship details will refresh when connected.`}):r.isPending?(0,X.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Loading relationships…`}):null,r.isError?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-1 py-1`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,X.jsx)(N,{variant:`outline`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Retry relationships`})]}):null]})})}function Wt({ids:e,workers:t,parentId:n,desktop:r,query:i}){if(e.length===0)return i.isError?`Unavailable`:i.isPending?`Linking…`:n?`Parent linked`:`No workers`;let a=`${e.length} linked`;if(!r)return a;let o=new Map;for(let n of e){let e=t.get(n)?.status;e!==void 0&&o.set(e,(o.get(e)??0)+1)}return[a,...[...o.entries()].map(([e,t])=>`${t} ${e}`)].join(` · `)}function Gt({status:e}){let t=`size-[15px] shrink-0`;return e===`done`?(0,X.jsx)(b,{"aria-hidden":!0,className:z(t,`text-success`)}):e===`failed`?(0,X.jsx)(I,{"aria-hidden":!0,className:z(t,`text-danger`)}):e===`cancelled`?(0,X.jsx)(be,{"aria-hidden":!0,className:z(t,`text-soft-foreground`)}):e===`running`||e===`waiting`||e===`review`?(0,X.jsx)(rt,{role:`status`,"aria-label":`Worker running`,className:z(t,`animate-spin stroke-pending motion-reduce:animate-none`)}):(0,X.jsx)(O,{"aria-hidden":!0,className:z(t,`text-soft-foreground`)})}function Kt(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function qt(e){return e===`done`?`text-success`:e===`failed`?`text-danger`:`text-muted-foreground`}function Jt({wait:e,dependencyLabel:t}){return(0,X.jsxs)(`p`,{className:`px-2 break-words`,children:[e.phase===`parked`&&t?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e.requestIds?e.phase===`parked`?`Waiting on request replies`:e.phase===`wake-pending`?`Conversation update queued for this task`:`Request wait registered — the agent is finishing its turn`:e.phase===`parked`?`Waiting on workers`:e.phase===`wake-pending`?`Worker update queued for the parent`:`Worker wait registered — the agent is finishing its turn`,`.`,` `,`Deadline: `,(0,X.jsx)(`time`,{dateTime:e.deadline,children:e.deadline})]})}function Yt({id:e}){let t=ce(e);return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2`,children:[(0,X.jsx)(H,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,className:Rt,children:t.data?`Parent · ${P(t.data)}`:`Parent task ${e}`}),t.isError?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`px-2 text-xs`,children:`Parent record unavailable or deleted`}),(0,X.jsx)(N,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}function Z({state:e}){return e.phase===`complete`&&e.remaining.length===0&&e.error===void 0?null:(0,X.jsxs)(`p`,{className:`px-2 pb-2 break-words`,children:[e.phase===`incomplete`?`Cleanup incomplete`:e.phase===`complete`?`Cleanup complete`:`Cleanup ${e.phase}`,e.remaining.length?` — remaining: ${e.remaining.join(`, `)}`:``,e.error?` — ${e.error}`:``]})}function Q(e){switch(e){case`done`:return`done`;case`running`:case`waiting`:case`review`:return`active`;case`failed`:case`cancelled`:return`failed`;case`pending`:case`skipped`:return`pending`}}function Xt(e){if(e.length===0)return 0;let t=new Set([`done`,`failed`,`cancelled`,`skipped`]),n=new Set([`running`,`waiting`,`review`]),r=0;for(let i of e)t.has(i.status)?r+=1:n.has(i.status)&&(r+=.5);return r/e.length}function Zt({steps:e}){if(e.length===0)return null;let t=Xt(e)*100;return(0,X.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,X.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":Q(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,X.jsx)(Qt,{visual:Q(t.status)}),(0,X.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,X.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,X.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-[11px] text-soft-foreground tabular-nums`,children:[t.kind,` · step `,n+1,` of `,e.length]})]},t.id)),(0,X.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,X.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function Qt({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,X.jsx)(b,{"aria-hidden":!0,className:z(t,`text-success`)});case`active`:return(0,X.jsx)(rt,{role:`status`,"aria-label":`Step running`,className:z(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,X.jsx)(I,{"aria-hidden":!0,className:z(t,`text-danger`)});case`pending`:return(0,X.jsx)(O,{"aria-hidden":!0,className:z(t,`text-soft-foreground`)})}}function $t(e){let t=e.findIndex(e=>Q(e.status)===`active`);if(t>=0)return t;let n=e.findIndex(e=>Q(e.status)===`pending`);return n>=0?n:Math.max(0,e.length-1)}function en({visual:e}){return(0,X.jsx)(`span`,{"aria-hidden":!0,"data-slot":`step-dot`,"data-visual":e,className:z(`size-1.5 rounded-full`,e===`done`?`bg-success`:e===`failed`?`bg-danger`:e===`active`?`bg-pending`:`bg-soft-foreground`,e===`active`&&`animate-pulse motion-reduce:animate-none`)})}var tn=new Map;function nn({runId:e,steps:t}){let[n,r]=(0,Y.useState)(()=>tn.get(e)??!1);if(t.length===0)return null;let i=t=>{tn.set(e,t),r(t)},a=$t(t),o=t[a],s=Xt(t)*100;return(0,X.jsxs)(ft,{"data-slot":`workflow-steps`,open:n,onOpenChange:i,className:`min-w-0`,children:[(0,X.jsxs)(dt,{"aria-label":`Workflow: ${o.name}, step ${a+1} of ${t.length}`,className:`group flex min-h-11 w-full items-center gap-2 text-left text-xs text-muted-foreground hover:text-foreground md:min-h-[30px] md:gap-2.5`,children:[(0,X.jsx)(`span`,{"data-slot":`step-dots`,className:`flex shrink-0 items-center gap-1`,children:t.map(e=>(0,X.jsx)(en,{visual:Q(e.status)},e.id))}),(0,X.jsx)(`span`,{className:`min-w-0 max-w-[45%] shrink truncate font-semibold text-foreground`,children:o.name}),(0,X.jsxs)(`span`,{className:`shrink-0 text-soft-foreground tabular-nums`,children:[`step `,a+1,` of `,t.length]}),(0,X.jsx)(`span`,{"data-slot":`step-summary-progress`,className:`h-0.5 min-w-[36px] flex-1 overflow-hidden rounded-full bg-muted`,children:(0,X.jsx)(`span`,{className:`block h-full rounded-full bg-pending`,style:{width:`${s}%`}})}),(0,X.jsx)(S,{"aria-hidden":!0,className:`size-4 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-180`})]}),(0,X.jsx)(ut,{children:(0,X.jsx)(`div`,{className:`pt-2`,children:(0,X.jsx)(Zt,{steps:t})})})]})}var rn=3,an=(e,t)=>e.kind===t.kind&&e.number===t.number;function on(e,t,n=rn){let r=t?e.findIndex(e=>an(e,t)):-1;if(e.length<=n||r<n)return{inline:e.slice(0,n),overflow:e.slice(n)};let i=[...e.slice(0,n-1),e[r]];return{inline:i,overflow:e.filter(e=>!i.includes(e))}}var sn=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function cn({tab:e}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(e.kind===`pr`?we:r,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,X.jsx)(Xe,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}var ln=new Map;function un({run:e,tab:t=`session`,hasPendingHumanAsk:n=!1,onMarkedUnread:r}){let o=a(e,n),s=Ge(e),[c,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),p=fn(e,r),[,m]=(0,Y.useReducer)(e=>e+1,0),h=(0,Y.useId)(),g=V(),_=JSON.stringify([g,e.id]),v=ln.get(_)??!1,y=()=>{ln.set(_,!v),m()},te=Ee(),b=ee(),ne=wt(b.data),x=e.status===`queued`?me(te.data??[]).get(e.id):void 0,re=ze(),C=Ue(),w=re!==null&&!C?re:null,T=w!==null,E=l(),D=(0,Y.useMemo)(()=>i(e,E),[e,E]),O=D[0],k=ae(),oe=(0,Y.useMemo)(()=>k===void 0?[]:D.map(e=>({projectId:k,kind:e.kind,number:e.number})),[D,k]),se=(0,Y.useMemo)(()=>ie(e,E),[e,E]),A=typeof t==`object`?t:null,{inline:j,overflow:M}=on(se,A),P=(0,Y.useRef)(null),ce=A?`${A.kind}#${A.number}`:null;(0,Y.useEffect)(()=>{!ce||C||P.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[ce,j.map(e=>`${e.kind}#${e.number}`).join(`,`),C]);let le=(0,X.jsx)(Sn,{run:e,actions:p,onOpenChooser:()=>f(!0),onToggleNotes:()=>u(e=>!e)}),F=(0,X.jsx)(N,{variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":v?`Hide run details`:`Show run details`,"aria-controls":h,"aria-expanded":v,onClick:y,children:(0,X.jsx)(S,{"aria-hidden":`true`,className:z(`transition-transform motion-reduce:transition-none`,v&&`rotate-180`)})}),I=t!==`session`&&s.archive?(0,X.jsx)(jt,{run:e}):null;return(0,X.jsx)(Je,{projectId:k,repoBase:E,requests:oe,children:(0,X.jsxs)(`header`,{"data-slot":`run-header`,className:z(`relative z-20 bg-background px-[18px] md:px-9 md:pt-7`,T?`pt-0`:`pt-[18px]`,t===`session`&&`md:sticky md:top-0`),children:[(0,X.jsxs)(`div`,{className:`w-full`,children:[w?(0,X.jsxs)(We,{slot:w,children:[(0,X.jsx)(hn,{run:e,children:(0,X.jsxs)(`span`,{"data-slot":`mobile-run-state`,className:`flex min-w-0 items-center gap-1.5 text-[11.5px] leading-tight text-soft-foreground`,children:[(0,X.jsx)(qe,{tone:o.tone,shape:o.shape,pulse:o.pulse}),(0,X.jsxs)(`span`,{className:`truncate`,children:[o.label,x===void 0?``:` #${x}`,O?` · #${O.number}`:``]})]})}),F,le]}):(0,X.jsxs)(`div`,{"data-slot":`run-title-row`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 md:flex-nowrap`,children:[(0,X.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[12px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:e.delegation?.role===`worker`?`Worker session`:e.delegation?.role===`root`?`Parent session`:`Task session`}),(0,X.jsx)(mn,{run:e}),(0,X.jsxs)(Re,{dot:o.tone,shape:o.shape,pulse:o.pulse,children:[o.label,x===void 0?``:` #${x}`]}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[F,I,(0,X.jsx)(Mt,{run:e}),le]})]}),(0,X.jsxs)(`div`,{id:h,"data-slot":`run-details`,className:z(v?`block`:`hidden`,`md:block`),children:[w?(0,X.jsxs)(`div`,{"data-slot":`run-details-actions`,className:`flex flex-wrap items-center gap-2 pt-2`,children:[I,(0,X.jsx)(Mt,{run:e})]}):null,(0,X.jsx)(_n,{run:e,showTokens:ne.tokens,showCost:ne.cost,automationsAvailable:b.data?.capabilities?.automations===!0})]}),(0,X.jsx)(yn,{run:e}),(0,X.jsx)(bn,{run:e}),(0,X.jsxs)(`div`,{ref:P,"data-slot":`run-tabs`,"data-phone-bar":T||void 0,className:`mt-3 flex flex-wrap items-end gap-1 border-b border-border md:mt-5 max-md:flex-nowrap max-md:overflow-x-auto max-md:border-b-0 max-md:shadow-[inset_0_-1px_0_var(--border)] max-md:gap-0 max-md:[&>*]:mb-0 max-md:[&>*]:shrink-0 max-md:[&>a]:min-h-11 max-md:[&>a]:px-3.5 max-md:[&>a]:text-[13.5px]`,children:[(0,X.jsx)(U,{to:`/tasks/${e.id}`,active:t===`session`,replace:T,children:`Session`}),(0,X.jsx)(U,{to:`/tasks/${e.id}/changes`,active:t===`changes`,replace:T,count:T&&e.diffStat&&e.diffStat.files>0?e.diffStat.files:void 0,children:`Changes`}),(0,X.jsx)(U,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:T,children:`Commits`}),(0,X.jsx)(U,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:T,children:`Files`}),j.map(t=>(0,X.jsx)(U,{to:sn(e.id,t),active:A!==null&&an(t,A),replace:T,children:(0,X.jsx)(cn,{tab:t})},`${t.kind}-${t.number}`)),M.length>0?(0,X.jsxs)(J,{children:[(0,X.jsxs)(K,{"data-slot":`run-tabs-more`,"aria-label":`${M.length} more linked items`,className:`-mb-px flex h-8 items-center rounded-t-md border-b-2 border-transparent px-3 text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground max-md:min-h-11 max-md:px-3.5 max-md:text-[13.5px]`,children:[`+`,M.length]}),(0,X.jsx)(q,{align:`end`,children:M.map(t=>(0,X.jsx)(G,{asChild:!0,children:(0,X.jsx)(H,{to:sn(e.id,t),replace:T,children:(0,X.jsx)(cn,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]}),t===`session`?null:(0,X.jsx)(zt,{run:e}),t!==`session`&&e.steps.length>0?(0,X.jsx)(`div`,{className:`border-t border-border pt-1 pb-0 md:pt-2 md:pb-1`,children:(0,X.jsx)(nn,{runId:e.id,steps:e.steps})}):null,c?(0,X.jsx)(wn,{runId:e.id,onClose:()=>u(!1)}):null,d?(0,X.jsx)(dn,{run:e,canResume:Ge(e).terminal,onResume:()=>p.terminal.mutate(),onClose:()=>f(!1)}):null]}),(0,X.jsx)(Cn,{run:e,actions:p})]})})}function dn({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let a=d(),o=p(),s=L({mutationFn:t=>xe(e.id,t),onError:e=>y(e.message,{tone:`danger`})}),c=De(o.data),l=e=>!o.isSuccess||c.includes(e??`claude`),u=t&&l(He(e)),f=e.worktreePath?(a.data?.targets??[]).filter(e=>{let t=Be(e.id);return t===void 0||l(t)}).map(t=>({target:t,...Ve(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[];if(!u&&f.length===0)return null;let m=()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>y(`Worktree path copied`)).catch(()=>y(`Path: ${t}`))};if(r)return(0,X.jsx)(G,{onSelect:r,children:`Open in…`});let h=Ie(e);return(0,X.jsxs)(`section`,{"aria-label":`Open task worktree in…`,className:`task-action-panel my-5 rounded-xl border border-border bg-card p-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,X.jsx)(N,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,X.jsx)(ye,{})})]}),e.worktreePath?(0,X.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,X.jsxs)(`div`,{className:`task-open-targets mt-4 flex flex-wrap gap-3`,children:[u?(0,X.jsxs)(N,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,X.jsx)(Ye,{}),`Terminal (resume session)`]}):null,f.map(({target:e,suffix:t,title:n})=>{let r=Ae(e);return(0,X.jsxs)(N,{variant:`outline`,"data-target":e.id,title:n,disabled:s.isPending,onClick:()=>s.mutate(e.id),children:[(0,X.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,X.jsxs)(N,{variant:`outline`,onClick:m,children:[(0,X.jsx)(M,{}),`Copy worktree path`]}):null]}),h?(0,X.jsxs)(`div`,{className:`mt-5 border-t border-border pt-5`,children:[(0,X.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,X.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:h}),(0,X.jsxs)(N,{variant:`outline`,onClick:()=>void $(h,`Command copied to clipboard.`),children:[(0,X.jsx)(M,{}),`Copy resume command`]})]}):null]})}function fn(e,t){let n=he(),r=it(),[i,a]=(0,Y.useState)(null),o=()=>n.invalidateQueries({queryKey:j.runs.all}),s=e=>y(e.message,{tone:`danger`}),c=x(),l={isPending:c.isPending,mutate:()=>c.mutate({id:e.id,pinned:!e.pinned})},u=v();return{pin:l,markUnread:{isPending:u.isPending,mutate:()=>{t?.(),u.mutate(e.id,{onError:s})}},delete:L({mutationFn:()=>Oe(e.id),onSuccess:()=>{o(),r(`/`)},onError:s}),terminal:L({mutationFn:()=>D(e.id),onError:e=>{if(e instanceof Te&&e.command){$(e.command,`No terminal found — command copied to clipboard.`);return}s(e)}}),confirming:i,setConfirming:a}}async function $(e,t){try{await navigator.clipboard.writeText(e),y(t)}catch{y(`Run manually: ${e}`)}}function pn(e){let t=_(e.id),n=P(e);return{title:n,editor:Fe(n,e=>t.mutate({title:e},{onError:e=>y(e.message,{tone:`danger`})}))}}function mn({run:e}){let{title:t,editor:n}=pn(e);return n.editing?(0,X.jsx)(Ke,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,X.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:n.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,X.jsx)(Pe,{className:`size-3.5`,"aria-hidden":`true`})})]})}function hn({run:e,children:t}){let{title:n,editor:r}=pn(e);return(0,X.jsxs)(et,{open:r.editing,onOpenChange:e=>{e?r.begin():r.commit()},children:[(0,X.jsxs)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-px`,children:[(0,X.jsx)(`h1`,{className:`truncate text-[15px] leading-tight font-semibold text-foreground`,title:e.task,children:n}),t]}),(0,X.jsx)(Qe,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,className:`flex size-11 shrink-0 items-center justify-center rounded-sm text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,X.jsx)(Pe,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,X.jsx)($e,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),r.cancel()},children:(0,X.jsx)(Ke,{editor:r,className:`text-[16px] font-semibold`})})]})}function gn({branch:e}){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);let i=t===e,a=async()=>{r.current!==null&&clearTimeout(r.current),n(null);try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(e),n(e),r.current=setTimeout(()=>n(null),2e3)}catch{y(`Could not copy branch. Select and copy: ${e}`)}};return(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,X.jsx)(`span`,{"data-slot":`branch-chip`,className:`min-w-0 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium break-all`,children:e}),(0,X.jsxs)(`button`,{type:`button`,"aria-label":i?`Copied branch name`:`Copy branch name`,onClick:()=>void a(),className:`inline-flex min-h-11 shrink-0 items-center gap-1 rounded-sm px-2 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground md:min-h-8`,children:[(0,X.jsx)(M,{className:`size-3.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function _n({run:e,showTokens:t,showCost:n,automationsAvailable:r}){let a=l(),o=ae(),s=t=>o===void 0?void 0:C(o,e.id,t,a),d=(0,Y.useMemo)(()=>i(e,a),[e,a]),f=[(0,X.jsx)(`span`,{className:`min-w-0 max-w-full break-all`,children:ve(e)},`workflow`)];e.branch&&f.push((0,X.jsx)(gn,{branch:e.branch},`branch`));let p=d.filter(e=>e.kind===`PR`);for(let t of p)f.push((0,X.jsx)(Ze,{reference:t,to:s(t),taskTitle:P(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,X.jsx)(Le,{run:e,prNumber:t.number})},`pr-${t.number}`));let h=w(e);h&&R(h)&&!p.some(e=>e.url===h)&&f.push((0,X.jsx)(Ze,{reference:{kind:`PR`,url:h},taskTitle:P(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`pr`));let g=m(e,a);if(g&&R(g)){let t=c(g);f.push((0,X.jsx)(Ze,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:g},to:t?s({kind:`Issue`,number:Number(t),url:g}):void 0,taskTitle:P(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}e.diffStat&&f.push((0,X.jsx)(St,{stat:e.diffStat},`diff`)),e.automation&&f.push(r?(0,X.jsx)(H,{to:`/automations/${encodeURIComponent(e.automation.automationId)}/log`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium hover:text-foreground`,children:`Automation`},`automation`):(0,X.jsx)(`span`,{"data-slot":`automation-origin`,title:`Automations are off on this server (CEZ_AUTOMATIONS)`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium`,children:`Automation`},`automation`));let _=[];return t&&(e.inputTokens!==void 0||e.outputTokens!==void 0)&&_.push((0,X.jsx)(Ct,{inputTokens:e.inputTokens,outputTokens:e.outputTokens},`tokens`)),n&&e.costUsd!==void 0&&_.push((0,X.jsx)(`span`,{className:`tabular-nums`,children:u(e.costUsd)},`cost`)),(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{"data-slot":`run-meta`,className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground md:mt-1.5 md:gap-y-1`,children:[f.map((e,t)=>(0,X.jsxs)(Y.Fragment,{children:[t>0?(0,X.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,X.jsxs)(`span`,{className:`ml-auto flex min-w-0 max-w-full items-center gap-1.5`,children:[_.map((e,t)=>(0,X.jsxs)(Y.Fragment,{children:[t>0?(0,X.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,X.jsx)(xn,{run:e})]})]})})}function vn(e){let t=e.ciWait;return[`running`,`queued`,`waiting`].includes(e.status)&&t&&t.phase!==`delivered`&&t.phase!==`withdrawn`?t:void 0}function yn({run:e}){let t=vn(e),n=t??e.lastCiWait;if(!t&&e.lastCiWaitError)return(0,X.jsx)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`mt-1 min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:e.lastCiWaitError});if(!n)return null;let r=n.result,i={passed:`CI checks passed — observed checks only; not merge approval`,failed:`CI checks failed — inspect the PR checks`,cancelled:`CI wait cancelled`,skipped:`CI checks skipped — inspect the PR checks`,no_checks:`No CI checks found — inspect the PR workflows`,deadline:`CI wait timed out — inspect the PR checks`,error:`CI wait unavailable — inspect access and the PR checks`,head_changed:`CI head changed — ${r?.headSha.slice(0,7)} → ${r?.observedHeadSha?.slice(0,7)??`unknown`}`},a=t?n.phase===`wake-pending`?e.status!==`running`||e.activity===`monitoring`?`CI result ready — waiting for capacity`:`CI result ready — current turn still working`:`Waiting for CI`:r?i[r.outcome]:n.phase===`withdrawn`?`CI wait cancelled`:`CI wait unavailable`,o=t?n.deadline:r?.observedAt,s=o?new Date(o):void 0,c=s&&Number.isFinite(s.getTime())?new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(s):void 0,l=`${n.repository}#${n.prNumber}`;return(0,X.jsxs)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`mt-1 min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-1`,children:[(0,X.jsx)(`span`,{children:a}),(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`—`}),R(n.prUrl)?(0,X.jsx)(`a`,{href:n.prUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-h-11 min-w-11 max-w-full items-center rounded-sm px-1 font-medium text-foreground underline underline-offset-2 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:l}):(0,X.jsx)(`span`,{children:l})]}),c?(0,X.jsxs)(`p`,{children:[t?`Deadline`:`Observed`,` `,(0,X.jsx)(`time`,{dateTime:o,children:c})]}):t?(0,X.jsx)(`p`,{children:`CI deadline unavailable`}):null]})}function bn({run:e}){if(vn(e)||e.status!==`running`||e.activity!==`monitoring`)return null;if(e.monitoringWakeCapReached)return(0,X.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Automatic checks paused — 40/40 reached`});let t=e.monitoringWakeAt?new Date(e.monitoringWakeAt):null,n=t&&Number.isFinite(t.getTime())?t:null;if(!n)return(0,X.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Parked — no automatic check scheduled`});let r=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n);return(0,X.jsxs)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:[`Next automatic check`,` `,(0,X.jsx)(`time`,{dateTime:e.monitoringWakeAt,className:`font-medium text-foreground`,children:r})]})}function xn({run:e}){let t=le(),n=Se(),{accounts:r}=ot(),i=e.runner??t.data?.defaultRunner??`claude`,a=e.model??`auto`,o=e.effort||`auto`,s=[...e.steps].reverse().find(e=>e.profileId),c=s?.profileId,l=s?.backend??i,u=n.data?.profiles.find(e=>e.id===c&&e.provider===l),d=c===void 0||n.isPending?void 0:n.isError?c:c==="default"?st(r,l)?`default`:void 0:u?st(r,l)?u.label:void 0:`${c} (removed)`,p=e.modelIdentity&&e.modelIdentity!==a?e.modelIdentity:void 0,m=[i,d,a,o].filter(Boolean).join(` · `);return(0,X.jsxs)(J,{children:[(0,X.jsx)(K,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`agent-badge`,title:m,"aria-label":`Agent: ${i}, ${d?`account ${d}, `:``}model ${a}${o?`, effort ${o}`:``}`,className:`flex min-w-0 shrink items-center max-md:min-h-11 gap-1.5 rounded-sm px-1 py-1 text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:[(0,X.jsx)(f,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{"data-slot":`agent-badge-summary`,className:`truncate font-mono text-[11px]`,children:m})]})}),(0,X.jsxs)(q,{align:`end`,className:`min-w-[9rem] max-md:max-w-[calc(100vw-2rem)] max-md:break-all`,children:[(0,X.jsxs)(W,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`runner: `,i]}),d?(0,X.jsxs)(W,{"data-slot":`agent-badge-account`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`account: `,d]}):null,(0,X.jsxs)(W,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`model: `,a]}),o?(0,X.jsxs)(W,{"data-slot":`agent-badge-effort`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`effort: `,o]}):null,p?(0,X.jsxs)(W,{"data-slot":`agent-badge-identity`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`identity: `,p]}):null]})]})}function Sn({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=Ge(e),a=Ie(e);return(0,X.jsxs)(J,{children:[(0,X.jsx)(K,{asChild:!0,children:(0,X.jsx)(N,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,X.jsx)(ge,{"aria-hidden":`true`})})}),(0,X.jsxs)(q,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,X.jsx)(W,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,X.jsxs)(G,{onSelect:n,children:[(0,X.jsx)(je,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,X.jsx)(dn,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,X.jsxs)(G,{onSelect:()=>void $(a,`Command copied to clipboard.`),children:[(0,X.jsx)(M,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,X.jsxs)(G,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,X.jsx)(Et,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,X.jsxs)(lt,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,X.jsx)(Dt,{"aria-hidden":`true`}):(0,X.jsx)(s,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,i.deleteRun?(0,X.jsx)(ct,{}):null,i.deleteRun?(0,X.jsxs)(G,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,X.jsx)(h,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})}function Cn({run:e,actions:t}){let n=t.confirming;return(0,X.jsx)(_e,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,X.jsxs)(A,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,X.jsxs)(pe,{children:[(0,X.jsx)(E,{className:`text-danger`,children:`Delete task permanently?`}),(0,X.jsx)(T,{children:(0,X.jsxs)(X.Fragment,{children:[`Delete “`,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,title:P(e),children:P(e)}),`” and its transcript, worktree and branch. This cannot be undone.`]})})]}),(0,X.jsxs)(ue,{children:[(0,X.jsx)(fe,{children:`Cancel`}),(0,X.jsx)(F,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function wn({runId:e,onClose:t}){let n=se(e);return(0,X.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,X.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,X.jsx)(N,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,X.jsx)(ye,{})})]}),n.isPending?(0,X.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,X.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,X.jsx)(Pt,{runId:e,children:(0,X.jsx)(xt,{children:n.data})}):(0,X.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,X.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,X.jsx)(N,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void $(n.data??``,`Notes copied`),children:`Copy notes`}),(0,X.jsx)(N,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{Ut as a,It as c,Q as i,Pt as l,Zt as n,Vt as o,$t as r,Lt as s,un as t,jt as u};
|
|
@@ -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{At as r,Cr as i,Dr as a,Fr as o,G as s,Gt as ee,Pa as c,Pt as te,X as ne,Y as re,_ as l,d as ie,f as ae,g as u,h as d,in as oe,l as f,m as se,p as ce,qt as le,so as ue,tn as de,v as fe,ya as pe,z as me}from"./alert-dialog-C-xYE_dg.js";import{g as he,h as p,t as m,v as ge}from"./utils-fzNfbPzA.js";import{i as _e,n as ve,r as ye}from"./use-desktop-CrDny2uG.js";import{L as be,c as xe,m as Se,p as Ce,r as we}from"./prompt-templates-CBPp39IU.js";import{f as Te}from"./format-dBiNDNVe.js";import{i as Ee,n as De,r as Oe,t as ke}from"./skills-DFBiAuJG.js";import{t as Ae}from"./use-submit-shortcut-KWJsC906.js";var h=e(t(),1);function je(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function Me(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function g(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat||je(e.target)&&!Me(e.target))}function Ne(e,t){let n=h.useRef(t);h.useLayoutEffect(()=>{n.current=t}),h.useEffect(()=>{let t=t=>{g(t,e)&&(t.preventDefault(),n.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Pe(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||je(e.target))}function _(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function v(e,t){let n=h.useRef(t);h.useLayoutEffect(()=>{n.current=t}),h.useEffect(()=>{let t=t=>{Pe(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function y(e){let[t,n]=h.useState(()=>Date.now());return h.useEffect(()=>{if(o())return;let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Fe={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,avif:`image/avif`,md:`text/markdown`,markdown:`text/markdown`,txt:`text/plain`,log:`text/plain`,pdf:`application/pdf`};function Ie(e){return he(e.type)?e.type:Fe[e.name.split(`.`).pop()?.toLowerCase()??``]??null}async function Le(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));let r=btoa(n),i=Ie(e)??`application/octet-stream`,a=ge(i);return{mediaType:i,data:r,...a?{preview:`data:${i};base64,${r}`}:{},name:e.name||(a?`pasted image`:`pasted.${p(i)}`),isImage:a}}function Re(e,t){let n=[],r=[],i=t;for(let t of e){let e=t.name||`attachment`;if(Ie(t)===null){r.push(`${e} is not a supported attachment (images, PDF and plain-text files such as TXT or MD)`);continue}if(t.size>5242880){r.push(`${e} is too large (max 5 MB)`);continue}if(i>=4){r.push(`${e} skipped — max 4 attachments per message`);continue}n.push(t),i+=1}return{accepted:n,rejected:r}}var b=new Set([`/`,`@`]);function ze(e,t){for(let n=t-1;n>=0;--n){let r=e[n];if(/\s/.test(r))return null;if(b.has(r))return n>0&&!/\s/.test(e[n-1])?null:{trigger:r,start:n,query:e.slice(n+1,t)}}return null}function Be(e,t,n,r){let i=`${t.trigger}${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}function Ve(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function x(e,t){let n=e,r=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let i=t.results[e],a=i[0]?.transcript??``;i.isFinal?n+=a:r+=a}return{finalText:n,interim:r}}function He(e){let[t,n]=h.useState(null),r=h.useRef(null),i=h.useRef(``),[a]=h.useState(()=>Ve()!==void 0),o=h.useCallback(()=>{let e=r.current;r.current=null,i.current=``,n(null),e&&(e.onresult=null,e.onerror=null,e.onend=null,e.abort())},[]);return h.useEffect(()=>o,[o]),{supported:a,recording:t,start:h.useCallback(()=>{if(r.current)return;let t=Ve();if(!t)return;let a;try{a=new t,a.lang=navigator.language||`en-US`,a.continuous=!0,a.interimResults=!0;let s=Date.now();a.onresult=e=>{let t=x(i.current,e);i.current=t.finalText,n({transcript:t.finalText+t.interim,startedAt:s})},a.onerror=t=>{e(`Dictation failed${t.error?` — ${t.error}`:``}`),o()},a.start(),r.current=a,n({transcript:``,startedAt:s})}catch{e(`Dictation failed — the microphone could not be started`),o()}},[e,o]),cancel:h.useCallback(()=>o(),[o]),finish:h.useCallback(()=>{let e=r.current,a=(i.current+``).trim()===``?``:i.current,o=t?.transcript??a;return e&&(e.onresult=null,e.onerror=null,e.onend=null,e.stop()),r.current=null,i.current=``,n(null),o.trim()},[t])}}function Ue(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`}var S=n(),We=new Map,Ge={KeyA:`Yes, approved.`,KeyC:`Continue.`};function Ke({onSubmit:e,retainDraftUntilSuccess:t=!1,onStop:n,onFinish:o,finishing:l=!1,secondaryAction:ie,stopOnEmpty:ae=!1,stopping:u=!1,emptySubmitLabel:d,compactFeedback:se=!1,idleFeedback:ce,pendingLabel:fe=`Starting task…`,failureHint:me=`Could not confirm submission. Check Tasks before you retry. Your draft is kept.`,clearOnSuccess:he=!0,onPendingChange:p,value:ge,onValueChange:Te,autoFocus:Me=!1,mobileCollapsible:g=!1,mobileDisclosureKey:Ne,footerStart:Pe,footerEnd:_,sessionControls:v,executionOptions:y,agentOptions:Fe,sendAriaLabel:Ie=`Send`,disabled:b=!1,disabledReason:Ve=`Session closed — Continue to reopen.`,allowEmptySubmit:x=!1,placeholder:Ue=`Reply — / for skills, @ for files…`,ariaLabel:Ke=`Reply to the agent`,autocompleteSkills:C=!0,quickReplies:Ye=!1,getMentionCandidates:w,ref:Xe}){let[Ze,Qe]=(0,h.useState)(``),T=ge??Ze,E=(0,h.useRef)(T);E.current=T;let $e=(0,h.useRef)(Te);$e.current=Te;let D=(0,h.useCallback)(e=>{let t=typeof e==`function`?e(E.current):e;Qe(t),$e.current?.(t)},[]),[O,k]=(0,h.useState)([]),A=(0,h.useRef)(O);A.current=O;let[et,tt]=(0,h.useState)(!1),j=u||et,M=(0,h.useRef)(j);M.current=j;let N=T.trim()!==``||O.length>0,nt=!N&&(n!==void 0&&ae||j),rt=!N&&!nt&&o!==void 0,it=nt||rt||!N&&d!==void 0,at=!N&&d?d:Ie,[P,F]=(0,h.useState)(!1),I=(0,h.useRef)(!1),ot=(0,h.useRef)(0),L=(0,h.useRef)(!0);(0,h.useEffect)(()=>(L.current=!0,()=>{L.current=!1}),[]);let[R,z]=(0,h.useState)(null),B=j||t&&P,V=()=>M.current||t&&I.current,[H,U]=(0,h.useState)(null),[st,ct]=(0,h.useState)(``),[lt,ut]=(0,h.useState)(!1),W=(0,h.useRef)(null),G=(0,h.useId)(),dt=(0,h.useId)(),ft=(0,h.useRef)(new Map),pt=Ne===void 0?ft.current:We,mt=Ne??`default`,[,ht]=(0,h.useReducer)(e=>e+1,0),K=pt.get(mt)??!1,gt=g&&!K,_t=(0,h.useRef)(null),vt=(0,h.useRef)(null),q=(0,h.useRef)(null),yt=i(C&<),J=a(),bt=ue(),Y=He(e=>c(e,{tone:`danger`}));(0,h.useEffect)(()=>{Me&&W.current?.focus()},[]),(0,h.useImperativeHandle)(Xe,()=>({insertAtCaret:e=>{if(V())return;let t=W.current,n=we(E.current,t?.selectionStart??E.current.length,e);D(n.text),q.current=n.caret,t?.focus()}}),[D,t]);let xt=(0,h.useCallback)(()=>{let e=W.current;if(!e||b||V()){U(null);return}let t=ze(e.value,e.selectionStart??e.value.length);if(t?.trigger===`/`&&!C||t?.trigger===`@`&&w===void 0)return U(null);t?.trigger===`/`&&ut(!0),U(t)},[C,b,w,t]),X=(0,h.useMemo)(()=>H===null?[]:H.trigger===`/`?De(yt.data??[],H.query,J.data?.skillUsage).map(e=>({value:`${e.name} ${e.path}`,insert:e.name,label:e.name,description:e.description,emphasized:Ee(e)})):(w?.()??[]).filter(e=>Oe(e,H.query)).map(e=>({value:e,insert:e,label:e,emphasized:!1})),[w,yt.data,H,J.data?.skillUsage]),Z=X.some(e=>e.value===st)?st:X[0]?.value,Q=H!==null;(0,h.useLayoutEffect)(()=>{!Q||!Z||[...vt.current?.querySelectorAll(`[data-slot="composer-menu-item"]`)??[]].find(e=>e.getAttribute(`data-value`)===Z)?.scrollIntoView({block:`nearest`})},[Z,Q]);let St=(0,h.useCallback)(()=>U(null),[]),Ct=e=>{let t=W.current;if(!t||H===null||V())return;let n=t.selectionStart??t.value.length,r=Be(t.value,H,n,e.insert);H.trigger===`/`&&J.data!==void 0&&pe({skillUsage:ke(J.data.skillUsage,e.insert)}).then(()=>bt.invalidateQueries({queryKey:oe.uiState})).catch(()=>{}),D(r.text),q.current=r.caret,U(null),t.focus()};(0,h.useLayoutEffect)(()=>{let e=q.current,t=W.current;e!==null&&t&&(t.setSelectionRange(e,e),q.current=null)},[T]),(0,h.useLayoutEffect)(()=>{let e=W.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)},[T,K]);let wt=(0,h.useCallback)(e=>{if(b||V())return;let n=ot.current,r=Re(e,A.current.length);for(let e of r.rejected)c(e,{tone:`danger`});for(let e of r.accepted)Le(e).then(e=>{!L.current||t&&I.current&&!M.current||n!==ot.current||k(t=>t.length>=4?t:[...t,e])},()=>c(`${e.name||`Attachment`} could not be read — try attaching it again`,{tone:`danger`}))},[b,t]),Tt=e=>{let t=[...e.clipboardData?.items??[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length!==0&&(e.preventDefault(),wt(t))},Et=e=>{let t=[...e.dataTransfer?.files??[]];t.length!==0&&(e.preventDefault(),wt(t))},$=(0,h.useCallback)(async(n,r,i)=>{let a=n.trim();if(!(b||u||I.current)&&!(a===``&&r.length===0&&!x)){I.current=!0,t&&(ot.current+=1),F(!0),z(null),p?.(!0),U(null),i&&!t&&(D(``),k([]));try{await e(a,r.map(({mediaType:e,data:t})=>({mediaType:e,data:t}))),L.current&&t&&he&&(E.current===n&&D(``),A.current===r&&k([]))}catch(e){if(!L.current&&t)return;let a=e instanceof Error?e.message:String(e);t?z(a):(c(a,{tone:`danger`}),i&&(D(e=>e===``?n:`${n}\n${e}`),k(e=>[...r,...e].slice(0,4))))}finally{I.current=!1,L.current&&(p?.(!1),F(!1))}}},[x,b,u,e,t,he,p,D]),Dt=(0,h.useCallback)(()=>{b||u||I.current||$(E.current,A.current,!0)},[b,u,$]),Ot=async()=>{if(!(!n||u||I.current)){I.current=!0,F(!0),tt(!0),z(null);try{await n()}catch(e){L.current&&z(e instanceof Error?e.message:String(e))}finally{I.current=!1,L.current&&(F(!1),tt(!1))}}},kt=e=>{if(Q){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),X.length===0)return;let t=X.findIndex(e=>e.value===Z),n=e.key===`ArrowDown`?1:-1,r=X[(t+n+X.length)%X.length];ct(r.value);return}if(e.key===`Escape`){e.preventDefault(),St();return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=X.find(e=>e.value===Z);if(t){e.preventDefault(),Ct(t);return}St()}}Ae({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),Dt())};(0,h.useEffect)(()=>{if(!Ye||b)return;let e=e=>{if(!e.altKey||e.metaKey||e.ctrlKey||e.repeat||je(e.target))return;let t=Ge[e.code];t!==void 0&&(e.preventDefault(),$(t,[],!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b,Ye,$]);let At=e=>{if(b||M.current||I.current&&(e||t))return;let n=Y.finish();if(n===``)return;let r=T.trim()===``?n:`${T.replace(/\s*$/,``)} ${n}`;if(e){t&&D(r),$(r,O,!0);return}D(r),q.current=r.length,W.current?.focus()},jt=Y.recording,Mt=Y.supported?(0,S.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,disabled:b||B,"aria-label":`Start dictation`,title:`Dictation`,className:m(`h-11 gap-1.5 px-2.5 text-xs font-medium text-muted-foreground md:h-8`,gt&&`hidden md:inline-flex`),onClick:()=>{V()||Y.start()},children:[(0,S.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),y||v?null:`Dictation`]}):null,Nt=rt?(0,S.jsxs)(f,{type:`button`,"data-slot":`composer-finish`,"aria-label":l?`Finishing…`:`Finish`,"aria-busy":l||void 0,title:`Close the session and mark this task done`,disabled:P||j||l,className:`h-11 w-auto gap-[7px] px-5 active:opacity-80`,onClick:()=>void o?.(),children:[(0,S.jsx)(re,{"aria-hidden":`true`}),l?`Finishing…`:`Finish`]}):null,Pt=n||j?(0,S.jsxs)(f,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":j?`Stopping…`:`Stop`,"aria-busy":j||void 0,title:j?`Waiting for execution to stop`:`Stop execution; keep existing work`,disabled:P||j,className:m(`h-11 min-w-11 active:opacity-80`,it?`w-auto px-3`:`w-11`),onClick:()=>void Ot(),children:[(0,S.jsx)(ee,{"aria-hidden":`true`,className:`size-3 fill-current`}),it?j?`Stopping…`:`Stop`:null]}):null,Ft=j||P||R!==null||ce!=null,It=(0,S.jsx)(S.Fragment,{children:t||n||u?(0,S.jsx)(`div`,{className:m(`overflow-y-auto text-xs leading-5 text-muted-foreground`,se&&!Ft?`h-0`:`px-3 pb-2 md:px-4`,se?Ft&&`min-h-6`:`h-24 md:h-20`),children:(0,S.jsx)(`div`,{id:`${G}-submission`,role:R===null?`status`:`alert`,"aria-atomic":`true`,tabIndex:R===null?void 0:0,className:`break-words`,children:j?`Stopping execution. Your draft is kept.`:P?fe:R===null?ce??null:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{className:`font-medium text-foreground`,children:R}),(0,S.jsx)(`p`,{children:me})]})})}):null}),Lt=(0,S.jsxs)(`div`,{"data-slot":`composer-submit-row`,className:m(`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1 md:flex-nowrap`,y&&`new-task-submission`),children:[y||v?null:Mt,_?(0,S.jsx)(`div`,{id:dt,"data-slot":`composer-footer-end`,className:m(`min-w-0 flex-wrap items-center gap-1.5 md:flex-nowrap`,y&&`mr-auto`,g&&`max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11`,gt?`hidden md:flex`:`flex`),children:(0,S.jsx)(`div`,{className:`contents`,inert:B||void 0,children:_})}):null,(0,S.jsxs)(`div`,{className:`flex min-w-[100px] items-center justify-end gap-1`,"data-slot":`composer-actions`,children:[Pt??ie,Nt,!nt&&!rt?(0,S.jsxs)(f,{type:`button`,size:`icon-sm`,"aria-label":at,"aria-busy":P&&!j||void 0,disabled:b||P||j||!N&&!x,className:m(y?`h-12 w-full gap-2 px-6`:v?`h-11 w-auto gap-2 px-5`:`size-11`,!N&&d&&`w-auto px-3`,`active:opacity-80`),onClick:Dt,children:[!v&&!N&&d?(0,S.jsx)(be,{"aria-hidden":`true`}):null,y||v||!N&&d?at:null,v||N||!d?(0,S.jsx)(s,{"aria-hidden":`true`}):null]}):null]})]});return(0,S.jsxs)(ve,{open:Q,onOpenChange:e=>e?void 0:St(),children:[(0,S.jsx)(ye,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:_t,"data-slot":`composer`,"data-disabled":b||void 0,onDrop:Et,onDragOver:e=>e.preventDefault(),className:m(y&&`new-task-composer`,v&&`session-composer`,b&&`opacity-80`),children:[(0,S.jsxs)(`div`,{"data-slot":`composer-editor`,className:m(`rounded-xl border border-[var(--composer-border)] bg-card shadow-none transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/15`,y&&`new-task-editor`),children:[O.length>0?(0,S.jsx)(`div`,{"data-slot":`composer-thumbs`,className:`flex flex-nowrap items-center gap-2 overflow-x-auto px-4 pt-3 md:flex-wrap md:overflow-visible`,children:O.map((e,t)=>(0,S.jsxs)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,title:B?`Attachment submitted`:`Click to remove`,disabled:B,className:m(`group relative shrink-0 overflow-hidden rounded-md border border-border`,e.isImage?`size-12`:`flex h-12 min-w-11 max-w-[200px] items-center gap-1.5 bg-muted/40 px-2.5 text-xs text-muted-foreground`),onClick:()=>{V()||k(e=>e.filter((e,n)=>n!==t))},children:[e.isImage?(0,S.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(te,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,S.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,S.jsx)(`span`,{className:`absolute inset-0 hidden items-center justify-center bg-background/70 group-hover:flex group-focus-visible:flex`,children:(0,S.jsx)(de,{"aria-hidden":`true`,className:`size-4`})})]},`${e.name}-${t}`))}):null,(0,S.jsx)(`label`,{htmlFor:G,className:y?`hidden px-5 pt-5 text-xs text-muted-foreground md:block`:`sr-only`,children:y?`Task description`:Ke}),(0,S.jsx)(`textarea`,{ref:W,id:G,autoComplete:`off`,rows:1,value:T,disabled:b,readOnly:B,"aria-busy":B||void 0,"aria-describedby":t?`${G}-submission`:void 0,"aria-label":Ke,placeholder:b?Ve:Ue,className:m(`block min-h-11 w-full resize-none bg-transparent px-3 pt-2.5 pb-1 text-base leading-normal outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:min-h-[54px] md:px-4 md:pt-3 md:text-sm`,gt?`max-h-11 md:max-h-[220px]`:`max-h-[220px]`,y&&`md:text-base`),onChange:e=>{V()||(D(e.target.value),xt())},onKeyDown:kt,onSelect:xt,onPaste:Tt}),y?(0,S.jsxs)(`p`,{"data-slot":`composer-skill-hint`,className:`flex items-center gap-2 px-5 pt-3 pb-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(le,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),`Type / for a skill or workflow`]}):null,v&&jt?(0,S.jsx)(`div`,{"data-slot":`session-controls`,inert:B||void 0,children:v}):null,jt?(0,S.jsxs)(`div`,{children:[(0,S.jsx)(Je,{transcript:jt.transcript,startedAt:jt.startedAt,insertionDisabled:B,onCancel:Y.cancel,onInsert:()=>At(!1),onInsertAndSend:()=>At(!0)}),Pt?(0,S.jsx)(`div`,{className:`flex justify-end px-2 pb-2`,children:Pt}):null]}):(0,S.jsxs)(`div`,{"data-slot":`composer-toolbar`,className:`flex flex-wrap items-center gap-1 gap-y-1 px-1.5 pt-1 pb-1.5 md:gap-y-1.5 md:px-2 md:pt-1.5 md:pb-2`,children:[v?(0,S.jsx)(`div`,{"data-slot":`session-controls`,inert:B||void 0,children:v}):null,(0,S.jsxs)(`div`,{"data-slot":`composer-footer-start`,className:m(`flex min-w-0 flex-wrap items-center gap-1`,y&&`w-full`),children:[(0,S.jsx)(qe,{disabled:b||B,onFiles:wt}),g?(0,S.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":K?`Collapse composer`:`Expand composer`,"aria-expanded":K,"aria-controls":_?`${G} ${dt}`:G,onClick:()=>{pt.set(mt,!K),ht()},children:(0,S.jsx)(ne,{"aria-hidden":`true`,className:m(`transition-transform motion-reduce:transition-none`,!K&&`rotate-180`)})}):null,(0,S.jsx)(`div`,{className:`contents`,inert:B||void 0,children:Pe}),y||v?(0,S.jsx)(`div`,{children:Mt}):null]}),y?null:Lt]}),y?null:It]}),y?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{"data-slot":`composer-agent-options`,inert:B||void 0,children:Fe}),(0,S.jsx)(`div`,{"data-slot":`composer-execution-panel`,inert:B||void 0,children:y}),Lt,(0,S.jsx)(`div`,{"data-slot":`composer-feedback`,children:It})]}):null]})}),(0,S.jsx)(_e,{side:`top`,align:`start`,sideOffset:8,className:`w-80 max-w-[calc(100vw-2rem)] p-0`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{_t.current?.contains(e.target)&&e.preventDefault()},children:(0,S.jsx)(xe,{shouldFilter:!1,value:Z??``,onValueChange:ct,children:(0,S.jsx)(Se,{ref:vt,"data-slot":`composer-menu`,"data-trigger":H?.trigger,className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] p-1`,children:X.length===0?(0,S.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:H?.trigger===`@`?`No files seen in this session yet — full file search arrives with the Files tab.`:yt.isPending?`Loading skills…`:`No matching skills.`}):X.map(e=>(0,S.jsxs)(Ce,{value:e.value,"data-slot":`composer-menu-item`,"data-emphasized":e.emphasized||void 0,onSelect:()=>Ct(e),children:[(0,S.jsx)(`span`,{className:m(`shrink-0 truncate`,e.emphasized&&`font-semibold`,H?.trigger===`@`&&`font-mono text-xs`),children:e.label}),e.description?(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.value))})})})]})}function qe({disabled:e,onFiles:t}){let n=(0,h.useRef)(null);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,title:`Attach an image, PDF, TXT or MD file (or paste a screenshot)`,disabled:e,className:`size-11 text-muted-foreground`,onClick:()=>n.current?.click(),children:(0,S.jsx)(te,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,S.jsx)(`input`,{ref:n,type:`file`,accept:`image/*,application/pdf,text/plain,text/markdown,.pdf,.txt,.md,.markdown,.log`,multiple:!0,className:`hidden`,"aria-hidden":`true`,tabIndex:-1,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function Je({transcript:e,startedAt:t,insertionDisabled:n,onCancel:r,onInsert:i,onInsertAndSend:a}){let o=y(1e3);return(0,S.jsxs)(`div`,{"data-slot":`dictation-overlay`,role:`status`,"aria-label":`Dictation in progress`,className:`flex items-center gap-2.5 rounded-b-xl border-t border-border bg-muted/60 px-3 py-2`,children:[(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none animate-pulse rounded-full bg-danger motion-reduce:animate-none`}),(0,S.jsx)(`span`,{"data-slot":`dictation-timer`,className:`text-xs font-medium text-muted-foreground tabular-nums`,children:Ue(t,o)}),(0,S.jsx)(`span`,{"data-slot":`dictation-transcript`,"aria-live":`polite`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e===``?(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:`Listening…`}):e}),(0,S.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Cancel dictation`,className:`size-11 text-muted-foreground md:size-8`,onClick:r,children:(0,S.jsx)(de,{"aria-hidden":`true`})}),(0,S.jsx)(f,{type:`button`,variant:`outline`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription`,className:`size-11 md:size-8`,onClick:i,children:(0,S.jsx)(re,{"aria-hidden":`true`})}),(0,S.jsx)(f,{type:`button`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription and send`,className:`size-11 md:size-8`,onClick:a,children:(0,S.jsx)(s,{"aria-hidden":`true`})})]})}function C(){return(0,S.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,S.jsx)(me,{icon:(0,S.jsx)(Te,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}function Ye({...e}){return(0,S.jsx)(ie,{"data-slot":`sheet`,...e})}function w({...e}){return(0,S.jsx)(fe,{"data-slot":`sheet-trigger`,...e})}function Xe({...e}){return(0,S.jsx)(ae,{"data-slot":`sheet-close`,...e})}function Ze({...e}){return(0,S.jsx)(u,{"data-slot":`sheet-portal`,...e})}function Qe({className:e,...t}){return(0,S.jsx)(d,{"data-slot":`sheet-overlay`,className:m(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function T({className:e,children:t,side:n=`right`,showCloseButton:r=!0,overlayClassName:i,...a}){return(0,S.jsxs)(Ze,{children:[(0,S.jsx)(Qe,{className:i}),(0,S.jsxs)(ce,{"data-slot":`sheet-content`,className:m(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...a,children:[t,r&&(0,S.jsxs)(ae,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,S.jsx)(de,{className:`size-4`}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function E({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`sheet-header`,className:m(`flex flex-col gap-1.5 p-4`,e),...t})}function $e({className:e,...t}){return(0,S.jsx)(l,{"data-slot":`sheet-title`,className:m(`font-semibold text-foreground`,e),...t})}function D({className:e,...t}){return(0,S.jsx)(se,{"data-slot":`sheet-description`,className:m(`text-sm text-muted-foreground`,e),...t})}export{E as a,C as c,_ as d,Ne as f,D as i,Ke as l,Xe as n,$e as o,v as p,T as r,w as s,Ye as t,y as u};
|
|
@@ -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{An as r,Ar as i,Cr as a,Fi as o,Gt as s,It as c,Lt as l,Mr as u,Pa as d,Pr as f,Q as p,Rt as m,U as h,Ut as g,Wt as _,Yt as v,in as y,jt as b,ki as x,l as S,nn as C,no as w,ot as T,qn as E,ro as D,so as O,vi as k,wa as A,wr as j,xa as M,xi as N,z as P}from"./alert-dialog-C-xYE_dg.js";import{t as F}from"./utils-fzNfbPzA.js";import{F as I}from"./prompt-templates-CBPp39IU.js";import{r as L,u as ee}from"./format-dBiNDNVe.js";import{a as te,i as ne,n as re,o as ie,r as ae,s as oe}from"./textarea-DxlkE-Yd.js";import{i as R,l as z,n as B,o as V,p as H}from"./skills-DFBiAuJG.js";import{D as U,T as W,_ as G,w as K}from"./index-CatemBEL.js";import{t as se}from"./skill-empty-hint-oOtzR3v0.js";var q=e(t(),1),J=n(),ce=`https://github.com/open-mercato/skills`;function le(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function Y(e,t){return le(e)??[...t]}function X({projectId:e}){let t=O(),n=u(),i=r(),[a,o]=(0,q.useState)(``),l=j(e,!!e),p=i.data??[],h=(0,q.useMemo)(()=>p.map(e=>e.name),[p]),g=(0,q.useRef)([]);g.current=h;let x=(0,q.useMemo)(()=>new Set(Y(n.data,h)),[n.data,h]),S=(0,q.useRef)(Promise.resolve()),C=(0,q.useRef)(0),w=(0,q.useCallback)(e=>{let n=f.uiState,r=t.getQueryData(n),i=e(Y(r,g.current));t.setQueryData(n,{...r,importedSkills:i});let a=++C.current;S.current=S.current.then(async()=>{try{let e=await M({importedSkills:i});a===C.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:y.skills}))}catch(e){d(e instanceof Error?e.message:String(e),{tone:`danger`}),a===C.current&&t.invalidateQueries({queryKey:n})}})},[t]),T=(0,q.useCallback)(e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[w]),E=h.length>0&&h.every(e=>x.has(e)),D=(0,q.useCallback)(()=>{if(E){let e=new Set(g.current);w(t=>t.filter(t=>!e.has(t)))}else w(e=>[...new Set([...e,...g.current])])},[E,w]);if(i.isError)return(0,J.jsx)(P,{icon:(0,J.jsx)(v,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:i.error.message});let k=z(p,a);return(0,J.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`w-full min-w-0 [&_button]:min-h-11`,children:[(0,J.jsx)(`p`,{className:`mb-4 text-[12px] font-medium tracking-wide text-link-foreground`,children:`OPEN-MERCATO / SKILLS`}),(0,J.jsx)(`h2`,{className:`text-2xl font-medium`,children:`Manage skills`}),(0,J.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`a`,{href:ce,target:`_blank`,rel:`noreferrer`,children:`open-mercato`}),` skills appear in your catalog and composer picker. All are enabled by default; uncheck any you don’t want.`]}),(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Applies across projects · saved automatically`}),(0,J.jsx)(ue,{projectId:e,state:l.data,loadError:l.error}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Checkboxes control visibility. Updating refreshes installed skill files; it does not change your selection.`}),(0,J.jsxs)(`div`,{className:`sw-import-controls mt-4 flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`sw-search relative min-w-0 flex-1`,children:[(0,J.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(K,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:a,onChange:e=>o(e.target.value),className:`h-11 min-w-0 pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`import-all`,disabled:h.length===0||n.isPending,onClick:D,className:`h-11 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[E?(0,J.jsx)(b,{"aria-hidden":`true`,className:`size-4`}):(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-4`}),E?`Remove all`:`Enable all`]})]}),(0,J.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:i.isPending?(0,J.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):k.length>0?k.map(e=>{let t=x.has(e.name);return(0,J.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:F(`flex min-h-16 cursor-pointer items-start gap-3 rounded-lg border border-border p-4 transition-colors hover:bg-muted`,t&&`bg-background`),children:[(0,J.jsxs)(`span`,{className:`relative size-5 shrink-0`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>T(e.name),className:`peer absolute inset-0 m-0 size-5 opacity-0`}),t?(0,J.jsx)(_,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`}):(0,J.jsx)(s,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`})]}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:`min-w-0 break-words text-[13px] font-medium text-foreground`,children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,J.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:p.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ue({projectId:e,state:t,loadError:n}){let r=O(),i=ee(),a=(0,q.useRef)(0),[s,c]=(0,q.useState)(!1),u=D({mutationFn:()=>o({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{c(!1),i(I(e))},onError:e=>d(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===a.current&&(r.setQueryData(f.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(r.invalidateQueries({queryKey:y.skills}),d(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),c(!0)))},h=(e,t)=>{t.seq===a.current&&d(e.message,{tone:`danger`})},g=D({mutationFn:t=>x(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),_=D({mutationFn:t=>N(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),v=e=>{let n=++a.current;e===`apply`?_.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):g.mutate({action:e,seq:n})},b=t?.scopes.some(e=>e.skills.length>0)??!1,C=t?.status===`error`,w=b&&(t?.available||C),T=_.isPending||t?.status===`updating`,E=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],k=t?.scopes.filter(e=>e.updatedAt&&!E.includes(e))??[],A=`Checking installed Open Mercato skills…`;return n?A=`Update status is unavailable right now.`:t?.status===`available`?A=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?A=`Updating installed Open Mercato skills…`:t?.status===`current`?A=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?A=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(A=`The update did not finish for every installation.`),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-background p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:A}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Project and global installations are checked separately.`}),t?.checkedAt?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,J.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,J.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,E.length>0?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,E.map(e=>Z(e.scope)).join(`, `),k.length?`; updated: ${k.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),w?(0,J.jsxs)(S,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:F(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:C?`Retry`:`Update now`]}):t?.status===`current`?(0,J.jsxs)(S,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:`size-4`}),`Check again`]}):t?.status===`unavailable`||n?(0,J.jsx)(S,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,J.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,J.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,J.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-accent-strong/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,J.jsx)(p,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-link-foreground`}),(0,J.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,J.jsx)(re,{open:s,onOpenChange:e=>u.isPending?void 0:c(e),children:(0,J.jsxs)(ae,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,J.jsxs)(ie,{children:[(0,J.jsx)(oe,{children:`Apply the upgrade notes now?`}),(0,J.jsxs)(ne,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,J.jsxs)(te,{children:[(0,J.jsx)(S,{type:`button`,variant:`outline`,disabled:u.isPending,onClick:()=>c(!1),children:`No`}),(0,J.jsx)(S,{type:`button`,disabled:u.isPending,onClick:()=>u.mutate(),children:u.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function de(){return(0,J.jsx)(`div`,{"data-route":`skills`,className:`mx-auto min-h-full w-full px-[18px] py-6 md:p-9`,children:(0,J.jsx)(fe,{})})}function fe(){let e=a(),t=i(),n=r(),[o]=w(),[s,c]=(0,q.useState)(``),u=O(),f=E(),p=k().projectId??f.data?.bootProject??``,_=D({mutationFn:()=>A(),onSuccess:e=>{u.setQueryData(y.skills,e),d(`Team skills refreshed.`)},onError:e=>d(e.message,{tone:`danger`})});if(e.isError)return(0,J.jsx)(P,{icon:(0,J.jsx)(v,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let b=V(e.data??[]),x=(n.data?.length??0)>0,S=o.get(`skill`),j=S===Q||S===$||S!==null&&b.some(e=>e.name===S)?S:b[0]?.name??(x?$:Q),M=b.find(e=>e.name===j)??null,N=B(b,s);return(0,J.jsxs)(`div`,{"data-slot":`skills-section`,className:`@container flex min-w-0 flex-col gap-[22px]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-4 @min-[700px]:flex-row @min-[700px]:items-center @min-[700px]:justify-between`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-[25px] font-semibold md:text-[30px]`,children:`Skills`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground md:text-[13px]`,children:`Markdown playbooks your agents can follow.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?(0,J.jsxs)(L,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":j===$?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Manage skills`]}):null,(0,J.jsxs)(L,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":j===Q?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(C,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Run from GitHub`]})]})]}),(0,J.jsxs)(`div`,{className:F(`flex-col items-start gap-2 sm:flex-row sm:items-center md:flex`,S===null?`flex`:`hidden`),children:[(0,J.jsxs)(`div`,{className:`sw-search relative w-full min-w-0 flex-1`,children:[(0,J.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(K,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:s,onChange:e=>c(e.target.value),className:`h-11 min-w-0 bg-card pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:_.isPending,onClick:()=>_.mutate(),className:`flex h-11 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:F(`size-3`,_.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,J.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] md:grid-cols-[minmax(220px,310px)_minmax(0,1fr)]`,children:[(0,J.jsx)(`section`,{"data-slot":`skills-list`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card p-3 md:flex`,S===null?`flex`:`hidden`),children:(0,J.jsx)(`ul`,{"data-slot":`skill-rows`,className:`flex min-h-0 flex-col gap-1 overflow-y-auto md:max-h-[calc(100dvh-280px)]`,children:e.isPending?(0,J.jsx)(`li`,{role:`status`,"aria-busy":`true`,className:`min-h-72 p-3 text-[13px] text-soft-foreground`,children:`Loading skills…`}):N.length>0?N.map(e=>(0,J.jsx)(pe,{skill:e,active:j===e.name,highlighted:j===$&&e===b[0]},e.path)):(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:b.length>0?`(no skills match)`:(0,J.jsx)(se,{})})})}),(0,J.jsx)(`section`,{"data-slot":`skills-detail`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card md:flex`,S===null?`hidden`:`flex`),children:(0,J.jsxs)(`div`,{className:`min-w-0 p-5`,children:[(0,J.jsxs)(L,{to:`/skills`,"data-slot":`skills-back`,className:`mb-4 inline-flex min-h-11 items-center gap-2 rounded-lg border border-border px-3 text-xs font-medium hover:bg-muted md:hidden`,children:[(0,J.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),j===$?(0,J.jsx)(X,{projectId:p}):j===Q?(0,J.jsx)(G,{skills:b}):M?(0,J.jsx)(W,{skill:M,usedBy:H(t.data?.workflows??[],M.name)}):e.isPending?(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`min-h-72 text-xs text-muted-foreground`,children:`Loading skill…`}):(0,J.jsx)(P,{icon:(0,J.jsx)(g,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})]})}function pe({skill:e,active:t,highlighted:n}){let r=R(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(L,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-highlighted":n||void 0,"data-project":r?`true`:void 0,"aria-current":t?`page`:void 0,className:F(`selection-row flex min-h-24 flex-col gap-2 rounded-lg border-b border-border p-3 transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground`,(t||n)&&`border-transparent bg-accent-strong/10`),children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:F(`min-w-0 break-words text-[13px]`,r?`font-semibold text-foreground`:`font-normal text-muted-foreground`),children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-supporting-foreground`,children:e.description}):null,(0,J.jsx)(U,{source:e.source,className:`self-start border-0 bg-transparent p-0 text-link-foreground`})]})})}export{de as SkillsRoute};
|
|
@@ -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{Ai as r,Da as i,Ii as a,On as o,Pa as s,_a as c,_t as l,da as u,in as d,ir as f,l as p,la as m,li as h,lr as g,lt as _,na as v,ro as y,so as b,to as x,ur as ee,yi as S,z as C}from"./alert-dialog-C-xYE_dg.js";import{d as te,m as w}from"./mobile-run-bar-BCfmFi8V.js";import{t as T}from"./run-header-BcjoDi0W.js";import{i as E,n as D,r as O}from"./git-toolbar-ClVvf5iF.js";import{t as k}from"./use-desktop-CrDny2uG.js";import{a as A,i as j,n as M,o as N,r as P,s as F,t as I}from"./textarea-DxlkE-Yd.js";import{t as L}from"./use-submit-shortcut-KWJsC906.js";import{b as R,y as z}from"./index-CatemBEL.js";import{t as B}from"./diff-rE8rm75J2.js";var V=e(t(),1),H=e=>e===`running`||e===`queued`||e===`waiting`,U=`no worktree — this task ran directly in the repo working tree`;function W(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${U}`)}function G(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${U}`)}function K(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${U}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?H(e.status)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function q(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:W(e),n=e.prUrl?[W(e),G(e)]:[G(e),K(e)],r=[];if(e.localHandoff){let t=e.hasSession?H(e.status)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var J=n();function Y({run:e,open:t,onOpenChange:n}){let i=b(),[a,o]=(0,V.useState)(``),c=h(e),l=(0,V.useRef)(c);l.current=c,(0,V.useEffect)(()=>{t&&o(l.current)},[t]);let u=y({mutationFn:t=>r(e.id,t),onSuccess:t=>{s(`Committed ${t.sha.slice(0,7)}`),n(!1),i.invalidateQueries({queryKey:d.runs.changes(e.id)}),i.invalidateQueries({queryKey:d.runs.all})},onError:e=>s(e.message,{tone:`danger`})}),f=()=>{let e=a.trim();e.length===0||u.isPending||u.mutate(e)};return(0,J.jsx)(M,{open:t,onOpenChange:n,children:(0,J.jsxs)(P,{"data-slot":`commit-dialog`,children:[(0,J.jsxs)(N,{children:[(0,J.jsx)(F,{children:`Commit changes`}),(0,J.jsxs)(j,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,J.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,J.jsx)(I,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{L({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f())}}),(0,J.jsxs)(A,{children:[(0,J.jsx)(p,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,J.jsx)(p,{"data-slot":`commit-confirm`,disabled:a.trim().length===0||u.isPending,onClick:f,children:u.isPending?`Committing…`:`Commit`})]})]})})}function X(){let{id:e}=x(),t=g(e);return t.isPending?(0,J.jsx)(R,{tab:`changes`}):t.isError?(0,J.jsx)(z,{tab:`changes`,error:t.error}):(0,J.jsx)(Z,{run:t.data})}function Z({run:e}){let t=o(),n=f(),r=ee(e.id,te(e.status)),p=k(),[h,g]=(0,V.useState)(`unified`),[v,x]=(0,V.useState)(!1),[A,j]=(0,V.useState)(null),[M,N]=(0,V.useState)(!1),P=(0,V.useRef)(null),F=b(),I=()=>F.invalidateQueries({queryKey:d.runs.all}),L=e=>s(e.message,{tone:`danger`}),R=y({mutationFn:()=>c(e.id),onSuccess:e=>s(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:L}),z=y({mutationFn:()=>a(e.id),onSuccess:e=>{s(`Draft PR created — ${e.url}`),I()},onError:L}),H=y({mutationFn:()=>u(e.id),onError:e=>{if(e instanceof S&&e.command){navigator.clipboard.writeText(e.command).then(()=>s(`No terminal found — command copied to clipboard.`)).catch(()=>s(`Run manually: ${e.command}`));return}L(e)}}),U=y({mutationFn:t=>m(e.id,t),onError:L}),W=r.isError&&r.error instanceof S&&r.error.status===409,G=q({status:e.status,hasWorktree:!!e.worktreePath&&!W,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:w(e)!==void 0,prUrl:e.pullRequestUrl}),K=e=>{switch(e){case`commit`:N(!0);break;case`push`:R.mutate();break;case`create-pr`:z.mutate();break;case`open-terminal`:H.mutate();break;case`view-pr`:break}},X=r.data?.files??[],Z=(0,V.useMemo)(()=>O(X),[X]),Q=p?h:`unified`,$=!p||v;return(0,J.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,J.jsx)(T,{run:e,tab:`changes`}),(0,J.jsx)(D,{bar:G,branch:e.branch,stat:r.data?.stat,mode:Q,wrap:$,onModeChange:g,onWrapChange:x,onAction:K}),r.data?.repointedHead?(0,J.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,J.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,J.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,r.isPending?(0,J.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):r.isError?(0,J.jsx)(C,{icon:W?(0,J.jsx)(_,{size:16}):(0,J.jsx)(l,{size:16}),tone:W?`neutral`:`danger`,heading:`h2`,title:W?`No changes to show`:`Could not load the changes`,subtitle:r.error.message}):X.length===0?(0,J.jsx)(C,{icon:(0,J.jsx)(_,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`,children:[(0,J.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:block lg:w-[250px]`,children:[(0,J.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,J.jsx)(E,{root:Z,selected:A,onSelect:e=>{j(e),P.current?.scrollToPath(e)}})]}),(0,J.jsx)(B,{files:X,viewRef:P,mode:Q,wrap:$,loadFileText:t=>ne(e.id,t),imageSrc:t=>i(e.id,t),onOpenInApp:t.data?.capabilities.localHandoff?e=>U.mutate(e):void 0,className:`min-w-0 flex-1`})]}),(0,J.jsx)(Y,{run:e,open:M,onOpenChange:N})]})}async function ne(e,t){try{let n=await v(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{X as TaskChangesRoute};
|
|
@@ -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{Rt as r,U as i,Yt as a,_t as o,ct as s,dr as c,fr as l,l as u,lr as d,lt as f,to as p,ur as m,yi as h,z as g}from"./alert-dialog-C-xYE_dg.js";import{t as _}from"./utils-fzNfbPzA.js";import{d as v}from"./mobile-run-bar-BCfmFi8V.js";import{t as y}from"./run-header-BcjoDi0W.js";import{n as b}from"./diff-controls-Bj0YrioE.js";import{t as x}from"./use-desktop-CrDny2uG.js";import{r as S}from"./format-dBiNDNVe.js";import{t as C}from"./search-x-I9Q8pgUa.js";import{t as w}from"./diff-stat-BKDCSVfJ.js";import{b as T,w as E,y as D}from"./index-CatemBEL.js";import{t as O}from"./lib-BQXq3kEf2.js";import{t as k}from"./diff-rE8rm75J2.js";var A=e(t(),1),j=n(),M=77;function N({slot:e,commits:t,className:n,heading:i}){let[a,o]=(0,A.useState)(``),s=a.trim().toLowerCase(),c=s?t.filter(e=>e.subject.toLowerCase().includes(s)):t,l=c.length>150,u=(0,A.useRef)(null),d=(0,A.useRef)(null),[f,p]=(0,A.useState)(0);(0,A.useLayoutEffect)(()=>{if(!l)return;let e=()=>{let e=u.current,t=d.current;!e||!t||p(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l]);let m=c.map(n=>(0,j.jsx)(P,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,j.jsx)(r,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,j.jsx)(E,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>o(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,j.jsxs)(`div`,{ref:e=>{u.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":l,className:_(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,j.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,c.length===0?(0,j.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,l?(0,j.jsx)(O,{scrollRef:d,startMargin:f,itemSize:M,children:m}):m]})]})}function P({commit:e,detailed:t}){return(0,j.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,j.jsxs)(S,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:_(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,j.jsx)(o,{size:16,"aria-hidden":`true`,className:_(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,j.jsxs)(`span`,{className:_(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,j.jsx)(`span`,{className:_(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,j.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,j.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,j.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,j.jsx)(f,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}function F(){let{id:e}=p(),t=d(e);return t.isPending?(0,j.jsx)(T,{tab:`changes`}):t.isError?(0,j.jsx)(D,{tab:`changes`,error:t.error}):(0,j.jsx)(I,{run:t.data})}function I({run:e}){let{sha:t}=p(),n=l(e.id,v(e.status));return(0,j.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,j.jsx)(y,{run:e,tab:`commits`}),t?(0,j.jsx)(L,{runId:e.id,sha:t}):n.isPending?(0,j.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,j.jsx)(g,{icon:(0,j.jsx)(o,{size:16}),tone:n.error instanceof h&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof h&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,j.jsx)(g,{icon:(0,j.jsx)(o,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,j.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,j.jsx)(N,{slot:`task-commits`,heading:(0,j.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,j.jsx)(R,{run:e})]})]})}function L({runId:e,sha:t}){let n=c(e,t),r=x(),[s,l]=(0,A.useState)(`unified`),[d,f]=(0,A.useState)(!1),p=n.isError&&n.error instanceof h&&n.error.status===409,m=r?s:`unified`,_=!r||d;return(0,j.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,j.jsx)(u,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,j.jsxs)(S,{to:`/tasks/${e}/commits`,children:[(0,j.jsx)(i,{size:16,"aria-hidden":`true`}),`All commits`]})}),n.data?(0,j.jsx)(w,{stat:n.data.stat}):null,(0,j.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,j.jsx)(b,{mode:s,wrap:d,onModeChange:l,onWrapChange:f})})]}),n.isPending?(0,j.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,j.jsx)(g,{icon:p?(0,j.jsx)(C,{}):(0,j.jsx)(a,{size:16}),tone:p?`neutral`:`danger`,heading:`h2`,title:p?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,j.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,j.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,j.jsx)(g,{icon:(0,j.jsx)(o,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,j.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`,children:(0,j.jsx)(k,{files:n.data.files,mode:m,wrap:_,className:`min-w-0`})})]})]})}function R({run:e}){let t=m(e.id,v(e.status));return t.isPending?(0,j.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,j.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,j.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,j.jsxs)(`h2`,{className:`mb-4 text-[16px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,j.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(S,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,j.jsx)(s,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,j.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{F as TaskCommitsRoute};
|
|
@@ -1,2 +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{Da as r,Rt as i,Ti as a,Vi as o,Yt as s,Z as c,ct as l,dn as u,dt as d,fn as f,l as p,lr as m,mr as h,no as g,to as _,ut as v,yi as y,yn as b,z as x}from"./alert-dialog-C-xYE_dg.js";import{t as S}from"./utils-fzNfbPzA.js";import{t as C}from"./createLucideIcon-BHp8sXmF.js";import{l as w,t as T}from"./run-header-BcjoDi0W.js";import{n as E,t as D}from"./markdown-zdKeLIYA.js";import{a as O,i as k,r as A}from"./highlighter-CdHqIwFr.js";import{b as j,w as M,y as N}from"./index-CatemBEL.js";var P=C(`file-exclamation-point`,[[`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:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),F=C(`file-question-mark`,[[`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:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),I=C(`file-x`,[[`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:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),L=C(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),R=C(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),z=e(t(),1),B=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function V(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:B.has(t.slice(n+1).toLowerCase())}function H(e){return e.tooLarge?`too-large`:V(e.path)?`image`:e.binary?`binary`:`text`}function U(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var W=n();function G({runId:e,path:t,className:n}){let r=h(e,t??void 0);if(t===null)return(0,W.jsx)(q,{className:n,children:(0,W.jsx)(x,{icon:(0,W.jsx)(v,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,W.jsx)(q,{className:n,children:(0,W.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof y&&r.error.status===409;return(0,W.jsx)(q,{className:n,children:(0,W.jsx)(x,{icon:e?(0,W.jsx)(I,{}):(0,W.jsx)(s,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,W.jsx)(K,{runId:e,entry:r.data,className:n}):(0,W.jsx)(q,{className:n,children:(0,W.jsx)(x,{icon:(0,W.jsx)(F,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function K({runId:e,entry:t,className:n,imageUrl:i,downloadUrl:a,snapshot:o,documentPreview:s=!1}){let[c,l]=(0,z.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),f=s&&d&&t.size<=10*1024*1024?`image`:H(t);return(0,W.jsxs)(q,{className:n,children:[(0,W.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,W.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:U(t.size)})]}),o||a||u?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[o?(0,W.jsxs)(`span`,{children:[`Published snapshot · `,o]}):null,a?(0,W.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:a,children:`Download`}):null,u?(0,W.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:()=>l(e=>!e),children:c?`Preview`:`View source`}):null]}):null,f===`image`&&(!s||d)?(0,W.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,W.jsx)(`img`,{"data-slot":`file-preview-image`,src:i??r(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):f===`too-large`?(0,W.jsx)(x,{icon:(0,W.jsx)(P,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${U(t.size)} — past the preview cap. Open it in your editor instead.`}):f===`binary`?(0,W.jsx)(x,{icon:(0,W.jsx)(F,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${U(t.size)} of binary data — no text preview.`}):u&&!c?(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(D,{document:!0,children:t.content??``})}):(0,W.jsx)(X,{path:t.path,text:t.content??``})]})}function q({className:e,children:t}){return(0,W.jsx)(`section`,{"data-slot":`file-preview`,className:S(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var J=1500;function Y(e,t){let n=(0,z.useMemo)(()=>t.split(`
|
|
2
|
-
`).map(e=>[{content:e}]),[t]),r=(0,z.useMemo)(()=>O(e),[e]),i=n.length>J,[a,o]=(0,z.useState)(null);return(0,z.useEffect)(()=>{if(r===null||i)return;let n=!1;return A(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:k(t,r)?.tokens??n}function X({path:e,text:t}){let n=Y(e,t);return(0,W.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":O(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex px-4`,children:[(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,W.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function Z({runId:e,path:t,artifactId:n}){let r=b(e,n?null:t),i=u(e,n),s=n?i:r,c=(0,z.useContext)(E),l=s.data,d=(0,z.useMemo)(()=>l?.type===`file`&&l.source!==`artifact`?{runId:e,...c,basePath:l.path}:null,[l,c,e]);if(!t&&!n)return(0,W.jsx)(G,{runId:e,path:null,className:`min-w-0 flex-1`});if(s.isPending)return(0,W.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(s.isError)return(0,W.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,W.jsx)(`h2`,{children:`Could not load this file`}),(0,W.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:s.error.message}),(0,W.jsx)(p,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});if(!l)return(0,W.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(l.type!==`file`)return(0,W.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,W.jsx)(`h2`,{children:l.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,W.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:l.path}),(0,W.jsx)(`p`,{className:`text-sm`,children:l.reason}),(0,W.jsx)(p,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});let f=l.artifact;return(0,W.jsx)(E.Provider,{value:d,children:(0,W.jsx)(K,{runId:e,entry:l,documentPreview:!0,className:`min-w-0 flex-1`,imageUrl:f?a(e,f.id,`image`):o(e,t),...f?{downloadUrl:a(e,f.id,`download`),snapshot:new Date(f.createdAt).toLocaleString()}:{}},f?.id??l.path)})}function Q({runId:e,selected:t,onSelect:n}){return(0,W.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,W.jsx)($,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function $({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=h(e,t);return a.isPending?(0,W.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,W.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,W.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,W.jsx)(W.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,W.jsx)(ee,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,W.jsx)(te,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function ee({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let[o,s]=(0,z.useState)(!1);return(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,W.jsx)(c,{size:16,"aria-hidden":`true`,className:S(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,o&&`rotate-90`)}),(0,W.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),o?(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,W.jsx)($,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function te({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=V(t)?R:l;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:S(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,W.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:U(n)})]})})}function ne(){let{id:e}=_(),t=m(e);return t.isPending?(0,W.jsx)(j,{tab:`files`}):t.isError?(0,W.jsx)(N,{tab:`files`,error:t.error}):(0,W.jsx)(w,{runId:t.data.id,children:(0,W.jsx)(re,{run:t.data},t.data.id)})}function re({run:e}){let t=h(e.id,``),n=f(e.id),[r,a]=g(),o=r.get(`path`),c=r.get(`artifact`),l=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&c!==null,[u,d]=(0,z.useState)(o??``);(0,z.useEffect)(()=>d(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},_=t.isError&&t.error instanceof y&&t.error.status===409;return(0,W.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,W.jsx)(T,{run:e,tab:`files`}),(0,W.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),u.trim()&&m(`path`,u.trim())},children:[(0,W.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,W.jsx)(i,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,W.jsx)(M,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:u,onChange:e=>d(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,W.jsx)(p,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,W.jsxs)(`aside`,{"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,W.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,W.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,W.jsx)(x,{icon:_?(0,W.jsx)(L,{}):(0,W.jsx)(s,{size:16}),tone:_?`neutral`:`danger`,heading:`h2`,title:_?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,W.jsx)(Q,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)}),(0,W.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,W.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,W.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,W.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,W.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,W.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsx)(`button`,{type:`button`,"aria-current":e.id===c?`true`:void 0,className:`min-h-11 w-full rounded px-2 py-2 text-left text-xs wrap-anywhere hover:bg-muted focus-visible:ring-2`,onClick:()=>m(`artifact`,e.id),children:e.name})},e.id))}),(0,W.jsx)(p,{variant:`ghost`,className:`min-h-11`,onClick:()=>void n.refetch(),children:`Refresh published files`})]})]}),l?(0,W.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||c!==null||t.isSuccess?(0,W.jsx)(Z,{runId:e.id,path:o,artifactId:c}):null]}),(0,W.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{ne as TaskFilesRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{$ as t,$r as n,Hn as r,Ji as i,On as a,Sn as o,Xr as s,Yt as c,in as l,l as u,lr as d,qn as f,ro as p,so as m,to as h,wn as g,xt as _,z as v}from"./alert-dialog-C-xYE_dg.js";import{n as y}from"./utils-fzNfbPzA.js";import{t as b}from"./run-header-BcjoDi0W.js";import{c as x}from"./use-desktop-CrDny2uG.js";import{r as S}from"./format-dBiNDNVe.js";import{t as C}from"./search-x-I9Q8pgUa.js";import{F as w,v as T,y as E}from"./index-CatemBEL.js";import{r as D}from"./github-item-detail-W5F6GVjF.js";var O=e(),k={issue:`Issue`,pr:`Pull request`};function A({kind:e}){let{id:t}=h(),n=d(t);return n.isPending?(0,O.jsx)(T,{kind:e}):n.isError?(0,O.jsx)(E,{tab:`github-item`,error:n.error}):(0,O.jsx)(j,{run:n.data,kind:e})}function j({run:e,kind:t}){let{n}=h(),i=Number(n),o=r(),c=f(),l=a(),d=c.isPending||l.isPending,p=s(e,o).some(e=>e.kind===t&&e.number===i),m=g(t,i,p);return(0,O.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,O.jsx)(b,{run:e,tab:{kind:t,number:i}}),p?(0,O.jsx)(M,{run:e,kind:t,number:i,repoBase:o,item:m}):d?(0,O.jsx)(T,{kind:t,number:i,heading:`h2`}):(0,O.jsx)(v,{icon:(0,O.jsx)(w,{size:16}),tone:`neutral`,heading:`h2`,title:`#${n} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,O.jsx)(u,{asChild:!0,variant:`outline`,children:(0,O.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function M({run:e,kind:r,number:a,repoBase:s,item:d}){let f=m(),h=p({mutationFn:e=>i(r,a,{refresh:!0}),onSuccess:(e,t)=>f.setQueryData(t,e)}),g=r===`pr`&&d.data?.available===!0&&d.data.item!==null,b=o(g?[a]:[],g),S=b.data?.available?b.data.checks:void 0,w=`${k[r]} #${a}`,E=r===`pr`?_:t,A=(0,O.jsx)(u,{variant:`outline`,disabled:h.isPending,onClick:()=>h.mutate(l.githubItem(r,a)),children:`Retry`});if(d.isPending)return(0,O.jsx)(T,{kind:r,number:a,heading:`h2`});if(d.isError){let e=h.error??d.error;return(0,O.jsx)(v,{icon:(0,O.jsx)(c,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${k[r].toLowerCase()} #${a}`,subtitle:e.message,actions:A})}let j=d.data;if(!j.available){let t=n(e,s).find(e=>e.kind===`PR`==(r===`pr`)&&e.number===a)?.url;return(0,O.jsx)(v,{icon:(0,O.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:h.error?.message??j.reason,actions:(0,O.jsxs)(O.Fragment,{children:[A,t&&y(t)?(0,O.jsx)(u,{asChild:!0,variant:`outline`,children:(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,O.jsx)(x,{"aria-hidden":`true`})]})}):null]})})}return j.item?(0,O.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,O.jsx)(D,{item:j.item,colors:{},checks:r===`pr`?S?.[a]??j.item.checks:j.item.checks,backLink:null,subNav:null})}):(0,O.jsx)(v,{icon:(0,O.jsx)(C,{}),tone:`neutral`,heading:`h2`,title:`${w} was not found in ${N(s)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function N(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}export{A as TaskGithubItemRoute};
|