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
|
@@ -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 D}from"./chunk-DYHYDHCW.mjs";import{a as $}from"./chunk-
|
|
8
|
+
import{a as D}from"./chunk-DYHYDHCW.mjs";import{a as $}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{a as M,p as B}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import{a as O,e as R,f as L}from"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";L();B();import z from"node:fs/promises";import S from"node:path";var j={frontend:["component","page","view","ui","layout","style","css","scss","sass","hook","context","store","redux","zustand","react","vue","svelte","angular","next","nuxt","app","client"],backend:["api","route","controller","service","middleware","handler","resolver","schema","model","entity","repository","server","socket","graphql","rest","trpc"],database:["migration","seed","schema","model","entity","repository","prisma","drizzle","sequelize","typeorm","mongoose","knex","sql","db"],auth:["auth","login","logout","session","token","jwt","oauth","passport","credential","permission","role","user","account"],testing:["test","spec","e2e","integration","unit","mock","fixture","stub","jest","vitest","cypress","playwright"],config:["config","env","setting","constant","option","tsconfig","eslint","prettier","vite","webpack","rollup"],infra:["docker","compose","kubernetes","k8s","ci","cd","github","gitlab","jenkins","terraform","ansible","deploy"],util:["util","helper","lib","common","shared","core","base","abstract"]},E=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java",".kt",".swift",".rb",".php",".c",".cpp",".h",".hpp",".cs",".vue",".svelte"]),A=new Set(["node_modules",".git","dist","build",".next",".nuxt",".output","coverage",".cache","__pycache__",".pytest_cache","vendor","target",".turbo",".vercel"]),I=new Set(["a","an","the","and","or","but","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","must","shall","can","need","to","of","in","for","on","with","at","by","from","as","into","through","during","before","after","above","below","between","under","again","further","then","once","here","there","when","where","why","how","all","each","few","more","most","other","some","such","no","nor","not","only","own","same","so","than","too","very","just","add","create","make","implement","fix","update","change","modify","remove","delete","new"]);async function N(n,e,o={}){let t=Date.now(),s=o.maxFiles??30,r=o.minScore??.1,i=o.includeTests??!1,u=H(n),c=await W(e),a=await q(e),m=[];for(let h of c){if(!i&&Y(h))continue;let p=G(h,u,a,o.historicalBoosts);p.score>=r&&m.push(p)}m.sort((h,p)=>p.score-h.score);let g=m.slice(0,s);return{files:g,metrics:{filesScanned:c.length,filesReturned:g.length,scanDuration:Date.now()-t}}}l(N,"findRelevantFiles");function H(n){return n.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).filter(o=>!I.has(o)&&o.length>2)}l(H,"extractKeywords");async function W(n){let e=[];async function o(t,s=""){try{let r=await z.readdir(t,{withFileTypes:!0});for(let i of r){let u=S.join(t,i.name),c=S.join(s,i.name);if(i.isDirectory()){if(A.has(i.name)||i.name.startsWith("."))continue;await o(u,c)}else if(i.isFile()){let a=S.extname(i.name).toLowerCase();E.has(a)&&e.push(c)}}}catch(r){O(r)||D.debug(`files-tool: skipped unreadable path during walk: ${R(r)}`)}}return l(o,"walk"),await o(n),e}l(W,"getAllCodeFiles");async function q(n){let e=new Map;try{let{stdout:o}=await M(`git log -30 --pretty=format:"%H %ct" --name-only | awk '
|
|
9
9
|
/^[a-f0-9]{40}/ { commit=$1; timestamp=$2; next }
|
|
10
10
|
NF { files[$0]++; if (!lastmod[$0]) lastmod[$0]=timestamp }
|
|
11
11
|
END { for (const f in files) print files[f], lastmod[f], f }
|
|
@@ -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 _,b as R,c as o}from"./chunk-
|
|
8
|
+
import{a as _,b as R,c as o}from"./chunk-ZFLIVOFX.mjs";import"./chunk-B36LC2JR.mjs";import"./chunk-DYHYDHCW.mjs";import{a as v}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import{b as y}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{e as w,g as k}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b as P,h as A}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{b as E,p as x}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";A();x();k();import{createHash as I}from"node:crypto";function S(c){let t={goal:c.goal,eli10:c.eli10,stakes:c.stakes,acceptance_criteria:c.acceptance_criteria,scope:c.scope,out_of_scope:c.out_of_scope,risks:c.risks,test_plan:c.test_plan,scenarios:c.scenarios};return I("sha256").update(JSON.stringify(t)).digest("hex")}m(S,"computeAuditCandidateHash");function j(c,t){let e=w.get(c,"SELECT content FROM specs WHERE id = ?",t),s=(()=>{if(!e?.content)return null;try{return JSON.parse(e.content)}catch{return null}})(),r=w.query(c,"SELECT lens FROM spec_selected_reviewer WHERE spec_id = ?",t).map(a=>a.lens),n=new Set(w.query(c,"SELECT lens FROM spec_review WHERE spec_id = ? AND verdict = 'pass'",t).map(a=>a.lens));if(!(r.length>0?r.every(a=>n.has(a)):n.has("strategic")&&n.has("architecture")&&n.has("design")))return!1;let u=s?.audit_candidate_hash;if(!u)return!0;if(S(s)!==u)return!1;let l=s?.reviews??{};for(let a of r.length>0?r:Object.keys(l)){let d=l[a];if(!(!d||d.verdict!=="pass")&&d.candidateHash!==u)return!1}for(let a of r.length>0?r:["strategic","architecture","design"]){if(!n.has(a))continue;let d=l[a];if(!d||d.candidateHash!==u)return!1}return!0}m(j,"reviewsGatePassedRelational");async function D(c){try{let{stdout:t}=await E("git",["rev-parse","HEAD"],{cwd:c}),e=t.trim();return/^[0-9a-f]{7,40}$/.test(e)?e:null}catch{return null}}m(D,"readGitHead");var C=class{static{m(this,"SpecService")}async create(t,e){let s=await this.requireProjectId(t),{classifySpecCreate:r,shouldMirrorSpecToMemory:n}=await import("./precision-classifier-IVVAXE26.mjs"),p=r(e.title,e.content.goal);if(p.action==="refuse")throw new Error(`Cannot create empty spec (${p.reasonCode}): ${p.reason}`);let u=e.autoContext!==!1,l=e.content.notes??"",a=u&&!l.trim()?await import("./spec-context-inference-6Z52BT37.mjs").then(async({inferSpecContext:h,warnNoContextMatch:f})=>{let g=await h(e.title,s,t);return g.empty&&f(e.title),g.empty?l:g.notesBlock}):l,d=_.parse({goal:e.content.goal,eli10:e.content.eli10??"",stakes:e.content.stakes??"",acceptance_criteria:e.content.acceptance_criteria??[],scope:e.content.scope??[],out_of_scope:e.content.out_of_scope??[],risks:e.content.risks??[],test_plan:e.content.test_plan??[],reviews:e.content.reviews,linked_tasks:e.content.linked_tasks??[],notes:a}),i=o.create(s,{title:e.title,content:d,tags:e.tags});return n(i.title,i.content.goal)&&await v.remember(t,{type:"spec",content:`${i.title}
|
|
9
9
|
|
|
10
10
|
Goal: ${i.content.goal}`,tags:{...e.tags??{},spec_id:i.id,status:i.status},source:i.id,provenance:"declared"}),i}async get(t,e){let s=await this.requireProjectId(t);return o.get(s,e)}async list(t,e={}){let s=await this.requireProjectId(t);return o.list(s,e)}async setStatus(t,e,s){let r=await this.requireProjectId(t),n=o.setStatus(r,e,s);return n&&await v.remember(t,{type:"spec",content:`Spec status \u2192 ${s}: ${n.title}`,tags:{spec_id:e,status:s,event:"status_change"},source:e}),n}async patch(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=_.parse({...n.content,...s});return this.update(t,e,p)}async applyDelta(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=R(n.content,s);return p===n.content?n:this.update(t,e,p)}async update(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=S(n.content),u=S(s),l=p!==u,a=l?{...s,reviews:{},selected_reviewers:[],audit_candidate_hash:null}:s;return l&&(n.status==="reviewed"||n.status==="in_progress")&&o.setStatus(r,e,"draft"),o.updateContent(r,e,a)}async recordReview(t,e,s,r){let n=await this.requireProjectId(t),p=3,u=50,l=m(async d=>{let i=o.get(n,e);if(!i)return null;let h=i.content.audit_candidate_hash??S(i.content);if(i.content.audit_candidate_hash&&S(i.content)!==i.content.audit_candidate_hash)throw new Error(`SPEC_CANDIDATE_DRIFT: body no longer matches audit_candidate_hash. Re-run \`prjct spec audit ${e}\` then re-record reviews.`);let f={...r,ts:P(),candidateHash:h},g={...i.content,audit_candidate_hash:h,reviews:{...i.content.reviews??{},[s]:f}};if(o.casUpdate(n,e,g,i.updatedAt))return o.get(n,e);if(d+1>=p)throw new Error(`SPEC_RECORD_REVIEW_CONFLICT_RETRY_EXHAUSTED: ${p} retries failed for spec ${e}`);return await new Promise($=>setTimeout($,u)),l(d+1)},"attemptReview"),a=await l(0);if(a&&j(n,e)&&a.status==="draft"){let{assessAcceptanceCriteria:d}=await import("./nyquist-lite-GE7OAFLC.mjs"),i=d(a.content.acceptance_criteria??[]);if(!i.ok&&i.message){let f=await y.readConfig(t).catch(()=>null),g=f?.tdd?.mode==="strict",b=f?.sdd?.mode==="strict";if(g||b)throw new Error(`NYQUIST_LITE_BLOCK: ${i.message}
|
|
11
|
-
Rewrite acceptance criteria with verifiable signals, then re-record the last review.`);try{await v.remember(t,{type:"improvement-signal",content:i.message,tags:{source:"nyquist-lite",spec:e},provenance:"extracted",projectId:n})}catch{}}let h=o.setStatus(n,e,"reviewed");if(h){let{breakdownSpecToTasks:f}=await import("./spec-task-breakdown-
|
|
11
|
+
Rewrite acceptance criteria with verifiable signals, then re-record the last review.`);try{await v.remember(t,{type:"improvement-signal",content:i.message,tags:{source:"nyquist-lite",spec:e},provenance:"extracted",projectId:n})}catch{}}let h=o.setStatus(n,e,"reviewed");if(h){let{breakdownSpecToTasks:f}=await import("./spec-task-breakdown-LAXGVLMY.mjs");return await f(n,t,h),o.get(n,e)}return h}return a}async linkTask(t,e,s){let r=await this.requireProjectId(t);return o.linkTask(r,e,s)}async ship(t,e,s){let r=await this.requireProjectId(t);s!==void 0&&o.setShippedPr(r,e,s);let n=await D(t);return n&&o.setShippedSha(r,e,n),o.setStatus(r,e,"shipped")}unmetCriteria(t,e=new Set){return t.content.acceptance_criteria.filter(s=>!e.has(s))}async setSelectedReviewers(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=S(n.content);return o.updateContent(r,e,{...n.content,selected_reviewers:s,audit_candidate_hash:p,reviews:{}})}async requireProjectId(t){let e=await y.readConfig(t);if(!e?.projectId)throw new Error("not a prjct project (run `prjct init` first)");return e.projectId}},oe=new C;export{oe as specService};
|
package/dist/bin/hook-chunks/{spec-task-breakdown-K3GMQKGH.mjs → spec-task-breakdown-LAXGVLMY.mjs}
RENAMED
|
@@ -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 m}from"./chunk-
|
|
8
|
+
import{a as m}from"./chunk-ZOX6OV6X.mjs";import{c as s}from"./chunk-ZFLIVOFX.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import{a as w}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b as h,h as S}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";S();async function x(r,a,e){let o=e.content.acceptance_criteria;if(o.length===0)return{taskIds:[],skippedReason:"no_acceptance_criteria"};if(e.content.tasks_created_at!==null)return{taskIds:[],skippedReason:"already_broken_down"};let d=e.content.linked_tasks.length>0,y=(await m.getTasks(r)).filter(t=>t.featureId===e.id),g=new Set,u=o.map(t=>{let n=y.find(_=>_.body===t&&!g.has(_.id));return n&&g.add(n.id),n??null}),c=o.map((t,n)=>({ac:t,i:n})).filter(({i:t})=>u[t]===null),l=c.length>0?await m.addTasks(r,c.map(({ac:t})=>({description:I(t),body:t,priority:"medium",type:"feature",section:"backlog",featureId:e.id,groupId:e.id,groupName:e.title}))):[],b=new Map(c.map(({i:t},n)=>[t,l[n].id])),i=o.map((t,n)=>u[n]?.id??b.get(n));for(let t of i)s.linkTask(r,e.id,t);let k=s.get(r,e.id);if(k){let t={...k.content,tasks_created_at:h()};s.updateContent(r,e.id,t)}let f=i.length-l.length;return await w.remember(a,{type:"spec",content:`Auto-breakdown: ${l.length} tasks created${f>0?`, ${f} adopted`:""} from ${e.title}${d?" (recovered from partial)":""}`,tags:{spec_id:e.id,event:"auto_breakdown",task_count:String(i.length),...d?{recovered:"partial"}:{}},source:e.id}),{taskIds:i,...d?{recoveredFromPartial:!0}:{}}}p(x,"breakdownSpecToTasks");function I(r){let a=r.replace(/\s+/g," ").trim();return a.length<=140?a:`${a.slice(0,137)}\u2026`}p(I,"truncateForDescription");export{x as breakdownSpecToTasks};
|
|
@@ -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 a}from"./chunk-
|
|
8
|
+
import{b as a}from"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as stateStorage};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as ue,b as T,d as W}from"./chunk-32RX4YGI.mjs";import{a as L}from"./chunk-BDOAQVIF.mjs";import{b as ae}from"./chunk-QBYHZX33.mjs";import{a as ce}from"./chunk-GPZP7NXL.mjs";import{b as q}from"./chunk-2UC4DTDO.mjs";import{a as J}from"./chunk-PGWFGRX4.mjs";import{a as ie,b as oe}from"./chunk-TRMBRDKH.mjs";import"./chunk-TPESWBA7.mjs";import{b as se}from"./chunk-FEFP6JOL.mjs";import{c as M}from"./chunk-4HAKTI36.mjs";import{c as re}from"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import{a as m}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import{g as at,h as ct}from"./chunk-UUULLTQV.mjs";import{a as ne,c as G}from"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import{b as Y}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as v}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{a as te,b as it,e as b,f as ot,g as B}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b as Q,h as tt,v as ee,w as st}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import{b as U,c as rt}from"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as Z,o as nt}from"./chunk-UH4MD3F3.mjs";import{e as A,g as P,l as C,p as V}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a,b as K,e as z}from"./chunk-E66B27AL.mjs";import S from"node:fs/promises";import Qe from"node:path";import ut from"node:crypto";import lt from"node:fs/promises";function D(n){return typeof n=="string"?n:Array.isArray(n)?n.map(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"&&"text"in t){let e=t.text;return typeof e=="string"?e:""}return""}).join(`
|
|
9
|
+
`).trim():""}a(D,"textOf");function I(n){try{let t=K("node:fs"),s=K("node:path").join(n,".prjct","prjct.config.json"),r=t.readFileSync(s,"utf-8");return JSON.parse(r).projectId??null}catch{return null}}a(I,"projectIdFromPath");var fe="friction-detector",le="friction-promote",pe=5,de=400,ge=160,pt=[/^\s*no[,.!\s]/i,/^\s*nope\b/i,/^\s*stop\b/i,/^\s*wait\b/i,/^\s*cancel\b/i],dt=[/\bshould be\b/i,/\brather than\b/i,/\binstead\b/i],ft=[/\bdoesn'?t work\b/i,/\bbroken\b/i,/\bagain\b.*\bsame\b/i];async function me(n,t,e,s={}){let r=s.preloadedLines?s.preloadedLines:await lt.readFile(t,"utf-8").then(gt).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=mt(r);if(i.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=i.slice(0,pe).map(l=>({category:l.category,expectedBehavior:"Follow the user constraint without requiring correction.",observedBehavior:`The assistant response triggered user ${l.category}.`,relatedRuleId:null})),u=kt(n),c=I(n)??void 0;return{...await i.slice(0,pe).reduce(async(l,f)=>{let d=await l,y=ye(f.excerpt).slice(0,12);if(u.has(y))return await wt(n,c,f).catch(()=>{}),{...d,signalsSkipped:d.signalsSkipped+1};try{return await m.remember(n,{type:"improvement-signal",content:yt(f),tags:{source:fe,category:f.category,...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},...e?{session:e}:{},key:y},provenance:"extracted",projectId:c}),u.add(y),{...d,signalsRecorded:d.signalsRecorded+1}}catch{return{...d,signalsSkipped:d.signalsSkipped+1}}},Promise.resolve({signalsRecorded:0,signalsSkipped:0})),failures:o}}a(me,"detectFriction");function gt(n){return T(n)}a(gt,"parseJsonl");function mt(n){let t={signals:[],lastAssistantText:""};for(let e of n){let s=e.role??e.message?.role,r=D(e.content??e.message?.content);if(!r)continue;if(s==="assistant"){t.lastAssistantText=r;continue}if(s!=="user")continue;let i=ht(r.slice(0,300));i&&t.signals.push({excerpt:r.slice(0,de).trim(),category:i,precedingAssistantPreview:t.lastAssistantText.slice(0,de).trim()})}return t.signals}a(mt,"extractSignals");function ht(n){return ft.some(t=>t.test(n))?"complaint":pt.some(t=>t.test(n))?"negation":dt.some(t=>t.test(n))?"correction":null}a(ht,"classify");function yt(n){let t=bt(n.category),e=he(n.excerpt),s=e?`Obey developer constraint: ${e}`:t.lesson,r=e?`Always: ${e}`:t.nextAction;return[`[${n.category}] Lesson: ${s}`,"What happened: The user pushed back after the assistant response.",`Why it mattered: ${t.why}`,`Pattern: ${t.pattern}`,`Anti-pattern: ${t.antiPattern}`,`Next action: ${r}`].join(`
|
|
10
|
+
`)}a(yt,"formatSignal");function he(n){let t=n.replace(/\s+/g," ").trim();if(!t)return null;let e=t.replace(/^\s*(?:nope|no|stop|wait|cancel)[,.!\s:—-]*/i,"").trim(),s=e.match(/\bshould be\b\s+(.+?)$/i);if(s?.[1])return E(`Prefer ${s[1]}`);let r=e.match(/^(.+?)\s+rather than\s+(.+?)$/i);if(r?.[1]&&r[2])return E(`Prefer ${r[1].trim()} rather than ${r[2].trim()}`);let i=e.match(/\b(?:use|prefer|do|run|ship|write|keep)\s+(.+?)\s+instead(?:\s+of\s+(.+))?$/i);if(i?.[1]){let p=i[2]?` instead of ${i[2].trim()}`:" instead";return E(`Use ${i[1].trim()}${p}`)}let o=e.match(/\binstead of\b\s+(.+?)$/i);if(o?.[1])return E(`Avoid ${o[1].trim()}`);let u=e.match(/\b(?:don'?t|do not|never)\s+(.+?)$/i);if(u?.[1])return E(`Never ${u[1].trim()}`);let c=e.match(/\balways\s+(.+?)$/i);if(c?.[1])return E(`Always ${c[1].trim()}`);if(e.length>=12&&e.length<=ge&&/^(?:run|use|do|ship|write|keep|add|fix|remove|prefer|test|check|verify|read|ask|stop|start)\b/i.test(e)){let p=e.charAt(0).toUpperCase()+e.slice(1);return E(p.replace(/[.!?]+$/,""))}return null}a(he,"extractSpecificConstraint");function E(n){let t=n.replace(/\s+/g," ").trim().replace(/^[-*•]\s+/,"").replace(/[.!?]+$/,"").slice(0,ge);return t.length<12||/^(?:nope|no|stop|wait|cancel)\b/i.test(t)?null:t}a(E,"cleanConstraint");async function wt(n,t,e){if(!t)return;let s=he(e.excerpt);if(!s)return;let r=`Always: ${s}`,i=`fp:${ye(s).slice(0,12)}`;try{if(m.recall(t,{types:["feedback"],tags:{source:le,key:i},limit:1,dedupeByKey:!1}).length>0)return;await m.remember(n,{type:"feedback",content:r,tags:{source:le,key:i,category:e.category,from:"recurring-friction"},provenance:"extracted",projectId:t})}catch{}}a(wt,"maybePromoteStandingPreference");function bt(n){return n==="complaint"?{lesson:"Treat explicit failure complaints as evidence that the last result needs diagnosis, not repetition.",why:"The user reported that the delivered behavior or command did not work.",pattern:"User names a broken or non-working result after an assistant action.",antiPattern:"Retrying the same path or moving on without isolating the failure.",nextAction:"Stop, inspect the failing output or assumption, and propose the smallest verifiable fix."}:n==="correction"?{lesson:"Update the working assumption when the user corrects the intended direction.",why:"The assistant was using an assumption that did not match what the user wanted.",pattern:"User redirects the implementation or workflow with a correction.",antiPattern:"Continuing with the original plan after the user clarified a different target.",nextAction:"Restate the corrected target as an actionable rule before continuing."}:{lesson:"Recalibrate before continuing when the user rejects the assistant\u2019s last step.",why:"The assistant likely violated sequencing, scope, or approval expectations.",pattern:"User immediately rejects an assistant action or proposed next step.",antiPattern:"Treating the rejected action as acceptable and continuing without changing course.",nextAction:"Pause, convert the pushback into a workflow constraint, and adjust the next tool use."}}a(bt,"lessonTemplate");function ye(n){let t=n.toLowerCase().replace(/\s+/g," ").trim();return ut.createHash("sha256").update(t).digest("hex")}a(ye,"hashSignal");function kt(n){try{let t=I(n);if(!t)return new Set;let e=m.recall(t,{types:["improvement-signal"],tags:{source:fe},limit:100,dedupeByKey:!1}),s=new Set;for(let r of e){let i=r.tags.key;i&&s.add(i)}return s}catch{return new Set}}a(kt,"projectMemoryHashes");var St=32;function we(n={}){let e=(n.hookHost===void 0?process.env.PRJCT_HOOK_HOST:n.hookHost)?.trim().toLowerCase().slice(0,St);return e&&ie.has(e)?e:n.detectedRuntime??oe()}a(we,"resolveInstructionRuntime");V();function be(n){try{return JSON.parse(n)}catch{return null}}a(be,"safeJsonParse");function k(n,t,e,s){let r=[];try{let{prjctDb:i}=(B(),z(ot)),o=i.query(n,t,...e);for(let u of o){let c=be(u.data);if(!c||typeof c!="object")continue;let p=c.tags;if(!p)continue;let l=s(p,c);l!==void 0&&r.push(l)}}catch{}return r}a(k,"collectFromPersistedEvents");var Se="lean-detector",vt="lean-debt-growth",Tt=3,ke=["off","lite","full","ultra"];function Rt(n){let t=n?.lean?.mode;if(t&&ke.includes(t))return t;let e=process.env.PRJCT_LEAN_MODE?.toLowerCase();return e&&ke.includes(e)?e:"off"}a(Rt,"effectiveMode");async function ve(n,t){let e={active:!1,total:0,previous:0,persisted:!1},s=t!==void 0?t:await v.readConfig(n).catch(()=>null);if(!s?.projectId||Rt(s)==="off")return e;e.active=!0;try{let r=await Et(n);if(e.total=r,r===0)return e;let i=_t(s.projectId);e.previous=i;let o=r-i;i>0&&o>=Tt&&(await m.remember(n,{type:"lean-debt",content:`Lean debt growing: \`lean:\` markers rose by ${o} (now ${r}, was ${i}). Deferred simplifications are accumulating \u2014 consider a leaning pass via \`prjct lean debt\`.`,tags:{source:Se,pattern:vt,total:String(r),previous:String(i),delta:String(o)},provenance:"inferred",projectId:s.projectId}),e.persisted=!0)}catch{}return e}a(ve,"detectAndPersistLeanDebt");async function Et(n){let t=await A(["grep","-cI","-e","lean:"],{cwd:n,maxBuffer:16777216});if(!t.ok){if(P(t,1))return 0;C(t)}return t.stdout.split(`
|
|
11
|
+
`).reduce((e,s)=>{let r=s.lastIndexOf(":");if(r<=0)return e;let i=Number.parseInt(s.slice(r+1),10);return Number.isFinite(i)?e+i:e},0)}a(Et,"measureLeanMarkers");function _t(n){return k(n,"SELECT data FROM events WHERE type = 'memory.remember.lean-debt' ORDER BY id DESC LIMIT 50",[],e=>{if(e.source!==Se)return;let s=typeof e.total=="string"?Number.parseInt(e.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(_t,"collectPreviousSnapshot");import At from"node:path";V();var Ct="hot-file",Te="pattern-detector-auto",It="recurring-bug",Re="pattern-detector-recurring",xt="tech-debt-growth",Ee="pattern-detector-debt",O=7,Pt=3,N=30,Mt=2,Lt=5,Dt=[/^package(-lock)?\.json$/,/^bun\.lock(b)?$/,/^pnpm-lock\.yaml$/,/^yarn\.lock$/,/^CHANGELOG\.md$/,/^\.gitignore$/,/\.snap$/,/^dist\//,/^node_modules\//];async function _e(n,t){let e={scanned:0,hotFiles:[],persisted:0,skipped:[],errors:[]},s=t!==void 0?t:await v.readConfig(n).catch(()=>null);if(!s?.projectId)return e.errors.push("no project config"),e;try{let r=await Ot(n);if(e.scanned+=r.length,e.hotFiles=r,r.length>0){let i=jt(s.projectId);for(let o of r){if(i.has(o.path)){e.skipped.push({reason:"already-marked-this-window",file:o.path});continue}try{await m.remember(n,{type:"learning",content:`Hot file: \`${o.path}\` \u2014 ${o.touches} touches in the last ${O} days. Worth a refactor pass or a deliberate decision about why it churns this often.`,tags:{source:Te,pattern:Ct,file:o.path,touches:String(o.touches),window_days:String(O)},provenance:"inferred"}),e.persisted+=1}catch(u){e.errors.push(`remember failed for ${o.path}: ${u.message}`)}}}}catch(r){e.errors.push(`hot-file detection failed: ${r.message}`)}try{let r=$t(s.projectId);if(r.length>0){let i=Ut(s.projectId);for(let o of r){if(i.has(o.topic)){e.skipped.push({reason:"recurring-bug-already-marked",file:o.topic});continue}try{await m.remember(n,{type:"learning",content:`Recurring bug pattern: gotchas tagged \`topic:${o.topic}\` reported ${o.occurrences} times in the last ${N} days. Likely a real underlying issue \u2014 consider a focused investigation before patching the next instance.`,tags:{source:Re,pattern:It,topic:o.topic,occurrences:String(o.occurrences),window_days:String(N)},provenance:"inferred"}),e.persisted+=1}catch(u){e.errors.push(`remember failed for recurring ${o.topic}: ${u.message}`)}}}}catch(r){e.errors.push(`recurring-bug detection failed: ${r.message}`)}try{let r=await Ht(n);if(r.totalCount>0){let i=Ft(s.projectId),o=r.totalCount-i;if(i>0&&o>=Lt)try{await m.remember(n,{type:"learning",content:`Tech debt growing: TODO/FIXME/XXX count rose by ${o} (now ${r.totalCount}, was ${i}). Consider a focused debt-reduction pass before adding more features.`,tags:{source:Ee,pattern:xt,total:String(r.totalCount),previous:String(i),delta:String(o)},provenance:"inferred"}),e.persisted+=1}catch(u){e.errors.push(`remember failed for tech-debt: ${u.message}`)}}}catch(r){e.errors.push(`tech-debt detection failed: ${r.message}`)}return e}a(_e,"detectAndPersistPatterns");async function Ot(n){let t=await A(["log",`--since=${O}.days.ago`,"--name-only","--pretty=format:","-z"],{cwd:n,maxBuffer:16777216,timeoutMs:15e3});if(!t.ok){if(t.kind==="exit")return[];C(t)}let e=new Map;for(let r of t.stdout.split("\0")){let i=r.trim();i&&(Nt(i)||e.set(i,(e.get(i)??0)+1))}let s=[];for(let[r,i]of e)i<Pt||s.push({path:r,touches:i});return s.sort((r,i)=>i.touches-r.touches),s}a(Ot,"detectHotFiles");function Nt(n){let t=At.basename(n);for(let e of Dt)if(e.test(n)||e.test(t))return!0;return!1}a(Nt,"isIgnored");function $t(n){let t=new Date(Date.now()-N*24*60*60*1e3).toISOString(),e=k(n,"SELECT data, timestamp FROM events WHERE type = 'memory.remember.gotcha' AND timestamp >= ? ORDER BY id DESC LIMIT 500",[t],i=>{if(i.source==="transcript-auto")return;let o=typeof i.topic=="string"?i.topic:void 0,u=typeof i.area=="string"?i.area:void 0;return(o??u)||void 0}),s=new Map;for(let i of e)s.set(i,(s.get(i)??0)+1);let r=[];for(let[i,o]of s)o<Mt||r.push({topic:i,occurrences:o});return r.sort((i,o)=>o.occurrences-i.occurrences),r}a($t,"detectRecurringBugs");async function Ht(n){let t=await A(["grep","-cE","\\b(TODO|FIXME|XXX)\\b"],{cwd:n,maxBuffer:16777216});if(!t.ok){if(P(t,1))return{totalCount:0};C(t)}return{totalCount:t.stdout.split(`
|
|
12
|
+
`).reduce((s,r)=>{let i=r.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(r.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}a(Ht,"measureTechDebt");function Ft(n){return k(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50",[],e=>{if(e.source!==Ee)return;let s=typeof e.total=="string"?Number.parseInt(e.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(Ft,"collectPreviousDebtSnapshot");function jt(n){let t=Date.now()-O*24*60*60*1e3,e=k(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Te)return;let i=s.file,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let u=Date.parse(o);if(!Number.isNaN(u)&&u<t)return}return i}});return new Set(e)}a(jt,"collectAlreadyMarkedHotFiles");function Ut(n){let t=Date.now()-N*24*60*60*1e3,e=k(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Re)return;let i=s.topic,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let u=Date.parse(o);if(!Number.isNaN(u)&&u<t)return}return i}});return new Set(e)}a(Ut,"collectAlreadyMarkedRecurringBugs");st();it();import x from"node:fs/promises";import Ae from"node:path";B();var Bt={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Gt(n=process.env){let t=(n.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Bt[t==="conservative"||t==="standard"||t==="aggressive"?t:"standard"]}a(Gt,"resolveProfile");async function Jt(n,t){let e=Date.now()-t*24*60*60*1e3,r=m.recall(n,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<e);if(r.length===0)return 0;let i=[];for(let o of r)try{G.archive(n,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${t}d)`});let u=o.id.startsWith("mem_")?o.id.slice(4):null;u&&b.run(n,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(u)),b.run(n,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}a(Jt,"archiveAgedInbox");async function Wt(n,t){if(t===null)return 0;let e=Ae.join(ee.getGlobalProjectPath(n),"checkpoints"),s=await x.readdir(e).catch(()=>null);if(!s)return 0;let r=Date.now()-t*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let u=Ae.join(e,o);try{(await x.stat(u)).mtimeMs<r&&(await x.unlink(u),i.push(u))}catch{}}return i.length}a(Wt,"pruneOldCheckpoints");async function Xt(){let{getVerifyCachePath:n}=await import("./context7-service-GDJ3QICX.mjs"),t=n();try{let e=await x.stat(t);if((Date.now()-e.mtimeMs)/(1440*60*1e3)>7)return await x.unlink(t),!0}catch{}return!1}a(Xt,"rotateContext7Cache");async function Ce(n){let t=Gt(),e={inboxArchived:0,archivesPruned:0,checkpointsRemoved:0,context7CacheRotated:!1};try{e.inboxArchived=await Jt(n,t.inboxDays)}catch{}try{e.archivesPruned=G.pruneOldArchives(n,t.archivesDays)}catch{}try{e.checkpointsRemoved=await Wt(n,t.checkpointsDays)}catch{}try{e.context7CacheRotated=await Xt()}catch{}return e}a(Ce,"runSessionCleanup");async function Ie(n,t){if(t.inboxArchived+t.archivesPruned+t.checkpointsRemoved+(t.context7CacheRotated?1:0)===0)return;let r=`Session cleanup: ${[t.inboxArchived>0?`${t.inboxArchived} inbox archived`:null,t.archivesPruned>0?`${t.archivesPruned} archives pruned`:null,t.checkpointsRemoved>0?`${t.checkpointsRemoved} checkpoints removed`:null,t.context7CacheRotated?"context7 cache rotated":null].filter(i=>!!i).join(", ")}`;b.appendEvent(n,"memory.remember.system-event",{content:r,tags:{source:"session-cleanup",key:"last-cleanup"},provenance:"extracted",content_hash:te(r),project_id:n})}a(Ie,"recordCleanupReport");import Kt from"node:crypto";import zt from"node:fs/promises";import{z as w}from"zod";tt();B();var Pe="crew-run:",xe=w.object({id:w.string().min(1),spec_id:w.string().nullable().default(null),task_id:w.string().nullable().default(null),started_at:w.string().min(1),ended_at:w.string().min(1),implementer_summary:w.string().default(""),files_touched:w.array(w.string()).default([]),reviewer_verdict:w.enum(["APPROVED","CHANGES_REQUESTED"]),reviewer_notes:w.string().nullable().default(null)});function $(n){return`${Pe}${n}`}a($,"keyFor");var X=class{static{a(this,"CrewRunStorage")}record(t,e){let s=e.runId??ne(),r=b.getDoc(t,$(s));if(r)return r;let i=Q(),o=xe.parse({id:s,spec_id:e.specId??null,task_id:e.taskId??null,started_at:e.startedAt??i,ended_at:e.endedAt??i,implementer_summary:e.implementerSummary,files_touched:e.filesTouched,reviewer_verdict:e.reviewerVerdict,reviewer_notes:e.reviewerNotes??null});return b.setDoc(t,$(s),o),o}get(t,e){return b.getDoc(t,$(e))}list(t){return b.listDocsByPrefix(t,Pe).map(s=>xe.parse(s.data))}delete(t,e){b.deleteDoc(t,$(e))}},Me=new X;var Ne="skill-miss-detector",Le=3,Yt=280,qt=["decision","gotcha","anti-pattern"],Vt=5400*1e3,Qt=360*60*1e3,Zt=2,$e=5,en=8,He=new Set(["should","because","project","prjct","instead","always","never","using","value","state","change","changes","update","updated","function","return","returns","error","errors","tests","testing","config","default","import","export","before","after","without"]);async function Fe(n,t,e,s={}){let r=s.preloadedLines?s.preloadedLines:await zt.readFile(t,"utf-8").then(nn).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=I(n);if(!i)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=rn(r);if(!o)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let u=(()=>{try{return cn(i,e)}catch{return null}})();if(!u)return{signalsRecorded:0,signalsSkipped:0,failures:[]};if(u.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let c=await se(n).catch(()=>[]),p=(()=>{try{let h=Date.now()-Qt;return new Set(Me.list(i).filter(g=>Date.parse(g.ended_at)>h).flatMap(g=>g.files_touched))}catch{return new Set}})(),l=tn(o,c,u,p);if(l.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let f=un(i),d=[];for(let h of l.slice(0,Le)){let g=an(h.memId,h.excerpt).slice(0,12);if(f.has(g)){d.push("skipped");continue}try{await m.remember(n,{type:"improvement-signal",content:on(h),tags:{source:Ne,kind:"skill-miss",category:"skill-miss",...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},relates:h.memId,file:h.evidenceFile,key:g,...e?{session:e}:{}},provenance:"extracted",projectId:i}),M.penalizeSkillMiss(i,h.memId),d.push("recorded")}catch{d.push("skipped")}}let y=d.filter(h=>h==="recorded").length,R=d.filter(h=>h==="skipped").length;return{signalsRecorded:y,signalsSkipped:R,failures:l.slice(0,Le).map(h=>({category:"skill-miss",expectedBehavior:`Apply relevant project rule ${h.memId}.`,observedBehavior:"Relevant project knowledge was not referenced in the session.",relatedRuleId:h.memId}))}}a(Fe,"detectSkillMisses");function tn(n,t,e,s=new Set){let r=De(n);if(r.size===0)return[];let i=t.filter(c=>!s.has(c)),o=H(i),u=[];for(let c of e){let p=De(`${c.content} ${c.fileTag}`);if(p.size===0)continue;let l=c.fileTag!==""&&i.some(g=>Oe(g,c.fileTag))||[...o].some(g=>p.has(g)),f=sn(p),d=[...p].filter(g=>!f.has(g)&&r.has(g)).length;if(!(l||d>=Zt)||[...f].some(g=>r.has(g)))continue;let h=c.fileTag!==""&&i.some(g=>Oe(g,c.fileTag))?c.fileTag:i.find(g=>[...H([g])].some(et=>p.has(et)))??"";u.push({miss:{memId:c.id,memType:c.type,excerpt:c.content.replace(/\s+/g," ").trim().slice(0,Yt),evidenceFile:h,reason:l?"path-overlap-unused":"topic-overlap-unused"},rank:l?2:1,overlap:d})}return u.sort((c,p)=>p.rank-c.rank||p.overlap-c.overlap),u.map(c=>c.miss)}a(tn,"analyze");function nn(n){return T(n)}a(nn,"parseJsonl");function rn(n){let t=[];for(let e of n){let s=e.role??e.message?.role;if(s!=="user"&&s!=="assistant")continue;let r=D(e.content??e.message?.content);r&&t.push(r)}return t.join(`
|
|
13
|
+
`).toLowerCase()}a(rn,"transcriptTextOf");function De(n){let t=new Set;for(let e of n.toLowerCase().split(/[^a-z0-9]+/))e.length<$e||He.has(e)||t.add(e);return t}a(De,"tokenize");function sn(n){let t=[...n].filter(s=>s.length>=en);if(t.length>0)return new Set(t);let e=[...n].sort((s,r)=>r.length-s.length||s.localeCompare(r))[0]??"";return e?new Set([e]):new Set}a(sn,"signatureOf");function H(n){let t=new Set;for(let e of n)for(let s of e.split("/")){let r=s.replace(/\.[a-z0-9]+$/i,"").toLowerCase();r.length>=$e&&!He.has(r)&&t.add(r)}return t}a(H,"fileStems");function Oe(n,t){let e=H([n]);for(let s of H([t]))if(e.has(s))return!0;return!1}a(Oe,"sharesStem");function on(n){let t=n.evidenceFile!==""?`touched \`${n.evidenceFile}\``:"worked the same area";return[`[skill-miss] Unused project knowledge (${n.memType}, ${n.memId}): "${n.excerpt}"`,`This session ${t} but never referenced it. Apply it, or supersede it via: prjct remember decision "<resolution>" --tags resolves:skill-miss,relates:${n.memId}`].join(`
|
|
14
|
+
`)}a(on,"formatSkillMiss");function an(n,t){let e=`${n}::${t.toLowerCase().replace(/\s+/g," ").trim()}`;return Kt.createHash("sha256").update(e).digest("hex")}a(an,"hashKey");function cn(n,t){let e=m.recall(n,{types:[...qt],limit:120}),s=Date.now()-Vt,r=[];for(let i of e)i.provenance!=="inferred"&&(Date.parse(i.rememberedAt)>s||t&&i.tags.session===t||r.push({id:i.id,type:i.type,content:i.content,fileTag:i.tags.file??"",rememberedAt:i.rememberedAt,provenance:i.provenance,session:i.tags.session??""}));return r}a(cn,"recallCandidates");function un(n){try{let t=m.recall(n,{types:["improvement-signal"],tags:{source:Ne},limit:100,dedupeByKey:!1}),e=new Set;for(let s of t)s.tags.key&&e.add(s.tags.key);return e}catch{return new Set}}a(un,"existingSkillMissKeys");import ln from"node:crypto";import pn from"node:fs/promises";var Be="transcript-auto",dn="v2",Ge=80,Je=20,F=1500,fn=12,je=4,gn=[{phrase:"decided to",type:"decision"},{phrase:"we chose",type:"decision"},{phrase:"going with",type:"decision"},{phrase:"the right call",type:"decision"},{phrase:"best approach is",type:"decision"},{phrase:"we will use",type:"decision"},{phrase:"shipping with",type:"decision"},{phrase:"turns out that",type:"learning"},{phrase:"now i understand",type:"learning"},{phrase:"the key insight",type:"learning"},{phrase:"i learned that",type:"learning"},{phrase:"discovered that",type:"learning"},{phrase:"root cause is",type:"learning"},{phrase:"root cause was",type:"learning"},{phrase:"the fix is",type:"learning"},{phrase:"gotcha:",type:"gotcha"},{phrase:"bug:",type:"gotcha"},{phrase:"fails when",type:"gotcha"},{phrase:"breaks when",type:"gotcha"},{phrase:"be careful",type:"gotcha"},{phrase:"never do this",type:"gotcha"},{phrase:"trap:",type:"gotcha"},{phrase:"important:",type:"fact"},{phrase:"always use",type:"fact"},{phrase:"never write",type:"fact"},{phrase:"the pattern is",type:"pattern"},{phrase:"anti-pattern:",type:"anti-pattern"},{phrase:"antipattern:",type:"anti-pattern"}],We=[{re:/^(?:[-*•]\s+)?(?:\*\*)?decision(?:\*\*)?\s*[:—-]\s+/i,type:"decision",phrase:"label:decision"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(learning|insight)(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:learning"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(gotcha|trap|warning)(?:\*\*)?\s*[:—-]\s+/i,type:"gotcha",phrase:"label:gotcha"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(fact|note)(?:\*\*)?\s*[:—-]\s+/i,type:"fact",phrase:"label:fact"},{re:/^(?:[-*•]\s+)?(?:\*\*)?root\s*cause(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:root-cause"},{re:/^(?:[-*•]\s+)?(?:\*\*)?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"pattern",phrase:"label:pattern"},{re:/^(?:[-*•]\s+)?(?:\*\*)?anti[- ]?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"anti-pattern",phrase:"label:anti-pattern"}];async function Xe(n,t,e,s={}){let r={scanned:0,ingested:0,skipped:[],errors:[]},i=s.preloadedConfig!==void 0?s.preloadedConfig:await v.readConfig(n).catch(()=>null);if(!i?.projectId)return r.errors.push("no project config"),r;let o=await(async()=>{if(s.preloadedLines)return s.preloadedLines;try{return T(await pn.readFile(t,"utf-8"))}catch(d){return r.errors.push(`transcript read failed: ${d.message}`),null}})();if(o===null)return r;let u=mn(o),c=hn(o);if(r.scanned=u.length+c.length,u.length===0&&c.length===0)return r;let p=[...kn(u),...wn(c)];if(p.length===0)return r;let l=vn(i.projectId),f=e?e.slice(0,12):"unknown";for(let d of p){if(l.has(d.hash)){r.skipped.push({reason:"duplicate",phrase:d.matchedPhrase});continue}try{await m.remember(n,{type:d.type,content:d.content,tags:{source:Be,capture:dn,session:f,hash:d.hash,phrase:d.matchedPhrase},provenance:"inferred",projectId:i.projectId}),r.ingested+=1}catch(y){r.errors.push(`remember failed: ${y.message}`)}}return r}a(Xe,"ingestTranscript");function mn(n){let t=[];for(let e of n){let s=Ke(e);if(s!=="assistant")continue;let r=ze(e);!r||r.length<Ge||t.push({role:s,text:r})}return t}a(mn,"projectMessages");function hn(n){let t=[];for(let e of n){let s=Ke(e);if(s!=="user")continue;let r=ze(e);!r||r.length<Je||t.push({role:s,text:r})}return t}a(hn,"projectUserMessages");var yn=[{re:/^(?:please\s+)?always\b/i,phrase:"user:always"},{re:/^(?:please\s+)?never\b/i,phrase:"user:never"},{re:/\bi (?:always|never|prefer)\b/i,phrase:"user:i-prefer"},{re:/^(?:rule|preference)\s*[:—-]/i,phrase:"user:rule"},{re:/\bno more\s+(?:features?|feature\s+creep)\b/i,phrase:"user:no-more-features"},{re:/\bdon'?t add (?:more )?(?:features?|surface)\b/i,phrase:"user:dont-add-features"}];function wn(n){let t=[],e=new Set;for(let s of n){if(t.length>=je)break;let r=s.text.split(/\n/).map(o=>o.replace(/^[-*•]\s+/,"").trim()).filter(o=>o.length>=Je),i=r.length>0?r:[s.text.trim()];for(let o of i){if(t.length>=je)break;let u=yn.find(l=>l.re.test(o));if(!u)continue;let c=o.length>F?`${o.slice(0,F)}\u2026`:o,p=Ye(c);e.has(p)||(e.add(p),t.push({type:"feedback",content:c,hash:p,matchedPhrase:u.phrase}))}}return t}a(wn,"extractUserPreferenceCandidates");function Ke(n){let t=n.role;if(typeof t=="string")return Ue(t);let e=n.message;if(e&&typeof e=="object"&&"role"in e){let r=e.role;if(typeof r=="string")return Ue(r)}let s=n.type;return s==="assistant"||s==="user"||s==="system"?s:null}a(Ke,"inferRole");function Ue(n){let t=n.toLowerCase();return t==="assistant"||t==="user"||t==="system"?t:null}a(Ue,"normalizeRole");function ze(n){let t=n.content===void 0&&n.message&&typeof n.message=="object"?n.message.content:n.content;if(typeof t=="string")return t.trim();if(Array.isArray(t)){let e=[];for(let s of t){if(!s||typeof s!="object")continue;let r=s;r.type==="text"&&typeof r.text=="string"&&e.push(r.text)}return e.join(`
|
|
15
|
+
`).trim()}return""}a(ze,"extractText");function bn(n){let t=n.trim();if(t.length<Ge)return null;for(let r of We)if(r.re.test(t))return{type:r.type,matchedPhrase:r.phrase};let e=t.toLowerCase(),s=gn.find(r=>e.includes(r.phrase));return s?{type:s.type,matchedPhrase:s.phrase}:null}a(bn,"classifyCaptureParagraph");function kn(n){let t=[],e=new Set;for(let s of n){let r=Sn(s.text);for(let i of r){if(t.length>=fn)return t;let o=bn(i);if(!o)continue;let u=i.length>F?`${i.slice(0,F)}\u2026`:i,c=Ye(u);e.has(c)||(e.add(c),t.push({type:o.type,content:u,hash:c,matchedPhrase:o.matchedPhrase}))}}return t}a(kn,"extractCandidates");function Sn(n){let t=n.split(/\n\s*\n/).map(s=>s.trim()).filter(Boolean),e=[];for(let s of t){let r=s.split(`
|
|
16
|
+
`).map(o=>o.trim()).filter(Boolean);if(r.some(o=>We.some(u=>u.re.test(o)))&&r.length>1)for(let o of r)e.push(o);else e.push(s)}return e}a(Sn,"splitParagraphs");function Ye(n){return ln.createHash("sha256").update(n.toLowerCase().trim()).digest("hex").slice(0,16)}a(Ye,"hashContent");function vn(n){try{let{REMEMBER_EVENT_RANGE:t}=(ct(),z(at)),e=k(n,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",[...t],s=>{if(s.source!==Be)return;let r=s.hash;return typeof r=="string"?r:void 0});return new Set(e)}catch{return new Set}}a(vn,"collectExistingAutoHashes");rt();nt();import Tn from"node:fs/promises";import qe from"node:path";function Rn(){return process.env.PRJCT_TEST_MODE==="1"?qe.join(U(".prjct-tests"),"kimi-code","sessions"):U(".kimi-code","sessions")}a(Rn,"getKimiSessionsRoot");async function Ve(n,t=Rn()){let e=n.replace(/[^a-zA-Z0-9_-]/g,"");if(!e)return;let s=e.startsWith("session_")?[e]:[e,`session_${e}`],r=await Tn.readdir(t,{withFileTypes:!0}).catch(()=>[]);for(let i of r)if(i.isDirectory())for(let o of s){let u=qe.join(t,i.name,o,"agents","main","wire.jsonl");if(await Z(u))return u}}a(Ve,"resolveKimiTranscriptPath");var j=600*1e3,_=new Map;function En(n){let t=n.replace(/[^a-zA-Z0-9._-]/g,"_");return Qe.join(q.runDir(),`stop-heavy-${t}.stamp`)}a(En,"heavyStepStampPath");async function Ze(n,t,e=!0){if(await S.stat(n).then(i=>t-i.mtimeMs<j).catch(()=>!1))return!1;let r=`${n}.lock`;try{await S.mkdir(r)}catch(i){if(i.code!=="EEXIST")throw i;return!await S.stat(r).then(u=>t-u.mtimeMs>=j).catch(()=>!1)||!e?!1:(await S.rmdir(r).catch(()=>{}),Ze(n,t,!1))}try{return await S.stat(n).then(o=>t-o.mtimeMs<j).catch(()=>!1)?!1:(await S.writeFile(n,String(t)),!0)}finally{await S.rmdir(r).catch(()=>{})}}a(Ze,"claimHeavyStep");async function _n(n){let t=Date.now(),e=_.get(n)??0;if(t-e<j)return!1;try{let s=En(n);await S.mkdir(Qe.dirname(s),{recursive:!0});let r=await Ze(s,t);return _.size>32&&_.clear(),_.set(n,t),r}catch{}return _.size>32&&_.clear(),_.set(n,t),!0}a(_n,"heavyStepsDue");function cs(n=process.cwd(),t){return ce({event:"Stop",projectPath:n,afterEmit:a(async(e,s)=>{let r=await v.readConfig(s).catch(()=>null);if(!r?.projectId)return;let i=we(),o=e.transcript_path??(Y()==="kimi"&&e.session_id?await Ve(e.session_id).catch(()=>{}):void 0),u=await _n(r.projectId),c={};if(u&&o){let l=await S.readFile(o,"utf-8").catch(()=>null);l!==null&&(c.transcriptLines=T(l))}let p=ue(c.transcriptLines??[]);if(u)try{let{collectActiveTasks:l}=await import("./task-overview-PCUZWL5Q.mjs"),f=await l(r.projectId,s);c.activeTaskId=f.current?.id,c.activeTaskDescription=f.current?.description,c.activeTaskStartedAt=f.current?.startedAt}catch{}if(c.transcriptLines&&c.transcriptLines.length>0)try{if(c.transcriptUsage=W(c.transcriptLines),c.transcriptUsage.tokensIn+c.transcriptUsage.tokensOut>0){let l=c.activeTaskStartedAt?{sinceIso:c.activeTaskStartedAt}:void 0,f=W(c.transcriptLines,l);if(c.activeTaskId&&f.tokensIn+f.tokensOut>0){J(r.projectId,c.activeTaskId,f.tokensIn,f.tokensOut,{description:c.activeTaskDescription,agent:i,source:`${i}-transcript`});try{let{sumTranscriptUsageByModel:d}=await import("./transcript-jsonl-7W2NOJPZ.mjs");for(let[y,R]of d(c.transcriptLines,l))R.tokensIn+R.tokensOut<=0||J(r.projectId,c.activeTaskId,R.tokensIn,R.tokensOut,{model:y,agent:i,source:`${i}-transcript:${y}`})}catch{}}}}catch{}if(ae({projectId:r.projectId,sessionId:e.session_id,directory:s,taskId:c.activeTaskId,goal:c.activeTaskDescription,tokensIn:c.transcriptUsage?.tokensIn,tokensOut:c.transcriptUsage?.tokensOut,agent:i,model:p}),u&&o)try{await Xe(s,o,e.session_id??null,{preloadedConfig:r,preloadedLines:c.transcriptLines})}catch{}if(u){try{await _e(s,r)}catch{}try{await ve(s,r)}catch{}try{let l=await Ce(r.projectId);await Ie(r.projectId,l),L.pruneRetained(r.projectId)}catch{}}if(u&&o)try{let l=await me(s,o,e.session_id??null,{preloadedLines:c.transcriptLines,runtime:i,model:p});for(let f of l.failures)try{L.record(r.projectId,{source:"friction-detector",runtime:i,model:p,sessionId:e.session_id??null,taskId:c.activeTaskId??null,...f})}catch{}l.signalsRecorded>0&&c.activeTaskId&&M.penalizeSurfaced(r.projectId,c.activeTaskId)}catch{}if(u&&o)try{let l=await Fe(s,o,e.session_id??null,{preloadedLines:c.transcriptLines,runtime:i,model:p});for(let f of l.failures)try{L.record(r.projectId,{source:"skill-miss-detector",runtime:i,model:p,sessionId:e.session_id??null,taskId:c.activeTaskId??null,...f})}catch{}}catch{}if(u)try{await re.backfill(r.projectId,r,new Date().toISOString())}catch{}if(u&&c.activeTaskId){let l={projectId:r.projectId,projectPath:s,cycleDescription:c.activeTaskDescription??null,cycleId:c.activeTaskId,tokensIn:c.transcriptUsage?.tokensIn,tokensOut:c.transcriptUsage?.tokensOut,model:p},f=a(async d=>{try{await d()}catch{}},"runBestEffort");await f(async()=>{let{synthesizeLandHandoff:d}=await import("./land-synthesis-JLYUBKHR.mjs");await d(l)}),await f(async()=>{let{synthesizeJudgmentReceipt:d}=await import("./judgment-receipt-7A2DXVJA.mjs");await d(l)})}try{let{flushIfLinked:l}=await import("./auto-flush-CXWTU3RF.mjs");await l(s,r)}catch{}},"afterEmit")},t)}a(cs,"runStopHook");export{En as heavyStepStampPath,_n as heavyStepsDue,cs as runStopHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a}from"./chunk-GLPKMG5A.mjs";import"./chunk-QBYHZX33.mjs";import{a as i}from"./chunk-GPZP7NXL.mjs";import"./chunk-2UC4DTDO.mjs";import"./chunk-BOBFTVAY.mjs";import"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-4HAKTI36.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{d as e,g as m}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";m();function l(c=process.cwd(),p){return i({event:"SubagentStart",projectPath:c,build:o((u,t)=>a(t),"build"),afterEmit:o(async(u,t)=>{try{let r=await n.readConfig(t);if(!r?.projectId)return;let{collectActiveTasks:s}=await import("./task-overview-PCUZWL5Q.mjs"),d=await s(r.projectId,t);e.appendEvent(r.projectId,"subagent.spawned",{taskId:d.current?.id??null})}catch{}},"afterEmit")},p)}o(l,"runSubagentStartHook");export{l as runSubagentStartHook};
|
|
@@ -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 f,b as p}from"./chunk-OWOPA2O7.mjs";import{a as s}from"./chunk-
|
|
8
|
+
import{a as f,b as p}from"./chunk-OWOPA2O7.mjs";import{a as s}from"./chunk-GPZP7NXL.mjs";import{a}from"./chunk-EWOK4VE7.mjs";import{a as c}from"./chunk-ZOX6OV6X.mjs";import"./chunk-T6ELTQZM.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as r}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";function w(u=process.cwd(),g){return s({event:"SubagentStop",projectPath:u,afterEmit:i(async(d,n)=>{let o=await r.readConfig(n).catch(()=>null);if(!o?.projectId||f(o)==="off")return;let e=[];try{let t=await a(o.projectId,n);t.current&&e.push(`active: ${t.current.description}`)}catch{}try{let t=await c.getActiveTasks(o.projectId);t.length>0&&e.push(`pending: ${t.length}`)}catch{}await p("prjct \u2014 subagent finished",e.join(" \xB7 ")||"A subagent finished")},"afterEmit")},g)}i(w,"runSubagentStopHook");export{w as runSubagentStopHook};
|
package/dist/bin/hook-chunks/{surface-attribution-K37N2NK7.mjs → surface-attribution-A6GCGRFM.mjs}
RENAMED
|
@@ -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}from"./chunk-
|
|
8
|
+
import{a}from"./chunk-N3L77UNM.mjs";import"./chunk-4HAKTI36.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as recordSurfacedForActiveTask};
|
|
@@ -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 a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"./chunk-
|
|
8
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"./chunk-22AXWLI6.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as extractFile,l as fileFanIn,m as fileFanInByFile,n as filesCallingInto,e as hasSymbolIndex,c as indexSymbols,g as listAllSymbols,f as loadMeta,i as scoreFilesFromQuery,h as searchSymbols,a as stripNoise,j as symbolsInFile,k as tracePath,d as updateSymbols};
|
|
@@ -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 a,d as b}from"./chunk-
|
|
8
|
+
import{c as a,d as b}from"./chunk-OC4CYF7V.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-XDBJSJOT.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as default,a as syncClient};
|
package/dist/bin/hook-chunks/{sync-cursor-storage-E3LMZISA.mjs → sync-cursor-storage-VVLA3L2U.mjs}
RENAMED
|
@@ -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 s,g as a}from"./chunk-
|
|
8
|
+
import{e as s,g as a}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b as i,h as o}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";o();a();var d=class{static{l(this,"SyncCursorStorage")}get(t,r=null,e=null){if(!e)return null;let n=s.get(t,`SELECT * FROM sync_cursors
|
|
9
9
|
WHERE project_id = ?
|
|
10
10
|
AND device_id = ?
|
|
11
11
|
AND ${r===null?"user_id IS NULL":"user_id = ?"}`,...r===null?[t,e]:[t,e,r]);return n?this.rowToCursor(n):null}touch(t,r=null,e=null){if(!e)return;let n=i();this.upsert({userId:r,deviceId:e,projectId:t,lastEventId:this.getLastEventId(t,r,e),updatedAt:n})}advance(t,r,e={}){let n=e.userId??null,u=e.deviceId??null;if(!u)return;let _=this.getLastEventId(t,n,u);r<=_||this.upsert({userId:n,deviceId:u,projectId:t,lastEventId:r,updatedAt:i()})}getLastEventId(t,r,e){return s.get(t,`SELECT last_event_id FROM sync_cursors
|
package/dist/bin/hook-chunks/{task-orchestration-2ZYE5M6J.mjs → task-orchestration-HFZYWYLR.mjs}
RENAMED
|
@@ -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,b,c}from"./chunk-
|
|
8
|
+
import{a,b,c}from"./chunk-RHKF7EJW.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-J5UQVJUW.mjs";import"./chunk-YDBZO6I3.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as orchestrationFor,a as pointsFromDiffLines,b as renderDelegationTrigger};
|
|
@@ -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,b,c}from"./chunk-
|
|
8
|
+
import{a,b,c}from"./chunk-EWOK4VE7.mjs";import"./chunk-T6ELTQZM.mjs";import"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as collectActiveTasks,b as formatActiveTaskLine,c as formatActiveTaskList};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-FXFG6PV6.mjs";import"./chunk-WGWE3CSC.mjs";import"./chunk-KSSRINDX.mjs";import"./chunk-H4CA3XZ6.mjs";import"./chunk-MHNWIB7B.mjs";import"./chunk-T6ELTQZM.mjs";import"./chunk-RHKF7EJW.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-GDESYWTD.mjs";import"./chunk-J5UQVJUW.mjs";import"./chunk-YDBZO6I3.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-Z6KVLCMK.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-3WQBTXUC.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{e as TASK_CONTEXT_PROMPT,h as completeActiveTask,a as formatRelatedContextForAgent,b as formatRiskForAgent,i as readLastStatus,d as recallRisksForFiles,g as resolveActiveTask,f as setTaskStatus,c as startTask};
|
|
@@ -5,6 +5,6 @@ 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 M,b as l}from"./chunk-
|
|
8
|
+
import{a as M,b as l}from"./chunk-BX7VKYA7.mjs";import{a as d}from"./chunk-GDECEHO5.mjs";import{a as T,d as k}from"./chunk-S6L3FECF.mjs";import{a as u}from"./chunk-H4CA3XZ6.mjs";import{a as c}from"./chunk-MHNWIB7B.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import{b as h}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{a as D,p as w}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import{e as f,f as $}from"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";$();w();var i=["off","assist","strict"],C=class extends k{static{m(this,"TddCommands")}async tdd(s=null,t=process.cwd(),n={}){let e=M(s,i);return e.kind==="status"?this.showStatus(t,n):e.kind==="mode"?this.setMode(e.mode,t,n):e.sub==="check"?this.check(t,n):T(`Unknown tdd subcommand "${e.sub}". Use: check, or ${i.join("|")}.`,n)}async showStatus(s,t){let n=await l(s,t);if(!n.ok)return n.result;let e=n.value,o=y(e),a=(await u(s).catch(()=>null))?.test?.command??null,p=[`Mode: ${o}${o==="off"?" (guidance + ship TDD gate dormant)":""}`,`Test command: ${a??"none detected (add tests to enable the gate)"}`,"Set: prjct tdd off|assist|strict","Check: prjct tdd check \u2014 run the test command now (red/green)"];return t.md?console.log(d("## TDD",`> **Mode**: \`${o}\``,`- Test command: \`${a??"none detected"}\``,p.slice(2).join(`
|
|
9
9
|
`))):c.info(`TDD \u2014 ${p.join(`
|
|
10
10
|
`)}`),{success:!0,mode:o,testCommand:a}}async setMode(s,t,n){let e=await l(t,n);if(!e.ok)return e.result;let o=e.value;o.tdd={mode:s},await h.writeConfig(t,o);let r=s==="off"?"TDD mode off \u2014 test-first guidance and the ship TDD gate are dormant.":s==="assist"?"TDD mode \u2192 assist. Guidance biases test-first (red\u2192green\u2192refactor); `ship` reminds.":"TDD mode \u2192 strict. Test-first expected; `ship` surfaces a hard gate \u2014 run `prjct tdd check` and don't ship on red.";return n.md?console.log(d("## TDD",`> ${r}`)):c.done(r),{success:!0,mode:s}}async check(s,t){let e=(await u(s).catch(()=>null))?.test?.command;if(!e){let o="tdd check: no test command detected for this stack. Add a test script first.";return console.log(t.md?d("## TDD check",`> ${o}`):o),{success:!1,reason:"no_test_command"}}try{await D(e,{cwd:s,maxBuffer:32*1024*1024});let o=`tdd check: GREEN \u2014 \`${e}\` passed.`;return console.log(t.md?d("## TDD check",`> \u2705 ${o}`):o),{success:!0,green:!0,testCommand:e}}catch(o){let r=`tdd check: RED \u2014 \`${e}\` failed. Fix before shipping.`;return t.md?console.log(d("## TDD check",`> \u274C ${r}`,f(o))):(c.fail(r),c.info(f(o))),{success:!1,green:!1,testCommand:e}}}};function y(g){let s=g?.tdd?.mode;if(s&&i.includes(s))return s;let t=process.env.PRJCT_TDD_MODE?.toLowerCase();return t&&i.includes(t)?t:"off"}m(y,"effectiveTddMode");var L={effectiveTddMode:y,TDD_MODES:i};export{C as TddCommands,L as _internal,y as effectiveTddMode};
|
|
@@ -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 a,c as b,d as c,e as d}from"./chunk-
|
|
8
|
+
import{b as a,c as b,d as c,e as d}from"./chunk-FW4MEPTB.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{d as default,b as getTemplateContent,c as listTemplates,a as resetBundle};
|
package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs}
RENAMED
|
@@ -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,b,c,d,e}from"./chunk-
|
|
8
|
+
import{a,b,c,d,e}from"./chunk-32RX4YGI.mjs";import"./chunk-E66B27AL.mjs";export{a as identifyTranscriptModel,b as parseTranscriptJsonl,d as sumTranscriptUsage,e as sumTranscriptUsageByModel,c as sumTranscriptUsageDetailed};
|
|
@@ -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,b,c}from"./chunk-
|
|
8
|
+
import{a,b,c}from"./chunk-4HAKTI36.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as extractCorrectionIds,a as extractRefIds,c as usefulnessService};
|
package/dist/bin/hook-chunks/{vault-retire-notice-HT756AND.mjs → vault-retire-notice-HOXPURNQ.mjs}
RENAMED
|
@@ -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{e as t,g as a}from"./chunk-
|
|
8
|
+
import{e as t,g as a}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as n}from"./chunk-E66B27AL.mjs";a();var r="vault-retire-notice-shown";async function c(o,e){try{return!(o?.vault?.mode==="export")||t.getDoc(e,r)?.shown?null:(t.setDoc(e,r,{shown:!0}),["> **prjct has removed the Obsidian/markdown vault feature.**","> Any files it previously generated are untouched on disk, but prjct no","> longer regenerates them. Agents read project knowledge through prjct","> tools (`prjct search`, `prjct context memory`, `prjct_analysis`, \u2026)."].join(`
|
|
9
9
|
`))}catch{return null}}n(c,"vaultRetirementNotice");export{c as vaultRetirementNotice};
|
package/dist/bin/hook-chunks/{velocity-storage-47CF3XWZ.mjs → velocity-storage-5J6BAMCW.mjs}
RENAMED
|
@@ -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,b}from"./chunk-
|
|
8
|
+
import{a,b}from"./chunk-IWJG7CZX.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as epochWeek,b as velocityStorage};
|
|
@@ -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{h as a,i as b,j as c,k as d,l as e}from"./chunk-
|
|
8
|
+
import{h as a,i as b,j as c,k as d,l as e}from"./chunk-PP6DANGV.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as conflictModeWithWeakModel,a as effectiveWeakModelMode,c as qualityFloorWithWeakModel,d as weakModelBanner,e as weakModelOneLiner};
|
|
@@ -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{d as i,g as E}from"./chunk-
|
|
8
|
+
import{d as i,g as E}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";E();var _=["blocks","parent"];function m(d,t=0){return{id:d.id,description:d.description,type:d.type,priority:d.priority,section:d.section,claimedBy:d.claimed_by,createdAt:d.created_at,unblocks:t}}p(m,"rowToReadyItem");var u=`
|
|
9
9
|
SELECT d.from_id FROM work_dependencies d
|
|
10
10
|
WHERE d.dep_type IN ('blocks', 'parent')
|
|
11
11
|
AND (
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f}from"./chunk-GDESYWTD.mjs";import"./chunk-Z6KVLCMK.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as extractFilePathsFromEntries,d as formatWorkScopeBlock,f as isUsefulScopePath,b as resolveWorkScope,a as resolveWorkScopeSync,e as toLikelyFileHits};
|
package/dist/bin/hook-chunks/{workspace-occupancy-UUW4UGGB.mjs → workspace-occupancy-3D4OKQRB.mjs}
RENAMED
|
@@ -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 w,e as k}from"./chunk-TRMBRDKH.mjs";import{a as g}from"./chunk-
|
|
8
|
+
import{c as w,e as k}from"./chunk-TRMBRDKH.mjs";import{a as g}from"./chunk-EWOK4VE7.mjs";import{c as u,d}from"./chunk-T6ELTQZM.mjs";import"./chunk-TPESWBA7.mjs";import{b as i}from"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as s}from"./chunk-E66B27AL.mjs";function b(e,o){return{taskId:e.id,description:e.description,ownerAgent:e.ownerAgent,ownerIdentity:e.ownerIdentity,startedAt:e.startedAt,workspaceId:o,branch:e.branch}}s(b,"asOwner");async function W(e,o,c){let t=c??w(o),r=await d(o),f=await g(e,o),p=r.isMain?await i.getCurrentTask(e):await i.getCurrentTaskForWorkspace(e,r.workspaceId),a=p?b(p,r.isMain?u:r.workspaceId):null,y=f.all.filter(n=>!n.isCurrent).map(n=>({taskId:n.id,description:n.description,startedAt:n.startedAt,workspaceId:n.workspaceId,branch:n.branch})),l=a!==null,I=l&&k(a,t);return{workspaceId:r.workspaceId,isMain:r.isMain,current:a,others:y,occupied:l,occupiedByMe:I}}s(W,"getOccupancy");function M(e,o,c){if(o==="off")return{isolate:!1,reason:"autoWorktree off"};if(!e.occupied||e.occupiedByMe)return{isolate:!1,reason:"workspace free or owned by caller"};let t=e.current,r=[t.ownerAgent,t.ownerIdentity].filter(Boolean).join("/")||"another agent";return e.isMain?o==="ask"?{isolate:!1,block:!0,occupant:t,reason:`Workspace owned by ${r} on "${t.description}" (${t.taskId.slice(0,8)}). Re-run with isolation (config multiAgent.autoWorktree=auto) or \`prjct switch <agent>\` to yield that cycle.`}:{isolate:!0,occupant:t,reason:`Branch/workspace owned by ${r} on "${t.description}" (${t.taskId.slice(0,8)}). Isolating to a sibling worktree.`}:{isolate:!1,block:!0,occupant:t,reason:`Workspace already owned by ${r} on "${t.description}" (${t.taskId.slice(0,8)}). Work elsewhere or \`prjct switch\` to take over.`}}s(M,"shouldIsolate");function $(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||`work-${Date.now().toString(36)}`}s($,"worktreeSlugFromIntent");export{W as getOccupancy,M as shouldIsolate,$ as worktreeSlugFromIntent};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|