ccdeck 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/web/assets/AccountBridge-fp-fsMx-.js +1 -0
- package/dist/web/assets/{AccountSection-BpIHPhF3.js → AccountSection-Cu-96Q00.js} +1 -1
- package/dist/web/assets/{BrowserWatchModal-DBdt52v7.js → BrowserWatchModal-CvUx07C6.js} +1 -1
- package/dist/web/assets/{FeedbackConversations-BJjgXI0-.js → FeedbackConversations-BgVk0nkA.js} +1 -1
- package/dist/web/assets/{IntegrationModal-DQ0vEz4X.js → IntegrationModal-CEj5oJg4.js} +1 -1
- package/dist/web/assets/{IntegrationSkeleton-JCPbqp96.js → IntegrationSkeleton-DD7YiFgd.js} +1 -1
- package/dist/web/assets/{RadioPanel-Be6AkrKl.js → RadioPanel-BhnzWRCT.js} +1 -1
- package/dist/web/assets/{StageShell-Dq0JOQhd.js → StageShell-DmJu3dU1.js} +3 -3
- package/dist/web/assets/{TrafficRadar-7jqJbhaK.js → TrafficRadar-C8-ieIw5.js} +1 -1
- package/dist/web/assets/{UsageHistoryModal-ckawZGoe.js → UsageHistoryModal-BThv9Kja.js} +1 -1
- package/dist/web/assets/{app-BRjYF6oD.css → app-DtosBis5.css} +1 -1
- package/dist/web/assets/{app-40gNTTfq.js → app-ZMmmEHxF.js} +94 -94
- package/dist/web/assets/{index-XIY3yFiN.js → index-zSxC5ueJ.js} +1 -1
- package/dist/web/assets/{inspector-status-pane-BV_m7eBv.js → inspector-status-pane-BgQG0bQi.js} +1 -1
- package/dist/web/assets/{screens-9_ivqfcF.js → screens-DD0uCtat.js} +1 -1
- package/dist/web/assets/{stage-board-NF_wgGRA.js → stage-board-J2rKA9Pg.js} +1 -1
- package/dist/web/assets/{use-account-BUmI-A8e.js → use-account-DvFObI4M.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/release-notes.json +3 -2
- package/dist/web/assets/AccountBridge-OQHT5qmS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./app-
|
|
1
|
+
import"./app-ZMmmEHxF.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();
|
package/dist/web/assets/{inspector-status-pane-BV_m7eBv.js → inspector-status-pane-BgQG0bQi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J as l,K as p}from"./stage-board-
|
|
1
|
+
import{J as l,K as p}from"./stage-board-J2rKA9Pg.js";import{bL as g,aB as u}from"./app-ZMmmEHxF.js";function h(a,o,e){const t=g(o,a.sessionId)??a,i=[...o.values()].filter(n=>n.sessionId===t.sessionId&&n.kind==="subagent"),s=l(p(t,i),e),d=[s.phrase,s.emphasis].filter(Boolean).join(" ")+(s.arg?` · ${s.arg}`:""),r=u(t);return{glyph:r==="partial"?"partial":r==="err"?"error":s.state==="working"?"working":s.state==="waiting"?"waiting":s.state==="ready"?"idle":s.state==="ended"||t.lastTurnEndAt!=null?"done":"idle",phrase:d}}export{h as paneStatus};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cc as ee,j as t,B as v,bh as Y,E as ne,r as u,aA as ke,bg as ye,cd as ge,t as je,u as C,b2 as be,y as Ne}from"./app-40gNTTfq.js";import{I as we}from"./IntegrationSkeleton-JCPbqp96.js";import{S as A,C as Ee}from"./StageShell-Dq0JOQhd.js";import"./stage-board-NF_wgGRA.js";const te="Only in the terminal",Te="Could not read the prompt again, so nothing was sent";function se(e){return{mode:e.origin==="outside"?"readOnly":e.multi?"multi":"choose",outcome:{kind:"none"},focus:null,checked:[],text:"",closed:!1,token:0}}const l=(e,n=[])=>({state:e,effects:n});function G(e){return e.outcome.kind==="none"||e.outcome.kind==="held"}function oe(e,n){const o=n.model.options,s=c=>Number.isInteger(c)&&!!o[c]&&!o[c].locked;switch(e.kind){case"option":return s(e.index);case"text":return s(e.index)&&!!o[e.index].free&&e.text.trim()!=="";case"many":return e.indexes.length>0&&e.indexes.every(s)}}function M(e,n,o){return!o.canRecheck||!oe(n,o)?l(e):l({...e,token:e.token+1,outcome:{kind:"checking",answer:n}},[{type:"recheck",answer:n}])}function Q(e){return e.outcome.kind==="checking"?{...e,token:e.token+1,outcome:{kind:"none"}}:e}function J(e,n,o){const s=o.model.options[n];if(!s||!G(e))return l(e);const c={...e,focus:n};return s.locked?l(c,[{type:"announce",text:te}]):s.free?l({...c,mode:"free"}):M(c,{kind:"option",index:n},o)}function ce(e,n,o){var c;const s=o.model.options.length;switch(n.type){case"focus":return n.index==null?l({...e,focus:null}):e.mode==="readOnly"||n.index<0||n.index>=s?l(e):e.mode==="free"&&!((c=o.model.options[n.index])!=null&&c.free)?l({...e,mode:"choose",focus:n.index}):l({...e,focus:n.index});case"move":{if(e.mode==="readOnly"||e.mode==="free"||s===0)return l(e);const d=e.focus==null?n.by===1?0:s-1:Math.min(s-1,Math.max(0,e.focus+n.by));return l({...e,focus:d})}case"pick":return e.mode==="readOnly"||e.mode==="free"?l(e):e.mode==="multi"?ce(e,{type:"toggle",index:n.index},o):J(e,n.index,o);case"toggle":{if(e.mode!=="multi"||!G(e)||n.index<0||n.index>=s)return l(e);if(o.model.options[n.index].locked)return l({...e,focus:n.index},[{type:"announce",text:te}]);const h=e.checked.includes(n.index)?e.checked.filter(x=>x!==n.index):[...e.checked,n.index].sort((x,m)=>x-m);return l({...e,focus:n.index,checked:h})}case"submit":{if(!G(e))return l(e);if(e.mode==="choose")return e.focus==null?l(e):J(e,e.focus,o);if(e.mode==="free"){const d=e.text.trim(),h=e.focus==null?void 0:o.model.options[e.focus];return!d||e.focus==null||!(h!=null&&h.free)||h.locked?l(e):M(e,{kind:"text",index:e.focus,text:d},o)}return e.mode==="multi"&&e.checked.length?M(e,{kind:"many",indexes:e.checked},o):l(e)}case"openFree":{if(e.mode!=="choose"||!G(e))return l(e);const d=o.model.options.findIndex(h=>h.free&&!h.locked);return d<0?l(e):l({...e,mode:"free",focus:d})}case"typeFree":return e.mode==="free"?l({...e,text:n.text}):l(e);case"escape":return e.mode==="free"?l({...Q(e),mode:"choose"}):l({...Q(e),closed:!0},[{type:"close"}]);case"result":{if(e.closed||e.outcome.kind!=="checking"||n.token!==void 0&&n.token!==e.token)return l(e);const{answer:d}=e.outcome,h=n.result;return h==="ok"&&!oe(d,o)?l({...e,outcome:{kind:"none"}}):h==="ok"?l({...e,outcome:{kind:"sent",answer:d}},[{type:"send",answer:d},{type:"record",answer:d}]):l({...e,outcome:h})}case"checkFailed":return e.closed||e.outcome.kind!=="checking"||n.token!==void 0&&n.token!==e.token?l(e):l({...e,outcome:{kind:"none"}},[{type:"announce",text:Te}]);case"reset":return l({...se(o.model),token:e.token+1});case"elsewhere":return l({...e,outcome:{kind:"elsewhere",at:n.at}});case"outcome":return l({...e,outcome:n.input});case"dismissOutcome":return l({...e,outcome:{kind:"none"},closed:e.outcome.kind==="sent"||e.outcome.kind==="elsewhere"?!0:e.closed});case"showTerm":return l(e,[{type:"showTerm"}]);case"showNew":return l(e,[{type:"showNew"}]);default:return l(e)}}const Se="Decision",ve="Keys on the question",X={id:"decision",rows:[{cap:"1 – 3",action:"Pick an answer and send it, after the prompt is read again",binds:["1","2","3"]},{cap:"↑ ↓ Tab",action:"Move the ring along the answers",binds:["ArrowUp","ArrowDown","Tab"]},{cap:"↵",action:"Send the answer the ring is on",binds:["Enter"]},{cap:"Esc",action:"Close the question. It never answers",binds:["Escape"]}]},S=(e,n)=>({text:e,spoken:n}),Ce=[{caps:[S("1–3","1 to 3")],word:"pick and send",binds:["1","2","3"]},{caps:[S("↑"),S("↓"),S("Tab")],word:"move",binds:["ArrowUp","ArrowDown","Tab"]},{caps:[S("↵","Enter")],word:"send",binds:["Enter"]},{caps:[S("Esc","Escape")],word:"close",binds:["Escape"]}];function wn(e){return{layer:"decision",label:ve,hints:Ce.filter(n=>e||!n.binds.some(ee))}}function En(e){return{id:X.id,title:Se,rows:X.rows.filter(n=>e||!n.binds.some(ee))}}function Oe(e){return!e||typeof e.closest!="function"?"other":e.closest(".dc-input")?"field":e.closest(".dc-opt")?"row":"other"}function Re(e,n,o,s,c){return n==="other"||n==="field"&&e.key!=="Enter"&&e.key!=="Escape"?null:Ie(e,o,s,c)}function Ie(e,n,o,s){if(e.ctrlKey||e.metaKey||e.altKey)return null;switch(e.key){case" ":return s!=null&&s.multi&&s.focus!=null&&s.focus<o?{type:"toggle",index:s.focus}:null;case"ArrowDown":return{type:"move",by:1};case"ArrowUp":return{type:"move",by:-1};case"Tab":return{type:"move",by:e.shiftKey?-1:1};case"Enter":return{type:"submit"};case"Escape":return{type:"escape"};default:{if(!n||!/^[1-3]$/.test(e.key))return null;const c=Number(e.key)-1;return c<o?{type:"pick",index:c}:null}}}const re=()=>t.jsx(v,{name:"lock"}),Ke=()=>t.jsx(v,{name:"changed"}),ie=()=>t.jsx(v,{name:"chevron-right"}),De=()=>t.jsx(v,{name:"file"}),$e=()=>t.jsx(v,{name:"search"}),Fe=()=>t.jsx(v,{name:"terminal"}),_e="Sent only when you pick, after re-reading the prompt",Ae="↵ sends the highlighted answer, after re-reading the prompt",Le="↵ sends what you wrote · Esc goes back to the choices",Ge="Started outside ccdeck, so it is answered in its own terminal",Ue="See it in Term";function Be(e){return`Send ${e} ${e===1?"answer":"answers"} ↵`}function He(e,n,o){return e==="readOnly"?{text:Ge,lock:!1}:e==="free"?{text:Le,lock:!1}:e==="multi"?{text:o>0?Be(o):"",lock:!1}:n?{text:Ae,lock:!1}:{text:_e,lock:!0}}function Me(e){const n=He(e.mode,e.focused,e.checked),o=e.mode==="readOnly";return t.jsxs("div",{className:"dc-foot",children:[!o&&e.mode!=="multi"&&e.singleKeys!==!1&&t.jsxs("span",{className:"dc-foot-pick",children:["Pick ",t.jsx(Y,{children:"1"}),e.rows>1&&t.jsxs(t.Fragment,{children:[" ","–"," ",t.jsx(Y,{children:String(e.rows)})]})]}),t.jsxs("span",{className:"dc-foot-note","data-muted":e.mode==="multi"||void 0,children:[n.lock&&t.jsx(re,{}),n.text]}),!o&&t.jsxs("button",{type:"button",className:"dc-link",onClick:e.onShowTerm,children:[Ue,t.jsx(ne,{})]})]})}const Pe="Claude’s pick",qe="Send";function ze(e){const{option:n}=e,o=u.useId(),s=n.locked?`${o}-lock-${e.index}`:void 0;return t.jsxs("div",{className:"dc-row","data-typing":e.typing||void 0,children:[t.jsxs("div",{ref:e.rowRef,className:"dc-opt",role:e.selection==="radio"?"radio":"checkbox","aria-checked":e.checked,"aria-disabled":n.locked||e.readOnly||void 0,"aria-describedby":s,"aria-keyshortcuts":e.readOnly||e.singleKeys===!1?void 0:String(e.index+1),tabIndex:e.readOnly?void 0:e.tabStop?0:-1,"data-focus":e.focused||void 0,"data-locked":n.locked||void 0,"data-checked":e.checked||void 0,"data-typing":e.typing||void 0,onClick:e.readOnly?void 0:e.onPick,onFocus:e.readOnly?void 0:e.onFocus,children:[t.jsx("span",{className:"dc-chip","aria-hidden":"true",children:e.index+1}),t.jsxs("span",{className:"dc-opt-text",children:[t.jsx("span",{className:"dc-opt-label",children:n.label}),n.locked?t.jsxs("span",{className:"dc-opt-sub dc-lock",id:s,children:[t.jsx(re,{}),n.lockNote]}):t.jsx("span",{className:"dc-opt-sub",children:n.sub})]}),n.pick&&t.jsx("span",{className:"dc-pick",children:Pe}),e.selection==="checkbox"&&t.jsx("span",{className:"dc-box","aria-hidden":"true","data-on":e.checked||void 0})]}),e.typing&&t.jsxs("div",{className:"dc-field",children:[t.jsx("input",{ref:e.inputRef,className:"dc-input",type:"text",value:e.text,"aria-label":n.label,onChange:c=>e.onText(c.target.value),onKeyDown:e.onFieldKey}),t.jsxs("span",{className:"dc-send","aria-hidden":"true",children:[qe," ","↵"]})]})]})}const We="Checking the prompt is still on screen",Ve="Nothing is sent if it changed.",Ye="The question changed, so nothing was sent",Qe="Nothing was sent.",Je="Held: you have unsent text in the terminal",Xe="Send it or clear it there, then pick again.",Ze="Nothing to send from here.";function en(e,n,o){switch(e.kind){case"none":return null;case"checking":return{glyph:t.jsx(A,{kind:"working"}),title:We,sub:Ve};case"sent":return{glyph:t.jsx(A,{kind:"done"}),title:`Sent to ${n.session}`,tone:"ok",sub:n.command?t.jsxs(t.Fragment,{children:["Running ",t.jsx("code",{className:"dc-mono",children:n.command}),"."]}):"Claude has your answer."};case"changed":return{glyph:t.jsx(Ke,{}),title:Ye,sub:t.jsxs(t.Fragment,{children:["Claude now asks about ",t.jsx("code",{className:"dc-mono",children:e.now})]}),link:{label:"Show it",run:o.onShowNew}};case"ended":return{glyph:t.jsx("span",{className:"dc-err",children:t.jsx(ke,{kind:"err",size:14})}),title:`${n.session} ended before the answer went out`,sub:Qe,link:{label:"Open the transcript",run:o.onOpenTranscript}};case"held":return{glyph:t.jsx(A,{kind:"idle"}),title:Je,sub:Xe,link:{label:"Open Term",run:o.onShowTerm}};case"elsewhere":return{glyph:t.jsx(A,{kind:"done"}),title:`Answered in the terminal at ${e.at}`,sub:Ze}}}function nn({outcome:e,model:n,...o}){const s=en(e,n,o);return s?t.jsxs("div",{className:"dc-out",role:"status","aria-atomic":"true","data-kind":e.kind,children:[t.jsx("span",{className:"dc-out-glyph","aria-hidden":"true",children:s.glyph}),t.jsxs("span",{className:"dc-out-text",children:[t.jsx("span",{className:"dc-out-title","data-tone":s.tone,children:s.title}),t.jsx("span",{className:"dc-out-sub",children:s.sub})]}),s.link&&t.jsxs("button",{type:"button",className:"dc-link",onClick:s.link.run,children:[s.link.label,s.link.external&&t.jsx(ne,{})]})]}):t.jsx("div",{className:"dc-out-empty",role:"status","aria-atomic":"true"})}let tn=0;function sn(e){const{model:n}=e,o=ye(),[s]=u.useState(()=>`dc-${++tn}`),[c,d]=u.useState(()=>({...se(n),...e.outcome?{outcome:e.outcome}:null,...e.initial})),[h,x]=u.useState(""),m=u.useRef(c),p=u.useRef(e);p.current=e;const a=u.useRef([]),k=u.useRef(null),j=u.useRef(!1),g=u.useRef(!0);u.useEffect(()=>()=>{g.current=!1},[]);const O=typeof e.recheck=="function",$=u.useMemo(()=>({model:n,canRecheck:O}),[n,O]),F=u.useRef($);F.current=$;const i=u.useCallback(f=>{const r=ce(m.current,f,F.current);m.current=r.state,d(r.state);for(const y of r.effects)w(y)},[]);function w(f){var y,E,T,_,z,W;const r=p.current;switch(f.type){case"recheck":{const V=m.current.token;(y=r.recheck)==null||y.call(r,f.answer).then(xe=>{g.current&&i({type:"result",result:xe,token:V})},()=>{g.current&&i({type:"checkFailed",token:V})})}break;case"send":(E=r.onAnswer)==null||E.call(r,f.answer);break;case"record":(T=r.onRecord)==null||T.call(r,f.answer);break;case"close":(_=r.onClose)==null||_.call(r);break;case"showTerm":(z=r.onShowTerm)==null||z.call(r);break;case"showNew":(W=r.onShowNew)==null||W.call(r);break;case"announce":x(f.text);break}}const R=u.useRef(!0);u.useEffect(()=>{if(R.current){R.current=!1;return}e.outcome&&i({type:"outcome",input:e.outcome})},[e.outcome,i]);const I=u.useRef(n.id);u.useEffect(()=>{I.current!==n.id&&(I.current=n.id,x(""),i({type:"reset"}),p.current.outcome&&i({type:"outcome",input:p.current.outcome}))},[n.id,i]),u.useEffect(()=>{var f;c.focus!=null&&j.current&&((f=a.current[c.focus])==null||f.focus())},[c.focus]);const N=u.useRef(c.mode),K=u.useRef(!1);u.useEffect(()=>{var r,y;const f=N.current;N.current=c.mode,c.mode==="free"&&f!=="free"?(r=k.current)==null||r.focus():f==="free"&&c.mode!=="free"&&K.current&&(K.current=!1,c.focus!=null&&((y=a.current[c.focus])==null||y.focus()))},[c.mode,c.focus]);const D=f=>{const r=m.current;if(r.mode==="readOnly")return;const y=Oe(f.target),E=Re(f,y,o,n.options.length,{multi:r.mode==="multi",focus:r.focus});if(E){if(E.type==="move"&&f.key==="Tab"){const T=r.focus,_=E.by===1?T===n.options.length-1:T===0;if(T!=null&&_)return}f.preventDefault(),f.stopPropagation(),j.current=!0,i(E)}},b=c.outcome,U=b.kind==="checking"||b.kind==="sent"?b.answer:null,fe=U&&U.kind!=="many"?U.index:-1,B=`${s}-title`,H=c.mode==="multi",pe=c.focus??0;return c.closed?null:t.jsxs("div",{className:"dc-dock","data-size":e.size==="phone"?"phone":void 0,"data-mode":c.mode,"data-outcome":b.kind,"data-kind":n.kind,children:[t.jsxs("div",{className:"dc-decision",role:"group","aria-labelledby":B,onKeyDown:D,onBlur:f=>{f.currentTarget.contains(f.relatedTarget)||(j.current=!1,m.current.focus!=null&&m.current.mode!=="free"&&i({type:"focus",index:null}))},children:[t.jsxs("div",{className:"dc-dq","data-outcome":b.kind,children:[t.jsx("h3",{className:"dc-title",id:B,children:n.title}),n.plan?t.jsx("ol",{className:"dc-plan",children:n.plan.map((f,r)=>t.jsxs("li",{children:[t.jsx("span",{className:"dc-plan-n",children:r+1}),f]},r))}):n.command?t.jsx("code",{className:"dc-cmd",children:n.command}):null,t.jsx("p",{className:"dc-caption",children:n.caption})]}),t.jsxs("div",{className:"dc-tree","aria-hidden":"true",children:[t.jsx("i",{className:"dc-stub"}),n.options.map((f,r)=>t.jsx("i",{className:"dc-tick","data-typing":c.mode==="free"&&c.focus===r||void 0},r))]}),t.jsx("div",{className:"dc-opts",role:H?"group":"radiogroup","aria-labelledby":B,children:n.options.map((f,r)=>t.jsx(ze,{index:r,option:f,selection:H?"checkbox":"radio",focused:c.focus===r,checked:H?c.checked.includes(r):fe===r,typing:c.mode==="free"&&c.focus===r,text:c.text,readOnly:c.mode==="readOnly",singleKeys:o,tabStop:pe===r,rowRef:y=>{a.current[r]=y},inputRef:k,onPick:()=>{j.current=!0,i({type:"pick",index:r})},onFocus:()=>i({type:"focus",index:r}),onText:y=>i({type:"typeFree",text:y}),onFieldKey:y=>{y.key==="Enter"?(y.preventDefault(),y.stopPropagation(),i({type:"submit"})):y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),K.current=!0,i({type:"escape"}))}},r))}),t.jsx(nn,{outcome:b,model:n,onShowNew:()=>i({type:"showNew"}),onShowTerm:()=>i({type:"showTerm"}),onOpenTranscript:()=>{var f,r;return(r=(f=p.current).onOpenTranscript)==null?void 0:r.call(f)}})]}),t.jsx(Me,{mode:c.mode,focused:c.focus!=null,checked:c.checked.length,rows:n.options.length,singleKeys:o,onShowTerm:()=>i({type:"showTerm"})}),t.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:h})]})}function on(e){const n=[];return e.forEach((o,s)=>{if(o.kind==="user"||o.kind==="record"){n.push({kind:o.kind,text:o.text,index:s});return}const c=n.at(-1);(c==null?void 0:c.kind)==="assistant"?c.turns.push(o):n.push({kind:"assistant",turns:[o],index:s})}),n}const cn=/^ {0,3}(`{3,}|~{3,})(.*)$/,ae=/^ {0,3}(#{1,6})[\t ]+(.+)$/,P=/^ {0,3}(?:([-+*])|([0-9]{1,9})[.)])[\t ]+(.*)$/,q=/^ {0,3}>[\t ]?(.*)$/;function le(e){const n=cn.exec(e);return n&&!(n[1][0]==="`"&&n[2].includes("`"))?n:null}function de(e){return e.map((n,o)=>n.kind==="code"?t.jsx("code",{children:n.text},o):n.kind==="bold"?t.jsx("strong",{children:de(n.kids)},o):t.jsx(u.Fragment,{children:n.text.split(`
|
|
1
|
+
import{cc as ee,j as t,B as v,bh as Y,E as ne,r as u,aA as ke,bg as ye,cd as ge,t as je,u as C,b2 as be,y as Ne}from"./app-ZMmmEHxF.js";import{I as we}from"./IntegrationSkeleton-DD7YiFgd.js";import{S as A,C as Ee}from"./StageShell-DmJu3dU1.js";import"./stage-board-J2rKA9Pg.js";const te="Only in the terminal",Te="Could not read the prompt again, so nothing was sent";function se(e){return{mode:e.origin==="outside"?"readOnly":e.multi?"multi":"choose",outcome:{kind:"none"},focus:null,checked:[],text:"",closed:!1,token:0}}const l=(e,n=[])=>({state:e,effects:n});function G(e){return e.outcome.kind==="none"||e.outcome.kind==="held"}function oe(e,n){const o=n.model.options,s=c=>Number.isInteger(c)&&!!o[c]&&!o[c].locked;switch(e.kind){case"option":return s(e.index);case"text":return s(e.index)&&!!o[e.index].free&&e.text.trim()!=="";case"many":return e.indexes.length>0&&e.indexes.every(s)}}function M(e,n,o){return!o.canRecheck||!oe(n,o)?l(e):l({...e,token:e.token+1,outcome:{kind:"checking",answer:n}},[{type:"recheck",answer:n}])}function Q(e){return e.outcome.kind==="checking"?{...e,token:e.token+1,outcome:{kind:"none"}}:e}function J(e,n,o){const s=o.model.options[n];if(!s||!G(e))return l(e);const c={...e,focus:n};return s.locked?l(c,[{type:"announce",text:te}]):s.free?l({...c,mode:"free"}):M(c,{kind:"option",index:n},o)}function ce(e,n,o){var c;const s=o.model.options.length;switch(n.type){case"focus":return n.index==null?l({...e,focus:null}):e.mode==="readOnly"||n.index<0||n.index>=s?l(e):e.mode==="free"&&!((c=o.model.options[n.index])!=null&&c.free)?l({...e,mode:"choose",focus:n.index}):l({...e,focus:n.index});case"move":{if(e.mode==="readOnly"||e.mode==="free"||s===0)return l(e);const d=e.focus==null?n.by===1?0:s-1:Math.min(s-1,Math.max(0,e.focus+n.by));return l({...e,focus:d})}case"pick":return e.mode==="readOnly"||e.mode==="free"?l(e):e.mode==="multi"?ce(e,{type:"toggle",index:n.index},o):J(e,n.index,o);case"toggle":{if(e.mode!=="multi"||!G(e)||n.index<0||n.index>=s)return l(e);if(o.model.options[n.index].locked)return l({...e,focus:n.index},[{type:"announce",text:te}]);const h=e.checked.includes(n.index)?e.checked.filter(x=>x!==n.index):[...e.checked,n.index].sort((x,m)=>x-m);return l({...e,focus:n.index,checked:h})}case"submit":{if(!G(e))return l(e);if(e.mode==="choose")return e.focus==null?l(e):J(e,e.focus,o);if(e.mode==="free"){const d=e.text.trim(),h=e.focus==null?void 0:o.model.options[e.focus];return!d||e.focus==null||!(h!=null&&h.free)||h.locked?l(e):M(e,{kind:"text",index:e.focus,text:d},o)}return e.mode==="multi"&&e.checked.length?M(e,{kind:"many",indexes:e.checked},o):l(e)}case"openFree":{if(e.mode!=="choose"||!G(e))return l(e);const d=o.model.options.findIndex(h=>h.free&&!h.locked);return d<0?l(e):l({...e,mode:"free",focus:d})}case"typeFree":return e.mode==="free"?l({...e,text:n.text}):l(e);case"escape":return e.mode==="free"?l({...Q(e),mode:"choose"}):l({...Q(e),closed:!0},[{type:"close"}]);case"result":{if(e.closed||e.outcome.kind!=="checking"||n.token!==void 0&&n.token!==e.token)return l(e);const{answer:d}=e.outcome,h=n.result;return h==="ok"&&!oe(d,o)?l({...e,outcome:{kind:"none"}}):h==="ok"?l({...e,outcome:{kind:"sent",answer:d}},[{type:"send",answer:d},{type:"record",answer:d}]):l({...e,outcome:h})}case"checkFailed":return e.closed||e.outcome.kind!=="checking"||n.token!==void 0&&n.token!==e.token?l(e):l({...e,outcome:{kind:"none"}},[{type:"announce",text:Te}]);case"reset":return l({...se(o.model),token:e.token+1});case"elsewhere":return l({...e,outcome:{kind:"elsewhere",at:n.at}});case"outcome":return l({...e,outcome:n.input});case"dismissOutcome":return l({...e,outcome:{kind:"none"},closed:e.outcome.kind==="sent"||e.outcome.kind==="elsewhere"?!0:e.closed});case"showTerm":return l(e,[{type:"showTerm"}]);case"showNew":return l(e,[{type:"showNew"}]);default:return l(e)}}const Se="Decision",ve="Keys on the question",X={id:"decision",rows:[{cap:"1 – 3",action:"Pick an answer and send it, after the prompt is read again",binds:["1","2","3"]},{cap:"↑ ↓ Tab",action:"Move the ring along the answers",binds:["ArrowUp","ArrowDown","Tab"]},{cap:"↵",action:"Send the answer the ring is on",binds:["Enter"]},{cap:"Esc",action:"Close the question. It never answers",binds:["Escape"]}]},S=(e,n)=>({text:e,spoken:n}),Ce=[{caps:[S("1–3","1 to 3")],word:"pick and send",binds:["1","2","3"]},{caps:[S("↑"),S("↓"),S("Tab")],word:"move",binds:["ArrowUp","ArrowDown","Tab"]},{caps:[S("↵","Enter")],word:"send",binds:["Enter"]},{caps:[S("Esc","Escape")],word:"close",binds:["Escape"]}];function wn(e){return{layer:"decision",label:ve,hints:Ce.filter(n=>e||!n.binds.some(ee))}}function En(e){return{id:X.id,title:Se,rows:X.rows.filter(n=>e||!n.binds.some(ee))}}function Oe(e){return!e||typeof e.closest!="function"?"other":e.closest(".dc-input")?"field":e.closest(".dc-opt")?"row":"other"}function Re(e,n,o,s,c){return n==="other"||n==="field"&&e.key!=="Enter"&&e.key!=="Escape"?null:Ie(e,o,s,c)}function Ie(e,n,o,s){if(e.ctrlKey||e.metaKey||e.altKey)return null;switch(e.key){case" ":return s!=null&&s.multi&&s.focus!=null&&s.focus<o?{type:"toggle",index:s.focus}:null;case"ArrowDown":return{type:"move",by:1};case"ArrowUp":return{type:"move",by:-1};case"Tab":return{type:"move",by:e.shiftKey?-1:1};case"Enter":return{type:"submit"};case"Escape":return{type:"escape"};default:{if(!n||!/^[1-3]$/.test(e.key))return null;const c=Number(e.key)-1;return c<o?{type:"pick",index:c}:null}}}const re=()=>t.jsx(v,{name:"lock"}),Ke=()=>t.jsx(v,{name:"changed"}),ie=()=>t.jsx(v,{name:"chevron-right"}),De=()=>t.jsx(v,{name:"file"}),$e=()=>t.jsx(v,{name:"search"}),Fe=()=>t.jsx(v,{name:"terminal"}),_e="Sent only when you pick, after re-reading the prompt",Ae="↵ sends the highlighted answer, after re-reading the prompt",Le="↵ sends what you wrote · Esc goes back to the choices",Ge="Started outside ccdeck, so it is answered in its own terminal",Ue="See it in Term";function Be(e){return`Send ${e} ${e===1?"answer":"answers"} ↵`}function He(e,n,o){return e==="readOnly"?{text:Ge,lock:!1}:e==="free"?{text:Le,lock:!1}:e==="multi"?{text:o>0?Be(o):"",lock:!1}:n?{text:Ae,lock:!1}:{text:_e,lock:!0}}function Me(e){const n=He(e.mode,e.focused,e.checked),o=e.mode==="readOnly";return t.jsxs("div",{className:"dc-foot",children:[!o&&e.mode!=="multi"&&e.singleKeys!==!1&&t.jsxs("span",{className:"dc-foot-pick",children:["Pick ",t.jsx(Y,{children:"1"}),e.rows>1&&t.jsxs(t.Fragment,{children:[" ","–"," ",t.jsx(Y,{children:String(e.rows)})]})]}),t.jsxs("span",{className:"dc-foot-note","data-muted":e.mode==="multi"||void 0,children:[n.lock&&t.jsx(re,{}),n.text]}),!o&&t.jsxs("button",{type:"button",className:"dc-link",onClick:e.onShowTerm,children:[Ue,t.jsx(ne,{})]})]})}const Pe="Claude’s pick",qe="Send";function ze(e){const{option:n}=e,o=u.useId(),s=n.locked?`${o}-lock-${e.index}`:void 0;return t.jsxs("div",{className:"dc-row","data-typing":e.typing||void 0,children:[t.jsxs("div",{ref:e.rowRef,className:"dc-opt",role:e.selection==="radio"?"radio":"checkbox","aria-checked":e.checked,"aria-disabled":n.locked||e.readOnly||void 0,"aria-describedby":s,"aria-keyshortcuts":e.readOnly||e.singleKeys===!1?void 0:String(e.index+1),tabIndex:e.readOnly?void 0:e.tabStop?0:-1,"data-focus":e.focused||void 0,"data-locked":n.locked||void 0,"data-checked":e.checked||void 0,"data-typing":e.typing||void 0,onClick:e.readOnly?void 0:e.onPick,onFocus:e.readOnly?void 0:e.onFocus,children:[t.jsx("span",{className:"dc-chip","aria-hidden":"true",children:e.index+1}),t.jsxs("span",{className:"dc-opt-text",children:[t.jsx("span",{className:"dc-opt-label",children:n.label}),n.locked?t.jsxs("span",{className:"dc-opt-sub dc-lock",id:s,children:[t.jsx(re,{}),n.lockNote]}):t.jsx("span",{className:"dc-opt-sub",children:n.sub})]}),n.pick&&t.jsx("span",{className:"dc-pick",children:Pe}),e.selection==="checkbox"&&t.jsx("span",{className:"dc-box","aria-hidden":"true","data-on":e.checked||void 0})]}),e.typing&&t.jsxs("div",{className:"dc-field",children:[t.jsx("input",{ref:e.inputRef,className:"dc-input",type:"text",value:e.text,"aria-label":n.label,onChange:c=>e.onText(c.target.value),onKeyDown:e.onFieldKey}),t.jsxs("span",{className:"dc-send","aria-hidden":"true",children:[qe," ","↵"]})]})]})}const We="Checking the prompt is still on screen",Ve="Nothing is sent if it changed.",Ye="The question changed, so nothing was sent",Qe="Nothing was sent.",Je="Held: you have unsent text in the terminal",Xe="Send it or clear it there, then pick again.",Ze="Nothing to send from here.";function en(e,n,o){switch(e.kind){case"none":return null;case"checking":return{glyph:t.jsx(A,{kind:"working"}),title:We,sub:Ve};case"sent":return{glyph:t.jsx(A,{kind:"done"}),title:`Sent to ${n.session}`,tone:"ok",sub:n.command?t.jsxs(t.Fragment,{children:["Running ",t.jsx("code",{className:"dc-mono",children:n.command}),"."]}):"Claude has your answer."};case"changed":return{glyph:t.jsx(Ke,{}),title:Ye,sub:t.jsxs(t.Fragment,{children:["Claude now asks about ",t.jsx("code",{className:"dc-mono",children:e.now})]}),link:{label:"Show it",run:o.onShowNew}};case"ended":return{glyph:t.jsx("span",{className:"dc-err",children:t.jsx(ke,{kind:"err",size:14})}),title:`${n.session} ended before the answer went out`,sub:Qe,link:{label:"Open the transcript",run:o.onOpenTranscript}};case"held":return{glyph:t.jsx(A,{kind:"idle"}),title:Je,sub:Xe,link:{label:"Open Term",run:o.onShowTerm}};case"elsewhere":return{glyph:t.jsx(A,{kind:"done"}),title:`Answered in the terminal at ${e.at}`,sub:Ze}}}function nn({outcome:e,model:n,...o}){const s=en(e,n,o);return s?t.jsxs("div",{className:"dc-out",role:"status","aria-atomic":"true","data-kind":e.kind,children:[t.jsx("span",{className:"dc-out-glyph","aria-hidden":"true",children:s.glyph}),t.jsxs("span",{className:"dc-out-text",children:[t.jsx("span",{className:"dc-out-title","data-tone":s.tone,children:s.title}),t.jsx("span",{className:"dc-out-sub",children:s.sub})]}),s.link&&t.jsxs("button",{type:"button",className:"dc-link",onClick:s.link.run,children:[s.link.label,s.link.external&&t.jsx(ne,{})]})]}):t.jsx("div",{className:"dc-out-empty",role:"status","aria-atomic":"true"})}let tn=0;function sn(e){const{model:n}=e,o=ye(),[s]=u.useState(()=>`dc-${++tn}`),[c,d]=u.useState(()=>({...se(n),...e.outcome?{outcome:e.outcome}:null,...e.initial})),[h,x]=u.useState(""),m=u.useRef(c),p=u.useRef(e);p.current=e;const a=u.useRef([]),k=u.useRef(null),j=u.useRef(!1),g=u.useRef(!0);u.useEffect(()=>()=>{g.current=!1},[]);const O=typeof e.recheck=="function",$=u.useMemo(()=>({model:n,canRecheck:O}),[n,O]),F=u.useRef($);F.current=$;const i=u.useCallback(f=>{const r=ce(m.current,f,F.current);m.current=r.state,d(r.state);for(const y of r.effects)w(y)},[]);function w(f){var y,E,T,_,z,W;const r=p.current;switch(f.type){case"recheck":{const V=m.current.token;(y=r.recheck)==null||y.call(r,f.answer).then(xe=>{g.current&&i({type:"result",result:xe,token:V})},()=>{g.current&&i({type:"checkFailed",token:V})})}break;case"send":(E=r.onAnswer)==null||E.call(r,f.answer);break;case"record":(T=r.onRecord)==null||T.call(r,f.answer);break;case"close":(_=r.onClose)==null||_.call(r);break;case"showTerm":(z=r.onShowTerm)==null||z.call(r);break;case"showNew":(W=r.onShowNew)==null||W.call(r);break;case"announce":x(f.text);break}}const R=u.useRef(!0);u.useEffect(()=>{if(R.current){R.current=!1;return}e.outcome&&i({type:"outcome",input:e.outcome})},[e.outcome,i]);const I=u.useRef(n.id);u.useEffect(()=>{I.current!==n.id&&(I.current=n.id,x(""),i({type:"reset"}),p.current.outcome&&i({type:"outcome",input:p.current.outcome}))},[n.id,i]),u.useEffect(()=>{var f;c.focus!=null&&j.current&&((f=a.current[c.focus])==null||f.focus())},[c.focus]);const N=u.useRef(c.mode),K=u.useRef(!1);u.useEffect(()=>{var r,y;const f=N.current;N.current=c.mode,c.mode==="free"&&f!=="free"?(r=k.current)==null||r.focus():f==="free"&&c.mode!=="free"&&K.current&&(K.current=!1,c.focus!=null&&((y=a.current[c.focus])==null||y.focus()))},[c.mode,c.focus]);const D=f=>{const r=m.current;if(r.mode==="readOnly")return;const y=Oe(f.target),E=Re(f,y,o,n.options.length,{multi:r.mode==="multi",focus:r.focus});if(E){if(E.type==="move"&&f.key==="Tab"){const T=r.focus,_=E.by===1?T===n.options.length-1:T===0;if(T!=null&&_)return}f.preventDefault(),f.stopPropagation(),j.current=!0,i(E)}},b=c.outcome,U=b.kind==="checking"||b.kind==="sent"?b.answer:null,fe=U&&U.kind!=="many"?U.index:-1,B=`${s}-title`,H=c.mode==="multi",pe=c.focus??0;return c.closed?null:t.jsxs("div",{className:"dc-dock","data-size":e.size==="phone"?"phone":void 0,"data-mode":c.mode,"data-outcome":b.kind,"data-kind":n.kind,children:[t.jsxs("div",{className:"dc-decision",role:"group","aria-labelledby":B,onKeyDown:D,onBlur:f=>{f.currentTarget.contains(f.relatedTarget)||(j.current=!1,m.current.focus!=null&&m.current.mode!=="free"&&i({type:"focus",index:null}))},children:[t.jsxs("div",{className:"dc-dq","data-outcome":b.kind,children:[t.jsx("h3",{className:"dc-title",id:B,children:n.title}),n.plan?t.jsx("ol",{className:"dc-plan",children:n.plan.map((f,r)=>t.jsxs("li",{children:[t.jsx("span",{className:"dc-plan-n",children:r+1}),f]},r))}):n.command?t.jsx("code",{className:"dc-cmd",children:n.command}):null,t.jsx("p",{className:"dc-caption",children:n.caption})]}),t.jsxs("div",{className:"dc-tree","aria-hidden":"true",children:[t.jsx("i",{className:"dc-stub"}),n.options.map((f,r)=>t.jsx("i",{className:"dc-tick","data-typing":c.mode==="free"&&c.focus===r||void 0},r))]}),t.jsx("div",{className:"dc-opts",role:H?"group":"radiogroup","aria-labelledby":B,children:n.options.map((f,r)=>t.jsx(ze,{index:r,option:f,selection:H?"checkbox":"radio",focused:c.focus===r,checked:H?c.checked.includes(r):fe===r,typing:c.mode==="free"&&c.focus===r,text:c.text,readOnly:c.mode==="readOnly",singleKeys:o,tabStop:pe===r,rowRef:y=>{a.current[r]=y},inputRef:k,onPick:()=>{j.current=!0,i({type:"pick",index:r})},onFocus:()=>i({type:"focus",index:r}),onText:y=>i({type:"typeFree",text:y}),onFieldKey:y=>{y.key==="Enter"?(y.preventDefault(),y.stopPropagation(),i({type:"submit"})):y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),K.current=!0,i({type:"escape"}))}},r))}),t.jsx(nn,{outcome:b,model:n,onShowNew:()=>i({type:"showNew"}),onShowTerm:()=>i({type:"showTerm"}),onOpenTranscript:()=>{var f,r;return(r=(f=p.current).onOpenTranscript)==null?void 0:r.call(f)}})]}),t.jsx(Me,{mode:c.mode,focused:c.focus!=null,checked:c.checked.length,rows:n.options.length,singleKeys:o,onShowTerm:()=>i({type:"showTerm"})}),t.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:h})]})}function on(e){const n=[];return e.forEach((o,s)=>{if(o.kind==="user"||o.kind==="record"){n.push({kind:o.kind,text:o.text,index:s});return}const c=n.at(-1);(c==null?void 0:c.kind)==="assistant"?c.turns.push(o):n.push({kind:"assistant",turns:[o],index:s})}),n}const cn=/^ {0,3}(`{3,}|~{3,})(.*)$/,ae=/^ {0,3}(#{1,6})[\t ]+(.+)$/,P=/^ {0,3}(?:([-+*])|([0-9]{1,9})[.)])[\t ]+(.*)$/,q=/^ {0,3}>[\t ]?(.*)$/;function le(e){const n=cn.exec(e);return n&&!(n[1][0]==="`"&&n[2].includes("`"))?n:null}function de(e){return e.map((n,o)=>n.kind==="code"?t.jsx("code",{children:n.text},o):n.kind==="bold"?t.jsx("strong",{children:de(n.kids)},o):t.jsx(u.Fragment,{children:n.text.split(`
|
|
2
2
|
`).map((s,c)=>t.jsxs(u.Fragment,{children:[c>0&&t.jsx("br",{}),s]},c))},o))}const L=e=>de(ge(e)),Z=e=>le(e)||ae.test(e)||P.test(e)||q.test(e);function rn({text:e}){const n=e.replace(/\r\n?/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`),o=[];let s=0;for(;s<n.length;){if(!n[s].trim()){s++;continue}const c=s,d=le(n[s]);if(d){const p=d[1],a=new RegExp(`^ {0,3}${p[0]}{${p.length},}[\\t ]*$`),k=d[2].trim().split(/\s+/)[0],j=++s;for(;s<n.length&&!a.test(n[s]);)s++;const g=n.slice(j,s).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bM as U,bN as W,bO as j,t as i,bP as O,bo as p,aG as G,bQ as H,bR as V,bS as B,bT as z,bU as X,ay as J,bV as K,az as E,bW as M,bX as S,bY as I,bZ as q}from"./app-
|
|
1
|
+
import{bM as U,bN as W,bO as j,t as i,bP as O,bo as p,aG as G,bQ as H,bR as V,bS as B,bT as z,bU as X,ay as J,bV as K,az as E,bW as M,bX as S,bY as I,bZ as q}from"./app-ZMmmEHxF.js";const m=14,Z=18,Q=24,A=12,Y=26,ee=24,x=7,T=50,te=22,R=25,$=5,ne=8,se=168,oe=360;function ae(e,n){return n==="rail"||e<=0?x*2+T:x+T+$+(e-1)*R+te+ne}function Pe(e){return e.replace(/^(\d+m) \d+s$/,"$1")}function re(e,n){if(n==="rail")return[];const t=[];for(let s=0;s<e;s++)t.push(x+T+$+s*R);return t}function ie(e){return Math.max(1,Math.floor((e-m*2+A)/(se+A)))}function Ne(e,n,t){const s=new Map([...new Set(e.map(u=>u.col))].sort((u,c)=>u-c).map((u,c)=>[u,c])),a=e.map((u,c)=>({c:u,boardCol:s.get(u.col),order:u.order??c,i:c})).sort((u,c)=>u.boardCol-c.boardCol||u.order-c.order||u.i-c.i),o=s.size;let r=0,l=Math.max(1,o);if(t==="rail")for(;l>1;)l=Math.ceil(l/2),r+=1;else{const u=ie(n);for(;l>u;)l=Math.ceil(l/2),r+=1}const d=t==="rail"?Math.max(0,Math.floor(n-m*2)):Math.max(0,Math.min(oe,Math.floor((n-m*2-A*(l-1))/l))),g=t==="rail"?ee:Y,h=Array.from({length:l},()=>Z),b=Array.from({length:l},()=>[]);for(const{c:u,boardCol:c}of a){const f=t==="rail"?0:c>>r,C=ae(u.rows,t);b[f].push({sessionId:u.sessionId,col:f,boardCol:c,x:m+f*(d+A),y:h[f],w:d,h:C,rows:re(u.rows,t)}),h[f]+=C+g}const k=b.flat(),D=Math.max(0,...k.map(u=>u.y+u.h));return{density:t,columns:l,merges:r,width:n,height:k.length?D+Q:0,tileW:d,tiles:k}}function le(e){const n=[...e].sort((a,o)=>a.x-o.x||a.y-o.y),t=[];let s=-1/0;for(const a of n)t.length===0||a.x>=s?(t.push([a]),s=a.x+a.w):(t[t.length-1].push(a),s=Math.max(s,a.x+a.w));return t.flatMap((a,o)=>[...a].sort((r,l)=>r.y-l.y||r.x-l.x).map((r,l)=>({sessionId:r.sessionId,col:o,order:l})))}function ve(e,n,t){var l;const s=e.tiles.find(d=>d.sessionId===n);if(!s)return null;if(t==="up"||t==="down"){const d=e.tiles.filter(h=>h.col===s.col),g=d.indexOf(s)+(t==="down"?1:-1);return((l=d[g])==null?void 0:l.sessionId)??null}const a=s.col+(t==="right"?1:-1),o=s.y+s.h/2;let r=null;for(const d of e.tiles)d.col===a&&(!r||Math.abs(d.y+d.h/2-o)<Math.abs(r.y+r.h/2-o))&&(r=d);return(r==null?void 0:r.sessionId)??null}function Le(e){const n=new Map,t=new Map;for(const a of e){if(a.type!=="agent")continue;const o=a.data;if(!(o!=null&&o.sessionId)||o.exitAt!=null)continue;if(o.kind==="root"){n.set(o.sessionId,o);continue}const r=t.get(o.sessionId)??[];r.push({d:o,x:a.position.x,y:a.position.y}),t.set(o.sessionId,r)}const s=new Map;for(const a of new Set([...n.keys(),...t.keys()])){const o=(t.get(a)??[]).sort((r,l)=>r.y-l.y||r.x-l.x);s.set(a,{sessionId:a,root:n.get(a)??null,subs:o.map(r=>r.d)})}return s}function Oe(e,n){if(e.size!==n.size)return!1;for(const[t,s]of e){const a=n.get(t);if(!a||s.root!==a.root||s.subs.length!==a.subs.length)return!1;for(let o=0;o<s.subs.length;o++)if(s.subs[o]!==a.subs[o])return!1}return!0}function Re(e,n){return le(e).map(({sessionId:t,col:s,order:a})=>{var o;return{sessionId:t,col:s,order:a,rows:((o=n.get(t))==null?void 0:o.subs.length)??0}})}const y={sayWaiting:U,describeCall:e=>({name:j(e.name).label,subject:W(e.name,e.input)})};function $e(e){return O(e,e.kind==="root"?e.branch:void 0,y)}function Fe(e){return e===0?i("board.nav.none"):i("board.hosts.sessions",{count:e})}function w(e){let n=5381;for(let t=0;t<e.length;t++)n=(n<<5)+n^e.charCodeAt(t);return Math.abs(n)%360}const ue=3e3;function De(e,n){return e.exitStatus===0&&e.exitSignal===void 0&&n>=ue}function de(e){return e.kind==="live"||e.kind==="ended"||e.kind==="detached"||e.kind==="attaching"&&e.reconnect}function ce(e,n){return de(n)?"shown":n.kind==="attaching"&&e!=="hidden"?"held":"hidden"}function Ue(e,n){const t=ce(e.state,n),s=t==="shown"&&(e.state==="held"||e.state==="shown"&&e.afterHold);return{state:t,afterHold:s}}function We(e,n){return e.kind==="starting"||e.kind==="attaching"&&n==="hidden"}function je(e){return e.kind==="live"&&!e.readOnly}function _(e){return H(Math.max(0,Math.floor(e/1e3)))}function he(e,n){if(e.closedAt!=null){const t=p(n-e.closedAt);return{state:"ended",phrase:t===i("common.ago.now")?i("board.stage.phrase.endedJustNow"):i("board.stage.phrase.endedAgo",{ago:t})}}if(e.waiting)return{state:"waiting",phrase:i("board.queue.waiting"),emphasis:_(n-e.waiting.since),...e.waiting.tool?{tool:e.waiting.tool}:{},...e.waiting.detail?{arg:e.waiting.detail}:{}};if(e.yourTurn&&!e.tool){if(e.fresh)return{state:"ready",phrase:i("board.stage.phrase.ready"),arg:i("board.stage.phrase.firstPrompt")};const t=e.lastTurnEndAt!=null?p(n-e.lastTurnEndAt):null;return{state:"idle",phrase:i("board.list.yourTurn"),...t?{arg:P(t)}:{}}}if(e.fresh&&!e.tool&&!e.subagentsLive)return{state:"ready",phrase:i("board.stage.phrase.ready"),arg:i("board.stage.phrase.firstPrompt")};if(e.active){const t={state:"working",phrase:i("board.stage.phrase.working")};return e.tool?(t.tool=e.tool.name,e.tool.subject&&(t.arg=e.tool.subject),e.tool.startedAt!=null&&(t.seconds=G(e.tool.startedAt,void 0,n))):e.subagentsLive&&(t.arg=i("board.stage.subagentsRunning",{count:e.subagentsLive})),t}return e.fresh?{state:"ready",phrase:i("board.stage.phrase.ready"),arg:i("board.stage.phrase.firstPrompt")}:e.lastTurnEndAt!=null?{state:"idle",phrase:i("board.stage.phrase.idle"),arg:P(p(n-e.lastTurnEndAt))}:{state:"idle",phrase:i("board.stage.phrase.idle")}}function P(e){return e===i("common.ago.now")?i("board.stage.phrase.lastTurnNow"):i("board.stage.phrase.lastTurn",{ago:e})}const ge="board.stage.reconnectNote";function Ge(e,n){switch(n.kind){case"empty":return{state:"none",phrase:""};case"attaching":return n.reconnect?{state:"attaching",phrase:i("board.stage.phrase.reconnecting"),arg:i(ge)}:{state:"attaching",phrase:i("board.stage.attaching")};case"starting":return{state:"starting",phrase:i("board.stage.phrase.starting"),arg:n.cwd};case"tmux-installing":return{state:"starting",phrase:i("board.stage.settingUpTmux")};case"tmux-missing":return{state:"detached",phrase:i("board.stage.phrase.notAttached")};case"error":return n.code?{state:"detached",phrase:i("board.stage.phrase.notAttached")}:e??{state:"none",phrase:""};case"not-attachable":if(n.target.kind==="C"&&e&&e.state!=="ended"){const{tool:t,arg:s}=e;return{state:"elsewhere",phrase:i(pe(e.state)),...t?{tool:t}:{},...s?{arg:s}:{}}}return e??{state:"ended",phrase:i("board.stage.phrase.ended")};case"ended":return(e==null?void 0:e.state)==="ended"?e:{state:"ended",phrase:n.atOpen?i("board.stage.phrase.ended"):i("board.stage.phrase.endedJustNow")};default:return e??{state:"none",phrase:""}}}function He(e,n,t){return n.kind==="live"&&t&&e.state!=="waiting"}const Ve="board.stage.launchedUnreachable",Be="board.stage.provenanceUnknown";function fe(e,n){return e.kind==="C"&&n.windows===!0&&(n.launched===!0||e.provenance==="panel")}function ze(e,n){return e.kind==="C"&&n.windows===!0&&!fe(e,n)&&e.provenance==="unknown"}function Xe(e){switch(e){case"idle":case"ready":return"board.stage.elsewhere.idle";case"waiting":return"board.stage.elsewhere.waiting";case"working":return"board.stage.elsewhere.working";default:return"board.stage.elsewhere.running"}}function pe(e){return e==="working"?"board.stage.phrase.workingElsewhere":e==="idle"||e==="ready"||e==="waiting"?"board.stage.phrase.waitingElsewhere":"board.stage.phrase.elsewhere"}function Je(e,n){switch(n.kind){case"live":return i("board.stage.announceLive",{name:e});case"ended":return i("board.stage.announceEnded",{name:e});case"detached":return i("board.stage.announceDetached",{name:e});case"not-attachable":return n.stillRunning?i("board.stage.announceStillRunning",{name:e}):i("board.stage.announceNoPane",{name:e});case"tmux-installing":return i("board.stage.announceTmuxSetup");case"tmux-missing":return i("board.stage.announceTmuxMissing");case"error":return we(n.message);default:return null}}const be="board.stage.panelStopped",me=new Set(["That is not a session id.","The provider must be claude or codex."]);function we(e){return me.has(e.trim())?i(be):e}function Ke(e){return e?i("board.stage.closedNamed",{name:e}):i("board.stage.closed")}function Ae(e){return/^\//.test(e)||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\/]+[\\/][^\\/]+/.test(e)}function F(e){const n=e.split(/[\\/]+/).filter(Boolean);return n.length?n[n.length-1]:e}function ke(e,n){const t=new Map;for(const o of e){if(!o.cwd||!Ae(o.cwd))continue;const r=t.get(o.cwd);(!r||o.at>r.at)&&t.set(o.cwd,o)}const s=[...t.values()].sort((o,r)=>r.at-o.at),a=n?s.findIndex(o=>o.cwd===n):-1;return a>0&&s.unshift(...s.splice(a,1)),s.map(o=>({cwd:o.cwd,name:o.name||F(o.cwd),hue:o.hue,at:o.at}))}function qe(e,n=24){if(e.length<=n)return e;const t=e.split(/[\\/]+/).filter(Boolean),s=t.slice(-2).join("/");if(s.length+2<=n)return`…/${s}`;const a=t[t.length-1]??e;return a.length+2<=n?`…/${a}`:`…/${a.slice(0,Math.max(1,n-3))}…`}function xe(e){return e==="codex"?"Codex":"Claude Code"}function Ze(e){return e==="codex"?"Codex":"Claude"}const Te=160,ye=(e,n)=>e.length>n?`${e.slice(0,n-1)}…`:e;function N(e){var t;const n=((t=(e??"").split(`
|
|
2
2
|
`).find(s=>s.trim()!==""))==null?void 0:t.trim())??"";return n?ye(n,Te):null}function _e(e,n){const t=[];for(const s of e)s.sessionId===n&&s.kind==="subagent"&&t.push(s);return t}function Ce(e,n){var a,o;const t=e.waiting;let s=null;if(e.state==="active")for(let r=e.tools.length-1;r>=0;r--){const l=e.tools[r];if(l.endedAt!=null)continue;const d=y.describeCall(l);s={name:d.name,subject:d.subject??null,startedAt:l.startedAt};break}return{closedAt:e.closedAt??null,waiting:t&&J(t)?{since:t.since,...(a=t.tool)!=null&&a.name?{tool:t.tool.name}:{},...(o=t.tool)!=null&&o.preview?{detail:t.tool.preview}:{}}:null,active:e.state==="active",tool:s,subagentsLive:n.filter(r=>r.state==="active").length,lastTurnEndAt:e.lastTurnEndAt??null,fresh:e.prompts.length===0&&!e.firstPrompt&&e.lastTurnEndAt==null,yourTurn:(t==null?void 0:t.kind)==="idle"}}function Ee(e){const{used:n,limit:t}=K(e);return{used:n,window:t}}const v=32,L=e=>e.length>v?`${e.slice(0,v-1).trimEnd()}…`:e;function Me(e,n){const{title:t}=E(e),s=[...n.values()].filter(r=>r.kind!=="subagent"&&r.sessionId!==e.sessionId&&M(E(r).title,t));if(!s.length)return t;const a=L(S(e)),o=s.filter(r=>M(L(S(r)),a));return a&&!o.length?`${t}${I}${a}`:`${t}${I}${q(e.sessionId,o.map(r=>r.sessionId))}`}function Qe(e,n,t){if(!e||e.kind==="empty")return{kind:"empty"};if(e.kind==="launch")return{kind:"launch",agent:e.agent,cwd:e.cwd,name:F(e.cwd),hue:w(e.key),key:e.key,...e.options?{options:e.options}:{}};const s=V(n,e.id),a=e.launch?{launch:e.launch}:{},o=n.get(s);if(!o)return{kind:"session",session:{ref:{sessionId:s,provider:"claude",cwd:""},name:s.slice(0,8),hue:w(s),status:{state:"none",phrase:""},...e.launch?{launched:!0}:{}},...a};const r=_e(n.values(),s),l=Ce(o,r),d=o.provider==="codex"?"codex":"claude",g=B(o),h=O(o,void 0,y),b=[l.subagentsLive?i("board.stage.subagentsWorking",{count:l.subagentsLive}):null,o.closedAt!=null?i("board.stage.phrase.endedAgo",{ago:p(t-o.closedAt)}):null,`${xe(d)}${o.cwd?` · ${o.cwd}`:""}`].filter(Boolean).join(" · ");return{kind:"session",session:{ref:{sessionId:s,provider:d,cwd:o.cwd??""},name:Me(o,n),hue:w(s),model:o.model??null,effort:o.effort??null,status:he(l,t),contextUse:Ee(o),promptCount:X(o.prompts).length,ghostLine:(h==null?void 0:h.long)??N(g),context:{prompt:N(g),fact:b},endedAgo:o.closedAt!=null?p(t-o.closedAt):null,...o.panelLaunch!=null||e.launch?{launched:!0}:{},rename:z(o)},...a}}function Ye(e,n,t){var a,o;if(e.track.length===0)return null;let s=null;if(e.next){const r=n.find(l=>l.id===e.next.id);s={name:e.next.label,waited:r?_(t-r.waiting.since):"",tool:((a=r==null?void 0:r.waiting.tool)==null?void 0:a.name)??null}}return{position:e.position?{index:e.position.index-1,total:e.position.total}:null,resumed:((o=e.resumed)==null?void 0:o.label)??null,next:s,clear:e.clear}}function Se(e){return e.kind==="asked"?i("board.stage.askAsked"):e.kind==="idle"?i("board.stage.askIdle"):e.tool?e.tool.name==="Bash"?i("board.stage.askCommand"):i("board.stage.askTool",{tool:e.tool.name}):i("board.stage.askPermission")}function et(e,n){var s;const t=e[0];return t?{id:t.id,name:t.label,waited:_(n-t.waiting.since),ask:Se(t.waiting),command:((s=t.waiting.tool)==null?void 0:s.preview)||null}:null}function tt(e,n){var a;const t=e.arrival;if(!t)return null;const s=n.find(o=>o.id===t.id);return{name:t.label,tool:((a=s==null?void 0:s.waiting.tool)==null?void 0:a.name)??null}}function nt(e,n){const t=[];for(const s of e)s.kind!=="root"||!s.cwd||t.push({cwd:s.cwd,hue:w(s.sessionId),at:s.lastEventAt??s.startedAt});return ke(t,n)}export{Je as A,We as B,Qe as C,nt as D,Ke as E,T as F,et as G,tt as H,Ye as I,he as J,Ce as K,Ve as L,Be as P,te as R,x as T,Re as a,ve as b,$e as c,Oe as d,Le as e,w as f,F as g,qe as h,Ae as i,De as j,de as k,xe as l,Ue as m,Ne as n,we as o,fe as p,ze as q,Pe as r,Fe as s,Xe as t,ge as u,Ze as v,ce as w,Ge as x,He as y,je as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c4 as j,c5 as x,c6 as M,c7 as B,r as E,c8 as C,c9 as J,ca as U,a as P,cb as D}from"./app-
|
|
1
|
+
import{c4 as j,c5 as x,c6 as M,c7 as B,r as E,c8 as C,c9 as J,ca as U,a as P,cb as D}from"./app-ZMmmEHxF.js";const $=2e3;function G(n){var s,o,i,r;if(!n)return null;const t=n.state==="connected";return{connected:t,email:t?((s=n.account)==null?void 0:s.email)??null:null,unread:t?((o=n.feedback)==null?void 0:o.unread)??0:0,latestAt:t?((i=n.feedback)==null?void 0:i.latestAt)??null:null,mail:!t||((r=n.feedback)==null?void 0:r.mail)!==!1}}function F({post:n,read:t,appliers:s,themes:o,setTimer:i=(e,f)=>setTimeout(e,f),clearTimer:r=e=>clearTimeout(e),debounceMs:m=$}){let e=!1,f={},O=null,v={},u=null;function R(){u!=null&&r(u),u=null,v={}}function T(c){var V;const a=s();let l;const w=j(t);for(const[S,h]of Object.entries(x(c.values))){if(S==="theme"&&!o().includes(h)){l={theme:h};continue}f[S]=h,w[S]!==h&&((V=a[S])==null||V.call(a,h))}O=c.revision,n("/api/account/ui/applied",{revision:c.revision,...l?{skipped:l}:{}}).catch(()=>{})}function _(c){const a=(c==null?void 0:c.state)==="connected"?c.sync:null;if(!a){e=!1,O=null,R();return}if(!e){if(e=!0,f=j(t),a.initialUpload){n("/api/account/ui",{values:{...f},reason:"initial"}).catch(()=>{});return}T(a.apply??a.adopt);return}a.apply&&a.apply.revision!==O&&T(a.apply)}function N(){u=null;const c=v;v={},Object.keys(c).length&&n("/api/account/ui",{values:c,reason:"user"}).catch(()=>{})}function L(c,a){if(!e)return;const l=M(c);if(!l)return;const w=B(l,a);f[l.key]!==w&&(f[l.key]=w,v[l.key]=w,u!=null&&r(u),u=i(N,m))}return{onView:_,onStored:L,flush:()=>{u!=null&&r(u),N()},dispose:R}}let k=null,b=!1;const A=new Set;let g=!1;function p(n){k=n;for(const t of A)t()}async function y(){try{const n=await fetch("/api/account",{headers:{accept:"application/json"}});if(!n.ok){b=!0,p(k);return}b=!1,p(await n.json())}catch{b=!0,p(k)}}function H(){g||typeof window>"u"||(g=!0,window.addEventListener(C,n=>{const t=n.detail;try{p(JSON.parse(t))}catch{}}),window.addEventListener(J,()=>{y()}),y())}function K(n){return H(),A.add(n),()=>{A.delete(n)}}function q(){return{view:E.useSyncExternalStore(K,()=>k,()=>null),failed:b}}async function d(n,t={}){const s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),o=await s.json().catch(()=>null);if(!s.ok&&!o)throw new Error(`${n} answered ${s.status}`);return o}function I(n){try{const t=new URL(String(n??""));return t.username||t.password?!1:t.protocol==="https:"?!0:t.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(t.hostname)}catch{return!1}}const Q={async connect(n){const t=await d("/api/account/connect",{name:n});return t&&p(t),t},async cancel(){p(await d("/api/account/connect/cancel"))},async disconnect(){p(await d("/api/account/disconnect"))},async setMode(n){const t=await d("/api/account/sync/mode",n);return await y(),t},async resolve(n){await d("/api/account/sync/resolve",{action:n}),await y()},async upload(){await d("/api/account/sync/upload",{upload:!0}),await y()},async preview(){return(await fetch("/api/account/sync/preview")).json()},refresh:y};function W(n){const t=E.useRef(n);t.current=n;const{view:s}=q(),o=E.useRef(null);o.current||(o.current=F({post:(i,r)=>d(i,r),read:P,appliers:()=>t.current,themes:()=>D})),E.useEffect(()=>{const i=o.current,r=m=>{const e=m.detail;e&&typeof e.key=="string"&&i.onStored(e.key,e.value??null)};return window.addEventListener(U,r),()=>{window.removeEventListener(U,r),i.dispose()}},[]),E.useEffect(()=>{o.current.onView(s)},[s])}export{q as a,Q as b,G as f,I as o,W as u};
|
package/dist/web/index.html
CHANGED
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
document.documentElement.setAttribute("data-density", density === "tightest" || density === "tighter" || density === "default" || density === "comfortable" ? density : "compact");
|
|
88
88
|
})();
|
|
89
89
|
</script>
|
|
90
|
-
<script type="module" crossorigin src="/assets/index-
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/app-
|
|
92
|
-
<link rel="stylesheet" crossorigin href="/assets/app-
|
|
90
|
+
<script type="module" crossorigin src="/assets/index-zSxC5ueJ.js"></script>
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/app-ZMmmEHxF.js">
|
|
92
|
+
<link rel="stylesheet" crossorigin href="/assets/app-DtosBis5.css">
|
|
93
93
|
</head>
|
|
94
94
|
<body>
|
|
95
95
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccdeck",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Local dashboard for Claude Code and Codex CLI sessions: which Claude Code session needs input, every tool call and Claude Code subagent live, token cost and quota, several Claude accounts. Run npx ccdeck.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/release-notes.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"title": "🧭 A calmer deck that shows what needs you",
|
|
13
13
|
"body": "The Sessions list reads like an inbox, colour on the board means state, and the Inspector offers each session's next step under its title.",
|
|
14
14
|
"priority": "highlight",
|
|
15
|
-
"details": "
|
|
15
|
+
"details": "Counters at zero and key hints you have learned step aside, and the board's tools sit in one ⋯ menu. Quotas moved from Sessions to Usage, and Codex's helper agents stay inside their main conversation. Every key works as before."
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"title": "🪟 Up to four sessions side by side in Workspace",
|
|
@@ -243,7 +243,8 @@
|
|
|
243
243
|
"3.48.1",
|
|
244
244
|
"3.49.1",
|
|
245
245
|
"3.53.1",
|
|
246
|
-
"3.53.3"
|
|
246
|
+
"3.53.3",
|
|
247
|
+
"4.0.1"
|
|
247
248
|
],
|
|
248
249
|
"3.82.2": [
|
|
249
250
|
{
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,p as t}from"./app-40gNTTfq.js";import{u as o,a as s,f as n}from"./use-account-BUmI-A8e.js";function r({appliers:u}){o(u);const{view:c}=s();return e.useEffect(()=>{t(n(c))},[c]),e.useEffect(()=>()=>t(null),[]),null}export{r as default};
|