dev-process-kit 0.0.11 → 0.0.13

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 (39) hide show
  1. package/dist/THIRD_PARTY_LICENSES.md +46 -0
  2. package/dist/chunks/{shared-CrE-y5oF.js → shared-0MFKKPnB.js} +165 -96
  3. package/dist/chunks/shared-B2YRwZ0P.js +2062 -0
  4. package/dist/chunks/{shared-OGH3pSVq.js → shared-B4Mwapvi.js} +89 -63
  5. package/dist/chunks/shared-BDUe3aT-.js +1 -0
  6. package/dist/chunks/{shared-DGI_sFo5.js → shared-C1KQ5iU8.js} +55 -32
  7. package/dist/chunks/{shared-BgCDocVX.js → shared-CQG0dnvb.js} +17 -7
  8. package/dist/chunks/shared-CSC14I4g.js +2370 -0
  9. package/dist/chunks/shared-Cd8A5TjZ.js +2428 -0
  10. package/dist/chunks/shared-CirHYajF.js +30 -0
  11. package/dist/chunks/shared-D4K7KsfJ.js +1 -0
  12. package/dist/chunks/{shared-TW6kWbUL.js → shared-D7poXZ0z.js} +17 -9
  13. package/dist/chunks/shared-DO0pUSjw.js +571 -0
  14. package/dist/chunks/shared-DdefS1nG.js +1 -0
  15. package/dist/chunks/{shared-BSFZSMH5.js → shared-DjmQsa0n.js} +1 -1
  16. package/dist/chunks/{shared-DZfXwU7f.js → shared-DklLt1Sc.js} +1 -1
  17. package/dist/chunks/{shared-CHaHI5X3.js → shared-DrMSORn-.js} +34 -11
  18. package/dist/chunks/shared-DxAiavwJ.js +1102 -0
  19. package/dist/chunks/shared-aDPp8Vry.js +1 -0
  20. package/dist/components.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/templates/delegation-poker.js +1 -1
  23. package/dist/templates/event-storming.js +1 -1
  24. package/dist/templates/example-mapping.js +1 -1
  25. package/dist/templates/grill.js +1 -1
  26. package/dist/templates/plain.js +1 -1
  27. package/dist/templates/prototype.js +1 -1
  28. package/dist/templates/slides.js +1 -1
  29. package/dist/templates/task-board.js +1 -1
  30. package/dist/templates/usm.js +1 -1
  31. package/dist/templates/whiteboard.js +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunks/shared-B4ewpBuM.js +0 -30
  34. package/dist/chunks/shared-B9OVJ7XA.js +0 -556
  35. package/dist/chunks/shared-BHRhwgui.js +0 -1252
  36. package/dist/chunks/shared-B_MMP97h.js +0 -2402
  37. package/dist/chunks/shared-CxFItadP.js +0 -1094
  38. package/dist/chunks/shared-DIJgMVpY.js +0 -2239
  39. package/dist/chunks/shared-xrCdgpNS.js +0 -1
@@ -1,4 +1,4 @@
1
- import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,ai as V,p as $,v as Uo,av as qo,as as Io,ak as Qo,am as B,P as Ho,e as Mo,a0 as Ko,V as Fo,R as S,a3 as s,a4 as n,A as jo,a5 as y,aT as Z,aU as Yo,aF as P,K as Xo,aC as Jo,a2 as Vo,T as oo,l as Zo,aH as oe}from"./shared-B_MMP97h.js";const eo=["working","waiting","blocked","done"],D=["todo","doing","blocked","done"],ao=["agent","human"],E=["why","what","goals","nonGoals"],T=J(c(),V(1)),ee=b({id:h,name:T,kind:i(w(ao),"agent")}),ae=b({id:h,title:T,status:i(w(D),"todo"),assignee:i(h),note:i(c()),proposed:i(X(),!1),reason:i(c())}),te=b({id:h,label:i(c()),href:T,kind:i(c()),description:i(c())}),re=b({why:i(c()),what:i(c()),goals:i(f(c()),[]),nonGoals:i(f(c()),[])}),ne=b({id:h,from:i(h),at:i(c()),title:i(c()),body:i(c()),points:i(f(c()),[])}),de=b({id:h,ref:i(T),title:T,description:i(c()),blocking:i(X(),!1),assumption:i(c())}),to=b({title:i(c(),""),status:i(w(eo)),updatedAt:i(c()),context:i(re,{}),members:i(f(ee),[]),todos:i(f(ae),[]),outputs:i(f(te),[]),log:i(f(ne),[]),questions:i(f(de),[])}),A=(e,o)=>{const a=new Set;for(const t of o){if(a.has(t))throw new Error(`duplicate ${e} id: ${t}`);a.add(t)}},u=e=>e===void 0||e.trim()===""?null:e,W=e=>e.filter(o=>o.trim()!==""),ro=e=>{const o=Ro(to,e);A("member",o.members.map(t=>t.id)),A("todo",o.todos.map(t=>t.id)),A("output",o.outputs.map(t=>t.id)),A("log",o.log.map(t=>t.id)),A("question",o.questions.map(t=>t.id));const a=new Set(o.members.map(t=>t.id));for(const t of o.todos)if(t.assignee!==void 0&&!a.has(t.assignee))throw new Error(`todo ${t.id} is assigned to ${t.assignee}, which is not in members`);for(const t of o.log){if(t.from!==void 0&&!a.has(t.from))throw new Error(`log entry ${t.id} is from ${t.from}, which is not in members`);if(u(t.title)===null&&u(t.body)===null)throw new Error(`log entry ${t.id} needs a title or a body`)}for(const t of o.questions)if(!t.blocking&&u(t.assumption)===null)throw new Error(`question ${t.id} does not block, so it needs the assumption the agent works on`);return{title:o.title,status:o.status??null,updatedAt:u(o.updatedAt),context:{why:u(o.context.why),what:u(o.context.what),goals:W(o.context.goals),nonGoals:W(o.context.nonGoals)},members:o.members,todos:o.todos.map(t=>({id:t.id,title:t.title,status:t.status,assignee:t.assignee??null,note:u(t.note),proposed:t.proposed,reason:u(t.reason),added:!1})),outputs:o.outputs.map(t=>({id:t.id,label:u(t.label),href:t.href,kind:u(t.kind),description:u(t.description)})),log:o.log.map(t=>({id:t.id,from:t.from??null,at:u(t.at),title:u(t.title),body:u(t.body),points:W(t.points)})),questions:o.questions.map((t,r)=>({id:t.id,ref:t.ref??`Q${r+1}`,title:t.title,description:u(t.description),blocking:t.blocking,assumption:u(t.assumption)})),answers:{},decisions:{}}},no=()=>({title:"",status:null,updatedAt:null,context:{why:null,what:null,goals:[],nonGoals:[]},members:[],todos:[],outputs:[],log:[],questions:[],answers:{},decisions:{}}),O=(e,o)=>o===null?void 0:e.members.find(a=>a.id===o),k=(e,o)=>e.todos.find(a=>a.id===o),so=(e,o)=>e.log.find(a=>a.id===o),io=e=>E.includes(e),N=(e,o)=>{const a=e.context[o];return typeof a=="string"||a!==null&&a.length>0},C=(e,o)=>e.questions.find(a=>a.id===o),lo=(e,o)=>{const a=e.answers[o.id];return a===void 0?!1:a.kind==="approve"||a.text.trim()!==""},R=(e,o)=>!o.proposed||e.decisions[o.id]==="accept",U=(e,o)=>R(e,o)&&O(e,o.assignee)?.kind==="human",po=(e,o,a)=>{const t={...e};return a===null?delete t[o]:t[o]=a,t},q=(e,o,a)=>({...e,answers:po(e.answers,o,a)}),se=(e,o,a)=>({...e,decisions:po(e.decisions,o,a)}),ie=(e,o,a)=>({...e,todos:e.todos.map(t=>t.id===o?a(t):t)}),m={ANSWER_QUESTION:$("ANSWER_QUESTION","question",Qo("kind",[b({kind:B("approve")}),b({kind:B("answer"),text:c()}),b({kind:B("clear")})])),DECIDE_PROPOSAL:$("DECIDE_PROPOSAL","todo",b({decision:w(["accept","decline","clear"])})),SET_TODO_STATUS:$("SET_TODO_STATUS","todo",b({status:w(D)})),ADD_TODO:$("ADD_TODO","page",b({id:h,title:J(c(),Io(),V(1)),assignee:qo(h)}),{dedupeKey:Uo}),DELETE_TODO:$("DELETE_TODO","todo",b({}))},co={type:"page",id:"task-board"},I=(e,o)=>({type:"ANSWER_QUESTION",target:{type:"question",id:e},payload:o}),uo=(e,o)=>({type:"DECIDE_PROPOSAL",target:{type:"todo",id:e},payload:{decision:o}}),bo=(e,o)=>({type:"SET_TODO_STATUS",target:{type:"todo",id:e},payload:{status:o}}),go=(e,o,a)=>({type:"ADD_TODO",target:co,payload:{id:e,title:o,assignee:a}}),ho=e=>({type:"DELETE_TODO",target:{type:"todo",id:e},payload:{}}),ko=(e,o)=>{const a=Ho(m,o);if(a===null)return null;const t=a.target.id;switch(a.type){case"ANSWER_QUESTION":{const r=C(e,t);if(r===void 0)return null;const d=a.payload;return d.kind==="clear"?q(e,t,null):d.kind==="approve"?r.assumption===null?null:q(e,t,{kind:"approve"}):q(e,t,{kind:"answer",text:d.text})}case"DECIDE_PROPOSAL":{if(k(e,t)?.proposed!==!0)return null;const{decision:r}=a.payload;return se(e,t,r==="clear"?null:r)}case"SET_TODO_STATUS":{const r=k(e,t);if(r===void 0||!U(e,r))return null;const{status:d}=a.payload;return ie(e,t,l=>({...l,status:d}))}case"ADD_TODO":{const{payload:r}=a;return k(e,r.id)!==void 0||r.assignee!==null&&O(e,r.assignee)===void 0?null:{...e,todos:[...e.todos,{id:r.id,title:r.title,status:"todo",assignee:r.assignee,note:null,proposed:!1,reason:null,added:!0}]}}case"DELETE_TODO":return k(e,t)?.added!==!0?null:{...e,todos:e.todos.filter(r=>r.id!==t)};default:return Mo(a)}},Q=Ko({en:{wholeBoard:"Whole board",statusWorking:"Working",statusWaiting:"Waiting on you",statusBlocked:"Blocked",statusDone:"Done",todoTodo:"To do",todoDoing:"In progress",todoBlocked:"Blocked",todoDone:"Done",kindAgent:"Agent",kindHuman:"Human",updatedAt:e=>`Updated ${e}`,context:"What this task is about",contextWhy:"Why",contextWhat:"What",contextGoals:"Goals",contextNonGoals:"Non-goals",noContext:"The agent has not written down why and what yet.",tabs:"Board sections",tabContext:"Context",tabLog:"Work log",tabQuestions:"Questions",openCount:e=>`${e} open`,noQuestions:"The agent has nothing to ask right now.",questions:"Questions from the agent",questionsProgress:(e,o)=>`${e} of ${o} replied`,blockingGroup:"Blocking \u2014 the agent waits for your decision",provisionalGroup:"Going ahead on an assumption \u2014 the agent adjusts if you answer otherwise",blockingTag:"Blocking",assumption:"Assumption",recommendation:"Agent recommends",approveAssumption:"OK, go with this",approveRecommendation:"OK, go with the recommendation",answerOther:"Answer differently",answerOf:e=>`Your answer to ${e}`,answerPlaceholder:"What you expect instead\u2026",blockingPlaceholder:"Your decision\u2026",approvedTag:"Approved",answeredTag:"Answered",todos:"Todo",progress:(e,o)=>`${e} of ${o} done`,noTodosYet:"No todos yet",assignee:"Assignee",unassigned:"Unassigned",memberOption:(e,o)=>`${e} (${o})`,statusOf:e=>`Status of \u201C${e}\u201D`,filterTodos:"Show todos",filterAll:"All",filterHuman:"People",doneGroup:e=>`Done (${e})`,noHumanTodos:"Nobody but the agent has a todo.",addedTag:"Added by you",changedTag:"Changed",removeAdded:"Remove this todo you added",noTodos:"There are no todos yet.",newTodo:"New todo",newTodoPlaceholder:"Add a todo for the agent\u2026",newTodoAssignee:"Assignee of the new todo",addTodo:"Add",proposedMark:"Proposed by the agent",reason:"Why",accept:"Accept",decline:"Decline",decisionOf:e=>`Decision on \u201C${e}\u201D`,acceptedTag:"Accepted",declinedTag:"Declined",undoDecision:"Undo",outputs:"Outputs",noOutputs:"Nothing has been produced yet.",copy:e=>`Copy ${e}`,copied:"Copied",log:"Conversation with the agent",logLede:"Newest first",noLog:"Nothing has been exchanged yet.",fromAgent:"Agent",latestTag:"Latest",commentOn:e=>`Comment on ${e}`,todoGroup:"Todo",logGroup:"Log",contextGroup:"Context",proposalGroup:"Proposal",questionGroup:"Question",approved:"Approve the assumption",answered:"Answer",answerCleared:"Clear the reply",accepted:"Accept the proposal",declined:"Decline the proposal",decisionCleared:"Clear the decision",statusChanged:"Change the status",todoAdded:"Add a todo",todoRemoved:"Remove the added todo",quoted:e=>`\u2192 \u201C${e}\u201D`,change:(e,o)=>`${e} \u2192 ${o}`},ja:{wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53",statusWorking:"\u4F5C\u696D\u4E2D",statusWaiting:"\u3042\u306A\u305F\u306E\u8FD4\u7B54\u5F85\u3061",statusBlocked:"\u30D6\u30ED\u30C3\u30AF\u4E2D",statusDone:"\u5B8C\u4E86",todoTodo:"\u672A\u7740\u624B",todoDoing:"\u9032\u884C\u4E2D",todoBlocked:"\u30D6\u30ED\u30C3\u30AF",todoDone:"\u5B8C\u4E86",kindAgent:"Agent",kindHuman:"\u4EBA\u9593",updatedAt:e=>`\u66F4\u65B0 ${e}`,context:"\u3053\u306E\u30BF\u30B9\u30AF\u306E\u524D\u63D0",contextWhy:"Why \u2014 \u306A\u305C\u3084\u308B\u304B",contextWhat:"What \u2014 \u4F55\u3092\u3084\u308B\u304B",contextGoals:"\u30B4\u30FC\u30EB",contextNonGoals:"\u3084\u3089\u306A\u3044\u3053\u3068",noContext:"Agent \u306F\u307E\u3060 Why / What \u3092\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002",tabs:"\u30DC\u30FC\u30C9\u306E\u533A\u5206",tabContext:"Context",tabLog:"\u4F5C\u696D\u30ED\u30B0",tabQuestions:"\u8CEA\u554F",openCount:e=>`\u672A\u56DE\u7B54 ${e} \u4EF6`,noQuestions:"\u4ECA Agent \u304B\u3089\u805E\u304D\u305F\u3044\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\u3002",questions:"Agent \u304B\u3089\u306E\u8CEA\u554F",questionsProgress:(e,o)=>`\u8FD4\u7B54\u6E08\u307F ${e} / ${o}`,blockingGroup:"\u30D6\u30ED\u30C3\u30AB\u30FC \u2014 \u6C7A\u3081\u3066\u3082\u3089\u3046\u307E\u3067\u5148\u306B\u9032\u3081\u306A\u3044",provisionalGroup:"\u4EEE\u306E\u524D\u63D0\u3067\u9032\u884C\u4E2D \u2014 \u9055\u3048\u3070\u65B9\u91DD\u3092\u76F4\u3059",blockingTag:"\u30D6\u30ED\u30C3\u30AB\u30FC",assumption:"\u4EEE\u56DE\u7B54",recommendation:"Agent \u306E\u63A8\u5968",approveAssumption:"\u3053\u306E\u524D\u63D0\u3067 OK",approveRecommendation:"\u63A8\u5968\u3069\u304A\u308A\u3067 OK",answerOther:"\u5225\u306E\u56DE\u7B54\u3092\u3059\u308B",answerOf:e=>`${e} \u3078\u306E\u56DE\u7B54`,answerPlaceholder:"\u671F\u5F85\u3059\u308B\u56DE\u7B54\u3092\u5165\u529B\u2026",blockingPlaceholder:"\u3069\u3046\u3059\u308B\u304B\u3092\u5165\u529B\u2026",approvedTag:"\u627F\u8A8D\u6E08\u307F",answeredTag:"\u56DE\u7B54\u6E08\u307F",todos:"Todo",progress:(e,o)=>`${o} \u4EF6\u4E2D ${e} \u4EF6\u5B8C\u4E86`,noTodosYet:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",assignee:"\u62C5\u5F53",unassigned:"\u672A\u5272\u308A\u5F53\u3066",memberOption:(e,o)=>`${e}\uFF08${o}\uFF09`,statusOf:e=>`\u300C${e}\u300D\u306E\u72B6\u614B`,filterTodos:"\u8868\u793A\u3059\u308B Todo",filterAll:"\u3059\u3079\u3066",filterHuman:"\u4EBA\u9593\u306E\u62C5\u5F53",doneGroup:e=>`\u5B8C\u4E86 ${e} \u4EF6`,noHumanTodos:"\u4EBA\u9593\u304C\u62C5\u5F53\u3059\u308B Todo \u306F\u3042\u308A\u307E\u305B\u3093\u3002",addedTag:"\u3042\u306A\u305F\u304C\u8FFD\u52A0",changedTag:"\u5909\u66F4\u3042\u308A",removeAdded:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3059",noTodos:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",newTodo:"\u65B0\u3057\u3044 Todo",newTodoPlaceholder:"Agent \u306B\u983C\u3080 Todo \u3092\u8FFD\u52A0\u2026",newTodoAssignee:"\u65B0\u3057\u3044 Todo \u306E\u62C5\u5F53",addTodo:"\u8FFD\u52A0",proposedMark:"Agent \u304B\u3089\u306E\u63D0\u6848",reason:"\u306A\u305C",accept:"\u627F\u8A8D",decline:"\u898B\u9001\u308A",decisionOf:e=>`\u300C${e}\u300D\u306E\u5224\u65AD`,acceptedTag:"\u627F\u8A8D\u6E08\u307F",declinedTag:"\u898B\u9001\u308A",undoDecision:"\u53D6\u308A\u6D88\u3059",outputs:"\u6210\u679C\u7269",noOutputs:"\u307E\u3060\u6210\u679C\u7269\u306F\u3042\u308A\u307E\u305B\u3093\u3002",copy:e=>`${e} \u3092\u30B3\u30D4\u30FC`,copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",log:"Agent \u3068\u306E\u3084\u308A\u3068\u308A",logLede:"\u65B0\u3057\u3044\u9806",noLog:"\u307E\u3060\u3084\u308A\u3068\u308A\u306F\u3042\u308A\u307E\u305B\u3093\u3002",fromAgent:"Agent",latestTag:"\u6700\u65B0",commentOn:e=>`${e} \u306B\u30B3\u30E1\u30F3\u30C8`,todoGroup:"Todo",logGroup:"\u4F5C\u696D\u30ED\u30B0",contextGroup:"Context",proposalGroup:"\u63D0\u6848",questionGroup:"\u8CEA\u554F",approved:"\u524D\u63D0\u3092\u627F\u8A8D",answered:"\u56DE\u7B54",answerCleared:"\u8FD4\u7B54\u3092\u30AF\u30EA\u30A2",accepted:"\u63D0\u6848\u3092\u627F\u8A8D",declined:"\u63D0\u6848\u3092\u898B\u9001\u308A",decisionCleared:"\u63D0\u6848\u306E\u5224\u65AD\u3092\u30AF\u30EA\u30A2",statusChanged:"\u72B6\u614B\u3092\u5909\u66F4",todoAdded:"Todo \u3092\u8FFD\u52A0",todoRemoved:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3057",quoted:e=>`\u2192 \u300C${e}\u300D`,change:(e,o)=>`${e} \u2192 ${o}`}}),xo=(e,o)=>{switch(o){case"working":return e.statusWorking;case"waiting":return e.statusWaiting;case"blocked":return e.statusBlocked;case"done":return e.statusDone}},z=(e,o)=>{switch(o){case"todo":return e.todoTodo;case"doing":return e.todoDoing;case"blocked":return e.todoBlocked;case"done":return e.todoDone}},le=(e,o)=>o==="agent"?e.kindAgent:e.kindHuman,L=(e,o)=>{switch(o){case"why":return e.contextWhy;case"what":return e.contextWhat;case"goals":return e.contextGoals;case"nonGoals":return e.contextNonGoals}},fo=48,H=e=>{const o=e.title??e.body??e.id;return o.length<=fo?o:`${o.slice(0,fo-1)}\u2026`},pe=(e,o,a)=>a===null?e.unassigned:O(o,a)?.name??a,mo=e=>e.title===""?"Task Context Board":e.title,vo=(e,o,a)=>{switch(a.type){case"todo":{const t=k(o,a.id);return`${t?.proposed===!0?e.proposalGroup:e.todoGroup} \xB7 ${t?.title??a.id}`}case"log":{const t=so(o,a.id);return`${e.logGroup} \xB7 ${t===void 0?a.id:H(t)}`}case"context":return`${e.contextGroup} \xB7 ${io(a.id)?L(e,a.id):a.id}`;case"question":{const t=C(o,a.id);return t===void 0?a.id:`${t.ref} \xB7 ${t.title}`}case"page":return e.wholeBoard;default:return a.id}},ce=(e,o)=>{switch(o){case"accept":return{title:e.accepted,tone:"update"};case"decline":return{title:e.declined,tone:"update"};case"clear":return{title:e.decisionCleared,tone:"delete"}}},ue=(e,o,a)=>{switch(a.type){case"ANSWER_QUESTION":{const t=S(m.ANSWER_QUESTION,a);if(t.kind==="clear")return{title:e.answerCleared,tone:"delete"};if(t.kind==="approve"){const r=C(o,a.target.id)?.assumption??null;return{title:e.approved,tone:"update",...r===null?{}:{body:e.quoted(r)}}}return{title:e.answered,tone:"update",body:e.quoted(t.text.slice(0,120))}}case"DECIDE_PROPOSAL":return ce(e,S(m.DECIDE_PROPOSAL,a).decision);case"SET_TODO_STATUS":{const{status:t}=S(m.SET_TODO_STATUS,a),r=k(o,a.target.id)?.status,d=z(e,t);return{title:e.statusChanged,tone:"update",body:r===void 0?d:e.change(z(e,r),d)}}case"ADD_TODO":{const t=S(m.ADD_TODO,a);return{title:e.todoAdded,tone:"create",targetLabel:`${e.todoGroup} \xB7 ${t.title}`,...t.assignee===null?{}:{body:`${e.assignee}: ${pe(e,o,t.assignee)}`}}}case"DELETE_TODO":return{title:e.todoRemoved,tone:"delete"};default:return{title:a.type,tone:"meta"}}},wo=(e,o,a,t)=>{let r;try{r=ue(e,t??a,o)}catch{r={title:o.type,tone:"meta"}}return{title:r.title,targetLabel:r.targetLabel??vo(e,a,o.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},$o=e=>`${e.type} ${Fo(e.target)} ${JSON.stringify(e.payload)}`,yo=(e,o)=>[...o.questions.map(a=>({value:`question:${a.id}`,label:`${a.ref} \xB7 ${a.title}`,group:e.questionGroup})),...o.todos.map(a=>({value:`todo:${a.id}`,label:a.title,group:a.proposed?e.proposalGroup:e.todoGroup})),...o.log.map(a=>({value:`log:${a.id}`,label:H(a),group:e.logGroup})),...E.filter(a=>N(o,a)).map(a=>({value:`context:${a}`,label:L(e,a),group:e.contextGroup}))],To=(e,o)=>o,Ao=(e,o,a)=>({parts:E.filter(t=>N(o,t)).map(t=>{const r=o.context[t];return{id:t,title:L(e,t),text:typeof r=="string"?r:null,items:typeof r=="string"||r===null?[]:r,comments:a(`context:${t}`)}})}),be=(e,o,a)=>{const t=e.answers[o.id];return{id:o.id,ref:o.ref,title:o.title,description:o.description,blocking:o.blocking,assumption:o.assumption,reply:t?.kind??"none",resolved:lo(e,o),draft:t?.kind==="answer"?t.text:"",comments:a(`question:${o.id}`)}},Oo=(e,o)=>{const a=e.questions.map(r=>be(e,r,o)),t=a.filter(r=>r.resolved).length;return{blocking:a.filter(r=>r.blocking),provisional:a.filter(r=>!r.blocking),resolved:t,total:a.length,open:a.length-t,blockingOpen:a.filter(r=>r.blocking&&!r.resolved).length}},ge=(e,o,a,t,r)=>{const d=k(a,t.id),l=O(o,t.assignee);return{id:t.id,title:t.title,note:t.note,reason:t.reason,status:t.status,statusLabel:z(e,t.status),assignee:t.assignee,assigneeName:l?.name??null,assigneeKind:l?.kind??null,editable:U(o,t),proposal:t.proposed?o.decisions[t.id]??"pending":null,added:t.added,changed:d!==void 0&&d.status!==t.status,comments:r(`todo:${t.id}`)}},So=(e,o,a,t,r="all")=>{const d=o.todos.filter(p=>R(o,p)),l=d.filter(p=>p.status==="done").length,g=o.members.some(p=>p.kind==="human"),x=g?r:"all",F=p=>p.assigneeKind==="human",G=o.todos.map(p=>ge(e,o,a,p,t)),j=x==="human"?G.filter(F):G,Y=p=>p.status==="done"&&k(a,p.id)?.status==="done";return{todos:j.filter(p=>!Y(p)),done:j.filter(Y),filter:x,canFilter:g,humanCount:G.filter(F).length,progress:{done:l,total:d.length,label:d.length===0?e.noTodosYet:e.progress(l,d.length)},statuses:D.map(p=>({value:p,label:z(e,p)})),members:o.members.map(p=>({id:p.id,label:e.memberOption(p.name,le(e,p.kind))}))}},Do=e=>{if(!/^[a-z][a-z\d+.-]*:\/\//i.test(e))return{kind:"path"};try{return{kind:"url",host:new URL(e).host}}catch{return{kind:"path"}}},Eo=e=>e.outputs.map(o=>({id:o.id,title:o.label??o.href,labelled:o.label!==null,href:o.href,kind:o.kind,description:o.description,place:Do(o.href)})),Co=(e,o,a)=>({entries:o.log.map((t,r)=>{const d=O(o,t.from);return{id:t.id,author:d===void 0?null:{name:d.name,kind:d.kind},at:t.at,title:t.title,body:t.body,points:t.points,label:H(t),latest:r===o.log.length-1,comments:a(`log:${t.id}`)}}).reverse(),status:o.status===null&&o.updatedAt===null?null:{status:o.status,label:o.status===null?null:xo(e,o.status),updatedAt:o.updatedAt}}),zo=(e,o)=>{switch(o.type){case"todo":return k(e,o.id)!==void 0;case"log":return so(e,o.id)!==void 0;case"context":return io(o.id)&&N(e,o.id);case"question":return C(e,o.id)!==void 0;case"page":return!0;default:return!1}},Lo=e=>{const o=Q(e);return{name:"task-board",label:"Task Context Board",parseBase:ro,emptyBase:no,actions:m,apply:ko,hasTarget:zo,describe:(a,t,r)=>wo(o,a,t,r),serialize:$o,resolveNavigation:To,commentTargets:a=>yo(o,a),title:mo}},_=(e,o,a,t)=>n`
1
+ import{ac as Ro,ad as b,ae as i,af as f,ag as c,ah as w,az as h,ao as J,ai as X,aj as V,p as $,v as qo,ay as Io,av as Qo,al as Uo,an as B,P as Ho,e as Mo,a0 as Ko,V as jo,R as S,a3 as s,a4 as n,A as Fo,a5 as y,aY as Z,aZ as Yo,aH as P,K as Jo,aE as Xo,a2 as Vo,T as oo,l as Zo,aJ as oe}from"./shared-CSC14I4g.js";const eo=["working","waiting","blocked","done"],D=["todo","doing","blocked","done"],ao=["agent","human"],E=["why","what","goals","nonGoals"],T=X(c(),V(1)),ee=b({id:h,name:T,kind:i(w(ao),"agent")}),ae=b({id:h,title:T,status:i(w(D),"todo"),assignee:i(h),note:i(c()),proposed:i(J(),!1),reason:i(c())}),te=b({id:h,label:i(c()),href:T,kind:i(c()),description:i(c())}),re=b({why:i(c()),what:i(c()),goals:i(f(c()),[]),nonGoals:i(f(c()),[])}),ne=b({id:h,from:i(h),at:i(c()),title:i(c()),body:i(c()),points:i(f(c()),[])}),de=b({id:h,ref:i(T),title:T,description:i(c()),blocking:i(J(),!1),assumption:i(c())}),to=b({title:i(c(),""),status:i(w(eo)),updatedAt:i(c()),context:i(re,{}),members:i(f(ee),[]),todos:i(f(ae),[]),outputs:i(f(te),[]),log:i(f(ne),[]),questions:i(f(de),[])}),A=(e,o)=>{const a=new Set;for(const t of o){if(a.has(t))throw new Error(`duplicate ${e} id: ${t}`);a.add(t)}},u=e=>e===void 0||e.trim()===""?null:e,W=e=>e.filter(o=>o.trim()!==""),ro=e=>{const o=Ro(to,e);A("member",o.members.map(t=>t.id)),A("todo",o.todos.map(t=>t.id)),A("output",o.outputs.map(t=>t.id)),A("log",o.log.map(t=>t.id)),A("question",o.questions.map(t=>t.id));const a=new Set(o.members.map(t=>t.id));for(const t of o.todos)if(t.assignee!==void 0&&!a.has(t.assignee))throw new Error(`todo ${t.id} is assigned to ${t.assignee}, which is not in members`);for(const t of o.log){if(t.from!==void 0&&!a.has(t.from))throw new Error(`log entry ${t.id} is from ${t.from}, which is not in members`);if(u(t.title)===null&&u(t.body)===null)throw new Error(`log entry ${t.id} needs a title or a body`)}for(const t of o.questions)if(!t.blocking&&u(t.assumption)===null)throw new Error(`question ${t.id} does not block, so it needs the assumption the agent works on`);return{title:o.title,status:o.status??null,updatedAt:u(o.updatedAt),context:{why:u(o.context.why),what:u(o.context.what),goals:W(o.context.goals),nonGoals:W(o.context.nonGoals)},members:o.members,todos:o.todos.map(t=>({id:t.id,title:t.title,status:t.status,assignee:t.assignee??null,note:u(t.note),proposed:t.proposed,reason:u(t.reason),added:!1})),outputs:o.outputs.map(t=>({id:t.id,label:u(t.label),href:t.href,kind:u(t.kind),description:u(t.description)})),log:o.log.map(t=>({id:t.id,from:t.from??null,at:u(t.at),title:u(t.title),body:u(t.body),points:W(t.points)})),questions:o.questions.map((t,r)=>({id:t.id,ref:t.ref??`Q${r+1}`,title:t.title,description:u(t.description),blocking:t.blocking,assumption:u(t.assumption)})),answers:{},decisions:{}}},no=()=>({title:"",status:null,updatedAt:null,context:{why:null,what:null,goals:[],nonGoals:[]},members:[],todos:[],outputs:[],log:[],questions:[],answers:{},decisions:{}}),O=(e,o)=>o===null?void 0:e.members.find(a=>a.id===o),k=(e,o)=>e.todos.find(a=>a.id===o),so=(e,o)=>e.log.find(a=>a.id===o),io=e=>E.includes(e),N=(e,o)=>{const a=e.context[o];return typeof a=="string"||a!==null&&a.length>0},z=(e,o)=>e.questions.find(a=>a.id===o),lo=(e,o)=>{const a=e.answers[o.id];return a===void 0?!1:a.kind==="approve"||a.text.trim()!==""},R=(e,o)=>!o.proposed||e.decisions[o.id]==="accept",q=(e,o)=>R(e,o)&&O(e,o.assignee)?.kind==="human",po=(e,o,a)=>{const t={...e};return a===null?delete t[o]:t[o]=a,t},I=(e,o,a)=>({...e,answers:po(e.answers,o,a)}),se=(e,o,a)=>({...e,decisions:po(e.decisions,o,a)}),ie=(e,o,a)=>({...e,todos:e.todos.map(t=>t.id===o?a(t):t)}),m={ANSWER_QUESTION:$("ANSWER_QUESTION","question",Uo("kind",[b({kind:B("approve")}),b({kind:B("answer"),text:c()}),b({kind:B("clear")})])),DECIDE_PROPOSAL:$("DECIDE_PROPOSAL","todo",b({decision:w(["accept","decline","clear"])})),SET_TODO_STATUS:$("SET_TODO_STATUS","todo",b({status:w(D)})),ADD_TODO:$("ADD_TODO","page",b({id:h,title:X(c(),Qo(),V(1)),assignee:Io(h)}),{dedupeKey:qo}),DELETE_TODO:$("DELETE_TODO","todo",b({}))},co={type:"page",id:"task-board"},Q=(e,o)=>({type:"ANSWER_QUESTION",target:{type:"question",id:e},payload:o}),uo=(e,o)=>({type:"DECIDE_PROPOSAL",target:{type:"todo",id:e},payload:{decision:o}}),bo=(e,o)=>({type:"SET_TODO_STATUS",target:{type:"todo",id:e},payload:{status:o}}),go=(e,o,a)=>({type:"ADD_TODO",target:co,payload:{id:e,title:o,assignee:a}}),ho=e=>({type:"DELETE_TODO",target:{type:"todo",id:e},payload:{}}),ko=(e,o)=>{const a=Ho(m,o);if(a===null)return null;const t=a.target.id;switch(a.type){case"ANSWER_QUESTION":{const r=z(e,t);if(r===void 0)return null;const d=a.payload;return d.kind==="clear"?I(e,t,null):d.kind==="approve"?r.assumption===null?null:I(e,t,{kind:"approve"}):I(e,t,{kind:"answer",text:d.text})}case"DECIDE_PROPOSAL":{if(k(e,t)?.proposed!==!0)return null;const{decision:r}=a.payload;return se(e,t,r==="clear"?null:r)}case"SET_TODO_STATUS":{const r=k(e,t);if(r===void 0||!q(e,r))return null;const{status:d}=a.payload;return ie(e,t,l=>({...l,status:d}))}case"ADD_TODO":{const{payload:r}=a;return k(e,r.id)!==void 0||r.assignee!==null&&O(e,r.assignee)===void 0?null:{...e,todos:[...e.todos,{id:r.id,title:r.title,status:"todo",assignee:r.assignee,note:null,proposed:!1,reason:null,added:!0}]}}case"DELETE_TODO":return k(e,t)?.added!==!0?null:{...e,todos:e.todos.filter(r=>r.id!==t)};default:return Mo(a)}},U=Ko({en:{wholeBoard:"Whole board",statusWorking:"Working",statusWaiting:"Waiting on you",statusBlocked:"Blocked",statusDone:"Done",todoTodo:"To do",todoDoing:"In progress",todoBlocked:"Blocked",todoDone:"Done",kindAgent:"Agent",kindHuman:"Human",updatedAt:e=>`Updated ${e}`,context:"What this task is about",contextWhy:"Why",contextWhat:"What",contextGoals:"Goals",contextNonGoals:"Non-goals",noContext:"The agent has not written down why and what yet.",tabs:"Board sections",tabContext:"Context",tabLog:"Work log",tabQuestions:"Questions",openCount:e=>`${e} open`,noQuestions:"The agent has nothing to ask right now.",questions:"Questions from the agent",questionsProgress:(e,o)=>`${e} of ${o} replied`,blockingGroup:"Blocking \u2014 the agent waits for your decision",provisionalGroup:"Going ahead on an assumption \u2014 the agent adjusts if you answer otherwise",blockingTag:"Blocking",assumption:"Assumption",recommendation:"Agent recommends",approveAssumption:"OK, go with this",approveRecommendation:"OK, go with the recommendation",answerOther:"Answer differently",answerOf:e=>`Your answer to ${e}`,answerPlaceholder:"What you expect instead\u2026",blockingPlaceholder:"Your decision\u2026",approvedTag:"Approved",answeredTag:"Answered",todos:"Todo",progress:(e,o)=>`${e} of ${o} done`,noTodosYet:"No todos yet",assignee:"Assignee",unassigned:"Unassigned",memberOption:(e,o)=>`${e} (${o})`,statusOf:e=>`Status of \u201C${e}\u201D`,filterTodos:"Show todos",filterAll:"All",filterHuman:"People",doneGroup:e=>`Done (${e})`,noHumanTodos:"Nobody but the agent has a todo.",addedTag:"Added by you",changedTag:"Changed",removeAdded:"Remove this todo you added",noTodos:"There are no todos yet.",newTodo:"New todo",newTodoPlaceholder:"Add a todo for the agent\u2026",newTodoAssignee:"Assignee of the new todo",addTodo:"Add",proposedMark:"Proposed by the agent",reason:"Why",accept:"Accept",decline:"Decline",decisionOf:e=>`Decision on \u201C${e}\u201D`,acceptedTag:"Accepted",declinedTag:"Declined",undoDecision:"Undo",outputs:"Outputs",noOutputs:"Nothing has been produced yet.",copy:e=>`Copy ${e}`,copied:"Copied",log:"Conversation with the agent",logLede:"Newest first",noLog:"Nothing has been exchanged yet.",fromAgent:"Agent",latestTag:"Latest",commentOn:e=>`Comment on ${e}`,todoGroup:"Todo",logGroup:"Log",contextGroup:"Context",proposalGroup:"Proposal",questionGroup:"Question",approved:"Approve the assumption",answered:"Answer",answerCleared:"Clear the reply",accepted:"Accept the proposal",declined:"Decline the proposal",decisionCleared:"Clear the decision",statusChanged:"Change the status",todoAdded:"Add a todo",todoRemoved:"Remove the added todo",quoted:e=>`\u2192 \u201C${e}\u201D`,change:(e,o)=>`${e} \u2192 ${o}`},ja:{wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53",statusWorking:"\u4F5C\u696D\u4E2D",statusWaiting:"\u3042\u306A\u305F\u306E\u8FD4\u7B54\u5F85\u3061",statusBlocked:"\u30D6\u30ED\u30C3\u30AF\u4E2D",statusDone:"\u5B8C\u4E86",todoTodo:"\u672A\u7740\u624B",todoDoing:"\u9032\u884C\u4E2D",todoBlocked:"\u30D6\u30ED\u30C3\u30AF",todoDone:"\u5B8C\u4E86",kindAgent:"Agent",kindHuman:"\u4EBA\u9593",updatedAt:e=>`\u66F4\u65B0 ${e}`,context:"\u3053\u306E\u30BF\u30B9\u30AF\u306E\u524D\u63D0",contextWhy:"Why \u2014 \u306A\u305C\u3084\u308B\u304B",contextWhat:"What \u2014 \u4F55\u3092\u3084\u308B\u304B",contextGoals:"\u30B4\u30FC\u30EB",contextNonGoals:"\u3084\u3089\u306A\u3044\u3053\u3068",noContext:"Agent \u306F\u307E\u3060 Why / What \u3092\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002",tabs:"\u30DC\u30FC\u30C9\u306E\u533A\u5206",tabContext:"Context",tabLog:"\u4F5C\u696D\u30ED\u30B0",tabQuestions:"\u8CEA\u554F",openCount:e=>`\u672A\u56DE\u7B54 ${e} \u4EF6`,noQuestions:"\u4ECA Agent \u304B\u3089\u805E\u304D\u305F\u3044\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\u3002",questions:"Agent \u304B\u3089\u306E\u8CEA\u554F",questionsProgress:(e,o)=>`\u8FD4\u7B54\u6E08\u307F ${e} / ${o}`,blockingGroup:"\u30D6\u30ED\u30C3\u30AB\u30FC \u2014 \u6C7A\u3081\u3066\u3082\u3089\u3046\u307E\u3067\u5148\u306B\u9032\u3081\u306A\u3044",provisionalGroup:"\u4EEE\u306E\u524D\u63D0\u3067\u9032\u884C\u4E2D \u2014 \u9055\u3048\u3070\u65B9\u91DD\u3092\u76F4\u3059",blockingTag:"\u30D6\u30ED\u30C3\u30AB\u30FC",assumption:"\u4EEE\u56DE\u7B54",recommendation:"Agent \u306E\u63A8\u5968",approveAssumption:"\u3053\u306E\u524D\u63D0\u3067 OK",approveRecommendation:"\u63A8\u5968\u3069\u304A\u308A\u3067 OK",answerOther:"\u5225\u306E\u56DE\u7B54\u3092\u3059\u308B",answerOf:e=>`${e} \u3078\u306E\u56DE\u7B54`,answerPlaceholder:"\u671F\u5F85\u3059\u308B\u56DE\u7B54\u3092\u5165\u529B\u2026",blockingPlaceholder:"\u3069\u3046\u3059\u308B\u304B\u3092\u5165\u529B\u2026",approvedTag:"\u627F\u8A8D\u6E08\u307F",answeredTag:"\u56DE\u7B54\u6E08\u307F",todos:"Todo",progress:(e,o)=>`${o} \u4EF6\u4E2D ${e} \u4EF6\u5B8C\u4E86`,noTodosYet:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",assignee:"\u62C5\u5F53",unassigned:"\u672A\u5272\u308A\u5F53\u3066",memberOption:(e,o)=>`${e}\uFF08${o}\uFF09`,statusOf:e=>`\u300C${e}\u300D\u306E\u72B6\u614B`,filterTodos:"\u8868\u793A\u3059\u308B Todo",filterAll:"\u3059\u3079\u3066",filterHuman:"\u4EBA\u9593\u306E\u62C5\u5F53",doneGroup:e=>`\u5B8C\u4E86 ${e} \u4EF6`,noHumanTodos:"\u4EBA\u9593\u304C\u62C5\u5F53\u3059\u308B Todo \u306F\u3042\u308A\u307E\u305B\u3093\u3002",addedTag:"\u3042\u306A\u305F\u304C\u8FFD\u52A0",changedTag:"\u5909\u66F4\u3042\u308A",removeAdded:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3059",noTodos:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",newTodo:"\u65B0\u3057\u3044 Todo",newTodoPlaceholder:"Agent \u306B\u983C\u3080 Todo \u3092\u8FFD\u52A0\u2026",newTodoAssignee:"\u65B0\u3057\u3044 Todo \u306E\u62C5\u5F53",addTodo:"\u8FFD\u52A0",proposedMark:"Agent \u304B\u3089\u306E\u63D0\u6848",reason:"\u306A\u305C",accept:"\u627F\u8A8D",decline:"\u898B\u9001\u308A",decisionOf:e=>`\u300C${e}\u300D\u306E\u5224\u65AD`,acceptedTag:"\u627F\u8A8D\u6E08\u307F",declinedTag:"\u898B\u9001\u308A",undoDecision:"\u53D6\u308A\u6D88\u3059",outputs:"\u6210\u679C\u7269",noOutputs:"\u307E\u3060\u6210\u679C\u7269\u306F\u3042\u308A\u307E\u305B\u3093\u3002",copy:e=>`${e} \u3092\u30B3\u30D4\u30FC`,copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",log:"Agent \u3068\u306E\u3084\u308A\u3068\u308A",logLede:"\u65B0\u3057\u3044\u9806",noLog:"\u307E\u3060\u3084\u308A\u3068\u308A\u306F\u3042\u308A\u307E\u305B\u3093\u3002",fromAgent:"Agent",latestTag:"\u6700\u65B0",commentOn:e=>`${e} \u306B\u30B3\u30E1\u30F3\u30C8`,todoGroup:"Todo",logGroup:"\u4F5C\u696D\u30ED\u30B0",contextGroup:"Context",proposalGroup:"\u63D0\u6848",questionGroup:"\u8CEA\u554F",approved:"\u524D\u63D0\u3092\u627F\u8A8D",answered:"\u56DE\u7B54",answerCleared:"\u8FD4\u7B54\u3092\u30AF\u30EA\u30A2",accepted:"\u63D0\u6848\u3092\u627F\u8A8D",declined:"\u63D0\u6848\u3092\u898B\u9001\u308A",decisionCleared:"\u63D0\u6848\u306E\u5224\u65AD\u3092\u30AF\u30EA\u30A2",statusChanged:"\u72B6\u614B\u3092\u5909\u66F4",todoAdded:"Todo \u3092\u8FFD\u52A0",todoRemoved:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3057",quoted:e=>`\u2192 \u300C${e}\u300D`,change:(e,o)=>`${e} \u2192 ${o}`}}),xo=(e,o)=>{switch(o){case"working":return e.statusWorking;case"waiting":return e.statusWaiting;case"blocked":return e.statusBlocked;case"done":return e.statusDone}},C=(e,o)=>{switch(o){case"todo":return e.todoTodo;case"doing":return e.todoDoing;case"blocked":return e.todoBlocked;case"done":return e.todoDone}},le=(e,o)=>o==="agent"?e.kindAgent:e.kindHuman,L=(e,o)=>{switch(o){case"why":return e.contextWhy;case"what":return e.contextWhat;case"goals":return e.contextGoals;case"nonGoals":return e.contextNonGoals}},fo=48,H=e=>{const o=e.title??e.body??e.id;return o.length<=fo?o:`${o.slice(0,fo-1)}\u2026`},pe=(e,o,a)=>a===null?e.unassigned:O(o,a)?.name??a,mo=e=>e.title===""?"Task Context Board":e.title,vo=(e,o,a)=>{switch(a.type){case"todo":{const t=k(o,a.id);return`${t?.proposed===!0?e.proposalGroup:e.todoGroup} \xB7 ${t?.title??a.id}`}case"log":{const t=so(o,a.id);return`${e.logGroup} \xB7 ${t===void 0?a.id:H(t)}`}case"context":return`${e.contextGroup} \xB7 ${io(a.id)?L(e,a.id):a.id}`;case"question":{const t=z(o,a.id);return t===void 0?a.id:`${t.ref} \xB7 ${t.title}`}case"page":return e.wholeBoard;default:return a.id}},ce=(e,o)=>{switch(o){case"accept":return{title:e.accepted,tone:"update"};case"decline":return{title:e.declined,tone:"update"};case"clear":return{title:e.decisionCleared,tone:"delete"}}},ue=(e,o,a)=>{switch(a.type){case"ANSWER_QUESTION":{const t=S(m.ANSWER_QUESTION,a);if(t.kind==="clear")return{title:e.answerCleared,tone:"delete"};if(t.kind==="approve"){const r=z(o,a.target.id)?.assumption??null;return{title:e.approved,tone:"update",...r===null?{}:{body:e.quoted(r)}}}return{title:e.answered,tone:"update",body:e.quoted(t.text.slice(0,120))}}case"DECIDE_PROPOSAL":return ce(e,S(m.DECIDE_PROPOSAL,a).decision);case"SET_TODO_STATUS":{const{status:t}=S(m.SET_TODO_STATUS,a),r=k(o,a.target.id)?.status,d=C(e,t);return{title:e.statusChanged,tone:"update",body:r===void 0?d:e.change(C(e,r),d)}}case"ADD_TODO":{const t=S(m.ADD_TODO,a);return{title:e.todoAdded,tone:"create",targetLabel:`${e.todoGroup} \xB7 ${t.title}`,...t.assignee===null?{}:{body:`${e.assignee}: ${pe(e,o,t.assignee)}`}}}case"DELETE_TODO":return{title:e.todoRemoved,tone:"delete"};default:return{title:a.type,tone:"meta"}}},wo=(e,o,a,t)=>{let r;try{r=ue(e,t??a,o)}catch{r={title:o.type,tone:"meta"}}return{title:r.title,targetLabel:r.targetLabel??vo(e,a,o.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},$o=e=>`${e.type} ${jo(e.target)} ${JSON.stringify(e.payload)}`,yo=(e,o)=>[...o.questions.map(a=>({value:`question:${a.id}`,label:`${a.ref} \xB7 ${a.title}`,group:e.questionGroup})),...o.todos.map(a=>({value:`todo:${a.id}`,label:a.title,group:a.proposed?e.proposalGroup:e.todoGroup})),...o.log.map(a=>({value:`log:${a.id}`,label:H(a),group:e.logGroup})),...E.filter(a=>N(o,a)).map(a=>({value:`context:${a}`,label:L(e,a),group:e.contextGroup}))],To=(e,o)=>o,Ao=(e,o,a)=>({parts:E.filter(t=>N(o,t)).map(t=>{const r=o.context[t];return{id:t,title:L(e,t),text:typeof r=="string"?r:null,items:typeof r=="string"||r===null?[]:r,comments:a(`context:${t}`)}})}),be=(e,o,a)=>{const t=e.answers[o.id];return{id:o.id,ref:o.ref,title:o.title,description:o.description,blocking:o.blocking,assumption:o.assumption,reply:t?.kind??"none",resolved:lo(e,o),draft:t?.kind==="answer"?t.text:"",comments:a(`question:${o.id}`)}},Oo=(e,o)=>{const a=e.questions.map(r=>be(e,r,o)),t=a.filter(r=>r.resolved).length;return{blocking:a.filter(r=>r.blocking),provisional:a.filter(r=>!r.blocking),resolved:t,total:a.length,open:a.length-t,blockingOpen:a.filter(r=>r.blocking&&!r.resolved).length}},ge=(e,o,a,t,r)=>{const d=k(a,t.id),l=O(o,t.assignee);return{id:t.id,title:t.title,note:t.note,reason:t.reason,status:t.status,statusLabel:C(e,t.status),assignee:t.assignee,assigneeName:l?.name??null,assigneeKind:l?.kind??null,editable:q(o,t),proposal:t.proposed?o.decisions[t.id]??"pending":null,added:t.added,changed:d!==void 0&&d.status!==t.status,comments:r(`todo:${t.id}`)}},So=(e,o,a,t,r="all")=>{const d=o.todos.filter(p=>R(o,p)),l=d.filter(p=>p.status==="done").length,g=o.members.some(p=>p.kind==="human"),x=g?r:"all",j=p=>p.assigneeKind==="human",G=o.todos.map(p=>ge(e,o,a,p,t)),F=x==="human"?G.filter(j):G,Y=p=>p.status==="done"&&k(a,p.id)?.status==="done";return{todos:F.filter(p=>!Y(p)),done:F.filter(Y),filter:x,canFilter:g,humanCount:G.filter(j).length,progress:{done:l,total:d.length,label:d.length===0?e.noTodosYet:e.progress(l,d.length)},statuses:D.map(p=>({value:p,label:C(e,p)})),members:o.members.map(p=>({id:p.id,label:e.memberOption(p.name,le(e,p.kind))}))}},Do=e=>{if(!/^[a-z][a-z\d+.-]*:\/\//i.test(e))return{kind:"path"};try{return{kind:"url",host:new URL(e).host}}catch{return{kind:"path"}}},Eo=e=>e.outputs.map(o=>({id:o.id,title:o.label??o.href,labelled:o.label!==null,href:o.href,kind:o.kind,description:o.description,place:Do(o.href)})),zo=(e,o,a)=>({entries:o.log.map((t,r)=>{const d=O(o,t.from);return{id:t.id,author:d===void 0?null:{name:d.name,kind:d.kind},at:t.at,title:t.title,body:t.body,points:t.points,label:H(t),latest:r===o.log.length-1,comments:a(`log:${t.id}`)}}).reverse(),status:o.status===null&&o.updatedAt===null?null:{status:o.status,label:o.status===null?null:xo(e,o.status),updatedAt:o.updatedAt}}),Co=(e,o)=>{switch(o.type){case"todo":return k(e,o.id)!==void 0;case"log":return so(e,o.id)!==void 0;case"context":return io(o.id)&&N(e,o.id);case"question":return z(e,o.id)!==void 0;case"page":return!0;default:return!1}},Lo=e=>{const o=U(e);return{name:"task-board",label:"Task Context Board",parseBase:ro,emptyBase:no,actions:m,apply:ko,hasTarget:Co,describe:(a,t,r)=>wo(o,a,t,r),serialize:$o,resolveNavigation:To,commentTargets:a=>yo(o,a),title:mo}},_=(e,o,a,t)=>n`
2
2
  <button
3
3
  class="dpk-icon-btn board-comment"
4
4
  type="button"
@@ -7,7 +7,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
7
7
  title=${o}
8
8
  @click=${()=>t.comment(e)}
9
9
  >
10
- ${jo()} ${a>0?n`<span class="dpk-icon-badge">${a}</span>`:s}
10
+ ${Fo()} ${a>0?n`<span class="dpk-icon-badge">${a}</span>`:s}
11
11
  </button>
12
12
  `,M=(e,o,a,t=null)=>n`
13
13
  <header class="board-section-head">
@@ -180,7 +180,8 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
180
180
  @click=${()=>t(d)}
181
181
  @keydown=${r}
182
182
  >
183
- ${Ae(e,d)}${l===null||l===0?s:n`<span class="board-tab-count">${l}</span>`}
183
+ <span class="board-tab-label">${Ae(e,d)}</span
184
+ >${l===null||l===0?s:n`<span class="board-tab-count">${l}</span>`}
184
185
  </button>`})}
185
186
  </div>
186
187
  `,K=(e,o,a)=>n`
@@ -209,7 +210,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
209
210
  >
210
211
  <span class="board-progress-fill" style=${`width: ${o.progress.done/o.progress.total*100}%`}></span>
211
212
  </div>`}
212
- ${o.canFilter?Ce(e,o,a):s}
213
+ ${o.canFilter?ze(e,o,a):s}
213
214
  ${o.todos.length===0&&o.done.length===0?n`<p class="board-empty">${o.filter==="human"?e.noHumanTodos:e.noTodos}</p>`:s}
214
215
  ${o.done.length===0?s:n`<details class="board-done">
215
216
  <summary class="board-done-summary">
@@ -223,7 +224,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
223
224
  <ul class="board-todos">
224
225
  ${y(a,r=>r.id,r=>_e(e,o,r,t))}
225
226
  </ul>
226
- `,Ce=(e,o,a)=>{const t=(r,d,l)=>n`
227
+ `,ze=(e,o,a)=>{const t=(r,d,l)=>n`
227
228
  <button
228
229
  type="button"
229
230
  class="board-filter-option"
@@ -235,7 +236,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
235
236
  </button>
236
237
  `;return n`<div class="board-filter" role="group" aria-label=${e.filterTodos}>
237
238
  ${t("all",e.filterAll,null)} ${t("human",e.filterHuman,o.humanCount)}
238
- </div>`},ze=(e,o)=>o.proposal==="pending"||o.proposal==="decline"?n`<span
239
+ </div>`},Ce=(e,o)=>o.proposal==="pending"||o.proposal==="decline"?n`<span
239
240
  class="board-todo-mark board-todo-mark--proposal"
240
241
  role="img"
241
242
  aria-label=${e.proposedMark}
@@ -255,7 +256,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
255
256
  data-added=${String(a.added)}
256
257
  data-changed=${String(a.changed)}
257
258
  >
258
- ${ze(e,a)}
259
+ ${Ce(e,a)}
259
260
  <div class="board-todo-body">
260
261
  <div class="board-todo-title"><span class="board-todo-text">${a.title}</span>${Le(e,a)}</div>
261
262
  ${a.note===null?s:n`<p class="board-todo-note">${a.note}</p>`}
@@ -280,7 +281,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
280
281
  title=${e.removeAdded}
281
282
  @click=${()=>t.deleteTodo(a.id)}
282
283
  >
283
- ${Xo()}
284
+ ${Jo()}
284
285
  </button>`:s}
285
286
  </div>
286
287
  </div>
@@ -308,7 +309,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
308
309
  class="dpk-select board-todo-status"
309
310
  data-status=${a.status}
310
311
  aria-label=${e.statusOf(a.title)}
311
- @change=${Jo(r=>{De(r,o)&&r!==a.status&&t.setStatus(a.id,r)})}
312
+ @change=${Xo(r=>{De(r,o)&&r!==a.status&&t.setStatus(a.id,r)})}
312
313
  >
313
314
  ${o.statuses.map(r=>n`<option value=${r.value} ?selected=${r.value===a.status}>${r.label}</option>`)}
314
315
  </select>`:n`<span class="board-todo-state" data-status=${a.status}>${a.statusLabel}</span>`,Pe=(e,o,a)=>n`
@@ -391,6 +392,11 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
391
392
  border-top: 1px solid var(--dpk-rule);
392
393
  }
393
394
 
395
+ /* Stacked, the rail is what ends the page: it clears the hand-off dock, not the board above it. */
396
+ .dpk-main-body {
397
+ padding-bottom: 24px;
398
+ }
399
+
394
400
  /* Stacked, the rail takes the full width: there is no edge to drag or
395
401
  fold on. A rail folded on a wider screen is a bar to unfold it. */
396
402
  .dpk-sidebar-resizer,
@@ -541,7 +547,22 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
541
547
  box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
542
548
  }
543
549
 
550
+ @media (max-width: 400px) {
551
+ .board-tabs [role='tab'] {
552
+ gap: 5px;
553
+ padding-inline: 6px;
554
+ }
555
+ }
556
+
557
+ /* Too narrow for every label whole, a label gives way before its count does. */
558
+ .board-tab-label {
559
+ min-width: 0;
560
+ overflow: hidden;
561
+ text-overflow: ellipsis;
562
+ }
563
+
544
564
  .board-tab-count {
565
+ flex: none;
545
566
  min-width: 18px;
546
567
  padding: 0 6px;
547
568
  border-radius: 999px;
@@ -976,6 +997,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
976
997
 
977
998
  .board-todos {
978
999
  display: grid;
1000
+ grid-template-columns: minmax(0, 1fr);
979
1001
  margin: 0;
980
1002
  padding: 0;
981
1003
  list-style: none;
@@ -1063,6 +1085,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
1063
1085
  display: grid;
1064
1086
  gap: 4px;
1065
1087
  min-width: 0;
1088
+ overflow-wrap: anywhere;
1066
1089
  }
1067
1090
 
1068
1091
  .board-todo-title {
@@ -1591,7 +1614,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
1591
1614
  animation: none;
1592
1615
  }
1593
1616
  }
1594
- `,Ne=1500;class Wo extends oo{static{this.styles=[oo.styles,We]}static{this.properties={tab:{state:!0},todoFilter:{state:!0}}}#o=null;#e=null;#a;constructor(){super(),this.tab="context",this.todoFilter="all"}get sidebarLayout(){return{side:"right",defaultWidth:360}}definitionFor(o){return Lo(o)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.#a)}renderRegions(o){const a=Q(this.locale),t=x=>o.commentCount(x),r=Oo(o.state,t),d=Co(a,o.state,t),l=this.#d(),g=this.tab;return{header:this.#r(a,o.state),sidebar:n`
1617
+ `,Ne=1500;class Wo extends oo{static{this.styles=[oo.styles,We]}static{this.properties={tab:{state:!0},todoFilter:{state:!0}}}#o=null;#e=null;#a;constructor(){super(),this.tab="context",this.todoFilter="all"}get sidebarLayout(){return{side:"right",defaultWidth:360,narrow:"stack"}}definitionFor(o){return Lo(o)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.#a)}renderRegions(o){const a=U(this.locale),t=x=>o.commentCount(x),r=Oo(o.state,t),d=zo(a,o.state,t),l=this.#d(),g=this.tab;return{header:this.#r(a,o.state),sidebar:n`
1595
1618
  <div class="board-rail">
1596
1619
  ${ve(a,Eo(o.state),this.#e,l)}
1597
1620
  ${Ee(a,So(a,o.state,o.base,t,this.todoFilter),l)}
@@ -1605,4 +1628,4 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
1605
1628
  </div>
1606
1629
  `}}updated(){super.updated();const o=this.#o;o!==null&&(this.#o=null,this.renderRoot.querySelector(`[data-answer-text="${o}"]`)?.focus())}#t(o){const a=Te(this.tab,o.key);a!==null&&(o.preventDefault(),this.tab=a,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-tab="${a}"]`)?.focus()))}#r(o,a){return a.status===null?s:n`<span class="board-status board-status--header" data-status=${a.status}>
1607
1630
  <span class="board-status-dot" aria-hidden="true"></span>${xo(o,a.status)}
1608
- </span>`}#n(){return this.querySelector(':scope > [slot="main"]')!==null}#d(){return{answer:(o,a)=>this.#s(o,a),answerOther:o=>this.#i(o),decide:(o,a)=>this.dispatch(uo(o,a)),setStatus:(o,a)=>this.dispatch(bo(o,a)),filterTodos:o=>{this.todoFilter=o},addTodo:(o,a)=>this.#l(o,a),deleteTodo:o=>this.dispatch(ho(o)),copy:(o,a)=>{this.#p(o,a)},comment:o=>this.requestComment(o)}}#s(o,a){this.dispatch(I(o,a))}#i(o){this.dispatch(I(o,{kind:"answer",text:""})).ok&&(this.#o=o)}#l(o,a){const{base:t,state:r}=this.derivation,d=[...t.todos,...r.todos].map(l=>l.id);this.dispatch(go(Zo(o,d),o,a))}async#p(o,a){await oe(a)&&(clearTimeout(this.#a),this.#e=o,this.requestUpdate(),this.#a=setTimeout(()=>{this.#e=null,this.requestUpdate()},Ne))}}const No=()=>{customElements.get("dpk-template-task-board")||customElements.define("dpk-template-task-board",Wo)},Re=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_PARTS:E,DpkTemplateTaskBoard:Wo,MEMBER_KINDS:ao,TASK_BOARD_PAGE:co,TASK_STATUSES:eo,TODO_STATUSES:D,addTodo:go,answerQuestion:I,applyTaskBoardAction:ko,contextPartTitle:L,decideProposal:uo,defineTaskBoardElement:No,deleteTodo:ho,describeTaskBoardAction:wo,emptyTaskBoardBase:no,isAnswered:lo,isHumanTodo:U,isPlanned:R,outputLocation:Do,parseTaskBoardBase:ro,presentContext:Ao,presentLog:Co,presentOutputs:Eo,presentQuestions:Oo,presentTodos:So,resolveTaskBoardNavigation:To,serializeTaskBoardAction:$o,setTodoStatus:bo,taskBoardActions:m,taskBoardBaseSchema:to,taskBoardCommentTargets:yo,taskBoardDefinitionFor:Lo,taskBoardHasTarget:zo,taskBoardMessages:Q,taskBoardTargetLabel:vo,taskBoardTitle:mo},Symbol.toStringTag,{value:"Module"}));export{No as d,Re as i};
1631
+ </span>`}#n(){return this.querySelector(':scope > [slot="main"]')!==null}#d(){return{answer:(o,a)=>this.#s(o,a),answerOther:o=>this.#i(o),decide:(o,a)=>this.dispatch(uo(o,a)),setStatus:(o,a)=>this.dispatch(bo(o,a)),filterTodos:o=>{this.todoFilter=o},addTodo:(o,a)=>this.#l(o,a),deleteTodo:o=>this.dispatch(ho(o)),copy:(o,a)=>{this.#p(o,a)},comment:o=>this.requestComment(o)}}#s(o,a){this.dispatch(Q(o,a))}#i(o){this.dispatch(Q(o,{kind:"answer",text:""})).ok&&(this.#o=o)}#l(o,a){const{base:t,state:r}=this.derivation,d=[...t.todos,...r.todos].map(l=>l.id);this.dispatch(go(Zo(o,d),o,a))}async#p(o,a){await oe(a)&&(clearTimeout(this.#a),this.#e=o,this.requestUpdate(),this.#a=setTimeout(()=>{this.#e=null,this.requestUpdate()},Ne))}}const No=()=>{customElements.get("dpk-template-task-board")||customElements.define("dpk-template-task-board",Wo)},Re=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_PARTS:E,DpkTemplateTaskBoard:Wo,MEMBER_KINDS:ao,TASK_BOARD_PAGE:co,TASK_STATUSES:eo,TODO_STATUSES:D,addTodo:go,answerQuestion:Q,applyTaskBoardAction:ko,contextPartTitle:L,decideProposal:uo,defineTaskBoardElement:No,deleteTodo:ho,describeTaskBoardAction:wo,emptyTaskBoardBase:no,isAnswered:lo,isHumanTodo:q,isPlanned:R,outputLocation:Do,parseTaskBoardBase:ro,presentContext:Ao,presentLog:zo,presentOutputs:Eo,presentQuestions:Oo,presentTodos:So,resolveTaskBoardNavigation:To,serializeTaskBoardAction:$o,setTodoStatus:bo,taskBoardActions:m,taskBoardBaseSchema:to,taskBoardCommentTargets:yo,taskBoardDefinitionFor:Lo,taskBoardHasTarget:Co,taskBoardMessages:U,taskBoardTargetLabel:vo,taskBoardTitle:mo},Symbol.toStringTag,{value:"Module"}));export{No as d,Re as i};