octocode-cli 1.2.6 → 1.2.8
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/LICENSE +21 -63
- package/README.md +85 -142
- package/out/octocode-cli.js +7063 -6934
- package/package.json +8 -6
- package/skills/README.md +97 -120
- package/skills/octocode-code-engineer/.claude/settings.local.json +18 -0
- package/skills/octocode-code-engineer/.octocode/rfc/RFC-code-engineer-weakness-fixes.md +255 -0
- package/skills/octocode-code-engineer/.plan/VALIDATED_PLAN.md +223 -0
- package/skills/octocode-code-engineer/README.md +178 -0
- package/skills/octocode-code-engineer/SKILL.md +418 -0
- package/skills/octocode-code-engineer/coverage/architecture.ts.html +7828 -0
- package/skills/octocode-code-engineer/coverage/ast-helpers.ts.html +211 -0
- package/skills/octocode-code-engineer/coverage/ast-search.ts.html +1795 -0
- package/skills/octocode-code-engineer/coverage/base.css +224 -0
- package/skills/octocode-code-engineer/coverage/block-navigation.js +87 -0
- package/skills/octocode-code-engineer/coverage/cache.ts.html +376 -0
- package/skills/octocode-code-engineer/coverage/cli.ts.html +982 -0
- package/skills/octocode-code-engineer/coverage/clover.xml +3217 -0
- package/skills/octocode-code-engineer/coverage/collect-effects.ts.html +664 -0
- package/skills/octocode-code-engineer/coverage/collect-input-sources.ts.html +577 -0
- package/skills/octocode-code-engineer/coverage/collect-performance.ts.html +331 -0
- package/skills/octocode-code-engineer/coverage/collect-prototype-pollution.ts.html +421 -0
- package/skills/octocode-code-engineer/coverage/collect-security.ts.html +604 -0
- package/skills/octocode-code-engineer/coverage/collect-test-profile.ts.html +589 -0
- package/skills/octocode-code-engineer/coverage/coverage-final.json +30 -0
- package/skills/octocode-code-engineer/coverage/dependencies.ts.html +997 -0
- package/skills/octocode-code-engineer/coverage/dependency-summary.ts.html +688 -0
- package/skills/octocode-code-engineer/coverage/discovery.ts.html +322 -0
- package/skills/octocode-code-engineer/coverage/favicon.png +0 -0
- package/skills/octocode-code-engineer/coverage/graph-analytics.ts.html +1510 -0
- package/skills/octocode-code-engineer/coverage/index.html +536 -0
- package/skills/octocode-code-engineer/coverage/index.ts.html +826 -0
- package/skills/octocode-code-engineer/coverage/metrics.ts.html +553 -0
- package/skills/octocode-code-engineer/coverage/pipeline.ts.html +2044 -0
- package/skills/octocode-code-engineer/coverage/prettify.css +1 -0
- package/skills/octocode-code-engineer/coverage/prettify.js +2 -0
- package/skills/octocode-code-engineer/coverage/report-analysis.ts.html +1570 -0
- package/skills/octocode-code-engineer/coverage/report-writer.ts.html +1102 -0
- package/skills/octocode-code-engineer/coverage/security-detectors.ts.html +1747 -0
- package/skills/octocode-code-engineer/coverage/semantic-detectors.ts.html +2152 -0
- package/skills/octocode-code-engineer/coverage/semantic.ts.html +1897 -0
- package/skills/octocode-code-engineer/coverage/sort-arrow-sprite.png +0 -0
- package/skills/octocode-code-engineer/coverage/sorter.js +210 -0
- package/skills/octocode-code-engineer/coverage/summary-md.ts.html +1222 -0
- package/skills/octocode-code-engineer/coverage/test-quality-detectors.ts.html +1039 -0
- package/skills/octocode-code-engineer/coverage/tree-sitter-analyzer.ts.html +955 -0
- package/skills/octocode-code-engineer/coverage/ts-analyzer.ts.html +1213 -0
- package/skills/octocode-code-engineer/coverage/types.ts.html +2473 -0
- package/skills/octocode-code-engineer/coverage/utils.ts.html +820 -0
- package/skills/octocode-code-engineer/eslint.config.mjs +54 -0
- package/skills/octocode-code-engineer/minify-scripts.mjs +32 -0
- package/skills/octocode-code-engineer/package.json +54 -0
- package/skills/octocode-code-engineer/references/agent-ast-reading-rfc.md +95 -0
- package/skills/octocode-code-engineer/references/architecture-techniques.md +121 -0
- package/skills/octocode-code-engineer/references/ast-search.md +210 -0
- package/skills/octocode-code-engineer/references/ast-tree-search.md +151 -0
- package/skills/octocode-code-engineer/references/cli-reference.md +167 -0
- package/skills/octocode-code-engineer/references/concepts.md +107 -0
- package/skills/octocode-code-engineer/references/finding-categories.md +128 -0
- package/skills/octocode-code-engineer/references/improvement-roadmap.md +304 -0
- package/skills/octocode-code-engineer/references/output-files.md +144 -0
- package/skills/octocode-code-engineer/references/playbooks.md +204 -0
- package/skills/octocode-code-engineer/references/present-results.md +136 -0
- package/skills/octocode-code-engineer/references/tool-workflows.md +566 -0
- package/skills/octocode-code-engineer/references/validate-investigate.md +225 -0
- package/skills/octocode-code-engineer/scripts/analysis/dependencies.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/dependency-summary.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/discovery.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/graph-analytics.js +1 -0
- package/skills/octocode-code-engineer/scripts/analysis/semantic.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/helpers.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/metrics.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/search.js +2 -0
- package/skills/octocode-code-engineer/scripts/ast/tree-search.js +2 -0
- package/skills/octocode-code-engineer/scripts/ast/tree-sitter.js +1 -0
- package/skills/octocode-code-engineer/scripts/ast/ts-analyzer.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/chains.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/effects.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/input-sources.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/performance.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/prototype-pollution.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/security.js +1 -0
- package/skills/octocode-code-engineer/scripts/collectors/test-profile.js +1 -0
- package/skills/octocode-code-engineer/scripts/common/is-direct-run.js +1 -0
- package/skills/octocode-code-engineer/scripts/common/utils.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/code-quality.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/cohesion.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/coupling.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/cycle.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/dead-code.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/import-style.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/index.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/security.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/semantic.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/shared.js +1 -0
- package/skills/octocode-code-engineer/scripts/detectors/test-quality.js +1 -0
- package/skills/octocode-code-engineer/scripts/index.js +1 -0
- package/skills/octocode-code-engineer/scripts/pipeline/cache.js +1 -0
- package/skills/octocode-code-engineer/scripts/pipeline/cli.js +1 -0
- package/skills/octocode-code-engineer/scripts/pipeline/main.js +2 -0
- package/skills/octocode-code-engineer/scripts/reporting/analysis.js +1 -0
- package/skills/octocode-code-engineer/scripts/reporting/summary-md.js +1 -0
- package/skills/octocode-code-engineer/scripts/reporting/writer.js +1 -0
- package/skills/octocode-code-engineer/scripts/types/constants.js +1 -0
- package/skills/octocode-code-engineer/scripts/types/index.js +1 -0
- package/skills/octocode-code-engineer/scripts/types/interfaces.js +1 -0
- package/skills/octocode-code-engineer/src/analysis/dependencies.test.ts +545 -0
- package/skills/octocode-code-engineer/src/analysis/dependencies.ts +406 -0
- package/skills/octocode-code-engineer/src/analysis/dependency-summary.test.ts +566 -0
- package/skills/octocode-code-engineer/src/analysis/dependency-summary.ts +257 -0
- package/skills/octocode-code-engineer/src/analysis/discovery.test.ts +420 -0
- package/skills/octocode-code-engineer/src/analysis/discovery.ts +87 -0
- package/skills/octocode-code-engineer/src/analysis/graph-analytics.test.ts +449 -0
- package/skills/octocode-code-engineer/src/analysis/graph-analytics.ts +534 -0
- package/skills/octocode-code-engineer/src/analysis/semantic.test.ts +1533 -0
- package/skills/octocode-code-engineer/src/analysis/semantic.ts +830 -0
- package/skills/octocode-code-engineer/src/ast/helpers.test.ts +185 -0
- package/skills/octocode-code-engineer/src/ast/helpers.ts +62 -0
- package/skills/octocode-code-engineer/src/ast/metrics.test.ts +304 -0
- package/skills/octocode-code-engineer/src/ast/metrics.ts +204 -0
- package/skills/octocode-code-engineer/src/ast/search.test.ts +647 -0
- package/skills/octocode-code-engineer/src/ast/search.ts +648 -0
- package/skills/octocode-code-engineer/src/ast/tree-search.test.ts +199 -0
- package/skills/octocode-code-engineer/src/ast/tree-search.ts +392 -0
- package/skills/octocode-code-engineer/src/ast/tree-sitter.test.ts +407 -0
- package/skills/octocode-code-engineer/src/ast/tree-sitter.ts +402 -0
- package/skills/octocode-code-engineer/src/ast/ts-analyzer.test.ts +1864 -0
- package/skills/octocode-code-engineer/src/ast/ts-analyzer.ts +509 -0
- package/skills/octocode-code-engineer/src/collectors/chains.ts +74 -0
- package/skills/octocode-code-engineer/src/collectors/effects.test.ts +490 -0
- package/skills/octocode-code-engineer/src/collectors/effects.ts +332 -0
- package/skills/octocode-code-engineer/src/collectors/input-sources.test.ts +144 -0
- package/skills/octocode-code-engineer/src/collectors/input-sources.ts +196 -0
- package/skills/octocode-code-engineer/src/collectors/performance.test.ts +82 -0
- package/skills/octocode-code-engineer/src/collectors/performance.ts +141 -0
- package/skills/octocode-code-engineer/src/collectors/prototype-pollution.test.ts +55 -0
- package/skills/octocode-code-engineer/src/collectors/prototype-pollution.ts +162 -0
- package/skills/octocode-code-engineer/src/collectors/security.test.ts +124 -0
- package/skills/octocode-code-engineer/src/collectors/security.ts +309 -0
- package/skills/octocode-code-engineer/src/collectors/test-profile.test.ts +97 -0
- package/skills/octocode-code-engineer/src/collectors/test-profile.ts +269 -0
- package/skills/octocode-code-engineer/src/common/is-direct-run.test.ts +32 -0
- package/skills/octocode-code-engineer/src/common/is-direct-run.ts +13 -0
- package/skills/octocode-code-engineer/src/common/utils.test.ts +463 -0
- package/skills/octocode-code-engineer/src/common/utils.ts +304 -0
- package/skills/octocode-code-engineer/src/detectors/code-quality.ts +966 -0
- package/skills/octocode-code-engineer/src/detectors/cohesion.ts +539 -0
- package/skills/octocode-code-engineer/src/detectors/coupling.ts +323 -0
- package/skills/octocode-code-engineer/src/detectors/cycle.ts +349 -0
- package/skills/octocode-code-engineer/src/detectors/dead-code.ts +320 -0
- package/skills/octocode-code-engineer/src/detectors/import-style.ts +376 -0
- package/skills/octocode-code-engineer/src/detectors/index.test.ts +3061 -0
- package/skills/octocode-code-engineer/src/detectors/index.ts +88 -0
- package/skills/octocode-code-engineer/src/detectors/security.test.ts +882 -0
- package/skills/octocode-code-engineer/src/detectors/security.ts +821 -0
- package/skills/octocode-code-engineer/src/detectors/semantic.ts +758 -0
- package/skills/octocode-code-engineer/src/detectors/shared.ts +49 -0
- package/skills/octocode-code-engineer/src/detectors/test-quality.test.ts +388 -0
- package/skills/octocode-code-engineer/src/detectors/test-quality.ts +367 -0
- package/skills/octocode-code-engineer/src/index.test.ts +4425 -0
- package/skills/octocode-code-engineer/src/index.ts +403 -0
- package/skills/octocode-code-engineer/src/pipeline/cache.test.ts +199 -0
- package/skills/octocode-code-engineer/src/pipeline/cache.ts +130 -0
- package/skills/octocode-code-engineer/src/pipeline/cli.test.ts +493 -0
- package/skills/octocode-code-engineer/src/pipeline/cli.ts +344 -0
- package/skills/octocode-code-engineer/src/pipeline/main.test.ts +174 -0
- package/skills/octocode-code-engineer/src/pipeline/main.ts +1074 -0
- package/skills/octocode-code-engineer/src/pipeline.test.ts +84 -0
- package/skills/octocode-code-engineer/src/reporting/analysis.test.ts +782 -0
- package/skills/octocode-code-engineer/src/reporting/analysis.ts +688 -0
- package/skills/octocode-code-engineer/src/reporting/output-contract.test.ts +463 -0
- package/skills/octocode-code-engineer/src/reporting/summary-md.test.ts +421 -0
- package/skills/octocode-code-engineer/src/reporting/summary-md.ts +714 -0
- package/skills/octocode-code-engineer/src/reporting/writer.ts +430 -0
- package/skills/octocode-code-engineer/src/sanity.test.ts +47 -0
- package/skills/octocode-code-engineer/src/types/constants.ts +248 -0
- package/skills/octocode-code-engineer/src/types/index.ts +80 -0
- package/skills/octocode-code-engineer/src/types/interfaces.ts +682 -0
- package/skills/octocode-code-engineer/tsconfig.json +17 -0
- package/skills/octocode-code-engineer/vitest.config.ts +8 -0
- package/skills/octocode-documentation-writer/README.md +113 -0
- package/skills/octocode-documentation-writer/SKILL.md +886 -0
- package/skills/octocode-documentation-writer/references/agent-discovery-analysis.md +453 -0
- package/skills/octocode-documentation-writer/references/agent-documentation-writer.md +255 -0
- package/skills/octocode-documentation-writer/references/agent-engineer-questions.md +247 -0
- package/skills/octocode-documentation-writer/references/agent-orchestrator.md +370 -0
- package/skills/octocode-documentation-writer/references/agent-qa-validator.md +227 -0
- package/skills/octocode-documentation-writer/references/agent-researcher.md +250 -0
- package/skills/octocode-documentation-writer/schemas/analysis-schema.json +886 -0
- package/skills/octocode-documentation-writer/schemas/discovery-tasks.json +96 -0
- package/skills/octocode-documentation-writer/schemas/documentation-structure.json +373 -0
- package/skills/octocode-documentation-writer/schemas/partial-discovery-schema.json +102 -0
- package/skills/octocode-documentation-writer/schemas/partial-research-schema.json +98 -0
- package/skills/octocode-documentation-writer/schemas/qa-results-schema.json +113 -0
- package/skills/octocode-documentation-writer/schemas/questions-schema.json +228 -0
- package/skills/octocode-documentation-writer/schemas/research-schema.json +104 -0
- package/skills/octocode-documentation-writer/schemas/state-schema.json +222 -0
- package/skills/octocode-documentation-writer/schemas/work-assignments-schema.json +74 -0
- package/skills/octocode-plan/SKILL.md +122 -116
- package/skills/octocode-prompt-optimizer/SKILL.md +617 -0
- package/skills/octocode-pull-request-reviewer/README.md +249 -0
- package/skills/octocode-pull-request-reviewer/SKILL.md +479 -0
- package/skills/octocode-pull-request-reviewer/references/dependency-check.md +74 -0
- package/skills/octocode-pull-request-reviewer/references/domain-reviewers.md +24 -0
- package/skills/octocode-pull-request-reviewer/references/execution-lifecycle.md +441 -0
- package/skills/octocode-pull-request-reviewer/references/flow-analysis-protocol.md +64 -0
- package/skills/octocode-pull-request-reviewer/references/output-template.md +174 -0
- package/skills/octocode-pull-request-reviewer/references/parallel-agent-protocol.md +182 -0
- package/skills/octocode-pull-request-reviewer/references/review-guidelines.md +26 -0
- package/skills/octocode-pull-request-reviewer/references/verification-checklist.md +40 -0
- package/skills/octocode-research/.claude/settings.local.json +46 -0
- package/skills/octocode-research/.octocode/plan/code-review-fixes/plan.md +312 -0
- package/skills/octocode-research/.octocode/plan/code-review-fixes/research.md +212 -0
- package/skills/octocode-research/.octocode/plans/NODE_SERVER_START_PLAN.md +755 -0
- package/skills/octocode-research/.octocode/research/code-review/research.md +371 -0
- package/skills/octocode-research/.octocode/review/IMPROVEMENTS.md +391 -0
- package/skills/octocode-research/.octocode/review/REVIEW_PLAN.md +289 -0
- package/skills/octocode-research/.octocode/review/REVIEW_REPORT.md +356 -0
- package/skills/octocode-research/AGENTS.md +349 -0
- package/skills/octocode-research/README.md +494 -0
- package/skills/octocode-research/SKILL.md +652 -274
- package/skills/octocode-research/docs/API_REFERENCE.md +562 -0
- package/skills/octocode-research/docs/ARCHITECTURE.md +554 -0
- package/skills/octocode-research/docs/FLOWS.md +577 -0
- package/skills/octocode-research/docs/OVERVIEW.md +564 -0
- package/skills/octocode-research/docs/SERVER_FLOWS.md +631 -0
- package/skills/octocode-research/ecosystem.config.cjs +88 -0
- package/skills/octocode-research/eslint.config.mjs +27 -0
- package/skills/octocode-research/package.json +84 -0
- package/skills/octocode-research/references/GUARDRAILS.md +40 -0
- package/skills/octocode-research/references/PARALLEL_AGENT_PROTOCOL.md +178 -0
- package/skills/octocode-research/references/roast-prompt.md +149 -0
- package/skills/octocode-research/scripts/server-init.d.ts +2 -0
- package/skills/octocode-research/scripts/server-init.js +2 -0
- package/skills/octocode-research/scripts/server.d.ts +8 -0
- package/skills/octocode-research/scripts/server.js +445 -0
- package/skills/octocode-research/src/__tests__/integration/circuitBreaker.test.ts +205 -0
- package/skills/octocode-research/src/__tests__/integration/routes.test.ts +374 -0
- package/skills/octocode-research/src/__tests__/unit/circuitBreaker.test.ts +245 -0
- package/skills/octocode-research/src/__tests__/unit/errorHandler.test.ts +183 -0
- package/skills/octocode-research/src/__tests__/unit/httpPreprocess.test.ts +157 -0
- package/skills/octocode-research/src/__tests__/unit/logger.test.ts +143 -0
- package/skills/octocode-research/src/__tests__/unit/queryParser.test.ts +130 -0
- package/skills/octocode-research/src/__tests__/unit/responseBuilder.test.ts +469 -0
- package/skills/octocode-research/src/__tests__/unit/retry.test.ts +205 -0
- package/skills/octocode-research/src/index.ts +186 -0
- package/skills/octocode-research/src/mcpCache.ts +49 -0
- package/skills/octocode-research/src/middleware/errorHandler.ts +65 -0
- package/skills/octocode-research/src/middleware/logger.ts +61 -0
- package/skills/octocode-research/src/middleware/queryParser.ts +115 -0
- package/skills/octocode-research/src/middleware/readiness.ts +17 -0
- package/skills/octocode-research/src/routes/github.ts +197 -0
- package/skills/octocode-research/src/routes/local.ts +175 -0
- package/skills/octocode-research/src/routes/lsp.ts +177 -0
- package/skills/octocode-research/src/routes/package.ts +127 -0
- package/skills/octocode-research/src/routes/prompts.ts +138 -0
- package/skills/octocode-research/src/routes/tools.ts +677 -0
- package/skills/octocode-research/src/server-init.ts +363 -0
- package/skills/octocode-research/src/server.ts +285 -0
- package/skills/octocode-research/src/types/errorGuards.ts +151 -0
- package/skills/octocode-research/src/types/express.d.ts +76 -0
- package/skills/octocode-research/src/types/guards.ts +98 -0
- package/skills/octocode-research/src/types/mcp.ts +119 -0
- package/skills/octocode-research/src/types/responses.ts +199 -0
- package/skills/octocode-research/src/types/toolTypes.ts +33 -0
- package/skills/octocode-research/src/utils/asyncTimeout.ts +116 -0
- package/skills/octocode-research/src/utils/circuitBreaker.ts +492 -0
- package/skills/octocode-research/src/utils/colors.ts +53 -0
- package/skills/octocode-research/src/utils/errorQueue.ts +71 -0
- package/skills/octocode-research/src/utils/logEmoji.ts +103 -0
- package/skills/octocode-research/src/utils/logger.ts +413 -0
- package/skills/octocode-research/src/utils/resilience.ts +169 -0
- package/skills/octocode-research/src/utils/responseBuilder.ts +495 -0
- package/skills/octocode-research/src/utils/responseFactory.ts +100 -0
- package/skills/octocode-research/src/utils/responseParser.ts +272 -0
- package/skills/octocode-research/src/utils/retry.ts +280 -0
- package/skills/octocode-research/src/utils/routeFactory.ts +117 -0
- package/skills/octocode-research/src/utils/url.ts +20 -0
- package/skills/octocode-research/src/validation/httpPreprocess.ts +155 -0
- package/skills/octocode-research/src/validation/index.ts +2 -0
- package/skills/octocode-research/src/validation/schemas.ts +578 -0
- package/skills/octocode-research/src/validation/toolCallSchema.ts +132 -0
- package/skills/octocode-research/tsconfig.json +21 -0
- package/skills/octocode-research/tsdown.config.ts +42 -0
- package/skills/octocode-research/vitest.config.ts +20 -0
- package/skills/octocode-researcher/SKILL.md +461 -0
- package/skills/octocode-researcher/references/fallbacks.md +120 -0
- package/skills/{octocode-local-search → octocode-researcher}/references/tool-reference.md +132 -49
- package/skills/{octocode-local-search → octocode-researcher}/references/workflow-patterns.md +204 -4
- package/skills/octocode-rfc-generator/SKILL.md +223 -0
- package/skills/octocode-rfc-generator/references/rfc-template.md +193 -0
- package/skills/octocode-roast/SKILL.md +63 -21
- package/skills/octocode-implement/SKILL.md +0 -293
- package/skills/octocode-implement/references/execution-phases.md +0 -317
- package/skills/octocode-implement/references/tool-reference.md +0 -403
- package/skills/octocode-implement/references/workflow-patterns.md +0 -385
- package/skills/octocode-local-search/SKILL.md +0 -449
- package/skills/octocode-pr-review/SKILL.md +0 -391
- package/skills/octocode-pr-review/references/domain-reviewers.md +0 -105
- package/skills/octocode-pr-review/references/execution-lifecycle.md +0 -116
- package/skills/octocode-pr-review/references/research-flows.md +0 -75
- package/skills/octocode-research/references/tool-reference.md +0 -304
- package/skills/octocode-research/references/workflow-patterns.md +0 -325
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
# Octocode Research Skill - Research Document
|
|
2
|
+
|
|
3
|
+
**Generated:** 2026-01-18
|
|
4
|
+
**Version:** 2.0.0
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Overview](#overview)
|
|
11
|
+
- [Architecture](#architecture)
|
|
12
|
+
- [Core Components](#core-components)
|
|
13
|
+
- [API Reference](#api-reference)
|
|
14
|
+
- [Tool Registry](#tool-registry)
|
|
15
|
+
- [Resilience Patterns](#resilience-patterns)
|
|
16
|
+
- [Request Flow](#request-flow)
|
|
17
|
+
- [Response Formats](#response-formats)
|
|
18
|
+
- [File Structure](#file-structure)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
The **octocode-research** skill is an Express.js HTTP server that wraps `octocode-mcp` tools as REST endpoints for code research. It listens to **localhost** on port **1987** and provides:
|
|
25
|
+
|
|
26
|
+
| Feature | Description |
|
|
27
|
+
|---------|-------------|
|
|
28
|
+
| **Unified Tool API** | All tools via `POST /tools/call/:toolName` |
|
|
29
|
+
| **MCP-compatible** | Prompts, tools, and system context following MCP patterns |
|
|
30
|
+
| **Resilience** | Circuit breaker + retry with exponential backoff |
|
|
31
|
+
| **Throttling** | Gradual slowdown for high-frequency requests |
|
|
32
|
+
| **Session Telemetry** | Tool call tracking for analytics |
|
|
33
|
+
|
|
34
|
+
### Key Design Principle
|
|
35
|
+
|
|
36
|
+
> **All tools are executed via a unified `POST /tools/call/:toolName` endpoint, NOT individual GET routes.**
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Architecture
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
44
|
+
│ OCTOCODE RESEARCH SKILL │
|
|
45
|
+
├─────────────────────────────────────────────────────────────────────────────┤
|
|
46
|
+
│ HTTP Clients (curl/fetch) ←──────→ Express Server (port 1987) │
|
|
47
|
+
│ │ │
|
|
48
|
+
│ ┌──────────────────────┼───────────────────────┐ │
|
|
49
|
+
│ │ │ │ │
|
|
50
|
+
│ ▼ ▼ ▼ │
|
|
51
|
+
│ Local Tools LSP Tools GitHub Tools │
|
|
52
|
+
│ (ripgrep, fs) (semantic analysis) (API) │
|
|
53
|
+
│ │
|
|
54
|
+
│ localSearchCode lspGotoDefinition githubSearchCode │
|
|
55
|
+
│ localGetFileContent lspFindReferences githubGetFile... │
|
|
56
|
+
│ localFindFiles lspCallHierarchy githubViewRepo... │
|
|
57
|
+
│ localViewStructure githubSearchPR... │
|
|
58
|
+
│ packageSearch │
|
|
59
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
60
|
+
│
|
|
61
|
+
▼
|
|
62
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
63
|
+
│ EXTERNAL SYSTEMS │
|
|
64
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
65
|
+
│ │ Filesystem │ │ GitHub API │ │ NPM/PyPI │ │ LSP Server │ │
|
|
66
|
+
│ │ (ripgrep) │ │ (Octokit) │ │ APIs │ │ │ │
|
|
67
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
68
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Core Components
|
|
74
|
+
|
|
75
|
+
### 1. Server (`src/server.ts`)
|
|
76
|
+
|
|
77
|
+
The Express HTTP server that:
|
|
78
|
+
- Initializes MCP content cache at startup via `initializeMcpContent()`
|
|
79
|
+
- Initializes providers for GitHub token resolution via `initializeProviders()`
|
|
80
|
+
- Mounts `/tools` and `/prompts` route handlers
|
|
81
|
+
- Exposes `/health` endpoint for monitoring with circuit breaker states
|
|
82
|
+
- Handles graceful shutdown with `SIGTERM`/`SIGINT` handlers
|
|
83
|
+
|
|
84
|
+
**Key functions:**
|
|
85
|
+
- `createServer()` - Creates and configures the Express app
|
|
86
|
+
- `startServer()` - Starts the HTTP server on port 1987
|
|
87
|
+
- `gracefulShutdown()` - Cleans up contexts and circuits on shutdown
|
|
88
|
+
|
|
89
|
+
### 2. MCP Cache (`src/mcpCache.ts`)
|
|
90
|
+
|
|
91
|
+
Singleton cache that loads tool metadata **ONCE** at startup:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
export async function initializeMcpContent(): Promise<CompleteMetadata> {
|
|
95
|
+
if (mcpContent) return mcpContent;
|
|
96
|
+
|
|
97
|
+
initPromise = (async () => {
|
|
98
|
+
await initialize();
|
|
99
|
+
const content = await loadToolContent();
|
|
100
|
+
mcpContent = content;
|
|
101
|
+
return content;
|
|
102
|
+
})();
|
|
103
|
+
|
|
104
|
+
return initPromise;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function getMcpContent(): CompleteMetadata {
|
|
108
|
+
if (!mcpContent) {
|
|
109
|
+
throw new Error('mcpContent not initialized');
|
|
110
|
+
}
|
|
111
|
+
return mcpContent;
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 3. Index (`src/index.ts`)
|
|
116
|
+
|
|
117
|
+
Re-exports layer that maps `octocode-mcp` functions to skill-friendly names:
|
|
118
|
+
|
|
119
|
+
| Export | Source |
|
|
120
|
+
|--------|--------|
|
|
121
|
+
| `githubSearchCode` | `searchMultipleGitHubCode` |
|
|
122
|
+
| `githubGetFileContent` | `fetchMultipleGitHubFileContents` |
|
|
123
|
+
| `localSearchCode` | `executeRipgrepSearch` |
|
|
124
|
+
| `localGetFileContent` | `executeFetchContent` |
|
|
125
|
+
| `lspGotoDefinition` | `executeGotoDefinition` |
|
|
126
|
+
| `lspFindReferences` | `executeFindReferences` |
|
|
127
|
+
| `lspCallHierarchy` | `executeCallHierarchy` |
|
|
128
|
+
| `packageSearch` | `searchPackages` |
|
|
129
|
+
|
|
130
|
+
### 4. Routes (`src/routes/`)
|
|
131
|
+
|
|
132
|
+
| File | Mounted | Purpose |
|
|
133
|
+
|------|---------|---------|
|
|
134
|
+
| `tools.ts` | ✅ `/tools/*` | **Main API** - Tool discovery & execution |
|
|
135
|
+
| `prompts.ts` | ✅ `/prompts/*` | Prompt discovery |
|
|
136
|
+
| `local.ts` | ❌ | Handler logic (used in tests) |
|
|
137
|
+
| `lsp.ts` | ❌ | Handler logic (used in tests) |
|
|
138
|
+
| `github.ts` | ❌ | Handler logic (used in tests) |
|
|
139
|
+
| `package.ts` | ❌ | Handler logic (used in tests) |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## API Reference
|
|
144
|
+
|
|
145
|
+
### Discovery Endpoints
|
|
146
|
+
|
|
147
|
+
| Endpoint | Method | Description |
|
|
148
|
+
|----------|--------|-------------|
|
|
149
|
+
| `/health` | GET | Server health, memory usage, circuit breaker states |
|
|
150
|
+
| `/tools/list` | GET | List all tools (concise - name + description) |
|
|
151
|
+
| `/tools/info/:toolName` | GET | Get tool JSON schema + hints |
|
|
152
|
+
| `/tools/info` | GET | List all tools with details |
|
|
153
|
+
| `/tools/system` | GET | Get system prompt (load FIRST) |
|
|
154
|
+
| `/tools/initContext` | GET | Combined system prompt + all tool schemas (recommended for init) |
|
|
155
|
+
| `/tools/metadata` | GET | Get raw metadata (advanced) |
|
|
156
|
+
| `/prompts/list` | GET | List all prompts (MCP-compatible format) |
|
|
157
|
+
| `/prompts/info/:promptName` | GET | Get prompt content and arguments |
|
|
158
|
+
|
|
159
|
+
### Execution Endpoint
|
|
160
|
+
|
|
161
|
+
| Endpoint | Method | Description |
|
|
162
|
+
|----------|--------|-------------|
|
|
163
|
+
| `/tools/call/:toolName` | **POST** | **Execute any tool** |
|
|
164
|
+
|
|
165
|
+
**Request format:**
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"queries": [{
|
|
169
|
+
"mainResearchGoal": "Overall research objective",
|
|
170
|
+
"researchGoal": "This specific query's goal",
|
|
171
|
+
"reasoning": "Why this approach helps",
|
|
172
|
+
// ... tool-specific parameters
|
|
173
|
+
}]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Constraints:**
|
|
178
|
+
- `queries` must be an array with 1-3 items
|
|
179
|
+
- Each query must include research context parameters
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Tool Registry
|
|
184
|
+
|
|
185
|
+
The `TOOL_REGISTRY` in `src/routes/tools.ts` maps tool names to their functions and resilience wrappers:
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const TOOL_REGISTRY: Record<string, ToolEntry> = {
|
|
189
|
+
// GitHub tools
|
|
190
|
+
githubSearchCode: { fn: githubSearchCode, resilience: withGitHubResilience, category: 'github' },
|
|
191
|
+
githubGetFileContent: { fn: githubGetFileContent, resilience: withGitHubResilience, category: 'github' },
|
|
192
|
+
githubViewRepoStructure: { fn: githubViewRepoStructure, resilience: withGitHubResilience, category: 'github' },
|
|
193
|
+
githubSearchRepositories: { fn: githubSearchRepositories, resilience: withGitHubResilience, category: 'github' },
|
|
194
|
+
githubSearchPullRequests: { fn: githubSearchPullRequests, resilience: withGitHubResilience, category: 'github' },
|
|
195
|
+
|
|
196
|
+
// Local tools
|
|
197
|
+
localSearchCode: { fn: localSearchCode, resilience: withLocalResilience, category: 'local' },
|
|
198
|
+
localGetFileContent: { fn: localGetFileContent, resilience: withLocalResilience, category: 'local' },
|
|
199
|
+
localFindFiles: { fn: localFindFiles, resilience: withLocalResilience, category: 'local' },
|
|
200
|
+
localViewStructure: { fn: localViewStructure, resilience: withLocalResilience, category: 'local' },
|
|
201
|
+
|
|
202
|
+
// LSP tools
|
|
203
|
+
lspGotoDefinition: { fn: lspGotoDefinition, resilience: withLspResilience, category: 'lsp' },
|
|
204
|
+
lspFindReferences: { fn: lspFindReferences, resilience: withLspResilience, category: 'lsp' },
|
|
205
|
+
lspCallHierarchy: { fn: lspCallHierarchy, resilience: withLspResilience, category: 'lsp' },
|
|
206
|
+
|
|
207
|
+
// Package tools
|
|
208
|
+
packageSearch: { fn: packageSearch, resilience: withPackageResilience, category: 'package' },
|
|
209
|
+
};
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Available Tools (13 total)
|
|
213
|
+
|
|
214
|
+
| Tool | Category | Description |
|
|
215
|
+
|------|----------|-------------|
|
|
216
|
+
| `localSearchCode` | Local | Search code with ripgrep |
|
|
217
|
+
| `localGetFileContent` | Local | Read local file content |
|
|
218
|
+
| `localFindFiles` | Local | Find files by pattern/metadata |
|
|
219
|
+
| `localViewStructure` | Local | View directory tree |
|
|
220
|
+
| `lspGotoDefinition` | LSP | Go to symbol definition |
|
|
221
|
+
| `lspFindReferences` | LSP | Find all symbol references |
|
|
222
|
+
| `lspCallHierarchy` | LSP | Get call hierarchy (incoming/outgoing) |
|
|
223
|
+
| `githubSearchCode` | GitHub | Search code in repos |
|
|
224
|
+
| `githubGetFileContent` | GitHub | Read file from repo |
|
|
225
|
+
| `githubViewRepoStructure` | GitHub | View repo tree |
|
|
226
|
+
| `githubSearchRepositories` | GitHub | Search repositories |
|
|
227
|
+
| `githubSearchPullRequests` | GitHub | Search pull requests |
|
|
228
|
+
| `packageSearch` | Package | Search npm/PyPI |
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Resilience Patterns
|
|
233
|
+
|
|
234
|
+
### 1. Circuit Breaker (`src/utils/circuitBreaker.ts`)
|
|
235
|
+
|
|
236
|
+
Prevents cascading failures with three states:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
CLOSED (normal) ──[failures >= threshold]──► OPEN (reject all)
|
|
240
|
+
▲ │
|
|
241
|
+
│ [timeout]
|
|
242
|
+
│ │
|
|
243
|
+
└──[successes >= threshold]─── HALF-OPEN ◄─┘
|
|
244
|
+
(probe)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Default configuration:**
|
|
248
|
+
```typescript
|
|
249
|
+
const DEFAULT_CONFIG: CircuitBreakerConfig = {
|
|
250
|
+
failureThreshold: 3, // Failures before opening
|
|
251
|
+
successThreshold: 2, // Successes to close from half-open
|
|
252
|
+
resetTimeoutMs: 30000, // Time before half-open probe
|
|
253
|
+
};
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Per-service overrides:**
|
|
257
|
+
|
|
258
|
+
| Service | Failure Threshold | Success Threshold | Timeout |
|
|
259
|
+
|---------|-------------------|-------------------|---------|
|
|
260
|
+
| LSP | 3 | 1 | 10s |
|
|
261
|
+
| GitHub | 2 | 1 | 60s |
|
|
262
|
+
|
|
263
|
+
**Key functions:**
|
|
264
|
+
- `withCircuitBreaker(name, operation, fallback?)` - Execute with protection
|
|
265
|
+
- `getCircuitState(name)` - Monitor circuit health
|
|
266
|
+
- `configureCircuit(name, config)` - Customize thresholds
|
|
267
|
+
- `getAllCircuitStates()` - Health dashboard (used in `/health`)
|
|
268
|
+
|
|
269
|
+
### 2. Retry with Exponential Backoff (`src/utils/retry.ts`)
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
const RETRY_CONFIGS = {
|
|
273
|
+
lsp: {
|
|
274
|
+
maxAttempts: 3,
|
|
275
|
+
initialDelayMs: 500,
|
|
276
|
+
maxDelayMs: 5000,
|
|
277
|
+
backoffMultiplier: 2,
|
|
278
|
+
},
|
|
279
|
+
github: {
|
|
280
|
+
maxAttempts: 3,
|
|
281
|
+
initialDelayMs: 1000,
|
|
282
|
+
maxDelayMs: 30000,
|
|
283
|
+
backoffMultiplier: 3,
|
|
284
|
+
},
|
|
285
|
+
package: {
|
|
286
|
+
maxAttempts: 3,
|
|
287
|
+
initialDelayMs: 1000,
|
|
288
|
+
maxDelayMs: 15000,
|
|
289
|
+
backoffMultiplier: 2,
|
|
290
|
+
},
|
|
291
|
+
local: {
|
|
292
|
+
maxAttempts: 2,
|
|
293
|
+
initialDelayMs: 100,
|
|
294
|
+
maxDelayMs: 1000,
|
|
295
|
+
backoffMultiplier: 2,
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 3. Combined Resilience (`src/utils/resilience.ts`)
|
|
301
|
+
|
|
302
|
+
Four pre-configured wrappers that combine circuit breaker + retry:
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
export async function withGitHubResilience<T>(operation: () => Promise<T>, toolName: string): Promise<T>
|
|
306
|
+
export async function withLspResilience<T>(operation: () => Promise<T>, toolName: string): Promise<T>
|
|
307
|
+
export async function withLocalResilience<T>(operation: () => Promise<T>, toolName: string): Promise<T>
|
|
308
|
+
export async function withPackageResilience<T>(operation: () => Promise<T>, toolName: string): Promise<T>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### 4. Readiness Check (`src/middleware/readiness.ts`)
|
|
312
|
+
|
|
313
|
+
Middleware that verifies the server is ready to handle requests before processing them. Returns 503 Service Unavailable if the server is still initializing.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Request Flow
|
|
318
|
+
|
|
319
|
+
### Tool Execution Flow
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
POST /tools/call/localSearchCode
|
|
323
|
+
Body: { "queries": [{ "pattern": "auth", "path": "src", ... }] }
|
|
324
|
+
│
|
|
325
|
+
▼
|
|
326
|
+
┌─────────────────────────────────────┐
|
|
327
|
+
│ requestLogger Middleware │
|
|
328
|
+
│ → Log: tool, params, timestamp │
|
|
329
|
+
│ → Write to ~/.octocode/logs/ │
|
|
330
|
+
└────────┬────────────────────────────┘
|
|
331
|
+
│
|
|
332
|
+
▼
|
|
333
|
+
┌─────────────────────────────────────┐
|
|
334
|
+
│ Route Handler (routes/tools.ts) │
|
|
335
|
+
│ POST /tools/call/:toolName │
|
|
336
|
+
│ │
|
|
337
|
+
│ 1. Lookup tool in TOOL_REGISTRY │
|
|
338
|
+
│ 2. Validate queries array (1-3) │
|
|
339
|
+
│ 3. Get resilience wrapper │
|
|
340
|
+
└────────┬────────────────────────────┘
|
|
341
|
+
│
|
|
342
|
+
▼
|
|
343
|
+
┌─────────────────────────────────────┐
|
|
344
|
+
│ Resilience Wrapper │
|
|
345
|
+
│ │
|
|
346
|
+
│ toolEntry.resilience(fn, toolName) │
|
|
347
|
+
│ ├─ Circuit Breaker Check │
|
|
348
|
+
│ │ └─ OPEN? → Fail fast │
|
|
349
|
+
│ │ └─ CLOSED/HALF-OPEN? → Proceed│
|
|
350
|
+
│ ├─ Retry with Backoff │
|
|
351
|
+
│ └─ Execute Tool Function │
|
|
352
|
+
└────────┬────────────────────────────┘
|
|
353
|
+
│
|
|
354
|
+
▼
|
|
355
|
+
┌─────────────────────────────────────┐
|
|
356
|
+
│ octocode-mcp Tool Function │
|
|
357
|
+
│ │
|
|
358
|
+
│ localSearchCode({ queries: [...] })│
|
|
359
|
+
│ ├─ Execute ripgrep search │
|
|
360
|
+
│ ├─ Parse results │
|
|
361
|
+
│ ├─ Apply hints │
|
|
362
|
+
│ └─ Return CallToolResult │
|
|
363
|
+
└────────┬────────────────────────────┘
|
|
364
|
+
│
|
|
365
|
+
▼
|
|
366
|
+
┌─────────────────────────────────────┐
|
|
367
|
+
│ Response Transformation │
|
|
368
|
+
│ │
|
|
369
|
+
│ parseToolResponse(rawResult) │
|
|
370
|
+
│ ├─ Extract data, hints, research │
|
|
371
|
+
│ └─ Detect errors │
|
|
372
|
+
└────────┬────────────────────────────┘
|
|
373
|
+
│
|
|
374
|
+
▼
|
|
375
|
+
HTTP Response (JSON)
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Response Formats
|
|
381
|
+
|
|
382
|
+
### Single Query Response
|
|
383
|
+
|
|
384
|
+
```json
|
|
385
|
+
{
|
|
386
|
+
"tool": "localSearchCode",
|
|
387
|
+
"success": true,
|
|
388
|
+
"data": {
|
|
389
|
+
"files": [...],
|
|
390
|
+
"totalMatches": 10,
|
|
391
|
+
"pagination": { "page": 1, "hasMore": false }
|
|
392
|
+
},
|
|
393
|
+
"hints": [
|
|
394
|
+
"Use lineHint for LSP tools",
|
|
395
|
+
"Consider narrowing search with path filter"
|
|
396
|
+
],
|
|
397
|
+
"research": {
|
|
398
|
+
"mainResearchGoal": "Find authentication handlers",
|
|
399
|
+
"researchGoal": "Locate auth middleware",
|
|
400
|
+
"reasoning": "Understanding auth flow"
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### Bulk Query Response (2-3 queries)
|
|
406
|
+
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"tool": "localSearchCode",
|
|
410
|
+
"bulk": true,
|
|
411
|
+
"success": true,
|
|
412
|
+
"instructions": "Review results by status...",
|
|
413
|
+
"results": [
|
|
414
|
+
{ "id": 1, "status": "hasResults", "data": {...}, "research": {...} },
|
|
415
|
+
{ "id": 2, "status": "empty", "data": {}, "research": {...} }
|
|
416
|
+
],
|
|
417
|
+
"hints": {
|
|
418
|
+
"hasResults": ["Follow up with LSP for semantic analysis"],
|
|
419
|
+
"empty": ["Try broader search pattern"],
|
|
420
|
+
"error": []
|
|
421
|
+
},
|
|
422
|
+
"counts": {
|
|
423
|
+
"total": 2,
|
|
424
|
+
"hasResults": 1,
|
|
425
|
+
"empty": 1,
|
|
426
|
+
"error": 0
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Error Response
|
|
432
|
+
|
|
433
|
+
```json
|
|
434
|
+
{
|
|
435
|
+
"tool": "localSearchCode",
|
|
436
|
+
"success": false,
|
|
437
|
+
"data": {},
|
|
438
|
+
"hints": [
|
|
439
|
+
"Circuit breaker is open - retry in 30s",
|
|
440
|
+
"Consider using fallback tool"
|
|
441
|
+
],
|
|
442
|
+
"research": {
|
|
443
|
+
"mainResearchGoal": "...",
|
|
444
|
+
"researchGoal": "...",
|
|
445
|
+
"reasoning": "..."
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## File Structure
|
|
453
|
+
|
|
454
|
+
```
|
|
455
|
+
octocode-research/
|
|
456
|
+
├── src/
|
|
457
|
+
│ ├── server.ts # Express server entry point
|
|
458
|
+
│ ├── index.ts # Re-exports from octocode-mcp
|
|
459
|
+
│ ├── mcpCache.ts # MCP client caching
|
|
460
|
+
│ ├── routes/
|
|
461
|
+
│ │ ├── tools.ts # /tools/* - MAIN tool API
|
|
462
|
+
│ │ ├── prompts.ts # /prompts/* - prompt discovery
|
|
463
|
+
│ │ ├── local.ts # Handler logic (tests)
|
|
464
|
+
│ │ ├── lsp.ts # Handler logic (tests)
|
|
465
|
+
│ │ ├── github.ts # Handler logic (tests)
|
|
466
|
+
│ │ └── package.ts # Handler logic (tests)
|
|
467
|
+
│ ├── middleware/
|
|
468
|
+
│ │ ├── errorHandler.ts # Error response formatting
|
|
469
|
+
│ │ ├── logger.ts # Request/response logging
|
|
470
|
+
│ │ ├── queryParser.ts # Zod validation
|
|
471
|
+
│ │ └── readiness.ts # Server readiness check
|
|
472
|
+
│ ├── validation/
|
|
473
|
+
│ │ ├── index.ts # Schema exports
|
|
474
|
+
│ │ ├── schemas.ts # HTTP schemas (from octocode-mcp)
|
|
475
|
+
│ │ └── httpPreprocess.ts # Query string conversion
|
|
476
|
+
│ ├── utils/
|
|
477
|
+
│ │ ├── circuitBreaker.ts # Circuit breaker pattern
|
|
478
|
+
│ │ ├── colors.ts # Console color functions
|
|
479
|
+
│ │ ├── logger.ts # File-based logging
|
|
480
|
+
│ │ ├── resilience.ts # Combined resilience wrappers
|
|
481
|
+
│ │ ├── responseBuilder.ts # Research response formatting
|
|
482
|
+
│ │ ├── responseFactory.ts # Safe data extraction
|
|
483
|
+
│ │ ├── responseParser.ts # MCP response parsing
|
|
484
|
+
│ │ ├── retry.ts # Retry with backoff
|
|
485
|
+
│ │ └── routeFactory.ts # Route handler factory
|
|
486
|
+
│ ├── types/
|
|
487
|
+
│ │ ├── express.d.ts # Express type extensions
|
|
488
|
+
│ │ ├── guards.ts # Type guard functions
|
|
489
|
+
│ │ ├── mcp.ts # MCP protocol types
|
|
490
|
+
│ │ ├── responses.ts # Response type definitions
|
|
491
|
+
│ │ └── toolTypes.ts # Tool parameter types
|
|
492
|
+
│ └── __tests__/
|
|
493
|
+
│ ├── integration/ # Integration tests
|
|
494
|
+
│ └── unit/ # Unit tests
|
|
495
|
+
├── docs/
|
|
496
|
+
│ ├── API_REFERENCE.md # HTTP API reference
|
|
497
|
+
│ ├── ARCHITECTURE.md # Architecture documentation
|
|
498
|
+
│ ├── FLOWS.md # Flow diagrams
|
|
499
|
+
│ └── OVERVIEW.md # This document
|
|
500
|
+
├── references/
|
|
501
|
+
│ └── GUARDRAILS.md # Safety guardrails
|
|
502
|
+
├── scripts/
|
|
503
|
+
│ ├── server.js # Bundled server (tsdown)
|
|
504
|
+
│ └── server.d.ts # Type declarations
|
|
505
|
+
├── SKILL.md # Skill definition for agents
|
|
506
|
+
├── AGENTS.md # Development guide
|
|
507
|
+
├── README.md # Quick start
|
|
508
|
+
├── package.json
|
|
509
|
+
├── tsconfig.json
|
|
510
|
+
├── tsdown.config.ts
|
|
511
|
+
└── vitest.config.ts
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Quick Start
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
# Build
|
|
520
|
+
npm run build
|
|
521
|
+
|
|
522
|
+
# Start server
|
|
523
|
+
npm start
|
|
524
|
+
|
|
525
|
+
# Development with hot reload
|
|
526
|
+
npm run dev
|
|
527
|
+
|
|
528
|
+
# Health check
|
|
529
|
+
curl http://localhost:1987/health
|
|
530
|
+
|
|
531
|
+
# List tools
|
|
532
|
+
curl http://localhost:1987/tools/list
|
|
533
|
+
|
|
534
|
+
# Get tool schema
|
|
535
|
+
curl http://localhost:1987/tools/info/localSearchCode
|
|
536
|
+
|
|
537
|
+
# Execute tool
|
|
538
|
+
curl -X POST http://localhost:1987/tools/call/localSearchCode \
|
|
539
|
+
-H "Content-Type: application/json" \
|
|
540
|
+
-d '{"queries": [{
|
|
541
|
+
"mainResearchGoal": "Find auth",
|
|
542
|
+
"researchGoal": "Search handlers",
|
|
543
|
+
"reasoning": "Testing",
|
|
544
|
+
"pattern": "authenticate",
|
|
545
|
+
"path": "/src"
|
|
546
|
+
}]}'
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
---
|
|
550
|
+
|
|
551
|
+
## Related Documentation
|
|
552
|
+
|
|
553
|
+
| Document | Purpose |
|
|
554
|
+
|----------|---------|
|
|
555
|
+
| [SKILL.md](https://github.com/bgauryy/octocode-mcp/blob/main/skills/octocode-research/SKILL.md) | Agent workflow guide |
|
|
556
|
+
| [AGENTS.md](https://github.com/bgauryy/octocode-mcp/blob/main/skills/octocode-research/AGENTS.md) | Development guidelines |
|
|
557
|
+
| [ARCHITECTURE.md](./ARCHITECTURE.md) | Full architecture details |
|
|
558
|
+
| [FLOWS.md](./FLOWS.md) | Request flow diagrams |
|
|
559
|
+
| [API_REFERENCE.md](./API_REFERENCE.md) | HTTP API reference |
|
|
560
|
+
| [GUARDRAILS.md](https://github.com/bgauryy/octocode-mcp/blob/main/skills/octocode-research/references/GUARDRAILS.md) | Safety rules |
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
*Generated by Octocode Research Analysis*
|