@crownpeak/dqm-react-component-dev-mcp 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -0
- package/data/.env.example +22 -0
- package/data/.gitattributes +47 -0
- package/data/.glfrc.json +7 -0
- package/data/.husky/pre-commit +5 -0
- package/data/.nvmrc +1 -0
- package/data/CHANGELOG.md +75 -0
- package/data/CODE_OF_CONDUCT.md +129 -0
- package/data/CONTRIBUTING.md +203 -0
- package/data/DOCS-STRUCTURE.md +307 -0
- package/data/I18N.md +292 -0
- package/data/LICENSE +22 -0
- package/data/README.md +315 -0
- package/data/SECURITY.md +125 -0
- package/data/WIKI-DEPLOYMENT.md +348 -0
- package/data/docs/AI-FEATURES.md +610 -0
- package/data/docs/API-REFERENCE.md +1022 -0
- package/data/docs/AUTHENTICATION.md +301 -0
- package/data/docs/BACKEND-API.md +468 -0
- package/data/docs/DEVELOPMENT.md +375 -0
- package/data/docs/EXAMPLES.md +622 -0
- package/data/docs/MCP-SERVER.md +307 -0
- package/data/docs/MIGRATION-GUIDE.md +367 -0
- package/data/docs/NPM-PUBLISH.md +193 -0
- package/data/docs/QUICKSTART.md +206 -0
- package/data/docs/REDIS-SETUP.md +162 -0
- package/data/docs/SERVER.md +228 -0
- package/data/docs/TROUBLESHOOTING.md +657 -0
- package/data/docs/WIDGET-GUIDE.md +638 -0
- package/data/docs/WIKI-HOME.md +58 -0
- package/data/docs/WIKI-SIDEBAR.md +39 -0
- package/data/package.json +171 -0
- package/data/playwright.config.ts +64 -0
- package/data/probe/.cargo/config.toml +10 -0
- package/data/probe/.claude/commands/performance-review.md +15 -0
- package/data/probe/.clinerules +288 -0
- package/data/probe/.dockerignore +57 -0
- package/data/probe/.githooks/post-commit +11 -0
- package/data/probe/.githooks/pre-commit +99 -0
- package/data/probe/.githooks/pre-commit-vow +9 -0
- package/data/probe/.prompts/engineer.md +41 -0
- package/data/probe/.roomodes +28 -0
- package/data/probe/.windsurfrules +0 -0
- package/data/probe/BASH_TOOL_SUMMARY.md +148 -0
- package/data/probe/BENCHMARKING.md +256 -0
- package/data/probe/CLAUDE.md +226 -0
- package/data/probe/CODE_OF_CONDUCT.md +128 -0
- package/data/probe/CONTRIBUTING.md +193 -0
- package/data/probe/Cargo.toml +120 -0
- package/data/probe/Cross.toml +10 -0
- package/data/probe/DOCKER-README.md +224 -0
- package/data/probe/Dockerfile +32 -0
- package/data/probe/ENHANCED_DEBUG_TELEMETRY.md +188 -0
- package/data/probe/LICENSE +201 -0
- package/data/probe/Makefile +210 -0
- package/data/probe/README.md +824 -0
- package/data/probe/SECURITY.md +67 -0
- package/data/probe/WINDOWS-GUIDE.md +294 -0
- package/data/probe/benches/parsing_benchmarks.rs +370 -0
- package/data/probe/benches/search_benchmarks.rs +599 -0
- package/data/probe/benches/simd_benchmarks.rs +372 -0
- package/data/probe/benches/timing_benchmarks.rs +287 -0
- package/data/probe/build-windows.bat +229 -0
- package/data/probe/codex-config/config.toml +6 -0
- package/data/probe/docs/PERFORMANCE_OPTIMIZATION.md +161 -0
- package/data/probe/examples/cache_demo.rs +46 -0
- package/data/probe/examples/chat/.dockerignore +37 -0
- package/data/probe/examples/chat/ChatSessionManager.js +295 -0
- package/data/probe/examples/chat/Dockerfile +98 -0
- package/data/probe/examples/chat/LICENSE +201 -0
- package/data/probe/examples/chat/LOCAL_IMAGE_SUPPORT.md +195 -0
- package/data/probe/examples/chat/MCP_INTEGRATION.md +400 -0
- package/data/probe/examples/chat/README.md +338 -0
- package/data/probe/examples/chat/TRACING.md +226 -0
- package/data/probe/examples/chat/appTracer.js +968 -0
- package/data/probe/examples/chat/auth.js +76 -0
- package/data/probe/examples/chat/bin/probe-chat.js +13 -0
- package/data/probe/examples/chat/build.js +104 -0
- package/data/probe/examples/chat/cancelRequest.js +84 -0
- package/data/probe/examples/chat/demo-agentic-image-flow.js +88 -0
- package/data/probe/examples/chat/demo-local-images.js +128 -0
- package/data/probe/examples/chat/fileSpanExporter.js +181 -0
- package/data/probe/examples/chat/implement/README.md +228 -0
- package/data/probe/examples/chat/implement/backends/AiderBackend.js +750 -0
- package/data/probe/examples/chat/implement/backends/BaseBackend.js +276 -0
- package/data/probe/examples/chat/implement/backends/ClaudeCodeBackend.js +767 -0
- package/data/probe/examples/chat/implement/backends/MockBackend.js +237 -0
- package/data/probe/examples/chat/implement/backends/registry.js +85 -0
- package/data/probe/examples/chat/implement/core/BackendManager.js +567 -0
- package/data/probe/examples/chat/implement/core/ImplementTool.js +354 -0
- package/data/probe/examples/chat/implement/core/config.js +428 -0
- package/data/probe/examples/chat/implement/core/timeouts.js +58 -0
- package/data/probe/examples/chat/implement/core/utils.js +496 -0
- package/data/probe/examples/chat/implement/types/BackendTypes.js +126 -0
- package/data/probe/examples/chat/index.js +669 -0
- package/data/probe/examples/chat/mcpServer.js +341 -0
- package/data/probe/examples/chat/npm/LICENSE +15 -0
- package/data/probe/examples/chat/npm/README.md +168 -0
- package/data/probe/examples/chat/npm/bin/probe-chat.js +156 -0
- package/data/probe/examples/chat/npm/index.js +259 -0
- package/data/probe/examples/chat/npm/package.json +54 -0
- package/data/probe/examples/chat/package.json +102 -0
- package/data/probe/examples/chat/probeChat.js +456 -0
- package/data/probe/examples/chat/probeTool.js +491 -0
- package/data/probe/examples/chat/storage/JsonChatStorage.js +476 -0
- package/data/probe/examples/chat/telemetry.js +281 -0
- package/data/probe/examples/chat/test/integration/chatFlows.test.js +320 -0
- package/data/probe/examples/chat/test/integration/toolCalling.test.js +471 -0
- package/data/probe/examples/chat/test/mocks/mockLLMProvider.js +269 -0
- package/data/probe/examples/chat/test/test-backends.js +90 -0
- package/data/probe/examples/chat/test/testUtils.js +530 -0
- package/data/probe/examples/chat/test/unit/backendTimeout.test.js +161 -0
- package/data/probe/examples/chat/test/unit/packageFiles.test.js +120 -0
- package/data/probe/examples/chat/test/verify-tests.js +118 -0
- package/data/probe/examples/chat/test-agentic-image-loading.js +294 -0
- package/data/probe/examples/chat/test-ai-sdk-telemetry.js +204 -0
- package/data/probe/examples/chat/test-chat-tracing.js +38 -0
- package/data/probe/examples/chat/test-direct-function.js +49 -0
- package/data/probe/examples/chat/test-file-size-validation.js +103 -0
- package/data/probe/examples/chat/test-full-mcp-integration.js +258 -0
- package/data/probe/examples/chat/test-github-context.txt +12 -0
- package/data/probe/examples/chat/test-hierarchy.js +203 -0
- package/data/probe/examples/chat/test-image-spans.js +37 -0
- package/data/probe/examples/chat/test-local-image-reading.js +176 -0
- package/data/probe/examples/chat/test-mcp-integration.js +136 -0
- package/data/probe/examples/chat/test-mcp-probe-server.js +161 -0
- package/data/probe/examples/chat/test-mcp-with-ai.js +279 -0
- package/data/probe/examples/chat/test-multiple-allowed-dirs.js +111 -0
- package/data/probe/examples/chat/test-probe-mcp-server.js +110 -0
- package/data/probe/examples/chat/test-security-validation.js +145 -0
- package/data/probe/examples/chat/test-simple-tracing.js +32 -0
- package/data/probe/examples/chat/test-trace-verification.js +235 -0
- package/data/probe/examples/chat/test-tracing.js +114 -0
- package/data/probe/examples/chat/tokenCounter.js +419 -0
- package/data/probe/examples/chat/tokenUsageDisplay.js +134 -0
- package/data/probe/examples/chat/webServer.js +1103 -0
- package/data/probe/examples/reranker/Cargo.toml +33 -0
- package/data/probe/examples/reranker/DEBUG_OUTPUT_ANALYSIS.md +71 -0
- package/data/probe/examples/reranker/MODELS.md +66 -0
- package/data/probe/examples/reranker/MODEL_COMPARISON.md +60 -0
- package/data/probe/examples/reranker/MULTI_MODEL_ANALYSIS.md +176 -0
- package/data/probe/examples/reranker/PERFORMANCE_SUMMARY.md +156 -0
- package/data/probe/examples/reranker/README.md +347 -0
- package/data/probe/examples/reranker/RUST_BERT_COMPARISON.md +82 -0
- package/data/probe/examples/reranker/TOKENIZATION_GUIDE.md +120 -0
- package/data/probe/examples/reranker/check_rust_tokenizer.py +108 -0
- package/data/probe/examples/reranker/convert_to_torchscript.py +109 -0
- package/data/probe/examples/reranker/debug_scoring.py +189 -0
- package/data/probe/examples/reranker/debug_tokenization.py +154 -0
- package/data/probe/examples/reranker/download_models.sh +73 -0
- package/data/probe/examples/reranker/requirements.txt +13 -0
- package/data/probe/examples/reranker/run_comprehensive_benchmark.sh +83 -0
- package/data/probe/examples/reranker/rust_bert_test/Cargo.toml +12 -0
- package/data/probe/examples/reranker/rust_bert_test/README.md +54 -0
- package/data/probe/examples/reranker/simple_test.py +50 -0
- package/data/probe/examples/reranker/test_all_models.sh +63 -0
- package/data/probe/examples/reranker/test_bert_results.sh +44 -0
- package/data/probe/examples/reranker/test_cross_encoder.py +334 -0
- package/data/probe/examples/reranker/test_cross_encoder.sh +80 -0
- package/data/probe/examples/reranker/test_exact_comparison.py +151 -0
- package/data/probe/examples/reranker/test_parallel_performance.sh +56 -0
- package/data/probe/examples/reranker/test_scores.py +132 -0
- package/data/probe/install.ps1 +508 -0
- package/data/probe/install.sh +460 -0
- package/data/probe/npm/CLONE_METHOD_EXAMPLES.md +596 -0
- package/data/probe/npm/CONTEXT_COMPACTION.md +303 -0
- package/data/probe/npm/DELEGATE_TOOL_README.md +166 -0
- package/data/probe/npm/MAID_INTEGRATION.md +313 -0
- package/data/probe/npm/MCP_INTEGRATION_SUMMARY.md +241 -0
- package/data/probe/npm/README.md +824 -0
- package/data/probe/npm/bin/.gitignore +7 -0
- package/data/probe/npm/bin/.gitkeep +0 -0
- package/data/probe/npm/bin/README.md +12 -0
- package/data/probe/npm/bin/probe +167 -0
- package/data/probe/npm/docs/CLAUDE_CODE_INTEGRATION.md +414 -0
- package/data/probe/npm/docs/CODEX_INTEGRATION.md +502 -0
- package/data/probe/npm/docs/EDIT_CREATE_TOOLS.md +233 -0
- package/data/probe/npm/docs/RETRY_AND_FALLBACK.md +674 -0
- package/data/probe/npm/example-usage.js +335 -0
- package/data/probe/npm/examples/multi-engine-demo.js +117 -0
- package/data/probe/npm/examples/probe-agent-cli.js +113 -0
- package/data/probe/npm/examples/test-agent-edit.js +114 -0
- package/data/probe/npm/examples/test-edit-create.js +120 -0
- package/data/probe/npm/examples/test-edit-direct.js +114 -0
- package/data/probe/npm/index.d.ts +744 -0
- package/data/probe/npm/jest.config.js +52 -0
- package/data/probe/npm/package.json +117 -0
- package/data/probe/npm/scripts/build-agent.cjs +75 -0
- package/data/probe/npm/scripts/build-cjs.js +124 -0
- package/data/probe/npm/scripts/build-mcp.cjs +36 -0
- package/data/probe/npm/scripts/postinstall.js +216 -0
- package/data/probe/npm/test-codex-e2e.js +78 -0
- package/data/probe/npm/test-download-lock.js +109 -0
- package/data/probe/npm/test-grep-security.js +94 -0
- package/data/probe/npm/test-grep-simplified.js +63 -0
- package/data/probe/npm/test-grep.js +51 -0
- package/data/probe/npm/tests/README.md +96 -0
- package/data/probe/npm/tests/agent-compact-history.test.js +174 -0
- package/data/probe/npm/tests/allow-tests-default.test.js +151 -0
- package/data/probe/npm/tests/contextCompactor.test.js +498 -0
- package/data/probe/npm/tests/delegate-config.test.js +353 -0
- package/data/probe/npm/tests/delegate-integration.test.js +348 -0
- package/data/probe/npm/tests/extractor-integration.test.js +162 -0
- package/data/probe/npm/tests/extractor.test.js +317 -0
- package/data/probe/npm/tests/fixtures/sampleDiagrams.js +267 -0
- package/data/probe/npm/tests/integration/claude-code-auto-fallback.spec.js +148 -0
- package/data/probe/npm/tests/integration/claude-code-multi-step.spec.js +127 -0
- package/data/probe/npm/tests/integration/claude-code-tool-events.spec.js +163 -0
- package/data/probe/npm/tests/integration/codex-auto-fallback.spec.js +191 -0
- package/data/probe/npm/tests/integration/codex-tool-events.spec.js +147 -0
- package/data/probe/npm/tests/integration/examplesChatMcp.test.js +402 -0
- package/data/probe/npm/tests/integration/mcpDotenvSupport.test.js +174 -0
- package/data/probe/npm/tests/integration/mcpErrorHandling.test.js +566 -0
- package/data/probe/npm/tests/integration/mcpRobustness.test.js +564 -0
- package/data/probe/npm/tests/integration/mcpStdoutPurity.test.js +355 -0
- package/data/probe/npm/tests/integration/probeAgentMcp.test.js +398 -0
- package/data/probe/npm/tests/integration/retryFallback.test.js +368 -0
- package/data/probe/npm/tests/integration/schema-in-initial-message.test.js +318 -0
- package/data/probe/npm/tests/integration/schema-validation-loop-prevention.test.js +244 -0
- package/data/probe/npm/tests/integration/schemaRetryLogic.test.js +94 -0
- package/data/probe/npm/tests/integration/validationFlow.test.js +329 -0
- package/data/probe/npm/tests/manual/test-codex-basic.js +110 -0
- package/data/probe/npm/tests/mcp/mcpClientManager.test.js +614 -0
- package/data/probe/npm/tests/mcp/mcpConfig.test.js +359 -0
- package/data/probe/npm/tests/mcp/mcpXmlBridge.test.js +436 -0
- package/data/probe/npm/tests/mcp/mockMcpServer.js +510 -0
- package/data/probe/npm/tests/mcp-strict-syntax.test.js +319 -0
- package/data/probe/npm/tests/mermaidQuoteEscaping.test.js +214 -0
- package/data/probe/npm/tests/nestedQuoteFix.test.js +40 -0
- package/data/probe/npm/tests/setup.js +46 -0
- package/data/probe/npm/tests/unit/allowed-tools.test.js +513 -0
- package/data/probe/npm/tests/unit/attempt-completion-closing-tag-in-content.test.js +188 -0
- package/data/probe/npm/tests/unit/attemptCompletionJsonFix.test.js +238 -0
- package/data/probe/npm/tests/unit/attemptCompletionJsonIssue.test.js +128 -0
- package/data/probe/npm/tests/unit/backtickAutoFix.test.js +35 -0
- package/data/probe/npm/tests/unit/bash-probe-agent-integration.test.js +389 -0
- package/data/probe/npm/tests/unit/bash-simple-commands.test.js +324 -0
- package/data/probe/npm/tests/unit/bash-tool-comprehensive.test.js +371 -0
- package/data/probe/npm/tests/unit/bash-tool-integration.test.js +310 -0
- package/data/probe/npm/tests/unit/bash-tool.test.js +341 -0
- package/data/probe/npm/tests/unit/completion-prompt.test.js +379 -0
- package/data/probe/npm/tests/unit/cwd-path-options.test.js +287 -0
- package/data/probe/npm/tests/unit/delegate-limits.test.js +422 -0
- package/data/probe/npm/tests/unit/direct-content-attempt-completion.test.js +235 -0
- package/data/probe/npm/tests/unit/edit-create-tools.test.js +609 -0
- package/data/probe/npm/tests/unit/enhancedMermaidValidation.test.js +577 -0
- package/data/probe/npm/tests/unit/extract-content.test.js +83 -0
- package/data/probe/npm/tests/unit/extract-multiple-targets.test.js +89 -0
- package/data/probe/npm/tests/unit/fallbackManager.test.js +442 -0
- package/data/probe/npm/tests/unit/githubCompatibilityValidation.test.js +258 -0
- package/data/probe/npm/tests/unit/imageConfig.test.js +149 -0
- package/data/probe/npm/tests/unit/imagePathResolution.test.js +345 -0
- package/data/probe/npm/tests/unit/json-fixing-agent.test.js +238 -0
- package/data/probe/npm/tests/unit/json-validation-enhanced-errors.test.js +199 -0
- package/data/probe/npm/tests/unit/jsonValidationInfiniteLoopFix.test.js +228 -0
- package/data/probe/npm/tests/unit/maidIntegration.test.js +139 -0
- package/data/probe/npm/tests/unit/maxIterationsWarning.test.js +195 -0
- package/data/probe/npm/tests/unit/mermaidEdgeLabelFix.test.js +161 -0
- package/data/probe/npm/tests/unit/mermaidHtmlEntities.test.js +76 -0
- package/data/probe/npm/tests/unit/mermaidInfiniteLoopFix.test.js +64 -0
- package/data/probe/npm/tests/unit/mermaidValidation.test.js +723 -0
- package/data/probe/npm/tests/unit/mermaidValidationVisorExample.test.js +309 -0
- package/data/probe/npm/tests/unit/probe-agent-clone-realistic.test.js +643 -0
- package/data/probe/npm/tests/unit/probe-agent-clone.test.js +476 -0
- package/data/probe/npm/tests/unit/probe-agent-delegate.test.js +400 -0
- package/data/probe/npm/tests/unit/probe-agent-model-option.test.js +118 -0
- package/data/probe/npm/tests/unit/probeTool-security.test.js +283 -0
- package/data/probe/npm/tests/unit/readImageTool.test.js +418 -0
- package/data/probe/npm/tests/unit/retryManager.test.js +317 -0
- package/data/probe/npm/tests/unit/schema-aware-reminders.test.js +288 -0
- package/data/probe/npm/tests/unit/schemaDefinitionDetection.test.js +115 -0
- package/data/probe/npm/tests/unit/schemaUtils.test.js +1268 -0
- package/data/probe/npm/tests/unit/simpleTelemetry.test.js +282 -0
- package/data/probe/npm/tests/unit/simplified-attempt-completion.test.js +274 -0
- package/data/probe/npm/tests/unit/single-quote-json-bug.test.js +231 -0
- package/data/probe/npm/tests/unit/subgraphAutoFix.test.js +110 -0
- package/data/probe/npm/tests/unit/system-prompt.test.js +32 -0
- package/data/probe/npm/tests/unit/types-probe-agent-options.test.js +42 -0
- package/data/probe/npm/tests/unit/xmlParsing.test.js +720 -0
- package/data/probe/npm/tsconfig.json +21 -0
- package/data/probe/result1.txt +19 -0
- package/data/probe/result2.txt +26 -0
- package/data/probe/scripts/benchmark.sh +270 -0
- package/data/probe/scripts/cache_memory_analysis.rs +844 -0
- package/data/probe/scripts/claude-hook-wrapper.sh +56 -0
- package/data/probe/site/.env.example +10 -0
- package/data/probe/site/DEPLOYMENT.md +86 -0
- package/data/probe/site/README.md +183 -0
- package/data/probe/site/adding-languages.md +135 -0
- package/data/probe/site/ai-chat.md +427 -0
- package/data/probe/site/ai-integration.md +1488 -0
- package/data/probe/site/blog/agentic-flow-custom-xml-protocol.md +407 -0
- package/data/probe/site/blog/index.md +118 -0
- package/data/probe/site/blog/v0.6.0-release.md +426 -0
- package/data/probe/site/blog.md +8 -0
- package/data/probe/site/changelog.md +200 -0
- package/data/probe/site/cli-mode.md +437 -0
- package/data/probe/site/code-extraction.md +436 -0
- package/data/probe/site/contributing/README.md +9 -0
- package/data/probe/site/contributing/documentation-cross-references.md +215 -0
- package/data/probe/site/contributing/documentation-maintenance.md +275 -0
- package/data/probe/site/contributing/documentation-structure.md +75 -0
- package/data/probe/site/documentation-cross-references.md +215 -0
- package/data/probe/site/documentation-guide.md +132 -0
- package/data/probe/site/documentation-maintenance.md +275 -0
- package/data/probe/site/features.md +147 -0
- package/data/probe/site/how-it-works.md +118 -0
- package/data/probe/site/index.md +175 -0
- package/data/probe/site/index.md.bak +133 -0
- package/data/probe/site/installation.md +235 -0
- package/data/probe/site/integrations/docker.md +248 -0
- package/data/probe/site/integrations/github-actions.md +413 -0
- package/data/probe/site/language-support-overview.md +168 -0
- package/data/probe/site/mcp-integration.md +587 -0
- package/data/probe/site/mcp-server.md +304 -0
- package/data/probe/site/navigation-structure.md +76 -0
- package/data/probe/site/nodejs-sdk.md +798 -0
- package/data/probe/site/output-formats.md +625 -0
- package/data/probe/site/package.json +21 -0
- package/data/probe/site/public/_headers +28 -0
- package/data/probe/site/public/_redirects +11 -0
- package/data/probe/site/quick-start.md +289 -0
- package/data/probe/site/search-functionality.md +291 -0
- package/data/probe/site/search-reference.md +291 -0
- package/data/probe/site/supported-languages.md +215 -0
- package/data/probe/site/use-cases/README.md +8 -0
- package/data/probe/site/use-cases/advanced-cli.md +253 -0
- package/data/probe/site/use-cases/ai-code-editors.md +239 -0
- package/data/probe/site/use-cases/building-ai-tools.md +529 -0
- package/data/probe/site/use-cases/cli-ai-workflows.md +285 -0
- package/data/probe/site/use-cases/deploying-probe-web-interface.md +255 -0
- package/data/probe/site/use-cases/integrating-probe-into-ai-code-editors.md +161 -0
- package/data/probe/site/use-cases/nodejs-sdk.md +596 -0
- package/data/probe/site/use-cases/team-chat.md +350 -0
- package/data/probe/site/web-interface.md +434 -0
- package/data/probe/site/wrangler.toml +9 -0
- package/data/probe/test-api-key.sh +1 -0
- package/data/probe/test-probe-implementation/hello.js +7 -0
- package/data/probe/test_cases/demonstrate_early_termination_issues.sh +176 -0
- package/data/probe/test_cases/early_termination_issues.rs +533 -0
- package/data/probe/test_data/test_nested_struct.go +26 -0
- package/data/probe/tests/README.md +286 -0
- package/data/probe/tests/README_search_determinism_tests.md +116 -0
- package/data/probe/tests/adjacent_comment_test.rs +152 -0
- package/data/probe/tests/apostrophe_handling_tests.rs +132 -0
- package/data/probe/tests/block_filtering_with_ast_tests.rs +669 -0
- package/data/probe/tests/block_merging_tests.rs +396 -0
- package/data/probe/tests/c_outline_format_tests.rs +2179 -0
- package/data/probe/tests/cache_invalidation_issues.rs.disabled +682 -0
- package/data/probe/tests/cache_order_tests.rs +147 -0
- package/data/probe/tests/cache_query_scoping_tests.rs +221 -0
- package/data/probe/tests/cli_tests.rs +680 -0
- package/data/probe/tests/comment_context_integration_test.rs +240 -0
- package/data/probe/tests/common.rs +33 -0
- package/data/probe/tests/complex_block_merging_tests.rs +599 -0
- package/data/probe/tests/complex_query_block_filtering_tests.rs +422 -0
- package/data/probe/tests/control_flow_closing_braces_test.rs +91 -0
- package/data/probe/tests/cpp_outline_format_tests.rs +1507 -0
- package/data/probe/tests/csharp_outline_format_tests.rs +941 -0
- package/data/probe/tests/elastic_query_integration_tests.rs +922 -0
- package/data/probe/tests/extract_command_tests.rs +1848 -0
- package/data/probe/tests/extract_deduplication_tests.rs +146 -0
- package/data/probe/tests/extract_input_file_tests.rs +84 -0
- package/data/probe/tests/extract_prompt_tests.rs +102 -0
- package/data/probe/tests/filename_search_tests.rs +96 -0
- package/data/probe/tests/fixtures/user/AssemblyInfo.cs +3 -0
- package/data/probe/tests/github_extract_tests.rs +234 -0
- package/data/probe/tests/go_comment_test.rs +253 -0
- package/data/probe/tests/go_outline_format_tests.rs +2587 -0
- package/data/probe/tests/go_path_resolver_tests.rs +96 -0
- package/data/probe/tests/html_outline_format_tests.rs +637 -0
- package/data/probe/tests/integration_tests.rs +837 -0
- package/data/probe/tests/ip_whitelist_test.rs +148 -0
- package/data/probe/tests/java_outline_format_tests.rs +1611 -0
- package/data/probe/tests/javascript_extract_tests.rs +315 -0
- package/data/probe/tests/javascript_outline_format_tests.rs +1464 -0
- package/data/probe/tests/json_format_tests.rs +436 -0
- package/data/probe/tests/json_schema_validation_tests.rs +450 -0
- package/data/probe/tests/lib_usage.rs +60 -0
- package/data/probe/tests/line_comment_context_extension_test.rs +459 -0
- package/data/probe/tests/line_map_cache_tests.rs +114 -0
- package/data/probe/tests/markdown_integration_tests.rs +190 -0
- package/data/probe/tests/mocks/test_ip_whitelist.go +11 -0
- package/data/probe/tests/mocks/test_object.js +27 -0
- package/data/probe/tests/mocks/test_struct.go +50 -0
- package/data/probe/tests/multi_keyword_pattern_tests.rs +464 -0
- package/data/probe/tests/multi_language_syntax_integration_tests.rs +218 -0
- package/data/probe/tests/multiple_capture_groups_tests.rs +169 -0
- package/data/probe/tests/negative_compound_word_tests.rs +246 -0
- package/data/probe/tests/nested_symbol_extraction_tests.rs +99 -0
- package/data/probe/tests/outline_cross_file_interference_test.rs +335 -0
- package/data/probe/tests/outline_keyword_preservation_test.rs +67 -0
- package/data/probe/tests/output_format_edge_cases_tests.rs +693 -0
- package/data/probe/tests/parallel_extraction_tests.rs +178 -0
- package/data/probe/tests/parallel_search_tests.rs +355 -0
- package/data/probe/tests/path_resolver_tests.rs +698 -0
- package/data/probe/tests/php_outline_format_extended_tests.rs +928 -0
- package/data/probe/tests/php_outline_format_tests.rs +768 -0
- package/data/probe/tests/property_tests.proptest-regressions +9 -0
- package/data/probe/tests/property_tests.rs +118 -0
- package/data/probe/tests/python_outline_format_tests.rs +1538 -0
- package/data/probe/tests/query_command_json_tests.rs +438 -0
- package/data/probe/tests/query_command_tests.rs +232 -0
- package/data/probe/tests/query_command_xml_tests.rs +569 -0
- package/data/probe/tests/quoted_term_with_negative_keyword_tests.rs +216 -0
- package/data/probe/tests/required_terms_filename_tests.rs +116 -0
- package/data/probe/tests/ruby_outline_format_tests.rs +1011 -0
- package/data/probe/tests/rust_line_comment_context_test.rs +151 -0
- package/data/probe/tests/rust_outline_format_enhanced_tests.rs +725 -0
- package/data/probe/tests/rust_outline_format_tests.rs +843 -0
- package/data/probe/tests/schemas/xml_output_schema.xsd +38 -0
- package/data/probe/tests/search_determinism_tests.rs +451 -0
- package/data/probe/tests/search_hints_tests.rs +253 -0
- package/data/probe/tests/special_character_escaping_tests.rs +417 -0
- package/data/probe/tests/stemming_compound_word_filtering_tests.rs +535 -0
- package/data/probe/tests/strict_elastic_syntax_tests.rs +404 -0
- package/data/probe/tests/swift_outline_format_tests.rs +3319 -0
- package/data/probe/tests/symbols_tests.rs +166 -0
- package/data/probe/tests/test_file.rs +45 -0
- package/data/probe/tests/test_tokenize.rs +28 -0
- package/data/probe/tests/timeout_tests.rs +82 -0
- package/data/probe/tests/tokenization_tests.rs +195 -0
- package/data/probe/tests/tokenized_block_filtering_tests.rs +174 -0
- package/data/probe/tests/typescript_extract_tests.rs +214 -0
- package/data/probe/tests/typescript_outline_format_tests.rs +2188 -0
- package/data/probe/tests/xml_format_tests.rs +568 -0
- package/data/probe/tests/xml_schema_validation_tests.rs +497 -0
- package/data/scripts/postinstall.mjs +9 -0
- package/data/scripts/set-version.js +0 -0
- package/data/scripts/wiki-build.sh +111 -0
- package/data/scripts/wiki-deploy.sh +73 -0
- package/data/serve.json +12 -0
- package/data/test/demo-dynamic.html +134 -0
- package/data/test/demo-esm.html +105 -0
- package/data/test/demo-iife.html +78 -0
- package/data/tsconfig.json +7 -0
- package/data/vite.server.ts +483 -0
- package/data/vitest.config.ts +40 -0
- package/data/wiki/Home.md +58 -0
- package/data/wiki/_Sidebar.md +39 -0
- package/docs-mcp.config.json +20 -0
- package/package.json +56 -0
- package/src/config.js +111 -0
- package/src/index.js +395 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with the probe codebase.
|
|
4
|
+
|
|
5
|
+
**IMPORTANT**: ALWAYS use code-search-agent to navigate the codebase and ask questions about it.
|
|
6
|
+
|
|
7
|
+
## Project Overview
|
|
8
|
+
|
|
9
|
+
Probe is an AI-friendly, fully local, semantic code search tool built in Rust that combines ripgrep's speed with tree-sitter's AST parsing. It's designed to power AI coding assistants with precise, context-aware code search and extraction capabilities.
|
|
10
|
+
|
|
11
|
+
## Development Guidelines
|
|
12
|
+
|
|
13
|
+
### 1. Testing Requirements
|
|
14
|
+
|
|
15
|
+
**EVERY feature, bug fix, or change MUST include tests:**
|
|
16
|
+
- Unit tests for new functions/modules (in same file using `#[cfg(test)]`)
|
|
17
|
+
- Integration tests for cross-module functionality (in `tests/` directory)
|
|
18
|
+
- CLI tests for command-line interface changes (`tests/cli_tests.rs`)
|
|
19
|
+
- Property-based tests with `proptest` for complex logic
|
|
20
|
+
- Test coverage for edge cases and error conditions
|
|
21
|
+
|
|
22
|
+
**Test patterns in this codebase:**
|
|
23
|
+
```rust
|
|
24
|
+
#[cfg(test)]
|
|
25
|
+
mod tests {
|
|
26
|
+
use super::*;
|
|
27
|
+
|
|
28
|
+
#[test]
|
|
29
|
+
fn test_feature_name() {
|
|
30
|
+
// Arrange
|
|
31
|
+
let input = create_test_data();
|
|
32
|
+
|
|
33
|
+
// Act
|
|
34
|
+
let result = function_under_test(input);
|
|
35
|
+
|
|
36
|
+
// Assert
|
|
37
|
+
assert_eq!(result, expected_value);
|
|
38
|
+
assert!(condition);
|
|
39
|
+
assert_ne!(unexpected, actual);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Before committing:**
|
|
45
|
+
```bash
|
|
46
|
+
make test # Run all tests (unit + integration + CLI)
|
|
47
|
+
make test-unit # Run unit tests only
|
|
48
|
+
make test-cli # Run CLI tests
|
|
49
|
+
make test-property # Run property-based tests
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Error Handling
|
|
53
|
+
|
|
54
|
+
**Always use proper error handling with anyhow:**
|
|
55
|
+
```rust
|
|
56
|
+
use anyhow::{Context, Result};
|
|
57
|
+
|
|
58
|
+
// Good - use Result<T> with context
|
|
59
|
+
pub fn parse_file(path: &Path) -> Result<ParsedData> {
|
|
60
|
+
let content = fs::read_to_string(path)
|
|
61
|
+
.context(format!("Failed to read file: {:?}", path))?;
|
|
62
|
+
|
|
63
|
+
parse_content(&content)
|
|
64
|
+
.context("Failed to parse file content")
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Bad - using unwrap() in production code
|
|
68
|
+
pub fn parse_file(path: &Path) -> ParsedData {
|
|
69
|
+
let content = fs::read_to_string(path).unwrap(); // NO!
|
|
70
|
+
parse_content(&content).unwrap() // NO!
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Key patterns:**
|
|
75
|
+
- Return `Result<T>` for all fallible operations
|
|
76
|
+
- Use `.context()` to add error context
|
|
77
|
+
- Use `anyhow::Error` for flexible error handling
|
|
78
|
+
- Create custom error types when domain-specific errors needed
|
|
79
|
+
- Never use `.unwrap()` except in tests
|
|
80
|
+
|
|
81
|
+
### 3. Code Quality Standards
|
|
82
|
+
|
|
83
|
+
**Before EVERY commit run these commands:**
|
|
84
|
+
```bash
|
|
85
|
+
make format # Format code with rustfmt
|
|
86
|
+
make lint # Run clippy linter
|
|
87
|
+
make test # Run all tests
|
|
88
|
+
# OR simply:
|
|
89
|
+
make fix-all # Runs format + lint fixes + tests
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Code organization principles:**
|
|
93
|
+
- Keep modules focused and single-purpose
|
|
94
|
+
- Use descriptive names (avoid abbreviations like `cfg`, `ctx`)
|
|
95
|
+
- Add doc comments (`///`) for all public APIs
|
|
96
|
+
- Keep functions under 50 lines when possible
|
|
97
|
+
- Group related functionality in modules
|
|
98
|
+
|
|
99
|
+
### 4. Performance Considerations
|
|
100
|
+
|
|
101
|
+
- Profile before optimizing using `DEBUG=1` environment variable
|
|
102
|
+
- Document performance-critical code with comments
|
|
103
|
+
- Prefer lazy evaluation and iterators over collecting
|
|
104
|
+
- Use `rayon` for CPU-bound parallel tasks
|
|
105
|
+
- Leverage caching for expensive operations
|
|
106
|
+
- See `docs/PERFORMANCE_OPTIMIZATION.md` for detailed methodology
|
|
107
|
+
|
|
108
|
+
### 5. Adding New Features
|
|
109
|
+
|
|
110
|
+
**Process for new features:**
|
|
111
|
+
1. Search existing code for similar patterns using probe itself
|
|
112
|
+
2. Write tests FIRST (TDD approach)
|
|
113
|
+
3. Implement the feature
|
|
114
|
+
4. Ensure all tests pass
|
|
115
|
+
5. Update relevant documentation
|
|
116
|
+
6. Run `make fix-all` before committing
|
|
117
|
+
|
|
118
|
+
**For new language support:**
|
|
119
|
+
1. Add tree-sitter parser to `Cargo.toml`
|
|
120
|
+
2. Create module in `src/language/` implementing `Language` trait
|
|
121
|
+
3. Add comprehensive tests including test detection
|
|
122
|
+
4. Register in `src/language/factory.rs`
|
|
123
|
+
5. Update docs in `site/supported-languages.md`
|
|
124
|
+
|
|
125
|
+
## Common Commands
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Building
|
|
129
|
+
make build # Debug build
|
|
130
|
+
cargo build --release # Release build with optimizations
|
|
131
|
+
|
|
132
|
+
# Testing & Quality
|
|
133
|
+
make test # All tests
|
|
134
|
+
make test-unit # Unit tests only
|
|
135
|
+
make lint # Run clippy
|
|
136
|
+
make format # Format code
|
|
137
|
+
make fix-all # Fix everything automatically
|
|
138
|
+
|
|
139
|
+
# Running probe
|
|
140
|
+
cargo run -- search "query" ./path
|
|
141
|
+
cargo run -- extract file.rs:42
|
|
142
|
+
probe search "function" ./src --max-results 10
|
|
143
|
+
|
|
144
|
+
# Performance debugging
|
|
145
|
+
DEBUG=1 probe search "query" ./path # Shows timing information
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Architecture Quick Reference
|
|
149
|
+
|
|
150
|
+
### Core Components
|
|
151
|
+
- `src/language/` - Language parsers using tree-sitter
|
|
152
|
+
- `src/search/` - Search engine with Elastic query support
|
|
153
|
+
- `src/extract/` - Code extraction logic
|
|
154
|
+
- `src/ranking.rs` - BM25 and TF-IDF ranking
|
|
155
|
+
- `src/simd_ranking.rs` - SIMD-optimized ranking
|
|
156
|
+
|
|
157
|
+
### Key Design Patterns
|
|
158
|
+
- **Result<T> everywhere**: All fallible operations return Result
|
|
159
|
+
- **Lazy evaluation**: Parse only what's needed
|
|
160
|
+
- **Parallel processing**: Use rayon for file processing
|
|
161
|
+
- **Caching**: Multiple cache levels (parser pool, tree cache, search cache)
|
|
162
|
+
- **Zero-copy where possible**: Use references and slices
|
|
163
|
+
|
|
164
|
+
## GitHub Integration
|
|
165
|
+
|
|
166
|
+
**ALWAYS use `gh` CLI for GitHub operations:**
|
|
167
|
+
```bash
|
|
168
|
+
gh issue view <number> --comments # View issue with full discussion
|
|
169
|
+
gh pr view <number> --comments # View PR with reviews
|
|
170
|
+
gh pr create # Create pull request
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Project-Specific Patterns
|
|
174
|
+
|
|
175
|
+
### Testing Patterns
|
|
176
|
+
- Unit tests use `#[cfg(test)]` modules in same file
|
|
177
|
+
- Integration tests go in `tests/` directory
|
|
178
|
+
- Use `assert!`, `assert_eq!`, `assert_ne!` macros
|
|
179
|
+
- Property tests with `proptest` for fuzzing
|
|
180
|
+
- Test both success and error cases
|
|
181
|
+
|
|
182
|
+
### Module Organization
|
|
183
|
+
```rust
|
|
184
|
+
// Standard module layout
|
|
185
|
+
pub mod module_name; // Public module
|
|
186
|
+
mod internal_module; // Private module
|
|
187
|
+
pub use module_name::PublicItem; // Re-exports
|
|
188
|
+
|
|
189
|
+
#[cfg(test)]
|
|
190
|
+
mod tests { // Test module
|
|
191
|
+
use super::*;
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Common Idioms
|
|
196
|
+
- Use `Arc<>` for shared immutable data
|
|
197
|
+
- Prefer `&str` over `String` for function parameters
|
|
198
|
+
- Use `PathBuf` for owned paths, `&Path` for borrowed
|
|
199
|
+
- Implement `Display` and `Debug` for public types
|
|
200
|
+
- Use `#[derive()]` for common traits
|
|
201
|
+
|
|
202
|
+
## Important Notes
|
|
203
|
+
|
|
204
|
+
### NPM Package Management
|
|
205
|
+
When adding files to `examples/chat/`, ALWAYS update the `files` array in `examples/chat/package.json`.
|
|
206
|
+
|
|
207
|
+
### Pre-commit Hook
|
|
208
|
+
The project has git hooks in `.githooks/`. Install with:
|
|
209
|
+
```bash
|
|
210
|
+
make install-hooks
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Debugging Tips
|
|
214
|
+
- Use `DEBUG=1` for verbose output
|
|
215
|
+
- Check `error.log` for detailed errors
|
|
216
|
+
- Use `RUST_BACKTRACE=1` for stack traces
|
|
217
|
+
- Profile with `cargo flamegraph` for performance
|
|
218
|
+
|
|
219
|
+
## Getting Help
|
|
220
|
+
|
|
221
|
+
1. Search codebase first: `probe search "topic" ./src`
|
|
222
|
+
2. Check existing tests for usage examples
|
|
223
|
+
3. Review similar implementations
|
|
224
|
+
4. Consult docs in `site/` directory
|
|
225
|
+
|
|
226
|
+
Remember: **Quality > Speed**. Write tests, handle errors properly, and maintain code standards.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
email: leonsbox@gmail.com.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Contributing to Probe
|
|
2
|
+
|
|
3
|
+
Thank you for considering contributing to Probe! This document provides guidelines and instructions to make the contribution process smooth and effective.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [Development Setup](#development-setup)
|
|
9
|
+
- [Development Workflow](#development-workflow)
|
|
10
|
+
- [Pull Request Process](#pull-request-process)
|
|
11
|
+
- [Testing Guidelines](#testing-guidelines)
|
|
12
|
+
- [Coding Standards](#coding-standards)
|
|
13
|
+
- [Documentation](#documentation)
|
|
14
|
+
- [Release Process](#release-process)
|
|
15
|
+
|
|
16
|
+
## Code of Conduct
|
|
17
|
+
|
|
18
|
+
By participating in this project, you are expected to uphold our Code of Conduct. Please report unacceptable behavior to the project maintainers.
|
|
19
|
+
|
|
20
|
+
## Development Setup
|
|
21
|
+
|
|
22
|
+
### Prerequisites
|
|
23
|
+
|
|
24
|
+
- Rust and Cargo (latest stable version)
|
|
25
|
+
- Git
|
|
26
|
+
- Make (for using the Makefile commands)
|
|
27
|
+
|
|
28
|
+
### Getting Started
|
|
29
|
+
|
|
30
|
+
1. Fork the repository on GitHub
|
|
31
|
+
2. Clone your fork locally:
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/YOUR-USERNAME/probe.git
|
|
34
|
+
cd probe
|
|
35
|
+
```
|
|
36
|
+
3. Set up the git hooks to ensure code quality:
|
|
37
|
+
```bash
|
|
38
|
+
make install-hooks
|
|
39
|
+
```
|
|
40
|
+
4. Add the original repository as a remote to keep your fork updated:
|
|
41
|
+
```bash
|
|
42
|
+
git remote add upstream https://github.com/probelabs/probe.git
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Building the Project
|
|
46
|
+
|
|
47
|
+
To build the project in debug mode:
|
|
48
|
+
```bash
|
|
49
|
+
make build
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
To run the application:
|
|
53
|
+
```bash
|
|
54
|
+
make run
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For a release build:
|
|
58
|
+
```bash
|
|
59
|
+
make run-release
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Development Workflow
|
|
63
|
+
|
|
64
|
+
1. Create a new branch for your feature or bugfix:
|
|
65
|
+
```bash
|
|
66
|
+
git checkout -b feature/your-feature-name
|
|
67
|
+
```
|
|
68
|
+
or
|
|
69
|
+
```bash
|
|
70
|
+
git checkout -b fix/issue-you-are-fixing
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
2. Make your changes, following the [Coding Standards](#coding-standards)
|
|
74
|
+
|
|
75
|
+
3. Run tests to ensure your changes don't break existing functionality:
|
|
76
|
+
```bash
|
|
77
|
+
make test
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
4. Format your code:
|
|
81
|
+
```bash
|
|
82
|
+
make format
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
5. Run the linter:
|
|
86
|
+
```bash
|
|
87
|
+
make lint
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
6. Commit your changes using the [Git Commit Message Guidelines](#git-commit-message-guidelines)
|
|
91
|
+
|
|
92
|
+
7. Push your branch to your fork:
|
|
93
|
+
```bash
|
|
94
|
+
git push origin feature/your-feature-name
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
8. Create a Pull Request from your fork to the main repository
|
|
98
|
+
|
|
99
|
+
## Pull Request Process
|
|
100
|
+
|
|
101
|
+
1. Ensure your PR includes a clear description of the changes and the purpose
|
|
102
|
+
2. Link any related issues using keywords like "Fixes #123" or "Resolves #456"
|
|
103
|
+
3. Make sure all tests pass and there are no linting errors
|
|
104
|
+
4. Add tests for new functionality
|
|
105
|
+
5. Update documentation as needed
|
|
106
|
+
6. Your PR will be reviewed by maintainers who may request changes
|
|
107
|
+
7. Once approved, your PR will be merged
|
|
108
|
+
|
|
109
|
+
## Testing Guidelines
|
|
110
|
+
|
|
111
|
+
Probe uses several types of tests to ensure quality:
|
|
112
|
+
|
|
113
|
+
### Running Tests
|
|
114
|
+
|
|
115
|
+
- Run all tests:
|
|
116
|
+
```bash
|
|
117
|
+
make test
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- Run specific test types:
|
|
121
|
+
```bash
|
|
122
|
+
make test-unit # Unit tests
|
|
123
|
+
make test-integration # Integration tests
|
|
124
|
+
make test-property # Property-based tests
|
|
125
|
+
make test-cli # CLI tests
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Writing Tests
|
|
129
|
+
|
|
130
|
+
- **Unit Tests**: Place in the same file as the code being tested, using Rust's `#[cfg(test)]` module
|
|
131
|
+
- **Integration Tests**: Add to the `tests/` directory
|
|
132
|
+
- **Property Tests**: Use the proptest framework for property-based testing
|
|
133
|
+
- **CLI Tests**: Test the command-line interface functionality
|
|
134
|
+
|
|
135
|
+
## Coding Standards
|
|
136
|
+
|
|
137
|
+
### Rust Style Guidelines
|
|
138
|
+
|
|
139
|
+
- Follow the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/)
|
|
140
|
+
- Use `rustfmt` for consistent formatting (run `make format`)
|
|
141
|
+
- Use `clippy` to catch common mistakes (run `make lint`)
|
|
142
|
+
|
|
143
|
+
### Git Commit Message Guidelines
|
|
144
|
+
|
|
145
|
+
- Use the present tense ("Add feature" not "Added feature")
|
|
146
|
+
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
|
147
|
+
- Limit the first line to 72 characters or less
|
|
148
|
+
- Reference issues and pull requests after the first line
|
|
149
|
+
- Consider using emoji prefixes for better readability:
|
|
150
|
+
- 🎨 `:art:` when improving code structure/format
|
|
151
|
+
- 🐎 `:racehorse:` when improving performance
|
|
152
|
+
- 📝 `:memo:` when writing docs
|
|
153
|
+
- 🐛 `:bug:` when fixing a bug
|
|
154
|
+
- ✅ `:white_check_mark:` when adding tests
|
|
155
|
+
- 🔒 `:lock:` when dealing with security
|
|
156
|
+
|
|
157
|
+
## Documentation
|
|
158
|
+
|
|
159
|
+
- Update the README.md if you change functionality
|
|
160
|
+
- Document all public API items with rustdoc comments
|
|
161
|
+
- Include examples in documentation where appropriate
|
|
162
|
+
- Generate documentation with:
|
|
163
|
+
```bash
|
|
164
|
+
make doc
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Adding Support for New Languages
|
|
168
|
+
|
|
169
|
+
If you want to add support for a new programming language:
|
|
170
|
+
|
|
171
|
+
1. Add the appropriate tree-sitter grammar dependency to `Cargo.toml`
|
|
172
|
+
2. Implement the language parser in the `src/language` directory
|
|
173
|
+
3. Update the language detection logic
|
|
174
|
+
4. Add tests for the new language support
|
|
175
|
+
5. Update the documentation to include the new supported language
|
|
176
|
+
|
|
177
|
+
## Release Process
|
|
178
|
+
|
|
179
|
+
Releases are managed by the project maintainers. The process involves:
|
|
180
|
+
|
|
181
|
+
1. Updating the version in `Cargo.toml`
|
|
182
|
+
2. Building release packages for all supported platforms:
|
|
183
|
+
```bash
|
|
184
|
+
VERSION=vX.Y.Z make release
|
|
185
|
+
```
|
|
186
|
+
3. Creating a new GitHub release with release notes
|
|
187
|
+
4. Publishing the updated package
|
|
188
|
+
|
|
189
|
+
## Questions?
|
|
190
|
+
|
|
191
|
+
If you have any questions about contributing, feel free to open an issue or contact the project maintainers.
|
|
192
|
+
|
|
193
|
+
Thank you for contributing to Probe!
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "probe-code"
|
|
3
|
+
version = "0.6.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.88.0"
|
|
6
|
+
authors = ["Leonid Bugaev <leonsbox@gmail.com>"]
|
|
7
|
+
description = "AI-friendly, fully local, semantic code search tool for large codebases"
|
|
8
|
+
license = "MIT"
|
|
9
|
+
repository = "https://github.com/probelabs/probe"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
keywords = ["search", "code", "ast", "grep", "semantic"]
|
|
12
|
+
categories = ["command-line-utilities", "development-tools", "text-processing"]
|
|
13
|
+
|
|
14
|
+
[lints.clippy]
|
|
15
|
+
# Allow uninlined format args for existing code - will be addressed in future cleanup
|
|
16
|
+
uninlined_format_args = "allow"
|
|
17
|
+
|
|
18
|
+
[dependencies]
|
|
19
|
+
ahash = "0.8.6" # Fast, non-cryptographic hash function
|
|
20
|
+
dashmap = "5.5.3" # Thread-safe concurrent HashMap
|
|
21
|
+
anyhow = "1.0"
|
|
22
|
+
atty = "0.2.13"
|
|
23
|
+
colored = "3.0.0"
|
|
24
|
+
dirs = "5.0.1"
|
|
25
|
+
ignore = "0.4"
|
|
26
|
+
tree-sitter = "0.24.5"
|
|
27
|
+
tree-sitter-rust = "0.23.2"
|
|
28
|
+
tree-sitter-javascript = "0.23.1"
|
|
29
|
+
tree-sitter-typescript = "0.23.2"
|
|
30
|
+
tree-sitter-python = "0.23.6"
|
|
31
|
+
tree-sitter-go = "0.23.4"
|
|
32
|
+
tree-sitter-c = "0.23.4"
|
|
33
|
+
tree-sitter-cpp = "0.23.4"
|
|
34
|
+
tree-sitter-java = "0.23.5"
|
|
35
|
+
tree-sitter-ruby = "0.23.1"
|
|
36
|
+
tree-sitter-php = "0.23.11"
|
|
37
|
+
tree-sitter-swift = { version = "0.7.0" }
|
|
38
|
+
tree-sitter-c-sharp = { version = "0.23.1" }
|
|
39
|
+
tree-sitter-html = "0.23.2"
|
|
40
|
+
tree-sitter-md = "0.3.2"
|
|
41
|
+
tree-sitter-yaml = "0.6.1"
|
|
42
|
+
ast-grep-core = "0.36.1"
|
|
43
|
+
ast-grep-language = "0.36.1"
|
|
44
|
+
clap = { version = "4.3", features = ["derive"] }
|
|
45
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
46
|
+
serde_json = "1.0"
|
|
47
|
+
rust-stemmers = "1.2"
|
|
48
|
+
tokio = { version = "1", features = ["full"] }
|
|
49
|
+
tiktoken-rs = "0.6.0"
|
|
50
|
+
regex = "1.9"
|
|
51
|
+
rayon = "1.8"
|
|
52
|
+
once_cell = "1.19.0"
|
|
53
|
+
decompound = "0.3.0"
|
|
54
|
+
lazy_static = "1.4.0"
|
|
55
|
+
rand = "0.8.5"
|
|
56
|
+
glob = "0.3.1"
|
|
57
|
+
arboard = "3.4.1"
|
|
58
|
+
md5 = "0.7.0"
|
|
59
|
+
lru = "0.12.5"
|
|
60
|
+
simsimd = "6.1.0" # SIMD-accelerated similarity metrics for vector operations
|
|
61
|
+
memchr = "2.7" # SIMD-accelerated string searching and processing
|
|
62
|
+
aho-corasick = "1.1" # SIMD-accelerated multi-pattern string matching
|
|
63
|
+
num_cpus = "1.16" # Detect number of CPUs for parallel processing
|
|
64
|
+
# BERT reranker dependencies - optional for ms-marco-tinybert reranker
|
|
65
|
+
candle-core = { version = "0.8", optional = true }
|
|
66
|
+
candle-nn = { version = "0.8", optional = true }
|
|
67
|
+
candle-transformers = { version = "0.8", optional = true }
|
|
68
|
+
tokenizers = { version = "0.20", optional = true }
|
|
69
|
+
hf-hub = { version = "0.3", features = ["tokio"], optional = true }
|
|
70
|
+
parking_lot = { version = "0.12", optional = true }
|
|
71
|
+
|
|
72
|
+
[dev-dependencies]
|
|
73
|
+
tempfile = "3.10.1"
|
|
74
|
+
proptest = "1.2"
|
|
75
|
+
criterion = "0.5"
|
|
76
|
+
roxmltree = "0.18.0"
|
|
77
|
+
jsonschema = "0.17.1"
|
|
78
|
+
|
|
79
|
+
[lib]
|
|
80
|
+
name = "probe_code"
|
|
81
|
+
path = "src/lib.rs"
|
|
82
|
+
|
|
83
|
+
[[bin]]
|
|
84
|
+
name = "probe"
|
|
85
|
+
path = "src/main.rs"
|
|
86
|
+
|
|
87
|
+
[features]
|
|
88
|
+
default = []
|
|
89
|
+
bert-reranker = [
|
|
90
|
+
"candle-core",
|
|
91
|
+
"candle-nn",
|
|
92
|
+
"candle-transformers",
|
|
93
|
+
"tokenizers",
|
|
94
|
+
"hf-hub",
|
|
95
|
+
"parking_lot"
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
[[bench]]
|
|
100
|
+
name = "search_benchmarks"
|
|
101
|
+
harness = false
|
|
102
|
+
|
|
103
|
+
[[bench]]
|
|
104
|
+
name = "timing_benchmarks"
|
|
105
|
+
harness = false
|
|
106
|
+
|
|
107
|
+
[[bench]]
|
|
108
|
+
name = "parsing_benchmarks"
|
|
109
|
+
harness = false
|
|
110
|
+
|
|
111
|
+
[[bench]]
|
|
112
|
+
name = "simd_benchmarks"
|
|
113
|
+
harness = false
|
|
114
|
+
|
|
115
|
+
[profile.release]
|
|
116
|
+
opt-level = "z" # Optimize for size ("s" also works, but "z" is smaller)
|
|
117
|
+
strip = true # Strip symbols automatically
|
|
118
|
+
lto = true # Link-time optimization
|
|
119
|
+
codegen-units = 1 # Slower compile, smaller binary
|
|
120
|
+
panic = "abort" # Ditch unwinding code
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Cross-compilation configuration for probe
|
|
2
|
+
# This configures the cross tool for ARM64 Linux builds
|
|
3
|
+
|
|
4
|
+
[build.env]
|
|
5
|
+
passthrough = [
|
|
6
|
+
"CARGO_INCREMENTAL",
|
|
7
|
+
"CARGO_TERM_COLOR",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
# Cross uses prebuilt images for musl targets; no per-target overrides needed.
|