@humwick/server 0.130.1 → 0.130.2
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 +5 -0
- package/docs/guides/tools-administration.md +4 -0
- package/docs/guides/tools-coordination.md +1 -0
- package/docs/guides/tools-tasks.md +8 -0
- package/docs/guides/workflows.md +58 -0
- package/docs/openapi.json +414 -1
- package/package.json +8 -17
- package/public/assets/{MessageBubble-BWpoBjl4.js → MessageBubble-BWLqMGKG.js} +2 -2
- package/public/assets/{PlanGraphPanel-C0auck3n.js → PlanGraphPanel-3TlIQpjk.js} +2 -2
- package/public/assets/{TraceView-DBnOx7AQ.js → TraceView-Wimm0Czv.js} +2 -2
- package/public/assets/{VaultDecisionCard-0kp2oNBC.js → VaultDecisionCard-Bau_vNax.js} +2 -2
- package/public/assets/{activity-yLztXEBt.js → activity-CrSurn-r.js} +2 -2
- package/public/assets/{agent-lineage-BbJDR1dW.js → agent-lineage-CknAJKcb.js} +2 -2
- package/public/assets/agent-liveness-CaNwK0Zf.js +2 -0
- package/public/assets/{agent-name-CTZBrSD9.js → agent-name-DKbiIhBo.js} +2 -2
- package/public/assets/agent-profiles-DwF6EQ4R.js +2 -0
- package/public/assets/{agent-project-badge-9TqzUUYE.js → agent-project-badge-Diz4Sjjb.js} +2 -2
- package/public/assets/{agent-tools-D4n40pn8.js → agent-tools-CRhpRQza.js} +2 -2
- package/public/assets/{agent-type-icon-D6FUarOf.js → agent-type-icon-LrUEU3lB.js} +2 -2
- package/public/assets/{agents-BYDslkJc.js → agents-B-v66C-4.js} +2 -2
- package/public/assets/{analytics-B-XSbEMC.js → analytics-BqCb-LKi.js} +2 -2
- package/public/assets/{artifact-viewer-DdWIfV6M.js → artifact-viewer-kf4pGuAR.js} +2 -2
- package/public/assets/{artifacts-oBOqks-2.js → artifacts-D32zyw4Y.js} +2 -2
- package/public/assets/{artifacts-DPN1q4pA.js → artifacts-DJevXcvg.js} +2 -2
- package/public/assets/{automation-4KcRFXEu.js → automation-BpRajx_5.js} +2 -2
- package/public/assets/{backlog-Cw9xPTCF.js → backlog-D_UjTdzX.js} +2 -2
- package/public/assets/{busy-health-CTu32MZt.js → busy-health-N3VEh4ao.js} +2 -2
- package/public/assets/{channels-BiXzg1G9.js → channels-9jopungq.js} +2 -2
- package/public/assets/{chat-Ctk2qwvA.js → chat-CSXrTB3C.js} +2 -2
- package/public/assets/{code-preview-Bm1wWqAp.js → code-preview-p1NnmqK0.js} +2 -2
- package/public/assets/{connectors-C36ax4Vw.js → connectors-CZdqlDNL.js} +2 -2
- package/public/assets/{cosmos-Jj9LK2Wf.js → cosmos-BgdsE4dG.js} +2 -2
- package/public/assets/{crate-agent-H6S7-B9T.js → crate-agent-30aXTKva.js} +2 -2
- package/public/assets/{dependency-graph-Cd1E23wa.js → dependency-graph-B_jvw2GE.js} +2 -2
- package/public/assets/{deploys-Bwfq146q.js → deploys-DoN6bAb5.js} +2 -2
- package/public/assets/{display-CfO7rTuF.js → display-BrKWFGJz.js} +2 -2
- package/public/assets/{files-DhhZI2Ih.js → files-D6XEu8Ng.js} +2 -2
- package/public/assets/{fleet-B_rFEbnL.js → fleet-C7jQWbw2.js} +2 -2
- package/public/assets/{fleet-metrics-BkHP-P3R.js → fleet-metrics-BiDs3MLx.js} +2 -2
- package/public/assets/{formatted-body-Cm1RrzmN.js → formatted-body-CQBwc1fb.js} +3 -3
- package/public/assets/{formatted-body-impl-DQiOuOD1.js → formatted-body-impl-DyG0WsQS.js} +2 -2
- package/public/assets/{host-providers-dialog-CHqwXTov.js → host-providers-dialog-DKaW31dN.js} +2 -2
- package/public/assets/index-CRHep3M9.js +15 -0
- package/public/assets/index-MYAIwYTX.css +2 -0
- package/public/assets/{insights-fH1EL-qZ.js → insights-CzrtkpOE.js} +2 -2
- package/public/assets/{integrations-C5Oix6ng.js → integrations-aVsUmigt.js} +2 -2
- package/public/assets/{issue-ref-chip-ODyondIa.js → issue-ref-chip-BnSlM_95.js} +2 -2
- package/public/assets/{log-viewer-Cvfy6PW7.js → log-viewer-qe7Ee47Z.js} +2 -2
- package/public/assets/{maintenance-D8CDH5wZ.js → maintenance-NfjqFZAk.js} +2 -2
- package/public/assets/{managed-agents-egllbpij.js → managed-agents-BiH0HgaE.js} +2 -2
- package/public/assets/{markdown-preview-CYSFgVgK.js → markdown-preview-BixaT3Xr.js} +3 -3
- package/public/assets/{markdown-preview-impl-BteVIjX4.js → markdown-preview-impl-DNGlWIS3.js} +2 -2
- package/public/assets/{memory-C8WmXsyr.js → memory-DNsCl6UX.js} +2 -2
- package/public/assets/{messages-BzQdqlO6.js → messages-DopU1L1X.js} +2 -2
- package/public/assets/{orchestrators-B1HxzkNw.js → orchestrators-Cq7ckLQT.js} +2 -2
- package/public/assets/{overview-DCUnI4Z7.js → overview-C1DCTzzV.js} +2 -2
- package/public/assets/{pairs-ftCd2XcD.js → pairs-DE_m6rrE.js} +2 -2
- package/public/assets/{profile-icon-B2zH8DMH.js → profile-icon-B3rfh77F.js} +2 -2
- package/public/assets/project-profile-instructions-DQWZE0kA.js +2 -0
- package/public/assets/projects-Br2Bd2h1.js +2 -0
- package/public/assets/{prompt-settings-Bftq9czX.js → prompt-settings-BKvFsvGD.js} +2 -2
- package/public/assets/provider-display-DsuWMvVL.js +2 -0
- package/public/assets/{registry-DWCU5c8q.js → registry-Cw38_6gW.js} +2 -2
- package/public/assets/run-card-CpKqRbhg.js +2 -0
- package/public/assets/scroll-text-BKXS1ahr.js +2 -0
- package/public/assets/{secrets-C7GIUATz.js → secrets-DxI-vzSq.js} +2 -2
- package/public/assets/{service-access-settings-C3aujqTG.js → service-access-settings-D9s_VJbd.js} +2 -2
- package/public/assets/{settings-C6sZ9eBa.js → settings-CKZTVGIx.js} +2 -2
- package/public/assets/{shipping-Bu8p1gEw.js → shipping-B9YtnwtG.js} +2 -2
- package/public/assets/{stats-V9Z-GxUd.js → stats-DyUBKyWI.js} +2 -2
- package/public/assets/{status-dot-CVv0iGHL.js → status-dot-DYqlEUhJ.js} +2 -2
- package/public/assets/{store-BvtFdlGX.js → store-DcClXLH0.js} +3 -3
- package/public/assets/{tasks-CXU75HRF.js → tasks-Bh7Chr4-.js} +2 -2
- package/public/assets/{teams-BPf976zb.js → teams-bowI7qVY.js} +2 -2
- package/public/assets/{terminal-viewer-DE9BOe-8.js → terminal-viewer-BgVLHdsU.js} +3 -3
- package/public/assets/{terminal-viewer-impl-D04pjmGh.js → terminal-viewer-impl-Dz22UPy6.js} +2 -2
- package/public/assets/token-estimate-Co-Jdphh.js +2 -0
- package/public/assets/{use-agent-terminal-B1yR456R.js → use-agent-terminal-DSQQ-iY7.js} +2 -2
- package/public/assets/{use-decisions-D-S4tpDf.js → use-decisions-samMQhQf.js} +2 -2
- package/public/assets/use-project-list-59LheVP7.js +2 -0
- package/public/assets/{use-selectors-CnrAk2YP.js → use-selectors-BZa25xEB.js} +2 -2
- package/public/assets/{user-avatar-nBFIcR4M.js → user-avatar-DHxlvUvV.js} +2 -2
- package/public/assets/versioned-prompt-editor-BmED5DnJ.js +8 -0
- package/public/assets/{work-queue-TCjJxeT-.js → work-queue-CSvpuNLz.js} +2 -2
- package/public/assets/{workflow-marker-Cf3Hf2fN.js → workflow-marker-DAZcj5qt.js} +2 -2
- package/public/assets/{workflows-CXQX20Qj.js → workflows-DdmxRSyg.js} +2 -2
- package/public/assets/{workspaces-qSYzKYMA.js → workspaces-BxeKfVuF.js} +2 -2
- package/public/cosmos.html +4 -4
- package/public/index.html +31 -29
- package/runner/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/runner/plugins/claude/hooks/gate-run-guard.provisioned.mjs +31 -1
- package/runner/src/adapters/claude-effort.ts +2 -4
- package/runner/src/adapters/codex-launch-config.ts +4 -5
- package/runner/src/adapters/codex.ts +1 -1
- package/runner/src/adapters/opencode-provider.ts +7 -22
- package/runner/src/adapters/opencode.ts +4 -4
- package/runner/src/agent-runner/credentials.ts +42 -12
- package/runner/src/agent-runner/inbox.ts +27 -0
- package/runner/src/agent-runner/lifecycle-milestones.ts +0 -2
- package/runner/src/bin/claude.ts +4 -0
- package/runner/src/bin/codex.ts +4 -0
- package/runner/src/bin/opencode.ts +4 -0
- package/runner/src/index.ts +5 -2
- package/runner/src/provider-setup.ts +34 -0
- package/runner/src/providers.ts +2 -1
- package/runner/src/runner-core.ts +18 -23
- package/runner/src/spawn-input.ts +2 -1
- package/runner/src/test-run-dedup.ts +59 -56
- package/scripts/cd-config.ts +8 -0
- package/scripts/gate-run-lease.ts +10 -7
- package/scripts/gate.sh +5 -1
- package/src/branch-land-notice.ts +93 -0
- package/src/branch-landed.ts +7 -76
- package/src/bus.ts +19 -20
- package/src/cd-deploy-notify.ts +30 -2
- package/src/cd-host-lag-notify.ts +7 -6
- package/src/ci/incidents.ts +2 -2
- package/src/ci/monitor.ts +5 -8
- package/src/ci/root-missing.ts +2 -7
- package/src/ci/transition-notify.ts +7 -39
- package/src/cli/cd-pauses.ts +19 -0
- package/src/cli/orchestrator.ts +1 -1
- package/src/cli/state.ts +2 -19
- package/src/cli/task-edit.ts +22 -0
- package/src/cli/task.ts +3 -1
- package/src/cli/workflow.ts +8 -2
- package/src/commands-db.ts +3 -3
- package/src/config-store-write.ts +13 -1
- package/src/config-store.ts +25 -14
- package/src/db/activity-async.ts +6 -1
- package/src/db/activity-write-ops.ts +12 -1
- package/src/db/activity.ts +1 -14
- package/src/db/agent-search.ts +1 -15
- package/src/db/agents-async.ts +52 -5
- package/src/db/agents-write-ops.ts +12 -3
- package/src/db/agents.ts +81 -54
- package/src/db/ci-incidents-async.ts +5 -5
- package/src/db/ci-incidents-write-ops.ts +2 -2
- package/src/db/command-row.ts +10 -2
- package/src/db/commands-list-query.ts +2 -0
- package/src/db/commands-spawn-read.ts +1 -1
- package/src/db/config-store-write-ops.ts +7 -2
- package/src/db/continuation-archives-async.ts +5 -0
- package/src/db/continuation-archives-write-ops.ts +7 -0
- package/src/db/continuations.ts +2 -2
- package/src/db/db-writer-worker.ts +8 -1
- package/src/db/deploy-events-async.ts +1 -0
- package/src/db/deploy-events-read-ops.ts +2 -1
- package/src/db/deploy-events.ts +35 -4
- package/src/db/hosts-registration.ts +10 -2
- package/src/db/hosts.ts +9 -6
- package/src/db/inbox.ts +0 -14
- package/src/db/index.ts +2 -0
- package/src/db/integrations-async.ts +8 -0
- package/src/db/integrations-ops.ts +15 -0
- package/src/db/integrations.ts +15 -21
- package/src/db/issue-lifecycle.ts +3 -4
- package/src/db/issue-refs-async.ts +20 -0
- package/src/db/issue-refs-write-ops.ts +29 -0
- package/src/db/issue-refs.ts +7 -8
- package/src/db/long-running-work.ts +2 -2
- package/src/db/main-connection-writes.ts +23 -2
- package/src/db/maintenance-job-reconcile.ts +61 -0
- package/src/db/maintenance-job-runs-async.ts +14 -0
- package/src/db/maintenance-job-write-ops.ts +9 -0
- package/src/db/mappers.ts +2 -14
- package/src/db/merge-lease.ts +1 -15
- package/src/db/migrations.ts +7 -15
- package/src/db/orchestrators.ts +4 -72
- package/src/db/pairs.ts +1 -13
- package/src/db/project-profile-instructions.ts +50 -0
- package/src/db/prompt-versions.ts +9 -2
- package/src/db/provider-config-history.ts +8 -3
- package/src/db/provider-model-seed.ts +34 -0
- package/src/db/read-op-marshaling-fixtures.ts +5 -0
- package/src/db/read-ops.ts +4 -0
- package/src/db/routing-policy.ts +2 -3
- package/src/db/schema.ts +9 -3
- package/src/db/spawn-delegation-state.ts +11 -4
- package/src/db/stats-async.ts +4 -3
- package/src/db/task-entity.ts +23 -2
- package/src/db/task-list.ts +3 -1
- package/src/db/tasks.ts +1 -17
- package/src/db/timer-ingress.ts +7 -1
- package/src/db/token-db-write-ops.ts +17 -0
- package/src/db/token-standing.ts +15 -11
- package/src/db/workflow-contact.ts +1 -1
- package/src/db/workflow-task-read-ops.ts +30 -0
- package/src/db/write-ops.ts +6 -0
- package/src/db/writer-gateway.ts +17 -11
- package/src/dispatch-availability.ts +10 -6
- package/src/ephemeral/{landing-ingress-proof-worker.ts → landing-ingress-proof.test-fixture.ts} +4 -2
- package/src/host/disk-alert.ts +121 -0
- package/src/lifecycle-manager.ts +3 -2
- package/src/maintenance/cd-watcher.ts +3 -3
- package/src/maintenance/critical-job-watchdog.ts +16 -17
- package/src/maintenance/index.ts +1 -0
- package/src/maintenance/jobs.ts +3 -2
- package/src/maintenance/scheduler.ts +84 -128
- package/src/maintenance/stalled-delivery-pager.ts +6 -5
- package/src/maintenance/workspaces.ts +1 -1
- package/src/managed-policy.ts +31 -27
- package/src/mcp/index.ts +5 -2
- package/src/mcp/output-descriptions.ts +8 -8
- package/src/mcp/presentation.ts +4 -4
- package/src/mcp/project-profile-instructions.ts +32 -0
- package/src/mcp/tool-groups.ts +1 -1
- package/src/mcp/tools-spawn.ts +4 -3
- package/src/mcp-agent-action.ts +1 -2
- package/src/mcp-issue-ref-tools.ts +12 -11
- package/src/mcp-maintenance-tools.ts +2 -2
- package/src/mcp-profile-trust-tools.ts +4 -4
- package/src/mcp-provider-catalog.ts +2 -2
- package/src/mcp-task-tools.ts +11 -5
- package/src/mcp-team-template-tools.ts +3 -3
- package/src/mcp-workflow-tools.ts +10 -3
- package/src/notification-types.ts +2 -1
- package/src/operator-alarm.ts +26 -11
- package/src/project-instructions.ts +4 -0
- package/src/project-profile-instruction-text.ts +6 -0
- package/src/project-profile-instructions.ts +20 -0
- package/src/provider-catalog-store.ts +3 -49
- package/src/provider-config-store.ts +12 -11
- package/src/provider-model-seed.ts +1 -18
- package/src/provider-quota-config-store.ts +5 -4
- package/src/provider-secrets.test-fixture.ts +3 -3
- package/src/recipe-runner.ts +2 -2
- package/src/repo-config-source.ts +10 -4
- package/src/routes/agent-profiles.ts +6 -6
- package/src/routes/agents-spawn.ts +1 -1
- package/src/routes/agents.ts +6 -6
- package/src/routes/commands-listing.ts +4 -0
- package/src/routes/commands.ts +2 -2
- package/src/routes/continuation-archives.ts +2 -2
- package/src/routes/index.ts +10 -1
- package/src/routes/integrations.ts +24 -50
- package/src/routes/issue-refs.ts +7 -7
- package/src/routes/orchestrator-bootstrap.ts +1 -1
- package/src/routes/orchestrator-host-registration.ts +2 -2
- package/src/routes/orchestrator-host-utilization.ts +3 -1
- package/src/routes/orchestrator-proxy.ts +2 -2
- package/src/routes/orchestrator.ts +2 -2
- package/src/routes/project-profile-instructions.ts +27 -0
- package/src/routes/project-trust.ts +2 -2
- package/src/routes/provider-config.ts +6 -6
- package/src/routes/provider-quota-config.ts +2 -2
- package/src/routes/settings.ts +5 -5
- package/src/routes/stats.ts +6 -6
- package/src/routes/task-http.ts +15 -1
- package/src/routes/task-issues.ts +11 -26
- package/src/routes/tasks.ts +22 -53
- package/src/routes/team-templates.ts +5 -5
- package/src/routes/teams-config.ts +2 -2
- package/src/routes/tokens.ts +12 -5
- package/src/routes/workflows.ts +20 -5
- package/src/routing-policy-normalize.ts +1 -2
- package/src/routing-step-defaults.ts +0 -2
- package/src/runner-token-mint-limit.ts +63 -0
- package/src/runtime-grant.ts +4 -2
- package/src/runtime-tokens.ts +39 -7
- package/src/security.ts +13 -20
- package/src/server-background.ts +1 -1
- package/src/server.ts +5 -2
- package/src/services/host-utilization.ts +23 -0
- package/src/services/idle-epics.ts +5 -6
- package/src/services/issue-lifecycle.ts +57 -61
- package/src/services/issue-refs.ts +9 -13
- package/src/services/kernel-timers-cutover-chaos-worker.ts +10 -7
- package/src/services/kernel-timers-ingress.ts +1 -1
- package/src/services/landed-ancestry.ts +19 -3
- package/src/services/memory-areas.ts +15 -51
- package/src/services/plan-ci-notice.ts +57 -0
- package/src/services/plan-ci-recovery.ts +2 -55
- package/src/services/plan-wake-digest.ts +1 -0
- package/src/services/profile-trust.ts +4 -3
- package/src/services/project-config-read.ts +70 -0
- package/src/services/project-profile-instructions.ts +54 -0
- package/src/services/provisioning-harness/budget-baseline.json +4 -4
- package/src/services/restart-spawn.ts +61 -49
- package/src/services/self-care-state.ts +2 -1
- package/src/services/self-effort.ts +5 -5
- package/src/services/send-message.ts +5 -1
- package/src/services/spawn-agent.ts +13 -2
- package/src/services/spawn-chain-inspector.ts +6 -13
- package/src/services/spawn-policy.ts +68 -0
- package/src/services/spawn-tree-cleanup.ts +2 -2
- package/src/services/task-dispatch.ts +3 -0
- package/src/services/task-state-reconcile.ts +6 -14
- package/src/services/team-templates.ts +9 -8
- package/src/services/transient-agent-reaper.ts +3 -1
- package/src/services/workflow-auto-start.ts +25 -13
- package/src/services/workflow-ci-main.ts +1 -1
- package/src/services/workflow-deferred-cleanup.ts +4 -2
- package/src/services/workflow-effect-driver.ts +2 -0
- package/src/services/workflow-effects.ts +18 -11
- package/src/services/workflow-land-notice.ts +10 -0
- package/src/services/workflow-pause-text.ts +43 -0
- package/src/services/workflow-reconcile.ts +13 -11
- package/src/services/workflow-run-view.ts +2 -0
- package/src/services/workflow-runs.ts +29 -13
- package/src/services/workflow-supervisor-state.ts +5 -0
- package/src/services/workflow-supervisor.ts +7 -3
- package/src/settings/registry.ts +1 -2
- package/src/spawn-command.ts +4 -4
- package/src/spawn-models.ts +10 -12
- package/src/spawn-placement.ts +1 -1
- package/src/spawn-targets.ts +1 -1
- package/src/startup-context-injection.ts +1 -0
- package/src/state-adoption/cd-cutover.ts +53 -7
- package/src/state-adoption/fleet-cutover.ts +35 -0
- package/src/state-adoption/fleet-plan.ts +36 -0
- package/src/state-adoption/index.ts +2 -2
- package/src/state-adoption/linux-plan.ts +2 -2
- package/src/state-adoption/linux.ts +2 -2
- package/src/state-adoption/macos-plan.ts +2 -2
- package/src/state-adoption/macos.ts +1 -1
- package/src/steward.ts +7 -6
- package/src/task-dispatch-live.ts +1 -1
- package/src/task-dispatcher.ts +1 -1
- package/src/teams-config-store.ts +4 -3
- package/src/token-db-write.ts +10 -0
- package/src/workspace-command-settle.ts +2 -1
- package/src/workspace-steward-wake.ts +2 -2
- package/node_modules/@humwick/kernel/LICENSE +0 -167
- package/node_modules/@humwick/kernel/async-entity-persistence.ts +0 -344
- package/node_modules/@humwick/kernel/async-event-log.ts +0 -107
- package/node_modules/@humwick/kernel/automations.pilot.ts +0 -147
- package/node_modules/@humwick/kernel/config.ts +0 -111
- package/node_modules/@humwick/kernel/contract.ts +0 -572
- package/node_modules/@humwick/kernel/control-authz.ts +0 -281
- package/node_modules/@humwick/kernel/control.ts +0 -645
- package/node_modules/@humwick/kernel/effects.ts +0 -493
- package/node_modules/@humwick/kernel/event-log.ts +0 -319
- package/node_modules/@humwick/kernel/http-transport.ts +0 -384
- package/node_modules/@humwick/kernel/identity-grammar.ts +0 -20
- package/node_modules/@humwick/kernel/identity.ts +0 -248
- package/node_modules/@humwick/kernel/index.ts +0 -28
- package/node_modules/@humwick/kernel/kernel-persistence.ts +0 -181
- package/node_modules/@humwick/kernel/landing-incident.ts +0 -306
- package/node_modules/@humwick/kernel/landing.ts +0 -953
- package/node_modules/@humwick/kernel/manifest-validation.ts +0 -460
- package/node_modules/@humwick/kernel/mcp-transport.ts +0 -109
- package/node_modules/@humwick/kernel/message-authority-chaos-worker.ts +0 -200
- package/node_modules/@humwick/kernel/message-authority.ts +0 -281
- package/node_modules/@humwick/kernel/module-host.ts +0 -722
- package/node_modules/@humwick/kernel/openapi-init.ts +0 -14
- package/node_modules/@humwick/kernel/package.json +0 -39
- package/node_modules/@humwick/kernel/persistence-schema.ts +0 -248
- package/node_modules/@humwick/kernel/persistence.ts +0 -510
- package/node_modules/@humwick/kernel/registry.ts +0 -60
- package/node_modules/@humwick/kernel/sqlite-kernel-persistence.ts +0 -499
- package/node_modules/@humwick/kernel/sqlite-module-host.ts +0 -87
- package/node_modules/@humwick/kernel/timers-chaos-worker.ts +0 -186
- package/node_modules/@humwick/kernel/timers.pilot.ts +0 -1411
- package/node_modules/@humwick/kernel/workflow-activation.ts +0 -25
- package/node_modules/@humwick/kernel/workflow-backstop.ts +0 -40
- package/node_modules/@humwick/kernel/workflow-cancel-tree.ts +0 -20
- package/node_modules/@humwick/kernel/workflow-chaos-worker.ts +0 -213
- package/node_modules/@humwick/kernel/workflow-composition.ts +0 -231
- package/node_modules/@humwick/kernel/workflow-container.ts +0 -72
- package/node_modules/@humwick/kernel/workflow-control.test-fixture.ts +0 -42
- package/node_modules/@humwick/kernel/workflow-control.ts +0 -178
- package/node_modules/@humwick/kernel/workflow-definition.ts +0 -507
- package/node_modules/@humwick/kernel/workflow-dispatch.ts +0 -60
- package/node_modules/@humwick/kernel/workflow-foreach.ts +0 -167
- package/node_modules/@humwick/kernel/workflow-journal-codec.ts +0 -339
- package/node_modules/@humwick/kernel/workflow-journal.ts +0 -922
- package/node_modules/@humwick/kernel/workflow-lane.ts +0 -48
- package/node_modules/@humwick/kernel/workflow-lease-owner.ts +0 -60
- package/node_modules/@humwick/kernel/workflow-recovery.test-fixture.ts +0 -19
- package/node_modules/@humwick/kernel/workflow-runtime.ts +0 -938
- package/node_modules/@humwick/kernel/workflow-script.ts +0 -11
- package/node_modules/@humwick/kernel/workflow-state.ts +0 -299
- package/node_modules/@humwick/kernel/workflow-step-commit.ts +0 -195
- package/node_modules/@humwick/kernel/workflow-transitions.ts +0 -317
- package/node_modules/@humwick/kernel/workflow-values.ts +0 -153
- package/node_modules/@humwick/kernel/workflow.pilot.ts +0 -376
- package/node_modules/@humwick/offload/LICENSE +0 -167
- package/node_modules/@humwick/offload/README.md +0 -57
- package/node_modules/@humwick/offload/dist/async-runner.d.ts +0 -18
- package/node_modules/@humwick/offload/dist/async-runner.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/async-runner.js +0 -158
- package/node_modules/@humwick/offload/dist/async-runner.js.map +0 -1
- package/node_modules/@humwick/offload/dist/envelope.d.ts +0 -25
- package/node_modules/@humwick/offload/dist/envelope.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/envelope.js +0 -80
- package/node_modules/@humwick/offload/dist/envelope.js.map +0 -1
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.d.ts +0 -10
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.js +0 -59
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.js.map +0 -1
- package/node_modules/@humwick/offload/dist/index.d.ts +0 -5
- package/node_modules/@humwick/offload/dist/index.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/index.js +0 -5
- package/node_modules/@humwick/offload/dist/index.js.map +0 -1
- package/node_modules/@humwick/offload/dist/subprocess-runner.d.ts +0 -62
- package/node_modules/@humwick/offload/dist/subprocess-runner.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/subprocess-runner.js +0 -295
- package/node_modules/@humwick/offload/dist/subprocess-runner.js.map +0 -1
- package/node_modules/@humwick/offload/dist/types.d.ts +0 -111
- package/node_modules/@humwick/offload/dist/types.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/types.js +0 -176
- package/node_modules/@humwick/offload/dist/types.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-pool.d.ts +0 -23
- package/node_modules/@humwick/offload/dist/worker-pool.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-pool.js +0 -435
- package/node_modules/@humwick/offload/dist/worker-pool.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-runtime.d.ts +0 -2
- package/node_modules/@humwick/offload/dist/worker-runtime.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-runtime.js +0 -27
- package/node_modules/@humwick/offload/dist/worker-runtime.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker.d.ts +0 -5
- package/node_modules/@humwick/offload/dist/worker.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker.js +0 -1
- package/node_modules/@humwick/offload/dist/worker.js.map +0 -1
- package/node_modules/@humwick/offload/package.json +0 -42
- package/node_modules/@humwick/offload/src/async-runner.ts +0 -170
- package/node_modules/@humwick/offload/src/envelope.ts +0 -92
- package/node_modules/@humwick/offload/src/fixtures/worker-task.ts +0 -49
- package/node_modules/@humwick/offload/src/index.ts +0 -4
- package/node_modules/@humwick/offload/src/subprocess-runner.ts +0 -334
- package/node_modules/@humwick/offload/src/types.ts +0 -235
- package/node_modules/@humwick/offload/src/worker-pool.ts +0 -463
- package/node_modules/@humwick/offload/src/worker-runtime.ts +0 -32
- package/node_modules/@humwick/offload/src/worker.ts +0 -5
- package/public/assets/agent-liveness-DyqxfB-t.js +0 -2
- package/public/assets/agent-profiles-BpI_jTxq.js +0 -2
- package/public/assets/index-B7ZerHLY.css +0 -2
- package/public/assets/index-BU3uWo2t.js +0 -15
- package/public/assets/projects-B_lmcqfO.js +0 -2
- package/public/assets/provider-display-DbLWpP3j.js +0 -2
- package/public/assets/run-card-CO_bguQf.js +0 -2
- package/public/assets/use-project-list-B-T2Bnnn.js +0 -2
- package/public/assets/versioned-prompt-editor-Diu8BIaM.js +0 -8
- package/runner/src/gate-run-lease-probe.ts +0 -38
- package/src/db/claude-catalog-reconcile.ts +0 -27
- package/src/routing-model-aliases.ts +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-DcClXLH0.js";import"./provider-display-DsuWMvVL.js";import{h as a}from"./display-BrKWFGJz.js";import{i as o,r as s,t as c}from"./file-code-corner-CXhIR1vB.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-uuJ9_geR.js";import{t as ee}from"./switch-DuCA7mrB.js";import{i as g,r as _,t as v}from"./tabs-jZgNvNHr.js";import{t as y}from"./arrow-right-vFsRqG8V.js";import{t as b}from"./git-commit-horizontal-DS1pJ_SS.js";import{n as x,r as S}from"./workflow-marker-DAZcj5qt.js";import{t as C}from"./button-Do6Z3vvn.js";import{t as w}from"./copy-button-CjOj4HEf.js";import{t as T}from"./textarea-hs6Mpyfl.js";import{n as E,r as D}from"./shipping-stats-BiMTsA4A.js";import{a as O,i as te,n as k,r as A,t as j}from"./run-card-CpKqRbhg.js";import{n as M,r as ne}from"./stats-DyUBKyWI.js";var N=r(),P={running:`Running`,done:`Done`,escalated:`Escalated`,cancelled:`Cancelled`,failed:`Failed`};function F({route:e}){return(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1 text-xs`,children:[(0,N.jsx)(`span`,{className:`rounded bg-muted px-1.5 font-mono text-[11px]`,children:e.on}),(0,N.jsx)(y,{className:`h-3 w-3 shrink-0 text-muted-foreground`,"aria-label":`goes to`}),(0,N.jsx)(`span`,{className:`font-medium`,children:e.to}),e.condition!==void 0&&(0,N.jsxs)(`code`,{children:[`if `,String(e.condition)]}),e.max!==void 0&&(0,N.jsxs)(`span`,{className:`text-muted-foreground`,children:[`at most `,e.max===1?`once`:`${e.max} times`,`, then `,e.else]})]})}function I({step:e}){let t=[...e.decision?[`wait for operator`,...e.decision.deadlineMs?[`deadline ${D(e.decision.deadlineMs)}`]:[]]:e.script?[`host ${e.script.host}`,...e.script.everyMs?[`poll every ${D(e.script.everyMs)}`]:[],`time limit ${D(e.script.timeoutMs)}`]:[e.task===`input`?`on the run’s Task`:`on a new Task`],e.gate&&`verdict gate ${e.gate}`,e.crossProvider&&`another provider than ${e.crossProvider}`,e.reap&&`reap ${e.reap}`,e.timeoutMs!==void 0&&`time limit ${D(e.timeoutMs)}`].filter(Boolean);return(0,N.jsxs)(`li`,{"data-testid":`workflow-def-step-${e.name}`,className:`grid min-w-0 gap-1.5 border-t border-border/60 py-2 first:border-t-0 sm:grid-cols-[minmax(0,14rem)_1fr] sm:gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,N.jsx)(`span`,{className:`text-sm font-semibold`,children:e.name}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.script?`script`:`role ${e.role}`})]}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.join(` · `)}),e.script&&(0,N.jsx)(`code`,{className:`block break-all text-xs`,children:e.script.run})]}),(0,N.jsx)(`ul`,{"aria-label":`${e.name} routes`,className:`space-y-1`,children:e.routes.map((e,t)=>(0,N.jsx)(F,{route:e},`${e.on}-${t}`))})]})}function re({def:e,now:t,project:n}){let r=[...!e.stations||e.stations.includes(`land`)?[`land${e.land?.timeoutMs===void 0?``:` (time limit ${D(e.land.timeoutMs)})`}`]:[],...e.ciMain?[`CI on main${e.ciMain.workflow?` (${e.ciMain.workflow})`:``}${e.ciMain.timeoutMs===void 0?``:`, up to ${D(e.ciMain.timeoutMs)}`}`]:[]];return(0,N.jsxs)(`article`,{"data-testid":`workflow-def-${e.workflow}`,"aria-label":`${e.workflow} definition`,className:`wf-run min-w-0 space-y-2 rounded-lg p-3`,children:[(0,N.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,N.jsxs)(`h3`,{className:`flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold`,children:[(0,N.jsx)(x,{workflow:e.workflow,className:`h-3.5 w-3.5 shrink-0`}),(0,N.jsx)(O,{text:e.workflow})]}),(0,N.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,title:`.agent-relay/workflows/${e.workflow}.yaml at ${e.ref} ${e.sha}`,children:[(0,N.jsx)(b,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,N.jsxs)(`span`,{className:`truncate`,children:[`.agent-relay/workflows/`,e.workflow,`.yaml`]}),(0,N.jsxs)(`span`,{className:`shrink-0 font-mono`,children:[e.ref,` `,e.sha.slice(0,7)]})]}),n&&(0,N.jsx)(O,{text:n,className:`text-xs text-muted-foreground`})]}),e.description&&(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),(0,N.jsx)(`ol`,{"aria-label":`Steps`,children:e.steps.map(e=>(0,N.jsx)(I,{step:e},e.name))}),r.length>0&&(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`After the steps: `,r.join(`, then `),`.`]}),(0,N.jsxs)(`footer`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 border-t border-border/60 pt-2 text-xs text-muted-foreground`,children:[(0,N.jsx)(`span`,{children:`Last run`}),(0,N.jsx)(`span`,{className:`font-medium text-foreground`,children:P[e.lastRun.status]}),(0,N.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,N.jsx)(A,{taskId:e.lastRun.taskId,title:e.lastRun.taskTitle})}),(0,N.jsxs)(`span`,{title:new Date(e.lastRun.at).toLocaleString(),children:[a(t,e.lastRun.at),` ago`]})]})]})}function ie({projectTitles:e}){let t=i(e=>e.workflowDefinitions),n=i(e=>e.workflowLoading),r=i(e=>e.workflowError),a=Date.now();return(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Each workflow a run used, as its newest run read the file from the repo’s default branch. Edit the file and land it to change the next run.`}),r&&(0,N.jsxs)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[`Could not load the workflows: `,r]}),!t&&n&&(0,N.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading the workflows…`}),t&&t.length===0&&(0,N.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-8 text-center text-sm text-muted-foreground`,children:`No workflow has run yet. A coordinator starts one with relay_workflow_start.`}),t&&t.map(t=>(0,N.jsx)(re,{def:t,now:a,project:t.lastRun.projectId?e.get(t.lastRun.projectId):void 0},t.workflow))]})}var L=e(n(),1);function R(e){let t=Math.max(0,...Array.from(e.matchAll(/`+/g),e=>e[0].length));return"`".repeat(Math.max(3,t+1))}function z(e){let t=R(e.text),n=e.path.endsWith(`.yaml`)?`yaml`:`markdown`;return`${e.path}\n\n${t}${n}\n${e.text}${e.text.endsWith(`
|
|
2
2
|
`)?``:`
|
|
3
3
|
`}${t}`}function B(e){let t=e.files.map(e=>e.path),n=t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``;return{title:`Override the bundled ${e.workflow} workflow in ${e.projectName}`,intent:`Land ${n} on the default branch with exactly the content in the context, so relay_workflow_start ${e.workflow} uses the project's files instead of Relay's bundled ones. Change nothing else.`,context:e.files.map(z).join(`
|
|
4
4
|
|
|
5
5
|
`),doneWhen:`${n} landed on the default branch with this content.`,projectId:e.projectId}}var V={bundled:`Bundled`,project:`Project`,"project-overrides-bundled":`Overrides bundled`},H={bundled:`border-border text-muted-foreground`,project:`border-primary/40 text-primary`,"project-overrides-bundled":`border-tone-warning/50 text-tone-warning-fg`};function U({source:e}){return e?(0,N.jsx)(`span`,{"data-testid":`catalog-source`,className:t(`shrink-0 rounded-full border px-1.5 text-[11px] font-medium`,H[e]),children:V[e]}):(0,N.jsx)(`span`,{className:`rounded-full border border-destructive/50 px-1.5 text-[11px] text-destructive`,children:`Missing`})}function W(e,t){return[...new Set((e.steps??[]).map(e=>e.role))].flatMap(e=>t.filter(t=>t.name===e))}function G({label:e,text:t}){return(0,N.jsxs)(`section`,{className:`space-y-1`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,N.jsx)(`h4`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:e}),(0,N.jsx)(w,{value:t,label:`Copy ${e}`})]}),(0,N.jsx)(`pre`,{className:`max-h-[50vh] overflow-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-xs leading-relaxed`,children:t})]})}function K({entry:e,roles:t,onClose:n}){return(0,N.jsx)(h,{open:!0,onOpenChange:e=>!e&&n(),children:(0,N.jsxs)(p,{className:`max-w-3xl`,children:[(0,N.jsxs)(f,{children:[(0,N.jsxs)(m,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{workflow:e.name,className:`h-4 w-4`}),e.name,(0,N.jsx)(U,{source:e.source})]}),e.description&&(0,N.jsx)(u,{children:e.description})]}),(0,N.jsxs)(d,{className:`space-y-4`,children:[(0,N.jsx)(G,{label:e.source===`bundled`?`Bundled ${e.name}.yaml`:e.path,text:e.text}),e.bundledText!==void 0&&(0,N.jsx)(G,{label:`Bundled ${e.name}.yaml (overridden)`,text:e.bundledText}),t.map(e=>(0,N.jsxs)(`details`,{className:`rounded-md border border-border px-3 py-2`,children:[(0,N.jsxs)(`summary`,{className:`flex cursor-pointer flex-wrap items-center gap-2 text-sm`,children:[(0,N.jsxs)(`span`,{className:`font-medium`,children:[`Role `,e.name]}),(0,N.jsx)(U,{source:e.source}),e.description&&(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.error&&(0,N.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:e.error}),e.text!==void 0&&(0,N.jsx)(`div`,{className:`mt-2`,children:(0,N.jsx)(G,{label:e.source===`bundled`?`Bundled ${e.name}.md`:e.path,text:e.text})})]},e.name))]}),(0,N.jsx)(l,{children:(0,N.jsx)(C,{variant:`outline`,onClick:n,children:`Close`})})]})})}function q({entry:e,roles:t,project:n,onClose:r}){let a=i(e=>e.createWorkflowOverrideTask),o=t.filter(e=>e.source===`bundled`&&e.text!==void 0),[s,c]=(0,L.useState)(e.text),[g,_]=(0,L.useState)({}),[v,y]=(0,L.useState)(!1),[b,x]=(0,L.useState)(null);async function S(){y(!0);let t=[{path:e.path,text:s},...o.filter(e=>g[e.name]!==void 0).map(e=>({path:e.path,text:g[e.name]}))],r=await a(B({projectId:n.id,projectName:n.name,workflow:e.name,files:t}));y(!1),r!==null&&x(r)}return(0,N.jsx)(h,{open:!0,onOpenChange:e=>!e&&r(),children:(0,N.jsxs)(p,{className:`max-w-3xl`,children:[(0,N.jsxs)(f,{children:[(0,N.jsxs)(m,{children:[`Override `,e.name,` in `,n.name]}),(0,N.jsxs)(u,{children:[`Edit the copy of Relay's bundled workflow. The Task asks a builder to land it at `,(0,N.jsx)(`span`,{className:`font-mono`,children:e.path}),`; until it lands, runs keep using the bundled one.`]})]}),b===null?(0,N.jsxs)(d,{className:`space-y-4`,children:[(0,N.jsxs)(`label`,{className:`block space-y-1`,children:[(0,N.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.path}),(0,N.jsx)(T,{"aria-label":e.path,spellCheck:!1,className:`max-h-[50vh] font-mono text-xs md:text-xs`,value:s,onChange:e=>c(e.target.value)})]}),o.map(e=>{let t=g[e.name];return(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,N.jsx)(ee,{checked:t!==void 0,onCheckedChange:t=>_(n=>{let r={...n};return t?r[e.name]=e.text:delete r[e.name],r})}),`Also override role `,e.name,` `,(0,N.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.path})]}),t!==void 0&&(0,N.jsx)(T,{"aria-label":e.path,spellCheck:!1,className:`max-h-[50vh] font-mono text-xs md:text-xs`,value:t,onChange:t=>_(n=>({...n,[e.name]:t.target.value}))})]},e.name)})]}):(0,N.jsxs)(d,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{children:`Created the override Task. Dispatch it to land the files.`}),(0,N.jsx)(`div`,{className:`text-sm`,children:(0,N.jsx)(A,{taskId:b,title:`Override the bundled ${e.name} workflow in ${n.name}`})})]}),(0,N.jsx)(l,{children:b===null?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w,{value:s,label:`Copy YAML`,showText:!0,variant:`outline`}),(0,N.jsx)(C,{disabled:v||!s.trim(),onClick:()=>void S(),children:`Create override Task`})]}):(0,N.jsx)(C,{variant:`outline`,onClick:r,children:`Close`})})]})})}function J({entry:e,roles:t,canOverride:n,onView:r,onOverride:i}){let a=new Map(t.map(e=>[e.name,e]));return(0,N.jsxs)(`article`,{"data-testid":`workflow-catalog-${e.name}`,"aria-label":`${e.name} workflow`,className:`wf-run min-w-0 space-y-2 rounded-lg p-3`,children:[(0,N.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,N.jsxs)(`h3`,{className:`flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold`,children:[(0,N.jsx)(x,{workflow:e.name,className:`h-3.5 w-3.5 shrink-0`}),(0,N.jsx)(O,{text:e.name})]}),(0,N.jsx)(U,{source:e.source}),(0,N.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,title:e.source===`bundled`?`A project file at ${e.path} would override it`:e.path,children:[(0,N.jsx)(c,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,N.jsx)(`span`,{className:`truncate font-mono`,children:e.source===`bundled`?`shipped with Relay`:e.path})]})]}),e.description&&(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.steps&&(0,N.jsx)(`ol`,{"aria-label":`Steps`,className:`flex flex-wrap gap-x-4 gap-y-1 text-xs`,children:e.steps.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:[`script`,`workflow`].includes(e.role)?e.role:`role ${e.role}`}),![`script`,`workflow`].includes(e.role)&&(0,N.jsx)(U,{source:a.get(e.role)?.source})]},e.name))}),e.error&&(0,N.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`A run would not start: `,e.error]}),(0,N.jsxs)(`footer`,{className:`flex flex-wrap items-center gap-2 border-t border-border/60 pt-2`,children:[(0,N.jsx)(C,{size:`sm`,variant:`outline`,onClick:r,children:`View`}),e.source===`bundled`&&(0,N.jsx)(C,{size:`sm`,variant:`outline`,disabled:!n,title:n?void 0:`Pick a project to override it in`,onClick:i,children:`Override`})]})]})}function ae({projectName:e}){let t=i(e=>e.workflowCatalog),n=i(e=>e.workflowCatalogLoading),r=i(e=>e.workflowCatalogError),a=i(e=>e.workflowProjectId),[o,s]=(0,L.useState)(null),c=t?.project,l=o&&t?.workflows.find(e=>e.name===o.name),u=!!(a&&c&&!c.error);return(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a?(0,N.jsxs)(N.Fragment,{children:[`The workflows relay_workflow_start can run in `,e??`this project`,`: Relay's bundled ones and the repo's own `,(0,N.jsx)(`span`,{className:`font-mono`,children:`.agent-relay/workflows/*.yaml`}),` on its default branch. A repo file of the same name overrides the bundled one, and so does a repo role file.`]}):`The workflows Relay ships. Pick a project to see its own workflows and which bundled ones it overrides.`}),r&&(0,N.jsxs)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[`Could not load the catalog: `,r]}),c?.error&&(0,N.jsxs)(`div`,{"data-testid":`catalog-project-error`,className:`rounded-md border border-tone-warning/40 bg-tone-warning/10 px-3 py-2 text-sm`,children:[`Could not read the project's workflow files: `,c.error,`. Only Relay's bundled workflows are shown.`]}),c?.sha&&(0,N.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[(0,N.jsx)(b,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Read at `,(0,N.jsxs)(`span`,{className:`font-mono`,children:[c.ref,` `,c.sha.slice(0,7)]}),c.host&&(0,N.jsxs)(N.Fragment,{children:[` on `,c.host]}),c.fetchError&&(0,N.jsxs)(`span`,{className:`text-tone-warning-fg`,children:[` as last fetched: refreshing failed (`,c.fetchError,`)`]})]}),!t&&n&&(0,N.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading the catalog…`}),t?.workflows.map(e=>(0,N.jsx)(J,{entry:e,roles:t.roles,canOverride:u,onView:()=>s({kind:`view`,name:e.name}),onOverride:()=>s({kind:`override`,name:e.name})},e.name)),l&&o.kind===`view`&&(0,N.jsx)(K,{entry:l,roles:W(l,t?.roles??[]),onClose:()=>s(null)}),l&&o.kind===`override`&&a&&(0,N.jsx)(q,{entry:l,roles:W(l,t?.roles??[]),project:{id:a,name:e??a},onClose:()=>s(null)},l.name)]})}var oe=new Set([`fail`,`failed`,`blocked`,`exited`,`escalated`,`cancelled`,`CI fail`]),Y=e=>e===void 0?`—`:D(e),X=(e,t)=>e?`median of ${e.count}; mean ${D(e.avgMs)}, longest ${D(e.maxMs)}`:t;function se({duration:e}){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`td`,{className:`whitespace-nowrap px-1.5 py-1 text-right tabular-nums`,children:Y(e?.p50Ms)}),(0,N.jsx)(`td`,{className:`whitespace-nowrap px-1.5 py-1 text-right tabular-nums text-muted-foreground`,children:Y(e?.avgMs)}),(0,N.jsx)(`td`,{className:`whitespace-nowrap py-1 pl-1.5 text-right tabular-nums text-muted-foreground`,children:Y(e?.maxMs)})]})}function ce({outcomes:e}){return(0,N.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:Object.entries(e).sort((e,t)=>t[1]-e[1]).map(([e,n])=>(0,N.jsxs)(`span`,{className:t(`rounded px-1.5 text-[11px] tabular-nums`,oe.has(e)?`bg-destructive/10 text-destructive`:`bg-muted text-muted-foreground`),children:[e,` `,n]},e))})}function Z({stats:e}){let t=e.done+e.failed,n=Object.entries(e.failedAt).sort((e,t)=>t[1]-e[1]),r=e.steps.find(e=>e.step===te)?.duration;return(0,N.jsxs)(`article`,{"data-testid":`workflow-stats-${e.workflow}`,"aria-label":`${e.workflow} statistics`,className:`wf-run min-w-0 space-y-3 rounded-lg p-3`,children:[(0,N.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,N.jsxs)(`h3`,{className:`flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold`,children:[(0,N.jsx)(x,{workflow:e.workflow,className:`h-3.5 w-3.5 shrink-0`}),(0,N.jsx)(O,{text:e.workflow})]}),(0,N.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.runs,` `,e.runs===1?`run`:`runs`,e.running?`, ${e.running} running`:``]})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-6 gap-2`,children:[(0,N.jsx)(M,{className:`col-span-2`,label:`Landed`,value:String(e.done),hint:t?`${E(e.done/t)} of finished runs`:void 0}),(0,N.jsx)(M,{className:`col-span-2`,label:`Failed`,value:String(e.failed),hint:`${e.escalated} escalated, ${e.cancelled} cancelled`}),(0,N.jsx)(M,{className:`col-span-2`,label:`Fix rounds`,value:String(e.fixRounds),hint:`Most rounds in one run: ${e.maxRound}`}),(0,N.jsx)(M,{className:`col-span-3`,label:`Time to merge`,value:Y(e.timeToMerge?.p50Ms),hint:X(e.timeToMerge,`No run merged in this window`)}),(0,N.jsx)(M,{className:`col-span-3`,label:`CI after merge`,value:Y(r?.p50Ms),hint:X(r,`No run waited for CI on main in this window`)})]}),e.steps.length>0&&(0,N.jsx)(`div`,{className:`overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,"aria-label":`${e.workflow} steps`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`whitespace-nowrap text-[11px] text-muted-foreground`,children:[(0,N.jsx)(`th`,{className:`text-left font-normal`,children:`Step`}),(0,N.jsx)(`th`,{className:`px-1.5 text-left font-normal`,children:`Outcomes`}),(0,N.jsx)(`th`,{className:`px-1.5 text-right font-normal`,title:`Median time from the step's start to its result`,children:`p50`}),(0,N.jsx)(`th`,{className:`px-1.5 text-right font-normal`,children:`Mean`}),(0,N.jsx)(`th`,{className:`pl-1.5 text-right font-normal`,children:`Longest`})]})}),(0,N.jsx)(`tbody`,{children:e.steps.map(e=>(0,N.jsxs)(`tr`,{"data-testid":`workflow-step-stats-${e.step}`,className:`border-t border-border/60 first:border-t-0`,children:[(0,N.jsx)(`th`,{scope:`row`,className:`whitespace-nowrap py-1 pr-2 text-left font-medium`,children:e.step}),(0,N.jsx)(`td`,{className:`px-1.5 py-1`,children:(0,N.jsx)(ce,{outcomes:e.outcomes})}),(0,N.jsx)(se,{duration:e.duration})]},e.step))})]})}),n.length>0&&(0,N.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Failed runs stopped at `,n.map(([e,t])=>`${e} (${t})`).join(`, `),`.`]})]})}function le({failures:e,total:t,now:n,projectTitles:r}){return e.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`ul`,{"aria-label":`Failed runs`,className:`divide-y divide-border rounded-lg border border-border bg-card`,children:e.map(e=>(0,N.jsxs)(`li`,{"data-testid":`workflow-failure-${e.runId}`,className:`wf-ledger flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm`,children:[(0,N.jsx)(`span`,{className:`ship-lamp h-2 w-2 shrink-0 rounded-full`,"data-status":e.status===`escalated`?`failing`:`unknown`,"aria-hidden":!0}),(0,N.jsx)(O,{text:e.workflow,className:`font-medium sm:w-28 sm:shrink-0`}),(0,N.jsx)(`div`,{className:`order-last w-full min-w-0 pl-5 sm:order-none sm:w-auto sm:flex-1 sm:pl-0`,children:(0,N.jsx)(A,{taskId:e.taskId,title:e.taskTitle})}),(0,N.jsxs)(`span`,{className:`ml-auto shrink-0 font-medium sm:ml-0`,children:[e.status===`escalated`?`Escalated`:`Cancelled`,` at `,e.step]}),(0,N.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`round `,e.round]}),(0,N.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:new Date(e.at).toLocaleString(),children:[a(n,e.at),` ago`]}),e.projectId&&r.get(e.projectId)&&(0,N.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:r.get(e.projectId)}),e.reason&&(0,N.jsx)(O,{text:e.reason,className:`order-last w-full pl-5 text-xs text-muted-foreground`})]},e.runId))}),t>e.length&&(0,N.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Showing the newest `,e.length,` of `,t,` failed runs.`]})]}):(0,N.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-4 text-center text-sm text-muted-foreground`,children:`No workflow run failed in this window.`})}var Q=e=>E(e.share??null);function $({label:e,rows:t}){return(0,N.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,"aria-label":`Adoption by ${e}`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`whitespace-nowrap text-[11px] text-muted-foreground`,children:[(0,N.jsx)(`th`,{className:`text-left font-normal`,children:e===`project`?`Project`:`Coordinator`}),(0,N.jsx)(`th`,{className:`px-1.5 text-right font-normal`,children:`Landed`}),(0,N.jsx)(`th`,{className:`px-1.5 text-right font-normal`,children:`Workflow`}),(0,N.jsx)(`th`,{className:`pl-1.5 text-left font-normal`,children:`Share`})]})}),(0,N.jsx)(`tbody`,{children:t.map(t=>(0,N.jsxs)(`tr`,{"data-testid":`workflow-adoption-${e}-${t.key||`none`}`,className:`border-t border-border/60 first:border-t-0`,children:[(0,N.jsx)(`th`,{scope:`row`,className:`max-w-0 py-1 pr-2 text-left font-medium`,title:t.title,children:(0,N.jsx)(O,{text:t.name})}),(0,N.jsx)(`td`,{className:`px-1.5 py-1 text-right tabular-nums`,children:t.landed}),(0,N.jsx)(`td`,{className:`px-1.5 py-1 text-right tabular-nums`,children:t.viaWorkflow}),(0,N.jsx)(`td`,{className:`w-28 py-1 pl-1.5`,children:(0,N.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-muted`,"aria-hidden":!0,children:(0,N.jsx)(`span`,{className:`block h-full rounded-full bg-primary`,style:{width:`${Math.round((t.share??0)*100)}%`}})}),(0,N.jsx)(`span`,{className:`w-9 text-right text-xs tabular-nums`,children:Q(t)})]})})]},t.key))})]})})}function ue({adoption:e,projectTitles:t}){let n=e.byProject.map(e=>({...e,key:e.projectId??``,name:e.projectId&&t.get(e.projectId)||e.repo||e.projectId||`No project`})),r=e.byCoordinator.map(e=>({...e,key:e.coordinator??``,name:e.label||e.coordinator||`Unattributed`,title:e.coordinator}));return(0,N.jsxs)(`section`,{"aria-labelledby":`wf-adoption`,"data-testid":`workflow-adoption`,className:`space-y-2`,children:[(0,N.jsx)(`h3`,{id:`wf-adoption`,className:`text-sm font-semibold`,children:`Adoption`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,N.jsx)(M,{label:`Through a workflow`,value:Q(e),hint:`${e.viaWorkflow} of ${e.landed} landed Tasks that land code`}),(0,N.jsx)(M,{label:`Workflow lands`,value:String(e.viaWorkflow)}),(0,N.jsx)(M,{label:`By hand`,value:String(e.byHand)})]}),e.landed===0?(0,N.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-4 text-center text-sm text-muted-foreground`,children:`No Task that lands code landed in this window.`}):(0,N.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,N.jsx)($,{label:`project`,rows:n}),(0,N.jsx)($,{label:`coordinator`,rows:r})]}),e.truncated&&(0,N.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`More lands matched than one read takes; the share covers the newest ones.`}),(0,N.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Tasks of type `,s.join(`, `),` that landed in this window, once each. A land counts as a workflow land when a workflow run on its Task started before it.`]})]})}function de({report:e,projectTitles:t}){let{totals:n}=e,r=Date.now();return(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsxs)(`div`,{"data-testid":`workflow-stats-totals`,className:`grid grid-cols-2 gap-2 sm:grid-cols-5`,children:[(0,N.jsx)(M,{label:`Runs`,value:String(n.runs)}),(0,N.jsx)(M,{label:`Running`,value:String(n.running)}),(0,N.jsx)(M,{label:`Landed`,value:String(n.done)}),(0,N.jsx)(M,{label:`Failed`,value:String(n.failed),hint:`${n.escalated} escalated, ${n.cancelled} cancelled`}),(0,N.jsx)(M,{label:`Fix rounds`,value:String(n.fixRounds),hint:`Loops back to an earlier step, such as a NO-GO sent back to the builder`})]}),e.truncated&&(0,N.jsx)(`div`,{role:`status`,className:`rounded-md border border-tone-warning/40 bg-tone-warning/10 px-3 py-2 text-sm`,children:`More runs matched than one read takes; the figures cover the newest ones.`}),e.adoption&&(0,N.jsx)(ue,{adoption:e.adoption,projectTitles:t}),e.workflows.length===0?(0,N.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-8 text-center text-sm text-muted-foreground`,children:`No workflow ran in this window.`}):(0,N.jsx)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:e.workflows.map(e=>(0,N.jsx)(Z,{stats:e},e.workflow))}),(0,N.jsxs)(`section`,{"aria-labelledby":`wf-failures`,className:`space-y-2`,children:[(0,N.jsxs)(`h3`,{id:`wf-failures`,className:`flex items-baseline gap-2 text-sm font-semibold`,children:[`Failed runs `,(0,N.jsx)(`span`,{className:`font-mono text-xs tabular-nums text-muted-foreground`,children:n.failed})]}),(0,N.jsx)(le,{failures:e.failures,total:n.failed,now:r,projectTitles:t})]}),(0,N.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Running runs, and runs that finished in this window. Step times run from the step's start to its result; land runs from the last step's result to the merge. Time to merge runs from the run's start to the merge; CI after merge is the wait for CI on main that follows it. Runs routed before step times were recorded count in outcomes but show no step time.`})]})}function fe({projectTitles:e}){let t=i(e=>e.workflowStats),n=i(e=>e.workflowLoading),r=i(e=>e.workflowError);return(0,N.jsxs)(`div`,{className:`space-y-3`,children:[(0,N.jsx)(ne,{keys:o,active:i(e=>e.workflowStatsWindow),onChange:i(e=>e.setWorkflowStatsWindow)}),r&&(0,N.jsxs)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[`Could not load the statistics: `,r]}),!t&&n&&(0,N.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading the statistics…`}),t&&(0,N.jsx)(de,{report:t,projectTitles:e})]})}function pe(){let e=i(e=>e.workflowRuns),t=i(e=>e.workflowFocusedRun),n=i(e=>e.workflowRecent),r=i(e=>e.workflowProjects),a=i(e=>e.workflowProjectId),o=i(e=>e.setWorkflowProject),s=i(e=>e.workflowLoading),c=i(e=>e.workflowError),l=i(e=>e.agentsById),u=i(e=>e.workflowTab),d=i(e=>e.setWorkflowTab),f=Date.now(),p=new Map(r.map(e=>[e.id,e.title||e.slug])),m=!a,h=m?p:new Map;return(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(S,{className:`h-5 w-5 text-muted-foreground`}),(0,N.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Workflows`})]}),(0,N.jsx)(v,{value:u,onValueChange:e=>d(e),children:(0,N.jsxs)(_,{children:[(0,N.jsx)(g,{value:`runs`,className:`px-3`,children:`Live`}),(0,N.jsx)(g,{value:`stats`,className:`px-3`,children:`Statistics`}),(0,N.jsx)(g,{value:`definitions`,className:`px-3`,children:`Definitions`}),(0,N.jsx)(g,{value:`catalog`,className:`px-3`,children:`Catalog`})]})}),(0,N.jsxs)(`select`,{"aria-label":`Project`,className:`h-8 max-w-full min-w-0 rounded-md border border-border bg-background px-2 text-sm`,value:a,onChange:e=>o(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:`All projects`}),r.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.title||e.slug},e.id))]})]}),u===`stats`&&(0,N.jsx)(fe,{projectTitles:h}),u===`definitions`&&(0,N.jsx)(ie,{projectTitles:h}),u===`catalog`&&(0,N.jsx)(ae,{projectName:a?p.get(a):void 0}),u===`runs`&&t&&(0,N.jsx)(k,{run:t,agentsById:l,now:f}),u===`runs`&&c&&(0,N.jsxs)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[`Could not load workflow runs: `,c]}),u===`runs`&&!e&&s&&(0,N.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading workflow runs…`}),e&&(0,N.jsxs)(`section`,{"aria-labelledby":`wf-running`,className:`space-y-2`,children:[(0,N.jsxs)(`h3`,{id:`wf-running`,className:`flex items-baseline gap-2 text-sm font-semibold`,children:[`Running `,(0,N.jsx)(`span`,{"data-testid":`workflow-running-count`,className:`font-mono text-xs tabular-nums text-muted-foreground`,children:e.length})]}),e.length===0?(0,N.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-8 text-center text-sm text-muted-foreground`,children:`No workflow is running. A coordinator starts one with relay_workflow_start.`}):e.filter(e=>e.runId!==t?.runId).map(e=>(0,N.jsx)(k,{run:e,agentsById:l,now:f,project:m&&e.projectId?p.get(e.projectId):void 0},e.runId))]}),n&&(0,N.jsxs)(`section`,{"aria-labelledby":`wf-recent`,className:`space-y-2`,children:[(0,N.jsx)(`h3`,{id:`wf-recent`,className:`text-sm font-semibold`,children:`Recently finished`}),(0,N.jsx)(j,{runs:n,now:f,projectTitles:h})]})]})}export{pe as WorkflowsView};
|
|
6
|
-
//# sourceMappingURL=workflows-
|
|
6
|
+
//# sourceMappingURL=workflows-DdmxRSyg.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t,u as n}from"./dist-DeW2Y1R5.js";import{t as r,wt as i}from"./store-BvtFdlGX.js";import{N as a}from"./provider-display-DbLWpP3j.js";import{et as o}from"./display-CfO7rTuF.js";import{t as s}from"./api-CIIVBtAV.js";import{i as c,n as l,r as u,t as d}from"./package-open-ckPgcjpv.js";import{t as f}from"./check-B3M9Ug1P.js";import{t as p}from"./chevron-down-BoG3JCZn.js";import{t as m}from"./chevron-right-iljytE0x.js";import{t as h}from"./clock-BWPPBh1_.js";import{t as g}from"./eye-BAP6fHrX.js";import{t as _}from"./file-pen-Crunre5f.js";import{t as v}from"./flag-CnEG9PH-.js";import{t as y}from"./folder-open-CBUCMSlu.js";import{t as b}from"./git-branch-yxhV0m8E.js";import{t as x}from"./git-commit-horizontal-DS1pJ_SS.js";import{t as S}from"./git-merge-C7eIG425.js";import{t as ee}from"./pause-DttnHD4c.js";import{t as te}from"./play-BbT8m7A0.js";import{t as C}from"./refresh-cw-CfpvQcUn.js";import{t as w}from"./trash-2-FbcSq927.js";import{t as T}from"./triangle-alert-BBNhfgMi.js";import{t as E}from"./x-Bge17hWJ.js";import{t as D}from"./button-Do6Z3vvn.js";import{t as O}from"./badge-DqJRtj_p.js";import{t as k}from"./copy-button-CjOj4HEf.js";import{t as A}from"./task-chip-CYj0mpoL.js";import{t as j}from"./agent-name-CTZBrSD9.js";import{o as M,r as N,s as P,t as F}from"./card-C4QJ4hCW.js";var I=[`cleaned`,`merged`,`landed`,`abandoned`],ne=new Set([`active`,`ready`,`conflict`,`review_requested`,`merge_planned`,`gate_running`,`gate_failed`,`merging`]),L=new Set([`active`,`ready`,`review_requested`,`merge_planned`,`gate_failed`,`conflict`]),R={active:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,ready:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,conflict:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,review_requested:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,merge_planned:`bg-tone-indigo/10 text-tone-indigo-fg border-tone-indigo/20`,gate_running:`bg-tone-sky/10 text-tone-sky-fg border-tone-sky/20`,gate_failed:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,merging:`bg-tone-indigo/10 text-tone-indigo-fg border-tone-indigo/20`,landed:`bg-tone-violet/10 text-tone-violet-fg border-tone-violet/20`,merged:`bg-tone-violet/10 text-tone-violet-fg border-tone-violet/20`,abandoned:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,cleanup_requested:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,cleaned:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,stranded:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`},z={active:`active`,ready:`ready`,conflict:`conflict`,review_requested:`review`,merge_planned:`queued`,gate_running:`gate running`,gate_failed:`gate failed`,merging:`merging`,landed:`landed`,merged:`merged`,abandoned:`abandoned`,cleanup_requested:`cleanup`,cleaned:`cleaned`,stranded:`stranded`},B={conflict:0,ready:1,review_requested:2,merge_planned:3,gate_running:4,gate_failed:5,merging:6,active:7,cleanup_requested:8,landed:9,merged:10,abandoned:11,cleaned:12,stranded:13},V=n();function H({workspace:e,expanded:t,onToggleDetails:n}){let i=r(e=>e.workspaceAction),a=r(e=>e.purgeWorkspace),o=r(e=>e.fetchWorkspaceMergePreview),s=r(e=>e.openFilesAt),c=e.status===`cleaned`||e.status===`merged`||e.status===`landed`||e.status===`abandoned`,l=!!e.metadata.stewardCancellation&&![`completed`,`unproven-released`].includes(e.metadata.stewardCancellation.status),u=l||c||e.status===`cleanup_requested`,d=e.worktreePath||e.sourceCwd||e.repoRoot,h=r(t=>t.workspaceGitState[e.id]),_=!!h&&h.available!==!1&&h.landed===!0,b=!!e.metadata.mergeHold,x=e.mode===`isolated`&&!!e.worktreePath&&L.has(e.status)&&!_&&!l&&!b;async function C(){await o(e.id),await i(e.id,`merge`)}return(0,V.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:[(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,title:t?`Hide details`:`Show diff & timeline`,onClick:n,children:t?(0,V.jsx)(p,{className:`h-3.5 w-3.5`}):(0,V.jsx)(m,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,title:`Open workspace`,disabled:!d||e.status===`cleaned`,onClick:()=>void s({path:d}),children:(0,V.jsx)(y,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(k,{value:d,label:`Copy path`,copiedLabel:`Copied path`,size:`icon-sm`,variant:`ghost`,disabled:!d}),e.mode===`isolated`&&!c&&(0,V.jsxs)(D,{size:`sm`,variant:`outline`,title:b?`Resume workspace merge`:`Hold workspace merge (does not cancel an admitted land)`,onClick:()=>void i(e.id,b?`resume-merge`:`hold-merge`),children:[b?(0,V.jsx)(te,{className:`mr-1 h-3.5 w-3.5`}):(0,V.jsx)(ee,{className:`mr-1 h-3.5 w-3.5`}),b?`Merge held — resume`:`Hold merge`]}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Mark ready`,disabled:u||e.status===`ready`,onClick:()=>void i(e.id,`ready`),children:(0,V.jsx)(f,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Request review`,disabled:u||e.status===`review_requested`,onClick:()=>void i(e.id,`request-review`),children:(0,V.jsx)(g,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Mark merge planned`,disabled:u||b||e.status===`merge_planned`,onClick:()=>void i(e.id,`merge-plan`),children:(0,V.jsx)(v,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`default`,title:_?`Already merged into base — nothing to land`:`Merge & land work`,disabled:!x,onClick:()=>void C(),children:(0,V.jsx)(S,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Request cleanup (removes the worktree on the host)`,disabled:u,onClick:()=>void i(e.id,`cleanup`),children:(0,V.jsx)(w,{className:`h-3.5 w-3.5`})}),c&&(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,title:`Purge record (clears the row, does not touch disk)`,onClick:()=>void a(e.id),children:(0,V.jsx)(E,{className:`h-3.5 w-3.5`})})]})}var U=e(t(),1),W=new Set([`active`,`ready`,`conflict`,`review_requested`,`merge_planned`,`gate_running`,`gate_failed`,`merging`,`cleanup_requested`]),G=new Set(I),K=`__all__`,q=`__unassigned__`;function J(e,t){let n=new Map;for(let t of e){let e=t.repoRoot||t.sourceCwd||`unknown repo`;n.set(e,[...n.get(e)||[],t])}return[...n.entries()].map(([e,n])=>({repoRoot:e,workspaces:n.sort(t)})).sort((e,t)=>e.repoRoot.localeCompare(t.repoRoot))}function Y(e,t){let n=new Map;for(let t of e){let e=t.projectSlug||t.repoRoot||t.sourceCwd||`unassigned`;n.set(e,[...n.get(e)||[],t])}return[...n.entries()].map(([e,n])=>{let r=n[0],i=!r.projectId;return{key:e,title:i?r.repoRoot||r.sourceCwd||`unknown repo`:r.projectTitle||r.projectSlug||r.repoRoot,...r.projectId?{projectId:r.projectId}:{},...r.projectSlug?{projectSlug:r.projectSlug}:{},unassigned:i,repoGroups:J(n,t)}}).sort((e,t)=>{let n=e.repoGroups.some(e=>e.workspaces.some(e=>W.has(e.status)));return n===t.repoGroups.some(e=>e.workspaces.some(e=>W.has(e.status)))?e.title.localeCompare(t.title):n?-1:1})}function X(e,t,n){let r=t===`all`?e:t===`cleaned`?e.filter(e=>G.has(e.status)):e.filter(e=>!G.has(e.status));return n===`__all__`?r:n===`__unassigned__`?r.filter(e=>!e.projectId):r.filter(e=>e.projectId===n)}function Z({group:e,renderWorkspaceRow:t}){let n=e.repoGroups.flatMap(e=>e.workspaces),r=n.filter(e=>W.has(e.status)).length,i=n.filter(e=>e.status===`ready`||e.status===`review_requested`||e.status===`merge_planned`||e.status===`gate_running`||e.status===`gate_failed`||e.status===`merging`).length,a=n.filter(e=>e.status===`conflict`).length,o=e.repoGroups.length>1;return(0,V.jsxs)(F,{children:[(0,V.jsx)(M,{className:`px-4 py-3`,children:(0,V.jsx)(`div`,{className:`flex min-w-0 items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(P,{className:`truncate text-sm font-medium`,title:e.title,children:e.title}),e.unassigned&&(0,V.jsx)(O,{variant:`outline`,className:`text-[10px]`,children:`Unassigned`})]}),(0,V.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:[(0,V.jsxs)(O,{variant:`outline`,className:`text-[10px]`,children:[n.length,` total`]}),(0,V.jsxs)(O,{variant:`outline`,className:`text-[10px]`,children:[r,` live`]}),i>0&&(0,V.jsxs)(O,{variant:`outline`,className:`border-tone-success/20 text-tone-success-fg text-[10px]`,children:[i,` merge signal`]}),a>0&&(0,V.jsxs)(O,{variant:`outline`,className:`border-tone-danger/20 text-tone-danger-fg text-[10px]`,children:[a,` conflict`]})]})]})})}),(0,V.jsx)(N,{className:`p-0`,children:e.repoGroups.map(e=>(0,V.jsxs)(`div`,{className:`border-t border-border first:border-t-0`,children:[o&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-dashed border-border/80 px-3 py-2`,children:[(0,V.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,title:e.repoRoot,children:e.repoRoot})]}),e.workspaces.map(e=>t(e))]},e.repoRoot))})]})}function re(e){let t=e.split(`/`).filter(Boolean);return t.length<=3?e||`-`:`/${t.slice(-3).join(`/`)}`}function ie(){let e=r(e=>e.workspaceOrphans),t=r(e=>e.fetchWorkspaceOrphans),n=r(e=>e.reclaimWorkspaceOrphan);return(0,U.useEffect)(()=>{t()},[t]),e.length?(0,V.jsxs)(F,{className:`border-tone-warning/30`,children:[(0,V.jsxs)(M,{className:`px-4 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(d,{className:`h-4 w-4 text-tone-warning-fg`}),(0,V.jsx)(P,{className:`text-sm font-medium`,children:`Orphaned worktrees`}),(0,V.jsx)(O,{variant:`outline`,className:`border-tone-warning/30 text-tone-warning-fg text-[10px]`,children:e.length}),(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,className:`ml-auto h-6 w-6`,title:`Rescan`,onClick:()=>void t(),children:(0,V.jsx)(C,{className:`h-3.5 w-3.5`})})]}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Agent worktrees on disk with no live workspace. Reclaim removes them from the host.`})]}),(0,V.jsx)(N,{className:`p-0`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border px-4 py-2 text-xs`,children:[(0,V.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`truncate font-medium`,title:e.branch,children:e.branch||`(detached)`}),(0,V.jsx)(`span`,{className:`truncate font-mono text-muted-foreground`,title:e.worktreePath,children:re(e.worktreePath)}),e.hadTerminalRow&&(0,V.jsx)(O,{variant:`outline`,className:`text-[10px]`,children:`cleanup failed`}),(0,V.jsxs)(D,{size:`sm`,variant:`outline`,className:`ml-auto h-7 text-xs`,onClick:()=>void n(e),children:[(0,V.jsx)(d,{className:`mr-1 h-3.5 w-3.5`}),`Reclaim`]})]},e.worktreePath))})]}):null}function ae(e,t,n){if(n){let t=e.find(e=>e.branch&&e.branch===n);if(t)return t}if(!t)return null;let r=e.filter(e=>e.ownerAgentId===t);return r.length===0?null:r.length===1?r[0]:null}function oe({cancellation:e}){let t=e.status===`completed`,n=e.status===`unproven-released`,r=e.proof===`unavailable`;return(0,V.jsxs)(`div`,{className:`mx-3 mb-3 rounded-md border border-tone-warning/20 px-3 py-2 text-xs`,role:`status`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:n?`Workspace released · stop unproven`:t?`Steward stopped · workspace handed back`:`Steward cancellation · hand-back pending`}),(0,V.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:e.status===`stopped`?`Steward stopped; hand-back awaits withdrawal of remaining landing activity. Recovery retries automatically.`:n||r?`Process-tree proof unavailable. Claims released; the canceled generation remains fenced.`:t?`The host confirmed the conflict job and its children stopped.`:`Shutdown is settling. Retry in 2 seconds; deadline recovery starts after 60 seconds.`})]})}function se({workspace:e}){let t=typeof e.metadata.rekeyCommandId==`string`,n=typeof e.metadata.rekeyError==`string`?e.metadata.rekeyError:void 0,r=a(e.metadata.lastStewardRekey)?e.metadata.lastStewardRekey:void 0;return!t&&!n&&!r?null:(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,role:`status`,children:t?`Steward rebase: synchronizing owner host`:n?`Steward rebase refused: ${n}`:`Steward rebase recorded: ${String(r?.oldHeadSha).slice(0,12)} → ${String(r?.newHeadSha).slice(0,12)}`})}function Q(e,t){return(0,V.jsx)(j,{agent:e,fallback:t||`-`})}function ce(e){let t=e.split(`/`).filter(Boolean);return t.length<=3?e||`-`:`/${t.slice(-3).join(`/`)}`}function le(e){return R[e]||`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`}function ue(e,t){let n=(B[e.status]??99)-(B[t.status]??99);return n===0?Number(t.updatedAt||0)-Number(e.updatedAt||0):n}function $({workspace:e,unmerged:t}){let n=r(t=>t.workspaceMergePreview[e.id]),i=r(e=>e.fetchWorkspaceMergePreview),a=t>0&&L.has(e.status);return(0,U.useEffect)(()=>{a&&n===void 0&&i(e.id)},[a,n,e.id,i]),!a||n===void 0||n.available===!1?null:n.conflict?(0,V.jsxs)(`span`,{className:`flex items-center gap-0.5 text-tone-warning-fg`,title:`Merging into ${n.baseRef||`base`} would conflict — resolve before merging`,children:[(0,V.jsx)(T,{className:`h-3 w-3`}),`conflict`]}):n.conflict===!1?(0,V.jsxs)(`span`,{className:`flex items-center gap-0.5 text-tone-success-fg`,title:`Clean to merge via ${n.strategy===`pr`?`PR`:`rebase + fast-forward`} into ${n.baseRef||`base`}`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),n.strategy===`pr`?`PR ready`:`clean`]}):null}function de({workspace:e}){let t=i(),n=r(t=>t.workspaceGitState[e.id]),a=r(e=>e.fetchWorkspaceGitState),s=e.mode===`isolated`&&!!e.worktreePath&&ne.has(e.status);if((0,U.useEffect)(()=>{s&&n===void 0&&a(e.id)},[s,n,e.id,a]),!s)return null;let l=(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,className:`h-5 w-5`,title:`Refresh git state`,onClick:()=>void a(e.id),children:(0,V.jsx)(C,{className:`h-3 w-3`})});if(n===void 0)return(0,V.jsx)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:`Loading git state…`});if(n.available===!1)return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,title:n.reason,children:[(0,V.jsx)(`span`,{children:`git state unavailable`}),l]});if(n.missing)return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:[`worktree gone `,l]});if(n.error)return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-tone-danger-fg`,title:n.error,children:[(0,V.jsx)(`span`,{children:`git error`}),l]});let d=n.ahead??0,p=n.landed===!0,m=p?0:n.unmergedAhead??d,h=n.behind??0,g=n.dirtyCount??0,v=m===0&&g===0&&!p,y=n.lastCommit;return(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px]`,children:[v?(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`no unmerged work`}):(0,V.jsxs)(V.Fragment,{children:[p?(0,V.jsxs)(`span`,{className:`flex items-center gap-0.5 text-tone-success-fg`,title:`Work already landed in ${n.baseRef||`base`} via squash/cherry-pick — safe to clean up`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`landed`]}):(0,V.jsxs)(`span`,{className:m>0?`flex items-center text-tone-success-fg`:`flex items-center text-muted-foreground`,title:d===m?`${m} commit(s) ahead of base`:`${m} unmerged commit(s) (${d} ahead of base)`,children:[(0,V.jsx)(u,{className:`h-3 w-3`}),m]}),(0,V.jsxs)(`span`,{className:h>0?`flex items-center text-tone-warning-fg`:`flex items-center text-muted-foreground`,title:`${h} commit(s) behind base`,children:[(0,V.jsx)(c,{className:`h-3 w-3`}),h]}),g>0&&(0,V.jsxs)(`span`,{className:`flex items-center text-tone-orange-fg`,title:`${g} uncommitted change(s)`,children:[(0,V.jsx)(_,{className:`h-3 w-3`}),g]}),!p&&(0,V.jsx)($,{workspace:e,unmerged:m})]}),l]}),y&&(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground`,title:`${y.sha.slice(0,8)} — ${y.message}`,children:[(0,V.jsx)(x,{className:`h-3 w-3 shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:y.message||y.sha.slice(0,8)}),y.at?(0,V.jsxs)(`span`,{className:`shrink-0 opacity-70`,children:[`· `,o(t,y.at)]}):null]})]})}function fe({workspace:e}){let t=i(),n=typeof e.metadata?.mergedAt==`number`?e.metadata.mergedAt:void 0,r=[{label:`created`,at:e.createdAt},{label:`ready`,at:e.readyAt},{label:`merged`,at:n},{label:`cleaned`,at:e.cleanedAt}].filter(e=>typeof e.at==`number`&&e.at>0);return(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-foreground`,children:[(0,V.jsx)(h,{className:`h-3 w-3`}),`Timeline`]}),r.map((e,n)=>(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n>0&&(0,V.jsx)(`span`,{className:`opacity-40`,children:`→`}),(0,V.jsx)(`span`,{className:`text-foreground`,children:e.label}),(0,V.jsx)(`span`,{title:new Date(e.at).toLocaleString(),children:o(t,e.at)})]},e.label))]})}function pe(e){return e.startsWith(`+`)&&!e.startsWith(`+++`)?`text-tone-success-fg`:e.startsWith(`-`)&&!e.startsWith(`---`)?`text-tone-danger-fg`:e.startsWith(`@@`)?`text-tone-cyan-fg`:e.startsWith(`diff `)||e.startsWith(`index `)||e.startsWith(`+++`)||e.startsWith(`---`)?`text-muted-foreground`:``}function me({workspace:e}){let t=r(t=>t.workspaceDiff[e.id]),n=r(e=>e.fetchWorkspaceDiff),i=e.mode===`isolated`&&!!e.worktreePath;if((0,U.useEffect)(()=>{i&&t===void 0&&n(e.id)},[i,t,e.id,n]),!i)return null;if(t===void 0)return(0,V.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Loading diff…`});if(t.available===!1)return(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`Diff unavailable`,t.reason?`: ${t.reason}`:``]});if(t.missing)return(0,V.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Worktree no longer on disk`});if(t.error)return(0,V.jsxs)(`div`,{className:`text-[11px] text-tone-danger-fg`,children:[`Diff error: `,t.error]});if(!t.files.length)return(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`No committed changes against `,t.baseRef||`base`]});let a=(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,className:`h-5 w-5`,title:`Refresh diff`,onClick:()=>void n(e.id),children:(0,V.jsx)(C,{className:`h-3 w-3`})});return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-medium`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),(0,V.jsxs)(`span`,{children:[t.files.length,` file`,t.files.length===1?``:`s`,` vs `,t.baseRef||`base`]}),a]}),(0,V.jsx)(`ul`,{className:`space-y-0.5 text-[11px]`,children:t.files.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center gap-2 font-mono`,children:[(0,V.jsx)(`span`,{className:`truncate`,title:e.path,children:e.path}),e.binary?(0,V.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`binary`}):(0,V.jsxs)(`span`,{className:`shrink-0`,children:[(0,V.jsxs)(`span`,{className:`text-tone-success-fg`,children:[`+`,e.additions??0]}),` `,(0,V.jsxs)(`span`,{className:`text-tone-danger-fg`,children:[`−`,e.deletions??0]})]})]},e.path))}),t.patch&&(0,V.jsxs)(`pre`,{className:`max-h-80 overflow-auto rounded border border-border bg-muted/30 p-2 text-[10.5px] leading-relaxed`,children:[t.patch.split(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t,u as n}from"./dist-DeW2Y1R5.js";import{t as r,wt as i}from"./store-DcClXLH0.js";import{N as a}from"./provider-display-DsuWMvVL.js";import{et as o}from"./display-BrKWFGJz.js";import{t as s}from"./api-CIIVBtAV.js";import{i as c,n as l,r as u,t as d}from"./package-open-ckPgcjpv.js";import{t as f}from"./check-B3M9Ug1P.js";import{t as p}from"./chevron-down-BoG3JCZn.js";import{t as m}from"./chevron-right-iljytE0x.js";import{t as h}from"./clock-BWPPBh1_.js";import{t as g}from"./eye-BAP6fHrX.js";import{t as _}from"./file-pen-Crunre5f.js";import{t as v}from"./flag-CnEG9PH-.js";import{t as y}from"./folder-open-CBUCMSlu.js";import{t as b}from"./git-branch-yxhV0m8E.js";import{t as x}from"./git-commit-horizontal-DS1pJ_SS.js";import{t as S}from"./git-merge-C7eIG425.js";import{t as ee}from"./pause-DttnHD4c.js";import{t as te}from"./play-BbT8m7A0.js";import{t as C}from"./refresh-cw-CfpvQcUn.js";import{t as w}from"./trash-2-FbcSq927.js";import{t as T}from"./triangle-alert-BBNhfgMi.js";import{t as E}from"./x-Bge17hWJ.js";import{t as D}from"./button-Do6Z3vvn.js";import{t as O}from"./badge-DqJRtj_p.js";import{t as k}from"./copy-button-CjOj4HEf.js";import{t as A}from"./task-chip-CYj0mpoL.js";import{t as j}from"./agent-name-DKbiIhBo.js";import{o as M,r as N,s as P,t as F}from"./card-C4QJ4hCW.js";var I=[`cleaned`,`merged`,`landed`,`abandoned`],ne=new Set([`active`,`ready`,`conflict`,`review_requested`,`merge_planned`,`gate_running`,`gate_failed`,`merging`]),L=new Set([`active`,`ready`,`review_requested`,`merge_planned`,`gate_failed`,`conflict`]),R={active:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,ready:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,conflict:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,review_requested:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,merge_planned:`bg-tone-indigo/10 text-tone-indigo-fg border-tone-indigo/20`,gate_running:`bg-tone-sky/10 text-tone-sky-fg border-tone-sky/20`,gate_failed:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,merging:`bg-tone-indigo/10 text-tone-indigo-fg border-tone-indigo/20`,landed:`bg-tone-violet/10 text-tone-violet-fg border-tone-violet/20`,merged:`bg-tone-violet/10 text-tone-violet-fg border-tone-violet/20`,abandoned:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,cleanup_requested:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,cleaned:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,stranded:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`},z={active:`active`,ready:`ready`,conflict:`conflict`,review_requested:`review`,merge_planned:`queued`,gate_running:`gate running`,gate_failed:`gate failed`,merging:`merging`,landed:`landed`,merged:`merged`,abandoned:`abandoned`,cleanup_requested:`cleanup`,cleaned:`cleaned`,stranded:`stranded`},B={conflict:0,ready:1,review_requested:2,merge_planned:3,gate_running:4,gate_failed:5,merging:6,active:7,cleanup_requested:8,landed:9,merged:10,abandoned:11,cleaned:12,stranded:13},V=n();function H({workspace:e,expanded:t,onToggleDetails:n}){let i=r(e=>e.workspaceAction),a=r(e=>e.purgeWorkspace),o=r(e=>e.fetchWorkspaceMergePreview),s=r(e=>e.openFilesAt),c=e.status===`cleaned`||e.status===`merged`||e.status===`landed`||e.status===`abandoned`,l=!!e.metadata.stewardCancellation&&![`completed`,`unproven-released`].includes(e.metadata.stewardCancellation.status),u=l||c||e.status===`cleanup_requested`,d=e.worktreePath||e.sourceCwd||e.repoRoot,h=r(t=>t.workspaceGitState[e.id]),_=!!h&&h.available!==!1&&h.landed===!0,b=!!e.metadata.mergeHold,x=e.mode===`isolated`&&!!e.worktreePath&&L.has(e.status)&&!_&&!l&&!b;async function C(){await o(e.id),await i(e.id,`merge`)}return(0,V.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:[(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,title:t?`Hide details`:`Show diff & timeline`,onClick:n,children:t?(0,V.jsx)(p,{className:`h-3.5 w-3.5`}):(0,V.jsx)(m,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,title:`Open workspace`,disabled:!d||e.status===`cleaned`,onClick:()=>void s({path:d}),children:(0,V.jsx)(y,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(k,{value:d,label:`Copy path`,copiedLabel:`Copied path`,size:`icon-sm`,variant:`ghost`,disabled:!d}),e.mode===`isolated`&&!c&&(0,V.jsxs)(D,{size:`sm`,variant:`outline`,title:b?`Resume workspace merge`:`Hold workspace merge (does not cancel an admitted land)`,onClick:()=>void i(e.id,b?`resume-merge`:`hold-merge`),children:[b?(0,V.jsx)(te,{className:`mr-1 h-3.5 w-3.5`}):(0,V.jsx)(ee,{className:`mr-1 h-3.5 w-3.5`}),b?`Merge held — resume`:`Hold merge`]}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Mark ready`,disabled:u||e.status===`ready`,onClick:()=>void i(e.id,`ready`),children:(0,V.jsx)(f,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Request review`,disabled:u||e.status===`review_requested`,onClick:()=>void i(e.id,`request-review`),children:(0,V.jsx)(g,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Mark merge planned`,disabled:u||b||e.status===`merge_planned`,onClick:()=>void i(e.id,`merge-plan`),children:(0,V.jsx)(v,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`default`,title:_?`Already merged into base — nothing to land`:`Merge & land work`,disabled:!x,onClick:()=>void C(),children:(0,V.jsx)(S,{className:`h-3.5 w-3.5`})}),(0,V.jsx)(D,{size:`icon-sm`,variant:`outline`,title:`Request cleanup (removes the worktree on the host)`,disabled:u,onClick:()=>void i(e.id,`cleanup`),children:(0,V.jsx)(w,{className:`h-3.5 w-3.5`})}),c&&(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,title:`Purge record (clears the row, does not touch disk)`,onClick:()=>void a(e.id),children:(0,V.jsx)(E,{className:`h-3.5 w-3.5`})})]})}var U=e(t(),1),W=new Set([`active`,`ready`,`conflict`,`review_requested`,`merge_planned`,`gate_running`,`gate_failed`,`merging`,`cleanup_requested`]),G=new Set(I),K=`__all__`,q=`__unassigned__`;function J(e,t){let n=new Map;for(let t of e){let e=t.repoRoot||t.sourceCwd||`unknown repo`;n.set(e,[...n.get(e)||[],t])}return[...n.entries()].map(([e,n])=>({repoRoot:e,workspaces:n.sort(t)})).sort((e,t)=>e.repoRoot.localeCompare(t.repoRoot))}function Y(e,t){let n=new Map;for(let t of e){let e=t.projectSlug||t.repoRoot||t.sourceCwd||`unassigned`;n.set(e,[...n.get(e)||[],t])}return[...n.entries()].map(([e,n])=>{let r=n[0],i=!r.projectId;return{key:e,title:i?r.repoRoot||r.sourceCwd||`unknown repo`:r.projectTitle||r.projectSlug||r.repoRoot,...r.projectId?{projectId:r.projectId}:{},...r.projectSlug?{projectSlug:r.projectSlug}:{},unassigned:i,repoGroups:J(n,t)}}).sort((e,t)=>{let n=e.repoGroups.some(e=>e.workspaces.some(e=>W.has(e.status)));return n===t.repoGroups.some(e=>e.workspaces.some(e=>W.has(e.status)))?e.title.localeCompare(t.title):n?-1:1})}function X(e,t,n){let r=t===`all`?e:t===`cleaned`?e.filter(e=>G.has(e.status)):e.filter(e=>!G.has(e.status));return n===`__all__`?r:n===`__unassigned__`?r.filter(e=>!e.projectId):r.filter(e=>e.projectId===n)}function Z({group:e,renderWorkspaceRow:t}){let n=e.repoGroups.flatMap(e=>e.workspaces),r=n.filter(e=>W.has(e.status)).length,i=n.filter(e=>e.status===`ready`||e.status===`review_requested`||e.status===`merge_planned`||e.status===`gate_running`||e.status===`gate_failed`||e.status===`merging`).length,a=n.filter(e=>e.status===`conflict`).length,o=e.repoGroups.length>1;return(0,V.jsxs)(F,{children:[(0,V.jsx)(M,{className:`px-4 py-3`,children:(0,V.jsx)(`div`,{className:`flex min-w-0 items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(P,{className:`truncate text-sm font-medium`,title:e.title,children:e.title}),e.unassigned&&(0,V.jsx)(O,{variant:`outline`,className:`text-[10px]`,children:`Unassigned`})]}),(0,V.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:[(0,V.jsxs)(O,{variant:`outline`,className:`text-[10px]`,children:[n.length,` total`]}),(0,V.jsxs)(O,{variant:`outline`,className:`text-[10px]`,children:[r,` live`]}),i>0&&(0,V.jsxs)(O,{variant:`outline`,className:`border-tone-success/20 text-tone-success-fg text-[10px]`,children:[i,` merge signal`]}),a>0&&(0,V.jsxs)(O,{variant:`outline`,className:`border-tone-danger/20 text-tone-danger-fg text-[10px]`,children:[a,` conflict`]})]})]})})}),(0,V.jsx)(N,{className:`p-0`,children:e.repoGroups.map(e=>(0,V.jsxs)(`div`,{className:`border-t border-border first:border-t-0`,children:[o&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-dashed border-border/80 px-3 py-2`,children:[(0,V.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,title:e.repoRoot,children:e.repoRoot})]}),e.workspaces.map(e=>t(e))]},e.repoRoot))})]})}function re(e){let t=e.split(`/`).filter(Boolean);return t.length<=3?e||`-`:`/${t.slice(-3).join(`/`)}`}function ie(){let e=r(e=>e.workspaceOrphans),t=r(e=>e.fetchWorkspaceOrphans),n=r(e=>e.reclaimWorkspaceOrphan);return(0,U.useEffect)(()=>{t()},[t]),e.length?(0,V.jsxs)(F,{className:`border-tone-warning/30`,children:[(0,V.jsxs)(M,{className:`px-4 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(d,{className:`h-4 w-4 text-tone-warning-fg`}),(0,V.jsx)(P,{className:`text-sm font-medium`,children:`Orphaned worktrees`}),(0,V.jsx)(O,{variant:`outline`,className:`border-tone-warning/30 text-tone-warning-fg text-[10px]`,children:e.length}),(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,className:`ml-auto h-6 w-6`,title:`Rescan`,onClick:()=>void t(),children:(0,V.jsx)(C,{className:`h-3.5 w-3.5`})})]}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Agent worktrees on disk with no live workspace. Reclaim removes them from the host.`})]}),(0,V.jsx)(N,{className:`p-0`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-3 border-t border-border px-4 py-2 text-xs`,children:[(0,V.jsx)(y,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`truncate font-medium`,title:e.branch,children:e.branch||`(detached)`}),(0,V.jsx)(`span`,{className:`truncate font-mono text-muted-foreground`,title:e.worktreePath,children:re(e.worktreePath)}),e.hadTerminalRow&&(0,V.jsx)(O,{variant:`outline`,className:`text-[10px]`,children:`cleanup failed`}),(0,V.jsxs)(D,{size:`sm`,variant:`outline`,className:`ml-auto h-7 text-xs`,onClick:()=>void n(e),children:[(0,V.jsx)(d,{className:`mr-1 h-3.5 w-3.5`}),`Reclaim`]})]},e.worktreePath))})]}):null}function ae(e,t,n){if(n){let t=e.find(e=>e.branch&&e.branch===n);if(t)return t}if(!t)return null;let r=e.filter(e=>e.ownerAgentId===t);return r.length===0?null:r.length===1?r[0]:null}function oe({cancellation:e}){let t=e.status===`completed`,n=e.status===`unproven-released`,r=e.proof===`unavailable`;return(0,V.jsxs)(`div`,{className:`mx-3 mb-3 rounded-md border border-tone-warning/20 px-3 py-2 text-xs`,role:`status`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:n?`Workspace released · stop unproven`:t?`Steward stopped · workspace handed back`:`Steward cancellation · hand-back pending`}),(0,V.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:e.status===`stopped`?`Steward stopped; hand-back awaits withdrawal of remaining landing activity. Recovery retries automatically.`:n||r?`Process-tree proof unavailable. Claims released; the canceled generation remains fenced.`:t?`The host confirmed the conflict job and its children stopped.`:`Shutdown is settling. Retry in 2 seconds; deadline recovery starts after 60 seconds.`})]})}function se({workspace:e}){let t=typeof e.metadata.rekeyCommandId==`string`,n=typeof e.metadata.rekeyError==`string`?e.metadata.rekeyError:void 0,r=a(e.metadata.lastStewardRekey)?e.metadata.lastStewardRekey:void 0;return!t&&!n&&!r?null:(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,role:`status`,children:t?`Steward rebase: synchronizing owner host`:n?`Steward rebase refused: ${n}`:`Steward rebase recorded: ${String(r?.oldHeadSha).slice(0,12)} → ${String(r?.newHeadSha).slice(0,12)}`})}function Q(e,t){return(0,V.jsx)(j,{agent:e,fallback:t||`-`})}function ce(e){let t=e.split(`/`).filter(Boolean);return t.length<=3?e||`-`:`/${t.slice(-3).join(`/`)}`}function le(e){return R[e]||`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`}function ue(e,t){let n=(B[e.status]??99)-(B[t.status]??99);return n===0?Number(t.updatedAt||0)-Number(e.updatedAt||0):n}function $({workspace:e,unmerged:t}){let n=r(t=>t.workspaceMergePreview[e.id]),i=r(e=>e.fetchWorkspaceMergePreview),a=t>0&&L.has(e.status);return(0,U.useEffect)(()=>{a&&n===void 0&&i(e.id)},[a,n,e.id,i]),!a||n===void 0||n.available===!1?null:n.conflict?(0,V.jsxs)(`span`,{className:`flex items-center gap-0.5 text-tone-warning-fg`,title:`Merging into ${n.baseRef||`base`} would conflict — resolve before merging`,children:[(0,V.jsx)(T,{className:`h-3 w-3`}),`conflict`]}):n.conflict===!1?(0,V.jsxs)(`span`,{className:`flex items-center gap-0.5 text-tone-success-fg`,title:`Clean to merge via ${n.strategy===`pr`?`PR`:`rebase + fast-forward`} into ${n.baseRef||`base`}`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),n.strategy===`pr`?`PR ready`:`clean`]}):null}function de({workspace:e}){let t=i(),n=r(t=>t.workspaceGitState[e.id]),a=r(e=>e.fetchWorkspaceGitState),s=e.mode===`isolated`&&!!e.worktreePath&&ne.has(e.status);if((0,U.useEffect)(()=>{s&&n===void 0&&a(e.id)},[s,n,e.id,a]),!s)return null;let l=(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,className:`h-5 w-5`,title:`Refresh git state`,onClick:()=>void a(e.id),children:(0,V.jsx)(C,{className:`h-3 w-3`})});if(n===void 0)return(0,V.jsx)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:`Loading git state…`});if(n.available===!1)return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,title:n.reason,children:[(0,V.jsx)(`span`,{children:`git state unavailable`}),l]});if(n.missing)return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:[`worktree gone `,l]});if(n.error)return(0,V.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] text-tone-danger-fg`,title:n.error,children:[(0,V.jsx)(`span`,{children:`git error`}),l]});let d=n.ahead??0,p=n.landed===!0,m=p?0:n.unmergedAhead??d,h=n.behind??0,g=n.dirtyCount??0,v=m===0&&g===0&&!p,y=n.lastCommit;return(0,V.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px]`,children:[v?(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`no unmerged work`}):(0,V.jsxs)(V.Fragment,{children:[p?(0,V.jsxs)(`span`,{className:`flex items-center gap-0.5 text-tone-success-fg`,title:`Work already landed in ${n.baseRef||`base`} via squash/cherry-pick — safe to clean up`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`landed`]}):(0,V.jsxs)(`span`,{className:m>0?`flex items-center text-tone-success-fg`:`flex items-center text-muted-foreground`,title:d===m?`${m} commit(s) ahead of base`:`${m} unmerged commit(s) (${d} ahead of base)`,children:[(0,V.jsx)(u,{className:`h-3 w-3`}),m]}),(0,V.jsxs)(`span`,{className:h>0?`flex items-center text-tone-warning-fg`:`flex items-center text-muted-foreground`,title:`${h} commit(s) behind base`,children:[(0,V.jsx)(c,{className:`h-3 w-3`}),h]}),g>0&&(0,V.jsxs)(`span`,{className:`flex items-center text-tone-orange-fg`,title:`${g} uncommitted change(s)`,children:[(0,V.jsx)(_,{className:`h-3 w-3`}),g]}),!p&&(0,V.jsx)($,{workspace:e,unmerged:m})]}),l]}),y&&(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground`,title:`${y.sha.slice(0,8)} — ${y.message}`,children:[(0,V.jsx)(x,{className:`h-3 w-3 shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:y.message||y.sha.slice(0,8)}),y.at?(0,V.jsxs)(`span`,{className:`shrink-0 opacity-70`,children:[`· `,o(t,y.at)]}):null]})]})}function fe({workspace:e}){let t=i(),n=typeof e.metadata?.mergedAt==`number`?e.metadata.mergedAt:void 0,r=[{label:`created`,at:e.createdAt},{label:`ready`,at:e.readyAt},{label:`merged`,at:n},{label:`cleaned`,at:e.cleanedAt}].filter(e=>typeof e.at==`number`&&e.at>0);return(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1 font-medium text-foreground`,children:[(0,V.jsx)(h,{className:`h-3 w-3`}),`Timeline`]}),r.map((e,n)=>(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n>0&&(0,V.jsx)(`span`,{className:`opacity-40`,children:`→`}),(0,V.jsx)(`span`,{className:`text-foreground`,children:e.label}),(0,V.jsx)(`span`,{title:new Date(e.at).toLocaleString(),children:o(t,e.at)})]},e.label))]})}function pe(e){return e.startsWith(`+`)&&!e.startsWith(`+++`)?`text-tone-success-fg`:e.startsWith(`-`)&&!e.startsWith(`---`)?`text-tone-danger-fg`:e.startsWith(`@@`)?`text-tone-cyan-fg`:e.startsWith(`diff `)||e.startsWith(`index `)||e.startsWith(`+++`)||e.startsWith(`---`)?`text-muted-foreground`:``}function me({workspace:e}){let t=r(t=>t.workspaceDiff[e.id]),n=r(e=>e.fetchWorkspaceDiff),i=e.mode===`isolated`&&!!e.worktreePath;if((0,U.useEffect)(()=>{i&&t===void 0&&n(e.id)},[i,t,e.id,n]),!i)return null;if(t===void 0)return(0,V.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Loading diff…`});if(t.available===!1)return(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`Diff unavailable`,t.reason?`: ${t.reason}`:``]});if(t.missing)return(0,V.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Worktree no longer on disk`});if(t.error)return(0,V.jsxs)(`div`,{className:`text-[11px] text-tone-danger-fg`,children:[`Diff error: `,t.error]});if(!t.files.length)return(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`No committed changes against `,t.baseRef||`base`]});let a=(0,V.jsx)(D,{size:`icon-sm`,variant:`ghost`,className:`h-5 w-5`,title:`Refresh diff`,onClick:()=>void n(e.id),children:(0,V.jsx)(C,{className:`h-3 w-3`})});return(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-medium`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),(0,V.jsxs)(`span`,{children:[t.files.length,` file`,t.files.length===1?``:`s`,` vs `,t.baseRef||`base`]}),a]}),(0,V.jsx)(`ul`,{className:`space-y-0.5 text-[11px]`,children:t.files.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center gap-2 font-mono`,children:[(0,V.jsx)(`span`,{className:`truncate`,title:e.path,children:e.path}),e.binary?(0,V.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`binary`}):(0,V.jsxs)(`span`,{className:`shrink-0`,children:[(0,V.jsxs)(`span`,{className:`text-tone-success-fg`,children:[`+`,e.additions??0]}),` `,(0,V.jsxs)(`span`,{className:`text-tone-danger-fg`,children:[`−`,e.deletions??0]})]})]},e.path))}),t.patch&&(0,V.jsxs)(`pre`,{className:`max-h-80 overflow-auto rounded border border-border bg-muted/30 p-2 text-[10.5px] leading-relaxed`,children:[t.patch.split(`
|
|
2
2
|
`).map((e,t)=>(0,V.jsx)(`div`,{className:pe(e),children:e||` `},t)),t.truncated&&(0,V.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:`… patch truncated`})]})]})}function he({workspace:e}){return(0,V.jsxs)(`div`,{className:`space-y-3 border-t border-dashed border-border bg-muted/20 px-3 py-3`,children:[(0,V.jsx)(fe,{workspace:e}),(0,V.jsx)(se,{workspace:e}),(0,V.jsx)(me,{workspace:e})]})}function ge(e){let t=e.match(/\/pull\/(\d+)/);return t?`PR #${t[1]}`:`View PR`}function _e({workspace:e}){let t=e.metadata?.mergeResult,n=t?.prUrl,r=t?.error||e.metadata?.mergeError;return!n&&!r?null:(0,V.jsxs)(V.Fragment,{children:[n&&(0,V.jsxs)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,title:n,className:`inline-flex items-center gap-0.5 rounded border border-tone-violet/30 px-1.5 py-0 text-[10px] text-tone-violet-fg hover:text-tone-violet-fg`,children:[(0,V.jsx)(S,{className:`h-2.5 w-2.5`}),ge(n)]}),r&&(0,V.jsxs)(O,{variant:`outline`,className:`max-w-[16rem] border-tone-warning/30 text-tone-warning-fg text-[10px]`,title:r,children:[(0,V.jsx)(T,{className:`mr-0.5 h-2.5 w-2.5 shrink-0`}),(0,V.jsxs)(`span`,{className:`truncate`,children:[`merge: `,r]})]})]})}function ve({workspace:e}){let t=i(),[n,a]=(0,U.useState)(!1),s=r(e=>e.agentsById),c=r(t=>t.workspaceFocusId===e.id),l=r(e=>e.deliverableTasks),u=r(e=>e.openTaskDetail),d=e.ownerAgentId?s[e.ownerAgentId]:void 0,f=ae(l,e.ownerAgentId,e.branch),p=r(t=>t.workspaceGitState[e.id]),m=!!p&&p.available!==!1&&p.landed===!0,h=f!=null&&(e.status===`merged`||e.status===`landed`||e.status===`cleaned`||e.status===`abandoned`||m),g=e.stewardAgentId?s[e.stewardAgentId]:void 0,_=e.worktreePath||e.sourceCwd||e.repoRoot,v=(0,U.useRef)(null);return(0,U.useEffect)(()=>{c&&v.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[c]),(0,V.jsxs)(`div`,{ref:v,className:`border-t border-border ${c?`bg-primary/5 ring-1 ring-inset ring-primary/40`:``}`,children:[(0,V.jsxs)(`div`,{className:`grid gap-3 px-3 py-3 text-sm lg:grid-cols-[minmax(180px,1.2fr)_minmax(220px,1.5fr)_minmax(160px,1fr)_minmax(170px,auto)]`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`truncate font-medium`,title:e.branch||e.id,children:e.branch||e.id})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,V.jsx)(O,{variant:`outline`,className:`text-[10px] ${e.mode===`isolated`?`border-tone-sky/30 text-tone-sky-fg`:`border-tone-neutral/30 text-tone-neutral-fg`}`,children:e.mode}),e.requestedMode&&e.requestedMode!==e.mode&&(0,V.jsxs)(O,{variant:`outline`,className:`text-[10px]`,children:[`requested `,e.requestedMode]}),(0,V.jsx)(O,{variant:`outline`,className:`text-[10px] ${le(e.status)}`,children:z[e.status]||e.status}),e.landState&&(0,V.jsxs)(O,{variant:`outline`,className:`text-[10px] border-tone-violet/30 text-tone-violet-fg`,title:`Lifecycle state since ${e.landStateAt?o(t,e.landStateAt):`unknown`}`,children:[e.landState,e.landWaitReason?` · ${e.landWaitReason}`:``,e.landStateAt?` (${o(t,e.landStateAt)})`:``]}),(0,V.jsx)(_e,{workspace:e}),h&&f&&(0,V.jsx)(A,{id:f.id,title:f.title,status:f.status,onClick:()=>u(f)})]})]}),(0,V.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,V.jsx)(`div`,{className:`truncate font-mono text-xs`,title:_,children:ce(_)}),(0,V.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,title:e.sourceCwd,children:e.sourceCwd}),(0,V.jsx)(de,{workspace:e})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-[4.5rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-xs`,children:[typeof e.metadata.gateHost==`string`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Gate host`}),(0,V.jsx)(`span`,{className:`truncate`,title:String(e.metadata.gateOrchestratorId??``),children:e.metadata.gateHost})]}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Owner`}),(0,V.jsx)(`span`,{className:`truncate`,title:e.ownerAgentId,children:Q(d,e.ownerPolicyName||e.ownerAgentId)}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Steward`}),(0,V.jsx)(`span`,{className:`truncate`,title:e.stewardAgentId,children:Q(g,e.stewardAgentId)}),(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Updated`}),(0,V.jsx)(`span`,{children:o(t,e.updatedAt)}),e.baseRef&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`Base`}),(0,V.jsx)(`span`,{className:`truncate`,title:e.baseSha,children:e.baseRef})]})]}),(0,V.jsx)(H,{workspace:e,expanded:n,onToggleDetails:()=>a(!n)})]}),!!e.metadata.stewardCancellation&&(0,V.jsx)(oe,{cancellation:e.metadata.stewardCancellation}),n&&(0,V.jsx)(he,{workspace:e})]})}function ye(){let[e,t]=(0,U.useState)(`active`),[n,i]=(0,U.useState)(K),[a,o]=(0,U.useState)([]),c=r(e=>e.workspaces),l=r(e=>e.set),u=r(e=>e.workspaceFocusId);(0,U.useEffect)(()=>{u&&(t(`all`),i(K))},[u]),(0,U.useEffect)(()=>()=>{l({workspaceFocusId:null})},[l]),(0,U.useEffect)(()=>{let e=!1;return s(`GET`,`/projects`).then(t=>{e||o(t.projects??[])}).catch(()=>{e||o([])}),()=>{e=!0}},[]);let d=(0,U.useMemo)(()=>X(c,e,n),[c,e,n]),f=(0,U.useMemo)(()=>Y(d,ue),[d]),p=c.filter(e=>W.has(e.status)).length,m=c.filter(e=>e.mode===`isolated`).length,h=c.filter(e=>e.status===`ready`||e.status===`review_requested`||e.status===`merge_planned`||e.status===`gate_running`||e.status===`gate_failed`||e.status===`merging`).length,g=c.filter(e=>e.status===`conflict`).length,_=c.filter(e=>e.status===`merged`||e.status===`landed`||e.status===`abandoned`||e.status===`cleaned`).length,v=[{key:`active`,label:`Active`,count:c.length-_},{key:`cleaned`,label:`Done`,count:_},{key:`all`,label:`All`,count:c.length}],y=(0,U.useMemo)(()=>{let e=[{value:K,label:`All Projects`}];for(let t of a)e.push({value:t.id,label:t.title||t.slug});return e.push({value:q,label:`Unassigned`}),e},[a]);return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Workspaces`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Agent worktrees, ownership, and merge readiness.`})]}),(0,V.jsxs)(`div`,{className:`ml-auto flex flex-wrap gap-1.5`,children:[(0,V.jsxs)(O,{variant:`outline`,children:[m,` isolated`]}),(0,V.jsxs)(O,{variant:`outline`,children:[p,` live`]}),(0,V.jsxs)(O,{variant:`outline`,children:[h,` ready`]}),g>0&&(0,V.jsxs)(O,{variant:`outline`,className:`border-tone-danger/20 text-tone-danger-fg`,children:[g,` conflict`]})]})]}),(0,V.jsx)(ie,{}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex rounded-md border border-border bg-card p-1`,children:v.map(n=>(0,V.jsxs)(D,{size:`sm`,variant:e===n.key?`secondary`:`ghost`,className:`h-7 text-xs`,onClick:()=>t(n.key),children:[n.label,(0,V.jsx)(`span`,{className:`ml-1 text-muted-foreground`,children:n.count})]},n.key))}),(0,V.jsx)(`select`,{className:`h-8 min-w-[12rem] rounded-md border border-border bg-card px-2.5 text-sm text-foreground`,value:n,onChange:e=>i(e.target.value),children:y.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),f.length===0?(0,V.jsxs)(`div`,{className:`rounded-md border border-border px-3 py-12 text-center text-sm text-muted-foreground`,children:[`No `,e===`all`?``:e,` workspaces`,n===`__all__`?``:` in this project filter`]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:f.map(e=>(0,V.jsx)(Z,{group:e,renderWorkspaceRow:e=>(0,V.jsx)(ve,{workspace:e},e.id)},e.key))})]})}export{ye as WorkspacesView};
|
|
3
|
-
//# sourceMappingURL=workspaces-
|
|
3
|
+
//# sourceMappingURL=workspaces-BxeKfVuF.js.map
|
package/public/cosmos.html
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
touch-action: none;
|
|
19
19
|
}
|
|
20
20
|
</style>
|
|
21
|
-
<script type="module" crossorigin src="./assets/cosmos-
|
|
21
|
+
<script type="module" crossorigin src="./assets/cosmos-BgdsE4dG.js"></script>
|
|
22
22
|
<link rel="modulepreload" crossorigin href="./assets/legacy-storage-carry-C-tBSxRA.js">
|
|
23
|
-
<link rel="modulepreload" crossorigin href="./assets/provider-display-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="./assets/display-
|
|
23
|
+
<link rel="modulepreload" crossorigin href="./assets/provider-display-DsuWMvVL.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="./assets/display-BrKWFGJz.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="./assets/api-CIIVBtAV.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-liveness-
|
|
26
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-liveness-CaNwK0Zf.js">
|
|
27
27
|
<link rel="stylesheet" crossorigin href="./assets/cosmos-Dn8XrlnS.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
package/public/index.html
CHANGED
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
<link rel="icon" href="favicon.svg" type="image/svg+xml">
|
|
14
14
|
<link rel="manifest" href="manifest.webmanifest">
|
|
15
15
|
<link rel="apple-touch-icon" href="icons/apple-touch-icon.png">
|
|
16
|
-
<script type="module" crossorigin src="./assets/index-
|
|
16
|
+
<script type="module" crossorigin src="./assets/index-CRHep3M9.js"></script>
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-QTnfLwEv.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/legacy-storage-carry-C-tBSxRA.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="./assets/dist-DeW2Y1R5.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-DSFxiC7T.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="./assets/provider-display-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="./assets/display-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="./assets/provider-display-DsuWMvVL.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="./assets/display-BrKWFGJz.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="./assets/api-CIIVBtAV.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-liveness-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="./assets/store-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="./assets/artifacts-
|
|
24
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-liveness-CaNwK0Zf.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="./assets/store-DcClXLH0.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="./assets/artifacts-D32zyw4Y.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="./assets/tasks-BIyeAaPC.js">
|
|
28
28
|
<link rel="modulepreload" crossorigin href="./assets/host-mTgRw7xh.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="./assets/file-code-corner-CXhIR1vB.js">
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<link rel="modulepreload" crossorigin href="./assets/archive-CIuPSvmx.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-a-z-CKC2RCjD.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-HclGiUj8.js">
|
|
57
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-preview-
|
|
57
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-preview-BixaT3Xr.js">
|
|
58
58
|
<link rel="modulepreload" crossorigin href="./assets/folder-tree-BG3Y9nqH.js">
|
|
59
59
|
<link rel="modulepreload" crossorigin href="./assets/git-branch-yxhV0m8E.js">
|
|
60
60
|
<link rel="modulepreload" crossorigin href="./assets/loader-circle-BfPd4kOD.js">
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
<link rel="modulepreload" crossorigin href="./assets/copy-DFxhHRtV.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="./assets/copy-button-CjOj4HEf.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="./assets/input-CsTB6jIx.js">
|
|
70
|
-
<link rel="modulepreload" crossorigin href="./assets/code-preview-
|
|
71
|
-
<link rel="modulepreload" crossorigin href="./assets/files-
|
|
70
|
+
<link rel="modulepreload" crossorigin href="./assets/code-preview-p1NnmqK0.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="./assets/files-D6XEu8Ng.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/cpu-Dndy84IU.js">
|
|
73
73
|
<link rel="modulepreload" crossorigin href="./assets/eye-BAP6fHrX.js">
|
|
74
74
|
<link rel="modulepreload" crossorigin href="./assets/layers-DEfClY-v.js">
|
|
75
75
|
<link rel="modulepreload" crossorigin href="./assets/lock-BW8MPKw_.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="./assets/rocket-BmO1qSu-.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="./assets/terminal-Bl2u7KxT.js">
|
|
78
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-lineage-
|
|
78
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-lineage-CknAJKcb.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="./assets/package-open-ckPgcjpv.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="./assets/bell-_Yzbxxrt.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="./assets/radio-Bn0_qc0G.js">
|
|
@@ -98,29 +98,29 @@
|
|
|
98
98
|
<link rel="modulepreload" crossorigin href="./assets/sparkles-CzwR10ZU.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="./assets/bot-B0NpDNhr.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="./assets/messages-square-DVM1ZtcI.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="./assets/workflow-marker-
|
|
101
|
+
<link rel="modulepreload" crossorigin href="./assets/workflow-marker-DAZcj5qt.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="./assets/server-CZIRjFyY.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="./assets/provider-brand-icon-_67JR7Zh.js">
|
|
104
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-type-icon-
|
|
104
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-type-icon-LrUEU3lB.js">
|
|
105
105
|
<link rel="modulepreload" crossorigin href="./assets/users-C7B3u9jv.js">
|
|
106
106
|
<link rel="modulepreload" crossorigin href="./assets/wrench-C7-4CgnY.js">
|
|
107
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-name-
|
|
108
|
-
<link rel="modulepreload" crossorigin href="./assets/formatted-body-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="./assets/TraceView-
|
|
107
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-name-DKbiIhBo.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="./assets/formatted-body-CQBwc1fb.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="./assets/TraceView-Wimm0Czv.js">
|
|
110
110
|
<link rel="modulepreload" crossorigin href="./assets/boxes-Cv7Wq3h4.js">
|
|
111
111
|
<link rel="modulepreload" crossorigin href="./assets/braces-BOks9SsY.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="./assets/brain-circuit-CpQeSmp3.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="./assets/calendar-clock-CDG_KBhx.js">
|
|
114
114
|
<link rel="modulepreload" crossorigin href="./assets/calendar-QJjoZ1JU.js">
|
|
115
115
|
<link rel="modulepreload" crossorigin href="./assets/textarea-hs6Mpyfl.js">
|
|
116
|
-
<link rel="modulepreload" crossorigin href="./assets/service-access-settings-
|
|
116
|
+
<link rel="modulepreload" crossorigin href="./assets/service-access-settings-D9s_VJbd.js">
|
|
117
117
|
<link rel="modulepreload" crossorigin href="./assets/chart-column-S02ZGfTR.js">
|
|
118
118
|
<link rel="modulepreload" crossorigin href="./assets/circle-arrow-up-B432r0Kk.js">
|
|
119
119
|
<link rel="modulepreload" crossorigin href="./assets/package-plus-C1AKMjsl.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/octagon-x-B5lnUY-8.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/external-link-BRfu-fHG.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="./assets/task-chip-CYj0mpoL.js">
|
|
123
|
-
<link rel="modulepreload" crossorigin href="./assets/issue-ref-chip-
|
|
123
|
+
<link rel="modulepreload" crossorigin href="./assets/issue-ref-chip-BnSlM_95.js">
|
|
124
124
|
<link rel="modulepreload" crossorigin href="./assets/circle-x-CZ0erS7Q.js">
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/zap-DGuDTw4w.js">
|
|
126
126
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-list-W2YeUsxT.js">
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<link rel="modulepreload" crossorigin href="./assets/flame-CxBuz46L.js">
|
|
132
132
|
<link rel="modulepreload" crossorigin href="./assets/minimize-2-BkK6XoMP.js">
|
|
133
133
|
<link rel="modulepreload" crossorigin href="./assets/pin-DcsKeXxr.js">
|
|
134
|
-
<link rel="modulepreload" crossorigin href="./assets/artifact-viewer-
|
|
134
|
+
<link rel="modulepreload" crossorigin href="./assets/artifact-viewer-kf4pGuAR.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/flag-CnEG9PH-.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/folder-git-2-CJOmTT06.js">
|
|
137
137
|
<link rel="modulepreload" crossorigin href="./assets/folder-open-CBUCMSlu.js">
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/message-square-C-1G8dMM.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/paperclip-CNpKZKum.js">
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/pause-DttnHD4c.js">
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-project-badge-
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-project-badge-Diz4Sjjb.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/pencil-B1Hf2V_J.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/play-BbT8m7A0.js">
|
|
160
160
|
<link rel="modulepreload" crossorigin href="./assets/plug-zap-V0wMDJ-G.js">
|
|
@@ -162,6 +162,7 @@
|
|
|
162
162
|
<link rel="modulepreload" crossorigin href="./assets/rotate-ccw-CtD77qkX.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/rotate-cw-FPtkDewA.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/save-B_PGqSm4.js">
|
|
165
|
+
<link rel="modulepreload" crossorigin href="./assets/scroll-text-BKXS1ahr.js">
|
|
165
166
|
<link rel="modulepreload" crossorigin href="./assets/shield-CtXNUA0i.js">
|
|
166
167
|
<link rel="modulepreload" crossorigin href="./assets/smile-plus-q6EQBXHZ.js">
|
|
167
168
|
<link rel="modulepreload" crossorigin href="./assets/square-Bqly37YM.js">
|
|
@@ -171,16 +172,17 @@
|
|
|
171
172
|
<link rel="modulepreload" crossorigin href="./assets/user-plus-D9749q73.js">
|
|
172
173
|
<link rel="modulepreload" crossorigin href="./assets/volume-2-XrcRKD9Z.js">
|
|
173
174
|
<link rel="modulepreload" crossorigin href="./assets/waypoints-CIzINtLT.js">
|
|
174
|
-
<link rel="modulepreload" crossorigin href="./assets/use-selectors-
|
|
175
|
-
<link rel="modulepreload" crossorigin href="./assets/status-dot-
|
|
176
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-viewer-
|
|
177
|
-
<link rel="modulepreload" crossorigin href="./assets/log-viewer-
|
|
178
|
-
<link rel="modulepreload" crossorigin href="./assets/fleet-metrics-
|
|
179
|
-
<link rel="modulepreload" crossorigin href="./assets/busy-health-
|
|
180
|
-
<link rel="modulepreload" crossorigin href="./assets/profile-icon-
|
|
181
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
182
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
183
|
-
<link rel="
|
|
175
|
+
<link rel="modulepreload" crossorigin href="./assets/use-selectors-BZa25xEB.js">
|
|
176
|
+
<link rel="modulepreload" crossorigin href="./assets/status-dot-DYqlEUhJ.js">
|
|
177
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-viewer-BgVLHdsU.js">
|
|
178
|
+
<link rel="modulepreload" crossorigin href="./assets/log-viewer-qe7Ee47Z.js">
|
|
179
|
+
<link rel="modulepreload" crossorigin href="./assets/fleet-metrics-BiDs3MLx.js">
|
|
180
|
+
<link rel="modulepreload" crossorigin href="./assets/busy-health-N3VEh4ao.js">
|
|
181
|
+
<link rel="modulepreload" crossorigin href="./assets/profile-icon-B3rfh77F.js">
|
|
182
|
+
<link rel="modulepreload" crossorigin href="./assets/token-estimate-Co-Jdphh.js">
|
|
183
|
+
<link rel="modulepreload" crossorigin href="./assets/versioned-prompt-editor-BmED5DnJ.js">
|
|
184
|
+
<link rel="modulepreload" crossorigin href="./assets/host-providers-dialog-DKaW31dN.js">
|
|
185
|
+
<link rel="stylesheet" crossorigin href="./assets/index-MYAIwYTX.css">
|
|
184
186
|
</head>
|
|
185
187
|
<body class="bg-background text-foreground antialiased">
|
|
186
188
|
<div id="root"></div>
|
|
@@ -260,6 +260,9 @@ function classifyGateRun(command, commands = {}) {
|
|
|
260
260
|
return null;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
// sdk/src/types/host.ts
|
|
264
|
+
var HOST_GATE_KINDS = ["land", "iterate", "validation"];
|
|
265
|
+
|
|
263
266
|
// sdk/src/land-gates.ts
|
|
264
267
|
import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve3 } from "path";
|
|
265
268
|
|
|
@@ -420,7 +423,34 @@ function cleanLandGatesConfigFull(value, worktreePath) {
|
|
|
420
423
|
const requirements = cleanLandGateRequirements(value);
|
|
421
424
|
const cd = value.cd === true;
|
|
422
425
|
const scope = cleanLandGateScope(value);
|
|
423
|
-
|
|
426
|
+
const resources = cleanGateResources(value);
|
|
427
|
+
return { gates, ...resources ? { resources } : {}, ...deliveryPolicy, ...iterate ? { iterate } : {}, ...cd ? { cd } : {}, ...placement ? { placement } : {}, ...requirements ? { requirements } : {}, ...scope };
|
|
428
|
+
}
|
|
429
|
+
function cleanGateResources(value) {
|
|
430
|
+
if (!isRecord(value))
|
|
431
|
+
throw new ValidationError("land-gates config must be an object");
|
|
432
|
+
if (value.resources === undefined)
|
|
433
|
+
return;
|
|
434
|
+
if (!isRecord(value.resources))
|
|
435
|
+
throw new ValidationError("resources must be an object");
|
|
436
|
+
const resources = {};
|
|
437
|
+
for (const [kind, request] of Object.entries(value.resources)) {
|
|
438
|
+
if (!HOST_GATE_KINDS.includes(kind))
|
|
439
|
+
throw new ValidationError(`resources: unknown gate kind '${kind}'; use land, iterate or validation`);
|
|
440
|
+
if (!isRecord(request))
|
|
441
|
+
throw new ValidationError(`resources.${kind} must be an object`);
|
|
442
|
+
const parsed = {};
|
|
443
|
+
for (const [key, n] of Object.entries(request)) {
|
|
444
|
+
if (key !== "cpus" && key !== "memoryBytes")
|
|
445
|
+
throw new ValidationError(`resources.${kind}: unknown field '${key}'`);
|
|
446
|
+
if (typeof n !== "number" || !Number.isFinite(n) || n <= 0 || key === "memoryBytes" && !Number.isSafeInteger(n)) {
|
|
447
|
+
throw new ValidationError(`resources.${kind}.${key} must be a positive ${key === "memoryBytes" ? "safe integer" : "finite number"}`);
|
|
448
|
+
}
|
|
449
|
+
parsed[key] = n;
|
|
450
|
+
}
|
|
451
|
+
resources[kind] = parsed;
|
|
452
|
+
}
|
|
453
|
+
return resources;
|
|
424
454
|
}
|
|
425
455
|
function cleanDeliveryGatePolicy(value) {
|
|
426
456
|
if (!isRecord(value))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { relayEnv, writeChildEnv } from "@humwick/sdk/env";
|
|
2
|
-
import {
|
|
2
|
+
import { type SpawnProvider } from "@humwick/sdk";
|
|
3
3
|
import { tmuxCommand, tmuxHasSession } from "@humwick/sdk/tmux-utils";
|
|
4
4
|
import type { ManagedProcess, RunnerSpawnConfig } from "../adapter";
|
|
5
5
|
import { effortSwitchEnabledFromEnv } from "../config";
|
|
@@ -24,9 +24,7 @@ export function claudeEffortLaunch(effort: string | undefined, inheritedEnv: Rec
|
|
|
24
24
|
|
|
25
25
|
/** Persistent transports can switch effort. Host-base `/effort` would save into the human's own settings. */
|
|
26
26
|
export function claudeEffortSwitchMeta(provider: SpawnProvider, config: RunnerSpawnConfig, oneShot: boolean): { effortSwitch?: true } {
|
|
27
|
-
|
|
28
|
-
const model = catalog && findProviderCatalogModel(catalog, config.model ?? catalog.defaultModel);
|
|
29
|
-
return effortSwitchEnabledFromEnv() && !oneShot && providerHomePathFor(provider, config) && model?.efforts.length ? { effortSwitch: true } : {};
|
|
27
|
+
return effortSwitchEnabledFromEnv() && !oneShot && providerHomePathFor(provider, config) && (config.modelRecord?.efforts?.length || config.effort) ? { effortSwitch: true } : {};
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
interface ClaudeEffortOutcome { applied?: string; message: string }
|
|
@@ -10,6 +10,7 @@ import { hostProviderDefaultArgs } from "../host-asset-plan";
|
|
|
10
10
|
import { bundledSkillConfigArgs } from "../launch-assembly";
|
|
11
11
|
import { codexRetiredMcpConfigArgs } from "./codex-effective-config";
|
|
12
12
|
import { codexWebToolsConfigArgs } from "../web-tools";
|
|
13
|
+
import type { ResolvedModelRecord } from "@humwick/sdk/provider-catalog";
|
|
13
14
|
import { tomlString } from "../relay-mcp";
|
|
14
15
|
|
|
15
16
|
export const DEFAULT_CODEX_TOOL_OUTPUT_TOKEN_LIMIT = 12_000;
|
|
@@ -31,14 +32,12 @@ export const DEFAULT_CODEX_TOOL_OUTPUT_TOKEN_LIMIT = 12_000;
|
|
|
31
32
|
// advertise longer polls to the model (#2776): agents are steered to end the turn and take the wake.
|
|
32
33
|
const CODEX_BACKGROUND_TERMINAL_MAX_TIMEOUT_MS = 900000;
|
|
33
34
|
|
|
34
|
-
export function codexModelConfigArgs(model?: string, effort?: string): string[] {
|
|
35
|
+
export function codexModelConfigArgs(model?: string, effort?: string, record?: ResolvedModelRecord): string[] {
|
|
35
36
|
const args: string[] = [];
|
|
36
37
|
if (model) args.push("-c", `model=${tomlString(model)}`);
|
|
37
38
|
if (effort) args.push("-c", `model_reasoning_effort=${tomlString(effort)}`);
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
args.push("-c", "model_context_window=1000000", "-c", "model_auto_compact_token_limit=272000");
|
|
41
|
-
}
|
|
39
|
+
if (record?.contextWindowTokens) args.push("-c", `model_context_window=${record.contextWindowTokens}`);
|
|
40
|
+
if (record?.contextWindowTokens && record.contextThreshold) args.push("-c", `model_auto_compact_token_limit=${Math.floor(record.contextWindowTokens * record.contextThreshold.selfCompactUtilization)}`);
|
|
42
41
|
return args;
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -688,7 +688,7 @@ export class CodexAdapter implements ProviderAdapter {
|
|
|
688
688
|
? [
|
|
689
689
|
"app-server",
|
|
690
690
|
...codexAppServerConfigArgs(defaultArgs, config.providerArgs),
|
|
691
|
-
...codexModelConfigArgs(config.model, config.effort),
|
|
691
|
+
...codexModelConfigArgs(config.model, config.effort, config.modelRecord),
|
|
692
692
|
...codexApprovalConfigArgs(config.approvalMode),
|
|
693
693
|
...codexToolOutputTokenLimitConfigArgs(config), ...codexHarnessConfigArgs(config), ...codexWebToolsConfigArgs(config),
|
|
694
694
|
...assembled.args,
|
|
@@ -35,14 +35,6 @@ export function openCodeBackendApiKeyEnvVar(backendID: string): string | undefin
|
|
|
35
35
|
return OPENCODE_STATIC_BACKENDS[backendID]?.envVar;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/** Catalog alias → provider model (older runner protocols carry the alias without a record). */
|
|
39
|
-
function openCodeAliasResolved(model: string | undefined, manifest: ProviderManifest, provider: string): string {
|
|
40
|
-
const alias = model?.trim() || manifest.catalog.defaultModel;
|
|
41
|
-
const raw = manifest.catalog.models.find((entry) => entry.alias === alias)?.providerModel || alias;
|
|
42
|
-
if (!raw) throw new Error(`OpenCode provider ${provider} has no default model.`);
|
|
43
|
-
return raw;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
38
|
/**
|
|
47
39
|
* #2659 — the launch model: THE one normalization of a spawn's model through the shared seam
|
|
48
40
|
* (`resolveOpenCodeModelId`). A server-threaded record's qualified name wins over the alias.
|
|
@@ -51,8 +43,9 @@ function openCodeAliasResolved(model: string | undefined, manifest: ProviderMani
|
|
|
51
43
|
* default-backend model id.
|
|
52
44
|
*/
|
|
53
45
|
export function openCodeLaunchModel(model: string | undefined, provider = "opencode", record?: ResolvedModelRecord, registry?: OpenCodeModelRegistry): OpenCodeModelId {
|
|
54
|
-
const {
|
|
55
|
-
const input = record?.qualifiedModel ||
|
|
46
|
+
const { backend } = openCodeBackend(provider);
|
|
47
|
+
const input = record?.qualifiedModel || model?.trim();
|
|
48
|
+
if (!input) throw new Error(`OpenCode provider ${provider} requires a hub-resolved model.`);
|
|
56
49
|
return resolveOpenCodeModelId(input, backend.opencodeProviderID, registry);
|
|
57
50
|
}
|
|
58
51
|
|
|
@@ -111,18 +104,10 @@ export function openCodeCustomBackendIDs(): string[] {
|
|
|
111
104
|
return getAllManifests().flatMap((entry) => entry.opencode && OPENCODE_STATIC_BACKENDS[entry.opencode.opencodeProviderID]?.custom ? [entry.opencode.opencodeProviderID] : []);
|
|
112
105
|
}
|
|
113
106
|
|
|
114
|
-
/**
|
|
115
|
-
export function openCodeContextWindowTokens(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (typeof record?.contextWindowTokens === "number" && Number.isFinite(record.contextWindowTokens) && record.contextWindowTokens > 0) {
|
|
119
|
-
openCodeBackend(provider); // keep the unknown-provider hard error on the record path too.
|
|
120
|
-
return record.contextWindowTokens;
|
|
121
|
-
}
|
|
122
|
-
const { manifest } = openCodeBackend(provider);
|
|
123
|
-
const { modelID } = openCodeLaunchModel(model, provider);
|
|
124
|
-
const value = manifest.catalog.models.find((entry) => entry.alias === modelID || entry.providerModel === modelID)?.limits?.contextWindowTokens?.value;
|
|
125
|
-
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
107
|
+
/** Context limits come from the hub-resolved launch record. */
|
|
108
|
+
export function openCodeContextWindowTokens(_model: string | undefined, provider = "opencode", record?: ResolvedModelRecord): number | undefined {
|
|
109
|
+
openCodeBackend(provider);
|
|
110
|
+
return record?.contextWindowTokens;
|
|
126
111
|
}
|
|
127
112
|
|
|
128
113
|
/**
|
|
@@ -1505,7 +1505,7 @@ export class OpenCodeAdapter implements ProviderAdapter {
|
|
|
1505
1505
|
const tokens = countTokens(info?.tokens);
|
|
1506
1506
|
const sessionUnattributable = Boolean(activeSessionId && sessionID !== activeSessionId);
|
|
1507
1507
|
if (process && role === "assistant" && tokens !== undefined && !sessionUnattributable) {
|
|
1508
|
-
const model = stringValue(process.meta?.model)
|
|
1508
|
+
const model = stringValue(process.meta?.model);
|
|
1509
1509
|
this.reportContextUsage(process, model, tokens);
|
|
1510
1510
|
}
|
|
1511
1511
|
// #2484 — same door, reused for the spine report: model/createdAt prefer the message's
|
|
@@ -1516,7 +1516,7 @@ export class OpenCodeAdapter implements ProviderAdapter {
|
|
|
1516
1516
|
scheduleOpenCodeTokenUsage(this.tokenUsagePoster, {
|
|
1517
1517
|
provider: this.provider,
|
|
1518
1518
|
sessionId: activeSessionId ?? sessionID,
|
|
1519
|
-
model: openCodeMessageModel(info) ?? stringValue(process.meta?.model)
|
|
1519
|
+
model: openCodeMessageModel(info) ?? stringValue(process.meta?.model),
|
|
1520
1520
|
messageId: id,
|
|
1521
1521
|
tokens: info?.tokens,
|
|
1522
1522
|
createdAt: openCodeMessageObservedAt(info),
|
|
@@ -1832,8 +1832,8 @@ export class OpenCodeAdapter implements ProviderAdapter {
|
|
|
1832
1832
|
for (const relayContextInput = prepareOpenCodeRelayContext(process, text);;) {
|
|
1833
1833
|
const client = process.meta?.client as OpenCodeClient | undefined;
|
|
1834
1834
|
const sessionId = stringValue(process.meta?.sessionId);
|
|
1835
|
-
const model = stringValue(process.meta?.model)
|
|
1836
|
-
if (!client || !sessionId) throw new Error("OpenCode session is not ready");
|
|
1835
|
+
const model = stringValue(process.meta?.model);
|
|
1836
|
+
if (!client || !sessionId || !model) throw new Error("OpenCode session is not ready with a hub-resolved model");
|
|
1837
1837
|
// #2397 round 5 review (LOW-2) — raised only once we're actually about to run an attempt
|
|
1838
1838
|
// (past the guard above), so a "session not ready" throw never emits a close for a turn
|
|
1839
1839
|
// that never started (never emitted its own busy edge below).
|