dev-process-kit 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/dist/chunks/{shared-CKG_SQh5.js → shared-ARDbveKk.js} +1 -1
- package/dist/chunks/{shared-DqB_TR20.js → shared-B76KHxdC.js} +1 -1
- package/dist/chunks/shared-BAvT77LJ.js +3448 -0
- package/dist/chunks/{shared-DaoPCw6-.js → shared-By_biQNN.js} +5 -5
- package/dist/chunks/{shared-BqW3KAJ4.js → shared-C0ctJXPv.js} +1 -1
- package/dist/chunks/{shared-DBDgdVsd.js → shared-CAzb0Ecs.js} +1 -1
- package/dist/chunks/{shared-DsVxrO_3.js → shared-CBM3Dha3.js} +1 -1
- package/dist/chunks/{shared-CwbzACTe.js → shared-CU-s47EI.js} +2 -2
- package/dist/chunks/{shared-DMlMTd3c.js → shared-CtB9MFc6.js} +1 -1
- package/dist/chunks/{shared-CPAT0Cgk.js → shared-CvU8S9Oz.js} +1 -1
- package/dist/chunks/{shared-B2K3LoOU.js → shared-CzhOCQdU.js} +1 -1
- package/dist/chunks/shared-DOi0CODr.js +736 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-Byv6cc0r.js +0 -2779
- package/dist/chunks/shared-iQIywbRc.js +0 -676
package/README.md
CHANGED
|
@@ -95,19 +95,20 @@ dev-process-kit ships **templates**, which make up a whole page, and **component
|
|
|
95
95
|
|
|
96
96
|
### Components
|
|
97
97
|
|
|
98
|
-
| Component | Element | What it is
|
|
99
|
-
| ---------------- | -------------------------------- |
|
|
100
|
-
| Review rail | `dpk-component-comment-panel` | Draft actions and comments, stale markers, deletion, and the copy or send-to-Claude hand-off
|
|
101
|
-
| Inline editing | `dpk-component-inline-edit` | A text/multiline editor that emits `dpk-commit`
|
|
102
|
-
| State diagram | `dpk-component-state-diagram` | Which states exist, and what moves between them
|
|
103
|
-
| Sequence diagram | `dpk-component-sequence-diagram` | In what order participants talk
|
|
104
|
-
| Dependency graph | `dpk-component-dependency-graph` | What depends on what, and what is circular
|
|
105
|
-
| ER diagram | `dpk-component-er-diagram` | What changed between two schema snapshots
|
|
106
|
-
| Architecture map | `dpk-component-architecture-map` | Which services exist, in which boundary
|
|
107
|
-
| Mind map | `dpk-component-mind-map` | A central topic and its subtopics, fanned out left and right, with folding
|
|
108
|
-
| Kanban | `dpk-component-kanban` | Columns of cards with WIP limits; reviewers move and add cards as draft actions
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
| Component | Element | What it is |
|
|
99
|
+
| ---------------- | -------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
100
|
+
| Review rail | `dpk-component-comment-panel` | Draft actions and comments, stale markers, deletion, and the copy or send-to-Claude hand-off |
|
|
101
|
+
| Inline editing | `dpk-component-inline-edit` | A text/multiline editor that emits `dpk-commit` |
|
|
102
|
+
| State diagram | `dpk-component-state-diagram` | Which states exist, and what moves between them |
|
|
103
|
+
| Sequence diagram | `dpk-component-sequence-diagram` | In what order participants talk |
|
|
104
|
+
| Dependency graph | `dpk-component-dependency-graph` | What depends on what, and what is circular |
|
|
105
|
+
| ER diagram | `dpk-component-er-diagram` | What changed between two schema snapshots |
|
|
106
|
+
| Architecture map | `dpk-component-architecture-map` | Which services exist, in which boundary |
|
|
107
|
+
| Mind map | `dpk-component-mind-map` | A central topic and its subtopics, fanned out left and right, with folding |
|
|
108
|
+
| Kanban | `dpk-component-kanban` | Columns of cards with WIP limits; reviewers move and add cards as draft actions |
|
|
109
|
+
| Formal spec | `dpk-component-formal-spec` | What a verified property says (premises, conclusions, what it does not claim), in plain words |
|
|
110
|
+
|
|
111
|
+
Diagrams and the formal spec are components, not templates: no draft actions, no review rail, no navigation. Put them in your own page, or inside a template. Each one has a page — `docs/templates/<name>.md` and `docs/components/<name>.md`.
|
|
111
112
|
|
|
112
113
|
## License
|
|
113
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as t,aE as a,a1 as i,aF as n}from"./shared-
|
|
1
|
+
import{aD as t,aE as a,a1 as i,aF as n}from"./shared-CU-s47EI.js";const o=t(class extends a{constructor(){super(...arguments),this.key=i}render(s,e){return this.key=s,e}update(s,[e,r]){return e!==this.key&&(n(s),this.key=e),r}});export{o as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a9 as Ro,aa as b,ab as i,ac as f,ad as c,ae as $,au as h,al as X,af as J,ag as V,q as w,v as qo,as as Io,ap as Qo,ai as Uo,ak as B,P as Ho,f as Mo,_ as Ko,V as Fo,R as S,a1 as s,a2 as n,A as jo,a3 as y,aH as Z,aI as Yo,ax as P,K as Xo,aC as Jo,a0 as Vo,T as oo,m as Zo,aA as oe}from"./shared-CwbzACTe.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($(ao),"agent")}),ae=b({id:h,title:T,status:i($(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($(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,N=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:N(o.context.goals),nonGoals:N(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:N(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),W=(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",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:w("ANSWER_QUESTION","question",Uo("kind",[b({kind:B("approve")}),b({kind:B("answer"),text:c()}),b({kind:B("clear")})])),DECIDE_PROPOSAL:w("DECIDE_PROPOSAL","todo",b({decision:$(["accept","decline","clear"])})),SET_TODO_STATUS:w("SET_TODO_STATUS","todo",b({status:$(D)})),ADD_TODO:w("ADD_TODO","page",b({id:h,title:J(c(),Qo(),V(1)),assignee:Io(h)}),{dedupeKey:qo}),DELETE_TODO:w("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=C(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}},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,_=(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)?_(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"}}},$o=(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}}},wo=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=>W(o,a)).map(a=>({value:`context:${a}`,label:_(e,a),group:e.contextGroup}))],To=(e,o)=>o,Ao=(e,o,a)=>({parts:E.filter(t=>W(o,t)).map(t=>{const r=o.context[t];return{id:t,title:_(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: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",F=p=>p.assigneeKind==="human",L=o.todos.map(p=>ge(e,o,a,p,t)),j=x==="human"?L.filter(F):L,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:L.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)&&W(e,o.id);case"question":return C(e,o.id)!==void 0;case"page":return!0;default:return!1}},_o=e=>{const o=U(e);return{name:"task-board",label:"Task Context Board",parseBase:ro,emptyBase:no,actions:m,apply:ko,hasTarget:zo,describe:(a,t,r)=>$o(o,a,t,r),serialize:wo,resolveNavigation:To,commentTargets:a=>yo(o,a),title:mo}},G=(e,o,a,t)=>n`
|
|
1
|
+
import{a9 as Ro,aa as b,ab as i,ac as f,ad as c,ae as $,at as h,al as X,af as J,ag as V,q as w,v as qo,as as Io,ap as Qo,ai as Uo,ak as B,P as Ho,f as Mo,_ as Ko,V as Fo,R as S,a1 as s,a2 as n,A as jo,a3 as y,aH as Z,aI as Yo,ay as P,K as Xo,aC as Jo,a0 as Vo,T as oo,m as Zo,aA as oe}from"./shared-CU-s47EI.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($(ao),"agent")}),ae=b({id:h,title:T,status:i($(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($(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,N=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:N(o.context.goals),nonGoals:N(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:N(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),W=(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",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:w("ANSWER_QUESTION","question",Uo("kind",[b({kind:B("approve")}),b({kind:B("answer"),text:c()}),b({kind:B("clear")})])),DECIDE_PROPOSAL:w("DECIDE_PROPOSAL","todo",b({decision:$(["accept","decline","clear"])})),SET_TODO_STATUS:w("SET_TODO_STATUS","todo",b({status:$(D)})),ADD_TODO:w("ADD_TODO","page",b({id:h,title:J(c(),Qo(),V(1)),assignee:Io(h)}),{dedupeKey:qo}),DELETE_TODO:w("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=C(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}},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,_=(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)?_(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"}}},$o=(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}}},wo=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=>W(o,a)).map(a=>({value:`context:${a}`,label:_(e,a),group:e.contextGroup}))],To=(e,o)=>o,Ao=(e,o,a)=>({parts:E.filter(t=>W(o,t)).map(t=>{const r=o.context[t];return{id:t,title:_(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: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",F=p=>p.assigneeKind==="human",L=o.todos.map(p=>ge(e,o,a,p,t)),j=x==="human"?L.filter(F):L,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:L.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)&&W(e,o.id);case"question":return C(e,o.id)!==void 0;case"page":return!0;default:return!1}},_o=e=>{const o=U(e);return{name:"task-board",label:"Task Context Board",parseBase:ro,emptyBase:no,actions:m,apply:ko,hasTarget:zo,describe:(a,t,r)=>$o(o,a,t,r),serialize:wo,resolveNavigation:To,commentTargets:a=>yo(o,a),title:mo}},G=(e,o,a,t)=>n`
|
|
2
2
|
<button
|
|
3
3
|
class="dpk-icon-btn board-comment"
|
|
4
4
|
type="button"
|