noskills 4.5.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +497 -18
- package/noskills.js +145 -1
- package/package.json +14 -1
- package/{chunks/ajan-bridge-BNPC757J.js → ts/chunks/ajan-bridge-6UUIUFAV.js} +1 -1
- package/ts/chunks/anthropic-ICVQ5GK6.js +1 -0
- package/ts/chunks/approve-R7MCYHCS.js +1 -0
- package/ts/chunks/ask-GBLFPNFX.js +2 -0
- package/ts/chunks/block-YEKLMXHR.js +1 -0
- package/ts/chunks/cancel-7NS4WM2N.js +1 -0
- package/ts/chunks/chunk-2CLD527I.js +1 -0
- package/ts/chunks/chunk-34AWV7DB.js +1 -0
- package/ts/chunks/chunk-3M26Y3NG.js +27 -0
- package/{chunks/chunk-J25XTDQQ.js → ts/chunks/chunk-3QVRJO3V.js} +1 -1
- package/ts/chunks/chunk-5ALJRBMW.js +22 -0
- package/ts/chunks/chunk-5NMDE2VZ.js +4 -0
- package/ts/chunks/chunk-6BKTY7SA.js +4 -0
- package/ts/chunks/chunk-6M7PCVUR.js +1 -0
- package/ts/chunks/chunk-6O2RXYTM.js +3 -0
- package/ts/chunks/chunk-7DIQYKPL.js +3 -0
- package/ts/chunks/chunk-7J6R2D2K.js +2 -0
- package/ts/chunks/chunk-AW3XJGEP.js +1 -0
- package/ts/chunks/chunk-BRC46A3N.js +39 -0
- package/ts/chunks/chunk-C5LYQDQH.js +368 -0
- package/ts/chunks/chunk-CCYWFSXR.js +3 -0
- package/{chunks/chunk-OAWYVETM.js → ts/chunks/chunk-CL55MNGD.js} +1 -1
- package/ts/chunks/chunk-CSP2GUD4.js +29 -0
- package/{chunks/chunk-EROZRDGT.js → ts/chunks/chunk-D2UKX2VW.js} +1 -1
- package/ts/chunks/chunk-DGYDUGTM.js +1 -0
- package/ts/chunks/chunk-FB3Z7XYQ.js +1 -0
- package/ts/chunks/chunk-FLLYK5FU.js +1 -0
- package/{chunks/chunk-EJYSOUEA.js → ts/chunks/chunk-GCPGG4YB.js} +1 -1
- package/{chunks/chunk-FYFUEK4U.js → ts/chunks/chunk-HLDPASM6.js} +1 -1
- package/ts/chunks/chunk-HNQA5O2S.js +2 -0
- package/ts/chunks/chunk-HUP7XWW6.js +1 -0
- package/ts/chunks/chunk-J3XNDEMU.js +4 -0
- package/ts/chunks/chunk-K6FVY52W.js +5 -0
- package/ts/chunks/chunk-KQJGXVWX.js +91 -0
- package/ts/chunks/chunk-M4U4Y3XQ.js +7 -0
- package/ts/chunks/chunk-M6CAJL36.js +1 -0
- package/ts/chunks/chunk-MPHTBN7E.js +1 -0
- package/ts/chunks/chunk-NYIFCLEG.js +1 -0
- package/ts/chunks/chunk-RRDWQKZY.js +1 -0
- package/ts/chunks/chunk-RVNSKPFL.js +1 -0
- package/ts/chunks/chunk-S5F2DAAG.js +5 -0
- package/ts/chunks/chunk-SCYP2G2T.js +3 -0
- package/ts/chunks/chunk-SWP6BJR6.js +147 -0
- package/{chunks/chunk-XDRX4ZBJ.js → ts/chunks/chunk-SWRVSRYY.js} +1 -1
- package/ts/chunks/chunk-T2X4E35X.js +1 -0
- package/ts/chunks/chunk-TDLTCTV4.js +1 -0
- package/ts/chunks/chunk-TKBGNLNV.js +1 -0
- package/ts/chunks/chunk-UY4YFVSW.js +3 -0
- package/ts/chunks/chunk-V5ZXCJPI.js +2 -0
- package/ts/chunks/chunk-W46BJM2F.js +1 -0
- package/ts/chunks/chunk-W7KQFMHV.js +1 -0
- package/ts/chunks/chunk-XGRZPTAD.js +24 -0
- package/ts/chunks/chunk-XTQFSF6C.js +1 -0
- package/ts/chunks/chunk-YN3SHWBR.js +1 -0
- package/ts/chunks/chunk-ZAY6LSJD.js +2 -0
- package/ts/chunks/chunk-ZGVXR3EC.js +8 -0
- package/ts/chunks/chunk-ZW5C5IGT.js +32 -0
- package/ts/chunks/claude-code-J2V5WSGZ.js +1 -0
- package/ts/chunks/concern-EDWQHU4H.js +1 -0
- package/ts/chunks/config-E7BDBHPK.js +1 -0
- package/ts/chunks/decision-ledger-5QXKZSV2.js +1 -0
- package/ts/chunks/delegate-LVQQ3GCV.js +1 -0
- package/ts/chunks/diagrams-2F5ZYXA7.js +1 -0
- package/ts/chunks/diagrams-H62JGTIS.js +1 -0
- package/ts/chunks/done-U3TOSZIX.js +1 -0
- package/ts/chunks/followup-J2HJU3ZT.js +1 -0
- package/ts/chunks/free-73WMLMCT.js +1 -0
- package/ts/chunks/gemini-GA6P4M7D.js +1 -0
- package/ts/chunks/init-6CVDGRY2.js +1 -0
- package/ts/chunks/invoke-hook-2TMKWL7I.js +15 -0
- package/ts/chunks/kiro-BJSKSAUC.js +1 -0
- package/ts/chunks/learn-7Q2VWZMI.js +7 -0
- package/ts/chunks/ledger-XR4AHZRX.js +2 -0
- package/ts/chunks/list-CUQCPXZH.js +1 -0
- package/ts/chunks/manager-WTLJ5C2I.js +3 -0
- package/ts/chunks/mod-BZA5TFW7.js +1 -0
- package/ts/chunks/mod-RWA5ZPYH.js +1 -0
- package/ts/chunks/mod-X372UNSQ.js +1 -0
- package/ts/chunks/mod-XVE4ZWPY.js +1 -0
- package/ts/chunks/next-CEYZSYGB.js +20 -0
- package/ts/chunks/node-33JV5VS3.js +15 -0
- package/ts/chunks/node-XYP2DQHR.js +74 -0
- package/{chunks/node-2XIHQ2M4.js → ts/chunks/node-ZSGIX7K3.js} +1 -1
- package/ts/chunks/ollama-X6OGN5BW.js +1 -0
- package/ts/chunks/openai-TV7KLQ2C.js +1 -0
- package/ts/chunks/openai-YPM2E7QS.js +30 -0
- package/ts/chunks/opencode-AK6WWZRF.js +1 -0
- package/ts/chunks/pack-EOUSZGJT.js +5 -0
- package/ts/chunks/plan-export-ZBINRAAS.js +3 -0
- package/ts/chunks/purge-GPMC5A6Y.js +5 -0
- package/ts/chunks/reopen-LPVNZN5I.js +1 -0
- package/ts/chunks/reset-RNLPXGWQ.js +1 -0
- package/ts/chunks/review-ZGAY5XCN.js +1 -0
- package/ts/chunks/rule-SNBQ4VZD.js +6 -0
- package/ts/chunks/run-4TDP4C7Z.js +3 -0
- package/ts/chunks/sdk-MEVPL5WT.js +1 -0
- package/ts/chunks/session-J7TSLNEH.js +1 -0
- package/ts/chunks/spec-3NSPFDIC.js +1 -0
- package/ts/chunks/status-DIEA2OGR.js +1 -0
- package/ts/chunks/sync-HZNKILSP.js +1 -0
- package/ts/chunks/validate-MWHDOF2F.js +1 -0
- package/ts/chunks/vertexai-ARXI4AMJ.js +1 -0
- package/ts/chunks/watch-P6HABMAS.js +7 -0
- package/ts/chunks/web-BMIC3VJQ.js +1 -0
- package/ts/chunks/wontfix-6UKEYTVB.js +1 -0
- package/ts/noskills.js +2 -0
- package/chunks/anthropic-ZKOMTKX2.js +0 -1
- package/chunks/approve-3TKOHYHH.js +0 -1
- package/chunks/ask-UB26SBWQ.js +0 -2
- package/chunks/block-Q4WAIX7X.js +0 -1
- package/chunks/browser-BGFD24RX.js +0 -1
- package/chunks/bun-WZ7BVR7Y.js +0 -1
- package/chunks/cancel-DY76ADX4.js +0 -1
- package/chunks/chunk-34RPTI4K.js +0 -29
- package/chunks/chunk-3JTDWOAJ.js +0 -2
- package/chunks/chunk-5FX4EBFY.js +0 -5
- package/chunks/chunk-5RLCKUIF.js +0 -2
- package/chunks/chunk-7PBHRFOZ.js +0 -3
- package/chunks/chunk-7PPUGTKL.js +0 -4
- package/chunks/chunk-AB3N327V.js +0 -1
- package/chunks/chunk-AUZWXMWA.js +0 -27
- package/chunks/chunk-BYPCI5VU.js +0 -1
- package/chunks/chunk-CH6A3LES.js +0 -91
- package/chunks/chunk-CKIZYL4O.js +0 -3
- package/chunks/chunk-CTTMQSHF.js +0 -1
- package/chunks/chunk-DEHRWREM.js +0 -1
- package/chunks/chunk-DYCGJ4RY.js +0 -4
- package/chunks/chunk-ENP4P2YH.js +0 -0
- package/chunks/chunk-EVJYA7S3.js +0 -21
- package/chunks/chunk-FE4MKOI4.js +0 -1
- package/chunks/chunk-GNMOE7H3.js +0 -48
- package/chunks/chunk-HB62UGZI.js +0 -2
- package/chunks/chunk-IFE5SYGK.js +0 -1
- package/chunks/chunk-IM73MYMS.js +0 -1
- package/chunks/chunk-JYVB6UAV.js +0 -1
- package/chunks/chunk-KJLEPI7T.js +0 -1
- package/chunks/chunk-KRRPOVQG.js +0 -1
- package/chunks/chunk-LGQEWL5X.js +0 -1
- package/chunks/chunk-LJEWPIEI.js +0 -1
- package/chunks/chunk-LKZZ4JN5.js +0 -110
- package/chunks/chunk-NGCBWJML.js +0 -2
- package/chunks/chunk-NPWXEWRN.js +0 -4
- package/chunks/chunk-O4KKKYCH.js +0 -1
- package/chunks/chunk-ONJVI5AZ.js +0 -23
- package/chunks/chunk-OP4XAIGW.js +0 -1
- package/chunks/chunk-PSX63TYP.js +0 -2
- package/chunks/chunk-Q4TI7EYT.js +0 -5
- package/chunks/chunk-SLO22P65.js +0 -1
- package/chunks/chunk-T6NZVA6P.js +0 -7
- package/chunks/chunk-TCSIXKUD.js +0 -3
- package/chunks/chunk-VJRCTYGL.js +0 -1
- package/chunks/chunk-VXU6XZ66.js +0 -39
- package/chunks/chunk-WDKWHGJU.js +0 -146
- package/chunks/chunk-XDPATEP5.js +0 -1
- package/chunks/chunk-Y45DQJSS.js +0 -3
- package/chunks/chunk-Y5E7ZCCX.js +0 -1
- package/chunks/chunk-YUTDPPXX.js +0 -1
- package/chunks/chunk-Z7OYXH3J.js +0 -1
- package/chunks/claude-code-OQJIUKZP.js +0 -1
- package/chunks/cmd-46ZIHXLB.js +0 -1
- package/chunks/concern-UIGVWDFS.js +0 -1
- package/chunks/config-72Z4PIJN.js +0 -1
- package/chunks/decision-ledger-5IPPTRT7.js +0 -1
- package/chunks/delegate-OV6NY434.js +0 -1
- package/chunks/deno-YM5PW6ZM.js +0 -1
- package/chunks/diagrams-CBCUA47B.js +0 -1
- package/chunks/diagrams-OX4FBDGP.js +0 -1
- package/chunks/done-V54GSSTY.js +0 -1
- package/chunks/followup-NL7EPIGF.js +0 -1
- package/chunks/free-KD344KRL.js +0 -1
- package/chunks/gemini-23EOEXSF.js +0 -1
- package/chunks/init-WDRNFT57.js +0 -1
- package/chunks/invoke-hook-I3NTD36Q.js +0 -13
- package/chunks/kiro-TPAAIMY6.js +0 -1
- package/chunks/learn-WBWNJEB2.js +0 -7
- package/chunks/ledger-QYK252DV.js +0 -1
- package/chunks/list-WO6RS7JX.js +0 -1
- package/chunks/loader-command-3A5FK2RF.js +0 -1
- package/chunks/loader-reactor-YZM7HO4G.js +0 -1
- package/chunks/manager-ZSPRC5R4.js +0 -3
- package/chunks/mod-7VTKN6Q5.js +0 -1
- package/chunks/mod-B6LBGYON.js +0 -1
- package/chunks/mod-MMHDQRNF.js +0 -1
- package/chunks/mod-RBGAMGZA.js +0 -1
- package/chunks/mod-SFSUQWSB.js +0 -8
- package/chunks/mod-SV4VELMH.js +0 -1
- package/chunks/next-QXCLZ7P3.js +0 -15
- package/chunks/node-BXYZKSJY.js +0 -15
- package/chunks/node-DMUOWFGA.js +0 -69
- package/chunks/node-J4GTOSL2.js +0 -1
- package/chunks/ollama-MXRDGQDF.js +0 -1
- package/chunks/openai-LE47IWMQ.js +0 -30
- package/chunks/openai-MSJF4B6H.js +0 -1
- package/chunks/opencode-ZDHKR2P6.js +0 -1
- package/chunks/pack-NS64WU6M.js +0 -5
- package/chunks/plan-export-HECAF7D4.js +0 -3
- package/chunks/purge-PSQNN42H.js +0 -4
- package/chunks/reopen-L37M5XUI.js +0 -1
- package/chunks/reset-OOTZXW6Q.js +0 -1
- package/chunks/review-QLD6WSOB.js +0 -1
- package/chunks/rule-OOANQBHB.js +0 -6
- package/chunks/run-YHCIRY7Z.js +0 -3
- package/chunks/sdk-OQIHH3OY.js +0 -1
- package/chunks/session-OWWDH7KA.js +0 -1
- package/chunks/spec-O7F525UN.js +0 -1
- package/chunks/status-SZZXY7V3.js +0 -1
- package/chunks/sync-3RYRGTEA.js +0 -1
- package/chunks/unstable_chmod-44MCKF3B.js +0 -1
- package/chunks/validate-UZD6JBSG.js +0 -1
- package/chunks/vertexai-CVCRCO24.js +0 -1
- package/chunks/watch-5DNM646U.js +0 -8
- package/chunks/web-662LNB3K.js +0 -1
- package/chunks/wontfix-UDCTLHNB.js +0 -1
- package/chunks/workerd-I7MLRCLJ.js +0 -1
- /package/{chunks/chunk-5OTECUN7.js → ts/chunks/chunk-ATNTR7M5.js} +0 -0
- /package/{chunks → ts/chunks}/chunk-HISXAZ4Y.js +0 -0
- /package/{chunks → ts/chunks}/chunk-I4Z2RF7L.js +0 -0
- /package/{chunks → ts/chunks}/dist-3MH5UCQU.js +0 -0
- /package/{chunks → ts/chunks}/multipart-parser-DKDFOZKD.js +0 -0
- /package/{chunks → ts/chunks}/src-HXQVVTGQ.js +0 -0
package/chunks/chunk-ONJVI5AZ.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{e as C}from"./chunk-WDKWHGJU.js";import{i as y}from"./chunk-Y5E7ZCCX.js";import{e as A}from"./chunk-HISXAZ4Y.js";var g=A(C(),1);var $=[{id:"summary",title:"Summary",placeholder:"_Synthesize the spec in 2-3 sentences: what changes, why it matters, for whom._",position:"base:0"},{id:"problem-statement",title:"Problem Statement",placeholder:"_Describe the current pain: what is broken, missing, or inefficient? For whom? What happens today when they try?_",position:"base:1"},{id:"ambition",title:"Ambition",placeholder:"_What does success look like? Paint the 12-month ideal state \u2014 not just this feature, but the trajectory it starts._",position:"base:2"},{id:"reversibility",title:"Reversibility",placeholder:"_If this ships and is wrong, how do we undo it? Rollback steps, feature flags, migration reversibility, blast radius._",position:"base:3"},{id:"user-impact",title:"User Impact",placeholder:"_Who benefits and how? What changes for them \u2014 before/after their day, their workflow, their frustration?_",position:"base:4"},{id:"verification-strategy",title:"Verification Strategy",placeholder:"_How will we know it worked? Automated tests, manual smoke tests, metrics to watch, acceptance checklist._",position:"base:5"},{id:"scope-boundary",title:"Scope Boundary",placeholder:"_What is explicitly OUT of scope? Name specific features, use cases, or edge cases this spec does NOT address._",position:"base:6"},{id:"premises",title:"Premises",placeholder:"_List every assumption this spec makes. If an assumption turns out wrong, what breaks?_",position:"base:7"},{id:"tasks",title:"Tasks",placeholder:"_Break implementation into concrete tasks. Each task: what it does, how to verify it is done, any ordering constraints._",position:"base:8"},{id:"acceptance-criteria",title:"Acceptance Criteria",placeholder:"_Binary, testable criteria. Each item: the system does X when Y. No fuzzy language._",position:"base:9"}],D=(e,t,s)=>typeof t=="string"?{id:`${e}-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}`,title:t,placeholder:`_${t}: to be addressed during discovery._`,condition:null,position:`after:tasks:${s}`}:t,M=e=>{let t=$.map(i=>({...i,condition:null})),s=new Set(t.map(i=>i.id)),n=new Map;for(let i of e)for(let a=0;a<i.specSections.length;a++){let d=i.specSections[a],l=D(i.id,d,a),u={...l,concernSource:i.id},p=l.position.match(/^after:([^:]+)/),r=p!==null?p[1]:void 0,c=r!==void 0&&s.has(r)?r:"acceptance-criteria",h=n.get(c)??[];n.set(c,[...h,u])}let o=[];for(let i of t){o.push(i);let a=n.get(i.id)??[];o.push(...a)}return o},w={involvesWebUI:e=>e.involvesWebUI,involvesCLI:e=>e.involvesCLI,involvesPublicAPI:e=>e.involvesPublicAPI,involvesMigration:e=>e.involvesMigration,involvesDataHandling:e=>e.involvesDataHandling},j=(e,t,s)=>{let n=new Map(t.map(o=>[o.id,o]));return e.map(o=>{let i=n.get(o.sectionId);if(i===void 0||i.condition===null||o.status==="filled"||o.status==="na")return o;let a=w[i.condition];if(a===void 0)return o;let d=s!==null&&a(s);return d&&o.status==="conditional-hidden"?{...o,status:"placeholder"}:!d&&o.status==="placeholder"?{...o,status:"conditional-hidden"}:o})},W=(e,t)=>{if(t===null)return"unknown";let s=[["involvesWebUI","UI work"],["involvesCLI","CLI interaction"],["involvesPublicAPI","public API changes"],["involvesMigration","migration or deprecation"],["involvesDataHandling","data handling"]],n=[];for(let[o,i]of s){if(o==="source"||o==="inferredFrom")continue;let a=e!==null?!!e[o]:!1,d=!!t[o];!a&&d&&n.push(i)}return n.length>0?n.join(", "):"project classification update"},U=(e,t)=>{let s=new Set(e.filter(a=>a.status!=="conditional-hidden").map(a=>a.sectionId)),n=new Set(t.filter(a=>a.status!=="conditional-hidden").map(a=>a.sectionId)),o=[...n].filter(a=>!s.has(a)),i=[...s].filter(a=>!n.has(a));return o.length===0&&i.length===0?null:{revealed:o,hidden:i}},O={filled:"\u2713",placeholder:"\u25CB",na:"\u2014","conditional-hidden":"\u2298"},I="<!-- TOC:START -->",v="<!-- TOC:END -->",x=e=>{let t=[I,"## Sections"];for(let s of e){let n=O[s.status];s.status==="na"&&s.naReason!==void 0?t.push(`- ${n} ${s.sectionTitle} _(N/A: ${s.naReason})_`):s.status==="conditional-hidden"?t.push(`- ${n} ${s.sectionTitle} _(hidden \u2014 condition not met)_`):t.push(`- ${n} ${s.sectionTitle}`)}return t.push(v),t.join(`
|
|
2
|
-
`)},f="---",E=e=>{let t=e.split(`
|
|
3
|
-
`);if(t[0]!==f)return{metadata:{created:{date:"",user:""},lastModified:{date:"",user:""},contributors:[],approvals:[],pendingDecisions:[]},body:e};let s=t.indexOf(f,1);if(s===-1)throw new Error("spec.md frontmatter is malformed: found opening --- but no closing ---. Inspect the file manually and restore a valid YAML frontmatter block.");let n=t.slice(1,s).join(`
|
|
4
|
-
`),o=g.parse(n),i=t.slice(s+1).join(`
|
|
5
|
-
`);return{metadata:o,body:i}},T=e=>{let t=g.stringify(e,{lineWidth:0});return`${f}
|
|
6
|
-
${t.trimEnd()}
|
|
7
|
-
${f}`},m=e=>`<!-- PLACEHOLDER:${e} -->`,F=(e,t,s)=>{let n=m(t);if(!e.includes(n))throw new Error(`Placeholder marker not found for section "${t}". spec.md may have been manually edited or this section was already filled. Inspect the file and restore the marker, or mark the section as filled in state JSON directly.`);return e.replace(n,s)},N=(e,t)=>{let s=e.indexOf(I),n=e.indexOf(v);if(s===-1||n===-1)return e;let o=x(t);return e.slice(0,s)+o+e.slice(n+v.length)},V=(e,t,s,n,o="STATED")=>e.map(i=>i.sectionId===t?{...i,status:"filled",filledBy:s,filledAt:n.toISOString(),source:o}:i);var H=e=>{let t=e.placeholders.filter(n=>!(n.status==="conditional-hidden"||n.status==="filled"||n.status==="na"&&n.naReason!==void 0&&n.naReason.trim().length>=20)).map(n=>({sectionId:n.sectionId,sectionTitle:n.sectionTitle})),s=e.metadata.pendingDecisions;return{canAdvance:t.length===0&&s.length===0,unresolvedSections:t,pendingDecisions:s}},z=(e,t,s)=>{let n=s.toISOString(),o={date:n,user:t.user},i={user:t.user,lastAction:t.type,date:n},a=e.contributors.findIndex(l=>l.user===t.user),d=a>=0?e.contributors.map((l,u)=>u===a?i:l):[...e.contributors,i];switch(t.type){case"delegation-created":{let l={section:t.section,question:t.question,waitingFor:t.waitingFor};return{...e,lastModified:o,contributors:d,pendingDecisions:[...e.pendingDecisions,l]}}case"delegation-answered":return{...e,lastModified:o,contributors:d,pendingDecisions:e.pendingDecisions.filter(l=>l.section!==t.section)};case"approval":{let l=e.approvals.findIndex(r=>r.user===t.user),u={user:t.user,status:"approved",date:n},p=l>=0?e.approvals.map((r,c)=>c===l?u:r):[...e.approvals,u];return{...e,lastModified:o,contributors:d,approvals:p}}default:return{...e,lastModified:o,contributors:d}}},R={status_quo:"problem-statement",user_impact:"user-impact",ambition:"ambition",scope_boundary:"scope-boundary",verification:"verification-strategy",reversibility:"reversibility"},q=e=>R[e]??e,Y=e=>{let{specName:t,activeConcerns:s,classification:n,creator:o,now:i}=e,a=i.toISOString(),d=M(s),l=d.map(r=>{if(r.condition===null)return{sectionId:r.id,sectionTitle:r.title,status:"placeholder",concernSource:r.concernSource};let c=w[r.condition],h=n!==null&&c!==void 0&&c(n);return{sectionId:r.id,sectionTitle:r.title,status:h?"placeholder":"conditional-hidden",concernSource:r.concernSource}}),u={created:{date:a,user:o.name},lastModified:{date:a,user:o.name},contributors:[{user:o.name,lastAction:"created",date:a}],approvals:[],pendingDecisions:[]},p=[];p.push(T(u)),p.push(`# Spec: ${t}`),p.push(x(l));for(let r of d){let c=l.find(h=>h.sectionId===r.id);c===void 0||c.status==="conditional-hidden"||p.push(`## ${r.title}
|
|
8
|
-
|
|
9
|
-
${m(r.id)}
|
|
10
|
-
${r.placeholder}`)}return{content:p.join(`
|
|
11
|
-
|
|
12
|
-
`),placeholders:l,metadata:u}},J=async e=>{let{path:t,sectionId:s,body:n,attribution:o,metadata:i,visiblePlaceholders:a}=e,d=await y.fs.readTextFile(t),{body:l}=E(d),u=T(i),p=o.date.toISOString().split("T")[0],r=`${n}
|
|
13
|
-
|
|
14
|
-
_Answered by ${o.user} on ${p}_`,c=F(l,s,r);if(c=N(c,a),e.classificationChanged){for(let h of e.newlyRevealedSections??[])c+=`
|
|
15
|
-
|
|
16
|
-
## ${h.title}
|
|
17
|
-
|
|
18
|
-
${m(h.id)}
|
|
19
|
-
${h.placeholder}`;for(let h of e.newlyHiddenIds??[]){let _=m(h),S=c.indexOf(_);if(S===-1)continue;let b=c.slice(0,S);if(/\n## [^\n]+\n/.exec(b.slice(b.lastIndexOf(`
|
|
20
|
-
## `)))===null)continue;let P=b.lastIndexOf(`
|
|
21
|
-
## `),k=c.indexOf(`
|
|
22
|
-
`,S)+1;c=c.slice(0,P)+c.slice(k)}}await y.fs.writeTextFile(t,`${u}
|
|
23
|
-
${c}`)};var Q=async(e,t)=>{try{await y.fs.stat(t);return}catch{}let s=await y.fs.readTextFile(e);await y.fs.writeTextFile(t,s)};export{M as a,j as b,W as c,U as d,V as e,H as f,z as g,q as h,Y as i,J as j,Q as k};
|
package/chunks/chunk-OP4XAIGW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,d as T,e as x,f as R}from"./chunk-PSX63TYP.js";import{a as y,k as h}from"./chunk-JYVB6UAV.js";import{a as m,b as p}from"./chunk-OAWYVETM.js";var l=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="vertexai";modelId;client;config;constructor(e,t){this.client=e,this.config=t,this.modelId=t.model}async generateText(e,t){let r=v(this.config,e);try{let o=await this.client.models.generateContent({model:this.config.model,...r,config:{...r.config,httpOptions:t!==void 0?{signal:t}:void 0}});return m(x(o,this.modelId))}catch(o){return p(C(o))}}async*streamText(e,t){let r=v(this.config,e);try{let o=await this.client.models.generateContentStream({model:this.config.model,...r,config:{...r.config,httpOptions:t!==void 0?{signal:t}:void 0}}),s=0,a=0;for await(let c of o){let g=c?.candidates??[];if(g.length>0){let u=g[0],S=u?.content?.parts??[];for(let i of S)i.text!==void 0&&(yield{kind:"content_delta",textDelta:i.text}),i.functionCall!==void 0&&(yield{kind:"tool_call_delta",toolCall:{id:i.functionCall.name,name:i.functionCall.name,arguments:i.functionCall.args??{}}});let d=u?.finishReason;if(d!=null){let i=c?.usageMetadata;s=i?.promptTokenCount??s,a=i?.candidatesTokenCount??a;let f="end_turn";d==="MAX_TOKENS"&&(f="max_tokens"),yield{kind:"message_done",stopReason:f,usage:{inputTokens:s,outputTokens:a,totalTokens:s+a}}}}}}catch(o){yield{kind:"error",error:C(o)}}}async close(){}getRawClient(){return this.client}},_={provider:"vertexai",async createModel(n){let{GoogleGenAI:e}=await import("./node-DMUOWFGA.js"),t={vertexai:!0,project:n.projectId,location:n.location??"us-central1"};n.apiKey!==void 0&&(t.apiKey=n.apiKey);let r=new e(t);return new l(r,n)}},v=(n,e)=>{let{contents:t,systemInstruction:r}=k(e.messages),o={maxOutputTokens:e.maxTokens??n.maxTokens};e.temperature!==void 0&&(o.temperature=e.temperature),e.topP!==void 0&&(o.topP=e.topP),e.stopWords!==void 0&&(o.stopSequences=e.stopWords),e.responseFormat!==void 0&&e.responseFormat.type==="json_schema"&&(o.responseMimeType="application/json",o.responseSchema=e.responseFormat.jsonSchema),e.thinkingBudget!==void 0&&(o.thinkingConfig={thinkingBudget:e.thinkingBudget});let s={contents:t,config:o},a=e.system??r;return a!=null&&(s.systemInstruction=a),e.tools!==void 0&&(s.tools=T(e.tools)),e.safetySettings!==void 0&&(s.safetySettings=e.safetySettings),s},C=n=>{if(n instanceof y)return n;let e=n instanceof Error?n:new Error(String(n)),t=R(n);return h("vertexai",t,e)};export{l as a,_ as b};
|
package/chunks/chunk-PSX63TYP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as l,i as p,j as u}from"./chunk-EJYSOUEA.js";var f=e=>e==="assistant"?"model":e==="tool"?"user":e,g=e=>{switch(e.kind){case"text":return{text:e.text};case"image":{if(e.image.data!==void 0)return{inlineData:{mimeType:e.image.mimeType??"image/png",data:d(e.image.data)}};if(e.image.url!==void 0){if(l(e.image.url)){let t=p(e.image.url);if(t!==null)return{inlineData:{mimeType:t.mimeType,data:d(t.data)}}}return{fileData:{mimeType:e.image.mimeType??u(e.image.url)??"image/png",fileUri:e.image.url}}}return{text:"[unsupported image]"}}case"audio":return e.audio.data!==void 0?{inlineData:{mimeType:e.audio.mimeType??"audio/mpeg",data:d(e.audio.data)}}:e.audio.url!==void 0?{fileData:{mimeType:e.audio.mimeType??u(e.audio.url)??"audio/mpeg",fileUri:e.audio.url}}:{text:"[unsupported audio]"};case"file":return{fileData:{mimeType:e.file.mimeType??"application/octet-stream",fileUri:e.file.uri}};case"tool_call":return{functionCall:{name:e.toolCall.name,args:e.toolCall.arguments}};case"tool_result":return{functionResponse:{name:e.toolResult.toolCallId,response:{content:e.toolResult.content}}}}},T=e=>{let t=null,n=[];for(let a of e){if(a.role==="system"){let o=[];for(let r of a.content)r.kind==="text"&&o.push(r.text);t=o.join(`
|
|
2
|
-
`);continue}let s=a.content.map(g);n.push({role:f(a.role),parts:s})}return{contents:n,systemInstruction:t}},x=e=>e.map(t=>({functionDeclarations:[{name:t.name,description:t.description,parameters:t.parameters}]})),C=(e,t)=>{let n=[],a="end_turn",s=e?.candidates??[];if(s.length>0){let r=s[0],c=r?.content?.parts??[];for(let i of c)i.text!==void 0&&n.push({kind:"text",text:i.text}),i.functionCall!==void 0&&(n.push({kind:"tool_call",toolCall:{id:i.functionCall.name,name:i.functionCall.name,arguments:i.functionCall.args??{}}}),a="tool_use");let m=r?.finishReason;m==="MAX_TOKENS"?a="max_tokens":m==="STOP"&&(a="end_turn")}let o=e?.usageMetadata;return{content:n,stopReason:a,usage:{inputTokens:o?.promptTokenCount??0,outputTokens:o?.candidatesTokenCount??0,totalTokens:o?.totalTokenCount??0},modelId:t,rawResponse:e}},R=e=>e?.status!==void 0?e.status:e?.code!==void 0?e.code:500,d=e=>{let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)};export{f as a,g as b,T as c,x as d,C as e,R as f};
|
package/chunks/chunk-Q4TI7EYT.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as c}from"./chunk-Y5E7ZCCX.js";var p=".eser/diagrams.json",g=i=>{let t=0;for(let s=0;s<i.length;s++){let a=i.charCodeAt(s);t=(t<<5)-t+a,t|=0}return Math.abs(t).toString(36)},u=i=>{let t=new Set,s=/(?:[\w@.-]+\/)*[\w@.-]+\.(?:ts|tsx|js|jsx|go|py|rs|md|json|yaml|yml)/g,a;for(;(a=s.exec(i))!==null;)t.add(a[0]);let r=/(?:@[\w-]+\/[\w-]+|[\w-]+\/[\w-]+)/g;for(;(a=r.exec(i))!==null;)a[0].includes(".")||t.add(a[0]);return[...t]},D=async(i,t)=>{let s=`${i}/${t}`,a;try{a=await c.fs.readTextFile(s)}catch{return[]}let r=[],e=a.split(`
|
|
2
|
-
`),n=new Date().toISOString(),o=!1,h=0,m="";for(let l=0;l<e.length;l++){let d=e[l];if(d.trim().startsWith("```mermaid")){o=!0,h=l+1,m="";continue}if(o&&d.trim()==="```"){o=!1,r.push({file:t,line:h,type:"mermaid",hash:g(m),referencedFiles:u(m),lastVerified:n});continue}if(o){m+=d+`
|
|
3
|
-
`;continue}if(/[┌─┬┐│└┴┘╔═╗║╚╝╭╮╰╯]/.test(d)&&e[l+1]&&/[┌─┬┐│└┴┘╔═╗║╚╝╭╮╰╯]/.test(e[l+1])){let f="",y=l;for(;y<e.length&&/[┌─┬┐│└┴┘╔═╗║╚╝╭╮╰╯┼├┤▶→←↓↑\|+\-]/.test(e[y]);)f+=e[y]+`
|
|
4
|
-
`,y++;f.length>20&&r.push({file:t,line:l+1,type:"ascii",hash:g(f),referencedFiles:u(f),lastVerified:n})}}return r},F=async i=>{let t=[],s=[],a=async(r,e)=>{try{for await(let n of c.fs.readDir(r))n.name.startsWith(".")||n.name==="node_modules"||(n.isFile&&n.name.endsWith(".md")&&s.push(e?`${e}/${n.name}`:n.name),n.isDirectory&&!n.name.startsWith(".")&&await a(`${r}/${n.name}`,e?`${e}/${n.name}`:n.name))}catch{}};await a(i,"");for(let r of s){let e=await D(i,r);t.push(...e)}try{for await(let r of c.fs.readDir(i))if(r.isFile&&r.name.endsWith(".puml")){let e=await c.fs.readTextFile(`${i}/${r.name}`);t.push({file:r.name,line:1,type:"plantuml",hash:g(e),referencedFiles:u(e),lastVerified:new Date().toISOString()})}}catch{}return t},w=async i=>{try{let t=await c.fs.readTextFile(`${i}/${p}`);return JSON.parse(t)}catch{return[]}},S=async(i,t)=>{await c.fs.writeTextFile(`${i}/${p}`,JSON.stringify(t,null,2)+`
|
|
5
|
-
`)},x=async(i,t,s)=>{let a=await w(i),r=!1,e=a.map(n=>n.file===t&&(s===void 0||n.line===s)?(r=!0,{...n,lastVerified:new Date().toISOString()}):n);return r&&await S(i,e),r},E=async(i,t)=>{let s=await w(i);if(s.length===0)return[];let a=new Set(t.map(e=>e.replace(/^\.\//,""))),r=[];for(let e of s)for(let n of e.referencedFiles)for(let o of a)if(o.includes(n)||n.includes(o)){r.push({file:e.file,line:e.line,type:e.type,reason:`${o} was modified but diagram references ${n}`});break}return r};export{F as a,w as b,S as c,x as d,E as e};
|
package/chunks/chunk-SLO22P65.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=class{stdinData;stdinOffset=0;stdoutChunks=[];stderrChunks=[];instance=null;exitCode=null;constructor(e={}){this.stdinData=e.stdin??new Uint8Array(0)}getStdout(){let e=this.stdoutChunks.reduce((r,s)=>r+s.length,0),n=new Uint8Array(e),t=0;for(let r of this.stdoutChunks)n.set(r,t),t+=r.length;return new TextDecoder().decode(n)}getExitCode(){return this.exitCode}getMemory(){if(this.instance===null)throw new Error("WASI shim: instance not set");let e=this.instance.exports.memory;return new DataView(e.buffer)}getMemoryBytes(){if(this.instance===null)throw new Error("WASI shim: instance not set");let e=this.instance.exports.memory;return new Uint8Array(e.buffer)}setInstance(e){this.instance=e}start(e){this.setInstance(e);let n=e.exports._start;if(typeof n!="function")throw new Error("WASI shim: no _start export found");try{n()}catch(t){if(t instanceof b){if(this.exitCode=t.code,t.code!==0)throw t;return}throw t}}initialize(e){this.setInstance(e);let n=e.exports._initialize;if(typeof n=="function"){n();return}let t=e.exports._start;if(typeof t=="function")try{t()}catch(r){if(r instanceof b&&r.code===0)return;throw r}}get wasiImport(){return{fd_write:(e,n,t,r)=>{let s=this.getMemory(),u=this.getMemoryBytes(),o=0;for(let i=0;i<t;i++){let m=n+i*8,S=s.getUint32(m,!0),_=s.getUint32(m+4,!0),R=u.slice(S,S+_);if(e===1)this.stdoutChunks.push(R);else if(e===2)this.stderrChunks.push(R);else return 8;o+=_}return s.setUint32(r,o,!0),0},fd_read:(e,n,t,r)=>{if(e!==0)return 8;let s=this.getMemory(),u=this.getMemoryBytes(),o=0;for(let i=0;i<t;i++){let m=n+i*8,S=s.getUint32(m,!0),_=s.getUint32(m+4,!0),R=this.stdinData.length-this.stdinOffset,a=Math.min(_,R);if(a>0&&(u.set(this.stdinData.subarray(this.stdinOffset,this.stdinOffset+a),S),this.stdinOffset+=a,o+=a),a<_)break}return s.setUint32(r,o,!0),0},fd_close:e=>0,fd_seek:(e,n,t,r,s)=>52,fd_fdstat_get:(e,n)=>{let t=this.getMemory();return t.setUint8(n,2),t.setUint16(n+2,0,!0),t.setBigUint64(n+8,BigInt(0),!0),t.setBigUint64(n+16,BigInt(0),!0),e<=2?0:8},fd_fdstat_set_flags:(e,n)=>0,fd_prestat_get:(e,n)=>8,fd_prestat_dir_name:(e,n,t)=>8,proc_exit:e=>{throw this.exitCode=e,new b(e)},clock_time_get:(e,n,t)=>{let r=this.getMemory(),s=BigInt(Date.now())*BigInt(1e6);return r.setBigUint64(t,s,!0),0},environ_sizes_get:(e,n)=>{let t=this.getMemory();return t.setUint32(e,0,!0),t.setUint32(n,0,!0),0},environ_get:(e,n)=>0,args_sizes_get:(e,n)=>{let t=this.getMemory();return t.setUint32(e,0,!0),t.setUint32(n,0,!0),0},args_get:(e,n)=>0,path_open:()=>52,path_filestat_get:()=>52,path_create_directory:()=>52,path_remove_directory:()=>52,path_unlink_file:()=>52,path_rename:()=>52,path_readlink:()=>52,path_symlink:()=>52,fd_readdir:()=>52,fd_filestat_get:()=>52,fd_filestat_set_size:()=>52,fd_filestat_set_times:()=>52,fd_advise:()=>52,fd_allocate:()=>52,fd_datasync:()=>52,fd_sync:()=>52,fd_pread:()=>52,fd_pwrite:()=>52,fd_renumber:()=>52,fd_tell:()=>52,poll_oneoff:(e,n,t,r)=>{let s=this.getMemory();for(let u=0;u<t;u++){let o=e+u*48,i=n+u*32,m=s.getBigUint64(o,!0);s.setBigUint64(i,m,!0),s.setUint16(i+8,0,!0),s.setUint8(i+10,s.getUint8(o+8))}return s.setUint32(r,t,!0),0},random_get:(e,n)=>{let t=this.getMemoryBytes(),r=new Uint8Array(n);return crypto.getRandomValues(r),t.set(r,e),0},sched_yield:()=>0,sock_accept:()=>52,sock_recv:()=>52,sock_send:()=>52,sock_shutdown:()=>52}}},b=class extends Error{code;constructor(e){super(`WASI proc_exit(${e})`),this.name="WasiExitError",this.code=e}};export{c as a};
|
package/chunks/chunk-T6NZVA6P.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{f as a}from"./chunk-WDKWHGJU.js";import{i as n}from"./chunk-Y5E7ZCCX.js";var m=t=>{if(t?.driver!=="acp")return!1;let e=t.driverPid;return typeof e!="number"?!1:n.process.isAlive(e)},f=async t=>{let e=`${t}/${a.progressesDir}/files-changed.jsonl`;try{let s=(await n.fs.readTextFile(e)).trim().split(`
|
|
2
|
-
`).filter(Boolean).map(r=>{try{return JSON.parse(r).file}catch{return null}}).filter(r=>r!==null);return[...new Set(s)]}catch{return[]}},p=async t=>{try{let{execSync:e}=await import("node:child_process"),i=e("git diff --name-only",{cwd:t,encoding:"utf-8",timeout:5e3}),r=e("git diff --stat",{cwd:t,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
3
|
-
`);return{files:i.trim().split(`
|
|
4
|
-
`).filter(Boolean),stat:r[r.length-1]??""}}catch{return{files:[],stat:""}}},y=async t=>{let e;try{let u=await n.fs.readTextFile(`${t}/${a.stateFile}`);e=JSON.parse(u)}catch{return null}let i=e.execution??{},[s,r]=await Promise.all([f(t),p(t)]),c=[...new Set([...s,...r.files])],o=(i.iteration??0)+1,l=r.stat.trim(),d=`${t}/${a.progressesDir}/iterations`;try{await n.fs.mkdir(d,{recursive:!0}),await n.fs.writeTextFile(`${d}/iteration-${o}.json`,JSON.stringify({iteration:o,files:c,gitStat:l,timestamp:new Date().toISOString()},null,2)+`
|
|
5
|
-
`)}catch{}e.execution={...i,iteration:o,modifiedFiles:c,lastProgress:l||i.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await n.fs.writeTextFile(`${t}/${a.stateFile}`,JSON.stringify(e,null,2)+`
|
|
6
|
-
`)}catch{}try{await n.fs.writeTextFile(`${t}/${a.progressesDir}/files-changed.jsonl`,"")}catch{}return{iteration:o,modifiedFiles:c,gitStat:l}},h=async(t,e)=>{let i;try{let r=await n.fs.readTextFile(`${t}/${a.stateFile}`);i=JSON.parse(r)}catch{return}let s={...i.execution??{}};e===null?(delete s.driver,delete s.driverPid):(s.driver=e,s.driverPid=n.process.pid),i.execution=s;try{await n.fs.writeTextFile(`${t}/${a.stateFile}`,JSON.stringify(i,null,2)+`
|
|
7
|
-
`)}catch{}};export{m as a,y as b,h as c};
|
package/chunks/chunk-TCSIXKUD.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as V}from"./chunk-Y45DQJSS.js";import{a as A}from"./chunk-JYVB6UAV.js";import{a as L,b as x}from"./chunk-3JTDWOAJ.js";import{a as W,b as N,f as b}from"./chunk-OAWYVETM.js";var m=class extends Error{statusCode;request;response;body;retryAfter;constructor(e,t){super(e,{cause:t?.cause}),this.name="HttpClientError",this.statusCode=t?.statusCode??null,this.request=t?.request??null,this.response=t?.response??null,this.body=t?.body,this.retryAfter=t?.retryAfter??null}},E=class extends m{code="RESPONSE_ERROR";constructor(e,t){super(e,t),this.name="HttpResponseError"}},v=class extends m{code="TIMEOUT";constructor(e,t){super(e,t),this.name="HttpTimeoutError"}},k=class extends m{code="ABORT_ERROR";constructor(e,t){super(e,t),this.name="HttpAbortError"}},_=class extends m{code="RATE_LIMITED";constructor(e,t){super(e,t),this.name="HttpRateLimitError"}},q=class extends m{code="NETWORK_ERROR";constructor(e,t){super(e,t),this.name="HttpNetworkError"}},te=s=>s===429?_:s>=500&&s<=599||s===408?E:null,U=(s,e)=>{if(s instanceof m)return s;if(s.name==="TimeoutError")return new v(s.message,{cause:s,...e!==void 0&&{statusCode:e.status,response:e}});if(s.name==="AbortError")return new k(s.message,{cause:s});if(e!==void 0){let t=te(e.status),r={statusCode:e.status,response:e,cause:s};return t!==null?new t(s.message,r):new E(s.message,r)}return s.message.includes("Failed to fetch")||s.message.includes("fetch failed")||s.message.includes("ECONNREFUSED")||s.message.includes("ENOTFOUND")?new q(s.message,{cause:s}):new m(s.message,{cause:s})};var X=async(s,e)=>{let t=s;for(let r of e)t=await r.intercept(t);return t},z=async(s,e)=>{let t=s;for(let r of e)t=await r.intercept(t);return t};var O=class extends Error{status;statusText;headers;body;retries;constructor(e){super(e.error),this.name="GoHttpError",this.status=e.status??0,this.statusText=e.statusText??"",this.headers=e.headers??{},this.body=e.body??"",this.retries=e.retries??0}},K=async(s={})=>{await L();let e=x();if(e===null)throw new Error("native library not available for createGoHttpClient");let t=e.symbols.EserAjanHttpCreate(JSON.stringify(s)),r=JSON.parse(t);if(r.error)throw new Error(r.error);let n=r.handle;return{request(o){let a=x();if(a===null)return Promise.reject(new Error("native library unavailable"));let u=a.symbols.EserAjanHttpRequest(JSON.stringify({handle:n,...o})),l=JSON.parse(u);return l.error?Promise.reject(new O({...l,error:l.error})):Promise.resolve(l)},requestStream(o){let a=x();if(a===null)return Promise.reject(new Error("native library unavailable"));let u=a.symbols.EserAjanHttpRequestStream(JSON.stringify({handle:n,...o})),l=JSON.parse(u);if(l.error||!l.handle)return Promise.reject(new O({error:l.error??"failed to open HTTP stream",status:l.status,statusText:l.statusText,headers:l.headers,body:l.body}));let i=l.handle,f=l.status??200,p=l.statusText??"",c=l.headers??{},S=new ReadableStream({pull(y){let M=x();if(M===null){y.error(new Error("native library unavailable"));return}let j=M.symbols.EserAjanHttpStreamRead(i),T=JSON.parse(j);if(T.error){y.error(new Error(T.error));return}if(T.done){y.close();return}if(T.chunk){let g=atob(T.chunk),d=new Uint8Array(g.length);for(let H=0;H<g.length;H++)d[H]=g.charCodeAt(H);y.enqueue(d)}},cancel(){let y=x();y!==null&&y.symbols.EserAjanHttpStreamClose(i)}});return Promise.resolve({body:S,status:f,statusText:p,headers:c})},close(){let o=x();o!==null&&o.symbols.EserAjanHttpClose(JSON.stringify({handle:n}))}}};var ie=3e4,G={maxAttempts:3,initialDelay:1e3,maxDelay:3e4,factor:2,jitter:!0,retryableStatuses:[408,429,500,502,503,504],respectRetryAfter:!0},ae=s=>new Promise(e=>setTimeout(e,s)),I=(s,e)=>{if(e.startsWith("http://")||e.startsWith("https://"))return e;if(s!==void 0&&s!==""){let t=s.replace(/\/$/,""),r=e.startsWith("/")?e:`/${e}`;return`${t}${r}`}return e};var D=s=>{if(s===null)return null;let e=Number(s);if(!Number.isNaN(e)&&e>=0)return Math.round(e*1e3);let t=new Date(s);return Number.isNaN(t.getTime())?null:Math.max(0,t.getTime()-Date.now())},F=s=>{let e=s.get("X-RateLimit-Remaining")??s.get("x-rate-limit-remaining"),t=s.get("X-RateLimit-Limit")??s.get("x-rate-limit-limit"),r=s.get("X-RateLimit-Reset")??s.get("x-rate-limit-reset"),n=s.get("Retry-After");if(e===null&&t===null&&r===null&&n===null)return;let o=D(n);return{...e!==null&&{remaining:Number(e)},...t!==null&&{limit:Number(t)},...r!==null&&{resetAt:Number(r)},...o!==null&&{retryAfterSeconds:o/1e3}}},Y=(s,e)=>{let t=e.initialDelay*Math.pow(e.factor,s);return t=Math.min(t,e.maxDelay),e.jitter&&(t=t*(.5+Math.random()*.5)),Math.round(t)},ue=(s,e)=>s===!1||e===!1?!1:s===void 0&&e===void 0?G:{...G,...s??{},...e??{}},le=async s=>{try{return await s.clone().json()}catch{return await s.clone().text().catch(()=>{})}},pe=s=>{if(typeof s=="object"&&s!==null){let e=s,t=e.error??e.message??e.detail??e.title;if(t!==void 0)return String(t)}return null},J=class s{config;#e=null;#t=null;constructor(e){this.config=e??{}}withDefaults(e){return new s({...this.config,...e,headers:{...this.config.headers??{},...e.headers??{}}})}async request(e,t,r){return await this.#r(),this.#e!==null?this.#n(e,t,r):this._execute(e,t,r)}get(e,t){return this._execute("GET",e,t)}post(e,t){return this._execute("POST",e,t)}put(e,t){return this._execute("PUT",e,t)}patch(e,t){return this._execute("PATCH",e,t)}delete(e,t){return this._execute("DELETE",e,t)}async requestStream(e,t,r){return await this.#r(),this.#e!==null?this.#o(e,t,r):this._executeStream(e,t,r)}postStream(e,t){return this.requestStream("POST",e,t)}requestResult(e,t,r){return b(this._execute(e,t,r),C)}getResult(e,t){return b(this._execute("GET",e,t),C)}postResult(e,t){return b(this._execute("POST",e,t),C)}putResult(e,t){return b(this._execute("PUT",e,t),C)}patchResult(e,t){return b(this._execute("PATCH",e,t),C)}deleteResult(e,t){return b(this._execute("DELETE",e,t),C)}requestStreamResult(e,t,r){return b(this._executeStream(e,t,r),C)}postStreamResult(e,t){return b(this._executeStream("POST",e,t),C)}async _executeFetch(e,t,r,n){let o=this.config.fetchFn??fetch,a=this.config._delayFn??ae,u=I(this.config.baseUrl,t),l=new URL(u);if(r?.params!==void 0)for(let[g,d]of Object.entries(r.params))l.searchParams.set(g,d);let i={...this.config.headers??{},...r?.headers??{}},f,p=r?.body;p!==void 0&&(typeof p=="string"||p instanceof ArrayBuffer||ArrayBuffer.isView(p)||p instanceof Blob||p instanceof FormData||p instanceof URLSearchParams||p instanceof ReadableStream?f=p:typeof p=="object"&&p!==null&&(f=JSON.stringify(p),i["Content-Type"]===void 0&&(i["Content-Type"]="application/json")));let c=ue(this.config.retry,r?.retry),S=r?.timeout??this.config.timeout??ie,y=c===!1?1:c.maxAttempts??G.maxAttempts,M=this.config.interceptors?.request??[],j=0,T;for(let g=0;g<y;g++){g>0&&j++;let d,H;try{let R=r?.signal,w=AbortSignal.timeout(S),h=R!==void 0?AbortSignal.any([w,R]):w,P=new Request(l.toString(),{method:e,headers:i,body:f,signal:h});H=await X(P,M),d=await o(H)}catch(R){let w=R instanceof Error?R:new Error(String(R)),h=U(w);if(h instanceof v||h instanceof k)throw h;if(T=h,g<y-1){let P=Y(g,c===!1?G:c);await a(P)}continue}let $=F(d.headers);if(!d.ok){let R=await le(d),w=pe(R)??`HTTP ${d.status}`,h=$!==void 0?D(d.headers.get("Retry-After")):null,P=d.status===429?new _(w,{statusCode:d.status,response:d,body:R,...h!==null&&{retryAfter:h/1e3}}):new E(w,{statusCode:d.status,response:d,body:R});if((c!==!1?c.retryableStatuses:[]).includes(d.status)&&g<y-1){if(T=P,d.status===429&&c!==!1&&c.respectRetryAfter&&h!==null){await a(h);continue}let ee=Y(g,c===!1?G:c);await a(ee);continue}throw P}return await n(d,H,j,$)}throw T??new m(`Request failed after ${y} attempt(s)`)}_execute(e,t,r){let n=this.config.interceptors?.response??[];return this._executeFetch(e,t,r,async(o,a,u,l)=>{let i;if(o.status===204||o.status===304||o.headers.get("Content-Length")==="0")i=void 0;else if((o.headers.get("Content-Type")??"").includes("application/json"))i=await o.json();else{let c=await o.text();try{i=JSON.parse(c)}catch{i=c}}let f={data:i,status:o.status,statusText:o.statusText,headers:o.headers,request:a,raw:o,retries:u,...l!==void 0&&{rateLimit:l}};return f=await z(f,n),f})}_executeStream(e,t,r){return this._executeFetch(e,t,r,(n,o,a,u)=>n.body===null?Promise.reject(new q("Response body is null \u2014 server sent no body for a streaming request")):Promise.resolve({body:n.body,status:n.status,statusText:n.statusText,headers:n.headers,request:o,raw:n,retries:a,...u!==void 0&&{rateLimit:u}}))}#s(e){if(e instanceof O){if(e.status>0){let r=e.body;try{r=JSON.parse(e.body)}catch{}let n=D(e.headers["Retry-After"]??e.headers["retry-after"]??null),o={statusCode:e.status,body:r,...n!==null&&{retryAfter:n/1e3}};return e.status===429?new _(`HTTP ${e.status}`,o):new E(`HTTP ${e.status}`,o)}return new q(e.message,{cause:e})}let t=e instanceof Error?e:new Error(String(e));return U(t)}#r(){return this.config.fetchFn!==void 0?Promise.resolve():this.#t!==null?this.#t:(this.#t=K({baseUrl:this.config.baseUrl,timeout:this.config.timeout,headers:this.config.headers}).then(e=>{this.#e=e},()=>{}),this.#t)}async#n(e,t,r){let n=I(this.config.baseUrl,t),o={...this.config.headers??{},...r?.headers??{}},a=r?.body,u;a!==void 0&&(typeof a=="string"?u=a:typeof a=="object"&&a!==null&&!(a instanceof ReadableStream)&&(u=JSON.stringify(a),o["Content-Type"]===void 0&&(o["Content-Type"]="application/json")));let l={method:e,url:n,headers:o,...u!==void 0&&{body:u},...r?.timeout!==void 0&&{timeout:r.timeout}},i;try{i=await this.#e.request(l)}catch(y){throw this.#s(y)}let f=i.headers["content-type"]??i.headers["Content-Type"]??"",p;if(f.includes("application/json"))p=JSON.parse(i.body);else try{p=JSON.parse(i.body)}catch{p=i.body}let c=new Response(i.body,{status:i.status,statusText:i.statusText,headers:i.headers}),S=F(c.headers);return{data:p,status:i.status,statusText:i.statusText,headers:c.headers,request:new Request(n,{method:e,headers:o}),raw:c,retries:i.retries,...S!==void 0&&{rateLimit:S}}}async#o(e,t,r){let n=I(this.config.baseUrl,t),o={...this.config.headers??{},...r?.headers??{}},a=r?.body,u;a!==void 0&&(typeof a=="string"?u=a:typeof a=="object"&&a!==null&&!(a instanceof ReadableStream)&&(u=JSON.stringify(a),o["Content-Type"]===void 0&&(o["Content-Type"]="application/json")));let l={method:e,url:n,headers:o,...u!==void 0&&{body:u},...r?.timeout!==void 0&&{timeout:r.timeout}},i;try{i=await this.#e.requestStream(l)}catch(c){throw this.#s(c)}let f=new Headers(i.headers),p=F(f);return{body:i.body,status:i.status,statusText:i.statusText,headers:f,request:new Request(n,{method:e,headers:o}),raw:new Response(i.body,{status:i.status,statusText:i.statusText,headers:i.headers}),retries:0,...p!==void 0&&{rateLimit:p}}}close(){this.#e?.close(),this.#e=null,this.#t=null}},Q=s=>new J(s),C=s=>{if(s instanceof m)return s;let e=s instanceof Error?s:new Error(String(s));return new m(e.message,{cause:e})};var de="http://localhost:11434",B=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;_baseUrl;_client;config;constructor(e,t){this._baseUrl=e,this._client=Q({baseUrl:e,retry:!1}),this.config=t,this.modelId=t.model}async generateText(e,t){let r=Z(this.config,e,!1);try{let n=await this._client.post("/api/chat",{body:r,signal:t});return W(fe(n.data,this.modelId))}catch(n){if(n instanceof A)return N(n);let o=n instanceof m?n.statusCode??void 0:void 0;return N(new A(n instanceof Error?n.message:String(n),{provider:"ollama",statusCode:o,cause:n instanceof Error?n:void 0}))}}async*streamText(e,t){let r=Z(this.config,e,!0);try{let n=await this._client.postStream("/api/chat",{body:r,signal:t});for await(let o of V(n.body)){let a=ye(o);a!==null&&(yield a)}}catch(n){if(n instanceof A)yield{kind:"error",error:n};else{let o=n instanceof m?n.statusCode??void 0:void 0;yield{kind:"error",error:new A(n instanceof Error?n.message:String(n),{provider:"ollama",statusCode:o,cause:n instanceof Error?n:void 0})}}}}close(){return Promise.resolve()}getRawClient(){return null}},_e={provider:"ollama",createModel(s){let e=s.properties?.baseUrl??de;return Promise.resolve(new B(e,s))}},Z=(s,e,t)=>{let r=me(e.messages,e.system),n={model:s.model,messages:r,stream:t},o={};return e.temperature!==void 0&&(o.temperature=e.temperature),e.maxTokens!==void 0&&(o.num_predict=e.maxTokens),e.topP!==void 0&&(o.top_p=e.topP),e.stopWords!==void 0&&(o.stop=e.stopWords),Object.keys(o).length>0&&(n.options=o),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?n.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(n.format="json")),n},me=(s,e)=>{let t=[];e!==void 0&&t.push({role:"system",content:e});for(let r of s){if(r.role==="system"){let u=[];for(let l of r.content)l.kind==="text"&&u.push(l.text);t.push({role:"system",content:u.join(`
|
|
2
|
-
`)});continue}let n=[],o=[];for(let u of r.content)u.kind==="text"?n.push(u.text):u.kind==="image"&&u.image.url!==void 0&&o.push(u.image.url);let a={role:r.role==="tool"?"user":r.role,content:n.join(`
|
|
3
|
-
`)};o.length>0&&(a.images=o),t.push(a)}return t},fe=(s,e)=>{let t=[];return s.message?.content!==void 0&&t.push({kind:"text",text:s.message.content}),{content:t,stopReason:s.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:s.prompt_eval_count??0,outputTokens:s.eval_count??0,totalTokens:(s.prompt_eval_count??0)+(s.eval_count??0)},modelId:e,rawResponse:s}},ye=s=>{if(s===null||typeof s!="object")return null;let e=s;return e.done===!0?{kind:"message_done",stopReason:e.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:e.prompt_eval_count??0,outputTokens:e.eval_count??0,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}}:e.message?.content!==void 0&&e.message.content.length>0?{kind:"content_delta",textDelta:e.message.content}:e.response!==void 0&&e.response.length>0?{kind:"content_delta",textDelta:e.response}:null};export{B as a,_e as b};
|
package/chunks/chunk-VJRCTYGL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as s}from"./chunk-O4KKKYCH.js";var o=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],a=[{questionId:"verification",text:"What tests should be written? (unit, integration, e2e \u2014 be specific about what behavior to test)"},{questionId:"verification",text:"What documentation needs updating? (README, API docs, CHANGELOG, inline comments)"}],d=n=>o.map(e=>{let t=a.filter(i=>i.questionId===e.id),r=s(n,e.id);return{...e,extras:[...t,...r]}});var u=n=>{let e=new Set(n.map(t=>t.questionId));return o.every(t=>e.has(t.id))};export{o as a,d as b,u as c};
|
package/chunks/chunk-VXU6XZ66.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{i as E}from"./chunk-Y5E7ZCCX.js";import{d as H}from"./chunk-HISXAZ4Y.js";var y=e=>e.map(n=>typeof n=="string"?Z(n):n),Z=e=>({kind:"text",value:e}),le=(...e)=>({kind:"bold",children:y(e)}),pe=(...e)=>({kind:"dim",children:y(e)});var ue=(...e)=>({kind:"group",children:y(e)});var g=(e,...n)=>({kind:"color",color:e,children:y(n)}),de=(...e)=>g("red",...e),ce=(...e)=>g("green",...e),me=(...e)=>g("yellow",...e),ye=(...e)=>g("blue",...e),he=(...e)=>g("magenta",...e),fe=(...e)=>g("cyan",...e),ke=(...e)=>g("gray",...e);var Se=(e,n)=>({kind:"table",headers:y(e),rows:n.map(r=>y(r))});var we=(e,...n)=>({kind:"alert",level:e,children:y(n)}),h=e=>{switch(e.kind){case"text":return e.value.length;case"newline":return 1;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.reduce((n,r)=>n+h(r),0);case"code-block":return e.value.length;case"table":case"list":return 0;case"gauge":{let n=e.width??20,r=e.label?` ${e.label}`:"";return n+` ${e.percent}%`.length+r.length}case"separator":return 0;case"alert":return 2+e.children.reduce((n,r)=>n+h(r),0)}};var S=(e,n)=>{let r=typeof e=="string"?"text":e instanceof Uint8Array?"bytes":"structured";return{data:e,meta:{timestamp:Date.now(),kind:r,channel:"stdout",...n}}};var L=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
2
|
-
`;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.map(L).join("");case"code-block":return e.value.split(`
|
|
3
|
-
`).map(n=>` ${n}`).join(`
|
|
4
|
-
`)+`
|
|
5
|
-
`;case"table":{let n=e.headers.map((i,p)=>{let a=e.rows.reduce((T,c)=>{let d=c[p];return Math.max(T,d!==void 0?h(d):0)},0);return Math.max(h(i),a)}),r=(i,p)=>{let a=L(i),T=h(i);return a+" ".repeat(Math.max(0,p-T))},o=e.headers.map((i,p)=>r(i,n[p])).join(" "),t=n.map(i=>"-".repeat(i)).join(" "),l=e.rows.map(i=>i.map((p,a)=>r(p,n[a])).join(" ")).join(`
|
|
6
|
-
`);return`${o}
|
|
7
|
-
${t}
|
|
8
|
-
${l}
|
|
9
|
-
`}case"list":return e.items.map(n=>` - ${n.map(L).join("")}`).join(`
|
|
10
|
-
`)+`
|
|
11
|
-
`;case"gauge":{let n=e.width??20,r=Math.round(n*e.percent/100),o=n-r,t=`[${"=".repeat(r)}${" ".repeat(o)}]`,l=e.label?` ${e.label}`:"";return`${t} ${e.percent}%${l}`}case"separator":return e.label?`--- ${e.label} ---
|
|
12
|
-
`:`${"\u2500".repeat(40)}
|
|
13
|
-
`;case"alert":return`[${{info:"INFO",success:"OK",warning:"WARN",error:"ERROR"}[e.level]}] ${e.children.map(L).join("")}`}},R=()=>({name:"plain",render:e=>e.map(L).join("")});var I=()=>{let e=[];return{name:"buffer",writable:new WritableStream({write(n){e.push(n)}}),chunks:()=>e,items:()=>e.map(n=>n.data),clear:()=>{e.length=0}}};var ne=e=>{console.error(`[streams] Error at chunk #${e.chunkIndex} (${e.pendingCount} pending):`,e.error)},U=e=>{let n=[],r=e?.onError??ne,o=e?.renderer??R(),t=!1,l=!1,i=0,p=!1,a,d=(()=>{let u=e?.sink??I(),k=e?.layers??[];if(k.length===0)return u.writable;let{readable:v,writable:X}=new TransformStream,W=v;for(let D of k)W=W.pipeThrough(D.transform());return W.pipeTo(u.writable).catch(D=>{r({error:D,chunkIndex:i,pendingCount:n.length,lastChunk:n[n.length-1]})}),X})().getWriter(),w=async()=>{if(!l){for(l=!0,t=!1;n.length>0;){let u=n.shift();try{await d.ready,await d.write(u),i++}catch(k){r({error:k,chunkIndex:i,pendingCount:n.length,lastChunk:u}),n.length=0;break}}l=!1,a!==void 0&&(a(),a=void 0)}},$=()=>{t||(t=!0,queueMicrotask(w))},j=u=>{p||(n.push(u),$())},O={write:(...u)=>{let k=y(u),v=o.render(k);j(S(v))},writeln:(...u)=>{let k=y(u),v=o.render(k)+`
|
|
14
|
-
`;j(S(v))},flush:()=>n.length===0&&!t&&!l?Promise.resolve():new Promise(u=>{a=u,$()}),close:async()=>{p=!0,await O.flush();try{await d.close()}catch{}},pipe:(...u)=>U({sink:e?.sink,renderer:e?.renderer,layers:[...e?.layers??[],...u],onError:r})};return O};var P=class extends Error{constructor(n){super(n),this.name="StreamError"}},b=class extends P{cause;constructor(n,r){super(n),this.name="PipelineError",this.cause=r}},x=class extends P{constructor(n){super(`Pipeline timed out after ${n}ms`),this.name="TimeoutError"}};var re=()=>{let e,n=[],r,o={from:t=>(e=t,o),through:(...t)=>(n.push(...t),o),to:t=>(r=t,o),run:async t=>{if(e===void 0)throw new b("Pipeline has no source. Call .from() first.");if(r===void 0)throw new b("Pipeline has no sink. Call .to() first.");let l=e.readable;for(let a of n)l=l.pipeThrough(a.transform());let i=new AbortController,p;t?.timeout!==void 0&&t.timeout>0&&(p=setTimeout(()=>{i.abort(new x(t.timeout))},t.timeout));try{await l.pipeTo(r.writable,{signal:i.signal})}catch(a){throw a instanceof x?a:a instanceof DOMException&&a.name==="AbortError"?new x(t?.timeout??0):new b(`Pipeline failed: ${a instanceof Error?a.message:String(a)}`,a instanceof Error?a:void 0)}finally{p!==void 0&&clearTimeout(p)}},collect:async()=>{let t=I();return r=t,await o.run(),t.items()}};return o};var Y={};H(Y,{buffer:()=>I,multiplex:()=>K,nullSink:()=>z,stderr:()=>_,stdout:()=>N,writable:()=>F});var B,te=()=>(B===void 0&&(B=new TextEncoder),B),N=()=>{let e=E.process.stdout;return{name:"stdout",writable:new WritableStream({async write(n){let r=String(n.data),o=te().encode(r),t=e.getWriter();try{await t.write(o)}finally{t.releaseLock()}}})}};var q,oe=()=>(q===void 0&&(q=new TextEncoder),q),_=()=>{let e=E.process.stderr;return{name:"stderr",writable:new WritableStream({async write(n){let r=String(n.data),o=oe().encode(r),t=e.getWriter();try{await t.write(o)}finally{t.releaseLock()}}})}};var z=()=>({name:"null",writable:new WritableStream({write(e){}})});var F=(e,n)=>({name:n??"writable",writable:e});var K=(...e)=>{let n=e.map(r=>({name:r.name,writer:r.writable.getWriter()}));return{name:`multiplex(${e.map(r=>r.name).join(",")})`,writable:new WritableStream({async write(r){await Promise.all(n.map(o=>o.writer.write(r)))},async close(){await Promise.all(n.map(r=>r.writer.close()))},async abort(r){await Promise.all(n.map(o=>o.writer.abort(r)))}})}};var V={};H(V,{ansi:()=>J,markdown:()=>Q,plain:()=>R});var s="\x1B[",ae=`${s}0m`,m={bold:[`${s}1m`,`${s}22m`],dim:[`${s}2m`,`${s}22m`],italic:[`${s}3m`,`${s}23m`],underline:[`${s}4m`,`${s}24m`],strikethrough:[`${s}9m`,`${s}29m`]},M={black:`${s}30m`,red:`${s}31m`,green:`${s}32m`,yellow:`${s}33m`,blue:`${s}34m`,magenta:`${s}35m`,cyan:`${s}36m`,white:`${s}37m`,gray:`${s}90m`},A=`${s}39m`,C=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
15
|
-
`;case"bold":case"dim":case"italic":case"underline":case"strikethrough":{let[n,r]=m[e.kind];return`${n}${e.children.map(C).join("")}${r}`}case"color":return`${M[e.color]??M.white}${e.children.map(C).join("")}${A}`;case"group":return e.children.map(C).join("");case"code-block":{let n=m.dim[0],r=m.dim[1];return e.value.split(`
|
|
16
|
-
`).map(o=>`${n} ${o}${r}`).join(`
|
|
17
|
-
`)+`
|
|
18
|
-
`}case"table":{let n=e.headers.map((c,d)=>{let w=e.rows.reduce(($,j)=>{let O=j[d];return Math.max($,O!==void 0?h(O):0)},0);return Math.max(h(c),w)}),r=m.bold[0],o=m.bold[1],t=m.dim[0],l=m.dim[1],i=(c,d)=>{let w=C(c),$=h(c);return w+" ".repeat(Math.max(0,d-$))},p=e.headers.map((c,d)=>`${r}${i(c,n[d])}${o}`).join(" "),a=`${t}${n.map(c=>"\u2500".repeat(c)).join("\u2500\u2500")}${l}`,T=e.rows.map(c=>c.map((d,w)=>i(d,n[w])).join(" ")).join(`
|
|
19
|
-
`);return`${p}
|
|
20
|
-
${a}
|
|
21
|
-
${T}
|
|
22
|
-
`}case"list":return e.items.map(n=>` \u2022 ${n.map(C).join("")}`).join(`
|
|
23
|
-
`)+`
|
|
24
|
-
`;case"gauge":{let n=e.width??20,r=Math.round(n*e.percent/100),o=n-r,t=`${M.green}${"\u2588".repeat(r)}${A}${m.dim[0]}${"\u2591".repeat(o)}${m.dim[1]}`,l=` ${e.percent}%`,i=e.label?`${m.dim[0]} ${e.label}${m.dim[1]}`:"";return`${t}${l}${i}`}case"separator":{let n=m.dim[0],r=m.dim[1];if(e.label){let o="\u2500".repeat(Math.max(0,33-e.label.length));return`${n}\u2500\u2500\u2500\u2500 ${e.label} ${o}${r}
|
|
25
|
-
`}return`${n}${"\u2500".repeat(40)}${r}
|
|
26
|
-
`}case"alert":{let n={info:"\u2139",success:"\u2713",warning:"\u25B2",error:"\u2717"},r={info:"cyan",success:"green",warning:"yellow",error:"red"},o=n[e.level];return`${M[r[e.level]]}${o}${A} ${e.children.map(C).join("")}`}}},J=()=>({name:"ansi",render:e=>{let n=e.map(C).join("");return n.includes(s)?n+ae:n}});var f=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
27
|
-
`;case"bold":return`**${e.children.map(f).join("")}**`;case"italic":return`*${e.children.map(f).join("")}*`;case"strikethrough":return`~~${e.children.map(f).join("")}~~`;case"dim":case"underline":case"color":case"group":return e.children.map(f).join("");case"code-block":return`\`\`\`${e.language??""}
|
|
28
|
-
${e.value}
|
|
29
|
-
\`\`\`
|
|
30
|
-
`;case"table":{let n=`| ${e.headers.map(f).join(" | ")} |`,r=`| ${e.headers.map(()=>"---").join(" | ")} |`,o=e.rows.map(t=>`| ${t.map(f).join(" | ")} |`).join(`
|
|
31
|
-
`);return`${n}
|
|
32
|
-
${r}
|
|
33
|
-
${o}
|
|
34
|
-
`}case"list":return e.items.map(n=>`- ${n.map(f).join("")}`).join(`
|
|
35
|
-
`)+`
|
|
36
|
-
`;case"gauge":{let n=e.label?` \u2014 ${e.label}`:"";return`**${e.percent}%**${n}`}case"separator":return e.label?`--- ${e.label} ---
|
|
37
|
-
`:`---
|
|
38
|
-
`;case"alert":{let n={info:"\u2139 Info",success:"\u2713 Success",warning:"\u26A0 Warning",error:"\u2717 Error"},r=e.children.map(f).join("");return`> **${n[e.level]}:** ${r}
|
|
39
|
-
`}}},Q=()=>({name:"markdown",render:e=>e.map(f).join("")});export{S as a,Z as b,le as c,pe as d,ue as e,de as f,ce as g,me as h,ye as i,he as j,fe as k,ke as l,Se as m,we as n,U as o,re as p,Y as q,V as r};
|