prjct-cli 3.94.0 → 3.95.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 +5 -0
- package/README.md +27 -21
- package/dist/bin/hook-chunks/{agent-switch-2U2LOBGR.mjs → agent-switch-4ZJJWKMD.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-N4NYGIG3.mjs → analysis-UGHAG2SK.mjs} +3 -3
- package/dist/bin/hook-chunks/{auth-config-SP4PBALR.mjs → auth-config-JIITQ6GY.mjs} +1 -1
- package/dist/bin/hook-chunks/{auto-flush-BN6L6QHO.mjs → auto-flush-CXWTU3RF.mjs} +1 -1
- package/dist/bin/hook-chunks/{capture-gate-FRF2G3IG.mjs → capture-gate-PS6QUXLX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7GNWHWOO.mjs → chunk-22AXWLI6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-OENWCYLF.mjs → chunk-3WQBTXUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QPRNRLG6.mjs → chunk-4HAKTI36.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-4SKJWNKE.mjs → chunk-4KXXDQYI.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-S7HQQILD.mjs → chunk-4NTVXJD7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Y4DUB7UN.mjs → chunk-5H3KJWQS.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-INXNK57E.mjs → chunk-5XA5RL5I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NBKEOLDH.mjs → chunk-6GAFRIUQ.mjs} +5 -5
- package/dist/bin/hook-chunks/{chunk-Q3Z53QTH.mjs → chunk-76GDLA3Z.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-6RLCUGGG.mjs → chunk-ABJNOG2I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EHEQOF6Z.mjs → chunk-B36LC2JR.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NCOOKPXX.mjs → chunk-BDOAQVIF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PUHX3ECX.mjs → chunk-BOBFTVAY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AZYQFRPJ.mjs → chunk-BU22R6JX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NHIWYDQD.mjs → chunk-BX7VKYA7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7JEKBJAP.mjs → chunk-C4O243NG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V2BSS7HW.mjs → chunk-CYZ7ST2P.mjs} +5 -5
- package/dist/bin/hook-chunks/{chunk-JMCMTX6U.mjs → chunk-DCSKTMDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-J6TAD3OZ.mjs → chunk-DVDZA63F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-D6IONKRA.mjs → chunk-EWOK4VE7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EQ5KNMLG.mjs → chunk-FW4MEPTB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2HB2JHQE.mjs → chunk-FXFG6PV6.mjs} +4 -4
- package/dist/bin/hook-chunks/chunk-G7QQZMAO.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-EMTCZG5I.mjs → chunk-GCDLPKOH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X2AGNDGD.mjs → chunk-GDECEHO5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JUZ5LNDI.mjs → chunk-GDESYWTD.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-GLPKMG5A.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-SDUS2AT7.mjs → chunk-HEDZA6KC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-5EQLQ7GF.mjs → chunk-I26F7TLM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HHIGNKDO.mjs → chunk-IGHY4FGS.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QYEASMFV.mjs → chunk-IWJG7CZX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7O6OMD4X.mjs → chunk-J5UQVJUW.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-J5UVRZ44.mjs +15 -0
- package/dist/bin/hook-chunks/{chunk-GFY4GY3Z.mjs → chunk-KHLYWNHT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-C3W2HLJT.mjs → chunk-KSSRINDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-4O4D6DV7.mjs → chunk-MHNWIB7B.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-3VWBNLBC.mjs → chunk-N3L77UNM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IHECXD2M.mjs → chunk-NLKPAJND.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OIU4Y5WL.mjs → chunk-OC4CYF7V.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Q3EYM4GJ.mjs → chunk-OGIFB3OE.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-AVRNHROK.mjs → chunk-OUAVSD47.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Y3J7UUMR.mjs → chunk-PGWFGRX4.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AZHE4VOM.mjs → chunk-PO3QDKTE.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZMKTR2IO.mjs → chunk-PP6DANGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MHQTGU45.mjs → chunk-PTA7DMLM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HRWXMF7P.mjs → chunk-QBYHZX33.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HNEKXKOI.mjs → chunk-QL3NYJTW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UA4Z5TGG.mjs → chunk-QP5USCDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JPSJWCFD.mjs → chunk-RHKF7EJW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-66GE3IHX.mjs → chunk-ROA2AJXY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TG5CQJD5.mjs → chunk-RTEEXGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-YUKGWWL7.mjs → chunk-S5ISOGDB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TKWAFYF7.mjs → chunk-S5N2ZZDL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-F4T7IAA7.mjs → chunk-S6L3FECF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JCYXFHQZ.mjs → chunk-T6ELTQZM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NWZEBCTC.mjs → chunk-TXSLON7M.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-IKIB42F7.mjs → chunk-U4OON3S7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KG7Z6OMK.mjs → chunk-UHVYBU7F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NWIQNII6.mjs → chunk-UYQC63MC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-27XFSCOE.mjs → chunk-V2FR2NPL.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-XE4MJNBQ.mjs → chunk-WGWE3CSC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MI3JEFON.mjs → chunk-X5W2UYQK.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-TYEAIX3X.mjs → chunk-XDBJSJOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6UH244CC.mjs → chunk-XXRAQZNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OZJ6UKKP.mjs → chunk-YDBZO6I3.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-Z4X7JIAP.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-FX6VHIKB.mjs → chunk-Z6KVLCMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KOCROTRM.mjs → chunk-ZFLIVOFX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-T2FCU3ZS.mjs → chunk-ZOX6OV6X.mjs} +1 -1
- package/dist/bin/hook-chunks/{client-ERZ5CM3D.mjs → client-CRXA774S.mjs} +3 -3
- package/dist/bin/hook-chunks/{code-graph-cloud-4GRWQSUK.mjs → code-graph-cloud-GTSLO7CD.mjs} +1 -1
- package/dist/bin/hook-chunks/{codex-skill-6DYQMPDJ.mjs → codex-skill-NUBNPSMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-MF4KUM3X.mjs → command-installer-UHSXC3UG.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-2VZPHUDG.mjs → config-manager-DX5OOPW5.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-V7CIDF3Q.mjs → context7-service-GDJ3QICX.mjs} +1 -1
- package/dist/bin/hook-chunks/{custom-workflow-storage-UOBQXY42.mjs → custom-workflow-storage-FD47DPA3.mjs} +1 -1
- package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +8 -0
- package/dist/bin/hook-chunks/{database-XYKQF3KR.mjs → database-ZUC7OEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-DFRJOOB3.mjs → detect-changes-OJUBWWTU.mjs} +1 -1
- package/dist/bin/hook-chunks/{developer-evolution-SLC34HUU.mjs → developer-evolution-WNSTHDAA.mjs} +1 -1
- package/dist/bin/hook-chunks/{distill-U2LJGUG3.mjs → distill-GOGPFQFK.mjs} +1 -1
- package/dist/bin/hook-chunks/{editors-config-6XFYIOE6.mjs → editors-config-2CACBNS4.mjs} +1 -1
- package/dist/bin/hook-chunks/{enriched-recall-X6RDNNIE.mjs → enriched-recall-QF22RIK7.mjs} +1 -1
- package/dist/bin/hook-chunks/{format-ALUX4QSI.mjs → format-J3X3R225.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-SCGU3URM.mjs → judgment-ledger-storage-FE4HXTHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-BYPG65RS.mjs → judgment-orchestrator-YDJTKNV2.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-receipt-GWSSCLAB.mjs → judgment-receipt-7A2DXVJA.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-cue-MMISX2BI.mjs → land-cue-SZWJH6XP.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-synthesis-WG5JAS7B.mjs → land-synthesis-JLYUBKHR.mjs} +1 -1
- package/dist/bin/hook-chunks/{legacy-crew-sweep-2WSO5KEB.mjs → legacy-crew-sweep-JXYO62UE.mjs} +2 -2
- package/dist/bin/hook-chunks/{memory-index-QK5QJOFJ.mjs → memory-index-CIYDXN2G.mjs} +1 -1
- package/dist/bin/hook-chunks/{notification-MPVWVV52.mjs → notification-UA7RTVHG.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-integrity-XRYOROK5.mjs → pack-integrity-GZC5NGFN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-WWGQNJDQ.mjs → pack-manager-AF5F7PRT.mjs} +1 -1
- package/dist/bin/hook-chunks/{path-manager-ZR5RAKTK.mjs → path-manager-375HH6TB.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-S55KBPN2.mjs → planning-M3RAOZVB.mjs} +2 -2
- package/dist/bin/hook-chunks/{post-edit-QMHSZHDN.mjs → post-edit-QRDYPZLZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-bash-RAM6L3G4.mjs → pre-bash-TWWFVNQ7.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-commit-736ZLMDL.mjs → pre-commit-PTFF7JIN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-edit-GZ4QJ2MU.mjs → pre-edit-PMMWDR2B.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-package-LCIAWWGK.mjs → pre-package-325ALZKD.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-search-J5EOFMYN.mjs → pre-search-GOHVFAFH.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-secrets-TSUMTXHH.mjs → pre-secrets-MYNM5KI4.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-T2DG236Y.mjs → prjct-md-RCB6FWD6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-VRY22I66.mjs → project-agent-surfaces-V4P5RTUR.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-5DEN5VLF.mjs → project-file-inventory-OKIP4LBO.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-memory-KKEMTEMP.mjs → project-memory-JK2MXRJB.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-style-evolution-7MAUSED2.mjs → project-style-evolution-RPGATIYJ.mjs} +1 -1
- package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +24 -0
- package/dist/bin/hook-chunks/{publish-helper-G54XQV5K.mjs → publish-helper-SX7HEV2L.mjs} +1 -1
- package/dist/bin/hook-chunks/{purge-MC5LFSAO.mjs → purge-XKHUAB4H.mjs} +1 -1
- package/dist/bin/hook-chunks/{retention-LWETHQX3.mjs → retention-C3NQT65W.mjs} +1 -1
- package/dist/bin/hook-chunks/{sdd-5UCVX43H.mjs → sdd-6PF7MBAY.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-continuity-RKNAJJHR.mjs → session-continuity-UEXQDGZE.mjs} +1 -1
- package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +8 -0
- package/dist/bin/hook-chunks/{setup-WQRJ6TQL.mjs → setup-ZOHG6MGF.mjs} +3 -3
- package/dist/bin/hook-chunks/{shipping-5D5LTJ3P.mjs → shipping-QVGTOO6U.mjs} +4 -4
- package/dist/bin/hook-chunks/{skill-index-RAVJMC4P.mjs → skill-index-FGDQVYHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-7DDSTRTV.mjs → spec-context-inference-6Z52BT37.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-LAO5Z2M5.mjs → spec-service-UAQ5AEXQ.mjs} +2 -2
- package/dist/bin/hook-chunks/{spec-task-breakdown-K3GMQKGH.mjs → spec-task-breakdown-LAXGVLMY.mjs} +1 -1
- package/dist/bin/hook-chunks/{state-storage-EIFGUO7X.mjs → state-storage-XU35ZYNA.mjs} +1 -1
- package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +8 -0
- package/dist/bin/hook-chunks/{subagent-stop-RBD2OILE.mjs → subagent-stop-OUG4PR7S.mjs} +1 -1
- package/dist/bin/hook-chunks/{surface-attribution-K37N2NK7.mjs → surface-attribution-A6GCGRFM.mjs} +1 -1
- package/dist/bin/hook-chunks/{symbol-graph-BKQIMFRG.mjs → symbol-graph-DMPBNBX7.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-client-EGBMWF3J.mjs → sync-client-PIRHMHXL.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-E3LMZISA.mjs → sync-cursor-storage-VVLA3L2U.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-2ZYE5M6J.mjs → task-orchestration-HFZYWYLR.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-ITY5OSHX.mjs → task-overview-PCUZWL5Q.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +8 -0
- package/dist/bin/hook-chunks/{tdd-7S55S5C3.mjs → tdd-QZL4OSM7.mjs} +1 -1
- package/dist/bin/hook-chunks/{template-loader-SCM4C2A3.mjs → template-loader-SKXILJLJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-SCH5ARGV.mjs → usefulness-SZLG6LVC.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-HT756AND.mjs → vault-retire-notice-HOXPURNQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{velocity-storage-47CF3XWZ.mjs → velocity-storage-5J6BAMCW.mjs} +1 -1
- package/dist/bin/hook-chunks/{weak-model-mode-FLCEQ2BV.mjs → weak-model-mode-ZRNKFTFF.mjs} +1 -1
- package/dist/bin/hook-chunks/{work-graph-JQHVVXIZ.mjs → work-graph-PGYHFLEL.mjs} +1 -1
- package/dist/bin/hook-chunks/work-scope-FIB6LBKE.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UUW4UGGB.mjs → workspace-occupancy-3D4OKQRB.mjs} +1 -1
- package/dist/bin/hook-fast-darwin-arm64 +0 -0
- package/dist/bin/hook-fast-darwin-x64 +0 -0
- package/dist/bin/hook-fast-linux-x64 +0 -0
- package/dist/bin/prjct-core.mjs +681 -668
- package/dist/bin/prjct-hooks.mjs +1 -1
- package/dist/bin/prjct.mjs +1 -1
- package/dist/daemon/entry.mjs +595 -582
- package/dist/mcp/server.mjs +232 -232
- package/package.json +1 -1
- package/dist/bin/hook-chunks/chunk-DRGI5UHQ.mjs +0 -10
- package/dist/bin/hook-chunks/chunk-JAMSIKDE.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-NUJASVHN.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-TFCLMTJ5.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-VWOIUTAX.mjs +0 -15
- package/dist/bin/hook-chunks/chunk-ZJXH76Q5.mjs +0 -11
- package/dist/bin/hook-chunks/cwd-changed-J6O46KS7.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-DVF6V2X2.mjs +0 -22
- package/dist/bin/hook-chunks/session-start-MFMFKUPK.mjs +0 -8
- package/dist/bin/hook-chunks/stop-RYLI4FGF.mjs +0 -16
- package/dist/bin/hook-chunks/subagent-start-CCUPSANT.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-XREJLWEF.mjs +0 -8
- package/dist/bin/hook-chunks/work-scope-CDLSZ4U5.mjs +0 -8
|
@@ -0,0 +1,11 @@
|
|
|
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 as c,c as d,e as k,f as s,g as l,j as f}from"./chunk-Z4X7JIAP.mjs";import{a as u}from"./chunk-E66B27AL.mjs";function m(t){return typeof t=="string"?`${t}
|
|
9
|
+
`:`${JSON.stringify(t)}
|
|
10
|
+
`}u(m,"payloadLine");async function g(t,n){let i=t.projectPath??process.cwd();if(n){try{let e=n.hookHost??c(),r=n.input;if(n.afterEmitOnly){t.afterEmit&&n.detachAfterEmit(()=>t.afterEmit(r,i));return}let o=t.decide?await t.decide(r,i):null;if(o){n.sink(m(d(a(t.event,o.deny),e)));return}let H=t.build?await t.build(r,i,e):null;n.sink(m(d(f(t.event,H),e))),t.afterEmit&&n.detachAfterEmit(()=>t.afterEmit(r,i))}catch{n.sink(`{}
|
|
11
|
+
`)}return}await l(async()=>{let e=k(),r=t.decide?await t.decide(e,i):null;if(r){s(a(t.event,r.deny));return}let o=t.build?await t.build(e,i,c()):null;s(f(t.event,o)),t.afterEmit&&await t.afterEmit(e,i)})}u(g,"runHook");export{g as a};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{d as n,g as o}from"./chunk-
|
|
8
|
+
import{d as n,g as o}from"./chunk-UHVYBU7F.mjs";import{a as i}from"./chunk-E66B27AL.mjs";o();function u(r,e){try{return e?n.query(r,"SELECT content FROM task_log WHERE task_id = ? ORDER BY id DESC LIMIT 5",e).map(t=>t.content):n.query(r,"SELECT content FROM task_log ORDER BY id DESC LIMIT 5").map(t=>t.content)}catch{return[]}}i(u,"recentJournal");export{u as a};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as u}from"./chunk-
|
|
8
|
+
import{b as u}from"./chunk-QP5USCDX.mjs";import{d as i,g as T}from"./chunk-UHVYBU7F.mjs";import{b as y,h as _}from"./chunk-A6K4H3YT.mjs";import{a as o}from"./chunk-E66B27AL.mjs";import g from"node:crypto";function E(){return g.randomUUID()}o(E,"generateUUID");_();T();function v(d,t,e){return{id:d,entity_type:t.entityType,entity_id:t.entityId,entity_data:JSON.stringify(t.entityData),summary:t.summary??null,reason:t.reason,archived_at:e,created_at:e}}o(v,"archiveSyncPayload");var l={SHIPPED_RETENTION_DAYS:90,IDEA_DORMANT_DAYS:180,QUEUE_COMPLETED_DAYS:7,PAUSED_TASK_DAYS:30,MEMORY_MAX_ENTRIES:500},h=class{static{o(this,"ArchiveStorage")}archive(t,e){let r=E(),n=y();return i.run(t,"INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)",r,e.entityType,e.entityId,JSON.stringify(e.entityData),e.summary??null,n,e.reason),u({projectId:t,entityType:"archives",entityId:r,eventType:"upsert",data:v(r,e,n)}),r}archiveMany(t,e){if(e.length===0)return 0;let r=y(),n=[];i.transaction(t,a=>{let c=a.prepare("INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)");for(let s of e){let p=E();c.run(p,s.entityType,s.entityId,JSON.stringify(s.entityData),s.summary??null,r,s.reason),n.push({id:p,item:s})}});for(let{id:a,item:c}of n)u({projectId:t,entityType:"archives",entityId:a,eventType:"upsert",data:v(a,c,r)});return e.length}getArchived(t,e,r=50){return e?i.query(t,"SELECT * FROM archives WHERE entity_type = ? ORDER BY archived_at DESC LIMIT ?",e,r):i.query(t,"SELECT * FROM archives ORDER BY archived_at DESC LIMIT ?",r)}getStats(t){let e=i.query(t,"SELECT entity_type, COUNT(*) as count FROM archives GROUP BY entity_type"),r={shipped:0,idea:0,queue_task:0,paused_task:0,memory_entry:0,total:0};for(let n of e){let a=n.entity_type;a in r&&(r[a]=n.count),r.total+=n.count}return r}restore(t,e){let r=i.get(t,"SELECT * FROM archives WHERE id = ?",e);return r?(i.run(t,"DELETE FROM archives WHERE id = ?",e),JSON.parse(r.entity_data)):null}pruneOldArchives(t,e){let r=new Date(Date.now()-e*24*60*60*1e3).toISOString(),n=this.getTotalCount(t);i.run(t,"DELETE FROM archives WHERE archived_at < ?",r);let a=this.getTotalCount(t);return n-a}getTotalCount(t){return i.get(t,"SELECT COUNT(*) as count FROM archives")?.count??0}},I=new h;export{E as a,l as b,I as c};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as u,g as C}from"./chunk-
|
|
8
|
+
import{e as u,g as C}from"./chunk-UHVYBU7F.mjs";import{a as E,b as _,c as A,d as w,e as v,o as b}from"./chunk-UH4MD3F3.mjs";import{a as c}from"./chunk-E66B27AL.mjs";A();C();b();import I from"node:fs/promises";import d from"node:path";function O(t){let r=new RegExp(_.source,"g");return[...t.matchAll(r)].map(e=>e[1]).filter(e=>e.startsWith(".")||e.startsWith("@/"))}c(O,"extractImportSources");async function R(t,r,e){let n=t.startsWith("@/")?d.join(e,"src",t.slice(2)):d.resolve(d.dirname(d.join(e,r)),t);for(let o of E){let i=n+o;try{if((await I.stat(i)).isFile())return d.relative(e,i)}catch{}}return null}c(R,"resolveImport");async function x(t){let r=await w(t),e={},n={},o=await v(r,50,async i=>{let s=await G(t,i);return s&&s.imports.length>0?s:null});for(let{filePath:i,imports:s}of o){e[i]=s;for(let f of s)n[f]||(n[f]=[]),n[f].push(i)}return{forward:e,reverse:n,fileCount:r.length,edgeCount:o.reduce((i,s)=>i+s.imports.length,0),builtAt:new Date().toISOString()}}c(x,"buildGraph");function B(t,r,e=2){let n=new Set(t),o=new Map,i=[];for(let s of t){let f=r.forward[s]||[],a=r.reverse[s]||[];for(let p of[...f,...a])n.has(p)||i.push({file:p,depth:1})}for(let{file:s,depth:f}of i){if(f>e)continue;let a=1/(f+1),p=o.get(s);if(p){a>p.score&&o.set(s,{score:a,depth:f});continue}if(o.set(s,{score:a,depth:f}),f<e){let g=r.forward[s]||[],y=r.reverse[s]||[];for(let h of[...g,...y])!n.has(h)&&!o.has(h)&&i.push({file:h,depth:f+1})}}return Array.from(o.entries()).map(([s,{score:f,depth:a}])=>({path:s,score:f,depth:a})).sort((s,f)=>f.score-s.score)}c(B,"scoreFromSeeds");var l="import-graph",m=new Map;function D(t){return Object.values(t).reduce((r,e)=>r+e.length,0)}c(D,"countEdges");function T(t,r){let e=t.forward[r]||[];delete t.forward[r];for(let n of e){let o=(t.reverse[n]||[]).filter(i=>i!==r);o.length===0?delete t.reverse[n]:t.reverse[n]=o}}c(T,"removeOutgoingEdges");function P(t,r){let e=t.reverse[r]||[];delete t.reverse[r];let n=[];for(let o of e){let i=(t.forward[o]||[]).filter(s=>s!==r);i.length===0?delete t.forward[o]:t.forward[o]=i,n.push(o)}return n}c(P,"removeIncomingEdges");function M(t,r,e){if(e.length===0)return;let n=Array.from(new Set(e));t.forward[r]=n;for(let o of n)t.reverse[o]||(t.reverse[o]=[]),t.reverse[o].includes(r)||t.reverse[o].push(r)}c(M,"addEdges");async function G(t,r){try{let e=await I.readFile(d.join(t,r),"utf-8"),n=O(e),o=[];for(let i of n){let s=await R(i,r,t);s&&s!==r&&o.push(s)}return{filePath:r,imports:o}}catch{return null}}c(G,"importsForFile");function S(t){return{schemaVersion:2,fileCount:t.fileCount,edgeCount:t.edgeCount,builtAt:t.builtAt}}c(S,"graphMetadata");function F(t,r){try{u.transaction(t,e=>{e.prepare("DELETE FROM import_graph_edges").run();let n=e.prepare("INSERT INTO import_graph_edges (from_path, to_path, sort_order) VALUES (?, ?, ?)");for(let[o,i]of Object.entries(r.forward))for(let[s,f]of i.entries())n.run(o,f,s)})}catch{}}c(F,"replacePerFileEdges");function L(t,r,e,n){try{u.transaction(t,o=>{let i=o.prepare("DELETE FROM import_graph_edges WHERE from_path = ?"),s=o.prepare("INSERT INTO import_graph_edges (from_path, to_path, sort_order) VALUES (?, ?, ?)");for(let f of new Set([...e,...n]))i.run(f);for(let f of e){let a=r.forward[f]||[];for(let[p,g]of a.entries())s.run(f,g,p)}})}catch{}}c(L,"updatePerFileEdges");function N(t,r,e){try{let n=u.query(t,"SELECT from_path, to_path FROM import_graph_edges ORDER BY from_path, sort_order, to_path");if(n.length===0){if(e?.edgeCount===0){let a={forward:{},reverse:{},fileCount:e.fileCount,edgeCount:0,builtAt:e.builtAt};return m.set(t,{graph:a,updatedAt:r}),a}return null}let o={},i={};for(let a of n)o[a.from_path]||(o[a.from_path]=[]),o[a.from_path].push(a.to_path),i[a.to_path]||(i[a.to_path]=[]),i[a.to_path].push(a.from_path);let s=new Set;for(let[a,p]of Object.entries(o)){s.add(a);for(let g of p)s.add(g)}let f={forward:o,reverse:i,fileCount:e?.fileCount??s.size,edgeCount:n.length,builtAt:e?.builtAt??r};return m.set(t,{graph:f,updatedAt:r}),f}catch{return null}}c(N,"loadGraphFromPerFileEdges");function V(t,r){u.setDoc(t,l,S(r)),F(t,r),m.delete(t)}c(V,"saveGraph");function W(t,r,e,n){u.setDoc(t,l,S(r)),L(t,r,e,n),m.delete(t)}c(W,"saveGraphUpdate");function k(t){let r=u.get(t,"SELECT updated_at FROM kv_store WHERE key = ?",l);if(!r)return m.delete(t),null;let e=m.get(t);if(e&&e.updatedAt===r.updated_at)return e.graph;let n=u.getDoc(t,l),o=N(t,r.updated_at,n);if(o)return o;if(!n?.forward||!n?.reverse)return null;let i={forward:n.forward,reverse:n.reverse,fileCount:n.fileCount,edgeCount:n.edgeCount,builtAt:n.builtAt};return m.set(t,{graph:i,updatedAt:r.updated_at}),i}c(k,"loadGraph");async function q(t,r){let e=await x(t);return V(r,e),e}c(q,"indexImports");async function K(t,r,e,n=[]){let o=k(r);if(!o)return q(t,r);let i=new Set([...e,...n]);for(let a of i)T(o,a);let s=new Set;for(let a of n)for(let p of P(o,a))s.add(p);let f=await v(e,50,a=>G(t,a));for(let a of f)M(o,a.filePath,a.imports);return o.edgeCount=D(o.forward),o.builtAt=new Date().toISOString(),W(r,o,[...e,...s],n),o}c(K,"updateImportGraph");export{B as a,k as b,q as c,K as d};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as C}from"./chunk-
|
|
8
|
+
import{a as C}from"./chunk-5XA5RL5I.mjs";import{d as l,g as A}from"./chunk-UHVYBU7F.mjs";import{a as d}from"./chunk-E66B27AL.mjs";import{z as t}from"zod";var O=t.enum(["improving","stable","declining"]),R=t.object({sprintNumber:t.number(),startDate:t.string(),endDate:t.string(),pointsCompleted:t.number(),tasksCompleted:t.number(),avgVariance:t.number(),estimationAccuracy:t.number()}),D=t.object({category:t.string(),avgVariance:t.number(),taskCount:t.number()}),I=t.object({totalPoints:t.number(),sprints:t.number(),estimatedDate:t.string()}),P=t.object({sprints:t.array(R),averageVelocity:t.number(),velocityTrend:O,estimationAccuracy:t.number(),overEstimated:t.array(D),underEstimated:t.array(D),lastUpdated:t.string()}),U=t.object({sprintLengthDays:t.number().min(1).max(90).default(7),startDay:t.enum(["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]).default("monday"),windowSize:t.number().min(1).max(52).default(6),accuracyTolerance:t.number().min(0).max(100).default(20)});var f={sprints:[],averageVelocity:0,velocityTrend:"stable",estimationAccuracy:0,overEstimated:[],underEstimated:[],lastUpdated:""};A();var h=10080*60*1e3;function M(m){let r=new Date(m).getTime();return Number.isFinite(r)?Math.floor(r/h):null}d(M,"epochWeek");function k(m){return new Date(m*h).toISOString()}d(k,"weekStartIso");function w(m){return new Date((m+1)*h-1).toISOString()}d(w,"weekEndIso");var E=class extends C{static{d(this,"VelocityStorage")}constructor(){super("velocity.json")}getDefault(){return{metrics:f,lastUpdated:""}}getEventType(r){return`velocity.${r}d`}async recompute(r){let o=l.query(r,"SELECT completed_at FROM tasks WHERE completed_at IS NOT NULL"),_=l.query(r,"SELECT shipped_at FROM shipped_features"),c=new Map;for(let a of o){let n=M(a.completed_at);if(n===null)continue;let p=c.get(n)??{tasks:0,ships:0};p.tasks++,c.set(n,p)}for(let a of _){let n=M(a.shipped_at);if(n===null)continue;let p=c.get(n)??{tasks:0,ships:0};p.ships++,c.set(n,p)}for(let[a,n]of c)l.run(r,`INSERT INTO velocity_sprints
|
|
9
9
|
(sprint_number, points_completed, tasks_completed, estimation_accuracy, avg_variance, started_at, ended_at)
|
|
10
10
|
VALUES (?, ?, ?, 0, 0, ?, ?)
|
|
11
11
|
ON CONFLICT(sprint_number) DO UPDATE SET
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as d}from"./chunk-
|
|
8
|
+
import{c as d}from"./chunk-YDBZO6I3.mjs";import{G as u,R as h,d as m}from"./chunk-YQ55MHKL.mjs";import{g,h as f}from"./chunk-KOGZCFBC.mjs";import{b as p,h as C}from"./chunk-A6K4H3YT.mjs";import{a as s}from"./chunk-E66B27AL.mjs";C();var w='Ship: you MAY suggest when ready, but run `prjct ship` ONLY after the user confirms in text this turn (e.g. "ship", "s\xED publ\xEDcalo"). Never ship on silence, Stop, or green tests alone.';function $(t){return t==="skip"?"none":t==="standard"?"standard":"full"}s($,"qualityFromIntensity");function E(t){return t==="none"?"skip":t==="standard"?"standard":"full"}s(E,"intensityFromQuality");async function R(t,e={}){let{files:n,loc:r}=await(async()=>{try{let o=await f(t);if(o&&(o.files>0||o.loc>0))return{files:o.files,loc:o.loc};let l=await g(t);return{files:l?.files??0,loc:l?.loc??0}}catch{return{files:0,loc:0}}})(),{intensity:i}=m({files:n,loc:r},e);return{intensity:i,files:n,loc:r}}s(R,"resolveWorkIntensity");async function N(t){let e=await R(t.projectPath,t.signals??{}),n=t.forceIntensity??e.intensity,r=$(n),i=d.get(t.projectId);if(r==="none"){let a=u(i,n);return{opened:!1,intensity:n,quality:r,ledger:i,next:a}}if(i&&(i.verdict==="in_progress"||i.verdict==="approved")){let a=u(i,i.intensity);return{opened:!1,intensity:i.intensity,quality:r,ledger:i,next:a}}let o=t.target?.trim()||await L(t.projectPath)||`work-${p().slice(0,10)}`,l=await import("./delivery-geometry-WYOEMKMO.mjs").then(({tierOf:a})=>a({files:e.files,loc:e.loc})).catch(()=>{}),x=await(async()=>{try{let{computeCommittedChangeset:a}=await import("./delivery-geometry-WYOEMKMO.mjs"),c=await a(t.projectPath);if(c?.base){let{execFileAsync:I}=await import("./exec-2P5VOBHM.mjs"),{stdout:v}=await I("git",["diff","--name-only",`${c.base}..HEAD`],{cwd:t.projectPath});return v.split(`
|
|
9
9
|
`).map(k=>k.trim()).filter(Boolean)}return c?.dirs?.length?[...c.dirs]:void 0}catch{return}})(),y=h({target:o,intensity:n,deliveryTier:l,now:p(),scopePaths:x});d.set(t.projectId,y);let j=u(y,n);return{opened:!0,intensity:n,quality:r,ledger:y,next:j}}s(N,"ensureJudgmentLedger");function P(t,e){if(t.intensity==="skip")return null;if(e?.verdict==="approved")return["# prjct: quality ready","",`- Judgment ledger \`${e.id.slice(0,8)}\` \u2192 **APPROVED** (intensity=${e.intensity}).`,"- You MAY suggest: work is ready to ship when they want.",`- ${w}`].join(`
|
|
10
10
|
`);if(t.kind==="skip_ship")return null;let n=["# prjct: quality orchestrator (automatic)","",`- **kind**: \`${t.kind}\` \xB7 intensity **${t.intensity}** \xB7 round ${t.fixRound}/${t.maxFixRounds}`,`- **directive**: ${t.directive}`,"","### Steps (run these \u2014 human does not type judgment)",...t.steps.map((r,i)=>`${i+1}. ${r}`),"",`_${w}_`];return t.judgeCharters&&n.push("","### Charters",`RED: ${t.judgeCharters.red}`,"",`BLUE: ${t.judgeCharters.blue}`),t.rankedFixIds.length&&n.push("",`### Blast rank: ${t.rankedFixIds.join(" \u2192 ")}`),n.join(`
|
|
11
11
|
`)}s(P,"formatQualityInject");function Q(t){let e=d.get(t),n=e?.intensity??"skip";if(!e&&n==="skip")return null;let r=u(e,n==="skip"&&e?e.intensity:n);return e?P(r,e):null}s(Q,"qualityInjectForProject");async function L(t){try{let{getGitBranch:e}=await import("./git-helpers-HELM6DXJ.mjs");return await e(t)??null}catch{return null}}s(L,"defaultBranchTarget");function q(t){return t!=="skip"}s(q,"shipRequiresQuality");export{w as a,$ as b,E as c,R as d,N as e,P as f,Q as g,q as h};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 j}from"./chunk-NLKPAJND.mjs";import{n as w}from"./chunk-A6K4H3YT.mjs";import{c as C}from"./chunk-JQE2F2RK.mjs";import{k as r,o as u}from"./chunk-UH4MD3F3.mjs";import{c as A}from"./chunk-FW4MEPTB.mjs";import{b as l,c,d as h,e as d}from"./chunk-SYHDEUVU.mjs";import{c as R,e as G}from"./chunk-GCDLPKOH.mjs";import{a as s}from"./chunk-E66B27AL.mjs";u();import a from"node:path";var b=`${h}
|
|
9
|
+
- project facts (stack/commands): see \`PRJCT.md\``,P=`${l}
|
|
10
|
+
${b}
|
|
11
|
+
${c}
|
|
12
|
+
`;async function T(e){return d(e,"AGENTS.md",P)}s(T,"writeProjectAgentsMd");var D="@PRJCT.md",I=`${l}
|
|
13
|
+
${D}
|
|
14
|
+
${c}
|
|
15
|
+
`;async function y(e){return d(e,"CLAUDE.md",I)}s(y,"writeProjectClaudeMd");import g from"node:fs/promises";import p from"node:path";u();w();C();import m from"node:path";var F=[{id:"agents-md",displayName:"AGENTS.md-compatible agents",kind:"standard",status:"stable",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!1,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Universal project instruction surface shared by current and future coding agents."},{id:"mcp",displayName:"Model Context Protocol clients",kind:"standard",status:"stable",contextFiles:[],supports:{agentsMd:!1,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Universal tool surface for prjct memory, workflow, files, and code intelligence."},{id:"acp",displayName:"Agent Client Protocol clients",kind:"standard",status:"emerging",contextFiles:[],supports:{agentsMd:!1,mcp:!1,skills:!1,hooks:!1,acp:!0,projectRules:!1},notes:"Editor/agent transport for clients such as Zed and other ACP-compatible tools."},{id:"claude",displayName:"Claude Code",kind:"cli",status:"stable",detectsBy:{homeDirs:[".claude"],commands:["claude"]},contextFiles:["CLAUDE.md","AGENTS.md"],mcpTargets:[{format:"claude-json",pathHint:"~/.claude/mcp.json",writable:!0}],supports:{agentsMd:!1,mcp:!0,skills:!0,hooks:!0,acp:!1,projectRules:!0},notes:"Benchmark-tier CLI (2026-07): Claude Code + Opus frontier. CLAUDE.md, skills, hooks, MCP JSON."},{id:"codex",displayName:"OpenAI Codex",kind:"cli",status:"stable",detectsBy:{homeDirs:[".codex"],commands:["codex"]},contextFiles:["AGENTS.md"],mcpTargets:[{format:"codex-toml",pathHint:"~/.codex/config.toml",writable:!0}],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!0,acp:!1,projectRules:!1},notes:"Benchmark-tier CLI (2026-07): Codex + GPT-5.x (TB leader). AGENTS.md, config.toml MCP (native), hooks opt-in (planned installer)."},{id:"gemini",displayName:"Gemini CLI",kind:"cli",status:"stable",detectsBy:{homeDirs:[".gemini"],commands:["gemini"]},contextFiles:["GEMINI.md","AGENTS.md"],mcpTargets:[{format:"claude-json",pathHint:"~/.gemini/settings.json mcpServers",writable:!0}],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!0,acp:!1,projectRules:!0},notes:"Benchmark-tier CLI (2026-07): Gemini CLI + Pro/Flash. GEMINI.md; prjct install writes MCP+hooks to ~/.gemini/settings.json."},{id:"antigravity",displayName:"Google Antigravity",kind:"ide",status:"emerging",detectsBy:{homeDirs:[m.join(".gemini","antigravity")]},contextFiles:["ANTIGRAVITY.md","AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!1,acp:!1,projectRules:!0},notes:"Uses Antigravity skills under the Gemini config tree."},{id:"opencode",displayName:"OpenCode",kind:"cli",status:"stable",detectsBy:{homeDirs:[".config/opencode"],projectDirs:[".opencode"],commands:["opencode"]},contextFiles:["AGENTS.md","opencode.json","opencode.jsonc"],mcpTargets:[{format:"opencode-json",pathHint:"~/.config/opencode/opencode.json mcp.prjct",writable:!0}],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!1,acp:!1,projectRules:!0},notes:"Benchmark-tier open-source CLI (2026-07): most-starred multi-provider agent. AGENTS.md + prjct install writes mcp.prjct; Claude skill/CLAUDE.md compat."},{id:"pi",displayName:"Pi",kind:"cli",status:"stable",detectsBy:{homeDirs:[".pi",m.join(".pi","agent")],projectDirs:[".pi"],commands:["pi"]},contextFiles:["AGENTS.md","CLAUDE.md","SYSTEM.md","APPEND_SYSTEM.md"],supports:{agentsMd:!0,mcp:!1,skills:!0,hooks:!1,acp:!1,projectRules:!1},notes:"Benchmark-tier minimal harness (2026-07): AGENTS.md + prjct skill at ~/.pi/agent/skills/prjct. MCP only via optional extensions \u2014 do not require it."},{id:"qwen-code",displayName:"Qwen Code",kind:"model-runtime",status:"emerging",detectsBy:{homeDirs:[".qwen"],projectDirs:[".qwen"],commands:["qwen"]},contextFiles:["AGENTS.md","GEMINI.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"Qwen-family coding runtime; treat model/provider choice as separate from runtime setup."},{id:"kimi-cli",displayName:"Kimi Code CLI",kind:"model-runtime",status:"emerging",detectsBy:{homeDirs:[".kimi-code",".kimi"],projectDirs:[".kimi"],commands:["kimi"]},contextFiles:["AGENTS.md"],mcpTargets:[{format:"claude-json",pathHint:"~/.kimi-code/mcp.json",writable:!0},{format:"claude-json",pathHint:"~/.kimi/mcp.json (legacy Kimi CLI fallback)",writable:!1}],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!0,acp:!1,projectRules:!1},notes:"Kimi Code CLI (~/.kimi-code; legacy ~/.kimi is fallback-only): native MCP + hooks ([[hooks]] in config.toml) + compact skill at ~/.agents/skills/prjct via prjct install. See harness-surfaces."},{id:"grok",displayName:"xAI Grok Build",kind:"cli",status:"stable",detectsBy:{homeDirs:[".grok"],commands:["grok"]},contextFiles:["AGENTS.md","CLAUDE.md"],mcpTargets:[{format:"codex-toml",pathHint:"~/.grok/config.toml",writable:!0},{format:"claude-json",pathHint:"~/.claude/mcp.json (Grok Claude-compat fallback)",writable:!0}],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!0,acp:!1,projectRules:!1},notes:"Benchmark-tier CLI (2026-07): Grok Build. Native MCP + skill via prjct install (~/.grok/config.toml + ~/.grok/skills/prjct). Hooks still Claude-compat. See harness-surfaces."},{id:"goose",displayName:"Goose",kind:"cli",status:"stable",detectsBy:{homeDirs:[".config/goose"],projectDirs:[".goose"],commands:["goose"]},contextFiles:["AGENTS.md"],mcpTargets:[{format:"generic",pathHint:"Goose extensions",writable:!1}],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Open-source coding agent with extension/MCP-style tool configuration."},{id:"aider",displayName:"Aider",kind:"cli",status:"stable",detectsBy:{projectFiles:[".aider.conf.yml",".aider.conf.yaml"],commands:["aider"]},contextFiles:["AGENTS.md","CONVENTIONS.md"],supports:{agentsMd:!0,mcp:!1,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"CLI pair-programming agent; AGENTS.md provides durable repo instructions."},{id:"cursor",displayName:"Cursor",kind:"ide",status:"stable",detectsBy:{projectDirs:[".cursor"],projectFiles:[".cursorrules"]},contextFiles:["AGENTS.md",".cursor/rules/prjct.mdc"],projectRuleTargets:[{relativePath:".cursor/rules/prjct.mdc",templateKey:"global/CURSOR.mdc",detectPath:".cursor"}],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!0,acp:!1,projectRules:!0},notes:"Benchmark-tier AI IDE (2026-07): agent mode + CLI. Rules under .cursor/rules; prjct install writes ~/.cursor/hooks.json."},{id:"cline",displayName:"Cline",kind:"ide",status:"stable",detectsBy:{projectDirs:[".cline",".clinerules"],projectFiles:[".clinerules"]},contextFiles:["AGENTS.md",".clinerules/"],supports:{agentsMd:!0,mcp:!0,skills:!0,hooks:!0,acp:!0,projectRules:!0},notes:"Benchmark-tier open agent (2026-07): VS Code + multi-model. AGENTS.md, rules, skills, hooks, MCP, ACP."},{id:"roo-code",displayName:"Roo Code",kind:"ide",status:"stable",detectsBy:{projectDirs:[".roo"]},contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"VS Code agent with MCP and project rule surfaces."},{id:"continue",displayName:"Continue",kind:"ide",status:"stable",detectsBy:{projectDirs:[".continue"]},contextFiles:["AGENTS.md"],mcpTargets:[{format:"continue-yaml",pathHint:".continue/mcpServers/",writable:!1}],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"IDE assistant with dedicated MCP server config directory."},{id:"kiro",displayName:"Kiro",kind:"ide",status:"stable",detectsBy:{homeDirs:[".kiro"],projectDirs:[".kiro"]},contextFiles:["AGENTS.md",".kiro/steering/"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!0,acp:!1,projectRules:!0},notes:"Agentic IDE with steering docs and MCP."},{id:"copilot",displayName:"GitHub Copilot coding agent",kind:"hosted",status:"hosted",detectsBy:{projectFiles:[m.join(".github","copilot-instructions.md")]},contextFiles:["AGENTS.md",".github/copilot-instructions.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"GitHub Copilot coding agent / Copilot CLI (2026-07 benchmark field). Repo AGENTS.md + .github instructions + MCP."},{id:"devin",displayName:"Devin",kind:"hosted",status:"hosted",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Hosted coding agent; repo-level AGENTS.md is the safest portable surface."},{id:"jules",displayName:"Google Jules",kind:"hosted",status:"hosted",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!1,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Hosted coding agent; AGENTS.md carries repo-level prjct instructions."},{id:"zed",displayName:"Zed Agent Panel",kind:"ide",status:"stable",detectsBy:{projectDirs:[".zed"]},contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!0,projectRules:!0},notes:"Editor agent surface with ACP support; AGENTS.md remains the repo contract."},{id:"warp",displayName:"Warp",kind:"ide",status:"stable",detectsBy:{homeDirs:[".warp"]},contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Terminal agent surface; AGENTS.md plus MCP covers portable prjct usage."},{id:"amp",displayName:"Amp",kind:"cli",status:"stable",detectsBy:{homeDirs:[".config/amp"],commands:["amp"]},contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Coding agent runtime; AGENTS.md and MCP are the portable contract."},{id:"factory",displayName:"Factory",kind:"hosted",status:"hosted",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Hosted/agentic development platform; repo instructions are the stable surface."},{id:"augment",displayName:"Augment",kind:"ide",status:"stable",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"IDE agent; universal project instructions avoid model-specific coupling."},{id:"kilo-code",displayName:"Kilo Code",kind:"ide",status:"stable",detectsBy:{projectDirs:[".kilocode"]},contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!0,skills:!1,hooks:!1,acp:!1,projectRules:!0},notes:"Agent runtime in the Cline/Roo family; AGENTS.md and MCP keep it compatible."},{id:"phoenix",displayName:"Phoenix",kind:"hosted",status:"hosted",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!1,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Hosted coding agent; AGENTS.md is the repo-level bridge."},{id:"ona",displayName:"Ona",kind:"hosted",status:"hosted",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!1,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Hosted coding agent; AGENTS.md is the repo-level bridge."},{id:"semgrep",displayName:"Semgrep assistant",kind:"hosted",status:"hosted",contextFiles:["AGENTS.md"],supports:{agentsMd:!0,mcp:!1,skills:!1,hooks:!1,acp:!1,projectRules:!1},notes:"Security/review agent surface; AGENTS.md carries project workflow guidance."}];function N(){return F.flatMap(e=>e.projectRuleTargets??[])}s(N,"listProjectRuleTargets");u();G();async function v(e){let t=A(e);return t||g.readFile(p.join(R,"templates",e),"utf-8")}s(v,"loadTemplate");async function B(e,t,n){let o=p.join(e,t);await g.mkdir(p.dirname(o),{recursive:!0}),await g.writeFile(o,await v(n),"utf-8")}s(B,"writeRule");async function E(e,t={}){let n=new Set(t.agents??[]),o=[];for(let i of N())(n.has(i.relativePath.split("/")[0].replace(/^\./,""))||i.detectPath&&await r(p.join(e,i.detectPath)))&&(await B(e,i.relativePath,i.templateKey),o.push(i.relativePath));return{written:o}}s(E,"writeProjectIdeRules");async function L(e){let[t,n,o]=await Promise.all([r(a.join(e,"PRJCT.md")),r(a.join(e,"AGENTS.md")),r(a.join(e,"CLAUDE.md"))]);return t||n||o}s(L,"hasAdoptedSurfaces");async function ge(e,t={}){if(!(t.explicit||t.refreshIfAdopted&&await L(e)))return{prjctMd:{action:"unchanged",path:a.join(e,"PRJCT.md")},agentsMd:{action:"unchanged",path:a.join(e,"AGENTS.md")},ideRules:[]};let o=new Set(t.agents??[]),i=await r(a.join(e,"CLAUDE.md")),f=o.has("claude")||i,[M,S,k,x]=await Promise.all([j(e),T(e),f?y(e):void 0,E(e,t)]);return{prjctMd:M,agentsMd:S,...k?{claudeMd:k}:{},ideRules:x.written}}s(ge,"writeProjectAgentSurfaces");export{ge as a};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as x}from"./chunk-SJ75V4WG.mjs";import{d as M}from"./chunk-
|
|
8
|
+
import{b as x}from"./chunk-SJ75V4WG.mjs";import{d as M}from"./chunk-C4O243NG.mjs";import{a as f}from"./chunk-V2FR2NPL.mjs";import{a as C}from"./chunk-QP5USCDX.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var q=new Set(["pattern-detector-auto","pattern-detector-recurring","skill-miss-detector","friction-detector"]);function E(t){if(t.type==="improvement-signal")return!0;let e=t.tags?.source;return e!==void 0&&q.has(e)}o(E,"isSignalEntry");var R=85,S=2;async function K(t,e,n={}){let a=n.threshold??R,d=n.maxIterations??S,i=await import("./retention-C3NQT65W.mjs").then(({evaluateRetention:s})=>s(e,Date.now()).byId).catch(()=>null),h=o(async(s,c,g,m)=>{if(s>=d||c.score>=a)return{...c,irrelevantRemoved:g,repairEntriesCreated:m};let r=f.allEntriesForIndex(e),p=r.filter(l=>{if(!w(l))return!1;let b=i?.get(l.id);return!(b&&b.verdict==="active"&&b.score>=70)}),u=I(r)?0:1;u>0&&await f.remember(t,{type:"context",content:_(r,c),tags:{context_schema:"living-v2",synthesis:"model-authored",feature:"context-quality-cleanup",key_data:`quality_score=${c.score}; threshold=${a}; irrelevant=${p.length}`,model:"prjct sync context-quality analyzer",token_usage:"0 deterministic sync tokens",source:"sync-context-quality"},provenance:"inferred",projectId:e});let y=[];for(let l of p)f.forget(e,l.id)&&(y.push(l.id),await C({projectId:e,entityType:"memories",entityId:l.id,eventType:"delete",data:{id:l.id,type:l.type,content:l.content,tags:l.tags,reason:"context-quality-cleanup"}}));let $={...k(e,a),iterations:s+1,irrelevantRemoved:g+y.length,repairEntriesCreated:m+u};return p.length===0&&u===0?$:h(s+1,$,g+y.length,m+u)},"repairIteration");return h(0,k(e,a),0,0)}o(K,"repairContextQuality");function k(t,e=R){let n=f.allEntriesForIndex(t),a=n.filter(r=>r.type==="context"),d=a.filter(v),i=a.filter(r=>!v(r)),h=n.filter(w),s=[],c=[];n.length>0&&d.length===0&&(c.push(35),s.push("missing living-v2 context synthesis")),h.length>0&&(c.push(Math.min(40,h.length*8)),s.push(`${h.length} irrelevant generated entries in active context`)),i.length>0&&(c.push(Math.min(20,i.length*5)),s.push(`${i.length} legacy context entries need cleanup`));let g=d[0];if(g){let r=x(g.content),u=[r.contextSynthesis,r.keyData,r.model,r.tokenUsage,r.nextImplication].filter(y=>!y).length;u>0&&(c.push(u*4),s.push("latest living context is missing structured UI/LLM fields"))}let m=Math.max(0,Math.min(100,100-c.reduce((r,p)=>r+p,0)));return{score:m,threshold:e,passed:m>=e,iterations:0,livingContextCount:d.length,legacyContextCount:i.length,irrelevantRemoved:0,repairEntriesCreated:0,issues:s}}o(k,"evaluateContextQuality");function w(t){return E(t)?!0:t.tags?.source==="sync-context-quality"||t.type!=="context"||v(t)?!1:L(t)}o(w,"isIrrelevantGeneratedContext");function v(t){if(t.tags?.context_schema==="living-v2")return!0;let e=x(t.content);return!!(e.contextSynthesis&&e.keyData)}o(v,"isLivingV2Context");function I(t){return t.some(e=>e.type==="context"&&v(e))}o(I,"hasUsableLivingContext");function L(t){let e=t.content.trim();if(e.length<260||/User pushback:|raw quote|transcript|hot file|skill-miss/i.test(e))return!0;let n=x(e);return[n.whatHappened,n.whyItMattered,n.pattern,n.antiPattern,n.outcome,n.nextImplication].filter(Boolean).length<3}o(L,"isLowValueLegacyContext");function _(t,e){let n=t.filter(i=>!w(i)).filter(i=>["decision","gotcha","learning","context","shipped"].includes(i.type)).slice(0,8),a=n.length>0?n.map(i=>`${i.type}:${M(i)}`).join("; "):"No high-quality prior context survived cleanup.";return["Context synthesis: Sync repaired historical low-quality project context by removing generated telemetry and preserving the useful project knowledge as a living-v2 synthesis. Future agents should trust this synthesized layer over old raw detector rows or legacy context snippets.",`Key data: ${[`quality_score=${e.score}`,`threshold=${e.threshold}`,`legacy_context=${e.legacyContextCount}`,`issues=${e.issues.join("|")||"none"}`].join("; ")}`,"What happened: prjct sync detected that active context quality was below the required threshold and generated a replacement synthesis before deleting irrelevant generated entries.","Why it mattered: Existing users had accumulated low-signal context over time; leaving it active makes the second brain noisy for both the UI and LLM retrieval.","Who/author: prjct sync","Model: prjct sync context-quality analyzer","Token usage: 0 deterministic sync tokens","Sentiment: cleanup required because raw generated context had become product debt","Related files: generated from existing project memory during sync","Feature/domain: context-quality-cleanup","Pattern: Keep structured key data for UI representation and synthesized context for humans/LLMs.","Anti-pattern: Surfacing raw detector rows, hot-file counters, or short legacy snippets as durable project knowledge.","Decision/trap: Generated garbage is hard-deleted from active recall/vault/search; user-authored decisions, gotchas, learnings, and facts are preserved.",`Outcome: Repair synthesis created from surviving highlights: ${a}`,"Next implication: If quality remains below threshold, run full sync/analysis and inspect remaining user-authored entries manually instead of deleting them blindly."].join(" \xB7 ")}o(_,"buildRepairContext");export{K as a,w as b};
|
|
@@ -5,5 +5,5 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f}from"./chunk-
|
|
8
|
+
import{a as f}from"./chunk-3WQBTXUC.mjs";import{b as m}from"./chunk-QP5USCDX.mjs";import{d as r,g}from"./chunk-UHVYBU7F.mjs";import{a as i}from"./chunk-E66B27AL.mjs";g();var _=["hook","gate","step","instruction"];function d(o){let t=o.trust_source==="imported"?"imported":"local",e=_.includes(o.type)?o.type:"step";return{id:o.id,type:e,command:o.command,position:o.position,action:o.action,description:o.description,enabled:o.enabled===1,timeoutMs:o.timeout_ms,createdAt:o.created_at,sortOrder:o.sort_order,whenExpr:o.when_expr??null,parallel:o.parallel===null?!0:o.parallel===1,trustSource:t}}i(d,"rowToRule");var p=class{static{i(this,"WorkflowRuleStorage")}addRule(t,e){let n=r.get(t,"SELECT MAX(sort_order) as m FROM workflow_rules WHERE command = ?",e.command),u=e.sortOrder||(n?.m??-1)+1;r.run(t,`INSERT INTO workflow_rules (type, command, position, action, description, enabled, timeout_ms, created_at, sort_order, when_expr, parallel, trust_source)
|
|
9
9
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,e.type,e.command,e.position,e.action,e.description??null,e.enabled?1:0,e.timeoutMs,e.createdAt,u,e.whenExpr??null,e.parallel===!1?0:1,e.trustSource??"local");let l=r.get(t,"SELECT last_insert_rowid() as id")?.id??0;return l>0&&m({projectId:t,entityType:"workflow_rules",entityId:String(l),eventType:"upsert",data:{id:l,type:e.type,command:e.command,position:e.position,action:e.action,description:e.description??null,enabled:e.enabled?1:0,timeout_ms:e.timeoutMs,sort_order:u,when_expr:e.whenExpr??null,parallel:e.parallel===!1?0:1,trust_source:e.trustSource??"local",created_at:e.createdAt}}),l}removeRule(t,e){return r.get(t,"SELECT id FROM workflow_rules WHERE id = ?",e)?(r.run(t,"DELETE FROM workflow_rules WHERE id = ?",e),m({projectId:t,entityType:"workflow_rules",entityId:String(e),eventType:"delete",data:{id:e}}),!0):!1}updateRule(t,e,n){if(!r.get(t,"SELECT id FROM workflow_rules WHERE id = ?",e))return!1;let w={type:{column:"type"},command:{column:"command"},position:{column:"position"},action:{column:"action"},description:{column:"description"},enabled:{column:"enabled",transform:i(s=>s?1:0,"transform")},timeoutMs:{column:"timeout_ms"},createdAt:{column:"created_at"},sortOrder:{column:"sort_order"},whenExpr:{column:"when_expr"},parallel:{column:"parallel",transform:i(s=>s===!1?0:1,"transform")},trustSource:{column:"trust_source"}},l=[],c=[];for(let[s,E]of Object.entries(n)){let a=w[s];if(!a)continue;l.push(`${a.column} = ?`);let R=E;c.push(a.transform?a.transform(R):R)}return l.length===0||(c.push(e),r.run(t,`UPDATE workflow_rules SET ${l.join(", ")} WHERE id = ?`,...c)),!0}getRuleById(t,e){let n=r.get(t,"SELECT * FROM workflow_rules WHERE id = ?",e);return n?d(n):null}getRulesForCommand(t,e){let n=f.getWorkflow(t,e);return!n||!n.enabled?[]:r.query(t,"SELECT * FROM workflow_rules WHERE command = ? AND enabled = 1 ORDER BY sort_order ASC",e).map(d)}getAllRules(t){return r.query(t,"SELECT * FROM workflow_rules ORDER BY command ASC, sort_order ASC").map(d)}resetRules(t){let e=r.get(t,"SELECT COUNT(*) as c FROM workflow_rules");return r.run(t,"DELETE FROM workflow_rules"),e?.c??0}},S=new p;export{S as a};
|
|
@@ -5,9 +5,9 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as u}from"./chunk-3FBCOCPD.mjs";import{a as N,b as f}from"./chunk-
|
|
8
|
+
import{b as u}from"./chunk-3FBCOCPD.mjs";import{a as N,b as f}from"./chunk-PO3QDKTE.mjs";import{q as E,u as _,v as T,w as S}from"./chunk-A6K4H3YT.mjs";import{n as I,o as P}from"./chunk-UH4MD3F3.mjs";import{a as A}from"./chunk-PKDYFXMI.mjs";import{a as y,e as $,f as O}from"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";import i from"chalk";_();import m from"chalk";var j=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],x=80,v={name:"prjct",icon:"\u26A1",signature:"\u26A1 prjct",spinner:{frames:j,speed:x},cli:{header:c(()=>`${m.cyan.bold("\u26A1")} ${m.cyan("prjct")}`,"header"),footer:c(()=>m.dim("\u26A1 prjct"),"footer"),spin:c((e,t)=>`${m.cyan("\u26A1")} ${m.cyan("prjct")} ${m.cyan(j[e%10])} ${m.dim(t||"")}`,"spin")},template:{header:"\u26A1 prjct",footer:"\u26A1 prjct"},commitFooter:"Generated with [p/](https://www.prjct.app/)",urls:{website:"https://prjct.app",docs:"https://prjct.app/docs"},getCommitFooter:c((e="claude")=>E(e).commitFooter,"getCommitFooter"),getSignature:c((e="claude")=>E(e).signature,"getSignature")},l=v;var w={NO_PROJECT:{message:"No prjct project found in this directory",hint:"Run 'prjct init' to set up a new project",file:".prjct/prjct.config.json"},NO_PROJECT_ID:{message:"Project ID not found",hint:"Run 'prjct init' or check .prjct/prjct.config.json",file:".prjct/prjct.config.json"},CONFIG_NOT_FOUND:{message:"Configuration file not found",hint:"Run 'prjct init' to create project configuration",file:".prjct/prjct.config.json"},CONFIG_INVALID:{message:"Invalid configuration file",hint:"Check JSON syntax or delete .prjct/ and run init again",file:".prjct/prjct.config.json"},GIT_NOT_FOUND:{message:"Git repository not detected",hint:"Run 'git init' first, then 'prjct init'"},GIT_NO_COMMITS:{message:"No commits in repository",hint:"Make an initial commit before using prjct"},GIT_DIRTY:{message:"Working directory has uncommitted changes",hint:"Commit or stash changes, or use '--force' to override"},GIT_ON_MAIN:{message:"Cannot ship from main/master branch",hint:"Create a feature branch first: git checkout -b feature/your-feature"},GIT_OPERATION_FAILED:{message:"Git operation failed",hint:"Check git status and resolve any conflicts"},GH_NOT_AUTHENTICATED:{message:"GitHub CLI not authenticated",hint:"Run 'gh auth login' to authenticate",docs:"https://cli.github.com/manual/gh_auth_login"},LINEAR_NOT_CONFIGURED:{message:"Linear integration not configured",hint:"Configure the Linear MCP server in your AI client"},LINEAR_API_ERROR:{message:"Linear API error",hint:"Check your API key or network connection"},NO_ACTIVE_TASK:{message:"No active work cycle",hint:`Start work with 'p. work "intent"'`},TASK_ALREADY_ACTIVE:{message:"A work cycle is already in progress",hint:"Use 'p. work' to inspect it or ship when complete"},SYNC_FAILED:{message:"Project sync failed",hint:"Check file permissions and try again"},NOTHING_TO_SHIP:{message:"Nothing to ship",hint:"Make some changes first, then run ship"},PR_CREATE_FAILED:{message:"Failed to create pull request",hint:"Check GitHub auth and remote configuration"},NO_AI_PROVIDER:{message:"No AI provider detected",hint:"Install Claude Code or Gemini CLI, then run 'prjct start'",docs:"https://prjct.app/docs"},PROVIDER_NOT_CONFIGURED:{message:"AI provider not configured for prjct",hint:"Run 'prjct start' to configure your provider"},UNKNOWN_COMMAND:{message:"Unknown command",hint:"Run 'prjct --help' to see available commands"},MISSING_PARAM:{message:"Missing required parameter",hint:"Check command usage below"},UNKNOWN:{message:"An unexpected error occurred",hint:"Check the error details and try again"}};function R(e,t){return{...w[e],...t}}c(R,"getError");var b=l.spinner.speed,L={silent:{maxLines:0,maxCharsPerLine:0,showMetrics:!1},minimal:{maxLines:1,maxCharsPerLine:65,showMetrics:!1},compact:{maxLines:4,maxCharsPerLine:80,showMetrics:!0},verbose:{maxLines:1/0,maxCharsPerLine:1/0,showMetrics:!0}},s={currentTier:"compact",interval:null,frame:0,quietMode:!1};function k(){return L[s.currentTier]}c(k,"getTierConfig");var h={success:i.green("\u2713"),fail:i.red("\u2717"),warn:i.yellow("\u26A0"),info:i.blue("\u2139"),debug:i.dim("\u{1F527}"),bullet:i.dim("\u2022"),arrow:i.dim("\u2192"),check:i.green("\u2713"),cross:i.red("\u2717"),spinner:i.cyan("\u25D0")};var g=c((e,t)=>{if(!process.stdout.isTTY&&!process.stderr.isTTY)return e||"";let r=t??(k().maxCharsPerLine||u.FALLBACK_TRUNCATE);return e&&e.length>r?`${e.slice(0,r-1)}\u2026`:e||""},"truncate");var G=c(()=>process.stdout.isTTY?process.stdout.write(`\r${" ".repeat(u.CLEAR_WIDTH)}\r`):!0,"clear"),D={start(){return s.quietMode||console.log(l.cli.header()),this},end(){return s.quietMode||console.log(l.cli.footer()),this},spin(e){return s.quietMode?this:(this.stop(),process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,g(e,u.SPINNER_MSG))}`)},b),this):(process.stdout.write(`${l.cli.spin(0,g(e,u.SPINNER_MSG))}
|
|
9
9
|
`),this))},done(e,t){if(this.stop(),!s.quietMode){let r=[];t?.agents!==void 0&&r.push(`${t.agents}a`),t?.reduction!==void 0&&r.push(`${t.reduction}%`),t?.tokens!==void 0&&r.push(`${Math.round(t.tokens)}K`);let o=r.length>0?i.dim(` [${r.join(" | ")}]`):"";console.log(`${h.success} ${g(e,u.DONE_MSG)}${o}`)}return this},fail(e){return this.stop(),console.error(`${h.fail} ${g(e,u.FAIL_MSG)}`),this},failWithHint(e){this.stop();let t=typeof e=="string"?R(e):e;return console.error(),console.error(`${h.fail} ${t.message}`),t.file&&console.error(i.dim(` File: ${t.file}`)),t.hint&&console.error(i.yellow(` \u{1F4A1} ${t.hint}`)),t.docs&&console.error(i.dim(` Docs: ${t.docs}`)),console.error(),this},warn(e){return this.stop(),s.quietMode||console.log(`${h.warn} ${g(e,u.WARN_MSG)}`),this},info(e){return this.stop(),s.quietMode||console.log(`${h.info} ${e}`),this},debug(e){this.stop();let t=process.env.DEBUG==="1"||process.env.DEBUG==="true";return!s.quietMode&&t&&console.log(`${h.debug} ${i.dim(e)}`),this},success(e,t){return this.done(e,t)},list(e,t={}){if(this.stop(),s.quietMode)return this;let r=t.bullet||h.bullet,o=" ".repeat(t.indent||0);for(let n of e)console.log(`${o}${r} ${n}`);return this},table(e,t={}){if(this.stop(),s.quietMode||e.length===0)return this;let r=Object.keys(e[0]),o={};for(let n of r){o[n]=n.length;for(let a of e){let p=String(a[n]??"");p.length>o[n]&&(o[n]=p.length)}}if(t.header!==!1){let n=r.map(a=>a.padEnd(o[a])).join(" ");console.log(i.dim(n)),console.log(i.dim("\u2500".repeat(n.length)))}for(let n of e){let a=r.map(p=>String(n[p]??"").padEnd(o[p])).join(" ");console.log(a)}return this},box(e,t){if(this.stop(),s.quietMode)return this;let r=t.split(`
|
|
10
10
|
`),o=Math.max(e.length,...r.map(a=>a.length)),n="\u2500".repeat(o+2);console.log(i.dim(`\u250C${n}\u2510`)),console.log(`${i.dim("\u2502")} ${i.bold(e.padEnd(o))} ${i.dim("\u2502")}`),console.log(i.dim(`\u251C${n}\u2524`));for(let a of r)console.log(`${i.dim("\u2502")} ${a.padEnd(o)} ${i.dim("\u2502")}`);return console.log(i.dim(`\u2514${n}\u2518`)),this},section(e){return this.stop(),s.quietMode?this:(console.log(`
|
|
11
11
|
${i.bold(e)}`),console.log(i.dim("\u2500".repeat(e.length))),this)},stop(){return s.interval&&(clearInterval(s.interval),s.interval=null,G()),this},step(e,t,r){if(s.quietMode)return this;this.stop();let o=i.dim(`[${e}/${t}]`);return process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,`${o} ${g(r,u.STEP_MSG)}`)}`)},b),this):(process.stdout.write(`${l.cli.spin(0,`${o} ${g(r,u.STEP_MSG)}`)}
|
|
12
12
|
`),this)},progress(e,t,r){if(s.quietMode)return this;this.stop();let o=Math.round(e/t*100),n=Math.round(o/10),a=10-n,p=i.cyan("\u2588".repeat(n))+i.dim("\u2591".repeat(a)),d=r?` ${g(r,u.PROGRESS_TEXT)}`:"";return process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,`[${p}] ${o}%${d}`)}`)},b),this):(process.stdout.write(`${l.cli.spin(0,`[${p}] ${o}%${d}`)}
|
|
13
|
-
`),this)}},M=D;S();O();P();var C=class{static{c(this,"ProjectService")}currentAuthor=null;async ensureInit(t){if(await f.isConfigured(t))return{success:!0};try{let{worktreeService:a}=await import("./worktree-service-AS7JVBK5.mjs");if(await a.detect(t)){let d=await a.getMainWorktree(t);if(d&&d!==t&&await f.isConfigured(d))return await a.setup(t,d),{success:!0}}}catch{}M.spin("initializing project...");let{PlanningCommands:r}=await import("./planning-
|
|
13
|
+
`),this)}},M=D;S();O();P();var C=class{static{c(this,"ProjectService")}currentAuthor=null;async ensureInit(t){if(await f.isConfigured(t))return{success:!0};try{let{worktreeService:a}=await import("./worktree-service-AS7JVBK5.mjs");if(await a.detect(t)){let d=await a.getMainWorktree(t);if(d&&d!==t&&await f.isConfigured(d))return await a.setup(t,d),{success:!0}}}catch{}M.spin("initializing project...");let{PlanningCommands:r}=await import("./planning-M3RAOZVB.mjs"),n=await new r().init(null,t);return n.success?{success:!0}:n}async getProjectId(t){let r=await f.getProjectId(t);if(!r)throw A.notInitialized();return r}async getGlobalPath(t){let r=await this.getProjectId(t);return await T.ensureProjectStructure(r),T.getGlobalProjectPath(r)}async ensureAuthor(){if(this.currentAuthor)return this.currentAuthor;let t=await N();return this.currentAuthor={name:t.name??void 0,email:t.email??void 0,github:t.github??void 0},this.currentAuthor}getCurrentAuthor(){return this.currentAuthor}clearAuthorCache(){this.currentAuthor=null}async isEmptyDirectory(t){try{return(await I(t)).filter(n=>!n.startsWith(".")&&n!=="node_modules"&&n!=="package.json"&&n!=="package-lock.json"&&n!=="README.md").length===0}catch(r){return y(r)||console.error(`Directory check error: ${$(r)}`),!0}}async hasExistingCode(t){try{let r=["src","lib","app","components","pages","api","main.go","main.rs","main.py"];return(await I(t)).some(n=>r.includes(n))}catch(r){return y(r)||console.error(`Code check error: ${$(r)}`),!1}}async isConfigured(t){return await f.isConfigured(t)}async needsMigration(t){return await f.needsMigration(t)}},F=new C,ct=F;export{M as a,F as b,ct as c};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as t}from"./chunk-
|
|
8
|
+
import{c as t}from"./chunk-4HAKTI36.mjs";import{a as e}from"./chunk-E66B27AL.mjs";async function f(r,o,i){if(i.length!==0)try{let{resolveActiveTask:s}=await import("./task-service-PXCDU55T.mjs"),c=await s(r,o);c?.id&&t.recordSurfaced(r,i,c.id);for(let n of i)t.recordFetch(r,n)}catch{}}e(f,"recordSurfacedForActiveTask");export{f as a};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as y,b as N}from"./chunk-KEJ5RMAI.mjs";import{b as u}from"./chunk-
|
|
8
|
+
import{a as y,b as N}from"./chunk-KEJ5RMAI.mjs";import{b as u}from"./chunk-PO3QDKTE.mjs";import{f as d,h as l,k as m,o as j}from"./chunk-UH4MD3F3.mjs";import{b as f,c as g,d as p,e as k}from"./chunk-SYHDEUVU.mjs";import{a}from"./chunk-E66B27AL.mjs";j();import c from"node:path";var P=[{scriptName:"typecheck",kind:"typecheck"},{scriptName:"lint",kind:"lint"},{scriptName:"test",kind:"test"},{scriptName:"build",kind:"build"},{scriptName:"dev",kind:"dev"},{scriptName:"format",kind:"format"}],A=[{file:"bun.lock",manager:"bun"},{file:"bun.lockb",manager:"bun"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];async function R(t){for(let{file:n,manager:e}of A)if(await m(c.join(t,n)))return e;return null}a(R,"detectPackageManager");async function w(t){let n=c.join(t,"package.json");if(!await m(n))return[];let r=(await d(n,null))?.scripts??{};return P.filter(({scriptName:i})=>!!r[i]).map(({scriptName:i,kind:o})=>{let s=r[i];return{scriptName:i,command:s,kind:o,mutating:S(s)}})}a(w,"detectNodeCommands");async function M(t){return await m(c.join(t,"Cargo.toml"))?[{scriptName:"test",command:"cargo test",kind:"test",mutating:!1},{scriptName:"build",command:"cargo build",kind:"build",mutating:!1},{scriptName:"lint",command:"cargo clippy",kind:"lint",mutating:!1},{scriptName:"format",command:"cargo fmt",kind:"format",mutating:!0}]:[]}a(M,"detectCargoCommands");async function _(t){return await m(c.join(t,"go.mod"))?[{scriptName:"test",command:"go test ./...",kind:"test",mutating:!1},{scriptName:"build",command:"go build ./...",kind:"build",mutating:!1},{scriptName:"format",command:"gofmt -l .",kind:"format",mutating:!1}]:[]}a(_,"detectGoCommands");var h=[{marker:/\[tool\.pytest\b/,scriptName:"test",command:"pytest",kind:"test",mutating:!1},{marker:/\[tool\.ruff\b/,scriptName:"lint",command:"ruff check .",kind:"lint",mutating:!1},{marker:/\[tool\.black\b/,scriptName:"format",command:"black .",kind:"format",mutating:!0},{marker:/\[tool\.mypy\b/,scriptName:"typecheck",command:"mypy .",kind:"typecheck",mutating:!1}];async function V(t){let n=c.join(t,"pyproject.toml");if(!await m(n))return[];let e=await l(n,"");return h.filter(({marker:r})=>r.test(e)).map(({marker:r,...i})=>i)}a(V,"detectPythonCommands");async function C(t){let[n,e,r,i,o]=await Promise.all([w(t),M(t),_(t),V(t),R(t)]);return{packageManager:o,commands:[...n,...e,...r,...i]}}a(C,"detectVerifiedCommands");var T=/^(?:--fix|--write|--update|-w|--fix-type)$/,E=new Set(["migrate","push","publish","deploy","release","commit"]);function S(t){for(let n of y(t)){let e=N(n);if(e.some(r=>T.test(r))||e.some(r=>E.has(r.toLowerCase())))return!0}return!1}a(S,"classifyCommandMutation");var x=6,O=3,I=80;function G(t){let n=new Set;return t.filter(e=>n.has(e.kind)?!1:(n.add(e.kind),!0))}a(G,"dedupeByKind");function K(t,n){let e=t.replace(/\s+/g," ").trim();return e.length>n?`${e.slice(0,n-1)}\u2026`:e}a(K,"truncate");async function L(t){try{let n=await u.getProjectId(t),{getActiveProjectStyle:e}=await import("./project-style-evolution-RPGATIYJ.mjs"),r=e(n);if(!r)return null;let i=r.payload.stack,o=[i.ecosystem&&i.ecosystem!=="unknown"?i.ecosystem:null,i.languages.slice(0,O).join(", ")||null,i.frameworks.slice(0,x).join(", ")||null].filter(s=>!!s);return o.length>0?o.join(" \xB7 "):null}catch{return null}}a(L,"buildStackLine");async function b(t){let[n,e]=await Promise.all([L(t),C(t)]),r=G(e.commands);if(!n&&r.length===0)return null;let i=[];n&&i.push(`- stack: ${n}`);for(let o of r){let s=o.mutating?"mutating":"read-only";i.push(`- ${o.kind}: \`${K(o.command,I)}\` (${s})`)}return i.push("- deeper: `prjct context --md` \xB7 `prjct_analysis` MCP \xB7 `prjct_relevant_files` MCP"),i.join(`
|
|
9
9
|
`)}a(b,"buildProjectFactsSection");async function $(t){let n=await b(t),e=[p];return n&&e.push("","## This project",n),e.join(`
|
|
10
10
|
`)}a($,"buildPrjctMdBody");async function J(t){let n=await $(t),e=`${f}
|
|
11
11
|
${n}
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as p}from"./chunk-3FBCOCPD.mjs";import{c as d}from"./chunk-
|
|
8
|
+
import{a as p}from"./chunk-3FBCOCPD.mjs";import{c as d}from"./chunk-XDBJSJOT.mjs";import{a as l}from"./chunk-E66B27AL.mjs";var k={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"};function y(c){if(c)return k[c]}l(y,"toCloudTable");var w={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"},f={memories:!0,tasks:!0,ideas:!0,shipped:!0,workflows:!0,metrics:!0,archives:!0,user_prompts:!1,agent_sessions:!1,analysis:!0,specs:!0};function T(c,e){let t=w[c];return t?{...f,...e??{}}[t]!==!1:!0}l(T,"isTableIncluded");var v=Object.keys(f);function _(c){return c.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}l(_,"camelToSnake");function R(c){let e={};for(let[t,s]of Object.entries(c))e[_(t)]=s;return e}l(R,"snakeCaseKeys");function E(c,e){let[t,s]=e.type.split("."),r=y(e.entityType)??y(t);if(!r)return null;let i=e.eventType==="delete"||s==="deleted"||s==="archived"||s==="removed"?"delete":"upsert",n=e.data||{},a=R(n),h=e.entityId||(typeof a.id=="string"?a.id:"")||(typeof n.id=="string"?n.id:"")||(typeof a.task_id=="string"?a.task_id:"")||(typeof n.taskId=="string"?n.taskId:"")||(typeof a.entity_id=="string"?a.entity_id:"")||"";h&&a.id==null&&(a.id=h);let u={event_type:i,entity_type:r,entity_id:h,data:{...a,project_id:c},project_id:c};return e.originDeviceId!==void 0&&(u.origin_device_id=e.originDeviceId),e.contentHash!==void 0&&(u.content_hash=e.contentHash),e.revisionCount!==void 0&&(u.revision_count=e.revisionCount),e.timestamp&&(u.ts=e.timestamp),u}l(E,"mapCliEventToWebFormat");function g(c,e){return e.map(t=>E(c,t)).filter(t=>t!==null)}l(g,"mapCliEventsToWebFormat");var m=class{static{l(this,"SyncClient")}retryConfig={maxRetries:3,baseDelayMs:1e3,maxDelayMs:3e4};async pushEvents(e,t){let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)throw this.createError("AUTH_REQUIRED","No API key configured");let i=g(e,t),n=await this.fetchWithRetry(`${s}/sync/batch`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(r,o)},body:JSON.stringify({projectId:e,events:i})});if(!n.ok)throw await this.parseErrorResponse(n);return await n.json()}async pullEvents(e,t,s){let{apiUrl:r,apiKey:o,deviceId:i}=await this.getAuthHeaders();if(!o)throw this.createError("AUTH_REQUIRED","No API key configured");let n={projectId:e};typeof t=="number"&&t>0&&(n.sinceEventId=t);let a=await this.fetchWithRetry(`${r}/sync/pull`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(o,i)},body:JSON.stringify(n)});if(!a.ok)throw await this.parseErrorResponse(a);return await a.json()}async getStatus(e){let{apiUrl:t,apiKey:s,deviceId:r}=await this.getAuthHeaders();if(!s)throw this.createError("AUTH_REQUIRED","No API key configured");let o=await this.fetchWithRetry(`${t}/sync/status/${e}`,{method:"GET",headers:{...this.authHeaders(s,r)}});if(!o.ok)throw await this.parseErrorResponse(o);return await o.json()}async linkProject(e,t,s){let{apiUrl:r,apiKey:o,deviceId:i}=await this.getAuthHeaders();if(!o)throw this.createError("AUTH_REQUIRED","No API key configured");let n=await this.fetchWithRetry(`${r}/sync/link`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(o,i)},body:JSON.stringify({projectId:e,...t?{name:t}:{},...s?{meta:s}:{}})});if(!n.ok)throw await this.parseErrorResponse(n);return await n.json()}async setCloudLifecycle(e,t){try{let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();return r?(await this.fetchWithRetry(`${s}/sync/projects/${e}/${t}`,{method:"POST",headers:{...this.authHeaders(r,o)}})).ok:!1}catch{return!1}}async uploadCodeGraph(e,t){try{let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)return{ok:!1,reason:"unauthenticated"};let i=await this.fetchWithRetry(`${s}/sync/projects/${e}/code-graph`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(r,o)},body:JSON.stringify(t)});if(!i.ok)return{ok:!1,reason:await(async()=>{let h=`${i.status} ${i.statusText}`;try{let u=await i.json();return typeof u.detail=="string"?u.detail:u.detail!=null?JSON.stringify(u.detail).slice(0,300):h}catch{return h}})()};let n=await i.json();return{ok:n.ok!==!1,nodes:n.nodes,links:n.links}}catch(s){return{ok:!1,reason:s instanceof Error?s.message:String(s)}}}async publishBenchmark(e,t){let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)throw this.createError("AUTH_REQUIRED","No API key configured");let i=await this.fetchWithRetry(`${s}/benchmarks/evals`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(r,o)},body:JSON.stringify({projectId:e,...t})});if(!i.ok)throw await this.parseErrorResponse(i);return await i.json()}async testConnection(){let e=new AbortController,t=setTimeout(()=>e.abort(),p("API_REQUEST"));try{let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)return clearTimeout(t),!1;let i=await fetch(`${s}/auth/verify`,{method:"GET",headers:{...this.authHeaders(r,o)},signal:e.signal});return clearTimeout(t),i.status===401||i.status===403?(await d.clearAuth(),!1):i.ok}catch{return clearTimeout(t),!1}}async hasAuth(){return await d.hasAuth()}async getAuthHeaders(){let[e,t,s]=await Promise.all([d.getApiUrl(),d.getApiKey(),d.getDeviceId()]);return{apiUrl:e,apiKey:t,deviceId:s}}authHeaders(e,t){return{"X-Api-Key":e,"X-Device-Id":t}}async fetchWithRetry(e,t,s=0){let r=new AbortController,o=setTimeout(()=>r.abort(),p("API_REQUEST")),i=(t.method??"GET").toUpperCase(),n=i==="GET"||i==="HEAD";try{let a=await fetch(e,{...t,signal:r.signal});return clearTimeout(o),n&&a.status>=500&&s<this.retryConfig.maxRetries?this.scheduleRetry(e,t,s):a}catch(a){if(clearTimeout(o),a instanceof Error&&a.name==="AbortError")throw this.createError("NETWORK_ERROR",`Request timed out. Try increasing PRJCT_TIMEOUT_API_REQUEST (current: ${p("API_REQUEST")}ms)`);if(n&&s<this.retryConfig.maxRetries)return this.scheduleRetry(e,t,s);throw this.createError("NETWORK_ERROR",a instanceof Error?a.message:"Network request failed")}}async scheduleRetry(e,t,s){let r=Math.min(this.retryConfig.baseDelayMs*2**s,this.retryConfig.maxDelayMs);return await this.sleep(r),this.fetchWithRetry(e,t,s+1)}async parseErrorResponse(e){try{let t=await e.json(),s=t.detail||t.message||t.error||`HTTP ${e.status}`;return e.status===401||e.status===403?(await d.clearAuth(),this.createError("AUTH_REQUIRED",s,e.status)):e.status===402?this.createError("PAYMENT_REQUIRED",s,e.status):this.createError("API_ERROR",s,e.status)}catch{return e.status===401||e.status===403?(await d.clearAuth(),this.createError("AUTH_REQUIRED",`HTTP ${e.status}`,e.status)):this.createError("API_ERROR",`HTTP ${e.status}`,e.status)}}createError(e,t,s){return{code:e,message:t,status:s}}sleep(e){return new Promise(t=>setTimeout(t,e))}},b=new m,D=b;export{y as a,T as b,b as c,D as d};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as j,b as f,d as x,e as I}from"./chunk-
|
|
8
|
+
import{a as j,b as f,d as x,e as I}from"./chunk-BU22R6JX.mjs";import{a as D}from"./chunk-JR542RI2.mjs";import{b as v}from"./chunk-IGHY4FGS.mjs";import{g as C,h as M,i as w,j as E,o as R}from"./chunk-22AXWLI6.mjs";import{a as b}from"./chunk-V2FR2NPL.mjs";import{a as S,b as K,d as m,g as U}from"./chunk-UHVYBU7F.mjs";import{a as c}from"./chunk-E66B27AL.mjs";K();import g from"node:fs/promises";import d from"node:path";U();var q=/^(main|index|app|server|cli|handler|router|bootstrap|init|start|run|default)$/i;function L(t){let e=M(t);if(!C(t))return{ready:!1,builtAt:e?.builtAt??null,symbols:0,edges:0,files:0,languages:[],kinds:[],routes:[],hotspots:[],entryCandidates:[],packages:[],note:"No symbol index. Run `prjct sync` or `prjct code reindex`."};let o=w(t),n=new Map,r=new Map,a=new Map,u=[],p=[];for(let i of o){n.set(i.kind,(n.get(i.kind)??0)+1),r.set(i.file,(r.get(i.file)??0)+1);let l=i.file.includes(".")?i.file.slice(i.file.lastIndexOf(".")):"(none)";a.set(l,(a.get(l)??0)+1),i.kind==="route"&&u.push({name:i.name,file:i.file,line:i.startLine}),i.exported&&q.test(i.name)&&(i.kind==="function"||i.kind==="class")&&!/__tests__|\.test\.|\.spec\.|fixtures?\//i.test(i.file)&&p.push({name:i.name,file:i.file,kind:i.kind})}let y=[...r.keys()],h=[],Y=R(t),J=y.length>400?y.slice(0,400):y;for(let i of J){let l=Y.get(i)??0;l>0&&h.push({file:i,fanIn:l,symbolCount:r.get(i)??0})}h.sort((i,l)=>l.fanIn-i.fanIn);let k=new Set,A=v(t);if(A)for(let i of Object.keys(A.forward).slice(0,2e3)){let l=i.includes("/")?i.slice(0,i.indexOf("/")):i;l&&!l.startsWith(".")&&k.add(l)}for(let i of y.slice(0,2e3)){let l=i.includes("/")?i.slice(0,i.indexOf("/")):".";l&&l!=="."&&k.add(l)}if(p.length<8)for(let i of o){if(p.length>=12)break;i.exported&&i.kind==="class"&&!p.some(l=>l.file===i.file)&&p.push({name:i.name,file:i.file,kind:i.kind})}return{ready:!0,builtAt:e?.builtAt??null,symbols:e?.symbolCount??o.length,edges:e?.edgeCount??0,files:e?.fileCount??r.size,languages:[...a.entries()].map(([i,l])=>({ext:i,count:l})).sort((i,l)=>l.count-i.count).slice(0,12),kinds:[...n.entries()].map(([i,l])=>({kind:i,count:l})).sort((i,l)=>l.count-i.count),routes:u.slice(0,30),hotspots:h.slice(0,15),entryCandidates:p.slice(0,15),packages:[...k].sort().slice(0,40),note:"Structural only (symbol + import graphs). Narrative architecture lives in prjct analysis / memory decisions."}}c(L,"buildArchitectureSnapshot");function O(t,e){let s=[];if(!t)return{hasChanges:!0,items:[{field:"Project style",type:"added",after:e.summary}],summary:{added:1,removed:0,changed:0},beforeCommit:null,afterCommit:e.commitHash};let o=t.payload,n=e.payload;return o.stack.ecosystem!==n.stack.ecosystem&&s.push({field:"Ecosystem",type:"changed",before:o.stack.ecosystem,after:n.stack.ecosystem}),(o.stack.packageManager??"")!==(n.stack.packageManager??"")&&s.push({field:"Package manager",type:"changed",before:o.stack.packageManager??"(none)",after:n.stack.packageManager??"(none)"}),P("Languages",o.stack.languages,n.stack.languages,s),P("Frameworks",o.stack.frameworks,n.stack.frameworks,s),P("Key libraries",o.stack.keyLibraries,n.stack.keyLibraries,s),o.stack.hasTests!==n.stack.hasTests&&s.push({field:"Has tests",type:"changed",before:String(o.stack.hasTests),after:String(n.stack.hasTests)}),_("Pattern",o.patterns.map(r=>[r.key,r.name]),n.patterns.map(r=>[r.key,r.name]),s),_("Anti-pattern",o.antiPatterns.map(r=>[r.key,r.issue]),n.antiPatterns.map(r=>[r.key,r.issue]),s),_("Convention",o.conventions.map(r=>[r.key,r.rule]),n.conventions.map(r=>[r.key,r.rule]),s),o.structural.symbols!==n.structural.symbols&&(o.structural.symbols>0||n.structural.symbols>0)&&s.push({field:"Symbols",type:"changed",before:String(o.structural.symbols),after:String(n.structural.symbols)}),o.structural.files!==n.structural.files&&s.push({field:"Files",type:"changed",before:String(o.structural.files),after:String(n.structural.files)}),D(s,t.commitHash,e.commitHash)}c(O,"generateProjectStyleDiff");function F(t){if(!t.hasChanges)return`## Project evolution
|
|
9
9
|
|
|
10
10
|
No style changes since last sync.`;let e=["## Project evolution (this sync)"];(t.beforeCommit||t.afterCommit)&&e.push(`> \`${T(t.beforeCommit)}\` \u2192 \`${T(t.afterCommit)}\``),e.push(""),e.push(`+${t.summary.added} \xB7 \u2212${t.summary.removed} \xB7 ~${t.summary.changed}`),e.push("");for(let s of t.items.slice(0,20)){let o=s.type==="added"?"+":s.type==="removed"?"\u2212":"~";s.type==="changed"?e.push(`- ${o} **${s.field}**: ${s.before} \u2192 ${s.after}`):s.type==="added"?e.push(`- ${o} **${s.field}**: ${s.after}`):e.push(`- ${o} **${s.field}**: ${s.before}`)}return e.join(`
|
|
11
11
|
`)}c(F,"formatProjectStyleDiffMd");function T(t){return t?t.length>7?t.slice(0,7):t:"(none)"}c(T,"short");function P(t,e,s,o){let n=new Set(e.map(a=>a.toLowerCase())),r=new Set(s.map(a=>a.toLowerCase()));for(let a of s)n.has(a.toLowerCase())||o.push({field:t,type:"added",after:a});for(let a of e)r.has(a.toLowerCase())||o.push({field:t,type:"removed",before:a})}c(P,"diffStringArray");function _(t,e,s,o){let n=new Map(e),r=new Map(s);for(let[a,u]of r)n.has(a)?n.get(a)!==u&&o.push({field:t,type:"changed",before:n.get(a),after:u}):o.push({field:t,type:"added",after:u});for(let[a,u]of n)r.has(a)||o.push({field:t,type:"removed",before:u})}c(_,"diffKeyed");var H=50;function W(t){let e=(()=>{try{return JSON.parse(t.payload_json)}catch{return z()}})();return{id:t.id,capturedAt:t.captured_at,commitHash:t.commit_hash,source:t.source||"sync-mechanical",patternCount:t.pattern_count,antiPatternCount:t.anti_pattern_count,conventionCount:t.convention_count,frameworkCount:t.framework_count,symbolCount:t.symbol_count,fileCount:t.file_count,summary:t.summary,payload:e}}c(W,"rowToSnapshot");function z(){return{payloadVersion:1,stack:{ecosystem:"unknown",languages:[],frameworks:[],keyLibraries:[],hasTests:!1,hasDocker:!1},commands:{},conventions:[],patterns:[],antiPatterns:[],structural:{symbols:0,files:0,packages:[]},metrics:{}}}c(z,"emptyPayload");function N(t){try{let e=m.get(t,"SELECT * FROM project_style_snapshots WHERE is_active = 1 ORDER BY captured_at DESC LIMIT 1");return e?W(e):null}catch{return null}}c(N,"getActiveProjectStyle");function G(t,e=12){try{return m.query(t,"SELECT * FROM project_style_snapshots ORDER BY captured_at DESC LIMIT ?",e).map(W)}catch{return[]}}c(G,"getProjectEvolution");function jt(t,e=6){let s=G(t,e);if(s.length===0)return null;let o=["## Project evolution"];if(s.length>=2){let n=s[0],r=s[s.length-1],a=n.patternCount-r.patternCount,u=n.conventionCount-r.conventionCount,p=n.fileCount-r.fileCount;o.push(`Over ${s.length} snapshots: patterns ${$(a)}, conventions ${$(u)}, files ${$(p)}.`)}for(let n of s)o.push(`- ${n.capturedAt.slice(0,10)} \u2014 ${n.summary}`);return o.join(`
|
|
@@ -16,4 +16,4 @@ No style changes since last sync.`;let e=["## Project evolution (this sync)"];(t
|
|
|
16
16
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)`).run(e.id,e.capturedAt,e.commitHash,e.source,e.patternCount,e.antiPatternCount,e.conventionCount,e.frameworkCount,e.symbolCount,e.fileCount,e.summary,JSON.stringify(e.payload));let o=s.prepare("SELECT id FROM project_style_snapshots ORDER BY captured_at DESC").all();if(o.length>H){let n=o.slice(H),r=s.prepare("DELETE FROM project_style_snapshots WHERE id = ?");for(let a of n)r.run(a.id)}})}c(V,"persistProjectStyleSnapshot");async function Pt(t){let e=N(t.projectId),s=X(t.projectId),o=await et(t.projectPath),n=Z(t.projectId),r=tt(t.projectId),a=x({stats:t.stats,stack:t.stack,commands:t.commands,packageDeps:o.deps,packageManager:o.packageManager,llmAnalysis:s,memoryPatterns:r.patterns,memoryAntiPatterns:r.antiPatterns,memoryConventions:r.conventions,structural:n,commitHash:t.commitHash??null,source:t.source??"sync-mechanical"});a.payload.metrics.styleCoverage=Q(a),a.payload.metrics.hasRichAnalysis=f(s)?1:0;let u=O(e,a),p=e===null;(p||u.hasChanges)&&V(t.projectId,a);let y=N(t.projectId)??a;return t.bridgeMemory!==!1&&await st(t.projectPath,t.projectId,y).catch(()=>{}),await rt(t.projectId,y).catch(()=>{}),{snapshot:y,delta:u,isFirst:p}}c(Pt,"recomputeProjectStyle");function Q(t){let e=(t.payload.stack.ecosystem!=="unknown"?25:0)+(t.payload.stack.frameworks.length>0||t.payload.stack.keyLibraries.length>0?20:0)+(t.payload.stack.hasTests?10:0)+Math.min(25,t.conventionCount*5)+Math.min(15,t.patternCount*3)+Math.min(5,t.antiPatternCount);return Math.min(100,e)}c(Q,"computeStyleCoverage");function X(t){try{let e=j.getActive(t);if(f(e))return e;try{let s=j.getAllFull(t);for(let o of s)if(f(o.analysis))return o.analysis}catch{}return e}catch{return null}}c(X,"pickBestAnalysis");function Z(t){try{let e=L(t);return e.ready?{symbols:e.symbols,files:e.files,packages:e.packages.slice(0,20)}:{symbols:0,files:0,packages:[]}}catch{return{symbols:0,files:0,packages:[]}}}c(Z,"loadStructural");function tt(t){let e=[],s=[],o=[];try{let n=b.recall(t,{types:["pattern","anti-pattern","decision"],limit:40});for(let r of n){let a=r.tags?.topic??"";!a.startsWith("style:")&&r.type!=="pattern"&&r.type!=="anti-pattern"||(r.type==="pattern"||a.startsWith("style:pattern:")?e.push({name:r.tags?.name||a.replace(/^style:pattern:/,"")||"pattern",description:r.content.slice(0,400)}):r.type==="anti-pattern"||a.startsWith("style:anti:")?s.push({issue:r.tags?.name||a.replace(/^style:anti:/,"")||"anti-pattern",suggestion:r.content.slice(0,400)}):a.startsWith("style:convention:")&&o.push({rule:r.content.slice(0,400),category:r.tags?.category}))}}catch{}return{patterns:e,antiPatterns:s,conventions:o}}c(tt,"loadMemoryStyle");async function et(t){try{let e=await g.readFile(d.join(t,"package.json"),"utf-8"),s=JSON.parse(e),o={...s.dependencies??{},...s.devDependencies??{}},n=s.packageManager?s.packageManager.split("@")[0]??null:await(async()=>{let r=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];for(let[a,u]of r)try{return await g.access(d.join(t,a)),u}catch{}return null})();return{deps:o,packageManager:n}}catch{return{deps:{},packageManager:null}}}c(et,"readPackageMeta");function nt(t){let e=t.payload,s=[...e.conventions.slice(0,25).map(n=>({type:"decision",content:n.rule,tags:{topic:`style:convention:${n.key}`,category:n.category??"convention",source:"project-style"}})),...e.patterns.slice(0,25).map(n=>({type:"pattern",content:`${n.name}: ${n.description}`,tags:{topic:`style:pattern:${n.key}`,name:n.name,source:"project-style",...n.category?{category:n.category}:{}}})),...e.antiPatterns.slice(0,25).map(n=>({type:"anti-pattern",content:`${n.issue}. Suggestion: ${n.suggestion}`,tags:{topic:`style:anti:${n.key}`,name:n.issue,source:"project-style",...n.severity?{severity:n.severity}:{}}}))],o=new Set;return s.filter(n=>{let r=`${n.type}\0${S(n.content)}`;return o.has(r)?!1:(o.add(r),!0)})}c(nt,"desiredStyleBridgeEntries");function B(t,e,s){return`${t}\0${e}\0${s}`}c(B,"styleBridgeIdentity");async function st(t,e,s){let o=nt(s);if(o.length===0)return 0;let n=(()=>{try{let a=[...new Set(o.map(y=>y.tags.topic))],u=a.map(()=>"?").join(","),p=m.query(e,`SELECT type, topic_key, content_hash
|
|
17
17
|
FROM memory_entries
|
|
18
18
|
WHERE project_id = ? AND deleted_at IS NULL
|
|
19
|
-
AND topic_key IN (${u})`,e,...a);return new Set(p.map(y=>B(y.type,y.topic_key,y.content_hash)))}catch{return null}})(),r=[];for(let a of o){let u=a.tags.topic,p=B(a.type,u,S(a.content));n?.has(p)||(await b.remember(t,{...a,projectId:e,provenance:"extracted"}),r.push(a))}return r.length}c(st,"bridgeStyleToMemory");async function rt(t,e){let{default:s}=await import("./path-manager-
|
|
19
|
+
AND topic_key IN (${u})`,e,...a);return new Set(p.map(y=>B(y.type,y.topic_key,y.content_hash)))}catch{return null}})(),r=[];for(let a of o){let u=a.tags.topic,p=B(a.type,u,S(a.content));n?.has(p)||(await b.remember(t,{...a,projectId:e,provenance:"extracted"}),r.push(a))}return r.length}c(st,"bridgeStyleToMemory");async function rt(t,e){let{default:s}=await import("./path-manager-375HH6TB.mjs"),o=s.getGlobalProjectPath(t),n=d.join(o,"analysis");await g.mkdir(n,{recursive:!0});let r=e.payload.stack,a={ecosystem:r.ecosystem,frameworks:r.frameworks,hasTests:r.hasTests,technologies:[...r.languages,...r.frameworks,...r.keyLibraries].filter((u,p,y)=>y.indexOf(u)===p),packageManager:r.packageManager??null,updatedAt:e.capturedAt,styleSummary:e.summary};await g.writeFile(d.join(n,"repo-analysis.json"),JSON.stringify(a,null,2),"utf-8")}c(rt,"writeRepoAnalysisArtifact");function _t(t){let e=t.delta.hasChanges||t.isFirst?F(t.delta):null,s=I(t.snapshot,{maxConventions:4,maxPatterns:3,maxAnti:2});return{evolutionMd:e,digestMd:s,delta:t.delta}}c(_t,"formatProjectStyleForSync");export{N as a,G as b,jt as c,V as d,Pt as e,st as f,_t as g};
|
|
@@ -5,5 +5,5 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as l}from"./chunk-
|
|
8
|
+
import{a as l}from"./chunk-GPZP7NXL.mjs";import{c as u}from"./chunk-XS45K7ZQ.mjs";import{a as s,c}from"./chunk-4KVPAHFV.mjs";import{b as i}from"./chunk-PO3QDKTE.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function g(n){let e=n.tool_input??n.toolInput;return e&&typeof e.command=="string"?e.command:typeof n.command=="string"?n.command:e&&typeof e.command_line=="string"?e.command_line:""}o(g,"extractCommand");function k(n){return n?n.sdd?.mode==="strict"||n.tdd?.mode==="strict"||n.deliveryGeometry?.mode==="strict":!1}o(k,"isStrictPackageMode");async function m(n,e){let a=s(g(e));if(!a)return null;let t=await c(n),r=u(a.packages,t);if(r.allow)return null;let d=await i.readConfig(n).catch(()=>null);return{strict:k(d),message:r.decision?.message??r.denyMessage}}o(m,"evaluatePrePackageInput");function w(n=process.cwd(),e){return l({event:"PreToolUse",projectPath:n,decide:o(async a=>{try{let t=await m(n,a);return t?.strict?{deny:t.message}:null}catch{return null}},"decide"),build:o(async a=>{try{let t=await m(n,a);return!t||t.strict?null:`# prjct: package legitimacy (advisory)
|
|
9
9
|
${t.message}`}catch{return null}},"build")},e)}o(w,"runPrePackageHook");export{m as a,w as b};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as q}from"./chunk-
|
|
8
|
+
import{a as q}from"./chunk-QP5USCDX.mjs";import{e as p,g as P}from"./chunk-UHVYBU7F.mjs";import{d as H,e as g,f as B,h as Q}from"./chunk-A6K4H3YT.mjs";import{a as c}from"./chunk-E66B27AL.mjs";P();P();function l(t,s,...e){try{return Number(p.get(t,s,...e)?.value??0)}catch{return 0}}c(l,"count");function E(t,s,...e){try{return p.query(t,s,...e)}catch{return[]}}c(E,"query");Q();var j="memory.task_tokens",_=1e7;function pt(t,s,e,r,n){if(!s||e+r<=0)return;let i=5e7;if(e>i||r>i)return;let a=e>_||r>_,u=Math.min(Math.round(e),_),d=Math.min(Math.round(r),_);a&&(n={...n,isEstimated:!0});try{p.appendEvent(t,j,{taskId:s,tokensIn:u,tokensOut:d,...n?.description?{description:n.description}:{},...n?.agent?{agent:n.agent}:{},...n?.model?{model:n.model}:{},...n?.runtime?{runtime:n.runtime}:{},...n?.isEstimated!==void 0?{isEstimated:n.isEstimated}:{},...n?.source?{source:n.source}:{}},s)}catch{}if(u>=0&&u<=_&&d>=0&&d<=_)try{p.run(t,"UPDATE tasks SET tokens_in = ?, tokens_out = ? WHERE id = ?",u,d,s)}catch{}try{let C=n?.source??"cli",S=`${s}:${C}`,h=Date.now();p.run(t,`INSERT INTO token_usage
|
|
9
9
|
(id, work_cycle_id, event_key, source, is_estimated, input_tokens, output_tokens, model_id, description, measured_at, created_at)
|
|
10
10
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
11
11
|
ON CONFLICT(event_key) DO UPDATE SET
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as v}from"./chunk-
|
|
8
|
+
import{a as v}from"./chunk-ABJNOG2I.mjs";import{b as u,h as S,v as s,w as $}from"./chunk-A6K4H3YT.mjs";import{g as C,o as j}from"./chunk-UH4MD3F3.mjs";import{a as y,b as P,p as G}from"./chunk-QWQFF2UG.mjs";import{b,e as E}from"./chunk-GCDLPKOH.mjs";import{d as w}from"./chunk-PKDYFXMI.mjs";import{a as f,f as M}from"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";import h from"node:fs/promises";import W from"node:path";import*as d from"jsonc-parser";G();import k from"node:crypto";var D="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";function F(r,t=D){let n=Buffer.from(t.replace(/-/g,""),"hex"),i=k.createHash("sha1").update(n).update(r,"utf8").digest().subarray(0,16);i[6]=i[6]&15|80,i[8]=i[8]&63|128;let e=i.toString("hex");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}c(F,"uuidv5");async function N(r){let t=await P("git",["remote","get-url","origin"],{cwd:r}).then(({stdout:i})=>i.trim()||null).catch(()=>null);if(!t)return null;let{provider:n,repoSlug:o}=v(t);return!n||!o?null:`${n}:${o}`.toLowerCase()}c(N,"repoKey");async function x(r){let t=await N(r);return t?F(t):null}c(x,"deriveProjectId");M();S();j();E();G();async function m(r){try{let{stdout:t}=await y(r,{timeout:5e3});return{success:!0,output:t.trim()}}catch{return{success:!1,output:""}}}c(m,"execCommand");async function R(){let r=await m("gh api user --jq .login");if(r.success&&r.output)return r.output;let t=await m("git config --global github.user");return t.success&&t.output?t.output:null}c(R,"detectGitHubUsername");async function T(){let r=await m("git config user.name");return r.success&&r.output?r.output:null}c(T,"detectGitName");async function U(){let r=await m("git config user.email");return r.success&&r.output?r.output:null}c(U,"detectGitEmail");async function A(){let[r,t,n]=await Promise.all([R(),T(),U()]);return{github:r,email:n,name:t||r||"Unknown"}}c(A,"detect");$();function I(r){let t=[],n=d.parse(r,t,{allowTrailingComma:!0,disallowComments:!1});if(t.length>0){let o=t[0];throw new SyntaxError(`JSON parse error at offset ${o.offset}: ${d.printParseErrorCode(o.error)}`)}return n}c(I,"parseJsonc");var l=new Map,p=class{static{c(this,"ConfigManager")}async readConfig(t){let n=s.getLocalConfigPath(t),o=await h.stat(n).catch(()=>null);if(!o)return l.delete(n),null;let i=o.mtimeMs,e=l.get(n);if(e&&e.mtimeMs===i)return e.config;try{let a=await h.readFile(n,"utf-8"),g=I(a);return l.size>32&&l.clear(),l.set(n,{mtimeMs:i,config:g}),g}catch(a){return f(a)?(l.delete(n),null):(console.warn(`Warning: Could not read config at ${t}: ${w(a)}`),null)}}async writeConfig(t,n){let o=s.getLocalConfigPath(t);await C(o,n),l.delete(o)}async readGlobalConfig(t){try{let n=s.getGlobalProjectConfigPath(t),o=await h.readFile(n,"utf-8");return I(o)}catch(n){return f(n)||console.warn(`Warning: Could not read global config for ${t}: ${w(n)}`),null}}async writeGlobalConfig(t,n){let o=s.getGlobalProjectConfigPath(t);await C(o,n)}async ensureGlobalConfig(t){let n=await this.readGlobalConfig(t),o=n??(()=>{let i=u();return{projectId:t,authors:[],version:b,lastSync:i}})();return n||await this.writeGlobalConfig(t,o),o}async createConfig(t,n){let o=await x(t)??s.generateProjectId(t),i=s.getGlobalProjectPath(o),e=s.getDisplayPath(i),a=u(),g={projectId:o,dataPath:e,showMetrics:!0};await this.writeConfig(t,g);let L={projectId:o,authors:[{name:n.name||"Unknown",email:n.email||"",github:n.github||"",firstContribution:a,lastActivity:a}],version:b,created:a,lastSync:a};return await this.writeGlobalConfig(o,L),g}async updateLastSync(t){let n=await this.getProjectId(t),o=await this.readGlobalConfig(n);o&&(o.lastSync=u(),await this.writeGlobalConfig(n,o))}validateConfig(t){return!(!t||!t.projectId||!t.dataPath)}async needsMigration(t){if(!await s.hasLegacyStructure(t))return!1;if(!await s.hasConfig(t))return!0;let i=await this.readConfig(t);if(!i||!i.projectId)return!0;let e=s.getGlobalProjectPath(i.projectId);try{return(await h.readdir(W.join(e,"core"))).length===0}catch(a){return f(a),!0}}async getProjectId(t){let n=await this.readConfig(t);if(n?.projectId)return n.projectId;try{let{worktreeService:o}=await import("./worktree-service-AS7JVBK5.mjs");if(await o.detect(t)){let e=await o.getMainWorktree(t);if(e!==t){let a=await this.readConfig(e);if(a?.projectId)return a.projectId}}}catch{}return""}async findAuthor(t,n){let o=await this.readGlobalConfig(t);return!o||!o.authors?null:o.authors.find(i=>i.github===n)||null}async addAuthor(t,n){let o=await this.ensureGlobalConfig(t);if(o.authors.some(a=>a.github===n.github))return;let e=u();o.authors.push({name:n.name||"Unknown",email:n.email||"",github:n.github||"",firstContribution:e,lastActivity:e}),o.lastSync=e,await this.writeGlobalConfig(t,o)}async updateAuthorActivity(t,n){let o=await this.readGlobalConfig(t);if(!o||!o.authors)return;let i=o.authors.find(e=>e.github===n);i&&(i.lastActivity=u(),o.lastSync=i.lastActivity,await this.writeGlobalConfig(t,o))}async getCurrentAuthor(t){let n=await A(),o=await this.getProjectId(t);return await this.addAuthor(o,{name:n.name??void 0,email:n.email??void 0,github:n.github??void 0}),n.github||n.name||"Unknown"}async isConfigured(t){let n=await this.readConfig(t);return this.validateConfig(n)}async getShowMetrics(t){return(await this.readConfig(t))?.showMetrics??!0}async setShowMetrics(t,n){let o=await this.readConfig(t);o&&(o.showMetrics=n,await this.writeConfig(t,o))}async getConfigWithDefaults(t){let n=await this.readConfig(t);if(n)return n;let o=s.generateProjectId(t);return{projectId:o,dataPath:s.getDisplayPath(s.getGlobalProjectPath(o))}}},H=new p,et=H;export{A as a,et as b};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as p}from"./chunk-
|
|
8
|
+
import{a as p}from"./chunk-V2FR2NPL.mjs";import{d as g,g as M}from"./chunk-UHVYBU7F.mjs";import{a as o}from"./chunk-E66B27AL.mjs";M();var h=300,x=3;function v(t){let e=t?.judgment?.conflictMode;if(e==="off"||e==="advisory"||e==="strict")return e;let n=t?.persona?.packs??[];return n.includes("code-strict")?"strict":n.includes("code")?"advisory":"off"}o(v,"effectiveConflictMode");function N(t){let e={action:"none",memoryIds:[],reason:"",recovery:"",message:""};if(t.mode==="off")return e;let n=new Set(t.overriddenIds??[]),r=t.candidates.filter(c=>c.id&&!n.has(c.id));if(r.length===0)return e;let i=r.filter(c=>c.confidence==="high"),l=r.filter(c=>c.confidence==="low"),s=i[0]??l[0];if(!s)return e;let f=r.map(c=>c.id),u=t.fileLabel?` on \`${t.fileLabel}\``:"",a=`Edit may contradict [${s.type}] ${m(s.content,80)} (\`${s.id}\`)${u}`,d='To supersede: `prjct remember decision "\u2026why supersede\u2026" --tags supersedes:'+s.id+'`. To lift deny for this memory: `prjct remember feedback "override conflict '+s.id+': <why>" --tags conflict:override,memory:'+s.id+"`.";return i.length===0?{action:"warn",memoryIds:f,reason:`Low-confidence preventive signal${u}: ${m(s.content,80)}`,recovery:d,message:y(a,d,f,!1)}:t.mode==="strict"?{action:"deny",memoryIds:i.map(c=>c.id),reason:a,recovery:d,message:_(a,d,i.map(c=>c.id))}:{action:"warn",memoryIds:f,reason:a,recovery:d,message:y(a,d,f,!0)}}o(N,"decisionConflictVerdict");function y(t,e,n,r){return[r?"# prjct: CONFLICT \u2014 decision/gotcha may block this path":"# prjct: heads-up \u2014 weak preventive signal","",t,"",`Memory: ${n.map(l=>`\`${l}\``).join(", ")}`,"",e,"",r?"> Not a soft nudge. Revise the edit or supersede the decision with rationale before proceeding.":"> Apply if it still holds; proceed if not."].join(`
|
|
9
9
|
`)}o(y,"formatWarnMessage");function _(t,e,n){return[`\u26D4 prjct conflict deny: ${t}`,`Memories: ${n.join(", ")}`,e,"Host will block Edit|Write until override or supersede. Fail-open only on hook errors, not on intentional deny."].join(" ")}o(_,"formatDenyMessage");function E(t){let e=new Set;try{let n=Date.now()-6048e5,r=g.query(t,`SELECT t.value AS value
|
|
10
10
|
FROM memory_entry_tags t
|
|
11
11
|
JOIN memory_entries me ON me.id = t.entry_id
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as x,b as h}from"./chunk-
|
|
8
|
+
import{a as x,b as h}from"./chunk-X5W2UYQK.mjs";import{a as M,h as I}from"./chunk-DXQMKW2B.mjs";import{e as b}from"./chunk-TXSLON7M.mjs";import{a as S}from"./chunk-V2FR2NPL.mjs";import{a as l,b as D}from"./chunk-UHVYBU7F.mjs";import{b as R}from"./chunk-GCKILEXJ.mjs";import{a as c}from"./chunk-E66B27AL.mjs";D();var F=.92,v=.18;function d(e){let r=new Map,n=[];for(let s of e){r.set(l(s.content),s.id);let o=x(s.content);n.push(Float64Array.from(o))}return{entries:e,fingerprints:r,vectors:n}}c(d,"buildReferenceIndex");function g(e,r,n){if(!r||r.entries.length===0)return{excess:1,maxSim:0,nearestId:null,exactDup:!1,nearDup:!1};let s=l(e),o=r.fingerprints.get(s);if(o&&o!==n)return{excess:0,maxSim:1,nearestId:o,exactDup:!0,nearDup:!0};let f=x(e),a=r.entries.reduce((t,m,_)=>{if(n&&m.id===n)return t;let E=h(f,r.vectors[_]);return E>t.maxSim?{maxSim:E,nearestId:m.id}:t},{maxSim:0,nearestId:null}),i=Math.max(0,Math.min(1,a.maxSim)),u=a.nearestId,p=i>=F;return{excess:p?0:Math.max(0,Math.min(1,1-i)),maxSim:i,nearestId:u,exactDup:!1,nearDup:p}}c(g,"excessAgainstIndex");function L(e,r,n){return g(e,d(r),n)}c(L,"computeExcess");var $=new Set(["decision","gotcha","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","context"]),k=150,N={declared:3,extracted:2,ambiguous:1,inferred:0};function T(e){return e.tags?.context_schema==="living-v2"||e.tags?.synthesis==="model-authored"||e.tags?.synthesis==="deterministic"||e.tags?.source==="land-auto"||e.tags?.capture==="land-v2"}c(T,"isLivingV2");function w(e){return!(!R(e)||e.content.trim().length<40||!$.has(e.type)||e.type==="context"&&!T(e)||e.type==="inbox"||e.type==="todo"||e.type==="idea")}c(w,"isReferenceEligible");function A(e){let r=N[e.provenance]??1,n=e.type==="decision"||e.type==="gotcha"?100:e.type==="learning"||e.type==="fact"?50:e.type==="context"?30:20,s=Date.parse(e.rememberedAt),o=Number.isFinite(s)?s/1e13:0;return n*10+r*3+o}c(A,"referenceRank");function C(e){let r=e.filter(w);return r.sort((n,s)=>A(s)-A(n)),r.slice(0,k)}c(C,"buildReferenceModel");var P=new Set(["decision","gotcha","red-herring","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","shipped"]),j=.28;function Q(e,r,n,s){let o=n.trim();if(o.length===0)return{accept:!1,reason:"empty content"};let f=M(o,r);if(f.junk)return{accept:!1,reason:`junk capture: ${f.reason}`};let a=I(o,r,{force:s?.force==="true"||s?.["precision:force"]==="true"});if(a.action==="refuse")return{accept:!1,reason:`precision: ${a.reason}`};if(a.action==="demote")return{accept:!1,reason:`precision demote\u2192${a.demoteTo??"context"}: ${a.reason}`};let i=b(s?.source);if(P.has(r)&&!i)return{accept:!0,reason:"judgment type \u2014 always accept novel content"};let u=(()=>{try{return S.allEntriesForIndex(e)}catch{return null}})();if(!u)return{accept:!0,reason:"gate skipped (read failure)"};if(u.length===0)return{accept:!0,reason:"empty vault \u2014 seed accepted"};let p=C(u);if(p.length===0)return{accept:!0,reason:"empty reference \u2014 accept"};let y=d(p),t=g(o,y),m=i?j:v;return t.exactDup||t.nearDup||t.excess<m?{accept:!1,reason:t.exactDup?`redundant exact match of ${t.nearestId}`:i?`auto-source low excess ${t.excess.toFixed(2)} (floor ${m}) vs R nearest ${t.nearestId}`:`low excess ${t.excess.toFixed(2)} vs reference (nearest ${t.nearestId}, sim ${t.maxSim.toFixed(2)})`,excess:t.excess,nearestId:t.nearestId}:{accept:!0,reason:i?`auto-source excess ${t.excess.toFixed(2)} above floor`:`excess ${t.excess.toFixed(2)} above capture floor`,excess:t.excess,nearestId:t.nearestId}}c(Q,"captureGate");export{k as a,w as b,C as c,F as d,v as e,d as f,g,L as h,Q as i};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as d,g as r}from"./chunk-
|
|
8
|
+
import{e as d,g as r}from"./chunk-UHVYBU7F.mjs";import{a as o}from"./chunk-E66B27AL.mjs";r();function t(e,s=500){let n=e?.replace(/\s+/g," ").trim();return n?n.length<=s?n:`${n.slice(0,s-3)}...`:null}o(t,"cleanText");function i(e){let s=[];return e.agent&&s.push(`agent=${e.agent}`),(e.tokensIn??0)+(e.tokensOut??0)>0&&(s.push(`tokens_in=${Math.round(e.tokensIn??0)}`),s.push(`tokens_out=${Math.round(e.tokensOut??0)}`)),e.filesTouched&&e.filesTouched.length>0&&s.push(`files_touched=${e.filesTouched.length}`),s.length===0?null:s.join(" ")}o(i,"summary");function a(e){if(!e.sessionId)return;let s=new Date().toISOString();try{d.run(e.projectId,`INSERT INTO agent_sessions
|
|
9
9
|
(id, project_id, directory, task_id, goal, started_at, created_at)
|
|
10
10
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
11
11
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f}from"./chunk-
|
|
8
|
+
import{a as f}from"./chunk-HEDZA6KC.mjs";import{a as i}from"./chunk-ZMLA5SKR.mjs";import{a as y}from"./chunk-V2FR2NPL.mjs";import{d as g,g as x}from"./chunk-UHVYBU7F.mjs";import{a}from"./chunk-E66B27AL.mjs";import{execFileSync as S}from"node:child_process";x();var j="land-auto",$="session-close";async function N(t){let o=L(t);if(!o)return{wrote:!1,content:null,reason:"nothing-to-land"};try{return await y.remember(t.projectPath,{type:"context",content:o,tags:{source:j,topic:$,capture:"land-v2",context_schema:"living-v2",synthesis:"deterministic"},provenance:"extracted",projectId:t.projectId}),{wrote:!0,content:o}}catch(r){return{wrote:!1,content:o,reason:`remember-failed: ${r.message}`}}}a(N,"synthesizeLandHandoff");function L(t){let o=t.cycleDescription?.trim()||null,r=f(t.projectId,t.cycleId),u=k(t.projectPath),c=b(t.projectId);if(!o&&r.length===0&&u.length===0&&c.length===0)return null;let e=[];o?e.push(`Session close: Work cycle "${i(o,120)}" still open or just closed.`):e.push("Session close: no open work cycle \u2014 landed repo + capture signals only."),e.push("Context synthesis: Passive land hand-off from durable signals (cycle, journal, commits, auto-captures). Not a model essay."),e.push(`Key data: source=${j}; topic=${$}; capture=land-v2`);let l=[];if(o&&l.push(`cycle="${i(o,100)}"`),r.length>0&&l.push(`journal: ${r.map(s=>i(s,70)).join(" \xB7 ")}`),l.length>0&&e.push(`What happened: ${l.join("; ")}`),r.length>0&&e.push(`Why it mattered: Journal trail shows progression \u2014 ${r.slice(0,2).map(s=>i(s,80)).join(" \xB7 ")}`),c.length>0){let s=c.filter(n=>n.type==="learning"||n.type==="decision"||n.type==="fact").slice(0,4),p=c.filter(n=>n.type==="gotcha"||n.type==="anti-pattern").slice(0,3);s.length>0&&e.push(`Learned this session: ${s.map(n=>`[${n.type}] ${i(n.content,100)}`).join(" \xB7 ")}`),p.length>0&&e.push(`Decision/trap: ${p.map(n=>`[${n.type}] ${i(n.content,100)}`).join(" \xB7 ")}`);let I=new Set([...s,...p]),d=c.filter(n=>!I.has(n)).slice(0,3);d.length>0&&s.length===0&&p.length===0&&e.push(`Decision/trap: ${d.map(n=>`[${n.type}] ${i(n.content,100)}`).join(" \xB7 ")}`)}u.length>0&&e.push(`Outcome: Recent commits: ${u.join("; ")}`),t.author&&e.push(`Who/author: ${t.author}`),t.model&&e.push(`Model: ${t.model}`);let m=t.tokensIn,h=t.tokensOut;if(m!=null||h!=null){let s=(m??0)+(h??0);e.push(`Token usage: in=${m??0} out=${h??0} total=${s} (compound judgment \u2014 not a fresh-window thrash loop)`)}e.push("Feature/domain: session-close"),e.push("Pattern: land auto-synthesis without agent remember"),e.push("Anti-pattern: relying on the model to remember to remember at session end"),e.push("Competitive: next window must `prjct prime` \u2014 act as this developer with SQLite judgment, not re-research from zero (GSD tax).");let w=o!=null?"Finish or pause the open cycle (`prjct status done` / `prjct pause`); next agent should `prjct work --md` or `prjct prime`.":"Next agent: `prjct prime` then pick from `prjct next --md`.";return e.push(`Next implication: ${w}`),e.join(" \xB7 ")}a(L,"buildLandHandoffContent");function k(t){try{return S("git",["log","-5","--oneline","--no-decorate"],{cwd:t,encoding:"utf-8",timeout:3e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
9
9
|
`).map(r=>r.trim()).filter(Boolean)}catch{return[]}}a(k,"recentCommits");function b(t){try{return g.query(t,`SELECT me.type, me.content
|
|
10
10
|
FROM memory_entries me
|
|
11
11
|
JOIN memory_entry_tags t ON t.entry_id = me.id
|