@imagile-dev/toil-ui 0.1.0-beta.4 → 0.1.0-beta.6

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 (61) hide show
  1. package/README.md +529 -180
  2. package/dist/app/assets/400-3Dshv1o0.css +1 -0
  3. package/dist/app/assets/400-BlzPh-5d.css +1 -0
  4. package/dist/app/assets/400-CPrO1MiG.css +1 -0
  5. package/dist/app/assets/400-CbHxiUkt.css +1 -0
  6. package/dist/app/assets/400-D153RTnK.css +1 -0
  7. package/dist/app/assets/600-B0bH0tPL.css +1 -0
  8. package/dist/app/assets/600-BC2hxnnO.css +1 -0
  9. package/dist/app/assets/600-BR9-_eiK.css +1 -0
  10. package/dist/app/assets/600-BsKsKkx5.css +1 -0
  11. package/dist/app/assets/600-Czj0FyAy.css +1 -0
  12. package/dist/app/assets/600-D452fNA9.css +1 -0
  13. package/dist/app/assets/600-D6SrDV1i.css +1 -0
  14. package/dist/app/assets/600-DBby7xF7.css +1 -0
  15. package/dist/app/assets/700-DlBBsyxq.css +1 -0
  16. package/dist/app/assets/700-Dr8Emwbw.css +1 -0
  17. package/dist/app/assets/Graph-CAQkpyYr.js +7 -0
  18. package/dist/app/assets/PowershellMan-DldYCOOP.js +1 -0
  19. package/dist/app/assets/gallery-447w4Nva.js +1 -0
  20. package/dist/app/assets/graph-CPXdI5ap.js +13 -0
  21. package/dist/app/assets/graph-CpctQRjW.css +1 -0
  22. package/dist/app/assets/index-CGVZr4kM.css +1 -0
  23. package/dist/app/assets/index-lUb0DGcI.js +732 -0
  24. package/dist/app/assets/jsx-runtime-DyZJNswf.js +1 -0
  25. package/dist/app/assets/latin-400-BVAlDo0s.css +1 -0
  26. package/dist/app/assets/latin-400-_vizA_-6.css +1 -0
  27. package/dist/app/assets/latin-600-BcF9gTYO.css +1 -0
  28. package/dist/app/assets/latin-600-Cv5fXBpv.css +1 -0
  29. package/dist/app/assets/latin-600-yBvtfTSt.css +1 -0
  30. package/dist/app/assets/latin-800-DN-4L033.css +1 -0
  31. package/dist/app/assets/sample-app-DEDGRcL1.js +27 -0
  32. package/dist/app/assets/series-B2reSWoM.svg +10 -0
  33. package/dist/app/assets/series-CRHwxbpo.svg +10 -0
  34. package/dist/app/assets/series-CppUGsOL.svg +10 -0
  35. package/dist/app/assets/series-DVzjwDhp.svg +10 -0
  36. package/dist/app/assets/series-zigaZBZX.svg +10 -0
  37. package/dist/app/assets/{source-serif-4-cyrillic-600-normal-DFnC3vAY.woff → source-serif-4-cyrillic-600-normal-CHh5eQWW.woff} +0 -0
  38. package/dist/app/assets/{source-serif-4-cyrillic-ext-600-normal-DiT2IGQm.woff → source-serif-4-cyrillic-ext-600-normal-h2VnbV3V.woff} +0 -0
  39. package/dist/app/assets/{source-serif-4-greek-600-normal-DhXQw1Kl.woff → source-serif-4-greek-600-normal-OkzgCkGB.woff} +0 -0
  40. package/dist/app/assets/{source-serif-4-latin-600-normal-DMD1h6_f.woff → source-serif-4-latin-600-normal-DeJomR3S.woff} +0 -0
  41. package/dist/app/assets/{source-serif-4-latin-ext-600-normal-C6NNqpJh.woff → source-serif-4-latin-ext-600-normal-B2fExS53.woff} +0 -0
  42. package/dist/app/assets/source-serif-4-latin-ext-600-normal-pa-C5Dkf.woff2 +0 -0
  43. package/dist/app/assets/source-serif-4-vietnamese-600-normal-B33FcZBi.woff2 +0 -0
  44. package/dist/app/assets/{source-serif-4-vietnamese-600-normal-B0WJbuqT.woff → source-serif-4-vietnamese-600-normal-CKUOBVO_.woff} +0 -0
  45. package/dist/app/assets/theme-BxDF9UoZ.css +1 -0
  46. package/dist/app/assets/theme-zHGs48Oo.css +1 -0
  47. package/dist/app/assets/unread-27QyAoLL.css +1 -0
  48. package/dist/app/assets/unread-Cpm8TUDq.js +4 -0
  49. package/dist/app/index.html +7 -2
  50. package/dist/server/toil-ui.js +21912 -10488
  51. package/package.json +19 -17
  52. package/dist/app/assets/Graph-8jUpxY5T.js +0 -7
  53. package/dist/app/assets/PowershellMan-D_GfPDDt.js +0 -1
  54. package/dist/app/assets/index-BJY6F1XS.js +0 -504
  55. package/dist/app/assets/index-BWejFOaT.css +0 -1
  56. package/dist/app/assets/press-start-2p-latin-400-normal-KLytu4cr.woff +0 -0
  57. package/dist/app/assets/press-start-2p-latin-400-normal-_wFEWmAB.woff2 +0 -0
  58. package/dist/app/assets/source-serif-4-latin-ext-600-normal-0sIUyHMO.woff2 +0 -0
  59. package/dist/app/assets/source-serif-4-vietnamese-600-normal-CznyfUKR.woff2 +0 -0
  60. package/dist/app/assets/theme-Bd9rCh2b.css +0 -1
  61. package/dist/app/assets/theme-hbyLw_lf.css +0 -1
@@ -0,0 +1,27 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DyZJNswf.js";import{$ as r,A as i,At as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,M as p,N as m,O as h,Ot as g,P as ee,Q as te,S as ne,St as re,T as ie,Tt as ae,X as oe,Z as se,_,_t as ce,a as le,at as ue,b as de,bt as fe,c as pe,ct as me,d as he,dt as ge,et as _e,f as ve,ft as ye,g as be,gt as xe,h as Se,ht as Ce,i as we,it as Te,j as Ee,jt as De,k as Oe,kt as ke,l as Ae,lt as je,m as Me,mt as Ne,n as Pe,nt as Fe,o as Ie,ot as Le,p as Re,pt as ze,r as Be,rt as Ve,s as He,st as Ue,t as We,tt as Ge,u as Ke,ut as qe,v as Je,vt as Ye,w as Xe,wt as Ze,x as Qe,xt as $e,y as et,yt as tt}from"./index-lUb0DGcI.js";import{Dn as nt,O as rt,dn as it,fn as at,k as ot,x as st}from"./graph-CPXdI5ap.js";import{m as ct}from"./unread-Cpm8TUDq.js";var lt=e(t(),1),ut=[`card-payments`,`settlement`,`checkout-web`],dt={claude:[`claude-sonnet-4-6`,`claude-haiku-4-5`],codex:[`gpt-5.5`],copilot:[`gpt-5-mini`,`claude-sonnet-4.6`]},ft=864e5;function pt(e){let t=e;return()=>{t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function mt(e,t,n,r){let i=Math.round(1500+n()*6e3),a=Math.round(200+n()*900),o=Math.round(n()*18e3);if(e===`claude`){let s=Math.round(n()*3e3),c=(i*3+a*15+o*.3+s*3.75)/1e6;return{...r,adapter:e,model:t,inputTokens:i,outputTokens:a,cachedInputTokens:o,cacheWriteTokens:s,costUsd:Math.round(c*1e4)/1e4,costSource:`sdk-estimate`,plan:!0}}return e===`codex`?{...r,adapter:e,model:t,inputTokens:i+o,cachedInputTokens:o,outputTokens:a,costSource:`none`,inputIncludesCached:!0}:{...r,adapter:e,model:t,inputTokens:i,outputTokens:a,cachedInputTokens:o,premiumRequests:+!!t.startsWith(`claude`),costSource:`none`}}function ht(e=_){let t=pt(295),n=Date.parse(e),r=[],i=[`claude`,`codex`,`copilot`];for(let e=29;e>=0;e--){let a=new Date(n-e*ft),o=a.getUTCDay()===0||a.getUTCDay()===6?+(t()<.3):1+Math.floor(t()*3);for(let e=0;e<o;e++){let o=i[Math.floor(t()*i.length)],s=dt[o],c=s[Math.floor(t()*s.length)],l=ut[Math.floor(t()*ut.length)],u=`sample-${a.toISOString().slice(0,10)}-${e}`,d=1+Math.floor(t()*3);for(let i=1;i<=d;i++){let s=o===`codex`?1:1+Math.floor(t()*3);for(let d=0;d<s;d++){let s=new Date(Math.min(n,Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),9+e*2,i*7+d))).toISOString();r.push(mt(o,c,t,{id:`${u}:${i}:${d}`,chatId:u,turn:i,toilProject:l,at:s}))}}}}return r}var gt={codexRates:null};function _t(e,t,n,r=_){return{adapter:`claude`,records:[mt(`claude`,`claude-sonnet-4-6`,pt(t*7919+n.length),{id:`${e}:${t}`,chatId:e,turn:t,toilProject:n,at:r})],context:{used:24800,window:2e5},notices:[],sample:!0}}function vt(){let e=ht(),t=new Date(Date.parse(`${_.slice(0,10)}T00:00:00.000Z`)-29*ft).toISOString();return{view:async()=>({since:t,now:_,records:e,retentionDays:null,settings:gt,problem:null,sample:!0}),save:async()=>{throw Error(`This preview shows sample figures, so its rates can't be saved. Toil UI on your own machine saves them in its data folder.`)}}}var yt=5913630;function bt(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}var xt=(e,t=0)=>bt((yt^Math.imul(e+1,2654435761)^Math.imul(t+1,2246822507))>>>0),v=(e,t,n)=>t+Math.floor(e()*(n-t+1)),St=(e,t)=>t[Math.floor(e()*t.length)],Ct=864e5,wt=Ct;function Tt(e){let t=Date.parse(e);if(!Number.isFinite(t))throw RangeError(`"${e}" isn't a date-time.`);return Math.floor(t/wt)*wt}function Et(e){let t=1+e,n=Math.floor(t/5);return n*7+(t-n*5)-1}function Dt(e,t,n=9,r=0){let i=t===0?Math.min(n,7):n;return new Date(e+Et(t)*wt+i*36e5+r*6e4).toISOString()}var Ot=(e,t)=>new Date(e+t*wt).toISOString().slice(0,10),kt=e=>e.replace(`Z`,`+0000`),y=[{key:`js`,name:`J. Smith`,team:`Storefront`,kind:`human`,jira:`jsmith`,github:`jsmith-dev`},{key:`ac`,name:`A. Chen`,team:`Storefront`,kind:`human`,jira:`achen`,github:`achen-dev`},{key:`rp`,name:`R. Patel`,team:`Storefront`,kind:`human`,jira:`rpatel`,github:`rpatel-dev`},{key:`ml`,name:`M. Lind`,team:`Storefront`,kind:`human`,jira:`mlind`,github:`mlind-dev`},{key:`kn`,name:`K. Nakamura`,team:`Storefront`,kind:`human`,jira:`knakamura`,github:`knakamura-dev`},{key:`do`,name:`D. Okafor`,team:`Platform`,kind:`human`,jira:`dokafor`,github:`dokafor-dev`},{key:`sg`,name:`S. Garcia`,team:`Platform`,kind:`human`,jira:`sgarcia`,github:`sgarcia-dev`},{key:`tn`,name:`T. Novak`,team:`Platform`,kind:`human`,jira:`tnovak`,github:`tnovak-dev`},{key:`ag`,name:`Copilot`,team:`Platform`,kind:`agent`,jira:`copilot-agent`,github:`copilot-swe-agent[bot]`}],At=e=>{let t=y.find(t=>t.key===e);if(!t)throw Error(`The sample team has no person "${e}".`);return t},jt=y.filter(e=>e.team===`Storefront`&&e.kind===`human`),Mt=y.filter(e=>e.team===`Platform`&&e.kind===`human`),Nt={jira:`svc-renovate`,name:`Renovate Bot`,github:`renovate[bot]`},Pt=e=>{let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length===0?0:t.length%2?t[n]:(t[n-1]+t[n])/2},Ft=(e,t)=>{let n={};for(let r of e){let e=t(r);e!==void 0&&(n[e]=(n[e]??0)+1)}return n},It=e=>e?Date.parse(e):NaN,Lt=(e,t=3)=>Math.round(e*10**t)/10**t;function Rt(e){let{items:t,changes:n}=e.owi,r=Date.parse(e.asOf),i=new Map(t.map(e=>[e.id,e])),a=Ge({scheme:te(`ktlo-feature`),items:t}).result,o=new Map(a.verdicts.map(e=>[e.id,e.category??`unsure`])),s=e=>e.statusCategory!==`DONE`&&e.links.some(e=>e.type===`blocks`&&e.direction===`inward`&&i.get(e.target)?.statusCategory!==`DONE`),c=e=>e.history?.transitions.find(e=>e.toCategory===`IN_PROGRESS`)?.at,l=e.jira.sprints.find(e=>e.state===`active`),u=Ft(t.filter(e=>e.statusCategory===`IN_PROGRESS`&&e.assignee!==null),e=>e.assignee.name??e.assignee.id),d=t.flatMap(e=>{let t=It(c(e)),n=It(e.resolved);return e.statusCategory===`DONE`&&Number.isFinite(t)&&Number.isFinite(n)?[(n-t)/Ct]:[]}),f=e.jira.sprints.map((n,r)=>{let i=Date.parse(n.start),a=Date.parse(n.end),s=t.filter(e=>e.sprints?.some(e=>e.name===n.name)),c=e=>e.history?.iterations.some(e=>e.to.includes(n.name)&&!e.from.includes(n.name)&&Date.parse(e.at)>i)===!0,l=s.filter(e=>e.statusCategory===`DONE`&&It(e.resolved)<=a),u=e.jira.sprints[r-1];return{name:n.name,start:n.start,end:n.end,state:n.state,committed:s.filter(e=>!c(e)).length,added:s.filter(c).length,carriedIn:u?s.filter(e=>e.sprints?.some(e=>e.name===u.name)).length:0,carriedOut:n.state===`closed`?s.filter(e=>e.sprints?.some(e=>e.name===`Sprint ${n.id+1}`)).length:0,done:l.length,donePoints:l.reduce((e,t)=>e+(t.estimate?.value??0),0),keepTheLightsOn:s.filter(e=>o.get(e.id)===`ktlo`).length,feature:s.filter(e=>o.get(e.id)===`feature`).length,unsure:s.filter(e=>o.get(e.id)===`unsure`).length}}),p=e.jira.versions.map(n=>{let r=Date.parse(n.startDate),i=t.filter(e=>e.releases?.some(e=>e.name===n.name)),a=t=>(e.jira.data.issues.find(e=>e.key===t.source.key)?.changelog).histories.some(e=>Date.parse(e.created.replace(`+0000`,`Z`))>r&&e.items.some(e=>e.field===`Fix Version`&&e.toString===n.name&&e.fromString===``))||It(t.created)>r,o=t=>(e.jira.data.issues.find(e=>e.key===t.source.key)?.changelog).histories.some(e=>e.items.some(e=>e.field===`Fix Version`&&e.toString===n.name&&e.fromString!==``)),s=i.filter(a).length,c=i.length-s;return{name:n.name,date:n.releaseDate,released:n.released,items:i.length,done:i.filter(e=>e.statusCategory===`DONE`).length,scopeAtStart:c,scopeAdded:s,growth:c===0?0:Lt(s/c),carriedIn:i.filter(o).length,open:i.filter(e=>e.statusCategory!==`DONE`).length}}),m=n.filter(e=>e.state===`OPEN`||e.state===`DRAFT`),h=a.summary;return{asOf:e.asOf,items:t.length,byType:Ft(t,e=>e.typeName??e.type),withNoEpic:t.filter(e=>e.type!==`EPIC`&&e.typeName!==`Initiative`&&!e.ancestors?.some(e=>e.type===`EPIC`)).length,withNoFixVersion:t.filter(e=>e.type!==`EPIC`&&e.releases?.length===0).length,withNoEstimate:t.filter(e=>e.estimate===null&&e.type!==`EPIC`&&e.typeName!==`Initiative`&&e.typeName!==`Sub-task`).length,withNoComponent:t.filter(e=>e.components?.length===0).length,withTwoComponents:t.filter(e=>(e.components?.length??0)>=2).length,withACustomer:t.filter(e=>(e.dims?.customer?.length??0)>0).length,inSeveralSprints:t.filter(e=>(e.sprints?.length??0)>1).length,reopened:t.filter(e=>e.history?.transitions.some(e=>e.fromCategory===`DONE`)).length,incidents:t.filter(e=>e.type===`INCIDENT`||e.labels.includes(`incident`)).length,blockedNow:t.filter(s).length,blockedByLinks:t.filter(e=>e.links.some(e=>e.type===`blocks`&&e.direction===`outward`)).length,unassignedInCurrentSprint:t.filter(e=>e.iteration?.name===l.name&&e.assignee===null&&e.statusCategory!==`DONE`).length,aging:t.filter(e=>e.statusCategory===`IN_PROGRESS`&&(r-It(c(e)))/864e5>15).length,overTheLimit:Object.entries(u).filter(([,t])=>t>e.wipLimit).map(([e])=>e).sort(),wipLimit:e.wipLimit,medianCycleDays:Lt(Pt(d),1),sprints:f,releases:p,components:Ft(t.flatMap(e=>(e.components??[]).map(e=>({name:e}))),e=>e.name),people:{total:y.length,teams:new Set(y.map(e=>e.team)).size,agents:y.filter(e=>e.kind===`agent`).length},pullRequests:{total:n.length,open:m.length,merged:n.filter(e=>e.state===`MERGED`).length,draft:n.filter(e=>e.state===`DRAFT`).length,bots:n.filter(e=>e.authorKind===`BOT`).length,agents:n.filter(e=>e.authorKind===`AGENT`).length,failingMoreThanADay:m.filter(e=>e.checks===`FAILING`&&e.checksAt!==null&&r-Date.parse(e.checksAt)>864e5).length,waitingOnReview:m.filter(e=>e.state===`OPEN`&&e.approvedAt===null).length},comments:{total:t.reduce((e,t)=>e+(t.comments?.length??0),0),items:t.filter(e=>(e.comments?.length??0)>0).length,outstandingQuestions:t.reduce((e,t)=>e+ke(t.comments??[]).length,0)},classification:{scheme:a.scheme.name,byCategory:h.byCategory,bySource:h.bySource,unsure:h.byCategory.unsure??0,unsureShare:Lt((h.byCategory.unsure??0)/t.length)}}}var zt=e=>(t,n={})=>({title:t,type:e,...n}),b=zt(`Story`),x=zt(`Task`),S=zt(`Bug`),Bt=zt(`Incident`),Vt=(e,t,n={})=>({title:e,type:`Sub-task`,parent:t,p:null,...n}),Ht=(e,t)=>`A dependency scan flagged ${e} in ${t}. The fixed release is out; this ticket is to take it and run the regression suite.\n\n* Upgrade to the patched release\n* Run the checkout and catalog suites\n* Note the version in the release notes`,Ut=e=>`h2. What happened\n${e}\n\nh2. Follow-up\n* Write the timeline\n* Decide what would have caught it earlier`,Wt=[{sprint:0,rows:[{title:`Shopfront 2.x: a faster, friendlier storefront`,type:`Initiative`,ref:`I1`,l:`feature`,d:`The 2.x line of the storefront: checkout, discovery and accounts, one release at a time.`},{title:`Checkout redesign`,type:`Epic`,ref:`E1`,epic:`I1`,c:`Checkout`,l:`feature`},{title:`Product discovery and search`,type:`Epic`,ref:`E2`,epic:`I1`,c:`Catalog,Search`,l:`feature`},{title:`Accounts and loyalty`,type:`Epic`,ref:`E3`,c:`Accounts`,l:`feature`},{title:`Platform upkeep`,type:`Epic`,ref:`E4`,c:`Platform`,l:`ktlo`,d:`The work that keeps the storefront standing: upgrades, patches, capacity and clean-up.`},{title:`Order tracking and returns`,type:`Epic`,ref:`E5`,c:`Accounts,Checkout`}]},{sprint:21,rows:[b(`Add a saved-address picker to the checkout form`,{ref:`saved-address`,epic:`E1`,c:`Checkout`,p:5,fv:`2.3`}),b(`Show delivery estimates on the cart page`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.3`}),b(`Pay with a saved card in one tap`,{ref:`one-tap`,epic:`E1`,c:`Checkout`,p:8,fv:`2.3`,carry:!0}),Vt(`Design the saved-card list`,`one-tap`),Vt(`Write the saved-card migration`,`one-tap`),S(`Cart total ignores the discount code on mobile`,{epic:`E1`,c:`Checkout`,p:2,fv:`2.3`,l:`mobile`}),b(`Faceted filters on the category page`,{epic:`E2`,c:`Catalog`,p:5,fv:`2.3`}),b(`Rank in-stock products first in search results`,{epic:`E2`,c:`Search`,p:3,fv:`2.3`}),x(`Bump react-dom to the latest 18.x patch`,{c:`Platform`,p:1,by:`bot`,l:`dependencies`}),b(`Email a receipt when an order is placed`,{epic:`E5`,c:`Checkout,Accounts`,p:3,fv:`2.3`}),b(`Sign in with a one-time email code`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.3`}),x(`Move the image resizer to the new job queue`,{epic:`E4`,c:`Platform`,p:5}),b(`Add alt text fields to the product editor`,{c:`Catalog`,p:2,fv:`2.3`,l:`a11y,feature`}),x(`Upgrade Node to the current LTS in CI`,{epic:`E4`,c:`Platform`,p:3}),b(`Customer address book page`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.3`}),b(`Show stock levels on the product page`,{epic:`E2`,c:`Catalog`,p:2,fv:`2.3`}),b(`Remember the last used delivery address`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.3`}),b(`Persist the cart across browser tabs`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.3`}),b(`Lazy-load product images below the fold`,{epic:`E2`,c:`Catalog`,p:2,fv:`2.3`,l:`frontend`})]},{sprint:22,rows:[b(`Order history list with paging`,{epic:`E5`,c:`Accounts`,p:5,fv:`2.3`}),b(`Reorder button on past orders`,{epic:`E5`,c:`Accounts`,p:3,fv:`2.3`}),b(`Product image zoom on touch devices`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.3`,l:`mobile`}),b(`Search suggestions as you type`,{ref:`typeahead`,epic:`E2`,c:`Search`,p:8,fv:`2.3`,carry:!0}),b(`Recently viewed products strip`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.3`}),b(`Guest checkout without creating an account`,{ref:`guest`,epic:`E1`,c:`Checkout,Accounts`,p:5,fv:`2.3`}),Vt(`Update the order model for guests`,`guest`),Vt(`Add the guest email step`,`guest`),b(`Apple Pay button on the payment step`,{epic:`E1`,c:`Checkout`,p:5,fv:`2.3`}),S(`Coupon field loses focus after each keystroke`,{epic:`E1`,c:`Checkout`,p:1,fv:`2.3`,reopen:!0}),S(`Postcode lookup returns nothing for UK outward codes`,{epic:`E1`,c:`Checkout`,p:2,fv:`2.3`}),b(`Loyalty points balance in the account header`,{epic:`E3`,c:`Accounts`,p:3,fv:`2.3`}),b(`Earn points on completed orders`,{ref:`earn`,epic:`E3`,c:`Accounts`,p:8,fv:`2.3`,blocks:[`redeem`]}),x(`Patch CVE-2026-21114 in the image processing library`,{epic:`E4`,c:`Platform`,p:2,l:`security`,d:Ht(`CVE-2026-21114`,`the image processing library`)}),x(`Bump the postgres client to 16.4`,{epic:`E4`,c:`Platform`,p:1,by:`bot`,l:`dependencies`}),b(`Product comparison table`,{c:`Catalog`,p:5,fv:`2.3`,l:`feature`}),b(`Add a size filter to the category page`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.3`}),b(`Email preferences page`,{epic:`E3`,c:`Accounts`,p:3,fv:`2.3`}),S(`Basket empties when the session expires mid-checkout`,{c:`Checkout`,p:3,fv:`2.3`,late:!0,epic:`E1`})]},{sprint:23,rows:[b(`Redeem points at checkout`,{ref:`redeem`,epic:`E3`,c:`Checkout,Accounts`,p:8,fv:`2.3`}),b(`Search results page redesign`,{ref:`results`,epic:`E2`,c:`Search`,p:8,fv:`2.4`,slipped:`2.3`,carry:!0}),b(`Add synonyms to the product search index`,{epic:`E2`,c:`Search`,p:3,fv:`2.3`}),b(`Wishlist sharing by link`,{c:`Accounts`,p:3,fv:`2.3`,l:`feature`}),b(`Save for later in the cart`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.3`}),b(`Order status page`,{epic:`E5`,c:`Accounts`,p:5,fv:`2.3`}),b(`Email notifications for shipped orders`,{ref:`ship-emails`,epic:`E5`,c:`Accounts`,p:5,fv:`2.4`,slipped:`2.3`,carry:!0}),S(`Order confirmation email shows the wrong currency`,{epic:`E5`,c:`Checkout`,p:2,fv:`2.3`}),S(`Product page returns a 500 when a variant has no image`,{c:`Catalog`,p:3,fv:`2.3`,epic:`E2`}),x(`Replace the deprecated payment SDK calls`,{epic:`E4`,c:`Platform,Checkout`,p:5,fv:`2.3`}),x(`Bump jest and ts-jest`,{epic:`E4`,c:`Platform`,p:1,by:`bot`,l:`dependencies`}),x(`Patch CVE-2026-23780 in the session middleware`,{epic:`E4`,c:`Platform`,p:2,l:`security`,d:Ht(`CVE-2026-23780`,`the session middleware`)}),Bt(`Checkout outage: payment provider timeouts`,{ref:`outage`,c:`Checkout`,late:!0,l:`incident`,p:null,d:Ut(`Card payments timed out for forty minutes while the provider degraded. Orders were retried by hand.`)}),b(`Gift message on orders`,{c:`Checkout`,p:2,fv:`2.3`,late:!0,l:`feature`}),b(`Product reviews summary on the product page`,{epic:`E2`,c:`Catalog`,p:5,fv:`2.3`}),b(`Carousel of related products`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.3`}),b(`Order summary on small screens`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.3`,l:`mobile`}),b(`Loyalty banner in the cart`,{epic:`E3`,c:`Checkout,Accounts`,p:2,fv:`2.3`}),b(`Filter product reviews by rating`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.3`})]},{sprint:24,rows:[x(`Upgrade the search cluster to enable typo tolerance`,{ref:`search-upgrade`,c:`Search`,p:5,fv:`2.4`,blocks:[`tuning`]}),b(`Product recommendations on the cart page`,{epic:`E2`,c:`Catalog,Checkout`,p:8,fv:`2.4`,carry:!0}),b(`Saved payment methods page`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.4`}),b(`Delete my account and data`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.4`,l:`compliance`}),b(`Order tracking link in the shipped email`,{epic:`E5`,c:`Accounts`,p:3,fv:`2.4`}),b(`Start a return from the order page`,{ref:`returns`,epic:`E5`,c:`Accounts`,p:8,fv:`2.4`,carry:!0,blocks:[`refund-status`]}),Vt(`Return reasons and the refund choice`,`returns`),Vt(`Notify the warehouse of a return`,`returns`),b(`Express checkout for returning customers`,{epic:`E1`,c:`Checkout`,p:8,fv:`2.4`,carry:!0}),b(`Address autocomplete on the checkout form`,{epic:`E1`,c:`Checkout`,p:5,fv:`2.4`}),S(`Discount applied twice when a coupon and a sale overlap`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.4`,av:`2.3`}),S(`Saved card expiry shows the wrong month`,{epic:`E3`,c:`Checkout,Accounts`,p:1,fv:`2.4`,av:`2.3`}),S(`Search facets count zero after filtering twice`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.4`,av:`2.3`,reopen:!0}),S(`Wishlist page times out with more than 200 items`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.4`}),Bt(`Search index lagging behind the catalog by hours`,{ref:`lag`,c:`Search`,late:!0,l:`incident`,p:null,d:Ut(`New products took up to six hours to appear in search after the indexer fell behind.`)}),x(`Bump next to the latest minor`,{epic:`E4`,c:`Platform`,p:1,by:`bot`,l:`dependencies`}),x(`Upgrade the CI runners to the new image`,{epic:`E4`,c:`Platform`,p:3}),x(`Move session storage from Redis 6 to 7`,{epic:`E4`,c:`Platform`,p:5}),b(`Back-in-stock alerts`,{c:`Catalog`,p:3,fv:`2.4`,late:!0,l:`feature`}),S(`Double submit on the payment button creates two orders`,{c:`Checkout`,p:1,fv:`2.4`,late:!0,epic:`E1`}),b(`Wishlist items on the account dashboard`,{epic:`E3`,c:`Accounts`,p:3,fv:`2.4`}),b(`Bulk add to cart from a wishlist`,{epic:`E3`,c:`Accounts`,p:3,fv:`2.4`}),b(`Promo code suggestions at checkout`,{epic:`E1`,c:`Checkout`,p:5,fv:`2.4`}),b(`Zero-result search page with suggestions`,{epic:`E2`,c:`Search`,p:5,fv:`2.4`}),b(`Estimated delivery on the product page`,{epic:`E1`,c:`Catalog,Checkout`,p:3,fv:`2.4`}),b(`Sort search results by rating`,{epic:`E2`,c:`Search`,p:2,fv:`2.4`})]},{sprint:25,rows:[b(`Delivery date picker at checkout`,{epic:`E1`,c:`Checkout`,p:5,fv:`2.4`}),b(`Order notes for gift wrapping`,{epic:`E1`,c:`Checkout`,p:2,fv:`2.4`,added:!0}),b(`Wishlist price-drop alerts`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.4`}),b(`Loyalty tiers and tier badges`,{ref:`tiers`,epic:`E3`,c:`Accounts`,p:8,fv:`2.4`,carry:!0,start:-17,w:`rp`}),Vt(`Tier thresholds and the rule engine`,`tiers`),b(`Search within a category`,{epic:`E2`,c:`Search,Catalog`,p:3,fv:`2.4`}),b(`Refund status on the order page`,{ref:`refund-status`,epic:`E5`,c:`Accounts`,p:5,fv:`2.4`}),b(`Print a return label`,{epic:`E5`,c:`Accounts`,p:3,fv:`2.4`}),S(`Return request fails for orders paid with a gift card`,{epic:`E5`,c:`Accounts`,p:3,fv:`2.4`}),S(`Mobile menu overlaps the search box on small phones`,{c:`Catalog`,p:2,fv:`2.4`,l:`mobile`}),S(`Checkout hangs when the address service is slow`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.4`,av:`2.3`,ref:`hang`}),x(`Patch CVE-2026-31337 in the image resizer`,{epic:`E4`,c:`Platform`,p:2,l:`security`,fv:`2.4`,d:Ht(`CVE-2026-31337`,`the image resizer`)}),x(`Upgrade the payment gateway client to v4`,{epic:`E1`,ref:`gateway`,c:`Checkout,Platform`,p:5,fv:`2.4`,blocks:[`bnpl`]}),x(`Bump eslint and the typescript-eslint plugins`,{c:`Platform`,p:1,by:`bot`,l:`dependencies`}),x(`Cut the CI build time with a shared cache`,{ref:`cache`,epic:`E4`,c:`Platform`,p:5,carry:!0,start:-16,w:`do`}),x(`Alert on slow checkout requests`,{epic:`E4`,c:`Platform,Checkout`,p:2,late:!0}),Bt(`Elevated 5xx on the product API after the deploy`,{c:`Catalog,Platform`,late:!0,l:`incident`,p:null,d:Ut(`A deploy raised the 5xx rate on the product API to four percent until it was rolled back.`)}),b(`Newsletter signup in the footer`,{c:`Accounts`,p:2,fv:`2.5`,l:`feature`}),b(`Pickup point selection at checkout`,{epic:`E1`,c:`Checkout`,p:5,fv:`2.4`,added:!0}),b(`Save a basket for later across devices`,{epic:`E1`,c:`Checkout`,p:5,fv:`2.5`}),S(`Rounding error in the loyalty discount on partial refunds`,{epic:`E3`,c:`Accounts`,p:2,fv:`2.4`,added:!0}),x(`Add unit tests for the discount rules`,{epic:`E1`,c:`Checkout`,p:3,w:`ag`})]},{sprint:26,rows:[b(`Buy now, pay later at checkout`,{ref:`bnpl`,epic:`E1`,c:`Checkout`,p:8,fv:`2.4`,st:`done`,w:`ac`}),b(`Product bundles on the category page`,{epic:`E2`,c:`Catalog`,p:5,fv:`2.4`,st:`done`,w:`kn`}),b(`Loyalty points history page`,{epic:`E3`,c:`Accounts`,p:3,fv:`2.4`,st:`done`,w:`js`}),S(`Gift card balance shows in the wrong currency`,{epic:`E1`,c:`Checkout`,p:2,fv:`2.4`,st:`done`,w:`ml`}),x(`Bump playwright to the latest release`,{c:`Platform`,p:1,by:`bot`,l:`dependencies`,st:`done`,w:`tn`}),b(`Refunds issued to the original payment method`,{ref:`refunds`,epic:`E5`,c:`Accounts`,p:5,fv:`2.4`,st:`review`,w:`rp`,blocks:[`cancel`]}),b(`Order cancellation before dispatch`,{ref:`cancel`,epic:`E5`,c:`Accounts,Checkout`,p:5,fv:`2.4`,st:`prog`,w:`kn`}),b(`Size guide on product pages`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.4`,st:`prog`,w:`ac`}),x(`Upgrade the Postgres cluster to 16`,{ref:`pg`,epic:`E4`,c:`Platform`,p:8,fv:`2.4`,st:`prog`,w:`sg`,blocks:[`quebec`]}),x(`Move image storage behind the CDN`,{epic:`E4`,c:`Platform,Catalog`,p:5,fv:`2.5`,st:`prog`,w:`sg`}),x(`Replace the nightly export script`,{epic:`E4`,c:`Platform`,p:3,st:`prog`,w:`sg`}),x(`Rotate the TLS certificates before they expire`,{epic:`E4`,c:`Platform`,p:2,st:`review`,w:`sg`,due:-3}),S(`Checkout fails for postcodes with a trailing space`,{epic:`E1`,c:`Checkout`,p:2,fv:`2.4`,st:`review`,w:`js`}),S(`Facet counts are stale after a bulk price update`,{epic:`E2`,c:`Catalog`,p:3,fv:`2.4`,st:`prog`,w:`ml`}),x(`Patch CVE-2026-35002 in the HTTP client`,{epic:`E4`,c:`Platform`,p:2,fv:`2.4`,st:`review`,w:`do`,l:`security`,d:Ht(`CVE-2026-35002`,`the HTTP client`)}),b(`Birthday rewards for loyalty members`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.5`,st:`todo`,w:`none`}),b(`Search relevance tuning dashboard`,{ref:`tuning`,epic:`E2`,c:`Search`,p:5,fv:`2.4`,st:`todo`,w:`none`,due:-2}),b(`Customer reviews moderation queue`,{epic:`E2`,c:`Catalog`,p:null,fv:`2.5`,st:`todo`,w:`none`}),Bt(`Stale prices shown after the flash sale`,{c:`Catalog`,late:!0,l:`incident`,st:`done`,w:`do`,p:null,d:Ut(`Prices cached before the flash sale ended were served for an hour after it did.`)}),S(`Wrong tax on orders shipped to Quebec`,{ref:`quebec`,c:`Checkout`,p:3,fv:`2.4`,st:`todo`,w:`ac`,late:!0}),b(`Saved baskets with a shareable link`,{epic:`E1`,c:`Checkout`,p:null,fv:`2.4`,st:`todo`,w:`js`,added:!0}),b(`Offer a pickup option in the order summary`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.4`,st:`todo`,w:`ml`,added:!0,late:!0})]},{sprint:-1,rows:[b(`Gift receipts for orders with a gift message`,{epic:`E1`,c:`Checkout`,p:3,fv:`2.5`,st:`todo`}),b(`Wishlist for guests`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.5`,st:`todo`}),b(`Dark mode for the storefront`,{c:`Catalog`,p:8,fv:`2.5`,st:`todo`,l:`feature`}),b(`Faster product images on slow connections`,{epic:`E2`,c:`Catalog`,p:5,fv:`2.5`,st:`todo`}),b(`Subscription orders for repeat purchases`,{epic:`E5`,c:`Checkout,Accounts`,p:13,fv:`2.5`,st:`todo`}),b(`Admin export of customer orders`,{c:`Accounts`,p:3,st:`todo`,l:`feature`}),x(`Migrate the build to the new monorepo tooling`,{epic:`E4`,c:`Platform`,p:8,st:`todo`}),x(`Retire the legacy order API`,{epic:`E4`,c:`Platform`,p:8,fv:`2.5`,st:`todo`}),b(`Review the fraud rules for the new payment methods`,{c:`Checkout`,p:3,st:`todo`,l:`ktlo`}),b(`Localise the checkout into French`,{epic:`E1`,p:8,fv:`2.5`,st:`todo`}),b(`Gift card purchase flow`,{epic:`E1`,c:`Checkout`,p:8,fv:`2.5`,st:`todo`}),b(`Share a wishlist with the household`,{epic:`E3`,c:`Accounts`,p:5,fv:`2.5`,st:`todo`}),b(`Compare products side by side on mobile`,{epic:`E2`,c:`Catalog`,p:5,fv:`2.5`,st:`todo`})]}],Gt=[{on:`Replace the nightly export script`,by:`sg`,day:-6,hour:10,minute:5,text:`Which team still reads the CSV from the old export?`},{on:`Replace the nightly export script`,by:`do`,day:-6,hour:13,minute:40,text:`Only finance, and they are moving to the API in Sprint 27.`},{on:`Upgrade the Postgres cluster to 16`,by:`sg`,day:-3,hour:10,minute:15,text:`Dry run on staging finished in 38 minutes, no errors.`},{on:`Upgrade the Postgres cluster to 16`,by:`do`,day:-2,hour:16,minute:40,text:`Do we have a rollback plan if the 16 upgrade slips past the maintenance window?`},{on:`Facet counts are stale after a bulk price update`,by:`ac`,day:-1,hour:11,minute:20,text:`Do we need a migration for the facet counts, or will the reindex job cover it?`},{on:`Checkout fails for postcodes with a trailing space`,by:`rp`,day:-1,hour:10,minute:15,text:`Is the trailing space also stripped on the billing postcode?`},{on:`Checkout fails for postcodes with a trailing space`,by:`js`,day:-1,hour:14,minute:30,text:`Yes, both go through the same validator. Covered by the new test.`},{on:`Order cancellation before dispatch`,by:`kn`,day:-1,hour:9,minute:30,text:`Rebased onto main, CI is green again.`},{on:`Loyalty tiers and tier badges`,by:`kn`,day:-1,hour:11,minute:45,text:`Badge artwork is in the shared drive, thanks for the quick turnaround.`},{on:`Refunds issued to the original payment method`,by:`kn`,day:-1,hour:13,minute:10,text:`Added the partial-refund case to the test plan.`},{on:`Move image storage behind the CDN`,by:`kn`,day:-1,hour:15,minute:25,text:`The cache headers look right from the storefront side.`},{on:`Patch CVE-2026-35002 in the HTTP client`,by:`kn`,day:0,hour:7,minute:5,text:`Storefront builds pass with the patched client.`},{on:`Patch CVE-2026-35002 in the HTTP client`,by:`ag`,day:-1,hour:17,minute:10,text:`Opened a pull request with the client bump and a regression test. It waits on a review.`},{on:`Rotate the TLS certificates before they expire`,by:`tn`,day:0,hour:7,minute:10,text:`Renewed certificates are staged; I will cut over after stand-up.`}],Kt=`https://jira.imagile.dev`,qt=e=>{let t=At(e);return{self:`${Kt}/rest/api/2/user?username=${t.jira}`,name:t.jira,key:t.jira,displayName:t.name,active:!0}};function Jt(e,t){let n=new Map,r=5e4;for(let i of Gt){let a=t.find(e=>e.row.title===i.on);if(!a)throw Error(`The sample backlog has no item called "${i.on}" for a comment to be on.`);let o=kt(Dt(e,i.day,i.hour,i.minute));r++;let s={self:`${Kt}/rest/api/2/issue/${1e4+a.num}/comment/${r}`,id:String(r),author:qt(i.by),body:i.text,updateAuthor:qt(i.by),created:o,updated:o};n.set(a.key,[...n.get(a.key)??[],s])}return new Map(t.map(e=>[e.key,{comments:n.get(e.key)??[],maxResults:(n.get(e.key)??[]).length,total:(n.get(e.key)??[]).length,startAt:0}]))}var C=`https://jira.imagile.dev`,Yt=`SHOP`,w={epicLink:`customfield_10014`,points:`customfield_10016`,sprint:`customfield_10020`,customer:`customfield_10500`},Xt={Checkout:`10300`,Catalog:`10301`,Search:`10302`,Accounts:`10303`,Platform:`10304`};Object.keys(Xt);var Zt={"2.3":`10400`,"2.4":`10401`,"2.5":`10402`},Qt={todo:{name:`To Do`,id:`10000`,statusCategory:{id:2,key:`new`,name:`To Do`}},prog:{name:`In Progress`,id:`3`,statusCategory:{id:4,key:`indeterminate`,name:`In Progress`}},review:{name:`In Review`,id:`10100`,statusCategory:{id:4,key:`indeterminate`,name:`In Progress`}},done:{name:`Done`,id:`10001`,statusCategory:{id:3,key:`done`,name:`Done`}}},$t={Initiative:{name:`Initiative`,id:`10005`,subtask:!1},Epic:{name:`Epic`,id:`10000`,subtask:!1},Story:{name:`Story`,id:`10001`,subtask:!1},Task:{name:`Task`,id:`10002`,subtask:!1},Bug:{name:`Bug`,id:`1`,subtask:!1},Incident:{name:`Incident`,id:`10004`,subtask:!1},"Sub-task":{name:`Sub-task`,id:`10003`,subtask:!0}},en=[1,1,1,2,2,2,2,3,3,3,3,4,4,5,6,8,11,16],tn={Checkout:[`payments`,`frontend`],Catalog:[`frontend`,`content`],Search:[`search`,`backend`],Accounts:[`backend`,`email`],Platform:[`infra`,`ops`]},nn=[`Acme`,`Globex`,`Initech`],T=e=>-6-10*(26-e),rn=e=>T(e)+9;function an(e){let t=Wt.flatMap(e=>e.rows.map(t=>({row:t,block:e.sprint}))),n=new Map;t.forEach(({row:e},t)=>{e.ref!==void 0&&n.set(e.ref,t+1)});let r=e=>`${Yt}-${e}`,i=new Map([...n].map(([e,t])=>[e,r(t)])),a=e=>{let t=n.get(e);if(t===void 0)throw Error(`The sample backlog has no row called "${e}".`);return t},o=t.map(({row:e,block:n},i)=>{let o=i+1,s=e.parent===void 0?void 0:t[a(e.parent)-1],c=s?on(s.row,s.block):on(e,n),l=c.at(-1)??0,u=e.st??(e.type===`Epic`||e.type===`Initiative`?`todo`:e.type!==`Sub-task`&&l>=26?`prog`:`done`);return{key:r(o),num:o,row:e,block:n,sprints:c,state:u,assignee:null}});for(let e of o)e.assignee=cn(e,o,a);let s=[21,22,23,24,25,26].map(t=>({id:t,name:`Sprint ${t}`,state:t<26?`closed`:`active`,start:Dt(e,T(t),9),end:Dt(e,rn(t),17)})),c=e=>{let t=s[e-21];return`com.atlassian.greenhopper.service.sprint.Sprint@6f3a${e}[id=${e},rapidViewId=7,state=${t.state===`closed`?`CLOSED`:`ACTIVE`},name=${t.name},startDate=${t.start},endDate=${t.end},completeDate=${t.state===`closed`?t.end:`<null>`},sequence=${e},goal=]`},l=[{id:Zt[`2.3`],name:`2.3`,released:!0,startDate:Ot(e,Et(-60)),releaseDate:Ot(e,Et(-25))},{id:Zt[`2.4`],name:`2.4`,released:!1,startDate:Ot(e,Et(-25)),releaseDate:Ot(e,11)},{id:Zt[`2.5`],name:`2.5`,released:!1,startDate:Ot(e,12),releaseDate:Ot(e,39)}],u=e=>{let t=l.find(t=>t.name===e);return{self:`${C}/rest/api/2/version/${t.id}`,id:t.id,name:t.name,archived:!1,released:t.released,releaseDate:t.releaseDate,startDate:t.startDate}},d=new Map,f=3e4,p={id:`10000`,name:`Blocks`,inward:`is blocked by`,outward:`blocks`},m=e=>({key:e.key,fields:{summary:e.row.title,status:Qt[e.state]}});for(let e of o)for(let t of e.row.blocks??[]){let n=o[a(t)-1];f++,d.set(e.num,[...d.get(e.num)??[],{id:String(f),type:p,outwardIssue:m(n)}]),d.set(n.num,[...d.get(n.num)??[],{id:String(f),type:p,inwardIssue:m(e)}])}let h=Jt(e,o),g=o.map(t=>{let{row:n}=t,i=xt(t.num),s=pn(t,o,a,i,e),l=mn(t,s,i,e).map((e,n)=>({id:String(4e4+t.num*10+n),author:e.who?sn(e.who):sn(At(`rp`)),created:kt(e.when),items:e.items})),f=l.at(-1),p=s.created,g=f?f.created:kt(p),ee=(n.c??``).split(`,`).filter(Boolean),te=un(n,ee,i),ne=o.filter(e=>e.row.parent===n.ref&&n.ref!==void 0),re=n.epic!==void 0&&n.type!==`Epic`&&n.type!==`Sub-task`?r(a(n.epic)):null,ie=(n.type===`Story`||n.type===`Bug`)&&xt(t.num,2)()<.33?St(xt(t.num,3),nn):null,ae=n.p===void 0?dn(n,i):n.p,oe=s.resolved===void 0?null:kt(s.resolved),se={summary:n.title,description:n.d??null,issuetype:{self:`${C}/rest/api/2/issuetype/${$t[n.type].id}`,...$t[n.type]},status:{self:`${C}/rest/api/2/status/${Qt[t.state].id}`,...Qt[t.state]},resolution:t.state===`done`?{self:`${C}/rest/api/2/resolution/10000`,id:`10000`,name:`Done`}:null,resolutiondate:oe,priority:{self:`${C}/rest/api/2/priority/3`,name:fn(n,te,i),id:`3`},assignee:t.assignee?sn(t.assignee):null,reporter:ln(n,i),labels:te,project:{self:`${C}/rest/api/2/project/10200`,id:`10200`,key:Yt,name:`Shop`},created:kt(p),updated:g,duedate:n.due===void 0?null:Ot(e,n.due),timeoriginalestimate:null,issuelinks:d.get(t.num)??[],comment:h.get(t.key),subtasks:ne.map(m),...n.type===`Sub-task`?{parent:{key:r(a(n.parent)),fields:{}}}:{},...n.type===`Epic`&&n.epic!==void 0?{parent:{key:r(a(n.epic)),fields:{}}}:{},fixVersions:n.fv===void 0?[]:[u(n.fv)],versions:n.av===void 0?[]:[u(n.av)],components:ee.map(e=>({self:`${C}/rest/api/2/component/${Xt[e]}`,id:Xt[e],name:e})),[w.epicLink]:re,[w.points]:ae,[w.sprint]:t.sprints.length===0?null:t.sprints.map(c),[w.customer]:ie===null?null:{self:`${C}/rest/api/2/customFieldOption/${10600+nn.indexOf(ie)}`,value:ie,id:String(10600+nn.indexOf(ie))}};return{expand:`renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations`,id:String(1e4+t.num),self:`${C}/rest/api/2/issue/${1e4+t.num}`,key:t.key,fields:se,names:{[w.epicLink]:`Epic Link`,[w.points]:`Story Points`,[w.sprint]:`Sprint`,[w.customer]:`Customer`},changelog:{startAt:0,maxResults:1e3,total:l.length,histories:l}}});return{data:{startAt:0,maxResults:1e3,total:g.length,issues:g},placed:o,keyOf:i,sprints:s,versions:l}}function on(e,t){return t<=0||e.type===`Epic`||e.type===`Initiative`?[]:e.carry?[t,t+1]:[t]}function sn(e){return{self:`${C}/rest/api/2/user?username=${e.jira}`,name:e.jira,key:e.jira,displayName:e.name,active:!0}}function cn(e,t,n){let{row:r}=e;if(r.w===`none`)return null;if(r.w!==void 0)return At(r.w);if(r.type===`Epic`||r.type===`Initiative`||e.block<0)return null;if(r.type===`Sub-task`)return t[n(r.parent)-1].assignee??St(xt(e.num,1),jt);let i=(r.c??``).startsWith(`Platform`)||r.epic===`E4`;return St(xt(e.num,1),i?Mt:jt)}function ln(e,t){return e.by===`bot`?sn(Nt):e.type===`Story`||e.type===`Epic`||e.type===`Initiative`?sn(At(`rp`)):e.type===`Incident`?sn(At(`do`)):sn(St(t,y.filter(e=>e.kind===`human`)))}function un(e,t,n){let r=(e.l??``).split(`,`).filter(Boolean);return r.length>0||t.length===0?r:n()<.3?[St(n,tn[t[0]]??[`backend`])]:r}function dn(e,t){return e.type===`Story`?St(t,[2,3,3,5,5,8]):e.type===`Bug`?St(t,[1,2,2,3,5]):e.type===`Task`?St(t,[1,2,3,3,5]):null}function fn(e,t,n){return e.type===`Incident`?`Highest`:t.includes(`security`)?`High`:e.type===`Bug`?n()<.35?`High`:`Medium`:n()<.15?`Low`:`Medium`}function pn(e,t,n,r,i){let{row:a}=e,o=e.sprints[0],s=e.sprints.at(-1),c={},l=()=>v(r,9,16),u=()=>v(r,0,59),d;if(d=a.type===`Initiative`?-62:a.type===`Epic`?-60+e.num:o===void 0?-v(r,3,25):T(o)-v(r,2,12),a.fv===`2.4`&&o!==void 0&&a.late!==!0&&d>-26){let e=-25-v(r,1,8);d=a.added===!0?d:e}if(a.fv===`2.4`&&a.added===!0&&a.late!==!0&&o!==void 0&&(d=Math.min(Math.max(d,-24),T(o))),a.late&&o!==void 0){let e=T(o)+(a.type===`Incident`?v(r,1,3):v(r,2,5));c.addedAt=Math.min(e,o>=26?-1:rn(o)),d=c.addedAt}let f=a.late?8:l();c.created=d;let p={created:Dt(i,d,f,u()),idx:c,moments:{}};if(c.addedAt!==void 0&&(p.addedAt=c.addedAt),e.state===`todo`)return p;if(a.type===`Sub-task`){let e=t[n(a.parent)-1],s=pn(e,t,n,xt(e.num),i),l=(s.idx.start??T(o??26))+1,d=Math.min(l+v(r,1,3),e.state===`done`?s.idx.end??-1:-1);return c.start=Math.min(l,d-1),c.end=d,p.start=c.start,p.end=d,p.resolved=Dt(i,d,15,u()),p}let m=(s??26)>=26?0:rn(s??26),h=a.type===`Incident`?v(r,1,2):St(r,en),g;if(g=a.start===void 0?a.type===`Incident`?d:a.carry&&o!==void 0?T(o)+v(r,1,6):a.late&&c.addedAt!==void 0?c.addedAt+v(r,0,1):T(o??26)+v(r,0,4):a.start,g=Math.max(g,d),e.state===`done`){let e=a.end??(a.carry&&s!==void 0&&o!==void 0?T(s)+v(r,0,5):g+h);e=Math.min(e,m),g>=e&&(g=e-1),c.start=g,c.end=e,e-g>=2&&r()<.8&&(c.review=g+Math.max(1,Math.round((e-g)*.6))),a.reopen&&(c.out=e+2,c.back=e+2+v(r,1,2))}else g=Math.min(g,e.state===`review`?-2:-1),c.start=g,e.state===`review`&&(c.review=Math.min(-1,g+Math.max(1,Math.round(h*.6))));for(let e of[`start`,`review`,`end`,`out`,`back`])c[e]!==void 0&&(p[e]=c[e]);let ee=c.back??c.end;return ee!==void 0&&(p.resolved=Dt(i,ee,15,u())),p}function mn(e,t,n,r){let{row:i}=e,a=[],o=e.assignee,s=(e,t=10)=>Dt(r,e,t,v(n,0,59)),c=(e,t,n,r,i=o)=>({when:s(n,r),who:i,items:[{field:`status`,fieldtype:`jira`,fieldId:`status`,from:Qt[e].id,fromString:Qt[e].name,to:Qt[t].id,toString:Qt[t].name}]}),l=(e,t,n,r)=>({when:s(e,t),who:At(`rp`),items:[{field:`Sprint`,fieldtype:`custom`,fieldId:w.sprint,from:null,fromString:n,to:null,toString:r}]}),u=e=>`Sprint ${e}`,d=e.sprints[0];d!==void 0&&i.type!==`Sub-task`&&(i.late?a.push(l(t.addedAt??T(d)+2,10,``,u(d))):a.push(l(T(d)-1,16,``,u(d))),i.carry&&a.push(l(rn(d),17,u(d),`${u(d)}, ${u(d+1)}`))),i.fv!==void 0&&i.added===!0&&d!==void 0&&a.push({when:s(T(d)+1,11),who:At(`rp`),items:[{field:`Fix Version`,fieldtype:`jira`,fieldId:`fixVersions`,from:null,fromString:``,to:null,toString:i.fv}]}),i.slipped!==void 0&&i.fv!==void 0&&a.push({when:s(-25,15),who:At(`rp`),items:[{field:`Fix Version`,fieldtype:`jira`,fieldId:`fixVersions`,from:null,fromString:i.slipped,to:null,toString:i.fv}]});let f=t.idx;return f.start!==void 0&&a.push(c(`todo`,`prog`,f.start,9)),f.review!==void 0&&a.push(c(`prog`,`review`,f.review,13)),f.end!==void 0&&a.push(c(f.review===void 0?`prog`:`review`,`done`,f.end,15,f.review===void 0?o:St(n,y.filter(e=>e.kind===`human`&&e!==o)))),f.out!==void 0&&f.back!==void 0&&(a.push(c(`done`,`prog`,f.out,10)),a.push(c(`prog`,`done`,f.back,15))),a.sort((e,t)=>Date.parse(e.when)-Date.parse(t.when))}var hn=`https://github.imagile.dev`,gn=`${hn}/api/v3`,E=`imagile`,D=`shop`,O=(e,t)=>[[`test`,`success`,e,t],[`e2e`,`success`,e,t]],_n=[{item:`Delivery date picker`,user:`ac`,branch:`feature/delivery-date-picker`,created:[-14,10],merged:[-13,11],reviews:[[`ml`,`APPROVED`,-13,9]],checks:O(-14,11),commits:[`Add the delivery date picker`,`Disable dates the carrier cannot serve`],files:[[`src/checkout/delivery-date.tsx`,164,3],[`src/checkout/delivery-date.test.tsx`,72,0]]},{item:`Wishlist price-drop alerts`,user:`js`,branch:`feature/price-drop-alerts`,created:[-13,13],merged:[-11,16],reviews:[[`kn`,`CHANGES_REQUESTED`,-12,10],[`kn`,`APPROVED`,-11,15]],checks:O(-13,14),commits:[`Alert when a wishlist item drops in price`,`Throttle alerts to one a day`],files:[[`src/accounts/price-alerts.ts`,118,6],[`src/accounts/price-alerts.test.ts`,64,0],[`src/email/templates/price-drop.html`,41,0]]},{item:`Upgrade the payment gateway client`,user:`do`,branch:`chore/gateway-client-v4`,created:[-15,9],merged:[-15,15],reviews:[[`sg`,`APPROVED`,-15,13]],checks:O(-15,10),commits:[`Upgrade the payment gateway client to v4`],files:[[`package.json`,1,1],[`src/payments/gateway.ts`,38,41]]},{item:`Patch CVE-2026-31337`,user:`tn`,branch:`security/image-resizer-patch`,created:[-12,9],merged:[-12,11],reviews:[[`do`,`APPROVED`,-12,10]],checks:O(-12,9),commits:[`Take the patched image resizer release`],files:[[`package.json`,1,1],[`package-lock.json`,14,14]]},{item:`Search within a category`,user:`rp`,branch:`feature/search-in-category`,created:[-12,15],merged:[-10,13],reviews:[[`ac`,`APPROVED`,-10,11]],checks:O(-12,16),commits:[`Scope the search box to the current category`],files:[[`src/search/scope.ts`,52,8],[`src/search/search-box.tsx`,21,4]]},{item:`Order notes for gift wrapping`,user:`kn`,branch:`feature/gift-wrap-notes`,created:[-15,11],merged:[-14,16],reviews:[[`js`,`APPROVED`,-14,15]],checks:O(-15,12),commits:[`Add a gift wrap note to the order`],files:[[`src/checkout/gift-note.tsx`,58,2]]},{item:`Bump eslint and the typescript-eslint`,name:`Bump eslint from 9.12.0 to 9.14.0`,user:`renovate`,branch:`renovate/eslint-9.x`,created:[-12,6],merged:[-11,10],reviews:[[`tn`,`APPROVED`,-11,9]],checks:[[`test`,`success`,-12,7]],commits:[`Bump eslint from 9.12.0 to 9.14.0`],files:[[`package.json`,2,2],[`package-lock.json`,31,29]]},{item:`Buy now, pay later`,user:`ac`,branch:`feature/bnpl-checkout`,created:[-5,9],merged:[-3,15],reviews:[[`rp`,`APPROVED`,-3,14]],checks:O(-5,10),commits:[`Add the pay-later option to the payment step`,`Show the instalment plan before confirming`],files:[[`src/checkout/pay-later.tsx`,188,9],[`src/checkout/pay-later.test.tsx`,97,0],[`src/payments/plans.ts`,44,0]]},{item:`Loyalty points history`,user:`js`,branch:`feature/points-history`,created:[-4,10],merged:[-3,11],reviews:[[`ml`,`APPROVED`,-3,10]],checks:O(-4,11),commits:[`List loyalty points earned and spent`],files:[[`src/accounts/points-history.tsx`,96,0],[`src/accounts/points-history.test.tsx`,48,0]]},{item:`Size guide on product pages`,user:`ac`,branch:`feature/size-guide`,created:[-1,14],requested:[`ml`],checks:O(-1,15),commits:[`Add the size guide drawer`],files:[[`src/catalog/size-guide.tsx`,132,0],[`src/catalog/product-page.tsx`,9,2]]},{item:`Facet counts are stale`,user:`ml`,branch:`fix/facet-counts-after-price-update`,created:[-3,10],requested:[`ac`,`kn`],checks:O(-3,11),commits:[`Refresh facet counts after a bulk price update`],files:[[`src/catalog/facets.ts`,27,11]]},{item:`Refunds issued to the original payment method`,user:`rp`,branch:`feature/refund-to-source`,created:[-6,11],reviews:[[`kn`,`COMMENTED`,-5,10]],requested:[`kn`],checks:O(-6,12),commits:[`Refund to the payment method on the order`,`Fall back to store credit for expired cards`],files:[[`src/orders/refunds.ts`,144,22],[`src/orders/refunds.test.ts`,118,0]],mergeable:!1},{item:`Order cancellation before dispatch`,user:`kn`,branch:`feature/cancel-before-dispatch`,created:[-4,15],draft:!0,checks:O(-4,16),commits:[`Draft: cancel an order that has not shipped`],files:[[`src/orders/cancel.ts`,73,0]]},{item:`Checkout fails for postcodes with a trailing space`,user:`js`,branch:`fix/postcode-trailing-space`,created:[-4,9],requested:[`ml`],checks:[[`test`,`success`,-4,10],[`e2e`,`failure`,-3,10]],commits:[`Trim the postcode before validating it`],files:[[`src/checkout/postcode.ts`,6,2],[`src/checkout/postcode.test.ts`,14,0]]},{item:`Bump playwright`,name:`Bump playwright from 1.47.2 to 1.49.1`,user:`renovate`,branch:`renovate/playwright-1.x`,created:[-1,6],requested:[`tn`],checks:[[`test`,`success`,-1,7]],commits:[`Bump playwright from 1.47.2 to 1.49.1`],files:[[`package.json`,2,2],[`package-lock.json`,26,24]]},{item:`Replace the nightly export script`,user:`ag`,branch:`copilot/replace-nightly-export`,created:[-2,13],requested:[`sg`],checks:O(-2,14),commits:[`Replace the nightly export script with a scheduled job`],files:[[`jobs/nightly-export.ts`,87,0],[`scripts/nightly-export.sh`,0,52]]}],vn=e=>{let t=bt([...e].reduce((e,t)=>Math.imul(e,31)+t.charCodeAt(0)>>>0,7));return Array.from({length:40},()=>`0123456789abcdef`[Math.floor(t()*16)]).join(``)},yn=e=>{if(e===`renovate`)return{login:Nt.github,id:4100,avatar_url:`${hn}/avatars/u/4100`,type:`Bot`};let t=At(e),n=100+y.indexOf(t);return{login:t.github,id:n,avatar_url:`${hn}/avatars/u/${n}`,type:t.kind===`agent`?`Bot`:`User`}},bn={id:5200,name:D,full_name:`${E}/${D}`,html_url:`${hn}/${E}/${D}`,owner:{login:E,id:1,type:`Organization`}};function xn(e,t){return[..._n].sort((e,t)=>e.created[0]-t.created[0]||e.created[1]-t.created[1]).map((n,r)=>{let i=201+r,a=t.find(e=>e.row.title.startsWith(n.item));if(!a)throw Error(`The sample backlog has no item that starts "${n.item}".`);let o=`${a.key}: ${n.name??a.row.title}`,s=(t,n)=>Dt(e,t,n,v(bt(i*97+t*13+n),0,59)),c=vn(`${i}-head`),l=yn(n.user),u=s(...n.created),d=n.merged?s(...n.merged):null,f=(n.reviews??[]).map((e,t)=>({id:9e4+i*10+t,user:yn(e[0]),body:``,state:e[1],submitted_at:s(e[2],e[3]),commit_id:c,author_association:`MEMBER`})),p=[u,...f.map(e=>e.submitted_at),...d?[d]:[]].sort().at(-1),m=n.files.reduce((e,t)=>e+t[1],0),h=n.files.reduce((e,t)=>e+t[2],0);return{url:`${gn}/repos/${E}/${D}/pulls/${i}`,id:7e3+i,number:i,state:d?`closed`:`open`,locked:!1,title:o,user:l,body:`Implements ${a.key}.`,draft:n.draft??!1,html_url:`${hn}/${E}/${D}/pull/${i}`,created_at:u,updated_at:p,closed_at:d,merged_at:d,merge_commit_sha:vn(`${i}-merge`),requested_reviewers:(n.requested??[]).map(yn),requested_teams:[],labels:[],head:{label:`${E}:${n.branch}`,ref:n.branch,sha:c,repo:bn},base:{label:`${E}:main`,ref:`main`,sha:vn(`main`),repo:bn},merged:d!==null,mergeable:d?null:n.mergeable??!0,mergeable_state:d?`unknown`:n.mergeable===!1?`dirty`:`clean`,comments:0,review_comments:0,commits:n.commits.length,additions:m,deletions:h,changed_files:n.files.length,included:{reviews:f,checks:n.checks.map((e,t)=>({id:8e3+i*10+t,name:e[0],head_sha:c,status:e[1]===null?`in_progress`:`completed`,conclusion:e[1],html_url:`${hn}/${E}/${D}/actions/runs/${8e3+i*10+t}`,started_at:s(e[2],e[3]),completed_at:e[1]===null?null:s(e[2],e[3]),app:{slug:`github-actions`,name:`GitHub Actions`}})),commits:n.commits.map((e,t)=>({sha:vn(`${i}-c${t}`),commit:{message:e,author:{name:l.login,email:`you@example.com`,date:u}},author:l})),files:n.files.map(([e,t,n])=>({filename:e,status:`modified`,additions:t,deletions:n,changes:t+n}))}}})}var Sn={jira:`sample-jira`,github:`sample-github`},Cn=`sample-team`,wn=`0.0.0-sample`,Tn=(e,t,n,r)=>({ok:!0,data:t,error:null,meta:{command:e,durationMs:1,version:wn,context:{connection:{value:n,source:`default`,default:`named`},inputs:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{value:t,source:`toil-project`}]))}}});function En(){return{name:Cn,description:`A web shop team for trying toil: two teams, six sprints, three releases and an AI agent, with no connection to set up.`,repos:[{name:D,remotes:[`https://github.imagile.dev/${E}/${D}.git`]}],jira:{connection:Sn.jira,project:Yt,fields:{estimate:w.points,iteration:w.sprint,epicLink:w.epicLink,customer:w.customer}},github:{connection:Sn.github,owner:E,repo:D},people:y.map(e=>({name:e.name,...e.kind===`agent`?{kind:`agent`}:{},team:e.team,ids:{jira:e.jira,github:e.github}})),wipLimit:3,dimensions:{customer:{jira:w.customer}},classify:{scheme:`ktlo-feature`}}}function Dn(e){let t=Tt(e),n=an(t),r=xn(t,n.placed),i=En(),a=Tn(`jira issue search`,{...n.data,issues:n.data.issues.map(({changelog:e,...t})=>t)},Sn.jira,{project:Yt}),o=n.data.issues.map(e=>({key:e.key,history:Tn(`jira issue history`,e.changelog.histories,Sn.jira,{project:Yt})})),c=r.map(e=>Tn(`github pr get`,e,Sn.github,{owner:E,repo:D})),{documents:u,skipped:f}=Ze([a,...o,...c]),p=ae(On(i.jira.fields)),m=d(u,{fields:p,skipped:f,dimensions:s(i.dimensions),keys:l([`${Yt}-{n}=${Sn.jira}`])});if(m.warnings.length>0||m.skipped.length>0)throw Error(`The sample team did not map cleanly: ${[...m.warnings.map(e=>e.message),...m.skipped.map(e=>e.reason)].join(`; `)}`);let h={owi:`0.2`,count:m.items.length,items:m.items,changes:m.changes,histories:[],unmapped:{},skipped:[]},g=Rt({asOf:new Date(Date.parse(e)).toISOString(),base:t,jira:n,owi:h,wipLimit:i.wipLimit});return{asOf:g.asOf,jira:n.data,prs:r,toilProject:i,owi:h,facts:g}}function On(e){return Object.fromEntries(Object.entries(e).filter(([e])=>nt.includes(e)))}var k=Dn(_),kn={...k.toilProject,description:`A whole sample team: two squads, six sprints, three releases and an AI agent. Nothing to set up.`},An=k.jira,jn={owner:`imagile`,repo:`shop`},Mn=[`merged`,`mergeable`,`mergeable_state`,`comments`,`review_comments`,`commits`,`additions`,`deletions`,`changed_files`,`included`],Nn=k.prs.map(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!Mn.includes(e)))),Pn=Object.fromEntries(k.prs.map(e=>[e.number,e])),Fn=e=>`@${y.find(t=>t.key===e).github}`,In=[`# Who reviews what`,`* ${Fn(`ml`)}`,`src/checkout/ ${Fn(`ac`)} ${Fn(`js`)}`,`src/orders/ ${Fn(`kn`)} ${Fn(`rp`)}`,`jobs/ ${Fn(`sg`)} ${Fn(`do`)}`,`package.json ${Fn(`tn`)}`,``].join(`
2
+ `),Ln={type:`file`,encoding:`base64`,size:In.length,name:`CODEOWNERS`,path:`.github/CODEOWNERS`,content:btoa(In),sha:`abc12345abc12345abc12345abc12345abc12345`,html_url:`https://github.imagile.dev/${jn.owner}/${jn.repo}/blob/main/.github/CODEOWNERS`,text:In},A=e=>`[[${e}]]`,Rn=(e,t)=>t===0?`0%`:`${Math.round(e/t*100)}%`,j=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,zn=864e5;function Bn(){let e=k.toilProject.people??[],t=k.toilProject.classify?.scheme??null;return oe(k.owi.items,e,t)}function Vn(e,t){let n=Bn();return it({items:n.items,changes:k.owi.changes,spec:{measure:e,split:t},asOf:_,people:n.people,...n.categories?{categories:n.categories}:{},...n.scheme?{scheme:n.scheme}:{}})}function Hn(){let e=Vn(`throughput`,`category`),t=e.total.value??0,n=e.rows.map((t,n)=>({row:t,cell:e.cells[n][0]})).filter(e=>e.cell.value!==null),r=[`${j(t,`item`)} were finished in the ${j(Math.round((Date.parse(`${e.period.to}T00:00:00Z`)-Date.parse(`${e.period.from}T00:00:00Z`))/zn)+1,`day`)} up to ${e.period.to}.`];for(let{row:e,cell:i}of n.sort((e,t)=>(t.cell.value??0)-(e.cell.value??0)).slice(0,2)){let n=i.items[0];r.push(`${e.label}: ${i.value} of them, ${Rn(i.value??0,t)}${n?`, for example ${A(n)}`:``}.`)}return e.coverage.notes.length>0&&r.push(e.coverage.notes[0]),{label:`What is our work mix?`,parts:r}}function Un(){let e=at(k.owi.items,`2.4`,_),t=[`Release 2.4 holds ${j(e.total,`item`)}: ${e.done} done and ${e.open} open.`];return e.added===null?t.push(`Its start day was not read, so how much scope arrived after work began cannot be said.`):t.push(`${j(e.added,`item`)} ${e.added===1?`was`:`were`} created after its start day, ${e.start}${e.addedItems?.length?`, for example ${e.addedItems.slice(0,2).map(A).join(` and `)}`:``}. That counts only items created after the start, so it is a floor.`),e.pastDue===null?t.push(`Its date was not read, so how many items are open past it cannot be said.`):e.pastDue.length>0&&t.push(`${j(e.pastDue.length,`item`)} still open after the release date, for example ${A(e.pastDue[0])}.`),{label:`How is release 2.4 going?`,parts:t}}var Wn=e=>e.statusCategory!==`DONE`;function Gn(){let e=k.owi.items.filter(e=>e.iteration?.state===`current`),t=e[0]?.iteration?.name??null;if(!t)return{label:`What is at risk this sprint?`,parts:[`No sprint is running in the sample, so there is nothing to weigh.`]};let n=e.filter(Wn),r=n.reduce((e,t)=>e+(t.estimate?.value??0),0),i=n.filter(e=>!e.estimate),a=n.filter(e=>(e.sprints??[]).length>1),o=[`${t} has ${j(n.length,`open item`)} of ${e.length}, holding ${r} points.`];return i.length>0&&o.push(`${j(i.length,`open item`)} ${i.length===1?`has`:`have`} no estimate, so those points leave them out, for example ${A(i[0].id)}.`),a.length>0&&o.push(`${j(a.length,`open item`)} came over from an earlier sprint, for example ${A(a[0].id)}.`),{label:`What is at risk this sprint?`,parts:o}}function Kn(){let e=Date.parse(_),t=k.owi.changes.filter(e=>e.state===`OPEN`&&e.created).sort((e,t)=>Date.parse(e.created)-Date.parse(t.created));if(t.length===0)return{label:`What's waiting on a review?`,parts:[`No pull request is open in the sample.`]};let n=t[0],r=Math.floor((e-Date.parse(n.created))/zn),i=t.filter(e=>e.reviewers.length===0),a=[`${j(t.length,`pull request`)} ${t.length===1?`is`:`are`} open. The oldest, ${A(n.id)}, was opened ${j(r,`day`)} ago.`];return i.length>0&&a.push(`${j(i.length,`open pull request`)} ${i.length===1?`has`:`have`} no reviewer asked yet, for example ${A(i[0].id)}.`),{label:`What's waiting on a review?`,parts:a}}function qn(){let e=k.toilProject.wipLimit,t=new Map;for(let e of k.owi.items.filter(e=>e.statusCategory===`IN_PROGRESS`&&e.assignee)){let n=e.assignee.name??e.assignee.id;t.set(n,[...t.get(n)??[],e])}let n=[...t.entries()].sort((e,t)=>t[1].length-e[1].length||e[0].localeCompare(t[0]));if(n.length===0)return{label:`Who has the most in progress?`,parts:[`Nobody has an item in progress in the sample.`]};let r=[`${j(n.length,`person`,`people`)} ${n.length===1?`has`:`have`} work in progress. This is load, not performance.`];for(let[e,t]of n.slice(0,2))r.push(`${e} has ${j(t.length,`item`)} in progress, for example ${A(t[0].id)}.`);if(e!==void 0){let t=n.filter(([,t])=>t.length>e);r.push(t.length>0?`${j(t.length,`person`,`people`)} ${t.length===1?`is`:`are`} over the limit of ${e}.`:`Nobody is over the limit of ${e}.`)}return{label:`Who has the most in progress?`,parts:r}}var Jn;function Yn(){return Jn??={mix:Hn(),release:Un(),risk:Gn(),review:Kn(),people:qn()},Jn}var Xn=[{id:`mix`,label:`What is our work mix?`},{id:`release`,label:`How is release 2.4 going?`},{id:`risk`,label:`What is at risk this sprint?`},{id:`review`,label:`What's waiting on a review?`},{id:`people`,label:`Who has the most in progress?`}];function Zn(e){let t=e.cells.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),n=[`${e.title}: the chart holds ${j(e.cells.length,`cell`)}, ${t.length} of them with something in.`];for(let e of t.slice(0,2)){let t=e.items[0];n.push(`${e.rowLabel}, ${e.columnLabel}, holds ${j(e.count,`item`)} [[cell:${st(e)}]]${t?`, for example ${A(t)}`:``}.`)}return n.push(e.notable[0]??`Nothing in this chart is flagged as having moved.`),n.push(e.coverage[0]??`Everything in the table was read.`),n}function Qn(){let e=k.owi.items,t=e.filter(e=>e.iteration?.state===`current`),n=t.filter(Wn),r=n.filter(e=>(e.sprints??[]).length>1),i=n.filter(e=>!e.estimate),a=r[0]??i[0]??n[0]??null,o=k.owi.changes.filter(e=>e.state===`OPEN`&&e.created).sort((e,t)=>Date.parse(e.created)-Date.parse(t.created)),s=Date.parse(_),c=o[0]??null,l=c?Math.floor((s-Date.parse(c.created))/zn):0,u=new Map;for(let t of e.filter(e=>e.statusCategory===`IN_PROGRESS`&&e.assignee)){let e=t.assignee.name??t.assignee.id;u.set(e,[...u.get(e)??[],t])}let d=[...u.entries()].sort((e,t)=>t[1].length-e[1].length||e[0].localeCompare(t[0]))[0]??null,f=[],p=t[0]?.iteration?.name??`The sprint`;if(n.length>0){let e=[...r,...i.filter(e=>!r.includes(e))].slice(0,2);f.push({lens:`sprint`,label:`Sprint`,line:`${j(n.length,`open item`)}, ${j(r.length,`carried over`,`carried over`)}, ${j(i.length,`without an estimate`,`without an estimate`)}`,text:null,items:e.map(e=>({id:e.id,why:r.includes(e)?`It came over from an earlier sprint and is still open in ${p}.`:`It has no estimate, so ${p}'s points leave it out.`,next:r.includes(e)?`Decide whether to finish it, split it or move it out of the sprint.`:`Estimate it, so the sprint says what is really left.`}))})}if(c){let e=o.filter(e=>e.reviewers.length===0);f.push({lens:`waiting`,label:`Waiting on review`,line:`${j(o.length,`pull request`)} open, the oldest for ${j(l,`day`)}`,text:`The oldest, ${A(c.id)}, was opened ${j(l,`day`)} ago.${e[0]?` ${A(e[0].id)} has no reviewer asked yet.`:``} Ask for the first review today.`,items:[]})}return d&&f.push({lens:`load`,label:`Load`,line:`${d[0]} has ${j(d[1].length,`item`)} in progress`,text:null,items:[{id:d[1][0].id,why:`${d[0]} has ${j(d[1].length,`item`)} in progress, the most on the team. This is load, not performance.`,next:`Check whether something can be handed on or finished before another is started.`}]}),{recommendation:a?`Settle ${A(a.id)} first: ${r.includes(a)?`it came over from an earlier sprint`:`it is open in the running sprint`}, and ${j(n.length,`item`)} ${n.length===1?`is`:`are`} still open in ${p}${c?`. Then ask for a review of ${A(c.id)}, which has waited ${j(l,`day`)}`:``}.`:c?`Ask for a first review of ${A(c.id)}: it has waited ${j(l,`day`)}.`:`Nothing needs anyone right now.`,reasons:f,onTrack:``,changed:[],leftOut:[]}}var $n={"card-payments":{context:{key:`context`,type:`systemContext`,title:`Card payments in context`,inside:[],outside:[{id:`cardholder`,name:`Cardholder`,description:`Pays with a card at a merchant.`,how:`observed`,source:`payments-core/README.md:9`,kind:`person`,external:!1,database:!1,path:`people[0]`},{id:`support`,name:`Support agent`,description:`Looks up a payment to answer a dispute.`,how:`inferred`,reason:`the API has a lookup route that only an internal role may call`,kind:`person`,external:!1,database:!1,path:`people[1]`},{id:`payments`,name:`Card payments`,description:`Takes a card payment and settles it.`,kind:`system`,external:!1,database:!1,how:`observed`,source:`payments-core/README.md:1`,path:`systems[0]`},{id:`network`,name:`Card network`,description:`Authorises and clears card payments.`,kind:`system`,external:!0,database:!1,how:`inferred`,reason:`the worker names a scheme client; the network itself is outside this repository`,path:`systems[1]`},{id:`ledger`,name:`General ledger`,description:`Where finance books settled payments.`,kind:`system`,external:!0,database:!1,path:`systems[2]`}],edges:[{from:`cardholder`,to:`payments`,description:`Pays through`,technology:`JSON/HTTPS`,how:`observed`,source:`payments-core/openapi/payments.yaml:3`},{from:`support`,to:`payments`,description:`Looks up payments in`,how:`inferred`,reason:`the lookup route is documented for support`},{from:`payments`,to:`network`,description:`Sends settlements to`,how:`inferred`,reason:`the worker builds scheme messages; the destination is not in the repository`},{from:`payments`,to:`ledger`,description:`Posts settled totals to`}]},containers:{key:`containers`,type:`container`,title:`Card payments, containers`,boundary:{id:`payments`,name:`Card payments`,description:`Takes a card payment and settles it.`,kind:`system`,external:!1,database:!1,how:`observed`,source:`payments-core/README.md:1`,path:`systems[0]`},inside:[{id:`api`,name:`Payments API`,description:`Accepts and looks up payments.`,technology:`Java, Spring Boot`,kind:`container`,external:!1,database:!1,how:`observed`,source:`payments-core/pom.xml:14`,parent:`payments`,path:`systems[0].containers[0]`},{id:`tokeniser`,name:`Tokeniser`,description:`Swaps a card number for a token at the edge.`,technology:`Java`,kind:`container`,external:!1,database:!1,how:`observed`,source:`payments-core/tokeniser/pom.xml:9`,parent:`payments`,path:`systems[0].containers[1]`},{id:`worker`,name:`Settlement worker`,description:`Sends authorised payments to the card network.`,technology:`Java`,kind:`container`,external:!1,database:!1,how:`inferred`,reason:`its main class reads the settlements topic, but no manifest names it as a service`,parent:`payments`,path:`systems[0].containers[2]`},{id:`db`,name:`Payments database`,description:`Payments and their state.`,technology:`PostgreSQL`,kind:`container`,external:!1,database:!0,how:`observed`,source:`payments-core/src/main/resources/application.yml:22`,parent:`payments`,path:`systems[0].containers[3]`},{id:`cache`,name:`Token cache`,description:`Recently used tokens.`,technology:`Redis`,kind:`container`,external:!1,database:!1,how:`inferred`,reason:`a cache client is configured, but nothing here says who runs it`,parent:`payments`,path:`systems[0].containers[4]`}],outside:[{id:`cardholder`,name:`Cardholder`,description:`Pays with a card at a merchant.`,how:`observed`,source:`payments-core/README.md:9`,kind:`person`,external:!1,database:!1,path:`people[0]`},{id:`support`,name:`Support agent`,description:`Looks up a payment to answer a dispute.`,how:`inferred`,reason:`the API has a lookup route that only an internal role may call`,kind:`person`,external:!1,database:!1,path:`people[1]`},{id:`network`,name:`Card network`,description:`Authorises and clears card payments.`,kind:`system`,external:!0,database:!1,how:`inferred`,reason:`the worker names a scheme client; the network itself is outside this repository`,path:`systems[1]`},{id:`ledger`,name:`General ledger`,description:`Where finance books settled payments.`,kind:`system`,external:!0,database:!1,path:`systems[2]`}],edges:[{from:`cardholder`,to:`api`,description:`Pays through`,technology:`JSON/HTTPS`,how:`observed`,source:`payments-core/openapi/payments.yaml:3`},{from:`support`,to:`api`,description:`Looks up payments in`,how:`inferred`,reason:`the lookup route is documented for support`},{from:`api`,to:`tokeniser`,description:`Swaps card numbers with`,how:`observed`,source:`payments-core/src/main/java/pay/api/CardClient.java:31`},{from:`tokeniser`,to:`cache`,description:`Keeps recent tokens in`,how:`inferred`,reason:`the tokeniser configures a cache client`},{from:`api`,to:`db`,description:`Reads and writes`,technology:`JDBC`,how:`observed`,source:`payments-core/src/main/resources/application.yml:22`},{from:`worker`,to:`db`,description:`Reads authorised payments from`,technology:`JDBC`,how:`observed`,source:`payments-core/worker/src/main/java/pay/worker/Poller.java:18`},{from:`worker`,to:`network`,description:`Sends settlements to`,how:`inferred`,reason:`the worker builds scheme messages; the destination is not in the repository`},{from:`worker`,to:`ledger`,description:`Posts settled totals to`}]}},settlement:{context:{key:`context`,type:`systemContext`,title:`Settlement in context`,inside:[],outside:[{id:`analyst`,name:`Finance analyst`,description:`Reads the daily settlement report.`,how:`observed`,source:`settlement/docs/runbook.md:4`,kind:`person`,external:!1,database:!1,path:`people[0]`},{id:`settlement`,name:`Settlement`,description:`Builds the daily settlement reports.`,kind:`system`,external:!1,database:!1,how:`observed`,source:`settlement/README.md:1`,path:`systems[0]`},{id:`bankfiles`,name:`Bank file drop`,description:`Where the bank leaves its statements.`,kind:`system`,external:!0,database:!1,how:`inferred`,reason:`the batch job reads a folder named for the bank; who writes it is not in the repository`,path:`systems[1]`}],edges:[{from:`analyst`,to:`settlement`,description:`Reads reports from`,how:`observed`,source:`settlement/docs/runbook.md:12`},{from:`settlement`,to:`bankfiles`,description:`Reads statements from`,how:`inferred`,reason:`the batch job opens a statements folder`}]},containers:{key:`containers`,type:`container`,title:`Settlement, containers`,boundary:{id:`settlement`,name:`Settlement`,description:`Builds the daily settlement reports.`,kind:`system`,external:!1,database:!1,how:`observed`,source:`settlement/README.md:1`,path:`systems[0]`},inside:[{id:`batch`,name:`Settlement batch`,description:`Runs nightly and builds the day.`,technology:`.NET`,kind:`container`,external:!1,database:!1,how:`observed`,source:`settlement/Settlement.Batch/Settlement.Batch.csproj:3`,parent:`settlement`,path:`systems[0].containers[0]`},{id:`reports`,name:`Report service`,description:`Serves the finished reports.`,technology:`.NET, ASP.NET Core`,kind:`container`,external:!1,database:!1,how:`observed`,source:`settlement/Settlement.Reports/Settlement.Reports.csproj:3`,parent:`settlement`,path:`systems[0].containers[1]`},{id:`store`,name:`Settlement database`,description:`Settled payments and report runs.`,technology:`SQL Server`,kind:`container`,external:!1,database:!0,how:`observed`,source:`settlement/Settlement.Batch/appsettings.json:6`,parent:`settlement`,path:`systems[0].containers[2]`}],outside:[{id:`analyst`,name:`Finance analyst`,description:`Reads the daily settlement report.`,how:`observed`,source:`settlement/docs/runbook.md:4`,kind:`person`,external:!1,database:!1,path:`people[0]`},{id:`bankfiles`,name:`Bank file drop`,description:`Where the bank leaves its statements.`,kind:`system`,external:!0,database:!1,how:`inferred`,reason:`the batch job reads a folder named for the bank; who writes it is not in the repository`,path:`systems[1]`}],edges:[{from:`analyst`,to:`reports`,description:`Reads reports from`,how:`observed`,source:`settlement/docs/runbook.md:12`},{from:`batch`,to:`bankfiles`,description:`Reads statements from`,how:`inferred`,reason:`the batch job opens a statements folder`},{from:`batch`,to:`store`,description:`Writes settled days to`,technology:`SQL`,how:`observed`,source:`settlement/Settlement.Batch/DayWriter.cs:40`},{from:`reports`,to:`store`,description:`Reads reports from`,technology:`SQL`,how:`observed`,source:`settlement/Settlement.Reports/ReportQuery.cs:22`}]}},"checkout-web":{context:{key:`context`,type:`systemContext`,title:`Checkout in context`,inside:[],outside:[{id:`shopper`,name:`Shopper`,description:`Buys something and pays.`,how:`observed`,source:`payments-web/README.md:5`,kind:`person`,external:!1,database:!1,path:`people[0]`},{id:`checkout`,name:`Checkout`,description:`The checkout page and the SDK behind it.`,kind:`system`,external:!1,database:!1,how:`observed`,source:`payments-web/package.json:2`,path:`systems[0]`},{id:`paymentsapi`,name:`Payments`,description:`Takes the card payment.`,kind:`system`,external:!0,database:!1,how:`observed`,source:`checkout-sdk/src/client.ts:12`,path:`systems[1]`}],edges:[{from:`shopper`,to:`checkout`,description:`Pays on`,how:`observed`,source:`payments-web/README.md:5`},{from:`checkout`,to:`paymentsapi`,description:`Pays through`,technology:`JSON/HTTPS`,how:`observed`,source:`checkout-sdk/src/client.ts:12`}]},containers:{key:`containers`,type:`container`,title:`Checkout, containers`,boundary:{id:`checkout`,name:`Checkout`,description:`The checkout page and the SDK behind it.`,kind:`system`,external:!1,database:!1,how:`observed`,source:`payments-web/package.json:2`,path:`systems[0]`},inside:[{id:`web`,name:`Checkout web`,description:`The page a shopper pays on.`,technology:`React, TypeScript`,kind:`container`,external:!1,database:!1,how:`observed`,source:`payments-web/package.json:14`,parent:`checkout`,path:`systems[0].containers[0]`},{id:`sdk`,name:`Checkout SDK`,description:`Talks to payments for the page.`,technology:`TypeScript`,kind:`container`,external:!1,database:!1,how:`observed`,source:`checkout-sdk/package.json:2`,parent:`checkout`,path:`systems[0].containers[1]`},{id:`session`,name:`Session store`,description:`A shopper’s basket while they pay.`,technology:`Redis`,kind:`container`,external:!1,database:!0,how:`inferred`,reason:`the page server configures a session store; nothing names the engine except its client package`,parent:`checkout`,path:`systems[0].containers[2]`}],outside:[{id:`shopper`,name:`Shopper`,description:`Buys something and pays.`,how:`observed`,source:`payments-web/README.md:5`,kind:`person`,external:!1,database:!1,path:`people[0]`},{id:`paymentsapi`,name:`Payments`,description:`Takes the card payment.`,kind:`system`,external:!0,database:!1,how:`observed`,source:`checkout-sdk/src/client.ts:12`,path:`systems[1]`}],edges:[{from:`shopper`,to:`web`,description:`Pays on`,how:`observed`,source:`payments-web/README.md:5`},{from:`web`,to:`sdk`,description:`Calls`,how:`observed`,source:`payments-web/src/pay.ts:3`},{from:`web`,to:`session`,description:`Keeps the basket in`,how:`inferred`,reason:`the page server reads and writes a session`},{from:`sdk`,to:`paymentsapi`,description:`Pays through`,technology:`JSON/HTTPS`,how:`observed`,source:`checkout-sdk/src/client.ts:12`}]}}},er={title:`Card payments`,people:[{id:`cardholder`,name:`Cardholder`,description:`Pays with a card at a merchant.`,how:`observed`,source:`payments-core/README.md:9`},{id:`support`,name:`Support agent`,description:`Looks up a payment to answer a dispute.`,how:`inferred`,reason:`the API has a lookup route that only an internal role may call`}],systems:[{id:`payments`,name:`Card payments`,description:`Takes a card payment and settles it.`,how:`observed`,source:`payments-core/README.md:1`,containers:[{id:`api`,name:`Payments API`,description:`Accepts and looks up payments.`,technology:`Java, Spring Boot`,how:`observed`,source:`payments-core/pom.xml:14`},{id:`tokeniser`,name:`Tokeniser`,description:`Swaps a card number for a token at the edge.`,technology:`Java`,how:`observed`,source:`payments-core/tokeniser/pom.xml:9`},{id:`worker`,name:`Settlement worker`,description:`Sends authorised payments to the card network.`,technology:`Java`,how:`inferred`,reason:`its main class reads the settlements topic, but no manifest names it as a service`},{id:`db`,name:`Payments database`,description:`Payments and their state.`,technology:`PostgreSQL`,database:!0,how:`observed`,source:`payments-core/src/main/resources/application.yml:22`},{id:`cache`,name:`Token cache`,description:`Recently used tokens.`,technology:`Redis`,how:`inferred`,reason:`a cache client is configured, but nothing here says who runs it`}]},{id:`network`,name:`Card network`,description:`Authorises and clears card payments.`,external:!0,how:`inferred`,reason:`the worker names a scheme client; the network itself is outside this repository`},{id:`ledger`,name:`General ledger`,description:`Where finance books settled payments.`,external:!0}],relationships:[{source:`cardholder`,destination:`api`,description:`Pays through`,technology:`JSON/HTTPS`,how:`observed`,evidence:`payments-core/openapi/payments.yaml:3`},{source:`support`,destination:`api`,description:`Looks up payments in`,how:`inferred`,reason:`the lookup route is documented for support`},{source:`api`,destination:`tokeniser`,description:`Swaps card numbers with`,how:`observed`,evidence:`payments-core/src/main/java/pay/api/CardClient.java:31`},{source:`tokeniser`,destination:`cache`,description:`Keeps recent tokens in`,how:`inferred`,reason:`the tokeniser configures a cache client`},{source:`api`,destination:`db`,description:`Reads and writes`,technology:`JDBC`,how:`observed`,evidence:`payments-core/src/main/resources/application.yml:22`},{source:`worker`,destination:`db`,description:`Reads authorised payments from`,technology:`JDBC`,how:`observed`,evidence:`payments-core/worker/src/main/java/pay/worker/Poller.java:18`},{source:`worker`,destination:`network`,description:`Sends settlements to`,how:`inferred`,reason:`the worker builds scheme messages; the destination is not in the repository`},{source:`worker`,destination:`ledger`,description:`Posts settled totals to`}],views:[{key:`context`,type:`systemContext`,scope:`payments`,title:`Card payments in context`},{key:`containers`,type:`container`,scope:`payments`,title:`Card payments, containers`}]},tr={title:`Settlement`,people:[{id:`analyst`,name:`Finance analyst`,description:`Reads the daily settlement report.`,how:`observed`,source:`settlement/docs/runbook.md:4`}],systems:[{id:`settlement`,name:`Settlement`,description:`Builds the daily settlement reports.`,how:`observed`,source:`settlement/README.md:1`,containers:[{id:`batch`,name:`Settlement batch`,description:`Runs nightly and builds the day.`,technology:`.NET`,how:`observed`,source:`settlement/Settlement.Batch/Settlement.Batch.csproj:3`},{id:`reports`,name:`Report service`,description:`Serves the finished reports.`,technology:`.NET, ASP.NET Core`,how:`observed`,source:`settlement/Settlement.Reports/Settlement.Reports.csproj:3`},{id:`store`,name:`Settlement database`,description:`Settled payments and report runs.`,technology:`SQL Server`,database:!0,how:`observed`,source:`settlement/Settlement.Batch/appsettings.json:6`}]},{id:`bankfiles`,name:`Bank file drop`,description:`Where the bank leaves its statements.`,external:!0,how:`inferred`,reason:`the batch job reads a folder named for the bank; who writes it is not in the repository`}],relationships:[{source:`analyst`,destination:`reports`,description:`Reads reports from`,how:`observed`,evidence:`settlement/docs/runbook.md:12`},{source:`batch`,destination:`bankfiles`,description:`Reads statements from`,how:`inferred`,reason:`the batch job opens a statements folder`},{source:`batch`,destination:`store`,description:`Writes settled days to`,technology:`SQL`,how:`observed`,evidence:`settlement/Settlement.Batch/DayWriter.cs:40`},{source:`reports`,destination:`store`,description:`Reads reports from`,technology:`SQL`,how:`observed`,evidence:`settlement/Settlement.Reports/ReportQuery.cs:22`}],views:[{key:`context`,type:`systemContext`,scope:`settlement`,title:`Settlement in context`},{key:`containers`,type:`container`,scope:`settlement`,title:`Settlement, containers`}]},nr={title:`Checkout web`,people:[{id:`shopper`,name:`Shopper`,description:`Buys something and pays.`,how:`observed`,source:`payments-web/README.md:5`}],systems:[{id:`checkout`,name:`Checkout`,description:`The checkout page and the SDK behind it.`,how:`observed`,source:`payments-web/package.json:2`,containers:[{id:`web`,name:`Checkout web`,description:`The page a shopper pays on.`,technology:`React, TypeScript`,how:`observed`,source:`payments-web/package.json:14`},{id:`sdk`,name:`Checkout SDK`,description:`Talks to payments for the page.`,technology:`TypeScript`,how:`observed`,source:`checkout-sdk/package.json:2`},{id:`session`,name:`Session store`,description:`A shopper’s basket while they pay.`,technology:`Redis`,database:!0,how:`inferred`,reason:`the page server configures a session store; nothing names the engine except its client package`}]},{id:`paymentsapi`,name:`Payments`,description:`Takes the card payment.`,external:!0,how:`observed`,source:`checkout-sdk/src/client.ts:12`}],relationships:[{source:`shopper`,destination:`web`,description:`Pays on`,how:`observed`,evidence:`payments-web/README.md:5`},{source:`web`,destination:`sdk`,description:`Calls`,how:`observed`,evidence:`payments-web/src/pay.ts:3`},{source:`web`,destination:`session`,description:`Keeps the basket in`,how:`inferred`,reason:`the page server reads and writes a session`},{source:`sdk`,destination:`paymentsapi`,description:`Pays through`,technology:`JSON/HTTPS`,how:`observed`,evidence:`checkout-sdk/src/client.ts:12`}],views:[{key:`context`,type:`systemContext`,scope:`checkout`,title:`Checkout in context`},{key:`containers`,type:`container`,scope:`checkout`,title:`Checkout, containers`}]},rr=`2026-10-13T08:00:00.000Z`,ir={"card-payments":{revision:2,savedAt:rr,model:er,notMapped:[`dist/`,`node_modules/`,`payments-core/vendor/`]},settlement:{revision:1,savedAt:rr,model:tr,notMapped:[`bin/`,`obj/`]},"checkout-web":{revision:1,savedAt:rr,model:nr,notMapped:[`dist/`,`node_modules/`]}},ar=e=>`/home/you/.toil/diagrams/${e}.json`;function or(e){let t=[...e.people,...e.systems,...e.systems.flatMap(e=>e.containers??[])],n=[...t,...e.relationships],r=e=>n.filter(t=>t.how===e).length;return{elements:t.length,relationships:e.relationships.length,observed:r(`observed`),inferred:r(`inferred`),unmarked:r(void 0)}}function sr(e,t){let n=ir[e],r=t===void 0?void 0:$n[e]?.[t];return{toilProject:e,revision:n.revision,savedAt:n.savedAt,toilVersion:`0.1.0-beta.5`,file:ar(e),model:n.model,notMapped:n.notMapped,views:n.model.views.map(e=>({key:e.key,type:e.type,title:e.title})),counts:or(n.model),...r?{view:r}:{}}}var M=e=>`[[corp-jira:PAY-${e}]]`,N=e=>`[[corp-ado:${e}]]`,P=e=>`[[github:imagile/payments-web#${e}]]`,cr=e=>`[[${e}]]`,lr=e=>cr(`corp-bitbucket:PAY/payments-core#${e}`),ur=e=>cr(`corp-ado:Payments/settlement#${e}`),dr=e=>cr(`github:imagile/payments-web#${e}`),fr=e=>cr(`bitbucket-cloud:imagile/checkout-sdk#${e}`),pr=()=>{let e=globalThis.document;return e?e.documentElement?.dataset?.words!==`standard`:!1},mr=e=>({id:`agent:${e.item}:${e.command??`none`}`,from:`agent`,...e}),hr={"card-payments":{risk:{label:`What's at risk in this Toil project?`,parts:[`It is day 7 of 10 of Sprint 42: 3 of 21 points are done and 18 remain.`,`${M(101)}'s pull request #311 fails its Jenkins build, and ${M(102)} and ${M(103)} are blocked behind it, holding 11 points back.`,`${M(104)} came over from Sprint 41 and its pull request #305 is still open. ${M(107)} was added after the sprint started, with no estimate.`],proposals:[mr({item:`corp-jira:PAY-107`,title:`Estimate PAY-107 at 3 points`,reason:`${M(107)} was added mid-sprint with no estimate, so the sprint's points leave it out. It is a retry of one call, about the size of ${M(105)}.`,command:`jira issue update`,input:{toilProject:`card-payments`,key:`PAY-107`,field:[`Story Points=3`]},note:`A suggested size. Agree it with the team before applying.`})]},attention:{label:`What needs attention first?`,parts:[`${M(102)} is blocked by ${M(101)} and holds up ${M(103)}, and nothing has changed on it for 8 days.`,`${M(104)} has been in progress for 13.9 days, longer than 85% of this Toil project's finished items took (11 days). It came over from Sprint 41 and hasn't been updated for 5.9 days.`,`${M(101)}'s latest build failed, and it blocks ${M(102)}: fixing that build unblocks the chain.`]},deployed:{label:`Where is this work deployed?`,parts:[`The dev environment runs payments-core 1.14.0 (4e1d2a9), which includes ${M(105)} (pull request #298) and ${M(106)} (#296).`,`The prod environment runs 1.13.2 (1a2b3c4), merged before the sprint, so none of Sprint 42's work is in prod yet.`,`${M(101)} and ${M(104)} have pull requests still open, so neither is deployed anywhere.`]},people:{label:`Who's overloaded or blocked?`,parts:[`Nobody is over the Toil project's limit of 2 items in progress. J. Smith has ${M(101)} in progress for 6.9 days, and A. Chen has ${M(104)} in review for 5.9 days.`,`A. Chen is blocked: ${M(102)} waits on ${M(101)}, still in progress with J. Smith, whose pull request ${lr(311)} now waits on J. Smith after A. Chen asked for changes.`,`One review waits on J. Smith: ${lr(305)}, open 3.9 working days. A. Chen's Bitbucket account isn't mapped to her yet; the People view suggests it.`]},review:{label:`What's stuck in review, and why?`,parts:[`${lr(305)} has waited 3.9 working days for a first review from J. Smith, and it now has a merge conflict. It carries ${M(104)}, which came over from Sprint 41.`,`${lr(311)} waits on its author: A. Chen asked for changes 0.6 working days ago, and its Jenkins build fails. It carries ${M(101)}, which blocks ${M(102)}.`,`A first review here usually comes within 0.3 working days (the median of 4 pull requests), so 305 is well past it.`]}},settlement:{risk:{label:`What's at risk in this Toil project?`,parts:[`It is day 7 of 9 of Sprint 42: 1 of 16 points is done and 15 remain. The points leave out ${N(2305)}, which is estimated in hours.`,`${N(2303)} can't start until ${N(2302)} is done, and 2302's pull request #87 is still building.`,`${N(2304)} came over from Sprint 41 with nothing linked to it. ${N(2305)} and ${N(2306)} were added after the sprint started.`,`${N(2307)} was removed from the backlog, which OWI counts as done.`],proposals:[mr({item:`corp-ado:2303`,title:`Move 2303 to Sprint 43`,reason:`${N(2303)} can't start until ${N(2302)} is done, with two working days left in the sprint.`,command:`ado work-item update`,input:{toilProject:`settlement`,id:2303,field:[`System.IterationPath=Payments\\Sprint 43`]},note:null})]},attention:{label:`What needs attention first?`,parts:[`${N(2304)} has been in progress for 15 days, longer than 85% of this Toil project's finished items took (8.3 days). It came over from Sprint 41 and hasn't been updated for 5.9 days.`,`${N(2303)} is blocked by ${N(2302)}, and nothing has changed on it for 7.9 days.`,`${N(2302)} blocks ${N(2303)} and hasn't been updated for 7 days.`]},deployed:{label:`Where is this work deployed?`,parts:[`The test environment runs settlement-deploy 20261008.1 (c84e5f0), which includes ${N(2305)} through pull request #84.`,`The prod environment runs 20261002.1 (b80a1d2), the job skeleton from before the sprint, so none of Sprint 42's work is in prod yet.`,`${N(2302)}'s pull request #87 is open and its CI run is still in progress.`]},people:{label:`Who's overloaded or blocked?`,parts:[`This Toil project sets no limit and lists nobody yet, so each account stands on its own. D. Okafor has ${N(2302)} in progress for 7 days, and M. Lind has ${N(2304)} for 15 days.`,`D. Okafor's pull request ${ur(87)} waits on D. Okafor: J. Park asked for changes 0.8 working days ago.`,`Nobody's own items are blocked. ${N(2303)} is blocked by ${N(2302)}, but nobody is assigned to it.`]},review:{label:`What's stuck in review, and why?`,parts:[`${ur(87)} waits on its author: J. Park voted -5 (waiting for the author) 0.8 working days ago, and its CI run is still going. It carries ${N(2302)}, which ${N(2303)} waits on.`,`Nothing else is open. A first review here has taken 0.8 working days at the median, over 3 pull requests.`]}},"checkout-web":{risk:{label:`What's at risk in this Toil project?`,parts:[`It is day 7 of 10 of Sprint 42: 1 of 11 points is done and 10 remain.`,`${P(43)} was added after the sprint started, and its draft pull request #53 fails the e2e-safari check.`,`${P(45)} was added on day one and has no estimate.`],proposals:[mr({item:`github:imagile/payments-web#45`,title:`Estimate payments-web#45`,reason:`${P(45)} has no Estimate on project 7, so the sprint's points leave it out.`,command:null,input:null,note:`toil has no command that sets a GitHub Projects field yet. Set Estimate on the project board: https://ghe.imagile.dev/imagile/payments-web/issues/45.`})]},attention:{label:`What needs attention first?`,parts:[`${P(43)}'s latest build failed on e2e-safari, it was added after the sprint started, and nothing has changed on it for 6 days.`,`${P(45)} has no estimate and hasn't been updated for 7.9 days.`,`${P(42)}'s pull request is merged, but no environment runs it yet.`]},deployed:{label:`Where is this work deployed?`,parts:[`The staging environment runs payments-web 2026.10.12 (5a7e3f1), which includes ${P(44)}'s fix, pull request #50.`,`The prod environment runs 2026.10.02 (1c9b8e4), so ${P(44)} isn't in prod yet.`,`${P(42)} and ${P(43)} have pull requests still open, so neither is deployed anywhere. ${P(44)}'s SDK change, imagile/checkout-sdk #12, is still open too.`]},people:{label:`Who's overloaded or blocked?`,parts:[`Nobody is over the Toil project's limit of 2. Bo W. has ${P(42)} in review; GitHub records no move into that status, so how long it has sat there is unknown.`,`Two reviews wait on Ada D.: ${fr(12)} and ${dr(52)}, each open 1.3 working days.`,`${dr(51)}, which Ada D. wrote with Claude, waits on its failing checks, for 2 working days. Nothing assigned to anyone is blocked.`]},review:{label:`What's stuck in review, and why?`,parts:[`${dr(51)} has its failing test check to fix first, failing for 2 working days. It has been open 3 working days with no reviewer asked and names no work item. An agent wrote it: its commit carries a Co-Authored-By: Claude trailer.`,`${fr(12)} waits 1.3 working days for review from Ada D., but ${P(44)}, the issue it is for, is already closed. An agent wrote it too (a copilot/ branch).`,`${dr(52)} waits 1.3 working days for review from ada-dev. It carries ${P(42)}.`,`${dr(53)} is a draft, failing e2e-safari, for ${P(43)}.`]}}},gr={"card-payments":{crate:[`Day 7 of 10 on Sprint 42. 3 of 21 points are on the truck, 18 still on the floor.`,`${M(101)} is the pallet in the aisle: its pull request #311 fails the Jenkins build, and ${M(102)} and ${M(103)} wait behind it. That is 11 points not moving.`,`${M(104)} came over from Sprint 41, and its pull request #305 is still open at the dock. ${M(107)} turned up after the sprint started, with no estimate on the label.`],harvest:[`We're on day 7 of 10 of Sprint 42. 3 of 21 points are in the barn, and 18 are still in the ground.`,`${M(101)}'s pull request #311 keeps failing its Jenkins build, and ${M(102)} and ${M(103)} can't grow until it's mended. That's 11 points waiting on one fence.`,`${M(104)} was carried over from Sprint 41, and its pull request #305 is still open. ${M(107)} was planted after the sprint started, with no estimate yet.`],starship:[`Ship's log, day 7 of 10 of Sprint 42. 3 of 21 points complete; 18 remain.`,`Fault: ${M(101)}'s pull request #311 fails its Jenkins build. ${M(102)} and ${M(103)} are held behind it, 11 points in all.`,`${M(104)} transferred from Sprint 41 with pull request #305 still open. ${M(107)} came aboard after the sprint started, with no estimate logged.`],realm:[`Candles gutter on day 7 of 10 of Sprint 42. 3 of 21 points are won as experience; 18 still stand as the sprint's hit points.`,`${M(101)}'s pull request #311 fails its Jenkins build: a critical fail on the saving throw. The road is broken there, and ${M(102)} and ${M(103)} wait behind it, 11 points held.`,`${M(104)} was carried from Sprint 41, its pull request #305 still open. ${M(107)} entered the ledger after the sprint began, with no estimate rolled.`],sprawl:[`Day 7 of 10 on the run, Sprint 42. 3 of 21 points are clean, 18 still live.`,`${M(101)} hit black ICE: its pull request #311 fails the Jenkins build, and ${M(102)} and ${M(103)} are stuck behind it. 11 points going nowhere.`,`${M(104)} rolled over from Sprint 41, its pull request #305 still open, waiting on the fixer. ${M(107)} showed up after the sprint started, no estimate on it.`],frontier:[`Day 7 of 10 on the drive for Sprint 42. 3 of 21 points are in the pen; 18 are still out on the range.`,`${M(101)} is the busted axle: its pull request #311 keeps failing the Jenkins boiler test, and ${M(102)} and ${M(103)} sit behind it. That's 11 points going nowhere.`,`${M(104)} rode over from Sprint 41, and its telegram, pull request #305, is still waiting on a signature. ${M(107)} joined after the drive set out, with no estimate on it.`],overworld:[`Day 7 of 10 of the journey, Sprint 42. 3 of 21 points are carried home; 18 still lie along the road.`,`A locked door: ${M(101)}'s pull request #311 fails its Jenkins build, its dungeon trial. ${M(102)} and ${M(103)} wait behind that door, 11 points in all. Its key is in that build.`,`${M(104)} was carried over from Sprint 41, and its pull request #305 still waits at the shop. ${M(107)} joined the journey after it began, with no estimate yet.`]},settlement:{crate:[`Day 7 of 9 on Sprint 42. 1 of 16 points is shipped, 15 still on the floor. ${N(2305)} isn't in that count: it's weighed in hours, not points.`,`${N(2303)} can't move until ${N(2302)} clears, and 2302's pull request #87 is still on the forklift check.`,`${N(2304)} came over from Sprint 41 with nothing strapped to it. ${N(2305)} and ${N(2306)} arrived after the sprint started.`,`${N(2307)} was taken off the backlog, which OWI books as done.`],harvest:[`Day 7 of 9 of Sprint 42: 1 of 16 points is harvested and 15 are still growing. ${N(2305)} isn't counted in those points; it's measured in hours.`,`${N(2303)} can't be planted until ${N(2302)} is done, and 2302's pull request #87 is still building.`,`${N(2304)} came over from Sprint 41 with nothing linked to it. ${N(2305)} and ${N(2306)} were sown after the sprint started.`,`${N(2307)} was cleared from the backlog, which OWI counts as done.`],starship:[`Ship's log, day 7 of 9 of Sprint 42. 1 of 16 points complete; 15 remain. ${N(2305)} is excluded from the count: it is estimated in hours.`,`${N(2303)} cannot launch until ${N(2302)} is done. 2302's pull request #87 is still building.`,`${N(2304)} transferred from Sprint 41 with no links. ${N(2305)} and ${N(2306)} came aboard after the sprint started.`,`${N(2307)} was removed from the backlog, which OWI logs as done.`],realm:[`The dice fall on day 7 of 9 of Sprint 42. 1 of 16 points is won; 15 remain as hit points. ${N(2305)} is not reckoned in points: it is measured in hours.`,`${N(2303)} cannot march until ${N(2302)} is done, and 2302's pull request #87 is still rolling its saving throw.`,`${N(2304)} was carried from Sprint 41, bound to nothing. ${N(2305)} and ${N(2306)} joined the quest after the sprint began.`,`${N(2307)} was struck from the backlog, which OWI counts as done.`],sprawl:[`Day 7 of 9 on the run, Sprint 42. 1 of 16 points is clean, 15 still live. ${N(2305)} isn't in that count: it's sized in hours, not points.`,`${N(2303)} can't move until ${N(2302)} is done, and 2302's pull request #87 is still in its ICE check.`,`${N(2304)} rolled over from Sprint 41 with nothing linked to it. ${N(2305)} and ${N(2306)} showed up after the sprint started.`,`${N(2307)} got pulled off the backlog, which OWI logs as done.`],frontier:[`Day 7 of 9 on the drive for Sprint 42. 1 of 16 points is in the pen; 15 are still out. ${N(2305)} isn't in that count: it's tallied in hours, not points.`,`${N(2303)} can't move till ${N(2302)} is done, and 2302's pull request #87 is still in its boiler test.`,`${N(2304)} rode over from Sprint 41 with nothing hitched to it. ${N(2305)} and ${N(2306)} joined after the drive set out.`,`${N(2307)} was struck off the backlog, which OWI books as done.`],overworld:[`Day 7 of 9 of the journey, Sprint 42. 1 of 16 points is carried home; 15 remain. ${N(2305)} is not counted in points: it is measured in hours.`,`${N(2303)} waits at a locked door; its key is ${N(2302)}, and 2302's pull request #87 is still in its dungeon trial.`,`${N(2304)} came over from Sprint 41 with nothing linked to it. ${N(2305)} and ${N(2306)} joined the journey after it began.`,`${N(2307)} was taken off the backlog, which OWI counts as done.`]},"checkout-web":{crate:[`Day 7 of 10 on Sprint 42. 1 of 11 points is shipped, 10 still on the floor.`,`${P(43)} turned up after the sprint started, and its draft pull request #53 fails the e2e-safari check.`,`${P(45)} has been on the floor since day one with no estimate on the label.`],harvest:[`Day 7 of 10 of Sprint 42: 1 of 11 points is harvested and 10 are still growing.`,`${P(43)} was sown after the sprint started, and its draft pull request #53 fails the e2e-safari check.`,`${P(45)} was planted on day one and still has no estimate.`],starship:[`Ship's log, day 7 of 10 of Sprint 42. 1 of 11 points complete; 10 remain.`,`${P(43)} came aboard after the sprint started; its draft pull request #53 fails the e2e-safari check.`,`${P(45)} has been aboard since day one with no estimate logged.`],realm:[`The torches burn low on day 7 of 10 of Sprint 42. 1 of 11 points is won; 10 remain as hit points.`,`${P(43)} joined the quest after the sprint began, and its draft pull request #53 fails the e2e-safari check: a critical fail.`,`${P(45)} was taken up on day one. No one has yet rolled its estimate.`],sprawl:[`Day 7 of 10 on the run, Sprint 42. 1 of 11 points is clean, 10 still live.`,`${P(43)} showed up after the sprint started, and its draft pull request #53 fails the e2e-safari check.`,`${P(45)} has been live since day one with no estimate on it.`],frontier:[`Day 7 of 10 on the drive for Sprint 42. 1 of 11 points is in the pen; 10 are still out on the range.`,`${P(43)} joined after the drive set out, and its draft telegram, pull request #53, fails the e2e-safari check.`,`${P(45)} has been out on the trail since day one with no estimate on it.`],overworld:[`Day 7 of 10 of the journey, Sprint 42. 1 of 11 points is carried home; 10 remain.`,`${P(43)} joined the journey after it began, and its draft pull request #53 fails the e2e-safari check.`,`${P(45)} has been on the road since day one, and still has no estimate.`]}},_r={chosen:`scripted`,options:[{name:`scripted`,label:rt,model:null,ready:!0,problem:null,fix:null,action:null},...[`Claude`,`GitHub Copilot`,`Codex`].map(e=>({name:e===`Claude`?`claude`:e===`Codex`?`codex`:`copilot`,label:e,model:null,ready:!1,problem:`The sample answers with ${rt}, so ${e} isn't offered here.`,fix:`Start toil-ui without --sample to switch between the agents installed on this machine.`,action:null}))]},vr={"Are we going to finish the sprint?":`risk`,"What's blocking us?":`attention`,"What's stuck in review?":`review`,"Who might need help?":`people`,"Summarise this for my boss":`risk`},yr=`This preview answers only its starter questions. Installed, Toil UI sends your question to the agent you pick.`,br=/^write up the stand-up for /i,xr=[`This is the preview's scripted write-up, not a model's: it shows where the agent's short narrative of the report goes. The team lines come first (F1).`,`Then each person's done, in progress, blocked and next, in the report's order, each sentence naming the fact lines it rests on (F2).`],Sr=(e,t)=>new Promise(n=>{if(e<=0||t?.aborted)return n();let r=setTimeout(n,e);t?.addEventListener(`abort`,()=>(clearTimeout(r),n()),{once:!0})}),Cr=e=>e.match(/\[\[[^\]]+\]\]\S*\s*|\S+\s*/g)??[],wr=[`risk`,`attention`,`people`,`review`],Tr=e=>e.slice(2,-2),Er={"card-payments":{recommendation:`Fix ${M(101)}'s failing checks first: ${M(102)} and ${M(103)} wait behind it, 11 of the 18 points left, and the sprint ends in 3 days.`,reasons:[{lens:`failing`,label:`Failing checks`,line:`holds up 2 items, 11 points`,items:[[M(101),`Its pull request ${lr(311)} fails the tokeniser's tests, and ${M(102)} and ${M(103)} wait behind it.`,`Fix the failing test in the tokeniser before anything else in the chain.`]]},{lens:`blocked`,label:`Blocked`,line:`2 items, 11 points, both behind PAY-101`,items:[[M(102),`Blocked by ${M(101)} and unchanged for 8 days.`,`Nothing to do until ${M(101)}'s checks pass; its assignee can review ${lr(305)} meanwhile.`],[M(103),`Second in the chain behind ${M(102)}, 8 points, and nobody owns it.`,`Give it an owner now, so it starts the day the chain clears.`]]},{lens:`waiting`,label:`Waiting on review`,line:`1 pull request past 2 working days`,items:[[M(104),`Its pull request ${lr(305)} has waited 3.9 working days for a first review, and it came over from Sprint 41.`,`Ask for a first review of ${lr(305)} today.`]]}],onTrack:``,changed:[]},settlement:{recommendation:`Get ${N(2302)} done first: ${N(2303)} can't start until it is, and its pull request ${ur(87)} is still building.`,reasons:[{lens:`blocked`,label:`Blocked`,line:`1 item, 3 points`,items:[[N(2303),`Blocked by ${N(2302)}, and nothing has changed on it for 7.9 days.`,`Finish ${N(2302)} first; ${ur(87)} needs its build to pass.`]]},{lens:`stale`,label:`Stale`,line:`1 item past 5 days`,items:[[N(2304),`In progress for 15 days, longer than 85% of the finished items here took, and carried over from Sprint 41.`,`Ask whether it should be split or moved out of the sprint.`]]}],onTrack:``,changed:[]},"checkout-web":{recommendation:`Fix ${dr(51)}'s failing checks first: it has waited on them for 2 working days, with no reviewer asked.`,reasons:[{lens:`failing`,label:`Failing checks`,line:`1 item`,items:[[P(43),`Its latest build failed on e2e-safari, and nothing has changed on it for 6 days.`,`Rerun e2e-safari, then fix or quarantine the failing spec.`]]},{lens:`waiting`,label:`Waiting on review`,line:`2 pull requests, 1.3 working days each`,items:[[P(42),`${dr(52)} and ${fr(12)} each wait 1.3 working days for a review.`,`Ask Ada D. for the two reviews together.`]]}],onTrack:``,changed:[]}};function Dr(e){let t=hr[e]??(e===`sample-team`?Yn():{}),n=Er[e],r=wr.flatMap(e=>t[e]?.parts??[]);if(e===`sample-team`)return[`\`\`\`briefing\n${JSON.stringify(Qn())}\n\`\`\``,...r];if(!n)return r;let i={recommendation:n.recommendation,reasons:n.reasons.map(e=>({lens:e.lens,label:e.label,line:e.line,text:e.text??null,items:e.items.map(([e,t,n])=>({id:Tr(e),why:t,next:n}))})),onTrack:n.onTrack,changed:n.changed,leftOut:[]};return[`\`\`\`briefing\n${JSON.stringify(i)}\n\`\`\``,...r]}function Or(e,t){let n=et(e);if(!n)return null;let{id:r,target:i}=n,a=/^github:([^/]+)\/([^#]+)#(\d+)$/.exec(i),o=t?ir[t]:void 0,s={review:[`Review of ${cr(i)}, as the scripted preview would read it: its description and reviewers (pr_get), the files it changes and its diff (pr_files, pr_diff), then its checks. A real agent reads each of those and cites the command behind every finding.`,`Nothing was checked here: the preview reads no tools, so every check below is unchecked, not passed. Findings would be drafted as inline comments, each a proposal you press.`],ship:[`Round 1 of 3 on ${cr(i)}, as the scripted preview would answer it: read the review threads and the failing check, draft a reply to each thread, and list what only your terminal can do (edit, run the gate, push).`,`Nothing was read here, so nothing below is checked. After round 3 the loop stops and the pull request is marked needs-human.`],classify:[`Sorting ${i||`the Toil project`}'s work into categories, as the scripted preview would: the scheme's rules settle what they can (a label, a type, the parent), and the AI agent is asked only about the items left unsure.`,`Nothing was read here, so no category below is checked. Each label is drafted as a change you approve, one at a time; Toil UI applies none of them.`],"map-codebase":[`Architecture of ${i||`the Toil project`}, as the scripted preview would answer it: containers from the Toil project's repositories, each marked observed (read from a file or a command) or inferred (with the reason), and what was left out on purpose.`,o?`It shows ${Fe(or(o.model))}. Nothing was read here: this is the sample's own diagram. A real agent builds its model from its tools and checks it with projects_diagram_check, and the Save below keeps that model, exactly as checked.`:`Nothing was read here, so there is no sample diagram for this Toil project to offer.`,`Three questions for you: which inferred box or arrow would you check first? Is anything missing from the picture? Which part should be drawn in more detail next?`]}[r].map(e=>({text:e})),c=r===`review`&&a?[{id:`job-review-${i}`,from:`agent`,item:i,title:`Comment on ${a[2]}#${a[3]}`,reason:`The review's summary, for the author to read. ${cr(i)}`,command:`github pr comment`,input:{owner:a[1],repo:a[2],number:a[3],body:`Reviewed in Toil UI (scripted preview): no findings, nothing was checked.`},note:`Preview only: a real review drafts findings from the diff.`}]:[],l=r===`map-codebase`?o?{text:JSON.stringify(o.model),notMapped:o.notMapped,title:o.model.title,views:sr(t).views,counts:or(o.model)}:null:void 0;return{prompt:Je(r,i),parts:s,citations:ot(s),by:`scripted`,adapter:`scripted`,model:null,proposals:c,...r===`ship`?{warnings:[`Round 1 of 3. After round 3 it stops and the pull request is for a person.`]}:{},...l===void 0?{}:{diagram:l}}}function kr(e){let t=e.message.toLowerCase(),n=/scope/.test(t)?`For read-only use, a token that can read your repositories and issues is enough. toil lists exactly what each tool needs on the Settings page, and the tool's own page for making a token can pre-fill it.`:/site name|address/.test(t)?`It is the first part of the web address you see when you open the tool in a browser, for example the part before .atlassian.net for Jira Cloud. Paste the whole address, with https://, into the Address box.`:/cloud|data center/.test(t)?`Cloud means the vendor hosts it and you reach it at their domain. Data Center means your organization runs it, at an address of its own. If the address ends in a vendor domain, it is Cloud.`:/toil project/.test(t)?`A Toil project is one body of work, such as a product or a team's backlog: the tools it reads from and the repositories it covers. It is a small file in your home folder, and it holds no login.`:`This is a scripted preview of the guide, so it can only answer the starter questions. With an AI agent set up, it reads toil's own documentation to answer yours.`,r=/toil project/.test(t)?[{id:`guide:projects init:0`,from:`agent`,item:`setup`,title:`Make a Toil project called payments`,reason:`You have no Toil project yet, and this one is empty until you link your tools to it.`,command:`projects init`,input:{name:`payments`},note:null}]:[];return{prompt:e.message,parts:[{text:n}],citations:[],by:`scripted`,adapter:`scripted`,model:null,proposals:r}}function Ar({delay:e=0}={}){let t=(e,t,n,r,i)=>{let a=Or(t,e);if(a)return a;if(i?.context&&t!==`analyze`){let n=Zn(i.context).map(e=>({text:pr()?ct(e):e}));return{prompt:t,parts:n,citations:ot(n),by:`scripted`,adapter:`scripted`,model:null,proposals:[],...r?{usage:_t(r.id,r.turn,e)}:{}}}let o=hr[e]??(e===`sample-team`?Yn():{});if(t===`analyze`&&(hr[e]||e===`sample-team`)){let t=Dr(e).map(e=>({text:e}));return{prompt:`Analyze`,parts:t,citations:ot(t),by:`scripted`,adapter:`scripted`,model:null,proposals:o.risk?.proposals??[],...r?{usage:_t(r.id,r.turn,e)}:{}}}let s=vr[t],c=o[t]?t:s&&o[s]?s:Object.entries(o).find(([,e])=>e.label===t)?.[0],l=c?o[c]:void 0,u=c===`risk`&&n?.voice?gr[e]?.[n.theme]:void 0,d=(u??l?.parts??(br.test(t)?xr:[yr])).map(e=>({text:pr()&&!u?ct(e):e}));return{prompt:s&&l?t:l?.label??t,parts:d,citations:ot(d),by:`scripted`,adapter:`scripted`,model:null,proposals:l?.proposals??[],...r?{usage:_t(r.id,r.turn,e)}:{}}};return{label:rt,adapters:async()=>_r,starters:e=>e===`sample-team`?[...Xn]:Object.entries(hr[e]??{}).map(([e,t])=>({id:e,label:t.label})),ask:async(e,n,r,i,a)=>t(e,n,r,i,a),async*guide(t,n,r){if(Ke(t.message))throw Error(Ae);let i=kr(t),a=``;for(let t of Cr(i.parts[0].text)){if(r?.aborted)return;a+=t,yield{...i,parts:[{text:a}],proposals:[],activity:{phase:`writing`}},await Sr(e,r)}yield i},async*stream(n,r,i,a,o,s){let{usage:c,...l}=t(n,r,a,o,s),u=[];for(let t of l.parts){let n=``;u.push({text:n});for(let r of Cr(t.text)){if(i?.aborted)return;n+=r,u[u.length-1]={text:n},yield{...l,parts:[...u],citations:ot(u),proposals:[],activity:{phase:`writing`}},await Sr(e,i)}}yield c?{...l,usage:c}:l}}}var jr=`0.1.0-alpha.1`,F=e=>e.padEnd(40,`0`),Mr=e=>Date.parse(e),Nr=(e,t,n,r,i)=>({ok:!0,data:t,error:null,meta:{command:e,durationMs:233,version:jr,context:{connection:{value:n,source:`toil-project`,...i===void 0?{}:{deployment:i}},inputs:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{value:t,source:`toil-project`}]))}}}),Pr=(e,t)=>t?`${e}\n\n${t}`:e,Fr=`Co-Authored-By: Claude <you@example.com>`,Ir=`https://bitbucket.imagile.dev`,Lr=(e,t,n=`NORMAL`)=>({name:e,id:e.length*101,displayName:t,active:!0,slug:e,type:n,...n===`NORMAL`?{emailAddress:`you@example.com`}:{}}),Rr={slug:`payments-core`,name:`payments-core`,project:{key:`PAY`,name:`Payments`}},zr=Lr(`jsmith`,`J. Smith`),I=Lr(`achen`,`A. Chen`),Br=Lr(`svc-renovate`,`Renovate`,`SERVICE`),Vr=e=>({id:e.id,version:2,title:e.title,...e.description?{description:e.description}:{},state:e.state,open:e.state===`OPEN`,closed:e.state!==`OPEN`,draft:!1,createdDate:Mr(e.created),updatedDate:Mr(e.updated??e.closed??e.created),...e.closed?{closedDate:Mr(e.closed)}:{},fromRef:{id:`refs/heads/${e.branch}`,displayId:e.branch,latestCommit:F(e.head),repository:Rr},toRef:{id:`refs/heads/master`,displayId:`master`,latestCommit:F(`f00d000`),repository:Rr},locked:!1,author:{user:e.author,role:`AUTHOR`,approved:!1,status:`UNAPPROVED`},reviewers:(e.reviewers??[]).map(e=>({user:e.user,role:`REVIEWER`,approved:e.status===`APPROVED`,status:e.status})),participants:[],properties:{...e.state===`OPEN`?{mergeResult:{outcome:e.outcome??`CLEAN`,current:!0}}:{},...e.merge?{mergeCommit:{displayId:e.merge,id:F(e.merge)}}:{},commentCount:0},links:{self:[{href:`${Ir}/projects/PAY/repos/payments-core/pull-requests/${e.id}`}]}}),Hr=e=>({...Vr(e),included:{reviews:(e.activities??[]).map((t,n)=>({id:e.id*100+n,createdDate:Mr(t.at),user:t.user,action:t.action})),checks:(e.builds??[]).map((t,n)=>({state:t.state,key:`payments-core-PR-${e.id}`,name:`payments-core » PR-${e.id} #${n+1}`,url:`https://jenkins.imagile.dev/job/payments-core/job/PR-${e.id}/${n+1}/`,dateAdded:Mr(t.at)})),commits:(e.commits??[e.title]).map((t,n)=>({id:F(`${e.head.slice(0,5)}${n}`),displayId:`${e.head.slice(0,5)}${n}`,message:t,author:{name:e.author.displayName,emailAddress:`you@example.com`},authorTimestamp:Mr(e.created)})),files:Array.from({length:e.files??1},(t,n)=>({contentId:F(`c${e.id}${n}`),path:{toString:`src/main/java/payments/File${n}.java`},type:`MODIFY`}))}}),Ur=[{id:311,title:`PAY-101 Tokenise PANs in the edge proxy`,description:`First slice of Card payments v2 (PAY-100).`,state:`OPEN`,author:zr,branch:`feature/PAY-101-tokenise`,head:`e91a4c2`,created:`2026-10-12T15:30:00.000Z`,updated:`2026-10-12T17:00:00.000Z`,reviewers:[{user:I,status:`NEEDS_WORK`}],activities:[{user:I,action:`REVIEWED`,at:`2026-10-12T17:00:00.000Z`}],builds:[{state:`FAILED`,at:`2026-10-12T15:35:00.000Z`},{state:`FAILED`,at:`2026-10-12T16:05:00.000Z`}],files:6},{id:305,title:`PAY-104 Round refund totals half-up`,state:`OPEN`,author:I,branch:`bugfix/PAY-104-rounding`,head:`3c5d7e1`,created:`2026-10-07T10:15:00.000Z`,reviewers:[{user:zr,status:`UNAPPROVED`}],outcome:`CONFLICTED`,builds:[{state:`SUCCESSFUL`,at:`2026-10-07T10:40:00.000Z`}],files:2},{id:298,title:`PAY-105 Show the last four digits on receipts`,state:`MERGED`,author:zr,branch:`feature/PAY-105-last-four`,head:`8a6b2f0`,created:`2026-10-08T09:00:00.000Z`,closed:`2026-10-09T14:50:00.000Z`,merge:`4e1d2a9`,reviewers:[{user:I,status:`APPROVED`}],activities:[{user:I,action:`REVIEWED`,at:`2026-10-08T16:00:00.000Z`},{user:I,action:`APPROVED`,at:`2026-10-09T11:00:00.000Z`}],builds:[{state:`SUCCESSFUL`,at:`2026-10-09T14:20:00.000Z`}],files:4},{id:296,title:`PAY-106 Register the tokeniser with the gateway`,state:`MERGED`,author:zr,branch:`feature/PAY-106-gateway`,head:`2d9e8b4`,created:`2026-10-06T13:00:00.000Z`,closed:`2026-10-07T11:40:00.000Z`,merge:`7b3c9d2`,reviewers:[{user:I,status:`APPROVED`}],activities:[{user:I,action:`APPROVED`,at:`2026-10-07T09:30:00.000Z`}],builds:[{state:`SUCCESSFUL`,at:`2026-10-07T11:10:00.000Z`}],files:3},{id:290,title:`Bump the HTTP client to 5.3`,state:`MERGED`,author:Br,branch:`renovate/http-client-5.x`,head:`0f4e6a3`,created:`2026-09-29T09:00:00.000Z`,closed:`2026-09-30T10:00:00.000Z`,merge:`1a2b3c4`,reviewers:[{user:I,status:`APPROVED`}],activities:[{user:I,action:`APPROVED`,at:`2026-09-30T09:15:00.000Z`}],builds:[{state:`SUCCESSFUL`,at:`2026-09-30T09:30:00.000Z`}],files:1}],Wr=Ur.map(Vr),Gr=Object.fromEntries(Ur.map(e=>[e.id,Hr(e)])),Kr=`https://ado.imagile.dev/DefaultCollection`,qr=(e,t)=>({displayName:t,uniqueName:`IMAGILE\\${e}`,id:`abc12345-0000-0000-0000-0000000000${e.length}0`,descriptor:`win.${e}`}),Jr=qr(`dokafor`,`D. Okafor`),Yr=qr(`jpark`,`J. Park`),Xr={id:`abc12345-0000-0000-0000-000000000500`,name:`settlement`,url:`${Kr}/Payments/_apis/git/repositories/settlement`,webUrl:`${Kr}/Payments/_git/settlement`,project:{name:`Payments`}},Zr=e=>({repository:Xr,pullRequestId:e.id,codeReviewId:e.id,status:e.status,createdBy:Jr,creationDate:e.created,...e.closed?{closedDate:e.closed}:{},title:e.title,description:e.description,sourceRefName:`refs/heads/${e.branch}`,targetRefName:`refs/heads/main`,mergeStatus:`succeeded`,isDraft:!1,lastMergeSourceCommit:{commitId:F(e.head)},...e.merge?{lastMergeCommit:{commitId:F(e.merge)}}:{},reviewers:[{...Yr,vote:e.vote,isRequired:!0,hasDeclined:!1,isFlagged:!1}],url:`${Xr.url}/pullRequests/${e.id}`}),Qr=e=>({...Zr(e),included:{reviews:e.votes.map((t,n)=>({id:e.id*10+n,publishedDate:t.at,lastUpdatedDate:t.at,isDeleted:!1,status:`closed`,comments:[{id:1,author:Yr,content:`J. Park voted ${t.value}`,publishedDate:t.at,commentType:`system`}],properties:{CodeReviewThreadType:{$type:`System.String`,$value:`VoteUpdate`},CodeReviewVoteResult:{$type:`System.String`,$value:String(t.value)}}})),checks:e.statuses.map((e,t)=>({id:t+1,state:e.state,description:`settlement-ci ${e.state}`,context:{name:`settlement-ci`,genre:`continuous-integration`},creationDate:e.at,updatedDate:e.at,iterationId:1})),commits:e.commits.map((t,n)=>({commitId:F(`${e.head.slice(0,5)}${n}`),comment:t,author:{name:Jr.displayName,email:`you@example.com`,date:e.created}})),files:Array.from({length:e.files},(t,n)=>({changeTrackingId:n+1,changeId:n+1,item:{objectId:F(`f${e.id}${n}`),path:`/src/Settlement/File${n}.cs`},changeType:`edit`}))}}),$r=[{id:87,title:`Write the daily settlement CSV`,description:`For #2302. One file per merchant, written at 02:00 UTC.`,status:`active`,branch:`feature/2302-settlement-csv`,head:`87ab3e2`,created:`2026-10-12T09:20:00Z`,vote:-5,votes:[{value:-5,at:`2026-10-12T14:00:00Z`}],statuses:[{state:`pending`,at:`2026-10-13T07:55:00Z`}],commits:[`Write the settlement CSV`],files:5},{id:84,title:`Schedule the settlement export job`,description:`Task #2305.`,status:`completed`,branch:`feature/2305-schedule`,head:`84cd1f9`,created:`2026-10-07T16:00:00Z`,closed:`2026-10-08T12:30:00Z`,merge:`c84e5f0`,vote:10,votes:[{value:10,at:`2026-10-08T10:00:00Z`}],statuses:[{state:`succeeded`,at:`2026-10-08T12:10:00Z`}],commits:[`Schedule the export at 02:00 UTC`],files:2},{id:80,title:`Settlement job skeleton`,description:`The empty job and its pipeline.`,status:`completed`,branch:`feature/skeleton`,head:`80ef2a1`,created:`2026-09-29T10:00:00Z`,closed:`2026-10-01T11:00:00Z`,merge:`b80a1d2`,vote:10,votes:[{value:10,at:`2026-09-30T15:00:00Z`}],statuses:[{state:`succeeded`,at:`2026-10-01T10:30:00Z`}],commits:[Pr(`Add the settlement job skeleton`,Fr),`Add its pipeline`],files:9}],ei=$r.map(Zr),ti=Object.fromEntries($r.map(e=>[e.id,Qr(e)])),ni=`https://ghe.imagile.dev`,ri=`${ni}/api/v3`,ii=(e,t,n=`User`)=>({login:e,id:t,avatar_url:`${ni}/avatars/u/${t}`,type:n}),ai=ii(`ada-dev`,11),oi=ii(`bo-web`,12),si=ii(`dependabot[bot]`,49699333,`Bot`),ci={full_name:`imagile/payments-web`,name:`payments-web`,owner:{login:`imagile`}},li=e=>({url:`${ri}/repos/imagile/payments-web/pulls/${e.number}`,id:7e3+e.number,number:e.number,state:e.merged?`closed`:`open`,locked:!1,title:e.title,user:e.user,body:e.body,draft:e.draft??!1,html_url:`${ni}/imagile/payments-web/pull/${e.number}`,created_at:e.created,updated_at:e.updated??e.merged??e.created,closed_at:e.merged??null,merged_at:e.merged??null,merge_commit_sha:F(e.merge),requested_reviewers:e.requested??[],requested_teams:[],labels:[],head:{label:`imagile:${e.branch}`,ref:e.branch,sha:F(e.head),repo:ci},base:{label:`imagile:main`,ref:`main`,sha:F(`0a0a0a0`),repo:ci}}),ui=e=>({...li(e),merged:!!e.merged,mergeable:e.merged?null:e.mergeable===void 0||e.mergeable,mergeable_state:e.merged?`unknown`:`clean`,comments:0,review_comments:0,commits:e.commits.length,additions:e.files.reduce((e,t)=>e+t.additions,0),deletions:e.files.reduce((e,t)=>e+t.deletions,0),changed_files:e.files.length,included:{reviews:(e.reviews??[]).map((t,n)=>({id:9e4+e.number*10+n,user:t.user,body:``,state:t.state,submitted_at:t.at,commit_id:F(e.head),author_association:`MEMBER`})),checks:e.checks.map((t,n)=>({id:8e3+e.number*10+n,name:t.name,head_sha:F(e.head),status:t.conclusion===null?`in_progress`:`completed`,conclusion:t.conclusion,html_url:`${ni}/imagile/payments-web/actions/runs/${8e3+e.number*10+n}/job/${8001+e.number*10+n}`,started_at:t.at,completed_at:t.conclusion===null?null:t.at,app:{slug:`github-actions`,name:`GitHub Actions`}})),commits:e.commits.map((t,n)=>({sha:F(`${e.head.slice(0,5)}${n}`),commit:{message:t,author:{name:e.user.login,email:`you@example.com`,date:e.created}},author:e.user})),files:e.files.map(e=>({filename:e.path,status:`modified`,additions:e.additions,deletions:e.deletions,changes:e.additions+e.deletions}))}}),di=[{number:53,title:`Keep focus in the card form on Safari`,body:`Fixes #43.`,user:oi,branch:`fix/43-safari-focus`,draft:!0,head:`53d0e12`,created:`2026-10-12T13:00:00Z`,updated:`2026-10-12T13:25:00Z`,merge:`53f9a00`,checks:[{name:`test`,conclusion:`success`,at:`2026-10-12T13:15:00Z`},{name:`e2e-safari`,conclusion:`failure`,at:`2026-10-12T13:25:00Z`}],commits:[`Keep focus in the expiry field`],files:[{path:`src/checkout/card-form.tsx`,additions:18,deletions:6}]},{number:52,title:`Saved-card picker`,body:`Closes #42. Part of #41.`,user:oi,branch:`feature/saved-cards`,head:`52c4b88`,created:`2026-10-11T10:00:00Z`,updated:`2026-10-11T10:28:00Z`,merge:`52e7d00`,requested:[ai],checks:[{name:`test`,conclusion:`success`,at:`2026-10-11T10:20:00Z`},{name:`e2e-safari`,conclusion:`success`,at:`2026-10-11T10:28:00Z`}],commits:[`Add the saved-card picker`,`Show the expiry beside each card`],files:[{path:`src/checkout/saved-cards.tsx`,additions:210,deletions:4},{path:`src/checkout/saved-cards.test.tsx`,additions:96,deletions:0},{path:`src/checkout/card-form.tsx`,additions:12,deletions:3}]},{number:51,title:`Retry the address lookup once`,body:`The lookup service times out under load; retry once after 300 ms.`,user:ai,branch:`claude/address-retry`,head:`51a7f30`,created:`2026-10-08T09:00:00Z`,updated:`2026-10-09T08:10:00Z`,merge:`51b0c00`,checks:[{name:`test`,conclusion:`failure`,at:`2026-10-09T08:10:00Z`}],commits:[Pr(`Retry the address lookup once`,Fr)],files:[{path:`src/address/lookup.ts`,additions:31,deletions:5},{path:`src/address/lookup.test.ts`,additions:40,deletions:0}]},{number:50,title:`Use the order currency on receipts`,body:`Closes #44.`,user:ai,branch:`fix/44-receipt-currency`,head:`50b1c77`,created:`2026-10-12T14:30:00Z`,merged:`2026-10-12T15:55:00Z`,merge:`5a7e3f1`,reviews:[{user:oi,state:`APPROVED`,at:`2026-10-12T15:20:00Z`}],checks:[{name:`test`,conclusion:`success`,at:`2026-10-12T15:40:00Z`}],commits:[`Format receipts in the order currency`],files:[{path:`src/receipt/total.tsx`,additions:9,deletions:4}]},{number:49,title:`Bump vite from 7.1.2 to 7.1.5`,body:`Bumps vite from 7.1.2 to 7.1.5.`,user:si,branch:`dependabot/npm_and_yarn/vite-7.1.5`,head:`49c2d11`,created:`2026-10-03T06:00:00Z`,merged:`2026-10-05T09:30:00Z`,merge:`49e0a00`,reviews:[{user:ai,state:`APPROVED`,at:`2026-10-05T09:10:00Z`}],checks:[{name:`test`,conclusion:`success`,at:`2026-10-03T06:20:00Z`}],commits:[`Bump vite from 7.1.2 to 7.1.5`],files:[{path:`package.json`,additions:1,deletions:1},{path:`package-lock.json`,additions:12,deletions:12}]},{number:48,title:`Order summary panel`,body:`From the checkout refresh designs.`,user:ai,branch:`feature/order-summary`,head:`48a9e66`,created:`2026-10-01T09:00:00Z`,merged:`2026-10-02T10:00:00Z`,merge:`1c9b8e4`,reviews:[{user:oi,state:`CHANGES_REQUESTED`,at:`2026-10-01T14:00:00Z`},{user:oi,state:`APPROVED`,at:`2026-10-02T09:00:00Z`}],checks:[{name:`test`,conclusion:`success`,at:`2026-10-01T09:20:00Z`}],commits:[`Add the order summary panel`,`Round the subtotal as the designs show`],files:[{path:`src/checkout/summary.tsx`,additions:140,deletions:2},{path:`src/checkout/card-form.tsx`,additions:6,deletions:1}]}],fi=di.map(li),pi=Object.fromEntries(di.map(e=>[e.number,ui(e)])),mi=`# Who reviews what
3
+ * @ada-dev
4
+ src/checkout/ @bo-web
5
+ src/address/ @bo-web @ada-dev
6
+ `,hi={type:`file`,encoding:`base64`,size:82,name:`CODEOWNERS`,path:`.github/CODEOWNERS`,content:btoa(mi),sha:F(`c0de0e5`),html_url:`${ni}/imagile/payments-web/blob/main/.github/CODEOWNERS`,text:mi},gi=`https://bitbucket-cloud.imagile.dev`,_i=(e,t,n)=>({display_name:t,nickname:e,type:`user`,uuid:`{abc12345-0000-0000-0000-0000000000${n}0}`,account_id:`557058:abc12345-0000-0000-0000-0000000000${n}0`}),vi=_i(`bo-web`,`Bo W.`,1),yi=_i(`ada-dev`,`Ada D.`,2),bi={full_name:`imagile/checkout-sdk`,name:`checkout-sdk`,type:`repository`,uuid:`{abc12345-0000-0000-0000-000000000700}`},xi=e=>({type:`pullrequest`,id:e.id,title:e.title,description:e.description,summary:{type:`rendered`,raw:e.description,markup:`markdown`},state:e.state,draft:!1,author:e.author,source:{branch:{name:e.branch},commit:{hash:e.head.padEnd(12,`0`)},repository:bi},destination:{branch:{name:`main`},commit:{hash:`a0a0a0a0a0a0`},repository:bi},...e.merge?{merge_commit:{hash:e.merge.padEnd(12,`0`)}}:{merge_commit:null},comment_count:0,task_count:0,close_source_branch:!0,created_on:e.created,updated_on:e.updated,reviewers:e.reviewers.map(e=>e.user),participants:e.reviewers.map(t=>({type:`participant`,user:t.user,role:`REVIEWER`,approved:t.state===`approved`,state:t.state,participated_on:t.state?e.updated:null})),links:{html:{href:`${gi}/imagile/checkout-sdk/pull-requests/${e.id}`},self:{href:`${gi}/2.0/repositories/imagile/checkout-sdk/pullrequests/${e.id}`}}}),Si=e=>({...xi(e),included:{reviews:e.approvals.map(t=>({approval:{date:t.at,user:t.user,pullrequest:{id:e.id,type:`pullrequest`}},pull_request:{id:e.id,type:`pullrequest`}})),checks:e.statuses.map((t,n)=>({type:`commitstatus`,key:`checkout-sdk-ci-${n}`,name:`checkout-sdk CI`,state:t.state,url:`${gi}/imagile/checkout-sdk/pipelines/results/${e.id*10+n}`,created_on:t.at,updated_on:t.at})),commits:e.commits.map((t,n)=>({type:`commit`,hash:`${e.head}${n}`.padEnd(40,`0`),message:t,author:{type:`author`,raw:`${e.author.display_name} <you@example.com>`},date:e.created})),files:e.files.map(e=>({type:`diffstat`,status:`modified`,lines_added:e.added,lines_removed:e.removed,old:{path:e.path,type:`commit_file`},new:{path:e.path,type:`commit_file`}}))}}),Ci=[{id:12,title:`Format receipt totals in the order currency`,description:`The SDK side of imagile/payments-web#44.`,state:`OPEN`,author:vi,branch:`copilot/receipt-currency`,head:`12ab3c4`,created:`2026-10-10T11:00:00.000000+00:00`,updated:`2026-10-10T11:25:00.000000+00:00`,reviewers:[{user:yi,state:null}],approvals:[],statuses:[{state:`SUCCESSFUL`,at:`2026-10-10T11:25:00.000000+00:00`}],commits:[`Format totals with Intl.NumberFormat`],files:[{path:`src/money.ts`,added:22,removed:7}]},{id:9,title:`Saved-card hooks`,description:`useSavedCards and useDefaultCard, for imagile/payments-web#42.`,state:`MERGED`,author:yi,branch:`feature/saved-card-hooks`,head:`09cd5e6`,merge:`9f1e2d3`,created:`2026-10-06T08:30:00.000000+00:00`,updated:`2026-10-07T12:00:00.000000+00:00`,reviewers:[{user:vi,state:`approved`}],approvals:[{user:vi,at:`2026-10-07T10:00:00.000000+00:00`}],statuses:[{state:`SUCCESSFUL`,at:`2026-10-06T08:50:00.000000+00:00`}],commits:[`Add useSavedCards`,`Add useDefaultCard`],files:[{path:`src/hooks/saved-cards.ts`,added:120,removed:0},{path:`src/hooks/saved-cards.test.ts`,added:64,removed:0}]}],wi=Ci.map(xi),Ti=Object.fromEntries(Ci.map(e=>[e.id,Si(e)])),Ei={project:`PAY`,repo:`payments-core`},Di={collection:`DefaultCollection`,project:`Payments`,repo:`settlement`},Oi={owner:`imagile`,repo:`payments-web`},ki={workspace:`imagile`,repo:`checkout-sdk`};`${[Nr(`bitbucket pr list`,Wr,`corp-bitbucket`,Ei,`server`),...Object.values(Gr).map(e=>Nr(`bitbucket pr get`,e,`corp-bitbucket`,Ei,`server`)),Nr(`ado pr list`,ei,`corp-ado`,Di),...Object.values(ti).map(e=>Nr(`ado pr get`,e,`corp-ado`,Di)),Nr(`github pr list`,fi,`github`,Oi),...Object.values(pi).map(e=>Nr(`github pr get`,e,`github`,Oi)),Nr(`bitbucket pr list`,wi,`bitbucket-cloud`,ki,`cloud`),...Object.values(Ti).map(e=>Nr(`bitbucket pr get`,e,`bitbucket-cloud`,ki,`cloud`))].map(e=>JSON.stringify(e)).join(`
7
+ `)}`;var Ai=e=>Date.parse(e),ji=e=>e.padEnd(40,`0`),Mi=`https://jenkins.imagile.dev`,Ni=(e,t,n,r,i)=>({number:t,url:`${Mi}/job/payments-core/job/PR-${e}/${t}/`,result:n,duration:n===null?0:i,timestamp:Ai(r),building:n===null,displayName:`#${t}`,fullDisplayName:`payments-core » PR-${e} #${t}`,description:null,id:String(t),queueId:9e3+e*10+t}),Pi={311:[Ni(311,2,`FAILURE`,`2026-10-12T16:05:00.000Z`,412e3),Ni(311,1,`FAILURE`,`2026-10-12T15:35:00.000Z`,398e3)],305:[Ni(305,1,`SUCCESS`,`2026-10-07T10:40:00.000Z`,455e3)],298:[Ni(298,3,`SUCCESS`,`2026-10-09T14:20:00.000Z`,441e3)],296:[Ni(296,1,`SUCCESS`,`2026-10-07T11:10:00.000Z`,43e4)],290:[Ni(290,1,`SUCCESS`,`2026-09-30T09:30:00.000Z`,42e4)]},Fi=(e,t,n,r,i,a)=>({name:e,ready:`${r}/${i}`,desiredReplicas:i,readyReplicas:r,updatedReplicas:r,availableReplicas:r,unavailableReplicas:i-r,age:a,images:[{name:e,image:t}],strategy:`RollingUpdate`,labels:{"app.kubernetes.io/name":e,"app.kubernetes.io/version":n}}),Ii=(e,t)=>({namespace:e,kind:`Deployment`,count:t.length,deployments:t}),Li={"payments-dev":Ii(`payments-dev`,[Fi(`payments-core`,`artifactory.imagile.dev/payments/payments-core:1.14.0-4e1d2a9`,`1.14.0`,2,2,`3d`)]),"payments-prod":Ii(`payments-prod`,[Fi(`payments-core`,`artifactory.imagile.dev/payments/payments-core:1.13.2-1a2b3c4`,`1.13.2`,3,3,`13d`)]),"checkout-staging":Ii(`checkout-staging`,[Fi(`payments-web`,`artifactory.imagile.dev/checkout/payments-web:2026.10.12-5a7e3f1`,`2026.10.12`,2,2,`18h`)]),"checkout-prod":Ii(`checkout-prod`,[Fi(`payments-web`,`artifactory.imagile.dev/checkout/payments-web:2026.10.02-1c9b8e4`,`2026.10.02`,4,4,`11d`)])},Ri=`https://ado.imagile.dev/DefaultCollection`,zi={displayName:`D. Okafor`,uniqueName:`IMAGILE\\dokafor`,id:`abc12345-0000-0000-0000-000000000070`,descriptor:`win.dokafor`},Bi=e=>({id:e.id,buildNumber:e.number,status:e.status,...e.result?{result:e.result}:{},queueTime:e.at,startTime:e.at,...e.status===`completed`?{finishTime:e.at}:{},sourceBranch:e.branch,sourceVersion:ji(e.commit),definition:{...e.definition,path:`\\`},project:{name:`Payments`},reason:e.pr?`pullRequest`:`individualCI`,...e.pr?{triggerInfo:{"pr.number":String(e.pr),"pr.sourceBranch":`refs/heads/feature/${e.pr}`}}:{},...e.environment?{templateParameters:{environment:e.environment}}:{},requestedFor:zi,_links:{web:{href:`${Ri}/Payments/_build/results?buildId=${e.id}`}},url:`${Ri}/Payments/_apis/build/Builds/${e.id}`}),Vi={id:12,name:`settlement-ci`},Hi={id:13,name:`settlement-deploy`},Ui=[Bi({id:5530,definition:Vi,number:`20261013.1`,status:`inProgress`,branch:`refs/pull/87/merge`,commit:`87ab3e2`,at:`2026-10-13T07:55:00Z`,pr:87}),Bi({id:5512,definition:Vi,number:`20261008.3`,status:`completed`,result:`succeeded`,branch:`refs/pull/84/merge`,commit:`84cd1f9`,at:`2026-10-08T12:10:00Z`,pr:84}),Bi({id:5461,definition:Vi,number:`20261001.2`,status:`completed`,result:`succeeded`,branch:`refs/pull/80/merge`,commit:`80ef2a1`,at:`2026-10-01T10:30:00Z`,pr:80})],Wi=[Bi({id:5521,definition:Hi,number:`20261008.1`,status:`completed`,result:`succeeded`,branch:`refs/heads/main`,commit:`c84e5f0`,at:`2026-10-08T14:00:00Z`,environment:`test`}),Bi({id:5470,definition:Hi,number:`20261002.1`,status:`completed`,result:`succeeded`,branch:`refs/heads/main`,commit:`b80a1d2`,at:`2026-10-02T16:00:00Z`,environment:`prod`}),Bi({id:5466,definition:Hi,number:`20261001.1`,status:`completed`,result:`succeeded`,branch:`refs/heads/main`,commit:`b80a1d2`,at:`2026-10-01T13:00:00Z`,environment:`test`})],Gi=[kn,{name:`card-payments`,description:`Card payments v2: tokenised cards at the edge. Jira, Bitbucket, Jenkins and OpenShift.`,env:`dev`,repos:[{name:`payments-core`,remotes:[`ssh://git@bitbucket.imagile.dev:7999/pay/payments-core.git`]}],jira:{connection:`corp-jira`,project:`PAY`,fields:{acceptanceCriteria:`customfield_10500`},readiness:{minWords:20}},bitbucket:{connection:`corp-bitbucket`,project:`PAY`,repo:`payments-core`},jenkins:{connection:`corp-jenkins`,jobs:[`payments-core`]},environments:{dev:{openshift:{connection:`ocp-nonprod`,namespace:`payments-dev`}},prod:{openshift:{connection:`ocp-prod`,namespace:`payments-prod`}}},people:[{name:`J. Smith`,ids:{jira:`jsmith`,bitbucket:`jsmith`}},{name:`A. Chen`,email:`you@example.com`,ids:{jira:`achen`}},{name:`R. Patel`,ids:{jira:`rpatel`}}],wipLimit:2},{name:`settlement`,description:`Daily settlement reports for finance. Azure DevOps Server: Boards, Repos and Pipelines.`,repos:[{name:`settlement`,remotes:[`https://ado.imagile.dev/DefaultCollection/Payments/_git/settlement`]}],ado:{connection:`corp-ado`,collection:`DefaultCollection`,project:`Payments`,repo:`settlement`,builds:[`settlement-ci`],deployments:[`settlement-deploy`]}},{name:`checkout-web`,description:`The checkout web front end and its SDK. GitHub Enterprise with Projects and Actions, Bitbucket Cloud for the SDK, deployed on OpenShift.`,env:`staging`,repos:[{name:`payments-web`,remotes:[`https://ghe.imagile.dev/imagile/payments-web.git`]},{name:`checkout-sdk`,remotes:[`https://bitbucket-cloud.imagile.dev/imagile/checkout-sdk.git`]}],github:{connection:`github`,owner:`imagile`,repo:`payments-web`,projects:[`7`],readiness:{minWords:10,templates:[`## What
8
+ ## Why
9
+ ## Acceptance criteria`]}},bitbucket:{connection:`bitbucket-cloud`,workspace:`imagile`,repo:`checkout-sdk`},environments:{staging:{openshift:{connection:`ocp-nonprod`,namespace:`checkout-staging`}},prod:{openshift:{connection:`ocp-prod`,namespace:`checkout-prod`}}},people:[{name:`Ada D.`,ids:{github:`ada-dev`,bitbucket:`557058:abc12345-0000-0000-0000-000000000020`}},{name:`Bo W.`,ids:{github:`bo-web`}},{name:`Claude`,kind:`agent`,ids:{}}],wipLimit:2}],Ki=`/home/you/.toil/projects`,qi=e=>`${Ki}/${e}.json`,Ji={jira:[`project`],bitbucket:[`project`,`workspace`,`repo`],jenkins:[`instance`],ado:[`collection`,`organization`,`project`,`repo`],github:[`owner`,`repo`],openshift:[`instance`]},Yi=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Xi(e){let{name:t,description:n,env:r,repos:i,environments:a,people:o,wipLimit:s,dimensions:c,classify:l,views:u,...d}=e,f=new Set([...Object.keys(d),...Object.values(a??{}).flatMap(e=>Object.keys(e))]),p={};for(let e of[...f].sort()){let t=(r===void 0?void 0:a?.[r]?.[e])??(Yi(d[e])?d[e]:{}),n=Object.fromEntries((Ji[e]??[]).flatMap(e=>typeof t[e]==`string`?[[e,t[e]]]:[]));p[e]={connection:typeof t.connection==`string`?{value:t.connection,source:`toil-project`}:null,writes:!1,env:e===`openshift`?r??null:null,inputs:n}}return{name:t,source:`user`,file:qi(t),by:`input`,match:null,repo:null,adopted:!0,areas:p,toilProject:{name:t,description:n,...r?{env:r}:{},repos:i,...d,...a?{environments:a}:{},...o?{people:o}:{},...s?{wipLimit:s}:{},...c?{dimensions:c}:{},...l?{classify:l}:{},...u?{views:u}:{}},problems:[]}}function Zi(){return{folder:null,places:{user:Ki,listed:[],repo:null},archivedHidden:Qi.length,toilProjects:Gi.map(e=>({name:e.name,description:e.description,archived:!1,source:`user`,file:qi(e.name),shadowedBy:null,problems:0})),broken:[]}}var Qi=[{name:`pilot-rollout`,description:`The pilot, wrapped up in March`}];function $i(){return{folder:null,places:{user:Ki,listed:[],repo:null},archivedHidden:0,toilProjects:Qi.map(e=>({name:e.name,description:e.description,archived:!0,source:`user`,file:qi(e.name),shadowedBy:null,problems:0})),broken:[]}}var ea=`0.1.0-alpha.1`,ta=`https://jira.imagile.dev`,na=`https://ado.imagile.dev/DefaultCollection`,ra=`https://ghe.imagile.dev`,ia=`${ra}/api/v3`,L=(e,t,n,r={})=>({ok:!0,data:t,error:null,meta:{command:e,durationMs:412,version:ea,context:{connection:{value:n,source:`default`,default:`named`},...Object.keys(r).length?{inputs:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{value:t,source:`toil-project`}]))}:{}}}}),aa=(e,t)=>({self:`${ta}/rest/api/2/user?username=${e}`,name:e,key:e,displayName:t,active:!0}),R=aa(`jsmith`,`J. Smith`),z=aa(`achen`,`A. Chen`),oa=aa(`rpatel`,`R. Patel`),sa={todo:{name:`To Do`,id:`10000`,statusCategory:{id:2,key:`new`,name:`To Do`}},progress:{name:`In Progress`,id:`3`,statusCategory:{id:4,key:`indeterminate`,name:`In Progress`}},review:{name:`In Review`,id:`10100`,statusCategory:{id:4,key:`indeterminate`,name:`In Progress`}},done:{name:`Done`,id:`10001`,statusCategory:{id:3,key:`done`,name:`Done`}}},ca={epic:{name:`Epic`,id:`10000`,subtask:!1},story:{name:`Story`,id:`10001`,subtask:!1},bug:{name:`Bug`,id:`1`,subtask:!1},subtask:{name:`Sub-task`,id:`10003`,subtask:!0}},la=(e,t,n,r)=>`com.atlassian.greenhopper.service.sprint.Sprint@6f3a${e}[id=${e},rapidViewId=7,state=${t},name=Sprint ${e},startDate=${n},endDate=${r},completeDate=${t===`CLOSED`?r:`<null>`},sequence=${e},goal=]`,ua=la(40,`CLOSED`,`2026-09-07T09:00:00.000Z`,`2026-09-18T17:00:00.000Z`),da=la(41,`CLOSED`,`2026-09-21T09:00:00.000Z`,`2026-10-02T17:00:00.000Z`),fa=la(42,`ACTIVE`,`2026-10-05T09:00:00.000Z`,`2026-10-16T17:00:00.000Z`),pa=(e,t,n,r)=>({id:String(r),type:e===`Blocks`?{id:`10000`,name:`Blocks`,inward:`is blocked by`,outward:`blocks`}:{id:`10003`,name:`Relates`,inward:`relates to`,outward:`relates to`},[t===`outward`?`outwardIssue`:`inwardIssue`]:{key:n,fields:{}}}),ma=(e,t)=>({expand:`renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations`,id:String(20100+t),self:`${ta}/rest/api/2/issue/${20100+t}`,key:e.key,fields:{summary:e.summary,description:e.description??null,issuetype:{self:`${ta}/rest/api/2/issuetype/${ca[e.type].id}`,...ca[e.type]},status:{self:`${ta}/rest/api/2/status/${sa[e.status].id}`,...sa[e.status]},resolution:e.resolved?{self:`${ta}/rest/api/2/resolution/10000`,id:`10000`,name:`Done`}:null,resolutiondate:e.resolved??null,priority:{self:`${ta}/rest/api/2/priority/3`,name:e.priority??`Medium`,id:`3`},assignee:e.assignee??null,reporter:oa,labels:e.labels??[`payments`],project:{self:`${ta}/rest/api/2/project/10200`,id:`10200`,key:`PAY`,name:`Payments`},created:e.created,updated:e.updated,duedate:null,timeoriginalestimate:null,issuelinks:e.links??[],subtasks:(e.subtasks??[]).map(e=>({key:e,fields:{}})),...e.parent?{parent:{key:e.parent,fields:{}}}:{},"Story Points":e.points??null,Sprint:e.sprints??null,"Epic Link":e.epic??null}}),ha=[{key:`PAY-92`,type:`story`,summary:`Mask card numbers in the gateway logs`,status:`done`,assignee:R,points:3,sprints:[ua],created:`2026-09-01T09:00:00.000+0000`,updated:`2026-09-17T14:00:00.000+0000`,resolved:`2026-09-17T14:00:00.000+0000`},{key:`PAY-95`,type:`story`,summary:`Look up the card scheme from the BIN`,status:`done`,assignee:z,points:3,sprints:[da],created:`2026-09-08T11:00:00.000+0000`,updated:`2026-09-25T11:00:00.000+0000`,resolved:`2026-09-25T11:00:00.000+0000`},{key:`PAY-97`,type:`bug`,summary:`A double click charges twice`,status:`done`,assignee:R,points:2,sprints:[da],created:`2026-09-16T08:20:00.000+0000`,updated:`2026-09-30T16:00:00.000+0000`,resolved:`2026-09-30T16:00:00.000+0000`,priority:`High`},{key:`PAY-98`,type:`story`,summary:`Decline codes in the merchant report`,status:`done`,assignee:oa,points:5,sprints:[da],created:`2026-09-10T10:00:00.000+0000`,updated:`2026-10-02T15:00:00.000+0000`,resolved:`2026-10-02T15:00:00.000+0000`},{key:`PAY-100`,type:`epic`,summary:`Card payments v2`,status:`progress`,assignee:oa,created:`2026-08-31T10:00:00.000+0000`,updated:`2026-10-09T11:00:00.000+0000`,description:`h2. Goal
10
+ Store cards as tokens and charge them without the PAN leaving the edge.`},{key:`PAY-101`,type:`story`,summary:`Tokenise card numbers at the edge`,status:`progress`,assignee:R,points:5,sprints:[fa],epic:`PAY-100`,subtasks:[`PAY-106`],links:[pa(`Blocks`,`outward`,`PAY-102`,30001)],created:`2026-09-14T09:30:00.000+0000`,updated:`2026-10-08T16:10:00.000+0000`,priority:`High`,description:`The gateway swaps the PAN for a token before anything is logged.
11
+
12
+ * PAN never reaches the app tier
13
+ * Token format agreed with the vault team`},{key:`PAY-102`,type:`story`,summary:`Store tokens in the vault`,status:`todo`,assignee:z,points:3,sprints:[fa],epic:`PAY-100`,links:[pa(`Blocks`,`inward`,`PAY-101`,30001),pa(`Blocks`,`outward`,`PAY-103`,30002)],created:`2026-09-14T09:35:00.000+0000`,updated:`2026-10-05T09:10:00.000+0000`},{key:`PAY-103`,type:`story`,summary:`Charge a stored token`,status:`todo`,points:8,sprints:[fa],epic:`PAY-100`,links:[pa(`Blocks`,`inward`,`PAY-102`,30002)],created:`2026-09-14T09:40:00.000+0000`,updated:`2026-10-05T09:10:00.000+0000`},{key:`PAY-104`,type:`bug`,summary:`Refund total rounds half-cents down`,status:`review`,assignee:z,points:2,sprints:[da,fa],created:`2026-09-22T13:00:00.000+0000`,updated:`2026-10-07T10:20:00.000+0000`,priority:`High`,labels:[`payments`,`refunds`]},{key:`PAY-105`,type:`story`,summary:`Show the last four digits on receipts`,status:`done`,assignee:R,points:3,sprints:[fa],epic:`PAY-100`,created:`2026-09-15T08:00:00.000+0000`,updated:`2026-10-09T15:30:00.000+0000`,resolved:`2026-10-09T15:30:00.000+0000`},{key:`PAY-106`,type:`subtask`,summary:`Add the tokeniser to the gateway config`,status:`done`,assignee:R,parent:`PAY-101`,sprints:[fa],created:`2026-10-05T10:00:00.000+0000`,updated:`2026-10-07T12:00:00.000+0000`,resolved:`2026-10-07T12:00:00.000+0000`},{key:`PAY-107`,type:`story`,summary:`Retry declined charges once`,status:`todo`,sprints:[fa],links:[pa(`Relates`,`outward`,`PAY-103`,30003)],created:`2026-10-08T13:45:00.000+0000`,updated:`2026-10-08T14:00:00.000+0000`}],B=(e,t,n,r)=>({id:String(e),author:t,created:n,items:r}),V=(e,t)=>({field:`status`,fieldtype:`jira`,from:sa[e].id,fromString:sa[e].name,to:sa[t].id,toString:sa[t].name}),ga=(e,t)=>({field:`Sprint`,fieldtype:`custom`,from:null,fromString:e,to:null,toString:t}),_a={"PAY-92":[B(40001,R,`2026-09-09T10:00:00.000+0000`,[V(`todo`,`progress`)]),B(40002,R,`2026-09-17T14:00:00.000+0000`,[V(`progress`,`done`)])],"PAY-95":[B(40011,z,`2026-09-22T10:00:00.000+0000`,[V(`todo`,`progress`)]),B(40012,z,`2026-09-24T15:00:00.000+0000`,[V(`progress`,`review`)]),B(40013,R,`2026-09-25T11:00:00.000+0000`,[V(`review`,`done`)])],"PAY-97":[B(40021,R,`2026-09-23T09:00:00.000+0000`,[V(`todo`,`progress`)]),B(40022,z,`2026-09-30T16:00:00.000+0000`,[V(`progress`,`done`)])],"PAY-98":[B(40031,oa,`2026-09-21T14:00:00.000+0000`,[V(`todo`,`progress`)]),B(40032,oa,`2026-10-01T10:00:00.000+0000`,[V(`progress`,`review`)]),B(40033,z,`2026-10-02T15:00:00.000+0000`,[V(`review`,`done`)])],"PAY-101":[B(40101,R,`2026-10-06T09:15:00.000+0000`,[V(`todo`,`progress`)])],"PAY-104":[B(40201,z,`2026-09-29T10:00:00.000+0000`,[V(`todo`,`progress`)]),B(40202,oa,`2026-10-05T09:05:00.000+0000`,[ga(`Sprint 41`,`Sprint 41, Sprint 42`)]),B(40203,z,`2026-10-07T10:20:00.000+0000`,[V(`progress`,`review`)])],"PAY-105":[B(40301,R,`2026-10-06T11:00:00.000+0000`,[V(`todo`,`progress`)]),B(40302,R,`2026-10-08T17:00:00.000+0000`,[V(`progress`,`review`)]),B(40303,z,`2026-10-09T15:30:00.000+0000`,[V(`review`,`done`)])],"PAY-107":[B(40401,oa,`2026-10-08T14:00:00.000+0000`,[ga(``,`Sprint 42`)])]},va=(e,t)=>({displayName:t,url:`https://ado.imagile.dev/_apis/Identities/abc12345-0000-0000-0000-0000000000${e.length}0`,id:`abc12345-0000-0000-0000-0000000000${e.length}0`,uniqueName:`IMAGILE\\${e}`,descriptor:`win.abc12345${e}`}),ya=va(`dokafor`,`D. Okafor`),ba=va(`mlind`,`M. Lind`),H=va(`knakamura`,`K. Nakamura`),xa=(e,t)=>({rel:e,url:`${na}/_apis/wit/workItems/${t}`,attributes:{isLocked:!1,name:e.split(`.`).pop()}}),Sa=e=>({id:e.id,rev:6,fields:{"System.AreaPath":`Payments\\Settlement`,"System.TeamProject":`Payments`,"System.IterationPath":e.iteration,"System.WorkItemType":e.type,"System.State":e.state,"System.Reason":e.reason,...e.assignee?{"System.AssignedTo":e.assignee}:{},"System.CreatedDate":e.created,"System.CreatedBy":H,"System.ChangedDate":e.changed,"System.ChangedBy":e.assignee??H,"System.Title":e.title,...e.description?{"System.Description":e.description}:{},"Microsoft.VSTS.Common.Priority":2,...e.points===void 0?{}:{"Microsoft.VSTS.Scheduling.StoryPoints":e.points},...e.hours===void 0?{}:{"Microsoft.VSTS.Scheduling.OriginalEstimate":e.hours},...e.teamPoints===void 0?{}:{"Custom.TeamPoints":e.teamPoints},...e.closed?{"Microsoft.VSTS.Common.ClosedDate":e.closed}:{},"System.Tags":e.tags??`settlement`},relations:e.relations??[],_links:{self:{href:`${na}/_apis/wit/workItems/${e.id}`},html:{href:`${na}/Payments/_workitems/edit/${e.id}`}},url:`${na}/_apis/wit/workItems/${e.id}`}),U=`Payments\\Sprint 42`,Ca=[{id:2290,type:`User Story`,title:`Read settlement batches from the ledger`,state:`Closed`,reason:`Acceptance tests pass`,assignee:ya,iteration:`Payments\\Sprint 40`,points:3,teamPoints:3,created:`2026-09-01T09:00:00Z`,changed:`2026-09-15T16:00:00Z`,closed:`2026-09-15T16:00:00Z`},{id:2294,type:`Bug`,title:`Batch totals ignore refunds`,state:`Closed`,reason:`Fixed and verified`,assignee:ba,iteration:`Payments\\Sprint 41`,points:2,teamPoints:2,created:`2026-09-14T13:00:00Z`,changed:`2026-09-26T11:30:00Z`,closed:`2026-09-26T11:30:00Z`},{id:2297,type:`User Story`,title:`Group settlements by merchant`,state:`Closed`,reason:`Acceptance tests pass`,assignee:ya,iteration:`Payments\\Sprint 41`,points:5,teamPoints:5,created:`2026-09-15T10:00:00Z`,changed:`2026-10-01T15:00:00Z`,closed:`2026-10-01T15:00:00Z`},{id:2301,type:`Feature`,title:`Settlement reports`,state:`Active`,reason:`Implementation started`,assignee:H,iteration:`Payments`,relations:[xa(`System.LinkTypes.Hierarchy-Forward`,2302),xa(`System.LinkTypes.Hierarchy-Forward`,2303)],created:`2026-08-24T14:00:00Z`,changed:`2026-10-05T09:30:00Z`},{id:2302,type:`User Story`,title:`Export the daily settlement CSV`,state:`Active`,reason:`Implementation started`,assignee:ya,iteration:U,points:5,teamPoints:5,relations:[xa(`System.LinkTypes.Hierarchy-Reverse`,2301),xa(`System.LinkTypes.Dependency-Forward`,2303),xa(`System.LinkTypes.Hierarchy-Forward`,2305)],created:`2026-09-10T10:00:00Z`,changed:`2026-10-06T08:45:00Z`,description:`<div>One CSV per merchant, written at 02:00 UTC.</div>`},{id:2303,type:`User Story`,title:`Email the settlement report to finance`,state:`New`,reason:`New`,iteration:U,points:3,teamPoints:3,relations:[xa(`System.LinkTypes.Hierarchy-Reverse`,2301),xa(`System.LinkTypes.Dependency-Reverse`,2302)],created:`2026-09-10T10:05:00Z`,changed:`2026-10-05T09:30:00Z`},{id:2304,type:`Bug`,title:`Settlement totals are a day early in UTC-5`,state:`Active`,reason:`Approved`,assignee:ba,iteration:U,points:2,teamPoints:2,created:`2026-09-24T16:20:00Z`,changed:`2026-10-07T11:00:00Z`,tags:`settlement; timezones`},{id:2305,type:`Task`,title:`Schedule the export job`,state:`Closed`,reason:`Completed`,assignee:ya,iteration:U,hours:4,relations:[xa(`System.LinkTypes.Hierarchy-Reverse`,2302)],created:`2026-10-05T10:00:00Z`,changed:`2026-10-08T13:00:00Z`,closed:`2026-10-08T13:00:00Z`},{id:2306,type:`User Story`,title:`Reconcile chargebacks against settlements`,state:`New`,reason:`New`,iteration:U,points:5,created:`2026-10-02T09:00:00Z`,changed:`2026-10-09T10:15:00Z`},{id:2307,type:`Bug`,title:`Retire the legacy settlement endpoint`,state:`Removed`,reason:`Removed from the backlog`,iteration:U,points:1,created:`2026-09-01T09:00:00Z`,changed:`2026-10-07T09:00:00Z`,closed:`2026-10-07T09:00:00Z`}],W=(e,t,n,r,i,a)=>({id:e,rev:t,fields:{"System.WorkItemType":e===2304||e===2294?`Bug`:`User Story`,"System.State":i,"System.IterationPath":a,"System.ChangedDate":n,"System.ChangedBy":r},url:`${na}/_apis/wit/workItems/${e}/revisions/${t}`}),wa=`Payments\\Sprint 40`,Ta=`Payments\\Sprint 41`,Ea={2290:[W(2290,1,`2026-09-01T09:00:00Z`,H,`New`,`Payments`),W(2290,2,`2026-09-04T15:00:00Z`,H,`New`,wa),W(2290,3,`2026-09-08T10:00:00Z`,ya,`Active`,wa),W(2290,4,`2026-09-15T16:00:00Z`,ya,`Closed`,wa)],2294:[W(2294,1,`2026-09-14T13:00:00Z`,H,`New`,Ta),W(2294,2,`2026-09-22T09:30:00Z`,ba,`Active`,Ta),W(2294,3,`2026-09-26T11:30:00Z`,ba,`Closed`,Ta)],2297:[W(2297,1,`2026-09-15T10:00:00Z`,H,`New`,Ta),W(2297,2,`2026-09-23T09:00:00Z`,ya,`Active`,Ta),W(2297,3,`2026-10-01T15:00:00Z`,ya,`Closed`,Ta)],2302:[W(2302,1,`2026-09-10T10:00:00Z`,H,`New`,`Payments`),W(2302,2,`2026-09-30T15:00:00Z`,H,`New`,U),W(2302,3,`2026-10-06T08:45:00Z`,ya,`Active`,U)],2304:[W(2304,1,`2026-09-24T16:20:00Z`,H,`New`,`Payments\\Sprint 41`),W(2304,2,`2026-09-28T09:00:00Z`,ba,`Active`,`Payments\\Sprint 41`),W(2304,3,`2026-10-05T08:30:00Z`,H,`Active`,U)],2306:[W(2306,1,`2026-10-02T09:00:00Z`,H,`New`,`Payments`),W(2306,2,`2026-10-09T10:15:00Z`,H,`New`,U)]},Da=(e,t,n,r)=>({id:r,identifier:`abc12345-0000-0000-0000-0000000004${r}`,name:e,structureType:`iteration`,hasChildren:!1,path:`\\Payments\\Iteration\\${e}`,attributes:{startDate:t,finishDate:n},url:`${na}/Payments/_apis/wit/classificationNodes/Iterations/${encodeURIComponent(e)}`}),Oa={id:40,identifier:`abc12345-0000-0000-0000-000000000400`,name:`Payments`,structureType:`iteration`,hasChildren:!0,path:`\\Payments\\Iteration`,children:[Da(`Sprint 40`,`2026-09-07T00:00:00Z`,`2026-09-18T00:00:00Z`,40),Da(`Sprint 41`,`2026-09-21T00:00:00Z`,`2026-10-02T00:00:00Z`,41),Da(`Sprint 42`,`2026-10-05T00:00:00Z`,`2026-10-16T00:00:00Z`,42),Da(`Sprint 43`,`2026-10-19T00:00:00Z`,`2026-10-30T00:00:00Z`,43)],url:`${na}/Payments/_apis/wit/classificationNodes/Iterations`},ka=(e,t)=>({login:e,id:t,avatar_url:`${ra}/avatars/u/${t}`,type:`User`}),Aa=ka(`ada-dev`,11),ja=ka(`bo-web`,12),Ma={Feature:{id:3,name:`Feature`},Task:{id:1,name:`Task`},Bug:{id:2,name:`Bug`}},Na=`imagile/payments-web`,Pa=e=>({id:9e3+e.number,number:e.number,title:e.title,state:e.state,state_reason:e.state===`closed`?`completed`:null,locked:!1,body:e.body,html_url:`${ra}/${Na}/issues/${e.number}`,repository_url:`${ia}/repos/${Na}`,user:Aa,labels:e.labels.map((e,t)=>({id:500+t,name:e,color:`d73a4a`,description:null})),assignees:e.assignee?[e.assignee]:[],type:{...Ma[e.type],node_id:`IT_kwDOabc12345${e.type}`,description:null,color:`gray`},sub_issues_summary:{total:e.subs?.length??0,completed:0,percent_completed:0},parent_issue_url:e.parent?`${ia}/repos/${Na}/issues/${e.parent}`:null,created_at:e.created,updated_at:e.updated,closed_at:e.closed??null}),Fa=[{number:36,title:`Pay button stays disabled after an error`,type:`Bug`,state:`closed`,assignee:ja,labels:[`bug`],created:`2026-09-21T10:00:00Z`,updated:`2026-09-24T17:00:00Z`,closed:`2026-09-24T17:00:00Z`,body:`After a declined card the Pay button never re-enables.`},{number:38,title:`Show card brand icons`,type:`Task`,state:`closed`,assignee:Aa,labels:[`checkout`,`ui`],created:`2026-09-21T10:30:00Z`,updated:`2026-10-01T12:00:00Z`,closed:`2026-10-01T12:00:00Z`,body:`Visa, Mastercard and Amex icons beside the card number field.`},{number:41,title:`Checkout accepts saved cards`,type:`Feature`,state:`open`,assignee:Aa,labels:[`checkout`],subs:[42],created:`2026-09-28T12:00:00Z`,updated:`2026-10-08T09:00:00Z`,body:`Customers pick a saved card at checkout instead of typing it again.
14
+
15
+ - [ ] Card picker
16
+ - [ ] 3-D Secure on saved cards`},{number:42,title:`Saved-card picker component`,type:`Task`,state:`open`,assignee:ja,labels:[`checkout`,`ui`],parent:41,created:`2026-09-28T12:10:00Z`,updated:`2026-10-09T14:00:00Z`,body:`A list of saved cards with the last four digits and expiry.`},{number:43,title:`Card form loses focus on Safari`,type:`Bug`,state:`open`,assignee:ja,labels:[`bug`,`safari`],created:`2026-10-07T08:30:00Z`,updated:`2026-10-07T08:45:00Z`,body:`Typing the expiry moves focus back to the card number field on Safari 18.`},{number:44,title:`Receipt page shows the wrong currency symbol`,type:`Bug`,state:`closed`,assignee:Aa,labels:[`bug`],created:`2026-10-01T10:00:00Z`,updated:`2026-10-12T16:00:00Z`,closed:`2026-10-12T16:00:00Z`,body:`EUR receipts show $.`},{number:45,title:`End-to-end test for 3-D Secure`,type:`Task`,state:`open`,labels:[`testing`],created:`2026-10-05T11:00:00Z`,updated:`2026-10-05T11:00:00Z`,body:`Cover the challenge flow with the issuer simulator.`}],Ia={36:{status:`Done`,estimate:2,added:`2026-09-21T10:05:00Z`,sprint:41},38:{status:`Done`,estimate:3,added:`2026-09-21T10:35:00Z`,sprint:41},41:{status:`In Progress`,estimate:5,added:`2026-09-28T12:05:00Z`},42:{status:`In Review`,estimate:3,added:`2026-09-28T12:15:00Z`},43:{status:`Todo`,estimate:2,added:`2026-10-07T09:00:00Z`},44:{status:`Done`,estimate:1,added:`2026-10-01T10:05:00Z`},45:{status:`Todo`,added:`2026-10-05T11:05:00Z`}},La={Todo:`f75ad846`,"In Progress":`47fc9ee4`,"In Review":`a1b2c3d4`,Done:`98236657`},Ra=e=>{let t=Ia[e.number];return{id:`PVTI_abc12345${e.number}`,type:`ISSUE`,isArchived:!1,createdAt:t.added,updatedAt:e.updated,content:{__typename:`Issue`,number:e.number,title:e.title,state:e.state.toUpperCase(),url:`${ra}/${Na}/issues/${e.number}`,updatedAt:e.updated,repository:{nameWithOwner:Na}},fieldValues:[{__typename:`ProjectV2ItemFieldTextValue`,text:e.title,field:{id:`PVTF_abc12345title`,name:`Title`}},{__typename:`ProjectV2ItemFieldSingleSelectValue`,name:t.status,optionId:La[t.status],field:{id:`PVTSSF_abc12345`,name:`Status`}},...t.estimate===void 0?[]:[{__typename:`ProjectV2ItemFieldNumberValue`,number:t.estimate,field:{id:`PVTF_abc12345`,name:`Estimate`}}],t.sprint===41?{__typename:`ProjectV2ItemFieldIterationValue`,title:`Sprint 41`,iterationId:`b7e2a91c`,startDate:`2026-09-21`,duration:12,field:{id:`PVTIF_abc12345`,name:`Sprint`}}:{__typename:`ProjectV2ItemFieldIterationValue`,title:`Sprint 42`,iterationId:`cfc16e4d`,startDate:`2026-10-05`,duration:12,field:{id:`PVTIF_abc12345`,name:`Sprint`}}]}},za=(e,t,n)=>[{id:7e3+e*10,node_id:`CE_kwDOabc1234570${e}`,event:`closed`,actor:t,created_at:n,state_reason:`completed`,commit_id:null}],Ba=[{id:7001,node_id:`LE_kwDOabc123457001`,event:`labeled`,actor:Aa,created_at:`2026-10-01T10:01:00Z`,label:{name:`bug`,color:`d73a4a`}},{id:7002,node_id:`CE_kwDOabc123457002`,event:`closed`,actor:Aa,created_at:`2026-10-12T16:00:00Z`,state_reason:`completed`,commit_id:null}],Va={owner:`imagile`,repo:`payments-web`},Ha=[L(`jira issue get`,{issues:ha.map(ma),errors:[]},`corp-jira`),...Object.entries(_a).map(([e,t])=>({key:e,history:L(`jira issue history`,t,`corp-jira`)})),L(`ado work-item iterations`,Oa,`corp-ado`,{collection:`DefaultCollection`,project:`Payments`}),L(`ado work-item get-many`,{count:Ca.length,value:Ca.map(Sa),missing:[]},`corp-ado`,{collection:`DefaultCollection`,project:`Payments`}),...Object.values(Ea).map(e=>L(`ado work-item history`,e,`corp-ado`,{collection:`DefaultCollection`,project:`Payments`})),L(`github issue get`,{issues:Fa.map(e=>e.subs?{...Pa(e),sub_issues:e.subs.map(e=>Pa(Fa.find(t=>t.number===e)))}:Pa(e)),errors:[]},`github`,Va),{key:`36`,history:L(`github issue history`,za(36,ja,`2026-09-24T17:00:00Z`),`github`,Va)},{key:`38`,history:L(`github issue history`,za(38,Aa,`2026-10-01T12:00:00Z`),`github`,Va)},{key:`44`,history:L(`github issue history`,Ba,`github`,Va)},L(`github project items`,Fa.map(Ra),`github`,{owner:`imagile`})];`${Ha.map(e=>JSON.stringify(e)).join(`
17
+ `)}`,`${JSON.stringify(L(`jira issue history`,_a[`PAY-104`],`corp-jira`),null,2)}`,`${JSON.stringify(Ha.find(e=>e.meta?.command===`ado work-item get-many`),null,2)}`;var Ua=Ha,Wa=e=>`history`in e,Ga=e=>Ua.find(t=>!Wa(t)&&t.meta?.command===e).data,Ka=e=>Ua.filter(Wa).filter(t=>t.history.meta?.command===e),qa=Ga(`jira issue get`).issues,Ja={"PAY-101":`* The PAN is swapped for a token before the first log line
18
+ * A replayed token is refused`,"PAY-102":`* A stored token charges once
19
+ * A second charge with the same idempotency key is refused`},Ya={startAt:0,maxResults:50,total:qa.length,issues:qa.map(e=>Ja[e.key]?{...e,fields:{...e.fields,customfield_10500:Ja[e.key]}}:e)},Xa=qa.map(e=>e.key),Za={self:`https://jira.imagile.dev/rest/api/2/user?username=jsmith`,name:`jsmith`,key:`jsmith`,displayName:`J. Smith`,active:!0},Qa=(e,t,n,r)=>({id:String(e),author:Za,created:t,items:[{field:`status`,fieldtype:`jira`,from:n[0],fromString:n[1],to:r[0],toString:r[1]}]}),$a={"PAY-106":[Qa(40501,`2026-10-06T09:30:00.000+0000`,[`10000`,`To Do`],[`3`,`In Progress`]),Qa(40502,`2026-10-07T12:00:00.000+0000`,[`3`,`In Progress`],[`10001`,`Done`])]},eo=Object.fromEntries(Xa.map(e=>[e,Ka(`jira issue history`).find(t=>t.key===e)?.history.data??$a[e]??[]])),to=Ga(`ado work-item iterations`),no=Ga(`ado work-item get-many`),ro=no.value.map(e=>e.id),io=`https://ado.imagile.dev/DefaultCollection`,ao={queryType:`flat`,queryResultType:`workItem`,asOf:`2026-10-13T08:00:00.000Z`,columns:[{referenceName:`System.Id`,name:`ID`,url:`${io}/_apis/wit/fields/System.Id`}],workItems:ro.map(e=>({id:e,url:`${io}/_apis/wit/workItems/${e}`}))},oo=new Map(Ua.filter(e=>!Wa(e)&&e.meta?.command===`ado work-item history`).map(e=>[e.data[0].id,e.data])),so=(e,t)=>({displayName:t,id:`abc12345-0000-0000-0000-0000000000${e.length}0`,uniqueName:`IMAGILE\\${e}`}),co=so(`knakamura`,`K. Nakamura`),lo=so(`dokafor`,`D. Okafor`),G=(e,t,n,r,i,a,o)=>({id:e,rev:t,fields:{"System.WorkItemType":i,"System.State":a,"System.IterationPath":o,"System.ChangedDate":n,"System.ChangedBy":r},url:`${io}/_apis/wit/workItems/${e}/revisions/${t}`}),uo=`Payments`,fo=`Payments\\Sprint 42`,po={2301:[G(2301,1,`2026-08-24T14:00:00Z`,co,`Feature`,`New`,uo),G(2301,2,`2026-10-05T09:30:00Z`,co,`Feature`,`Active`,uo)],2303:[G(2303,1,`2026-09-10T10:05:00Z`,co,`User Story`,`New`,uo),G(2303,2,`2026-09-30T15:00:00Z`,co,`User Story`,`New`,fo)],2305:[G(2305,1,`2026-10-05T10:00:00Z`,lo,`Task`,`New`,fo),G(2305,2,`2026-10-06T09:00:00Z`,lo,`Task`,`Active`,fo),G(2305,3,`2026-10-08T13:00:00Z`,lo,`Task`,`Closed`,fo)],2307:[G(2307,1,`2026-09-01T09:00:00Z`,co,`Bug`,`New`,uo),G(2307,2,`2026-09-30T15:00:00Z`,co,`Bug`,`New`,fo),G(2307,3,`2026-10-07T09:00:00Z`,co,`Bug`,`Removed`,fo)]},mo=Object.fromEntries(ro.map(e=>[e,oo.get(e)??po[e]])),ho={...no,value:no.value.map(e=>({...e,rev:mo[e.id].length}))},go=Date.parse(`2026-10-13T08:00:00.000Z`)-37152e5,_o=e=>typeof e==`object`&&e?`${e.displayName} <${e.uniqueName}>`:e,vo=ro.flatMap(e=>mo[e]).filter(e=>Date.parse(String(e.fields[`System.ChangedDate`]))>go).map(e=>({id:e.id,rev:e.rev,fields:{"System.Id":e.id,"System.Rev":e.rev,...e.fields,"System.ChangedBy":_o(e.fields[`System.ChangedBy`])}})).sort((e,t)=>Date.parse(String(e.fields[`System.ChangedDate`]))-Date.parse(String(t.fields[`System.ChangedDate`]))||e.id-t.id),yo=ro.filter(e=>vo.filter(t=>t.id===e).length!==mo[e].length),bo=Ga(`github project items`),xo=bo.map(e=>e.content.number),So=Ga(`github issue get`),Co=Object.fromEntries(xo.map(e=>[e,Ka(`github issue history`).find(t=>t.key===String(e))?.history.data??[]])),wo=(e,t,n,r)=>({self:`https://jira.imagile.dev/rest/api/2/status/${t}`,name:e,id:t,statusCategory:{id:n===`new`?2:n===`done`?3:4,key:n,name:r}}),To={progress:wo(`In Progress`,`3`,`indeterminate`,`In Progress`),review:wo(`In Review`,`10100`,`indeterminate`,`In Progress`),done:wo(`Done`,`10001`,`done`,`Done`),todo:wo(`To Do`,`10000`,`new`,`To Do`)},Eo={"To Do":[{id:`11`,name:`Start Progress`,to:To.progress}],"In Progress":[{id:`21`,name:`Submit for Review`,to:To.review},{id:`31`,name:`Done`,to:To.done},{id:`41`,name:`Stop Progress`,to:To.todo}],"In Review":[{id:`31`,name:`Done`,to:To.done},{id:`51`,name:`Back to In Progress`,to:To.progress}]},Do=e=>String(e.fields?.status?.name??``),Oo=e=>Object.fromEntries(e.filter(e=>Do(e)!==`Done`).map(e=>[String(e.key),Eo[Do(e)]??[]])),ko=Oo(qa),Ao=[{name:`New`,color:`b2b2b2`,category:`Proposed`},{name:`Active`,color:`007acc`,category:`InProgress`},{name:`Resolved`,color:`ff9d00`,category:`Resolved`},{name:`Closed`,color:`339933`,category:`Completed`},{name:`Removed`,color:`ffffff`,category:`Removed`}],jo={"User Story":Ao,Bug:Ao,Feature:Ao},Mo=[`PAY-106`],No={...Ya,issues:Ya.issues.map(e=>{let t=e.key,n=eo[t],r=Mo.includes(t)?n.slice(0,1):n;return{...e,changelog:{startAt:0,maxResults:100,total:n.length,histories:r}}})},Po=_,Fo=`0.1.0-alpha.1`,Io=[{id:`customfield_10016`,name:`Story Points`,type:`number`},{id:`customfield_10020`,name:`Sprint`,type:`sprint`}],K=`card-payments`,q=`settlement`,J=`checkout-web`,Y=`sample-team`,Lo=(e,t=[])=>{let n=Gi.find(t=>t.name===e);return fe(n,n.jira,t).join(`,`)},Ro=Lo(K,Io),zo={owner:`imagile`,repo:`payments-web`},X=(e,t,n,r)=>({toilProject:e,area:t,...n?{env:n}:{},...r?{deployment:r}:{}}),Bo=(e,t,n,r,i,a={})=>Object.entries(r).map(([r,o])=>({command:`${t} pr get`,input:{toilProject:e,...a,[n]:Number(r),include:Ye},data:o,...X(e,t,void 0,i)}));function Vo(){return Object.entries(ir).flatMap(([e,t])=>[{command:`projects diagram show`,input:{toilProject:e},data:sr(e)},...t.model.views.map(t=>({command:`projects diagram show`,input:{toilProject:e,view:t.key},data:sr(e,t.key)}))])}var Ho=[{command:`projects list`,input:{},data:Zi()},{command:`projects list`,input:{archived:!0},data:$i()},...Gi.map(e=>({command:`projects show`,input:{toilProject:e.name},data:Xi(e)})),...Vo(),{command:`jira issue fields`,input:{toilProject:K},data:Io,...X(K,`jira`)},{command:`jira issue search`,input:{toilProject:K,jql:ce(`PAY`),changelog:!0,moreFields:Ro},data:No,...X(K,`jira`)},...Mo.map(e=>({command:`jira issue history`,input:{toilProject:K,key:e},data:eo[e],...X(K,`jira`)})),...Object.entries(ko).map(([e,t])=>({command:`jira issue transitions`,input:{toilProject:K,key:e},data:t,...X(K,`jira`)})),{command:`bitbucket pr list`,input:{toilProject:K,state:`ALL`},data:Wr,...X(K,`bitbucket`)},...Bo(K,`bitbucket`,`id`,Gr),...Object.entries(Pi).map(([e,t])=>({command:`jenkins pipeline runs`,input:{toilProject:K,name:`payments-core/PR-${e}`,limit:5},data:t,...X(K,`jenkins`)})),{command:`openshift deployment list`,input:{toilProject:K,env:`dev`,namespace:`payments-dev`},data:Li[`payments-dev`],...X(K,`openshift`,`dev`)},{command:`openshift deployment list`,input:{toilProject:K,env:`prod`,namespace:`payments-prod`},data:Li[`payments-prod`],...X(K,`openshift`,`prod`)},{command:`ado work-item iterations`,input:{toilProject:q},data:to,...X(q,`ado`)},{command:`ado work-item search`,input:{toilProject:q,wiql:tt},data:ao,...X(q,`ado`)},{command:`ado work-item get-many`,input:{toilProject:q,id:ro},data:ho,...X(q,`ado`)},{command:`ado work-item feed`,input:{toilProject:q,fields:De},data:vo,...X(q,`ado`)},...yo.map(e=>({command:`ado work-item history`,input:{toilProject:q,id:e},data:mo[e],...X(q,`ado`)})),...Object.entries(jo).map(([e,t])=>({command:`ado work-item states`,input:{toilProject:q,type:e},data:t,...X(q,`ado`)})),{command:`ado pr list`,input:{toilProject:q,state:`all`},data:ei,...X(q,`ado`)},...Bo(q,`ado`,`id`,ti),{command:`ado run list`,input:{toilProject:q,name:`settlement-ci`,top:20},data:Ui,...X(q,`ado`)},{command:`ado run list`,input:{toilProject:q,name:`settlement-deploy`,top:20},data:Wi,...X(q,`ado`)},{command:`github project items`,input:{toilProject:J,owner:zo.owner,project:7},data:bo,...X(J,`github`)},{command:`github issue get`,input:{toilProject:J,...zo,number:xo,subIssues:!0},data:So,...X(J,`github`)},...xo.map(e=>({command:`github issue history`,input:{toilProject:J,...zo,number:e},data:Co[e],...X(J,`github`)})),{command:`github pr list`,input:{toilProject:J,...zo,state:`all`},data:fi,...X(J,`github`)},...Bo(J,`github`,`number`,pi,void 0,zo),{command:`github repo file`,input:{toilProject:J,...zo,path:xe[0]},data:hi,...X(J,`github`)},{command:`bitbucket pr list`,input:{toilProject:J,state:`ALL`},data:wi,...X(J,`bitbucket`,void 0,`cloud`)},...Bo(J,`bitbucket`,`id`,Ti,`cloud`),{command:`openshift deployment list`,input:{toilProject:J,env:`staging`,namespace:`checkout-staging`},data:Li[`checkout-staging`],...X(J,`openshift`,`staging`)},{command:`openshift deployment list`,input:{toilProject:J,env:`prod`,namespace:`checkout-prod`},data:Li[`checkout-prod`],...X(J,`openshift`,`prod`)},{command:`jira issue fields`,input:{toilProject:Y},data:[],...X(Y,`jira`)},{command:`jira issue search`,input:{toilProject:Y,jql:ce(`SHOP`),changelog:!0,moreFields:Lo(Y)},data:An,...X(Y,`jira`)},{command:`github issue list`,input:{toilProject:Y,...jn,state:`all`},data:[],...X(Y,`github`)},...Object.entries(Oo(An.issues)).map(([e,t])=>({command:`jira issue transitions`,input:{toilProject:Y,key:e},data:t,...X(Y,`jira`)})),{command:`github pr list`,input:{toilProject:Y,...jn,state:`all`},data:Nn,...X(Y,`github`)},...Bo(Y,`github`,`number`,Pn,void 0,jn),{command:`github repo file`,input:{toilProject:Y,...jn,path:xe[0]},data:Ln,...X(Y,`github`)}];function Uo(e,t){e===`ado work-item feed`&&(t=Object.fromEntries(Object.entries(t).filter(([e])=>e!==`updatedSince`)));let n=e=>Array.isArray(e)?e.map(n):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,n(t)])):e;return`${e} ${JSON.stringify(n(t))}`}function Wo(e){if(!e.toilProject||!e.area)return;let t=Gi.find(t=>t.name===e.toilProject),n=(e.env?t.environments?.[e.env]?.[e.area]:void 0)??t[e.area],r=Xi(t).areas[e.area]?.inputs??{};return{toilProject:{name:t.name,source:`user`,file:qi(t.name),by:`input`},connection:{value:String(n.connection),source:`toil-project`,...e.deployment?{deployment:e.deployment}:{}},...Object.keys(r).length?{inputs:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{value:t,source:`toil-project`}]))}:{}}}function Go(e){let t=Wo(e);return{ok:!0,data:e.data,error:null,meta:{command:e.command,durationMs:0,version:Fo,contractVersion:1,...t?{context:t}:{}}}}function Ko(e,t,n,r){return{ok:!1,data:null,error:{code:t,message:n,fix:r},meta:{command:e,durationMs:0,version:Fo,contractVersion:1}}}function qo(e=Ho){let t=new Map(e.map(e=>[Uo(e.command,e.input),e])),n=[];return{execute:async(e,r={},i={})=>{let a=t.get(Uo(e,r)),o=i.readOnly===!0?a?Go(a):Ko(e,`INVALID_INPUT`,`The preview has no sample answer for ${Uo(e,r)}.`,`Add the call to CANNED in ui/src/fixtures/execute.ts, with data in the command's own output shape.`):Ko(e,`WRITE_DISABLED`,`The preview answers read-only calls only, and this ${e} call didn't pass readOnly.`,`Pass { readOnly: true }, as every Toil UI call does.`);return n.push({command:e,input:r,ok:o.ok,error:o.ok?null:`${o.error.message} ${o.error.fix??``}`.trim()}),await Promise.resolve(),structuredClone(o)},calls:n}}var Jo=`card-payments`,Yo=36e5,Xo=e=>new Date(Date.parse(Po)-e*Yo).toISOString(),Z=e=>`corp-jira:PAY-${e}`;function Zo(e){let t=e.blocked.filter(e=>e.id!==Z(103));t.some(e=>e.id===Z(104))||t.push({id:Z(104),by:[Z(105)]});let n={...e.points},r=n[Z(102)];r!==void 0&&(n[Z(102)]=Math.max(0,r-2));let i=e.sprint,a=i&&i.done!==null&&i.remaining!==null?{...i,done:Math.max(0,i.done-3),remaining:i.remaining+3}:i;return{blocked:t.sort((e,t)=>e.id.localeCompare(t.id)),points:n,sprint:a}}var Qo=[`Recommendation: Unblock [[${Z(104)}]] first: it waits on [[${Z(105)}]], and it came over from Sprint 41.`,[`Issues:`,`1. Blocked: [[${Z(104)}]] is blocked by [[${Z(105)}]].`,`2. Build failing: [[${Z(101)}]]'s latest build failed, and it blocks [[${Z(102)}]].`].join(`
20
+ `),`Evidence:`,`The scripted preview's earlier analysis, kept so the history has one to compare with. [[${Z(102)}]] waited on [[${Z(101)}]]; [[${Z(103)}]] was not blocked yet.`];async function $o(){let e=await $e(qo().execute,Jo),t=Te(e.items,Po),n=e=>{let t=e.map(e=>({text:e}));return{prompt:`Analyze`,parts:t,citations:ot(t),by:`scripted`,adapter:`scripted`,model:null,proposals:[]}};return[Ve(n(Qo),{id:`sample-analysis-1`,toilProject:Jo,startedAt:Xo(90.5),at:Xo(90),snapshot:Zo(t)}),Ve(n(Dr(Jo)),{id:`sample-analysis-2`,toilProject:Jo,startedAt:Xo(.6),at:Xo(.5),snapshot:t})]}function es(){let e,t=()=>e??=$o().then(e=>pe(e));return{list:async e=>(await t()).list(e),get:async(e,n)=>(await t()).get(e,n),record:async(e,n,r)=>(await t()).record(e,n,r)}}function ts(e,t){let n=t.indexOf(`-`);return n>0&&e.startsWith(t.slice(0,n+1))?t.slice(n+1):t}var ns=e=>e?e.slice(0,7):`an unrecorded commit`;function rs(e,t,n){return t.version===n.version?t.commit===n.commit?null:`${e} ${t.version} at ${ns(t.commit)} · now ${ns(n.commit)}`:`${e} ${t.version} · now ${ts(t.version,n.version)}`}function is(e,t){if(!e)return null;let n=[],r=[rs(`toil`,e.toil,t.toil),rs(`Toil UI`,e.toilUi,t.toilUi)].filter(e=>e!==null),i=[...new Set([...Object.keys(e.skills),...Object.keys(t.skills)])].filter(n=>e.skills[n]!==t.skills[n]).sort();if(i.length&&n.push(`skills changed: ${i.join(`, `)}`),e.toilProject!==t.toilProject&&n.push(`Toil project changed`),e.prompts!==t.prompts&&n.push(`prompts changed`),!r.length&&!n.length)return null;let a=[...r,...n];return{reasons:a,text:r.length?`started on ${a.join(` · `)}`:`${a.join(` · `)} since it started`}}var Q=class extends Error{fix;status;constructor(e,t,n=400){super(e),this.fix=t,this.status=n}},as=class extends Error{reason;fix;usage;constructor(e,t,n,r=null){super(t),this.reason=e,this.fix=n,this.usage=r}},os=2e3,ss=({transcript:e,...t})=>t,cs=class{o;records=new Map;running=new Map;listeners=new Set;events=[];seq=0;held=new Set;applying=new Set;constructor(e){this.o=e;for(let t of e.keeper.load())t.state===`working`&&e.sample?(this.held.add(t.id),this.running.set(t.id,new AbortController)):t.state===`working`&&(t.state=`failed`,t.endedAt=e.now(),t.stop={reason:`interrupted`,message:`Toil UI stopped while this assignment was running, so it never finished.`,fix:`Assign the item again.`},e.keeper.save(t)),this.records.set(t.id,t);queueMicrotask(()=>this.pump())}summary(e){return{...ss(e),ranMs:Ne(e,this.o.now())}}wake(){this.pump()}get busy(){return this.running.size>0}wipe(){if(this.busy)throw new Q(`An assignment is running, so the cache stays until it ends.`,`Stop it from its page, or wait for it to finish, then wipe.`,409);this.records.clear(),this.events.length=0}runningIn(e){return[...this.running.keys()].some(t=>this.records.get(t)?.toilProject===e)}renameToilProject(e,t){if(this.runningIn(e))throw new Q(`An assignment of ${e} is running, so it can't be renamed yet.`,`Wait for it to finish, or stop it from its page, then rename the Toil project.`,409);let n=0;for(let r of this.records.values())r.toilProject===e&&(r.toilProject=t,this.note(r,`note`,`The Toil project was renamed from ${e} to ${t}.`),this.save(r,`renamed`,r.state,`Toil project renamed to ${t}.`),n++);return n}async staleOf(e,t=new Map){let n=e.startedOn?.fingerprint;if(!this.o.current||!n||e.state===`done`||e.renewedBy)return null;let r=`${e.toilProject}/${e.mode}`,i=t.get(r);i||t.set(r,i=Promise.resolve(this.o.current(e.toilProject,e.mode)));try{let e=is(n,await i);return e?{...e,restart:this.o.restartNeeded?.()??null}:null}catch{return null}}async list(e,t={}){t.inbox!==!1&&await this.inbox(e);let n=await this.o.repos(e).catch(()=>[]),r=new Map,i=[...this.records.values()].filter(t=>t.toilProject===e).sort((e,t)=>t.createdAt.localeCompare(e.createdAt));return{assignments:await Promise.all(i.map(async e=>({...this.summary(e),stale:await this.staleOf(e,r)}))),settings:this.o.settings(),adapters:this.o.runner.adapters(),repos:n,preferred:this.o.runner.preferred()}}all(){return[...this.records.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>this.summary(e))}get(e){let t=this.records.get(e);if(!t)throw new Q(`There is no assignment ${e}.`,`Open the Agents sidebar on the Toil project to see its assignments.`,404);return{...structuredClone(t),ranMs:Ne(t,this.o.now())}}async read(e){return{...this.get(e),stale:await this.staleOf(this.records.get(e))}}async renew(e){let t=this.mutable(e),n=await this.staleOf(t),r=ze({...t,stale:n});if(r)throw new Q(r,`Renew covers stale assignments that have stopped and wait on nobody.`,409);if(!t.adapter)throw new Q(`That assignment has no adapter to renew on.`,`Assign the item again, choosing one.`);this.usable(t.adapter,t.mode);let i=this.item(t.toilProject,t.item),a=this.create({toilProject:t.toilProject,item:i,mode:t.mode,adapter:t.adapter,origin:`person`,trigger:null,waiting:`slot`,repo:t.repo,renews:t.id,history:us(t,n)});return t.renewedBy=a.id,this.note(t,`note`,`Renewed by a person in Toil UI as ${a.id}, on today's instructions (${n.text}).`),this.save(t,`renewed`,t.state,`Renewed as ${a.id}.`),this.pump(),this.summary(this.records.get(a.id))}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get latest(){return this.seq}since(e){return this.events.filter(t=>t.seq>e)}async assign(e){let t=this.check(e),n=this.item(t.toilProject,t.item),r=t.mode===`implement`?(await this.repoFor(t.toilProject,t.repo)).name:null,i=this.create({toilProject:t.toilProject,item:n,mode:t.mode,adapter:t.adapter,origin:`person`,trigger:null,waiting:`slot`,repo:r});return this.pump(),this.summary(this.records.get(i.id))}async start(e,t){let n=this.mutable(e);if(n.state!==`queued`||n.waiting!==`start`)throw new Q(`Assignment ${e} isn't waiting for Start: it is ${n.state}.`,`Only an assignment the tracker queued waits for a person to start it.`,409);let r=t??n.adapter;if(!r)throw new Q(`Choose an adapter to start this assignment.`,`Pick Claude, Copilot or Codex in the dialog, then press Start.`);if(!ue.includes(r))throw new Q(`${String(r)} isn't an adapter.`,`Choose claude, copilot or codex.`);return this.usable(r,n.mode),n.mode===`implement`&&(n.repo=(await this.repoFor(n.toilProject,n.repo??void 0)).name),n.adapter=r,n.waiting=`slot`,this.note(n,`note`,`Started from the inbox by a person in Toil UI, on ${Le[r]}.`),this.save(n,`state`,n.state,`Started by a person; waiting for a free slot.`),this.pump(),this.summary(n)}cancel(e){let t=this.mutable(e),n=this.running.get(e);if(n&&this.held.delete(e))return this.running.delete(e),this.end(t,`failed`,{reason:`cancelled`,message:`Stopped by a person in Toil UI.`,fix:null}),this.pump(),this.summary(t);if(n)return n.abort(`cancelled`),this.summary(t);if(t.state!==`queued`)throw new Q(`Assignment ${e} is ${t.state}, so there is nothing to stop.`,`Only a queued or working assignment can be stopped.`,409);return this.end(t,`failed`,{reason:`cancelled`,message:`Taken off the queue by a person before it started.`,fix:null}),this.summary(t)}async apply(e,t){let n=this.mutable(e),r=n.proposals.find(e=>e.id===t);if(!r)throw new Q(`Assignment ${e} has no proposal ${t}.`,`Reload the assignment; its proposals are listed on its page.`,404);if(r.status===`applied`)throw new Q(`That proposal was applied ${r.outcome?.at??`already`}.`,`Nothing to do: it is in the tracker.`,409);if(r.status===`dismissed`)throw new Q(`That proposal was dismissed.`,`Assign the item again for a fresh proposal.`,409);if(!r.command||!r.input)throw new Q(`toil has no command for this proposal, so there is nothing to apply here.`,r.note??`Make the change by hand.`);let i=`${e}/${t}`;if(this.applying.has(i))throw new Q(`That proposal is being applied now.`,`Wait for it to finish; its card says what came of it.`,409);this.applying.add(i);let a;try{a=await this.o.apply(this.summary(n),r)}finally{this.applying.delete(i)}let o=this.o.now();return r.status=a.ok?`applied`:`failed`,r.outcome=a.ok?{at:o,ok:!0,message:`Applied with toil ${r.command}.`}:{at:o,ok:!1,message:`${a.error.message}${a.error.fix?` ${a.error.fix}`:``}`},this.note(n,`proposal`,`${a.ok?`Applied`:`Tried to apply`}: ${r.title}`,r.outcome.message),this.settle(n,`${a.ok?`Applied`:`Apply failed`}: ${r.title}`),this.summary(n)}dismiss(e,t){let n=this.mutable(e),r=n.proposals.find(e=>e.id===t);if(!r)throw new Q(`Assignment ${e} has no proposal ${t}.`,`Reload the assignment; its proposals are listed on its page.`,404);if(!ge(r)&&r.status!==`failed`)throw new Q(`That proposal is ${r.status}.`,`Only a proposal still waiting can be dismissed.`,409);return r.status=`dismissed`,this.note(n,`proposal`,`Dismissed: ${r.title}`),this.settle(n,`Dismissed: ${r.title}`),this.summary(n)}finish(e){let t=this.mutable(e);if(t.state!==`needs-you`)throw new Q(`Assignment ${e} is ${t.state}, not waiting on you.`,`Only an assignment that needs you can be marked reviewed.`,409);for(let e of t.proposals)ge(e)&&(e.status=`dismissed`);t.questions=[],this.note(t,`note`,`Marked reviewed by a person.`);let n=t.state;return t.state=`done`,this.save(t,`state`,n,`Marked reviewed.`),this.summary(t)}check(e){let t=typeof e==`object`&&e?e:{},n=`Send { "toilProject": "<name>", "item": "<owi id>", "mode": "refine", "adapter": "codex" }, with "repo" for implement.`;if(typeof t.toilProject!=`string`||!t.toilProject)throw new Q(`An assignment needs a Toil project.`,n);if(typeof t.item!=`string`||!t.item)throw new Q(`An assignment needs the OWI id of a work item.`,n);if(!Ue.includes(t.mode))throw new Q(`${JSON.stringify(t.mode)} isn't a mode.`,`Choose refine, investigate or implement.`);if(!ue.includes(t.adapter))throw new Q(`${JSON.stringify(t.adapter)} isn't an adapter.`,`Choose claude, copilot or codex.`);if(t.repo!==void 0&&(typeof t.repo!=`string`||!t.repo))throw new Q(`repo names one of the Toil project's repositories.`,n);return this.usable(t.adapter,t.mode),t}usable(e,t){let n=this.o.runner.adapters().find(t=>t.name===e);if(n?.problem)throw new Q(n.problem,`Set the adapter up under Settings, AI agent, or choose another.`);if(t===`implement`&&n?.implement)throw new Q(n.implement,`Choose an adapter the dialog offers for implement mode, or refine or investigate instead.`)}item(e,t){let n=this.o.items(e);if(!n)throw new Q(`Toil UI hasn't synced ${e} yet, so the agent has no item to work on.`,`Press Sync now in the Sync panel, then assign again.`,409);let r=n.find(e=>e.id===t);if(!r)throw new Q(`${e} has no item ${t} in Toil UI's last sync.`,`Sync the Toil project, or pick an item its board shows.`,404);return r}async repoFor(e,t){let n=await this.o.repos(e);if(!n.length)throw new Q(`${e} lists no repository with a local path, so implement mode has nothing to clone.`,`Add one under Settings, Toil projects, then assign again.`);if(t===void 0){if(n.length===1)return n[0];throw new Q(`${e} lists ${n.length} repositories; say which one to work in.`,`Choose one of ${n.map(e=>e.name).join(`, `)}.`)}let r=n.find(e=>e.name===t);if(!r)throw new Q(`${e} has no repository ${t} with a local path.`,`Choose one of ${n.map(e=>e.name).join(`, `)}.`);return r}async inbox(e){let t=this.o.items(e);if(!t)return;let n=(await this.o.people(e).catch(()=>[])).filter(e=>e.kind===`agent`),r=this.o.runner.preferred();for(let i of t){let t=qe(i,n);t&&([...this.records.values()].some(n=>n.toilProject===e&&n.item===i.id&&n.mode===t.mode&&n.origin===`tracker`&&n.trigger===t.trigger)||this.create({toilProject:e,item:i,mode:t.mode,adapter:r,origin:`tracker`,trigger:t.trigger,waiting:`start`,repo:null}))}}create(e){let t=this.o.now(),n={id:this.o.newId(),toilProject:e.toilProject,item:e.item.id,itemTitle:e.item.title,mode:e.mode,adapter:e.adapter,origin:e.origin,trigger:e.trigger,state:`queued`,waiting:e.waiting,repo:e.repo,createdAt:t,startedAt:null,endedAt:null,stop:null,report:null,questions:[],proposals:[],usage:null,startedOn:null,branch:null,...e.renews?{renews:e.renews,history:e.history??null}:{},transcript:[]},r=e.renews?`Renewed by a person in Toil UI from ${e.renews}, on ${e.adapter?Le[e.adapter]:`an agent`}, in ${me[e.mode].label.toLowerCase()} mode, with what that run left as context.`:e.origin===`tracker`?`Queued by the tracker (${e.trigger}); it starts only when a person presses Start.`:`Assigned by a person in Toil UI to ${e.adapter?Le[e.adapter]:`an agent`}, in ${me[e.mode].label.toLowerCase()} mode.`;return n.transcript.push({at:t,kind:`note`,title:r}),this.records.set(n.id,n),this.save(n,`created`,null,r),n}mutable(e){let t=this.records.get(e);if(!t)throw new Q(`There is no assignment ${e}.`,`Open the Agents sidebar on the Toil project to see its assignments.`,404);return t}note(e,t,n,r){e.transcript.push({at:this.o.now(),kind:t,title:n,...r===void 0?{}:{detail:r}}),e.transcript.length>2e3&&e.transcript.splice(1,e.transcript.length-os,{at:this.o.now(),kind:`note`,title:`Earlier lines were dropped: a transcript keeps the first line and the last 1998.`})}save(e,t,n,r){this.o.keeper.save(e);let i={seq:++this.seq,at:this.o.now(),id:e.id,toilProject:e.toilProject,item:e.item,kind:t,state:e.state,previous:n,message:r,itemTitle:e.itemTitle,adapter:e.adapter,origin:e.origin,stop:e.stop?.reason??null,pending:e.proposals.filter(ge).length,questions:e.questions.length};this.events.push(i),this.events.length>500&&this.events.splice(0,this.events.length-500);for(let e of this.listeners)try{e(i)}catch{}}settle(e,t){let n=e.state;e.state===`needs-you`&&(e.state=Ce(e)),this.save(e,n===e.state?`proposal`:`state`,n,t)}end(e,t,n){let r=e.state;e.state=t,e.waiting=null,e.endedAt=this.o.now(),e.stop=n,n&&this.note(e,n.reason===`injection`?`note`:`error`,n.message,n.fix??void 0),this.save(e,`state`,r,n?.message??(t===`needs-you`?`Finished: proposals or questions wait on you.`:`Finished.`))}pump(){let{concurrent:e}=this.o.settings();for(;this.running.size<e;){let e=[...this.records.values()].filter(e=>e.state===`queued`&&e.waiting===`slot`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt))[0];if(!e)return;this.run(e)}}async run(e){let t=new AbortController;this.running.set(e.id,t);let{timeLimitMinutes:n}=this.o.settings(),r=this.o.setTimer??((e,t)=>setTimeout(e,t)),i=this.o.clearTimer??(e=>clearTimeout(e)),a=r(()=>t.abort(`time`),n*6e4),o=e.state;e.state=`working`,e.waiting=null,e.startedAt=this.o.now(),this.note(e,`note`,`Started on ${e.adapter?Le[e.adapter]:`no adapter`}, with a time limit of ${n} minutes.`),this.save(e,`state`,o,`Working.`);try{let n=this.item(e.toilProject,e.item),r=await this.o.runner.run({assignment:this.summary(e),item:n,signal:t.signal,record:t=>this.note(e,t.kind,t.title,t.detail),started:t=>void(e.startedOn=t,this.o.keeper.save(e))});if(t.signal.aborted)throw t.signal.reason;e.report=r.report,e.questions=r.questions,e.proposals=r.proposals.map(e=>({...e,status:`pending`,diff:ye(e,n)})),e.usage=r.usage,e.startedOn=r.startedOn,e.branch=r.branch;for(let t of e.proposals)this.note(e,`proposal`,`Proposed: ${t.title}`,t.command?`toil ${t.command} ${JSON.stringify(t.input)}`:t.note??void 0);let i=r.injection?{reason:`injection`,message:`The agent stopped: the item looks like an attempt to instruct it (${r.injection}).`,fix:`Read the item yourself before assigning it again.`}:null;this.end(e,i?`needs-you`:Ce(e),i)}catch(r){let i=t.signal.aborted?t.signal.reason:null;r instanceof as&&r.usage&&(e.usage=r.usage);let a;a=i===`time`?{reason:`time`,message:`Stopped at the time limit of ${n} minutes, before the agent finished.`,fix:`Raise the limit under Limits in the AI agents panel, or assign a smaller piece of the item.`}:i===`cancelled`?{reason:`cancelled`,message:`Stopped by a person in Toil UI.`,fix:null}:r instanceof as?{reason:r.reason,message:r.message,fix:r.fix}:r instanceof Q?{reason:`error`,message:r.message,fix:r.fix}:{reason:`error`,message:r instanceof Error?r.message:String(r),fix:null},this.end(e,a.reason===`injection`?`needs-you`:`failed`,a)}finally{i(a),this.running.delete(e.id),this.pump()}}},ls=4e3;function us(e,t){let n=e.stop?`It ended ${e.state}: ${e.stop.message}`:`It ended ${e.state}.`,r=[`An earlier run of this assignment (${e.id}) started ${e.startedAt??`at an unknown time`} on instructions that have changed since (${t.text}). ${n}`,...e.report?.parts.length?[`Its report:`,...e.report.parts.map(e=>e.text)]:[],...e.questions.length?[`Its questions:`,...e.questions.map(e=>`- ${e}`)]:[],...e.proposals.length?[`Its proposals:`,...e.proposals.map(e=>`- ${e.title} (${e.status})`)]:[]].join(`
21
+ `);return r.length>4e3?`${r.slice(0,ls)}\n[cut at ${ls} characters]`:r}var ds={concurrent:2,timeLimitMinutes:20},fs={item:`corp-jira:PAY-107`,label:`agent:refine`},$=e=>new Date(Date.parse(Po)-e*6e4).toISOString(),ps=e=>`[[corp-jira:PAY-${e}]]`,ms=`sample0000000000000000000000000000000000000000000000000000000000`,hs={toil:{version:`0.1.0-alpha.4`,commit:null},toilUi:{version:`0.1.0-alpha.2`,commit:null},skills:{github:`sample-github-2`,jira:`sample-jira-2`},toilProject:`sample-toil-project`,prompts:`sample-prompts`},gs={...hs,toil:{version:`0.1.0-alpha.3`,commit:null},skills:{github:`sample-github-2`,jira:`sample-jira-1`}},_s=(e,t,n,r,i=hs)=>({at:n,toil:`sample`,toilUi:`sample`,adapter:t,model:null,skills:[],tools:r,toilProject:{name:`card-payments`,fingerprint:ms},item:{id:e,updated:null,fingerprint:ms},prompt:ms,fingerprint:i}),vs=[`owi_query`,`owi_get`,`owi_history`,`owi_similar`,`pr_query`,`pr_get`,`pr_metrics`,`proposal_fields`];function ys(e,t){let n=t.source.key,r=[`${t.title}.`,``,`Acceptance criteria:`,`- It works for every card scheme the gateway takes.`,`- A failure is logged with its reason and no card data.`,`- A test covers the happy path and one failure.`].join(`
22
+ `),i=[{id:`agent:${t.id}:jira issue update:0`,from:`agent`,item:t.id,title:`Add acceptance criteria to ${n}`,reason:`${t.title} has no acceptance criteria, so nobody can say when it is done.`,command:`jira issue update`,input:{toilProject:e,key:n,description:r},note:`Replaces the description. Check the wording with the team first.`}];return t.estimate||i.push({id:`agent:${t.id}:jira issue update:1`,from:`agent`,item:t.id,title:`Estimate ${n} at 3 points`,reason:`About the size of ${ps(105)}, which took 3 points.`,command:`jira issue update`,input:{toilProject:e,key:n,field:[`Story Points=3`]},note:`A suggested size. Agree it with the team before applying.`}),i}function bs(e){let t=new Map(e.items.map(e=>[e.id,e])),n=e=>t.get(e),r=(e,t,r)=>({id:e,toilProject:`card-payments`,item:t,itemTitle:n(t).title,mode:`refine`,adapter:`codex`,origin:`person`,trigger:null,state:`queued`,waiting:null,repo:null,createdAt:$(60),startedAt:null,endedAt:null,stop:null,report:null,questions:[],proposals:[],usage:null,startedOn:null,branch:null,transcript:[],...r}),i=n(`corp-jira:PAY-102`),a=ys(`card-payments`,i).map(e=>({...e,status:`pending`,diff:ye(e,i)}));return[r(`sample-working-0001`,`corp-jira:PAY-104`,{mode:`investigate`,adapter:`claude`,state:`working`,createdAt:$(4),startedAt:$(3),transcript:[{at:$(4),kind:`note`,title:`Assigned by a person in Toil UI to Claude, in investigate mode.`},{at:$(3),kind:`note`,title:`Started on Claude, with a time limit of 20 minutes.`},{at:$(3),kind:`tool`,title:`Called: owi_get`,detail:`{"id":"corp-jira:PAY-104"}`},{at:$(2),kind:`tool`,title:`Called: pr_query`,detail:`{"item":"corp-jira:PAY-104"}`}]}),r(`sample-needsyou-0002`,`corp-jira:PAY-102`,{state:`needs-you`,createdAt:$(55),startedAt:$(54),endedAt:$(51),report:{parts:[{text:`${ps(102)} has no likely duplicate: owi_similar's closest is ${ps(103)} at 41%, which charges a token rather than storing one.`},{text:`It blocks ${ps(101)} and ${ps(103)}, so its criteria decide when both can start. Its 3-point estimate fits the work; the proposal below adds the criteria it lacks.`}],citations:[`corp-jira:PAY-102`,`corp-jira:PAY-103`,`corp-jira:PAY-101`],unverified:[],warnings:[]},questions:[`Which vault holds the tokens in staging: the shared one, or a vault of its own?`],proposals:a,usage:_t(`sample-needsyou-0002`,1,`card-payments`,$(51)),startedOn:_s(`corp-jira:PAY-102`,`codex`,$(54),vs,gs),transcript:[{at:$(55),kind:`note`,title:`Assigned by a person in Toil UI to Codex, in refine mode.`},{at:$(54),kind:`note`,title:`Started on Codex, with a time limit of 20 minutes.`},{at:$(54),kind:`prompt`,title:`Task`,detail:`Refine [[corp-jira:PAY-102]] so a person could pick it up.`},{at:$(53),kind:`tool`,title:`Called: owi_similar`,detail:`{"id":"corp-jira:PAY-102"}`},{at:$(52),kind:`tool`,title:`Called: proposal_fields`,detail:`{"command":"jira issue update"}`},{at:$(51),kind:`text`,title:`The agent answered`},...a.map(e=>({at:$(51),kind:`proposal`,title:`Proposed: ${e.title}`}))]}),r(`sample-done-00000003`,`corp-jira:PAY-98`,{mode:`investigate`,adapter:`copilot`,state:`done`,createdAt:$(300),startedAt:$(299),endedAt:$(296),report:{parts:[{text:`${ps(98)} shipped the decline codes in the merchant report; nothing in the sprint depends on it, and no pull request on it is open.`}],citations:[`corp-jira:PAY-98`],unverified:[],warnings:[]},proposals:[{id:`agent:corp-jira:PAY-98:comment:report`,from:`agent`,item:`corp-jira:PAY-98`,title:`Post the report as a comment on PAY-98`,reason:`The investigation above, as one comment, so the people on the item can read it where they work.`,command:`jira issue comment`,input:{toilProject:`card-payments`,key:`PAY-98`,body:`corp-jira:PAY-98 shipped the decline codes in the merchant report.`},note:`The comment is the report exactly as shown above.`,status:`applied`,diff:[{field:`body`,before:null,after:`corp-jira:PAY-98 shipped the decline codes in the merchant report.`}],outcome:{at:$(290),ok:!0,message:`Applied with toil jira issue comment.`}}],startedOn:_s(`corp-jira:PAY-98`,`copilot`,$(299),vs),transcript:[{at:$(300),kind:`note`,title:`Assigned by a person in Toil UI to GitHub Copilot, in investigate mode.`},{at:$(290),kind:`proposal`,title:`Applied: Post the report as a comment on PAY-98`,detail:`Applied with toil jira issue comment.`}]}),r(`sample-failed-0000004`,`corp-jira:PAY-101`,{mode:`implement`,adapter:`codex`,repo:`payments-core`,state:`failed`,createdAt:$(180),startedAt:$(179),endedAt:$(159),stop:{reason:`time`,message:`Stopped at the time limit of 20 minutes, before the agent finished.`,fix:`Raise the limit in the Agents sidebar, or assign a smaller piece of the item.`},startedOn:_s(`corp-jira:PAY-101`,`codex`,$(179),[...vs,`codex sandbox`],gs),transcript:[{at:$(180),kind:`note`,title:`Assigned by a person in Toil UI to Codex, in implement mode.`},{at:$(178),kind:`activity`,title:`Ran git clone --no-hardlinks <payments-core> . (exit 0)`},{at:$(177),kind:`activity`,title:`Ran git switch -c ${je(n(`corp-jira:PAY-101`))} (exit 0)`},{at:$(159),kind:`error`,title:`Stopped at the time limit of 20 minutes, before the agent finished.`}]}),r(`sample-inbox-00000005`,fs.item,{origin:`tracker`,trigger:`label ${fs.label}`,adapter:null,waiting:`start`,createdAt:$(20),transcript:[{at:$(20),kind:`note`,title:`Queued by the tracker (label ${fs.label}); it starts only when a person presses Start.`}]})]}function xs(e=600){let t=(e,t)=>new Promise((n,r)=>{let i=setTimeout(n,e);t.addEventListener(`abort`,()=>(clearTimeout(i),r(Error(`Stopped.`))),{once:!0})});return{adapters:()=>[`claude`,`copilot`,`codex`].map(e=>({name:e,label:Le[e],problem:null,implement:e===`codex`?null:`${Le[e]} can't take implement mode through Toil UI yet: only Codex's own sandbox holds an agent's commands and writes to one folder.`})),preferred:()=>`codex`,async run(n){let{assignment:r,item:i,signal:a}=n;n.record({kind:`prompt`,title:`Task`,detail:`${r.mode} [[${i.id}]] (sample: no model is asked)`}),await t(e,a),n.record({kind:`tool`,title:`Called: owi_get`,detail:JSON.stringify({id:i.id})}),await t(e,a),n.record({kind:`tool`,title:`Called: owi_similar`,detail:JSON.stringify({id:i.id})}),await t(e,a);let o=`[[${i.id}]]`,s={parts:[{text:r.mode===`investigate`?`${o} is ${i.status??`open`}. This is the sample's canned report; a real run reads the Toil project's sources and cites each one.`:`${o}: the sample's canned ${r.mode} run. A real run would ${r.mode===`refine`?`draft criteria and an estimate`:`clone the repository and stage a change`}.`}],citations:[i.id],unverified:[],warnings:[]};return{report:s,proposals:r.mode===`refine`&&i.source.area===`jira`?ys(r.toilProject,i):r.mode===`investigate`&&i.source.area===`jira`?[{id:`agent:${i.id}:comment:report`,from:`agent`,item:i.id,title:`Post the report as a comment on ${i.source.key}`,reason:`The investigation above, as one comment.`,command:`jira issue comment`,input:{toilProject:r.toilProject,key:i.source.key,body:s.parts[0].text.replace(/\[\[([^\]]+)\]\]/g,`$1`)},note:null}]:[],questions:r.mode===`refine`?[`Is this sample question answered by the item itself?`]:[],injection:null,usage:_t(r.id,1,r.toilProject),startedOn:_s(i.id,r.adapter,Po,vs),branch:r.mode===`implement`?{name:je(i),repo:r.repo??`payments-core`,folder:`~/.toil-ui/cache/work/${r.id}`,onBranch:!0,files:[{path:`src/sample.ts`,status:`staged`}],hidden:[],cut:!1,diff:`--- a/src/sample.ts
23
+ +++ b/src/sample.ts
24
+ @@ -1 +1 @@
25
+ -// before
26
+ +// after (sample)`}:null}}}}var Ss=e=>{let t=new Map(e.map(e=>[e.id,e]));return{load:()=>[...t.values()].map(e=>structuredClone(e)),save:e=>void t.set(e.id,structuredClone(e))}},Cs=e=>({ok:!1,data:null,error:{code:`WRITE_DISABLED`,message:`This is sample data, so toil ${e} wasn't run: there is no tracker to change.`,fix:`Start toil-ui on your own Toil projects to apply proposals.`},meta:{command:e,durationMs:0,version:`sample`,contractVersion:1}});function ws(e=qo().execute,t={}){let n=new Map,r=0,i=Date.now(),a=()=>new Date(Date.parse(Po)+(Date.now()-i)).toISOString(),o;return{get queue(){return o},ready:(async()=>{for(let t of[`card-payments`,`settlement`,`checkout-web`])n.set(t,await $e(e,t));o=new cs({keeper:Ss(bs(n.get(`card-payments`))),runner:xs(t.delay),items:e=>(n.get(e)?.items??null)?.map(e=>e.id===fs.item?{...e,labels:[...e.labels,fs.label]}:e)??null,people:async e=>n.get(e)?.people??[],repos:async e=>e===`card-payments`?[{name:`payments-core`,path:`~/src/payments-core`}]:[],apply:async(e,t)=>Cs(t.command??`that`),settings:()=>ds,current:()=>hs,...t.restartNeeded?{restartNeeded:t.restartNeeded}:{},now:t.now??a,newId:()=>`sample-new-${String(++r).padStart(8,`0`)}`,sample:!0})})()}}function Ts(e={}){let t=ws(qo().execute,e),n=async()=>(await t.ready,t.queue);return{disabled:null,list:async(e,t)=>(await n()).list(e,t),get:async e=>(await n()).read(e),assign:async e=>(await n()).assign(e),start:async(e,t)=>(await n()).start(e,t),cancel:async e=>(await n()).cancel(e),apply:async(e,t)=>(await n()).apply(e,t),dismiss:async(e,t)=>(await n()).dismiss(e,t),finish:async e=>(await n()).finish(e),renew:async e=>(await n()).renew(e),async events(e,t,r){let i=(await n()).subscribe(t);await new Promise(e=>r.aborted?e():r.addEventListener(`abort`,()=>e(),{once:!0})),i()}}}var Es={scheme:{name:`ktlo-feature`,revision:1},toilProject:null,ledger:{lines:168,verdicts:146,corrections:10,confirmations:12,items:146},agreement:{overall:.545,checked:22,byCategory:[{category:`ktlo`,checked:7,confirmed:1,agreement:.143},{category:`feature`,checked:15,confirmed:11,agreement:.733}],byRevision:[{revision:1,checked:22,confirmed:12,agreement:.545}]},sources:[{source:`signal:type`,checked:4,confirmed:0,overruled:4,overruledTo:{feature:4},agreement:0},{source:`parent`,checked:14,confirmed:12,overruled:2,overruledTo:{ktlo:2},agreement:.857},{source:`label`,checked:2,confirmed:0,overruled:2,overruledTo:{ktlo:2},agreement:0},{source:`signal:bot-author`,checked:1,confirmed:0,overruled:1,overruledTo:{feature:1},agreement:0},{source:`signal:title`,checked:1,confirmed:0,overruled:1,overruledTo:{feature:1},agreement:0}],confusion:[{from:`ktlo`,to:`feature`,count:6},{from:`feature`,to:`ktlo`,count:4}],sinceLastTune:10,changedTwice:[],byDoor:{cli:10,mcp:0,api:0,tracker:0}},Ds=[`Fixes a bug, but it adds a new export format, so it is new work.`,`A security patch that also unlocks a new payment method.`,`It is a build upgrade, and customers see nothing new.`,`The epic is new functionality, so its tasks are too.`];function Os(e=k.owi.items,t=r()){let n=Ge({scheme:t,items:[...e]}).result,i=e=>new Date(Date.parse(_)-(20-e)*36e5).toISOString(),a={toilProject:`sample-team`,scheme:t.name,revision:t.revision},o=n.verdicts.map((e,t)=>({kind:`verdict`,at:i(0+t%2),item:e.id,title:e.title,category:e.category,source:e.source,...a})),s=new Set(e.map(e=>e.parent)),c=e=>n.verdicts.filter(t=>t.category!==null&&!s.has(t.id)&&e(t.source)),l=e=>e===`ktlo`?`feature`:`ktlo`,u=[...c(e=>e===`signal:type`).slice(0,4),...c(e=>e===`signal:bot-author`).slice(0,1),...c(e=>e===`parent`).slice(0,2),...c(e=>e===`signal:title`).slice(0,1),...c(e=>e===`label`).slice(0,2)];u.forEach((e,t)=>{o.push({kind:`correction`,at:i(2+t),item:e.id,title:e.title,from:e.category,fromSource:e.source,to:l(e.category),confirmed:!1,via:`cli`,by:null,reason:Ds[t%Ds.length],...a})});let d=new Set(u.map(e=>e.id));return c(e=>e===`signal:type`||e===`parent`||e===`label`||e===`signal:security-id`).filter(e=>!d.has(e.id)).slice(0,12).forEach((e,t)=>o.push({kind:`correction`,at:i(14+t%5),item:e.id,title:e.title,from:e.category,fromSource:e.source,to:e.category,confirmed:!0,via:`cli`,by:null,reason:null,...a})),o}function ks(e){let t={};for(let n of e)n.kind===`correction`&&(t[n.item]={category:n.to===`unsure`?null:n.to,reason:n.reason});return t}var As=(e=12)=>new Promise(t=>setTimeout(t,e));function js(e,t){return/upgrade|patch|bump|outage|security|incident|certificate|rotate/i.test(t)?{id:e,category:`ktlo`,reason:`"${t}" keeps something running or safe rather than adding anything.`}:/print|label|warehouse/i.test(t)?{id:e,category:re,reason:`It could be tooling for the warehouse or something customers use; nothing in the title says which.`}:{id:e,category:`feature`,reason:`"${t}" adds something customers can use.`}}function Ms(e){return{...e,guidance:[...e.guidance,`A bug fix that adds a new capability for customers is Feature; one that restores what already worked is KTLO.`],examples:[...e.examples,{item:`sample-jira:SHOP-40`,title:`Fix the export, and add CSV`,category:`feature`,why:`It adds a format.`}],rules:[...e.rules,{id:`new-exports`,when:{title:[`export`]},then:`feature`}]}}var Ns={};function Ps(){let e=r(),t=Os(),n=()=>({scheme:e,kept:`built-in`,stats:Es,standing:ks(t),notes:[]}),i=n=>{let r=Ge({scheme:e,items:n.items,targets:Ns,recheck:!0,person:_e(ks(t))}).result,i=new Map(n.items.map(e=>[e.id,e]));return{id:`sample-plan`,groups:r.plan.map(e=>({area:e.area,connection:e.connection,writes:!1,command:{name:e.area===`ado`?`ado work-item categorize`:`${e.area} issue categorize`,input:{connection:e.connection,inputFile:`plan.json`}},changes:e.items.map(t=>{let n=i.get(t.id),r=new Set(Object.values(e.labels).map(e=>e.toLowerCase()));return{id:t.id,key:t.key,title:n.title,category:t.category,labelsFrom:n.labels.filter(e=>r.has(e.toLowerCase())),labelsAdd:t.labels.add,labelsRemove:t.labels.remove,field:null}})})),notes:[]}};return{disabled:We,movesDisabled:We,moveItem:async()=>a,ledger:async()=>(await As(),n()),correct:async(n,{item:r,to:i,reason:a})=>{await As(),t.push({kind:`correction`,at:new Date(Date.parse(_)+t.length*1e3).toISOString(),item:r.id,title:r.title,from:null,fromSource:null,to:i??`unsure`,confirmed:!1,via:`cli`,by:null,reason:a||null,toilProject:`sample-team`,scheme:e.name,revision:e.revision})},agents:async()=>[{name:`scripted`,label:`The sample agent (a script, not a model)`,ready:!0,problem:null}],ask:async(e,t)=>(await As(400),{by:`a scripted sample, not a model`,answers:t.map(e=>js(e.id,e.title)),omitted:0,warnings:[]}),plan:async(e,t)=>(await As(),i(t)),apply:async()=>{throw Error(We)},tune:async()=>{await As(600);let t=Ms(e);return{id:`sample-revision`,by:`a scripted sample, not a model`,before:e,after:{...t,revision:e.revision},changes:Re(e,t),backtest:{heldBack:4,before:{agreed:1,agreement:.25},after:{agreed:3,agreement:.75},worse:!1},warnings:[]}},applyRevision:async()=>{throw Error(We)},saveScheme:async()=>{throw Error(We)}}}var Fs=JSON.parse(`[{"name":"ado","description":"Azure DevOps Server and Azure DevOps Services: work items, boards, sprints, repositories, pull requests and pipelines","connection":[{"name":"baseUrl","description":"Server: the root, e.g. https://ado.imagile.dev (keep any /tfs prefix). Services: the organization URL, https://dev.azure.com/<organization> (or https://<organization>.visualstudio.com)","secret":false,"password":false,"default":null,"required":true,"choices":{"options":[{"label":"Your Azure DevOps organization","value":null,"when":{"deployment":"cloud"},"compose":{"prefix":"https://dev.azure.com/","label":"Organization","placeholder":"example-org"}},{"label":"Your Azure DevOps Server","value":null,"when":{"deployment":"server"},"placeholder":"https://ado.imagile.dev"}]}},{"name":"deployment","description":"Which Azure DevOps this is: \\"server\\" for Azure DevOps Server (the default), or \\"cloud\\" for Azure DevOps Services","secret":false,"password":false,"default":"server","required":false,"choices":{"question":"Which one is it?","required":true,"options":[{"label":"Services (cloud)","value":"cloud","hosts":["dev.azure.com","*.visualstudio.com"]},{"label":"Server","value":"server"}]}},{"name":"collection","description":"Server only: default collection, when --collection isn't given","secret":false,"password":false,"default":null,"required":false,"appliesTo":["server"]},{"name":"project","description":"Default team project, when --project isn't given","secret":false,"password":false,"default":null,"required":false},{"name":"repo","description":"Default git repository, when --repo isn't given","secret":false,"password":false,"default":null,"required":false},{"name":"team","description":"Services only: default team for the board, backlog and sprint commands, when --team isn't given (else the project's default team)","secret":false,"password":false,"default":null,"required":false,"appliesTo":["cloud"]},{"name":"fieldAliases","description":"Work item field aliases, friendly name to reference name (e.g. {\\"storypoints\\": \\"Microsoft.VSTS.Scheduling.StoryPoints\\"})","secret":false,"password":false,"default":null,"required":false},{"name":"discoveredFields","description":"Server only: work item fields recorded by an earlier discovery; kept, not read","secret":false,"password":false,"default":null,"required":false,"appliesTo":["server"]},{"name":"discoveredTypes","description":"Server only: work item types recorded by an earlier discovery; kept, not read","secret":false,"password":false,"default":null,"required":false,"appliesTo":["server"]},{"name":"pat","description":"Personal access token. Services: an organization-scoped one","secret":true,"password":false,"default":null,"required":true}],"variantBy":"deployment"},{"name":"bitbucket","description":"Bitbucket Data Center and Bitbucket Cloud: repositories, branches, tags, commits, files, pull requests, comments, reviewers, build statuses and Pipelines","connection":[{"name":"baseUrl","description":"Bitbucket root: the Data Center server (https://bitbucket.imagile.dev), or the Cloud REST API root (https://api.bitbucket.org/2.0)","secret":false,"password":false,"default":null,"required":true,"choices":{"options":[{"label":"Bitbucket Cloud (https://api.bitbucket.org/2.0)","value":"https://api.bitbucket.org/2.0","when":{"deployment":"cloud"}},{"label":"Your Bitbucket server","value":null,"when":{"deployment":"server"},"placeholder":"https://bitbucket.imagile.dev"}]}},{"name":"deployment","description":"Which Bitbucket this is: \\"server\\" for Data Center (the default), or \\"cloud\\" for Bitbucket Cloud","secret":false,"password":false,"default":"server","required":false,"choices":{"question":"Which one is it?","required":true,"options":[{"label":"Cloud","value":"cloud","hosts":["bitbucket.org","api.bitbucket.org"]},{"label":"Data Center","value":"server"}]}},{"name":"email","description":"Bitbucket Cloud only: the email address of the Atlassian account an API token belongs to (with apiToken)","secret":false,"password":false,"default":null,"required":false,"appliesTo":["cloud"]},{"name":"project","description":"Data Center: default project key","secret":false,"password":false,"default":null,"required":false,"appliesTo":["server"]},{"name":"workspace","description":"Bitbucket Cloud: default workspace slug","secret":false,"password":false,"default":null,"required":false,"appliesTo":["cloud"]},{"name":"repo","description":"Default repository slug","secret":false,"password":false,"default":null,"required":false},{"name":"targetBranch","description":"Data Center: default target branch for pr create (main when unset)","secret":false,"password":false,"default":null,"required":false,"appliesTo":["server"]},{"name":"pat","description":"Data Center: an HTTP access token","secret":true,"password":false,"default":null,"required":false,"appliesTo":["server"],"requiredFor":["server"]},{"name":"apiToken","description":"Bitbucket Cloud only: an Atlassian API token with Bitbucket scopes, sent as Basic auth with email","secret":true,"password":false,"default":null,"required":false,"appliesTo":["cloud"]},{"name":"accessToken","description":"Bitbucket Cloud only: a workspace, project or repository access token, sent as Bearer","secret":true,"password":false,"default":null,"required":false,"appliesTo":["cloud"]}],"variantBy":"deployment"},{"name":"confluence","description":"Confluence Data Center and Confluence Cloud: pages, spaces, CQL search, comments, labels and attachments","connection":[{"name":"baseUrl","description":"Confluence root: the Data Center server (https://confluence.imagile.dev), or the Cloud site without /wiki (https://<your-site>.atlassian.net)","secret":false,"password":false,"default":null,"required":true,"choices":{"options":[{"label":"Your Atlassian site","value":null,"when":{"deployment":"cloud"},"compose":{"prefix":"https://","suffix":".atlassian.net","label":"Site name","placeholder":"example-site"}},{"label":"Your Confluence server","value":null,"when":{"deployment":"server"},"placeholder":"https://confluence.imagile.dev"}]}},{"name":"deployment","description":"Which Confluence this is: \\"server\\" for Data Center (the default), or \\"cloud\\" for Confluence Cloud","secret":false,"password":false,"default":"server","required":false,"choices":{"question":"Which one is it?","required":true,"options":[{"label":"Cloud","value":"cloud","hosts":["*.atlassian.net"]},{"label":"Data Center","value":"server"}]}},{"name":"email","description":"Confluence Cloud only: the email address of the Atlassian account the API token belongs to","secret":false,"password":false,"default":null,"required":false,"appliesTo":["cloud"],"requiredFor":["cloud"]},{"name":"apiTokenFrom","description":"The jira connection to take apiToken from when this connection has none","secret":false,"password":false,"default":null,"required":false,"borrows":{"area":"jira","key":"apiToken","when":{"deployment":"cloud"},"sameHost":true,"match":["email"]}},{"name":"apiToken","description":"Data Center: a personal access token. Cloud: an Atlassian account API token","secret":true,"password":false,"default":null,"required":true}],"variantBy":"deployment"},{"name":"github","description":"GitHub and GitHub Enterprise Server: pull requests, reviews, comments, checks, labels, assignees, issues and projects","connection":[{"name":"baseUrl","description":"REST API root: https://api.github.com, or https://ghe.imagile.dev/api/v3 for Enterprise Server","secret":false,"password":false,"default":null,"required":true,"choices":{"question":"Which GitHub is it?","options":[{"label":"GitHub.com (https://api.github.com)","value":"https://api.github.com","hosts":["api.github.com"]},{"label":"GitHub Enterprise Server","value":null,"placeholder":"https://ghe.imagile.dev/api/v3","expectPath":"/api/v3"}]}},{"name":"owner","description":"Default owner (user or org)","secret":false,"password":false,"default":null,"required":false},{"name":"repo","description":"Default repository name","secret":false,"password":false,"default":null,"required":false},{"name":"targetBranch","description":"Default base branch for pr create (main when unset)","secret":false,"password":false,"default":null,"required":false},{"name":"token","description":"Personal access token, classic (ghp_...) or fine-grained (github_pat_...)","secret":true,"password":false,"default":null,"required":true}],"scopes":{"secret":"token","otherPrefixes":{"gho_":"an OAuth token","ghu_":"an app user token","ghs_":"an app installation token","ghr_":"an app refresh token"},"kinds":[{"id":"classic","label":"Classic token","tokenPrefix":"ghp_","summary":"The common kind: one token, scopes ticked on one page, works on every repository you can reach.","createUrl":"https://github.com/settings/tokens/new","readOnly":{"needs":["repo","read:project"],"createUrl":"https://github.com/settings/tokens/new?scopes=repo,read:project&description=toil"},"everything":{"needs":["repo","read:project","project"],"createUrl":"https://github.com/settings/tokens/new?scopes=repo,read:project,project&description=toil"},"entries":[{"name":"repo","required":"read","commands":["github pr list","github pr get","github pr diff","github pr files","github pr comments","github pr review-comments","github pr reviews","github pr reviewers","github pr threads","github pr status","github pr create","github pr update","github pr close","github pr reopen","github pr draft","github pr ready","github pr merge","github pr comment","github pr comment-inline","github pr reply","github pr delete-comment","github pr delete-review-comment","github pr approve","github pr request-changes","github pr add-reviewers","github pr remove-reviewers","github pr resolve","github pr enable-auto-merge","github pr disable-auto-merge","github pr enqueue","github issue list","github issue search","github issue get","github issue history","github milestone list","github issue create","github issue label","github issue unlabel","github issue categorize","github issue assign","github issue unassign","github issue close","github issue reopen","github repo file","github repo create","github commit status","github commit checks","github check-toil-project"],"note":"GitHub has no read-only form of repo. toil's own write gate keeps it read-only until you turn writes on. Public repositories alone need only public_repo."},{"name":"read:project","required":"read","commands":["github project list","github project fields","github project items"],"note":"Reading Projects (v2)."},{"name":"project","required":"write","commands":["github project status","github project add","github issue categorize"],"note":"Adding an item to a project, changing its Status, or the field issue categorize sets (needed only when the plan names a field). It includes read:project."}]},{"id":"fine-grained","label":"Fine-grained token","tokenPrefix":"github_pat_","summary":"Limited to the repositories you pick, with each permission set to Read or Read and write. Cannot read your own account-level Projects.","createUrl":"https://github.com/settings/personal-access-tokens/new","readOnly":{"needs":["Metadata: Read","Pull requests: Read","Contents: Read","Issues: Read","Checks: Read","Commit statuses: Read","Projects (organization permission): Read"],"createUrl":"https://github.com/settings/personal-access-tokens/new"},"everything":{"needs":["Metadata: Read","Pull requests: Read and write","Contents: Read and write","Issues: Read and write","Checks: Read","Commit statuses: Read","Projects (organization permission): Read and write","Administration: Read and write"],"createUrl":"https://github.com/settings/personal-access-tokens/new"},"entries":[{"name":"Metadata","access":"read","required":"read","commands":["github check-toil-project"],"note":"GitHub grants it to every fine-grained token."},{"name":"Pull requests","access":"read","required":"read","commands":["github pr list","github pr get","github pr diff","github pr files","github pr comments","github pr review-comments","github pr reviews","github pr reviewers","github pr threads","github pr status"]},{"name":"Pull requests","access":"write","required":"write","commands":["github pr create","github pr update","github pr close","github pr reopen","github pr draft","github pr ready","github pr merge","github pr comment","github pr comment-inline","github pr reply","github pr delete-comment","github pr delete-review-comment","github pr approve","github pr request-changes","github pr add-reviewers","github pr remove-reviewers","github pr resolve","github pr enable-auto-merge","github pr disable-auto-merge","github pr enqueue"]},{"name":"Contents","access":"read","required":"read","commands":["github repo file"]},{"name":"Contents","access":"write","required":"write","commands":["github pr merge","github pr enable-auto-merge","github pr enqueue"],"note":"Merging a pull request needs Contents as well as Pull requests."},{"name":"Issues","access":"read","required":"read","commands":["github issue list","github issue search","github issue get","github issue history","github milestone list"]},{"name":"Issues","access":"write","required":"write","commands":["github issue create","github issue label","github issue unlabel","github issue categorize","github issue assign","github issue unassign","github issue close","github issue reopen"]},{"name":"Checks","access":"read","required":"read","commands":["github commit checks","github pr get","github pr status"],"note":"pr get needs it only with --include checks."},{"name":"Commit statuses","access":"read","required":"read","commands":["github commit status","github pr status"]},{"name":"Projects (organization permission)","access":"write","required":"write","commands":["github project status","github project add","github issue categorize"],"note":"Adding an item to a project, changing its Status, or the field issue categorize sets (needed only when the plan names a field). Only an organization's projects."},{"name":"Projects (organization permission)","access":"read","required":"read","commands":["github project list","github project fields","github project items"],"note":"Only an organization's projects. A fine-grained token can't read a user's own; use a classic token for those."},{"name":"Administration","access":"write","required":"write","commands":["github repo create"],"note":"For a repository under an organization. GitHub may refuse a fine-grained token for one under your own account; use a classic token for that."}]}]}},{"name":"jenkins","description":"Jenkins: jobs, builds, console logs and the build queue","connection":[{"name":"baseUrl","description":"Jenkins server root, e.g. https://jenkins.imagile.dev","secret":false,"password":false,"default":null,"required":true},{"name":"username","description":"Jenkins user name the API token belongs to","secret":false,"password":false,"default":null,"required":true},{"name":"instance","description":"The name --instance selects this connection by, when it isn't the connection's own name","secret":false,"password":false,"default":null,"required":false},{"name":"apiToken","description":"Jenkins API token","secret":true,"password":false,"default":null,"required":true}]},{"name":"jira","description":"Jira Data Center and Jira Cloud: issues, JQL search, transitions, comments, worklogs, attachments, custom fields, projects, users, boards and sprints","connection":[{"name":"baseUrl","description":"Jira root: the Data Center server (https://jira.imagile.dev), or the Cloud site (https://<your-site>.atlassian.net)","secret":false,"password":false,"default":null,"required":true,"choices":{"options":[{"label":"Your Atlassian site","value":null,"when":{"deployment":"cloud"},"compose":{"prefix":"https://","suffix":".atlassian.net","label":"Site name","placeholder":"example-site"}},{"label":"Your Jira server","value":null,"when":{"deployment":"server"},"placeholder":"https://jira.imagile.dev"}]}},{"name":"deployment","description":"Which Jira this is: \\"server\\" for Data Center (the default), or \\"cloud\\" for Jira Cloud","secret":false,"password":false,"default":"server","required":false,"choices":{"question":"Which one is it?","required":true,"options":[{"label":"Cloud","value":"cloud","hosts":["*.atlassian.net"]},{"label":"Data Center","value":"server"}]}},{"name":"email","description":"Jira Cloud only: the email address of the Atlassian account the API token belongs to","secret":false,"password":false,"default":null,"required":false,"appliesTo":["cloud"],"requiredFor":["cloud"]},{"name":"customFields","description":"Custom fields addressable by friendly name","secret":false,"password":false,"default":null,"required":false},{"name":"project","description":"Default project key for issue create","secret":false,"password":false,"default":null,"required":false},{"name":"issueType","description":"Default issue type for issue create (Task when unset)","secret":false,"password":false,"default":null,"required":false},{"name":"priority","description":"Default priority for issue create","secret":false,"password":false,"default":null,"required":false},{"name":"apiToken","description":"Data Center: a personal access token. Cloud: an Atlassian account API token","secret":true,"password":false,"default":null,"required":true}],"variantBy":"deployment"},{"name":"openshift","description":"OpenShift and Kubernetes: pods, deployments, events, logs and resource usage","connection":[{"name":"baseUrl","description":"API server URL, e.g. https://openshift.imagile.dev","secret":false,"password":false,"default":null,"required":false},{"name":"env","description":"Environment name that --env selects this cluster by, e.g. prod","secret":false,"password":false,"default":null,"required":false},{"name":"instance","description":"Cluster instance name within the environment that --instance selects this cluster by, e.g. east","secret":false,"password":false,"default":null,"required":false},{"name":"token","description":"Bearer token, typically a service account token","secret":true,"password":false,"default":null,"required":false}]}]`),Is=(e,t)=>e===t||e.startsWith(`${t} `);function Ls(e,t){let n=Date.parse(e.time);return(t.since===void 0||n>=t.since.getTime())&&(t.until===void 0||n<t.until.getTime())&&(t.area===void 0||e.area===t.area)&&(t.command===void 0||Is(e.command,t.command))&&(t.connection===void 0||e.connection===t.connection)&&(t.caller===void 0||e.caller===t.caller)&&(t.outcome===void 0||(t.outcome===`failed`?e.outcome!==`ok`:e.outcome===t.outcome))&&(t.writesOnly!==!0||e.writes===!0)}var Rs={INVALID_INPUT:`Check the arguments against toil <command> --help; the call was refused before anything ran.`,NOT_CONFIGURED:`Add the connection or setting the command needs (toil connections add), or set its env var.`,CONFIG_INVALID:`Fix the config file the error named; toil connections list shows which file is read.`,AUTH:`Replace the connection's credential with toil connections login <name>, then check it with toil connections test <name>.`,NOT_FOUND:`Check the id, key or path the call named, and that the connection can see it.`,HTTP:`The service refused the request. Run the call again to read the service's own message.`,NETWORK:`Check the host is reachable from this machine and the proxy settings, with toil connections test <name>.`,WRITE_DISABLED:`A write needs writes: true on the connection, set by a person, and --allow-write on the call.`,TIMEOUT:`Narrow the call (a smaller page, a tighter filter), or raise TOIL_TIMEOUT_MS.`,CANCELLED:`The call was cancelled by the person or the client; nothing to fix unless that was unintended.`,DATABASE:`The database refused the statement. Run it again to read the database's own message.`,CREDENTIAL_STORE:`Check the OS credential store is available, or set the secret's env var instead.`,UNSUPPORTED_NODE:`Install Node 24.22.1 or later on 24.x, or 26.12.1 or later (CVE-2026-111497).`,GIT_NOT_FOUND:`Install git 2.24 or later and put it on PATH.`,UNSUPPORTED:`The server's release, or the connection's deployment, doesn't have what the command needs; check the area's supported versions, or use a connection of the deployment that does.`,INTERNAL:`This is a bug in toil. Report it with toil feedback bug, naming the command.`},zs=e=>Object.hasOwn(Rs,e)?Rs[e]:null;function Bs(e,t){if(t===`day`)return e.time.slice(0,10);let n=e[t];return n==null?null:String(n)}var Vs=(e,t)=>e[Math.max(0,Math.ceil(t*e.length)-1)]??0,Hs=class{calls=0;ok=0;writes=0;first=``;last=``;durations=[];codes=new Map;add(e){this.calls++,e.outcome===`ok`?this.ok++:this.codes.set(e.outcome,(this.codes.get(e.outcome)??0)+1),e.writes===!0&&this.writes++,this.durations.push(typeof e.durationMs==`number`?e.durationMs:0),(this.first===``||e.time<this.first)&&(this.first=e.time),e.time>this.last&&(this.last=e.time)}figures(){let e=this.durations.sort((e,t)=>e-t),t=[...this.codes].sort((e,t)=>t[1]-e[1]||(e[0]<t[0]?-1:1)).slice(0,3).map(([e,t])=>({code:e,count:t,fix:zs(e)}));return{calls:this.calls,ok:this.ok,failed:this.calls-this.ok,errors:t,durationMs:{median:Vs(e,.5),p95:Vs(e,.95)},writes:this.writes,writeShare:this.calls===0?0:Math.round(this.writes/this.calls*1e3)/1e3,firstSeen:this.first,lastSeen:this.last}}};function Us(e,t){let n=new Hs,r=new Map;for(let i of e){if(n.add(i),t.length===0)continue;let e=t.map(e=>Bs(i,e)),a=JSON.stringify(e),o=r.get(a);o||r.set(a,o={key:e,tally:new Hs}),o.tally.add(i)}let i=e=>e.map(e=>e??``).join(`\0`),a=[...r.values()].sort((e,n)=>t[0]===`day`?i(e.key)<i(n.key)?-1:1:n.tally.calls-e.tally.calls||(i(e.key)<i(n.key)?-1:1));return{totals:n.figures(),groups:a.map(({key:e,tally:n})=>({...Object.fromEntries(t.map((t,n)=>[t,e[n]])),...n.figures()}))}}var Ws=`2026-09-19T00:00:00.000Z`,Gs=`2026-10-19T00:00:00.000Z`,Ks=[{command:`jira issue get`,area:`jira`,connection:`corp-jira`,weight:30,fails:[[`NOT_FOUND`,.06]],ms:180},{command:`jira issue search`,area:`jira`,connection:`corp-jira`,weight:18,fails:[[`INVALID_INPUT`,.08],[`TIMEOUT`,.02]],ms:420},{command:`github pr list`,area:`github`,connection:`github`,weight:14,ms:260},{command:`github pr get`,area:`github`,connection:`github`,weight:10,fails:[[`AUTH`,.12]],ms:230},{command:`ado work-item get`,area:`ado`,connection:`corp-ado`,weight:9,fails:[[`NETWORK`,.1],[`AUTH`,.04]],ms:340},{command:`jira issue comment`,area:`jira`,connection:`corp-jira`,weight:3,fails:[[`WRITE_DISABLED`,.3]],ms:210,writes:!0},{command:`projects list`,area:null,connection:null,weight:6,ms:12},{command:`connections list`,area:null,connection:null,weight:4,ms:9}],qs=[{via:`api`,caller:`toil-ui`,weight:5},{via:`mcp`,weight:4},{via:`cli`,weight:2}];function Js(e){let t=e;return()=>{t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function Ys(e,t){let n=t*e.reduce((e,t)=>e+t.weight,0);for(let t of e)if((n-=t.weight)<0)return t;return e[e.length-1]}function Xs(){let e=Js(309),t=[],n=Date.parse(Ws);for(let r=0;r<30;r++){let i=new Date(n+r*864e5).getUTCDay()%6==0,a=Math.round((i?3:14)+e()*(i?4:22));for(let i=0;i<a;i++){let i=Ys(Ks,e()),a=Ys(qs,e()),o=`ok`,s=e(),c=0;for(let[e,t]of i.fails??[])o===`ok`&&s<(c+=t)&&(o=e);let l=new Date(n+r*864e5+Math.floor(e()*864e5)).toISOString();t.push({time:l,via:a.via,...a.caller?{caller:a.caller}:{},command:i.command,area:i.area,connection:i.connection,writes:i.writes===!0,allowWrite:i.writes===!0&&o===`ok`,outcome:o,durationMs:Math.round(i.ms*(.5+e()*1.5)*(e()<.05?6:1)),input:null,requests:[]})}}return t.sort((e,t)=>e.time<t.time?-1:1)}var Zs=(e,t)=>({window:{since:Ws,until:Gs},by:t,...Us(e,t)});function Qs(){let e=Xs(),t=Zs(e,[`command`,`caller`]);return[{command:`audit stats`,input:{...he.days,by:[...he.days.by]},data:Zs(e,[`day`,`caller`])},{command:`audit stats`,input:{...he.commands,by:[...he.commands.by]},data:t},{command:`audit stats`,input:{...he.doors,by:[...he.doors.by]},data:Zs(e,[`via`,`caller`])},...[...new Set(t.groups.filter(e=>e.failed>0).map(e=>e.command??``))].map(t=>{let n=ve(t);return{command:`audit list`,input:n,data:e.filter(e=>Ls(e,n)).reverse().slice(0,n.limit)}})]}var $s=`0.1.0-alpha.1`,ec=`/home/you/.toil/config.json`,tc=`This is the preview, on sample data: it has no configuration of yours to change, so every action here is turned off. In Toil UI on your own machine, these run toil's own commands.`,nc=Fs,rc={configFile:ec,connections:[{name:`corp-ado`,area:`ado`,isDefault:!0,host:`ado.imagile.dev`,writes:!1,values:{baseUrl:`file`,collection:`file`,pat:`store`},definedIn:`file`},{name:`corp-bitbucket`,area:`bitbucket`,isDefault:!0,host:`bitbucket.imagile.dev`,writes:!1,values:{baseUrl:`file`,pat:`store`},definedIn:`file`},{name:`corp-jenkins`,area:`jenkins`,isDefault:!0,host:`jenkins.imagile.dev`,writes:!1,values:{baseUrl:`file`,username:`file`,apiToken:`store`},definedIn:`file`},{name:`corp-jira`,area:`jira`,isDefault:!0,host:`jira.imagile.dev`,writes:!0,values:{baseUrl:`file`,apiToken:`store`,writes:`file`},definedIn:`file`},{name:`github`,area:`github`,isDefault:!0,host:`ghe.imagile.dev`,writes:!1,values:{baseUrl:`env`,token:`ci`},definedIn:`env`},{name:`ocp-nonprod`,area:`openshift`,isDefault:!0,host:`api.ocp-nonprod.imagile.dev:6443`,writes:!1,values:{baseUrl:`file`,env:`file`,token:`store`},definedIn:`file`},{name:`ocp-prod`,area:`openshift`,isDefault:!1,host:`api.ocp-prod.imagile.dev:6443`,writes:!1,values:{baseUrl:`file`,env:`file`,token:`store`},definedIn:`file`}]},ic={ado:`GET /DefaultCollection/_apis/connectionData`,bitbucket:`GET /rest/api/1.0/profile/recent/repos`,jenkins:`GET /me/api/json`,jira:`GET /rest/api/2/myself`,github:`GET /user`,openshift:`GET /api/v1`},ac={toilProject:{name:`checkout-web`,source:`repo`,file:`/home/you/code/payments-web/.toil/projects/checkout-web.json`},ownCopy:null,plan:!0,ok:!1,areas:[{area:`github`,env:null,path:`github`,selects:{host:`ghe.imagile.dev`},status:`matched`,connection:`github`,test:{ok:!0,request:ic.github,live:!0}},{area:`bitbucket`,env:null,path:`bitbucket`,selects:{host:`bitbucket-sdk.imagile.dev`},status:`missing`,connection:null,problem:{code:`NOT_CONFIGURED`,message:`You have no bitbucket connection on bitbucket-sdk.imagile.dev.`,fix:`Run toil projects onboard checkout-web in a terminal, or toil connections add bitbucket --area bitbucket with a base URL on bitbucket-sdk.imagile.dev (https://bitbucket-sdk.imagile.dev).`},suggest:{name:`bitbucket`,baseUrl:`https://bitbucket-sdk.imagile.dev`},test:null},{area:`openshift`,env:`staging`,path:`environments.staging.openshift`,selects:{host:`api.ocp-nonprod.imagile.dev:6443`},status:`matched`,connection:`ocp-nonprod`,test:{ok:!0,request:ic.openshift,live:!0}},{area:`openshift`,env:`prod`,path:`environments.prod.openshift`,selects:{host:`api.ocp-prod.imagile.dev:6443`},status:`matched`,connection:`ocp-prod`,test:{ok:!0,request:ic.openshift,live:!0}}],check:{ok:!1,problems:[{level:`error`,code:`TOIL_PROJECT_HOST_UNMATCHED`,path:`bitbucket.host`,message:`Toil project checkout-web uses the bitbucket connection on bitbucket-sdk.imagile.dev, and you have no bitbucket connection with that host.`}]}},oc={current:`crate`,source:`default`,default:`crate`,themes:[[`plain`,`Plain`],[`crate`,`Crate`],[`harvest`,`Harvest`],[`starship`,`Starship`],[`realm`,`Realm`],[`sprawl`,`Sprawl`],[`frontier`,`Frontier`],[`overworld`,`Overworld`]].map(([e,t])=>({name:e,label:t,current:e===`crate`,default:e===`crate`}))},sc={deployment:`cloud`,mode:`sample`,project:`PAY`,issueTypes:[{name:`Story`,id:`10001`,sampled:[`PAY-107`],status:`sampled`,fields:[`customfield_10016`,`customfield_10020`,`customfield_10200`]},{name:`Bug`,id:`10002`,sampled:[`PAY-104`],status:`sampled`,fields:[`customfield_10200`]},{name:`Epic`,id:`10003`,sampled:null,status:`no-sample`,fields:null}],fields:[{id:`customfield_10016`,name:`Story point estimate`,schema:{type:`number`,custom:`com.atlassian.jira.plugin.system.customfieldtypes:float`},example:`3`,issueTypes:[`Story`],alias:`storyPointEstimate`,owi:{field:`estimate`,confidence:`high`,why:`a number named "Story point estimate", where Jira keeps story points`}},{id:`customfield_10020`,name:`Sprint`,schema:{type:`array`,custom:`com.pyxis.greenhopper.jira:gh-sprint`},example:`Sprint 7 (active)`,issueTypes:[`Story`],alias:`sprint`,owi:{field:`iteration`,confidence:`high`,why:`Jira Software's own Sprint field`}},{id:`customfield_10200`,name:`Crew`,schema:{type:`option`,custom:`com.atlassian.jira.plugin.system.customfieldtypes:select`},example:`Platform`,issueTypes:[`Story`,`Bug`],alias:`crew`,owi:null}],commands:[`toil projects field <toil-project> jira storyPointEstimate customfield_10016`,`toil projects field <toil-project> jira estimate customfield_10016 --replace`,`toil projects field <toil-project> jira sprint customfield_10020`,`toil projects field <toil-project> jira iteration customfield_10020 --replace`]},cc=[{command:`connections list`,input:{},data:rc},{command:`projects list`,input:{},data:Zi()},{command:`projects list`,input:{archived:!0},data:$i()},...Gi.map(e=>({command:`projects show`,input:{toilProject:e.name},data:Xi(e)})),...Gi.map(e=>({command:`projects check`,input:{toilProject:e.name},data:{name:e.name,file:qi(e.name),source:`user`,ok:!0,problems:[]}})),...rc.connections.map(e=>({command:`connections test`,input:{name:e.name},data:{name:e.name,area:e.area,host:e.host,live:!0,authenticated:!0,request:ic[e.area]??null}})),...Qs(),{command:`jira field discover`,input:{connection:`corp-jira`,project:`PAY`,perType:1},data:sc},{command:`projects onboard`,input:{plan:!0},data:ac},{command:`theme list`,input:{},data:oc},{command:`classify scheme list`,input:{},data:{schemes:se.map(e=>({name:e.name,revision:e.revision,source:`built-in`,categories:e.categories.map(e=>({id:e.id,short:e.short,name:e.name,label:e.label}))}))}},...se.map(e=>({command:`classify scheme show`,input:{name:e.name},data:{scheme:e,source:`built-in`}}))],lc=(e,t)=>e===`projects onboard`&&t.plan===!0&&t.pin===void 0,uc=(e,t)=>e===`audit stats`?Object.fromEntries(Object.entries(t).filter(([e])=>e!==`until`)):t,dc=e=>({command:e,durationMs:0,version:$s,contractVersion:1});function fc(e=cc){let t=new Map(e.map(e=>[Uo(e.command,e.input),e])),n=[],r=new Set(Se);return{disabled:tc,calls:n,areas:async()=>structuredClone(nc),settings:async()=>({timeout:{variable:`TOIL_TIMEOUT_MS`,value:null,effectiveMs:be,defaultMs:be}}),run:async(e,i)=>(n.push({command:e,input:i}),await Promise.resolve(),structuredClone(pc(t,r,e,i)))}}function pc(e,t,n,r){if(!Me.has(n))return{ok:!1,data:null,error:{code:`INVALID_INPUT`,message:`Toil UI doesn't change ${n} from the page.`,fix:`Run toil ${n} on the CLI, where toil's own rules apply.`},meta:dc(n)};if(!t.has(n)&&!lc(n,r))return{ok:!1,data:null,error:{code:`WRITE_DISABLED`,message:`The preview changes nothing, so it wasn't saved.`,fix:`Run Toil UI on your own machine to change your configuration.`},meta:dc(n)};let i=e.get(Uo(n,uc(n,r)));return i?{ok:!0,data:i.data,error:null,meta:dc(n)}:{ok:!1,data:null,error:{code:`INVALID_INPUT`,message:`The preview has no sample answer for ${Uo(n,r)}.`,fix:`Add the call to CONFIG_CANNED in ui/src/fixtures/config.ts.`},meta:dc(n)}}var mc=4e3,hc=254,gc=/[\u0000-\u001f\u007f]+/g,_c=/^[^\s@<>()[\]\\,;:"]+@[^\s@<>()[\]\\,;:"]+\.[^\s@<>()[\]\\,;:"]{2,}$/;function vc(e,t,n){let{kind:r}=e;if(r!==`bug`&&r!==`feature`)throw new g(`INVALID_INPUT`,r===void 0?`Say what kind of report this is: bug or feature.`:`The kind must be bug or feature, not ${JSON.stringify(r)}.`,{fix:`Run toil feedback bug … for something broken, or toil feedback feature … for something you need.`});let i=(e.title??``).replace(gc,` `).trim();if(i.length<1||i.length>120)throw new g(`INVALID_INPUT`,`The title must be 1 to 120 characters; it is ${i.length}.`,{fix:`Pass a one-line summary with --title.`});let a=(e.body??``).replace(/\r\n?/g,`
27
+ `).trim();if(a.length<1||a.length>4e3)throw new g(`INVALID_INPUT`,`The body must be 1 to ${mc} characters; it is ${a.length}.`,{fix:`Pass the details with --body, or as "body" in a JSON file given with --input-file.`});let o=(e.email??``).trim();if(o.length>hc||!_c.test(o))throw new g(`INVALID_INPUT`,o?`${JSON.stringify(o)} isn't an email address.`:`An email address is needed.`,{fix:`Pass yours with --email. It stays private: it is used only to tell you when the issue is filed and when it closes.`});return{kind:r,title:i,body:a,email:o,consent:1,version:t,commit:n}}var yc=`0.1.0-alpha.1`,bc=`abc1234500000000000000000000000000000000`,xc={command:`feedback`,durationMs:0,version:yc,contractVersion:1};function Sc(e,t){try{let n=t=>typeof e[t]==`string`?e[t]:void 0,r=vc({kind:n(`kind`),title:n(`title`),body:n(`body`),email:n(`email`)},yc,bc);return t?{ok:!1,data:null,error:{code:`INVALID_INPUT`,message:`Nothing was sent: this is sample data.`,fix:Be},meta:xc}:{ok:!0,data:{sent:!1,endpoint:le,report:r,consentVersion:1,disclaimer:we,approve:`Tick the box once you have read the report and the disclaimer.`},error:null,meta:{...xc,warnings:[{code:`FEEDBACK_NOT_SENT`,message:`Nothing was sent: this is a preview.`}]}}}catch(e){return{ok:!1,data:null,error:e instanceof g?{code:e.code,message:e.message,...e.fix?{fix:e.fix}:{}}:{code:`INTERNAL`,message:String(e)},meta:xc}}}function Cc(){return{disabled:Be,preview:async e=>Sc({...e},!1),send:async e=>Sc({...e},!0)}}var wc=30,Tc=14,Ec=(e,t)=>`${e}T${t}:00.000Z`;async function Dc(e,t){let n=Ar(),r=n.starters(e),i=null;for(let t of r){let r=await n.ask(e,t.id);(!i||!i.answer.proposals.length&&r.proposals.length)&&(i={label:t.label,answer:r})}if(!i)return null;let a=f({id:`sample-${e}-1`,kind:`ask`,toilProject:e,startedAt:Ec(t,`15:20`),by:`the scripted preview`,prompt:i.label},Ec(t,`15:21`),i.answer),o=a.proposals.find(e=>e.command);return{run:a,applied:o?{[o.id]:{state:`applied`,at:Ec(t,`16:02`),via:`cli`}}:{}}}async function Oc(e,t){let n=c(t),r=ie(n,-1),i=h({items:e.items,changes:e.changes}),a=e.sources.map(e=>e.area),o=[];for(let e=Tc;e>=0;e--){let t=ie(n,-e);for(let n of a)e===2&&n===a[0]&&o.push({area:n,at:Ec(t,`06:40`),ok:!1,error:`toil timed out after 120 s waiting for the server.`}),o.push({area:n,at:Ec(t,e===0?`07:55`:`07:00`),ok:!0,error:null})}let s=new Map(e.items.map(e=>[e.id,e])),l=e.items.find(e=>e.statusCategory!==`DONE`&&e.links.some(e=>e.type===`blocks`&&e.direction===`inward`&&s.get(e.target)?.statusCategory!==`DONE`));if(l){let e=l.links.find(e=>e.type===`blocks`&&e.direction===`inward`&&s.get(e.target)?.statusCategory!==`DONE`).target,t=s.get(e),n=e=>e.replace(/^[^/]+\//,``);i.push({key:`blocker:${l.id}:${e}:${Ec(r,`07:00`)}`,kind:`blocker`,at:Ec(r,`07:00`),subject:l.id,source:l.source.area,label:n(l.source.key),title:l.title,url:l.url,by:null,text:`blocked by [[${e}]]`,cites:[l.id,e],refs:{[l.id]:{label:n(l.source.key),url:l.url},[e]:{label:n(t.source.key),url:t.url}},observed:{previousSync:Ec(ie(r,-1),`07:00`)},who:l.assignee})}let u=await Dc(e.name,r);return{data:e,events:i,runs:u?[u.run]:[],applied:u?.applied??{},notes:[{id:`sample-${e.name}-note`,at:Ec(r,`17:30`),by:`Sample person`,text:`Paired on the retry fix; the review is booked for the morning.`}],syncs:o}}function kc(e=qo().execute,t=Po){let n=new Map,r=r=>(n.has(r)||n.set(r,$e(e,r).then(e=>Oc(e,t))),n.get(r).catch(e=>{throw n.delete(r),new He(e instanceof Error?e.message:String(e),`Pick one of the sample Toil projects.`,404)})),a=c(t),s=e=>[...new Set([...e.events.map(e=>c(e.at)),...e.runs.map(e=>c(e.startedAt)),...e.notes.map(e=>c(e.at)),...e.syncs.map(e=>c(e.at))])].filter(e=>e<=a).sort(),l=(e,n,r)=>u({toilProject:e,day:r,events:n.events,runs:n.runs,applied:n.applied,notes:n.notes,syncs:n.syncs,now:t,retentionDays:wc}),d=e=>{if(!i(e))throw new He(`Name a day as yyyy-mm-dd.`,`Pick one from the calendar.`);if(e>a)throw new He(`${e} hasn't happened yet, so it has no page.`,`Pick today or an earlier day.`);return e},f=async(e,t)=>{let n=l(e,await r(e),d(t));return{page:n,markdown:m(n),file:null}};return{disabled:Ie,async month(e,n){let i=await r(e),o=n??ee(a);if(!Ee(o))throw new He(`Name a month as yyyy-mm.`,`Use the calendar's arrows.`);let c=s(i);return{toilProject:e,month:o,today:a,timeZone:`UTC`,retentionDays:wc,first:c[0]??null,last:c.at(-1)??null,days:c.filter(e=>ee(e)===o).map(n=>({day:n,lines:p(l(e,i,n)),gaps:Oe({day:n,syncs:i.syncs,now:t,retentionDays:wc}).length}))}},day:f,async rebuild(e,t){return{...await f(e,t),same:null}},async addNote(){throw new He(Ie,`Run toil-ui on your own machine to keep notes.`)},async exportTo(e,t){throw new He(Ie,`Run toil-ui on your own machine to export a page.`)},async standup(e,t,n){let i=await r(e),s=ne(t,n,a);if(s)throw new He(s,`Pick the days again, ending today or earlier.`);let c=i.syncs.filter(e=>e.ok).map(e=>e.at).sort().at(-1)??null,u=de({toilProject:e,from:t,to:n,pages:Qe(t,n).map(t=>l(e,i,t)),people:i.data.people,items:i.data.items,pullRequests:i.data.pullRequests,asOf:c,notes:i.data.peopleNotes});return{report:u,markdown:o(u),text:Xe(u)}}}}var Ac=n();function jc({onLeave:e}){let[t]=(0,lt.useState)(()=>({execute:qo().execute,agent:Ar({delay:18}),config:fc(),feedback:Cc(),modelUsage:vt(),assignments:Ts(),worklog:kc(),analyses:es(),classify:Ps()}));return(0,Ac.jsx)(Pe,{...t,now:Po,preview:!0,...e?{onLeaveSample:e}:{}})}export{jc as SampleApp,jc as default};