@code-partner/codepipe 0.14.1-dev.305.g250dfd51 → 0.14.1-dev.309.g7a3294da

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 (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Jv=Object.defineProperty;var E=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ne=(t,e)=>{for(var r in e)Jv(t,r,{get:e[r],enumerable:!0})};var et,vt,Ta=E(()=>{"use strict";et="0.14.1-dev.305.g250dfd51",vt="https://hub.dev.codepipe.dev"});function bo(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=_d&&t<=$t}var $t,_d,jd=E(()=>{"use strict";Ta();$t=4,_d=4});var Nd=E(()=>{"use strict";Ta()});function ko(t=6){return`# CodePipe Context Repo format version.
2
+ var Jv=Object.defineProperty;var E=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ne=(t,e)=>{for(var r in e)Jv(t,r,{get:e[r],enumerable:!0})};var et,vt,Ta=E(()=>{"use strict";et="0.14.1-dev.309.g7a3294da",vt="https://hub.dev.codepipe.dev"});function bo(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=_d&&t<=$t}var $t,_d,jd=E(()=>{"use strict";Ta();$t=4,_d=4});var Nd=E(()=>{"use strict";Ta()});function ko(t=6){return`# CodePipe Context Repo format version.
3
3
  # Bumped by the scaffold / the format-migration PR \u2014 do not edit by hand.
4
4
  template_version: ${t}
5
5
  `}function Ca(t){if(!t)return 0;let e=/^\s*template_version:\s*(\d+)\s*$/m.exec(t),r=e?parseInt(e[1]??"",10):NaN;return Number.isFinite(r)&&r>=0?r:0}function Pa(t,e=Ia){let r=[];for(let n of e)if(!(n.version<=t))for(let o of n.addedPaths)r.includes(o)||r.push(o);return r}function Aa(t,e=Ia){return e.filter(r=>r.version>t)}var Od,xt,fn,Ia,Ld=E(()=>{"use strict";Od=6,xt=".codepipe-context.yaml",fn=".devpipe-context.yaml",Ia=[{version:1,summary:"ADR section: adr/ scaffold (README, template, derived INDEX) + the format-version stamp itself",addedPaths:["adr/README.md","adr/0000-template.md","adr/INDEX.md",xt]},{version:2,summary:"Rename the format-version stamp .devpipe-context.yaml \u2192 .codepipe-context.yaml (drop the devpipe-brand leftover)",addedPaths:[xt]},{version:3,summary:"Custom project actions (the RUN tab): actions/ scaffold with the format README",addedPaths:["actions/README.md"]},{version:4,summary:"Project map: model/ scaffold with the format README (facts/ vs derived/ layout)",addedPaths:["model/README.md"]},{version:5,summary:"Roles: roles/ scaffold with the format README (override a bundled critic by name, or add your own)",addedPaths:["roles/README.md"]},{version:6,summary:"Skills: skills/ scaffold with the format README (procedures the agent invokes instead of improvising)",addedPaths:["skills/README.md"]}]});function $o(t){return`model/facts/identity/${t}.yaml`}function _r(t){return`model/facts/events/${t}.yaml`}function Na(t){return`model/facts/annotations/${t}.md`}function Oa(t){return`model/derived/correlates/${t}.yaml`}function La(t){return`model/derived/touched/${t}.yaml`}function Md(t){return t===""?"root":t.replace(/\//g,"-")}function Ma(t,e){return`model/derived/structure/${t}/${Md(e)}.yaml`}function Ri(t){return typeof t=="string"&&Ud.test(t)}function re(t){if(typeof t!="string")return null;let e=t.indexOf(":");if(e<=0)return null;let r=t.indexOf(":",e+1);if(r<0)return null;let n=t.slice(0,e);if(!Dd.includes(n))return null;let o=t.slice(e+1,r),i=t.slice(r+1);return o===""&&!r$.includes(n)||i===""?null:{level:n,repo:o,path:i}}function Re(t){return`task::${t}`}function be(t,e,r){return`${t}:${e}:${r}`}function xo(t){let e=[];return _t(t)?(Ii(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),typeof t.repo!="string"&&e.push("repo: missing (empty string = cross-repo)"),typeof t.builtFromCommit!="string"&&e.push("builtFromCommit: missing"),Array.isArray(t.edges)?t.edges.forEach((r,n)=>{if(!_t(r)){e.push(`edges[${n}]: not an object`);return}Da.includes(r.kind)||e.push(`edges[${n}].kind: unknown "${String(r.kind)}"`),re(r.from)||e.push(`edges[${n}].from: malformed nodeKey`),re(r.to)||e.push(`edges[${n}].to: malformed nodeKey`),r.weight!==void 0&&!(typeof r.weight=="number"&&Number.isFinite(r.weight))&&e.push(`edges[${n}].weight: not a finite number`)}):e.push("edges: not an array"),e.length?{ok:!1,errors:e}:{ok:!0,value:t}):{ok:!1,errors:["edge sheet: not an object"]}}function Bd(t){return{...t,edges:mn(t.edges,e=>`${e.kind} ${e.from} ${e.to}`)}}function jr(t){return Or(Bd(t))}function _t(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ii(t){return typeof t=="number"&&Number.isInteger(t)&&t>0}function St(t){return typeof t=="string"&&t.length>0}function o$(t){return t.modelFormatVersion!==2}function Gt(t){let e=[];if(!_t(t))return{ok:!1,errors:["shard: not an object"]};Ii(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),St(t.repo)||e.push("repo: missing or empty"),St(t.builtFromCommit)||e.push("builtFromCommit: missing or empty");let r=typeof t.repo=="string"?t.repo:"",n=new Set;return Array.isArray(t.nodes)?t.nodes.forEach((o,i)=>{if(!_t(o)){e.push(`nodes[${i}]: not an object`);return}let s=re(o.key);if(!s){e.push(`nodes[${i}].key: malformed nodeKey (${JSON.stringify(o.key??null)})`);return}o.level!==s.level&&e.push(`nodes[${i}]: level "${String(o.level)}" does not match key prefix "${s.level}"`),r&&s.repo!==r&&e.push(`nodes[${i}].key: repo "${s.repo}" mixed into shard of repo "${r}"`);let a=o.key;n.has(a)&&e.push(`nodes[${i}].key: duplicate "${a}"`),n.add(a),o.entityId!==void 0&&!Ri(o.entityId)&&e.push(`nodes[${i}].entityId: malformed (${JSON.stringify(o.entityId)})`)}):e.push("nodes: not an array"),Array.isArray(t.edges)?t.edges.forEach((o,i)=>{if(!_t(o)){e.push(`edges[${i}]: not an object`);return}Da.includes(o.kind)||e.push(`edges[${i}].kind: unknown "${String(o.kind)}"`),(!St(o.to)||!re(o.to))&&e.push(`edges[${i}].to: malformed nodeKey`),(!St(o.from)||!n.has(o.from))&&e.push(`edges[${i}].from: "${String(o.from)}" is not a node of this shard`),o.weight!==void 0&&!(typeof o.weight=="number"&&Number.isFinite(o.weight))&&e.push(`edges[${i}].weight: not a finite number`)}):e.push("edges: not an array"),e.length?{ok:!1,errors:e}:{ok:!0,value:t}}function So(t){let e=[];if(!_t(t))return{ok:!1,errors:["identity: not an object"]};if(Ii(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),St(t.repo)||e.push("repo: missing or empty"),t.builtFromCommit!==void 0&&!St(t.builtFromCommit)&&e.push("builtFromCommit: not a non-empty string"),!Array.isArray(t.entities))e.push("entities: not an array");else{let r=new Set;t.entities.forEach((n,o)=>{if(!_t(n)){e.push(`entities[${o}]: not an object`);return}Ri(n.entityId)?r.has(n.entityId)?e.push(`entities[${o}].entityId: duplicate "${n.entityId}"`):r.add(n.entityId):e.push(`entities[${o}].entityId: malformed (${JSON.stringify(n.entityId??null)})`),re(n.currentKey)||e.push(`entities[${o}].currentKey: malformed nodeKey`),n.status!=="active"&&n.status!=="orphaned"&&e.push(`entities[${o}].status: expected active|orphaned`),St(n.firstSeen)||e.push(`entities[${o}].firstSeen: missing`),St(n.lastSeen)||e.push(`entities[${o}].lastSeen: missing`),n.aliases!==void 0&&(Array.isArray(n.aliases)?n.aliases.forEach((i,s)=>{(!_t(i)||!re(i.key)||!St(i.until))&&e.push(`entities[${o}].aliases[${s}]: malformed`)}):e.push(`entities[${o}].aliases: not an array`))})}return e.length?{ok:!1,errors:e}:{ok:!0,value:t}}function Kt(t){let e=[];return _t(t)?(Ii(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),St(t.taskKey)||e.push("taskKey: missing or empty"),t.origin!=="bootstrap"&&t.origin!=="pipeline"&&e.push("origin: expected bootstrap|pipeline"),t.date!==void 0&&!(typeof t.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t.date))&&e.push("date: expected YYYY-MM-DD"),(!Array.isArray(t.commits)||t.commits.some(r=>!St(r)))&&e.push("commits: not an array of non-empty strings"),Array.isArray(t.files)?t.files.forEach((r,n)=>{if(!_t(r)||!re(r.key)){e.push(`files[${n}].key: malformed nodeKey`);return}r.entityId!==void 0&&!Ri(r.entityId)&&e.push(`files[${n}].entityId: malformed`),r.churn!==void 0&&!(typeof r.churn=="number"&&r.churn>=0)&&e.push(`files[${n}].churn: not a non-negative number`)}):e.push("files: not an array"),e.length?{ok:!1,errors:e}:{ok:!0,value:t}):{ok:!1,errors:["event: not an object"]}}function mn(t,e){return[...t].sort((r,n)=>e(r)<e(n)?-1:e(r)>e(n)?1:0)}function Fd(t){return{...t,nodes:mn(t.nodes,e=>e.key),edges:mn(t.edges,e=>`${e.kind}\0${e.from}\0${e.to}`)}}function Gd(t){return{...t,entities:mn(t.entities,e=>e.entityId).map(e=>e.aliases?{...e,aliases:mn(e.aliases,r=>`${r.key}\0${r.until}`)}:e)}}function Kd(t){let e=t.links?{...t.links,...t.links.adr?{adr:[...t.links.adr].sort()}:{},...t.links.tasks?{tasks:[...t.links.tasks].sort()}:{}}:void 0;return{...t,commits:[...t.commits].sort(),files:mn(t.files,r=>r.key),...e?{links:e}:{}}}function vo(t){return i$.test(t)?t:JSON.stringify(t)}function Hd(t){if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"){if(!Number.isFinite(t))throw new Error(`model yaml: non-finite number ${t}`);return JSON.stringify(t)}if(typeof t=="string")return JSON.stringify(t);throw new Error(`model yaml: unsupported scalar ${typeof t}`)}function Wd(t){return t===null||["boolean","number","string"].includes(typeof t)}function _a(t){return Object.entries(t).filter(([,e])=>e!==void 0).sort(([e],[r])=>e<r?-1:e>r?1:0)}function qd(t,e,r){if(Array.isArray(t)){for(let n of t)if(Wd(n))r.push(`${e}- ${Hd(n)}`);else{if(Array.isArray(n))throw new Error("model yaml: nested arrays are not part of the model schema");{let o=_a(n);if(o.length===0){r.push(`${e}- {}`);continue}o.forEach(([i,s],a)=>{let c=a===0?`${e}- `:`${e} `;ja(i,s,c,`${e} `,r)})}}return}for(let[n,o]of _a(t))ja(n,o,e,e,r)}function ja(t,e,r,n,o){if(Wd(e))o.push(`${r}${vo(t)}: ${Hd(e)}`);else if(Array.isArray(e))e.length===0?o.push(`${r}${vo(t)}: []`):(o.push(`${r}${vo(t)}:`),qd(e,`${n} `,o));else{let i=_a(e);if(i.length===0)o.push(`${r}${vo(t)}: {}`);else{o.push(`${r}${vo(t)}:`);for(let[s,a]of i)ja(s,a,`${n} `,`${n} `,o)}}}function Or(t){let e=[];return qd(t,"",e),e.join(`
@@ -10,7 +10,7 @@ ${a.trim()}`.trim();continue}a.trim()||(i=null)}let s=[...r.entries()].filter(([
10
10
  `)[0]}`:s.id;i.push(`- **${c}**`),s.remark?.trim()&&i.push(` ${s.remark.trim()}`)}return o.length>0&&i.push("",`Approved and settled: ${o.join(", ")}. Do not revisit these unless a`,"rejected item forces it \u2014 and say so explicitly if it does."),i.join(`
11
11
  `)}function $c(t){let e=new Set;for(let r of t.items)if(r.kind==="procedure")for(let n of r.text.matchAll(K$))e.add(n[1]);return[...e]}var D$,U$,K$,Tp=E(()=>{"use strict";D$=[{re:/^decisions?$/i,kind:"decision",letter:"D"},{re:/^changes?$/i,kind:"change",letter:"C"},{re:/^assumptions?$/i,kind:"assumption",letter:"A"},{re:/^out of scope$/i,kind:"out_of_scope",letter:"O"},{re:/^test strategy$/i,kind:"test",letter:"T"},{re:/^procedures?$/i,kind:"procedure",letter:"P"}],U$=/^\s*[-*]\s+(?:\*\*)?\[([A-Z][0-9]+)\](?:\*\*)?\s*(.*)$/;K$=/`([a-z][a-z0-9-]{1,39})`/g});function q$(t){let e=[],r=null;for(let o of t.split(`
12
12
  `)){let i=W$.exec(o);if(i){r={id:i[1],status:i[2].toLowerCase(),text:i[3].trim()},e.push(r);continue}if(/^#{1,6}\s/.test(o)||/^\s*[-*]\s/.test(o)||!o.trim()){r=null;continue}r&&(r.text=`${r.text}
13
- ${o.trim()}`.trim())}let n={};for(let o of e)n[o.id]=o;return{items:e,byId:n}}function Y$(t,e){let r=new Set(t);return{unreported:t.filter(n=>!(n in e.byId)),unknown:e.items.filter(n=>!r.has(n.id)).map(n=>n.id),notDone:e.items.filter(n=>n.status!=="done")}}var H$,W$,Ip=E(()=>{"use strict";H$=["done","deviated","partial","dropped"],W$=/^\s*[-*]\s+(?:\*\*)?\[([A-Z][0-9]+)\](?:\*\*)?\s*[—:-]?\s*(done|deviated|partial|dropped)\b\s*[—:-]?\s*(.*)$/i});var Cp=E(()=>{"use strict"});var Pp=E(()=>{"use strict"});var Ap=E(()=>{"use strict"});function xc(t){return`codepipe-host-${t}`}function V$(t){let e=t.filter(r=>r!=="self-hosted");return`runs-on: [self-hosted${e.length?", "+e.join(", "):""}]`}var _p=E(()=>{"use strict"});function z$(t){let e=t.toLowerCase(),r="";for(let o of e)r+=Object.prototype.hasOwnProperty.call(jp,o)?jp[o]:o;return r.replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50).replace(/-+$/g,"")}function X$(t,e,r){let o=(t&&t.includes("<TASK_ID>")?t:Np).replace(/<TASK_ID>/g,e.toLowerCase()).replace(/<SLUG>/g,r??"");return o=o.replace(/-{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-\//g,"/").replace(/\/-/g,"/").replace(/^[-/]+|[-/]+$/g,""),o}function J$(t,e){if(t)return`${t.replace(/\/+$/,"")}/issue/${encodeURIComponent(e)}`}function rr(t){return!(!t||t.length>250||!/^[A-Za-z0-9._/-]+$/.test(t)||/^[-/.]/.test(t)||/[/.]$/.test(t)||t.endsWith(".lock")||t.includes("..")||t.includes("//")||t.includes("/."))}function Sc(t){if(!t||typeof t!="object")return null;let e=t,r=typeof e.owner=="string"?e.owner.trim():"",n=typeof e.repo=="string"?e.repo.trim():typeof e.repoName=="string"?e.repoName.trim():"",o=typeof e.host=="string"?e.host.trim():"";return!r||!n||o!=="github"&&o!=="gitlab"&&o!=="bitbucket"?null:{host:o,owner:r,repoName:n}}function Ec(t){if(!t.mirror)return t;let{mirror:e,...r}=t;return{...r,host:e.host,owner:e.owner,repoName:e.repoName}}function jt(t){return`${t}${Op}`}var Np,b0,jp,nr,Op,Rc=E(()=>{"use strict";Np="codepipe/<TASK_ID>",b0=50,jp={\u0430:"a",\u0431:"b",\u0432:"v",\u0433:"g",\u0434:"d",\u0435:"e",\u0451:"e",\u0436:"zh",\u0437:"z",\u0438:"i",\u0439:"y",\u043A:"k",\u043B:"l",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"p",\u0440:"r",\u0441:"s",\u0442:"t",\u0443:"u",\u0444:"f",\u0445:"h",\u0446:"c",\u0447:"ch",\u0448:"sh",\u0449:"sch",\u044A:"",\u044B:"y",\u044C:"",\u044D:"e",\u044E:"yu",\u044F:"ya"};nr=/^[a-z][a-z0-9-]{1,30}$/,Op="-codepipe-ctx"});function Z$(t){return t==="simple"||t==="gitflow"||t==="release"}function Tc(t){return t==="integration"||t==="stable"||t==="release_pattern"}function Q$(t){let e=t.endsWith("/*")?t.slice(0,-2):t;return rr(e)}function ex(t){let e=new Set(Ic[t.flow].roles);for(let r of Object.keys(t.branchTypes??{}))Tc(r)&&e.add(r);return e}function kn(t){if(t==null)return{config:null,errors:[]};let e=[];if(typeof t!="object"||Array.isArray(t))return{config:null,errors:["git: must be a mapping"]};let r=t,n=r.flow;if(!Z$(n))return e.push(`git.flow must be one of simple | gitflow | release (got ${JSON.stringify(n)})`),{config:null,errors:e};let o=n,i={},s=r.branch_types??r.branchTypes;if(s!==void 0)if(typeof s!="object"||s===null||Array.isArray(s))e.push("git.branch_types must be a mapping of role \u2192 name/pattern");else for(let[d,f]of Object.entries(s)){if(!Tc(d)){e.push(`git.branch_types: unknown role "${d}"`);continue}if(typeof f!="string"||!Lp(d,f)){e.push(`git.branch_types.${d}: invalid branch name/pattern ${JSON.stringify(f)}`);continue}i[d]=f}let a=new Set(Ic[o].roles);for(let d of Object.keys(i))a.add(d);let c={},l=r.branches;if(l!==void 0)if(typeof l!="object"||l===null||Array.isArray(l))e.push("git.branches must be a mapping of role \u2192 branch name");else for(let[d,f]of Object.entries(l)){if(!Tc(d)){e.push(`git.branches: unknown role "${d}"`);continue}if(!a.has(d)){e.push(`git.branches.${d}: role not part of flow "${o}"`);continue}if(typeof f!="string"||!Lp(d,f)){e.push(`git.branches.${d}: invalid branch name/pattern ${JSON.stringify(f)}`);continue}c[d]=f}let u,p=r.commit;if(p!==void 0)if(typeof p!="object"||p===null||Array.isArray(p))e.push("git.commit must be a mapping");else{let d=p.subject;d!==void 0&&typeof d!="string"?e.push("git.commit.subject must be a string"):typeof d=="string"?u={subject:d}:u={}}return e.length>0?{config:null,errors:e}:{config:{flow:o,branches:c,...Object.keys(i).length>0?{branchTypes:i}:{},...u?{commit:u}:{}},errors:[]}}function Lp(t,e){return t==="release_pattern"?Q$(e):rr(e)}function tx(t,e,r){let n=r??"main",o=e??t;if(!o)return{flow:"simple",integration:n};let i=ex(o),s=u=>o.branches[u]??o.branchTypes?.[u],a=s("integration")??n,c=i.has("stable")?s("stable"):void 0,l=i.has("release_pattern")?s("release_pattern"):void 0;return{flow:o.flow,integration:a,...c?{stable:c}:{},...l?{releasePattern:l}:{}}}function vn(t){return t.gitFlow?.integration??t.defaultBranch??"main"}function rx(t,e){return e??vn(t)}function Mp(t,e){if(e.endsWith("/*")){let r=e.slice(0,-1);return t.startsWith(r)&&t.length>r.length}return t===e}function Cc(t,e){return e.flow==="simple"?!1:!!(t===e.integration||e.stable&&t===e.stable||e.releasePattern&&Mp(t,e.releasePattern))}function Co(t){let e=t.branches??[],r=e.some(s=>/^release\//.test(s)),n=e.includes("develop")||e.includes("dev"),o=r?"release":n?"gitflow":"simple",i={integration:nx(o,t)};if(o!=="simple"){let s=ox(t,i.integration??"");s&&(i.stable=s)}return o==="release"&&(i.release_pattern="release/*"),{flow:o,branches:i}}function nx(t,e){let r=e.branches??[];if(t!=="simple"){if(r.includes("develop"))return"develop";if(r.includes("dev"))return"dev"}return e.defaultBranch??r[0]??""}function ox(t,e){let r=t.branches??[],n=t.defaultBranch;if(n&&(n==="main"||n==="master")&&n!==e)return n;if(r.includes("main")&&e!=="main")return"main";if(r.includes("master")&&e!=="master")return"master"}function Pc(t,e){if(t.flow==="simple")return!1;if(t.flow!==e.flow)return!0;let r=t.branches,n=e.branches;return(r.integration??"")!==(n.integration??"")||(r.stable??"")!==(n.stable??"")||(r.release_pattern??"")!==(n.release_pattern??"")}var Ic,Dp=E(()=>{"use strict";Rc();Ic={simple:{roles:["integration"]},gitflow:{roles:["integration","stable"]},release:{roles:["integration","stable","release_pattern"]}}});function ix(t,e,r=72){let n=(t||Up).replace(/\{key\}/g,e.key).replace(/\{summary\}/g,e.summary).replace(/\s+/g," ").trim(),o=Number.isFinite(r)&&r>0?Math.floor(r):72;if(n.length<=o)return n;let i=n.slice(0,o),s=i.lastIndexOf(" ");return s>=Math.floor(o/2)?i.slice(0,s).trimEnd():i.trimEnd()}var Up,x0,Bp=E(()=>{"use strict";Up="{key}: {summary}",x0=72});function sx(t,e){return`${t}:${e}`}var Fp=E(()=>{"use strict"});function Gp(t){let e=(t??"").trim();return/^pr_closed_without_merge\b/.test(e)?"blocked":/^(merge_failed|close_failed)\b/.test(e)||/^chain_base_changed\b/.test(e)||/^write action apply_delivery failed: .*hit conflicts/.test(e)?"conflict":/^(build_failed|ci_failed)\b/.test(e)?"loop_exhausted":"error"}function ax(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.to==="NEEDS_MANUAL")return r}return null}function cx(t,e){if(t==="AWAITING_ANSWER")return{kind:"question"};if(t==="NEEDS_MANUAL"){let n=ax(e)?.reason,o={kind:Gp(n)};return n&&(o.reason=n),o}}var Kp=E(()=>{"use strict"});function Mr(t){for(let e of Hp){let r=t.match(e.pattern);if(r)return{name:e.name,args:(r[1]??"").trim()}}return null}var Hp,Wp=E(()=>{"use strict";Hp=[{name:"rework",pattern:/^@(?:codepipe|devpipe)\s+rework:\s*(.+)$/im,description:"Send the task back to ANALYZING with a new instruction.",hasArg:!0},{name:"approve",pattern:/^@(?:codepipe|devpipe)\s+approve\s*$/im,description:"Merge every PR for this task (TRACKING only)."},{name:"reject",pattern:/^@(?:codepipe|devpipe)\s+reject(?::\s*(.+))?\s*$/im,description:"Abandon this task: close any open PR(s) and move it to DONE (reason rejected_and_closed). Valid from any non-terminal phase; from early phases it just skips the task.",hasArg:!0},{name:"merge",pattern:/^@(?:codepipe|devpipe)\s+merge\s*$/im,description:"Merge the task branch into the default branch without a PR (direct apply path, apply.pull_request=false; TRACKING only)."},{name:"rebase",pattern:/^@(?:codepipe|devpipe)\s+rebase\s*$/im,description:"Re-apply the patch on top of the latest base branch and force-push. Use after a PR merge conflict or APPLYING failure."},{name:"update",pattern:/^@(?:codepipe|devpipe)\s+update(?::\s*(.+))?\s*$/im,description:"Update a conflicting PR: resolve conflicts against the current base branch (TRACKING only). Optional `: <instruction>` is forwarded to the agent.",hasArg:!0},{name:"apply",pattern:/^@(?:codepipe|devpipe)\s+apply:\s*(local|auto)\s*$/im,description:"Override apply mode for this task: local (you apply by hand) or auto.",hasArg:!0},{name:"fix",pattern:/^@(?:codepipe|devpipe)\s+fix\s*$/im,description:"Fix the external review remarks on the developer's branch (waiting-for-fix state only)."}]});var qp=E(()=>{"use strict"});function Yp(t){let e=Math.max(1,Math.round(t));if(e<60)return`${e}s`;let r=Math.round(e/60);if(r<60)return`${r}m`;let n=Math.round(r/60);return n<24?`${n}h`:`${Math.round(n/24)}d`}function lx(t,e=Date.now()){return`${Yp((e-t)/1e3)} ago`}function ux(t){let e=Math.floor(t/86400),r=Math.floor(t%86400/3600),n=Math.floor(t%3600/60);return e>0?`${e}d ${r}h`:r>0?`${r}h ${n}m`:`${n}m`}var Vp=E(()=>{"use strict"});var zp=E(()=>{"use strict"});function Xp(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/^[^A-Z]+/,"").slice(0,10)}function _c(t){let e=t.split(/[^A-Za-z0-9]+/).filter(Boolean),r=Xp(e.length>=2?e.map(o=>o[0]).join(""):(e[0]??"").slice(0,4));if(Dr.test(r))return r;let n=Xp(t);return Dr.test(n)?n:Ni}function jc(t,e){let r=new Set([...e].map(n=>n.toUpperCase()));if(!r.has(t.toUpperCase()))return t;for(let n=1;n<1e4;n++){let o=String(n),i=t.slice(0,10-o.length)+o;if(!r.has(i.toUpperCase()))return i}return t}function xn(t){return`tasks/${t}/issue.yaml`}var Ac,Po,Ni,Dr,Oi,dx,Ao,$n,Jp=E(()=>{"use strict";Ac=["bug","feature","epic"],Po="feature",Ni="TASK",Dr=/^[A-Z][A-Z0-9]{1,9}$/;Oi={backlog:"Backlog",source:["To Do"],inProgress:"In Progress",review:"Review",done:["Done"],rejected:["Rejected"],statusColumns:["Backlog","To Do","In Progress","Review","Done","Rejected"]},dx=Oi.backlog,Ao="tracker/config.yaml",$n="tracker/counter"});function _o(t){let e=t.split(`
13
+ ${o.trim()}`.trim())}let n={};for(let o of e)n[o.id]=o;return{items:e,byId:n}}function Y$(t,e){let r=new Set(t);return{unreported:t.filter(n=>!(n in e.byId)),unknown:e.items.filter(n=>!r.has(n.id)).map(n=>n.id),notDone:e.items.filter(n=>n.status!=="done")}}var H$,W$,Ip=E(()=>{"use strict";H$=["done","deviated","partial","dropped"],W$=/^\s*[-*]\s+(?:\*\*)?\[([A-Z][0-9]+)\](?:\*\*)?\s*[—:-]?\s*(done|deviated|partial|dropped)\b\s*[—:-]?\s*(.*)$/i});var Cp=E(()=>{"use strict"});var Pp=E(()=>{"use strict"});var Ap=E(()=>{"use strict"});function xc(t){return`codepipe-host-${t}`}function V$(t){let e=t.filter(r=>r!=="self-hosted");return`runs-on: [self-hosted${e.length?", "+e.join(", "):""}]`}var _p=E(()=>{"use strict"});function z$(t){let e=t.toLowerCase(),r="";for(let o of e)r+=Object.prototype.hasOwnProperty.call(jp,o)?jp[o]:o;return r.replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50).replace(/-+$/g,"")}function X$(t,e,r){let o=(t&&t.includes("<TASK_ID>")?t:Np).replace(/<TASK_ID>/g,e.toLowerCase()).replace(/<SLUG>/g,r??"");return o=o.replace(/-{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-\//g,"/").replace(/\/-/g,"/").replace(/^[-/]+|[-/]+$/g,""),o}function J$(t,e){if(t)return`${t.replace(/\/+$/,"")}/issue/${encodeURIComponent(e)}`}function rr(t){return!(!t||t.length>250||!/^[A-Za-z0-9._/-]+$/.test(t)||/^[-/.]/.test(t)||/[/.]$/.test(t)||t.endsWith(".lock")||t.includes("..")||t.includes("//")||t.includes("/."))}function Sc(t){if(!t||typeof t!="object")return null;let e=t,r=typeof e.owner=="string"?e.owner.trim():"",n=typeof e.repo=="string"?e.repo.trim():typeof e.repoName=="string"?e.repoName.trim():"",o=typeof e.host=="string"?e.host.trim():"";return!r||!n||o!=="github"&&o!=="gitlab"&&o!=="bitbucket"?null:{host:o,owner:r,repoName:n}}function Ec(t){if(!t.mirror)return t;let{mirror:e,...r}=t;return{...r,host:e.host,owner:e.owner,repoName:e.repoName}}function jt(t){return`${t}${Op}`}var Np,b0,jp,nr,Op,Rc=E(()=>{"use strict";Np="codepipe/<TASK_ID>",b0=50,jp={\u0430:"a",\u0431:"b",\u0432:"v",\u0433:"g",\u0434:"d",\u0435:"e",\u0451:"e",\u0436:"zh",\u0437:"z",\u0438:"i",\u0439:"y",\u043A:"k",\u043B:"l",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"p",\u0440:"r",\u0441:"s",\u0442:"t",\u0443:"u",\u0444:"f",\u0445:"h",\u0446:"c",\u0447:"ch",\u0448:"sh",\u0449:"sch",\u044A:"",\u044B:"y",\u044C:"",\u044D:"e",\u044E:"yu",\u044F:"ya"};nr=/^[a-z][a-z0-9-]{1,30}$/,Op="-codepipe-ctx"});function Z$(t){return t==="simple"||t==="gitflow"||t==="release"}function Tc(t){return t==="integration"||t==="stable"||t==="release_pattern"}function Q$(t){let e=t.endsWith("/*")?t.slice(0,-2):t;return rr(e)}function ex(t){let e=new Set(Ic[t.flow].roles);for(let r of Object.keys(t.branchTypes??{}))Tc(r)&&e.add(r);return e}function kn(t){if(t==null)return{config:null,errors:[]};let e=[];if(typeof t!="object"||Array.isArray(t))return{config:null,errors:["git: must be a mapping"]};let r=t,n=r.flow;if(!Z$(n))return e.push(`git.flow must be one of simple | gitflow | release (got ${JSON.stringify(n)})`),{config:null,errors:e};let o=n,i={},s=r.branch_types??r.branchTypes;if(s!==void 0)if(typeof s!="object"||s===null||Array.isArray(s))e.push("git.branch_types must be a mapping of role \u2192 name/pattern");else for(let[d,f]of Object.entries(s)){if(!Tc(d)){e.push(`git.branch_types: unknown role "${d}"`);continue}if(typeof f!="string"||!Lp(d,f)){e.push(`git.branch_types.${d}: invalid branch name/pattern ${JSON.stringify(f)}`);continue}i[d]=f}let a=new Set(Ic[o].roles);for(let d of Object.keys(i))a.add(d);let c={},l=r.branches;if(l!==void 0)if(typeof l!="object"||l===null||Array.isArray(l))e.push("git.branches must be a mapping of role \u2192 branch name");else for(let[d,f]of Object.entries(l)){if(!Tc(d)){e.push(`git.branches: unknown role "${d}"`);continue}if(!a.has(d)){e.push(`git.branches.${d}: role not part of flow "${o}"`);continue}if(typeof f!="string"||!Lp(d,f)){e.push(`git.branches.${d}: invalid branch name/pattern ${JSON.stringify(f)}`);continue}c[d]=f}let u,p=r.commit;if(p!==void 0)if(typeof p!="object"||p===null||Array.isArray(p))e.push("git.commit must be a mapping");else{let d=p,f=d.subject,m=d.subject_max??d.subjectMax,y,b;f!==void 0&&typeof f!="string"?e.push("git.commit.subject must be a string"):typeof f=="string"&&f.trim()!==""&&(y=f),m!==void 0&&(typeof m!="number"||!Number.isInteger(m)||m<1?e.push("git.commit.subject_max must be a positive integer"):b=m),u={...y!==void 0?{subject:y}:{},...b!==void 0?{subjectMax:b}:{}}}return e.length>0?{config:null,errors:e}:{config:{flow:o,branches:c,...Object.keys(i).length>0?{branchTypes:i}:{},...u?{commit:u}:{}},errors:[]}}function Lp(t,e){return t==="release_pattern"?Q$(e):rr(e)}function tx(t,e,r){let n=r??"main",o=e??t;if(!o)return{flow:"simple",integration:n};let i=ex(o),s=u=>o.branches[u]??o.branchTypes?.[u],a=s("integration")??n,c=i.has("stable")?s("stable"):void 0,l=i.has("release_pattern")?s("release_pattern"):void 0;return{flow:o.flow,integration:a,...c?{stable:c}:{},...l?{releasePattern:l}:{}}}function vn(t){return t.gitFlow?.integration??t.defaultBranch??"main"}function rx(t,e){return e??vn(t)}function Mp(t,e){if(e.endsWith("/*")){let r=e.slice(0,-1);return t.startsWith(r)&&t.length>r.length}return t===e}function Cc(t,e){return e.flow==="simple"?!1:!!(t===e.integration||e.stable&&t===e.stable||e.releasePattern&&Mp(t,e.releasePattern))}function Co(t){let e=t.branches??[],r=e.some(s=>/^release\//.test(s)),n=e.includes("develop")||e.includes("dev"),o=r?"release":n?"gitflow":"simple",i={integration:nx(o,t)};if(o!=="simple"){let s=ox(t,i.integration??"");s&&(i.stable=s)}return o==="release"&&(i.release_pattern="release/*"),{flow:o,branches:i}}function nx(t,e){let r=e.branches??[];if(t!=="simple"){if(r.includes("develop"))return"develop";if(r.includes("dev"))return"dev"}return e.defaultBranch??r[0]??""}function ox(t,e){let r=t.branches??[],n=t.defaultBranch;if(n&&(n==="main"||n==="master")&&n!==e)return n;if(r.includes("main")&&e!=="main")return"main";if(r.includes("master")&&e!=="master")return"master"}function Pc(t,e){if(t.flow==="simple")return!1;if(t.flow!==e.flow)return!0;let r=t.branches,n=e.branches;return(r.integration??"")!==(n.integration??"")||(r.stable??"")!==(n.stable??"")||(r.release_pattern??"")!==(n.release_pattern??"")}var Ic,Dp=E(()=>{"use strict";Rc();Ic={simple:{roles:["integration"]},gitflow:{roles:["integration","stable"]},release:{roles:["integration","stable","release_pattern"]}}});function ix(t,e,r=72){let n=(t||Up).replace(/\{key\}/g,e.key).replace(/\{summary\}/g,e.summary).replace(/\s+/g," ").trim(),o=Number.isFinite(r)&&r>0?Math.floor(r):72;if(n.length<=o)return n;let i=n.slice(0,o),s=i.lastIndexOf(" ");return s>=Math.floor(o/2)?i.slice(0,s).trimEnd():i.trimEnd()}var Up,x0,Bp=E(()=>{"use strict";Up="{key}: {summary}",x0=72});function sx(t,e){return`${t}:${e}`}var Fp=E(()=>{"use strict"});function Gp(t){let e=(t??"").trim();return/^pr_closed_without_merge\b/.test(e)?"blocked":/^(merge_failed|close_failed)\b/.test(e)||/^chain_base_changed\b/.test(e)||/^write action apply_delivery failed: .*hit conflicts/.test(e)?"conflict":/^(build_failed|ci_failed)\b/.test(e)?"loop_exhausted":"error"}function ax(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.to==="NEEDS_MANUAL")return r}return null}function cx(t,e){if(t==="AWAITING_ANSWER")return{kind:"question"};if(t==="NEEDS_MANUAL"){let n=ax(e)?.reason,o={kind:Gp(n)};return n&&(o.reason=n),o}}var Kp=E(()=>{"use strict"});function Mr(t){for(let e of Hp){let r=t.match(e.pattern);if(r)return{name:e.name,args:(r[1]??"").trim()}}return null}var Hp,Wp=E(()=>{"use strict";Hp=[{name:"rework",pattern:/^@(?:codepipe|devpipe)\s+rework:\s*(.+)$/im,description:"Send the task back to ANALYZING with a new instruction.",hasArg:!0},{name:"approve",pattern:/^@(?:codepipe|devpipe)\s+approve\s*$/im,description:"Merge every PR for this task (TRACKING only)."},{name:"reject",pattern:/^@(?:codepipe|devpipe)\s+reject(?::\s*(.+))?\s*$/im,description:"Abandon this task: close any open PR(s) and move it to DONE (reason rejected_and_closed). Valid from any non-terminal phase; from early phases it just skips the task.",hasArg:!0},{name:"merge",pattern:/^@(?:codepipe|devpipe)\s+merge\s*$/im,description:"Merge the task branch into the default branch without a PR (direct apply path, apply.pull_request=false; TRACKING only)."},{name:"rebase",pattern:/^@(?:codepipe|devpipe)\s+rebase\s*$/im,description:"Re-apply the patch on top of the latest base branch and force-push. Use after a PR merge conflict or APPLYING failure."},{name:"update",pattern:/^@(?:codepipe|devpipe)\s+update(?::\s*(.+))?\s*$/im,description:"Update a conflicting PR: resolve conflicts against the current base branch (TRACKING only). Optional `: <instruction>` is forwarded to the agent.",hasArg:!0},{name:"apply",pattern:/^@(?:codepipe|devpipe)\s+apply:\s*(local|auto)\s*$/im,description:"Override apply mode for this task: local (you apply by hand) or auto.",hasArg:!0},{name:"fix",pattern:/^@(?:codepipe|devpipe)\s+fix\s*$/im,description:"Fix the external review remarks on the developer's branch (waiting-for-fix state only)."}]});var qp=E(()=>{"use strict"});function Yp(t){let e=Math.max(1,Math.round(t));if(e<60)return`${e}s`;let r=Math.round(e/60);if(r<60)return`${r}m`;let n=Math.round(r/60);return n<24?`${n}h`:`${Math.round(n/24)}d`}function lx(t,e=Date.now()){return`${Yp((e-t)/1e3)} ago`}function ux(t){let e=Math.floor(t/86400),r=Math.floor(t%86400/3600),n=Math.floor(t%3600/60);return e>0?`${e}d ${r}h`:r>0?`${r}h ${n}m`:`${n}m`}var Vp=E(()=>{"use strict"});var zp=E(()=>{"use strict"});function Xp(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/^[^A-Z]+/,"").slice(0,10)}function _c(t){let e=t.split(/[^A-Za-z0-9]+/).filter(Boolean),r=Xp(e.length>=2?e.map(o=>o[0]).join(""):(e[0]??"").slice(0,4));if(Dr.test(r))return r;let n=Xp(t);return Dr.test(n)?n:Ni}function jc(t,e){let r=new Set([...e].map(n=>n.toUpperCase()));if(!r.has(t.toUpperCase()))return t;for(let n=1;n<1e4;n++){let o=String(n),i=t.slice(0,10-o.length)+o;if(!r.has(i.toUpperCase()))return i}return t}function xn(t){return`tasks/${t}/issue.yaml`}var Ac,Po,Ni,Dr,Oi,dx,Ao,$n,Jp=E(()=>{"use strict";Ac=["bug","feature","epic"],Po="feature",Ni="TASK",Dr=/^[A-Z][A-Z0-9]{1,9}$/;Oi={backlog:"Backlog",source:["To Do"],inProgress:"In Progress",review:"Review",done:["Done"],rejected:["Rejected"],statusColumns:["Backlog","To Do","In Progress","Review","Done","Rejected"]},dx=Oi.backlog,Ao="tracker/config.yaml",$n="tracker/counter"});function _o(t){let e=t.split(`
14
14
  `),r=e.indexOf("---");if(r<0)return;let n=e.slice(r+1),o=n.lastIndexOf("## Attachments");o>=0&&n.slice(o+1).every(c=>c.trim()===""||/^- \[[^\]]*\]\(attachments\/[^)]*\)$/.test(c.trim()))&&(n=n.slice(0,o));let i=n.join(`
15
15
  `).trim();if(!(!i||i==="_(no description)_"))return i}function px(t){return`{{ancestorExcerpt:${t}}}`}var Li,Zp=E(()=>{"use strict";Li=/\{\{ancestorExcerpt:([^}]+)\}\}/g});var fx,Qp=E(()=>{"use strict";fx="youtrack"});function Ur(t){let e=t.match(/^git@([^:/]+):/);if(e)return e[1]??null;let r=t.match(/^ssh:\/\/(?:[^@/]+@)?([^/:]+)/);if(r)return r[1]??null;let n=t.match(/^https?:\/\/(?:[^@/]+@)?([^/:]+)/);return n?n[1]??null:null}function jo(t){switch(t){case Sn.gitlab:return"oauth2";case Sn.bitbucket:return"x-token-auth";default:return"x-access-token"}}var Sn,qt,ef=E(()=>{"use strict";Sn={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};qt="x-bitbucket-api-token-auth"});var tf=E(()=>{"use strict"});var rf=E(()=>{"use strict";Qp();ef();tf()});var Oc={};Ne(Oc,{ACTION_ID_RE:()=>ec,ACTION_STEP_DEFAULT_TIMEOUT_SEC:()=>rc,ALL_JOB_ROLES:()=>Va,ALL_MODEL_ROLE_KEYS:()=>Pi,ANALYSIS_MAX_DRAFTS:()=>Nc,ANCESTOR_EXCERPT_RE:()=>Li,ANCESTOR_EXCERPT_TOKEN:()=>px,ANNOTATION_MAX_PER_TASK:()=>Ba,BACKFILL_MAX_DRAFTS:()=>mx,BITBUCKET_API_TOKEN_GIT_USER:()=>qt,BRANCH_SLUG_MAX_LENGTH:()=>b0,BUILD_DISCOVERY:()=>Qd,COCHANGE_DEFAULTS:()=>lt,CODEPIPE_COMMANDS:()=>Hp,CODE_REVIEW_VERIFY:()=>ep,COMMIT_STYLE_MAX_LENGTH:()=>lc,CONTEXT_PACK_DECAY:()=>Ga,CONTEXT_PACK_DEFAULTS:()=>Nr,CONTEXT_REPO_SUFFIX:()=>Op,CONTEXT_STAMP_FILE:()=>xt,CONTEXT_TEMPLATE_CHANGELOG:()=>Ia,CONTEXT_TEMPLATE_VERSION:()=>Od,COUNCIL_MAX_ANSWER:()=>m0,DEFAULT_BRANCH_PATTERN:()=>Np,DEFAULT_COMMIT_SUBJECT:()=>Up,DEFAULT_HUB_URL:()=>vt,DEFAULT_INTERNAL_ISSUE_TYPE:()=>Po,DEFAULT_INTERNAL_TRACKER_PREFIX:()=>Ni,DEFAULT_LLM_PROVIDER:()=>tt,DEFAULT_REGIMEN_ALIASES:()=>ap,DEFAULT_SUBJECT_MAX:()=>x0,DEFAULT_TRACKER_PROVIDER:()=>fx,DEFAULT_WORKFLOW_PRESET:()=>op,EFFORT_LEVELS:()=>cp,EFFORT_LEVEL_SUGGESTIONS:()=>Ai,ENV_NAME_RE:()=>rt,FALLBACK_MODEL:()=>rp,GIT_FLOW_PRESETS:()=>Ic,GIT_HOST_DOMAINS:()=>Sn,INTERACTIVE_ROLES:()=>Jd,INTERNAL_ISSUE_TYPES:()=>Ac,INTERNAL_TRACKER_CONFIG_PATH:()=>Ao,INTERNAL_TRACKER_COUNTER_PATH:()=>$n,INTERNAL_TRACKER_DEFAULT_STATUS:()=>dx,INTERNAL_TRACKER_PREFIX_RE:()=>Dr,INTERNAL_TRACKER_STATUSES:()=>Oi,LANE_PHASES:()=>c$,LANE_SEGMENTS:()=>Ya,LANGUAGE_AUTO:()=>ke,LANGUAGE_SUGGESTIONS:()=>bn,LANGUAGE_VALUE_MAX_LENGTH:()=>Io,LEGACY_CONTEXT_STAMP_FILE:()=>fn,LLM_PROVIDER_SUGGESTIONS:()=>Ja,MIN_SUPPORTED_PROTOCOL:()=>_d,MODEL_ALIAS_SUGGESTIONS:()=>Ci,MODEL_DERIVED_DIR:()=>t$,MODEL_DERIVED_INDEX_PATH:()=>Ei,MODEL_DIR:()=>Zv,MODEL_EDGE_KINDS:()=>Da,MODEL_ENTITY_ID_RE:()=>Ud,MODEL_FACTS_DIR:()=>e$,MODEL_FAMILY_PREFERENCE:()=>sp,MODEL_HAIKU:()=>wn,MODEL_LEVELS:()=>Dd,MODEL_OPUS:()=>Ce,MODEL_README_PATH:()=>Qv,MODEL_RELATES_PATH:()=>Ar,MODEL_SEARCH_MAX_LIMIT:()=>Fa,MODEL_SEARCH_MAX_ROWS:()=>n$,MODEL_SEARCH_ROW_TEXT_MAX:()=>Ti,MODEL_SONNET:()=>Ht,MODEL_SUB_ROLES:()=>tp,OBSERVER_MAX_DECISION:()=>d0,OBSERVER_MAX_SUMMARY:()=>p0,OFFICIAL_MARKETPLACES:()=>vp,PHASES:()=>qa,PIPELINE_COLUMNS:()=>Vd,PLANNING_LANE_MAX_JOBS:()=>p$,PLANNING_ROLES:()=>Xd,PLATFORM_VERSION:()=>et,PRESET_ROLE_MODELS:()=>ip,PROJECT_ID_RE:()=>nr,PROJECT_LANGUAGE_SECTIONS:()=>To,PROJECT_MODEL_FORMAT_VERSION:()=>Fe,PROJECT_SETTINGS_MANIFEST:()=>fp,PROMPT_ROLES:()=>bp,PROTOCOL_VERSION:()=>$t,RECOMMENDED_ROLE_EFFORT:()=>Ro,RECOMMENDED_ROLE_MODELS:()=>Eo,RELATES_MIN_OVERLAP:()=>Ua,ROLE_MAX_DESCRIPTION:()=>s0,ROLE_MAX_REFS:()=>i0,ROLE_NAME_RE:()=>pc,ROLE_SCENARIOS:()=>ji,SKILL_MAX_DESCRIPTION:()=>l0,SKILL_NAME_RE:()=>wc,SOLUTION_STATUSES:()=>H$,STRING_MAP_MAX_ENTRIES:()=>ac,STRING_MAP_MAX_VALUE_LENGTH:()=>cc,WORKFLOW_PRESETS:()=>np,additionsSince:()=>Pa,ago:()=>lx,attentionFor:()=>cx,autoLanguageConfig:()=>dp,autoModelDefault:()=>Za,branchMatchesFlow:()=>Cc,canonicalizeModelEdgeSheet:()=>Bd,canonicalizeModelIdentityTable:()=>Gd,canonicalizeModelShard:()=>Fd,canonicalizeModelTaskEvent:()=>Kd,changesSince:()=>Aa,classifyAttentionReason:()=>Gp,compilePlanRework:()=>G$,contextRepoName:()=>jt,deserializeEffortConfig:()=>k$,deserializeModelConfig:()=>$$,detectGitFlowPreset:()=>Co,effectiveClusterBase:()=>rx,emptyEffortConfig:()=>yn,emptyModelConfig:()=>gn,enabledPluginsSetting:()=>O$,extractLanguageConfig:()=>T$,extractTaskMdBody:()=>_o,findSettingField:()=>mp,firstFreeInternalTrackerPrefix:()=>jc,flattenSettingFields:()=>uc,fmtDuration:()=>Yp,fmtUptime:()=>ux,ghRunnerHostLabel:()=>xc,ghRunnerRunsOnSnippet:()=>V$,gitCloneUrlDomain:()=>Ur,gitFlowDiverges:()=>Pc,httpsTokenUser:()=>jo,internalIssueYamlPath:()=>xn,isAllAutoLanguage:()=>I$,isAutoLanguage:()=>pp,isBodyEditFrozen:()=>a$,isInteractiveRole:()=>za,isModelEntityId:()=>Ri,isPromptRole:()=>gc,isProtocolCompatible:()=>bo,isReservedEnvName:()=>Wt,isTerminalPhase:()=>s$,isValidBranchName:()=>rr,jobLane:()=>d$,laneSegmentForPhase:()=>l$,makeTaskId:()=>sx,matchesReleasePattern:()=>Mp,mergeRoles:()=>mc,mergeSkills:()=>kc,mismatchedIds:()=>F$,modelAnnotationPath:()=>Na,modelComponentSlug:()=>Md,modelCorrelatesPath:()=>Oa,modelEventPath:()=>_r,modelIdentityPath:()=>$o,modelNodeKey:()=>be,modelShardNeedsRebuild:()=>o$,modelStructureShardPath:()=>Ma,modelTaskNodeKey:()=>Re,modelTouchedPath:()=>La,parseActionDefinition:()=>nc,parseCodepipeCommand:()=>Mr,parseContextStamp:()=>Ca,parseEffortConfig:()=>w$,parseGitConfig:()=>kn,parseMarketplaceSource:()=>$p,parseMarketplaces:()=>j$,parseModelConfig:()=>g$,parseModelNodeKey:()=>re,parsePlanItems:()=>vc,parseRepoMirror:()=>Sc,parseSolutionItems:()=>q$,parseWorkflowPreset:()=>f$,pipelineColumnForPhase:()=>u$,pipelineRepoSpec:()=>Ec,prescribedSkills:()=>$c,promptOverridePath:()=>yc,renderCommitSubject:()=>ix,renderContextStamp:()=>ko,repoBaseBranch:()=>vn,resolveBranchName:()=>X$,resolveEffortForRole:()=>y$,resolveModelForRole:()=>m$,resolveProvider:()=>h$,resolveRepoFlow:()=>tx,rolesForScenario:()=>hc,serializeEffortConfig:()=>b$,serializeModelConfig:()=>v$,serializeModelEdgeSheet:()=>jr,serializeModelIdentityTable:()=>Ha,serializeModelShard:()=>Ka,serializeModelTaskEvent:()=>hn,serializeModelYaml:()=>Or,slugify:()=>z$,solutionCoverage:()=>Y$,suggestInternalTrackerPrefix:()=>_c,validateActionInput:()=>oc,validateCouncilVerdict:()=>M$,validateModelEdgeSheet:()=>xo,validateModelIdentityTable:()=>So,validateModelShard:()=>Gt,validateModelTaskEvent:()=>Kt,validateObserverPlan:()=>L$,validateRoleDefinition:()=>fc,validateSettingEdit:()=>dc,validateSkill:()=>bc,youtrackIssueUrl:()=>J$,zeroUsage:()=>ut});var Nc,mx,M=E(()=>{"use strict";jd();Nd();Ld();Wa();Yd();zd();Xa();Qa();hp();gp();sc();ic();wp();kp();xp();Ep();Rp();Tp();Ip();Cp();Pp();Ap();_p();Rc();Dp();Bp();Fp();Kp();Wp();qp();Vp();zp();Jp();Zp();rf();Nc=20,mx=15});function ee(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}var Ye=E(()=>{"use strict"});import{existsSync as hx,readFileSync as gx,readdirSync as yx}from"node:fs";import{dirname as wx,join as Lc}from"node:path";import{parse as bx}from"yaml";function kx(t=process.cwd()){let e=t;for(;;){if(hx(Lc(e,nt,"project.yaml")))return e;let r=wx(e);if(r===e)return null;e=r}}function vx(t){return Lc(t,nt)}function je(t=process.cwd()){let e=kx(t);if(!e)return null;let r=vx(e),n=$x(gx(Lc(r,"project.yaml"),"utf-8"));for(let o of n.gitConfigErrors??[])console.warn(`project.yaml: invalid git config \u2014 ${o}`);return{root:e,contextDir:r,spec:n}}function nf(t,e,r){return yx(t).filter(o=>o!==".DS_Store").length===0?!0:e?r.some(o=>o.host===e.host&&o.owner===e.owner&&o.repoName===e.repoName):!1}function En(t,e=process.cwd()){try{let r=je(e);return r&&r.spec.projectId===t?r:null}catch{return null}}function $x(t){let e=bx(t);if(!e||typeof e!="object")throw new Error("project.yaml is empty or malformed");let r=String(e.id??""),n=String(e.name??r),o=Array.isArray(e.repos)?e.repos:[],i=[],s=[];s.push(...kn(e.git).errors.map(a=>`git: ${a}`));for(let a of o){if(!a||typeof a!="object")continue;let c=a,l=String(c.repo??c.repoName??""),u=String(c.name??l);if(!u||!l)continue;let p=c.host,d=p==="bitbucket"?"bitbucket":p==="gitlab"?"gitlab":"github",f=Sc(c.mirror);c.git!==void 0&&c.git!==null&&s.push(...kn(c.git).errors.map(m=>`repos[${u}].git: ${m}`)),i.push({name:u,host:d,owner:String(c.owner??""),repoName:l,defaultBranch:String(c.default_branch??c.defaultBranch??"main"),mountAs:String(c.mount_as??c.mountAs??u),...f?{mirror:f}:{}})}return{projectId:r,name:n,repos:i,...s.length>0?{gitConfigErrors:s}:{}}}function of(t){return t.host==="github"?`git@github.com:${t.owner}/${t.repoName}.git`:t.host==="gitlab"?`git@gitlab.com:${t.owner}/${t.repoName}.git`:`git@bitbucket.org:${t.owner}/${t.repoName}.git`}var nt,Et=E(()=>{"use strict";M();nt=".codepipe"});import{homedir as sf}from"node:os";import{mkdirSync as xx,readFileSync as Sx,writeFileSync as Ex,existsSync as Mc}from"node:fs";import{dirname as cf,join as Mi,resolve as Rx}from"node:path";import{fileURLToPath as Tx}from"node:url";function lf(t){let e=Mi(af,".env");if(Mc(e)&&process.loadEnvFile(e),t){let r=Mi(af,"profiles",t,".env");Mc(r)&&process.loadEnvFile(r)}}function Rn(t){let e=ee("CONFIG");return e||(t?Mi(sf(),".codepipe","profiles",t,"config.json"):Mi(sf(),".codepipe","config.json"))}function Rt(t){let e=Rn(t);if(!Mc(e))return null;let r=Sx(e,"utf-8");return JSON.parse(r)}function Yt(t,e){let r=Rn(e);xx(cf(r),{recursive:!0}),Ex(r,JSON.stringify(t,null,2)+`
16
16
  `,{mode:384})}function Tn(t){if(t)return{cfg:Ve(t),profile:t};let e;try{e=je()?.spec.projectId||void 0}catch{}if(e){let r=Rt(e);if(r)return console.log(`[profile] ${e} \u2014 resolved from this folder's workspace`),{cfg:r,profile:e};console.error(`this folder is the workspace of project '${e}', but that CLI profile is not initialised on this machine \u2014 run \`codepipe init\` here (or pass --profile).`),process.exit(1)}return{cfg:Ve(void 0),profile:void 0}}function Ve(t){let e=Rt(t);if(!e){let r=t?`codepipe init --profile ${t} --hub <url> --token <token> --project ${t}`:"codepipe init --hub <url> --token <token> --project <id>";console.error(t?`CLI profile '${t}' is not initialised. run \`${r}\` first.`:`CLI is not initialised. run \`${r}\` first.`),process.exit(1)}return e.projectId||(console.error(`config at ${Rn(t)} is missing 'projectId'. re-run init with --force.`),process.exit(1)),e}var af,Ge=E(()=>{"use strict";Ye();Et();af=Rx(cf(Tx(import.meta.url)),"..")});import{homedir as uf}from"node:os";import{existsSync as df,mkdirSync as pf,readFileSync as ff,writeFileSync as mf}from"node:fs";import{dirname as hf,join as gf}from"node:path";function yf(t,e,r){let n=X(t);if(!n)throw new Error("no secrets file for this project on the CLI");n.secrets={...n.secrets??{},[e]:r},ie(n)}function wf(t,e){let r=X(t);return!r?.secrets||!(e in r.secrets)?!1:(delete r.secrets[e],ie(r),!0)}function bf(t){return Object.keys(X(t)?.secrets??{}).sort()}function Di(t,e,r){let n=X(t);if(!n)return"mismatch";let o=n.sandboxPins??{},i=o[e];return i&&i===r?"ok":i&&i!==r?"mismatch":(o[e]=r,n.sandboxPins=o,ie(n),"pinned")}function kf(t,e){let r=X(t);return r?.sandboxPins?.[e]?(delete r.sandboxPins[e],ie(r),!0):!1}function Nt(t){return gf(uf(),".codepipe","secrets",`${t}.json`)}function X(t){let e=Nt(t);return df(e)?JSON.parse(ff(e,"utf-8")):null}function ie(t){let e=Nt(t.projectId);pf(hf(e),{recursive:!0}),mf(e,JSON.stringify(t,null,2)+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-partner/codepipe",
3
- "version": "0.14.1-dev.305.g250dfd51",
3
+ "version": "0.14.1-dev.309.g7a3294da",
4
4
  "description": "CodePipe turns tasks into reviewed pull requests: an AI agent analyzes, implements, and opens a PR under your control.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",