cezarion 0.19.0-dev.8751 → 0.19.0-dev.8762
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/package.json +3 -3
- package/web/dist/assets/{accounts-section-BJPI6m7z.js → accounts-section-DhS7blSK.js} +1 -1
- package/web/dist/assets/activity-motion-aJkLHTxc.js +1 -0
- package/web/dist/assets/{activity-route-42fC7Mxs.js → activity-route-D2sff_BA.js} +1 -1
- package/web/dist/assets/{agent-config-section-C74gGUgR.js → agent-config-section-C7SMwOgZ.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-lpKgMMNk.js → agent-defaults-section-CvMgsSLY.js} +1 -1
- package/web/dist/assets/{appearance-NUe0p0BF.js → appearance-44RH8bum.js} +1 -1
- package/web/dist/assets/{automations-route-B-f1XBAk.js → automations-route-CygHw9Ni.js} +1 -1
- package/web/dist/assets/{commit-list-U-OxWHN-.js → commit-list-Djmz3j1l.js} +1 -1
- package/web/dist/assets/{diff-DZWO3IkH.js → diff-ByLut7n4.js} +2 -2
- package/web/dist/assets/{diff-controls-CSkIE9yB.js → diff-controls-BEVRwCau.js} +1 -1
- package/web/dist/assets/{diff-view-Zt6DGbX2.js → diff-view-kvjafBI7.js} +1 -1
- package/web/dist/assets/{file-preview-DKpgJH2C.js → file-preview-Ce0Jsxbm.js} +1 -1
- package/web/dist/assets/{git-toolbar-DLTYN21M.js → git-toolbar-Cn1ASnMZ.js} +1 -1
- package/web/dist/assets/{github-Cn5ODryx.js → github-CxYmUkO9.js} +1 -1
- package/web/dist/assets/{global-activity-route-5usGSS4S.js → global-activity-route-ALFcEqug.js} +2 -2
- package/web/dist/assets/{index-BEnkhnIC.js → index-BZr8Y74X.js} +4 -4
- package/web/dist/assets/index-D9L-uSh4.css +1 -0
- package/web/dist/assets/{markdown-B2ioG8t9.js → markdown-BRNtAZkY.js} +1 -1
- package/web/dist/assets/{notifications-section-1cYsj6Kt.js → notifications-section-C_IsaiyD.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-B1k-xMeW.js → preview-pane-connected-DzajVDzR.js} +2 -2
- package/web/dist/assets/{projects-section-B9MczGec.js → projects-section-Cme2qWcF.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-B6B3YiYG.js → prompt-templates-section-DVr3aKc-.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-CNoeqtGO.js → remote-settings-notice-BFeWL9QB.js} +1 -1
- package/web/dist/assets/{repo-git-DfuenTj0.js → repo-git-C3YNr0yL.js} +1 -1
- package/web/dist/assets/{report-reader-CfpyZKZF.js → report-reader-Bm0J3ujk.js} +1 -1
- package/web/dist/assets/{reports-HWxwI40r.js → reports-CNL2zChD.js} +1 -1
- package/web/dist/assets/{resources-section-EsUWF8Gp.js → resources-section-BymE7-3T.js} +1 -1
- package/web/dist/assets/{review-panel-my4q8xfO.js → review-panel-3oSwii0J.js} +1 -1
- package/web/dist/assets/{run-header-DfEfupCk.css → run-header-BXO2nM0A.css} +1 -1
- package/web/dist/assets/run-header-CI49Lba9.js +2 -0
- package/web/dist/assets/{select-BC0GRtWk.js → select-DEqrvCmQ.js} +1 -1
- package/web/dist/assets/{session-context-section-Cc7O57OB.js → session-context-section-oK9zU15I.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-2VsJyFCR.js → settings-agent-picker-BqRDs5nQ.js} +1 -1
- package/web/dist/assets/{settings-shell-DoYsgDvs.js → settings-shell-11SRBczO.js} +1 -1
- package/web/dist/assets/{sidebar-section-CJg8mwiE.js → sidebar-section-DujeUKJ0.js} +1 -1
- package/web/dist/assets/{skills-BJicAwPH.js → skills-B6vquPg1.js} +1 -1
- package/web/dist/assets/{task-changes-59Qa1bEL.js → task-changes-t473lMAF.js} +1 -1
- package/web/dist/assets/{task-commits-BGtVyWPE.js → task-commits-CuXxfPY6.js} +1 -1
- package/web/dist/assets/{task-file-scope-CYLbdb6B.js → task-file-scope-DK1biohR.js} +1 -1
- package/web/dist/assets/{task-files-DKGtV-H2.js → task-files-C0zhDxod.js} +1 -1
- package/web/dist/assets/{task-github-item-KzGyb9nv.js → task-github-item-CFU1Rbv0.js} +1 -1
- package/web/dist/assets/{task-thread-DpmaZvjj.js → task-thread-1BQ5lWbM.js} +2 -2
- package/web/dist/assets/{task-thread-PDeU-fL6.css → task-thread-1mNL_5FP.css} +1 -1
- package/web/dist/assets/{thread-state-BLwfKLzD.js → thread-state-BHI3Jijs.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-Dx4mIAAl.js → use-hand-to-agent-state-BHAhGcZe.js} +1 -1
- package/web/dist/assets/{workflows-a73JJd3t.js → workflows-BMlXKiaH.js} +1 -1
- package/web/dist/assets/{workspace-tools-D1ZIqE9E.js → workspace-tools-CsrBXG_p.js} +1 -1
- package/web/dist/assets/{worktrees-section-CJuySRx_.js → worktrees-section-DvFx6o_A.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/activity-motion-C0kwg24F.js +0 -1
- package/web/dist/assets/index-CHtuekzK.css +0 -1
- package/web/dist/assets/run-header-BOp4d2LA.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-slot=main]:has([data-route=task-thread]){min-block-size:0;min-inline-size:0;overflow:hidden}[data-route=task-thread]{block-size:100%;min-block-size:0;min-inline-size:0;overflow:clip}[data-route=task-thread] [data-slot=thread-workspace]{flex:1 1 0;min-block-size:0;min-inline-size:0;display:flex;overflow:clip}[data-route=task-thread] [data-slot=thread-main]{flex-direction:column;flex:1 1 0;min-block-size:0;min-inline-size:0;display:flex;position:relative;overflow:clip}[data-route=task-thread] [data-slot=thread-transcript]{overscroll-behavior-block:contain;flex:1 1 0;min-block-size:0;min-inline-size:0;scroll-padding-block:12px 56px;overflow:hidden auto}[data-route=task-thread] [data-slot=thread-transcript]:focus-visible{outline:2px solid var(--link-foreground);outline-offset:-2px}@media (forced-colors:active){[data-route=task-thread] [data-slot=thread-transcript]:focus-visible{outline-color:highlight}}[data-route=task-thread] [data-slot=thread-activity-sidebar]{overscroll-behavior-block:contain;border-inline-start:1px solid var(--border);background:var(--card);flex:0 0 320px;min-block-size:0;overflow-y:auto}.session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding-block:0 10px;padding-inline:12px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content;gap:8px;min-inline-size:0;display:grid}.session-engine-controls [data-slot$=pill]{inline-size:100%;min-inline-size:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-inline-start:auto}.session-engine-controls [data-slot=session-runner-value]{inline-size:100%;min-inline-size:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-block:0 12px;padding-inline:12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-inline-size:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;block-size:44px;inline-size:44px}.session-composer [data-slot=follow-up-model-pill]{min-block-size:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-inline-start:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}.session-composer [data-slot=composer-toolbar]:has([data-folded]){grid-template-columns:auto minmax(0,1fr) auto}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=session-controls]{grid-area:1/2;align-self:center}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-footer-start]{grid-area:1/1}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-submit-row]{grid-area:1/3}[data-slot=run-actions-menu] [role^=menuitem]{min-block-size:44px}[data-route=task-thread] [data-slot=thread-dock]{z-index:10;border-block-start:1px solid var(--border);background:var(--background);flex:none;position:relative;container:thread-dock/inline-size}[data-route=task-thread] [data-slot=thread-jump]{margin-block-end:8px;padding-inline:16px;position:absolute;inset-block-end:100%;inset-inline:0}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(60dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - var(--spacing) * 5.5));max-block-size:var(--thread-footer-limit);min-block-size:0;min-inline-size:0}[data-route=task-thread] [data-slot=thread-footer-content]>:not([data-slot=thread-composer-slot]):not(:has([data-slot=ask-card])):not([data-slot=review-panel]){flex-shrink:0}[data-route=task-thread] [data-slot=thread-footer-content]>:has([data-slot=ask-card]){flex-direction:column;flex:0 auto;min-block-size:0;min-inline-size:0;display:flex}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=thread-composer-slot]{flex-direction:column;flex:0 auto;min-block-size:0;inline-size:100%;min-inline-size:0;display:flex}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=thread-composer-slot][hidden]{display:none}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=composer]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 24px);flex-direction:column;flex:0 auto;inline-size:100%;min-inline-size:0;display:flex}[data-route=task-thread] [data-slot=composer-editor]{flex-direction:column;min-block-size:0;display:flex;overflow-y:auto}[data-route=task-thread] [data-slot=composer-editor]>textarea{flex-shrink:1;min-block-size:44px}[data-route=task-thread] [data-slot=composer-thumbs]{flex-wrap:nowrap;flex-shrink:0;max-block-size:60px;overflow:auto}[data-route=task-thread] [data-slot=composer-toolbar]{flex-shrink:0}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-panel],[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-banner],[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-actions]{min-block-size:0;max-block-size:var(--thread-footer-limit)}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-banner]{overscroll-behavior-block:contain;overflow-y:auto}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-notes]{overscroll-behavior-block:contain;max-block-size:min(24dvh,180px);overflow-y:auto}[data-route=task-thread] [data-slot=thread-dock] [data-slot=ask-card]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 24px);flex-direction:column;flex:0 auto;display:flex;overflow:clip}[data-route=task-thread] [data-slot=ask-body]{overscroll-behavior-block:contain;flex:auto;min-block-size:0;overflow-y:auto}@media (width>=768px){[data-route=task-thread] [data-slot=thread-jump]{padding-inline:64px}@container thread-dock (width<=680px){[data-slot=thread-dock]>[data-slot=thread-footer-content]{padding-inline:8px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}}@media (width<=767px){[data-slot=run-title-row]>.group{max-inline-size:calc(100% - 52px)}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr)}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}.session-composer [data-slot=composer-toolbar]{padding-block:0 8px}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(50dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - 180px))}[data-route=task-thread][data-compact-viewport=true][data-keyboard-open=true] [data-slot=run-activity-trigger-mobile],[data-route=task-thread][data-compact-viewport=true] [data-slot=paused-hint],[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-header]>span:first-child,[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-hint]{display:none}[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-header],[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-footer]{padding-block:4px}[data-route=task-thread][data-compact-viewport=true] [data-slot=thread-footer-content]{--thread-footer-limit:calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - 24px)}[data-route=task-thread][data-compact-viewport=true] [data-slot=thread-dock] [data-slot=ask-card],[data-route=task-thread][data-compact-viewport=true] [data-slot=thread-footer-content] [data-slot=composer]{max-block-size:var(--thread-footer-limit)}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none;padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-block-end:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-block-start:0;margin-block-start:0;padding-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-block-end:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-block-start:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding-block:calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-block-start:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding-block:calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=session-conversation],[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=thread-dock]>[data-slot=thread-footer-content]{padding-inline:18px}[data-route=task-thread] [data-slot=ask-card]{scroll-margin-block:24px}[data-route=task-thread] [data-slot=composer-submit-row]>button{font-size:13px}
|
|
1
|
+
[data-slot=main]:has([data-route=task-thread]){min-block-size:0;min-inline-size:0;overflow:hidden}[data-route=task-thread]{block-size:100%;min-block-size:0;min-inline-size:0;overflow:clip}[data-route=task-thread] [data-slot=thread-workspace]{flex:1 1 0;min-block-size:0;min-inline-size:0;display:flex;overflow:clip}[data-route=task-thread] [data-slot=thread-main]{flex-direction:column;flex:1 1 0;min-block-size:0;min-inline-size:0;display:flex;position:relative;overflow:clip}[data-route=task-thread] [data-slot=thread-transcript]{overscroll-behavior-block:contain;flex:1 1 0;min-block-size:0;min-inline-size:0;scroll-padding-block:12px 56px;overflow:hidden auto}[data-route=task-thread] [data-slot=thread-transcript]:focus-visible{outline:2px solid var(--link-foreground);outline-offset:-2px}@media (forced-colors:active){[data-route=task-thread] [data-slot=thread-transcript]:focus-visible{outline-color:highlight}}[data-route=task-thread] [data-slot=thread-activity-sidebar]{overscroll-behavior-block:contain;border-inline-start:1px solid var(--border);background:var(--card);flex:0 0 320px;min-block-size:0;overflow-y:auto}.session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding-block:0 10px;padding-inline:12px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content;gap:8px;min-inline-size:0;display:grid}.session-engine-controls [data-slot$=pill]{inline-size:100%;min-inline-size:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-inline-start:auto}.session-engine-controls [data-slot=session-runner-value]{inline-size:100%;min-inline-size:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-block:0 12px;padding-inline:12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-inline-size:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;block-size:44px;inline-size:44px}.session-composer [data-slot=follow-up-model-pill]{min-block-size:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-inline-start:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}.session-composer [data-slot=composer-toolbar]:has([data-folded]){grid-template-columns:auto minmax(0,1fr) auto}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=session-controls]{grid-area:1/2;align-self:center}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-footer-start]{grid-area:1/1}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-submit-row]{grid-area:1/3}[data-slot=run-actions-menu] [role^=menuitem]{min-block-size:44px}[data-route=task-thread] [data-slot=thread-dock]{z-index:10;border-block-start:1px solid var(--border);background:var(--background);flex:none;position:relative;container:thread-dock/inline-size}[data-route=task-thread] [data-slot=thread-jump]{margin-block-end:8px;padding-inline:16px;position:absolute;inset-block-end:100%;inset-inline:0}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(60dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - var(--spacing) * 5.5));max-block-size:var(--thread-footer-limit);min-block-size:0;min-inline-size:0}[data-route=task-thread] [data-slot=thread-footer-content]>:not([data-slot=thread-composer-slot]):not(:has([data-slot=ask-card])):not([data-slot=review-panel]){flex-shrink:0}[data-route=task-thread] [data-slot=thread-footer-content]>:has([data-slot=ask-card]){flex-direction:column;flex:0 auto;min-block-size:0;min-inline-size:0;display:flex}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=thread-composer-slot]{flex-direction:column;flex:0 auto;min-block-size:0;inline-size:100%;min-inline-size:0;display:flex}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=thread-composer-slot][hidden]{display:none}[data-route=task-thread] [data-slot=thread-footer-content] [data-slot=composer]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 24px);flex-direction:column;flex:0 auto;inline-size:100%;min-inline-size:0;display:flex}[data-route=task-thread] [data-slot=composer-editor]{flex-direction:column;min-block-size:0;display:flex;overflow-y:auto}[data-route=task-thread] [data-slot=composer-editor]>textarea{flex-shrink:1;min-block-size:44px}[data-route=task-thread] [data-slot=composer-thumbs]{flex-wrap:nowrap;flex-shrink:0;max-block-size:60px;overflow:auto}[data-route=task-thread] [data-slot=composer-toolbar]{flex-shrink:0}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-panel],[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-banner],[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-actions]{min-block-size:0;max-block-size:var(--thread-footer-limit)}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-banner]{overscroll-behavior-block:contain;overflow-y:auto}[data-route=task-thread] [data-slot=thread-dock] [data-slot=review-notes]{overscroll-behavior-block:contain;max-block-size:min(24dvh,180px);overflow-y:auto}[data-route=task-thread] [data-slot=thread-dock] [data-slot=ask-card]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 24px);flex-direction:column;flex:0 auto;display:flex;overflow:clip}[data-route=task-thread] [data-slot=ask-body]{overscroll-behavior-block:contain;flex:auto;min-block-size:0;overflow-y:auto}@media (width>=768px){[data-route=task-thread] [data-slot=thread-jump]{padding-inline:64px}@container thread-dock (width<=680px){[data-slot=thread-dock]>[data-slot=thread-footer-content]{padding-inline:8px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}}@media (width<=767px){[data-slot=run-title-row]>.group{max-inline-size:calc(100% - 52px)}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr)}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}.session-composer [data-slot=composer-toolbar]{padding-block:0 8px}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(50dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - 180px))}[data-route=task-thread][data-compact-viewport=true][data-keyboard-open=true] [data-mobile-session-bar=true],[data-route=task-thread][data-compact-viewport=true][data-keyboard-open=true] [data-slot=run-activity-trigger-mobile],[data-route=task-thread][data-compact-viewport=true] [data-slot=paused-hint],[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-header]>span:first-child,[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-hint]{display:none}[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-header],[data-route=task-thread][data-compact-viewport=true] [data-slot=ask-footer]{padding-block:4px}[data-route=task-thread][data-compact-viewport=true] [data-slot=thread-footer-content]{--thread-footer-limit:calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - 24px)}[data-route=task-thread][data-compact-viewport=true] [data-slot=thread-dock] [data-slot=ask-card],[data-route=task-thread][data-compact-viewport=true] [data-slot=thread-footer-content] [data-slot=composer]{max-block-size:var(--thread-footer-limit)}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none;padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-block-end:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-block-start:0;margin-block-start:0;padding-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-block-end:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-block-start:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding-block:calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-block-start:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding-block:calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=session-conversation],[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=thread-dock]>[data-slot=thread-footer-content]{padding-inline:18px}[data-route=task-thread] [data-slot=ask-card]{scroll-margin-block:24px}[data-route=task-thread] [data-slot=composer-submit-row]>button{font-size:13px}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{gr as n,hr as r,ti as i}from"./toaster-B0kvcFif.js";import{h as a,p as o,v as s}from"./live-protocol-DMhTnCmf.js";import{t as c}from"./createLucideIcon-BHp8sXmF.js";import{t as l}from"./app-window-CSHwDX9N.js";import{t as u}from"./play-CmVAj_fu.js";import{i as d,n as ee,o as te,r as ne}from"./tool-display-B9NN44oU.js";import{t as re}from"./square-terminal-B6RYYieR.js";import{t as ie}from"./button-B7MKxYjT.js";import{t as ae}from"./status-dot-BRzVlF2X.js";import{a as oe,o as se}from"./format-BU7D3IfE.js";import{ar as ce,f,p}from"./index-BEnkhnIC.js";var m=c(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),h=e(),g={registered:e=>e.server.answeredAtRegistration?{label:`Open`,run:!1}:{label:`Run and open`,run:!0},adopted:()=>({label:`Open`,run:!1}),starting:()=>({label:`Open`,run:!1}),up:()=>({label:`Open`,run:!1}),stalled:()=>({label:`View`,run:!1}),exited:()=>({label:`Start again`,run:!0}),stopped:()=>({label:`Start again`,run:!0}),unavailable:()=>void 0};function _(e){let{text:t,...n}=p(e),r={...n,status:t},i=g[e.state](e);return i?{...r,action:i}:r}var v={"Run and open":u,Open:l,View:ce,"Start again":te};function y({entry:e,inPreview:n,onOpen:r}){let{server:i}=e,a=_(e),o=e.state===`unavailable`,s=r?a.action:void 0,c=f(i.command),l=oe(i.registeredAt);return(0,h.jsxs)(`div`,{"data-slot":`preview-server-card`,"data-state":e.state,className:t(`min-w-0 rounded-lg border border-border bg-card px-3.5 py-3 text-sm`,o&&`text-muted-foreground`),children:[(0,h.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2 text-xs text-soft-foreground`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono`,children:[(0,h.jsx)(m,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`truncate`,children:`cezar_preview_serve`})]}),o?(0,h.jsx)(`span`,{children:`worktree removed`}):l?(0,h.jsx)(`span`,{children:se(l)}):null]}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-2`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(ae,{tone:a.tone,shape:a.ring?`ring`:`filled`,pulse:a.pulse===!0,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`font-semibold text-foreground`,children:i.label}),(0,h.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[`:`,i.port]}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:a.status})]}),(0,h.jsx)(le,{entry:e,inPreview:n,action:s,onOpen:r})]}),(0,h.jsxs)(`div`,{className:`mt-2.5 min-w-0 rounded-md bg-muted px-3 py-2 font-mono text-xs`,children:[(0,h.jsx)(`p`,{className:`break-words whitespace-pre-wrap text-foreground`,children:i.command}),i.cwd?(0,h.jsxs)(`p`,{className:`mt-1 flex gap-3 text-soft-foreground`,children:[(0,h.jsx)(`span`,{children:`cwd`}),(0,h.jsx)(`span`,{className:`break-all`,children:i.cwd})]}):null]}),s?.run?(0,h.jsx)(b,{icon:(0,h.jsx)(re,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),children:`${s.label===`Start again`?`Starting again`:`Opening`} runs ${c} in this task's worktree, on the host.`}):null,o?(0,h.jsx)(b,{children:`The worktree this server ran in is gone. Register it again from a new task.`}):null]})}function le({entry:e,inPreview:t,action:n,onOpen:r}){let{server:i}=e,a=t&&n!==void 0&&!n.run,o=a?`In preview`:n?.label,s=a?l:n?v[n.label]:null;return n&&o&&s?(0,h.jsxs)(ie,{variant:a||n.label===`View`||n.label===`Open`&&e.state===`starting`?`outline`:`contrast`,size:`sm`,className:`max-md:h-11 max-md:px-3.5`,onClick:()=>r?.({port:i.port,run:n.run}),children:[(0,h.jsx)(s,{"aria-hidden":`true`}),o]}):null}function b({icon:e,children:t}){return(0,h.jsxs)(`p`,{className:`mt-2.5 flex items-start gap-2 text-xs text-muted-foreground`,children:[e,(0,h.jsx)(`span`,{children:t})]})}function x(e,t){return e.kind===`message`&&e.role===`user`&&e.skillInput?.source===t&&typeof e.skillInput.id==`string`&&e.skillInput.id!==``}function ue(){return{turns:[],itemsById:new Map,turnSeq:0,eventSeq:0,permissions:new Map,conversationEntries:new Map,outcomesByRequest:new Map,seenInputs:new Set,previewByPort:new Map,handedOff:!1}}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(e){return typeof e==`string`?e:void 0}function w(e){let t=typeof e==`string`?new Date(e):void 0;return!t||Number.isNaN(t.getTime())?``:` · ${t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}`}function T(e){if(!(typeof e!=`string`||e===``))return Number.isFinite(new Date(e).getTime())?e:void 0}function de(e){return i.safeParse(e).data}function E(e,t){e.turnSeq+=1;let n={id:t===void 0?`turn-fallback-${e.turnSeq}`:`turn-seq-${t}`,entries:[],v2Items:!1};return e.turns.push(n),n}function D(e){return e.turns.at(-1)??E(e)}function O(e,t){let n={origin:`meta`,entry:t,firstSeq:e.eventSeq,lastSeq:e.eventSeq};return D(e).entries.push(n),n}var k=[/^run failed\s+[—-]\s+/,/^continue failed(?:\s+[—-]\s+|:\s+)/,/^step\s+"[^"]+"\s+failed:\s+/,/^step\s+\S+\s+failed\s+[—-]\s+/],A=/^(?:run failed\s+[—-]\s+|continue failed(?:\s+[—-]\s+|:\s+))/;function j(e){return e.trim().replace(/\s+/g,` `)}function M(e){let t=e.trim(),n=!0;for(;n;){n=!1;for(let e of k){let r=t.replace(e,``).trim();r!==t&&r!==``&&(t=r,n=!0)}}return j(t)}function N(e,t,n){if(t===e.primarySource&&n===e.primaryText||e.draft.entry.kind!==`note`)return;let r=e.draft.entry;r.details?.some(e=>e.source===t&&e.text===n)||(r.details=[...r.details??[],{source:t,text:n}])}function P(e,t,n){let r=e.failures;if(r)for(let e=r.length-1;e>=0;--e){let i=r[e];if(t!==``&&i.cause===t||t===``&&i.fatal&&(n===void 0||i.stepId===void 0||i.stepId===n))return i}}function F(e,t,n){let r=D(e),i=P(r,n.cause,n.stepId);if(i){i.draft.lastSeq=Math.max(i.draft.lastSeq,t.seq),n.fatal&&(i.fatal=!0),n.stepId!==void 0&&i.stepId===void 0&&(i.stepId=n.stepId),N(i,n.source,n.text);return}let a={draft:O(e,{kind:`note`,id:n.id,text:n.text,tone:`danger`}),cause:n.cause,primarySource:n.source,primaryText:n.text,...n.stepId===void 0?{}:{stepId:n.stepId},fatal:n.fatal};r.failures=[...r.failures??[],a]}function I(e,t,n){if(!A.test(n))return!1;let r=e.turns.at(-1);if(!r)return!1;let i=M(n);if(i===``)return!1;let a=P(r,i,C(t.stepId));return a?(a.draft.lastSeq=Math.max(a.draft.lastSeq,t.seq),a.fatal=!0,N(a,`lifecycle`,n),!0):!1}function L(e,t,n){let r=e.turns.at(-1);if(!r)return;let i=P(r,n?M(n):``,C(t.stepId));i&&(i.fatal=!0)}function R(e){for(let t of e.permissions.values())t.status===`pending`&&(t.status=`expired`)}function z(e,t){let n=C(e.stepId);return n===void 0?t:`${n}:${t}`}function B(e,t){t.v2Items=!0;for(let n of t.entries)n.origin===`v1`&&n.entry.kind===`tool`&&e.itemsById.delete(n.entry.id);t.entries=t.entries.filter(e=>!(e.origin===`v1`&&e.entry.kind===`tool`))}function V(e,t,n,r,i,a=!1){let o=n.kind===`message`&&i!==void 0?{...n,ts:i}:{...n};!t.v2Items&&o.kind!==`hook`&&B(e,t);let s=e.itemsById.get(r);if(s&&s.turn===t){s.entry.entry=o,s.entry.lastSeq=e.eventSeq,s.entry.streaming=a;return}let c={origin:`v2`,entry:o,firstSeq:e.eventSeq,lastSeq:e.eventSeq,streaming:a};t.entries.push(c),e.itemsById.set(r,{turn:t,entry:c})}var H={"not-delivered":0,queued:1,delivered:2,consumed:3},fe=[`instruction`,`resumed`,`requestId`,`relationship`,`state`,`createdAt`,`requestHash`,`deadline`];function U(e){let t={};for(let n of fe)e[n]!==void 0&&Object.assign(t,{[n]:e[n]});return t}function W(e,t){if(t.messageKind!==`request`)return;let n=e.outcomesByRequest.get(t.messageId);n&&(t.outcome={status:n.status,...n.replyId===void 0?{}:{replyId:n.replyId},observedAt:n.observedAt})}function pe(e,t){let n=e.conversationEntries.get(t);n&&W(e,n)}function me(e,t,n,r){(H[e.delivery]<H.delivered||H[n]>H[e.delivery])&&(e.delivery=n),t.text!==``&&(e.text=t.text),Object.assign(e,U(t)),r.deliveredAt!==void 0&&(e.deliveredAt=r.deliveredAt),r.consumedAt!==void 0&&(e.consumedAt=r.consumedAt),r.recordedAt!==void 0&&(n===`delivered`||e.delivery!==`delivered`)&&(e.recordedAt=r.recordedAt)}function G(e,t,n,r){let i=e.conversationEntries.get(t.id);if(i){me(i,t,n,r),W(e,i);return}let a={kind:`conversation`,id:`conversation-message:${t.id}`,messageId:t.id,text:t.text,senderRunId:t.senderRunId,recipientRunId:t.recipientRunId,messageKind:t.kind,delivery:n,...r,...U(t)};W(e,a),e.conversationEntries.set(t.id,a),O(e,a)}function he(e,t){let n=w(t.ts),r=C(t.message),i=t.notify===!1?`Stopped notifying the webhook${n}`:`${e.handedOff?`Note sent to webhook`:`Handed off to webhook`}${n}${r?` — ${r}`:``}`;e.handedOff=t.notify!==!1,O(e,{kind:`note`,id:`v1:${t.seq}`,text:i,tone:`dim`,icon:`handoff`})}function ge(e,t){let n=typeof t.attempts==`number`?t.attempts:void 0,r=C(t.webhookName),i=`${r?`Delivery to ${r} failed`:`Webhook delivery failed`}${C(t.event)?` (${C(t.event)})`:``}${n?` after ${n} attempt${n===1?``:`s`}`:``}: ${C(t.error)??`unknown error`}`;O(e,{kind:`note`,id:`v1:${t.seq}`,text:i,tone:`danger`})}function _e(e,t){let n=C(t.webhookName)??`webhook`,r=C(t.title),i=`v1:${t.seq}`;if(t.ok===!1){O(e,{kind:`note`,id:i,text:`Report to ${n} failed: ${C(t.error)??`unknown error`}`,tone:`danger`});return}let a=`${t.dryRun===!0?`Report to ${n} (dry run, nothing sent)`:`Sent report to ${n}`}${w(t.ts)}${r?` — ${r}`:``}`;O(e,t.dryRun===!0?{kind:`note`,id:i,text:a,tone:`dim`}:{kind:`note`,id:i,text:a,tone:`dim`,icon:`handoff`})}function ve(e,t){let n=t.payload??{},r=`Webhook (dry run, nothing sent): ${C(t.event)??`delivery`}${C(n.status)?` · ${C(n.status)}`:``}`;O(e,{kind:`note`,id:`v1:${t.seq}`,text:r,tone:`dim`})}function ye(e,t){let n=r.safeParse(t.server);if(!n.success)return;let i=e.previewByPort.get(n.data.port);i&&(i.turn.entries=i.turn.entries.filter(e=>e!==i.draft));let a=D(e),o={origin:`meta`,firstSeq:t.seq,lastSeq:t.seq,entry:{kind:`preview-server`,id:`preview-server:${n.data.port}`,server:n.data,state:`registered`,stateAt:t.ts}};a.entries.push(o),e.previewByPort.set(n.data.port,{turn:a,draft:o})}function be(e,t){let r=n.safeParse(t.state),i=typeof t.port==`number`?e.previewByPort.get(t.port):void 0;if(!r.success||!i||i.draft.entry.kind!==`preview-server`)return;let{server:a,id:o}=i.draft.entry;i.draft.lastSeq=t.seq,i.draft.entry={kind:`preview-server`,id:o,server:a,state:r.data,stateAt:t.ts,...typeof t.exitCode==`number`?{exitCode:t.exitCode}:{},...t.reason===`user`||t.reason===`idle`?{reason:t.reason}:{}}}function xe(e,t){let n=a.safeParse(t);if(!n.success)return;let{message:r,delivery:i,deliveredAt:o,consumedAt:s,ts:c}=n.data;G(e,r,i,{deliveredAt:o,consumedAt:s,recordedAt:c})}function Se(e,t){let n=s.safeParse(t);if(!n.success)return;let{outcome:r}=n.data,i=e.outcomesByRequest.get(r.requestId);i&&!(i.status===`timed-out`&&r.status===`replied-late`)||(e.outcomesByRequest.set(r.requestId,r),pe(e,r.requestId))}function Ce(e,t){let n=o.safeParse(t);if(!n.success)return;let{input:r}=n.data;if(!e.seenInputs.has(r.id)){if(e.seenInputs.add(r.id),r.conversation){G(e,{id:r.id,text:r.text,createdAt:r.createdAt,...r.conversation},`delivered`,{deliveredAt:r.deliveredAt,recordedAt:n.data.ts});return}O(e,{kind:`note`,id:`agent-input:${r.id}`,text:r.text,tone:`dim`,attribution:{source:r.source,parentRunId:r.parentRunId}})}}function we(e,t){let n=C(t.text)??``,r=e.pendingAsk;e.pendingAsk&&!e.pendingAsk.resolved&&(e.pendingAsk.resolved=!0,e.pendingAsk.answeredBy=`human`,n!==``&&(e.pendingAsk.answer=n),e.pendingAsk=void 0);let i=E(e,t.seq),a=T(t.ts);i.userMessage={text:n,ask:r,imageCount:typeof t.imageCount==`number`?t.imageCount:0,images:Array.isArray(t.images)?t.images.filter(e=>typeof e==`string`):[],...a===void 0?{}:{ts:a}},a!==void 0&&(i.startedAt=a)}function Te(e,t){let n=e.turns.at(-1),r=n&&n.turnId===void 0&&!n.v2Items?n:E(e,t.seq);r.turnId=C(t.turnId),r.startedAt??=T(t.ts)}function Ee(e,t){for(let n=e.turns.length-1;n>=0;--n)if(e.turns[n].turnId===t)return e.turns[n];return e.turns.at(-1)}function De(e,t){R(e);let n=Ee(e,C(t.turnId));if(!n)return;let r=T(t.ts);n.completed={stopReason:C(t.stopReason)??`end_turn`,...typeof t.costUsd==`number`?{costUsd:t.costUsd}:{},...r===void 0?{}:{ts:r}}}var K=new Set([`message`,`reasoning`,`tool`,`hook`]),Oe=e=>K.has(e.kind);function ke(e){if(!(!S(e)||!K.has(e.kind)))return typeof e.id==`string`&&e.id!==``?e:void 0}function q(e,t){let n=ke(t.item);if(!n)return;let r=z(t,n.id),i=e.itemsById.get(r),a=t.type===`item.completed`,o=!a&&(n.kind===`message`||n.kind===`reasoning`);V(e,i?.turn??D(e),n,r,a?T(t.ts):void 0,o)}function Ae(e,t){let n=e.itemsById.get(z(t,C(t.itemId)??``)),r=C(t.delta)??``;if(!n||r===``||!Oe(n.entry.entry))return;let i=n.entry.entry;n.entry.lastSeq=t.seq,t.field===`output`&&i.kind===`tool`?i.output=(i.output??``)+r:t.field!==`output`&&(i.kind===`message`||i.kind===`reasoning`)&&(i.text+=r)}function je(e,t){let n=D(e),r=C(t.text)??``;if(r===``)return;let i=T(t.ts);n.entries.push({origin:`v1`,firstSeq:t.seq,lastSeq:t.seq,entry:{kind:`message`,id:`v1:${t.seq}`,role:`assistant`,text:r,...i===void 0?{}:{ts:i}}})}var Me=new Set([`pending`,`in_progress`,`completed`,`cancelled`]);function Ne(e){if(!S(e)||!Array.isArray(e.todos))return;let t=[];for(let n of e.todos){if(!S(n)||typeof n.content!=`string`)return;t.push({content:n.content,status:Me.has(n.status)?n.status:`pending`,...typeof n.activeForm==`string`?{activeForm:n.activeForm}:{}})}return t}var Pe=new Set([`subAgentActivity`,`collabAgentToolCall`,`collabToolCall`]);function Fe(e,t){let n=D(e),r=C(t.tool)??`Tool`;if(n.v2Items||Pe.has(r))return;let i=ee(r,t.input),a=i.toolKind===`plan`?Ne(t.input):void 0;a!==void 0&&(n.planEntries=a);let o={kind:`tool`,id:C(t.id)??`v1:${t.seq}`,name:r,toolKind:i.toolKind,title:i.title,status:`running`,input:t.input},s={origin:`v1`,entry:o,firstSeq:t.seq,lastSeq:t.seq};n.entries.push(s),e.itemsById.set(o.id,{turn:n,entry:s})}function Ie(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}function Le(e,t){let n=e.itemsById.get(C(t.toolCallId)??``);if(!n||n.turn.v2Items||n.entry.origin!==`v1`)return;let r=n.entry.entry;r.kind===`tool`&&(n.entry.lastSeq=t.seq,r.status=`completed`,r.output=Ie(t.result))}function Re(e,t,n,r){let i=C(t.message)??``;i!==``&&O(e,{kind:`note`,id:n,text:i,tone:r})}function J(e,t){let n=C(t.message)??``;t.type===`lifecycle`&&n!==``&&I(e,t,n)||Re(e,t,`v1:${t.seq}`,t.tone===`danger`?`danger`:`dim`)}function ze(e,t){let n=C(t.message)??``;n!==``&&F(e,t,{id:`v1:${t.seq}`,source:`error`,text:n,cause:M(n),stepId:C(t.stepId),fatal:!1})}function Be(e,t){let n=C(t.message)??``;n!==``&&F(e,t,{id:`v2:${t.seq}`,source:`session.error`,text:n,cause:M(n),stepId:C(t.stepId),fatal:t.fatal===!0})}function Ve(e,t){if(t.status!==`failed`)return;let n=C(t.stepId),r=C(t.error),i=r?` — ${r}`:``;F(e,t,{id:`v1:${t.seq}`,source:`step-end`,text:`step ${n??`?`} failed${i}`,cause:r?M(r):``,stepId:n,fatal:!0})}function He(e,t){let n=C(t.command)??`check`,r=typeof t.exitCode==`number`?t.exitCode:-1;O(e,{kind:`tool`,id:`v1:${t.seq}`,name:`check`,toolKind:`execute`,title:`Ran ${n}`,status:r===0?`completed`:`failed`,output:C(t.text)??``,exitCode:r})}function Ue(e,t){let n=de(t.provider),r=C(t.authFailureId)??``;n===void 0||r.length<1||r.length>128||O(e,{kind:`provider-auth-required`,id:`v1:${t.seq}`,provider:n,authFailureId:r})}function We(e,t){let n=C(t.url);if(n===void 0)return;let r={kind:`image`,id:`v1:${t.seq}`,url:n},i=C(t.name);i!==void 0&&(r.name=i),O(e,r)}function Ge(e,t){Array.isArray(t.entries)&&(D(e).planEntries=t.entries)}function Ke(e,t){R(e);let n=C(t.reason)??`end_turn`,r=C(t.message);n===`error`&&L(e,t,r),e.sessionEnded={reason:n,...r===void 0?{}:{message:r}}}var qe=new Set([`allow_once`,`allow_always`,`reject_once`,`reject_always`]);function Je(e){return S(e)&&typeof e.id==`string`&&e.id!==``&&typeof e.label==`string`&&e.label!==``&&qe.has(e.kind)}function Ye(e){if(!(!Array.isArray(e)||e.length===0||!e.every(Je)))return new Set(e.map(e=>e.id)).size===e.length?e:void 0}function Xe(e,t){let n=C(t.requestId),r=C(t.title),i=Ye(t.options);if(!n||!r||e.permissions.has(n)||!i)return;let a=C(t.itemId),o=C(t.details),s={kind:`permission`,id:`permission:${n}`,requestId:n,title:r,options:i.map(e=>({...e})),status:`pending`,...a===void 0?{}:{itemId:a},...o===void 0?{}:{details:o}};e.permissions.set(n,s),O(e,s)}function Ze(e,t){let n=e.permissions.get(C(t.requestId)??``);if(!n||n.status!==`pending`)return;let r=C(t.optionId);r!==void 0&&n.options.some(e=>e.id===r)?(n.status=`resolved`,n.optionId=r):n.status=`expired`;let i=C(t.reason);i!==void 0&&(n.reason=i)}function Qe(e,t){let n=d(t),r=n&&ne(n);if(!r)return;let i={kind:`ask`,...r,questions:r.questions,resolved:!1};O(e,i),e.pendingAsk=i}function Y(e,t){let n=e.pendingAsk;return n&&!n.resolved&&n.askSeq===t.askSeq?n:void 0}function $e(e,t){let n=Y(e,t);if(!n)return;n.routedToParent=!0;let r=C(t.parentRunId);r!==void 0&&(n.parentRunId=r)}function et(e,t){let n=Y(e,t);n&&(n.routedToParent=!1)}function tt(e,t){let n=Y(e,t);n&&X(e,n,`undeliverable`)}var nt=new Set([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`]);function rt(e,t){let n=Y(e,t);n&&nt.has(t.reason)&&X(e,n,t.reason)}function X(e,t,n){t.resolved=!0,t.closed=n,e.pendingAsk=void 0}function it(e,t){let n=Y(e,t);if(n){if(t.source===`cezar`){X(e,n,`undeliverable`);return}t.source===`parent`&&(n.resolved=!0,n.answeredBy=`parent`,e.pendingAsk=void 0)}}var Z=()=>{},at=new Map([[`handoff`,he],[`webhook.failed`,ge],[`webhook.dry-run`,ve],[`webhook.report`,_e],[`preview.server-registered`,ye],[`preview.server-state`,be],[`conversation-message`,xe],[`request-outcome`,Se],[`agent-input`,Ce],[`user-message`,we],[`turn.started`,Te],[`turn.completed`,De],[`item.started`,q],[`item.updated`,q],[`item.completed`,q],[`item.delta`,Ae],[`text`,je],[`tool-call`,Fe],[`tool-result`,Le],[`note`,J],[`lifecycle`,J],[`error`,ze],[`session.error`,Be],[`step-end`,Ve],[`check-output`,He],[`provider-auth-required`,Ue],[`image`,We],[`plan.updated`,Ge],[`session.started`,e=>R(e)],[`session.ended`,Ke],[`permission.requested`,Xe],[`permission.resolved`,Ze],[`ask.requested`,Qe],[`worker-question-routed`,$e],[`worker-question-fallback`,et],[`worker-question-undelivered`,tt],[`human-ask-closed`,rt],[`human-input-delivered`,it],[`step-start`,Z],[`token-usage`,Z],[`cost`,Z],[`turn-end`,Z],[`done`,Z],[`session`,Z]]);function ot(e,t){e.eventSeq=t.seq,at.get(t.type)?.(e,t)}function st(e){for(let t=e.turns.length-1;t>=0;--t){let n=e.turns[t].planEntries;if(n!==void 0)return n}}function ct(e){let t=[];for(let n of e.turns)for(let e of n.items)if(e.kind===`tool`){for(let n of e.locations??[])t.push(n.path);for(let n of e.diffs??[])t.push(n.path)}let n=new Set;for(let e=t.length-1;e>=0;--e)n.add(t[e]);return[...n]}function lt(e,t){let n=e?.turns.at(-1);if(!n)return!1;let r=M(t);return r!==``&&n.items.some(e=>e.kind===`note`&&e.tone===`danger`&&M(e.text)===r)}function ut(e,t,n){switch(e){case`waiting`:return{state:`waiting`};case`failed`:return{state:`closed`,tone:`danger`,label:t!==void 0&&t!==``&&!lt(n,t)?`Session failed — ${t}`:`Session failed`};case`review`:return{state:`closed`,tone:`dim`,label:`Session closed — waiting for your review`};case`done`:case`cancelled`:return{state:`closed`,tone:`dim`,label:`Session closed`};default:return null}}function Q(e,t){let n=e.replace(/\s*CEZ:DONE\s*$/,``).replace(/\s*CEZ:MONITORING\s*$/,``);if(t){let e=n.trimEnd(),t=e.lastIndexOf(`
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{gr as n,hr as r,ti as i}from"./toaster-B0kvcFif.js";import{h as a,p as o,v as s}from"./live-protocol-DMhTnCmf.js";import{t as c}from"./createLucideIcon-BHp8sXmF.js";import{t as l}from"./app-window-CSHwDX9N.js";import{t as u}from"./play-CmVAj_fu.js";import{i as d,n as ee,o as te,r as ne}from"./tool-display-B9NN44oU.js";import{t as re}from"./square-terminal-B6RYYieR.js";import{t as ie}from"./button-B7MKxYjT.js";import{t as ae}from"./status-dot-BRzVlF2X.js";import{a as oe,o as se}from"./format-BU7D3IfE.js";import{ar as ce,f,p}from"./index-BZr8Y74X.js";var m=c(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),h=e(),g={registered:e=>e.server.answeredAtRegistration?{label:`Open`,run:!1}:{label:`Run and open`,run:!0},adopted:()=>({label:`Open`,run:!1}),starting:()=>({label:`Open`,run:!1}),up:()=>({label:`Open`,run:!1}),stalled:()=>({label:`View`,run:!1}),exited:()=>({label:`Start again`,run:!0}),stopped:()=>({label:`Start again`,run:!0}),unavailable:()=>void 0};function _(e){let{text:t,...n}=p(e),r={...n,status:t},i=g[e.state](e);return i?{...r,action:i}:r}var v={"Run and open":u,Open:l,View:ce,"Start again":te};function y({entry:e,inPreview:n,onOpen:r}){let{server:i}=e,a=_(e),o=e.state===`unavailable`,s=r?a.action:void 0,c=f(i.command),l=oe(i.registeredAt);return(0,h.jsxs)(`div`,{"data-slot":`preview-server-card`,"data-state":e.state,className:t(`min-w-0 rounded-lg border border-border bg-card px-3.5 py-3 text-sm`,o&&`text-muted-foreground`),children:[(0,h.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2 text-xs text-soft-foreground`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-mono`,children:[(0,h.jsx)(m,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`truncate`,children:`cezar_preview_serve`})]}),o?(0,h.jsx)(`span`,{children:`worktree removed`}):l?(0,h.jsx)(`span`,{children:se(l)}):null]}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-2`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(ae,{tone:a.tone,shape:a.ring?`ring`:`filled`,pulse:a.pulse===!0,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`font-semibold text-foreground`,children:i.label}),(0,h.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[`:`,i.port]}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:a.status})]}),(0,h.jsx)(le,{entry:e,inPreview:n,action:s,onOpen:r})]}),(0,h.jsxs)(`div`,{className:`mt-2.5 min-w-0 rounded-md bg-muted px-3 py-2 font-mono text-xs`,children:[(0,h.jsx)(`p`,{className:`break-words whitespace-pre-wrap text-foreground`,children:i.command}),i.cwd?(0,h.jsxs)(`p`,{className:`mt-1 flex gap-3 text-soft-foreground`,children:[(0,h.jsx)(`span`,{children:`cwd`}),(0,h.jsx)(`span`,{className:`break-all`,children:i.cwd})]}):null]}),s?.run?(0,h.jsx)(b,{icon:(0,h.jsx)(re,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),children:`${s.label===`Start again`?`Starting again`:`Opening`} runs ${c} in this task's worktree, on the host.`}):null,o?(0,h.jsx)(b,{children:`The worktree this server ran in is gone. Register it again from a new task.`}):null]})}function le({entry:e,inPreview:t,action:n,onOpen:r}){let{server:i}=e,a=t&&n!==void 0&&!n.run,o=a?`In preview`:n?.label,s=a?l:n?v[n.label]:null;return n&&o&&s?(0,h.jsxs)(ie,{variant:a||n.label===`View`||n.label===`Open`&&e.state===`starting`?`outline`:`contrast`,size:`sm`,className:`max-md:h-11 max-md:px-3.5`,onClick:()=>r?.({port:i.port,run:n.run}),children:[(0,h.jsx)(s,{"aria-hidden":`true`}),o]}):null}function b({icon:e,children:t}){return(0,h.jsxs)(`p`,{className:`mt-2.5 flex items-start gap-2 text-xs text-muted-foreground`,children:[e,(0,h.jsx)(`span`,{children:t})]})}function x(e,t){return e.kind===`message`&&e.role===`user`&&e.skillInput?.source===t&&typeof e.skillInput.id==`string`&&e.skillInput.id!==``}function ue(){return{turns:[],itemsById:new Map,turnSeq:0,eventSeq:0,permissions:new Map,conversationEntries:new Map,outcomesByRequest:new Map,seenInputs:new Set,previewByPort:new Map,handedOff:!1}}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(e){return typeof e==`string`?e:void 0}function w(e){let t=typeof e==`string`?new Date(e):void 0;return!t||Number.isNaN(t.getTime())?``:` · ${t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}`}function T(e){if(!(typeof e!=`string`||e===``))return Number.isFinite(new Date(e).getTime())?e:void 0}function de(e){return i.safeParse(e).data}function E(e,t){e.turnSeq+=1;let n={id:t===void 0?`turn-fallback-${e.turnSeq}`:`turn-seq-${t}`,entries:[],v2Items:!1};return e.turns.push(n),n}function D(e){return e.turns.at(-1)??E(e)}function O(e,t){let n={origin:`meta`,entry:t,firstSeq:e.eventSeq,lastSeq:e.eventSeq};return D(e).entries.push(n),n}var k=[/^run failed\s+[—-]\s+/,/^continue failed(?:\s+[—-]\s+|:\s+)/,/^step\s+"[^"]+"\s+failed:\s+/,/^step\s+\S+\s+failed\s+[—-]\s+/],A=/^(?:run failed\s+[—-]\s+|continue failed(?:\s+[—-]\s+|:\s+))/;function j(e){return e.trim().replace(/\s+/g,` `)}function M(e){let t=e.trim(),n=!0;for(;n;){n=!1;for(let e of k){let r=t.replace(e,``).trim();r!==t&&r!==``&&(t=r,n=!0)}}return j(t)}function N(e,t,n){if(t===e.primarySource&&n===e.primaryText||e.draft.entry.kind!==`note`)return;let r=e.draft.entry;r.details?.some(e=>e.source===t&&e.text===n)||(r.details=[...r.details??[],{source:t,text:n}])}function P(e,t,n){let r=e.failures;if(r)for(let e=r.length-1;e>=0;--e){let i=r[e];if(t!==``&&i.cause===t||t===``&&i.fatal&&(n===void 0||i.stepId===void 0||i.stepId===n))return i}}function F(e,t,n){let r=D(e),i=P(r,n.cause,n.stepId);if(i){i.draft.lastSeq=Math.max(i.draft.lastSeq,t.seq),n.fatal&&(i.fatal=!0),n.stepId!==void 0&&i.stepId===void 0&&(i.stepId=n.stepId),N(i,n.source,n.text);return}let a={draft:O(e,{kind:`note`,id:n.id,text:n.text,tone:`danger`}),cause:n.cause,primarySource:n.source,primaryText:n.text,...n.stepId===void 0?{}:{stepId:n.stepId},fatal:n.fatal};r.failures=[...r.failures??[],a]}function I(e,t,n){if(!A.test(n))return!1;let r=e.turns.at(-1);if(!r)return!1;let i=M(n);if(i===``)return!1;let a=P(r,i,C(t.stepId));return a?(a.draft.lastSeq=Math.max(a.draft.lastSeq,t.seq),a.fatal=!0,N(a,`lifecycle`,n),!0):!1}function L(e,t,n){let r=e.turns.at(-1);if(!r)return;let i=P(r,n?M(n):``,C(t.stepId));i&&(i.fatal=!0)}function R(e){for(let t of e.permissions.values())t.status===`pending`&&(t.status=`expired`)}function z(e,t){let n=C(e.stepId);return n===void 0?t:`${n}:${t}`}function B(e,t){t.v2Items=!0;for(let n of t.entries)n.origin===`v1`&&n.entry.kind===`tool`&&e.itemsById.delete(n.entry.id);t.entries=t.entries.filter(e=>!(e.origin===`v1`&&e.entry.kind===`tool`))}function V(e,t,n,r,i,a=!1){let o=n.kind===`message`&&i!==void 0?{...n,ts:i}:{...n};!t.v2Items&&o.kind!==`hook`&&B(e,t);let s=e.itemsById.get(r);if(s&&s.turn===t){s.entry.entry=o,s.entry.lastSeq=e.eventSeq,s.entry.streaming=a;return}let c={origin:`v2`,entry:o,firstSeq:e.eventSeq,lastSeq:e.eventSeq,streaming:a};t.entries.push(c),e.itemsById.set(r,{turn:t,entry:c})}var H={"not-delivered":0,queued:1,delivered:2,consumed:3},fe=[`instruction`,`resumed`,`requestId`,`relationship`,`state`,`createdAt`,`requestHash`,`deadline`];function U(e){let t={};for(let n of fe)e[n]!==void 0&&Object.assign(t,{[n]:e[n]});return t}function W(e,t){if(t.messageKind!==`request`)return;let n=e.outcomesByRequest.get(t.messageId);n&&(t.outcome={status:n.status,...n.replyId===void 0?{}:{replyId:n.replyId},observedAt:n.observedAt})}function pe(e,t){let n=e.conversationEntries.get(t);n&&W(e,n)}function me(e,t,n,r){(H[e.delivery]<H.delivered||H[n]>H[e.delivery])&&(e.delivery=n),t.text!==``&&(e.text=t.text),Object.assign(e,U(t)),r.deliveredAt!==void 0&&(e.deliveredAt=r.deliveredAt),r.consumedAt!==void 0&&(e.consumedAt=r.consumedAt),r.recordedAt!==void 0&&(n===`delivered`||e.delivery!==`delivered`)&&(e.recordedAt=r.recordedAt)}function G(e,t,n,r){let i=e.conversationEntries.get(t.id);if(i){me(i,t,n,r),W(e,i);return}let a={kind:`conversation`,id:`conversation-message:${t.id}`,messageId:t.id,text:t.text,senderRunId:t.senderRunId,recipientRunId:t.recipientRunId,messageKind:t.kind,delivery:n,...r,...U(t)};W(e,a),e.conversationEntries.set(t.id,a),O(e,a)}function he(e,t){let n=w(t.ts),r=C(t.message),i=t.notify===!1?`Stopped notifying the webhook${n}`:`${e.handedOff?`Note sent to webhook`:`Handed off to webhook`}${n}${r?` — ${r}`:``}`;e.handedOff=t.notify!==!1,O(e,{kind:`note`,id:`v1:${t.seq}`,text:i,tone:`dim`,icon:`handoff`})}function ge(e,t){let n=typeof t.attempts==`number`?t.attempts:void 0,r=C(t.webhookName),i=`${r?`Delivery to ${r} failed`:`Webhook delivery failed`}${C(t.event)?` (${C(t.event)})`:``}${n?` after ${n} attempt${n===1?``:`s`}`:``}: ${C(t.error)??`unknown error`}`;O(e,{kind:`note`,id:`v1:${t.seq}`,text:i,tone:`danger`})}function _e(e,t){let n=C(t.webhookName)??`webhook`,r=C(t.title),i=`v1:${t.seq}`;if(t.ok===!1){O(e,{kind:`note`,id:i,text:`Report to ${n} failed: ${C(t.error)??`unknown error`}`,tone:`danger`});return}let a=`${t.dryRun===!0?`Report to ${n} (dry run, nothing sent)`:`Sent report to ${n}`}${w(t.ts)}${r?` — ${r}`:``}`;O(e,t.dryRun===!0?{kind:`note`,id:i,text:a,tone:`dim`}:{kind:`note`,id:i,text:a,tone:`dim`,icon:`handoff`})}function ve(e,t){let n=t.payload??{},r=`Webhook (dry run, nothing sent): ${C(t.event)??`delivery`}${C(n.status)?` · ${C(n.status)}`:``}`;O(e,{kind:`note`,id:`v1:${t.seq}`,text:r,tone:`dim`})}function ye(e,t){let n=r.safeParse(t.server);if(!n.success)return;let i=e.previewByPort.get(n.data.port);i&&(i.turn.entries=i.turn.entries.filter(e=>e!==i.draft));let a=D(e),o={origin:`meta`,firstSeq:t.seq,lastSeq:t.seq,entry:{kind:`preview-server`,id:`preview-server:${n.data.port}`,server:n.data,state:`registered`,stateAt:t.ts}};a.entries.push(o),e.previewByPort.set(n.data.port,{turn:a,draft:o})}function be(e,t){let r=n.safeParse(t.state),i=typeof t.port==`number`?e.previewByPort.get(t.port):void 0;if(!r.success||!i||i.draft.entry.kind!==`preview-server`)return;let{server:a,id:o}=i.draft.entry;i.draft.lastSeq=t.seq,i.draft.entry={kind:`preview-server`,id:o,server:a,state:r.data,stateAt:t.ts,...typeof t.exitCode==`number`?{exitCode:t.exitCode}:{},...t.reason===`user`||t.reason===`idle`?{reason:t.reason}:{}}}function xe(e,t){let n=a.safeParse(t);if(!n.success)return;let{message:r,delivery:i,deliveredAt:o,consumedAt:s,ts:c}=n.data;G(e,r,i,{deliveredAt:o,consumedAt:s,recordedAt:c})}function Se(e,t){let n=s.safeParse(t);if(!n.success)return;let{outcome:r}=n.data,i=e.outcomesByRequest.get(r.requestId);i&&!(i.status===`timed-out`&&r.status===`replied-late`)||(e.outcomesByRequest.set(r.requestId,r),pe(e,r.requestId))}function Ce(e,t){let n=o.safeParse(t);if(!n.success)return;let{input:r}=n.data;if(!e.seenInputs.has(r.id)){if(e.seenInputs.add(r.id),r.conversation){G(e,{id:r.id,text:r.text,createdAt:r.createdAt,...r.conversation},`delivered`,{deliveredAt:r.deliveredAt,recordedAt:n.data.ts});return}O(e,{kind:`note`,id:`agent-input:${r.id}`,text:r.text,tone:`dim`,attribution:{source:r.source,parentRunId:r.parentRunId}})}}function we(e,t){let n=C(t.text)??``,r=e.pendingAsk;e.pendingAsk&&!e.pendingAsk.resolved&&(e.pendingAsk.resolved=!0,e.pendingAsk.answeredBy=`human`,n!==``&&(e.pendingAsk.answer=n),e.pendingAsk=void 0);let i=E(e,t.seq),a=T(t.ts);i.userMessage={text:n,ask:r,imageCount:typeof t.imageCount==`number`?t.imageCount:0,images:Array.isArray(t.images)?t.images.filter(e=>typeof e==`string`):[],...a===void 0?{}:{ts:a}},a!==void 0&&(i.startedAt=a)}function Te(e,t){let n=e.turns.at(-1),r=n&&n.turnId===void 0&&!n.v2Items?n:E(e,t.seq);r.turnId=C(t.turnId),r.startedAt??=T(t.ts)}function Ee(e,t){for(let n=e.turns.length-1;n>=0;--n)if(e.turns[n].turnId===t)return e.turns[n];return e.turns.at(-1)}function De(e,t){R(e);let n=Ee(e,C(t.turnId));if(!n)return;let r=T(t.ts);n.completed={stopReason:C(t.stopReason)??`end_turn`,...typeof t.costUsd==`number`?{costUsd:t.costUsd}:{},...r===void 0?{}:{ts:r}}}var K=new Set([`message`,`reasoning`,`tool`,`hook`]),Oe=e=>K.has(e.kind);function ke(e){if(!(!S(e)||!K.has(e.kind)))return typeof e.id==`string`&&e.id!==``?e:void 0}function q(e,t){let n=ke(t.item);if(!n)return;let r=z(t,n.id),i=e.itemsById.get(r),a=t.type===`item.completed`,o=!a&&(n.kind===`message`||n.kind===`reasoning`);V(e,i?.turn??D(e),n,r,a?T(t.ts):void 0,o)}function Ae(e,t){let n=e.itemsById.get(z(t,C(t.itemId)??``)),r=C(t.delta)??``;if(!n||r===``||!Oe(n.entry.entry))return;let i=n.entry.entry;n.entry.lastSeq=t.seq,t.field===`output`&&i.kind===`tool`?i.output=(i.output??``)+r:t.field!==`output`&&(i.kind===`message`||i.kind===`reasoning`)&&(i.text+=r)}function je(e,t){let n=D(e),r=C(t.text)??``;if(r===``)return;let i=T(t.ts);n.entries.push({origin:`v1`,firstSeq:t.seq,lastSeq:t.seq,entry:{kind:`message`,id:`v1:${t.seq}`,role:`assistant`,text:r,...i===void 0?{}:{ts:i}}})}var Me=new Set([`pending`,`in_progress`,`completed`,`cancelled`]);function Ne(e){if(!S(e)||!Array.isArray(e.todos))return;let t=[];for(let n of e.todos){if(!S(n)||typeof n.content!=`string`)return;t.push({content:n.content,status:Me.has(n.status)?n.status:`pending`,...typeof n.activeForm==`string`?{activeForm:n.activeForm}:{}})}return t}var Pe=new Set([`subAgentActivity`,`collabAgentToolCall`,`collabToolCall`]);function Fe(e,t){let n=D(e),r=C(t.tool)??`Tool`;if(n.v2Items||Pe.has(r))return;let i=ee(r,t.input),a=i.toolKind===`plan`?Ne(t.input):void 0;a!==void 0&&(n.planEntries=a);let o={kind:`tool`,id:C(t.id)??`v1:${t.seq}`,name:r,toolKind:i.toolKind,title:i.title,status:`running`,input:t.input},s={origin:`v1`,entry:o,firstSeq:t.seq,lastSeq:t.seq};n.entries.push(s),e.itemsById.set(o.id,{turn:n,entry:s})}function Ie(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}function Le(e,t){let n=e.itemsById.get(C(t.toolCallId)??``);if(!n||n.turn.v2Items||n.entry.origin!==`v1`)return;let r=n.entry.entry;r.kind===`tool`&&(n.entry.lastSeq=t.seq,r.status=`completed`,r.output=Ie(t.result))}function Re(e,t,n,r){let i=C(t.message)??``;i!==``&&O(e,{kind:`note`,id:n,text:i,tone:r})}function J(e,t){let n=C(t.message)??``;t.type===`lifecycle`&&n!==``&&I(e,t,n)||Re(e,t,`v1:${t.seq}`,t.tone===`danger`?`danger`:`dim`)}function ze(e,t){let n=C(t.message)??``;n!==``&&F(e,t,{id:`v1:${t.seq}`,source:`error`,text:n,cause:M(n),stepId:C(t.stepId),fatal:!1})}function Be(e,t){let n=C(t.message)??``;n!==``&&F(e,t,{id:`v2:${t.seq}`,source:`session.error`,text:n,cause:M(n),stepId:C(t.stepId),fatal:t.fatal===!0})}function Ve(e,t){if(t.status!==`failed`)return;let n=C(t.stepId),r=C(t.error),i=r?` — ${r}`:``;F(e,t,{id:`v1:${t.seq}`,source:`step-end`,text:`step ${n??`?`} failed${i}`,cause:r?M(r):``,stepId:n,fatal:!0})}function He(e,t){let n=C(t.command)??`check`,r=typeof t.exitCode==`number`?t.exitCode:-1;O(e,{kind:`tool`,id:`v1:${t.seq}`,name:`check`,toolKind:`execute`,title:`Ran ${n}`,status:r===0?`completed`:`failed`,output:C(t.text)??``,exitCode:r})}function Ue(e,t){let n=de(t.provider),r=C(t.authFailureId)??``;n===void 0||r.length<1||r.length>128||O(e,{kind:`provider-auth-required`,id:`v1:${t.seq}`,provider:n,authFailureId:r})}function We(e,t){let n=C(t.url);if(n===void 0)return;let r={kind:`image`,id:`v1:${t.seq}`,url:n},i=C(t.name);i!==void 0&&(r.name=i),O(e,r)}function Ge(e,t){Array.isArray(t.entries)&&(D(e).planEntries=t.entries)}function Ke(e,t){R(e);let n=C(t.reason)??`end_turn`,r=C(t.message);n===`error`&&L(e,t,r),e.sessionEnded={reason:n,...r===void 0?{}:{message:r}}}var qe=new Set([`allow_once`,`allow_always`,`reject_once`,`reject_always`]);function Je(e){return S(e)&&typeof e.id==`string`&&e.id!==``&&typeof e.label==`string`&&e.label!==``&&qe.has(e.kind)}function Ye(e){if(!(!Array.isArray(e)||e.length===0||!e.every(Je)))return new Set(e.map(e=>e.id)).size===e.length?e:void 0}function Xe(e,t){let n=C(t.requestId),r=C(t.title),i=Ye(t.options);if(!n||!r||e.permissions.has(n)||!i)return;let a=C(t.itemId),o=C(t.details),s={kind:`permission`,id:`permission:${n}`,requestId:n,title:r,options:i.map(e=>({...e})),status:`pending`,...a===void 0?{}:{itemId:a},...o===void 0?{}:{details:o}};e.permissions.set(n,s),O(e,s)}function Ze(e,t){let n=e.permissions.get(C(t.requestId)??``);if(!n||n.status!==`pending`)return;let r=C(t.optionId);r!==void 0&&n.options.some(e=>e.id===r)?(n.status=`resolved`,n.optionId=r):n.status=`expired`;let i=C(t.reason);i!==void 0&&(n.reason=i)}function Qe(e,t){let n=d(t),r=n&&ne(n);if(!r)return;let i={kind:`ask`,...r,questions:r.questions,resolved:!1};O(e,i),e.pendingAsk=i}function Y(e,t){let n=e.pendingAsk;return n&&!n.resolved&&n.askSeq===t.askSeq?n:void 0}function $e(e,t){let n=Y(e,t);if(!n)return;n.routedToParent=!0;let r=C(t.parentRunId);r!==void 0&&(n.parentRunId=r)}function et(e,t){let n=Y(e,t);n&&(n.routedToParent=!1)}function tt(e,t){let n=Y(e,t);n&&X(e,n,`undeliverable`)}var nt=new Set([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`]);function rt(e,t){let n=Y(e,t);n&&nt.has(t.reason)&&X(e,n,t.reason)}function X(e,t,n){t.resolved=!0,t.closed=n,e.pendingAsk=void 0}function it(e,t){let n=Y(e,t);if(n){if(t.source===`cezar`){X(e,n,`undeliverable`);return}t.source===`parent`&&(n.resolved=!0,n.answeredBy=`parent`,e.pendingAsk=void 0)}}var Z=()=>{},at=new Map([[`handoff`,he],[`webhook.failed`,ge],[`webhook.dry-run`,ve],[`webhook.report`,_e],[`preview.server-registered`,ye],[`preview.server-state`,be],[`conversation-message`,xe],[`request-outcome`,Se],[`agent-input`,Ce],[`user-message`,we],[`turn.started`,Te],[`turn.completed`,De],[`item.started`,q],[`item.updated`,q],[`item.completed`,q],[`item.delta`,Ae],[`text`,je],[`tool-call`,Fe],[`tool-result`,Le],[`note`,J],[`lifecycle`,J],[`error`,ze],[`session.error`,Be],[`step-end`,Ve],[`check-output`,He],[`provider-auth-required`,Ue],[`image`,We],[`plan.updated`,Ge],[`session.started`,e=>R(e)],[`session.ended`,Ke],[`permission.requested`,Xe],[`permission.resolved`,Ze],[`ask.requested`,Qe],[`worker-question-routed`,$e],[`worker-question-fallback`,et],[`worker-question-undelivered`,tt],[`human-ask-closed`,rt],[`human-input-delivered`,it],[`step-start`,Z],[`token-usage`,Z],[`cost`,Z],[`turn-end`,Z],[`done`,Z],[`session`,Z]]);function ot(e,t){e.eventSeq=t.seq,at.get(t.type)?.(e,t)}function st(e){for(let t=e.turns.length-1;t>=0;--t){let n=e.turns[t].planEntries;if(n!==void 0)return n}}function ct(e){let t=[];for(let n of e.turns)for(let e of n.items)if(e.kind===`tool`){for(let n of e.locations??[])t.push(n.path);for(let n of e.diffs??[])t.push(n.path)}let n=new Set;for(let e=t.length-1;e>=0;--e)n.add(t[e]);return[...n]}function lt(e,t){let n=e?.turns.at(-1);if(!n)return!1;let r=M(t);return r!==``&&n.items.some(e=>e.kind===`note`&&e.tone===`danger`&&M(e.text)===r)}function ut(e,t,n){switch(e){case`waiting`:return{state:`waiting`};case`failed`:return{state:`closed`,tone:`danger`,label:t!==void 0&&t!==``&&!lt(n,t)?`Session failed — ${t}`:`Session failed`};case`review`:return{state:`closed`,tone:`dim`,label:`Session closed — waiting for your review`};case`done`:case`cancelled`:return{state:`closed`,tone:`dim`,label:`Session closed`};default:return null}}function Q(e,t){let n=e.replace(/\s*CEZ:DONE\s*$/,``).replace(/\s*CEZ:MONITORING\s*$/,``);if(t){let e=n.trimEnd(),t=e.lastIndexOf(`
|
|
2
2
|
`)+1;/^CEZ:ASK[ \t]+.+$/.test(e.slice(t))&&(n=e.slice(0,t).trimEnd())}return n.includes(`CEZ:`)?n.split(`
|
|
3
3
|
`).filter(e=>!/^CEZ:(?:PR=\d+|ISSUE=\d+|TITLE=.+)\s*$/.test(e)).join(`
|
|
4
4
|
`):n}var dt=/\s*(?:^|\n)C(?:E(?:Z(?::.*)?)?)?$/,ft=/[ \t]+CEZ(?::[A-Z]*)?$/;function $(e){return e.replace(dt,``).replace(ft,``)}function pt(e,t,n){return t!==``&&e.some(e=>e.norm===``?n>e.firstSeq:e.norm.startsWith(t)||t.startsWith(e.norm))}function mt(e,t){let n=e=>Q(e,!0).replace(/\s+/g,``),r=new Set,i=[],a=[];for(let{origin:o,entry:s,firstSeq:c,streaming:l}of e.entries)if(o===`v2`&&s.kind===`message`){let e=n(s.text);r.add(e),i.push(e),t&&l===!0&&a.push({norm:e,firstSeq:c})}if(i.length===0)return;r.add(i.join(``));let o=[],s={entries:[],texts:[]},c=()=>{let e=n(s.texts.join(``)),t=s.entries[0],i=s.entries.length>=2&&r.has(e);if(t&&(i||pt(a,e,t.firstSeq))){s={entries:[],texts:[]};return}o.push(...s.entries),s={entries:[],texts:[]}};for(let t of e.entries)t.origin===`v1`&&t.entry.kind===`message`?(s.entries.push(t),s.texts.push(t.entry.text)):(c(),o.push(t));c(),e.entries=o}function ht(e,t){let n=new Set;for(let{origin:t,entry:r}of e.entries)t===`v2`&&r.kind===`message`&&n.add(Q(r.text,!0).trim());n.size!==0&&(e.entries=e.entries.filter(e=>!(e.origin===`v1`&&e.entry.kind===`message`&&n.has(Q(e.entry.text,!0).trim()))),mt(e,t))}function gt(e){let t=e.failures?.filter(e=>e.fatal&&e.cause!==``);if(!t||t.length===0)return;let n=new Map;for(let e of t)n.set(e.cause,e);e.entries=e.entries.filter(e=>{if(e.entry.kind!==`message`||e.entry.role!==`assistant`)return!0;let t=Q(e.entry.text,!0).trim();if(t===``)return!0;let r=n.get(j(t));return r?(r.draft.firstSeq=Math.min(r.draft.firstSeq,e.firstSeq),r.draft.lastSeq=Math.max(r.draft.lastSeq,e.lastSeq),N(r,`assistant`,t),!1):!0})}function _t(e){e.userMessage&&(e.entries=e.entries.filter(({entry:e})=>!x(e,`human`)))}function vt(e){for(let t of e.conversationEntries.values())t.messageKind!==`request`||t.outcome!==void 0||t.delivery!==`not-delivered`&&(t.state!==void 0&&t.state!==`accepted`||(t.outcome={status:`pending`}))}function yt(e,t,n){let{entry:r}=e;if(r.kind!==`message`||r.role!==`assistant`)return r;let i=Q(r.text,t);return n&&e.streaming===!0?{...r,text:$(i),streaming:!0}:{...r,text:i}}function bt(e,t){let n=t||e.entries.some(({entry:e})=>e.kind===`ask`);return{id:e.id,...e.turnId===void 0?{}:{turnId:e.turnId},...e.userMessage===void 0?{}:{userMessage:e.userMessage},...e.startedAt===void 0?{}:{startedAt:e.startedAt},...e.planEntries===void 0?{}:{planEntries:e.planEntries},...e.completed===void 0?{}:{completed:e.completed},items:e.entries.map(e=>yt(e,n,t)),itemSeqs:xt(e.entries)}}function xt(e){let t=new Map;for(let{entry:n,firstSeq:r,lastSeq:i}of e)t.has(n.id)||t.set(n.id,{first:r,last:i});return t}function St(e,t={}){let n=ue();for(let t of e)ot(n,t);let r=n.turns.length-1;for(let[e,i]of n.turns.entries())i.v2Items&&ht(i,t.activeTurn===!0&&e===r),gt(i),_t(i);return vt(n),{turns:n.turns.map((e,n)=>bt(e,t.activeTurn===!0&&n===r)),...n.sessionEnded===void 0?{}:{sessionEnded:n.sessionEnded}}}export{x as a,ut as i,St as n,y as o,ct as r,m as s,st as t};
|
package/web/dist/assets/{use-hand-to-agent-state-Dx4mIAAl.js → use-hand-to-agent-state-BHAhGcZe.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,t as i}from"./utils-DSMR_WLb.js";import{A as a,Ct as o,Jt as s,Wt as c,_ as l,a as u,c as d,dn as f,f as p,k as m,rn as h,sn as g}from"./queries-CYWRnyM5.js";import{$ as _,I as v,J as y,Pr as b,Y as x,a as S,hi as C,ii as w,n as T,st as E}from"./toaster-B0kvcFif.js";import{Y as D,c as O,ct as k,ft as A,g as j,it as M,k as N,l as ee,m as P,ot as F,r as I,tt as L,u as te,ut as R,y as ne}from"./design-icons-CzEoMH9c.js";import{t as re}from"./chevron-down-CHGyCDBH.js";import{t as z}from"./external-link-BE6y205O.js";import{t as ie}from"./eye-B8okNWXU.js";import{t as ae}from"./loader-circle-CPBhhDbB.js";import{t as oe}from"./message-square-B-MD-8rD.js";import{t as se}from"./play-CmVAj_fu.js";import{t as B}from"./button-B7MKxYjT.js";import{i as ce,r as le,t as ue}from"./popover-CZV6tz9i.js";import{a as de,i as fe,o as pe,r as me,s as he,t as ge}from"./dialog-B531GGAo.js";import{t as V}from"./project-router-BvBqllk2.js";import{a as _e,i as H,o as U,r as ve,s as ye,t as be}from"./command-KdW7aO0N.js";import{d as xe,f as W,i as Se,o as Ce,p as we,s as Te,t as Ee,u as De}from"./skills-pM_PouEs.js";import{$ as Oe,A as ke,F as Ae,G as je,H as Me,I as Ne,Jn as G,M as Pe,Mn as Fe,N as Ie,Nn as Le,P as Re,Q as ze,U as K,V as Be,W as Ve,X as He,Y as Ue,_n as We,bt as q,dr as Ge,j as Ke,jn as J,mn as qe,nt as Je,q as Ye,rt as Xe,tt as Ze}from"./index-BEnkhnIC.js";import{t as Qe}from"./markdown-B2ioG8t9.js";import{t as $e}from"./textarea-vJt9undk.js";import{t as et}from"./diff-DZWO3IkH.js";import{t as Y}from"./change-counts-npLATh-3.js";import{t as tt}from"./tab-link-B0pNjKxZ.js";var X=e(t(),1),Z=n(),nt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Q({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:i(t,`text-semantic-green`)}):e===`failing`?(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:i(t,`text-semantic-red`)}):e===`pending`?(0,Z.jsx)(ae,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:i(t,`animate-spin text-semantic-amber motion-reduce:animate-none`)}):e===`review`?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-review`,className:i(t,`text-semantic-info`)}):e===`conflict`?(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-conflict`,className:i(t,`text-semantic-conflict`)}):(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:i(t,`text-soft-foreground`)})}function rt(e){return e?.available?e.mergeState:null}function it(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function at(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ot(e){return e===`approved`||e===`not-required`?`passing`:e===`review-required`?`review`:e===`unknown`?`unknown`:`failing`}function st(e){switch(e){case`approved`:return`Approved`;case`not-required`:return`Not required`;case`review-required`:return`Waiting for review`;case`changes-requested`:return`Changes requested`;case`unknown`:return`Unknown`}}function ct(e){return e===`mergeable`?`passing`:e===`conflicting`?`conflict`:`unknown`}function lt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ut(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function dt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function ft(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function $(e){return e?nt[e]:`Merge`}function pt(e){return e===`conflicting`?`true`:void 0}function mt({check:e}){return(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(Q,{state:e.state}),(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,ut(e.required)]})]}),e.url&&r(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function ht({reason:e}){return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function gt({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:r,refreshPending:a,onRefresh:o,onRunAgent:s,onConfirm:c,onMethodChange:l,onOverrideChange:u}){let d=at(e),f=ot(e.reviewDecision),p=ct(e.mergeable);return(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-semantic-green`}):(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,className:i(`mt-0.5 size-5 shrink-0`,e.mergeable===`conflicting`?`text-semantic-conflict`:`text-semantic-amber`)}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:d}),(0,Z.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:o,children:[(0,Z.jsx)(D,{size:16,"aria-hidden":`true`,className:i(`size-3.5`,a&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-soft-foreground`,children:[e.headRef,` (`,Le(e.headSha),`) → `,e.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:f}),(0,Z.jsxs)(`span`,{children:[`Reviews: `,st(e.reviewDecision)]})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:p}),(0,Z.jsxs)(`span`,{children:[`Conflicts: `,lt(e.mergeable)]})]}),e.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Z.jsx)(mt,{check:e},e.name)),e.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&s?(0,Z.jsx)(B,{className:`mt-4`,onClick:s,children:`Run agent on this PR`}):null,e.canOverride?(0,Z.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>u(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Z.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Z.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Z.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>l(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,Z.jsx)(`option`,{value:e,children:nt[e]},e))}),(0,Z.jsx)(B,{disabled:!r,onClick:c,children:$(t)})]}):null]})]})}function _t({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,Z.jsx)(ge,{open:r,onOpenChange:s,children:(0,Z.jsxs)(me,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(pe,{children:[(0,Z.jsxs)(he,{children:[$(n),` pull request #`,e,`?`]}),(0,Z.jsx)(fe,{asChild:!0,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),i&&t.canOverride?(0,Z.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-semantic-amber`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,Z.jsxs)(de,{children:[(0,Z.jsx)(B,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,Z.jsx)(B,{disabled:a,onClick:c,children:a?`Merging…`:$(n)})]})]})})}function vt({number:e,onRunAgent:t}){let n=C(),r=p(),i=w({queryKey:c.githubMergeState(e),queryFn:({signal:t})=>x(e,{},{signal:t}),retry:!1}),a=rt(i.data),[o,s]=(0,X.useState)(null),[l,u]=(0,X.useState)(!1),[d,m]=(0,X.useState)(!1),h=f({mutationFn:t=>x(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>T(e instanceof Error?e.message:String(e),{tone:`danger`})}),g=it(o,a),v=()=>({mergeState:c.githubMergeState(e),list:c.githubPages(50),comments:c.githubComments(`pr`,e),item:c.githubItem(`pr`,e),refStatus:r===void 0?void 0:c.githubRefStatusOf(r)}),y=f({mutationFn:t=>{if(!a||!g)throw Error(`No merge method is available.`);return _(e,{method:g,expectedHeadSha:a.headSha,...d&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{u(!1),T(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{T(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Z.jsx)(G,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":pt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-card-edge bg-card p-4 shadow-card`,children:[(0,Z.jsx)(gt,{state:a,selectedMethod:g,overrideRules:d,mergeEnabled:ft(g,a,d),refreshPending:h.isPending,onRefresh:()=>h.mutate(c.githubMergeState(e)),onRunAgent:t,onConfirm:()=>u(!0),onMethodChange:s,onOverrideChange:m}),(0,Z.jsx)(_t,{number:e,state:a,selectedMethod:g,confirming:l,overrideRules:d,mergePending:y.isPending,mergeError:y.error,onOpenChange:u,onMerge:()=>y.mutate(v())})]}):(0,Z.jsx)(ht,{reason:dt(i.data)})}function yt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function bt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function xt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function St(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function Ct({label:e,color:t,plain:n=!1}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:St(t),className:n?`text-xs font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function wt(e){return e===`pr`?`pull request`:`issue`}function Tt(e,t,n){return e===`pr`&&!!(t||n)}function Et({backLink:e}){return e?(0,Z.jsxs)(V,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Z.jsx)(I,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var Dt=i(`text-sm`,`[&_[data-streamdown="code-block"]]:relative [&_[data-streamdown="code-block"]]:my-2.5 [&_[data-streamdown="code-block"]]:gap-0 [&_[data-streamdown="code-block"]]:overflow-hidden [&_[data-streamdown="code-block"]]:rounded-lg [&_[data-streamdown="code-block"]]:border [&_[data-streamdown="code-block"]]:border-border [&_[data-streamdown="code-block"]]:bg-background [&_[data-streamdown="code-block"]]:p-0 [&_[data-streamdown="code-block"]]:![content-visibility:visible] [&_[data-streamdown="code-block"]]:![contain-intrinsic-size:auto]`,`[&_[data-streamdown="code-block-header"]]:h-7 [&_[data-streamdown="code-block-header"]]:border-b [&_[data-streamdown="code-block-header"]]:border-border [&_[data-streamdown="code-block-header"]]:bg-muted/40 [&_[data-streamdown="code-block-header"]]:px-3 [&_[data-streamdown="code-block-header"]]:text-xs`,`[&_[data-streamdown="code-block-header"][data-language=""]]:hidden [&_[data-streamdown="code-block-header"]:not([data-language])]:hidden [&_[data-streamdown="code-block-header"]:has(>span:empty)]:hidden`,`[&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:absolute [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:top-1 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:right-1.5 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:mt-0 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:h-auto`,`[&_[data-streamdown="code-block-actions"]]:border-0 [&_[data-streamdown="code-block-actions"]]:bg-transparent [&_[data-streamdown="code-block-actions"]]:p-0 [&_[data-streamdown="code-block-actions"]]:backdrop-blur-none`,`[&_[data-streamdown="image-fallback"]]:inline-flex [&_[data-streamdown="image-fallback"]]:rounded-md [&_[data-streamdown="image-fallback"]]:border [&_[data-streamdown="image-fallback"]]:border-dashed [&_[data-streamdown="image-fallback"]]:border-border [&_[data-streamdown="image-fallback"]]:bg-muted/40 [&_[data-streamdown="image-fallback"]]:px-3 [&_[data-streamdown="image-fallback"]]:py-2 [&_[data-streamdown="image-fallback"]]:not-italic [&_[data-streamdown="image-fallback"]]:after:content-["_—_open_on_GitHub_to_view"]`,`[&_[data-streamdown="code-block-body"]]:rounded-none [&_[data-streamdown="code-block-body"]]:border-0 [&_[data-streamdown="code-block-body"]]:bg-transparent [&_[data-streamdown="code-block-body"]]:px-3.5 [&_[data-streamdown="code-block-body"]]:py-2.5 [&_[data-streamdown="code-block-body"]]:pr-10`);function Ot(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function kt({item:e,kindWord:t,commentCount:n,hasDiffStat:i,additions:a,deletions:o}){return(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:t}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsx)(J,{iso:e.createdAt,title:Ot(e.createdAt)}),n?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(tn,{count:n})]}):null,i?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,Z.jsx)(Y,{adds:a??0,dels:o??0})})]}):null,`·`,r(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function At({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(tt,{to:q(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,Z.jsx)(tt,{to:q(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,Z.jsx)(V,{to:q(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function jt({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(Ct,{label:e,color:t[e]},e)),n?(0,Z.jsx)(nn,{checks:n,url:e.url}):null]}):null}function Mt({item:e,colors:t,body:n}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:i(`mt-5`,Dt),children:n?(0,Z.jsx)(Qe,{children:n}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Z.jsx)(It,{item:e,colors:t})]})}function Nt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let d=a?.changes??!1,f=wt(e.kind),p=u(e.kind,e.number,!d).data?.detail,m=p?.body??e.body,h=p?.additions??e.additions,g=p?.deletions??e.deletions,_=Tt(e.kind,h,g),v=r??e.comments;return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsx)(Et,{backLink:i}),(0,Z.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Z.jsx)(Pt,{action:c,className:`mb-4`,children:(0,Z.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,Z.jsx)(Pt,{action:e.kind===`pr`?void 0:c,children:(0,Z.jsx)(kt,{item:e,kindWord:f,commentCount:v,hasDiffStat:_,additions:h,deletions:g})}),e.kind===`pr`?null:(0,Z.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,Z.jsx)(At,{item:e,subNav:a,changes:d}),(0,Z.jsx)(jt,{item:e,colors:t,checks:n}),d&&e.kind===`pr`?(0,Z.jsx)(Ft,{item:e}):(0,Z.jsx)(Mt,{item:e,colors:t,body:m})]}),e.kind===`pr`?(0,Z.jsx)(vt,{number:e.number,onRunAgent:o}):null,l]})}function Pt({action:e,className:t,children:n}){return e?(0,Z.jsxs)(`div`,{"data-slot":`gh-header-row`,className:i(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,Z.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,Z.jsx)(`div`,{className:t,children:n}):(0,Z.jsx)(Z.Fragment,{children:n})}function Ft({item:e}){let t=C(),n=d(e.number),[a,o]=(0,X.useState)(``),[s,l]=(0,X.useState)(null),u=n.data,f=e=>u?.available?u.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],p=f(a),m=p.some(e=>e.path===s)?s:p[0]?.path??null,h=p.findIndex(e=>e.path===m),g=e=>{o(e);let t=f(e),n=m??s,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==s&&l(r)},_=async()=>{let n=u?.available?u.headSha:null,r=c.githubPrChanges(e.number),i=await y(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),T(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let v=p.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),b=r(e.url)?`${e.url}/files`:null,x=p.find(e=>e.path===m);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Z.jsx)(Y,{adds:u.additions,dels:u.deletions}),(0,Z.jsx)(Fe,{sha:u.headSha,variant:`inline`,prefix:`head `,className:`text-muted-foreground`}),(0,Z.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void _(),children:`Refresh`})]}),u.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,b?(0,Z.jsx)(`a`,{href:b,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:a,onChange:e=>g(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsxs)(`div`,{className:`relative mt-2 lg:hidden`,children:[(0,Z.jsx)(`select`,{"aria-label":`Select changed file`,value:m??``,onChange:e=>l(e.target.value),className:`min-h-11 w-full appearance-none rounded-md border border-input bg-background py-2 pr-8 pl-3 text-sm`,children:p.map(e=>(0,Z.jsx)(`option`,{children:e.path},e.path))}),(0,Z.jsx)(re,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:p.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:i(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,m===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsx)(Y,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(B,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:h<=0,onClick:()=>l(p[h-1]?.path??null),children:(0,Z.jsx)(Ge,{})}),(0,Z.jsx)(B,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:h<0||h>=p.length-1,onClick:()=>l(p[h+1]?.path??null),children:(0,Z.jsx)(te,{size:16})})]}),p.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(et,{files:v.filter(e=>e.path===m),wrap:!0,className:`min-w-0`}),x&&!x.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,x.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function It({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(Lt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(G,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(G,{className:`h-14 w-full`}),(0,Z.jsx)(G,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Rt(i).map(e=>e.group===`commits`?(0,Z.jsx)(zt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Xt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(Vt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Lt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Rt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function zt({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Bt.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(Vt,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Bt.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(J,{iso:e[e.length-1].createdAt,className:`shrink-0`})]})})}var Bt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Vt({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:i(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Bt[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(qt,{event:e,colors:t}),(0,Z.jsx)(J,{iso:e.createdAt,className:`shrink-0`}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Ht({event:e}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(Fe,{sha:e.sha,variant:`inline`,className:`shrink-0 text-xs text-muted-foreground`}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Jt,{checks:e.checks})]})}function Ut({event:e,colors:t}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:St(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Wt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Gt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Kt={committed:e=>(0,Z.jsx)(Ht,{event:e}),labeled:(e,t)=>(0,Z.jsx)(Ut,{event:e,colors:t}),unlabeled:(e,t)=>(0,Z.jsx)(Ut,{event:e,colors:t}),assigned:e=>(0,Z.jsx)(Wt,{event:e}),unassigned:e=>(0,Z.jsx)(Wt,{event:e}),merged:()=>(0,Z.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Z.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Z.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Z.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Z.jsx)(Gt,{event:e})};function qt({event:e,colors:t}){return Kt[e.kind]?.(e,t)??null}function Jt({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:i(`shrink-0`,$t[e]),children:Qt[e]}):null}var Yt={approved:{label:`Approved`,tone:`border-success/40 text-semantic-green`},changes_requested:{label:`Changes requested`,tone:`border-danger/40 text-semantic-red`},commented:{label:`Commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`Dismissed`,tone:`border-border text-muted-foreground`}};function Xt({comment:e}){let t=e.reviewState?Yt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Zt,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(J,{iso:e.createdAt}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:i(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:Dt,children:e.body?(0,Z.jsx)(Qe,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function Zt({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:20,height:20,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-5 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Qt={passing:`✓`,failing:`✗`,pending:`○`},$t={passing:`text-semantic-green`,failing:`text-semantic-red`,pending:`text-semantic-amber`},en={passing:`Checks passing`,failing:`Checks failing`,pending:`Checks pending`};function tn({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function nn({checks:e,url:t}){let n=i(`text-xs font-medium`,$t[e],t&&`hover:underline`),r=`${Qt[e]} ${en[e]}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function rn({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:en[e],"aria-label":en[e],className:i(`shrink-0 font-sans text-xs font-semibold`,$t[e]),children:Qt[e]})}function an(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function on(e,t=[]){let n=an(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=sn(t)),n}function sn(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function cn(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function ln(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function un(e,t,n){let r=(n??``).trim();if(!r)return on(e,t);let i=an(e),a=r.startsWith(i)?i+cn(r.slice(i.length),e):cn(r,e),o=ln(a,e)?a:`${i}\n\n${a}`;return t.length?o+sn(t):o}function dn(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function fn(e,t,n,r,i={}){return t?{...i,workflow:t,task:un(e,n.map(e=>e.id),r)}:n.length?{...i,steps:dn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:un(e,[],r)}:{...i,workflow:`quick-task`,task:un(e,[],r)}}function pn(e){let t=o(),n=l(),r=h(),{runners:i,uninstalled:a,signedOut:s,accounts:c,repoAccount:u,accountFor:d}=We(),f=n.data?.defaultRunner,p=Ae(e.runner,i,f??i[0]??`claude`),m=n.data?.modelsLocked===!0,_=d(p,e.account),v=g(p,!0,_??u?.[p]),y=Re(m?null:e.model,p,r.data,n.data?.defaultModels,v.data),b=Ke(y,v.data);return{runner:p,runnerExplicit:e.runner!==null,model:y,effort:m?``:Ie(e.effort,b),effortOptions:b,runners:i,uninstalled:a,signedOut:s,defaultRunner:f,canRun:t.isSuccess&&i.length>0,modelsLocked:m,providerPending:t.isPending,providerError:t.isError,accounts:c,account:_,repoAccount:u}}function mn(e){return{runner:Ne(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function hn(e){return{...mn(e),...e.account?{agentProfile:e.account}:{}}}function gn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>qe(t,e))}function _n({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,X.useRef)(null),o=(0,X.useRef)(null),[s,c]=(0,X.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,X.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,X.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let u=pn(e),{runner:d,model:f,effort:p,effortOptions:m,runners:_,canRun:v,modelsLocked:y}=u,b=l(),x=h(),S=g(d,!0,u.account??u.repoAccount?.[d]),C=Pe(d,x.data,S.data,[e.model,b.data?.defaultModels?.[d]]),w=n||!v,T=r?u.accounts:[],E=gn(u,T)?(0,Z.jsx)(je,{icon:(0,Z.jsx)(M,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,uninstalled:u.uninstalled,signedOut:u.signedOut,value:d,accounts:T,account:r?u.account:null,repoAccount:r?u.repoAccount:void 0,disabled:w,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===d?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,D=(0,Z.jsx)(K,{icon:(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:f===``?`Default`:C.find(e=>e.id===f).label,value:f,disabled:w,readOnly:y===!0,disabledHint:y?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Ke(n,S.data);t({...e,model:n,effort:e.effort===null?null:Ie(e.effort,r)})},options:C.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:ke(d,x.data,S)},`model`),O=(0,Z.jsx)(K,{icon:(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:m.find(e=>e.value===p)?.label??`auto`,value:p,disabled:w,readOnly:y===!0,disabledHint:y?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:m.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Z.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,Z.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Z.jsx)(Ve,{fill:`model-pill`,children:s?[E,O,D]:[E,D,O]})})}):(0,Z.jsxs)(Ve,{children:[E,D,O]})}var vn={workflow:null,skills:[]},yn=`cez-followup-selection`;function bn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function xn(){try{let e=localStorage.getItem(yn);return e?bn(JSON.parse(e)):{...vn}}catch{return{...vn}}}function Sn(e){try{localStorage.setItem(yn,JSON.stringify(e))}catch{}}var Cn=`cez-followup-prompt:`;function wn(e){try{return localStorage.getItem(Cn+e)??``}catch{return``}}function Tn(e,t){try{t===``?localStorage.removeItem(Cn+e):localStorage.setItem(Cn+e,t)}catch{}}function En({item:e,workflows:t,skills:n,workflow:i,onWorkflowChange:a,selectedSkills:o,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:p,onQueued:h}){let g=C(),_=m(),y=e.kind===`pr`?`PR`:`issue`,b=pn(u),x=s(b.runner,b.account),S=o.filter(e=>x.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),w=S.length!==o.length,[D]=(0,X.useState)(()=>an(e)),[k,A]=(0,X.useState)(()=>wn(e.url)||D),j=(0,X.useRef)(null),M=(0,X.useRef)(null);(0,X.useEffect)(()=>{Tn(e.url,k===D?``:k)},[e.url,k,D]);let N=(0,X.useMemo)(()=>Ze(_.data?.promptTemplates),[_.data?.promptTemplates]),ee=e=>{let t=j.current,n=Xe({prompt:k,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:M.current}),r=Oe(k,n,e);A(r.text),M.current=r.caret,requestAnimationFrame(()=>{j.current?.focus(),j.current?.setSelectionRange(r.caret,r.caret)})},P=ze(N,S.map(e=>e.id)),F=(0,X.useRef)(k);F.current=k;let I=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=Je(F.current,I.current,P,D);I.current=e.applied,e.text!==F.current&&A(e.text)},[P,D]);let L=f({mutationFn:async()=>!b.canRun||w?null:E(fn(e,i,S,k,hn(b))),onSuccess:t=>{if(t===null)return;let n=t;n&&h(e.url,n.id),T(`Added to the queue — ${y} #${e.number}`),S.length>0&&_.data!==void 0&&v({skillUsage:S.reduce((e,t)=>Ee(e,t.id),_.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:c.uiState})).catch(()=>{}),Tn(e.url,``),A(D),I.current=``,g.invalidateQueries({queryKey:c.runs.all})},onError:e=>T(e.message,{tone:`danger`})}),te=e=>{Ue({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!L.isPending&&b.canRun&&L.mutate())},R=e=>l(o.some(t=>W(t)===W(e))?o.filter(t=>W(t)!==W(e)):[...o,Te(e)]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Z.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Z.jsx)(`span`,{children:`Instructions for the agent`}),(0,Z.jsx)($e,{ref:j,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:k,onChange:e=>A(e.target.value),onSelect:e=>{M.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Z.jsx)(Me,{templates:N,onInsert:ee}),(0,Z.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Workflow`}),(0,Z.jsx)(On,{workflows:t,value:i,onChange:a})]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Skills · select one or more`}),(0,Z.jsx)(An,{skills:n,skillUsage:_.data?.skillUsage,selected:o,onToggle:R})]}),o.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:o.map(e=>(0,Z.jsx)(Dn,{skill:e,skills:n,unchecked:x.unchecked,onRemove:()=>R(e)},W(e)))}):null,w?(0,Z.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Z.jsx)(_n,{layout:`row`,pick:u,onChange:d,disabled:L.isPending||!b.canRun,accounts:!0}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Account`}),(0,Z.jsx)(kn,{resolved:b,disabled:L.isPending||!b.canRun,onPick:e=>d({...u,account:e})})]}),!b.providerPending&&!b.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[b.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(V,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[r(e.url)?(0,Z.jsx)(B,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Z.jsxs)(B,{variant:`primary`,"data-action":`gh-run`,disabled:L.isPending||!b.canRun||w,onClick:()=>L.mutate(),children:[(0,Z.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,y]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-xs font-medium text-muted-foreground`,children:He()}),p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(V,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function Dn({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Z.jsx)(A,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function On({workflows:e,value:t,onChange:n}){let[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),c=(0,X.useRef)(null),l=xe(e,o);return(0,Z.jsxs)(ue,{open:r,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:i(Ye,t&&`border-foreground/60 font-mono text-xs font-semibold text-foreground`),children:[(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(le,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(be,{shouldFilter:!1,children:[(0,Z.jsx)(_e,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Z.jsxs)(ye,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Z.jsx)(ve,{children:`Nothing matches.`}):null,(0,Z.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,Z.jsxs)(U,{value:`workflow ${e.name}`,keywords:we(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function kn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:b,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,...e.configDir?{desc:e.configDir}:{}}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Z.jsx)(K,{icon:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function An({skills:e,skillUsage:t,selected:n,onToggle:r}){let[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=De(e,s,t),g=(e,t)=>{let a=n.some(t=>W(t)===W(e));return(0,Z.jsxs)(U,{value:W(e),keywords:we(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>r(Te(e)),children:[(0,Z.jsx)(`span`,{className:i(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},W(e))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Be,{skill:l,onClose:()=>u(null)}),(0,Z.jsxs)(ue,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:i(Ye,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(le,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(be,{shouldFilter:!1,children:[(0,Z.jsx)(_e,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Z.jsxs)(ye,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Z.jsx)(H,{children:(0,Z.jsxs)(U,{value:`typed-skill`,onSelect:()=>r({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Z.jsx)(ve,{children:`Nothing matches.`}):null,h?h.length>0?(0,Z.jsx)(H,{children:h.map(e=>g(e,Se(e)))}):null:(0,Z.jsxs)(Z.Fragment,{children:[f.length>0?(0,Z.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,Se(e)))}):null,p.length>0?(0,Z.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Z.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var jn=new WeakMap;function Mn(){let e=xn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&Sn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Nn(){let e=C(),{projectId:t}=S(),n=jn.get(e);n||jn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=Mn());let{snapshot:i,subscribe:o,update:c}=r,l=(0,X.useSyncExternalStore)(o,i,i),u=a(),d=pn(l.engine),f=s(d.runner,d.account),p=m(),h=u.data?.workflows;(0,X.useEffect)(()=>{h&&l.workflow!==null&&!h.some(e=>e.name===l.workflow)&&c({workflow:null})},[c,h,l.workflow]);let g=(0,X.useMemo)(()=>Ce(f.data??[],p.data?.skillUsage),[f.data,p.data?.skillUsage]);return{...l,workflows:u,skillList:g,skillsUnchecked:f.unchecked,setWorkflow:e=>c({workflow:e}),setSelectedSkills:e=>c({selectedSkills:e}),setEngine:e=>c({engine:e}),onQueued:(e,t)=>c({queued:new Map(i().queued).set(e,t)})}}export{tn as a,Rt as c,St as d,xt as f,rn as i,yt as l,En as n,Nt as o,on as r,Ct as s,Nn as t,bt as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,t as i}from"./utils-DSMR_WLb.js";import{A as a,Ct as o,Jt as s,Wt as c,_ as l,a as u,c as d,dn as f,f as p,k as m,rn as h,sn as g}from"./queries-CYWRnyM5.js";import{$ as _,I as v,J as y,Pr as b,Y as x,a as S,hi as C,ii as w,n as T,st as E}from"./toaster-B0kvcFif.js";import{Y as D,c as O,ct as k,ft as A,g as j,it as M,k as N,l as ee,m as P,ot as F,r as I,tt as L,u as te,ut as R,y as ne}from"./design-icons-CzEoMH9c.js";import{t as re}from"./chevron-down-CHGyCDBH.js";import{t as z}from"./external-link-BE6y205O.js";import{t as ie}from"./eye-B8okNWXU.js";import{t as ae}from"./loader-circle-CPBhhDbB.js";import{t as oe}from"./message-square-B-MD-8rD.js";import{t as se}from"./play-CmVAj_fu.js";import{t as B}from"./button-B7MKxYjT.js";import{i as ce,r as le,t as ue}from"./popover-CZV6tz9i.js";import{a as de,i as fe,o as pe,r as me,s as he,t as ge}from"./dialog-B531GGAo.js";import{t as V}from"./project-router-BvBqllk2.js";import{a as _e,i as H,o as U,r as ve,s as ye,t as be}from"./command-KdW7aO0N.js";import{d as xe,f as W,i as Se,o as Ce,p as we,s as Te,t as Ee,u as De}from"./skills-pM_PouEs.js";import{$ as Oe,A as ke,F as Ae,G as je,H as Me,I as Ne,Jn as G,M as Pe,Mn as Fe,N as Ie,Nn as Le,P as Re,Q as ze,U as K,V as Be,W as Ve,X as He,Y as Ue,_n as We,bt as q,dr as Ge,j as Ke,jn as J,mn as qe,nt as Je,q as Ye,rt as Xe,tt as Ze}from"./index-BZr8Y74X.js";import{t as Qe}from"./markdown-BRNtAZkY.js";import{t as $e}from"./textarea-vJt9undk.js";import{t as et}from"./diff-ByLut7n4.js";import{t as Y}from"./change-counts-npLATh-3.js";import{t as tt}from"./tab-link-B0pNjKxZ.js";var X=e(t(),1),Z=n(),nt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Q({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:i(t,`text-semantic-green`)}):e===`failing`?(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:i(t,`text-semantic-red`)}):e===`pending`?(0,Z.jsx)(ae,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:i(t,`animate-spin text-semantic-amber motion-reduce:animate-none`)}):e===`review`?(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-review`,className:i(t,`text-semantic-info`)}):e===`conflict`?(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-conflict`,className:i(t,`text-semantic-conflict`)}):(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:i(t,`text-soft-foreground`)})}function rt(e){return e?.available?e.mergeState:null}function it(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function at(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ot(e){return e===`approved`||e===`not-required`?`passing`:e===`review-required`?`review`:e===`unknown`?`unknown`:`failing`}function st(e){switch(e){case`approved`:return`Approved`;case`not-required`:return`Not required`;case`review-required`:return`Waiting for review`;case`changes-requested`:return`Changes requested`;case`unknown`:return`Unknown`}}function ct(e){return e===`mergeable`?`passing`:e===`conflicting`?`conflict`:`unknown`}function lt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ut(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function dt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function ft(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function $(e){return e?nt[e]:`Merge`}function pt(e){return e===`conflicting`?`true`:void 0}function mt({check:e}){return(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(Q,{state:e.state}),(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,ut(e.required)]})]}),e.url&&r(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function ht({reason:e}){return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function gt({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:r,refreshPending:a,onRefresh:o,onRunAgent:s,onConfirm:c,onMethodChange:l,onOverrideChange:u}){let d=at(e),f=ot(e.reviewDecision),p=ct(e.mergeable);return(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-semantic-green`}):(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,className:i(`mt-0.5 size-5 shrink-0`,e.mergeable===`conflicting`?`text-semantic-conflict`:`text-semantic-amber`)}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:d}),(0,Z.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:o,children:[(0,Z.jsx)(D,{size:16,"aria-hidden":`true`,className:i(`size-3.5`,a&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-soft-foreground`,children:[e.headRef,` (`,Le(e.headSha),`) → `,e.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:f}),(0,Z.jsxs)(`span`,{children:[`Reviews: `,st(e.reviewDecision)]})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{state:p}),(0,Z.jsxs)(`span`,{children:[`Conflicts: `,lt(e.mergeable)]})]}),e.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Z.jsx)(mt,{check:e},e.name)),e.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&s?(0,Z.jsx)(B,{className:`mt-4`,onClick:s,children:`Run agent on this PR`}):null,e.canOverride?(0,Z.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>u(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Z.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Z.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Z.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>l(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,Z.jsx)(`option`,{value:e,children:nt[e]},e))}),(0,Z.jsx)(B,{disabled:!r,onClick:c,children:$(t)})]}):null]})]})}function _t({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,Z.jsx)(ge,{open:r,onOpenChange:s,children:(0,Z.jsxs)(me,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(pe,{children:[(0,Z.jsxs)(he,{children:[$(n),` pull request #`,e,`?`]}),(0,Z.jsx)(fe,{asChild:!0,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),i&&t.canOverride?(0,Z.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-semantic-amber`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,Z.jsxs)(de,{children:[(0,Z.jsx)(B,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,Z.jsx)(B,{disabled:a,onClick:c,children:a?`Merging…`:$(n)})]})]})})}function vt({number:e,onRunAgent:t}){let n=C(),r=p(),i=w({queryKey:c.githubMergeState(e),queryFn:({signal:t})=>x(e,{},{signal:t}),retry:!1}),a=rt(i.data),[o,s]=(0,X.useState)(null),[l,u]=(0,X.useState)(!1),[d,m]=(0,X.useState)(!1),h=f({mutationFn:t=>x(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>T(e instanceof Error?e.message:String(e),{tone:`danger`})}),g=it(o,a),v=()=>({mergeState:c.githubMergeState(e),list:c.githubPages(50),comments:c.githubComments(`pr`,e),item:c.githubItem(`pr`,e),refStatus:r===void 0?void 0:c.githubRefStatusOf(r)}),y=f({mutationFn:t=>{if(!a||!g)throw Error(`No merge method is available.`);return _(e,{method:g,expectedHeadSha:a.headSha,...d&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{u(!1),T(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{T(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Z.jsx)(G,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":pt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-card-edge bg-card p-4 shadow-card`,children:[(0,Z.jsx)(gt,{state:a,selectedMethod:g,overrideRules:d,mergeEnabled:ft(g,a,d),refreshPending:h.isPending,onRefresh:()=>h.mutate(c.githubMergeState(e)),onRunAgent:t,onConfirm:()=>u(!0),onMethodChange:s,onOverrideChange:m}),(0,Z.jsx)(_t,{number:e,state:a,selectedMethod:g,confirming:l,overrideRules:d,mergePending:y.isPending,mergeError:y.error,onOpenChange:u,onMerge:()=>y.mutate(v())})]}):(0,Z.jsx)(ht,{reason:dt(i.data)})}function yt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function bt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function xt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function St(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function Ct({label:e,color:t,plain:n=!1}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:St(t),className:n?`text-xs font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function wt(e){return e===`pr`?`pull request`:`issue`}function Tt(e,t,n){return e===`pr`&&!!(t||n)}function Et({backLink:e}){return e?(0,Z.jsxs)(V,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Z.jsx)(I,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var Dt=i(`text-sm`,`[&_[data-streamdown="code-block"]]:relative [&_[data-streamdown="code-block"]]:my-2.5 [&_[data-streamdown="code-block"]]:gap-0 [&_[data-streamdown="code-block"]]:overflow-hidden [&_[data-streamdown="code-block"]]:rounded-lg [&_[data-streamdown="code-block"]]:border [&_[data-streamdown="code-block"]]:border-border [&_[data-streamdown="code-block"]]:bg-background [&_[data-streamdown="code-block"]]:p-0 [&_[data-streamdown="code-block"]]:![content-visibility:visible] [&_[data-streamdown="code-block"]]:![contain-intrinsic-size:auto]`,`[&_[data-streamdown="code-block-header"]]:h-7 [&_[data-streamdown="code-block-header"]]:border-b [&_[data-streamdown="code-block-header"]]:border-border [&_[data-streamdown="code-block-header"]]:bg-muted/40 [&_[data-streamdown="code-block-header"]]:px-3 [&_[data-streamdown="code-block-header"]]:text-xs`,`[&_[data-streamdown="code-block-header"][data-language=""]]:hidden [&_[data-streamdown="code-block-header"]:not([data-language])]:hidden [&_[data-streamdown="code-block-header"]:has(>span:empty)]:hidden`,`[&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:absolute [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:top-1 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:right-1.5 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:mt-0 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:h-auto`,`[&_[data-streamdown="code-block-actions"]]:border-0 [&_[data-streamdown="code-block-actions"]]:bg-transparent [&_[data-streamdown="code-block-actions"]]:p-0 [&_[data-streamdown="code-block-actions"]]:backdrop-blur-none`,`[&_[data-streamdown="image-fallback"]]:inline-flex [&_[data-streamdown="image-fallback"]]:rounded-md [&_[data-streamdown="image-fallback"]]:border [&_[data-streamdown="image-fallback"]]:border-dashed [&_[data-streamdown="image-fallback"]]:border-border [&_[data-streamdown="image-fallback"]]:bg-muted/40 [&_[data-streamdown="image-fallback"]]:px-3 [&_[data-streamdown="image-fallback"]]:py-2 [&_[data-streamdown="image-fallback"]]:not-italic [&_[data-streamdown="image-fallback"]]:after:content-["_—_open_on_GitHub_to_view"]`,`[&_[data-streamdown="code-block-body"]]:rounded-none [&_[data-streamdown="code-block-body"]]:border-0 [&_[data-streamdown="code-block-body"]]:bg-transparent [&_[data-streamdown="code-block-body"]]:px-3.5 [&_[data-streamdown="code-block-body"]]:py-2.5 [&_[data-streamdown="code-block-body"]]:pr-10`);function Ot(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function kt({item:e,kindWord:t,commentCount:n,hasDiffStat:i,additions:a,deletions:o}){return(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:t}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsx)(J,{iso:e.createdAt,title:Ot(e.createdAt)}),n?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(tn,{count:n})]}):null,i?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,Z.jsx)(Y,{adds:a??0,dels:o??0})})]}):null,`·`,r(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function At({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(tt,{to:q(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,Z.jsx)(tt,{to:q(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,Z.jsx)(V,{to:q(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function jt({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(Ct,{label:e,color:t[e]},e)),n?(0,Z.jsx)(nn,{checks:n,url:e.url}):null]}):null}function Mt({item:e,colors:t,body:n}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:i(`mt-5`,Dt),children:n?(0,Z.jsx)(Qe,{children:n}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Z.jsx)(It,{item:e,colors:t})]})}function Nt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let d=a?.changes??!1,f=wt(e.kind),p=u(e.kind,e.number,!d).data?.detail,m=p?.body??e.body,h=p?.additions??e.additions,g=p?.deletions??e.deletions,_=Tt(e.kind,h,g),v=r??e.comments;return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsx)(Et,{backLink:i}),(0,Z.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Z.jsx)(Pt,{action:c,className:`mb-4`,children:(0,Z.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,Z.jsx)(Pt,{action:e.kind===`pr`?void 0:c,children:(0,Z.jsx)(kt,{item:e,kindWord:f,commentCount:v,hasDiffStat:_,additions:h,deletions:g})}),e.kind===`pr`?null:(0,Z.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,Z.jsx)(At,{item:e,subNav:a,changes:d}),(0,Z.jsx)(jt,{item:e,colors:t,checks:n}),d&&e.kind===`pr`?(0,Z.jsx)(Ft,{item:e}):(0,Z.jsx)(Mt,{item:e,colors:t,body:m})]}),e.kind===`pr`?(0,Z.jsx)(vt,{number:e.number,onRunAgent:o}):null,l]})}function Pt({action:e,className:t,children:n}){return e?(0,Z.jsxs)(`div`,{"data-slot":`gh-header-row`,className:i(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,Z.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,Z.jsx)(`div`,{className:t,children:n}):(0,Z.jsx)(Z.Fragment,{children:n})}function Ft({item:e}){let t=C(),n=d(e.number),[a,o]=(0,X.useState)(``),[s,l]=(0,X.useState)(null),u=n.data,f=e=>u?.available?u.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],p=f(a),m=p.some(e=>e.path===s)?s:p[0]?.path??null,h=p.findIndex(e=>e.path===m),g=e=>{o(e);let t=f(e),n=m??s,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==s&&l(r)},_=async()=>{let n=u?.available?u.headSha:null,r=c.githubPrChanges(e.number),i=await y(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),T(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let v=p.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),b=r(e.url)?`${e.url}/files`:null,x=p.find(e=>e.path===m);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Z.jsx)(Y,{adds:u.additions,dels:u.deletions}),(0,Z.jsx)(Fe,{sha:u.headSha,variant:`inline`,prefix:`head `,className:`text-muted-foreground`}),(0,Z.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void _(),children:`Refresh`})]}),u.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,b?(0,Z.jsx)(`a`,{href:b,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:a,onChange:e=>g(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsxs)(`div`,{className:`relative mt-2 lg:hidden`,children:[(0,Z.jsx)(`select`,{"aria-label":`Select changed file`,value:m??``,onChange:e=>l(e.target.value),className:`min-h-11 w-full appearance-none rounded-md border border-input bg-background py-2 pr-8 pl-3 text-sm`,children:p.map(e=>(0,Z.jsx)(`option`,{children:e.path},e.path))}),(0,Z.jsx)(re,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:p.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:i(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,m===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsx)(Y,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(B,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:h<=0,onClick:()=>l(p[h-1]?.path??null),children:(0,Z.jsx)(Ge,{})}),(0,Z.jsx)(B,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:h<0||h>=p.length-1,onClick:()=>l(p[h+1]?.path??null),children:(0,Z.jsx)(te,{size:16})})]}),p.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(et,{files:v.filter(e=>e.path===m),wrap:!0,className:`min-w-0`}),x&&!x.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,x.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function It({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(Lt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(G,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(G,{className:`h-14 w-full`}),(0,Z.jsx)(G,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Rt(i).map(e=>e.group===`commits`?(0,Z.jsx)(zt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Xt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(Vt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Lt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Rt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function zt({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Bt.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(Vt,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Bt.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(J,{iso:e[e.length-1].createdAt,className:`shrink-0`})]})})}var Bt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Vt({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:i(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Bt[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(qt,{event:e,colors:t}),(0,Z.jsx)(J,{iso:e.createdAt,className:`shrink-0`}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Ht({event:e}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(Fe,{sha:e.sha,variant:`inline`,className:`shrink-0 text-xs text-muted-foreground`}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Jt,{checks:e.checks})]})}function Ut({event:e,colors:t}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:St(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Wt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Gt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Kt={committed:e=>(0,Z.jsx)(Ht,{event:e}),labeled:(e,t)=>(0,Z.jsx)(Ut,{event:e,colors:t}),unlabeled:(e,t)=>(0,Z.jsx)(Ut,{event:e,colors:t}),assigned:e=>(0,Z.jsx)(Wt,{event:e}),unassigned:e=>(0,Z.jsx)(Wt,{event:e}),merged:()=>(0,Z.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Z.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Z.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Z.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Z.jsx)(Gt,{event:e})};function qt({event:e,colors:t}){return Kt[e.kind]?.(e,t)??null}function Jt({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:i(`shrink-0`,$t[e]),children:Qt[e]}):null}var Yt={approved:{label:`Approved`,tone:`border-success/40 text-semantic-green`},changes_requested:{label:`Changes requested`,tone:`border-danger/40 text-semantic-red`},commented:{label:`Commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`Dismissed`,tone:`border-border text-muted-foreground`}};function Xt({comment:e}){let t=e.reviewState?Yt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Zt,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(J,{iso:e.createdAt}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:i(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:Dt,children:e.body?(0,Z.jsx)(Qe,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function Zt({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:20,height:20,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-5 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Qt={passing:`✓`,failing:`✗`,pending:`○`},$t={passing:`text-semantic-green`,failing:`text-semantic-red`,pending:`text-semantic-amber`},en={passing:`Checks passing`,failing:`Checks failing`,pending:`Checks pending`};function tn({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function nn({checks:e,url:t}){let n=i(`text-xs font-medium`,$t[e],t&&`hover:underline`),r=`${Qt[e]} ${en[e]}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function rn({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:en[e],"aria-label":en[e],className:i(`shrink-0 font-sans text-xs font-semibold`,$t[e]),children:Qt[e]})}function an(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function on(e,t=[]){let n=an(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=sn(t)),n}function sn(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function cn(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function ln(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function un(e,t,n){let r=(n??``).trim();if(!r)return on(e,t);let i=an(e),a=r.startsWith(i)?i+cn(r.slice(i.length),e):cn(r,e),o=ln(a,e)?a:`${i}\n\n${a}`;return t.length?o+sn(t):o}function dn(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function fn(e,t,n,r,i={}){return t?{...i,workflow:t,task:un(e,n.map(e=>e.id),r)}:n.length?{...i,steps:dn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:un(e,[],r)}:{...i,workflow:`quick-task`,task:un(e,[],r)}}function pn(e){let t=o(),n=l(),r=h(),{runners:i,uninstalled:a,signedOut:s,accounts:c,repoAccount:u,accountFor:d}=We(),f=n.data?.defaultRunner,p=Ae(e.runner,i,f??i[0]??`claude`),m=n.data?.modelsLocked===!0,_=d(p,e.account),v=g(p,!0,_??u?.[p]),y=Re(m?null:e.model,p,r.data,n.data?.defaultModels,v.data),b=Ke(y,v.data);return{runner:p,runnerExplicit:e.runner!==null,model:y,effort:m?``:Ie(e.effort,b),effortOptions:b,runners:i,uninstalled:a,signedOut:s,defaultRunner:f,canRun:t.isSuccess&&i.length>0,modelsLocked:m,providerPending:t.isPending,providerError:t.isError,accounts:c,account:_,repoAccount:u}}function mn(e){return{runner:Ne(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function hn(e){return{...mn(e),...e.account?{agentProfile:e.account}:{}}}function gn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>qe(t,e))}function _n({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,X.useRef)(null),o=(0,X.useRef)(null),[s,c]=(0,X.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,X.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,X.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let u=pn(e),{runner:d,model:f,effort:p,effortOptions:m,runners:_,canRun:v,modelsLocked:y}=u,b=l(),x=h(),S=g(d,!0,u.account??u.repoAccount?.[d]),C=Pe(d,x.data,S.data,[e.model,b.data?.defaultModels?.[d]]),w=n||!v,T=r?u.accounts:[],E=gn(u,T)?(0,Z.jsx)(je,{icon:(0,Z.jsx)(M,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,uninstalled:u.uninstalled,signedOut:u.signedOut,value:d,accounts:T,account:r?u.account:null,repoAccount:r?u.repoAccount:void 0,disabled:w,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===d?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,D=(0,Z.jsx)(K,{icon:(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:f===``?`Default`:C.find(e=>e.id===f).label,value:f,disabled:w,readOnly:y===!0,disabledHint:y?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Ke(n,S.data);t({...e,model:n,effort:e.effort===null?null:Ie(e.effort,r)})},options:C.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:ke(d,x.data,S)},`model`),O=(0,Z.jsx)(K,{icon:(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:m.find(e=>e.value===p)?.label??`auto`,value:p,disabled:w,readOnly:y===!0,disabledHint:y?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:m.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Z.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,Z.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Z.jsx)(Ve,{fill:`model-pill`,children:s?[E,O,D]:[E,D,O]})})}):(0,Z.jsxs)(Ve,{children:[E,D,O]})}var vn={workflow:null,skills:[]},yn=`cez-followup-selection`;function bn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function xn(){try{let e=localStorage.getItem(yn);return e?bn(JSON.parse(e)):{...vn}}catch{return{...vn}}}function Sn(e){try{localStorage.setItem(yn,JSON.stringify(e))}catch{}}var Cn=`cez-followup-prompt:`;function wn(e){try{return localStorage.getItem(Cn+e)??``}catch{return``}}function Tn(e,t){try{t===``?localStorage.removeItem(Cn+e):localStorage.setItem(Cn+e,t)}catch{}}function En({item:e,workflows:t,skills:n,workflow:i,onWorkflowChange:a,selectedSkills:o,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:p,onQueued:h}){let g=C(),_=m(),y=e.kind===`pr`?`PR`:`issue`,b=pn(u),x=s(b.runner,b.account),S=o.filter(e=>x.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),w=S.length!==o.length,[D]=(0,X.useState)(()=>an(e)),[k,A]=(0,X.useState)(()=>wn(e.url)||D),j=(0,X.useRef)(null),M=(0,X.useRef)(null);(0,X.useEffect)(()=>{Tn(e.url,k===D?``:k)},[e.url,k,D]);let N=(0,X.useMemo)(()=>Ze(_.data?.promptTemplates),[_.data?.promptTemplates]),ee=e=>{let t=j.current,n=Xe({prompt:k,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:M.current}),r=Oe(k,n,e);A(r.text),M.current=r.caret,requestAnimationFrame(()=>{j.current?.focus(),j.current?.setSelectionRange(r.caret,r.caret)})},P=ze(N,S.map(e=>e.id)),F=(0,X.useRef)(k);F.current=k;let I=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=Je(F.current,I.current,P,D);I.current=e.applied,e.text!==F.current&&A(e.text)},[P,D]);let L=f({mutationFn:async()=>!b.canRun||w?null:E(fn(e,i,S,k,hn(b))),onSuccess:t=>{if(t===null)return;let n=t;n&&h(e.url,n.id),T(`Added to the queue — ${y} #${e.number}`),S.length>0&&_.data!==void 0&&v({skillUsage:S.reduce((e,t)=>Ee(e,t.id),_.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:c.uiState})).catch(()=>{}),Tn(e.url,``),A(D),I.current=``,g.invalidateQueries({queryKey:c.runs.all})},onError:e=>T(e.message,{tone:`danger`})}),te=e=>{Ue({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!L.isPending&&b.canRun&&L.mutate())},R=e=>l(o.some(t=>W(t)===W(e))?o.filter(t=>W(t)!==W(e)):[...o,Te(e)]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Z.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Z.jsx)(`span`,{children:`Instructions for the agent`}),(0,Z.jsx)($e,{ref:j,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:k,onChange:e=>A(e.target.value),onSelect:e=>{M.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Z.jsx)(Me,{templates:N,onInsert:ee}),(0,Z.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Workflow`}),(0,Z.jsx)(On,{workflows:t,value:i,onChange:a})]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Skills · select one or more`}),(0,Z.jsx)(An,{skills:n,skillUsage:_.data?.skillUsage,selected:o,onToggle:R})]}),o.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:o.map(e=>(0,Z.jsx)(Dn,{skill:e,skills:n,unchecked:x.unchecked,onRemove:()=>R(e)},W(e)))}):null,w?(0,Z.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Z.jsx)(_n,{layout:`row`,pick:u,onChange:d,disabled:L.isPending||!b.canRun,accounts:!0}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Account`}),(0,Z.jsx)(kn,{resolved:b,disabled:L.isPending||!b.canRun,onPick:e=>d({...u,account:e})})]}),!b.providerPending&&!b.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[b.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(V,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[r(e.url)?(0,Z.jsx)(B,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Z.jsxs)(B,{variant:`primary`,"data-action":`gh-run`,disabled:L.isPending||!b.canRun||w,onClick:()=>L.mutate(),children:[(0,Z.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,y]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-xs font-medium text-muted-foreground`,children:He()}),p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(V,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function Dn({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Z.jsx)(A,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function On({workflows:e,value:t,onChange:n}){let[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),c=(0,X.useRef)(null),l=xe(e,o);return(0,Z.jsxs)(ue,{open:r,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:i(Ye,t&&`border-foreground/60 font-mono text-xs font-semibold text-foreground`),children:[(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(le,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(be,{shouldFilter:!1,children:[(0,Z.jsx)(_e,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Z.jsxs)(ye,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Z.jsx)(ve,{children:`Nothing matches.`}):null,(0,Z.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,Z.jsxs)(U,{value:`workflow ${e.name}`,keywords:we(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function kn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:b,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,...e.configDir?{desc:e.configDir}:{}}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Z.jsx)(K,{icon:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function An({skills:e,skillUsage:t,selected:n,onToggle:r}){let[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=De(e,s,t),g=(e,t)=>{let a=n.some(t=>W(t)===W(e));return(0,Z.jsxs)(U,{value:W(e),keywords:we(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>r(Te(e)),children:[(0,Z.jsx)(`span`,{className:i(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},W(e))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Be,{skill:l,onClose:()=>u(null)}),(0,Z.jsxs)(ue,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:i(Ye,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(le,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(be,{shouldFilter:!1,children:[(0,Z.jsx)(_e,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Z.jsxs)(ye,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Z.jsx)(H,{children:(0,Z.jsxs)(U,{value:`typed-skill`,onSelect:()=>r({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Z.jsx)(ve,{children:`Nothing matches.`}):null,h?h.length>0?(0,Z.jsx)(H,{children:h.map(e=>g(e,Se(e)))}):null:(0,Z.jsxs)(Z.Fragment,{children:[f.length>0?(0,Z.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,Se(e)))}):null,p.length>0?(0,Z.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Z.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var jn=new WeakMap;function Mn(){let e=xn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&Sn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Nn(){let e=C(),{projectId:t}=S(),n=jn.get(e);n||jn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=Mn());let{snapshot:i,subscribe:o,update:c}=r,l=(0,X.useSyncExternalStore)(o,i,i),u=a(),d=pn(l.engine),f=s(d.runner,d.account),p=m(),h=u.data?.workflows;(0,X.useEffect)(()=>{h&&l.workflow!==null&&!h.some(e=>e.name===l.workflow)&&c({workflow:null})},[c,h,l.workflow]);let g=(0,X.useMemo)(()=>Ce(f.data??[],p.data?.skillUsage),[f.data,p.data?.skillUsage]);return{...l,workflows:u,skillList:g,skillsUnchecked:f.unchecked,setWorkflow:e=>c({workflow:e}),setSelectedSkills:e=>c({selectedSkills:e}),setEngine:e=>c({engine:e}),onQueued:(e,t)=>c({queued:new Map(i().queued).set(e,t)})}}export{tn as a,Rt as c,St as d,xt as f,rn as i,yt as l,En as n,Nt as o,on as r,Ct as s,Nn as t,bt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{A as i,Jt as a,Wt as o,dn as s,k as c}from"./queries-CYWRnyM5.js";import{A as l,Fn as u,hi as d,k as f,n as p,p as ee,u as te}from"./toaster-B0kvcFif.js";import{h as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{J as re,L as m,S as h,X as ie,at as g,b as ae,c as oe,ft as _,i as se,l as v,lt as y,n as ce,ot as le,st as ue,tt as b,v as de,x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./button-B7MKxYjT.js";import{i as fe,p as C,r as w,t as T}from"./dropdown-menu-4e2iKSMT.js";import{i as E,o as D,r as pe,s as O,t as k}from"./dialog-B531GGAo.js";import{i as A,l as me,o as he}from"./skills-pM_PouEs.js";import{d as ge,l as _e,s as ve}from"./page-shell-7pLJMOgh.js";import{t as ye}from"./centered-state-V15AR_qo.js";import{Gt as j,Ht as M,Jt as N,Kt as be,Ut as P,Vt as F,Wt as I,Xn as L,qt as R,w as xe}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{A as i,Jt as a,Wt as o,dn as s,k as c}from"./queries-CYWRnyM5.js";import{A as l,Fn as u,hi as d,k as f,n as p,p as ee,u as te}from"./toaster-B0kvcFif.js";import{h as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{J as re,L as m,S as h,X as ie,at as g,b as ae,c as oe,ft as _,i as se,l as v,lt as y,n as ce,ot as le,st as ue,tt as b,v as de,x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./button-B7MKxYjT.js";import{i as fe,p as C,r as w,t as T}from"./dropdown-menu-4e2iKSMT.js";import{i as E,o as D,r as pe,s as O,t as k}from"./dialog-B531GGAo.js";import{i as A,l as me,o as he}from"./skills-pM_PouEs.js";import{d as ge,l as _e,s as ve}from"./page-shell-7pLJMOgh.js";import{t as ye}from"./centered-state-V15AR_qo.js";import{Gt as j,Ht as M,Jt as N,Kt as be,Ut as P,Vt as F,Wt as I,Xn as L,qt as R,w as xe}from"./index-BZr8Y74X.js";import{_ as z,a as Se,c as Ce,f as we,g as Te,h as Ee,i as De,m as B,n as Oe,o as ke,p as Ae,r as V,t as H,u as je}from"./sortable.esm-CAVTYaA3.js";import{t as U}from"./textarea-vJt9undk.js";var W=e(t(),1);function G(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Me(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function Ne(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function Pe(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Fe(e,t){return e.filter((e,n)=>n!==t)}function K(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function q(e,t,n){let r=` `.repeat(n);return t.includes(`
|
|
2
2
|
`)?[`${r}${e}: |`,...t.split(`
|
|
3
3
|
`).map(e=>`${r} ${e}`)]:[`${r}${e}: ${K(t)}`]}function J(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${K(e.name)}`),e.skill&&t.push(` skill: ${K(e.skill)}`),t}function Y(e){let t=[];return e.model&&t.push(` model: ${K(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${K(e.effort)}`),e.runner&&t.push(` runner: ${K(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${K(e.agentProfile)}`),t}function X(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(K).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(K).join(`, `)}]`),t}function Z(e){return e.onFail?[` onFail:`,` retry: ${K(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Ie(e){return[` - id: ${K(e.id)}`,...J(e),...e.prompt?q(`prompt`,e.prompt,4):[],...e.kind===`plugin`?[` kind: plugin`,` pluginKind: ${K(e.pluginKind)}`,...e.config===void 0?[]:[` config: ${JSON.stringify(e.config)}`]]:[],...Y(e),...X(e),...e.command?q(`command`,e.command,4):[],...Z(e)]}function Le(e,t,n){let r=[`name: ${K(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...q(`description`,t.trim(),0));let i=G(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${K(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Ie(e))}else r.push(`skills: []`);return`${r.join(`
|
|
4
4
|
`)}\n`}function Re(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function ze(e){let t=G(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Be(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ve(e,t,n){let r=G(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var Q=n();function He({workflows:e,draft:t,trimmedName:n,nameRef:r,onDraft:i,onLoadWorkflow:a}){return(0,Q.jsxs)(`section`,{"data-slot":`wb-metadata`,className:`grid min-w-0 grid-cols-1 gap-3 @xl:grid-cols-2 @4xl:grid-cols-[minmax(180px,240px)_minmax(200px,280px)_minmax(0,1fr)] @xl:items-start`,children:[(0,Q.jsxs)(`div`,{"data-slot":`wb-load`,className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-load`,className:`text-xs font-medium text-foreground`,children:`Load an existing workflow`}),(0,Q.jsxs)(`div`,{className:`relative flex min-w-0 items-center`,children:[(0,Q.jsxs)(`select`,{id:`workflow-load`,value:e.some(e=>e.name===n)?n:``,onChange:t=>{let n=e.find(e=>e.name===t.target.value);n&&a(n)},className:`h-10 w-full min-w-0 appearance-none rounded-lg border border-border bg-card pr-9 pl-3.5 text-xs font-medium text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:h-11`,children:[(0,Q.jsx)(`option`,{value:``,disabled:!0,children:`Choose a workflow`}),e.map(e=>(0,Q.jsx)(`option`,{value:e.name,"data-slot":`wb-load-option`,"data-name":e.name,children:e.name},e.name))]}),(0,Q.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-3 size-4 text-muted-foreground`})]})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-medium text-foreground`,children:`Workflow name`}),(0,Q.jsx)(L,{id:`workflow-name`,ref:r,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:t.name,onChange:e=>i({...t,name:e.target.value}),className:`h-10 bg-card text-sm max-md:h-11`})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 @xl:col-span-2 @4xl:col-span-1`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-medium text-foreground`,children:`Description`}),(0,Q.jsx)(U,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,rows:1,value:t.description,onChange:e=>i({...t,description:e.target.value}),className:`min-h-10 bg-card px-3 py-2 text-sm max-md:min-h-11`})]})]})}function Ue({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:a}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-actions`,className:`grid grid-cols-[max-content_max-content] items-center justify-start gap-2 sm:flex sm:flex-wrap [&_button]:min-h-11 [&_button]:border [&_button]:border-border [&_button]:bg-card`,children:[(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,className:`col-span-2 justify-self-start`,onClick:n,children:[(0,Q.jsx)(ue,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,className:`col-span-2 justify-self-start`,title:`Download workflow.yaml`,onClick:r,children:[(0,Q.jsx)(ae,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":t,"aria-describedby":`wb-auto-hint`,title:`Auto-build: describe the chain in words and an agent drafts its steps for you to review`,onClick:i,children:[(0,Q.jsx)(y,{"aria-hidden":`true`,className:`size-3`}),`Auto-build`]}),(0,Q.jsx)(`span`,{id:`wb-auto-hint`,className:`sr-only`,children:`Describe the chain in words and an agent drafts its steps for you to review.`}),e?(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-delete`,className:`relative text-danger hover:text-danger sm:ms-3 sm:before:absolute sm:before:-start-[13px] sm:before:top-1/2 sm:before:h-5 sm:before:w-px sm:before:-translate-y-1/2 sm:before:bg-border sm:before:content-['']`,title:`Delete the saved workflow file`,onClick:a,children:[(0,Q.jsx)(g,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null]})}function We({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,Q.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,Q.jsx)(U,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),r())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Q.jsxs)(S,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,Q.jsx)(y,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,Q.jsx)(_,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,Q.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function Ge({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:a,onRun:o,onCancel:s}){return(0,Q.jsx)(k,{open:e,onOpenChange:t,children:(0,Q.jsxs)(pe,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(O,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,Q.jsx)(E,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,Q.jsx)(U,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Qt as r,St as i,Vt as a,rn as o,yt as s}from"./queries-CYWRnyM5.js";import{n as c}from"./toaster-B0kvcFif.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import"./tasks-table-k18AuMR5.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./button-B7MKxYjT.js";import{t as f}from"./status-dot-BRzVlF2X.js";import{r as p,t as m}from"./agents-settings-path-7X6_cvUg.js";import{a as h,d as g}from"./page-shell-7pLJMOgh.js";import{On as _,Yn as v,Yt as y,Zn as b,qn as x}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Qt as r,St as i,Vt as a,rn as o,yt as s}from"./queries-CYWRnyM5.js";import{n as c}from"./toaster-B0kvcFif.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import"./tasks-table-k18AuMR5.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./button-B7MKxYjT.js";import{t as f}from"./status-dot-BRzVlF2X.js";import{r as p,t as m}from"./agents-settings-path-7X6_cvUg.js";import{a as h,d as g}from"./page-shell-7pLJMOgh.js";import{On as _,Yn as v,Yt as y,Zn as b,qn as x}from"./index-BZr8Y74X.js";var S=e(t(),1),C=n();function w(e){let t=e.replace(/\binstall\b/g,(e,t)=>t===0?`Install`:e),n=t.split(/(`[^`]+`)/g);if(n.length===1){let e=t.split(/(\bgh auth login\b)/g);return e.length===1?t:e.map((e,t)=>e===`gh auth login`?(0,C.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e},t):(0,C.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,C.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.slice(1,-1)},t):e?(0,C.jsx)(`span`,{children:e},t):null)}function T(e,t){let n=r(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}function E({mode:e,version:t,rawVersion:n}){return e?(0,C.jsx)(`span`,{"data-slot":`tool-dry-run`,title:n,className:`shrink-0 rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:e.label}):t?(0,C.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,t]}):null}var D=`h-8 text-xs font-medium max-md:h-11 no-hover:h-11`;function O({health:e,projects:t,repository:n,onAction:r}){let i=!!(e.data?.repoRoot||n||t.data?.projectsDir);return(0,C.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`add-project-heading`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{id:`add-project-heading`,className:`text-base font-semibold text-foreground`,children:`Add project`}),(0,C.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a new repository, open an existing local folder, or clone a GitHub repository.`})]}),i?(0,C.jsxs)(`div`,{className:`border-y border-border py-3.5`,children:[(0,C.jsx)(`h3`,{className:`mb-2.5 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:`Active project`}),(0,C.jsxs)(`dl`,{className:`space-y-2 text-[13px] leading-[1.5] text-muted-foreground`,children:[e.data?.repoRoot?(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,C.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Local folder`}),(0,C.jsx)(`dd`,{className:`min-w-0 font-mono text-xs break-all`,children:e.data.repo?.root??e.data.repoRoot})]}):null,n?(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,C.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Repository`}),(0,C.jsx)(`dd`,{className:`min-w-0 font-mono text-xs break-all`,children:n.replace(/^https:\/\//,``)})]}):null,t.data?.projectsDir?(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,C.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Checkout folder`}),(0,C.jsx)(`dd`,{className:`min-w-0 font-mono text-xs break-all`,children:t.data.projectsDir})]}):null]})]}):null,(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,C.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,"data-action":`new-project`,onClick:()=>r(`new`),children:`New project`}),(0,C.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,onClick:()=>r(`local`),children:`Open local folder`}),(0,C.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,onClick:()=>r(`clone`),children:`Clone from GitHub`})]})]})}function k({health:e,runners:t,copying:n,onCopy:r}){return(0,C.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,C.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,C.jsx)(d,{asChild:!0,variant:`outline`,size:`sm`,className:D,children:(0,C.jsxs)(l,{to:m,"data-slot":`tools-settings`,children:[`Tool settings`,(0,C.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,C.jsx)(`p`,{role:`alert`,className:`text-sm text-semantic-red`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,C.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,C.jsx)(`dl`,{className:`divide-y divide-border border-y border-border text-[13px] leading-[1.5] text-muted-foreground`,children:e.data.checks.map(e=>{let n=y(e),r=T(e.name,t),i=_(e);return(0,C.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":e.available,className:`grid grid-cols-1 gap-x-4 gap-y-1 py-3 sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center`,children:[(0,C.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,C.jsx)(f,{tone:i.availability.tone,shape:i.availability.shape}),(0,C.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,C.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,C.jsx)(`span`,{className:`shrink-0`,children:i.availability.label}),(0,C.jsx)(E,{mode:i.mode,version:i.version,rawVersion:i.rawVersion}),e.available?null:(0,C.jsx)(d,{asChild:!0,variant:`outline`,size:`sm`,className:`${D} ml-auto`,children:(0,C.jsxs)(l,{to:p(e.name),"data-slot":`tool-setup`,children:[`Set up`,(0,C.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),n?(0,C.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:w(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,C.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,C.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`})]})]})}function A(){let e=s(),t=i(),n=o().data,r=a(e.data?.repo?.remote),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)(!1),p=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),c(`Diagnostics copied`)}catch{c(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},m=e.data?.checks.length??4;return(0,C.jsxs)(h,{route:`workspace-tools`,density:e.data?g(m):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Add projects and inspect local workspace CLI diagnostics.`},children:[(0,C.jsx)(O,{health:e,projects:t,repository:r,onAction:u}),(0,C.jsx)(k,{health:e,runners:n,copying:d,onCopy:p}),l===`new`?(0,C.jsx)(x,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,C.jsx)(b,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,C.jsx)(v,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{A as WorkspaceToolsRoute};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Wt as t,_ as n,dn as r,yt as i}from"./queries-CYWRnyM5.js";import{Fn as a,Ir as o,Lr as s,P as c,hi as l,n as u}from"./toaster-B0kvcFif.js";import{u as d}from"./design-icons-CzEoMH9c.js";import{t as f}from"./button-B7MKxYjT.js";import{t as p}from"./project-router-BvBqllk2.js";import{t as m}from"./centered-state-V15AR_qo.js";import{fn as h,ir as g}from"./index-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Wt as t,_ as n,dn as r,yt as i}from"./queries-CYWRnyM5.js";import{Fn as a,Ir as o,Lr as s,P as c,hi as l,n as u}from"./toaster-B0kvcFif.js";import{u as d}from"./design-icons-CzEoMH9c.js";import{t as f}from"./button-B7MKxYjT.js";import{t as p}from"./project-router-BvBqllk2.js";import{t as m}from"./centered-state-V15AR_qo.js";import{fn as h,ir as g}from"./index-BZr8Y74X.js";import{n as _,r as v,t as y}from"./remote-settings-notice-BFeWL9QB.js";import{n as b}from"./saved-draft-BwzBc-_Y.js";import{t as x}from"./save-cue-Cd3ZAPBS.js";import{n as S}from"./settings-field-DP9sYv5a.js";import{n as C}from"./project-location-CZNz3wYW.js";var w=e();function T({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,w.jsxs)(w.Fragment,{children:[t===0&&i===null?(0,w.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,w.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,w.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,w.jsxs)(w.Fragment,{children:[`the project’s `,(0,w.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,w.jsx)(`code`,{className:`break-all`,children:r}),` `,`on the machine running Squawk. `,e.fileEditApplies,` No restart is needed. To edit here, the host operator runs `,(0,w.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,w.jsxs)(`p`,{"data-slot":`${s}-issue`,className:`text-xs text-danger`,children:[`config.json has an invalid `,e.key,` (`,i,`) — saving replaces it.`]}),a===null?null:(0,w.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function E(e,t){let n=e.split(`
|
|
2
2
|
`).map(e=>e.trim()).filter(e=>e!==``),r=Number(t);return{commands:n,timeoutSeconds:r,invalid:n.length>20?`Enter at most 20 commands.`:n.some(e=>e.length>4e3)?`Keep each command under ${o.toLocaleString(`en-US`)} characters.`:t.trim()===``||!Number.isInteger(r)||r<1||r>7200?`Enter a whole number of seconds from 1 to ${s}.`:null}}var D={setup:{key:`worktreeSetup`,issueKey:`worktreeSetupIssue`,slot:`worktree-setup`,title:`Prepare new worktrees`,hint:`Runs in order in every new task and worker worktree before the agent starts. The first failure stops setup.`,empty:`No setup commands configured. No commands will run in new worktrees.`,label:`Worktree setup commands, one per line`,example:`npm ci`,fileEditApplies:`Valid file edits apply to new worktrees.`,saved:`Worktree setup saved`,cleared:`Worktree setup cleared`,save:`Save setup`},teardown:{key:`worktreeTeardown`,issueKey:`worktreeTeardownIssue`,slot:`worktree-teardown`,title:`Stop worker services before destroy`,hint:`Runs in order in a worker’s worktree when the worker is destroyed, before its processes stop. The first failure stops teardown; destroy goes on and records it on the worker.`,empty:`No teardown commands configured. Destroy runs no commands in worker worktrees.`,label:`Worktree teardown commands, one per line`,example:`docker compose down`,fileEditApplies:`Valid file edits apply to the next worker destroy.`,saved:`Worktree teardown saved`,cleared:`Worktree teardown cleared`,save:`Save teardown`}};function O(e,t){return t?`One command per line, for example: ${e.example}`:void 0}function k({config:e,copy:n}){let o=l(),d=i(),p=v(),m=C(),g=m===null?null:`${m.replace(/\/$/,``)}/.ai/cezar/config.json`,y=d.data?.capabilities?.settingsAdmin===!0,D=e[n.key],k=e[n.issueKey],A=D?.commands??[],j=D?.timeoutSeconds??900,[M,N]=b(A.join(`
|
|
3
3
|
`)),[P,F]=b(String(j)),{commands:I,timeoutSeconds:L,invalid:R}=E(M,P),z=I.length===A.length&&I.every((e,t)=>e===A[t])&&(I.length===0||L===j),B=k===null&&z;h(y&&!z);let V=r({mutationFn:e=>c(e),onSuccess:e=>{o.setQueryData(t.config,e),N(I.join(`
|
|
4
4
|
`)),u(I.length===0?n.cleared:n.saved)},onError:e=>{u(e.message,{tone:`danger`}),e instanceof a&&e.status===409&&p()}}),H=()=>V.mutate({[n.key]:I.length===0?null:{commands:I,...L===900?{}:{timeoutSeconds:L}}}),U=`block rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50 read-only:bg-muted read-only:text-muted-foreground`;return(0,w.jsxs)(S,{title:n.title,hint:n.hint,children:[(0,w.jsx)(_,{risk:`These commands run on the machine running Squawk`}),(0,w.jsxs)(T,{copy:n,savedCommandCount:A.length,settingsAdmin:d.data?.capabilities?.settingsAdmin,configPath:g,issue:k,invalid:R,children:[(0,w.jsx)(`textarea`,{"data-slot":`${n.slot}-commands`,"data-reports-dirty":``,"aria-label":n.label,rows:4,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,value:M,placeholder:O(n,y),readOnly:!y,disabled:V.isPending,onChange:e=>N(e.target.value),className:`${U} field-sizing-content min-h-24 max-h-[min(24rem,60dvh)] w-full resize-none overflow-y-auto font-mono text-[13px] leading-relaxed`}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsx)(`span`,{children:`Timeout per command`}),(0,w.jsx)(`input`,{type:`number`,inputMode:`numeric`,min:1,max:s,step:1,"data-slot":`${n.slot}-timeout`,"data-reports-dirty":``,value:P,readOnly:!y,disabled:V.isPending,onChange:e=>F(e.target.value),className:`${U} min-h-11 w-28 md:min-h-0`}),(0,w.jsx)(`span`,{children:`seconds`})]}),(0,w.jsx)(x,{show:y&&B&&!V.isPending,children:(0,w.jsx)(f,{type:`button`,variant:`primary`,size:`sm`,className:`min-h-11 md:min-h-0`,"data-action":`${n.slot}-save`,disabled:!y||B||R!==null||V.isPending,onClick:H,children:n.save})})]})]})]})}var A=0,j=1e3;function M(){let e=n();return e.isPending?(0,w.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading worktree settings…`}):e.isError?(0,w.jsx)(m,{icon:(0,w.jsx)(g,{}),tone:`danger`,title:`Worktree settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,w.jsx)(N,{config:e.data})}function N({config:e}){let n=l(),i=r({mutationFn:e=>c(e),onSuccess:e=>n.setQueryData(t.config,e),onError:e=>u(e.message,{tone:`danger`})}),[a,o]=b(String(e.worktreeRetention)),s=Number(a),m=a.trim()===``||!Number.isInteger(s)||s<A||s>j,g=e.worktreeRetention===(m?-1:s);return h(!g),(0,w.jsxs)(`div`,{"data-slot":`worktrees-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,w.jsxs)(S,{title:`Keep N finished worktrees`,hint:`Older finished worktrees are removed to free disk; their branch stays, so the work is recoverable. 0 keeps all. Running and in-review tasks are never removed.`,children:[(0,w.jsxs)(`div`,{"data-reports-dirty":``,className:`flex items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`number`,inputMode:`numeric`,min:A,max:j,step:1,"aria-label":`Keep last N finished worktrees`,"data-slot":`resources-worktree-retention`,value:a,disabled:i.isPending,onChange:e=>o(e.target.value),className:`block w-32 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`}),(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`worktrees`}),(0,w.jsx)(x,{show:g&&!m&&!i.isPending,children:(0,w.jsx)(f,{type:`button`,variant:`primary`,size:`sm`,"data-action":`resources-save-retention`,disabled:g||m||i.isPending,onClick:()=>i.mutate({worktreeRetention:s},{onSuccess:()=>{n.invalidateQueries({queryKey:t.worktrees}),u(s===0?`Keeping all worktrees (unlimited)`:`Keeping the last ${s} finished worktree${s===1?``:`s`}`)}}),children:`Save retention`})})]}),m?(0,w.jsxs)(`p`,{"data-slot":`resources-retention-invalid`,className:`text-xs text-danger`,children:[`Enter a whole number from `,A,` to `,j,` (0 = unlimited).`]}):(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s===0?`Keeping every finished worktree.`:`Keeping the last ${s} finished worktree${s===1?``:`s`} on disk.`})]}),(0,w.jsx)(k,{config:e,copy:D.setup}),(0,w.jsx)(k,{config:e,copy:D.teardown}),(0,w.jsxs)(p,{to:`/git/cleanup`,"data-slot":`worktrees-manage-link`,className:`inline-flex min-h-11 items-center gap-1 self-start text-[13px] font-medium text-link-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring md:min-h-0`,children:[`Manage worktrees on Git`,(0,w.jsx)(d,{"aria-hidden":`true`,className:`size-[14px]`})]})]})}export{M as WorktreesSection};
|
package/web/dist/index.html
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
}
|
|
60
60
|
})()
|
|
61
61
|
</script>
|
|
62
|
-
<script type="module" crossorigin src="/assets/index-
|
|
62
|
+
<script type="module" crossorigin src="/assets/index-BZr8Y74X.js"></script>
|
|
63
63
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-rHxsej31.js">
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
<link rel="modulepreload" crossorigin href="/assets/page-shell-7pLJMOgh.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="/assets/centered-state-V15AR_qo.js">
|
|
121
121
|
<link rel="stylesheet" crossorigin href="/assets/page-shell-DQPYcKyL.css">
|
|
122
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
122
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D9L-uSh4.css">
|
|
123
123
|
</head>
|
|
124
124
|
<body>
|
|
125
125
|
<div id="root"></div>
|