@a-company/paradigm 5.37.11 → 6.0.2
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/dist/{accept-orchestration-SBZVK3H4.js → accept-orchestration-QQISPINV.js} +1 -1
- package/dist/add-UOR4INIV.js +8 -0
- package/dist/{agent-loader-RIVI6QPP.js → agent-loader-2WJHD46U.js} +1 -1
- package/dist/{agent-loader-RJRVO5GQ.js → agent-loader-YKS2PQWO.js} +1 -1
- package/dist/{aggregate-W66DM3GA.js → aggregate-A5S5MTCC.js} +1 -1
- package/dist/{ambient-76YMUA5Q.js → ambient-BE3SQXNN.js} +1 -1
- package/dist/{ambient-WTLYUAQM.js → ambient-NVKQCW2A.js} +12 -12
- package/dist/{assess-UFPYEJKP.js → assess-63WXHWJV.js} +1 -1
- package/dist/{beacon-5QVYV5DF.js → beacon-QVUD3MGP.js} +1 -1
- package/dist/{calibration-OLJYB5HN.js → calibration-BDHGYJOK.js} +1 -1
- package/dist/{chunk-SI6SV76D.js → chunk-3DZK54RU.js} +72 -19
- package/dist/{chunk-CHVQNRRT.js → chunk-4PSD5R7N.js} +2 -2
- package/dist/chunk-6SKSV5B2.js +24 -0
- package/dist/{chunk-KFNHCQ4R.js → chunk-FEYOQMZ5.js} +1 -1
- package/dist/{chunk-NEJ4ZLCY.js → chunk-GAFKOFAV.js} +1 -1
- package/dist/chunk-GRZQIKST.js +2 -0
- package/dist/{chunk-RLCH7DXQ.js → chunk-K7X3Z3GL.js} +1 -1
- package/dist/chunk-LPBCQM5Y.js +6 -0
- package/dist/{chunk-T6IDXUUA.js → chunk-LWAIVOSF.js} +1 -1
- package/dist/{chunk-74SGKSRQ.js → chunk-M2HKWR25.js} +1 -1
- package/dist/{chunk-BOYQAMGC.js → chunk-M3PPXJU4.js} +1 -1
- package/dist/chunk-PHEX6LU4.js +111 -0
- package/dist/chunk-Q527BPUF.js +2 -0
- package/dist/chunk-R5ECMBIV.js +11 -0
- package/dist/{chunk-X3U3IGYT.js → chunk-TBWWFRL5.js} +1 -1
- package/dist/{chunk-MQIG6SMF.js → chunk-TNVWGPCE.js} +1 -1
- package/dist/{chunk-SUU6M4JH.js → chunk-TOYQ2QCB.js} +1 -1
- package/dist/chunk-TZDYIPVU.js +521 -0
- package/dist/{chunk-3XGNXXCT.js → chunk-UZ5H7K6Q.js} +1 -1
- package/dist/chunk-VIG5LSGZ.js +2 -0
- package/dist/chunk-VNIX5KBT.js +3 -0
- package/dist/{chunk-AGFPVSX5.js → chunk-VXIIVMTM.js} +1 -1
- package/dist/{chunk-ORDKEGII.js → chunk-WESTEMIM.js} +1 -1
- package/dist/{chunk-LBQBWIEX.js → chunk-Y4P4SGZV.js} +1 -1
- package/dist/{chunk-DOCDDDTD.js → chunk-YNDPSWOE.js} +5 -5
- package/dist/chunk-Z5QW6USC.js +2 -0
- package/dist/chunk-ZJQY5PPP.js +7 -0
- package/dist/{commands-LMUD5L6R.js → commands-ANRJNG2W.js} +1 -1
- package/dist/compliance-BNFWQPKM.js +6 -0
- package/dist/config-schema-FLHRVZMI.js +2 -0
- package/dist/{constellation-CG7C4WFE.js → constellation-NWLXYATA.js} +1 -1
- package/dist/{context-audit-XRPT3OU2.js → context-audit-JVCA6GSV.js} +1 -1
- package/dist/{cost-IDNVMAEV.js → cost-24UZSS2P.js} +1 -1
- package/dist/{cursorrules-U5O4G5T4.js → cursorrules-ZXPXPZ3P.js} +1 -1
- package/dist/decision-loader-HELL2AMX.js +2 -0
- package/dist/{delete-P5VULXR4.js → delete-2C6ALLYY.js} +1 -1
- package/dist/{diff-JVEYCXUC.js → diff-MF55KQZH.js} +1 -1
- package/dist/{dist-KGRCLBJP-2QAPFYNF.js → dist-GQ42YS5N-4HIJZVBB.js} +10 -10
- package/dist/dist-JZZJLVMR.js +2 -0
- package/dist/{dist-3ZCH25SG.js → dist-OG6MM4VY.js} +1 -1
- package/dist/dist-SE67SOXB.js +2 -0
- package/dist/{docs-USDAF26F.js → docs-O37YLLRN.js} +1 -1
- package/dist/doctor-IG5XM4C4.js +2 -0
- package/dist/{edit-GUU3HBVW.js → edit-P3MDAZLU.js} +1 -1
- package/dist/{flow-POQP27WA.js → flow-BGXOVE2V.js} +1 -1
- package/dist/{hooks-IG2GOAHP.js → hooks-TFMMMB2H.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/init-M44SO65G.js +2 -0
- package/dist/init-V4KSEKPK.js +2 -0
- package/dist/{integrity-UYDOOJDP.js → integrity-ROO3G43N.js} +1 -1
- package/dist/{list-YKIQNKGB.js → list-2XIWUEMA.js} +1 -1
- package/dist/list-CFHINXIS.js +12 -0
- package/dist/lore-loader-D2ISOASW.js +2 -0
- package/dist/lore-loader-PXFKMKAN.js +2 -0
- package/dist/mcp.js +19 -11
- package/dist/metrics-UESGUHTA.js +2 -0
- package/dist/{migrate-IBDE7VK4.js → migrate-Z5UQN57G.js} +1 -1
- package/dist/migrate-assessments-YSITX7KM.js +4 -0
- package/dist/migrate-decisions-NPLQOEEH.js +6 -0
- package/dist/migrate-plsat-EM2ACIQ3.js +6 -0
- package/dist/{nomination-engine-EALA5MGI.js → nomination-engine-QPZJH6XO.js} +1 -1
- package/dist/{notebook-loader-PXNRBBXD.js → notebook-loader-3J2OFMS3.js} +1 -1
- package/dist/{orchestrate-RCAMBOIB.js → orchestrate-RID7HHHH.js} +1 -1
- package/dist/{platform-server-DNAMH4YI.js → platform-server-UD45NTGV.js} +1 -1
- package/dist/portal-check-DV2VSJ5E.js +8 -0
- package/dist/{portal-compliance-4MG5F2GI.js → portal-compliance-JONQ4SOP.js} +1 -1
- package/dist/{probe-B22G2JKF.js → probe-5HAXULAD.js} +1 -1
- package/dist/{providers-AWA7WLLM.js → providers-4PXMWA7V.js} +1 -1
- package/dist/quiz-WYIZJG5K.js +10 -0
- package/dist/{record-YXPB34MY.js → record-N3VNYYKJ.js} +1 -1
- package/dist/reindex-FWPD2VGM.js +2 -0
- package/dist/{retag-N5XF3KXP.js → retag-72R2OSZV.js} +1 -1
- package/dist/{review-77QI6VOC.js → review-2INNWLTW.js} +1 -1
- package/dist/{review-6UAH6V3R.js → review-VMSX2PKI.js} +1 -1
- package/dist/{ripple-ZGDITCGB.js → ripple-FNZI47SH.js} +1 -1
- package/dist/{sentinel-HYAZ3CO5.js → sentinel-EFPEX246.js} +1 -1
- package/dist/{sentinel-bridge-VR357PKL.js → sentinel-bridge-UR2MKARY.js} +1 -1
- package/dist/sentinel.js +1 -1
- package/dist/{serve-U47GULB6.js → serve-MO35XIZE.js} +1 -1
- package/dist/serve-OQYUO7CR.js +12 -0
- package/dist/{server-4YNUIK4W.js → server-4D77LCST.js} +1 -1
- package/dist/server-FGUL2FWQ.js +7 -0
- package/dist/session-tracker-KGORN6B5.js +2 -0
- package/dist/{session-work-log-PAKXOFGL.js → session-work-log-4IEVE4KK.js} +1 -1
- package/dist/{session-work-log-ZP45TREI.js → session-work-log-EE4UIZ33.js} +1 -1
- package/dist/{setup-3F5IK7MO.js → setup-ZSEC72BS.js} +2 -2
- package/dist/{shift-FDADESC4.js → shift-TVNY2CQF.js} +6 -6
- package/dist/{show-PJ5LFLIL.js → show-JH7LJ5MT.js} +1 -1
- package/dist/show-WVHAL4VU.js +7 -0
- package/dist/{snapshot-L2G56RPL.js → snapshot-3IYB67D4.js} +1 -1
- package/dist/{spawn-M5BAV252.js → spawn-UH5RENSE.js} +1 -1
- package/dist/{status-77M3SDIF.js → status-DB3KNLW3.js} +1 -1
- package/dist/status-S7Z5FVIE.js +6 -0
- package/dist/{summary-LXLHFRN7.js → summary-WLI3NF4G.js} +2 -2
- package/dist/{sweep-HU74OPVW.js → sweep-7TZFN5NS.js} +1 -1
- package/dist/sync-55U6QPIA.js +2 -0
- package/dist/{sync-llms-7CAI74QL.js → sync-llms-GF7DDQDI.js} +1 -1
- package/dist/team-MGT66HZQ.js +2 -0
- package/dist/{test-BQJMS4Y2.js → test-WLEPZQFC.js} +1 -1
- package/dist/{timeline-K3ZFKJ3R.js → timeline-RK7O2SCM.js} +1 -1
- package/dist/tools-QJHAVYI6.js +2 -0
- package/dist/university-content/notes/N-para-001-build-something.md +126 -0
- package/dist/university-content/notes/N-para-001-meet-the-team.md +85 -0
- package/dist/university-content/notes/N-para-001-shift-setup.md +74 -0
- package/dist/university-content/notes/N-para-101-component-types.md +99 -0
- package/dist/university-content/notes/N-para-101-first-steps.md +134 -0
- package/dist/university-content/notes/N-para-101-five-symbols.md +128 -0
- package/dist/university-content/notes/N-para-101-paradigm-logger.md +89 -0
- package/dist/university-content/notes/N-para-101-portal-yaml.md +112 -0
- package/dist/university-content/notes/N-para-101-project-structure.md +143 -0
- package/dist/university-content/notes/N-para-101-purpose-files.md +121 -0
- package/dist/university-content/notes/N-para-101-tags-and-classification.md +93 -0
- package/dist/university-content/notes/N-para-101-welcome.md +51 -0
- package/dist/university-content/notes/N-para-201-architecture-review.md +175 -0
- package/dist/university-content/notes/N-para-201-aspect-graph.md +79 -0
- package/dist/university-content/notes/N-para-201-aspects-and-anchors.md +112 -0
- package/dist/university-content/notes/N-para-201-component-patterns.md +138 -0
- package/dist/university-content/notes/N-para-201-cross-cutting-concerns.md +145 -0
- package/dist/university-content/notes/N-para-201-disciplines.md +187 -0
- package/dist/university-content/notes/N-para-201-flows-deep-dive.md +119 -0
- package/dist/university-content/notes/N-para-201-gates-deep-dive.md +165 -0
- package/dist/university-content/notes/N-para-201-portal-protocol.md +133 -0
- package/dist/university-content/notes/N-para-201-signal-patterns.md +159 -0
- package/dist/university-content/notes/N-para-201-symbol-naming.md +149 -0
- package/dist/university-content/notes/N-para-301-context-management.md +53 -0
- package/dist/university-content/notes/N-para-301-decisions.md +99 -0
- package/dist/university-content/notes/N-para-301-doctor-and-validation.md +70 -0
- package/dist/university-content/notes/N-para-301-enforcement-levels.md +102 -0
- package/dist/university-content/notes/N-para-301-fragility-tracking.md +50 -0
- package/dist/university-content/notes/N-para-301-history-system.md +42 -0
- package/dist/university-content/notes/N-para-301-navigation-system.md +55 -0
- package/dist/university-content/notes/N-para-301-operations-review.md +55 -0
- package/dist/university-content/notes/N-para-301-paradigm-shift.md +93 -0
- package/dist/university-content/notes/N-para-301-protocols.md +113 -0
- package/dist/university-content/notes/N-para-301-ripple-analysis.md +53 -0
- package/dist/university-content/notes/N-para-301-sentinel-observability.md +87 -0
- package/dist/university-content/notes/N-para-301-sync-and-maintenance.md +57 -0
- package/dist/university-content/notes/N-para-301-wisdom-system.md +89 -0
- package/dist/university-content/notes/N-para-401-agent-identity.md +99 -0
- package/dist/university-content/notes/N-para-401-agent-interop.md +87 -0
- package/dist/university-content/notes/N-para-401-agent-roles.md +107 -0
- package/dist/university-content/notes/N-para-401-commit-conventions.md +82 -0
- package/dist/university-content/notes/N-para-401-mastery-review.md +71 -0
- package/dist/university-content/notes/N-para-401-mcp-tools-overview.md +102 -0
- package/dist/university-content/notes/N-para-401-multi-agent-coordination.md +80 -0
- package/dist/university-content/notes/N-para-401-notebooks-permissions.md +66 -0
- package/dist/university-content/notes/N-para-401-orchestration-workflow.md +101 -0
- package/dist/university-content/notes/N-para-401-pm-governance.md +71 -0
- package/dist/university-content/notes/N-para-401-provider-cascade.md +75 -0
- package/dist/university-content/notes/N-para-401-quick-check.md +95 -0
- package/dist/university-content/notes/N-para-501-advanced-workflows.md +122 -0
- package/dist/university-content/notes/N-para-501-aspect-graph-advanced.md +195 -0
- package/dist/university-content/notes/N-para-501-aspect-graph-internals.md +97 -0
- package/dist/university-content/notes/N-para-501-assessment-loops.md +116 -0
- package/dist/university-content/notes/N-para-501-conductor-workspace.md +77 -0
- package/dist/university-content/notes/N-para-501-habits-practice.md +164 -0
- package/dist/university-content/notes/N-para-501-hook-enforcement.md +100 -0
- package/dist/university-content/notes/N-para-501-lore-system.md +155 -0
- package/dist/university-content/notes/N-para-501-platform-agent-ui.md +108 -0
- package/dist/university-content/notes/N-para-501-review-compliance.md +72 -0
- package/dist/university-content/notes/N-para-501-sentinel-deep-dive.md +173 -0
- package/dist/university-content/notes/N-para-501-session-intelligence.md +104 -0
- package/dist/university-content/notes/N-para-501-symphony-a-mail.md +120 -0
- package/dist/university-content/notes/N-para-501-symphony-networking.md +119 -0
- package/dist/university-content/notes/N-para-501-task-management.md +100 -0
- package/dist/university-content/notes/N-para-601-agent-renaissance.md +121 -0
- package/dist/university-content/notes/N-para-601-attention-scoring.md +129 -0
- package/dist/university-content/notes/N-para-601-context-composition.md +146 -0
- package/dist/university-content/notes/N-para-601-data-sovereignty.md +140 -0
- package/dist/university-content/notes/N-para-601-event-stream.md +126 -0
- package/dist/university-content/notes/N-para-601-knowledge-streams.md +144 -0
- package/dist/university-content/notes/N-para-601-learning-loop.md +68 -0
- package/dist/university-content/notes/N-para-601-maestro-team-collab.md +136 -0
- package/dist/university-content/notes/N-para-601-nominations-debates.md +115 -0
- package/dist/university-content/notes/N-para-701-agent-notebooks.md +131 -0
- package/dist/university-content/notes/N-para-701-agent-pods-nevrland.md +182 -0
- package/dist/university-content/notes/N-para-701-agent-profiles.md +197 -0
- package/dist/university-content/notes/N-para-701-agent-roster.md +82 -0
- package/dist/university-content/notes/N-para-701-agent-state.md +180 -0
- package/dist/university-content/notes/N-para-701-learning-feedback-loop.md +188 -0
- package/dist/university-content/notes/N-para-701-model-tier-resolution.md +204 -0
- package/dist/university-content/notes/N-para-701-orchestration-enforcement.md +169 -0
- package/dist/university-content/notes/N-para-701-per-project-rosters.md +198 -0
- package/dist/university-content/notes/N-para-701-symphony-visibility.md +142 -0
- package/dist/university-content/paths/LP-para-001.yaml +29 -0
- package/dist/university-content/paths/LP-para-101.yaml +59 -0
- package/dist/university-content/paths/LP-para-201.yaml +69 -0
- package/dist/university-content/paths/LP-para-301.yaml +84 -0
- package/dist/university-content/paths/LP-para-401.yaml +74 -0
- package/dist/university-content/paths/LP-para-501.yaml +89 -0
- package/dist/university-content/paths/LP-para-601.yaml +59 -0
- package/dist/university-content/paths/LP-para-701.yaml +64 -0
- package/dist/university-content/quizzes/Q-para-001-build-something.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-001-meet-the-team.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-001-shift-setup.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-101-component-types.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-101-first-steps.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-five-symbols.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-101-paradigm-logger.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-portal-yaml.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-project-structure.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-101-purpose-files.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-tags-and-classification.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-welcome.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-architecture-review.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-aspect-graph.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-201-aspects-and-anchors.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-component-patterns.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-cross-cutting-concerns.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-disciplines.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-flows-deep-dive.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-gates-deep-dive.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-portal-protocol.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-signal-patterns.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-symbol-naming.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-301-context-management.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-decisions.yaml +76 -0
- package/dist/university-content/quizzes/Q-para-301-doctor-and-validation.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-301-enforcement-levels.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-fragility-tracking.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-history-system.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-navigation-system.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-operations-review.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-301-paradigm-shift.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-protocols.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-ripple-analysis.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-sentinel-observability.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-sync-and-maintenance.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-wisdom-system.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-agent-identity.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-agent-interop.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-401-agent-roles.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-commit-conventions.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-mastery-review.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-mcp-tools-overview.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-multi-agent-coordination.yaml +76 -0
- package/dist/university-content/quizzes/Q-para-401-notebooks-permissions.yaml +61 -0
- package/dist/university-content/quizzes/Q-para-401-orchestration-workflow.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-pm-governance.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-provider-cascade.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-quick-check.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-501-advanced-workflows.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-aspect-graph-advanced.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-aspect-graph-internals.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-assessment-loops.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-501-conductor-workspace.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-501-habits-practice.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-501-hook-enforcement.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-lore-system.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-platform-agent-ui.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-review-compliance.yaml +61 -0
- package/dist/university-content/quizzes/Q-para-501-sentinel-deep-dive.yaml +86 -0
- package/dist/university-content/quizzes/Q-para-501-session-intelligence.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-symphony-a-mail.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-symphony-networking.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-task-management.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-601-agent-renaissance.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-attention-scoring.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-601-context-composition.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-data-sovereignty.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-601-event-stream.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-knowledge-streams.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-learning-loop.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-601-maestro-team-collab.yaml +86 -0
- package/dist/university-content/quizzes/Q-para-601-nominations-debates.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-notebooks.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-pods-nevrland.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-profiles.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-roster.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-state.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-learning-feedback-loop.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-model-tier-resolution.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-orchestration-enforcement.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-per-project-rosters.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-symphony-visibility.yaml +66 -0
- package/dist/university-content/quizzes/Q-plsat-v2.yaml +904 -0
- package/dist/university-content/quizzes/Q-plsat-v3.yaml +2909 -0
- package/dist/university-content/reference.json +2 -2
- package/dist/university-ui/assets/{index-CecQrfSn.js → index-nNgzO1il.js} +2 -2
- package/dist/university-ui/assets/{index-CecQrfSn.js.map → index-nNgzO1il.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/{upgrade-GX56QE3C.js → upgrade-NKN63VTY.js} +2 -2
- package/dist/{validate-VZXTJHGO.js → validate-BB6LRWIY.js} +1 -1
- package/dist/validate-XUQZTF3H.js +9 -0
- package/dist/{watch-YCODNIET.js → watch-25GJHQYT.js} +1 -1
- package/dist/workspace-VMSPYIBV.js +2 -0
- package/lore-ui/dist/assets/{index-Bk-K0qgN.js → index-DKhNxgtW.js} +10 -10
- package/lore-ui/dist/index.html +1 -1
- package/package.json +3 -2
- package/platform-ui/dist/assets/{AmbientSection-BYjt75R1.js → AmbientSection-CwatqcBD.js} +1 -1
- package/platform-ui/dist/assets/{CanvasSection-rKvA_vZj.js → CanvasSection-dFAthehN.js} +1 -1
- package/platform-ui/dist/assets/{DocsSection-CI9K73M-.js → DocsSection-BZ2SFJBZ.js} +1 -1
- package/platform-ui/dist/assets/{GitSection-DSGj_c6S.js → GitSection-MNNYU1tO.js} +1 -1
- package/platform-ui/dist/assets/{GraphSection-CawN7pC5.js → GraphSection-COYjb4Pt.js} +1 -1
- package/platform-ui/dist/assets/LoreSection-B0hUbfsJ.js +1 -0
- package/platform-ui/dist/assets/{SentinelSection-DNgoYMH0.js → SentinelSection-BCxW1DCp.js} +1 -1
- package/platform-ui/dist/assets/{SymphonySection-C0zfcqv3.js → SymphonySection-BsucZRqy.js} +1 -1
- package/platform-ui/dist/assets/{TeamSection-Bzd3Dt9Q.js → TeamSection-C0QNTudW.js} +1 -1
- package/platform-ui/dist/assets/{UniversitySection-tBr62R0S.js → UniversitySection-DN1-g9pw.js} +1 -1
- package/platform-ui/dist/assets/{index-BaOmyn11.js → index-DwUT8pju.js} +2 -2
- package/platform-ui/dist/index.html +1 -1
- package/templates/paradigm/specs/symbols.md +4 -2
- package/dist/add-P76GEMGF.js +0 -8
- package/dist/chunk-3TR6LLXP.js +0 -111
- package/dist/chunk-G7XFK2GI.js +0 -11
- package/dist/chunk-J6KWGCHN.js +0 -24
- package/dist/chunk-JQKKVAAN.js +0 -2
- package/dist/chunk-ODVKPZZ4.js +0 -2
- package/dist/chunk-Q2J542ST.js +0 -2
- package/dist/chunk-QT2LKB3P.js +0 -7
- package/dist/chunk-SHD27BQX.js +0 -6
- package/dist/chunk-WS2N27RX.js +0 -3
- package/dist/chunk-YT52WLBF.js +0 -521
- package/dist/compliance-WJINB5DM.js +0 -6
- package/dist/config-schema-GUQY2QN7.js +0 -2
- package/dist/decision-loader-2XPZE4EZ.js +0 -2
- package/dist/dist-R3RWD35F.js +0 -2
- package/dist/dist-VXCZWVVJ.js +0 -2
- package/dist/doctor-QJ47XAUP.js +0 -2
- package/dist/init-HIBRSVUB.js +0 -2
- package/dist/list-5IUGP3ZB.js +0 -7
- package/dist/lore-loader-RVQI5GXL.js +0 -2
- package/dist/lore-loader-XY5MZRR2.js +0 -2
- package/dist/migrate-assessments-GEI5WMI2.js +0 -4
- package/dist/portal-check-Z3OCQEQR.js +0 -8
- package/dist/quiz-FE5UGAY2.js +0 -10
- package/dist/reindex-FO5VMZVQ.js +0 -2
- package/dist/serve-OY6XYL7F.js +0 -12
- package/dist/server-2MNROHF6.js +0 -7
- package/dist/session-tracker-MWJAJA6Z.js +0 -2
- package/dist/show-BOAVWZPZ.js +0 -7
- package/dist/status-A37ECYNJ.js +0 -6
- package/dist/sync-DLUBV5HQ.js +0 -2
- package/dist/team-NSP6PMPS.js +0 -2
- package/dist/tools-CERDNVCG.js +0 -2
- package/dist/university-content/courses/.purpose +0 -492
- package/dist/university-content/courses/para-001.json +0 -166
- package/dist/university-content/courses/para-101.json +0 -615
- package/dist/university-content/courses/para-201.json +0 -794
- package/dist/university-content/courses/para-301.json +0 -830
- package/dist/university-content/courses/para-401.json +0 -868
- package/dist/university-content/courses/para-501.json +0 -1166
- package/dist/university-content/courses/para-601.json +0 -719
- package/dist/university-content/courses/para-701.json +0 -807
- package/dist/university-content/plsat/.purpose +0 -162
- package/dist/university-content/plsat/v2.0.json +0 -760
- package/dist/university-content/plsat/v3.0.json +0 -3453
- package/dist/validate-C6SMKGYD.js +0 -9
- package/dist/workspace-MKSQN7B2.js +0 -2
- package/platform-ui/dist/assets/LoreSection-oO5dCe6O.js +0 -1
- /package/dist/{chunk-BV5PRPLB.js → chunk-IZSBGW6E.js} +0 -0
- /package/templates/paradigm/specs/{scan.md → probe.md} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {d,f,b,a as a$1,g,c,e as e$1,h}from'./chunk-
|
|
2
|
+
import {d,f,b,a as a$1,g,c,e as e$1,h}from'./chunk-YNDPSWOE.js';import {a}from'./chunk-LKAT7IAK.js';import*as S from'path';import e from'chalk';import M from'ora';async function q(b$1,a$2){let i=process.cwd(),r=M(),x=a$2.target||b$1,o=a$2.quiet;o||console.log(e.blue(`
|
|
3
3
|
\u{1F504} Paradigm Sync
|
|
4
4
|
`)),o||r.start("Loading .paradigm/ configuration...");let f$1=d(i);if(!f$1)throw o||(r.fail("No .paradigm/ directory found"),console.log(e.gray("\nRun `paradigm init` to initialize Paradigm in this project.\n"))),a.command("sync").error("Missing .paradigm/ directory"),o||process.exit(1),new Error("No .paradigm/ directory found");if(o||r.succeed(`Loaded configuration for ${e.cyan(f$1.projectName)}`),a.command("sync").debug("Configuration loaded",{projectName:f$1.projectName}),a$2.all){console.log(e.gray(`
|
|
5
5
|
Syncing to all IDEs...
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import*as t from'js-yaml';var n={"#":{name:"Component",description:"Any documented code unit",owner:"purpose",examples:["#Button","#api-client","#AuthProvider"]},$:{name:"Flow",description:"Multi-step processes or user journeys",owner:"shared",examples:["$checkout-flow","$auth-flow"]},"^":{name:"Gate",description:"Authorization checkpoints",owner:"portal",examples:["^authenticated","^admin-only","^resource-owner"]},"!":{name:"Signal",description:"Events for side effects",owner:"portal",examples:["!payment-completed","!login-failed","!rate-limited"]},"~":{name:"Aspect",description:"Rules with required code anchors",owner:"purpose",examples:["~audit-required","~rate-limited","~cache-invalidation"]}},i=["Use kebab-case for all symbol IDs (feature-name, not featureName)","Document flows when logic spans 3+ components","Reference related items using symbol prefixes (@ # $ % ~ ^ ! ?)","Add descriptions to all features and gates","Update .purpose files when changing feature behavior","Keep gates minimal - one responsibility per gate","Use signals for side effects, not direct state mutations"];function o(e){return {version:"1.0",project:e,"agent-guidelines":{overview:`${e} uses Paradigm for structured planning and context management.`,"how-to-use":["Check .purpose files in directories for context before making changes","Run `paradigm status` to see the project symbol index","Run `paradigm visualize` to explore the Dreamscape","Reference symbols using prefixes: @feature #component ^gate",'Attach an image and say "paradigm scan" to map UI to code'],"update-rules":["When adding a feature, create/update the nearest .purpose file","When adding authorization, update portal.yaml","When exploring ideas, add to .premise or use ?symbol prefix","Always update references when renaming symbols"]},"symbol-system":n,states:{user:{authenticated:{type:"boolean",default:false,description:"User is logged in"},role:{type:"enum",values:["guest","user","admin"],description:"User access level"}},app:{loading:{type:"boolean",default:false,description:"App is loading"}}},"purpose-required":[{pattern:"src/features/*",depth:1},{pattern:"src/components/*",depth:1}],conventions:i}}function r(e){return t.dump(e,{lineWidth:-1,quotingType:'"'})}function a(e){return t.load(e)}export{n as a,i as b,o as c,r as d,a as e};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {a}from'./chunk-5TAVYPOV.js';import {execSync}from'child_process';import*as W from'os';import*as o from'fs';import*as d from'path';import*as f from'js-yaml';function R(s){let e=s.toLowerCase();return e.includes("claude")||e.includes("anthropic")?"anthropic":e.includes("gpt")||e.includes("openai")||e.includes("o1")||e.includes("o3")?"openai":e.includes("gemini")||e.includes("google")||e.includes("palm")?"google":e.includes("llama")||e.includes("meta")?"meta":e.includes("mistral")||e.includes("mixtral")?"mistral":e.includes("deepseek")?"deepseek":e.includes("cohere")||e.includes("command")?"cohere":"unknown"}function v(s){let e=s,t=e.author;if(e.type||(e.type="agent-session"),typeof t=="string")return s;if(t&&typeof t=="object"&&!Array.isArray(t)){let n=t;n.type==="agent"?(e.author="unknown",e.agent={provider:n.model?R(n.model):R(n.id),model:n.model||n.id}):e.author=n.id||"unknown",delete e.assistedBy;}return e}function w(s){return s.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,20)||"unknown"}function P(){let s=process.env.PARADIGM_AUTHOR;if(s)return w(s);try{let e=execSync("git config user.name",{encoding:"utf-8",timeout:3e3}).trim();if(e)return w(e)}catch{}try{let e=W.userInfo().username;if(e)return w(e)}catch{}return "unknown"}function $(s,e){let t=s;if(e.author&&(t=t.filter(n=>n.author===e.author)),e.hasAgent!==void 0?t=t.filter(n=>e.hasAgent?n.agent!=null:n.agent==null):e.authorType&&(t=t.filter(n=>e.authorType==="agent"?n.agent!=null:n.agent==null)),e.symbol&&(t=t.filter(n=>n.symbols_touched?.includes(e.symbol)||n.symbols_created?.includes(e.symbol))),e.dateFrom){let n=new Date(e.dateFrom).getTime();t=t.filter(i=>new Date(i.timestamp).getTime()>=n);}if(e.dateTo){let n=new Date(e.dateTo).getTime();t=t.filter(i=>new Date(i.timestamp).getTime()<=n);}if(e.type&&(t=t.filter(n=>n.type===e.type)),e.tag){let n=e.tag;t=t.filter(i=>i.tags?.some(r=>r===n||r.startsWith(n+":")||n.includes(":")&&r===n));}return e.tags&&e.tags.length>0&&(t=t.filter(n=>e.tags.some(i=>n.tags?.includes(i)))),e.hasBody!==void 0&&(t=t.filter(n=>e.hasBody?n.body!=null&&n.body.length>0:!n.body||n.body.length===0)),e.hasReview!==void 0&&(t=t.filter(n=>e.hasReview?n.review!=null:n.review==null)),e.hasConfidence!==void 0&&(t=t.filter(n=>e.hasConfidence?n.confidence!=null:n.confidence==null)),e.hasAssessment!==void 0&&(t=t.filter(n=>e.hasAssessment?n.assessment!=null:n.assessment==null)),e.minCompleteness!==void 0&&(t=t.filter(n=>n.review!=null&&n.review.completeness>=e.minCompleteness)),t.sort((n,i)=>new Date(i.timestamp).getTime()-new Date(n.timestamp).getTime()),e.offset&&(t=t.slice(e.offset)),e.limit&&(t=t.slice(0,e.limit)),t}var L=".paradigm/lore",_="entries",D="timeline.yaml";function x(s){return s.endsWith(".yaml")||s.endsWith(".lore")}function E(s,e,t){let n=d.join(s,L,_,e),i=d.join(n,`${t}.lore`);if(o.existsSync(i))return i;let r=d.join(n,`${t}.yaml`);return o.existsSync(r)?r:null}function O(s){try{let e=execSync("git rev-parse HEAD",{cwd:s,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),t=execSync("git rev-parse --abbrev-ref HEAD",{cwd:s,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),n=execSync("git status --porcelain",{cwd:s,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return {ref:e,branch:t,dirty:n.length>0}}catch{return}}function N(s,e){let t={unregistered:[],warnings:[]};if(e.length===0)return t;let n=new Set;try{let c=a("child_process").execSync(`find "${s}" -name ".purpose" -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null || true`,{encoding:"utf-8"});for(let l of c.split(`
|
|
3
|
+
`).filter(Boolean))try{let m=o.readFileSync(l,"utf8").matchAll(/^([#$^!~][\w-]+):/gm);for(let u of m)n.add(u[1]);}catch{}}catch{return t}let i=d.join(s,".paradigm","flows.yaml");if(o.existsSync(i))try{let l=o.readFileSync(i,"utf8").matchAll(/([#$^!~][\w-]+)/g);for(let a of l)n.add(a[1]);}catch{}let r=d.join(s,"portal.yaml");if(o.existsSync(r))try{let l=o.readFileSync(r,"utf8").matchAll(/\^([\w-]+)/g);for(let a of l)n.add(`^${a[1]}`);}catch{}for(let c of e)n.has(c)||(t.unregistered.push(c),t.warnings.push(`Symbol "${c}" not found in .purpose files or project index`));return t}async function H(s,e,t){if(e.type==="decision")throw new Error("lore type 'decision' was removed in v6.0. Use `paradigm decision record` (CLI) or `paradigm_decision_record` (MCP) instead. The decision will be stored in .paradigm/decisions/ and a companion lore insight entry will be written automatically.");let n;if(t?.validateSymbols){let a=[...e.symbols_touched||[],...e.symbols_created||[]];n=N(s,a);}let i=d.join(s,L),r=e.timestamp.slice(0,10),c=d.join(i,_,r);o.existsSync(c)||o.mkdirSync(c,{recursive:true}),e.author||(e.author=P()),e.git_context||(e.git_context=O(s)),e.id||(e.id=B(s,r,e.author,e.timestamp));let l=d.join(c,`${e.id}.lore`);return o.writeFileSync(l,f.dump(e,{lineWidth:-1,noRefs:true})),await j(s),{validation:n}}async function A(s,e){let t=d.join(s,L,_);if(!o.existsSync(t))return [];z(s);let n=[],i=o.readdirSync(t).filter(r=>/^\d{4}-\d{2}-\d{2}$/.test(r)).sort().reverse();for(let r of i){if(e?.dateFrom&&r<e.dateFrom.slice(0,10)||e?.dateTo&&r>e.dateTo.slice(0,10))continue;let c=d.join(t,r),l=o.readdirSync(c).filter(x).sort();for(let a of l)try{let m=o.readFileSync(d.join(c,a),"utf8"),u=f.load(m);n.push(v(u));}catch{}}return e?$(n,e):n}async function j(s){let e=d.join(s,L),t=d.join(e,_);if(!o.existsSync(t))return;z(s);let n=new Set,i=0,r="",c=o.readdirSync(t).filter(u=>/^\d{4}-\d{2}-\d{2}$/.test(u));for(let u of c){let g=d.join(t,u),h=o.readdirSync(g).filter(x);for(let S of h)try{let y=o.readFileSync(d.join(g,S),"utf8"),p=f.load(y),b=v(p);n.add(b.author),i++,(!r||b.timestamp>r)&&(r=b.timestamp);}catch{}}let l="unknown",a=d.join(s,".paradigm","config.yaml");if(o.existsSync(a))try{let u=f.load(o.readFileSync(a,"utf8"));l=u.project||u.name||"unknown";}catch{}let m={version:"1.0",project:l,entries:i,last_updated:r||new Date().toISOString(),authors:Array.from(n)};o.existsSync(e)||o.mkdirSync(e,{recursive:true}),o.writeFileSync(d.join(e,D),f.dump(m,{lineWidth:-1,noRefs:true}));}async function G(s,e,t){let i=(await A(s)).find(l=>l.id===e);if(!i)return false;let r=i.timestamp.slice(0,10),c=E(s,r,e);return c?(i.review=t,o.writeFileSync(c,f.dump(i,{lineWidth:-1,noRefs:true})),true):false}function q(s){switch(s){case "correct":return 1;case "partial":return .5;case "incorrect":return 0}}async function K(s,e,t){let i=(await A(s)).find(l=>l.id===e);if(!i)return false;let r=i.timestamp.slice(0,10),c=E(s,r,e);return c?(i.assessment=t,i.confidence!=null&&(i.assessment_delta=q(t.verdict)-i.confidence),o.writeFileSync(c,f.dump(i,{lineWidth:-1,noRefs:true})),true):false}async function C(s,e){let t=e.match(/^L-(\d{4}-\d{2}-\d{2})-/);if(t){let i=t[1],r=E(s,i,e);if(r)try{let c=o.readFileSync(r,"utf8"),l=f.load(c);return v(l)}catch{return null}}return (await A(s)).find(i=>i.id===e)||null}async function Z(s,e,t){let n=await C(s,e);if(!n)return false;let i=n.timestamp.slice(0,10),r=E(s,i,e);return r?(t.title!==void 0&&(n.title=t.title),t.summary!==void 0&&(n.summary=t.summary),t.type!==void 0&&(n.type=t.type),t.duration_minutes!==void 0&&(n.duration_minutes=t.duration_minutes),t.symbols_touched!==void 0&&(n.symbols_touched=t.symbols_touched),t.symbols_created!==void 0&&(n.symbols_created=t.symbols_created),t.files_created!==void 0&&(n.files_created=t.files_created),t.files_modified!==void 0&&(n.files_modified=t.files_modified),t.lines_added!==void 0&&(n.lines_added=t.lines_added),t.lines_removed!==void 0&&(n.lines_removed=t.lines_removed),t.commit!==void 0&&(n.commit=t.commit),t.decisions!==void 0&&(n.decisions=t.decisions),t.errors_encountered!==void 0&&(n.errors_encountered=t.errors_encountered),t.learnings!==void 0&&(n.learnings=t.learnings),t.verification!==void 0&&(n.verification=t.verification),t.tags!==void 0&&(n.tags=t.tags),t.body!==void 0&&(n.body=t.body),t.linked_lore!==void 0&&(n.linked_lore=t.linked_lore),t.linked_tasks!==void 0&&(n.linked_tasks=t.linked_tasks),t.linked_commits!==void 0&&(n.linked_commits=t.linked_commits),t.confidence!==void 0&&(n.confidence=t.confidence),t.assessment!==void 0&&(n.assessment=t.assessment),t.assessment_delta!==void 0&&(n.assessment_delta=t.assessment_delta),o.writeFileSync(r,f.dump(n,{lineWidth:-1,noRefs:true})),await j(s),true):false}async function J(s,e){let t=await C(s,e);if(!t)return false;let n=t.timestamp.slice(0,10),i=E(s,n,e);if(!i)return false;o.unlinkSync(i);let r=d.dirname(i);return o.readdirSync(r).filter(x).length===0&&o.rmdirSync(r),await j(s),true}function z(s){let e=d.join(s,L,_);if(!o.existsSync(e))return 0;let t=o.readdirSync(e).filter(i=>x(i)&&!i.startsWith(".")),n=0;for(let i of t){let r=d.join(e,i);if(o.statSync(r).isFile())try{let l=o.readFileSync(r,"utf8"),a=f.load(l);if(a.author&&typeof a.author=="object"||typeof a.author=="string"&&a.timestamp)continue;let m=typeof a.date=="string"?a.date.slice(0,10):new Date().toISOString().slice(0,10),u=d.join(e,m);o.existsSync(u)||o.mkdirSync(u,{recursive:!0});let g=P(),h=`${m}T00:00:00.000Z`,S=B(s,m,g,h),y=String(a.type||"agent-session"),p=y==="decision",b=p?"insight":["agent-session","human-note","review","incident","milestone","insight"].includes(y)?y:"agent-session",T;if(a.test_results&&typeof a.test_results=="object"){let k=a.test_results;T={status:k.total===k.passed?"pass":"partial",details:{tests:k.total===k.passed?"pass":"fail"}};}let M=["migrated",y];p&&M.push("v6-migrated:from-decision");let I={id:S,type:b,timestamp:h,author:"unknown",agent:{provider:"unknown",model:"unknown"},title:String(a.title||i.replace(/\.(yaml|lore)$/,"")),summary:String(a.summary||""),symbols_touched:Array.isArray(a.symbols_touched)?a.symbols_touched:[],files_modified:Array.isArray(a.files_modified)?a.files_modified:void 0,...T?{verification:T}:{},tags:M};o.writeFileSync(d.join(u,`${S}.lore`),f.dump(I,{lineWidth:-1,noRefs:!0})),o.unlinkSync(r),n++;}catch{}}return n}function B(s,e,t,n){let i=w(t),r=new Date(n),c=String(r.getUTCHours()).padStart(2,"0"),l=String(r.getUTCMinutes()).padStart(2,"0"),a=String(r.getUTCSeconds()).padStart(2,"0"),m=`${c}${l}${a}`,u=`L-${e}-${i}-${m}`,g=d.join(s,L,_,e);if(!o.existsSync(g))return `${u}-001`;let h=o.readdirSync(g).filter(y=>y.startsWith(u)&&x(y)).map(y=>{let p=y.match(/-(\d{3})\.(yaml|lore)$/);return p?parseInt(p[1],10):0}),S=h.length>0?Math.max(...h)+1:1;return `${u}-${String(S).padStart(3,"0")}`}export{v as a,P as b,H as c,A as d,G as e,K as f,C as g,Z as h,J as i};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import*as e from'fs';import*as o from'path';var y=".paradigm/events/session-log.jsonl",d=".paradigm/events/session-metrics.jsonl",p=".paradigm/events/verdicts.jsonl",v=200,g=".paradigm/events/notebook-refs.jsonl";function x(i,n){try{let t=o.join(i,y),r=o.dirname(t);if(e.existsSync(r)||e.mkdirSync(r,{recursive:!0}),e.existsSync(t)&&e.readFileSync(t,"utf8").trim().split(`
|
|
3
3
|
`).filter(a=>a.trim()).length>=v)return;let f=JSON.stringify(n)+`
|
|
4
|
-
`;e.appendFileSync(t,f,"utf8"),n.type==="user-verdict"&&n.agent&&n.symbols?.length&&import('./agent-loader-
|
|
4
|
+
`;e.appendFileSync(t,f,"utf8"),n.type==="user-verdict"&&n.agent&&n.symbols?.length&&import('./agent-loader-2WJHD46U.js').then(({loadAgentProfile:c,saveAgentProfile:s})=>{try{let a=c(i,n.agent);if(a?.expertise){let u=n.verdict==="accepted"?.03:n.verdict==="dismissed"?-.02:n.verdict==="revised"?-.01:0;if(u!==0){for(let S of n.symbols){let l=a.expertise.find(h=>h.symbol===S);l&&(l.confidence=Math.max(0,Math.min(1,l.confidence+u)),l.sessions=(l.sessions||0)+1,l.lastTouch=new Date().toISOString());}s(n.agent,a,"global");}}}catch{}}).catch(()=>{});}catch{}}function m(i){try{let n=o.join(i,y);return e.existsSync(n)?e.readFileSync(n,"utf8").trim().split(`
|
|
5
5
|
`).filter(t=>t.trim()).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(t=>t!==null):[]}catch{return []}}function C(i){try{let n=o.join(i,y);e.existsSync(n)&&e.writeFileSync(n,"","utf8");}catch{}}function I(i,n){try{let t=o.join(i,p),r=o.dirname(t);e.existsSync(r)||e.mkdirSync(r,{recursive:!0}),e.appendFileSync(t,JSON.stringify(n)+`
|
|
6
6
|
`,"utf8");}catch{}}function N(i){try{let n=o.join(i,p);return e.existsSync(n)?e.readFileSync(n,"utf8").trim().split(`
|
|
7
7
|
`).filter(t=>t.trim()).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(t=>t!==null&&!t.consumed):[]}catch{return []}}function M(i,n){try{let t=o.join(i,p);if(!e.existsSync(t))return;let r=new Set(n),c=e.readFileSync(t,"utf8").trim().split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import {a as a$1}from'./chunk-FYDRENK7.js';import {f,a}from'./chunk-IZSBGW6E.js';import {e}from'./chunk-AO7ZSRME.js';import {b,d,c}from'./chunk-EKZDFEJW.js';import*as h from'fs';import*as A from'path';import*as R from'js-yaml';import {glob}from'glob';import {EventEmitter}from'events';var H=/[#$^!~][a-zA-Z0-9_-]+/g;function V(r){let e=r.match(H)||[];return [...new Set(e)]}function G(r){let e=r.charAt(0);return {"#":"component",$:"flow","^":"gate","!":"signal","~":"aspect"}[e]||"unknown"}async function M(r,e,s,t){let o=A.join(s,".paradigm"),n=V(e),a=K(r,t),c=W(a.include||[],n),l=a.exclude||[],p=await J(s,c,l);return {systemPrompt:await Y(r,o,n),files:p,symbols:n}}function K(r,e){return e?.contextInclude||e?.contextExclude?{include:e.contextInclude,exclude:e.contextExclude}:{architect:{include:["specs/*.md",".purpose","**/.purpose","portal.yaml",".paradigm/config.yaml"],exclude:["src/**","tests/**","node_modules/**","dist/**"]},builder:{include:["src/**","tests/**","{feature}.purpose","specs/{feature}.md"],exclude:["specs/*.md","node_modules/**","dist/**"]},reviewer:{include:["src/**","specs/*.md","portal.yaml",".purpose"],exclude:["tests/**","node_modules/**","dist/**"]},tester:{include:["tests/**","health.yaml","{feature}.purpose"],exclude:["src/**","specs/**","node_modules/**","dist/**"]},security:{include:["portal.yaml","src/middleware/**","src/auth/**",".paradigm/wisdom/antipatterns.yaml"],exclude:["src/routes/**","tests/**","node_modules/**","dist/**"]}}[r.name]||{include:[".purpose","portal.yaml"],exclude:["node_modules/**","dist/**"]}}function W(r,e){let s=[];for(let t of r)if(t.includes("{feature}")||t.includes("{symbol}"))for(let o of e){let n=o.substring(1);s.push(t.replace(/\{feature\}/g,n).replace(/\{symbol\}/g,n));}else s.push(t);return s}async function J(r,e,s){let t=new Set;for(let o of e)try{let n=await glob(o,{cwd:r,ignore:s,nodir:!0,absolute:!1});for(let a of n)t.add(a);}catch{}return Array.from(t)}async function Y(r,e,s){let t=[],o=A.join(e,"config.yaml"),n=null;if(h.existsSync(o))try{n=R.load(h.readFileSync(o,"utf-8"));}catch{}if(t.push(`# ${r.name.charAt(0).toUpperCase()+r.name.slice(1)} Agent Context
|
|
3
3
|
`),n?.project&&(t.push(`> Project: ${n.project}`),n.discipline&&n.discipline!=="auto"&&t.push(`> Discipline: ${n.discipline}`),t.push("")),n?.["agent-guidelines"]?.overview&&(t.push(`## Project Overview
|
|
4
4
|
`),t.push(n["agent-guidelines"].overview),t.push("")),n?.["symbol-system"]){t.push(`## Symbol System
|
|
5
5
|
`),t.push("| Symbol | Meaning | Description |"),t.push("|--------|---------|-------------|");for(let[c,l]of Object.entries(n["symbol-system"]))t.push(`| \`${c}\` | ${l.name} | ${l.description} |`);t.push("");}if(n?.conventions){let c=Z(n.conventions,r.name);if(c.length>0){t.push(`## Conventions
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b}from'./chunk-4TXOVRWD.js';import {b as b$1}from'./chunk-VCKKJDLP.js';import {m}from'./chunk-
|
|
2
|
+
import {a,b}from'./chunk-4TXOVRWD.js';import {b as b$1}from'./chunk-VCKKJDLP.js';import {m}from'./chunk-LWAIVOSF.js';import*as u from'fs';import*as p from'path';import*as $ from'js-yaml';import g from'chalk';import q from'ora';var _={"@":{category:"features",prefix:"@"},"#":{category:"components",prefix:"#"},"^":{category:"gates",prefix:"^"},$:{category:"flows",prefix:"$"},"&":{category:"integrations",prefix:"&"},"!":{category:"signals",prefix:"!"},"%":{category:"state",prefix:"%"}},N={features:["src/features/","features/","app/","src/app/","src/modules/","modules/"],components:["src/components/","components/","src/lib/","lib/","src/ui/","ui/"],gates:["middleware/","src/middleware/","auth/","src/auth/","guards/","src/guards/"],flows:["flows/","src/flows/","workflows/","src/workflows/","sagas/","src/sagas/"],integrations:["integrations/","src/integrations/","external/","src/external/","vendors/"],signals:["events/","src/events/","handlers/","src/handlers/"],state:["stores/","src/stores/","state/","src/state/","reducers/","src/reducers/"]},z={config:[".paradigm/config.yaml","package.json","tsconfig.json",".env.example"],entry:["src/index.ts","src/index.tsx","src/main.ts","src/main.tsx","index.ts","main.ts","src/app.ts","src/app.tsx"],types:["src/types/","types/","src/types.ts","types.ts"]},G={always:["node_modules/","dist/","build/",".git/",".next/",".nuxt/",".cache/","*.lock","*.log"],unless_testing:["**/*.test.ts","**/*.test.tsx","**/*.spec.ts","**/*.spec.tsx","__tests__/","test/","tests/"],unless_docs:["docs/","*.md","README*","CHANGELOG*"]};async function A(o,t,n={}){let r=n.quiet?null:q();r?.start("Generating navigator.yaml...");let s=M(o),e=L(o),c=H(o),i=U(t.symbols,t.purposeFiles),f={version:"1.0",generated:new Date().toISOString(),structure:s,key_files:e,skip_patterns:c,symbols:i},a=p.join(o,".paradigm"),l=p.join(a,"navigator.yaml");u.existsSync(a)||u.mkdirSync(a,{recursive:true}),u.writeFileSync(l,$.dump(f,{indent:2,lineWidth:120,noRefs:true,sortKeys:false}),"utf8"),r?.succeed(g.green("Navigator generated")),n.quiet||(console.log(g.gray(` Output: ${l}`)),console.log(g.gray(` Structure categories: ${Object.keys(s).length}`)),console.log(g.gray(` Symbol mappings: ${Object.keys(i).length}`)),console.log());}function M(o){let t={};for(let[n,r]of Object.entries(N)){let s=r.filter(e=>{let c=p.join(o,e);return u.existsSync(c)});if(s.length>0){let e=Object.values(_).find(c=>c.category===n);t[n]={paths:s,symbol:e?.prefix||"@"};}}return t}function L(o){let t={};for(let[n,r]of Object.entries(z)){let s=r.filter(e=>{let c=p.join(o,e);return u.existsSync(c)});s.length>0&&(t[n]=s);}return t.config||(t.config=[]),t.entry||(t.entry=[]),t.types||(t.types=[]),t}function H(o){let t={...G},n=p.join(o,".gitignore");if(u.existsSync(n))try{let s=u.readFileSync(n,"utf8").split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).filter(e=>e.endsWith("/")||e.includes("*")||["node_modules","dist","build",".cache"].some(c=>e.includes(c))).slice(0,20);for(let e of s)t.always.includes(e)||t.always.push(e);}catch{}return t}function U(o,t,n){let r={},s=new Map;for(let e of t){let c=p.dirname(e);s.set(e,c);}for(let e of o){let i=`${W(e.type)}${e.id}`;if(e.path)r[i]=e.path;else if(e.directory)r[i]=e.directory;else {let f=t.find(a=>{let l=p.dirname(a),y=e.id.toLowerCase();return l.toLowerCase().includes(y)});f&&(r[i]=p.dirname(f)+"/");}}return r}function W(o){switch(o){case "feature":return "@";case "component":return "#";case "gate":return "^";case "flow":return "$";case "integration":return "&";case "signal":return "!";case "state":return "%";case "idea":return "?";case "deprecated":return "~";default:return "@"}}function P(o){return $.load(o)}async function ce(o,t){let n=o?p.resolve(o):process.cwd(),r=p.basename(n),s=q(),e=p.join(n,".paradigm"),c=u.existsSync(e)&&u.statSync(e).isFile(),i;t.output?i=p.resolve(t.output):c?i=p.join(n,".paradigm-scan-index.json"):(i=p.join(n,".paradigm","scan-index.json"),u.existsSync(p.dirname(i))||u.mkdirSync(p.dirname(i),{recursive:true})),t.quiet||console.log(g.blue(`
|
|
4
4
|
\u{1F52D} Generating Paradigm Scan Index
|
|
5
5
|
`));let f,a$1,l,y=[p.join(n,".paradigm"),p.join(n,".paradigm","config.yaml")];for(let h of y)if(u.existsSync(h)&&u.statSync(h).isFile())try{let m=u.readFileSync(h,"utf8"),F=P(m);f=F.scan,a$1=F.graph,l=F.context?.tiers;break}catch{}s.start("Aggregating symbols from purpose and portal files...");let d;try{d=await m(n);}catch(h){s.fail(g.red("Failed to aggregate symbols")),console.error(g.gray(h.message)),process.exit(1);}if(s.succeed(`Found ${d.symbols.length} symbols`),!t.quiet){let h={components:d.symbols.filter(m=>m.type==="component").length,flows:d.symbols.filter(m=>m.type==="flow").length,gates:d.symbols.filter(m=>m.type==="gate").length,signals:d.symbols.filter(m=>m.type==="signal").length,aspects:d.symbols.filter(m=>m.type==="aspect").length};console.log(g.gray(" Breakdown:"));for(let[m,S]of Object.entries(h))S>0&&console.log(g.gray(` ${m}: ${S}`));console.log();}s.start("Generating scan index...");let b$2=a({symbols:d.symbols,purposeFiles:d.purposeFiles,portalFiles:d.portalFiles},{projectName:r,visualTagMappings:f?.visualTagMappings,screenDefinitions:f?.screens});K(b$2,{hot:l?.["hot-threshold"],warm:l?.["warm-threshold"]});try{u.writeFileSync(i,b(b$2),"utf8"),s.succeed(g.green("Scan index generated"));}catch(h){s.fail(g.red("Failed to write scan index")),console.error(g.gray(h.message)),process.exit(1);}await A(n,d,{quiet:t.quiet});let j=await Y(n,d.purposeFiles,{quiet:t.quiet});if(j&&Object.keys(j.flows).length>0){let h=p.join(n,".paradigm","flow-index.json");u.writeFileSync(h,JSON.stringify(j,null,2),"utf8"),t.quiet||s.succeed(g.green(`Flow index generated (${Object.keys(j.flows).length} flows)`));}if(a$1?.["auto-generate"]!==false)try{let h=b$1(n),m=p.join(n,".paradigm","graphs");u.existsSync(m)||u.mkdirSync(m,{recursive:!0});let S=p.join(m,"auto.graph.json");u.writeFileSync(S,JSON.stringify(h,null,2),"utf8"),t.quiet||s.succeed(g.green(`Symbol graph updated (${h.nodes.length} nodes)`));}catch{t.quiet||s.warn(g.yellow("Could not auto-generate symbol graph"));}return t.quiet||(console.log(g.gray(`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {e}from'./chunk-
|
|
2
|
+
import {e}from'./chunk-VIG5LSGZ.js';import*as r from'fs';import*as c from'path';import*as ce from'os';import*as N from'js-yaml';function se(e,s){let n=[];return n.push(`# ${e} - Paradigm Context`),n.push(""),n.push(`Generated for ${s} by Paradigm.`),n.push(""),n.join(`
|
|
3
3
|
`)}function P(e){let s=[];if(e["agent-guidelines"]?.overview&&(s.push("## Overview"),s.push(""),s.push(e["agent-guidelines"].overview),s.push("")),e["agent-guidelines"]?.["how-to-use"]?.length){s.push("## How to Use Paradigm"),s.push("");for(let n of e["agent-guidelines"]["how-to-use"])s.push(`- ${n}`);s.push("");}return s.join(`
|
|
4
4
|
`)}function C(e){let s=[];s.push("## Symbol System"),s.push(""),s.push("Use these prefixes to reference project elements:"),s.push(""),s.push("| Symbol | Name | Description |"),s.push("|--------|------|-------------|");let n=e["symbol-system"];if(n)for(let[a,t]of Object.entries(n))s.push(`| \`${a}\` | ${t.name} | ${t.description} |`);return s.push(""),s.push("See `.paradigm/specs/symbols.md` for complete reference."),s.push(""),s.join(`
|
|
5
5
|
`)}function w(e){let s=[];if(!e.logging?.enforce)return "";if(s.push("## Paradigm Logging"),s.push(""),s.push("**IMPORTANT:** Use the Paradigm logger instead of raw console.log/print."),s.push(""),s.push("```"),s.push("// Use this pattern:"),s.push("log.component('#login-handler').info('Starting login', { email });"),s.push("log.component('#database').debug('Query executed', { duration });"),s.push("log.gate('^authenticated').warn('Access denied', { userId });"),s.push("log.signal('!login-success').info('User authenticated');"),s.push("```"),s.push(""),e.logging["symbol-mapping"]){s.push("### Symbol Mapping by Directory"),s.push(""),s.push("| Directory | Symbol | Logger Method |"),s.push("|-----------|--------|---------------|");for(let[n,a]of Object.entries(e.logging["symbol-mapping"])){let t=ge(a);s.push(`| \`${n}\` | \`${a}\` | \`log.${t}()\` |`);}s.push("");}return s.push("See `.paradigm/specs/logger.md` for full specification."),s.push(""),s.join(`
|
|
6
|
-
`)}function ge(e){return {"#":"component","^":"gate","!":"signal",$:"flow","~":"aspect","@":"component","%":"component","&":"component"}[e]||"raw"}function ne(e){if(!e.
|
|
6
|
+
`)}function ge(e){return {"#":"component","^":"gate","!":"signal",$:"flow","~":"aspect","@":"component","%":"component","&":"component"}[e]||"raw"}function ne(e){if(!e.probe?.enabled)return "";let s=[];return s.push("## Paradigm Probe"),s.push(""),s.push('When the user says "**paradigm probe**" with an image:'),s.push(""),s.push("1. Analyze the image for UI elements"),s.push("2. Cross-reference with `.paradigm/probe-index.json`"),s.push("3. Return structured mapping of visual elements to code"),s.push(""),s.push("| Mode | Use Case |"),s.push("|------|----------|"),s.push("| `paradigm probe` | Map any image to code |"),s.push("| `paradigm probe ui` | Screenshot of running app |"),s.push("| `paradigm probe design` | Mockup - gap analysis |"),s.push("| `paradigm probe error` | Error screenshot |"),s.push(""),s.push("See `.paradigm/specs/probe.md` for full protocol."),s.push(""),s.join(`
|
|
7
7
|
`)}function b(e){if(!e.conventions?.length)return "";let s=[];s.push("## Conventions"),s.push("");for(let n of e.conventions)s.push(`- ${n}`);return s.push(""),s.join(`
|
|
8
8
|
`)}function S(e){if(!e["agent-guidelines"]?.["update-rules"]?.length)return "";let s=[];s.push("## When to Update Paradigm Files"),s.push("");for(let n of e["agent-guidelines"]["update-rules"])s.push(`- ${n}`);return s.push(""),s.join(`
|
|
9
9
|
`)}function x(){let e=[];return e.push("## Paradigm Commands"),e.push(""),e.push("| Command | Description |"),e.push("|---------|-------------|"),e.push("| `paradigm init` | Initialize Paradigm in a project |"),e.push("| `paradigm sync` | Regenerate IDE instruction files |"),e.push("| `paradigm index` | Generate scan index |"),e.push("| `paradigm doctor` | Health check |"),e.push("| `paradigm status` | Show project status |"),e.push("| `paradigm watch` | Auto-sync on changes |"),e.push(""),e.push("See `.paradigm/docs/commands.md` for full reference."),e.push(""),e.join(`
|
|
@@ -16,7 +16,7 @@ import {e}from'./chunk-JQKKVAAN.js';import*as r from'fs';import*as c from'path';
|
|
|
16
16
|
`)}function E(){let e=[];return e.push("## Habits Compliance"),e.push(""),e.push("Paradigm tracks behavioral habits \u2014 repeatable practices that improve code quality."),e.push(""),e.push("### When to Check Habits"),e.push(""),e.push("| Trigger | When | Tool |"),e.push("|---------|------|------|"),e.push('| `preflight` | Before starting implementation | `paradigm_habits_check({ trigger: "preflight" })` |'),e.push('| `postflight` | After completing implementation | `paradigm_habits_check({ trigger: "postflight" })` |'),e.push('| `on-stop` | Before ending a session | `paradigm_habits_check({ trigger: "on-stop" })` |'),e.push(""),e.push("### Key Habit Categories"),e.push(""),e.push("| Category | Examples |"),e.push("|----------|----------|"),e.push("| Discovery | Call `paradigm_ripple` before modifying symbols |"),e.push("| Security | Declare gates for new routes in portal.yaml |"),e.push("| Documentation | Update .purpose files for modified components |"),e.push("| Quality | Record lore for sessions modifying 3+ files |"),e.push(""),e.push("Use `paradigm_practice_context` before modifying symbols to get habit-aware warnings."),e.push(""),e.join(`
|
|
17
17
|
`)}function D(){let e=[];return e.push("## Lore Recording"),e.push(""),e.push("Lore captures the project timeline \u2014 sessions, decisions, milestones, and incidents."),e.push(""),e.push("### When to Record Lore"),e.push(""),e.push("| Type | When | Example |"),e.push("|------|------|---------|"),e.push('| `agent-session` | After modifying 3+ files | "Added JWT auth to /api/projects" |'),e.push('| `decision` | After making architectural choices | "Chose Redis over Memcached for caching" |'),e.push('| `milestone` | After completing a significant feature | "v2.0 migration complete" |'),e.push('| `incident` | After resolving a production issue | "Fixed OOM in payment worker" |'),e.push(""),e.push("### Recording"),e.push(""),e.push("```"),e.push("paradigm_lore_record({"),e.push(' type: "agent-session",'),e.push(' title: "Short description of work done",'),e.push(' summary: "Detailed summary of changes...",'),e.push(' symbols_touched: ["#component", "^gate"]'),e.push("})"),e.push("```"),e.push(""),e.push("Use `paradigm_lore_timeline` at session start for project history orientation."),e.push(""),e.join(`
|
|
18
18
|
`)}function U(){let e=[];return e.push("## llms.txt"),e.push(""),e.push("This project provides an `llms.txt` file at the repository root \u2014 a plain-text summary"),e.push("of the project optimized for LLM consumption. It includes symbols, key files, flows,"),e.push("gates, and conventions."),e.push(""),e.push("Regenerate with: `paradigm sync-llms`"),e.push(""),e.join(`
|
|
19
|
-
`)}function pe(){let e=[];return e.push("---"),e.push(""),e.push("## Reference Files"),e.push(""),e.push("- `.paradigm/specs/symbols.md` - Symbol system reference"),e.push("- `.paradigm/specs/logger.md` - Logging specification"),e.push("- `.paradigm/specs/
|
|
19
|
+
`)}function pe(){let e=[];return e.push("---"),e.push(""),e.push("## Reference Files"),e.push(""),e.push("- `.paradigm/specs/symbols.md` - Symbol system reference"),e.push("- `.paradigm/specs/logger.md` - Logging specification"),e.push("- `.paradigm/specs/probe.md` - Probe protocol"),e.push("- `.paradigm/docs/commands.md` - CLI reference"),e.push("- `.paradigm/docs/patterns.md` - Coding patterns"),e.push("- `.paradigm/docs/troubleshooting.md` - Common issues"),e.push("- `.paradigm/prompts/` - Pre-written task prompts"),e.push(""),e.push("*Generated by Paradigm. Run `paradigm sync` to regenerate.*"),e.join(`
|
|
20
20
|
`)}function g(e,s={}){let n=["---",`description: ${e}`];return s.globs&&n.push(`globs: ${s.globs}`),s.alwaysApply!==void 0&&n.push(`alwaysApply: ${s.alwaysApply}`),n.push("---",""),n.join(`
|
|
21
21
|
`)}var G=class{name="cursor";displayName="Cursor";outputPath=".cursor/rules";multiFile=true;detect(s){return !!(r.existsSync(c.join(s,".cursor"))||r.existsSync(c.join(s,".cursorrules"))||r.existsSync(c.join(s,".vscode")))}generate(s){return this.generateFiles(s).map(a=>`# ${a.path}
|
|
22
22
|
|
|
@@ -578,7 +578,7 @@ For detailed specifications, reference these files:
|
|
|
578
578
|
|
|
579
579
|
- \`.paradigm/specs/symbols.md\` - Complete symbol reference
|
|
580
580
|
- \`.paradigm/specs/logger.md\` - Logging specification
|
|
581
|
-
- \`.paradigm/specs/
|
|
581
|
+
- \`.paradigm/specs/probe.md\` - Visual discovery protocol
|
|
582
582
|
- \`.paradigm/docs/\` - Documentation and troubleshooting
|
|
583
583
|
- \`.paradigm/prompts/\` - Pre-written task prompts
|
|
584
584
|
|
|
@@ -740,4 +740,4 @@ ${v()}
|
|
|
740
740
|
`)}},W=new Q;var Y=class{name="claude";displayName="Claude";outputPath="CLAUDE.md";detect(s){return !!r.existsSync(c.join(s,"CLAUDE.md"))}generate(s){let{config:n,projectName:a}=s,t=[];t.push(`# ${a} - Claude Context`),t.push(""),t.push("> **Paradigm v2.0** | For Claude Code, Claude API, and Claude-native interfaces"),t.push(">"),t.push("> **Author:** Matt Canoy ([@ascend42](https://github.com/ascend42)) | **Repo:** [github.com/ascend42/a-paradigm](https://github.com/ascend42/a-paradigm) | **npm:** [@a-company/paradigm](https://www.npmjs.com/package/@a-company/paradigm) | **Plugin:** `paradigm` via Claude Code marketplace"),t.push(""),t.push("## Project Overview"),t.push(""),n["agent-guidelines"]?.overview&&t.push(n["agent-guidelines"].overview),t.push(""),t.push("## Quick Orientation"),t.push(""),t.push("```"),t.push(".paradigm/config.yaml \u2192 Project configuration"),t.push(".paradigm/specs/ \u2192 Detailed specifications"),t.push(".paradigm/docs/ \u2192 Commands, patterns, troubleshooting"),t.push(".cursorrules \u2192 IDE instructions (if using Cursor)"),t.push("portal.yaml \u2192 Security/auth definitions"),t.push(".paradigm/lore/ \u2192 Project timeline and history"),t.push("```"),t.push(""),t.push("## Symbol System"),t.push(""),t.push("Use these prefixes in documentation and commits:"),t.push(""),t.push("| Symbol | Meaning | Example |"),t.push("|--------|---------|---------|");let i=n["symbol-system"];if(i)for(let[p,u]of Object.entries(i)){let d=u.examples?.[0]||`${p}example`;t.push(`| \`${p}\` | ${u.name} | \`${d}\` |`);}t.push("");let o=b(n);if(o&&t.push(o),t.push(v()),t.push("## Agent Onboarding"),t.push(""),t.push("**First session:** Call `paradigm_status` \u2192 read `.paradigm/config.yaml` \u2192 check `portal.yaml`"),t.push(""),t.push("**Before each task:** `paradigm_ripple` for impact, `paradigm_gates_for_route` for new endpoints"),t.push(""),t.push("**Resuming:** Call `paradigm_session_recover`"),t.push(""),t.push("## Before Implementing"),t.push(""),t.push("0. Call `paradigm_protocol_search` \u2014 if a protocol matches, follow it"),t.push('1. Complex task (3+ files)? \u2192 `paradigm_orchestrate_inline` mode="plan"'),t.push("2. Affects symbols? \u2192 `paradigm_ripple`"),t.push("3. Adds endpoints? \u2192 `paradigm_gates_for_route`"),t.push(""),t.push("## Automatic Enforcement (Hooks)"),t.push(""),t.push("The stop hook **BLOCKS** if source files were modified without .purpose updates."),t.push(""),t.push("| Hook | Behavior |"),t.push("|------|----------|"),t.push("| **Stop** | Blocks on: missing .purpose, missing portal.yaml gates, aspect drift, stale purposes |"),t.push("| **Pre-commit** | Auto-rebuilds index \u2014 never blocks |"),t.push("| **Post-write** | Advisory reminder for .purpose coverage |"),t.push(""),t.push("**If blocked:** Update .purpose files \u2192 update portal.yaml if needed \u2192 `paradigm_reindex` \u2192 finish"),t.push(""),t.push("## Maintaining Paradigm Files"),t.push(""),t.push("**You MUST update Paradigm files when making code changes:**"),t.push(""),t.push("- Add feature \u2192 create `.purpose` in directory"),t.push("- Add protected route \u2192 update `portal.yaml` with gates"),t.push("- Add signal/event \u2192 add to `.purpose`"),t.push("- Add multi-step flow \u2192 document as `$flow`"),t.push("- Rename/delete symbol \u2192 update all references"),t.push("- Record lore via `paradigm_lore_record` for sessions modifying 3+ files"),t.push("- Use Paradigm logger (`log.component()`, `log.gate()`, etc.) \u2014 never raw console.log"),t.push(""),t.push("**Auth requires portal.yaml** if your code has JWT, role checks, ownership checks, or protected endpoints."),t.push(""),t.push("## On-Demand Guidance"),t.push(""),t.push("Detailed guidance is available via MCP resources \u2014 load only what you need:"),t.push(""),t.push("| Topic | Resource |"),t.push("|-------|----------|"),t.push("| Logging rules & directory mapping | `paradigm://guidance/logging` |"),t.push("| Portal protocol & gate patterns | `paradigm://guidance/portal` |"),t.push("| MCP workflow & token budgets | `paradigm://guidance/mcp-workflow` |"),t.push("| Flow-first development | `paradigm://guidance/flows` |"),t.push("| Multi-agent orchestration | `paradigm://guidance/orchestration` |"),t.push("| Workspaces (multi-project) | `paradigm://guidance/workspaces` |"),t.push("| University (knowledge base) | `paradigm://guidance/university` |"),t.push("| Confidence calibration | `paradigm://guidance/calibration` |"),t.push("| Session checkpoints | `paradigm://guidance/checkpoints` |"),t.push("| Navigation & task recipes | `paradigm://guidance/navigation` |"),t.push("| Component types & hierarchy | `paradigm://guidance/component-types` |"),t.push("| Troubleshooting | `paradigm://guidance/troubleshooting` |"),t.push(""),s.agents?.length){let p=s.agents.flatMap(u=>(u.context?.contributions||[]).filter(d=>d.priority==="high"&&d.content).map(d=>({agent:u.id,section:d.section,content:d.content})));if(p.length>0){t.push("## Agent Contributions"),t.push("");for(let u of p)t.push(`### ${u.section} (${u.agent})`),t.push(""),t.push(u.content),t.push("");}}if(n["purpose-required"]?.length){t.push("## Directory Structure"),t.push(""),t.push("`.purpose` files exist in:");for(let p of n["purpose-required"])t.push(`- \`${p.pattern}\``);t.push("");}return t.push("---"),t.push(""),t.push("*See `.paradigm/specs/` for specifications. Run `paradigm sync` to regenerate.*"),t.filter(p=>p!==void 0).join(`
|
|
741
741
|
`)}generateMcpConfig(s){return {mcpServers:{paradigm:{command:"paradigm-mcp",args:["."],cwd:s}}}}generateNestedContexts(s,n){let a=[],t=me(s);for(let i of t){let o=c.dirname(i),p=c.relative(s,o);if(p===""||p===".")continue;let u=r.readFileSync(i,"utf8"),d=this.generateDirectoryContext(p,u,n);a.push({path:c.join(p,"CLAUDE.md"),content:d});}return a}generateDirectoryContext(s,n,a){let t=[],i=c.basename(s);return t.push(`# ${i} - Directory Context`),t.push(""),t.push(`> Part of ${a.projectName} | See root CLAUDE.md for project overview`),t.push(""),t.push("## Purpose"),t.push(""),t.push("```yaml"),t.push(n.trim()),t.push("```"),t.push(""),t.push("## Quick Reference"),t.push(""),t.push(`- **Path**: \`${s}\``),t.push("- **Config**: See `.paradigm/config.yaml`"),t.push("- **Patterns**: See `.paradigm/docs/patterns.md`"),t.push(""),t.push("## Symbols"),t.push(""),t.push("`#` component | `$` flow | `^` gate | `!` signal | `~` aspect"),t.push(""),t.push("---"),t.push(""),t.push("*Auto-generated by `paradigm sync claude`. Edit .purpose file to update.*"),t.join(`
|
|
742
742
|
`)}};function me(e){let s=[];function n(a){let t=r.readdirSync(a,{withFileTypes:true});for(let i of t){let o=c.join(a,i.name);if(i.isDirectory()){if(i.name.startsWith(".")||i.name==="node_modules")continue;n(o);}else i.name===".purpose"&&s.push(o);}}return n(e),s}var J=new Y;var K=class{name="agents";displayName="AGENTS.md";outputPath="AGENTS.md";multiFile=false;detect(s){return r.existsSync(c.join(s,"AGENTS.md"))}generate(s){let{config:n,projectName:a}=s,t=[];t.push(`# ${a} - AI Agent Instructions`),t.push(""),t.push("> Generated by [Paradigm](https://github.com/anthropics/paradigm) v2.0 | Universal AI agent instruction file"),t.push(""),t.push(P(n)),t.push(C(n));let i=b(n);i&&t.push(i);let o=w(n);o&&t.push(o),t.push(ie()),t.push(ae()),t.push(re()),t.push(v()),t.push(oe()),t.push($()),t.push(E()),t.push(D()),t.push(U());let p=S(n);return p&&t.push(p),t.push(x()),t.push("---"),t.push(""),t.push("*Generated by Paradigm. Run `paradigm sync agents` to regenerate.*"),t.filter(u=>u!==void 0&&u!=="").join(`
|
|
743
|
-
`)}},X=new K;var Z=new Map([["cursor",O],["copilot",L],["windsurf",W],["claude",J],["agents",X]]);function ee(e){return Z.get(e.toLowerCase())}function he(){return Array.from(Z.keys())}function Ee(e){return O.detect(e)?{detected:"cursor",confidence:"high",reason:"Found .cursor directory or .cursorrules file"}:W.detect(e)?{detected:"windsurf",confidence:"high",reason:"Found .windsurf directory or .windsurfrules file"}:L.detect(e)?{detected:"copilot",confidence:"medium",reason:"Found .github/copilot-instructions.md file"}:r.existsSync(c.join(e,".vscode"))?{detected:"cursor",confidence:"low",reason:"Found .vscode directory, defaulting to Cursor format"}:{detected:null,confidence:"low",reason:"No IDE markers found"}}function De(e$1){let s=c.join(e$1,".paradigm"),n=c.join(e$1,".paradigm"),a,t,i;if(r.existsSync(s)&&r.statSync(s).isDirectory())a=c.join(s,"config.yaml"),t=c.join(s,"specs"),i=c.join(s,"docs");else if(r.existsSync(n)&&r.statSync(n).isFile())a=n,t="",i="";else return null;if(!r.existsSync(a))return null;let o;try{let f=r.readFileSync(a,"utf8");o=e(f);}catch{return null}let p={};if(t&&r.existsSync(t)){let f=["logger.md","
|
|
743
|
+
`)}},X=new K;var Z=new Map([["cursor",O],["copilot",L],["windsurf",W],["claude",J],["agents",X]]);function ee(e){return Z.get(e.toLowerCase())}function he(){return Array.from(Z.keys())}function Ee(e){return O.detect(e)?{detected:"cursor",confidence:"high",reason:"Found .cursor directory or .cursorrules file"}:W.detect(e)?{detected:"windsurf",confidence:"high",reason:"Found .windsurf directory or .windsurfrules file"}:L.detect(e)?{detected:"copilot",confidence:"medium",reason:"Found .github/copilot-instructions.md file"}:r.existsSync(c.join(e,".vscode"))?{detected:"cursor",confidence:"low",reason:"Found .vscode directory, defaulting to Cursor format"}:{detected:null,confidence:"low",reason:"No IDE markers found"}}function De(e$1){let s=c.join(e$1,".paradigm"),n=c.join(e$1,".paradigm"),a,t,i;if(r.existsSync(s)&&r.statSync(s).isDirectory())a=c.join(s,"config.yaml"),t=c.join(s,"specs"),i=c.join(s,"docs");else if(r.existsSync(n)&&r.statSync(n).isFile())a=n,t="",i="";else return null;if(!r.existsSync(a))return null;let o;try{let f=r.readFileSync(a,"utf8");o=e(f);}catch{return null}let p={};if(t&&r.existsSync(t)){let f=["logger.md","probe.md","symbols.md"];for(let h of f){let y=c.join(t,h);if(r.existsSync(y)){let _=h.replace(".md","");p[_]=r.readFileSync(y,"utf8");}}}let u={};if(i&&r.existsSync(i)){let f=["commands.md","patterns.md","troubleshooting.md"];for(let h of f){let y=c.join(i,h);if(r.existsSync(y)){let _=h.replace(".md","");u[_]=r.readFileSync(y,"utf8");}}}let d,l=c.join(e$1,".paradigm","agents");if(r.existsSync(l))try{let f=r.readdirSync(l).filter(y=>y.endsWith(".agent")),h=[];for(let y of f)try{let _=r.readFileSync(c.join(l,y),"utf8"),F=N.load(_);F?.id&&h.push({id:F.id,role:F.role,context:F.context});}catch{}h.length>0&&(d=h);}catch{}let m,I=N.load(r.readFileSync(a,"utf8")).workspace;if(typeof I=="string"){let f=c.resolve(e$1,I);if(r.existsSync(f))try{let h=N.load(r.readFileSync(f,"utf8")),y=c.dirname(f),_=h.members?.find(F=>c.resolve(y,F.path)===e$1)?.name||c.basename(e$1);m={name:h.name,currentMember:_,members:h.members||[]};}catch{}}return {config:o,specs:p,docs:u,projectName:c.basename(e$1),workspace:m,agents:d}}function fe(e,s,n,a=false){let t=ee(s);if(!t)return {success:false,ide:s,outputPath:"",message:`Unknown IDE: ${s}. Available: ${he().join(", ")}`};let i=c.join(e,t.outputPath);try{if(t.multiFile&&t.generateFiles)return ye(e,t,n,a);!a&&r.existsSync(i);let o=c.dirname(i);r.existsSync(o)||r.mkdirSync(o,{recursive:!0});let p=t.generate(n);return r.writeFileSync(i,p,"utf8"),{success:!0,ide:s,outputPath:i,message:`Generated ${t.outputPath}`}}catch(o){return {success:false,ide:s,outputPath:i,message:`Failed to write ${t.outputPath}: ${o.message}`}}}function ye(e,s,n,a){let t=c.join(e,s.outputPath);r.existsSync(t)||r.mkdirSync(t,{recursive:true});let i=s.generateFiles(n,e),o=[];for(let l of i){let m;l.path.startsWith("../")?m=c.join(t,l.path):m=c.join(t,l.path);let j=c.dirname(m);r.existsSync(j)||r.mkdirSync(j,{recursive:true}),!a&&r.existsSync(m),r.writeFileSync(m,l.content,"utf8"),o.push(l.path);}if(s.name==="cursor"){let l=c.join(e,".cursorrules");if(r.existsSync(l)){let m=c.join(e,".cursorrules.bak");r.existsSync(m)||r.renameSync(l,m);}}let p=o.filter(l=>!l.startsWith("../")),u=o.filter(l=>l.startsWith("../")),d=`Generated ${p.length} files in ${s.outputPath}/`;return u.length>0&&(d+=` + ${u.length} additional file(s)`),{success:true,ide:s.name,outputPath:t,message:d}}function Ue(e,s,n=false){let a=[];for(let[t]of Z)a.push(fe(e,t,s,n));return a}function Oe(e,s){let n=ee(s);if(!n||!n.generateMcpConfig)return {success:false,path:"",message:`IDE ${s} does not support MCP configuration`};let a=n.generateMcpConfig(e),t;switch(s){case "cursor":t=c.join(e,".cursor","mcp.json");break;case "claude":t=c.join(e,".mcp.json");break;default:return {success:false,path:"",message:`Unknown MCP config path for ${s}`}}try{let i=c.dirname(t);r.existsSync(i)||r.mkdirSync(i,{recursive:!0});let o={};if(r.existsSync(t)){let u=r.readFileSync(t,"utf8");o=JSON.parse(u);}let p={...o,mcpServers:{...o.mcpServers||{},...a.mcpServers}};if(s==="claude"){let u=o.permissions||{},d=u.allow||[],l="Bash(paradigm *)";d.includes(l)||(p.permissions={...u,allow:[...d,l]});}return r.writeFileSync(t,JSON.stringify(p,null,2)),{success:!0,path:t,message:`MCP configuration written to ${c.relative(e,t)}`}}catch(i){return {success:false,path:t,message:`Failed to write MCP config: ${i.message}`}}}function Le(e,s,n){let a=ee(s);if(!a||!a.generateNestedContexts)return {success:false,count:0,message:`IDE ${s} does not support nested contexts`};try{let t=a.generateNestedContexts(e,n);for(let i of t){let o=c.join(e,i.path),p=c.dirname(o);r.existsSync(p)||r.mkdirSync(p,{recursive:!0}),r.writeFileSync(o,i.content,"utf8");}return {success:!0,count:t.length,message:`Generated ${t.length} nested context files`}}catch(t){return {success:false,count:0,message:`Failed to write nested contexts: ${t.message}`}}}export{ee as a,he as b,Ee as c,De as d,fe as e,Ue as f,Oe as g,Le as h};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import*as r from'fs';import*as s from'path';import*as m from'js-yaml';var d=".paradigm/university",R="pack.yaml";function l(e){let a=s.join(e,R);if(!r.existsSync(a))return null;try{let c=r.readFileSync(a,"utf8");return m.load(c)??null}catch{return null}}function g(e){let a=[],c=s.join(e,"node_modules","@a-company","university"),n=l(c);n&&n.id&&n.tenant_kind&&a.push({id:n.id,name:n.name,tenantKind:n.tenant_kind,packRoot:c,disciplines:n.disciplines,entryCount:k(c)});let t=s.join(e,d);if(r.existsSync(t)){let i=l(t),o=i?.id??s.basename(e),h=i?.tenant_kind??"project";a.push({id:o,name:i?.name,tenantKind:h,packRoot:t,disciplines:i?.disciplines,entryCount:k(t)});try{let y=r.readdirSync(t,{withFileTypes:!0});for(let f of y){if(!f.isDirectory()||f.name.startsWith("."))continue;let u=s.join(t,f.name),p=l(u);!p||!p.id||a.push({id:p.id,name:p.name,tenantKind:p.tenant_kind??"project",packRoot:u,disciplines:p.disciplines,entryCount:k(u)});}}catch{}}return a}function k(e){for(let a of ["content","src/content"]){let c=s.join(e,a);if(!r.existsSync(c))continue;let n=0;for(let t of ["notes","policies","quizzes","paths"]){let i=s.join(c,t);if(r.existsSync(i))try{n+=r.readdirSync(i).filter(o=>o.endsWith(".md")||o.endsWith(".yaml")).length;}catch{}}if(n>0)return n}return 0}function j(e,a){let c=g(e),n;if(a.pack){let t=c.find(i=>i.id===a.pack);if(t)n={packId:t.id,packRoot:t.packRoot,tenantKind:t.tenantKind,hasManifest:true};else {let i=s.join(e,d);n={packId:a.pack,packRoot:i,hasManifest:false};}}else if(a.project){let t=c.find(o=>o.tenantKind==="project"&&!o.disciplines),i=s.join(e,d);t?n={packId:t.id,packRoot:t.packRoot,tenantKind:t.tenantKind,hasManifest:true}:n={packId:s.basename(e),packRoot:i,hasManifest:false};}else {let t=c.find(i=>i.tenantKind==="project");if(t)n={packId:t.id,packRoot:t.packRoot,tenantKind:t.tenantKind,hasManifest:true};else {let i=c.find(o=>o.tenantKind==="first-party");if(i)n={packId:i.id,packRoot:i.packRoot,tenantKind:i.tenantKind,hasManifest:true};else {let o=s.join(e,d);n={packId:s.basename(e),packRoot:o,hasManifest:false};}}}if(a.discipline){let t=s.join(n.packRoot,a.discipline),i=l(t);i&&i.id?(n.subPackRoot=t,n.subPackId=i.id):r.existsSync(t)&&(n.subPackRoot=t,n.subPackId=`${n.packId}-${a.discipline}`);}return n}function b(e){return !!(e.pack||e.project||e.discipline)}export{g as a,j as b,b as c};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import*as l from'fs';import*as p from'path';import*as c from'js-yaml';import {glob}from'glob';var v={visualizerPort:42195,watcherPort:42196,autoConnect:true};async function F(e){let t=p.resolve(e),i=p.dirname(t);if(!l.existsSync(t))throw new Error(`Gate config not found: ${t}`);let s=l.readFileSync(t,"utf8"),n=c.load(s);if(!n.version)throw new Error('Gate config missing required "version" field');let o=[],a=n,h=n.gates||a.portals;if(h)for(let[r,d]of Object.entries(h)){let f=r.startsWith("^")?r.slice(1):r;o.push(u(f,d));}if(n.include)for(let r of n.include){let d=p.join(i,r),f=await glob(d.replace(/\\/g,"/"));for(let w of f){let $=await k(w);o.push(...$);}}let g=[];if(n.flows)for(let[r,d]of Object.entries(n.flows))g.push(b(r,d));return {version:n.version,gates:o,flows:g,settings:{dev:{...v,...n.settings?.dev}}}}async function k(e){let t=l.readFileSync(e,"utf8"),i=c.load(t);if(i.id){let s=i.id,n=s.startsWith("^")?s.slice(1):s;return [u(n,i)]}if(i.gates){let s=[];for(let[n,o]of Object.entries(i.gates)){let a=n.startsWith("^")?n.slice(1):n;s.push(u(a,o));}return s}return []}function u(e,t){let i=[];if(t.locks)for(let n of t.locks)i.push(z(n));let s=[];if(t.prizes)for(let n of t.prizes)s.push(x(n));return {id:e,description:t.description,locks:i,prizes:s,position:t.position}}function z(e){let t=e,i=[];if(t.keys){for(let s of t.keys)if(typeof s=="string")i.push({expression:s});else if(s.expression){let n=s;i.push({expression:n.expression,description:n.description});}}return {id:t.id,description:t.description,keys:i,mode:t.mode||"all"}}function x(e){let t=e;return {id:t.id,oneTime:t.oneTime??false,metadata:t.metadata}}function b(e,t){return {id:e,description:t.description,gates:t.gates||[],forkable:t.forkable}}function S(e){let t={version:e.version,gates:{},flows:{},settings:{dev:e.settings.dev}};for(let i of e.gates){let{id:s,...n}=i;t.gates[s]=n;}for(let i of e.flows){let{id:s,...n}=i;t.flows[s]=n;}return c.dump(t,{indent:2,lineWidth:-1,noRefs:true,sortKeys:false})}function E(){return c.dump({version:"1.0.0",gates:{"example-gate":{description:"An example gate to get you started",locks:[{id:"example-lock",description:"Requires user to be authenticated",keys:[{expression:"user.isAuthenticated === true"}]}],prizes:[{id:"example-prize",oneTime:true,metadata:{event:"first_access"}}]}},flows:{"example-flow":{description:"An example user journey",gates:["example-gate"]}},settings:{dev:{visualizerPort:42195,watcherPort:42196,autoConnect:true}}},{indent:2,lineWidth:-1,noRefs:true,sortKeys:false})}async function P(e){let t=p.resolve(e);return await glob("**/portal.yaml",{cwd:t,absolute:true,ignore:["**/node_modules/**","**/dist/**","**/.git/**"]})}function A(e){let t=[];e.version||t.push({type:"error",message:'Missing required "version" field',path:"version"});let i=new Set;for(let s of e.gates)D(s,i,t),i.add(s.id);for(let s of e.flows)C(s,i,t);return {valid:t.filter(s=>s.type==="error").length===0,issues:t}}function D(e,t,i){let s=`gates.${e.id}`;t.has(e.id)&&i.push({type:"error",message:`Duplicate gate ID: "${e.id}"`,path:s}),/^[a-z][a-z0-9-]*$/.test(e.id)||i.push({type:"warning",message:`Gate ID "${e.id}" should use kebab-case (e.g., "my-gate")`,path:s});let n=new Set;for(let a of e.locks)I(a,n,`${s}.locks`,i),n.add(a.id);let o=new Set;for(let a of e.prizes)o.has(a.id)&&i.push({type:"error",message:`Duplicate prize ID "${a.id}" in gate "${e.id}"`,path:`${s}.prizes`}),o.add(a.id),/^[a-z][a-z0-9-]*$/.test(a.id)||i.push({type:"warning",message:`Prize ID "${a.id}" should use kebab-case`,path:`${s}.prizes`});e.locks.length===0&&i.push({type:"warning",message:`Gate "${e.id}" has no locks - any entity can pass through`,path:s});}function I(e,t,i,s){let n=`${i}.${e.id}`;t.has(e.id)&&s.push({type:"error",message:`Duplicate lock ID: "${e.id}"`,path:n}),/^[a-z][a-z0-9-]*$/.test(e.id)||s.push({type:"warning",message:`Lock ID "${e.id}" should use kebab-case`,path:n}),e.keys.length===0&&s.push({type:"error",message:`Lock "${e.id}" has no keys - it can never be opened`,path:n});for(let o of e.keys)(!o.expression||o.expression.trim()==="")&&s.push({type:"error",message:`Key in lock "${e.id}" has empty expression`,path:`${n}.keys`}),o.expression.includes("==")&&!o.expression.includes("===")&&s.push({type:"warning",message:'Key expression uses "==" instead of "===" - consider using strict equality',path:`${n}.keys`});e.mode&&!["all","any"].includes(e.mode)&&s.push({type:"error",message:`Invalid lock mode "${e.mode}" - must be "all" or "any"`,path:n});}function C(e,t,i){let s=`flows.${e.id}`;/^[a-z][a-z0-9-]*$/.test(e.id)||i.push({type:"warning",message:`Flow ID "${e.id}" should use kebab-case`,path:s});for(let o of e.gates)t.has(o)||i.push({type:"error",message:`Flow "${e.id}" references unknown gate "${o}"`,path:`${s}.gates`});e.gates.length===0&&i.push({type:"warning",message:`Flow "${e.id}" has no gates`,path:s});let n=new Set;for(let o of e.gates)n.has(o)&&i.push({type:"warning",message:`Flow "${e.id}" contains duplicate gate "${o}"`,path:`${s}.gates`}),n.add(o);}function L(e){if(e.valid&&e.issues.length===0)return "\u2705 Configuration is valid";let t=[],i=e.issues.filter(n=>n.type==="error"),s=e.issues.filter(n=>n.type==="warning");if(i.length>0){t.push(`
|
|
3
|
+
\u274C ${i.length} error(s):`);for(let n of i)t.push(` \u2022 ${n.message}${n.path?` (${n.path})`:""}`);}if(s.length>0){t.push(`
|
|
4
|
+
\u26A0\uFE0F ${s.length} warning(s):`);for(let n of s)t.push(` \u2022 ${n.message}${n.path?` (${n.path})`:""}`);}return e.valid?t.push(`
|
|
5
|
+
\u2705 Configuration is valid (with warnings)`):t.push(`
|
|
6
|
+
\u274C Configuration is invalid`),t.join(`
|
|
7
|
+
`)}function R(e){if(e instanceof c.YAMLException){let t=(e.reason||"").toLowerCase();return t.includes("duplicated mapping key")||t.includes("duplicate mapping key")?{errorClass:"duplicate-key",detail:"duplicate mapping key"}:["unexpected","expected","bad indentation","mapping values","cannot read a block mapping entry","end of the stream","while scanning","while parsing"].some(s=>t.includes(s))?{errorClass:"syntax",detail:"yaml syntax error"}:{errorClass:"other",detail:"yaml parse error"}}return {errorClass:"other",detail:"yaml parse error"}}export{F as a,k as b,S as c,E as d,P as e,A as f,L as g,R as h};
|
|
@@ -421,7 +421,7 @@ import m from'chalk';import Ze from'sql.js';import {v4}from'uuid';import*as S fr
|
|
|
421
421
|
SELECT id FROM events ORDER BY timestamp ASC LIMIT ?
|
|
422
422
|
)`,[t]),this.save(),t}rowToGenericEvent(e,n){let t={};return e.forEach((s,r)=>{t[s]=n[r];}),{id:t.id,schemaId:t.schema_id,eventType:t.event_type,category:t.category,timestamp:t.timestamp,scopeValue:t.scope_value||void 0,scopeOrdinal:t.scope_ordinal!=null?t.scope_ordinal:void 0,sessionId:t.session_id||void 0,service:t.service,data:t.data_json?JSON.parse(t.data_json):void 0,severity:t.severity||"info",parentEventId:t.parent_event_id||void 0,depth:t.depth||0}}close(){this.db&&(this.save(),this.db.close(),this.db=null);}};var nt={minScore:30,maxResults:5,boostConfidence:true},q=class{constructor(e){this.storage=e;}match(e,n={}){let{minScore:t,maxResults:s,boostConfidence:r}={...nt,...n},i=this.storage.getAllPatterns({includePrivate:true}),a=[];for(let c of i){if(!this.matchEnvironment(c,e))continue;let{score:l,matchedCriteria:d}=this.scoreMatch(c,e);if(l>=t){let u=l;if(r){let g=c.confidence.score/100;u=l*(.5+.5*g);}a.push({pattern:c,score:l,matchedCriteria:d,confidence:Math.round(u)}),this.storage.updatePatternConfidence(c.id,"matched");}}return a.sort((c,l)=>l.confidence-c.confidence).slice(0,s)}testPattern(e,n=100){let t=this.storage.getRecentIncidents({limit:n}),s=[],r=0;for(let i of t){if(!this.matchEnvironment(e,i))continue;let{score:a}=this.scoreMatch(e,i);a>=30&&(s.push(i),r+=a);}return {wouldMatch:s,matchCount:s.length,avgScore:s.length>0?Math.round(r/s.length):0}}scoreMatch(e,n){let t=0,s={symbols:[],errorKeywords:[],missingSignals:[]},r=this.matchSymbols(e.pattern.symbols,n.symbols,s.symbols);t+=Math.min(r,50);let i=this.matchErrorText(e,n,s.errorKeywords);t+=Math.min(i,25);let a=this.matchMissingSignals(e,n,s.missingSignals);return t+=Math.min(a,25),t=Math.min(t,100),{score:t,matchedCriteria:s}}matchSymbols(e,n,t){let s=0,r=["feature","component","flow","gate","signal","state","integration"];for(let i of r){let a=e[i],c=n[i];if(!(!a||!c)){if(typeof a=="string")this.matchSingleSymbol(a,c)&&(s+=a.includes("*")?5:10,t.push(i));else if(Array.isArray(a)){for(let l of a)if(this.matchSingleSymbol(l,c)){s+=7,t.push(i);break}}}}return s}matchSingleSymbol(e,n){if(e==="*")return true;if(e.endsWith("*")){let t=e.slice(0,-1);return n.startsWith(t)}if(e.startsWith("*")){let t=e.slice(1);return n.endsWith(t)}return e.includes("*")?new RegExp("^"+e.replace(/\*/g,".*")+"$").test(n):e===n}matchErrorText(e,n,t){let s=0,r=n.error.message.toLowerCase(),i=n.error.type?.toLowerCase();if(e.pattern.errorContains)for(let a of e.pattern.errorContains)r.includes(a.toLowerCase())&&(s+=5,t.push(a));if(e.pattern.errorMatches)try{new RegExp(e.pattern.errorMatches,"i").test(n.error.message)&&(s+=10,t.push(`regex:${e.pattern.errorMatches}`));}catch{}if(e.pattern.errorType&&i)for(let a of e.pattern.errorType)i.includes(a.toLowerCase())&&(s+=5,t.push(`type:${a}`));return s}matchMissingSignals(e,n,t){if(!e.pattern.missingSignals||!n.flowPosition?.missing)return 0;let s=0;for(let r of e.pattern.missingSignals)for(let i of n.flowPosition.missing)if(this.matchSingleSymbol(r,i)){s+=12,t.push(i);break}return s}matchEnvironment(e,n){return !e.pattern.environment||e.pattern.environment.length===0?true:e.pattern.environment.includes(n.environment)}};var G=class{constructor(e){this.storage=e;}getStats(e=7){let n=new Date().toISOString(),t=new Date(Date.now()-e*24*60*60*1e3).toISOString();return this.storage.getStats({start:t,end:n})}getSymbolHealth(e){return this.storage.getSymbolHealth(e)}getTrendingIssues(e=7){let n=Date.now(),t=e*24*60*60*1e3/2,s=new Date(n-e*24*60*60*1e3).toISOString(),r=new Date(n-t).toISOString(),i=new Date(n).toISOString(),a=this.storage.getRecentIncidents({dateFrom:s,dateTo:r,limit:1e3}),c=this.storage.getRecentIncidents({dateFrom:r,dateTo:i,limit:1e3}),l=this.countSymbols(a),d=this.countSymbols(c),u=[],g=new Set([...l.keys(),...d.keys()]);for(let p of g){let y=l.get(p)||0,f=d.get(p)||0;if(y===0&&f>0)u.push({symbol:p,trend:f*100});else if(y>0){let T=(f-y)/y*100;u.push({symbol:p,trend:T});}}return u.filter(p=>p.trend>0).sort((p,y)=>y.trend-p.trend).slice(0,10)}getResolutionMetrics(){let e=this.getStats(30);return {avgTimeToResolve:e.resolution.avgTimeToResolve,resolvedWithPattern:e.resolution.resolvedWithPattern,resolvedManually:e.resolution.resolvedManually,totalResolved:e.incidents.resolved,resolutionRate:e.resolution.resolutionRate}}getPatternEffectiveness(){return this.storage.getAllPatterns({includePrivate:true}).filter(n=>n.confidence.timesMatched>0).map(n=>({patternId:n.id,name:n.name,matches:n.confidence.timesMatched,resolutions:n.confidence.timesResolved,recurrences:n.confidence.timesRecurred,effectiveness:n.confidence.timesMatched>0?Math.round((n.confidence.timesResolved-n.confidence.timesRecurred)/n.confidence.timesMatched*100):0})).sort((n,t)=>t.effectiveness-n.effectiveness)}getIncidentsByHour(e=7){let n=new Date(Date.now()-e*24*60*60*1e3).toISOString(),t=this.storage.getRecentIncidents({dateFrom:n,limit:1e4}),s=new Map;for(let r=0;r<24;r++)s.set(r,0);for(let r of t){let i=new Date(r.timestamp).getHours();s.set(i,(s.get(i)||0)+1);}return Array.from(s.entries()).map(([r,i])=>({hour:r,count:i}))}getIncidentsByEnvironment(){let e=this.getStats(30),n=e.incidents.total;return Object.entries(e.incidents.byEnvironment).map(([t,s])=>({environment:t,count:s,percentage:n>0?Math.round(s/n*100):0})).sort((t,s)=>s.count-t.count)}getSymbolCorrelation(){let e=this.storage.getRecentIncidents({limit:1e3}),n=new Map,t=new Map;for(let r of e){let i=this.getSymbolsFromIncident(r);for(let a of i)t.set(a,(t.get(a)||0)+1);for(let a=0;a<i.length;a++)for(let c=a+1;c<i.length;c++){let l=[i[a],i[c]].sort().join("|");n.set(l,(n.get(l)||0)+1);}}let s=[];for(let[r,i]of n){let[a,c]=r.split("|"),l=t.get(a)||1,d=t.get(c)||1,u=i/Math.max(l,d);u>.3&&s.push({symbol1:a,symbol2:c,correlation:Math.round(u*100)/100});}return s.sort((r,i)=>i.correlation-r.correlation).slice(0,20)}generateDashboard(e=7){let n=this.getStats(e),t=[];t.push("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"),t.push("\u2551 PARADIGM SENTINEL DASHBOARD \u2551"),t.push("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563");let s=n.incidents.byDay[n.incidents.byDay.length-1]?.count||0;t.push(`\u2551 Open: ${String(n.incidents.open).padEnd(4)} \u2502 Investigating: ${String(n.incidents.total-n.incidents.open-n.incidents.resolved).padEnd(3)} \u2502 Resolved: ${String(n.incidents.resolved).padEnd(4)} \u2502 Today: +${s} \u2551`),t.push("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"),t.push(""),t.push("Incidents by Day (last 7 days):"),t.push("\u2500".repeat(50));let r=Math.max(...n.incidents.byDay.map(i=>i.count),1);for(let i of n.incidents.byDay.slice(-7)){let a=Math.round(i.count/r*30),c="\u2588".repeat(a);t.push(`${i.date.substring(5)} ${c} ${i.count}`);}t.push(""),t.push("Most Affected Symbols:"),t.push("\u2500".repeat(50));for(let{symbol:i,count:a}of n.symbols.mostIncidents.slice(0,5))t.push(` ${i.padEnd(25)} ${a} incidents`);t.push(""),t.push("Top Patterns:"),t.push("\u2500".repeat(50));for(let{patternId:i,resolvedCount:a}of n.patterns.mostEffective.slice(0,5))t.push(` ${i.padEnd(25)} ${a} resolved`);return t.push(""),t.push("Resolution Stats:"),t.push("\u2500".repeat(50)),t.push(` Resolution rate: ${Math.round(n.resolution.resolutionRate)}%`),t.push(` With pattern: ${n.resolution.resolvedWithPattern}`),t.push(` Manual: ${n.resolution.resolvedManually}`),t.join(`
|
|
423
423
|
`)}countSymbols(e){let n=new Map;for(let t of e)for(let[,s]of Object.entries(t.symbols))s&&n.set(s,(n.get(s)||0)+1);return n}getSymbolsFromIncident(e){let n=[];for(let[,t]of Object.entries(e.symbols))t&&n.push(t);return n}};var W=class{build(e){if(!e.flowPosition)return null;let n=[],t=new Date(e.timestamp).getTime();n.push({timestamp:new Date(t-5e3).toISOString(),symbol:e.flowPosition.flowId,type:"flow-started"});let s=1e3;for(let i of e.flowPosition.actual){let a=this.inferEventType(i);n.push({timestamp:new Date(t-4e3+s).toISOString(),symbol:i,type:a}),s+=Math.random()*1e3+500;}let r=e.flowPosition.failedAt||e.flowPosition.missing[0]||e.symbols.gate||e.symbols.signal||"unknown";return n.push({timestamp:e.timestamp,symbol:r,type:"error",data:{message:e.error.message,missing:e.flowPosition.missing}}),{incidentId:e.id,flowId:e.flowPosition.flowId,events:n,failure:{at:e.timestamp,symbol:r,reason:e.error.message}}}renderAscii(e){let n=[];n.push(`${e.flowId} Timeline`),n.push("\u2550".repeat(40)),n.push("");for(let s of e.events){let r=this.formatTime(s.timestamp),i=this.getEventIcon(s.type),a=this.getEventStatus(s.type),c=`${r} ${i} ${s.symbol}`;a&&(c+=` (${a})`),n.push(c),s.type==="error"&&s.data&&(n.push(` \u2514\u2500 ${s.data.message}`),s.data.missing&&Array.isArray(s.data.missing)&&s.data.missing.length>0&&n.push(` \u2514\u2500 Expected: ${s.data.missing.join(", ")}`));}let t=e.events.find(s=>s.type==="error")?.data?.missing;return t&&t.length>0&&(n.push(""),n.push(`Missing signals: ${t.join(", ")}`)),n.join(`
|
|
424
|
-
`)}renderStructured(e){return {incidentId:e.incidentId,flow:{id:e.flowId,eventCount:e.events.length},events:e.events.map(n=>({time:this.formatTime(n.timestamp),symbol:n.symbol,type:n.type,status:this.getEventStatus(n.type),data:n.data})),failure:{at:this.formatTime(e.failure.at),symbol:e.failure.symbol,reason:e.failure.reason}}}inferEventType(e){return e.startsWith("^")?"gate-passed":e.startsWith("!")?"signal-emitted":e.startsWith("%")?"state-changed":"signal-emitted"}getEventIcon(e){switch(e){case "flow-started":return "\u25B6";case "flow-ended":return "\u25A0";case "gate-passed":return "\u2713";case "gate-failed":return "\u2717";case "signal-emitted":return "\u26A1";case "state-changed":return "\u25C6";case "error":return "\u2717";default:return "\u2022"}}getEventStatus(e){switch(e){case "gate-passed":return "PASSED";case "gate-failed":return "FAILED";case "signal-emitted":return "EMITTED";case "state-changed":return "CHANGED";case "error":return "ERROR";default:return ""}}formatTime(e){let n=new Date(e),t=String(n.getHours()).padStart(2,"0"),s=String(n.getMinutes()).padStart(2,"0"),r=String(n.getSeconds()).padStart(2,"0"),i=String(n.getMilliseconds()).padStart(3,"0");return `${t}:${s}:${r}.${i}`}};var rt=fileURLToPath(import.meta.url),Ne=S.dirname(rt);function it(){let o=S.join(Ne,"universal-patterns.json"),e=E.readFileSync(o,"utf-8");return JSON.parse(e)}function ot(){let o=S.join(Ne,"paradigm-patterns.json"),e=E.readFileSync(o,"utf-8");return JSON.parse(e)}function Oe(){let o=it(),e=ot();return {version:"1.0.0",exportedAt:new Date().toISOString(),patterns:[...o.patterns,...e.patterns]}}var at=process.env.SENTINEL_LOG_LEVEL||process.env.LOG_LEVEL||"info",xe={debug:0,info:1,warn:2,error:3};function A(o){return xe[o]>=xe[at]}function P(o){if(!o)return "";let e=Object.entries(o).map(([n,t])=>`${n}=${typeof t=="string"?t:JSON.stringify(t)}`).join(" ");return m.gray(` ${e}`)}var v={component(o){let e=m.magenta(`#${o}`);return {debug:(n,t)=>{A("debug")&&console.log(`${m.gray("\u25CB")} ${e} ${n}${P(t)}`);},info:(n,t)=>{A("info")&&console.log(`${m.blue("\u2139")} ${e} ${n}${P(t)}`);},warn:(n,t)=>{A("warn")&&console.log(`${m.yellow("\u26A0")} ${e} ${n}${P(t)}`);},error:(n,t)=>{A("error")&&console.error(`${m.red("\u2716")} ${e} ${n}${P(t)}`);}}},flow(o){let e=m.yellow(`$${o}`);return {debug:(n,t)=>{A("debug")&&console.log(`${m.gray("\u25CB")} ${e} ${n}${P(t)}`);},info:(n,t)=>{A("info")&&console.log(`${m.blue("\u2139")} ${e} ${n}${P(t)}`);},warn:(n,t)=>{A("warn")&&console.log(`${m.yellow("\u26A0")} ${e} ${n}${P(t)}`);},error:(n,t)=>{A("error")&&console.error(`${m.red("\u2716")} ${e} ${n}${P(t)}`);}}}},Le=new Set(["$lib","$env","$app","$service-worker","$virtual","$schema","$ref","$id","$type"]);async function Q(o){let e=S.join(o,".paradigm","config.yaml");if(!E.existsSync(e)){let n=S.join(o,"package.json");if(E.existsSync(n))try{return {name:JSON.parse(E.readFileSync(n,"utf-8")).name}}catch{}return {}}try{let n=E.readFileSync(e,"utf-8"),t={},s=n.match(/^name:\s*(.+)$/m);s&&(t.name=s[1].trim().replace(/^["']|["']$/g,""));let r=n.match(/^discipline:\s*(.+)$/m);r&&(t.discipline=r[1].trim());let i=n.match(/^version:\s*(.+)$/m);return i&&(t.version=i[1].trim()),t}catch(n){return v.component("config-loader").error("Failed to load Paradigm config",{error:String(n)}),{}}}async function ct(o){try{let{aggregateFromDirectory:e}=await import('./dist-
|
|
424
|
+
`)}renderStructured(e){return {incidentId:e.incidentId,flow:{id:e.flowId,eventCount:e.events.length},events:e.events.map(n=>({time:this.formatTime(n.timestamp),symbol:n.symbol,type:n.type,status:this.getEventStatus(n.type),data:n.data})),failure:{at:this.formatTime(e.failure.at),symbol:e.failure.symbol,reason:e.failure.reason}}}inferEventType(e){return e.startsWith("^")?"gate-passed":e.startsWith("!")?"signal-emitted":e.startsWith("%")?"state-changed":"signal-emitted"}getEventIcon(e){switch(e){case "flow-started":return "\u25B6";case "flow-ended":return "\u25A0";case "gate-passed":return "\u2713";case "gate-failed":return "\u2717";case "signal-emitted":return "\u26A1";case "state-changed":return "\u25C6";case "error":return "\u2717";default:return "\u2022"}}getEventStatus(e){switch(e){case "gate-passed":return "PASSED";case "gate-failed":return "FAILED";case "signal-emitted":return "EMITTED";case "state-changed":return "CHANGED";case "error":return "ERROR";default:return ""}}formatTime(e){let n=new Date(e),t=String(n.getHours()).padStart(2,"0"),s=String(n.getMinutes()).padStart(2,"0"),r=String(n.getSeconds()).padStart(2,"0"),i=String(n.getMilliseconds()).padStart(3,"0");return `${t}:${s}:${r}.${i}`}};var rt=fileURLToPath(import.meta.url),Ne=S.dirname(rt);function it(){let o=S.join(Ne,"universal-patterns.json"),e=E.readFileSync(o,"utf-8");return JSON.parse(e)}function ot(){let o=S.join(Ne,"paradigm-patterns.json"),e=E.readFileSync(o,"utf-8");return JSON.parse(e)}function Oe(){let o=it(),e=ot();return {version:"1.0.0",exportedAt:new Date().toISOString(),patterns:[...o.patterns,...e.patterns]}}var at=process.env.SENTINEL_LOG_LEVEL||process.env.LOG_LEVEL||"info",xe={debug:0,info:1,warn:2,error:3};function A(o){return xe[o]>=xe[at]}function P(o){if(!o)return "";let e=Object.entries(o).map(([n,t])=>`${n}=${typeof t=="string"?t:JSON.stringify(t)}`).join(" ");return m.gray(` ${e}`)}var v={component(o){let e=m.magenta(`#${o}`);return {debug:(n,t)=>{A("debug")&&console.log(`${m.gray("\u25CB")} ${e} ${n}${P(t)}`);},info:(n,t)=>{A("info")&&console.log(`${m.blue("\u2139")} ${e} ${n}${P(t)}`);},warn:(n,t)=>{A("warn")&&console.log(`${m.yellow("\u26A0")} ${e} ${n}${P(t)}`);},error:(n,t)=>{A("error")&&console.error(`${m.red("\u2716")} ${e} ${n}${P(t)}`);}}},flow(o){let e=m.yellow(`$${o}`);return {debug:(n,t)=>{A("debug")&&console.log(`${m.gray("\u25CB")} ${e} ${n}${P(t)}`);},info:(n,t)=>{A("info")&&console.log(`${m.blue("\u2139")} ${e} ${n}${P(t)}`);},warn:(n,t)=>{A("warn")&&console.log(`${m.yellow("\u26A0")} ${e} ${n}${P(t)}`);},error:(n,t)=>{A("error")&&console.error(`${m.red("\u2716")} ${e} ${n}${P(t)}`);}}}},Le=new Set(["$lib","$env","$app","$service-worker","$virtual","$schema","$ref","$id","$type"]);async function Q(o){let e=S.join(o,".paradigm","config.yaml");if(!E.existsSync(e)){let n=S.join(o,"package.json");if(E.existsSync(n))try{return {name:JSON.parse(E.readFileSync(n,"utf-8")).name}}catch{}return {}}try{let n=E.readFileSync(e,"utf-8"),t={},s=n.match(/^name:\s*(.+)$/m);s&&(t.name=s[1].trim().replace(/^["']|["']$/g,""));let r=n.match(/^discipline:\s*(.+)$/m);r&&(t.discipline=r[1].trim());let i=n.match(/^version:\s*(.+)$/m);return i&&(t.version=i[1].trim()),t}catch(n){return v.component("config-loader").error("Failed to load Paradigm config",{error:String(n)}),{}}}async function ct(o){try{let{aggregateFromDirectory:e}=await import('./dist-JZZJLVMR.js');v.flow("load-symbols").info("Using premise-core aggregator",{path:o});let n=await e(o),t={};for(let s of n.symbols)t[s.type]=(t[s.type]||0)+1;if(v.flow("load-symbols").info("Aggregation complete",{total:n.symbols.length,...t,purposeFiles:n.purposeFiles.length,portalFiles:n.portalFiles.length}),n.errors.length>0)for(let s of n.errors)v.component("aggregator").warn("Aggregation error",{source:s.source,file:s.filePath,message:s.message});for(let s of n.purposeFiles)v.component("purpose-loader").info("Loaded .purpose file",{file:S.relative(o,s)});for(let s of n.portalFiles)v.component("gate-loader").info("Loaded portal.yaml",{file:S.relative(o,s)});return n.symbols}catch(e){return v.component("premise-core").warn("premise-core not available, using fallback scanner",{error:e instanceof Error?e.message:String(e)}),null}}async function $(o){v.flow("load-symbols").info("Loading symbols",{projectDir:o});let e=S.join(o,".paradigm","index.json");if(E.existsSync(e))try{v.component("index-loader").info("Found cached index",{path:e});let t=E.readFileSync(e,"utf-8"),s=JSON.parse(t),r=Array.isArray(s.entries)?s.entries:Array.isArray(s)?s:null;if(r)return v.flow("load-symbols").info("Loaded from cached index",{count:r.length}),r}catch(t){v.component("index-loader").error("Failed to load cached index",{error:String(t)});}let n=await ct(o);return n||(v.flow("load-symbols").info("Using fallback scanner"),lt(o))}async function lt(o){let e=[],n=new Set,t=["src","lib","packages","apps","."];for(let r of t){let i=S.join(o,r);E.existsSync(i)&&await we(i,e,n,o);}let s=S.join(o,"portal.yaml");if(E.existsSync(s)){v.component("gate-loader").debug("Found portal.yaml",{path:"portal.yaml"});try{let i=E.readFileSync(s,"utf-8").match(/^gates:\s*\n((?: .+\n)*)/m);if(i){let a=i[1].matchAll(/^ ([a-z][a-z0-9-]*):/gm);for(let c of a){let l=c[1],d=`gate-${l}`;n.has(d)||(n.add(d),e.push({id:d,symbol:`^${l}`,type:"gate",source:"portal",filePath:"portal.yaml",data:{},references:[],referencedBy:[]}),v.component("gate-loader").debug("Extracted gate",{symbol:`^${l}`}));}}}catch(r){v.component("gate-loader").error("Failed to parse portal.yaml",{error:String(r)});}}return v.flow("load-symbols").info("Fallback scan complete",{count:e.length}),e}async function we(o,e,n,t){let s=["node_modules",".git","dist","build",".paradigm","coverage",".next",".svelte-kit"],r;try{r=E.readdirSync(o,{withFileTypes:!0});}catch{return}for(let i of r){let a=S.join(o,i.name);if(i.isDirectory())s.includes(i.name)||await we(a,e,n,t);else if(i.name===".purpose"){let c=S.relative(t,a);v.component("purpose-loader").debug("Scanning .purpose file",{path:c});try{let l=E.readFileSync(a,"utf-8"),d=ut(l,a,t);for(let u of d)n.has(u.id)||(n.add(u.id),e.push(u),v.component("purpose-loader").debug("Extracted symbol",{symbol:u.symbol,type:u.type,file:c}));}catch(l){v.component("purpose-loader").error("Failed to parse .purpose file",{path:c,error:String(l)});}}}}function ut(o,e,n){let t=[],s=S.relative(n,e),r=o.matchAll(/(?:^|\s)#([a-z][a-z0-9-]*)/gm);for(let d of r){let u=d[1];t.push({id:`component-${u}`,symbol:`#${u}`,type:"component",source:"purpose",filePath:s,data:{},description:dt(o,`#${u}`),references:mt(o),referencedBy:[],tags:gt(o)});}let i=o.matchAll(/\$([a-z][a-z0-9-]*)/gm);for(let d of i){let u=d[1],g=`$${u}`;if(Le.has(g)){v.component("purpose-loader").debug("Skipping blocklisted symbol",{symbol:g});continue}t.find(p=>p.symbol===g)||t.push({id:`flow-${u}`,symbol:g,type:"flow",source:"purpose",filePath:s,data:{},references:[],referencedBy:[]});}let a=o.matchAll(/!([a-z][a-z0-9-]*)/gm);for(let d of a){let u=d[1];t.find(g=>g.symbol===`!${u}`)||t.push({id:`signal-${u}`,symbol:`!${u}`,type:"signal",source:"purpose",filePath:s,data:{},references:[],referencedBy:[]});}let c=o.matchAll(/\^([a-z][a-z0-9-]*)/gm);for(let d of c){let u=d[1];t.find(g=>g.symbol===`^${u}`)||t.push({id:`gate-${u}`,symbol:`^${u}`,type:"gate",source:"purpose",filePath:s,data:{},references:[],referencedBy:[]});}let l=o.matchAll(/~([a-z][a-z0-9-]*)/gm);for(let d of l){let u=d[1];t.find(g=>g.symbol===`~${u}`)||t.push({id:`aspect-${u}`,symbol:`~${u}`,type:"aspect",source:"purpose",filePath:s,data:{},references:[],referencedBy:[]});}return t}function dt(o,e){let n=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*[-:]?\\s*(.+)`,"m"),t=o.match(n);if(t&&t[1])return t[1].trim()}function mt(o){let e=new Set,n=o.matchAll(/[@#$!^~]([a-z][a-z0-9-]*)/g);for(let t of n){let s=t[0];Le.has(s)||e.add(s);}return Array.from(e)}function gt(o){let e=o.match(/tags:\s*\[([^\]]+)\]/);return e?e[1].split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")):[]}async function Z(o){return (await $(o)).length}async function Ce(o,e,n){let s=(await $(o)).find(i=>i.id===e);if(!s)return {success:false,error:"Symbol not found"};let r=S.join(o,s.filePath);if(!E.existsSync(r))return {success:false,error:"Source file not found"};try{let i=E.readFileSync(r,"utf-8"),a=!1;if(n.description!==void 0){let c=s.symbol.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`(${c})\\s*[-:]?\\s*(.*)`,"m");if(i.match(l)){let u=n.description?`${s.symbol}: ${n.description}`:s.symbol;i=i.replace(l,u),a=!0;}}if(n.tags!==void 0){let c=n.tags.length>0?`tags: [${n.tags.map(d=>`"${d}"`).join(", ")}]`:"",l=/^tags:\s*\[[^\]]*\]\s*$/m;if(l.test(i))c?i=i.replace(l,c):i=i.replace(l,""),a=!0;else if(c){let d=s.symbol.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=new RegExp(`(${d}[^\\n]*\\n)`,"m");i.match(u)&&(i=i.replace(u,`$1${c}
|
|
425
425
|
`),a=!0);}}if(a){i=i.replace(/\n{3,}/g,`
|
|
426
426
|
|
|
427
427
|
`),E.writeFileSync(r,i,"utf-8"),v.component("symbol-updater").info("Updated symbol",{symbol:s.symbol,file:s.filePath});let c=S.join(o,".paradigm","index.json");if(E.existsSync(c))try{let l=E.readFileSync(c,"utf-8"),d=JSON.parse(l),u=Array.isArray(d.entries)?d.entries:d,g=u.findIndex(p=>p.id===e);g>=0&&(n.description!==void 0&&(u[g].description=n.description),n.tags!==void 0&&(u[g].tags=n.tags),Array.isArray(d.entries)?(d.entries=u,E.writeFileSync(c,JSON.stringify(d,null,2),"utf-8")):E.writeFileSync(c,JSON.stringify(u,null,2),"utf-8"));}catch{}return {success:!0}}return {success:!0}}catch(i){return v.component("symbol-updater").error("Failed to update symbol",{error:String(i)}),{success:false,error:"Failed to write file"}}}var ft=process.env.SENTINEL_LOG_LEVEL||process.env.LOG_LEVEL||"info",Ae=o=>{let e={debug:0,info:1,warn:2,error:3};return e[o]>=e[ft]},M={gate(o){let e=m.cyan(`^${o}`);return {info:(n,t)=>{if(Ae("info")){let s=t?m.gray(` ${Object.entries(t).map(([r,i])=>`${r}=${i}`).join(" ")}`):"";console.log(`${m.blue("\u2139")} ${e} ${n}${s}`);}},error:(n,t)=>{if(Ae("error")){let s=t?m.gray(` ${Object.entries(t).map(([r,i])=>`${r}=${i}`).join(" ")}`):"";console.error(`${m.red("\u2716")} ${e} ${n}${s}`);}}}}};function ee(o){let e=Router();return e.get("/",async(n,t)=>{try{let s=await $(o);M.gate("api-symbols").info("Symbols loaded",{count:s.length}),t.json({symbols:s});}catch(s){M.gate("api-symbols").error("Failed to load symbols",{error:String(s)}),t.status(500).json({error:"Failed to load symbols"});}}),e.put("/:id",async(n,t)=>{try{let{id:s}=n.params,r=n.body;if(M.gate("api-symbols").info("Update requested",{id:s,updates:JSON.stringify(r)}),r.tags&&!Array.isArray(r.tags)){t.status(400).json({error:"Tags must be an array"});return}let i=await Ce(o,s,r);if(i.success){let c=(await $(o)).find(l=>l.id===s);M.gate("api-symbols").info("Symbol updated",{id:s}),t.json({success:!0,symbol:c});}else M.gate("api-symbols").error("Update failed",{id:s,error:i.error}),t.status(400).json({success:!1,error:i.error});}catch(s){M.gate("api-symbols").error("Failed to update symbol",{error:String(s)}),t.status(500).json({error:"Failed to update symbol"});}}),e}function te(o){let e=Router();return e.get("/",async(n,t)=>{try{let s=await Q(o),r=await Z(o);t.json({projectName:s.name||null,discipline:s.discipline||null,symbolCount:r,projectDir:o});}catch(s){console.error("Failed to load project info:",s),t.status(500).json({error:"Failed to load project info"});}}),e}function vt(o){let e=new Set;for(let n of o){if(n.endsWith(".purpose")){let r=S.dirname(n),i=S.basename(r);r.includes("features/")||r.includes("routes/")||r.includes("api/")?e.add(`@${i}`):r.includes("components/")||r.includes("lib/")||r.includes("utils/")?e.add(`#${i}`):r.includes("middleware/")||r.includes("auth/")||r.includes("guards/")?e.add(`^${i}`):(r.includes("flows/")||r.includes("workflows/"))&&e.add(`$${i}`);}n.includes("portal.yaml")&&e.add("^portal");let t=n.match(/features\/([^/]+)/);t&&e.add(`@${t[1]}`);let s=n.match(/components\/([^/]+)/);s&&e.add(`#${s[1]}`);}return Array.from(e)}async function ne(o,e={}){let n=ht(o);if(!await n.checkIsRepo())return [];try{let s={maxCount:e.limit||100};e.since&&(s["--since"]=e.since);let r=await n.log(s),i=[];for(let a of r.all){let c=[],l=[];try{c=(await n.diffSummary([`${a.hash}^`,a.hash])).files.map(u=>u.file),l=vt(c);}catch{}i.push({hash:a.hash,shortHash:a.hash.slice(0,7),date:a.date,author:a.author_name,message:a.message.split(`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {a,e,d}from'./chunk-QO7YPQXC.js';import'./chunk-5TAVYPOV.js';import*as u from'fs';import*as m from'path';import {execSync}from'child_process';import n from'chalk';import*as w from'js-yaml';function $(s){return s.match(/(?:^|\s)((?:\/|\.\/|[a-zA-Z0-9_-]+\/)[^\s,;:'"]+\.[a-zA-Z]{1,10})\b/)?.[1]}async function R(s,a$1){try{let r=a(s),d$1=[];try{d$1=execSync("git diff --name-only HEAD",{cwd:s,encoding:"utf8",timeout:5e3}).trim().split(`
|
|
3
|
+
`).filter(Boolean);}catch{}let l;try{l=execSync("git status --porcelain",{cwd:s,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let c=m.join(s,"portal.yaml"),f=!1;if(u.existsSync(c))try{let t=u.readFileSync(c,"utf8"),e=w.load(t);f=e?.routes!=null&&Object.keys(e.routes).length>0;}catch{}let i=e({toolsCalled:[],filesModified:d$1,symbolsTouched:[],loreRecorded:!1,hasPortalRoutes:f,taskAddsRoutes:!1,gitClean:l}),o=d(r,a$1,i),g=0;if(o.evaluations.length>0)try{let t=m.join(s,".paradigm","sentinel");if(u.existsSync(t)){let{SentinelStorage:e}=await import('./dist-VGFSP3XM.js'),p=new e(t);for(let b of o.evaluations)p.recordPracticeEvent({habitId:b.habit.id,habitCategory:b.habit.category,result:b.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:[],filesModified:d$1,notes:b.reason}),g++;}}catch{}let h=m.join(s,".paradigm",".habits-blocking");try{if(a$1==="on-stop"&&o.blocksCompletion){let t=o.evaluations.filter(e=>e.result==="skipped"&&e.habit.severity==="block").map(e=>`${e.habit.name}: ${e.reason}`);u.writeFileSync(h,t.join(`
|
|
4
|
+
`),"utf8");}else a$1==="on-stop"&&u.existsSync(h)&&u.unlinkSync(h);}catch{}return {trigger:a$1,evaluation:{total:o.summary.total,followed:o.summary.followed,skipped:o.summary.skipped,partial:o.summary.partial,blockingViolations:o.summary.blockingViolations,blocksCompletion:o.blocksCompletion},habits:o.evaluations.map(t=>({id:t.habit.id,name:t.habit.name,category:t.habit.category,severity:t.habit.severity,result:t.result,reason:t.reason,evidence:t.evidence})),recorded:g}}catch{return null}}async function P(s,a){let r=m.join(s,".paradigm","aspect-graph.db");if(!u.existsSync(r))return {driftedCount:0,healedCount:0,cleanCount:0,missingCount:0,details:[]};try{let{driftCheckCommand:d}=await import('./drift-ILZE5BFJ.js'),l="",c=console.log;console.log=f=>{l=f;};try{await d({json:!0,autoHeal:a});}finally{console.log=c;}return l?JSON.parse(l):null}catch{return null}}async function B(s){if(!u.existsSync(m.join(s,"portal.yaml")))return null;try{let{checkPortalCompliance:a}=await import('./portal-compliance-JONQ4SOP.js'),r=await a(s);return {status:r.status,declaredButUnusedCount:r.declaredButUnused.length,usedButUndeclaredCount:r.usedButUndeclared.length,properlyDeclaredCount:r.properlyDeclared.length,declaredButUnused:r.declaredButUnused,usedButUndeclared:r.usedButUndeclared,properlyDeclared:r.properlyDeclared,portalError:r.portalError,...r.nearMatches&&r.nearMatches.length>0?{suggestions:r.nearMatches.map(d=>({gate:d.gate,didYouMean:d.didYouMean,distance:d.distance}))}:{}}}catch{return null}}async function j(s){try{let{runPostflightLearning:a}=await import('./ambient-NVKQCW2A.js');return await a(s)}catch{return null}}async function A(s){let a=process.cwd(),r=s.trigger||"on-stop",d=s.autoHeal!==false,l=[],c=[],f=await R(a,r),i=await P(a,d),o=await B(a);if(f?.evaluation.blocksCompletion){let t=f.habits.filter(e=>e.result==="skipped"&&e.severity==="block");for(let e of t){let p=`Blocking habit not satisfied: ${e.name} \u2014 ${e.reason}`;l.push(p),c.push({message:p,source:"habits",file:$(e.reason),severity:"blocking"});}}if(i&&i.driftedCount>0){let t=`${i.driftedCount} aspect anchor(s) have drifted (content genuinely changed). Run paradigm_aspect_check to review.`;l.push(t);for(let e of i.details.filter(p=>p.status==="drifted"))c.push({message:`Aspect ~${e.aspectId} drifted at lines ${e.startLine}-${e.endLine}`,source:"drift",file:e.path,severity:"advisory"});c.filter(e=>e.source==="drift").length===0&&c.push({message:t,source:"drift",severity:"advisory"});}if(o&&o.portalError?.kind==="unparseable"){let e=`portal.yaml unparseable: ${o.portalError.errorClass} \u2014 run 'paradigm doctor' for details`;l.push(e),c.push({message:e,source:"portal",file:"portal.yaml",severity:"blocking"});}else if(o&&o.usedButUndeclaredCount>0){let t=o.usedButUndeclared.filter(e=>e!=="__portal_unparseable__");if(t.length>0){let e=`${t.length} gate(s) used in code but not declared in portal.yaml: ${t.join(", ")}`;l.push(e);for(let p of t)c.push({message:`Gate ^${p} used in code but not declared in portal.yaml`,source:"portal",file:"portal.yaml",severity:"blocking"});}}let g=null;s.learn&&(g=await j(a));let h={habits:f,drift:i,portal:o,violations:l,structuredViolations:c,postflight:s.learn?g:void 0};if(s.json)console.log(JSON.stringify(h));else {if(console.log(n.magenta(`
|
|
5
|
+
Paradigm Compliance Check
|
|
6
|
+
`)),f){let{evaluation:t}=f,e=t.blocksCompletion?n.red:n.green;console.log(n.white(" Habits:")),console.log(` ${e(`${t.followed} followed, ${t.skipped} skipped, ${t.partial} partial`)}`),t.blockingViolations>0&&console.log(n.red(` ${t.blockingViolations} blocking violation(s)`)),console.log();}if(i&&(console.log(n.white(" Drift:")),i.healedCount>0&&console.log(n.green(` Auto-healed: ${i.healedCount} shifted anchor(s)`)),i.cleanCount>0&&console.log(n.green(` Clean: ${i.cleanCount} anchor(s)`)),i.driftedCount>0&&console.log(n.red(` Drifted: ${i.driftedCount} anchor(s)`)),i.missingCount>0&&console.log(n.yellow(` Missing: ${i.missingCount} anchor file(s)`)),console.log()),o){console.log(n.white(" Portal:"));let t=o.status==="compliant"?n.green:o.status==="warnings"?n.yellow:n.red;console.log(` Status: ${t(o.status)}`),o.usedButUndeclaredCount>0&&console.log(n.red(` ${o.usedButUndeclaredCount} undeclared gate(s)`)),console.log();}if(g){if(console.log(n.white(" Postflight Learning:")),g.journalsWritten>0){console.log(n.green(` Journals written: ${g.journalsWritten}`));for(let[t,e]of Object.entries(g.journalsByAgent))e>0&&console.log(n.gray(` ${t}: ${e} entries`));}else console.log(n.gray(" No verdicts to learn from"));g.promoted>0&&console.log(n.green(` Promoted to notebooks: ${g.promoted}`)),console.log();}if(l.length>0){console.log(n.red(` ${l.length} violation(s):`));for(let t of l)console.log(n.red(` - ${t}`));}else console.log(n.green(" All checks passed."));console.log();}l.length>0&&(process.exitCode=1);}export{A as complianceCheckCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import'./chunk-5TAVYPOV.js';import {z}from'zod';import*as r from'js-yaml';var p=z.enum(["web","backend","fullstack","api","cli","ml","mobile","game","embedded","devops","data","library","monorepo","custom"]),g=z.enum(["auto","claude","claude-code","cursor-cli","claude-cli","manual"]),i=z.object({name:z.string(),description:z.string(),examples:z.array(z.string()).optional()}).passthrough(),u=z.object({file:z.string().optional(),"core-tags":z.array(z.string()).optional(),"allow-suggestions":z.boolean().optional()}).passthrough(),m=z.object({overview:z.string().optional(),"how-to-use":z.array(z.string()).optional(),"update-rules":z.array(z.string()).optional()}).passthrough(),d=z.object({enforce:z.boolean().optional(),"default-level":z.enum(["debug","info","warn","error"]).optional(),"symbol-mapping":z.record(z.string(),z.string()).optional()}).passthrough(),b=z.object({pattern:z.string(),depth:z.number().optional()}),h=z.object({toolCacheTtlMs:z.number().optional()}).passthrough(),f=z.object({model:z.string().optional(),"context-window":z.number().optional()}).passthrough(),y=z.object({enabled:z.boolean().optional(),"index-file":z.string().optional(),"docs-path":z.string().optional()}).passthrough(),j=z.object({enabled:z.boolean().optional(),"auto-include":z.boolean().optional()}).passthrough(),w=z.object({remote_consent:z.enum(["pending","granted","declined"]).optional(),local_snapshots_enabled:z.boolean().optional()}).passthrough(),v=z.object({version:z.string(),project:z.string(),discipline:p.optional(),"agent-provider":g.optional(),"agent-guidelines":m.optional(),"symbol-system":z.record(z.string(),i).optional(),"tag-bank":u.optional(),component_types:z.record(z.string(),z.string()).optional(),logging:d.optional(),"purpose-required":z.array(b).optional(),conventions:z.array(z.string()).optional(),workspace:z.string().optional(),limits:h.optional(),"ai-agent":f.optional(),context:y.optional(),probe:j.optional(),metrics:w.optional(),states:z.record(z.string(),z.unknown()).optional(),"custom-symbols":z.record(z.string(),i).optional()}).passthrough(),k=new Set(["version","project","discipline","agent-provider","agent-guidelines","symbol-system","tag-bank","component_types","logging","purpose-required","conventions","workspace","limits","ai-agent","context","probe","metrics","states","custom-symbols","docs","features","enforcement","model-resolution"]);function x(l){let s=[],e=[],t;try{t=r.load(l);}catch(n){return {valid:false,warnings:[],errors:[`YAML parse error: ${n.message}`]}}if(!t||typeof t!="object")return {valid:false,warnings:[],errors:["Config must be a YAML object"]};for(let n of Object.keys(t))k.has(n)||s.push(`Unrecognized config key: "${n}"`);let a=v.safeParse(t);if(!a.success)for(let n of a.error.issues){let c=n.path.join(".");e.push(`${c}: ${n.message}`);}return {valid:e.length===0,warnings:s,errors:e}}export{v as paradigmConfigSchema,x as validateConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {m as m$1,o,C,B,r}from'./chunk-
|
|
2
|
+
import {m as m$1,o,C,B,r}from'./chunk-LWAIVOSF.js';import'./chunk-JIXHEBGK.js';import'./chunk-ZJQY5PPP.js';import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as u from'fs';import*as m from'path';import e from'chalk';import F from'ora';function I(t){let o={gates:[],signals:[],components:[],flows:[],aspects:[]};for(let r of t){if(!r||r.length<2)continue;switch(r[0]){case "^":o.gates.push(r);break;case "!":o.signals.push(r);break;case "#":o.components.push(r);break;case "$":o.flows.push(r);break;case "~":o.aspects.push(r);break}}return o}function T(t,o){let r$1={},g={},l=B(t),a=C(t);for(let s of a){let n=I(s.references),i={type:s.type,path:s.filePath,references:s.references,referencedBy:s.referencedBy};s.description&&(i.description=s.description),s.tags&&s.tags.length>0&&(i.tags=s.tags),n.gates.length>0&&(i.gates=n.gates),n.signals.length>0&&(i.signals=n.signals),n.components.length>0&&(i.components=n.components),n.flows.length>0&&(i.flows=n.flows),n.aspects.length>0&&(i.aspects=n.aspects),r$1[s.symbol]=i;}let y=r(t,"flow");for(let s of y){let n=s.data,i=n?.sequence||n?.gates||s.references;g[s.symbol]={description:s.description,sequence:i};}return {version:"1.0",generated:new Date().toISOString(),project:o,stats:{components:l.component,flows:l.flow,gates:l.gate,signals:l.signal,aspects:l.aspect,total:Object.values(l).reduce((s,n)=>s+n,0)},stars:r$1,orbits:g}}async function z(t,o$1={}){let r=process.cwd(),g=t?m.resolve(r,t):r,l=m.basename(g),a$1=o$1.format||"json";o$1.quiet||console.log(e.blue(`
|
|
3
3
|
\u2728 Building Constellation...
|
|
4
4
|
`));let y=F("Aggregating symbols...").start(),s=a.command("constellation").start("Building constellation",{project:l});try{let n=await m$1(g),i=o(n);a.operation("aggregate").debug("Symbols aggregated",{count:C(i).length}),y.text="Building constellation...";let p=T(i,l),$=m.join(g,".paradigm");u.existsSync($)||u.mkdirSync($,{recursive:!0});let h=o$1.output||m.join($,`constellation.${a$1}`),S;if(a$1==="yaml"?S=d(p):S=JSON.stringify(p,null,2),u.writeFileSync(h,S,"utf8"),a.component("constellation-file").success("Constellation written",{path:h,format:a$1}),y.succeed("Constellation built"),s.success("Constellation built",{path:h,stars:Object.keys(p.stars).length}),!o$1.quiet){console.log(e.white(`
|
|
5
5
|
Constellation Stats`)),console.log(e.gray("\u2500".repeat(40)));let f=p.stats,q=[{symbol:"#",name:"Components",count:f.components,color:e.green},{symbol:"$",name:"Flows",count:f.flows,color:e.yellow},{symbol:"^",name:"Gates",count:f.gates,color:e.red},{symbol:"!",name:"Signals",count:f.signals,color:e.cyan},{symbol:"~",name:"Aspects",count:f.aspects,color:e.magenta}];for(let{symbol:c,name:R,count:O,color:E}of q)O>0&&console.log(` ${E(c)} ${R.padEnd(12)} ${e.cyan(O.toString())}`);console.log(e.gray("\u2500".repeat(40))),console.log(` Total stars: ${e.cyan(f.total.toString())}`),console.log(` Total orbits: ${e.cyan(Object.keys(p.orbits).length.toString())}`),console.log(e.gray(`
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import {a}from'./chunk-LKAT7IAK.js';import'./chunk-5TAVYPOV.js';import*as h from'fs';import*as f from'path';import*as v from'js-yaml';var w=["CLAUDE.md",".cursorrules","AGENTS.md"];function k(i){let e=[];for(let r of w){let t=f.join(i,r);if(h.existsSync(t)){let l=h.readFileSync(t,"utf8");e.push({name:r,content:l,lines:l.split(`
|
|
3
3
|
`)});}}return e}function C(i,e){let r=new Set,t=new Set(["node_modules","dist",".git",".paradigm","coverage","build","__pycache__","target",".next",".nuxt"]);function l(n){let u;try{u=h.readdirSync(n,{withFileTypes:!0});}catch{return}let a=false;for(let o of u){if(t.has(o.name))continue;let s=f.join(n,o.name);if(o.isDirectory())l(s);else if(o.isFile()){let c=f.extname(o.name);e.includes(c)&&(a=true);}}a&&r.add(n);}return l(i),r}function S(i,e){let r=i;for(;;){if(h.existsSync(f.join(r,".purpose")))return true;if(r===e)break;let t=f.dirname(r);if(t===r)break;r=t;}return false}async function $(i){let e=[],r=k(i);if(r.length===0)return e.push({check:"stale-references",status:"advisory",message:"No instruction files found (CLAUDE.md, .cursorrules, AGENTS.md)"}),e;let t=/(?:^|\s|`|"|')([.a-zA-Z0-9_-]+(?:\/[.a-zA-Z0-9_*{}-]+)+\/?)/gm,l=/(?:^|\s|`|"|')([a-zA-Z0-9_-]+\.(?:ts|js|py|rs|go|yaml|yml|json|md|toml))\b/gm,n=[],u=new Set;for(let a of r){let o=[],s;for(t.lastIndex=0;(s=t.exec(a.content))!==null;)o.push(s[1]);for(l.lastIndex=0;(s=l.exec(a.content))!==null;)o.push(s[1]);for(let c of o){let d=c.replace(/\/+$/,"").replace(/`/g,"");if(d.startsWith("http")||d.startsWith("//")||d.includes("*")||d.includes("{")||d.startsWith("paradigm://")||d.startsWith("node_modules/")||u.has(d))continue;u.add(d);let p=/\.(ts|js|py|rs|go|yaml|yml|json|md|toml)(?:\/|$)/.test(d),g=/^(\.|src\/|packages\/|lib\/|app\/|docs\/)/.test(d);if(!p&&!g)continue;let y=f.join(i,d);h.existsSync(y)||n.push(`${a.name}: ${d}`);}}return n.length>0?e.push({check:"stale-references",status:"error",message:`${n.length} dead path reference${n.length>1?"s":""} in instruction files`,details:n,fix:"Update or remove dead paths from instruction files"}):e.push({check:"stale-references",status:"ok",message:"All referenced paths exist"}),e}async function A(i){let e=[],r=k(i),t=f.join(i,".paradigm","config.yaml");if(h.existsSync(t)){let o=h.readFileSync(t,"utf8");r.push({name:"config.yaml",content:o,lines:o.split(`
|
|
4
4
|
`)});}if(r.length===0)return e.push({check:"convention-contradictions",status:"ok",message:"No instruction files to check"}),e;let l=[],n=[],u=[[/\bcamelCase\b/i,"camelCase"],[/\bkebab[- ]?case\b/i,"kebab-case"],[/\bsnake[_ ]?case\b/i,"snake_case"],[/\bPascalCase\b/i,"PascalCase"]];for(let o of r)for(let s=0;s<o.lines.length;s++){let c=o.lines[s];for(let[d,p]of u)if(d.test(c)){let g=c.match(/\b(file|variable|function|class|component|symbol|directory|folder|module|import)\s*nam/i),y=g?g[1].toLowerCase():"general";l.push({scope:y,directive:p,source:o.name,line:s+1});}}let a=new Map;for(let o of l){let s=a.get(o.scope)||[];s.push(o),a.set(o.scope,s);}for(let[o,s]of a){let c=new Set(s.map(p=>p.directive)),d=[["camelCase","kebab-case"],["camelCase","snake_case"],["kebab-case","snake_case"]];for(let[p,g]of d)if(c.has(p)&&c.has(g)){let y=s.find(b=>b.directive===p),m=s.find(b=>b.directive===g);n.push(`${o} naming: ${p} (${y.source}:${y.line}) vs ${g} (${m.source}:${m.line})`);}}return n.length>0?e.push({check:"convention-contradictions",status:"warn",message:`${n.length} potential convention contradiction${n.length>1?"s":""}`,details:n,fix:"Reconcile conflicting naming/style conventions in instruction files"}):e.push({check:"convention-contradictions",status:"ok",message:"No contradictions detected"}),e}var R=new Set(["typescript","tsup","vitest","eslint","prettier","rimraf","tsx","ts-node","nodemon","concurrently","husky","lint-staged","unbuild","turbo","lerna","changesets"]),P=["@types/","@typescript-eslint/","@eslint/"];async function j(i){let e=[],r=f.join(i,"package.json");if(!h.existsSync(r))return e.push({check:"undocumented-stack",status:"ok",message:"No package.json found (not a JS/TS project or monorepo root)"}),e;let t;try{t=JSON.parse(h.readFileSync(r,"utf8"));}catch{return e.push({check:"undocumented-stack",status:"advisory",message:"Could not parse package.json"}),e}let l=new Set([...Object.keys(t.dependencies||{}),...Object.keys(t.devDependencies||{})]),n=[];for(let s of l)R.has(s)||P.some(c=>s.startsWith(c))||n.push(s);if(n.length===0)return e.push({check:"undocumented-stack",status:"ok",message:"No major dependencies to document"}),e;let a=k(i).map(s=>s.content).join(`
|
|
5
|
-
`).toLowerCase(),o=[];for(let s of n){let c=s.toLowerCase(),d=s.includes("/")?s.split("/").pop():s;!a.includes(c)&&!a.includes(d.toLowerCase())&&o.push(s);}return o.length>0?e.push({check:"undocumented-stack",status:"advisory",message:`${o.length} dependenc${o.length>1?"ies":"y"} not mentioned in instruction files`,details:o.slice(0,20),fix:"Consider documenting major dependencies in CLAUDE.md for AI context"}):e.push({check:"undocumented-stack",status:"ok",message:"All major dependencies are documented"}),e}async function E(i){let e=[],t=C(i,[".ts",".js",".py",".rs",".go",".tsx",".jsx"]);if(t.size===0)return e.push({check:"purpose-coverage",status:"ok",message:"No source directories found"}),e;let l=0,n=[];for(let o of t)if(S(o,i))l++;else {let s=f.relative(i,o);n.push(s);}let u=t.size,a=Math.round(l/u*100);return a<80?e.push({check:"purpose-coverage",status:"warn",message:`${a}% purpose coverage (${l}/${u} source directories) \u2014 below 80% threshold`,details:n.slice(0,15),fix:"Create .purpose files in uncovered source directories"}):e.push({check:"purpose-coverage",status:"ok",message:`${a}% purpose coverage (${l}/${u} source directories)`}),e}async function N(i){let e=[],r=f.join(i,".paradigm","scan-index.json");if(!h.existsSync(r))return e.push({check:"orphaned-symbols",status:"advisory",message:"No scan-index.json found \u2014 run paradigm scan first"}),e;let t;try{t=JSON.parse(h.readFileSync(r,"utf8"));}catch{return e.push({check:"orphaned-symbols",status:"advisory",message:"Could not parse scan-index.json"}),e}let l=["components","gates","signals","flows","aspects"],n=new Map,u=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object")){for(let[d,p]of Object.entries(c))if(p.symbol&&n.set(p.symbol,d),p.related&&Array.isArray(p.related))for(let g of p.related)u.add(g);}}let a=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object"))for(let[,d]of Object.entries(c))d.symbol&&d.related&&Array.isArray(d.related)&&d.related.length>0&&a.add(d.symbol);}let o=[];for(let[s]of n)!u.has(s)&&!a.has(s)&&o.push(s);return o.length>0?e.push({check:"orphaned-symbols",status:"advisory",message:`${o.length} isolated symbol${o.length>1?"s":""} (no connections to other symbols)`,details:o.slice(0,20),fix:"Wire isolated symbols into features or remove them from .purpose files"}):e.push({check:"orphaned-symbols",status:"ok",message:"All symbols are connected"}),e}async function F(i){let e=[],r=f.join(i,"portal.yaml");if(!h.existsSync(r))return e.push({check:"stale-portal",status:"ok",message:"No portal.yaml found (no routes to check)"}),e;let t;try{t=v.load(h.readFileSync(r,"utf8"));}catch{return e.push({check:"stale-portal",status:"error",message:"Could not parse portal.yaml"}),e}if(!t?.routes||typeof t.routes!="object")return e.push({check:"stale-portal",status:"ok",message:"No routes defined in portal.yaml"}),e;let l=Object.keys(t.routes),n=[],u=[".ts",".js",".py",".rs",".go"],a=[];function o(c){let d=new Set(["node_modules","dist",".git",".paradigm","coverage","build","target"]);try{let p=h.readdirSync(c,{withFileTypes:!0});for(let g of p){if(d.has(g.name))continue;let y=f.join(c,g.name);if(g.isDirectory())o(y);else if(g.isFile()){let m=f.extname(g.name);u.includes(m)&&a.push(y);}}}catch{}}o(i);let s=a.map(c=>({full:c,name:f.basename(c,f.extname(c)).toLowerCase(),relPath:f.relative(i,c).toLowerCase()}));for(let c of l){let p=c.replace(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+/i,"").split("/").filter(m=>m&&!m.startsWith(":")&&m!=="api");if(p.length===0)continue;let g=p[0].toLowerCase();s.some(m=>m.name.includes(g)||m.relPath.includes(g))||n.push(c);}return n.length>0?e.push({check:"stale-portal",status:"error",message:`${n.length} portal route${n.length>1?"s":""} with no matching implementation file`,details:n,fix:"Implement missing route handlers or remove stale routes from portal.yaml"}):e.push({check:"stale-portal",status:"ok",message:`All ${l.length} portal routes have matching implementation files`}),e}var _=[{pattern:/\btry to\b/i,label:"try to"},{pattern:/\bmaybe\b/i,label:"maybe"},{pattern:/\bif possible\b/i,label:"if possible"},{pattern:/\bconsider\b(?!-handoff)/i,label:"consider"},{pattern:/\bmight want to\b/i,label:"might want to"},{pattern:/\byou could\b/i,label:"you could"},{pattern:/\boptionally\b/i,label:"optionally"}];async function T(i){let e=[],r=k(i);if(r.length===0)return e.push({check:"instruction-vagueness",status:"ok",message:"No instruction files to check"}),e;let t=[];for(let l of r)for(let n=0;n<l.lines.length;n++){let u=l.lines[n];if(!u.trimStart().startsWith("```")&&!u.trim().startsWith("|---")){for(let{pattern:a,label:o}of _)if(a.test(u)){let s=u.trim(),c=s.length>80?s.slice(0,77)+"...":s;t.push(`${l.name}:${n+1} \u2014 "${o}" \u2014 ${c}`);}}}return t.length>0?e.push({check:"instruction-vagueness",status:"advisory",message:`${t.length} vague phrase${t.length>1?"s":""} in instruction files`,details:t.slice(0,20),fix:"Replace vague language with clear, actionable directives"}):e.push({check:"instruction-vagueness",status:"ok",message:"No vague language detected"}),e}async function I(i){let e=[],r=f.join(i,".paradigm","config.yaml");if(!h.existsSync(r))return e.push({check:"config-schema-validation",status:"advisory",message:"No .paradigm/config.yaml found"}),e;try{let t=h.readFileSync(r,"utf8"),{validateConfig:l}=await import('./config-schema-
|
|
5
|
+
`).toLowerCase(),o=[];for(let s of n){let c=s.toLowerCase(),d=s.includes("/")?s.split("/").pop():s;!a.includes(c)&&!a.includes(d.toLowerCase())&&o.push(s);}return o.length>0?e.push({check:"undocumented-stack",status:"advisory",message:`${o.length} dependenc${o.length>1?"ies":"y"} not mentioned in instruction files`,details:o.slice(0,20),fix:"Consider documenting major dependencies in CLAUDE.md for AI context"}):e.push({check:"undocumented-stack",status:"ok",message:"All major dependencies are documented"}),e}async function E(i){let e=[],t=C(i,[".ts",".js",".py",".rs",".go",".tsx",".jsx"]);if(t.size===0)return e.push({check:"purpose-coverage",status:"ok",message:"No source directories found"}),e;let l=0,n=[];for(let o of t)if(S(o,i))l++;else {let s=f.relative(i,o);n.push(s);}let u=t.size,a=Math.round(l/u*100);return a<80?e.push({check:"purpose-coverage",status:"warn",message:`${a}% purpose coverage (${l}/${u} source directories) \u2014 below 80% threshold`,details:n.slice(0,15),fix:"Create .purpose files in uncovered source directories"}):e.push({check:"purpose-coverage",status:"ok",message:`${a}% purpose coverage (${l}/${u} source directories)`}),e}async function N(i){let e=[],r=f.join(i,".paradigm","scan-index.json");if(!h.existsSync(r))return e.push({check:"orphaned-symbols",status:"advisory",message:"No scan-index.json found \u2014 run paradigm scan first"}),e;let t;try{t=JSON.parse(h.readFileSync(r,"utf8"));}catch{return e.push({check:"orphaned-symbols",status:"advisory",message:"Could not parse scan-index.json"}),e}let l=["components","gates","signals","flows","aspects"],n=new Map,u=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object")){for(let[d,p]of Object.entries(c))if(p.symbol&&n.set(p.symbol,d),p.related&&Array.isArray(p.related))for(let g of p.related)u.add(g);}}let a=new Set;for(let s of l){let c=t[s];if(!(!c||typeof c!="object"))for(let[,d]of Object.entries(c))d.symbol&&d.related&&Array.isArray(d.related)&&d.related.length>0&&a.add(d.symbol);}let o=[];for(let[s]of n)!u.has(s)&&!a.has(s)&&o.push(s);return o.length>0?e.push({check:"orphaned-symbols",status:"advisory",message:`${o.length} isolated symbol${o.length>1?"s":""} (no connections to other symbols)`,details:o.slice(0,20),fix:"Wire isolated symbols into features or remove them from .purpose files"}):e.push({check:"orphaned-symbols",status:"ok",message:"All symbols are connected"}),e}async function F(i){let e=[],r=f.join(i,"portal.yaml");if(!h.existsSync(r))return e.push({check:"stale-portal",status:"ok",message:"No portal.yaml found (no routes to check)"}),e;let t;try{t=v.load(h.readFileSync(r,"utf8"));}catch{return e.push({check:"stale-portal",status:"error",message:"Could not parse portal.yaml"}),e}if(!t?.routes||typeof t.routes!="object")return e.push({check:"stale-portal",status:"ok",message:"No routes defined in portal.yaml"}),e;let l=Object.keys(t.routes),n=[],u=[".ts",".js",".py",".rs",".go"],a=[];function o(c){let d=new Set(["node_modules","dist",".git",".paradigm","coverage","build","target"]);try{let p=h.readdirSync(c,{withFileTypes:!0});for(let g of p){if(d.has(g.name))continue;let y=f.join(c,g.name);if(g.isDirectory())o(y);else if(g.isFile()){let m=f.extname(g.name);u.includes(m)&&a.push(y);}}}catch{}}o(i);let s=a.map(c=>({full:c,name:f.basename(c,f.extname(c)).toLowerCase(),relPath:f.relative(i,c).toLowerCase()}));for(let c of l){let p=c.replace(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+/i,"").split("/").filter(m=>m&&!m.startsWith(":")&&m!=="api");if(p.length===0)continue;let g=p[0].toLowerCase();s.some(m=>m.name.includes(g)||m.relPath.includes(g))||n.push(c);}return n.length>0?e.push({check:"stale-portal",status:"error",message:`${n.length} portal route${n.length>1?"s":""} with no matching implementation file`,details:n,fix:"Implement missing route handlers or remove stale routes from portal.yaml"}):e.push({check:"stale-portal",status:"ok",message:`All ${l.length} portal routes have matching implementation files`}),e}var _=[{pattern:/\btry to\b/i,label:"try to"},{pattern:/\bmaybe\b/i,label:"maybe"},{pattern:/\bif possible\b/i,label:"if possible"},{pattern:/\bconsider\b(?!-handoff)/i,label:"consider"},{pattern:/\bmight want to\b/i,label:"might want to"},{pattern:/\byou could\b/i,label:"you could"},{pattern:/\boptionally\b/i,label:"optionally"}];async function T(i){let e=[],r=k(i);if(r.length===0)return e.push({check:"instruction-vagueness",status:"ok",message:"No instruction files to check"}),e;let t=[];for(let l of r)for(let n=0;n<l.lines.length;n++){let u=l.lines[n];if(!u.trimStart().startsWith("```")&&!u.trim().startsWith("|---")){for(let{pattern:a,label:o}of _)if(a.test(u)){let s=u.trim(),c=s.length>80?s.slice(0,77)+"...":s;t.push(`${l.name}:${n+1} \u2014 "${o}" \u2014 ${c}`);}}}return t.length>0?e.push({check:"instruction-vagueness",status:"advisory",message:`${t.length} vague phrase${t.length>1?"s":""} in instruction files`,details:t.slice(0,20),fix:"Replace vague language with clear, actionable directives"}):e.push({check:"instruction-vagueness",status:"ok",message:"No vague language detected"}),e}async function I(i){let e=[],r=f.join(i,".paradigm","config.yaml");if(!h.existsSync(r))return e.push({check:"config-schema-validation",status:"advisory",message:"No .paradigm/config.yaml found"}),e;try{let t=h.readFileSync(r,"utf8"),{validateConfig:l}=await import('./config-schema-FLHRVZMI.js'),n=l(t),u=[];for(let a of n.errors)u.push(`Error: ${a}`);for(let a of n.warnings)u.push(`Warning: ${a}`);n.errors.length>0?e.push({check:"config-schema-validation",status:"error",message:`${n.errors.length} schema error${n.errors.length>1?"s":""} in config.yaml`,details:u,fix:"Fix invalid fields in .paradigm/config.yaml"}):n.warnings.length>0?e.push({check:"config-schema-validation",status:"warn",message:`${n.warnings.length} unrecognized key${n.warnings.length>1?"s":""} in config.yaml`,details:u,fix:"Check for typos in .paradigm/config.yaml field names"}):e.push({check:"config-schema-validation",status:"ok",message:"config.yaml schema is valid"});}catch(t){e.push({check:"config-schema-validation",status:"error",message:`Could not validate config.yaml: ${t.message}`});}return e}async function L(i){let e=[],r=[];function t(a){let o=new Set(["node_modules","dist",".git",".paradigm","coverage","build"]);try{let s=h.readdirSync(a,{withFileTypes:!0});for(let c of s){if(o.has(c.name))continue;let d=f.join(a,c.name);c.isDirectory()?t(d):c.name===".purpose"&&r.push(d);}}catch{}}if(t(i),r.length===0)return e.push({check:"purpose-file-health",status:"ok",message:"No .purpose files to check"}),e;let l=[],n=0,u="";for(let a of r)try{let s=h.readFileSync(a,"utf8").split(`
|
|
6
6
|
`).length;if(s>n&&(n=s,u=f.relative(i,a)),s>500){let c=s>1e3?"!!":"!";l.push(`${c} ${f.relative(i,a)} (${s} lines)`);}}catch{continue}return l.length>0?e.push({check:"purpose-file-health",status:"warn",message:`${l.length} oversized .purpose file${l.length>1?"s":""} (largest: ${u} at ${n} lines)`,details:l,fix:"Split large .purpose files by component type or subdirectory"}):e.push({check:"purpose-file-health",status:"ok",message:`${r.length} .purpose files, all under 500 lines`}),e}async function W(i,e){let r=a.command("doctor:context-audit").start("Running context audit checks"),t=[];t.push(...await $(i)),t.push(...await A(i)),t.push(...await j(i)),t.push(...await E(i)),t.push(...await N(i)),t.push(...await F(i)),t.push(...await T(i)),t.push(...await I(i)),t.push(...await L(i));let l=t.filter(a=>a.status==="error").length,n=t.filter(a=>a.status==="warn").length,u=t.filter(a=>a.status==="advisory").length;return l>0?r.error("Context audit found issues",{errors:l,warnings:n,advisories:u}):r.success("Context audit complete",{warnings:n,advisories:u}),t}export{W as runContextAudit};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {e}from'./chunk-JIXHEBGK.js';import {e as e$1}from'./chunk-
|
|
2
|
+
import {e}from'./chunk-JIXHEBGK.js';import {e as e$1}from'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';import*as v from'fs';import*as l from'path';import o from'chalk';import D from'ora';function Q(t){let a=t.length;return Math.ceil(a/3.5)}function f(t,a){try{let s=v.readFileSync(t,"utf8"),m=Buffer.byteLength(s,"utf8"),C=Q(s),r=l.relative(a,t);return {path:t,relativePath:r,tokens:C,bytes:m}}catch{return null}}function i(t){return t<1e3?t.toString():`${(t/1e3).toFixed(1)}k`}async function L(t,a){let s=t?l.resolve(t):process.cwd(),m=D();a.json||console.log(o.blue(`
|
|
3
3
|
\u{1F4B0} Paradigm Cost Analysis
|
|
4
4
|
`)),m.start("Analyzing context files...");let C=await e(s),r=[];for(let e of C){let n=f(e,s);n&&r.push(n);}let A=await e$1(s),y=[];for(let e of A){let n=f(e,s);n&&y.push(n);}let R=l.join(s,".paradigm","scan-index.json"),h=f(R,s),I=l.join(s,".cursorrules"),q=l.join(s,".cursor","rules","paradigm.mdc"),g=f(I,s);g||(g=f(q,s)),m.stop();let x=r.reduce((e,n)=>e+n.tokens,0),F=y.reduce((e,n)=>e+n.tokens,0),b=h?.tokens||0,P=g?.tokens||0,w=x+F+b,u=w+P,T=150,k=T*7,c=u>0?Math.round((1-k/u)*100):0,d=[],M=r.filter(e=>e.tokens>500);M.length>0&&d.push(`${M.length} .purpose file(s) exceed 500 tokens. Consider splitting large features.`);let N=l.join(s,".cursor","mcp.json"),$=v.existsSync(N);$||d.push("MCP not configured. Run `paradigm mcp setup` to enable dynamic context (80%+ savings)."),h||d.push("No scan-index.json found. Run `paradigm index` for visual discovery support."),r.length<3&&d.push("Few .purpose files found. Add more context for better AI understanding.");let O={static:{purposeFiles:r,portalFiles:y,scanIndex:h,cursorrules:g,total:u},dynamic:{avgQueryTokens:T,typicalConversation:k},savings:{percentage:Math.max(0,c),description:c>0?`${c}% fewer tokens with MCP vs static context`:"MCP provides on-demand context loading"},recommendations:d};if(a.json){console.log(JSON.stringify(O,null,2));return}if(console.log(o.white("Context Token Analysis")),console.log(o.gray("\u2500".repeat(50))),console.log(o.cyan(`
|
|
5
5
|
Static Context (loaded every conversation):`)),console.log(` .purpose files (${r.length}):`.padEnd(35)+o.yellow(i(x)+" tokens")),console.log(` portal.yaml (${y.length}):`.padEnd(35)+o.yellow(i(F)+" tokens")),h&&console.log(" scan-index.json:".padEnd(35)+o.yellow(i(b)+" tokens")),g&&console.log(" .cursorrules:".padEnd(35)+o.yellow(i(P)+" tokens")),console.log(o.gray("\u2500".repeat(50))),console.log(" Static Total:".padEnd(35)+o.yellow.bold(i(u)+" tokens")),console.log(o.cyan(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {d,a,c as c$1,b}from'./chunk-W7C6FFMO.js';import'./chunk-4TXOVRWD.js';import {c,d as d$1,e as e$1}from'./chunk-
|
|
2
|
+
import {d,a,c as c$1,b}from'./chunk-W7C6FFMO.js';import'./chunk-4TXOVRWD.js';import {c,d as d$1,e as e$1}from'./chunk-VIG5LSGZ.js';import'./chunk-5TAVYPOV.js';import*as s from'fs';import*as o from'path';import e from'chalk';import j from'ora';async function D(d$2,a$1){let r=d$2?o.resolve(d$2):process.cwd(),t=o.basename(r),u=o.join(r,".paradigm"),i=j();if(!d(r))if(a$1.init){i.start("Creating .paradigm config...");let n=c(t);s.writeFileSync(u,d$1(n),"utf8"),i.succeed(e.green(".paradigm config created"));}else console.log(e.red(`
|
|
3
3
|
\u274C No .paradigm file found.`)),console.log(e.gray(`
|
|
4
4
|
Run with --init to create a default .paradigm config:`)),console.log(e.cyan(` paradigm cursorrules --init
|
|
5
5
|
`)),process.exit(1);let c$2;try{let n=s.readFileSync(u,"utf8");c$2=e$1(n);}catch(n){let b=n;console.log(e.red(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export{g as findDecisionsForSymbol,h as getDecisionSummary,f as loadDecision,e as loadDecisions,a as recordDecision,c as supersedeDecision,b as updateDecision,d as writeCompanionLoreEntry}from'./chunk-Q527BPUF.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {g,i as i$1}from'./chunk-
|
|
2
|
+
import {g,i as i$1}from'./chunk-VNIX5KBT.js';import'./chunk-5TAVYPOV.js';import e from'chalk';async function i(n,r){let l=process.cwd(),o=await g(l,n);if(!o){console.error(e.red(`
|
|
3
3
|
Entry not found: ${n}
|
|
4
4
|
`)),process.exitCode=1;return}if(r.dryRun){console.log(e.cyan(`
|
|
5
5
|
[dry-run] Would delete lore entry:`)),console.log(e.white(` ${o.id} - ${o.title}`)),console.log(e.gray(` Type: ${o.type} | Author: ${o.author} | ${o.timestamp}`)),console.log(e.gray(` Symbols: ${(o.symbols_touched||[]).join(", ")}`)),console.log(e.cyan(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b}from'./chunk-
|
|
2
|
+
import {b}from'./chunk-6SKSV5B2.js';import'./chunk-TYWB5IQJ.js';import'./chunk-WESTEMIM.js';import'./chunk-FYDRENK7.js';import'./chunk-IZSBGW6E.js';import'./chunk-AO7ZSRME.js';import'./chunk-EKZDFEJW.js';import'./chunk-LPBCQM5Y.js';import'./chunk-LWAIVOSF.js';import'./chunk-JIXHEBGK.js';import'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as a from'path';import o from'chalk';async function D(l,f,t){let d=f?a.resolve(f):process.cwd();if(!l){t.json?console.log(JSON.stringify({error:"Orchestration ID required"})):(console.log(o.red(`
|
|
3
3
|
Orchestration ID required.`)),console.log(o.gray(`Usage: paradigm team diff <orchestration-id>
|
|
4
4
|
`)));return}let e=new b(d).getOrchestration(l);if(!e){t.json?console.log(JSON.stringify({error:"Orchestration not found",id:l})):console.log(o.red(`
|
|
5
5
|
Orchestration not found: ${l}
|