prjct-cli 3.62.0 → 3.63.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.
@@ -1228,7 +1228,7 @@ CREATE TABLE velocity_sprints (
1228
1228
  name TEXT NOT NULL,
1229
1229
  applied_at TEXT NOT NULL
1230
1230
  )
1231
- `);let r=new Set(e.prepare("SELECT version FROM _migrations").all().map(i=>i.version)),s=Bo.filter(i=>!r.has(i.version));if(s.length!==0){if(n&&r.size>0)try{let i=`${n}.pre-migrate.bak`;ui.existsSync(i)&&ui.rmSync(i,{force:!0}),e.prepare("VACUUM INTO ?").run(i)}catch(i){console.warn(`prjct: pre-migration backup failed (continuing): ${i?.message??i}`)}for(let i of s)pu(e,()=>{i.up(e),e.prepare("INSERT INTO _migrations (version, name, applied_at) VALUES (?, ?, ?)").run(i.version,i.name,new Date().toISOString())})}}getMigrations(e){return this.getDb(e).prepare("SELECT * FROM _migrations ORDER BY version").all()}getSchemaVersion(e){return this.getDb(e).prepare("SELECT MAX(version) as version FROM _migrations").get()?.version??0}},E=new Go,y=E});function Uh(t){let e=t.toLowerCase();return e.includes("github")?"github":e.includes("gitlab")?"gitlab":e.includes("bitbucket")?"bitbucket":"other"}function mu(t){let e=t.trim();if(!e)return{};let n=e.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(n)return{provider:Uh(n[1]),repoSlug:n[2]};try{let r=new URL(e),s=r.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!r.host||!s?{}:{provider:Uh(r.host),repoSlug:s}}catch{return{}}}async function nN(t){try{let{stdout:e}=await U("git",["remote","get-url","origin"],{cwd:t});return e.trim()||void 0}catch{return}}async function rN(t){try{let{stdout:e}=await U("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:t});return e.trim().replace(/^origin\//,"")||void 0}catch{return}}function nr(t){return typeof t=="string"&&t.length>0?t:void 0}function Wh(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function sN(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}async function Bh(t){let e=E.getDoc(t,"project")||{},n=nr(e.repoPath),{provider:r,repoSlug:s}=n?mu(await nN(n)||""):{},i=n?await rN(n):void 0,o=Array.isArray(e.techStack)?e.techStack.filter(c=>typeof c=="string"):void 0;return sN({provider:r,repoSlug:s,currentBranch:nr(e.currentBranch),defaultBranch:i,stack:nr(e.stack),techStack:o&&o.length>0?o:void 0,version:nr(e.version),commitCount:Wh(e.commitCount),fileCount:Wh(e.fileCount),lastCommit:nr(e.lastSyncCommit),hasUncommitted:typeof e.hasUncommittedChanges=="boolean"?e.hasUncommittedChanges:void 0,cliVersion:nr(e.cliVersion),syncedAt:nr(e.lastSync)})}var gu=f(()=>{"use strict";O();ne();a(Uh,"providerForHost");a(mu,"parseRemote");a(nN,"gitRemoteUrl");a(rN,"gitDefaultBranch");a(nr,"str");a(Wh,"num");a(sN,"compact");a(Bh,"buildProjectMeta")});import{execFile as iN}from"node:child_process";import oN from"node:crypto";import{promisify as aN}from"node:util";function uN(t,e=lN){let n=Buffer.from(e.replace(/-/g,""),"hex"),s=oN.createHash("sha1").update(n).update(t,"utf8").digest().subarray(0,16);s[6]=s[6]&15|80,s[8]=s[8]&63|128;let i=s.toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function dN(t){let e;try{let{stdout:s}=await cN("git",["remote","get-url","origin"],{cwd:t});e=s.trim()||void 0}catch{return null}if(!e)return null;let{provider:n,repoSlug:r}=mu(e);return!n||!r?null:`${n}:${r}`.toLowerCase()}async function Gh(t){let e=await dN(t);return e?uN(e):null}var cN,lN,Xh=f(()=>{"use strict";gu();cN=aN(iN),lN="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";a(uN,"uuidv5");a(dN,"repoKey");a(Gh,"deriveProjectId")});var yu={};A(yu,{PACKAGE_ROOT:()=>ln,VERSION:()=>Be,getPackageRoot:()=>hu,getVersion:()=>qo,resetPackageRoot:()=>pN});import fu from"node:fs";import Xo from"node:path";function hu(){if(Qr)return Qr;let t=__dirname;for(let e=0;e<5;e++){let n=Xo.join(t,"package.json");if(fu.existsSync(n))try{if(JSON.parse(fu.readFileSync(n,"utf-8")).name==="prjct-cli")return Qr=t,t}catch{}t=Xo.dirname(t)}return Qr=Xo.join(__dirname,"..","..",".."),Qr}function qo(){if(rr)return rr;let t="3.62.0";if(t&&/^\d+\.\d+\.\d+/.test(t))return rr=t,rr;try{let e=Xo.join(hu(),"package.json");return rr=JSON.parse(fu.readFileSync(e,"utf-8")).version,rr}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",C(e)),"0.0.0"}}function pN(t){Qr=t,rr=null}var rr,Qr,Be,ln,Dt=f(()=>{"use strict";te();rr=null,Qr=null;a(hu,"getPackageRoot");a(qo,"getVersion");a(pN,"resetPackageRoot");Be=qo(),ln=hu()});async function Vo(t){try{let{stdout:e}=await H(t,{timeout:5e3});return{success:!0,output:e.trim()}}catch{return{success:!1,output:""}}}async function mN(){let t=await Vo("gh api user --jq .login");return t.success&&t.output||(t=await Vo("git config --global github.user"),t.success&&t.output)?t.output:null}async function gN(){let t=await Vo("git config user.name");return t.success&&t.output?t.output:null}async function fN(){let t=await Vo("git config user.email");return t.success&&t.output?t.output:null}async function Zr(){let[t,e,n]=await Promise.all([mN(),gN(),fN()]);return{github:t,email:n,name:e||t||"Unknown"}}var Jo=f(()=>{"use strict";ne();a(Vo,"execCommand");a(mN,"detectGitHubUsername");a(gN,"detectGitName");a(fN,"detectGitEmail");a(Zr,"detect")});var Ko={};A(Ko,{worktreeService:()=>hN});import ku from"node:fs/promises";import qt from"node:path";var qh,wu,hN,Yo=f(()=>{"use strict";ne();Y();qh=".worktrees",wu=class{static{a(this,"WorktreeService")}async create(e,n,r={}){let s=await this.getMainWorktree(e),i=qt.join(s,qh,n),o=r.branch||`feat/${n}`;await ku.mkdir(qt.join(s,qh),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await H(`git worktree add "${i}" -b "${o}"${c}`,{cwd:s});let{stdout:l}=await H("git rev-parse HEAD",{cwd:i});return{path:i,branch:o,commit:l.trim(),isMain:!1,slug:n}}async remove(e,n=!1){let r=await this.getMainWorktree(e),s;if(n)try{let{stdout:i}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e});s=i.trim()}catch{}if(await H(`git worktree remove "${e}" --force`,{cwd:r}),n&&s&&s!=="main"&&s!=="master")try{await H(`git branch -D "${s}"`,{cwd:r})}catch{}}async list(e){let n=await this.getMainWorktree(e),{stdout:r}=await H("git worktree list --porcelain",{cwd:n});return this.parsePorcelainOutput(r,n)}async detect(e){try{let{stdout:n}=await H("git rev-parse --git-common-dir",{cwd:e}),{stdout:r}=await H("git rev-parse --git-dir",{cwd:e}),s=qt.resolve(e,n.trim()),i=qt.resolve(e,r.trim());if(s!==i){let{stdout:o}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e}),{stdout:c}=await H("git rev-parse HEAD",{cwd:e}),{stdout:l}=await H("git rev-parse --show-toplevel",{cwd:e}),u=l.trim(),d=qt.basename(u);return{path:u,branch:o.trim(),commit:c.trim(),isMain:!1,slug:d}}return null}catch{return null}}async getMainWorktree(e){try{let{stdout:r}=await H("git worktree list --porcelain",{cwd:e}),s=r.split(`
1231
+ `);let r=new Set(e.prepare("SELECT version FROM _migrations").all().map(i=>i.version)),s=Bo.filter(i=>!r.has(i.version));if(s.length!==0){if(n&&r.size>0)try{let i=`${n}.pre-migrate.bak`;ui.existsSync(i)&&ui.rmSync(i,{force:!0}),e.prepare("VACUUM INTO ?").run(i)}catch(i){console.warn(`prjct: pre-migration backup failed (continuing): ${i?.message??i}`)}for(let i of s)pu(e,()=>{i.up(e),e.prepare("INSERT INTO _migrations (version, name, applied_at) VALUES (?, ?, ?)").run(i.version,i.name,new Date().toISOString())})}}getMigrations(e){return this.getDb(e).prepare("SELECT * FROM _migrations ORDER BY version").all()}getSchemaVersion(e){return this.getDb(e).prepare("SELECT MAX(version) as version FROM _migrations").get()?.version??0}},E=new Go,y=E});function Uh(t){let e=t.toLowerCase();return e.includes("github")?"github":e.includes("gitlab")?"gitlab":e.includes("bitbucket")?"bitbucket":"other"}function mu(t){let e=t.trim();if(!e)return{};let n=e.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(n)return{provider:Uh(n[1]),repoSlug:n[2]};try{let r=new URL(e),s=r.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!r.host||!s?{}:{provider:Uh(r.host),repoSlug:s}}catch{return{}}}async function nN(t){try{let{stdout:e}=await U("git",["remote","get-url","origin"],{cwd:t});return e.trim()||void 0}catch{return}}async function rN(t){try{let{stdout:e}=await U("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:t});return e.trim().replace(/^origin\//,"")||void 0}catch{return}}function nr(t){return typeof t=="string"&&t.length>0?t:void 0}function Wh(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function sN(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}async function Bh(t){let e=E.getDoc(t,"project")||{},n=nr(e.repoPath),{provider:r,repoSlug:s}=n?mu(await nN(n)||""):{},i=n?await rN(n):void 0,o=Array.isArray(e.techStack)?e.techStack.filter(c=>typeof c=="string"):void 0;return sN({provider:r,repoSlug:s,currentBranch:nr(e.currentBranch),defaultBranch:i,stack:nr(e.stack),techStack:o&&o.length>0?o:void 0,version:nr(e.version),commitCount:Wh(e.commitCount),fileCount:Wh(e.fileCount),lastCommit:nr(e.lastSyncCommit),hasUncommitted:typeof e.hasUncommittedChanges=="boolean"?e.hasUncommittedChanges:void 0,cliVersion:nr(e.cliVersion),syncedAt:nr(e.lastSync)})}var gu=f(()=>{"use strict";O();ne();a(Uh,"providerForHost");a(mu,"parseRemote");a(nN,"gitRemoteUrl");a(rN,"gitDefaultBranch");a(nr,"str");a(Wh,"num");a(sN,"compact");a(Bh,"buildProjectMeta")});import{execFile as iN}from"node:child_process";import oN from"node:crypto";import{promisify as aN}from"node:util";function uN(t,e=lN){let n=Buffer.from(e.replace(/-/g,""),"hex"),s=oN.createHash("sha1").update(n).update(t,"utf8").digest().subarray(0,16);s[6]=s[6]&15|80,s[8]=s[8]&63|128;let i=s.toString("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}async function dN(t){let e;try{let{stdout:s}=await cN("git",["remote","get-url","origin"],{cwd:t});e=s.trim()||void 0}catch{return null}if(!e)return null;let{provider:n,repoSlug:r}=mu(e);return!n||!r?null:`${n}:${r}`.toLowerCase()}async function Gh(t){let e=await dN(t);return e?uN(e):null}var cN,lN,Xh=f(()=>{"use strict";gu();cN=aN(iN),lN="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";a(uN,"uuidv5");a(dN,"repoKey");a(Gh,"deriveProjectId")});var yu={};A(yu,{PACKAGE_ROOT:()=>ln,VERSION:()=>Be,getPackageRoot:()=>hu,getVersion:()=>qo,resetPackageRoot:()=>pN});import fu from"node:fs";import Xo from"node:path";function hu(){if(Qr)return Qr;let t=__dirname;for(let e=0;e<5;e++){let n=Xo.join(t,"package.json");if(fu.existsSync(n))try{if(JSON.parse(fu.readFileSync(n,"utf-8")).name==="prjct-cli")return Qr=t,t}catch{}t=Xo.dirname(t)}return Qr=Xo.join(__dirname,"..","..",".."),Qr}function qo(){if(rr)return rr;let t="3.63.1";if(t&&/^\d+\.\d+\.\d+/.test(t))return rr=t,rr;try{let e=Xo.join(hu(),"package.json");return rr=JSON.parse(fu.readFileSync(e,"utf-8")).version,rr}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",C(e)),"0.0.0"}}function pN(t){Qr=t,rr=null}var rr,Qr,Be,ln,Dt=f(()=>{"use strict";te();rr=null,Qr=null;a(hu,"getPackageRoot");a(qo,"getVersion");a(pN,"resetPackageRoot");Be=qo(),ln=hu()});async function Vo(t){try{let{stdout:e}=await H(t,{timeout:5e3});return{success:!0,output:e.trim()}}catch{return{success:!1,output:""}}}async function mN(){let t=await Vo("gh api user --jq .login");return t.success&&t.output||(t=await Vo("git config --global github.user"),t.success&&t.output)?t.output:null}async function gN(){let t=await Vo("git config user.name");return t.success&&t.output?t.output:null}async function fN(){let t=await Vo("git config user.email");return t.success&&t.output?t.output:null}async function Zr(){let[t,e,n]=await Promise.all([mN(),gN(),fN()]);return{github:t,email:n,name:e||t||"Unknown"}}var Jo=f(()=>{"use strict";ne();a(Vo,"execCommand");a(mN,"detectGitHubUsername");a(gN,"detectGitName");a(fN,"detectGitEmail");a(Zr,"detect")});var Ko={};A(Ko,{worktreeService:()=>hN});import ku from"node:fs/promises";import qt from"node:path";var qh,wu,hN,Yo=f(()=>{"use strict";ne();Y();qh=".worktrees",wu=class{static{a(this,"WorktreeService")}async create(e,n,r={}){let s=await this.getMainWorktree(e),i=qt.join(s,qh,n),o=r.branch||`feat/${n}`;await ku.mkdir(qt.join(s,qh),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await H(`git worktree add "${i}" -b "${o}"${c}`,{cwd:s});let{stdout:l}=await H("git rev-parse HEAD",{cwd:i});return{path:i,branch:o,commit:l.trim(),isMain:!1,slug:n}}async remove(e,n=!1){let r=await this.getMainWorktree(e),s;if(n)try{let{stdout:i}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e});s=i.trim()}catch{}if(await H(`git worktree remove "${e}" --force`,{cwd:r}),n&&s&&s!=="main"&&s!=="master")try{await H(`git branch -D "${s}"`,{cwd:r})}catch{}}async list(e){let n=await this.getMainWorktree(e),{stdout:r}=await H("git worktree list --porcelain",{cwd:n});return this.parsePorcelainOutput(r,n)}async detect(e){try{let{stdout:n}=await H("git rev-parse --git-common-dir",{cwd:e}),{stdout:r}=await H("git rev-parse --git-dir",{cwd:e}),s=qt.resolve(e,n.trim()),i=qt.resolve(e,r.trim());if(s!==i){let{stdout:o}=await H("git rev-parse --abbrev-ref HEAD",{cwd:e}),{stdout:c}=await H("git rev-parse HEAD",{cwd:e}),{stdout:l}=await H("git rev-parse --show-toplevel",{cwd:e}),u=l.trim(),d=qt.basename(u);return{path:u,branch:o.trim(),commit:c.trim(),isMain:!1,slug:d}}return null}catch{return null}}async getMainWorktree(e){try{let{stdout:r}=await H("git worktree list --porcelain",{cwd:e}),s=r.split(`
1232
1232
  `)[0];if(s?.startsWith("worktree "))return s.replace("worktree ","").trim()}catch{}let{stdout:n}=await H("git rev-parse --show-toplevel",{cwd:e});return n.trim()}async setup(e,n){let r=qt.join(n,".env");await L(r)&&await ku.copyFile(r,qt.join(e,".env"));let s=qt.join(n,".prjct"),i=qt.join(e,".prjct");await L(s)&&!await L(i)&&await ku.symlink(s,i,"dir")}async teardown(e){}async clean(e){let n=await this.list(e),r=[],s=await this.getMainWorktree(e);await H("git worktree prune",{cwd:s});for(let i of n)i.isMain||await L(i.path)||r.push(i.slug);return r}parsePorcelainOutput(e,n){let r=[],s=e.trim().split(`
1233
1233
 
1234
1234
  `);for(let i of s){if(!i.trim())continue;let o=i.trim().split(`
@@ -1342,7 +1342,7 @@ public static class PrjctCredentialManager {
1342
1342
  CredDelete(target, CRED_TYPE_GENERIC, 0);
1343
1343
  }
1344
1344
  }
1345
- `;a(Mu,"powershellArgs");a(ju,"windowsCommand");a(vy,"readWindowsCredentialManager");a(KN,"writeWindowsCredentialManager");a(YN,"clearWindowsCredentialManager");a(zN,"platformGet");a(QN,"hasSecureCredentialStore");a(ZN,"platformSet");a(e0,"platformClear");a(t0,"platformLocation");a($u,"activeStore");a(ki,"getAuthToken");a(Fu,"setAuthToken");a(Hu,"clearAuthToken")});var qu={};A(qu,{default:()=>fe});import n0 from"node:crypto";import Uu from"node:fs/promises";import Wu from"node:os";import xy from"node:path";function Bu(){return n0.randomUUID()}function Gu(t){return{...t,apiKey:null}}var Cy,Ry,Xu,r0,fe,ss=f(()=>{"use strict";Fe();Y();_y();Cy="https://cli-api.prjct.app",Ry={apiKey:null,apiUrl:Cy,userId:null,email:null,lastAuth:null};a(Bu,"freshDeviceId");a(Gu,"metadataOnly");Xu=class{static{a(this,"AuthConfigManager")}configPath;cachedConfig=null;constructor(){this.configPath=W.getAuthConfigPath()}getConfigPath(){return this.configPath}async read(){if(this.cachedConfig)return this.cachedConfig={...this.cachedConfig,apiKey:await ki()},this.cachedConfig;let e=await De(this.configPath),n=await ki(),r={...e??Ry,apiKey:n},s=!1;if(!n&&e?.apiKey&&(await Fu(e.apiKey),r={...r,apiKey:e.apiKey},s=!0),r.deviceId||(r.deviceId=Bu(),s=!0),r.hostname||(r.hostname=Wu.hostname(),s=!0),this.cachedConfig=r,s&&e)try{await ye(this.configPath,Gu(this.cachedConfig)),await Uu.chmod(this.configPath,384)}catch{}return this.cachedConfig}async getDeviceId(){return(await this.read()).deviceId??Bu()}async getHostname(){return(await this.read()).hostname??Wu.hostname()}async write(e){let n=await this.read();Object.hasOwn(e,"apiKey")&&(e.apiKey?await Fu(e.apiKey):await Hu());let r={...n,...e,apiKey:await ki(),lastAuth:new Date().toISOString()};await Gt(xy.dirname(this.configPath)),await ye(this.configPath,Gu(r)),await Uu.chmod(this.configPath,384),this.cachedConfig=r}async hasAuth(){let e=await this.getApiKey();return e!==null&&e.length>0}async getApiKey(){return(await this.read()).apiKey||await ki()}async getApiUrl(){return(await this.read()).apiUrl||Cy}async saveAuth(e,n,r){await this.write({apiKey:e,userId:n,email:r})}async clearAuth(){await Hu();let e=this.cachedConfig??await De(this.configPath);this.cachedConfig={...Ry,deviceId:e?.deviceId??Bu(),hostname:e?.hostname??Wu.hostname()},await Gt(xy.dirname(this.configPath)),await ye(this.configPath,Gu(this.cachedConfig)),await Uu.chmod(this.configPath,384)}async getStatus(){let e=await this.read();return{authenticated:e.apiKey!==null,email:e.email,apiKeyPrefix:null,lastAuth:e.lastAuth}}clearCache(){this.cachedConfig=null}},r0=new Xu,fe=r0});import{createHash as s0,randomBytes as Ay}from"node:crypto";function Vu(t){return t.toString("base64url")}function Dy(){let t=Vu(Ay(Iy)),e=Vu(Ay(Iy)),n=Vu(s0("sha256").update(t,"ascii").digest());return{state:e,codeVerifier:t,codeChallenge:n,codeChallengeMethod:"S256"}}function Py(t){return new URLSearchParams({flow:Ny,port:String(t.port),device_id:t.deviceId,hostname:t.hostname,state:t.state,code_challenge:t.codeChallenge,code_challenge_method:"S256"})}function Ly(t,e){if(t.get("key"))return{ok:!1,reason:"legacy-bearer",message:"This CLI requires PKCE login. Update the web app or set flow=pkce-v1; bearer tokens in the callback URL are no longer accepted."};let r=t.get("code"),s=t.get("state");return!r||!s?{ok:!1,reason:"missing",message:"Missing authorization code or state in callback"}:s!==e?{ok:!1,reason:"mismatch",message:"Login state mismatch \u2014 try `prjct login` again"}:{ok:!0,code:r,state:s}}function Oy(t){return{flow:Ny,code:t.code,state:t.state,code_verifier:t.codeVerifier,device_id:t.deviceId,redirect_uri:`http://127.0.0.1:${t.port}/callback`}}function My(t){if(!t||typeof t!="object")return null;let e=t,n=e.apiKey??e.api_key,r=e.userId??e.user_id,s=e.email,i=e.deviceId??e.device_id;return!n||!r||!s||!i?null:{apiKey:n,userId:r,email:s,deviceId:i}}var Ny,Iy,jy=f(()=>{"use strict";Ny="pkce-v1",Iy=32;a(Vu,"base64Url");a(Dy,"generatePkceMaterial");a(Py,"buildCliLoginSearchParams");a(Ly,"parsePkceCallback");a(Oy,"buildExchangeBody");a(My,"parseMintedKeyResponse")});function ua(t){let e=`PRJCT_TIMEOUT_${t}`,n=process.env[e];if(n){let r=Number.parseInt(n,10);if(!Number.isNaN(r)&&r>0)return r}return i0[t]}var i0,Lt,Ju=f(()=>{"use strict";i0={TOOL_CHECK:5e3,GIT_OPERATION:1e4,GIT_CLONE:6e4,API_REQUEST:3e4,NPM_INSTALL:12e4,WORKFLOW_HOOK:6e4};a(ua,"getTimeout");Lt={SPINNER_MSG:45,DONE_MSG:50,FAIL_MSG:65,WARN_MSG:65,STEP_MSG:35,PROGRESS_TEXT:25,ISSUE_TITLE:50,FALLBACK_TRUNCATE:50,CLEAR_WIDTH:80}});function ur(t){if(t)return o0[t]}function Fy(t,e){let n=a0[t];return n?{...$y,...e??{}}[n]!==!1:!0}var o0,a0,$y,G2,Ku=f(()=>{"use strict";o0={memories:"memories",tasks:"tasks",subtasks:"subtasks",ideas:"ideas",queue_tasks:"queue_tasks",custom_workflows:"custom_workflows",workflow_rules:"workflow_rules",archives:"archives",shipped_items:"shipped_items",shipped_features:"shipped_features",metrics_daily:"metrics_daily",work_cost_snapshots:"work_cost_snapshots",velocity_sprints:"velocity_sprints",analysis:"analysis",specs:"specs",memory:"memories",memory_entry:"memories",task:"tasks",paused_task:"tasks",subtask:"subtasks",idea:"ideas",queue:"queue_tasks",queue_task:"queue_tasks",shipped:"shipped_items",feature:"roadmap_features",workflow:"custom_workflows",workflow_rule:"workflow_rules",metric:"metrics_daily",work_cost_snapshot:"work_cost_snapshots",velocity:"velocity_sprints",spec:"specs",project:"projects",session:"sessions",agent:"agents"};a(ur,"toCloudTable");a0={memories:"memories",tasks:"tasks",subtasks:"tasks",queue_tasks:"tasks",ideas:"ideas",shipped_items:"shipped",shipped_features:"shipped",custom_workflows:"workflows",workflow_rules:"workflows",metrics_daily:"metrics",work_cost_snapshots:"metrics",velocity_sprints:"metrics",archives:"archives",analysis:"analysis",specs:"specs"},$y={memories:!0,tasks:!0,ideas:!0,shipped:!0,workflows:!0,metrics:!0,archives:!0,user_prompts:!1,agent_sessions:!1,analysis:!0,specs:!0};a(Fy,"isTableIncluded");G2=Object.keys($y)});function c0(t){return t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}function l0(t){let e={};for(let[n,r]of Object.entries(t))e[c0(n)]=r;return e}function u0(t,e){let[n,r]=e.type.split("."),s=ur(e.entityType)??ur(n);if(!s)return null;let o=e.eventType==="delete"||r==="deleted"||r==="archived"||r==="removed"?"delete":"upsert",c=e.data||{},l=l0(c),u=e.entityId||l.id||c.id||"",d={event_type:o,entity_type:s,entity_id:u,data:{...l,project_id:t},project_id:t};return e.originDeviceId!==void 0&&(d.origin_device_id=e.originDeviceId),e.contentHash!==void 0&&(d.content_hash=e.contentHash),e.revisionCount!==void 0&&(d.revision_count=e.revisionCount),e.timestamp&&(d.ts=e.timestamp),d}function Hy(t,e){return e.map(n=>u0(t,n)).filter(n=>n!==null)}var Uy=f(()=>{"use strict";Ku();a(c0,"camelToSnake");a(l0,"snakeCaseKeys");a(u0,"mapCliEventToWebFormat");a(Hy,"mapCliEventsToWebFormat")});var Wy={};A(Wy,{default:()=>d0,syncClient:()=>Dn});var Yu,Dn,d0,da=f(()=>{"use strict";Ju();ss();Uy();Yu=class{static{a(this,"SyncClient")}retryConfig={maxRetries:3,baseDelayMs:1e3,maxDelayMs:3e4};async pushEvents(e,n){let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)throw this.createError("AUTH_REQUIRED","No API key configured");let o=Hy(e,n),c=await this.fetchWithRetry(`${r}/sync/batch`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(s,i)},body:JSON.stringify({projectId:e,events:o})});if(!c.ok)throw await this.parseErrorResponse(c);return await c.json()}async pullEvents(e,n,r){let{apiUrl:s,apiKey:i,deviceId:o}=await this.getAuthHeaders();if(!i)throw this.createError("AUTH_REQUIRED","No API key configured");let c={projectId:e};typeof n=="number"&&n>0&&(c.sinceEventId=n);let l=await this.fetchWithRetry(`${s}/sync/pull`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(i,o)},body:JSON.stringify(c)});if(!l.ok)throw await this.parseErrorResponse(l);return await l.json()}async getStatus(e){let{apiUrl:n,apiKey:r,deviceId:s}=await this.getAuthHeaders();if(!r)throw this.createError("AUTH_REQUIRED","No API key configured");let i=await this.fetchWithRetry(`${n}/sync/status/${e}`,{method:"GET",headers:{...this.authHeaders(r,s)}});if(!i.ok)throw await this.parseErrorResponse(i);return await i.json()}async linkProject(e,n,r){let{apiUrl:s,apiKey:i,deviceId:o}=await this.getAuthHeaders();if(!i)throw this.createError("AUTH_REQUIRED","No API key configured");let c=await this.fetchWithRetry(`${s}/sync/link`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(i,o)},body:JSON.stringify({projectId:e,...n?{name:n}:{},...r?{meta:r}:{}})});if(!c.ok)throw await this.parseErrorResponse(c);return await c.json()}async setCloudLifecycle(e,n){try{let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();return s?(await this.fetchWithRetry(`${r}/sync/projects/${e}/${n}`,{method:"POST",headers:{...this.authHeaders(s,i)}})).ok:!1}catch{return!1}}async uploadCodeGraph(e,n){try{let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)return{ok:!1};let o=await this.fetchWithRetry(`${r}/sync/projects/${e}/code-graph`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(s,i)},body:JSON.stringify(n)});if(!o.ok)return{ok:!1};let c=await o.json();return{ok:c.ok!==!1,nodes:c.nodes,links:c.links}}catch{return{ok:!1}}}async publishBenchmark(e,n){let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)throw this.createError("AUTH_REQUIRED","No API key configured");let o=await this.fetchWithRetry(`${r}/benchmarks/evals`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(s,i)},body:JSON.stringify({projectId:e,...n})});if(!o.ok)throw await this.parseErrorResponse(o);return await o.json()}async testConnection(){let e=new AbortController,n=setTimeout(()=>e.abort(),ua("API_REQUEST"));try{let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)return clearTimeout(n),!1;let o=await fetch(`${r}/auth/verify`,{method:"GET",headers:{...this.authHeaders(s,i)},signal:e.signal});return clearTimeout(n),o.status===401||o.status===403?(await fe.clearAuth(),!1):o.ok}catch{return clearTimeout(n),!1}}async hasAuth(){return await fe.hasAuth()}async getAuthHeaders(){let[e,n,r]=await Promise.all([fe.getApiUrl(),fe.getApiKey(),fe.getDeviceId()]);return{apiUrl:e,apiKey:n,deviceId:r}}authHeaders(e,n){return{"X-Api-Key":e,"X-Device-Id":n}}async fetchWithRetry(e,n,r=0){let s=new AbortController,i=setTimeout(()=>s.abort(),ua("API_REQUEST")),o=(n.method??"GET").toUpperCase(),c=o==="GET"||o==="HEAD";try{let l=await fetch(e,{...n,signal:s.signal});if(clearTimeout(i),c&&l.status>=500&&r<this.retryConfig.maxRetries){let u=Math.min(this.retryConfig.baseDelayMs*2**r,this.retryConfig.maxDelayMs);return await this.sleep(u),this.fetchWithRetry(e,n,r+1)}return l}catch(l){if(clearTimeout(i),l instanceof Error&&l.name==="AbortError")throw this.createError("NETWORK_ERROR",`Request timed out. Try increasing PRJCT_TIMEOUT_API_REQUEST (current: ${ua("API_REQUEST")}ms)`);if(c&&r<this.retryConfig.maxRetries){let u=Math.min(this.retryConfig.baseDelayMs*2**r,this.retryConfig.maxDelayMs);return await this.sleep(u),this.fetchWithRetry(e,n,r+1)}throw this.createError("NETWORK_ERROR",l instanceof Error?l.message:"Network request failed")}}async parseErrorResponse(e){try{let n=await e.json(),r=n.detail||n.message||n.error||`HTTP ${e.status}`;return e.status===401||e.status===403?(await fe.clearAuth(),this.createError("AUTH_REQUIRED",r,e.status)):e.status===402?this.createError("PAYMENT_REQUIRED",r,e.status):this.createError("API_ERROR",r,e.status)}catch{return e.status===401||e.status===403?(await fe.clearAuth(),this.createError("AUTH_REQUIRED",`HTTP ${e.status}`,e.status)):this.createError("API_ERROR",`HTTP ${e.status}`,e.status)}}createError(e,n,r){return{code:e,message:n,status:r}}sleep(e){return new Promise(n=>setTimeout(n,e))}},Dn=new Yu,d0=Dn});var zu,dr,By=f(()=>{"use strict";K();O();zu=class{static{a(this,"SyncPendingStorage")}append(e,n){let r=v(),s=JSON.stringify(n);return n.entityType&&n.entityId&&n.contentHash&&y.run(e,`DELETE FROM sync_pending
1345
+ `;a(Mu,"powershellArgs");a(ju,"windowsCommand");a(vy,"readWindowsCredentialManager");a(KN,"writeWindowsCredentialManager");a(YN,"clearWindowsCredentialManager");a(zN,"platformGet");a(QN,"hasSecureCredentialStore");a(ZN,"platformSet");a(e0,"platformClear");a(t0,"platformLocation");a($u,"activeStore");a(ki,"getAuthToken");a(Fu,"setAuthToken");a(Hu,"clearAuthToken")});var qu={};A(qu,{default:()=>fe});import n0 from"node:crypto";import Uu from"node:fs/promises";import Wu from"node:os";import xy from"node:path";function Bu(){return n0.randomUUID()}function Gu(t){return{...t,apiKey:null}}var Cy,Ry,Xu,r0,fe,ss=f(()=>{"use strict";Fe();Y();_y();Cy="https://cli-api.prjct.app",Ry={apiKey:null,apiUrl:Cy,userId:null,email:null,lastAuth:null};a(Bu,"freshDeviceId");a(Gu,"metadataOnly");Xu=class{static{a(this,"AuthConfigManager")}configPath;cachedConfig=null;constructor(){this.configPath=W.getAuthConfigPath()}getConfigPath(){return this.configPath}async read(){if(this.cachedConfig)return this.cachedConfig={...this.cachedConfig,apiKey:await ki()},this.cachedConfig;let e=await De(this.configPath),n=await ki(),r={...e??Ry,apiKey:n},s=!1;if(!n&&e?.apiKey&&(await Fu(e.apiKey),r={...r,apiKey:e.apiKey},s=!0),r.deviceId||(r.deviceId=Bu(),s=!0),r.hostname||(r.hostname=Wu.hostname(),s=!0),this.cachedConfig=r,s&&e)try{await ye(this.configPath,Gu(this.cachedConfig)),await Uu.chmod(this.configPath,384)}catch{}return this.cachedConfig}async getDeviceId(){return(await this.read()).deviceId??Bu()}async getHostname(){return(await this.read()).hostname??Wu.hostname()}async write(e){let n=await this.read();Object.hasOwn(e,"apiKey")&&(e.apiKey?await Fu(e.apiKey):await Hu());let r={...n,...e,apiKey:await ki(),lastAuth:new Date().toISOString()};await Gt(xy.dirname(this.configPath)),await ye(this.configPath,Gu(r)),await Uu.chmod(this.configPath,384),this.cachedConfig=r}async hasAuth(){let e=await this.getApiKey();return e!==null&&e.length>0}async getApiKey(){return(await this.read()).apiKey||await ki()}async getApiUrl(){return(await this.read()).apiUrl||Cy}async saveAuth(e,n,r){await this.write({apiKey:e,userId:n,email:r})}async clearAuth(){await Hu();let e=this.cachedConfig??await De(this.configPath);this.cachedConfig={...Ry,deviceId:e?.deviceId??Bu(),hostname:e?.hostname??Wu.hostname()},await Gt(xy.dirname(this.configPath)),await ye(this.configPath,Gu(this.cachedConfig)),await Uu.chmod(this.configPath,384)}async getStatus(){let e=await this.read();return{authenticated:e.apiKey!==null,email:e.email,apiKeyPrefix:null,lastAuth:e.lastAuth}}clearCache(){this.cachedConfig=null}},r0=new Xu,fe=r0});import{createHash as s0,randomBytes as Ay}from"node:crypto";function Vu(t){return t.toString("base64url")}function Dy(){let t=Vu(Ay(Iy)),e=Vu(Ay(Iy)),n=Vu(s0("sha256").update(t,"ascii").digest());return{state:e,codeVerifier:t,codeChallenge:n,codeChallengeMethod:"S256"}}function Py(t){return new URLSearchParams({flow:Ny,port:String(t.port),device_id:t.deviceId,hostname:t.hostname,state:t.state,code_challenge:t.codeChallenge,code_challenge_method:"S256"})}function Ly(t,e){if(t.get("key"))return{ok:!1,reason:"legacy-bearer",message:"This CLI requires PKCE login. Update the web app or set flow=pkce-v1; bearer tokens in the callback URL are no longer accepted."};let r=t.get("code"),s=t.get("state");return!r||!s?{ok:!1,reason:"missing",message:"Missing authorization code or state in callback"}:s!==e?{ok:!1,reason:"mismatch",message:"Login state mismatch \u2014 try `prjct login` again"}:{ok:!0,code:r,state:s}}function Oy(t){return{flow:Ny,code:t.code,state:t.state,code_verifier:t.codeVerifier,device_id:t.deviceId,redirect_uri:`http://127.0.0.1:${t.port}/callback`}}function My(t){if(!t||typeof t!="object")return null;let e=t,n=e.apiKey??e.api_key,r=e.userId??e.user_id,s=e.email,i=e.deviceId??e.device_id;return!n||!r||!s||!i?null:{apiKey:n,userId:r,email:s,deviceId:i}}var Ny,Iy,jy=f(()=>{"use strict";Ny="pkce-v1",Iy=32;a(Vu,"base64Url");a(Dy,"generatePkceMaterial");a(Py,"buildCliLoginSearchParams");a(Ly,"parsePkceCallback");a(Oy,"buildExchangeBody");a(My,"parseMintedKeyResponse")});function ua(t){let e=`PRJCT_TIMEOUT_${t}`,n=process.env[e];if(n){let r=Number.parseInt(n,10);if(!Number.isNaN(r)&&r>0)return r}return i0[t]}var i0,Lt,Ju=f(()=>{"use strict";i0={TOOL_CHECK:5e3,GIT_OPERATION:1e4,GIT_CLONE:6e4,API_REQUEST:3e4,NPM_INSTALL:12e4,WORKFLOW_HOOK:6e4};a(ua,"getTimeout");Lt={SPINNER_MSG:45,DONE_MSG:50,FAIL_MSG:65,WARN_MSG:65,STEP_MSG:35,PROGRESS_TEXT:25,ISSUE_TITLE:50,FALLBACK_TRUNCATE:50,CLEAR_WIDTH:80}});function ur(t){if(t)return o0[t]}function Fy(t,e){let n=a0[t];return n?{...$y,...e??{}}[n]!==!1:!0}var o0,a0,$y,G2,Ku=f(()=>{"use strict";o0={memories:"memories",tasks:"tasks",subtasks:"subtasks",ideas:"ideas",queue_tasks:"queue_tasks",custom_workflows:"custom_workflows",workflow_rules:"workflow_rules",archives:"archives",shipped_items:"shipped_items",shipped_features:"shipped_features",metrics_daily:"metrics_daily",work_cost_snapshots:"work_cost_snapshots",velocity_sprints:"velocity_sprints",analysis:"analysis",specs:"specs",memory:"memories",memory_entry:"memories",task:"tasks",paused_task:"tasks",subtask:"subtasks",idea:"ideas",queue:"queue_tasks",queue_task:"queue_tasks",shipped:"shipped_items",feature:"roadmap_features",workflow:"custom_workflows",workflow_rule:"workflow_rules",metric:"metrics_daily",work_cost_snapshot:"work_cost_snapshots",velocity:"velocity_sprints",spec:"specs",project:"projects",session:"sessions",agent:"agents"};a(ur,"toCloudTable");a0={memories:"memories",tasks:"tasks",subtasks:"tasks",queue_tasks:"tasks",ideas:"ideas",shipped_items:"shipped",shipped_features:"shipped",custom_workflows:"workflows",workflow_rules:"workflows",metrics_daily:"metrics",work_cost_snapshots:"metrics",velocity_sprints:"metrics",archives:"archives",analysis:"analysis",specs:"specs"},$y={memories:!0,tasks:!0,ideas:!0,shipped:!0,workflows:!0,metrics:!0,archives:!0,user_prompts:!1,agent_sessions:!1,analysis:!0,specs:!0};a(Fy,"isTableIncluded");G2=Object.keys($y)});function c0(t){return t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}function l0(t){let e={};for(let[n,r]of Object.entries(t))e[c0(n)]=r;return e}function u0(t,e){let[n,r]=e.type.split("."),s=ur(e.entityType)??ur(n);if(!s)return null;let o=e.eventType==="delete"||r==="deleted"||r==="archived"||r==="removed"?"delete":"upsert",c=e.data||{},l=l0(c),u=e.entityId||(typeof l.id=="string"?l.id:"")||(typeof c.id=="string"?c.id:"")||(typeof l.task_id=="string"?l.task_id:"")||(typeof c.taskId=="string"?c.taskId:"")||(typeof l.entity_id=="string"?l.entity_id:"")||"";u&&l.id==null&&(l.id=u);let d={event_type:o,entity_type:s,entity_id:u,data:{...l,project_id:t},project_id:t};return e.originDeviceId!==void 0&&(d.origin_device_id=e.originDeviceId),e.contentHash!==void 0&&(d.content_hash=e.contentHash),e.revisionCount!==void 0&&(d.revision_count=e.revisionCount),e.timestamp&&(d.ts=e.timestamp),d}function Hy(t,e){return e.map(n=>u0(t,n)).filter(n=>n!==null)}var Uy=f(()=>{"use strict";Ku();a(c0,"camelToSnake");a(l0,"snakeCaseKeys");a(u0,"mapCliEventToWebFormat");a(Hy,"mapCliEventsToWebFormat")});var Wy={};A(Wy,{default:()=>d0,syncClient:()=>Dn});var Yu,Dn,d0,da=f(()=>{"use strict";Ju();ss();Uy();Yu=class{static{a(this,"SyncClient")}retryConfig={maxRetries:3,baseDelayMs:1e3,maxDelayMs:3e4};async pushEvents(e,n){let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)throw this.createError("AUTH_REQUIRED","No API key configured");let o=Hy(e,n),c=await this.fetchWithRetry(`${r}/sync/batch`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(s,i)},body:JSON.stringify({projectId:e,events:o})});if(!c.ok)throw await this.parseErrorResponse(c);return await c.json()}async pullEvents(e,n,r){let{apiUrl:s,apiKey:i,deviceId:o}=await this.getAuthHeaders();if(!i)throw this.createError("AUTH_REQUIRED","No API key configured");let c={projectId:e};typeof n=="number"&&n>0&&(c.sinceEventId=n);let l=await this.fetchWithRetry(`${s}/sync/pull`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(i,o)},body:JSON.stringify(c)});if(!l.ok)throw await this.parseErrorResponse(l);return await l.json()}async getStatus(e){let{apiUrl:n,apiKey:r,deviceId:s}=await this.getAuthHeaders();if(!r)throw this.createError("AUTH_REQUIRED","No API key configured");let i=await this.fetchWithRetry(`${n}/sync/status/${e}`,{method:"GET",headers:{...this.authHeaders(r,s)}});if(!i.ok)throw await this.parseErrorResponse(i);return await i.json()}async linkProject(e,n,r){let{apiUrl:s,apiKey:i,deviceId:o}=await this.getAuthHeaders();if(!i)throw this.createError("AUTH_REQUIRED","No API key configured");let c=await this.fetchWithRetry(`${s}/sync/link`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(i,o)},body:JSON.stringify({projectId:e,...n?{name:n}:{},...r?{meta:r}:{}})});if(!c.ok)throw await this.parseErrorResponse(c);return await c.json()}async setCloudLifecycle(e,n){try{let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();return s?(await this.fetchWithRetry(`${r}/sync/projects/${e}/${n}`,{method:"POST",headers:{...this.authHeaders(s,i)}})).ok:!1}catch{return!1}}async uploadCodeGraph(e,n){try{let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)return{ok:!1};let o=await this.fetchWithRetry(`${r}/sync/projects/${e}/code-graph`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(s,i)},body:JSON.stringify(n)});if(!o.ok)return{ok:!1};let c=await o.json();return{ok:c.ok!==!1,nodes:c.nodes,links:c.links}}catch{return{ok:!1}}}async publishBenchmark(e,n){let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)throw this.createError("AUTH_REQUIRED","No API key configured");let o=await this.fetchWithRetry(`${r}/benchmarks/evals`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(s,i)},body:JSON.stringify({projectId:e,...n})});if(!o.ok)throw await this.parseErrorResponse(o);return await o.json()}async testConnection(){let e=new AbortController,n=setTimeout(()=>e.abort(),ua("API_REQUEST"));try{let{apiUrl:r,apiKey:s,deviceId:i}=await this.getAuthHeaders();if(!s)return clearTimeout(n),!1;let o=await fetch(`${r}/auth/verify`,{method:"GET",headers:{...this.authHeaders(s,i)},signal:e.signal});return clearTimeout(n),o.status===401||o.status===403?(await fe.clearAuth(),!1):o.ok}catch{return clearTimeout(n),!1}}async hasAuth(){return await fe.hasAuth()}async getAuthHeaders(){let[e,n,r]=await Promise.all([fe.getApiUrl(),fe.getApiKey(),fe.getDeviceId()]);return{apiUrl:e,apiKey:n,deviceId:r}}authHeaders(e,n){return{"X-Api-Key":e,"X-Device-Id":n}}async fetchWithRetry(e,n,r=0){let s=new AbortController,i=setTimeout(()=>s.abort(),ua("API_REQUEST")),o=(n.method??"GET").toUpperCase(),c=o==="GET"||o==="HEAD";try{let l=await fetch(e,{...n,signal:s.signal});if(clearTimeout(i),c&&l.status>=500&&r<this.retryConfig.maxRetries){let u=Math.min(this.retryConfig.baseDelayMs*2**r,this.retryConfig.maxDelayMs);return await this.sleep(u),this.fetchWithRetry(e,n,r+1)}return l}catch(l){if(clearTimeout(i),l instanceof Error&&l.name==="AbortError")throw this.createError("NETWORK_ERROR",`Request timed out. Try increasing PRJCT_TIMEOUT_API_REQUEST (current: ${ua("API_REQUEST")}ms)`);if(c&&r<this.retryConfig.maxRetries){let u=Math.min(this.retryConfig.baseDelayMs*2**r,this.retryConfig.maxDelayMs);return await this.sleep(u),this.fetchWithRetry(e,n,r+1)}throw this.createError("NETWORK_ERROR",l instanceof Error?l.message:"Network request failed")}}async parseErrorResponse(e){try{let n=await e.json(),r=n.detail||n.message||n.error||`HTTP ${e.status}`;return e.status===401||e.status===403?(await fe.clearAuth(),this.createError("AUTH_REQUIRED",r,e.status)):e.status===402?this.createError("PAYMENT_REQUIRED",r,e.status):this.createError("API_ERROR",r,e.status)}catch{return e.status===401||e.status===403?(await fe.clearAuth(),this.createError("AUTH_REQUIRED",`HTTP ${e.status}`,e.status)):this.createError("API_ERROR",`HTTP ${e.status}`,e.status)}}createError(e,n,r){return{code:e,message:n,status:r}}sleep(e){return new Promise(n=>setTimeout(n,e))}},Dn=new Yu,d0=Dn});var zu,dr,By=f(()=>{"use strict";K();O();zu=class{static{a(this,"SyncPendingStorage")}append(e,n){let r=v(),s=JSON.stringify(n);return n.entityType&&n.entityId&&n.contentHash&&y.run(e,`DELETE FROM sync_pending
1346
1346
  WHERE project_id = ?
1347
1347
  AND entity_type = ?
1348
1348
  AND entity_id = ?
@@ -1708,7 +1708,7 @@ ${qb(e,n)}`}function js(t){let e=Object.entries(t).filter(([,s])=>s!=null);if(e.
1708
1708
  > ${e}`:`## ${t}`}function Vb(t){return`> **WARNING:** ${t}`}function Zj(...t){return t.filter(Boolean).join(`
1709
1709
 
1710
1710
  `)}var Gn=f(()=>{"use strict";Dt();a(zj,"mdHeader");a(Qj,"mdFooter");a(oe,"mdOutput");a(qb,"mdTable");a(ut,"mdSection");a(wt,"mdList");a(Fc,"mdNextSteps");a(js,"mdStats");a(Ht,"mdDone");a(Vb,"mdWarn");a(Zj,"mdJoin")});import Km from"chalk";function Ym(t){return e$[t]??t}function Hc(t,e={}){if(e.quiet)return;let n=Kb[t]||"idle",r=ps.getValidCommands(n);if(r.length===0)return;let s=r.map(i=>({cmd:`p. ${Ym(i)}`,desc:Jb[i]||i}));console.log(Km.dim(`
1711
- Next:`));for(let i of s){let o=Km.cyan(i.cmd.padEnd(12));console.log(Km.dim(` ${o} \u2192 ${i.desc}`))}}function Uc(t,e=!1){let n=Kb[t]||"idle";return ps.getValidCommands(n).map(s=>({cmd:e?`prjct ${Ym(s)} --md`:`p. ${Ym(s)}`,desc:Jb[s]||s}))}var Jb,e$,Kb,Wc=f(()=>{"use strict";hd();Jb={task:"Start new work cycle",done:"Complete current work",pause:"Pause and switch context",resume:"Continue paused task",ship:"Ship the feature",reopen:"Reopen for rework",next:"View task queue",sync:"Analyze project",bug:"Report a bug",idea:"Capture an idea"},e$={task:"work"};a(Ym,"publicCommand");Kb={task:"working",done:"completed","done-subtask":"working",pause:"paused",resume:"working",ship:"shipped",reopen:"working",next:"idle",sync:"idle",init:"idle",bug:"working",idea:"idle"};a(Hc,"showNextSteps");a(Uc,"getNextSteps")});var Bc,t$,n$,Yb=f(()=>{"use strict";Bc=[{name:"intent",group:"core",surface:"ai-agile",routing:{group:"spec",method:"draft"},routingMode:"cold-only",optionSchema:{strings:["goal","tags"]},description:"Frame the work brief: objective, constraints, risks, and success signal",usage:{claude:'p. intent "<title>"',terminal:'prjct intent "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["v3 work-cycle replacement for ticket-style planning","Stores the durable brief in SQLite","Sub-verbs mirror spec for compatibility: list, show, update, audit, link-work, ship"]},{name:"work",group:"core",surface:"ai-agile",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec","geometry"],booleans:["extend"]},description:"Start or inspect a work cycle with context and evidence",usage:{claude:'p. work "<intent>"',terminal:'prjct work "<intent>" [--geometry split|single|direct]'},params:"[intent] [--geometry]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["v3 name for the execution cycle formerly exposed as task","No arg \u2192 shows the active work cycle","Surfaces related context before planning/editing","Captures harness/evidence expectations for the cycle"]},{name:"init",group:"core",surface:"support",routing:{group:"planning",method:"init"},description:"Deep project analysis and initialization",usage:{claude:'p. init "[idea]"',terminal:'prjct init "[idea]" [--yes] [--pack code,daily]'},params:"[idea] [--yes]",implemented:!0,hasTemplate:!0,requiresProject:!1,requiresLlm:!0,features:["Architect mode for blank projects","Auto tech stack recommendation","Analyzes existing codebases","`--yes` skips wizard (CI / 60s quickstart)"]},{name:"quickstart",group:"core",surface:"support",routing:{group:"planning",method:"quickstart"},optionSchema:{strings:["pack"]},description:"One-shot init + packs + agent surfaces (\u224860s install)",usage:{claude:"p. quickstart",terminal:"prjct quickstart [--pack code,daily]"},params:"[--pack]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Non-interactive init --yes","Default packs + AGENTS/CLAUDE routing","Prints three next verbs for the agent"]},{name:"task",group:"legacy",surface:"legacy",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Compatibility alias for `work`",usage:{claude:null,terminal:'prjct task "<description>"'},params:"[description]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["No arg \u2192 shows the active task (or none)","Deprecated public language: use `prjct work` for the v3 work cycle","Auto-harness classifies H0-H3 and stores expected evidence on the task","Writes to stateStorage; runs before/after workflow rules","Optional Linear issue link when the arg matches `[A-Z]+-\\d+`"]},{name:"ship",group:"core",surface:"ai-agile",routing:{group:"shipping",method:"ship"},optionSchema:{booleans:["skipHooks","noSpecGate","noTestGate","allowNewDeps","forcePressure","noJudgmentGate"],strings:["intent","geometry"]},description:"Commit, push, and celebrate shipped feature",usage:{claude:'p. ship ["feature"]',terminal:'prjct ship ["feature"]'},params:"[feature]",implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["No arg \u2192 ships the active task description, or derives a summary from the branch"]},{name:"sync",group:"core",surface:"ai-agile",routing:{group:"analysis",method:"sync"},description:"Sync project state and update workflow agents",usage:{claude:"p. sync",terminal:"prjct sync [--package=<name>] [--full]"},implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["Incremental sync: only re-analyzes changed files (default)","Force full sync: --full bypasses incremental cache","Monorepo support: --package=<name> for single package sync","Nested PRJCT.md inheritance","Per-package CLAUDE.md generation"]},{name:"eval",group:"optional",surface:"support",routing:{group:"eval",method:"eval"},optionSchema:{booleans:["publish","dryRun","json"],strings:["baseline","candidate","source","target","file"]},description:"Run product evals, compare versions, and publish actionable results",usage:{claude:"p. eval run [--candidate <version>] [--publish]",terminal:"prjct eval <run|compare|report|publish> [--baseline <version>] [--candidate <version>] [--target cloud] [--dry-run]"},params:"[run|compare|report|publish]",implemented:!0,hasTemplate:!1,requiresProject:!1,requiresLlm:!1,features:["Deterministic local eval runs stored under PRJCT_CLI_HOME/evals","Version comparisons with regression/improvement actionables","Cloud publication for shared benchmark history with server-side ownership and subscription checks"]},{name:"status",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"status"},optionSchema:{strings:["tokensIn","tokensOut"]},description:"Compatibility lifecycle escape hatch; prefer `work` outcomes",usage:{claude:null,terminal:"prjct status <value>"},params:"[value]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["No args \u2192 prints active task + current status","Workflows are the primary status-change mechanism; this is the escape"]},{name:"tag",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"tag"},optionSchema:{},description:"Compatibility metadata escape hatch; prefer synthesized context tags",usage:{claude:null,terminal:"prjct tag type:bug domain:auth"},params:"<pairs...>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Claude decides what to tag \u2014 no heuristic classifier","type:<feature|bug|improvement|chore> promotes to tasks.type"]},{name:"remember",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"remember"},optionSchema:{strings:["tags"],booleans:["force","global"]},description:"Capture a project memory entry (fact, decision, learning, gotcha, \u2026)",usage:{claude:'p. remember learning "message"',terminal:'prjct remember learning "message" --tags domain:auth'},params:'<type> "<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Types: fact, decision, learning, gotcha, pattern, anti-pattern, shipped, inbox, todo, idea, insight, question, source, person \u2014 plus user-defined","Grows the project memory consumable via `prjct context memory`"]},{name:"forget",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"forget"},optionSchema:{},description:"Delete a project memory entry by id (the delete half of `remember`)",usage:{claude:"p. forget mem_1234",terminal:"prjct forget mem_1234 [--md]"},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Accepts `mem_1234`, `mem-1234`, or a bare `1234`","Hard-deletes the source event + drops the FTS mirror and any embedding \u2014 cannot resurface lexically or semantically"]},{name:"close",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"close"},optionSchema:{strings:["reason"]},description:"Resolve/close a memory entry (inbox, signal, trap) so it leaves rotation \u2014 soft-delete + closed tag",usage:{claude:'p. close mem_1234 --reason "fixed in PR"',terminal:'prjct close mem_1234 [--reason "..."] [--md]'},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Soft-removes from recall/FTS/embeddings; records status:closed for audit","Use for resolved inbox/improvement-signals \u2014 prefer over silent forget when the resolution matters"]},{name:"capture",group:"legacy",surface:"legacy",routing:{group:"capture",method:"capture"},optionSchema:{strings:["tags"],booleans:["force","fromCurrent"]},description:"Compatibility inbox fallback; prefer synthesized `remember context`",usage:{claude:null,terminal:'prjct capture "call Ana re pricing" --tags domain:sales'},params:'"<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes memory type=inbox; Claude retypes later via a clarify workflow","No task id, no branch, no worktree \u2014 just persists",'Bare `prjct "<text>"` auto-routes to `capture`']},{name:"seed",group:"setup",surface:"support",routing:{group:"seed",method:"seed"},routingMode:"bin-only",optionSchema:{},description:"Manage declarative packs (persona, memory types, workflow slots, hook signals)",usage:{claude:"p. seed list",terminal:"prjct seed add pm,daily"},params:"[add|remove|list|suggest] [pack,pack,...]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Packs declare signals only \u2014 no bash is written","Add or remove multi-persona contexts per project","Auto-detect suggestion from project stack"]},{name:"mcp",group:"setup",surface:"support",routing:{group:"mcp",method:"mcp"},routingMode:"bin-only",optionSchema:{},description:"Toggle MCP servers per-project \u2014 interactive multi-select in your terminal, list/deny/allow for scripts",usage:{claude:"p. mcp list",terminal:"prjct mcp"},params:"[list|status|deny|allow] [serverName]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Interactive multi-select with live tool-cost delta (default UX in TTY)","Project-local \u2014 writes only to .claude/settings.local.json","Knows the well-known cloud MCPs from claude.ai (PostHog, Atlassian, etc.)","Headless list/deny/allow for LLM agents and scripts (--md flag)"]},{name:"install",group:"setup",surface:"support",routing:{group:"install",method:"install"},routingMode:"bin-only",optionSchema:{},description:"Install universal agent surfaces, Claude hooks, and Codex config",usage:{claude:"p. install",terminal:"prjct install"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Inside a prjct project, refreshes AGENTS.md as the portable baseline","Writes Claude passive hooks: SessionStart, UserPromptSubmit, \u2026","Repairs detected Codex config.toml with prjct MCP and TUI status_line","Idempotent; existing non-prjct hooks stay intact","Audit agent support with `prjct agents doctor`"]},{name:"help",group:"setup",surface:"support",routingMode:"bin-only",description:"Contextual help and guidance",usage:{claude:"p. help [topic]",terminal:"prjct help [topic]"},params:"[topic]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"analysis-save-llm",group:"optional",surface:"internal",routing:{group:"analysis",method:"saveLlmAnalysis"},description:"Persist analysis notes produced by an LLM run",usage:{claude:null,terminal:"prjct analysis-save-llm <file|text|json>"},params:"<file|text|json>",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0},{name:"analyze",group:"legacy",surface:"legacy",routing:{group:"analysis",method:"analyze"},description:"Compatibility alias for sync analysis",usage:{claude:null,terminal:"prjct analyze"},implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0},{name:"code",group:"optional",surface:"support",routing:{group:"code",method:"code"},optionSchema:{},description:"Structural code graph: symbols, trace, impact/risk, architecture (run after sync)",usage:{claude:"p. code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]",terminal:"prjct code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]"},params:"[symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm] [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Symbol index on sync; 4th work-scope signal; CALLS with enclosing + imports","trace / impact (hunk-level) / architecture / dead one-shots","Per-project cache under ~/.prjct-cli/projects/<id>/ (never in client repo)","push-graph: compact Function/Class/File + CALLS snapshot \u2192 cloud 3D","PreToolUse Grep|Glob augment; ship structural risk cue; optional CBM cli"]},{name:"lean",group:"optional",surface:"support",routing:{group:"lean",method:"lean"},optionSchema:{},description:"Anti-over-engineering: set intensity, review/audit/debt (read-only)",usage:{claude:"p. lean [review|audit|debt|off|lite|full|ultra]",terminal:"prjct lean [sub]"},params:"[review|audit|debt|off|lite|full|ultra]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show active intensity mode + a one-screen summary","review/audit/debt are advisory \u2014 no gate, no source writes","off|lite|full|ultra sets the intensity (mirrors ponytail modes)"]},{name:"tdd",group:"optional",surface:"support",routing:{group:"tdd",method:"tdd"},optionSchema:{},description:"Test-Driven Development: set intensity, run the test command (check)",usage:{claude:"p. tdd [check|off|assist|strict]",terminal:"prjct tdd [sub]"},params:"[check|off|assist|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the auto-detected test command","off|assist|strict sets the intensity (opt-in, like lean)","check runs the detected test command now (red/green) \u2014 the real gate"]},{name:"judgment",group:"optional",surface:"support",routing:{group:"judgment",method:"judgment"},optionSchema:{booleans:["md"]},description:"Precision judgment v2: evidence tax, DNA, RED/BLUE merge, ghosts, next card, ship gate",usage:{claude:"p. judgment [plan|open|add|merge|challenge|next|approve|\u2026]",terminal:"prjct judgment [sub]"},params:"[plan|open|add|merge|challenge|fix-round|fixed|verify|brief|next|ghosts|approve|escalate|status|clear]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["next \u2192 machine directive card (agent loop never re-derives state)","evidence tax + finding DNA + project ghost FP memory","RED/BLUE dual-blind merge; contradiction auto-escalates","code-strict ship hard-gates on ledger.approved before task complete"]},{name:"sdd",group:"optional",surface:"support",routing:{group:"sdd",method:"sdd"},optionSchema:{},description:"Spec-Driven Development: gate the spec pipeline (off/advisory/strict)",usage:{claude:"p. sdd [off|advisory|strict]",terminal:"prjct sdd [sub]"},params:"[off|advisory|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the active task spec station (pipeline checklist)","off|advisory|strict sets the intensity (opt-in, like lean)","strict: every task needs a reviewed spec; ship blocks unspecced work"]},{name:"notify",group:"setup",surface:"support",routing:{group:"notify",method:"notify"},optionSchema:{},description:"Desktop notifications (default on): ping on Claude-waiting + subagent-finished",usage:{claude:"p. notify [on|off]",terminal:"prjct notify [on|off]"},params:"[on|off]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Default ON \u2014 pings when Claude is waiting or a subagent finishes","No arg \u2192 show mode + what fires","off silences OS notifications (per-prompt work-state block stays)"]},{name:"agents",group:"setup",surface:"support",routing:{group:"agents",method:"agents"},optionSchema:{booleans:["fix"]},description:"Show the concrete compatibility matrix for AI coding agents (doctor) or harness surface map (surfaces)",usage:{claude:"p. agents [doctor|surfaces|doctor --fix]",terminal:"prjct agents [doctor|surfaces [--detail]|doctor --fix]"},params:"[doctor|status|list|surfaces] [--fix] [--detail]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Derives support levels from the runtime registry","Reports AGENTS.md, MCP, skills, hooks, ACP, and project-rule support","surfaces: benchmark-tier harness map (hooks/MCP/skills wire status)","doctor --fix refreshes repo-local agent surfaces when run inside a project",'Use this to audit claims like "works with Codex/Gemini/OpenCode/Cursor/Grok"']},{name:"value",group:"legacy",surface:"legacy",routing:{group:"product",method:"value"},optionSchema:{},description:"Compatibility alias for `insights value`",usage:{claude:null,terminal:"prjct value [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Scores project continuity from real SQLite data","Counts durable memory, preventive guardrails, shipped work, sync metrics, and agent coverage","Designed as the paid-tier proof screen for humans and agents"]},{name:"memory-doctor",group:"legacy",surface:"legacy",routing:{group:"product",method:"memoryDoctor"},optionSchema:{},description:"Compatibility alias for `insights quality`",usage:{claude:null,terminal:"prjct memory-doctor [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Finds duplicate groups, stale inbox entries, low-signal memories, and missing types","Read-only by default; recommends exact cleanup actions","Protects recall quality across Claude, Codex, Gemini, OpenCode, and future agents"]},{name:"report",group:"legacy",surface:"legacy",routing:{group:"product",method:"report"},optionSchema:{numbers:["days"]},description:"Compatibility alias for `insights report`",usage:{claude:null,terminal:"prjct report [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Summarizes shipped features, completed tasks, active work, and carry-forward lessons","Uses real project state instead of a marketing changelog","Useful for founders, teams, and paid Cloud status emails"]},{name:"handoff",group:"legacy",surface:"legacy",routing:{group:"product",method:"handoff"},optionSchema:{},description:'Static continuation brief for another agent. For realtime ownership transfer use `prjct switch <agent> --reason "\u2026"` + `prjct accept`.',usage:{claude:null,terminal:"prjct handoff codex [--md]"},params:"[agent]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Gives the next agent the active task, required prjct checks, and high-value memories","Works across Codex, Claude, Gemini, Cursor, OpenCode, Qwen, Kimi, Grok, and unknown future agents","For stuck same-branch rescue with ownership transfer: prjct switch / accept (not this alias)"]},{name:"guardrails",group:"legacy",surface:"legacy",routing:{group:"product",method:"guardrails"},optionSchema:{},description:"Compatibility alias for `insights guardrails`",usage:{claude:null,terminal:"prjct guardrails [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Checks changed files against preventive memory","Falls back to general project traps when no file-specific hit exists","Advisory only; no gate, no mutation"]},{name:"insights",group:"optional",surface:"ai-agile",routing:{group:"product",method:"insights"},optionSchema:{numbers:["days"]},description:"Harness intelligence: value, quality, reliability, token cost, reports, continuation, and guardrails",usage:{claude:"p. insights [value|quality|reliability|cost|report|continue|guardrails]",terminal:"prjct insights [value|quality|reliability|cost|report|continue|guardrails] [--md]"},params:"[value|quality|reliability|cost|report|continue|guardrails] [agent|days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["v3 surface for project intelligence formerly spread across value/report/handoff/memory-doctor/guardrails","Default view summarizes whether the project is compounding","reliability/trust shows whether value, cost, and performance metrics are decision-ready","cost/spend/tokens shows subscription burn, token coverage, context reuse, and capture gaps","Subcommands remain read-only except where underlying compatibility commands already mutate nothing"]},{name:"performance",group:"optional",surface:"ai-agile",routing:{group:"product",method:"performance"},optionSchema:{numbers:["days"]},description:"Measure dev+LLM efficiency per work cycle: time, tokens, model/runtime, tools, friction",usage:{claude:"p. performance [7]",terminal:"prjct performance [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Uses real task/session rows and available token columns","Stores unknown when a runtime does not expose exact model/token data","Designed to guide the next work cycle, not to create scrum velocity reports"]},{name:"cloud",group:"setup",surface:"support",routing:{group:"cloud",method:"cloud"},optionSchema:{},description:"Cloud sync (paid): link/unlink a project, sync/pull, pause/resume, status",usage:{claude:"p. cloud [link|unlink|sync|pull|pause|resume|status]",terminal:"prjct cloud [sub]"},params:"[link|unlink|sync|pull|pause|resume|status]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Local-first: nothing leaves the machine until `prjct cloud link`","Token API only \u2014 no backend engine details, no client-side paywall","Auto-syncs on `prjct ship` and at session end once linked"]},{name:"workflow",group:"optional",surface:"support",routing:{group:"workflow",method:"workflow"},optionSchema:{},description:"Configure workflow hooks via natural language",usage:{claude:'p. workflow ["config"]',terminal:'prjct workflow ["config"]'},params:'["natural language config"]',implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0,features:["Natural language configuration","Before/after hooks for task, done, ship, sync","Permanent, session, or one-time preferences"]},{name:"start",group:"setup",surface:"support",routing:{group:"setup",method:"start"},routingMode:"bin-only",description:"First-time setup (install commands to editors)",usage:{claude:null,terminal:"prjct start"},implemented:!0,hasTemplate:!1,requiresProject:!1},{name:"setup",group:"setup",surface:"support",routing:{group:"setup",method:"setup"},routingMode:"bin-only",description:"Reconfigure editor installations and user-owned defaults",usage:{claude:"p. setup",terminal:"prjct setup"},params:"[--force] [--non-interactive]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"login",group:"setup",surface:"support",routing:{group:"setup",method:"login"},description:"Authenticate with prjct cloud (opens browser)",usage:{claude:null,terminal:"prjct login"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"logout",group:"setup",surface:"support",routing:{group:"setup",method:"logout"},description:"Sign out from prjct cloud",usage:{claude:null,terminal:"prjct logout"},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"auth",group:"setup",surface:"support",routing:{group:"setup",method:"auth"},description:"Manage cloud authentication",usage:{claude:"p. auth [action]",terminal:"prjct auth [action]"},params:"[logout|status]",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"context",group:"setup",surface:"support",routing:{group:"context",method:"context"},routingMode:"bin-only",optionSchema:{},description:"Smart context filtering tools for AI agents",usage:{claude:null,terminal:"prjct context <tool> [args]"},params:"<tool> [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["files - Find relevant files for a task","signatures - Extract code structure (~90% compression)","imports - Analyze dependency graphs","recent - Find hot files from git history","summary - Intelligent file summarization"]},{name:"search",group:"core",surface:"ai-agile",routing:{group:"context",method:"search"},optionSchema:{booleans:["global"]},description:"Search project memory (decisions, learnings, gotchas, ships\u2026) \u2014 BM25 + semantic + recall",usage:{claude:'p. search "<query>"',terminal:'prjct search "<query>" [--md]'},params:"<query>",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blended retrieval: FTS5 BM25 + opt-in semantic + recency recall","Reranks by proven usefulness, expands one hop of the memory graph","`prjct search mem_1234` resolves a specific entry by id"]},{name:"update",group:"setup",surface:"support",routing:{group:"update",method:"update"},routingMode:"bin-only",description:"Update prjct system-wide: package + migrations + daemon restart",usage:{claude:null,terminal:"prjct update [--dry-run]"},params:"[--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Phase 1: npm update (migrates homebrew \u2192 npm if needed)","Phase 2: All projects \u2014 migrate, sweep, reinstall commands","Phase 3: Daemon stop + restart with new code","--dry-run to preview without changes"]},{name:"uninstall",group:"setup",surface:"support",routing:{group:"uninstall",method:"uninstall"},routingMode:"bin-only",description:"Complete system removal of prjct",usage:{claude:null,terminal:"prjct uninstall"},params:"[--force] [--backup] [--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Removes ~/.prjct-cli/ data","Cleans CLAUDE.md prjct section","Uninstalls Homebrew/npm packages","Backup option before deletion"]},{name:"team",group:"setup",surface:"support",routing:{group:"team",method:"team"},optionSchema:{booleans:["required","enforce"],strings:["minVersion"]},description:"Enroll this repo in prjct team mode \u2014 commits .prjct/team.json + .claude/CLAUDE.md so teammates pick up shared expectations",usage:{claude:"p. team",terminal:"prjct team [--required] [--min-version <semver>]"},params:"[--required] [--min-version <semver>]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes .prjct/team.json with required/minVersion config","Adds prjct context block to .claude/CLAUDE.md (per-project)","Stages both files for the next commit (does NOT commit)","Teammates clone repo + install prjct \u2192 ready to go"]},{name:"embeddings",group:"setup",surface:"support",routing:{group:"embeddings",method:"embeddings"},optionSchema:{strings:["key","model","baseUrl","authHeader","authScheme","headers","query"]},description:"Configure the GLOBAL semantic-embeddings provider (BYOT) \u2014 one API key, stored securely, used by every project.",usage:{claude:"p. embeddings status",terminal:'prjct embeddings <set|status|test|clear> [--key <K>] [--model <M>] [--base-url <U>] [--auth-header <H>] [--auth-scheme <S|none>] [--headers "k=v,..."] [--query <qs>]'},params:"[set|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["BYOT: bring your own embedding API key \u2014 ANY OpenAI-compatible provider","Zero-config: paste just --key, the base URL is auto-detected from its prefix","OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio\u2026",'Non-Bearer providers too: --auth-header api-key --auth-scheme none --query "api-version=..." (Azure OpenAI)',"Key stored in the macOS Keychain (else a 0600 file), never in config","Global \u2014 applies to all projects; per-project config still overrides","Without a key, recall uses the always-on local subword embedder","Validate with: prjct embeddings test"]},{name:"log",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"log"},optionSchema:{strings:["task"]},params:"<note>",description:'Append-only implementation journal on the active work cycle \u2014 "what did the last agent try", the cheapest session-to-session continuity. Surfaced in prjct brief and prime.',usage:{claude:'p. log "tried X, blocked on Y"',terminal:'prjct log "<note>" [--task id]'}},{name:"brief",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"brief"},optionSchema:{},description:"COMPILED context artifact for a task: orchestration directive + journal + related memory + recently-landed conventions + graph position. Persisted, regenerable \u2014 retrieval as a build step.",usage:{claude:"p. brief",terminal:"prjct brief [task-id] [--md]"}},{name:"replan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"replan"},optionSchema:{},params:"<what-changed>",description:"Cascading drift repair: captures the pivot as a decision memory FIRST, then serves a re-plan directive over the open frontier so downstream items get re-evaluated against reality.",usage:{claude:'p. replan "auth moved to JWT"',terminal:'prjct replan "<what changed>"'}},{name:"prime",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"prime"},optionSchema:{},description:"Session-open bundle in ONE pull: active cycle + its last journal entries + ready frontier + pull-pointers. The named start-of-session ceremony.",usage:{claude:"p. prime",terminal:"prjct prime [--md]"}},{name:"land",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"land"},optionSchema:{},description:'Session-close checklist ("land the plane"): open cycle, claimed-but-unfinished items, pending sync, hand-off reminder \u2014 everything that must not die with the context.',usage:{claude:"p. land",terminal:"prjct land [--md]"}},{name:"dream",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"dream"},optionSchema:{booleans:["force","dryRun","md"],numbers:["minHours","minSessions"]},description:"Memory auto-dream: consolidate vault (triage inbox + Rho retention) and rebuild the L0 memory index \u2014 Claude Code KAIROS pattern, deterministic (no model call).",usage:{claude:"p. dream --force",terminal:"prjct dream [--force] [--dry-run] [--min-hours=24] [--min-sessions=5] [--md]"},params:"[--force] [--dry-run]",features:["Gates: \u226524h since last dream AND \u22655 lands (session counter) \u2014 bypass with --force","Phases: orient \u2192 gather \u2192 consolidate (triageInbox + applyRetention) \u2192 prune (L0 index)","Land auto-runs when gates open; dry-run previews without writes"]},{name:"ready",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"ready"},optionSchema:{},description:'The ready frontier: open backlog items with zero unresolved blocking dependencies \u2014 "what can I work on NOW" as a structural query, ranked by how much each item unblocks.',usage:{claude:"p. ready",terminal:"prjct ready [--md]"}},{name:"next",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"next"},optionSchema:{},description:'Deterministic "what now": top unclaimed item of the ready frontier, served WITH its orchestration directive (model tier, effort, ceremony, fan-out, points).',usage:{claude:"p. next",terminal:"prjct next [--md]"}},{name:"claim",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"claim"},optionSchema:{strings:["as"]},params:"<id>",description:"Race-free claim of a backlog item for multi-agent fan-out: succeeds only if unclaimed (atomic check-and-set).",usage:{claude:"p. claim <id>",terminal:"prjct claim <id> [--as name]"}},{name:"depend",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"depend"},optionSchema:{strings:["on","type"]},params:"<id>",description:"Add a typed dependency edge between work items: blocks | parent | related | discovered-from. Blocking edges are cycle-checked.",usage:{claude:"p. depend <id> --on <id>",terminal:"prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]"}},{name:"phases",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"phases"},optionSchema:{},description:"Topological execution phases over the dependency graph: items in the same phase are parallelizable \u2014 a data-driven fan-out plan with per-item orchestration.",usage:{claude:"p. phases",terminal:"prjct phases [--md]"}},{name:"expand",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"expand"},optionSchema:{},params:"<id>",description:"Decomposition loop: read the persisted complexity record + expansion directive for an item, or persist the agent's decomposition as subtasks with parent edges.",usage:{claude:"p. expand <id>",terminal:'prjct expand <id> ["subtask 1" "subtask 2" ...]'}},{name:"switch",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"switch"},optionSchema:{booleans:["launch"],strings:["reason"]},params:"<agent>",description:"Yield the active work cycle to another agent runtime (codex/claude/grok/\u2026) with who started + why \u2014 realtime handoff for stuck multi-terminal work.",usage:{claude:'p. switch codex --reason "\u2026"',terminal:'prjct switch <agent> [--reason "\u2026"] [--launch]'}},{name:"accept",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"accept"},optionSchema:{},params:"[hand_id]",description:"Accept a pending multi-agent handoff: rebind ownership of the live cycle and print the resume brief (who/why/task id).",usage:{claude:"p. accept [hand_id]",terminal:"prjct accept [hand_id] [--md]"}},{name:"handoffs",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"handoffs"},optionSchema:{},description:"List pending and recent multi-agent handoffs for this project.",usage:{claude:"p. handoffs",terminal:"prjct handoffs [--md]"}},{name:"changelog",group:"changelog",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"changelog",method:"changelog"},optionSchema:{},description:"Release notes from the typed delivery record: what shipped (by version) + completed work cycles in the window. Zero LLM \u2014 pure data-plane render.",usage:{claude:"p. changelog 14",terminal:"prjct changelog [days]"}},{name:"workflows",group:"workflowsReference",surface:"ai-agile",requiresProject:!1,implemented:!0,hasTemplate:!1,routing:{group:"workflowsReference",method:"workflows"},optionSchema:{},description:"Print the quality methodology reference (subagent dispatch, model policy, review/judgment/security workflows) \u2014 the rig-agnostic pull of what Claude reads as workflows.md.",usage:{claude:"p. workflows",terminal:"prjct workflows --md"}},{name:"memory",group:"memoryExport",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"memoryExport",method:"memory"},optionSchema:{booleans:["force","dryRun","md"],strings:["reason"]},description:"Memory surface: export|import (git-shareable), index (L0 TOC), close|forget (lifecycle), dream (auto-consolidation).",usage:{claude:"p. memory index",terminal:"prjct memory export|import|index|close <id>|forget <id>|dream [--force] [--dry-run]"},features:["export/import \u2014 git-shareable JSONL under .prjct/memory-export/","index \u2014 rebuild/show L0 compact memory TOC (SessionStart injects it)","close/forget \u2014 lifecycle aliases of top-level verbs","dream \u2014 auto-consolidation + L0 rebuild"]},{name:"guard",group:"core",surface:"ai-agile",routing:{group:"guard",method:"guard"},optionSchema:{numbers:["limit"],strings:["diff"],booleans:["strict"]},description:"Surface preventive memory (gotchas, anti-patterns, recurring-bugs) recorded against a file BEFORE you edit it \u2014 anticipation, provider-agnostic.",usage:{claude:"p. guard <file>",terminal:"prjct guard <file> | prjct guard --diff <range> [--strict]"},params:"[file]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Pillar 3 (anticipation): see the trap before you step in it","Pull, not push \u2014 also exposed as the prjct_guard MCP tool for Claude + Codex","Strict: only gotchas / anti-patterns / recurring-bugs \u2014 never plain decisions, so no noise",'Quiet by design: "clear to edit" when nothing preventive matches',"Matches absolute or repo-relative paths by exact / suffix / basename"]},{name:"config",group:"setup",surface:"support",routing:{group:"config",method:"config"},optionSchema:{},description:"Read/write global prjct config \u2014 auto-update opt-in, suggestions toggle, etc.",usage:{claude:"p. config list",terminal:"prjct config <list|get|set|unset> [key] [value]"},params:"<list|get|set|unset> [key] [value]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Stored at ~/.prjct-cli/config/global.json","Opt into silent auto-update: prjct config set auto-update on","Toggle proactive suggestions: prjct config set suggestions off","Booleans accept on/off/true/false; numbers parsed automatically"]},{name:"spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"draft"},routingMode:"cold-only",description:"Compatibility alias for `intent` \u2014 Goal/Acceptance/Scope/Risks before work starts.",usage:{claude:null,terminal:'prjct spec "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:['Drafting: `prjct spec "<title>"` IS the create action \u2014 there is no `draft` subverb (aliases `draft`/`new`/`create` are tolerated and stripped)',"Persists in `specs` SQLite table + memory event stream","Sub-verbs: list, show, update, set-status, record-review, link-task, ship, audit, inventory"]},{name:"audit-spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"audit"},routingMode:"cold-only",description:"Compatibility alias for `intent audit <id>`",usage:{claude:null,terminal:"prjct audit-spec <id>"},params:"<spec-id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Emits dispatch prompt \u2014 Claude runs three Agent calls in parallel","Each reviewer writes back via `prjct spec record-review`","All three pass \u2192 spec auto-promotes draft \u2192 reviewed"]},...[["daemon","Run the prjct daemon in the foreground"],["stop","Stop the running prjct daemon"],["restart","Restart the prjct daemon"],["upgrade","Alias of `prjct update`",{group:"update",method:"update"}],["hook","Run a Claude Code hook event (internal; called by the hook scripts)"],["hooks","Inspect or reinstall the Claude Code hooks"],["claude","Claude Code integration management (install/uninstall)"],["crew","Run a crew (multi-subagent) workflow"],["harness","Harness scorecard + Body/rig adoption (score \xB7 learn-from \xB7 list \xB7 use)"],["doctor","Diagnose the local prjct installation"],["watch","Watch project files and react to changes"],["version","Print the installed prjct version + provider status"],["prefs","Inspect or set workflow preferences"],["retro","Summarize what shipped over a time window"],["health","Codebase health snapshot"],["skill-adherence","Report how well sessions follow the prjct skill"],["review-risk","Risk-ranked review hints for the working tree"],["context-save","Save the current working context for later restore"],["context-restore","Restore a previously saved working context"]].map(([t,e,n])=>({name:t,group:"setup",description:e,routing:n,usage:{claude:null,terminal:`prjct ${t}`},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"}))],t$={"-h":"help","--help":"help","-v":"version","--version":"version"},n$=new Set([...Bc.filter(t=>t.routingMode==="bin-only").map(t=>t.name),...Object.entries(t$).filter(([,t])=>Bc.some(e=>e.name===t&&e.routingMode==="bin-only")).map(([t])=>t)])});var zb,Qb=f(()=>{"use strict";Yb();zb=new Set(Bc.filter(t=>t.routing).map(t=>t.name))});var Zb={};A(Zb,{getGitBranch:()=>Nr,getModifiedFiles:()=>zm});async function Nr(t){try{let{stdout:e}=await H("git branch --show-current",{cwd:t});return e.trim()||void 0}catch{return}}async function zm(t,e=20){try{let{stdout:n}=await H("git diff --name-only HEAD 2>/dev/null || git diff --name-only 2>/dev/null",{cwd:t});return n.trim().split(`
1711
+ Next:`));for(let i of s){let o=Km.cyan(i.cmd.padEnd(12));console.log(Km.dim(` ${o} \u2192 ${i.desc}`))}}function Uc(t,e=!1){let n=Kb[t]||"idle";return ps.getValidCommands(n).map(s=>({cmd:e?`prjct ${Ym(s)} --md`:`p. ${Ym(s)}`,desc:Jb[s]||s}))}var Jb,e$,Kb,Wc=f(()=>{"use strict";hd();Jb={task:"Start new work cycle",done:"Complete current work",pause:"Pause and switch context",resume:"Continue paused task",ship:"Ship the feature",reopen:"Reopen for rework",next:"View task queue",sync:"Analyze project",bug:"Report a bug",idea:"Capture an idea"},e$={task:"work"};a(Ym,"publicCommand");Kb={task:"working",done:"completed","done-subtask":"working",pause:"paused",resume:"working",ship:"shipped",reopen:"working",next:"idle",sync:"idle",init:"idle",bug:"working",idea:"idle"};a(Hc,"showNextSteps");a(Uc,"getNextSteps")});var Bc,t$,n$,Yb=f(()=>{"use strict";Bc=[{name:"intent",group:"core",surface:"ai-agile",routing:{group:"spec",method:"draft"},routingMode:"cold-only",optionSchema:{strings:["goal","tags"]},description:"Frame the work brief: objective, constraints, risks, and success signal",usage:{claude:'p. intent "<title>"',terminal:'prjct intent "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["v3 work-cycle replacement for ticket-style planning","Stores the durable brief in SQLite","Sub-verbs mirror spec for compatibility: list, show, update, audit, link-work, ship"]},{name:"work",group:"core",surface:"ai-agile",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec","geometry"],booleans:["extend"]},description:"Start or inspect a work cycle with context and evidence",usage:{claude:'p. work "<intent>"',terminal:'prjct work "<intent>" [--geometry split|single|direct]'},params:"[intent] [--geometry]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["v3 name for the execution cycle formerly exposed as task","No arg \u2192 shows the active work cycle","Surfaces related context before planning/editing","Captures harness/evidence expectations for the cycle"]},{name:"init",group:"core",surface:"support",routing:{group:"planning",method:"init"},description:"Deep project analysis and initialization",usage:{claude:'p. init "[idea]"',terminal:'prjct init "[idea]" [--yes] [--pack code,daily]'},params:"[idea] [--yes]",implemented:!0,hasTemplate:!0,requiresProject:!1,requiresLlm:!0,features:["Architect mode for blank projects","Auto tech stack recommendation","Analyzes existing codebases","`--yes` skips wizard (CI / 60s quickstart)"]},{name:"quickstart",group:"core",surface:"support",routing:{group:"planning",method:"quickstart"},optionSchema:{strings:["pack"]},description:"One-shot init + packs + agent surfaces (\u224860s install)",usage:{claude:"p. quickstart",terminal:"prjct quickstart [--pack code,daily]"},params:"[--pack]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Non-interactive init --yes","Default packs + AGENTS/CLAUDE routing","Prints three next verbs for the agent"]},{name:"task",group:"legacy",surface:"legacy",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Compatibility alias for `work`",usage:{claude:null,terminal:'prjct task "<description>"'},params:"[description]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["No arg \u2192 shows the active task (or none)","Deprecated public language: use `prjct work` for the v3 work cycle","Auto-harness classifies H0-H3 and stores expected evidence on the task","Writes to stateStorage; runs before/after workflow rules","Optional Linear issue link when the arg matches `[A-Z]+-\\d+`"]},{name:"ship",group:"core",surface:"ai-agile",routing:{group:"shipping",method:"ship"},optionSchema:{booleans:["skipHooks","noSpecGate","noTestGate","allowNewDeps","forcePressure","noJudgmentGate"],strings:["intent","geometry"]},description:"Commit, push, and celebrate shipped feature",usage:{claude:'p. ship ["feature"]',terminal:'prjct ship ["feature"]'},params:"[feature]",implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["No arg \u2192 ships the active task description, or derives a summary from the branch"]},{name:"sync",group:"core",surface:"ai-agile",routing:{group:"analysis",method:"sync"},description:"Sync project state and update workflow agents",usage:{claude:"p. sync",terminal:"prjct sync [--package=<name>] [--full]"},implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["Incremental sync: only re-analyzes changed files (default)","Force full sync: --full bypasses incremental cache","Monorepo support: --package=<name> for single package sync","Nested PRJCT.md inheritance","Per-package CLAUDE.md generation"]},{name:"eval",group:"optional",surface:"support",routing:{group:"eval",method:"eval"},optionSchema:{booleans:["publish","dryRun","json"],strings:["baseline","candidate","source","target","file"]},description:"Run product evals, compare versions, and publish actionable results",usage:{claude:"p. eval run [--candidate <version>] [--publish]",terminal:"prjct eval <run|compare|report|publish> [--baseline <version>] [--candidate <version>] [--target cloud] [--dry-run]"},params:"[run|compare|report|publish]",implemented:!0,hasTemplate:!1,requiresProject:!1,requiresLlm:!1,features:["Deterministic local eval runs stored under PRJCT_CLI_HOME/evals","Version comparisons with regression/improvement actionables","Cloud publication for shared benchmark history with server-side ownership and subscription checks"]},{name:"status",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"status"},optionSchema:{strings:["tokensIn","tokensOut"]},description:"Compatibility lifecycle escape hatch; prefer `work` outcomes",usage:{claude:null,terminal:"prjct status <value>"},params:"[value]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["No args \u2192 prints active task + current status","Workflows are the primary status-change mechanism; this is the escape"]},{name:"tag",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"tag"},optionSchema:{},description:"Compatibility metadata escape hatch; prefer synthesized context tags",usage:{claude:null,terminal:"prjct tag type:bug domain:auth"},params:"<pairs...>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Claude decides what to tag \u2014 no heuristic classifier","type:<feature|bug|improvement|chore> promotes to tasks.type"]},{name:"remember",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"remember"},optionSchema:{strings:["tags"],booleans:["force","global"]},description:"Capture a project memory entry (fact, decision, learning, gotcha, \u2026)",usage:{claude:'p. remember learning "message"',terminal:'prjct remember learning "message" --tags domain:auth'},params:'<type> "<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Types: fact, decision, learning, gotcha, pattern, anti-pattern, shipped, inbox, todo, idea, insight, question, source, person \u2014 plus user-defined","Grows the project memory consumable via `prjct context memory`"]},{name:"forget",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"forget"},optionSchema:{},description:"Delete a project memory entry by id (the delete half of `remember`)",usage:{claude:"p. forget mem_1234",terminal:"prjct forget mem_1234 [--md]"},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Accepts `mem_1234`, `mem-1234`, or a bare `1234`","Hard-deletes the source event + drops the FTS mirror and any embedding \u2014 cannot resurface lexically or semantically"]},{name:"close",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"close"},optionSchema:{strings:["reason"]},description:"Resolve/close a memory entry (inbox, signal, trap) so it leaves rotation \u2014 soft-delete + closed tag",usage:{claude:'p. close mem_1234 --reason "fixed in PR"',terminal:'prjct close mem_1234 [--reason "..."] [--md]'},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Soft-removes from recall/FTS/embeddings; records status:closed for audit","Use for resolved inbox/improvement-signals \u2014 prefer over silent forget when the resolution matters"]},{name:"capture",group:"legacy",surface:"legacy",routing:{group:"capture",method:"capture"},optionSchema:{strings:["tags"],booleans:["force","fromCurrent"]},description:"Compatibility inbox fallback; prefer synthesized `remember context`",usage:{claude:null,terminal:'prjct capture "call Ana re pricing" --tags domain:sales'},params:'"<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes memory type=inbox; Claude retypes later via a clarify workflow","No task id, no branch, no worktree \u2014 just persists",'Bare `prjct "<text>"` auto-routes to `capture`']},{name:"seed",group:"setup",surface:"support",routing:{group:"seed",method:"seed"},routingMode:"bin-only",optionSchema:{},description:"Manage declarative packs (persona, memory types, workflow slots, hook signals)",usage:{claude:"p. seed list",terminal:"prjct seed add pm,daily"},params:"[add|remove|list|suggest] [pack,pack,...]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Packs declare signals only \u2014 no bash is written","Add or remove multi-persona contexts per project","Auto-detect suggestion from project stack"]},{name:"mcp",group:"setup",surface:"support",routing:{group:"mcp",method:"mcp"},routingMode:"bin-only",optionSchema:{},description:"Toggle MCP servers per-project \u2014 interactive multi-select in your terminal, list/deny/allow for scripts",usage:{claude:"p. mcp list",terminal:"prjct mcp"},params:"[list|status|deny|allow] [serverName]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Interactive multi-select with live tool-cost delta (default UX in TTY)","Project-local \u2014 writes only to .claude/settings.local.json","Knows the well-known cloud MCPs from claude.ai (PostHog, Atlassian, etc.)","Headless list/deny/allow for LLM agents and scripts (--md flag)"]},{name:"install",group:"setup",surface:"support",routing:{group:"install",method:"install"},routingMode:"bin-only",optionSchema:{},description:"Install universal agent surfaces, Claude hooks, and Codex config",usage:{claude:"p. install",terminal:"prjct install"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Inside a prjct project, refreshes AGENTS.md as the portable baseline","Writes Claude passive hooks: SessionStart, UserPromptSubmit, \u2026","Repairs detected Codex config.toml with prjct MCP and TUI status_line","Idempotent; existing non-prjct hooks stay intact","Audit agent support with `prjct agents doctor`"]},{name:"help",group:"setup",surface:"support",routingMode:"bin-only",description:"Contextual help and guidance",usage:{claude:"p. help [topic]",terminal:"prjct help [topic]"},params:"[topic]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"analysis-save-llm",group:"optional",surface:"internal",routing:{group:"analysis",method:"saveLlmAnalysis"},description:"Persist analysis notes produced by an LLM run",usage:{claude:null,terminal:"prjct analysis-save-llm <file|text|json>"},params:"<file|text|json>",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0},{name:"analyze",group:"legacy",surface:"legacy",routing:{group:"analysis",method:"analyze"},description:"Compatibility alias for sync analysis",usage:{claude:null,terminal:"prjct analyze"},implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0},{name:"code",group:"optional",surface:"support",routing:{group:"code",method:"code"},optionSchema:{},description:"Structural code graph: symbols, trace, impact/risk, architecture (run after sync)",usage:{claude:"p. code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]",terminal:"prjct code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]"},params:"[symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm] [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Symbol index on sync; 4th work-scope signal; CALLS with enclosing + imports","trace / impact (hunk-level) / architecture / dead one-shots","Per-project cache under ~/.prjct-cli/projects/<id>/ (never in client repo)","push-graph: compact Function/Class/File + CALLS snapshot \u2192 cloud 3D","PreToolUse Grep|Glob augment; ship structural risk cue; optional CBM cli"]},{name:"lean",group:"optional",surface:"support",routing:{group:"lean",method:"lean"},optionSchema:{},description:"Anti-over-engineering: set intensity, review/audit/debt (read-only)",usage:{claude:"p. lean [review|audit|debt|off|lite|full|ultra]",terminal:"prjct lean [sub]"},params:"[review|audit|debt|off|lite|full|ultra]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show active intensity mode + a one-screen summary","review/audit/debt are advisory \u2014 no gate, no source writes","off|lite|full|ultra sets the intensity (mirrors ponytail modes)"]},{name:"tdd",group:"optional",surface:"support",routing:{group:"tdd",method:"tdd"},optionSchema:{},description:"Test-Driven Development: set intensity, run the test command (check)",usage:{claude:"p. tdd [check|off|assist|strict]",terminal:"prjct tdd [sub]"},params:"[check|off|assist|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the auto-detected test command","off|assist|strict sets the intensity (opt-in, like lean)","check runs the detected test command now (red/green) \u2014 the real gate"]},{name:"judgment",group:"optional",surface:"support",routing:{group:"judgment",method:"judgment"},optionSchema:{booleans:["md"]},description:"Precision judgment v2: evidence tax, DNA, RED/BLUE merge, ghosts, next card, ship gate",usage:{claude:"p. judgment [plan|open|add|merge|challenge|next|approve|\u2026]",terminal:"prjct judgment [sub]"},params:"[plan|open|add|merge|challenge|fix-round|fixed|verify|brief|next|ghosts|approve|escalate|status|clear]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["next \u2192 machine directive card (agent loop never re-derives state)","evidence tax + finding DNA + project ghost FP memory","RED/BLUE dual-blind merge; contradiction auto-escalates","code-strict ship hard-gates on ledger.approved before task complete"]},{name:"sdd",group:"optional",surface:"support",routing:{group:"sdd",method:"sdd"},optionSchema:{},description:"Spec-Driven Development: gate the spec pipeline (off/advisory/strict)",usage:{claude:"p. sdd [off|advisory|strict]",terminal:"prjct sdd [sub]"},params:"[off|advisory|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the active task spec station (pipeline checklist)","off|advisory|strict sets the intensity (opt-in, like lean)","strict: every task needs a reviewed spec; ship blocks unspecced work"]},{name:"notify",group:"setup",surface:"support",routing:{group:"notify",method:"notify"},optionSchema:{},description:"Desktop notifications (default on): ping on Claude-waiting + subagent-finished",usage:{claude:"p. notify [on|off]",terminal:"prjct notify [on|off]"},params:"[on|off]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Default ON \u2014 pings when Claude is waiting or a subagent finishes","No arg \u2192 show mode + what fires","off silences OS notifications (per-prompt work-state block stays)"]},{name:"agents",group:"setup",surface:"support",routing:{group:"agents",method:"agents"},optionSchema:{booleans:["fix"]},description:"Show the concrete compatibility matrix for AI coding agents (doctor) or harness surface map (surfaces)",usage:{claude:"p. agents [doctor|surfaces|doctor --fix]",terminal:"prjct agents [doctor|surfaces [--detail]|doctor --fix]"},params:"[doctor|status|list|surfaces] [--fix] [--detail]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Derives support levels from the runtime registry","Reports AGENTS.md, MCP, skills, hooks, ACP, and project-rule support","surfaces: benchmark-tier harness map (hooks/MCP/skills wire status)","doctor --fix refreshes repo-local agent surfaces when run inside a project",'Use this to audit claims like "works with Codex/Gemini/OpenCode/Cursor/Grok"']},{name:"value",group:"legacy",surface:"legacy",routing:{group:"product",method:"value"},optionSchema:{},description:"Compatibility alias for `insights value`",usage:{claude:null,terminal:"prjct value [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Scores project continuity from real SQLite data","Counts durable memory, preventive guardrails, shipped work, sync metrics, and agent coverage","Designed as the paid-tier proof screen for humans and agents"]},{name:"memory-doctor",group:"legacy",surface:"legacy",routing:{group:"product",method:"memoryDoctor"},optionSchema:{},description:"Compatibility alias for `insights quality`",usage:{claude:null,terminal:"prjct memory-doctor [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Finds duplicate groups, stale inbox entries, low-signal memories, and missing types","Read-only by default; recommends exact cleanup actions","Protects recall quality across Claude, Codex, Gemini, OpenCode, and future agents"]},{name:"report",group:"legacy",surface:"legacy",routing:{group:"product",method:"report"},optionSchema:{numbers:["days"]},description:"Compatibility alias for `insights report`",usage:{claude:null,terminal:"prjct report [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Summarizes shipped features, completed tasks, active work, and carry-forward lessons","Uses real project state instead of a marketing changelog","Useful for founders, teams, and paid Cloud status emails"]},{name:"handoff",group:"legacy",surface:"legacy",routing:{group:"product",method:"handoff"},optionSchema:{},description:'Static continuation brief for another agent. For realtime ownership transfer use `prjct switch <agent> --reason "\u2026"` + `prjct accept`.',usage:{claude:null,terminal:"prjct handoff codex [--md]"},params:"[agent]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Gives the next agent the active task, required prjct checks, and high-value memories","Works across Codex, Claude, Gemini, Cursor, OpenCode, Qwen, Kimi, Grok, and unknown future agents","For stuck same-branch rescue with ownership transfer: prjct switch / accept (not this alias)"]},{name:"guardrails",group:"legacy",surface:"legacy",routing:{group:"product",method:"guardrails"},optionSchema:{},description:"Compatibility alias for `insights guardrails`",usage:{claude:null,terminal:"prjct guardrails [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Checks changed files against preventive memory","Falls back to general project traps when no file-specific hit exists","Advisory only; no gate, no mutation"]},{name:"insights",group:"optional",surface:"ai-agile",routing:{group:"product",method:"insights"},optionSchema:{numbers:["days"]},description:"Harness intelligence: value, quality, reliability, token cost, reports, continuation, and guardrails",usage:{claude:"p. insights [value|quality|reliability|cost|report|continue|guardrails]",terminal:"prjct insights [value|quality|reliability|cost|report|continue|guardrails] [--md]"},params:"[value|quality|reliability|cost|report|continue|guardrails] [agent|days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["v3 surface for project intelligence formerly spread across value/report/handoff/memory-doctor/guardrails","Default view summarizes whether the project is compounding","reliability/trust shows whether value, cost, and performance metrics are decision-ready","cost/spend/tokens shows subscription burn, token coverage, context reuse, and capture gaps","Subcommands remain read-only except where underlying compatibility commands already mutate nothing"]},{name:"performance",group:"optional",surface:"ai-agile",routing:{group:"product",method:"performance"},optionSchema:{numbers:["days"]},description:"Measure dev+LLM efficiency per work cycle: time, tokens, model/runtime, tools, friction",usage:{claude:"p. performance [7]",terminal:"prjct performance [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Uses real task/session rows and available token columns","Stores unknown when a runtime does not expose exact model/token data","Designed to guide the next work cycle, not to create scrum velocity reports"]},{name:"cloud",group:"setup",surface:"support",routing:{group:"cloud",method:"cloud"},optionSchema:{},description:"Cloud sync (paid): connect/disconnect projects, sync/pull, pause/resume, list, status",usage:{claude:"p. cloud [link|unlink|projects|sync|pull|pause|resume|status] [--all|--interactive|--yes]",terminal:"prjct cloud [sub] [--all|--interactive|--yes]"},params:"[link|unlink|projects|sync|pull|pause|resume|status] [--all|--interactive|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Local-first: nothing leaves until `prjct connect` / `prjct cloud link`","One project (cwd), one-by-one (--interactive), or all (--all --yes)","Disconnect is soft \u2014 cloud history kept; local vault untouched","Auto-syncs on `prjct ship` and at session end once connected"]},{name:"connect",group:"setup",surface:"support",routing:{group:"cloud",method:"connect"},optionSchema:{},description:"Connect this project to Cloud Sync (alias of `prjct cloud link`)",usage:{claude:"p. connect [--all|--interactive|--yes]",terminal:"prjct connect [--all|--interactive|--yes]"},params:"[--all|--interactive|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["cwd: connect one repo after `prjct login`","--all --yes: bulk connect (confirm with human first)","--interactive: one-by-one Y/n (TTY)"]},{name:"disconnect",group:"setup",surface:"support",routing:{group:"cloud",method:"disconnect"},optionSchema:{},description:"Disconnect this project from Cloud Sync (alias of `prjct cloud unlink`)",usage:{claude:"p. disconnect [--all|--yes]",terminal:"prjct disconnect [--all|--yes]"},params:"[--all|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Soft disconnect \u2014 leaves Cloud list; records kept; local vault untouched","Re-connect with `prjct connect`","--all --yes: bulk disconnect after human confirm"]},{name:"workflow",group:"optional",surface:"support",routing:{group:"workflow",method:"workflow"},optionSchema:{},description:"Configure workflow hooks via natural language",usage:{claude:'p. workflow ["config"]',terminal:'prjct workflow ["config"]'},params:'["natural language config"]',implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0,features:["Natural language configuration","Before/after hooks for task, done, ship, sync","Permanent, session, or one-time preferences"]},{name:"start",group:"setup",surface:"support",routing:{group:"setup",method:"start"},routingMode:"bin-only",description:"First-time setup (install commands to editors)",usage:{claude:null,terminal:"prjct start"},implemented:!0,hasTemplate:!1,requiresProject:!1},{name:"setup",group:"setup",surface:"support",routing:{group:"setup",method:"setup"},routingMode:"bin-only",description:"Reconfigure editor installations and user-owned defaults",usage:{claude:"p. setup",terminal:"prjct setup"},params:"[--force] [--non-interactive]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"login",group:"setup",surface:"support",routing:{group:"setup",method:"login"},description:"Authenticate with prjct cloud (opens browser)",usage:{claude:null,terminal:"prjct login"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"logout",group:"setup",surface:"support",routing:{group:"setup",method:"logout"},description:"Sign out from prjct cloud",usage:{claude:null,terminal:"prjct logout"},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"auth",group:"setup",surface:"support",routing:{group:"setup",method:"auth"},description:"Manage cloud authentication",usage:{claude:"p. auth [action]",terminal:"prjct auth [action]"},params:"[logout|status]",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"context",group:"setup",surface:"support",routing:{group:"context",method:"context"},routingMode:"bin-only",optionSchema:{},description:"Smart context filtering tools for AI agents",usage:{claude:null,terminal:"prjct context <tool> [args]"},params:"<tool> [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["files - Find relevant files for a task","signatures - Extract code structure (~90% compression)","imports - Analyze dependency graphs","recent - Find hot files from git history","summary - Intelligent file summarization"]},{name:"search",group:"core",surface:"ai-agile",routing:{group:"context",method:"search"},optionSchema:{booleans:["global"]},description:"Search project memory (decisions, learnings, gotchas, ships\u2026) \u2014 BM25 + semantic + recall",usage:{claude:'p. search "<query>"',terminal:'prjct search "<query>" [--md]'},params:"<query>",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blended retrieval: FTS5 BM25 + opt-in semantic + recency recall","Reranks by proven usefulness, expands one hop of the memory graph","`prjct search mem_1234` resolves a specific entry by id"]},{name:"update",group:"setup",surface:"support",routing:{group:"update",method:"update"},routingMode:"bin-only",description:"Update prjct system-wide: package + migrations + daemon restart",usage:{claude:null,terminal:"prjct update [--dry-run]"},params:"[--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Phase 1: npm update (migrates homebrew \u2192 npm if needed)","Phase 2: All projects \u2014 migrate, sweep, reinstall commands","Phase 3: Daemon stop + restart with new code","--dry-run to preview without changes"]},{name:"uninstall",group:"setup",surface:"support",routing:{group:"uninstall",method:"uninstall"},routingMode:"bin-only",description:"Complete system removal of prjct",usage:{claude:null,terminal:"prjct uninstall"},params:"[--force] [--backup] [--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Removes ~/.prjct-cli/ data","Cleans CLAUDE.md prjct section","Uninstalls Homebrew/npm packages","Backup option before deletion"]},{name:"team",group:"setup",surface:"support",routing:{group:"team",method:"team"},optionSchema:{booleans:["required","enforce"],strings:["minVersion"]},description:"Enroll this repo in prjct team mode \u2014 commits .prjct/team.json + .claude/CLAUDE.md so teammates pick up shared expectations",usage:{claude:"p. team",terminal:"prjct team [--required] [--min-version <semver>]"},params:"[--required] [--min-version <semver>]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes .prjct/team.json with required/minVersion config","Adds prjct context block to .claude/CLAUDE.md (per-project)","Stages both files for the next commit (does NOT commit)","Teammates clone repo + install prjct \u2192 ready to go"]},{name:"embeddings",group:"setup",surface:"support",routing:{group:"embeddings",method:"embeddings"},optionSchema:{strings:["key","model","baseUrl","authHeader","authScheme","headers","query"]},description:"Configure the GLOBAL semantic-embeddings provider (BYOT) \u2014 one API key, stored securely, used by every project.",usage:{claude:"p. embeddings status",terminal:'prjct embeddings <set|status|test|clear> [--key <K>] [--model <M>] [--base-url <U>] [--auth-header <H>] [--auth-scheme <S|none>] [--headers "k=v,..."] [--query <qs>]'},params:"[set|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["BYOT: bring your own embedding API key \u2014 ANY OpenAI-compatible provider","Zero-config: paste just --key, the base URL is auto-detected from its prefix","OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio\u2026",'Non-Bearer providers too: --auth-header api-key --auth-scheme none --query "api-version=..." (Azure OpenAI)',"Key stored in the macOS Keychain (else a 0600 file), never in config","Global \u2014 applies to all projects; per-project config still overrides","Without a key, recall uses the always-on local subword embedder","Validate with: prjct embeddings test"]},{name:"log",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"log"},optionSchema:{strings:["task"]},params:"<note>",description:'Append-only implementation journal on the active work cycle \u2014 "what did the last agent try", the cheapest session-to-session continuity. Surfaced in prjct brief and prime.',usage:{claude:'p. log "tried X, blocked on Y"',terminal:'prjct log "<note>" [--task id]'}},{name:"brief",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"brief"},optionSchema:{},description:"COMPILED context artifact for a task: orchestration directive + journal + related memory + recently-landed conventions + graph position. Persisted, regenerable \u2014 retrieval as a build step.",usage:{claude:"p. brief",terminal:"prjct brief [task-id] [--md]"}},{name:"replan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"replan"},optionSchema:{},params:"<what-changed>",description:"Cascading drift repair: captures the pivot as a decision memory FIRST, then serves a re-plan directive over the open frontier so downstream items get re-evaluated against reality.",usage:{claude:'p. replan "auth moved to JWT"',terminal:'prjct replan "<what changed>"'}},{name:"prime",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"prime"},optionSchema:{},description:"Session-open bundle in ONE pull: active cycle + its last journal entries + ready frontier + pull-pointers. The named start-of-session ceremony.",usage:{claude:"p. prime",terminal:"prjct prime [--md]"}},{name:"land",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"land"},optionSchema:{},description:'Session-close checklist ("land the plane"): open cycle, claimed-but-unfinished items, pending sync, hand-off reminder \u2014 everything that must not die with the context.',usage:{claude:"p. land",terminal:"prjct land [--md]"}},{name:"dream",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"dream"},optionSchema:{booleans:["force","dryRun","md"],numbers:["minHours","minSessions"]},description:"Memory auto-dream: consolidate vault (triage inbox + Rho retention) and rebuild the L0 memory index \u2014 Claude Code KAIROS pattern, deterministic (no model call).",usage:{claude:"p. dream --force",terminal:"prjct dream [--force] [--dry-run] [--min-hours=24] [--min-sessions=5] [--md]"},params:"[--force] [--dry-run]",features:["Gates: \u226524h since last dream AND \u22655 lands (session counter) \u2014 bypass with --force","Phases: orient \u2192 gather \u2192 consolidate (triageInbox + applyRetention) \u2192 prune (L0 index)","Land auto-runs when gates open; dry-run previews without writes"]},{name:"ready",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"ready"},optionSchema:{},description:'The ready frontier: open backlog items with zero unresolved blocking dependencies \u2014 "what can I work on NOW" as a structural query, ranked by how much each item unblocks.',usage:{claude:"p. ready",terminal:"prjct ready [--md]"}},{name:"next",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"next"},optionSchema:{},description:'Deterministic "what now": top unclaimed item of the ready frontier, served WITH its orchestration directive (model tier, effort, ceremony, fan-out, points).',usage:{claude:"p. next",terminal:"prjct next [--md]"}},{name:"claim",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"claim"},optionSchema:{strings:["as"]},params:"<id>",description:"Race-free claim of a backlog item for multi-agent fan-out: succeeds only if unclaimed (atomic check-and-set).",usage:{claude:"p. claim <id>",terminal:"prjct claim <id> [--as name]"}},{name:"depend",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"depend"},optionSchema:{strings:["on","type"]},params:"<id>",description:"Add a typed dependency edge between work items: blocks | parent | related | discovered-from. Blocking edges are cycle-checked.",usage:{claude:"p. depend <id> --on <id>",terminal:"prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]"}},{name:"phases",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"phases"},optionSchema:{},description:"Topological execution phases over the dependency graph: items in the same phase are parallelizable \u2014 a data-driven fan-out plan with per-item orchestration.",usage:{claude:"p. phases",terminal:"prjct phases [--md]"}},{name:"expand",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"expand"},optionSchema:{},params:"<id>",description:"Decomposition loop: read the persisted complexity record + expansion directive for an item, or persist the agent's decomposition as subtasks with parent edges.",usage:{claude:"p. expand <id>",terminal:'prjct expand <id> ["subtask 1" "subtask 2" ...]'}},{name:"switch",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"switch"},optionSchema:{booleans:["launch"],strings:["reason"]},params:"<agent>",description:"Yield the active work cycle to another agent runtime (codex/claude/grok/\u2026) with who started + why \u2014 realtime handoff for stuck multi-terminal work.",usage:{claude:'p. switch codex --reason "\u2026"',terminal:'prjct switch <agent> [--reason "\u2026"] [--launch]'}},{name:"accept",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"accept"},optionSchema:{},params:"[hand_id]",description:"Accept a pending multi-agent handoff: rebind ownership of the live cycle and print the resume brief (who/why/task id).",usage:{claude:"p. accept [hand_id]",terminal:"prjct accept [hand_id] [--md]"}},{name:"handoffs",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"handoffs"},optionSchema:{},description:"List pending and recent multi-agent handoffs for this project.",usage:{claude:"p. handoffs",terminal:"prjct handoffs [--md]"}},{name:"changelog",group:"changelog",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"changelog",method:"changelog"},optionSchema:{},description:"Release notes from the typed delivery record: what shipped (by version) + completed work cycles in the window. Zero LLM \u2014 pure data-plane render.",usage:{claude:"p. changelog 14",terminal:"prjct changelog [days]"}},{name:"workflows",group:"workflowsReference",surface:"ai-agile",requiresProject:!1,implemented:!0,hasTemplate:!1,routing:{group:"workflowsReference",method:"workflows"},optionSchema:{},description:"Print the quality methodology reference (subagent dispatch, model policy, review/judgment/security workflows) \u2014 the rig-agnostic pull of what Claude reads as workflows.md.",usage:{claude:"p. workflows",terminal:"prjct workflows --md"}},{name:"memory",group:"memoryExport",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"memoryExport",method:"memory"},optionSchema:{booleans:["force","dryRun","md"],strings:["reason"]},description:"Memory surface: export|import (git-shareable), index (L0 TOC), close|forget (lifecycle), dream (auto-consolidation).",usage:{claude:"p. memory index",terminal:"prjct memory export|import|index|close <id>|forget <id>|dream [--force] [--dry-run]"},features:["export/import \u2014 git-shareable JSONL under .prjct/memory-export/","index \u2014 rebuild/show L0 compact memory TOC (SessionStart injects it)","close/forget \u2014 lifecycle aliases of top-level verbs","dream \u2014 auto-consolidation + L0 rebuild"]},{name:"guard",group:"core",surface:"ai-agile",routing:{group:"guard",method:"guard"},optionSchema:{numbers:["limit"],strings:["diff"],booleans:["strict"]},description:"Surface preventive memory (gotchas, anti-patterns, recurring-bugs) recorded against a file BEFORE you edit it \u2014 anticipation, provider-agnostic.",usage:{claude:"p. guard <file>",terminal:"prjct guard <file> | prjct guard --diff <range> [--strict]"},params:"[file]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Pillar 3 (anticipation): see the trap before you step in it","Pull, not push \u2014 also exposed as the prjct_guard MCP tool for Claude + Codex","Strict: only gotchas / anti-patterns / recurring-bugs \u2014 never plain decisions, so no noise",'Quiet by design: "clear to edit" when nothing preventive matches',"Matches absolute or repo-relative paths by exact / suffix / basename"]},{name:"config",group:"setup",surface:"support",routing:{group:"config",method:"config"},optionSchema:{},description:"Read/write global prjct config \u2014 auto-update opt-in, suggestions toggle, etc.",usage:{claude:"p. config list",terminal:"prjct config <list|get|set|unset> [key] [value]"},params:"<list|get|set|unset> [key] [value]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Stored at ~/.prjct-cli/config/global.json","Opt into silent auto-update: prjct config set auto-update on","Toggle proactive suggestions: prjct config set suggestions off","Booleans accept on/off/true/false; numbers parsed automatically"]},{name:"spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"draft"},routingMode:"cold-only",description:"Compatibility alias for `intent` \u2014 Goal/Acceptance/Scope/Risks before work starts.",usage:{claude:null,terminal:'prjct spec "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:['Drafting: `prjct spec "<title>"` IS the create action \u2014 there is no `draft` subverb (aliases `draft`/`new`/`create` are tolerated and stripped)',"Persists in `specs` SQLite table + memory event stream","Sub-verbs: list, show, update, set-status, record-review, link-task, ship, audit, inventory"]},{name:"audit-spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"audit"},routingMode:"cold-only",description:"Compatibility alias for `intent audit <id>`",usage:{claude:null,terminal:"prjct audit-spec <id>"},params:"<spec-id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Emits dispatch prompt \u2014 Claude runs three Agent calls in parallel","Each reviewer writes back via `prjct spec record-review`","All three pass \u2192 spec auto-promotes draft \u2192 reviewed"]},...[["daemon","Run the prjct daemon in the foreground"],["stop","Stop the running prjct daemon"],["restart","Restart the prjct daemon"],["upgrade","Alias of `prjct update`",{group:"update",method:"update"}],["hook","Run a Claude Code hook event (internal; called by the hook scripts)"],["hooks","Inspect or reinstall the Claude Code hooks"],["claude","Claude Code integration management (install/uninstall)"],["crew","Run a crew (multi-subagent) workflow"],["harness","Harness scorecard + Body/rig adoption (score \xB7 learn-from \xB7 list \xB7 use)"],["doctor","Diagnose the local prjct installation"],["watch","Watch project files and react to changes"],["version","Print the installed prjct version + provider status"],["prefs","Inspect or set workflow preferences"],["retro","Summarize what shipped over a time window"],["health","Codebase health snapshot"],["skill-adherence","Report how well sessions follow the prjct skill"],["review-risk","Risk-ranked review hints for the working tree"],["context-save","Save the current working context for later restore"],["context-restore","Restore a previously saved working context"]].map(([t,e,n])=>({name:t,group:"setup",description:e,routing:n,usage:{claude:null,terminal:`prjct ${t}`},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"}))],t$={"-h":"help","--help":"help","-v":"version","--version":"version"},n$=new Set([...Bc.filter(t=>t.routingMode==="bin-only").map(t=>t.name),...Object.entries(t$).filter(([,t])=>Bc.some(e=>e.name===t&&e.routingMode==="bin-only")).map(([t])=>t)])});var zb,Qb=f(()=>{"use strict";Yb();zb=new Set(Bc.filter(t=>t.routing).map(t=>t.name))});var Zb={};A(Zb,{getGitBranch:()=>Nr,getModifiedFiles:()=>zm});async function Nr(t){try{let{stdout:e}=await H("git branch --show-current",{cwd:t});return e.trim()||void 0}catch{return}}async function zm(t,e=20){try{let{stdout:n}=await H("git diff --name-only HEAD 2>/dev/null || git diff --name-only 2>/dev/null",{cwd:t});return n.trim().split(`
1712
1712
  `).filter(r=>r.length>0).slice(0,e)}catch{return[]}}var $s=f(()=>{"use strict";ne();a(Nr,"getGitBranch");a(zm,"getModifiedFiles")});function r$(t){return{projectId:t.project_id,taskId:t.task_id,workspaceId:t.workspace_id,classification:t.classification,station:t.station,requiresSpec:t.requires_spec===1,requiresTestsFirst:t.requires_tests_first===1,reason:t.reason,linkedSpecId:t.linked_spec_id,createdAt:t.created_at,updatedAt:t.updated_at}}function ev(t,e){let n=ro(t,e.taskId,e.workspaceId),r=v(),s=n?.createdAt??r;return E.run(t,`INSERT INTO task_pipeline_state (
1713
1713
  project_id, task_id, workspace_id, classification, station,
1714
1714
  requires_spec, requires_tests_first, reason, linked_spec_id,