@code-partner/codepipe 0.1.137-dev.67.g38523e5 → 0.1.137
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 me="0.1.137
|
|
2
|
+
var me="0.1.137",ve="https://hub.codepipe.dev";var Se=4,Zl=4;function Or(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=Zl&&t<=Se}var Ce=".codepipe-context.yaml",sr=".devpipe-context.yaml",ri=[{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",Ce]},{version:2,summary:"Rename the format-version stamp .devpipe-context.yaml \u2192 .codepipe-context.yaml (drop the devpipe-brand leftover)",addedPaths:[Ce]}];function Nr(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 oi(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 ni(t,e=ri){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 ii(t,e=ri){return e.filter(r=>r.version>t)}function lt(){return{inputTokens:0,outputTokens:0,cacheReadInputTokens:0,cacheCreationInputTokens:0,totalCostUsd:0,model:"",numTurns:0,durationMs:0}}var ut=/^[a-z][a-z0-9-]{1,30}$/,eu="-codepipe-ctx";function Le(t){return`${t}${eu}`}var tu=[{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 Ur(t){for(let e of tu){let r=t.match(e.pattern);if(r)return{name:e.name,args:(r[1]??"").trim()}}return null}var ar={github:"github.com",gitlab:"gitlab.com",bitbucket:"bitbucket.org"};function St(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 pt="x-bitbucket-api-token-auth";function Lr(t){switch(t){case ar.gitlab:return"oauth2";case ar.bitbucket:return"x-token-auth";default:return"x-access-token"}}var si=20;function L(t){return process.env[`CODEPIPE_${t}`]??process.env[`DEVPIPE_${t}`]}import{Command as mh}from"commander";import{homedir as pi}from"node:os";import{mkdirSync as pu,readFileSync as du,writeFileSync as fu,existsSync as Do}from"node:fs";import{dirname as fi,join as Mr,resolve as mu}from"node:path";import{fileURLToPath as gu}from"node:url";import{existsSync as Dr,readFileSync as ci,readdirSync as ou,writeFileSync as nu}from"node:fs";import{dirname as iu,join as qe}from"node:path";import{parse as su}from"yaml";import{existsSync as ai,renameSync as ru}from"node:fs";function dt(t,e,r=o=>console.error(o)){if(ai(e)||!ai(t))return!1;try{return ru(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 Re=".codepipe",Lo=".devpipe";function au(t=process.cwd()){let e=t;for(;;){if(Dr(qe(e,Re,"project.yaml")))return e;if(Dr(qe(e,Lo,"project.yaml")))return dt(qe(e,Lo),qe(e,Re))&&lu(e),e;let r=iu(e);if(r===e)return null;e=r}}function cu(t){let e=qe(t,Re);return Dr(e)?e:qe(t,Lo)}function lu(t){let e=qe(t,".gitignore");if(!Dr(e))return;let r=ci(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(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-partner/codepipe",
|
|
3
|
-
"version": "0.1.137
|
|
3
|
+
"version": "0.1.137",
|
|
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",
|