synapsexcoder 6.0.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/.opencode/opencode.jsonc +102 -0
- package/README.md +353 -0
- package/dist/agents/agent-config-manager.d.ts +58 -0
- package/dist/agents/agent-config-manager.d.ts.map +1 -0
- package/dist/agents/agent-config-manager.js +313 -0
- package/dist/agents/agent-config-manager.js.map +1 -0
- package/dist/agents/base-agents.d.ts +352 -0
- package/dist/agents/base-agents.d.ts.map +1 -0
- package/dist/agents/base-agents.js +3961 -0
- package/dist/agents/base-agents.js.map +1 -0
- package/dist/agents/gated-subagent.d.ts +126 -0
- package/dist/agents/gated-subagent.d.ts.map +1 -0
- package/dist/agents/gated-subagent.js +591 -0
- package/dist/agents/gated-subagent.js.map +1 -0
- package/dist/agents/gated-subagents.d.ts +130 -0
- package/dist/agents/gated-subagents.d.ts.map +1 -0
- package/dist/agents/gated-subagents.js +2014 -0
- package/dist/agents/gated-subagents.js.map +1 -0
- package/dist/agents/internal-gatekeeper.d.ts +167 -0
- package/dist/agents/internal-gatekeeper.d.ts.map +1 -0
- package/dist/agents/internal-gatekeeper.js +1130 -0
- package/dist/agents/internal-gatekeeper.js.map +1 -0
- package/dist/agents/verification-agent.d.ts +86 -0
- package/dist/agents/verification-agent.d.ts.map +1 -0
- package/dist/agents/verification-agent.js +211 -0
- package/dist/agents/verification-agent.js.map +1 -0
- package/dist/analytics/analytics-types.d.ts +113 -0
- package/dist/analytics/analytics-types.d.ts.map +1 -0
- package/dist/analytics/analytics-types.js +8 -0
- package/dist/analytics/analytics-types.js.map +1 -0
- package/dist/analytics/dashboard-generator.d.ts +35 -0
- package/dist/analytics/dashboard-generator.d.ts.map +1 -0
- package/dist/analytics/dashboard-generator.js +365 -0
- package/dist/analytics/dashboard-generator.js.map +1 -0
- package/dist/analytics/index.d.ts +12 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +12 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics/metrics-aggregator.d.ts +88 -0
- package/dist/analytics/metrics-aggregator.d.ts.map +1 -0
- package/dist/analytics/metrics-aggregator.js +280 -0
- package/dist/analytics/metrics-aggregator.js.map +1 -0
- package/dist/cli/index.d.ts +36 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2677 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/normalize_patch.d.ts +3 -0
- package/dist/cli/normalize_patch.d.ts.map +1 -0
- package/dist/cli/normalize_patch.js +34 -0
- package/dist/cli/normalize_patch.js.map +1 -0
- package/dist/commands/command-processor.d.ts +58 -0
- package/dist/commands/command-processor.d.ts.map +1 -0
- package/dist/commands/command-processor.js +796 -0
- package/dist/commands/command-processor.js.map +1 -0
- package/dist/config/compliance-checker.d.ts +93 -0
- package/dist/config/compliance-checker.d.ts.map +1 -0
- package/dist/config/compliance-checker.js +424 -0
- package/dist/config/compliance-checker.js.map +1 -0
- package/dist/config/enterprise-config.d.ts +173 -0
- package/dist/config/enterprise-config.d.ts.map +1 -0
- package/dist/config/enterprise-config.js +190 -0
- package/dist/config/enterprise-config.js.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +11 -0
- package/dist/config/index.js.map +1 -0
- package/dist/context/context-system.d.ts +97 -0
- package/dist/context/context-system.d.ts.map +1 -0
- package/dist/context/context-system.js +880 -0
- package/dist/context/context-system.js.map +1 -0
- package/dist/context/store.d.ts +123 -0
- package/dist/context/store.d.ts.map +1 -0
- package/dist/context/store.js +281 -0
- package/dist/context/store.js.map +1 -0
- package/dist/dasp/dasp-controller.d.ts +83 -0
- package/dist/dasp/dasp-controller.d.ts.map +1 -0
- package/dist/dasp/dasp-controller.js +190 -0
- package/dist/dasp/dasp-controller.js.map +1 -0
- package/dist/dasp/feedback-adapter.d.ts +56 -0
- package/dist/dasp/feedback-adapter.d.ts.map +1 -0
- package/dist/dasp/feedback-adapter.js +158 -0
- package/dist/dasp/feedback-adapter.js.map +1 -0
- package/dist/dasp/index.d.ts +14 -0
- package/dist/dasp/index.d.ts.map +1 -0
- package/dist/dasp/index.js +10 -0
- package/dist/dasp/index.js.map +1 -0
- package/dist/dasp/prompt-templates.d.ts +38 -0
- package/dist/dasp/prompt-templates.d.ts.map +1 -0
- package/dist/dasp/prompt-templates.js +406 -0
- package/dist/dasp/prompt-templates.js.map +1 -0
- package/dist/dasp/vault-rag-provider.d.ts +51 -0
- package/dist/dasp/vault-rag-provider.d.ts.map +1 -0
- package/dist/dasp/vault-rag-provider.js +125 -0
- package/dist/dasp/vault-rag-provider.js.map +1 -0
- package/dist/distribution/cli-distribution.d.ts +68 -0
- package/dist/distribution/cli-distribution.d.ts.map +1 -0
- package/dist/distribution/cli-distribution.js +941 -0
- package/dist/distribution/cli-distribution.js.map +1 -0
- package/dist/docs/doc-generator.d.ts +78 -0
- package/dist/docs/doc-generator.d.ts.map +1 -0
- package/dist/docs/doc-generator.js +297 -0
- package/dist/docs/doc-generator.js.map +1 -0
- package/dist/docs/index.d.ts +13 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +11 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/docs/site-builder.d.ts +58 -0
- package/dist/docs/site-builder.d.ts.map +1 -0
- package/dist/docs/site-builder.js +229 -0
- package/dist/docs/site-builder.js.map +1 -0
- package/dist/ecosystem/adapters/claude-adapter.d.ts +29 -0
- package/dist/ecosystem/adapters/claude-adapter.d.ts.map +1 -0
- package/dist/ecosystem/adapters/claude-adapter.js +116 -0
- package/dist/ecosystem/adapters/claude-adapter.js.map +1 -0
- package/dist/ecosystem/adapters/cursor-adapter.d.ts +27 -0
- package/dist/ecosystem/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/ecosystem/adapters/cursor-adapter.js +93 -0
- package/dist/ecosystem/adapters/cursor-adapter.js.map +1 -0
- package/dist/ecosystem/adapters/v0-adapter.d.ts +30 -0
- package/dist/ecosystem/adapters/v0-adapter.d.ts.map +1 -0
- package/dist/ecosystem/adapters/v0-adapter.js +112 -0
- package/dist/ecosystem/adapters/v0-adapter.js.map +1 -0
- package/dist/ecosystem/ecosystem-router.d.ts +80 -0
- package/dist/ecosystem/ecosystem-router.d.ts.map +1 -0
- package/dist/ecosystem/ecosystem-router.js +241 -0
- package/dist/ecosystem/ecosystem-router.js.map +1 -0
- package/dist/ecosystem/ecosystem-types.d.ts +94 -0
- package/dist/ecosystem/ecosystem-types.d.ts.map +1 -0
- package/dist/ecosystem/ecosystem-types.js +27 -0
- package/dist/ecosystem/ecosystem-types.js.map +1 -0
- package/dist/ecosystem/index.d.ts +10 -0
- package/dist/ecosystem/index.d.ts.map +1 -0
- package/dist/ecosystem/index.js +9 -0
- package/dist/ecosystem/index.js.map +1 -0
- package/dist/integration/agentic-integration.d.ts +73 -0
- package/dist/integration/agentic-integration.d.ts.map +1 -0
- package/dist/integration/agentic-integration.js +253 -0
- package/dist/integration/agentic-integration.js.map +1 -0
- package/dist/integration/background-agents-integration.d.ts +54 -0
- package/dist/integration/background-agents-integration.d.ts.map +1 -0
- package/dist/integration/background-agents-integration.js +225 -0
- package/dist/integration/background-agents-integration.js.map +1 -0
- package/dist/integration/dcp-integration.d.ts +81 -0
- package/dist/integration/dcp-integration.d.ts.map +1 -0
- package/dist/integration/dcp-integration.js +189 -0
- package/dist/integration/dcp-integration.js.map +1 -0
- package/dist/integration/firecrawl-integration.d.ts +61 -0
- package/dist/integration/firecrawl-integration.d.ts.map +1 -0
- package/dist/integration/firecrawl-integration.js +246 -0
- package/dist/integration/firecrawl-integration.js.map +1 -0
- package/dist/integration/index.d.ts +40 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +43 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/integration/integration-hub.d.ts +43 -0
- package/dist/integration/integration-hub.d.ts.map +1 -0
- package/dist/integration/integration-hub.js +507 -0
- package/dist/integration/integration-hub.js.map +1 -0
- package/dist/integration/integration-loader.d.ts +42 -0
- package/dist/integration/integration-loader.d.ts.map +1 -0
- package/dist/integration/integration-loader.js +240 -0
- package/dist/integration/integration-loader.js.map +1 -0
- package/dist/integration/md-table-formatter-integration.d.ts +41 -0
- package/dist/integration/md-table-formatter-integration.d.ts.map +1 -0
- package/dist/integration/md-table-formatter-integration.js +183 -0
- package/dist/integration/md-table-formatter-integration.js.map +1 -0
- package/dist/integration/native/agentic/agentic-engine.d.ts +52 -0
- package/dist/integration/native/agentic/agentic-engine.d.ts.map +1 -0
- package/dist/integration/native/agentic/agentic-engine.js +267 -0
- package/dist/integration/native/agentic/agentic-engine.js.map +1 -0
- package/dist/integration/native/background/background-engine.d.ts +62 -0
- package/dist/integration/native/background/background-engine.d.ts.map +1 -0
- package/dist/integration/native/background/background-engine.js +167 -0
- package/dist/integration/native/background/background-engine.js.map +1 -0
- package/dist/integration/native/dcp/dcp-engine.d.ts +55 -0
- package/dist/integration/native/dcp/dcp-engine.d.ts.map +1 -0
- package/dist/integration/native/dcp/dcp-engine.js +168 -0
- package/dist/integration/native/dcp/dcp-engine.js.map +1 -0
- package/dist/integration/native/firecrawl/firecrawl-engine.d.ts +66 -0
- package/dist/integration/native/firecrawl/firecrawl-engine.d.ts.map +1 -0
- package/dist/integration/native/firecrawl/firecrawl-engine.js +221 -0
- package/dist/integration/native/firecrawl/firecrawl-engine.js.map +1 -0
- package/dist/integration/native/formatter/formatter-engine.d.ts +47 -0
- package/dist/integration/native/formatter/formatter-engine.d.ts.map +1 -0
- package/dist/integration/native/formatter/formatter-engine.js +130 -0
- package/dist/integration/native/formatter/formatter-engine.js.map +1 -0
- package/dist/integration/native/index.d.ts +41 -0
- package/dist/integration/native/index.d.ts.map +1 -0
- package/dist/integration/native/index.js +80 -0
- package/dist/integration/native/index.js.map +1 -0
- package/dist/integration/native/orchestration/orchestration-engine.d.ts +62 -0
- package/dist/integration/native/orchestration/orchestration-engine.d.ts.map +1 -0
- package/dist/integration/native/orchestration/orchestration-engine.js +177 -0
- package/dist/integration/native/orchestration/orchestration-engine.js.map +1 -0
- package/dist/integration/native/pty/pty-engine.d.ts +45 -0
- package/dist/integration/native/pty/pty-engine.d.ts.map +1 -0
- package/dist/integration/native/pty/pty-engine.js +103 -0
- package/dist/integration/native/pty/pty-engine.js.map +1 -0
- package/dist/integration/native/shell-strategy.d.ts +60 -0
- package/dist/integration/native/shell-strategy.d.ts.map +1 -0
- package/dist/integration/native/shell-strategy.js +131 -0
- package/dist/integration/native/shell-strategy.js.map +1 -0
- package/dist/integration/native/skillful/skillful-engine.d.ts +53 -0
- package/dist/integration/native/skillful/skillful-engine.d.ts.map +1 -0
- package/dist/integration/native/skillful/skillful-engine.js +127 -0
- package/dist/integration/native/skillful/skillful-engine.js.map +1 -0
- package/dist/integration/native/subtask2/subtask2-engine.d.ts +50 -0
- package/dist/integration/native/subtask2/subtask2-engine.d.ts.map +1 -0
- package/dist/integration/native/subtask2/subtask2-engine.js +158 -0
- package/dist/integration/native/subtask2/subtask2-engine.js.map +1 -0
- package/dist/integration/native/supermemory/supermemory-engine.d.ts +63 -0
- package/dist/integration/native/supermemory/supermemory-engine.d.ts.map +1 -0
- package/dist/integration/native/supermemory/supermemory-engine.js +127 -0
- package/dist/integration/native/supermemory/supermemory-engine.js.map +1 -0
- package/dist/integration/native/workspace/workspace-engine.d.ts +75 -0
- package/dist/integration/native/workspace/workspace-engine.d.ts.map +1 -0
- package/dist/integration/native/workspace/workspace-engine.js +216 -0
- package/dist/integration/native/workspace/workspace-engine.js.map +1 -0
- package/dist/integration/oh-my-opencode-integration.d.ts +59 -0
- package/dist/integration/oh-my-opencode-integration.d.ts.map +1 -0
- package/dist/integration/oh-my-opencode-integration.js +180 -0
- package/dist/integration/oh-my-opencode-integration.js.map +1 -0
- package/dist/integration/openagents-control-integration.d.ts +81 -0
- package/dist/integration/openagents-control-integration.d.ts.map +1 -0
- package/dist/integration/openagents-control-integration.js +273 -0
- package/dist/integration/openagents-control-integration.js.map +1 -0
- package/dist/integration/pty-integration.d.ts +64 -0
- package/dist/integration/pty-integration.d.ts.map +1 -0
- package/dist/integration/pty-integration.js +180 -0
- package/dist/integration/pty-integration.js.map +1 -0
- package/dist/integration/shell-strategy-integration.d.ts +26 -0
- package/dist/integration/shell-strategy-integration.d.ts.map +1 -0
- package/dist/integration/shell-strategy-integration.js +110 -0
- package/dist/integration/shell-strategy-integration.js.map +1 -0
- package/dist/integration/skillful-integration.d.ts +74 -0
- package/dist/integration/skillful-integration.d.ts.map +1 -0
- package/dist/integration/skillful-integration.js +317 -0
- package/dist/integration/skillful-integration.js.map +1 -0
- package/dist/integration/subtask2-integration.d.ts +71 -0
- package/dist/integration/subtask2-integration.d.ts.map +1 -0
- package/dist/integration/subtask2-integration.js +240 -0
- package/dist/integration/subtask2-integration.js.map +1 -0
- package/dist/integration/supermemory-integration.d.ts +82 -0
- package/dist/integration/supermemory-integration.d.ts.map +1 -0
- package/dist/integration/supermemory-integration.js +252 -0
- package/dist/integration/supermemory-integration.js.map +1 -0
- package/dist/integration/types.d.ts +218 -0
- package/dist/integration/types.d.ts.map +1 -0
- package/dist/integration/types.js +5 -0
- package/dist/integration/types.js.map +1 -0
- package/dist/integration/workspace-integration.d.ts +46 -0
- package/dist/integration/workspace-integration.d.ts.map +1 -0
- package/dist/integration/workspace-integration.js +181 -0
- package/dist/integration/workspace-integration.js.map +1 -0
- package/dist/knowledge-vault/deepwiki-sync.d.ts +99 -0
- package/dist/knowledge-vault/deepwiki-sync.d.ts.map +1 -0
- package/dist/knowledge-vault/deepwiki-sync.js +381 -0
- package/dist/knowledge-vault/deepwiki-sync.js.map +1 -0
- package/dist/knowledge-vault/index.d.ts +11 -0
- package/dist/knowledge-vault/index.d.ts.map +1 -0
- package/dist/knowledge-vault/index.js +8 -0
- package/dist/knowledge-vault/index.js.map +1 -0
- package/dist/knowledge-vault/knowledge-vault.d.ts +38 -0
- package/dist/knowledge-vault/knowledge-vault.d.ts.map +1 -0
- package/dist/knowledge-vault/knowledge-vault.js +284 -0
- package/dist/knowledge-vault/knowledge-vault.js.map +1 -0
- package/dist/knowledge-vault/opencode-doc-ingest.d.ts +23 -0
- package/dist/knowledge-vault/opencode-doc-ingest.d.ts.map +1 -0
- package/dist/knowledge-vault/opencode-doc-ingest.js +48 -0
- package/dist/knowledge-vault/opencode-doc-ingest.js.map +1 -0
- package/dist/knowledge-vault/types.d.ts +61 -0
- package/dist/knowledge-vault/types.d.ts.map +1 -0
- package/dist/knowledge-vault/types.js +5 -0
- package/dist/knowledge-vault/types.js.map +1 -0
- package/dist/knowledge-vault/vault-config.d.ts +12 -0
- package/dist/knowledge-vault/vault-config.d.ts.map +1 -0
- package/dist/knowledge-vault/vault-config.js +24 -0
- package/dist/knowledge-vault/vault-config.js.map +1 -0
- package/dist/mcp/index.d.ts +28 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +29 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/mcp-manager.d.ts +181 -0
- package/dist/mcp/mcp-manager.d.ts.map +1 -0
- package/dist/mcp/mcp-manager.js +621 -0
- package/dist/mcp/mcp-manager.js.map +1 -0
- package/dist/mcp/mcp-types.d.ts +199 -0
- package/dist/mcp/mcp-types.d.ts.map +1 -0
- package/dist/mcp/mcp-types.js +152 -0
- package/dist/mcp/mcp-types.js.map +1 -0
- package/dist/mcp/servers/mcp-server-bridge.d.ts +64 -0
- package/dist/mcp/servers/mcp-server-bridge.d.ts.map +1 -0
- package/dist/mcp/servers/mcp-server-bridge.js +189 -0
- package/dist/mcp/servers/mcp-server-bridge.js.map +1 -0
- package/dist/messages/message-bus.d.ts +148 -0
- package/dist/messages/message-bus.d.ts.map +1 -0
- package/dist/messages/message-bus.js +432 -0
- package/dist/messages/message-bus.js.map +1 -0
- package/dist/modes/custom-mode-registry.d.ts +121 -0
- package/dist/modes/custom-mode-registry.d.ts.map +1 -0
- package/dist/modes/custom-mode-registry.js +306 -0
- package/dist/modes/custom-mode-registry.js.map +1 -0
- package/dist/modes/index.d.ts +10 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/mode-designer.d.ts +89 -0
- package/dist/modes/mode-designer.d.ts.map +1 -0
- package/dist/modes/mode-designer.js +485 -0
- package/dist/modes/mode-designer.js.map +1 -0
- package/dist/modes/mode-manager.d.ts +27 -0
- package/dist/modes/mode-manager.d.ts.map +1 -0
- package/dist/modes/mode-manager.js +68 -0
- package/dist/modes/mode-manager.js.map +1 -0
- package/dist/modes/synapse-modes.d.ts +26 -0
- package/dist/modes/synapse-modes.d.ts.map +1 -0
- package/dist/modes/synapse-modes.js +69 -0
- package/dist/modes/synapse-modes.js.map +1 -0
- package/dist/opencode/agent-delegate.d.ts +3 -0
- package/dist/opencode/agent-delegate.d.ts.map +1 -0
- package/dist/opencode/agent-delegate.js +3 -0
- package/dist/opencode/agent-delegate.js.map +1 -0
- package/dist/opencode/tool-bridge.d.ts +3 -0
- package/dist/opencode/tool-bridge.d.ts.map +1 -0
- package/dist/opencode/tool-bridge.js +3 -0
- package/dist/opencode/tool-bridge.js.map +1 -0
- package/dist/optimization/token-optimizer-v2.d.ts +18 -0
- package/dist/optimization/token-optimizer-v2.d.ts.map +1 -0
- package/dist/optimization/token-optimizer-v2.js +23 -0
- package/dist/optimization/token-optimizer-v2.js.map +1 -0
- package/dist/optimization/token-optimizer.d.ts +90 -0
- package/dist/optimization/token-optimizer.d.ts.map +1 -0
- package/dist/optimization/token-optimizer.js +399 -0
- package/dist/optimization/token-optimizer.js.map +1 -0
- package/dist/parallel/agent-farm.d.ts +123 -0
- package/dist/parallel/agent-farm.d.ts.map +1 -0
- package/dist/parallel/agent-farm.js +501 -0
- package/dist/parallel/agent-farm.js.map +1 -0
- package/dist/parallel/farm-scheduler.d.ts +115 -0
- package/dist/parallel/farm-scheduler.d.ts.map +1 -0
- package/dist/parallel/farm-scheduler.js +356 -0
- package/dist/parallel/farm-scheduler.js.map +1 -0
- package/dist/parallel/farm-types.d.ts +104 -0
- package/dist/parallel/farm-types.d.ts.map +1 -0
- package/dist/parallel/farm-types.js +9 -0
- package/dist/parallel/farm-types.js.map +1 -0
- package/dist/parallel/farm-worker.d.ts +62 -0
- package/dist/parallel/farm-worker.d.ts.map +1 -0
- package/dist/parallel/farm-worker.js +268 -0
- package/dist/parallel/farm-worker.js.map +1 -0
- package/dist/parallel/index.d.ts +14 -0
- package/dist/parallel/index.d.ts.map +1 -0
- package/dist/parallel/index.js +14 -0
- package/dist/parallel/index.js.map +1 -0
- package/dist/plugin/native-tools.d.ts +8 -0
- package/dist/plugin/native-tools.d.ts.map +1 -0
- package/dist/plugin/native-tools.js +147 -0
- package/dist/plugin/native-tools.js.map +1 -0
- package/dist/plugin/opencode-plugin.d.ts +32 -0
- package/dist/plugin/opencode-plugin.d.ts.map +1 -0
- package/dist/plugin/opencode-plugin.js +119 -0
- package/dist/plugin/opencode-plugin.js.map +1 -0
- package/dist/plugins/plugin-system.d.ts +108 -0
- package/dist/plugins/plugin-system.d.ts.map +1 -0
- package/dist/plugins/plugin-system.js +707 -0
- package/dist/plugins/plugin-system.js.map +1 -0
- package/dist/profiler/cpu-profiler.d.ts +53 -0
- package/dist/profiler/cpu-profiler.d.ts.map +1 -0
- package/dist/profiler/cpu-profiler.js +233 -0
- package/dist/profiler/cpu-profiler.js.map +1 -0
- package/dist/profiler/index.d.ts +36 -0
- package/dist/profiler/index.d.ts.map +1 -0
- package/dist/profiler/index.js +122 -0
- package/dist/profiler/index.js.map +1 -0
- package/dist/profiler/memory-profiler.d.ts +45 -0
- package/dist/profiler/memory-profiler.d.ts.map +1 -0
- package/dist/profiler/memory-profiler.js +211 -0
- package/dist/profiler/memory-profiler.js.map +1 -0
- package/dist/profiler/profiler-types.d.ts +234 -0
- package/dist/profiler/profiler-types.d.ts.map +1 -0
- package/dist/profiler/profiler-types.js +89 -0
- package/dist/profiler/profiler-types.js.map +1 -0
- package/dist/profiler/query-profiler.d.ts +48 -0
- package/dist/profiler/query-profiler.d.ts.map +1 -0
- package/dist/profiler/query-profiler.js +210 -0
- package/dist/profiler/query-profiler.js.map +1 -0
- package/dist/profiler/report-generator.d.ts +17 -0
- package/dist/profiler/report-generator.d.ts.map +1 -0
- package/dist/profiler/report-generator.js +329 -0
- package/dist/profiler/report-generator.js.map +1 -0
- package/dist/sdk/api.d.ts +85 -0
- package/dist/sdk/api.d.ts.map +1 -0
- package/dist/sdk/api.js +155 -0
- package/dist/sdk/api.js.map +1 -0
- package/dist/sdk/hooks.d.ts +58 -0
- package/dist/sdk/hooks.d.ts.map +1 -0
- package/dist/sdk/hooks.js +115 -0
- package/dist/sdk/hooks.js.map +1 -0
- package/dist/sdk/index.d.ts +17 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +14 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/plugin-base.d.ts +198 -0
- package/dist/sdk/plugin-base.d.ts.map +1 -0
- package/dist/sdk/plugin-base.js +227 -0
- package/dist/sdk/plugin-base.js.map +1 -0
- package/dist/security/audit-rules.d.ts +12 -0
- package/dist/security/audit-rules.d.ts.map +1 -0
- package/dist/security/audit-rules.js +214 -0
- package/dist/security/audit-rules.js.map +1 -0
- package/dist/security/index.d.ts +13 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +13 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/sarif-exporter.d.ts +36 -0
- package/dist/security/sarif-exporter.d.ts.map +1 -0
- package/dist/security/sarif-exporter.js +216 -0
- package/dist/security/sarif-exporter.js.map +1 -0
- package/dist/security/security-auditor.d.ts +30 -0
- package/dist/security/security-auditor.d.ts.map +1 -0
- package/dist/security/security-auditor.js +295 -0
- package/dist/security/security-auditor.js.map +1 -0
- package/dist/security/security-types.d.ts +132 -0
- package/dist/security/security-types.d.ts.map +1 -0
- package/dist/security/security-types.js +7 -0
- package/dist/security/security-types.js.map +1 -0
- package/dist/synapsexcoder/agent-delegate.d.ts +128 -0
- package/dist/synapsexcoder/agent-delegate.d.ts.map +1 -0
- package/dist/synapsexcoder/agent-delegate.js +837 -0
- package/dist/synapsexcoder/agent-delegate.js.map +1 -0
- package/dist/synapsexcoder/agent-mailbox.d.ts +26 -0
- package/dist/synapsexcoder/agent-mailbox.d.ts.map +1 -0
- package/dist/synapsexcoder/agent-mailbox.js +64 -0
- package/dist/synapsexcoder/agent-mailbox.js.map +1 -0
- package/dist/synapsexcoder/ast-grep/ast-grep-api.d.ts +62 -0
- package/dist/synapsexcoder/ast-grep/ast-grep-api.d.ts.map +1 -0
- package/dist/synapsexcoder/ast-grep/ast-grep-api.js +223 -0
- package/dist/synapsexcoder/ast-grep/ast-grep-api.js.map +1 -0
- package/dist/synapsexcoder/cited-search.d.ts +32 -0
- package/dist/synapsexcoder/cited-search.d.ts.map +1 -0
- package/dist/synapsexcoder/cited-search.js +141 -0
- package/dist/synapsexcoder/cited-search.js.map +1 -0
- package/dist/synapsexcoder/credential-store.d.ts +42 -0
- package/dist/synapsexcoder/credential-store.d.ts.map +1 -0
- package/dist/synapsexcoder/credential-store.js +165 -0
- package/dist/synapsexcoder/credential-store.js.map +1 -0
- package/dist/synapsexcoder/devcontainer-awareness.d.ts +35 -0
- package/dist/synapsexcoder/devcontainer-awareness.d.ts.map +1 -0
- package/dist/synapsexcoder/devcontainer-awareness.js +133 -0
- package/dist/synapsexcoder/devcontainer-awareness.js.map +1 -0
- package/dist/synapsexcoder/execution-loops/helix-loop.d.ts +31 -0
- package/dist/synapsexcoder/execution-loops/helix-loop.d.ts.map +1 -0
- package/dist/synapsexcoder/execution-loops/helix-loop.js +93 -0
- package/dist/synapsexcoder/execution-loops/helix-loop.js.map +1 -0
- package/dist/synapsexcoder/execution-loops/ralp-loop.d.ts +28 -0
- package/dist/synapsexcoder/execution-loops/ralp-loop.d.ts.map +1 -0
- package/dist/synapsexcoder/execution-loops/ralp-loop.js +77 -0
- package/dist/synapsexcoder/execution-loops/ralp-loop.js.map +1 -0
- package/dist/synapsexcoder/feature-names.d.ts +27 -0
- package/dist/synapsexcoder/feature-names.d.ts.map +1 -0
- package/dist/synapsexcoder/feature-names.js +40 -0
- package/dist/synapsexcoder/feature-names.js.map +1 -0
- package/dist/synapsexcoder/index.d.ts +39 -0
- package/dist/synapsexcoder/index.d.ts.map +1 -0
- package/dist/synapsexcoder/index.js +23 -0
- package/dist/synapsexcoder/index.js.map +1 -0
- package/dist/synapsexcoder/knowledge-provider.d.ts +44 -0
- package/dist/synapsexcoder/knowledge-provider.d.ts.map +1 -0
- package/dist/synapsexcoder/knowledge-provider.js +107 -0
- package/dist/synapsexcoder/knowledge-provider.js.map +1 -0
- package/dist/synapsexcoder/lsp/lsp-layer.d.ts +51 -0
- package/dist/synapsexcoder/lsp/lsp-layer.d.ts.map +1 -0
- package/dist/synapsexcoder/lsp/lsp-layer.js +302 -0
- package/dist/synapsexcoder/lsp/lsp-layer.js.map +1 -0
- package/dist/synapsexcoder/migration/opencode-config-migrator.d.ts +37 -0
- package/dist/synapsexcoder/migration/opencode-config-migrator.d.ts.map +1 -0
- package/dist/synapsexcoder/migration/opencode-config-migrator.js +100 -0
- package/dist/synapsexcoder/migration/opencode-config-migrator.js.map +1 -0
- package/dist/synapsexcoder/runtime-environment.d.ts +35 -0
- package/dist/synapsexcoder/runtime-environment.d.ts.map +1 -0
- package/dist/synapsexcoder/runtime-environment.js +108 -0
- package/dist/synapsexcoder/runtime-environment.js.map +1 -0
- package/dist/synapsexcoder/secret-guard.d.ts +18 -0
- package/dist/synapsexcoder/secret-guard.d.ts.map +1 -0
- package/dist/synapsexcoder/secret-guard.js +69 -0
- package/dist/synapsexcoder/secret-guard.js.map +1 -0
- package/dist/synapsexcoder/self-prompt-engine.d.ts +15 -0
- package/dist/synapsexcoder/self-prompt-engine.d.ts.map +1 -0
- package/dist/synapsexcoder/self-prompt-engine.js +11 -0
- package/dist/synapsexcoder/self-prompt-engine.js.map +1 -0
- package/dist/synapsexcoder/session-observability.d.ts +44 -0
- package/dist/synapsexcoder/session-observability.d.ts.map +1 -0
- package/dist/synapsexcoder/session-observability.js +115 -0
- package/dist/synapsexcoder/session-observability.js.map +1 -0
- package/dist/synapsexcoder/specialist-agents.d.ts +38 -0
- package/dist/synapsexcoder/specialist-agents.d.ts.map +1 -0
- package/dist/synapsexcoder/specialist-agents.js +192 -0
- package/dist/synapsexcoder/specialist-agents.js.map +1 -0
- package/dist/synapsexcoder/swarm/kanban-board.d.ts +34 -0
- package/dist/synapsexcoder/swarm/kanban-board.d.ts.map +1 -0
- package/dist/synapsexcoder/swarm/kanban-board.js +85 -0
- package/dist/synapsexcoder/swarm/kanban-board.js.map +1 -0
- package/dist/synapsexcoder/swarm/swarm-mailbox.d.ts +38 -0
- package/dist/synapsexcoder/swarm/swarm-mailbox.d.ts.map +1 -0
- package/dist/synapsexcoder/swarm/swarm-mailbox.js +93 -0
- package/dist/synapsexcoder/swarm/swarm-mailbox.js.map +1 -0
- package/dist/synapsexcoder/tool-bridge.d.ts +277 -0
- package/dist/synapsexcoder/tool-bridge.d.ts.map +1 -0
- package/dist/synapsexcoder/tool-bridge.js +1356 -0
- package/dist/synapsexcoder/tool-bridge.js.map +1 -0
- package/dist/synapsexcoder/tool-routing.d.ts +28 -0
- package/dist/synapsexcoder/tool-routing.d.ts.map +1 -0
- package/dist/synapsexcoder/tool-routing.js +79 -0
- package/dist/synapsexcoder/tool-routing.js.map +1 -0
- package/dist/synapsexcoder/type-injector.d.ts +26 -0
- package/dist/synapsexcoder/type-injector.d.ts.map +1 -0
- package/dist/synapsexcoder/type-injector.js +124 -0
- package/dist/synapsexcoder/type-injector.js.map +1 -0
- package/dist/synapsexcoder/utils/fuzzy-match.d.ts +25 -0
- package/dist/synapsexcoder/utils/fuzzy-match.d.ts.map +1 -0
- package/dist/synapsexcoder/utils/fuzzy-match.js +83 -0
- package/dist/synapsexcoder/utils/fuzzy-match.js.map +1 -0
- package/dist/synapsexcoder/vault-crawl.d.ts +29 -0
- package/dist/synapsexcoder/vault-crawl.d.ts.map +1 -0
- package/dist/synapsexcoder/vault-crawl.js +103 -0
- package/dist/synapsexcoder/vault-crawl.js.map +1 -0
- package/dist/synapsexcoder/verified-apply.d.ts +39 -0
- package/dist/synapsexcoder/verified-apply.d.ts.map +1 -0
- package/dist/synapsexcoder/verified-apply.js +81 -0
- package/dist/synapsexcoder/verified-apply.js.map +1 -0
- package/dist/synapsexcoder/verified-context-editing.d.ts +34 -0
- package/dist/synapsexcoder/verified-context-editing.d.ts.map +1 -0
- package/dist/synapsexcoder/verified-context-editing.js +80 -0
- package/dist/synapsexcoder/verified-context-editing.js.map +1 -0
- package/dist/synapsexcoder/worker-pool.d.ts +47 -0
- package/dist/synapsexcoder/worker-pool.d.ts.map +1 -0
- package/dist/synapsexcoder/worker-pool.js +120 -0
- package/dist/synapsexcoder/worker-pool.js.map +1 -0
- package/dist/synapsexcoder/workspace-intelligence.d.ts +35 -0
- package/dist/synapsexcoder/workspace-intelligence.d.ts.map +1 -0
- package/dist/synapsexcoder/workspace-intelligence.js +126 -0
- package/dist/synapsexcoder/workspace-intelligence.js.map +1 -0
- package/dist/synapsexcoder/worktree-manager.d.ts +31 -0
- package/dist/synapsexcoder/worktree-manager.d.ts.map +1 -0
- package/dist/synapsexcoder/worktree-manager.js +100 -0
- package/dist/synapsexcoder/worktree-manager.js.map +1 -0
- package/dist/team/index.d.ts +17 -0
- package/dist/team/index.d.ts.map +1 -0
- package/dist/team/index.js +13 -0
- package/dist/team/index.js.map +1 -0
- package/dist/team/team-audit.d.ts +120 -0
- package/dist/team/team-audit.d.ts.map +1 -0
- package/dist/team/team-audit.js +357 -0
- package/dist/team/team-audit.js.map +1 -0
- package/dist/team/team-collaboration.d.ts +150 -0
- package/dist/team/team-collaboration.d.ts.map +1 -0
- package/dist/team/team-collaboration.js +495 -0
- package/dist/team/team-collaboration.js.map +1 -0
- package/dist/team/team-rbac.d.ts +84 -0
- package/dist/team/team-rbac.d.ts.map +1 -0
- package/dist/team/team-rbac.js +259 -0
- package/dist/team/team-rbac.js.map +1 -0
- package/dist/team/team-session-manager.d.ts +100 -0
- package/dist/team/team-session-manager.d.ts.map +1 -0
- package/dist/team/team-session-manager.js +255 -0
- package/dist/team/team-session-manager.js.map +1 -0
- package/dist/thoughts/thoughts-manager.d.ts +52 -0
- package/dist/thoughts/thoughts-manager.d.ts.map +1 -0
- package/dist/thoughts/thoughts-manager.js +271 -0
- package/dist/thoughts/thoughts-manager.js.map +1 -0
- package/dist/tools/api-validator/index.d.ts +97 -0
- package/dist/tools/api-validator/index.d.ts.map +1 -0
- package/dist/tools/api-validator/index.js +312 -0
- package/dist/tools/api-validator/index.js.map +1 -0
- package/dist/tools/code-archaeology/index.d.ts +193 -0
- package/dist/tools/code-archaeology/index.d.ts.map +1 -0
- package/dist/tools/code-archaeology/index.js +468 -0
- package/dist/tools/code-archaeology/index.js.map +1 -0
- package/dist/tools/codebase-search/index.d.ts +126 -0
- package/dist/tools/codebase-search/index.d.ts.map +1 -0
- package/dist/tools/codebase-search/index.js +437 -0
- package/dist/tools/codebase-search/index.js.map +1 -0
- package/dist/tools/context/index.d.ts +162 -0
- package/dist/tools/context/index.d.ts.map +1 -0
- package/dist/tools/context/index.js +332 -0
- package/dist/tools/context/index.js.map +1 -0
- package/dist/tools/deepwiki/analyzer.d.ts +167 -0
- package/dist/tools/deepwiki/analyzer.d.ts.map +1 -0
- package/dist/tools/deepwiki/analyzer.js +925 -0
- package/dist/tools/deepwiki/analyzer.js.map +1 -0
- package/dist/tools/deepwiki/extractor.d.ts +151 -0
- package/dist/tools/deepwiki/extractor.d.ts.map +1 -0
- package/dist/tools/deepwiki/extractor.js +923 -0
- package/dist/tools/deepwiki/extractor.js.map +1 -0
- package/dist/tools/deepwiki/generator.d.ts +89 -0
- package/dist/tools/deepwiki/generator.d.ts.map +1 -0
- package/dist/tools/deepwiki/generator.js +638 -0
- package/dist/tools/deepwiki/generator.js.map +1 -0
- package/dist/tools/deepwiki/index.d.ts +96 -0
- package/dist/tools/deepwiki/index.d.ts.map +1 -0
- package/dist/tools/deepwiki/index.js +282 -0
- package/dist/tools/deepwiki/index.js.map +1 -0
- package/dist/tools/deepwiki/types.d.ts +370 -0
- package/dist/tools/deepwiki/types.d.ts.map +1 -0
- package/dist/tools/deepwiki/types.js +21 -0
- package/dist/tools/deepwiki/types.js.map +1 -0
- package/dist/tools/dependency-mapper/index.d.ts +212 -0
- package/dist/tools/dependency-mapper/index.d.ts.map +1 -0
- package/dist/tools/dependency-mapper/index.js +592 -0
- package/dist/tools/dependency-mapper/index.js.map +1 -0
- package/dist/tools/memory/index.d.ts +120 -0
- package/dist/tools/memory/index.d.ts.map +1 -0
- package/dist/tools/memory/index.js +275 -0
- package/dist/tools/memory/index.js.map +1 -0
- package/dist/tools/normalize_patch.d.ts +3 -0
- package/dist/tools/normalize_patch.d.ts.map +1 -0
- package/dist/tools/normalize_patch.js +22 -0
- package/dist/tools/normalize_patch.js.map +1 -0
- package/dist/tools/pattern-detector/index.d.ts +105 -0
- package/dist/tools/pattern-detector/index.d.ts.map +1 -0
- package/dist/tools/pattern-detector/index.js +526 -0
- package/dist/tools/pattern-detector/index.js.map +1 -0
- package/dist/tools/performance-profiler/index.d.ts +50 -0
- package/dist/tools/performance-profiler/index.d.ts.map +1 -0
- package/dist/tools/performance-profiler/index.js +164 -0
- package/dist/tools/performance-profiler/index.js.map +1 -0
- package/dist/tools/refactoring-engine/index.d.ts +63 -0
- package/dist/tools/refactoring-engine/index.d.ts.map +1 -0
- package/dist/tools/refactoring-engine/index.js +270 -0
- package/dist/tools/refactoring-engine/index.js.map +1 -0
- package/dist/tools/registry.d.ts +36 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +499 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/test-generator/index.d.ts +152 -0
- package/dist/tools/test-generator/index.d.ts.map +1 -0
- package/dist/tools/test-generator/index.js +448 -0
- package/dist/tools/test-generator/index.js.map +1 -0
- package/dist/types/index.d.ts +565 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/path-validator.d.ts +94 -0
- package/dist/utils/path-validator.d.ts.map +1 -0
- package/dist/utils/path-validator.js +192 -0
- package/dist/utils/path-validator.js.map +1 -0
- package/dist/utils/secure-exec.d.ts +92 -0
- package/dist/utils/secure-exec.d.ts.map +1 -0
- package/dist/utils/secure-exec.js +230 -0
- package/dist/utils/secure-exec.js.map +1 -0
- package/dist/verification/claim-parser.d.ts +37 -0
- package/dist/verification/claim-parser.d.ts.map +1 -0
- package/dist/verification/claim-parser.js +231 -0
- package/dist/verification/claim-parser.js.map +1 -0
- package/dist/verification/cross-reference-engine.d.ts +55 -0
- package/dist/verification/cross-reference-engine.d.ts.map +1 -0
- package/dist/verification/cross-reference-engine.js +149 -0
- package/dist/verification/cross-reference-engine.js.map +1 -0
- package/dist/verification/discrepancy-tracker.d.ts +73 -0
- package/dist/verification/discrepancy-tracker.d.ts.map +1 -0
- package/dist/verification/discrepancy-tracker.js +196 -0
- package/dist/verification/discrepancy-tracker.js.map +1 -0
- package/dist/verification/feature-reconciler.d.ts +90 -0
- package/dist/verification/feature-reconciler.d.ts.map +1 -0
- package/dist/verification/feature-reconciler.js +264 -0
- package/dist/verification/feature-reconciler.js.map +1 -0
- package/dist/verification/index.d.ts +16 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +19 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/integration-verifier.d.ts +66 -0
- package/dist/verification/integration-verifier.d.ts.map +1 -0
- package/dist/verification/integration-verifier.js +210 -0
- package/dist/verification/integration-verifier.js.map +1 -0
- package/dist/verification/recursive-audit-loop.d.ts +56 -0
- package/dist/verification/recursive-audit-loop.d.ts.map +1 -0
- package/dist/verification/recursive-audit-loop.js +136 -0
- package/dist/verification/recursive-audit-loop.js.map +1 -0
- package/dist/verification/runtime-verifier.d.ts +37 -0
- package/dist/verification/runtime-verifier.d.ts.map +1 -0
- package/dist/verification/runtime-verifier.js +221 -0
- package/dist/verification/runtime-verifier.js.map +1 -0
- package/dist/verification/types.d.ts +88 -0
- package/dist/verification/types.d.ts.map +1 -0
- package/dist/verification/types.js +5 -0
- package/dist/verification/types.js.map +1 -0
- package/dist/verification/verification-engine.d.ts +48 -0
- package/dist/verification/verification-engine.d.ts.map +1 -0
- package/dist/verification/verification-engine.js +203 -0
- package/dist/verification/verification-engine.js.map +1 -0
- package/opencode-agents/synapse-analyzer.md +64 -0
- package/opencode-agents/synapse-debugger.md +43 -0
- package/opencode-agents/synapse-diff-validator.md +42 -0
- package/opencode-agents/synapse-gatekeeper.md +273 -0
- package/opencode-agents/synapse-master.md +167 -0
- package/opencode-agents/synapse-planner.md +55 -0
- package/opencode-agents/synapse-researcher.md +61 -0
- package/opencode-agents/synapse-reviewer.md +64 -0
- package/opencode-agents/synapse-rewriter.md +62 -0
- package/opencode-agents/synapse-strategist.md +50 -0
- package/opencode-agents/synapse-test-runner.md +43 -0
- package/opencode-agents/synapse-ui-designer.md +61 -0
- package/opencode-agents/synapse-verifier.md +544 -0
- package/package.json +108 -0
- package/src/plugin/opencode-plugin.ts +141 -0
|
@@ -0,0 +1,923 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DeepWiki Tool - Documentation Extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts documentation from code and generates wiki content.
|
|
5
|
+
*/
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// Documentation Extractor
|
|
8
|
+
// ============================================================================
|
|
9
|
+
export class DocumentationExtractor {
|
|
10
|
+
analysis;
|
|
11
|
+
pageIdCounter = 0;
|
|
12
|
+
edgeIdCounter = 0;
|
|
13
|
+
constructor(analysis) {
|
|
14
|
+
this.analysis = analysis;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Extract all wiki pages from the analysis
|
|
18
|
+
*/
|
|
19
|
+
extractAllPages() {
|
|
20
|
+
const pages = [];
|
|
21
|
+
// Generate overview page
|
|
22
|
+
pages.push(this.generateOverviewPage());
|
|
23
|
+
// Generate architecture page
|
|
24
|
+
pages.push(this.generateArchitecturePage());
|
|
25
|
+
// Generate module pages
|
|
26
|
+
for (const module of this.analysis.modules) {
|
|
27
|
+
pages.push(this.generateModulePage(module));
|
|
28
|
+
}
|
|
29
|
+
// Generate class pages
|
|
30
|
+
for (const cls of this.analysis.classes) {
|
|
31
|
+
pages.push(this.generateClassPage(cls));
|
|
32
|
+
}
|
|
33
|
+
// Generate function pages for significant functions
|
|
34
|
+
for (const func of this.analysis.functions) {
|
|
35
|
+
if (this.isSignificantFunction(func)) {
|
|
36
|
+
pages.push(this.generateFunctionPage(func));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// Generate interface pages
|
|
40
|
+
for (const iface of this.analysis.interfaces) {
|
|
41
|
+
pages.push(this.generateInterfacePage(iface));
|
|
42
|
+
}
|
|
43
|
+
// Generate pattern pages
|
|
44
|
+
for (const pattern of this.analysis.patterns) {
|
|
45
|
+
pages.push(this.generatePatternPage(pattern));
|
|
46
|
+
}
|
|
47
|
+
// Generate API reference page
|
|
48
|
+
pages.push(this.generateApiReferencePage());
|
|
49
|
+
// Generate getting started guide
|
|
50
|
+
pages.push(this.generateGettingStartedGuide());
|
|
51
|
+
return pages;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Extract knowledge graph from the analysis
|
|
55
|
+
*/
|
|
56
|
+
extractKnowledgeGraph() {
|
|
57
|
+
const nodes = new Map();
|
|
58
|
+
const edges = [];
|
|
59
|
+
// Add module nodes
|
|
60
|
+
for (const module of this.analysis.modules) {
|
|
61
|
+
const node = this.createModuleNode(module);
|
|
62
|
+
nodes.set(node.id, node);
|
|
63
|
+
}
|
|
64
|
+
// Add class nodes
|
|
65
|
+
for (const cls of this.analysis.classes) {
|
|
66
|
+
const node = this.createClassNode(cls);
|
|
67
|
+
nodes.set(node.id, node);
|
|
68
|
+
// Add edge to module
|
|
69
|
+
const moduleId = this.getModuleId(cls.module);
|
|
70
|
+
if (moduleId) {
|
|
71
|
+
edges.push(this.createEdge(node.id, moduleId, "contains"));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Add function nodes
|
|
75
|
+
for (const func of this.analysis.functions) {
|
|
76
|
+
const node = this.createFunctionNode(func);
|
|
77
|
+
nodes.set(node.id, node);
|
|
78
|
+
// Add edge to module
|
|
79
|
+
const moduleId = this.getModuleId(func.module);
|
|
80
|
+
if (moduleId) {
|
|
81
|
+
edges.push(this.createEdge(node.id, moduleId, "contains"));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Add interface nodes
|
|
85
|
+
for (const iface of this.analysis.interfaces) {
|
|
86
|
+
const node = this.createInterfaceNode(iface);
|
|
87
|
+
nodes.set(node.id, node);
|
|
88
|
+
// Add edge to module
|
|
89
|
+
const moduleId = this.getModuleId(iface.module);
|
|
90
|
+
if (moduleId) {
|
|
91
|
+
edges.push(this.createEdge(node.id, moduleId, "contains"));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Add dependency edges
|
|
95
|
+
for (const dep of this.analysis.dependencies) {
|
|
96
|
+
for (const user of dep.usedBy) {
|
|
97
|
+
const moduleId = this.getModuleId(user);
|
|
98
|
+
if (moduleId) {
|
|
99
|
+
edges.push(this.createEdge(moduleId, `dep-${dep.name}`, "depends_on"));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Add inheritance edges
|
|
104
|
+
for (const cls of this.analysis.classes) {
|
|
105
|
+
if (cls.extends) {
|
|
106
|
+
const classId = this.getClassId(cls.name);
|
|
107
|
+
const parentId = this.getClassId(cls.extends);
|
|
108
|
+
if (classId && parentId) {
|
|
109
|
+
edges.push(this.createEdge(classId, parentId, "extends"));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const impl of cls.implements) {
|
|
113
|
+
const classId = this.getClassId(cls.name);
|
|
114
|
+
const interfaceId = this.getInterfaceId(impl);
|
|
115
|
+
if (classId && interfaceId) {
|
|
116
|
+
edges.push(this.createEdge(classId, interfaceId, "implements"));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Calculate metadata
|
|
121
|
+
const nodeTypes = {
|
|
122
|
+
module: 0,
|
|
123
|
+
class: 0,
|
|
124
|
+
function: 0,
|
|
125
|
+
interface: 0,
|
|
126
|
+
type: 0,
|
|
127
|
+
constant: 0,
|
|
128
|
+
config: 0,
|
|
129
|
+
concept: 0,
|
|
130
|
+
pattern: 0,
|
|
131
|
+
dependency: 0,
|
|
132
|
+
};
|
|
133
|
+
const connectionTypes = {
|
|
134
|
+
uses: 0,
|
|
135
|
+
extends: 0,
|
|
136
|
+
implements: 0,
|
|
137
|
+
depends_on: 0,
|
|
138
|
+
contains: 0,
|
|
139
|
+
calls: 0,
|
|
140
|
+
imports: 0,
|
|
141
|
+
related_to: 0,
|
|
142
|
+
alternative_to: 0,
|
|
143
|
+
conflicts_with: 0,
|
|
144
|
+
};
|
|
145
|
+
for (const node of nodes.values()) {
|
|
146
|
+
nodeTypes[node.type]++;
|
|
147
|
+
}
|
|
148
|
+
for (const edge of edges) {
|
|
149
|
+
connectionTypes[edge.type]++;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
nodes,
|
|
153
|
+
edges,
|
|
154
|
+
metadata: {
|
|
155
|
+
totalNodes: nodes.size,
|
|
156
|
+
totalEdges: edges.length,
|
|
157
|
+
nodeTypes,
|
|
158
|
+
connectionTypes,
|
|
159
|
+
generatedAt: Date.now(),
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
// ============================================================================
|
|
164
|
+
// Page Generators
|
|
165
|
+
// ============================================================================
|
|
166
|
+
/**
|
|
167
|
+
* Generate overview page
|
|
168
|
+
*/
|
|
169
|
+
generateOverviewPage() {
|
|
170
|
+
const project = this.analysis.project;
|
|
171
|
+
const metrics = this.analysis.metrics;
|
|
172
|
+
const sections = [
|
|
173
|
+
{
|
|
174
|
+
id: this.generateId(),
|
|
175
|
+
title: "Project Overview",
|
|
176
|
+
level: 1,
|
|
177
|
+
content: `# ${project.name}\n\n${project.description || "No description provided."}`,
|
|
178
|
+
codeBlocks: [],
|
|
179
|
+
subsections: [],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: this.generateId(),
|
|
183
|
+
title: "Quick Stats",
|
|
184
|
+
level: 2,
|
|
185
|
+
content: `| Metric | Value |\n|--------|-------|\n| Total Files | ${metrics.totalFiles} |\n| Total Lines | ${metrics.totalLines} |\n| Modules | ${metrics.totalModules} |\n| Classes | ${metrics.totalClasses} |\n| Functions | ${metrics.totalFunctions} |\n| Interfaces | ${metrics.totalInterfaces} |`,
|
|
186
|
+
codeBlocks: [],
|
|
187
|
+
subsections: [],
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: this.generateId(),
|
|
191
|
+
title: "Technologies",
|
|
192
|
+
level: 2,
|
|
193
|
+
content: `**Languages:** ${project.languages.join(", ")}\n\n**Frameworks:** ${project.frameworks.join(", ") || "None detected"}`,
|
|
194
|
+
codeBlocks: [],
|
|
195
|
+
subsections: [],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: this.generateId(),
|
|
199
|
+
title: "Entry Points",
|
|
200
|
+
level: 2,
|
|
201
|
+
content: project.entryPoints.length > 0
|
|
202
|
+
? project.entryPoints.map((ep) => `- \`${ep}\``).join("\n")
|
|
203
|
+
: "No entry points detected.",
|
|
204
|
+
codeBlocks: [],
|
|
205
|
+
subsections: [],
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
return this.createPage("overview", "Project Overview", "overview", sections, ["overview", "introduction", project.name]);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Generate architecture page
|
|
212
|
+
*/
|
|
213
|
+
generateArchitecturePage() {
|
|
214
|
+
const patterns = this.analysis.patterns;
|
|
215
|
+
const sections = [
|
|
216
|
+
{
|
|
217
|
+
id: this.generateId(),
|
|
218
|
+
title: "Architecture Overview",
|
|
219
|
+
level: 1,
|
|
220
|
+
content: "This document describes the high-level architecture of the project.",
|
|
221
|
+
codeBlocks: [],
|
|
222
|
+
subsections: [],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: this.generateId(),
|
|
226
|
+
title: "Module Structure",
|
|
227
|
+
level: 2,
|
|
228
|
+
content: this.generateModuleTree(),
|
|
229
|
+
codeBlocks: [],
|
|
230
|
+
subsections: [],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: this.generateId(),
|
|
234
|
+
title: "Design Patterns",
|
|
235
|
+
level: 2,
|
|
236
|
+
content: patterns.length > 0
|
|
237
|
+
? patterns
|
|
238
|
+
.map((p) => `### ${p.name}\n\n${p.description}\n\n**Occurrences:** ${p.occurrences.length}`)
|
|
239
|
+
.join("\n\n")
|
|
240
|
+
: "No design patterns detected.",
|
|
241
|
+
codeBlocks: [],
|
|
242
|
+
subsections: [],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: this.generateId(),
|
|
246
|
+
title: "Dependencies",
|
|
247
|
+
level: 2,
|
|
248
|
+
content: this.generateDependencySummary(),
|
|
249
|
+
codeBlocks: [],
|
|
250
|
+
subsections: [],
|
|
251
|
+
},
|
|
252
|
+
];
|
|
253
|
+
return this.createPage("architecture", "Architecture", "architecture", sections, ["architecture", "design", "structure"]);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Generate module page
|
|
257
|
+
*/
|
|
258
|
+
generateModulePage(module) {
|
|
259
|
+
const sections = [
|
|
260
|
+
{
|
|
261
|
+
id: this.generateId(),
|
|
262
|
+
title: "Module Overview",
|
|
263
|
+
level: 1,
|
|
264
|
+
content: `# ${module.name}\n\n**Path:** \`${module.path}\`\n\n${module.description || "No description provided."}`,
|
|
265
|
+
codeBlocks: [],
|
|
266
|
+
subsections: [],
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: this.generateId(),
|
|
270
|
+
title: "Statistics",
|
|
271
|
+
level: 2,
|
|
272
|
+
content: `| Metric | Value |\n|--------|-------|\n| Lines of Code | ${module.linesOfCode} |\n| Complexity | ${module.complexity} |\n| Classes | ${module.classes.length} |\n| Functions | ${module.functions.length} |\n| Interfaces | ${module.interfaces.length} |`,
|
|
273
|
+
codeBlocks: [],
|
|
274
|
+
subsections: [],
|
|
275
|
+
},
|
|
276
|
+
];
|
|
277
|
+
// Add exports section
|
|
278
|
+
if (module.exports.length > 0) {
|
|
279
|
+
sections.push({
|
|
280
|
+
id: this.generateId(),
|
|
281
|
+
title: "Exports",
|
|
282
|
+
level: 2,
|
|
283
|
+
content: module.exports.map((e) => `- \`${e}\``).join("\n"),
|
|
284
|
+
codeBlocks: [],
|
|
285
|
+
subsections: [],
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
// Add imports section
|
|
289
|
+
if (module.imports.length > 0) {
|
|
290
|
+
sections.push({
|
|
291
|
+
id: this.generateId(),
|
|
292
|
+
title: "Dependencies",
|
|
293
|
+
level: 2,
|
|
294
|
+
content: module.imports.map((i) => `- \`${i}\``).join("\n"),
|
|
295
|
+
codeBlocks: [],
|
|
296
|
+
subsections: [],
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return this.createPage(`module-${module.name}`, module.name, "module", sections, ["module", module.name, ...module.exports], [module.path]);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Generate class page
|
|
303
|
+
*/
|
|
304
|
+
generateClassPage(cls) {
|
|
305
|
+
const sections = [
|
|
306
|
+
{
|
|
307
|
+
id: this.generateId(),
|
|
308
|
+
title: "Class Overview",
|
|
309
|
+
level: 1,
|
|
310
|
+
content: this.generateClassSignature(cls),
|
|
311
|
+
codeBlocks: [],
|
|
312
|
+
subsections: [],
|
|
313
|
+
},
|
|
314
|
+
];
|
|
315
|
+
// Add description
|
|
316
|
+
if (cls.description) {
|
|
317
|
+
sections.push({
|
|
318
|
+
id: this.generateId(),
|
|
319
|
+
title: "Description",
|
|
320
|
+
level: 2,
|
|
321
|
+
content: cls.description,
|
|
322
|
+
codeBlocks: [],
|
|
323
|
+
subsections: [],
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
// Add properties section
|
|
327
|
+
if (cls.properties.length > 0) {
|
|
328
|
+
sections.push({
|
|
329
|
+
id: this.generateId(),
|
|
330
|
+
title: "Properties",
|
|
331
|
+
level: 2,
|
|
332
|
+
content: this.generatePropertiesTable(cls.properties),
|
|
333
|
+
codeBlocks: [],
|
|
334
|
+
subsections: [],
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
// Add methods section
|
|
338
|
+
if (cls.methods.length > 0) {
|
|
339
|
+
sections.push({
|
|
340
|
+
id: this.generateId(),
|
|
341
|
+
title: "Methods",
|
|
342
|
+
level: 2,
|
|
343
|
+
content: this.generateMethodsDocumentation(cls.methods),
|
|
344
|
+
codeBlocks: [],
|
|
345
|
+
subsections: [],
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
return this.createPage(`class-${cls.name}`, cls.name, "class", sections, ["class", cls.name, cls.module], [cls.module]);
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Generate function page
|
|
352
|
+
*/
|
|
353
|
+
generateFunctionPage(func) {
|
|
354
|
+
const sections = [
|
|
355
|
+
{
|
|
356
|
+
id: this.generateId(),
|
|
357
|
+
title: "Function Signature",
|
|
358
|
+
level: 1,
|
|
359
|
+
content: this.generateFunctionSignature(func),
|
|
360
|
+
codeBlocks: [
|
|
361
|
+
{
|
|
362
|
+
language: "typescript",
|
|
363
|
+
code: this.generateFunctionCode(func),
|
|
364
|
+
description: "Function signature",
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
subsections: [],
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
// Add description
|
|
371
|
+
if (func.description) {
|
|
372
|
+
sections.push({
|
|
373
|
+
id: this.generateId(),
|
|
374
|
+
title: "Description",
|
|
375
|
+
level: 2,
|
|
376
|
+
content: func.description,
|
|
377
|
+
codeBlocks: [],
|
|
378
|
+
subsections: [],
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
// Add parameters section
|
|
382
|
+
if (func.parameters.length > 0) {
|
|
383
|
+
sections.push({
|
|
384
|
+
id: this.generateId(),
|
|
385
|
+
title: "Parameters",
|
|
386
|
+
level: 2,
|
|
387
|
+
content: this.generateParametersTable(func.parameters),
|
|
388
|
+
codeBlocks: [],
|
|
389
|
+
subsections: [],
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
// Add return type section
|
|
393
|
+
sections.push({
|
|
394
|
+
id: this.generateId(),
|
|
395
|
+
title: "Returns",
|
|
396
|
+
level: 2,
|
|
397
|
+
content: `\`${func.returnType}\``,
|
|
398
|
+
codeBlocks: [],
|
|
399
|
+
subsections: [],
|
|
400
|
+
});
|
|
401
|
+
return this.createPage(`function-${func.name}`, func.name, "function", sections, ["function", func.name, func.module], [func.module]);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Generate interface page
|
|
405
|
+
*/
|
|
406
|
+
generateInterfacePage(iface) {
|
|
407
|
+
const sections = [
|
|
408
|
+
{
|
|
409
|
+
id: this.generateId(),
|
|
410
|
+
title: "Interface Definition",
|
|
411
|
+
level: 1,
|
|
412
|
+
content: this.generateInterfaceSignature(iface),
|
|
413
|
+
codeBlocks: [],
|
|
414
|
+
subsections: [],
|
|
415
|
+
},
|
|
416
|
+
];
|
|
417
|
+
// Add description
|
|
418
|
+
if (iface.description) {
|
|
419
|
+
sections.push({
|
|
420
|
+
id: this.generateId(),
|
|
421
|
+
title: "Description",
|
|
422
|
+
level: 2,
|
|
423
|
+
content: iface.description,
|
|
424
|
+
codeBlocks: [],
|
|
425
|
+
subsections: [],
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
// Add properties section
|
|
429
|
+
if (iface.properties.length > 0) {
|
|
430
|
+
sections.push({
|
|
431
|
+
id: this.generateId(),
|
|
432
|
+
title: "Properties",
|
|
433
|
+
level: 2,
|
|
434
|
+
content: this.generatePropertiesTable(iface.properties),
|
|
435
|
+
codeBlocks: [],
|
|
436
|
+
subsections: [],
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
// Add methods section
|
|
440
|
+
if (iface.methods.length > 0) {
|
|
441
|
+
sections.push({
|
|
442
|
+
id: this.generateId(),
|
|
443
|
+
title: "Methods",
|
|
444
|
+
level: 2,
|
|
445
|
+
content: this.generateMethodsDocumentation(iface.methods),
|
|
446
|
+
codeBlocks: [],
|
|
447
|
+
subsections: [],
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
return this.createPage(`interface-${iface.name}`, iface.name, "interface", sections, ["interface", iface.name, iface.module], [iface.module]);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Generate pattern page
|
|
454
|
+
*/
|
|
455
|
+
generatePatternPage(pattern) {
|
|
456
|
+
const sections = [
|
|
457
|
+
{
|
|
458
|
+
id: this.generateId(),
|
|
459
|
+
title: `${pattern.name} Pattern`,
|
|
460
|
+
level: 1,
|
|
461
|
+
content: pattern.description,
|
|
462
|
+
codeBlocks: [],
|
|
463
|
+
subsections: [],
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
id: this.generateId(),
|
|
467
|
+
title: "Occurrences",
|
|
468
|
+
level: 2,
|
|
469
|
+
content: pattern.occurrences
|
|
470
|
+
.map((o) => `- \`${o.file}\` (lines ${o.lineStart}-${o.lineEnd}): ${o.description}`)
|
|
471
|
+
.join("\n"),
|
|
472
|
+
codeBlocks: [],
|
|
473
|
+
subsections: [],
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
id: this.generateId(),
|
|
477
|
+
title: "Confidence",
|
|
478
|
+
level: 2,
|
|
479
|
+
content: `Detection confidence: **${Math.round(pattern.confidence * 100)}%**`,
|
|
480
|
+
codeBlocks: [],
|
|
481
|
+
subsections: [],
|
|
482
|
+
},
|
|
483
|
+
];
|
|
484
|
+
return this.createPage(`pattern-${pattern.name.toLowerCase()}`, `${pattern.name} Pattern`, "concept", sections, ["pattern", pattern.name, pattern.type]);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Generate API reference page
|
|
488
|
+
*/
|
|
489
|
+
generateApiReferencePage() {
|
|
490
|
+
const sections = [
|
|
491
|
+
{
|
|
492
|
+
id: this.generateId(),
|
|
493
|
+
title: "API Reference",
|
|
494
|
+
level: 1,
|
|
495
|
+
content: "Complete API reference for all exported functions, classes, and interfaces.",
|
|
496
|
+
codeBlocks: [],
|
|
497
|
+
subsections: [],
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
id: this.generateId(),
|
|
501
|
+
title: "Exported Classes",
|
|
502
|
+
level: 2,
|
|
503
|
+
content: this.analysis.classes
|
|
504
|
+
.filter((c) => c.isExported)
|
|
505
|
+
.map((c) => `- [[class-${c.name}|${c.name}]] - ${c.description || "No description"}`)
|
|
506
|
+
.join("\n") || "No exported classes.",
|
|
507
|
+
codeBlocks: [],
|
|
508
|
+
subsections: [],
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
id: this.generateId(),
|
|
512
|
+
title: "Exported Functions",
|
|
513
|
+
level: 2,
|
|
514
|
+
content: this.analysis.functions
|
|
515
|
+
.filter((f) => f.isExported)
|
|
516
|
+
.map((f) => `- [[function-${f.name}|${f.name}]] - ${f.description || "No description"}`)
|
|
517
|
+
.join("\n") || "No exported functions.",
|
|
518
|
+
codeBlocks: [],
|
|
519
|
+
subsections: [],
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
id: this.generateId(),
|
|
523
|
+
title: "Exported Interfaces",
|
|
524
|
+
level: 2,
|
|
525
|
+
content: this.analysis.interfaces
|
|
526
|
+
.filter((i) => i.isExported)
|
|
527
|
+
.map((i) => `- [[interface-${i.name}|${i.name}]] - ${i.description || "No description"}`)
|
|
528
|
+
.join("\n") || "No exported interfaces.",
|
|
529
|
+
codeBlocks: [],
|
|
530
|
+
subsections: [],
|
|
531
|
+
},
|
|
532
|
+
];
|
|
533
|
+
return this.createPage("api-reference", "API Reference", "reference", sections, ["api", "reference", "exports"]);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Generate getting started guide
|
|
537
|
+
*/
|
|
538
|
+
generateGettingStartedGuide() {
|
|
539
|
+
const project = this.analysis.project;
|
|
540
|
+
const sections = [
|
|
541
|
+
{
|
|
542
|
+
id: this.generateId(),
|
|
543
|
+
title: "Getting Started",
|
|
544
|
+
level: 1,
|
|
545
|
+
content: `Welcome to ${project.name}! This guide will help you get started.`,
|
|
546
|
+
codeBlocks: [],
|
|
547
|
+
subsections: [],
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
id: this.generateId(),
|
|
551
|
+
title: "Installation",
|
|
552
|
+
level: 2,
|
|
553
|
+
content: "```bash\nnpm install\n```",
|
|
554
|
+
codeBlocks: [
|
|
555
|
+
{
|
|
556
|
+
language: "bash",
|
|
557
|
+
code: "npm install",
|
|
558
|
+
description: "Install dependencies",
|
|
559
|
+
},
|
|
560
|
+
],
|
|
561
|
+
subsections: [],
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: this.generateId(),
|
|
565
|
+
title: "Running the Project",
|
|
566
|
+
level: 2,
|
|
567
|
+
content: project.entryPoints.length > 0
|
|
568
|
+
? `Entry points:\n${project.entryPoints.map((ep) => `- \`${ep}\``).join("\n")}`
|
|
569
|
+
: "No entry points detected.",
|
|
570
|
+
codeBlocks: [],
|
|
571
|
+
subsections: [],
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
id: this.generateId(),
|
|
575
|
+
title: "Project Structure",
|
|
576
|
+
level: 2,
|
|
577
|
+
content: this.generateModuleTree(),
|
|
578
|
+
codeBlocks: [],
|
|
579
|
+
subsections: [],
|
|
580
|
+
},
|
|
581
|
+
];
|
|
582
|
+
return this.createPage("getting-started", "Getting Started", "guide", sections, ["guide", "tutorial", "getting-started"]);
|
|
583
|
+
}
|
|
584
|
+
// ============================================================================
|
|
585
|
+
// Helper Methods
|
|
586
|
+
// ============================================================================
|
|
587
|
+
/**
|
|
588
|
+
* Create a wiki page
|
|
589
|
+
*/
|
|
590
|
+
createPage(id, title, category, sections, tags, sourceFiles = []) {
|
|
591
|
+
const content = sections.map((s) => s.content).join("\n\n");
|
|
592
|
+
const summary = this.generateSummary(content);
|
|
593
|
+
return {
|
|
594
|
+
id,
|
|
595
|
+
title,
|
|
596
|
+
slug: this.slugify(title),
|
|
597
|
+
content,
|
|
598
|
+
summary,
|
|
599
|
+
category,
|
|
600
|
+
tags,
|
|
601
|
+
links: this.extractLinks(content),
|
|
602
|
+
metadata: {
|
|
603
|
+
sourceFiles,
|
|
604
|
+
complexity: "intermediate",
|
|
605
|
+
estimatedReadTime: Math.ceil(content.length / 1000),
|
|
606
|
+
lastVerified: Date.now(),
|
|
607
|
+
contributors: [],
|
|
608
|
+
status: "published",
|
|
609
|
+
},
|
|
610
|
+
sections,
|
|
611
|
+
createdAt: Date.now(),
|
|
612
|
+
updatedAt: Date.now(),
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Generate a unique ID
|
|
617
|
+
*/
|
|
618
|
+
generateId() {
|
|
619
|
+
return `id-${++this.pageIdCounter}`;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Generate a slug from a title
|
|
623
|
+
*/
|
|
624
|
+
slugify(title) {
|
|
625
|
+
return title
|
|
626
|
+
.toLowerCase()
|
|
627
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
628
|
+
.replace(/^-|-$/g, "");
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Generate a summary from content
|
|
632
|
+
*/
|
|
633
|
+
generateSummary(content) {
|
|
634
|
+
const plainText = content
|
|
635
|
+
.replace(/#{1,6}\s+/g, "")
|
|
636
|
+
.replace(/\*\*/g, "")
|
|
637
|
+
.replace(/\[\[.*?\]\]/g, "")
|
|
638
|
+
.replace(/`[^`]+`/g, "");
|
|
639
|
+
const firstParagraph = plainText.split("\n\n")[0] || "";
|
|
640
|
+
return (firstParagraph.substring(0, 200) +
|
|
641
|
+
(firstParagraph.length > 200 ? "..." : ""));
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Extract links from content
|
|
645
|
+
*/
|
|
646
|
+
extractLinks(content) {
|
|
647
|
+
const links = [];
|
|
648
|
+
const linkRegex = /\[\[(.*?)(?:\|(.*?))?\]\]/g;
|
|
649
|
+
let match;
|
|
650
|
+
while ((match = linkRegex.exec(content)) !== null) {
|
|
651
|
+
links.push({
|
|
652
|
+
targetId: match[1],
|
|
653
|
+
targetSlug: this.slugify(match[1]),
|
|
654
|
+
text: match[2] || match[1],
|
|
655
|
+
type: "internal",
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
return links;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Check if a function is significant enough for its own page
|
|
662
|
+
*/
|
|
663
|
+
isSignificantFunction(func) {
|
|
664
|
+
return func.isExported || func.description.length > 50;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Generate module tree
|
|
668
|
+
*/
|
|
669
|
+
generateModuleTree() {
|
|
670
|
+
const tree = {};
|
|
671
|
+
for (const module of this.analysis.modules) {
|
|
672
|
+
const parts = module.path.split("/");
|
|
673
|
+
const dir = parts.slice(0, -1).join("/") || "/";
|
|
674
|
+
if (!tree[dir])
|
|
675
|
+
tree[dir] = [];
|
|
676
|
+
tree[dir].push(parts[parts.length - 1]);
|
|
677
|
+
}
|
|
678
|
+
let output = "```\n";
|
|
679
|
+
for (const [dir, files] of Object.entries(tree).sort()) {
|
|
680
|
+
output += `${dir}/\n`;
|
|
681
|
+
for (const file of files.sort()) {
|
|
682
|
+
output += ` ├── ${file}\n`;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
output += "```";
|
|
686
|
+
return output;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Generate dependency summary
|
|
690
|
+
*/
|
|
691
|
+
generateDependencySummary() {
|
|
692
|
+
const prodDeps = this.analysis.dependencies.filter((d) => d.type === "production");
|
|
693
|
+
const devDeps = this.analysis.dependencies.filter((d) => d.type === "development");
|
|
694
|
+
let output = `**Production Dependencies:** ${prodDeps.length}\n\n`;
|
|
695
|
+
output += `**Development Dependencies:** ${devDeps.length}\n\n`;
|
|
696
|
+
if (prodDeps.length > 0) {
|
|
697
|
+
output += "### Production\n\n";
|
|
698
|
+
output += prodDeps
|
|
699
|
+
.map((d) => `- \`${d.name}\` (${d.version})`)
|
|
700
|
+
.join("\n");
|
|
701
|
+
}
|
|
702
|
+
return output;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Generate class signature
|
|
706
|
+
*/
|
|
707
|
+
generateClassSignature(cls) {
|
|
708
|
+
let sig = "";
|
|
709
|
+
if (cls.isExported)
|
|
710
|
+
sig += "export ";
|
|
711
|
+
if (cls.isAbstract)
|
|
712
|
+
sig += "abstract ";
|
|
713
|
+
sig += `class ${cls.name}`;
|
|
714
|
+
if (cls.extends)
|
|
715
|
+
sig += ` extends ${cls.extends}`;
|
|
716
|
+
if (cls.implements.length > 0)
|
|
717
|
+
sig += ` implements ${cls.implements.join(", ")}`;
|
|
718
|
+
return `\`${sig}\``;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Generate function signature
|
|
722
|
+
*/
|
|
723
|
+
generateFunctionSignature(func) {
|
|
724
|
+
let sig = "";
|
|
725
|
+
if (func.isExported)
|
|
726
|
+
sig += "export ";
|
|
727
|
+
if (func.isAsync)
|
|
728
|
+
sig += "async ";
|
|
729
|
+
sig += `function ${func.name}(`;
|
|
730
|
+
sig += func.parameters.map((p) => `${p.name}: ${p.type}`).join(", ");
|
|
731
|
+
sig += `): ${func.returnType}`;
|
|
732
|
+
return `\`${sig}\``;
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Generate function code
|
|
736
|
+
*/
|
|
737
|
+
generateFunctionCode(func) {
|
|
738
|
+
let code = "";
|
|
739
|
+
if (func.isExported)
|
|
740
|
+
code += "export ";
|
|
741
|
+
if (func.isAsync)
|
|
742
|
+
code += "async ";
|
|
743
|
+
code += `function ${func.name}(\n`;
|
|
744
|
+
code += func.parameters.map((p) => ` ${p.name}: ${p.type},`).join("\n");
|
|
745
|
+
code += `\n): ${func.returnType} {\n // Implementation\n}`;
|
|
746
|
+
return code;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Generate interface signature
|
|
750
|
+
*/
|
|
751
|
+
generateInterfaceSignature(iface) {
|
|
752
|
+
let sig = "";
|
|
753
|
+
if (iface.isExported)
|
|
754
|
+
sig += "export ";
|
|
755
|
+
sig += `interface ${iface.name}`;
|
|
756
|
+
if (iface.extends.length > 0)
|
|
757
|
+
sig += ` extends ${iface.extends.join(", ")}`;
|
|
758
|
+
return `\`${sig}\``;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Generate properties table
|
|
762
|
+
*/
|
|
763
|
+
generatePropertiesTable(properties) {
|
|
764
|
+
let table = "| Name | Type | Visibility | Description |\n";
|
|
765
|
+
table += "|------|------|------------|-------------|\n";
|
|
766
|
+
for (const prop of properties) {
|
|
767
|
+
table += `| \`${prop.name}\` | \`${prop.type}\` | ${prop.visibility} | ${prop.description || "-"} |\n`;
|
|
768
|
+
}
|
|
769
|
+
return table;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Generate methods documentation
|
|
773
|
+
*/
|
|
774
|
+
generateMethodsDocumentation(methods) {
|
|
775
|
+
let doc = "";
|
|
776
|
+
for (const method of methods) {
|
|
777
|
+
doc += `### \`${method.name}\`\n\n`;
|
|
778
|
+
if (method.description) {
|
|
779
|
+
doc += `${method.description}\n\n`;
|
|
780
|
+
}
|
|
781
|
+
doc += `**Signature:** \`${method.visibility} ${method.isStatic ? "static " : ""}${method.isAsync ? "async " : ""}${method.name}(${method.parameters.map((p) => `${p.name}: ${p.type}`).join(", ")}): ${method.returnType}\`\n\n`;
|
|
782
|
+
if (method.parameters.length > 0) {
|
|
783
|
+
doc += "**Parameters:**\n\n";
|
|
784
|
+
for (const param of method.parameters) {
|
|
785
|
+
doc += `- \`${param.name}\` (\`${param.type}\`)${param.isOptional ? " (optional)" : ""}: ${param.description || "No description"}\n`;
|
|
786
|
+
}
|
|
787
|
+
doc += "\n";
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return doc;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Generate parameters table
|
|
794
|
+
*/
|
|
795
|
+
generateParametersTable(parameters) {
|
|
796
|
+
let table = "| Name | Type | Optional | Description |\n";
|
|
797
|
+
table += "|------|------|----------|-------------|\n";
|
|
798
|
+
for (const param of parameters) {
|
|
799
|
+
table += `| \`${param.name}\` | \`${param.type}\` | ${param.isOptional ? "Yes" : "No"} | ${param.description || "-"} |\n`;
|
|
800
|
+
}
|
|
801
|
+
return table;
|
|
802
|
+
}
|
|
803
|
+
// ============================================================================
|
|
804
|
+
// Knowledge Graph Helpers
|
|
805
|
+
// ============================================================================
|
|
806
|
+
/**
|
|
807
|
+
* Create a module node
|
|
808
|
+
*/
|
|
809
|
+
createModuleNode(module) {
|
|
810
|
+
return {
|
|
811
|
+
id: `module-${module.name}`,
|
|
812
|
+
type: "module",
|
|
813
|
+
name: module.name,
|
|
814
|
+
description: module.description,
|
|
815
|
+
properties: {
|
|
816
|
+
path: module.path,
|
|
817
|
+
linesOfCode: module.linesOfCode,
|
|
818
|
+
complexity: module.complexity,
|
|
819
|
+
},
|
|
820
|
+
connections: [],
|
|
821
|
+
pageId: `module-${module.name}`,
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Create a class node
|
|
826
|
+
*/
|
|
827
|
+
createClassNode(cls) {
|
|
828
|
+
return {
|
|
829
|
+
id: `class-${cls.name}`,
|
|
830
|
+
type: "class",
|
|
831
|
+
name: cls.name,
|
|
832
|
+
description: cls.description,
|
|
833
|
+
properties: {
|
|
834
|
+
module: cls.module,
|
|
835
|
+
isAbstract: cls.isAbstract,
|
|
836
|
+
isExported: cls.isExported,
|
|
837
|
+
methodCount: cls.methods.length,
|
|
838
|
+
propertyCount: cls.properties.length,
|
|
839
|
+
},
|
|
840
|
+
connections: [],
|
|
841
|
+
pageId: `class-${cls.name}`,
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Create a function node
|
|
846
|
+
*/
|
|
847
|
+
createFunctionNode(func) {
|
|
848
|
+
return {
|
|
849
|
+
id: `function-${func.name}`,
|
|
850
|
+
type: "function",
|
|
851
|
+
name: func.name,
|
|
852
|
+
description: func.description,
|
|
853
|
+
properties: {
|
|
854
|
+
module: func.module,
|
|
855
|
+
isAsync: func.isAsync,
|
|
856
|
+
isExported: func.isExported,
|
|
857
|
+
parameterCount: func.parameters.length,
|
|
858
|
+
},
|
|
859
|
+
connections: [],
|
|
860
|
+
pageId: `function-${func.name}`,
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Create an interface node
|
|
865
|
+
*/
|
|
866
|
+
createInterfaceNode(iface) {
|
|
867
|
+
return {
|
|
868
|
+
id: `interface-${iface.name}`,
|
|
869
|
+
type: "interface",
|
|
870
|
+
name: iface.name,
|
|
871
|
+
description: iface.description,
|
|
872
|
+
properties: {
|
|
873
|
+
module: iface.module,
|
|
874
|
+
isExported: iface.isExported,
|
|
875
|
+
propertyCount: iface.properties.length,
|
|
876
|
+
methodCount: iface.methods.length,
|
|
877
|
+
},
|
|
878
|
+
connections: [],
|
|
879
|
+
pageId: `interface-${iface.name}`,
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Create an edge
|
|
884
|
+
*/
|
|
885
|
+
createEdge(sourceId, targetId, type) {
|
|
886
|
+
return {
|
|
887
|
+
id: `edge-${++this.edgeIdCounter}`,
|
|
888
|
+
sourceId,
|
|
889
|
+
targetId,
|
|
890
|
+
type,
|
|
891
|
+
weight: 1,
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Get module ID from path
|
|
896
|
+
*/
|
|
897
|
+
getModuleId(path) {
|
|
898
|
+
const module = this.analysis.modules.find((m) => m.path === path);
|
|
899
|
+
return module ? `module-${module.name}` : undefined;
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Get class ID from name
|
|
903
|
+
*/
|
|
904
|
+
getClassId(name) {
|
|
905
|
+
const cls = this.analysis.classes.find((c) => c.name === name);
|
|
906
|
+
return cls ? `class-${cls.name}` : undefined;
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Get interface ID from name
|
|
910
|
+
*/
|
|
911
|
+
getInterfaceId(name) {
|
|
912
|
+
const iface = this.analysis.interfaces.find((i) => i.name === name);
|
|
913
|
+
return iface ? `interface-${iface.name}` : undefined;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
// ============================================================================
|
|
917
|
+
// Factory Function
|
|
918
|
+
// ============================================================================
|
|
919
|
+
export function createDocumentationExtractor(analysis) {
|
|
920
|
+
return new DocumentationExtractor(analysis);
|
|
921
|
+
}
|
|
922
|
+
export default DocumentationExtractor;
|
|
923
|
+
//# sourceMappingURL=extractor.js.map
|