@code-partner/codepipe 0.1.136-dev.52.g6d45d0b → 0.1.136
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 +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ce="0.1.136
|
|
2
|
+
var ce="0.1.136",ge="https://hub.codepipe.dev";var he=3,ll=3;function kr(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=ll&&t<=he}var ye=".codepipe-context.yaml",Kt=".devpipe-context.yaml",Oo=[{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",ye]},{version:2,summary:"Rename the format-version stamp .devpipe-context.yaml \u2192 .codepipe-context.yaml (drop the devpipe-brand leftover)",addedPaths:[ye]}];function br(t=2){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 No(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 Uo(t,e=Oo){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 Lo(t,e=Oo){return e.filter(r=>r.version>t)}function $r(){return{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,totalCostUsd:0,model:"",numTurns:0,durationMs:0}}var Qe=/^[a-z][a-z0-9-]{1,30}$/,ul="-codepipe-ctx";function Ce(t){return`${t}${ul}`}var pl=[{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}];function xr(t){for(let e of pl){let r=t.match(e.pattern);if(r)return{name:e.name,args:(r[1]??"").trim()}}return null}var Wt={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};function dt(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}var Ze="x-bitbucket-api-token-auth";function vr(t){switch(t){case Wt.gitlab:return"oauth2";case Wt.bitbucket:return"x-token-auth";default:return"x-access-token"}}var Do=20;function N(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}import{Command as Um}from"commander";import{homedir as Ho}from"node:os";import{mkdirSync as $l,readFileSync as xl,writeFileSync as vl,existsSync as Cn}from"node:fs";import{dirname as Wo,join as Tr,resolve as Sl}from"node:path";import{fileURLToPath as Cl}from"node:url";import{existsSync as Sr,readFileSync as Mo,readdirSync as fl,writeFileSync as ml}from"node:fs";import{dirname as gl,join as Oe}from"node:path";import{parse as hl}from"yaml";import{existsSync as Bo,renameSync as dl}from"node:fs";function et(t,e,r=n=>console.error(n)){if(Bo(e)||!Bo(t))return!1;try{return dl(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 we=".codepipe",Sn=".devpipe";function yl(t=process.cwd()){let e=t;for(;;){if(Sr(Oe(e,we,"project.yaml")))return e;if(Sr(Oe(e,Sn,"project.yaml")))return et(Oe(e,Sn),Oe(e,we))&&kl(e),e;let r=gl(e);if(r===e)return null;e=r}}function wl(t){let e=Oe(t,we);return Sr(e)?e:Oe(t,Sn)}function kl(t){let e=Oe(t,".gitignore");if(!Sr(e))return;let r=Mo(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(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-partner/codepipe",
|
|
3
|
-
"version": "0.1.136
|
|
3
|
+
"version": "0.1.136",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@types/ws": "^8.5.13",
|
|
29
29
|
"esbuild": "^0.21.5",
|
|
30
30
|
"vitest": "2.1.9",
|
|
31
|
-
"@codepipe/
|
|
32
|
-
"@codepipe/
|
|
31
|
+
"@codepipe/shared": "0.0.0",
|
|
32
|
+
"@codepipe/sandbox": "0.1.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsc -p tsconfig.json && chmod +x dist/index.js",
|