nx-kv 0.68.2 → 0.68.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{a as e,d as t,f as n,h as r,l as i,n as a,r as o,t as s}from"./popup-BdVXUaJk.js";import{D as c}from"./repo-form-modal-awEPCcJK.js";import{n as l}from"./app-context-KCsdqNTq.js";import{l as u}from"./task-status-Cjsm0xF7.js";import{d,f,s as p}from"./md-history-BR2jLhFQ.js";import{t as m}from"./button-BRGGaUcY.js";import{S as h,h as g,w as _,x as v}from"./index-Bs5BehN8.js";import{t as y}from"./graph-BTEfvFz6.js";import{c as b,d as x,f as S,g as C,l as w,m as T,n as E,p as D,r as O,s as ee,t as te,u as ne}from"./reopen-text-C3dnqygC.js";import{n as k}from"./template-preview-CjQ-ucPt.js";import{a as A}from"./manage-session-CuaL7QqQ.js";import{t as re}from"./bar-DEY9q8mI.js";var j=r(n(),1),M=t(),N=10;function ie({repo:e,onClose:t,onSaved:n}){let r=l(),a=i(),o=e.getLoop&&typeof e.getLoop==`object`?e.getLoop:null,[u,d]=(0,j.useState)(!!(o&&o.enabled)),[f,p]=(0,j.useState)(o&&o.waitMinutes!==void 0&&o.waitMinutes!==null?String(o.waitMinutes):String(N)),[h,g]=(0,j.useState)(!1),_=e=>{let t=String(e??``).trim();if(t===``)return N;let n=Number(t);return Number.isFinite(n)&&n>=0?Math.min(Math.floor(n),600):N},v=async t=>{let i=String(e.id??``);g(!0);try{let o=t&&t.enabled!==void 0?t.enabled:u;await c(i,{"get-loop":o?`on`:`off`,...o?{"get-loop-minutes":_(f)}:{}});let s=_(f);a(o?`已保存「${e.name}」的持续 get 设置(${s>0?`${s} 分钟阻塞窗口`:`不阻塞,没活立即返回`})`:`已关闭「${e.name}」的持续 get`),r.refreshRepos&&r.refreshRepos(),n&&n()}catch(e){a(String(e.message||e))}finally{g(!1)}},y=async e=>{d(e),await v({enabled:e})};return(0,M.jsx)(s,{title:`持续 get · ${e.name}`,onClose:t,size:`md`,children:(0,M.jsxs)(`div`,{className:`rp-gl`,children:[(0,M.jsxs)(`div`,{className:`rp-gl-head`,children:[(0,M.jsxs)(`div`,{className:`rp-gl-title`,children:[(0,M.jsx)(`span`,{className:`rp-gl-name`,children:`持续 get`}),(0,M.jsx)(`span`,{className:`rp-gl-desc`,children:`无任务时阻塞等待新任务回填(waitgoal)`})]}),(0,M.jsxs)(`button`,{className:`toggle`+(u?` on`:``),onClick:()=>y(!u),disabled:h,children:[(0,M.jsx)(`span`,{className:`dot`}),u?`开`:`关`]})]}),u&&(0,M.jsxs)(`div`,{className:`rp-gl-body`,children:[(0,M.jsxs)(`div`,{className:`rp-gl-row`,children:[(0,M.jsx)(`span`,{children:`阻塞窗口`}),(0,M.jsxs)(`span`,{className:`rp-gl-unit`,children:[(0,M.jsx)(`input`,{className:`rp-gl-min`,value:f,onChange:e=>p(e.target.value),inputMode:`numeric`,title:`0 = 不阻塞:没任务时 get 立即返回 timeout`}),`分钟`]})]}),(0,M.jsx)(`div`,{className:`rp-gl-note`,children:`这里只决定没有任务时 get 最多阻塞多久(0 = 不阻塞,立即返回 timeout)。领到任务后那段「继续 get 直到 timeout」的提示词是全局的,只有一份:要改文案去 设置 → 提示词模板 → 持续 get。`}),(0,M.jsxs)(`div`,{className:`rp-gl-acts`,children:[(0,M.jsx)(`span`,{className:`spacer`}),(0,M.jsx)(m,{variant:`primary`,disabled:h,onClick:()=>v(),children:`保存持续 get 设置`})]})]})]})})}var P=s,F=(e,t,n)=>y(e=>n.get(Number(e))||[],e,t);function I({task:e,tasks:t,onClose:n,onSave:r}){let i=e=>Number(e.id),a=i(e),o=t.filter(e=>i(e)!==a),[s,c]=(0,j.useState)(!!e.blocksFollowing),[l,d]=(0,j.useState)(()=>new Set((e.blockBy||[]).map(Number))),[f,p]=(0,j.useState)(()=>new Set(o.filter(e=>(e.blockBy||[]).map(Number).includes(a)).map(i))),[m,h]=(0,j.useState)(!1),g=t.findIndex(e=>i(e)===a),_=t.slice(g+1).map(i),v=new Map(t.map(e=>[i(e),i(e)===a?[...l]:(e.blockBy||[]).map(Number)])),y=e=>s||!l.has(i(e))&&F(i(e),a,v),b=e=>!f.has(i(e))&&F(a,i(e),v),x=e=>t=>e(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}),S=()=>c(e=>(e||d(new Set),!e)),C=async()=>{h(!0);try{let e=[{id:a,gate:s,blockBy:[...l]}];if(!s)for(let t of o){let n=i(t),r=f.has(n),o=(t.blockBy||[]).map(Number);r!==o.includes(a)&&e.push({id:n,blockBy:r?[...o,a]:o.filter(e=>e!==a)})}await r(e),n()}catch{}finally{h(!1)}},w=(e,t,n,r)=>{let a=u(e.text)||`#${i(e)}`;return(0,M.jsxs)(`label`,{className:`mdw-dag-item`,title:n&&!m?`会造成循环依赖或与闸门约束冲突,已禁用`:void 0,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:t,disabled:m||n,onChange:()=>r(i(e))}),(0,M.jsxs)(`span`,{className:`mono faint`,children:[`#`,i(e)]}),(0,M.jsx)(`span`,{className:`mdw-dag-name`,children:a})]},i(e))};return(0,M.jsx)(P,{title:`编排 · #${a} ${u(e.text)||``}`,onClose:n,busy:m,size:`md`,footer:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:m,onClick:n,children:`取消`}),(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:m,onClick:C,children:m?`保存中…`:`保存编排`})]}),children:(0,M.jsxs)(`div`,{className:`mdw-dag`,children:[(0,M.jsxs)(`label`,{className:`mdw-dag-item mdw-dag-gate`,title:`闸门:本任务未完成前,队列里排在后面的全部待领取任务都不能被领取`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:s,disabled:m,onChange:S}),(0,M.jsx)(`b`,{children:`闸门`}),(0,M.jsx)(`span`,{className:`mdw-dag-hint`,children:`挡住队列里所有排在后面的待领取任务(闸门不声明上游依赖)`})]}),s?(0,M.jsxs)(`div`,{className:`mdw-dag-note`,children:[`开启时自动挡住 `,_.length,` 个后续任务`,_.length?`:${_.map(e=>`#${e}`).join(`, `)}`:`(后面已没有待领取任务)`]}):null,(0,M.jsxs)(`div`,{className:`mdw-dag-sec`,children:[`上游依赖(我等谁完成)`,s?(0,M.jsx)(`span`,{className:`mdw-dag-hint`,children:`—— 闸门开启时不声明上游,保存后已清空`}):null]}),(0,M.jsx)(`div`,{className:`mdw-dag-list`+(s?` dim`:``),children:o.length?o.map(e=>w(e,l.has(i(e)),y(e),x(d))):(0,M.jsx)(`div`,{className:`mdw-dag-note`,children:`队列里没有其他待领取任务`})}),(0,M.jsxs)(`div`,{className:`mdw-dag-sec`,children:[`下游任务(谁被我挡)`,s?(0,M.jsx)(`span`,{className:`mdw-dag-hint`,children:`—— 闸门开启时此表不生效,自动挡住全部后续`}):null]}),(0,M.jsx)(`div`,{className:`mdw-dag-list`+(s?` dim`:``),children:o.length?o.map(e=>w(e,f.has(i(e)),s||b(e),x(p))):(0,M.jsx)(`div`,{className:`mdw-dag-note`,children:`队列里没有其他待领取任务`})}),(0,M.jsx)(`div`,{className:`mdw-dag-note`,children:`保存会同时改写相关任务的依赖(逐条落盘);勾选会成环的组合会被禁用。`})]})})}function L(e,t,n){if(!k(e?.body).length||!e?.id)return!1;let r=A({...t,templateId:String(e.id)});return n.onNavigate?.(`#/templates/fill/${r}`),!0}function ae(e,t){let n=Array.isArray(e)?e:[],[r,i]=(0,j.useState)(0),a=Math.max(1,Number(t)||1),o=Math.max(1,Math.ceil(n.length/a)),s=Math.min(Math.max(0,r),o-1),c=s*a;return{page:s,pageCount:o,total:n.length,items:n.slice(c,c+a),setPage:i}}function oe({page:e=0,pageCount:t=1,total:n=0,onPage:r,unit:i=`条`}){let a=e=>r&&r(Math.max(0,Math.min(e,t-1)));return t<=1?(0,M.jsxs)(`span`,{className:`pager-n`,children:[`共 `,n,` `,i]}):(0,M.jsxs)(`span`,{className:`pager`,children:[(0,M.jsx)(`button`,{type:`button`,className:`pager-btn`,disabled:e<=0,onClick:()=>a(e-1),"aria-label":`上一页`,title:`上一页`,children:`‹`}),(0,M.jsxs)(`span`,{className:`pager-n`,children:[`第 `,e+1,`/`,t,` 页 · 共 `,n,` `,i]}),(0,M.jsx)(`button`,{type:`button`,className:`pager-btn`,disabled:e>=t-1,onClick:()=>a(e+1),"aria-label":`下一页`,title:`下一页`,children:`›`})]})}function se({icon:t=`list`,title:n,pendingCount:r=0,headerExtra:i=null,children:a=null,emptyText:o=``}){let s=Array.isArray(a)?a.length>0:!!a;return(0,M.jsxs)(`div`,{className:`rp-tasks`,children:[(0,M.jsxs)(`div`,{className:`rp-tasks-h`,children:[(0,M.jsx)(e,{name:t,size:13}),` `,n,r>0&&(0,M.jsxs)(`span`,{className:`rp-chip-count`,children:[`待领取 `,r]}),i]}),a,!s&&o?(0,M.jsx)(`div`,{className:`rp-proj-none muted`,children:o}):null]})}function ce({name:t,counts:n=[],icon:r=`folder`,actions:i=null,intro:a=null,batch:o=null,list:s=null,footer:c=null,extra:l=null}){return(0,M.jsxs)(`div`,{className:`rp-page`,children:[(0,M.jsxs)(`div`,{className:`rp-group-head`,children:[(0,M.jsxs)(`h2`,{children:[(0,M.jsx)(e,{name:r,size:15}),` `,t,n.map((e,t)=>{let n=typeof e==`string`?e:e&&e.text||``;return n?(0,M.jsx)(`span`,{className:`rp-chip-count`,children:n},t):null})]}),i?(0,M.jsx)(`div`,{className:`rp-group-acts`,children:i}):null]}),a,o,s,c,l]})}function R(e){let t=String(e||``).trim();if(!t)return`—`;let n=t.match(/^(\d{4}-\d{2}-\d{2})[ T](\d{2}:\d{2})/),r=n?.[1],i=n?.[2];return r&&i?`${r.slice(5)} ${i}`:t.slice(0,16)}function le({t,projectTag:n=``,projectTitle:r=``,selectable:i=!1,picked:a=!1,onTogglePick:o,draggable:s=!1,dragHandlers:c=null,dragVisual:l,onOpen:u,showTimes:f=!1,downs:m=[],history:h=!1,ops:g=null,searchCtx:v=null,searchQuery:y=``}){let[b,x]=(0,j.useState)(!1),S=`rp-proj-row`+(l?.dragging?` dragging`:``)+(l?.drop?` drop-`+l.drop:``),C=t.status===`pending`&&t.ready===!1;return(0,M.jsxs)(`div`,{className:S,...c?{onDragOver:c.onDragOver,onDragLeave:c.onDragLeave,onDrop:c.onDrop}:{},children:[s?(0,M.jsx)(`span`,{className:`rp-drag-handle`,draggable:!0,title:`拖动调整队列内顺序`,"aria-label":`拖动排序`,onDragStart:c?.onDragStart,onDragEnd:c?.onDragEnd,onClick:e=>e.stopPropagation(),children:(0,M.jsx)(e,{name:`grip`,size:12})}):(0,M.jsx)(`span`,{className:`rp-drag-handle off`,"aria-hidden":`true`}),i?(0,M.jsx)(`span`,{className:`rp-proj-pick`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:(0,M.jsx)(`input`,{type:`checkbox`,checked:a,onChange:()=>o?.(t.id),"aria-label":`选择任务 #${t.id}`})}):null,(0,M.jsxs)(`div`,{className:`rp-proj-task`+(h?` done`:``),role:`button`,tabIndex:0,title:`打开这条任务`,onClick:()=>u?.(t),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u?.(t))},children:[(0,M.jsxs)(`span`,{className:`mono`,children:[`#`,t.id]}),n?(0,M.jsx)(`span`,{className:`rp-ptag`,title:`归属项目:${r||n}`,children:n}):null,(0,M.jsx)(`span`,{className:`rp-proj-task-tx`,children:_(t)}),t.timegoal&&(0,M.jsxs)(`span`,{className:`rp-proj-goal`,title:`时间目标 ${t.timegoal.duration}:领取即计时,未到点不许标完成`,children:[(0,M.jsx)(e,{name:`clock`,size:11}),` `,t.timegoal.duration]}),t.blocksFollowing&&(0,M.jsxs)(`span`,{className:`rp-tgate`,title:m.length?`闸门:未完成前挡住 ${m.length} 个后续任务(#${m.join(`, #`)})`:`闸门:未完成前挡住队列里排在后面的待领取任务`,children:[`闸门`,m.length?`×${m.length}`:``]}),C&&(0,M.jsx)(`span`,{className:`rp-tlock`,title:t.blockBy?.length?`等待依赖完成:#${t.blockBy.join(`, #`)}`:`被前方闸门挡住`,children:`锁定`}),f&&(0,M.jsxs)(`span`,{className:`rp-proj-times mono`,title:`创建 ${t.createdAt||`—`}${t.consumedAt?` · 领取 ${t.consumedAt}`:``}`,children:[R(t.createdAt),t.consumedAt?` → ${R(t.consumedAt)}`:``]}),(0,M.jsx)(p,{t}),g?(0,M.jsx)(`span`,{className:`rp-proj-ops`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:g}):null]}),v?(0,M.jsxs)(`div`,{className:`rp-proj-task-ctx`,children:[(0,M.jsxs)(`div`,{className:`ctx-head`,children:[(0,M.jsx)(`span`,{className:`ctx-head-label`,children:`匹配上下文`}),(0,M.jsxs)(`button`,{type:`button`,className:`ctx-expand`+(b?` is-open`:``),title:b?`收起,只看命中附近`:`展开这条任务的完整原文`,onClick:e=>{e.stopPropagation(),x(e=>!e)},onKeyDown:e=>e.stopPropagation(),children:[(0,M.jsx)(e,{name:`chevron`,size:11}),(0,M.jsx)(`span`,{children:b?`收起`:`展开全文`})]})]}),(0,M.jsx)(`div`,{className:`ctx-lines`,role:`button`,tabIndex:0,title:`打开这条任务`,onClick:()=>u?.(t),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u?.(t))},children:(()=>{let e=b&&d(t,y,2**53-1)||v;return e.lines.map((t,n)=>(0,M.jsxs)(`div`,{className:`ctx-line`+(n===e.hitIndex?` hit`:``),children:[(0,M.jsx)(`span`,{className:`ctx-no`,children:e.hitLineNo-e.hitIndex+n}),(0,M.jsx)(`span`,{className:`ctx-tx`,children:t||`\xA0`})]},n))})()})]}):null]})}var ue=20;function z({kind:t,name:n,title:r,rows:s,emptyText:c,intro:l=null,extraCounts:u=[],actionExtra:p=null,toolActs:m={},onNew:h,newDisabled:g=!1,tplMenuItems:_,onOpenRow:v,onMoveRow:y,onImportFile:b,onTogglePlan:x,onOpenDag:S,onToggleGate:C,onFeedback:w,onDeleteRow:T,onDeleteRows:E,onCancelRows:D,onCompleteRows:O,extra:ee=null}){let te=i(),ne=(0,j.useRef)(null),[k,A]=(0,j.useState)(null),[N,ie]=(0,j.useState)(``),P=!!String(N).trim(),F=(0,j.useMemo)(()=>P?s.filter(e=>f({id:e.task.id,text:e.task.text},N)):s,[s,N,P]),I=(0,j.useMemo)(()=>F.filter(e=>e.task.status===`pending`&&!e.task.migratedTo).length,[F]),L=ae(F,ue);(0,j.useEffect)(()=>{L.setPage(0)},[N]);let[R,z]=(0,j.useState)(()=>new Set),B=L.items,V=B.map(e=>e.key),H=V.length>0&&V.every(e=>R.has(e));(0,j.useEffect)(()=>{z(new Set)},[L.page]);let U=s.filter(e=>R.has(e.key)),W=U.filter(e=>(e.task.status===`pending`||e.task.status===`claimed`)&&!e.task.migratedTo&&!e.task.deletedAt),G=U.filter(e=>e.task.status===`pending`&&!e.task.migratedTo&&!e.task.deletedAt),K=W.filter(e=>e.task.status===`claimed`).length,q=e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},de=()=>{z(e=>{let t=new Set(e);return H?V.forEach(e=>t.delete(e)):V.forEach(e=>t.add(e)),t})},J=async e=>{U.length&&e&&await e(U)&&z(new Set)},Y=U.filter(e=>e.task.status===`pending`),X=U.filter(e=>e.task.status===`plan`),Z=Y.length?Y:X,fe=Y.length?`plan`:`pending`,pe=U.length?fe===`plan`?`转草稿 (${Y.length})`:`转回待领取 (${X.length})`:`草稿态`,Q=(0,j.useRef)(null),[me,he]=(0,j.useState)(null),[ge,$]=(0,j.useState)(null),_e=(e,t)=>{let n=t.getBoundingClientRect();return e.clientY<n.top+n.height/2?`before`:`after`},ve=(e,t)=>{Q.current=t.key,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,`task:`+t.task.id),he(t.key)},ye=(e,t)=>{Q.current&&t.movable&&t.key!==Q.current&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,$({key:t.key,zone:_e(e,e.currentTarget)}))},be=e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||$(null)},xe=(e,t)=>{e.preventDefault();let n=_e(e,e.currentTarget),r=Q.current;if(Q.current=null,he(null),$(null),!r||!t.movable||t.key===r)return;let i=s.find(e=>e.key===r);i&&y&&y(i,t,n)},Se=()=>{Q.current=null,he(null),$(null)},Ce=e=>{let t=e.task;return[(t.status===`pending`||t.status===`plan`)&&x?{label:t.status===`pending`?`转为草稿(不进队列)`:`转回待领取`,onPick:()=>x([e],t.status===`pending`?`plan`:`pending`)}:null,e.movable&&S?{label:`编排依赖…`,onPick:()=>S(e)}:null,e.movable&&C?{label:t.blocksFollowing?`取消闸门(不再挡后续)`:`设为闸门(挡住后续)`,onPick:()=>C(e)}:null,w&&t.status!==`cancelled`&&!t.childCount&&(t.status===`claimed`||t.status===`done`||t.completedAt)?{label:t.completedAt?`反馈:新开一条任务(原任务不动)`:`反馈修改:回写本任务并记入任务链`,onPick:()=>w(e)}:null,T?{label:`删除此任务(软删除,CLI 可恢复)`,danger:!0,onPick:()=>T(e)}:null]},we=U.length>0?(0,M.jsxs)(`div`,{className:`mdw-land-batch`,children:[(0,M.jsxs)(`span`,{className:`mdw-land-batch-count`,children:[`已选 `,U.length,` 条`]}),O&&(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!W.length,title:W.length?`把选中的未结束任务标为已完成(补一条完成记录,原文留档)${K?`;其中 ${K} 条已被领取,会直接收口,agent 侧回执忽略`:``}`:`选中的任务都已结束,没有可标为完成的`,onClick:()=>void J(O),children:[`标为完成选中`,W.length?` (${W.length})`:``]}),D&&(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!G.length,title:G.length?`把选中的待领取任务标为已取消(终态,原文留档)`:`只有待领取任务可以取消(已领取的交给 agent 回执)`,onClick:()=>void J(D),children:[`取消选中`,G.length?` (${G.length})`:``]}),E&&(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost sm danger`,onClick:()=>void J(E),children:[`删除选中 (`,U.length,`)`]}),(0,M.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>z(new Set),children:`清空`})]}):null,Te=(0,M.jsx)(se,{title:r,pendingCount:I,headerExtra:(0,M.jsxs)(`span`,{className:`rp-tasks-tools`,children:[(0,M.jsx)(`input`,{className:`rp-task-search`,type:`search`,value:N,placeholder:`搜索标题 / 内容`,"aria-label":`搜索任务`,onChange:e=>ie(e.target.value)}),B.length?(0,M.jsxs)(`label`,{className:`rp-proj-pickall`,title:`全选/取消全选当前页`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:H,onChange:de,"aria-label":`全选当前页任务`}),`全选本页`]}):null]}),emptyText:P?`没有匹配「${N.trim()}」的任务(标题与正文都搜过了)`:c,children:B.map(e=>{let t=e.movable?{onDragStart:t=>ve(t,e),onDragOver:t=>ye(t,e),onDragLeave:be,onDrop:t=>xe(t,e),onDragEnd:Se}:null;return(0,M.jsx)(le,{t:e.task,projectTag:e.projectTag,projectTitle:e.projectTitle,searchCtx:P?d(e.task,N):null,searchQuery:P?String(N||``):``,selectable:!0,picked:R.has(e.key),onTogglePick:()=>q(e.key),draggable:!!e.movable,dragHandlers:t,dragVisual:{dragging:me===e.key,drop:ge&&ge.key===e.key?ge.zone:null},showTimes:e.showTimes,downs:e.downs,onOpen:()=>v(e),ops:(0,M.jsx)(o,{items:Ce(e)})},e.key)})}),Ee=L.total>0?(0,M.jsx)(`div`,{className:`mdw-land-pager`,children:(0,M.jsx)(oe,{page:L.page,pageCount:L.pageCount,total:L.total,onPage:L.setPage,unit:`个任务`})}):null,De=e=>{A({x:e.clientX,y:e.clientY})},Oe=()=>(0,M.jsx)(`span`,{className:`rp-newtask`,children:(0,M.jsxs)(`button`,{type:`button`,className:`btn small primary`,title:`按默认模板新建一页(▾ 选模板)`,disabled:g,onClick:()=>h(),children:[`+ 新建页`,(0,M.jsx)(`span`,{role:`button`,tabIndex:g?void 0:0,"aria-label":`选择模板新建一页`,"aria-haspopup":`menu`,className:`rp-newtask-caret`,title:`选择模板新建一页`,onClick:e=>{e.stopPropagation(),De(e)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),De(e))},children:(0,M.jsx)(e,{name:`chevron`,size:11,title:void 0})})]})});return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(ce,{name:n,counts:[`${P?`命中 `:``}${L.total} 个任务`,...I>0?[`待领取 ${I}`]:[],...u],intro:l,batch:we,list:Te,footer:Ee,actions:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(re,{kind:t,labels:{more:`更多`,...m.labels,plan:pe},titles:{new:`按默认模板新建一页(▾ 选模板)`,import:`把一个 .md 文件导入成任务`,plan:`选中任务后:待领取 ↔ 草稿(草稿不进 get/wait 队列;行尾 ⋯ 菜单也能单条切换)`,...m.titles},disabled:m.disabled,renderers:{new:Oe,...m.renderers},actions:{...m.actions,new:()=>h(),import:()=>ne.current?.click(),plan:()=>{if(!Z.length){te(`先勾选任务:待领取可转草稿,草稿可转回待领取(行尾 ⋯ 菜单也能单条切换)`);return}x?.(Z,fe)}}}),p]})}),k&&(0,M.jsx)(a,{x:k.x,y:k.y,items:_,onClose:()=>A(null)}),(0,M.jsx)(`input`,{ref:ne,type:`file`,accept:`.md,text/markdown,text/plain`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&b&&b(t)}}),ee]})}function B(e){return((e.text||``).split(`
1
+ import{a as e,d as t,f as n,h as r,l as i,n as a,r as o,t as s}from"./popup-BdVXUaJk.js";import{D as c}from"./repo-form-modal-awEPCcJK.js";import{n as l}from"./app-context-KCsdqNTq.js";import{l as u}from"./task-status-Cjsm0xF7.js";import{d,f,s as p}from"./md-history-BR2jLhFQ.js";import{t as m}from"./button-BRGGaUcY.js";import{S as h,h as g,w as _,x as v}from"./index-DqTSNBzX.js";import{t as y}from"./graph-BTEfvFz6.js";import{c as b,d as x,f as S,g as C,l as w,m as T,n as E,p as D,r as O,s as ee,t as te,u as ne}from"./reopen-text-C3dnqygC.js";import{n as k}from"./template-preview-CjQ-ucPt.js";import{a as A}from"./manage-session-CuaL7QqQ.js";import{t as re}from"./bar-DEY9q8mI.js";var j=r(n(),1),M=t(),N=10;function ie({repo:e,onClose:t,onSaved:n}){let r=l(),a=i(),o=e.getLoop&&typeof e.getLoop==`object`?e.getLoop:null,[u,d]=(0,j.useState)(!!(o&&o.enabled)),[f,p]=(0,j.useState)(o&&o.waitMinutes!==void 0&&o.waitMinutes!==null?String(o.waitMinutes):String(N)),[h,g]=(0,j.useState)(!1),_=e=>{let t=String(e??``).trim();if(t===``)return N;let n=Number(t);return Number.isFinite(n)&&n>=0?Math.min(Math.floor(n),600):N},v=async t=>{let i=String(e.id??``);g(!0);try{let o=t&&t.enabled!==void 0?t.enabled:u;await c(i,{"get-loop":o?`on`:`off`,...o?{"get-loop-minutes":_(f)}:{}});let s=_(f);a(o?`已保存「${e.name}」的持续 get 设置(${s>0?`${s} 分钟阻塞窗口`:`不阻塞,没活立即返回`})`:`已关闭「${e.name}」的持续 get`),r.refreshRepos&&r.refreshRepos(),n&&n()}catch(e){a(String(e.message||e))}finally{g(!1)}},y=async e=>{d(e),await v({enabled:e})};return(0,M.jsx)(s,{title:`持续 get · ${e.name}`,onClose:t,size:`md`,children:(0,M.jsxs)(`div`,{className:`rp-gl`,children:[(0,M.jsxs)(`div`,{className:`rp-gl-head`,children:[(0,M.jsxs)(`div`,{className:`rp-gl-title`,children:[(0,M.jsx)(`span`,{className:`rp-gl-name`,children:`持续 get`}),(0,M.jsx)(`span`,{className:`rp-gl-desc`,children:`无任务时阻塞等待新任务回填(waitgoal)`})]}),(0,M.jsxs)(`button`,{className:`toggle`+(u?` on`:``),onClick:()=>y(!u),disabled:h,children:[(0,M.jsx)(`span`,{className:`dot`}),u?`开`:`关`]})]}),u&&(0,M.jsxs)(`div`,{className:`rp-gl-body`,children:[(0,M.jsxs)(`div`,{className:`rp-gl-row`,children:[(0,M.jsx)(`span`,{children:`阻塞窗口`}),(0,M.jsxs)(`span`,{className:`rp-gl-unit`,children:[(0,M.jsx)(`input`,{className:`rp-gl-min`,value:f,onChange:e=>p(e.target.value),inputMode:`numeric`,title:`0 = 不阻塞:没任务时 get 立即返回 timeout`}),`分钟`]})]}),(0,M.jsx)(`div`,{className:`rp-gl-note`,children:`这里只决定没有任务时 get 最多阻塞多久(0 = 不阻塞,立即返回 timeout)。领到任务后那段「继续 get 直到 timeout」的提示词是全局的,只有一份:要改文案去 设置 → 提示词模板 → 持续 get。`}),(0,M.jsxs)(`div`,{className:`rp-gl-acts`,children:[(0,M.jsx)(`span`,{className:`spacer`}),(0,M.jsx)(m,{variant:`primary`,disabled:h,onClick:()=>v(),children:`保存持续 get 设置`})]})]})]})})}var P=s,F=(e,t,n)=>y(e=>n.get(Number(e))||[],e,t);function I({task:e,tasks:t,onClose:n,onSave:r}){let i=e=>Number(e.id),a=i(e),o=t.filter(e=>i(e)!==a),[s,c]=(0,j.useState)(!!e.blocksFollowing),[l,d]=(0,j.useState)(()=>new Set((e.blockBy||[]).map(Number))),[f,p]=(0,j.useState)(()=>new Set(o.filter(e=>(e.blockBy||[]).map(Number).includes(a)).map(i))),[m,h]=(0,j.useState)(!1),g=t.findIndex(e=>i(e)===a),_=t.slice(g+1).map(i),v=new Map(t.map(e=>[i(e),i(e)===a?[...l]:(e.blockBy||[]).map(Number)])),y=e=>s||!l.has(i(e))&&F(i(e),a,v),b=e=>!f.has(i(e))&&F(a,i(e),v),x=e=>t=>e(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}),S=()=>c(e=>(e||d(new Set),!e)),C=async()=>{h(!0);try{let e=[{id:a,gate:s,blockBy:[...l]}];if(!s)for(let t of o){let n=i(t),r=f.has(n),o=(t.blockBy||[]).map(Number);r!==o.includes(a)&&e.push({id:n,blockBy:r?[...o,a]:o.filter(e=>e!==a)})}await r(e),n()}catch{}finally{h(!1)}},w=(e,t,n,r)=>{let a=u(e.text)||`#${i(e)}`;return(0,M.jsxs)(`label`,{className:`mdw-dag-item`,title:n&&!m?`会造成循环依赖或与闸门约束冲突,已禁用`:void 0,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:t,disabled:m||n,onChange:()=>r(i(e))}),(0,M.jsxs)(`span`,{className:`mono faint`,children:[`#`,i(e)]}),(0,M.jsx)(`span`,{className:`mdw-dag-name`,children:a})]},i(e))};return(0,M.jsx)(P,{title:`编排 · #${a} ${u(e.text)||``}`,onClose:n,busy:m,size:`md`,footer:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:m,onClick:n,children:`取消`}),(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:m,onClick:C,children:m?`保存中…`:`保存编排`})]}),children:(0,M.jsxs)(`div`,{className:`mdw-dag`,children:[(0,M.jsxs)(`label`,{className:`mdw-dag-item mdw-dag-gate`,title:`闸门:本任务未完成前,队列里排在后面的全部待领取任务都不能被领取`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:s,disabled:m,onChange:S}),(0,M.jsx)(`b`,{children:`闸门`}),(0,M.jsx)(`span`,{className:`mdw-dag-hint`,children:`挡住队列里所有排在后面的待领取任务(闸门不声明上游依赖)`})]}),s?(0,M.jsxs)(`div`,{className:`mdw-dag-note`,children:[`开启时自动挡住 `,_.length,` 个后续任务`,_.length?`:${_.map(e=>`#${e}`).join(`, `)}`:`(后面已没有待领取任务)`]}):null,(0,M.jsxs)(`div`,{className:`mdw-dag-sec`,children:[`上游依赖(我等谁完成)`,s?(0,M.jsx)(`span`,{className:`mdw-dag-hint`,children:`—— 闸门开启时不声明上游,保存后已清空`}):null]}),(0,M.jsx)(`div`,{className:`mdw-dag-list`+(s?` dim`:``),children:o.length?o.map(e=>w(e,l.has(i(e)),y(e),x(d))):(0,M.jsx)(`div`,{className:`mdw-dag-note`,children:`队列里没有其他待领取任务`})}),(0,M.jsxs)(`div`,{className:`mdw-dag-sec`,children:[`下游任务(谁被我挡)`,s?(0,M.jsx)(`span`,{className:`mdw-dag-hint`,children:`—— 闸门开启时此表不生效,自动挡住全部后续`}):null]}),(0,M.jsx)(`div`,{className:`mdw-dag-list`+(s?` dim`:``),children:o.length?o.map(e=>w(e,f.has(i(e)),s||b(e),x(p))):(0,M.jsx)(`div`,{className:`mdw-dag-note`,children:`队列里没有其他待领取任务`})}),(0,M.jsx)(`div`,{className:`mdw-dag-note`,children:`保存会同时改写相关任务的依赖(逐条落盘);勾选会成环的组合会被禁用。`})]})})}function L(e,t,n){if(!k(e?.body).length||!e?.id)return!1;let r=A({...t,templateId:String(e.id)});return n.onNavigate?.(`#/templates/fill/${r}`),!0}function ae(e,t){let n=Array.isArray(e)?e:[],[r,i]=(0,j.useState)(0),a=Math.max(1,Number(t)||1),o=Math.max(1,Math.ceil(n.length/a)),s=Math.min(Math.max(0,r),o-1),c=s*a;return{page:s,pageCount:o,total:n.length,items:n.slice(c,c+a),setPage:i}}function oe({page:e=0,pageCount:t=1,total:n=0,onPage:r,unit:i=`条`}){let a=e=>r&&r(Math.max(0,Math.min(e,t-1)));return t<=1?(0,M.jsxs)(`span`,{className:`pager-n`,children:[`共 `,n,` `,i]}):(0,M.jsxs)(`span`,{className:`pager`,children:[(0,M.jsx)(`button`,{type:`button`,className:`pager-btn`,disabled:e<=0,onClick:()=>a(e-1),"aria-label":`上一页`,title:`上一页`,children:`‹`}),(0,M.jsxs)(`span`,{className:`pager-n`,children:[`第 `,e+1,`/`,t,` 页 · 共 `,n,` `,i]}),(0,M.jsx)(`button`,{type:`button`,className:`pager-btn`,disabled:e>=t-1,onClick:()=>a(e+1),"aria-label":`下一页`,title:`下一页`,children:`›`})]})}function se({icon:t=`list`,title:n,pendingCount:r=0,headerExtra:i=null,children:a=null,emptyText:o=``}){let s=Array.isArray(a)?a.length>0:!!a;return(0,M.jsxs)(`div`,{className:`rp-tasks`,children:[(0,M.jsxs)(`div`,{className:`rp-tasks-h`,children:[(0,M.jsx)(e,{name:t,size:13}),` `,n,r>0&&(0,M.jsxs)(`span`,{className:`rp-chip-count`,children:[`待领取 `,r]}),i]}),a,!s&&o?(0,M.jsx)(`div`,{className:`rp-proj-none muted`,children:o}):null]})}function ce({name:t,counts:n=[],icon:r=`folder`,actions:i=null,intro:a=null,batch:o=null,list:s=null,footer:c=null,extra:l=null}){return(0,M.jsxs)(`div`,{className:`rp-page`,children:[(0,M.jsxs)(`div`,{className:`rp-group-head`,children:[(0,M.jsxs)(`h2`,{children:[(0,M.jsx)(e,{name:r,size:15}),` `,t,n.map((e,t)=>{let n=typeof e==`string`?e:e&&e.text||``;return n?(0,M.jsx)(`span`,{className:`rp-chip-count`,children:n},t):null})]}),i?(0,M.jsx)(`div`,{className:`rp-group-acts`,children:i}):null]}),a,o,s,c,l]})}function R(e){let t=String(e||``).trim();if(!t)return`—`;let n=t.match(/^(\d{4}-\d{2}-\d{2})[ T](\d{2}:\d{2})/),r=n?.[1],i=n?.[2];return r&&i?`${r.slice(5)} ${i}`:t.slice(0,16)}function le({t,projectTag:n=``,projectTitle:r=``,selectable:i=!1,picked:a=!1,onTogglePick:o,draggable:s=!1,dragHandlers:c=null,dragVisual:l,onOpen:u,showTimes:f=!1,downs:m=[],history:h=!1,ops:g=null,searchCtx:v=null,searchQuery:y=``}){let[b,x]=(0,j.useState)(!1),S=`rp-proj-row`+(l?.dragging?` dragging`:``)+(l?.drop?` drop-`+l.drop:``),C=t.status===`pending`&&t.ready===!1;return(0,M.jsxs)(`div`,{className:S,...c?{onDragOver:c.onDragOver,onDragLeave:c.onDragLeave,onDrop:c.onDrop}:{},children:[s?(0,M.jsx)(`span`,{className:`rp-drag-handle`,draggable:!0,title:`拖动调整队列内顺序`,"aria-label":`拖动排序`,onDragStart:c?.onDragStart,onDragEnd:c?.onDragEnd,onClick:e=>e.stopPropagation(),children:(0,M.jsx)(e,{name:`grip`,size:12})}):(0,M.jsx)(`span`,{className:`rp-drag-handle off`,"aria-hidden":`true`}),i?(0,M.jsx)(`span`,{className:`rp-proj-pick`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:(0,M.jsx)(`input`,{type:`checkbox`,checked:a,onChange:()=>o?.(t.id),"aria-label":`选择任务 #${t.id}`})}):null,(0,M.jsxs)(`div`,{className:`rp-proj-task`+(h?` done`:``),role:`button`,tabIndex:0,title:`打开这条任务`,onClick:()=>u?.(t),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u?.(t))},children:[(0,M.jsxs)(`span`,{className:`mono`,children:[`#`,t.id]}),n?(0,M.jsx)(`span`,{className:`rp-ptag`,title:`归属项目:${r||n}`,children:n}):null,(0,M.jsx)(`span`,{className:`rp-proj-task-tx`,children:_(t)}),t.timegoal&&(0,M.jsxs)(`span`,{className:`rp-proj-goal`,title:`时间目标 ${t.timegoal.duration}:领取即计时,未到点不许标完成`,children:[(0,M.jsx)(e,{name:`clock`,size:11}),` `,t.timegoal.duration]}),t.blocksFollowing&&(0,M.jsxs)(`span`,{className:`rp-tgate`,title:m.length?`闸门:未完成前挡住 ${m.length} 个后续任务(#${m.join(`, #`)})`:`闸门:未完成前挡住队列里排在后面的待领取任务`,children:[`闸门`,m.length?`×${m.length}`:``]}),C&&(0,M.jsx)(`span`,{className:`rp-tlock`,title:t.blockBy?.length?`等待依赖完成:#${t.blockBy.join(`, #`)}`:`被前方闸门挡住`,children:`锁定`}),f&&(0,M.jsxs)(`span`,{className:`rp-proj-times mono`,title:`创建 ${t.createdAt||`—`}${t.consumedAt?` · 领取 ${t.consumedAt}`:``}`,children:[R(t.createdAt),t.consumedAt?` → ${R(t.consumedAt)}`:``]}),(0,M.jsx)(p,{t}),g?(0,M.jsx)(`span`,{className:`rp-proj-ops`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:g}):null]}),v?(0,M.jsxs)(`div`,{className:`rp-proj-task-ctx`,children:[(0,M.jsxs)(`div`,{className:`ctx-head`,children:[(0,M.jsx)(`span`,{className:`ctx-head-label`,children:`匹配上下文`}),(0,M.jsxs)(`button`,{type:`button`,className:`ctx-expand`+(b?` is-open`:``),title:b?`收起,只看命中附近`:`展开这条任务的完整原文`,onClick:e=>{e.stopPropagation(),x(e=>!e)},onKeyDown:e=>e.stopPropagation(),children:[(0,M.jsx)(e,{name:`chevron`,size:11}),(0,M.jsx)(`span`,{children:b?`收起`:`展开全文`})]})]}),(0,M.jsx)(`div`,{className:`ctx-lines`,role:`button`,tabIndex:0,title:`打开这条任务`,onClick:()=>u?.(t),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u?.(t))},children:(()=>{let e=b&&d(t,y,2**53-1)||v;return e.lines.map((t,n)=>(0,M.jsxs)(`div`,{className:`ctx-line`+(n===e.hitIndex?` hit`:``),children:[(0,M.jsx)(`span`,{className:`ctx-no`,children:e.hitLineNo-e.hitIndex+n}),(0,M.jsx)(`span`,{className:`ctx-tx`,children:t||`\xA0`})]},n))})()})]}):null]})}var ue=20;function z({kind:t,name:n,title:r,rows:s,emptyText:c,intro:l=null,extraCounts:u=[],actionExtra:p=null,toolActs:m={},onNew:h,newDisabled:g=!1,tplMenuItems:_,onOpenRow:v,onMoveRow:y,onImportFile:b,onTogglePlan:x,onOpenDag:S,onToggleGate:C,onFeedback:w,onDeleteRow:T,onDeleteRows:E,onCancelRows:D,onCompleteRows:O,extra:ee=null}){let te=i(),ne=(0,j.useRef)(null),[k,A]=(0,j.useState)(null),[N,ie]=(0,j.useState)(``),P=!!String(N).trim(),F=(0,j.useMemo)(()=>P?s.filter(e=>f({id:e.task.id,text:e.task.text},N)):s,[s,N,P]),I=(0,j.useMemo)(()=>F.filter(e=>e.task.status===`pending`&&!e.task.migratedTo).length,[F]),L=ae(F,ue);(0,j.useEffect)(()=>{L.setPage(0)},[N]);let[R,z]=(0,j.useState)(()=>new Set),B=L.items,V=B.map(e=>e.key),H=V.length>0&&V.every(e=>R.has(e));(0,j.useEffect)(()=>{z(new Set)},[L.page]);let U=s.filter(e=>R.has(e.key)),W=U.filter(e=>(e.task.status===`pending`||e.task.status===`claimed`)&&!e.task.migratedTo&&!e.task.deletedAt),G=U.filter(e=>e.task.status===`pending`&&!e.task.migratedTo&&!e.task.deletedAt),K=W.filter(e=>e.task.status===`claimed`).length,q=e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},de=()=>{z(e=>{let t=new Set(e);return H?V.forEach(e=>t.delete(e)):V.forEach(e=>t.add(e)),t})},J=async e=>{U.length&&e&&await e(U)&&z(new Set)},Y=U.filter(e=>e.task.status===`pending`),X=U.filter(e=>e.task.status===`plan`),Z=Y.length?Y:X,fe=Y.length?`plan`:`pending`,pe=U.length?fe===`plan`?`转草稿 (${Y.length})`:`转回待领取 (${X.length})`:`草稿态`,Q=(0,j.useRef)(null),[me,he]=(0,j.useState)(null),[ge,$]=(0,j.useState)(null),_e=(e,t)=>{let n=t.getBoundingClientRect();return e.clientY<n.top+n.height/2?`before`:`after`},ve=(e,t)=>{Q.current=t.key,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,`task:`+t.task.id),he(t.key)},ye=(e,t)=>{Q.current&&t.movable&&t.key!==Q.current&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,$({key:t.key,zone:_e(e,e.currentTarget)}))},be=e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||$(null)},xe=(e,t)=>{e.preventDefault();let n=_e(e,e.currentTarget),r=Q.current;if(Q.current=null,he(null),$(null),!r||!t.movable||t.key===r)return;let i=s.find(e=>e.key===r);i&&y&&y(i,t,n)},Se=()=>{Q.current=null,he(null),$(null)},Ce=e=>{let t=e.task;return[(t.status===`pending`||t.status===`plan`)&&x?{label:t.status===`pending`?`转为草稿(不进队列)`:`转回待领取`,onPick:()=>x([e],t.status===`pending`?`plan`:`pending`)}:null,e.movable&&S?{label:`编排依赖…`,onPick:()=>S(e)}:null,e.movable&&C?{label:t.blocksFollowing?`取消闸门(不再挡后续)`:`设为闸门(挡住后续)`,onPick:()=>C(e)}:null,w&&t.status!==`cancelled`&&!t.childCount&&(t.status===`claimed`||t.status===`done`||t.completedAt)?{label:t.completedAt?`反馈:新开一条任务(原任务不动)`:`反馈修改:回写本任务并记入任务链`,onPick:()=>w(e)}:null,T?{label:`删除此任务(软删除,CLI 可恢复)`,danger:!0,onPick:()=>T(e)}:null]},we=U.length>0?(0,M.jsxs)(`div`,{className:`mdw-land-batch`,children:[(0,M.jsxs)(`span`,{className:`mdw-land-batch-count`,children:[`已选 `,U.length,` 条`]}),O&&(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!W.length,title:W.length?`把选中的未结束任务标为已完成(补一条完成记录,原文留档)${K?`;其中 ${K} 条已被领取,会直接收口,agent 侧回执忽略`:``}`:`选中的任务都已结束,没有可标为完成的`,onClick:()=>void J(O),children:[`标为完成选中`,W.length?` (${W.length})`:``]}),D&&(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!G.length,title:G.length?`把选中的待领取任务标为已取消(终态,原文留档)`:`只有待领取任务可以取消(已领取的交给 agent 回执)`,onClick:()=>void J(D),children:[`取消选中`,G.length?` (${G.length})`:``]}),E&&(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost sm danger`,onClick:()=>void J(E),children:[`删除选中 (`,U.length,`)`]}),(0,M.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>z(new Set),children:`清空`})]}):null,Te=(0,M.jsx)(se,{title:r,pendingCount:I,headerExtra:(0,M.jsxs)(`span`,{className:`rp-tasks-tools`,children:[(0,M.jsx)(`input`,{className:`rp-task-search`,type:`search`,value:N,placeholder:`搜索标题 / 内容`,"aria-label":`搜索任务`,onChange:e=>ie(e.target.value)}),B.length?(0,M.jsxs)(`label`,{className:`rp-proj-pickall`,title:`全选/取消全选当前页`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:H,onChange:de,"aria-label":`全选当前页任务`}),`全选本页`]}):null]}),emptyText:P?`没有匹配「${N.trim()}」的任务(标题与正文都搜过了)`:c,children:B.map(e=>{let t=e.movable?{onDragStart:t=>ve(t,e),onDragOver:t=>ye(t,e),onDragLeave:be,onDrop:t=>xe(t,e),onDragEnd:Se}:null;return(0,M.jsx)(le,{t:e.task,projectTag:e.projectTag,projectTitle:e.projectTitle,searchCtx:P?d(e.task,N):null,searchQuery:P?String(N||``):``,selectable:!0,picked:R.has(e.key),onTogglePick:()=>q(e.key),draggable:!!e.movable,dragHandlers:t,dragVisual:{dragging:me===e.key,drop:ge&&ge.key===e.key?ge.zone:null},showTimes:e.showTimes,downs:e.downs,onOpen:()=>v(e),ops:(0,M.jsx)(o,{items:Ce(e)})},e.key)})}),Ee=L.total>0?(0,M.jsx)(`div`,{className:`mdw-land-pager`,children:(0,M.jsx)(oe,{page:L.page,pageCount:L.pageCount,total:L.total,onPage:L.setPage,unit:`个任务`})}):null,De=e=>{A({x:e.clientX,y:e.clientY})},Oe=()=>(0,M.jsx)(`span`,{className:`rp-newtask`,children:(0,M.jsxs)(`button`,{type:`button`,className:`btn small primary`,title:`按默认模板新建一页(▾ 选模板)`,disabled:g,onClick:()=>h(),children:[`+ 新建页`,(0,M.jsx)(`span`,{role:`button`,tabIndex:g?void 0:0,"aria-label":`选择模板新建一页`,"aria-haspopup":`menu`,className:`rp-newtask-caret`,title:`选择模板新建一页`,onClick:e=>{e.stopPropagation(),De(e)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),De(e))},children:(0,M.jsx)(e,{name:`chevron`,size:11,title:void 0})})]})});return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(ce,{name:n,counts:[`${P?`命中 `:``}${L.total} 个任务`,...I>0?[`待领取 ${I}`]:[],...u],intro:l,batch:we,list:Te,footer:Ee,actions:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(re,{kind:t,labels:{more:`更多`,...m.labels,plan:pe},titles:{new:`按默认模板新建一页(▾ 选模板)`,import:`把一个 .md 文件导入成任务`,plan:`选中任务后:待领取 ↔ 草稿(草稿不进 get/wait 队列;行尾 ⋯ 菜单也能单条切换)`,...m.titles},disabled:m.disabled,renderers:{new:Oe,...m.renderers},actions:{...m.actions,new:()=>h(),import:()=>ne.current?.click(),plan:()=>{if(!Z.length){te(`先勾选任务:待领取可转草稿,草稿可转回待领取(行尾 ⋯ 菜单也能单条切换)`);return}x?.(Z,fe)}}}),p]})}),k&&(0,M.jsx)(a,{x:k.x,y:k.y,items:_,onClose:()=>A(null)}),(0,M.jsx)(`input`,{ref:ne,type:`file`,accept:`.md,text/markdown,text/plain`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&b&&b(t)}}),ee]})}function B(e){return((e.text||``).split(`
2
2
  `).find(e=>e.trim())||`#${e.id}`).replace(/^#\s*/,``)}function V(e,t){return e.key&&!e.cwd?`key=${encodeURIComponent(e.key)}&id=${Number(t)}`:`cwd=${encodeURIComponent(e.cwd||``)}&id=${Number(t)}`}function H(e){return{cwd:e.cwd}}function U(e,t,n,r){r&&v(g(h(t||e.docKey),String(n)),{body:r})}async function W(e,t){try{return await t()}catch(t){return e.toast(String(t?.message||t)),!1}}async function G(e,t,n){let{dialog:r,toast:i}=e,a=B(n),o=!!n.completedAt,s=await r({title:o?`反馈 · #${n.id}`:`反馈修改 · #${n.id}`,input:!0,placeholder:o?`写下反馈(将新开一条任务,原任务不动)`:`写下要改的地方(留空 = 只重开,不改正文)`});if(s==null)return;let c=String(s).trim();await W(e,async()=>{let r=await ne(V(t,n.id)),s=String(r?.text??``).trim()||String(n.text||``).trim(),l=o&&(r?.roundSummary||n.roundSummary)||``;if(!c&&!o&&!s){i(`拿不到任务当前正文,已取消(防止丢内容)`);return}if(o){let r=c?te({base:s,feedback:c,ackSummary:l,feedbackHeading:E,bold:!0}):``;if(!r){i(`写一下反馈`);return}let o=await ee({...H(t),text:r,forkOf:String(n.id),forkKind:`reopen`}),u=String(o?.task?.id??o?.id??``);U(e,o?.key,u,r),i(`已反馈「${a}」→ 新任务 #${u||`?`}`),e.refresh?.();return}let u=await S({...t,id:n.id,kind:`reopen`,...c?{feedback:c,feedbackHeading:O,feedbackBold:!1}:{}}),d=String(u?.task?.id??n.id);U(e,u?.key,d,String(u?.task?.text??``)),i(`已回写「${a}」#${d}`+(u?.moved&&u.name?`;归属迁到「${u.name}」`:``)),e.refresh?.()})}async function K(e,t,n){let{dialog:r,toast:i}=e;await r({title:`删除任务「${B(n)}」`,message:`软删除:CLI localtask task restore 可恢复。`,danger:!0,okText:`删除`})&&await W(e,async()=>(await T({...t,id:n.id}),i(`已删除「${B(n)}」`),e.onDeleted?.(n),e.refresh?.(),!0))}var q=e=>e.reduce((e,t)=>e+t.ids.length,0);async function de(e,t){let n=q(t);if(!n||!await e.dialog({title:`删除选中的 ${n} 条任务`,message:`软删除:CLI localtask task restore 可恢复。`,danger:!0,okText:`删除`}))return!1;let r=0;for(let n of t){let t=await W(e,()=>D({...n.scope,ids:n.ids}));if(t===!1)return!1;r+=t.count??n.ids.length}return e.toast(`已删除 ${r} 条任务`),e.refresh?.(),!0}async function J(e,t){let n=q(t);if(!n||!await e.dialog({title:`取消选中的 ${n} 条待领取任务`,message:`只处理待领取任务;已领取/已完成/已取消会跳过。取消为终态,原文留档。`,okText:`取消任务`}))return!1;let r=0,i=0;for(let n of t){let t=await W(e,()=>b({...n.scope,ids:n.ids}));if(t===!1)return!1;let a=t;r+=a.count??0,i+=a.skipped?.length||0}return e.toast(`已取消 ${r} 条任务${i?`,跳过 ${i} 条`:``}`),e.refresh?.(),!0}async function Y(e,t){let n=q(t);if(!n||!await e.dialog({title:`把选中的 ${n} 条任务标为完成`,message:`待领取与已领取(正在跑)都能收:已领取的直接收口,agent 侧回执会被忽略。已完成/已取消会跳过。完成会补一条完成记录,原文留档。`,okText:`标为完成`}))return!1;let r=0,i=0,a=0;for(let n of t){let t=await W(e,()=>w({...n.scope,ids:n.ids,status:`done`}));if(t===!1)return!1;let o=t;r+=o.count??0,i+=o.skipped?.length||0,a+=o.claimedClosed?.length||0}return e.toast(`已标为完成 ${r} 条任务${a?`(含 ${a} 条已领取)`:``}${i?`,跳过 ${i} 条`:``}`),e.refresh?.(),!0}async function X(e,t,n){let r=!n.blocksFollowing;await W(e,()=>x({...t,id:n.id,gate:r}))&&(e.toast(r?`#${n.id} 已设为闸门——挡住所有后续待领取任务`:`#${n.id} 闸门已取消`),e.refresh?.())}async function Z(e,t,n){let r=t.reduce((e,t)=>e+t.ids.length,0);r&&await W(e,async()=>{for(let e of t)for(let t of e.ids)await C({...e.scope,id:Number(t),to:n});return e.toast(n===`plan`?`已把 ${r} 条任务转为草稿(不进队列)`:`已把 ${r} 条草稿转回待领取`),e.refresh?.(),!0})}async function fe(e,t,n){try{for(let e of n)await x({...t,...e});e.toast(`编排已保存`),e.refresh?.()}catch(t){throw e.toast(String(t?.message||t)),t}}export{G as a,fe as c,I as d,ie as f,K as i,z as l,Y as n,Z as o,de as r,X as s,J as t,L as u};
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bs5BehN8.js","assets/popup-BdVXUaJk.js","assets/popup-CHK8uSG4.css","assets/tool-bar-CAMqYt5j.js","assets/tool-bar-CLIs9Dr0.css","assets/repo-form-modal-awEPCcJK.js","assets/button-BRGGaUcY.js","assets/button-DA4lNJeC.css","assets/doc-R8KHVCxp.js","assets/app-context-KCsdqNTq.js","assets/task-status-Cjsm0xF7.js","assets/md-history-BR2jLhFQ.js","assets/use-rail-drag-C3GpkThI.js","assets/route-crumb-DvXzznKm.js","assets/board-view-C8OQhkyi.js","assets/doc-DgYKv2wo.css","assets/index-GyxCJY9y.css"])))=>i.map(i=>d[i]);
2
- import{a as e,d as t,f as n,h as r,i,l as a}from"./popup-BdVXUaJk.js";import{D as o}from"./tool-bar-CAMqYt5j.js";import{n as s}from"./app-context-KCsdqNTq.js";import{d as c,l}from"./task-status-Cjsm0xF7.js";import{a as u,i as d,n as f,r as p,t as m,u as h}from"./md-history-BR2jLhFQ.js";import{t as g}from"./button-BRGGaUcY.js";import{i as _,n as v,t as y}from"./route-crumb-DvXzznKm.js";import{S as b,d as x,h as S,m as C,v as w,x as T}from"./index-Bs5BehN8.js";import{n as E,t as D}from"./template-preview-CjQ-ucPt.js";import{i as O,r as k,t as A}from"./manage-session-CuaL7QqQ.js";import{t as j}from"./task-intent-CX5DZccN.js";var M=r(n(),1),N=t();function P(e){return String(e||``).split(`
3
- `).map(e=>e.trim().replace(/^#{1,6}\s+/,``).replace(/^[-*+]\s+\[[ x]\]\s*/i,``).replace(/^[-*+]\s+/,``).replace(/^>\s?/,``)).filter(Boolean).slice(0,2).join(` · `)}function F(){let t=s(),n=t.tpl,r=a(),{dialog:o,node:l}=i(),[u,d]=(0,M.useState)(null),[f,p]=(0,M.useState)(!1),[m,v]=(0,M.useState)(``),y=e=>t.onNavigate?.(e);if(!n)return(0,N.jsx)(`div`,{className:`rp-page tpl-page`,children:(0,N.jsx)(`div`,{className:`muted`,style:{padding:20},children:`模板服务未就绪…`})});if(n.unsupported)return(0,N.jsx)(`div`,{className:`rp-page tpl-page`,children:(0,N.jsx)(`div`,{className:`muted`,style:{padding:20},children:`当前服务比面板旧——重启面板后才有模板功能。`})});let b=n.templates||[],x=h(b,m,e=>[e.name,P(e.body)]),S=async(e,t)=>{if(!f){p(!0);try{await e(),t&&r(t)}catch(e){r(String(e.message||e))}finally{p(!1)}}},C=async e=>{await o({title:`删除模板「${e.name}」`,danger:!0,okText:`删除`})&&await S(()=>n.remove(e.id),`已删除「${e.name}」`)},w=(t,n,r,i={})=>(0,N.jsxs)(`button`,{type:`button`,className:`tpl-act`+(i.on?` is-on`:``),title:n,disabled:f||i.disabled,onClick:r,children:[(0,N.jsx)(e,{name:t,size:16}),(0,N.jsx)(`span`,{children:n})]});return(0,N.jsxs)(`div`,{className:`rp-page tpl-page`,children:[l,(0,N.jsxs)(`div`,{className:`page-head`,children:[(0,N.jsxs)(`div`,{className:`title-block`,children:[(0,N.jsxs)(`h2`,{children:[(0,N.jsx)(e,{name:`list`,size:16}),` 任务模板`]}),(0,N.jsx)(`p`,{className:`muted tpl-head-note`,children:`新建任务时的正文骨架;正式内容在编辑页自行填写。`})]}),(0,N.jsx)(`div`,{className:`acts`,children:(0,N.jsxs)(g,{variant:`primary`,small:!0,disabled:f,onClick:()=>y(`#/templates/new`),children:[(0,N.jsx)(e,{name:`plus`,size:13}),` 新建`]})})]}),(0,N.jsx)(`div`,{className:`tpl-search`,children:(0,N.jsx)(_,{value:m,onChange:v,placeholder:`搜索名称 / 正文…`,title:`过滤任务模板`,count:x.length,className:`wide`})}),!b.length&&(0,N.jsx)(`div`,{className:`muted`,style:{padding:`8px 2px`},children:`还没有模板(内置默认模板加载中…)。`}),(0,N.jsxs)(`div`,{className:`tpl-list`,children:[x.map(e=>{let t=e.id===n.defaultId,r=u===e.id;return(0,N.jsxs)(`div`,{className:`tpl-card`+(t?` is-default`:``),children:[(0,N.jsxs)(`div`,{className:`tpl-card-head`,children:[(0,N.jsx)(`span`,{className:`tpl-card-name`,children:e.name}),t&&(0,N.jsx)(`span`,{className:`tpl-badge`,children:`默认`}),e.builtin&&(0,N.jsx)(`span`,{className:`tpl-badge soft`,children:`内置`}),(0,N.jsx)(`span`,{className:`grow tpl-card-grow`}),(0,N.jsxs)(`div`,{className:`tpl-card-acts`,children:[w(`monitor`,r?`收起`:`预览`,()=>d(r?null:e.id),{on:r}),w(`edit`,`编辑`,()=>y(`#/templates/edit/${encodeURIComponent(e.id)}`)),!t&&w(`star`,`设为默认`,()=>S(()=>n.setDefault(e.id),`默认模板已设为「${e.name}」`)),!e.builtin&&w(`trash`,`删除`,()=>C(e))]})]}),(0,N.jsx)(`div`,{className:`tpl-card-sum`,children:P(e.body)||`(空模板)`}),r&&(0,N.jsx)(`div`,{className:`tpl-preview`,children:(0,N.jsx)(`div`,{className:`tpl-preview-body mdw-lp-view`,dangerouslySetInnerHTML:{__html:c(e.body)}})})]},e.id)}),b.length&&!x.length?(0,N.jsx)(`div`,{className:`muted`,style:{padding:`8px 2px`},children:`(没有匹配的模板)`}):null]})]})}function I({config:t}){let n=s(),r=a(),i=n.tpl,o=(0,M.useMemo)(()=>A(t?.id),[t?.id]),c=x(o?{topic:o.topic||``,group:o.group||``,repo:o.repo||``}:{topic:`__no_topic__`}),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[v,b]=(0,M.useState)(!1),S=c.templates||[],w=h(S,l,e=>[e.name,e.body]),T=async(e,t)=>{if(!v){b(!0);try{await e(),t&&r(t)}catch(e){r(String(e.message||e))}finally{b(!1)}}},E=async(e,t)=>{if(e===t)return;let n=S.map(e=>e.id),r=n.indexOf(e),a=n.indexOf(t);r<0||a<0||(n.splice(r,1),n.splice(a,0,e),await T(()=>i.reorder(n)))},D=()=>{let e=o?.group?[`group:${o.group}`]:o?.repo?[`repo:${o.repo}`]:o?.topic?[`topic:${o.topic}`]:[];C(async()=>{let{openTemplateEditor:e}=await import(`./index-Bs5BehN8.js`).then(e=>e.p);return{openTemplateEditor:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(({openTemplateEditor:t})=>{n.model&&t(n.model,{mode:`new`,scope:e,topic:o?.topic||``,name:``})})},O=o?.label||o?.topic||o?.group||o?.repo||`本主题`;return(0,N.jsxs)(`div`,{className:`rp-page tpl-mng-page`,children:[(0,N.jsx)(y,{}),(0,N.jsxs)(`div`,{className:`page-head`,children:[(0,N.jsxs)(`div`,{className:`title-block`,children:[(0,N.jsxs)(`h2`,{children:[(0,N.jsx)(e,{name:`gear`,size:16}),` 管理模板 · `,O]}),(0,N.jsx)(`p`,{className:`muted tpl-head-note`,children:`这里管理本主题的模板:拖动左侧把手调整顺序,编辑正文 / 设默认 / 删除。搜索框会同步隐藏不匹配的行。`})]}),(0,N.jsx)(`div`,{className:`acts`,children:(0,N.jsxs)(g,{variant:`primary`,small:!0,disabled:v,onClick:D,children:[(0,N.jsx)(e,{name:`plus`,size:13}),` 新建模板`]})})]}),(0,N.jsx)(`div`,{className:`tpl-mng-search`,children:(0,N.jsx)(_,{value:l,onChange:u,placeholder:`搜索名称 / 正文…`,title:`过滤本主题模板`,count:w.length,className:`wide`})}),S.length?(0,N.jsx)(`div`,{className:`tpl-mng-list`,children:w.map(t=>{let r=t.id===i?.defaultId;return(0,N.jsxs)(`div`,{className:[`tpl-mng-row`,d===t.id?`is-dragging`:``,p===t.id&&d!==t.id?`is-over`:``].filter(Boolean).join(` `),draggable:!0,onDragStart:e=>{f(t.id),e.dataTransfer.effectAllowed=`move`},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,m(t.id)},onDrop:e=>{e.preventDefault(),m(null),d&&E(d,t.id),f(null)},onDragEnd:()=>{f(null),m(null)},children:[(0,N.jsx)(`span`,{className:`tpl-mng-grip`,title:`拖动排序`,children:(0,N.jsx)(e,{name:`grip`,size:14})}),(0,N.jsx)(`div`,{className:`tpl-mng-main`,children:(0,N.jsxs)(`div`,{className:`tpl-mng-line`,children:[(0,N.jsx)(`span`,{className:`tpl-mng-name`,children:t.name}),r&&(0,N.jsx)(`span`,{className:`tpl-badge`,children:`默认`}),t.builtin&&(0,N.jsx)(`span`,{className:`tpl-badge soft`,children:`内置`})]})}),(0,N.jsxs)(`div`,{className:`tpl-mng-acts`,children:[(0,N.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`编辑`,onClick:()=>n.onNavigate?.(`#/templates/edit/${encodeURIComponent(t.id)}`),children:(0,N.jsx)(e,{name:`edit`,size:14})}),!r&&(0,N.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`设为默认`,disabled:v,onClick:()=>T(()=>i.setDefault(t.id),`默认模板已设为「${t.name}」`),children:(0,N.jsx)(e,{name:`star`,size:14})}),!t.builtin&&(0,N.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`删除`,disabled:v,onClick:()=>T(()=>i.remove(t.id),`已删除「${t.name}」`),children:(0,N.jsx)(e,{name:`trash`,size:14})})]})]},t.id)})}):(0,N.jsx)(`div`,{className:`muted`,style:{padding:`8px 2px`},children:`本主题下没有可见模板。`})]})}function L({config:t}){let n=s(),r=a(),i=(0,M.useMemo)(()=>O(t?.id),[t?.id]),o=(0,M.useMemo)(()=>(n.tpl?.templates||[]).find(e=>e.id===(i||{})?.templateId)||null,[n.tpl?.templates,i]),c=(0,M.useMemo)(()=>o?E(o.body):[],[o]),[u,d]=(0,M.useState)(()=>{let e={};for(let t of c)e[t]=String((o?.values||{})[t]??``);return e});if(!i||!o)return(0,N.jsxs)(`div`,{className:`rp-page tpl-fill-page`,children:[(0,N.jsx)(y,{}),(0,N.jsx)(`div`,{className:`pad muted`,children:`参数会话已失效——请从「新建任务」下拉重新选择模板。`})]});let f=(e,t)=>d(n=>({...n,[e]:t})),p=e=>{let a={};i.board&&(a.board=i.board),i.project&&(a.project=i.project);let s=D({id:o.id,body:o.body,values:o.values},a,u),c=w(),d=i.groupId||i.dirKey||``,f=S(b(d),c);T(f,{title:l(s,``),body:s}),e&&j(f,{submit:!0}),k(t?.id);let p=i.groupId?{groupId:i.groupId,task:c,name:`新任务`}:{dirKey:i.dirKey,task:c,name:`新任务`};n.openPage?.(p),r(e?`正在提交任务…`:`已进入草稿编辑`)};return(0,N.jsxs)(`div`,{className:`rp-page tpl-fill-page`,children:[(0,N.jsx)(y,{}),(0,N.jsxs)(`div`,{className:`page-head`,children:[(0,N.jsxs)(`div`,{className:`title-block`,children:[(0,N.jsxs)(`h2`,{children:[(0,N.jsx)(e,{name:`list`,size:16}),` 填写模板参数`]}),(0,N.jsxs)(`p`,{className:`muted tpl-head-note`,children:[`「`,o.name,`」· 全部可选,留空即为空白。生成的是纯文本任务,编辑页不会再出现槽位框。`]})]}),(0,N.jsx)(`div`,{className:`acts`,children:(0,N.jsxs)(g,{variant:`secondary`,small:!0,onClick:()=>n.onNavigate?.(v()||`#/templates`),children:[(0,N.jsx)(e,{name:`back`,size:13}),` 返回`]})})]}),(0,N.jsx)(`div`,{className:`tpl-fill-body`,children:c.length===0?(0,N.jsx)(`div`,{className:`muted tpl-fill-empty`,children:`这条模板没有参数槽位,可直接进入任务编辑。`}):c.map(e=>(0,N.jsxs)(`label`,{className:`tpl-fill-field`,children:[(0,N.jsx)(`span`,{className:`tpl-fill-label`,children:e}),(0,N.jsx)(`textarea`,{className:`tpl-fill-input`,value:u[e]??``,placeholder:`填写「${e}」(可留空)`,onChange:t=>f(e,t.target.value),rows:4})]},e))}),(0,N.jsxs)(`div`,{className:`tpl-fill-foot`,children:[(0,N.jsxs)(g,{variant:`secondary`,onClick:()=>p(!1),children:[(0,N.jsx)(e,{name:`edit`,size:13}),` 进入编辑页(草稿)`]}),(0,N.jsxs)(g,{variant:`primary`,onClick:()=>p(!0),children:[(0,N.jsx)(e,{name:`check`,size:13}),` 直接提交`]})]})]})}var R=e=>`tpl:${e||`new`}`,z=`## 背景
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DqTSNBzX.js","assets/popup-BdVXUaJk.js","assets/popup-CHK8uSG4.css","assets/tool-bar-CAMqYt5j.js","assets/tool-bar-CLIs9Dr0.css","assets/repo-form-modal-awEPCcJK.js","assets/button-BRGGaUcY.js","assets/button-DA4lNJeC.css","assets/doc-R8KHVCxp.js","assets/app-context-KCsdqNTq.js","assets/task-status-Cjsm0xF7.js","assets/md-history-BR2jLhFQ.js","assets/use-rail-drag-C3GpkThI.js","assets/route-crumb-DvXzznKm.js","assets/board-view-C8OQhkyi.js","assets/doc-DgYKv2wo.css","assets/index-CUnLXQWJ.css"])))=>i.map(i=>d[i]);
2
+ import{a as e,d as t,f as n,h as r,i,l as a}from"./popup-BdVXUaJk.js";import{D as o}from"./tool-bar-CAMqYt5j.js";import{n as s}from"./app-context-KCsdqNTq.js";import{d as c,l}from"./task-status-Cjsm0xF7.js";import{a as u,i as d,n as f,r as p,t as m,u as h}from"./md-history-BR2jLhFQ.js";import{t as g}from"./button-BRGGaUcY.js";import{i as _,n as v,t as y}from"./route-crumb-DvXzznKm.js";import{S as b,d as x,h as S,m as C,v as w,x as T}from"./index-DqTSNBzX.js";import{n as E,t as D}from"./template-preview-CjQ-ucPt.js";import{i as O,r as k,t as A}from"./manage-session-CuaL7QqQ.js";import{t as j}from"./task-intent-CX5DZccN.js";var M=r(n(),1),N=t();function P(e){return String(e||``).split(`
3
+ `).map(e=>e.trim().replace(/^#{1,6}\s+/,``).replace(/^[-*+]\s+\[[ x]\]\s*/i,``).replace(/^[-*+]\s+/,``).replace(/^>\s?/,``)).filter(Boolean).slice(0,2).join(` · `)}function F(){let t=s(),n=t.tpl,r=a(),{dialog:o,node:l}=i(),[u,d]=(0,M.useState)(null),[f,p]=(0,M.useState)(!1),[m,v]=(0,M.useState)(``),y=e=>t.onNavigate?.(e);if(!n)return(0,N.jsx)(`div`,{className:`rp-page tpl-page`,children:(0,N.jsx)(`div`,{className:`muted`,style:{padding:20},children:`模板服务未就绪…`})});if(n.unsupported)return(0,N.jsx)(`div`,{className:`rp-page tpl-page`,children:(0,N.jsx)(`div`,{className:`muted`,style:{padding:20},children:`当前服务比面板旧——重启面板后才有模板功能。`})});let b=n.templates||[],x=h(b,m,e=>[e.name,P(e.body)]),S=async(e,t)=>{if(!f){p(!0);try{await e(),t&&r(t)}catch(e){r(String(e.message||e))}finally{p(!1)}}},C=async e=>{await o({title:`删除模板「${e.name}」`,danger:!0,okText:`删除`})&&await S(()=>n.remove(e.id),`已删除「${e.name}」`)},w=(t,n,r,i={})=>(0,N.jsxs)(`button`,{type:`button`,className:`tpl-act`+(i.on?` is-on`:``),title:n,disabled:f||i.disabled,onClick:r,children:[(0,N.jsx)(e,{name:t,size:16}),(0,N.jsx)(`span`,{children:n})]});return(0,N.jsxs)(`div`,{className:`rp-page tpl-page`,children:[l,(0,N.jsxs)(`div`,{className:`page-head`,children:[(0,N.jsxs)(`div`,{className:`title-block`,children:[(0,N.jsxs)(`h2`,{children:[(0,N.jsx)(e,{name:`list`,size:16}),` 任务模板`]}),(0,N.jsx)(`p`,{className:`muted tpl-head-note`,children:`新建任务时的正文骨架;正式内容在编辑页自行填写。`})]}),(0,N.jsx)(`div`,{className:`acts`,children:(0,N.jsxs)(g,{variant:`primary`,small:!0,disabled:f,onClick:()=>y(`#/templates/new`),children:[(0,N.jsx)(e,{name:`plus`,size:13}),` 新建`]})})]}),(0,N.jsx)(`div`,{className:`tpl-search`,children:(0,N.jsx)(_,{value:m,onChange:v,placeholder:`搜索名称 / 正文…`,title:`过滤任务模板`,count:x.length,className:`wide`})}),!b.length&&(0,N.jsx)(`div`,{className:`muted`,style:{padding:`8px 2px`},children:`还没有模板(内置默认模板加载中…)。`}),(0,N.jsxs)(`div`,{className:`tpl-list`,children:[x.map(e=>{let t=e.id===n.defaultId,r=u===e.id;return(0,N.jsxs)(`div`,{className:`tpl-card`+(t?` is-default`:``),children:[(0,N.jsxs)(`div`,{className:`tpl-card-head`,children:[(0,N.jsx)(`span`,{className:`tpl-card-name`,children:e.name}),t&&(0,N.jsx)(`span`,{className:`tpl-badge`,children:`默认`}),e.builtin&&(0,N.jsx)(`span`,{className:`tpl-badge soft`,children:`内置`}),(0,N.jsx)(`span`,{className:`grow tpl-card-grow`}),(0,N.jsxs)(`div`,{className:`tpl-card-acts`,children:[w(`monitor`,r?`收起`:`预览`,()=>d(r?null:e.id),{on:r}),w(`edit`,`编辑`,()=>y(`#/templates/edit/${encodeURIComponent(e.id)}`)),!t&&w(`star`,`设为默认`,()=>S(()=>n.setDefault(e.id),`默认模板已设为「${e.name}」`)),!e.builtin&&w(`trash`,`删除`,()=>C(e))]})]}),(0,N.jsx)(`div`,{className:`tpl-card-sum`,children:P(e.body)||`(空模板)`}),r&&(0,N.jsx)(`div`,{className:`tpl-preview`,children:(0,N.jsx)(`div`,{className:`tpl-preview-body mdw-lp-view`,dangerouslySetInnerHTML:{__html:c(e.body)}})})]},e.id)}),b.length&&!x.length?(0,N.jsx)(`div`,{className:`muted`,style:{padding:`8px 2px`},children:`(没有匹配的模板)`}):null]})]})}function I({config:t}){let n=s(),r=a(),i=n.tpl,o=(0,M.useMemo)(()=>A(t?.id),[t?.id]),c=x(o?{topic:o.topic||``,group:o.group||``,repo:o.repo||``}:{topic:`__no_topic__`}),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[v,b]=(0,M.useState)(!1),S=c.templates||[],w=h(S,l,e=>[e.name,e.body]),T=async(e,t)=>{if(!v){b(!0);try{await e(),t&&r(t)}catch(e){r(String(e.message||e))}finally{b(!1)}}},E=async(e,t)=>{if(e===t)return;let n=S.map(e=>e.id),r=n.indexOf(e),a=n.indexOf(t);r<0||a<0||(n.splice(r,1),n.splice(a,0,e),await T(()=>i.reorder(n)))},D=()=>{let e=o?.group?[`group:${o.group}`]:o?.repo?[`repo:${o.repo}`]:o?.topic?[`topic:${o.topic}`]:[];C(async()=>{let{openTemplateEditor:e}=await import(`./index-DqTSNBzX.js`).then(e=>e.p);return{openTemplateEditor:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(({openTemplateEditor:t})=>{n.model&&t(n.model,{mode:`new`,scope:e,topic:o?.topic||``,name:``})})},O=o?.label||o?.topic||o?.group||o?.repo||`本主题`;return(0,N.jsxs)(`div`,{className:`rp-page tpl-mng-page`,children:[(0,N.jsx)(y,{}),(0,N.jsxs)(`div`,{className:`page-head`,children:[(0,N.jsxs)(`div`,{className:`title-block`,children:[(0,N.jsxs)(`h2`,{children:[(0,N.jsx)(e,{name:`gear`,size:16}),` 管理模板 · `,O]}),(0,N.jsx)(`p`,{className:`muted tpl-head-note`,children:`这里管理本主题的模板:拖动左侧把手调整顺序,编辑正文 / 设默认 / 删除。搜索框会同步隐藏不匹配的行。`})]}),(0,N.jsx)(`div`,{className:`acts`,children:(0,N.jsxs)(g,{variant:`primary`,small:!0,disabled:v,onClick:D,children:[(0,N.jsx)(e,{name:`plus`,size:13}),` 新建模板`]})})]}),(0,N.jsx)(`div`,{className:`tpl-mng-search`,children:(0,N.jsx)(_,{value:l,onChange:u,placeholder:`搜索名称 / 正文…`,title:`过滤本主题模板`,count:w.length,className:`wide`})}),S.length?(0,N.jsx)(`div`,{className:`tpl-mng-list`,children:w.map(t=>{let r=t.id===i?.defaultId;return(0,N.jsxs)(`div`,{className:[`tpl-mng-row`,d===t.id?`is-dragging`:``,p===t.id&&d!==t.id?`is-over`:``].filter(Boolean).join(` `),draggable:!0,onDragStart:e=>{f(t.id),e.dataTransfer.effectAllowed=`move`},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,m(t.id)},onDrop:e=>{e.preventDefault(),m(null),d&&E(d,t.id),f(null)},onDragEnd:()=>{f(null),m(null)},children:[(0,N.jsx)(`span`,{className:`tpl-mng-grip`,title:`拖动排序`,children:(0,N.jsx)(e,{name:`grip`,size:14})}),(0,N.jsx)(`div`,{className:`tpl-mng-main`,children:(0,N.jsxs)(`div`,{className:`tpl-mng-line`,children:[(0,N.jsx)(`span`,{className:`tpl-mng-name`,children:t.name}),r&&(0,N.jsx)(`span`,{className:`tpl-badge`,children:`默认`}),t.builtin&&(0,N.jsx)(`span`,{className:`tpl-badge soft`,children:`内置`})]})}),(0,N.jsxs)(`div`,{className:`tpl-mng-acts`,children:[(0,N.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`编辑`,onClick:()=>n.onNavigate?.(`#/templates/edit/${encodeURIComponent(t.id)}`),children:(0,N.jsx)(e,{name:`edit`,size:14})}),!r&&(0,N.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`设为默认`,disabled:v,onClick:()=>T(()=>i.setDefault(t.id),`默认模板已设为「${t.name}」`),children:(0,N.jsx)(e,{name:`star`,size:14})}),!t.builtin&&(0,N.jsx)(`button`,{type:`button`,className:`iconbtn`,title:`删除`,disabled:v,onClick:()=>T(()=>i.remove(t.id),`已删除「${t.name}」`),children:(0,N.jsx)(e,{name:`trash`,size:14})})]})]},t.id)})}):(0,N.jsx)(`div`,{className:`muted`,style:{padding:`8px 2px`},children:`本主题下没有可见模板。`})]})}function L({config:t}){let n=s(),r=a(),i=(0,M.useMemo)(()=>O(t?.id),[t?.id]),o=(0,M.useMemo)(()=>(n.tpl?.templates||[]).find(e=>e.id===(i||{})?.templateId)||null,[n.tpl?.templates,i]),c=(0,M.useMemo)(()=>o?E(o.body):[],[o]),[u,d]=(0,M.useState)(()=>{let e={};for(let t of c)e[t]=String((o?.values||{})[t]??``);return e});if(!i||!o)return(0,N.jsxs)(`div`,{className:`rp-page tpl-fill-page`,children:[(0,N.jsx)(y,{}),(0,N.jsx)(`div`,{className:`pad muted`,children:`参数会话已失效——请从「新建任务」下拉重新选择模板。`})]});let f=(e,t)=>d(n=>({...n,[e]:t})),p=e=>{let a={};i.board&&(a.board=i.board),i.project&&(a.project=i.project);let s=D({id:o.id,body:o.body,values:o.values},a,u),c=w(),d=i.groupId||i.dirKey||``,f=S(b(d),c);T(f,{title:l(s,``),body:s}),e&&j(f,{submit:!0}),k(t?.id);let p=i.groupId?{groupId:i.groupId,task:c,name:`新任务`}:{dirKey:i.dirKey,task:c,name:`新任务`};n.openPage?.(p),r(e?`正在提交任务…`:`已进入草稿编辑`)};return(0,N.jsxs)(`div`,{className:`rp-page tpl-fill-page`,children:[(0,N.jsx)(y,{}),(0,N.jsxs)(`div`,{className:`page-head`,children:[(0,N.jsxs)(`div`,{className:`title-block`,children:[(0,N.jsxs)(`h2`,{children:[(0,N.jsx)(e,{name:`list`,size:16}),` 填写模板参数`]}),(0,N.jsxs)(`p`,{className:`muted tpl-head-note`,children:[`「`,o.name,`」· 全部可选,留空即为空白。生成的是纯文本任务,编辑页不会再出现槽位框。`]})]}),(0,N.jsx)(`div`,{className:`acts`,children:(0,N.jsxs)(g,{variant:`secondary`,small:!0,onClick:()=>n.onNavigate?.(v()||`#/templates`),children:[(0,N.jsx)(e,{name:`back`,size:13}),` 返回`]})})]}),(0,N.jsx)(`div`,{className:`tpl-fill-body`,children:c.length===0?(0,N.jsx)(`div`,{className:`muted tpl-fill-empty`,children:`这条模板没有参数槽位,可直接进入任务编辑。`}):c.map(e=>(0,N.jsxs)(`label`,{className:`tpl-fill-field`,children:[(0,N.jsx)(`span`,{className:`tpl-fill-label`,children:e}),(0,N.jsx)(`textarea`,{className:`tpl-fill-input`,value:u[e]??``,placeholder:`填写「${e}」(可留空)`,onChange:t=>f(e,t.target.value),rows:4})]},e))}),(0,N.jsxs)(`div`,{className:`tpl-fill-foot`,children:[(0,N.jsxs)(g,{variant:`secondary`,onClick:()=>p(!1),children:[(0,N.jsx)(e,{name:`edit`,size:13}),` 进入编辑页(草稿)`]}),(0,N.jsxs)(g,{variant:`primary`,onClick:()=>p(!0),children:[(0,N.jsx)(e,{name:`check`,size:13}),` 直接提交`]})]})]})}var R=e=>`tpl:${e||`new`}`,z=`## 背景
4
4
 
5
5
 
6
6
  ## 验收
@@ -12,7 +12,7 @@
12
12
  <!-- .ico 兜底:浏览器不认上面的 <link> 时会自己请求 /favicon.ico -->
13
13
  <link rel="icon" type="image/x-icon" href="/favicon.ico">
14
14
  <link rel="apple-touch-icon" sizes="512x512" href="/logo-rounded.png">
15
- <script type="module" crossorigin src="/assets/index-Bs5BehN8.js"></script>
15
+ <script type="module" crossorigin src="/assets/index-DqTSNBzX.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="/assets/popup-BdVXUaJk.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/tool-bar-CAMqYt5j.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/button-BRGGaUcY.js">
@@ -28,7 +28,7 @@
28
28
  <link rel="stylesheet" crossorigin href="/assets/tool-bar-CLIs9Dr0.css">
29
29
  <link rel="stylesheet" crossorigin href="/assets/button-DA4lNJeC.css">
30
30
  <link rel="stylesheet" crossorigin href="/assets/doc-DgYKv2wo.css">
31
- <link rel="stylesheet" crossorigin href="/assets/index-GyxCJY9y.css">
31
+ <link rel="stylesheet" crossorigin href="/assets/index-CUnLXQWJ.css">
32
32
  </head>
33
33
  <body>
34
34
  <div id="root"></div>
@@ -1 +0,0 @@
1
- .setp{height:100%;min-height:0;color:var(--ink);font-size:12.5px;display:flex}.setp-nav{background:var(--soft);border-right:1px solid var(--line);flex-direction:column;flex:none;gap:2px;width:172px;padding:10px 8px;display:flex;overflow:auto}.setp-navitem{cursor:pointer;text-align:left;width:100%;color:var(--ink-2);background:0 0;border:0;border-radius:6px;align-items:center;gap:8px;padding:7px 9px;font-family:inherit;font-size:12.5px;display:flex}.setp-navitem:hover{background:var(--soft-2);color:var(--ink)}.setp-navitem.on{background:var(--paper);color:var(--ink);font-weight:650;box-shadow:0 1px 2px #14161a12}.setp-navitem .ic{color:var(--mid)}.setp-navitem.on .ic{color:var(--ink)}.setp-body{flex-direction:column;flex:1;gap:10px;min-width:0;padding:12px 16px 18px;display:flex;overflow:auto}.setp-h{letter-spacing:1px;color:var(--mid);text-transform:uppercase;font:600 10.5px Bahnschrift,Segoe UI,sans-serif}.setp-row{justify-content:space-between;align-items:center;gap:10px;min-height:26px;display:flex}.setp-row>span:first-child{color:var(--ink-2)}.setp-row .toggle{flex:none}.setp-input{flex:1;align-items:center;gap:6px;min-width:0;display:flex}.setp-input input{border:1px solid var(--line);background:var(--paper);min-width:0;height:24px;color:var(--ink);border-radius:6px;flex:1;padding:0 8px;font:400 11.5px ui-monospace,Consolas,monospace}.setp-input input:focus{outline:2px solid var(--soft-2);outline-offset:-1px}.setp-note{color:var(--faint);font-size:11px;line-height:1.65}.setp-gc-actions{flex:none;align-items:center;gap:6px;display:flex}.setp-gc-list{flex-direction:column;gap:6px;min-width:0;display:flex}.setp-gc-item{border:1px solid var(--line);background:var(--paper);border-radius:8px;flex-direction:column;gap:4px;min-width:0;padding:7px 9px;display:flex}.setp-gc-item.is-due{border-color:var(--mdw-accent-line,#b7d4c8);background:var(--mdw-accent-soft,#e8f2ee)}.setp-gc-main{flex-wrap:wrap;align-items:center;gap:6px;min-width:0;display:flex}.setp-gc-main b{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:12px;font-weight:600;overflow:hidden}.setp-gc-meta{color:var(--ink-2);flex-wrap:wrap;align-items:baseline;gap:10px;font-size:11px;display:flex}.setp-gc-meta code{color:var(--mid);font:400 10.5px ui-monospace,Consolas,monospace}.setp-gc-path{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;color:var(--faint);overflow:hidden}.setp-gc-log{color:var(--ink-2);font-size:11px;line-height:1.6}.setp-gc-log code{color:var(--mid);font:400 10.5px ui-monospace,Consolas,monospace}.setp-badge{color:var(--mid);background:var(--soft);border-radius:8px;align-items:center;padding:0 6px;font-size:10px;line-height:1.6;display:inline-flex}.setp-badge.soft{color:var(--faint,#8a8578);border:1px solid var(--line);background:0 0}.setp-proj-a{border-top:1px solid var(--line,#e4e2dc);flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px;padding-top:12px;display:flex}.setp-proj-a .spacer{flex:auto}.setp-suffix{flex-direction:column;gap:8px;margin-top:4px;display:flex}.setp-suffix-item{align-items:flex-start;gap:6px;display:flex}.setp-suffix-item .setp-suffix-no{color:var(--faint);text-align:right;flex:none;min-width:16px;margin-top:8px;font-family:ui-monospace,Consolas,monospace;font-size:10.5px}.setp-suffix-item .setp-suffix-ta{min-height:64px}.setp-suffix-item .btn{flex:none;margin-top:6px}.setp-suffix-ta{resize:vertical;border:1px solid var(--line);background:var(--paper);width:100%;min-height:110px;color:var(--ink);border-radius:8px;padding:8px 10px;font:400 11.5px/1.7 ui-monospace,Consolas,monospace}.setp-suffix-ta:focus{outline:2px solid var(--soft-2);outline-offset:-1px}.setp-suffix .mono{background:var(--soft);border-radius:4px;padding:0 4px;font-family:ui-monospace,Consolas,monospace;font-size:10.5px}.setp-prompts{background:0 0;border:0;border-radius:0;flex-direction:column;gap:0;min-height:0;margin-top:2px;display:flex}.setp-prompts-nav{border-bottom:1px solid var(--line,#e4e2dc);background:0 0;flex:none;align-items:center;gap:4px;padding:2px 0 8px;display:flex}.setp-prompts-tab{cursor:pointer;color:var(--ink-2,#4b515a);background:0 0;border:0;border-radius:999px;padding:4px 12px;font:600 12px inherit}.setp-prompts-tab:hover{background:var(--soft,#f1f0ec);color:var(--ink,#16181c)}.setp-prompts-tab.is-on{background:var(--mdw-accent-soft,#e8f2ee);color:var(--mdw-accent,#2f6f5e)}.setp-prompts-pane{flex:1;min-width:0;padding:12px 14px 14px;overflow:auto}.setp-prompts-pane>*{max-width:720px}.setp-tpl{flex-direction:column;gap:10px;min-width:0;display:flex}.setp-tpl-cards{flex-direction:column;gap:10px;display:flex}.setp-tpl-card{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);border-radius:10px;flex-direction:column;gap:8px;min-width:0;padding:12px 12px 10px;display:flex}.setp-tpl-card.is-default{border-color:var(--mdw-accent-line,#b7d4c8)}.setp-tpl-card-head{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}.setp-tpl-card-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;color:var(--ink,#16181c);font-size:13px;font-weight:600;overflow:hidden}.setp-tpl-card-scope{padding-top:2px}.setp-tpl-card-foot{flex-wrap:wrap;align-items:center;gap:6px;min-width:0;display:flex}.setp-tpl-card-new{justify-content:flex-start;display:flex}.setp-scope-block{flex-direction:column;gap:6px;display:flex}.setp-scope{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.setp-scope-label{color:var(--ink-2,#4b515a);font-size:11.5px}.setp-scope-chip{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);color:var(--ink-2,#4b515a);font:inherit;cursor:pointer;border-radius:999px;padding:2px 10px;font-size:11.5px}.setp-scope-chip:hover{border-color:var(--mdw-accent-line,#b7d4c8)}.setp-scope-chip.on{background:var(--mdw-accent-soft,#e8f2ee);border-color:var(--mdw-accent-line,#b7d4c8);color:var(--mdw-accent,#2f6f5e)}.setp-scope-none{color:#9e4c00;font-size:11px}.setp-scope-origin{color:var(--faint,#8a8578);margin-left:auto;font-size:11px}.setp-scope-add{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.setp-scope-add-label{color:var(--faint,#8a8578);font-size:11px}.setp-scope-add-btn{border:1px dashed var(--line,#e4e2dc);color:var(--ink-2,#4b515a);font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:11px}.setp-scope-add-btn:hover{border-color:var(--mdw-accent-line,#b7d4c8);color:var(--mdw-accent,#2f6f5e)}.setp-scope-add-btn.on{border-style:solid;border-color:var(--mdw-accent-line,#b7d4c8);background:var(--mdw-accent-soft,#e8f2ee);color:var(--mdw-accent,#2f6f5e)}.setp-scope-pick{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);border-radius:8px;flex-direction:column;gap:2px;max-height:160px;padding:6px;display:flex;overflow:auto}.setp-scope-pick-empty{color:var(--faint,#8a8578);padding:6px 8px;font-size:11.5px}.setp-scope-pick-it{cursor:pointer;text-align:left;width:100%;font:inherit;color:var(--ink,#16181c);background:0 0;border:0;border-radius:6px;align-items:center;gap:8px;padding:5px 8px;font-size:12px;display:flex}.setp-scope-pick-it:hover:not(:disabled){background:var(--soft,#f1f0ec)}.setp-scope-pick-it:disabled{opacity:.55;cursor:default}.setp-scope-pick-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.setp-scope-pick-done{color:var(--faint,#8a8578);flex:none;font-size:10.5px}.setp-tpl-editor{flex-direction:column;gap:10px;min-width:0;display:flex}.setp-prompts-pane>.setp-tpl-editor{max-width:880px}.ppt-split{flex-wrap:wrap;align-items:flex-start;gap:12px;min-width:0;display:flex}.ppt-rail{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);border-radius:10px;flex-direction:column;flex:0 190px;min-width:150px;display:flex;overflow:hidden}.ppt-rail-head{background:var(--soft,#f1f0ec);border-bottom:1px solid var(--line,#e4e2dc);align-items:baseline;gap:6px;padding:7px 10px;display:flex}.ppt-rail-head b{font-size:11.5px}.ppt-rail-list,.ppt-grp{flex-direction:column;min-width:0;display:flex}.ppt-grp+.ppt-grp{border-top:1px solid var(--soft-2,#e4e2dc)}.ppt-grp-head{background:var(--soft,#f1f0ec);color:var(--mid,#8a8578);white-space:nowrap;text-overflow:ellipsis;padding:4px 9px;font:600 10.5px/1.5 ui-monospace,Consolas,monospace;overflow:hidden}.ppt-rail-row{cursor:pointer;border-top:1px solid #0000;border-bottom:1px solid #0000;align-items:center;gap:7px;min-width:0;padding:6px 9px;display:flex}.ppt-rail-row+.ppt-rail-row{border-top-color:var(--soft-2,#e4e2dc)}.ppt-rail-row:hover{background:var(--soft,#f1f0ec)}.ppt-rail-row.is-on{background:var(--mdw-accent-soft,#e8f2ee)}.ppt-rail-row:focus-visible{outline:2px solid var(--mdw-accent-line,#b7d4c8);outline-offset:-2px}.ppt-rail-pos{text-align:right;width:12px;color:var(--mid,#8a8578);flex:none;font:600 10.5px/1.5 ui-monospace,Consolas,monospace}.ppt-rail-main{flex-direction:column;flex:1;min-width:0;display:flex}.ppt-rail-label{white-space:nowrap;text-overflow:ellipsis;font-size:11.5px;overflow:hidden}.ppt-rail-row.is-on .ppt-rail-label{color:var(--mdw-accent,#2f6f5e);font-weight:600}.ppt-rail-active{color:var(--faint,#8a8578);white-space:nowrap;text-overflow:ellipsis;font-size:10.5px;overflow:hidden}.ppt-ed{flex-direction:column;flex:300px;gap:9px;min-width:0;display:flex}.ppt-ed-head{flex-wrap:wrap;align-items:center;gap:4px 8px;display:flex}.ppt-ed-title{flex-wrap:wrap;align-items:baseline;gap:7px;min-width:0;display:flex}.ppt-ed-title b{font-size:13px}.ppt-ed-tag{color:var(--ink-2,#4b515a);background:var(--soft,#f1f0ec);border-radius:4px;padding:1px 5px;font:400 11px ui-monospace,Consolas,monospace}.ppt-pill{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);color:var(--mid,#8a8578);border-radius:4px;padding:0 5px;font-size:10.5px}.ppt-pill.is-write{color:var(--mdw-accent,#2f6f5e);border-color:var(--mdw-accent-line,#b7d4c8);background:var(--mdw-accent-soft,#e8f2ee)}.ppt-pill.is-on{color:var(--mdw-accent,#2f6f5e);border-color:var(--mdw-accent-line,#b7d4c8)}.ppt-ed-sub{color:var(--faint,#8a8578);flex:100%;font-size:11px}.ppt-ro-note{color:var(--faint,#8a8578);border:1px dashed var(--line,#e4e2dc);background:var(--soft,#f1f0ec);border-radius:8px;padding:6px 9px;font-size:11px;line-height:1.6}.ppt-ro-note code{color:var(--ink-2,#4b515a);font:400 10.5px ui-monospace,Consolas,monospace}.ppt-tpl-area{resize:vertical;border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);width:100%;min-height:170px;color:var(--ink,#16181c);border-radius:8px;padding:8px 10px;font:400 11.5px/1.75 ui-monospace,Consolas,monospace}.ppt-tpl-area:focus{outline:2px solid var(--soft-2,#e4e2dc);outline-offset:-1px}.ppt-tpl-area[readonly]{background:var(--soft,#f1f0ec);color:var(--ink-2,#4b515a)}.ppt-vars{border:1px dashed var(--line,#e4e2dc);background:var(--soft,#f1f0ec);border-radius:8px;flex-direction:column;gap:5px;padding:6px 9px;display:flex}.ppt-vars-head{align-items:center;gap:8px;min-width:0;display:flex}.ppt-vars-cap{color:var(--faint,#8a8578);white-space:nowrap;font-size:10.5px}.ppt-vars-q{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);min-width:0;height:22px;color:var(--ink,#16181c);font:inherit;border-radius:5px;flex:1;padding:0 7px;font-size:11px}.ppt-vars-q:focus{outline:2px solid var(--soft-2,#e4e2dc);outline-offset:-1px}.ppt-vars-body{flex-direction:column;gap:6px;min-width:0;max-height:200px;display:flex;overflow:auto}.ppt-vars-grp{flex-direction:column;gap:3px;min-width:0;display:flex}.ppt-vars-grp+.ppt-vars-grp{border-top:1px solid var(--soft-2,#e4e2dc);padding-top:5px}.ppt-vars-grp-head{color:var(--mid,#8a8578);white-space:nowrap;text-overflow:ellipsis;font:600 10.5px/1.5 ui-monospace,Consolas,monospace;overflow:hidden}.ppt-vars-chips{flex-wrap:wrap;gap:3px 6px;min-width:0;display:flex}.ppt-var{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);max-width:100%;color:var(--ink,#16181c);cursor:default;border-radius:4px;align-items:baseline;gap:5px;padding:1px 5px;font:400 11px/1.5 ui-monospace,Consolas,monospace;display:inline-flex}.ppt-var-key{flex:none}.ppt-tpl-bar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px;display:flex}.ppt-tpl-select{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);max-width:220px;color:var(--ink,#16181c);border-radius:6px;padding:4px 8px;font:400 12px/1.6 system-ui,sans-serif}.ppt-tpl-name{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);width:150px;color:var(--ink,#16181c);border-radius:6px;padding:4px 8px;font:400 12px/1.6 system-ui,sans-serif}.ppt-var-desc{color:var(--faint,#8a8578);white-space:nowrap;text-overflow:ellipsis;max-width:220px;font-family:system-ui,sans-serif;font-size:10.5px;overflow:hidden}.ppt-var[aria-disabled=true]{cursor:default}.ppt-actions{border-top:1px solid var(--line,#e4e2dc);flex-wrap:wrap;align-items:center;gap:6px;padding-top:9px;display:flex}.ppt-actions .spacer{flex:1}.ppt-preview-btn{color:var(--mdw-accent,#2f6f5e);border-color:var(--mdw-accent-line,#b7d4c8);background:var(--mdw-accent-soft,#e8f2ee)}.ppt-pv{border:1px solid var(--line,#e4e2dc);background:var(--soft,#f1f0ec);border-radius:8px;overflow:hidden}.ppt-pv-head{width:100%;font:inherit;text-align:left;color:inherit;cursor:pointer;background:0 0;border:0;align-items:baseline;gap:8px;padding:7px 10px;display:flex}.ppt-pv-head b{flex:none;font-size:11.5px}.ppt-pv-head .setp-note{flex:1;min-width:0}.ppt-pv-toggle{color:var(--mdw-accent,#2f6f5e);flex:none;font-size:10.5px}.ppt-pv-body{border-top:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);flex-direction:column;gap:6px;padding:8px 10px;display:flex}.ppt-pv-pre{white-space:pre-wrap;word-break:break-word;max-height:300px;color:var(--ink,#16181c);margin:0;font:400 11.5px/1.7 ui-monospace,Consolas,monospace;overflow:auto}.ppt-pv-segs{flex-wrap:wrap;gap:4px 10px;display:flex}.ppt-pv-seg{align-items:baseline;gap:5px;font-size:11px;display:inline-flex}.ppt-pv-seg-label{color:var(--ink-2,#4b515a)}.ppt-pv-seg code{background:var(--soft,#f1f0ec);color:var(--mid,#8a8578);border-radius:4px;padding:0 4px;font:400 10.5px ui-monospace,Consolas,monospace}.ppt-pv-empty{color:var(--faint,#8a8578);font-size:11.5px}.setp-blocks{flex-direction:column;gap:10px;display:flex}.setp-blocks .setp-row{margin:0}.setp-tpl-head{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:6px;display:flex}.setp-tpl-head-label{color:var(--ink-2,#4b515a);font-size:12px}.setp-seg{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);border-radius:6px;display:inline-flex;overflow:hidden}.setp-seg-btn{font:inherit;white-space:nowrap;color:var(--faint,#8a8578);cursor:pointer;background:0 0;border:0;padding:3px 8px;font-size:11.5px;line-height:1.2}.setp-seg-btn+.setp-seg-btn{border-left:1px solid var(--line,#e4e2dc)}.setp-seg-btn.is-on{background:var(--mdw-accent-soft,#e8f2ee);color:var(--ink,#16181c);font-weight:600}.setp-seg-btn:disabled{cursor:default;opacity:.6}.setp-block{border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);border-radius:8px;flex-direction:column;gap:6px;padding:8px 10px;display:flex}.setp-block.is-off{opacity:.55}.setp-block-head{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.setp-block-toggle{cursor:pointer;align-items:center;gap:6px;font-size:12px;display:flex}.setp-block-toggle b{font-weight:600}.setp-block-tag{color:var(--ink-2,#4b515a);background:var(--soft,#f1f0ec);border-radius:4px;padding:1px 5px;font:400 11px ui-monospace,Consolas,monospace}.setp-block-preset{font:inherit;border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);color:var(--ink,#16181c);border-radius:6px;padding:3px 6px;font-size:11.5px}.setp-blocks .setp-area{resize:vertical;border:1px solid var(--line,#e4e2dc);background:var(--paper,#fff);width:100%;min-height:70px;color:var(--ink,#16181c);border-radius:8px;padding:8px 10px;font:400 11.5px/1.7 ui-monospace,Consolas,monospace}.setp-blocks .setp-area:focus{outline:2px solid var(--soft-2,#e4e2dc);outline-offset:-1px}.setp-vars{flex-direction:column;gap:6px;min-width:0;display:flex}.setp-vars-wrap{overflow-x:auto}.setp-vars table{border-collapse:collapse;width:100%;min-width:420px;margin:2px 0 10px;font-size:11.5px}.setp-vars th,.setp-vars td{text-align:left;border-bottom:1px solid var(--line,#e4e2dc);vertical-align:top;padding:4px 8px}.setp-vars th{color:var(--mid,#8a8578);white-space:nowrap;font-weight:600}.setp-vars td:first-child{white-space:nowrap}.setp-vars code{background:var(--soft,#f1f0ec);color:var(--ink,#16181c);border-radius:4px;padding:1px 4px;font:400 11px/1.5 ui-monospace,Consolas,monospace}.setp-vars h4{color:var(--ink,#16181c);margin:10px 0 2px;font-size:12px}.setp-seg{border:1px solid var(--soft-2,#e4e2dc);border-radius:7px;flex:none;display:inline-flex;overflow:hidden}.setp-seg .seg{cursor:pointer;font:inherit;color:var(--ink-2,#4b515a);background:0 0;border:0;padding:4px 12px;font-size:12px}.setp-seg .seg+.seg{border-left:1px solid var(--soft-2,#e4e2dc)}.setp-seg .seg.on{background:var(--ink,#16181c);color:var(--paper,#fff);font-weight:600}