@code-partner/codepipe 0.8.0 → 0.8.1
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/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var eg=Object.defineProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var tg=(t,e)=>{for(var r in e)eg(t,r,{get:e[r],enumerable:!0})};var Ie,Ye,wi=k(()=>{"use strict";Ie="0.8.
|
|
2
|
+
var eg=Object.defineProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var tg=(t,e)=>{for(var r in e)eg(t,r,{get:e[r],enumerable:!0})};var Ie,Ye,wi=k(()=>{"use strict";Ie="0.8.1",Ye="https://hub.codepipe.dev"});function Kn(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=rg&&t<=Ve}var Ve,rg,xa=k(()=>{"use strict";wi();Ve=4,rg=4});var Sa=k(()=>{"use strict";wi()});function Wn(t=3){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
|
-
`}function Ra(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 Ia(t,e=Ta){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 Ca(t,e=Ta){return e.filter(r=>r.version>t)}var ze,Zr,Ta,Ea=k(()=>{"use strict";ze=".codepipe-context.yaml",Zr=".devpipe-context.yaml",Ta=[{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",ze]},{version:2,summary:"Rename the format-version stamp .devpipe-context.yaml \u2192 .codepipe-context.yaml (drop the devpipe-brand leftover)",addedPaths:[ze]},{version:3,summary:"Custom project actions (the RUN tab): actions/ scaffold with the format README",addedPaths:["actions/README.md"]}]});var Pa=k(()=>{"use strict"});var ng,dx,Aa=k(()=>{"use strict";ng=[{id:"intake",label:"Intake",phases:["INTAKE"]},{id:"analysis",label:"Analysis",phases:["ANALYZING","ESTIMATING"]},{id:"ready",label:"Ready",phases:["READY"]},{id:"implementation",label:"Implementation",phases:["IMPLEMENTING","BUILD"]},{id:"delivery",label:"Delivery",phases:["READY_TO_APPLY","APPLYING","AWAITING_CLUSTER"]}],dx=ng.flatMap(t=>t.phases)});function Ut(){return{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,totalCostUsd:0,model:"",numTurns:0,durationMs:0}}var ja,ki=k(()=>{"use strict";ja=["estimate","analyze","implement","resolve-conflict","rework","draft","build","code-review","index","backfill","analysis","chat"]});function _a(t,e){return e.toLowerCase().includes(t.toLowerCase())}function La(t){let e=t.filter(o=>o&&typeof o.id=="string"&&o.id.trim().length>0);if(e.length===0||ig.every(o=>e.some(i=>_a(o,i.id))))return null;let n=[...e].sort((o,i)=>{let s=o.createdAt??"",a=i.createdAt??"";return s!==a?s<a?1:-1:o.id<i.id?1:-1});for(let o of og){let i=n.find(s=>_a(o,s.id));if(i)return i.id}return n[0].id}var Je,Na,Ue,en,Oa,bi,$i,og,ig,vi=k(()=>{"use strict";Je="claude",Na=[Je],Ue="opus",en="sonnet",Oa="haiku",bi=[Ue,en,Oa],$i={analyze:Ue,implement:Ue,"resolve-conflict":Ue,rework:Ue,estimate:en,build:en,"code-review":Ue,draft:en,index:Ue,backfill:Ue,analysis:Ue,chat:Ue},og=[Ue,en,Oa],ig=Array.from(new Set(Object.values($i)))});function gt(t){return sg.has(t)?!0:ag.some(e=>t.startsWith(e))}function qn(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Bt(t,e){if(t!=null){if(typeof t!="string")throw new Error(`${e} must be a string`);return t}}function xi(t,e){if(t!=null){if(typeof t!="number"||!Number.isFinite(t))throw new Error(`${e} must be a number`);return t}}function Ga(t,e){let r=qn(e,"action definition"),n=t.replace(/\.(yml|yaml)$/i,""),o=Bt(r.id,"id")??n;if(!Da.test(o))throw new Error(`id must match ${Da} (got "${o}")`);if(o!==n)throw new Error(`id "${o}" must match the file name ("${n}")`);let i=Bt(r.title,"title")?.trim()||o,s;if(r.env!==void 0&&r.env!==null){let p=qn(r.env,"env");s={};for(let[d,m]of Object.entries(p)){if(!Ce.test(d))throw new Error(`env name "${d}" must match ${Ce}`);if(typeof m!="string"&&typeof m!="number"&&typeof m!="boolean")throw new Error(`env.${d} must be a scalar`);s[d]=String(m)}}let a,c=r.params;if(c!=null){if(!Array.isArray(c))throw new Error("params must be a list");if(c.length>Ua)throw new Error(`too many params (max ${Ua})`);let p=new Set;a=c.map((d,m)=>cg(d,m,p))}let l=r.steps;if(!Array.isArray(l)||l.length===0)throw new Error("steps must be a non-empty list");if(l.length>Ba)throw new Error(`too many steps (max ${Ba})`);let u=l.map((p,d)=>{let m=qn(p,`steps[${d}]`),f=Bt(m.run,`steps[${d}].run`);if(!f||f.trim().length===0)throw new Error(`steps[${d}].run is required`);let g=Bt(m.name,`steps[${d}].name`),y=xi(m.timeout_sec,`steps[${d}].timeout_sec`);if(y!==void 0&&(!Number.isInteger(y)||y<=0))throw new Error(`steps[${d}].timeout_sec must be a positive integer`);return{run:f,...g?{name:g}:{},...y!==void 0?{timeout_sec:y}:{}}});return{id:o,title:i,...s?{env:s}:{},...a?{params:a}:{},steps:u}}function cg(t,e,r){let n=qn(t,`params[${e}]`),o=Bt(n.name,`params[${e}].name`);if(!o||!Ce.test(o))throw new Error(`params[${e}].name must match ${Ce}`);if(r.has(o))throw new Error(`duplicate param "${o}"`);r.add(o);let i=n.type;if(i!=="string"&&i!=="enum"&&i!=="number"&&i!=="boolean")throw new Error(`params[${e}].type must be string | enum | number | boolean`);let s;if(i==="enum"){let m=n.enum;if(!Array.isArray(m)||m.length===0||!m.every(f=>typeof f=="string"))throw new Error(`params[${e}].enum must be a non-empty string list`);s=m}let a=Bt(n.label,`params[${e}].label`),c=Bt(n.help,`params[${e}].help`),l=n.required===!0,u=xi(n.min,`params[${e}].min`),p=xi(n.max,`params[${e}].max`),d=n.default;if(d!=null&&typeof d!="string"&&typeof d!="number"&&typeof d!="boolean")throw new Error(`params[${e}].default must be a scalar`);return{name:o,type:i,...a?{label:a}:{},...c?{help:c}:{},...l?{required:!0}:{},...s?{enum:s}:{},...u!==void 0?{min:u}:{},...p!==void 0?{max:p}:{},...d!=null?{default:d}:{}}}function Fa(t,e){let r=t.params??[],n=new Map(r.map(i=>[i.name,i]));for(let i of Object.keys(e))if(!n.has(i))return{ok:!1,error:`unknown param: ${i}`};let o={};for(let i of r){let s=e[i.name];if(s==null||typeof s=="string"&&s.trim()==="")if(i.default!==void 0)s=i.default;else{if(i.required)return{ok:!1,error:`${i.name} is required`};continue}switch(i.type){case"string":{if(typeof s!="string")return{ok:!1,error:`${i.name} must be a string`};o[i.name]=s;break}case"enum":{if(typeof s!="string"||!(i.enum??[]).includes(s))return{ok:!1,error:`${i.name} must be one of: ${(i.enum??[]).join(", ")}`};o[i.name]=s;break}case"number":{let a=typeof s=="number"?s:typeof s=="string"?Number(s):NaN;if(!Number.isFinite(a))return{ok:!1,error:`${i.name} must be a number`};if(i.min!==void 0&&a<i.min)return{ok:!1,error:`${i.name} must be \u2265 ${i.min}`};if(i.max!==void 0&&a>i.max)return{ok:!1,error:`${i.name} must be \u2264 ${i.max}`};o[i.name]=a;break}case"boolean":{let a=typeof s=="boolean"?s:s==="true"?!0:s==="false"?!1:null;if(a===null)return{ok:!1,error:`${i.name} must be a boolean`};o[i.name]=a;break}}}return{ok:!0,values:o}}var Ce,sg,ag,Ma,Da,Ua,Ba,Si=k(()=>{"use strict";Ce=/^[A-Z][A-Z0-9_]*$/,sg=new Set(["GH_TOKEN","GITHUB_TOKEN","GITLAB_TOKEN"]),ag=["BITBUCKET_","YOUTRACK_","CLAUDE_","INPUT_"];Ma=600,Da=/^[a-z0-9-]+$/,Ua=32,Ba=64});function qa(t=lg){let e=[];for(let r of t)e.push(...r.fields),r.groups&&e.push(...qa(r.groups));return e}function ug(t,e){let r=JSON.stringify(e);return qa().find(n=>n.file===t&&JSON.stringify(n.path)===r)}function Ya(t){let e=ug(t.file,t.path);if(!e)return{ok:!1,error:`unknown setting path: ${t.file}:${t.path.join(".")}`};let r=t.value,n=e.type==="model"||e.type==="enum"||e.type==="string";if(r===null||n&&typeof r=="string"&&r.trim().length===0)return e.nullable?{ok:!0,field:e,value:null}:{ok:!1,error:`${e.id} cannot be cleared`};switch(e.type){case"model":case"string":{if(typeof r!="string")return{ok:!1,error:`${e.id} must be a string`};let i=r.trim();return e.type==="string"&&e.mustContain&&!i.includes(e.mustContain)?{ok:!1,error:`${e.id} must contain "${e.mustContain}"`}:e.maxLength!==void 0&&i.length>e.maxLength?{ok:!1,error:`${e.id} must be \u2264 ${e.maxLength} chars`}:{ok:!0,field:e,value:i}}case"enum":{if(typeof r!="string")return{ok:!1,error:`${e.id} must be a string`};let i=r.trim();return e.suggestions?.includes(i)?{ok:!0,field:e,value:i}:{ok:!1,error:`${e.id} must be one of: ${(e.suggestions??[]).join(", ")}`}}case"number":return typeof r!="number"||!Number.isFinite(r)||!Number.isInteger(r)?{ok:!1,error:`${e.id} must be an integer`}:e.min!==void 0&&r<e.min?{ok:!1,error:`${e.id} must be \u2265 ${e.min}`}:e.max!==void 0&&r>e.max?{ok:!1,error:`${e.id} must be \u2264 ${e.max}`}:{ok:!0,field:e,value:r};case"boolean":return typeof r!="boolean"?{ok:!1,error:`${e.id} must be a boolean`}:{ok:!0,field:e,value:r};case"string_list":{if(!Array.isArray(r))return{ok:!1,error:`${e.id} must be a list`};let i=r.map(s=>typeof s=="string"?s.trim():"").filter(s=>s.length>0);return i.length===0?e.nullable?{ok:!0,field:e,value:null}:{ok:!1,error:`${e.id} must be a non-empty list`}:{ok:!0,field:e,value:i}}case"string_map":{if(typeof r!="object"||r===null||Array.isArray(r))return{ok:!1,error:`${e.id} must be a name\u2192value map`};let i=Object.entries(r);if(i.length===0)return e.nullable?{ok:!0,field:e,value:null}:{ok:!1,error:`${e.id} must be a non-empty map`};if(i.length>Ha)return{ok:!1,error:`${e.id} must have \u2264 ${Ha} entries`};let s={};for(let[a,c]of i){if(!Ce.test(a))return{ok:!1,error:`${e.id}: name "${a}" must match ${Ce}`};if(gt(a))return{ok:!1,error:`${e.id}: name "${a}" is reserved`};if(typeof c!="string")return{ok:!1,error:`${e.id}: value of "${a}" must be a string`};if(c.length>Ka)return{ok:!1,error:`${e.id}: value of "${a}" must be \u2264 ${Ka} chars`};s[a]=c}return{ok:!0,field:e,value:s}}}}var Ha,Ka,Wa,lg,Va=k(()=>{"use strict";Si();ki();vi();Ha=64,Ka=2e3,Wa=2e3,lg=[{id:"branch",label:"Branch",help:"Task-branch naming.",fields:[{id:"branch.pattern",file:"project.yaml",path:["branch","pattern"],type:"string",label:"Task-branch pattern",nullable:!0,mustContain:"<TASK_ID>",help:"Template for the per-task branch name. Must contain the <TASK_ID> placeholder. Empty \u21D2 default codepipe/<TASK_ID>."}]},{id:"llm",label:"LLM",fields:[{id:"llm.provider",file:"regimen.yaml",path:["llm","provider"],type:"enum",label:"Provider",nullable:!1,suggestions:[...Na],help:"LLM backend for this project. Currently only claude is available."}],groups:[{id:"llm.models",label:"Models by role",help:"Model per pipeline stage. Empty \u21D2 the role's recommended default applies.",fields:[{id:"llm.models.default",file:"regimen.yaml",path:["llm","models","default"],type:"model",label:"default (catch-all)",nullable:!0,suggestions:[...bi],help:"Overrides the recommended defaults for every role not listed below."},...ja.map(t=>({id:`llm.models.${t}`,file:"regimen.yaml",path:["llm","models",t],type:"model",label:t,nullable:!0,suggestions:[...bi],help:`recommended: ${$i[t]}`}))]}]},{id:"apply.style",label:"Commits & PRs",help:"Instructions for the AI agent on how to write commit messages and PR descriptions. Empty \u21D2 built-in templates.",fields:[{id:"apply.commit_style",file:"project.yaml",path:["apply","commit_style"],type:"string",label:"Commit message style",nullable:!0,multiline:!0,maxLength:Wa,help:'e.g. "English, imperative mood, first line \u2264 72 chars, start with the issue key". Empty \u21D2 "<KEY>: <task title>".'},{id:"apply.pr_style",file:"project.yaml",path:["apply","pr_style"],type:"string",label:"PR description style",nullable:!0,multiline:!0,maxLength:Wa,help:'e.g. "Russian, implementation details, bullet list of what was done". Empty \u21D2 the default PR body.'}]},{id:"variables",label:"Variables",help:"Non-secret env vars for custom actions (RUN tab). Secrets go via the sealed Secrets form on the Tokens section instead.",fields:[{id:"variables",file:"project.yaml",path:["variables"],type:"string_map",label:"Variables",nullable:!0,help:"NAME=value pairs, one per line. Names are env-style (A-Z, 0-9, _); reserved credential names are refused."}]},{id:"gates",label:"Gates",help:"Approval gate before the pipeline starts (on by default; orthogonal to automation).",fields:[{id:"gates.require_approval",file:"regimen.yaml",path:["gates","require_approval"],type:"boolean",label:"Require approval before start",nullable:!1,help:"When on (default), a task taken from Develop waits in the QUEUE for a single Confirm before the pipeline starts \u2014 the Confirm pulls in dependency closure and topologically orders the queue. Off \u21D2 conveyor: the task starts the pipeline immediately."}]},{id:"automation",label:"Automation",help:"How far the pipeline advances the G1\u2013G4 gates without a manual Run/Approve. Independent of the approval gate above.",fields:[{id:"automation.level",file:"regimen.yaml",path:["automation","level"],type:"enum",label:"Automation level",nullable:!1,suggestions:["assisted","full"],help:"assisted \u21D2 manual Run/Approve at each of G1\u2013G4; full \u21D2 gates auto-pass."}]}]});var za=k(()=>{"use strict"});var Ja=k(()=>{"use strict"});var Xa=k(()=>{"use strict"});function Qa(t){return`codepipe-host-${t}`}var Za=k(()=>{"use strict"});function ec(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 st(t){return`${t}${dg}`}var Mt,dg,tc=k(()=>{"use strict";Mt=/^[a-z][a-z0-9-]{1,30}$/,dg="-codepipe-ctx"});var rc=k(()=>{"use strict"});var nc=k(()=>{"use strict"});function sr(t){for(let e of pg){let r=t.match(e.pattern);if(r)return{name:e.name,args:(r[1]??"").trim()}}return null}var pg,oc=k(()=>{"use strict";pg=[{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}]});var ic=k(()=>{"use strict"});var sc=k(()=>{"use strict"});var ac=k(()=>{"use strict"});function cc(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/^[^A-Z]+/,"").slice(0,10)}function uc(t){let e=t.split(/[^A-Za-z0-9]+/).filter(Boolean),r=cc(e.length>=2?e.map(o=>o[0]).join(""):(e[0]??"").slice(0,4));if(ar.test(r))return r;let n=cc(t);return ar.test(n)?n:Ti}function dc(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 rn(t){return`tasks/${t}/issue.yaml`}var lc,Yn,Ti,ar,Ri,Rx,Vn,tn,pc=k(()=>{"use strict";lc=["bug","feature","epic"],Yn="feature",Ti="TASK",ar=/^[A-Z][A-Z0-9]{1,9}$/;Ri={backlog:"Backlog",source:["To Do"],inProgress:"In Progress",review:"Review",done:["Done"],rejected:["Rejected"],statusColumns:["Backlog","To Do","In Progress","Review","Done","Rejected"]},Rx=Ri.backlog,Vn="tracker/config.yaml",tn="tracker/counter"});var fc=k(()=>{"use strict"});function cr(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 zn(t){switch(t){case nn.gitlab:return"oauth2";case nn.bitbucket:return"x-token-auth";default:return"x-access-token"}}var nn,Gt,mc=k(()=>{"use strict";nn={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};Gt="x-bitbucket-api-token-auth"});var gc=k(()=>{"use strict"});var hc=k(()=>{"use strict";fc();mc();gc()});var yc,W=k(()=>{"use strict";xa();Sa();Ea();Pa();Aa();ki();vi();Va();Si();za();Ja();Xa();Za();tc();rc();nc();oc();ic();sc();ac();pc();hc();yc=20});function M(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}var ke=k(()=>{"use strict"});import{existsSync as wc,renameSync as fg}from"node:fs";function Ft(t,e,r=n=>console.error(n)){if(wc(e)||!wc(t))return!1;try{return fg(t,e),r(`migrated ${t} \u2192 ${e} (DevPipe \u2192 CodePipe)`),!0}catch(n){return r(`failed to migrate ${t} \u2192 ${e}: ${n instanceof Error?n.message:String(n)} \u2014 continuing with the legacy path untouched`),!1}}var Jn=k(()=>{"use strict"});import{existsSync as Xn,readFileSync as kc,readdirSync as mg,writeFileSync as gg}from"node:fs";import{dirname as hg,join as ht}from"node:path";import{parse as yg}from"yaml";function wg(t=process.cwd()){let e=t;for(;;){if(Xn(ht(e,Xe,"project.yaml")))return e;if(Xn(ht(e,Ii,"project.yaml")))return Ft(ht(e,Ii),ht(e,Xe))&&bg(e),e;let r=hg(e);if(r===e)return null;e=r}}function kg(t){let e=ht(t,Xe);return Xn(e)?e:ht(t,Ii)}function bg(t){let e=ht(t,".gitignore");if(!Xn(e))return;let r=kc(e,"utf-8"),n=r.split(/\r?\n/).map(o=>{let i=o.trim();return i===".devpipe"||i===".devpipe/"||i==="/.devpipe"||i==="/.devpipe/"?o.replace(".devpipe",".codepipe"):o}).join(`
|
|
5
|
+
`}function Ra(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 Ia(t,e=Ta){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 Ca(t,e=Ta){return e.filter(r=>r.version>t)}var ze,Zr,Ta,Ea=k(()=>{"use strict";ze=".codepipe-context.yaml",Zr=".devpipe-context.yaml",Ta=[{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",ze]},{version:2,summary:"Rename the format-version stamp .devpipe-context.yaml \u2192 .codepipe-context.yaml (drop the devpipe-brand leftover)",addedPaths:[ze]},{version:3,summary:"Custom project actions (the RUN tab): actions/ scaffold with the format README",addedPaths:["actions/README.md"]}]});var Pa=k(()=>{"use strict"});var ng,dx,Aa=k(()=>{"use strict";ng=[{id:"intake",label:"Intake",phases:["INTAKE"]},{id:"analysis",label:"Analysis",phases:["ANALYZING","ESTIMATING"]},{id:"ready",label:"Ready",phases:["READY"]},{id:"implementation",label:"Implementation",phases:["IMPLEMENTING","BUILD"]},{id:"delivery",label:"Delivery",phases:["READY_TO_APPLY","APPLYING","AWAITING_CLUSTER"]}],dx=ng.flatMap(t=>t.phases)});function Ut(){return{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,totalCostUsd:0,model:"",numTurns:0,durationMs:0}}var ja,ki=k(()=>{"use strict";ja=["estimate","analyze","implement","resolve-conflict","rework","draft","build","code-review","index","backfill","analysis","chat"]});function _a(t,e){return e.toLowerCase().includes(t.toLowerCase())}function La(t){let e=t.filter(o=>o&&typeof o.id=="string"&&o.id.trim().length>0);if(e.length===0||ig.every(o=>e.some(i=>_a(o,i.id))))return null;let n=[...e].sort((o,i)=>{let s=o.createdAt??"",a=i.createdAt??"";return s!==a?s<a?1:-1:o.id<i.id?1:-1});for(let o of og){let i=n.find(s=>_a(o,s.id));if(i)return i.id}return n[0].id}var Je,Na,Ue,en,Oa,bi,$i,og,ig,vi=k(()=>{"use strict";Je="claude",Na=[Je],Ue="opus",en="sonnet",Oa="haiku",bi=[Ue,en,Oa],$i={analyze:Ue,implement:Ue,"resolve-conflict":Ue,rework:Ue,estimate:en,build:en,"code-review":Ue,draft:en,index:Ue,backfill:Ue,analysis:Ue,chat:Ue},og=[Ue,en,Oa],ig=Array.from(new Set(Object.values($i)))});function gt(t){return sg.has(t)?!0:ag.some(e=>t.startsWith(e))}function qn(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Bt(t,e){if(t!=null){if(typeof t!="string")throw new Error(`${e} must be a string`);return t}}function xi(t,e){if(t!=null){if(typeof t!="number"||!Number.isFinite(t))throw new Error(`${e} must be a number`);return t}}function Ga(t,e){let r=qn(e,"action definition"),n=t.replace(/\.(yml|yaml)$/i,""),o=Bt(r.id,"id")??n;if(!Da.test(o))throw new Error(`id must match ${Da} (got "${o}")`);if(o!==n)throw new Error(`id "${o}" must match the file name ("${n}")`);let i=Bt(r.title,"title")?.trim()||o,s;if(r.env!==void 0&&r.env!==null){let p=qn(r.env,"env");s={};for(let[d,m]of Object.entries(p)){if(!Ce.test(d))throw new Error(`env name "${d}" must match ${Ce}`);if(typeof m!="string"&&typeof m!="number"&&typeof m!="boolean")throw new Error(`env.${d} must be a scalar`);s[d]=String(m)}}let a,c=r.params;if(c!=null){if(!Array.isArray(c))throw new Error("params must be a list");if(c.length>Ua)throw new Error(`too many params (max ${Ua})`);let p=new Set;a=c.map((d,m)=>cg(d,m,p))}let l=r.steps;if(!Array.isArray(l)||l.length===0)throw new Error("steps must be a non-empty list");if(l.length>Ba)throw new Error(`too many steps (max ${Ba})`);let u=l.map((p,d)=>{let m=qn(p,`steps[${d}]`),f=Bt(m.run,`steps[${d}].run`);if(!f||f.trim().length===0)throw new Error(`steps[${d}].run is required`);let g=Bt(m.name,`steps[${d}].name`),y=xi(m.timeout_sec,`steps[${d}].timeout_sec`);if(y!==void 0&&(!Number.isInteger(y)||y<=0))throw new Error(`steps[${d}].timeout_sec must be a positive integer`);return{run:f,...g?{name:g}:{},...y!==void 0?{timeout_sec:y}:{}}});return{id:o,title:i,...s?{env:s}:{},...a?{params:a}:{},steps:u}}function cg(t,e,r){let n=qn(t,`params[${e}]`),o=Bt(n.name,`params[${e}].name`);if(!o||!Ce.test(o))throw new Error(`params[${e}].name must match ${Ce}`);if(r.has(o))throw new Error(`duplicate param "${o}"`);r.add(o);let i=n.type;if(i!=="string"&&i!=="enum"&&i!=="number"&&i!=="boolean")throw new Error(`params[${e}].type must be string | enum | number | boolean`);let s;if(i==="enum"){let m=n.enum;if(!Array.isArray(m)||m.length===0||!m.every(f=>typeof f=="string"))throw new Error(`params[${e}].enum must be a non-empty string list`);s=m}let a=Bt(n.label,`params[${e}].label`),c=Bt(n.help,`params[${e}].help`),l=n.required===!0,u=xi(n.min,`params[${e}].min`),p=xi(n.max,`params[${e}].max`),d=n.default;if(d!=null&&typeof d!="string"&&typeof d!="number"&&typeof d!="boolean")throw new Error(`params[${e}].default must be a scalar`);return{name:o,type:i,...a?{label:a}:{},...c?{help:c}:{},...l?{required:!0}:{},...s?{enum:s}:{},...u!==void 0?{min:u}:{},...p!==void 0?{max:p}:{},...d!=null?{default:d}:{}}}function Fa(t,e){let r=t.params??[],n=new Map(r.map(i=>[i.name,i]));for(let i of Object.keys(e))if(!n.has(i))return{ok:!1,error:`unknown param: ${i}`};let o={};for(let i of r){let s=e[i.name];if(s==null||typeof s=="string"&&s.trim()==="")if(i.default!==void 0)s=i.default;else{if(i.required)return{ok:!1,error:`${i.name} is required`};continue}switch(i.type){case"string":{if(typeof s!="string")return{ok:!1,error:`${i.name} must be a string`};o[i.name]=s;break}case"enum":{if(typeof s!="string"||!(i.enum??[]).includes(s))return{ok:!1,error:`${i.name} must be one of: ${(i.enum??[]).join(", ")}`};o[i.name]=s;break}case"number":{let a=typeof s=="number"?s:typeof s=="string"?Number(s):NaN;if(!Number.isFinite(a))return{ok:!1,error:`${i.name} must be a number`};if(i.min!==void 0&&a<i.min)return{ok:!1,error:`${i.name} must be \u2265 ${i.min}`};if(i.max!==void 0&&a>i.max)return{ok:!1,error:`${i.name} must be \u2264 ${i.max}`};o[i.name]=a;break}case"boolean":{let a=typeof s=="boolean"?s:s==="true"?!0:s==="false"?!1:null;if(a===null)return{ok:!1,error:`${i.name} must be a boolean`};o[i.name]=a;break}}}return{ok:!0,values:o}}var Ce,sg,ag,Ma,Da,Ua,Ba,Si=k(()=>{"use strict";Ce=/^[A-Z][A-Z0-9_]*$/,sg=new Set(["GH_TOKEN","GITHUB_TOKEN","GITLAB_TOKEN"]),ag=["BITBUCKET_","YOUTRACK_","CLAUDE_","INPUT_"];Ma=600,Da=/^[a-z0-9-]+$/,Ua=32,Ba=64});function qa(t=lg){let e=[];for(let r of t)e.push(...r.fields),r.groups&&e.push(...qa(r.groups));return e}function ug(t,e){let r=JSON.stringify(e);return qa().find(n=>n.file===t&&JSON.stringify(n.path)===r)}function Ya(t){let e=ug(t.file,t.path);if(!e)return{ok:!1,error:`unknown setting path: ${t.file}:${t.path.join(".")}`};let r=t.value,n=e.type==="model"||e.type==="enum"||e.type==="string";if(r===null||n&&typeof r=="string"&&r.trim().length===0)return e.nullable?{ok:!0,field:e,value:null}:{ok:!1,error:`${e.id} cannot be cleared`};switch(e.type){case"model":case"string":{if(typeof r!="string")return{ok:!1,error:`${e.id} must be a string`};let i=r.trim();return e.type==="string"&&e.mustContain&&!i.includes(e.mustContain)?{ok:!1,error:`${e.id} must contain "${e.mustContain}"`}:e.maxLength!==void 0&&i.length>e.maxLength?{ok:!1,error:`${e.id} must be \u2264 ${e.maxLength} chars`}:{ok:!0,field:e,value:i}}case"enum":{if(typeof r!="string")return{ok:!1,error:`${e.id} must be a string`};let i=r.trim();return e.suggestions?.includes(i)?{ok:!0,field:e,value:i}:{ok:!1,error:`${e.id} must be one of: ${(e.suggestions??[]).join(", ")}`}}case"number":return typeof r!="number"||!Number.isFinite(r)||!Number.isInteger(r)?{ok:!1,error:`${e.id} must be an integer`}:e.min!==void 0&&r<e.min?{ok:!1,error:`${e.id} must be \u2265 ${e.min}`}:e.max!==void 0&&r>e.max?{ok:!1,error:`${e.id} must be \u2264 ${e.max}`}:{ok:!0,field:e,value:r};case"boolean":return typeof r!="boolean"?{ok:!1,error:`${e.id} must be a boolean`}:{ok:!0,field:e,value:r};case"string_list":{if(!Array.isArray(r))return{ok:!1,error:`${e.id} must be a list`};let i=r.map(s=>typeof s=="string"?s.trim():"").filter(s=>s.length>0);return i.length===0?e.nullable?{ok:!0,field:e,value:null}:{ok:!1,error:`${e.id} must be a non-empty list`}:{ok:!0,field:e,value:i}}case"string_map":{if(typeof r!="object"||r===null||Array.isArray(r))return{ok:!1,error:`${e.id} must be a name\u2192value map`};let i=Object.entries(r);if(i.length===0)return e.nullable?{ok:!0,field:e,value:null}:{ok:!1,error:`${e.id} must be a non-empty map`};if(i.length>Ha)return{ok:!1,error:`${e.id} must have \u2264 ${Ha} entries`};let s={};for(let[a,c]of i){if(!Ce.test(a))return{ok:!1,error:`${e.id}: name "${a}" must match ${Ce}`};if(gt(a))return{ok:!1,error:`${e.id}: name "${a}" is reserved`};if(typeof c!="string")return{ok:!1,error:`${e.id}: value of "${a}" must be a string`};if(c.length>Ka)return{ok:!1,error:`${e.id}: value of "${a}" must be \u2264 ${Ka} chars`};s[a]=c}return{ok:!0,field:e,value:s}}}}var Ha,Ka,Wa,lg,Va=k(()=>{"use strict";Si();ki();vi();Ha=64,Ka=2e3,Wa=2e3,lg=[{id:"branch",label:"Branch",help:"Task-branch naming.",fields:[{id:"branch.pattern",file:"project.yaml",path:["branch","pattern"],type:"string",label:"Task-branch pattern",nullable:!0,mustContain:"<TASK_ID>",help:"Template for the per-task branch name. Must contain the <TASK_ID> placeholder. Empty \u21D2 default codepipe/<TASK_ID>."}]},{id:"llm",label:"LLM",fields:[{id:"llm.provider",file:"regimen.yaml",path:["llm","provider"],type:"enum",label:"Provider",nullable:!1,suggestions:[...Na],help:"LLM backend for this project. Currently only claude is available."}],groups:[{id:"llm.models",label:"Models by role",help:"Model per pipeline stage. Empty \u21D2 the role's recommended default applies.",fields:[{id:"llm.models.default",file:"regimen.yaml",path:["llm","models","default"],type:"model",label:"default (catch-all)",nullable:!0,suggestions:[...bi],help:"Overrides the recommended defaults for every role not listed below."},...ja.map(t=>({id:`llm.models.${t}`,file:"regimen.yaml",path:["llm","models",t],type:"model",label:t,nullable:!0,suggestions:[...bi],help:`recommended: ${$i[t]}`}))]}]},{id:"apply.style",label:"Commits & PRs",help:"Instructions for the AI agent on how to write commit messages and PR descriptions. Empty \u21D2 built-in templates.",fields:[{id:"apply.commit_style",file:"project.yaml",path:["apply","commit_style"],type:"string",label:"Commit message style",nullable:!0,multiline:!0,maxLength:Wa,help:'e.g. "English, imperative mood, first line \u2264 72 chars, start with the issue key". Empty \u21D2 "<KEY>: <task title>".'},{id:"apply.pr_style",file:"project.yaml",path:["apply","pr_style"],type:"string",label:"PR description style",nullable:!0,multiline:!0,maxLength:Wa,help:'e.g. "Russian, implementation details, bullet list of what was done". Empty \u21D2 the default PR body.'}]},{id:"variables",label:"Variables",help:"Non-secret env vars for custom actions (RUN tab). Secrets go via the sealed Secrets form on the Tokens section instead.",fields:[{id:"variables",file:"project.yaml",path:["variables"],type:"string_map",label:"Variables",nullable:!0,help:"NAME=value pairs, one per line. Names are env-style (A-Z, 0-9, _); reserved credential names are refused."}]},{id:"gates",label:"Gates",help:"Approval gate before the pipeline starts (on by default; orthogonal to automation).",fields:[{id:"gates.require_approval",file:"regimen.yaml",path:["gates","require_approval"],type:"boolean",label:"Require approval before start",nullable:!1,help:"When on (default), a task taken from Develop waits in the QUEUE for a single Confirm before the pipeline starts \u2014 the Confirm pulls in dependency closure and topologically orders the queue. Off \u21D2 conveyor: the task starts the pipeline immediately."}]},{id:"automation",label:"Automation",help:"How far the pipeline advances the G1\u2013G4 gates without a manual Run/Approve. Independent of the approval gate above.",fields:[{id:"automation.level",file:"regimen.yaml",path:["automation","level"],type:"enum",label:"Automation level",nullable:!1,suggestions:["assisted","full"],help:"assisted \u21D2 manual Run/Approve at each of G1\u2013G4; full \u21D2 gates auto-pass."}]},{id:"implementation",label:"Implementation",help:"How a dependency cluster is serialized into branches and PRs.",fields:[{id:"implementation.mode",file:"regimen.yaml",path:["implementation","mode"],type:"enum",label:"Implementation mode",nullable:!0,suggestions:["cluster-pr","sequential","parallel"],help:"cluster-pr (default for new projects) \u2014 one shared branch and a single PR per dependency cluster; a lone task is a cluster of one. sequential / parallel are an explicit opt-out of that. Clearing removes the key from regimen.yaml but keeps the mode already stored for the project (it is not reset to the default)."}]}]});var za=k(()=>{"use strict"});var Ja=k(()=>{"use strict"});var Xa=k(()=>{"use strict"});function Qa(t){return`codepipe-host-${t}`}var Za=k(()=>{"use strict"});function ec(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 st(t){return`${t}${dg}`}var Mt,dg,tc=k(()=>{"use strict";Mt=/^[a-z][a-z0-9-]{1,30}$/,dg="-codepipe-ctx"});var rc=k(()=>{"use strict"});var nc=k(()=>{"use strict"});function sr(t){for(let e of pg){let r=t.match(e.pattern);if(r)return{name:e.name,args:(r[1]??"").trim()}}return null}var pg,oc=k(()=>{"use strict";pg=[{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}]});var ic=k(()=>{"use strict"});var sc=k(()=>{"use strict"});var ac=k(()=>{"use strict"});function cc(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/^[^A-Z]+/,"").slice(0,10)}function uc(t){let e=t.split(/[^A-Za-z0-9]+/).filter(Boolean),r=cc(e.length>=2?e.map(o=>o[0]).join(""):(e[0]??"").slice(0,4));if(ar.test(r))return r;let n=cc(t);return ar.test(n)?n:Ti}function dc(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 rn(t){return`tasks/${t}/issue.yaml`}var lc,Yn,Ti,ar,Ri,Rx,Vn,tn,pc=k(()=>{"use strict";lc=["bug","feature","epic"],Yn="feature",Ti="TASK",ar=/^[A-Z][A-Z0-9]{1,9}$/;Ri={backlog:"Backlog",source:["To Do"],inProgress:"In Progress",review:"Review",done:["Done"],rejected:["Rejected"],statusColumns:["Backlog","To Do","In Progress","Review","Done","Rejected"]},Rx=Ri.backlog,Vn="tracker/config.yaml",tn="tracker/counter"});var fc=k(()=>{"use strict"});function cr(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 zn(t){switch(t){case nn.gitlab:return"oauth2";case nn.bitbucket:return"x-token-auth";default:return"x-access-token"}}var nn,Gt,mc=k(()=>{"use strict";nn={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};Gt="x-bitbucket-api-token-auth"});var gc=k(()=>{"use strict"});var hc=k(()=>{"use strict";fc();mc();gc()});var yc,W=k(()=>{"use strict";xa();Sa();Ea();Pa();Aa();ki();vi();Va();Si();za();Ja();Xa();Za();tc();rc();nc();oc();ic();sc();ac();pc();hc();yc=20});function M(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}var ke=k(()=>{"use strict"});import{existsSync as wc,renameSync as fg}from"node:fs";function Ft(t,e,r=n=>console.error(n)){if(wc(e)||!wc(t))return!1;try{return fg(t,e),r(`migrated ${t} \u2192 ${e} (DevPipe \u2192 CodePipe)`),!0}catch(n){return r(`failed to migrate ${t} \u2192 ${e}: ${n instanceof Error?n.message:String(n)} \u2014 continuing with the legacy path untouched`),!1}}var Jn=k(()=>{"use strict"});import{existsSync as Xn,readFileSync as kc,readdirSync as mg,writeFileSync as gg}from"node:fs";import{dirname as hg,join as ht}from"node:path";import{parse as yg}from"yaml";function wg(t=process.cwd()){let e=t;for(;;){if(Xn(ht(e,Xe,"project.yaml")))return e;if(Xn(ht(e,Ii,"project.yaml")))return Ft(ht(e,Ii),ht(e,Xe))&&bg(e),e;let r=hg(e);if(r===e)return null;e=r}}function kg(t){let e=ht(t,Xe);return Xn(e)?e:ht(t,Ii)}function bg(t){let e=ht(t,".gitignore");if(!Xn(e))return;let r=kc(e,"utf-8"),n=r.split(/\r?\n/).map(o=>{let i=o.trim();return i===".devpipe"||i===".devpipe/"||i==="/.devpipe"||i==="/.devpipe/"?o.replace(".devpipe",".codepipe"):o}).join(`
|
|
6
6
|
`);n!==r&&gg(e,n)}function Ee(t=process.cwd()){let e=wg(t);if(!e)return null;let r=kg(e),n=$g(kc(ht(r,"project.yaml"),"utf-8"));return{root:e,contextDir:r,spec:n}}function bc(t,e,r){return mg(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 Qn(t,e=process.cwd()){try{let r=Ee(e);return r&&r.spec.projectId===t?r:null}catch{return null}}function $g(t){let e=yg(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=[];for(let s of o){if(!s||typeof s!="object")continue;let a=s,c=String(a.repo??a.repoName??""),l=String(a.name??c);if(!l||!c)continue;let u=a.host,p=u==="bitbucket"?"bitbucket":u==="gitlab"?"gitlab":"github";i.push({name:l,host:p,owner:String(a.owner??""),repoName:c,defaultBranch:String(a.default_branch??a.defaultBranch??"main"),mountAs:String(a.mount_as??a.mountAs??l)})}return{projectId:r,name:n,repos:i}}function $c(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 Xe,Ii,at=k(()=>{"use strict";Jn();Xe=".codepipe",Ii=".devpipe"});import{homedir as vc}from"node:os";import{mkdirSync as vg,readFileSync as xg,writeFileSync as Sg,existsSync as Ci}from"node:fs";import{dirname as Sc,join as Zn,resolve as Tg}from"node:path";import{fileURLToPath as Rg}from"node:url";function Tc(t){let e=Zn(xc,".env");if(Ci(e)&&process.loadEnvFile(e),t){let r=Zn(xc,"profiles",t,".env");Ci(r)&&process.loadEnvFile(r)}}function lr(t){let e=M("CONFIG");return e||(t?Zn(vc(),".codepipe","profiles",t,"config.json"):Zn(vc(),".codepipe","config.json"))}function Be(t){let e=lr(t);if(!Ci(e))return null;let r=xg(e,"utf-8");return JSON.parse(r)}function ct(t,e){let r=lr(e);vg(Sc(r),{recursive:!0}),Sg(r,JSON.stringify(t,null,2)+`
|
|
7
7
|
`,{mode:384})}function eo(t){if(t)return{cfg:Pe(t),profile:t};let e;try{e=Ee()?.spec.projectId||void 0}catch{}if(e){let r=Be(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:Pe(void 0),profile:void 0}}function Pe(t){let e=Be(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 ${lr(t)} is missing 'projectId'. re-run init with --force.`),process.exit(1)),e}var xc,xe=k(()=>{"use strict";ke();at();xc=Tg(Sc(Rg(import.meta.url)),"..")});import{homedir as Ec}from"node:os";import{existsSync as Pc,mkdirSync as Ac,readFileSync as jc,writeFileSync as _c}from"node:fs";import{dirname as Nc,join as Oc}from"node:path";function Lc(t,e,r){let n=B(t);if(!n)throw new Error("no secrets file for this project on the CLI");n.secrets={...n.secrets??{},[e]:r},z(n)}function Dc(t,e){let r=B(t);return!r?.secrets||!(e in r.secrets)?!1:(delete r.secrets[e],z(r),!0)}function Uc(t){return Object.keys(B(t)?.secrets??{}).sort()}function to(t,e,r){let n=B(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,z(n),"pinned")}function Bc(t,e){let r=B(t);return r?.sandboxPins?.[e]?(delete r.sandboxPins[e],z(r),!0):!1}function Qe(t){return Oc(Ec(),".codepipe","secrets",`${t}.json`)}function B(t){let e=Qe(t);return Pc(e)?JSON.parse(jc(e,"utf-8")):null}function z(t){let e=Qe(t.projectId);Ac(Nc(e),{recursive:!0}),_c(e,JSON.stringify(t,null,2)+`
|
|
8
8
|
`,{mode:384})}function ro(){return Oc(Ec(),".codepipe","shared.json")}function Ei(){let t=ro();return Pc(t)?JSON.parse(jc(t,"utf-8")):null}function Mc(t){let e=ro();Ac(Nc(e),{recursive:!0}),_c(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.8.
|
|
3
|
+
"version": "0.8.1",
|
|
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",
|