@humwick/server 0.130.0 → 0.130.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/docs/guides/tools-administration.md +6 -1
- package/docs/guides/tools-coordination.md +1 -0
- package/docs/guides/tools-tasks.md +8 -0
- package/docs/guides/workflows.md +58 -0
- package/docs/openapi.json +414 -1
- package/package.json +8 -17
- package/public/assets/{MessageBubble-BWpoBjl4.js → MessageBubble-BWLqMGKG.js} +2 -2
- package/public/assets/{PlanGraphPanel-C0auck3n.js → PlanGraphPanel-3TlIQpjk.js} +2 -2
- package/public/assets/{TraceView-DBnOx7AQ.js → TraceView-Wimm0Czv.js} +2 -2
- package/public/assets/{VaultDecisionCard-0kp2oNBC.js → VaultDecisionCard-Bau_vNax.js} +2 -2
- package/public/assets/{activity-yLztXEBt.js → activity-CrSurn-r.js} +2 -2
- package/public/assets/{agent-lineage-BbJDR1dW.js → agent-lineage-CknAJKcb.js} +2 -2
- package/public/assets/agent-liveness-CaNwK0Zf.js +2 -0
- package/public/assets/{agent-name-CTZBrSD9.js → agent-name-DKbiIhBo.js} +2 -2
- package/public/assets/agent-profiles-DwF6EQ4R.js +2 -0
- package/public/assets/{agent-project-badge-9TqzUUYE.js → agent-project-badge-Diz4Sjjb.js} +2 -2
- package/public/assets/{agent-tools-D4n40pn8.js → agent-tools-CRhpRQza.js} +2 -2
- package/public/assets/{agent-type-icon-D6FUarOf.js → agent-type-icon-LrUEU3lB.js} +2 -2
- package/public/assets/{agents-BYDslkJc.js → agents-B-v66C-4.js} +2 -2
- package/public/assets/{analytics-B-XSbEMC.js → analytics-BqCb-LKi.js} +2 -2
- package/public/assets/{artifact-viewer-DdWIfV6M.js → artifact-viewer-kf4pGuAR.js} +2 -2
- package/public/assets/{artifacts-oBOqks-2.js → artifacts-D32zyw4Y.js} +2 -2
- package/public/assets/{artifacts-DPN1q4pA.js → artifacts-DJevXcvg.js} +2 -2
- package/public/assets/{automation-4KcRFXEu.js → automation-BpRajx_5.js} +2 -2
- package/public/assets/{backlog-Cw9xPTCF.js → backlog-D_UjTdzX.js} +2 -2
- package/public/assets/{busy-health-CTu32MZt.js → busy-health-N3VEh4ao.js} +2 -2
- package/public/assets/{channels-BiXzg1G9.js → channels-9jopungq.js} +2 -2
- package/public/assets/{chat-Ctk2qwvA.js → chat-CSXrTB3C.js} +2 -2
- package/public/assets/{code-preview-Bm1wWqAp.js → code-preview-p1NnmqK0.js} +2 -2
- package/public/assets/{connectors-C36ax4Vw.js → connectors-CZdqlDNL.js} +2 -2
- package/public/assets/{cosmos-Jj9LK2Wf.js → cosmos-BgdsE4dG.js} +2 -2
- package/public/assets/{crate-agent-H6S7-B9T.js → crate-agent-30aXTKva.js} +2 -2
- package/public/assets/{dependency-graph-Cd1E23wa.js → dependency-graph-B_jvw2GE.js} +2 -2
- package/public/assets/{deploys-Bwfq146q.js → deploys-DoN6bAb5.js} +2 -2
- package/public/assets/{display-CfO7rTuF.js → display-BrKWFGJz.js} +2 -2
- package/public/assets/{files-DhhZI2Ih.js → files-D6XEu8Ng.js} +2 -2
- package/public/assets/fleet-C7jQWbw2.js +2 -0
- package/public/assets/{fleet-metrics-BkHP-P3R.js → fleet-metrics-BiDs3MLx.js} +2 -2
- package/public/assets/{formatted-body-Cm1RrzmN.js → formatted-body-CQBwc1fb.js} +3 -3
- package/public/assets/{formatted-body-impl-DQiOuOD1.js → formatted-body-impl-DyG0WsQS.js} +2 -2
- package/public/assets/{host-providers-dialog-CHqwXTov.js → host-providers-dialog-DKaW31dN.js} +2 -2
- package/public/assets/index-CRHep3M9.js +15 -0
- package/public/assets/index-MYAIwYTX.css +2 -0
- package/public/assets/{insights-fH1EL-qZ.js → insights-CzrtkpOE.js} +2 -2
- package/public/assets/{integrations-C5Oix6ng.js → integrations-aVsUmigt.js} +2 -2
- package/public/assets/{issue-ref-chip-ODyondIa.js → issue-ref-chip-BnSlM_95.js} +2 -2
- package/public/assets/{log-viewer-Cvfy6PW7.js → log-viewer-qe7Ee47Z.js} +2 -2
- package/public/assets/{maintenance-D8CDH5wZ.js → maintenance-NfjqFZAk.js} +2 -2
- package/public/assets/{managed-agents-egllbpij.js → managed-agents-BiH0HgaE.js} +2 -2
- package/public/assets/{markdown-preview-CYSFgVgK.js → markdown-preview-BixaT3Xr.js} +3 -3
- package/public/assets/{markdown-preview-impl-BteVIjX4.js → markdown-preview-impl-DNGlWIS3.js} +2 -2
- package/public/assets/{memory-C8WmXsyr.js → memory-DNsCl6UX.js} +2 -2
- package/public/assets/{messages-BzQdqlO6.js → messages-DopU1L1X.js} +2 -2
- package/public/assets/{orchestrators-B1HxzkNw.js → orchestrators-Cq7ckLQT.js} +2 -2
- package/public/assets/{overview-DCUnI4Z7.js → overview-C1DCTzzV.js} +2 -2
- package/public/assets/{pairs-ftCd2XcD.js → pairs-DE_m6rrE.js} +2 -2
- package/public/assets/{profile-icon-B2zH8DMH.js → profile-icon-B3rfh77F.js} +2 -2
- package/public/assets/project-profile-instructions-DQWZE0kA.js +2 -0
- package/public/assets/projects-Br2Bd2h1.js +2 -0
- package/public/assets/{prompt-settings-Bftq9czX.js → prompt-settings-BKvFsvGD.js} +2 -2
- package/public/assets/provider-display-DsuWMvVL.js +2 -0
- package/public/assets/{registry-DWCU5c8q.js → registry-Cw38_6gW.js} +2 -2
- package/public/assets/run-card-CpKqRbhg.js +2 -0
- package/public/assets/scroll-text-BKXS1ahr.js +2 -0
- package/public/assets/{secrets-C7GIUATz.js → secrets-DxI-vzSq.js} +2 -2
- package/public/assets/{service-access-settings-C3aujqTG.js → service-access-settings-D9s_VJbd.js} +2 -2
- package/public/assets/{settings-C6sZ9eBa.js → settings-CKZTVGIx.js} +2 -2
- package/public/assets/{shipping-Bu8p1gEw.js → shipping-B9YtnwtG.js} +2 -2
- package/public/assets/{stats-V9Z-GxUd.js → stats-DyUBKyWI.js} +2 -2
- package/public/assets/{status-dot-CVv0iGHL.js → status-dot-DYqlEUhJ.js} +2 -2
- package/public/assets/{store-BvtFdlGX.js → store-DcClXLH0.js} +3 -3
- package/public/assets/{tasks-CXU75HRF.js → tasks-Bh7Chr4-.js} +2 -2
- package/public/assets/{teams-BPf976zb.js → teams-bowI7qVY.js} +2 -2
- package/public/assets/{terminal-viewer-DE9BOe-8.js → terminal-viewer-BgVLHdsU.js} +3 -3
- package/public/assets/{terminal-viewer-impl-D04pjmGh.js → terminal-viewer-impl-Dz22UPy6.js} +2 -2
- package/public/assets/token-estimate-Co-Jdphh.js +2 -0
- package/public/assets/{use-agent-terminal-B1yR456R.js → use-agent-terminal-DSQQ-iY7.js} +2 -2
- package/public/assets/{use-decisions-D-S4tpDf.js → use-decisions-samMQhQf.js} +2 -2
- package/public/assets/use-project-list-59LheVP7.js +2 -0
- package/public/assets/{use-selectors-CnrAk2YP.js → use-selectors-BZa25xEB.js} +2 -2
- package/public/assets/{user-avatar-nBFIcR4M.js → user-avatar-DHxlvUvV.js} +2 -2
- package/public/assets/versioned-prompt-editor-BmED5DnJ.js +8 -0
- package/public/assets/{work-queue-TCjJxeT-.js → work-queue-CSvpuNLz.js} +2 -2
- package/public/assets/{workflow-marker-Cf3Hf2fN.js → workflow-marker-DAZcj5qt.js} +2 -2
- package/public/assets/{workflows-CXQX20Qj.js → workflows-DdmxRSyg.js} +2 -2
- package/public/assets/{workspaces-qSYzKYMA.js → workspaces-BxeKfVuF.js} +2 -2
- package/public/cosmos.html +4 -4
- package/public/index.html +31 -29
- package/runner/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/runner/plugins/claude/hooks/gate-run-guard.provisioned.mjs +31 -1
- package/runner/src/adapters/claude-effort.ts +2 -4
- package/runner/src/adapters/codex-launch-config.ts +4 -5
- package/runner/src/adapters/codex.ts +1 -1
- package/runner/src/adapters/opencode-provider.ts +7 -22
- package/runner/src/adapters/opencode.ts +4 -4
- package/runner/src/agent-runner/credentials.ts +42 -12
- package/runner/src/agent-runner/inbox.ts +27 -0
- package/runner/src/agent-runner/lifecycle-milestones.ts +0 -2
- package/runner/src/bin/claude.ts +4 -0
- package/runner/src/bin/codex.ts +4 -0
- package/runner/src/bin/opencode.ts +4 -0
- package/runner/src/index.ts +5 -2
- package/runner/src/provider-setup.ts +34 -0
- package/runner/src/providers.ts +2 -1
- package/runner/src/runner-core.ts +18 -23
- package/runner/src/spawn-input.ts +2 -1
- package/runner/src/test-run-dedup.ts +59 -56
- package/scripts/cd-config.ts +24 -3
- package/scripts/gate-run-lease.ts +10 -7
- package/scripts/gate.sh +5 -1
- package/src/branch-land-notice.ts +93 -0
- package/src/branch-landed.ts +7 -76
- package/src/bus.ts +19 -20
- package/src/cd-deploy-notify.ts +30 -2
- package/src/cd-host-lag-notify.ts +7 -6
- package/src/ci/incidents.ts +2 -2
- package/src/ci/monitor.ts +5 -8
- package/src/ci/root-missing.ts +2 -7
- package/src/ci/transition-notify.ts +7 -39
- package/src/cli/cd-pauses.ts +19 -0
- package/src/cli/orchestrator.ts +1 -1
- package/src/cli/state.ts +2 -19
- package/src/cli/task-edit.ts +22 -0
- package/src/cli/task.ts +3 -1
- package/src/cli/workflow.ts +8 -2
- package/src/commands-db.ts +10 -6
- package/src/commands-write.ts +8 -0
- package/src/config-store-write.ts +13 -1
- package/src/config-store.ts +25 -14
- package/src/db/activity-async.ts +6 -1
- package/src/db/activity-write-ops.ts +13 -1
- package/src/db/activity.ts +1 -14
- package/src/db/agent-lifecycle-write-ops.ts +1 -0
- package/src/db/agent-meta.ts +2 -2
- package/src/db/agent-ownership-write-ops.ts +4 -0
- package/src/db/agent-search.ts +1 -15
- package/src/db/agents-async.ts +58 -7
- package/src/db/agents-write-ops.ts +28 -5
- package/src/db/agents.ts +81 -54
- package/src/db/artifacts-write-ops.ts +8 -3
- package/src/db/bus-outbox-write-ops.ts +1 -0
- package/src/db/channels-write-ops.ts +4 -0
- package/src/db/ci-incidents-async.ts +5 -5
- package/src/db/ci-incidents-write-ops.ts +2 -2
- package/src/db/claude-api-budget-ops.ts +5 -5
- package/src/db/claude-app-oauth.ts +4 -4
- package/src/db/codex-reset-consumes-write-ops.ts +3 -0
- package/src/db/command-row.ts +10 -2
- package/src/db/commands-list-query.ts +2 -0
- package/src/db/commands-spawn-read.ts +1 -1
- package/src/db/commands-write-ops.ts +21 -0
- package/src/db/config-store-write-ops.ts +9 -2
- package/src/db/continuation-archives-async.ts +5 -0
- package/src/db/continuation-archives-write-ops.ts +9 -0
- package/src/db/continuations.ts +2 -2
- package/src/db/db-writer-worker.ts +8 -1
- package/src/db/delivery-write-ops.ts +5 -0
- package/src/db/deploy-events-async.ts +1 -0
- package/src/db/deploy-events-read-ops.ts +2 -1
- package/src/db/deploy-events.ts +35 -4
- package/src/db/hosts-registration.ts +10 -2
- package/src/db/hosts-write-ops.ts +14 -0
- package/src/db/hosts.ts +9 -6
- package/src/db/inbox-write-ops.ts +4 -0
- package/src/db/inbox.ts +0 -14
- package/src/db/index.ts +2 -0
- package/src/db/insights-write-ops.ts +1 -0
- package/src/db/integrations-async.ts +8 -0
- package/src/db/integrations-ops.ts +15 -0
- package/src/db/integrations.ts +15 -21
- package/src/db/issue-lifecycle.ts +3 -4
- package/src/db/issue-refs-async.ts +20 -0
- package/src/db/issue-refs-write-ops.ts +29 -0
- package/src/db/issue-refs.ts +7 -8
- package/src/db/long-running-work.ts +2 -2
- package/src/db/macos-privacy.ts +1 -1
- package/src/db/main-connection-writes.ts +23 -2
- package/src/db/maintenance-job-reconcile.ts +61 -0
- package/src/db/maintenance-job-runs-async.ts +14 -0
- package/src/db/maintenance-job-write-ops.ts +9 -0
- package/src/db/mappers.ts +2 -14
- package/src/db/merge-lease.ts +1 -15
- package/src/db/message-reads-write-ops.ts +3 -0
- package/src/db/message-write-ops.ts +4 -0
- package/src/db/migrations.ts +7 -15
- package/src/db/orchestrators-async.ts +7 -3
- package/src/db/orchestrators-write-ops.ts +7 -1
- package/src/db/orchestrators.ts +21 -77
- package/src/db/pairs.ts +1 -13
- package/src/db/project-profile-instructions.ts +50 -0
- package/src/db/prompt-versions-ops.ts +1 -0
- package/src/db/prompt-versions.ts +9 -2
- package/src/db/provider-catalog-write-ops.ts +4 -4
- package/src/db/provider-config-history.ts +8 -3
- package/src/db/provider-flap-messages-write-ops.ts +1 -0
- package/src/db/provider-model-seed.ts +34 -0
- package/src/db/provider-quota-lease-write-ops.ts +1 -0
- package/src/db/provider-quota-write-ops.ts +2 -0
- package/src/db/provisioning-write-ops.ts +9 -8
- package/src/db/read-op-marshaling-fixtures.ts +5 -0
- package/src/db/read-ops.ts +4 -0
- package/src/db/routing-policy.ts +3 -4
- package/src/db/schema.ts +9 -3
- package/src/db/secrets-broker-write-ops.ts +5 -5
- package/src/db/secrets-vault-write.ts +7 -7
- package/src/db/services-write-ops.ts +3 -0
- package/src/db/spawn-delegation-state.ts +11 -4
- package/src/db/spawn-tree-cleanup.ts +3 -0
- package/src/db/stats-async.ts +4 -3
- package/src/db/task-entity.ts +23 -2
- package/src/db/task-list.ts +3 -1
- package/src/db/tasks.ts +1 -17
- package/src/db/team-spawn-delegation.ts +1 -1
- package/src/db/teams-write-ops.ts +4 -4
- package/src/db/timer-cutover-write-ops.ts +7 -0
- package/src/db/timer-ingress-write-ops.ts +9 -0
- package/src/db/timer-ingress.ts +7 -1
- package/src/db/timer-operator-write-ops.ts +14 -0
- package/src/db/timer-transfer-write-ops.ts +4 -0
- package/src/db/timer-write-ops.ts +14 -0
- package/src/db/token-db-write-ops.ts +21 -0
- package/src/db/token-standing.ts +15 -11
- package/src/db/user-settings-write-ops.ts +1 -0
- package/src/db/vault-backup.ts +2 -2
- package/src/db/vault-expiry.ts +2 -2
- package/src/db/vault-health.ts +3 -3
- package/src/db/vault-token-ops.ts +8 -8
- package/src/db/web-tool-call-ops.ts +3 -3
- package/src/db/workflow-contact.ts +1 -1
- package/src/db/workflow-task-read-ops.ts +30 -0
- package/src/db/write-ops.ts +15 -1
- package/src/db/writer-fault-seam.ts +5 -2
- package/src/db/writer-gateway.ts +21 -12
- package/src/dispatch-availability.ts +10 -6
- package/src/ephemeral/{landing-ingress-proof-worker.ts → landing-ingress-proof.test-fixture.ts} +4 -2
- package/src/host/disk-alert.ts +121 -0
- package/src/lifecycle-manager.ts +3 -2
- package/src/maintenance/cd-watcher.ts +3 -3
- package/src/maintenance/critical-job-watchdog.ts +16 -17
- package/src/maintenance/index.ts +1 -0
- package/src/maintenance/jobs.ts +3 -2
- package/src/maintenance/scheduler.ts +84 -128
- package/src/maintenance/stalled-delivery-pager.ts +6 -5
- package/src/maintenance/workspaces.ts +1 -1
- package/src/managed-policy.ts +31 -27
- package/src/mcp/index.ts +5 -2
- package/src/mcp/output-descriptions.ts +8 -8
- package/src/mcp/presentation.ts +4 -4
- package/src/mcp/project-profile-instructions.ts +32 -0
- package/src/mcp/tool-groups.ts +1 -1
- package/src/mcp/tools-spawn.ts +4 -3
- package/src/mcp-agent-action.ts +1 -2
- package/src/mcp-host-tools.ts +1 -1
- package/src/mcp-issue-ref-tools.ts +12 -11
- package/src/mcp-maintenance-tools.ts +2 -2
- package/src/mcp-profile-trust-tools.ts +4 -4
- package/src/mcp-provider-catalog.ts +2 -2
- package/src/mcp-task-tools.ts +11 -5
- package/src/mcp-team-template-tools.ts +3 -3
- package/src/mcp-workflow-tools.ts +10 -3
- package/src/notification-types.ts +2 -1
- package/src/operator-alarm.ts +26 -11
- package/src/package-pack.ts +42 -39
- package/src/project-instructions.ts +4 -0
- package/src/project-profile-instruction-text.ts +6 -0
- package/src/project-profile-instructions.ts +20 -0
- package/src/provider-catalog-store.ts +3 -49
- package/src/provider-config-store.ts +12 -11
- package/src/provider-model-seed.ts +1 -18
- package/src/provider-quota-config-store.ts +5 -4
- package/src/provider-secrets.test-fixture.ts +3 -3
- package/src/recipe-runner.ts +2 -2
- package/src/repo-config-source.ts +10 -4
- package/src/routes/agent-profiles.ts +6 -6
- package/src/routes/agents-spawn.ts +1 -1
- package/src/routes/agents.ts +6 -6
- package/src/routes/commands-listing.ts +4 -0
- package/src/routes/commands.ts +2 -2
- package/src/routes/continuation-archives.ts +2 -2
- package/src/routes/host-resource-control.ts +4 -1
- package/src/routes/index.ts +10 -1
- package/src/routes/integrations.ts +24 -50
- package/src/routes/issue-refs.ts +7 -7
- package/src/routes/orchestrator-bootstrap.ts +3 -3
- package/src/routes/orchestrator-host-registration.ts +2 -2
- package/src/routes/orchestrator-host-utilization.ts +3 -1
- package/src/routes/orchestrator-proxy.ts +2 -2
- package/src/routes/orchestrator.ts +4 -4
- package/src/routes/project-profile-instructions.ts +27 -0
- package/src/routes/project-trust.ts +2 -2
- package/src/routes/provider-config.ts +9 -8
- package/src/routes/provider-quota-config.ts +2 -2
- package/src/routes/settings.ts +5 -5
- package/src/routes/stats.ts +6 -6
- package/src/routes/task-http.ts +15 -1
- package/src/routes/task-issues.ts +11 -26
- package/src/routes/tasks.ts +22 -53
- package/src/routes/team-templates.ts +5 -5
- package/src/routes/teams-config.ts +2 -2
- package/src/routes/tokens.ts +12 -5
- package/src/routes/workflows.ts +20 -5
- package/src/routing-policy-normalize.ts +1 -2
- package/src/routing-step-defaults.ts +0 -2
- package/src/runner-token-mint-limit.ts +63 -0
- package/src/runtime-grant.ts +4 -2
- package/src/runtime-tokens.ts +50 -9
- package/src/security.ts +13 -20
- package/src/server-background.ts +1 -1
- package/src/server.ts +5 -2
- package/src/services/host-utilization.ts +23 -0
- package/src/services/idle-epics.ts +5 -6
- package/src/services/issue-lifecycle.ts +57 -61
- package/src/services/issue-refs.ts +9 -13
- package/src/services/kernel-timers-cutover-chaos-worker.ts +12 -7
- package/src/services/kernel-timers-ingress.ts +1 -1
- package/src/services/kernel-timers-request-key-migration-chaos-worker.ts +4 -1
- package/src/services/landed-ancestry.ts +19 -3
- package/src/services/memory-areas.ts +15 -51
- package/src/services/plan-ci-notice.ts +57 -0
- package/src/services/plan-ci-recovery.ts +2 -55
- package/src/services/plan-wake-digest.ts +1 -0
- package/src/services/profile-trust.ts +4 -3
- package/src/services/project-config-read.ts +70 -0
- package/src/services/project-profile-instructions.ts +54 -0
- package/src/services/provisioning-harness/budget-baseline.json +4 -4
- package/src/services/restart-spawn.ts +61 -49
- package/src/services/self-care-state.ts +2 -1
- package/src/services/self-effort.ts +5 -5
- package/src/services/send-message.ts +5 -1
- package/src/services/spawn-agent.ts +13 -2
- package/src/services/spawn-chain-inspector.ts +6 -13
- package/src/services/spawn-policy.ts +68 -0
- package/src/services/spawn-tree-cleanup.ts +2 -2
- package/src/services/task-dispatch.ts +3 -0
- package/src/services/task-state-reconcile.ts +6 -14
- package/src/services/team-templates.ts +9 -8
- package/src/services/transient-agent-reaper.ts +3 -1
- package/src/services/workflow-auto-start.ts +25 -13
- package/src/services/workflow-ci-main.ts +1 -1
- package/src/services/workflow-deferred-cleanup.ts +4 -2
- package/src/services/workflow-effect-driver.ts +2 -0
- package/src/services/workflow-effects.ts +18 -11
- package/src/services/workflow-land-notice.ts +10 -0
- package/src/services/workflow-pause-text.ts +43 -0
- package/src/services/workflow-reconcile.ts +13 -11
- package/src/services/workflow-run-view.ts +2 -0
- package/src/services/workflow-runs.ts +29 -13
- package/src/services/workflow-supervisor-state.ts +5 -0
- package/src/services/workflow-supervisor.ts +7 -3
- package/src/settings/registry.ts +1 -2
- package/src/spawn-command.ts +4 -4
- package/src/spawn-models.ts +10 -12
- package/src/spawn-placement.ts +1 -1
- package/src/spawn-targets.ts +1 -1
- package/src/startup-context-injection.ts +1 -0
- package/src/state-adoption/cd-cutover.ts +53 -7
- package/src/state-adoption/fleet-cutover.ts +35 -0
- package/src/state-adoption/fleet-plan.ts +36 -0
- package/src/state-adoption/index.ts +2 -2
- package/src/state-adoption/linux-plan.ts +2 -2
- package/src/state-adoption/linux.ts +2 -2
- package/src/state-adoption/macos-plan.ts +2 -2
- package/src/state-adoption/macos.ts +1 -1
- package/src/steward.ts +7 -6
- package/src/task-dispatch-live.ts +1 -1
- package/src/task-dispatcher.ts +1 -1
- package/src/teams-config-store.ts +4 -3
- package/src/token-db-write.ts +10 -0
- package/src/workspace-command-settle.ts +2 -1
- package/src/workspace-steward-wake.ts +2 -2
- package/node_modules/@humwick/kernel/LICENSE +0 -167
- package/node_modules/@humwick/kernel/async-entity-persistence.ts +0 -344
- package/node_modules/@humwick/kernel/async-event-log.ts +0 -107
- package/node_modules/@humwick/kernel/automations.pilot.ts +0 -147
- package/node_modules/@humwick/kernel/config.ts +0 -111
- package/node_modules/@humwick/kernel/contract.ts +0 -572
- package/node_modules/@humwick/kernel/control-authz.ts +0 -281
- package/node_modules/@humwick/kernel/control.ts +0 -645
- package/node_modules/@humwick/kernel/effects.ts +0 -493
- package/node_modules/@humwick/kernel/event-log.ts +0 -319
- package/node_modules/@humwick/kernel/http-transport.ts +0 -384
- package/node_modules/@humwick/kernel/identity-grammar.ts +0 -20
- package/node_modules/@humwick/kernel/identity.ts +0 -248
- package/node_modules/@humwick/kernel/index.ts +0 -28
- package/node_modules/@humwick/kernel/kernel-persistence.ts +0 -181
- package/node_modules/@humwick/kernel/landing-incident.ts +0 -306
- package/node_modules/@humwick/kernel/landing.ts +0 -953
- package/node_modules/@humwick/kernel/manifest-validation.ts +0 -460
- package/node_modules/@humwick/kernel/mcp-transport.ts +0 -109
- package/node_modules/@humwick/kernel/message-authority-chaos-worker.ts +0 -200
- package/node_modules/@humwick/kernel/message-authority.ts +0 -281
- package/node_modules/@humwick/kernel/module-host.ts +0 -722
- package/node_modules/@humwick/kernel/openapi-init.ts +0 -14
- package/node_modules/@humwick/kernel/package.json +0 -47
- package/node_modules/@humwick/kernel/persistence-schema.ts +0 -248
- package/node_modules/@humwick/kernel/persistence.ts +0 -510
- package/node_modules/@humwick/kernel/registry.ts +0 -60
- package/node_modules/@humwick/kernel/sqlite-kernel-persistence.ts +0 -499
- package/node_modules/@humwick/kernel/sqlite-module-host.ts +0 -87
- package/node_modules/@humwick/kernel/timers-chaos-worker.ts +0 -186
- package/node_modules/@humwick/kernel/timers.pilot.ts +0 -1411
- package/node_modules/@humwick/kernel/workflow-activation.ts +0 -25
- package/node_modules/@humwick/kernel/workflow-backstop.ts +0 -40
- package/node_modules/@humwick/kernel/workflow-cancel-tree.ts +0 -20
- package/node_modules/@humwick/kernel/workflow-chaos-worker.ts +0 -213
- package/node_modules/@humwick/kernel/workflow-composition.ts +0 -231
- package/node_modules/@humwick/kernel/workflow-container.ts +0 -72
- package/node_modules/@humwick/kernel/workflow-control.test-fixture.ts +0 -42
- package/node_modules/@humwick/kernel/workflow-control.ts +0 -178
- package/node_modules/@humwick/kernel/workflow-definition.ts +0 -507
- package/node_modules/@humwick/kernel/workflow-dispatch.ts +0 -60
- package/node_modules/@humwick/kernel/workflow-foreach.ts +0 -167
- package/node_modules/@humwick/kernel/workflow-journal-codec.ts +0 -339
- package/node_modules/@humwick/kernel/workflow-journal.ts +0 -922
- package/node_modules/@humwick/kernel/workflow-lane.ts +0 -48
- package/node_modules/@humwick/kernel/workflow-lease-owner.ts +0 -60
- package/node_modules/@humwick/kernel/workflow-recovery.test-fixture.ts +0 -19
- package/node_modules/@humwick/kernel/workflow-runtime.ts +0 -938
- package/node_modules/@humwick/kernel/workflow-script.ts +0 -11
- package/node_modules/@humwick/kernel/workflow-state.ts +0 -299
- package/node_modules/@humwick/kernel/workflow-step-commit.ts +0 -195
- package/node_modules/@humwick/kernel/workflow-transitions.ts +0 -317
- package/node_modules/@humwick/kernel/workflow-values.ts +0 -153
- package/node_modules/@humwick/kernel/workflow.pilot.ts +0 -376
- package/node_modules/@humwick/offload/LICENSE +0 -167
- package/node_modules/@humwick/offload/README.md +0 -57
- package/node_modules/@humwick/offload/dist/async-runner.d.ts +0 -18
- package/node_modules/@humwick/offload/dist/async-runner.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/async-runner.js +0 -158
- package/node_modules/@humwick/offload/dist/async-runner.js.map +0 -1
- package/node_modules/@humwick/offload/dist/envelope.d.ts +0 -25
- package/node_modules/@humwick/offload/dist/envelope.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/envelope.js +0 -80
- package/node_modules/@humwick/offload/dist/envelope.js.map +0 -1
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.d.ts +0 -10
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.js +0 -59
- package/node_modules/@humwick/offload/dist/fixtures/worker-task.js.map +0 -1
- package/node_modules/@humwick/offload/dist/index.d.ts +0 -5
- package/node_modules/@humwick/offload/dist/index.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/index.js +0 -5
- package/node_modules/@humwick/offload/dist/index.js.map +0 -1
- package/node_modules/@humwick/offload/dist/subprocess-runner.d.ts +0 -62
- package/node_modules/@humwick/offload/dist/subprocess-runner.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/subprocess-runner.js +0 -295
- package/node_modules/@humwick/offload/dist/subprocess-runner.js.map +0 -1
- package/node_modules/@humwick/offload/dist/types.d.ts +0 -111
- package/node_modules/@humwick/offload/dist/types.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/types.js +0 -176
- package/node_modules/@humwick/offload/dist/types.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-pool.d.ts +0 -23
- package/node_modules/@humwick/offload/dist/worker-pool.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-pool.js +0 -435
- package/node_modules/@humwick/offload/dist/worker-pool.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-runtime.d.ts +0 -2
- package/node_modules/@humwick/offload/dist/worker-runtime.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker-runtime.js +0 -27
- package/node_modules/@humwick/offload/dist/worker-runtime.js.map +0 -1
- package/node_modules/@humwick/offload/dist/worker.d.ts +0 -5
- package/node_modules/@humwick/offload/dist/worker.d.ts.map +0 -1
- package/node_modules/@humwick/offload/dist/worker.js +0 -1
- package/node_modules/@humwick/offload/dist/worker.js.map +0 -1
- package/node_modules/@humwick/offload/package.json +0 -46
- package/node_modules/@humwick/offload/src/async-runner.ts +0 -170
- package/node_modules/@humwick/offload/src/envelope.ts +0 -92
- package/node_modules/@humwick/offload/src/fixtures/worker-task.ts +0 -49
- package/node_modules/@humwick/offload/src/index.ts +0 -4
- package/node_modules/@humwick/offload/src/subprocess-runner.ts +0 -334
- package/node_modules/@humwick/offload/src/types.ts +0 -235
- package/node_modules/@humwick/offload/src/worker-pool.ts +0 -463
- package/node_modules/@humwick/offload/src/worker-runtime.ts +0 -32
- package/node_modules/@humwick/offload/src/worker.ts +0 -5
- package/public/assets/agent-liveness-DyqxfB-t.js +0 -2
- package/public/assets/agent-profiles-BpI_jTxq.js +0 -2
- package/public/assets/fleet-BL4UXS_k.js +0 -2
- package/public/assets/index-B7ZerHLY.css +0 -2
- package/public/assets/index-BK0WV6hF.js +0 -15
- package/public/assets/projects-B_lmcqfO.js +0 -2
- package/public/assets/provider-display-DbLWpP3j.js +0 -2
- package/public/assets/run-card-CO_bguQf.js +0 -2
- package/public/assets/use-project-list-B-T2Bnnn.js +0 -2
- package/public/assets/versioned-prompt-editor-Diu8BIaM.js +0 -8
- package/runner/src/gate-run-lease-probe.ts +0 -38
- package/src/db/claude-catalog-reconcile.ts +0 -27
- package/src/routing-model-aliases.ts +0 -21
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t,u as n}from"./dist-DeW2Y1R5.js";import{t as r,wt as i}from"./store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t,u as n}from"./dist-DeW2Y1R5.js";import{t as r,wt as i}from"./store-DcClXLH0.js";import{M as a}from"./provider-display-DsuWMvVL.js";import{et as o,v as s}from"./display-BrKWFGJz.js";import{o as c,t as l}from"./tasks-BIyeAaPC.js";import{t as u}from"./api-CIIVBtAV.js";import{t as d}from"./scroll-area-CIN4KQse.js";import{n as f}from"./TraceView-Wimm0Czv.js";import{t as p}from"./clipboard-list-W2YeUsxT.js";import{t as m}from"./external-link-BRfu-fHG.js";import{t as h}from"./folder-git-2-CJOmTT06.js";import{t as g}from"./git-branch-yxhV0m8E.js";import{t as _}from"./plus-D5Ek4e2S.js";import{t as v}from"./button-Do6Z3vvn.js";import{t as y}from"./badge-DqJRtj_p.js";import{t as b}from"./input-CsTB6jIx.js";import{o as x,r as S,t as C}from"./card-C4QJ4hCW.js";var w=e(t(),1),T=n(),E=`version: 1
|
|
2
2
|
key: my-feature
|
|
3
3
|
revision: r1
|
|
4
4
|
title: My feature
|
|
@@ -8,4 +8,4 @@ acceptance:
|
|
|
8
8
|
tasks:
|
|
9
9
|
- {key: a, title: Build feature, intent: Implement the feature}
|
|
10
10
|
`;function D(){let[e,t]=(0,w.useState)(E),[n,i]=(0,w.useState)(`yaml`),[o,s]=(0,w.useState)(0),[c,l]=(0,w.useState)(()=>crypto.randomUUID()),[d,f]=(0,w.useState)(null),[p,m]=(0,w.useState)(``),[h,g]=(0,w.useState)(!1),_=r(e=>e.fetchDeliverableTasks),y=r(e=>e.openTaskDetail);function b(){f(null),m(``),l(crypto.randomUUID())}async function x(t){g(!0),m(``);try{let r=await u(`POST`,`/plans/import`,{document:e,format:n,expectedVersion:o,requestKey:c,dryRun:t});f(r),r.applied&&(s(r.version),await _())}catch(e){m(a(e))}finally{g(!1)}}async function S(e){try{y(await u(`GET`,`/tasks/${e}`))}catch(e){m(a(e))}}return(0,T.jsxs)(`section`,{"aria-label":`Import plan`,className:`rounded-lg border p-4 space-y-3`,children:[(0,T.jsx)(`h3`,{className:`font-medium`,children:`Import plan`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Preview a version 1 plan, then import its Tasks. Reuse source keys and change revision for updates. Start the plan separately.`}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,T.jsxs)(`label`,{children:[`Format `,(0,T.jsxs)(`select`,{"aria-label":`Plan format`,value:n,onChange:e=>{i(e.target.value),b()},children:[(0,T.jsx)(`option`,{value:`yaml`,children:`YAML`}),(0,T.jsx)(`option`,{value:`json`,children:`JSON`})]})]}),(0,T.jsxs)(`label`,{children:[`Expected version `,(0,T.jsx)(`input`,{className:`w-20 rounded border bg-background px-2`,"aria-label":`Expected version`,type:`number`,min:0,value:o,onChange:e=>{s(Number(e.target.value)),b()}})]}),(0,T.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Use 0 for a new plan.`})]}),(0,T.jsx)(`textarea`,{"aria-label":`Plan document`,className:`w-full min-h-56 rounded border bg-background p-3 font-mono text-sm`,value:e,onChange:e=>{t(e.target.value),b()}}),(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(v,{disabled:h,onClick:()=>void x(!0),children:`Preview import`}),(0,T.jsx)(v,{disabled:h||!d?.dryRun||d.conflicts.length>0,onClick:()=>void x(!1),children:`Import Tasks`})]}),p&&(0,T.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:p}),d&&(0,T.jsxs)(`div`,{"aria-label":`Import result`,className:`space-y-2 text-sm`,children:[(0,T.jsxs)(`p`,{children:[d.applied?`Imported`:`Preview`,` · version `,d.version,` · source `,d.sourceRevision]}),d.conflicts.map((e,t)=>(0,T.jsxs)(`p`,{role:`alert`,children:[e.key,`.`,e.field,`: `,e.reason]},t)),d.version!==o&&!d.applied&&(0,T.jsxs)(v,{size:`sm`,variant:`outline`,onClick:()=>{s(d.version),b()},children:[`Use version `,d.version]}),d.changes.length>0&&(0,T.jsxs)(`p`,{children:[`Plan changes: `,d.changes.join(`, `)]}),(0,T.jsx)(`ul`,{children:d.tasks.map(e=>(0,T.jsxs)(`li`,{children:[e.taskId?(0,T.jsxs)(`button`,{className:`underline`,onClick:()=>void S(e.taskId),children:[`T`,e.taskId,` · `,e.key]}):e.key,` · `,e.changes.join(`, `)||`unchanged`,` · `,e.execution?.workflow??`no recipe`]},e.key))}),d.omitted.length>0&&(0,T.jsxs)(`p`,{children:[`Retained omitted Tasks: `,d.omitted.join(`, `)]})]})]})}var O={open:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,validating:`bg-tone-teal/10 text-tone-teal-fg border-tone-teal/20`,in_progress:`bg-tone-purple/10 text-tone-purple-fg border-tone-purple/20`,blocked:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,done:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,failed:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,canceled:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,claimed:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`},k={none:`bg-tone-neutral/10 text-tone-neutral-fg`,uncommitted:`bg-tone-yellow/10 text-tone-yellow-fg`,"committed-on-branch":`bg-tone-info/10 text-tone-info-fg`,"landed-on-main":`bg-tone-success/10 text-tone-success-fg`,deploying:`bg-tone-purple/10 text-tone-purple-fg`,deployed:`bg-tone-teal/10 text-tone-teal-fg`},A={none:`None`,uncommitted:`Uncommitted`,"committed-on-branch":`On Branch`,"landed-on-main":`Landed`,deploying:`Deploying`,deployed:`Deployed`},j=[`open`,`in_progress`,`validating`,`owner-gone`,`blocked`,`done`,`failed`,`canceled`],M={low:`bg-tone-neutral/10 text-tone-neutral-fg`,medium:`bg-tone-info/10 text-tone-info-fg`,high:`bg-tone-orange/10 text-tone-orange-fg`,urgent:`bg-tone-danger/10 text-tone-danger-fg`};function N(){let e=i(),t=r(e=>e.deliverableTasks),n=r(e=>e.deliverableStatusFilter),a=r(e=>e.deliverableStageFilter),o=r(e=>e.deliverableProjectFilter),s=r(e=>e.deliverableTagFilter),f=r(e=>e.deliverablePriorityFilter),m=r(e=>e.set),h=r(e=>e.fetchDeliverableTasks),g=r(e=>e.openTaskDetail),x=r(e=>e.openTaskCreate),[S,C]=(0,w.useState)(!1),[E,O]=(0,w.useState)([]),[k,M]=(0,w.useState)(s);(0,w.useEffect)(()=>{let e=!1;return u(`GET`,`/projects`).then(t=>{e||O(t.projects??[])}).catch(()=>{e||O([])}),()=>{e=!0}},[]);let N=(0,w.useMemo)(()=>new Map(E.map(e=>[e.id,e])),[E]),F=(0,w.useMemo)(()=>{let e=E.map(e=>({value:e.id,label:e.title||e.slug||e.issueRepo||e.id}));for(let n of t)n.projectId&&!e.some(e=>e.value===n.projectId)&&e.push({value:n.projectId,label:n.repo||n.projectId});return e.sort((e,t)=>e.label.localeCompare(t.label))},[t,E]);function I(e){m({deliverableStatusFilter:e}),h()}function L(e){m({deliverableStageFilter:e}),h()}function R(e){m({deliverableProjectFilter:e}),h()}function z(e){m({deliverablePriorityFilter:e}),h()}function B(){let e=k.trim();M(e),e!==s&&(m({deliverableTagFilter:e}),h())}return(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(p,{className:`w-5 h-5 text-muted-foreground`}),(0,T.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Tasks`}),(0,T.jsx)(y,{variant:`secondary`,children:t.length})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,T.jsx)(v,{size:`sm`,variant:`outline`,onClick:()=>C(!S),children:`Import plan`}),(0,T.jsxs)(v,{size:`sm`,className:`h-8 gap-1.5`,onClick:x,children:[(0,T.jsx)(_,{className:`w-3.5 h-3.5`}),`New Task`]}),(0,T.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:n,onChange:e=>I(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:`All statuses`}),j.map(e=>(0,T.jsx)(`option`,{value:e,children:e===`validating`?`Needs validation`:e===`owner-gone`?`Owner gone · inactive 7 days`:e},e))]}),(0,T.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:a,onChange:e=>L(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:`All stages`}),l.map(e=>(0,T.jsx)(`option`,{value:e,children:A[e]??e},e))]}),(0,T.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:o,onChange:e=>R(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:`All projects`}),F.map(e=>(0,T.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),(0,T.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:f,onChange:e=>z(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:`All priorities`}),c.map(e=>(0,T.jsx)(`option`,{value:e,children:e},e))]}),(0,T.jsx)(b,{className:`h-8 w-36 text-sm`,placeholder:`Filter by tag…`,value:k,onChange:e=>M(e.target.value),onBlur:B,onKeyDown:e=>{e.key===`Enter`&&B()}})]})]}),S&&(0,T.jsx)(D,{}),(0,T.jsx)(d,{className:`h-[calc(100dvh-11rem)]`,children:(0,T.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3 pr-2`,children:[t.length===0&&(0,T.jsx)(`div`,{className:`col-span-full text-center text-muted-foreground py-16 text-sm`,children:`No deliverable tasks`}),t.map(t=>(0,T.jsx)(P,{task:t,now:e,project:t.projectId?N.get(t.projectId):void 0,onOpen:()=>g(t)},t.id))]})})]})}function P({task:e,now:t,project:n,onOpen:r}){let i=O[e.status]??`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,a=e.deliverableStage?k[e.deliverableStage]??`bg-tone-neutral/10 text-tone-neutral-fg`:``,c=e.label||e.title,l=n?.title||n?.slug||e.repo||e.projectId;return(0,T.jsxs)(C,{className:`flex flex-col cursor-pointer hover:border-tone-neutral transition-colors min-w-0`,onClick:r,children:[(0,T.jsxs)(x,{className:`py-3 px-4 pb-0 space-y-0`,children:[(0,T.jsxs)(`div`,{className:`flex items-start gap-2 justify-between`,children:[(0,T.jsxs)(`div`,{className:`flex gap-1.5 flex-wrap`,children:[(0,T.jsx)(y,{variant:`outline`,className:`text-xs px-1.5 py-0 border ${i}`,children:e.status}),e.deliverableStage&&e.deliverableStage!==`none`&&(0,T.jsx)(y,{variant:`secondary`,className:`text-xs px-1.5 py-0 ${a}`,children:A[e.deliverableStage]??e.deliverableStage}),e.priority&&(0,T.jsx)(y,{variant:`secondary`,className:`text-xs px-1.5 py-0 ${M[e.priority]??`bg-tone-neutral/10 text-tone-neutral-fg`}`,children:e.priority})]}),(0,T.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[`T`,e.id]})]}),(0,T.jsx)(`p`,{className:`font-medium text-sm mt-2 line-clamp-2`,children:c}),e.staleOwnerGone&&(0,T.jsx)(`p`,{className:`text-xs text-tone-warning-fg`,children:`Owner gone · inactive 7 days`}),e.validationItems?.filter(e=>e.status!==`met`).map(e=>(0,T.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.status,`: `,e.criterion]},e.id)),e.tags&&e.tags.length>0&&(0,T.jsx)(`div`,{className:`flex gap-1 flex-wrap mt-1.5`,children:e.tags.map(e=>(0,T.jsx)(y,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-normal`,children:e},e))})]}),(0,T.jsxs)(S,{className:`px-4 py-3 flex-1 flex flex-col justify-between gap-2`,children:[(0,T.jsxs)(`div`,{className:`space-y-0.5 text-xs text-muted-foreground`,children:[l&&(0,T.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,T.jsx)(h,{className:`w-3 h-3 shrink-0`}),(0,T.jsx)(`span`,{className:`truncate min-w-0`,children:l})]}),e.ownerAgentId&&(0,T.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,T.jsx)(`span`,{className:`text-muted-foreground/60 shrink-0`,children:`owner`}),(0,T.jsx)(f,{agentId:e.ownerAgentId,fallbackLabel:e.ownerAgentLabel,noIcon:!0,className:`text-xs min-w-0`})]}),e.branch&&(0,T.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,T.jsx)(g,{className:`w-3 h-3 shrink-0`}),(0,T.jsx)(`span`,{className:`font-mono truncate min-w-0`,children:e.branch})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,title:s(e.updatedAt),children:[(0,T.jsx)(`span`,{className:`text-muted-foreground/60`,children:`updated`}),(0,T.jsx)(`span`,{children:o(t,e.updatedAt)})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,T.jsx)(v,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:e=>{e.stopPropagation(),r()},children:`Details`}),e.externalUrl&&(0,T.jsx)(`a`,{href:e.externalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`ml-auto`,onClick:e=>e.stopPropagation(),children:(0,T.jsx)(v,{size:`sm`,variant:`ghost`,className:`h-7 px-2`,children:(0,T.jsx)(m,{className:`w-3.5 h-3.5`})})})]})]})]})}export{N as TasksView};
|
|
11
|
-
//# sourceMappingURL=tasks-
|
|
11
|
+
//# sourceMappingURL=tasks-Bh7Chr4-.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{A as i,f as a,t as o,u as s}from"./store-BvtFdlGX.js";import{M as c}from"./provider-display-DbLWpP3j.js";import{et as l,f as u,v as d}from"./display-CfO7rTuF.js";import{t as f}from"./PlanGraphPanel-C0auck3n.js";import{t as p}from"./api-CIIVBtAV.js";import{t as m}from"./scroll-area-CIN4KQse.js";import{a as ee,i as te,n as ne,r as re,t as ie}from"./select-DTQMP4Dk.js";import{t as h}from"./chart-column-S02ZGfTR.js";import{t as ae}from"./issue-ref-chip-ODyondIa.js";import{t as oe}from"./message-square-C-1G8dMM.js";import{t as se}from"./refresh-cw-CfpvQcUn.js";import{t as ce}from"./workflow-marker-Cf3Hf2fN.js";import{t as le}from"./trash-2-FbcSq927.js";import{t as ue}from"./users-C7B3u9jv.js";import{t as g}from"./button-Do6Z3vvn.js";import{t as _}from"./badge-DqJRtj_p.js";import{t as de}from"./agent-name-CTZBrSD9.js";import{t as fe}from"./input-CsTB6jIx.js";import{t as pe}from"./status-dot-CVv0iGHL.js";import{o as v,r as y,s as b,t as x}from"./card-C4QJ4hCW.js";var S=e(n(),1),C=r();function w(e){return Promise.all([p(`GET`,`/teams/${encodeURIComponent(e)}/spawn-delegation`),p(`GET`,`/projects`)])}function me({team:e}){let[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(null),s=e.parentTeamId??e.id;async function l(){let[e,t]=await w(s);n(e),i(t.projects),o(null)}return(0,S.useEffect)(()=>{let e=!0;return w(s).then(([t,r])=>{e&&(n(t),i(r.projects))}).catch(t=>{e&&o(c(t))}),()=>{e=!1}},[s]),(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsx)(b,{children:`Spawn delegation`})}),(0,C.jsxs)(y,{className:`space-y-3`,children:[(0,C.jsx)(g,{variant:`outline`,onClick:()=>{l().catch(e=>o(c(e)))},children:`Reload delegation`}),a?(0,C.jsx)(`p`,{role:`alert`,children:a}):null,t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`p`,{children:[`Version `,t.team.spawnDelegation?.version??0,` · `,t.occupied,`/`,t.limit,` occupied · depth limit 2`]}),e.parentTeamId?(0,C.jsxs)(`p`,{children:[`Grant managed by root team `,s]}):(0,C.jsx)(T,{state:t,projects:r,onSaved:l},`${t.team.id}:${t.team.spawnDelegation?.version??0}`),t.projects.filter(e=>e.error).map(e=>(0,C.jsxs)(`p`,{role:`alert`,children:[e.title??e.id,`: `,e.error]},e.id)),(0,C.jsx)(`ul`,{"aria-label":`Delegated tree`,children:t.launches.map(e=>(0,C.jsxs)(`li`,{style:{marginLeft:(e.depth-1)*16},children:[e.parentId,` → `,e.agentId,` · `,e.profile,` · `,t.projects.find(t=>t.id===e.projectId)?.title??e.projectId??`project unavailable`,` · depth `,e.depth,` · `,e.status,e.stopping?` · stopping; cleanup pending`:``,e.error?(0,C.jsxs)(`span`,{role:`alert`,children:[` · `,e.error]}):null]},e.agentId))})]}):null]})]})}function T({state:e,projects:t,onSaved:n}){let[r,i]=(0,S.useState)(e.team.spawnDelegation?.enabled??!1),[a,o]=(0,S.useState)(e.team.spawnDelegation?.projectIds??(e.team.projectId?[e.team.projectId]:[])),[s,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),f=[...t.map(e=>({id:e.id,title:e.title??e.slug})),...e.projects.filter(e=>!t.some(t=>t.id===e.id)).map(e=>({id:e.id,title:`${e.id} (unavailable)`}))];async function m(){d(!0),l(null);try{await p(`PATCH`,`/teams/${encodeURIComponent(e.team.id)}/spawn-delegation`,{expectedVersion:e.team.spawnDelegation?.version??0,requestId:crypto.randomUUID(),enabled:r,projectIds:a}),await n()}catch(e){l(c(e))}finally{d(!1)}}return(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),` Enable delegated spawning`]}),f.map(e=>(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:a.includes(e.id),onChange:t=>o(t.target.checked?[...a,e.id]:a.filter(t=>t!==e.id))}),` `,e.title]},e.id)),(0,C.jsx)(g,{disabled:u,onClick:()=>{m()},children:`Save delegation`}),s?(0,C.jsx)(`p`,{role:`alert`,children:s}):null]})}function E(e){if(e==null)return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function he(e){return`${Math.round(e*100)}%`}function D(e){return e===`success`?`bg-tone-success/10 text-tone-success-fg border-tone-success/20`:e===`partial`?`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`:e===`failed`?`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`}function ge({data:e,loading:t,error:n}){let r=e?.totals.byOutcomeStatus,i=e?.compositionShapes.slice(0,6)??[],a=e?.recent.slice(0,8)??[];return(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(h,{className:`size-4 text-primary`}),` Outcomes`]}),(0,C.jsxs)(_,{variant:`secondary`,children:[e?.totals.total??0,` dissolved`]})]})}),(0,C.jsxs)(y,{className:`space-y-5`,children:[n?(0,C.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:n}):null,t&&!e?(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading outcomes…`}):!e||e.totals.total===0?(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No dissolved teams yet`}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[`success`,`partial`,`failed`,`unknown`].map(e=>{let t=r?.[e]??0;return(0,C.jsxs)(_,{variant:`outline`,className:t===0?`text-muted-foreground`:D(e===`unknown`?null:e),children:[t,` `,e]},e)})}),(0,C.jsxs)(`section`,{className:`space-y-2`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium`,children:`Composition win-rate`}),(0,C.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border`,children:i.map(e=>(0,C.jsxs)(`div`,{className:`grid gap-2 px-3 py-2 text-sm md:grid-cols-[1fr_auto_auto] md:items-center`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`break-words font-medium`,title:e.shape,children:e.shape}),(0,C.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.count,` team`,e.count===1?``:`s`,` · avg `,E(e.avgWallClockMs)]})]}),(0,C.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.successCount,`/`,e.count]}),(0,C.jsx)(_,{variant:`outline`,className:D(e.successRate>=.5?`success`:e.successRate>0?`partial`:`failed`),children:he(e.successRate)})]},e.shape))})]}),(0,C.jsxs)(`section`,{className:`space-y-2`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium`,children:`Recent outcomes`}),(0,C.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border`,children:(0,C.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,C.jsx)(`thead`,{className:`bg-muted/40 text-xs text-muted-foreground`,children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:`Team`}),(0,C.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:`Outcome`}),(0,C.jsx)(`th`,{className:`px-3 py-2 text-right font-medium`,children:`Members`}),(0,C.jsx)(`th`,{className:`px-3 py-2 text-right font-medium`,children:`Duration`})]})}),(0,C.jsx)(`tbody`,{className:`divide-y divide-border`,children:a.map(e=>(0,C.jsxs)(`tr`,{children:[(0,C.jsxs)(`td`,{className:`max-w-[220px] px-3 py-2`,children:[(0,C.jsx)(`div`,{className:`truncate font-medium`,children:e.title||e.id.slice(0,12)}),(0,C.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]}),(0,C.jsx)(`td`,{className:`px-3 py-2`,children:(0,C.jsx)(_,{variant:`outline`,className:D(e.outcome),children:e.outcome??`unknown`})}),(0,C.jsx)(`td`,{className:`px-3 py-2 text-right`,children:e.memberCount}),(0,C.jsx)(`td`,{className:`px-3 py-2 text-right text-muted-foreground`,children:E(e.durationMs)})]},e.id))})]})})]})]})]})]})}var _e=[],ve=[{value:`all`,label:`All kinds`},{value:`decision`,label:`Decisions`},{value:`fact`,label:`Facts`},{value:`ruled_out`,label:`Ruled out`}],ye={decision:`decision`,fact:`fact`,ruled_out:`ruled out`};function be(e){return e.runtimeState?e.runtimeState:e.status===`dissolved`?`dissolved`:e.zeroMembersSince==null?`active`:`orphaned`}var xe={busy:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,idle:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,degraded:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,stalled:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,active:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,orphaned:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,dissolved:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`},Se={success:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,partial:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,failed:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`},Ce={active:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,superseded:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,retracted:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`};function O(e){return e?e.slice(0,12):`-`}function we(e){if(e===void 0)return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function Te(e){if(!e.composition)return null;try{let t=JSON.parse(e.composition);return Array.isArray(t)?t.length:null}catch{return null}}function Ee(e,t){let n=t.trim().toLowerCase();return!n||[e.title,e.id,e.coordinatorId,e.rootCoordinatorId,e.outcomeStatus,e.outcomeSummary].some(e=>String(e??``).toLowerCase().includes(n))}function De(e){return e.status===`offline`?`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`:e.status===`busy`?`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`:e.status===`stale`?`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`}function k(){let[e,n]=(0,S.useState)(null),[r,h]=(0,S.useState)([]),[w,T]=(0,S.useState)(null),[E,he]=(0,S.useState)(`all`),[D,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(!1),[Oe,M]=(0,S.useState)(!1),[ke,N]=(0,S.useState)(null),[P,Ae]=(0,S.useState)(()=>Date.now()),F=o(e=>i(e.sessionUser)),I=o(e=>e.teams),L=e??I[0]?.id??null,R=L?s(`team`,L):``,z=o(e=>e.teamsLoading),B=o(e=>e.teamsError),je=o(e=>e.fetchTeams),V=o(e=>(L?e.issuesByEntity[R]:void 0)??_e),H=o(e=>e.issueRefsById),Me=o(e=>R?!!e.issueLoading[R]:!1),U=o(e=>R?e.issueErrors[R]??null:null),W=o(e=>e.fetchIssuesForEntity),Ne=o(e=>e.teamOutcomeAggregates),Pe=o(e=>e.teamOutcomeAggregatesLoading),Fe=o(e=>e.teamOutcomeAggregatesError),Ie=o(e=>e.fetchTeamOutcomeAggregates),G=o(e=>e.fetchPlan),Le=o(e=>e.dissolveTeam),Re=o(e=>e.openConfirm),K=o(e=>e.agentsById),ze=o(e=>e.switchView),Be=o(e=>e.openInboxThread),Ve=o(e=>L?e.plansByTeam[a(L)]??null:null);async function q(e,t=E){M(!0),N(null);try{let n=new URLSearchParams({team:e});t!==`all`&&n.set(`kind`,t);let r=await p(`GET`,`/blackboard?${n.toString()}`);h(r.entries),T(e)}catch(t){N(c(t)),h([]),T(e)}finally{M(!1)}}async function J(){j(!0),N(null);try{let[t]=await Promise.all([je(),F?Ie():null]);Ae(Date.now());let n=e??t[0]?.id;n&&F?(G({teamId:n}),await Promise.all([q(n,E),W(`team`,n)])):(h([]),T(null))}catch(e){N(c(e))}finally{j(!1)}}(0,S.useEffect)(()=>{J()},[]),(0,S.useEffect)(()=>{F&&w&&q(w,E)},[E]);let Y=(0,S.useMemo)(()=>I.filter(e=>Ee(e,D)),[I,D]),X=I.find(e=>e.id===L)??null,Z=w===L?r:[],Q=(0,S.useMemo)(()=>V.map(e=>({...e,issueRef:H[e.issueRef.id]??e.issueRef})),[H,V]),$=(0,S.useMemo)(()=>L?Object.values(K).filter(e=>e.teamId===L).sort((e,t)=>u(e).localeCompare(u(t))||e.id.localeCompare(t.id)):[],[K,L]),He=(0,S.useMemo)(()=>{let e={decision:[],fact:[],ruled_out:[]};for(let t of Z)e[t.kind].push(t);return e},[Z]),Ue=E===`all`?[`decision`,`fact`,`ruled_out`]:[E];return(0,C.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(ue,{className:`size-5 text-primary`}),(0,C.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Teams`}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`active and dissolved team working sets`})]}),(0,C.jsxs)(g,{variant:`outline`,size:`sm`,onClick:()=>void J(),disabled:A||z,children:[(0,C.jsx)(se,{className:t(`size-4`,(A||z)&&`animate-spin`)}),` Refresh`]})]}),(ke||B)&&(0,C.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:ke||B}),(0,C.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]`,children:[(0,C.jsxs)(`div`,{className:`min-h-[520px] min-w-0 space-y-3`,children:[(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,C.jsx)(`span`,{children:`Team list`}),(0,C.jsx)(_,{variant:`secondary`,children:I.length})]}),(0,C.jsx)(fe,{value:D,onChange:e=>k(e.target.value),placeholder:`Filter teams`,className:`h-8`})]}),(0,C.jsx)(`div`,{children:(A||z)&&I.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Loading teams…`}):Y.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:I.length===0?`No teams`:`No teams match`}):(0,C.jsx)(m,{className:`h-[610px] pr-3`,children:(0,C.jsx)(`div`,{className:`space-y-2`,children:Y.map(e=>{let r=e.id===L,i=Te(e),a=be(e),o=e.coordinatorId,s=()=>{n(e.id),F&&(G({teamId:e.id}),W(`team`,e.id),q(e.id,E))};return(0,C.jsx)(`div`,{role:`button`,tabIndex:0,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:`block w-full cursor-pointer text-left`,children:(0,C.jsx)(x,{className:t(`transition-colors hover:border-primary/50`,r&&`border-primary/60 bg-primary/5`),children:(0,C.jsxs)(y,{className:`space-y-3 p-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.title||O(e.id)}),(0,C.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]}),(0,C.jsx)(_,{variant:`outline`,className:xe[a],children:a})]}),(0,C.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,C.jsx)(`span`,{children:`Coordinator`}),o?(0,C.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Be(o),ze(`chat`)},className:`flex min-w-0 items-center justify-end gap-1 text-right text-primary hover:underline`,title:`Chat with ${o}`,children:[(0,C.jsx)(oe,{className:`size-3 shrink-0`}),(0,C.jsx)(de,{agent:K[o],fallback:o.slice(-8)})]}):(0,C.jsx)(`span`,{className:`text-right text-muted-foreground`,children:`—`}),(0,C.jsx)(`span`,{children:`Members`}),(0,C.jsx)(`span`,{className:`text-right text-foreground`,children:i??`-`}),(0,C.jsx)(`span`,{children:`Created`}),(0,C.jsx)(`span`,{className:`text-right text-foreground`,title:d(e.createdAt),children:l(P,e.createdAt)}),e.dissolvedAt?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{children:`Dissolved`}),(0,C.jsx)(`span`,{className:`text-right text-foreground`,title:d(e.dissolvedAt),children:l(P,e.dissolvedAt)})]}):null]}),a===`orphaned`&&e.zeroMembersSince!=null?(0,C.jsx)(`div`,{className:`flex items-center gap-1.5 border-t border-border pt-2 text-xs text-tone-warning-fg`,title:d(e.zeroMembersSince),children:(0,C.jsxs)(`span`,{children:[`No live members since `,l(P,e.zeroMembersSince),` — auto-dissolving`]})}):null,e.status===`dissolved`?(0,C.jsxs)(`div`,{className:`space-y-1 border-t border-border pt-2`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.outcomeStatus?(0,C.jsx)(_,{variant:`outline`,className:Se[e.outcomeStatus],children:e.outcomeStatus}):(0,C.jsx)(_,{variant:`outline`,children:`no outcome`}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:we(e.wallClockMs)})]}),e.outcomeSummary?(0,C.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.outcomeSummary}):null]}):null]})})},e.id)})})})})]}),(0,C.jsxs)(`div`,{className:`min-h-[520px] min-w-0 space-y-4`,children:[F?(0,C.jsx)(ge,{data:Ne,loading:Pe,error:Fe}):null,F&&X?(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`span`,{children:`Issues`}),(0,C.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[Q.length,` associated`]})]}),Me?(0,C.jsx)(_,{variant:`secondary`,children:`loading`}):null]})}),(0,C.jsx)(y,{children:U?(0,C.jsx)(`div`,{className:`text-xs text-destructive`,children:U}):Q.length===0?(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No associated issues`}):(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Q.map(({association:e,issueRef:t})=>(0,C.jsx)(ae,{issueRef:t,now:P,showSync:!0},`${e.issueRefId}:${e.createdAt}`))})})]}):null,F&&X?(0,C.jsx)(me,{team:X},X.id):null,F&&X&&Ve?(0,C.jsx)(x,{className:`p-0`,children:(0,C.jsx)(f,{teamId:X.id})}):null,(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`span`,{children:`Roster`}),(0,C.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[$.length,` member`,$.length===1?``:`s`]})]}),F&&X&&X.status!==`dissolved`?(0,C.jsxs)(g,{variant:`destructive`,size:`sm`,onClick:()=>Re(`Dissolve Team`,`Dissolve "${X.title||X.id}"? This closes the team working set but keeps its records visible.`,()=>void Le(X.id)),children:[(0,C.jsx)(le,{className:`size-4`}),` Dissolve`]}):null]})}),(0,C.jsx)(y,{children:X?$.length===0?(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No members`}):(0,C.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:$.map(e=>(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 py-2`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(pe,{agent:e,now:P,className:`h-2 w-2`}),(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-sm font-medium`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:u(e)}),(0,C.jsx)(ce,{agent:e})]}),(0,C.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]})]}),(0,C.jsx)(_,{variant:`outline`,className:De(e),children:e.status})]},e.id))}):(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No team selected`})})]}),F?(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`span`,{children:`Blackboard`}),X?(0,C.jsx)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:X.title||X.id}):null]}),(0,C.jsxs)(ie,{value:E,onValueChange:e=>he(e),children:[(0,C.jsx)(te,{size:`sm`,className:`w-36`,children:(0,C.jsx)(ee,{})}),(0,C.jsx)(ne,{children:ve.map(e=>(0,C.jsx)(re,{value:e.value,children:e.label},e.value))})]})]})}),(0,C.jsx)(y,{children:X?Oe&&Z.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Loading blackboard…`}):Z.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`No blackboard entries`}):(0,C.jsx)(m,{className:`h-[640px] pr-3`,children:(0,C.jsx)(`div`,{className:`space-y-5`,children:Ue.map(e=>{let t=He[e];return t.length===0?null:(0,C.jsxs)(`section`,{className:`space-y-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(_,{variant:`secondary`,children:ye[e]}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.length})]}),(0,C.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,C.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-background p-3`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,C.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`by `,O(e.authorId),` · `,l(P,e.updatedAt||e.createdAt)]})]}),(0,C.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:[(0,C.jsx)(_,{variant:`outline`,className:Ce[e.status],children:e.status}),e.supersedes?(0,C.jsxs)(_,{variant:`outline`,children:[`supersedes `,O(e.supersedes)]}):null]})]}),e.body?(0,C.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-muted-foreground`,children:e.body}):null]},e.id))})]},e)})})}):(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`No team selected`})})]}):null]})]})]})}export{k as TeamsView};
|
|
2
|
-
//# sourceMappingURL=teams-
|
|
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{A as i,f as a,t as o,u as s}from"./store-DcClXLH0.js";import{M as c}from"./provider-display-DsuWMvVL.js";import{et as l,f as u,v as d}from"./display-BrKWFGJz.js";import{t as f}from"./PlanGraphPanel-3TlIQpjk.js";import{t as p}from"./api-CIIVBtAV.js";import{t as m}from"./scroll-area-CIN4KQse.js";import{a as ee,i as te,n as ne,r as re,t as ie}from"./select-DTQMP4Dk.js";import{t as h}from"./chart-column-S02ZGfTR.js";import{t as ae}from"./issue-ref-chip-BnSlM_95.js";import{t as oe}from"./message-square-C-1G8dMM.js";import{t as se}from"./refresh-cw-CfpvQcUn.js";import{t as ce}from"./workflow-marker-DAZcj5qt.js";import{t as le}from"./trash-2-FbcSq927.js";import{t as ue}from"./users-C7B3u9jv.js";import{t as g}from"./button-Do6Z3vvn.js";import{t as _}from"./badge-DqJRtj_p.js";import{t as de}from"./agent-name-DKbiIhBo.js";import{t as fe}from"./input-CsTB6jIx.js";import{t as pe}from"./status-dot-DYqlEUhJ.js";import{o as v,r as y,s as b,t as x}from"./card-C4QJ4hCW.js";var S=e(n(),1),C=r();function w(e){return Promise.all([p(`GET`,`/teams/${encodeURIComponent(e)}/spawn-delegation`),p(`GET`,`/projects`)])}function me({team:e}){let[t,n]=(0,S.useState)(null),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(null),s=e.parentTeamId??e.id;async function l(){let[e,t]=await w(s);n(e),i(t.projects),o(null)}return(0,S.useEffect)(()=>{let e=!0;return w(s).then(([t,r])=>{e&&(n(t),i(r.projects))}).catch(t=>{e&&o(c(t))}),()=>{e=!1}},[s]),(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsx)(b,{children:`Spawn delegation`})}),(0,C.jsxs)(y,{className:`space-y-3`,children:[(0,C.jsx)(g,{variant:`outline`,onClick:()=>{l().catch(e=>o(c(e)))},children:`Reload delegation`}),a?(0,C.jsx)(`p`,{role:`alert`,children:a}):null,t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`p`,{children:[`Version `,t.team.spawnDelegation?.version??0,` · `,t.occupied,`/`,t.limit,` occupied · depth limit 2`]}),e.parentTeamId?(0,C.jsxs)(`p`,{children:[`Grant managed by root team `,s]}):(0,C.jsx)(T,{state:t,projects:r,onSaved:l},`${t.team.id}:${t.team.spawnDelegation?.version??0}`),t.projects.filter(e=>e.error).map(e=>(0,C.jsxs)(`p`,{role:`alert`,children:[e.title??e.id,`: `,e.error]},e.id)),(0,C.jsx)(`ul`,{"aria-label":`Delegated tree`,children:t.launches.map(e=>(0,C.jsxs)(`li`,{style:{marginLeft:(e.depth-1)*16},children:[e.parentId,` → `,e.agentId,` · `,e.profile,` · `,t.projects.find(t=>t.id===e.projectId)?.title??e.projectId??`project unavailable`,` · depth `,e.depth,` · `,e.status,e.stopping?` · stopping; cleanup pending`:``,e.error?(0,C.jsxs)(`span`,{role:`alert`,children:[` · `,e.error]}):null]},e.agentId))})]}):null]})]})}function T({state:e,projects:t,onSaved:n}){let[r,i]=(0,S.useState)(e.team.spawnDelegation?.enabled??!1),[a,o]=(0,S.useState)(e.team.spawnDelegation?.projectIds??(e.team.projectId?[e.team.projectId]:[])),[s,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),f=[...t.map(e=>({id:e.id,title:e.title??e.slug})),...e.projects.filter(e=>!t.some(t=>t.id===e.id)).map(e=>({id:e.id,title:`${e.id} (unavailable)`}))];async function m(){d(!0),l(null);try{await p(`PATCH`,`/teams/${encodeURIComponent(e.team.id)}/spawn-delegation`,{expectedVersion:e.team.spawnDelegation?.version??0,requestId:crypto.randomUUID(),enabled:r,projectIds:a}),await n()}catch(e){l(c(e))}finally{d(!1)}}return(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),` Enable delegated spawning`]}),f.map(e=>(0,C.jsxs)(`label`,{className:`block`,children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:a.includes(e.id),onChange:t=>o(t.target.checked?[...a,e.id]:a.filter(t=>t!==e.id))}),` `,e.title]},e.id)),(0,C.jsx)(g,{disabled:u,onClick:()=>{m()},children:`Save delegation`}),s?(0,C.jsx)(`p`,{role:`alert`,children:s}):null]})}function E(e){if(e==null)return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function he(e){return`${Math.round(e*100)}%`}function D(e){return e===`success`?`bg-tone-success/10 text-tone-success-fg border-tone-success/20`:e===`partial`?`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`:e===`failed`?`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`}function ge({data:e,loading:t,error:n}){let r=e?.totals.byOutcomeStatus,i=e?.compositionShapes.slice(0,6)??[],a=e?.recent.slice(0,8)??[];return(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(h,{className:`size-4 text-primary`}),` Outcomes`]}),(0,C.jsxs)(_,{variant:`secondary`,children:[e?.totals.total??0,` dissolved`]})]})}),(0,C.jsxs)(y,{className:`space-y-5`,children:[n?(0,C.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:n}):null,t&&!e?(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading outcomes…`}):!e||e.totals.total===0?(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No dissolved teams yet`}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[`success`,`partial`,`failed`,`unknown`].map(e=>{let t=r?.[e]??0;return(0,C.jsxs)(_,{variant:`outline`,className:t===0?`text-muted-foreground`:D(e===`unknown`?null:e),children:[t,` `,e]},e)})}),(0,C.jsxs)(`section`,{className:`space-y-2`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium`,children:`Composition win-rate`}),(0,C.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border`,children:i.map(e=>(0,C.jsxs)(`div`,{className:`grid gap-2 px-3 py-2 text-sm md:grid-cols-[1fr_auto_auto] md:items-center`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`break-words font-medium`,title:e.shape,children:e.shape}),(0,C.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.count,` team`,e.count===1?``:`s`,` · avg `,E(e.avgWallClockMs)]})]}),(0,C.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.successCount,`/`,e.count]}),(0,C.jsx)(_,{variant:`outline`,className:D(e.successRate>=.5?`success`:e.successRate>0?`partial`:`failed`),children:he(e.successRate)})]},e.shape))})]}),(0,C.jsxs)(`section`,{className:`space-y-2`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium`,children:`Recent outcomes`}),(0,C.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border`,children:(0,C.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,C.jsx)(`thead`,{className:`bg-muted/40 text-xs text-muted-foreground`,children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:`Team`}),(0,C.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:`Outcome`}),(0,C.jsx)(`th`,{className:`px-3 py-2 text-right font-medium`,children:`Members`}),(0,C.jsx)(`th`,{className:`px-3 py-2 text-right font-medium`,children:`Duration`})]})}),(0,C.jsx)(`tbody`,{className:`divide-y divide-border`,children:a.map(e=>(0,C.jsxs)(`tr`,{children:[(0,C.jsxs)(`td`,{className:`max-w-[220px] px-3 py-2`,children:[(0,C.jsx)(`div`,{className:`truncate font-medium`,children:e.title||e.id.slice(0,12)}),(0,C.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]}),(0,C.jsx)(`td`,{className:`px-3 py-2`,children:(0,C.jsx)(_,{variant:`outline`,className:D(e.outcome),children:e.outcome??`unknown`})}),(0,C.jsx)(`td`,{className:`px-3 py-2 text-right`,children:e.memberCount}),(0,C.jsx)(`td`,{className:`px-3 py-2 text-right text-muted-foreground`,children:E(e.durationMs)})]},e.id))})]})})]})]})]})]})}var _e=[],ve=[{value:`all`,label:`All kinds`},{value:`decision`,label:`Decisions`},{value:`fact`,label:`Facts`},{value:`ruled_out`,label:`Ruled out`}],ye={decision:`decision`,fact:`fact`,ruled_out:`ruled out`};function be(e){return e.runtimeState?e.runtimeState:e.status===`dissolved`?`dissolved`:e.zeroMembersSince==null?`active`:`orphaned`}var xe={busy:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,idle:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,degraded:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,stalled:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,active:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,orphaned:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,dissolved:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`},Se={success:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,partial:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,failed:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`},Ce={active:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,superseded:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,retracted:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`};function O(e){return e?e.slice(0,12):`-`}function we(e){if(e===void 0)return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<48?`${r}h`:`${Math.round(r/24)}d`}function Te(e){if(!e.composition)return null;try{let t=JSON.parse(e.composition);return Array.isArray(t)?t.length:null}catch{return null}}function Ee(e,t){let n=t.trim().toLowerCase();return!n||[e.title,e.id,e.coordinatorId,e.rootCoordinatorId,e.outcomeStatus,e.outcomeSummary].some(e=>String(e??``).toLowerCase().includes(n))}function De(e){return e.status===`offline`?`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`:e.status===`busy`?`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`:e.status===`stale`?`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`}function k(){let[e,n]=(0,S.useState)(null),[r,h]=(0,S.useState)([]),[w,T]=(0,S.useState)(null),[E,he]=(0,S.useState)(`all`),[D,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(!1),[Oe,M]=(0,S.useState)(!1),[ke,N]=(0,S.useState)(null),[P,Ae]=(0,S.useState)(()=>Date.now()),F=o(e=>i(e.sessionUser)),I=o(e=>e.teams),L=e??I[0]?.id??null,R=L?s(`team`,L):``,z=o(e=>e.teamsLoading),B=o(e=>e.teamsError),je=o(e=>e.fetchTeams),V=o(e=>(L?e.issuesByEntity[R]:void 0)??_e),H=o(e=>e.issueRefsById),Me=o(e=>R?!!e.issueLoading[R]:!1),U=o(e=>R?e.issueErrors[R]??null:null),W=o(e=>e.fetchIssuesForEntity),Ne=o(e=>e.teamOutcomeAggregates),Pe=o(e=>e.teamOutcomeAggregatesLoading),Fe=o(e=>e.teamOutcomeAggregatesError),Ie=o(e=>e.fetchTeamOutcomeAggregates),G=o(e=>e.fetchPlan),Le=o(e=>e.dissolveTeam),Re=o(e=>e.openConfirm),K=o(e=>e.agentsById),ze=o(e=>e.switchView),Be=o(e=>e.openInboxThread),Ve=o(e=>L?e.plansByTeam[a(L)]??null:null);async function q(e,t=E){M(!0),N(null);try{let n=new URLSearchParams({team:e});t!==`all`&&n.set(`kind`,t);let r=await p(`GET`,`/blackboard?${n.toString()}`);h(r.entries),T(e)}catch(t){N(c(t)),h([]),T(e)}finally{M(!1)}}async function J(){j(!0),N(null);try{let[t]=await Promise.all([je(),F?Ie():null]);Ae(Date.now());let n=e??t[0]?.id;n&&F?(G({teamId:n}),await Promise.all([q(n,E),W(`team`,n)])):(h([]),T(null))}catch(e){N(c(e))}finally{j(!1)}}(0,S.useEffect)(()=>{J()},[]),(0,S.useEffect)(()=>{F&&w&&q(w,E)},[E]);let Y=(0,S.useMemo)(()=>I.filter(e=>Ee(e,D)),[I,D]),X=I.find(e=>e.id===L)??null,Z=w===L?r:[],Q=(0,S.useMemo)(()=>V.map(e=>({...e,issueRef:H[e.issueRef.id]??e.issueRef})),[H,V]),$=(0,S.useMemo)(()=>L?Object.values(K).filter(e=>e.teamId===L).sort((e,t)=>u(e).localeCompare(u(t))||e.id.localeCompare(t.id)):[],[K,L]),He=(0,S.useMemo)(()=>{let e={decision:[],fact:[],ruled_out:[]};for(let t of Z)e[t.kind].push(t);return e},[Z]),Ue=E===`all`?[`decision`,`fact`,`ruled_out`]:[E];return(0,C.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(ue,{className:`size-5 text-primary`}),(0,C.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Teams`}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`active and dissolved team working sets`})]}),(0,C.jsxs)(g,{variant:`outline`,size:`sm`,onClick:()=>void J(),disabled:A||z,children:[(0,C.jsx)(se,{className:t(`size-4`,(A||z)&&`animate-spin`)}),` Refresh`]})]}),(ke||B)&&(0,C.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:ke||B}),(0,C.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(320px,420px)_1fr]`,children:[(0,C.jsxs)(`div`,{className:`min-h-[520px] min-w-0 space-y-3`,children:[(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,C.jsx)(`span`,{children:`Team list`}),(0,C.jsx)(_,{variant:`secondary`,children:I.length})]}),(0,C.jsx)(fe,{value:D,onChange:e=>k(e.target.value),placeholder:`Filter teams`,className:`h-8`})]}),(0,C.jsx)(`div`,{children:(A||z)&&I.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Loading teams…`}):Y.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:I.length===0?`No teams`:`No teams match`}):(0,C.jsx)(m,{className:`h-[610px] pr-3`,children:(0,C.jsx)(`div`,{className:`space-y-2`,children:Y.map(e=>{let r=e.id===L,i=Te(e),a=be(e),o=e.coordinatorId,s=()=>{n(e.id),F&&(G({teamId:e.id}),W(`team`,e.id),q(e.id,E))};return(0,C.jsx)(`div`,{role:`button`,tabIndex:0,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:`block w-full cursor-pointer text-left`,children:(0,C.jsx)(x,{className:t(`transition-colors hover:border-primary/50`,r&&`border-primary/60 bg-primary/5`),children:(0,C.jsxs)(y,{className:`space-y-3 p-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.title||O(e.id)}),(0,C.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]}),(0,C.jsx)(_,{variant:`outline`,className:xe[a],children:a})]}),(0,C.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,C.jsx)(`span`,{children:`Coordinator`}),o?(0,C.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Be(o),ze(`chat`)},className:`flex min-w-0 items-center justify-end gap-1 text-right text-primary hover:underline`,title:`Chat with ${o}`,children:[(0,C.jsx)(oe,{className:`size-3 shrink-0`}),(0,C.jsx)(de,{agent:K[o],fallback:o.slice(-8)})]}):(0,C.jsx)(`span`,{className:`text-right text-muted-foreground`,children:`—`}),(0,C.jsx)(`span`,{children:`Members`}),(0,C.jsx)(`span`,{className:`text-right text-foreground`,children:i??`-`}),(0,C.jsx)(`span`,{children:`Created`}),(0,C.jsx)(`span`,{className:`text-right text-foreground`,title:d(e.createdAt),children:l(P,e.createdAt)}),e.dissolvedAt?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{children:`Dissolved`}),(0,C.jsx)(`span`,{className:`text-right text-foreground`,title:d(e.dissolvedAt),children:l(P,e.dissolvedAt)})]}):null]}),a===`orphaned`&&e.zeroMembersSince!=null?(0,C.jsx)(`div`,{className:`flex items-center gap-1.5 border-t border-border pt-2 text-xs text-tone-warning-fg`,title:d(e.zeroMembersSince),children:(0,C.jsxs)(`span`,{children:[`No live members since `,l(P,e.zeroMembersSince),` — auto-dissolving`]})}):null,e.status===`dissolved`?(0,C.jsxs)(`div`,{className:`space-y-1 border-t border-border pt-2`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.outcomeStatus?(0,C.jsx)(_,{variant:`outline`,className:Se[e.outcomeStatus],children:e.outcomeStatus}):(0,C.jsx)(_,{variant:`outline`,children:`no outcome`}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:we(e.wallClockMs)})]}),e.outcomeSummary?(0,C.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.outcomeSummary}):null]}):null]})})},e.id)})})})})]}),(0,C.jsxs)(`div`,{className:`min-h-[520px] min-w-0 space-y-4`,children:[F?(0,C.jsx)(ge,{data:Ne,loading:Pe,error:Fe}):null,F&&X?(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`span`,{children:`Issues`}),(0,C.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[Q.length,` associated`]})]}),Me?(0,C.jsx)(_,{variant:`secondary`,children:`loading`}):null]})}),(0,C.jsx)(y,{children:U?(0,C.jsx)(`div`,{className:`text-xs text-destructive`,children:U}):Q.length===0?(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No associated issues`}):(0,C.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Q.map(({association:e,issueRef:t})=>(0,C.jsx)(ae,{issueRef:t,now:P,showSync:!0},`${e.issueRefId}:${e.createdAt}`))})})]}):null,F&&X?(0,C.jsx)(me,{team:X},X.id):null,F&&X&&Ve?(0,C.jsx)(x,{className:`p-0`,children:(0,C.jsx)(f,{teamId:X.id})}):null,(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`span`,{children:`Roster`}),(0,C.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[$.length,` member`,$.length===1?``:`s`]})]}),F&&X&&X.status!==`dissolved`?(0,C.jsxs)(g,{variant:`destructive`,size:`sm`,onClick:()=>Re(`Dissolve Team`,`Dissolve "${X.title||X.id}"? This closes the team working set but keeps its records visible.`,()=>void Le(X.id)),children:[(0,C.jsx)(le,{className:`size-4`}),` Dissolve`]}):null]})}),(0,C.jsx)(y,{children:X?$.length===0?(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No members`}):(0,C.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:$.map(e=>(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 py-2`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,C.jsx)(pe,{agent:e,now:P,className:`h-2 w-2`}),(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-sm font-medium`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:u(e)}),(0,C.jsx)(ce,{agent:e})]}),(0,C.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.id})]})]}),(0,C.jsx)(_,{variant:`outline`,className:De(e),children:e.status})]},e.id))}):(0,C.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No team selected`})})]}),F?(0,C.jsxs)(x,{children:[(0,C.jsx)(v,{children:(0,C.jsxs)(b,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`span`,{children:`Blackboard`}),X?(0,C.jsx)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:X.title||X.id}):null]}),(0,C.jsxs)(ie,{value:E,onValueChange:e=>he(e),children:[(0,C.jsx)(te,{size:`sm`,className:`w-36`,children:(0,C.jsx)(ee,{})}),(0,C.jsx)(ne,{children:ve.map(e=>(0,C.jsx)(re,{value:e.value,children:e.label},e.value))})]})]})}),(0,C.jsx)(y,{children:X?Oe&&Z.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`Loading blackboard…`}):Z.length===0?(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`No blackboard entries`}):(0,C.jsx)(m,{className:`h-[640px] pr-3`,children:(0,C.jsx)(`div`,{className:`space-y-5`,children:Ue.map(e=>{let t=He[e];return t.length===0?null:(0,C.jsxs)(`section`,{className:`space-y-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(_,{variant:`secondary`,children:ye[e]}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.length})]}),(0,C.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,C.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-background p-3`,children:[(0,C.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,C.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`by `,O(e.authorId),` · `,l(P,e.updatedAt||e.createdAt)]})]}),(0,C.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:[(0,C.jsx)(_,{variant:`outline`,className:Ce[e.status],children:e.status}),e.supersedes?(0,C.jsxs)(_,{variant:`outline`,children:[`supersedes `,O(e.supersedes)]}):null]})]}),e.body?(0,C.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-muted-foreground`,children:e.body}):null]},e.id))})]},e)})})}):(0,C.jsx)(`div`,{className:`py-16 text-center text-sm text-muted-foreground`,children:`No team selected`})})]}):null]})]})]})}export{k as TeamsView};
|
|
2
|
+
//# sourceMappingURL=teams-bowI7qVY.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./terminal-viewer-impl-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t,u as n}from"./dist-DeW2Y1R5.js";import{t as r}from"./preload-helper-HclGiUj8.js";var i=e(t(),1),a=n(),o=(0,i.lazy)(()=>r(()=>import(`./terminal-viewer-impl-
|
|
3
|
-
//# sourceMappingURL=terminal-viewer-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./terminal-viewer-impl-Dz22UPy6.js","./rolldown-runtime-QTnfLwEv.js","./dist-DeW2Y1R5.js","./store-DcClXLH0.js","./provider-display-DsuWMvVL.js","./display-BrKWFGJz.js","./api-CIIVBtAV.js","./agent-liveness-CaNwK0Zf.js","./dialog-uuJ9_geR.js","./dist-CoWL6B0c.js","./react-dom-DSFxiC7T.js","./dist-B2h2GeWt.js","./dist-C1xmD7qJ.js","./dist-DwBdqQ6H.js","./es2015-DMmZ8vbD.js","./dist-H3DLHJ0C.js","./x-Bge17hWJ.js","./button-Do6Z3vvn.js","./keyboard-DcmEulph.js","./pause-DttnHD4c.js","./play-BbT8m7A0.js","./refresh-cw-CfpvQcUn.js","./terminal-Bl2u7KxT.js","./terminal-viewer-impl-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t,u as n}from"./dist-DeW2Y1R5.js";import{t as r}from"./preload-helper-HclGiUj8.js";var i=e(t(),1),a=n(),o=(0,i.lazy)(()=>r(()=>import(`./terminal-viewer-impl-Dz22UPy6.js`).then(e=>({default:e.TerminalDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url));function s(e){return e.open?(0,a.jsx)(i.Suspense,{fallback:null,children:(0,a.jsx)(o,{...e})}):null}export{s as t};
|
|
3
|
+
//# sourceMappingURL=terminal-viewer-BgVLHdsU.js.map
|
|
@@ -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"./store-BvtFdlGX.js";import{M as a}from"./provider-display-DbLWpP3j.js";import{u as o}from"./api-CIIVBtAV.js";import{r as s,s as c,t as l}from"./dialog-uuJ9_geR.js";import{t as u}from"./keyboard-DcmEulph.js";import{t as d}from"./pause-DttnHD4c.js";import{t as f}from"./play-BbT8m7A0.js";import{t as p}from"./refresh-cw-CfpvQcUn.js";import{t as m}from"./terminal-Bl2u7KxT.js";import{t as h}from"./x-Bge17hWJ.js";import{t as g}from"./button-Do6Z3vvn.js";var _=e(n(),1),v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,ee=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0})},b=(e,t,n,r)=>{for(var i=r>1?void 0:r?y(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&v(t,n,i),i},x=(e,t)=>(n,r)=>t(n,r,e),te=`Terminal input`,S={get:()=>te,set:e=>te=e},ne=`Too much output to announce, navigate to rows manually to read`,re={get:()=>ne,set:e=>ne=e};function C(e){return e.replace(/\r?\n/g,`\r`)}function ie(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function w(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ae(e,t,n,r){e.stopPropagation(),e.clipboardData&&oe(e.clipboardData.getData(`text/plain`),t,n,r)}function oe(e,t,n,r){e=C(e),e=ie(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function se(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function T(e,t,n,r,i){se(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function E(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function D(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ce=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},le=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},O=``,ue=` `,de=class e{constructor(){this.fg=0,this.bg=0,this.extended=new k}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},k=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},fe=class e extends de{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new k,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?E(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},pe=`di$target`,me=`di$dependencies`,he=new Map;function ge(e){return e[me]||[]}function A(e){if(he.has(e))return he.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);_e(t,e,r)};return t._id=e,he.set(e,t),t}function _e(e,t,n){t[pe]===t?t[me].push({id:e,index:n}):(t[me]=[{id:e,index:n}],t[pe]=t)}var j=A(`BufferService`),ve=A(`CoreMouseService`),ye=A(`CoreService`),be=A(`CharsetService`),xe=A(`InstantiationService`),Se=A(`LogService`),Ce=A(`OptionsService`),we=A(`OscLinkService`),Te=A(`UnicodeService`),Ee=A(`DecorationService`),De=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new fe,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Oe(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};De=b([x(0,j),x(1,Ce),x(2,we)],De);function Oe(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{o as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-DcClXLH0.js";import{M as a}from"./provider-display-DsuWMvVL.js";import{u as o}from"./api-CIIVBtAV.js";import{r as s,s as c,t as l}from"./dialog-uuJ9_geR.js";import{t as u}from"./keyboard-DcmEulph.js";import{t as d}from"./pause-DttnHD4c.js";import{t as f}from"./play-BbT8m7A0.js";import{t as p}from"./refresh-cw-CfpvQcUn.js";import{t as m}from"./terminal-Bl2u7KxT.js";import{t as h}from"./x-Bge17hWJ.js";import{t as g}from"./button-Do6Z3vvn.js";var _=e(n(),1),v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,ee=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0})},b=(e,t,n,r)=>{for(var i=r>1?void 0:r?y(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&v(t,n,i),i},x=(e,t)=>(n,r)=>t(n,r,e),te=`Terminal input`,S={get:()=>te,set:e=>te=e},ne=`Too much output to announce, navigate to rows manually to read`,re={get:()=>ne,set:e=>ne=e};function C(e){return e.replace(/\r?\n/g,`\r`)}function ie(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function w(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ae(e,t,n,r){e.stopPropagation(),e.clipboardData&&oe(e.clipboardData.getData(`text/plain`),t,n,r)}function oe(e,t,n,r){e=C(e),e=ie(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function se(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function T(e,t,n,r,i){se(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function E(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function D(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ce=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},le=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},O=``,ue=` `,de=class e{constructor(){this.fg=0,this.bg=0,this.extended=new k}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},k=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},fe=class e extends de{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new k,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?E(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},pe=`di$target`,me=`di$dependencies`,he=new Map;function ge(e){return e[me]||[]}function A(e){if(he.has(e))return he.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);_e(t,e,r)};return t._id=e,he.set(e,t),t}function _e(e,t,n){t[pe]===t?t[me].push({id:e,index:n}):(t[me]=[{id:e,index:n}],t[pe]=t)}var j=A(`BufferService`),ve=A(`CoreMouseService`),ye=A(`CoreService`),be=A(`CharsetService`),xe=A(`InstantiationService`),Se=A(`LogService`),Ce=A(`OptionsService`),we=A(`OscLinkService`),Te=A(`UnicodeService`),Ee=A(`DecorationService`),De=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new fe,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Oe(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};De=b([x(0,j),x(1,Ce),x(2,we)],De);function Oe(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var ke=A(`CharSizeService`),Ae=A(`CoreBrowserService`),je=A(`MouseService`),Me=A(`RenderService`),Ne=A(`SelectionService`),Pe=A(`CharacterJoinerService`),Fe=A(`ThemeService`),Ie=A(`LinkProviderService`),Le=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Ue.isErrorNoTelemetry(e)?new Ue(e.message+`
|
|
4
4
|
|
|
@@ -140,4 +140,4 @@ ${s.join(`
|
|
|
140
140
|
`))}},pp=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},mp=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},hp=0,gp=class{constructor(e){this.value=e,this.id=hp++}},_p=2,vp,yp=class{constructor(e){this._size=0,this._options=e,this._leakageMon=lp>0||this._options?.leakWarningThreshold?new dp(e?.onListenerError??jf,this._options?.leakWarningThreshold??lp):void 0,this._perfMon=this._options?._profName?new cp(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new mp(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||jf)(n),np.None}if(this._disposed)return np.None;t&&(e=e.bind(t));let r=new gp(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=fp.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof gp?(this._deliveryQueue??=new bp,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=$f(()=>{vp?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof tp?n.add(a):Array.isArray(n)&&n.push(a),vp){let e=Error().stack.split(`
|
|
141
141
|
`).slice(2,3).join(`
|
|
142
142
|
`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);vp.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*_p<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||jf;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof gp)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},bp=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},xp=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new yp,this.onChange=this._onChange.event;let e=new kf;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},Sp=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],Cp=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],wp=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Tp=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],Ep;function Dp(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var Op=class{constructor(){if(this.version=`11`,!Ep){Ep=new Uint8Array(65536),Ep.fill(1),Ep[0]=0,Ep.fill(0,1,32),Ep.fill(0,127,160);for(let e=0;e<Sp.length;++e)Ep.fill(0,Sp[e][0],Sp[e][1]+1);for(let e=0;e<wp.length;++e)Ep.fill(2,wp[e][0],wp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ep[e]:Dp(e,Cp)?0:Dp(e,Tp)?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=xp.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return xp.createPropertyValue(0,n,r)}},kp=class{activate(e){e.unicode.register(new Op)}dispose(){}},$=r();function Ap(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function jp(e){if(e)try{let t=document.createElement(`div`);t.style.color=`oklch(${e})`,document.body.appendChild(t);let n=getComputedStyle(t).color;document.body.removeChild(t);let r=n.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return r?`#${[r[1],r[2],r[3]].map(e=>Number(e).toString(16).padStart(2,`0`)).join(``)}`:void 0}catch{return}}function Mp(){let e=jp(Ap(`--background`))??`#09090b`,t=jp(Ap(`--foreground`))??`#e4e4e7`;return{background:e,foreground:t,cursor:t,selectionBackground:jp(Ap(`--muted`))??`#3f3f46`}}function Np({orchestratorId:e,session:n,interactive:r=!1,canWrite:s=!1,onClose:c,onSessionChanged:l}){let v=i(e=>e.apiCall),y=i(e=>e.theme),ee=(0,_.useRef)(l);ee.current=l;let b=(0,_.useRef)(null),x=(0,_.useRef)(null),te=(0,_.useRef)(null),S=(0,_.useRef)(null),ne=(0,_.useRef)(!1),re=(0,_.useRef)(Promise.resolve()),C=(0,_.useRef)(null),ie=(0,_.useRef)(null),w=(0,_.useRef)(null),ae=(0,_.useRef)(!1),oe=(0,_.useRef)(!1),se=(0,_.useRef)(!1),[T,E]=(0,_.useState)(!1),[D,ce]=(0,_.useState)(null),[le,O]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[k,fe]=(0,_.useState)(r&&s),pe=(0,_.useRef)(r&&s),[me,he]=(0,_.useState)(`connecting`),ge=(0,_.useRef)(!1),[A,_e]=(0,_.useState)(!1),j=(0,_.useCallback)(()=>{let e=oe.current||se.current;ae.current=e;let t=S.current;t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:`pause`,paused:e}))},[]);(0,_.useEffect)(()=>{oe.current=T,j()},[T,j]),(0,_.useEffect)(()=>{let e=()=>{se.current=document.hidden||!document.hasFocus(),j()};return e(),document.addEventListener(`visibilitychange`,e),window.addEventListener(`blur`,e),window.addEventListener(`focus`,e),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`blur`,e),window.removeEventListener(`focus`,e)}},[j]);let ve=(0,_.useCallback)(e=>{let t=x.current;if(t){let n=(e.content||``).replace(/\n$/,``);t.write(`\x1b[H\x1b[2J\x1b[3J${n}`),e.cursorX!=null&&e.cursorY!=null&&t.write(`\x1b[${e.cursorY+1};${e.cursorX+1}H`)}ce(e.running),de(e.capturedAt),O(null)},[]),ye=(0,_.useCallback)(async()=>{if(ae.current||ne.current)return;let t=S.current;if(t?.readyState===WebSocket.OPEN){t.send(JSON.stringify({type:`refresh`}));return}ne.current=!0;try{let t=await v(`GET`,`/orchestrators/${encodeURIComponent(e)}/terminal/${encodeURIComponent(n)}`);ve(t)}catch(e){O(a(e))}finally{ne.current=!1}},[e,n,v,ve]);function be(t,r){let i=w.current;if(i&&i.cols===t&&i.rows===r)return;w.current={cols:t,rows:r};let a=S.current;if(a?.readyState===WebSocket.OPEN){a.send(JSON.stringify({type:`resize`,cols:t,rows:r}));return}v(`POST`,`/orchestrators/${encodeURIComponent(e)}/terminal/${encodeURIComponent(n)}/resize`,{cols:t,rows:r}).catch(()=>{})}function xe(){let e=te.current,t=x.current;if(!(!e||!t))try{e.fit(),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{be(t.cols,t.rows)},300)}catch{}}function Se(t){if(!t)return;let r=t.match(/[\s\S]{1,2048}/g)??[],i=S.current;if(i?.readyState===WebSocket.OPEN){for(let e of r)i.send(JSON.stringify({type:`input`,data:e}));return}for(let t of r)re.current=re.current.then(()=>v(`POST`,`/orchestrators/${encodeURIComponent(e)}/terminal/${encodeURIComponent(n)}/input`,{data:t})).then(()=>{O(null)}).catch(e=>{if(a(e).includes(`session changed`)){O(`session changed; reopening terminal…`),ee.current?.();return}O(a(e))})}function Ce(e){if(ge.current&&e.length===1){let t=e.toLowerCase().charCodeAt(0);if(t>=97&&t<=122){Se(String.fromCharCode(t-96)),ge.current=!1,_e(!1);return}}Se(e)}function we(e){Se(e),x.current?.focus()}function Te(){let e=!ge.current;ge.current=e,_e(e)}return(0,_.useEffect)(()=>{let e=new qs,t=new Ws({convertEol:!0,cursorBlink:!1,disableStdin:!k,fontFamily:`"JetBrains Mono", "SFMono-Regular", Consolas, monospace`,fontSize:13,lineHeight:1.15,scrollback:5e3,scrollSensitivity:3,fastScrollSensitivity:10,theme:Mp()});t.loadAddon(e);try{t.loadAddon(new kp),t.unicode.activeVersion=`11`}catch{}if(x.current=t,te.current=e,b.current){t.open(b.current);let e=0,n=()=>{let t=x.current;if(t)try{let r=new wf;r.onContextLoss(()=>{r.dispose(),!(e>=3)&&(e+=1,ie.current&&clearTimeout(ie.current),ie.current=setTimeout(n,3e3))}),t.loadAddon(r)}catch{}};n(),requestAnimationFrame(()=>xe())}let n=b.current,r=0,i=0,a=0,o=null;function s(e){e.touches.length===1&&(r=e.touches[0].clientY,i=e.touches[0].clientX,a=0,o=null)}function c(e){if(e.touches.length!==1)return;let t=x.current;if(!t)return;let n=r-e.touches[0].clientY,s=i-e.touches[0].clientX;if(o===null&&(Math.abs(n)>8||Math.abs(s)>8)&&(o=Math.abs(n)>Math.abs(s)),o!==!0)return;a+=n,r=e.touches[0].clientY;let c=Math.trunc(a/15);c!==0&&(t.scrollLines(c),a-=c*15),e.preventDefault(),e.stopPropagation()}n.addEventListener(`touchstart`,s,{capture:!0,passive:!0}),n.addEventListener(`touchmove`,c,{capture:!0,passive:!1});let l=new ResizeObserver(()=>{requestAnimationFrame(()=>xe())});return b.current&&l.observe(b.current),ye(),()=>{n.removeEventListener(`touchstart`,s,{capture:!0}),n.removeEventListener(`touchmove`,c,{capture:!0}),l.disconnect(),C.current&&clearTimeout(C.current),ie.current&&clearTimeout(ie.current),t.dispose(),x.current=null,te.current=null}},[e,n]),(0,_.useEffect)(()=>{let e=x.current;e&&requestAnimationFrame(()=>{e.options.theme=Mp()})},[y]),(0,_.useEffect)(()=>{pe.current=k;let e=S.current;e?.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:`interactive`,interactive:k}));let t=x.current;if(t&&(t.options.disableStdin=!k,k)){let e=t.onData(Ce);return setTimeout(()=>t.focus(),50),()=>e.dispose()}},[k]),(0,_.useEffect)(()=>{let t=!1,r=!1,i=0,a=null,s=null,c=()=>{if(t||r||a)return;let e=Math.min(1e4,1e3*2**i);i+=1,a=setTimeout(()=>{a=null,l()},e)},l=()=>{if(t||r)return;he(`connecting`);let a=o(e,n);a.binaryType=`arraybuffer`,s=a,S.current=a,a.onopen=()=>{if(t)return;i=0,he(`stream`),O(null),a.send(JSON.stringify({type:`pause`,paused:ae.current})),a.send(JSON.stringify({type:`interactive`,interactive:pe.current}));let e=x.current;try{te.current?.fit()}catch{}e&&a.send(JSON.stringify({type:`resize`,cols:e.cols,rows:e.rows}))},a.onmessage=e=>{let t=x.current;if(typeof e.data!=`string`){if(!t)return;e.data instanceof ArrayBuffer?t.write(new Uint8Array(e.data)):e.data instanceof Blob&&e.data.arrayBuffer().then(e=>x.current?.write(new Uint8Array(e)));return}try{let n=JSON.parse(e.data);n.type===`reset`?(t&&t.write(`\x1B[H\x1B[2J\x1B[3J`),typeof n.running==`boolean`&&ce(n.running),typeof n.capturedAt==`number`&&de(n.capturedAt),O(null)):n.type===`closed`?n.reason===`backpressure`?(O(`stream reset (backpressure) — reconnecting`),a.close()):n.reason===`session-changed`?(O(`session changed; reopening terminal…`),a.close(),ee.current?.()):(r=!0,ce(!1),n.reason&&O(n.reason)):n.type===`error`&&O(n.error||`terminal stream error`)}catch{O(`invalid terminal stream frame`)}},a.onerror=()=>{t||O(`terminal stream failed; falling back to polling`)},a.onclose=()=>{t||(S.current===a&&(S.current=null),he(`polling`),c())}};return l(),()=>{t=!0,a&&clearTimeout(a),S.current===s&&(S.current=null),s?.close()}},[e,n]),(0,_.useEffect)(()=>{if(me===`stream`||me===`connecting`)return;let e=setInterval(()=>void ye(),k?1e3:1500);return()=>clearInterval(e)},[ye,k,me]),(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1 px-1.5 py-1.5 border-b border-border bg-background shrink-0 w-full`,children:[(0,$.jsx)(m,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground truncate min-w-0`,children:n}),(0,$.jsx)(`span`,{className:t(`text-xs shrink-0 ml-auto`,D===!1?`text-tone-danger-fg`:D===!0?`text-tone-success-fg`:`text-muted-foreground`),children:D===!1?`stopped`:D===!0?`live`:`…`}),(0,$.jsx)(`span`,{className:t(`text-xs shrink-0 hidden sm:inline`,me===`stream`?`text-tone-sky-fg`:me===`polling`?`text-tone-warning-fg`:`text-muted-foreground`),children:me}),(0,$.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:!s,onClick:()=>s&&fe(e=>!e),title:s?k?`Disable input`:`Enable input`:`Read-only: no write access to this session`,className:t(`h-7 w-7`,k?`text-tone-success-fg`:``),children:(0,$.jsx)(u,{className:`h-3.5 w-3.5`})}),(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>E(e=>!e),title:T?`Resume`:`Pause`,className:`h-7 w-7`,children:T?(0,$.jsx)(f,{className:`h-3.5 w-3.5`}):(0,$.jsx)(d,{className:`h-3.5 w-3.5`})}),(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>void ye(),title:`Refresh`,className:`hidden sm:inline-flex h-7 w-7`,children:(0,$.jsx)(p,{className:`h-3.5 w-3.5`})}),c&&(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:c,title:`Close`,className:`h-7 w-7`,children:(0,$.jsx)(h,{className:`h-3.5 w-3.5`})})]})]}),le&&(0,$.jsx)(`div`,{className:`px-3 py-1 text-xs text-destructive bg-destructive/10 border-b border-destructive/20`,children:le}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 bg-background p-1 overscroll-contain`,children:(0,$.jsx)(`div`,{ref:b,className:`h-full w-full overscroll-contain`})}),k&&(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-t border-border bg-muted/30 px-1.5 py-1.5`,children:[[{label:`Esc`,seq:`\x1B`},{label:`Tab`,seq:` `},{label:`↑`,seq:`\x1B[A`},{label:`↓`,seq:`\x1B[B`},{label:`←`,seq:`\x1B[D`},{label:`→`,seq:`\x1B[C`},{label:`^C`,seq:``},{label:`^D`,seq:``},{label:`^Z`,seq:``}].map(e=>(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 rounded border border-border bg-background px-2 py-1 font-mono text-xs text-foreground active:bg-accent`,onPointerDown:e=>e.preventDefault(),onClick:()=>we(e.seq),children:e.label},e.label)),(0,$.jsx)(`button`,{type:`button`,className:t(`shrink-0 rounded border px-2 py-1 font-mono text-xs`,A?`border-primary bg-primary/20 text-primary`:`border-border bg-background text-foreground active:bg-accent`),onPointerDown:e=>e.preventDefault(),onClick:Te,children:`Ctrl`})]})]})}function Pp({open:e,onOpenChange:t,orchestratorId:n,session:r,interactive:i,canWrite:a,onSessionChanged:o}){return(0,$.jsx)(l,{open:e,onOpenChange:t,children:(0,$.jsxs)(s,{className:`inset-x-0 top-0 h-[var(--app-h)] max-h-none translate-x-0 translate-y-0 w-auto max-w-none rounded-none p-0 pt-[var(--sat)] bg-background border-border gap-0 overflow-hidden`,showCloseButton:!1,blurOverlay:!1,onEscapeKeyDown:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,$.jsxs)(c,{className:`sr-only`,children:[`Terminal — `,r]}),(0,$.jsx)(Np,{orchestratorId:n,session:r,interactive:i,canWrite:a,onClose:()=>t(!1),onSessionChanged:o})]})})}export{Pp as TerminalDialog};
|
|
143
|
-
//# sourceMappingURL=terminal-viewer-impl-
|
|
143
|
+
//# sourceMappingURL=terminal-viewer-impl-Dz22UPy6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t}from"./dist-DeW2Y1R5.js";import{t as n}from"./store-
|
|
2
|
-
//# sourceMappingURL=use-agent-terminal-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t}from"./dist-DeW2Y1R5.js";import{t as n}from"./store-DcClXLH0.js";import{t as r}from"./api-CIIVBtAV.js";var i=e(t(),1);function a(e){let t=n(e=>e.showError),[a,o]=(0,i.useState)(!1),[s,c]=(0,i.useState)(null),[l,u]=(0,i.useState)(!1),d=(0,i.useRef)(s);return d.current=s,{terminalOpen:a,terminalTarget:s,terminalOpening:l,openTerminal:(0,i.useCallback)(async()=>{if(!(!e||l)){u(!0);try{let t=await r(`POST`,`/agents/`+encodeURIComponent(e)+`/terminal-session`);c(t),o(!0)}catch(e){t(`Terminal Failed`,e.message,e)}finally{u(!1)}}},[e,l,t]),closeTerminal:(0,i.useCallback)(t=>{if(t){o(!0);return}o(!1);let n=d.current;e&&n?.mode===`guest`&&r(`DELETE`,`/agents/`+encodeURIComponent(e)+`/terminal-session/`+encodeURIComponent(n.session)).catch(()=>{}),c(null)},[e])}}export{a as t};
|
|
2
|
+
//# sourceMappingURL=use-agent-terminal-DSQQ-iY7.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,Ft as a,It as o,J as s,Pt as c,q as l,t as u}from"./store-
|
|
2
|
-
//# sourceMappingURL=use-decisions-
|
|
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,Ft as a,It as o,J as s,Pt as c,q as l,t as u}from"./store-DcClXLH0.js";import"./provider-display-DsuWMvVL.js";import{et as d}from"./display-BrKWFGJz.js";import{t as f}from"./check-B3M9Ug1P.js";import{n as p,r as m,t as h}from"./zap-DGuDTw4w.js";import{t as g}from"./external-link-BRfu-fHG.js";import{t as _}from"./loader-circle-BfPd4kOD.js";import{t as v}from"./button-Do6Z3vvn.js";import{t as y}from"./badge-DqJRtj_p.js";import{t as b}from"./textarea-hs6Mpyfl.js";import{t as x}from"./formatted-body-CQBwc1fb.js";import{t as S}from"./VaultDecisionCard-Bau_vNax.js";var C=e(n(),1),w=r();function T(e){let t=e.options?.find(e=>e.recommended),n=t?.id??t?.label;return{labels:n?[n]:[],other:``,otherActive:!1}}function E(e,t,n){let r=t.otherActive||e.kind===`text`?t.other.trim():``;if(e.kind===`multi`){let e=r?[...t.labels,r]:t.labels;return e.length||n?e:null}return e.kind===`text`?r||null:r||t.labels[0]||null}function D({decision:e,className:t}){return s(e)?(0,w.jsx)(S,{decision:e,className:t}):(0,w.jsx)(O,{decision:e,className:t})}function O({decision:e,className:n}){let r=u(e=>e.answerDecision),s=u(e=>e.showWorkflowRun),l=i(),S=e.kind===`action`,D=S?e.questions.filter(e=>e.id!==o):e.questions,[O,A]=(0,C.useState)(()=>Object.fromEntries(D.map(e=>[e.id,T(e)]))),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(null),F=N!==null,I={};for(let t of D){let n=E(t,O[t.id],!!e.workflow);n!==null&&(I[t.id]=n)}let L=S||Object.keys(I).length===D.length,R=S?D.filter(e=>e.required&&I[e.id]===void 0):[],z=j.trim(),B=R.length>0,V=!z;function H(e,t){A(n=>({...n,[e]:{...n[e],...t}}))}function U(e,t){let n=O[e.id];e.kind===`multi`?H(e.id,{labels:n.labels.includes(t)?n.labels.filter(e=>e!==t):[...n.labels,t]}):H(e.id,{labels:[t],otherActive:!1})}function W(e){let t=O[e.id];e.kind===`multi`?H(e.id,{otherActive:!t.otherActive}):H(e.id,{labels:[],otherActive:!0})}async function G(t){if(!(!L||F)&&!(t===`Done`&&B)&&!(t===`Could not do it`&&V)){P(t??`submit`);try{await r(e.id,t?{...I,[o]:t}:I,j.trim()||void 0)}finally{P(null)}}}let K=S?m:p;return(0,w.jsxs)(`div`,{"data-testid":`decision-card-${e.id}`,"data-kind":e.kind,className:t(`rounded-xl bg-card ring-1 px-3.5 py-3 text-sm`,e.timeCritical?`ring-tone-danger/45`:S?`ring-tone-sky/40`:`ring-tone-warning/35`,n),children:[(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(K,{className:t(`mt-0.5 h-4 w-4 shrink-0`,S?`text-tone-sky-fg`:`text-tone-warning-fg`)}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`div`,{className:`font-medium text-foreground break-words`,children:e.title}),(0,w.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground`,children:[S&&(0,w.jsx)(y,{variant:`outline`,className:`h-4 border-tone-sky/50 px-1 text-[10px] text-tone-sky-fg`,children:`To do for you`}),(0,w.jsxs)(`span`,{children:[`#`,e.id]}),(0,w.jsxs)(`span`,{children:[`· waiting `,d(l,e.createdAt)]}),e.timeCritical&&(0,w.jsxs)(y,{variant:`outline`,className:`h-4 gap-0.5 border-tone-danger/50 px-1 text-[10px] text-tone-danger-fg`,children:[(0,w.jsx)(h,{className:`h-2.5 w-2.5`}),`time-critical`]})]})]})]}),e.context&&(0,w.jsx)(x,{text:e.context,rawBody:e.context,className:t(`mt-2 leading-relaxed`,S?`text-[13px] text-foreground/90`:`text-xs text-muted-foreground`)}),e.workflow&&(0,w.jsxs)(`a`,{href:e.links[0],className:`mt-2 inline-flex text-xs text-tone-sky-fg hover:underline`,onClick:t=>{t.preventDefault(),s(e.workflow.runId)},children:[`Run `,e.workflow.runId,` · step `,e.workflow.step]}),!e.workflow&&e.links.length>0&&(0,w.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-2`,children:e.links.map(e=>(0,w.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-tone-sky-fg hover:underline break-all`,children:[(0,w.jsx)(g,{className:`h-3 w-3 shrink-0`}),e]},e))}),D.map(t=>{let n=O[t.id],r=t.kind===`multi`;return(0,w.jsxs)(`fieldset`,{className:`mt-3`,disabled:F,children:[(0,w.jsxs)(`legend`,{className:`text-sm text-foreground whitespace-pre-wrap break-words`,children:[t.prompt,S&&(t.required?(0,w.jsx)(`span`,{className:`font-medium text-tone-warning-fg`,children:` (required)`}):(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:` (optional)`}))]}),r&&(0,w.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Select all that apply`}),t.kind===`text`?(0,w.jsx)(b,{rows:2,"aria-label":t.prompt,"aria-required":t.required||void 0,value:n.other,onChange:e=>H(t.id,{other:e.target.value}),placeholder:`Your answer`,className:`mt-1.5 text-sm`}):(0,w.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[t.options?.map(e=>(0,w.jsxs)(k,{multi:r,selected:n.labels.includes(e.id??e.label),onClick:()=>U(t,e.id??e.label),children:[(0,w.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),e.recommended&&(0,w.jsx)(y,{variant:`outline`,className:`ml-1.5 h-4 px-1 text-[10px] text-tone-success-fg border-tone-success/40`,children:`recommended`}),e.description&&(0,w.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]},e.id??e.label)),!e.workflow&&(0,w.jsx)(k,{multi:r,selected:n.otherActive,onClick:()=>W(t),children:(0,w.jsx)(`span`,{className:`text-sm text-foreground`,children:`Other…`})}),n.otherActive&&(0,w.jsx)(b,{rows:2,"aria-label":`${t.prompt} (other)`,value:n.other,onChange:e=>H(t.id,{other:e.target.value,otherActive:!0}),placeholder:`Type your answer`,className:`text-sm`})]})]},t.id)}),(0,w.jsx)(b,{rows:2,"aria-label":S?`Note`:`Notes`,value:j,disabled:F,onChange:e=>M(e.target.value),placeholder:S?`Note for the agent (needed for Could not do it)`:`Notes for the agent (optional)`,className:`mt-3 text-sm`}),S?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`mt-2.5 flex gap-2`,children:[(0,w.jsxs)(v,{disabled:F||B,"aria-describedby":`decision-hint-done-${e.id}`,onClick:()=>void G(c),className:`h-11 flex-1 bg-tone-success-fg text-background hover:bg-tone-success-fg/90 sm:h-8 sm:flex-none sm:px-3`,children:[N===`Done`?(0,w.jsx)(_,{className:`animate-spin`}):(0,w.jsx)(f,{}),c]}),(0,w.jsxs)(v,{variant:`outline`,disabled:F||V,"aria-describedby":`decision-hint-not-done-${e.id}`,onClick:()=>void G(a),className:`h-11 flex-1 sm:h-8 sm:flex-none sm:px-3`,children:[N===`Could not do it`&&(0,w.jsx)(_,{className:`animate-spin`}),a]})]}),(B||V)&&(0,w.jsxs)(`div`,{"data-testid":`decision-hints`,className:`mt-1.5 space-y-0.5 text-[11px] text-muted-foreground`,children:[B&&(0,w.jsxs)(`p`,{id:`decision-hint-done-${e.id}`,className:`break-words`,children:[`To mark Done, answer: `,R.map(e=>e.prompt).join(`; `)]}),V&&(0,w.jsx)(`p`,{id:`decision-hint-not-done-${e.id}`,children:`Could not do it needs a short note saying why.`})]})]}):(0,w.jsx)(`div`,{className:`mt-3 flex items-center`,children:(0,w.jsxs)(v,{size:`sm`,disabled:!L||F,onClick:()=>void G(),className:`h-7 px-2.5 text-xs`,children:[F&&(0,w.jsx)(_,{className:`mr-1.5 h-3 w-3 animate-spin`}),`Submit`]})})]})}function k({multi:e,selected:n,onClick:r,children:i}){return(0,w.jsxs)(`button`,{type:`button`,role:e?`checkbox`:`radio`,"aria-checked":n,onClick:r,className:t(`flex items-start gap-2 rounded-lg border px-2.5 py-2 text-left transition-colors`,n?`border-tone-warning/60 bg-tone-warning/10`:`border-border bg-background/60 hover:bg-background`),children:[(0,w.jsx)(`span`,{className:t(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center border text-tone-warning-fg`,e?`rounded`:`rounded-full`,n?`border-tone-warning bg-tone-warning/20`:`border-muted-foreground/40`),children:n&&(0,w.jsx)(f,{className:`h-3 w-3`})}),(0,w.jsx)(`span`,{className:`min-w-0`,children:i})]})}function A(){let e=u(e=>e.openDecisions),t=i();return(0,C.useMemo)(()=>{let n=new Map;for(let r of e)r.coordinatorId&&!l(r,t)&&n.set(r.coordinatorId,(n.get(r.coordinatorId)??0)+1);return n},[e,t])}var j=[];function M(e){let t=u(e=>e.openDecisions);return(0,C.useMemo)(()=>{let n=t.filter(t=>t.coordinatorId===e);return n.length?n:j},[t,e])}function N(e){return`${e.id}:${e.updatedAt}`}export{D as i,M as n,A as r,N as t};
|
|
2
|
+
//# sourceMappingURL=use-decisions-samMQhQf.js.map
|
|
@@ -0,0 +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{r as i,t as a}from"./store-DcClXLH0.js";import{M as o}from"./provider-display-DsuWMvVL.js";import{et as s,v as c}from"./display-BrKWFGJz.js";import{t as l}from"./api-CIIVBtAV.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-DTQMP4Dk.js";import{t as h}from"./folder-tree-BG3Y9nqH.js";import{t as g}from"./globe-Cl5fXtqs.js";import{t as _}from"./layers-DEfClY-v.js";import{t as v}from"./pencil-B1Hf2V_J.js";import{n as y,t as b}from"./pin-DcsKeXxr.js";import{t as x}from"./refresh-cw-CfpvQcUn.js";import{t as S}from"./trash-2-FbcSq927.js";import{t as C}from"./button-Do6Z3vvn.js";import{t as w}from"./badge-DqJRtj_p.js";import{t as T}from"./input-CsTB6jIx.js";import{t as E}from"./textarea-hs6Mpyfl.js";import{t as D}from"./formatted-body-CQBwc1fb.js";import{t as O}from"./token-estimate-Co-Jdphh.js";var k=[`manual`,`promoted`,`steward`];function A(e){return k.includes(e)}var j=[`project-wide`,`process`,`tooling`];function M(e){return j.includes(e)}var N=e(n(),1),P=r(),F=`border-tone-violet/30 bg-tone-violet/10 text-tone-violet-fg`,I=`border-tone-teal/30 bg-tone-teal/10 text-tone-teal-fg`;function L({area:e,active:n,onClick:r}){let i=M(e),a=i?g:h,o=t(`inline-flex h-5 max-w-full items-center gap-1 rounded-md border px-1.5 font-mono text-[10px]`,i?F:I,n&&`ring-2 ring-primary/60`),s=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,P.jsx)(`span`,{className:`truncate`,children:e})]}),c=i?`system area`:`path area`;return r?(0,P.jsx)(`button`,{type:`button`,className:t(o,`cursor-pointer hover:brightness-110`),"data-area-kind":i?`system`:`path`,"aria-pressed":n,title:`${c} — filter`,onClick:r,children:s}):(0,P.jsx)(`span`,{className:o,"data-area-kind":i?`system`:`path`,title:c,children:s})}function R(e){let t=new Map;for(let n of e)for(let e of n.areas??[])t.set(e,(t.get(e)??0)+1);return[...t].sort(([e],[t])=>Number(M(t))-Number(M(e))||e.localeCompare(t))}function z(e){let t=new Map;for(let n of e)for(let e of n.tags)t.set(e,(t.get(e)??0)+1);return[...t].sort(([e,t],[n,r])=>r-t||e.localeCompare(n))}function B({counts:e,active:t,onChange:n}){return e.length===0?null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,role:`group`,"aria-label":`Filter by area`,children:[(0,P.jsx)(`span`,{className:`mr-0.5 text-[10px] text-muted-foreground`,children:`Areas`}),e.map(([e,r])=>(0,P.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-0.5`,children:[(0,P.jsx)(L,{area:e,active:t===e,onClick:()=>n(t===e?null:e)}),(0,P.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:r})]},e)),t&&(0,P.jsx)(`button`,{type:`button`,className:`text-[10px] text-primary hover:underline`,onClick:()=>n(null),children:`clear`})]})}var V=[`rule`,`decision`,`fact`,`memory`],H={rule:`Rules`,decision:`Decisions`,fact:`Facts`,memory:`Memory`},U=[`pinned`,`indexed`,`never`],W=[`ingested`,...V],G={ingested:`Ingested CLAUDE.md`,...H};function K(e){return e===`ingested`?`bg-tone-info/10 text-tone-info-fg border-tone-info/30`:e===`promoted`?`bg-tone-success/10 text-tone-success-fg border-tone-success/30`:e===`steward`?`bg-tone-violet/10 text-tone-violet-fg border-tone-violet/30`:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/30`}function q(e){return`${e.length}c/${O(e)}t`}function J(e){return!e.inherited&&A(e.source)}function Y(e,t){return{kind:e?.kind??t??`memory`,title:e?.title??``,body:e?.body??``,tags:e?.tags??[],audience:e?.audience??`all`,inject:e?.inject??`indexed`}}function X(e){return{kind:e.kind,title:e.title,body:e.body,tags:e.tags,audience:e.audience,inject:e.inject}}var Z=320;function Q({audience:e,onChange:t,profiles:n}){let r=e===`all`;function i(n){let i=r?[]:e,a=i.includes(n)?i.filter(e=>e!==n):[...i,n];t(a.length?a:`all`)}return(0,P.jsxs)(`div`,{className:`min-w-[220px] flex-1 space-y-1`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`Profiles (audience)`}),(0,P.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground select-none`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`rounded`,checked:r,onChange:e=>t(e.target.checked?`all`:[])}),`All profiles`]})]}),!r&&(n.length===0?(0,P.jsx)(`div`,{className:`rounded border border-border px-1.5 py-1 text-[10px] text-muted-foreground`,children:`No agent profiles found.`}):(0,P.jsx)(`div`,{className:`grid max-h-28 grid-cols-2 gap-0.5 overflow-y-auto rounded border border-border p-1`,children:n.map(t=>(0,P.jsxs)(`label`,{className:`flex items-center gap-1.5 rounded px-1 py-0.5 text-[10px] hover:bg-accent`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`rounded`,checked:e.includes(t.name),onChange:()=>i(t.name)}),(0,P.jsxs)(`span`,{className:`truncate font-mono`,children:[t.icon?`${t.icon} `:``,t.name]})]},t.name))}))]})}function $({initial:e,submitLabel:t,onSubmit:n,onCancel:r}){let s=a(e=>e.agentProfiles),[c,l]=(0,N.useState)(e.kind),[h,g]=(0,N.useState)(e.title),[_,v]=(0,N.useState)(e.body),[y,b]=(0,N.useState)(e.tags.join(`, `)),[x,S]=(0,N.useState)(e.audience),[w,D]=(0,N.useState)(e.inject),[O,k]=(0,N.useState)(!1),[A,j]=(0,N.useState)(null);async function M(){if(!h.trim()){j(`Title is required`);return}k(!0),j(null);let e=y.split(`,`).map(e=>e.trim()).filter(Boolean);try{await n({kind:c,title:h.trim(),body:_,tags:e,audience:x,inject:w})}catch(e){j(o(e)),k(!1)}}return(0,P.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border bg-card/60 p-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,P.jsxs)(m,{value:c,onValueChange:e=>l(e),children:[(0,P.jsx)(d,{size:`sm`,className:`w-32`,children:(0,P.jsx)(u,{})}),(0,P.jsx)(f,{children:V.map(e=>(0,P.jsx)(p,{value:e,children:H[e]},e))})]}),(0,P.jsx)(T,{value:h,onChange:e=>g(e.target.value),placeholder:`Title`,className:`h-8 min-w-[200px] flex-1`})]}),(0,P.jsx)(E,{value:_,onChange:e=>v(e.target.value),placeholder:`Body (markdown)`,className:`min-h-24 font-mono text-xs`}),(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-[9px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[`label `,q(h)]}),(0,P.jsxs)(`span`,{children:[`body `,q(_)]})]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,P.jsx)(T,{value:y,onChange:e=>b(e.target.value),placeholder:`tags, comma, separated`,className:`h-8 min-w-[160px] flex-1 text-xs`}),(0,P.jsxs)(m,{value:w,onValueChange:e=>D(e),children:[(0,P.jsx)(d,{size:`sm`,className:`w-28`,children:(0,P.jsx)(u,{})}),(0,P.jsx)(f,{children:U.map(e=>(0,P.jsx)(p,{value:e,children:e},e))})]})]}),(0,P.jsx)(Q,{audience:x,onChange:S,profiles:i(s)}),A&&(0,P.jsx)(`div`,{className:`text-xs text-destructive`,children:A}),(0,P.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,P.jsx)(C,{variant:`outline`,size:`sm`,onClick:r,disabled:O,children:`Cancel`}),(0,P.jsx)(C,{size:`sm`,onClick:()=>void M(),disabled:O,children:O?`Saving…`:t})]})]})}function ee({entry:e,ownerName:t,now:n,editing:r,expanded:i,onToggleExpanded:a,onEdit:o,onDelete:l,onTogglePin:u,onSubmitEdit:d,onCancelEdit:f,onAreaClick:p}){if(r)return(0,P.jsx)($,{initial:Y(e),submitLabel:`Save`,onSubmit:d,onCancel:f});let m=e.body??``,h=m.length>Z,g=i||!h?m:m.slice(0,Z).trimEnd()+`…`,x=J(e),T=e.inject===`pinned`;return(0,P.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-3`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`min-w-0 break-words text-sm font-medium`,children:e.title}),(0,P.jsx)(w,{variant:`outline`,className:`text-[10px] ${K(e.source)}`,children:e.source}),T&&(0,P.jsxs)(w,{variant:`outline`,className:`gap-1 border-primary/30 bg-primary/10 text-[10px] text-primary`,children:[(0,P.jsx)(b,{className:`h-3 w-3`}),`pinned`]}),e.inherited&&(0,P.jsxs)(w,{variant:`outline`,className:`gap-1 border-tone-warning/30 bg-tone-warning/10 text-[10px] text-tone-warning-fg`,children:[(0,P.jsx)(_,{className:`h-3 w-3`}),`inherited`,t?` · ${t}`:``]}),(0,P.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,title:`Created ${c(e.createdAt)}`,children:s(n,e.updatedAt)}),x&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(C,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:u,title:T?`Unpin (revert to indexed)`:`Pin (always render full body)`,children:T?(0,P.jsx)(y,{className:`h-3 w-3 text-primary`}):(0,P.jsx)(b,{className:`h-3 w-3`})}),(0,P.jsx)(C,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:o,title:`Edit entry`,children:(0,P.jsx)(v,{className:`h-3 w-3`})}),(0,P.jsx)(C,{variant:`ghost`,size:`icon`,className:`h-6 w-6 text-destructive hover:text-destructive`,onClick:l,title:`Remove entry`,children:(0,P.jsx)(S,{className:`h-3 w-3`})})]})]})]}),m&&(0,P.jsxs)(`div`,{className:`mt-2`,children:[(0,P.jsx)(D,{text:g,className:`text-xs text-muted-foreground`}),h&&(0,P.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:a,children:i?`Show less`:`Show more`})]}),(e.areas?.length||e.tags.length>0)&&(0,P.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[e.areas?.map(e=>(0,P.jsx)(L,{area:e,onClick:p&&(()=>p(e))},`area:${e}`)),e.tags.map(e=>(0,P.jsx)(w,{variant:`secondary`,className:`h-4 px-1 text-[9px]`,children:e},e))]}),(0,P.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[9px] text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[`label `,q(e.title)]}),m&&(0,P.jsxs)(`span`,{children:[`body `,q(m)]}),(0,P.jsxs)(`span`,{children:[`Created `,c(e.createdAt)]}),(0,P.jsxs)(`span`,{children:[`Updated `,c(e.updatedAt)]})]})]})}function te(){let e=a(e=>e.projectFocusId),t=a(e=>e.consumeProjectFocus),[n,r]=(0,N.useState)([]),[i,s]=(0,N.useState)(``),[c,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(!0),[p,m]=(0,N.useState)(null);async function h(){m(null);try{let n=await l(`GET`,`/projects${c?`?includeArchived=true`:``}`);r(n.projects);let i=e?n.projects.find(t=>t.id===e||t.slug===e):void 0;i?(s(i.id),t()):s(e=>n.projects.some(t=>t.id===e)?e:n.projects[0]?.id??``)}catch(e){m(o(e))}finally{f(!1)}}return(0,N.useEffect)(()=>{h()},[c]),(0,N.useEffect)(()=>{let r=e?n.find(t=>t.id===e||t.slug===e):void 0;r&&(s(r.id),t())},[e]),{projects:n,selectedId:i,setSelectedId:s,includeArchived:c,setIncludeArchived:u,loading:d,error:p,setError:m,refresh:h}}function ne({list:e}){let{projects:t,selectedId:n,setSelectedId:r,includeArchived:i,setIncludeArchived:a}=e;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`select`,{"aria-label":`Project`,className:`ml-auto h-8 w-full min-w-0 max-w-full basis-full rounded-md border border-border bg-card px-2 text-sm text-foreground sm:w-auto sm:basis-auto`,value:n,onChange:e=>r(e.target.value),disabled:t.length===0,children:[t.length===0&&(0,P.jsx)(`option`,{value:``,children:`No projects`}),t.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title||e.slug,e.status===`archived`?` (archived)`:``]},e.id))]}),(0,P.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground select-none`,children:[(0,P.jsx)(`input`,{type:`checkbox`,className:`rounded`,checked:i,onChange:e=>a(e.target.checked)}),`Archived`]})]})}function re({icon:e,title:t,list:n,actions:r,onRefresh:i}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e,(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:t}),(0,P.jsx)(ne,{list:n}),r,(0,P.jsxs)(C,{variant:`outline`,size:`sm`,onClick:i,children:[(0,P.jsx)(x,{className:`size-4`}),` Refresh`]})]}),n.error&&(0,P.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:n.error})]})}export{$ as a,Y as c,R as d,z as f,W as i,J as l,te as n,ee as o,G as r,X as s,re as t,B as u};
|
|
2
|
+
//# sourceMappingURL=use-project-list-59LheVP7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t}from"./dist-DeW2Y1R5.js";import{St as n,Tt as r,n as i,t as a}from"./store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{p as t}from"./dist-DeW2Y1R5.js";import{St as n,Tt as r,n as i,t as a}from"./store-DcClXLH0.js";import{t as o}from"./provider-display-DsuWMvVL.js";import{A as s,C as c,E as l,F as u,M as d,O as f,P as p,T as m,ct as h,d as g,f as _,i as v,it as y,j as b,k as x,s as S,tt as C,wt as w}from"./display-BrKWFGJz.js";import{s as T}from"./api-CIIVBtAV.js";var E=e(t(),1);function D(e){return a(e)}var O=null;function k(e){let t=O;if(t&&t.agents===e.agents&&t.showBuiltIns===e.showBuiltIns&&t.showOffline===e.showOffline&&t.managedPolicies===e.managedPolicies)return t.summary;let n=new Set(y(e.agents,e.showBuiltIns,e.managedPolicies)),r={online:0,offline:0,needsHumanResponse:0,needsHumanResponseIds:``,shownIds:``,hosts:``},i=[],a=[],o=new Set;for(let t of e.agents){let s=v(t);s&&i.push(t.id),n.has(t)&&(t.machine&&o.add(t.machine),t.status===`offline`?r.offline++:r.online++,!(!e.showOffline&&t.status===`offline`)&&(a.push(t.id),s&&r.needsHumanResponse++))}return r.needsHumanResponseIds=i.join(`
|
|
2
2
|
`),r.shownIds=a.join(`
|
|
3
3
|
`),r.hosts=[...o].sort().join(`
|
|
4
4
|
`),O={agents:e.agents,showBuiltIns:e.showBuiltIns,showOffline:e.showOffline,managedPolicies:e.managedPolicies,summary:r},r}function A(e){return new Set(e?e.split(`
|
|
5
5
|
`):[])}function j(){let e=D(e=>e.pairs);return(0,E.useMemo)(()=>{let t={};for(let n of e)(n.status===`active`||n.status===`pending`)&&(n.requesterId&&(t[n.requesterId]=n),n.targetId&&(t[n.targetId]=n));return t},[e])}function M(e){let t=D(e=>e.messages),n=D(e=>e.tasks),r=D(e=>e.pairs),i=D(e=>e.inboxReadCursors),a=D(e=>e.inboxArchivedThreads);return(0,E.useMemo)(()=>{if(!e)return{unread:0,needsHumanResponse:!1,pendingPairInvite:!1,claimableTasks:0,total:0,score:0};let o=t.filter(t=>c(t)===e.id&&!b(t)),u=Number(a[e.id]||0),d=u>=o.filter(e=>s(e)&&l(e)).reduce((e,t)=>Math.max(e,t.id),0)&&u>0?0:o.filter(t=>p(i,e.id,t)).length,m=v(e),h=r.find(t=>(t.status===`active`||t.status===`pending`)&&(t.requesterId===e.id||t.targetId===e.id))?.status===`pending`,_=n.filter(t=>x(t)&&g(t.target,e)).length+t.filter(t=>f(t)&&g(t.to,e)).length;return{unread:d,needsHumanResponse:m,pendingPairInvite:h,claimableTasks:_,total:d+ +!!m+ +!!h+_,score:d*10+(m?8:0)+(h?4:0)+_*2}},[e,t,n,r,i,a])}function N(){let e=D(e=>e.agents),t=D(e=>e.showBuiltIns),i=D(e=>e.showOffline),a=D(e=>e.agentSort),o=D(e=>e.agentSortDir),s=D(e=>e.agentPresetFilter),c=D(e=>e.agentStatusFilter),l=D(e=>e.agentTagFilter),u=D(e=>e.agentHostFilter),d=D(e=>e.managedPolicies),f=D(e=>e.pairs);return(0,E.useMemo)(()=>{let r=y(e,t,d);if(s){let e=P(f);r=F(r,s,n.getState().now,e)}i||(r=r.filter(e=>e.status!==`offline`)),c===`starting`?r=r.filter(e=>e.status!==`offline`&&!e.ready):c&&(r=r.filter(e=>e.status===c)),l&&(r=r.filter(e=>(e.tags||[]).includes(l))),u&&(r=r.filter(e=>(e.machine||``)===u));let p=o===`desc`?-1:1;return[...r].sort((e,t)=>a===`name`?_(e).localeCompare(_(t))*p:a===`lastSeen`?(new Date(t.lastSeen).getTime()-new Date(e.lastSeen).getTime())*p||_(e).localeCompare(_(t)):a===`created`?(new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())*p||_(e).localeCompare(_(t)):((w[e.status]??9)-(w[t.status]??9))*p||_(e).localeCompare(_(t)))},[e,t,i,d,a,o,s,c,l,u,f,r()])}function P(e){let t={};for(let n of e)(n.status===`active`||n.status===`pending`)&&(n.requesterId&&(t[n.requesterId]=n),n.targetId&&(t[n.targetId]=n));return t}function F(e,t,n,r){switch(t){case`active`:return e.filter(e=>e.status!==`offline`);case`offline_stale`:return e.filter(e=>e.status===`offline`||m(n,e));case`paired`:return e.filter(e=>!!r[e.id]);case`unpaired`:return e.filter(e=>!r[e.id]);default:return o().includes(t)?e.filter(e=>S(e)===t):e}}function I(e,t){let n=null;for(let r=e.length-1;r>=0;r--){let i=e[r];if(!i)continue;if(!d(i))return i;let a=i.payload?.session?.type;!n&&(t||a!==`reasoning`)&&(n=i)}return n}function L(){return D(z)}var R=null;function z(e){let t=[e.messages,e.inboxReadCursors,e.inboxArchivedThreads,k(e).needsHumanResponseIds,e.coordinatorMutes,e.chatFilters.reasoning],n=R;if(n&&t.every((e,t)=>e===n.inputs[t]))return n.threads;let[r,i,a,o,s,l]=t,u=A(o),d=new Map;for(let e of r){if(b(e))continue;let t=c(e);t&&(d.has(t)||d.set(t,{id:t,peer:t,messages:[],lastMessage:null,previewMessage:null,attention:{unread:0,needsHumanResponse:!1,score:0},archived:!1,draft:``}),d.get(t).messages.push(e))}for(let[e,t]of d){t.messages.sort((e,t)=>e.id-t.id),t.lastMessage=t.messages[t.messages.length-1]||null,t.previewMessage=I(t.messages,l);let r=s.includes(t.peer),o=r?0:t.messages.filter(e=>p(i,t.peer,e)).length,c=!r&&u.has(t.peer);t.attention={unread:o,needsHumanResponse:c,score:o*10+(c?8:0)};let f=Number(a[t.peer]||0);t.archived=!!(t.lastMessage?.id&&f>=t.lastMessage.id);let m=n?.byPeer.get(e);m&&B(m,t)&&d.set(e,m)}let f=[...d.values()].sort((e,t)=>{let n=(t.attention.score||0)-(e.attention.score||0);return n===0?(t.lastMessage?.id||0)-(e.lastMessage?.id||0):n});return R={inputs:t,byPeer:d,threads:n&&n.threads.length===f.length&&f.every((e,t)=>e===n.threads[t])?n.threads:f},R.threads}function B(e,t){return e.previewMessage===t.previewMessage&&e.archived===t.archived&&e.attention.unread===t.attention.unread&&e.attention.needsHumanResponse===t.attention.needsHumanResponse&&e.messages.length===t.messages.length&&e.messages.every((e,n)=>e===t.messages[n])}function V(){let e=L(),t=D(e=>e.inboxDrafts);return(0,E.useMemo)(()=>Object.keys(t).length===0&&e.every(e=>!e.draft)?e:e.map(e=>{let n=t[e.peer]||``;return n===e.draft?e:{...e,draft:n}}),[e,t])}function H(){let e=L(),t=D(e=>k(e).shownIds),n=D(e=>k(e).needsHumanResponse),r=D(e=>e.pairs),i=D(e=>e.tasks),a=D(e=>e.messages),o=(0,E.useMemo)(()=>A(t),[t]);return(0,E.useMemo)(()=>{let t=e.filter(e=>!e.archived&&o.has(e.peer)).reduce((e,t)=>e+(t.attention.unread||0),0),s=r.filter(e=>e.status===`pending`).length,c=i.filter(x).length+a.filter(f).length;return{unreadInbox:t,needsHumanResponse:n,pendingPairInvites:s,claimableTasks:c,total:t+n+s+c}},[e,o,n,r,i,a])}function U(){return D(e=>k(e).online)}function W(){return D(e=>k(e).offline)}function G(){let e=D(e=>e.agents);return(0,E.useMemo)(()=>e.filter(e=>e.status===`busy`).length,[e])}function K(e=!0){let t=i(e,e=>e.agents),n=i(e,e=>e.showBuiltIns),r=i(e,e=>e.showOffline),a=i(e,e=>e.managedPolicies);return(0,E.useMemo)(()=>{let e=y(t,n,a);return r?e:e.filter(e=>e.status!==`offline`)},[t,n,r,a])}function q(){let e=D(e=>k(e).hosts);return(0,E.useMemo)(()=>[...A(e)],[e])}function J(){let e=D(e=>e.agents),t=D(e=>e.showBuiltIns),n=D(e=>e.managedPolicies);return(0,E.useMemo)(()=>[...new Set(y(e,t,n).flatMap(e=>e.tags||[]))],[e,t,n])}function Y(){let e=D(e=>e.tasks),t=D(e=>e.messages);return(0,E.useMemo)(()=>{let n=e.filter(e=>(e.kind??`claim`)===`claim`).filter(e=>!h.has(e.status)).map(e=>({id:`task-`+e.id,sourceType:`task`,title:e.title,body:e.body,severity:e.severity||`info`,status:e.status,owner:e.claimedBy||``,target:e.target,source:e.source,channel:e.channel||``,updatedAt:e.updatedAt||e.createdAt,createdAt:e.createdAt,claimable:x(e),task:e})),r=t.filter(f).map(e=>({id:`message-`+e.id,sourceType:`message`,title:e.subject||`Claimable message #`+e.id,body:u(e),severity:`warning`,status:e.claimedBy?`claimed`:`open`,owner:e.claimedBy||``,target:e.to,source:`message`,channel:e.channel||``,updatedAt:e.claimedAt||e.createdAt,createdAt:e.createdAt,claimable:f(e),message:e}));return[...n,...r].sort((e,t)=>{let n=Number(t.claimable)-Number(e.claimable);if(n!==0)return n;let r={critical:0,warning:1,info:2},i=(r[e.severity]??9)-(r[t.severity]??9);return i===0?C(e.updatedAt)-C(t.updatedAt):i})},[e,t])}function X(e=!0){let t=i(e,e=>e.commandQuery),n=i(e,e=>e.agents),r=i(e,e=>e.showBuiltIns),a=i(e,e=>e.showOffline),o=i(e,e=>e.managedPolicies);return(0,E.useMemo)(()=>{let e=y(n,r,o).filter(e=>a||e.status!==`offline`),i=[...new Set(e.flatMap(e=>e.tags||[]))],s=T(),c=[Z(`open-chat`,`Open chat`,`Human console`,`MessageCircle`,`openView`,{view:`chat`}),Z(`open-work`,`Open work queue`,`Claimable messages and tasks`,`ListChecks`,`openView`,{view:`work`}),Z(`open-workspaces`,`Open workspaces`,`Agent worktrees and merge state`,`GitBranch`,`openView`,{view:`workspaces`}),Z(`show-stale`,`Show stale agents`,`Filter agents to offline or stale`,`Filter`,`agentPreset`,{preset:`offline_stale`}),Z(`copy-url`,`Copy relay URL`,s,`Copy`,`copy`,{value:s}),Z(`export-md`,`Export timeline as Markdown`,`Activity audit trace`,`FileDown`,`exportActivity`,{format:`markdown`}),Z(`export-json`,`Export timeline as JSON`,`Activity audit trace`,`Braces`,`exportActivity`,{format:`json`}),...e.slice(0,12).map(e=>Z(`msg-`+e.id,`Message agent: `+_(e),e.id,`Send`,`messageAgent`,{agentId:e.id})),...e.filter(e=>e.providerCapabilities?.liveSession?.inject===!0).slice(0,8).map(e=>Z(`pair-`+e.id,`Pair: `+_(e),e.id,`Link`,`pairAgent`,{agentId:e.id})),...i.map(e=>Z(`tag-`+e,`Filter tag: `+e,`#`+e,`Tag`,`filterTag`,{tag:e}))],l=t.trim().toLowerCase();return(l?c.filter(e=>e.search.includes(l)):c).slice(0,24)},[t,n,r,a,o])}function Z(e,t,n,r,i,a){return{id:e,title:t,subtitle:n,icon:r,action:i,payload:a,search:`${t}\n${n}\n${i}`.toLowerCase()}}export{X as a,W as c,N as d,q as f,G as i,U as l,Y as m,V as n,K as o,J as p,H as r,L as s,M as t,j as u};
|
|
6
|
-
//# sourceMappingURL=use-selectors-
|
|
6
|
+
//# sourceMappingURL=use-selectors-BZa25xEB.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{mt as i,x as a}from"./display-
|
|
2
|
-
//# sourceMappingURL=user-avatar-
|
|
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{mt as i,x as a}from"./display-BrKWFGJz.js";import{n as o}from"./api-CIIVBtAV.js";import{t as s}from"./agent-type-icon-LrUEU3lB.js";var c=e(n(),1),l=r(),u={id:i};function d({user:e,address:n,distinct:r=!1,className:i}){let d=e?.avatarUrl??(e?.avatarArtifactId?`/artifacts/${encodeURIComponent(e.avatarArtifactId)}/content`:null),[f,p]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(!d){p(null);return}let e=!1,t=null;return(async()=>{try{let n=await o(d);if(e)return;t=URL.createObjectURL(n),p(t)}catch{e||p(null)}})(),()=>{e=!0,t&&URL.revokeObjectURL(t)}},[d]);let m=e?.displayName||e?.handle||`User`;if(f)return(0,l.jsx)(`img`,{src:f,alt:m,title:m,className:t(`w-7 h-7 rounded-md object-cover`,i)});if(r){let e=(m.trim()[0]||`U`).toUpperCase();return(0,l.jsx)(`span`,{title:m,className:t(`inline-flex w-7 h-7 items-center justify-center rounded-md bg-muted text-xs font-semibold ring-1 ring-foreground/10`,a(n),i),children:e})}return(0,l.jsx)(s,{agent:u,className:i})}export{d as t};
|
|
2
|
+
//# sourceMappingURL=user-avatar-DHxlvUvV.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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{M as i}from"./provider-display-DsuWMvVL.js";import{t as a}from"./api-CIIVBtAV.js";import{t as o}from"./button-Do6Z3vvn.js";import{t as s}from"./badge-DqJRtj_p.js";import{n as c}from"./token-estimate-Co-Jdphh.js";var l=e(n(),1),u=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends u{};function d(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function f(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function p(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function m(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function h(e,t){return p(e,t,``)}function g(e,t){return m(e,t,``)}function _(e,t){return t.slice(0,v(e,t))}function v(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function y(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function b(e,t){if(t)return S(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function x(e,t){if(t)return S(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function S(e,t){if(!t)return[x(e),b(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=y(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var C=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,w=RegExp(`[${C}]+|\\s+|[^${C}]`,`ug`);new class extends u{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=y(e,r)}else n=e.match(w)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&T(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&T(n,i,r,null,t.intlSegmenter),e}};function T(e,t,n,r,i){if(t&&n){let[a,o]=S(t.value,i),[s,c]=S(n.value,i);if(e){let r=d(a,s);e.value=m(e.value,s,r),t.value=h(t.value,r),n.value=h(n.value,r)}if(r){let e=f(o,c);r.value=p(r.value,c,e),t.value=g(t.value,e),n.value=g(n.value,e)}}else if(n){if(e){let e=x(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=x(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=x(r.value,i),[a,o]=S(t.value,i),s=d(n,a);t.value=h(t.value,s);let c=f(h(n,s),o);t.value=g(t.value,c),r.value=p(r.value,n,c),e.value=m(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=x(r.value,i),n=_(b(t.value,i),e);t.value=g(t.value,n)}else if(e){let n=_(b(e.value,i),x(t.value,i));t.value=h(t.value,n)}}new class extends u{tokenize(e){let t=RegExp(`(\\r?\\n)|[${C}]+|[^\\S\\n\\r]+|[^${C}]`,`ug`);return e.match(t)||[]}};var E=new class extends u{constructor(){super(...arguments),this.tokenize=O}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
2
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
3
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
5
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function D(e,t,n){return E.diff(e,t,n)}function O(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
6
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function k(e){return e==`.`||e==`!`||e==`?`}new class extends u{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(k(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends u{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends u{constructor(){super(...arguments),this.tokenize=O}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(A(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function A(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=A(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=A(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends u{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var j=r(),M=2;function N(e,t){let n=D(e,t).flatMap(e=>{let t=e.added?`add`:e.removed?`del`:`same`;return e.value.replace(/\n$/,``).split(`
|
|
7
|
+
`).map(e=>({kind:t,text:e}))}),r=n.map((e,t)=>e.kind!==`same`||n.slice(Math.max(0,t-M),t+M+1).some(e=>e.kind!==`same`)),i=[],a=0;return n.forEach((e,t)=>{r[t]?(a&&i.push({kind:`gap`,text:`${a} unchanged line${a===1?``:`s`}`}),a=0,i.push(e)):a++}),a&&i.push({kind:`gap`,text:`${a} unchanged line${a===1?``:`s`}`}),i}function P({from:e,to:n,label:r}){let i=N(e,n),a=i.some(e=>e.kind===`add`||e.kind===`del`);return(0,j.jsxs)(`div`,{className:`min-w-0 space-y-1`,"data-testid":`prompt-diff`,children:[(0,j.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:r}),a?(0,j.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto rounded border bg-background p-1 font-mono text-[11px] leading-4`,children:i.map((e,n)=>(0,j.jsxs)(`div`,{className:t(`whitespace-pre-wrap break-words`,e.kind===`add`&&`bg-tone-success/10 text-tone-success-fg`,e.kind===`del`&&`bg-tone-danger/10 text-tone-danger-fg`,e.kind===`gap`&&`text-muted-foreground italic`),children:[e.kind===`add`?`+ `:e.kind===`del`?`- `:e.kind===`gap`?`… `:` `,e.text]},n))}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No differences.`})]})}function F(e){return`/settings/prompts/${encodeURIComponent(e)}`}async function I(e){let[t,n]=await Promise.all([a(`GET`,e),a(`GET`,`${e}/history`).then(e=>e.versions,()=>void 0)]);return[t,n]}function L(e){return new Date(e).toLocaleString()}function R(e){return e.fallbackReason===`db-error`?`The prompt database is unavailable, so the bundled text is being served. Editing is disabled until it recovers.`:`No saved version exists for this prompt yet, so the bundled text is being served. Editing is disabled until a saved version exists.`}function z({slug:e,...t}){return(0,j.jsx)(B,{path:F(e),title:e,...t},e)}function B({path:e,title:t,textLabel:n=`Prompt text`,saveLabel:r=`Save prompt version`,children:u,onSaved:d,readOnly:f=!1}){let[p,m]=(0,l.useState)(),[h,g]=(0,l.useState)(),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(``),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)(!1),[T,E]=(0,l.useState)(!1),[D,O]=(0,l.useState)(``);(0,l.useEffect)(()=>{let t=!0;return I(e).then(e=>{t&&m(e)},e=>{t&&b(i(e))}),()=>{t=!1}},[e]);async function k(){let t=await I(e);m(t),t[0].version&&d?.(t[0])}async function A(){E(!0);try{await k(),b(``),S(C?`Reloaded the latest version. Your unsaved text is kept; review the changes and save again.`:``),w(!1)}catch(e){b(i(e))}finally{E(!1)}}async function M(t,n){if(!p)return;let[r]=p;E(!0),b(``),S(``),w(!1);try{await a(t===`edit`?`PUT`:`POST`,`${e}${t===`edit`?``:`/${t}`}`,{...t===`edit`?{template:h??r.template}:{},...n===void 0?{}:{version:n},expectedVersion:r.version,reason:_.trim()||void 0}),await k(),g(void 0),v(``),O(``)}catch(e){e.status===409?(w(!0),b(`Version ${r.version} is no longer current: someone else saved first. Reload the latest version, then re-apply your change.`)):b(i(e))}finally{E(!1)}}if(!p||p[0].version===void 0)return(0,j.jsxs)(j.Fragment,{children:[u,y&&(0,j.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:y})]});let[N,F]=p,z=N.source===`bundled-fallback`,B=f||z,V=h!==void 0&&h!==N.template,H=F?.find(e=>e.version===N.version),U=!!N.bundledUpdateAvailable&&N.bundledTemplate!==void 0,W=V?`Save or discard your edits first`:void 0;return(0,j.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border p-2 text-xs`,"data-testid":`versioned-prompt-editor`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:t}),(0,j.jsxs)(`span`,{children:[`· `,z?`No saved version`:`Version ${N.version}`]}),(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,c(h??N.template)]}),z&&(0,j.jsx)(s,{variant:`outline`,className:`border-tone-warning/40 bg-tone-warning/10 text-tone-warning-fg`,children:`Bundled fallback`}),U&&(0,j.jsx)(s,{variant:`outline`,className:`border-tone-info/40 bg-tone-info/10 text-tone-info-fg`,children:`Bundled update available`})]}),H&&(0,j.jsxs)(`p`,{className:`break-words text-muted-foreground`,children:[`Saved by `,H.actor,` · `,L(H.createdAt),H.reason?` · ${H.reason}`:``]}),z&&(0,j.jsxs)(`p`,{role:`status`,className:`rounded border border-tone-warning/30 bg-tone-warning/10 p-1.5 text-tone-warning-fg`,children:[R(N),` `,(0,j.jsx)(o,{type:`button`,variant:`outline`,size:`xs`,disabled:T,onClick:()=>void A(),children:`Reload`})]}),y&&(0,j.jsxs)(`p`,{role:`alert`,className:`rounded border border-destructive/40 bg-destructive/10 p-1.5 text-destructive`,children:[y,` `,C&&(0,j.jsx)(o,{type:`button`,variant:`outline`,size:`xs`,disabled:T,onClick:()=>void A(),children:`Reload latest`})]}),x&&(0,j.jsx)(`p`,{role:`status`,className:`rounded border border-tone-info/30 bg-tone-info/10 p-1.5 text-tone-info-fg`,children:x}),U&&!z&&(0,j.jsxs)(`details`,{className:`rounded border p-1.5`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Review bundled update`}),(0,j.jsxs)(`div`,{className:`mt-1.5 space-y-1.5`,children:[(0,j.jsx)(P,{from:N.template,to:N.bundledTemplate,label:`Live version ${N.version} → bundled update`}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[!f&&(0,j.jsx)(o,{type:`button`,size:`sm`,disabled:T||V,title:W,onClick:()=>void M(`adopt`),children:`Adopt bundled update`}),W&&!f&&(0,j.jsxs)(`span`,{className:`text-muted-foreground`,children:[W,`.`]})]})]})]}),(0,j.jsxs)(`label`,{className:`block`,children:[n,(0,j.jsx)(`textarea`,{className:`mt-1 w-full rounded border bg-background p-2 font-mono`,rows:8,readOnly:B,value:h??N.template,onChange:e=>g(e.target.value),disabled:T})]}),V&&(0,j.jsxs)(`details`,{className:`rounded border p-1.5`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer`,children:`Review my changes`}),(0,j.jsx)(`div`,{className:`mt-1.5`,children:(0,j.jsx)(P,{from:N.template,to:h,label:`Version ${N.version} → my edits`})})]}),!B&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`label`,{className:`block`,children:[`Reason (optional)`,(0,j.jsx)(`input`,{className:`mt-1 w-full rounded border bg-background p-1`,value:_,maxLength:2e3,onChange:e=>v(e.target.value)})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,j.jsx)(o,{type:`button`,size:`sm`,disabled:T||!V,onClick:()=>void M(`edit`),children:r}),(0,j.jsx)(o,{type:`button`,size:`sm`,variant:`outline`,disabled:T||!V,onClick:()=>{g(void 0),S(``)},children:`Discard changes`})]})]}),(0,j.jsxs)(`details`,{className:`rounded border p-1.5`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:F?`History (${F.length}${F.length>=100?`+, latest 100`:``})`:`History unavailable`}),(0,j.jsx)(`ul`,{className:`mt-1.5 space-y-1.5`,children:(F??[]).map(e=>{let t=e.version===N.version,n=`v${e.version}`;return(0,j.jsxs)(`li`,{className:`min-w-0 space-y-1 rounded border p-1.5`,children:[(0,j.jsxs)(`p`,{className:`break-words`,children:[`Version `,e.version,t?` (current)`:``,` · `,e.actor,` · `,L(e.createdAt),e.reason?` · ${e.reason}`:``]}),!t&&(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,j.jsxs)(o,{type:`button`,size:`xs`,variant:`outline`,"aria-pressed":D===n,disabled:T,onClick:()=>O(D===n?``:n),children:[`Compare version `,e.version,` with current`]}),!B&&(0,j.jsxs)(o,{type:`button`,size:`xs`,variant:`outline`,disabled:T||V,title:W,onClick:()=>void M(`restore`,e.version),children:[`Restore version `,e.version]})]}),D===n&&(0,j.jsx)(P,{from:e.template,to:N.template,label:`Version ${e.version} → current version ${N.version}`})]},e.version)})})]})]})}export{B as n,z as t};
|
|
8
|
+
//# sourceMappingURL=versioned-prompt-editor-BmED5DnJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e}from"./dist-DeW2Y1R5.js";import{t,wt as n}from"./store-
|
|
2
|
-
//# sourceMappingURL=work-queue-
|
|
1
|
+
import{u as e}from"./dist-DeW2Y1R5.js";import{t,wt as n}from"./store-DcClXLH0.js";import{Ct as r,et as i,f as a}from"./display-BrKWFGJz.js";import{t as o}from"./scroll-area-CIN4KQse.js";import{t as s}from"./calendar-QJjoZ1JU.js";import{t as c}from"./circle-check-CkUkN96J.js";import{t as l}from"./list-checks-CwnS3hly.js";import{t as u}from"./x-Bge17hWJ.js";import{t as d}from"./button-Do6Z3vvn.js";import{t as f}from"./badge-DqJRtj_p.js";import{t as p}from"./agent-name-DKbiIhBo.js";import{m,o as h}from"./use-selectors-BZa25xEB.js";import{r as g,t as _}from"./card-C4QJ4hCW.js";var v=e(),y={open:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,blocked:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,claimed:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,in_progress:`bg-tone-purple/10 text-tone-purple-fg border-tone-purple/20`,validating:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`};function b(){let e=n(),r=t(e=>e.agentsById),i=t(e=>e.compose),s=t(e=>e.set),c=t(e=>e.doClaimTask),u=t(e=>e.doClaim),d=t(e=>e.openTaskEvents),g=t(e=>e.showError),_=t(e=>e.openConfirm),y=t(e=>e.doDeleteMessage),b=t(e=>e.doUpdateTaskStatus),S=h(),C=m(),w=C.filter(e=>e.claimable).length;function T(e){if(!i.from){g(`Validation`,`Select a "Claim as" agent first.`);return}e.sourceType===`task`&&e.task?c(e.task.id):e.sourceType===`message`&&e.message&&u(e.message.id)}function E(e){let t=e.title||(e.sourceType===`task`?`T${e.id}`:`Message #${e.id}`);_(`Cancel Item`,`Cancel "${t}"? This cannot be undone.`,()=>{e.sourceType===`task`&&e.task?b(e.task,`canceled`):e.sourceType===`message`&&e.message&&y(e.message.id)})}function D(e){e.task&&d(e.task)}return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(l,{className:`w-5 h-5 text-muted-foreground`}),(0,v.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Work Queue`}),w>0&&(0,v.jsxs)(f,{className:`bg-tone-orange/20 text-tone-orange-fg border-tone-orange/30 border`,children:[w,` claimable`]})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`label`,{className:`text-xs text-muted-foreground shrink-0`,children:`Claim as`}),(0,v.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:i.from,onChange:e=>s({compose:{...i,from:e.target.value}}),children:[(0,v.jsx)(`option`,{value:``,children:`Select agent...`}),S.map(e=>(0,v.jsx)(`option`,{value:e.id,children:a(e)},e.id))]})]})]}),(0,v.jsx)(o,{className:`h-[calc(100dvh-11rem)]`,children:(0,v.jsxs)(`div`,{className:`space-y-2 pr-2`,children:[C.length===0&&(0,v.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`Work queue is empty`}),C.map(t=>(0,v.jsx)(x,{item:t,now:e,agentName:e=>(0,v.jsx)(p,{agent:r[e],fallback:e.slice(-10)}),onClaim:()=>T(t),onCancel:()=>E(t),onEvents:t.task?()=>D(t):void 0},t.id))]})})]})}function x({item:e,now:t,agentName:n,onClaim:a,onCancel:o,onEvents:l}){let p=r[e.severity]||r.info,m=y[e.status]||`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`;return(0,v.jsx)(_,{className:e.claimable?`ring-1 ring-tone-orange/30`:``,children:(0,v.jsx)(g,{className:`p-3`,children:(0,v.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,v.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1`,children:[(0,v.jsx)(`span`,{className:`font-medium text-sm truncate`,children:e.title}),(0,v.jsx)(f,{variant:`outline`,className:`text-xs px-1.5 py-0 border ${p}`,children:e.severity}),(0,v.jsx)(f,{variant:`outline`,className:`text-xs px-1.5 py-0 border ${m}`,children:e.status}),e.sourceType===`message`&&(0,v.jsx)(f,{variant:`outline`,className:`text-xs px-1.5 py-0 border border-tone-neutral/20 text-tone-neutral-fg`,children:`msg`})]}),e.body&&(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mb-2`,children:e.body}),(0,v.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[e.owner&&(0,v.jsxs)(`span`,{title:`Owner`,children:[(0,v.jsx)(c,{className:`w-3 h-3 inline mr-1`}),n(e.owner)]}),e.source&&(0,v.jsx)(`span`,{className:`font-mono`,children:e.source}),(0,v.jsxs)(`span`,{title:String(e.updatedAt),children:[(0,v.jsx)(s,{className:`w-3 h-3 inline mr-1`}),i(t,e.updatedAt)]})]})]}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-1 shrink-0`,children:[e.claimable&&(0,v.jsxs)(d,{size:`sm`,className:`h-7 text-xs bg-tone-orange-fg hover:bg-tone-orange-fg/90 text-background`,onClick:a,children:[(0,v.jsx)(c,{className:`w-3.5 h-3.5 mr-1`}),` Claim`]}),l&&(0,v.jsx)(d,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:l,children:`Events`}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,className:`h-7 text-xs text-tone-danger-fg hover:text-tone-danger-fg hover:bg-tone-danger/10 border-tone-danger/20`,onClick:o,children:[(0,v.jsx)(u,{className:`w-3.5 h-3.5 mr-1`}),` Cancel`]})]})]})})})}export{b as WorkQueueView};
|
|
2
|
+
//# sourceMappingURL=work-queue-CSvpuNLz.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t,u as n}from"./dist-DeW2Y1R5.js";import{i as r,t as i}from"./store-
|
|
2
|
-
//# sourceMappingURL=workflow-marker-
|
|
1
|
+
import{n as e,o as t,u as n}from"./dist-DeW2Y1R5.js";import{i as r,t as i}from"./store-DcClXLH0.js";var a=e(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),o=n();function s({workflow:e,step:n,className:r=`h-3 w-3`,corner:i=!1}){let s=e?`Workflow agent: ${e}${n?`, step ${n}`:``}`:`Workflow agent`;return(0,o.jsx)(`span`,{"data-testid":`workflow-marker`,role:`img`,"aria-label":s,title:s,className:t(`wf-marker inline-grid shrink-0 place-items-center`,i&&`absolute -right-1.5 -top-1.5 rounded-full bg-background p-px ring-1 ring-border`),children:(0,o.jsx)(a,{className:r,"aria-hidden":!0})})}function c({agentId:e,className:t,corner:n}){let r=i(t=>t.workflowLiveIndex.byAgent[e]);return(0,o.jsx)(s,{workflow:r?.workflow,step:r?.step,className:t,corner:n})}function l({agent:e,className:t,corner:n}){return!e||!r(e)?null:(0,o.jsx)(c,{agentId:e.id,className:t,corner:n})}export{s as n,a as r,l as t};
|
|
2
|
+
//# sourceMappingURL=workflow-marker-DAZcj5qt.js.map
|