claude-flow-novice 2.18.12 → 2.18.14
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/.backups/unknown/1765417503_2999b9ec66f591dd76075617ec31fcea/metadata.json +8 -0
- package/.backups/unknown/1765417503_2999b9ec66f591dd76075617ec31fcea/original +3 -0
- package/.backups/unknown/1765417503_2999b9ec66f591dd76075617ec31fcea/revert.sh +7 -0
- package/.backups/unknown/1765417531_2999b9ec66f591dd76075617ec31fcea/metadata.json +8 -0
- package/.backups/unknown/1765417531_2999b9ec66f591dd76075617ec31fcea/original +3 -0
- package/.backups/unknown/1765417531_2999b9ec66f591dd76075617ec31fcea/revert.sh +7 -0
- package/.backups/unknown/1765417552_2999b9ec66f591dd76075617ec31fcea/metadata.json +8 -0
- package/.backups/unknown/1765417552_2999b9ec66f591dd76075617ec31fcea/original +3 -0
- package/.backups/unknown/1765417552_2999b9ec66f591dd76075617ec31fcea/revert.sh +7 -0
- package/.backups/unknown/1765417613_1f34dbf0fe1ec3b6cb74ba7c4e12a2a4/metadata.json +8 -0
- package/.backups/unknown/1765417613_1f34dbf0fe1ec3b6cb74ba7c4e12a2a4/original +1212 -0
- package/.backups/unknown/1765417613_1f34dbf0fe1ec3b6cb74ba7c4e12a2a4/revert.sh +7 -0
- package/.backups/unknown/1765417613_332e9bb223a26270398922640c1c1653/metadata.json +8 -0
- package/.backups/unknown/1765417613_332e9bb223a26270398922640c1c1653/original +1212 -0
- package/.backups/unknown/1765417613_332e9bb223a26270398922640c1c1653/revert.sh +7 -0
- package/.backups/unknown/1765417613_45880a7afef063347b701e7e88e2df9c/metadata.json +8 -0
- package/.backups/unknown/1765417613_45880a7afef063347b701e7e88e2df9c/original +1212 -0
- package/.backups/unknown/1765417613_45880a7afef063347b701e7e88e2df9c/revert.sh +7 -0
- package/.backups/unknown/1765417614_1b6c3b658c2891dbe245aea4bad41661/metadata.json +8 -0
- package/.backups/unknown/1765417614_1b6c3b658c2891dbe245aea4bad41661/original +1228 -0
- package/.backups/unknown/1765417614_1b6c3b658c2891dbe245aea4bad41661/revert.sh +7 -0
- package/.backups/unknown/1765417614_1ed5bd129f0b5d1b297a04ec5267ef62/metadata.json +8 -0
- package/.backups/unknown/1765417614_1ed5bd129f0b5d1b297a04ec5267ef62/original +1237 -0
- package/.backups/unknown/1765417614_1ed5bd129f0b5d1b297a04ec5267ef62/revert.sh +7 -0
- package/.backups/unknown/1765417614_28e032bd1b62dbfcecbd56327a0b0e23/metadata.json +8 -0
- package/.backups/unknown/1765417614_28e032bd1b62dbfcecbd56327a0b0e23/original +1240 -0
- package/.backups/unknown/1765417614_28e032bd1b62dbfcecbd56327a0b0e23/revert.sh +7 -0
- package/.backups/unknown/1765417614_40a1ce1b0efa2e1ba1958c27b2cbc557/metadata.json +8 -0
- package/.backups/unknown/1765417614_40a1ce1b0efa2e1ba1958c27b2cbc557/original +1216 -0
- package/.backups/unknown/1765417614_40a1ce1b0efa2e1ba1958c27b2cbc557/revert.sh +7 -0
- package/.backups/unknown/1765417614_f65dbf58cff7a9aa1c5c3d0d1618074a/metadata.json +8 -0
- package/.backups/unknown/1765417614_f65dbf58cff7a9aa1c5c3d0d1618074a/original +1238 -0
- package/.backups/unknown/1765417614_f65dbf58cff7a9aa1c5c3d0d1618074a/revert.sh +7 -0
- package/.backups/unknown/1765417615_0f45c28b9b8d5204974421c06075ff74/metadata.json +8 -0
- package/.backups/unknown/1765417615_0f45c28b9b8d5204974421c06075ff74/original +1167 -0
- package/.backups/unknown/1765417615_0f45c28b9b8d5204974421c06075ff74/revert.sh +7 -0
- package/.backups/unknown/1765417615_41d36156891ddb6f63d1b4da59d1db4c/metadata.json +8 -0
- package/.backups/unknown/1765417615_41d36156891ddb6f63d1b4da59d1db4c/original +1242 -0
- package/.backups/unknown/1765417615_41d36156891ddb6f63d1b4da59d1db4c/revert.sh +7 -0
- package/.backups/unknown/1765417709_77dda8631459cfc2ab94b8928f7d90b4/metadata.json +8 -0
- package/.backups/unknown/1765417709_77dda8631459cfc2ab94b8928f7d90b4/original +2 -0
- package/.backups/unknown/1765417709_77dda8631459cfc2ab94b8928f7d90b4/revert.sh +7 -0
- package/.backups/unknown/1765417775_1405837bacf112ba832a139840fe94e7/metadata.json +8 -0
- package/.backups/unknown/1765417775_1405837bacf112ba832a139840fe94e7/original +1169 -0
- package/.backups/unknown/1765417775_1405837bacf112ba832a139840fe94e7/revert.sh +7 -0
- package/.backups/unknown/1765417775_8044b4a5cfdcb5cd71317831ad53f5a2/metadata.json +8 -0
- package/.backups/unknown/1765417775_8044b4a5cfdcb5cd71317831ad53f5a2/original +1171 -0
- package/.backups/unknown/1765417775_8044b4a5cfdcb5cd71317831ad53f5a2/revert.sh +7 -0
- package/.backups/unknown/1765417775_8eb94d60151e1db262377fbf8a187212/metadata.json +8 -0
- package/.backups/unknown/1765417775_8eb94d60151e1db262377fbf8a187212/original +1170 -0
- package/.backups/unknown/1765417775_8eb94d60151e1db262377fbf8a187212/revert.sh +7 -0
- package/.backups/unknown/1765417776_a0d4b709e15e0bfa002c4b128f5e4603/metadata.json +8 -0
- package/.backups/unknown/1765417776_a0d4b709e15e0bfa002c4b128f5e4603/original +1173 -0
- package/.backups/unknown/1765417776_a0d4b709e15e0bfa002c4b128f5e4603/revert.sh +7 -0
- package/.backups/unknown/1765417776_cb1bc24d98b63564eb73ef782b8c68b3/metadata.json +8 -0
- package/.backups/unknown/1765417776_cb1bc24d98b63564eb73ef782b8c68b3/original +1170 -0
- package/.backups/unknown/1765417776_cb1bc24d98b63564eb73ef782b8c68b3/revert.sh +7 -0
- package/.backups/unknown/1765417777_1c4cc8c33f476f0c87c8efd4e34efc22/metadata.json +8 -0
- package/.backups/unknown/1765417777_1c4cc8c33f476f0c87c8efd4e34efc22/original +1172 -0
- package/.backups/unknown/1765417777_1c4cc8c33f476f0c87c8efd4e34efc22/revert.sh +7 -0
- package/.backups/unknown/1765417777_325de83ffd34544909b8b9aa6e18dd05/metadata.json +8 -0
- package/.backups/unknown/1765417777_325de83ffd34544909b8b9aa6e18dd05/original +1175 -0
- package/.backups/unknown/1765417777_325de83ffd34544909b8b9aa6e18dd05/revert.sh +7 -0
- package/.backups/unknown/1765417950_402e7c1a8956b56ac7b88e89f024acb4/metadata.json +8 -0
- package/.backups/unknown/1765417950_402e7c1a8956b56ac7b88e89f024acb4/original +1178 -0
- package/.backups/unknown/1765417950_402e7c1a8956b56ac7b88e89f024acb4/revert.sh +7 -0
- package/.backups/unknown/1765417950_647e27e4da18ae42c339e04b4d334feb/metadata.json +8 -0
- package/.backups/unknown/1765417950_647e27e4da18ae42c339e04b4d334feb/original +1174 -0
- package/.backups/unknown/1765417950_647e27e4da18ae42c339e04b4d334feb/revert.sh +7 -0
- package/.backups/unknown/1765417951_1424d2dd67b8c8a4e7cf649b379d21f2/metadata.json +8 -0
- package/.backups/unknown/1765417951_1424d2dd67b8c8a4e7cf649b379d21f2/original +1194 -0
- package/.backups/unknown/1765417951_1424d2dd67b8c8a4e7cf649b379d21f2/revert.sh +7 -0
- package/.backups/unknown/1765417951_6df070ca287ea94a7f08efc69ec9ea51/metadata.json +8 -0
- package/.backups/unknown/1765417951_6df070ca287ea94a7f08efc69ec9ea51/original +1186 -0
- package/.backups/unknown/1765417951_6df070ca287ea94a7f08efc69ec9ea51/revert.sh +7 -0
- package/.backups/unknown/1765417951_848919a1365f6536e5ef8d85d0c80fa7/metadata.json +8 -0
- package/.backups/unknown/1765417951_848919a1365f6536e5ef8d85d0c80fa7/original +1180 -0
- package/.backups/unknown/1765417951_848919a1365f6536e5ef8d85d0c80fa7/revert.sh +7 -0
- package/.backups/unknown/1765417951_b0d1d4ecf85ad10cda0f3900d414b608/metadata.json +8 -0
- package/.backups/unknown/1765417951_b0d1d4ecf85ad10cda0f3900d414b608/original +1198 -0
- package/.backups/unknown/1765417951_b0d1d4ecf85ad10cda0f3900d414b608/revert.sh +7 -0
- package/.backups/unknown/1765417952_2b720e213b5197cbaad53f9f0857f23f/metadata.json +8 -0
- package/.backups/unknown/1765417952_2b720e213b5197cbaad53f9f0857f23f/original +1202 -0
- package/.backups/unknown/1765417952_2b720e213b5197cbaad53f9f0857f23f/revert.sh +7 -0
- package/.backups/unknown/1765417952_ef1d15e8b83a802a0c0f0fc03e56a89c/metadata.json +8 -0
- package/.backups/unknown/1765417952_ef1d15e8b83a802a0c0f0fc03e56a89c/original +1202 -0
- package/.backups/unknown/1765417952_ef1d15e8b83a802a0c0f0fc03e56a89c/revert.sh +7 -0
- package/.backups/unknown/1765418048_ac94238a69a6f86a6ba9d31f623c18a7/metadata.json +8 -0
- package/.backups/unknown/1765418048_ac94238a69a6f86a6ba9d31f623c18a7/original +1209 -0
- package/.backups/unknown/1765418048_ac94238a69a6f86a6ba9d31f623c18a7/revert.sh +7 -0
- package/.backups/unknown/1765418048_f3afed98da63fef9ff57fb5646976f63/metadata.json +8 -0
- package/.backups/unknown/1765418048_f3afed98da63fef9ff57fb5646976f63/original +1207 -0
- package/.backups/unknown/1765418048_f3afed98da63fef9ff57fb5646976f63/revert.sh +7 -0
- package/.backups/unknown/1765418049_9c392702a4e1cace37d17f6f2dfaf54e/metadata.json +8 -0
- package/.backups/unknown/1765418049_9c392702a4e1cace37d17f6f2dfaf54e/original +1207 -0
- package/.backups/unknown/1765418049_9c392702a4e1cace37d17f6f2dfaf54e/revert.sh +7 -0
- package/.backups/unknown/1765418049_9e0777555b51dea4d24d0503b584cfc5/metadata.json +8 -0
- package/.backups/unknown/1765418049_9e0777555b51dea4d24d0503b584cfc5/original +1193 -0
- package/.backups/unknown/1765418049_9e0777555b51dea4d24d0503b584cfc5/revert.sh +7 -0
- package/.backups/unknown/1765418050_22d534bed68f9f5d883bee54e7cbc4d3/metadata.json +8 -0
- package/.backups/unknown/1765418050_22d534bed68f9f5d883bee54e7cbc4d3/original +1194 -0
- package/.backups/unknown/1765418050_22d534bed68f9f5d883bee54e7cbc4d3/revert.sh +7 -0
- package/.backups/unknown/1765418051_d9243722dc90dabc851c5767a62ac7f2/metadata.json +8 -0
- package/.backups/unknown/1765418051_d9243722dc90dabc851c5767a62ac7f2/original +1193 -0
- package/.backups/unknown/1765418051_d9243722dc90dabc851c5767a62ac7f2/revert.sh +7 -0
- package/.backups/unknown/1765418177_21a2fa816d25d419b54ef2d429aab474/metadata.json +8 -0
- package/.backups/unknown/1765418177_21a2fa816d25d419b54ef2d429aab474/original +1191 -0
- package/.backups/unknown/1765418177_21a2fa816d25d419b54ef2d429aab474/revert.sh +7 -0
- package/.backups/unknown/1765418177_33b673dce1eb59d7eb4f752aec882794/metadata.json +8 -0
- package/.backups/unknown/1765418177_33b673dce1eb59d7eb4f752aec882794/original +1190 -0
- package/.backups/unknown/1765418177_33b673dce1eb59d7eb4f752aec882794/revert.sh +7 -0
- package/.backups/unknown/1765418177_72568812ea5a73cf6861a6b14da065fa/metadata.json +8 -0
- package/.backups/unknown/1765418177_72568812ea5a73cf6861a6b14da065fa/original +1191 -0
- package/.backups/unknown/1765418177_72568812ea5a73cf6861a6b14da065fa/revert.sh +7 -0
- package/.backups/unknown/1765418178_20c28b95f12194fe4b81cfb35f4f3757/metadata.json +8 -0
- package/.backups/unknown/1765418178_20c28b95f12194fe4b81cfb35f4f3757/original +1189 -0
- package/.backups/unknown/1765418178_20c28b95f12194fe4b81cfb35f4f3757/revert.sh +7 -0
- package/.backups/unknown/1765418178_cdf68719cc09173769027743e2718ad4/metadata.json +8 -0
- package/.backups/unknown/1765418178_cdf68719cc09173769027743e2718ad4/original +1197 -0
- package/.backups/unknown/1765418178_cdf68719cc09173769027743e2718ad4/revert.sh +7 -0
- package/.backups/unknown/1765418178_eb19e0f8542405480e51af09fad84b71/metadata.json +8 -0
- package/.backups/unknown/1765418178_eb19e0f8542405480e51af09fad84b71/original +1190 -0
- package/.backups/unknown/1765418178_eb19e0f8542405480e51af09fad84b71/revert.sh +7 -0
- package/.backups/unknown/1765418236_c016507725847318a3c369b047cbb802/metadata.json +8 -0
- package/.backups/unknown/1765418236_c016507725847318a3c369b047cbb802/original +1197 -0
- package/.backups/unknown/1765418236_c016507725847318a3c369b047cbb802/revert.sh +7 -0
- package/.backups/unknown/1765418237_932c3cc3a5c537b7933c2370b65f4b39/metadata.json +8 -0
- package/.backups/unknown/1765418237_932c3cc3a5c537b7933c2370b65f4b39/original +1197 -0
- package/.backups/unknown/1765418237_932c3cc3a5c537b7933c2370b65f4b39/revert.sh +7 -0
- package/.claude/agents/cfn-dev-team/utility/epic-creator-v2.md +194 -2
- package/.claude/agents/cfn-dev-team/utility/epic-creator-v2.sh +264 -0
- package/.claude/agents/cfn-dev-team/utility/epic-creator-v2.sh.backup +698 -0
- package/.claude/agents/custom/claude-code-expert.md +56 -0
- package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/SKILL.md +1 -1
- package/.claude/hooks/README.md +148 -0
- package/.claude/hooks/SessionStart:cfn-load-openai-key.sh +35 -0
- package/.claude/hooks/cfn-invoke-pre-edit.sh +1 -1
- package/.claude/hooks/cfn-load-cerebras-env.sh +65 -0
- package/.claude/hooks/cfn-precompact-enhanced.sh +283 -0
- package/.claude/hooks/deprecated/README.md +27 -0
- package/.claude/settings.json +71 -6
- package/.claude/skills/cfn-agent-lifecycle/SKILL.md +1 -1
- package/.claude/skills/cfn-agent-tooling/SKILL.md +1 -1
- package/.claude/skills/cfn-cerebras-coordinator/QUICKSTART.md +348 -0
- package/.claude/skills/cfn-cerebras-coordinator/README.md +525 -0
- package/.claude/skills/cfn-cerebras-coordinator/TDD_COORDINATOR_OVERVIEW.md +284 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-py-v2-test-1733854200.json +36 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-py-v3-test-1765383241.json +36 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-rust-v2-test-1765381361.json +36 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-rust-v3-test-1765383242.json +46 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v2-test-1733864400.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v3-test-1765383238.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v4-test-1765386506.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v5-test-1765393100.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/example-usage.sh +206 -0
- package/.claude/skills/cfn-cerebras-coordinator/lib/tdd-conversation-coordinator.ts +569 -0
- package/.claude/skills/cfn-cerebras-coordinator/test-tdd-coordinator.sh +250 -0
- package/.claude/skills/cfn-compilation-error-fixer/SKILL.md +1 -1
- package/.claude/skills/cfn-compilation-error-fixer/lib/fixer/cerebras-gated-fixer-v2.ts +1 -1
- package/.claude/skills/cfn-config/SKILL.md +1 -1
- package/.claude/skills/cfn-dependency-management/SKILL.md +1 -1
- package/.claude/skills/cfn-deployment-lifecycle/SKILL.md +1 -1
- package/.claude/skills/cfn-edit-safety/SKILL.md +1 -1
- package/.claude/skills/cfn-epic-creator/SKILL.md +392 -0
- package/.claude/skills/cfn-epic-creator/estimate-costs.sh +524 -0
- package/.claude/skills/cfn-epic-creator/invoke.sh +445 -0
- package/.claude/skills/cfn-epic-creator/parse-personas.sh +533 -0
- package/.claude/skills/cfn-epic-creator/security-utils.sh +268 -0
- package/.claude/skills/cfn-epic-creator/security-verification-demo.sh +127 -0
- package/.claude/skills/cfn-epic-creator/test-invoke.sh +620 -0
- package/.claude/skills/cfn-epic-creator/test-security-fixes.sh +195 -0
- package/.claude/skills/cfn-epic-creator/test-security-simple.sh +165 -0
- package/.claude/skills/cfn-epic-creator/validate-epic.sh +474 -0
- package/.claude/skills/cfn-epic-parser/SKILL.md +8 -0
- package/.claude/skills/cfn-error-management/SKILL.md +1 -1
- package/.claude/skills/cfn-intervention-system/SKILL.md +1 -1
- package/.claude/skills/cfn-knowledge-base/SKILL.md +1 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/.backups/unknown/1765358428_2cf0ad7377232c919ff0a65630cb307d/metadata.json +8 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/.backups/unknown/1765358428_2cf0ad7377232c919ff0a65630cb307d/original +209 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/.backups/unknown/1765358428_2cf0ad7377232c919ff0a65630cb307d/revert.sh +7 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/AGENT_INTEGRATION_PATTERNS.md +255 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/Cargo.toml +8 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/Cargo.toml.backup +47 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/EXTRACTION_EXAMPLES.md +287 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/README.md +2 -563
- package/.claude/skills/cfn-local-ruvector-accelerator/SCHEMA_V2_IMPLEMENTATION.md +151 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/SECURITY_IMPLEMENTATION.md +185 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/SKILL.md +8 -343
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/EXECUTIVE_SUMMARY.txt +90 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/PHASE_4_QUERY_API.md +210 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/RUST_AST_EXTRACTOR_IMPLEMENTATION.md +222 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/TRANSACTION_MANAGEMENT.md +241 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/VALIDATION_FINDINGS.txt +250 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/epic-ast-indexer.json +335 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/index-code.sh +292 -96
- package/.claude/skills/cfn-local-ruvector-accelerator/index-code.sh.backup +249 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/index_all.sh +65 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/find.rs +214 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index.rs +275 -94
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index_ast.rs +767 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index_modified.rs +37 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/init.rs +17 -12
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/migration.rs +34 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/mod.rs +6 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/query.rs +2 -2
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/refs.rs +209 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/embeddings.rs +82 -33
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/mod.rs +251 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/rust.rs +425 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/rust_placeholder.rs +420 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/text_fallback.rs +490 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/typescript.rs +520 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/typescript_full.rs +531 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/lib.rs +20 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/main.rs +33 -2
- package/.claude/skills/cfn-local-ruvector-accelerator/src/main.rs.backup +360 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/migration.rs +325 -318
- package/.claude/skills/cfn-local-ruvector-accelerator/src/migration_backup.rs +325 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/migration_tx.rs +513 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/paths.rs +29 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/query_api.rs +609 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/schema_v2.rs +603 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/search_engine.rs +150 -29
- package/.claude/skills/cfn-local-ruvector-accelerator/src/security_tests.rs +154 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/sqlite_store.rs +1 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2.rs +583 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2_backup.rs +560 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2_fixed.rs +0 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2_tx.rs +397 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/test_schema.rs +228 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/transaction_tests.rs +410 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_ast_indexing.rs +59 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_query_api.sh +103 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_schema.sql +158 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_schema_v2.sql +147 -0
- package/.claude/skills/cfn-loop-orchestration-v2/SKILL.md +1 -1
- package/.claude/skills/cfn-loop-orchestration-v2/lib/decision/SKILL.md +8 -0
- package/.claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/SKILL.md +1 -1
- package/.claude/skills/cfn-loop-orchestration-v2/lib/output/SKILL.md +8 -0
- package/.claude/skills/cfn-loop-orchestration-v2/lib/validation/SKILL.md +11 -2
- package/.claude/skills/cfn-mdap-context-injection/SKILL.md +31 -10
- package/.claude/skills/cfn-mdap-error-fixer/skill.md +15 -205
- package/.claude/skills/cfn-memory-persistence/lib/auto/SKILL.md +7 -0
- package/.claude/skills/cfn-memory-persistence/lib/management/SKILL.md +7 -0
- package/.claude/skills/cfn-parameterized-queries/SKILL.md +8 -0
- package/.claude/skills/cfn-planning/SKILL.md +1 -1
- package/.claude/skills/cfn-session-handoff/SKILL.md +1 -53
- package/.claude/skills/cfn-skill-management/SKILL.md +1 -1
- package/.claude/skills/cfn-task-decomposition/SKILL.md +1 -0
- package/.claude/skills/cfn-task-intelligence/SKILL.md +39 -18
- package/.claude/skills/cfn-task-planning/SKILL.md +37 -12
- package/.claude/skills/cfn-transparency-middleware/SKILL.md +1 -1
- package/.claude/skills/cfn-utilities/SKILL.md +1 -1
- package/.claude/skills/cfn-validation-framework/SKILL.md +3 -60
- package/.claude/skills/cfn-vision-analysis/SKILL.md +3 -20
- package/.claude-flow/metrics/performance.json +3 -3
- package/.claude-flow/metrics/task-metrics.json +3 -3
- package/.ruvector/index_v2.db-shm +0 -0
- package/.ruvector/index_v2.db-wal +0 -0
- package/CLAUDE.md +9 -1
- package/README.md +56 -0
- package/docs/AGENT_PRODUCTION_FEEDBACK_PATTERNS.md +389 -0
- package/docs/CEREBRAS_TDD_COORDINATOR_TEST_RESULTS.md +213 -0
- package/docs/CEREBRAS_TDD_ROUND1_VS_ROUND2_COMPARISON.md +225 -0
- package/docs/CEREBRAS_TDD_ROUND3_FINAL_RESULTS.md +264 -0
- package/docs/EPIC_CREATOR_V2_ARCHITECTURE.md +629 -0
- package/docs/HOOKS_IMPLEMENTATION_PRIORITY.md +585 -0
- package/docs/SKILLS_HOOKS_INTEGRATION.md +1074 -0
- package/epic-with-personas-2025-12-09-17-15-13.json +253 -0
- package/index/index.bin +0 -0
- package/index/metadata.json +1 -0
- package/package.json +2 -1
- package/test-epic-creator-security.sh +203 -0
- package/.claude/skills/cfn-compilation-error-fixer/HANDOFF.md +0 -29
- package/.claude/skills/cfn-local-ruvector-accelerator/__pycache__/search_engine_v2.cpython-312.pyc +0 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/search_engine.py +0 -200
- package/.ruvector/index.db-journal +0 -0
- package/jest.config.ts.cjs +0 -17
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-cerebras-code-generator/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-cerebras-code-generator/context-analyzer.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-cerebras-code-generator/generate-code.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/execute.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/INTEGRATION.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/SAMPLE_OUTPUTS.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/capture-container-logs.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/enable-logging.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/init-hybrid-logging.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/analytics-summary.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-agent-timeline.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-consensus-history.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-coordination-timeline.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-failed-containers.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-gate-checks.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/schema.sql +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/sqlite-helpers.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/test-hybrid-logging.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/mcp/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/mcp/skill-mcp-selector.js +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/orchestration/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/orchestration/orchestrate.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/spawning/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/spawning/spawn-agent.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/cleanup-wave.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/lib/docker-helpers.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/monitor-wave.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/spawn-wave.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-node-heap-sizer/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-node-heap-sizer/task-mode-heap-limiter.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/deprecated/analyze-patterns.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/README.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/SECURITY.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/package.json +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/solve.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/test-equation-solver-minimal.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/test-equation-solver.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/test.cjs +0 -0
- /package/.claude/hooks/{cfn-credential-scanner.sh → deprecated/cfn-credential-scanner.sh} +0 -0
- /package/.claude/hooks/{cfn-detect-hardcoded-credentials.sh → deprecated/cfn-detect-hardcoded-credentials.sh} +0 -0
- /package/.claude/hooks/{cfn-invoke-post-edit-ts.sh → deprecated/cfn-invoke-post-edit-ts.sh} +0 -0
- /package/.claude/hooks/{cfn-invoke-pre-edit-ts.sh → deprecated/cfn-invoke-pre-edit-ts.sh} +0 -0
- /package/.claude/hooks/{cfn-invoke-security-validation.sh → deprecated/cfn-invoke-security-validation.sh} +0 -0
- /package/.claude/hooks/{cfn-lint-sql-injection.sh → deprecated/cfn-lint-sql-injection.sh} +0 -0
- /package/.claude/hooks/{cfn-post-edit.sh → deprecated/cfn-post-edit.sh} +0 -0
- /package/.claude/hooks/{cfn-pre-edit-backup.sh → deprecated/cfn-pre-edit-backup.sh} +0 -0
- /package/.claude/skills/cfn-local-ruvector-accelerator/{embeddings_manager.py → embeddings_manager.py.backup} +0 -0
- /package/{.ruvector → .claude/skills/cfn-local-ruvector-accelerator/index}/index.bin +0 -0
- /package/{.ruvector → .claude/skills/cfn-local-ruvector-accelerator/index}/metadata.json +0 -0
- /package/.claude/skills/cfn-local-ruvector-accelerator/{search_engine_v2.py → search_engine_v2.py.backup} +0 -0
- /package/.claude/skills/cfn-local-ruvector-accelerator/{sqlite_store.py → sqlite_store.py.backup} +0 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
use anyhow::Result;
|
|
2
|
+
use rusqlite::params;
|
|
3
|
+
use serde::{Serialize, Deserialize};
|
|
4
|
+
use std::collections::HashMap;
|
|
5
|
+
use tracing::{info, debug, warn};
|
|
6
|
+
|
|
7
|
+
use crate::store_v2::{StoreV2, Entity, Reference, TypeUsage};
|
|
8
|
+
use crate::schema_v2::{EntityKind, RefKind, Visibility};
|
|
9
|
+
|
|
10
|
+
/// High-level query API for agent use cases
|
|
11
|
+
pub struct QueryApi {
|
|
12
|
+
store: StoreV2,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl QueryApi {
|
|
16
|
+
pub fn new(store: StoreV2) -> Self {
|
|
17
|
+
Self { store }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Query 1: Find all functions using a specific type
|
|
21
|
+
///
|
|
22
|
+
/// Example: Find all functions using the type 'Album'
|
|
23
|
+
pub fn find_functions_using_type(&self, type_name: &str) -> Result<QueryResult> {
|
|
24
|
+
debug!("Finding functions using type: {}", type_name);
|
|
25
|
+
|
|
26
|
+
// Input validation
|
|
27
|
+
if type_name.is_empty() {
|
|
28
|
+
return Ok(QueryResult {
|
|
29
|
+
query_type: QueryType::FunctionsUsingType { type_name: type_name.to_string() },
|
|
30
|
+
results: vec![],
|
|
31
|
+
total_count: 0,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let query = r#"
|
|
36
|
+
SELECT DISTINCT e.*
|
|
37
|
+
FROM entities e
|
|
38
|
+
JOIN type_usage tu ON e.id = tu.entity_id
|
|
39
|
+
WHERE e.kind = 'function'
|
|
40
|
+
AND tu.type_name = ?
|
|
41
|
+
ORDER BY e.file_path, e.line_number
|
|
42
|
+
"#;
|
|
43
|
+
|
|
44
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
45
|
+
let entities = stmt.query_map([type_name], |row| {
|
|
46
|
+
self.store.row_to_entity(row)
|
|
47
|
+
})?
|
|
48
|
+
.collect::<Result<Vec<_>, rusqlite::Error>>()
|
|
49
|
+
.map_err(|e| anyhow::anyhow!("Failed to fetch entities: {}", e))?;
|
|
50
|
+
|
|
51
|
+
let results: Vec<QueryResultItem> = entities.into_iter().map(|e| {
|
|
52
|
+
QueryResultItem {
|
|
53
|
+
entity: e,
|
|
54
|
+
context: None,
|
|
55
|
+
score: 1.0,
|
|
56
|
+
}
|
|
57
|
+
}).collect();
|
|
58
|
+
|
|
59
|
+
let total_count = results.len();
|
|
60
|
+
Ok(QueryResult {
|
|
61
|
+
query_type: QueryType::FunctionsUsingType { type_name: type_name.to_string() },
|
|
62
|
+
results,
|
|
63
|
+
total_count,
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// Query 2: Find all callers of a specific function
|
|
68
|
+
///
|
|
69
|
+
/// Example: Find all functions that call 'create_album'
|
|
70
|
+
pub fn find_callers_of_function(&self, function_name: &str, exclude_module: Option<&str>) -> Result<QueryResult> {
|
|
71
|
+
debug!("Finding callers of function: {}", function_name);
|
|
72
|
+
|
|
73
|
+
// Input validation
|
|
74
|
+
if function_name.is_empty() {
|
|
75
|
+
return Ok(QueryResult {
|
|
76
|
+
query_type: QueryType::CallersOfFunction {
|
|
77
|
+
function_name: function_name.to_string(),
|
|
78
|
+
exclude_module: exclude_module.map(|s| s.to_string()),
|
|
79
|
+
},
|
|
80
|
+
results: vec![],
|
|
81
|
+
total_count: 0,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
let query = r#"
|
|
86
|
+
SELECT DISTINCT caller.*
|
|
87
|
+
FROM entities caller
|
|
88
|
+
JOIN refs r ON caller.id = r.source_entity_id
|
|
89
|
+
JOIN entities target ON r.target_entity_id = target.id
|
|
90
|
+
WHERE r.ref_kind = 'call'
|
|
91
|
+
AND target.name = ?
|
|
92
|
+
AND (? IS NULL OR caller.file_path NOT LIKE ?)
|
|
93
|
+
ORDER BY caller.file_path, caller.line_number
|
|
94
|
+
"#;
|
|
95
|
+
|
|
96
|
+
let exclude_pattern = exclude_module.map(|m| format!("%{}%", m));
|
|
97
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
98
|
+
let entities = stmt.query_map(
|
|
99
|
+
params![function_name, exclude_module, exclude_pattern],
|
|
100
|
+
|row| {
|
|
101
|
+
self.store.row_to_entity(row)
|
|
102
|
+
}
|
|
103
|
+
)?
|
|
104
|
+
.collect::<Result<Vec<_>, rusqlite::Error>>()
|
|
105
|
+
.map_err(|e| anyhow::anyhow!("Failed to fetch entities: {}", e))?;
|
|
106
|
+
|
|
107
|
+
let results: Vec<QueryResultItem> = entities.into_iter().map(|e| {
|
|
108
|
+
QueryResultItem {
|
|
109
|
+
entity: e,
|
|
110
|
+
context: None,
|
|
111
|
+
score: 1.0,
|
|
112
|
+
}
|
|
113
|
+
}).collect();
|
|
114
|
+
|
|
115
|
+
let total_count = results.len();
|
|
116
|
+
Ok(QueryResult {
|
|
117
|
+
query_type: QueryType::CallersOfFunction {
|
|
118
|
+
function_name: function_name.to_string(),
|
|
119
|
+
exclude_module: exclude_module.map(|s| s.to_string()),
|
|
120
|
+
},
|
|
121
|
+
results,
|
|
122
|
+
total_count,
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/// Query 3: Find types defined in a file that are used elsewhere
|
|
127
|
+
///
|
|
128
|
+
/// Example: Find all types from 'module.rs' that are used in other files
|
|
129
|
+
pub fn find_types_used_elsewhere(&self, file_path: &str) -> Result<QueryResult> {
|
|
130
|
+
debug!("Finding types from {} used elsewhere", file_path);
|
|
131
|
+
|
|
132
|
+
// Input validation
|
|
133
|
+
if file_path.is_empty() {
|
|
134
|
+
return Ok(QueryResult {
|
|
135
|
+
query_type: QueryType::TypesUsedElsewhere { file_path: file_path.to_string() },
|
|
136
|
+
results: vec![],
|
|
137
|
+
total_count: 0,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
let query = r#"
|
|
142
|
+
SELECT DISTINCT e.*
|
|
143
|
+
FROM entities e
|
|
144
|
+
WHERE e.kind IN ('struct', 'enum', 'trait', 'interface', 'class', 'type_alias')
|
|
145
|
+
AND e.file_path = ?
|
|
146
|
+
AND e.id IN (
|
|
147
|
+
SELECT DISTINCT tu.type_name
|
|
148
|
+
FROM type_usage tu
|
|
149
|
+
WHERE tu.file_path != ?
|
|
150
|
+
)
|
|
151
|
+
ORDER BY e.name
|
|
152
|
+
"#;
|
|
153
|
+
|
|
154
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
155
|
+
let entities = stmt.query_map([file_path, file_path], |row| {
|
|
156
|
+
self.store.row_to_entity(row)
|
|
157
|
+
})?
|
|
158
|
+
.collect::<Result<Vec<_>, rusqlite::Error>>()
|
|
159
|
+
.map_err(|e| anyhow::anyhow!("Failed to fetch entities: {}", e))?;
|
|
160
|
+
|
|
161
|
+
let results: Vec<QueryResultItem> = entities.into_iter().map(|e| {
|
|
162
|
+
QueryResultItem {
|
|
163
|
+
entity: e,
|
|
164
|
+
context: None,
|
|
165
|
+
score: 1.0,
|
|
166
|
+
}
|
|
167
|
+
}).collect();
|
|
168
|
+
|
|
169
|
+
let total_count = results.len();
|
|
170
|
+
Ok(QueryResult {
|
|
171
|
+
query_type: QueryType::TypesUsedElsewhere { file_path: file_path.to_string() },
|
|
172
|
+
results,
|
|
173
|
+
total_count,
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/// Query 4: Find all implementations of a trait/interface
|
|
178
|
+
///
|
|
179
|
+
/// Example: Find all implementations of the 'Display' trait
|
|
180
|
+
pub fn find_implementations(&self, trait_name: &str) -> Result<QueryResult> {
|
|
181
|
+
debug!("Finding implementations of trait: {}", trait_name);
|
|
182
|
+
|
|
183
|
+
// Input validation
|
|
184
|
+
if trait_name.is_empty() {
|
|
185
|
+
return Ok(QueryResult {
|
|
186
|
+
query_type: QueryType::Implementations { trait_name: trait_name.to_string() },
|
|
187
|
+
results: vec![],
|
|
188
|
+
total_count: 0,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let query = r#"
|
|
193
|
+
SELECT DISTINCT impl_block.*
|
|
194
|
+
FROM entities impl_block
|
|
195
|
+
JOIN refs r ON impl_block.id = r.source_entity_id
|
|
196
|
+
JOIN entities trait ON r.target_entity_id = trait.id
|
|
197
|
+
WHERE impl_block.kind = 'impl'
|
|
198
|
+
AND r.ref_kind = 'implement'
|
|
199
|
+
AND trait.name = ?
|
|
200
|
+
ORDER BY impl_block.file_path, impl_block.line_number
|
|
201
|
+
"#;
|
|
202
|
+
|
|
203
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
204
|
+
let entities = stmt.query_map([trait_name], |row| {
|
|
205
|
+
self.store.row_to_entity(row)
|
|
206
|
+
})?
|
|
207
|
+
.collect::<Result<Vec<_>, rusqlite::Error>>()
|
|
208
|
+
.map_err(|e| anyhow::anyhow!("Failed to fetch entities: {}", e))?;
|
|
209
|
+
|
|
210
|
+
let results: Vec<QueryResultItem> = entities.into_iter().map(|e| {
|
|
211
|
+
QueryResultItem {
|
|
212
|
+
entity: e,
|
|
213
|
+
context: None,
|
|
214
|
+
score: 1.0,
|
|
215
|
+
}
|
|
216
|
+
}).collect();
|
|
217
|
+
|
|
218
|
+
let total_count = results.len();
|
|
219
|
+
Ok(QueryResult {
|
|
220
|
+
query_type: QueryType::Implementations { trait_name: trait_name.to_string() },
|
|
221
|
+
results,
|
|
222
|
+
total_count,
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/// Query 5: Get the public API surface of a module
|
|
227
|
+
///
|
|
228
|
+
/// Example: Find all public entities in the 'auth' module
|
|
229
|
+
pub fn find_public_api(&self, module_path: &str) -> Result<QueryResult> {
|
|
230
|
+
debug!("Finding public API for module: {}", module_path);
|
|
231
|
+
|
|
232
|
+
// Input validation
|
|
233
|
+
if module_path.is_empty() {
|
|
234
|
+
return Ok(QueryResult {
|
|
235
|
+
query_type: QueryType::PublicAPI { module_path: module_path.to_string() },
|
|
236
|
+
results: vec![],
|
|
237
|
+
total_count: 0,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
let query = r#"
|
|
242
|
+
SELECT e.*
|
|
243
|
+
FROM entities e
|
|
244
|
+
WHERE e.visibility = 'public'
|
|
245
|
+
AND e.file_path LIKE ?
|
|
246
|
+
ORDER BY e.kind, e.name
|
|
247
|
+
"#;
|
|
248
|
+
|
|
249
|
+
let pattern = format!("%{}%", module_path);
|
|
250
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
251
|
+
let entities = stmt.query_map([pattern], |row| {
|
|
252
|
+
self.store.row_to_entity(row)
|
|
253
|
+
})?
|
|
254
|
+
.collect::<Result<Vec<_>, rusqlite::Error>>()
|
|
255
|
+
.map_err(|e| anyhow::anyhow!("Failed to fetch entities: {}", e))?;
|
|
256
|
+
|
|
257
|
+
let results: Vec<QueryResultItem> = entities.into_iter().map(|e| {
|
|
258
|
+
QueryResultItem {
|
|
259
|
+
entity: e,
|
|
260
|
+
context: None,
|
|
261
|
+
score: 1.0,
|
|
262
|
+
}
|
|
263
|
+
}).collect();
|
|
264
|
+
|
|
265
|
+
let total_count = results.len();
|
|
266
|
+
Ok(QueryResult {
|
|
267
|
+
query_type: QueryType::PublicAPI { module_path: module_path.to_string() },
|
|
268
|
+
results,
|
|
269
|
+
total_count,
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/// Query 6: Find all references to a path (for refactoring)
|
|
274
|
+
///
|
|
275
|
+
/// Example: Find all references to 'crate::models::Album'
|
|
276
|
+
pub fn find_references_to_path(&self, path: &str) -> Result<QueryResult> {
|
|
277
|
+
debug!("Finding references to path: {}", path);
|
|
278
|
+
|
|
279
|
+
// Input validation
|
|
280
|
+
if path.is_empty() {
|
|
281
|
+
return Ok(QueryResult {
|
|
282
|
+
query_type: QueryType::ReferencesToPath { path: path.to_string() },
|
|
283
|
+
results: vec![],
|
|
284
|
+
total_count: 0,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// First, find entities that match this path
|
|
289
|
+
let find_entities_query = r#"
|
|
290
|
+
SELECT id, kind, name, signature, visibility, parent_id, file_path, line_number,
|
|
291
|
+
column_number, doc_comment, attributes, metadata, created_at, updated_at
|
|
292
|
+
FROM entities
|
|
293
|
+
WHERE signature LIKE ? OR name = ?
|
|
294
|
+
"#;
|
|
295
|
+
|
|
296
|
+
let pattern = format!("%{}%", path);
|
|
297
|
+
let mut stmt = self.store.conn.prepare(find_entities_query)?;
|
|
298
|
+
let mut matching_entities = Vec::new();
|
|
299
|
+
let rows = stmt.query_map([pattern.as_str(), path], |row| {
|
|
300
|
+
Ok((
|
|
301
|
+
row.get::<_, i64>(0)?, // id
|
|
302
|
+
row.get::<_, String>(1)?, // kind
|
|
303
|
+
row.get::<_, String>(2)?, // name
|
|
304
|
+
row.get::<_, Option<String>>(3)?, // signature
|
|
305
|
+
row.get::<_, String>(4)?, // visibility
|
|
306
|
+
row.get::<_, Option<i64>>(5)?, // parent_id
|
|
307
|
+
row.get::<_, String>(6)?, // file_path
|
|
308
|
+
row.get::<_, i64>(7)?, // line_number
|
|
309
|
+
row.get::<_, Option<i64>>(8)?, // column_number
|
|
310
|
+
row.get::<_, Option<String>>(9)?, // doc_comment
|
|
311
|
+
row.get::<_, Option<String>>(10)?, // attributes
|
|
312
|
+
row.get::<_, Option<String>>(11)?, // metadata
|
|
313
|
+
row.get::<_, i64>(12)?, // created_at
|
|
314
|
+
row.get::<_, i64>(13)?, // updated_at
|
|
315
|
+
))
|
|
316
|
+
})?;
|
|
317
|
+
|
|
318
|
+
for row in rows {
|
|
319
|
+
let row = row?;
|
|
320
|
+
let (id, kind_str, name, signature, visibility_str, parent_id, file_path, line_number, column_number, doc_comment, attributes, metadata, created_at, updated_at) = row;
|
|
321
|
+
// For now, just create a simple entity - the full parsing can be done later
|
|
322
|
+
// This is just to get the IDs for reference finding
|
|
323
|
+
matching_entities.push(crate::store_v2::Entity {
|
|
324
|
+
id,
|
|
325
|
+
kind: crate::schema_v2::EntityKind::from_str(&kind_str).unwrap_or(crate::schema_v2::EntityKind::Function),
|
|
326
|
+
name,
|
|
327
|
+
signature,
|
|
328
|
+
visibility: crate::schema_v2::Visibility::from_str(&visibility_str).unwrap_or(crate::schema_v2::Visibility::Private),
|
|
329
|
+
parent_id,
|
|
330
|
+
file_path,
|
|
331
|
+
line_number,
|
|
332
|
+
column_number,
|
|
333
|
+
doc_comment,
|
|
334
|
+
attributes,
|
|
335
|
+
metadata,
|
|
336
|
+
created_at: chrono::DateTime::from_timestamp(created_at, 0).unwrap_or_default(),
|
|
337
|
+
updated_at: chrono::DateTime::from_timestamp(updated_at, 0).unwrap_or_default(),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Then find all references to these entities
|
|
342
|
+
let mut all_refs = Vec::new();
|
|
343
|
+
|
|
344
|
+
for entity in matching_entities {
|
|
345
|
+
let ref_query = r#"
|
|
346
|
+
SELECT r.*, e.*
|
|
347
|
+
FROM refs r
|
|
348
|
+
JOIN entities e ON r.source_entity_id = e.id
|
|
349
|
+
WHERE r.target_entity_id = ?
|
|
350
|
+
ORDER BY e.file_path, e.line_number
|
|
351
|
+
"#;
|
|
352
|
+
|
|
353
|
+
let mut ref_stmt = self.store.conn.prepare(ref_query)?;
|
|
354
|
+
let refs = ref_stmt.query_map([entity.id], |row| {
|
|
355
|
+
// Create a dummy entity for now - this needs proper implementation
|
|
356
|
+
let ref_entity = crate::store_v2::Entity {
|
|
357
|
+
id: row.get(8)?,
|
|
358
|
+
kind: crate::schema_v2::EntityKind::Function,
|
|
359
|
+
name: "".to_string(),
|
|
360
|
+
signature: None,
|
|
361
|
+
visibility: crate::schema_v2::Visibility::Private,
|
|
362
|
+
parent_id: None,
|
|
363
|
+
file_path: "".to_string(),
|
|
364
|
+
line_number: 0,
|
|
365
|
+
column_number: None,
|
|
366
|
+
doc_comment: None,
|
|
367
|
+
attributes: None,
|
|
368
|
+
metadata: None,
|
|
369
|
+
created_at: chrono::DateTime::from_timestamp(0, 0).unwrap_or_default(),
|
|
370
|
+
updated_at: chrono::DateTime::from_timestamp(0, 0).unwrap_or_default(),
|
|
371
|
+
};
|
|
372
|
+
Ok((Reference {
|
|
373
|
+
id: row.get(0)?,
|
|
374
|
+
source_entity_id: row.get(1)?,
|
|
375
|
+
target_entity_id: row.get(2)?,
|
|
376
|
+
ref_kind: RefKind::from_str(&row.get::<_, String>(3)?).unwrap_or(RefKind::Reference),
|
|
377
|
+
file_path: row.get(4)?,
|
|
378
|
+
line_number: row.get(5)?,
|
|
379
|
+
column_number: row.get(6)?,
|
|
380
|
+
context: row.get(7)?,
|
|
381
|
+
created_at: chrono::DateTime::from_timestamp(row.get(9)?, 0).unwrap_or_default(),
|
|
382
|
+
}, ref_entity))
|
|
383
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
384
|
+
|
|
385
|
+
all_refs.extend(refs);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
let results: Vec<QueryResultItem> = all_refs.into_iter().map(|(r, e)| {
|
|
389
|
+
QueryResultItem {
|
|
390
|
+
entity: e,
|
|
391
|
+
context: r.context,
|
|
392
|
+
score: 1.0,
|
|
393
|
+
}
|
|
394
|
+
}).collect();
|
|
395
|
+
|
|
396
|
+
let total_count = results.len();
|
|
397
|
+
Ok(QueryResult {
|
|
398
|
+
query_type: QueryType::ReferencesToPath { path: path.to_string() },
|
|
399
|
+
results,
|
|
400
|
+
total_count,
|
|
401
|
+
})
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/// Get type usage statistics for a file
|
|
405
|
+
pub fn get_type_usage_stats(&self, file_path: &str) -> Result<TypeUsageStats> {
|
|
406
|
+
debug!("Getting type usage statistics for: {}", file_path);
|
|
407
|
+
|
|
408
|
+
// Input validation
|
|
409
|
+
if file_path.is_empty() {
|
|
410
|
+
return Ok(TypeUsageStats {
|
|
411
|
+
file_path: file_path.to_string(),
|
|
412
|
+
total_unique_types: 0,
|
|
413
|
+
stats: vec![],
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
let query = r#"
|
|
418
|
+
SELECT e.name, COUNT(*) as usage_count
|
|
419
|
+
FROM entities e
|
|
420
|
+
JOIN type_usage tu ON e.name = tu.type_name
|
|
421
|
+
WHERE e.file_path LIKE ?
|
|
422
|
+
AND e.kind IN ('struct', 'enum', 'trait', 'interface', 'class', 'type_alias')
|
|
423
|
+
GROUP BY e.name
|
|
424
|
+
ORDER BY usage_count DESC
|
|
425
|
+
"#;
|
|
426
|
+
|
|
427
|
+
let pattern = format!("%{}%", file_path);
|
|
428
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
429
|
+
let stats = stmt.query_map([pattern], |row| {
|
|
430
|
+
Ok(TypeUsageStat {
|
|
431
|
+
type_name: row.get(0)?,
|
|
432
|
+
usage_count: row.get(1)?,
|
|
433
|
+
})
|
|
434
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
435
|
+
|
|
436
|
+
Ok(TypeUsageStats {
|
|
437
|
+
file_path: file_path.to_string(),
|
|
438
|
+
total_unique_types: stats.len(),
|
|
439
|
+
stats,
|
|
440
|
+
})
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/// Advanced query: Find functions by signature pattern
|
|
444
|
+
pub fn find_functions_by_pattern(&self, pattern: &str) -> Result<QueryResult> {
|
|
445
|
+
debug!("Finding functions matching pattern: {}", pattern);
|
|
446
|
+
|
|
447
|
+
// Input validation
|
|
448
|
+
if pattern.is_empty() {
|
|
449
|
+
return Ok(QueryResult {
|
|
450
|
+
query_type: QueryType::FunctionPattern { pattern: pattern.to_string() },
|
|
451
|
+
results: vec![],
|
|
452
|
+
total_count: 0,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
let query = r#"
|
|
457
|
+
SELECT * FROM entities
|
|
458
|
+
WHERE kind = 'function'
|
|
459
|
+
AND (signature LIKE ? OR name LIKE ?)
|
|
460
|
+
ORDER BY file_path, line_number
|
|
461
|
+
"#;
|
|
462
|
+
|
|
463
|
+
let pattern_like = format!("%{}%", pattern);
|
|
464
|
+
let mut stmt = self.store.conn.prepare(query)?;
|
|
465
|
+
let entities = stmt.query_map([pattern_like.as_str(), pattern_like.as_str()], |row| {
|
|
466
|
+
self.store.row_to_entity(row)
|
|
467
|
+
})?
|
|
468
|
+
.collect::<Result<Vec<_>, rusqlite::Error>>()
|
|
469
|
+
.map_err(|e| anyhow::anyhow!("Failed to fetch entities: {}", e))?;
|
|
470
|
+
|
|
471
|
+
let results: Vec<QueryResultItem> = entities.into_iter().map(|e| {
|
|
472
|
+
QueryResultItem {
|
|
473
|
+
entity: e,
|
|
474
|
+
context: None,
|
|
475
|
+
score: 1.0,
|
|
476
|
+
}
|
|
477
|
+
}).collect();
|
|
478
|
+
|
|
479
|
+
let total_count = results.len();
|
|
480
|
+
Ok(QueryResult {
|
|
481
|
+
query_type: QueryType::FunctionPattern { pattern: pattern.to_string() },
|
|
482
|
+
results,
|
|
483
|
+
total_count,
|
|
484
|
+
})
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/// Result types for the query API
|
|
489
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
490
|
+
pub struct QueryResult {
|
|
491
|
+
pub query_type: QueryType,
|
|
492
|
+
pub results: Vec<QueryResultItem>,
|
|
493
|
+
pub total_count: usize,
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
497
|
+
pub struct QueryResultItem {
|
|
498
|
+
pub entity: Entity,
|
|
499
|
+
pub context: Option<String>,
|
|
500
|
+
pub score: f32,
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
504
|
+
#[serde(tag = "type", content = "params")]
|
|
505
|
+
pub enum QueryType {
|
|
506
|
+
FunctionsUsingType { type_name: String },
|
|
507
|
+
CallersOfFunction {
|
|
508
|
+
function_name: String,
|
|
509
|
+
#[serde(skip_serializing_if = "Option::is_none")]
|
|
510
|
+
exclude_module: Option<String>,
|
|
511
|
+
},
|
|
512
|
+
TypesUsedElsewhere { file_path: String },
|
|
513
|
+
Implementations { trait_name: String },
|
|
514
|
+
PublicAPI { module_path: String },
|
|
515
|
+
ReferencesToPath { path: String },
|
|
516
|
+
FunctionPattern { pattern: String },
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
520
|
+
pub struct TypeUsageStats {
|
|
521
|
+
pub file_path: String,
|
|
522
|
+
pub stats: Vec<TypeUsageStat>,
|
|
523
|
+
pub total_unique_types: usize,
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
527
|
+
pub struct TypeUsageStat {
|
|
528
|
+
pub type_name: String,
|
|
529
|
+
pub usage_count: i64,
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/// Utility trait for converting query results to different formats
|
|
533
|
+
pub trait QueryResultFormatter {
|
|
534
|
+
fn format_simple(&self) -> String;
|
|
535
|
+
fn format_json(&self) -> Result<String>;
|
|
536
|
+
fn format_detailed(&self) -> String;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
impl QueryResultFormatter for QueryResult {
|
|
540
|
+
fn format_simple(&self) -> String {
|
|
541
|
+
self.results.iter()
|
|
542
|
+
.map(|item| format!("{}:{} - {}",
|
|
543
|
+
item.entity.file_path,
|
|
544
|
+
item.entity.line_number,
|
|
545
|
+
item.entity.name))
|
|
546
|
+
.collect::<Vec<_>>()
|
|
547
|
+
.join("\n")
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
fn format_json(&self) -> Result<String> {
|
|
551
|
+
Ok(serde_json::to_string_pretty(self)?)
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
fn format_detailed(&self) -> String {
|
|
555
|
+
let mut output = String::new();
|
|
556
|
+
|
|
557
|
+
match &self.query_type {
|
|
558
|
+
QueryType::FunctionsUsingType { type_name } => {
|
|
559
|
+
output.push_str(&format!("Functions using type '{}':\n", type_name));
|
|
560
|
+
}
|
|
561
|
+
QueryType::CallersOfFunction { function_name, exclude_module } => {
|
|
562
|
+
output.push_str(&format!("Callers of function '{}'", function_name));
|
|
563
|
+
if let Some(module) = exclude_module {
|
|
564
|
+
output.push_str(&format!(" (excluding {})", module));
|
|
565
|
+
}
|
|
566
|
+
output.push_str(":\n");
|
|
567
|
+
}
|
|
568
|
+
QueryType::TypesUsedElsewhere { file_path } => {
|
|
569
|
+
output.push_str(&format!("Types from {} used elsewhere:\n", file_path));
|
|
570
|
+
}
|
|
571
|
+
QueryType::Implementations { trait_name } => {
|
|
572
|
+
output.push_str(&format!("Implementations of trait '{}':\n", trait_name));
|
|
573
|
+
}
|
|
574
|
+
QueryType::PublicAPI { module_path } => {
|
|
575
|
+
output.push_str(&format!("Public API for module '{}':\n", module_path));
|
|
576
|
+
}
|
|
577
|
+
QueryType::ReferencesToPath { path } => {
|
|
578
|
+
output.push_str(&format!("References to path '{}':\n", path));
|
|
579
|
+
}
|
|
580
|
+
QueryType::FunctionPattern { pattern } => {
|
|
581
|
+
output.push_str(&format!("Functions matching pattern '{}':\n", pattern));
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
for (i, item) in self.results.iter().enumerate() {
|
|
586
|
+
output.push_str(&format!("\n {}. {} ({}:{}): {}\n",
|
|
587
|
+
i + 1,
|
|
588
|
+
item.entity.name,
|
|
589
|
+
item.entity.file_path,
|
|
590
|
+
item.entity.line_number,
|
|
591
|
+
item.entity.kind.as_str()
|
|
592
|
+
));
|
|
593
|
+
|
|
594
|
+
if let Some(signature) = &item.entity.signature {
|
|
595
|
+
output.push_str(&format!(" {}\n", signature));
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
if let Some(doc) = &item.entity.doc_comment {
|
|
599
|
+
let first_line = doc.lines().next().unwrap_or("");
|
|
600
|
+
if !first_line.is_empty() {
|
|
601
|
+
output.push_str(&format!(" /// {}\n", first_line));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
output.push_str(&format!("\nTotal: {} results\n", self.total_count));
|
|
607
|
+
output
|
|
608
|
+
}
|
|
609
|
+
}
|