@code-partner/codepipe 0.12.1-dev.250.g9a27fd7 → 0.12.1-dev.252.gaefd16e
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 +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var tb=Object.defineProperty;var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var ze=(t,e)=>{for(var r in e)tb(t,r,{get:e[r],enumerable:!0})};var Ve,mt,Ws=x(()=>{"use strict";Ve="0.12.1-dev.
|
|
2
|
+
var tb=Object.defineProperty;var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var ze=(t,e)=>{for(var r in e)tb(t,r,{get:e[r],enumerable:!0})};var Ve,mt,Ws=x(()=>{"use strict";Ve="0.12.1-dev.252.gaefd16e",mt="https://hub.dev.codepipe.dev"});function zn(t){return typeof t!="number"||!Number.isFinite(t)?!1:t>=ku&&t<=ht}var ht,ku,bu=x(()=>{"use strict";Ws();ht=4,ku=4});var $u=x(()=>{"use strict";Ws()});function Vn(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 Ys(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 zs(t,e=qs){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 Vs(t,e=qs){return e.filter(r=>r.version>t)}var vu,gt,Gr,qs,xu=x(()=>{"use strict";vu=6,gt=".codepipe-context.yaml",Gr=".devpipe-context.yaml",qs=[{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",gt]},{version:2,summary:"Rename the format-version stamp .devpipe-context.yaml \u2192 .codepipe-context.yaml (drop the devpipe-brand leftover)",addedPaths:[gt]},{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 Jn(t){return`model/facts/identity/${t}.yaml`}function hr(t){return`model/facts/events/${t}.yaml`}function Zs(t){return`model/facts/annotations/${t}.md`}function Qs(t){return`model/derived/correlates/${t}.yaml`}function ea(t){return`model/derived/touched/${t}.yaml`}function Su(t){return t===""?"root":t.replace(/\//g,"-")}function ta(t,e){return`model/derived/structure/${t}/${Su(e)}.yaml`}function Jo(t){return typeof t=="string"&&Tu.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(!Eu.includes(n))return null;let o=t.slice(e+1,r),i=t.slice(r+1);return o===""&&!sb.includes(n)||i===""?null:{level:n,repo:o,path:i}}function ve(t){return`task::${t}`}function ye(t,e,r){return`${t}:${e}:${r}`}function Zn(t){let e=[];return vt(t)?(Qo(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(!vt(r)){e.push(`edges[${n}]: not an object`);return}ra.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 Iu(t){return{...t,edges:Kr(t.edges,e=>`${e.kind} ${e.from} ${e.to}`)}}function gr(t){return wr(Iu(t))}function vt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Qo(t){return typeof t=="number"&&Number.isInteger(t)&&t>0}function yt(t){return typeof t=="string"&&t.length>0}function cb(t){return t.modelFormatVersion!==2}function jt(t){let e=[];if(!vt(t))return{ok:!1,errors:["shard: not an object"]};Qo(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),yt(t.repo)||e.push("repo: missing or empty"),yt(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(!vt(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&&!Jo(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(!vt(o)){e.push(`edges[${i}]: not an object`);return}ra.includes(o.kind)||e.push(`edges[${i}].kind: unknown "${String(o.kind)}"`),(!yt(o.to)||!re(o.to))&&e.push(`edges[${i}].to: malformed nodeKey`),(!yt(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 Qn(t){let e=[];if(!vt(t))return{ok:!1,errors:["identity: not an object"]};if(Qo(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),yt(t.repo)||e.push("repo: missing or empty"),t.builtFromCommit!==void 0&&!yt(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(!vt(n)){e.push(`entities[${o}]: not an object`);return}Jo(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`),yt(n.firstSeen)||e.push(`entities[${o}].firstSeen: missing`),yt(n.lastSeen)||e.push(`entities[${o}].lastSeen: missing`),n.aliases!==void 0&&(Array.isArray(n.aliases)?n.aliases.forEach((i,s)=>{(!vt(i)||!re(i.key)||!yt(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 Nt(t){let e=[];return vt(t)?(Qo(t.modelFormatVersion)||e.push("modelFormatVersion: missing or not a positive integer"),yt(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=>!yt(r)))&&e.push("commits: not an array of non-empty strings"),Array.isArray(t.files)?t.files.forEach((r,n)=>{if(!vt(r)||!re(r.key)){e.push(`files[${n}].key: malformed nodeKey`);return}r.entityId!==void 0&&!Jo(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 Kr(t,e){return[...t].sort((r,n)=>e(r)<e(n)?-1:e(r)>e(n)?1:0)}function Ru(t){return{...t,nodes:Kr(t.nodes,e=>e.key),edges:Kr(t.edges,e=>`${e.kind}\0${e.from}\0${e.to}`)}}function Cu(t){return{...t,entities:Kr(t.entities,e=>e.entityId).map(e=>e.aliases?{...e,aliases:Kr(e.aliases,r=>`${r.key}\0${r.until}`)}:e)}}function Pu(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:Kr(t.files,r=>r.key),...e?{links:e}:{}}}function Xn(t){return lb.test(t)?t:JSON.stringify(t)}function Au(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 _u(t){return t===null||["boolean","number","string"].includes(typeof t)}function Xs(t){return Object.entries(t).filter(([,e])=>e!==void 0).sort(([e],[r])=>e<r?-1:e>r?1:0)}function ju(t,e,r){if(Array.isArray(t)){for(let n of t)if(_u(n))r.push(`${e}- ${Au(n)}`);else{if(Array.isArray(n))throw new Error("model yaml: nested arrays are not part of the model schema");{let o=Xs(n);if(o.length===0){r.push(`${e}- {}`);continue}o.forEach(([i,s],a)=>{let c=a===0?`${e}- `:`${e} `;Js(i,s,c,`${e} `,r)})}}return}for(let[n,o]of Xs(t))Js(n,o,e,e,r)}function Js(t,e,r,n,o){if(_u(e))o.push(`${r}${Xn(t)}: ${Au(e)}`);else if(Array.isArray(e))e.length===0?o.push(`${r}${Xn(t)}: []`):(o.push(`${r}${Xn(t)}:`),ju(e,`${n} `,o));else{let i=Xs(e);if(i.length===0)o.push(`${r}${Xn(t)}: {}`);else{o.push(`${r}${Xn(t)}:`);for(let[s,a]of i)Js(s,a,`${n} `,`${n} `,o)}}}function wr(t){let e=[];return ju(t,"",e),e.join(`
|
|
@@ -859,7 +859,7 @@ ${I}
|
|
|
859
859
|
`),n=t.refs.length>0&&e?["","## Read these first","",...t.refs.map(o=>`- \`${Bl(e,o)}\``),"","They are this role's curated context. If one is missing, say so in a line and continue \u2014","its absence is not an error.",""].join(`
|
|
860
860
|
`):"";return`${r}${t.body}
|
|
861
861
|
${n}`}function fR(t,e,r,n){let o=ja(e,r);if(o.length===0)return{roles:[],files:[]};let i=Bl(t,Fl);uR(i,{recursive:!0});let s=[];for(let a of o)dR(Bl(i,`${a.name}.md`),pR(a,n)),s.push(`${Fl}/${a.name}.md`);return{roles:o,files:s}}function mR(t,e){return t.roles.length===0?"":["## The panel \u2014 run these critics first","","This project reviews through a panel of roles. Each is available to you as a","subagent with its own narrow view and its own reading list:","",t.roles.map(n=>`- **${n.name}** \u2014 ${n.description}`).join(`
|
|
862
|
-
`),"","Delegate to **every** role above
|
|
862
|
+
`),"","Delegate to **every** role above \u2014 **in parallel**, all Task calls in one","turn, giving each the change under review. The roles are independent","read-only views that never wait on each other, so the panel costs the time","of its slowest member, not the sum. Then do your own job on what comes back:","",`1. Save each role's findings verbatim as \`${e}/<role>.md\`.`,"2. **Deduplicate.** Two roles reporting the same defect is one finding, not two.","3. **Filter.** A finding earns a round-trip only if it is a real defect, a"," regression or a convention the project actually enforces. Taste-level notes"," go in the summary, never in the remarks.","4. **Decide.** The verdict is yours, not a vote: a role can be wrong, and you"," are the one who read the code. When you overrule a role, say why in the"," summary.","","A role that returns nothing is a normal outcome \u2014 do not manufacture findings","to justify the panel.",""].join(`
|
|
863
863
|
`)}var Fl,tw=x(()=>{"use strict";F();Fl=".claude/agents"});var nw={};ze(nw,{COUNCIL_ANSWER_PATH:()=>rw,readCouncilVerdict:()=>yR});import{readFileSync as hR}from"node:fs";import{join as gR}from"node:path";function yR(t){let e;try{e=hR(gR(t,rw),"utf-8")}catch{return null}try{return JSON.parse(e)}catch{return null}}var rw,ow=x(()=>{"use strict";rw="meta/council-answer.json"});var sw={};ze(sw,{QUEUE_PLAN_PATH:()=>iw,readQueuePlan:()=>bR});import{readFileSync as wR}from"node:fs";import{join as kR}from"node:path";function bR(t){let e;try{e=wR(kR(t,iw),"utf-8")}catch{return null}try{return JSON.parse(e)}catch{return null}}var iw,aw=x(()=>{"use strict";iw="meta/queue-plan.json"});import{mkdirSync as cw,readFileSync as vs,readdirSync as $R,writeFileSync as lw}from"node:fs";import{homedir as vR}from"node:os";import{dirname as xR,join as Rt}from"node:path";function ER(t){let e=Buffer.from(t,"utf-8");if(e.length<=xs)return t;let r=Math.floor(xs/4),n=xs-r,o=e.subarray(0,r).toString("utf-8"),i=e.subarray(e.length-n).toString("utf-8"),s=e.length-r-n;return`${o}
|
|
864
864
|
|
|
865
865
|
\u2026 [${s} bytes elided \u2014 log capped at ${xs} bytes for upload] \u2026
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-partner/codepipe",
|
|
3
|
-
"version": "0.12.1-dev.
|
|
3
|
+
"version": "0.12.1-dev.252.gaefd16e",
|
|
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",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@types/ws": "^8.5.13",
|
|
30
30
|
"esbuild": "^0.21.5",
|
|
31
31
|
"vitest": "2.1.9",
|
|
32
|
-
"@codepipe/
|
|
33
|
-
"@codepipe/
|
|
32
|
+
"@codepipe/shared": "0.0.0",
|
|
33
|
+
"@codepipe/sandbox": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsc -p tsconfig.json && chmod +x dist/index.js",
|