@code-partner/codepipe 0.1.130-dev.30.gc16bf93 → 0.1.131
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 +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ce="0.1.
|
|
2
|
+
var ce="0.1.131",me="https://hub.codepipe.dev";var ge=2,Fc=1;function mr(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=Fc&&t<=ge}var ve=".devpipe-context.yaml",Sn=[{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",ve]}];function gr(t=1){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 Cn(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 Tn(t,e=Sn){let r=[];for(let o of e)if(!(o.version<=t))for(let n of o.addedPaths)r.includes(n)||r.push(n);return r}function Rn(t,e=Sn){return e.filter(r=>r.version>t)}function hr(){return{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,totalCostUsd:0,model:"",numTurns:0,durationMs:0}}var Je=/^[a-z][a-z0-9-]{1,30}$/,Hc="-codepipe-ctx";function Se(t){return`${t}${Hc}`}var Gt={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};function ut(t){let e=t.match(/^git@([^:/]+):/);if(e)return e[1]??null;let r=t.match(/^ssh:\/\/(?:[^@/]+@)?([^/:]+)/);if(r)return r[1]??null;let o=t.match(/^https?:\/\/(?:[^@/]+@)?([^/:]+)/);return o?o[1]??null:null}var ze="x-bitbucket-api-token-auth";function yr(t){switch(t){case Gt.gitlab:return"oauth2";case Gt.bitbucket:return"x-token-auth";default:return"x-access-token"}}var In=20;function O(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}import{Command as sm}from"commander";import{homedir as _n}from"node:os";import{mkdirSync as Zc,readFileSync as el,writeFileSync as tl,existsSync as wo}from"node:fs";import{dirname as Nn,join as kr,resolve as rl}from"node:path";import{fileURLToPath as ol}from"node:url";import{existsSync as wr,readFileSync as jn,readdirSync as Wc,writeFileSync as qc}from"node:fs";import{dirname as Yc,join as Ae}from"node:path";import{parse as Vc}from"yaml";import{existsSync as Pn,renameSync as Kc}from"node:fs";function Xe(t,e,r=o=>console.error(o)){if(Pn(e)||!Pn(t))return!1;try{return Kc(t,e),r(`migrated ${t} \u2192 ${e} (DevPipe \u2192 CodePipe)`),!0}catch(o){return r(`failed to migrate ${t} \u2192 ${e}: ${o instanceof Error?o.message:String(o)} \u2014 continuing with the legacy path untouched`),!1}}var he=".codepipe",yo=".devpipe";function Jc(t=process.cwd()){let e=t;for(;;){if(wr(Ae(e,he,"project.yaml")))return e;if(wr(Ae(e,yo,"project.yaml")))return Xe(Ae(e,yo),Ae(e,he))&&Xc(e),e;let r=Yc(e);if(r===e)return null;e=r}}function zc(t){let e=Ae(t,he);return wr(e)?e:Ae(t,yo)}function Xc(t){let e=Ae(t,".gitignore");if(!wr(e))return;let r=jn(e,"utf-8"),o=r.split(/\r?\n/).map(n=>{let i=n.trim();return i===".devpipe"||i===".devpipe/"||i==="/.devpipe"||i==="/.devpipe/"?n.replace(".devpipe",".codepipe"):n}).join(`
|