teamsmith 0.3.3 → 0.4.0

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.
Files changed (82) hide show
  1. package/README.md +8 -8
  2. package/package.json +2 -6
  3. package/skills/teamsmith/CHANGELOG.md +77 -0
  4. package/skills/teamsmith/SKILL.md +83 -163
  5. package/skills/teamsmith/extension/team-inbox-watch.ts +30 -1
  6. package/skills/teamsmith/extension/team-notify.ts +162 -21
  7. package/skills/teamsmith/extension/team-reply.ts +105 -0
  8. package/skills/teamsmith/references/agent-adapters.md +4 -2
  9. package/skills/teamsmith/references/config.md +21 -12
  10. package/skills/teamsmith/references/migration.md +47 -3
  11. package/skills/teamsmith/references/protocol.md +85 -31
  12. package/skills/teamsmith/references/reminders.md +131 -0
  13. package/skills/teamsmith/references/troubleshooting.md +26 -8
  14. package/skills/teamsmith/references/workflows.md +18 -16
  15. package/skills/teamsmith/scripts/lib/cmd-agents.sh +290 -68
  16. package/skills/teamsmith/scripts/lib/cmd-config.sh +1 -1
  17. package/skills/teamsmith/scripts/lib/cmd-project.sh +193 -21
  18. package/skills/teamsmith/scripts/lib/cmd-remind.sh +103 -0
  19. package/skills/teamsmith/scripts/lib/cmd-status.sh +177 -21
  20. package/skills/teamsmith/scripts/lib/cmd-update.sh +7 -4
  21. package/skills/teamsmith/scripts/lib/cmd-watch.sh +11 -1
  22. package/skills/teamsmith/scripts/lib/common.sh +50 -6
  23. package/skills/teamsmith/scripts/lib/outbox.sh +103 -21
  24. package/skills/teamsmith/scripts/panel/panel.js +1 -1
  25. package/skills/teamsmith/scripts/panel/src/strings/en.ts +1 -1
  26. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +1 -1
  27. package/skills/teamsmith/scripts/remind-store.mjs +529 -0
  28. package/skills/teamsmith/scripts/replies.mjs +9 -3
  29. package/skills/teamsmith/scripts/reply-capture.mjs +596 -0
  30. package/skills/teamsmith/scripts/state-authority.mjs +500 -0
  31. package/skills/teamsmith/scripts/strings/commands.tsv +2 -1
  32. package/skills/teamsmith/scripts/strings/help.en.tsv +16 -2
  33. package/skills/teamsmith/scripts/strings/help.zh.tsv +16 -2
  34. package/skills/teamsmith/scripts/team +2 -0
  35. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +68 -123
  36. package/skills/teamsmith/templates/PROTOCOL.md.tmpl +48 -55
  37. package/skills/teamsmith/templates/config.sh.tmpl +2 -1
  38. package/skills/teamsmith/templates/pm-prompt.md.tmpl +126 -119
  39. package/skills/teamsmith/tests/bg-ledger-harness.mjs +17 -6
  40. package/skills/teamsmith/tests/bg-ledger.sh +16 -5
  41. package/skills/teamsmith/tests/checkout-shape-probe.sh +6 -5
  42. package/skills/teamsmith/tests/delivery-truth.sh +82 -47
  43. package/skills/teamsmith/tests/fixtures/delivery-truth-real/README.md +71 -23
  44. package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
  45. package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-dirty-ab.py +143 -0
  46. package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-second.py +26 -9
  47. package/skills/teamsmith/tests/fixtures/delivery-truth-real/run-case.sh +92 -20
  48. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +47 -3
  49. package/skills/teamsmith/tests/fixtures/reply-capture-provider.ts +76 -0
  50. package/skills/teamsmith/tests/flip-p410-order2.sh +205 -0
  51. package/skills/teamsmith/tests/frames/README.md +3 -1
  52. package/skills/teamsmith/tests/gate-guard.sh +20 -4
  53. package/skills/teamsmith/tests/help-surface.sh +61 -3
  54. package/skills/teamsmith/tests/install-shape.sh +400 -38
  55. package/skills/teamsmith/tests/key-replies-pty.sh +197 -21
  56. package/skills/teamsmith/tests/key-replies.sh +187 -68
  57. package/skills/teamsmith/tests/ledger-claim.sh +8 -6
  58. package/skills/teamsmith/tests/lib/box-judge.sh +2 -1
  59. package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +104 -0
  60. package/skills/teamsmith/tests/lib/pm-window.sh +127 -0
  61. package/skills/teamsmith/tests/lib/reply-fixture.sh +7 -19
  62. package/skills/teamsmith/tests/lib/reply-guard.sh +188 -0
  63. package/skills/teamsmith/tests/lib/section-calls.pl +171 -0
  64. package/skills/teamsmith/tests/loop-inventory.tsv +7 -5
  65. package/skills/teamsmith/tests/meta-suite.sh +215 -0
  66. package/skills/teamsmith/tests/panel-b3-pty-mouse.py +154 -17
  67. package/skills/teamsmith/tests/panel-b3.sh +33 -4
  68. package/skills/teamsmith/tests/panel-choices.sh +11 -7
  69. package/skills/teamsmith/tests/remind-cli.sh +574 -0
  70. package/skills/teamsmith/tests/reply-capture-real.mjs +360 -0
  71. package/skills/teamsmith/tests/reply-capture-real.sh +5 -0
  72. package/skills/teamsmith/tests/reply-capture.mjs +622 -0
  73. package/skills/teamsmith/tests/section-paths.tsv +41 -10
  74. package/skills/teamsmith/tests/section-select.sh +180 -26
  75. package/skills/teamsmith/tests/smoke.sh +1829 -249
  76. package/skills/teamsmith/tests/state-authority-node.mjs +42 -0
  77. package/skills/teamsmith/tests/state-authority.sh +629 -0
  78. package/skills/teamsmith/tests/task-model-routing.sh +10 -1
  79. package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +33 -0
  80. package/skills/teamsmith/tests/team-notify-knock-marker.mjs +91 -0
  81. package/skills/teamsmith/tests/workflow-entry.sh +123 -3
  82. package/skills/teamsmith-init/SKILL.md +1 -1
@@ -348,7 +348,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
348
348
  `),C};var aP=MQ(b9(),1);var m3=MQ(IB(),1);var gL=MQ(IB(),1);var nP=MQ(IB(),1);var oP=MQ(IB(),1);var gK=MQ(IB(),1);var DL=new TextDecoder,rP=/^(?:\x1b)([a-zA-Z0-9])$/,sP=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,JL={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[P":"f1","[Q":"f2","[R":"f3","[S":"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},HL=[...Object.values(JL),"backspace"],tP=(I)=>{return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(I)},eP=(I)=>{return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(I)},UL=/^\x1b\[(\d+)(?:;(\d+)(?::(\d+))?(?:;([\d:]+))?)?u$/,AT=/^\x1b\[(\d+);(\d+):(\d+)([A-Za-z~])$/,IT={A:"up",B:"down",C:"right",D:"left",E:"clear",F:"end",H:"home",P:"f1",Q:"f2",R:"f3",S:"f4"},QT={2:"insert",3:"delete",5:"pageup",6:"pagedown",7:"home",8:"end",11:"f1",12:"f2",13:"f3",14:"f4",15:"f5",17:"f6",18:"f7",19:"f8",20:"f9",21:"f10",23:"f11",24:"f12"},GL={27:"escape",9:"tab",127:"backspace",8:"backspace",57358:"capslock",57359:"scrolllock",57360:"numlock",57361:"printscreen",57362:"pause",57363:"menu",57376:"f13",57377:"f14",57378:"f15",57379:"f16",57380:"f17",57381:"f18",57382:"f19",57383:"f20",57384:"f21",57385:"f22",57386:"f23",57387:"f24",57388:"f25",57389:"f26",57390:"f27",57391:"f28",57392:"f29",57393:"f30",57394:"f31",57395:"f32",57396:"f33",57397:"f34",57398:"f35",57399:"kp0",57400:"kp1",57401:"kp2",57402:"kp3",57403:"kp4",57404:"kp5",57405:"kp6",57406:"kp7",57407:"kp8",57408:"kp9",57409:"kpdecimal",57410:"kpdivide",57411:"kpmultiply",57412:"kpsubtract",57413:"kpadd",57414:"kpenter",57415:"kpequal",57416:"kpseparator",57417:"kpleft",57418:"kpright",57419:"kpup",57420:"kpdown",57421:"kppageup",57422:"kppagedown",57423:"kphome",57424:"kpend",57425:"kpinsert",57426:"kpdelete",57427:"kpbegin",57428:"mediaplay",57429:"mediapause",57430:"mediaplaypause",57431:"mediareverse",57432:"mediastop",57433:"mediafastforward",57434:"mediarewind",57435:"mediatracknext",57436:"mediatrackprevious",57437:"mediarecord",57438:"lowervolume",57439:"raisevolume",57440:"mutevolume",57441:"leftshift",57442:"leftcontrol",57443:"leftalt",57444:"leftsuper",57445:"lefthyper",57446:"leftmeta",57447:"rightshift",57448:"rightcontrol",57449:"rightalt",57450:"rightsuper",57451:"righthyper",57452:"rightmeta",57453:"isoLevel3Shift",57454:"isoLevel5Shift"},ML=(I)=>I>=0&&I<=1114111&&!(I>=55296&&I<=57343),g5=(I)=>ML(I)?String.fromCodePoint(I):"?";function KL(I){if(I===3)return"release";if(I===2)return"repeat";return"press"}function FL(I){return{ctrl:!!(I&jG.ctrl),shift:!!(I&jG.shift),meta:!!(I&(jG.meta|jG.alt)),super:!!(I&jG.super),hyper:!!(I&jG.hyper),capsLock:!!(I&jG.capsLock),numLock:!!(I&jG.numLock)}}var BT=(I)=>{let B=UL.exec(I);if(!B)return null;let C=parseInt(B[1],10),D=B[2]?Math.max(0,parseInt(B[2],10)-1):0,J=B[3]?parseInt(B[3],10):1,U=B[4];if(!ML(C))return null;let N;if(U)N=U.split(":").map((O)=>g5(parseInt(O,10))).join("");let X,L;if(C===32)X="space",L=!0;else if(C===13)X="return",L=!0;else if(GL[C])X=GL[C],L=!1;else if(C>=1&&C<=26)X=String.fromCodePoint(C+96),L=!1;else X=g5(C).toLowerCase(),L=!0;if(L&&!N)N=g5(C);return{name:X,...FL(D),eventType:KL(J),sequence:I,raw:I,isKittyProtocol:!0,isPrintable:L,text:N}},ET=(I)=>{let B=AT.exec(I);if(!B)return null;let C=parseInt(B[1],10),D=Math.max(0,parseInt(B[2],10)-1),J=parseInt(B[3],10),U=B[4],N=U==="~"?QT[C]:IT[U];if(!N)return null;return{name:N,...FL(D),eventType:KL(J),sequence:I,raw:I,isKittyProtocol:!0,isPrintable:!1}},CT=(I="")=>{let B;if(I instanceof Uint8Array)if(I[0]>127&&I[1]===void 0)I[0]-=128,I="\x1B"+DL.decode(I);else I=DL.decode(I);else if(I!==void 0&&typeof I!=="string")I=String(I);else if(!I)I="";let C=BT(I);if(C)return C;let D=ET(I);if(D)return D;if(UL.test(I))return{name:"",ctrl:!1,meta:!1,shift:!1,sequence:I,raw:I,isKittyProtocol:!0,isPrintable:!1};let J={name:"",ctrl:!1,meta:!1,shift:!1,sequence:I,raw:I};if(J.sequence=J.sequence||I||J.name,I==="\r"||I==="\x1B\r")J.raw=void 0,J.name="return",J.meta=I.length===2;else if(I===`
349
349
  `)J.name="enter";else if(I==="\t")J.name="tab";else if(I==="\b"||I==="\x1B\b")J.name="backspace",J.meta=I.charAt(0)==="\x1B";else if(I===""||I==="\x1B")J.name="backspace",J.meta=I.charAt(0)==="\x1B";else if(I==="\x1B"||I==="\x1B\x1B")J.name="escape",J.meta=I.length===2;else if(I===" "||I==="\x1B ")J.name="space",J.meta=I.length===2;else if(I.length===1&&I<="\x1A")J.name=String.fromCharCode(I.charCodeAt(0)+97-1),J.ctrl=!0;else if(I.length===1&&I>="0"&&I<="9")J.name="number";else if(I.length===1&&I>="a"&&I<="z")J.name=I;else if(I.length===1&&I>="A"&&I<="Z")J.name=I.toLowerCase(),J.shift=!0;else if(B=rP.exec(I))J.name=B[1].toLowerCase(),J.meta=!0,J.shift=/^[A-Z]$/.test(B[1]);else if(B=sP.exec(I)){let U=[...I];if(U[0]==="\x1B"&&U[1]==="\x1B")J.meta=!0;let N=[B[1],B[2],B[4],B[6]].filter(Boolean).join(""),X=(B[3]||B[5]||1)-1;J.ctrl=!!(X&4),J.meta=J.meta||!!(X&10),J.shift=!!(X&1),J.code=N,J.name=JL[N]??"",J.shift=tP(N)||J.shift,J.ctrl=eP(N)||J.ctrl}return J},YL=CT;var NL=MQ(IB(),1);var D5=()=>NL.useContext(T3);var gT=(I,B={})=>{let{setRawMode:C,internal_exitOnCtrlC:D,internal_eventEmitter:J}=D5();gK.useEffect(()=>{if(B.isActive===!1)return;return C(!0),()=>{C(!1)}},[B.isActive,C]);let U=gK.useEffectEvent((N)=>{let X=YL(N),L={upArrow:X.name==="up",downArrow:X.name==="down",leftArrow:X.name==="left",rightArrow:X.name==="right",pageDown:X.name==="pagedown",pageUp:X.name==="pageup",home:X.name==="home",end:X.name==="end",return:X.name==="return",escape:X.name==="escape",ctrl:X.ctrl,shift:X.shift,tab:X.name==="tab",backspace:X.name==="backspace",delete:X.name==="delete",meta:X.meta,super:X.super??!1,hyper:X.hyper??!1,capsLock:X.capsLock??!1,numLock:X.numLock??!1,eventType:X.eventType},O;if(X.isKittyProtocol)if(X.isPrintable)O=X.text??X.name;else if(X.ctrl&&X.name.length===1)O=X.name;else O="";else if(X.ctrl)O=X.name??"";else O=X.sequence;if(!X.isKittyProtocol&&HL.includes(X.name))O="";if(O.startsWith("\x1B"))O=O.slice(1);if(O.length===1&&/[A-Z]/.test(O))L.shift=!0;if(O==="c"&&L.ctrl&&D)return;Mg.discreteUpdates(()=>{I(O,L)})});gK.useEffect(()=>{if(B.isActive===!1)return;return J.on("input",U),()=>{J.removeListener("input",U)}},[B.isActive,J])},G5=gT;var ZL=MQ(IB(),1);var XL=MQ(IB(),1);var DT=()=>XL.useContext(P3),J5=DT;var GT=MQ(IB(),1);var JT=MQ(IB(),1);var H5=MQ(IB(),1);var UT=MQ(IB(),1);var MT=MQ(IB(),1);var fJ=MQ(IB(),1);var KT=()=>{let I=fJ.useContext(_3),B=fJ.useRef(void 0),C=fJ.useCallback((D)=>{B.current=D},[]);return fJ.useInsertionEffect(()=>{return I.setCursorPosition(B.current),()=>{I.setCursorPosition(void 0)}}),{setCursorPosition:C}},U5=KT;var DK=MQ(IB(),1);var qL=MQ(IB(),1);var u3=MQ(IB(),1);var xA=MQ(IB(),1);import{writeSync as Pz}from"node:fs";var p3={running:"●",starting:"…",exited:"○",absent:"·",foreign:"○",unknown:"○"};function R1(I){if(I==null||Number.isNaN(I))return"?";return I>=1024?`${(I/1024).toFixed(1)}G`:`${Math.round(I)}M`}function K5(I){if(I==null||Number.isNaN(I))return"-";if(I<60)return`${Math.floor(I)}s`;if(I<3600)return`${Math.floor(I/60)}m`;return`${Math.floor(I/3600)}h`}var M5="▁▂▃▄▅▆▇█";function F5(I,B){if(!I||!I.length||B<=0)return"";let C=I.slice(-B).filter((N)=>typeof N==="number"&&!Number.isNaN(N));if(!C.length)return"";let D=Math.min(...C),U=Math.max(...C)-D||1;return C.map((N)=>M5[Math.min(M5.length-1,Math.floor((N-D)/U*(M5.length-1)))]).join("")}function bJ(I){let B=/T(\d{2}:\d{2}:\d{2})/.exec(I||"");return B?B[1]:I}function RL(I,B){if(!I||I==="-")return"-";let C=I.replace(/^(refs\/heads\/|task\/|agent\/)/,"");return C.length>B?`…${C.slice(C.length-(B-1))}`:C}var LL=[[4352,4447],[11904,12350],[12353,13311],[13312,19903],[19968,40959],[40960,42191],[44032,55203],[63744,64255],[65040,65049],[65072,65135],[65280,65376],[65504,65510],[127744,128591],[129280,129535],[131072,262141]];function G8(I){let B=I.codePointAt(0)??0;if(B===8205||B===65039||B>=768&&B<=879)return 0;for(let C=0;C<LL.length;C++){let[D,J]=LL[C];if(B>=D&&B<=J)return 2}return 1}function bI(I){let B=0;for(let C of String(I))B+=G8(C);return B}function YT(I,B){let C=String(I),D=B-bI(C);return D>0?C+" ".repeat(D):C}function J8(I,B){if(B<=0)return"";let C=String(I),D=[...C],J=0;for(let X=0;X<D.length;X++)J+=G8(D[X]);if(J<=B)return C;let U=0,N="";for(let X=0;X<D.length;X++){let L=G8(D[X]);if(U+L>B-1)break;U+=L,N+=D[X]}return`${N}…`}function zL(I,B){if(B<=0)return"";let C=String(I),D=[...C],J=0;for(let X=0;X<D.length;X++)J+=G8(D[X]);if(J<=B)return C;let U=0,N="";for(let X=D.length-1;X>=0;X--){let L=G8(D[X]);if(U+L>B-1)break;U+=L,N=D[X]+N}return`…${N}`}function d3(I,B="─"){return B.repeat(Math.max(0,I))}function sg(I,B){return J8(YT(I,B),B)}var zC=(I,B="text")=>({text:String(I),tone:B}),NT=(...I)=>I.filter((B)=>B!==null);function $L(I,B){let C="",D=0;for(let J of I){let U=bI(J);if(D+U>B)break;D+=U,C+=J}return C||[...I][0]||""}function c3(I,B,C="",D=C){let J=Math.max(1,B-Math.max(bI(C),bI(D))),U=[];for(let T of I){if(/^\s+$/.test(T.text)){U.push({text:" ",tone:T.tone});continue}let v=T.text;while(bI(v)>J){let V=$L(v,J);U.push({text:V,tone:T.tone}),v=v.slice(V.length)}if(v)U.push({text:v,tone:T.tone})}let N=[],X=C?[zC(C,"dim")]:[],L=bI(C),O=!1;for(let T of U){if(T.text===" ")continue;let v=bI(T.text);if(O&&L+1+v>B)N.push(X),X=D?[zC(D,"dim")]:[],L=bI(D),O=!1;if(O)X.push(zC(" ",T.tone)),L+=1;X.push(zC(T.text,T.tone)),L+=v,O=!0}return N.push(X),N}function Y5(I){let B=[],C=null,D=()=>{if(C&&C.text)B.push(C);C=null};for(let J of I)for(let U of String(J.text).split(/(\s+)/)){if(U==="")continue;if(/^\s+$/.test(U)){D(),B.push({text:" ",tone:J.tone});continue}if(C)C.text+=U;else C={text:U,tone:J.tone}}return D(),B}function N5(I,B="text"){let C=[],D=/(\*\*([^*]+)\*\*)|(`([^`]+)`)|(\[([^\]]+)\]\(([^)\s]+)\))/g,J=0;for(let U=D.exec(I);U;U=D.exec(I)){if(U.index>J)C.push(zC(I.slice(J,U.index),B));if(U[2]!==void 0)C.push(zC(U[2],"heading"));else if(U[4]!==void 0)C.push(zC(U[4],"accent"));else if(U[6]!==void 0)C.push(zC(U[6],"accent"),zC(` (${U[7]})`,"dim"));J=U.index+U[0].length}if(J<I.length)C.push(zC(I.slice(J),B));return C.length?C:[zC(I,B)]}function VL(I){return String(I).replace(/\*\*([^*]+)\*\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,"$1 ($2)").trim()}function Z5(I){let B=I.trim();if(B.startsWith("|"))B=B.slice(1);if(B.endsWith("|"))B=B.slice(0,-1);let C=[],D="";for(let J=0;J<B.length;J++){let U=B[J];if(U==="\\"&&B[J+1]==="|"){D+="|",J++;continue}if(U==="|"){C.push(D),D="";continue}D+=U}return C.push(D),C}var ZT=/^\s*\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/;function XT(I){return I.includes("|")&&ZT.test(I)&&/-/.test(I)}function qT(I){let B=I.trim();if(B.startsWith(":")&&B.endsWith(":"))return"center";if(B.endsWith(":"))return"right";return"left"}function RT(I,B){let C=Z5(I[0]).map(VL),D=Z5(I[1]).map(qT),J=I.slice(2).map((O)=>Z5(O).map(VL)),U=Math.max(C.length,...J.map((O)=>O.length),1),N=[];for(let O=0;O<U;O++){let T=bI(C[O]??"");for(let v of J)T=Math.max(T,bI(v[O]??""));N.push(T)}let X=(O,T)=>{let v=[zC(" ")];for(let V=0;V<U;V++){if(V>0)v.push(zC(" │ ","dim"));let j=O[V]??"",h=Math.max(0,N[V]-bI(j)),f=D[V]??"left",c=f==="right"?h:f==="center"?Math.floor(h/2):0,e=h-c;v.push(zC(" ".repeat(c)),zC(j,T),zC(" ".repeat(e)))}return v},L=[X(C,"heading")];L.push(NT(zC(" "),...N.map((O,T)=>(T>0?[zC("─┼─","dim")]:[]).concat([zC("─".repeat(O),"dim")])).flat()));for(let O of J)L.push(X(O,"text"));return L.map((O)=>bI(O.map((T)=>T.text).join(""))>B?wL(O,B):O)}function wL(I,B){let C=[],D=0;for(let J of I){if(D>=B)break;let U=$L(J.text,B-D);if(U)C.push({text:U,tone:J.tone});D+=bI(U)}return C}function LT(I,B){let C=Math.max(4,Math.floor(B)||4),D=String(I??"").replace(/\r\n?/g,`
350
350
  `).split(`
351
- `),J=[],U=(X)=>{for(let L of X)J.push({line:wL(L,C)})},N=0;while(N<D.length){let X=D[N],L=/^\s{0,3}(```|~~~)/.exec(X);if(L){let V=L[1],j=new RegExp(`^\\s{0,3}${V}\\s*$`);N++;while(N<D.length&&!j.test(D[N]))J.push({line:[{text:D[N],tone:"dim"}]}),N++;if(N<D.length)N++;continue}if(!X.trim()){J.push({line:[]}),N++;continue}if(X.includes("|")&&N+1<D.length&&XT(D[N+1])){let V=[X,D[N+1]];N+=2;while(N<D.length&&D[N].trim()&&D[N].includes("|"))V.push(D[N]),N++;U(RT(V,C));continue}let O=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(X);if(O){U(c3([{text:O[2],tone:"heading"}],C)),N++;continue}if(/^\s{0,3}([-*_])(\s*\1){2,}\s*$/.test(X)){J.push({line:[{text:"─".repeat(C),tone:"dim"}]}),N++;continue}let T=/^\s{0,3}>\s?(.*)$/.exec(X);if(T){U(c3(Y5(N5(T[1])),C,"│ ","│ ")),N++;continue}let v=/^(\s*)([-*+]|\d+[.)])\s+(.*)$/.exec(X);if(v){let V=" ".repeat(Math.min(8,v[1].length)),j=/^[-*+]$/.test(v[2])?"•":v[2],h=`${V}${j} `;U(c3(Y5(N5(v[3])),C,h," ".repeat(bI(h)))),N++;continue}U(c3(Y5(N5(X)),C)),N++}return J}function zT(I){let B=2166136261,C=I.slice(0,4096);for(let D=0;D<C.length;D++)B^=C.charCodeAt(D),B=Math.imul(B,16777619);return`${C.length}:${I.length}:${B>>>0}`}var GK=new Map;function X5(I,B,C){let D=`${I}\x00${C}\x00${zT(B)}`,J=GK.get(D);if(J)return J;let U=LT(B,C);if(GK.set(D,U),GK.size>6){let N=GK.keys().next().value;if(N!==void 0)GK.delete(N)}return U}var q5={appTitle:"teamsmith pulse",patrolLabel:"patrol",patrolSeconds:"patrol {n}s",standbyLabel:"standby",standbyOn:"standby on (reason: {reason})",standbyOff:"standby off",standbyDash:"standby —",pmLabel:"PM",pmDeliveryWarning:"delivery degraded: {reason}",pendingLabel:"pending",pendingNone:"none",outboxLabel:"deferred",outboxHeldSuffix:" (held {n})",outboxImpededSuffix:" · impeded {n}",capacityLabel:"capacity",capacityRam:"RAM {mb}",capacitySwap:"swap {mb}",capacityAgents:"{n} more agents fit",capacityDisk:"{path} {mb} (inode {ino})",dash:"—",progressLabel:"progress",progressTasks:"tasks {parts}",taskTodo:"todo",taskWip:"wip",taskReview:"review",taskBlocked:"blocked",taskDone:"done",taskDropped:"dropped",progressChanges:"changes {n}",progressSpecs:"specs {specs} · {reqs} requirements",progressDecisions:"decisions {n}",countPair:"{label} {n}",deliveriesLabel:"recent deliveries",deliveryLine:"{id} · {agent} · {time}",deliveriesEmpty:"(no deliveries yet)",agentsHeader:"agent",tableState:"state",tableTask:"task",tableBranch:"branch",tableSession:"session",agentRunning:"running",agentExited:"exited",agentAbsent:"no window",pmRunning:"running",pmStarting:"starting",pmAbsent:"not running",pmForeign:"another project holds it",pmUnknown:"not a PM process",agentEmpty:"(no agents)",activityHeading:"activity (windows running in this session)",activitySource:"source {path}",activityEmpty:"(no session activity)",recentHeading:"recent actions",recentEmpty:"(no actions recorded yet)",pageOverview:"overview",pageWork:"work",pageMessages:"messages & logs",pageBoard:"board",pageReplies:"key replies",pageOverviewShort:"overview",pageWorkShort:"work",pageMessagesShort:"msgs",pageBoardShort:"board",pageRepliesShort:"replies",pageTab:" {name} ",pageTabActive:"▸{name}◂",boardHeading:"board",boardHeadingCount:"board ({n})",boardCounts:"{todo} todo · {wip} wip · {review} review · {blocked} blocked · {done} done",boardDoneCollapsed:"… {n} older done/dropped rows folded",boardEmpty:"(board is empty)",kanbanEmptyLane:"·",laneFolded:" (folded)",laneHiddenAbove:"↑{n}",laneHiddenBelow:"↓{n}",detailTitle:"detail {id}",detailNoFiles:"(no associated files for this entry)",detailUnavailable:"(source unavailable: {reason})",detailTruncated:"… truncated (first 128 KiB shown)",detailLoading:"… loading",changesHeading:"active changes",changesHeadingCount:"active changes ({n})",changeLine:"{done}/{total} · {phase}",changePhaseExplore:"explore",changePhasePropose:"propose",changePhaseApply:"apply",changePhaseVerify:"verify",changePhaseArchive:"archive",specsHeading:"specs",specsCount:"{specs} specs · {reqs} requirements",specsLine:"{name} {n}",decisionsHeading:"recent decisions",decisionsCountSuffix:"{n} total",decisionsEmpty:"(no decisions recorded)",queueHeading:"deferred queue",queueHeadingCount:"deferred queue {queued} (held {held})",queueLine:"{index}. [{state}] {name} · {age}",queueStateQueued:"queued",queueStateHeld:"held",queueHeldReason:"held reason: {reason}",queueViewHint:"Enter to view the full text",queueImpededLine:"delivery impeded {n}: {reasons}",queueImpededItem:" {entry} → {reason} ({when})",queueImpededUnavailable:" (diagnostics unavailable; read HOLDING.log)",queueBackHint:"Esc back to the list",queueEmpty:"(queue is empty)",queueFullHeading:"full text: {name}",queueMeta:"kind={kind} target={target} from={from}",inboxHeading:"inbox and threads",inboxLine:"inbox {inbox} · thread {thread} · {age}",inboxEmpty:"(no inbox/thread files)",patrolHeading:"patrol log",patrolEmpty:"(no patrol records yet)",trendHeading:"capacity trend",trendLine:"RAM {mb} · swap {swap}",healthHeading:"health",healthLine:"skill {version} · doctor {doctor} · last gates {gates}",healthDoctorOk:"ok",healthDoctorWarn:"warn",healthDoctorFail:"fail",healthDoctorNA:"unavailable",settingsTitle:"settings",settingsCursor:"›",prefLang:"language",prefDefaultPage:"default page",prefActivity:"activity column",prefMouse:"mouse",prefDensity:"density",toggleOn:"on",toggleOff:"off",langNameZh:"中文",langNameEn:"English",densityComfortable:"comfortable",densityCompact:"compact",settingsHint:"↑/↓ select · Enter toggle · Esc/, close",prefProjectSettings:"Project settings",prefNavArrow:"›",settingsViewTitle:"Project settings",group_identity:"Identity & ledger layout",group_branch:"Branch & forge",group_policy:"Permissions & dependencies",group_roster:"Roster, models & adapters","group_task-model":"Task categories & PM model",group_workflow:"Workflow & gates",group_delivery:"Capacity & delivery",group_panel:"Pulse & panel",group_patrol:"Patrol","group_pm-lifecycle":"PM lifecycle",group_session:"Live sessions",group_meeting:"Cross-project meetings",settingsGroupUngrouped:"Ungrouped",settingsGroupCategories:"The model the next task will use",settingsGroupAssignments:"The model running tasks actually use",settingsBadgeApply:"apply",settingsBadgeRestart:"restart",settingsBadgeRefuse:"change in file",settingsUnknownBadge:"not recognized",settingsUnset:"unset · default {value}",settingsKeyHint:"↑/↓ rows · Enter edit · / filter · Esc back",keyFilter:"/ filter",settingFilterTitle:"Filter settings",settingConfirm:"Confirm: {key} {old} → {next} · {timing} (Enter again to write)",settingTimingApply:"the next process that reads it",settingTimingRestart:"needs a restart",settingDanger:"Danger: {reason} (press Enter once more to confirm)",settingRejected:"✗ refused: {line}",settingWritten:"✓ wrote {key} = {value} · {timing}",settingRefused:"✗ this value is changed in the project config file: {line}",settingInvalid:"✗ invalid value: {line}",settingConflict:"! the contract changed under the editor (fingerprint mismatch) — nothing written; reloaded",settingWriteError:"✗ write failed (file unchanged): {line}",settingsRefusedRoute:"change this value in the project config file .pi/team/config.sh; the panel cannot change it",settingsCategoryHint:"category {category}: team config set-task-model {category} <model> — new tasks only; a task already dispatched keeps the model it was given (this row never composes the map)",settingsCategoryRow:"category {category}",settingsCategoryModel:"model {model}",settingsCategoryBadge:"new tasks",settingsCategoryPickerTitle:"Pick the model for category {category}",settingsCategoryPickerHint:"↑/↓ choose · Enter writes that value now · only free text opens the editor · Esc back (new tasks only; a task already dispatched keeps the model it was given and no process is restarted)",settingsCategoryMapHint:"the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the pair list is never composed in the console",settingsCategoryMapEmpty:"the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the map is empty today; add a category through the CLI first",settingsAssignmentHint:"once a task is dispatched it keeps the model it was given; this setting does not change it",settingsAssignmentNote:"task {task} · category {category} · session {sid} · origin {selected}/{launch}",settingsAssignmentNone:"this seat has not been given a task yet",settingsAssignmentUnreadable:"this seat was given a task, but its record could not be read, so the panel does not show its model",settingsReadOnlyBadge:"change in file",settingsPmLaunchLabel:"last PM start",settingsPmLaunchNote:"window {window} · {mode} · {time}",settingsPmLaunchHint:"the model the PM used the last time it started; it cannot be changed here",settingsDiagnosisHeading:"these settings need an upgrade",settingsCliHint:"CLI: team config set {key} <value>",settingsRefusedHint:"change this value in the project config file .pi/team/config.sh; the panel cannot change it",settingsUnknownHint:"{key}: the file carries this setting but the tool does not know it; the panel cannot change it",settingsChoiceTitle:"Choose a value for {label} · {key}",settingsChoiceHint:"↑/↓ choose · Enter writes that value now (danger needs one more) · only free text opens the editor · Esc back",settingsChoiceCurrent:"current",settingsChoiceDefault:"default",settingsChoiceKeepUnset:"keep unset (cancel, nothing written)",settingsChoiceClear:"clear (write the empty value)",settingsChoiceFree:"… (free text)",settingsChoiceInterval:"accepted interval {min}–{max} (empty = unbounded)",settingsChoiceNoChoice:"the kind {kind} has no choice set; the command still validates the write (Enter opens free text)",settingCategoryConfirm:"Confirm category {category}: {old} → {next} · new tasks only; a task already dispatched keeps the model it was given (Enter again to write)",settingCategoryWritten:"✓ wrote category {category} = {value} · new tasks only; tasks already dispatched keep the model they were given; no process was restarted",settingPmWritten:"✓ wrote the PM model = {value} · changing the model needs team up --fresh-pm, which starts a new conversation; no process was restarted",settingsBoolOn:"on (1)",settingsBoolOff:"off (0)",settingsPathExists:"exists",settingsPathMissing:"missing",settingsPathNotExec:"not executable",keyCategoryPick:"Enter edit",seatSourceExplicit:"chosen at dispatch",seatSourcePolicy:"set by category",seatSourceAssignment:"kept from the record",label_TEAM_PROJECT:"Project name",label_TEAM_SESSION:"Session name",label_TEAM_PM_WINDOW:"PM window",label_TEAM_AGENTS:"Roster",label_TEAM_DOCS_DIR:"Ledger dir",label_TEAM_WORKTREES_DIR:"Worktree dir",label_TEAM_STATE_DIR:"State dir",label_TEAM_MEETINGS_DIR:"Meeting dir",label_TEAM_SPEC_DIR:"Spec dir",label_TEAM_ROOT:"Project root",label_TEAM_MAIN_ROOT:"Main checkout root",label_TEAM_TMP_ROOT:"Temp root",label_TEAM_CONFIG_FILE:"Contract file",label_TEAM_BRANCH_MODE:"Branch naming mode",label_TEAM_TASK_BRANCH_PREFIX:"Task branch prefix",label_TEAM_AGENT_BRANCH_PREFIX:"Seat branch prefix",label_TEAM_PROTECTED_BRANCH:"Protected branch",label_TEAM_REMOTE:"Remote",label_TEAM_VCS:"Forge",label_TEAM_TOKEN_FILE:"Token file",label_TEAM_GITLAB_HOST:"GitLab host",label_TEAM_GITLAB_PROJECT:"GitLab project",label_TEAM_GITLAB_TOKEN_FILE:"GitLab token file",label_TEAM_MERGE_PREFER_THEIRS:"Prefer branch side",label_TEAM_CONFIRM_WRITES:"Confirm writes",label_TEAM_ALLOW_FOREIGN_IDENTITY:"Allow foreign ID",label_TEAM_ALLOW_FOREIGN_SESSION:"Allow foreign window",label_TEAM_GUARD_FOREIGN_TARGET:"Guard foreign targets",label_TEAM_REPLACE_FOREIGN_PM:"Replace foreign PM",label_TEAM_ALLOW_DESTRUCTIVE_TMUX:"Allow destructive ops",label_TEAM_ASSUME_YES:"Assume yes",label_TEAM_REQUIRE_JS:"Require JS runtime",label_TEAM_REQUIRE_OPENSPEC:"Require OpenSpec",label_TEAM_REQUIRE_MAGIC_CONTEXT:"Require Magic Context",label_TEAM_PI_AGENT_DIR:"Pi agent dir",label_TEAM_PI_SETTINGS_FILE:"Pi settings file",label_TEAM_MEMINFO_FILE:"meminfo file",label_TEAM_DISK_STATS_FILE:"Disk stats fixture",label_TEAM_SMOKE_FAST:"Smoke fast mode",label_TEAM_MODEL_LIMITS:"Concurrency limits",label_TEAM_MODEL_WINDOWS:"Context windows",label_TEAM_SESSION_WARN_TOKENS:"Context warn tokens",label_TEAM_EXTRA_PI_ARGS:"Seat extra args",label_TEAM_AGENT_CMD:"Seat launch command",label_TEAM_AGENT_NOTIFY_CMD:"Turn-end notify cmd",label_TEAM_AGENT_LOG_GLOB:"Seat log glob",label_TEAM_PI_BIN:"pi binary",label_TEAM_AGENT_BIN:"Seat binary",label_TEAM_OPENSPEC_BIN:"openspec binary",label_TEAM_JS_BIN:"JS runtime",label_TEAM_TASK_MODELS:"Task category models",label_TEAM_PM_MODEL:"PM model",label_TEAM_CONFIG_VERSION:"Config shape version",label_TEAM_UPDATE_CHECK:"Startup version notice",label_TEAM_GATES:"Gate commands",label_TEAM_INSTALL_CMD:"Install command",label_TEAM_TASK_BRANCH_RESET:"Reset task branch",label_TEAM_DISPATCH_VERIFY_SEC:"Dispatch check wait",label_TEAM_DISPATCH_ALIVE_SEC:"Alive check wait",label_TEAM_SQUASH_LOOKBACK:"Squash look-back",label_TEAM_REVIEW_TIMEOUT:"Review timeout",label_TEAM_REVIEW_TIMEOUT_GRACE:"Timeout grace",label_TEAM_REVIEW_ALLOW_DIRTY:"Allow dirty checkout",label_TEAM_REVIEW_ALLOW_IGNORED:"Allow ignored files",label_TEAM_REVIEW_ALLOW_UNRESOLVED_BRANCH:"Allow unresolved tip",label_TEAM_REVIEW_ANY_DIR:"Skip checkout guard",label_TEAM_BOARD_DONE_FORCE:"Force board done",label_TEAM_BOARD_DONE_REASON:"Force-done reason",label_TEAM_MIN_FREE_SWAP_MB:"Free swap floor",label_TEAM_MIN_TOTAL_MB:"RAM+swap floor",label_TEAM_MIN_AVAIL_MB:"Free memory floor",label_TEAM_TMP_MIN_FREE_MB:"Temp root space floor",label_TEAM_TMP_MIN_FREE_INODES:"Temp root inode floor",label_TEAM_WARN_AVAIL_MB:"Memory warn line",label_TEAM_ZRAM_WARN_PCT:"zram warn percent",label_TEAM_AGENT_MEM_MB:"Seat memory cap",label_TEAM_NOTIFY_TMUX:"tmux delivery",label_TEAM_NOTIFY_DEDUP_SEC:"Notify dedup window",label_TEAM_INBOX_MAX_CHARS:"Inbox summary chars",label_TEAM_NOTIFY_LOG:"Notify debug log",label_TEAM_NOTIFY_DETAIL_MAX:"Notify detail bound",label_TEAM_DEFER_TTL:"Queued delivery TTL",label_TEAM_OUTBOX_MAX:"Outbox cap",label_TEAM_PANEL_DETAIL_CAP:"Detail read cap",label_TEAM_ORPHAN_WARN_MB:"Orphan memory hint",label_TEAM_ORPHAN_SCAN:"Scan orphan seats",label_TEAM_ORPHAN_PROC_ROOT:"Census proc root",label_TEAM_PULSE_INTERVAL:"Patrol interval",label_TEAM_MONITOR_REFRESH:"Panel refresh period",label_TEAM_MONITOR_EVENTS:"Initial event rows",label_TEAM_MONITOR_UI:"Panel renderer",label_TEAM_MONITOR_ACTIVITY:"Activity column",label_TEAM_AGENT_LOG_TAIL_BYTES:"Log tail read cap",label_TEAM_PULSE_WINDOW:"Pulse window name",label_TEAM_PULSE_NUDGE_GAP:"Nudge gap",label_TEAM_PULSE_PENDING_BOARD:"Wake on board to-do",label_TEAM_PULSE_REBUILD_TMUX:"Rebuild tmux server",label_TEAM_PULSE_MAX_RESTARTS:"Max auto-restarts",label_TEAM_PM_SESSION_ID:"PM session id",label_TEAM_PM_CMD:"PM launch command",label_TEAM_PM_BIN:"PM binary",label_TEAM_PM_EXTRA_PI_ARGS:"PM extra args",label_TEAM_PM_RESUME_ARGS:"PM resume args",label_TEAM_PM_START_WAIT:"PM start wait",label_TEAM_INBOX_WATCH_MAX_BYTES:"Watcher read cap",label_TEAM_INBOX_WATCH_PREVIEW:"Preview lines",label_TEAM_INBOX_WATCH_REPLAY_MAX:"Replay cap",label_TEAM_INBOX_WATCH_SEEN_MAX:"Seen-record cap",label_TEAM_INBOX_WATCH_STALE:"Stale threshold",label_TEAM_INBOX_WATCH_STALE_SEC:"Wake freshness (s)",label_TEAM_INBOX_WATCH_FORCE_FAIL:"Force watch failure",label_TEAM_IW_REQUIRE_WATCH:"Strict gate mode",label_TEAM_INBOX_WATCH_POLL_MS:"Poll interval",label_TEAM_INBOX_WATCH_HEARTBEAT_MS:"Heartbeat interval",label_TEAM_INBOX_WATCH_TARGET:"Delivery target",label_TEAM_BG_LOG_MAX_BYTES:"Background log cap",label_TEAM_SIGNAL_CALLS_LOG:"Signal call log",label_TEAM_SIGNAL_REAL:"Real signal tool",label_TEAM_BG_STOP_GRACE:"Job stop grace",label_TEAM_MEETING_TTL_HOURS:"Meeting TTL",label_TEAM_MEETING_MAX_TURNS:"Meeting turn cap",label_TEAM_MEETING_KNOCK:"Allow knocking",label_TEAM_MEETING_ALLOW_USER_ID:"Users who may knock",replyHeading:"key replies",replyHeadingCount:"key replies ({n})",replyLatest:"latest key reply",replyEmpty:"(no key replies yet)",replyUnavailable:"(unavailable)",replyLatestUnavailable:"latest reply unavailable: {reason}",replyDeclared:"from {from} · {at}",replyDeclaredShort:"from {from}",replySlotUnavailable:"#{no} unavailable",replyLoading:"… loading",replyBodyMissing:"this reply is unavailable",replyBodyHint:"read-only · shown as published",replyOlder:"Older",replyNewer:"Newer",replyBack:"Back",replyScrollHint:"↑/↓ PgUp/PgDn Home/End scroll",replyTotalSlots:"{n} numbered slots",replyTailWarning:"the index tail is incomplete (the last append did not finish)",replyPageNote:'"who is this reply written for?" — replies the PM wrote for the user',keyCompose:"m compose",keyFlush:"f flush",keyStandby:"s standby",keySettings:", settings",keyPages:"Tab/1-5 pages",keyReplies:"←/→ older/newer",keyReplyReset:"r newest",keyScroll:"↑/↓ scroll",keyLanes:"←/→ lanes",keyCards:"↑/↓ cards",keyFold:"c fold",keyRows:"↑/↓ rows",keyOpen:"Enter open",keyDetailClose:"Esc/q back",keyDetailTabs:"←/→ file",keyDetailScroll:"↑/↓ scroll",keyQuit:"q collapse",composeHint:"Enter send · C-j newline · Esc cancel (draft kept) · C-o editor",composeHiddenAbove:"↑{n} rows",composeReasonHint:"Enter standby · C-j newline (as a space) · Esc cancel",composeTitle:"Message",composeStandbyTitle:"Standby reason",receiptDelivered:"✓ delivered to the PM · delivered",receiptQueued:"… queued (the PM is typing) · queued",receiptHeld:"! held (copy under state/outbox/held/) · held",receiptError:"✗ delivery unconfirmed · {detail}",draftNotCleared:"✗ settled, but the draft file could not be emptied: {file} (the text stays in the input line)",flushOk:"✓ flush · {detail}",flushFail:"✗ flush failed · {detail}",standbyOkOn:"✓ standby on (reason: {reason})",standbyOkOff:"✓ standby off",standbyFail:"✗ standby failed · {detail}",busySend:"sending…",busyAction:"working…",editorClosed:"editor closed: draft {n} chars",noTeamCli:"teamsmith CLI not found",sendUnconfirmed:"delivery unconfirmed (no result token)",queuePending:"the queue still holds entries"};var R5={appTitle:"teamsmith pulse",patrolLabel:"巡检",patrolSeconds:"巡检 {n}s",standbyLabel:"待命",standbyOn:"待命 on(原因:{reason})",standbyOff:"待命 off",standbyDash:"待命 —",pmLabel:"PM",pmDeliveryWarning:"投递降级:{reason}",pendingLabel:"待办",pendingNone:"无",outboxLabel:"延后投递",outboxHeldSuffix:"(扣住 {n})",outboxImpededSuffix:"· 阻碍 {n}",capacityLabel:"容量",capacityRam:"RAM {mb}",capacitySwap:"swap {mb}",capacityAgents:"可再加 {n} 个 agent",capacityDisk:"{path} {mb}(inode {ino})",dash:"—",progressLabel:"项目进度",progressTasks:"任务 {parts}",taskTodo:"待办",taskWip:"进行",taskReview:"待复验",taskBlocked:"阻塞",taskDone:"完成",taskDropped:"已放弃",progressChanges:"变更 {n}",progressSpecs:"规格 {specs} 项 · {reqs} 条需求",progressDecisions:"决策 {n}",countPair:"{label} {n}",deliveriesLabel:"最近交付",deliveryLine:"{id} · {agent} · {time}",deliveriesEmpty:"(还没有交付记录)",agentsHeader:"代理",tableState:"状态",tableTask:"任务",tableBranch:"分支",tableSession:"会话",agentRunning:"在跑",agentExited:"已退出",agentAbsent:"无窗口",pmRunning:"在运行",pmStarting:"正在启动",pmAbsent:"未在跑",pmForeign:"别的项目占着",pmUnknown:"非 PM 进程",agentEmpty:"(没有 agent)",activityHeading:"活动(仅本 session 在跑的窗口)",activitySource:"源 {path}",activityEmpty:"(没有会话活动)",recentHeading:"最近动作",recentEmpty:"(还没有动作记录)",pageOverview:"总览",pageWork:"工作",pageMessages:"消息与日志",pageBoard:"看板",pageReplies:"关键回复",pageOverviewShort:"总览",pageWorkShort:"工作",pageMessagesShort:"消息",pageBoardShort:"看板",pageRepliesShort:"回复",pageTab:" {name} ",pageTabActive:"▸{name}◂",boardHeading:"任务看板",boardHeadingCount:"任务看板 ({n})",boardCounts:"{todo} 待办 · {wip} 进行 · {review} 待复验 · {blocked} 阻塞 · {done} 完成",boardDoneCollapsed:"… 其余 {n} 条 done/dropped 收起",boardEmpty:"(看板为空)",kanbanEmptyLane:"·",laneFolded:"(已折叠)",laneHiddenAbove:"↑{n}",laneHiddenBelow:"↓{n}",detailTitle:"详情 {id}",detailNoFiles:"(这个入口没有关联文件)",detailUnavailable:"(来源不可用:{reason})",detailTruncated:"… 已截断(只显示前 128 KiB)",detailLoading:"… 读取中",changesHeading:"活动变更",changesHeadingCount:"活动变更 ({n})",changeLine:"{done}/{total} · {phase}",changePhaseExplore:"探索",changePhasePropose:"提案",changePhaseApply:"实施",changePhaseVerify:"验证",changePhaseArchive:"归档",specsHeading:"规格",specsCount:"{specs} 项 · {reqs} 条需求",specsLine:"{name} {n}",decisionsHeading:"最近决策",decisionsCountSuffix:"共 {n} 条",decisionsEmpty:"(没有决策记录)",queueHeading:"延后队列",queueHeadingCount:"延后队列 {queued}(扣住 {held})",queueLine:"{index}. [{state}] {name} · {age}",queueStateQueued:"排队",queueStateHeld:"滞留",queueHeldReason:"扣住原因:{reason}",queueViewHint:"Enter 看全文",queueImpededLine:"投递阻碍 {n}:{reasons}",queueImpededItem:" {entry} → {reason}({when})",queueImpededUnavailable:"(诊断不可读:原因以 HOLDING.log 为准)",queueBackHint:"Esc 返回列表",queueEmpty:"(队列为空)",queueFullHeading:"条目全文:{name}",queueMeta:"kind={kind} target={target} from={from}",inboxHeading:"收件箱与往来",inboxLine:"收件箱 {inbox} 条 · 往来 {thread} 条 · {age}",inboxEmpty:"(没有收件箱/往来记录)",patrolHeading:"巡检日志",patrolEmpty:"(还没有巡检记录)",trendHeading:"容量趋势",trendLine:"RAM {mb} · swap {swap}",healthHeading:"健康",healthLine:"技能 {version} · doctor {doctor} · 上次门禁 {gates}",healthDoctorOk:"ok",healthDoctorWarn:"warn",healthDoctorFail:"fail",healthDoctorNA:"不可用",settingsTitle:"设置",settingsCursor:"›",prefLang:"语言",prefDefaultPage:"默认页面",prefActivity:"活动列",prefMouse:"鼠标",prefDensity:"密度",toggleOn:"开",toggleOff:"关",langNameZh:"中文",langNameEn:"English",densityComfortable:"舒适",densityCompact:"紧凑",settingsHint:"↑/↓ 选择 · Enter 切换 · Esc/, 关闭",prefProjectSettings:"项目设置",prefNavArrow:"›",settingsViewTitle:"项目设置",group_identity:"身份与账本布局",group_branch:"分支与 forge",group_policy:"权限与依赖",group_roster:"名册、模型解析与适配器","group_task-model":"任务类别与 PM 模型",group_workflow:"工作流与门禁",group_delivery:"容量与投递通知",group_panel:"巡检与面板",group_patrol:"巡检","group_pm-lifecycle":"PM 生命周期",group_session:"活着的会话",group_meeting:"跨项目会议",settingsGroupUngrouped:"未分组",settingsGroupCategories:"下一次派任务会用的模型",settingsGroupAssignments:"正在运行的任务实际使用的模型",settingsBadgeApply:"立即生效",settingsBadgeRestart:"需重启",settingsBadgeRefuse:"不可改",settingsUnknownBadge:"不认识",settingsUnset:"未设 · 默认 {value}",settingsKeyHint:"↑/↓ 行 · Enter 编辑 · / 筛选 · Esc 返回",keyFilter:"/ 筛选",settingFilterTitle:"筛选设置",settingConfirm:"确认:{key} {old} → {next} · {timing}(再按 Enter 写入)",settingTimingApply:"下一个读取它的进程生效",settingTimingRestart:"需要重启才生效",settingDanger:"危险:{reason}(再按一次 Enter 确认)",settingRejected:"✗ 被拒:{line}",settingWritten:"✓ 已写入 {key} = {value} · {timing}",settingRefused:"✗ 这个值要在项目配置文件里改:{line}",settingInvalid:"✗ 值不合法:{line}",settingConflict:"! 契约在编辑器打开后变过(指纹不符)—— 什么都没写;已重读",settingWriteError:"✗ 写入失败(原文件未动):{line}",settingsRefusedRoute:"这个值要改项目配置文件 .pi/team/config.sh,界面不能改",settingsCategoryHint:"类别 {category}:team config set-task-model {category} <model> —— 只影响以后派的新任务;已经派出去的任务继续用它当时的模型(这一行不组合映射)",settingsCategoryRow:"类别 {category}",settingsCategoryModel:"模型 {model}",settingsCategoryBadge:"新任务",settingsCategoryPickerTitle:"选择类别 {category} 的模型",settingsCategoryPickerHint:"↑/↓ 选择 · Enter 直接写入该值 ·「自由输入」才进编辑器 · Esc 返回(只影响以后派的新任务;已经派出去的任务继续用它当时的模型,没有进程被重启)",settingsCategoryMapHint:"类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 映射在面板里绝不被组合",settingsCategoryMapEmpty:"类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 当前映射为空,先用 CLI 添加一个类别",settingsAssignmentHint:"任务派出去以后就固定用它当时的模型,不跟着上面的设置变",settingsAssignmentNote:"任务 {task} · 类别 {category} · 会话 {sid} · 来源 {selected}/{launch}",settingsAssignmentNone:"这个席位还没有派过任务",settingsAssignmentUnreadable:"这个席位派过任务,但它的记录读不出来,面板不显示它在用的模型",settingsReadOnlyBadge:"不可改",settingsPmLaunchLabel:"PM 上次启动",settingsPmLaunchNote:"窗口 {window} · {mode} · {time}",settingsPmLaunchHint:"PM 上一次启动时用的模型,这里不能改",settingsDiagnosisHeading:"旧设置需要升级",settingsCliHint:"命令行:team config set {key} <新值>",settingsRefusedHint:"这个值要改项目配置文件 .pi/team/config.sh,界面不能改",settingsUnknownHint:"{key}:这个设置在文件里,工具不认识它,面板不能改",settingsChoiceTitle:"选择 {label} 的值 · {key}",settingsChoiceHint:"↑/↓ 选择 · Enter 直接写入该值(危险值再按一次确认)· 「自由输入」才进编辑器 · Esc 返回",settingsChoiceCurrent:"当前",settingsChoiceDefault:"默认",settingsChoiceKeepUnset:"保持未设(取消,什么都不写)",settingsChoiceClear:"清空(写入空值)",settingsChoiceFree:"…(自由输入)",settingsChoiceInterval:"接受区间 {min}–{max}(空 = 无界)",settingsChoiceNoChoice:"{kind} 这种 kind 没有选项集;写入仍由命令校验(Enter 打开自由输入)",settingCategoryConfirm:"确认类别 {category}:{old} → {next} · 只影响以后派的新任务;已经派出去的任务继续用它当时的模型(再按 Enter 写入)",settingCategoryWritten:"✓ 已写入类别 {category} = {value} · 只影响以后派的新任务;已经派出去的任务继续用它当时的模型;没有重启任何进程",settingPmWritten:"✓ 已写入 PM 模型 = {value} · 换模型要用 team up --fresh-pm 重开一场对话;没有重启任何进程",settingsBoolOn:"开(1)",settingsBoolOff:"关(0)",settingsPathExists:"存在",settingsPathMissing:"不存在",settingsPathNotExec:"不是可执行文件",keyCategoryPick:"Enter 编辑",seatSourceExplicit:"派单时指定",seatSourcePolicy:"按类别设置",seatSourceAssignment:"沿用原记录",label_TEAM_PROJECT:"项目名",label_TEAM_SESSION:"会话名",label_TEAM_PM_WINDOW:"PM 窗口",label_TEAM_AGENTS:"名册",label_TEAM_DOCS_DIR:"账本目录",label_TEAM_WORKTREES_DIR:"工作树目录",label_TEAM_STATE_DIR:"状态目录",label_TEAM_MEETINGS_DIR:"会议目录",label_TEAM_SPEC_DIR:"规格目录",label_TEAM_ROOT:"项目根",label_TEAM_MAIN_ROOT:"主检出根",label_TEAM_TMP_ROOT:"临时根目录",label_TEAM_CONFIG_FILE:"契约文件",label_TEAM_BRANCH_MODE:"分支命名模式",label_TEAM_TASK_BRANCH_PREFIX:"任务分支前缀",label_TEAM_AGENT_BRANCH_PREFIX:"席位分支前缀",label_TEAM_PROTECTED_BRANCH:"保护分支",label_TEAM_REMOTE:"远端",label_TEAM_VCS:"托管平台",label_TEAM_TOKEN_FILE:"凭据文件",label_TEAM_GITLAB_HOST:"GitLab 主机",label_TEAM_GITLAB_PROJECT:"GitLab 项目",label_TEAM_GITLAB_TOKEN_FILE:"GitLab 凭据文件",label_TEAM_MERGE_PREFER_THEIRS:"冲突默认取分支侧",label_TEAM_CONFIRM_WRITES:"写入前确认",label_TEAM_ALLOW_FOREIGN_IDENTITY:"放行外部身份",label_TEAM_ALLOW_FOREIGN_SESSION:"放行外部会话",label_TEAM_GUARD_FOREIGN_TARGET:"拦截外部目标",label_TEAM_REPLACE_FOREIGN_PM:"可替换外部 PM",label_TEAM_ALLOW_DESTRUCTIVE_TMUX:"放行破坏性操作",label_TEAM_ASSUME_YES:"默认全部确认",label_TEAM_REQUIRE_JS:"必需 JS 运行时",label_TEAM_REQUIRE_OPENSPEC:"必需 OpenSpec",label_TEAM_REQUIRE_MAGIC_CONTEXT:"必需 Magic Context",label_TEAM_PI_AGENT_DIR:"Pi 配置目录",label_TEAM_PI_SETTINGS_FILE:"Pi 设置文件",label_TEAM_MEMINFO_FILE:"内存信息文件",label_TEAM_DISK_STATS_FILE:"磁盘读数夹具",label_TEAM_SMOKE_FAST:"冒烟快模式",label_TEAM_MODEL_LIMITS:"模型并发上限",label_TEAM_MODEL_WINDOWS:"显式上下文窗口",label_TEAM_SESSION_WARN_TOKENS:"上下文告警阈值",label_TEAM_EXTRA_PI_ARGS:"席位附加参数",label_TEAM_AGENT_CMD:"席位启动命令",label_TEAM_AGENT_NOTIFY_CMD:"收工通知命令",label_TEAM_AGENT_LOG_GLOB:"席位日志路径",label_TEAM_PI_BIN:"pi 可执行文件",label_TEAM_AGENT_BIN:"席位可执行文件",label_TEAM_OPENSPEC_BIN:"openspec 可执行文件",label_TEAM_JS_BIN:"JS 运行时",label_TEAM_TASK_MODELS:"任务类别模型",label_TEAM_PM_MODEL:"PM 模型",label_TEAM_CONFIG_VERSION:"配置形状号",label_TEAM_UPDATE_CHECK:"启动时提示新版本",label_TEAM_GATES:"门禁命令",label_TEAM_INSTALL_CMD:"安装命令",label_TEAM_TASK_BRANCH_RESET:"派单时重置分支",label_TEAM_DISPATCH_VERIFY_SEC:"派单检查等待",label_TEAM_DISPATCH_ALIVE_SEC:"存活判定等待",label_TEAM_SQUASH_LOOKBACK:"squash 回看条数",label_TEAM_REVIEW_TIMEOUT:"复验超时",label_TEAM_REVIEW_TIMEOUT_GRACE:"超时宽限",label_TEAM_REVIEW_ALLOW_DIRTY:"复验放行脏工作树",label_TEAM_REVIEW_ALLOW_IGNORED:"复验放行忽略文件",label_TEAM_REVIEW_ALLOW_UNRESOLVED_BRANCH:"放行未解析分支",label_TEAM_REVIEW_ANY_DIR:"复验跳过目录校验",label_TEAM_BOARD_DONE_FORCE:"强制标记 done",label_TEAM_BOARD_DONE_REASON:"强制放行理由",label_TEAM_MIN_FREE_SWAP_MB:"swap 底线",label_TEAM_MIN_TOTAL_MB:"内存硬底线",label_TEAM_MIN_AVAIL_MB:"可用内存底线",label_TEAM_TMP_MIN_FREE_MB:"临时根空间底线",label_TEAM_TMP_MIN_FREE_INODES:"临时根 inode 底线",label_TEAM_WARN_AVAIL_MB:"可用内存告警线",label_TEAM_ZRAM_WARN_PCT:"zram 告警比例",label_TEAM_AGENT_MEM_MB:"席位内存上限",label_TEAM_NOTIFY_TMUX:"走 tmux 投递",label_TEAM_NOTIFY_DEDUP_SEC:"通知去重窗口",label_TEAM_INBOX_MAX_CHARS:"收件箱摘要字数",label_TEAM_NOTIFY_LOG:"通知调试日志",label_TEAM_NOTIFY_DETAIL_MAX:"通知明细条数上限",label_TEAM_DEFER_TTL:"排队过期时间",label_TEAM_OUTBOX_MAX:"发件箱条数上限",label_TEAM_PANEL_DETAIL_CAP:"详情文件读取上限",label_TEAM_ORPHAN_WARN_MB:"孤儿内存提示阈值",label_TEAM_ORPHAN_SCAN:"扫描孤儿席位进程",label_TEAM_ORPHAN_PROC_ROOT:"普查 /proc 接缝",label_TEAM_PULSE_INTERVAL:"巡检周期",label_TEAM_MONITOR_REFRESH:"面板刷新周期",label_TEAM_MONITOR_EVENTS:"事件初始条数",label_TEAM_MONITOR_UI:"面板渲染器",label_TEAM_MONITOR_ACTIVITY:"活动列",label_TEAM_AGENT_LOG_TAIL_BYTES:"日志尾部读取上限",label_TEAM_PULSE_WINDOW:"巡检窗口名",label_TEAM_PULSE_NUDGE_GAP:"重复提醒间隔",label_TEAM_PULSE_PENDING_BOARD:"看板待办也唤醒",label_TEAM_PULSE_REBUILD_TMUX:"自愈重建 server",label_TEAM_PULSE_MAX_RESTARTS:"自动拉起次数上限",label_TEAM_PM_SESSION_ID:"PM 会话 ID",label_TEAM_PM_CMD:"PM 启动命令",label_TEAM_PM_BIN:"PM 可执行文件",label_TEAM_PM_EXTRA_PI_ARGS:"PM 附加参数",label_TEAM_PM_RESUME_ARGS:"PM 续跑参数",label_TEAM_PM_START_WAIT:"PM 启动等待",label_TEAM_INBOX_WATCH_MAX_BYTES:"watcher 读取上限",label_TEAM_INBOX_WATCH_PREVIEW:"预览行数",label_TEAM_INBOX_WATCH_REPLAY_MAX:"重放条数上限",label_TEAM_INBOX_WATCH_SEEN_MAX:"已见记录上限",label_TEAM_INBOX_WATCH_STALE:"过期判定秒数",label_TEAM_INBOX_WATCH_STALE_SEC:"唤醒行新鲜度",label_TEAM_INBOX_WATCH_FORCE_FAIL:"强制注册失败(测试)",label_TEAM_IW_REQUIRE_WATCH:"门禁严格模式(测试)",label_TEAM_INBOX_WATCH_POLL_MS:"轮询间隔",label_TEAM_INBOX_WATCH_HEARTBEAT_MS:"心跳间隔",label_TEAM_INBOX_WATCH_TARGET:"投递目标",label_TEAM_BG_LOG_MAX_BYTES:"后台日志上限",label_TEAM_SIGNAL_CALLS_LOG:"信号调用审计",label_TEAM_SIGNAL_REAL:"信号真身",label_TEAM_BG_STOP_GRACE:"作业停止宽限",label_TEAM_MEETING_TTL_HOURS:"会议有效期",label_TEAM_MEETING_MAX_TURNS:"会议轮次上限",label_TEAM_MEETING_KNOCK:"允许敲门",label_TEAM_MEETING_ALLOW_USER_ID:"可敲门用户",replyHeading:"关键回复",replyHeadingCount:"关键回复({n})",replyLatest:"最新关键回复",replyEmpty:"(还没有关键回复)",replyUnavailable:"(不可用)",replyLatestUnavailable:"最新回复不可用:{reason}",replyDeclared:"来自 {from} · {at}",replyDeclaredShort:"来自 {from}",replySlotUnavailable:"#{no} 不可用",replyLoading:"… 载入中",replyBodyMissing:"这份回复不可用",replyBodyHint:"只读 · 按发布的原文显示",replyOlder:"更早",replyNewer:"更新",replyBack:"返回",replyScrollHint:"↑/↓ PgUp/PgDn Home/End 滚动",replyTotalSlots:"{n} 个编号槽位",replyTailWarning:"索引尾部不完整(上一次追加没有写完)",replyPageNote:"「这条回复是写给谁的?」——PM 写给用户的回复都在这里",keyCompose:"m 写信",keyFlush:"f 冲刷",keyStandby:"s 待命",keySettings:", 设置",keyPages:"Tab/1-5 翻页",keyReplies:"←/→ 更早/更新",keyReplyReset:"r 最新",keyScroll:"↑/↓ 滚动",keyLanes:"←/→ 车道",keyCards:"↑/↓ 卡片",keyFold:"c 折叠",keyRows:"↑/↓ 行",keyOpen:"Enter 打开",keyDetailClose:"Esc/q 返回",keyDetailTabs:"←/→ 文件",keyDetailScroll:"↑/↓ 滚动",keyQuit:"q 收起",composeHint:"Enter 发送 · C-j 换行 · Esc 取消(保留草稿)· C-o 编辑器",composeHiddenAbove:"↑{n} 行",composeReasonHint:"Enter 进入待命 · C-j 换行(变空格)· Esc 取消",composeTitle:"写信",composeStandbyTitle:"待命原因",receiptDelivered:"✓ 已送达 PM · delivered",receiptQueued:"… 已入队(PM 的输入框在忙)· queued",receiptHeld:"! 滞留(副本在 state/outbox/held/)· held",receiptError:"✗ 投递未确认 · {detail}",draftNotCleared:"✗ 已结算,但草稿文件清不掉:{file}(文字保留在输入行)",flushOk:"✓ 冲刷 · {detail}",flushFail:"✗ 冲刷失败 · {detail}",standbyOkOn:"✓ 待命 on(原因:{reason})",standbyOkOff:"✓ 待命 off",standbyFail:"✗ 待命失败 · {detail}",busySend:"发送中…",busyAction:"执行中…",editorClosed:"编辑器已关闭:草稿 {n} 字符",noTeamCli:"找不到 teamsmith CLI",sendUnconfirmed:"投递未确认(没有拿到结果码)",queuePending:"队列仍有条目未投递"};var WL={zh:R5,en:q5};function L5(I){return I==="zh"||I==="en"}function H8(I){return L5(I)?WL[I]:WL.zh}var VT=["prefLang","prefDefaultPage","prefActivity","prefMouse","prefDensity"],OL=VT.reduce((I,B)=>Math.max(I,bI(R5[B]),bI(q5[B])),0);function NI(I,B){return String(I).replace(/\{(\w+)\}/g,(C,D)=>Object.prototype.hasOwnProperty.call(B,D)?String(B[D]):C)}var $T="label_";function l3(I,B){let C=I[$T+B];return typeof C==="string"&&C.length>0?C:String(B)}var L1=["todo","wip","review","done","blocked","dropped"];var PL={name:"dark",bg:"#10141a",tones:{title:"#ffffff",text:"#dfe3ea",dim:"#98a2b3",heading:"#7cc7ff",accent:"#9db8ff",ok:"#8ee6a1",warn:"#f2c66d",err:"#ff9d9d",selected:"#9db8ff"}},wT={name:"light",bg:"#fbfbf8",tones:{title:"#111111",text:"#24292f",dim:"#57606a",heading:"#0b5cad",accent:"#1b4fd8",ok:"#0f7a37",warn:"#8a5a00",err:"#c0272d",selected:"#1b4fd8"}},z1={dark:PL,light:wT};function V5(I,B=process.env){if(I==="dark"||I==="light")return I;let D=String(B.COLORFGBG??"").split(";").pop()?.trim()??"";if(/^\d+$/.test(D))return Number(D)>=7&&Number(D)!==8?"light":"dark";return"dark"}function TL(I){let B=/^#?([0-9a-fA-F]{6})$/.exec(String(I).trim());if(!B)return[0,0,0];let C=Number.parseInt(B[1],16);return[C>>16&255,C>>8&255,C&255]}function z5(I){let B=I/255;return B<=0.04045?B/12.92:((B+0.055)/1.055)**2.4}function jL(I){let[B,C,D]=TL(I);return 0.2126*z5(B)+0.7152*z5(C)+0.0722*z5(D)}function WT(I,B){let C=jL(I),D=jL(B),J=Math.max(C,D),U=Math.min(C,D);return(J+0.05)/(U+0.05)}function $5(I=PL){return Object.keys(I.tones).map((B)=>({tone:B,fg:I.tones[B],bg:I.bg,ratio:WT(I.tones[B],I.bg)}))}var OT={title:"97",text:"39",dim:"90",heading:"96",accent:"94",ok:"92",warn:"93",err:"91",selected:"94"};function SL(I,B,C=!0){if(!C)return OT[I]??"39";let[D,J,U]=TL(B.tones[I]??"#ffffff");return`38;2;${D};${J};${U}`}var jT=160,PT=100,TT=60,ST=0.56,_T=0.64,U8=3,i=(I,B="text")=>({text:String(I),tone:B});function vT(I){let B=[];for(let C of I){let D=B[B.length-1];if(D&&D.tone===C.tone&&!D.clock&&!C.clock)D.text+=C.text;else B.push({...C})}return B}var OA=(...I)=>vT(I.filter((B)=>B!==null&&B!==void 0&&B!=="").map((B)=>typeof B==="string"?i(B):B)),R0=(I)=>I.map((B)=>B.text).join(""),bD=(I)=>bI(R0(I));function VI(I,B){if(B<=0)return[];if(bD(I)<=B)return I;let C=B-1,D=[],J=0;for(let U of I){if(J>=C)break;let N="";for(let X of U.text){let L=bI(X);if(J+L>C)break;N+=X,J+=L}if(N)D.push({text:N,tone:U.tone})}return D.push(i("…",D[D.length-1]?.tone??"text")),D}function uL(I,B){let C=B-bD(I);return C>0?[...I,i(" ".repeat(C),"text")]:I}function QD(I,B,C){let D=VI(I,C);if(!B?.length)return{line:D};let U=bD(I)>C?Math.max(0,C-1):C,N=[];for(let X of B){let L=Math.min(X.start,U),O=Math.min(X.end,U);if(O>L)N.push({...X,start:L,end:O})}return N.length?{line:D,hits:N}:{line:D}}function W1(I){return I.view.tui&&I.view.density==="comfortable"}function pL(I,B){if(B<=1)return OA(i(V1,"dim"));if(B===2)return OA(i(V1+JK,"dim"));let C=B-2;if(!I)return OA(i(V1+ID.repeat(C)+JK,"dim"));let D=bI(I);if(2+D+1>C){let U=Math.max(0,C-1);return OA(i(V1+ID,"dim"),...VI(OA(i(I,"heading")),U),i(JK,"dim"))}let J=C-(2+D+1);return OA(i(V1+ID+" ","dim"),i(I,"heading"),i(" "+ID.repeat(Math.max(0,J)),"dim"),i(JK,"dim"))}function r3(I){if(I<=1)return OA(i(a3,"dim"));if(I===2)return OA(i(a3+w5,"dim"));return OA(i(a3+ID.repeat(I-2)+w5,"dim"))}function mJ(I,B){let C=Math.max(0,B-4),D=VI(I.line,C),J=Math.max(0,C-bD(D)),U=[];for(let X of I.hits??[]){let L=Math.min(X.start+2,2+C),O=Math.min(X.end+2,2+C);if(O>L)U.push({...X,start:L,end:O})}let N=OA(i(`${s3} `,"dim"),...D,J>0?i(" ".repeat(J),"text"):null,i(` ${s3}`,"dim"));return U.length?{line:N,hits:U}:{line:N}}function dL(I,B,C="heading"){if(B<=0)return[];if(!I)return OA(i(d3(B,ID),"dim"));let D=bI(I);if(D+4>=B)return VI(OA(i(ID+ID+" ","dim"),i(I,C)),B);let J=2,U=B-J-1-D;return OA(i(d3(J,ID)+" ","dim"),i(I,C),i(" "+d3(Math.max(0,U-1),ID),"dim"))}function yT(I,B,C){let D=I.title;if(!D||C==="plain"){if(D&&C==="plain"&&I.id!=="agents")return[{line:VI(OA(i(` ${D}`,"heading")),B)},...I.lines];return I.lines}if(C==="rule")return[{line:dL(D,B)},...I.lines.map((J)=>({line:VI(J.line,B),hits:J.hits}))];return[{line:pL(D,B)},...I.lines.map((J)=>mJ(J,B)),{line:r3(B)}]}function kT(I,B,C){let D=I.lines.length;if(!C||!I.title){if(B>=D)return"plain";if((I.summary||I.title)&&B>=1)return"summary";return null}if(B>=D+2)return"card";if(B>=D+1)return"rule";if(B>=1)return"summary";return null}function hT(I,B){if(I.summary)return{line:VI(I.summary.line,B),hits:I.summary.hits};return{line:VI(OA(i(` ${I.title??""}`,"heading")),B)}}var V1="╭",JK="╮",a3="╰",w5="╯",ID="─",s3="│";function cL(I,B,C){if(C){let D=I.state==="running"?B.agentRunning:I.state==="exited"?B.agentExited:B.agentAbsent;return`${p3[I.state]??"?"}${[...D][0]??""}`}return fT(I,B)}function xT(I,B,C,D){let J=Math.max(10,bI(D.agentsHeader)),U=bI(D.tableState);for(let h of C)U=Math.max(U,bI(cL(h,D,B)));let N=bI(D.tableSession);for(let h of C)N=Math.max(N,bI(String(h.session_text||D.dash)));let X=Math.max(7,bI(D.tableTask)),L={id:"name",header:D.agentsHeader,width:J},O={id:"state",header:D.tableState,width:U},T={id:"session",header:D.tableSession,width:N},v=J+U+N,V=I-v;if(B||V<7)return[L,O,T];let j={id:"task",header:D.tableTask,width:X};if(V>=X+8)return[L,O,j,{id:"branch",header:D.tableBranch,width:V-X},T];if(V>=X)return[L,O,j,T];return[L,O,T]}function _L(I,B){return OA(...I.map((C,D)=>i(sg(B[D]?.text??"",C.width),B[D]?.tone??"text")))}function fT(I,B){let C=p3[I.state]??"?",D=I.state==="running"?B.agentRunning:I.state==="exited"?B.agentExited:B.agentAbsent,J=I.cause?` · ${I.cause}`:"";return`${C} ${D}${J}`}function bT(I,B){switch(I?.state){case"running":return B.pmRunning;case"starting":return B.pmStarting;case"foreign":return B.pmForeign;case"unknown":return B.pmUnknown;default:return B.pmAbsent}}function mT(I){let{s:B,panel:C}=I,D=C.project||B.dash,J=`${B.appTitle} · ${D}`,U=!C.standby?B.standbyDash:NI(C.standby.on?B.standbyOn:B.standbyOff,{reason:C.standby.reason||"-"}),N=C.timestamp?bJ(C.timestamp):B.dash,X=` ${NI(B.patrolSeconds,{n:C.interval||"—"})} · ${U}`,O=I.width-bI(J)-2>=bI(`${N}${X}`)?OA(i(J,"title"),i(" "),{text:N,tone:"dim",clock:!0},i(X,"dim")):OA(i(`${J} ${N}${X}`,"title"));return{id:"title",full:!0,priority:0,lines:[{line:VI(O,I.width)}],separator:"none"}}function uT(I){let{s:B,panel:C,deg:D}=I,J=!C.pm||D.has("pm")?`${B.pmLabel} ${B.dash}`:`${B.pmLabel} ${C.pm.state}${C.pm.detail?`(${C.pm.detail})`:""} · ${bT(C.pm,B)}`,U=!C.pending||D.has("pending")?`${B.pendingLabel} ${B.dash}`:`${B.pendingLabel} ${C.pending.text||B.pendingNone}`,N=C.outbox,X=!N||D.has("outbox")?`${B.outboxLabel} ${B.dash}`:`${B.outboxLabel} ${N.queued}${N.held>0?NI(B.outboxHeldSuffix,{n:N.held}):""}${N.impeded&&N.impeded>0?` ${NI(B.outboxImpededSuffix,{n:N.impeded})}`:""}`,L=[{line:VI(OA(i(" "),i(J),i(" "),i(U),i(" "),i(X,"accent")),I.width)}],O=!C.pm||D.has("pm")?"":C.pm.delivery_warning||"";if(O)L.push({line:VI(OA(i(" "),i(NI(B.pmDeliveryWarning,{reason:O}),"warn")),I.width)});if(N&&!D.has("outbox")&&N.impeded&&N.impeded>0){let T=Array.from(new Set((N.impediments??[]).map((v)=>v.reason))).join(" · ")||B.dash;L.push({line:VI(OA(i(" "),i(NI(B.queueImpededLine,{n:N.impeded,reasons:T}),"warn")),I.width)})}return{id:"status",full:!0,priority:1,lines:L,separator:"none"}}function pT(I){let{s:B,panel:C,deg:D}=I,J=C.capacity;if(!J||D.has("capacity"))return{id:"capacity",title:B.capacityLabel,full:!0,priority:2,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let U=Math.min(18,Math.max(0,I.width-60)),N=(J.disk??[]).flatMap((T)=>[i(" | ","dim"),i(NI(B.capacityDisk,{path:T.path,mb:T.avail_mb==null?B.dash:R1(T.avail_mb),ino:T.free_inodes==null?B.dash:String(T.free_inodes)}))]),X=N.reduce((T,v)=>T+bI(v.text),0),L=F5(J.spark,Math.max(0,U-X)),O=OA(i(NI(B.capacityRam,{mb:R1(J.ram_avail_mb)})),i(" | ","dim"),i(NI(B.capacitySwap,{mb:R1(J.swap_free_mb)})),i(" | ","dim"),i(NI(B.capacityAgents,{n:J.agents})),...N,L?i(` ${L}`,"accent"):null);return{id:"capacity",title:B.capacityLabel,full:!0,priority:2,lines:[{line:VI(O,I.width)}]}}function dT(I){let{s:B,panel:C,deg:D,blocks:J}=I,U=J.board,N=[];if(U&&!D.has("board")){let L=U.counts??{},O=[[B.taskTodo,L.todo??0],[B.taskWip,L.wip??0],[B.taskReview,L.review??0],[B.taskBlocked,L.blocked??0],[B.taskDone,L.done??0]].map(([T,v])=>NI(B.countPair,{label:T,n:v})).join(" · ");N.push(i(NI(B.progressTasks,{parts:O})))}else N.push(i(NI(B.progressTasks,{parts:B.dash}),"dim"));let X=i(" | ","dim");if(N.push(X),J.changes&&!D.has("changes"))N.push(i(NI(B.progressChanges,{n:J.changes.count})));else N.push(i(`${B.progressChanges.replace("{n}",B.dash)}`,"dim"));if(N.push(X),J.specs&&!D.has("specs"))N.push(i(NI(B.progressSpecs,{specs:J.specs.count,reqs:J.specs.requirements})));else N.push(i(`${B.specsHeading} ${B.dash}`,"dim"));if(N.push(X),J.decisions&&!D.has("decisions"))N.push(i(NI(B.progressDecisions,{n:J.decisions.count})));else N.push(i(`${B.progressDecisions.replace("{n}",B.dash)}`,"dim"));return{id:"progress",title:B.progressLabel,full:!0,priority:5,lines:[{line:VI(OA(...N),I.width)}],summary:{line:VI(OA(i(` ${B.progressLabel}`,"heading")),I.width)}}}function cT(I){let{s:B,deg:C,blocks:D}=I,J=D.board;if(!J||C.has("board"))return null;let U=J.deliveries??[];if(!U.length)return{id:"deliveries",title:B.deliveriesLabel,full:!0,priority:6,lines:[{line:OA(i(` ${B.deliveriesEmpty}`,"dim"))}]};let N=[...U.slice(0,3).map((X)=>({line:VI(OA(i(" "),i(NI(B.deliveryLine,{id:X.id,agent:X.agent,time:X.at?bJ(X.at):B.dash}))),I.width)}))];return{id:"deliveries",title:B.deliveriesLabel,full:!0,priority:6,lines:N,summary:{line:VI(OA(i(` ${B.deliveriesLabel}`,"heading")),I.width)}}}function lT(I){let{s:B,panel:C,deg:D,width:J,minimal:U}=I,N=!C.agents||D.has("agents")?[]:C.agents??[],L=W1(I)&&J>8?J-4:J,O=xT(L,U,N,B);if(!C.agents||D.has("agents"))return{id:"agents",title:B.agentsHeader,priority:10,lines:[{line:OA(i(` ${B.dash}`,"dim"))}],summary:{line:VI(OA(i(` ${B.agentsHeader} ${B.dash}`,"heading")),J)}};let T=O.map((V)=>({text:V.header,tone:"heading"})),v=[{line:_L(O,T)}];if(!N.length)v.push({line:OA(i(` ${B.agentEmpty}`,"dim"))});for(let V of N){let j=O.map((h)=>{switch(h.id){case"name":return{text:String(V.name??"?"),tone:"text"};case"state":return{text:cL(V,B,U),tone:iT(V.state)};case"task":return{text:String(V.task||B.dash),tone:"text"};case"branch":{let f=`${V.dirty?" *":""}${V.ahead?` +${V.ahead}`:""}`;return{text:`${RL(String(V.branch??""),Math.max(1,h.width-bI(f)))}${f}`,tone:"text"}}case"session":return{text:String(V.session_text||B.dash),tone:"text"}}});v.push({line:_L(O,j)})}return{id:"agents",title:B.agentsHeader,priority:10,lines:v,summary:{line:VI(OA(i(` ${B.agentsHeader} (${N.length})`,"heading")),J)}}}function iT(I){return I==="running"?"ok":I==="exited"?"warn":"dim"}function aT(I){let{s:B,panel:C,deg:D,activity:J,width:U,view:N}=I;if(!I.input.activity)return null;let X=[];if(D.has("activity")||!C.activity_source)X.push({line:OA(i(` ${B.dash}`,"dim"))});else{let L=`${B.activitySource.replace("{path}","")}`.trim(),O=zL(C.activity_source,U-bI(L)-3);X.push({line:VI(OA(i(" "),i(L,"dim"),i(" "),i(O,"dim")),U)});let T=oT(J).slice(Math.max(0,N.scroll));if(!T.length)X.push({line:OA(i(` ${B.activityEmpty}`,"dim"))});for(let v of T)X.push({line:VI(OA(i(` ${v}`)),U)})}return{id:"events",title:B.activityHeading,right:!0,priority:11,lines:X,summary:{line:VI(OA(i(` ${B.activityHeading}`,"heading")),U)}}}function nT(I){let{s:B,panel:C,deg:D,width:J}=I,U=C.recent??[];if(D.has("recent")||!C.recent)return{id:"recent",title:B.recentHeading,right:!0,priority:12,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=[],X=U.slice(-6);if(!X.length)N.push({line:OA(i(` ${B.recentEmpty}`,"dim"))});for(let L of X)N.push({line:VI(OA(i(` ${L}`,"dim")),J)});return{id:"recent",title:B.recentHeading,right:!0,priority:12,lines:N,summary:{line:VI(OA(i(` ${B.recentHeading}`,"heading")),J)}}}function oT(I){let B=[];for(let C of I??[]){let D=String(C?.name??"?"),J=Array.isArray(C?.events)?C.events:[];if(!J.length)continue;for(let U of J){let N=U?.ts?String(U.ts):"",X=N&&N.includes("T")?N.slice(11,19):N,L=String(U?.text??"");B.push(` ${D}${X?` ${X}`:""} ${L}`.trimEnd())}}return B}var W5={todo:"dim",wip:"accent",review:"warn",blocked:"err",done:"ok",dropped:"dim"};function lL(I,B){switch(I){case"done":return B.taskDone;case"wip":return B.taskWip;case"review":return B.taskReview;case"blocked":return B.taskBlocked;case"todo":return B.taskTodo;case"dropped":return B.taskDropped;default:return I}}function rT(I,B){switch(I){case"explore":return B.changePhaseExplore;case"propose":return B.changePhasePropose;case"verify":return B.changePhaseVerify;case"archive":return B.changePhaseArchive;default:return B.changePhaseApply}}var T5=5;function sT(I){if(I.deg.has("board"))return 0;let B=I.blocks.board?.rows??[],C=0;for(let D of B)if(D.state==="done"||D.state==="dropped")C++;return Math.max(0,C-Math.max(1,I.boardDoneKeep??T5))}function iL(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.board;if(!U)return null;if(D.has("board"))return{id:"board",title:B.boardHeading,priority:10,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=U.rows??[];if(!N.length)return{id:"board",title:B.boardHeading,priority:10,lines:[{line:OA(i(` ${B.boardEmpty}`,"dim"))}]};let X=U.counts??{},L=[{line:VI(OA(i(` ${NI(B.boardCounts,{todo:X.todo??0,wip:X.wip??0,review:X.review??0,blocked:X.blocked??0,done:X.done??0})}`,"dim")),J)}],O=N.filter((IA)=>IA.state==="done"||IA.state==="dropped"),T=Math.max(1,I.boardDoneKeep??T5),v=new Set(O.slice(-T).map((IA)=>IA.id)),V=O.filter((IA)=>!v.has(IA.id)).length,j=[...N.filter((IA)=>IA.state!=="done"&&IA.state!=="dropped"),...N.filter((IA)=>(IA.state==="done"||IA.state==="dropped")&&v.has(IA.id))],h=AY(N),f=IY(I.view.focus),c=f?O1(N,f):null,e=I.view.focus&&!f?null:c&&j.includes(c)?c:j[0]??null,XA=j.map((IA)=>$1(IA,h));for(let IA of j){let VA=IA===e,pA=OA(i(VA?`${HK} `:" ",VA?"selected":"dim"),i(`${p3[IA.state]??"·"} `,W5[IA.state]??"text"),i(sg(IA.id,10),VA?"selected":"accent"),i(sg(IA.agent,8),"dim"),i(sg(lL(IA.state,B),8),W5[IA.state]??"text"),i(IA.title)),_A=VA?{kind:"open-focused",lane:IA.state}:{kind:"focus",lane:IA.state,id:IA.id,nth:h.get(IA)??0};L.push(QD(pA,I.view.tui?[{start:0,end:bD(pA),action:_A}]:void 0,J))}if(V>0)L.push({line:VI(OA(i(` ${NI(B.boardDoneCollapsed,{n:V})}`,"dim")),J)});return{id:"board",title:NI(B.boardHeadingCount,{n:U.total??N.length}),priority:10,lines:L,order:XA,summary:{line:VI(OA(i(` ${NI(B.boardHeadingCount,{n:U.total??N.length})}`,"heading")),J)}}}var fD=L1,tT={todo:"·",wip:"▸",review:"◆",done:"✓",blocked:"✗",dropped:"—"},O5=1,aL=4,t3=2,eT=2,HK="›",AS="▸",nL="▾",n3=3,IS="…",QS="⋮",i3="\x00page";function BS(I){return I==="done"||I==="dropped"}function e3(I,B){return lL(I,B)}function M8(I,B){return I.filter((C)=>C.state===B)}function S5(I,B,C){if((I.boardFold??[]).includes(B))return!0;if((I.boardShow??[]).includes(B))return!1;return C&&(I.boardEmptyFold??!0)}function ES(I,B,C){return`${AS} ${e3(B,I)} ${C}`}function CS(I,B,C,D,J){let{s:U}=I,N=OA(i(" "),i(J?`${HK} `:" ",J?"selected":"dim"),i(ES(U,B,C),J?"selected":"heading"),i(U.laneFolded,"dim")),X=I.view.tui?[{start:0,end:Math.max(1,D),action:{kind:"lane-fold",lane:B}}]:void 0;return{line:VI(N,D),hits:X}}function gS(I,B,C,D){let J=Math.max(1,Math.floor(D)-2),U=Math.floor((J-1)/2),N=()=>I.view.tui?[{start:0,end:n3,action:{kind:"lane-fold",lane:B}}]:void 0,X=[{line:OA(i(V1+ID+JK,"dim")),hits:N()}];for(let L=0;L<J;L++){let O=C&&L===0,T=O?HK:L===U?QS:IS;X.push({line:OA(i(s3,"dim"),i(T,O?"selected":"dim"),i(s3,"dim")),hits:N()})}return X.push({line:OA(i(a3+ID+w5,"dim")),hits:N()}),X}function AY(I){let B=new Map,C=new Map;for(let D of I){let J=B.get(D.id)??0;C.set(D,J),B.set(D.id,J+1)}return C}function $1(I,B){return{lane:I.state,id:I.id,nth:B.get(I)??0}}function O1(I,B){if(!B)return null;let C=Math.max(0,B.nth??0),D=0;for(let J of I){if(J.id!==B.id)continue;if(D===C)return J;D++}return null}function _5(I,B){return $1(B,AY(I))}function uJ(I,B){return oL(I,AY(I),B)}function oL(I,B,C){if(C){let D=O1(I,C);if(D)return $1(D,B);let J=I.find((N)=>N.id===C.id);if(J)return $1(J,B);let U=M8(I,C.lane)[0];if(U)return $1(U,B)}for(let D of fD){let J=M8(I,D)[0];if(J)return $1(J,B)}return null}function IY(I){return I&&fD.includes(I.lane)?I:null}function DS(I,B,C,D,J,U=B){let N=Math.max(1,Math.floor(D)),X=C.length,L=Math.max(0,X-N),O=I.view.laneOffset?.[U],T=O==null||Number.isNaN(O)?BS(B)?L:0:O;if(T=Math.max(0,Math.min(L,Math.floor(T))),O==null&&J&&J.state===B){let v=C.indexOf(J);if(v>=0){if(v<T)T=v;else if(v>=T+N)T=Math.min(L,v-N+1)}}return{start:T,end:Math.min(X,T+N),above:T,below:Math.max(0,X-(T+N))}}function rL(I,B,C,D){let{minimal:J}=I,U=tT[B.state]??"·",N=W5[B.state]??"text",X=D?"selected":"dim",L=D?"selected":"accent",O=D?`${HK} `:" ";if(J)return VI(OA(i(O,X),i(`${U} `,N),i(`${sg(B.id,6)} `,L),i(B.title)),C);return VI(OA(i(O,X),i(`${U} `,N),i(`${B.id} `,L),i(B.title)),C)}function sL(I,B,C){return B?{kind:"open-focused",lane:I.state}:{kind:"focus",lane:I.state,id:I.id,nth:C}}function tL(I){return{kind:"lane-scroll",lane:I,delta:0}}function GS(I,B,C,D,J,U,N,X){let{s:L}=I,O=M8(I.blocks.board?.rows??[],B);if(X){N.push({lane:B,offset:0,visible:0,count:0});let f=J!=null&&J.state===B;return gS(I,B,f,D+2)}let T=DS(I,B,O,D-t3,J);N.push({lane:B,offset:T.start,visible:T.end-T.start,count:O.length});let v=I.view.tui?[{start:0,end:C,action:tL(B)}]:void 0,V=I.view.tui?[{start:0,end:C,action:{kind:"lane-fold",lane:B}}]:void 0,j=[{line:pL(`${nL} ${e3(B,L)} ${O.length}`,C),hits:V}];if(T.above>0)j.push(mJ({line:OA(i(` ${NI(L.laneHiddenAbove,{n:T.above})}`,"dim"))},C));if(!O.length)j.push(mJ({line:OA(i(` ${L.kanbanEmptyLane}`,"dim"))},C));for(let f=T.start;f<T.end;f++){let c=O[f],e=c===J,XA=rL(I,c,Math.max(0,C-4),e),IA=I.view.tui&&!I.view.detail?[{start:0,end:Math.max(1,Math.min(C-4,bD(XA))),action:sL(c,e,U.get(c)??0)}]:void 0;j.push(mJ({line:XA,hits:IA},C))}if(T.below>0)j.push(mJ({line:OA(i(` ${NI(L.laneHiddenBelow,{n:T.below})}`,"dim"))},C));while(j.length<D+1)j.push(mJ({line:[]},C));j.push({line:r3(C)});let h=j.slice(0,D+2);if(v){for(let f of h)if(!f.hits?.length)f.hits=v}return h}function JS(I,B){let C=[],D=I.reduce((J,U)=>Math.max(J,U.length),0);for(let J=0;J<D;J++){let U=[],N=[],X=0;I.forEach((L,O)=>{let T=B[O];if(O>0)U.push(i(" ".repeat(O5))),X+=O5;let v=L[J];if(v){U.push(...uL(v.line,T));for(let V of v.hits??[])N.push({...V,start:V.start+X,end:V.end+X})}else U.push(i(" ".repeat(T)));X+=T}),C.push(N.length?{line:U,hits:N}:{line:U})}return C}function HS(I,B,C,D){let{s:J}=I,U=I.width,N=[],X={i:-1};for(let h of fD){let f=M8(B,h);if(S5(I.view,h,!f.length)){let e=C!=null&&C.state===h;if(e)X.i=N.length;N.push(CS(I,h,f.length,U,e));continue}let c=I.view.tui?[{start:0,end:U,action:{kind:"lane-fold",lane:h,scroll:i3}}]:void 0;if(N.push({line:VI(OA(i(` ${nL} ${e3(h,J)} ${f.length}`,"heading")),U),hits:c}),!f.length)N.push({line:VI(OA(i(` ${J.kanbanEmptyLane}`,"dim")),U)});for(let e of f){let XA=e===C;if(XA)X.i=N.length;let IA=rL(I,e,Math.max(0,U-2),XA),VA=I.view.tui&&!I.view.detail?[{start:1,end:1+Math.max(1,bD(IA)),action:sL(e,XA,D.get(e)??0)}]:void 0;N.push({line:VI(OA(i(" "),...IA.slice(0)),U),hits:VA})}}let L=Math.max(1,(I.laneRows??aL)+t3),O=Math.max(0,N.length-L),T=I.view.laneOffset?.[i3]??0;if(T=Math.max(0,Math.min(O,Math.floor(T)||0)),X.i>=0){if(X.i<T)T=X.i;else if(X.i>=T+L)T=Math.min(O,X.i-L+1)}let v=I.view.tui?[{start:0,end:U,action:tL(i3)}]:void 0,V=[];if(T>0)V.push({line:VI(OA(i(` ${NI(J.laneHiddenAbove,{n:T})}`,"dim")),U)});for(let h=T;h<Math.min(N.length,T+L);h++)V.push(N[h]);let j=Math.max(0,N.length-(T+L));if(j>0)V.push({line:VI(OA(i(` ${NI(J.laneHiddenBelow,{n:j})}`,"dim")),U)});if(v){for(let h of V)if(!h.hits?.length)h.hits=v}return{lines:V,lanes:[{lane:i3,offset:T,visible:Math.min(L,Math.max(0,N.length-T)),count:N.length}]}}function eL(I){let{s:B,blocks:C,deg:D}=I,J=C.board;if(!J)return null;let U=(XA)=>({id:"kanban",full:!0,priority:1,separator:"none",lines:XA,summary:{line:VI(OA(i(` ${B.boardHeadingCount}`.replace("{n}",String(J.total??0)),"heading")),I.width)}});if(D.has("board"))return U([{line:VI(OA(i(` ${B.dash}`,"dim")),I.width)}]);let N=J.rows??[];if(!N.length)return U([{line:VI(OA(i(` ${B.boardEmpty}`,"dim")),I.width)}]);let X=AY(N),L=I.view.focus&&!fD.includes(I.view.focus.lane)?null:oL(N,X,I.view.focus),O=O1(N,L);if(!I.twoColumn){let XA=HS(I,N,O,X);return{...U(XA.lines),lanes:XA.lanes}}let T=Math.max(2,Math.floor(I.laneRows??aL)+t3),v=[],V=Math.max(0,I.width-O5*(fD.length-1)),j=(XA)=>S5(I.view,XA,!M8(N,XA).length),h=fD.filter(j),f=fD.filter((XA)=>!j(XA)),c=new Map;if(!h.length){let XA=Math.max(8,Math.floor(V/fD.length));for(let IA of fD)c.set(IA,XA)}else if(!f.length)for(let XA of h)c.set(XA,n3);else{for(let IA of h)c.set(IA,n3);let XA=Math.max(8,Math.floor((V-n3*h.length)/f.length));for(let IA of f)c.set(IA,XA)}let e=fD.map((XA)=>GS(I,XA,c.get(XA)??8,T,O,X,v,h.includes(XA)));return{...U(JS(e,fD.map((XA)=>c.get(XA)??8))),lanes:v}}var US=16;function QY(I){return Math.max(1,W1(I)?I.width-4:I.width)}function MS(I,B,C,D){let J=[i(" ")],U=[],N=1;return B.forEach((X,L)=>{if(L>0)J.push(i(" ")),N+=2;let O=L===C?`[${X.tab}]`:X.tab,T=N;if(J.push(i(O,L===C?"accent":"dim")),N+=bI(O),I.view.tui)U.push({start:T,end:N,action:{kind:"detail-tab",index:L}})}),QD(J,U,D)}function j5(I){let{s:B,blocks:C,deg:D}=I,J=I.view.detail??"",U=QY(I),N=NI(B.detailTitle,{id:J}),X=(IA,VA)=>({id:"detail",full:!0,priority:1,separator:"none",title:N,lines:IA,detail:VA,summary:{line:VI(OA(i(` ${N}`,"heading")),I.width)}});if(D.has("detail"))return X([{line:VI(OA(i(` ${B.dash}`,"dim")),U)}]);let L=C.detail;if(!L)return X([{line:VI(OA(i(` ${B.detailLoading}`,"dim")),U)}],{index:0,total:0,visible:0,offset:0});let O=L.files??[];if(!O.length){let IA=L.reason?NI(B.detailUnavailable,{reason:L.reason}):B.detailNoFiles;return X([{line:VI(OA(i(` ${IA}`,"dim")),U)}])}let T=L,v=Math.max(0,Math.min(O.length-1,Math.floor(I.view.detailIndex??0)||0)),V=O[v],j=[MS(I,O,v,U)];if(L.reason)j.push({line:VI(OA(i(` ${L.reason}`,"warn")),U)});if(V.truncated)j.push({line:VI(OA(i(` ${B.detailTruncated}`,"warn")),U)});if(T.file!==V.path)return j.push({line:VI(OA(i(` ${B.detailLoading}`,"dim")),U)}),X(j,{index:v,total:0,visible:0,offset:0});let h=X5(V.path,T.text,U),f=Math.max(1,I.detailRows??US),c=Math.max(1,f-j.length),e=Math.max(0,h.length-c),XA=Math.max(0,Math.min(e,Math.floor(I.view.detailScroll??0)||0));for(let IA=XA;IA<Math.min(h.length,XA+c);IA++)j.push(h[IA]);while(j.length<f)j.push({line:[]});return X(j,{index:v,total:h.length,visible:Math.min(c,Math.max(0,h.length-XA)),offset:XA})}var KS=12,FS=16;function YS(I){return I.available?`#${I.no} ${I.title}`:""}function Az(I,B){let{s:C}=I,D=[i(" ")],J=[],U=1,N=(X,L)=>{let O=U;D.push(i(X,"accent")),U+=bI(X),J.push({start:O,end:U,action:L}),D.push(i(" ")),U+=1};return N(`‹ ${C.replyOlder}`,{kind:"reply-page",dir:-1}),N(`${C.replyNewer} ›`,{kind:"reply-page",dir:1}),N(C.keyReplyReset,{kind:"reply-reset"}),QD(D,J,B)}function Iz(I){let{s:B,blocks:C,deg:D,view:J}=I,U=QY(I),N=C.reply_list,X=Math.max(2,I.replyRows??KS),L=(c,e)=>({id:"reply_list",full:!0,priority:1,separator:"none",title:N?NI(B.replyHeadingCount,{n:N.total_slots}):B.replyHeading,lines:c,replyList:e,summary:{line:VI(OA(i(` ${B.replyHeading}`,"heading")),I.width)}}),O=[Az(I,U),{line:VI(OA(i(` ${B.replyPageNote}`,"dim")),U)}];if(!N||D.has("reply_list"))return O.push({line:VI(OA(i(` ${N?B.dash:B.replyLoading}`,"dim")),U)}),L(O,{focus:0,offset:0,visible:0,count:0});if(N.state!=="empty")O.push({line:VI(OA(i(` ${NI(B.replyTotalSlots,{n:N.total_slots})}`,"dim")),U)});if((N.warnings??[]).some((c)=>c.kind==="partial-tail"))O.push({line:VI(OA(i(` ${B.replyTailWarning}`,"warn")),U)});let T=Array.isArray(N.entries)?N.entries:[];if(!T.length)return O.push({line:VI(OA(i(` ${B.replyEmpty}`,"dim")),U)}),L(O,{focus:0,offset:0,visible:0,count:0});let v=Math.max(1,X-O.length),V=J.replyFocus??0,j=T.findIndex((c)=>c.no===V);if(j<0)j=0;let h=Math.max(0,j-v+1),f=Math.max(0,Math.min(Math.max(0,T.length-v),Math.floor(J.replyOffset??h)||0));for(let c=f;c<Math.min(T.length,f+v);c++){let e=T[c],XA=c===j,VA=` ${XA?B.settingsCursor:" "} `,pA=e.available?OA(i(VA,"accent"),i(YS(e),XA?"selected":"text"),i(` · ${e.from}`,"dim")):OA(i(VA,"accent"),i(NI(B.replySlotUnavailable,{no:e.no}),"warn"),i(`(${e.reason})`,"dim"));O.push({line:VI(pA,U),hits:I.view.tui?[{start:1,end:Math.min(U,bD(pA)+1),action:{kind:"reply-click",index:c}}]:void 0})}return L(O,{focus:T[j].no,offset:f,visible:Math.min(v,T.length-f),count:T.length})}function Qz(I){let B=I.view.replyBody;if(!B)return null;let{s:C,blocks:D,deg:J}=I,U=QY(I),N=Math.max(2,I.replyDocRows??FS),X=D.reply_body,L=(XA,IA)=>({id:"reply_viewer",full:!0,priority:1,separator:"none",title:`#${B} ${C.replyHeading}`,lines:XA,replyDoc:IA,summary:{line:VI(OA(i(` ${C.replyHeading} #${B}`,"heading")),I.width)}}),O=Az(I,U),T=OA(i(` ${C.replyBack}`,"accent"),i(` · ${C.keyDetailClose}`,"dim")),v={line:VI(T,U),hits:I.view.tui?[{start:1,end:1+bI(C.replyBack)+2,action:{kind:"reply-close"}}]:void 0};if(!X||X.no!==B){let IA=I.view.replyBodyFailed===!0||J.has("reply_body")?i(` ${C.replyBodyMissing}`,"warn"):i(` ${C.replyLoading}`,"dim");return L([O,{line:VI(OA(IA),U)},v],{no:B,total:0,visible:0,offset:0})}if(X.available===!1)return L([O,{line:VI(OA(i(` ${C.replyBodyMissing}`,"warn")),U)},v],{no:B,total:0,visible:0,offset:0});let V=[{line:VI(OA(i(` ${X.title}`,"heading")),U)},{line:VI(OA(i(` ${NI(C.replyDeclared,{from:X.from,at:X.at})}`,"dim")),U)},{line:VI(OA(i(` ${C.replyBodyHint} · ${X.bytes} B`,"dim")),U)}],j=X5(`reply:${B}`,X.display_text??"",U),h=Math.max(1,N-NS(V)),f=Math.max(0,j.length-h),c=Math.max(0,Math.min(f,Math.floor(I.view.replyScroll??0)||0)),e=[O,...V];for(let XA=c;XA<Math.min(j.length,c+h);XA++)e.push(j[XA]);return e.push(v),L(e,{no:B,total:j.length,visible:Math.min(h,Math.max(0,j.length-c)),offset:c})}function NS(I){return I.length+2}function ZS(I){if(!I.view.tui)return null;let{s:B,blocks:C,deg:D,width:J}=I,U=C.reply_summary,N=` ${B.replyLatest} `,X=[i(N,"heading")],L=[],O=bI(N);L.push({start:1,end:O,action:{kind:"page",page:5}});let T=U&&U.available&&U.state==="ok"?U.entry:void 0;if(!U||D.has("reply_summary"))X.push(i(B.dash,"dim"));else if(T&&T.available){let V=`#${T.no} ${T.title} · ${T.from}`;X.push(i(V,"text")),L.push({start:O,end:O+bI(V),action:{kind:"reply-open-latest",no:T.no}}),O+=bI(V);let j=` · ${T.at}`;X.push(i(j,"dim")),O+=bI(j)}else if(U.state==="empty")X.push(i(B.replyEmpty,"dim"));else{X.push(i(B.replyUnavailable,"warn"));let V=U.reason?`(${U.reason})`:"";if(V)X.push(i(V,"dim"))}let v=" [5] ";return L.push({start:O+1,end:O+1+bI(v),action:{kind:"page",page:5}}),X.push(i(v,"accent")),{id:"reply_summary",title:B.replyLatest,priority:9,lines:[QD(X,L,J)],summary:{line:VI(OA(i(` ${B.replyLatest}`,"heading")),J)}}}var UK=22,XS=2,qS=2,Bz=2,RS=Bz+6;function LS(I,B){if(B==="restart")return I.settingsBadgeRestart;if(B==="refuse")return I.settingsBadgeRefuse;return I.settingsBadgeApply}var zS="fixture-only: ";function VS(I){return String(I.route??"").startsWith(zS)}function $S(I){if(I==="restart")return"warn";if(I==="refuse")return"dim";return"text"}function wS(I,B){let C=I[`group_${B}`];return typeof C==="string"&&C.length>0?C:B}function vL(I,B){if(B==="explicit")return I.seatSourceExplicit;if(B==="policy")return I.seatSourcePolicy;if(B==="assignment")return I.seatSourceAssignment;if(B==="record")return I.seatSourceRecord;return B||I.dash}function v5(I,B,C){let D=[];if(!I||!Array.isArray(I.keys))return D;let J=String(B??"").trim().toLowerCase(),U=(...j)=>J===""||j.some((h)=>String(h??"").toLowerCase().includes(J)),N=I.keys.filter((j)=>!VS(j)&&U(l3(C,j.name),j.name,j.value,j.default,j.comment,j.warning,j.route??"")),X=[],L=null;for(let j of N){let h=String(j.group??"");if(!h){X.push(j);continue}if(h!==L)D.push({kind:"group",label:wS(C,h),tone:"heading"}),L=h;D.push({kind:"key",key:j})}if(X.length){D.push({kind:"group",label:C.settingsGroupUngrouped,tone:"heading"});for(let j of X)D.push({kind:"key",key:j})}let O=(I.models?.policy?.categories??[]).filter((j)=>U(NI(C.settingsCategoryRow,{category:j.category}),j.category,j.model));if(O.length){D.push({kind:"group",label:C.settingsGroupCategories,tone:"heading"});for(let j of O)D.push({kind:"category",category:j})}let T=(I.models?.assignments??[]).filter((j)=>U(j.agent,j.task,j.category,j.model,j.sid,j.selected_via,j.launch_via)),v=I.models?.pm_launch??{},V=Object.keys(v).length>0&&U(C.settingsPmLaunchLabel,String(v.model??""),String(v.mode??""),String(v.window??""));if(T.length||V){D.push({kind:"group",label:C.settingsGroupAssignments,tone:"heading"});for(let j of T)D.push({kind:"assignment",assignment:j});if(V)D.push({kind:"pm-launch",launch:v})}return D}function w1(I){return I.kind!=="group"}function BY(I,B,C,D,J){let U=J8(B,Math.max(6,J-UK-14));return C===""?OA(i(` ${U}`,D)):OA(i(` ${U} · `,"text"),i(C,D))}function WS(I,B,C,D){let{s:J}=I,U=B.known!==!1,N=B.set||B.value!==""?B.value===""?'""':B.value:NI(J.settingsUnset,{value:B.default||J.dash}),X=U?LS(J,B.class):J.settingsUnknownBadge,L=U?$S(B.class):"dim",O=OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(l3(J,B.name),UK),C?"selected":U?"heading":"dim"),...BY(I,N,X,L,D).map((v)=>v)),T=(B.warning||B.route||B.comment||"").trim();if(T)O.push(i(` ${J8(T,Math.max(8,D-bI(R0(O))-2))}`,B.warning?"warn":B.route&&!U?"warn":"dim"));return{line:O}}function yL(I,B){let C=0,D="";for(let J of String(I)){let U=G8(J);if(C+U>B)break;C+=U,D+=J}return D}function OS(I,B,C){let D=[],J=I;while(J!==""&&D.length<C){if(bI(J)<=B){D.push(J),J="";break}let U=yL(J,B);if(U==="")break;if(J.slice(U.length,U.length+1)!==""&&J.slice(U.length,U.length+1)!==" "){let N=U.lastIndexOf(" ");if(N>0)U=U.slice(0,N+1)}D.push(U),J=J.slice(U.length)}if(J!==""){let U=D[D.length-1]??"";D[D.length-1]=yL(U,Math.max(1,B-1))+"…"}return D}function jS(I,B,C,D){let{s:J}=I;return{line:OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(NI(J.settingsCategoryRow,{category:B.category}),UK),C?"selected":"heading"),...BY(I,B.model||J.dash,J.settingsCategoryBadge,"text",D).map((N)=>N))}}function PS(I,B,C,D){let{s:J}=I,U=OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(B.agent,UK),C?"selected":"heading"),...BY(I,B.assigned?B.model||J.dash:J.dash,J.settingsReadOnlyBadge,"dim",D).map((X)=>X)),N=B.assigned?NI(J.settingsAssignmentNote,{task:B.task||J.dash,category:B.category||J.dash,sid:B.sid||J.dash,selected:vL(J,B.selected_via),launch:vL(J,B.launch_via)}):B.record_present===!1?J.settingsAssignmentNone:J.settingsAssignmentUnreadable;return U.push(i(` ${J8(N,Math.max(8,D-bI(R0(U))-2))}`,B.assigned?"dim":"warn")),{line:U}}function TS(I,B,C,D){let{s:J}=I,U=OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(J.settingsPmLaunchLabel,UK),C?"selected":"heading"),...BY(I,B.model||J.dash,J.settingsReadOnlyBadge,"dim",D).map((X)=>X)),N=NI(J.settingsPmLaunchNote,{window:B.window||J.dash,mode:B.mode||J.dash,time:B.time||J.dash});return U.push(i(` ${J8(N,Math.max(8,D-bI(R0(U))-2))}`,"dim")),{line:U}}function SS(I,B,C){let J=B.filter(w1)[C];if(!J)return"";if(J.kind==="category")return NI(I.settingsCategoryHint,{category:J.category.category});if(J.kind==="assignment")return I.settingsAssignmentHint;if(J.kind==="pm-launch")return I.settingsPmLaunchHint;let U=J.key;if(U.known===!1)return NI(I.settingsUnknownHint,{key:U.name});if(U.class==="refuse")return I.settingsRefusedHint;if(String(U.kind??"")==="task-model-map")return I.settingsCategoryMapHint;return NI(I.settingsCliHint,{key:U.name})}function Ez(I){let{s:B,blocks:C,deg:D}=I,J=QY(I),U=(QA,yA)=>({id:"settings",full:!0,priority:1,separator:"none",title:B.settingsViewTitle,lines:QA,settings:yA,summary:{line:VI(OA(i(` ${B.settingsViewTitle}`,"heading")),I.width)}}),N=C.settings;if(D.has("settings")||!N||!Array.isArray(N.keys)||!N.keys.length)return U([QD(VI(OA(i(` ${B.settingsViewTitle}`,"heading"),i(" "),i(B.dash,"dim")),J),void 0,J)]);let X=v5(N,I.view.settingsFilter??"",B),L=0;for(let QA of X)if(w1(QA))L+=1;let O=Math.max(3,I.settingsRows??12),T=Math.max(0,Math.min(Math.max(0,L-1),I.view.settingsFocus??0)),v=I.view.settingsOffset,V=String(N.models?.diagnostic??"").split(`
351
+ `),J=[],U=(X)=>{for(let L of X)J.push({line:wL(L,C)})},N=0;while(N<D.length){let X=D[N],L=/^\s{0,3}(```|~~~)/.exec(X);if(L){let V=L[1],j=new RegExp(`^\\s{0,3}${V}\\s*$`);N++;while(N<D.length&&!j.test(D[N]))J.push({line:[{text:D[N],tone:"dim"}]}),N++;if(N<D.length)N++;continue}if(!X.trim()){J.push({line:[]}),N++;continue}if(X.includes("|")&&N+1<D.length&&XT(D[N+1])){let V=[X,D[N+1]];N+=2;while(N<D.length&&D[N].trim()&&D[N].includes("|"))V.push(D[N]),N++;U(RT(V,C));continue}let O=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(X);if(O){U(c3([{text:O[2],tone:"heading"}],C)),N++;continue}if(/^\s{0,3}([-*_])(\s*\1){2,}\s*$/.test(X)){J.push({line:[{text:"─".repeat(C),tone:"dim"}]}),N++;continue}let T=/^\s{0,3}>\s?(.*)$/.exec(X);if(T){U(c3(Y5(N5(T[1])),C,"│ ","│ ")),N++;continue}let v=/^(\s*)([-*+]|\d+[.)])\s+(.*)$/.exec(X);if(v){let V=" ".repeat(Math.min(8,v[1].length)),j=/^[-*+]$/.test(v[2])?"•":v[2],h=`${V}${j} `;U(c3(Y5(N5(v[3])),C,h," ".repeat(bI(h)))),N++;continue}U(c3(Y5(N5(X)),C)),N++}return J}function zT(I){let B=2166136261,C=I.slice(0,4096);for(let D=0;D<C.length;D++)B^=C.charCodeAt(D),B=Math.imul(B,16777619);return`${C.length}:${I.length}:${B>>>0}`}var GK=new Map;function X5(I,B,C){let D=`${I}\x00${C}\x00${zT(B)}`,J=GK.get(D);if(J)return J;let U=LT(B,C);if(GK.set(D,U),GK.size>6){let N=GK.keys().next().value;if(N!==void 0)GK.delete(N)}return U}var q5={appTitle:"teamsmith pulse",patrolLabel:"patrol",patrolSeconds:"patrol {n}s",standbyLabel:"standby",standbyOn:"standby on (reason: {reason})",standbyOff:"standby off",standbyDash:"standby —",pmLabel:"PM",pmDeliveryWarning:"delivery degraded: {reason}",pendingLabel:"pending",pendingNone:"none",outboxLabel:"deferred",outboxHeldSuffix:" (held {n})",outboxImpededSuffix:" · impeded {n}",capacityLabel:"capacity",capacityRam:"RAM {mb}",capacitySwap:"swap {mb}",capacityAgents:"{n} more agents fit",capacityDisk:"{path} {mb} (inode {ino})",dash:"—",progressLabel:"progress",progressTasks:"tasks {parts}",taskTodo:"todo",taskWip:"wip",taskReview:"review",taskBlocked:"blocked",taskDone:"done",taskDropped:"dropped",progressChanges:"changes {n}",progressSpecs:"specs {specs} · {reqs} requirements",progressDecisions:"decisions {n}",countPair:"{label} {n}",deliveriesLabel:"recent deliveries",deliveryLine:"{id} · {agent} · {time}",deliveriesEmpty:"(no deliveries yet)",agentsHeader:"agent",tableState:"state",tableTask:"task",tableBranch:"branch",tableSession:"session",agentRunning:"running",agentExited:"exited",agentAbsent:"no window",pmRunning:"running",pmStarting:"starting",pmAbsent:"not running",pmForeign:"another project holds it",pmUnknown:"not a PM process",agentEmpty:"(no agents)",activityHeading:"activity (windows running in this session)",activitySource:"source {path}",activityEmpty:"(no session activity)",recentHeading:"recent actions",recentEmpty:"(no actions recorded yet)",pageOverview:"overview",pageWork:"work",pageMessages:"messages & logs",pageBoard:"board",pageReplies:"key replies",pageOverviewShort:"overview",pageWorkShort:"work",pageMessagesShort:"msgs",pageBoardShort:"board",pageRepliesShort:"replies",pageTab:" {name} ",pageTabActive:"▸{name}◂",boardHeading:"board",boardHeadingCount:"board ({n})",boardCounts:"{todo} todo · {wip} wip · {review} review · {blocked} blocked · {done} done",boardDoneCollapsed:"… {n} older done/dropped rows folded",boardEmpty:"(board is empty)",kanbanEmptyLane:"·",laneFolded:" (folded)",laneHiddenAbove:"↑{n}",laneHiddenBelow:"↓{n}",detailTitle:"detail {id}",detailNoFiles:"(no associated files for this entry)",detailUnavailable:"(source unavailable: {reason})",detailTruncated:"… truncated (first 128 KiB shown)",detailLoading:"… loading",changesHeading:"active changes",changesHeadingCount:"active changes ({n})",changeLine:"{done}/{total} · {phase}",changePhaseExplore:"explore",changePhasePropose:"propose",changePhaseApply:"apply",changePhaseVerify:"verify",changePhaseArchive:"archive",specsHeading:"specs",specsCount:"{specs} specs · {reqs} requirements",specsLine:"{name} {n}",decisionsHeading:"recent decisions",decisionsCountSuffix:"{n} total",decisionsEmpty:"(no decisions recorded)",queueHeading:"deferred queue",queueHeadingCount:"deferred queue {queued} (held {held})",queueLine:"{index}. [{state}] {name} · {age}",queueStateQueued:"queued",queueStateHeld:"held",queueHeldReason:"held reason: {reason}",queueViewHint:"Enter to view the full text",queueImpededLine:"delivery impeded {n}: {reasons}",queueImpededItem:" {entry} → {reason} ({when})",queueImpededUnavailable:" (diagnostics unavailable; read HOLDING.log)",queueBackHint:"Esc back to the list",queueEmpty:"(queue is empty)",queueFullHeading:"full text: {name}",queueMeta:"kind={kind} target={target} from={from}",inboxHeading:"inbox and threads",inboxLine:"inbox {inbox} · thread {thread} · {age}",inboxEmpty:"(no inbox/thread files)",patrolHeading:"patrol log",patrolEmpty:"(no patrol records yet)",trendHeading:"capacity trend",trendLine:"RAM {mb} · swap {swap}",healthHeading:"health",healthLine:"skill {version} · doctor {doctor} · last gates {gates}",healthDoctorOk:"ok",healthDoctorWarn:"warn",healthDoctorFail:"fail",healthDoctorNA:"unavailable",settingsTitle:"settings",settingsCursor:"›",prefLang:"language",prefDefaultPage:"default page",prefActivity:"activity column",prefMouse:"mouse",prefDensity:"density",toggleOn:"on",toggleOff:"off",langNameZh:"中文",langNameEn:"English",densityComfortable:"comfortable",densityCompact:"compact",settingsHint:"↑/↓ select · Enter toggle · Esc/, close",prefProjectSettings:"Project settings",prefNavArrow:"›",settingsViewTitle:"Project settings",group_identity:"Identity & ledger layout",group_branch:"Branch & forge",group_policy:"Permissions & dependencies",group_roster:"Roster, models & adapters","group_task-model":"Task categories & PM model",group_workflow:"Workflow & gates",group_delivery:"Capacity & delivery",group_panel:"Pulse & panel",group_patrol:"Patrol","group_pm-lifecycle":"PM lifecycle",group_session:"Live sessions",group_meeting:"Cross-project meetings",settingsGroupUngrouped:"Ungrouped",settingsGroupCategories:"The model the next task will use",settingsGroupAssignments:"The model running tasks actually use",settingsBadgeApply:"apply",settingsBadgeRestart:"restart",settingsBadgeRefuse:"change in file",settingsUnknownBadge:"not recognized",settingsUnset:"unset · default {value}",settingsKeyHint:"↑/↓ rows · Enter edit · / filter · Esc back",keyFilter:"/ filter",settingFilterTitle:"Filter settings",settingConfirm:"Confirm: {key} {old} → {next} · {timing} (Enter again to write)",settingTimingApply:"the next process that reads it",settingTimingRestart:"needs a restart",settingDanger:"Danger: {reason} (press Enter once more to confirm)",settingRejected:"✗ refused: {line}",settingWritten:"✓ wrote {key} = {value} · {timing}",settingRefused:"✗ this value is changed in the project config file: {line}",settingInvalid:"✗ invalid value: {line}",settingConflict:"! the contract changed under the editor (fingerprint mismatch) — nothing written; reloaded",settingWriteError:"✗ write failed (file unchanged): {line}",settingsRefusedRoute:"change this value in the project config file .pi/team/config.sh; the panel cannot change it",settingsCategoryHint:"category {category}: team config set-task-model {category} <model> — new tasks only; a task already dispatched keeps the model it was given (this row never composes the map)",settingsCategoryRow:"category {category}",settingsCategoryModel:"model {model}",settingsCategoryBadge:"new tasks",settingsCategoryPickerTitle:"Pick the model for category {category}",settingsCategoryPickerHint:"↑/↓ choose · Enter writes that value now · only free text opens the editor · Esc back (new tasks only; a task already dispatched keeps the model it was given and no process is restarted)",settingsCategoryMapHint:"the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the pair list is never composed in the console",settingsCategoryMapEmpty:"the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the map is empty today; add a category through the CLI first",settingsAssignmentHint:"once a task is dispatched it keeps the model it was given; this setting does not change it",settingsAssignmentNote:"task {task} · category {category} · session {sid} · origin {selected}/{launch}",settingsAssignmentNone:"this seat has not been given a task yet",settingsAssignmentUnreadable:"this seat was given a task, but its record could not be read, so the panel does not show its model",settingsReadOnlyBadge:"change in file",settingsPmLaunchLabel:"last PM start",settingsPmLaunchNote:"window {window} · {mode} · {time}",settingsPmLaunchHint:"the model the PM used the last time it started; it cannot be changed here",settingsDiagnosisHeading:"these settings need an upgrade",settingsCliHint:"CLI: team config set {key} <value>",settingsRefusedHint:"change this value in the project config file .pi/team/config.sh; the panel cannot change it",settingsUnknownHint:"{key}: the file carries this setting but the tool does not know it; the panel cannot change it",settingsChoiceTitle:"Choose a value for {label} · {key}",settingsChoiceHint:"↑/↓ choose · Enter writes that value now (danger needs one more) · only free text opens the editor · Esc back",settingsChoiceCurrent:"current",settingsChoiceDefault:"default",settingsChoiceKeepUnset:"keep unset (cancel, nothing written)",settingsChoiceClear:"clear (write the empty value)",settingsChoiceFree:"… (free text)",settingsChoiceInterval:"accepted interval {min}–{max} (empty = unbounded)",settingsChoiceNoChoice:"the kind {kind} has no choice set; the command still validates the write (Enter opens free text)",settingCategoryConfirm:"Confirm category {category}: {old} → {next} · new tasks only; a task already dispatched keeps the model it was given (Enter again to write)",settingCategoryWritten:"✓ wrote category {category} = {value} · new tasks only; tasks already dispatched keep the model they were given; no process was restarted",settingPmWritten:"✓ wrote the PM model = {value} · changing the model needs team up --fresh-pm, which starts a new conversation; no process was restarted",settingsBoolOn:"on (1)",settingsBoolOff:"off (0)",settingsPathExists:"exists",settingsPathMissing:"missing",settingsPathNotExec:"not executable",keyCategoryPick:"Enter edit",seatSourceExplicit:"chosen at dispatch",seatSourcePolicy:"set by category",seatSourceAssignment:"kept from the record",label_TEAM_PROJECT:"Project name",label_TEAM_SESSION:"Session name",label_TEAM_PM_WINDOW:"PM window",label_TEAM_AGENTS:"Roster",label_TEAM_DOCS_DIR:"Ledger dir",label_TEAM_WORKTREES_DIR:"Worktree dir",label_TEAM_STATE_DIR:"State dir",label_TEAM_MEETINGS_DIR:"Meeting dir",label_TEAM_SPEC_DIR:"Spec dir",label_TEAM_ROOT:"Project root",label_TEAM_MAIN_ROOT:"Main checkout root",label_TEAM_TMP_ROOT:"Temp root",label_TEAM_CONFIG_FILE:"Contract file",label_TEAM_BRANCH_MODE:"Branch naming mode",label_TEAM_TASK_BRANCH_PREFIX:"Task branch prefix",label_TEAM_AGENT_BRANCH_PREFIX:"Seat branch prefix",label_TEAM_PROTECTED_BRANCH:"Protected branch",label_TEAM_REMOTE:"Remote",label_TEAM_VCS:"Forge",label_TEAM_TOKEN_FILE:"Token file",label_TEAM_GITLAB_HOST:"GitLab host",label_TEAM_GITLAB_PROJECT:"GitLab project",label_TEAM_GITLAB_TOKEN_FILE:"GitLab token file",label_TEAM_MERGE_PREFER_THEIRS:"Prefer branch side",label_TEAM_CONFIRM_WRITES:"Confirm writes",label_TEAM_ALLOW_FOREIGN_IDENTITY:"Allow foreign ID",label_TEAM_ALLOW_FOREIGN_SESSION:"Allow foreign window",label_TEAM_GUARD_FOREIGN_TARGET:"Guard foreign targets",label_TEAM_REPLACE_FOREIGN_PM:"Replace foreign PM",label_TEAM_ALLOW_DESTRUCTIVE_TMUX:"Allow destructive ops",label_TEAM_ASSUME_YES:"Assume yes",label_TEAM_REQUIRE_JS:"Require JS runtime",label_TEAM_REQUIRE_OPENSPEC:"Require OpenSpec",label_TEAM_REQUIRE_MAGIC_CONTEXT:"Require Magic Context",label_TEAM_PI_AGENT_DIR:"Pi agent dir",label_TEAM_PI_SETTINGS_FILE:"Pi settings file",label_TEAM_MEMINFO_FILE:"meminfo file",label_TEAM_DISK_STATS_FILE:"Disk stats fixture",label_TEAM_SMOKE_FAST:"Smoke fast mode",label_TEAM_MODEL_LIMITS:"Concurrency limits",label_TEAM_MODEL_WINDOWS:"Context windows",label_TEAM_SESSION_WARN_TOKENS:"Context warn tokens",label_TEAM_EXTRA_PI_ARGS:"Seat extra args",label_TEAM_AGENT_CMD:"Seat launch command",label_TEAM_AGENT_NOTIFY_CMD:"Turn-end notify cmd",label_TEAM_AGENT_LOG_GLOB:"Seat log glob",label_TEAM_PI_BIN:"pi binary",label_TEAM_AGENT_BIN:"Seat binary",label_TEAM_OPENSPEC_BIN:"openspec binary",label_TEAM_JS_BIN:"JS runtime",label_TEAM_TASK_MODELS:"Task category models",label_TEAM_PM_MODEL:"PM model",label_TEAM_CONFIG_VERSION:"Config shape version",label_TEAM_UPDATE_CHECK:"Startup version notice",label_TEAM_GATES:"Gate commands",label_TEAM_INSTALL_CMD:"Install command",label_TEAM_TASK_BRANCH_RESET:"Reset task branch",label_TEAM_DISPATCH_VERIFY_SEC:"Dispatch check wait",label_TEAM_DISPATCH_ALIVE_SEC:"Alive check wait",label_TEAM_SQUASH_LOOKBACK:"Squash look-back",label_TEAM_REVIEW_TIMEOUT:"Review timeout",label_TEAM_REVIEW_TIMEOUT_GRACE:"Timeout grace",label_TEAM_REVIEW_ALLOW_DIRTY:"Allow dirty checkout",label_TEAM_REVIEW_ALLOW_IGNORED:"Allow ignored files",label_TEAM_REVIEW_ALLOW_UNRESOLVED_BRANCH:"Allow unresolved tip",label_TEAM_REVIEW_ANY_DIR:"Skip checkout guard",label_TEAM_BOARD_DONE_FORCE:"Force board done",label_TEAM_BOARD_DONE_REASON:"Force-done reason",label_TEAM_MIN_FREE_SWAP_MB:"Free swap floor",label_TEAM_MIN_TOTAL_MB:"RAM+swap floor",label_TEAM_MIN_AVAIL_MB:"Free memory floor",label_TEAM_TMP_MIN_FREE_MB:"Temp root space floor",label_TEAM_TMP_MIN_FREE_INODES:"Temp root inode floor",label_TEAM_WARN_AVAIL_MB:"Memory warn line",label_TEAM_ZRAM_WARN_PCT:"zram warn percent",label_TEAM_AGENT_MEM_MB:"Seat memory cap",label_TEAM_NOTIFY_TMUX:"tmux delivery",label_TEAM_NOTIFY_DEDUP_SEC:"Notify dedup window",label_TEAM_INBOX_MAX_CHARS:"Preview chars",label_TEAM_NOTIFY_LOG:"Notify debug log",label_TEAM_NOTIFY_DETAIL_MAX:"Notify detail bound",label_TEAM_DEFER_TTL:"Queued delivery TTL",label_TEAM_OUTBOX_MAX:"Outbox cap",label_TEAM_PANEL_DETAIL_CAP:"Detail read cap",label_TEAM_ORPHAN_WARN_MB:"Orphan memory hint",label_TEAM_ORPHAN_SCAN:"Scan orphan seats",label_TEAM_ORPHAN_PROC_ROOT:"Census proc root",label_TEAM_PULSE_INTERVAL:"Patrol interval",label_TEAM_MONITOR_REFRESH:"Panel refresh period",label_TEAM_MONITOR_EVENTS:"Initial event rows",label_TEAM_MONITOR_UI:"Panel renderer",label_TEAM_MONITOR_ACTIVITY:"Activity column",label_TEAM_AGENT_LOG_TAIL_BYTES:"Log tail read cap",label_TEAM_PULSE_WINDOW:"Pulse window name",label_TEAM_PULSE_NUDGE_GAP:"Nudge gap",label_TEAM_PULSE_PENDING_BOARD:"Wake on board to-do",label_TEAM_PULSE_REBUILD_TMUX:"Rebuild tmux server",label_TEAM_PULSE_MAX_RESTARTS:"Max auto-restarts",label_TEAM_PM_SESSION_ID:"PM session id",label_TEAM_PM_CMD:"PM launch command",label_TEAM_PM_BIN:"PM binary",label_TEAM_PM_EXTRA_PI_ARGS:"PM extra args",label_TEAM_PM_RESUME_ARGS:"PM resume args",label_TEAM_PM_START_WAIT:"PM start wait",label_TEAM_INBOX_WATCH_MAX_BYTES:"Watcher read cap",label_TEAM_INBOX_WATCH_PREVIEW:"Preview lines",label_TEAM_INBOX_WATCH_REPLAY_MAX:"Replay cap",label_TEAM_INBOX_WATCH_SEEN_MAX:"Seen-record cap",label_TEAM_INBOX_WATCH_STALE:"Stale threshold",label_TEAM_INBOX_WATCH_STALE_SEC:"Wake freshness (s)",label_TEAM_INBOX_WATCH_FORCE_FAIL:"Force watch failure",label_TEAM_IW_REQUIRE_WATCH:"Strict gate mode",label_TEAM_INBOX_WATCH_POLL_MS:"Poll interval",label_TEAM_INBOX_WATCH_HEARTBEAT_MS:"Heartbeat interval",label_TEAM_INBOX_WATCH_TARGET:"Delivery target",label_TEAM_BG_LOG_MAX_BYTES:"Background log cap",label_TEAM_SIGNAL_CALLS_LOG:"Signal call log",label_TEAM_SIGNAL_REAL:"Real signal tool",label_TEAM_BG_STOP_GRACE:"Job stop grace",label_TEAM_MEETING_TTL_HOURS:"Meeting TTL",label_TEAM_MEETING_MAX_TURNS:"Meeting turn cap",label_TEAM_MEETING_KNOCK:"Allow knocking",label_TEAM_MEETING_ALLOW_USER_ID:"Users who may knock",replyHeading:"key replies",replyHeadingCount:"key replies ({n})",replyLatest:"latest key reply",replyEmpty:"(no key replies yet)",replyUnavailable:"(unavailable)",replyLatestUnavailable:"latest reply unavailable: {reason}",replyDeclared:"from {from} · {at}",replyDeclaredShort:"from {from}",replySlotUnavailable:"#{no} unavailable",replyLoading:"… loading",replyBodyMissing:"this reply is unavailable",replyBodyHint:"read-only · shown as published",replyOlder:"Older",replyNewer:"Newer",replyBack:"Back",replyScrollHint:"↑/↓ PgUp/PgDn Home/End scroll",replyTotalSlots:"{n} numbered slots",replyTailWarning:"the index tail is incomplete (the last append did not finish)",replyPageNote:'"who is this reply written for?" — replies the PM wrote for the user',keyCompose:"m compose",keyFlush:"f flush",keyStandby:"s standby",keySettings:", settings",keyPages:"Tab/1-5 pages",keyReplies:"←/→ older/newer",keyReplyReset:"r newest",keyScroll:"↑/↓ scroll",keyLanes:"←/→ lanes",keyCards:"↑/↓ cards",keyFold:"c fold",keyRows:"↑/↓ rows",keyOpen:"Enter open",keyDetailClose:"Esc/q back",keyDetailTabs:"←/→ file",keyDetailScroll:"↑/↓ scroll",keyQuit:"q collapse",composeHint:"Enter send · C-j newline · Esc cancel (draft kept) · C-o editor",composeHiddenAbove:"↑{n} rows",composeReasonHint:"Enter standby · C-j newline (as a space) · Esc cancel",composeTitle:"Message",composeStandbyTitle:"Standby reason",receiptDelivered:"✓ delivered to the PM · delivered",receiptQueued:"… queued (the PM is typing) · queued",receiptHeld:"! held (copy under state/outbox/held/) · held",receiptError:"✗ delivery unconfirmed · {detail}",draftNotCleared:"✗ settled, but the draft file could not be emptied: {file} (the text stays in the input line)",flushOk:"✓ flush · {detail}",flushFail:"✗ flush failed · {detail}",standbyOkOn:"✓ standby on (reason: {reason})",standbyOkOff:"✓ standby off",standbyFail:"✗ standby failed · {detail}",busySend:"sending…",busyAction:"working…",editorClosed:"editor closed: draft {n} chars",noTeamCli:"teamsmith CLI not found",sendUnconfirmed:"delivery unconfirmed (no result token)",queuePending:"the queue still holds entries"};var R5={appTitle:"teamsmith pulse",patrolLabel:"巡检",patrolSeconds:"巡检 {n}s",standbyLabel:"待命",standbyOn:"待命 on(原因:{reason})",standbyOff:"待命 off",standbyDash:"待命 —",pmLabel:"PM",pmDeliveryWarning:"投递降级:{reason}",pendingLabel:"待办",pendingNone:"无",outboxLabel:"延后投递",outboxHeldSuffix:"(扣住 {n})",outboxImpededSuffix:"· 阻碍 {n}",capacityLabel:"容量",capacityRam:"RAM {mb}",capacitySwap:"swap {mb}",capacityAgents:"可再加 {n} 个 agent",capacityDisk:"{path} {mb}(inode {ino})",dash:"—",progressLabel:"项目进度",progressTasks:"任务 {parts}",taskTodo:"待办",taskWip:"进行",taskReview:"待复验",taskBlocked:"阻塞",taskDone:"完成",taskDropped:"已放弃",progressChanges:"变更 {n}",progressSpecs:"规格 {specs} 项 · {reqs} 条需求",progressDecisions:"决策 {n}",countPair:"{label} {n}",deliveriesLabel:"最近交付",deliveryLine:"{id} · {agent} · {time}",deliveriesEmpty:"(还没有交付记录)",agentsHeader:"代理",tableState:"状态",tableTask:"任务",tableBranch:"分支",tableSession:"会话",agentRunning:"在跑",agentExited:"已退出",agentAbsent:"无窗口",pmRunning:"在运行",pmStarting:"正在启动",pmAbsent:"未在跑",pmForeign:"别的项目占着",pmUnknown:"非 PM 进程",agentEmpty:"(没有 agent)",activityHeading:"活动(仅本 session 在跑的窗口)",activitySource:"源 {path}",activityEmpty:"(没有会话活动)",recentHeading:"最近动作",recentEmpty:"(还没有动作记录)",pageOverview:"总览",pageWork:"工作",pageMessages:"消息与日志",pageBoard:"看板",pageReplies:"关键回复",pageOverviewShort:"总览",pageWorkShort:"工作",pageMessagesShort:"消息",pageBoardShort:"看板",pageRepliesShort:"回复",pageTab:" {name} ",pageTabActive:"▸{name}◂",boardHeading:"任务看板",boardHeadingCount:"任务看板 ({n})",boardCounts:"{todo} 待办 · {wip} 进行 · {review} 待复验 · {blocked} 阻塞 · {done} 完成",boardDoneCollapsed:"… 其余 {n} 条 done/dropped 收起",boardEmpty:"(看板为空)",kanbanEmptyLane:"·",laneFolded:"(已折叠)",laneHiddenAbove:"↑{n}",laneHiddenBelow:"↓{n}",detailTitle:"详情 {id}",detailNoFiles:"(这个入口没有关联文件)",detailUnavailable:"(来源不可用:{reason})",detailTruncated:"… 已截断(只显示前 128 KiB)",detailLoading:"… 读取中",changesHeading:"活动变更",changesHeadingCount:"活动变更 ({n})",changeLine:"{done}/{total} · {phase}",changePhaseExplore:"探索",changePhasePropose:"提案",changePhaseApply:"实施",changePhaseVerify:"验证",changePhaseArchive:"归档",specsHeading:"规格",specsCount:"{specs} 项 · {reqs} 条需求",specsLine:"{name} {n}",decisionsHeading:"最近决策",decisionsCountSuffix:"共 {n} 条",decisionsEmpty:"(没有决策记录)",queueHeading:"延后队列",queueHeadingCount:"延后队列 {queued}(扣住 {held})",queueLine:"{index}. [{state}] {name} · {age}",queueStateQueued:"排队",queueStateHeld:"滞留",queueHeldReason:"扣住原因:{reason}",queueViewHint:"Enter 看全文",queueImpededLine:"投递阻碍 {n}:{reasons}",queueImpededItem:" {entry} → {reason}({when})",queueImpededUnavailable:"(诊断不可读:原因以 HOLDING.log 为准)",queueBackHint:"Esc 返回列表",queueEmpty:"(队列为空)",queueFullHeading:"条目全文:{name}",queueMeta:"kind={kind} target={target} from={from}",inboxHeading:"收件箱与往来",inboxLine:"收件箱 {inbox} 条 · 往来 {thread} 条 · {age}",inboxEmpty:"(没有收件箱/往来记录)",patrolHeading:"巡检日志",patrolEmpty:"(还没有巡检记录)",trendHeading:"容量趋势",trendLine:"RAM {mb} · swap {swap}",healthHeading:"健康",healthLine:"技能 {version} · doctor {doctor} · 上次门禁 {gates}",healthDoctorOk:"ok",healthDoctorWarn:"warn",healthDoctorFail:"fail",healthDoctorNA:"不可用",settingsTitle:"设置",settingsCursor:"›",prefLang:"语言",prefDefaultPage:"默认页面",prefActivity:"活动列",prefMouse:"鼠标",prefDensity:"密度",toggleOn:"开",toggleOff:"关",langNameZh:"中文",langNameEn:"English",densityComfortable:"舒适",densityCompact:"紧凑",settingsHint:"↑/↓ 选择 · Enter 切换 · Esc/, 关闭",prefProjectSettings:"项目设置",prefNavArrow:"›",settingsViewTitle:"项目设置",group_identity:"身份与账本布局",group_branch:"分支与 forge",group_policy:"权限与依赖",group_roster:"名册、模型解析与适配器","group_task-model":"任务类别与 PM 模型",group_workflow:"工作流与门禁",group_delivery:"容量与投递通知",group_panel:"巡检与面板",group_patrol:"巡检","group_pm-lifecycle":"PM 生命周期",group_session:"活着的会话",group_meeting:"跨项目会议",settingsGroupUngrouped:"未分组",settingsGroupCategories:"下一次派任务会用的模型",settingsGroupAssignments:"正在运行的任务实际使用的模型",settingsBadgeApply:"立即生效",settingsBadgeRestart:"需重启",settingsBadgeRefuse:"不可改",settingsUnknownBadge:"不认识",settingsUnset:"未设 · 默认 {value}",settingsKeyHint:"↑/↓ 行 · Enter 编辑 · / 筛选 · Esc 返回",keyFilter:"/ 筛选",settingFilterTitle:"筛选设置",settingConfirm:"确认:{key} {old} → {next} · {timing}(再按 Enter 写入)",settingTimingApply:"下一个读取它的进程生效",settingTimingRestart:"需要重启才生效",settingDanger:"危险:{reason}(再按一次 Enter 确认)",settingRejected:"✗ 被拒:{line}",settingWritten:"✓ 已写入 {key} = {value} · {timing}",settingRefused:"✗ 这个值要在项目配置文件里改:{line}",settingInvalid:"✗ 值不合法:{line}",settingConflict:"! 契约在编辑器打开后变过(指纹不符)—— 什么都没写;已重读",settingWriteError:"✗ 写入失败(原文件未动):{line}",settingsRefusedRoute:"这个值要改项目配置文件 .pi/team/config.sh,界面不能改",settingsCategoryHint:"类别 {category}:team config set-task-model {category} <model> —— 只影响以后派的新任务;已经派出去的任务继续用它当时的模型(这一行不组合映射)",settingsCategoryRow:"类别 {category}",settingsCategoryModel:"模型 {model}",settingsCategoryBadge:"新任务",settingsCategoryPickerTitle:"选择类别 {category} 的模型",settingsCategoryPickerHint:"↑/↓ 选择 · Enter 直接写入该值 ·「自由输入」才进编辑器 · Esc 返回(只影响以后派的新任务;已经派出去的任务继续用它当时的模型,没有进程被重启)",settingsCategoryMapHint:"类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 映射在面板里绝不被组合",settingsCategoryMapEmpty:"类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 当前映射为空,先用 CLI 添加一个类别",settingsAssignmentHint:"任务派出去以后就固定用它当时的模型,不跟着上面的设置变",settingsAssignmentNote:"任务 {task} · 类别 {category} · 会话 {sid} · 来源 {selected}/{launch}",settingsAssignmentNone:"这个席位还没有派过任务",settingsAssignmentUnreadable:"这个席位派过任务,但它的记录读不出来,面板不显示它在用的模型",settingsReadOnlyBadge:"不可改",settingsPmLaunchLabel:"PM 上次启动",settingsPmLaunchNote:"窗口 {window} · {mode} · {time}",settingsPmLaunchHint:"PM 上一次启动时用的模型,这里不能改",settingsDiagnosisHeading:"旧设置需要升级",settingsCliHint:"命令行:team config set {key} <新值>",settingsRefusedHint:"这个值要改项目配置文件 .pi/team/config.sh,界面不能改",settingsUnknownHint:"{key}:这个设置在文件里,工具不认识它,面板不能改",settingsChoiceTitle:"选择 {label} 的值 · {key}",settingsChoiceHint:"↑/↓ 选择 · Enter 直接写入该值(危险值再按一次确认)· 「自由输入」才进编辑器 · Esc 返回",settingsChoiceCurrent:"当前",settingsChoiceDefault:"默认",settingsChoiceKeepUnset:"保持未设(取消,什么都不写)",settingsChoiceClear:"清空(写入空值)",settingsChoiceFree:"…(自由输入)",settingsChoiceInterval:"接受区间 {min}–{max}(空 = 无界)",settingsChoiceNoChoice:"{kind} 这种 kind 没有选项集;写入仍由命令校验(Enter 打开自由输入)",settingCategoryConfirm:"确认类别 {category}:{old} → {next} · 只影响以后派的新任务;已经派出去的任务继续用它当时的模型(再按 Enter 写入)",settingCategoryWritten:"✓ 已写入类别 {category} = {value} · 只影响以后派的新任务;已经派出去的任务继续用它当时的模型;没有重启任何进程",settingPmWritten:"✓ 已写入 PM 模型 = {value} · 换模型要用 team up --fresh-pm 重开一场对话;没有重启任何进程",settingsBoolOn:"开(1)",settingsBoolOff:"关(0)",settingsPathExists:"存在",settingsPathMissing:"不存在",settingsPathNotExec:"不是可执行文件",keyCategoryPick:"Enter 编辑",seatSourceExplicit:"派单时指定",seatSourcePolicy:"按类别设置",seatSourceAssignment:"沿用原记录",label_TEAM_PROJECT:"项目名",label_TEAM_SESSION:"会话名",label_TEAM_PM_WINDOW:"PM 窗口",label_TEAM_AGENTS:"名册",label_TEAM_DOCS_DIR:"账本目录",label_TEAM_WORKTREES_DIR:"工作树目录",label_TEAM_STATE_DIR:"状态目录",label_TEAM_MEETINGS_DIR:"会议目录",label_TEAM_SPEC_DIR:"规格目录",label_TEAM_ROOT:"项目根",label_TEAM_MAIN_ROOT:"主检出根",label_TEAM_TMP_ROOT:"临时根目录",label_TEAM_CONFIG_FILE:"契约文件",label_TEAM_BRANCH_MODE:"分支命名模式",label_TEAM_TASK_BRANCH_PREFIX:"任务分支前缀",label_TEAM_AGENT_BRANCH_PREFIX:"席位分支前缀",label_TEAM_PROTECTED_BRANCH:"保护分支",label_TEAM_REMOTE:"远端",label_TEAM_VCS:"托管平台",label_TEAM_TOKEN_FILE:"凭据文件",label_TEAM_GITLAB_HOST:"GitLab 主机",label_TEAM_GITLAB_PROJECT:"GitLab 项目",label_TEAM_GITLAB_TOKEN_FILE:"GitLab 凭据文件",label_TEAM_MERGE_PREFER_THEIRS:"冲突默认取分支侧",label_TEAM_CONFIRM_WRITES:"写入前确认",label_TEAM_ALLOW_FOREIGN_IDENTITY:"放行外部身份",label_TEAM_ALLOW_FOREIGN_SESSION:"放行外部会话",label_TEAM_GUARD_FOREIGN_TARGET:"拦截外部目标",label_TEAM_REPLACE_FOREIGN_PM:"可替换外部 PM",label_TEAM_ALLOW_DESTRUCTIVE_TMUX:"放行破坏性操作",label_TEAM_ASSUME_YES:"默认全部确认",label_TEAM_REQUIRE_JS:"必需 JS 运行时",label_TEAM_REQUIRE_OPENSPEC:"必需 OpenSpec",label_TEAM_REQUIRE_MAGIC_CONTEXT:"必需 Magic Context",label_TEAM_PI_AGENT_DIR:"Pi 配置目录",label_TEAM_PI_SETTINGS_FILE:"Pi 设置文件",label_TEAM_MEMINFO_FILE:"内存信息文件",label_TEAM_DISK_STATS_FILE:"磁盘读数夹具",label_TEAM_SMOKE_FAST:"冒烟快模式",label_TEAM_MODEL_LIMITS:"模型并发上限",label_TEAM_MODEL_WINDOWS:"显式上下文窗口",label_TEAM_SESSION_WARN_TOKENS:"上下文告警阈值",label_TEAM_EXTRA_PI_ARGS:"席位附加参数",label_TEAM_AGENT_CMD:"席位启动命令",label_TEAM_AGENT_NOTIFY_CMD:"收工通知命令",label_TEAM_AGENT_LOG_GLOB:"席位日志路径",label_TEAM_PI_BIN:"pi 可执行文件",label_TEAM_AGENT_BIN:"席位可执行文件",label_TEAM_OPENSPEC_BIN:"openspec 可执行文件",label_TEAM_JS_BIN:"JS 运行时",label_TEAM_TASK_MODELS:"任务类别模型",label_TEAM_PM_MODEL:"PM 模型",label_TEAM_CONFIG_VERSION:"配置形状号",label_TEAM_UPDATE_CHECK:"启动时提示新版本",label_TEAM_GATES:"门禁命令",label_TEAM_INSTALL_CMD:"安装命令",label_TEAM_TASK_BRANCH_RESET:"派单时重置分支",label_TEAM_DISPATCH_VERIFY_SEC:"派单检查等待",label_TEAM_DISPATCH_ALIVE_SEC:"存活判定等待",label_TEAM_SQUASH_LOOKBACK:"squash 回看条数",label_TEAM_REVIEW_TIMEOUT:"复验超时",label_TEAM_REVIEW_TIMEOUT_GRACE:"超时宽限",label_TEAM_REVIEW_ALLOW_DIRTY:"复验放行脏工作树",label_TEAM_REVIEW_ALLOW_IGNORED:"复验放行忽略文件",label_TEAM_REVIEW_ALLOW_UNRESOLVED_BRANCH:"放行未解析分支",label_TEAM_REVIEW_ANY_DIR:"复验跳过目录校验",label_TEAM_BOARD_DONE_FORCE:"强制标记 done",label_TEAM_BOARD_DONE_REASON:"强制放行理由",label_TEAM_MIN_FREE_SWAP_MB:"swap 底线",label_TEAM_MIN_TOTAL_MB:"内存硬底线",label_TEAM_MIN_AVAIL_MB:"可用内存底线",label_TEAM_TMP_MIN_FREE_MB:"临时根空间底线",label_TEAM_TMP_MIN_FREE_INODES:"临时根 inode 底线",label_TEAM_WARN_AVAIL_MB:"可用内存告警线",label_TEAM_ZRAM_WARN_PCT:"zram 告警比例",label_TEAM_AGENT_MEM_MB:"席位内存上限",label_TEAM_NOTIFY_TMUX:"走 tmux 投递",label_TEAM_NOTIFY_DEDUP_SEC:"通知去重窗口",label_TEAM_INBOX_MAX_CHARS:"预览字数",label_TEAM_NOTIFY_LOG:"通知调试日志",label_TEAM_NOTIFY_DETAIL_MAX:"通知明细条数上限",label_TEAM_DEFER_TTL:"排队过期时间",label_TEAM_OUTBOX_MAX:"发件箱条数上限",label_TEAM_PANEL_DETAIL_CAP:"详情文件读取上限",label_TEAM_ORPHAN_WARN_MB:"孤儿内存提示阈值",label_TEAM_ORPHAN_SCAN:"扫描孤儿席位进程",label_TEAM_ORPHAN_PROC_ROOT:"普查 /proc 接缝",label_TEAM_PULSE_INTERVAL:"巡检周期",label_TEAM_MONITOR_REFRESH:"面板刷新周期",label_TEAM_MONITOR_EVENTS:"事件初始条数",label_TEAM_MONITOR_UI:"面板渲染器",label_TEAM_MONITOR_ACTIVITY:"活动列",label_TEAM_AGENT_LOG_TAIL_BYTES:"日志尾部读取上限",label_TEAM_PULSE_WINDOW:"巡检窗口名",label_TEAM_PULSE_NUDGE_GAP:"重复提醒间隔",label_TEAM_PULSE_PENDING_BOARD:"看板待办也唤醒",label_TEAM_PULSE_REBUILD_TMUX:"自愈重建 server",label_TEAM_PULSE_MAX_RESTARTS:"自动拉起次数上限",label_TEAM_PM_SESSION_ID:"PM 会话 ID",label_TEAM_PM_CMD:"PM 启动命令",label_TEAM_PM_BIN:"PM 可执行文件",label_TEAM_PM_EXTRA_PI_ARGS:"PM 附加参数",label_TEAM_PM_RESUME_ARGS:"PM 续跑参数",label_TEAM_PM_START_WAIT:"PM 启动等待",label_TEAM_INBOX_WATCH_MAX_BYTES:"watcher 读取上限",label_TEAM_INBOX_WATCH_PREVIEW:"预览行数",label_TEAM_INBOX_WATCH_REPLAY_MAX:"重放条数上限",label_TEAM_INBOX_WATCH_SEEN_MAX:"已见记录上限",label_TEAM_INBOX_WATCH_STALE:"过期判定秒数",label_TEAM_INBOX_WATCH_STALE_SEC:"唤醒行新鲜度",label_TEAM_INBOX_WATCH_FORCE_FAIL:"强制注册失败(测试)",label_TEAM_IW_REQUIRE_WATCH:"门禁严格模式(测试)",label_TEAM_INBOX_WATCH_POLL_MS:"轮询间隔",label_TEAM_INBOX_WATCH_HEARTBEAT_MS:"心跳间隔",label_TEAM_INBOX_WATCH_TARGET:"投递目标",label_TEAM_BG_LOG_MAX_BYTES:"后台日志上限",label_TEAM_SIGNAL_CALLS_LOG:"信号调用审计",label_TEAM_SIGNAL_REAL:"信号真身",label_TEAM_BG_STOP_GRACE:"作业停止宽限",label_TEAM_MEETING_TTL_HOURS:"会议有效期",label_TEAM_MEETING_MAX_TURNS:"会议轮次上限",label_TEAM_MEETING_KNOCK:"允许敲门",label_TEAM_MEETING_ALLOW_USER_ID:"可敲门用户",replyHeading:"关键回复",replyHeadingCount:"关键回复({n})",replyLatest:"最新关键回复",replyEmpty:"(还没有关键回复)",replyUnavailable:"(不可用)",replyLatestUnavailable:"最新回复不可用:{reason}",replyDeclared:"来自 {from} · {at}",replyDeclaredShort:"来自 {from}",replySlotUnavailable:"#{no} 不可用",replyLoading:"… 载入中",replyBodyMissing:"这份回复不可用",replyBodyHint:"只读 · 按发布的原文显示",replyOlder:"更早",replyNewer:"更新",replyBack:"返回",replyScrollHint:"↑/↓ PgUp/PgDn Home/End 滚动",replyTotalSlots:"{n} 个编号槽位",replyTailWarning:"索引尾部不完整(上一次追加没有写完)",replyPageNote:"「这条回复是写给谁的?」——PM 写给用户的回复都在这里",keyCompose:"m 写信",keyFlush:"f 冲刷",keyStandby:"s 待命",keySettings:", 设置",keyPages:"Tab/1-5 翻页",keyReplies:"←/→ 更早/更新",keyReplyReset:"r 最新",keyScroll:"↑/↓ 滚动",keyLanes:"←/→ 车道",keyCards:"↑/↓ 卡片",keyFold:"c 折叠",keyRows:"↑/↓ 行",keyOpen:"Enter 打开",keyDetailClose:"Esc/q 返回",keyDetailTabs:"←/→ 文件",keyDetailScroll:"↑/↓ 滚动",keyQuit:"q 收起",composeHint:"Enter 发送 · C-j 换行 · Esc 取消(保留草稿)· C-o 编辑器",composeHiddenAbove:"↑{n} 行",composeReasonHint:"Enter 进入待命 · C-j 换行(变空格)· Esc 取消",composeTitle:"写信",composeStandbyTitle:"待命原因",receiptDelivered:"✓ 已送达 PM · delivered",receiptQueued:"… 已入队(PM 的输入框在忙)· queued",receiptHeld:"! 滞留(副本在 state/outbox/held/)· held",receiptError:"✗ 投递未确认 · {detail}",draftNotCleared:"✗ 已结算,但草稿文件清不掉:{file}(文字保留在输入行)",flushOk:"✓ 冲刷 · {detail}",flushFail:"✗ 冲刷失败 · {detail}",standbyOkOn:"✓ 待命 on(原因:{reason})",standbyOkOff:"✓ 待命 off",standbyFail:"✗ 待命失败 · {detail}",busySend:"发送中…",busyAction:"执行中…",editorClosed:"编辑器已关闭:草稿 {n} 字符",noTeamCli:"找不到 teamsmith CLI",sendUnconfirmed:"投递未确认(没有拿到结果码)",queuePending:"队列仍有条目未投递"};var WL={zh:R5,en:q5};function L5(I){return I==="zh"||I==="en"}function H8(I){return L5(I)?WL[I]:WL.zh}var VT=["prefLang","prefDefaultPage","prefActivity","prefMouse","prefDensity"],OL=VT.reduce((I,B)=>Math.max(I,bI(R5[B]),bI(q5[B])),0);function NI(I,B){return String(I).replace(/\{(\w+)\}/g,(C,D)=>Object.prototype.hasOwnProperty.call(B,D)?String(B[D]):C)}var $T="label_";function l3(I,B){let C=I[$T+B];return typeof C==="string"&&C.length>0?C:String(B)}var L1=["todo","wip","review","done","blocked","dropped"];var PL={name:"dark",bg:"#10141a",tones:{title:"#ffffff",text:"#dfe3ea",dim:"#98a2b3",heading:"#7cc7ff",accent:"#9db8ff",ok:"#8ee6a1",warn:"#f2c66d",err:"#ff9d9d",selected:"#9db8ff"}},wT={name:"light",bg:"#fbfbf8",tones:{title:"#111111",text:"#24292f",dim:"#57606a",heading:"#0b5cad",accent:"#1b4fd8",ok:"#0f7a37",warn:"#8a5a00",err:"#c0272d",selected:"#1b4fd8"}},z1={dark:PL,light:wT};function V5(I,B=process.env){if(I==="dark"||I==="light")return I;let D=String(B.COLORFGBG??"").split(";").pop()?.trim()??"";if(/^\d+$/.test(D))return Number(D)>=7&&Number(D)!==8?"light":"dark";return"dark"}function TL(I){let B=/^#?([0-9a-fA-F]{6})$/.exec(String(I).trim());if(!B)return[0,0,0];let C=Number.parseInt(B[1],16);return[C>>16&255,C>>8&255,C&255]}function z5(I){let B=I/255;return B<=0.04045?B/12.92:((B+0.055)/1.055)**2.4}function jL(I){let[B,C,D]=TL(I);return 0.2126*z5(B)+0.7152*z5(C)+0.0722*z5(D)}function WT(I,B){let C=jL(I),D=jL(B),J=Math.max(C,D),U=Math.min(C,D);return(J+0.05)/(U+0.05)}function $5(I=PL){return Object.keys(I.tones).map((B)=>({tone:B,fg:I.tones[B],bg:I.bg,ratio:WT(I.tones[B],I.bg)}))}var OT={title:"97",text:"39",dim:"90",heading:"96",accent:"94",ok:"92",warn:"93",err:"91",selected:"94"};function SL(I,B,C=!0){if(!C)return OT[I]??"39";let[D,J,U]=TL(B.tones[I]??"#ffffff");return`38;2;${D};${J};${U}`}var jT=160,PT=100,TT=60,ST=0.56,_T=0.64,U8=3,i=(I,B="text")=>({text:String(I),tone:B});function vT(I){let B=[];for(let C of I){let D=B[B.length-1];if(D&&D.tone===C.tone&&!D.clock&&!C.clock)D.text+=C.text;else B.push({...C})}return B}var OA=(...I)=>vT(I.filter((B)=>B!==null&&B!==void 0&&B!=="").map((B)=>typeof B==="string"?i(B):B)),R0=(I)=>I.map((B)=>B.text).join(""),bD=(I)=>bI(R0(I));function VI(I,B){if(B<=0)return[];if(bD(I)<=B)return I;let C=B-1,D=[],J=0;for(let U of I){if(J>=C)break;let N="";for(let X of U.text){let L=bI(X);if(J+L>C)break;N+=X,J+=L}if(N)D.push({text:N,tone:U.tone})}return D.push(i("…",D[D.length-1]?.tone??"text")),D}function uL(I,B){let C=B-bD(I);return C>0?[...I,i(" ".repeat(C),"text")]:I}function QD(I,B,C){let D=VI(I,C);if(!B?.length)return{line:D};let U=bD(I)>C?Math.max(0,C-1):C,N=[];for(let X of B){let L=Math.min(X.start,U),O=Math.min(X.end,U);if(O>L)N.push({...X,start:L,end:O})}return N.length?{line:D,hits:N}:{line:D}}function W1(I){return I.view.tui&&I.view.density==="comfortable"}function pL(I,B){if(B<=1)return OA(i(V1,"dim"));if(B===2)return OA(i(V1+JK,"dim"));let C=B-2;if(!I)return OA(i(V1+ID.repeat(C)+JK,"dim"));let D=bI(I);if(2+D+1>C){let U=Math.max(0,C-1);return OA(i(V1+ID,"dim"),...VI(OA(i(I,"heading")),U),i(JK,"dim"))}let J=C-(2+D+1);return OA(i(V1+ID+" ","dim"),i(I,"heading"),i(" "+ID.repeat(Math.max(0,J)),"dim"),i(JK,"dim"))}function r3(I){if(I<=1)return OA(i(a3,"dim"));if(I===2)return OA(i(a3+w5,"dim"));return OA(i(a3+ID.repeat(I-2)+w5,"dim"))}function mJ(I,B){let C=Math.max(0,B-4),D=VI(I.line,C),J=Math.max(0,C-bD(D)),U=[];for(let X of I.hits??[]){let L=Math.min(X.start+2,2+C),O=Math.min(X.end+2,2+C);if(O>L)U.push({...X,start:L,end:O})}let N=OA(i(`${s3} `,"dim"),...D,J>0?i(" ".repeat(J),"text"):null,i(` ${s3}`,"dim"));return U.length?{line:N,hits:U}:{line:N}}function dL(I,B,C="heading"){if(B<=0)return[];if(!I)return OA(i(d3(B,ID),"dim"));let D=bI(I);if(D+4>=B)return VI(OA(i(ID+ID+" ","dim"),i(I,C)),B);let J=2,U=B-J-1-D;return OA(i(d3(J,ID)+" ","dim"),i(I,C),i(" "+d3(Math.max(0,U-1),ID),"dim"))}function yT(I,B,C){let D=I.title;if(!D||C==="plain"){if(D&&C==="plain"&&I.id!=="agents")return[{line:VI(OA(i(` ${D}`,"heading")),B)},...I.lines];return I.lines}if(C==="rule")return[{line:dL(D,B)},...I.lines.map((J)=>({line:VI(J.line,B),hits:J.hits}))];return[{line:pL(D,B)},...I.lines.map((J)=>mJ(J,B)),{line:r3(B)}]}function kT(I,B,C){let D=I.lines.length;if(!C||!I.title){if(B>=D)return"plain";if((I.summary||I.title)&&B>=1)return"summary";return null}if(B>=D+2)return"card";if(B>=D+1)return"rule";if(B>=1)return"summary";return null}function hT(I,B){if(I.summary)return{line:VI(I.summary.line,B),hits:I.summary.hits};return{line:VI(OA(i(` ${I.title??""}`,"heading")),B)}}var V1="╭",JK="╮",a3="╰",w5="╯",ID="─",s3="│";function cL(I,B,C){if(C){let D=I.state==="running"?B.agentRunning:I.state==="exited"?B.agentExited:B.agentAbsent;return`${p3[I.state]??"?"}${[...D][0]??""}`}return fT(I,B)}function xT(I,B,C,D){let J=Math.max(10,bI(D.agentsHeader)),U=bI(D.tableState);for(let h of C)U=Math.max(U,bI(cL(h,D,B)));let N=bI(D.tableSession);for(let h of C)N=Math.max(N,bI(String(h.session_text||D.dash)));let X=Math.max(7,bI(D.tableTask)),L={id:"name",header:D.agentsHeader,width:J},O={id:"state",header:D.tableState,width:U},T={id:"session",header:D.tableSession,width:N},v=J+U+N,V=I-v;if(B||V<7)return[L,O,T];let j={id:"task",header:D.tableTask,width:X};if(V>=X+8)return[L,O,j,{id:"branch",header:D.tableBranch,width:V-X},T];if(V>=X)return[L,O,j,T];return[L,O,T]}function _L(I,B){return OA(...I.map((C,D)=>i(sg(B[D]?.text??"",C.width),B[D]?.tone??"text")))}function fT(I,B){let C=p3[I.state]??"?",D=I.state==="running"?B.agentRunning:I.state==="exited"?B.agentExited:B.agentAbsent,J=I.cause?` · ${I.cause}`:"";return`${C} ${D}${J}`}function bT(I,B){switch(I?.state){case"running":return B.pmRunning;case"starting":return B.pmStarting;case"foreign":return B.pmForeign;case"unknown":return B.pmUnknown;default:return B.pmAbsent}}function mT(I){let{s:B,panel:C}=I,D=C.project||B.dash,J=`${B.appTitle} · ${D}`,U=!C.standby?B.standbyDash:NI(C.standby.on?B.standbyOn:B.standbyOff,{reason:C.standby.reason||"-"}),N=C.timestamp?bJ(C.timestamp):B.dash,X=` ${NI(B.patrolSeconds,{n:C.interval||"—"})} · ${U}`,O=I.width-bI(J)-2>=bI(`${N}${X}`)?OA(i(J,"title"),i(" "),{text:N,tone:"dim",clock:!0},i(X,"dim")):OA(i(`${J} ${N}${X}`,"title"));return{id:"title",full:!0,priority:0,lines:[{line:VI(O,I.width)}],separator:"none"}}function uT(I){let{s:B,panel:C,deg:D}=I,J=!C.pm||D.has("pm")?`${B.pmLabel} ${B.dash}`:`${B.pmLabel} ${C.pm.state}${C.pm.detail?`(${C.pm.detail})`:""} · ${bT(C.pm,B)}`,U=!C.pending||D.has("pending")?`${B.pendingLabel} ${B.dash}`:`${B.pendingLabel} ${C.pending.text||B.pendingNone}`,N=C.outbox,X=!N||D.has("outbox")?`${B.outboxLabel} ${B.dash}`:`${B.outboxLabel} ${N.queued}${N.held>0?NI(B.outboxHeldSuffix,{n:N.held}):""}${N.impeded&&N.impeded>0?` ${NI(B.outboxImpededSuffix,{n:N.impeded})}`:""}`,L=[{line:VI(OA(i(" "),i(J),i(" "),i(U),i(" "),i(X,"accent")),I.width)}],O=!C.pm||D.has("pm")?"":C.pm.delivery_warning||"";if(O)L.push({line:VI(OA(i(" "),i(NI(B.pmDeliveryWarning,{reason:O}),"warn")),I.width)});if(N&&!D.has("outbox")&&N.impeded&&N.impeded>0){let T=Array.from(new Set((N.impediments??[]).map((v)=>v.reason))).join(" · ")||B.dash;L.push({line:VI(OA(i(" "),i(NI(B.queueImpededLine,{n:N.impeded,reasons:T}),"warn")),I.width)})}return{id:"status",full:!0,priority:1,lines:L,separator:"none"}}function pT(I){let{s:B,panel:C,deg:D}=I,J=C.capacity;if(!J||D.has("capacity"))return{id:"capacity",title:B.capacityLabel,full:!0,priority:2,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let U=Math.min(18,Math.max(0,I.width-60)),N=(J.disk??[]).flatMap((T)=>[i(" | ","dim"),i(NI(B.capacityDisk,{path:T.path,mb:T.avail_mb==null?B.dash:R1(T.avail_mb),ino:T.free_inodes==null?B.dash:String(T.free_inodes)}))]),X=N.reduce((T,v)=>T+bI(v.text),0),L=F5(J.spark,Math.max(0,U-X)),O=OA(i(NI(B.capacityRam,{mb:R1(J.ram_avail_mb)})),i(" | ","dim"),i(NI(B.capacitySwap,{mb:R1(J.swap_free_mb)})),i(" | ","dim"),i(NI(B.capacityAgents,{n:J.agents})),...N,L?i(` ${L}`,"accent"):null);return{id:"capacity",title:B.capacityLabel,full:!0,priority:2,lines:[{line:VI(O,I.width)}]}}function dT(I){let{s:B,panel:C,deg:D,blocks:J}=I,U=J.board,N=[];if(U&&!D.has("board")){let L=U.counts??{},O=[[B.taskTodo,L.todo??0],[B.taskWip,L.wip??0],[B.taskReview,L.review??0],[B.taskBlocked,L.blocked??0],[B.taskDone,L.done??0]].map(([T,v])=>NI(B.countPair,{label:T,n:v})).join(" · ");N.push(i(NI(B.progressTasks,{parts:O})))}else N.push(i(NI(B.progressTasks,{parts:B.dash}),"dim"));let X=i(" | ","dim");if(N.push(X),J.changes&&!D.has("changes"))N.push(i(NI(B.progressChanges,{n:J.changes.count})));else N.push(i(`${B.progressChanges.replace("{n}",B.dash)}`,"dim"));if(N.push(X),J.specs&&!D.has("specs"))N.push(i(NI(B.progressSpecs,{specs:J.specs.count,reqs:J.specs.requirements})));else N.push(i(`${B.specsHeading} ${B.dash}`,"dim"));if(N.push(X),J.decisions&&!D.has("decisions"))N.push(i(NI(B.progressDecisions,{n:J.decisions.count})));else N.push(i(`${B.progressDecisions.replace("{n}",B.dash)}`,"dim"));return{id:"progress",title:B.progressLabel,full:!0,priority:5,lines:[{line:VI(OA(...N),I.width)}],summary:{line:VI(OA(i(` ${B.progressLabel}`,"heading")),I.width)}}}function cT(I){let{s:B,deg:C,blocks:D}=I,J=D.board;if(!J||C.has("board"))return null;let U=J.deliveries??[];if(!U.length)return{id:"deliveries",title:B.deliveriesLabel,full:!0,priority:6,lines:[{line:OA(i(` ${B.deliveriesEmpty}`,"dim"))}]};let N=[...U.slice(0,3).map((X)=>({line:VI(OA(i(" "),i(NI(B.deliveryLine,{id:X.id,agent:X.agent,time:X.at?bJ(X.at):B.dash}))),I.width)}))];return{id:"deliveries",title:B.deliveriesLabel,full:!0,priority:6,lines:N,summary:{line:VI(OA(i(` ${B.deliveriesLabel}`,"heading")),I.width)}}}function lT(I){let{s:B,panel:C,deg:D,width:J,minimal:U}=I,N=!C.agents||D.has("agents")?[]:C.agents??[],L=W1(I)&&J>8?J-4:J,O=xT(L,U,N,B);if(!C.agents||D.has("agents"))return{id:"agents",title:B.agentsHeader,priority:10,lines:[{line:OA(i(` ${B.dash}`,"dim"))}],summary:{line:VI(OA(i(` ${B.agentsHeader} ${B.dash}`,"heading")),J)}};let T=O.map((V)=>({text:V.header,tone:"heading"})),v=[{line:_L(O,T)}];if(!N.length)v.push({line:OA(i(` ${B.agentEmpty}`,"dim"))});for(let V of N){let j=O.map((h)=>{switch(h.id){case"name":return{text:String(V.name??"?"),tone:"text"};case"state":return{text:cL(V,B,U),tone:iT(V.state)};case"task":return{text:String(V.task||B.dash),tone:"text"};case"branch":{let f=`${V.dirty?" *":""}${V.ahead?` +${V.ahead}`:""}`;return{text:`${RL(String(V.branch??""),Math.max(1,h.width-bI(f)))}${f}`,tone:"text"}}case"session":return{text:String(V.session_text||B.dash),tone:"text"}}});v.push({line:_L(O,j)})}return{id:"agents",title:B.agentsHeader,priority:10,lines:v,summary:{line:VI(OA(i(` ${B.agentsHeader} (${N.length})`,"heading")),J)}}}function iT(I){return I==="running"?"ok":I==="exited"?"warn":"dim"}function aT(I){let{s:B,panel:C,deg:D,activity:J,width:U,view:N}=I;if(!I.input.activity)return null;let X=[];if(D.has("activity")||!C.activity_source)X.push({line:OA(i(` ${B.dash}`,"dim"))});else{let L=`${B.activitySource.replace("{path}","")}`.trim(),O=zL(C.activity_source,U-bI(L)-3);X.push({line:VI(OA(i(" "),i(L,"dim"),i(" "),i(O,"dim")),U)});let T=oT(J).slice(Math.max(0,N.scroll));if(!T.length)X.push({line:OA(i(` ${B.activityEmpty}`,"dim"))});for(let v of T)X.push({line:VI(OA(i(` ${v}`)),U)})}return{id:"events",title:B.activityHeading,right:!0,priority:11,lines:X,summary:{line:VI(OA(i(` ${B.activityHeading}`,"heading")),U)}}}function nT(I){let{s:B,panel:C,deg:D,width:J}=I,U=C.recent??[];if(D.has("recent")||!C.recent)return{id:"recent",title:B.recentHeading,right:!0,priority:12,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=[],X=U.slice(-6);if(!X.length)N.push({line:OA(i(` ${B.recentEmpty}`,"dim"))});for(let L of X)N.push({line:VI(OA(i(` ${L}`,"dim")),J)});return{id:"recent",title:B.recentHeading,right:!0,priority:12,lines:N,summary:{line:VI(OA(i(` ${B.recentHeading}`,"heading")),J)}}}function oT(I){let B=[];for(let C of I??[]){let D=String(C?.name??"?"),J=Array.isArray(C?.events)?C.events:[];if(!J.length)continue;for(let U of J){let N=U?.ts?String(U.ts):"",X=N&&N.includes("T")?N.slice(11,19):N,L=String(U?.text??"");B.push(` ${D}${X?` ${X}`:""} ${L}`.trimEnd())}}return B}var W5={todo:"dim",wip:"accent",review:"warn",blocked:"err",done:"ok",dropped:"dim"};function lL(I,B){switch(I){case"done":return B.taskDone;case"wip":return B.taskWip;case"review":return B.taskReview;case"blocked":return B.taskBlocked;case"todo":return B.taskTodo;case"dropped":return B.taskDropped;default:return I}}function rT(I,B){switch(I){case"explore":return B.changePhaseExplore;case"propose":return B.changePhasePropose;case"verify":return B.changePhaseVerify;case"archive":return B.changePhaseArchive;default:return B.changePhaseApply}}var T5=5;function sT(I){if(I.deg.has("board"))return 0;let B=I.blocks.board?.rows??[],C=0;for(let D of B)if(D.state==="done"||D.state==="dropped")C++;return Math.max(0,C-Math.max(1,I.boardDoneKeep??T5))}function iL(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.board;if(!U)return null;if(D.has("board"))return{id:"board",title:B.boardHeading,priority:10,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=U.rows??[];if(!N.length)return{id:"board",title:B.boardHeading,priority:10,lines:[{line:OA(i(` ${B.boardEmpty}`,"dim"))}]};let X=U.counts??{},L=[{line:VI(OA(i(` ${NI(B.boardCounts,{todo:X.todo??0,wip:X.wip??0,review:X.review??0,blocked:X.blocked??0,done:X.done??0})}`,"dim")),J)}],O=N.filter((IA)=>IA.state==="done"||IA.state==="dropped"),T=Math.max(1,I.boardDoneKeep??T5),v=new Set(O.slice(-T).map((IA)=>IA.id)),V=O.filter((IA)=>!v.has(IA.id)).length,j=[...N.filter((IA)=>IA.state!=="done"&&IA.state!=="dropped"),...N.filter((IA)=>(IA.state==="done"||IA.state==="dropped")&&v.has(IA.id))],h=AY(N),f=IY(I.view.focus),c=f?O1(N,f):null,e=I.view.focus&&!f?null:c&&j.includes(c)?c:j[0]??null,XA=j.map((IA)=>$1(IA,h));for(let IA of j){let VA=IA===e,pA=OA(i(VA?`${HK} `:" ",VA?"selected":"dim"),i(`${p3[IA.state]??"·"} `,W5[IA.state]??"text"),i(sg(IA.id,10),VA?"selected":"accent"),i(sg(IA.agent,8),"dim"),i(sg(lL(IA.state,B),8),W5[IA.state]??"text"),i(IA.title)),_A=VA?{kind:"open-focused",lane:IA.state}:{kind:"focus",lane:IA.state,id:IA.id,nth:h.get(IA)??0};L.push(QD(pA,I.view.tui?[{start:0,end:bD(pA),action:_A}]:void 0,J))}if(V>0)L.push({line:VI(OA(i(` ${NI(B.boardDoneCollapsed,{n:V})}`,"dim")),J)});return{id:"board",title:NI(B.boardHeadingCount,{n:U.total??N.length}),priority:10,lines:L,order:XA,summary:{line:VI(OA(i(` ${NI(B.boardHeadingCount,{n:U.total??N.length})}`,"heading")),J)}}}var fD=L1,tT={todo:"·",wip:"▸",review:"◆",done:"✓",blocked:"✗",dropped:"—"},O5=1,aL=4,t3=2,eT=2,HK="›",AS="▸",nL="▾",n3=3,IS="…",QS="⋮",i3="\x00page";function BS(I){return I==="done"||I==="dropped"}function e3(I,B){return lL(I,B)}function M8(I,B){return I.filter((C)=>C.state===B)}function S5(I,B,C){if((I.boardFold??[]).includes(B))return!0;if((I.boardShow??[]).includes(B))return!1;return C&&(I.boardEmptyFold??!0)}function ES(I,B,C){return`${AS} ${e3(B,I)} ${C}`}function CS(I,B,C,D,J){let{s:U}=I,N=OA(i(" "),i(J?`${HK} `:" ",J?"selected":"dim"),i(ES(U,B,C),J?"selected":"heading"),i(U.laneFolded,"dim")),X=I.view.tui?[{start:0,end:Math.max(1,D),action:{kind:"lane-fold",lane:B}}]:void 0;return{line:VI(N,D),hits:X}}function gS(I,B,C,D){let J=Math.max(1,Math.floor(D)-2),U=Math.floor((J-1)/2),N=()=>I.view.tui?[{start:0,end:n3,action:{kind:"lane-fold",lane:B}}]:void 0,X=[{line:OA(i(V1+ID+JK,"dim")),hits:N()}];for(let L=0;L<J;L++){let O=C&&L===0,T=O?HK:L===U?QS:IS;X.push({line:OA(i(s3,"dim"),i(T,O?"selected":"dim"),i(s3,"dim")),hits:N()})}return X.push({line:OA(i(a3+ID+w5,"dim")),hits:N()}),X}function AY(I){let B=new Map,C=new Map;for(let D of I){let J=B.get(D.id)??0;C.set(D,J),B.set(D.id,J+1)}return C}function $1(I,B){return{lane:I.state,id:I.id,nth:B.get(I)??0}}function O1(I,B){if(!B)return null;let C=Math.max(0,B.nth??0),D=0;for(let J of I){if(J.id!==B.id)continue;if(D===C)return J;D++}return null}function _5(I,B){return $1(B,AY(I))}function uJ(I,B){return oL(I,AY(I),B)}function oL(I,B,C){if(C){let D=O1(I,C);if(D)return $1(D,B);let J=I.find((N)=>N.id===C.id);if(J)return $1(J,B);let U=M8(I,C.lane)[0];if(U)return $1(U,B)}for(let D of fD){let J=M8(I,D)[0];if(J)return $1(J,B)}return null}function IY(I){return I&&fD.includes(I.lane)?I:null}function DS(I,B,C,D,J,U=B){let N=Math.max(1,Math.floor(D)),X=C.length,L=Math.max(0,X-N),O=I.view.laneOffset?.[U],T=O==null||Number.isNaN(O)?BS(B)?L:0:O;if(T=Math.max(0,Math.min(L,Math.floor(T))),O==null&&J&&J.state===B){let v=C.indexOf(J);if(v>=0){if(v<T)T=v;else if(v>=T+N)T=Math.min(L,v-N+1)}}return{start:T,end:Math.min(X,T+N),above:T,below:Math.max(0,X-(T+N))}}function rL(I,B,C,D){let{minimal:J}=I,U=tT[B.state]??"·",N=W5[B.state]??"text",X=D?"selected":"dim",L=D?"selected":"accent",O=D?`${HK} `:" ";if(J)return VI(OA(i(O,X),i(`${U} `,N),i(`${sg(B.id,6)} `,L),i(B.title)),C);return VI(OA(i(O,X),i(`${U} `,N),i(`${B.id} `,L),i(B.title)),C)}function sL(I,B,C){return B?{kind:"open-focused",lane:I.state}:{kind:"focus",lane:I.state,id:I.id,nth:C}}function tL(I){return{kind:"lane-scroll",lane:I,delta:0}}function GS(I,B,C,D,J,U,N,X){let{s:L}=I,O=M8(I.blocks.board?.rows??[],B);if(X){N.push({lane:B,offset:0,visible:0,count:0});let f=J!=null&&J.state===B;return gS(I,B,f,D+2)}let T=DS(I,B,O,D-t3,J);N.push({lane:B,offset:T.start,visible:T.end-T.start,count:O.length});let v=I.view.tui?[{start:0,end:C,action:tL(B)}]:void 0,V=I.view.tui?[{start:0,end:C,action:{kind:"lane-fold",lane:B}}]:void 0,j=[{line:pL(`${nL} ${e3(B,L)} ${O.length}`,C),hits:V}];if(T.above>0)j.push(mJ({line:OA(i(` ${NI(L.laneHiddenAbove,{n:T.above})}`,"dim"))},C));if(!O.length)j.push(mJ({line:OA(i(` ${L.kanbanEmptyLane}`,"dim"))},C));for(let f=T.start;f<T.end;f++){let c=O[f],e=c===J,XA=rL(I,c,Math.max(0,C-4),e),IA=I.view.tui&&!I.view.detail?[{start:0,end:Math.max(1,Math.min(C-4,bD(XA))),action:sL(c,e,U.get(c)??0)}]:void 0;j.push(mJ({line:XA,hits:IA},C))}if(T.below>0)j.push(mJ({line:OA(i(` ${NI(L.laneHiddenBelow,{n:T.below})}`,"dim"))},C));while(j.length<D+1)j.push(mJ({line:[]},C));j.push({line:r3(C)});let h=j.slice(0,D+2);if(v){for(let f of h)if(!f.hits?.length)f.hits=v}return h}function JS(I,B){let C=[],D=I.reduce((J,U)=>Math.max(J,U.length),0);for(let J=0;J<D;J++){let U=[],N=[],X=0;I.forEach((L,O)=>{let T=B[O];if(O>0)U.push(i(" ".repeat(O5))),X+=O5;let v=L[J];if(v){U.push(...uL(v.line,T));for(let V of v.hits??[])N.push({...V,start:V.start+X,end:V.end+X})}else U.push(i(" ".repeat(T)));X+=T}),C.push(N.length?{line:U,hits:N}:{line:U})}return C}function HS(I,B,C,D){let{s:J}=I,U=I.width,N=[],X={i:-1};for(let h of fD){let f=M8(B,h);if(S5(I.view,h,!f.length)){let e=C!=null&&C.state===h;if(e)X.i=N.length;N.push(CS(I,h,f.length,U,e));continue}let c=I.view.tui?[{start:0,end:U,action:{kind:"lane-fold",lane:h,scroll:i3}}]:void 0;if(N.push({line:VI(OA(i(` ${nL} ${e3(h,J)} ${f.length}`,"heading")),U),hits:c}),!f.length)N.push({line:VI(OA(i(` ${J.kanbanEmptyLane}`,"dim")),U)});for(let e of f){let XA=e===C;if(XA)X.i=N.length;let IA=rL(I,e,Math.max(0,U-2),XA),VA=I.view.tui&&!I.view.detail?[{start:1,end:1+Math.max(1,bD(IA)),action:sL(e,XA,D.get(e)??0)}]:void 0;N.push({line:VI(OA(i(" "),...IA.slice(0)),U),hits:VA})}}let L=Math.max(1,(I.laneRows??aL)+t3),O=Math.max(0,N.length-L),T=I.view.laneOffset?.[i3]??0;if(T=Math.max(0,Math.min(O,Math.floor(T)||0)),X.i>=0){if(X.i<T)T=X.i;else if(X.i>=T+L)T=Math.min(O,X.i-L+1)}let v=I.view.tui?[{start:0,end:U,action:tL(i3)}]:void 0,V=[];if(T>0)V.push({line:VI(OA(i(` ${NI(J.laneHiddenAbove,{n:T})}`,"dim")),U)});for(let h=T;h<Math.min(N.length,T+L);h++)V.push(N[h]);let j=Math.max(0,N.length-(T+L));if(j>0)V.push({line:VI(OA(i(` ${NI(J.laneHiddenBelow,{n:j})}`,"dim")),U)});if(v){for(let h of V)if(!h.hits?.length)h.hits=v}return{lines:V,lanes:[{lane:i3,offset:T,visible:Math.min(L,Math.max(0,N.length-T)),count:N.length}]}}function eL(I){let{s:B,blocks:C,deg:D}=I,J=C.board;if(!J)return null;let U=(XA)=>({id:"kanban",full:!0,priority:1,separator:"none",lines:XA,summary:{line:VI(OA(i(` ${B.boardHeadingCount}`.replace("{n}",String(J.total??0)),"heading")),I.width)}});if(D.has("board"))return U([{line:VI(OA(i(` ${B.dash}`,"dim")),I.width)}]);let N=J.rows??[];if(!N.length)return U([{line:VI(OA(i(` ${B.boardEmpty}`,"dim")),I.width)}]);let X=AY(N),L=I.view.focus&&!fD.includes(I.view.focus.lane)?null:oL(N,X,I.view.focus),O=O1(N,L);if(!I.twoColumn){let XA=HS(I,N,O,X);return{...U(XA.lines),lanes:XA.lanes}}let T=Math.max(2,Math.floor(I.laneRows??aL)+t3),v=[],V=Math.max(0,I.width-O5*(fD.length-1)),j=(XA)=>S5(I.view,XA,!M8(N,XA).length),h=fD.filter(j),f=fD.filter((XA)=>!j(XA)),c=new Map;if(!h.length){let XA=Math.max(8,Math.floor(V/fD.length));for(let IA of fD)c.set(IA,XA)}else if(!f.length)for(let XA of h)c.set(XA,n3);else{for(let IA of h)c.set(IA,n3);let XA=Math.max(8,Math.floor((V-n3*h.length)/f.length));for(let IA of f)c.set(IA,XA)}let e=fD.map((XA)=>GS(I,XA,c.get(XA)??8,T,O,X,v,h.includes(XA)));return{...U(JS(e,fD.map((XA)=>c.get(XA)??8))),lanes:v}}var US=16;function QY(I){return Math.max(1,W1(I)?I.width-4:I.width)}function MS(I,B,C,D){let J=[i(" ")],U=[],N=1;return B.forEach((X,L)=>{if(L>0)J.push(i(" ")),N+=2;let O=L===C?`[${X.tab}]`:X.tab,T=N;if(J.push(i(O,L===C?"accent":"dim")),N+=bI(O),I.view.tui)U.push({start:T,end:N,action:{kind:"detail-tab",index:L}})}),QD(J,U,D)}function j5(I){let{s:B,blocks:C,deg:D}=I,J=I.view.detail??"",U=QY(I),N=NI(B.detailTitle,{id:J}),X=(IA,VA)=>({id:"detail",full:!0,priority:1,separator:"none",title:N,lines:IA,detail:VA,summary:{line:VI(OA(i(` ${N}`,"heading")),I.width)}});if(D.has("detail"))return X([{line:VI(OA(i(` ${B.dash}`,"dim")),U)}]);let L=C.detail;if(!L)return X([{line:VI(OA(i(` ${B.detailLoading}`,"dim")),U)}],{index:0,total:0,visible:0,offset:0});let O=L.files??[];if(!O.length){let IA=L.reason?NI(B.detailUnavailable,{reason:L.reason}):B.detailNoFiles;return X([{line:VI(OA(i(` ${IA}`,"dim")),U)}])}let T=L,v=Math.max(0,Math.min(O.length-1,Math.floor(I.view.detailIndex??0)||0)),V=O[v],j=[MS(I,O,v,U)];if(L.reason)j.push({line:VI(OA(i(` ${L.reason}`,"warn")),U)});if(V.truncated)j.push({line:VI(OA(i(` ${B.detailTruncated}`,"warn")),U)});if(T.file!==V.path)return j.push({line:VI(OA(i(` ${B.detailLoading}`,"dim")),U)}),X(j,{index:v,total:0,visible:0,offset:0});let h=X5(V.path,T.text,U),f=Math.max(1,I.detailRows??US),c=Math.max(1,f-j.length),e=Math.max(0,h.length-c),XA=Math.max(0,Math.min(e,Math.floor(I.view.detailScroll??0)||0));for(let IA=XA;IA<Math.min(h.length,XA+c);IA++)j.push(h[IA]);while(j.length<f)j.push({line:[]});return X(j,{index:v,total:h.length,visible:Math.min(c,Math.max(0,h.length-XA)),offset:XA})}var KS=12,FS=16;function YS(I){return I.available?`#${I.no} ${I.title}`:""}function Az(I,B){let{s:C}=I,D=[i(" ")],J=[],U=1,N=(X,L)=>{let O=U;D.push(i(X,"accent")),U+=bI(X),J.push({start:O,end:U,action:L}),D.push(i(" ")),U+=1};return N(`‹ ${C.replyOlder}`,{kind:"reply-page",dir:-1}),N(`${C.replyNewer} ›`,{kind:"reply-page",dir:1}),N(C.keyReplyReset,{kind:"reply-reset"}),QD(D,J,B)}function Iz(I){let{s:B,blocks:C,deg:D,view:J}=I,U=QY(I),N=C.reply_list,X=Math.max(2,I.replyRows??KS),L=(c,e)=>({id:"reply_list",full:!0,priority:1,separator:"none",title:N?NI(B.replyHeadingCount,{n:N.total_slots}):B.replyHeading,lines:c,replyList:e,summary:{line:VI(OA(i(` ${B.replyHeading}`,"heading")),I.width)}}),O=[Az(I,U),{line:VI(OA(i(` ${B.replyPageNote}`,"dim")),U)}];if(!N||D.has("reply_list"))return O.push({line:VI(OA(i(` ${N?B.dash:B.replyLoading}`,"dim")),U)}),L(O,{focus:0,offset:0,visible:0,count:0});if(N.state!=="empty")O.push({line:VI(OA(i(` ${NI(B.replyTotalSlots,{n:N.total_slots})}`,"dim")),U)});if((N.warnings??[]).some((c)=>c.kind==="partial-tail"))O.push({line:VI(OA(i(` ${B.replyTailWarning}`,"warn")),U)});let T=Array.isArray(N.entries)?N.entries:[];if(!T.length)return O.push({line:VI(OA(i(` ${B.replyEmpty}`,"dim")),U)}),L(O,{focus:0,offset:0,visible:0,count:0});let v=Math.max(1,X-O.length),V=J.replyFocus??0,j=T.findIndex((c)=>c.no===V);if(j<0)j=0;let h=Math.max(0,j-v+1),f=Math.max(0,Math.min(Math.max(0,T.length-v),Math.floor(J.replyOffset??h)||0));for(let c=f;c<Math.min(T.length,f+v);c++){let e=T[c],XA=c===j,VA=` ${XA?B.settingsCursor:" "} `,pA=e.available?OA(i(VA,"accent"),i(YS(e),XA?"selected":"text"),i(` · ${e.from}`,"dim")):OA(i(VA,"accent"),i(NI(B.replySlotUnavailable,{no:e.no}),"warn"),i(`(${e.reason})`,"dim"));O.push({line:VI(pA,U),hits:I.view.tui?[{start:1,end:Math.min(U,bD(pA)+1),action:{kind:"reply-click",index:c}}]:void 0})}return L(O,{focus:T[j].no,offset:f,visible:Math.min(v,T.length-f),count:T.length})}function Qz(I){let B=I.view.replyBody;if(!B)return null;let{s:C,blocks:D,deg:J}=I,U=QY(I),N=Math.max(2,I.replyDocRows??FS),X=D.reply_body,L=(XA,IA)=>({id:"reply_viewer",full:!0,priority:1,separator:"none",title:`#${B} ${C.replyHeading}`,lines:XA,replyDoc:IA,summary:{line:VI(OA(i(` ${C.replyHeading} #${B}`,"heading")),I.width)}}),O=Az(I,U),T=OA(i(` ${C.replyBack}`,"accent"),i(` · ${C.keyDetailClose}`,"dim")),v={line:VI(T,U),hits:I.view.tui?[{start:1,end:1+bI(C.replyBack)+2,action:{kind:"reply-close"}}]:void 0};if(!X||X.no!==B){let IA=I.view.replyBodyFailed===!0||J.has("reply_body")?i(` ${C.replyBodyMissing}`,"warn"):i(` ${C.replyLoading}`,"dim");return L([O,{line:VI(OA(IA),U)},v],{no:B,total:0,visible:0,offset:0})}if(X.available===!1)return L([O,{line:VI(OA(i(` ${C.replyBodyMissing}`,"warn")),U)},v],{no:B,total:0,visible:0,offset:0});let V=[{line:VI(OA(i(` ${X.title}`,"heading")),U)},{line:VI(OA(i(` ${NI(C.replyDeclared,{from:X.from,at:X.at})}`,"dim")),U)},{line:VI(OA(i(` ${C.replyBodyHint} · ${X.bytes} B`,"dim")),U)}],j=X5(`reply:${B}`,X.display_text??"",U),h=Math.max(1,N-NS(V)),f=Math.max(0,j.length-h),c=Math.max(0,Math.min(f,Math.floor(I.view.replyScroll??0)||0)),e=[O,...V];for(let XA=c;XA<Math.min(j.length,c+h);XA++)e.push(j[XA]);return e.push(v),L(e,{no:B,total:j.length,visible:Math.min(h,Math.max(0,j.length-c)),offset:c})}function NS(I){return I.length+2}function ZS(I){if(!I.view.tui)return null;let{s:B,blocks:C,deg:D,width:J}=I,U=C.reply_summary,N=` ${B.replyLatest} `,X=[i(N,"heading")],L=[],O=bI(N);L.push({start:1,end:O,action:{kind:"page",page:5}});let T=U&&U.available&&U.state==="ok"?U.entry:void 0;if(!U||D.has("reply_summary"))X.push(i(B.dash,"dim"));else if(T&&T.available){let V=`#${T.no} ${T.title} · ${T.from}`;X.push(i(V,"text")),L.push({start:O,end:O+bI(V),action:{kind:"reply-open-latest",no:T.no}}),O+=bI(V);let j=` · ${T.at}`;X.push(i(j,"dim")),O+=bI(j)}else if(U.state==="empty")X.push(i(B.replyEmpty,"dim"));else{X.push(i(B.replyUnavailable,"warn"));let V=U.reason?`(${U.reason})`:"";if(V)X.push(i(V,"dim"))}let v=" [5] ";return L.push({start:O+1,end:O+1+bI(v),action:{kind:"page",page:5}}),X.push(i(v,"accent")),{id:"reply_summary",title:B.replyLatest,priority:9,lines:[QD(X,L,J)],summary:{line:VI(OA(i(` ${B.replyLatest}`,"heading")),J)}}}var UK=22,XS=2,qS=2,Bz=2,RS=Bz+6;function LS(I,B){if(B==="restart")return I.settingsBadgeRestart;if(B==="refuse")return I.settingsBadgeRefuse;return I.settingsBadgeApply}var zS="fixture-only: ";function VS(I){return String(I.route??"").startsWith(zS)}function $S(I){if(I==="restart")return"warn";if(I==="refuse")return"dim";return"text"}function wS(I,B){let C=I[`group_${B}`];return typeof C==="string"&&C.length>0?C:B}function vL(I,B){if(B==="explicit")return I.seatSourceExplicit;if(B==="policy")return I.seatSourcePolicy;if(B==="assignment")return I.seatSourceAssignment;if(B==="record")return I.seatSourceRecord;return B||I.dash}function v5(I,B,C){let D=[];if(!I||!Array.isArray(I.keys))return D;let J=String(B??"").trim().toLowerCase(),U=(...j)=>J===""||j.some((h)=>String(h??"").toLowerCase().includes(J)),N=I.keys.filter((j)=>!VS(j)&&U(l3(C,j.name),j.name,j.value,j.default,j.comment,j.warning,j.route??"")),X=[],L=null;for(let j of N){let h=String(j.group??"");if(!h){X.push(j);continue}if(h!==L)D.push({kind:"group",label:wS(C,h),tone:"heading"}),L=h;D.push({kind:"key",key:j})}if(X.length){D.push({kind:"group",label:C.settingsGroupUngrouped,tone:"heading"});for(let j of X)D.push({kind:"key",key:j})}let O=(I.models?.policy?.categories??[]).filter((j)=>U(NI(C.settingsCategoryRow,{category:j.category}),j.category,j.model));if(O.length){D.push({kind:"group",label:C.settingsGroupCategories,tone:"heading"});for(let j of O)D.push({kind:"category",category:j})}let T=(I.models?.assignments??[]).filter((j)=>U(j.agent,j.task,j.category,j.model,j.sid,j.selected_via,j.launch_via)),v=I.models?.pm_launch??{},V=Object.keys(v).length>0&&U(C.settingsPmLaunchLabel,String(v.model??""),String(v.mode??""),String(v.window??""));if(T.length||V){D.push({kind:"group",label:C.settingsGroupAssignments,tone:"heading"});for(let j of T)D.push({kind:"assignment",assignment:j});if(V)D.push({kind:"pm-launch",launch:v})}return D}function w1(I){return I.kind!=="group"}function BY(I,B,C,D,J){let U=J8(B,Math.max(6,J-UK-14));return C===""?OA(i(` ${U}`,D)):OA(i(` ${U} · `,"text"),i(C,D))}function WS(I,B,C,D){let{s:J}=I,U=B.known!==!1,N=B.set||B.value!==""?B.value===""?'""':B.value:NI(J.settingsUnset,{value:B.default||J.dash}),X=U?LS(J,B.class):J.settingsUnknownBadge,L=U?$S(B.class):"dim",O=OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(l3(J,B.name),UK),C?"selected":U?"heading":"dim"),...BY(I,N,X,L,D).map((v)=>v)),T=(B.warning||B.route||B.comment||"").trim();if(T)O.push(i(` ${J8(T,Math.max(8,D-bI(R0(O))-2))}`,B.warning?"warn":B.route&&!U?"warn":"dim"));return{line:O}}function yL(I,B){let C=0,D="";for(let J of String(I)){let U=G8(J);if(C+U>B)break;C+=U,D+=J}return D}function OS(I,B,C){let D=[],J=I;while(J!==""&&D.length<C){if(bI(J)<=B){D.push(J),J="";break}let U=yL(J,B);if(U==="")break;if(J.slice(U.length,U.length+1)!==""&&J.slice(U.length,U.length+1)!==" "){let N=U.lastIndexOf(" ");if(N>0)U=U.slice(0,N+1)}D.push(U),J=J.slice(U.length)}if(J!==""){let U=D[D.length-1]??"";D[D.length-1]=yL(U,Math.max(1,B-1))+"…"}return D}function jS(I,B,C,D){let{s:J}=I;return{line:OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(NI(J.settingsCategoryRow,{category:B.category}),UK),C?"selected":"heading"),...BY(I,B.model||J.dash,J.settingsCategoryBadge,"text",D).map((N)=>N))}}function PS(I,B,C,D){let{s:J}=I,U=OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(B.agent,UK),C?"selected":"heading"),...BY(I,B.assigned?B.model||J.dash:J.dash,J.settingsReadOnlyBadge,"dim",D).map((X)=>X)),N=B.assigned?NI(J.settingsAssignmentNote,{task:B.task||J.dash,category:B.category||J.dash,sid:B.sid||J.dash,selected:vL(J,B.selected_via),launch:vL(J,B.launch_via)}):B.record_present===!1?J.settingsAssignmentNone:J.settingsAssignmentUnreadable;return U.push(i(` ${J8(N,Math.max(8,D-bI(R0(U))-2))}`,B.assigned?"dim":"warn")),{line:U}}function TS(I,B,C,D){let{s:J}=I,U=OA(i(`${C?J.settingsCursor:" "} `,"accent"),i(sg(J.settingsPmLaunchLabel,UK),C?"selected":"heading"),...BY(I,B.model||J.dash,J.settingsReadOnlyBadge,"dim",D).map((X)=>X)),N=NI(J.settingsPmLaunchNote,{window:B.window||J.dash,mode:B.mode||J.dash,time:B.time||J.dash});return U.push(i(` ${J8(N,Math.max(8,D-bI(R0(U))-2))}`,"dim")),{line:U}}function SS(I,B,C){let J=B.filter(w1)[C];if(!J)return"";if(J.kind==="category")return NI(I.settingsCategoryHint,{category:J.category.category});if(J.kind==="assignment")return I.settingsAssignmentHint;if(J.kind==="pm-launch")return I.settingsPmLaunchHint;let U=J.key;if(U.known===!1)return NI(I.settingsUnknownHint,{key:U.name});if(U.class==="refuse")return I.settingsRefusedHint;if(String(U.kind??"")==="task-model-map")return I.settingsCategoryMapHint;return NI(I.settingsCliHint,{key:U.name})}function Ez(I){let{s:B,blocks:C,deg:D}=I,J=QY(I),U=(QA,yA)=>({id:"settings",full:!0,priority:1,separator:"none",title:B.settingsViewTitle,lines:QA,settings:yA,summary:{line:VI(OA(i(` ${B.settingsViewTitle}`,"heading")),I.width)}}),N=C.settings;if(D.has("settings")||!N||!Array.isArray(N.keys)||!N.keys.length)return U([QD(VI(OA(i(` ${B.settingsViewTitle}`,"heading"),i(" "),i(B.dash,"dim")),J),void 0,J)]);let X=v5(N,I.view.settingsFilter??"",B),L=0;for(let QA of X)if(w1(QA))L+=1;let O=Math.max(3,I.settingsRows??12),T=Math.max(0,Math.min(Math.max(0,L-1),I.view.settingsFocus??0)),v=I.view.settingsOffset,V=String(N.models?.diagnostic??"").split(`
352
352
  `).map((QA)=>QA.trim()).filter((QA)=>QA!==""),j=V.slice(0,XS),h=V.length-j.length,f=j.map((QA)=>OS(QA,Math.max(8,J-3),qS)),e=1+(f.length?f.reduce((QA,yA)=>QA+yA.length,0)+1+(h>0?1:0):0),XA=Math.max(1,Math.min(Math.max(1,L),Math.max(1,O-e))),IA=Math.max(0,L-XA),VA=Math.max(1,O-e-Bz),pA=[],_A=0;for(let QA of X){if(!w1(QA)){_A=1;continue}pA.push({heading:_A}),_A=0}let hA=(QA,yA)=>{let GA=0;for(let gI=QA;gI<Math.min(QA+yA,pA.length);gI+=1)GA+=1+pA[gI].heading;return GA},fA=(QA)=>{let yA=0;while(yA<XA&&QA+yA<pA.length&&hA(QA,yA+1)<=VA)yA+=1;return yA},TA=(QA)=>{let yA=QA;while(yA>0&&QA-yA+1<XA&&hA(yA-1,QA-yA+2)<=VA)yA-=1;return yA},uA,UI;if(v===void 0||v===null){if(uA=Math.max(0,Math.min(IA,T-Math.floor(XA/2))),UI=fA(uA),T>=uA+UI)uA=TA(T),UI=fA(uA)}else uA=Math.max(0,Math.min(Math.max(0,L-1),v)),UI=fA(uA);if(UI===0&&L>0)UI=1;let dA=(QA,yA)=>hA(QA,yA)+(QA>0?1:0)+(L>QA+yA?1:0);while(uA+UI<L&&UI<XA&&dA(uA,UI+1)+e<=O)UI+=1;let _I=I.view.choicePicker;if(_I){let QA=_I.entries,yA=Math.max(0,Math.min(Math.max(0,QA.length-1),_I.index)),GA=Math.max(1,O-RS-6),gI=Math.max(1,Math.min(QA.length,GA)),$A=Math.max(0,Math.min(Math.max(0,QA.length-gI),yA-Math.floor(gI/2))),qA=[],m=(CA)=>{qA.push({line:VI(CA,J)})},u=(CA)=>{let JA=CA.kind==="keep-unset"?B.settingsChoiceKeepUnset:CA.kind==="clear"?B.settingsChoiceClear:CA.kind==="free"?B.settingsChoiceFree:_I.kind==="bool"&&(CA.value==="1"||CA.value==="0")?CA.value==="1"?B.settingsBoolOn:B.settingsBoolOff:CA.value,cA=[];if(CA.kind==="current")cA.push(B.settingsChoiceCurrent);if(CA.kind==="default")cA.push(B.settingsChoiceDefault);if(CA.mark)cA.push(CA.mark==="exists"?B.settingsPathExists:CA.mark==="not-exec"?B.settingsPathNotExec:B.settingsPathMissing);return cA.length?`${JA} · ${cA.join(" · ")}`:JA};if(m(OA(i(_I.category?` ${NI(B.settingsCategoryPickerTitle,{category:_I.key})}`:` ${NI(B.settingsChoiceTitle,{label:l3(B,_I.key),key:_I.key})}`,"heading"))),_I.category)m(OA(i(` ${B.settingsCategoryPickerHint}`,"dim")));if(_I.interval)m(OA(i(` ${NI(B.settingsChoiceInterval,{min:_I.interval.min||"0",max:_I.interval.max||"∞"})}`,"dim")));if($A>0)m(OA(i(` ${NI(B.laneHiddenAbove,{n:String($A)})}`,"dim")));QA.forEach((CA,JA)=>{if(JA<$A||JA>=$A+gI)return;let cA=u(CA),OI=OA(i(`${JA===yA?B.settingsCursor:" "} `,"accent"),i(cA,JA===yA?"selected":CA.kind==="value"||CA.kind==="current"||CA.kind==="default"?"text":"dim")),$Q={kind:"choice-pick",index:JA},JQ=Math.max(2,Math.min(J,1+bI(R0(OI))));qA.push(QD(OI,I.view.tui?[{start:1,end:JQ,action:$Q}]:void 0,J))});let d=Math.max(0,QA.length-($A+gI));if(d>0)m(OA(i(` ${NI(B.laneHiddenBelow,{n:String(d)})}`,"dim")));m(OA(i(""))),m(OA(i(` ${_I.category?B.settingsCategoryPickerHint:B.settingsChoiceHint}`,"dim")));while(qA.length<O)m(OA(i("")));return U(qA,{focus:yA,offset:$A,visible:gI,count:QA.length})}let eI=[],vA=uA,rA=Math.max(0,L-(uA+UI)),t=(QA)=>{eI.push({line:VI(QA,J)})};if(vA>0)t(OA(i(` ${NI(B.laneHiddenAbove,{n:String(vA)})}`,"dim")));let DA=-1;for(let QA of X){if(w1(QA)){if(DA+=1,DA<uA||DA>=uA+UI)continue;let GA=DA===T,gI=QA.kind==="key"?WS(I,QA.key,GA,J):QA.kind==="category"?jS(I,QA.category,GA,J):QA.kind==="assignment"?PS(I,QA.assignment,GA,J):TS(I,QA.launch,GA,J),$A=GA?{kind:"settings-open",index:DA}:{kind:"settings-focus",index:DA},qA=Math.max(2,Math.min(J,1+bI(R0(gI.line))));eI.push(QD(gI.line,I.view.tui?[{start:1,end:qA,action:$A}]:void 0,J));continue}let yA=DA+1;if(yA<uA||yA>=uA+UI)continue;t(dL(QA.label,J,QA.tone))}if(rA>0)t(OA(i(` ${NI(B.laneHiddenBelow,{n:String(rA)})}`,"dim")));if(t(OA(i(` ${SS(B,X,T)}`,"dim"))),j.length){t(OA(i(` ${B.settingsDiagnosisHeading}`,"warn")));for(let QA of f)for(let yA of QA)t(OA(i(` ${yA}`,"warn")));if(h>0)t(OA(i(` ${NI(B.laneHiddenBelow,{n:String(h)})}`,"dim")))}while(eI.length<O)t(OA(i("")));return U(eI,{focus:T,offset:uA,visible:UI,count:L})}function _S(I,B){let C=I.tasks??[];if(!C.length)return null;let D=C.map((U)=>`${U.id} ${U.board}`);if((I.tasks_more??0)>0)D.push(`+${I.tasks_more}`);let J=OA(i(` ${D.join(" · ")}`,"dim"));return bD(J)<=B?{line:J}:null}function vS(I){let B=new Map;return I.map((C)=>{let D=B.get(C)??0;return B.set(C,D+1),D})}function yS(I,B,C,D){let J=I.view.focus;if(J&&J.lane===B){let U=Math.max(0,J.nth??0),N=C.findIndex((L,O)=>L===J.id&&D[O]===U);if(N>=0)return N;let X=C.indexOf(J.id);if(X>=0)return X;return 0}return-1}function Cz(I){if(I==="changes")return"change";if(I==="specs")return"spec";if(I==="decisions")return"decision";return"entry"}function y5(I,B,C,D){let J=C.filter((T)=>T.key!==null).map((T)=>T.key),U=vS(J),N=J.length?yS(I,B,J,U):-1,X=[],L=[],O=-1;for(let T of C){if(T.key===null){X.push({line:VI(T.content,D)});continue}O++;let v=U[O],V=O===N;L.push({lane:B,id:T.key,nth:v});let j=OA(V?i(`${HK} `,"selected"):i(" "),...T.content),h=V?{kind:"open-focused",lane:B}:{kind:"focus",lane:B,id:T.key,nth:v};X.push(QD(j,I.view.tui?[{start:0,end:bD(j),action:h}]:void 0,D))}return{lines:X,order:L}}function kS(I){let B=/^D([0-9]+)(?![0-9])/.exec(String(I).trim());return B?`D${B[1]}`:null}function hS(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.changes;if(!U)return null;if(D.has("changes")||!U.available)return{id:"changes",title:B.changesHeading,right:!0,priority:11,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};if(!U.changes.length)return null;let N=[];for(let O of U.changes){N.push({key:O.id,content:[i(sg(O.id,18),"accent"),i(NI(B.changeLine,{done:O.done,total:O.total,phase:rT(O.phase,B)}))]});let T=_S(O,J);if(T)N.push({key:null,content:T.line})}let{lines:X,order:L}=y5(I,"changes",N,J);return{id:"changes",title:NI(B.changesHeadingCount,{n:U.count}),right:!0,priority:11,lines:X,order:L,summary:{line:VI(OA(i(` ${NI(B.changesHeadingCount,{n:U.count})}`,"heading")),J)}}}function xS(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.specs;if(!U)return null;if(D.has("specs")||!U.available)return{id:"specs",title:B.specsHeading,right:!0,priority:13,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=(U.specs??[]).slice(0,6).map((T)=>({key:T.name,content:[i(sg(T.name,Math.max(8,J-10)),"text"),i(` ${T.requirements}`,"dim")]})),{lines:X,order:L}=y5(I,"specs",N,J),O=[{line:VI(OA(i(NI(B.specsCount,{specs:U.count,reqs:U.requirements}),"dim")),J)},...X];return{id:"specs",title:B.specsHeading,right:!0,priority:13,lines:O,order:L,summary:{line:VI(OA(i(` ${B.specsHeading}`,"heading")),J)}}}function fS(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.decisions;if(!U)return null;if(D.has("decisions"))return{id:"decisions",title:B.decisionsHeading,right:!0,priority:14,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=U.recent.slice(0,3).map((T)=>({key:kS(T),content:[i(T,"dim")]})),{lines:X,order:L}=y5(I,"decisions",N,J),O=[{line:VI(OA(i(NI(B.decisionsCountSuffix,{n:U.count}),"dim")),J)}];if(!U.recent.length)O.push({line:OA(i(` ${B.decisionsEmpty}`,"dim"))});return O.push(...X),{id:"decisions",title:B.decisionsHeading,right:!0,priority:14,lines:O,order:L,summary:{line:VI(OA(i(` ${B.decisionsHeading}`,"heading")),J)}}}function kL(I){let{s:B,blocks:C,deg:D,width:J,view:U}=I,N=C.outbox_list;if(!N&&!D.has("outbox_list"))return null;if(D.has("outbox_list")||!N)return{id:"queue",title:B.queueHeading,priority:10,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};if(U.viewEntry!=null&&N.entries[U.viewEntry]){let O=N.entries[U.viewEntry],T=[{line:VI(OA(i(` ${NI(B.queueMeta,{kind:O.kind,target:O.target,from:O.from})}`,"dim")),J)},{line:OA(i(" "))}];for(let v of String(O.text??"").split(`
353
353
  `))for(let V of bS(v,Math.max(4,J-2)))T.push({line:VI(OA(i(` ${V}`)),J)});return T.push({line:OA(i(""),i(` ${B.queueBackHint}`,"dim"))}),{id:"queue",title:NI(B.queueFullHeading,{name:O.name}),priority:10,lines:T,summary:{line:VI(OA(i(` ${NI(B.queueFullHeading,{name:O.name})}`,"heading")),J)}}}if(!N.entries.length)return{id:"queue",title:B.queueHeading,priority:10,lines:[{line:OA(i(` ${B.queueEmpty}`,"dim"))}]};let X=[],L=N.impediments??[];if(N.impeded&&N.impeded>0){let O=Array.from(new Set(L.map((T)=>T.reason))).join(" · ")||B.dash;X.push({line:VI(OA(i(` ${NI(B.queueImpededLine,{n:N.impeded,reasons:O})}`,"warn")),J)});for(let T of L.slice(0,3)){let v=T.diagnostic==="available"&&T.last_observed?T.last_observed:B.queueImpededUnavailable;X.push({line:VI(OA(i(NI(B.queueImpededItem,{entry:T.entry,reason:T.reason,when:v}),"warn")),J)})}}if(N.entries.slice(0,20).forEach((O,T)=>{let v=O.state==="held"?B.queueStateHeld:B.queueStateQueued,V=OA(i(" "),i(NI(B.queueLine,{index:T+1,state:v,name:O.name,age:K5(O.age_s)}),O.state==="held"?"warn":"text"),O.reason&&O.reason!=="-"?i(` ${NI(B.queueHeldReason,{reason:O.reason})}`,"dim"):null),j=QD(V,U.tui?[{start:2,end:2+bI(R0(V)),action:{kind:"view-entry",index:T}}]:void 0,J);X.push(j)}),I.view.tui)X.push({line:OA(i(` ${B.queueViewHint}`,"dim"))});return{id:"queue",title:NI(B.queueHeadingCount,{queued:N.queued,held:N.held}),priority:10,lines:X,summary:{line:VI(OA(i(` ${NI(B.queueHeadingCount,{queued:N.queued,held:N.held})}`,"heading")),J)}}}function bS(I,B){if(!I)return[""];let C=[],D="";for(let J of String(I))if(D&&bI(D+J)>B)C.push(D),D=J;else D+=J;return C.push(D),C}function hL(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.inbox;if(!U)return null;if(D.has("inbox"))return{id:"inbox",title:B.inboxHeading,right:!0,priority:11,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};if(!U.agents.length)return null;let N=[];for(let X of U.agents.slice(0,8))N.push({line:VI(OA(i(" "),i(sg(X.agent,10),"accent"),i(NI(B.inboxLine,{inbox:X.inbox_lines,thread:X.thread_lines,age:K5(X.inbox_age_s)}),"dim")),J)});return{id:"inbox",title:B.inboxHeading,right:!0,priority:11,lines:N,summary:{line:VI(OA(i(` ${B.inboxHeading}`,"heading")),J)}}}function xL(I){let{s:B,blocks:C,deg:D,width:J,view:U}=I,N=C.patrol;if(!N)return null;if(D.has("patrol"))return{id:"patrol",title:B.patrolHeading,right:!0,priority:12,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};if(!N.lines.length)return null;let X=[];for(let L of N.lines.slice(-12).slice(Math.max(0,U.scroll)))X.push({line:VI(OA(i(` ${L}`,"dim")),J)});return{id:"patrol",title:B.patrolHeading,right:!0,priority:12,lines:X,summary:{line:VI(OA(i(` ${B.patrolHeading}`,"heading")),J)}}}function fL(I){let{s:B,panel:C,deg:D,width:J}=I,U=C.capacity;if(!U||D.has("capacity"))return null;let N=F5(U.spark,Math.max(8,J-8));if(!N)return null;return{id:"trend",title:B.trendHeading,right:!0,priority:13,lines:[{line:OA(i(NI(B.trendLine,{mb:R1(U.ram_avail_mb),swap:R1(U.swap_free_mb)}),"dim"))},{line:VI(OA(i(" "),i(N,"accent")),J)}],summary:{line:VI(OA(i(` ${B.trendHeading}`,"heading")),J)}}}function bL(I){let{s:B,blocks:C,deg:D,width:J}=I,U=C.health;if(!U)return null;if(D.has("health"))return{id:"health",title:B.healthHeading,right:!0,priority:14,lines:[{line:OA(i(` ${B.dash}`,"dim"))}]};let N=U.doctor==="ok"?B.healthDoctorOk:U.doctor==="warn"?B.healthDoctorWarn:U.doctor==="fail"?B.healthDoctorFail:B.healthDoctorNA,X=U.doctor==="ok"?"ok":U.doctor==="fail"?"err":"warn";return{id:"health",title:B.healthHeading,right:!0,priority:14,lines:[{line:VI(OA(i(NI(B.healthLine,{version:U.version||B.dash,doctor:N,gates:U.gates||B.dash}),U.doctor==="ok"?"text":X)),J)}]}}function mS(I){let{s:B}=I;if(I.view.page!==4||I.view.detail||I.view.overlay||I.view.settings)return null;let C=I.blocks.board?.rows??[];if(!C.length)return null;let D=O1(C,uJ(C,I.view.focus));if(!D)return null;if(I.twoColumn&&S5(I.view,D.state,!M8(C,D.state).length)){let U=`${e3(D.state,B)} ${M8(C,D.state).length}`;return{full:U,phase:U}}let J=D.phase&&D.phase!=="-"?D.phase:B.dash;return{full:`${D.agent} · ${J}`,phase:J}}function o3(I,B=!0){let{s:C,width:D}=I,J=[{text:C.keyCompose,action:{kind:"compose"}},{text:C.keyFlush,action:{kind:"flush"}},{text:C.keyStandby,action:{kind:"standby"}},{text:C.keySettings,action:{kind:"settings"}}],U=I.view.settings?I.view.choicePicker?[{text:C.keyRows,action:{kind:"choice-move",delta:1}},{text:C.keyOpen,action:{kind:"choice-pick",index:-1}},{text:C.keyDetailClose,action:{kind:"choice-close"}}]:[{text:C.keyRows,action:{kind:"settings-scroll",delta:1}},{text:C.keyOpen,action:{kind:"settings-open",index:-1}},{text:C.keyFilter,action:{kind:"settings-filter"}},{text:C.keyDetailClose,action:{kind:"settings-close"}}]:I.view.detail?[{text:C.keyDetailClose,action:{kind:"detail-close"}},{text:C.keyDetailTabs,action:{kind:"detail-tab-move",delta:1}},{text:C.keyDetailScroll,action:{kind:"detail-scroll",delta:1}},{text:C.keyPages,action:{kind:"page-cycle"}}]:I.view.page===2&&B?[{text:C.keyRows,action:{kind:"card-move",delta:1}},{text:C.keyOpen,action:{kind:"open-focused",lane:"todo"}},{text:C.keyPages,action:{kind:"page-cycle"}},{text:C.keyQuit,action:{kind:"quit"}}]:I.view.page===5?I.view.replyBody?[{text:C.keyDetailScroll,action:{kind:"reply-scroll",delta:1}},{text:C.keyDetailClose,action:{kind:"reply-close"}},{text:C.keyPages,action:{kind:"page-cycle"}}]:[{text:C.keyReplies,action:{kind:"reply-page",dir:-1}},{text:C.keyOpen,action:{kind:"reply-open"}},{text:C.keyReplyReset,action:{kind:"reply-reset"}},{text:C.keyPages,action:{kind:"page-cycle"}},{text:C.keyQuit,action:{kind:"quit"}}]:I.view.page===4?[{text:C.keyLanes,action:{kind:"lane-move",delta:1}},{text:C.keyCards,action:{kind:"card-move",delta:1}},{text:C.keyFold,action:{kind:"lane-fold",lane:uJ(I.blocks.board?.rows??[],I.view.focus)?.lane??""}},{text:C.keyOpen,action:{kind:"open-focused",lane:uJ(I.blocks.board?.rows??[],I.view.focus)?.lane??"todo"}},{text:C.keyPages,action:{kind:"page-cycle"}},{text:C.keyQuit,action:{kind:"quit"}}]:[{text:C.keyPages,action:{kind:"page-cycle"}},{text:C.keyScroll,action:{kind:"scroll",delta:1}},{text:C.keyQuit,action:{kind:"quit"}}],N=[],X=[],L=1,O=W1(I),T=(V,j,h,f)=>{if(h){let c=` ${V} `,e=L;if(N.push(i("(","dim"),i(c,"accent"),i(")","dim")),L+=bI(`(${c})`),I.view.tui)X.push({start:e,end:L,action:j})}else{let c=L;if(N.push(i(V,f?"dim":"accent")),L+=bI(V),I.view.tui)X.push({start:c,end:L,action:j})}};J.forEach((V,j)=>{if(j>0)if(O)N.push(i(" ","dim")),L+=1;else N.push(i(" · ","dim")),L+=3;T(V.text,V.action,O,!1)}),U.forEach((V)=>{N.push(i(" · ","dim")),L+=3,T(V.text,V.action,!1,O)});let v=mS(I);if(v){let V=D-L,j=bI(v.full)<=V?v.full:bI(v.phase)<=V?v.phase:"";if(j)N.push(i(" ".repeat(V-bI(j)),"dim"),i(j,"dim")),L+=V}return{id:"keys",full:!0,priority:99,lines:[QD(OA(i(" "),...N),X,D)],separator:"none"}}function uS(I){if(!I.view.tui)return null;let{s:B}=I,C=[],D=[],J=1,U=[{page:1,text:B.pageOverview,short:B.pageOverviewShort},{page:2,text:B.pageWork,short:B.pageWorkShort},{page:3,text:B.pageMessages,short:B.pageMessagesShort},{page:4,text:B.pageBoard,short:B.pageBoardShort},{page:5,text:B.pageReplies,short:B.pageRepliesShort}],N=W1(I),X=U.map((O)=>NI(B.pageTab,{name:O.text})).join(" "),L=bI(X)>I.width;for(let O of U){let T=I.view.page===O.page,v=L?`${O.page}${O.short}`:O.text,V=T?N?`[${v}]`:NI(B.pageTabActive,{name:v}):NI(B.pageTab,{name:v}),j=J;C.push(i(V,T?"accent":"dim")),J+=bI(V),D.push({start:j,end:J,action:{kind:"page",page:O.page}}),C.push(i(" ")),J+=1}return{id:"tabs",full:!0,priority:0.5,lines:[QD(OA(i(" "),...C),D,I.width)],separator:"none"}}function pS(I){let{s:B,input:C}=I,D=C.view;return[{pref:"lang",label:B.prefLang,value:D.lang==="zh"?B.langNameZh:B.langNameEn},{pref:"defaultPage",label:B.prefDefaultPage,value:dS(D.page,B)},{pref:"activity",label:B.prefActivity,value:C.activity?B.toggleOn:B.toggleOff},{pref:"mouse",label:B.prefMouse,value:D.mouseOn?B.toggleOn:B.toggleOff},{pref:"density",label:B.prefDensity,value:D.density==="compact"?B.densityCompact:B.densityComfortable},{pref:"",label:B.prefProjectSettings,value:B.prefNavArrow}]}function dS(I,B){return I===1?B.pageOverview:I===2?B.pageWork:I===3?B.pageMessages:I===4?B.pageBoard:B.pageReplies}var mL=4,P5=2,cS=4;function lS(I){let B=Math.max(1,I.width-(W1(I)?cS:0)),C=Math.max(1,Math.min(OL,B-mL-P5-1));return{keyW:C,valueW:Math.max(1,B-mL-C-P5)}}function iS(I){let{s:B,width:C}=I,D=pS(I),{keyW:J,valueW:U}=lS(I),N=[];return D.forEach((X,L)=>{let O=OA(i(` ${L===I.view.overlayIndex?B.settingsCursor:" "} `,"accent"),i(sg(X.label,J),"heading"),i(" ".repeat(P5)),i(J8(X.value,U)));N.push(QD(O,I.view.tui?[{start:2,end:2+bI(R0(O)),action:X.pref?{kind:"toggle",pref:X.pref}:{kind:"settings-open-view"}}]:void 0,C))}),N.push({line:OA(i(""))}),N.push({line:VI(OA(i(` ${B.settingsHint}`,"dim")),C)}),{id:"overlay",title:B.settingsTitle,full:!0,priority:0,lines:N,separator:"none"}}function aS(I){let B=()=>I.twoColumn?{...I,width:I.leftWidth}:I,C=()=>I.twoColumn?{...I,width:I.rightWidth}:I,D=[mT(I),uS(I)];if(I.view.settings){let J=Ez(I);return[...D.filter((U)=>U!==null),...J?[J]:[],o3(I)]}if(I.view.overlay)return[...D.filter((J)=>J!==null),iS(I),o3(I)];switch(I.view.page){case 1:D.push(uT(I),pT(I),dT(I),ZS(I),cT(I),lT(B()),aT(C()),nT(C()));break;case 2:D.push(I.view.detail?j5(I):iL(B()),...I.view.detail?[]:[hS(C()),xS(C()),fS(C())]);break;case 3:D.push(kL(B()),hL(C()),xL(C()),fL(C()),bL(C()));break;case 4:D.push(I.view.detail?j5(I):eL(I));break;case 5:D.push(I.view.replyBody?Qz(I):Iz(I));break;default:D.push(kL(B()),hL(C()),xL(C()),fL(C()),bL(C()));break}return D.push(o3(I)),D.filter((J)=>J!==null)}function j1(I){let B=Math.max(1,Math.floor(I.width)||1),C=Math.floor(I.height)||0,D=B<TT,J=B>=PT,U=B>=jT,N=J?Math.max(16,Math.floor((B-U8)*(U?ST:_T))):B,X=J?Math.max(8,B-N-U8):B,L={s:I.strings,input:I,width:B,minimal:D,compact:I.view.density==="compact",twoColumn:J,leftWidth:N,rightWidth:X,deg:new Set(I.degraded??[]),panel:I.panel,blocks:I.blocks??{},view:I.view,activity:I.activityBlocks??[]},O=aS(L),T=O.find((t)=>t.id==="title")??O[0],v=O[O.length-1],V=O.slice(1,-1),j=[],h=(t)=>{for(let DA of t)j.push(DA)};h(T.lines);let f=C>0?Math.max(0,C-T.lines.length-v.lines.length):Number.POSITIVE_INFINITY,c=V.filter((t)=>t.full),e=V.filter((t)=>!t.full&&!t.right),XA=V.filter((t)=>!t.full&&t.right),IA=W1(L),VA=[],pA=(t,DA,QA,yA)=>{let GA=kT(t,DA,IA);if(GA===null)return[];if(GA==="summary")return[hT(t,QA)];if(t.order&&yA)yA.push(...t.order);return yT(t,QA,GA)},_A=[],hA,fA,TA,uA,UI;for(let t of c){let DA=C>0&&t.id==="kanban"?eL({...L,laneRows:Math.max(1,f-_A.length-t3-eT)})??t:C>0&&t.id==="detail"?j5({...L,detailRows:Math.max(2,f-_A.length-(IA?2:0))})??t:C>0&&t.id==="settings"?Ez({...L,settingsRows:Math.max(3,f-_A.length-(IA?2:0))})??t:C>0&&t.id==="reply_list"?Iz({...L,replyRows:Math.max(2,f-_A.length-(IA?2:0))})??t:C>0&&t.id==="reply_viewer"?Qz({...L,replyDocRows:Math.max(2,f-_A.length-(IA?2:0))})??t:t;if(DA.id==="kanban"&&DA.lanes)hA=DA.lanes;if(DA.id==="detail"&&DA.detail)fA=DA.detail;if(DA.id==="settings"&&DA.settings)TA=DA.settings;if(DA.id==="reply_list"&&DA.replyList)uA=DA.replyList;if(DA.id==="reply_viewer"&&DA.replyDoc)UI=DA.replyDoc;let QA=pA(DA,f-_A.length,B,null);for(let yA of QA)_A.push(yA)}h(_A);let dA=f===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,f-_A.length);if(dA>0)if(J){let t=N,DA=X,QA=($A)=>{VA=[];let qA=[[],[]],m=[...$A.filter((u)=>!u.right).map((u)=>({b:u,slot:0})),...$A.filter((u)=>u.right).map((u)=>({b:u,slot:1}))].sort((u,d)=>u.b.priority-d.b.priority);for(let{b:u,slot:d}of m){let CA=d===0?t:DA,JA=qA[d].length,cA=pA(u,dA-JA,CA,VA);for(let OI of cA)qA[d].push(OI)}return qA},yA=[...e,...XA],GA=QA(yA);if(C>0){let $A=yA.find((JA)=>JA.id==="board"),qA=$A?sT(L):0,m=$A?.right?1:0,u=Math.max(GA[0].length,Math.max(GA[1].length,dA)),d=Math.min(qA,Math.max(0,u-GA[m].length));if($A&&d>0){let JA=iL({...L,width:$A.right?DA:t,boardDoneKeep:Math.max(1,L.boardDoneKeep??T5)+d});if(JA)yA=yA.map((cA)=>cA===$A?JA:cA),GA=QA(yA)}let CA=Math.max(GA[0].length,GA[1].length);for(let JA of[0,1]){let cA=GA[JA],OI=JA===0?t:DA,$Q=CA-cA.length,JQ=cA[cA.length-1];if($Q<=0||!JQ)continue;if(R0(JQ.line)!==R0(r3(OI)))continue;cA.pop();for(let qI=0;qI<$Q;qI++)cA.push(mJ({line:[]},OI));cA.push(JQ)}}let gI=Math.min(dA,Math.max(GA[0].length,GA[1].length));for(let $A=0;$A<gI;$A++){let qA=GA[0][$A],m=GA[1][$A];if(qA&&m){let u={line:[...uL(qA.line,t),i(" "),...m.line].map((d)=>({...d})),hits:[...qA.hits??[],...(m.hits??[]).map((d)=>({...d,start:d.start+t+U8,end:d.end+t+U8}))]};j.push(u)}else if(qA)j.push(qA);else if(m)j.push({line:[i(" ".repeat(t+U8)),...m.line],hits:(m.hits??[]).map((u)=>({...u,start:u.start+t+U8,end:u.end+t+U8}))})}}else{let t=B,DA=0;VA=[];let QA=[...e,...XA].sort((yA,GA)=>yA.priority-GA.priority);for(let yA of QA){let GA=pA(yA,dA-DA,t,VA);for(let gI of GA)j.push({line:VI(gI.line,t),hits:gI.hits});DA+=GA.length}if(C>0){let yA=Math.max(0,C-v.lines.length-j.length),GA=j[j.length-1];if(yA>0&&GA&&R0(GA.line)===R0(r3(t))){j.pop();for(let gI=0;gI<yA;gI++)j.push(mJ({line:[]},t));j.push(GA)}}}let _I=L.view.page===2&&!L.view.detail&&!L.view.overlay&&!VA.length?o3(L,!1):v;if(C>0&&j.length+_I.lines.length>C){let t=Math.max(0,C-_I.lines.length);j.length=Math.min(j.length,t)}if(C>0&&j.length+_I.lines.length<C){let t=C-_I.lines.length-j.length;for(let DA=0;DA<t;DA++)j.push({line:[]})}h(_I.lines);let eI=j.slice(0,C>0?C:j.length),vA=[];return{rows:eI.map((t,DA)=>{if(t.hits?.length){let QA=bD(t.line)>B?Math.max(0,B-1):B;for(let yA of t.hits){let GA=Math.min(yA.start,QA),gI=Math.min(yA.end,QA);if(gI>GA)vA.push({row:DA,hit:{...yA,start:GA,end:gI}})}}return VI(t.line,B)}),targets:vA,...hA?{lanes:hA}:{},...fA?{detail:fA}:{},...uA?{replyList:uA}:{},...UI?{replyDoc:UI}:{},...TA?{settings:TA}:{},...VA.length?{boardOrder:VA}:{}}}function gz(I){let B="";for(let C of I)B+=`${C.tone}\x00${C.text}\x01`;return B}function EY(I){return I.rows.map((B)=>R0(B).replace(/\s+$/,""))}function Dz(I,B,C={}){let D=C.color!==!1,J=C.truecolor!==!1;if(!D)return EY(I);return I.rows.map((U)=>U.map((N)=>{if(!N.text)return N.text;return`\x1B[${SL(N.tone,B,J)}m${N.text}\x1B[0m`}).join(""))}function Gz(I,B){return{panel:{...I.panel,refresh_s:B},activity:I.activity?I.activityBlocks:[]}}var Kz="draft.md",x5="> ",Jz=" ";function Hz(I){let B=/(?:\u001b)?\[200~/.exec(I),C=/(?:\u001b)?\[201~/.exec(I);if(!B&&!C)return{body:null,open:!1,close:!1};let D="";if(B){let U=I.slice((B.index??0)+B[0].length),N=C?U.indexOf(C[0]):-1;return D=N>=0?U.slice(0,N):U,{body:D,open:!0,close:C!==null||N>=0}}let J=C?I.indexOf(C[0]):-1;return D=J>=0?I.slice(0,J):I,{body:D,open:!1,close:C!==null}}function P1(I){return String(I??"").replace(/\r\n/g,`
354
354
  `).replace(/\r/g,`
@@ -344,7 +344,7 @@ export const en = {
344
344
  label_TEAM_AGENT_MEM_MB: 'Seat memory cap',
345
345
  label_TEAM_NOTIFY_TMUX: 'tmux delivery',
346
346
  label_TEAM_NOTIFY_DEDUP_SEC: 'Notify dedup window',
347
- label_TEAM_INBOX_MAX_CHARS: 'Inbox summary chars',
347
+ label_TEAM_INBOX_MAX_CHARS: 'Preview chars',
348
348
  label_TEAM_NOTIFY_LOG: 'Notify debug log',
349
349
  label_TEAM_NOTIFY_DETAIL_MAX: 'Notify detail bound',
350
350
  label_TEAM_DEFER_TTL: 'Queued delivery TTL',
@@ -342,7 +342,7 @@ export const zh = {
342
342
  label_TEAM_AGENT_MEM_MB: '席位内存上限',
343
343
  label_TEAM_NOTIFY_TMUX: '走 tmux 投递',
344
344
  label_TEAM_NOTIFY_DEDUP_SEC: '通知去重窗口',
345
- label_TEAM_INBOX_MAX_CHARS: '收件箱摘要字数',
345
+ label_TEAM_INBOX_MAX_CHARS: '预览字数',
346
346
  label_TEAM_NOTIFY_LOG: '通知调试日志',
347
347
  label_TEAM_NOTIFY_DETAIL_MAX: '通知明细条数上限',
348
348
  label_TEAM_DEFER_TTL: '排队过期时间',