prjct-cli 3.87.0 → 3.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/bin/prjct +9 -2
- package/dist/bin/hook-chunks/agent-identity-45BYQBU2.mjs +8 -0
- package/dist/bin/hook-chunks/agent-switch-FBQDHWAO.mjs +22 -0
- package/dist/bin/hook-chunks/analysis-NRRZYJ6G.mjs +42 -0
- package/dist/bin/hook-chunks/auth-config-WNUARXTJ.mjs +8 -0
- package/dist/bin/hook-chunks/auto-flush-D3X3U4CP.mjs +8 -0
- package/dist/bin/hook-chunks/auto-updater-EHRRMCYY.mjs +9 -0
- package/dist/bin/hook-chunks/capture-gate-BFOABO2Y.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-2H57GV2T.mjs +38 -0
- package/dist/bin/hook-chunks/chunk-2NMSEZTQ.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-2OU2MKNS.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-2UC4DTDO.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-3FBCOCPD.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-3HDIQJ55.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-3JUE6MNF.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-3LG3ACQV.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-45I2C2UB.mjs +25 -0
- package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-4WHS7CO7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-54LH63LM.mjs +7 -0
- package/dist/bin/hook-chunks/chunk-5T5PZKHW.mjs +16 -0
- package/dist/bin/hook-chunks/chunk-5TBQNW2G.mjs +17 -0
- package/dist/bin/hook-chunks/chunk-5WAONIPX.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-6EWGHM32.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-6IKHMK2U.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-75UJIVMO.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-7OZDWT6C.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-7SI6X3Z7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-A4OFZ2SK.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-A5RNWWTH.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-AOPJ4Z6O.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-AUUWQH3S.mjs +14 -0
- package/dist/bin/hook-chunks/chunk-AW25AWN5.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-BISPGBNN.mjs +35 -0
- package/dist/bin/hook-chunks/chunk-BUDZL4DW.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-CE4RCNC7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-CREPUNOS.mjs +24 -0
- package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-CULYIJJZ.mjs +16 -0
- package/dist/bin/hook-chunks/chunk-D7TRY3CO.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-DAOC3T5G.mjs +43 -0
- package/dist/bin/hook-chunks/chunk-DMXFGLZE.mjs +21 -0
- package/dist/bin/hook-chunks/chunk-DXQMKW2B.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-DYHYDHCW.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-E66B27AL.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-EM6ZDJAK.mjs +45 -0
- package/dist/bin/hook-chunks/chunk-F652GI4F.mjs +15 -0
- package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +47 -0
- package/dist/bin/hook-chunks/chunk-GAOQHD5S.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-GCKILEXJ.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-GHBGBP2M.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-GJFWVCTS.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-GSMDQ7VM.mjs +16 -0
- package/dist/bin/hook-chunks/chunk-GVJZPOG2.mjs +13 -0
- package/dist/bin/hook-chunks/chunk-GVNMXVVA.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-H6KVNDQD.mjs +71 -0
- package/dist/bin/hook-chunks/chunk-HDHVBB6Q.mjs +1260 -0
- package/dist/bin/hook-chunks/chunk-HDSS6UB3.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-HE5RSIHG.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-HZIORCPO.mjs +16 -0
- package/dist/bin/hook-chunks/chunk-HZXDF2TQ.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-JQE2F2RK.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-JQLJM4BK.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-KEJ5RMAI.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +13 -0
- package/dist/bin/hook-chunks/chunk-LLQUB6YR.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-LWCHQIJ7.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-MECJJJ7R.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-MEQS4VPO.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-MXHX44WF.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-NLG2EW6M.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-NN65WGGN.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +12 -0
- package/dist/bin/hook-chunks/chunk-ODWWIFSN.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-OFVLGJ76.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-OVR6RUUZ.mjs +13 -0
- package/dist/bin/hook-chunks/chunk-P43HDWI5.mjs +14 -0
- package/dist/bin/hook-chunks/chunk-PKDYFXMI.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-PSSR7LSW.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-PTVXWPQH.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-Q5I2UPD6.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-QDQ7DTDV.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-QSAA6LZF.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-R77TXXPP.mjs +53 -0
- package/dist/bin/hook-chunks/chunk-RNCLLUMK.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-SJ75V4WG.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-SN224ILI.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-SNISJ7HR.mjs +15 -0
- package/dist/bin/hook-chunks/chunk-SOPRYWUY.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-SYHDEUVU.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-TPESWBA7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-TRMBRDKH.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-TXJT3G53.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-UDUUEZD3.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-UUULLTQV.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-V37VTXDW.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-VAXQ5IDD.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-WDGDFXSB.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-WUHGODSQ.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-X5RDLFPM.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-XGYCAVB2.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-Y5NQV46G.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-YGHIPTJN.mjs +13 -0
- package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-YORSHLFH.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-YUOTOCKK.mjs +103 -0
- package/dist/bin/hook-chunks/chunk-ZTZTVBAZ.mjs +12 -0
- package/dist/bin/hook-chunks/chunk-ZX2KFQV5.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-ZZ65CN5F.mjs +20 -0
- package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +8 -0
- package/dist/bin/hook-chunks/codex-skill-MNY46575.mjs +8 -0
- package/dist/bin/hook-chunks/command-installer-ZOQQLRCI.mjs +8 -0
- package/dist/bin/hook-chunks/config-manager-KJCMN7PV.mjs +8 -0
- package/dist/bin/hook-chunks/content-bound-stamp-72EQVZLP.mjs +10 -0
- package/dist/bin/hook-chunks/context-pressure-OUN5PFMN.mjs +8 -0
- package/dist/bin/hook-chunks/context7-service-4C6VNJUS.mjs +8 -0
- package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-KXOCN55N.mjs +8 -0
- package/dist/bin/hook-chunks/cycle-budget-card-O5WAGNGC.mjs +9 -0
- package/dist/bin/hook-chunks/database-SLDTQXWG.mjs +8 -0
- package/dist/bin/hook-chunks/delivery-geometry-VHCURJ7E.mjs +8 -0
- package/dist/bin/hook-chunks/detect-changes-6N4DCWXQ.mjs +17 -0
- package/dist/bin/hook-chunks/detection-MEYHME4X.mjs +8 -0
- package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +12 -0
- package/dist/bin/hook-chunks/discuss-lock-55GER2LR.mjs +8 -0
- package/dist/bin/hook-chunks/distill-R477XZE3.mjs +8 -0
- package/dist/bin/hook-chunks/drift-refresh-TD3PYPJN.mjs +8 -0
- package/dist/bin/hook-chunks/editors-config-3N6VREZR.mjs +8 -0
- package/dist/bin/hook-chunks/enriched-recall-65X44HBM.mjs +8 -0
- package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +8 -0
- package/dist/bin/hook-chunks/format-UF2TLTKX.mjs +8 -0
- package/dist/bin/hook-chunks/git-helpers-6JLP2OJZ.mjs +8 -0
- package/dist/bin/hook-chunks/infer-memory-file-PIAZ542H.mjs +8 -0
- package/dist/bin/hook-chunks/judgment-ledger-storage-UKROWRVA.mjs +8 -0
- package/dist/bin/hook-chunks/judgment-orchestrator-UFGNBTEK.mjs +8 -0
- package/dist/bin/hook-chunks/judgment-receipt-NXL5Q4CE.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-SRIIDHMN.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-ANVOY7AM.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-PSJCO5UP.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-7LM2BMWZ.mjs +10 -0
- package/dist/bin/hook-chunks/notification-2TZO3WRM.mjs +8 -0
- package/dist/bin/hook-chunks/nyquist-lite-GE7OAFLC.mjs +10 -0
- package/dist/bin/hook-chunks/pack-integrity-6VKUAISJ.mjs +10 -0
- package/dist/bin/hook-chunks/pack-manager-KQBNP6XR.mjs +8 -0
- package/dist/bin/hook-chunks/package-legitimacy-HXC4L73B.mjs +8 -0
- package/dist/bin/hook-chunks/path-manager-F2HE2GGK.mjs +8 -0
- package/dist/bin/hook-chunks/planning-ZQNNDOEL.mjs +9 -0
- package/dist/bin/hook-chunks/post-edit-AEFFZFPO.mjs +8 -0
- package/dist/bin/hook-chunks/pr-convention-7UGI7TFA.mjs +8 -0
- package/dist/bin/hook-chunks/pre-bash-3FACZOB5.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-MDFDQ5QZ.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-ORX656T5.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-ITHMLNGN.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-UFS2Z5VJ.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +8 -0
- package/dist/bin/hook-chunks/precision-classifier-IVVAXE26.mjs +8 -0
- package/dist/bin/hook-chunks/precision-judgment-WPTCNTGV.mjs +8 -0
- package/dist/bin/hook-chunks/prjct-md-IKUVPUGT.mjs +8 -0
- package/dist/bin/hook-chunks/project-agent-surfaces-VCOI4GHT.mjs +8 -0
- package/dist/bin/hook-chunks/project-file-inventory-ZAPKPKY6.mjs +8 -0
- package/dist/bin/hook-chunks/project-memory-KRA3BH7A.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-363CLE32.mjs +8 -0
- package/dist/bin/hook-chunks/prompt-6L7B546V.mjs +22 -0
- package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +8 -0
- package/dist/bin/hook-chunks/purge-IPK4NJN6.mjs +8 -0
- package/dist/bin/hook-chunks/retention-S2GGTVY2.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-JIPV7QJP.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-DABISZYM.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-GJPAQ3GL.mjs +8 -0
- package/dist/bin/hook-chunks/settings-installer-QDM3GB6J.mjs +9 -0
- package/dist/bin/hook-chunks/setup-TG5O5TKD.mjs +142 -0
- package/dist/bin/hook-chunks/shipping-VCLQS7GP.mjs +13 -0
- package/dist/bin/hook-chunks/skill-index-OOVAXHYJ.mjs +12 -0
- package/dist/bin/hook-chunks/spec-context-inference-MOOQL2VC.mjs +15 -0
- package/dist/bin/hook-chunks/spec-service-33UDKWXT.mjs +11 -0
- package/dist/bin/hook-chunks/spec-task-breakdown-FES465AB.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +8 -0
- package/dist/bin/hook-chunks/stop-IWI5SQG6.mjs +17 -0
- package/dist/bin/hook-chunks/subagent-start-NJZOWV2P.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-R6HIIVWQ.mjs +8 -0
- package/dist/bin/hook-chunks/surface-attribution-JYE6VDZR.mjs +8 -0
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +8 -0
- package/dist/bin/hook-chunks/sync-analyzer-FKC57RTV.mjs +8 -0
- package/dist/bin/hook-chunks/sync-client-DJWOG2ZQ.mjs +8 -0
- package/dist/bin/hook-chunks/sync-cursor-storage-2VKG757H.mjs +19 -0
- package/dist/bin/hook-chunks/task-orchestration-MLOCR7GA.mjs +8 -0
- package/dist/bin/hook-chunks/task-overview-6ZQKJGSH.mjs +8 -0
- package/dist/bin/hook-chunks/task-service-NSS5SVJE.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-AKXWUK2Y.mjs +10 -0
- package/dist/bin/hook-chunks/template-loader-KLKEG7XM.mjs +8 -0
- package/dist/bin/hook-chunks/transcript-jsonl-6X4DDD6R.mjs +8 -0
- package/dist/bin/hook-chunks/trust-boundary-ERMDF2C5.mjs +8 -0
- package/dist/bin/hook-chunks/usefulness-253CZLNY.mjs +8 -0
- package/dist/bin/hook-chunks/vault-retire-notice-GRT3QRLZ.mjs +9 -0
- package/dist/bin/hook-chunks/velocity-storage-UPW6TLK6.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-JQ23PTXN.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-C7BJX6QE.mjs +8 -0
- package/dist/bin/hook-chunks/workspace-occupancy-UVIRHY5Z.mjs +8 -0
- package/dist/bin/hook-chunks/worktree-service-XGRN5TTE.mjs +12 -0
- package/dist/bin/hook-fast-linux-x64 +0 -0
- package/dist/bin/prjct-core.mjs +625 -624
- package/dist/bin/prjct-hooks.mjs +3 -2282
- package/dist/bin/prjct.mjs +17 -2
- package/dist/daemon/entry.mjs +555 -554
- package/dist/mcp/server.mjs +196 -195
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as se,b as v,d as G}from"./chunk-PW3KYKVS.mjs";import{b as re}from"./chunk-45I2C2UB.mjs";import{a as P}from"./chunk-EM6ZDJAK.mjs";import{c as ne}from"./chunk-L4COZ7ZH.mjs";import{b as te}from"./chunk-2UC4DTDO.mjs";import{a as B}from"./chunk-FGQZ62ZP.mjs";import{a as Z,b as ee}from"./chunk-TRMBRDKH.mjs";import"./chunk-TPESWBA7.mjs";import{b as Q}from"./chunk-ODWWIFSN.mjs";import{c as L}from"./chunk-ZZ65CN5F.mjs";import{c as V}from"./chunk-OVR6RUUZ.mjs";import"./chunk-Y5NQV46G.mjs";import{a as g}from"./chunk-DAOC3T5G.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-OFVLGJ76.mjs";import{g as Ve,h as Qe}from"./chunk-UUULLTQV.mjs";import{a as Y,c as U}from"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b as S}from"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import{a as K,b as Ye,e as b,f as I,g as R}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{b as q,e as ze,s as z,t as Ke}from"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import{e as A,g as D,l as C,o as X}from"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as c,b as M,e as T}from"./chunk-E66B27AL.mjs";import k from"node:fs/promises";import We from"node:path";import Ze from"node:crypto";import et from"node:fs/promises";var ce="friction-detector",ie="friction-promote",oe=5,ae=400,ue=160,tt=[/^\s*no[,.!\s]/i,/^\s*nope\b/i,/^\s*stop\b/i,/^\s*wait\b/i,/^\s*cancel\b/i],rt=[/\bshould be\b/i,/\brather than\b/i,/\binstead\b/i],nt=[/\bdoesn'?t work\b/i,/\bbroken\b/i,/\bagain\b.*\bsame\b/i];async function le(r,e,t,s={}){let n=s.preloadedLines?s.preloadedLines:await et.readFile(e,"utf-8").then(st).catch(()=>null);if(!n)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=it(n);if(i.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=i.slice(0,oe).map(p=>({category:p.category,expectedBehavior:"Follow the user constraint without requiring correction.",observedBehavior:`The assistant response triggered user ${p.category}.`,relatedRuleId:null})),a=pt(r),u=fe(r)??void 0;return{...await i.slice(0,oe).reduce(async(p,m)=>{let d=await p,y=de(m.excerpt).slice(0,12);if(a.has(y))return await ut(r,u,m).catch(()=>{}),{...d,signalsSkipped:d.signalsSkipped+1};try{return await g.remember(r,{type:"improvement-signal",content:ct(m),tags:{source:ce,category:m.category,...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},...t?{session:t}:{},key:y},provenance:"extracted",projectId:u}),a.add(y),{...d,signalsRecorded:d.signalsRecorded+1}}catch{return{...d,signalsSkipped:d.signalsSkipped+1}}},Promise.resolve({signalsRecorded:0,signalsSkipped:0})),failures:o}}c(le,"detectFriction");function st(r){return v(r)}c(st,"parseJsonl");function it(r){let e={signals:[],lastAssistantText:""};for(let t of r){let s=t.role??t.message?.role,n=at(t.content??t.message?.content);if(!n)continue;if(s==="assistant"){e.lastAssistantText=n;continue}if(s!=="user")continue;let i=ot(n.slice(0,300));i&&e.signals.push({excerpt:n.slice(0,ae).trim(),category:i,precedingAssistantPreview:e.lastAssistantText.slice(0,ae).trim()})}return e.signals}c(it,"extractSignals");function ot(r){return nt.some(e=>e.test(r))?"complaint":tt.some(e=>e.test(r))?"negation":rt.some(e=>e.test(r))?"correction":null}c(ot,"classify");function at(r){return typeof r=="string"?r:Array.isArray(r)?r.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return typeof t=="string"?t:""}return""}).join(`
|
|
9
|
+
`).trim():""}c(at,"textOf");function ct(r){let e=lt(r.category),t=pe(r.excerpt),s=t?`Obey developer constraint: ${t}`:e.lesson,n=t?`Always: ${t}`:e.nextAction;return[`[${r.category}] Lesson: ${s}`,"What happened: The user pushed back after the assistant response.",`Why it mattered: ${e.why}`,`Pattern: ${e.pattern}`,`Anti-pattern: ${e.antiPattern}`,`Next action: ${n}`].join(`
|
|
10
|
+
`)}c(ct,"formatSignal");function pe(r){let e=r.replace(/\s+/g," ").trim();if(!e)return null;let t=e.replace(/^\s*(?:nope|no|stop|wait|cancel)[,.!\s:—-]*/i,"").trim(),s=t.match(/\bshould be\b\s+(.+?)$/i);if(s?.[1])return E(`Prefer ${s[1]}`);let n=t.match(/^(.+?)\s+rather than\s+(.+?)$/i);if(n?.[1]&&n[2])return E(`Prefer ${n[1].trim()} rather than ${n[2].trim()}`);let i=t.match(/\b(?:use|prefer|do|run|ship|write|keep)\s+(.+?)\s+instead(?:\s+of\s+(.+))?$/i);if(i?.[1]){let l=i[2]?` instead of ${i[2].trim()}`:" instead";return E(`Use ${i[1].trim()}${l}`)}let o=t.match(/\binstead of\b\s+(.+?)$/i);if(o?.[1])return E(`Avoid ${o[1].trim()}`);let a=t.match(/\b(?:don'?t|do not|never)\s+(.+?)$/i);if(a?.[1])return E(`Never ${a[1].trim()}`);let u=t.match(/\balways\s+(.+?)$/i);if(u?.[1])return E(`Always ${u[1].trim()}`);if(t.length>=12&&t.length<=ue&&/^(?:run|use|do|ship|write|keep|add|fix|remove|prefer|test|check|verify|read|ask|stop|start)\b/i.test(t)){let l=t.charAt(0).toUpperCase()+t.slice(1);return E(l.replace(/[.!?]+$/,""))}return null}c(pe,"extractSpecificConstraint");function E(r){let e=r.replace(/\s+/g," ").trim().replace(/^[-*•]\s+/,"").replace(/[.!?]+$/,"").slice(0,ue);return e.length<12||/^(?:nope|no|stop|wait|cancel)\b/i.test(e)?null:e}c(E,"cleanConstraint");async function ut(r,e,t){if(!e)return;let s=pe(t.excerpt);if(!s)return;let n=`Always: ${s}`,i=`fp:${de(s).slice(0,12)}`;try{if(g.recall(e,{types:["feedback"],tags:{source:ie,key:i},limit:1,dedupeByKey:!1}).length>0)return;await g.remember(r,{type:"feedback",content:n,tags:{source:ie,key:i,category:t.category,from:"recurring-friction"},provenance:"extracted",projectId:e})}catch{}}c(ut,"maybePromoteStandingPreference");function lt(r){return r==="complaint"?{lesson:"Treat explicit failure complaints as evidence that the last result needs diagnosis, not repetition.",why:"The user reported that the delivered behavior or command did not work.",pattern:"User names a broken or non-working result after an assistant action.",antiPattern:"Retrying the same path or moving on without isolating the failure.",nextAction:"Stop, inspect the failing output or assumption, and propose the smallest verifiable fix."}:r==="correction"?{lesson:"Update the working assumption when the user corrects the intended direction.",why:"The assistant was using an assumption that did not match what the user wanted.",pattern:"User redirects the implementation or workflow with a correction.",antiPattern:"Continuing with the original plan after the user clarified a different target.",nextAction:"Restate the corrected target as an actionable rule before continuing."}:{lesson:"Recalibrate before continuing when the user rejects the assistant\u2019s last step.",why:"The assistant likely violated sequencing, scope, or approval expectations.",pattern:"User immediately rejects an assistant action or proposed next step.",antiPattern:"Treating the rejected action as acceptable and continuing without changing course.",nextAction:"Pause, convert the pushback into a workflow constraint, and adjust the next tool use."}}c(lt,"lessonTemplate");function de(r){let e=r.toLowerCase().replace(/\s+/g," ").trim();return Ze.createHash("sha256").update(e).digest("hex")}c(de,"hashSignal");function pt(r){try{let e=fe(r);if(!e)return new Set;let t=g.recall(e,{types:["improvement-signal"],tags:{source:ce},limit:100,dedupeByKey:!1}),s=new Set;for(let n of t){let i=n.tags.key;i&&s.add(i)}return s}catch{return new Set}}c(pt,"projectMemoryHashes");function fe(r){try{let e=M("node:fs"),s=M("node:path").join(r,".prjct","prjct.config.json"),n=e.readFileSync(s,"utf-8");return JSON.parse(n).projectId??null}catch{return null}}c(fe,"projectIdFromPath");var dt=32;function ge(r={}){let t=(r.hookHost===void 0?process.env.PRJCT_HOOK_HOST:r.hookHost)?.trim().toLowerCase().slice(0,dt);return t&&Z.has(t)?t:r.detectedRuntime??ee()}c(ge,"resolveInstructionRuntime");X();var he="lean-detector",ft="lean-debt-growth",gt=3,me=["off","lite","full","ultra"];function mt(r){let e=r?.lean?.mode;if(e&&me.includes(e))return e;let t=process.env.PRJCT_LEAN_MODE?.toLowerCase();return t&&me.includes(t)?t:"off"}c(mt,"effectiveMode");async function ye(r,e){let t={active:!1,total:0,previous:0,persisted:!1},s=e!==void 0?e:await S.readConfig(r).catch(()=>null);if(!s?.projectId||mt(s)==="off")return t;t.active=!0;try{let n=await ht(r);if(t.total=n,n===0)return t;let i=yt(s.projectId);t.previous=i;let o=n-i;i>0&&o>=gt&&(await g.remember(r,{type:"lean-debt",content:`Lean debt growing: \`lean:\` markers rose by ${o} (now ${n}, was ${i}). Deferred simplifications are accumulating \u2014 consider a leaning pass via \`prjct lean debt\`.`,tags:{source:he,pattern:ft,total:String(n),previous:String(i),delta:String(o)},provenance:"inferred",projectId:s.projectId}),t.persisted=!0)}catch{}return t}c(ye,"detectAndPersistLeanDebt");async function ht(r){let e=await A(["grep","-cI","-e","lean:"],{cwd:r,maxBuffer:16777216});if(!e.ok){if(D(e,1))return 0;C(e)}return e.stdout.split(`
|
|
11
|
+
`).reduce((t,s)=>{let n=s.lastIndexOf(":");if(n<=0)return t;let i=Number.parseInt(s.slice(n+1),10);return Number.isFinite(i)?t+i:t},0)}c(ht,"measureLeanMarkers");function yt(r){try{let{prjctDb:e}=(R(),T(I)),t=e.query(r,"SELECT data FROM events WHERE type = 'memory.remember.lean-debt' ORDER BY id DESC LIMIT 50");for(let s of t){let n=(()=>{try{return JSON.parse(s.data)}catch{return null}})();if(!n||typeof n!="object")continue;let i=n.tags;if(!i||i.source!==he)continue;let o=typeof i.total=="string"?Number.parseInt(i.total,10):0;if(Number.isFinite(o))return o}}catch{}return 0}c(yt,"collectPreviousSnapshot");import wt from"node:path";X();var bt="hot-file",we="pattern-detector-auto",kt="recurring-bug",be="pattern-detector-recurring",Rt="tech-debt-growth",ke="pattern-detector-debt",O=7,St=3,N=30,vt=2,Tt=5,Et=[/^package(-lock)?\.json$/,/^bun\.lock(b)?$/,/^pnpm-lock\.yaml$/,/^yarn\.lock$/,/^CHANGELOG\.md$/,/^\.gitignore$/,/\.snap$/,/^dist\//,/^node_modules\//];async function Re(r,e){let t={scanned:0,hotFiles:[],persisted:0,skipped:[],errors:[]},s=e!==void 0?e:await S.readConfig(r).catch(()=>null);if(!s?.projectId)return t.errors.push("no project config"),t;try{let n=await _t(r);if(t.scanned+=n.length,t.hotFiles=n,n.length>0){let i=Mt(s.projectId);for(let o of n){if(i.has(o.path)){t.skipped.push({reason:"already-marked-this-window",file:o.path});continue}try{await g.remember(r,{type:"learning",content:`Hot file: \`${o.path}\` \u2014 ${o.touches} touches in the last ${O} days. Worth a refactor pass or a deliberate decision about why it churns this often.`,tags:{source:we,pattern:bt,file:o.path,touches:String(o.touches),window_days:String(O)},provenance:"inferred"}),t.persisted+=1}catch(a){t.errors.push(`remember failed for ${o.path}: ${a.message}`)}}}}catch(n){t.errors.push(`hot-file detection failed: ${n.message}`)}try{let n=At(s.projectId);if(n.length>0){let i=Dt(s.projectId);for(let o of n){if(i.has(o.topic)){t.skipped.push({reason:"recurring-bug-already-marked",file:o.topic});continue}try{await g.remember(r,{type:"learning",content:`Recurring bug pattern: gotchas tagged \`topic:${o.topic}\` reported ${o.occurrences} times in the last ${N} days. Likely a real underlying issue \u2014 consider a focused investigation before patching the next instance.`,tags:{source:be,pattern:kt,topic:o.topic,occurrences:String(o.occurrences),window_days:String(N)},provenance:"inferred"}),t.persisted+=1}catch(a){t.errors.push(`remember failed for recurring ${o.topic}: ${a.message}`)}}}}catch(n){t.errors.push(`recurring-bug detection failed: ${n.message}`)}try{let n=await Ct(r);if(n.totalCount>0){let i=xt(s.projectId),o=n.totalCount-i;if(i>0&&o>=Tt)try{await g.remember(r,{type:"learning",content:`Tech debt growing: TODO/FIXME/XXX count rose by ${o} (now ${n.totalCount}, was ${i}). Consider a focused debt-reduction pass before adding more features.`,tags:{source:ke,pattern:Rt,total:String(n.totalCount),previous:String(i),delta:String(o)},provenance:"inferred"}),t.persisted+=1}catch(a){t.errors.push(`remember failed for tech-debt: ${a.message}`)}}}catch(n){t.errors.push(`tech-debt detection failed: ${n.message}`)}return t}c(Re,"detectAndPersistPatterns");async function _t(r){let e=await A(["log",`--since=${O}.days.ago`,"--name-only","--pretty=format:","-z"],{cwd:r,maxBuffer:16777216,timeoutMs:15e3});if(!e.ok){if(e.kind==="exit")return[];C(e)}let t=new Map;for(let n of e.stdout.split("\0")){let i=n.trim();i&&(It(i)||t.set(i,(t.get(i)??0)+1))}let s=[];for(let[n,i]of t)i<St||s.push({path:n,touches:i});return s.sort((n,i)=>i.touches-n.touches),s}c(_t,"detectHotFiles");function It(r){let e=wt.basename(r);for(let t of Et)if(t.test(r)||t.test(e))return!0;return!1}c(It,"isIgnored");function At(r){try{let{prjctDb:e}=(R(),T(I)),t=new Date(Date.now()-N*24*60*60*1e3).toISOString(),s=e.query(r,"SELECT data, timestamp FROM events WHERE type = 'memory.remember.gotcha' AND timestamp >= ? ORDER BY id DESC LIMIT 500",t),n=new Map;for(let o of s){let a=(()=>{try{return JSON.parse(o.data)}catch{return null}})();if(!a||typeof a!="object")continue;let u=a.tags;if(!u||u.source==="transcript-auto")continue;let l=typeof u.topic=="string"?u.topic:void 0,p=typeof u.area=="string"?u.area:void 0,m=l??p;m&&n.set(m,(n.get(m)??0)+1)}let i=[];for(let[o,a]of n)a<vt||i.push({topic:o,occurrences:a});return i.sort((o,a)=>a.occurrences-o.occurrences),i}catch{return[]}}c(At,"detectRecurringBugs");async function Ct(r){let e=await A(["grep","-cE","\\b(TODO|FIXME|XXX)\\b"],{cwd:r,maxBuffer:16777216});if(!e.ok){if(D(e,1))return{totalCount:0};C(e)}return{totalCount:e.stdout.split(`
|
|
12
|
+
`).reduce((s,n)=>{let i=n.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(n.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}c(Ct,"measureTechDebt");function xt(r){try{let{prjctDb:e}=(R(),T(I)),t=e.query(r,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50");for(let s of t){let n=(()=>{try{return JSON.parse(s.data)}catch{return null}})();if(!n||typeof n!="object")continue;let i=n.tags;if(!i||i.source!==ke)continue;let o=typeof i.total=="string"?Number.parseInt(i.total,10):0;if(Number.isFinite(o))return o}}catch{}return 0}c(xt,"collectPreviousDebtSnapshot");function Mt(r){let e=new Set;try{let{prjctDb:t}=(R(),T(I)),s=t.query(r,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200"),n=Date.now()-O*24*60*60*1e3;for(let i of s){let o=(()=>{try{return JSON.parse(i.data)}catch{return null}})();if(!o||typeof o!="object")continue;let a=o.tags;if(!a||a.source!==we)continue;let u=a.file,l=o.rememberedAt;if(typeof u=="string"){if(typeof l=="string"){let p=Date.parse(l);if(!Number.isNaN(p)&&p<n)continue}e.add(u)}}}catch{}return e}c(Mt,"collectAlreadyMarkedHotFiles");function Dt(r){let e=new Set;try{let{prjctDb:t}=(R(),T(I)),s=t.query(r,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200"),n=Date.now()-N*24*60*60*1e3;for(let i of s){let o=(()=>{try{return JSON.parse(i.data)}catch{return null}})();if(!o||typeof o!="object")continue;let a=o.tags;if(!a||a.source!==be)continue;let u=a.topic,l=o.rememberedAt;if(typeof u=="string"){if(typeof l=="string"){let p=Date.parse(l);if(!Number.isNaN(p)&&p<n)continue}e.add(u)}}}catch{}return e}c(Dt,"collectAlreadyMarkedRecurringBugs");Ke();Ye();import x from"node:fs/promises";import Se from"node:path";R();var Lt={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Pt(r=process.env){let e=(r.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Lt[e==="conservative"||e==="standard"||e==="aggressive"?e:"standard"]}c(Pt,"resolveProfile");async function Ot(r,e){let t=Date.now()-e*24*60*60*1e3,n=g.recall(r,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<t);if(n.length===0)return 0;let i=[];for(let o of n)try{U.archive(r,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${e}d)`});let a=o.id.startsWith("mem_")?o.id.slice(4):null;a&&b.run(r,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(a)),b.run(r,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}c(Ot,"archiveAgedInbox");async function Nt(r,e){if(e===null)return 0;let t=Se.join(z.getGlobalProjectPath(r),"checkpoints"),s=await x.readdir(t).catch(()=>null);if(!s)return 0;let n=Date.now()-e*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let a=Se.join(t,o);try{(await x.stat(a)).mtimeMs<n&&(await x.unlink(a),i.push(a))}catch{}}return i.length}c(Nt,"pruneOldCheckpoints");async function $t(){let{getVerifyCachePath:r}=await import("./context7-service-4C6VNJUS.mjs"),e=r();try{let t=await x.stat(e);if((Date.now()-t.mtimeMs)/(1440*60*1e3)>7)return await x.unlink(e),!0}catch{}return!1}c($t,"rotateContext7Cache");async function ve(r){let e=Pt(),t={inboxArchived:0,archivesPruned:0,checkpointsRemoved:0,context7CacheRotated:!1};try{t.inboxArchived=await Ot(r,e.inboxDays)}catch{}try{t.archivesPruned=U.pruneOldArchives(r,e.archivesDays)}catch{}try{t.checkpointsRemoved=await Nt(r,e.checkpointsDays)}catch{}try{t.context7CacheRotated=await $t()}catch{}return t}c(ve,"runSessionCleanup");async function Te(r,e){if(e.inboxArchived+e.archivesPruned+e.checkpointsRemoved+(e.context7CacheRotated?1:0)===0)return;let n=`Session cleanup: ${[e.inboxArchived>0?`${e.inboxArchived} inbox archived`:null,e.archivesPruned>0?`${e.archivesPruned} archives pruned`:null,e.checkpointsRemoved>0?`${e.checkpointsRemoved} checkpoints removed`:null,e.context7CacheRotated?"context7 cache rotated":null].filter(i=>!!i).join(", ")}`;b.appendEvent(r,"memory.remember.system-event",{content:n,tags:{source:"session-cleanup",key:"last-cleanup"},provenance:"extracted",content_hash:K(n),project_id:r})}c(Te,"recordCleanupReport");import jt from"node:crypto";import Ht from"node:fs/promises";import{z as w}from"zod";ze();R();var _e="crew-run:",Ee=w.object({id:w.string().min(1),spec_id:w.string().nullable().default(null),task_id:w.string().nullable().default(null),started_at:w.string().min(1),ended_at:w.string().min(1),implementer_summary:w.string().default(""),files_touched:w.array(w.string()).default([]),reviewer_verdict:w.enum(["APPROVED","CHANGES_REQUESTED"]),reviewer_notes:w.string().nullable().default(null)});function $(r){return`${_e}${r}`}c($,"keyFor");var J=class{static{c(this,"CrewRunStorage")}record(e,t){let s=t.runId??Y(),n=b.getDoc(e,$(s));if(n)return n;let i=q(),o=Ee.parse({id:s,spec_id:t.specId??null,task_id:t.taskId??null,started_at:t.startedAt??i,ended_at:t.endedAt??i,implementer_summary:t.implementerSummary,files_touched:t.filesTouched,reviewer_verdict:t.reviewerVerdict,reviewer_notes:t.reviewerNotes??null});return b.setDoc(e,$(s),o),o}get(e,t){return b.getDoc(e,$(t))}list(e){return b.listDocsByPrefix(e,_e).map(s=>Ee.parse(s.data))}delete(e,t){b.deleteDoc(e,$(t))}},Ie=new J;var Me="skill-miss-detector",Ae=3,Ft=280,Ut=["decision","gotcha","anti-pattern"],Bt=5400*1e3,Gt=360*60*1e3,Jt=2,De=5,Wt=8,Le=new Set(["should","because","project","prjct","instead","always","never","using","value","state","change","changes","update","updated","function","return","returns","error","errors","tests","testing","config","default","import","export","before","after","without"]);async function Pe(r,e,t,s={}){let n=s.preloadedLines?s.preloadedLines:await Ht.readFile(e,"utf-8").then(qt).catch(()=>null);if(!n)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=tr(r);if(!i)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=zt(n);if(!o)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let a=(()=>{try{return Zt(i,t)}catch{return null}})();if(!a)return{signalsRecorded:0,signalsSkipped:0,failures:[]};if(a.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let u=await Q(r).catch(()=>[]),l=(()=>{try{let h=Date.now()-Gt;return new Set(Ie.list(i).filter(f=>Date.parse(f.ended_at)>h).flatMap(f=>f.files_touched))}catch{return new Set}})(),p=Xt(o,u,a,l);if(p.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let m=er(i),d=[];for(let h of p.slice(0,Ae)){let f=Qt(h.memId,h.excerpt).slice(0,12);if(m.has(f)){d.push("skipped");continue}try{await g.remember(r,{type:"improvement-signal",content:Vt(h),tags:{source:Me,kind:"skill-miss",category:"skill-miss",...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},relates:h.memId,file:h.evidenceFile,key:f,...t?{session:t}:{}},provenance:"extracted",projectId:i}),L.penalizeSkillMiss(i,h.memId),d.push("recorded")}catch{d.push("skipped")}}let y=d.filter(h=>h==="recorded").length,W=d.filter(h=>h==="skipped").length;return{signalsRecorded:y,signalsSkipped:W,failures:p.slice(0,Ae).map(h=>({category:"skill-miss",expectedBehavior:`Apply relevant project rule ${h.memId}.`,observedBehavior:"Relevant project knowledge was not referenced in the session.",relatedRuleId:h.memId}))}}c(Pe,"detectSkillMisses");function Xt(r,e,t,s=new Set){let n=Ce(r);if(n.size===0)return[];let i=e.filter(u=>!s.has(u)),o=j(i),a=[];for(let u of t){let l=Ce(`${u.content} ${u.fileTag}`);if(l.size===0)continue;let p=u.fileTag!==""&&i.some(f=>xe(f,u.fileTag))||[...o].some(f=>l.has(f)),m=Yt(l),d=[...l].filter(f=>!m.has(f)&&n.has(f)).length;if(!(p||d>=Jt)||[...m].some(f=>n.has(f)))continue;let h=u.fileTag!==""&&i.some(f=>xe(f,u.fileTag))?u.fileTag:i.find(f=>[...j([f])].some(qe=>l.has(qe)))??"";a.push({miss:{memId:u.id,memType:u.type,excerpt:u.content.replace(/\s+/g," ").trim().slice(0,Ft),evidenceFile:h,reason:p?"path-overlap-unused":"topic-overlap-unused"},rank:p?2:1,overlap:d})}return a.sort((u,l)=>l.rank-u.rank||l.overlap-u.overlap),a.map(u=>u.miss)}c(Xt,"analyze");function qt(r){return v(r)}c(qt,"parseJsonl");function zt(r){let e=[];for(let t of r){let s=t.role??t.message?.role;if(s!=="user"&&s!=="assistant")continue;let n=Kt(t.content??t.message?.content);n&&e.push(n)}return e.join(`
|
|
13
|
+
`).toLowerCase()}c(zt,"transcriptTextOf");function Kt(r){return typeof r=="string"?r:Array.isArray(r)?r.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return typeof t=="string"?t:""}return""}).join(`
|
|
14
|
+
`).trim():""}c(Kt,"textOf");function Ce(r){let e=new Set;for(let t of r.toLowerCase().split(/[^a-z0-9]+/))t.length<De||Le.has(t)||e.add(t);return e}c(Ce,"tokenize");function Yt(r){let e=[...r].filter(s=>s.length>=Wt);if(e.length>0)return new Set(e);let t=[...r].sort((s,n)=>n.length-s.length||s.localeCompare(n))[0]??"";return t?new Set([t]):new Set}c(Yt,"signatureOf");function j(r){let e=new Set;for(let t of r)for(let s of t.split("/")){let n=s.replace(/\.[a-z0-9]+$/i,"").toLowerCase();n.length>=De&&!Le.has(n)&&e.add(n)}return e}c(j,"fileStems");function xe(r,e){let t=j([r]);for(let s of j([e]))if(t.has(s))return!0;return!1}c(xe,"sharesStem");function Vt(r){let e=r.evidenceFile!==""?`touched \`${r.evidenceFile}\``:"worked the same area";return[`[skill-miss] Unused project knowledge (${r.memType}, ${r.memId}): "${r.excerpt}"`,`This session ${e} but never referenced it. Apply it, or supersede it via: prjct remember decision "<resolution>" --tags resolves:skill-miss,relates:${r.memId}`].join(`
|
|
15
|
+
`)}c(Vt,"formatSkillMiss");function Qt(r,e){let t=`${r}::${e.toLowerCase().replace(/\s+/g," ").trim()}`;return jt.createHash("sha256").update(t).digest("hex")}c(Qt,"hashKey");function Zt(r,e){let t=g.recall(r,{types:[...Ut],limit:120}),s=Date.now()-Bt,n=[];for(let i of t)i.provenance!=="inferred"&&(Date.parse(i.rememberedAt)>s||e&&i.tags.session===e||n.push({id:i.id,type:i.type,content:i.content,fileTag:i.tags.file??"",rememberedAt:i.rememberedAt,provenance:i.provenance,session:i.tags.session??""}));return n}c(Zt,"recallCandidates");function er(r){try{let e=g.recall(r,{types:["improvement-signal"],tags:{source:Me},limit:100,dedupeByKey:!1}),t=new Set;for(let s of e)s.tags.key&&t.add(s.tags.key);return t}catch{return new Set}}c(er,"existingSkillMissKeys");function tr(r){try{let e=M("node:fs"),s=M("node:path").join(r,".prjct","prjct.config.json");return JSON.parse(e.readFileSync(s,"utf-8")).projectId??null}catch{return null}}c(tr,"projectIdFromPath");import rr from"node:crypto";import nr from"node:fs/promises";var $e="transcript-auto",sr="v2",je=80,He=20,H=1500,ir=12,Oe=4,or=[{phrase:"decided to",type:"decision"},{phrase:"we chose",type:"decision"},{phrase:"going with",type:"decision"},{phrase:"the right call",type:"decision"},{phrase:"best approach is",type:"decision"},{phrase:"we will use",type:"decision"},{phrase:"shipping with",type:"decision"},{phrase:"turns out that",type:"learning"},{phrase:"now i understand",type:"learning"},{phrase:"the key insight",type:"learning"},{phrase:"i learned that",type:"learning"},{phrase:"discovered that",type:"learning"},{phrase:"root cause is",type:"learning"},{phrase:"root cause was",type:"learning"},{phrase:"the fix is",type:"learning"},{phrase:"gotcha:",type:"gotcha"},{phrase:"bug:",type:"gotcha"},{phrase:"fails when",type:"gotcha"},{phrase:"breaks when",type:"gotcha"},{phrase:"be careful",type:"gotcha"},{phrase:"never do this",type:"gotcha"},{phrase:"trap:",type:"gotcha"},{phrase:"important:",type:"fact"},{phrase:"always use",type:"fact"},{phrase:"never write",type:"fact"},{phrase:"the pattern is",type:"pattern"},{phrase:"anti-pattern:",type:"anti-pattern"},{phrase:"antipattern:",type:"anti-pattern"}],Fe=[{re:/^(?:[-*•]\s+)?(?:\*\*)?decision(?:\*\*)?\s*[:—-]\s+/i,type:"decision",phrase:"label:decision"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(learning|insight)(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:learning"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(gotcha|trap|warning)(?:\*\*)?\s*[:—-]\s+/i,type:"gotcha",phrase:"label:gotcha"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(fact|note)(?:\*\*)?\s*[:—-]\s+/i,type:"fact",phrase:"label:fact"},{re:/^(?:[-*•]\s+)?(?:\*\*)?root\s*cause(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:root-cause"},{re:/^(?:[-*•]\s+)?(?:\*\*)?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"pattern",phrase:"label:pattern"},{re:/^(?:[-*•]\s+)?(?:\*\*)?anti[- ]?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"anti-pattern",phrase:"label:anti-pattern"}];async function Ue(r,e,t,s={}){let n={scanned:0,ingested:0,skipped:[],errors:[]},i=s.preloadedConfig!==void 0?s.preloadedConfig:await S.readConfig(r).catch(()=>null);if(!i?.projectId)return n.errors.push("no project config"),n;let o=await(async()=>{if(s.preloadedLines)return s.preloadedLines;try{return v(await nr.readFile(e,"utf-8"))}catch(d){return n.errors.push(`transcript read failed: ${d.message}`),null}})();if(o===null)return n;let a=ar(o),u=cr(o);if(n.scanned=a.length+u.length,a.length===0&&u.length===0)return n;let l=[...dr(a),...lr(u)];if(l.length===0)return n;let p=gr(i.projectId),m=t?t.slice(0,12):"unknown";for(let d of l){if(p.has(d.hash)){n.skipped.push({reason:"duplicate",phrase:d.matchedPhrase});continue}try{await g.remember(r,{type:d.type,content:d.content,tags:{source:$e,capture:sr,session:m,hash:d.hash,phrase:d.matchedPhrase},provenance:"inferred",projectId:i.projectId}),n.ingested+=1}catch(y){n.errors.push(`remember failed: ${y.message}`)}}return n}c(Ue,"ingestTranscript");function ar(r){let e=[];for(let t of r){let s=Be(t);if(s!=="assistant")continue;let n=Ge(t);!n||n.length<je||e.push({role:s,text:n})}return e}c(ar,"projectMessages");function cr(r){let e=[];for(let t of r){let s=Be(t);if(s!=="user")continue;let n=Ge(t);!n||n.length<He||e.push({role:s,text:n})}return e}c(cr,"projectUserMessages");var ur=[{re:/^(?:please\s+)?always\b/i,phrase:"user:always"},{re:/^(?:please\s+)?never\b/i,phrase:"user:never"},{re:/\bi (?:always|never|prefer)\b/i,phrase:"user:i-prefer"},{re:/^(?:rule|preference)\s*[:—-]/i,phrase:"user:rule"},{re:/\bno more\s+(?:features?|feature\s+creep)\b/i,phrase:"user:no-more-features"},{re:/\bdon'?t add (?:more )?(?:features?|surface)\b/i,phrase:"user:dont-add-features"}];function lr(r){let e=[],t=new Set;for(let s of r){if(e.length>=Oe)break;let n=s.text.split(/\n/).map(o=>o.replace(/^[-*•]\s+/,"").trim()).filter(o=>o.length>=He),i=n.length>0?n:[s.text.trim()];for(let o of i){if(e.length>=Oe)break;let a=ur.find(p=>p.re.test(o));if(!a)continue;let u=o.length>H?`${o.slice(0,H)}\u2026`:o,l=Je(u);t.has(l)||(t.add(l),e.push({type:"feedback",content:u,hash:l,matchedPhrase:a.phrase}))}}return e}c(lr,"extractUserPreferenceCandidates");function Be(r){let e=r.role;if(typeof e=="string")return Ne(e);let t=r.message;if(t&&typeof t=="object"&&"role"in t){let n=t.role;if(typeof n=="string")return Ne(n)}let s=r.type;return s==="assistant"||s==="user"||s==="system"?s:null}c(Be,"inferRole");function Ne(r){let e=r.toLowerCase();return e==="assistant"||e==="user"||e==="system"?e:null}c(Ne,"normalizeRole");function Ge(r){let e=r.content===void 0&&r.message&&typeof r.message=="object"?r.message.content:r.content;if(typeof e=="string")return e.trim();if(Array.isArray(e)){let t=[];for(let s of e){if(!s||typeof s!="object")continue;let n=s;n.type==="text"&&typeof n.text=="string"&&t.push(n.text)}return t.join(`
|
|
16
|
+
`).trim()}return""}c(Ge,"extractText");function pr(r){let e=r.trim();if(e.length<je)return null;for(let n of Fe)if(n.re.test(e))return{type:n.type,matchedPhrase:n.phrase};let t=e.toLowerCase(),s=or.find(n=>t.includes(n.phrase));return s?{type:s.type,matchedPhrase:s.phrase}:null}c(pr,"classifyCaptureParagraph");function dr(r){let e=[],t=new Set;for(let s of r){let n=fr(s.text);for(let i of n){if(e.length>=ir)return e;let o=pr(i);if(!o)continue;let a=i.length>H?`${i.slice(0,H)}\u2026`:i,u=Je(a);t.has(u)||(t.add(u),e.push({type:o.type,content:a,hash:u,matchedPhrase:o.matchedPhrase}))}}return e}c(dr,"extractCandidates");function fr(r){let e=r.split(/\n\s*\n/).map(s=>s.trim()).filter(Boolean),t=[];for(let s of e){let n=s.split(`
|
|
17
|
+
`).map(o=>o.trim()).filter(Boolean);if(n.some(o=>Fe.some(a=>a.re.test(o)))&&n.length>1)for(let o of n)t.push(o);else t.push(s)}return t}c(fr,"splitParagraphs");function Je(r){return rr.createHash("sha256").update(r.toLowerCase().trim()).digest("hex").slice(0,16)}c(Je,"hashContent");function gr(r){let e=new Set;try{let{prjctDb:t}=(R(),T(I)),{REMEMBER_EVENT_RANGE:s}=(Qe(),T(Ve)),n=t.query(r,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",...s);for(let i of n){let o=(()=>{try{return JSON.parse(i.data)}catch{return null}})();if(!o||typeof o!="object")continue;let a=o.tags;if(!a||a.source!==$e)continue;let u=a.hash;typeof u=="string"&&e.add(u)}}catch{}return e}c(gr,"collectExistingAutoHashes");var F=600*1e3,_=new Map;function mr(r){let e=r.replace(/[^a-zA-Z0-9._-]/g,"_");return We.join(te.runDir(),`stop-heavy-${e}.stamp`)}c(mr,"heavyStepStampPath");async function Xe(r,e,t=!0){if(await k.stat(r).then(i=>e-i.mtimeMs<F).catch(()=>!1))return!1;let n=`${r}.lock`;try{await k.mkdir(n)}catch(i){if(i.code!=="EEXIST")throw i;return!await k.stat(n).then(a=>e-a.mtimeMs>=F).catch(()=>!1)||!t?!1:(await k.rmdir(n).catch(()=>{}),Xe(r,e,!1))}try{return await k.stat(r).then(o=>e-o.mtimeMs<F).catch(()=>!1)?!1:(await k.writeFile(r,String(e)),!0)}finally{await k.rmdir(n).catch(()=>{})}}c(Xe,"claimHeavyStep");async function hr(r){let e=Date.now(),t=_.get(r)??0;if(e-t<F)return!1;try{let s=mr(r);await k.mkdir(We.dirname(s),{recursive:!0});let n=await Xe(s,e);return _.size>32&&_.clear(),_.set(r,e),n}catch{}return _.size>32&&_.clear(),_.set(r,e),!0}c(hr,"heavyStepsDue");function Ln(r=process.cwd(),e){return ne({event:"Stop",projectPath:r,afterEmit:c(async(t,s)=>{let n=await S.readConfig(s).catch(()=>null);if(!n?.projectId)return;let i=ge(),o=await hr(n.projectId),a={};if(o&&t.transcript_path){let l=await k.readFile(t.transcript_path,"utf-8").catch(()=>null);l!==null&&(a.transcriptLines=v(l))}let u=se(a.transcriptLines??[]);if(o)try{let{collectActiveTasks:l}=await import("./task-overview-6ZQKJGSH.mjs"),p=await l(n.projectId,s);a.activeTaskId=p.current?.id,a.activeTaskDescription=p.current?.description,a.activeTaskStartedAt=p.current?.startedAt}catch{}if(a.transcriptLines&&a.transcriptLines.length>0)try{if(a.transcriptUsage=G(a.transcriptLines),a.transcriptUsage.tokensIn+a.transcriptUsage.tokensOut>0){let l=a.activeTaskStartedAt?{sinceIso:a.activeTaskStartedAt}:void 0,p=G(a.transcriptLines,l);if(a.activeTaskId&&p.tokensIn+p.tokensOut>0){B(n.projectId,a.activeTaskId,p.tokensIn,p.tokensOut,{description:a.activeTaskDescription,agent:i,source:`${i}-transcript`});try{let{sumTranscriptUsageByModel:m}=await import("./transcript-jsonl-6X4DDD6R.mjs");for(let[d,y]of m(a.transcriptLines,l))y.tokensIn+y.tokensOut<=0||B(n.projectId,a.activeTaskId,y.tokensIn,y.tokensOut,{model:d,agent:i,source:`${i}-transcript:${d}`})}catch{}}}}catch{}if(re({projectId:n.projectId,sessionId:t.session_id,directory:s,taskId:a.activeTaskId,goal:a.activeTaskDescription,tokensIn:a.transcriptUsage?.tokensIn,tokensOut:a.transcriptUsage?.tokensOut,agent:i,model:u}),o&&t.transcript_path)try{await Ue(s,t.transcript_path,t.session_id??null,{preloadedConfig:n,preloadedLines:a.transcriptLines})}catch{}if(o){try{await Re(s,n)}catch{}try{await ye(s,n)}catch{}try{let l=await ve(n.projectId);await Te(n.projectId,l),P.pruneRetained(n.projectId)}catch{}}if(o&&t.transcript_path)try{let l=await le(s,t.transcript_path,t.session_id??null,{preloadedLines:a.transcriptLines,runtime:i,model:u});for(let p of l.failures)try{P.record(n.projectId,{source:"friction-detector",runtime:i,model:u,sessionId:t.session_id??null,taskId:a.activeTaskId??null,...p})}catch{}l.signalsRecorded>0&&a.activeTaskId&&L.penalizeSurfaced(n.projectId,a.activeTaskId)}catch{}if(o&&t.transcript_path)try{let l=await Pe(s,t.transcript_path,t.session_id??null,{preloadedLines:a.transcriptLines,runtime:i,model:u});for(let p of l.failures)try{P.record(n.projectId,{source:"skill-miss-detector",runtime:i,model:u,sessionId:t.session_id??null,taskId:a.activeTaskId??null,...p})}catch{}}catch{}if(o)try{await V.backfill(n.projectId,n,new Date().toISOString())}catch{}if(o&&a.activeTaskId){try{let{synthesizeLandHandoff:l}=await import("./land-synthesis-ANVOY7AM.mjs");await l({projectId:n.projectId,projectPath:s,cycleDescription:a.activeTaskDescription??null,cycleId:a.activeTaskId,tokensIn:a.transcriptUsage?.tokensIn,tokensOut:a.transcriptUsage?.tokensOut,model:u})}catch{}try{let{synthesizeJudgmentReceipt:l}=await import("./judgment-receipt-NXL5Q4CE.mjs");await l({projectId:n.projectId,projectPath:s,cycleDescription:a.activeTaskDescription??null,cycleId:a.activeTaskId,tokensIn:a.transcriptUsage?.tokensIn,tokensOut:a.transcriptUsage?.tokensOut,model:u})}catch{}}try{let{flushIfLinked:l}=await import("./auto-flush-D3X3U4CP.mjs");await l(s,n)}catch{}},"afterEmit")},e)}c(Ln,"runStopHook");export{mr as heavyStepStampPath,hr as heavyStepsDue,Ln as runStopHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a}from"./chunk-RNCLLUMK.mjs";import"./chunk-45I2C2UB.mjs";import{c as i}from"./chunk-L4COZ7ZH.mjs";import"./chunk-4KY2EHXS.mjs";import"./chunk-GJFWVCTS.mjs";import"./chunk-7OZDWT6C.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-54LH63LM.mjs";import"./chunk-ZZ65CN5F.mjs";import"./chunk-JQLJM4BK.mjs";import"./chunk-OVR6RUUZ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-DAOC3T5G.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-OFVLGJ76.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import{b as n}from"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import{d as e,g as m}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";m();function l(c=process.cwd(),p){return i({event:"SubagentStart",projectPath:c,build:o((u,t)=>a(t),"build"),afterEmit:o(async(u,t)=>{try{let r=await n.readConfig(t);if(!r?.projectId)return;let{collectActiveTasks:s}=await import("./task-overview-6ZQKJGSH.mjs"),d=await s(r.projectId,t);e.appendEvent(r.projectId,"subagent.spawned",{taskId:d.current?.id??null})}catch{}},"afterEmit")},p)}o(l,"runSubagentStartHook");export{l as runSubagentStartHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as f,b as p}from"./chunk-X5RDLFPM.mjs";import{c as s}from"./chunk-L4COZ7ZH.mjs";import{a}from"./chunk-ZX2KFQV5.mjs";import{b as c}from"./chunk-NWY5M34K.mjs";import"./chunk-CREPUNOS.mjs";import"./chunk-QDQ7DTDV.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b as r}from"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";function w(u=process.cwd(),g){return s({event:"SubagentStop",projectPath:u,afterEmit:i(async(d,n)=>{let o=await r.readConfig(n).catch(()=>null);if(!o?.projectId||f(o)==="off")return;let e=[];try{let t=await a(o.projectId,n);t.current&&e.push(`active: ${t.current.description}`)}catch{}try{let t=await c.getActiveTasks(o.projectId);t.length>0&&e.push(`pending: ${t.length}`)}catch{}await p("prjct \u2014 subagent finished",e.join(" \xB7 ")||"A subagent finished")},"afterEmit")},g)}i(w,"runSubagentStopHook");export{w as runSubagentStopHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a}from"./chunk-XGYCAVB2.mjs";import"./chunk-ZZ65CN5F.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as recordSurfacedForActiveTask};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NJAMZSHM.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as extractFile,l as fileFanIn,m as fileFanInByFile,n as filesCallingInto,e as hasSymbolIndex,c as indexSymbols,g as listAllSymbols,f as loadMeta,i as scoreFilesFromQuery,h as searchSymbols,a as stripNoise,j as symbolsInFile,k as tracePath,d as updateSymbols};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c,d}from"./chunk-ZTZTVBAZ.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as analyzeGit,c as detectCommands,d as detectStack,b as gatherStats};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{c as a,d as b}from"./chunk-3JUE6MNF.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-YUOTOCKK.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as default,a as syncClient};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{e as s,g as a}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{b as i,e as o}from"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";o();a();var d=class{static{l(this,"SyncCursorStorage")}get(t,r=null,e=null){if(!e)return null;let n=s.get(t,`SELECT * FROM sync_cursors
|
|
9
|
+
WHERE project_id = ?
|
|
10
|
+
AND device_id = ?
|
|
11
|
+
AND ${r===null?"user_id IS NULL":"user_id = ?"}`,...r===null?[t,e]:[t,e,r]);return n?this.rowToCursor(n):null}touch(t,r=null,e=null){if(!e)return;let n=i();this.upsert({userId:r,deviceId:e,projectId:t,lastEventId:this.getLastEventId(t,r,e),updatedAt:n})}advance(t,r,e={}){let n=e.userId??null,u=e.deviceId??null;if(!u)return;let _=this.getLastEventId(t,n,u);r<=_||this.upsert({userId:n,deviceId:u,projectId:t,lastEventId:r,updatedAt:i()})}getLastEventId(t,r,e){return s.get(t,`SELECT last_event_id FROM sync_cursors
|
|
12
|
+
WHERE project_id = ?
|
|
13
|
+
AND device_id = ?
|
|
14
|
+
AND ${r===null?"user_id IS NULL":"user_id = ?"}`,...r===null?[t,e]:[t,e,r])?.last_event_id??0}backfillUser(t,r,e){s.run(t,`UPDATE sync_cursors
|
|
15
|
+
SET user_id = ?, updated_at = ?
|
|
16
|
+
WHERE project_id = ? AND device_id = ? AND user_id IS NULL`,e,i(),t,r)}upsert(t){s.run(t.projectId,`INSERT INTO sync_cursors (user_id, device_id, project_id, last_event_id, updated_at)
|
|
17
|
+
VALUES (?, ?, ?, ?, ?)
|
|
18
|
+
ON CONFLICT(user_id, device_id, project_id)
|
|
19
|
+
DO UPDATE SET last_event_id = excluded.last_event_id, updated_at = excluded.updated_at`,t.userId,t.deviceId,t.projectId,t.lastEventId,t.updatedAt)}rowToCursor(t){return{userId:t.user_id,deviceId:t.device_id,projectId:t.project_id,lastEventId:t.last_event_id,updatedAt:t.updated_at}}},p=new d;export{p as syncCursorStorage};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c}from"./chunk-D7TRY3CO.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-LLQUB6YR.mjs";import"./chunk-NLG2EW6M.mjs";import"./chunk-6IKHMK2U.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-75UJIVMO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as orchestrationFor,a as pointsFromDiffLines,b as renderDelegationTrigger};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c}from"./chunk-ZX2KFQV5.mjs";import"./chunk-CREPUNOS.mjs";import"./chunk-QDQ7DTDV.mjs";import"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as collectActiveTasks,b as formatActiveTaskLine,c as formatActiveTaskList};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-H6KVNDQD.mjs";import"./chunk-NN65WGGN.mjs";import"./chunk-Q5I2UPD6.mjs";import"./chunk-PSSR7LSW.mjs";import"./chunk-YGHIPTJN.mjs";import"./chunk-CREPUNOS.mjs";import"./chunk-D7TRY3CO.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-ODWWIFSN.mjs";import"./chunk-P43HDWI5.mjs";import"./chunk-LLQUB6YR.mjs";import"./chunk-NLG2EW6M.mjs";import"./chunk-6IKHMK2U.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-75UJIVMO.mjs";import"./chunk-QDQ7DTDV.mjs";import"./chunk-2OU2MKNS.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-6EWGHM32.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-4DDCWMI6.mjs";import"./chunk-JQLJM4BK.mjs";import"./chunk-OVR6RUUZ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-DAOC3T5G.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-OFVLGJ76.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{e as TASK_CONTEXT_PROMPT,h as completeActiveTask,a as formatRelatedContextForAgent,b as formatRiskForAgent,i as readLastStatus,d as recallRisksForFiles,g as resolveActiveTask,f as setTaskStatus,c as startTask};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as c}from"./chunk-5T5PZKHW.mjs";import{a as D,b as l,d as T}from"./chunk-R77TXXPP.mjs";import{a as u}from"./chunk-PSSR7LSW.mjs";import{a as d}from"./chunk-YGHIPTJN.mjs";import"./chunk-OFVLGJ76.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b as a}from"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import{a as h,o as y}from"./chunk-CTWZQ7YI.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import{e as f,f as w}from"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";w();y();var i=["off","assist","strict"],C=class extends T{static{m(this,"TddCommands")}async tdd(s=null,e=process.cwd(),r={}){let t=((s??"").trim().split(/\s+/).filter(Boolean)[0]??"").toLowerCase();return!t||t==="status"||t==="show"?this.showStatus(e,r):i.includes(t)?this.setMode(t,e,r):t==="check"?this.check(e,r):D(`Unknown tdd subcommand "${t}". Use: check, or ${i.join("|")}.`,r)}async showStatus(s,e){let r=await a.readConfig(s).catch(()=>null);if(!r?.projectId)return l("No prjct project here \u2014 run `prjct init` first.",e);let o=M(r),n=(await u(s).catch(()=>null))?.test?.command??null,g=[`Mode: ${o}${o==="off"?" (guidance + ship TDD gate dormant)":""}`,`Test command: ${n??"none detected (add tests to enable the gate)"}`,"Set: prjct tdd off|assist|strict","Check: prjct tdd check \u2014 run the test command now (red/green)"];return e.md?console.log(c("## TDD",`> **Mode**: \`${o}\``,`- Test command: \`${n??"none detected"}\``,g.slice(2).join(`
|
|
9
|
+
`))):d.info(`TDD \u2014 ${g.join(`
|
|
10
|
+
`)}`),{success:!0,mode:o,testCommand:n}}async setMode(s,e,r){let o=await a.readConfig(e).catch(()=>null);if(!o?.projectId)return l("No prjct project here \u2014 run `prjct init` first.",r);o.tdd={mode:s},await a.writeConfig(e,o);let t=s==="off"?"TDD mode off \u2014 test-first guidance and the ship TDD gate are dormant.":s==="assist"?"TDD mode \u2192 assist. Guidance biases test-first (red\u2192green\u2192refactor); `ship` reminds.":"TDD mode \u2192 strict. Test-first expected; `ship` surfaces a hard gate \u2014 run `prjct tdd check` and don't ship on red.";return r.md?console.log(c("## TDD",`> ${t}`)):d.done(t),{success:!0,mode:s}}async check(s,e){let o=(await u(s).catch(()=>null))?.test?.command;if(!o){let t="tdd check: no test command detected for this stack. Add a test script first.";return console.log(e.md?c("## TDD check",`> ${t}`):t),{success:!1,reason:"no_test_command"}}try{await h(o,{cwd:s,maxBuffer:32*1024*1024});let t=`tdd check: GREEN \u2014 \`${o}\` passed.`;return console.log(e.md?c("## TDD check",`> \u2705 ${t}`):t),{success:!0,green:!0,testCommand:o}}catch(t){let n=`tdd check: RED \u2014 \`${o}\` failed. Fix before shipping.`;return e.md?console.log(c("## TDD check",`> \u274C ${n}`,f(t))):(d.fail(n),d.info(f(t))),{success:!1,green:!1,testCommand:o}}}};function M(p){let s=p?.tdd?.mode;if(s&&i.includes(s))return s;let e=process.env.PRJCT_TDD_MODE?.toLowerCase();return e&&i.includes(e)?e:"off"}m(M,"effectiveTddMode");var _={effectiveTddMode:M,TDD_MODES:i};export{C as TddCommands,_ as _internal,M as effectiveTddMode};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a,c as b,d as c,e as d}from"./chunk-GSMDQ7VM.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{d as default,b as getTemplateContent,c as listTemplates,a as resetBundle};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c,d,e}from"./chunk-PW3KYKVS.mjs";import"./chunk-E66B27AL.mjs";export{a as identifyTranscriptModel,b as parseTranscriptJsonl,d as sumTranscriptUsage,e as sumTranscriptUsageByModel,c as sumTranscriptUsageDetailed};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c,d,e}from"./chunk-SOPRYWUY.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-V37VTXDW.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-E66B27AL.mjs";export{a as evaluateMemoryContent,c as evaluatePackageInstallTrust,b as evaluateToolInputSecrets,d as evaluateWorkflowRuleExecutable,e as isImportedWorkflowTrust};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c}from"./chunk-ZZ65CN5F.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as extractCorrectionIds,a as extractRefIds,c as usefulnessService};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{e as t,g as a}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as n}from"./chunk-E66B27AL.mjs";a();var r="vault-retire-notice-shown";async function c(o,e){try{return!(o?.vault?.mode==="export")||t.getDoc(e,r)?.shown?null:(t.setDoc(e,r,{shown:!0}),["> **prjct has removed the Obsidian/markdown vault feature.**","> Any files it previously generated are untouched on disk, but prjct no","> longer regenerates them. Agents read project knowledge through prjct","> tools (`prjct search`, `prjct context memory`, `prjct_analysis`, \u2026)."].join(`
|
|
9
|
+
`))}catch{return null}}n(c,"vaultRetirementNotice");export{c as vaultRetirementNotice};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b}from"./chunk-DMXFGLZE.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as epochWeek,b as velocityStorage};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{h as a,i as b,j as c,k as d,l as e}from"./chunk-A4OFZ2SK.mjs";import"./chunk-DAOC3T5G.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-OFVLGJ76.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as conflictModeWithWeakModel,a as effectiveWeakModelMode,c as qualityFloorWithWeakModel,d as weakModelBanner,e as weakModelOneLiner};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{d as r,g as u}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";u();var m=["blocks","parent"],p=`
|
|
9
|
+
SELECT d.from_id FROM work_dependencies d
|
|
10
|
+
WHERE d.dep_type IN ('blocks', 'parent')
|
|
11
|
+
AND (
|
|
12
|
+
EXISTS (SELECT 1 FROM queue_tasks q WHERE q.id = d.to_id AND q.completed = 0)
|
|
13
|
+
OR EXISTS (SELECT 1 FROM tasks t WHERE t.id = d.to_id
|
|
14
|
+
AND t.status NOT IN ('completed', 'shipped', 'cancelled'))
|
|
15
|
+
)`,a=class{static{l(this,"WorkGraph")}addDependency(n,t,e,i){if(t===e)throw new Error("an item cannot depend on itself");if(m.includes(i)&&this.wouldCycle(n,t,e))throw new Error(`dependency ${t} \u2192 ${e} would create a blocking cycle`);r.run(n,`INSERT OR IGNORE INTO work_dependencies (from_id, to_id, dep_type, created_at)
|
|
16
|
+
VALUES (?, ?, ?, ?)`,t,e,i,new Date().toISOString())}wouldCycle(n,t,e){return r.get(n,`WITH RECURSIVE chain(id) AS (
|
|
17
|
+
SELECT ?
|
|
18
|
+
UNION
|
|
19
|
+
SELECT d.to_id FROM work_dependencies d JOIN chain c ON d.from_id = c.id
|
|
20
|
+
WHERE d.dep_type IN ('blocks', 'parent')
|
|
21
|
+
)
|
|
22
|
+
SELECT 1 AS found FROM chain WHERE id = ? LIMIT 1`,e,t)!=null}ready(n,t){return r.query(n,`SELECT q.id, q.description, q.type, q.priority, q.section, q.claimed_by, q.created_at,
|
|
23
|
+
(SELECT COUNT(*) FROM work_dependencies u
|
|
24
|
+
WHERE u.to_id = q.id AND u.dep_type IN ('blocks', 'parent')) AS unblocks
|
|
25
|
+
FROM queue_tasks q
|
|
26
|
+
WHERE q.completed = 0
|
|
27
|
+
AND q.id NOT IN (${p})
|
|
28
|
+
${t?.unclaimedOnly?"AND q.claimed_by IS NULL":""}
|
|
29
|
+
ORDER BY unblocks DESC,
|
|
30
|
+
CASE q.priority WHEN 'high' THEN 0 WHEN 'medium' THEN 1 ELSE 2 END,
|
|
31
|
+
q.created_at ASC
|
|
32
|
+
LIMIT ?`,t?.limit??20).map(i=>({id:i.id,description:i.description,type:i.type,priority:i.priority,section:i.section,claimedBy:i.claimed_by,createdAt:i.created_at,unblocks:i.unblocks}))}next(n){return this.ready(n,{unclaimedOnly:!0,limit:1})[0]??null}claim(n,t,e){return r.run(n,`UPDATE queue_tasks SET claimed_by = ?, claimed_at = ?
|
|
33
|
+
WHERE id = ? AND completed = 0 AND claimed_by IS NULL`,e,new Date().toISOString(),t),r.get(n,"SELECT claimed_by FROM queue_tasks WHERE id = ?",t)?.claimed_by===e}release(n,t){r.run(n,"UPDATE queue_tasks SET claimed_by = NULL, claimed_at = NULL WHERE id = ?",t)}phases(n){let t=r.query(n,`WITH RECURSIVE lvl(id, phase) AS (
|
|
34
|
+
SELECT q.id, 1 FROM queue_tasks q
|
|
35
|
+
WHERE q.completed = 0 AND q.id NOT IN (${p})
|
|
36
|
+
UNION
|
|
37
|
+
SELECT d.from_id, lvl.phase + 1
|
|
38
|
+
FROM work_dependencies d
|
|
39
|
+
JOIN lvl ON d.to_id = lvl.id
|
|
40
|
+
JOIN queue_tasks q ON q.id = d.from_id AND q.completed = 0
|
|
41
|
+
WHERE d.dep_type IN ('blocks', 'parent')
|
|
42
|
+
)
|
|
43
|
+
SELECT id, MAX(phase) AS phase FROM lvl GROUP BY id ORDER BY phase, id`);if(t.length===0)return[];let e=new Map(t.map(s=>[s.id,s.phase])),i=this.allOpen(n).filter(s=>e.has(s.id)),o=new Map;for(let s of i){let d=e.get(s.id)??1,c=o.get(d)??[];c.push(s),o.set(d,c)}return[...o.entries()].sort((s,d)=>s[0]-d[0]).map(([s,d])=>({phase:s,items:d}))}allOpen(n){return r.query(n,"SELECT id, description, type, priority, section, claimed_by, created_at FROM queue_tasks WHERE completed = 0").map(e=>({id:e.id,description:e.description,type:e.type,priority:e.priority,section:e.section,claimedBy:e.claimed_by,createdAt:e.created_at,unblocks:0}))}recordComplexity(n,t,e){r.run(n,`INSERT INTO task_complexity (task_id, score, recommended_subtasks, expansion_prompt, reasoning, created_at)
|
|
44
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
45
|
+
ON CONFLICT(task_id) DO UPDATE SET
|
|
46
|
+
score = excluded.score,
|
|
47
|
+
recommended_subtasks = excluded.recommended_subtasks,
|
|
48
|
+
expansion_prompt = excluded.expansion_prompt,
|
|
49
|
+
reasoning = excluded.reasoning`,t,e.score,e.recommendedSubtasks,e.expansionPrompt??null,e.reasoning??null,new Date().toISOString())}getComplexity(n,t){let e=r.get(n,"SELECT * FROM task_complexity WHERE task_id = ?",t);return e?{score:e.score,recommendedSubtasks:e.recommended_subtasks,expansionPrompt:e.expansion_prompt,reasoning:e.reasoning}:null}dependenciesOf(n,t){return r.query(n,"SELECT from_id, to_id, dep_type FROM work_dependencies WHERE from_id = ? OR to_id = ?",t,t).map(e=>({fromId:e.from_id,toId:e.to_id,depType:e.dep_type}))}},y=new a;export{y as workGraph};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f}from"./chunk-P43HDWI5.mjs";import"./chunk-2OU2MKNS.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-4DDCWMI6.mjs";import"./chunk-DAOC3T5G.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-OFVLGJ76.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HZXDF2TQ.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-HE5RSIHG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as extractFilePathsFromEntries,d as formatWorkScopeBlock,f as isUsefulScopePath,b as resolveWorkScope,a as resolveWorkScopeSync,e as toLikelyFileHits};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{c as w,e as k}from"./chunk-TRMBRDKH.mjs";import{a as g}from"./chunk-ZX2KFQV5.mjs";import{c as u,d}from"./chunk-CREPUNOS.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-QDQ7DTDV.mjs";import{b as i}from"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as s}from"./chunk-E66B27AL.mjs";function b(e,o){return{taskId:e.id,description:e.description,ownerAgent:e.ownerAgent,ownerIdentity:e.ownerIdentity,startedAt:e.startedAt,workspaceId:o,branch:e.branch}}s(b,"asOwner");async function W(e,o,c){let t=c??w(o),r=await d(o),f=await g(e,o),p=r.isMain?await i.getCurrentTask(e):await i.getCurrentTaskForWorkspace(e,r.workspaceId),a=p?b(p,r.isMain?u:r.workspaceId):null,y=f.all.filter(n=>!n.isCurrent).map(n=>({taskId:n.id,description:n.description,startedAt:n.startedAt,workspaceId:n.workspaceId,branch:n.branch})),l=a!==null,I=l&&k(a,t);return{workspaceId:r.workspaceId,isMain:r.isMain,current:a,others:y,occupied:l,occupiedByMe:I}}s(W,"getOccupancy");function M(e,o,c){if(o==="off")return{isolate:!1,reason:"autoWorktree off"};if(!e.occupied||e.occupiedByMe)return{isolate:!1,reason:"workspace free or owned by caller"};let t=e.current,r=[t.ownerAgent,t.ownerIdentity].filter(Boolean).join("/")||"another agent";return e.isMain?o==="ask"?{isolate:!1,block:!0,occupant:t,reason:`Workspace owned by ${r} on "${t.description}" (${t.taskId.slice(0,8)}). Re-run with isolation (config multiAgent.autoWorktree=auto) or \`prjct switch <agent>\` to yield that cycle.`}:{isolate:!0,occupant:t,reason:`Branch/workspace owned by ${r} on "${t.description}" (${t.taskId.slice(0,8)}). Isolating to a sibling worktree.`}:{isolate:!1,block:!0,occupant:t,reason:`Workspace already owned by ${r} on "${t.description}" (${t.taskId.slice(0,8)}). Work elsewhere or \`prjct switch\` to take over.`}}s(M,"shouldIsolate");function $(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||`work-${Date.now().toString(36)}`}s($,"worktreeSlugFromIntent");export{W as getOccupancy,M as shouldIsolate,$ as worktreeSlugFromIntent};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{j as g,n as v}from"./chunk-SVZHJZ5T.mjs";import{a as s,o as b}from"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as d}from"./chunk-E66B27AL.mjs";b();v();import l from"node:fs/promises";import n from"node:path";var k=".worktrees",f=class{static{d(this,"WorktreeService")}async create(t,e,r={}){let i=await this.getMainWorktree(t),a=n.join(i,k,e),h=r.branch||`feat/${e}`;await l.mkdir(n.join(i,k),{recursive:!0});let c=r.baseBranch?` ${r.baseBranch}`:"";await s(`git worktree add "${a}" -b "${h}"${c}`,{cwd:i});let{stdout:w}=await s("git rev-parse HEAD",{cwd:a});return{path:a,branch:h,commit:w.trim(),isMain:!1,slug:e}}async remove(t,e=!1){let r=await this.getMainWorktree(t),i=e?await s("git rev-parse --abbrev-ref HEAD",{cwd:t}).then(({stdout:a})=>a.trim()).catch(()=>{}):void 0;if(await s(`git worktree remove "${t}" --force`,{cwd:r}),e&&i&&i!=="main"&&i!=="master")try{await s(`git branch -D "${i}"`,{cwd:r})}catch{}}async list(t){let e=await this.getMainWorktree(t),{stdout:r}=await s("git worktree list --porcelain",{cwd:e});return this.parsePorcelainOutput(r,e)}async detect(t){try{let{stdout:e}=await s("git rev-parse --git-common-dir",{cwd:t}),{stdout:r}=await s("git rev-parse --git-dir",{cwd:t}),i=n.resolve(t,e.trim()),a=n.resolve(t,r.trim());if(i!==a){let{stdout:h}=await s("git rev-parse --abbrev-ref HEAD",{cwd:t}),{stdout:c}=await s("git rev-parse HEAD",{cwd:t}),{stdout:w}=await s("git rev-parse --show-toplevel",{cwd:t}),p=w.trim(),u=n.basename(p);return{path:p,branch:h.trim(),commit:c.trim(),isMain:!1,slug:u}}return null}catch{return null}}async getMainWorktree(t){try{let{stdout:r}=await s("git worktree list --porcelain",{cwd:t}),i=r.split(`
|
|
9
|
+
`)[0];if(i?.startsWith("worktree "))return i.replace("worktree ","").trim()}catch{}let{stdout:e}=await s("git rev-parse --show-toplevel",{cwd:t});return e.trim()}async setup(t,e){let r=n.join(e,".env");await g(r)&&await l.copyFile(r,n.join(t,".env"));let i=n.join(e,".prjct"),a=n.join(t,".prjct");await g(i)&&!await g(a)&&await l.symlink(i,a,"dir")}async teardown(t){}async clean(t){let e=await this.list(t),r=[],i=await this.getMainWorktree(t);await s("git worktree prune",{cwd:i});for(let a of e)a.isMain||await g(a.path)||r.push(a.slug);return r}parsePorcelainOutput(t,e){let r=[],i=t.trim().split(`
|
|
10
|
+
|
|
11
|
+
`);for(let a of i){if(!a.trim())continue;let h=a.trim().split(`
|
|
12
|
+
`),{wtPath:c,commit:w,branch:p,isBare:u}=h.reduce((o,m)=>(m.startsWith("worktree ")?o.wtPath=m.replace("worktree ","").trim():m.startsWith("HEAD ")?o.commit=m.replace("HEAD ","").trim():m.startsWith("branch ")?o.branch=m.replace("branch refs/heads/","").trim():m==="bare"?o.isBare=!0:m==="detached"&&(o.branch="(detached)"),o),{wtPath:"",commit:"",branch:"",isBare:!1});if(c){let o=c===e||u;r.push({path:c,branch:p,commit:w,isMain:o,slug:o?"main":n.basename(c)})}}return r}},M=new f;export{M as worktreeService};
|
|
Binary file
|