@humwick/server 0.130.2 → 0.130.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/prompts/manifest.json +1 -0
- package/bundled/prompts/task.hydration.md +1 -1
- package/bundled/roles/builder.md +1 -1
- package/docs/guides/sub-coordinators.md +12 -5
- package/docs/guides/tools-coordination.md +1 -0
- package/docs/guides/workflows.md +16 -0
- package/docs/openapi.json +175 -4
- package/package.json +8 -7
- package/public/assets/{MessageBubble-BWLqMGKG.js → MessageBubble-BOkmEvgZ.js} +2 -2
- package/public/assets/{PlanGraphPanel-3TlIQpjk.js → PlanGraphPanel-BkaDJp0r.js} +2 -2
- package/public/assets/{TraceView-Wimm0Czv.js → TraceView-B99Uu2yT.js} +2 -2
- package/public/assets/{VaultDecisionCard-Bau_vNax.js → VaultDecisionCard-DUIfTTFF.js} +2 -2
- package/public/assets/{activity-CrSurn-r.js → activity-ZIX0N1El.js} +2 -2
- package/public/assets/{agent-lineage-CknAJKcb.js → agent-lineage-kq9TPYFw.js} +2 -2
- package/public/assets/agent-liveness-DSQY1Aa_.js +2 -0
- package/public/assets/{agent-name-DKbiIhBo.js → agent-name-C_7F4DFR.js} +2 -2
- package/public/assets/{agent-profiles-DwF6EQ4R.js → agent-profiles-BNOcrGcY.js} +2 -2
- package/public/assets/{agent-project-badge-Diz4Sjjb.js → agent-project-badge-B6yAh70a.js} +2 -2
- package/public/assets/{agent-tools-CRhpRQza.js → agent-tools-CcrhmOzF.js} +2 -2
- package/public/assets/{agent-type-icon-LrUEU3lB.js → agent-type-icon-CXSLrKiq.js} +2 -2
- package/public/assets/{agents-B-v66C-4.js → agents-DIZG97_X.js} +2 -2
- package/public/assets/{analytics-BqCb-LKi.js → analytics-rasmoPjR.js} +2 -2
- package/public/assets/{artifact-viewer-kf4pGuAR.js → artifact-viewer-tBpTrEPb.js} +2 -2
- package/public/assets/{artifacts-DJevXcvg.js → artifacts-BNkrynP1.js} +2 -2
- package/public/assets/{artifacts-D32zyw4Y.js → artifacts-Bjq-ZyBA.js} +2 -2
- package/public/assets/{automation-BpRajx_5.js → automation-Cx422L3L.js} +2 -2
- package/public/assets/{backlog-D_UjTdzX.js → backlog-RuFQ8PUu.js} +2 -2
- package/public/assets/{busy-health-N3VEh4ao.js → busy-health-BvNQ9g5x.js} +2 -2
- package/public/assets/{channels-9jopungq.js → channels-DNbKAS0I.js} +2 -2
- package/public/assets/{chat-CSXrTB3C.js → chat-Bp3Fx73h.js} +3 -3
- package/public/assets/{code-preview-p1NnmqK0.js → code-preview-KIRZA6cz.js} +2 -2
- package/public/assets/{connectors-CZdqlDNL.js → connectors-k7vO4vvc.js} +2 -2
- package/public/assets/{cosmos-BgdsE4dG.js → cosmos-BuVoq1aw.js} +2 -2
- package/public/assets/{crate-agent-30aXTKva.js → crate-agent-irqlt4NH.js} +2 -2
- package/public/assets/{dependency-graph-B_jvw2GE.js → dependency-graph-D_rurNBz.js} +2 -2
- package/public/assets/{deploys-DoN6bAb5.js → deploys-yzZqIpxE.js} +2 -2
- package/public/assets/{display-BrKWFGJz.js → display-BemJG1f_.js} +2 -2
- package/public/assets/{files-D6XEu8Ng.js → files-DXWcrxOz.js} +2 -2
- package/public/assets/{fleet-C7jQWbw2.js → fleet-TEuOCZXE.js} +2 -2
- package/public/assets/{fleet-metrics-BiDs3MLx.js → fleet-metrics-BGoDAFI-.js} +2 -2
- package/public/assets/{formatted-body-impl-DyG0WsQS.js → formatted-body-impl-BB9eq9nN.js} +2 -2
- package/public/assets/{formatted-body-CQBwc1fb.js → formatted-body-qy2nTD_1.js} +3 -3
- package/public/assets/{host-providers-dialog-DKaW31dN.js → host-providers-dialog-BGPHxuwT.js} +2 -2
- package/public/assets/{index-CRHep3M9.js → index-BC5XZc0z.js} +5 -5
- package/public/assets/{index-MYAIwYTX.css → index-D8Rp9pz2.css} +1 -1
- package/public/assets/{insights-CzrtkpOE.js → insights-C-KQG0h-.js} +2 -2
- package/public/assets/{integrations-aVsUmigt.js → integrations-ClPRPyKU.js} +2 -2
- package/public/assets/{issue-ref-chip-BnSlM_95.js → issue-ref-chip-DbH8J9Ak.js} +2 -2
- package/public/assets/{log-viewer-qe7Ee47Z.js → log-viewer-PH4zVn24.js} +2 -2
- package/public/assets/{maintenance-NfjqFZAk.js → maintenance-5lV43uTL.js} +2 -2
- package/public/assets/{managed-agents-BiH0HgaE.js → managed-agents-BdgU35aX.js} +2 -2
- package/public/assets/{markdown-preview-BixaT3Xr.js → markdown-preview-DNT4OUwQ.js} +3 -3
- package/public/assets/{markdown-preview-impl-DNGlWIS3.js → markdown-preview-impl-CnCcPy0A.js} +2 -2
- package/public/assets/{memory-DNsCl6UX.js → memory--GgWH1gH.js} +2 -2
- package/public/assets/{messages-DopU1L1X.js → messages-CzFl_97O.js} +2 -2
- package/public/assets/{orchestrators-Cq7ckLQT.js → orchestrators-CVvJVkzv.js} +2 -2
- package/public/assets/overview-DsrZvE86.js +2 -0
- package/public/assets/{pairs-DE_m6rrE.js → pairs-D2d0d2py.js} +2 -2
- package/public/assets/{profile-icon-B3rfh77F.js → profile-icon-_SMuSbYF.js} +2 -2
- package/public/assets/{project-profile-instructions-DQWZE0kA.js → project-profile-instructions-Apn15y43.js} +2 -2
- package/public/assets/{projects-Br2Bd2h1.js → projects-D3B6kto5.js} +2 -2
- package/public/assets/{prompt-settings-BKvFsvGD.js → prompt-settings-DnPB6Ez6.js} +2 -2
- package/public/assets/provider-display-bWwiuedV.js +2 -0
- package/public/assets/{registry-Cw38_6gW.js → registry-D790cIhN.js} +2 -2
- package/public/assets/run-card-BCro-Odj.js +2 -0
- package/public/assets/{secrets-DxI-vzSq.js → secrets-CVXvfvbU.js} +2 -2
- package/public/assets/{service-access-settings-D9s_VJbd.js → service-access-settings-D3Xxqb9w.js} +2 -2
- package/public/assets/{settings-CKZTVGIx.js → settings-CoUC7Jci.js} +2 -2
- package/public/assets/shipping-D_Lp9n_J.js +2 -0
- package/public/assets/{stats-DyUBKyWI.js → stats-CXiNjB9S.js} +2 -2
- package/public/assets/{status-dot-DYqlEUhJ.js → status-dot-C703YIy1.js} +2 -2
- package/public/assets/store-BgDALGIX.js +9 -0
- package/public/assets/{tasks-Bh7Chr4-.js → tasks-DO0WpJCx.js} +2 -2
- package/public/assets/{teams-bowI7qVY.js → teams-FGkdi_tL.js} +2 -2
- package/public/assets/{terminal-viewer-BgVLHdsU.js → terminal-viewer-Dh8dSC7e.js} +3 -3
- package/public/assets/{terminal-viewer-impl-Dz22UPy6.js → terminal-viewer-impl-B5Zriip3.js} +2 -2
- package/public/assets/{use-agent-terminal-DSQQ-iY7.js → use-agent-terminal-CRUVDvLC.js} +2 -2
- package/public/assets/{use-decisions-samMQhQf.js → use-decisions-CoaqRh4l.js} +2 -2
- package/public/assets/{use-project-list-59LheVP7.js → use-project-list-X-BgT53X.js} +2 -2
- package/public/assets/{use-selectors-BZa25xEB.js → use-selectors-0X_UZkk-.js} +2 -2
- package/public/assets/{user-avatar-DHxlvUvV.js → user-avatar-CkLhVBGu.js} +2 -2
- package/public/assets/{versioned-prompt-editor-BmED5DnJ.js → versioned-prompt-editor-BkTi7eim.js} +2 -2
- package/public/assets/{work-queue-CSvpuNLz.js → work-queue-DDOLEyKo.js} +2 -2
- package/public/assets/{workflow-marker-DAZcj5qt.js → workflow-marker-CzOsB8BM.js} +2 -2
- package/public/assets/{workflows-DdmxRSyg.js → workflows-DJilvmRM.js} +2 -2
- package/public/assets/{workspaces-BxeKfVuF.js → workspaces-CHcfbLR3.js} +2 -2
- package/public/cosmos.html +4 -4
- package/public/index.html +29 -29
- package/runner/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/runner/src/adapters/claude-api.ts +1 -1
- package/runner/src/adapters/claude-headless.ts +1 -1
- package/runner/src/adapters/claude-launch-exit.ts +26 -0
- package/runner/src/adapters/claude-session-probe.ts +1 -1
- package/runner/src/adapters/claude-tmux.ts +38 -10
- package/runner/src/adapters/claude.ts +28 -75
- package/runner/src/adapters/provider-quota-harvest.ts +20 -71
- package/runner/src/agent-runner/lifecycle-milestones.ts +2 -2
- package/runner/src/agent-runner/liveness-exchange.ts +104 -0
- package/runner/src/claude-system-prompt.ts +49 -0
- package/runner/src/launch-assembly.ts +14 -10
- package/runner/src/profile-home.ts +1 -1
- package/runner/src/project-instructions.ts +2 -2
- package/runner/src/provider-command.ts +18 -0
- package/runner/src/provider-setup.ts +3 -2
- package/runner/src/runner-core.ts +14 -15
- package/runner/src/runner-helpers.ts +0 -8
- package/runner/src/session-scratch.ts +6 -2
- package/runner/test-support/provisioning-context.ts +4 -2
- package/runner/test-support/runner-harness.ts +2 -1
- package/scripts/steward-policy-cleanup.ts +2 -2
- package/src/agent-authz.ts +2 -2
- package/src/agent-drive-arbiter.ts +3 -8
- package/src/agent-exit-cleanup-async.ts +2 -2
- package/src/agent-exit-cleanup.ts +23 -19
- package/src/agent-lifecycle-events.ts +112 -85
- package/src/agent-ref.ts +3 -2
- package/src/agent-status-events.ts +43 -14
- package/src/auth/login-link.ts +35 -0
- package/src/auth/password.ts +4 -3
- package/src/auth/session-refresh.ts +1 -1
- package/src/auth/session.test-fixture.ts +2 -2
- package/src/auth/session.ts +7 -7
- package/src/automations/crud.ts +8 -81
- package/src/automations/dispatch.ts +33 -58
- package/src/automations/index.ts +1 -1
- package/src/automations/persistence.ts +65 -0
- package/src/automations/precheck.ts +18 -16
- package/src/automations/read-async.ts +11 -0
- package/src/automations/reconcile.ts +30 -39
- package/src/automations/storage.ts +33 -10
- package/src/automations/write-async.ts +33 -0
- package/src/branch-land-notice.ts +3 -3
- package/src/branch-landed.ts +25 -23
- package/src/bus.ts +21 -19
- package/src/cd-deploy-notify.ts +2 -2
- package/src/ci/notifications.ts +4 -4
- package/src/ci/root-missing.ts +3 -3
- package/src/ci/transition-notify.ts +5 -5
- package/src/claude-app/oauth-http.ts +3 -3
- package/src/cli/index.ts +7 -1
- package/src/cli/init.ts +53 -0
- package/src/cli/orchestrator.ts +1 -7
- package/src/cli/setup.ts +6 -4
- package/src/cli/workflow.ts +12 -3
- package/src/commands-db.ts +4 -4
- package/src/commands-write.ts +8 -0
- package/src/compaction-watch.ts +10 -8
- package/src/config-store-write.ts +2 -2
- package/src/config.ts +4 -11
- package/src/connectors.ts +10 -8
- package/src/context-advisory.ts +22 -21
- package/src/db/agent-action-write.ts +36 -0
- package/src/db/agent-control-async.ts +9 -0
- package/src/db/agent-control-write.ts +49 -0
- package/src/db/agent-effort-observe.ts +22 -0
- package/src/db/agent-meta.ts +14 -3
- package/src/db/agents-async.ts +8 -5
- package/src/db/agents.ts +15 -12
- package/src/db/auth-identities.ts +2 -2
- package/src/db/automation-read-ops.ts +11 -0
- package/src/db/automation-write-ops.ts +46 -0
- package/src/db/blackboard.ts +2 -2
- package/src/db/browser-session-write.ts +32 -0
- package/src/db/bus-outbox-write-ops.ts +3 -1
- package/src/db/checkout-refresh-schema.ts +47 -0
- package/src/db/checkout-refresh.ts +5 -5
- package/src/db/command-agent-profile-backfill.ts +39 -0
- package/src/db/command-agent-profiles.ts +5 -1
- package/src/db/command-retention.ts +126 -0
- package/src/db/commands-planner-stats.test-fixture.ts +8 -0
- package/src/db/commands-read-ops.ts +16 -0
- package/src/db/connection.ts +1 -182
- package/src/db/context-carry-write.ts +74 -0
- package/src/db/continuations.ts +4 -4
- package/src/db/db-error-registry.ts +12 -0
- package/src/db/gateway.ts +26 -133
- package/src/db/history-retention-ops.ts +13 -0
- package/src/db/inbox-async.ts +2 -2
- package/src/db/inbox-read-ops.ts +1 -1
- package/src/db/inbox.ts +9 -3
- package/src/db/issue-associations.ts +2 -2
- package/src/db/issue-refs-async.ts +4 -1
- package/src/db/issue-refs-read-ops.ts +6 -0
- package/src/db/issue-refs.ts +8 -8
- package/src/db/kernel-event-log-schema.ts +2 -0
- package/src/db/land-boundaries.ts +51 -5
- package/src/db/land-gate-attestations.ts +2 -2
- package/src/db/landing-receipts.ts +2 -2
- package/src/db/lifecycle-context-write.ts +5 -0
- package/src/db/lifecycle-tail-async.ts +76 -0
- package/src/db/lifecycle-tail-write-ops.ts +62 -0
- package/src/db/lifecycle-write-window.ts +2 -1
- package/src/db/lineage-pair-dedupe-sql.ts +3 -3
- package/src/db/main-connection-mode.ts +11 -0
- package/src/db/main-connection-writes.ts +20 -2
- package/src/db/maintenance-job-runs-async.ts +2 -2
- package/src/db/maintenance-job-write-ops.ts +1 -1
- package/src/db/maintenance-pauses.ts +2 -2
- package/src/db/message-send.ts +4 -0
- package/src/db/messages.ts +31 -25
- package/src/db/migrations.ts +18 -1
- package/src/db/notification-write-ops.ts +19 -0
- package/src/db/operator-answer-write.ts +19 -0
- package/src/db/orchestrators.ts +10 -4
- package/src/db/pairs-async.ts +22 -1
- package/src/db/pairs-write-ops.ts +8 -3
- package/src/db/pairs.ts +41 -48
- package/src/db/plan-dispatch-schema.ts +5 -1
- package/src/db/plan-ready-notices.ts +43 -0
- package/src/db/plan-tools-include-migration.ts +36 -0
- package/src/db/plans-write-ops.ts +2 -0
- package/src/db/presence-buffer.ts +5 -0
- package/src/db/presence-loop.ts +18 -23
- package/src/db/presence-write.ts +0 -6
- package/src/db/project-entries-async.ts +14 -0
- package/src/db/project-entries-read-ops.ts +5 -1
- package/src/db/project-entries-write-ops.ts +8 -0
- package/src/db/project-entries.ts +15 -12
- package/src/db/project-journal.ts +2 -2
- package/src/db/project-trust-approvals.ts +2 -2
- package/src/db/prompt-templates.ts +4 -4
- package/src/db/read-op-marshaling-fixtures.ts +18 -0
- package/src/db/read-ops.ts +4 -0
- package/src/db/retention.ts +13 -2
- package/src/db/review-publish-write.ts +8 -0
- package/src/db/runtime-admin-async.ts +19 -0
- package/src/db/runtime-admin-write-ops.ts +36 -0
- package/src/db/runtime-tail-async.ts +288 -0
- package/src/db/runtime-tail-write-ops.ts +97 -0
- package/src/db/schema.ts +4 -1
- package/src/db/spawn-budget.ts +5 -0
- package/src/db/spawn-delegation.ts +3 -12
- package/src/db/sql-audit-indexes.ts +3 -0
- package/src/db/stats-async.ts +5 -3
- package/src/db/task-entity.ts +5 -4
- package/src/db/team-claim-policy.ts +60 -0
- package/src/db/teams-async.ts +4 -0
- package/src/db/teams-write-ops.ts +4 -0
- package/src/db/terminal-events.ts +15 -0
- package/src/db/timer-cutover-bodies.ts +292 -0
- package/src/db/timer-cutover-core.ts +37 -278
- package/src/db/timer-cutover-state.ts +40 -0
- package/src/db/timer-cutover-write-ops.ts +1 -40
- package/src/db/token-db-write-ops.ts +2 -0
- package/src/db/token-standing-async.ts +12 -0
- package/src/db/token-standing.ts +6 -9
- package/src/db/token-usage-retention.ts +33 -0
- package/src/db/token-usage-write-ops.ts +1 -1
- package/src/db/token-usage.ts +4 -1
- package/src/db/user-invites-async.ts +13 -0
- package/src/db/user-invites.ts +3 -3
- package/src/db/users.ts +14 -6
- package/src/db/workflow-execution.ts +3 -3
- package/src/db/workspaces.ts +8 -5
- package/src/db/write-ops.ts +31 -12
- package/src/db/writer-fault-seam.ts +2 -9
- package/src/db/writer-fault-test-ops.ts +18 -0
- package/src/db/writer-gateway.ts +42 -46
- package/src/dev.ts +12 -16
- package/src/event-loop-lag.ts +4 -2
- package/src/event-loop-yield.ts +2 -2
- package/src/events.ts +10 -8
- package/src/host-provider-store.ts +5 -4
- package/src/hub-metrics-report.ts +5 -1
- package/src/hub-metrics.ts +38 -18
- package/src/init.ts +299 -0
- package/src/injection-sweep-pacing.ts +6 -8
- package/src/invite-link.ts +16 -9
- package/src/land-gate-notifications.ts +11 -10
- package/src/land-gate-queue-progress.ts +3 -3
- package/src/land-settle-dispatch.ts +52 -92
- package/src/lifecycle-context-pressure.ts +11 -10
- package/src/lifecycle-manager.ts +104 -98
- package/src/maintenance/breaker.ts +18 -16
- package/src/maintenance/checkout-refresh.ts +18 -1
- package/src/maintenance/critical-job-watchdog.ts +3 -3
- package/src/maintenance/events.ts +3 -3
- package/src/maintenance/history-retention-job.ts +30 -0
- package/src/maintenance/jobs.ts +29 -67
- package/src/maintenance/long-running-work.ts +3 -1
- package/src/maintenance/offline-agent-prune-job.ts +28 -0
- package/src/maintenance/orphaned-sessions.ts +5 -4
- package/src/maintenance/pauses.ts +4 -10
- package/src/maintenance/plan-ready-notice-job.ts +71 -0
- package/src/maintenance/scheduler.ts +18 -13
- package/src/maintenance/stalled-delivery-pager.ts +4 -4
- package/src/maintenance/teams.ts +19 -30
- package/src/maintenance/workspaces.ts +17 -27
- package/src/managed-policy-escalation.ts +7 -7
- package/src/managed-policy.ts +3 -3
- package/src/managed-provider-gate.ts +5 -4
- package/src/managed-spawn-reservation.ts +5 -4
- package/src/mcp/index.ts +8 -8
- package/src/mcp/output-descriptions.ts +1 -1
- package/src/mcp/presentation.ts +2 -1
- package/src/mcp/runtime-output.ts +6 -1
- package/src/mcp/self-care-visibility.ts +2 -2
- package/src/mcp/spawn-targets-matrix.ts +10 -1
- package/src/mcp/tool-groups.ts +3 -2
- package/src/mcp/tool-roles.ts +81 -0
- package/src/mcp/tools-workspace.ts +1 -1
- package/src/mcp-blackboard-tools.ts +6 -5
- package/src/mcp-decision-tools.ts +7 -7
- package/src/mcp-egress-tools.ts +10 -9
- package/src/mcp-issue-activity-tools.ts +2 -2
- package/src/mcp-issue-association-tools.ts +4 -4
- package/src/mcp-issue-ref-tools.ts +3 -3
- package/src/mcp-merge-tools.ts +5 -5
- package/src/mcp-notification-subscription-tools.ts +14 -15
- package/src/mcp-output-levels.test-fixture.ts +1 -1
- package/src/mcp-profile-trust-tools.ts +1 -1
- package/src/mcp-project-journal-tools.ts +4 -12
- package/src/mcp-project-tools.ts +17 -18
- package/src/mcp-routing-policy-tools.ts +3 -2
- package/src/mcp-team-tools.ts +6 -6
- package/src/mcp-workflow-tools.ts +5 -3
- package/src/memory-area-injection.ts +13 -12
- package/src/memory-boundary-capture.ts +6 -6
- package/src/memory-injection.ts +45 -43
- package/src/merge-pause-maintenance.ts +5 -4
- package/src/notification-router.ts +44 -17
- package/src/notify.ts +5 -5
- package/src/observed-reset-refresh.ts +4 -4
- package/src/operator-alarm.ts +2 -5
- package/src/project-ingest.ts +6 -6
- package/src/project-instructions.ts +8 -1
- package/src/project-trust.ts +12 -11
- package/src/prompt-resolver.ts +3 -3
- package/src/provider-quota-async.ts +5 -7
- package/src/provider-timeline-event.ts +4 -7
- package/src/quota-band-delivery.ts +2 -2
- package/src/recipe-runner.ts +4 -3
- package/src/retention-config-store.ts +4 -3
- package/src/reviewer-pipeline.ts +11 -10
- package/src/routes/_route.ts +4 -4
- package/src/routes/_shared.ts +13 -12
- package/src/routes/agent-effort.ts +5 -5
- package/src/routes/agent-heartbeat-quota.ts +23 -0
- package/src/routes/agent-keep.ts +1 -1
- package/src/routes/agent-reporting.ts +1 -1
- package/src/routes/agent-self-effort.ts +5 -5
- package/src/routes/agent-sessions.ts +24 -24
- package/src/routes/agents-spawn.ts +1 -1
- package/src/routes/agents.ts +17 -119
- package/src/routes/auth.ts +44 -17
- package/src/routes/authority-audit.ts +2 -2
- package/src/routes/automations.ts +6 -5
- package/src/routes/channel-binding-delete.ts +1 -1
- package/src/routes/channel-output.ts +3 -3
- package/src/routes/claude-api-budget.ts +5 -5
- package/src/routes/commands-listing.ts +1 -1
- package/src/routes/commands.ts +29 -27
- package/src/routes/context-resets.ts +2 -2
- package/src/routes/coordinator-teams.ts +1 -1
- package/src/routes/decisions.ts +2 -2
- package/src/routes/host-providers.ts +18 -0
- package/src/routes/host-secret-files.ts +1 -1
- package/src/routes/hosts.ts +11 -11
- package/src/routes/inbox.ts +3 -2
- package/src/routes/index.ts +7 -3
- package/src/routes/integrations.ts +9 -7
- package/src/routes/issue-activity.ts +2 -2
- package/src/routes/issue-associations.ts +4 -4
- package/src/routes/issue-refs.ts +3 -3
- package/src/routes/kernel-timers-operator.ts +1 -1
- package/src/routes/memory.ts +1 -1
- package/src/routes/merges.ts +11 -11
- package/src/routes/messages.ts +23 -17
- package/src/routes/orchestrator-bootstrap.ts +3 -1
- package/src/routes/orchestrator-host-registration.ts +2 -0
- package/src/routes/orchestrator-host-utilization.ts +2 -2
- package/src/routes/orchestrator-proxy.ts +2 -2
- package/src/routes/orchestrator.ts +27 -18
- package/src/routes/pairs.ts +8 -8
- package/src/routes/project-profile-instructions.ts +1 -1
- package/src/routes/project-trust.ts +1 -1
- package/src/routes/projects.ts +16 -16
- package/src/routes/prompt-templates.ts +12 -12
- package/src/routes/provider-quotas.ts +10 -10
- package/src/routes/run-command.ts +1 -1
- package/src/routes/secrets-backup.ts +4 -5
- package/src/routes/secrets-import.ts +3 -4
- package/src/routes/secrets-vault.ts +12 -14
- package/src/routes/settings.ts +1 -1
- package/src/routes/shipping.ts +9 -1
- package/src/routes/spawn-policy.ts +8 -7
- package/src/routes/sse.ts +2 -2
- package/src/routes/team-templates.ts +7 -7
- package/src/routes/teams.ts +10 -10
- package/src/routes/tokens.ts +18 -17
- package/src/routes/users.ts +24 -24
- package/src/routes/viewer-read.ts +3 -3
- package/src/routes/web-tool-calls.ts +4 -4
- package/src/routes/workflows.ts +2 -2
- package/src/routes/workspaces.ts +17 -16
- package/src/routing-policy-push.ts +6 -6
- package/src/runtime-grant.ts +17 -11
- package/src/runtime-install.ts +30 -0
- package/src/runtime-tokens.ts +20 -28
- package/src/secrets-broker/config.ts +1 -1
- package/src/secrets-broker/service.ts +2 -2
- package/src/security.ts +3 -1
- package/src/self-resume-carry.ts +21 -110
- package/src/self-resume-supersede.ts +4 -3
- package/src/self-resume.ts +54 -66
- package/src/server-background.ts +1 -1
- package/src/server.ts +25 -26
- package/src/services/agent-action.ts +12 -31
- package/src/services/agent-effort.ts +7 -32
- package/src/services/agent-hang-watchdog-job.ts +2 -2
- package/src/services/agent-heartbeat.ts +166 -0
- package/src/services/agent-reporting.ts +1 -1
- package/src/services/auth-context.ts +6 -0
- package/src/services/browser-inventory.ts +3 -3
- package/src/services/browser-session-state.ts +3 -2
- package/src/services/browser-session.ts +21 -27
- package/src/services/bus-command-update.ts +9 -9
- package/src/services/checkout-refresh-state.ts +1 -0
- package/src/services/checkout-refresh.test-fixture.ts +3 -2
- package/src/services/command-host.ts +7 -2
- package/src/services/coordinator-digest.ts +3 -2
- package/src/services/dispatch-command.ts +12 -13
- package/src/services/effective-launch-driver.ts +14 -9
- package/src/services/host-changed-paths.test-fixture.ts +5 -6
- package/src/services/host-project-readiness.ts +2 -2
- package/src/services/host-providers.ts +1 -1
- package/src/services/host-utilization.ts +9 -9
- package/src/services/idle-agent-digest.ts +17 -12
- package/src/services/idle-epics.ts +4 -4
- package/src/services/interrupt-agent.ts +12 -9
- package/src/services/issue-activity.ts +3 -3
- package/src/services/issue-associations.ts +15 -18
- package/src/services/issue-lifecycle-comments.ts +3 -2
- package/src/services/issue-lifecycle.ts +14 -13
- package/src/services/issue-refs.ts +4 -5
- package/src/services/kernel-timers-cutover-chaos-worker.ts +1 -1
- package/src/services/kernel-timers-ingress-chaos-worker.ts +6 -1
- package/src/services/kernel-timers-ingress.ts +3 -3
- package/src/services/kernel-timers-message-authority-chaos-worker.ts +3 -10
- package/src/services/kernel-timers-operator-chaos-worker.ts +3 -2
- package/src/services/kernel-timers-outbox.ts +1 -1
- package/src/services/kernel-timers-stage10-operator.ts +1 -1
- package/src/services/kernel-timers.ts +4 -3
- package/src/services/land-gate-placement.ts +11 -2
- package/src/services/land-issue-relations.ts +5 -4
- package/src/services/land-restart-retry.ts +7 -6
- package/src/services/landed-ancestry.ts +6 -5
- package/src/services/legacy-landing-host.ts +4 -1
- package/src/services/legacy-landing-recovery.ts +8 -6
- package/src/services/managed-running.ts +17 -17
- package/src/services/memory-areas.ts +3 -3
- package/src/services/merge-pause.ts +9 -15
- package/src/services/operator-decisions.ts +37 -41
- package/src/services/orchestrator-registration-recovery.ts +6 -2
- package/src/services/orchestrator-upgrade.ts +14 -12
- package/src/services/permission-decision.ts +4 -3
- package/src/services/plan-ci-notice.ts +1 -1
- package/src/services/plan-conformance.ts +4 -4
- package/src/services/plan-dispatch-policy.ts +10 -3
- package/src/services/plan-dispatch.ts +35 -14
- package/src/services/plan-graph.ts +39 -261
- package/src/services/plan-import.ts +1 -1
- package/src/services/plan-live-bindings.ts +8 -37
- package/src/services/plan-task-create.ts +1 -1
- package/src/services/plan-terminal-refs.ts +2 -12
- package/src/services/plan-wake-digest.ts +8 -3
- package/src/services/profile-trust.ts +2 -2
- package/src/services/project.ts +11 -10
- package/src/services/prompt-templates.ts +6 -5
- package/src/services/provider-api-key.ts +73 -0
- package/src/services/provider-hold-nudge.ts +9 -9
- package/src/services/provider-hold-record.ts +13 -12
- package/src/services/provider-state-audit.ts +19 -18
- package/src/services/provisioning-harness/driver.ts +1 -1
- package/src/services/provisioning-harness/fixture-matrix.ts +3 -3
- package/src/services/provisioning-harness/lifecycle.ts +24 -22
- package/src/services/provisioning-harness/prepare.ts +16 -17
- package/src/services/rate-limit-resume.ts +10 -9
- package/src/services/red-main-auto-revert.ts +7 -5
- package/src/services/red-main-controller-deps.ts +20 -3
- package/src/services/red-main-incident.ts +3 -1
- package/src/services/red-main-quarantine.ts +2 -3
- package/src/services/register-agent.ts +22 -22
- package/src/services/restart-project-role.ts +1 -1
- package/src/services/restart-spawn.ts +17 -16
- package/src/services/review-publish.ts +7 -24
- package/src/services/review-ref-reconcile.ts +29 -38
- package/src/services/runtime-dependency-alert.ts +27 -0
- package/src/services/scheduler-command.ts +11 -9
- package/src/services/scheduler.ts +5 -5
- package/src/services/self-effort-grant.ts +5 -25
- package/src/services/send-message.ts +16 -33
- package/src/services/shutdown-agent.ts +17 -14
- package/src/services/spawn-agent.ts +12 -41
- package/src/services/spawn-chain-inspector.ts +1 -1
- package/src/services/spawn-cwd-placement.ts +21 -5
- package/src/services/spawn-issue-activity.ts +8 -6
- package/src/services/spawn-launch.ts +17 -1
- package/src/services/spawn-loss-escalation.ts +1 -1
- package/src/services/spawn-registration-watchdog.ts +2 -2
- package/src/services/spawn-repo-probe.ts +7 -5
- package/src/services/spawn-tree-cleanup.ts +7 -8
- package/src/services/steward-reaper.ts +4 -4
- package/src/services/task-context-hydration.ts +25 -1
- package/src/services/task-delivery.ts +20 -34
- package/src/services/task-entity.ts +40 -203
- package/src/services/task-issue-link.ts +13 -20
- package/src/services/task-issue-weave.ts +12 -11
- package/src/services/task-lifecycle.ts +27 -31
- package/src/services/task-repo-cwd.ts +37 -0
- package/src/services/task-review-hold.ts +4 -17
- package/src/services/task-semantic-events.ts +13 -11
- package/src/services/task-state-reconcile.ts +3 -4
- package/src/services/task-validation.ts +2 -2
- package/src/services/team-templates.ts +5 -5
- package/src/services/team.ts +31 -98
- package/src/services/terminal-provider-exit.ts +6 -5
- package/src/services/timer-message-fire-chaos-worker.ts +7 -3
- package/src/services/timer-message-fire-outbox.ts +1 -1
- package/src/services/transient-agent-reaper.ts +22 -19
- package/src/services/turn-reconcile-audit.ts +9 -9
- package/src/services/user-onboarding.ts +8 -6
- package/src/services/user-profile.ts +6 -9
- package/src/services/work-finality.ts +16 -4
- package/src/services/workflow-auto-start.ts +2 -1
- package/src/services/workflow-caller.ts +61 -4
- package/src/services/workflow-child-proof-worker.ts +1 -1
- package/src/services/workflow-control-proof-worker.ts +1 -1
- package/src/services/workflow-coordinator.ts +8 -2
- package/src/services/workflow-decisions.ts +5 -5
- package/src/services/workflow-deferred-cleanup.ts +1 -1
- package/src/services/workflow-effect-driver.ts +42 -19
- package/src/services/workflow-effects.ts +41 -27
- package/src/services/workflow-pins.ts +7 -4
- package/src/services/workflow-reconcile.ts +1 -0
- package/src/services/workflow-resume-pins.ts +3 -3
- package/src/services/workflow-routing-defaults.ts +18 -0
- package/src/services/workflow-run-view.ts +4 -3
- package/src/services/workflow-run.test-fixture.ts +1 -1
- package/src/services/workflow-runs.ts +34 -22
- package/src/services/workflow-supervisor-state.ts +21 -1
- package/src/services/workflow-supervisor.ts +4 -3
- package/src/services/workspace-recovery.ts +4 -3
- package/src/setup.ts +47 -8
- package/src/spawn-admission.ts +10 -2
- package/src/spawn-placement.ts +27 -9
- package/src/spawn-targets.ts +8 -8
- package/src/sse-agent-status.ts +15 -6
- package/src/sse.ts +49 -24
- package/src/startup-context-injection.ts +61 -57
- package/src/steward-handoff.ts +4 -3
- package/src/steward-policy-cleanup.ts +9 -8
- package/src/steward.ts +2 -2
- package/src/task-dispatch-live.ts +5 -2
- package/src/task-dispatcher.ts +2 -2
- package/src/token-db.ts +2 -2
- package/src/token-usage-async.ts +2 -4
- package/src/user-awaiting-reply.ts +5 -5
- package/src/utils.ts +7 -0
- package/src/workspace-actions.ts +24 -29
- package/src/workspace-auto-merge.ts +14 -12
- package/src/workspace-changed-paths-client.ts +16 -5
- package/src/workspace-cleanup-stale.ts +30 -7
- package/src/workspace-command-settle.ts +24 -16
- package/src/workspace-config.ts +1 -1
- package/src/workspace-conflict-resolver.ts +9 -7
- package/src/workspace-dead-owner-recovery.ts +5 -4
- package/src/workspace-escalation.ts +12 -11
- package/src/workspace-human-escalation.ts +3 -3
- package/src/workspace-land-gate-watchdog.ts +3 -3
- package/src/workspace-land-refusal.ts +20 -0
- package/src/workspace-land-stopped.ts +1 -0
- package/src/workspace-merge.ts +10 -26
- package/src/workspace-nothing-to-land-notice.ts +2 -2
- package/src/workspace-orphans.ts +18 -37
- package/src/workspace-pr-completion.ts +10 -8
- package/src/workspace-rekey.ts +3 -3
- package/src/workspace-steward-failure.ts +2 -2
- package/src/workspace-steward-wake.ts +2 -2
- package/public/assets/agent-liveness-CaNwK0Zf.js +0 -2
- package/public/assets/overview-C1DCTzzV.js +0 -2
- package/public/assets/provider-display-DsuWMvVL.js +0 -2
- package/public/assets/run-card-CpKqRbhg.js +0 -2
- package/public/assets/shipping-B9YtnwtG.js +0 -2
- package/public/assets/store-DcClXLH0.js +0 -9
- package/runner/src/agent-runner/http-liveness.ts +0 -85
- package/src/db/on-loop-write-transaction.ts +0 -34
package/bundled/roles/builder.md
CHANGED
|
@@ -11,7 +11,7 @@ workspace: { mode: isolated }
|
|
|
11
11
|
You implement the Task you are bound to and deliver it. The `build-review` workflow runs your delivery through a fresh reviewer; you do not choose when it lands.
|
|
12
12
|
|
|
13
13
|
1. Read the Task and the repo's agent instructions (`CLAUDE.md`, `AGENTS.md` or `CONTRIBUTING.md`, whichever exist), and follow its conventions. Meet the Done-when exactly.
|
|
14
|
-
2. Implement and prove the Task, then deliver `complete` per Delivery.
|
|
14
|
+
2. Implement and prove the Task, then deliver `complete` per Delivery. Post-deploy, live-check and independent-proof criteria in the Done-when are checked after land by QA/onDeploy; they never block delivery. Deliver `complete` when code, tests and the delivery gate pass.
|
|
15
15
|
3. A Relay message starting "returned NO-GO" carries the reviewer's findings for the head you delivered. Fix them and deliver `complete` again on the same Task; a fresh reviewer checks the new head. If a finding is wrong or conflicts with the Done-when, say so in the delivery `summary` and fix what is valid. Do not argue by message.
|
|
16
16
|
4. Need a decision, a dependency or access you do not have: deliver `blocked` with `blockedBy`. Task cannot be done as written: deliver `failed` with the reason. Either one stops the workflow and goes to the coordinator with the history.
|
|
17
17
|
|
|
@@ -79,11 +79,18 @@ notice. Read or change the budget with `GET` or `PATCH
|
|
|
79
79
|
|
|
80
80
|
## Workflows, decisions and project MCP
|
|
81
81
|
|
|
82
|
-
With `HUMWICK_CHILD_WORKFLOWS=1`, a sub-coordinator
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
With `HUMWICK_CHILD_WORKFLOWS=1`, a sub-coordinator owns the workflow runs of a
|
|
83
|
+
Task it created, a Task assigned to it (`relay_task_assign_agent`), or a Task in
|
|
84
|
+
its private team. It can start, read (`relay_workflow_get`), resume, pause and
|
|
85
|
+
cancel those runs, including a run the root started before it handed the Task
|
|
86
|
+
down. Run escalations, results and coordinator decisions go to the
|
|
87
|
+
sub-coordinator first. The root gets them only when the sub-coordinator is gone.
|
|
88
|
+
A run on such a Task is the sub-coordinator's run, even when the root starts it:
|
|
89
|
+
its step agents spawn under the sub-coordinator and count against its quota. The
|
|
90
|
+
root coordinator keeps full control of these runs. Its profile's `workflows`
|
|
91
|
+
policy defaults to three concurrent runs and ten live step agents per run.
|
|
92
|
+
Workflow agents also consume the same delegated subtree and root quotas as
|
|
93
|
+
direct workers. The hub flag stays off until operations enables it.
|
|
87
94
|
|
|
88
95
|
Use `relay_decision` to file operator questions; answers return to the private
|
|
89
96
|
team's coordinator seat. A project role may `extends: sub-coordinator` and select
|
|
@@ -208,6 +208,7 @@ Run the repo's declared workflow `.agent-relay/workflows/<workflow>.yaml` on a T
|
|
|
208
208
|
|
|
209
209
|
- `workflow`: Workflow name: .agent-relay/workflows/<workflow>.yaml on the default branch, else Relay's bundled one (build-review).
|
|
210
210
|
- `taskId`: Task id (TNNNN accepted).
|
|
211
|
+
- `cwd`: Checkout to read the workflow and its roles from. Omit it to resolve the Task repo using the caller’s checkout, recorded worktree or project team; pass it explicitly when several roots remain ambiguous.
|
|
211
212
|
- `pins`: Per-step pins { <step>: { provider?, model?, effort?, orchestratorId?, profile? } }. Each field set wins over the YAML step's same field, which wins over the role file, which wins over the Task's dispatch policy. A provider pin wins over the step's crossProvider. A model pin needs its provider (here or in the YAML). `profile` replaces the base profile the step's role extends (e.g. worker-gui for a UI builder). An invalid pin for its host fails the call before anything spawns.
|
|
212
213
|
- `budget`: Observed token cap for this run's step agents and descendants. Ignored when the server sets HUMWICK_DELEGATION_TOKEN_BUDGETS=0; at the cap new spawns are refused and the owner is notified once. Running work can finish.
|
|
213
214
|
- `inputs`: Declared workflow application inputs.
|
package/docs/guides/workflows.md
CHANGED
|
@@ -70,6 +70,22 @@ Use `pins` on `relay_workflow_start` when a particular step needs specific setti
|
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
The run owner or a Task coordinator can also change a later step's pins while
|
|
74
|
+
the run is running or paused. Call `relay_workflow_resume` with only `runId`,
|
|
75
|
+
`pins` and an optional `note`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{"runId":"<run-id>","pins":{"review":{"provider":"codex","model":"sol","effort":"high","orchestratorId":"wbox-1","profile":"worker"}},"note":"Move review to wbox-1"}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This preserves the current step, wait and pause. Each named step must never have
|
|
82
|
+
started; a request naming a started step refuses without changing any pins.
|
|
83
|
+
Each named pin replaces that step's previous call pin; `{}` restores its workflow
|
|
84
|
+
defaults. `relay_workflow_get` with `verbose:true` shows the actor, time, note and
|
|
85
|
+
new pins in `pinChanges`. The dashboard's Workflows page has **Change [step] pins**
|
|
86
|
+
controls for future steps and a **Pin history** ledger. The CLI equivalent is
|
|
87
|
+
`humwick workflow resume <run-id> --pins '{"review":{"effort":"low"}}'`.
|
|
88
|
+
|
|
73
89
|
Keys are step names, such as `build` and `review`. A pin can set `provider`, `model`,
|
|
74
90
|
`effort`, `orchestratorId` (the host id), or `profile` (the role's base profile). A
|
|
75
91
|
model pin needs a provider, either in the pin or the step definition. Pins override
|
package/docs/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Humwick API",
|
|
5
|
-
"version": "0.130.
|
|
5
|
+
"version": "0.130.4",
|
|
6
6
|
"description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
|
|
7
7
|
"license": {
|
|
8
8
|
"name": "MIT",
|
|
@@ -328,6 +328,62 @@
|
|
|
328
328
|
]
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
|
+
"/api/auth/login-links": {
|
|
332
|
+
"post": {
|
|
333
|
+
"operationId": "postLoginLinkRoute",
|
|
334
|
+
"summary": "Post Login Link",
|
|
335
|
+
"tags": [
|
|
336
|
+
"Other"
|
|
337
|
+
],
|
|
338
|
+
"responses": {
|
|
339
|
+
"200": {
|
|
340
|
+
"description": "Success",
|
|
341
|
+
"content": {
|
|
342
|
+
"application/json": {}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"security": [
|
|
347
|
+
{
|
|
348
|
+
"bearerAuth": []
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"tokenHeader": []
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"tokenQuery": []
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"/api/auth/login-links/redeem": {
|
|
360
|
+
"post": {
|
|
361
|
+
"operationId": "postRedeemLoginLinkRoute",
|
|
362
|
+
"summary": "Post Redeem Login Link",
|
|
363
|
+
"tags": [
|
|
364
|
+
"Other"
|
|
365
|
+
],
|
|
366
|
+
"responses": {
|
|
367
|
+
"200": {
|
|
368
|
+
"description": "Success",
|
|
369
|
+
"content": {
|
|
370
|
+
"application/json": {}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"security": [
|
|
375
|
+
{
|
|
376
|
+
"bearerAuth": []
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"tokenHeader": []
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"tokenQuery": []
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
},
|
|
331
387
|
"/api/users/invites": {
|
|
332
388
|
"post": {
|
|
333
389
|
"operationId": "postUserInvite",
|
|
@@ -5299,6 +5355,52 @@
|
|
|
5299
5355
|
]
|
|
5300
5356
|
}
|
|
5301
5357
|
},
|
|
5358
|
+
"/api/orchestrators/{id}/host-providers/{provider}/api-key": {
|
|
5359
|
+
"post": {
|
|
5360
|
+
"operationId": "postHostProviderApiKeyRoute",
|
|
5361
|
+
"summary": "Post Host Provider Api Key",
|
|
5362
|
+
"tags": [
|
|
5363
|
+
"Orchestrators"
|
|
5364
|
+
],
|
|
5365
|
+
"parameters": [
|
|
5366
|
+
{
|
|
5367
|
+
"name": "id",
|
|
5368
|
+
"in": "path",
|
|
5369
|
+
"required": true,
|
|
5370
|
+
"schema": {
|
|
5371
|
+
"type": "string"
|
|
5372
|
+
}
|
|
5373
|
+
},
|
|
5374
|
+
{
|
|
5375
|
+
"name": "provider",
|
|
5376
|
+
"in": "path",
|
|
5377
|
+
"required": true,
|
|
5378
|
+
"schema": {
|
|
5379
|
+
"type": "string"
|
|
5380
|
+
}
|
|
5381
|
+
}
|
|
5382
|
+
],
|
|
5383
|
+
"responses": {
|
|
5384
|
+
"200": {
|
|
5385
|
+
"description": "Success",
|
|
5386
|
+
"content": {
|
|
5387
|
+
"application/json": {}
|
|
5388
|
+
}
|
|
5389
|
+
}
|
|
5390
|
+
},
|
|
5391
|
+
"security": [
|
|
5392
|
+
{
|
|
5393
|
+
"bearerAuth": []
|
|
5394
|
+
},
|
|
5395
|
+
{
|
|
5396
|
+
"tokenHeader": []
|
|
5397
|
+
},
|
|
5398
|
+
{
|
|
5399
|
+
"tokenQuery": []
|
|
5400
|
+
}
|
|
5401
|
+
]
|
|
5402
|
+
}
|
|
5403
|
+
},
|
|
5302
5404
|
"/api/orchestrators/{id}/sessions": {
|
|
5303
5405
|
"get": {
|
|
5304
5406
|
"operationId": "getOrchestratorSessions",
|
|
@@ -9163,7 +9265,7 @@
|
|
|
9163
9265
|
"tags": [
|
|
9164
9266
|
"Other"
|
|
9165
9267
|
],
|
|
9166
|
-
"description": "Returns the global workspace provisioning config `{ symlinkPaths: string[] }` — untracked files/filename patterns symlinked from the main checkout into each isolated worktree (the dashboard \"Workspace\" spawn option).
|
|
9268
|
+
"description": "Returns the global workspace provisioning config `{ symlinkPaths: string[] }` — untracked files/filename patterns symlinked from the main checkout into each isolated worktree (the dashboard \"Workspace\" spawn option). No defaults (`AGENTS.md` is tracked); merged over defaults until set.",
|
|
9167
9269
|
"responses": {
|
|
9168
9270
|
"200": {
|
|
9169
9271
|
"description": "Success",
|
|
@@ -18074,6 +18176,42 @@
|
|
|
18074
18176
|
]
|
|
18075
18177
|
}
|
|
18076
18178
|
},
|
|
18179
|
+
"/api/shipping/known-failures": {
|
|
18180
|
+
"get": {
|
|
18181
|
+
"operationId": "getKnownFailuresRoute",
|
|
18182
|
+
"summary": "Test failures already present on a repository's main",
|
|
18183
|
+
"tags": [
|
|
18184
|
+
"Other"
|
|
18185
|
+
],
|
|
18186
|
+
"description": "The failing test cases recorded on each open red-main incident whose red land is in `remote`, with the incident id and red sha. A builder's delivery gate reports these apart and holds them out of runs whose diff does not touch the failing file; new failures still block. Requires agent:read.",
|
|
18187
|
+
"parameters": [
|
|
18188
|
+
{
|
|
18189
|
+
"name": "remote",
|
|
18190
|
+
"in": "query",
|
|
18191
|
+
"description": "GitHub `owner/repo`."
|
|
18192
|
+
}
|
|
18193
|
+
],
|
|
18194
|
+
"responses": {
|
|
18195
|
+
"200": {
|
|
18196
|
+
"description": "Success",
|
|
18197
|
+
"content": {
|
|
18198
|
+
"application/json": {}
|
|
18199
|
+
}
|
|
18200
|
+
}
|
|
18201
|
+
},
|
|
18202
|
+
"security": [
|
|
18203
|
+
{
|
|
18204
|
+
"bearerAuth": []
|
|
18205
|
+
},
|
|
18206
|
+
{
|
|
18207
|
+
"tokenHeader": []
|
|
18208
|
+
},
|
|
18209
|
+
{
|
|
18210
|
+
"tokenQuery": []
|
|
18211
|
+
}
|
|
18212
|
+
]
|
|
18213
|
+
}
|
|
18214
|
+
},
|
|
18077
18215
|
"/api/gates/stats": {
|
|
18078
18216
|
"get": {
|
|
18079
18217
|
"operationId": "getGateStatsRoute",
|
|
@@ -18538,11 +18676,11 @@
|
|
|
18538
18676
|
"/api/workflows/runs/{runId}/resume": {
|
|
18539
18677
|
"post": {
|
|
18540
18678
|
"operationId": "postWorkflowRunResumeRoute",
|
|
18541
|
-
"summary": "Resume a workflow
|
|
18679
|
+
"summary": "Resume a workflow or update future step pins",
|
|
18542
18680
|
"tags": [
|
|
18543
18681
|
"Other"
|
|
18544
18682
|
],
|
|
18545
|
-
"description": "Resume an escalated workflow or explicitly retry a failed for-each activation. For decision.answeredBy coordinator, pass decision: {action: answer, waitKey, answers} or {action: escalate, waitKey}, with optional note. Answers use the same typed approved IDs or choice as the operator card. Escalate files that card with the note in context. Only the run notice coordinator seat or an admin can respond; other agents receive 403. Cancellation invalidates both paths. Requires task:write; ordinary step resumes also require spawn authority unless admitted as a child caller.",
|
|
18683
|
+
"description": "Resume an escalated workflow or explicitly retry a failed for-each activation. For decision.answeredBy coordinator, pass decision: {action: answer, waitKey, answers} or {action: escalate, waitKey}, with optional note. Answers use the same typed approved IDs or choice as the operator card. Escalate files that card with the note in context. Only the run notice coordinator seat or an admin can respond; other agents receive 403. Cancellation invalidates both paths. Requires task:write; ordinary step resumes also require spawn authority unless admitted as a child caller. On a running or paused run, pins alone replaces each named not-yet-started step pin, without resuming, unpausing or changing its current wait. Pins support provider, model, effort, orchestratorId and profile; steps already started refuse atomically. The run owner or a Task coordinator can update pins. GET with verbose=true returns pinChanges with actor, timestamp, note and pins.",
|
|
18546
18684
|
"parameters": [
|
|
18547
18685
|
{
|
|
18548
18686
|
"name": "runId",
|
|
@@ -18623,6 +18761,39 @@
|
|
|
18623
18761
|
"additionalProperties": false
|
|
18624
18762
|
}
|
|
18625
18763
|
]
|
|
18764
|
+
},
|
|
18765
|
+
"step": {
|
|
18766
|
+
"type": "string",
|
|
18767
|
+
"maxLength": 64
|
|
18768
|
+
},
|
|
18769
|
+
"pins": {
|
|
18770
|
+
"type": "object",
|
|
18771
|
+
"additionalProperties": {
|
|
18772
|
+
"type": "object",
|
|
18773
|
+
"additionalProperties": false,
|
|
18774
|
+
"properties": {
|
|
18775
|
+
"provider": {
|
|
18776
|
+
"type": "string",
|
|
18777
|
+
"maxLength": 200
|
|
18778
|
+
},
|
|
18779
|
+
"model": {
|
|
18780
|
+
"type": "string",
|
|
18781
|
+
"maxLength": 200
|
|
18782
|
+
},
|
|
18783
|
+
"effort": {
|
|
18784
|
+
"type": "string",
|
|
18785
|
+
"maxLength": 200
|
|
18786
|
+
},
|
|
18787
|
+
"orchestratorId": {
|
|
18788
|
+
"type": "string",
|
|
18789
|
+
"maxLength": 200
|
|
18790
|
+
},
|
|
18791
|
+
"profile": {
|
|
18792
|
+
"type": "string",
|
|
18793
|
+
"maxLength": 200
|
|
18794
|
+
}
|
|
18795
|
+
}
|
|
18796
|
+
}
|
|
18626
18797
|
}
|
|
18627
18798
|
}
|
|
18628
18799
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humwick/server",
|
|
3
|
-
"version": "0.130.
|
|
3
|
+
"version": "0.130.4",
|
|
4
4
|
"description": "Lightweight HTTP message relay for inter-agent communication across machines",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
],
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"age-encryption": "0.3.1",
|
|
87
|
-
"@humwick/channels-host": "0.130.
|
|
88
|
-
"@humwick/kernel": "0.130.
|
|
89
|
-
"@humwick/offload": "0.130.
|
|
90
|
-
"@humwick/providers": "0.104.
|
|
91
|
-
"@humwick/sdk": "0.2.
|
|
87
|
+
"@humwick/channels-host": "0.130.4",
|
|
88
|
+
"@humwick/kernel": "0.130.4",
|
|
89
|
+
"@humwick/offload": "0.130.4",
|
|
90
|
+
"@humwick/providers": "0.104.10",
|
|
91
|
+
"@humwick/sdk": "0.2.139",
|
|
92
92
|
"ajv": "^8.20.0",
|
|
93
93
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
94
94
|
"express": "^5.2.1",
|
|
@@ -113,7 +113,8 @@
|
|
|
113
113
|
"deploy:dashboard": "bun run scripts/deploy-dashboard.ts",
|
|
114
114
|
"ci:land": "sh scripts/gate.sh bun run scripts/ci-land.ts",
|
|
115
115
|
"ci:release": "sh scripts/gate.sh sh -c 'bun run build:dashboard:bundle && bun run build:claude-monitor:check && bun run lint:import-boundaries && bun run lint:provider-contract && bun run typecheck && bun run docs:api:check && AGENT_RELAY_RELEASE_TESTS=1 bun test --timeout 30000 --bail && bun --config=bunfig.integration.toml test --isolate --timeout 30000 --bail dashboard/src'",
|
|
116
|
-
"ci": "bun run ci
|
|
116
|
+
"ci:full": "sh scripts/gate.sh bun run scripts/ci-full.ts",
|
|
117
|
+
"ci": "bun run ci:full",
|
|
117
118
|
"test": "sh scripts/gate.sh sh -c 'bun run test:guards && bun test --timeout 30000 --bail'",
|
|
118
119
|
"steward:cleanup": "bun run scripts/steward-policy-cleanup.ts",
|
|
119
120
|
"test:affected": "sh scripts/gate.sh bun run scripts/test-affected.ts",
|
|
@@ -1,4 +1,4 @@
|
|
|
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"./react-dom-DSFxiC7T.js";import{Nt as a,jt as o,t as s}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"./react-dom-DSFxiC7T.js";import{Nt as a,jt as o,t as s}from"./store-BgDALGIX.js";import{O as c}from"./provider-display-bWwiuedV.js";import{o as l}from"./artifacts-Bjq-ZyBA.js";import{F as u,J as d,S as f,_ as p,p as ee}from"./display-BemJG1f_.js";import{n as m}from"./api-CIIVBtAV.js";import{n as h,t as g}from"./radio-Bn0_qc0G.js";import{t as _}from"./arrow-right-vFsRqG8V.js";import{D as v,G as y,I as te,N as ne,O as b,T as x,c as S,h as C,j as re,k as w,m as ie,n as T,p as E,v as D,w as O}from"./TraceView-B99Uu2yT.js";import{t as k}from"./brain-CagXMEKE.js";import{t as A}from"./chevron-right-iljytE0x.js";import{t as j}from"./circle-alert-CryagaZd.js";import{t as M}from"./file-text-CKuoMR2U.js";import{t as N}from"./git-merge-C7eIG425.js";import{t as P}from"./loader-circle-BfPd4kOD.js";import{t as ae}from"./plug-zap-V0wMDJ-G.js";import{t as oe}from"./smile-plus-q6EQBXHZ.js";import{t as F}from"./triangle-alert-BBNhfgMi.js";import{t as I}from"./agent-type-icon-CXSLrKiq.js";import{t as se}from"./volume-2-XrcRKD9Z.js";import{t as L}from"./zoom-in-Bs8Qv8VL.js";import{n as R,t as z}from"./task-chip-CYj0mpoL.js";import{t as B}from"./formatted-body-qy2nTD_1.js";import{t as ce}from"./user-avatar-CkLhVBGu.js";var V=e(n(),1),H=e(i(),1),U=`[data-testid="chat-scroller"]`,W=`data-anchor-step`,G=e=>({[W]:e}),K=90,q=15,J=[`wheel`,`touchstart`,`pointerdown`,`keydown`],Y=new Map;function X(e,t){return Y.set(e,t),()=>void Y.delete(e)}var Z=(e,t)=>e.getBoundingClientRect().top-t.getBoundingClientRect().top;function le(e,t){let n=e.getBoundingClientRect(),r=null,i=Array.from(e.querySelectorAll(`[${W}]`)).filter(e=>e.getAttribute(W)!==t).map(e=>({el:e,top:e.getBoundingClientRect().top,bottom:e.getBoundingClientRect().bottom})).sort((e,t)=>e.top-t.top),a=null;for(let e of i){if(e.bottom>n.top&&e.top<n.bottom){a=e;break}e.bottom<=n.top&&(!r||e.bottom>r.bottom)&&(r=e)}if(a??=r,!a)return null;let o=a.el;return{find:()=>o.isConnected?o:null,offset:a.top-n.top}}function ue(e){let t=e.getBoundingClientRect(),n=t.top+t.height/2,r=new Set;return Array.from(e.querySelectorAll(`[data-msg-id]`)).filter(e=>!r.has(e.dataset.msgId)&&!!r.add(e.dataset.msgId)).map(e=>{let r=e.getBoundingClientRect();return{id:e.dataset.msgId,offset:r.top-t.top,distance:Math.abs((r.top+r.bottom)/2-n)}}).sort((e,t)=>e.distance-t.distance)}function de(e,t,n){let r=()=>{let r=n.find();if(!r)return!1;let i=Z(r,e)-n.offset;return Math.abs(i)<=.5?!1:(t.nudge(i),!0)};r();let i=0,a=()=>{cancelAnimationFrame(i),t.pin(null);for(let t of J)e.removeEventListener(t,a)};for(let t of J)e.addEventListener(t,a,{passive:!0});let o=0,s=0,c=()=>{if(o=r()?0:o+1,!e.isConnected||!n.find()||o>=q||++s>=K)return a();i=requestAnimationFrame(c)};i=requestAnimationFrame(c)}function fe(e,t,n){let r=e.closest(U),i=r&&Y.get(r),a=r&&i&&r.dataset.scrollMode===`anchored`?le(r,t):null;(0,H.flushSync)(n),r&&i&&a&&de(r,i,a)}function pe(e){let t=Array.from(Y,([e,t])=>({scroller:e,owner:t,rows:e.dataset.scrollMode===`anchored`?ue(e):[]})).filter(({rows:e})=>e.length);for(let{owner:e,rows:n}of t)e.pin(n.map(({id:e})=>Number(e)));(0,H.flushSync)(e);for(let{scroller:e,owner:n,rows:r}of t){let t=t=>()=>e.querySelector(`[data-msg-id="${CSS.escape(t)}"]`),i=r.find(({id:e})=>t(e)());i?de(e,n,{find:t(i.id),offset:i.offset}):n.pin(null)}}var Q=r();function me(e){let t=new Set,n=(()=>{try{return window.localStorage.getItem(e)===`on`}catch{return!1}})(),r=()=>t.forEach(e=>e());return typeof window<`u`&&window.addEventListener(`storage`,t=>{t.key===e&&(n=t.newValue===`on`,r())}),{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>n,toggle(){n=!n;try{window.localStorage.setItem(e,n?`on`:`off`)}catch{}r()}}}var he=me(`humwick:chat-hide-tools`),ge=me(`humwick:chat-hide-reasoning`);function _e(e){return[(0,V.useSyncExternalStore)(e.subscribe,e.get,()=>!1),e.toggle]}function ve(e){return e.split(`
|
|
2
2
|
`).find(e=>e.trim())?.trim()??`thinking`}function ye({step:e,issueRepo:t}){return(0,Q.jsx)(ie,{id:`reasoning-step-${e.id}`,icon:k,label:`thinking`,summary:ve(e.text),tone:`border-tone-neutral/25 bg-tone-neutral/10 text-tone-neutral-fg`,children:(0,Q.jsx)(B,{text:e.text,issueRepo:t,className:`italic break-words min-w-0 text-xs leading-relaxed`})})}function be({hidden:e,count:n,kind:r,onToggle:i}){return(0,Q.jsxs)(`button`,{...G(`control`),onClick:t=>fe(t.currentTarget,e?null:r,i),className:`flex items-center gap-1 text-[11px] text-muted-foreground/50 hover:text-muted-foreground transition-colors text-left`,children:[(0,Q.jsx)(A,{className:t(`w-3 h-3 shrink-0 transition-transform`,!e&&`rotate-90`)}),(0,Q.jsx)(`span`,{children:e?`show ${n} ${r} step${n===1?``:`s`}`:`hide ${r} steps`})]})}function xe({steps:e,showReasoning:t,issueRepo:n}){let[r,i]=_e(he),[a,o]=_e(ge),s=t?e:e.filter(e=>e.kind!==`reasoning`);if(!s.length)return null;let c=s.filter(e=>e.kind===`tool`).length,l=s.filter(e=>e.kind===`reasoning`).length;return(0,Q.jsx)(`div`,{className:`flex justify-start mb-2`,children:(0,Q.jsxs)(`div`,{className:`max-w-[85%] md:max-w-[75%] min-w-0 space-y-1.5`,children:[s.map(e=>(e.kind===`reasoning`?a:e.kind===`tool`&&r)?null:(0,Q.jsx)(`div`,{...G(e.kind),children:e.kind===`narration`?(0,Q.jsx)(B,{text:e.text,issueRepo:n,className:`text-sm leading-relaxed break-words text-foreground/90 min-w-0`}):e.kind===`reasoning`?(0,Q.jsx)(ye,{step:e,issueRepo:n}):(0,Q.jsx)(E,{step:e})},e.id)),l>0&&(0,Q.jsx)(be,{hidden:a,count:l,kind:`reasoning`,onToggle:o}),c>0&&(0,Q.jsx)(be,{hidden:r,count:c,kind:`tool`,onToggle:i})]})})}var Se={memory:`memories`,"memory-area":`memories`,instructions:`startup`,context:`startup`,tools:`injected`,comms:`injected`,knowledge:`injected`},Ce={narration:`narration`,tool:`tools`,reasoning:`reasoning`};function we(e){return e.startsWith(`workflow.`)||e.startsWith(`plan.`)?`workflow`:e===`branch.landed`||e===`landed-failure`||e===`task.steward-rekey`||e.startsWith(`workspace.`)||e.startsWith(`ci.`)||e.startsWith(`cd.`)?`land`:e.startsWith(`task.`)?`task`:e.startsWith(`agent.`)||e.startsWith(`team.`)||e.startsWith(`managed-policy.`)?`agents`:`other`}function Te(e){let t=e.payload??{};return typeof t.notificationKind==`string`?t.notificationKind:typeof t.kind==`string`?t.kind:``}function Ee(e,t){if(D(e))return we(Te(e));if(e.kind===`session`){let t=e.payload?.session;return t?.type===`relay-injection`?Se[t.relayInjection?.category]??`injected`:Ce[t?.type??``]??null}let n=e.from===t?e.to:e.from;return n&&n!==`system`&&!c(n)?`agentMessages`:null}function De(e,t,n){if(e.kind!==`session`&&e.deliveryStatus===`history`&&!n.undelivered)return!1;let r=Ee(e,t);return r===null||n[r]}var Oe={"branch.landed":N,"context.warning":F,"agent.context_threshold":F,"agent.rate_limit_resume":ae},ke={"branch.landed":`branch landed`,"context.warning":`context warning`,"agent.context_threshold":`context threshold reached`,"task.status-pulse":`Status Pulse`};function Ae(e){return e.payload?.kind===`agent.self_resume_continuation`?e.payload.delivery?.state===`ingested`?`self-resume continuation ingested`:`self-resume continuation stored / recoverable`:null}function je(e){return e.replace(/[._-]+/g,` `).trim()}function Me(e,t,n){return Ae(e)??ke[t]??(je(t)||e.subject?.trim()||n||`notice #${e.id}`)}function Ne(e,t){return t===e?``:t.startsWith(`${e}:`)?t.slice(e.length+1).trim():t}function Pe(e){return e.length?e.map(e=>[e.taskId==null?null:`T${e.taskId}`,e.transition,e.title].filter(Boolean).join(` `)).join(` · `):`update`}var $=e=>typeof e==`string`?e:``,Fe=[`sha`,`landedSha`,`newHeadSha`,`sourceHeadSha`,`greenHeadSha`,`gitSha`],Ie=[`taskId`,`runId`,`agentId`,`author`,`workspaceId`,`branch`,`base`,`commandId`,...Fe];function Le(e){let t=e.payload??{},n=Te(e),r=typeof t.taskId==`number`&&Number.isSafeInteger(t.taskId)?t.taskId:void 0,i=Fe.map(e=>$(t[e])).find(Boolean)??``,a=e.body.split(`
|
|
3
3
|
`).find(e=>e.trim())?.replace(/`/g,``).trim()??``;return n===`branch.landed`&&$(t.branch)&&(a=`${$(t.branch)} → ${$(t.base)||`base`}`),n===`task.status-pulse`&&(a=Pe(Array.isArray(t.events)?t.events:[])),{kind:n,summary:a,agentId:$(t.agentId)||$(t.author)||$(t.memberId),taskId:r,taskLabel:$(t.taskLabel)||void 0,runId:$(t.runId),sha:i}}function Re(e){let t=e.payload?.routing;return!t||typeof t!=`object`||Array.isArray(t)?``:$(t.reason)}function ze({msg:e}){let t=e.payload??{},{routing:n,...r}=t,i=Re(e),a=Ie.flatMap(e=>t[e]==null||t[e]===``?[]:[[e,String(t[e])]]);return(0,Q.jsxs)(`div`,{className:`mt-2 space-y-2 border-t border-current/10 pt-2`,children:[e.body.trim()&&(0,Q.jsx)(B,{text:e.body,className:`break-words text-xs leading-relaxed text-foreground/85`}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-0.5 text-[11px]`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`message`}),(0,Q.jsxs)(`dd`,{className:`font-mono`,children:[`#`,e.id,` · `,e.deliveryStatus??`pending`]}),a.map(([e,t])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`break-all font-mono`,children:t})]},e)),i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`why here`}),(0,Q.jsx)(`dd`,{children:i})]})]}),(0,Q.jsx)(C,{value:r,className:`max-h-72 overflow-auto rounded-md border border-border/60 bg-background/75`,compact:!0})]})}function Be({msg:e}){let n=Le(e),r=`notice-${e.id}`,i=s(e=>e.chatExpandedItems.includes(r)),a=s(e=>e.toggleChatItemExpanded),o=s(e=>e.openTaskDetailById),c=s(e=>e.showWorkflowRun),l=Oe[n.kind]??g,u=Me(e,n.kind,n.summary),d=Ne(u,n.summary),f=n.kind===`branch.landed`,p=e.deliveryStatus===`history`;return(0,Q.jsx)(`div`,{className:`flex justify-center py-1`,children:(0,Q.jsxs)(`div`,{"data-testid":`chat-notice`,"data-notice-kind":n.kind,className:t(`w-full min-w-0 max-w-full rounded-lg border px-2.5 py-1.5 text-xs md:max-w-[85%]`,f?`border-tone-success/35 bg-tone-success/10 text-tone-success-fg`:`border-border bg-muted/20 text-muted-foreground`,p&&`border-dashed opacity-80`),children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>a(r),className:`flex min-w-0 flex-1 basis-full items-center gap-1.5 text-left @2xl/chat:basis-56`,children:[(0,Q.jsx)(A,{className:t(`h-3.5 w-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,Q.jsx)(l,{className:`h-3.5 w-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`shrink-0 font-medium`,children:u}),d&&(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground/75`,children:d})]}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[n.agentId&&(0,Q.jsx)(T,{agentId:n.agentId,className:`text-current`}),n.taskId!=null&&(0,Q.jsx)(z,{id:n.taskId,title:n.taskLabel,compact:!0,onClick:()=>o(n.taskId)}),n.runId&&(0,Q.jsx)(R,{label:n.runId,compact:!0,title:`Workflow run ${n.runId}`,ariaLabel:`Open workflow run ${n.runId}`,onClick:()=>void c(n.runId)}),n.sha&&(0,Q.jsx)(`span`,{className:`rounded bg-current/10 px-1 font-mono text-[10px]`,title:n.sha,children:n.sha.slice(0,7)}),f&&e.payload?.pushed===!1&&(0,Q.jsx)(`span`,{className:`text-tone-warning-fg`,title:`Local-only land — not pushed to origin`,children:`local only`}),p&&(0,Q.jsx)(`span`,{className:`rounded border border-current/30 px-1 text-[10px]`,title:`Settled as history: this notice never reached the agent's turn`,children:`not delivered`}),(0,Q.jsx)(`span`,{className:`text-muted-foreground/70`,children:x(e.occurredAt??e.createdAt)})]})]}),i&&(0,Q.jsx)(ze,{msg:e})]})})}function Ve(){return(0,V.useSyncExternalStore)(e=>o.subscribe(e),()=>o.getPlayingKey(),()=>null)}function He({msg:e,peer:t}){return(0,Q.jsx)(S,{msg:e,issueRepo:s(e=>e.agentsById[t]?.issueRepo)})}function Ue({agent:e,onClick:n}){let r=!!(n&&e);return(0,Q.jsx)(`button`,{type:`button`,title:e?e.label||e.name||e.id:void 0,onClick:n,disabled:!r,className:t(`shrink-0 self-end transition-opacity`,r?`cursor-pointer hover:opacity-80`:`cursor-default opacity-60`),children:(0,Q.jsx)(I,{agent:e})})}function We({agentId:e,onOpen:t}){let n=s(t=>t.agentsById[e]??null);return(0,Q.jsx)(Ue,{agent:n,onClick:n?()=>t(n):void 0})}function Ge({attachment:e,outbound:n}){let r=e.title||e.artifactId;return e.kind===`image`?(0,Q.jsx)(Ke,{artifactId:e.artifactId,title:r}):(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>l(e.artifactId),className:t(`mt-2 flex w-full items-center gap-2 rounded-md border px-2.5 py-2 text-left text-xs transition-colors`,n?`border-primary-foreground/20 bg-primary-foreground/10 hover:bg-primary-foreground/15`:`border-border bg-background hover:bg-muted`),children:[(0,Q.jsx)(M,{className:`h-4 w-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),(0,Q.jsx)(A,{className:`h-3.5 w-3.5 shrink-0`})]})}function Ke({artifactId:e,title:n}){let[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let t=!1,n=null;return o(null),i(null),m(`/artifacts/${encodeURIComponent(e)}/content`).then(e=>{t||(n=URL.createObjectURL(e),i(n))},e=>{t||o(e.message)}),()=>{t=!0,n&&URL.revokeObjectURL(n)}},[e]),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>l(e),className:`group/img mt-2 block overflow-hidden rounded-md border border-foreground/10 bg-black/10 text-left relative`,children:r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`img`,{src:r,alt:n,loading:`lazy`,className:`block max-h-72 max-w-full object-contain`}),(0,Q.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-black/0 group-hover/img:bg-black/30 transition-colors`,children:(0,Q.jsx)(L,{className:`w-6 h-6 text-white opacity-0 group-hover/img:opacity-100 transition-opacity drop-shadow-md`})})]}):(0,Q.jsxs)(`span`,{className:t(`flex min-h-20 items-center gap-2 px-3 py-2 text-xs`,a?`text-tone-danger-fg`:`text-muted-foreground`),children:[a?(0,Q.jsx)(j,{className:`h-4 w-4`}):(0,Q.jsx)(P,{className:`h-4 w-4 animate-spin`}),a||`Loading image`]})})}function qe({open:e,onToggle:n,onReact:r}){return(0,Q.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Q.jsx)(`button`,{type:`button`,title:`Add reaction`,onClick:n,className:t(`inline-flex h-5 w-6 items-center justify-center rounded-full border border-border bg-popover text-muted-foreground shadow-sm transition hover:bg-muted hover:text-foreground`,e?`opacity-100`:`opacity-0 pointer-events-none md:group-hover/msg:opacity-100 md:group-hover/msg:pointer-events-auto`),children:(0,Q.jsx)(oe,{className:`h-3 w-3`})}),e&&(0,Q.jsx)(`div`,{className:`absolute bottom-full left-0 z-30 mb-1 flex gap-0.5 rounded-full border border-border bg-popover p-0.5 shadow-md`,children:O.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:`React ${e}`,onClick:()=>r(e),className:`inline-flex h-6 w-7 items-center justify-center rounded-full text-xs transition-colors hover:bg-muted`,children:e},e))})]})}function Je({msg:e,peer:n}){let[r,i]=(0,V.useState)(!1),a=s(e=>e.agentsById),o=s(e=>e.openAgentDetail),c=e.from===n,l=(c?e.to:e.from)||``,d=a[c?n:l]?.issueRepo??a[n]?.issueRepo,f=!l||l===`broadcast`||l.includes(`:`),p=u(e),m=x(e.occurredAt??e.createdAt),g=c?_:h,v=a[e.from??``]??null;function y(e){e.stopPropagation(),v&&o(v)}return(0,Q.jsx)(`div`,{"data-msg-id":e.id,className:`flex justify-center mb-1.5`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-[94%] rounded-md border border-border/50 bg-muted/15 px-2.5 py-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs cursor-pointer select-none`,onClick:()=>i(e=>!e),children:[(0,Q.jsx)(A,{className:t(`h-3 w-3 shrink-0 text-muted-foreground/60 transition-transform`,r&&`rotate-90`)}),(0,Q.jsx)(`button`,{type:`button`,title:v?v.label||v.name||v.id:void 0,disabled:!v,onClick:y,className:t(`shrink-0 transition-opacity`,v?`cursor-pointer hover:opacity-80`:`cursor-default opacity-60`),children:(0,Q.jsx)(I,{agent:v,className:`!w-4 !h-4 !rounded-sm opacity-70`})}),(0,Q.jsx)(g,{className:`h-3 w-3 shrink-0 text-muted-foreground/70`}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[`Message `,c?`to`:`from`]}),f?(0,Q.jsx)(`span`,{className:`shrink-0 font-medium text-muted-foreground`,children:ee(l,a)}):(0,Q.jsx)(T,{agentId:l,className:`shrink-0 px-0.5 text-foreground/80`,noIcon:!0}),!r&&(0,Q.jsx)(`span`,{className:`min-w-24 flex-1 truncate text-muted-foreground/50`,children:p}),(0,Q.jsx)(`span`,{className:`ml-auto shrink-0 text-muted-foreground/40`,children:m})]}),r&&(0,Q.jsx)(`div`,{className:`mt-1.5 pl-5`,children:(0,Q.jsx)(B,{text:p,rawBody:e.body,issueRepo:d,className:`text-sm leading-relaxed text-foreground/90`})})]})})}var Ye=(0,V.memo)(function({msg:e,peer:n,showAvatar:r=!1,onOpenReferencedPath:i,onPreviewReferencedPath:l,onPreviewReferencedPathEnd:ee}){if(!c(e.from)&&!c(e.to))return(0,Q.jsx)(Je,{msg:e,peer:n});let m=e.kind===`session`?e.payload?.session:void 0;if(m?.type===`prompt`&&m?.origin===`provider`)return(0,Q.jsx)(He,{msg:e,peer:n});let h=c(e.from),g=s(e=>e.reactToMessage),_=s(e=>e.voiceTtsEnabled),S=Ve(),C=s(e=>{let t=e.agentsById[n]?.meta?.cwd;return typeof t==`string`?t:``}),ie=s(e=>e.agentsById[n]?.issueRepo),T=s(e=>e.usersById),E=s(e=>e.users.length>1),D=h?d(e.from,T):void 0,O=s(e=>e.openAgentDetail);s(e=>e.openTaskDetailById);let[k,A]=(0,V.useState)(!1),j=(0,V.useRef)(null),M=(0,V.useRef)(null),N=(0,V.useRef)(!1),P=u(e),ae=x(e.occurredAt??e.createdAt),oe=re(e),F=v(e,a(s(e=>e.sessionUser))),I=h?ne(e,n):null,L=I?.icon,z=S===String(e.id),H=_&&!h&&!w(e)&&P.trim().length>0;function U(t){t.stopPropagation(),z?o.bargeIn():o.speak(e.body,String(e.id))}(0,V.useEffect)(()=>{if(!k)return;function e(e){b()||j.current&&!j.current.contains(e.target)&&A(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[k]);function W(e){return te(C||`/`,e)}function G(e,t){let n=W(e);i?.(n,t)}function K(e,t,n){let r=W(e);l?.(r,t,n)}function q(t){g(e,t),A(!1)}function J(e){e.button===0&&(M.current={x:e.clientX,y:e.clientY},N.current=!1)}function Y(e){let t=M.current;t&&(Math.abs(e.clientX-t.x)>3||Math.abs(e.clientY-t.y)>3)&&(N.current=!0)}function X(t){if(!(w(e)||h)&&!t.target.closest(`a,button,input,textarea,select,[role="button"]`)){if(N.current||b()){N.current=!1;return}A(e=>!e)}}let Z=r&&!w(e);return(0,Q.jsxs)(`div`,{"data-msg-id":e.id,className:t(`group/msg flex mb-3 items-end`,h?`justify-end`:`justify-start`,Z&&`gap-1.5`),children:[!h&&Z&&(0,Q.jsx)(We,{agentId:n,onOpen:O}),(0,Q.jsxs)(`div`,{ref:j,className:t(`relative`,h?`max-w-full md:max-w-[75%]`:`max-w-[calc(100%-2rem)] md:max-w-[calc(75%-2rem)]`),children:[H&&(0,Q.jsx)(`button`,{type:`button`,title:z?`Stop playback`:`Play aloud`,onClick:U,className:t(`absolute -top-2 -right-2 z-20 inline-flex h-6 w-6 items-center justify-center rounded-full border bg-popover shadow-sm transition`,z?`border-primary/50 text-primary opacity-100`:`border-border text-muted-foreground opacity-70 hover:bg-muted hover:text-foreground hover:opacity-100 [@media(hover:hover)]:md:opacity-0 [@media(hover:hover)]:md:group-hover/msg:opacity-100`),children:z?(0,Q.jsx)(y,{className:`h-3.5 w-3.5 animate-pulse`}):(0,Q.jsx)(se,{className:`h-3.5 w-3.5`})}),(0,Q.jsxs)(`div`,{className:t(`rounded-2xl px-3.5 py-2 text-sm select-text`,!h&&!w(e)&&`cursor-pointer`,h?`tone-on-primary bg-primary text-primary-foreground rounded-br-sm`:`bg-card ring-1 ring-foreground/10 rounded-bl-sm`),onPointerDown:J,onPointerMove:Y,onClick:X,children:[h&&E&&(0,Q.jsx)(`p`,{className:`text-[11px] font-semibold mb-0.5 text-right`,children:f(e.from,T)}),e.subject&&(0,Q.jsx)(`p`,{className:t(`text-xs font-semibold mb-1`,h?`text-primary-foreground`:`text-muted-foreground`),children:e.subject}),(0,Q.jsx)(B,{text:P,rawBody:e.body,issueRepo:ie,className:`leading-relaxed`,onPrimary:h,onOpenPath:G,onPreviewPath:K,onPreviewPathEnd:ee,resolvePathTitle:(e,t)=>`${W(e)}${t?`:${t}`:``}`}),oe.map(t=>(0,Q.jsx)(Ge,{attachment:t,outbound:h},`${e.id}-${t.artifactId}-${t.role||``}`)),(0,Q.jsxs)(`p`,{className:t(`text-xs mt-1 flex items-center gap-1.5`,h?`justify-end text-primary-foreground`:`justify-end text-muted-foreground`),children:[(0,Q.jsx)(R,{label:p(e.id),title:`Message id`,compact:!0}),(0,Q.jsx)(`span`,{children:ae}),I&&L&&(0,Q.jsxs)(`span`,{className:t(`inline-flex items-center gap-1`,I.tone!==`muted`&&`text-primary-foreground`,I.tone===`danger`&&`font-semibold`),title:I.title,children:[(0,Q.jsx)(L,{className:`h-3 w-3`}),I.label]})]})]}),!w(e)&&F.length>0&&(0,Q.jsxs)(`div`,{className:t(`flex flex-wrap items-center gap-0.5 -mt-1 relative z-10`,h?`justify-end pr-2`:`justify-start pl-2`),children:[!h&&(0,Q.jsx)(qe,{open:k,onToggle:()=>A(e=>!e),onReact:q}),F.map(e=>(0,Q.jsxs)(`button`,{type:`button`,title:e.actors.join(`, `),onClick:()=>q(e.emoji),className:t(`inline-flex h-5 items-center gap-0.5 rounded-full border px-1.5 text-[11px] shadow-sm transition-colors`,e.mine?`border-primary/40 bg-primary/10 text-primary`:`border-border bg-background hover:bg-muted text-foreground`),children:[(0,Q.jsx)(`span`,{children:e.emoji}),e.count>1&&(0,Q.jsx)(`span`,{children:e.count})]},e.emoji))]}),!w(e)&&!h&&F.length===0&&(0,Q.jsx)(`div`,{className:`absolute -bottom-2.5 left-1 z-20`,children:(0,Q.jsx)(qe,{open:k,onToggle:()=>A(e=>!e),onReact:q})})]}),h&&Z&&(0,Q.jsx)(`span`,{className:`shrink-0 self-end opacity-60`,children:(0,Q.jsx)(ce,{user:D,address:e.from,distinct:E})})]})});export{pe as a,xe as i,Be as n,X as o,De as r,Ye as t};
|
|
4
|
-
//# sourceMappingURL=MessageBubble-
|
|
4
|
+
//# sourceMappingURL=MessageBubble-BOkmEvgZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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{Ct as i,St as a,d as o,f as s,p as c,t as l}from"./store-DcClXLH0.js";import"./provider-display-DsuWMvVL.js";import{ct as u,et as d,h as f,v as p,vt as m}from"./display-BrKWFGJz.js";import{t as h}from"./api-CIIVBtAV.js";import{i as ee,n as g,r as _,t as v}from"./list-todo-9qT0fgxZ.js";import{t as y}from"./archive-CIuPSvmx.js";import{t as b}from"./check-B3M9Ug1P.js";import{t as x}from"./chevron-down-BoG3JCZn.js";import{t as S}from"./chevron-up-Bv3yC5ma.js";import{t as C}from"./issue-ref-chip-BnSlM_95.js";import{t as w}from"./circle-UESLMi2-.js";import{t as te}from"./git-branch-yxhV0m8E.js";import{r as T}from"./workflow-marker-DAZcj5qt.js";import{t as E}from"./x-Bge17hWJ.js";import{t as D}from"./task-chip-CYj0mpoL.js";import{t as O}from"./agent-name-DKbiIhBo.js";var k=[`reserved`,`running`,`escalated`,`ci-blocked`];function A(e){return k.includes(e)}var j=e(n(),1);function M(e){if(typeof window>`u`)return()=>{};let t=window.matchMedia(m);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function N(){return(0,j.useSyncExternalStore)(M,()=>typeof window<`u`&&window.matchMedia(m).matches,()=>!1)}var P=r(),F={open:{label:`open`,className:`border-border bg-muted/40 text-muted-foreground`},"conformance-pending":{label:`conformance pending`,className:`border-tone-warning/40 bg-tone-warning/10 text-tone-warning-fg`},done:{label:`done`,className:`border-tone-success/40 bg-tone-success/10 text-tone-success-fg`}};function I({completion:e}){let n=F[e];return(0,P.jsx)(`span`,{className:t(`shrink-0 rounded border px-1.5 py-0.5 text-[10px] font-medium`,n.className),children:n.label})}function ne({plan:e,onArchive:t}){let n=e.nodes.length;if(!n||e.nodes.some(e=>e.status!==`landed`))return null;let r=`${n} node${n===1?``:`s`}`;return e.completion===`conformance-pending`?(0,P.jsxs)(`div`,{role:`status`,className:`mb-2 rounded-md border border-tone-warning/30 bg-tone-warning/10 px-2.5 py-1.5 text-[11px] text-tone-warning-fg`,children:[`All `,r,` landed — conformance pending. The plan is not done until its acceptance check passes.`]}):e.completion&&e.completion!==`done`?null:(0,P.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md border border-tone-success/30 bg-tone-success/10 px-2.5 py-1.5`,children:[(0,P.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-tone-success-fg`,children:[e.completion===`done`?`Acceptance passed`:`All ${r} landed`,` — archive this plan?`]}),(0,P.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 rounded border border-tone-success/40 bg-tone-success/15 px-2 py-0.5 text-[10px] font-medium text-tone-success-fg hover:bg-tone-success/20 hover:text-tone-success-fg`,children:`Archive plan`})]})}function L({check:e}){let t=`command`in e;return(0,P.jsx)(`code`,{className:`block max-w-full truncate rounded-sm bg-muted/60 px-1 py-px font-mono text-[10px] text-muted-foreground`,title:t?e.command:e.path,children:t?`$ ${e.command}`:e.path})}function re({plan:e}){let n=e.acceptance??[];if(!n.length)return null;let r=e.conformance,i=r?r.planVersion!==e.version:!1,a=new Map(r?.items.map(e=>[e.id,e])??[]),o=n.filter(e=>a.get(e.id)?.status===`met`).length;return(0,P.jsxs)(`section`,{"aria-label":`Plan acceptance`,className:`mt-2 rounded-md border border-border bg-background/60 px-2.5 py-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1.5 flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Acceptance`}),(0,P.jsx)(`span`,{className:`text-[10px] tabular-nums text-muted-foreground`,children:r?`${o}/${n.length} met`:`${n.length} item${n.length===1?``:`s`} · not checked yet`})]}),r&&(0,P.jsxs)(`div`,{className:`mb-1.5 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[10px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{children:`Last verdict`}),(0,P.jsx)(`span`,{className:t(`rounded-sm px-1 py-px font-semibold uppercase tracking-wide`,r.verdict===`pass`?`bg-tone-success/15 text-tone-success-fg`:`bg-tone-danger/15 text-tone-danger-fg`),children:r.verdict}),(0,P.jsxs)(`span`,{children:[`on main `,(0,P.jsx)(`code`,{className:`font-mono`,children:r.mainSha.slice(0,9)})]}),(0,P.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`by `,r.by]}),(0,P.jsx)(`span`,{title:p(r.at),children:d(Date.now(),r.at)}),i&&(0,P.jsxs)(`span`,{className:`rounded-sm bg-tone-warning/15 px-1 py-px text-tone-warning-fg`,title:`The plan changed after this verdict; a new check is needed.`,children:[`stale · v`,r.planVersion,`, plan now v`,e.version]})]}),(0,P.jsx)(`ul`,{className:`max-h-48 space-y-1 overflow-auto`,children:n.map(e=>{let n=a.get(e.id);return(0,P.jsxs)(`li`,{className:t(`flex min-w-0 gap-1.5`,i&&`opacity-70`),children:[(0,P.jsx)(`span`,{className:`mt-px shrink-0`,"aria-label":n?.status??`not checked`,children:n?.status===`met`?(0,P.jsx)(b,{className:`h-3.5 w-3.5 text-tone-success-fg`}):n?.status===`unmet`?(0,P.jsx)(E,{className:`h-3.5 w-3.5 text-tone-danger-fg`}):(0,P.jsx)(w,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,P.jsxs)(`div`,{className:`text-[11px] leading-snug text-foreground`,children:[(0,P.jsx)(`span`,{className:`mr-1.5 font-mono text-[10px] text-muted-foreground`,children:e.id}),e.text]}),e.check&&(0,P.jsx)(L,{check:e.check}),n?.note&&(0,P.jsx)(`div`,{className:`text-[10px] leading-snug text-muted-foreground`,children:n.note})]})]},e.id)})})]})}function ie({listId:e,plans:n,shownId:r,open:i,onToggle:a}){let o=n.findIndex(e=>e.id===r)+1;return(0,P.jsxs)(`button`,{type:`button`,onClick:a,"aria-expanded":i,"aria-controls":e,"aria-label":`Switch plan (${n.length} active)`,title:`${n.length} active plans`,className:t(`flex h-6 shrink-0 items-center gap-0.5 rounded border border-border px-1.5 text-[10px] font-medium tabular-nums`,`text-muted-foreground hover:bg-muted/60 hover:text-foreground`,i&&`bg-muted/60 text-foreground`),children:[o>0?`${o}/${n.length}`:n.length,(0,P.jsx)(_,{className:`h-3 w-3`})]})}function R({listId:e,plans:n,shownId:r,onChoose:a,className:o}){let s=i();return(0,P.jsx)(`ul`,{id:e,"aria-label":`Active plans`,className:t(`overflow-hidden rounded-md border border-border bg-background/95`,o),children:n.map(e=>{let n=e.id===r,i=`${e.nodeCount} node${e.nodeCount===1?``:`s`}`;return(0,P.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),"aria-current":n?`true`:void 0,className:t(`flex min-h-11 w-full min-w-0 items-center gap-2 px-2.5 py-1.5 text-left sm:min-h-0`,n?`bg-muted/50`:`hover:bg-muted/40`),children:[(0,P.jsx)(b,{className:t(`h-3.5 w-3.5 shrink-0 text-foreground`,!n&&`invisible`),"aria-hidden":`true`}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-[12px] font-medium leading-tight text-foreground`,children:e.title||`Untitled plan`}),(0,P.jsxs)(`span`,{className:`block truncate text-[10px] leading-tight text-muted-foreground`,children:[i,` · updated `,d(s,e.updatedAt)]})]}),e.completion&&(0,P.jsx)(I,{completion:e.completion})]})},e.id)})})}function z(e){return new Map((e.dispatch?.slots??[]).flatMap(e=>e.runId?[[e.taskId,e.runId]]:[]))}function B({runId:e,label:n,className:r}){let i=l(e=>e.showWorkflowRun);return(0,P.jsxs)(`button`,{type:`button`,onClick:()=>void i(e),title:`Open workflow run ${e}`,"aria-label":`Open workflow run ${e}`,className:t(`wf-marker inline-flex min-w-0 items-center gap-0.5 rounded-sm border border-border/70 px-1 py-px text-[9px] font-medium text-muted-foreground hover:text-foreground`,r),children:[(0,P.jsx)(T,{className:`h-2.5 w-2.5 shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:n??e})]})}function ae({plan:e}){let t=e.dispatch;if(!t)return null;let n=t.slots.filter(e=>A(e.status)).length;return(0,P.jsxs)(`div`,{"data-testid":`plan-dispatch`,className:`mb-2 flex flex-wrap items-center gap-1.5 text-[10px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`Autopilot `,t.state]}),(0,P.jsxs)(`span`,{children:[n,`/`,t.concurrency,` running`]}),t.slots.filter(e=>e.ciBlock).map(e=>(0,P.jsxs)(`span`,{className:`text-tone-warning-fg`,title:e.ciBlock.sha,children:[`T`,e.taskId,` CI blocked · `,e.ciBlock.sha.slice(0,12),` · `,e.ciBlock.incidentIds.join(`, `),` · `,e.ciBlock.retriedAt===void 0?`retry on clearance`:`exact SHA retried; awaiting pass`]},e.taskId)),t.audit&&(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[`audit T`,t.audit.taskId,t.audit.verdict?` · ${t.audit.verdict}`:``,t.audit.runId&&(0,P.jsx)(B,{runId:t.audit.runId,label:`audit run`})]})]})}var V=4,H={satisfied:`text-tone-success-fg`,waiting:`text-tone-warning-fg`,unreachable:`text-tone-danger-fg`};function U(e){return e.verdict.state===`unreachable`?`unreachable · ${e.verdict.reason}`:e.verdict.state}function W({entry:e,now:n,nodeLabels:r}){let i=l(e=>e.openTaskDetailById),a=e.waitingSince===void 0?``:f(n,e.waitingSince);return(0,P.jsxs)(`li`,{"data-testid":`plan-external`,"data-verdict":e.verdict.state,title:e.projectId?`Project ${e.projectId}`:void 0,className:`min-w-0 rounded-md border border-dashed border-border bg-background/60 px-2 py-1.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>i(e.taskId),className:`flex w-full min-w-0 items-baseline gap-1.5 text-left`,title:`Open T${e.taskId}`,children:[(0,P.jsxs)(`span`,{className:`shrink-0 text-[11px] font-semibold tabular-nums text-foreground`,children:[`T`,e.taskId]}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-muted-foreground`,children:e.title??`title hidden`})]}),(0,P.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-[10px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:t(`font-medium`,H[e.verdict.state]),children:U(e)}),(0,P.jsxs)(`span`,{children:[`stage `,e.stage]}),(0,P.jsxs)(`span`,{children:[`needs `,e.requiredStage]}),a&&(0,P.jsxs)(`span`,{title:`How long this plan has waited on it`,children:[`waiting `,a]}),(0,P.jsxs)(`span`,{className:`truncate`,children:[`→ `,e.dependents.map(e=>r.get(e)??e).join(`, `)]})]})]})}function G({plan:e}){let[t,n]=(0,j.useState)(!1),r=a(e=>e.now),i=e.external;if(!i?.length)return null;let o=e.externalCount??i.length,s=t?i:i.slice(0,V),c=new Map(e.nodes.map(e=>[e.id,e.label])),l=i.length-s.length,u=o-i.length;return(0,P.jsxs)(`div`,{"data-testid":`plan-externals`,className:`mb-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,P.jsx)(g,{className:`h-3 w-3`}),(0,P.jsxs)(`span`,{children:[`Waits on other work (`,o,`)`]})]}),(0,P.jsx)(`ul`,{className:`grid gap-1.5 sm:grid-cols-2`,children:s.map(e=>(0,P.jsx)(W,{entry:e,now:r,nodeLabels:c},e.taskId))}),(l>0||t&&i.length>V||u>0)&&(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(l>0||t)&&i.length>V&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`rounded border border-border bg-muted/30 px-1.5 py-0.5 font-medium hover:bg-muted/50 hover:text-foreground`,children:t?`Show fewer`:`+ ${l} more`}),u>0&&(0,P.jsxs)(`span`,{children:[u,` more not listed`]})]})]})}var K=196,q=84,J=52,Y=16,X=14,Z=[`landed`,`in-progress`,`pending`,`blocked`],Q={landed:{label:`landed`,dot:`bg-tone-success`,accent:`border-l-tone-success`,text:`text-tone-success-fg`,wire:`#34d399`},"in-progress":{label:`in progress`,dot:`bg-tone-sky`,accent:`border-l-tone-sky`,text:`text-tone-sky-fg`,wire:`#38bdf8`},pending:{label:`pending`,dot:`bg-tone-warning`,accent:`border-l-tone-warning`,text:`text-tone-warning-fg`,wire:`#fbbf24`},blocked:{label:`blocked`,dot:`bg-tone-danger`,accent:`border-l-tone-danger`,text:`text-tone-danger-fg`,wire:`#f87171`}},oe=new Set([...u,`completed`]);function $(e){return oe.has(e.status)}function se(e,t){return t?e:e.filter(e=>!$(e))}function ce(e){return e?e.label||(e.policyName?`policy:${e.policyName}`:e.agentId||``):``}function le({owner:e}){let t=l(t=>e?.agentId?t.agentsById[e.agentId]:void 0),n=ce(e);return!t&&!n?null:(0,P.jsx)(O,{agent:t,fallback:n,className:`text-[10px] text-muted-foreground`})}function ue(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=new Map(e.nodes.map((e,t)=>[e.id,t])),r=new Map,i=new Map(e.nodes.map(e=>[e.id,0]));for(let n of e.edges)!t.has(n.from)||!t.has(n.to)||(r.set(n.from,[...r.get(n.from)??[],n.to]),i.set(n.to,(i.get(n.to)??0)+1));let a=new Map(e.nodes.map(e=>[e.id,0])),o=e.nodes.filter(e=>(i.get(e.id)??0)===0).map(e=>e.id),s=new Set;for(;o.length;){let e=o.shift();s.add(e);let t=a.get(e)??0;for(let n of r.get(e)??[])a.set(n,Math.max(a.get(n)??0,t+1)),i.set(n,(i.get(n)??0)-1),(i.get(n)??0)===0&&o.push(n)}let c=Math.max(0,...Array.from(a.values()))+1;for(let t of e.nodes)s.has(t.id)||a.set(t.id,c++);let l=new Map;for(let t of e.nodes){let e=a.get(t.id)??0;l.set(e,[...l.get(e)??[],t])}let u=[...l.entries()].sort(([e],[t])=>e-t),d=Math.max(1,...u.map(([,e])=>e.length)),f=[];u.forEach(([e,t],r)=>{let i=[...t].sort((e,t)=>(e.lane||``).localeCompare(t.lane||``)||(n.get(e.id)??0)-(n.get(t.id)??0)),a=(d-i.length)*100/2;i.forEach((t,n)=>{f.push({node:t,layer:e,x:X+r*248,y:X+a+n*100})})});let p=u.length;return{nodes:f,width:Math.max(320,X*2+p*K+Math.max(0,p-1)*J),height:Math.max(112,X*2+d*q+Math.max(0,d-1)*Y)}}function de(e,t){let n=e.x+K,r=e.y+q/2,i=t.x,a=t.y+q/2,o=n+Math.max(20,(i-n)/2);return`M ${n} ${r} C ${o} ${r}, ${o} ${a}, ${i} ${a}`}function fe({threadId:e,teamId:n,channel:r}){let i=n?s(n,r):e?o(e,r):``,a=l(e=>n?c(e,i):i?e.plansByThread[i]:null),u=l(e=>n?e.planListsByTeam[i]?.plans:void 0),d=l(e=>e.fetchPlan),f=l(e=>e.fetchTeamPlanList),p=l(e=>e.chooseTeamPlan),[m,h]=(0,j.useState)(!1),g=(0,j.useId)(),_=l(e=>e.setPlanArchived),v=l(e=>e.planCollapsed),b=l(e=>e.setPlanCollapsed),w=l(e=>e.issueRefsById),T=l(e=>e.deliverableTasks),E=l(e=>e.openTaskDetailById),O=N(),[k,A]=(0,j.useState)(!1),M=v??O;(0,j.useEffect)(()=>{if(n){d({teamId:n,channel:r}),f({teamId:n,channel:r});return}e&&d({threadId:e,channel:r})},[r,d,f,n,e]);let F=(0,j.useMemo)(()=>a?ue(a):null,[a]),L=(0,j.useMemo)(()=>a?z(a):new Map,[a]),V=(0,j.useMemo)(()=>new Map(F?.nodes.map(e=>[e.node.id,e])??[]),[F]),H=(0,j.useMemo)(()=>{if(!a)return[];let e=new Map;for(let t of a.nodes)e.set(t.status,(e.get(t.status)??0)+1);return Z.filter(t=>e.has(t)).map(t=>({status:t,count:e.get(t)??0}))},[a]);if(!a||!F)return null;if(a.archived&&!k)return(0,P.jsx)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:(0,P.jsxs)(`button`,{type:`button`,onClick:()=>A(!0),className:`flex min-w-0 items-center gap-2 text-left text-muted-foreground hover:text-foreground`,"aria-expanded":`false`,children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(y,{className:`h-3 w-3`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-semibold uppercase tracking-wider`,children:`Show archived plan (1)`}),(0,P.jsx)(x,{className:`h-3.5 w-3.5 shrink-0`})]})});if(a.archived)return(0,P.jsx)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(y,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-muted-foreground`,children:a.title||`Plan`}),(0,P.jsx)(`div`,{className:`truncate text-[11px] leading-tight text-muted-foreground`,children:`Archived plan`})]}),(0,P.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-muted/40 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:`archived`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>A(!1),className:`shrink-0 rounded border border-border bg-muted/40 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground hover:bg-muted/60 hover:text-foreground`,"aria-expanded":`true`,children:`Hide`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void _(a.id,!1),title:`Unarchive plan`,"aria-label":`Unarchive plan`,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:(0,P.jsx)(ee,{className:`h-3.5 w-3.5`})})]})});let U=a.nodes.length,W=H.find(e=>e.status===`landed`)?.count??0,J=`${U} node${U===1?``:`s`}${W>0?` · ${W} landed`:``}`,Y=n&&u&&u.length>1?u:null,X=!!(Y&&m);return(0,P.jsxs)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:[(0,P.jsx)(ne,{plan:a,onArchive:()=>void _(a.id,!0)}),(0,P.jsx)(ae,{plan:a}),(0,P.jsxs)(`div`,{className:t(`flex min-w-0 items-center gap-2`,(!M||X)&&`mb-2`),children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>b(!M),"aria-expanded":!M,"aria-label":M?`Expand plan graph`:`Collapse plan graph`,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(te,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-foreground`,children:a.title||`Plan`}),(0,P.jsx)(`div`,{className:`truncate text-[11px] leading-tight text-muted-foreground`,children:M?J:a.objective||J})]})]}),H.length>0&&(0,P.jsx)(`div`,{className:`hidden shrink-0 items-center gap-2.5 sm:flex`,children:H.map(({status:e,count:n})=>(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,Q[e].dot)}),(0,P.jsx)(`span`,{className:t(`font-medium tabular-nums`,Q[e].text),children:n}),(0,P.jsx)(`span`,{children:Q[e].label})]},e))}),a.completion&&(0,P.jsx)(I,{completion:a.completion}),Y&&(0,P.jsx)(ie,{listId:g,plans:Y,shownId:a.id,open:m,onToggle:()=>h(!m)}),(0,P.jsxs)(`span`,{className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground`,children:[`v`,a.version]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void _(a.id,!0),title:`Archive plan`,"aria-label":`Archive plan`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:(0,P.jsx)(y,{className:`h-3.5 w-3.5`})}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>b(!M),"aria-expanded":!M,"aria-label":M?`Expand plan graph`:`Collapse plan graph`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:M?(0,P.jsx)(x,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`})})]}),Y&&X&&(0,P.jsx)(R,{listId:g,className:M?void 0:`mb-2`,plans:Y,shownId:a.id,onChoose:e=>{h(!1),p({teamId:n,channel:r},e)}}),!M&&(0,P.jsx)(G,{plan:a}),M?null:a.nodes.length===0?(0,P.jsx)(`div`,{className:`rounded-md border border-dashed border-border px-3 py-3 text-center text-xs text-muted-foreground`,children:`No nodes yet — the plan graph fills in as the team is composed.`}):(0,P.jsx)(`div`,{className:`max-h-[min(46vh,360px)] overflow-auto`,children:(0,P.jsxs)(`div`,{className:`relative`,style:{width:F.width,height:F.height},children:[(0,P.jsxs)(`svg`,{className:`pointer-events-none absolute inset-0`,width:F.width,height:F.height,"aria-hidden":`true`,children:[(0,P.jsx)(`defs`,{children:Z.map(e=>(0,P.jsx)(`marker`,{id:`plan-arrow-${e}`,viewBox:`0 0 8 8`,refX:`6.5`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,P.jsx)(`path`,{d:`M0 0 L8 4 L0 8 z`,fill:Q[e].wire})},e))}),a.edges.map(e=>{let t=V.get(e.from),n=V.get(e.to);if(!t||!n)return null;let r=Q[t.node.status];return(0,P.jsx)(`path`,{d:de(t,n),stroke:r.wire,strokeOpacity:.7,strokeWidth:2,fill:`none`,strokeLinecap:`round`,markerEnd:`url(#plan-arrow-${t.node.status})`},`${e.from}->${e.to}`)})]}),F.nodes.map(({node:e,x:n,y:r})=>{let i=Q[e.status],a=e.refs?.issueId?w[e.refs.issueId]:null,o=e.refs?.taskId?parseInt(e.refs.taskId,10):null,s=o==null?void 0:T.find(e=>e.id===o)?.title,c=o==null?void 0:L.get(o);return(0,P.jsxs)(`article`,{className:t(`group absolute flex flex-col justify-between rounded-md border border-l-[3px] bg-background/95 p-2`,`shadow-sm transition-all hover:-translate-y-px hover:border-border hover:shadow-md hover:bg-background`,i.accent),style:{left:n,top:r,width:K,height:q},title:e.scopeBlurb||e.label,children:[(0,P.jsx)(`div`,{className:`truncate text-xs font-semibold leading-tight text-foreground`,children:e.label}),(e.scopeBlurb||e.id)&&(0,P.jsx)(`div`,{className:`truncate text-[10px] leading-tight text-muted-foreground`,children:e.scopeBlurb||e.id}),(a||o!=null)&&(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-1`,children:[a&&(0,P.jsx)(C,{issueRef:a,compact:!0,className:`max-w-full`}),o!=null&&(0,P.jsx)(D,{id:o,title:s,onClick:()=>E(o),className:`max-w-full`}),c&&(0,P.jsx)(B,{runId:c,label:`run`})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-1.5`,children:[(0,P.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:t(`h-1.5 w-1.5 shrink-0 rounded-full`,i.dot)}),(0,P.jsx)(`span`,{className:t(`text-[10px] font-medium`,i.text),children:i.label})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,P.jsx)(le,{owner:e.ownerRef}),e.lane&&(0,P.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted/70 px-1 py-px text-[9px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.lane})]})]})]},e.id)})]})}),!M&&(0,P.jsx)(re,{plan:a})]})}function pe({agentId:e}){let n=l(e=>e.openTaskDetailById),r=l(e=>e.sessionTasksCollapsed),i=l(e=>e.setSessionTasksCollapsed),a=l(e=>e.deliverableTasks),[o,s]=(0,j.useState)([]),[c,u]=(0,j.useState)(!1);(0,j.useEffect)(()=>{let t=!1;return h(`GET`,`/task-entities?createdBy=`+encodeURIComponent(e)+`&limit=500`).then(e=>{t||s(e)}).catch(()=>{}),()=>{t=!0}},[e]);let d=new Map(o.map(e=>[e.id,e]));for(let t of a)t.createdBy===e&&(!d.has(t.id)||Number(t.updatedAt)>=Number(d.get(t.id).updatedAt))&&d.set(t.id,t);let f=[...d.values()];if(f.length===0)return null;let p=f.filter($).length,m=se(f,c);return(0,P.jsxs)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":!r,"aria-label":r?`Expand session tasks`:`Collapse session tasks`,className:t(`flex w-full min-w-0 items-center gap-2 text-left`,!r&&`mb-1.5`),children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(v,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`span`,{className:`flex-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:[`Tasks from this session (`,m.length,`)`]}),(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:r?(0,P.jsx)(x,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`})})]}),!r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(me,{tasks:m,onOpen:n}),p>0&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>u(!c),className:`mt-1.5 rounded border border-border bg-muted/30 px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground`,"aria-pressed":c,children:c?`Hide ${p} closed`:`+ ${p} closed`})]})]})}function me({tasks:e,onOpen:t}){return(0,P.jsx)(`div`,{className:`space-y-2`,children:[{label:`In progress`,tasks:e.filter(e=>e.status===`in_progress`||e.status===`claimed`)},{label:`Needs validation`,tasks:e.filter(e=>e.status===`validating`)},{label:`Waiting`,tasks:e.filter(e=>![`in_progress`,`claimed`,`validating`].includes(e.status)&&!$(e))},{label:`Closed`,tasks:e.filter($)}].filter(e=>e.tasks.length).map(e=>(0,P.jsxs)(`section`,{"aria-label":e.label,children:[(0,P.jsxs)(`h3`,{className:`mb-1 text-[10px] text-muted-foreground`,children:[e.label,` (`,e.tasks.length,`)`]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tasks.map(e=>(0,P.jsx)(D,{id:e.id,title:e.title,status:e.status,onClick:()=>t(e.id),compact:!0},e.id))})]},e.label))})}export{pe as n,N as r,fe as t};
|
|
2
|
-
//# sourceMappingURL=PlanGraphPanel-
|
|
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{Ct as i,St as a,d as o,f as s,p as c,t as l}from"./store-BgDALGIX.js";import"./provider-display-bWwiuedV.js";import{ct as u,et as d,h as f,v as p,vt as m}from"./display-BemJG1f_.js";import{t as h}from"./api-CIIVBtAV.js";import{i as ee,n as g,r as _,t as v}from"./list-todo-9qT0fgxZ.js";import{t as y}from"./archive-CIuPSvmx.js";import{t as b}from"./check-B3M9Ug1P.js";import{t as x}from"./chevron-down-BoG3JCZn.js";import{t as S}from"./chevron-up-Bv3yC5ma.js";import{t as C}from"./issue-ref-chip-DbH8J9Ak.js";import{t as w}from"./circle-UESLMi2-.js";import{t as te}from"./git-branch-yxhV0m8E.js";import{r as T}from"./workflow-marker-CzOsB8BM.js";import{t as E}from"./x-Bge17hWJ.js";import{t as D}from"./task-chip-CYj0mpoL.js";import{t as O}from"./agent-name-C_7F4DFR.js";var k=[`reserved`,`running`,`escalated`,`ci-blocked`];function A(e){return k.includes(e)}var j=e(n(),1);function M(e){if(typeof window>`u`)return()=>{};let t=window.matchMedia(m);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function N(){return(0,j.useSyncExternalStore)(M,()=>typeof window<`u`&&window.matchMedia(m).matches,()=>!1)}var P=r(),F={open:{label:`open`,className:`border-border bg-muted/40 text-muted-foreground`},"conformance-pending":{label:`conformance pending`,className:`border-tone-warning/40 bg-tone-warning/10 text-tone-warning-fg`},done:{label:`done`,className:`border-tone-success/40 bg-tone-success/10 text-tone-success-fg`}};function I({completion:e}){let n=F[e];return(0,P.jsx)(`span`,{className:t(`shrink-0 rounded border px-1.5 py-0.5 text-[10px] font-medium`,n.className),children:n.label})}function ne({plan:e,onArchive:t}){let n=e.nodes.length;if(!n||e.nodes.some(e=>e.status!==`landed`))return null;let r=`${n} node${n===1?``:`s`}`;return e.completion===`conformance-pending`?(0,P.jsxs)(`div`,{role:`status`,className:`mb-2 rounded-md border border-tone-warning/30 bg-tone-warning/10 px-2.5 py-1.5 text-[11px] text-tone-warning-fg`,children:[`All `,r,` landed — conformance pending. The plan is not done until its acceptance check passes.`]}):e.completion&&e.completion!==`done`?null:(0,P.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-md border border-tone-success/30 bg-tone-success/10 px-2.5 py-1.5`,children:[(0,P.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-tone-success-fg`,children:[e.completion===`done`?`Acceptance passed`:`All ${r} landed`,` — archive this plan?`]}),(0,P.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 rounded border border-tone-success/40 bg-tone-success/15 px-2 py-0.5 text-[10px] font-medium text-tone-success-fg hover:bg-tone-success/20 hover:text-tone-success-fg`,children:`Archive plan`})]})}function L({check:e}){let t=`command`in e;return(0,P.jsx)(`code`,{className:`block max-w-full truncate rounded-sm bg-muted/60 px-1 py-px font-mono text-[10px] text-muted-foreground`,title:t?e.command:e.path,children:t?`$ ${e.command}`:e.path})}function re({plan:e}){let n=e.acceptance??[];if(!n.length)return null;let r=e.conformance,i=r?r.planVersion!==e.version:!1,a=new Map(r?.items.map(e=>[e.id,e])??[]),o=n.filter(e=>a.get(e.id)?.status===`met`).length;return(0,P.jsxs)(`section`,{"aria-label":`Plan acceptance`,className:`mt-2 rounded-md border border-border bg-background/60 px-2.5 py-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1.5 flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,P.jsx)(`h3`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Acceptance`}),(0,P.jsx)(`span`,{className:`text-[10px] tabular-nums text-muted-foreground`,children:r?`${o}/${n.length} met`:`${n.length} item${n.length===1?``:`s`} · not checked yet`})]}),r&&(0,P.jsxs)(`div`,{className:`mb-1.5 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[10px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{children:`Last verdict`}),(0,P.jsx)(`span`,{className:t(`rounded-sm px-1 py-px font-semibold uppercase tracking-wide`,r.verdict===`pass`?`bg-tone-success/15 text-tone-success-fg`:`bg-tone-danger/15 text-tone-danger-fg`),children:r.verdict}),(0,P.jsxs)(`span`,{children:[`on main `,(0,P.jsx)(`code`,{className:`font-mono`,children:r.mainSha.slice(0,9)})]}),(0,P.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`by `,r.by]}),(0,P.jsx)(`span`,{title:p(r.at),children:d(Date.now(),r.at)}),i&&(0,P.jsxs)(`span`,{className:`rounded-sm bg-tone-warning/15 px-1 py-px text-tone-warning-fg`,title:`The plan changed after this verdict; a new check is needed.`,children:[`stale · v`,r.planVersion,`, plan now v`,e.version]})]}),(0,P.jsx)(`ul`,{className:`max-h-48 space-y-1 overflow-auto`,children:n.map(e=>{let n=a.get(e.id);return(0,P.jsxs)(`li`,{className:t(`flex min-w-0 gap-1.5`,i&&`opacity-70`),children:[(0,P.jsx)(`span`,{className:`mt-px shrink-0`,"aria-label":n?.status??`not checked`,children:n?.status===`met`?(0,P.jsx)(b,{className:`h-3.5 w-3.5 text-tone-success-fg`}):n?.status===`unmet`?(0,P.jsx)(E,{className:`h-3.5 w-3.5 text-tone-danger-fg`}):(0,P.jsx)(w,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,P.jsxs)(`div`,{className:`text-[11px] leading-snug text-foreground`,children:[(0,P.jsx)(`span`,{className:`mr-1.5 font-mono text-[10px] text-muted-foreground`,children:e.id}),e.text]}),e.check&&(0,P.jsx)(L,{check:e.check}),n?.note&&(0,P.jsx)(`div`,{className:`text-[10px] leading-snug text-muted-foreground`,children:n.note})]})]},e.id)})})]})}function ie({listId:e,plans:n,shownId:r,open:i,onToggle:a}){let o=n.findIndex(e=>e.id===r)+1;return(0,P.jsxs)(`button`,{type:`button`,onClick:a,"aria-expanded":i,"aria-controls":e,"aria-label":`Switch plan (${n.length} active)`,title:`${n.length} active plans`,className:t(`flex h-6 shrink-0 items-center gap-0.5 rounded border border-border px-1.5 text-[10px] font-medium tabular-nums`,`text-muted-foreground hover:bg-muted/60 hover:text-foreground`,i&&`bg-muted/60 text-foreground`),children:[o>0?`${o}/${n.length}`:n.length,(0,P.jsx)(_,{className:`h-3 w-3`})]})}function R({listId:e,plans:n,shownId:r,onChoose:a,className:o}){let s=i();return(0,P.jsx)(`ul`,{id:e,"aria-label":`Active plans`,className:t(`overflow-hidden rounded-md border border-border bg-background/95`,o),children:n.map(e=>{let n=e.id===r,i=`${e.nodeCount} node${e.nodeCount===1?``:`s`}`;return(0,P.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),"aria-current":n?`true`:void 0,className:t(`flex min-h-11 w-full min-w-0 items-center gap-2 px-2.5 py-1.5 text-left sm:min-h-0`,n?`bg-muted/50`:`hover:bg-muted/40`),children:[(0,P.jsx)(b,{className:t(`h-3.5 w-3.5 shrink-0 text-foreground`,!n&&`invisible`),"aria-hidden":`true`}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-[12px] font-medium leading-tight text-foreground`,children:e.title||`Untitled plan`}),(0,P.jsxs)(`span`,{className:`block truncate text-[10px] leading-tight text-muted-foreground`,children:[i,` · updated `,d(s,e.updatedAt)]})]}),e.completion&&(0,P.jsx)(I,{completion:e.completion})]})},e.id)})})}function z(e){return new Map((e.dispatch?.slots??[]).flatMap(e=>e.runId?[[e.taskId,e.runId]]:[]))}function B({runId:e,label:n,className:r}){let i=l(e=>e.showWorkflowRun);return(0,P.jsxs)(`button`,{type:`button`,onClick:()=>void i(e),title:`Open workflow run ${e}`,"aria-label":`Open workflow run ${e}`,className:t(`wf-marker inline-flex min-w-0 items-center gap-0.5 rounded-sm border border-border/70 px-1 py-px text-[9px] font-medium text-muted-foreground hover:text-foreground`,r),children:[(0,P.jsx)(T,{className:`h-2.5 w-2.5 shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:n??e})]})}function ae({plan:e}){let t=e.dispatch;if(!t)return null;let n=t.slots.filter(e=>A(e.status)).length;return(0,P.jsxs)(`div`,{"data-testid":`plan-dispatch`,className:`mb-2 flex flex-wrap items-center gap-1.5 text-[10px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{className:`font-medium text-foreground`,children:[`Autopilot `,t.state]}),(0,P.jsxs)(`span`,{children:[n,`/`,t.concurrency,` running`]}),t.slots.filter(e=>e.ciBlock).map(e=>(0,P.jsxs)(`span`,{className:`text-tone-warning-fg`,title:e.ciBlock.sha,children:[`T`,e.taskId,` CI blocked · `,e.ciBlock.sha.slice(0,12),` · `,e.ciBlock.incidentIds.join(`, `),` · `,e.ciBlock.retriedAt===void 0?`retry on clearance`:`exact SHA retried; awaiting pass`]},e.taskId)),t.audit&&(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[`audit T`,t.audit.taskId,t.audit.verdict?` · ${t.audit.verdict}`:``,t.audit.runId&&(0,P.jsx)(B,{runId:t.audit.runId,label:`audit run`})]})]})}var V=4,H={satisfied:`text-tone-success-fg`,waiting:`text-tone-warning-fg`,unreachable:`text-tone-danger-fg`};function U(e){return e.verdict.state===`unreachable`?`unreachable · ${e.verdict.reason}`:e.verdict.state}function W({entry:e,now:n,nodeLabels:r}){let i=l(e=>e.openTaskDetailById),a=e.waitingSince===void 0?``:f(n,e.waitingSince);return(0,P.jsxs)(`li`,{"data-testid":`plan-external`,"data-verdict":e.verdict.state,title:e.projectId?`Project ${e.projectId}`:void 0,className:`min-w-0 rounded-md border border-dashed border-border bg-background/60 px-2 py-1.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>i(e.taskId),className:`flex w-full min-w-0 items-baseline gap-1.5 text-left`,title:`Open T${e.taskId}`,children:[(0,P.jsxs)(`span`,{className:`shrink-0 text-[11px] font-semibold tabular-nums text-foreground`,children:[`T`,e.taskId]}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-muted-foreground`,children:e.title??`title hidden`})]}),(0,P.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-[10px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:t(`font-medium`,H[e.verdict.state]),children:U(e)}),(0,P.jsxs)(`span`,{children:[`stage `,e.stage]}),(0,P.jsxs)(`span`,{children:[`needs `,e.requiredStage]}),a&&(0,P.jsxs)(`span`,{title:`How long this plan has waited on it`,children:[`waiting `,a]}),(0,P.jsxs)(`span`,{className:`truncate`,children:[`→ `,e.dependents.map(e=>r.get(e)??e).join(`, `)]})]})]})}function G({plan:e}){let[t,n]=(0,j.useState)(!1),r=a(e=>e.now),i=e.external;if(!i?.length)return null;let o=e.externalCount??i.length,s=t?i:i.slice(0,V),c=new Map(e.nodes.map(e=>[e.id,e.label])),l=i.length-s.length,u=o-i.length;return(0,P.jsxs)(`div`,{"data-testid":`plan-externals`,className:`mb-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,P.jsx)(g,{className:`h-3 w-3`}),(0,P.jsxs)(`span`,{children:[`Waits on other work (`,o,`)`]})]}),(0,P.jsx)(`ul`,{className:`grid gap-1.5 sm:grid-cols-2`,children:s.map(e=>(0,P.jsx)(W,{entry:e,now:r,nodeLabels:c},e.taskId))}),(l>0||t&&i.length>V||u>0)&&(0,P.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(l>0||t)&&i.length>V&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`rounded border border-border bg-muted/30 px-1.5 py-0.5 font-medium hover:bg-muted/50 hover:text-foreground`,children:t?`Show fewer`:`+ ${l} more`}),u>0&&(0,P.jsxs)(`span`,{children:[u,` more not listed`]})]})]})}var K=196,q=84,J=52,Y=16,X=14,Z=[`landed`,`in-progress`,`pending`,`blocked`],Q={landed:{label:`landed`,dot:`bg-tone-success`,accent:`border-l-tone-success`,text:`text-tone-success-fg`,wire:`#34d399`},"in-progress":{label:`in progress`,dot:`bg-tone-sky`,accent:`border-l-tone-sky`,text:`text-tone-sky-fg`,wire:`#38bdf8`},pending:{label:`pending`,dot:`bg-tone-warning`,accent:`border-l-tone-warning`,text:`text-tone-warning-fg`,wire:`#fbbf24`},blocked:{label:`blocked`,dot:`bg-tone-danger`,accent:`border-l-tone-danger`,text:`text-tone-danger-fg`,wire:`#f87171`}},oe=new Set([...u,`completed`]);function $(e){return oe.has(e.status)}function se(e,t){return t?e:e.filter(e=>!$(e))}function ce(e){return e?e.label||(e.policyName?`policy:${e.policyName}`:e.agentId||``):``}function le({owner:e}){let t=l(t=>e?.agentId?t.agentsById[e.agentId]:void 0),n=ce(e);return!t&&!n?null:(0,P.jsx)(O,{agent:t,fallback:n,className:`text-[10px] text-muted-foreground`})}function ue(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=new Map(e.nodes.map((e,t)=>[e.id,t])),r=new Map,i=new Map(e.nodes.map(e=>[e.id,0]));for(let n of e.edges)!t.has(n.from)||!t.has(n.to)||(r.set(n.from,[...r.get(n.from)??[],n.to]),i.set(n.to,(i.get(n.to)??0)+1));let a=new Map(e.nodes.map(e=>[e.id,0])),o=e.nodes.filter(e=>(i.get(e.id)??0)===0).map(e=>e.id),s=new Set;for(;o.length;){let e=o.shift();s.add(e);let t=a.get(e)??0;for(let n of r.get(e)??[])a.set(n,Math.max(a.get(n)??0,t+1)),i.set(n,(i.get(n)??0)-1),(i.get(n)??0)===0&&o.push(n)}let c=Math.max(0,...Array.from(a.values()))+1;for(let t of e.nodes)s.has(t.id)||a.set(t.id,c++);let l=new Map;for(let t of e.nodes){let e=a.get(t.id)??0;l.set(e,[...l.get(e)??[],t])}let u=[...l.entries()].sort(([e],[t])=>e-t),d=Math.max(1,...u.map(([,e])=>e.length)),f=[];u.forEach(([e,t],r)=>{let i=[...t].sort((e,t)=>(e.lane||``).localeCompare(t.lane||``)||(n.get(e.id)??0)-(n.get(t.id)??0)),a=(d-i.length)*100/2;i.forEach((t,n)=>{f.push({node:t,layer:e,x:X+r*248,y:X+a+n*100})})});let p=u.length;return{nodes:f,width:Math.max(320,X*2+p*K+Math.max(0,p-1)*J),height:Math.max(112,X*2+d*q+Math.max(0,d-1)*Y)}}function de(e,t){let n=e.x+K,r=e.y+q/2,i=t.x,a=t.y+q/2,o=n+Math.max(20,(i-n)/2);return`M ${n} ${r} C ${o} ${r}, ${o} ${a}, ${i} ${a}`}function fe({threadId:e,teamId:n,channel:r}){let i=n?s(n,r):e?o(e,r):``,a=l(e=>n?c(e,i):i?e.plansByThread[i]:null),u=l(e=>n?e.planListsByTeam[i]?.plans:void 0),d=l(e=>e.fetchPlan),f=l(e=>e.fetchTeamPlanList),p=l(e=>e.chooseTeamPlan),[m,h]=(0,j.useState)(!1),g=(0,j.useId)(),_=l(e=>e.setPlanArchived),v=l(e=>e.planCollapsed),b=l(e=>e.setPlanCollapsed),w=l(e=>e.issueRefsById),T=l(e=>e.deliverableTasks),E=l(e=>e.openTaskDetailById),O=N(),[k,A]=(0,j.useState)(!1),M=v??O;(0,j.useEffect)(()=>{if(n){d({teamId:n,channel:r}),f({teamId:n,channel:r});return}e&&d({threadId:e,channel:r})},[r,d,f,n,e]);let F=(0,j.useMemo)(()=>a?ue(a):null,[a]),L=(0,j.useMemo)(()=>a?z(a):new Map,[a]),V=(0,j.useMemo)(()=>new Map(F?.nodes.map(e=>[e.node.id,e])??[]),[F]),H=(0,j.useMemo)(()=>{if(!a)return[];let e=new Map;for(let t of a.nodes)e.set(t.status,(e.get(t.status)??0)+1);return Z.filter(t=>e.has(t)).map(t=>({status:t,count:e.get(t)??0}))},[a]);if(!a||!F)return null;if(a.archived&&!k)return(0,P.jsx)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:(0,P.jsxs)(`button`,{type:`button`,onClick:()=>A(!0),className:`flex min-w-0 items-center gap-2 text-left text-muted-foreground hover:text-foreground`,"aria-expanded":`false`,children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(y,{className:`h-3 w-3`})}),(0,P.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-semibold uppercase tracking-wider`,children:`Show archived plan (1)`}),(0,P.jsx)(x,{className:`h-3.5 w-3.5 shrink-0`})]})});if(a.archived)return(0,P.jsx)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(y,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-muted-foreground`,children:a.title||`Plan`}),(0,P.jsx)(`div`,{className:`truncate text-[11px] leading-tight text-muted-foreground`,children:`Archived plan`})]}),(0,P.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-muted/40 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:`archived`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>A(!1),className:`shrink-0 rounded border border-border bg-muted/40 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground hover:bg-muted/60 hover:text-foreground`,"aria-expanded":`true`,children:`Hide`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void _(a.id,!1),title:`Unarchive plan`,"aria-label":`Unarchive plan`,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:(0,P.jsx)(ee,{className:`h-3.5 w-3.5`})})]})});let U=a.nodes.length,W=H.find(e=>e.status===`landed`)?.count??0,J=`${U} node${U===1?``:`s`}${W>0?` · ${W} landed`:``}`,Y=n&&u&&u.length>1?u:null,X=!!(Y&&m);return(0,P.jsxs)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:[(0,P.jsx)(ne,{plan:a,onArchive:()=>void _(a.id,!0)}),(0,P.jsx)(ae,{plan:a}),(0,P.jsxs)(`div`,{className:t(`flex min-w-0 items-center gap-2`,(!M||X)&&`mb-2`),children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>b(!M),"aria-expanded":!M,"aria-label":M?`Expand plan graph`:`Collapse plan graph`,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(te,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-foreground`,children:a.title||`Plan`}),(0,P.jsx)(`div`,{className:`truncate text-[11px] leading-tight text-muted-foreground`,children:M?J:a.objective||J})]})]}),H.length>0&&(0,P.jsx)(`div`,{className:`hidden shrink-0 items-center gap-2.5 sm:flex`,children:H.map(({status:e,count:n})=>(0,P.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,Q[e].dot)}),(0,P.jsx)(`span`,{className:t(`font-medium tabular-nums`,Q[e].text),children:n}),(0,P.jsx)(`span`,{children:Q[e].label})]},e))}),a.completion&&(0,P.jsx)(I,{completion:a.completion}),Y&&(0,P.jsx)(ie,{listId:g,plans:Y,shownId:a.id,open:m,onToggle:()=>h(!m)}),(0,P.jsxs)(`span`,{className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground`,children:[`v`,a.version]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void _(a.id,!0),title:`Archive plan`,"aria-label":`Archive plan`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:(0,P.jsx)(y,{className:`h-3.5 w-3.5`})}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>b(!M),"aria-expanded":!M,"aria-label":M?`Expand plan graph`:`Collapse plan graph`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:M?(0,P.jsx)(x,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`})})]}),Y&&X&&(0,P.jsx)(R,{listId:g,className:M?void 0:`mb-2`,plans:Y,shownId:a.id,onChoose:e=>{h(!1),p({teamId:n,channel:r},e)}}),!M&&(0,P.jsx)(G,{plan:a}),M?null:a.nodes.length===0?(0,P.jsx)(`div`,{className:`rounded-md border border-dashed border-border px-3 py-3 text-center text-xs text-muted-foreground`,children:`No nodes yet — the plan graph fills in as the team is composed.`}):(0,P.jsx)(`div`,{className:`max-h-[min(46vh,360px)] overflow-auto`,children:(0,P.jsxs)(`div`,{className:`relative`,style:{width:F.width,height:F.height},children:[(0,P.jsxs)(`svg`,{className:`pointer-events-none absolute inset-0`,width:F.width,height:F.height,"aria-hidden":`true`,children:[(0,P.jsx)(`defs`,{children:Z.map(e=>(0,P.jsx)(`marker`,{id:`plan-arrow-${e}`,viewBox:`0 0 8 8`,refX:`6.5`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,P.jsx)(`path`,{d:`M0 0 L8 4 L0 8 z`,fill:Q[e].wire})},e))}),a.edges.map(e=>{let t=V.get(e.from),n=V.get(e.to);if(!t||!n)return null;let r=Q[t.node.status];return(0,P.jsx)(`path`,{d:de(t,n),stroke:r.wire,strokeOpacity:.7,strokeWidth:2,fill:`none`,strokeLinecap:`round`,markerEnd:`url(#plan-arrow-${t.node.status})`},`${e.from}->${e.to}`)})]}),F.nodes.map(({node:e,x:n,y:r})=>{let i=Q[e.status],a=e.refs?.issueId?w[e.refs.issueId]:null,o=e.refs?.taskId?parseInt(e.refs.taskId,10):null,s=o==null?void 0:T.find(e=>e.id===o)?.title,c=o==null?void 0:L.get(o);return(0,P.jsxs)(`article`,{className:t(`group absolute flex flex-col justify-between rounded-md border border-l-[3px] bg-background/95 p-2`,`shadow-sm transition-all hover:-translate-y-px hover:border-border hover:shadow-md hover:bg-background`,i.accent),style:{left:n,top:r,width:K,height:q},title:e.scopeBlurb||e.label,children:[(0,P.jsx)(`div`,{className:`truncate text-xs font-semibold leading-tight text-foreground`,children:e.label}),(e.scopeBlurb||e.id)&&(0,P.jsx)(`div`,{className:`truncate text-[10px] leading-tight text-muted-foreground`,children:e.scopeBlurb||e.id}),(a||o!=null)&&(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-1`,children:[a&&(0,P.jsx)(C,{issueRef:a,compact:!0,className:`max-w-full`}),o!=null&&(0,P.jsx)(D,{id:o,title:s,onClick:()=>E(o),className:`max-w-full`}),c&&(0,P.jsx)(B,{runId:c,label:`run`})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-1.5`,children:[(0,P.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:t(`h-1.5 w-1.5 shrink-0 rounded-full`,i.dot)}),(0,P.jsx)(`span`,{className:t(`text-[10px] font-medium`,i.text),children:i.label})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,P.jsx)(le,{owner:e.ownerRef}),e.lane&&(0,P.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted/70 px-1 py-px text-[9px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.lane})]})]})]},e.id)})]})}),!M&&(0,P.jsx)(re,{plan:a})]})}function pe({agentId:e}){let n=l(e=>e.openTaskDetailById),r=l(e=>e.sessionTasksCollapsed),i=l(e=>e.setSessionTasksCollapsed),a=l(e=>e.deliverableTasks),[o,s]=(0,j.useState)([]),[c,u]=(0,j.useState)(!1);(0,j.useEffect)(()=>{let t=!1;return h(`GET`,`/task-entities?createdBy=`+encodeURIComponent(e)+`&limit=500`).then(e=>{t||s(e)}).catch(()=>{}),()=>{t=!0}},[e]);let d=new Map(o.map(e=>[e.id,e]));for(let t of a)t.createdBy===e&&(!d.has(t.id)||Number(t.updatedAt)>=Number(d.get(t.id).updatedAt))&&d.set(t.id,t);let f=[...d.values()];if(f.length===0)return null;let p=f.filter($).length,m=se(f,c);return(0,P.jsxs)(`section`,{className:`shrink-0 border-b border-border bg-card/45 px-3 py-2`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":!r,"aria-label":r?`Expand session tasks`:`Collapse session tasks`,className:t(`flex w-full min-w-0 items-center gap-2 text-left`,!r&&`mb-1.5`),children:[(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted/60`,children:(0,P.jsx)(v,{className:`h-3 w-3 text-muted-foreground`})}),(0,P.jsxs)(`span`,{className:`flex-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:[`Tasks from this session (`,m.length,`)`]}),(0,P.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted/60 hover:text-foreground`,children:r?(0,P.jsx)(x,{className:`h-3.5 w-3.5`}):(0,P.jsx)(S,{className:`h-3.5 w-3.5`})})]}),!r&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(me,{tasks:m,onOpen:n}),p>0&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>u(!c),className:`mt-1.5 rounded border border-border bg-muted/30 px-2 py-0.5 text-[10px] font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground`,"aria-pressed":c,children:c?`Hide ${p} closed`:`+ ${p} closed`})]})]})}function me({tasks:e,onOpen:t}){return(0,P.jsx)(`div`,{className:`space-y-2`,children:[{label:`In progress`,tasks:e.filter(e=>e.status===`in_progress`||e.status===`claimed`)},{label:`Needs validation`,tasks:e.filter(e=>e.status===`validating`)},{label:`Waiting`,tasks:e.filter(e=>![`in_progress`,`claimed`,`validating`].includes(e.status)&&!$(e))},{label:`Closed`,tasks:e.filter($)}].filter(e=>e.tasks.length).map(e=>(0,P.jsxs)(`section`,{"aria-label":e.label,children:[(0,P.jsxs)(`h3`,{className:`mb-1 text-[10px] text-muted-foreground`,children:[e.label,` (`,e.tasks.length,`)`]}),(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.tasks.map(e=>(0,P.jsx)(D,{id:e.id,title:e.title,status:e.status,onClick:()=>t(e.id),compact:!0},e.id))})]},e.label))})}export{pe as n,N as r,fe as t};
|
|
2
|
+
//# sourceMappingURL=PlanGraphPanel-BkaDJp0r.js.map
|