@humwick/server 0.130.2 → 0.130.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/prompts/manifest.json +1 -0
- package/bundled/prompts/task.hydration.md +1 -1
- package/bundled/roles/builder.md +1 -1
- package/docs/guides/sub-coordinators.md +12 -5
- package/docs/guides/tools-coordination.md +1 -0
- package/docs/guides/workflows.md +16 -0
- package/docs/openapi.json +73 -4
- package/package.json +8 -7
- package/public/assets/{MessageBubble-BWLqMGKG.js → MessageBubble-Bq9kr21N.js} +2 -2
- package/public/assets/{PlanGraphPanel-3TlIQpjk.js → PlanGraphPanel-Dqiroy06.js} +2 -2
- package/public/assets/{TraceView-Wimm0Czv.js → TraceView-DYU962-H.js} +2 -2
- package/public/assets/{VaultDecisionCard-Bau_vNax.js → VaultDecisionCard-DhPfzioE.js} +2 -2
- package/public/assets/{activity-CrSurn-r.js → activity-DzCcQTee.js} +2 -2
- package/public/assets/{agent-lineage-CknAJKcb.js → agent-lineage-SgDt9i3T.js} +2 -2
- package/public/assets/agent-liveness-Bq-s73jW.js +2 -0
- package/public/assets/{agent-name-DKbiIhBo.js → agent-name-CcY3Aijy.js} +2 -2
- package/public/assets/{agent-profiles-DwF6EQ4R.js → agent-profiles-cxtRBn6O.js} +2 -2
- package/public/assets/{agent-project-badge-Diz4Sjjb.js → agent-project-badge-DGYbIhaI.js} +2 -2
- package/public/assets/{agent-tools-CRhpRQza.js → agent-tools-DHbftV0N.js} +2 -2
- package/public/assets/{agent-type-icon-LrUEU3lB.js → agent-type-icon-CY113sp-.js} +2 -2
- package/public/assets/{agents-B-v66C-4.js → agents-BPzY7IlQ.js} +2 -2
- package/public/assets/{analytics-BqCb-LKi.js → analytics-DENFPv_a.js} +2 -2
- package/public/assets/{artifact-viewer-kf4pGuAR.js → artifact-viewer-KRvSc7sl.js} +2 -2
- package/public/assets/{artifacts-DJevXcvg.js → artifacts-C9gSmL3s.js} +2 -2
- package/public/assets/{artifacts-D32zyw4Y.js → artifacts-DT-HkI5O.js} +2 -2
- package/public/assets/{automation-BpRajx_5.js → automation-BsmjQhKD.js} +2 -2
- package/public/assets/{backlog-D_UjTdzX.js → backlog-8NYH_62t.js} +2 -2
- package/public/assets/{busy-health-N3VEh4ao.js → busy-health-D3hwvYb4.js} +2 -2
- package/public/assets/{channels-9jopungq.js → channels-DCJ5WL7O.js} +2 -2
- package/public/assets/{chat-CSXrTB3C.js → chat-DAIl357U.js} +3 -3
- package/public/assets/{code-preview-p1NnmqK0.js → code-preview-CzrZfr9U.js} +2 -2
- package/public/assets/{connectors-CZdqlDNL.js → connectors-xTxtlyou.js} +2 -2
- package/public/assets/{cosmos-BgdsE4dG.js → cosmos-BpebFLK2.js} +2 -2
- package/public/assets/{crate-agent-30aXTKva.js → crate-agent-BHvI5wXC.js} +2 -2
- package/public/assets/{dependency-graph-B_jvw2GE.js → dependency-graph-DGT0o3wJ.js} +2 -2
- package/public/assets/{deploys-DoN6bAb5.js → deploys-hqWOHSHE.js} +2 -2
- package/public/assets/{display-BrKWFGJz.js → display-CDeH4I8T.js} +2 -2
- package/public/assets/{files-D6XEu8Ng.js → files-BTeGVmTg.js} +2 -2
- package/public/assets/{fleet-C7jQWbw2.js → fleet-DgXtNgCa.js} +2 -2
- package/public/assets/{fleet-metrics-BiDs3MLx.js → fleet-metrics-BHEt5yc_.js} +2 -2
- package/public/assets/{formatted-body-CQBwc1fb.js → formatted-body-MLtodyPp.js} +3 -3
- package/public/assets/{formatted-body-impl-DyG0WsQS.js → formatted-body-impl-CAe664Z8.js} +2 -2
- package/public/assets/{host-providers-dialog-DKaW31dN.js → host-providers-dialog-mapF4Fj9.js} +2 -2
- package/public/assets/{index-CRHep3M9.js → index-CqqgOI5R.js} +5 -5
- package/public/assets/{insights-CzrtkpOE.js → insights-DNyf7IzF.js} +2 -2
- package/public/assets/{integrations-aVsUmigt.js → integrations-DlYOHq7T.js} +2 -2
- package/public/assets/{issue-ref-chip-BnSlM_95.js → issue-ref-chip-CeWBNWn7.js} +2 -2
- package/public/assets/{log-viewer-qe7Ee47Z.js → log-viewer-Cib8nqdE.js} +2 -2
- package/public/assets/{maintenance-NfjqFZAk.js → maintenance-DSn1cPm7.js} +2 -2
- package/public/assets/{managed-agents-BiH0HgaE.js → managed-agents-C3CkM81m.js} +2 -2
- package/public/assets/{markdown-preview-BixaT3Xr.js → markdown-preview-W4VQQPAv.js} +3 -3
- package/public/assets/{markdown-preview-impl-DNGlWIS3.js → markdown-preview-impl-CMsTdhjq.js} +2 -2
- package/public/assets/{memory-DNsCl6UX.js → memory-BV17qtO4.js} +2 -2
- package/public/assets/{messages-DopU1L1X.js → messages-Bm_1AqSA.js} +2 -2
- package/public/assets/{orchestrators-Cq7ckLQT.js → orchestrators-Dg-vfP09.js} +2 -2
- package/public/assets/{overview-C1DCTzzV.js → overview-DcYCrvlr.js} +2 -2
- package/public/assets/{pairs-DE_m6rrE.js → pairs-8o9nuG3V.js} +2 -2
- package/public/assets/{profile-icon-B3rfh77F.js → profile-icon-BsRyBMea.js} +2 -2
- package/public/assets/{project-profile-instructions-DQWZE0kA.js → project-profile-instructions-DETKFn_E.js} +2 -2
- package/public/assets/{projects-Br2Bd2h1.js → projects-M_m6AHws.js} +2 -2
- package/public/assets/{prompt-settings-BKvFsvGD.js → prompt-settings-C_mNCgeL.js} +2 -2
- package/public/assets/provider-display-BEeLXC_D.js +2 -0
- package/public/assets/{registry-Cw38_6gW.js → registry-DDHHHE5N.js} +2 -2
- package/public/assets/run-card-Dt4I4jaP.js +2 -0
- package/public/assets/{secrets-DxI-vzSq.js → secrets-BkVwxI5O.js} +2 -2
- package/public/assets/{service-access-settings-D9s_VJbd.js → service-access-settings-Crq-6a-B.js} +2 -2
- package/public/assets/{settings-CKZTVGIx.js → settings-CYcavMFu.js} +2 -2
- package/public/assets/shipping-H6gzEeZB.js +2 -0
- package/public/assets/{stats-DyUBKyWI.js → stats-BJVeWkpV.js} +2 -2
- package/public/assets/{status-dot-DYqlEUhJ.js → status-dot-BcHyw1Vw.js} +2 -2
- package/public/assets/store-DKPDIZBe.js +9 -0
- package/public/assets/{tasks-Bh7Chr4-.js → tasks-qJjlQPpx.js} +2 -2
- package/public/assets/{teams-bowI7qVY.js → teams-Cd5Sk1uX.js} +2 -2
- package/public/assets/{terminal-viewer-BgVLHdsU.js → terminal-viewer-CpY5_m7W.js} +3 -3
- package/public/assets/{terminal-viewer-impl-Dz22UPy6.js → terminal-viewer-impl-DI_2llFR.js} +2 -2
- package/public/assets/{use-agent-terminal-DSQQ-iY7.js → use-agent-terminal-0yJA_buM.js} +2 -2
- package/public/assets/{use-decisions-samMQhQf.js → use-decisions-uJXHf34W.js} +2 -2
- package/public/assets/{use-project-list-59LheVP7.js → use-project-list-CpWl6eHQ.js} +2 -2
- package/public/assets/{use-selectors-BZa25xEB.js → use-selectors-BdxBW8mL.js} +2 -2
- package/public/assets/{user-avatar-DHxlvUvV.js → user-avatar-3IndfpOc.js} +2 -2
- package/public/assets/{versioned-prompt-editor-BmED5DnJ.js → versioned-prompt-editor-CIVg7XB1.js} +2 -2
- package/public/assets/{work-queue-CSvpuNLz.js → work-queue-B9rnLwHZ.js} +2 -2
- package/public/assets/{workflow-marker-DAZcj5qt.js → workflow-marker-X8wxyhzC.js} +2 -2
- package/public/assets/{workflows-DdmxRSyg.js → workflows-o5YyMFW7.js} +2 -2
- package/public/assets/{workspaces-BxeKfVuF.js → workspaces-CzEGoAng.js} +2 -2
- package/public/cosmos.html +4 -4
- package/public/index.html +28 -28
- package/runner/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/runner/src/adapters/claude-headless.ts +1 -1
- package/runner/src/adapters/claude-launch-exit.ts +26 -0
- package/runner/src/adapters/claude-session-probe.ts +1 -1
- package/runner/src/adapters/claude-tmux.ts +38 -10
- package/runner/src/adapters/claude.ts +28 -75
- package/runner/src/adapters/provider-quota-harvest.ts +20 -71
- package/runner/src/agent-runner/lifecycle-milestones.ts +2 -2
- package/runner/src/agent-runner/liveness-exchange.ts +104 -0
- package/runner/src/claude-system-prompt.ts +49 -0
- package/runner/src/launch-assembly.ts +14 -10
- package/runner/src/profile-home.ts +1 -1
- package/runner/src/project-instructions.ts +2 -2
- package/runner/src/provider-command.ts +18 -0
- package/runner/src/provider-setup.ts +2 -1
- package/runner/src/runner-core.ts +14 -15
- package/runner/src/runner-helpers.ts +0 -8
- package/runner/src/session-scratch.ts +6 -2
- package/runner/test-support/provisioning-context.ts +4 -2
- package/runner/test-support/runner-harness.ts +2 -1
- package/scripts/steward-policy-cleanup.ts +2 -2
- package/src/agent-authz.ts +2 -2
- package/src/agent-drive-arbiter.ts +3 -8
- package/src/agent-exit-cleanup-async.ts +2 -2
- package/src/agent-exit-cleanup.ts +23 -19
- package/src/agent-lifecycle-events.ts +112 -85
- package/src/agent-ref.ts +3 -2
- package/src/agent-status-events.ts +43 -14
- package/src/auth/password.ts +4 -3
- package/src/auth/session-refresh.ts +1 -1
- package/src/auth/session.test-fixture.ts +2 -2
- package/src/auth/session.ts +7 -7
- package/src/automations/crud.ts +8 -81
- package/src/automations/dispatch.ts +33 -58
- package/src/automations/index.ts +1 -1
- package/src/automations/persistence.ts +65 -0
- package/src/automations/precheck.ts +18 -16
- package/src/automations/read-async.ts +11 -0
- package/src/automations/reconcile.ts +30 -39
- package/src/automations/storage.ts +33 -10
- package/src/automations/write-async.ts +33 -0
- package/src/branch-land-notice.ts +3 -3
- package/src/branch-landed.ts +25 -23
- package/src/bus.ts +21 -19
- package/src/cd-deploy-notify.ts +2 -2
- package/src/ci/notifications.ts +4 -4
- package/src/ci/root-missing.ts +3 -3
- package/src/ci/transition-notify.ts +5 -5
- package/src/claude-app/oauth-http.ts +3 -3
- package/src/cli/workflow.ts +12 -3
- package/src/commands-db.ts +4 -4
- package/src/commands-write.ts +8 -0
- package/src/compaction-watch.ts +10 -8
- package/src/config-store-write.ts +2 -2
- package/src/config.ts +4 -11
- package/src/connectors.ts +10 -8
- package/src/context-advisory.ts +22 -21
- package/src/db/agent-action-write.ts +36 -0
- package/src/db/agent-control-async.ts +9 -0
- package/src/db/agent-control-write.ts +49 -0
- package/src/db/agent-effort-observe.ts +22 -0
- package/src/db/agent-meta.ts +14 -3
- package/src/db/agents-async.ts +8 -5
- package/src/db/agents.ts +15 -12
- package/src/db/auth-identities.ts +2 -2
- package/src/db/automation-read-ops.ts +11 -0
- package/src/db/automation-write-ops.ts +46 -0
- package/src/db/blackboard.ts +2 -2
- package/src/db/browser-session-write.ts +32 -0
- package/src/db/bus-outbox-write-ops.ts +3 -1
- package/src/db/checkout-refresh-schema.ts +47 -0
- package/src/db/checkout-refresh.ts +5 -5
- package/src/db/command-agent-profile-backfill.ts +39 -0
- package/src/db/command-agent-profiles.ts +5 -1
- package/src/db/command-retention.ts +126 -0
- package/src/db/commands-planner-stats.test-fixture.ts +8 -0
- package/src/db/commands-read-ops.ts +16 -0
- package/src/db/connection.ts +1 -182
- package/src/db/context-carry-write.ts +74 -0
- package/src/db/continuations.ts +4 -4
- package/src/db/db-error-registry.ts +12 -0
- package/src/db/gateway.ts +26 -133
- package/src/db/history-retention-ops.ts +13 -0
- package/src/db/inbox-async.ts +2 -2
- package/src/db/inbox-read-ops.ts +1 -1
- package/src/db/inbox.ts +9 -3
- package/src/db/issue-associations.ts +2 -2
- package/src/db/issue-refs-async.ts +4 -1
- package/src/db/issue-refs-read-ops.ts +6 -0
- package/src/db/issue-refs.ts +8 -8
- package/src/db/kernel-event-log-schema.ts +2 -0
- package/src/db/land-boundaries.ts +51 -5
- package/src/db/land-gate-attestations.ts +2 -2
- package/src/db/landing-receipts.ts +2 -2
- package/src/db/lifecycle-context-write.ts +5 -0
- package/src/db/lifecycle-tail-async.ts +76 -0
- package/src/db/lifecycle-tail-write-ops.ts +62 -0
- package/src/db/lifecycle-write-window.ts +2 -1
- package/src/db/lineage-pair-dedupe-sql.ts +3 -3
- package/src/db/main-connection-mode.ts +11 -0
- package/src/db/main-connection-writes.ts +20 -2
- package/src/db/maintenance-job-runs-async.ts +2 -2
- package/src/db/maintenance-job-write-ops.ts +1 -1
- package/src/db/maintenance-pauses.ts +2 -2
- package/src/db/message-send.ts +4 -0
- package/src/db/messages.ts +31 -25
- package/src/db/migrations.ts +18 -1
- package/src/db/notification-write-ops.ts +19 -0
- package/src/db/operator-answer-write.ts +19 -0
- package/src/db/orchestrators.ts +10 -4
- package/src/db/pairs-async.ts +22 -1
- package/src/db/pairs-write-ops.ts +8 -3
- package/src/db/pairs.ts +41 -48
- package/src/db/plan-dispatch-schema.ts +5 -1
- package/src/db/plan-ready-notices.ts +43 -0
- package/src/db/plan-tools-include-migration.ts +36 -0
- package/src/db/plans-write-ops.ts +2 -0
- package/src/db/presence-buffer.ts +5 -0
- package/src/db/presence-loop.ts +18 -23
- package/src/db/presence-write.ts +0 -6
- package/src/db/project-entries-async.ts +14 -0
- package/src/db/project-entries-read-ops.ts +5 -1
- package/src/db/project-entries-write-ops.ts +8 -0
- package/src/db/project-entries.ts +15 -12
- package/src/db/project-journal.ts +2 -2
- package/src/db/project-trust-approvals.ts +2 -2
- package/src/db/prompt-templates.ts +4 -4
- package/src/db/read-op-marshaling-fixtures.ts +18 -0
- package/src/db/read-ops.ts +4 -0
- package/src/db/retention.ts +13 -2
- package/src/db/review-publish-write.ts +8 -0
- package/src/db/runtime-admin-async.ts +19 -0
- package/src/db/runtime-admin-write-ops.ts +36 -0
- package/src/db/runtime-tail-async.ts +288 -0
- package/src/db/runtime-tail-write-ops.ts +97 -0
- package/src/db/schema.ts +4 -1
- package/src/db/spawn-budget.ts +5 -0
- package/src/db/spawn-delegation.ts +1 -11
- package/src/db/sql-audit-indexes.ts +3 -0
- package/src/db/stats-async.ts +5 -3
- package/src/db/task-entity.ts +5 -4
- package/src/db/team-claim-policy.ts +60 -0
- package/src/db/teams-async.ts +4 -0
- package/src/db/teams-write-ops.ts +4 -0
- package/src/db/terminal-events.ts +15 -0
- package/src/db/timer-cutover-bodies.ts +292 -0
- package/src/db/timer-cutover-core.ts +37 -278
- package/src/db/timer-cutover-state.ts +40 -0
- package/src/db/timer-cutover-write-ops.ts +1 -40
- package/src/db/token-db-write-ops.ts +2 -0
- package/src/db/token-standing-async.ts +12 -0
- package/src/db/token-standing.ts +6 -9
- package/src/db/token-usage-retention.ts +33 -0
- package/src/db/token-usage-write-ops.ts +1 -1
- package/src/db/token-usage.ts +4 -1
- package/src/db/user-invites-async.ts +13 -0
- package/src/db/user-invites.ts +3 -3
- package/src/db/users.ts +14 -6
- package/src/db/workspaces.ts +8 -5
- package/src/db/write-ops.ts +31 -12
- package/src/db/writer-fault-seam.ts +2 -9
- package/src/db/writer-fault-test-ops.ts +18 -0
- package/src/db/writer-gateway.ts +42 -46
- package/src/dev.ts +8 -3
- package/src/event-loop-lag.ts +4 -2
- package/src/event-loop-yield.ts +2 -2
- package/src/events.ts +10 -8
- package/src/host-provider-store.ts +5 -4
- package/src/hub-metrics-report.ts +5 -1
- package/src/hub-metrics.ts +38 -18
- package/src/injection-sweep-pacing.ts +6 -8
- package/src/land-gate-notifications.ts +11 -10
- package/src/land-gate-queue-progress.ts +3 -3
- package/src/land-settle-dispatch.ts +52 -92
- package/src/lifecycle-context-pressure.ts +11 -10
- package/src/lifecycle-manager.ts +104 -98
- package/src/maintenance/breaker.ts +18 -16
- package/src/maintenance/checkout-refresh.ts +18 -1
- package/src/maintenance/critical-job-watchdog.ts +3 -3
- package/src/maintenance/events.ts +3 -3
- package/src/maintenance/history-retention-job.ts +30 -0
- package/src/maintenance/jobs.ts +29 -67
- package/src/maintenance/long-running-work.ts +3 -1
- package/src/maintenance/offline-agent-prune-job.ts +28 -0
- package/src/maintenance/orphaned-sessions.ts +5 -4
- package/src/maintenance/pauses.ts +4 -10
- package/src/maintenance/plan-ready-notice-job.ts +71 -0
- package/src/maintenance/scheduler.ts +18 -13
- package/src/maintenance/stalled-delivery-pager.ts +4 -4
- package/src/maintenance/teams.ts +19 -30
- package/src/maintenance/workspaces.ts +17 -27
- package/src/managed-policy-escalation.ts +7 -7
- package/src/managed-policy.ts +3 -3
- package/src/managed-provider-gate.ts +5 -4
- package/src/managed-spawn-reservation.ts +5 -4
- package/src/mcp/index.ts +8 -8
- package/src/mcp/output-descriptions.ts +1 -1
- package/src/mcp/presentation.ts +2 -1
- package/src/mcp/runtime-output.ts +6 -1
- package/src/mcp/self-care-visibility.ts +2 -2
- package/src/mcp/spawn-targets-matrix.ts +10 -1
- package/src/mcp/tool-groups.ts +3 -2
- package/src/mcp/tool-roles.ts +81 -0
- package/src/mcp/tools-workspace.ts +1 -1
- package/src/mcp-blackboard-tools.ts +6 -5
- package/src/mcp-decision-tools.ts +7 -7
- package/src/mcp-egress-tools.ts +10 -9
- package/src/mcp-issue-activity-tools.ts +2 -2
- package/src/mcp-issue-association-tools.ts +4 -4
- package/src/mcp-issue-ref-tools.ts +3 -3
- package/src/mcp-merge-tools.ts +5 -5
- package/src/mcp-notification-subscription-tools.ts +14 -15
- package/src/mcp-output-levels.test-fixture.ts +1 -1
- package/src/mcp-profile-trust-tools.ts +1 -1
- package/src/mcp-project-journal-tools.ts +4 -12
- package/src/mcp-project-tools.ts +17 -18
- package/src/mcp-routing-policy-tools.ts +3 -2
- package/src/mcp-team-tools.ts +6 -6
- package/src/mcp-workflow-tools.ts +5 -3
- package/src/memory-area-injection.ts +13 -12
- package/src/memory-boundary-capture.ts +6 -6
- package/src/memory-injection.ts +45 -43
- package/src/merge-pause-maintenance.ts +5 -4
- package/src/notification-router.ts +44 -17
- package/src/notify.ts +5 -5
- package/src/observed-reset-refresh.ts +4 -4
- package/src/operator-alarm.ts +2 -5
- package/src/project-ingest.ts +6 -6
- package/src/project-instructions.ts +8 -1
- package/src/project-trust.ts +12 -11
- package/src/prompt-resolver.ts +3 -3
- package/src/provider-quota-async.ts +5 -7
- package/src/provider-timeline-event.ts +4 -7
- package/src/quota-band-delivery.ts +2 -2
- package/src/recipe-runner.ts +4 -3
- package/src/retention-config-store.ts +4 -3
- package/src/reviewer-pipeline.ts +11 -10
- package/src/routes/_route.ts +4 -4
- package/src/routes/_shared.ts +13 -12
- package/src/routes/agent-effort.ts +5 -5
- package/src/routes/agent-heartbeat-quota.ts +23 -0
- package/src/routes/agent-keep.ts +1 -1
- package/src/routes/agent-reporting.ts +1 -1
- package/src/routes/agent-self-effort.ts +5 -5
- package/src/routes/agent-sessions.ts +24 -24
- package/src/routes/agents-spawn.ts +1 -1
- package/src/routes/agents.ts +17 -119
- package/src/routes/auth.ts +14 -15
- package/src/routes/authority-audit.ts +2 -2
- package/src/routes/automations.ts +6 -5
- package/src/routes/channel-binding-delete.ts +1 -1
- package/src/routes/channel-output.ts +3 -3
- package/src/routes/claude-api-budget.ts +5 -5
- package/src/routes/commands-listing.ts +1 -1
- package/src/routes/commands.ts +29 -27
- package/src/routes/context-resets.ts +2 -2
- package/src/routes/coordinator-teams.ts +1 -1
- package/src/routes/decisions.ts +2 -2
- package/src/routes/host-secret-files.ts +1 -1
- package/src/routes/hosts.ts +11 -11
- package/src/routes/inbox.ts +3 -2
- package/src/routes/index.ts +2 -1
- package/src/routes/integrations.ts +9 -7
- package/src/routes/issue-activity.ts +2 -2
- package/src/routes/issue-associations.ts +4 -4
- package/src/routes/issue-refs.ts +3 -3
- package/src/routes/kernel-timers-operator.ts +1 -1
- package/src/routes/memory.ts +1 -1
- package/src/routes/merges.ts +11 -11
- package/src/routes/messages.ts +23 -17
- package/src/routes/orchestrator-bootstrap.ts +1 -1
- package/src/routes/orchestrator-host-registration.ts +2 -0
- package/src/routes/orchestrator-host-utilization.ts +2 -2
- package/src/routes/orchestrator-proxy.ts +2 -2
- package/src/routes/orchestrator.ts +27 -18
- package/src/routes/pairs.ts +8 -8
- package/src/routes/project-profile-instructions.ts +1 -1
- package/src/routes/project-trust.ts +1 -1
- package/src/routes/projects.ts +16 -16
- package/src/routes/prompt-templates.ts +12 -12
- package/src/routes/provider-quotas.ts +10 -10
- package/src/routes/run-command.ts +1 -1
- package/src/routes/secrets-backup.ts +2 -2
- package/src/routes/secrets-import.ts +1 -1
- package/src/routes/secrets-vault.ts +7 -7
- package/src/routes/settings.ts +1 -1
- package/src/routes/shipping.ts +9 -1
- package/src/routes/spawn-policy.ts +8 -7
- package/src/routes/sse.ts +2 -2
- package/src/routes/team-templates.ts +7 -7
- package/src/routes/teams.ts +10 -10
- package/src/routes/tokens.ts +18 -17
- package/src/routes/users.ts +24 -24
- package/src/routes/viewer-read.ts +3 -3
- package/src/routes/web-tool-calls.ts +4 -4
- package/src/routes/workflows.ts +2 -2
- package/src/routes/workspaces.ts +17 -16
- package/src/routing-policy-push.ts +6 -6
- package/src/runtime-grant.ts +17 -11
- package/src/runtime-tokens.ts +20 -28
- package/src/secrets-broker/config.ts +1 -1
- package/src/secrets-broker/service.ts +2 -2
- package/src/security.ts +3 -1
- package/src/self-resume-carry.ts +21 -110
- package/src/self-resume-supersede.ts +4 -3
- package/src/self-resume.ts +54 -66
- package/src/server-background.ts +1 -1
- package/src/server.ts +21 -22
- package/src/services/agent-action.ts +12 -31
- package/src/services/agent-effort.ts +7 -32
- package/src/services/agent-hang-watchdog-job.ts +2 -2
- package/src/services/agent-heartbeat.ts +166 -0
- package/src/services/agent-reporting.ts +1 -1
- package/src/services/browser-inventory.ts +3 -3
- package/src/services/browser-session-state.ts +3 -2
- package/src/services/browser-session.ts +21 -27
- package/src/services/bus-command-update.ts +9 -9
- package/src/services/checkout-refresh-state.ts +1 -0
- package/src/services/checkout-refresh.test-fixture.ts +3 -2
- package/src/services/command-host.ts +7 -2
- package/src/services/coordinator-digest.ts +3 -2
- package/src/services/dispatch-command.ts +12 -13
- package/src/services/effective-launch-driver.ts +14 -9
- package/src/services/host-changed-paths.test-fixture.ts +5 -6
- package/src/services/host-project-readiness.ts +2 -2
- package/src/services/host-providers.ts +1 -1
- package/src/services/host-utilization.ts +9 -9
- package/src/services/idle-agent-digest.ts +17 -12
- package/src/services/idle-epics.ts +4 -4
- package/src/services/interrupt-agent.ts +12 -9
- package/src/services/issue-activity.ts +3 -3
- package/src/services/issue-associations.ts +15 -18
- package/src/services/issue-lifecycle-comments.ts +3 -2
- package/src/services/issue-lifecycle.ts +14 -13
- package/src/services/issue-refs.ts +4 -5
- package/src/services/kernel-timers-cutover-chaos-worker.ts +1 -1
- package/src/services/kernel-timers-ingress-chaos-worker.ts +6 -1
- package/src/services/kernel-timers-ingress.ts +3 -3
- package/src/services/kernel-timers-message-authority-chaos-worker.ts +3 -10
- package/src/services/kernel-timers-operator-chaos-worker.ts +3 -2
- package/src/services/kernel-timers-outbox.ts +1 -1
- package/src/services/kernel-timers-stage10-operator.ts +1 -1
- package/src/services/kernel-timers.ts +4 -3
- package/src/services/land-gate-placement.ts +11 -2
- package/src/services/land-issue-relations.ts +5 -4
- package/src/services/land-restart-retry.ts +7 -6
- package/src/services/landed-ancestry.ts +6 -5
- package/src/services/legacy-landing-host.ts +4 -1
- package/src/services/legacy-landing-recovery.ts +8 -6
- package/src/services/managed-running.ts +17 -17
- package/src/services/memory-areas.ts +3 -3
- package/src/services/merge-pause.ts +9 -15
- package/src/services/operator-decisions.ts +37 -41
- package/src/services/orchestrator-registration-recovery.ts +6 -2
- package/src/services/orchestrator-upgrade.ts +14 -12
- package/src/services/permission-decision.ts +4 -3
- package/src/services/plan-ci-notice.ts +1 -1
- package/src/services/plan-conformance.ts +4 -4
- package/src/services/plan-dispatch-policy.ts +10 -3
- package/src/services/plan-dispatch.ts +35 -14
- package/src/services/plan-graph.ts +39 -261
- package/src/services/plan-import.ts +1 -1
- package/src/services/plan-live-bindings.ts +8 -37
- package/src/services/plan-task-create.ts +1 -1
- package/src/services/plan-terminal-refs.ts +2 -12
- package/src/services/plan-wake-digest.ts +8 -3
- package/src/services/profile-trust.ts +2 -2
- package/src/services/project.ts +11 -10
- package/src/services/prompt-templates.ts +6 -5
- package/src/services/provider-hold-nudge.ts +9 -9
- package/src/services/provider-hold-record.ts +13 -12
- package/src/services/provider-state-audit.ts +19 -18
- package/src/services/provisioning-harness/driver.ts +1 -1
- package/src/services/provisioning-harness/fixture-matrix.ts +3 -3
- package/src/services/provisioning-harness/lifecycle.ts +24 -22
- package/src/services/provisioning-harness/prepare.ts +16 -17
- package/src/services/rate-limit-resume.ts +10 -9
- package/src/services/red-main-auto-revert.ts +7 -5
- package/src/services/red-main-controller-deps.ts +20 -3
- package/src/services/red-main-incident.ts +3 -1
- package/src/services/red-main-quarantine.ts +2 -3
- package/src/services/register-agent.ts +22 -22
- package/src/services/restart-project-role.ts +1 -1
- package/src/services/restart-spawn.ts +17 -16
- package/src/services/review-publish.ts +7 -24
- package/src/services/review-ref-reconcile.ts +29 -38
- package/src/services/runtime-dependency-alert.ts +27 -0
- package/src/services/scheduler-command.ts +11 -9
- package/src/services/scheduler.ts +5 -5
- package/src/services/self-effort-grant.ts +5 -25
- package/src/services/send-message.ts +16 -33
- package/src/services/shutdown-agent.ts +17 -14
- package/src/services/spawn-agent.ts +12 -41
- package/src/services/spawn-chain-inspector.ts +1 -1
- package/src/services/spawn-cwd-placement.ts +21 -5
- package/src/services/spawn-issue-activity.ts +8 -6
- package/src/services/spawn-launch.ts +17 -1
- package/src/services/spawn-loss-escalation.ts +1 -1
- package/src/services/spawn-registration-watchdog.ts +2 -2
- package/src/services/spawn-repo-probe.ts +7 -5
- package/src/services/spawn-tree-cleanup.ts +7 -8
- package/src/services/steward-reaper.ts +4 -4
- package/src/services/task-context-hydration.ts +25 -1
- package/src/services/task-delivery.ts +20 -34
- package/src/services/task-entity.ts +40 -203
- package/src/services/task-issue-link.ts +13 -20
- package/src/services/task-issue-weave.ts +12 -11
- package/src/services/task-lifecycle.ts +27 -31
- package/src/services/task-repo-cwd.ts +37 -0
- package/src/services/task-review-hold.ts +4 -17
- package/src/services/task-semantic-events.ts +13 -11
- package/src/services/task-state-reconcile.ts +3 -4
- package/src/services/task-validation.ts +2 -2
- package/src/services/team-templates.ts +5 -5
- package/src/services/team.ts +31 -98
- package/src/services/terminal-provider-exit.ts +6 -5
- package/src/services/timer-message-fire-chaos-worker.ts +7 -3
- package/src/services/timer-message-fire-outbox.ts +1 -1
- package/src/services/transient-agent-reaper.ts +22 -19
- package/src/services/turn-reconcile-audit.ts +9 -9
- package/src/services/user-onboarding.ts +8 -6
- package/src/services/user-profile.ts +6 -9
- package/src/services/work-finality.ts +16 -4
- package/src/services/workflow-auto-start.ts +2 -1
- package/src/services/workflow-caller.ts +61 -4
- package/src/services/workflow-child-proof-worker.ts +1 -1
- package/src/services/workflow-control-proof-worker.ts +1 -1
- package/src/services/workflow-coordinator.ts +8 -2
- package/src/services/workflow-decisions.ts +5 -5
- package/src/services/workflow-deferred-cleanup.ts +1 -1
- package/src/services/workflow-effect-driver.ts +42 -19
- package/src/services/workflow-effects.ts +41 -27
- package/src/services/workflow-pins.ts +7 -4
- package/src/services/workflow-reconcile.ts +1 -0
- package/src/services/workflow-resume-pins.ts +3 -3
- package/src/services/workflow-routing-defaults.ts +18 -0
- package/src/services/workflow-run-view.ts +4 -3
- package/src/services/workflow-run.test-fixture.ts +1 -1
- package/src/services/workflow-runs.ts +34 -22
- package/src/services/workflow-supervisor-state.ts +21 -1
- package/src/services/workflow-supervisor.ts +4 -3
- package/src/services/workspace-recovery.ts +4 -3
- package/src/spawn-admission.ts +10 -2
- package/src/spawn-placement.ts +27 -9
- package/src/spawn-targets.ts +8 -8
- package/src/sse-agent-status.ts +15 -6
- package/src/sse.ts +49 -24
- package/src/startup-context-injection.ts +61 -57
- package/src/steward-handoff.ts +4 -3
- package/src/steward-policy-cleanup.ts +9 -8
- package/src/steward.ts +2 -2
- package/src/task-dispatch-live.ts +5 -2
- package/src/task-dispatcher.ts +2 -2
- package/src/token-db.ts +2 -2
- package/src/token-usage-async.ts +2 -4
- package/src/user-awaiting-reply.ts +5 -5
- package/src/workspace-actions.ts +24 -29
- package/src/workspace-auto-merge.ts +14 -12
- package/src/workspace-changed-paths-client.ts +16 -5
- package/src/workspace-cleanup-stale.ts +30 -7
- package/src/workspace-command-settle.ts +24 -16
- package/src/workspace-config.ts +1 -1
- package/src/workspace-conflict-resolver.ts +9 -7
- package/src/workspace-dead-owner-recovery.ts +5 -4
- package/src/workspace-escalation.ts +12 -11
- package/src/workspace-human-escalation.ts +3 -3
- package/src/workspace-land-gate-watchdog.ts +3 -3
- package/src/workspace-land-refusal.ts +20 -0
- package/src/workspace-land-stopped.ts +1 -0
- package/src/workspace-merge.ts +10 -26
- package/src/workspace-nothing-to-land-notice.ts +2 -2
- package/src/workspace-orphans.ts +18 -37
- package/src/workspace-pr-completion.ts +10 -8
- package/src/workspace-rekey.ts +3 -3
- package/src/workspace-steward-failure.ts +2 -2
- package/src/workspace-steward-wake.ts +2 -2
- package/public/assets/agent-liveness-CaNwK0Zf.js +0 -2
- package/public/assets/provider-display-DsuWMvVL.js +0 -2
- package/public/assets/run-card-CpKqRbhg.js +0 -2
- package/public/assets/shipping-B9YtnwtG.js +0 -2
- package/public/assets/store-DcClXLH0.js +0 -9
- package/runner/src/agent-runner/http-liveness.ts +0 -85
- package/src/db/on-loop-write-transaction.ts +0 -34
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e,u as t}from"./dist-DeW2Y1R5.js";import{Ct as n,X as r,Z as i,q as a,t as o}from"./store-
|
|
2
|
-
//# sourceMappingURL=VaultDecisionCard-
|
|
1
|
+
import{o as e,u as t}from"./dist-DeW2Y1R5.js";import{Ct as n,X as r,Z as i,q as a,t as o}from"./store-DKPDIZBe.js";import{et as s,h as c,v as l}from"./display-CDeH4I8T.js";import{s as u}from"./api-CIIVBtAV.js";import{t as d}from"./external-link-BRfu-fHG.js";import{t as f}from"./key-round-CcSxl5qr.js";import{t as p}from"./lock-BW8MPKw_.js";import{t as m}from"./x-Bge17hWJ.js";import{t as h}from"./button-Do6Z3vvn.js";import{t as g}from"./badge-DqJRtj_p.js";import{t as _}from"./agent-name-CcY3Aijy.js";import{t as v}from"./formatted-body-MLtodyPp.js";var y=t();function b({decision:t,className:b}){let x=n(),S=o(e=>e.agentsById[t.filedBy]),C=o(e=>e.declineVaultRequest),{name:w,scope:T}=i(t.title),E=a(t,x);return(0,y.jsxs)(`div`,{"data-testid":`decision-card-${t.id}`,"data-kind":`vault`,className:e(`rounded-xl bg-card ring-1 ring-tone-sky/40 px-3.5 py-3 text-sm`,b),children:[(0,y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,y.jsx)(f,{className:`mt-0.5 h-4 w-4 shrink-0 text-tone-sky-fg`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`font-medium text-foreground break-words`,children:[`Set secret `,(0,y.jsx)(`code`,{className:`break-all`,children:w})]}),(0,y.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,y.jsx)(g,{variant:`outline`,className:`h-4 border-tone-sky/50 px-1 text-[10px] text-tone-sky-fg`,children:`Secret`}),(0,y.jsx)(g,{variant:`outline`,className:`h-4 px-1 text-[10px]`,children:T}),(0,y.jsxs)(`span`,{children:[`#`,t.id]}),(0,y.jsxs)(`span`,{children:[`· asked by `,(0,y.jsx)(_,{agent:S,fallback:t.filedBy})]}),(0,y.jsxs)(`span`,{children:[`· `,s(x,t.createdAt)]}),t.expiresAt!==void 0&&t.status===`open`&&(0,y.jsxs)(`span`,{"data-testid":`vault-expiry`,title:l(t.expiresAt),className:E?`text-tone-warning-fg`:void 0,children:[`· `,E?`expired ${s(x,t.expiresAt)}`:`expires in ${c(t.expiresAt,x)}`]})]})]})]}),t.context&&(0,y.jsx)(v,{text:t.context,rawBody:t.context,className:`mt-2 text-[13px] leading-relaxed text-foreground/90`}),(0,y.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,y.jsx)(p,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,y.jsx)(`span`,{children:`Enter the value on the one-time page. It does not go through chat and the agent never sees it.`})]}),(0,y.jsxs)(`div`,{className:`mt-2.5 flex flex-col gap-2 sm:flex-row sm:items-center`,children:[t.formUrl&&t.status===`open`&&!E?(0,y.jsxs)(`a`,{href:r(t.formUrl,u()),target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex h-11 w-full items-center justify-center gap-1.5 rounded-lg bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 sm:h-8 sm:w-auto`,children:[(0,y.jsx)(d,{className:`h-3.5 w-3.5`}),`Open secure form`]}):(0,y.jsx)(`p`,{"data-testid":`vault-form-unavailable`,className:`text-xs text-tone-warning-fg`,children:E?`This request expired. Ask the agent to request the secret again.`:t.status===`open`?`The form link is only shown to the operator token.`:`This request is closed.`}),t.status===`open`&&(0,y.jsxs)(h,{type:`button`,variant:`ghost`,onClick:()=>{C(t.id)},className:`h-11 w-full text-muted-foreground sm:h-8 sm:w-auto`,children:[(0,y.jsx)(m,{className:`h-3.5 w-3.5`}),`Decline`]})]})]})}export{b as t};
|
|
2
|
+
//# sourceMappingURL=VaultDecisionCard-DhPfzioE.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{t as i,wt as a}from"./store-
|
|
2
|
-
//# sourceMappingURL=activity-
|
|
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,wt as a}from"./store-DKPDIZBe.js";import{et as o,mt as s,v as c}from"./display-CDeH4I8T.js";import{t as l}from"./scroll-area-CIN4KQse.js";import{t as u}from"./activity-TMzFOdh2.js";import{t as d}from"./radio-Bn0_qc0G.js";import{K as f,a as p,d as m,g as h,t as g}from"./TraceView-DYU962-H.js";import{t as _}from"./braces-BOks9SsY.js";import{t as v}from"./clipboard-list-W2YeUsxT.js";import{n as y,t as b}from"./flame-CxBuz46L.js";import{t as x}from"./link-6RR7Hy3-.js";import{t as S}from"./message-circle-wjztgHBe.js";import{t as C}from"./message-square-reply-B9Z4cbQx.js";import{n as w}from"./agent-type-icon-CY113sp-.js";import{t as T}from"./button-Do6Z3vvn.js";import{t as E}from"./badge-DqJRtj_p.js";import{t as D}from"./task-chip-CYj0mpoL.js";import{n as O}from"./agent-name-CcY3Aijy.js";import{r as k,t as A}from"./card-C4QJ4hCW.js";import{i as j,n as M,t as N}from"./MessageBubble-Bq9kr21N.js";var P=e(n(),1),F=r(),I={question:f,reply:C,message:S,operator:w,pair:x,task:v,state:d},L={question:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,reply:`bg-tone-success/10 text-tone-success-fg border-tone-success/20`,message:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,operator:`bg-tone-purple/10 text-tone-purple-fg border-tone-purple/20`,pair:`bg-tone-yellow/10 text-tone-yellow-fg border-tone-yellow/20`,task:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,state:`bg-tone-cyan/10 text-tone-cyan-fg border-tone-cyan/20`},R=[`question`,`reply`,`message`,`operator`,`pair`,`task`,`state`],z=[`chat`,`session`,`system`,`task`];function B(e){let t=e?.surface;if(!t||typeof t!=`object`)return null;let n=t,r=[];return typeof n.component==`string`&&r.push(n.component),typeof n.view==`string`&&n.view!==n.component&&r.push(n.view),typeof n.session==`string`&&r.push(`tab ${n.session.slice(0,6)}`),typeof n.client==`string`&&r.push(`client ${n.client.slice(0,6)}`),r.length?r.join(` · `):null}function V({entry:e,agentsById:t}){if(e.type===`notice`)return(0,F.jsx)(`div`,{className:`px-1`,children:(0,F.jsx)(M,{msg:e.msg})});if(e.type===`agent-action`)return(0,F.jsx)(`div`,{className:`px-1`,children:(0,F.jsx)(g,{entry:e})});if(e.type===`activity`)return(0,F.jsx)(`div`,{className:`px-1 opacity-60`,children:(0,F.jsx)(j,{steps:e.steps,showReasoning:!1})});if(e.type===`status`)return(0,F.jsx)(`div`,{className:`px-1`,children:(0,F.jsx)(m,{event:e.event})});if(e.type===`date`)return(0,F.jsx)(`div`,{className:`px-1`,children:(0,F.jsx)(p,{date:e.date})});if(e.type===`created`||e.type===`import-boundary`||e.type===`imported-message`||e.type!==`message`)return null;let{msg:n}=e;return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 px-3 mb-0.5`,children:[(0,F.jsx)(`span`,{className:`text-xs font-mono text-muted-foreground truncate max-w-[140px]`,title:n.from,children:(0,F.jsx)(O,{target:n.from,agentsById:t})}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:`→`}),(0,F.jsx)(`span`,{className:`text-xs font-mono text-muted-foreground truncate max-w-[140px]`,title:n.to,children:(0,F.jsx)(O,{target:n.to,agentsById:t})}),(0,F.jsx)(E,{variant:`outline`,className:`text-[10px] px-1 py-0 shrink-0 ml-1`,children:n.kind})]}),(0,F.jsx)(N,{msg:n,peer:s})]})}function H(){let e=i(e=>e.messages),t=i(e=>e.agentsById),[n,r]=(0,P.useState)(``),[a,o]=(0,P.useState)(``),s=(0,P.useMemo)(()=>{let t=e;if(n){let e=n.toLowerCase();t=t.filter(t=>t.from.toLowerCase().includes(e)||t.to.toLowerCase().includes(e))}return a&&(t=t.filter(e=>e.kind===a)),t},[e,n,a]),c=(0,P.useMemo)(()=>h(s,[]),[s]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`input`,{type:`text`,className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm w-44`,placeholder:`Filter by agent…`,value:n,onChange:e=>r(e.target.value)}),(0,F.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:a,onChange:e=>o(e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`All kinds`}),z.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]}),(0,F.jsx)(E,{variant:`secondary`,className:`ml-auto`,children:s.length})]}),(0,F.jsx)(l,{className:`h-[calc(100dvh-13rem)]`,children:(0,F.jsxs)(`div`,{className:`space-y-1 pr-2`,children:[c.length===0&&(0,F.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`No messages yet`}),c.map((e,n)=>(0,F.jsx)(V,{entry:e,agentsById:t},n))]})})]})}function U(){let e=a(),t=i(e=>e.activityFilter),n=i(e=>e.activityEvents),r=i(e=>e.operatorActivity),s=i(e=>e.set),d=i(e=>e.openActivityItem),f=i(e=>e.openTaskDetailById),p=i(e=>e.exportActivity),m=(0,P.useMemo)(()=>{let e=[...n,...r],t=new Set,i=[];for(let n of e){let e=n.clientId||String(n.id);t.has(e)||(t.add(e),i.push(n))}return i.map(e=>({...e,ts:e.ts??new Date(e.createdAt).getTime()})).sort((e,t)=>(t.ts??0)-(e.ts??0))},[n,r]),h=(0,P.useMemo)(()=>t?m.filter(e=>e.kind===t):m,[m,t]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:t,onChange:e=>s({activityFilter:e.target.value}),children:[(0,F.jsx)(`option`,{value:``,children:`All types`}),R.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]}),(0,F.jsxs)(T,{size:`sm`,variant:`outline`,onClick:()=>p(`markdown`),children:[(0,F.jsx)(y,{className:`w-4 h-4 mr-1`}),` Markdown`]}),(0,F.jsxs)(T,{size:`sm`,variant:`outline`,onClick:()=>p(`json`),children:[(0,F.jsx)(_,{className:`w-4 h-4 mr-1`}),` JSON`]}),(0,F.jsx)(E,{variant:`secondary`,className:`ml-auto`,children:h.length})]}),(0,F.jsx)(l,{className:`h-[calc(100dvh-13rem)]`,children:(0,F.jsxs)(`div`,{className:`space-y-2 pr-2`,children:[h.length===0&&(0,F.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`No activity yet`}),h.map(t=>{let n=I[t.kind]||u,r=L[t.kind]||L.message,i=B(t.metadata);return(0,F.jsx)(A,{className:`cursor-pointer hover:bg-accent/40 transition-colors`,onClick:()=>d(t),children:(0,F.jsxs)(k,{className:`p-3 flex gap-3`,children:[(0,F.jsx)(`span`,{className:`inline-flex items-center justify-center w-7 h-7 rounded-md border shrink-0 mt-0.5 ${r}`,children:(0,F.jsx)(n,{className:`w-3.5 h-3.5`})}),(0,F.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`font-medium text-sm truncate`,children:t.title}),(0,F.jsx)(E,{variant:`outline`,className:`text-xs px-1.5 py-0 border ${r}`,children:t.kind}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto shrink-0`,title:c(t.ts??t.createdAt),children:o(e,t.ts??t.createdAt)})]}),t.body&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5 line-clamp-2`,children:t.body}),t.meta&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground/60 mt-0.5 font-mono truncate`,children:t.meta}),i&&(0,F.jsxs)(`p`,{className:`text-xs text-muted-foreground/60 mt-0.5 truncate`,title:i,children:[(0,F.jsx)(`span`,{className:`opacity-70`,children:`via`}),` `,i]}),t.taskId!=null&&(0,F.jsx)(`div`,{className:`mt-1`,children:(0,F.jsx)(D,{id:t.taskId,onClick:()=>f(t.taskId)})})]})]})},t.clientId||t.id)})]})})]})}function W(){let[e,n]=(0,P.useState)(`firehose`);return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e===`firehose`?(0,F.jsx)(b,{className:`w-5 h-5 text-muted-foreground`}):(0,F.jsx)(u,{className:`w-5 h-5 text-muted-foreground`}),(0,F.jsx)(`h2`,{className:`text-lg font-semibold`,children:e===`firehose`?`Firehose`:`Events`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-input overflow-hidden`,children:[(0,F.jsx)(`button`,{className:t(`px-3 py-1.5 text-sm transition-colors`,e===`firehose`?`bg-primary text-primary-foreground`:`hover:bg-accent`),onClick:()=>n(`firehose`),children:`Firehose`}),(0,F.jsx)(`button`,{className:t(`px-3 py-1.5 text-sm transition-colors`,e===`events`?`bg-primary text-primary-foreground`:`hover:bg-accent`),onClick:()=>n(`events`),children:`Events`})]})]}),e===`firehose`?(0,F.jsx)(H,{}):(0,F.jsx)(U,{})]})}export{W as ActivityView};
|
|
2
|
+
//# sourceMappingURL=activity-DzCcQTee.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,u as t}from"./dist-DeW2Y1R5.js";import{P as n}from"./provider-display-
|
|
2
|
-
//# sourceMappingURL=agent-lineage-
|
|
1
|
+
import{n as e,u as t}from"./dist-DeW2Y1R5.js";import{P as n}from"./provider-display-BEeLXC_D.js";import{Z as r,f as i,t as a}from"./display-CDeH4I8T.js";import{t as o}from"./agent-liveness-Bq-s73jW.js";import{t as s}from"./cpu-Dndy84IU.js";import{t as c}from"./eye-BAP6fHrX.js";import{t as l}from"./git-branch-yxhV0m8E.js";import{t as u}from"./layers-DEfClY-v.js";import{t as d}from"./lock-BW8MPKw_.js";import{t as f}from"./rocket-BmO1qSu-.js";import{t as p}from"./terminal-Bl2u7KxT.js";import{t as m}from"./badge-DqJRtj_p.js";var h=e(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),g=e(`arrow-up-narrow-wide`,[[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}],[`path`,{d:`M11 16h7`,key:`uosisv`}],[`path`,{d:`M11 20h10`,key:`jvxblo`}]]),_=e(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),v=e(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),y=e(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),b=e(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),x=t();function S({agent:e,compact:t=!1}){let n=N(e);return n.length===0?null:(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.slice(0,t?4:void 0).map(e=>(0,x.jsx)(m,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))})}function C({agent:e,compact:t=!1,className:n=``}){let r=T(e);return(0,x.jsx)(`div`,{className:`flex flex-wrap items-center gap-1 ${n}`,children:r.map(e=>{let n=e.Icon;return(0,x.jsxs)(`span`,{title:e.title,className:`inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-md border px-1.5 text-[10px] leading-none ${e.className}`,children:[(0,x.jsx)(n,{className:`h-3 w-3 shrink-0`}),!t&&(0,x.jsx)(`span`,{children:e.label})]},e.key)})})}function w({agent:e}){let t=e.context;if(!t)return null;let n=I(t);if(n===null)return(0,x.jsxs)(`div`,{className:`space-y-1`,title:L(t),children:[(0,x.jsxs)(`div`,{className:`flex justify-between text-[10px] text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:`collecting`}),(0,x.jsx)(`span`,{children:`--`})]}),(0,x.jsx)(`div`,{className:`h-1.5 rounded-full bg-muted overflow-hidden`,children:(0,x.jsx)(`div`,{className:`h-full w-0 bg-muted-foreground/30`})})]});let r=Math.round(n*100),i=r>=80?`bg-tone-danger`:r>=60?`bg-tone-yellow`:`bg-tone-success`;return(0,x.jsxs)(`div`,{className:`space-y-1`,title:L(t),children:[(0,x.jsxs)(`div`,{className:`flex justify-between text-[10px] text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:t.lifecycleState}),(0,x.jsxs)(`span`,{children:[r,`%`]})]}),(0,x.jsx)(`div`,{className:`h-1.5 rounded-full bg-muted overflow-hidden`,children:(0,x.jsx)(`div`,{className:`h-full ${i}`,style:{width:`${Math.max(0,Math.min(100,r))}%`}})})]})}function T(e){let t=D(e),n=O(e),r=k(e);return[{key:`origin`,label:t?`Relay`:`External`,title:t?`Humwick spawned this agent`:`Externally started agent registered with Humwick`,Icon:t?f:_,className:t?`border-tone-sky/30 bg-tone-sky/10 text-tone-sky-fg`:`border-tone-neutral/30 bg-tone-neutral/10 text-tone-neutral-fg`},n,...E(e),r]}function E(e){let t=e.meta?.launchMode;return t===`headless`?[{key:`launchMode`,label:`Headless`,title:`Launch mode: headless (persistent pipe, no terminal)`,Icon:s,className:`border-tone-fuchsia/30 bg-tone-fuchsia/10 text-tone-fuchsia-fg`}]:t===`interactive`?[{key:`launchMode`,label:`Interactive`,title:`Launch mode: interactive (terminal)`,Icon:p,className:`border-tone-teal/30 bg-tone-teal/10 text-tone-teal-fg`}]:[]}function D(e){return typeof e.meta?.spawnRequestId==`string`||typeof e.meta?.policyName==`string`||typeof e.meta?.automationRunId==`string`}function O(e){let t=String(e.providerCapabilities?.session?.approvalMode||e.meta?.approvalMode||`guarded`).toLowerCase();return t===`open`?{key:`approval`,label:`Open`,title:`Approval mode: open`,Icon:y,className:`border-tone-success/30 bg-tone-success/10 text-tone-success-fg`}:t===`read-only`?{key:`approval`,label:`Read-only`,title:`Approval mode: read-only`,Icon:c,className:`border-tone-info/30 bg-tone-info/10 text-tone-info-fg`}:{key:`approval`,label:`Guarded`,title:`Approval mode: guarded`,Icon:d,className:`border-tone-warning/30 bg-tone-warning/10 text-tone-warning-fg`}}function k(e){let t=A(e.meta?.workspace),r=n(t.requestedMode)||n(e.meta?.workspaceMode),i=n(t.mode),a=r&&r!==`inherit`?r:i&&r!==`inherit`?i:`default`;return a===`isolated`?{key:`workspace`,label:`Isolated`,title:`Workspace: isolated worktree`,Icon:l,iconColor:`text-tone-violet-fg`,className:`border-tone-violet/30 bg-tone-violet/10 text-tone-violet-fg`}:a===`shared`?{key:`workspace`,label:`Shared`,title:`Workspace: shared repo checkout`,Icon:b,iconColor:`text-tone-cyan-fg`,className:`border-tone-cyan/30 bg-tone-cyan/10 text-tone-cyan-fg`}:{key:`workspace`,label:`Default`,title:i?`Workspace: default/inherit, resolved to ${i}`:`Workspace: default/inherit`,Icon:u,iconColor:`text-tone-neutral-fg`,className:`border-tone-neutral/30 bg-tone-neutral/10 text-tone-neutral-fg`}}function A(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function j(e){let t=A(e.meta?.workspace),i=n(e.branchWorkspaceProjectRoot)||n(t.repoRoot)||n(t.sourceCwd)||n(e.meta?.cwd);return i?r(i,2):``}function M(e){return!!(e.context||e.providerCapabilities?.context)}function N(e){let t=e.providerCapabilities,n=e.context,r=[];t?.lifecycle.managed?r.push(`managed`):t&&r.push(`bridge`),t?.session?.approvalMode===`read-only`?r.push(`read-only`):t?.session?.fileWrite&&r.push(`write`),t?.session?.shell&&r.push(`shell`),(t?.model?.alias||t?.model?.id)&&r.push(String(t.model.alias||t.model.id));let i=a(e).length;if(i&&r.push(i===1?`1 subagent`:`${i} subagents`),n){let e=I(n);r.push(e===null?`ctx collecting`:`${Math.round(e*100)}% ctx`)}return r}function P({context:e,expected:t=!!e,size:n=26,className:r}){let i=I(e);if(i===null&&!t)return null;let a=n>=24?3:2.5,o=n/2,s=o-a,c=2*Math.PI*s,l=i===null?c:c*(1-i),u=i===null,d=u?`text-muted-foreground`:i>.8?`text-tone-danger-fg`:i>.5?`text-tone-yellow-fg`:`text-tone-success-fg`,f=u?null:Math.round(i*100);return(0,x.jsxs)(`div`,{className:`relative shrink-0 ${u?`opacity-70`:``} ${r??``}`,style:{width:n,height:n},title:L(e),children:[(0,x.jsxs)(`svg`,{width:n,height:n,viewBox:`0 0 ${n} ${n}`,className:`rotate-[-90deg]`,children:[(0,x.jsx)(`circle`,{cx:o,cy:o,r:s,fill:`none`,strokeWidth:a,className:`stroke-muted-foreground/20`}),(0,x.jsx)(`circle`,{cx:o,cy:o,r:s,fill:`none`,strokeWidth:a,strokeDasharray:c,strokeDashoffset:l,strokeLinecap:`round`,className:`${d} stroke-current transition-all duration-500`})]}),(0,x.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center font-semibold leading-none ${u?`text-muted-foreground`:d}`,style:{fontSize:n>=24?8:7},children:u?`?`:f})]})}function F(e){let t=e.context;return!t?.tokensUsed&&!t?.tokensMax?null:t.tokensUsed&&t.tokensMax?`${R(t.tokensUsed)} / ${R(t.tokensMax)}`:t.tokensUsed?R(t.tokensUsed):t.tokensMax?R(t.tokensMax):null}function I(e){return!e||typeof e.utilization!=`number`||!Number.isFinite(e.utilization)?null:Math.min(1,Math.max(0,e.utilization))}function L(e){if(!e)return`Context: collecting; provider has not reported usage yet`;let t=I(e),n=`${e.source}/${e.confidence}`,r=Number.isFinite(e.lastUpdatedAt)?new Date(e.lastUpdatedAt).toLocaleString():`unknown`;return t===null?`Context: unknown; ${n}; updated ${r}`:`Context: ${Math.round(t*100)}%; ${n}; updated ${r}`}function R(e){return e>=1e6?`${(e/1e6).toFixed(e%1e6==0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function z(e,t){return!!e.spawnedBy&&o(t,e)}function B(e,t){let n=new Map;for(let r of e){if(!r.spawnedBy||!z(r,t))continue;let e=n.get(r.spawnedBy);e?e.push(r):n.set(r.spawnedBy,[r])}return n}function V(e,t,n,r=new Set){let i=B(e,n),a=[],o=new Set,s=U(e,n).map(e=>({agent:e,depth:0,parent:e.spawnedBy?t[e.spawnedBy]??null:null})).reverse();for(;s.length;){let e=s.pop();if(o.has(e.agent.id))continue;o.add(e.agent.id);let t=i.get(e.agent.id)??[];if(r.has(e.agent.id))a.push({...e,children:t,folded:t.length?H(e.agent.id,i):void 0});else{a.push({...e,children:t});for(let n=t.length-1;n>=0;n--)s.push({agent:t[n],depth:e.depth+1,parent:e.agent})}}return a}function H(e,t){let n=[],r=new Set([e]),i=[...t.get(e)??[]].reverse();for(;i.length;){let e=i.pop();if(r.has(e.id))continue;r.add(e.id),n.push(e);let a=t.get(e.id)??[];for(let e=a.length-1;e>=0;e--)i.push(a[e])}return n}function U(e,t){let n=new Set(e.map(e=>e.id));return e.filter(e=>e.spawnedBy&&!z(e,t)?!1:!z(e,t)||!e.spawnedBy||!n.has(e.spawnedBy))}function W(e){return[...e].sort((e,t)=>i(e).localeCompare(i(t)))}export{g as _,S as a,P as c,k as d,F as f,_ as g,v as h,U as i,M as l,y as m,B as n,C as o,b as p,W as r,w as s,V as t,j as u,h as v};
|
|
2
|
+
//# sourceMappingURL=agent-lineage-SgDt9i3T.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e,u as t}from"./dist-DeW2Y1R5.js";import{$ as n,f as r,p as i}from"./display-
|
|
2
|
-
//# sourceMappingURL=agent-name-
|
|
1
|
+
import{o as e,u as t}from"./dist-DeW2Y1R5.js";import{$ as n,f as r,p as i}from"./display-CDeH4I8T.js";import{t as a}from"./workflow-marker-X8wxyhzC.js";var o=t();function s({agent:t,fallback:n,className:i}){return(0,o.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1 align-bottom`,children:[(0,o.jsx)(`span`,{className:e(`truncate`,i),children:t?r(t):n??`?`}),(0,o.jsx)(a,{agent:t})]})}function c({target:t,agentsById:r,className:a}){let c=n(t,r);return c?(0,o.jsx)(s,{agent:c,className:a}):(0,o.jsx)(`span`,{className:e(`truncate`,a),children:i(t,r)})}export{c as n,s as t};
|
|
2
|
+
//# sourceMappingURL=agent-name-CcY3Aijy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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}from"./store-
|
|
2
|
-
//# sourceMappingURL=agent-profiles-
|
|
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}from"./store-DKPDIZBe.js";import{M as i,r as a,t as o}from"./provider-display-BEeLXC_D.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dialog-uuJ9_geR.js";import{t as m}from"./chevron-right-iljytE0x.js";import{t as h}from"./copy-DFxhHRtV.js";import{t as g}from"./download-KgtpDbt5.js";import{t as _}from"./eye-BAP6fHrX.js";import{n as v,t as y}from"./user-cog-CKcouW1J.js";import{t as b}from"./loader-circle-BfPd4kOD.js";import{t as x}from"./pencil-B1Hf2V_J.js";import{t as S}from"./plus-D5Ek4e2S.js";import{t as C}from"./trash-2-FbcSq927.js";import{t as w}from"./button-Do6Z3vvn.js";import{t as T}from"./badge-DqJRtj_p.js";import{t as E}from"./project-profile-instructions-DETKFn_E.js";var D=e(t(),1),O=n();function k(e){let t=o(),n=e.provider??``;return n&&n!==`any`&&t.includes(n)?n:t[0]??n}function A(e){if(Array.isArray(e))return e.map(A);if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n===`files`&&Array.isArray(r)?t[n]=r.map(e=>{if(e&&typeof e==`object`&&typeof e.content==`string`){let t=e.content;return{...e,content:`<${t.length} chars elided>`}}return A(e)}):t[n]=A(r);return t}return e}function j({profile:e,open:t,onOpenChange:n}){let m=r(e=>e.apiCall),[h,_]=(0,D.useState)(()=>k(e)),[v,y]=(0,D.useState)(!1),[x,S]=(0,D.useState)(null),[C,T]=(0,D.useState)(null),E=(0,D.useCallback)(async t=>{y(!0),S(null);try{let n=await m(`GET`,`/agent-profiles/${encodeURIComponent(e.name)}/resolved?provider=${t}`);T(n.profile)}catch(e){T(null),S(i(e))}finally{y(!1)}},[m,e.name]);(0,D.useEffect)(()=>{if(t){let t=k(e);_(t),E(t)}},[t,e,E]);function j(e){e!==h&&(_(e),E(e))}function M(){if(!C)return;let t=new Blob([JSON.stringify(C,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e.name}.${h}.resolved.json`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}let N=C?JSON.stringify(A(C),null,2):``;return(0,O.jsx)(p,{open:t,onOpenChange:n,children:(0,O.jsxs)(d,{className:`max-w-3xl`,children:[(0,O.jsxs)(u,{children:[(0,O.jsxs)(f,{className:`font-mono text-sm`,children:[e.name,` — resolved projection`]}),(0,O.jsxs)(c,{children:[`The fully-resolved agent-profile projection (`,(0,O.jsx)(`code`,{children:`withResolvedProvisioning`}),`) for the selected provider. File contents are elided below; download the full JSON for the complete bundle.`]})]}),(0,O.jsxs)(l,{className:`space-y-3`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Provider`}),(0,O.jsx)(`div`,{className:`flex items-center gap-1`,children:o().map(e=>(0,O.jsx)(w,{variant:e===h?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs`,disabled:v,onClick:()=>j(e),children:a(e)},e))}),(0,O.jsx)(`div`,{className:`flex-1`}),(0,O.jsxs)(w,{size:`sm`,className:`h-7 gap-1 text-xs`,disabled:v||!C,onClick:M,children:[(0,O.jsx)(g,{className:`h-3.5 w-3.5`}),`Download full JSON`]})]}),(0,O.jsx)(`div`,{className:`min-h-[16rem] rounded-md border border-border bg-muted/30 p-3`,children:v?(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(b,{className:`h-3.5 w-3.5 animate-spin`}),`Resolving projection…`]}):x?(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:x}):C?(0,O.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed`,children:N}):(0,O.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No projection available.`})})]}),(0,O.jsx)(s,{children:(0,O.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>n(!1),children:`Close`})})]})})}function M({relay:e}){return(0,O.jsx)(`div`,{className:`flex items-center gap-1`,children:[{key:`ctx`,on:e.context},{key:`skl`,on:e.skills},{key:`plg`,on:e.plugins},{key:`stl`,on:e.statusLine}].map(e=>(0,O.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${e.on?`bg-tone-success`:`bg-muted-foreground/30`}`,title:`${e.key}: ${e.on?`on`:`off`}`},e.key))})}function N({profile:e}){let t=r(e=>e.openProfileModal),n=r(e=>e.deleteProfile),i=e.builtIn===!0,[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`group flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-4 ${s?`sm:col-span-2 lg:col-span-3`:``}`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-2 gap-y-1`,children:[(0,O.jsxs)(`div`,{className:`min-w-[10rem] flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,O.jsx)(`span`,{className:`text-base leading-none`,"aria-hidden":!0,children:e.icon?.trim()||`•`}),(0,O.jsx)(`span`,{className:`min-w-0 font-mono text-sm font-medium [overflow-wrap:anywhere]`,children:e.name}),i&&(0,O.jsx)(T,{variant:`secondary`,className:`text-[10px]`,children:`Built-in`}),e.overridden&&(0,O.jsx)(T,{variant:`outline`,className:`text-[10px] border-tone-warning/30 bg-tone-warning/10 text-tone-warning-fg`,children:`Overridden`})]}),e.description&&(0,O.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground line-clamp-2`,children:e.description})]}),(0,O.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5 opacity-100 transition-opacity [@media(hover:hover)]:sm:opacity-0 [@media(hover:hover)]:sm:group-hover:opacity-100 [@media(hover:hover)]:sm:group-focus-within:opacity-100`,children:[(0,O.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`View`,onClick:()=>t(`view`,e),children:(0,O.jsx)(_,{className:`h-3.5 w-3.5`})}),(0,O.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Edit`,onClick:()=>t(`edit`,e),children:(0,O.jsx)(x,{className:`h-3.5 w-3.5`})}),(0,O.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Duplicate`,onClick:()=>t(`duplicate`,e),children:(0,O.jsx)(h,{className:`h-3.5 w-3.5`})}),(0,O.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Resolved projection`,onClick:()=>o(!0),children:(0,O.jsx)(v,{className:`h-3.5 w-3.5`})}),(!i||e.overridden)&&(0,O.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7 text-destructive`,title:i?`Reset to default`:`Delete`,onClick:()=>n(e),children:(0,O.jsx)(C,{className:`h-3.5 w-3.5`})})]})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[10px]`,children:[(0,O.jsx)(T,{variant:`outline`,children:e.provider||`any`}),(0,O.jsxs)(T,{variant:`outline`,children:[`fs: `,e.permissions.filesystem]}),e.permissions.mode&&(0,O.jsx)(T,{variant:`outline`,children:e.permissions.mode})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted-foreground`,children:[(0,O.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Relay `,(0,O.jsx)(M,{relay:e.relay})]}),e.instructions.globalInstructions===`ignore`&&(0,O.jsx)(`span`,{className:`text-tone-warning-fg`,children:`global: ignore`}),Object.keys(e.env||{}).length>0&&(0,O.jsxs)(`span`,{children:[Object.keys(e.env).length,` env vars`]})]}),(0,O.jsxs)(`div`,{className:`-mx-1 border-t border-border pt-2`,children:[(0,O.jsxs)(w,{variant:`ghost`,size:`sm`,className:`h-8 gap-1 px-1 text-xs`,"aria-expanded":s,onClick:()=>c(!s),children:[(0,O.jsx)(m,{className:`h-3.5 w-3.5 transition-transform ${s?`rotate-90`:``}`}),`Project instructions`]}),s&&(0,O.jsx)(`div`,{className:`px-1 pt-1`,children:(0,O.jsx)(E,{profile:e.name})})]}),(0,O.jsx)(j,{profile:e,open:a,onOpenChange:o})]})}function P(){let e=r(e=>e.agentProfiles),t=r(e=>e.openProfileModal),n=e.filter(e=>e.builtIn),i=e.filter(e=>!e.builtIn);return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-semibold`,children:[(0,O.jsx)(y,{className:`h-5 w-5 text-primary`}),`Agent Profiles`]}),(0,O.jsx)(T,{variant:`outline`,children:e.length}),(0,O.jsx)(`div`,{className:`flex-1`}),(0,O.jsxs)(w,{size:`sm`,className:`gap-1`,onClick:()=>t(`create`),children:[(0,O.jsx)(S,{className:`h-3.5 w-3.5`}),`Create Profile`]})]}),n.length>0&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Built-in`}),(0,O.jsx)(`div`,{className:`grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,children:n.map(e=>(0,O.jsx)(N,{profile:e},e.name))})]}),i.length>0&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Custom`}),(0,O.jsx)(`div`,{className:`grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(e=>(0,O.jsx)(N,{profile:e},e.name))})]}),e.length===0&&(0,O.jsx)(`div`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`No agent profiles found. Create one to configure agent behavior.`})]})}export{P as AgentProfilesView};
|
|
2
|
+
//# sourceMappingURL=agent-profiles-cxtRBn6O.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-
|
|
2
|
-
//# sourceMappingURL=agent-project-badge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,p as n,u as r}from"./dist-DeW2Y1R5.js";import{t as i}from"./store-DKPDIZBe.js";import{t as a}from"./boxes-Cv7Wq3h4.js";var o=t(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),s=e(n(),1),c=r();function l({agent:e,className:t=``,onNavigate:n}){let r=typeof e.meta?.cwd==`string`?e.meta.cwd:``,o=i(e=>r?e.projectByCwd[r]:null),l=i(e=>e.fetchProjectForCwd),u=i(e=>e.openProjectFocus);return(0,s.useEffect)(()=>{r&&l(r)},[r,l]),o?(0,c.jsxs)(`button`,{type:`button`,title:`Project: ${o.title||o.slug} — open in Projects`,onClick:e=>{e.stopPropagation(),n?.(),u(o.id)},className:`inline-flex h-5 max-w-full items-center gap-1 rounded-full border border-tone-indigo/30 bg-tone-indigo/10 px-1.5 text-[10px] font-medium text-tone-indigo-fg transition-colors hover:bg-tone-indigo/20 ${t}`,children:[(0,c.jsx)(a,{className:`h-3 w-3 shrink-0`}),(0,c.jsx)(`span`,{className:`truncate`,children:o.title||o.slug})]}):null}export{o as n,l as t};
|
|
2
|
+
//# sourceMappingURL=agent-project-badge-DGYbIhaI.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{t as i,wt as a}from"./store-DcClXLH0.js";import{et as o,v as s,y as c}from"./display-BrKWFGJz.js";import{t as l}from"./api-CIIVBtAV.js";import{t as u}from"./globe-Cl5fXtqs.js";import{t as d}from"./refresh-cw-CfpvQcUn.js";import{t as f}from"./button-Do6Z3vvn.js";import{t as p}from"./badge-DqJRtj_p.js";import{n as m}from"./agent-name-DKbiIhBo.js";var h=e(n(),1),g={total:0,perDay:[],perBackend:[],topErrors:[],agents:[],statuses:[]};function _(e){let[t,n]=(0,h.useState)([]),[r,i]=(0,h.useState)(null),[a,o]=(0,h.useState)(g),[s,c]=(0,h.useState)(null),[u,d]=(0,h.useState)(null),[f,p]=(0,h.useState)(!1),m=(0,h.useRef)([]),_=(0,h.useRef)(!1),v=(0,h.useRef)(0),{tool:y,windowMs:b,status:x,agentId:S,backend:C}=e,w=(0,h.useCallback)(async e=>{if(_.current)return;_.current=!0;let t=++v.current;p(!0);let r=Date.now()-b,a=new URLSearchParams({since:String(r),limit:`1000`});for(let[e,t]of Object.entries({tool:y,status:x,agentId:S,backend:C}))t&&a.set(e,t);let s=m.current.filter(e=>e.time>=r);e&&(a.set(`beforeTime`,String(e.beforeTime)),a.set(`beforeId`,e.beforeId));try{let u=async()=>{let n=await l(`GET`,`/web-tool-calls?${a}`),r=[...n.calls];for(;!e&&s[0]&&n.nextCursor&&!n.calls.some(e=>e.id===s[0].id)&&n.calls.at(-1).time>=s[0].time;)if(a.set(`beforeTime`,String(n.nextCursor.beforeTime)),a.set(`beforeId`,n.nextCursor.beforeId),n=await l(`GET`,`/web-tool-calls?${a}`),r.push(...n.calls),t!==v.current)return{calls:[],nextCursor:null};return{calls:r,nextCursor:n.nextCursor}},f=new URLSearchParams({since:String(r)});y&&f.set(`tool`,y);let[p,h,g]=await Promise.all([u(),e?Promise.resolve(null):l(`GET`,`/web-tool-calls/summary?${f}`),e?Promise.resolve(null):l(`GET`,`/web-search/budget`)]);if(t!==v.current)return;let _=new Map(s.map(e=>[e.id,e]));for(let e of p.calls)_.set(e.id,e);let b=[..._.values()].sort((e,t)=>t.time-e.time||(e.id<t.id?1:e.id>t.id?-1:0));m.current=b,n(b),e||s.length===0?i(p.nextCursor):i(e=>e&&e.beforeTime>=r?e:null),h&&o(h),g&&c(g),d(null)}catch(e){t===v.current&&d(e.message)}finally{t===v.current&&(_.current=!1,p(!1))}},[y,b,x,S,C]);return(0,h.useEffect)(()=>{w();let e=setInterval(()=>{document.visibilityState!==`hidden`&&w()},1e4);return()=>{clearInterval(e),v.current++,_.current=!1}},[w]),{calls:t,cursor:r,summary:a,budget:s,error:u,loading:f,refresh:()=>w(),loadOlder:()=>r?w(r):Promise.resolve()}}var v=r(),y=1440*60*1e3,b=[[`24h`,y],[`7d`,7*y],[`30d`,30*y]],x=[[``,`All web tools`],[`search`,`Web search`],[`fetch`,`Web fetch`]],S=`h-8 min-w-0 rounded-md border border-input bg-background px-2 text-sm`;function C({budget:e}){if(!e)return null;let n=Math.min(100,Math.round(e.requests/e.cap*100)),r=n>=100?`danger`:n>=80?`warning`:`success`;return(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`brave-budget`,children:[(0,v.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Brave budget · `,e.month,` (UTC)`]}),(0,v.jsxs)(`div`,{className:`mt-1 text-lg font-semibold`,children:[e.requests,` / `,e.cap,` `,(0,v.jsxs)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:[`requests (`,n,`%)`]})]}),(0,v.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-muted`,children:(0,v.jsx)(`div`,{className:t(`h-full`,`bg-tone-${r}`),style:{width:`${n}%`}})})]})}function w({summary:e,budget:n}){let r=Math.max(1,...e.perDay.map(e=>e.calls));return(0,v.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,v.jsx)(C,{budget:n}),(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Calls per day`}),(0,v.jsxs)(`ul`,{className:`mt-1 space-y-1`,children:[e.perDay.slice(0,7).map(e=>(0,v.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,v.jsx)(`span`,{className:`w-20 shrink-0 font-mono text-muted-foreground`,children:e.day.slice(5)}),(0,v.jsx)(`span`,{className:`h-2 rounded-full bg-tone-info`,style:{width:`${Math.max(2,e.calls/r*60)}%`}}),(0,v.jsx)(`span`,{children:e.calls})]},e.day)),e.perDay.length===0&&(0,v.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No calls`})]})]}),(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Error rate per backend`}),(0,v.jsxs)(`ul`,{className:`mt-1 space-y-1`,children:[e.perBackend.map(e=>(0,v.jsxs)(`li`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono`,children:e.backend}),(0,v.jsxs)(`span`,{className:t(e.errors>0&&`font-semibold text-tone-danger-fg`),children:[Math.round(e.errors/e.calls*100),`% · `,e.errors,`/`,e.calls]})]},e.backend)),e.perBackend.length===0&&(0,v.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No calls`})]})]}),(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Top errors`}),(0,v.jsxs)(`ul`,{className:`mt-1 space-y-1`,children:[e.topErrors.map(e=>(0,v.jsxs)(`li`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono text-tone-danger-fg`,children:e.status}),(0,v.jsx)(`span`,{children:e.count})]},e.status)),e.topErrors.length===0&&(0,v.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No errors`})]})]})]})}function T({label:e,children:t}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,v.jsx)(`dd`,{className:`break-words font-mono`,children:t})]})}function E({call:e,now:n,open:r,onToggle:a}){let l=i(e=>e.agentsById),u=e.status===`success`;return(0,v.jsxs)(`li`,{className:t(`rounded-md border border-border`,!u&&`border-tone-danger/40 bg-tone-danger/5`),"data-testid":`tool-call-row`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`block w-full min-w-0 px-3 py-2 text-left`,"aria-expanded":r,onClick:a,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,v.jsx)(p,{className:t(`border`,u?`border-tone-success/30 bg-tone-success/10 text-tone-success-fg`:`border-tone-danger/40 bg-tone-danger/10 text-tone-danger-fg`),children:e.status}),(0,v.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,v.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:e.backend}),(0,v.jsx)(`span`,{className:`min-w-0 max-w-[10rem] truncate`,children:(0,v.jsx)(m,{target:e.agentId,agentsById:l})}),(0,v.jsxs)(`span`,{className:`ml-auto text-muted-foreground`,title:s(e.time),children:[o(n,e.time),` · `,e.durationMs,` ms`]})]}),(0,v.jsx)(`div`,{className:`mt-1 truncate text-sm`,title:e.input,children:e.input})]}),r&&(0,v.jsxs)(`dl`,{className:`grid gap-2 border-t border-border px-3 py-2 text-xs sm:grid-cols-2`,children:[(0,v.jsx)(T,{label:`Time`,children:s(e.time)}),(0,v.jsx)(T,{label:`Provider / model / effort`,children:[e.provider,e.model,e.effort].map(e=>e??`–`).join(` / `)}),(0,v.jsx)(T,{label:`Input`,children:e.input}),(0,v.jsx)(T,{label:`Result size`,children:c(e.resultSize)}),(0,v.jsx)(T,{label:`Cache hit`,children:e.cacheHit===null?`unknown`:e.cacheHit?`yes`:`no`}),(0,v.jsx)(T,{label:`Fallback chain`,children:e.fallbackChain.length?e.fallbackChain.join(` → `):`–`}),e.error&&(0,v.jsx)(T,{label:`Error`,children:e.error}),(0,v.jsx)(T,{label:`Call id`,children:e.id})]})]})}function D(){let[e,t]=(0,h.useState)({tool:``,windowMs:y,status:``,agentId:``,backend:``});return(0,v.jsx)(O,{filters:e,onFilters:t},JSON.stringify(e))}function O({filters:e,onFilters:n}){let r=a(),{tool:i,windowMs:o,status:s,agentId:c,backend:l}=e,{calls:m,cursor:g,summary:y,budget:C,error:T,loading:D,refresh:O,loadOlder:k}=_(e),[A,j]=(0,h.useState)(null),M=y.perBackend.reduce((e,t)=>e+t.errors,0);return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,v.jsx)(u,{className:`h-5 w-5 text-muted-foreground`}),(0,v.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Agent Tools`}),(0,v.jsx)(p,{variant:`secondary`,children:y.total}),M>0&&(0,v.jsxs)(p,{variant:`destructive`,children:[M,` errors`]})]}),(0,v.jsxs)(f,{size:`sm`,variant:`outline`,disabled:D,onClick:()=>void O(),children:[(0,v.jsx)(d,{className:`h-3.5 w-3.5`}),` Refresh`]})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(`select`,{"aria-label":`Tool`,className:S,value:i,onChange:t=>n({...e,tool:t.target.value}),children:x.map(([e,t])=>(0,v.jsx)(`option`,{value:e,children:t},e))}),(0,v.jsx)(`select`,{"aria-label":`Time window`,className:S,value:o,onChange:t=>n({...e,windowMs:Number(t.target.value)}),children:b.map(([e,t])=>(0,v.jsx)(`option`,{value:t,children:e},e))}),(0,v.jsxs)(`select`,{"aria-label":`Status`,className:S,value:s,onChange:t=>n({...e,status:t.target.value}),children:[(0,v.jsx)(`option`,{value:``,children:`Any status`}),(0,v.jsx)(`option`,{value:`error`,children:`All errors`}),y.statuses.map(e=>(0,v.jsx)(`option`,{value:e,children:e},e))]}),(0,v.jsxs)(`select`,{"aria-label":`Agent`,className:t(S,`max-w-[10rem]`),value:c,onChange:t=>n({...e,agentId:t.target.value}),children:[(0,v.jsx)(`option`,{value:``,children:`Any agent`}),y.agents.map(e=>(0,v.jsx)(`option`,{value:e,children:e},e))]}),(0,v.jsxs)(`select`,{"aria-label":`Backend`,className:S,value:l,onChange:t=>n({...e,backend:t.target.value}),children:[(0,v.jsx)(`option`,{value:``,children:`Any backend`}),y.perBackend.map(e=>(0,v.jsx)(`option`,{value:e.backend,children:e.backend},e.backend))]})]}),T&&(0,v.jsx)(`div`,{className:`rounded-md border border-tone-danger/40 bg-tone-danger/10 px-3 py-2 text-sm text-tone-danger-fg`,children:T}),(0,v.jsx)(w,{summary:y,budget:C}),m.length===0?(0,v.jsx)(`div`,{className:`rounded-md border border-border px-3 py-12 text-center text-sm text-muted-foreground`,children:D?`Loading calls…`:`No tool calls match`}):(0,v.jsx)(`ul`,{className:`space-y-2`,children:m.map(e=>(0,v.jsx)(E,{call:e,now:r,open:A===e.id,onToggle:()=>j(A===e.id?null:e.id)},e.id))}),g&&(0,v.jsx)(`div`,{className:`text-center`,children:(0,v.jsx)(f,{size:`sm`,variant:`outline`,disabled:D,onClick:()=>void k(),children:`Load older calls`})})]})}export{D as AgentToolsView};
|
|
2
|
-
//# sourceMappingURL=agent-tools-
|
|
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,wt as a}from"./store-DKPDIZBe.js";import{et as o,v as s,y as c}from"./display-CDeH4I8T.js";import{t as l}from"./api-CIIVBtAV.js";import{t as u}from"./globe-Cl5fXtqs.js";import{t as d}from"./refresh-cw-CfpvQcUn.js";import{t as f}from"./button-Do6Z3vvn.js";import{t as p}from"./badge-DqJRtj_p.js";import{n as m}from"./agent-name-CcY3Aijy.js";var h=e(n(),1),g={total:0,perDay:[],perBackend:[],topErrors:[],agents:[],statuses:[]};function _(e){let[t,n]=(0,h.useState)([]),[r,i]=(0,h.useState)(null),[a,o]=(0,h.useState)(g),[s,c]=(0,h.useState)(null),[u,d]=(0,h.useState)(null),[f,p]=(0,h.useState)(!1),m=(0,h.useRef)([]),_=(0,h.useRef)(!1),v=(0,h.useRef)(0),{tool:y,windowMs:b,status:x,agentId:S,backend:C}=e,w=(0,h.useCallback)(async e=>{if(_.current)return;_.current=!0;let t=++v.current;p(!0);let r=Date.now()-b,a=new URLSearchParams({since:String(r),limit:`1000`});for(let[e,t]of Object.entries({tool:y,status:x,agentId:S,backend:C}))t&&a.set(e,t);let s=m.current.filter(e=>e.time>=r);e&&(a.set(`beforeTime`,String(e.beforeTime)),a.set(`beforeId`,e.beforeId));try{let u=async()=>{let n=await l(`GET`,`/web-tool-calls?${a}`),r=[...n.calls];for(;!e&&s[0]&&n.nextCursor&&!n.calls.some(e=>e.id===s[0].id)&&n.calls.at(-1).time>=s[0].time;)if(a.set(`beforeTime`,String(n.nextCursor.beforeTime)),a.set(`beforeId`,n.nextCursor.beforeId),n=await l(`GET`,`/web-tool-calls?${a}`),r.push(...n.calls),t!==v.current)return{calls:[],nextCursor:null};return{calls:r,nextCursor:n.nextCursor}},f=new URLSearchParams({since:String(r)});y&&f.set(`tool`,y);let[p,h,g]=await Promise.all([u(),e?Promise.resolve(null):l(`GET`,`/web-tool-calls/summary?${f}`),e?Promise.resolve(null):l(`GET`,`/web-search/budget`)]);if(t!==v.current)return;let _=new Map(s.map(e=>[e.id,e]));for(let e of p.calls)_.set(e.id,e);let b=[..._.values()].sort((e,t)=>t.time-e.time||(e.id<t.id?1:e.id>t.id?-1:0));m.current=b,n(b),e||s.length===0?i(p.nextCursor):i(e=>e&&e.beforeTime>=r?e:null),h&&o(h),g&&c(g),d(null)}catch(e){t===v.current&&d(e.message)}finally{t===v.current&&(_.current=!1,p(!1))}},[y,b,x,S,C]);return(0,h.useEffect)(()=>{w();let e=setInterval(()=>{document.visibilityState!==`hidden`&&w()},1e4);return()=>{clearInterval(e),v.current++,_.current=!1}},[w]),{calls:t,cursor:r,summary:a,budget:s,error:u,loading:f,refresh:()=>w(),loadOlder:()=>r?w(r):Promise.resolve()}}var v=r(),y=1440*60*1e3,b=[[`24h`,y],[`7d`,7*y],[`30d`,30*y]],x=[[``,`All web tools`],[`search`,`Web search`],[`fetch`,`Web fetch`]],S=`h-8 min-w-0 rounded-md border border-input bg-background px-2 text-sm`;function C({budget:e}){if(!e)return null;let n=Math.min(100,Math.round(e.requests/e.cap*100)),r=n>=100?`danger`:n>=80?`warning`:`success`;return(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`brave-budget`,children:[(0,v.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Brave budget · `,e.month,` (UTC)`]}),(0,v.jsxs)(`div`,{className:`mt-1 text-lg font-semibold`,children:[e.requests,` / `,e.cap,` `,(0,v.jsxs)(`span`,{className:`text-sm font-normal text-muted-foreground`,children:[`requests (`,n,`%)`]})]}),(0,v.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-muted`,children:(0,v.jsx)(`div`,{className:t(`h-full`,`bg-tone-${r}`),style:{width:`${n}%`}})})]})}function w({summary:e,budget:n}){let r=Math.max(1,...e.perDay.map(e=>e.calls));return(0,v.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,v.jsx)(C,{budget:n}),(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Calls per day`}),(0,v.jsxs)(`ul`,{className:`mt-1 space-y-1`,children:[e.perDay.slice(0,7).map(e=>(0,v.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,v.jsx)(`span`,{className:`w-20 shrink-0 font-mono text-muted-foreground`,children:e.day.slice(5)}),(0,v.jsx)(`span`,{className:`h-2 rounded-full bg-tone-info`,style:{width:`${Math.max(2,e.calls/r*60)}%`}}),(0,v.jsx)(`span`,{children:e.calls})]},e.day)),e.perDay.length===0&&(0,v.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No calls`})]})]}),(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Error rate per backend`}),(0,v.jsxs)(`ul`,{className:`mt-1 space-y-1`,children:[e.perBackend.map(e=>(0,v.jsxs)(`li`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono`,children:e.backend}),(0,v.jsxs)(`span`,{className:t(e.errors>0&&`font-semibold text-tone-danger-fg`),children:[Math.round(e.errors/e.calls*100),`% · `,e.errors,`/`,e.calls]})]},e.backend)),e.perBackend.length===0&&(0,v.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No calls`})]})]}),(0,v.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Top errors`}),(0,v.jsxs)(`ul`,{className:`mt-1 space-y-1`,children:[e.topErrors.map(e=>(0,v.jsxs)(`li`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono text-tone-danger-fg`,children:e.status}),(0,v.jsx)(`span`,{children:e.count})]},e.status)),e.topErrors.length===0&&(0,v.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No errors`})]})]})]})}function T({label:e,children:t}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,v.jsx)(`dd`,{className:`break-words font-mono`,children:t})]})}function E({call:e,now:n,open:r,onToggle:a}){let l=i(e=>e.agentsById),u=e.status===`success`;return(0,v.jsxs)(`li`,{className:t(`rounded-md border border-border`,!u&&`border-tone-danger/40 bg-tone-danger/5`),"data-testid":`tool-call-row`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`block w-full min-w-0 px-3 py-2 text-left`,"aria-expanded":r,onClick:a,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs`,children:[(0,v.jsx)(p,{className:t(`border`,u?`border-tone-success/30 bg-tone-success/10 text-tone-success-fg`:`border-tone-danger/40 bg-tone-danger/10 text-tone-danger-fg`),children:e.status}),(0,v.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,v.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:e.backend}),(0,v.jsx)(`span`,{className:`min-w-0 max-w-[10rem] truncate`,children:(0,v.jsx)(m,{target:e.agentId,agentsById:l})}),(0,v.jsxs)(`span`,{className:`ml-auto text-muted-foreground`,title:s(e.time),children:[o(n,e.time),` · `,e.durationMs,` ms`]})]}),(0,v.jsx)(`div`,{className:`mt-1 truncate text-sm`,title:e.input,children:e.input})]}),r&&(0,v.jsxs)(`dl`,{className:`grid gap-2 border-t border-border px-3 py-2 text-xs sm:grid-cols-2`,children:[(0,v.jsx)(T,{label:`Time`,children:s(e.time)}),(0,v.jsx)(T,{label:`Provider / model / effort`,children:[e.provider,e.model,e.effort].map(e=>e??`–`).join(` / `)}),(0,v.jsx)(T,{label:`Input`,children:e.input}),(0,v.jsx)(T,{label:`Result size`,children:c(e.resultSize)}),(0,v.jsx)(T,{label:`Cache hit`,children:e.cacheHit===null?`unknown`:e.cacheHit?`yes`:`no`}),(0,v.jsx)(T,{label:`Fallback chain`,children:e.fallbackChain.length?e.fallbackChain.join(` → `):`–`}),e.error&&(0,v.jsx)(T,{label:`Error`,children:e.error}),(0,v.jsx)(T,{label:`Call id`,children:e.id})]})]})}function D(){let[e,t]=(0,h.useState)({tool:``,windowMs:y,status:``,agentId:``,backend:``});return(0,v.jsx)(O,{filters:e,onFilters:t},JSON.stringify(e))}function O({filters:e,onFilters:n}){let r=a(),{tool:i,windowMs:o,status:s,agentId:c,backend:l}=e,{calls:m,cursor:g,summary:y,budget:C,error:T,loading:D,refresh:O,loadOlder:k}=_(e),[A,j]=(0,h.useState)(null),M=y.perBackend.reduce((e,t)=>e+t.errors,0);return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,v.jsx)(u,{className:`h-5 w-5 text-muted-foreground`}),(0,v.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Agent Tools`}),(0,v.jsx)(p,{variant:`secondary`,children:y.total}),M>0&&(0,v.jsxs)(p,{variant:`destructive`,children:[M,` errors`]})]}),(0,v.jsxs)(f,{size:`sm`,variant:`outline`,disabled:D,onClick:()=>void O(),children:[(0,v.jsx)(d,{className:`h-3.5 w-3.5`}),` Refresh`]})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(`select`,{"aria-label":`Tool`,className:S,value:i,onChange:t=>n({...e,tool:t.target.value}),children:x.map(([e,t])=>(0,v.jsx)(`option`,{value:e,children:t},e))}),(0,v.jsx)(`select`,{"aria-label":`Time window`,className:S,value:o,onChange:t=>n({...e,windowMs:Number(t.target.value)}),children:b.map(([e,t])=>(0,v.jsx)(`option`,{value:t,children:e},e))}),(0,v.jsxs)(`select`,{"aria-label":`Status`,className:S,value:s,onChange:t=>n({...e,status:t.target.value}),children:[(0,v.jsx)(`option`,{value:``,children:`Any status`}),(0,v.jsx)(`option`,{value:`error`,children:`All errors`}),y.statuses.map(e=>(0,v.jsx)(`option`,{value:e,children:e},e))]}),(0,v.jsxs)(`select`,{"aria-label":`Agent`,className:t(S,`max-w-[10rem]`),value:c,onChange:t=>n({...e,agentId:t.target.value}),children:[(0,v.jsx)(`option`,{value:``,children:`Any agent`}),y.agents.map(e=>(0,v.jsx)(`option`,{value:e,children:e},e))]}),(0,v.jsxs)(`select`,{"aria-label":`Backend`,className:S,value:l,onChange:t=>n({...e,backend:t.target.value}),children:[(0,v.jsx)(`option`,{value:``,children:`Any backend`}),y.perBackend.map(e=>(0,v.jsx)(`option`,{value:e.backend,children:e.backend},e.backend))]})]}),T&&(0,v.jsx)(`div`,{className:`rounded-md border border-tone-danger/40 bg-tone-danger/10 px-3 py-2 text-sm text-tone-danger-fg`,children:T}),(0,v.jsx)(w,{summary:y,budget:C}),m.length===0?(0,v.jsx)(`div`,{className:`rounded-md border border-border px-3 py-12 text-center text-sm text-muted-foreground`,children:D?`Loading calls…`:`No tool calls match`}):(0,v.jsx)(`ul`,{className:`space-y-2`,children:m.map(e=>(0,v.jsx)(E,{call:e,now:r,open:A===e.id,onToggle:()=>j(A===e.id?null:e.id)},e.id))}),g&&(0,v.jsx)(`div`,{className:`text-center`,children:(0,v.jsx)(f,{size:`sm`,variant:`outline`,disabled:D,onClick:()=>void k(),children:`Load older calls`})})]})}export{D as AgentToolsView};
|
|
2
|
+
//# sourceMappingURL=agent-tools-DHbftV0N.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t,u as n}from"./dist-DeW2Y1R5.js";import{w as r}from"./provider-display-
|
|
2
|
-
//# sourceMappingURL=agent-type-icon-
|
|
1
|
+
import{n as e,o as t,u as n}from"./dist-DeW2Y1R5.js";import{w as r}from"./provider-display-BEeLXC_D.js";import{s as i}from"./display-CDeH4I8T.js";import{t as a}from"./bot-B0NpDNhr.js";import{t as o}from"./messages-square-DVM1ZtcI.js";import{t as s}from"./plug-vIyO9_P8.js";import{t as c}from"./workflow-marker-X8wxyhzC.js";import{t as l}from"./server-CZIRjFyY.js";import{t as u}from"./provider-brand-icon-_67JR7Zh.js";var d=e(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),f=n(),p={codex:`text-tone-info-fg bg-tone-info/10 border-tone-info/25`,claude:`text-tone-orange-fg bg-tone-orange/10 border-tone-orange/25`,opencode:`text-tone-cyan-fg bg-tone-cyan/10 border-tone-cyan/25`,user:`text-tone-success-fg bg-tone-success/10 border-tone-success/25`,system:`text-tone-purple-fg bg-tone-purple/10 border-tone-purple/25`,channel:`text-tone-info-fg bg-tone-info/10 border-tone-info/25`,agent:`text-tone-neutral-fg bg-tone-neutral/10 border-tone-neutral/25`},m={user:d,system:l,channel:o,agent:a};function h({agent:e,className:n}){let o=i(e),l=e?.id===r,d=m[o]||a;return(0,f.jsxs)(`span`,{title:l?`Claude app connector`:void 0,className:t(`relative inline-flex items-center justify-center w-5 h-5 rounded-md border text-sm`,p[o]||p.agent,n),children:[l?(0,f.jsx)(s,{className:`w-3.5 h-3.5`}):(0,f.jsx)(u,{provider:o,fallback:d,className:`w-3.5 h-3.5`}),(0,f.jsx)(c,{agent:e,className:`h-2 w-2`,corner:!0})]})}export{d as n,h as t};
|
|
2
|
+
//# sourceMappingURL=agent-type-icon-CY113sp-.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{Bt as i,Ct as a,t as o}from"./store-DcClXLH0.js";import{O as s,r as c,t as l}from"./provider-display-DsuWMvVL.js";import{Z as u,a as d,et as f,f as p,n as m,nt as h,o as g,r as _,rt as v}from"./display-BrKWFGJz.js";import{t as y}from"./api-CIIVBtAV.js";import{a as b,i as x,n as S,r as C,t as w}from"./popover-8w1TWKMG.js";import{t as T}from"./switch-DuCA7mrB.js";import{_ as E,a as ee,h as te,i as D,n as O,o as ne,r as k,s as re,v as A}from"./agent-lineage-CknAJKcb.js";import{t as j}from"./circle-arrow-up-B432r0Kk.js";import{t as M}from"./circle-UESLMi2-.js";import{t as ie}from"./flag-CnEG9PH-.js";import{t as N}from"./git-commit-horizontal-DS1pJ_SS.js";import{t as ae}from"./link-6RR7Hy3-.js";import{t as P}from"./message-square-C-1G8dMM.js";import{t as oe}from"./minimize-2-BkK6XoMP.js";import{n as se,t as ce}from"./agent-project-badge-Diz4Sjjb.js";import{n as F,t as I}from"./pin-DcsKeXxr.js";import{t as L}from"./plus-D5Ek4e2S.js";import{t as le}from"./power-6tZOhYPg.js";import{t as ue}from"./terminal-Bl2u7KxT.js";import{t as de}from"./trash-2-FbcSq927.js";import{t as R}from"./triangle-alert-BBNhfgMi.js";import{t as z}from"./agent-type-icon-LrUEU3lB.js";import{t as fe}from"./users-C7B3u9jv.js";import{t as B}from"./wrench-C7-4CgnY.js";import{t as V}from"./x-Bge17hWJ.js";import{t as H}from"./button-Do6Z3vvn.js";import{t as U}from"./badge-DqJRtj_p.js";import{t as pe}from"./copy-button-CjOj4HEf.js";import{t as me}from"./agent-name-DKbiIhBo.js";import{c as W,d as G,f as K,p as q,t as he,u as ge}from"./use-selectors-BZa25xEB.js";import{t as J}from"./status-dot-DYqlEUhJ.js";import{t as _e}from"./terminal-viewer-BgVLHdsU.js";import{n as ve,t as ye}from"./profile-icon-B3rfh77F.js";import{r as be,t as xe}from"./card-C4QJ4hCW.js";import{t as Y}from"./user-avatar-DHxlvUvV.js";import{t as Se}from"./use-agent-terminal-DSQQ-iY7.js";var X=e(n(),1),Z=r();function Ce({agent:e}){let t=o(e=>e.sessionUser),n=o(e=>e.fetchAgents),[r,i]=(0,X.useState)(!1),[a,c]=(0,X.useState)(``);return t&&t.role!==`admin`&&t.id!==e.principalUserId||e.id===`system`||s(e.id)?null:(0,Z.jsxs)(`div`,{className:`mt-2 text-xs`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(T,{"aria-label":`Share ${e.name||e.id}`,checked:e.visibility===`shared`,disabled:r,onCheckedChange:async t=>{i(!0),c(``);try{await y(`PUT`,`/agents/${encodeURIComponent(e.id)}/visibility`,{visibility:t?`shared`:`private`}),await n()}catch(e){c(e instanceof Error?e.message:`Could not save sharing`)}finally{i(!1)}}}),`Shared with everyone`]}),a&&(0,Z.jsx)(`p`,{role:`alert`,children:a})]})}var Q={idle:{label:`idle`,tip:`Branch worktree — nothing to land yet.`,className:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,Icon:M},changes:{label:`changes`,tip:`Unlanded work in this branch — use "Mark workspace ready" to land it.`,className:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,Icon:N},ready:{label:`ready`,tip:`Handed off — the relay auto-merge will land it (~2 min sweep).`,className:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,Icon:j},steward:{label:`steward`,tip:`Under reconciliation — a steward is landing it. No action needed.`,className:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,Icon:B},blocked:{label:`blocked`,tip:`Escalated — the auto-merge/steward path is stuck. Needs human attention.`,className:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,Icon:R}};function we({state:e,onClick:n,iconOnly:r=!1,className:i}){let a=Q[e],{Icon:o}=a,s=!!n,c=s?`${a.tip} Click to open this workspace.`:a.tip;return(0,Z.jsxs)(`span`,{role:s?`button`:void 0,tabIndex:s?0:void 0,title:c,onClick:n,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n?.(e))}:void 0,className:t(`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium leading-none`,a.className,s&&`cursor-pointer hover:brightness-125 focus:outline-none focus:ring-1 focus:ring-current`,i),children:[(0,Z.jsx)(o,{className:`h-2.5 w-2.5 shrink-0`}),!r&&(0,Z.jsx)(`span`,{children:a.label})]})}function $(e,t){let n=e.keep;return n&&(n.until===void 0||n.until>t)?n:void 0}function Te(e){return`Kept ${e.until?`until ${new Date(e.until).toLocaleString()}`:`until cleared`}${e.reason?` — ${e.reason}`:``}. Excluded from idle digests and automatic cleanup.`}function Ee({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=$(e,t);return r?(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":`true`,title:`${Te(r)} Click to release.`,className:`mt-1 inline-flex h-5 items-center gap-1 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-1.5 text-[10px] font-medium text-tone-sky-fg hover:bg-tone-sky/15`,onClick:t=>{t.stopPropagation(),n(e,!1)},children:[(0,Z.jsx)(I,{className:`h-3 w-3`}),`Kept`]}):null}function De({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=!!$(e,t);return(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,"aria-pressed":r,title:r?`Release keep`:`Keep — exclude from idle digests and automatic cleanup`,onClick:()=>void n(e,!r),children:r?(0,Z.jsx)(F,{className:`w-3 h-3`}):(0,Z.jsx)(I,{className:`w-3 h-3`})})}function Oe({agent:e}){let t=o(e=>e.users.length>1),n=o(t=>e.principalUserId?t.usersById[e.principalUserId]:void 0);if(!t||!e.principalUserId)return null;let r=n?.displayName||n?.handle||e.principalUserId;return(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1 text-[10px] text-muted-foreground`,"data-testid":`agent-principal`,title:`Works for ${r}`,children:[(0,Z.jsx)(Y,{user:n,address:`user:${e.principalUserId}`,distinct:!0,className:`size-3.5 rounded text-[8px]`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`for `,r]})]})}function ke(e,t){return e.agent===t.agent&&e.parentAgent===t.parentAgent&&i(e.childAgents??[],t.childAgents??[])}var Ae=(0,X.memo)(function({agent:e,childAgents:t=[],parentAgent:n}){let r=a();o(e=>e.set);let i=o(e=>e.switchView),c=o(e=>e.openInboxThread),l=o(e=>e.openAgentDetail),y=o(e=>e.openPairInvite),T=o(e=>e.openRename),E=o(e=>e.openConfirm),D=o(e=>e.doAgentAction),O=o(e=>e.doDeleteAgent),k=o(e=>e.openFilesForAgent),A=o(e=>e.workspaceAction),j=o(e=>e.openWorkspaceFocus),{terminalOpen:M,terminalTarget:N,terminalOpening:F,openTerminal:I,closeTerminal:L}=Se(e.id),R=ge(),B=d(r,e,he(e),R[e.id]||null),V=g(e,`shutdown`),W=g(e,`compact`),G=g(e,`clearContext`),K=!!(e.providerCapabilities?.terminal?.live?.read||e.providerCapabilities?.terminal?.attach?.create),q=_(e,K),Y=m(e),X=n?p(n):e.spawnedBy,Q=t.length>0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xe,{className:`group hover:border-tone-neutral transition-colors cursor-pointer`,onClick:()=>l(e),children:(0,Z.jsxs)(be,{className:`p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-2.5`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-0.5`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,Z.jsx)(ye,{profile:ve(e),className:`text-sm shrink-0`}),(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:p(e)})]}),(0,Z.jsx)(`div`,{className:`text-xs mt-0.5 ${h(B.tone)}`,children:B.label}),typeof e.meta?.cwd==`string`&&e.meta.cwd&&(0,Z.jsx)(`button`,{type:`button`,className:`mt-0.5 block max-w-full truncate font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:`Open ${e.meta.cwd} in Files`,onClick:t=>{t.stopPropagation(),k(e)},children:u(e.meta.cwd)}),e.landState&&(0,Z.jsxs)(`div`,{className:`mt-1 text-[10px] text-tone-violet-fg`,children:[e.landState,e.landWaitReason?` · ${e.landWaitReason}`:``]}),(0,Z.jsx)(ce,{agent:e,className:`mt-1`}),(0,Z.jsx)(Ee,{agent:e,now:r}),(0,Z.jsx)(Oe,{agent:e})]}),e.branchState&&e.branchWorkspaceId&&(0,Z.jsx)(we,{state:e.branchState,className:`mt-0.5 shrink-0`,onClick:t=>{t.stopPropagation(),j(e.branchWorkspaceId)}})]}),B.badges.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:B.badges.map(e=>(0,Z.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${e.className}`,children:e.label},e.label))}),(Q||e.spawnedBy&&X)&&(0,Z.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,onClick:e=>e.stopPropagation(),children:[Q&&(0,Z.jsxs)(w,{children:[(0,Z.jsx)(b,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-2 text-[10px] font-medium text-tone-sky-fg transition-colors hover:bg-tone-sky/15`,title:`${t.length} live child ${t.length===1?`agent`:`agents`}`,children:[(0,Z.jsx)(fe,{className:`h-3 w-3`}),(0,Z.jsx)(`span`,{children:t.length}),(0,Z.jsx)(`span`,{className:`flex -space-x-1`,children:t.slice(0,4).map(e=>(0,Z.jsx)(J,{agent:e,now:r,className:`h-2 w-2 ring-1 ring-background`},e.id))})]})}),(0,Z.jsxs)(S,{align:`start`,className:`w-80`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(C,{children:(0,Z.jsx)(x,{children:`Team`})}),(0,Z.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,Z.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-1`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-xs font-medium`,children:p(e)}),(0,Z.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.providerCapabilities?.model?.alias||e.providerCapabilities?.model?.id||e.providerCapabilities?.model?.provider||e.status})]}),(0,Z.jsx)(U,{variant:`outline`,className:`h-4 px-1.5 text-[9px]`,children:e.status})]}),(0,Z.jsxs)(`div`,{className:`mt-2 flex gap-1`,children:[(0,Z.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>l(e),children:`Open`}),(0,Z.jsxs)(H,{size:`xs`,variant:`ghost`,onClick:()=>{c(e.id),i(`chat`)},children:[(0,Z.jsx)(P,{className:`h-3 w-3`}),`Chat`]})]})]},e.id))})]})]}),e.spawnedBy&&X&&(0,Z.jsx)(U,{variant:`outline`,className:`max-w-full text-[10px] text-muted-foreground`,children:(0,Z.jsxs)(`span`,{className:`truncate`,children:[`spawned by `,(0,Z.jsx)(me,{agent:n,fallback:e.spawnedBy})]})})]}),(0,Z.jsx)(Ce,{agent:e}),(e.tags.length>0||v(e.capabilities).length>0)&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:[e.tags.slice(0,3).map(e=>(0,Z.jsx)(U,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e)),v(e.capabilities).slice(0,2).map(e=>(0,Z.jsx)(U,{variant:`secondary`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))]}),(0,Z.jsxs)(`div`,{className:`space-y-2 mb-2`,children:[(0,Z.jsx)(ne,{agent:e}),(0,Z.jsx)(ee,{agent:e,compact:!0}),(0,Z.jsx)(re,{agent:e})]}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:!s(e.id)&&e.id!==`system`&&f(r,e.lastSeen)}),(0,Z.jsxs)(`div`,{className:`flex gap-1 mt-2.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(pe,{value:e.id,label:`Copy agent ID`,size:`icon`,className:`h-7 w-7`,iconClassName:`w-3 h-3`}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Chat`,onClick:()=>{c(e.id),i(`chat`)},children:(0,Z.jsx)(P,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Pair`,onClick:()=>y(e.id),children:(0,Z.jsx)(ae,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Rename`,onClick:()=>T(e),children:(0,Z.jsx)(se,{className:`w-3 h-3`})}),K&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Terminal`,disabled:F,onClick:()=>void I(),children:(0,Z.jsx)(ue,{className:`w-3 h-3`})}),(e.branchState===`changes`||e.branchState===`idle`)&&e.branchWorkspaceId&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-warning-fg hover:text-tone-warning-fg`,title:`Mark workspace ready — hand off to the auto-merge`,onClick:()=>E(`Mark Workspace Ready`,`Mark ${p(e)}'s branch ready to land? The relay auto-merge will rebase and land it.`,()=>A(e.branchWorkspaceId,`ready`)),children:(0,Z.jsx)(ie,{className:`w-3 h-3`})}),e.kind!==`user`&&e.id!==`system`&&(0,Z.jsx)(De,{agent:e,now:r}),W&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Compact`,onClick:()=>E(`Compact Agent`,`Compact context for ${p(e)}?`,()=>D(e,`compact`,`agents-grid`)),children:(0,Z.jsx)(oe,{className:`w-3 h-3`})}),G&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Clear Context`,onClick:()=>E(`Clear Context`,`Clear context for ${p(e)}?`,()=>D(e,`clearContext`,`agents-grid`)),children:(0,Z.jsx)(te,{className:`w-3 h-3`})}),V&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Shutdown`,onClick:()=>E(`Shutdown Agent`,`Shutdown ${p(e)}?`,()=>D(e,`shutdown`,`agents-grid`)),children:(0,Z.jsx)(le,{className:`w-3 h-3`})}),Y&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Forget stale agent`,onClick:()=>E(`Forget Agent`,`Forget ${p(e)}?`,()=>O(e.id)),children:(0,Z.jsx)(de,{className:`w-3 h-3`})})]})]})}),N&&(0,Z.jsx)(_e,{open:M,onOpenChange:L,orchestratorId:N.orchestratorId,session:N.session,interactive:N.interactive||q,canWrite:q,onSessionChanged:()=>void I()})]})},ke);function je(){let e=o(e=>e.agentPresetFilter),t=o(e=>e.agentStatusFilter),n=o(e=>e.agentTagFilter),r=o(e=>e.agentHostFilter),i=o(e=>e.agentSort),s=o(e=>e.agentSortDir),u=o(e=>e.showOffline),d=o(e=>e.setShowOffline),f=W(),p=o(e=>e.set),m=o(e=>e.openAgentSpawn),h=o(e=>e.agentsById),g=a(),_=G(),v=q(),y=K(),b=O(_,g),x=D(_,g),S=e||t||n||r;function C(){p({agentPresetFilter:``,agentStatusFilter:``,agentTagFilter:``,agentHostFilter:``})}function w(){p({agentSortDir:s===`asc`?`desc`:`asc`})}return(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`select`,{value:e,onChange:e=>p({agentPresetFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`All agents`}),(0,Z.jsx)(`option`,{value:`active`,children:`Active`}),l().map(e=>(0,Z.jsx)(`option`,{value:e,children:c(e)},e)),(0,Z.jsx)(`option`,{value:`paired`,children:`Paired`}),(0,Z.jsx)(`option`,{value:`unpaired`,children:`Unpaired`}),(0,Z.jsx)(`option`,{value:`offline_stale`,children:`Offline / Stale`})]}),(0,Z.jsxs)(`select`,{value:t,onChange:e=>p({agentStatusFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any status`}),(0,Z.jsx)(`option`,{value:`online`,children:`Online`}),(0,Z.jsx)(`option`,{value:`idle`,children:`Idle`}),(0,Z.jsx)(`option`,{value:`busy`,children:`Busy`}),(0,Z.jsx)(`option`,{value:`offline`,children:`Offline`}),(0,Z.jsx)(`option`,{value:`starting`,children:`Starting`})]}),v.length>0&&(0,Z.jsxs)(`select`,{value:n,onChange:e=>p({agentTagFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any tag`}),v.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),y.length>1&&(0,Z.jsxs)(`select`,{value:r,onChange:e=>p({agentHostFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any host`}),y.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsxs)(`select`,{value:i,onChange:e=>p({agentSort:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:`status`,children:`Sort: Status`}),(0,Z.jsx)(`option`,{value:`name`,children:`Sort: Name`}),(0,Z.jsx)(`option`,{value:`lastSeen`,children:`Sort: Last seen`}),(0,Z.jsx)(`option`,{value:`created`,children:`Sort: Created`})]}),(0,Z.jsx)(H,{size:`icon`,variant:`outline`,className:`h-8 w-8`,title:`Toggle sort direction`,onClick:w,children:s===`asc`?(0,Z.jsx)(E,{className:`w-3.5 h-3.5`}):(0,Z.jsx)(A,{className:`w-3.5 h-3.5`})}),(0,Z.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer select-none`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked),className:`rounded`}),`Show offline`,f>0?` (${f})`:``]}),S&&(0,Z.jsxs)(H,{size:`sm`,variant:`ghost`,className:`h-8 text-muted-foreground hover:text-foreground gap-1`,onClick:C,children:[(0,Z.jsx)(V,{className:`w-3 h-3`}),`Clear filters`]}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsxs)(H,{size:`sm`,onClick:m,className:`gap-1`,children:[(0,Z.jsx)(L,{className:`w-3.5 h-3.5`}),`Spawn`]})})]}),x.length===0?(0,Z.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:`No agents match the current filters.`}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3`,children:x.map(e=>(0,Z.jsx)(Ae,{agent:e,parentAgent:e.spawnedBy?h[e.spawnedBy]??null:null,childAgents:k(b.get(e.id)??[])},e.id))})]})}export{je as AgentsView};
|
|
2
|
-
//# sourceMappingURL=agents-
|
|
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{Bt as i,Ct as a,t as o}from"./store-DKPDIZBe.js";import{O as s,r as c,t as l}from"./provider-display-BEeLXC_D.js";import{Z as u,a as d,et as f,f as p,n as m,nt as h,o as g,r as _,rt as v}from"./display-CDeH4I8T.js";import{t as y}from"./api-CIIVBtAV.js";import{a as b,i as x,n as S,r as C,t as w}from"./popover-8w1TWKMG.js";import{t as T}from"./switch-DuCA7mrB.js";import{_ as E,a as ee,h as te,i as D,n as O,o as ne,r as k,s as re,v as A}from"./agent-lineage-SgDt9i3T.js";import{t as j}from"./circle-arrow-up-B432r0Kk.js";import{t as M}from"./circle-UESLMi2-.js";import{t as ie}from"./flag-CnEG9PH-.js";import{t as N}from"./git-commit-horizontal-DS1pJ_SS.js";import{t as ae}from"./link-6RR7Hy3-.js";import{t as P}from"./message-square-C-1G8dMM.js";import{t as oe}from"./minimize-2-BkK6XoMP.js";import{n as se,t as ce}from"./agent-project-badge-DGYbIhaI.js";import{n as F,t as I}from"./pin-DcsKeXxr.js";import{t as L}from"./plus-D5Ek4e2S.js";import{t as le}from"./power-6tZOhYPg.js";import{t as ue}from"./terminal-Bl2u7KxT.js";import{t as de}from"./trash-2-FbcSq927.js";import{t as R}from"./triangle-alert-BBNhfgMi.js";import{t as z}from"./agent-type-icon-CY113sp-.js";import{t as fe}from"./users-C7B3u9jv.js";import{t as B}from"./wrench-C7-4CgnY.js";import{t as V}from"./x-Bge17hWJ.js";import{t as H}from"./button-Do6Z3vvn.js";import{t as U}from"./badge-DqJRtj_p.js";import{t as pe}from"./copy-button-CjOj4HEf.js";import{t as me}from"./agent-name-CcY3Aijy.js";import{c as W,d as G,f as K,p as q,t as he,u as ge}from"./use-selectors-BdxBW8mL.js";import{t as J}from"./status-dot-BcHyw1Vw.js";import{t as _e}from"./terminal-viewer-CpY5_m7W.js";import{n as ve,t as ye}from"./profile-icon-BsRyBMea.js";import{r as be,t as xe}from"./card-C4QJ4hCW.js";import{t as Y}from"./user-avatar-3IndfpOc.js";import{t as Se}from"./use-agent-terminal-0yJA_buM.js";var X=e(n(),1),Z=r();function Ce({agent:e}){let t=o(e=>e.sessionUser),n=o(e=>e.fetchAgents),[r,i]=(0,X.useState)(!1),[a,c]=(0,X.useState)(``);return t&&t.role!==`admin`&&t.id!==e.principalUserId||e.id===`system`||s(e.id)?null:(0,Z.jsxs)(`div`,{className:`mt-2 text-xs`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(T,{"aria-label":`Share ${e.name||e.id}`,checked:e.visibility===`shared`,disabled:r,onCheckedChange:async t=>{i(!0),c(``);try{await y(`PUT`,`/agents/${encodeURIComponent(e.id)}/visibility`,{visibility:t?`shared`:`private`}),await n()}catch(e){c(e instanceof Error?e.message:`Could not save sharing`)}finally{i(!1)}}}),`Shared with everyone`]}),a&&(0,Z.jsx)(`p`,{role:`alert`,children:a})]})}var Q={idle:{label:`idle`,tip:`Branch worktree — nothing to land yet.`,className:`bg-tone-neutral/10 text-tone-neutral-fg border-tone-neutral/20`,Icon:M},changes:{label:`changes`,tip:`Unlanded work in this branch — use "Mark workspace ready" to land it.`,className:`bg-tone-warning/10 text-tone-warning-fg border-tone-warning/20`,Icon:N},ready:{label:`ready`,tip:`Handed off — the relay auto-merge will land it (~2 min sweep).`,className:`bg-tone-info/10 text-tone-info-fg border-tone-info/20`,Icon:j},steward:{label:`steward`,tip:`Under reconciliation — a steward is landing it. No action needed.`,className:`bg-tone-orange/10 text-tone-orange-fg border-tone-orange/20`,Icon:B},blocked:{label:`blocked`,tip:`Escalated — the auto-merge/steward path is stuck. Needs human attention.`,className:`bg-tone-danger/10 text-tone-danger-fg border-tone-danger/20`,Icon:R}};function we({state:e,onClick:n,iconOnly:r=!1,className:i}){let a=Q[e],{Icon:o}=a,s=!!n,c=s?`${a.tip} Click to open this workspace.`:a.tip;return(0,Z.jsxs)(`span`,{role:s?`button`:void 0,tabIndex:s?0:void 0,title:c,onClick:n,onKeyDown:s?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n?.(e))}:void 0,className:t(`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium leading-none`,a.className,s&&`cursor-pointer hover:brightness-125 focus:outline-none focus:ring-1 focus:ring-current`,i),children:[(0,Z.jsx)(o,{className:`h-2.5 w-2.5 shrink-0`}),!r&&(0,Z.jsx)(`span`,{children:a.label})]})}function $(e,t){let n=e.keep;return n&&(n.until===void 0||n.until>t)?n:void 0}function Te(e){return`Kept ${e.until?`until ${new Date(e.until).toLocaleString()}`:`until cleared`}${e.reason?` — ${e.reason}`:``}. Excluded from idle digests and automatic cleanup.`}function Ee({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=$(e,t);return r?(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":`true`,title:`${Te(r)} Click to release.`,className:`mt-1 inline-flex h-5 items-center gap-1 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-1.5 text-[10px] font-medium text-tone-sky-fg hover:bg-tone-sky/15`,onClick:t=>{t.stopPropagation(),n(e,!1)},children:[(0,Z.jsx)(I,{className:`h-3 w-3`}),`Kept`]}):null}function De({agent:e,now:t}){let n=o(e=>e.setAgentKeep),r=!!$(e,t);return(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,"aria-pressed":r,title:r?`Release keep`:`Keep — exclude from idle digests and automatic cleanup`,onClick:()=>void n(e,!r),children:r?(0,Z.jsx)(F,{className:`w-3 h-3`}):(0,Z.jsx)(I,{className:`w-3 h-3`})})}function Oe({agent:e}){let t=o(e=>e.users.length>1),n=o(t=>e.principalUserId?t.usersById[e.principalUserId]:void 0);if(!t||!e.principalUserId)return null;let r=n?.displayName||n?.handle||e.principalUserId;return(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1 text-[10px] text-muted-foreground`,"data-testid":`agent-principal`,title:`Works for ${r}`,children:[(0,Z.jsx)(Y,{user:n,address:`user:${e.principalUserId}`,distinct:!0,className:`size-3.5 rounded text-[8px]`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`for `,r]})]})}function ke(e,t){return e.agent===t.agent&&e.parentAgent===t.parentAgent&&i(e.childAgents??[],t.childAgents??[])}var Ae=(0,X.memo)(function({agent:e,childAgents:t=[],parentAgent:n}){let r=a();o(e=>e.set);let i=o(e=>e.switchView),c=o(e=>e.openInboxThread),l=o(e=>e.openAgentDetail),y=o(e=>e.openPairInvite),T=o(e=>e.openRename),E=o(e=>e.openConfirm),D=o(e=>e.doAgentAction),O=o(e=>e.doDeleteAgent),k=o(e=>e.openFilesForAgent),A=o(e=>e.workspaceAction),j=o(e=>e.openWorkspaceFocus),{terminalOpen:M,terminalTarget:N,terminalOpening:F,openTerminal:I,closeTerminal:L}=Se(e.id),R=ge(),B=d(r,e,he(e),R[e.id]||null),V=g(e,`shutdown`),W=g(e,`compact`),G=g(e,`clearContext`),K=!!(e.providerCapabilities?.terminal?.live?.read||e.providerCapabilities?.terminal?.attach?.create),q=_(e,K),Y=m(e),X=n?p(n):e.spawnedBy,Q=t.length>0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xe,{className:`group hover:border-tone-neutral transition-colors cursor-pointer`,onClick:()=>l(e),children:(0,Z.jsxs)(be,{className:`p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-2.5`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-0.5`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,Z.jsx)(ye,{profile:ve(e),className:`text-sm shrink-0`}),(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:p(e)})]}),(0,Z.jsx)(`div`,{className:`text-xs mt-0.5 ${h(B.tone)}`,children:B.label}),typeof e.meta?.cwd==`string`&&e.meta.cwd&&(0,Z.jsx)(`button`,{type:`button`,className:`mt-0.5 block max-w-full truncate font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:`Open ${e.meta.cwd} in Files`,onClick:t=>{t.stopPropagation(),k(e)},children:u(e.meta.cwd)}),e.landState&&(0,Z.jsxs)(`div`,{className:`mt-1 text-[10px] text-tone-violet-fg`,children:[e.landState,e.landWaitReason?` · ${e.landWaitReason}`:``]}),(0,Z.jsx)(ce,{agent:e,className:`mt-1`}),(0,Z.jsx)(Ee,{agent:e,now:r}),(0,Z.jsx)(Oe,{agent:e})]}),e.branchState&&e.branchWorkspaceId&&(0,Z.jsx)(we,{state:e.branchState,className:`mt-0.5 shrink-0`,onClick:t=>{t.stopPropagation(),j(e.branchWorkspaceId)}})]}),B.badges.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:B.badges.map(e=>(0,Z.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${e.className}`,children:e.label},e.label))}),(Q||e.spawnedBy&&X)&&(0,Z.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,onClick:e=>e.stopPropagation(),children:[Q&&(0,Z.jsxs)(w,{children:[(0,Z.jsx)(b,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border border-tone-sky/30 bg-tone-sky/10 px-2 text-[10px] font-medium text-tone-sky-fg transition-colors hover:bg-tone-sky/15`,title:`${t.length} live child ${t.length===1?`agent`:`agents`}`,children:[(0,Z.jsx)(fe,{className:`h-3 w-3`}),(0,Z.jsx)(`span`,{children:t.length}),(0,Z.jsx)(`span`,{className:`flex -space-x-1`,children:t.slice(0,4).map(e=>(0,Z.jsx)(J,{agent:e,now:r,className:`h-2 w-2 ring-1 ring-background`},e.id))})]})}),(0,Z.jsxs)(S,{align:`start`,className:`w-80`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(C,{children:(0,Z.jsx)(x,{children:`Team`})}),(0,Z.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,Z.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(J,{agent:e,now:r,className:`mt-1`}),(0,Z.jsx)(z,{agent:e}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate text-xs font-medium`,children:p(e)}),(0,Z.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.providerCapabilities?.model?.alias||e.providerCapabilities?.model?.id||e.providerCapabilities?.model?.provider||e.status})]}),(0,Z.jsx)(U,{variant:`outline`,className:`h-4 px-1.5 text-[9px]`,children:e.status})]}),(0,Z.jsxs)(`div`,{className:`mt-2 flex gap-1`,children:[(0,Z.jsx)(H,{size:`xs`,variant:`outline`,onClick:()=>l(e),children:`Open`}),(0,Z.jsxs)(H,{size:`xs`,variant:`ghost`,onClick:()=>{c(e.id),i(`chat`)},children:[(0,Z.jsx)(P,{className:`h-3 w-3`}),`Chat`]})]})]},e.id))})]})]}),e.spawnedBy&&X&&(0,Z.jsx)(U,{variant:`outline`,className:`max-w-full text-[10px] text-muted-foreground`,children:(0,Z.jsxs)(`span`,{className:`truncate`,children:[`spawned by `,(0,Z.jsx)(me,{agent:n,fallback:e.spawnedBy})]})})]}),(0,Z.jsx)(Ce,{agent:e}),(e.tags.length>0||v(e.capabilities).length>0)&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:[e.tags.slice(0,3).map(e=>(0,Z.jsx)(U,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e)),v(e.capabilities).slice(0,2).map(e=>(0,Z.jsx)(U,{variant:`secondary`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))]}),(0,Z.jsxs)(`div`,{className:`space-y-2 mb-2`,children:[(0,Z.jsx)(ne,{agent:e}),(0,Z.jsx)(ee,{agent:e,compact:!0}),(0,Z.jsx)(re,{agent:e})]}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:!s(e.id)&&e.id!==`system`&&f(r,e.lastSeen)}),(0,Z.jsxs)(`div`,{className:`flex gap-1 mt-2.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(pe,{value:e.id,label:`Copy agent ID`,size:`icon`,className:`h-7 w-7`,iconClassName:`w-3 h-3`}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Chat`,onClick:()=>{c(e.id),i(`chat`)},children:(0,Z.jsx)(P,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Pair`,onClick:()=>y(e.id),children:(0,Z.jsx)(ae,{className:`w-3 h-3`})}),(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Rename`,onClick:()=>T(e),children:(0,Z.jsx)(se,{className:`w-3 h-3`})}),K&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Terminal`,disabled:F,onClick:()=>void I(),children:(0,Z.jsx)(ue,{className:`w-3 h-3`})}),(e.branchState===`changes`||e.branchState===`idle`)&&e.branchWorkspaceId&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-warning-fg hover:text-tone-warning-fg`,title:`Mark workspace ready — hand off to the auto-merge`,onClick:()=>E(`Mark Workspace Ready`,`Mark ${p(e)}'s branch ready to land? The relay auto-merge will rebase and land it.`,()=>A(e.branchWorkspaceId,`ready`)),children:(0,Z.jsx)(ie,{className:`w-3 h-3`})}),e.kind!==`user`&&e.id!==`system`&&(0,Z.jsx)(De,{agent:e,now:r}),W&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Compact`,onClick:()=>E(`Compact Agent`,`Compact context for ${p(e)}?`,()=>D(e,`compact`,`agents-grid`)),children:(0,Z.jsx)(oe,{className:`w-3 h-3`})}),G&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Clear Context`,onClick:()=>E(`Clear Context`,`Clear context for ${p(e)}?`,()=>D(e,`clearContext`,`agents-grid`)),children:(0,Z.jsx)(te,{className:`w-3 h-3`})}),V&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Shutdown`,onClick:()=>E(`Shutdown Agent`,`Shutdown ${p(e)}?`,()=>D(e,`shutdown`,`agents-grid`)),children:(0,Z.jsx)(le,{className:`w-3 h-3`})}),Y&&(0,Z.jsx)(H,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-tone-danger-fg hover:text-tone-danger-fg`,title:`Forget stale agent`,onClick:()=>E(`Forget Agent`,`Forget ${p(e)}?`,()=>O(e.id)),children:(0,Z.jsx)(de,{className:`w-3 h-3`})})]})]})}),N&&(0,Z.jsx)(_e,{open:M,onOpenChange:L,orchestratorId:N.orchestratorId,session:N.session,interactive:N.interactive||q,canWrite:q,onSessionChanged:()=>void I()})]})},ke);function je(){let e=o(e=>e.agentPresetFilter),t=o(e=>e.agentStatusFilter),n=o(e=>e.agentTagFilter),r=o(e=>e.agentHostFilter),i=o(e=>e.agentSort),s=o(e=>e.agentSortDir),u=o(e=>e.showOffline),d=o(e=>e.setShowOffline),f=W(),p=o(e=>e.set),m=o(e=>e.openAgentSpawn),h=o(e=>e.agentsById),g=a(),_=G(),v=q(),y=K(),b=O(_,g),x=D(_,g),S=e||t||n||r;function C(){p({agentPresetFilter:``,agentStatusFilter:``,agentTagFilter:``,agentHostFilter:``})}function w(){p({agentSortDir:s===`asc`?`desc`:`asc`})}return(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`select`,{value:e,onChange:e=>p({agentPresetFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`All agents`}),(0,Z.jsx)(`option`,{value:`active`,children:`Active`}),l().map(e=>(0,Z.jsx)(`option`,{value:e,children:c(e)},e)),(0,Z.jsx)(`option`,{value:`paired`,children:`Paired`}),(0,Z.jsx)(`option`,{value:`unpaired`,children:`Unpaired`}),(0,Z.jsx)(`option`,{value:`offline_stale`,children:`Offline / Stale`})]}),(0,Z.jsxs)(`select`,{value:t,onChange:e=>p({agentStatusFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any status`}),(0,Z.jsx)(`option`,{value:`online`,children:`Online`}),(0,Z.jsx)(`option`,{value:`idle`,children:`Idle`}),(0,Z.jsx)(`option`,{value:`busy`,children:`Busy`}),(0,Z.jsx)(`option`,{value:`offline`,children:`Offline`}),(0,Z.jsx)(`option`,{value:`starting`,children:`Starting`})]}),v.length>0&&(0,Z.jsxs)(`select`,{value:n,onChange:e=>p({agentTagFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any tag`}),v.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),y.length>1&&(0,Z.jsxs)(`select`,{value:r,onChange:e=>p({agentHostFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:``,children:`Any host`}),y.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsxs)(`select`,{value:i,onChange:e=>p({agentSort:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,Z.jsx)(`option`,{value:`status`,children:`Sort: Status`}),(0,Z.jsx)(`option`,{value:`name`,children:`Sort: Name`}),(0,Z.jsx)(`option`,{value:`lastSeen`,children:`Sort: Last seen`}),(0,Z.jsx)(`option`,{value:`created`,children:`Sort: Created`})]}),(0,Z.jsx)(H,{size:`icon`,variant:`outline`,className:`h-8 w-8`,title:`Toggle sort direction`,onClick:w,children:s===`asc`?(0,Z.jsx)(E,{className:`w-3.5 h-3.5`}):(0,Z.jsx)(A,{className:`w-3.5 h-3.5`})}),(0,Z.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer select-none`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked),className:`rounded`}),`Show offline`,f>0?` (${f})`:``]}),S&&(0,Z.jsxs)(H,{size:`sm`,variant:`ghost`,className:`h-8 text-muted-foreground hover:text-foreground gap-1`,onClick:C,children:[(0,Z.jsx)(V,{className:`w-3 h-3`}),`Clear filters`]}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsxs)(H,{size:`sm`,onClick:m,className:`gap-1`,children:[(0,Z.jsx)(L,{className:`w-3.5 h-3.5`}),`Spawn`]})})]}),x.length===0?(0,Z.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:`No agents match the current filters.`}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3`,children:x.map(e=>(0,Z.jsx)(Ae,{agent:e,parentAgent:e.spawnedBy?h[e.spawnedBy]??null:null,childAgents:k(b.get(e.id)??[])},e.id))})]})}export{je as AgentsView};
|
|
2
|
+
//# sourceMappingURL=agents-BPzY7IlQ.js.map
|