local-operator-ui 0.46.2 → 0.46.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/out/main/index.js +216 -8
- package/out/renderer/assets/{_basePickBy-DRfj0nMs.js → _basePickBy-2VAMpEMo.js} +1 -1
- package/out/renderer/assets/{_baseUniq-_66zsZEt.js → _baseUniq-D2OgfD57.js} +1 -1
- package/out/renderer/assets/{agent-details-page-BHNSL3ah.js → agent-details-page-BE0Eywy0.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-BZQXuZfR.js → agent-hub-page-B2nahc5i.js} +1 -1
- package/out/renderer/assets/agents-page-QTvYjHqD.js +14 -0
- package/out/renderer/assets/{approvalsOverlay-DCoEhZQ9.js → approvalsOverlay-CbhP-8G2.js} +1 -1
- package/out/renderer/assets/{arc-BXfBwNqW.js → arc-CIhgQwCO.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-ChF6YQN8.js → architectureDiagram-IEHRJDOE-KSnYF6ar.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-Dx86_dfW.js → blockDiagram-JOT3LUYC-Bdcjhm_b.js} +1 -1
- package/out/renderer/assets/{book-open-KA0S3bsq.js → book-open-kiV9WBO2.js} +1 -1
- package/out/renderer/assets/browser-page-COdwEp7k.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-D_Jq5XpE.js → browser-webauthn-prompt-CV0Z5rTF.js} +1 -1
- package/out/renderer/assets/{building-2-28qEBngA.js → building-2-Bvx8v_1I.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-efMMgoVM.js → c4Diagram-VJAJSXHY-szZkD43r.js} +1 -1
- package/out/renderer/assets/channel-BTHuvCce.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-B-6vtvTz.js → chunk-4BMEZGHF-BRWGrX9N.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-D2tqnzB0.js → chunk-A2AXSNBT-B0j_5FM7.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-h6Wtx2p3.js → chunk-AEK57VVT-DpYuMMvI.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-wSNXJiq9.js → chunk-D6G4REZN-CEQFcyc2.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-D4_t9t1x.js → chunk-RZ5BOZE2-CFY0Oxw1.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-B8JVDCJh.js → chunk-XZIHB7SX-CgJZN1aD.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-B2PHFxpc.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-B2PHFxpc.js +1 -0
- package/out/renderer/assets/clone-DrGU-HSJ.js +1 -0
- package/out/renderer/assets/{console-mirror-BRY8oE4K.js → console-mirror-DfhNBriI.js} +1 -1
- package/out/renderer/assets/{consoleCapture-B26psDi1.js → consoleCapture-BZJy2OFK.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-B43QzK-n.js → conversation-input-sync-B0Mq-tKd.js} +5 -5
- package/out/renderer/assets/{dagre-OKDRZEBW-Cavj0RaJ.js → dagre-OKDRZEBW-zRwS64cR.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-svyEwxLR.js → diagram-SSKATNLV-BOcLk_oH.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-D1szj8BO.js → diagram-VNBRO52H-DkCWJjPr.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-CMn1BA_s.js → erDiagram-Q7BY3M3F-BLBvPIYe.js} +1 -1
- package/out/renderer/assets/{error-boundary-Ddujf9jK.js → error-boundary-Bz2Pk9pw.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-DgdJYGTZ.js → flowDiagram-4HSFHLVR-jKiXQ27T.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-BVjTSdjH.js → ganttDiagram-APWFNJXF-dbbKFiit.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-C8vZN_4k.js → gitGraphDiagram-7IBYFJ6S-rcjfC4iz.js} +1 -1
- package/out/renderer/assets/{graph-CSB82Wjd.js → graph-Dk-DB8SJ.js} +1 -1
- package/out/renderer/assets/{hash-CXletPCe.js → hash-BbpSmhjK.js} +1 -1
- package/out/renderer/assets/{heart-ChqhVcC1.js → heart-6uX5W0rm.js} +1 -1
- package/out/renderer/assets/index-B71X_Kxp.css +1 -0
- package/out/renderer/assets/{index-Il-cKDVk.js → index-B9Y_yNHL.js} +1 -1
- package/out/renderer/assets/{index-CccvxpxI.js → index-BXEsKMjO.js} +1 -1
- package/out/renderer/assets/{index-CuuaNMEg.js → index-DasG9wWz.js} +1 -1
- package/out/renderer/assets/{index-CJecPbzP.js → index-TheJFnyy.js} +206 -206
- package/out/renderer/assets/infoDiagram-PH2N3AL5-ZphutEES.js +2 -0
- package/out/renderer/assets/{installer-DRgLGcFq.js → installer-CmFCXNM9.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-9GtPf7zz.js → journeyDiagram-U35MCT3I-u--ZVjZj.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-N4tsmcBW.js → kanban-definition-NDS4AKOZ-DqFOSYbb.js} +1 -1
- package/out/renderer/assets/{layout-UxHKWbiY.js → layout-ppJHPzb5.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-0ZCLAr7P.js → legacy-agents-page-DPMbCQFf.js} +1 -1
- package/out/renderer/assets/{library-page-DQmGWxFa.js → library-page-ZV5C8-64.js} +3 -3
- package/out/renderer/assets/{mermaid.core-DTB7E8bD.js → mermaid.core-DIOsgGJD.js} +5 -5
- package/out/renderer/assets/{mesh-page-DP4g7a0_.js → mesh-page-CnSYWYKv.js} +1 -1
- package/out/renderer/assets/{messages-L4id_Ryc.js → messages-t0PiFhDs.js} +8 -8
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BOs9kE5s.js → mindmap-definition-ALO5MXBD-B-Fvzmvg.js} +1 -1
- package/out/renderer/assets/{mini-Dis9Zg2y.js → mini-C9o_TJ_Q.js} +1 -1
- package/out/renderer/assets/{notebook-pen-C97D4Lb8.js → notebook-pen-u33-WHsR.js} +1 -1
- package/out/renderer/assets/{notifications-page-ZpHMSLuT.js → notifications-page-C02v7-l9.js} +1 -1
- package/out/renderer/assets/{org-access-C8SmcBoM.js → org-access-BPVKafW3.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-P5Ccl5Db.js → org-surface-gate-02nRE3pm.js} +1 -1
- package/out/renderer/assets/{page-header-Dozu6EMr.js → page-header-Cvhkxa0E.js} +1 -1
- package/out/renderer/assets/{path-utils-iOrDaMni.js → path-utils-DGh24yEj.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-Dp4lOC8w.js → pieDiagram-IB7DONF6-B-gje72L.js} +1 -1
- package/out/renderer/assets/{project-markdown-4piBJLBp.js → project-markdown-DSgXKItF.js} +1 -1
- package/out/renderer/assets/{projects-page-BNrrxQKd.js → projects-page-CE47tbAV.js} +1 -1
- package/out/renderer/assets/{publication-validation-fzv0GPNg.js → publication-validation-BKMCHfo5.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-DHSWrmWe.js → quadrantDiagram-7GDLP6J5-DWkvugsh.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-C3Sk-j7T.js → radar-MK3ICKWK-oPPp3jMp.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-DR-PzmA2.js → radient-auth-buttons-T3Y6krrT.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-DWK-NTdV.js → requirementDiagram-KVF5MWMF-CRpxME4f.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-CHF12Qn9.js → sankeyDiagram-QLVOVGJD-Do8H4oUH.js} +1 -1
- package/out/renderer/assets/{schedules-page-Cejq3oxe.js → schedules-page-S53qXHE1.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-gzXAv6CR.js → sequenceDiagram-X6HHIX6F-eyfh_Cy-.js} +1 -1
- package/out/renderer/assets/{settings-page-C2wIopns.js → settings-page-DcHKSQu_.js} +1 -1
- package/out/renderer/assets/{smartart-DyN93A-y.js → smartart-C9r5oCW_.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-CLXAEwra.js → stateDiagram-DGXRK772-Cv2aAshk.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CpFVnwLX.js +1 -0
- package/out/renderer/assets/{team-bridge-page-CEu3-avn.js → team-bridge-page-CSNJn90C.js} +1 -1
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-DwtUlWh4.js → timeline-definition-BDJGKUSR-C2VNAqkv.js} +1 -1
- package/out/renderer/assets/{use-default-on-banner-B_1V5kjv.js → use-default-on-banner-C-oPKEE5.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-CALWx-Q2.js → use-download-agent-mutation-DXp2AbvB.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-vIClawM8.js → use-session-snapshot-DF5pok5c.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-DAZMV-19.js → xychartDiagram-VJFVF3MP-4DxcTL_i.js} +1 -1
- package/out/renderer/browser-approvals-overlay.html +2 -2
- package/out/renderer/console-capture.html +6 -6
- package/out/renderer/index.html +8 -8
- package/out/renderer/installer.html +5 -5
- package/out/renderer/mini.html +8 -8
- package/package.json +2 -2
- package/out/renderer/assets/agents-page-DkNXjymR.js +0 -14
- package/out/renderer/assets/browser-page-BGKTEL-Y.js +0 -1
- package/out/renderer/assets/channel-B39qZeT9.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D2KR8UHd.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D2KR8UHd.js +0 -1
- package/out/renderer/assets/clone-DcCCUUL_.js +0 -1
- package/out/renderer/assets/index-CTLf-QEl.css +0 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-BTctONIN.js +0 -2
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Di8DZG5E.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-operator-ui",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.3",
|
|
4
4
|
"productName": "Local Operator",
|
|
5
5
|
"description": "User interface for AI agent assistants that run Python code safely on your device through an intuitive chat interface. Supports local and cloud LLM models with built-in security features.",
|
|
6
6
|
"main": "./out/main/index.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"test:window-guards": "node scripts/window-guards-electron.test.mjs",
|
|
91
91
|
"test:window-glass": "node --test scripts/window-glass-cdp.test.mjs",
|
|
92
92
|
"test:tag-dialogs": "node scripts/run-desktop-tests.mjs scripts/chat-tag-dialogs-immediate.test.mjs",
|
|
93
|
-
"test:desktop": "node scripts/run-desktop-tests.mjs scripts/about-panel.test.mjs scripts/agent-class-toggle.test.mjs scripts/agent-hub-org-sharing.test.mjs scripts/agent-hub-public-teams.test.mjs scripts/agent-hub-queries.test.mjs scripts/agent-hub-skills-tab-count.test.mjs scripts/agent-hub-teams-tab-count.test.mjs scripts/agent-messages-busy.test.mjs scripts/agent-messages-dialog.test.mjs scripts/agent-messages-model.test.mjs scripts/agent-messages-settings.test.mjs scripts/agent-shell-spawn-env.test.mjs scripts/agents-composer-mount.test.mjs scripts/agents-config-probe-cadence.test.mjs scripts/agents-config-retry.test.mjs scripts/agents-config-summary.test.mjs scripts/agents-offer-dismiss.test.mjs scripts/agents-publication.test.mjs scripts/agents-source-and-recency-locale.test.mjs scripts/aida-rail-marks.test.mjs scripts/aida-sidebar.test.mjs scripts/analytics-channels.test.mjs scripts/analytics-rate-format.test.mjs scripts/analytics-session-table.test.mjs scripts/application-menu-labels.test.mjs scripts/approval-escape.test.mjs scripts/approvals-card-document.test.mjs scripts/approvals-overlay.test.mjs scripts/ask-composer-no-routing.test.mjs scripts/ask-dismiss-panel.test.mjs scripts/ask-dismiss.test.mjs scripts/ask-draft-swap.test.mjs scripts/ask-open-policy.test.mjs scripts/ask-open-render.test.mjs scripts/ask-options.test.mjs scripts/ask-other.test.mjs scripts/ask-queue.test.mjs scripts/ask-revise.test.mjs scripts/asks-app-regression.test.mjs scripts/at-mentions.test.mjs scripts/attachment-files.test.mjs scripts/attachment-live-row.test.mjs scripts/attachment-url.test.mjs scripts/attention-seen.test.mjs scripts/audio-engine.test.mjs scripts/audio-meter-stream.test.mjs scripts/audio-recording-levels.test.mjs scripts/authoring-refresh.test.mjs scripts/backend-error-surfaces.test.mjs scripts/backend-setting-combos.test.mjs scripts/backend-settings-collapse.test.mjs scripts/backend-settings-drafts.test.mjs scripts/backend-settings-tiers.test.mjs scripts/backend-spawn-address.test.mjs scripts/backend-version-drift.test.mjs scripts/browser-address-autocomplete.test.mjs scripts/browser-address-history.test.mjs scripts/browser-address-overlay.test.mjs scripts/browser-address-raises.test.mjs scripts/browser-approvals-dock-width.test.mjs scripts/browser-approvals-route.test.mjs scripts/browser-challenge-proof-passkey-servers.test.mjs scripts/browser-chord-renderer.test.mjs scripts/browser-chord.test.mjs scripts/browser-chrome-gaps.test.mjs scripts/browser-chrome-s4b-probe-rig.test.mjs scripts/browser-chrome.test.mjs scripts/browser-file-transfer-row.test.mjs scripts/browser-find-row.test.mjs scripts/browser-history-store.test.mjs scripts/browser-host.test.mjs scripts/browser-network-capture.test.mjs scripts/browser-page-controls.test.mjs scripts/browser-page-menu-focus.test.mjs scripts/browser-page-menu.test.mjs scripts/browser-queue-expiry.test.mjs scripts/browser-site-trigger.test.mjs scripts/browser-start-page.test.mjs scripts/browser-startup.test.mjs scripts/browser-tab-management.test.mjs scripts/browser-tab-actions-menu.test.mjs scripts/browser-tab-strip-focus.test.mjs scripts/browser-toolbar.test.mjs scripts/browser-url-autocomplete.test.mjs scripts/browser-view-policy-kinds.test.mjs scripts/btw-aside.test.mjs scripts/build-env-guard.test.mjs scripts/bundled-runtime-layout.test.mjs scripts/canonical-chat.test.mjs scripts/canonical-notice.test.mjs scripts/canvas-file-freshness.test.mjs scripts/canvas-goals.test.mjs scripts/canvas-tab-close.test.mjs scripts/capture-evidence.test.mjs scripts/chat-archive-press.test.mjs scripts/chat-archived.test.mjs scripts/chat-device-guidance.test.mjs scripts/chat-device-model.test.mjs scripts/chat-device-placement.test.mjs scripts/chat-image-expand.test.mjs scripts/chat-keyboard-regions.test.mjs scripts/chat-link-affordances.test.mjs scripts/chat-list-sections.test.mjs scripts/chat-pane-floors.test.mjs scripts/chat-remote.test.mjs scripts/chat-search.test.mjs scripts/chat-session-copy-id.test.mjs scripts/chat-session-status.test.mjs scripts/chat-session-subagents.test.mjs scripts/chat-sidebar-agents.test.mjs scripts/chat-sidebar-archive.test.mjs scripts/chat-sidebar-connection-voices.test.mjs scripts/chat-sidebar-drafts.test.mjs scripts/chat-sidebar-hover-intent.test.mjs scripts/chat-sidebar-layout.test.mjs scripts/chat-sidebar-pins.test.mjs scripts/chat-sidebar-row-menu.test.mjs scripts/chat-sidebar-scope-paging.test.mjs scripts/chat-sidebar-sections.test.mjs scripts/chat-sidebar-selection.test.mjs scripts/chat-sidebar-tags.test.mjs scripts/chat-sidebar-time-order.test.mjs scripts/chat-sidebar-view.test.mjs scripts/chat-status-strip.test.mjs scripts/chat-title.test.mjs scripts/check-build-env.test.mjs scripts/check-design-kit.test.mjs scripts/check-evidence-structure.test.mjs scripts/check-geometry-sources.test.mjs scripts/check-runtime-deps.test.mjs scripts/check-vendored.test.mjs scripts/checkpoint-model.test.mjs scripts/checkpoint-rail.test.mjs scripts/child-reader-foot-react.test.mjs scripts/child-transcript-paging.test.mjs scripts/chrome-keychain.test.mjs scripts/ci-log-guard.test.mjs scripts/ci-scope.test.mjs scripts/clear-search.test.mjs scripts/click-proof-expect.test.mjs scripts/code-review-delayed-flag.test.mjs scripts/code-review-model.test.mjs scripts/code-review-refresh-cue.test.mjs scripts/code-review-row-layout.test.mjs scripts/collapse-plan-per-pass.test.mjs scripts/compact-receipt.test.mjs scripts/completion-view-ack.test.mjs scripts/composer-file-drop.test.mjs scripts/composer-queued-send.test.mjs scripts/composer-readings.test.mjs scripts/composer-refusal.test.mjs scripts/composer-seeding.test.mjs scripts/composer-send-failure.test.mjs scripts/composer-suggestions.test.mjs scripts/composer-tabs.test.mjs scripts/composer-text-authority.test.mjs scripts/composer-tip-react.test.mjs scripts/condense-parity.test.mjs scripts/conflict-markers.test.mjs scripts/connectivity-banner-copy.test.mjs scripts/connectivity-banner-notice.test.mjs scripts/console-close.test.mjs scripts/console-host.test.mjs scripts/console-i18n-fit.test.mjs scripts/console-mirror.test.mjs scripts/console-pack.test.mjs scripts/console-pane-render.test.mjs scripts/console-pane.test.mjs scripts/context-readout-monotonic.test.mjs scripts/copy-button-copy-locale.test.mjs scripts/credential-capture.test.mjs scripts/credential-composer.test.mjs scripts/cross-session-visibility.test.mjs scripts/currency-math.test.mjs scripts/daemon-discovery.test.mjs scripts/daemon-health-state.test.mjs scripts/daemon-observation.test.mjs scripts/default-effort-options.test.mjs scripts/default-on-banner.test.mjs scripts/delivery-gate.test.mjs scripts/desktop-contract.test.mjs scripts/desktop-feed.test.mjs scripts/desktop-notifier.test.mjs scripts/desktop-proxy.test.mjs scripts/desktop-renderer-transport.test.mjs scripts/desktop-stream.test.mjs scripts/desktop-test-concurrency.test.mjs scripts/desktop-test-lane-bound.test.mjs scripts/desktop-test-memory-guard.test.mjs scripts/desktop-test-shards.test.mjs scripts/desktop-watch-lease.test.mjs scripts/dev-driver-attach.test.mjs scripts/dev-driver-gate.test.mjs scripts/dev-shortcuts.test.mjs scripts/directory-listing.test.mjs scripts/document-direction.test.mjs scripts/draft-selection.test.mjs scripts/draft-slash-identity.test.mjs scripts/draft-splash.test.mjs scripts/drafts-clear-on-send.test.mjs scripts/echo-delivery.test.mjs scripts/evidence-fold.test.mjs scripts/evidence-histogram-parity.test.mjs scripts/evidence-manifest.test.mjs scripts/evidence-run-guard.test.mjs scripts/evidence-sign-in-states.test.mjs scripts/evidence-tz.test.mjs scripts/external-open-refusal.test.mjs scripts/file-blob-url.test.mjs scripts/finder-files.test.mjs scripts/finder-reveal-scroll.test.mjs scripts/fleet-asks.test.mjs scripts/fold-open.test.mjs scripts/frontend-replace.test.mjs scripts/header-identity-menu.test.mjs scripts/header-identity-model.test.mjs scripts/held-claim-reach.test.mjs scripts/hold-escape-claim.test.mjs scripts/hotkey-registration.test.mjs scripts/hub-link-copy.test.mjs scripts/hub-link-view.test.mjs scripts/hub-links-scene.test.mjs scripts/hub-mutation-safety.test.mjs scripts/hub-skill-alias.test.mjs scripts/hub-skill-state.test.mjs scripts/hub-skills-capability.test.mjs scripts/hub-updates.test.mjs scripts/i18n-wave-b-keyed-copy.test.mjs scripts/i18n/absent-locale.test.mjs scripts/i18n/activation.test.mjs scripts/i18n/canvas-picker-review-remediation.test.mjs scripts/i18n/check-added-strings.test.mjs scripts/i18n/check-coverage.test.mjs scripts/i18n/check-strings.test.mjs scripts/i18n/context-parity.test.mjs scripts/i18n/es-activation.test.mjs scripts/i18n/format.test.mjs scripts/i18n/hi-activation.test.mjs scripts/i18n/ledger-assemble.test.mjs scripts/i18n/ledger-check.test.mjs scripts/i18n/locale-parity.test.mjs scripts/i18n/locale-reactivity.test.mjs scripts/i18n/ru-activation.test.mjs scripts/i18n/runtime.test.mjs scripts/i18n/surface-copy-reactivity.test.mjs scripts/i18n/table-pager-range.test.mjs scripts/i18n/typed-keys.test.mjs scripts/i18n/config-kind-word.test.mjs scripts/i18n/ur-activation.test.mjs scripts/i18n/vi-activation.test.mjs scripts/i18n/zh-CN-activation.test.mjs scripts/icon-identity.test.mjs scripts/image-actions.test.mjs scripts/image-gen-card.test.mjs scripts/image-preview-decode.test.mjs scripts/import-settings-section.test.mjs scripts/import-settings-view.test.mjs scripts/install-builtin-batch.test.mjs scripts/install-progress.test.mjs scripts/install-scripts-network.test.mjs scripts/integration-model.test.mjs scripts/interrupt-control.test.mjs scripts/interrupt-slot-hold-react.test.mjs scripts/job-cancel-panel.test.mjs scripts/job-controls.test.mjs scripts/journal-order-query.test.mjs scripts/keyboard-shortcuts-section.test.mjs scripts/keymap-chords.test.mjs scripts/keymap-dispatch.test.mjs scripts/keymap-persistence.test.mjs scripts/keymap-registry.test.mjs scripts/keymap-retention.test.mjs scripts/lane-leading.test.mjs scripts/lane-registration.test.mjs scripts/language-dialog.test.mjs scripts/language-live-updates.test.mjs scripts/launch-session.test.mjs scripts/launcher-watch.test.mjs scripts/library-card.test.mjs scripts/library-markdown.test.mjs scripts/library-model.test.mjs scripts/library-page.test.mjs scripts/library-pptx.test.mjs scripts/link-actions.test.mjs scripts/link-targets.test.mjs scripts/linux-sandbox.test.mjs scripts/live-seed-placement.test.mjs scripts/live-update-integrity.test.mjs scripts/loader-state-machine.test.mjs scripts/locale-direction.test.mjs scripts/logger-log-dir.test.mjs scripts/main-locale.test.mjs scripts/managed-python-transaction.test.mjs scripts/managed-python.test.mjs scripts/mark-all-read-control.test.mjs scripts/markdown-remend.test.mjs scripts/markdown-table-widths.test.mjs scripts/mcp-auth-complete-no-retry.test.mjs scripts/mcp-auth-surface.test.mjs scripts/mcp-catalog-parity.test.mjs scripts/mcp-catalog-transport.test.mjs scripts/mcp-failure-routing.test.mjs scripts/mcp-foreign-config-origin.test.mjs scripts/mcp-list-query.test.mjs scripts/mcp-target-resolution.test.mjs scripts/media-surface-floors.test.mjs scripts/mentioned-files.test.mjs scripts/merge-update-feed.test.mjs scripts/mesh-canvas-bench.test.mjs scripts/mesh-tab.test.mjs scripts/message-actions.test.mjs scripts/message-quote.test.mjs scripts/message-surface-floors.test.mjs scripts/mini-view-contract.test.mjs scripts/mini-view-dictation.test.mjs scripts/model-select-store.test.mjs scripts/model-setting-options.test.mjs scripts/monitor-cancel-dialog.test.mjs scripts/monitor-controls.test.mjs scripts/move-session.test.mjs scripts/navigation-gesture.test.mjs scripts/new-chat-row-evidence.test.mjs scripts/new-chat-row.test.mjs scripts/new-chat-shortcut.test.mjs scripts/no-hardlink-write.test.mjs scripts/no-websocket-plane.test.mjs scripts/notification-launch.test.mjs scripts/notification-lifetime.test.mjs scripts/notification-spawn-sites.test.mjs scripts/notifications-model.test.mjs scripts/notifications-off.test.mjs scripts/notifications-operations.test.mjs scripts/notifications-page-pill.test.mjs scripts/notifications-reel-observer.test.mjs scripts/older-history-slot.test.mjs scripts/onboarding-default-model.test.mjs scripts/onboarding-i18n-contract.test.mjs scripts/onboarding-search-step.test.mjs scripts/onboarding-step-block.test.mjs scripts/org-team-date-locale.test.mjs scripts/org-teams-summary.test.mjs scripts/overlay-drag-zones.test.mjs scripts/owned-serve-lifecycle.test.mjs scripts/pairing-card-copy.test.mjs scripts/palette-contract.test.mjs scripts/palette-focus.test.mjs scripts/palette-main-door.test.mjs scripts/palette-panel-request.test.mjs scripts/palette-recents.test.mjs scripts/palette-search.test.mjs scripts/palette-shortcut.test.mjs scripts/pane-slot-ground.test.mjs scripts/panel-chart-hover.test.mjs scripts/panel-chart-motion.test.mjs scripts/panel-info-credentials.test.mjs scripts/panel-info-fleet.test.mjs scripts/panel-info-session-age.test.mjs scripts/panel-presentation.test.mjs scripts/panel-rail.test.mjs scripts/panel-read-policy.test.mjs scripts/panel-top-inset.test.mjs scripts/passkey-notice.test.mjs scripts/path-utils.test.mjs scripts/peer-journal-source.test.mjs scripts/peer-source-unified.test.mjs scripts/peers-catalogue.test.mjs scripts/phone-access-block.test.mjs scripts/picker-default-checkbox.test.mjs scripts/picker-feedback.test.mjs scripts/picker-host-selection.test.mjs scripts/pre-push-gate.test.mjs scripts/preload-updater-surface.test.mjs scripts/preview-signed-urls.test.mjs scripts/project-update-assets.test.mjs scripts/project-view-perf.test.mjs scripts/projects-board-focus.test.mjs scripts/projects-card-click.test.mjs scripts/projects-entry-scroll.test.mjs scripts/projects-filters.test.mjs scripts/projects-force-done.test.mjs scripts/projects-i18n-locale.test.mjs scripts/projects-inline-edit.test.mjs scripts/projects-quick-send.test.mjs scripts/projects-request-update.test.mjs scripts/projects-search-index.test.mjs scripts/projects-search.test.mjs scripts/projects-sheet.test.mjs scripts/projects-sort.test.mjs scripts/projects-tab.test.mjs scripts/projects-time-window.test.mjs scripts/provider-catalog.test.mjs scripts/provider-chip-verdict.test.mjs scripts/provider-detail-remount.test.mjs scripts/provider-error-guidance.test.mjs scripts/provider-grid-error-copy.test.mjs scripts/provider-grid-pin.test.mjs scripts/provider-sign-in-flow.test.mjs scripts/provider-state.test.mjs scripts/provider-status.test.mjs scripts/prune-bundled-resources.test.mjs scripts/prune-python-seed.test.mjs scripts/ptt-keymap-binding.test.mjs scripts/python-bytecode-cache.test.mjs scripts/quota-notice.test.mjs scripts/radient-credits-guidance.test.mjs scripts/radient-session-issue.test.mjs scripts/radient-signout-authority.test.mjs scripts/radient-verify-callout.test.mjs scripts/receipt-fold-behaviour.test.mjs scripts/reconnect-page-gap.test.mjs scripts/relaunch-during-quit-proof.test.mjs scripts/reload-picker-close.test.mjs scripts/render-mac-entitlements.test.mjs scripts/renderer-driver-api.test.mjs scripts/resolve-package-union.test.mjs scripts/response-copy.test.mjs scripts/retention-duration.test.mjs scripts/reveal-record.test.mjs scripts/right-slot-memory.test.mjs scripts/right-slot-width.test.mjs scripts/row-state-floors.test.mjs scripts/rtl-layout.test.mjs scripts/run-child-reader.test.mjs scripts/run-desktop-tests.test.mjs scripts/run-detail-model.test.mjs scripts/run-detail-wake-label-locale.test.mjs scripts/run-panel-navigation.test.mjs scripts/scheduled-task-model.test.mjs scripts/scroll-region-to-top.test.mjs scripts/scrollbar-activity.test.mjs scripts/searchable-select.test.mjs scripts/secret-ask.test.mjs scripts/seed-label-gap.test.mjs scripts/seed-placement.test.mjs scripts/server-release-notes.test.mjs scripts/session-archive-delete.test.mjs scripts/session-asks.test.mjs scripts/session-cookies.test.mjs scripts/session-files-hook.test.mjs scripts/session-load-recovery.test.mjs scripts/session-load-sequence.test.mjs scripts/session-status-feed.test.mjs scripts/session-status-lifecycle.test.mjs scripts/session-status.test.mjs scripts/session-stream-token.test.mjs scripts/session-switch.test.mjs scripts/session-switcher.test.mjs scripts/settings-account-gate.test.mjs scripts/settings-language-row.test.mjs scripts/settings-section-routes.test.mjs scripts/settings-time-to-error.test.mjs scripts/shared-composer.test.mjs scripts/shell-path.test.mjs scripts/sidebar-account-reconnect.test.mjs scripts/sidebar-catalogue-gate.test.mjs scripts/sidebar-attention-badge.test.mjs scripts/sidebar-destinations.test.mjs scripts/sidebar-focus-hold.test.mjs scripts/sidebar-own-avatar.test.mjs scripts/sidebar-pin-order.test.mjs scripts/sidebar-split.test.mjs scripts/sidebar-tag-auto.test.mjs scripts/sidebar-tag-drag.test.mjs scripts/sidebar-tag-picker.test.mjs scripts/skill-highlight.test.mjs scripts/skill-invocation.test.mjs scripts/skill-list.test.mjs scripts/skill-row.test.mjs scripts/skill-seal-behaviour.test.mjs scripts/skills-tab.test.mjs scripts/slash-contract.test.mjs scripts/slash-highlight.test.mjs scripts/slash-rank.test.mjs scripts/slash-row-format.test.mjs scripts/slash-submit.test.mjs scripts/slash-tags-popup.test.mjs scripts/slash-tags-reopen.test.mjs scripts/slash-tags.test.mjs scripts/slash-token.test.mjs scripts/soft-breaks.test.mjs scripts/sound-player.test.mjs scripts/sounds-fixture.test.mjs scripts/speech-clip.test.mjs scripts/speech-controls.test.mjs scripts/speech-selection.test.mjs scripts/speech-settings.test.mjs scripts/speech-store.test.mjs scripts/speech-target.test.mjs scripts/speech-user-copy.test.mjs scripts/spend-payment-basis.test.mjs scripts/stale-agent.test.mjs scripts/stale-caption.test.mjs scripts/stopped-row-measure.test.mjs scripts/storybook-query-fixture.test.mjs scripts/stream-order-live.test.mjs scripts/streaming-live-markdown.test.mjs scripts/streaming-markdown-parity.test.mjs scripts/stt-mic-gate-session.test.mjs scripts/subagent-pulse.test.mjs scripts/submit-latency.test.mjs scripts/suggestion-stack-react.test.mjs scripts/suggestion-stack.test.mjs scripts/supplement-collage.test.mjs scripts/supplement-disclosure.test.mjs scripts/supplement-file-actions.test.mjs scripts/supplement-image-grid.test.mjs scripts/supplement-model.test.mjs scripts/supplement-row.test.mjs scripts/team-bridge-archive-container.test.mjs scripts/team-bridge-archive.test.mjs scripts/team-bridge-arrival.test.mjs scripts/team-bridge-attachments.test.mjs scripts/team-bridge-auth-owner-mount.test.mjs scripts/team-bridge-avatar.test.mjs scripts/team-bridge-banner.test.mjs scripts/team-bridge-channels.test.mjs scripts/team-bridge-composer-ring.test.mjs scripts/team-bridge-directory.test.mjs scripts/team-bridge-drafts-scheduled.test.mjs scripts/team-bridge-invitations.test.mjs scripts/team-bridge-model.test.mjs scripts/team-bridge-notifications-mount.test.mjs scripts/team-bridge-notify.test.mjs scripts/team-bridge-rail-profile-card.test.mjs scripts/team-bridge-reactions-behaviour.test.mjs scripts/team-bridge-reactions.test.mjs scripts/team-bridge-row-layout-pin.test.mjs scripts/team-bridge-scope.test.mjs scripts/team-bridge-thread-gate.test.mjs scripts/team-bridge-threads.test.mjs scripts/team-initials.test.mjs scripts/team-member-overrides.test.mjs scripts/team-new-chat-stale-draft.test.mjs scripts/telemetry-launch.test.mjs scripts/telemetry-spawn-sites.test.mjs scripts/test-inventory.test.mjs scripts/theme-grid-navigation.test.mjs scripts/theme-inline.test.mjs scripts/theme-registry-exhaustiveness.test.mjs scripts/thread-search-contract.test.mjs scripts/thread-search-model.test.mjs scripts/thread-search-overlay.test.mjs scripts/titlebar-options.test.mjs scripts/toast-close-placement.test.mjs scripts/toast-lifetime.test.mjs scripts/tool-compose-lifecycle.test.mjs scripts/tool-row.test.mjs scripts/tooltip-browser-view.test.mjs scripts/trace-fold-behaviour.test.mjs scripts/trace-fold-model.test.mjs scripts/transcript-copy-affordances.test.mjs scripts/transcript-cursor-continuity.test.mjs scripts/transcript-deep-jump.test.mjs scripts/transcript-dom-window-hook.test.mjs scripts/transcript-dom-window.test.mjs scripts/transcript-fade.test.mjs scripts/transcript-focus-behaviour.test.mjs scripts/transcript-focus.test.mjs scripts/transcript-foot-slot.test.mjs scripts/transcript-journal-order.test.mjs scripts/transcript-loader.test.mjs scripts/transcript-paging-hook.test.mjs scripts/transcript-paging.test.mjs scripts/transcript-perflush-perf.test.mjs scripts/transcript-rail-refusal.test.mjs scripts/transcript-reducer.test.mjs scripts/transcript-strand-hold.test.mjs scripts/transcription-failure-copy.test.mjs scripts/transcription-transient-retry.test.mjs scripts/turn-answer-rail.test.mjs scripts/turn-collapse-behaviour.test.mjs scripts/turn-collapse-model.test.mjs scripts/turn-partition-predicate.test.mjs scripts/turn-segments.test.mjs scripts/turn-timestamp.test.mjs scripts/typed-row-call-sites.test.mjs scripts/undo-toasts.test.mjs scripts/update-affirmation.test.mjs scripts/update-fleet-drain.test.mjs scripts/update-global-guard.test.mjs scripts/update-global-install.test.mjs scripts/update-indicator-segments.test.mjs scripts/update-install-copy.test.mjs scripts/update-panel-copy.test.mjs scripts/update-robustness.test.mjs scripts/update-rollover.test.mjs scripts/update-shipit.test.mjs scripts/update-window-report.test.mjs scripts/usage-container.test.mjs scripts/usage-view.test.mjs scripts/use-active-checkpoint.test.mjs scripts/use-checkpoints.test.mjs scripts/use-ever-in-view.test.mjs scripts/use-thread-search.test.mjs scripts/verify-bundled-uv.test.mjs scripts/verify-macos-artifacts.test.mjs scripts/viewer-record.test.mjs scripts/wake-cancel-panel.test.mjs scripts/wake-controls.test.mjs scripts/warm-session.test.mjs scripts/waveform-model.test.mjs scripts/webauthn.test.mjs scripts/window-chrome.test.mjs scripts/window-glass-main.test.mjs scripts/window-glass-renderer.test.mjs scripts/window-glass.test.mjs scripts/window-guards.test.mjs scripts/window-mode.test.mjs scripts/working-line-clock.test.mjs scripts/i18n/catalogue-locale.test.mjs scripts/i18n/device-tag-activation.test.mjs scripts/language-dialog-applies-on-pick.test.mjs scripts/i18n/chat-header-sidebar-copy.test.mjs scripts/agents-remaining-literals.test.mjs scripts/user-attachments.test.mjs scripts/user-attachments-render.test.mjs scripts/browser-address-overlay-list-child.test.mjs scripts/storybook-cache-prune.test.mjs scripts/with-storybook.test.mjs scripts/hub-check-now-body.test.mjs scripts/hub-incoming-review.test.mjs scripts/hub-incoming-preview.test.mjs",
|
|
93
|
+
"test:desktop": "node scripts/run-desktop-tests.mjs scripts/about-panel.test.mjs scripts/agent-class-toggle.test.mjs scripts/agent-hub-org-sharing.test.mjs scripts/agent-hub-public-teams.test.mjs scripts/agent-hub-queries.test.mjs scripts/agent-hub-skills-tab-count.test.mjs scripts/agent-hub-teams-tab-count.test.mjs scripts/agent-messages-busy.test.mjs scripts/agent-messages-dialog.test.mjs scripts/agent-messages-model.test.mjs scripts/agent-messages-settings.test.mjs scripts/agent-shell-spawn-env.test.mjs scripts/agents-composer-mount.test.mjs scripts/agents-config-probe-cadence.test.mjs scripts/agents-config-retry.test.mjs scripts/agents-config-summary.test.mjs scripts/agents-offer-dismiss.test.mjs scripts/agents-publication.test.mjs scripts/agents-source-and-recency-locale.test.mjs scripts/aida-rail-marks.test.mjs scripts/aida-sidebar.test.mjs scripts/analytics-channels.test.mjs scripts/analytics-rate-format.test.mjs scripts/analytics-session-table.test.mjs scripts/application-menu-labels.test.mjs scripts/approval-escape.test.mjs scripts/approvals-card-document.test.mjs scripts/approvals-overlay.test.mjs scripts/ask-composer-no-routing.test.mjs scripts/ask-dismiss-panel.test.mjs scripts/ask-dismiss.test.mjs scripts/ask-draft-swap.test.mjs scripts/ask-open-policy.test.mjs scripts/ask-open-render.test.mjs scripts/ask-options.test.mjs scripts/ask-other.test.mjs scripts/ask-queue.test.mjs scripts/ask-revise.test.mjs scripts/asks-app-regression.test.mjs scripts/at-mentions.test.mjs scripts/attachment-files.test.mjs scripts/attachment-live-row.test.mjs scripts/attachment-url.test.mjs scripts/attention-seen.test.mjs scripts/audio-engine.test.mjs scripts/audio-meter-stream.test.mjs scripts/audio-recording-levels.test.mjs scripts/authoring-refresh.test.mjs scripts/backend-error-surfaces.test.mjs scripts/backend-setting-combos.test.mjs scripts/backend-settings-collapse.test.mjs scripts/backend-settings-drafts.test.mjs scripts/backend-settings-tiers.test.mjs scripts/backend-spawn-address.test.mjs scripts/backend-version-drift.test.mjs scripts/browser-address-autocomplete.test.mjs scripts/browser-address-history.test.mjs scripts/browser-address-overlay.test.mjs scripts/browser-address-raises.test.mjs scripts/browser-approvals-dock-width.test.mjs scripts/browser-approvals-route.test.mjs scripts/browser-challenge-proof-passkey-servers.test.mjs scripts/browser-chord-renderer.test.mjs scripts/browser-chord.test.mjs scripts/browser-chrome-gaps.test.mjs scripts/browser-chrome-s4b-probe-rig.test.mjs scripts/browser-chrome.test.mjs scripts/browser-file-transfer-row.test.mjs scripts/browser-find-row.test.mjs scripts/browser-history-store.test.mjs scripts/browser-host.test.mjs scripts/browser-network-capture.test.mjs scripts/browser-page-controls.test.mjs scripts/browser-page-menu-focus.test.mjs scripts/browser-page-menu.test.mjs scripts/browser-queue-expiry.test.mjs scripts/browser-site-trigger.test.mjs scripts/browser-start-page.test.mjs scripts/browser-startup.test.mjs scripts/browser-tab-management.test.mjs scripts/browser-tab-actions-menu.test.mjs scripts/browser-tab-strip-focus.test.mjs scripts/browser-toolbar.test.mjs scripts/browser-url-autocomplete.test.mjs scripts/browser-view-policy-kinds.test.mjs scripts/btw-aside.test.mjs scripts/build-env-guard.test.mjs scripts/bundled-runtime-layout.test.mjs scripts/canonical-chat.test.mjs scripts/canonical-notice.test.mjs scripts/canvas-file-freshness.test.mjs scripts/canvas-goals.test.mjs scripts/canvas-tab-close.test.mjs scripts/capture-evidence.test.mjs scripts/chat-archive-press.test.mjs scripts/chat-archived.test.mjs scripts/chat-device-guidance.test.mjs scripts/chat-device-model.test.mjs scripts/chat-device-placement.test.mjs scripts/chat-image-expand.test.mjs scripts/chat-keyboard-regions.test.mjs scripts/chat-link-affordances.test.mjs scripts/chat-list-sections.test.mjs scripts/chat-pane-floors.test.mjs scripts/chat-remote.test.mjs scripts/chat-search.test.mjs scripts/chat-session-copy-id.test.mjs scripts/chat-session-status.test.mjs scripts/chat-session-subagents.test.mjs scripts/chat-sidebar-agents.test.mjs scripts/chat-sidebar-archive.test.mjs scripts/chat-sidebar-connection-voices.test.mjs scripts/chat-sidebar-drafts.test.mjs scripts/chat-sidebar-hover-intent.test.mjs scripts/chat-sidebar-layout.test.mjs scripts/chat-sidebar-pins.test.mjs scripts/chat-sidebar-row-menu.test.mjs scripts/chat-sidebar-scope-paging.test.mjs scripts/chat-sidebar-sections.test.mjs scripts/chat-sidebar-selection.test.mjs scripts/chat-sidebar-tags.test.mjs scripts/chat-sidebar-time-order.test.mjs scripts/chat-sidebar-view.test.mjs scripts/chat-status-strip.test.mjs scripts/chat-title.test.mjs scripts/check-build-env.test.mjs scripts/check-design-kit.test.mjs scripts/check-evidence-structure.test.mjs scripts/check-geometry-sources.test.mjs scripts/check-runtime-deps.test.mjs scripts/check-vendored.test.mjs scripts/checkpoint-model.test.mjs scripts/checkpoint-rail.test.mjs scripts/child-reader-foot-react.test.mjs scripts/child-transcript-paging.test.mjs scripts/chrome-keychain.test.mjs scripts/ci-log-guard.test.mjs scripts/ci-scope.test.mjs scripts/clear-search.test.mjs scripts/click-proof-expect.test.mjs scripts/code-review-delayed-flag.test.mjs scripts/code-review-model.test.mjs scripts/code-review-refresh-cue.test.mjs scripts/code-review-row-layout.test.mjs scripts/collapse-plan-per-pass.test.mjs scripts/compact-receipt.test.mjs scripts/completion-view-ack.test.mjs scripts/composer-file-drop.test.mjs scripts/composer-queued-send.test.mjs scripts/composer-readings.test.mjs scripts/composer-refusal.test.mjs scripts/composer-seeding.test.mjs scripts/composer-send-failure.test.mjs scripts/composer-suggestions.test.mjs scripts/composer-tabs.test.mjs scripts/composer-text-authority.test.mjs scripts/composer-tip-react.test.mjs scripts/condense-parity.test.mjs scripts/conflict-markers.test.mjs scripts/connectivity-banner-copy.test.mjs scripts/connectivity-banner-notice.test.mjs scripts/console-close.test.mjs scripts/console-host.test.mjs scripts/console-i18n-fit.test.mjs scripts/console-mirror.test.mjs scripts/console-pack.test.mjs scripts/console-pane-render.test.mjs scripts/console-pane.test.mjs scripts/context-readout-monotonic.test.mjs scripts/copy-button-copy-locale.test.mjs scripts/credential-capture.test.mjs scripts/credential-composer.test.mjs scripts/cross-session-visibility.test.mjs scripts/currency-math.test.mjs scripts/daemon-discovery.test.mjs scripts/daemon-health-state.test.mjs scripts/daemon-observation.test.mjs scripts/default-effort-options.test.mjs scripts/default-on-banner.test.mjs scripts/delivery-gate.test.mjs scripts/desktop-contract.test.mjs scripts/desktop-feed.test.mjs scripts/desktop-notifier.test.mjs scripts/desktop-proxy.test.mjs scripts/desktop-renderer-transport.test.mjs scripts/desktop-stream.test.mjs scripts/desktop-test-concurrency.test.mjs scripts/desktop-test-lane-bound.test.mjs scripts/desktop-test-memory-guard.test.mjs scripts/desktop-test-shards.test.mjs scripts/desktop-watch-lease.test.mjs scripts/dev-driver-attach.test.mjs scripts/dev-driver-gate.test.mjs scripts/dev-shortcuts.test.mjs scripts/directory-listing.test.mjs scripts/document-direction.test.mjs scripts/draft-selection.test.mjs scripts/draft-slash-identity.test.mjs scripts/draft-splash.test.mjs scripts/drafts-clear-on-send.test.mjs scripts/echo-delivery.test.mjs scripts/evidence-fold.test.mjs scripts/evidence-histogram-parity.test.mjs scripts/evidence-manifest.test.mjs scripts/evidence-run-guard.test.mjs scripts/evidence-sign-in-states.test.mjs scripts/evidence-tz.test.mjs scripts/external-open-refusal.test.mjs scripts/file-blob-url.test.mjs scripts/finder-files.test.mjs scripts/finder-reveal-scroll.test.mjs scripts/fleet-asks.test.mjs scripts/fold-open.test.mjs scripts/frontend-replace.test.mjs scripts/header-identity-menu.test.mjs scripts/header-identity-model.test.mjs scripts/held-claim-reach.test.mjs scripts/hold-escape-claim.test.mjs scripts/hotkey-registration.test.mjs scripts/hub-link-copy.test.mjs scripts/hub-link-view.test.mjs scripts/hub-links-scene.test.mjs scripts/hub-mutation-safety.test.mjs scripts/hub-skill-alias.test.mjs scripts/hub-skill-state.test.mjs scripts/hub-skills-capability.test.mjs scripts/hub-updates.test.mjs scripts/i18n-wave-b-keyed-copy.test.mjs scripts/i18n/absent-locale.test.mjs scripts/i18n/activation.test.mjs scripts/i18n/canvas-picker-review-remediation.test.mjs scripts/i18n/check-added-strings.test.mjs scripts/i18n/check-coverage.test.mjs scripts/i18n/check-strings.test.mjs scripts/i18n/context-parity.test.mjs scripts/i18n/es-activation.test.mjs scripts/i18n/format.test.mjs scripts/i18n/hi-activation.test.mjs scripts/i18n/ledger-assemble.test.mjs scripts/i18n/ledger-check.test.mjs scripts/i18n/locale-parity.test.mjs scripts/i18n/locale-reactivity.test.mjs scripts/i18n/ru-activation.test.mjs scripts/i18n/runtime.test.mjs scripts/i18n/surface-copy-reactivity.test.mjs scripts/i18n/table-pager-range.test.mjs scripts/i18n/typed-keys.test.mjs scripts/i18n/config-kind-word.test.mjs scripts/i18n/ur-activation.test.mjs scripts/i18n/vi-activation.test.mjs scripts/i18n/zh-CN-activation.test.mjs scripts/icon-identity.test.mjs scripts/image-actions.test.mjs scripts/image-gen-card.test.mjs scripts/image-preview-decode.test.mjs scripts/import-settings-section.test.mjs scripts/import-settings-view.test.mjs scripts/install-builtin-batch.test.mjs scripts/install-progress.test.mjs scripts/install-scripts-network.test.mjs scripts/integration-model.test.mjs scripts/interrupt-control.test.mjs scripts/interrupt-slot-hold-react.test.mjs scripts/job-cancel-panel.test.mjs scripts/job-controls.test.mjs scripts/journal-order-query.test.mjs scripts/keyboard-shortcuts-section.test.mjs scripts/keymap-chords.test.mjs scripts/keymap-dispatch.test.mjs scripts/keymap-persistence.test.mjs scripts/keymap-registry.test.mjs scripts/keymap-retention.test.mjs scripts/lane-leading.test.mjs scripts/lane-registration.test.mjs scripts/language-dialog.test.mjs scripts/language-live-updates.test.mjs scripts/launch-session.test.mjs scripts/launcher-watch.test.mjs scripts/library-card.test.mjs scripts/library-markdown.test.mjs scripts/library-model.test.mjs scripts/library-page.test.mjs scripts/library-pptx.test.mjs scripts/link-actions.test.mjs scripts/link-targets.test.mjs scripts/linux-sandbox.test.mjs scripts/live-seed-placement.test.mjs scripts/live-update-integrity.test.mjs scripts/loader-state-machine.test.mjs scripts/locale-direction.test.mjs scripts/logger-log-dir.test.mjs scripts/main-locale.test.mjs scripts/managed-python-transaction.test.mjs scripts/managed-python.test.mjs scripts/mark-all-read-control.test.mjs scripts/markdown-remend.test.mjs scripts/markdown-table-widths.test.mjs scripts/mcp-auth-complete-no-retry.test.mjs scripts/mcp-auth-surface.test.mjs scripts/mcp-catalog-parity.test.mjs scripts/mcp-catalog-transport.test.mjs scripts/mcp-failure-routing.test.mjs scripts/mcp-foreign-config-origin.test.mjs scripts/mcp-list-query.test.mjs scripts/mcp-target-resolution.test.mjs scripts/media-surface-floors.test.mjs scripts/mentioned-files.test.mjs scripts/merge-update-feed.test.mjs scripts/mesh-canvas-bench.test.mjs scripts/mesh-tab.test.mjs scripts/message-actions.test.mjs scripts/message-quote.test.mjs scripts/message-surface-floors.test.mjs scripts/mini-view-contract.test.mjs scripts/mini-view-dictation.test.mjs scripts/model-select-store.test.mjs scripts/model-setting-options.test.mjs scripts/monitor-cancel-dialog.test.mjs scripts/monitor-controls.test.mjs scripts/move-session.test.mjs scripts/navigation-gesture.test.mjs scripts/new-chat-row-evidence.test.mjs scripts/new-chat-row.test.mjs scripts/new-chat-shortcut.test.mjs scripts/no-hardlink-write.test.mjs scripts/no-websocket-plane.test.mjs scripts/notification-launch.test.mjs scripts/notification-lifetime.test.mjs scripts/notification-spawn-sites.test.mjs scripts/notifications-model.test.mjs scripts/notifications-off.test.mjs scripts/notifications-operations.test.mjs scripts/notifications-page-pill.test.mjs scripts/notifications-reel-observer.test.mjs scripts/older-history-slot.test.mjs scripts/onboarding-default-model.test.mjs scripts/onboarding-i18n-contract.test.mjs scripts/onboarding-search-step.test.mjs scripts/onboarding-step-block.test.mjs scripts/org-team-date-locale.test.mjs scripts/org-teams-summary.test.mjs scripts/overlay-drag-zones.test.mjs scripts/owned-serve-lifecycle.test.mjs scripts/pairing-card-copy.test.mjs scripts/palette-contract.test.mjs scripts/palette-focus.test.mjs scripts/palette-main-door.test.mjs scripts/palette-panel-request.test.mjs scripts/palette-recents.test.mjs scripts/palette-search.test.mjs scripts/palette-shortcut.test.mjs scripts/pane-slot-ground.test.mjs scripts/panel-chart-hover.test.mjs scripts/panel-chart-motion.test.mjs scripts/panel-info-credentials.test.mjs scripts/panel-info-fleet.test.mjs scripts/panel-info-session-age.test.mjs scripts/panel-presentation.test.mjs scripts/panel-rail.test.mjs scripts/panel-read-policy.test.mjs scripts/panel-top-inset.test.mjs scripts/passkey-notice.test.mjs scripts/path-utils.test.mjs scripts/peer-journal-source.test.mjs scripts/peer-source-unified.test.mjs scripts/peers-catalogue.test.mjs scripts/phone-access-block.test.mjs scripts/picker-default-checkbox.test.mjs scripts/picker-feedback.test.mjs scripts/picker-host-selection.test.mjs scripts/pre-push-gate.test.mjs scripts/preload-updater-surface.test.mjs scripts/preview-signed-urls.test.mjs scripts/project-update-assets.test.mjs scripts/project-view-perf.test.mjs scripts/projects-board-focus.test.mjs scripts/projects-card-click.test.mjs scripts/projects-entry-scroll.test.mjs scripts/projects-filters.test.mjs scripts/projects-force-done.test.mjs scripts/projects-i18n-locale.test.mjs scripts/projects-inline-edit.test.mjs scripts/projects-quick-send.test.mjs scripts/projects-request-update.test.mjs scripts/projects-search-index.test.mjs scripts/projects-search.test.mjs scripts/projects-sheet.test.mjs scripts/projects-sort.test.mjs scripts/projects-tab.test.mjs scripts/projects-time-window.test.mjs scripts/provider-catalog.test.mjs scripts/provider-chip-verdict.test.mjs scripts/provider-detail-remount.test.mjs scripts/provider-error-guidance.test.mjs scripts/provider-grid-error-copy.test.mjs scripts/provider-grid-pin.test.mjs scripts/provider-sign-in-flow.test.mjs scripts/provider-state.test.mjs scripts/provider-status.test.mjs scripts/prune-bundled-resources.test.mjs scripts/prune-python-seed.test.mjs scripts/ptt-keymap-binding.test.mjs scripts/python-bytecode-cache.test.mjs scripts/quota-notice.test.mjs scripts/radient-credits-guidance.test.mjs scripts/radient-session-issue.test.mjs scripts/radient-signout-authority.test.mjs scripts/radient-verify-callout.test.mjs scripts/receipt-fold-behaviour.test.mjs scripts/reconnect-page-gap.test.mjs scripts/relaunch-during-quit-proof.test.mjs scripts/reload-picker-close.test.mjs scripts/render-mac-entitlements.test.mjs scripts/renderer-driver-api.test.mjs scripts/resolve-package-union.test.mjs scripts/response-copy.test.mjs scripts/retention-duration.test.mjs scripts/reveal-record.test.mjs scripts/right-slot-memory.test.mjs scripts/right-slot-width.test.mjs scripts/row-state-floors.test.mjs scripts/rtl-layout.test.mjs scripts/run-child-reader.test.mjs scripts/run-desktop-tests.test.mjs scripts/run-detail-model.test.mjs scripts/run-detail-wake-label-locale.test.mjs scripts/run-panel-navigation.test.mjs scripts/scheduled-task-model.test.mjs scripts/scroll-region-to-top.test.mjs scripts/scrollbar-activity.test.mjs scripts/searchable-select.test.mjs scripts/secret-ask.test.mjs scripts/seed-label-gap.test.mjs scripts/seed-placement.test.mjs scripts/server-release-notes.test.mjs scripts/session-archive-delete.test.mjs scripts/session-asks.test.mjs scripts/session-cookies.test.mjs scripts/session-files-hook.test.mjs scripts/session-load-recovery.test.mjs scripts/session-load-sequence.test.mjs scripts/session-status-feed.test.mjs scripts/session-status-lifecycle.test.mjs scripts/session-status.test.mjs scripts/session-stream-token.test.mjs scripts/session-switch.test.mjs scripts/session-switcher.test.mjs scripts/settings-account-gate.test.mjs scripts/settings-language-row.test.mjs scripts/settings-section-routes.test.mjs scripts/settings-time-to-error.test.mjs scripts/shared-composer.test.mjs scripts/shell-path.test.mjs scripts/sidebar-account-reconnect.test.mjs scripts/sidebar-catalogue-gate.test.mjs scripts/sidebar-attention-badge.test.mjs scripts/sidebar-destinations.test.mjs scripts/sidebar-focus-hold.test.mjs scripts/sidebar-own-avatar.test.mjs scripts/sidebar-pin-order.test.mjs scripts/sidebar-split.test.mjs scripts/sidebar-tag-auto.test.mjs scripts/sidebar-tag-drag.test.mjs scripts/sidebar-tag-picker.test.mjs scripts/skill-highlight.test.mjs scripts/skill-invocation.test.mjs scripts/skill-list.test.mjs scripts/skill-row.test.mjs scripts/skill-seal-behaviour.test.mjs scripts/skills-tab.test.mjs scripts/slash-contract.test.mjs scripts/slash-highlight.test.mjs scripts/slash-rank.test.mjs scripts/slash-row-format.test.mjs scripts/slash-submit.test.mjs scripts/slash-tags-popup.test.mjs scripts/slash-tags-reopen.test.mjs scripts/slash-tags.test.mjs scripts/slash-token.test.mjs scripts/soft-breaks.test.mjs scripts/sound-player.test.mjs scripts/sounds-fixture.test.mjs scripts/speech-clip.test.mjs scripts/speech-controls.test.mjs scripts/speech-selection.test.mjs scripts/speech-settings.test.mjs scripts/speech-store.test.mjs scripts/speech-target.test.mjs scripts/speech-user-copy.test.mjs scripts/spend-payment-basis.test.mjs scripts/stale-agent.test.mjs scripts/stale-caption.test.mjs scripts/stopped-row-measure.test.mjs scripts/storybook-query-fixture.test.mjs scripts/stream-order-live.test.mjs scripts/streaming-live-markdown.test.mjs scripts/streaming-markdown-parity.test.mjs scripts/stt-mic-gate-session.test.mjs scripts/subagent-pulse.test.mjs scripts/submit-latency.test.mjs scripts/suggestion-stack-react.test.mjs scripts/suggestion-stack.test.mjs scripts/supplement-collage.test.mjs scripts/supplement-disclosure.test.mjs scripts/supplement-file-actions.test.mjs scripts/supplement-image-grid.test.mjs scripts/supplement-model.test.mjs scripts/supplement-row.test.mjs scripts/team-bridge-archive-container.test.mjs scripts/team-bridge-archive.test.mjs scripts/team-bridge-arrival.test.mjs scripts/team-bridge-attachments.test.mjs scripts/team-bridge-auth-owner-mount.test.mjs scripts/team-bridge-avatar.test.mjs scripts/team-bridge-banner.test.mjs scripts/team-bridge-channels.test.mjs scripts/team-bridge-composer-ring.test.mjs scripts/team-bridge-directory.test.mjs scripts/team-bridge-drafts-scheduled.test.mjs scripts/team-bridge-invitations.test.mjs scripts/team-bridge-model.test.mjs scripts/team-bridge-notifications-mount.test.mjs scripts/team-bridge-notify.test.mjs scripts/team-bridge-rail-profile-card.test.mjs scripts/team-bridge-reactions-behaviour.test.mjs scripts/team-bridge-reactions.test.mjs scripts/team-bridge-row-layout-pin.test.mjs scripts/team-bridge-scope.test.mjs scripts/team-bridge-thread-gate.test.mjs scripts/team-bridge-threads.test.mjs scripts/team-initials.test.mjs scripts/team-member-overrides.test.mjs scripts/team-new-chat-stale-draft.test.mjs scripts/telemetry-launch.test.mjs scripts/telemetry-spawn-sites.test.mjs scripts/test-inventory.test.mjs scripts/theme-grid-navigation.test.mjs scripts/theme-inline.test.mjs scripts/theme-registry-exhaustiveness.test.mjs scripts/thread-search-contract.test.mjs scripts/thread-search-model.test.mjs scripts/thread-search-overlay.test.mjs scripts/titlebar-options.test.mjs scripts/toast-close-placement.test.mjs scripts/toast-lifetime.test.mjs scripts/tool-compose-lifecycle.test.mjs scripts/tool-row.test.mjs scripts/tooltip-browser-view.test.mjs scripts/trace-fold-behaviour.test.mjs scripts/trace-fold-model.test.mjs scripts/transcript-copy-affordances.test.mjs scripts/transcript-cursor-continuity.test.mjs scripts/transcript-deep-jump.test.mjs scripts/transcript-dom-window-hook.test.mjs scripts/transcript-dom-window.test.mjs scripts/transcript-fade.test.mjs scripts/transcript-focus-behaviour.test.mjs scripts/transcript-focus.test.mjs scripts/transcript-foot-slot.test.mjs scripts/transcript-journal-order.test.mjs scripts/transcript-loader.test.mjs scripts/transcript-paging-hook.test.mjs scripts/transcript-paging.test.mjs scripts/transcript-perflush-perf.test.mjs scripts/transcript-rail-refusal.test.mjs scripts/transcript-reducer.test.mjs scripts/transcript-strand-hold.test.mjs scripts/transcription-failure-copy.test.mjs scripts/transcription-transient-retry.test.mjs scripts/turn-answer-rail.test.mjs scripts/turn-collapse-behaviour.test.mjs scripts/turn-collapse-model.test.mjs scripts/turn-partition-predicate.test.mjs scripts/turn-segments.test.mjs scripts/turn-timestamp.test.mjs scripts/typed-row-call-sites.test.mjs scripts/undo-toasts.test.mjs scripts/update-affirmation.test.mjs scripts/update-fleet-drain.test.mjs scripts/update-global-guard.test.mjs scripts/update-global-install.test.mjs scripts/update-indicator-segments.test.mjs scripts/update-install-copy.test.mjs scripts/update-panel-copy.test.mjs scripts/update-robustness.test.mjs scripts/update-rollover.test.mjs scripts/update-shipit.test.mjs scripts/update-window-report.test.mjs scripts/usage-container.test.mjs scripts/usage-view.test.mjs scripts/use-active-checkpoint.test.mjs scripts/use-checkpoints.test.mjs scripts/use-ever-in-view.test.mjs scripts/use-thread-search.test.mjs scripts/verify-bundled-uv.test.mjs scripts/verify-macos-artifacts.test.mjs scripts/viewer-record.test.mjs scripts/wake-cancel-panel.test.mjs scripts/wake-controls.test.mjs scripts/warm-session.test.mjs scripts/waveform-model.test.mjs scripts/webauthn.test.mjs scripts/window-chrome.test.mjs scripts/window-glass-main.test.mjs scripts/window-glass-renderer.test.mjs scripts/window-glass.test.mjs scripts/window-guards.test.mjs scripts/window-mode.test.mjs scripts/working-line-clock.test.mjs scripts/i18n/catalogue-locale.test.mjs scripts/i18n/device-tag-activation.test.mjs scripts/language-dialog-applies-on-pick.test.mjs scripts/i18n/chat-header-sidebar-copy.test.mjs scripts/agents-remaining-literals.test.mjs scripts/user-attachments.test.mjs scripts/user-attachments-render.test.mjs scripts/browser-address-overlay-list-child.test.mjs scripts/storybook-cache-prune.test.mjs scripts/with-storybook.test.mjs scripts/hub-check-now-body.test.mjs scripts/hub-incoming-review.test.mjs scripts/hub-incoming-preview.test.mjs scripts/hub-link-policy-popover.test.mjs",
|
|
94
94
|
"check-evidence": "node scripts/check-evidence.mjs",
|
|
95
95
|
"check-evidence:parity": "node scripts/evidence-histogram-parity.mjs",
|
|
96
96
|
"check-edit-diffs": "node scripts/check-edit-diffs.mjs",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./legacy-agents-page-0ZCLAr7P.js","./index-CccvxpxI.js","./messages-L4id_Ryc.js","./index-CTLf-QEl.css","./page-header-Dozu6EMr.js","./error-boundary-Ddujf9jK.js","./index-CJecPbzP.js","./path-utils-iOrDaMni.js","./conversation-input-sync-B43QzK-n.js","./conversation-input-sync-Dp97JwKx.css","./console-mirror-BRY8oE4K.js","./console-mirror-DOrYoP_4.css","./index-DHKnfVbX.css","./notebook-pen-C97D4Lb8.js","./org-access-C8SmcBoM.js","./org-surface-gate-P5Ccl5Db.js","./radient-auth-buttons-DR-PzmA2.js","./publication-validation-fzv0GPNg.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{bQ as _n,aj as Nn,bR as Qe,bS as $s,bT as Ot,bU as wn,bV as vt,aZ as Ne,aa as Sn,ab as En,ac as Cn,ad as Rn,ba as st,aA as Ds,bh as Ge,W as ct,b9 as Pt,aK as Os,a7 as In,bW as Ln,bX as An,bY as Fn,bZ as Ps,b_ as Tn,b$ as $n,c0 as ss,c1 as Dn,c2 as On,c3 as Pn,bJ as Mn,c4 as Bn}from"./conversation-input-sync-B43QzK-n.js";import{r,j as e,c as G}from"./index-CccvxpxI.js";import{aU as Un,aV as qn,D as zn,aQ as Mt,x as Hn,z as Kn,O as Ms,s as Bs,aW as Wn,aO as ht,aX as Vn,aN as nt,aY as Lt,aZ as Gn,a_ as Yn,a$ as ns,aR as Us,b0 as Jn,Q as Bt,b1 as as,b2 as Qn,b3 as Xe,aM as ut,b4 as qs,b5 as Zn,b6 as Xn,t as ea,A as ta}from"./index-CJecPbzP.js";import{y as dt,q as Ut,a as pt,c as ee,i as xt,a3 as sa,a4 as na,u as bt,a5 as aa,d as le,h as Be,G as mt,r as ia,a6 as la,B as qt,a2 as ra,A as oa}from"./path-utils-iOrDaMni.js";import{c as ca,u as Z,B as I,l as ua,J as da,g as Me,j as ke,A as pe,a as xe,x as je,K as Ue,Q as at,R as it,U as lt,V as rt,W as Ie,Y as kt,Z as gt,D as zs,d as Hs,e as Ks,f as Ws,T as At,o as zt,p as Ht,y as Kt,q as Wt,z as Vt,i as ma,F as Gt,_ as ga,$ as _t,a0 as Nt,a1 as Te,a2 as _e,a3 as wt,a4 as ve,M as fa,N as ha,O as pa}from"./error-boundary-Ddujf9jK.js";import{t as s,a as xa}from"./messages-L4id_Ryc.js";import{k as ba,x as Vs,c as ka,S as Gs,l as ja,n as St,H as ya,p as va,o as _a}from"./org-access-C8SmcBoM.js";import{P as Na}from"./project-markdown-4piBJLBp.js";import"./console-mirror-BRY8oE4K.js";/**
|
|
3
|
-
* @license lucide-react v0.507.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const wa=[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]],Sa=ca("log-in",wa),Ea=[],Ve="config-composer-note",is=()=>s("ui.agents.config.disabled_gate"),Ca=["ui.agents.config.examples.reads_code","ui.agents.config.examples.add_twice","ui.agents.config.examples.team_shipping"],Ra={idle:"bg-ink-dim",running:"bg-accent",stopping:"bg-warning",done:"bg-success",stopped:"bg-ink-muted",error:"bg-danger"};function Ia({status:t,pulse:n}){return e.jsx("span",{"aria-hidden":"true",className:G("size-2 shrink-0 rounded-full",Ra[t]??"bg-ink-dim",n&&"animate-pulse")})}function La({run:t}){return Z(),t.activity.length===0?e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.config.activity.empty")}):e.jsx("ul",{className:"space-y-1",children:t.activity.map((n,a)=>e.jsxs("li",{className:"flex items-baseline gap-2 text-body-sm",children:[e.jsx("span",{className:"text-ink-dim tabular-nums",children:new Date(n.ts).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),e.jsx("span",{className:"text-ink",children:n.verb})]},`${n.ts}:${n.verb}:${a}`))})}const ls="-mr-2",Aa="max-h-[clamp(3.5rem,10vh,5.5rem)]";function Fa(){const t=r.useRef(null),[n,a]=r.useState(!1);return r.useEffect(()=>{const i=t.current;if(!i)return;const l=()=>a(i.scrollHeight>i.clientHeight+1);l();const o=new ResizeObserver(l);return o.observe(i),()=>o.disconnect()}),{ref:t,overflowing:n}}function Ta({children:t}){const{ref:n,overflowing:a}=Fa();return e.jsx("div",{ref:n,tabIndex:a?0:void 0,role:a?"region":void 0,"aria-label":a?s("ui.agents.config.run_details_region"):void 0,"data-lo-region-cue":a?"":void 0,className:G("mb-2 overflow-y-auto empty:hidden",Aa),children:t})}const $a="mb-1 flex min-h-7 items-center gap-3",rs=t=>s("ui.agents.config.definitions",{count:t});function Da({run:t,about:n,skill:a=!1,blockedReason:i,hasDraft:l,onClearAbout:o,onDismiss:u}){Z();const[h,b]=r.useState(!1),d=r.useRef(null),f=t.status==="running"||t.status==="stopping",c=t.enabled&&t.status!=="idle",v=!!i&&l&&!c,p=!!i&&l&&c&&!f,g=r.useRef(null);r.useEffect(()=>{if(t.status!=="error"||!t.turnFailed)return;const E=document.activeElement,x=g.current?.closest('[data-testid="config-composer"]');(!E||E===document.body||x?.contains(E))&&g.current?.focus({preventScroll:!0})},[t.status,t.turnFailed]),r.useEffect(()=>{if(!f)return;const E=x=>{x.key!=="Escape"||x.defaultPrevented||document.querySelector('[role="alertdialog"], [role="dialog"]')||d.current?.focus()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[f]);const j=t.status==="running"?t.step??"Working on your request":t.status==="stopping"?"Stopping":t.status==="done"?t.results.length>0?"Finished":"Finished without changing anything":t.status==="stopped"?"Stopped":t.status==="error"?t.turnFailed?s("ui.agents.config.state.did_not_finish"):t.canRetry?"Stopped with an error":"Finished with an error":"";return e.jsxs("div",{className:Qe,"data-testid":c?"config-run-strip":void 0,children:[e.jsxs("div",{className:$a,children:[c?e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(Ia,{status:t.status,pulse:f}),e.jsxs("span",{"aria-live":"polite",className:"min-w-0 truncate text-body-sm text-ink",children:[j,t.status==="done"&&t.touched.length>0?e.jsxs("span",{className:"sr-only",children:[". ",s("ui.agents.config.result.configured")," ",rs(t.touched.length)]}):null]}),(f||t.status==="stopped"||t.status==="done")&&t.elapsed!=="0s"?e.jsx("span",{className:"shrink-0 text-meta text-ink-muted tabular-nums",children:t.elapsed}):null,t.touched.length>0?e.jsxs("span",{"aria-hidden":t.status==="done"?!0:void 0,className:"shrink-0 text-meta text-ink-muted",children:[e.jsxs("span",{className:"sr-only",children:[s("ui.agents.config.result.configured")," "]}),rs(t.touched.length)]}):null]}):null,t.enabled&&!p?e.jsxs(e.Fragment,{children:[v?null:e.jsx("span",{id:i?void 0:Ve,"data-testid":i?void 0:"config-composer-note",className:c?"sr-only":"min-w-0 flex-1 truncate text-meta text-ink-dim",children:s("ui.agents.config.background_only")}),i?e.jsx("span",{id:Ve,"data-testid":"config-composer-note",className:v?"min-w-0 flex-1 truncate text-meta text-ink-dim":"sr-only",children:i}):null]}):e.jsx("span",{className:"flex-1","aria-hidden":"true"}),e.jsxs("div",{className:"ms-auto flex shrink-0 items-center gap-1",children:[n?e.jsxs(e.Fragment,{children:[e.jsx("span",{"data-testid":"config-composer-about",title:os(n,a),className:"max-w-56 truncate text-meta text-ink-muted",children:os(n,a)}),a?null:e.jsx(I,{variant:"ghost",size:"sm",className:c?void 0:ls,onClick:o,children:s("ui.agents.config.action.clear")})]}):null,c&&t.activity.length>0?e.jsxs(I,{variant:"ghost",size:"sm","aria-expanded":h,onClick:()=>b(E=>!E),children:[h?e.jsx(ua,{className:"size-3.5"}):e.jsx(da,{className:"size-3.5 rtl:-scale-x-100"}),s("ui.agents.config.action.watch")]}):null,c?f?e.jsxs(I,{ref:d,variant:"secondary",size:"sm",disabled:t.status==="stopping",onClick:()=>void t.stop(),children:[e.jsx(wn,{className:"size-3.5"}),t.status==="stopping"?s("ui.agents.config.state.stopping"):s("ui.agents.config.action.stop")]}):e.jsx(I,{variant:"ghost",size:"sm",className:ls,onClick:u,children:s("ui.agents.config.action.dismiss")}):null]})]}),t.enabled?null:e.jsx("p",{id:Ve,"data-testid":"config-composer-note",className:"mb-2 text-meta text-ink-dim",children:t.disabledReason}),p?e.jsx("p",{id:Ve,"data-testid":"config-composer-note",className:"mb-2 text-meta text-ink-muted",children:i}):null,c?e.jsxs(Ta,{children:[t.attached?e.jsx("p",{className:"mt-1 text-meta text-ink-muted",children:s("ui.agents.config.status.attached")}):null,t.stopError?e.jsxs("div",{className:"mt-2 border-danger-border border-t pt-2","data-testid":"config-stop-refused",children:[e.jsx("p",{className:"text-body-sm text-danger",children:s("ui.agents.config.error.stop_refused")}),e.jsx("p",{className:"mt-0.5 text-meta text-ink-muted",children:t.stopError})]}):null,h?e.jsx("div",{className:"mt-2 border-hairline border-t pt-2",children:e.jsx(La,{run:t})}):null,t.status==="stopped"?e.jsxs("div",{className:"mt-2 space-y-1 border-hairline border-t pt-2 text-body-sm",children:[e.jsx("p",{className:"text-ink",children:t.results.length>0?s("ui.agents.config.stopped.kept"):s("ui.agents.config.stopped.nothing")}),t.results.length>0?e.jsx("ul",{className:"space-y-0.5",children:t.results.map(E=>e.jsxs("li",{className:"text-ink-muted",children:[E.created?s("ui.agents.config.result.created"):s("ui.agents.config.result.changed")," ",e.jsx("span",{className:"text-ink",children:E.target.name})]},`${E.target.kind}:${E.target.name}`))}):null]}):null,t.status==="done"?e.jsx(Oa,{run:t,skill:a}):null,t.status==="error"&&t.error?e.jsx("div",{className:"mt-2 border-danger-border border-t pt-2",children:e.jsx("p",{className:"text-body-sm text-danger",children:t.error})}):null]}):null,c&&t.status==="error"&&t.error?e.jsxs("div",{className:"mb-2.5 flex items-center gap-2",children:[t.canRetry?e.jsx(I,{ref:g,variant:"secondary",size:"sm","data-testid":"config-retry",disabled:t.starting,onClick:()=>void t.retry(),children:t.starting?s("ui.agents.config.state.sending"):s("ui.agents.config.action.retry")}):null,e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.config.summary.nothing_else")})]}):null]})}function os(t,n){return n||t.kind==="skill"?s("ui.agents.skills.composer.about",{name:t.name}):s("ui.agents.config.about",{kind:Ys(t),name:t.name})}function Ys(t){switch(t.kind){case"skill":return s("ui.agents.skills.composer.kind");case"team":return s("ui.agents.config.kind.team");case"agent":return s("ui.agents.config.kind.agent")}}function Oa({run:t,skill:n=!1}){return Z(),t.results.length===0?e.jsxs("div",{className:"mt-2 border-hairline border-t pt-2 text-body-sm",children:[e.jsx("p",{className:"text-ink-muted",children:n?s("ui.agents.skills.composer.no_changes"):s("ui.agents.config.summary.no_changes")}),t.answer?e.jsx("p",{className:"mt-1 whitespace-pre-wrap text-ink",children:t.answer}):null,t.topic?e.jsx("p",{className:"mt-1 text-meta text-ink-muted",children:s("ui.agents.config.summary.you_asked",{topic:t.topic})}):null]}):e.jsxs("div",{className:"mt-2 space-y-1 border-hairline border-t pt-2",children:[e.jsx("ul",{className:"space-y-1 text-body-sm",children:t.results.map(a=>e.jsxs("li",{children:[e.jsx("span",{className:"text-ink",children:a.created?s("ui.agents.config.summary.created",{name:a.target.name}):s("ui.agents.config.summary.updated",{name:a.target.name})}),e.jsxs("span",{className:"text-ink-muted",children:[" (",Ys(a.target),")"]}),a.changes.length>0?e.jsxs("span",{className:"text-ink-muted",children:[": ",a.changes.map(i=>i.label).join(", ")]}):a.created?null:e.jsxs("span",{className:"text-ink-muted",children:[": ",a.target.kind==="skill"?s("ui.agents.skills.composer.changed_below"):s("ui.agents.config.summary.hidden_changes")]})]},`${a.target.kind}:${a.target.name}`))}),t.answer?e.jsx("p",{className:"whitespace-pre-wrap text-body-sm text-ink-muted",children:t.answer}):null]})}const qe="agents-config",Js=t=>`Change the ${t.kind} ${t.name}: `;function et(t,n,a){t.setAbout(n);const i=dt.getState();i.getCurrentInput(qe)||i.setComposerText(qe,a)}function Pa(t){const n=dt.getState();n.getCurrentInput(qe).trim()===Js(t).trim()&&n.setComposerText(qe,"")}function Qs({run:t,hero:n=!1,blockedReason:a,about:i,onClearAbout:l,skill:o=!1,focusToken:u=0}){Z();const h=r.useRef(null),b=_n(),d=Ut(C=>C.cwd),f=pt(),c=t.frontend===null&&t.status==="idle"&&d.length>0&&ee(f.data,"draft_preview"),v=xt({...sa({cwd:d,model:null},ee(f.data,"draft_fast")),enabled:c}),p=qe,g=C=>dt.getState().setCurrentInput(p,C),j=t.status==="running"||t.status==="stopping",E=!t.enabled||!!a,x=dt(C=>(C.inputByConversation[qe]?.currentInput??"").trim().length>0),k=a||(j?"Working on your request…":t.enabled?void 0:is()),R=i?o?s("ui.agents.skills.composer.placeholder",{name:i.name}):s("ui.agents.config.placeholder.about",{name:i.name}):t.enabled?n?s("ui.agents.config.placeholder.hero"):s("ui.agents.config.placeholder.docked"):is(),L=i?`${i.kind}:${i.name}`:null;r.useEffect(()=>{!L||o||h.current?.focusInput()},[L,o]),r.useEffect(()=>{u>0&&h.current?.focusInput()},[u]);const P=()=>{t.dismiss(),h.current?.focusInput()},S=()=>{l(),h.current?.focusInput()};return e.jsxs("div",{"data-testid":"config-composer",children:[e.jsx("div",{className:"sr-only",id:"config-composer-label",children:o?s("ui.agents.skills.composer.label"):s("ui.agents.config.composer.label")}),e.jsx(Nn,{ref:h,autoFocus:!(t.status==="error"&&t.turnFailed&&t.canRetry),conversationId:p,messages:Ea,isLoading:!1,transcriptless:!0,placeholderOverride:R,sessionStatus:t.frontend?{frontend:t.frontend,costChannels:ee(f.data,"cost_channels")}:v.data?{frontend:v.data.snapshot,draft:!0,costChannels:ee(f.data,"cost_channels")}:void 0,recordingProbe:b,hostNotice:{id:Ve,blocksInput:!t.enabled||!!a||j,placeholder:k,statedByNode:x,node:e.jsx(Da,{run:t,about:i,skill:o,blockedReason:a,hasDraft:x,onClearAbout:S,onDismiss:P})},onSendMessage:(C,U)=>t.start(C,i,U)}),n&&t.enabled?e.jsx("div",{className:G(Ot,$s),children:e.jsx("div",{className:G(Qe,"mt-2 flex flex-col items-start gap-0.5",!i&&!j?"":"invisible"),children:Ca.map(C=>e.jsx(I,{variant:"ghost",size:"sm",className:"-ml-2 h-auto max-w-full justify-start whitespace-normal break-words px-2 py-1 text-start text-body-sm text-ink-muted hover:bg-elevated hover:text-ink disabled:text-ink-disabled disabled:hover:bg-transparent",disabled:E,onClick:()=>{g(s(C)),h.current?.focusInput()},children:s(C)},C))})}):null]})}const cs=(t,n)=>t.kind===n.kind&&t.name===n.name;function us(t){return`${t.kind}:${t.name}`}const ie=na(t=>({sessionId:null,status:"idle",topic:"",prompt:"",turnFailed:!1,images:[],files:[],about:null,error:null,stopError:null,unsent:!1,startedAt:null,settledAt:null,touched:[],results:[],answer:"",marks:[],before:null,setAbout:n=>t({about:n}),adopt:(n,a,i,l=[],o=[],u=a)=>t({sessionId:n,status:"running",topic:u,prompt:a,turnFailed:!1,images:l,files:o,error:null,stopError:null,startedAt:Date.now(),settledAt:null,touched:[],results:[],answer:"",before:i,unsent:!1}),noteTouched:n=>t(a=>a.touched.some(i=>cs(i,n))?a:{touched:[...a.touched,n]}),stopping:()=>t(n=>n.status==="running"?{status:"stopping",stopError:null}:n),stopFailed:n=>t({status:"running",stopError:n}),settle:(n,a,i)=>t(()=>({status:a,settledAt:Date.now(),results:n,answer:i,marks:n.map(l=>({...l.target,created:l.created})),sessionId:null,images:[],files:[],stopError:null,before:null,unsent:!1})),fail:n=>t({status:"error",error:n,unsent:!1,stopError:null}),failUnsent:n=>t({status:"error",error:n,unsent:!0,stopError:null}),failTurn:n=>t({status:"error",error:n,unsent:!0,turnFailed:!0,stopError:null,settledAt:Date.now()}),dismiss:()=>t({status:"idle",sessionId:null,error:null,stopError:null,unsent:!1,topic:"",prompt:"",turnFailed:!1,images:[],files:[],touched:[],results:[],answer:"",marks:[],startedAt:null,settledAt:null,before:null}),clearMark:n=>t(a=>({marks:a.marks.filter(i=>!cs(i,n))}))})),Ma=/Value error,\s*([\s\S]*?)\s*\[type=/,Ba=/^\d+ validation errors? for \S+[\s\S]*?\n\s*/i,Ua=/\s*\[type=[^\]]*\][\s\S]*$/m,qa=/\s*For further information visit \S+/g,za=/'([^']+)' already exists/,Ha=/cannot contain spaces or path separators/i,Ka=/effort tier '([^']+)' is unavailable/i,Wa=/team name must be/i,Va=/manager '([^']+)'/i,Ga=/(?:member|role) '([^']+)' (?:is not|does not)/i,Ya=/depth|cycle|circular/i,Ja=/instructions/i,Qa=/description/i;function Za(t){const n=t.match(Ma);return n?.[1]?n[1].trim():t.replace(Ba,"").replace(Ua,"").replace(qa,"").trim()}function Ye(t){const n=Za(t),a=n.match(za);if(a)return{message:s("ui.agents.refusals.name_taken",{name:a[1]}),field:"name"};if(Ha.test(n))return{message:s("ui.agents.refusals.name_grammar"),field:"name"};const i=n.match(Ka);if(i)return{message:s("ui.agents.refusals.effort_unavailable",{tier:i[1]}),field:"effort"};if(n.match(Wa))return{message:s("ui.agents.refusals.team_name_bound"),field:"name"};const o=n.match(Va);if(o)return{message:s("ui.agents.refusals.missing_manager",{name:o[1]}),field:"manager"};const u=n.match(Ga);return u?{message:s("ui.agents.refusals.missing_member",{name:u[1]}),field:"members"}:Ya.test(n)?{message:s("ui.agents.refusals.team_nesting"),field:"members"}:Ja.test(n)?{message:n,field:"instructions"}:Qa.test(n)?{message:n,field:"description"}:{message:n,field:null}}function Xa(t,n){const a=new Set(n),i=`${t}-copy`;if(!a.has(i))return i;for(let l=2;l<100;l+=1){const o=`${i}-${l}`;if(!a.has(o))return o}return i}function Ze(t){return t.action_class==="proactive"?"proactive":"reactive"}const Zs={get proactive(){return s("ui.agents.refusals.class.label.proactive")}},ei={get proactive(){return s("ui.agents.refusals.class.meaning.proactive")},get reactive(){return s("ui.agents.refusals.class.meaning.reactive")}},ti={get proactive(){return s("ui.agents.refusals.class.effect.proactive")},get reactive(){return s("ui.agents.refusals.class.effect.reactive")}};let Xs=s("ui.agents.refusals.class.install_disclosure");xa(()=>{Xs=s("ui.agents.refusals.class.install_disclosure")});function si(t,n){const a=[];return t.source==="builtin"&&a.push({op:"profiles.install",name:t.name}),a.push({op:"profiles.update",name:t.name,fields:{action_class:n}}),a}async function ni(t,n,a,i=()=>crypto.randomUUID()){if(Ze(t)===n)return null;let l=null;const o=si(t,n);for(let u=0;u<o.length;u+=1){const h=o[u];try{l=await a(h,i())}catch(b){throw new en(b,o.slice(0,u))}}return l}class en extends Error{completed;constructor(n,a){super(n instanceof Error?n.message:String(n)),this.name="ClassSwitchError",this.completed=a}}function ai(t,n){const a=t instanceof Error&&t.message?t.message:s("ui.agents.refusals.class.error.no_reason"),i=Ye(a).message;return n.some(l=>l.op==="profiles.install")?s("ui.agents.refusals.class.error.install_landed",{reason:i}):i}const ii=new Set(["agent","team","skill"]);function li(t){const n=typeof t.args?.op=="string"?t.args.op:null,a=typeof t.args?.name=="string"?t.args.name:null,i=t.toolName==="team"?"team":t.toolName==="skill"?"skill":"agent",l=a?{kind:i,name:a}:null,o=t.phase==="done"&&!t.isError&&!t.notRunReason&&!t.neverSent,u=h=>({writes:h&&o});switch(n){case"create":return{verb:a?`Creating ${i} ${a}`:`Creating a ${i}`,target:l,...u(!0)};case"update":return{verb:a?`Updating ${i} ${a}`:`Updating a ${i}`,target:l,...u(!0)};case"edit":return{verb:a?`Editing ${i} ${a}`:`Editing a ${i}`,target:l,...u(!0)};case"install":return{verb:a?`Installing ${a}`:"Installing an agent",target:l,...u(!0)};case"list":case"search":case"show":return{verb:a?`Reading ${a}`:`Reading ${i}s`,target:l,...u(!1)};default:return{verb:t.phase==="running"?`Working on ${i}s`:`Checked ${i}s`,target:l,...u(!0)}}}function ri(t){return t?Object.fromEntries(t.map(n=>[n.name,{description:n.description??"",fingerprint:n.fingerprint??""}])):null}const oi={description:"description",kind:"kind",tools:"tools",effort:"effort tier",delegate:"delegation",action_class:"class",manager:"manager",members:"members",instructions:"instructions"};function ci(t){return{description:t.description??"",kind:t.kind,tools:t.tools&&t.tools.length>0?[...t.tools].sort().join(","):"*",effort:t.effort??"inherit",delegate:String(!!t.delegate),action_class:Ze(t)}}function ui(t){return{description:t.description??"",manager:t.manager??"",members:(t.members??[]).map(n=>`${n.kind}:${n.role}x${n.count}`).sort().join(",")}}function ds(t,n){return{agents:Object.fromEntries((t??[]).map(a=>[a.name,ci(a)])),teams:Object.fromEntries((n??[]).map(a=>[a.name,ui(a)]))}}function di(t,n){if(t===n)return"tools";const a=h=>h==="*"?null:new Set(h.split(",")),i=a(t),l=a(n);if(l===null)return"tools widened to every tool";if(i===null)return"tools narrowed to a list";const o=[...l].filter(h=>!i.has(h)),u=[...i].filter(h=>!l.has(h));return o.length&&!u.length?o.length===1?`tool added: ${o[0]}`:`${o.length} tools added`:u.length&&!o.length?u.length===1?`tool removed: ${u[0]}`:`${u.length} tools removed`:"tools changed"}function mi(t,n,a){if(t==="tools")return di(n,a);if(t==="fingerprint")return"instructions changed";if(t==="delegate")return a==="true"?"delegation turned on":"delegation turned off";if(t==="action_class")return a==="proactive"?"class changed to proactive":"class changed to reactive — proactive messaging stopped";if(t==="members"){const i=l=>l?l.split(",").length:0;return`members changed (${i(n)} to ${i(a)})`}return`${oi[t]??t} changed`}function tt(t,n){return n==="agent"?t.agents:n==="team"?t.teams:t.skills??null}function gi(t,n,a){const i=[],l=new Set;for(const o of a){const u=`${o.kind}:${o.name}`;if(l.has(u))continue;l.add(u);const h=tt(t,o.kind),b=tt(n,o.kind);if(!h||!b){i.push({target:o,created:!1,changes:[]});continue}const d=h[o.name],f=b[o.name];if(!f)continue;if(!d){i.push({target:o,created:!0,changes:[]});continue}const c=[];for(const v of Object.keys(f))f[v]!==d[v]&&c.push({label:mi(v,d[v],f[v]),before:d[v],after:f[v]});i.push({target:o,created:!1,changes:c})}for(const o of["agent","team","skill"]){const u=tt(n,o),h=tt(t,o);if(!(!u||!h))for(const b of Object.keys(u))l.has(`${o}:${b}`)||h[b]||i.push({target:{kind:o,name:b},created:!0,changes:[]})}return i}function tn(t){return ee(t,"agents_config")&&ee(t,"session_interrupt")&&ee(t,"profile_catalogue")&&ee(t,"team_catalogue")}function sn(t){return tn(t)&&ee(t,"agents_config_skills")&&ee(t,"skill_library")}async function ms(t){if(!t)return null;try{const n=await le({op:"skills.list"});return ri(n?.data?.skills??null)}catch{return null}}function fi(t){if(!(t instanceof mt)||t.status!==409)return null;const a=t.detail?.session_id;return typeof a=="string"&&a.length>0?a:null}function hi(t,n){const[a,i]=r.useState(()=>Date.now());return r.useEffect(()=>{if(!t||!n)return;const l=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(l)},[t,n]),t?Math.max(0,a-t):0}function pi(t){const n=Math.floor(t/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m ${String(n%60).padStart(2,"0")}s`}function gs(t){for(let n=(t?.length??0)-1;n>=0;n-=1){const a=t?.[n];if(a?.kind==="assistant"&&a.text?.trim())return a.text.trim()}return""}function xi(t,n){const a=t.trim();if(!n)return a;const i=`Change the ${n.kind} ${n.name}:`;return a.startsWith(i)&&a.slice(i.length).trim()||a}function fs(t,n){if(n<=0)return!0;if(!t)return!1;for(let a=Math.max(0,n);a<t.length;a+=1)if(t[a]?.kind==="user")return!0;return!1}function hs(t){if(!t)return null;let n=0;for(let i=t.length-1;i>=0;i-=1)if(t[i]?.kind==="user"){n=i+1;break}let a=null;for(let i=n;i<t.length;i+=1){const l=t[i];l?.kind==="custom"&&l.level==="error"?a=l.headline?.trim()||ps():l?.kind==="assistant"&&(l.error===!0||l.stopReason==="error")?a=ps():l?.kind==="assistant"&&l.text?.trim()&&l.error!==!0&&(a=null)}return a}const ps=()=>s("ui.agents.config.error.turn_failed");function bi(t){const a=t?.payload?.frontend;if(!a||typeof a!="object")return null;const i=a.streaming;if(typeof i=="boolean")return i;const l=a.snapshot?.streaming;return typeof l=="boolean"?l:null}function ki(){const t=pt(),n=tn(t.data),a=sn(t.data),i=bt(),l=ie(),[o,u]=r.useState(!1),[h,b]=r.useState(!1),d=r.useRef(!1),f=r.useRef(0),c=r.useRef(0),v=l.status==="running"||l.status==="stopping",p=aa(l.sessionId??void 0,!!l.sessionId),g=r.useMemo(()=>gs(p.transcript?.records),[p.transcript?.records]);Un(l.sessionId??void 0,p.subscriptionId);const j=p.transcript?.records,E=r.useRef(j);r.useEffect(()=>{E.current=j},[j]);const x=r.useMemo(()=>(p.transcript?.records??[]).filter(N=>N.kind==="tool"&&ii.has(N.toolName)).map(N=>({...li({toolName:N.toolName,args:N.args??null,phase:N.phase,ts:N.ts,isError:N.isError,notRunReason:N.notRunReason,neverSent:N.neverSent}),ts:N.ts})),[p.transcript]);r.useEffect(()=>{if(v)for(const _ of x)_.target&&_.writes&&l.noteTouched(_.target)},[x,v,l]);const k=v&&x.length>0?x[x.length-1].verb:null,R=pi(hi(l.startedAt,v)),L=r.useCallback(async(_,N="")=>{if(d.current)return;d.current=!0;const H=_==="done"?hs(E.current?.slice(f.current)):null;if(H){vt(i),ie.getState().failTurn(H);return}const z=l.before;let w=[];try{const[A,W,ae]=await Promise.all([le({op:"profiles.list"}),le({op:"teams.list"}),ms(a)]);z&&(w=gi(z,{...ds(A.profiles,W.teams),skills:ae},l.touched))}catch{ie.getState().fail("The run finished, but the agents and teams lists could not be read to describe what changed."),vt(i);return}if(vt(i),ie.getState().settle(w,_,N),_==="done"&&w.length>0){const A=w.filter(W=>W.created).length;Ne(A>0?s("ui.notices.agents.config_run_changed",{count:w.length}):s("ui.notices.agents.config_run_updated",{count:w.length}))}},[i,l.before,l.touched,a]);r.useEffect(()=>{if(v){if(p.failure){ie.getState().fail(p.failure.statement);return}d.current||p.frontend&&(p.frontend.streaming||p.turnsCompleted<=c.current||fs(E.current,f.current)&&L(l.status==="stopping"?"stopped":"done",g))}},[v,g,p.failure,p.frontend,p.turnsCompleted,l.status,L]),r.useEffect(()=>{const _=l.sessionId;if(!v||!_)return;let N=!1;const H=async()=>{if(!(N||d.current))try{const A=await le({op:"sessions.get",sessionId:_});if(N||d.current||bi(A)!==!1)return;const W=E.current;if(!fs(W,f.current))return;const ae=W?.slice(f.current),K=gs(ae);if(!K&&!hs(ae))return;L(ie.getState().status==="stopping"?"stopped":"done",K)}catch{}},z=setTimeout(()=>void H(),400),w=setInterval(()=>void H(),4e3);return()=>{N=!0,clearTimeout(z),clearInterval(w)}},[v,l.sessionId,L]);const P=async(_,N,H=[])=>{if(o||!_.trim()&&H.length===0)return!1;u(!0),b(!1),d.current=!1,f.current=0,c.current=0;const z={...ds(i.getQueryData(["desktop","profiles"]),i.getQueryData(["desktop","teams"])),skills:await ms(a)},w=N?`About the ${N.kind} “${N.name}”: ${_.trim()}`:_.trim(),{images:A,files:W,failures:ae,overflow:K,fileOverflow:me}=await Sn(H,w),V=En(ae);if(V)return ie.getState().fail(V),!1;const oe=Cn(K);if(oe)return ie.getState().fail(oe),!1;const X=Rn(me);if(X)return ie.getState().fail(X),!1;try{let Q;try{Q=(await le({op:"sessions.create",requestId:crypto.randomUUID(),purpose:"agents-config"})).session_id}catch(te){const F=fi(te);if(F)return b(!0),l.adopt(F,_.trim(),z,A,W),!1;throw te}return l.adopt(Q,w,z,A,W,xi(_,N)),await S(Q,w,A,W),!0}catch(Q){const te=ie.getState().sessionId;return ie.getState().failUnsent(Be(Q,te?"The run was set up, but your request could not be sent. It is still in the box — send it again when the backend is reachable.":"The configuration run could not be started. Your request is still here.")),!1}finally{u(!1)}},S=async(_,N,H=[],z=[])=>{await le({op:"sessions.message",sessionId:_,requestId:crypto.randomUUID(),text:N,...H.length>0?{images:H}:{},...z.length>0?{files:z}:{}})},C=async()=>{const _=ie.getState();if(!(o||!_.unsent||!_.sessionId||!_.prompt&&_.images.length===0)){u(!0),f.current=E.current?.length??0,c.current=p.turnsCompleted;try{await S(_.sessionId,_.prompt,_.images,_.files),l.adopt(_.sessionId,_.prompt,_.before,_.images,_.files,_.topic),d.current=!1}catch(N){ie.getState().failUnsent(Be(N,"The request could not be sent. It is still in the box."))}finally{u(!1)}}},U=async()=>{const _=ie.getState().sessionId;if(_){l.stopping();try{await qn(_,crypto.randomUUID())}catch(N){ie.getState().stopFailed(Be(N,"The run did not acknowledge the request."))}}},$=n?null:t.isLoading?"Connecting to the backend…":t.error?s("ui.agents.config.banner.unavailable"):"Ask for a change needs a newer backend. Update Local Operator to configure agents by conversation.";return{enabled:n,disabledReason:$,status:l.status,sessionId:l.sessionId,frontend:p.frontend,topic:l.topic,error:l.error,stopError:l.stopError,about:l.about,setAbout:l.setAbout,touched:l.touched,results:l.results,answer:l.answer,step:k,elapsed:R,activity:x,start:P,stop:U,retry:C,canRetry:l.unsent&&!!l.sessionId,turnFailed:l.turnFailed,dismiss:l.dismiss,starting:o,attached:h}}function ji(t){return JSON.stringify(t.agent_id?["agent","id",t.agent_id]:["agent","source",t.source,t.name])}function yi(t){return JSON.stringify(t.id?["team","id",t.id]:["team","local",t.name])}const vi=["builtin","hub","local","external","project"];function _i(t){return vi.includes(t??"")?t:null}function nn(t){return{name:t.name,description:t.description??"",source:_i(t.source),linkId:t.link_id??null,installed:t.installed!==!1,fingerprint:t.fingerprint??null,form:t.form==="document"||t.form==="bundle"?t.form:null,editable:t.editable===!0}}function Ni(t){return t.map(nn).sort((n,a)=>n.name.localeCompare(a.name))}function wi(t,n,a,i){if(t.source!=="hub")return null;const l=t.linkId?n?.find(u=>u.kind==="skill"&&u.link_id===t.linkId):void 0,o=l?a.get(zn("skill",l.name)):void 0;return{state:ba(l,o,i),link:l,update:o}}function Si(t,n,a){const i=n.trim().toLowerCase();return i?t.filter(l=>l.name.toLowerCase().includes(i)||l.description.toLowerCase().includes(i)||a(l.source).toLowerCase().includes(i)):[...t]}function Ei(t,n){return n?n.body_in_detail?typeof t!="string"||typeof n.body_length!="number"?null:t.slice(0,n.body_length):typeof n.body=="string"?n.body:null:null}const Ci=/^(---[ \t]*\r?\n)(?:([\s\S]*?)\r?\n)?(---[ \t]*(?:\r?\n|$))/,Ri=/^(?:[ \t]*\r?\n)*/,xs=/^[ \t]+\S/,bs=/^[ \t]*$/,Ii=/\r?\n/,Li=/[\u007f-\u009f]/g,Ai=/(\r?\n)/;function an(t){const n=Ci.exec(t);if(!n)return{meta:null,text:t,head:"",tail:"",gap:""};const a=n[1],i=n[2]??"",l=n[0].slice(a.length+i.length),o=t.slice(n[0].length),u=Ri.exec(o)?.[0]??"";return{meta:i,text:o.slice(u.length),head:a,tail:l,gap:u}}function ln(t,n){const a=t.findIndex(l=>new RegExp(`^${n}[ \\t]*:`).test(l));if(a<0)return null;let i=a+1;for(;i<t.length;){const l=t[i];if(xs.test(l)){i+=1;continue}if(bs.test(l)){const o=t.slice(i).findIndex(u=>!bs.test(u));if(o>0&&xs.test(t[i+o])){i+=o;continue}}break}return[a,i]}function Fi(t){if(t===null)return null;const n=t.split(Ii),a=new Set;for(const l of["name","description"]){const o=ln(n,l);if(o)for(let u=o[0];u<o[1];u+=1)a.add(u)}const i=n.filter((l,o)=>!a.has(o)).join(`
|
|
8
|
-
`).trim();return i||null}function Et(t){return JSON.stringify(t).replace(Li,n=>`\\u${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function Ti(t,n,a,i){const l=an(t);if(l.meta===null){if(a===null)return i;const p=i.includes(`\r
|
|
9
|
-
`)?`\r
|
|
10
|
-
`:`
|
|
11
|
-
`;return`---${p}name: ${Et(n)}${p}description: ${Et(a.trim())}${p}---${p}${p}${i}`}if(a===null)return`${l.head}${l.meta}${l.tail}${l.gap}${i}`;const o=`description: ${Et(a.trim())}`,u=l.head.endsWith(`\r
|
|
12
|
-
`)?`\r
|
|
13
|
-
`:`
|
|
14
|
-
`,h=l.meta===""?[]:l.meta.split(Ai),b=h.filter((p,g)=>g%2===0),d=h.filter((p,g)=>g%2===1),f=ln(b,"description");if(f){const[p,g]=f;b.splice(p,g-p,o),d.splice(p,Math.max(0,g-1-p))}else b.length>0&&d.push(u),b.push(o);const c=b.map((p,g)=>p+(g<d.length?d[g]:"")).join(""),v=l.meta===""?`${u}${l.tail}`:l.tail;return`${l.head}${c}${v}${l.gap}${i}`}function ks(t,n){return t.installed?t.editable?Math.max(n?.files_total??0,n?.files?.length??0)>0?{kind:"ask",reason:"files"}:n?.body_truncated?{kind:"ask",reason:"truncated"}:{kind:"edit"}:t.form==="bundle"?{kind:"read-only",reason:"bundle",copy:!1}:t.source==="builtin"||t.source==="external"||t.source==="project"?{kind:"read-only",reason:t.source,copy:!0}:{kind:"read-only",reason:"unknown",copy:!1}:{kind:"not-installed"}}function $i(t,n){return t?n?n.installed?n.editable?null:"read-only":"not-installed":"none":"backend"}const Di=["all","local","hub","builtin"];function Oi(t,n){return n==="all"?[...t]:t.filter(a=>a.source===n)}const Pi=new Set(["local-only","both-changed"]);function rn(t){const n=t?.link?.push?.classification;return typeof n=="string"?Pi.has(n):!1}function Mi(t,n,a){return n?a==="failed"?"failed":t.installed?a==="available"?"available":a==="applied"?"applied":rn(n)?"modified":n.state.kind==="manual"?"updates-off":n.state.kind==="not-present"?"unlinked":null:"not-installed":null}function Bi(t,n){if(!t.installed)return"not-installed";if(t.source==="builtin"||t.source==="external"||t.source==="project")return"read-only";if(t.source!=="hub"||!n)return null;switch(n.state.kind){case"unknown":return"hub-unknown";case"not-present":return"unlinked";case"manual":return"updates-off";case"update":return n.state.link.policy.subscribe?"following":"updates-off";case"subscribed":case"detached":return"not-installed";default:return"following"}}const Yt=["desktop","skills","library"];async function on(t){const n=await le({op:"skills.list",...t?{name:t}:{}}),a=la.safeParse(n?.data);if(!a.success)throw new Error("skills-library-invalid");return a.data}function Ui(t){return xt({queryKey:Yt,enabled:t,queryFn:()=>on(),staleTime:1e4,retry:ia})}function qi(t,n){return xt({queryKey:[...Yt,t],enabled:n&&!!t,queryFn:()=>on(t??void 0),staleTime:1e4,retry:!1})}function zi(t){const n=Ui(t.enabled),a=Mt(t.enabled&&t.linksEnabled),i=Hn(t.enabled&&t.updatesEnabled),l=r.useMemo(()=>Ni(n.data?.skills??[]),[n.data]),o=r.useMemo(()=>Kn(i.data),[i.data]),u=t.linksEnabled&&!a.isLoading&&!a.error,h=Wi(),b=r.useCallback(d=>{const f=wi(d,a.data?.links,o,u);return!f?.link||!d.installed||!Ki(f.link)||f.link.push?.classification==="both-changed"?f:{...f,link:{...f.link,push:{...f.link.push,classification:"local-only"}}}},[a.data,o,u,h]);return{library:n,cards:l,join:b,inventoryReady:u,linksFailed:!!a.error}}const cn=new Map,Ft=new Set;let un=0;function Hi(t){cn.set(t,Date.now()),un+=1;for(const n of Ft)n()}function Ki(t){if(!t)return!1;const n=cn.get(t.link_id);return n===void 0?!1:!((t.push?.last_checked_at?Date.parse(t.push.last_checked_at):Number.NaN)>n)}function Wi(){return r.useSyncExternalStore(t=>(Ft.add(t),()=>Ft.delete(t)),()=>un)}function Vi(){const t=bt(),n=r.useCallback(()=>{t.invalidateQueries({queryKey:Yt}),t.invalidateQueries({queryKey:Ms})},[t]),a=st({retry:0,mutationFn:o=>le({op:"skills.create",requestId:crypto.randomUUID(),name:o,copyFrom:o}),onSettled:n}),i=st({retry:0,mutationFn:o=>le({op:"skills.update",requestId:crypto.randomUUID(),name:o.name,expectedFingerprint:o.expectedFingerprint,files:[{path:"SKILL.md",content:o.skillMd}]}),onSuccess:(o,u)=>{u.linkId&&Hi(u.linkId)},onSettled:n}),l=st({retry:0,mutationFn:o=>le({op:"skills.remove",requestId:crypto.randomUUID(),name:o.name,discardLocalChanges:o.discardLocalChanges}),onSettled:n});return{copy:a,update:i,remove:l}}function J({title:t,description:n,actions:a,children:i,className:l}){return e.jsxs("section",{className:G("space-y-2",l),children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1",children:[e.jsx("h3",{className:"text-heading",children:t}),a]}),n?e.jsx("p",{className:"text-meta text-ink-muted",children:n}):null,i]})}const Jt="min-h-6",Qt="h-[calc(var(--text-title)*var(--text-title--line-height))]";function we({text:t,empty:n="Nothing here yet.",mono:a=!1,showAllLabel:i,showLessLabel:l,breakLongTokens:o=!1,markdown:u=!1}){const[h,b]=r.useState(!1),[d,f]=r.useState(!1),c=r.useRef(null);Z();const v=l??s("ui.agents.detail.read.show_less"),p=i??s("ui.agents.detail.read.show_all");return r.useEffect(()=>{if(h)return;const g=c.current;if(!g)return;const j=()=>f(!!t&&g.scrollHeight>g.clientHeight+1);j();const E=new ResizeObserver(j);return E.observe(g),()=>E.disconnect()},[t,h]),t.trim()?e.jsxs("div",{className:G(o&&"min-w-0"),children:[e.jsx("div",{ref:c,"data-break-long-tokens":o?"true":void 0,"data-read-markdown":u?"true":void 0,className:G("text-body text-ink",u?!h&&"max-h-[10lh] overflow-hidden":"whitespace-pre-wrap",!u&&!h&&"line-clamp-10",a&&"font-mono text-meta",o&&"min-w-0 break-words [overflow-wrap:anywhere]"),children:u?e.jsx(Na,{children:t}):t}),d?e.jsx(I,{variant:"link",size:"sm",className:G("mt-px -mb-[3px]",Jt),"aria-expanded":h,onClick:()=>b(g=>!g),children:h?v:p}):null]}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:n})}function Gi({source:t,appearance:n="chip"}){const a=dn(t);return n==="text"?e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:a}):e.jsx(ke,{variant:"neutral",children:a})}function dn(t){return t==="builtin"?s("ui.agents.pages.scope.builtin"):t==="installed"?s("ui.agents.pages.scope.installed"):s("ui.agents.pages.scope.custom")}let Zt=!1,mn=null;function js(t,n){Zt=t,mn=t?n??null:null}function Xt(t,n){r.useEffect(()=>{if(!n)return;const a=i=>{i.key!=="Escape"||i.defaultPrevented||Zt||(i.preventDefault(),t())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n,t])}function jt({dirty:t,pending:n,onSave:a,onCancel:i,saveLabel:l=s("ui.agents.detail.action.save_changes"),pendingLabel:o=s("ui.agents.detail.action.saving"),dirtyHint:u,submit:h,confirming:b,onConfirmingChange:d}){Z();const[f,c]=r.useState(!1),v=r.useRef(null),p=r.useRef(null),g=b!==void 0,j=g?b:f,E=r.useRef(!1);r.useEffect(()=>{j?p.current?.focus():E.current&&document.activeElement===document.body&&v.current?.focus(),E.current=j},[j]);const x=r.useRef(null);r.useEffect(()=>{const R=x.current,L=R?.closest("[data-agents-pane]");if(!R||!L)return;const P=()=>L.style.setProperty("--lo-pane-footer-h",`${R.getBoundingClientRect().height}px`);P();const S=new ResizeObserver(P);return S.observe(R),()=>{S.disconnect(),L.style.removeProperty("--lo-pane-footer-h")}},[]);const k=R=>{g||c(R),d?.(R)};return r.useEffect(()=>{t||(g||c(!1),d?.(!1))},[t,g,d]),e.jsxs("div",{ref:x,"data-testid":"edit-footer","data-lo-pane-footer":!0,className:"sticky bottom-0 z-10 flex flex-wrap items-center gap-2 border-hairline border-t bg-canvas py-3",children:[e.jsx(I,{ref:v,type:h?"submit":void 0,variant:"primary",onClick:h?void 0:a,disabled:n,children:n?o:l}),j?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:u??s("ui.agents.detail.action.discard_question")}),e.jsx(I,{variant:"danger",onClick:i,children:s("ui.agents.detail.action.discard_changes")}),e.jsx(I,{ref:p,variant:"ghost",onClick:()=>{k(!1),v.current?.focus()},children:s("ui.agents.detail.action.keep_editing")})]}):e.jsx(I,{variant:"ghost",onClick:()=>{Zt&&mn?.(),t?k(!0):i()},disabled:n,children:s("ui.common.actions.cancel")}),t&&!j?e.jsx("span",{className:"ms-auto text-meta text-ink-dim",children:s("ui.agents.detail.action.unsaved_changes")}):null]})}let Tt=!1;function gn(){Tt=!0}function fn(){const t=Tt;return Tt=!1,t}function hn({rows:t=6}){return e.jsx("div",{className:"space-y-1","aria-hidden":"true",children:Yi.slice(0,t).map(n=>e.jsx(Me,{className:"h-12 w-full"},n))})}const Yi=["a","b","c","d","e","f","g","h"];function ft(){return e.jsxs("div",{className:"space-y-8","aria-hidden":"true",children:[e.jsx(Me,{className:"h-7 w-64"}),e.jsx(Me,{className:"h-5 w-40"}),e.jsx(Me,{className:"h-28 w-full"}),e.jsx(Me,{className:"h-24 w-full"})]})}function ot({title:t,what:n,meaning:a,onRetry:i,retrying:l=!1,retryLabel:o="Retry",retryingLabel:u="Retrying…"}){return e.jsxs("div",{role:"alert",className:"max-w-xl space-y-2",children:[e.jsx("h2",{className:"text-heading",children:t}),e.jsx("p",{className:"text-body-sm text-ink",children:n}),e.jsx("p",{className:"text-body-sm text-ink-muted",children:a}),e.jsx(I,{variant:"secondary",onClick:i,disabled:l,children:l?u:o})]})}function Se({label:t,htmlFor:n,error:a}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("label",{htmlFor:n,className:"text-body-sm text-ink-muted",children:t}),a?e.jsx("span",{className:"text-meta text-danger",role:"alert",children:a}):null]})}const Ji=/^[A-Za-z0-9_.:-]{1,128}$/;function Re(t){return{description:t.description??"",instructions:t.instructions??"",tools:t.tools&&t.tools.length>0?[...t.tools]:null,effort:t.effort??"inherit",delegate:t.delegate??!1}}function Qi(t,n){const a={};return n.description!==t.description&&(a.description=n.description),n.instructions!==t.instructions&&(a.instructions=n.instructions),JSON.stringify(n.tools)!==JSON.stringify(t.tools)&&(a.tools=n.tools??[]),n.effort!==t.effort&&(a.effort=n.effort),n.delegate!==t.delegate&&(a.delegate=n.delegate),a}function Zi({profile:t}){Z();const n=[dn(t.source),Ze(t)==="proactive"?Zs.proactive:null,t.delegate?s("ui.agents.detail.meta.delegates"):null,t.kind==="specialist"?"Specialist":null].filter(Boolean);return e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e.jsx("p",{className:"text-body-sm text-ink-muted",children:n.join(" · ")}),t.divergent_fields?.length?e.jsx(ke,{variant:"warning",children:s("ui.agents.detail.badge.modified")}):null]})}const Xi=5e3;let Ct=null;function el({profile:t,displayedName:n,notice:a,onNotice:i,onChanged:l}){Z();const o=Ze(t),[u,h]=r.useState(null),[b,d]=r.useState(!1),f=r.useRef(null),c=r.useId();r.useEffect(()=>{u!==null&&o===u&&h(null)},[o,u]),r.useEffect(()=>{const g=Ct;!g||g.name!==t.name||(Ct=null,!(Date.now()-g.at>Xi)&&f.current?.focus())},[t.name]);const v=u??o,p=async g=>{if(!(b||g===v)){Ct={name:t.name,at:Date.now()},i(null),h(g),d(!0);try{await ni(t,g,(j,E)=>j.op==="profiles.install"?le({op:"profiles.install",name:j.name,requestId:E}):le({op:"profiles.update",name:j.name,requestId:E,fields:j.fields??{}})),l(t.name),Ne(g==="proactive"?s("ui.notices.agents.proactive",{name:n}):s("ui.notices.agents.reactive",{name:n}))}catch(j){h(null);const E=j instanceof en?j.completed:[],x=ai(j,E);i(x),ct(x),l(t.name)}finally{d(!1)}}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative flex items-center gap-2 text-body-sm",children:[e.jsx(kt,{ref:f,checked:v==="proactive","aria-disabled":b,"aria-labelledby":c,"data-testid":"agent-class-switch",className:"after:absolute after:inset-0 after:content-['']",onCheckedChange:g=>void p(g?"proactive":"reactive")}),e.jsx("span",{id:c,className:"text-ink",children:s("ui.agents.detail.class.label")}),e.jsx("span",{"aria-live":"polite",className:"text-ink-muted",children:b?"Switching…":v==="proactive"?"On":"Off"})]}),e.jsx("p",{className:"text-body-sm text-ink",children:ei[v]}),e.jsx("p",{className:"text-meta text-ink-muted",children:ti[v]}),t.source==="builtin"?e.jsx("p",{className:"text-meta text-ink-muted",children:Xs}):null,a?e.jsxs(pe,{variant:"danger",role:"alert","data-testid":"agent-class-error",children:[e.jsx(xe,{children:s("ui.agents.detail.class.error_title")}),e.jsx(je,{children:a})]}):null]})}function pn({tools:t,onChange:n,error:a}){Z();const[i,l]=r.useState(""),[o,u]=r.useState(null),h=r.useId(),b=()=>{const d=i.trim();if(d){if(!Ji.test(d)){u("Tool names are letters, digits, dot, underscore, dash or colon.");return}if(t?.includes(d)){u("That tool is already listed.");return}u(null),l(""),n([...t??[],d])}};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(kt,{checked:t===null,onCheckedChange:d=>n(d?null:[]),"aria-label":s("ui.agents.detail.tools.every_tool_aria")}),e.jsx("span",{children:s("ui.agents.detail.tools.all_label")})]}),t===null?e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.detail.tools.may_use_any")}):e.jsxs(e.Fragment,{children:[t.length>0?e.jsx("ul",{className:"flex flex-wrap gap-1.5",children:t.map(d=>e.jsx("li",{children:e.jsxs(ke,{variant:"outline",children:[d,e.jsx(I,{variant:"ghost",size:"sm","aria-label":`Remove ${d}`,onClick:()=>n(t.filter(f=>f!==d)),className:"ms-1 h-4 px-1",children:"×"})]})},d))}):e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.detail.tools.empty")}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(Se,{label:"Add a tool",htmlFor:h,error:o??a}),e.jsx(Ue,{id:h,value:i,inputSize:"md",placeholder:s("ui.agents.detail.tools.placeholder"),"aria-invalid":!!(o??a),onChange:d=>{l(d.target.value),u(null)},onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),b())}})]}),e.jsx(I,{variant:"secondary",onClick:b,disabled:!i.trim(),children:s("ui.agents.detail.tools.add")})]})]})]})}function tl({profile:t,displayedName:n,classNotice:a,onClassNotice:i,teams:l,effortTiers:o,askEnabled:u,onSaved:h,onDuplicate:b,onOpenTeam:d,onAskAgent:f,onDirtyChange:c,belowHeader:v}){Z();const[p,g]=r.useState(!1),[j,E]=r.useState(()=>Re(t)),[x,k]=r.useState(()=>Re(t)),[R,L]=r.useState(!1),[P,S]=r.useState(null),[C,U]=r.useState(null),[$,_]=r.useState(!1),[N,H]=r.useState(!1),[z,w]=r.useState(!1),A=r.useRef(null),W=r.useRef(t.definition_revision),ae=qt(),K=JSON.stringify(x)!==JSON.stringify(j);r.useEffect(()=>(c?.(p&&K),()=>c?.(!1)),[c,p,K]),r.useEffect(()=>{fn()&&requestAnimationFrame(()=>A.current?.focus())},[]),r.useEffect(()=>{if(p&&K)return;const F=Re(t);E(F),k(F)},[t,p,K]),r.useEffect(()=>{if(!p){H(!1);return}const F=Re(t);H(K&&JSON.stringify(F)!==JSON.stringify(j))},[t,p,K,j]);const me=()=>{g(!1),S(null),U(null),_(!1),w(!1);const F=Re(t);E(F),k(F),W.current=t.definition_revision};Xt(()=>{if(z){w(!1);return}K?w(!0):me()},p);const oe=async F=>{if(F?.preventDefault(),R)return;const q=Qi(j,x);if(Object.keys(q).length===0){me();return}if(typeof q.instructions=="string"&&!q.instructions.trim()){S("Give the agent instructions."),U("instructions");return}L(!0),S(null),U(null);try{const ce=await le({op:"profiles.update",name:t.name,requestId:crypto.randomUUID(),fields:q,expectedDefinitionRevision:W.current});g(!1),_(!1);const re=Re(ce);E(re),k(re),W.current=ce.definition_revision,h(ce.name),Ne(s("ui.notices.agents.saved",{name:ce.name})),requestAnimationFrame(()=>A.current?.focus())}catch(ce){const re=Ye(ce instanceof Error?ce.message:"The agent could not be saved.");S(re.message),U(re.field);const ge=ce?.status;if(ce?.code==="local-concurrent-edit"){H(!0),L(!1);return}const D=typeof ge=="number"&&ge!==408&&ge>=400&&ge<500;_(!D),D||ct(s("ui.notices.agents.save_unconfirmed"))}finally{L(!1)}},X=async()=>{if(!R){L(!0),S(null);try{const F=await le({op:"profiles.install",name:t.name,requestId:crypto.randomUUID()}),q=Re(F);E(q),k(q),h(F.name),Ne(s("ui.notices.agents.installed",{name:F.name})),requestAnimationFrame(()=>A.current?.focus())}catch(F){const q=Ye(F instanceof Error?F.message:"The agent could not be installed.");S(q.message),ct(q.message)}finally{L(!1)}}},Q=(l??[]).filter(F=>F.manager===t.name||(F.members??[]).some(q=>q.role===t.name)),te=t.source==="builtin";return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-3",children:[e.jsxs("div",{className:"min-w-0 flex-[1_1_16rem] space-y-1",children:[e.jsx("h2",{ref:A,tabIndex:-1,title:n,className:"truncate text-title focus:outline-none",children:n}),e.jsx(Zi,{profile:t})]}),p?null:e.jsxs("div",{className:G("flex shrink-0 items-center gap-2",Qt),children:[e.jsx(I,{variant:"primary",onClick:()=>{Ut.getState().stageDraft({kind:"agent",name:t.name}),ae("/chat")},children:s("ui.agents.detail.action.new_chat")}),te?e.jsxs(I,{variant:"secondary",onClick:X,disabled:R,children:[e.jsx(Sa,{className:"size-4"}),R?"Installing…":"Install to edit"]}):e.jsx(I,{variant:"secondary",onClick:()=>{g(!0),S(null),U(null),W.current=t.definition_revision},children:s("ui.agents.detail.action.edit")}),u?e.jsx(I,{variant:"ghost",onClick:()=>f(`Change the agent ${t.name}: `),children:s("ui.agents.detail.action.ask_change")}):null,e.jsxs(zs,{children:[e.jsx(Hs,{asChild:!0,children:e.jsx(I,{variant:"ghost",size:"icon","aria-label":s("ui.agents.detail.action.more_actions"),className:"-mr-2",children:e.jsx(Ds,{"aria-hidden":"true"})})}),e.jsx(Ks,{align:"end",children:e.jsx(Ws,{onSelect:()=>b(t),children:s("ui.agents.detail.action.duplicate")})})]})]})]}),te?e.jsxs(pe,{variant:"info",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.builtin_title")}),e.jsx(je,{children:s("ui.agents.detail.alert.builtin_body")})]}):null,N?e.jsxs(pe,{variant:"warning","data-testid":"agent-conflict",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.conflict_title")}),e.jsxs(je,{children:[e.jsx("span",{className:"block",children:s("ui.agents.detail.alert.conflict_body")}),e.jsx(I,{variant:"secondary",size:"sm",className:"mt-2",onClick:me,children:s("ui.agents.detail.alert.conflict_reload")})]})]}):null,$?e.jsxs(pe,{variant:"danger","data-testid":"agent-unconfirmed",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.unconfirmed_title")}),e.jsx(je,{children:s("ui.agents.detail.alert.unconfirmed_body")})]}):null,P&&!C?e.jsxs(pe,{variant:"danger",role:"alert","data-testid":"agent-save-error",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.save_failed_title")}),e.jsx(je,{children:P})]}):null]}),v,e.jsx("form",{noValidate:!0,onSubmit:F=>{F.preventDefault(),oe(F)},className:"space-y-8",children:p?e.jsxs(e.Fragment,{children:[e.jsx(ze,{title:s("ui.agents.detail.section.when_to_use"),description:"One sentence the model reads to decide when this agent is the right one.",label:"When to use this agent",value:x.description,error:C==="description"?P:null,onChange:F=>k(q=>({...q,description:F}))}),e.jsx(ze,{title:s("ui.agents.detail.section.instructions"),description:"What the agent is told to do. This is the agent's whole behaviour.",label:"Instructions",value:x.instructions,rows:12,required:!0,error:C==="instructions"?P:null,onChange:F=>k(q=>({...q,instructions:F}))}),e.jsx(J,{title:s("ui.agents.detail.section.tools"),children:e.jsx(pn,{tools:x.tools,error:C==="tools"?P:null,onChange:F=>k(q=>({...q,tools:F}))})}),e.jsx(J,{title:s("ui.agents.detail.section.delegation"),description:"Whether this agent may hand work to subagents, and which effort tier it runs at.",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(kt,{checked:x.delegate,onCheckedChange:F=>k(q=>({...q,delegate:F})),"aria-label":s("ui.agents.detail.delegate.aria")}),e.jsx("span",{children:s("ui.agents.detail.delegate.label")})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Se,{label:"Effort tier",htmlFor:"agent-effort",error:C==="effort"?P:null}),e.jsx(gt,{ariaLabel:"Effort tier",showLabel:!1,placeholder:s("ui.agents.detail.field.effort_placeholder"),busyLabel:"Loading effort tiers",options:["inherit",...o].map(F=>({id:F,name:F,description:F==="inherit"?"Use the session's own effort":void 0})),selected:{id:x.effort,name:x.effort},onSelect:F=>k(q=>({...q,effort:F.id})),helperText:"Tiers come from the backend's subagent model settings."})]})]})}),e.jsx(jt,{submit:!0,confirming:z,onConfirmingChange:w,dirty:K,pending:R,onSave:()=>void oe(),onCancel:me,saveLabel:"Save changes",dirtyHint:"Discard your unsaved changes to this agent?"})]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{title:s("ui.agents.detail.section.when_to_use"),children:e.jsx(we,{text:t.description||"",empty:"No description yet — add one so a model knows when to pick this agent."})}),e.jsx(J,{title:s("ui.agents.detail.section.instructions"),children:e.jsx(we,{text:t.instructions??t.packaged_instructions??"",empty:"No instructions yet."})}),e.jsx(J,{title:s("ui.agents.detail.section.tools"),children:t.tools&&t.tools.length>0?e.jsx("ul",{className:"flex flex-wrap gap-1.5",children:t.tools.map(F=>e.jsx("li",{children:e.jsx(ke,{variant:"outline",children:F})},F))}):e.jsx(ke,{variant:"neutral",children:s("ui.agents.detail.tools.all_label")})}),e.jsxs(J,{title:s("ui.agents.detail.section.delegation"),children:[e.jsx("p",{className:"text-body-sm text-ink",children:t.delegate?"May hand work to subagents.":"Does its own work; it does not delegate."}),e.jsxs("p",{className:"text-body-sm text-ink-muted",children:[s("ui.agents.detail.read.effort_label")," ",t.effort??"inherit"]}),t.effort&&Q.length?e.jsx("p",{className:"text-body-sm text-ink-muted",children:s("ui.agents.models.pin_reach",{count:Q.length,teams:Q.map(F=>F.name).join(", ")})}):null]}),e.jsx(J,{title:s("ui.agents.detail.section.messaging"),description:"Reactive agents only reply. Proactive agents may also message you first.",children:e.jsx(el,{profile:t,displayedName:n,notice:a,onNotice:i,onChanged:h})}),e.jsx(J,{title:s("ui.agents.detail.section.used_by"),description:"Teams that name this agent as a manager or a member.",children:Q.length>0?e.jsx("ul",{className:"flex flex-wrap gap-x-3 gap-y-1",children:Q.map(F=>e.jsx("li",{children:e.jsx(I,{variant:"link",className:G("-my-0.5",Jt),onClick:()=>d(F.name),children:F.name})},F.id))}):e.jsx("p",{className:"text-body-sm text-ink-muted",children:s("ui.agents.detail.empty.used_by")})}),e.jsxs(J,{title:s("ui.agents.detail.section.origin"),description:t.source==="builtin"?"Shipped with the app.":t.source==="installed"?"Installed from a packaged starter.":"Created on this machine.",children:[e.jsxs("dl",{className:"space-y-1 text-body-sm",children:[t.seed_origin?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("dt",{className:"text-ink-muted",children:s("ui.agents.detail.origin.source")}),e.jsx("dd",{className:"text-ink",children:t.seed_origin})]}):null,t.divergent_fields?.length?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("dt",{className:"text-ink-muted",children:s("ui.agents.detail.origin.changed")}),e.jsx("dd",{className:"text-ink",children:t.divergent_fields.join(", ")})]}):null]}),t.packaged_instructions&&t.divergent_fields?.length?e.jsx(Ge,{summary:"Compare with the packaged instructions",className:"mt-2",children:e.jsx(we,{text:t.packaged_instructions,mono:!0})}):null]})]})})]})}function ze({title:t,description:n,label:a,value:i,onChange:l,rows:o,required:u,error:h,fieldRef:b}){const d=r.useId();return e.jsxs(J,{title:t,description:n,children:[e.jsx(Se,{label:a,htmlFor:d,error:h}),o?e.jsx(At,{id:d,ref:b,value:i,rows:o,required:u,"aria-invalid":!!h,className:G("min-h-0"),onChange:f=>l(f.target.value)}):e.jsx(Ue,{id:d,value:i,"aria-invalid":!!h,onChange:f=>l(f.target.value)})]})}function sl({initial:t,takenNames:n,effortTiers:a,onDirtyChange:i,onSaved:l,onCancel:o}){Z();const[u,h]=r.useState(()=>t?Xa(t.name,n):""),[b,d]=r.useState(t?.kind??"role"),[f,c]=r.useState(()=>t?{...Re(t),description:t.description??""}:{description:"",instructions:"",tools:null,effort:"inherit",delegate:!1}),[v,p]=r.useState(!1),[g,j]=r.useState(null),[E,x]=r.useState(null),k=r.useRef(null),R=r.useRef(null);r.useEffect(()=>(i?.(!!(u.trim()||f.instructions.trim())),()=>i?.(!1)),[i,u,f.instructions]),r.useEffect(()=>{k.current?.focus(),k.current?.select()},[]);const L=async S=>{if(S?.preventDefault(),!v){if(!u.trim()){j("Give the agent a name."),x("name"),k.current?.focus();return}if(/[\\/\s]/.test(u.trim())){j("Names cannot contain spaces or slashes."),x("name"),k.current?.focus();return}if(n.includes(u.trim())){j(`An agent called “${u.trim()}” already exists. Choose another name, or open the existing one to change it.`),x("name"),k.current?.focus();return}if(!f.instructions.trim()){j("Give the agent instructions."),x("instructions"),R.current?.focus();return}p(!0),j(null),x(null);try{const C=await le({op:"profiles.create",requestId:crypto.randomUUID(),name:u.trim(),fields:{kind:b,description:f.description,instructions:f.instructions,tools:f.tools??[],effort:f.effort,delegate:f.delegate}});Ne(s("ui.notices.agents.created_named",{name:C.name})),gn(),l(C.name)}catch(C){const U=Ye(C instanceof Error?C.message:"The agent could not be created.");j(U.message),x(U.field)}finally{p(!1)}}},P=t?"Duplicate as a new agent":"New agent";return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h2",{className:"text-title",children:P}),e.jsx("p",{className:"text-body-sm text-ink-muted",children:t?`A copy of ${t.name}. It is a separate agent: changing it does not change the original.`:"Reusable instructions shared by agent commands, subagents and teams. Chats stay separate."})]}),g&&!E?e.jsxs(pe,{variant:"danger",role:"alert","data-testid":"agent-create-error",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.save_failed_title")}),e.jsx(je,{children:g})]}):null,e.jsxs("form",{noValidate:!0,onSubmit:S=>{S.preventDefault(),L(S)},className:"space-y-8",children:[e.jsx(J,{title:s("ui.agents.detail.section.name_role"),children:e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(Se,{label:"Name",htmlFor:"agent-create-name",error:E==="name"?g:null}),e.jsx(Ue,{id:"agent-create-name",ref:k,value:u,required:!0,"aria-invalid":E==="name",onChange:S=>h(S.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Se,{label:"How it works with others",htmlFor:"agent-create-kind"}),e.jsxs(at,{value:b,onValueChange:S=>d(S),children:[e.jsx(it,{id:"agent-create-kind",children:e.jsx(lt,{})}),e.jsxs(rt,{children:[e.jsx(Ie,{value:"role",children:s("ui.agents.detail.kind.role")}),e.jsx(Ie,{value:"specialist",children:s("ui.agents.detail.kind.specialist")})]})]})]})]})}),e.jsx(ze,{title:s("ui.agents.detail.section.when_to_use"),description:"One sentence the model reads to decide when this agent is the right one.",label:"When to use this agent",value:f.description,error:E==="description"?g:null,onChange:S=>c(C=>({...C,description:S}))}),e.jsx(ze,{title:s("ui.agents.detail.section.instructions"),description:"What the agent is told to do. This is the agent's whole behaviour.",label:"Instructions",value:f.instructions,rows:12,required:!0,fieldRef:R,error:E==="instructions"?g:null,onChange:S=>c(C=>({...C,instructions:S}))}),e.jsx(J,{title:s("ui.agents.detail.section.delegation"),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[e.jsx(kt,{checked:f.delegate,onCheckedChange:S=>c(C=>({...C,delegate:S})),"aria-label":s("ui.agents.detail.delegate.aria")}),e.jsx("span",{children:s("ui.agents.detail.delegate.label")})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(Se,{label:"Effort tier",htmlFor:"agent-create-effort"}),e.jsx(gt,{ariaLabel:"Effort tier",showLabel:!1,busyLabel:"Loading effort tiers",placeholder:s("ui.agents.detail.field.effort_placeholder"),options:["inherit",...a].map(S=>({id:S,name:S,description:S==="inherit"?"Use the session's own effort":"A tier configured in Settings"})),selected:{id:f.effort,name:f.effort},onSelect:S=>c(C=>({...C,effort:S.id}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:s("ui.agents.detail.section.tools")}),e.jsx(pn,{tools:f.tools,error:E==="tools"?g:null,onChange:S=>c(C=>({...C,tools:S}))})]})]})}),e.jsx(jt,{submit:!0,dirty:!!(u.trim()||f.instructions),pending:v,saveLabel:t?"Create the copy":"Create agent",pendingLabel:"Creating…",dirtyHint:"Discard this new agent?",onSave:()=>void L(),onCancel:o})]})]})}function xn(t,n,a=Date.now()){const i=Date.parse(t.expires_at);return t.local_fingerprint.length>0&&t.proposal_fingerprint.length>0&&t.link_id===n.link_id&&(t.direction==="push"||t.remote_fingerprint.length>0)&&t.proposal.kind===n.kind&&t.hub_source===n.hub_source&&t.visibility===n.visibility&&t.tenant_id===n.tenant_id&&t.expected_policy_revision===n.policy.revision&&t.expected_remote_revision===n.remote_revision&&Number.isFinite(i)&&i>a}function nl(t,n,a=Date.now()){return t.can_confirm&&t.preview_receipt.length>0&&xn(t,n,a)}const Rt=t=>Number.isFinite(Date.parse(t))?Ln(new Date(t)):s("ui.hub.status.unknown"),al=t=>[t.pull.state,t.push.state].some(n=>["checking","merging","applying","pushing"].includes(n));function il({link:t,displayName:n,itemsById:a}){Z();const i=Gn(t,{displayName:n,itemsById:a}),l=ht(t),o=Yn(t),[u,h]=r.useState(null),[b,d]=r.useState(null),[f,c]=r.useState(void 0),[v,p]=r.useState(!1),[g,j]=r.useState(!1),E=r.useRef(null),x=r.useId(),k=i.isPending||al(t),R=i.isPending?i.variables?.action:void 0,L=!ns(t.baseline_state),P=new Set((b??[]).map(w=>w.outcome)),S=P.has("would-merge"),C=P.has("needs-review"),U=S||C,$=b?.find(w=>["failed","skipped","unavailable"].includes(w.outcome))??null,_=u;r.useEffect(()=>{_&&!xn(_,t)&&(h(null),j(!0))},[t,_]),r.useEffect(()=>{if(!_)return;const w=Date.parse(_.expires_at)-Date.now(),A=setTimeout(()=>{h(null),j(!0)},Math.max(0,Math.min(w,2147483647)));return()=>clearTimeout(A)},[_]);const N=w=>{k||(w.action==="preview"&&j(!1),i.mutate(w,{onSuccess:A=>{w.action==="preview"?h(A.preview?.direction==="push"?A.preview:null):w.action==="apply"&&w.preview?(d((A.reports??[]).filter(W=>W.local_id===t.local_id)),c(w.prefer),p(w.acknowledgeUnknownBaseline===!0)):(h(null),d(null))},onError:A=>{w.action==="apply"&&w.preview&&d(null),A instanceof mt&&["publication-preview-changed","application-preview-changed","remote-revision-changed"].includes(A.code??"")&&(h(null),d(null),j(!0))}}))},H=()=>{i.isPending||(h(null),d(null))},z=w=>s(w==="pull"?"ui.hub.links.direction_pull":"ui.hub.links.direction_push");return e.jsxs("section",{className:"flex min-w-0 flex-col gap-4 py-4","data-hub-link":t.link_id,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"break-words text-heading text-ink",children:l}),e.jsx("p",{className:"break-words text-meta text-ink-muted",children:t.name}),e.jsx("p",{className:"break-all text-meta text-ink-dim",children:s("ui.hub.links.source_address",{address:t.hub_source})})]}),e.jsx(Us,{link:t}),e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:["pull","push"].map(w=>{const A=t[w];return e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1","data-hub-direction":w,children:[e.jsx("h4",{className:"text-body-sm text-ink",children:z(w)}),e.jsx("p",{className:G("text-body-sm",A.state==="failed"?"text-danger":A.state==="available"?"text-accent":"text-ink-muted"),children:Jn(A)}),A.error_class&&e.jsx("p",{className:"text-meta text-warning",children:nt(A.error_class)}),o[w].retryable&&(w==="pull"||t.policy.auto_push)&&e.jsx(I,{variant:"outline",size:"sm",disabled:k||!i.canWrite,onClick:()=>N({action:"retry",linkId:t.link_id,direction:w}),children:s("ui.hub.links.retry")}),A.last_checked_at&&e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.status.last_checked",{time:Rt(A.last_checked_at)})}),A.last_success_at&&e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.links.last_success",{time:Rt(A.last_success_at)})}),A.next_retry_at&&e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.status.next_retry",{time:Rt(A.next_retry_at)})}),A.model_used&&e.jsx("p",{className:"break-words text-meta text-ink-muted",children:s("ui.hub.links.actual_model",{model:A.model_used})}),A.operation_id&&e.jsx("p",{className:"break-all text-meta text-ink-dim",children:s("ui.hub.status.receipt",{operation:A.operation_id})})]},w)})}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(I,{variant:"outline",size:"sm","aria-busy":R==="check",disabled:k||!i.canWrite,onClick:()=>N({action:"check",linkId:t.link_id}),children:s("ui.hub.subscriptions.check")}),e.jsx(I,{variant:"outline",size:"sm",disabled:k||!i.canWrite||t.kind==="skill"&&Bt(t)==="absent","aria-busy":R==="apply",onClick:()=>N({action:"apply",linkId:t.link_id,preview:!0}),children:s("ui.hub.links.preview_pull")}),e.jsx(I,{variant:"outline",size:"sm",disabled:k||!i.canWrite||!t.remote_revision||!ns(t.baseline_state)||t.visibility==="org"&&!t.tenant_name,onClick:()=>N({action:"preview",linkId:t.link_id}),children:s("ui.hub.subscriptions.preview_publish")}),R==="check"&&e.jsx("output",{className:"self-center text-meta text-ink-muted",children:s("ui.hub.status.checking")})]}),g&&e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:s("ui.hub.links.preview_changed")}),i.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:i.error instanceof Lt?i.error.message:as(i.variables?.action,{direction:z(i.variables?.action==="preview"||i.variables?.action==="confirm"?"push":"pull"),item:t.name,source:l})}),i.variables?.action!=="retry"&&i.data?.reports.filter(Qn).filter(w=>w.link_id===t.link_id).map((w,A)=>e.jsx("output",{className:"text-meta text-ink-muted",children:s("ui.hub.links.action_result",{direction:z(w.direction),item:t.name,source:l,outcome:Xe(w.outcome)})},`${w.operation_id??w.direction}-${A}`)),b&&!U&&!$&&e.jsx("output",{className:"text-meta text-ink-muted",children:s("ui.hub.links.incoming_nothing",{outcome:Xe(b[0]?.outcome??"up-to-date")})}),$&&e.jsxs("div",{role:"alert",className:"flex flex-col gap-0.5",children:[e.jsx("p",{className:"text-body-sm text-danger",children:s("ui.hub.links.incoming_failed",{outcome:Xe($.outcome)})}),e.jsx("p",{className:"break-words text-meta text-ink-muted",children:nt($.error_class)})]}),e.jsx(zt,{open:u!==null||U,onOpenChange:w=>{w||H()},children:e.jsxs(Ht,{className:"max-w-3xl",closeDisabled:i.isPending,onOpenAutoFocus:w=>{w.preventDefault(),E.current?.focus()},onEscapeKeyDown:w=>{i.isPending&&w.preventDefault()},children:[e.jsxs(Kt,{children:[e.jsx(Wt,{children:u?s("ui.hub.links.preview_payload",{source:l}):s("ui.hub.links.preview_pull")}),e.jsx(Vt,{children:u?s("ui.hub.subscriptions.enable_safety"):s("ui.hub.links.preview_recomputed")}),!u&&L&&e.jsx("p",{className:"text-body-sm text-warning",children:s("ui.hub.links.unknown_baseline")})]}),b?e.jsxs(e.Fragment,{children:[C&&e.jsx("p",{className:"text-body-sm text-ink","data-needs-review":!0,children:s("ui.hub.links.incoming_needs_review")}),e.jsx("ul",{className:"flex flex-col gap-1","data-incoming-reports":!0,children:b.map((w,A)=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsx("p",{className:"text-body-sm text-ink",children:s("ui.hub.links.incoming_outcome",{item:n?.trim()||t.name,outcome:Xe(w.outcome)})}),L&&!v||w.message?e.jsx("p",{className:"text-meta text-ink-muted",children:L&&!v?s("ui.hub.links.incoming_unknown_baseline"):w.message}):null]},`${w.local_id}-${A}`))})]}):e.jsx("pre",{className:"max-h-[50vh] overflow-auto whitespace-pre-wrap break-words rounded-md bg-sunken p-3 text-mono-sm text-ink",children:JSON.stringify(_?.proposal,null,2)}),_?.warnings.length?e.jsxs("div",{children:[e.jsx("h4",{className:"text-body-sm text-ink",children:s("ui.hub.links.preview_warnings")}),_.warnings.map((w,A)=>e.jsx("p",{className:"break-words text-body-sm text-warning",children:w},`${A}-${w}`))]}):null,_?.reason&&e.jsx("p",{className:"text-body-sm text-warning",children:nt(_.reason)}),b&&L&&e.jsxs("label",{htmlFor:x,className:"flex items-start gap-2 text-body-sm text-ink",children:[e.jsx(ma,{id:x,checked:v,onCheckedChange:w=>{const A=w===!0;p(A),N({action:"apply",linkId:t.link_id,preview:!0,prefer:f,acknowledgeUnknownBaseline:A})}}),s("ui.hub.links.acknowledge_baseline")]}),i.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:i.error instanceof Lt?i.error.message:as(i.variables?.action,{direction:z(u?"push":"pull"),item:t.name,source:l})}),e.jsxs(Gt,{children:[e.jsx(I,{ref:E,variant:"ghost",disabled:i.isPending,onClick:H,children:s("ui.hub.subscriptions.cancel")}),u?e.jsx(I,{disabled:i.isPending||!i.canWrite||!nl(u,t),onClick:()=>N({action:"confirm",linkId:t.link_id,previewReceipt:u.preview_receipt}),children:s("ui.hub.links.confirm_publish")}):e.jsxs(e.Fragment,{children:[["local","remote"].map(w=>e.jsx(I,{variant:"outline",disabled:i.isPending||!i.canWrite||L&&!v,onClick:()=>{N({action:"apply",linkId:t.link_id,preview:!0,prefer:w,acknowledgeUnknownBaseline:L&&v})},children:s(w==="local"?"ui.hub.links.prefer_local":"ui.hub.links.prefer_remote")},w)),e.jsx(I,{disabled:i.isPending||!i.canWrite||!S||L&&!v,onClick:()=>N({action:"apply",linkId:t.link_id,prefer:f,acknowledgeUnknownBaseline:L&&v}),children:s("ui.hub.subscriptions.pull")})]})]})]})})]})}function ll({row:t,source:n,organizations:a,isAuthenticated:i,onSignIn:l,initialOpen:o,onResolved:u}){Z();const[h,b]=r.useState(o??!1),[d,f]=r.useState(""),c=Vn(u),v=r.useRef(null),p=r.useRef(null),g=r.useRef(!1);r.useEffect(()=>{h?v.current?.focus():g.current&&(g.current=!1,p.current?.focus())},[h]);const j=d!=="public"&&d!=="",E=j?a.find(R=>R.tenant_id===d):null,k=d!==""&&(!j||!!E)&&(j||d==="public");return e.jsxs("section",{className:"flex min-w-0 flex-col gap-3","data-hub-source-unresolved":t.local_id,children:[e.jsx(pe,{variant:"warning",className:"p-4",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[c.upgradeMessage&&e.jsx("output",{className:"block text-meta text-warning","data-hub-core-upgrade":!0,children:c.upgradeMessage}),e.jsx(xe,{"data-hub-unresolved-label":!0,children:s("ui.hub.links.source_not_confirmed")}),e.jsx("h3",{className:"break-words text-body-sm font-medium text-ink",children:t.name}),e.jsx("p",{className:"text-body-sm text-ink",children:s("ui.hub.links.unresolved_what",{item:t.name})}),e.jsx("p",{className:"text-body-sm text-ink",children:s("ui.hub.links.unresolved_why",{item:t.name})}),e.jsx("p",{className:"text-body-sm text-ink",children:s("ui.hub.links.unresolved_next")}),e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.links.source_address",{address:n})}),e.jsx("p",{className:"break-all text-mono-sm text-ink-muted",children:s("ui.hub.links.hub_id",{address:t.hub_id})}),e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.links.resolve_irreversible")}),h?null:e.jsx(I,{ref:p,variant:"primary",size:"sm",className:"self-start",onClick:()=>b(!0),children:s("ui.hub.links.resolve_action")})]})}),h?e.jsxs("div",{ref:v,tabIndex:-1,className:"flex flex-col gap-2 outline-none",children:[e.jsx("h4",{className:"text-body-sm text-ink",children:s("ui.hub.links.resolve_title")}),e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.links.resolve_description",{item:t.name})}),i?e.jsxs("label",{className:"text-body-sm text-ink",children:[s("ui.hub.links.scope_label"),e.jsxs("select",{className:"mt-1 w-full rounded-md border border-control bg-surface px-2 py-1 text-body-sm text-ink",value:d,disabled:c.isPending,onChange:R=>f(R.target.value),children:[e.jsx("option",{value:"",disabled:!0,children:s("ui.hub.links.scope_placeholder")}),e.jsx("option",{value:"public",children:s("ui.hub.links.scope_public")}),a.map(R=>e.jsx("option",{value:R.tenant_id,children:s("ui.hub.links.scope_private",{organization:R.tenant_name})},R.tenant_id))]})]}):e.jsx(I,{variant:"outline",onClick:l,children:s("ui.hub.links.sign_in_to_publish")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(I,{variant:"outline",disabled:c.isPending,onClick:()=>{g.current=!0,b(!1)},children:s("ui.hub.subscriptions.cancel")}),e.jsx(I,{disabled:c.isPending||!c.canWrite||!k,onClick:()=>c.mutate({kind:t.kind,localId:t.local_id,name:t.name,hubSource:n,visibility:j?"org":"public",tenantId:j?E?.tenant_id??null:null}),children:c.isPending?s("ui.hub.links.resolve_action_confirming"):c.isSuccess?s("ui.hub.links.resolve_action_done"):s("ui.hub.links.resolve_action_confirm")})]}),!k&&!c.isPending&&i?e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.hub.links.scope_required")}):null,c.error?e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:c.error instanceof Lt?c.error.message:c.error instanceof mt&&c.error.code==="origin-conflict"?s("ui.hub.links.resolve_conflict"):c.error instanceof mt&&c.error.code?nt(c.error.code):s("ui.hub.links.resolve_failed_generic")}):null]}):null]})}function rl({enabled:t,kind:n,name:a,localId:i,itemsById:l=!1}){Z();const o=Mt(t),{isAuthenticated:u}=Pt(),h=qt(),[b]=Os(),d=b.get("resolve"),f=d!==null,{memberships:c}=Bs({enabled:t&&u}),v=Vs(c).map(N=>({tenant_id:N.tenant_id,tenant_name:N.tenant_name})),p=In.radientBaseUrl;if(!t)return null;const g=n&&a?Wn(o.data,n,i,a):o.data?.links.filter(N=>!n||N.kind===n)??[],j=(o.data?.unresolved??[]).filter(N=>(!n||N.kind===n)&&(!a||(i?N.local_id===i:N.name===a))),E=N=>s(N?"ui.hub.subscriptions.configured_on":"ui.hub.subscriptions.configured_off"),x=N=>{const H=g[0]?N(g[0]):!1;return g.every(z=>N(z)===H)},k=N=>x(N)?E(N(g[0])):s("ui.hub.links.mixed"),R=(()=>{if(g.length===0)return"";const N=g[0],H=g.length>1?` · ${s("ui.hub.links.sources_count",{count:g.length})}`:"";return`${ht(N)}${H} · ${s("ui.hub.subscriptions.subscribe")} ${k(z=>z.policy.subscribe)} · ${s("ui.hub.subscriptions.auto_push")} ${k(z=>z.policy.auto_push)}`})(),L=g.some(N=>[N.pull.state,N.push.state].some(H=>H==="available"||H==="failed")),P=r.useRef(null),[S,C]=r.useState(!1);r.useEffect(()=>{!S||g.length===0||(P.current?.querySelector("button[aria-expanded]")?.focus(),C(!1))},[S,g]);const[U,$]=r.useState(L),_=r.useRef(L);return r.useEffect(()=>{L&&!_.current&&$(!0),_.current=L},[L]),o.isLoading?null:o.error&&!o.data?e.jsxs("div",{className:"flex flex-col items-start gap-2",children:[e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:s("ui.hub.links.load_failed")}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>void o.refetch(),children:s("ui.hub.links.retry")})]}):g.length===0&&j.length===0?null:e.jsxs("div",{ref:P,className:"flex min-w-0 flex-col gap-3","data-hub-links-panel":!0,children:[j.map(N=>e.jsx(ll,{row:N,source:p,organizations:v,isAuthenticated:u,onSignIn:()=>h("/settings"),initialOpen:f,onResolved:()=>C(!0)},`${N.kind}:${N.local_id}:${d}`)),g.length>0?e.jsxs(Ge,{open:U,onOpenChange:$,summary:`${s("ui.hub.links.title")} · ${R}`,className:"min-w-0",children:[e.jsx("div",{className:"divide-y divide-hairline",children:g.map(N=>e.jsx(il,{link:N,displayName:a,itemsById:l},N.link_id))}),o.error&&o.data&&e.jsx("p",{role:"alert",className:"text-meta text-warning",children:s("ui.hub.links.load_failed")})]}):null]})}const ol={builtin:"ui.agents.skills.source.builtin",hub:"ui.agents.skills.source.hub",local:"ui.agents.skills.source.local",external:"ui.agents.skills.source.external",project:"ui.agents.skills.source.project"},cl={builtin:"ui.agents.skills.where.builtin",hub:"ui.agents.skills.where.hub",local:"ui.agents.skills.where.local",external:"ui.agents.skills.where.external",project:"ui.agents.skills.where.project"};function es(t){return s(t?ol[t]:"ui.agents.skills.source.unknown")}const ys={failed:{key:"ui.agents.skills.hub.update_failed",ink:"text-danger"},available:{key:"ui.hub.skills.update_available",ink:"text-accent"},applied:{key:"ui.hub.skills.update_applied",ink:"text-success"},modified:{key:"ui.agents.detail.badge.modified",ink:"text-warning"},"not-installed":{key:"ui.agents.skills.state.not_installed",ink:"text-ink"},"updates-off":{key:"ui.agents.skills.state.updates_off",ink:"text-ink"},unlinked:{key:"ui.agents.skills.hub.unlinked",ink:"text-ink"}},ul=new Set(["failed","available","applied"]),dl={following:"ui.agents.skills.state.following","updates-off":"ui.agents.skills.state.updates_off","not-installed":"ui.agents.skills.state.not_installed","hub-unknown":"ui.agents.skills.state.hub_unknown",unlinked:"ui.agents.skills.hub.unlinked","read-only":"ui.agents.skills.state.read_only"},ml={all:"ui.agents.pages.scope.all",local:"ui.agents.skills.scope.local",hub:"ui.agents.skills.scope.hub",builtin:"ui.agents.skills.scope.builtin"},gl={local:"ui.agents.skills.empty.local",hub:"ui.agents.skills.empty.hub",builtin:"ui.agents.skills.empty.builtin"};function bn(t){return t?ja(t.state,t.update,t.link?Bt(t.link)==="present":!1):null}function fl({cards:t,selected:n,join:a,marked:i,onOpen:l}){Z();const o=r.useRef(new Map),[u,h]=r.useState(n),b=(d,f)=>{const c=t.findIndex(p=>p.name===d);if(c<0)return;const v=t[Math.min(t.length-1,Math.max(0,c+f))];v&&(h(v.name),o.current.get(v.name)?.focus())};return e.jsx("ul",{"aria-label":s("ui.agents.skills.list_aria"),className:"space-y-0.5","data-skills-roster":!0,children:t.map(d=>{const f=a(d),c=bn(f),v=Mi(d,f,c?.kind??null),p=i?.get(`skill:${d.name}`);return e.jsx("li",{children:e.jsxs("button",{ref:g=>{g?o.current.set(d.name,g):o.current.delete(d.name)},type:"button","aria-current":d.name===n?"true":void 0,tabIndex:d.name===(u??t[0]?.name)?0:-1,"data-testid":`skill-row-${d.name}`,"data-skill-source":d.source??"unknown","data-skill-state":v??void 0,"data-skill-installed":d.installed?"true":"false",title:d.description?`${d.name} - ${d.description}`:d.name,className:G("flex min-h-12 w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-start hover:bg-row-hover",d.name===n&&ut),onFocus:()=>h(d.name),onClick:()=>l(d.name),onKeyDown:g=>{g.key==="ArrowDown"?(g.preventDefault(),b(d.name,1)):g.key==="ArrowUp"?(g.preventDefault(),b(d.name,-1)):g.key==="Home"?(g.preventDefault(),b(d.name,-t.length)):g.key==="End"&&(g.preventDefault(),b(d.name,t.length))},children:[e.jsxs("span",{className:"flex w-full items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-body-sm text-ink",children:d.name}),p!==void 0?e.jsx(ke,{variant:"attention","data-testid":"skill-row-updated",children:s(p?"ui.agents.skills.badge.new":"ui.agents.skills.badge.updated")}):null,e.jsx("span",{className:"ms-auto max-w-[45%] shrink-0 truncate text-meta text-ink-dim","data-testid":"skill-row-source",children:es(d.source)})]}),e.jsxs("span",{className:"block min-h-lh w-full min-w-0 truncate text-meta text-ink-muted","data-testid":"skill-row-line2",children:[v?e.jsxs("span",{"data-testid":"skill-row-state",children:[c&&ul.has(v)?e.jsx(Gs,{mark:c,labels:kn,className:"inline-flex align-middle"}):e.jsx("span",{className:ys[v].ink,children:s(ys[v].key)}),e.jsx("span",{className:"text-ink-dim",children:" · "})]}):null,d.description?d.description:e.jsx("span",{className:"text-ink-dim",children:s("ui.agents.detail.no_description")})]})]})},d.name)})})}function hl({loading:t,failed:n,cards:a,total:i,search:l,scope:o="all",selected:u,join:h,marked:b,onOpen:d}){return Z(),n?null:t?e.jsx(hn,{}):a.length===0?e.jsx("p",{className:"px-1 py-2 text-body-sm text-ink-muted","data-testid":"skills-empty","data-skills-empty":i===0?"none":l.trim()?"no-match":"scope",children:i===0?s("ui.agents.skills.empty.none"):l.trim()?s("ui.agents.skills.empty.search",{query:l}):o!=="all"?s(gl[o]):s("ui.agents.skills.empty.none")}):e.jsx(fl,{cards:a,selected:u,join:h,marked:b,onOpen:d})}const kn={failed:"ui.agents.skills.hub.update_failed",review:"ui.agents.skills.hub.needs_review"};function jn(t,n){const a=r.useRef(!1),i=r.useRef(!1),l=r.useRef(null);return r.useEffect(()=>{if(a.current){if(n){i.current=!0;return}i.current&&(i.current=!1,a.current=!1,t&&requestAnimationFrame(()=>{const o=document.activeElement;if(!(!o||o===document.body||!!l.current?.contains(o)))return;const h=l.current?.querySelector("button");h&&!h.disabled&&h.focus()}))}},[t,n]),{holder:l,onPress:()=>{a.current=!0}}}function vs(t){return t<1e3?s("ui.agents.skills.detail.file_bytes",{count:t}):An(t)}const _s={builtin:["ui.agents.skills.alert.builtin_title","ui.agents.skills.alert.builtin_body"],external:["ui.agents.skills.alert.external_title","ui.agents.skills.alert.external_body"],project:["ui.agents.skills.alert.project_title","ui.agents.skills.alert.project_body"],bundle:["ui.agents.skills.alert.bundle_title","ui.agents.skills.alert.bundle_body"]};function pl(t,n,a,i){if(t.kind!=="read-only"||t.reason==="unknown")return null;if(t.reason==="bundle")return a?["ui.agents.skills.alert.too_large_title","ui.agents.skills.alert.too_large_body"]:n.source==="hub"?_s.bundle:["ui.agents.skills.alert.bundle_title","ui.agents.skills.alert.bundle_local_body"];const[l,o]=_s[t.reason];return i?[l,o]:[l,bl[t.reason]]}function xl(t,n){return{requestId:n,remoteId:t.hub_id,scope:t.visibility==="org"&&t.tenant_id?{visibility:"org",tenantId:t.tenant_id,organization:t.tenant_name}:{visibility:"public",tenantId:null,organization:null},alias:t.name,subscribe:t.policy.subscribe,autoPush:t.policy.auto_push,consent:!1}}const bl={builtin:"ui.agents.skills.alert.builtin_body_no_copy",external:"ui.agents.skills.alert.external_body_no_copy",project:"ui.agents.skills.alert.project_body_no_copy"};function kl(t,n){const a=s("ui.agents.publication.subject.name",{name:n.trim()}),i=jl(t);return i===404?s("ui.agents.publication.pull.not_found",{subject:a}):i===401||i===403?s("ui.agents.publication.pull.sign_in_refused",{subject:a}):i===409?$t(t)?.startsWith("bundle-")?s("ui.agents.publication.pull.refused_download",{subject:a}):s("ui.agents.skills.error.download_failed_body"):i===422?s("ui.agents.publication.pull.refused_download",{subject:a}):i===429?s("ui.agents.publication.pull.busy",{subject:a}):s("ui.agents.skills.error.download_failed_body")}function $t(t){const n=t?.code;return typeof n=="string"?n:null}function jl(t){const n=t?.status;return typeof n=="number"?n:null}function yl({name:t,card:n,join:a,detail:i,onRetry:l,writesEnabled:o=!1,askEnabled:u=!1,onAsk:h,belowHeader:b,onDirtyChange:d,onRemoved:f,hubSignedIn:c=!1,downloadEnabled:v=!1}){Z();const p=r.useRef(null),g=jn(!!i.error,i.isFetching),j=Vi(),E=ka({retry:0});r.useEffect(()=>{const O=document.activeElement,m=!O||O===document.body,B=window.matchMedia("(max-width: 999px)").matches;(m||B&&O?.closest("[data-skills-roster]"))&&requestAnimationFrame(()=>p.current?.focus())},[]);const x=i.data?.skill_detail??null,k=n??(x?nn(x):null),R=Ei(i.data?.detail,x),L=R===null?null:an(R),P=()=>({description:(x?x.description:k?.description)??"",instructions:L?.text??""}),[S,C]=r.useState(!1),[U,$]=r.useState(P),[_,N]=r.useState(P),[H,z]=r.useState(!1),[w,A]=r.useState(!1),W=r.useRef(null),[ae,K]=r.useState(null),[me,V]=r.useState("write"),oe=r.useRef(!1),[X,Q]=r.useState(null),te=_.description!==U.description||_.instructions!==U.instructions,F=`${(x?x.description:k?.description)??""}\0${L?.text??""}`;r.useEffect(()=>{if(S)return;const O=P();$(O),N(O)},[F,S,te]),r.useEffect(()=>(d?.(S&&te),()=>d?.(!1)),[d,S,te]);const q=()=>{C(!1),z(!1),A(!1),K(null);const O=P();$(O),N(O)};if(Xt(()=>{if(H){z(!1);return}te?z(!0):q()},S),i.error)return e.jsx("div",{ref:g.holder,children:e.jsx(ot,{title:s("ui.agents.skills.error.detail_title",{name:t}),what:i.error.message,meaning:s("ui.agents.skills.error.detail_meaning"),onRetry:()=>{g.onPress(),l()},retrying:i.isFetching,retryLabel:s("ui.common.actions.retry"),retryingLabel:s("ui.agents.skills.retrying")})});if(!k)return i.isLoading?e.jsx(ft,{}):null;const re=a(k),ge=bn(re),fe=rn(re),D=Bi(k,re),be=x?.files??[],Ee=x?.files_total??be.length,ue=re?.link?.local_path??null,y=!!x&&!i.isLoading,T=ks(k,x),se=o&&T.kind==="edit"&&R!==null&&!!x?.fingerprint,Y=se&&!i.isFetching,M=u&&(T.kind==="edit"||T.kind==="ask")&&!!h,$e=o&&T.kind==="read-only"&&T.copy,he=k.source==="hub"&&!k.installed&&re?.link&&Bt(re.link)==="absent"?re.link:null,de=v&&he!==null,He=o&&k.installed&&(k.source==="local"||k.source==="hub")&&T.kind!=="not-installed",ye=k.source==="hub",Le=Fi(L?.meta??null),Ce=pl(T,k,!!x?.body_truncated,$e),De=y&&T.kind==="ask"&&o?s(T.reason==="files"?M?"ui.agents.skills.detail.edit_by_asking":"ui.agents.skills.detail.edit_off_files":M?"ui.agents.skills.detail.edit_by_asking_truncated":"ui.agents.skills.detail.edit_off_truncated"):null,Ae=async()=>{if(!(!he||!c||E.isPending||oe.current)){oe.current=!0,K(null),V("download");try{if(!(await E.mutateAsync(xl(he,crypto.randomUUID()))).reports?.some(m=>m.applied||m.outcome==="unchanged")){K(s("ui.hub.skills.pull_failed"));return}Ne(s("ui.hub.skills.installed_alias",{item:he.name,source:ht(he)})),requestAnimationFrame(()=>p.current?.focus())}catch(O){K(kl(O,he.name))}finally{oe.current=!1}}},Oe=async()=>{const O=W.current;if(!(j.update.isPending||O===null)){if(!te){q();return}if(x?.fingerprint!==O.fingerprint||ks(k,x).kind!=="edit"){A(!0);return}K(null),V("write");try{await j.update.mutateAsync({name:k.name,linkId:k.source==="hub"?k.linkId:null,expectedFingerprint:O.fingerprint,skillMd:Ti(O.body,k.name,_.description===U.description?null:_.description,_.instructions)}),C(!1),z(!1),$(_),Ne(s("ui.agents.skills.notice.saved",{name:k.name})),requestAnimationFrame(()=>p.current?.focus())}catch(m){if($t(m)==="skill_stale"){A(!0);return}K(Be(m,s("ui.agents.skills.error.write_fallback")))}}},Fe=async()=>{K(null),V("write");try{await j.copy.mutateAsync(k.name),Ne(s("ui.agents.skills.notice.copied",{name:k.name}))}catch(O){K(Be(O,s("ui.agents.skills.error.write_fallback")))}},Ke=async O=>{K(null),V("write");try{await j.remove.mutateAsync({name:k.name,discardLocalChanges:O}),Q(null),f?.(k.name,ye)}catch(m){if(!O&&$t(m)==="skill_local_changes_unpublished"){Q("unpublished");return}Q(null),K(Be(m,s("ui.agents.skills.error.write_fallback")))}};return e.jsxs("div",{className:"space-y-8","data-testid":"skill-detail","data-skill":k.name,"data-skill-editability":y?T.kind:void 0,children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-3",children:[e.jsxs("div",{className:"min-w-0 flex-[1_1_16rem] space-y-1",children:[e.jsx("h2",{ref:p,tabIndex:-1,className:"truncate text-title focus:outline-none",title:k.name,children:k.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e.jsx("p",{className:"text-body-sm text-ink-muted","data-testid":"skill-meta",children:[es(k.source),D?s(dl[D]):null].filter(Boolean).join(" · ")}),k.installed?e.jsx(Gs,{mark:ge,labels:kn}):null,fe&&k.installed&&ge?.kind!=="review"?e.jsx(ke,{variant:"warning","data-testid":"skill-modified",children:s("ui.agents.detail.badge.modified")}):null]}),ye&&(se||M)?e.jsx("p",{className:"text-meta text-ink-muted","data-testid":"skill-hub-local-note",children:s("ui.agents.skills.detail.hub_local_note")}):null]}),S||!y?null:e.jsx(vl,{editOffered:se,editReady:Y,canAsk:M,canCopy:$e,canRemove:He,canDownload:de,downloadReady:c,downloading:E.isPending,linked:ye,copying:j.copy.isPending,onDownload:()=>void Ae(),onEdit:()=>{if(!Y||R===null||!x?.fingerprint)return;W.current={fingerprint:x.fingerprint,body:R};const O=P();$(O),N(O),C(!0),K(null),A(!1)},onAsk:()=>h?.(k.name),onCopy:()=>void Fe(),onRemove:()=>Q("ask")})]}),De&&!S?e.jsx("p",{className:"text-meta text-ink-muted","data-testid":"skill-edit-reason",children:De}):null,de&&!c?e.jsx("p",{className:"text-meta text-ink-muted","data-testid":"skill-download-reason",children:s("ui.agents.skills.detail.download_signed_out")}):null,Ce&&y?e.jsxs(pe,{variant:"info","data-testid":"skill-read-only",children:[e.jsx(xe,{children:s(Ce[0])}),e.jsx(je,{children:s(Ce[1])})]}):null,w?e.jsxs(pe,{variant:"warning","data-testid":"skill-conflict",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.conflict_title")}),e.jsxs(je,{children:[e.jsx("span",{className:"block",children:s("ui.agents.skills.alert.conflict_body")}),e.jsx(I,{variant:"secondary",size:"sm",className:"mt-2",onClick:q,children:s("ui.agents.detail.alert.conflict_reload")})]})]}):null,ae?e.jsxs(pe,{variant:"danger",role:"alert","data-testid":"skill-write-error",children:[e.jsx(xe,{children:s(me==="download"?"ui.agents.skills.error.download_failed_title":"ui.agents.detail.alert.save_failed_title")}),e.jsx(je,{children:ae})]}):null]}),b,S?e.jsxs("form",{noValidate:!0,className:"space-y-8",onSubmit:O=>{O.preventDefault(),Oe()},children:[e.jsx(ze,{title:s("ui.agents.detail.section.when_to_use"),description:s("ui.agents.skills.edit.description_help"),label:s("ui.agents.skills.edit.description_label"),value:_.description,onChange:O=>N(m=>({...m,description:O}))}),e.jsx(ze,{title:s("ui.agents.detail.section.instructions"),description:s("ui.agents.skills.edit.instructions_help"),label:s("ui.agents.detail.section.instructions"),value:_.instructions,rows:12,onChange:O=>N(m=>({...m,instructions:O}))}),e.jsx(jt,{submit:!0,confirming:H,onConfirmingChange:z,dirty:te,pending:j.update.isPending,onSave:()=>void Oe(),onCancel:q,dirtyHint:s("ui.agents.detail.action.discard_question")})]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{title:s("ui.agents.detail.section.when_to_use"),children:e.jsx(we,{text:k.description,empty:s("ui.agents.detail.no_description"),showAllLabel:s("ui.agents.skills.detail.show_all"),showLessLabel:s("ui.agents.skills.detail.show_less"),breakLongTokens:!0})}),e.jsx(J,{title:s("ui.agents.detail.section.instructions"),children:i.isLoading?e.jsx("div",{"aria-hidden":"true",children:e.jsx(ft,{})}):L!==null?e.jsxs(e.Fragment,{children:[x?.body_truncated?e.jsx("p",{className:"text-meta text-warning","data-testid":"skill-body-truncated",children:s("ui.agents.skills.detail.body_truncated",{size:vs(x.body_bytes??0)})}):null,e.jsx("div",{"data-testid":"skill-instructions",children:e.jsx(we,{text:L.text,markdown:!0,showAllLabel:s("ui.agents.skills.detail.show_all"),showLessLabel:s("ui.agents.skills.detail.show_less"),breakLongTokens:!0})})]}):e.jsx("p",{className:"text-body-sm text-ink-muted","data-testid":"skill-no-body",children:s(k.installed?"ui.agents.skills.detail.body_unavailable":"ui.agents.skills.detail.body_not_installed")})}),i.isLoading?null:e.jsxs(J,{title:s("ui.agents.skills.detail.section.files"),description:be.length>0?s("ui.agents.skills.detail.files_count",{count:Ee}):void 0,children:[be.length===0?e.jsx("p",{className:"text-body-sm text-ink-muted",children:s("ui.agents.skills.detail.files_none")}):e.jsx("ul",{className:"space-y-1","data-testid":"skill-files",children:be.map(O=>e.jsx("li",{children:e.jsx(Ge,{summary:e.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 truncate font-mono text-meta text-ink",children:O.path}),e.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:vs(O.size??0)})]}),children:O.preview?e.jsxs("section",{"aria-label":s("ui.agents.skills.detail.preview_aria",{path:O.path}),children:[O.preview_truncated?e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.skills.detail.preview_truncated")}):null,e.jsx(we,{text:O.preview,mono:!0,showAllLabel:s("ui.agents.skills.detail.show_all"),showLessLabel:s("ui.agents.skills.detail.show_less"),breakLongTokens:!0})]}):e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.skills.detail.preview_none")})})},O.path))}),x?.files_truncated?e.jsx("p",{className:"text-meta text-warning","data-testid":"skill-files-truncated",children:s("ui.agents.skills.detail.files_truncated_of",{shown:be.length,total:Ee})}):null]}),e.jsx("div",{"data-testid":"skill-details",children:e.jsx(Ge,{summary:e.jsx("span",{className:"text-heading",children:s("ui.agents.skills.detail.section.details")}),children:e.jsxs("dl",{className:"mt-2 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-2 text-body-sm",children:[e.jsx("dt",{className:"text-ink-muted",children:s("ui.agents.skills.detail.location_label")}),e.jsxs("dd",{className:"min-w-0 space-y-1 text-ink",children:[e.jsx("p",{children:s(k.source?cl[k.source]:"ui.agents.skills.where.unknown")}),ue?e.jsx("p",{className:"break-all font-mono text-meta text-ink-muted","data-testid":"skill-local-path",children:s("ui.hub.skills.local_path",{path:ue})}):null,ye&&re?.state.kind==="not-present"?e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.skills.hub.unlinked_help")}):null]}),e.jsx("dt",{className:"text-ink-muted",children:s("ui.agents.skills.detail.form_label")}),e.jsx("dd",{className:"text-ink","data-testid":"skill-form",children:k.form?s(k.form==="bundle"?"ui.agents.skills.detail.form.bundle":"ui.agents.skills.detail.form.document"):s("ui.agents.skills.detail.form.unknown")}),e.jsx("dt",{className:"text-ink-muted",children:s("ui.agents.skills.detail.fingerprint")}),e.jsx("dd",{className:"min-w-0 break-all font-mono text-meta text-ink-muted","data-testid":"skill-fingerprint",children:k.fingerprint??s("ui.agents.skills.detail.fingerprint_none")}),Le?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-ink-muted",children:s("ui.agents.skills.detail.front_matter_label")}),e.jsx("dd",{className:"min-w-0 whitespace-pre-wrap break-all font-mono text-meta text-ink-muted","data-testid":"skill-front-matter",children:Le})]}):null]})})})]}),e.jsx(zt,{open:X!==null,onOpenChange:O=>{O||Q(null)},children:e.jsxs(Ht,{className:"sm:max-w-md",children:[e.jsxs(Kt,{children:[e.jsx(Wt,{children:X==="unpublished"?s("ui.agents.skills.remove.unpublished_title"):ye?s("ui.hub.skills.unpull_title",{item:k.name}):s("ui.agents.skills.remove.title",{name:k.name})}),e.jsx(Vt,{children:X==="unpublished"?s("ui.agents.skills.remove.unpublished_body"):ye?s("ui.hub.skills.unpull_body"):s("ui.agents.skills.remove.body")})]}),e.jsxs(Gt,{children:[e.jsx(I,{variant:"outline",onClick:()=>Q(null),children:s("ui.hub.subscriptions.cancel")}),e.jsx(I,{variant:"danger","data-testid":"skill-remove-confirm",disabled:j.remove.isPending,onClick:()=>void Ke(X==="unpublished"),children:X==="unpublished"?s("ui.agents.skills.remove.discard_confirm"):s("ui.agents.skills.action.remove_confirm")})]})]})})]})}function vl({editOffered:t,editReady:n,canAsk:a,canCopy:i,canRemove:l,canDownload:o,downloadReady:u,downloading:h,linked:b,copying:d,onEdit:f,onAsk:c,onCopy:v,onRemove:p,onDownload:g}){return!t&&!a&&!i&&!l&&!o?null:e.jsxs("div",{className:G("flex shrink-0 items-center gap-2",Qt),"data-testid":"skill-actions",children:[t?e.jsx(I,{variant:"secondary",onClick:f,disabled:!n,"data-testid":"skill-edit",children:s("ui.agents.detail.action.edit")}):null,o?e.jsx(I,{variant:"secondary",onClick:g,disabled:!u||h,"data-testid":"skill-download",children:s("ui.hub.skills.download")}):null,i?e.jsx(I,{variant:"secondary",onClick:v,disabled:d,"data-testid":"skill-copy",children:d?s("ui.agents.skills.action.copying"):s("ui.agents.skills.action.copy")}):null,a?e.jsx(I,{variant:t?"ghost":"secondary",onClick:c,"data-testid":"skill-ask",children:s("ui.agents.detail.action.ask_change")}):null,l?e.jsxs(zs,{children:[e.jsx(Hs,{asChild:!0,children:e.jsx(I,{variant:"ghost",size:"icon","aria-label":s("ui.agents.detail.action.more_actions"),className:"-mr-2","data-testid":"skill-more",children:e.jsx(Ds,{"aria-hidden":"true"})})}),e.jsx(Ks,{align:"end",children:e.jsx(Ws,{onSelect:p,children:b?s("ui.hub.skills.unpull"):s("ui.agents.skills.action.remove")})})]}):null]})}const _l=["lo","med","hi"],Nl=["auto","none","minimal","low","medium","high","xhigh","max"],Je="inherit";function Ns(t){return t??Je}function wl(t){return t===Je?null:t}function Sl(t){return t===Je?null:t}function El(t,n){return{...t,...n.tier===void 0?{}:{tier:wl(n.tier)},...n.effort===void 0?{}:{effort:Sl(n.effort)}}}function Dt(t){const{tier:n,effort:a,key:i,...l}=t;return JSON.stringify({...l,...n?{tier:n}:{},...a?{effort:a}:{}})}function Cl(t,n){const a=`${n.kind}\0${n.role.toLocaleLowerCase()}`;return(t?.members??[]).find(i=>`${i.kind}\0${i.role.toLocaleLowerCase()}`===a)??null}const Rl={team:"ui.agents.models.source.team",row:"ui.agents.models.source.row",none:"ui.agents.models.source.none"},Il={team:"ui.agents.models.source.team",tier:"ui.agents.models.source.tier",model_default:"ui.agents.models.source.model_default"},yn=t=>Rl[t],Ll=t=>Il[t];function Al(t){return t.isSuccess?"available":t.isError&&Fl(t.error)?"unavailable":"absent"}function Fl(t){return ra(t)!=="outdated"}function Tl({team:t}){Z();const n=r.useId(),a=pt(),{isAuthenticated:i}=Pt(),l=ee(a.data,"hub_links"),[o,u]=r.useState(!1),[h,b]=r.useState(null),[d,f]=r.useState(St),c=r.useRef(null),v=r.useRef(null),p=Mt(l),g=Bs({enabled:o&&i&&ee(a.data,"radient_org")}),j=Vs(g.memberships),E=h?j.find($=>$.tenant_id===h):null,x=h?E?.tenant_name?s("ui.hub.links.source_private",{organization:E.tenant_name}):s("ui.hub.links.source_unavailable"):s("ui.hub.links.source_public"),k=(p.data?.links??[]).filter($=>$.kind==="team"&&$.local_id===t.id),R=k.find($=>$.visibility===(h?"org":"public")&&$.tenant_id===h),L=k.find($=>$.link_id!==R?.link_id),P=p.data?.unresolved.some($=>$.kind==="team"&&$.local_id===t.id),S=bt(),C=st({mutationFn:async()=>{if(!i||R||!l||!p.isSuccess||L||P||h&&!E)throw new Error("hub-team-destination-not-ready");const $=JSON.stringify({id:t.id,target:h,policy:R?null:d}),_=c.current?.tuple===$?c.current:{tuple:$,id:crypto.randomUUID()};return c.current=_,le({op:"team.publish",teamId:t.id,requestId:_.id,...h?{visibility:"org",tenantId:h}:{},...R?{}:d})},onSuccess:()=>{S.invalidateQueries({queryKey:Ms})}});if(!l||!o&&(k.length>0||P))return null;const U=!i||!p.isSuccess||!!R||!!L||!!P||!!h&&!E;return e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"outline",disabled:!i||!p.isSuccess,onClick:()=>{u(!0),b(null),f(St()),c.current=null,C.reset()},children:s("ui.hub.subscriptions.preview_publish")}),e.jsx(zt,{open:o,onOpenChange:$=>{C.isPending||u($)},children:e.jsxs(Ht,{onOpenAutoFocus:$=>{$.preventDefault(),v.current?.focus()},children:[e.jsxs(Kt,{children:[e.jsx(Wt,{children:s("ui.hub.subscriptions.preview_publish")}),e.jsx(Vt,{children:s("ui.hub.skills.initial_policy_description")})]}),e.jsx("label",{htmlFor:`${n}-target`,className:"text-body-sm text-ink",children:x}),e.jsxs("select",{id:`${n}-target`,disabled:C.isPending||C.isSuccess,value:h??"",className:"rounded-md border border-control bg-surface px-3 py-2 text-body-sm text-ink",onChange:$=>{b($.target.value||null),f(St()),c.current=null},children:[e.jsx("option",{value:"",children:s("ui.hub.links.source_public")}),j.map($=>e.jsx("option",{value:$.tenant_id,children:$.tenant_name},$.tenant_id))]}),L?e.jsx("p",{className:"text-body-sm text-warning",children:s("ui.hub.subscriptions.source_separation",{currentSource:ht(L),newSource:x})}):P?e.jsx("p",{className:"text-body-sm text-warning",children:s("ui.hub.links.source_unavailable")}):R?e.jsx(Us,{link:R}):e.jsx(ya,{value:d,onChange:f,source:x,item:t.name,visibility:h?"org":"public",organization:E?.tenant_name??null,destinationKey:`${t.id}:${h??"public"}`,canEnableAutoPush:!1,disabled:U||C.isPending||C.isSuccess}),p.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:s("ui.hub.links.load_failed")}),C.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:s("ui.hub.links.action_failed",{direction:s("ui.hub.links.direction_push"),item:t.name,source:x})}),C.isSuccess&&e.jsx("output",{className:"text-body-sm text-ink",children:va(C.data)?s("ui.hub.links.published",{item:t.name,source:x}):s("ui.hub.skills.policy_pending")}),e.jsxs(Gt,{children:[e.jsx(I,{ref:v,variant:"outline",disabled:C.isPending,onClick:()=>u(!1),children:s("ui.hub.subscriptions.cancel")}),e.jsx(I,{disabled:U||C.isPending||C.isSuccess,onClick:()=>C.mutate(),children:s("ui.hub.links.confirm_publish")})]})]})})]})}function We(t){return{description:t?.description??"",manager:t?.manager??"manager",members:(t?.members??[]).map(n=>({...n,count:ts(n),key:crypto.randomUUID()})),instructions:t?.instructions??"",project:t?.project??""}}function $l(t,n){const a={};return n.description!==t.description&&(a.description=n.description),n.manager!==t.manager&&(a.manager=n.manager),JSON.stringify(n.members.map(Dt))!==JSON.stringify(t.members.map(Dt))&&(a.members=n.members.map(({key:i,...l})=>l)),n.instructions!==t.instructions&&(a.instructions=n.instructions),n.project!==t.project&&(a.project=n.project),a}function ws(t,n,a){return(t.kind==="agent"?(n??[]).map(l=>l.name):(a??[]).map(l=>l.name)).includes(t.role)}function Dl(t){return(t??[]).reduce((n,a)=>n+ts(a),0)}function ts(t){return t.count||1}function vn(t){return s("ui.agents.teams.member_count",{count:Dl(t)})}function Ss(t){const n=t.tier.value?s("ui.agents.models.reading.tier_layer",{tier:t.tier.value,source:s(yn(t.tier.source))}):null;return t.model.value?{value:t.model.value,layer:n}:t.available?{value:s("ui.agents.models.reading.session_model"),layer:n}:{value:s("ui.agents.models.reading.not_resolved"),layer:n}}function Es(t){const{requested:n,value:a,source:i}=t.effort,l=s(Ll(i));return n==="auto"?{value:s("ui.agents.models.reading.effort_auto"),layer:s("ui.agents.models.source.model_default")}:a&&n&&a!==n?{value:s("ui.agents.models.reading.effort_clamped",{requested:n,value:a}),layer:l}:a?{value:a,layer:l}:{value:s("ui.agents.models.reading.effort_default"),layer:i==="model_default"?null:l}}function Ol(t){return t.tier.value?s(yn(t.tier.source)):null}function Cs(t,n,a){return t.layer?s(a,{value:t.value,layer:t.layer}):s(n,{value:t.value})}function Rs(t){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"block truncate text-body-sm text-ink",title:t.value,children:t.value}),t.layer?e.jsx("span",{className:"block truncate text-meta text-ink-dim",title:t.layer,children:t.layer}):null]})}function Is(t){return JSON.stringify({...t,members:t.members.map(Dt)})}function Ls(){return e.jsxs("colgroup",{children:[e.jsx("col",{}),e.jsx("col",{className:"w-24"}),e.jsx("col",{className:"w-16"})]})}function As({team:t,agents:n,teams:a,askEnabled:i,onSaved:l,onCancelCreate:o,onOpenAgent:u,onAskAgent:h,onDirtyChange:b,belowHeader:d}){Z();const f=!t,[c,v]=r.useState(f),[p,g]=r.useState(t?.name??""),[j,E]=r.useState(()=>We(t)),[x,k]=r.useState(()=>We(t)),[R,L]=r.useState(!1),[P,S]=r.useState(null),[C,U]=r.useState(null),[$,_]=r.useState(!1),[N,H]=r.useState(!1),z=r.useRef(t?.definition_revision),w=r.useRef(null),A=r.useRef(null),W=r.useRef(null),ae=r.useRef(null),K=r.useRef(!1);r.useEffect(()=>{fn()&&requestAnimationFrame(()=>w.current?.focus())},[]);const me=qt();Z();const V=bt(),oe=t?.name??a?.[0]?.name??null,X=Fn(oe,!!oe),Q=Al(X),te=Q==="available",F=X.data&&X.data.team===t?.name?X.data:null,q=f?!!(p.trim()||x.description||x.members.length):Is(x)!==Is(j);r.useEffect(()=>(b?.((f||c)&&q),()=>b?.(!1)),[b,f,c,q]),r.useEffect(()=>{if(c&&q)return;const y=We(t);E(y),k(y)},[t,c,q]),r.useEffect(()=>{if(!K.current)return;K.current=!1;const y=ae.current;typeof y?.scrollIntoView=="function"&&y.scrollIntoView({block:"nearest"})});const ce=()=>{if(f){o?.();return}v(!1),S(null),U(null),_(!1),z.current=t?.definition_revision;const y=We(t);E(y),k(y)};Xt(()=>{if($){_(!1);return}q?_(!0):ce()},c);const ge=async y=>{if(y?.preventDefault(),!R){if(f&&!p.trim()){S("Give the team a name."),U("name"),W.current?.focus();return}if(f&&/[\\/\s]/.test(p.trim())){S("Names cannot contain spaces or slashes."),U("name"),W.current?.focus();return}if(f&&(a??[]).some(T=>T.name===p.trim())){S(`A team called “${p.trim()}” already exists. Open it to change it, or choose another name.`),U("name"),W.current?.focus();return}if(f&&!x.instructions.trim()){S("Give the team instructions."),U("instructions"),A.current?.focus();return}L(!0),S(null),U(null);try{const T=t?await le({op:"teams.update",name:t.name,requestId:crypto.randomUUID(),fields:$l(j,x),expectedDefinitionRevision:z.current}):await le({op:"teams.create",requestId:crypto.randomUUID(),fields:{name:p,description:x.description,manager:x.manager,members:x.members.map(({key:Y,...M})=>M),instructions:x.instructions,project:x.project}}),se=We(T);E(se),k(se),H(!1),z.current=T.definition_revision,v(!1),l(T.name),X.refetch(),V.invalidateQueries({queryKey:["desktop","team"]}),Ne(f?s("ui.notices.agents.created_named",{name:T.name}):s("ui.notices.agents.saved",{name:T.name})),f&&gn(),requestAnimationFrame(()=>w.current?.focus())}catch(T){if(T?.code==="local-concurrent-edit"){H(!0),S(null),U(null);return}const Y=Ye(T instanceof Error?T.message:"The team could not be saved.");S(Y.message),U(Y.field),ct(Y.message)}finally{L(!1)}}},fe=(y,T)=>k(se=>({...se,members:se.members.map((Y,M)=>M===y?{...Y,...T}:Y)})),D=(y,T)=>k(se=>({...se,members:se.members.map((Y,M)=>M===y?El(Y,T):Y)})),be=x.members.length?x.members:t?.members,Ee=t?Ps(t):"New team",ue=x.members.some(y=>y.kind==="team");return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-3",children:[e.jsxs("div",{className:"min-w-0 flex-[1_1_16rem] space-y-1",children:[e.jsx("h2",{ref:w,tabIndex:-1,title:Ee,className:"truncate text-title focus:outline-none",children:Ee}),t?e.jsxs("p",{className:"text-body-sm text-ink-muted",children:[vn(be),ue?" · Includes a team":""]}):null]}),t&&!c?e.jsxs("div",{className:G("flex shrink-0 items-center gap-2",Qt,i&&"-mr-3"),children:[e.jsx(I,{variant:"primary",onClick:()=>{Ut.getState().stageDraft({kind:"team",name:t.name}),me("/chat")},children:s("ui.agents.teams.action.new_chat")}),e.jsx(Tl,{team:t}),e.jsx(I,{variant:"secondary",onClick:()=>{z.current=t.definition_revision,v(!0)},children:s("ui.agents.detail.action.edit")}),i?e.jsx(I,{variant:"ghost",onClick:()=>h(`Change the team ${t.name}: `),children:s("ui.agents.detail.action.ask_change")}):null]}):null]}),P&&!C?e.jsxs(pe,{variant:"danger",role:"alert","data-testid":"team-save-error",children:[e.jsx(xe,{children:s("ui.agents.detail.alert.save_failed_title")}),e.jsx(je,{children:P})]}):null]}),d,c&&N?e.jsxs(pe,{variant:"warning","data-testid":"team-conflict",children:[e.jsx(xe,{children:s("ui.hub.conflict.title")}),e.jsxs(je,{children:[e.jsx("span",{className:"block",children:s("ui.hub.conflict.body")}),e.jsx(I,{variant:"secondary",size:"sm",className:"mt-2",onClick:ce,children:s("ui.hub.conflict.reload")})]})]}):null,e.jsx("form",{noValidate:!0,onSubmit:y=>{y.preventDefault(),ge(y)},className:"space-y-8",children:f||c?e.jsxs(e.Fragment,{children:[f?e.jsxs(J,{title:s("ui.agents.detail.field.name"),description:"How you and your chats will refer to this team.",children:[e.jsx(Se,{label:"Team name",htmlFor:"team-name",error:C==="name"?P:null}),e.jsx(Ue,{ref:W,id:"team-name","data-testid":"team-name-input",value:p,required:!0,maxLength:64,autoFocus:!0,"aria-invalid":C==="name",onChange:y=>g(y.target.value)})]}):null,e.jsx(J,{title:s("ui.agents.teams.section.manager"),description:"The agent that leads the chat and decides who works on what.",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Se,{label:"Manager agent",htmlFor:"team-manager",error:C==="manager"?P:null}),e.jsx(gt,{ariaLabel:"Manager agent",showLabel:!1,placeholder:s("ui.agents.teams.field.manager_placeholder"),busyLabel:"Loading agents",options:Pe(n,a),selected:Pe(n,a).find(y=>y.id===x.manager)??null,onSelect:y=>k(T=>({...T,manager:y.id})),onCustomSubmit:y=>k(T=>({...T,manager:y})),listNotice:"Agents and teams on this machine"}),Pe(n,a).some(y=>y.id===x.manager)?null:e.jsx(ke,{variant:"warning","data-testid":"team-manager-missing",children:s("ui.agents.teams.empty.not_found_name",{name:x.manager})})]})}),e.jsxs(J,{title:s("ui.agents.teams.section.members"),description:"Who the manager can delegate to, how many of each, and the model each runs on.",children:[e.jsx("p",{"data-testid":"team-override-scope",className:"text-meta text-ink-muted",children:s("ui.agents.models.override.scope_hint")}),f&&!oe?e.jsx("p",{"data-testid":"team-override-no-probe",className:"text-meta text-ink-muted",children:s("ui.agents.models.reading.no_probe_hint")}):null,Q==="unavailable"?e.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[e.jsx("p",{className:"text-meta text-danger",children:s("ui.agents.models.reading.read_failed")}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>void X.refetch(),children:s("ui.agents.models.reading.try_again")})]}):null,e.jsxs("div",{className:"space-y-4",children:[x.members.map((y,T)=>{const se=!ws(y,n,a),Y=Cl(F??void 0,y);return e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_8rem_auto_auto] items-center gap-x-2 gap-y-1",children:[e.jsx("div",{className:"min-w-0",children:e.jsx(gt,{ariaLabel:`Member ${T+1}`,showLabel:!1,placeholder:s("ui.agents.teams.field.member_placeholder"),busyLabel:"Loading agents",options:[...Pe(n,a).filter(M=>y.kind==="team"?M.group==="Teams":M.group==="Agents")],selected:Pe(n,a).find(M=>M.id===y.role)??null,onSelect:M=>fe(T,{role:M.id,kind:M.group==="Teams"?"team":"agent"}),onCustomSubmit:M=>fe(T,{role:M})})}),e.jsxs(at,{value:y.kind,onValueChange:M=>fe(T,{kind:M}),children:[e.jsx(it,{"aria-label":`Member ${T+1} kind`,className:"w-full",children:e.jsx(lt,{})}),e.jsxs(rt,{children:[e.jsx(Ie,{value:"agent",children:s("ui.agents.teams.kind.agent")}),e.jsx(Ie,{value:"team",children:s("ui.agents.teams.kind.team")})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{variant:"secondary",size:"icon-sm","aria-label":`One fewer ${y.role}`,disabled:y.count<=1,onClick:()=>fe(T,{count:y.count-1}),children:e.jsx(ga,{"aria-hidden":"true"})}),e.jsx("span",{className:"min-w-6 text-center text-body-sm tabular-nums","aria-label":`${y.count} of ${y.role}`,children:y.count}),e.jsx(I,{variant:"secondary",size:"icon-sm","aria-label":`One more ${y.role}`,disabled:y.count>=16,onClick:()=>fe(T,{count:y.count+1}),children:e.jsx(qs,{"aria-hidden":"true"})})]}),e.jsx(I,{variant:"ghost",onClick:()=>k(M=>({...M,members:M.members.filter(($e,he)=>he!==T)})),children:s("ui.agents.teams.action.remove")}),se?e.jsx(ke,{variant:"warning",className:"col-span-full w-fit",children:s("ui.agents.teams.empty.not_found_name",{name:y.role})}):null,te?e.jsxs("div",{className:"col-span-full grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] items-end gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:"text-meta text-ink-dim",children:s("ui.agents.models.override.tier_field")}),e.jsxs(at,{value:Ns(y.tier),onValueChange:M=>D(T,{tier:M}),children:[e.jsx(it,{"aria-label":s("ui.agents.models.override.tier_label",{member:y.role||`Member ${T+1}`}),className:"w-full",children:e.jsx(lt,{})}),e.jsxs(rt,{children:[e.jsx(Ie,{value:Je,children:s("ui.agents.models.override.inherit_tier")}),_l.map(M=>e.jsx(Ie,{value:M,children:M},M))]})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:"text-meta text-ink-dim",children:s("ui.agents.models.override.effort_field")}),e.jsxs(at,{value:Ns(y.effort),onValueChange:M=>D(T,{effort:M}),children:[e.jsx(it,{"aria-label":s("ui.agents.models.override.effort_label",{member:y.role||`Member ${T+1}`}),className:"w-full",children:e.jsx(lt,{})}),e.jsxs(rt,{children:[e.jsx(Ie,{value:Je,children:s("ui.agents.models.override.inherit_effort")}),Nl.map(M=>e.jsx(Ie,{value:M,children:M==="auto"?s("ui.agents.models.override.auto"):M},M))]})]})]})]}):null,Y?e.jsxs("div",{className:"col-span-full flex flex-wrap items-baseline gap-x-3 gap-y-1 text-meta",children:[e.jsx("span",{className:"text-ink-dim",children:s("ui.agents.models.reading.saved_label")}),e.jsx("span",{className:"text-ink-muted",children:Cs({value:Ss(Y).value,layer:Ol(Y)},"ui.agents.models.reading.model_cell","ui.agents.models.reading.model_cell_layer")}),e.jsx("span",{className:"text-ink-muted",children:Cs(Es(Y),"ui.agents.models.reading.effort_cell","ui.agents.models.reading.effort_cell_layer")})]}):null,Y&&!Y.available?e.jsxs("div",{className:"col-span-full",children:[e.jsx("p",{"data-testid":"team-member-unavailable",className:"text-meta text-danger",children:s("ui.agents.models.reading.unavailable_editor",{member:Y.role||`Member ${T+1}`,reason:Y.reason})}),e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.models.reading.unavailable_hint")})]}):null]},y.key)}),e.jsx(I,{ref:ae,variant:"secondary",onClick:()=>{K.current=!0,k(y=>({...y,members:[...y.members,{role:"",count:1,kind:"agent",key:crypto.randomUUID()}]}))},children:s("ui.agents.teams.action.add_member")})]})]}),e.jsxs(J,{title:s("ui.agents.teams.section.description"),children:[e.jsx(Se,{label:"What this team is for",htmlFor:"team-description",error:C==="description"?P:null}),e.jsx(Ue,{id:"team-description",value:x.description,onChange:y=>k(T=>({...T,description:y.target.value}))})]}),e.jsxs(J,{title:s("ui.agents.teams.section.collaboration"),children:[C==="instructions"?e.jsx("p",{className:"text-meta text-danger",role:"alert","data-testid":"team-instructions-error",children:P}):null,e.jsx(At,{ref:A,"aria-label":s("ui.agents.teams.action.collaboration_aria"),"aria-invalid":C==="instructions",className:"min-h-36",maxLength:8e3,value:x.instructions,onChange:y=>k(T=>({...T,instructions:y.target.value}))})]}),e.jsx(J,{title:s("ui.agents.teams.section.project_brief"),children:e.jsx(At,{"aria-label":s("ui.agents.teams.action.project_brief_aria"),className:"min-h-36",maxLength:8e3,value:x.project,onChange:y=>k(T=>({...T,project:y.target.value}))})}),e.jsx(jt,{submit:!0,confirming:$,onConfirmingChange:_,dirty:q,pending:R,saveLabel:f?"Create team":"Save changes",pendingLabel:f?"Creating…":"Saving…",dirtyHint:"Discard this team?",onSave:()=>void ge(),onCancel:ce})]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{title:s("ui.agents.teams.section.manager"),children:e.jsxs(_t,{className:"table-fixed","aria-label":s("ui.agents.teams.field.manager_aria"),children:[e.jsx(Ls,{}),e.jsx(Nt,{className:"sr-only",children:e.jsxs(Te,{children:[e.jsx(_e,{children:s("ui.agents.teams.col.member")}),e.jsx(_e,{children:s("ui.agents.teams.col.type")}),e.jsx(_e,{children:s("ui.agents.teams.col.count")})]})}),e.jsx(wt,{children:e.jsxs(Te,{className:"border-0",children:[e.jsx(ve,{className:"px-0 py-2",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(I,{variant:"link",className:G("-my-0.5 min-w-0 justify-start truncate",Jt),onClick:()=>u(x.manager),children:x.manager}),Pe(n,a).some(y=>y.id===x.manager)?null:e.jsx(ke,{variant:"warning","data-testid":"team-manager-missing",children:s("ui.agents.teams.empty.not_found")})]})}),e.jsx(ve,{className:"px-2 py-2 text-ink-dim text-meta",children:s("ui.agents.teams.kind.agent")}),e.jsx(ve,{})]})})]})}),e.jsxs(J,{title:s("ui.agents.teams.section.members"),children:[e.jsxs(_t,{className:"table-fixed","aria-label":s("ui.agents.teams.section.members_aria"),children:[e.jsx(Ls,{}),e.jsx(Nt,{className:"sr-only",children:e.jsxs(Te,{children:[e.jsx(_e,{children:s("ui.agents.teams.col.member")}),e.jsx(_e,{children:s("ui.agents.teams.col.type")}),e.jsx(_e,{children:s("ui.agents.teams.col.count")})]})}),e.jsx(wt,{children:(t?.members??[]).map(y=>e.jsxs(Te,{className:"last:border-0",children:[e.jsx(ve,{className:"px-0 py-2 text-ink",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate",children:y.role}),ws(y,n,a)?null:e.jsx(ke,{variant:"warning","data-testid":"team-member-missing",children:s("ui.agents.teams.empty.not_found")})]})}),e.jsx(ve,{className:"px-2 py-2 text-ink-dim text-meta",children:y.kind==="team"?"Team":"Agent"}),e.jsx(ve,{className:"px-0 py-2 text-right text-ink-muted tabular-nums",children:`×${ts(y)}`})]},`${y.kind}:${y.role}`))})]}),Q==="unavailable"?e.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[e.jsx("p",{className:"text-meta text-danger",children:s("ui.agents.models.reading.read_failed")}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>void X.refetch(),children:s("ui.agents.models.reading.try_again")})]}):null]}),te&&F?.members.length?e.jsxs(J,{title:s("ui.agents.models.reading.title"),description:s("ui.agents.models.reading.description"),children:[e.jsx("p",{className:"text-meta text-ink-muted",children:s("ui.agents.models.override.scope_hint")}),X.isFetching?e.jsx("p",{"data-testid":"team-effective-refreshing",className:"text-meta text-ink-dim",children:s("ui.agents.models.reading.refreshing")}):null,e.jsxs(_t,{className:G("table-fixed",X.isFetching&&"opacity-60"),"aria-label":s("ui.agents.models.reading.title"),children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:"w-24"}),e.jsx("col",{}),e.jsx("col",{className:"w-32"})]}),e.jsx(Nt,{children:e.jsxs(Te,{children:[e.jsx(_e,{className:"px-0",children:s("ui.agents.models.reading.member_col")}),e.jsx(_e,{className:"px-2",children:s("ui.agents.models.reading.model_col")}),e.jsx(_e,{className:"px-0",children:s("ui.agents.models.reading.effort_col")})]})}),e.jsx(wt,{children:F.members.map(y=>e.jsxs(r.Fragment,{children:[e.jsxs(Te,{className:y.available?"last:border-0":"border-0",children:[e.jsx(ve,{className:"px-0 py-2",children:e.jsx("span",{className:"block truncate text-body-sm text-ink",title:y.role,children:y.role})}),e.jsx(ve,{className:"px-2 py-2",children:Rs(Ss(y))}),e.jsx(ve,{className:"px-0 py-2",children:Rs(Es(y))})]}),y.available?null:e.jsx(Te,{className:"last:border-0",children:e.jsxs(ve,{colSpan:3,className:"px-0 pb-2",children:[e.jsx("span",{"data-testid":"team-effective-unavailable",className:"block text-meta text-danger",children:s("ui.agents.models.reading.unavailable",{member:y.role,reason:y.reason})}),e.jsx("span",{className:"block text-meta text-ink-muted",children:s("ui.agents.models.reading.unavailable_hint")})]})})]},`${y.kind}:${y.role}`))})]})]}):null,e.jsx(J,{title:s("ui.agents.teams.section.what_for"),children:e.jsx(we,{text:t?.description??"",empty:"No description yet."})}),t?.instructions?e.jsx(J,{title:s("ui.agents.teams.section.collaboration"),children:e.jsx(we,{text:t.instructions})}):null,t?.project?e.jsx(Ge,{summary:"Project brief",children:e.jsx(we,{text:t.project})}):null]})})]})}function Pe(t,n){return[...(t??[]).map(a=>({id:a.name,name:a.name,description:a.description,group:"Agents"})),...(n??[]).map(a=>({id:a.name,name:a.name,description:a.description,group:"Teams"}))]}const Pl=r.lazy(()=>Bn(()=>import("./legacy-agents-page-0ZCLAr7P.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(t=>({default:t.LegacyAgentsPage}))),Fs=/^subagents\.models\.([^.]+)$/,Ml=["lo","med","hi"],Bl={backend:"ui.agents.skills.composer.gate_backend",none:"ui.agents.skills.composer.gate_none","not-installed":"ui.agents.skills.composer.gate_not_installed","read-only":"ui.agents.skills.composer.gate_read_only"},Ts={all:"ui.agents.pages.scope.all",custom:"ui.agents.pages.scope.custom",installed:"ui.agents.pages.scope.installed",builtin:"ui.agents.pages.scope.builtin"},Ul={all:"ui.agents.pages.empty.agents",custom:"ui.agents.pages.empty.custom",installed:"ui.agents.pages.empty.installed",builtin:"ui.agents.pages.empty.builtin"};function ql(t){return!t||t.getAttribute("role")!=="tab"||t.getAttribute("aria-selected")==="true"?t:t.closest('[role="tablist"]')?.querySelector('[role="tab"][aria-selected="true"]')??null}function ar(){Z();const{agentId:t}=oa(),[n,a]=Os(),i=n.get("kind")==="skill",l=n.get("kind")==="team"||n.get("create")==="team",o=n.has("create"),u=n.get("name"),h=n.get("duplicate"),b=pt(),{isAuthenticated:d}=Pt(),f=ee(b.data,"skill_library"),c=i&&f&&!o,v=ee(b.data,l?"team_catalogue":"profile_catalogue"),p=Tn(v),g=$n(v),j=zi({enabled:f,linksEnabled:ee(b.data,"hub_links"),updatesEnabled:ee(b.data,"hub_updates")}),E=jn(!!j.library.error,j.library.isFetching),x=qi(c?n.get("name"):null,f),k=v&&!!u&&!o&&!i,R=ss(l?null:u,k),L=Dn(l?u:null,k),P=ss(l?null:h,!!h),[S,C]=r.useState(""),[U,$]=r.useState("all"),[_,N]=r.useState("all"),H=ee(b.data,"skill_write"),z=sn(b.data),[w,A]=r.useState(0),[W,ae]=r.useState(null),[K,me]=r.useState(null),V=ki(),oe=ie(m=>m.marks),X=ie(m=>m.clearMark),Q=xt({queryKey:["desktop","settings","effort-tiers"],enabled:v,queryFn:()=>le({op:"settings.list"}),staleTime:6e4}),te=r.useMemo(()=>(Q.data?.settings??[]).filter(m=>{const B=m.key.match(Fs)?.[1];return!B||!Ml.includes(B)?!1:typeof m.value=="string"&&m.value.trim().length>0}).map(m=>m.key.match(Fs)?.[1]).filter(m=>!!m),[Q.data]),F=Zn(),q=r.useCallback(m=>Xn(m,F),[F]),ce=r.useMemo(()=>Vl(p.data,S,U,q),[p.data,S,U,q]),re=r.useMemo(()=>Gl(g.data,S),[g.data,S]),ge=l?re:ce,fe=Si(Oi(j.cards,_),S,es),D=i&&!f?null:u??null,[be,Ee]=r.useState(null);be!==null&&be.name!==D&&Ee(null);const ue=r.useCallback(m=>{const B=new URLSearchParams,ne=m.kind??(c?"skill":l?"team":"agent");ne==="team"&&B.set("kind","team"),ne==="skill"&&B.set("kind","skill"),m.name&&B.set("name",m.name),m.create!==null&&m.create!==void 0&&B.set("create",m.create),m.duplicate&&B.set("duplicate",m.duplicate),ae(null),a(B)},[l,c,a]),y=`${c?"skill":l?"team":"agent"}:${o??""}:${D??""}`,T=r.useCallback(m=>me(m?y:null),[y]),se=K!==null&&K===y,Y=(m,B,ne,yt=!0)=>e.jsxs(e.Fragment,{children:[e.jsx(rl,{kind:m,name:B,localId:ne,enabled:ee(b.data,"hub_links"),itemsById:ee(b.data,"hub_items_by_id")}),m==="skill"&&(!yt||ee(b.data,"hub_links"))?null:e.jsx(_a,{kind:m,name:B,enabled:ee(b.data,"hub_updates")&&!ee(b.data,"hub_links")})]}),M=r.useRef(null),$e=r.useRef(null),he=r.useRef(null),de=r.useCallback(m=>{if(se){const B=$e.current,ne=document.activeElement;M.current=B?.isConnected&&B.closest("form")?B:ne instanceof HTMLElement?ne:null,ae(m);return}ue(m)},[se,ue]),He=r.useCallback(()=>{ae(null);const m=M.current;requestAnimationFrame(()=>{const B=ql(m);B?.isConnected&&B.focus()})},[]),ye=W!==null;r.useEffect(()=>{if(!ye)return;js(!0,()=>ae(null)),he.current?.focus();const m=requestAnimationFrame(()=>{const ne=he.current?.closest('[role="alertdialog"]');ne&&!ne.contains(document.activeElement)&&he.current?.focus()}),B=ne=>{ne.key!=="Escape"||ne.defaultPrevented||(ne.preventDefault(),He())};return window.addEventListener("keydown",B),()=>{cancelAnimationFrame(m),window.removeEventListener("keydown",B),js(!1)}},[ye,He]),r.useEffect(()=>{const m=B=>{B.key!=="Escape"||B.defaultPrevented||window.matchMedia("(max-width: 999px)").matches&&(!D&&!o||se||ye||(B.preventDefault(),de({name:null})))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[de,D,o,se,ye]),r.useEffect(()=>{const B=ie.getState().about;if(!B)return;const ne=c?"skill":l?"team":"agent";D&&B.kind===ne&&B.name===D||(V.setAbout(null),Pa(B))},[D,l,c,V]);const Le=c&&D?j.cards.find(m=>m.name===D)??null:null,Ce=$i(z,Le);r.useEffect(()=>{if(!c||!D||Ce!==null)return;const m=ie.getState().about;m?.kind==="skill"&&m.name===D||V.setAbout({kind:"skill",name:D})},[c,D,Ce,V]),r.useEffect(()=>{D&&X({kind:c?"skill":l?"team":"agent",name:D})},[D,l,c,X]);const De=r.useRef(null);r.useEffect(()=>{const m=De.current;De.current=c?D:null,!(!c||D||!m)&&requestAnimationFrame(()=>{const B=document.activeElement;B&&B!==document.body||[...document.querySelectorAll("[data-testid]")].find(ne=>ne.dataset.testid===`skill-row-${m}`)?.focus()})},[c,D]);const Ae=()=>{p.refetch(),g.refetch(),D&&(l?L.refetch():R.refetch())};if(t)return e.jsx(r.Suspense,{fallback:e.jsx("p",{className:"p-6 text-body",children:s("ui.agents.pages.loading_saved")}),children:e.jsx(Pl,{})});const Oe=l?L.error:R.error,Fe=l?g.error:p.error,Ke=!c&&v&&!Fe&&!o&&!D,O=l?L.isLoading:R.isLoading;return e.jsxs("div",{"data-glass-region":"canvas","data-glass-split":"",className:"panel-flush flex min-h-0 flex-1 bg-canvas text-ink",children:[e.jsxs("aside",{"data-open":D?"true":void 0,"data-glass-region":"page-sidebar",className:"panel-top-pad flex w-72 shrink-0 flex-col gap-3 bg-surface px-4 pb-4 max-[999px]:data-[open=true]:hidden",children:[e.jsx("h1",{className:"pt-4 text-heading",children:s("ui.agents.pages.heading")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(fa,{value:c?"skill":l?"team":"agent",onValueChange:m=>de({kind:m,name:null}),children:e.jsxs(ha,{"aria-label":s("ui.agents.pages.browse_aria"),className:"w-full",children:[e.jsx(It,{value:"agent",testId:"agents-tab",icon:e.jsx(ea,{className:"size-3.5"}),label:s("ui.agents.pages.tab.agents"),count:p.data?.length??null,compact:f}),e.jsx(It,{value:"team",testId:"teams-tab",icon:e.jsx(On,{className:"size-3.5"}),label:s("ui.agents.pages.tab.teams"),count:g.data?.length??null,compact:f}),f?e.jsx(It,{value:"skill",testId:"skills-tab",noPanel:!0,compact:!0,icon:e.jsx(Pn,{className:"size-3.5"}),label:s("ui.agents.skills.tab"),count:j.library.data?j.cards.length:null}):null]})}),e.jsxs("div",{className:"relative",children:[e.jsx(Mn,{"aria-hidden":"true",className:"pointer-events-none absolute top-2 start-2 size-4 text-ink-dim"}),e.jsx(Ue,{className:"ps-8",type:"search","aria-label":c?s("ui.agents.skills.search_aria"):s("ui.agents.pages.search_aria"),placeholder:c?s("ui.agents.skills.search"):l?s("ui.agents.pages.search.teams"):s("ui.agents.pages.search.agents"),value:S,onChange:m=>C(m.target.value)})]}),!l&&!c&&p.data?e.jsxs("fieldset",{className:"m-0 min-w-0 border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:s("ui.agents.pages.scope_legend")}),e.jsx("div",{"data-glass-well":"",className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Object.keys(Ts).map(m=>e.jsx(I,{variant:"ghost",size:"sm","aria-pressed":U===m,onClick:()=>$(m),className:G("flex-1",U===m&&ut),children:s(Ts[m])},m))})]}):null,c&&j.library.data?e.jsxs("fieldset",{className:"m-0 min-w-0 border-0 p-0",children:[e.jsx("legend",{className:"sr-only",children:s("ui.agents.skills.scope_legend")}),e.jsx("div",{"data-glass-well":"",className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:Di.map(m=>e.jsx(I,{variant:"ghost",size:"sm","aria-pressed":_===m,"data-testid":`skills-scope-${m}`,onClick:()=>N(m),className:G("flex-1",_===m&&ut),children:s(ml[m])},m))})]}):null]}),e.jsx("div",{"data-lo-pane-edge-cues":!0,className:"min-h-0 flex-1 overflow-y-auto",children:c?e.jsx(hl,{loading:j.library.isLoading,failed:!!j.library.error,cards:fe,total:j.cards.length,search:S,scope:_,selected:D,join:j.join,marked:new Map(oe.map(m=>[us(m),m.created])),onOpen:m=>de({name:m})}):Fe?null:!p.data&&!g.data?e.jsx(hn,{}):ge.length===0?e.jsx("p",{className:"px-1 py-2 text-body-sm text-ink-muted",children:S?s("ui.agents.pages.empty.search",{query:S}):l?s("ui.agents.pages.empty.teams"):s(Ul[U])}):e.jsx(Wl,{rows:ge,name:o?null:D,teamMode:l,printName:q,marked:new Map(oe.map(m=>[us(m),m.created])),onOpen:m=>de({name:m})})}),e.jsx(Hl,{teamMode:l,className:G(c&&"hidden"),disabled:!v,onClick:()=>de({create:l?"team":"agent"})})]}),e.jsxs("main",{"data-glass-region":"canvas-content",className:"panel-top-pad flex min-w-0 flex-1 flex-col",children:[D||o?e.jsx("div",{className:"flex shrink-0 items-center border-hairline border-b px-4 py-2 min-[1000px]:hidden",children:e.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>de({name:null}),children:[e.jsx(ta,{className:"size-4"}),s("ui.agents.pages.back_to_list")]})}):null,e.jsx("div",{"data-agents-pane":!0,onFocus:m=>{m.target instanceof HTMLElement&&($e.current=m.target)},"data-lo-pane-edge-cues":!0,className:G("min-h-0 flex-1 overflow-auto",Ke?void 0:"px-4 pt-6 [scroll-padding-bottom:calc(var(--lo-pane-footer-h)+var(--lo-pane-footer-cue-h)+4px)] [scrollbar-gutter:stable_both-edges]"),children:Ke?e.jsx(zl,{teamMode:l,run:V,onAddManually:()=>de({create:l?"team":"agent"})}):e.jsx("div",{className:Ot,children:e.jsx("div",{className:Qe,children:c?j.library.error?e.jsx("div",{ref:E.holder,children:e.jsx(ot,{title:s("ui.agents.skills.error.title"),what:j.library.error instanceof Error&&j.library.error.message?j.library.error.message:s("ui.agents.skills.error.what_fallback"),meaning:s("ui.agents.skills.error.meaning"),onRetry:()=>{E.onPress(),j.library.refetch()},retrying:j.library.isFetching,retryLabel:s("ui.common.actions.retry"),retryingLabel:s("ui.agents.skills.retrying")})}):D?e.jsx(yl,{name:D,card:Le,join:j.join,detail:x,onRetry:()=>void x.refetch(),writesEnabled:H,askEnabled:z,onDirtyChange:T,belowHeader:Le?.source==="hub"?Y("skill",D,void 0,Le.installed):void 0,onAsk:m=>{et(V,{kind:"skill",name:m},Js({kind:"skill",name:m})),A(B=>B+1)},hubSignedIn:d,downloadEnabled:ee(b.data,"hub_skills"),onRemoved:(m,B)=>{if(B){requestAnimationFrame(()=>document.querySelector('[data-testid="skill-detail"] h2')?.focus());return}const ne=fe.findIndex(yt=>yt.name===m);De.current=fe[ne+1]?.name??fe[ne-1]?.name??null,ue({name:null})}},D):j.library.isLoading||j.cards.length===0?null:e.jsx("p",{className:"text-body-sm text-ink-muted","data-testid":"skills-select-prompt",children:H?s("ui.agents.skills.select_prompt_editable"):s("ui.agents.skills.select_prompt")}):v?Fe?e.jsx(ot,{title:l?"Teams could not be read":"Agents could not be read",what:Fe instanceof Error?Fe.message:"The request did not complete.",meaning:"Nothing is lost. This is a read that failed — the backend answered an error, which is different from the backend being out of date.",onRetry:Ae,retrying:p.isFetching||g.isFetching}):D&&O?e.jsx(ft,{}):D&&Oe?e.jsx(ot,{title:l?`“${D}” could not be read`:`“${D}” could not be read`,what:Oe instanceof Error?Oe.message:"The request did not complete.",meaning:"The definition may have been removed, or the backend refused the read.",onRetry:()=>{R.refetch(),L.refetch()},retrying:R.isFetching||L.isFetching}):o&&l?e.jsx(As,{agents:p.data,teams:g.data,askEnabled:V.enabled,onDirtyChange:T,onSaved:m=>{Ae(),ue({name:m})},onCancelCreate:()=>ue({name:null}),onOpenAgent:m=>de({kind:"agent",name:m}),onAskAgent:m=>{et(V,{kind:"team",name:u??""},m)}},"team:create"):o&&h&&P.isLoading?e.jsx(ft,{}):o?e.jsx(sl,{initial:P.data??null,takenNames:(p.data??[]).map(m=>m.name),effortTiers:te,onDirtyChange:T,onSaved:m=>{Ae(),ue({name:m})},onCancel:()=>ue({name:null})},"agent:create"):l&&L.data?e.jsx(As,{team:L.data,agents:p.data,teams:g.data,askEnabled:V.enabled,onDirtyChange:T,belowHeader:Y("team",L.data.name,L.data.id),onSaved:m=>{Ae(),ue({name:m})},onOpenAgent:m=>de({kind:"agent",name:m}),onAskAgent:m=>{et(V,{kind:"team",name:L.data?.name??""},m)}},yi(L.data)):!l&&R.data?e.jsx(tl,{profile:R.data,displayedName:q(R.data.name),classNotice:be?.name===R.data.name?be.copy:null,onClassNotice:m=>Ee(m?{name:R.data.name,copy:m}:null),teams:g.data,effortTiers:te,askEnabled:V.enabled,onDirtyChange:T,belowHeader:Y("agent",R.data.name,R.data.agent_id??void 0),onSaved:m=>{Ae(),ue({name:m})},onDuplicate:m=>de({create:"agent",duplicate:m.name}),onOpenTeam:m=>de({kind:"team",name:m}),onAskAgent:m=>{et(V,{kind:"agent",name:R.data?.name??""},m)}},ji(R.data)):D?e.jsx(Me,{className:"h-6 w-40"}):null:e.jsxs(pe,{variant:b.isLoading?"neutral":"warning",className:"max-w-xl",children:[e.jsx(xe,{children:b.isLoading?"Connecting to the backend":b.error?"The backend could not be reached":"Reusable agents need a newer backend"}),e.jsx(je,{children:b.isLoading?"Loading what this backend can do…":b.error?b.error.message:"Update the backend to manage reusable agents and teams. Saved chats are unchanged."})]})})})}),W?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-hairline border-t bg-surface px-4 py-3",role:"alertdialog","aria-label":s("ui.agents.detail.action.discard_question"),children:[e.jsx("span",{className:"text-body-sm text-ink",children:l?s("ui.agents.pages.discard_bar.team"):s("ui.agents.pages.discard_bar.agent")}),e.jsx(I,{variant:"danger",onClick:()=>{me(null),ue(W)},children:s("ui.agents.detail.action.discard_changes")}),e.jsx(I,{ref:he,variant:"ghost",onClick:He,children:s("ui.agents.detail.action.keep_editing")})]}):null,Ke?null:e.jsx("div",{className:"shrink-0 bg-canvas",children:e.jsx(Qs,{run:V,about:c?V.about?.kind==="skill"?V.about:null:V.about,onClearAbout:()=>V.setAbout(null),skill:c,focusToken:c?w:0,blockedReason:se?"Finish or cancel your edit first.":c&&Ce!==null?s(Bl[Ce]):null})})]})]})}function It({value:t,testId:n,icon:a,label:i,count:l,compact:o,noPanel:u=!1}){return e.jsxs(pa,{value:t,"data-testid":n,...u?{"aria-controls":void 0}:{},title:l===null?i:`${i} ${l}`,className:G("min-w-0",o?"flex-auto px-2":"flex-1"),children:[o?null:a,e.jsx("span",{className:"min-w-0 truncate","data-testid":`${n}-label`,children:i}),l===null?null:e.jsx("span",{className:G("min-w-[2ch] font-normal text-ink-dim tabular-nums",o&&"sr-only"),children:l})]})}function zl({teamMode:t,run:n,onAddManually:a}){Z();const i=G(Ot,$s);return e.jsxs("div",{className:"flex min-h-full flex-col justify-center space-y-4 pb-12",children:[e.jsx("div",{className:i,children:e.jsx(Kl,{teamMode:t})}),e.jsx(Qs,{run:n,hero:!0,about:n.about,onClearAbout:()=>n.setAbout(null)}),e.jsx("div",{className:i,children:e.jsx("div",{className:Qe,children:e.jsx(I,{variant:"ghost",className:"-ml-3",onClick:a,children:t?s("ui.agents.pages.ask.manual_team"):s("ui.agents.pages.ask.manual_agent")})})})]})}function Hl({teamMode:t,className:n,disabled:a,onClick:i}){return Z(),e.jsxs(I,{variant:"ghost",className:G("w-full justify-start",n),disabled:a,onClick:i,children:[e.jsx(qs,{className:"size-4"}),t?s("ui.agents.pages.add_manual.team"):s("ui.agents.pages.add_manual.agent")]})}function Kl({teamMode:t}){return Z(),e.jsxs("div",{className:G(Qe,"space-y-2"),children:[e.jsx("h2",{className:"text-title",children:t?s("ui.agents.pages.ask.heading_team"):s("ui.agents.pages.ask.heading_agent")}),e.jsx("p",{className:"text-body text-ink-muted",children:t?s("ui.agents.pages.ask.body_team"):s("ui.agents.pages.ask.body_agent")})]})}function Wl({rows:t,name:n,teamMode:a,marked:i,printName:l,onOpen:o}){const u=r.useRef(new Map),[h,b]=r.useState(n),d=c=>"members"in c?Ps(c):l(c.name),f=(c,v)=>{const p=t.findIndex(j=>j.name===c);if(p<0)return;const g=t[Math.min(t.length-1,Math.max(0,p+v))];g&&(b(g.name),u.current.get(g.name)?.focus())};return e.jsx("ul",{"aria-label":a?"Teams":"Agents",className:"space-y-0.5",children:t.map(c=>{const v="source"in c,p=i.get(`${a?"team":"agent"}:${c.name}`);return e.jsx("li",{children:e.jsxs("button",{ref:g=>{g?u.current.set(c.name,g):u.current.delete(c.name)},type:"button","aria-current":c.name===n?"true":void 0,tabIndex:c.name===(h??t[0]?.name)?0:-1,"data-testid":`roster-row-${c.name}`,title:c.description?`${d(c)} - ${c.description}`:d(c),className:G("flex min-h-12 w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-start hover:bg-row-hover",c.name===n&&ut),onFocus:()=>b(c.name),onClick:()=>o(c.name),onKeyDown:g=>{g.key==="ArrowDown"?(g.preventDefault(),f(c.name,1)):g.key==="ArrowUp"?(g.preventDefault(),f(c.name,-1)):g.key==="Home"?(g.preventDefault(),f(c.name,-t.length)):g.key==="End"&&(g.preventDefault(),f(c.name,t.length))},children:[e.jsxs("span",{className:"flex w-full items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-body-sm text-ink",children:d(c)}),p!==void 0?e.jsx(ke,{variant:"attention","data-testid":"roster-row-updated",children:p?"New":"Updated"}):null,e.jsx("span",{className:"ms-auto shrink-0 text-meta text-ink-dim tabular-nums",children:"members"in c?vn(c.members):e.jsx(Gi,{source:c.source,appearance:"text"})})]}),e.jsxs("span",{className:"flex min-h-lh w-full items-baseline text-meta text-ink-muted",children:[v&&Ze(c)==="proactive"?e.jsxs("span",{className:"me-1 shrink-0","data-testid":"roster-row-proactive",children:[e.jsx("span",{className:"text-ink",children:Zs.proactive}),e.jsx("span",{className:"text-ink-dim",children:" ·"})]}):null,c.description?e.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.description}):e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink-dim",children:s("ui.agents.detail.no_description")})]})]})},c.name)})})}function Vl(t,n,a,i){const l=n.trim().toLowerCase();return(t??[]).filter(o=>a==="builtin"&&o.source!=="builtin"||a==="installed"&&o.source!=="installed"||a==="custom"&&o.source!=="custom"?!1:l?i(o.name).toLowerCase().includes(l)||o.name.toLowerCase().includes(l)||(o.description??"").toLowerCase().includes(l):!0)}function Gl(t,n){const a=n.trim().toLowerCase();return(t??[]).filter(i=>!a||i.name.toLowerCase().includes(a)||(i.label??"").toLowerCase().includes(a)||(i.description??"").toLowerCase().includes(a))}export{Hl as AddManuallyButton,ar as AgentsPage,Kl as AskPaneCopy};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-CccvxpxI.js";import{B as o}from"./index-CJecPbzP.js";import"./messages-L4id_Ryc.js";import"./path-utils-iOrDaMni.js";import"./error-boundary-Ddujf9jK.js";import"./conversation-input-sync-B43QzK-n.js";import"./console-mirror-BRY8oE4K.js";const u=()=>r.jsx(o,{tabScope:"all",requestScope:"all",hostSessionId:null,isRoutePage:!0,surfaceTag:"browser-route",dockSurfaceTag:"browser-approvals-dock"});export{u as BrowserPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,C as n}from"./mermaid.core-DTB7E8bD.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-A2AXSNBT-D2tqnzB0.js";import{_ as i}from"./mermaid.core-DTB7E8bD.js";import"./chunk-RZ5BOZE2-D4_t9t1x.js";import"./conversation-input-sync-B43QzK-n.js";import"./index-CccvxpxI.js";import"./messages-L4id_Ryc.js";import"./path-utils-iOrDaMni.js";import"./error-boundary-Ddujf9jK.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-A2AXSNBT-D2tqnzB0.js";import{_ as i}from"./mermaid.core-DTB7E8bD.js";import"./chunk-RZ5BOZE2-D4_t9t1x.js";import"./conversation-input-sync-B43QzK-n.js";import"./index-CccvxpxI.js";import"./messages-L4id_Ryc.js";import"./path-utils-iOrDaMni.js";import"./error-boundary-Ddujf9jK.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./_baseUniq-_66zsZEt.js";var e=4;function a(o){return r(o,e)}export{a as c};
|