prjct-cli 3.94.0 → 3.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +27 -21
- package/dist/bin/hook-chunks/{agent-identity-45BYQBU2.mjs → agent-identity-DH6DX72X.mjs} +1 -1
- package/dist/bin/hook-chunks/{agent-switch-2U2LOBGR.mjs → agent-switch-I4MTVE56.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-N4NYGIG3.mjs → analysis-VN7APBHR.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-DX3FVSQE.mjs} +1 -1
- package/dist/bin/hook-chunks/{capture-gate-FRF2G3IG.mjs → capture-gate-MEIQD7ZS.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OZJ6UKKP.mjs → chunk-22GFTUER.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-Q3EYM4GJ.mjs → chunk-33BHU4OM.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-HNEKXKOI.mjs → chunk-3AHW4XQH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JMCMTX6U.mjs → chunk-3CKNJ5RA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6RLCUGGG.mjs → chunk-3FEXJUO2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7GNWHWOO.mjs → chunk-3HGQPUKG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-D6IONKRA.mjs → chunk-3UB6SFRA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AVRNHROK.mjs → chunk-64ZEBHDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MI3JEFON.mjs → chunk-7PBWIO4K.mjs} +3 -3
- package/dist/bin/hook-chunks/{chunk-UA4Z5TGG.mjs → chunk-7WO5CEH3.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-3VWBNLBC.mjs → chunk-ADYTBOCZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TG5CQJD5.mjs → chunk-AORD3YDQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EHEQOF6Z.mjs → chunk-B36LC2JR.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-FX6VHIKB.mjs → chunk-BKJHD5JI.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-S7HQQILD.mjs → chunk-BVK7ZDLX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HHIGNKDO.mjs → chunk-CPR4FPXG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6UH244CC.mjs → chunk-D7DQABWO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Y4DUB7UN.mjs → chunk-DB226JIV.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-KOCROTRM.mjs → chunk-DCHIPMOG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IKIB42F7.mjs → chunk-E7NA34VQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MHQTGU45.mjs → chunk-EGCYDLSO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZMKTR2IO.mjs → chunk-EI6VQZOX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-INXNK57E.mjs → chunk-ETTDRXQ6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EQ5KNMLG.mjs → chunk-EXVL2OFE.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-5EQLQ7GF.mjs → chunk-FZS3XGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QYEASMFV.mjs → chunk-GSPDJSJ5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TKWAFYF7.mjs → chunk-H2DGDAQP.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-H5AVBDCH.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-SDUS2AT7.mjs → chunk-HGZQWYBL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EMTCZG5I.mjs → chunk-IJ523YO2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NBKEOLDH.mjs → chunk-IWUF2LGO.mjs} +5 -5
- package/dist/bin/hook-chunks/chunk-JGZ3QGWX.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-66GE3IHX.mjs → chunk-JZDZH6IV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PUHX3ECX.mjs → chunk-KDNUQPAK.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-KV4NXLPT.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-XE4MJNBQ.mjs → chunk-LF3S3MYE.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-LQLCYBFF.mjs +36 -0
- package/dist/bin/hook-chunks/{chunk-YUKGWWL7.mjs → chunk-LR24AIEW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2HB2JHQE.mjs → chunk-M4YM7Z3F.mjs} +15 -15
- package/dist/bin/hook-chunks/{chunk-F4T7IAA7.mjs → chunk-MW54MTLB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7O6OMD4X.mjs → chunk-NCLONKOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HRWXMF7P.mjs → chunk-NJ74RHNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JUZ5LNDI.mjs → chunk-NLL5AV2G.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-OIU4Y5WL.mjs → chunk-OC4CYF7V.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OLQAMCYV.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-C3W2HLJT.mjs → chunk-PPWPUEBH.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PVCEWFHS.mjs +51 -0
- package/dist/bin/hook-chunks/{chunk-Y3J7UUMR.mjs → chunk-QOQZHR3E.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2UC4DTDO.mjs → chunk-QXCEBAIA.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-RT2DFIWF.mjs +19 -0
- package/dist/bin/hook-chunks/{chunk-NCOOKPXX.mjs → chunk-SQW2B7NW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IHECXD2M.mjs → chunk-SWJ7TLBD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X2AGNDGD.mjs → chunk-TB57OYGW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QPRNRLG6.mjs → chunk-TF6PN7IB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KG7Z6OMK.mjs → chunk-TKXOMN4K.mjs} +4 -4
- package/dist/bin/hook-chunks/chunk-UMJ5D5I6.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-NWIQNII6.mjs → chunk-UVATSTRF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NHIWYDQD.mjs → chunk-WJV24WE6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Q3Z53QTH.mjs → chunk-WL6PKX3U.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-WUOVBBPC.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-TYEAIX3X.mjs → chunk-XDBJSJOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JCYXFHQZ.mjs → chunk-XSJ7SPVR.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-J6TAD3OZ.mjs → chunk-XV2LJVYB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7JEKBJAP.mjs → chunk-XYKVWO23.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-4O4D6DV7.mjs → chunk-Y3RHBU2R.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-JPSJWCFD.mjs → chunk-Y7MZA2G4.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-T2FCU3ZS.mjs → chunk-YHOZTAZH.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-YLOK4WRR.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-OENWCYLF.mjs → chunk-ZJW27EUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-VWOIUTAX.mjs → chunk-ZQI4TJ5C.mjs} +3 -3
- package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-AZHE4VOM.mjs → chunk-ZZBNFNMG.mjs} +1 -1
- package/dist/bin/hook-chunks/{client-ERZ5CM3D.mjs → client-K3ZA2BLB.mjs} +3 -3
- package/dist/bin/hook-chunks/{code-graph-cloud-4GRWQSUK.mjs → code-graph-cloud-XGQF7XYC.mjs} +1 -1
- package/dist/bin/hook-chunks/{codex-skill-6DYQMPDJ.mjs → codex-skill-6CRFUF3A.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-MF4KUM3X.mjs → command-installer-MUHZWDZA.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-2VZPHUDG.mjs → config-manager-2JJPCLKC.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-V7CIDF3Q.mjs → context7-service-NH4BMGSJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{custom-workflow-storage-UOBQXY42.mjs → custom-workflow-storage-VBMWLKA7.mjs} +1 -1
- package/dist/bin/hook-chunks/cwd-changed-UTD6Y4MS.mjs +8 -0
- package/dist/bin/hook-chunks/{database-XYKQF3KR.mjs → database-ZCP76LMM.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-DFRJOOB3.mjs → detect-changes-5W6EGEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{developer-evolution-SLC34HUU.mjs → developer-evolution-UTY3CWOK.mjs} +1 -1
- package/dist/bin/hook-chunks/{distill-U2LJGUG3.mjs → distill-5TNAM3LY.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-6VOIUNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{format-ALUX4QSI.mjs → format-IIOFTSBF.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-SCGU3URM.mjs → judgment-ledger-storage-7Q7AEEY6.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-BYPG65RS.mjs → judgment-orchestrator-AAON4ZJ4.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-receipt-GWSSCLAB.mjs → judgment-receipt-QLV3MYFT.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-cue-MMISX2BI.mjs → land-cue-57B23PEL.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-synthesis-WG5JAS7B.mjs → land-synthesis-ZVPFJERV.mjs} +1 -1
- package/dist/bin/hook-chunks/{legacy-crew-sweep-2WSO5KEB.mjs → legacy-crew-sweep-GR6HRSHX.mjs} +2 -2
- package/dist/bin/hook-chunks/{memory-index-QK5QJOFJ.mjs → memory-index-XE2MWKQS.mjs} +1 -1
- package/dist/bin/hook-chunks/{notification-MPVWVV52.mjs → notification-GU2ZJP5K.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-integrity-XRYOROK5.mjs → pack-integrity-WV5U3AFF.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-WWGQNJDQ.mjs → pack-manager-QLFQKP24.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-VPAX5DZL.mjs} +2 -2
- package/dist/bin/hook-chunks/{post-edit-QMHSZHDN.mjs → post-edit-UXCFSR3Y.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-bash-RAM6L3G4.mjs → pre-bash-MB4JNNYG.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-commit-736ZLMDL.mjs → pre-commit-U7TRFKWX.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-edit-MDCQXI5F.mjs +11 -0
- package/dist/bin/hook-chunks/{pre-package-LCIAWWGK.mjs → pre-package-A6ZI5R64.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-search-J5EOFMYN.mjs → pre-search-ZZO3LGXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-secrets-TSUMTXHH.mjs → pre-secrets-MWPPZPWK.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-T2DG236Y.mjs → prjct-md-MS52YLI2.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-VRY22I66.mjs → project-agent-surfaces-6AIW7KL6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-5DEN5VLF.mjs → project-file-inventory-HHURZTMH.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-UDH56VFP.mjs +8 -0
- package/dist/bin/hook-chunks/{project-style-evolution-7MAUSED2.mjs → project-style-evolution-IJXT2MCP.mjs} +1 -1
- package/dist/bin/hook-chunks/prompt-7VZLYONO.mjs +24 -0
- package/dist/bin/hook-chunks/{publish-helper-G54XQV5K.mjs → publish-helper-ZSL27HSX.mjs} +1 -1
- package/dist/bin/hook-chunks/{purge-MC5LFSAO.mjs → purge-N2WN6NDB.mjs} +1 -1
- package/dist/bin/hook-chunks/retention-RET4P2RO.mjs +8 -0
- package/dist/bin/hook-chunks/{sdd-5UCVX43H.mjs → sdd-PB6WKSLE.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-continuity-RKNAJJHR.mjs → session-continuity-BIJXMN44.mjs} +1 -1
- package/dist/bin/hook-chunks/session-start-R2VMKW2L.mjs +8 -0
- package/dist/bin/hook-chunks/settings-installer-CQKMGMRG.mjs +9 -0
- package/dist/bin/hook-chunks/{setup-WQRJ6TQL.mjs → setup-PPIZHVXS.mjs} +3 -3
- package/dist/bin/hook-chunks/{shipping-5D5LTJ3P.mjs → shipping-C637PCOF.mjs} +4 -4
- package/dist/bin/hook-chunks/{skill-index-RAVJMC4P.mjs → skill-index-55I3HLAI.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-7DDSTRTV.mjs → spec-context-inference-RTTDOZZO.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-LAO5Z2M5.mjs → spec-service-ENLAAMVL.mjs} +2 -2
- package/dist/bin/hook-chunks/{spec-task-breakdown-K3GMQKGH.mjs → spec-task-breakdown-RUDEP3AY.mjs} +1 -1
- package/dist/bin/hook-chunks/{state-storage-EIFGUO7X.mjs → state-storage-AJUPG7J5.mjs} +1 -1
- package/dist/bin/hook-chunks/stop-DPXAWJFN.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-AFHPXL2S.mjs +8 -0
- package/dist/bin/hook-chunks/{subagent-stop-RBD2OILE.mjs → subagent-stop-5BMV63ML.mjs} +1 -1
- package/dist/bin/hook-chunks/{surface-attribution-K37N2NK7.mjs → surface-attribution-EGIKCVMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{symbol-graph-BKQIMFRG.mjs → symbol-graph-MH42JSPX.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-ZB7FGT6D.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-2ZYE5M6J.mjs → task-orchestration-7NGRIISS.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-ITY5OSHX.mjs → task-overview-F3GB77OA.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-FZABHPFV.mjs +8 -0
- package/dist/bin/hook-chunks/{tdd-7S55S5C3.mjs → tdd-TAMBOPN3.mjs} +1 -1
- package/dist/bin/hook-chunks/{template-loader-SCM4C2A3.mjs → template-loader-MXOMU4XH.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-TBD5EYAL.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-HT756AND.mjs → vault-retire-notice-7XHVNHU6.mjs} +1 -1
- package/dist/bin/hook-chunks/{velocity-storage-47CF3XWZ.mjs → velocity-storage-IOCVK2LU.mjs} +1 -1
- package/dist/bin/hook-chunks/{weak-model-mode-FLCEQ2BV.mjs → weak-model-mode-BMSPGEQY.mjs} +1 -1
- package/dist/bin/hook-chunks/{work-graph-JQHVVXIZ.mjs → work-graph-AVAOKY63.mjs} +1 -1
- package/dist/bin/hook-chunks/work-scope-YCS4GTXW.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UUW4UGGB.mjs → workspace-occupancy-JOBYNNXV.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 +739 -714
- package/dist/bin/prjct-hooks.mjs +3 -3
- package/dist/bin/prjct.mjs +22 -9
- package/dist/daemon/entry.mjs +620 -593
- package/dist/mcp/server.mjs +317 -303
- package/package.json +3 -5
- package/scripts/install.sh +28 -496
- package/dist/bin/hook-chunks/chunk-27XFSCOE.mjs +0 -43
- package/dist/bin/hook-chunks/chunk-4SKJWNKE.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-AZYQFRPJ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-DRGI5UHQ.mjs +0 -10
- package/dist/bin/hook-chunks/chunk-GFY4GY3Z.mjs +0 -8
- 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-NWZEBCTC.mjs +0 -19
- 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-TRMBRDKH.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-V2BSS7HW.mjs +0 -36
- 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/pre-edit-GZ4QJ2MU.mjs +0 -11
- package/dist/bin/hook-chunks/project-memory-KKEMTEMP.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-DVF6V2X2.mjs +0 -22
- package/dist/bin/hook-chunks/retention-LWETHQX3.mjs +0 -8
- package/dist/bin/hook-chunks/session-start-MFMFKUPK.mjs +0 -8
- package/dist/bin/hook-chunks/settings-installer-QDM3GB6J.mjs +0 -9
- 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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [3.96.0] - 2026-08-16
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Efficiency improvements: model routing, agent planning, and performance
|
|
9
|
+
|
|
10
|
+
## [3.95.0] - 2026-08-16
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- kimi code full integration
|
|
14
|
+
|
|
5
15
|
## [3.94.0] - 2026-08-16
|
|
6
16
|
|
|
7
17
|
### Added
|
package/README.md
CHANGED
|
@@ -173,10 +173,16 @@ It reports concrete support levels:
|
|
|
173
173
|
| `hosted` | Repo instructions are the portable layer; platform config may be manual. |
|
|
174
174
|
|
|
175
175
|
Run `prjct agents doctor --md` to see the current machine/project matrix for
|
|
176
|
-
Claude Code, Codex, Gemini CLI, OpenCode, Qwen Code, Kimi CLI, Grok Build,
|
|
176
|
+
Claude Code, Codex, Gemini CLI, OpenCode, Qwen Code, Kimi Code CLI, Grok Build,
|
|
177
177
|
Cursor, Pi, Cline/Roo-family agents, hosted agents, and future
|
|
178
178
|
AGENTS.md/MCP clients.
|
|
179
179
|
|
|
180
|
+
Kimi Code CLI is `full`: native `[[hooks]]` entries in
|
|
181
|
+
`~/.kimi-code/config.toml`, MCP servers in `~/.kimi-code/mcp.json`, and the
|
|
182
|
+
compact skill at `~/.agents/skills/prjct/SKILL.md` — all installed by
|
|
183
|
+
`prjct install` when Kimi is detected (the legacy `~/.kimi/` directory remains
|
|
184
|
+
a detection fallback only).
|
|
185
|
+
|
|
180
186
|
Use `prjct agents doctor --fix` inside a prjct project to refresh the portable
|
|
181
187
|
`AGENTS.md` surface and any repo-local IDE rule adapters prjct manages. The
|
|
182
188
|
command is idempotent and reports what changed.
|
|
@@ -333,27 +339,27 @@ Seven built-in packs (TypeScript manifests in `core/packs/manifests.ts`, not bas
|
|
|
333
339
|
|
|
334
340
|
Slots ship **empty** — the human or the agent fills them on demand.
|
|
335
341
|
|
|
336
|
-
##
|
|
342
|
+
## Hooks Adapter (opt-in) — Claude Code + Kimi Code CLI
|
|
337
343
|
|
|
338
|
-
`prjct install` refreshes the universal project surface (`AGENTS.md`) when run inside a prjct project, writes the Claude Code hooks adapter to `~/.claude/settings.json`, and repairs detected Codex config in `~/.codex/config.toml` (prjct MCP + TUI `status_line`). Most of the 13 hook subcommands inject `additionalContext
|
|
344
|
+
`prjct install` refreshes the universal project surface (`AGENTS.md`) when run inside a prjct project, writes the Claude Code hooks adapter to `~/.claude/settings.json`, writes the native Kimi Code CLI hooks adapter as `[[hooks]]` entries in `~/.kimi-code/config.toml` (marked with a `# prjct-managed` comment each — TOML forbids extra entry fields, and user entries or other tools' blocks stay byte-identical), and repairs detected Codex config in `~/.codex/config.toml` (prjct MCP + TUI `status_line`). Most of the 13 hook subcommands inject `additionalContext` (plain stdout text under Kimi, which appends it to context); two guard: the credential guard denies tool calls that would leak secrets, and the package guard denies unknown installs under strict packs. Kimi applies hook config on the next session (or after `/reload`). Other agents use the support level shown by `prjct agents doctor`.
|
|
339
345
|
|
|
340
|
-
| Event | Does |
|
|
341
|
-
|
|
342
|
-
| `SessionStart` | Persona; on cold start (startup/clear/compact) also the knowledge digest — top traps + decisions in force, so a freshly-updated model starts grounded |
|
|
343
|
-
| `UserPromptSubmit` | Active project state (task, branch, inbox) |
|
|
344
|
-
| `PreToolUse` (any tool) | Credential guard — **denies** the call when tool arguments contain secret material, so credentials never leave the machine |
|
|
345
|
-
| `PreToolUse` (Bash package installs) | Package legitimacy — flags packages not already in `package.json` before the install runs (strict packs deny) |
|
|
346
|
-
| `PreToolUse` (Bash git commit) | Anti-patterns tagged with touched files |
|
|
347
|
-
| `PreToolUse` (Edit/Write) | The file's preventive memory (gotchas/anti-patterns) right before you edit it — pushes what `prjct guard` makes pull |
|
|
348
|
-
| `PreToolUse` (Grep/Glob) | Injects indexed symbol-graph hits alongside search results (never gates) |
|
|
349
|
-
| `PostToolUse` (Edit/Write) | Silently annotates `files_touched` on active task |
|
|
350
|
-
| `Stop` | Async prompt: "learn anything reusable?"; scans the transcript for durable captures |
|
|
351
|
-
| `SubagentStart` | Persona for fresh-brain subagents (cache-stable, digest-free) |
|
|
352
|
-
| `SubagentStop` | Desktop notification when a subagent finishes (`config.notify`, default on) |
|
|
353
|
-
| `Notification` | Desktop notification when the agent is waiting for input or permission |
|
|
354
|
-
| `CwdChanged` | Re-contextualizes on project switch |
|
|
355
|
-
|
|
356
|
-
Remove with `prjct claude uninstall` (hooks only) or `prjct uninstall` (everything).
|
|
346
|
+
| Event | Does | Kimi |
|
|
347
|
+
|---|---|---|
|
|
348
|
+
| `SessionStart` | Persona; on cold start (startup/clear/compact) also the knowledge digest — top traps + decisions in force, so a freshly-updated model starts grounded | ✓ |
|
|
349
|
+
| `UserPromptSubmit` | Active project state (task, branch, inbox) | ✓ |
|
|
350
|
+
| `PreToolUse` (any tool) | Credential guard — **denies** the call when tool arguments contain secret material, so credentials never leave the machine | ✓ |
|
|
351
|
+
| `PreToolUse` (Bash package installs) | Package legitimacy — flags packages not already in `package.json` before the install runs (strict packs deny) | ✓ |
|
|
352
|
+
| `PreToolUse` (Bash git commit) | Anti-patterns tagged with touched files | ✓ |
|
|
353
|
+
| `PreToolUse` (Edit/Write) | The file's preventive memory (gotchas/anti-patterns) right before you edit it — pushes what `prjct guard` makes pull | ✓ |
|
|
354
|
+
| `PreToolUse` (Grep/Glob) | Injects indexed symbol-graph hits alongside search results (never gates) | ✓ |
|
|
355
|
+
| `PostToolUse` (Edit/Write) | Silently annotates `files_touched` on active task | ✓ |
|
|
356
|
+
| `Stop` | Async prompt: "learn anything reusable?"; scans the transcript for durable captures | ✓ |
|
|
357
|
+
| `SubagentStart` | Persona for fresh-brain subagents (cache-stable, digest-free) | ✓ |
|
|
358
|
+
| `SubagentStop` | Desktop notification when a subagent finishes (`config.notify`, default on) | ✓ |
|
|
359
|
+
| `Notification` | Desktop notification when the agent is waiting for input or permission | ✓ |
|
|
360
|
+
| `CwdChanged` | Re-contextualizes on project switch | — (no Kimi equivalent; every Kimi payload already carries `cwd`) |
|
|
361
|
+
|
|
362
|
+
Remove with `prjct claude uninstall` (Claude hooks only) or `prjct uninstall` (everything — including the prjct-managed `[[hooks]]` entries in `~/.kimi-code/config.toml` and the prjct/context7 servers in Kimi's `mcp.json`).
|
|
357
363
|
|
|
358
364
|
## MCP Server
|
|
359
365
|
|
|
@@ -526,7 +532,7 @@ prjct-cli/
|
|
|
526
532
|
## Requirements
|
|
527
533
|
|
|
528
534
|
- Node.js 22.5+ (ships `node:sqlite`) or Bun 1.0+
|
|
529
|
-
- One of: Claude Code, OpenAI Codex, Gemini CLI, Cursor, OpenCode, Cline, Grok Build, Pi, Kimi CLI, or Antigravity
|
|
535
|
+
- One of: Claude Code, OpenAI Codex, Gemini CLI, Cursor, OpenCode, Cline, Grok Build, Pi, Kimi Code CLI, or Antigravity
|
|
530
536
|
|
|
531
537
|
## Common questions
|
|
532
538
|
|
|
@@ -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-H5AVBDCH.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-E66B27AL.mjs";export{a as KNOWN_AGENTS,b as detectRuntimeAgent,d as normalizeAgentName,c as resolveCallerIdentity,e as sameOwner};
|
|
@@ -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 E,b as I}from"./chunk-OWOPA2O7.mjs";import{a as P}from"./chunk-
|
|
8
|
+
import{a as E,b as I}from"./chunk-OWOPA2O7.mjs";import{a as P}from"./chunk-3AHW4XQH.mjs";import{a as O}from"./chunk-5WAONIPX.mjs";import{a as C}from"./chunk-5TBQNW2G.mjs";import"./chunk-HGZQWYBL.mjs";import{b as N,c as H,d as L}from"./chunk-H5AVBDCH.mjs";import{h as _}from"./chunk-M4YM7Z3F.mjs";import"./chunk-LF3S3MYE.mjs";import"./chunk-PPWPUEBH.mjs";import"./chunk-H4CA3XZ6.mjs";import"./chunk-Y3RHBU2R.mjs";import{c as D,d as A}from"./chunk-XSJ7SPVR.mjs";import"./chunk-Y7MZA2G4.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-NLL5AV2G.mjs";import"./chunk-NCLONKOT.mjs";import"./chunk-22GFTUER.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-BKJHD5JI.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-ZJW27EUC.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-3CKNJ5RA.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-XYKVWO23.mjs";import"./chunk-7PBWIO4K.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-PVCEWFHS.mjs";import"./chunk-LR24AIEW.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import{b as y}from"./chunk-D7DQABWO.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import{a as x}from"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as h}from"./chunk-ZZBNFNMG.mjs";import"./chunk-3FEXJUO2.mjs";import{d as f,g as v}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{b as m,h as V,l as S,n as Y,o as R,u as q}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-IJ523YO2.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a}from"./chunk-E66B27AL.mjs";q();import{spawn as X}from"node:child_process";v();V();v();function G(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}a(G,"parseEvidence");function $(t){return{id:t.id,projectId:t.project_id,taskId:t.task_id,taskDescription:t.task_description,fromAgent:t.from_agent,fromIdentity:t.from_identity,toAgent:t.to_agent,reason:t.reason,evidence:G(t.evidence),status:t.status,workspaceId:t.workspace_id,worktreePath:t.worktree_path,branch:t.branch,createdAt:t.created_at,acceptedAt:t.accepted_at,acceptedBy:t.accepted_by,expiresAt:t.expires_at}}a($,"toHandoff");function M(t){let e=new Date;return e.setTime(e.getTime()+Math.max(1,t)*36e5),e.toISOString()}a(M,"expiresAtIso");function W(t){let e=`hand_${x()}`,o=m(),n=t.ttlHours??24,r=t.evidence?JSON.stringify(t.evidence):null;return f.run(t.projectId,`INSERT INTO task_handoffs (
|
|
9
9
|
id, project_id, task_id, task_description, from_agent, from_identity,
|
|
10
10
|
to_agent, reason, evidence, status, workspace_id, worktree_path, branch,
|
|
11
11
|
created_at, accepted_at, accepted_by, expires_at
|
|
@@ -5,10 +5,10 @@ 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 G,b as Se,c as b,d as U,e as q,f as H,g as ve,h as $e,i as v}from"./chunk-
|
|
8
|
+
import{a as G,b as Se,c as b,d as U,e as q,f as H,g as ve,h as $e,i as v}from"./chunk-LQLCYBFF.mjs";import"./chunk-QOQZHR3E.mjs";import"./chunk-TXJT3G53.mjs";import"./chunk-UMJ5D5I6.mjs";import"./chunk-JZDZH6IV.mjs";import"./chunk-XV2LJVYB.mjs";import"./chunk-YHOZTAZH.mjs";import"./chunk-M4YM7Z3F.mjs";import"./chunk-LF3S3MYE.mjs";import"./chunk-PPWPUEBH.mjs";import{a as y,b as R,c as M,d as we,e as E,f as L,g as z}from"./chunk-TB57OYGW.mjs";import{b as ge,c as A,d as ke}from"./chunk-MW54MTLB.mjs";import"./chunk-H4CA3XZ6.mjs";import{a as d}from"./chunk-Y3RHBU2R.mjs";import"./chunk-XSJ7SPVR.mjs";import"./chunk-Y7MZA2G4.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-NLL5AV2G.mjs";import"./chunk-NCLONKOT.mjs";import"./chunk-22GFTUER.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-UVATSTRF.mjs";import"./chunk-LNB2GLYI.mjs";import{a as ue}from"./chunk-DYHYDHCW.mjs";import"./chunk-BKJHD5JI.mjs";import{a as D,b as ye,c as K}from"./chunk-ZYCNW75E.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-ZQI4TJ5C.mjs";import"./chunk-SWJ7TLBD.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-ZJW27EUC.mjs";import"./chunk-IWUF2LGO.mjs";import"./chunk-YLOK4WRR.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import{e as pe}from"./chunk-3CKNJ5RA.mjs";import"./chunk-R4ILCXKE.mjs";import{d as fe}from"./chunk-XYKVWO23.mjs";import"./chunk-7PBWIO4K.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{b as he}from"./chunk-PVCEWFHS.mjs";import{a as de}from"./chunk-LR24AIEW.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import{b as me}from"./chunk-D7DQABWO.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-ZZBNFNMG.mjs";import"./chunk-3FEXJUO2.mjs";import{d as _,g as ce}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{d as le}from"./chunk-KV4NXLPT.mjs";import{b as I,g as oe,h as X,v as ie,w as We}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as ae,o as Qe}from"./chunk-UH4MD3F3.mjs";import{a as N,b as ne,p as re}from"./chunk-QWQFF2UG.mjs";import"./chunk-EXVL2OFE.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-IJ523YO2.mjs";import"./chunk-PKDYFXMI.mjs";import{a as $,e as k,f as J}from"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";J();re();Qe();import j from"node:fs/promises";import C from"node:path";var Y=class{static{m(this,"CodebaseAnalyzer")}projectPath=null;init(e=process.cwd()){this.projectPath=e}async readPackageJson(){try{let e=C.join(this.projectPath,"package.json"),t=await j.readFile(e,"utf-8");return JSON.parse(t)}catch(e){if($(e)||e instanceof SyntaxError)return null;throw e}}async readCargoToml(){try{let e=C.join(this.projectPath,"Cargo.toml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readRequirements(){try{let e=C.join(this.projectPath,"requirements.txt");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readGoMod(){try{let e=C.join(this.projectPath,"go.mod");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readGemfile(){try{let e=C.join(this.projectPath,"Gemfile");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readMixExs(){try{let e=C.join(this.projectPath,"mix.exs");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readPomXml(){try{let e=C.join(this.projectPath,"pom.xml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readComposerJson(){try{let e=C.join(this.projectPath,"composer.json"),t=await j.readFile(e,"utf-8");return JSON.parse(t)}catch(e){if($(e)||e instanceof SyntaxError)return null;throw e}}async readPyprojectToml(){try{let e=C.join(this.projectPath,"pyproject.toml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async getFileExtensions(){try{let{stdout:e}=await N('find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" ! -path "*/.next/*" | sed "s/.*\\./\\./" | sort | uniq -c | sort -rn',{cwd:this.projectPath}),t={};return e.trim().split(`
|
|
9
9
|
`).filter(Boolean).forEach(o=>{let s=o.trim().match(/^\s*(\d+)\s+(\.\w+)$/);s&&(t[s[2]]=parseInt(s[1],10))}),t}catch{return{}}}async listConfigFiles(){try{let e=await j.readdir(this.projectPath),t=[/^package\.json$/,/^Cargo\.toml$/,/^go\.mod$/,/^requirements\.txt$/,/^Gemfile$/,/^mix\.exs$/,/^pom\.xml$/,/^composer\.json$/,/^pyproject\.toml$/,/^tsconfig.*\.json$/,/^\..*rc(\.json|\.js|\.cjs)?$/,/^Dockerfile$/,/^docker-compose.*\.ya?ml$/,/^\.env.*$/];return e.filter(o=>t.some(s=>s.test(o)))}catch(e){if($(e))return[];throw e}}async listDirectories(){try{return(await j.readdir(this.projectPath,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).filter(t=>!t.startsWith(".")&&t!=="node_modules")}catch(e){if($(e))return[];throw e}}async getGitLog(e=50){try{let{stdout:t}=await N(`git log -n ${e} --pretty=format:"%h|%an|%ar|%s"`,{cwd:this.projectPath});return t}catch{return""}}async getGitStats(){try{let{stdout:e}=await N("git rev-list --count HEAD",{cwd:this.projectPath}),{stdout:t}=await N('git log --format="%an" | sort -u | wc -l',{cwd:this.projectPath}),{stdout:o}=await N('git log --reverse --pretty=format:"%ar" | head -1',{cwd:this.projectPath});return{totalCommits:parseInt(e.trim(),10)||0,contributors:parseInt(t.trim(),10)||0,age:o.trim()||"unknown"}}catch{return{totalCommits:0,contributors:0,age:"unknown"}}}async countFiles(){try{let{stdout:e}=await N('find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" | wc -l',{cwd:this.projectPath});return parseInt(e.trim(),10)||0}catch{return 0}}async fileExists(e){return ae(C.join(this.projectPath,e))}async readFile(e){try{let t=C.join(this.projectPath,e);return await j.readFile(t,"utf-8")}catch(t){if($(t))return null;throw t}}async findFiles(e){try{let{stdout:t}=await N(`find . -type f -name "${e}" ! -path "*/node_modules/*" ! -path "*/.git/*"`,{cwd:this.projectPath});return t.trim().split(`
|
|
10
10
|
`).filter(Boolean)}catch{return[]}}},Xe=new Y,S=Xe;We();import je from"node:fs/promises";import Pe from"node:path";var V=800,Z=6,Ke=8,Ye=5;async function ee(r,e,t,o){let[s,i,n,a]=await Promise.all([Ze(r,e,o),et(r),tt(r),st(r)]);return{project:{name:o.name,ecosystem:o.ecosystem,languages:o.languages,frameworks:o.frameworks,fileCount:o.fileCount,projectType:o.projectType},git:{branch:t.branch,recentCommits:t.recentCommits.slice(0,Ke).map(u=>({message:u.message,date:u.date})),hasChanges:t.hasChanges,weeklyCommits:t.weeklyCommits},codeSamples:s,existingPatterns:i,taskHistory:n,previousAnalysis:a??void 0}}m(ee,"buildAnalysisPayload");async function Ze(r,e,t){let o=[],s=[...t.frameworks.map(a=>a.toLowerCase()),"config","router","middleware","service","model","schema","database","api","auth"].join(" "),i=pe(r,s,Z*2);for(let a of i){if(o.length>=Z)break;try{let u=Pe.join(e,a.path),c=await je.readFile(u,"utf-8");c.length>V*3?o.push({path:a.path,content:`${c.slice(0,V)}
|
|
11
|
-
// ... truncated`,reason:`BM25 score: ${a.score.toFixed(2)} (truncated, ${c.length} chars)`}):o.push({path:a.path,content:c.slice(0,V),reason:`BM25 score: ${a.score.toFixed(2)}`})}catch{}}let n=["package.json","tsconfig.json","src/index.ts","src/main.ts","app.ts"];for(let a of n){if(o.length>=Z)break;if(!o.some(u=>u.path===a))try{let u=Pe.join(e,a),c=await je.readFile(u,"utf-8");o.push({path:a,content:c.slice(0,V),reason:"entry point"})}catch{}}return o}m(Ze,"selectCodeSamples");async function et(r){try{let e=await b.getActive(r);return e?{patterns:(e.patterns??[]).map(t=>({name:t.name,description:t.description})),antiPatterns:(e.antiPatterns??[]).map(t=>({issue:t.issue,file:t.file,suggestion:t.suggestion}))}:{patterns:[],antiPatterns:[]}}catch{return{patterns:[],antiPatterns:[]}}}m(et,"getExistingPatterns");async function tt(r){try{return(await me.getTaskHistory(r)).slice(0,Ye).map(t=>({description:t.title,status:t.classification,branch:t.branchName}))}catch{return[]}}m(tt,"getTaskHistory");function st(r){try{let e=D.getActiveSummary(r);return Promise.resolve(e)}catch(e){return ue.debug("Failed to get previous LLM analysis summary",{error:e}),Promise.resolve(null)}}m(st,"getPreviousAnalysisSummary");J();X();ce();J();async function be(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.seal(o);return e.json?(console.log(JSON.stringify({success:s.success,signature:s.signature,error:s.error})),{success:s.success,error:s.error}):s.success?(d.done("Analysis sealed"),console.log(` Signature: ${s.signature?.substring(0,16)}...`),console.log(""),{success:!0,data:{signature:s.signature}}):(d.fail(s.error||"Seal failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(be,"seal");async function Ce(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.rollback(o);return e.json?(console.log(JSON.stringify({success:s.success,restoredSignature:s.restoredSignature,error:s.error})),{success:s.success,error:s.error}):e.md?s.success?(console.log(y(L("Analysis Rolled Back"),E({"Restored signature":`${s.restoredSignature?.substring(0,16)}...`,Note:"Previous sealed version is now active. Current version moved to draft."}))),{success:!0,data:{restoredSignature:s.restoredSignature}}):(console.log(y("## Rollback Failed",`> ${s.error}`)),{success:!1,error:s.error}):s.success?(d.done("Analysis rolled back to previous sealed version"),console.log(` Restored signature: ${s.restoredSignature?.substring(0,16)}...`),console.log(" Previous sealed version demoted to draft"),console.log(""),{success:!0,data:{restoredSignature:s.restoredSignature}}):(d.fail(s.error||"Rollback failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):e.md?console.log(y("## Rollback Failed",`> ${o}`)):d.fail(o),{success:!1,error:o}}}m(Ce,"rollback");async function xe(r=process.cwd(),e={}){if(e.semantic)return te(r,e);try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=await b.verify(o);return e.json?(console.log(JSON.stringify(s)),{success:s.valid}):(s.valid?d.done(s.message):d.fail(s.message),console.log(""),{success:s.valid,data:s})}catch(t){let o=k(t);return ge(o)}}m(xe,"verify");async function te(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json?console.log(JSON.stringify({success:!1,error:"No project ID found"})):d.fail("No project ID found"),t.result;let o=t.value,s=(()=>{try{return _.getDoc(o,"project")?.repoPath||r}catch{return r}})(),i=await b.semanticVerify(o,s);if(e.json)return console.log(JSON.stringify(i)),{success:i.passed,data:i};console.log(""),i.passed?(d.done("Semantic verification passed"),console.log(` ${i.passedCount}/${i.checks.length} checks passed (${i.totalMs}ms)`)):(d.fail("Semantic verification failed"),console.log(` ${i.failedCount}/${i.checks.length} checks failed`)),console.log(""),console.log("Check Results:");for(let n of i.checks){let a=n.passed?"\u2713":"\u2717",u=n.passed?`${n.output} (${n.durationMs}ms)`:n.error||"Failed";console.log(` ${a} ${n.name}: ${u}`)}return console.log(""),{success:i.passed,data:i}}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(te,"semanticVerifyCommand");import De from"node:fs/promises";import Re from"node:path";import{z as l}from"zod";var nt=l.object({style:l.string(),insights:l.array(l.string()),domains:l.array(l.string())}),rt=l.object({name:l.string(),description:l.string(),locations:l.array(l.string()),confidence:l.number().min(0).max(1),category:l.string()}),ot=l.object({issue:l.string(),reasoning:l.string(),files:l.array(l.string()),suggestion:l.string(),severity:l.enum(["low","medium","high"]),confidence:l.number().min(0).max(1)}),at=l.object({description:l.string(),area:l.string(),effort:l.enum(["small","medium","large"]),impact:l.string(),priority:l.enum(["low","medium","high"])}),it=l.object({path:l.string(),reason:l.string(),risk:l.string(),severity:l.enum(["low","medium","high"])}),ct=l.object({description:l.string(),files:l.array(l.string()),benefit:l.string(),effort:l.enum(["small","medium","large"])}),lt=l.object({category:l.string(),rule:l.string(),example:l.string().optional()}),ut=l.object({build:l.string().optional(),test:l.string().optional(),lint:l.string().optional(),dev:l.string().optional(),format:l.string().optional(),install:l.string().optional()}),mt=l.object({languages:l.array(l.string()),frameworks:l.array(l.string()),packageManager:l.string().optional()}),gt=l.object({version:l.literal(1),commitHash:l.string().nullable(),analyzedAt:l.string(),architecture:nt,patterns:l.array(rt),antiPatterns:l.array(ot),techDebt:l.array(at),riskAreas:l.array(it),refactorSuggestions:l.array(ct),projectInsights:l.array(l.string()),conventions:l.array(lt),commands:ut.optional(),stack:mt.optional()});function Ae(r){let e=gt.safeParse(r);return e.success?{ok:!0,value:e.data}:{ok:!1,error:e.error.issues.map(o=>`${o.path.length>0?o.path.join("."):"<root>"}: ${o.message}`).join("; ")}}m(Ae,"parseLlmAnalysis");X();re();async function Le(r,e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await pt(r,e),n=await ft(i.content,e),a=D.getActive(s),u=!!(a&&ye(a)&&K(n)),c=u?dt(a,n):n;D.save(s,c);try{let{recomputeProjectStyle:f}=await import("./project-style-evolution-
|
|
11
|
+
// ... truncated`,reason:`BM25 score: ${a.score.toFixed(2)} (truncated, ${c.length} chars)`}):o.push({path:a.path,content:c.slice(0,V),reason:`BM25 score: ${a.score.toFixed(2)}`})}catch{}}let n=["package.json","tsconfig.json","src/index.ts","src/main.ts","app.ts"];for(let a of n){if(o.length>=Z)break;if(!o.some(u=>u.path===a))try{let u=Pe.join(e,a),c=await je.readFile(u,"utf-8");o.push({path:a,content:c.slice(0,V),reason:"entry point"})}catch{}}return o}m(Ze,"selectCodeSamples");async function et(r){try{let e=await b.getActive(r);return e?{patterns:(e.patterns??[]).map(t=>({name:t.name,description:t.description})),antiPatterns:(e.antiPatterns??[]).map(t=>({issue:t.issue,file:t.file,suggestion:t.suggestion}))}:{patterns:[],antiPatterns:[]}}catch{return{patterns:[],antiPatterns:[]}}}m(et,"getExistingPatterns");async function tt(r){try{return(await me.getTaskHistory(r)).slice(0,Ye).map(t=>({description:t.title,status:t.classification,branch:t.branchName}))}catch{return[]}}m(tt,"getTaskHistory");function st(r){try{let e=D.getActiveSummary(r);return Promise.resolve(e)}catch(e){return ue.debug("Failed to get previous LLM analysis summary",{error:e}),Promise.resolve(null)}}m(st,"getPreviousAnalysisSummary");J();X();ce();J();async function be(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.seal(o);return e.json?(console.log(JSON.stringify({success:s.success,signature:s.signature,error:s.error})),{success:s.success,error:s.error}):s.success?(d.done("Analysis sealed"),console.log(` Signature: ${s.signature?.substring(0,16)}...`),console.log(""),{success:!0,data:{signature:s.signature}}):(d.fail(s.error||"Seal failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(be,"seal");async function Ce(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.rollback(o);return e.json?(console.log(JSON.stringify({success:s.success,restoredSignature:s.restoredSignature,error:s.error})),{success:s.success,error:s.error}):e.md?s.success?(console.log(y(L("Analysis Rolled Back"),E({"Restored signature":`${s.restoredSignature?.substring(0,16)}...`,Note:"Previous sealed version is now active. Current version moved to draft."}))),{success:!0,data:{restoredSignature:s.restoredSignature}}):(console.log(y("## Rollback Failed",`> ${s.error}`)),{success:!1,error:s.error}):s.success?(d.done("Analysis rolled back to previous sealed version"),console.log(` Restored signature: ${s.restoredSignature?.substring(0,16)}...`),console.log(" Previous sealed version demoted to draft"),console.log(""),{success:!0,data:{restoredSignature:s.restoredSignature}}):(d.fail(s.error||"Rollback failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):e.md?console.log(y("## Rollback Failed",`> ${o}`)):d.fail(o),{success:!1,error:o}}}m(Ce,"rollback");async function xe(r=process.cwd(),e={}){if(e.semantic)return te(r,e);try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=await b.verify(o);return e.json?(console.log(JSON.stringify(s)),{success:s.valid}):(s.valid?d.done(s.message):d.fail(s.message),console.log(""),{success:s.valid,data:s})}catch(t){let o=k(t);return ge(o)}}m(xe,"verify");async function te(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json?console.log(JSON.stringify({success:!1,error:"No project ID found"})):d.fail("No project ID found"),t.result;let o=t.value,s=(()=>{try{return _.getDoc(o,"project")?.repoPath||r}catch{return r}})(),i=await b.semanticVerify(o,s);if(e.json)return console.log(JSON.stringify(i)),{success:i.passed,data:i};console.log(""),i.passed?(d.done("Semantic verification passed"),console.log(` ${i.passedCount}/${i.checks.length} checks passed (${i.totalMs}ms)`)):(d.fail("Semantic verification failed"),console.log(` ${i.failedCount}/${i.checks.length} checks failed`)),console.log(""),console.log("Check Results:");for(let n of i.checks){let a=n.passed?"\u2713":"\u2717",u=n.passed?`${n.output} (${n.durationMs}ms)`:n.error||"Failed";console.log(` ${a} ${n.name}: ${u}`)}return console.log(""),{success:i.passed,data:i}}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(te,"semanticVerifyCommand");import De from"node:fs/promises";import Re from"node:path";import{z as l}from"zod";var nt=l.object({style:l.string(),insights:l.array(l.string()),domains:l.array(l.string())}),rt=l.object({name:l.string(),description:l.string(),locations:l.array(l.string()),confidence:l.number().min(0).max(1),category:l.string()}),ot=l.object({issue:l.string(),reasoning:l.string(),files:l.array(l.string()),suggestion:l.string(),severity:l.enum(["low","medium","high"]),confidence:l.number().min(0).max(1)}),at=l.object({description:l.string(),area:l.string(),effort:l.enum(["small","medium","large"]),impact:l.string(),priority:l.enum(["low","medium","high"])}),it=l.object({path:l.string(),reason:l.string(),risk:l.string(),severity:l.enum(["low","medium","high"])}),ct=l.object({description:l.string(),files:l.array(l.string()),benefit:l.string(),effort:l.enum(["small","medium","large"])}),lt=l.object({category:l.string(),rule:l.string(),example:l.string().optional()}),ut=l.object({build:l.string().optional(),test:l.string().optional(),lint:l.string().optional(),dev:l.string().optional(),format:l.string().optional(),install:l.string().optional()}),mt=l.object({languages:l.array(l.string()),frameworks:l.array(l.string()),packageManager:l.string().optional()}),gt=l.object({version:l.literal(1),commitHash:l.string().nullable(),analyzedAt:l.string(),architecture:nt,patterns:l.array(rt),antiPatterns:l.array(ot),techDebt:l.array(at),riskAreas:l.array(it),refactorSuggestions:l.array(ct),projectInsights:l.array(l.string()),conventions:l.array(lt),commands:ut.optional(),stack:mt.optional()});function Ae(r){let e=gt.safeParse(r);return e.success?{ok:!0,value:e.data}:{ok:!1,error:e.error.issues.map(o=>`${o.path.length>0?o.path.join("."):"<root>"}: ${o.message}`).join("; ")}}m(Ae,"parseLlmAnalysis");X();re();async function Le(r,e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await pt(r,e),n=await ft(i.content,e),a=D.getActive(s),u=!!(a&&ye(a)&&K(n)),c=u?dt(a,n):n;D.save(s,c);try{let{recomputeProjectStyle:f}=await import("./project-style-evolution-IJXT2MCP.mjs"),{gatherStats:h,detectStack:x,detectCommands:B}=await import("./sync-analyzer-6U5GHYV3.mjs"),[T,P,Q]=await Promise.all([h(e),x(e),B(e)]);await f({projectId:s,projectPath:e,stats:T,stack:P,commands:Q,commitHash:c.commitHash,source:"analysis-save"})}catch{}let p=K(c)&&!u;if(t.md){let h=[L(u?"LLM Analysis Notes Merged (house style preserved)":p?"LLM Analysis Notes Saved (thin \u2014 not house style)":"LLM Analysis Saved"),E({Input:i.source,Architecture:c.architecture.style,Patterns:c.patterns.length,"Anti-patterns":c.antiPatterns?.length||0,"Tech debt items":c.techDebt?.length||0,"Risk areas":c.riskAreas?.length||0,Conventions:c.conventions?.length||0,...u?{Merge:"thin notes \u2192 existing rich analysis"}:{},...p?{Kind:"thin markdown/notes"}:{}})];p&&h.push(z("Prefer schema v1 JSON (architecture/patterns/conventions) via `prjct analysis-save-llm <file> --md`. Markdown alone leaves patterns empty and burns a retry loop.")),console.log(y(...h))}else console.log(JSON.stringify({success:!0,message:u?"LLM analysis notes merged into existing rich analysis":p?"LLM analysis thin notes saved (prefer schema v1 JSON for house style)":"LLM analysis saved",input:i.source,mergedNotes:u,thin:p,stats:{patterns:c.patterns.length,antiPatterns:c.antiPatterns?.length||0,techDebt:c.techDebt?.length||0},...p?{tip:"Prefer schema v1 JSON (architecture/patterns/conventions). Markdown alone is thin notes."}:{}}));return{success:!0}}catch(o){return A(o)}}m(Le,"saveLlmAnalysis");function dt(r,e){let t=m((o,s,i)=>{let n=[],a=new Set;for(let u of[...o,...s]){let c=u.toLowerCase();if(!(a.has(c)||!u.trim())&&(a.add(c),n.push(u),n.length>=i))break}return n},"mergeUnique");return{...r,analyzedAt:e.analyzedAt,commitHash:e.commitHash??r.commitHash,projectInsights:t(r.projectInsights??[],e.projectInsights??[],60),architecture:{...r.architecture,insights:t(r.architecture.insights??[],e.architecture.insights??[],24)}}}m(dt,"mergeThinNotesIntoRich");async function pt(r,e){let t=r.trim();if(!t)throw new Error("analysis-save-llm requires analysis text, JSON, or a file path");let o=Re.isAbsolute(t)?t:Re.resolve(e,t);try{if((await De.stat(o)).isFile())return{content:await De.readFile(o,"utf-8"),source:"file"}}catch{}return{content:r,source:"inline"}}m(pt,"resolveAnalysisInput");async function ft(r,e){let t=r.trim();if(!t)throw new Error("analysis-save-llm received an empty analysis");let o=ht(t);if(o.ok){let s=Ae(o.value);return s.ok?s.value:Me(`Structured analysis did not match the legacy schema; preserved as LLM notes.
|
|
12
12
|
|
|
13
13
|
${JSON.stringify(o.value,null,2)}`,e)}return Me(t,e)}m(ft,"normalizeAnalysis");function ht(r){try{return{ok:!0,value:JSON.parse(r)}}catch{return{ok:!1}}}m(ht,"tryParseJson");async function Me(r,e){let t=yt(r);return{version:1,commitHash:await wt(e),analyzedAt:I(),architecture:{style:"unknown",insights:t.slice(0,8),domains:[]},patterns:[],antiPatterns:[],techDebt:[],riskAreas:[],refactorSuggestions:[],projectInsights:t,conventions:[]}}m(Me,"analysisFromText");function yt(r){let e=r.split(/\r?\n/).map(s=>s.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s*[-*]\s+\[[ xX]\]\s+/,"").replace(/^\s*[-*]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").trim()).filter(St),t=[],o=new Set;for(let s of e){let i=s.toLowerCase();if(!o.has(i)&&(o.add(i),t.push(s),t.length>=40))break}return t.length>0?t:[r.slice(0,2e3)]}m(yt,"textToInsights");function St(r){if(!r||!/[\p{L}\p{N}]/u.test(r))return!1;let e=r.toLowerCase().replace(/\s+/g," ").trim();return!(["current work","wip","misc","todo","n/a","none","latest","unreleased","changelog"].includes(e)||/^[-=_]{3,}$/.test(e)||/^(added|changed|fixed|removed)$/i.test(e)||/^v?\d+\.\d+\.\d+(?:-[\w.-]+)?$/i.test(e))}m(St,"isUsefulInsight");async function wt(r){try{let{stdout:e}=await ne("git",["rev-parse","HEAD"],{cwd:r});return e.trim()||null}catch{return null}}m(wt,"resolveCurrentCommit");async function Ne(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=D.getActive(o);if(!s)return e.md?console.log(y("## No LLM Analysis","> Run `prjct sync` to generate.")):console.log(JSON.stringify({success:!1,message:"No LLM analysis found"})),{success:!1,message:"No LLM analysis found"};if(e.md){let i=[L(`LLM Analysis (${s.architecture.style})`),""];if(s.architecture.insights.length>0&&i.push(R("Architecture Insights",M(s.architecture.insights.slice(0,5)))),s.patterns.length>0){let n=s.patterns.slice(0,8);i.push(R(`Patterns (${s.patterns.length})`,M(n.map(a=>`**${a.name}** \u2014 ${a.description} (${a.category})`))))}if(s.antiPatterns.length>0){let n=s.antiPatterns.slice(0,5);i.push(R(`Anti-Patterns (${s.antiPatterns.length})`,M(n.map(a=>`[${a.severity}] ${a.issue} \u2014 ${a.suggestion}`))))}if(s.techDebt.length>0){let n=s.techDebt.slice(0,5);i.push(R(`Tech Debt (${s.techDebt.length})`,M(n.map(a=>`[${a.priority}/${a.effort}] ${a.description}`))))}s.conventions.length>0&&i.push(R("Conventions",M(s.conventions.slice(0,5).map(n=>`**${n.category}**: ${n.rule}`)))),console.log(y(...i))}else{let i={...s,patterns:s.patterns.slice(0,10),antiPatterns:s.antiPatterns.slice(0,6),techDebt:s.techDebt.slice(0,6),conventions:s.conventions.slice(0,6)};console.log(JSON.stringify({success:!0,analysis:i}))}return{success:!0,data:s}}catch(t){return A(t)}}m(Ne,"getLlmAnalysis");ce();J();import $t from"node:path";X();async function Te(r,e){let t=Date.now()-e;await le.installGlobalConfig(),d.done(`Synced ${r.stats.name||"project"} (${(t/1e3).toFixed(1)}s)`),console.log("");let o=r.stats.frameworks.length>0?` (${r.stats.frameworks[0]})`:"",s=r.syncMetrics?.indexes,i=[`${r.stats.fileCount} files indexed`,`Stack: ${r.stats.ecosystem}${o} | Branch: ${r.git.branch}`];if(s?.bm25Files){let a=s.bm25Files*(s.bm25AvgTokens||0);i.push(`Index: ${O(a)} tokens | ${s.bm25VocabSize||0} terms | ${s.importEdges||0} imports`)}d.box("Sync Summary",i.join(`
|
|
14
14
|
`));let n=[];if(r.generatedSkills?.generated&&r.generatedSkills.generated.length>0){let a=r.generatedSkills.generated.length,u=a===1?"skill":"skills";n.push(`${a} ${u} generated`)}if(r.context7&&n.push(`Context7: ${r.context7.verified?"verified":`not ready${r.context7.message?` (${r.context7.message})`:""}`}`),r.analysisSummary&&n.push(`Analysis: ${r.analysisSummary.patterns} patterns | ${r.analysisSummary.antiPatterns} anti-patterns (${r.analysisSummary.criticalAntiPatterns} critical)`),r.contextQuality){let a=r.contextQuality,u=a.irrelevantRemoved>0||a.repairEntriesCreated>0?`, repaired ${a.repairEntriesCreated}, removed ${a.irrelevantRemoved}`:"";n.push(`Context quality: ${a.score}/${a.threshold}${a.passed?"":" (needs review)"}${u}`)}if(d.section("Generated"),d.list(n,{bullet:"\u2713"}),console.log(""),r.phaseTimings&&r.phaseTimings.length>0){let a=[...r.phaseTimings].sort((u,c)=>c.ms-u.ms).slice(0,3).map(u=>`${u.phase} ${(u.ms/1e3).toFixed(1)}s`).join(", ");console.log(`Slowest phases: ${a}`),console.log("")}if(r.git.hasChanges&&(d.warn("Uncommitted changes detected"),console.log("")),r.verification){let a=r.verification;if(a.passed){let u=a.checks.map(c=>`${c.name} (${c.durationMs}ms)`);d.section("Verified"),d.list(u,{bullet:"\u2713"})}else{d.section("Verification");let u=a.checks.map(c=>c.passed?`\u2713 ${c.name}`:`\u2717 ${c.name}${c.error?` \u2014 ${c.error}`:""}`);d.list(u),a.skippedCount>0&&d.warn(`${a.skippedCount} check(s) skipped (fail-fast)`)}console.log("")}return ve("sync"),{success:!0,data:r,metrics:{elapsed:t,fileCount:r.stats.fileCount}}}m(Te,"showSyncResult");async function Fe(r){try{let e=await de.getRecentEvents(r,100),t=new Date().toISOString().split("T")[0],o=e.filter(c=>(c.timestamp||c.ts)?.startsWith(t)),s=(()=>{if(o.length<2)return null;let c=o.map(f=>new Date(f.timestamp||f.ts).getTime()).filter(f=>!Number.isNaN(f)).sort((f,h)=>f-h);if(c.length<2)return null;let p=c[c.length-1]-c[0];return oe(p)})(),i=o.filter(c=>c.action==="task_completed").length,n=o.filter(c=>c.action==="feature_shipped").length,a=new Map;for(let c of o)if(c.action==="sync"&&Array.isArray(c.subagents))for(let p of c.subagents)a.set(p,(a.get(p)||0)+1);let u=Array.from(a.entries()).map(([c,p])=>({name:c,count:p})).sort((c,p)=>p.count-c.count);return{sessionDuration:s,tasksCompleted:i,featuresShipped:n,agentsUsed:u}}catch{return{sessionDuration:null,tasksCompleted:0,featuresShipped:0,agentsUsed:[]}}}m(Fe,"getSessionActivity");function O(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:r.toLocaleString()}m(O,"formatTokens");function se(r){return r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(1)}s`}m(se,"formatDuration");function Ee(r){if(r.length===0)return"";let e="\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588",t=r.map(s=>s.tokensSaved),o=Math.max(...t,1);return t.map(s=>{let i=Math.min(Math.floor(s/o*(e.length-1)),e.length-1);return e[i]}).join("")}m(Ee,"generateSparkline");function Oe(r,e,t,o,s,i){let n=[];if(n.push(`# ${t} - Stats Dashboard`),n.push(""),n.push(`_Generated: ${new Date().toLocaleString()} | Tracking since: ${o}_`),n.push(""),s){if(n.push("## Today's Activity"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),s.sessionDuration&&n.push(`| Duration | ${s.sessionDuration} |`),n.push(`| Tasks completed | ${s.tasksCompleted} |`),n.push(`| Features shipped | ${s.featuresShipped} |`),s.agentsUsed.length>0){let a=s.agentsUsed.slice(0,3).map(u=>`${u.name} (${u.count}\xD7)`).join(", ");n.push(`| Agents used | ${a} |`)}n.push("")}if(i&&(i.decisions>0||i.preferences>0)&&(n.push("## Patterns Learned"),n.push(""),n.push("| Type | Count |"),n.push("|------|-------|"),n.push(`| Decisions | ${i.learnedDecisions} confirmed (${i.decisions} total) |`),n.push(`| Preferences | ${i.preferences} |`),n.push(`| Workflows | ${i.workflows} |`),n.push("")),n.push("## Context Efficiency"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),n.push(`| Tokens reduced | ${O(r.totalTokensSaved)} |`),n.push(`| Compression | ${(r.compressionRate*100).toFixed(0)}% |`),n.push(`| Est. cost saved | ${U(r.estimatedCostSaved)} |`),n.push(""),n.push("## Performance"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),n.push(`| Syncs | ${r.syncCount} |`),n.push(`| Avg time | ${se(r.avgSyncDuration)} |`),n.push(""),r.topAgents.length>0){n.push("## Agent Usage"),n.push(""),n.push("| Agent | Usage |"),n.push("|-------|-------|");let a=r.topAgents.reduce((u,c)=>u+c.usageCount,0);for(let u of r.topAgents){let c=a>0?(u.usageCount/a*100).toFixed(0):0;n.push(`| ${u.agentName} | ${c}% (${u.usageCount}) |`)}n.push("")}if(n.push("## 30-Day Trend"),n.push(""),n.push(`- Tokens saved: ${O(r.last30DaysTokens)}`),r.trend!==0){let a=r.trend>0?"+":"";n.push(`- Trend: ${a}${r.trend.toFixed(0)}% vs previous period`)}return n.push(""),n.push("---"),n.push(""),n.push("_Generated with [prjct-cli](https://prjct.app)_"),n.join(`
|
|
@@ -37,6 +37,6 @@ ${JSON.stringify(o.value,null,2)}`,e)}return Me(t,e)}m(ft,"normalizeAnalysis");f
|
|
|
37
37
|
Next steps:`),console.log("\u2022 p. sync \u2192 Generate agents based on stack"),console.log('\u2022 p. work "<intent>" \u2192 Start a work cycle'),{success:!0,summary:s,data:o}}catch(o){return console.error("\u274C Error:",k(o)),A(o)}}async sync(e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=Date.now();if(t.package){let a=await ie.detectMonorepo(e);if(!a.isMonorepo)return{success:!1,error:"Not a monorepo. --package flag only works in monorepos."};let u=a.packages.find(p=>p.name===t.package||p.relativePath===t.package);if(!u){let p=a.packages.map(f=>f.name).join(", ");return{success:!1,error:`Package "${t.package}" not found. Available: ${p}`}}let c=await H.sync(e,{packagePath:u.path,packageName:u.name});return t.json?console.log(JSON.stringify({success:c.success,package:u.name,path:u.relativePath})):t.md?console.log(y(L(`Synced package: ${u.name}`))):d.done(`Synced package: ${u.name}`),{success:c.success}}t.md||d.spin("Syncing project...");let n=await H.sync(e,{full:t.full});if(!n.success)return t.md?console.log(y("## Sync Failed",`> ${n.error||"Unknown error"}`)):d.fail(n.error||"Sync failed"),{success:!1,error:n.error};if(t.md||d.stop(),t.md){let a=Date.now()-i,u=n.generatedSkills?.generated?.length??0,c=await b.diff(s).then(g=>g?.hasChanges?G(g):null).catch(()=>null),p=n.git.recentCommits[0]?.hash??null,h=p&&D.isCurrent(s,p)?null:await ee(s,e,n.git,n.stats).then(g=>["## Analysis Payload",Ge,"### Data","```json",JSON.stringify(g),"```"].join(`
|
|
38
38
|
`)).catch(()=>"### Next: Run `prjct analysis-payload --md` to update project analysis"),x=$e("sync",!0),B=(()=>{try{let g=he.recall(s,{types:["context"],limit:5}).map(F=>`- ${fe(F)} \`${F.id}\``);return g.length>0?["### Evaluate recent context","Task contexts captured recently \u2014 fold their decisions, patterns and","anti-patterns into the project analysis (and supersede anything now wrong):","",...g].join(`
|
|
39
39
|
`):null}catch{return null}})(),T=n.syncMetrics?.indexes,P={Duration:`${(a/1e3).toFixed(1)}s`,Skills:`${u} generated`,"Files indexed":n.stats.fileCount};if(T?.bm25Files){let g=T.bm25Files*(T.bm25AvgTokens||0);P["Tokens indexed"]=`${Math.round(g/1e3)}K`,P["Import edges"]=T.importEdges||0,P["Co-change commits"]=T.cochangeCommits||0}n.contextQuality&&(P["Context quality"]=`${n.contextQuality.score}/${n.contextQuality.threshold}`+(n.contextQuality.passed?"":" needs review"),P["Context removed"]=n.contextQuality.irrelevantRemoved,P["Context repairs"]=n.contextQuality.repairEntriesCreated);let Q=n.phaseTimings&&n.phaseTimings.length>0?R("Phase timings (slowest first)",M([...n.phaseTimings].sort((g,F)=>F.ms-g.ms).map(g=>`${g.phase}: ${(g.ms/1e3).toFixed(2)}s`))):null,qe=(()=>{if(!n.retentionDryRun)return null;let g=n.retentionDryRun,F=g.dryRun===!1?"applied":"dry-run",Be=g.dryRun===!1?` \xB7 acted: ${g.archived??0} archived, ${g.deleted??0} deleted`+(g.inboxMerged||g.inboxArchived?`, inbox ${g.inboxMerged??0} merged/${g.inboxArchived??0} archived`:""):"";if(P[`Retention (${F})`]=`${g.active} active \xB7 ${g.archive} archive \xB7 ${g.delete} delete${Be}`,g.vault){let w=g.vault,W=g.dryRun===!1?` \xB7 purged: hard\u0394${w.softDeletedPurged??0} distill\u0394${w.distilledDiscarded??0} digests+${w.digestsWritten??0} arch\u0394${w.archivesPruned??0}`:"";P.Vault=`${w.live} live \xB7 soft-del ${w.softDeleted} \xB7 archives ${w.archives} \xB7 auto ${w.autoSourceLive}${W}`}return g.samples.length>0?R(g.dryRun===!1?"Retention (Rho) \u2014 worst excess/score (actions applied)":"Retention (Rho) dry-run \u2014 worst excess/score (nothing removed)",M(g.samples.map(w=>{let W="excess"in w&&typeof w.excess=="number"?` excess=${w.excess.toFixed(2)}`:"";return`\`${w.id}\` [${w.type}] ${w.verdict} (${w.score}${W}) \u2014 ${w.reasons.join(", ")}`}))):null})(),He=n.projectStyle?.evolutionMd?n.projectStyle.evolutionMd:n.projectStyle?.summary?["## Project style","",n.projectStyle.summary,"",`Coverage: ${n.projectStyle.styleCoverage}/100 \xB7 ${n.projectStyle.patternCount} patterns \xB7 ${n.projectStyle.conventionCount} conventions \xB7 ${n.projectStyle.antiPatternCount} anti-patterns`].join(`
|
|
40
|
-
`):null,ze=n.developerSnapshotCaptured?await import("./developer-evolution-
|
|
40
|
+
`):null,ze=n.developerSnapshotCaptured?await import("./developer-evolution-UTY3CWOK.mjs").then(({renderDeveloperEvolution:g})=>g(s,4)).catch(()=>`## Developer evolution
|
|
41
41
|
|
|
42
42
|
Weekly developer snapshot captured.`):null,Ve=y(L("Sync Complete"),E(P),Q,qe,c,He,ze,n.git.hasChanges?z("Uncommitted changes detected"):null,B,h,we(x.map(g=>({label:g.desc,command:g.cmd}))));return console.log(Ve),{success:!0,data:n,metrics:{elapsed:a,skillCount:u,fileCount:n.stats.fileCount}}}return Te(n,i)}catch(o){return t.md?console.log(y("## Sync Failed",`> ${k(o)}`)):d.fail(k(o)),A(o)}}async analysisPayload(e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await H.sync(e);if(!i.success)return{success:!1,error:i.error||"Failed to gather project data"};let n=i.git.recentCommits[0]?.hash??null;if(n&&D.isCurrent(s,n))return t.md?console.log(y(L("LLM analysis is current"),"> No re-analysis needed.")):console.log(JSON.stringify({success:!0,action:"skip",message:"Analysis is current"})),{success:!0,message:"Analysis is current"};let a=await ee(s,e,i.git,i.stats);return t.md?console.log(y("## Analysis Payload",Ge,"### Data","```json",JSON.stringify(a),"```")):console.log(JSON.stringify({success:!0,payload:a})),{success:!0,data:a}}catch(o){return A(o)}}async saveLlmAnalysis(...e){return Le(...e)}async getLlmAnalysis(...e){return Ne(...e)}async stats(...e){return Je(...e)}async diff(...e){return _e(...e)}async seal(...e){return be(...e)}async rollback(...e){return Ce(...e)}async verify(...e){return xe(...e)}async semanticVerify(...e){return te(...e)}};export{Ue as AnalysisCommands};
|
|
@@ -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-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{a as DEFAULT_API_URL,b as DEFAULT_WEB_URL,c as default};
|
|
@@ -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 n}from"./chunk-
|
|
8
|
+
import{a as n}from"./chunk-DB226JIV.mjs";import"./chunk-JZDZH6IV.mjs";import"./chunk-XV2LJVYB.mjs";import"./chunk-YHOZTAZH.mjs";import"./chunk-DCHIPMOG.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-OC4CYF7V.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-XDBJSJOT.mjs";import"./chunk-D7DQABWO.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.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 t}from"./chunk-E66B27AL.mjs";async function c(u,o){try{let e=o??await import("./config-manager-2JJPCLKC.mjs").then(({default:a})=>a.readConfig(u).catch(()=>null));if(!e?.projectId||!e.cloud?.enabled||e.cloud.paused)return{ran:!1};if(!await n.hasAuth())return{ran:!1};let r=await n.sync(e.projectId,{include:e.cloud.include??{}});return{ran:!0,pushed:r.pushed?.count??0,pulled:r.pulled?.count??0,error:r.success?void 0:r.error}}catch{return{ran:!1}}}t(c,"flushIfLinked");export{c as flushIfLinked};
|
|
@@ -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{i as a}from"./chunk-
|
|
8
|
+
import{i as a}from"./chunk-EGCYDLSO.mjs";import"./chunk-7PBWIO4K.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-RT2DFIWF.mjs";import"./chunk-PVCEWFHS.mjs";import"./chunk-LR24AIEW.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-ZZBNFNMG.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.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-IJ523YO2.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as captureGate};
|
|
@@ -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 r,c as d}from"./chunk-QSAA6LZF.mjs";import{e as o,g as p}from"./chunk-
|
|
8
|
+
import{b as r,c as d}from"./chunk-QSAA6LZF.mjs";import{e as o,g as p}from"./chunk-TKXOMN4K.mjs";import{b as n,h as m}from"./chunk-A6K4H3YT.mjs";import{a}from"./chunk-E66B27AL.mjs";m();p();var u="judgment:active",c="judgment:ghosts",g=class{static{a(this,"JudgmentLedgerStorage")}get(s){let t=o.getDoc(s,u);if(t===null)return null;let e=r.safeParse(t);return e.success?e.data:null}set(s,t){let e=t.updatedAt||n();return o.updateDoc(s,u,()=>r.parse({...t,updatedAt:e}),()=>r.parse({...t,updatedAt:e}))}clear(s){o.deleteDoc(s,u)}getGhosts(s){let t=o.getDoc(s,c);if(t===null)return{ghosts:[],updatedAt:n()};let e=d.safeParse(t);return e.success?e.data:{ghosts:[],updatedAt:n()}}setGhosts(s,t){let e=d.parse(t);return o.setDoc(s,c,e),e}},w=new g;export{u as a,c as b,w as c};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a}from"./chunk-E66B27AL.mjs";function T(n){let e=new Set;for(let t of n){let s=c(t.message)?.model??t.model;typeof s=="string"&&s.trim()&&e.add(s.trim().slice(0,120))}return e.size===0?"unknown":e.size>1?"mixed":[...e][0]}a(T,"identifyTranscriptModel");function h(n){let e=[];for(let t of n.split(`
|
|
9
|
+
`)){let o=t.trim();if(o)try{let s=JSON.parse(o);s&&typeof s=="object"&&e.push(s)}catch{}}return e}a(h,"parseTranscriptJsonl");function c(n){return n&&typeof n=="object"?n:null}a(c,"asRecord");function r(n){return typeof n=="number"&&Number.isFinite(n)?n:0}a(r,"num");function f(n){let e=r(n.input_tokens)+r(n.cache_creation_input_tokens)+r(n.prompt_tokens)+r(n.promptTokenCount)+r(n.inputOther)+r(n.inputCacheCreation),t=r(n.output_tokens)+r(n.completion_tokens)+r(n.candidatesTokenCount)+r(n.output),o=r(n.cache_read_input_tokens)+r(n.inputCacheRead);return{tokensIn:e,tokensOut:t,cacheRead:o}}a(f,"usagePairFrom");function l(n){return typeof n.timestamp=="string"?Date.parse(n.timestamp):typeof n.time=="number"?n.time:Number.NaN}a(l,"lineTimeMs");function g(n,e){if(!e?.sinceIso&&!e?.untilIso)return!0;let t=l(n);return!(!Number.isFinite(t)||e.sinceIso&&t<Date.parse(e.sinceIso)||e.untilIso&&t>=Date.parse(e.untilIso))}a(g,"inWindow");function I(n,e){let t=n.reduce((u,p)=>{if(!g(p,e))return u;let d=c(c(p.message)?.usage)??c(p.usage)??c(p.usageMetadata);if(!d)return u;let m=f(d);return{tokensInNew:u.tokensInNew+m.tokensIn,tokensOut:u.tokensOut+m.tokensOut,maxCacheRead:Math.max(u.maxCacheRead,m.cacheRead)}},{tokensInNew:0,tokensOut:0,maxCacheRead:0}),{tokensInNew:o,tokensOut:s,maxCacheRead:i}=t;return{tokensInNew:o,cacheReadMax:i,tokensIn:o+i,tokensOut:s}}a(I,"sumTranscriptUsageDetailed");function x(n,e){let t=I(n,e);return{tokensIn:t.tokensIn,tokensOut:t.tokensOut}}a(x,"sumTranscriptUsage");function R(n,e){let t=new Map;for(let s of n){if(!g(s,e))continue;let i=c(s.message),u=c(i?.usage)??c(s.usage)??c(s.usageMetadata);if(!u)continue;let p=i?.model??s.model,d=typeof p=="string"&&p?p:"unknown",m=f(u),k=t.get(d)??{tokensIn:0,tokensOut:0,maxCacheRead:0};k.tokensIn+=m.tokensIn,k.tokensOut+=m.tokensOut,m.cacheRead>k.maxCacheRead&&(k.maxCacheRead=m.cacheRead),t.set(d,k)}let o=new Map;for(let[s,i]of t)o.set(s,{tokensIn:i.tokensIn+i.maxCacheRead,tokensOut:i.tokensOut});return o}a(R,"sumTranscriptUsageByModel");export{T as a,h as b,I as c,x as d,R as e};
|
|
@@ -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-ZYCNW75E.mjs";import{a as D}from"./chunk-JR542RI2.mjs";import{b as v}from"./chunk-CPR4FPXG.mjs";import{g as C,h as M,i as w,j as E,o as R}from"./chunk-3HGQPUKG.mjs";import{b}from"./chunk-PVCEWFHS.mjs";import{a as S,b as K,d as m,g as U}from"./chunk-TKXOMN4K.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,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-HGZQWYBL.mjs";import{a as i}from"./chunk-ZMLA5SKR.mjs";import{b as y}from"./chunk-PVCEWFHS.mjs";import{d as g,g as x}from"./chunk-TKXOMN4K.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
|
|
@@ -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 y}from"./chunk-R4ILCXKE.mjs";import{e as g,g as T}from"./chunk-
|
|
8
|
+
import{c as y}from"./chunk-R4ILCXKE.mjs";import{e as g,g as T}from"./chunk-TKXOMN4K.mjs";import{d as b,e as I,o as A}from"./chunk-UH4MD3F3.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import v from"node:fs/promises";import w from"node:path";T();A();var D=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","of","in","to","for","with","on","at","from","by","as","or","and","but","if","not","no","so","up","out","this","that","it","its","all","any","import","export","default","const","let","var","function","class","interface","type","return","new","true","false","null","undefined","void","async","await","static","public","private","protected","readonly","string","number","boolean","object","array"]);function p(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[-_./]/g," ").toLowerCase().split(/\s+/).filter(n=>n.length>1)}l(p,"splitIdentifier");function B(t,n){let e=[],o=n.replace(/\.[^.]+$/,"").split(/[/\\]/).filter(Boolean);for(let i of o)e.push(...p(i));let r=[/export\s+(?:async\s+)?function\s+(\w+)/g,/export\s+class\s+(\w+)/g,/export\s+interface\s+(\w+)/g,/export\s+type\s+(\w+)/g,/export\s+(?:const|let|var)\s+(\w+)/g,/export\s+default\s+(?:class|function)\s+(\w+)/g];for(let i of r)for(let s of t.matchAll(i))s[1]&&e.push(...p(s[1]));let a=[/(?:async\s+)?function\s+(\w+)/g,/class\s+(\w+)/g,/interface\s+(\w+)/g,/type\s+(\w+)\s*=/g];for(let i of a)for(let s of t.matchAll(i))s[1]&&e.push(...p(s[1]));let d=/(?:from|import)\s+['"]([^'"]+)['"]/g;for(let i of t.matchAll(d)){let s=i[1];if(s.startsWith(".")||s.startsWith("@/"))e.push(...p(s));else{let f=s.startsWith("@")?s.split("/").slice(0,2).join("/"):s.split("/")[0];e.push(...p(f))}}let c=/\/\/\s*(.+)/g;for(let i of t.matchAll(c)){let s=i[1].toLowerCase().split(/\s+/).filter(f=>f.length>2);e.push(...s)}let u=/\/\*\*?([\s\S]*?)\*\//g;for(let i of t.matchAll(u)){let s=i[1].replace(/@\w+/g,"").replace(/\*/g,"").toLowerCase().split(/\s+/).filter(f=>f.length>2&&/^[a-z]+$/.test(f));e.push(...s)}return e.filter(i=>i.length>1&&!D.has(i)&&/^[a-z][a-z0-9]*$/.test(i))}l(B,"tokenizeFile");function R(t){return t.split(/\s+/).flatMap(n=>p(n)).filter(n=>n.length>1&&!D.has(n)&&/^[a-z][a-z0-9]*$/.test(n))}l(R,"tokenizeQuery");function x(){return Object.create(null)}l(x,"emptyInvertedIndex");async function C(t){let n=await b(t),e={},o=x(),r=await I(n,50,async c=>{try{let u=await v.readFile(w.join(t,c),"utf-8"),i=B(u,c);return i.length>0?{filePath:c,tokens:i}:null}catch{return null}});for(let{filePath:c,tokens:u}of r){e[c]={tokens:u,length:u.length};for(let[i,s]of M(u))o[i]||(o[i]=[]),o[i].push({path:c,tf:s})}let a=r.reduce((c,u)=>c+u.tokens.length,0),d=Object.keys(e).length;return{documents:e,invertedIndex:o,avgDocLength:d>0?a/d:0,totalDocs:d,builtAt:new Date().toISOString()}}l(C,"buildIndex");function N(t,n){return Math.log((n-t+.5)/(t+.5)+1)}l(N,"idf");function F(t,n){let e=R(t);if(e.length===0)return[];let o=new Map;for(let r of e){let a=n.invertedIndex[r];if(!a)continue;let d=N(a.length,n.totalDocs);for(let{path:c,tf:u}of a){let i=n.documents[c];if(!i)continue;let s=u*(1.2+1),f=u+1.2*(1-.75+.75*(i.length/n.avgDocLength)),L=d*(s/f);o.set(c,(o.get(c)||0)+L)}}return y(o)}l(F,"score");var h="bm25-index";function M(t){let n=new Map;for(let e of t)n.set(e,(n.get(e)||0)+1);return n}l(M,"termFrequencies");function P(t,n){let e=t.documents[n];if(!e)return;delete t.documents[n];let o=new Set(e.tokens),r=o.size>0?o:new Set(Object.keys(t.invertedIndex));for(let a of r){let d=t.invertedIndex[a];if(!d)continue;let c=d.filter(u=>u.path!==n);c.length===0?delete t.invertedIndex[a]:t.invertedIndex[a]=c}}l(P,"removeDocument");function z(t,n,e){if(e.length!==0){t.documents[n]={tokens:e,length:e.length};for(let[o,r]of M(e))t.invertedIndex[o]||(t.invertedIndex[o]=[]),t.invertedIndex[o].push({path:n,tf:r})}}l(z,"addDocument");function q(t){let n=Object.values(t.documents).map(o=>o.length),e=n.reduce((o,r)=>o+r,0);t.totalDocs=n.length,t.avgDocLength=n.length>0?e/n.length:0,t.builtAt=new Date().toISOString()}l(q,"recalculateStats");var m=new Map;function _(t){return{schemaVersion:2,avgDocLength:t.avgDocLength,totalDocs:t.totalDocs,builtAt:t.builtAt,docLengths:Object.fromEntries(Object.entries(t.documents).map(([n,e])=>[n,e.length]))}}l(_,"indexMetadata");function k(t,n,e,o,r){if(o.length!==0){t.run(e,JSON.stringify(o),o.length,r);for(let[a,d]of M(o))n.run(a,e,d)}}l(k,"writeDocumentRows");function W(t,n){try{g.transaction(t,e=>{e.prepare("DELETE FROM bm25_terms").run(),e.prepare("DELETE FROM bm25_documents").run();let o=new Date().toISOString(),r=e.prepare("INSERT INTO bm25_documents (path, tokens, length, updated_at) VALUES (?, ?, ?, ?)"),a=e.prepare("INSERT INTO bm25_terms (token, path, tf) VALUES (?, ?, ?)");for(let[d,c]of Object.entries(n.documents))k(r,a,d,c.tokens,o)})}catch{}}l(W,"replacePerFileTables");function $(t,n,e,o){try{g.transaction(t,r=>{let a=r.prepare("DELETE FROM bm25_terms WHERE path = ?"),d=r.prepare("DELETE FROM bm25_documents WHERE path = ?"),c=r.prepare("INSERT INTO bm25_documents (path, tokens, length, updated_at) VALUES (?, ?, ?, ?)"),u=r.prepare("INSERT INTO bm25_terms (token, path, tf) VALUES (?, ?, ?)"),i=new Date().toISOString();for(let s of new Set([...e,...o]))a.run(s),d.run(s);for(let s of e){let f=n.documents[s];f&&k(c,u,s,f.tokens,i)}})}catch{}}l($,"updatePerFileTables");function H(t,n){g.setDoc(t,h,_(n)),W(t,n),m.delete(t)}l(H,"saveIndex");function U(t,n,e,o){g.setDoc(t,h,_(n)),$(t,n,e,o),m.delete(t)}l(U,"saveIndexUpdate");function V(t,n,e){try{let o=g.query(t,"SELECT path, length FROM bm25_documents ORDER BY path");if(o.length===0){if(e?.totalDocs===0){let s={documents:{},invertedIndex:x(),avgDocLength:0,totalDocs:0,builtAt:e.builtAt};return m.set(t,{index:s,updatedAt:n}),s}return null}let r={},a=x();for(let s of o)r[s.path]={tokens:[],length:s.length};let d=o.reduce((s,f)=>s+f.length,0),c=g.query(t,"SELECT token, path, tf FROM bm25_terms ORDER BY token, path");for(let s of c)a[s.token]||(a[s.token]=[]),a[s.token].push({path:s.path,tf:s.tf});let u=o.length,i={documents:r,invertedIndex:a,avgDocLength:u>0?d/u:0,totalDocs:u,builtAt:e?.builtAt??n};return m.set(t,{index:i,updatedAt:n}),i}catch{return null}}l(V,"loadIndexFromPerFileTables");function tt(t){try{return g.get(t,"SELECT key AS k FROM kv_store WHERE key = ? LIMIT 1",h)!=null}catch{return!1}}l(tt,"hasIndex");function O(t){let n=g.get(t,"SELECT updated_at FROM kv_store WHERE key = ?",h);if(!n)return m.delete(t),null;let e=m.get(t);if(e&&e.updatedAt===n.updated_at)return e.index;let o=g.getDoc(t,h),r=V(t,n.updated_at,o);if(r)return r;if(!o?.invertedIndex)return null;let a={};for(let[c,u]of Object.entries(o.docLengths))a[c]={tokens:[],length:u};let d={documents:a,invertedIndex:Object.assign(x(),o.invertedIndex),avgDocLength:o.avgDocLength,totalDocs:o.totalDocs,builtAt:o.builtAt};return m.set(t,{index:d,updatedAt:n.updated_at}),d}l(O,"loadIndex");async function Y(t,n){let e=await C(t);return H(n,e),e}l(Y,"indexProject");async function nt(t,n,e,o=[]){let r=O(n);if(!r)return Y(t,n);let a=new Set([...e,...o]);for(let c of a)P(r,c);let d=await I(e,50,async c=>{try{let u=await v.readFile(w.join(t,c),"utf-8"),i=B(u,c);return{filePath:c,tokens:i}}catch{return null}});for(let{filePath:c,tokens:u}of d)z(r,c,u);return q(r),U(n,r,e,o),r}l(nt,"updateProjectIndex");function et(t,n,e=15){let o=O(t);return o?F(n,o).slice(0,e):[]}l(et,"queryFiles");export{tt as a,O as b,Y as c,nt as d,et as e};
|
|
@@ -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 a,g as h}from"./chunk-
|
|
8
|
+
import{d as a,g as h}from"./chunk-TKXOMN4K.mjs";import{b as u,p as l}from"./chunk-QWQFF2UG.mjs";import{a as e}from"./chunk-E66B27AL.mjs";h();l();function d(n){let t=n.toLowerCase();return t.includes("github")?"github":t.includes("gitlab")?"gitlab":t.includes("bitbucket")?"bitbucket":"other"}e(d,"providerForHost");function p(n){let t=n.trim();if(!t)return{};let r=t.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(r)return{provider:d(r[1]),repoSlug:r[2]};try{let o=new URL(t),c=o.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!o.host||!c?{}:{provider:d(o.host),repoSlug:c}}catch{return{}}}e(p,"parseRemote");async function y(n){try{let{stdout:t}=await u("git",["remote","get-url","origin"],{cwd:n});return t.trim()||void 0}catch{return}}e(y,"gitRemoteUrl");async function b(n){try{let{stdout:t}=await u("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return t.trim().replace(/^origin\//,"")||void 0}catch{return}}e(b,"gitDefaultBranch");function i(n){return typeof n=="string"&&n.length>0?n:void 0}e(i,"str");function g(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}e(g,"num");function P(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}e(P,"compact");async function S(n){let t=a.getDoc(n,"project")||{},r=i(t.repoPath),{provider:o,repoSlug:c}=r?p(await y(r)||""):{},f=r?await b(r):void 0,s=Array.isArray(t.techStack)?t.techStack.filter(m=>typeof m=="string"):void 0;return P({provider:o,repoSlug:c,currentBranch:i(t.currentBranch),defaultBranch:f,stack:i(t.stack),techStack:s&&s.length>0?s:void 0,version:i(t.version),commitCount:g(t.commitCount),fileCount:g(t.fileCount),lastCommit:i(t.lastSyncCommit),hasUncommitted:typeof t.hasUncommittedChanges=="boolean"?t.hasUncommittedChanges:void 0,cliVersion:i(t.cliVersion),syncedAt:i(t.lastSync)})}e(S,"buildProjectMeta");export{p as a,S 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{e as S,g as G}from"./chunk-
|
|
8
|
+
import{e as S,g as G}from"./chunk-TKXOMN4K.mjs";import{a as B,c as te,d as W,e as $,o as ne}from"./chunk-UH4MD3F3.mjs";import{a as d}from"./chunk-E66B27AL.mjs";te();import N from"node:fs/promises";import E from"node:path";G();function j(e,n){S.transaction(e,t=>{t.prepare("DELETE FROM code_symbols").run(),t.prepare("DELETE FROM code_symbol_edges").run();let s=t.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
|
|
9
9
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),i=t.prepare(`INSERT OR IGNORE INTO code_symbol_edges (src, dst, edge_type, confidence)
|
|
10
10
|
VALUES (?, ?, ?, ?)`);for(let r of n.symbols)s.run(r.id,r.file,r.kind,r.name,r.qname,r.startLine,r.endLine,r.exported?1:0);for(let r of n.edges)i.run(r.src,r.dst,r.edgeType,r.confidence)})}d(j,"replaceCodeGraph");function we(e){try{return S.query(e,"SELECT src, dst, edge_type, confidence FROM code_symbol_edges").map(n=>({src:n.src,dst:n.dst,edgeType:n.edge_type,confidence:n.confidence}))}catch{return[]}}d(we,"loadCodeSymbolEdges");G();ne();var D="symbol-graph",se=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java"]),re=new Set(["if","for","while","switch","catch","function","class","return","typeof","new","throw","await","void","super","this","import","require","console","Math","JSON","Object","Array","Promise","Map","Set","Date","Error","Buffer","process","describe","it","test","expect","beforeEach","afterEach","beforeAll","afterAll"]),oe=new Set(["if","for","while","switch","catch","return","await","typeof","new","throw","else","case","from","import","export","class","function","const","let","var","get","set","constructor","async","static","public","private","protected","readonly","abstract","extends","implements","interface","type","enum","default","as","of","in","do","try","finally","yield","with"]);function L(e,n){return e.slice(0,Math.min(n,e.length)).split(`
|
|
11
11
|
`).length}d(L,"lineOf");function ie(e,n,t,s){return`${e}#${n}:${t}@${s}`}d(ie,"symbolId");function H(e,n){return`${e.replace(/\.[^.]+$/,"").replace(/[/\\]/g,".")}.${n}`}d(H,"qnameOf");function I(e){let n=E.extname(e).toLowerCase();return se.has(n)}d(I,"isSourceFile");function O(e){let n=/\/\/[^\n]*(?:\n|$)|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|"(?:\\[\s\S]|[^"\\])*(?:"|$)|`(?:\\[\s\S]|[^`\\])*(?:`|$)/g;return e.replace(n,t=>t.replace(/[^\n]/g," "))}d(O,"stripNoise");function K(e){return{filePath:e,symbols:[],callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(K,"emptyExtract");function z(e){let n=[...new Set(e.map(t=>t.name))];return{calls:e,callNames:n}}d(z,"finalizeCalls");function ae(e,n){let t=[],s=[],i=new Map,r=O(e),a=[{re:/export\s+(?:async\s+)?function\s+(\w+)/g,kind:"function",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])(?:async\s+)?function\s+(\w+)/g,kind:"function",nameIdx:1},{re:/export\s+(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_]\w*)\s*=>/g,kind:"function",nameIdx:1,exported:!0},{re:/(?:^|[\n;])(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_]\w*)\s*=>/g,kind:"function",nameIdx:1},{re:/export\s+(?:abstract\s+)?class\s+(\w+)/g,kind:"class",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])(?:abstract\s+)?class\s+(\w+)/g,kind:"class",nameIdx:1},{re:/export\s+interface\s+(\w+)/g,kind:"interface",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])interface\s+(\w+)/g,kind:"interface",nameIdx:1},{re:/export\s+type\s+(\w+)\s*[=<]/g,kind:"type",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])type\s+(\w+)\s*[=<]/g,kind:"type",nameIdx:1},{re:/export\s+enum\s+(\w+)/g,kind:"enum",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])enum\s+(\w+)/g,kind:"enum",nameIdx:1},{re:/export\s+(?:const|let|var)\s+(\w+)\s*[:=]/g,kind:"const",nameIdx:1,exported:!0},{re:/(?:^|\n)[ \t]+(?:(?:public|private|protected|static|async|readonly)\s+)*(\w+)\s*\([^)]{0,200}\)\s*[:{]/g,kind:"method",nameIdx:1}],o=new Set;for(let{re:m,kind:y,nameIdx:b,exported:C}of a){m.lastIndex=0;for(let _ of r.matchAll(m)){let x=_[b];if(!x||x.length<2||oe.has(x))continue;let h=L(r,_.index),T=`${y}:${x}@${h}`;o.has(T)||(o.add(T),t.push({kind:y,name:x,startLine:h,endLine:null,exported:C===!0}))}}let c=/import\s+(?:type\s+)?(?:\{([^}]+)\}|(\w+)(?:\s*,\s*\{([^}]+)\})?|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let m of e.matchAll(c)){let y=m[5],b=d(C=>{if(C)for(let _ of C.split(",")){let x=_.trim().replace(/^type\s+/,"").split(/\s+as\s+/),h=(x[1]??x[0])?.trim();h&&/^[A-Za-z_][\w]*$/.test(h)&&i.set(h,y)}},"bindNamed");b(m[1]),b(m[3]),m[2]&&i.set(m[2],y),m[4]&&i.set(m[4],y)}let l=/(?:const|let|var)\s+(\w+)\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(let m of e.matchAll(l))i.set(m[1],m[2]);let f=/\b([A-Za-z_][\w]*)\s*\(/g,p=400;for(let m of r.matchAll(f)){let y=m[1];if(re.has(y)||y.length<2)continue;let b=L(r,m.index);if(s.push({name:y,line:b}),s.length>=p)break}let g=/\.(?:get|post|put|patch|delete|options|head|all)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let m of e.matchAll(g)){let b=m[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:b,startLine:L(e,m.index),endLine:null,exported:!0})}let w=/@(?:app|router|api|bp)\.(?:get|post|put|patch|delete|options|head|api_route)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let m of e.matchAll(w)){let b=m[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:b,startLine:L(e,m.index),endLine:null,exported:!0})}if(/(?:^|\/)route\.(ts|js|tsx|jsx)$/.test(n.replace(/\\/g,"/"))){let m=/\bexport\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/g;for(let y of e.matchAll(m))t.push({kind:"route",name:`${y[1]} ${n.replace(/\\/g,"/")}`,startLine:L(e,y.index),endLine:null,exported:!0})}let u=z(s);return{filePath:n,symbols:t,callNames:u.callNames,calls:u.calls,importBindings:i,resolvedImports:new Map}}d(ae,"extractTsJs");function ce(e,n){let t=[],s=[],i=O(e),r=/^(?:async\s+)?def\s+(\w+)\s*\(/gm,a=/^class\s+(\w+)/gm;for(let l of i.matchAll(r))t.push({kind:"function",name:l[1],startLine:L(i,l.index),endLine:null,exported:!l[1].startsWith("_")});for(let l of i.matchAll(a))t.push({kind:"class",name:l[1],startLine:L(i,l.index),endLine:null,exported:!l[1].startsWith("_")});let o=/\b([A-Za-z_][\w]*)\s*\(/g;for(let l of i.matchAll(o)){let f=l[1];/^(if|for|while|return|print|len|range|str|int|list|dict|set|super|self)$/.test(f)||s.push({name:f,line:L(i,l.index)})}let c=z(s);return{filePath:n,symbols:t,callNames:c.callNames,calls:c.calls,importBindings:new Map,resolvedImports:new Map}}d(ce,"extractPython");function le(e,n){let t=[],s=O(e),i=/^func\s+(?:\([^)]+\)\s+)?(\w+)\s*\(/gm,r=/^type\s+(\w+)\s+(?:struct|interface)/gm;for(let a of s.matchAll(i)){let o=a[1];t.push({kind:"function",name:o,startLine:L(s,a.index),endLine:null,exported:o[0]===o[0].toUpperCase()})}for(let a of s.matchAll(r))t.push({kind:"type",name:a[1],startLine:L(s,a.index),endLine:null,exported:a[1][0]===a[1][0].toUpperCase()});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(le,"extractGo");function de(e,n){let t=[],s=O(e),i=/^(?:pub\s+)?(?:async\s+)?fn\s+(\w+)/gm,r=/^(?:pub\s+)?struct\s+(\w+)/gm,a=/^(?:pub\s+)?trait\s+(\w+)/gm,o=/^(?:pub\s+)?enum\s+(\w+)/gm;for(let[c,l]of[[i,"function"],[r,"class"],[a,"interface"],[o,"enum"]])for(let f of s.matchAll(c))t.push({kind:l,name:f[1],startLine:L(s,f.index),endLine:null,exported:/^pub\b/.test(f[0])});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(de,"extractRust");function me(e,n){let t=[],s=O(e),i=/(?:public\s+|private\s+|protected\s+)?(?:abstract\s+|final\s+)?class\s+(\w+)/g,r=/(?:public\s+)?interface\s+(\w+)/g,a=/(?:public|private|protected)\s+(?:static\s+)?(?:final\s+)?[\w.<>,[\]\s]+\s+(\w+)\s*\(/g;for(let o of s.matchAll(i))t.push({kind:"class",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});for(let o of s.matchAll(r))t.push({kind:"interface",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});for(let o of s.matchAll(a))/^(if|for|while|switch|catch|return|new)$/.test(o[1])||t.push({kind:"method",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(me,"extractJava");function ue(e,n){let t=E.extname(n).toLowerCase();return[".ts",".tsx",".js",".jsx",".mjs",".cjs"].includes(t)?ae(e,n):t===".py"?ce(e,n):t===".go"?le(e,n):t===".rs"?de(e,n):t===".java"?me(e,n):K(n)}d(ue,"extractFile");async function fe(e){let n=[];for(let t of["tsconfig.json","jsconfig.json"])try{let i=(await N.readFile(E.join(e,t),"utf-8")).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n]*/g,""),r=JSON.parse(i),a=r.compilerOptions?.paths,o=r.compilerOptions?.baseUrl??".";if(!a)continue;for(let[c,l]of Object.entries(a))n.push({pattern:c,targets:l.map(f=>E.posix.join(o.replace(/\\/g,"/"),f))});break}catch{}return n}d(fe,"loadTsPathMap");function ge(e,n){let t=[];for(let{pattern:s,targets:i}of n)if(s.endsWith("/*")){let r=s.slice(0,-1),a=s.slice(0,-2);if(e===a||e.startsWith(`${a}/`)){let o=e.slice(a.length).replace(/^\//,"");for(let c of i){let l=c.endsWith("/*")?c.slice(0,-1):c;t.push(E.posix.join(l.replace(/\*$/,""),o).replace(/\\/g,"/"))}}}else if(e===s)for(let r of i)t.push(r.replace(/\*$/,""));return t}d(ge,"applyTsPath");async function pe(e,n,t,s){let i=[];if(t.startsWith(".")){let r=E.dirname(E.join(e,n));i.push(E.resolve(r,t))}else if(t.startsWith("@/"))i.push(E.join(e,"src",t.slice(2))),i.push(E.join(e,t.slice(2)));else{for(let r of ge(t,s))i.push(E.join(e,r));i.push(E.join(e,"packages",t)),i.push(E.join(e,"src",t))}for(let r of i)for(let a of B){let o=r+a;try{if((await N.stat(o)).isFile())return E.relative(e,o).replace(/\\/g,"/")}catch{}}return null}d(pe,"resolveSpecifierToFile");async function ye(e,n,t){for(let[s,i]of n.importBindings){let r=await pe(e,n.filePath,i,t);r&&n.resolvedImports.set(s,r)}}d(ye,"resolveImportsForExtract");function U(e,n){let t=e.replace(/\\/g,"/"),s=n.replace(/\\/g,"/").replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"");return t===n||t.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"")===s||t===`${s}.ts`||t===`${s}.tsx`||t===`${s}.js`||t===`${s}.jsx`||t===`${s}/index.ts`||t===`${s}/index.tsx`||t===`${s}/index.js`}d(U,"matchFileToMod");function Y(e,n){return e.filter(s=>s.kind==="function"||s.kind==="method"||s.kind==="class").reduce((s,i)=>i.startLine<=n&&(!s||i.startLine>s.startLine)?i:s,null)}d(Y,"enclosingSymbol");function Z(e,n,t,s){let i=t.filter(o=>o.name===e);if(i.length===1)return{targets:i,confidence:.95};if(i.length>1){let o=i.filter(c=>c.exported);if(o.length===1)return{targets:o,confidence:.9}}let r=n.resolvedImports.get(e);if(r){let o=(s.get(e)??[]).filter(f=>U(f.file,r));if(o.length>0)return{targets:o,confidence:.9};let c=[...s.values()].flat().filter(f=>U(f.file,r)&&f.exported),l=c.find(f=>f.kind==="function"||f.kind==="class")??c[0];if(l)return{targets:[l],confidence:.65}}let a=s.get(e)??[];if(a.length===1)return{targets:a,confidence:.75};if(a.length>1){let o=a.filter(c=>c.exported);if(o.length===1)return{targets:o,confidence:.7}}return{targets:[],confidence:0}}d(Z,"resolveCallTargets");function J(e){let n=[],t=[],s=new Map,i=new Map;for(let o of e){let c=[];for(let l of o.symbols){let f=ie(o.filePath,l.kind,l.name,l.startLine),p={id:f,file:o.filePath,kind:l.kind,name:l.name,qname:H(o.filePath,l.name),startLine:l.startLine,endLine:l.endLine,exported:l.exported};n.push(p),c.push(p);let g=s.get(l.name)??[];g.push(p),s.set(l.name,g),t.push({src:`file:${o.filePath}`,dst:f,edgeType:"DEFINES",confidence:1})}i.set(o.filePath,c)}for(let o of e){let c=i.get(o.filePath)??[],l=new Set;for(let f of o.calls){if(c.some(m=>m.name===f.name&&m.startLine===f.line))continue;let{targets:p,confidence:g}=Z(f.name,o,c,s);if(p.length===0)continue;let u=Y(c,f.line)?.id??`file:${o.filePath}`;for(let m of p){if(m.id===u)continue;let y=`${u}|${m.id}`;l.has(y)||(l.add(y),t.push({src:u,dst:m.id,edgeType:"CALLS",confidence:g}))}}}let r=new Set,a=[];for(let o of t){let c=`${o.src}|${o.dst}|${o.edgeType}`;r.has(c)||(r.add(c),a.push(o))}return{symbols:n,edges:a,fileCount:e.length}}d(J,"buildFromExtracts");async function V(e,n){let s=(n??(await W(e)).filter(a=>I(a)&&!a.includes(".d.ts"))).filter(a=>I(a)&&!a.endsWith(".d.ts")),i=await fe(e),r=await $(s,40,async a=>{try{let o=await N.readFile(E.join(e,a),"utf-8"),c=o.length>4e5?o.slice(0,4e5):o;return ue(c,a)}catch{return K(a)}});return await $(r,40,async a=>(await ye(e,a,i),a)),r}d(V,"extractProject");function be(e,n){j(e,n);let t={symbolCount:n.symbols.length,edgeCount:n.edges.length,fileCount:n.fileCount,builtAt:new Date().toISOString()};S.setDoc(e,D,t)}d(be,"persistGraph");function he(e,n,t){let s=new Set([...n.map(c=>c.filePath),...t]);if(s.size===0)return Q(e);let i=xe(e).filter(c=>!s.has(c.file)),r=J(n);S.transaction(e,c=>{let l=c.prepare("DELETE FROM code_symbols WHERE file = ?");for(let u of s)c.prepare("DELETE FROM code_symbol_edges WHERE src LIKE ? OR dst LIKE ? OR src = ? OR dst = ?").run(`${u}#%`,`${u}#%`,`file:${u}`,`file:${u}`),l.run(u);let f=c.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
|
|
@@ -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{b as l,c as i,d as k}from"./chunk-
|
|
8
|
+
import{b as l,c as i,d as k}from"./chunk-XSJ7SPVR.mjs";import{b as d}from"./chunk-D7DQABWO.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function u(t,n){let r=t===i?i:t.slice(0,6);return{shortId:r,label:`${r} \xB7 ${n??"(detached)"}`}}o(u,"labelFor");async function b(t,n){let r=await k(n),a=[],p=await d.getTaskSnapshot(t),s=p.currentTask;if(s){let{shortId:e,label:c}=u(i,s.branch);a.push({id:s.id,description:s.description,workspaceId:i,shortId:e,label:c,branch:s.branch,linearId:s.linearId,harness:s.harness,startedAt:s.startedAt,isCurrent:r.workspaceId===i,pipeline:l(t,s.id,i)??void 0})}for(let e of p.activeTasks){if(e.workspaceId===i)continue;let{shortId:c,label:h}=u(e.workspaceId,e.branch);a.push({id:e.id,description:e.description,workspaceId:e.workspaceId,shortId:c,label:h,branch:e.branch,linearId:e.linearId,harness:e.harness,startedAt:e.startedAt,isCurrent:r.workspaceId===e.workspaceId,pipeline:l(t,e.id,e.workspaceId)??void 0})}return a.sort((e,c)=>Number(c.isCurrent)-Number(e.isCurrent)),{current:a.find(e=>e.isCurrent)??null,all:a,mainTaskRaw:s}}o(b,"collectActiveTasks");function T(t){let n=t.isCurrent?"\u2192":" ",r=t.isCurrent?" (this worktree)":"";return`${n} ${t.label} ${t.description}${r}`}o(T,"formatActiveTaskLine");function m(t){if(t.all.length===0)return"No active work cycle.";if(t.all.length===1&&t.current){let r=t.current,a=r.pipeline?`
|
|
9
9
|
Pipeline: ${r.pipeline.station}`:"";return`Active: ${r.description}
|
|
10
10
|
Workspace: ${r.label}${a}`}let n=[`Active work cycles (${t.all.length})`];for(let r of t.all)n.push(T(r));return n.join(`
|
|
11
11
|
`)}o(m,"formatActiveTaskList");export{b as a,T as b,m as c};
|
|
@@ -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-WUOVBBPC.mjs";import{c as u}from"./chunk-XS45K7ZQ.mjs";import{a as s,c}from"./chunk-4KVPAHFV.mjs";import{b as i}from"./chunk-ZZBNFNMG.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};
|