@monoes/monomindcli 2.7.13 → 2.7.15
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/.claude/agents/architecture/system-design/arch-system-design.md +0 -0
- package/.claude/agents/consensus/crdt-synchronizer.md +0 -0
- package/.claude/agents/consensus/quorum-manager.md +0 -0
- package/.claude/agents/consensus/security-manager.md +0 -0
- package/.claude/agents/core/coder.md +0 -0
- package/.claude/agents/core/coordinator.md +0 -0
- package/.claude/agents/core/planner.md +0 -0
- package/.claude/agents/core/researcher.md +0 -0
- package/.claude/agents/core/reviewer.md +0 -0
- package/.claude/agents/core/tester.md +0 -0
- package/.claude/agents/design/design-monodesign.md +0 -0
- package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-ai-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -0
- package/.claude/agents/engineering/engineering-backend-architect.md +0 -0
- package/.claude/agents/engineering/engineering-code-reviewer.md +0 -0
- package/.claude/agents/engineering/engineering-data-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-database-optimizer.md +0 -0
- package/.claude/agents/engineering/engineering-devops-automator.md +0 -0
- package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-feishu-integration-developer.md +0 -0
- package/.claude/agents/engineering/engineering-frontend-developer.md +0 -0
- package/.claude/agents/engineering/engineering-git-workflow-master.md +0 -0
- package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -0
- package/.claude/agents/engineering/engineering-mobile-app-builder.md +0 -0
- package/.claude/agents/engineering/engineering-rapid-prototyper.md +0 -0
- package/.claude/agents/engineering/engineering-security-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-senior-developer.md +0 -0
- package/.claude/agents/engineering/engineering-software-architect.md +0 -0
- package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-sre.md +0 -0
- package/.claude/agents/engineering/engineering-technical-writer.md +0 -0
- package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -0
- package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +0 -0
- package/.claude/agents/github/code-review-swarm.md +0 -0
- package/.claude/agents/github/github-modes.md +0 -0
- package/.claude/agents/github/issue-tracker.md +0 -0
- package/.claude/agents/github/multi-repo-swarm.md +0 -0
- package/.claude/agents/github/pr-manager.md +0 -0
- package/.claude/agents/github/project-board-sync.md +0 -0
- package/.claude/agents/github/release-manager.md +0 -0
- package/.claude/agents/github/repo-architect.md +0 -0
- package/.claude/agents/github/swarm-issue.md +0 -0
- package/.claude/agents/github/swarm-pr.md +0 -0
- package/.claude/agents/github/sync-coordinator.md +0 -0
- package/.claude/agents/github/workflow-automation.md +0 -0
- package/.claude/agents/goal/goal-planner.md +0 -0
- package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -0
- package/.claude/agents/hive-mind/scout-explorer.md +0 -0
- package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -0
- package/.claude/agents/hive-mind/worker-specialist.md +0 -0
- package/.claude/agents/marketing/marketing-competitive-content.md +0 -0
- package/.claude/agents/marketing/marketing-cro-specialist.md +0 -0
- package/.claude/agents/marketing/marketing-email-specialist.md +0 -0
- package/.claude/agents/marketing/marketing-launch-strategist.md +0 -0
- package/.claude/agents/marketing/marketing-pricing-strategist.md +0 -0
- package/.claude/agents/optimization/benchmark-suite.md +0 -0
- package/.claude/agents/optimization/load-balancer.md +0 -0
- package/.claude/agents/optimization/performance-monitor.md +0 -0
- package/.claude/agents/optimization/resource-allocator.md +0 -0
- package/.claude/agents/optimization/topology-optimizer.md +0 -0
- package/.claude/agents/schemas/architecture-output.json +0 -0
- package/.claude/agents/schemas/code-review-output.json +0 -0
- package/.claude/agents/schemas/generic-task-input.json +0 -0
- package/.claude/agents/schemas/implementation-output.json +0 -0
- package/.claude/agents/schemas/research-output.json +0 -0
- package/.claude/agents/schemas/security-audit-output.json +0 -0
- package/.claude/agents/schemas/test-report-output.json +0 -0
- package/.claude/agents/specialists/integration-architect.md +0 -0
- package/.claude/agents/specialized/agentic-identity-trust.md +0 -0
- package/.claude/agents/specialized/agents-orchestrator.md +0 -0
- package/.claude/agents/specialized/automation-governance-architect.md +0 -0
- package/.claude/agents/specialized/blockchain-security-auditor.md +0 -0
- package/.claude/agents/specialized/compliance-auditor.md +0 -0
- package/.claude/agents/specialized/identity-graph-operator.md +0 -0
- package/.claude/agents/specialized/lsp-index-engineer.md +0 -0
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -0
- package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -0
- package/.claude/agents/specialized/specialized-developer-advocate.md +0 -0
- package/.claude/agents/specialized/specialized-document-generator.md +0 -0
- package/.claude/agents/specialized/specialized-mcp-builder.md +0 -0
- package/.claude/agents/specialized/specialized-model-qa.md +0 -0
- package/.claude/agents/specialized/specialized-workflow-architect.md +0 -0
- package/.claude/agents/specialized/zk-steward.md +0 -0
- package/.claude/agents/swarm/mesh-coordinator.md +0 -0
- package/.claude/agents/templates/automation-smart-agent.md +0 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +0 -0
- package/.claude/agents/testing/production-validator.md +0 -0
- package/.claude/agents/testing/tdd-london-swarm.md +0 -0
- package/.claude/agents/testing/testing-accessibility-auditor.md +0 -0
- package/.claude/agents/testing/testing-api-tester.md +0 -0
- package/.claude/agents/testing/testing-evidence-collector.md +0 -0
- package/.claude/agents/testing/testing-performance-benchmarker.md +0 -0
- package/.claude/agents/testing/testing-test-results-analyzer.md +0 -0
- package/.claude/agents/testing/testing-tool-evaluator.md +0 -0
- package/.claude/agents/testing/testing-workflow-optimizer.md +0 -0
- package/.claude/commands/agents/README.md +0 -0
- package/.claude/commands/agents/agent-capabilities.md +0 -0
- package/.claude/commands/agents/agent-coordination.md +0 -0
- package/.claude/commands/agents/agent-spawning.md +0 -0
- package/.claude/commands/agents/agent-types.md +0 -0
- package/.claude/commands/analysis/README.md +0 -0
- package/.claude/commands/analysis/bottleneck-detect.md +0 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +0 -0
- package/.claude/commands/analysis/performance-report.md +0 -0
- package/.claude/commands/analysis/token-usage.md +0 -0
- package/.claude/commands/automation/README.md +0 -0
- package/.claude/commands/automation/auto-agent.md +0 -0
- package/.claude/commands/automation/self-healing.md +0 -0
- package/.claude/commands/automation/session-memory.md +0 -0
- package/.claude/commands/automation/smart-agents.md +0 -0
- package/.claude/commands/automation/smart-spawn.md +0 -0
- package/.claude/commands/automation/workflow-select.md +0 -0
- package/.claude/commands/coordination/README.md +0 -0
- package/.claude/commands/coordination/agent-spawn.md +0 -0
- package/.claude/commands/coordination/swarm-init.md +0 -0
- package/.claude/commands/coordination/task-orchestrate.md +0 -0
- package/.claude/commands/github/README.md +0 -0
- package/.claude/commands/github/github-modes.md +0 -0
- package/.claude/commands/github/issue-tracker.md +0 -0
- package/.claude/commands/github/pr-manager.md +0 -0
- package/.claude/commands/github/release-manager.md +0 -0
- package/.claude/commands/github/repo-architect.md +0 -0
- package/.claude/commands/github/sync-coordinator.md +0 -0
- package/.claude/commands/hive-mind/README.md +0 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +0 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +0 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +0 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +0 -0
- package/.claude/commands/hive-mind/hive-mind.md +0 -0
- package/.claude/commands/hooks/README.md +0 -0
- package/.claude/commands/hooks/overview.md +0 -0
- package/.claude/commands/hooks/post-edit.md +0 -0
- package/.claude/commands/hooks/post-task.md +0 -0
- package/.claude/commands/hooks/pre-edit.md +0 -0
- package/.claude/commands/hooks/pre-task.md +0 -0
- package/.claude/commands/hooks/session-end.md +0 -0
- package/.claude/commands/hooks/setup.md +0 -0
- package/.claude/commands/mastermind/_repeat.md +0 -0
- package/.claude/commands/mastermind/_taskfile.md +0 -0
- package/.claude/commands/mastermind/adr.md +0 -0
- package/.claude/commands/mastermind/approvev1.md +0 -0
- package/.claude/commands/mastermind/architect.md +0 -0
- package/.claude/commands/mastermind/autodev.md +0 -0
- package/.claude/commands/mastermind/brain.md +0 -0
- package/.claude/commands/mastermind/budget.md +0 -0
- package/.claude/commands/mastermind/build.md +0 -0
- package/.claude/commands/mastermind/code-review.md +0 -0
- package/.claude/commands/mastermind/content.md +0 -0
- package/.claude/commands/mastermind/createorg.md +2 -0
- package/.claude/commands/mastermind/createtask.md +0 -0
- package/.claude/commands/mastermind/debug.md +0 -0
- package/.claude/commands/mastermind/design.md +0 -0
- package/.claude/commands/mastermind/do.md +0 -0
- package/.claude/commands/mastermind/execute.md +0 -0
- package/.claude/commands/mastermind/finance.md +0 -0
- package/.claude/commands/mastermind/finish.md +0 -0
- package/.claude/commands/mastermind/graph-status.md +0 -0
- package/.claude/commands/mastermind/help.md +0 -0
- package/.claude/commands/mastermind/idea.md +0 -0
- package/.claude/commands/mastermind/ideate.md +0 -0
- package/.claude/commands/mastermind/improve.md +0 -0
- package/.claude/commands/mastermind/loops.md +0 -0
- package/.claude/commands/mastermind/marketing.md +0 -0
- package/.claude/commands/mastermind/master.md +0 -0
- package/.claude/commands/mastermind/memory.md +0 -0
- package/.claude/commands/mastermind/okf-export.md +0 -0
- package/.claude/commands/mastermind/okf-import.md +6 -1
- package/.claude/commands/mastermind/ops.md +0 -0
- package/.claude/commands/mastermind/orgs.md +0 -0
- package/.claude/commands/mastermind/orgstatus.md +0 -0
- package/.claude/commands/mastermind/plan.md +0 -0
- package/.claude/commands/mastermind/receive-review.md +0 -0
- package/.claude/commands/mastermind/references/antigravity-tools.md +0 -0
- package/.claude/commands/mastermind/references/claude-code-tools.md +0 -0
- package/.claude/commands/mastermind/references/codex-tools.md +0 -0
- package/.claude/commands/mastermind/references/copilot-tools.md +0 -0
- package/.claude/commands/mastermind/references/gemini-tools.md +0 -0
- package/.claude/commands/mastermind/references/pi-tools.md +0 -0
- package/.claude/commands/mastermind/release.md +0 -0
- package/.claude/commands/mastermind/repeat.md +0 -0
- package/.claude/commands/mastermind/research.md +0 -0
- package/.claude/commands/mastermind/review.md +0 -0
- package/.claude/commands/mastermind/runorg.md +0 -0
- package/.claude/commands/mastermind/runorgv1.md +0 -0
- package/.claude/commands/mastermind/sales.md +0 -0
- package/.claude/commands/mastermind/skill-builder.md +0 -0
- package/.claude/commands/mastermind/specialagents.md +0 -0
- package/.claude/commands/mastermind/stoporg.md +0 -0
- package/.claude/commands/mastermind/swarm.md +0 -0
- package/.claude/commands/mastermind/taskdev.md +0 -0
- package/.claude/commands/mastermind/tdd.md +0 -0
- package/.claude/commands/mastermind/techport.md +0 -0
- package/.claude/commands/mastermind/topology.md +0 -0
- package/.claude/commands/mastermind/understand.md +0 -0
- package/.claude/commands/mastermind/verify.md +0 -0
- package/.claude/commands/mastermind/worktree.md +0 -0
- package/.claude/commands/mastermind.md +0 -0
- package/.claude/commands/memory/README.md +0 -0
- package/.claude/commands/memory/memory-search.md +0 -0
- package/.claude/commands/monitoring/README.md +0 -0
- package/.claude/commands/monitoring/agent-metrics.md +0 -0
- package/.claude/commands/monitoring/agents.md +0 -0
- package/.claude/commands/monitoring/status.md +0 -0
- package/.claude/commands/monobrowse.md +0 -0
- package/.claude/commands/monoes/README.md +0 -0
- package/.claude/commands/monoes/install.md +0 -0
- package/.claude/commands/monoes/monoagent.md +0 -0
- package/.claude/commands/monoes/monoclip.md +0 -0
- package/.claude/commands/monoes/monotask.md +0 -0
- package/.claude/commands/monograph/README.md +0 -0
- package/.claude/commands/monograph/monograph-build.md +0 -0
- package/.claude/commands/monograph/monograph-search.md +0 -0
- package/.claude/commands/monograph/monograph-stats.md +0 -0
- package/.claude/commands/monograph/monograph-watch.md +0 -0
- package/.claude/commands/monograph/monograph-wiki.md +0 -0
- package/.claude/commands/optimization/auto-topology.md +0 -0
- package/.claude/commands/optimization/performance-optimize.md +0 -0
- package/.claude/commands/pair/README.md +0 -0
- package/.claude/commands/pair/examples.md +0 -0
- package/.claude/commands/pair/modes.md +0 -0
- package/.claude/commands/pair/session.md +0 -0
- package/.claude/commands/stream-chain/pipeline.md +0 -0
- package/.claude/commands/stream-chain/run.md +0 -0
- package/.claude/commands/swarm/README.md +0 -0
- package/.claude/commands/swarm/analysis.md +0 -0
- package/.claude/commands/swarm/development.md +0 -0
- package/.claude/commands/swarm/examples.md +0 -0
- package/.claude/commands/swarm/maintenance.md +0 -0
- package/.claude/commands/swarm/optimization.md +0 -0
- package/.claude/commands/swarm/research.md +0 -0
- package/.claude/commands/swarm/swarm.md +0 -0
- package/.claude/commands/swarm/testing.md +0 -0
- package/.claude/commands/tokens.md +0 -0
- package/.claude/commands/truth/start.md +0 -0
- package/.claude/commands/ts.md +0 -0
- package/.claude/commands/workflows/README.md +0 -0
- package/.claude/commands/workflows/development.md +0 -0
- package/.claude/commands/workflows/research.md +0 -0
- package/.claude/commands/workflows/workflow-create.md +0 -0
- package/.claude/commands/workflows/workflow-execute.md +0 -0
- package/.claude/commands/workflows/workflow-export.md +0 -0
- package/.claude/helpers/build-skill-registry.cjs +0 -0
- package/.claude/helpers/control-start.cjs +0 -0
- package/.claude/helpers/control-stop.cjs +0 -0
- package/.claude/helpers/event-logger.cjs +0 -0
- package/.claude/helpers/graphify-freshen.cjs +0 -0
- package/.claude/helpers/handlers/adr-draft-handler.cjs +0 -0
- package/.claude/helpers/handlers/agent-start-handler.cjs +0 -0
- package/.claude/helpers/handlers/budget-status-handler.cjs +0 -0
- package/.claude/helpers/handlers/capture-handler.cjs +0 -0
- package/.claude/helpers/handlers/compact-handler.cjs +0 -0
- package/.claude/helpers/handlers/edit-handler.cjs +0 -0
- package/.claude/helpers/handlers/gates-handler.cjs +0 -0
- package/.claude/helpers/handlers/graph-status-handler.cjs +0 -0
- package/.claude/helpers/handlers/loops-status-handler.cjs +0 -0
- package/.claude/helpers/handlers/route-handler.cjs +81 -36
- package/.claude/helpers/handlers/session-handler.cjs +0 -0
- package/.claude/helpers/handlers/session-restore-handler.cjs +27 -9
- package/.claude/helpers/handlers/stats-handler.cjs +0 -0
- package/.claude/helpers/handlers/task-handler.cjs +0 -0
- package/.claude/helpers/hook-handler.cjs +2 -2
- package/.claude/helpers/intelligence.cjs +0 -0
- package/.claude/helpers/learning-service.mjs +0 -0
- package/.claude/helpers/loop-tracker.cjs +0 -0
- package/.claude/helpers/mastermind-activate.cjs +4 -0
- package/.claude/helpers/memory-palace.cjs +0 -0
- package/.claude/helpers/memory.cjs +0 -0
- package/.claude/helpers/metrics-db.mjs +0 -0
- package/.claude/helpers/monolean-activate.cjs +0 -0
- package/.claude/helpers/monolean-config.cjs +0 -0
- package/.claude/helpers/monolean-instructions.cjs +0 -0
- package/.claude/helpers/monolean-propagate.cjs +0 -0
- package/.claude/helpers/monolean-tracker.cjs +0 -0
- package/.claude/helpers/router.cjs +0 -0
- package/.claude/helpers/session.cjs +0 -0
- package/.claude/helpers/skill-registry.json +0 -0
- package/.claude/helpers/statusline.cjs +0 -0
- package/.claude/helpers/toggle-statusline.cjs +0 -0
- package/.claude/helpers/token-tracker.cjs +0 -0
- package/.claude/helpers/utils/agent-registrations.cjs +0 -0
- package/.claude/helpers/utils/fs-helpers.cjs +0 -0
- package/.claude/helpers/utils/micro-agents.cjs +0 -0
- package/.claude/helpers/utils/monograph.cjs +4 -2
- package/.claude/helpers/utils/system-pressure.cjs +0 -0
- package/.claude/helpers/utils/telemetry.cjs +0 -0
- package/.claude/settings.json +0 -0
- package/.claude/skills/agent-browser-testing/SKILL.md +0 -0
- package/.claude/skills/agentic-jujutsu/SKILL.md +0 -0
- package/.claude/skills/github-issue-triage/SKILL.md +0 -0
- package/.claude/skills/github-repo-recap/SKILL.md +0 -0
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -0
- package/.claude/skills/hooks-automation/SKILL.md +0 -0
- package/.claude/skills/mastermind-access/SKILL.md +0 -0
- package/.claude/skills/mastermind-activity/SKILL.md +0 -0
- package/.claude/skills/mastermind-adapter-manager/SKILL.md +0 -0
- package/.claude/skills/mastermind-adapters/SKILL.md +0 -0
- package/.claude/skills/mastermind-agent-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-agent-select/SKILL.md +0 -0
- package/.claude/skills/mastermind-agents/SKILL.md +0 -0
- package/.claude/skills/mastermind-approval-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-approvev1/SKILL.md +0 -0
- package/.claude/skills/mastermind-architect/SKILL.md +0 -0
- package/.claude/skills/mastermind-autodev/SKILL.md +0 -0
- package/.claude/skills/mastermind-backup/SKILL.md +0 -0
- package/.claude/skills/mastermind-bootstrap/SKILL.md +0 -0
- package/.claude/skills/mastermind-budgets/SKILL.md +0 -0
- package/.claude/skills/mastermind-build/SKILL.md +0 -0
- package/.claude/skills/mastermind-companies/SKILL.md +0 -0
- package/.claude/skills/mastermind-content/SKILL.md +0 -0
- package/.claude/skills/mastermind-costs/SKILL.md +0 -0
- package/.claude/skills/mastermind-createorg/SKILL.md +11 -4
- package/.claude/skills/mastermind-debug/SKILL.md +0 -0
- package/.claude/skills/mastermind-delegation/SKILL.md +0 -0
- package/.claude/skills/mastermind-design/SKILL.md +0 -0
- package/.claude/skills/mastermind-diagnose/SKILL.md +0 -0
- package/.claude/skills/mastermind-env/SKILL.md +0 -0
- package/.claude/skills/mastermind-environments/SKILL.md +0 -0
- package/.claude/skills/mastermind-execute/SKILL.md +0 -0
- package/.claude/skills/mastermind-export/SKILL.md +0 -0
- package/.claude/skills/mastermind-finance/SKILL.md +0 -0
- package/.claude/skills/mastermind-finish/SKILL.md +0 -0
- package/.claude/skills/mastermind-goal-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-goals/SKILL.md +0 -0
- package/.claude/skills/mastermind-heartbeatv1/SKILL.md +0 -0
- package/.claude/skills/mastermind-idea/SKILL.md +0 -0
- package/.claude/skills/mastermind-import/SKILL.md +0 -0
- package/.claude/skills/mastermind-inbox/SKILL.md +0 -0
- package/.claude/skills/mastermind-instance/SKILL.md +0 -0
- package/.claude/skills/mastermind-instance-settings/SKILL.md +0 -0
- package/.claude/skills/mastermind-intake/SKILL.md +0 -0
- package/.claude/skills/mastermind-invite-landing/SKILL.md +0 -0
- package/.claude/skills/mastermind-invites/SKILL.md +0 -0
- package/.claude/skills/mastermind-issue-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-issues/SKILL.md +0 -0
- package/.claude/skills/mastermind-join-queue/SKILL.md +0 -0
- package/.claude/skills/mastermind-liveness/SKILL.md +0 -0
- package/.claude/skills/mastermind-marketing/SKILL.md +0 -0
- package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +0 -0
- package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +0 -0
- package/.claude/skills/mastermind-memory/SKILL.md +0 -0
- package/.claude/skills/mastermind-monitor/SKILL.md +0 -0
- package/.claude/skills/mastermind-monotask/SKILL.md +0 -0
- package/.claude/skills/mastermind-my-issues/SKILL.md +0 -0
- package/.claude/skills/mastermind-new-agent/SKILL.md +0 -0
- package/.claude/skills/mastermind-ops/SKILL.md +0 -0
- package/.claude/skills/mastermind-org-chart/SKILL.md +0 -0
- package/.claude/skills/mastermind-org-settings/SKILL.md +0 -0
- package/.claude/skills/mastermind-orgs/SKILL.md +0 -0
- package/.claude/skills/mastermind-orgstatus/SKILL.md +0 -0
- package/.claude/skills/mastermind-plan/SKILL.md +0 -0
- package/.claude/skills/mastermind-plan-to-tasks/SKILL.md +0 -0
- package/.claude/skills/mastermind-plugin-manager/SKILL.md +0 -0
- package/.claude/skills/mastermind-plugin-settings/SKILL.md +0 -0
- package/.claude/skills/mastermind-plugins/SKILL.md +0 -0
- package/.claude/skills/mastermind-profile/SKILL.md +0 -0
- package/.claude/skills/mastermind-project-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-project-workspace/SKILL.md +0 -0
- package/.claude/skills/mastermind-projects/SKILL.md +0 -0
- package/.claude/skills/mastermind-protocol/SKILL.md +0 -0
- package/.claude/skills/mastermind-receive-review/SKILL.md +0 -0
- package/.claude/skills/mastermind-release/SKILL.md +0 -0
- package/.claude/skills/mastermind-repeat/SKILL.md +0 -0
- package/.claude/skills/mastermind-research/SKILL.md +0 -0
- package/.claude/skills/mastermind-review/SKILL.md +0 -0
- package/.claude/skills/mastermind-routine-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-routines/SKILL.md +0 -0
- package/.claude/skills/mastermind-runorg/SKILL.md +0 -0
- package/.claude/skills/mastermind-runorgv1/SKILL.md +0 -0
- package/.claude/skills/mastermind-sales/SKILL.md +0 -0
- package/.claude/skills/mastermind-search/SKILL.md +0 -0
- package/.claude/skills/mastermind-secrets/SKILL.md +0 -0
- package/.claude/skills/mastermind-skill-builder/SKILL.md +0 -0
- package/.claude/skills/mastermind-skills/SKILL.md +0 -0
- package/.claude/skills/mastermind-stoporg/SKILL.md +0 -0
- package/.claude/skills/mastermind-taskdev/SKILL.md +0 -0
- package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +0 -0
- package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +0 -0
- package/.claude/skills/mastermind-taskdev/implementer-prompt.md +0 -0
- package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +0 -0
- package/.claude/skills/mastermind-tasks/SKILL.md +0 -0
- package/.claude/skills/mastermind-tdd/SKILL.md +0 -0
- package/.claude/skills/mastermind-techport/SKILL.md +0 -0
- package/.claude/skills/mastermind-threads/SKILL.md +0 -0
- package/.claude/skills/mastermind-tree-control/SKILL.md +0 -0
- package/.claude/skills/mastermind-verify/SKILL.md +0 -0
- package/.claude/skills/mastermind-wiki/SKILL.md +0 -0
- package/.claude/skills/mastermind-workspace-detail/SKILL.md +0 -0
- package/.claude/skills/mastermind-workspaces/SKILL.md +0 -0
- package/.claude/skills/mastermind-worktree/SKILL.md +0 -0
- package/.claude/skills/monodesign/SKILL.md +0 -0
- package/.claude/skills/monodesign/adapt.md +0 -0
- package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +0 -0
- package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +0 -0
- package/.claude/skills/monodesign/animate.md +0 -0
- package/.claude/skills/monodesign/audit.md +0 -0
- package/.claude/skills/monodesign/bolder.md +0 -0
- package/.claude/skills/monodesign/clarify.md +0 -0
- package/.claude/skills/monodesign/colorize.md +0 -0
- package/.claude/skills/monodesign/craft.md +0 -0
- package/.claude/skills/monodesign/critique.md +0 -0
- package/.claude/skills/monodesign/delight.md +0 -0
- package/.claude/skills/monodesign/distill.md +0 -0
- package/.claude/skills/monodesign/document.md +0 -0
- package/.claude/skills/monodesign/extract.md +0 -0
- package/.claude/skills/monodesign/harden.md +0 -0
- package/.claude/skills/monodesign/init.md +0 -0
- package/.claude/skills/monodesign/layout.md +0 -0
- package/.claude/skills/monodesign/live.md +0 -0
- package/.claude/skills/monodesign/onboard.md +0 -0
- package/.claude/skills/monodesign/optimize.md +0 -0
- package/.claude/skills/monodesign/overdrive.md +0 -0
- package/.claude/skills/monodesign/polish.md +0 -0
- package/.claude/skills/monodesign/quieter.md +0 -0
- package/.claude/skills/monodesign/reference/adapt.md +0 -0
- package/.claude/skills/monodesign/reference/adapt.native.md +0 -0
- package/.claude/skills/monodesign/reference/android.md +0 -0
- package/.claude/skills/monodesign/reference/animate.md +0 -0
- package/.claude/skills/monodesign/reference/antipatterns-catalog.md +0 -0
- package/.claude/skills/monodesign/reference/audit.md +0 -0
- package/.claude/skills/monodesign/reference/audit.native.md +0 -0
- package/.claude/skills/monodesign/reference/bolder.md +0 -0
- package/.claude/skills/monodesign/reference/brand-workflow.md +0 -0
- package/.claude/skills/monodesign/reference/brand.md +0 -0
- package/.claude/skills/monodesign/reference/clarify.md +0 -0
- package/.claude/skills/monodesign/reference/codex.md +0 -0
- package/.claude/skills/monodesign/reference/cognitive-load.md +0 -0
- package/.claude/skills/monodesign/reference/color-and-contrast.md +0 -0
- package/.claude/skills/monodesign/reference/colorize.md +0 -0
- package/.claude/skills/monodesign/reference/component-specs.md +0 -0
- package/.claude/skills/monodesign/reference/component-states.md +0 -0
- package/.claude/skills/monodesign/reference/component-system.md +0 -0
- package/.claude/skills/monodesign/reference/copy-formulas.md +0 -0
- package/.claude/skills/monodesign/reference/craft.md +0 -0
- package/.claude/skills/monodesign/reference/critique.md +0 -0
- package/.claude/skills/monodesign/reference/delight.md +0 -0
- package/.claude/skills/monodesign/reference/design-principles.md +0 -0
- package/.claude/skills/monodesign/reference/distill.md +0 -0
- package/.claude/skills/monodesign/reference/document.md +0 -0
- package/.claude/skills/monodesign/reference/extract.md +0 -0
- package/.claude/skills/monodesign/reference/harden.md +0 -0
- package/.claude/skills/monodesign/reference/heuristics-scoring.md +0 -0
- package/.claude/skills/monodesign/reference/hooks.md +0 -0
- package/.claude/skills/monodesign/reference/image-prompts.md +0 -0
- package/.claude/skills/monodesign/reference/init.md +0 -0
- package/.claude/skills/monodesign/reference/interaction-design.md +0 -0
- package/.claude/skills/monodesign/reference/ios.md +0 -0
- package/.claude/skills/monodesign/reference/layout.md +0 -0
- package/.claude/skills/monodesign/reference/live.md +0 -0
- package/.claude/skills/monodesign/reference/motion-design.md +0 -0
- package/.claude/skills/monodesign/reference/onboard.md +0 -0
- package/.claude/skills/monodesign/reference/optimize.md +0 -0
- package/.claude/skills/monodesign/reference/overdrive.md +0 -0
- package/.claude/skills/monodesign/reference/personas.md +0 -0
- package/.claude/skills/monodesign/reference/polish.md +0 -0
- package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +0 -0
- package/.claude/skills/monodesign/reference/product.md +0 -0
- package/.claude/skills/monodesign/reference/quieter.md +0 -0
- package/.claude/skills/monodesign/reference/responsive-design.md +0 -0
- package/.claude/skills/monodesign/reference/shape.md +0 -0
- package/.claude/skills/monodesign/reference/spatial-design.md +0 -0
- package/.claude/skills/monodesign/reference/teach.md +0 -0
- package/.claude/skills/monodesign/reference/token-architecture.md +0 -0
- package/.claude/skills/monodesign/reference/typeset.md +0 -0
- package/.claude/skills/monodesign/reference/typography.md +0 -0
- package/.claude/skills/monodesign/reference/ux-research.md +0 -0
- package/.claude/skills/monodesign/reference/ux-rules.md +0 -0
- package/.claude/skills/monodesign/reference/ux-writing.md +0 -0
- package/.claude/skills/monodesign/scripts/command-metadata.json +0 -0
- package/.claude/skills/monodesign/scripts/context-signals.mjs +0 -0
- package/.claude/skills/monodesign/scripts/context.mjs +0 -0
- package/.claude/skills/monodesign/scripts/critique-storage.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detect-csp.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detect.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/design-system.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +0 -0
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/findings.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +0 -0
- package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +0 -0
- package/.claude/skills/monodesign/scripts/hook-admin.mjs +0 -0
- package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +0 -0
- package/.claude/skills/monodesign/scripts/hook-lib.mjs +0 -0
- package/.claude/skills/monodesign/scripts/hook.mjs +0 -0
- package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +0 -0
- package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +0 -0
- package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +0 -0
- package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +0 -0
- package/.claude/skills/monodesign/scripts/lib/provider.mjs +0 -0
- package/.claude/skills/monodesign/scripts/lib/target-args.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/completion.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/event-validation.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/session-store.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/ui-core.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-accept.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-browser-dom.js +0 -0
- package/.claude/skills/monodesign/scripts/live-browser-session.js +0 -0
- package/.claude/skills/monodesign/scripts/live-browser.js +0 -0
- package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-complete.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-inject.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-insert.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-poll.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-resume.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-server.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-status.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-target.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live-wrap.mjs +0 -0
- package/.claude/skills/monodesign/scripts/live.mjs +0 -0
- package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +0 -0
- package/.claude/skills/monodesign/scripts/palette.mjs +0 -0
- package/.claude/skills/monodesign/scripts/pin.mjs +0 -0
- package/.claude/skills/monodesign/shape.md +0 -0
- package/.claude/skills/monodesign/teach.md +0 -0
- package/.claude/skills/monodesign/typeset.md +0 -0
- package/.claude/skills/monolean/SKILL.md +0 -0
- package/.claude/skills/monolean-audit/SKILL.md +0 -0
- package/.claude/skills/monolean-debt/SKILL.md +0 -0
- package/.claude/skills/monolean-help/SKILL.md +0 -0
- package/.claude/skills/monolean-review/SKILL.md +0 -0
- package/.claude/skills/monomind/browse-agentcore.md +0 -0
- package/.claude/skills/monomind/browse-electron.md +0 -0
- package/.claude/skills/monomind/browse-qa.md +0 -0
- package/.claude/skills/monomind/browse-references/authentication.md +0 -0
- package/.claude/skills/monomind/browse-references/trust-boundaries.md +0 -0
- package/.claude/skills/monomind/browse-references/video-recording.md +0 -0
- package/.claude/skills/monomind/browse-slack.md +0 -0
- package/.claude/skills/monomind/browse-vercel.md +0 -0
- package/.claude/skills/monomind/browse.md +0 -0
- package/.claude/skills/monomotion/SKILL.md +0 -0
- package/.claude/skills/monomotion/rules/api-control.md +0 -0
- package/.claude/skills/monomotion/rules/effects.md +0 -0
- package/.claude/skills/monomotion/rules/integration.md +0 -0
- package/.claude/skills/monomotion/rules/scroll.md +0 -0
- package/.claude/skills/monomotion/rules/sequencing.md +0 -0
- package/.claude/skills/monomotion/rules/svg.md +0 -0
- package/.claude/skills/monomotion/rules/text.md +0 -0
- package/.claude/skills/pair-programming/SKILL.md +0 -0
- package/.claude/skills/performance-analysis/SKILL.md +0 -0
- package/.claude/skills/skill-builder/SKILL.md +0 -0
- package/.claude/skills/specialagent/SKILL.md +0 -0
- package/.claude/skills/stop-slop/SKILL.md +0 -0
- package/.claude/skills/stop-slop/references/examples.md +0 -0
- package/.claude/skills/stop-slop/references/phrases.md +0 -0
- package/.claude/skills/stop-slop/references/structures.md +0 -0
- package/.claude/skills/swarm-advanced/SKILL.md +0 -0
- package/.claude/skills/swarm-orchestration/SKILL.md +0 -0
- package/.claude/skills/verification-quality/SKILL.md +0 -0
- package/README.md +12 -6
- package/bin/preinstall.cjs +0 -0
- package/dist/src/agents/registry-builder.d.ts +0 -0
- package/dist/src/agents/registry-builder.d.ts.map +0 -0
- package/dist/src/agents/registry-builder.js +0 -0
- package/dist/src/agents/registry-builder.js.map +0 -0
- package/dist/src/autopilot-state.d.ts +0 -0
- package/dist/src/autopilot-state.d.ts.map +0 -0
- package/dist/src/autopilot-state.js +0 -0
- package/dist/src/autopilot-state.js.map +0 -0
- package/dist/src/browser/action-builder/analyzer.d.ts +0 -0
- package/dist/src/browser/action-builder/analyzer.d.ts.map +0 -0
- package/dist/src/browser/action-builder/analyzer.js +0 -0
- package/dist/src/browser/action-builder/analyzer.js.map +0 -0
- package/dist/src/browser/action-builder/types.d.ts +0 -0
- package/dist/src/browser/action-builder/types.d.ts.map +0 -0
- package/dist/src/browser/action-builder/types.js +0 -0
- package/dist/src/browser/action-builder/types.js.map +0 -0
- package/dist/src/browser/adapters/gemini.d.ts +0 -0
- package/dist/src/browser/adapters/gemini.d.ts.map +0 -0
- package/dist/src/browser/adapters/gemini.js +0 -0
- package/dist/src/browser/adapters/gemini.js.map +0 -0
- package/dist/src/browser/adapters/index.d.ts +0 -0
- package/dist/src/browser/adapters/index.d.ts.map +0 -0
- package/dist/src/browser/adapters/index.js +0 -0
- package/dist/src/browser/adapters/index.js.map +0 -0
- package/dist/src/browser/adapters/instagram.d.ts +0 -0
- package/dist/src/browser/adapters/instagram.d.ts.map +0 -0
- package/dist/src/browser/adapters/instagram.js +0 -0
- package/dist/src/browser/adapters/instagram.js.map +0 -0
- package/dist/src/browser/adapters/linkedin.d.ts +0 -0
- package/dist/src/browser/adapters/linkedin.d.ts.map +0 -0
- package/dist/src/browser/adapters/linkedin.js +0 -0
- package/dist/src/browser/adapters/linkedin.js.map +0 -0
- package/dist/src/browser/adapters/x.d.ts +0 -0
- package/dist/src/browser/adapters/x.d.ts.map +0 -0
- package/dist/src/browser/adapters/x.js +0 -0
- package/dist/src/browser/adapters/x.js.map +0 -0
- package/dist/src/browser/dashboard/server.d.ts +0 -0
- package/dist/src/browser/dashboard/server.d.ts.map +0 -0
- package/dist/src/browser/dashboard/server.js +0 -0
- package/dist/src/browser/dashboard/server.js.map +0 -0
- package/dist/src/browser/dashboard/ui.html +0 -0
- package/dist/src/browser/workflow/engine.d.ts +0 -0
- package/dist/src/browser/workflow/engine.d.ts.map +0 -0
- package/dist/src/browser/workflow/engine.js +0 -0
- package/dist/src/browser/workflow/engine.js.map +0 -0
- package/dist/src/browser/workflow/expression.d.ts +0 -0
- package/dist/src/browser/workflow/expression.d.ts.map +0 -0
- package/dist/src/browser/workflow/expression.js +0 -0
- package/dist/src/browser/workflow/expression.js.map +0 -0
- package/dist/src/browser/workflow/store.d.ts +0 -0
- package/dist/src/browser/workflow/store.d.ts.map +0 -0
- package/dist/src/browser/workflow/store.js +0 -0
- package/dist/src/browser/workflow/store.js.map +0 -0
- package/dist/src/browser/workflow/types.d.ts +0 -0
- package/dist/src/browser/workflow/types.d.ts.map +0 -0
- package/dist/src/browser/workflow/types.js +0 -0
- package/dist/src/browser/workflow/types.js.map +0 -0
- package/dist/src/capabilities/cap-code.d.ts +0 -0
- package/dist/src/capabilities/cap-code.d.ts.map +0 -0
- package/dist/src/capabilities/cap-code.js +0 -0
- package/dist/src/capabilities/cap-code.js.map +0 -0
- package/dist/src/capabilities/cap-data.d.ts +0 -0
- package/dist/src/capabilities/cap-data.d.ts.map +0 -0
- package/dist/src/capabilities/cap-data.js +0 -0
- package/dist/src/capabilities/cap-data.js.map +0 -0
- package/dist/src/capabilities/cap-documents.d.ts +0 -0
- package/dist/src/capabilities/cap-documents.d.ts.map +0 -0
- package/dist/src/capabilities/cap-documents.js +0 -0
- package/dist/src/capabilities/cap-documents.js.map +0 -0
- package/dist/src/capabilities/cap-graph.d.ts +0 -0
- package/dist/src/capabilities/cap-graph.d.ts.map +0 -0
- package/dist/src/capabilities/cap-graph.js +0 -0
- package/dist/src/capabilities/cap-graph.js.map +0 -0
- package/dist/src/capabilities/cap-media.d.ts +0 -0
- package/dist/src/capabilities/cap-media.d.ts.map +0 -0
- package/dist/src/capabilities/cap-media.js +0 -0
- package/dist/src/capabilities/cap-media.js.map +0 -0
- package/dist/src/capabilities/cap-timeline.d.ts +0 -0
- package/dist/src/capabilities/cap-timeline.d.ts.map +0 -0
- package/dist/src/capabilities/cap-timeline.js +0 -0
- package/dist/src/capabilities/cap-timeline.js.map +0 -0
- package/dist/src/capabilities/index.d.ts +0 -0
- package/dist/src/capabilities/index.d.ts.map +1 -1
- package/dist/src/capabilities/index.js +17 -0
- package/dist/src/capabilities/index.js.map +1 -1
- package/dist/src/capabilities/manager.d.ts +0 -0
- package/dist/src/capabilities/manager.d.ts.map +0 -0
- package/dist/src/capabilities/manager.js +0 -0
- package/dist/src/capabilities/manager.js.map +0 -0
- package/dist/src/capabilities/scanner.d.ts +0 -0
- package/dist/src/capabilities/scanner.d.ts.map +0 -0
- package/dist/src/capabilities/scanner.js +0 -0
- package/dist/src/capabilities/scanner.js.map +0 -0
- package/dist/src/capabilities/types.d.ts +0 -11
- package/dist/src/capabilities/types.d.ts.map +1 -1
- package/dist/src/capabilities/types.js +0 -0
- package/dist/src/capabilities/types.js.map +0 -0
- package/dist/src/commands/agent-lifecycle.d.ts +0 -0
- package/dist/src/commands/agent-lifecycle.d.ts.map +0 -0
- package/dist/src/commands/agent-lifecycle.js +0 -0
- package/dist/src/commands/agent-lifecycle.js.map +0 -0
- package/dist/src/commands/agent-ops.d.ts +0 -0
- package/dist/src/commands/agent-ops.d.ts.map +0 -0
- package/dist/src/commands/agent-ops.js +0 -0
- package/dist/src/commands/agent-ops.js.map +0 -0
- package/dist/src/commands/agent.d.ts +0 -0
- package/dist/src/commands/agent.d.ts.map +0 -0
- package/dist/src/commands/agent.js +0 -0
- package/dist/src/commands/agent.js.map +0 -0
- package/dist/src/commands/analyze-ast.d.ts +0 -0
- package/dist/src/commands/analyze-ast.d.ts.map +0 -0
- package/dist/src/commands/analyze-ast.js +0 -0
- package/dist/src/commands/analyze-ast.js.map +0 -0
- package/dist/src/commands/analyze-diff.d.ts +0 -0
- package/dist/src/commands/analyze-diff.d.ts.map +0 -0
- package/dist/src/commands/analyze-diff.js +0 -0
- package/dist/src/commands/analyze-diff.js.map +0 -0
- package/dist/src/commands/analyze-imports.d.ts +0 -0
- package/dist/src/commands/analyze-imports.d.ts.map +0 -0
- package/dist/src/commands/analyze-imports.js +0 -0
- package/dist/src/commands/analyze-imports.js.map +0 -0
- package/dist/src/commands/analyze-symbols.d.ts +0 -0
- package/dist/src/commands/analyze-symbols.d.ts.map +0 -0
- package/dist/src/commands/analyze-symbols.js +0 -0
- package/dist/src/commands/analyze-symbols.js.map +0 -0
- package/dist/src/commands/analyze.d.ts +0 -0
- package/dist/src/commands/analyze.d.ts.map +0 -0
- package/dist/src/commands/analyze.js +0 -0
- package/dist/src/commands/analyze.js.map +0 -0
- package/dist/src/commands/autopilot.d.ts +0 -0
- package/dist/src/commands/autopilot.d.ts.map +0 -0
- package/dist/src/commands/autopilot.js +0 -0
- package/dist/src/commands/autopilot.js.map +0 -0
- package/dist/src/commands/browse-action.d.ts +0 -0
- package/dist/src/commands/browse-action.d.ts.map +0 -0
- package/dist/src/commands/browse-action.js +0 -0
- package/dist/src/commands/browse-action.js.map +0 -0
- package/dist/src/commands/browse-platform.d.ts +0 -0
- package/dist/src/commands/browse-platform.d.ts.map +0 -0
- package/dist/src/commands/browse-platform.js +0 -0
- package/dist/src/commands/browse-platform.js.map +0 -0
- package/dist/src/commands/browse-workflow.d.ts +0 -0
- package/dist/src/commands/browse-workflow.d.ts.map +0 -0
- package/dist/src/commands/browse-workflow.js +0 -0
- package/dist/src/commands/browse-workflow.js.map +0 -0
- package/dist/src/commands/browse.d.ts +0 -0
- package/dist/src/commands/browse.d.ts.map +0 -0
- package/dist/src/commands/browse.js +0 -0
- package/dist/src/commands/browse.js.map +0 -0
- package/dist/src/commands/cleanup.d.ts +0 -0
- package/dist/src/commands/cleanup.d.ts.map +0 -0
- package/dist/src/commands/cleanup.js +0 -0
- package/dist/src/commands/cleanup.js.map +0 -0
- package/dist/src/commands/completions.d.ts +0 -0
- package/dist/src/commands/completions.d.ts.map +0 -0
- package/dist/src/commands/completions.js +0 -0
- package/dist/src/commands/completions.js.map +0 -0
- package/dist/src/commands/config.d.ts +0 -0
- package/dist/src/commands/config.d.ts.map +0 -0
- package/dist/src/commands/config.js +0 -0
- package/dist/src/commands/config.js.map +0 -0
- package/dist/src/commands/crash-reporting.d.ts +0 -0
- package/dist/src/commands/crash-reporting.d.ts.map +0 -0
- package/dist/src/commands/crash-reporting.js +0 -0
- package/dist/src/commands/crash-reporting.js.map +0 -0
- package/dist/src/commands/design-detect.d.ts +0 -0
- package/dist/src/commands/design-detect.d.ts.map +0 -0
- package/dist/src/commands/design-detect.js +0 -0
- package/dist/src/commands/design-detect.js.map +0 -0
- package/dist/src/commands/design-palette.d.ts +0 -0
- package/dist/src/commands/design-palette.d.ts.map +0 -0
- package/dist/src/commands/design-palette.js +0 -0
- package/dist/src/commands/design-palette.js.map +0 -0
- package/dist/src/commands/doc.d.ts +0 -0
- package/dist/src/commands/doc.d.ts.map +1 -1
- package/dist/src/commands/doc.js +251 -8
- package/dist/src/commands/doc.js.map +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts +0 -0
- package/dist/src/commands/doctor-env-checks.d.ts.map +0 -0
- package/dist/src/commands/doctor-env-checks.js +0 -0
- package/dist/src/commands/doctor-env-checks.js.map +0 -0
- package/dist/src/commands/doctor-monoes-checks.d.ts +0 -0
- package/dist/src/commands/doctor-monoes-checks.d.ts.map +0 -0
- package/dist/src/commands/doctor-monoes-checks.js +0 -0
- package/dist/src/commands/doctor-monoes-checks.js.map +0 -0
- package/dist/src/commands/doctor-project-checks.d.ts +25 -3
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +111 -8
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts +0 -0
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +18 -2
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/guidance.d.ts +0 -0
- package/dist/src/commands/guidance.d.ts.map +0 -0
- package/dist/src/commands/guidance.js +0 -0
- package/dist/src/commands/guidance.js.map +0 -0
- package/dist/src/commands/hooks-core-commands.d.ts +0 -0
- package/dist/src/commands/hooks-core-commands.d.ts.map +0 -0
- package/dist/src/commands/hooks-core-commands.js +0 -0
- package/dist/src/commands/hooks-core-commands.js.map +0 -0
- package/dist/src/commands/hooks-coverage-commands.d.ts +0 -0
- package/dist/src/commands/hooks-coverage-commands.d.ts.map +0 -0
- package/dist/src/commands/hooks-coverage-commands.js +0 -0
- package/dist/src/commands/hooks-coverage-commands.js.map +0 -0
- package/dist/src/commands/hooks-coverage-gaps.d.ts +0 -0
- package/dist/src/commands/hooks-coverage-gaps.d.ts.map +0 -0
- package/dist/src/commands/hooks-coverage-gaps.js +0 -0
- package/dist/src/commands/hooks-coverage-gaps.js.map +0 -0
- package/dist/src/commands/hooks-coverage-routing.d.ts +0 -0
- package/dist/src/commands/hooks-coverage-routing.d.ts.map +0 -0
- package/dist/src/commands/hooks-coverage-routing.js +0 -0
- package/dist/src/commands/hooks-coverage-routing.js.map +0 -0
- package/dist/src/commands/hooks-coverage-utils.d.ts +0 -0
- package/dist/src/commands/hooks-coverage-utils.d.ts.map +0 -0
- package/dist/src/commands/hooks-coverage-utils.js +0 -0
- package/dist/src/commands/hooks-coverage-utils.js.map +0 -0
- package/dist/src/commands/hooks-extended-commands.d.ts +0 -0
- package/dist/src/commands/hooks-extended-commands.d.ts.map +0 -0
- package/dist/src/commands/hooks-extended-commands.js +0 -0
- package/dist/src/commands/hooks-extended-commands.js.map +0 -0
- package/dist/src/commands/hooks-formatting.d.ts +0 -0
- package/dist/src/commands/hooks-formatting.d.ts.map +0 -0
- package/dist/src/commands/hooks-formatting.js +0 -0
- package/dist/src/commands/hooks-formatting.js.map +0 -0
- package/dist/src/commands/hooks-routing-commands.d.ts +0 -0
- package/dist/src/commands/hooks-routing-commands.d.ts.map +0 -0
- package/dist/src/commands/hooks-routing-commands.js +0 -0
- package/dist/src/commands/hooks-routing-commands.js.map +0 -0
- package/dist/src/commands/hooks-workers.d.ts +0 -0
- package/dist/src/commands/hooks-workers.d.ts.map +0 -0
- package/dist/src/commands/hooks-workers.js +0 -0
- package/dist/src/commands/hooks-workers.js.map +0 -0
- package/dist/src/commands/hooks.d.ts +0 -0
- package/dist/src/commands/hooks.d.ts.map +0 -0
- package/dist/src/commands/hooks.js +0 -0
- package/dist/src/commands/hooks.js.map +0 -0
- package/dist/src/commands/index.d.ts +0 -0
- package/dist/src/commands/index.d.ts.map +0 -0
- package/dist/src/commands/index.js +0 -0
- package/dist/src/commands/index.js.map +0 -0
- package/dist/src/commands/init-subcommands.d.ts +0 -0
- package/dist/src/commands/init-subcommands.d.ts.map +0 -0
- package/dist/src/commands/init-subcommands.js +0 -0
- package/dist/src/commands/init-subcommands.js.map +0 -0
- package/dist/src/commands/init-upgrade.d.ts +0 -0
- package/dist/src/commands/init-upgrade.d.ts.map +0 -0
- package/dist/src/commands/init-upgrade.js +0 -0
- package/dist/src/commands/init-upgrade.js.map +0 -0
- package/dist/src/commands/init-wizard.d.ts +0 -0
- package/dist/src/commands/init-wizard.d.ts.map +0 -0
- package/dist/src/commands/init-wizard.js +0 -0
- package/dist/src/commands/init-wizard.js.map +0 -0
- package/dist/src/commands/init.d.ts +0 -0
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +32 -3
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts +0 -0
- package/dist/src/commands/mcp.d.ts.map +0 -0
- package/dist/src/commands/mcp.js +0 -0
- package/dist/src/commands/mcp.js.map +0 -0
- package/dist/src/commands/memory-admin.d.ts +0 -0
- package/dist/src/commands/memory-admin.d.ts.map +0 -0
- package/dist/src/commands/memory-admin.js +0 -0
- package/dist/src/commands/memory-admin.js.map +0 -0
- package/dist/src/commands/memory-crud.d.ts +0 -0
- package/dist/src/commands/memory-crud.d.ts.map +0 -0
- package/dist/src/commands/memory-crud.js +0 -0
- package/dist/src/commands/memory-crud.js.map +0 -0
- package/dist/src/commands/memory-list.d.ts +0 -0
- package/dist/src/commands/memory-list.d.ts.map +0 -0
- package/dist/src/commands/memory-list.js +0 -0
- package/dist/src/commands/memory-list.js.map +0 -0
- package/dist/src/commands/memory-transfer.d.ts +0 -0
- package/dist/src/commands/memory-transfer.d.ts.map +0 -0
- package/dist/src/commands/memory-transfer.js +0 -0
- package/dist/src/commands/memory-transfer.js.map +0 -0
- package/dist/src/commands/memory.d.ts +0 -0
- package/dist/src/commands/memory.d.ts.map +0 -0
- package/dist/src/commands/memory.js +0 -0
- package/dist/src/commands/memory.js.map +0 -0
- package/dist/src/commands/monograph.d.ts +0 -0
- package/dist/src/commands/monograph.d.ts.map +1 -1
- package/dist/src/commands/monograph.js +26 -3
- package/dist/src/commands/monograph.js.map +1 -1
- package/dist/src/commands/neural-core.d.ts +0 -0
- package/dist/src/commands/neural-core.d.ts.map +0 -0
- package/dist/src/commands/neural-core.js +0 -0
- package/dist/src/commands/neural-core.js.map +0 -0
- package/dist/src/commands/neural-optimize.d.ts +0 -0
- package/dist/src/commands/neural-optimize.d.ts.map +0 -0
- package/dist/src/commands/neural-optimize.js +0 -0
- package/dist/src/commands/neural-optimize.js.map +0 -0
- package/dist/src/commands/neural-registry.d.ts +0 -0
- package/dist/src/commands/neural-registry.d.ts.map +0 -0
- package/dist/src/commands/neural-registry.js +0 -0
- package/dist/src/commands/neural-registry.js.map +0 -0
- package/dist/src/commands/org-observe.d.ts +0 -0
- package/dist/src/commands/org-observe.d.ts.map +0 -0
- package/dist/src/commands/org-observe.js +0 -0
- package/dist/src/commands/org-observe.js.map +0 -0
- package/dist/src/commands/org.d.ts +17 -0
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +343 -6
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/performance.d.ts +0 -0
- package/dist/src/commands/performance.d.ts.map +0 -0
- package/dist/src/commands/performance.js +0 -0
- package/dist/src/commands/performance.js.map +0 -0
- package/dist/src/commands/platforms.d.ts +0 -0
- package/dist/src/commands/platforms.d.ts.map +0 -0
- package/dist/src/commands/platforms.js +0 -0
- package/dist/src/commands/platforms.js.map +0 -0
- package/dist/src/commands/providers.d.ts +0 -0
- package/dist/src/commands/providers.d.ts.map +0 -0
- package/dist/src/commands/providers.js +0 -0
- package/dist/src/commands/providers.js.map +0 -0
- package/dist/src/commands/report-crash.d.ts +0 -0
- package/dist/src/commands/report-crash.d.ts.map +0 -0
- package/dist/src/commands/report-crash.js +0 -0
- package/dist/src/commands/report-crash.js.map +0 -0
- package/dist/src/commands/route.d.ts +0 -0
- package/dist/src/commands/route.d.ts.map +0 -0
- package/dist/src/commands/route.js +0 -0
- package/dist/src/commands/route.js.map +0 -0
- package/dist/src/commands/search-universal.d.ts +0 -0
- package/dist/src/commands/search-universal.d.ts.map +0 -0
- package/dist/src/commands/search-universal.js +0 -0
- package/dist/src/commands/search-universal.js.map +0 -0
- package/dist/src/commands/security-cve.d.ts +0 -0
- package/dist/src/commands/security-cve.d.ts.map +0 -0
- package/dist/src/commands/security-cve.js +0 -0
- package/dist/src/commands/security-cve.js.map +0 -0
- package/dist/src/commands/security-misc.d.ts +0 -0
- package/dist/src/commands/security-misc.d.ts.map +0 -0
- package/dist/src/commands/security-misc.js +0 -0
- package/dist/src/commands/security-misc.js.map +0 -0
- package/dist/src/commands/security-scan.d.ts +0 -0
- package/dist/src/commands/security-scan.d.ts.map +0 -0
- package/dist/src/commands/security-scan.js +0 -0
- package/dist/src/commands/security-scan.js.map +0 -0
- package/dist/src/commands/security.d.ts +0 -0
- package/dist/src/commands/security.d.ts.map +0 -0
- package/dist/src/commands/security.js +0 -0
- package/dist/src/commands/security.js.map +0 -0
- package/dist/src/commands/session.d.ts +0 -0
- package/dist/src/commands/session.d.ts.map +0 -0
- package/dist/src/commands/session.js +0 -0
- package/dist/src/commands/session.js.map +0 -0
- package/dist/src/commands/start.d.ts +0 -0
- package/dist/src/commands/start.d.ts.map +0 -0
- package/dist/src/commands/start.js +0 -0
- package/dist/src/commands/start.js.map +0 -0
- package/dist/src/commands/status.d.ts +0 -0
- package/dist/src/commands/status.d.ts.map +0 -0
- package/dist/src/commands/status.js +0 -0
- package/dist/src/commands/status.js.map +0 -0
- package/dist/src/commands/swarm.d.ts +0 -0
- package/dist/src/commands/swarm.d.ts.map +0 -0
- package/dist/src/commands/swarm.js +0 -0
- package/dist/src/commands/swarm.js.map +0 -0
- package/dist/src/commands/task.d.ts +0 -0
- package/dist/src/commands/task.d.ts.map +0 -0
- package/dist/src/commands/task.js +0 -0
- package/dist/src/commands/task.js.map +0 -0
- package/dist/src/commands/tokens.d.ts +0 -0
- package/dist/src/commands/tokens.d.ts.map +0 -0
- package/dist/src/commands/tokens.js +0 -0
- package/dist/src/commands/tokens.js.map +0 -0
- package/dist/src/commands/update.d.ts +0 -0
- package/dist/src/commands/update.d.ts.map +0 -0
- package/dist/src/commands/update.js +0 -0
- package/dist/src/commands/update.js.map +0 -0
- package/dist/src/consensus/audit-writer.d.ts +0 -0
- package/dist/src/consensus/audit-writer.d.ts.map +0 -0
- package/dist/src/consensus/audit-writer.js +0 -0
- package/dist/src/consensus/audit-writer.js.map +0 -0
- package/dist/src/consensus/tally.d.ts +0 -0
- package/dist/src/consensus/tally.d.ts.map +0 -0
- package/dist/src/consensus/tally.js +0 -0
- package/dist/src/consensus/tally.js.map +0 -0
- package/dist/src/index.d.ts +0 -0
- package/dist/src/index.d.ts.map +0 -0
- package/dist/src/index.js +0 -0
- package/dist/src/index.js.map +0 -0
- package/dist/src/init/claudemd-generator.d.ts +0 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +4 -1
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts +0 -0
- package/dist/src/init/executor.d.ts.map +0 -0
- package/dist/src/init/executor.js +0 -0
- package/dist/src/init/executor.js.map +0 -0
- package/dist/src/init/helpers-generator.d.ts +0 -0
- package/dist/src/init/helpers-generator.d.ts.map +0 -0
- package/dist/src/init/helpers-generator.js +0 -0
- package/dist/src/init/helpers-generator.js.map +0 -0
- package/dist/src/init/index.d.ts +0 -0
- package/dist/src/init/index.d.ts.map +0 -0
- package/dist/src/init/index.js +0 -0
- package/dist/src/init/index.js.map +0 -0
- package/dist/src/init/mcp-generator.d.ts +0 -0
- package/dist/src/init/mcp-generator.d.ts.map +0 -0
- package/dist/src/init/mcp-generator.js +0 -0
- package/dist/src/init/mcp-generator.js.map +0 -0
- package/dist/src/init/settings-generator.d.ts +0 -0
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +23 -9
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/shared-instructions-generator.d.ts +0 -0
- package/dist/src/init/shared-instructions-generator.d.ts.map +0 -0
- package/dist/src/init/shared-instructions-generator.js +0 -0
- package/dist/src/init/shared-instructions-generator.js.map +0 -0
- package/dist/src/init/statusline-generator.d.ts +0 -0
- package/dist/src/init/statusline-generator.d.ts.map +0 -0
- package/dist/src/init/statusline-generator.js +0 -0
- package/dist/src/init/statusline-generator.js.map +0 -0
- package/dist/src/init/types.d.ts +0 -0
- package/dist/src/init/types.d.ts.map +0 -0
- package/dist/src/init/types.js +0 -0
- package/dist/src/init/types.js.map +0 -0
- package/dist/src/knowledge/document-pipeline.d.ts +77 -4
- package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
- package/dist/src/knowledge/document-pipeline.js +261 -15
- package/dist/src/knowledge/document-pipeline.js.map +1 -1
- package/dist/src/knowledge/eval/corpus.d.ts +56 -0
- package/dist/src/knowledge/eval/corpus.d.ts.map +1 -0
- package/dist/src/knowledge/eval/corpus.js +126 -0
- package/dist/src/knowledge/eval/corpus.js.map +1 -0
- package/dist/src/knowledge/eval/golden-set.d.ts +62 -0
- package/dist/src/knowledge/eval/golden-set.d.ts.map +1 -0
- package/dist/src/knowledge/eval/golden-set.js +331 -0
- package/dist/src/knowledge/eval/golden-set.js.map +1 -0
- package/dist/src/knowledge/eval/harness.d.ts +221 -0
- package/dist/src/knowledge/eval/harness.d.ts.map +1 -0
- package/dist/src/knowledge/eval/harness.js +610 -0
- package/dist/src/knowledge/eval/harness.js.map +1 -0
- package/dist/src/knowledge/eval/metrics.d.ts +120 -0
- package/dist/src/knowledge/eval/metrics.d.ts.map +1 -0
- package/dist/src/knowledge/eval/metrics.js +243 -0
- package/dist/src/knowledge/eval/metrics.js.map +1 -0
- package/dist/src/knowledge/eval/model-presence.d.ts +48 -0
- package/dist/src/knowledge/eval/model-presence.d.ts.map +1 -0
- package/dist/src/knowledge/eval/model-presence.js +128 -0
- package/dist/src/knowledge/eval/model-presence.js.map +1 -0
- package/dist/src/knowledge/eval/network-guard.d.ts +46 -0
- package/dist/src/knowledge/eval/network-guard.d.ts.map +1 -0
- package/dist/src/knowledge/eval/network-guard.js +112 -0
- package/dist/src/knowledge/eval/network-guard.js.map +1 -0
- package/dist/src/knowledge/eval/retrievers.d.ts +65 -0
- package/dist/src/knowledge/eval/retrievers.d.ts.map +1 -0
- package/dist/src/knowledge/eval/retrievers.js +180 -0
- package/dist/src/knowledge/eval/retrievers.js.map +1 -0
- package/dist/src/knowledge/eval/signals.d.ts +111 -0
- package/dist/src/knowledge/eval/signals.d.ts.map +1 -0
- package/dist/src/knowledge/eval/signals.js +232 -0
- package/dist/src/knowledge/eval/signals.js.map +1 -0
- package/dist/src/mcp-client.d.ts +10 -0
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +86 -4
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts +0 -0
- package/dist/src/mcp-server.d.ts.map +0 -0
- package/dist/src/mcp-server.js +0 -0
- package/dist/src/mcp-server.js.map +0 -0
- package/dist/src/mcp-tools/agent-tools.d.ts +0 -0
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +7 -34
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.d.ts +0 -0
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/analyze-tools.js +0 -0
- package/dist/src/mcp-tools/analyze-tools.js.map +0 -0
- package/dist/src/mcp-tools/auto-install.d.ts +0 -0
- package/dist/src/mcp-tools/auto-install.d.ts.map +0 -0
- package/dist/src/mcp-tools/auto-install.js +0 -0
- package/dist/src/mcp-tools/auto-install.js.map +0 -0
- package/dist/src/mcp-tools/autopilot-tools.d.ts +0 -0
- package/dist/src/mcp-tools/autopilot-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/autopilot-tools.js +0 -0
- package/dist/src/mcp-tools/autopilot-tools.js.map +0 -0
- package/dist/src/mcp-tools/browser-tools.d.ts +0 -0
- package/dist/src/mcp-tools/browser-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/browser-tools.js +0 -0
- package/dist/src/mcp-tools/browser-tools.js.map +0 -0
- package/dist/src/mcp-tools/claims-tools.d.ts +0 -0
- package/dist/src/mcp-tools/claims-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/claims-tools.js +0 -0
- package/dist/src/mcp-tools/claims-tools.js.map +0 -0
- package/dist/src/mcp-tools/config-tools.d.ts +0 -0
- package/dist/src/mcp-tools/config-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/config-tools.js +0 -0
- package/dist/src/mcp-tools/config-tools.js.map +0 -0
- package/dist/src/mcp-tools/embeddings-tools.d.ts +0 -0
- package/dist/src/mcp-tools/embeddings-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/embeddings-tools.js +0 -0
- package/dist/src/mcp-tools/embeddings-tools.js.map +0 -0
- package/dist/src/mcp-tools/github-tools.d.ts +0 -0
- package/dist/src/mcp-tools/github-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/github-tools.js +0 -0
- package/dist/src/mcp-tools/github-tools.js.map +0 -0
- package/dist/src/mcp-tools/graphify-tools.d.ts +0 -0
- package/dist/src/mcp-tools/graphify-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/graphify-tools.js +0 -0
- package/dist/src/mcp-tools/graphify-tools.js.map +0 -0
- package/dist/src/mcp-tools/guidance-tools.d.ts +0 -0
- package/dist/src/mcp-tools/guidance-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/guidance-tools.js +0 -0
- package/dist/src/mcp-tools/guidance-tools.js.map +0 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +0 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +0 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +0 -0
- package/dist/src/mcp-tools/hooks-embedding.d.ts +0 -0
- package/dist/src/mcp-tools/hooks-embedding.d.ts.map +0 -0
- package/dist/src/mcp-tools/hooks-embedding.js +0 -0
- package/dist/src/mcp-tools/hooks-embedding.js.map +0 -0
- package/dist/src/mcp-tools/hooks-intelligence.d.ts +0 -0
- package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +0 -0
- package/dist/src/mcp-tools/hooks-intelligence.js +0 -0
- package/dist/src/mcp-tools/hooks-intelligence.js.map +0 -0
- package/dist/src/mcp-tools/hooks-routing.d.ts +0 -0
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +0 -0
- package/dist/src/mcp-tools/hooks-routing.js +0 -0
- package/dist/src/mcp-tools/hooks-routing.js.map +0 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts +0 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/hooks-tools.js +0 -0
- package/dist/src/mcp-tools/hooks-tools.js.map +0 -0
- package/dist/src/mcp-tools/index.d.ts +1 -1
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +1 -1
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/knowledge-tools.d.ts +0 -0
- package/dist/src/mcp-tools/knowledge-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/knowledge-tools.js +88 -6
- package/dist/src/mcp-tools/knowledge-tools.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts +0 -0
- package/dist/src/mcp-tools/memory-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/memory-tools.js +0 -0
- package/dist/src/mcp-tools/memory-tools.js.map +0 -0
- package/dist/src/mcp-tools/monograph-compat.d.ts +0 -0
- package/dist/src/mcp-tools/monograph-compat.d.ts.map +0 -0
- package/dist/src/mcp-tools/monograph-compat.js +0 -0
- package/dist/src/mcp-tools/monograph-compat.js.map +0 -0
- package/dist/src/mcp-tools/monograph-tools.d.ts +0 -0
- package/dist/src/mcp-tools/monograph-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/monograph-tools.js +0 -0
- package/dist/src/mcp-tools/monograph-tools.js.map +0 -0
- package/dist/src/mcp-tools/monomind-tools.d.ts +14 -0
- package/dist/src/mcp-tools/monomind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/monomind-tools.js +54 -0
- package/dist/src/mcp-tools/monomind-tools.js.map +1 -0
- package/dist/src/mcp-tools/performance-tools.d.ts +0 -0
- package/dist/src/mcp-tools/performance-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/performance-tools.js +0 -0
- package/dist/src/mcp-tools/performance-tools.js.map +0 -0
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.d.ts +0 -0
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.d.ts.map +0 -0
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +0 -0
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js.map +0 -0
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +0 -0
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts.map +0 -0
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js +0 -0
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.js.map +0 -0
- package/dist/src/mcp-tools/quality-tools.d.ts +0 -0
- package/dist/src/mcp-tools/quality-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/quality-tools.js +0 -0
- package/dist/src/mcp-tools/quality-tools.js.map +0 -0
- package/dist/src/mcp-tools/request-tracker.d.ts +0 -0
- package/dist/src/mcp-tools/request-tracker.d.ts.map +0 -0
- package/dist/src/mcp-tools/request-tracker.js +0 -0
- package/dist/src/mcp-tools/request-tracker.js.map +0 -0
- package/dist/src/mcp-tools/security-tools.d.ts +0 -0
- package/dist/src/mcp-tools/security-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/security-tools.js +0 -0
- package/dist/src/mcp-tools/security-tools.js.map +0 -0
- package/dist/src/mcp-tools/session-tools.d.ts +0 -0
- package/dist/src/mcp-tools/session-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/session-tools.js +0 -0
- package/dist/src/mcp-tools/session-tools.js.map +0 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts +0 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/swarm-tools.js +0 -0
- package/dist/src/mcp-tools/swarm-tools.js.map +0 -0
- package/dist/src/mcp-tools/system-tools.d.ts +0 -0
- package/dist/src/mcp-tools/system-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/system-tools.js +0 -0
- package/dist/src/mcp-tools/system-tools.js.map +0 -0
- package/dist/src/mcp-tools/task-tools.d.ts +1 -0
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +76 -111
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.d.ts +0 -0
- package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +3 -28
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.d.ts +0 -0
- package/dist/src/mcp-tools/transfer-tools.d.ts.map +0 -0
- package/dist/src/mcp-tools/transfer-tools.js +0 -0
- package/dist/src/mcp-tools/transfer-tools.js.map +0 -0
- package/dist/src/mcp-tools/types.d.ts +0 -0
- package/dist/src/mcp-tools/types.d.ts.map +0 -0
- package/dist/src/mcp-tools/types.js +0 -0
- package/dist/src/mcp-tools/types.js.map +0 -0
- package/dist/src/memory/bm25-index.d.ts +137 -0
- package/dist/src/memory/bm25-index.d.ts.map +1 -0
- package/dist/src/memory/bm25-index.js +219 -0
- package/dist/src/memory/bm25-index.js.map +1 -0
- package/dist/src/memory/embedding-operations.d.ts +0 -0
- package/dist/src/memory/embedding-operations.d.ts.map +1 -1
- package/dist/src/memory/embedding-operations.js +8 -7
- package/dist/src/memory/embedding-operations.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.d.ts +0 -0
- package/dist/src/memory/ewc-consolidation.d.ts.map +1 -1
- package/dist/src/memory/ewc-consolidation.js +2 -1
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/hnsw-operations.d.ts +0 -0
- package/dist/src/memory/hnsw-operations.d.ts.map +1 -1
- package/dist/src/memory/hnsw-operations.js +4 -3
- package/dist/src/memory/hnsw-operations.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +0 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -1
- package/dist/src/memory/intelligence.js +2 -1
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +34 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +184 -26
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-crud.d.ts +0 -0
- package/dist/src/memory/memory-crud.d.ts.map +0 -0
- package/dist/src/memory/memory-crud.js +0 -0
- package/dist/src/memory/memory-crud.js.map +0 -0
- package/dist/src/memory/memory-initializer.d.ts +0 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -1
- package/dist/src/memory/memory-initializer.js +4 -3
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/memory-kg.d.ts +0 -0
- package/dist/src/memory/memory-kg.d.ts.map +0 -0
- package/dist/src/memory/memory-kg.js +0 -0
- package/dist/src/memory/memory-kg.js.map +0 -0
- package/dist/src/memory/memory-migrations.d.ts +0 -0
- package/dist/src/memory/memory-migrations.d.ts.map +0 -0
- package/dist/src/memory/memory-migrations.js +0 -0
- package/dist/src/memory/memory-migrations.js.map +0 -0
- package/dist/src/memory/memory-read.d.ts +0 -0
- package/dist/src/memory/memory-read.d.ts.map +0 -0
- package/dist/src/memory/memory-read.js +0 -0
- package/dist/src/memory/memory-read.js.map +0 -0
- package/dist/src/memory/memory-schema.d.ts +1 -1
- package/dist/src/memory/memory-schema.d.ts.map +0 -0
- package/dist/src/memory/memory-schema.js +1 -1
- package/dist/src/memory/memory-schema.js.map +0 -0
- package/dist/src/memory/query-router.d.ts +0 -0
- package/dist/src/memory/query-router.d.ts.map +0 -0
- package/dist/src/memory/query-router.js +0 -0
- package/dist/src/memory/query-router.js.map +0 -0
- package/dist/src/memory/sona-optimizer.d.ts +0 -0
- package/dist/src/memory/sona-optimizer.d.ts.map +0 -0
- package/dist/src/memory/sona-optimizer.js +0 -0
- package/dist/src/memory/sona-optimizer.js.map +0 -0
- package/dist/src/memory/text-tokens.d.ts +10 -0
- package/dist/src/memory/text-tokens.d.ts.map +1 -0
- package/dist/src/memory/text-tokens.js +37 -0
- package/dist/src/memory/text-tokens.js.map +1 -0
- package/dist/src/monovector/command-outcomes.d.ts +0 -0
- package/dist/src/monovector/command-outcomes.d.ts.map +0 -0
- package/dist/src/monovector/command-outcomes.js +0 -0
- package/dist/src/monovector/command-outcomes.js.map +0 -0
- package/dist/src/monovector/coverage-router.d.ts +0 -0
- package/dist/src/monovector/coverage-router.d.ts.map +0 -0
- package/dist/src/monovector/coverage-router.js +0 -0
- package/dist/src/monovector/coverage-router.js.map +0 -0
- package/dist/src/monovector/coverage-tools.d.ts +0 -0
- package/dist/src/monovector/coverage-tools.d.ts.map +0 -0
- package/dist/src/monovector/coverage-tools.js +0 -0
- package/dist/src/monovector/coverage-tools.js.map +0 -0
- package/dist/src/monovector/diff-classifier.d.ts +0 -0
- package/dist/src/monovector/diff-classifier.d.ts.map +0 -0
- package/dist/src/monovector/diff-classifier.js +0 -0
- package/dist/src/monovector/diff-classifier.js.map +0 -0
- package/dist/src/monovector/index.d.ts +0 -0
- package/dist/src/monovector/index.d.ts.map +0 -0
- package/dist/src/monovector/index.js +0 -0
- package/dist/src/monovector/index.js.map +0 -0
- package/dist/src/monovector/init-state.d.ts +0 -0
- package/dist/src/monovector/init-state.d.ts.map +0 -0
- package/dist/src/monovector/init-state.js +0 -0
- package/dist/src/monovector/init-state.js.map +0 -0
- package/dist/src/monovector/route-outcomes.d.ts +0 -0
- package/dist/src/monovector/route-outcomes.d.ts.map +0 -0
- package/dist/src/monovector/route-outcomes.js +0 -0
- package/dist/src/monovector/route-outcomes.js.map +0 -0
- package/dist/src/observability/replay-reader.d.ts +0 -0
- package/dist/src/observability/replay-reader.d.ts.map +0 -0
- package/dist/src/observability/replay-reader.js +0 -0
- package/dist/src/observability/replay-reader.js.map +0 -0
- package/dist/src/orgrt/broker.d.ts +4 -2
- package/dist/src/orgrt/broker.d.ts.map +1 -1
- package/dist/src/orgrt/broker.js +7 -5
- package/dist/src/orgrt/broker.js.map +1 -1
- package/dist/src/orgrt/bus.d.ts +0 -0
- package/dist/src/orgrt/bus.d.ts.map +0 -0
- package/dist/src/orgrt/bus.js +0 -0
- package/dist/src/orgrt/bus.js.map +0 -0
- package/dist/src/orgrt/daemon.d.ts +26 -3
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +183 -34
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/forwarder.d.ts +0 -0
- package/dist/src/orgrt/forwarder.d.ts.map +0 -0
- package/dist/src/orgrt/forwarder.js +0 -0
- package/dist/src/orgrt/forwarder.js.map +0 -0
- package/dist/src/orgrt/inbox.d.ts +0 -0
- package/dist/src/orgrt/inbox.d.ts.map +0 -0
- package/dist/src/orgrt/inbox.js +0 -0
- package/dist/src/orgrt/inbox.js.map +0 -0
- package/dist/src/orgrt/mailbox.d.ts +0 -0
- package/dist/src/orgrt/mailbox.d.ts.map +0 -0
- package/dist/src/orgrt/mailbox.js +0 -0
- package/dist/src/orgrt/mailbox.js.map +0 -0
- package/dist/src/orgrt/migrate.d.ts +0 -0
- package/dist/src/orgrt/migrate.d.ts.map +0 -0
- package/dist/src/orgrt/migrate.js +0 -0
- package/dist/src/orgrt/migrate.js.map +0 -0
- package/dist/src/orgrt/policy.d.ts +0 -0
- package/dist/src/orgrt/policy.d.ts.map +1 -1
- package/dist/src/orgrt/policy.js +84 -0
- package/dist/src/orgrt/policy.js.map +1 -1
- package/dist/src/orgrt/provider.d.ts +0 -0
- package/dist/src/orgrt/provider.d.ts.map +0 -0
- package/dist/src/orgrt/provider.js +0 -0
- package/dist/src/orgrt/provider.js.map +0 -0
- package/dist/src/orgrt/reporting.d.ts +0 -0
- package/dist/src/orgrt/reporting.d.ts.map +0 -0
- package/dist/src/orgrt/reporting.js +0 -0
- package/dist/src/orgrt/reporting.js.map +0 -0
- package/dist/src/orgrt/scheduler.d.ts +14 -1
- package/dist/src/orgrt/scheduler.d.ts.map +1 -1
- package/dist/src/orgrt/scheduler.js +51 -5
- package/dist/src/orgrt/scheduler.js.map +1 -1
- package/dist/src/orgrt/server.d.ts +0 -0
- package/dist/src/orgrt/server.d.ts.map +0 -0
- package/dist/src/orgrt/server.js +0 -0
- package/dist/src/orgrt/server.js.map +0 -0
- package/dist/src/orgrt/session.d.ts +0 -0
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +64 -16
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/templates.d.ts +0 -0
- package/dist/src/orgrt/templates.d.ts.map +0 -0
- package/dist/src/orgrt/templates.js +0 -0
- package/dist/src/orgrt/templates.js.map +0 -0
- package/dist/src/orgrt/test-loop.d.ts +0 -0
- package/dist/src/orgrt/test-loop.d.ts.map +0 -0
- package/dist/src/orgrt/test-loop.js +0 -0
- package/dist/src/orgrt/test-loop.js.map +0 -0
- package/dist/src/orgrt/types.d.ts +21 -0
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +10 -1
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/output.d.ts +0 -0
- package/dist/src/output.d.ts.map +0 -0
- package/dist/src/output.js +0 -0
- package/dist/src/output.js.map +0 -0
- package/dist/src/parser.d.ts +0 -0
- package/dist/src/parser.d.ts.map +0 -0
- package/dist/src/parser.js +0 -0
- package/dist/src/parser.js.map +0 -0
- package/dist/src/pricing/model-pricing.d.ts +0 -0
- package/dist/src/pricing/model-pricing.d.ts.map +0 -0
- package/dist/src/pricing/model-pricing.js +0 -0
- package/dist/src/pricing/model-pricing.js.map +0 -0
- package/dist/src/production/circuit-breaker.d.ts +0 -0
- package/dist/src/production/circuit-breaker.d.ts.map +0 -0
- package/dist/src/production/circuit-breaker.js +0 -0
- package/dist/src/production/circuit-breaker.js.map +0 -0
- package/dist/src/production/error-handler.d.ts +0 -0
- package/dist/src/production/error-handler.d.ts.map +0 -0
- package/dist/src/production/error-handler.js +0 -0
- package/dist/src/production/error-handler.js.map +0 -0
- package/dist/src/production/index.d.ts +0 -0
- package/dist/src/production/index.d.ts.map +0 -0
- package/dist/src/production/index.js +0 -0
- package/dist/src/production/index.js.map +0 -0
- package/dist/src/production/monitoring.d.ts +0 -0
- package/dist/src/production/monitoring.d.ts.map +0 -0
- package/dist/src/production/monitoring.js +0 -0
- package/dist/src/production/monitoring.js.map +0 -0
- package/dist/src/production/rate-limiter.d.ts +0 -0
- package/dist/src/production/rate-limiter.d.ts.map +0 -0
- package/dist/src/production/rate-limiter.js +0 -0
- package/dist/src/production/rate-limiter.js.map +0 -0
- package/dist/src/production/retry.d.ts +0 -0
- package/dist/src/production/retry.d.ts.map +0 -0
- package/dist/src/production/retry.js +0 -0
- package/dist/src/production/retry.js.map +0 -0
- package/dist/src/prompt.d.ts +0 -0
- package/dist/src/prompt.d.ts.map +0 -0
- package/dist/src/prompt.js +0 -0
- package/dist/src/prompt.js.map +0 -0
- package/dist/src/routing/embed-worker.d.ts +0 -0
- package/dist/src/routing/embed-worker.d.ts.map +0 -0
- package/dist/src/routing/embed-worker.js +0 -0
- package/dist/src/routing/embed-worker.js.map +0 -0
- package/dist/src/routing/embedder.d.ts +0 -0
- package/dist/src/routing/embedder.d.ts.map +0 -0
- package/dist/src/routing/embedder.js +0 -0
- package/dist/src/routing/embedder.js.map +0 -0
- package/dist/src/routing/llm-caller.d.ts +0 -0
- package/dist/src/routing/llm-caller.d.ts.map +0 -0
- package/dist/src/routing/llm-caller.js +0 -0
- package/dist/src/routing/llm-caller.js.map +0 -0
- package/dist/src/routing/route-layer-factory.d.ts +0 -0
- package/dist/src/routing/route-layer-factory.d.ts.map +0 -0
- package/dist/src/routing/route-layer-factory.js +0 -0
- package/dist/src/routing/route-layer-factory.js.map +0 -0
- package/dist/src/services/config-file-manager.d.ts +0 -0
- package/dist/src/services/config-file-manager.d.ts.map +0 -0
- package/dist/src/services/config-file-manager.js +0 -0
- package/dist/src/services/config-file-manager.js.map +0 -0
- package/dist/src/services/crash-reporter.d.ts +0 -0
- package/dist/src/services/crash-reporter.d.ts.map +1 -1
- package/dist/src/services/crash-reporter.js +7 -0
- package/dist/src/services/crash-reporter.js.map +1 -1
- package/dist/src/suggest.d.ts +0 -0
- package/dist/src/suggest.d.ts.map +0 -0
- package/dist/src/suggest.js +0 -0
- package/dist/src/suggest.js.map +0 -0
- package/dist/src/sync/checker.d.ts +0 -0
- package/dist/src/sync/checker.d.ts.map +0 -0
- package/dist/src/sync/checker.js +0 -0
- package/dist/src/sync/checker.js.map +0 -0
- package/dist/src/transfer/anonymization/index.d.ts +0 -0
- package/dist/src/transfer/anonymization/index.d.ts.map +0 -0
- package/dist/src/transfer/anonymization/index.js +0 -0
- package/dist/src/transfer/anonymization/index.js.map +0 -0
- package/dist/src/transfer/types.d.ts +0 -0
- package/dist/src/transfer/types.d.ts.map +0 -0
- package/dist/src/transfer/types.js +0 -0
- package/dist/src/transfer/types.js.map +0 -0
- package/dist/src/types.d.ts +0 -0
- package/dist/src/types.d.ts.map +0 -0
- package/dist/src/types.js +0 -0
- package/dist/src/types.js.map +0 -0
- package/dist/src/ui/collector.mjs +0 -0
- package/dist/src/ui/dashboard.html +13 -10
- package/dist/src/ui/data/agent-avatars.html +0 -0
- package/dist/src/ui/data/agent-avatars.json +0 -0
- package/dist/src/ui/data/avatars/account-strategist.svg +0 -0
- package/dist/src/ui/data/avatars/accounts-payable.svg +0 -0
- package/dist/src/ui/data/avatars/adaptive-coordinator.svg +0 -0
- package/dist/src/ui/data/avatars/adaptive-coordinator2.svg +0 -0
- package/dist/src/ui/data/avatars/ai-citation.svg +0 -0
- package/dist/src/ui/data/avatars/ai-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/analytics-reporter.svg +0 -0
- package/dist/src/ui/data/avatars/api-tester.svg +0 -0
- package/dist/src/ui/data/avatars/architecture.svg +0 -0
- package/dist/src/ui/data/avatars/automation-governance.svg +0 -0
- package/dist/src/ui/data/avatars/backend-dev.svg +0 -0
- package/dist/src/ui/data/avatars/benchmarker.svg +0 -0
- package/dist/src/ui/data/avatars/blockchain-auditor.svg +0 -0
- package/dist/src/ui/data/avatars/byzantine-coord.svg +0 -0
- package/dist/src/ui/data/avatars/case-analyst.svg +0 -0
- package/dist/src/ui/data/avatars/cicd-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/cloud-architect.svg +0 -0
- package/dist/src/ui/data/avatars/code-review-swarm.svg +0 -0
- package/dist/src/ui/data/avatars/coder-v119.svg +0 -0
- package/dist/src/ui/data/avatars/coder.svg +0 -0
- package/dist/src/ui/data/avatars/collective-coord.svg +0 -0
- package/dist/src/ui/data/avatars/compliance-auditor.svg +0 -0
- package/dist/src/ui/data/avatars/consensus-coordinator.svg +0 -0
- package/dist/src/ui/data/avatars/content-creator.svg +0 -0
- package/dist/src/ui/data/avatars/crdt-synchronizer.svg +0 -0
- package/dist/src/ui/data/avatars/cro-specialist.svg +0 -0
- package/dist/src/ui/data/avatars/data-consolidator.svg +0 -0
- package/dist/src/ui/data/avatars/data-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/database-optimizer.svg +0 -0
- package/dist/src/ui/data/avatars/deal-strategist.svg +0 -0
- package/dist/src/ui/data/avatars/defender.svg +0 -0
- package/dist/src/ui/data/avatars/devops-automator.svg +0 -0
- package/dist/src/ui/data/avatars/discovery-coach.svg +0 -0
- package/dist/src/ui/data/avatars/email-marketing.svg +0 -0
- package/dist/src/ui/data/avatars/embedded-firmware.svg +0 -0
- package/dist/src/ui/data/avatars/evidence-collector.svg +0 -0
- package/dist/src/ui/data/avatars/experiment-tracker.svg +0 -0
- package/dist/src/ui/data/avatars/feedback-synthesizer.svg +0 -0
- package/dist/src/ui/data/avatars/finance-tracker.svg +0 -0
- package/dist/src/ui/data/avatars/frontend-developer.svg +0 -0
- package/dist/src/ui/data/avatars/game-audio-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/game-designer.svg +0 -0
- package/dist/src/ui/data/avatars/gossip-coordinator.svg +0 -0
- package/dist/src/ui/data/avatars/hierarchical-coord.svg +0 -0
- package/dist/src/ui/data/avatars/incident-commander.svg +0 -0
- package/dist/src/ui/data/avatars/infrastructure.svg +0 -0
- package/dist/src/ui/data/avatars/input-validator.svg +0 -0
- package/dist/src/ui/data/avatars/ios-developer.svg +0 -0
- package/dist/src/ui/data/avatars/issue-tracker.svg +0 -0
- package/dist/src/ui/data/avatars/judge.svg +0 -0
- package/dist/src/ui/data/avatars/launch-strategist.svg +0 -0
- package/dist/src/ui/data/avatars/legal-compliance.svg +0 -0
- package/dist/src/ui/data/avatars/level-designer.svg +0 -0
- package/dist/src/ui/data/avatars/load-balancer.svg +0 -0
- package/dist/src/ui/data/avatars/mcp-builder.svg +0 -0
- package/dist/src/ui/data/avatars/memory-coordinator.svg +0 -0
- package/dist/src/ui/data/avatars/mesh-coordinator.svg +0 -0
- package/dist/src/ui/data/avatars/ml-developer.svg +0 -0
- package/dist/src/ui/data/avatars/mobile-app-builder.svg +0 -0
- package/dist/src/ui/data/avatars/mobile-dev.svg +0 -0
- package/dist/src/ui/data/avatars/model-qa.svg +0 -0
- package/dist/src/ui/data/avatars/narrative-designer.svg +0 -0
- package/dist/src/ui/data/avatars/outbound-strategist.svg +0 -0
- package/dist/src/ui/data/avatars/path-validator.svg +0 -0
- package/dist/src/ui/data/avatars/payment-agent.svg +0 -0
- package/dist/src/ui/data/avatars/perf-analyzer.svg +0 -0
- package/dist/src/ui/data/avatars/pipeline-analyst.svg +0 -0
- package/dist/src/ui/data/avatars/planner.svg +0 -0
- package/dist/src/ui/data/avatars/pr-manager.svg +0 -0
- package/dist/src/ui/data/avatars/pricing-strategist.svg +0 -0
- package/dist/src/ui/data/avatars/product-manager.svg +0 -0
- package/dist/src/ui/data/avatars/production-validator.svg +0 -0
- package/dist/src/ui/data/avatars/project-shepherd.svg +0 -0
- package/dist/src/ui/data/avatars/proposal-strategist.svg +0 -0
- package/dist/src/ui/data/avatars/prosecutor.svg +0 -0
- package/dist/src/ui/data/avatars/pseudocode.svg +0 -0
- package/dist/src/ui/data/avatars/queen-coordinator.svg +0 -0
- package/dist/src/ui/data/avatars/quorum-manager.svg +0 -0
- package/dist/src/ui/data/avatars/raft-manager.svg +0 -0
- package/dist/src/ui/data/avatars/reality-checker.svg +0 -0
- package/dist/src/ui/data/avatars/recruitment.svg +0 -0
- package/dist/src/ui/data/avatars/refinement.svg +0 -0
- package/dist/src/ui/data/avatars/release-manager.svg +0 -0
- package/dist/src/ui/data/avatars/repo-architect.svg +0 -0
- package/dist/src/ui/data/avatars/researcher.svg +0 -0
- package/dist/src/ui/data/avatars/resource-allocator.svg +0 -0
- package/dist/src/ui/data/avatars/reviewer.svg +0 -0
- package/dist/src/ui/data/avatars/safe-executor.svg +0 -0
- package/dist/src/ui/data/avatars/sales-coach.svg +0 -0
- package/dist/src/ui/data/avatars/sales-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/scout-explorer.svg +0 -0
- package/dist/src/ui/data/avatars/security-architect.svg +0 -0
- package/dist/src/ui/data/avatars/security-auditor.svg +0 -0
- package/dist/src/ui/data/avatars/senior-developer.svg +0 -0
- package/dist/src/ui/data/avatars/senior-pm.svg +0 -0
- package/dist/src/ui/data/avatars/seo-specialist.svg +0 -0
- package/dist/src/ui/data/avatars/social-media.svg +0 -0
- package/dist/src/ui/data/avatars/solidity-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/sparc-coder.svg +0 -0
- package/dist/src/ui/data/avatars/sparc-coord.svg +0 -0
- package/dist/src/ui/data/avatars/specification.svg +0 -0
- package/dist/src/ui/data/avatars/sprint-prioritizer.svg +0 -0
- package/dist/src/ui/data/avatars/sre.svg +0 -0
- package/dist/src/ui/data/avatars/studio-operations.svg +0 -0
- package/dist/src/ui/data/avatars/studio-producer.svg +0 -0
- package/dist/src/ui/data/avatars/support-responder.svg +0 -0
- package/dist/src/ui/data/avatars/system-architect.svg +0 -0
- package/dist/src/ui/data/avatars/task-orchestrator.svg +0 -0
- package/dist/src/ui/data/avatars/technical-artist.svg +0 -0
- package/dist/src/ui/data/avatars/technical-writer.svg +0 -0
- package/dist/src/ui/data/avatars/tester.svg +0 -0
- package/dist/src/ui/data/avatars/threat-detection.svg +0 -0
- package/dist/src/ui/data/avatars/trend-researcher.svg +0 -0
- package/dist/src/ui/data/avatars/trial-director.svg +0 -0
- package/dist/src/ui/data/avatars/unity-architect.svg +0 -0
- package/dist/src/ui/data/avatars/visionos-engineer.svg +0 -0
- package/dist/src/ui/data/avatars/worker-specialist.svg +0 -0
- package/dist/src/ui/data/avatars/workflow-architect.svg +0 -0
- package/dist/src/ui/data/avatars/workflow-automation.svg +0 -0
- package/dist/src/ui/data/avatars/zk-steward.svg +0 -0
- package/dist/src/ui/mastermind-diagram-fallback.html +0 -0
- package/dist/src/ui/orgs-files.js +0 -0
- package/dist/src/ui/orgs.html +30 -13
- package/dist/src/ui/routes-monograph.mjs +929 -0
- package/dist/src/ui/routes-org.mjs +2513 -0
- package/dist/src/ui/server.mjs +726 -4117
- package/dist/src/ui/sse-manager.mjs +0 -0
- package/dist/src/update/checker.d.ts +0 -0
- package/dist/src/update/checker.d.ts.map +0 -0
- package/dist/src/update/checker.js +0 -0
- package/dist/src/update/checker.js.map +0 -0
- package/dist/src/update/executor.d.ts +0 -0
- package/dist/src/update/executor.d.ts.map +0 -0
- package/dist/src/update/executor.js +0 -0
- package/dist/src/update/executor.js.map +0 -0
- package/dist/src/update/index.d.ts +0 -0
- package/dist/src/update/index.d.ts.map +0 -0
- package/dist/src/update/index.js +0 -0
- package/dist/src/update/index.js.map +0 -0
- package/dist/src/update/rate-limiter.d.ts +0 -0
- package/dist/src/update/rate-limiter.d.ts.map +0 -0
- package/dist/src/update/rate-limiter.js +0 -0
- package/dist/src/update/rate-limiter.js.map +0 -0
- package/dist/src/update/validator.d.ts +0 -0
- package/dist/src/update/validator.d.ts.map +0 -0
- package/dist/src/update/validator.js +0 -0
- package/dist/src/update/validator.js.map +0 -0
- package/dist/src/utils/cosine-similarity.d.ts +0 -0
- package/dist/src/utils/cosine-similarity.d.ts.map +0 -0
- package/dist/src/utils/cosine-similarity.js +0 -0
- package/dist/src/utils/cosine-similarity.js.map +0 -0
- package/dist/src/utils/input-guards.d.ts +0 -0
- package/dist/src/utils/input-guards.d.ts.map +0 -0
- package/dist/src/utils/input-guards.js +0 -0
- package/dist/src/utils/input-guards.js.map +0 -0
- package/dist/src/utils/json-file.d.ts +11 -0
- package/dist/src/utils/json-file.d.ts.map +1 -1
- package/dist/src/utils/json-file.js +27 -0
- package/dist/src/utils/json-file.js.map +1 -1
- package/dist/src/utils/parse-jsonl.d.ts +0 -0
- package/dist/src/utils/parse-jsonl.d.ts.map +0 -0
- package/dist/src/utils/parse-jsonl.js +0 -0
- package/dist/src/utils/parse-jsonl.js.map +0 -0
- package/dist/src/utils/resource-governor.d.ts +0 -0
- package/dist/src/utils/resource-governor.d.ts.map +0 -0
- package/dist/src/utils/resource-governor.js +0 -0
- package/dist/src/utils/resource-governor.js.map +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/scripts/deploy-ipfs-node.sh +0 -0
- package/scripts/setup-ipfs-registry.md +0 -0
- package/scripts/understand-analyze.mjs +0 -0
- package/.claude/skills/github-toolkit/SKILL.md +0 -60
- package/.claude/skills/memory-toolkit/SKILL.md +0 -75
- package/dist/src/mcp-tools/neural-tools.d.ts +0 -15
- package/dist/src/mcp-tools/neural-tools.d.ts.map +0 -1
- package/dist/src/mcp-tools/neural-tools.js +0 -506
- package/dist/src/mcp-tools/neural-tools.js.map +0 -1
- package/dist/src/ui/data/known-projects.json +0 -1
- package/dist/src/ui/data/mastermind-events.jsonl +0 -553
- package/dist/src/ui/data/mastermind-sessions.json +0 -1
- package/dist/src/ui/data/sessions/_index.json +0 -1
- package/dist/src/ui/data/sessions/final-sess-001.jsonl +0 -542
- package/dist/src/ui/data/unknown-events.jsonl +0 -1
|
@@ -0,0 +1,929 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export async function handleMonographRoutes(req, res, url, corsOrigin, ctx) {
|
|
5
|
+
// ------------------------------------------------------- GET /api/monograph-html
|
|
6
|
+
if (req.method === 'GET' && url === '/api/monograph-html') {
|
|
7
|
+
try {
|
|
8
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
9
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
10
|
+
const d = path.resolve(dir || process.cwd());
|
|
11
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
12
|
+
|
|
13
|
+
// Generate HTML on-the-fly from SQLite DB
|
|
14
|
+
if (fs.existsSync(dbPath)) {
|
|
15
|
+
let html;
|
|
16
|
+
try {
|
|
17
|
+
// Try better-sqlite3 first (fast, in-process)
|
|
18
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
19
|
+
const { toHtml } = await import(new URL('../../../../monograph/dist/src/export/html.js', import.meta.url).href);
|
|
20
|
+
const db = openDb(dbPath);
|
|
21
|
+
try {
|
|
22
|
+
const rawNodes = db.prepare('SELECT * FROM nodes LIMIT 5000').all();
|
|
23
|
+
const rawEdges = db.prepare('SELECT * FROM edges').all();
|
|
24
|
+
const parsedNodes = rawNodes.map(n => ({
|
|
25
|
+
id: n.id, label: n.label, name: n.name, normLabel: n.norm_label,
|
|
26
|
+
filePath: n.file_path, startLine: n.start_line, endLine: n.end_line,
|
|
27
|
+
communityId: n.community_id, isExported: !!n.is_exported,
|
|
28
|
+
language: n.language, properties: n.properties ? JSON.parse(n.properties) : {},
|
|
29
|
+
}));
|
|
30
|
+
const parsedEdges = rawEdges.map(e => ({
|
|
31
|
+
id: e.id, sourceId: e.source_id, targetId: e.target_id,
|
|
32
|
+
relation: e.relation, confidence: e.confidence,
|
|
33
|
+
confidenceScore: e.confidence_score, weight: e.weight,
|
|
34
|
+
}));
|
|
35
|
+
html = toHtml(parsedNodes, parsedEdges);
|
|
36
|
+
} finally { closeDb(db); }
|
|
37
|
+
} catch {
|
|
38
|
+
// Fallback: sqlite3 CLI + inline Sigma.js graph
|
|
39
|
+
const { execFileSync } = await import('child_process');
|
|
40
|
+
const runSql = (sql) => {
|
|
41
|
+
try { return JSON.parse(execFileSync('sqlite3', ['-json', dbPath], { encoding: 'utf-8', timeout: 15000, maxBuffer: 50*1024*1024, input: sql + ';' }) || '[]'); } catch { return []; }
|
|
42
|
+
};
|
|
43
|
+
const rawNodes = runSql('SELECT id, name, label, file_path, community_id FROM nodes LIMIT 2000');
|
|
44
|
+
const rawEdges = runSql('SELECT source_id, target_id, relation FROM edges');
|
|
45
|
+
const degree = new Map();
|
|
46
|
+
for (const n of rawNodes) degree.set(n.id, 0);
|
|
47
|
+
for (const e of rawEdges) {
|
|
48
|
+
if (degree.has(e.source_id)) degree.set(e.source_id, (degree.get(e.source_id)||0)+1);
|
|
49
|
+
if (degree.has(e.target_id)) degree.set(e.target_id, (degree.get(e.target_id)||0)+1);
|
|
50
|
+
}
|
|
51
|
+
const topNodes = [...rawNodes].sort((a,b) => (degree.get(b.id)||0)-(degree.get(a.id)||0)).slice(0,500);
|
|
52
|
+
const topIds = new Set(topNodes.map(n => n.id));
|
|
53
|
+
const filteredEdges = rawEdges.filter(e => topIds.has(e.source_id) && topIds.has(e.target_id)).slice(0,2000);
|
|
54
|
+
const colors = ['#4E79A7','#F28E2B','#E15759','#76B7B2','#59A14F','#EDC948','#B07AA1','#FF9DA7','#9C755F','#BAB0AC'];
|
|
55
|
+
const nodesJson = JSON.stringify(topNodes.map((n,i) => {
|
|
56
|
+
const d = degree.get(n.id)||1;
|
|
57
|
+
const c = n.community_id != null ? colors[n.community_id % colors.length] : colors[i % colors.length];
|
|
58
|
+
return { id: n.id, label: n.name||n.id, x: Math.cos(i*0.618*Math.PI*2)*300+Math.random()*50, y: Math.sin(i*0.618*Math.PI*2)*300+Math.random()*50, size: Math.min(3+Math.sqrt(d)*2,20), color: c };
|
|
59
|
+
}));
|
|
60
|
+
const edgesJson = JSON.stringify(filteredEdges.map((e,i) => ({ id:'e'+i, source:e.source_id, target:e.target_id })));
|
|
61
|
+
html = `<!DOCTYPE html><html><head><meta charset="utf-8"><title>Monograph</title>
|
|
62
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/sigma.js/2.4.0/sigma.min.js"><\/script>
|
|
63
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/graphology/0.25.4/graphology.umd.min.js"><\/script>
|
|
64
|
+
<style>*{margin:0;padding:0}body{background:#0f0f1a;overflow:hidden}#g{width:100vw;height:100vh}</style></head>
|
|
65
|
+
<body><div id="g"></div><script>
|
|
66
|
+
const g=new graphology.Graph();
|
|
67
|
+
${nodesJson}.forEach(n=>g.addNode(n.id,{label:n.label,x:n.x,y:n.y,size:n.size,color:n.color}));
|
|
68
|
+
${edgesJson}.forEach(e=>{try{g.addEdge(e.source,e.target,{size:0.5,color:'#333'})}catch{}});
|
|
69
|
+
new Sigma(g,document.getElementById('g'),{renderEdgeLabels:false,labelColor:{color:'#ccc'},labelSize:10});
|
|
70
|
+
<\/script></body></html>`;
|
|
71
|
+
}
|
|
72
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}), 'Cache-Control': 'no-cache' });
|
|
73
|
+
res.end(html);
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Fallback: try legacy graph.html on disk
|
|
78
|
+
const htmlPath = path.join(d, '.monomind', 'graph', 'graph.html');
|
|
79
|
+
const html = fs.readFileSync(htmlPath, 'utf-8');
|
|
80
|
+
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}), 'Cache-Control': 'no-cache' });
|
|
81
|
+
res.end(html);
|
|
82
|
+
} catch (err) {
|
|
83
|
+
res.writeHead(404, { 'Content-Type': 'text/html' });
|
|
84
|
+
res.end('<html><body style="background:#0f0f1a;color:#888;font-family:monospace;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;"><div style="text-align:center;"><h3 style="color:#4E79A7;">No Graph Built Yet</h3><p>Run <code style="color:#00E5C8;">mcp__monomind__monograph_build</code> or click BUILD in the sidebar.</p></div></body></html>');
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ------------------------------------------------------- GET /api/monograph-report
|
|
90
|
+
if (req.method === 'GET' && url === '/api/monograph-report') {
|
|
91
|
+
try {
|
|
92
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
93
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
94
|
+
const d = path.resolve(dir || process.cwd());
|
|
95
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
96
|
+
let report = null, exists = false, stats = null;
|
|
97
|
+
if (fs.existsSync(dbPath)) {
|
|
98
|
+
exists = true;
|
|
99
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
100
|
+
const db = openDb(dbPath);
|
|
101
|
+
try {
|
|
102
|
+
const nodeCount = db.prepare('SELECT COUNT(*) AS c FROM nodes').get().c;
|
|
103
|
+
const edgeCount = db.prepare('SELECT COUNT(*) AS c FROM edges').get().c;
|
|
104
|
+
const topNodes = db.prepare(`SELECT n.id, n.name, n.label, (SELECT COUNT(*) FROM edges e WHERE e.source_id=n.id OR e.target_id=n.id) AS deg FROM nodes n ORDER BY deg DESC LIMIT 20`).all();
|
|
105
|
+
const labelDist = db.prepare('SELECT label, COUNT(*) AS cnt FROM nodes GROUP BY label ORDER BY cnt DESC LIMIT 10').all();
|
|
106
|
+
const dbStat = fs.statSync(dbPath);
|
|
107
|
+
stats = { nodes: nodeCount, edges: edgeCount, size: dbStat.size, mtime: dbStat.mtimeMs };
|
|
108
|
+
report = [
|
|
109
|
+
'# Monograph Knowledge Graph',
|
|
110
|
+
'',
|
|
111
|
+
`## Overview`,
|
|
112
|
+
`- **Nodes**: ${nodeCount.toLocaleString()}`,
|
|
113
|
+
`- **Edges**: ${edgeCount.toLocaleString()}`,
|
|
114
|
+
`- **Last built**: ${new Date(dbStat.mtimeMs).toLocaleString()}`,
|
|
115
|
+
'',
|
|
116
|
+
'## Top 20 Nodes by Degree',
|
|
117
|
+
...topNodes.map((n, i) => `${String(i+1).padStart(3,' ')}. **${n.name || n.id}** \`${n.label}\` — ${n.deg} connections`),
|
|
118
|
+
'',
|
|
119
|
+
'## Node Type Distribution',
|
|
120
|
+
...labelDist.map(r => `- **${r.label}**: ${r.cnt}`),
|
|
121
|
+
].join('\n');
|
|
122
|
+
} finally { closeDb(db); }
|
|
123
|
+
}
|
|
124
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}), 'Cache-Control': 'no-cache' });
|
|
125
|
+
res.end(JSON.stringify({ exists, report, stats }));
|
|
126
|
+
} catch (err) {
|
|
127
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
128
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// -------------------------------------------------- GET /api/monograph-graph
|
|
134
|
+
if (req.method === 'GET' && url === '/api/monograph-graph') {
|
|
135
|
+
try {
|
|
136
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
137
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
138
|
+
const d = path.resolve(dir || process.cwd());
|
|
139
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
140
|
+
let nodes = [], edges = [];
|
|
141
|
+
if (fs.existsSync(dbPath)) {
|
|
142
|
+
const { execFileSync } = await import('child_process');
|
|
143
|
+
const runSql = (sql, timeout = 10000) => {
|
|
144
|
+
try {
|
|
145
|
+
return JSON.parse(execFileSync('sqlite3', ['-json', dbPath],
|
|
146
|
+
{ encoding: 'utf-8', timeout, maxBuffer: 50 * 1024 * 1024, input: sql + ';' }) || '[]');
|
|
147
|
+
} catch { return []; }
|
|
148
|
+
};
|
|
149
|
+
const nodeLimit = Math.min(parseInt(qs.get('limit') || '500', 10), 5000);
|
|
150
|
+
const labelFilter = qs.get('labels') ? qs.get('labels').split(',').map(s => s.trim()) : null;
|
|
151
|
+
const rawNodes = labelFilter
|
|
152
|
+
? runSql(`SELECT id, name, label, file_path, community_id FROM nodes WHERE label IN (${labelFilter.map(l => "'" + l.replace(/'/g, "''") + "'").join(',')}) LIMIT 5000`)
|
|
153
|
+
: runSql(`SELECT id, name, label, file_path, community_id FROM nodes LIMIT 5000`);
|
|
154
|
+
const rawEdges = runSql('SELECT source_id, target_id, relation FROM edges');
|
|
155
|
+
const degree = new Map();
|
|
156
|
+
for (const n of rawNodes) degree.set(n.id, 0);
|
|
157
|
+
for (const e of rawEdges) {
|
|
158
|
+
if (degree.has(e.source_id)) degree.set(e.source_id, (degree.get(e.source_id) || 0) + 1);
|
|
159
|
+
if (degree.has(e.target_id)) degree.set(e.target_id, (degree.get(e.target_id) || 0) + 1);
|
|
160
|
+
}
|
|
161
|
+
const topNodes = labelFilter
|
|
162
|
+
? rawNodes
|
|
163
|
+
: [...rawNodes].sort((a, b) => (degree.get(b.id) || 0) - (degree.get(a.id) || 0)).slice(0, nodeLimit);
|
|
164
|
+
const topIds = new Set(topNodes.map(n => n.id));
|
|
165
|
+
nodes = topNodes.map(n => ({ id: n.id, label: n.name || n.id, type: n.label || 'unknown', degree: degree.get(n.id) || 0 }));
|
|
166
|
+
edges = rawEdges.filter(e => topIds.has(e.source_id) && topIds.has(e.target_id)).slice(0, 2000).map(e => ({ source: e.source_id, target: e.target_id, relation: e.relation || 'REF' }));
|
|
167
|
+
}
|
|
168
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}), 'Cache-Control': 'no-cache' });
|
|
169
|
+
res.end(JSON.stringify({ nodes, edges }));
|
|
170
|
+
} catch (err) {
|
|
171
|
+
res.writeHead(500); res.end(JSON.stringify({ error: err.message }));
|
|
172
|
+
}
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// -------------------------------------------------- POST /api/ua-enrich
|
|
177
|
+
// Trigger semantic enrichment on an existing monograph DB.
|
|
178
|
+
// Imports understand graph.json if present; falls back to structural-only pass.
|
|
179
|
+
if (req.method === 'POST' && url === '/api/ua-enrich') {
|
|
180
|
+
try {
|
|
181
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
182
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
183
|
+
const d = path.resolve(dir || process.cwd());
|
|
184
|
+
const dbFilePath = path.join(d, '.monomind', 'monograph.db');
|
|
185
|
+
|
|
186
|
+
// Check for UA graph.json first
|
|
187
|
+
const uaGraphCandidates = [
|
|
188
|
+
path.join(d, '.understand-anything', 'knowledge-graph.json'),
|
|
189
|
+
path.join(d, '.understand-anything', 'graph.json'),
|
|
190
|
+
path.join(d, '.ua', 'knowledge-graph.json'),
|
|
191
|
+
path.join(d, '.ua', 'graph.json'),
|
|
192
|
+
];
|
|
193
|
+
const uaGraph = uaGraphCandidates.find(p => fs.existsSync(p));
|
|
194
|
+
const importScript = path.join(process.cwd(), 'scripts', 'ua-import.mjs');
|
|
195
|
+
const enrichScript = path.join(process.cwd(), 'scripts', 'ua-enrich.mjs');
|
|
196
|
+
|
|
197
|
+
res.writeHead(202, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
198
|
+
|
|
199
|
+
if (uaGraph && fs.existsSync(importScript)) {
|
|
200
|
+
res.end(JSON.stringify({ status: 'importing', source: uaGraph }));
|
|
201
|
+
const { spawn: sp } = await import('child_process');
|
|
202
|
+
const child = sp(process.execPath, [importScript, uaGraph, dbFilePath], { stdio: 'ignore', detached: true, cwd: d });
|
|
203
|
+
child.unref();
|
|
204
|
+
} else if (fs.existsSync(enrichScript)) {
|
|
205
|
+
res.end(JSON.stringify({ status: 'enriching', mode: 'structural-only' }));
|
|
206
|
+
const { spawn: sp } = await import('child_process');
|
|
207
|
+
const child = sp(process.execPath, [enrichScript, '--dir', d, '--db', dbFilePath, '--full'], { stdio: 'ignore', detached: true, cwd: d });
|
|
208
|
+
child.unref();
|
|
209
|
+
} else {
|
|
210
|
+
res.end(JSON.stringify({ status: 'skipped', reason: 'No understand graph.json found. Run /monomind:understand in Claude Code first.' }));
|
|
211
|
+
}
|
|
212
|
+
} catch (err) {
|
|
213
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
214
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
215
|
+
}
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// -------------------------------------------------- POST /api/monograph-build
|
|
220
|
+
if (req.method === 'POST' && url === '/api/monograph-build') {
|
|
221
|
+
try {
|
|
222
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
223
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
224
|
+
const d = path.resolve(dir || process.cwd());
|
|
225
|
+
|
|
226
|
+
// Security: this route spawns `node --eval` with `cwd: d`, which lets
|
|
227
|
+
// Node resolve '@monoes/monograph' against d's node_modules. Only ever
|
|
228
|
+
// allow this for the server's own project root — never an
|
|
229
|
+
// attacker-controlled `?dir=` — since a planted node_modules there
|
|
230
|
+
// would achieve RCE. (See P0-6.)
|
|
231
|
+
const _serverRoot = path.resolve(ctx.projectDir || process.cwd());
|
|
232
|
+
if (d !== _serverRoot) {
|
|
233
|
+
res.writeHead(400, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
234
|
+
res.end(JSON.stringify({ error: 'monograph-build only supports the server project root' }));
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
res.writeHead(202, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
239
|
+
res.end(JSON.stringify({ status: 'building', dir: d }));
|
|
240
|
+
|
|
241
|
+
// Build via monograph in background
|
|
242
|
+
const { spawn: sp } = await import('child_process');
|
|
243
|
+
const script = `import { buildAsync } from '@monoes/monograph'; await buildAsync(${JSON.stringify(d)});`;
|
|
244
|
+
const child = sp(process.execPath, ['--input-type=module', '--eval', script], { stdio: 'ignore', detached: true, cwd: d });
|
|
245
|
+
child.unref();
|
|
246
|
+
console.log(`[graph] build started for ${d} via monograph`);
|
|
247
|
+
} catch (err) {
|
|
248
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
249
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
250
|
+
}
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// -------------------------------------------------- GET /api/monograph-build-docs-status
|
|
255
|
+
if (req.method === 'GET' && url === '/api/monograph-build-docs-status') {
|
|
256
|
+
const qs2 = new URL(req.url, 'http://localhost').searchParams;
|
|
257
|
+
const d2 = path.resolve(qs2.get('dir') || ctx.projectDir || process.cwd());
|
|
258
|
+
const state = ctx.buildDocsState.get(d2) || { status: 'idle' };
|
|
259
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
260
|
+
res.end(JSON.stringify(state));
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// -------------------------------------------------- POST /api/monograph-build-docs
|
|
265
|
+
if (req.method === 'POST' && url === '/api/monograph-build-docs') {
|
|
266
|
+
try {
|
|
267
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
268
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
269
|
+
const d = path.resolve(dir || process.cwd());
|
|
270
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
271
|
+
if (!fs.existsSync(dbPath)) {
|
|
272
|
+
res.writeHead(400, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
273
|
+
res.end(JSON.stringify({ error: 'monograph.db not found — run BUILD GRAPH first' }));
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Reject if already running
|
|
278
|
+
const existing = ctx.buildDocsState.get(d);
|
|
279
|
+
if (existing && existing.status === 'pending') {
|
|
280
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
281
|
+
res.end(JSON.stringify({ status: 'pending', message: 'Build already in progress' }));
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const startedAt = Date.now();
|
|
286
|
+
ctx.buildDocsState.set(d, { status: 'pending', sections: 0, files: 0, error: null, startedAt });
|
|
287
|
+
res.writeHead(202, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
288
|
+
res.end(JSON.stringify({ status: 'pending', dir: d }));
|
|
289
|
+
|
|
290
|
+
// Run doc parsing in background
|
|
291
|
+
(async () => {
|
|
292
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
293
|
+
const { isFileCached, updateFileCache, hashFileContent } = await import(new URL('../../../../monograph/dist/src/storage/file-cache.js', import.meta.url).href);
|
|
294
|
+
const { readFileSync, readdirSync, statSync } = fs;
|
|
295
|
+
|
|
296
|
+
const docExts = new Set(['.md', '.mdx', '.txt', '.rst']);
|
|
297
|
+
const ignoreDirs = new Set(['node_modules', '.git', 'dist', 'build', '.next', '.nuxt', 'coverage', '.monomind', '__pycache__', 'vendor']);
|
|
298
|
+
const docFiles = [];
|
|
299
|
+
function walk(dir2, depth = 0) {
|
|
300
|
+
if (depth > 12) return;
|
|
301
|
+
let entries;
|
|
302
|
+
try { entries = readdirSync(dir2); } catch { return; }
|
|
303
|
+
for (const e of entries) {
|
|
304
|
+
if (ignoreDirs.has(e) || e.startsWith('.')) continue;
|
|
305
|
+
const full = path.join(dir2, e);
|
|
306
|
+
let st;
|
|
307
|
+
try { st = statSync(full); } catch { continue; }
|
|
308
|
+
if (st.isDirectory()) { walk(full, depth + 1); }
|
|
309
|
+
else if (docExts.has(path.extname(e).toLowerCase()) && st.size < 600000) docFiles.push(full);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
walk(d);
|
|
313
|
+
|
|
314
|
+
const db = openDb(dbPath);
|
|
315
|
+
try {
|
|
316
|
+
const insertNode = db.prepare(`INSERT OR REPLACE INTO nodes (id, label, name, norm_label, file_path, start_line, end_line, language, is_exported) VALUES (?, ?, ?, ?, ?, ?, ?, ?, 0)`);
|
|
317
|
+
const insertEdge = db.prepare(`INSERT OR IGNORE INTO edges (id, source_id, target_id, relation, confidence, confidence_score, weight) VALUES (?, ?, ?, ?, 'EXTRACTED', 1.0, 1.0)`);
|
|
318
|
+
|
|
319
|
+
const insertAll = db.transaction((nodes, edges) => {
|
|
320
|
+
for (const n of nodes) {
|
|
321
|
+
try { insertNode.run(n.id, n.label, n.name, n.norm_label, n.file_path, n.start_line, n.end_line, n.language); } catch {}
|
|
322
|
+
}
|
|
323
|
+
for (const e of edges) { try { insertEdge.run(e.id, e.src, e.dst, e.rel); } catch {} }
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
const normTitle = t => t.toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_|_$/g, '');
|
|
327
|
+
|
|
328
|
+
let totalSections = 0;
|
|
329
|
+
let skipped = 0;
|
|
330
|
+
for (const filePath of docFiles) {
|
|
331
|
+
let content;
|
|
332
|
+
try { content = readFileSync(filePath, 'utf-8'); } catch { continue; }
|
|
333
|
+
|
|
334
|
+
// Skip unchanged files using file cache
|
|
335
|
+
let isCached = false;
|
|
336
|
+
let contentHash = '';
|
|
337
|
+
try {
|
|
338
|
+
contentHash = hashFileContent(content);
|
|
339
|
+
isCached = isFileCached(db, filePath, contentHash);
|
|
340
|
+
} catch {}
|
|
341
|
+
if (isCached) { skipped++; continue; }
|
|
342
|
+
const relPath = path.relative(d, filePath);
|
|
343
|
+
const ext = path.extname(filePath).slice(1).toLowerCase();
|
|
344
|
+
const fileId = 'doc:' + relPath;
|
|
345
|
+
const lineCount = content.split('\n').length;
|
|
346
|
+
|
|
347
|
+
const nodes = [{ id: fileId, label: 'File', name: relPath, norm_label: normTitle(relPath), file_path: relPath, start_line: 1, end_line: lineCount, language: ext }];
|
|
348
|
+
const edges = [];
|
|
349
|
+
const lines = content.split('\n');
|
|
350
|
+
const sectionStack = [{ id: fileId, depth: 0 }];
|
|
351
|
+
let inCodeBlock = false;
|
|
352
|
+
let codeBlockLang = null;
|
|
353
|
+
|
|
354
|
+
for (let i = 0; i < lines.length; i++) {
|
|
355
|
+
const line = lines[i];
|
|
356
|
+
|
|
357
|
+
// Track fenced code blocks — don't parse headings inside them
|
|
358
|
+
const fenceMatch = line.match(/^```([a-zA-Z0-9_+-]*)$/);
|
|
359
|
+
if (fenceMatch) {
|
|
360
|
+
if (!inCodeBlock) {
|
|
361
|
+
inCodeBlock = true;
|
|
362
|
+
codeBlockLang = fenceMatch[1].trim() || null;
|
|
363
|
+
if (codeBlockLang) {
|
|
364
|
+
const cId = 'concept:lang:' + codeBlockLang.toLowerCase();
|
|
365
|
+
if (!nodes.find(n => n.id === cId)) {
|
|
366
|
+
nodes.push({ id: cId, label: 'Concept', name: codeBlockLang, norm_label: normTitle(codeBlockLang), file_path: null, start_line: 0, end_line: 0, language: null });
|
|
367
|
+
}
|
|
368
|
+
const curSec = sectionStack[sectionStack.length - 1].id;
|
|
369
|
+
edges.push({ id: 'e:' + curSec + ':' + cId + ':code', src: curSec, dst: cId, rel: 'TAGGED_AS' });
|
|
370
|
+
}
|
|
371
|
+
} else { inCodeBlock = false; codeBlockLang = null; }
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
if (inCodeBlock) continue;
|
|
375
|
+
|
|
376
|
+
// ATX headings: # Title
|
|
377
|
+
const hMatch = line.match(/^(#{1,6})\s+(.+)/);
|
|
378
|
+
if (hMatch) {
|
|
379
|
+
const depth = hMatch[1].length;
|
|
380
|
+
const title = hMatch[2].trim().replace(/\s+#+\s*$/, '').trim();
|
|
381
|
+
const secId = 'sec:' + relPath + ':' + (i + 1);
|
|
382
|
+
nodes.push({ id: secId, label: 'Section', name: title, norm_label: normTitle(title), file_path: relPath, start_line: i + 1, end_line: i + 1, language: ext });
|
|
383
|
+
totalSections++;
|
|
384
|
+
while (sectionStack.length > 1 && sectionStack[sectionStack.length - 1].depth >= depth) sectionStack.pop();
|
|
385
|
+
const parentId = sectionStack[sectionStack.length - 1].id;
|
|
386
|
+
edges.push({ id: 'e:' + secId + ':' + parentId + ':parent', src: parentId, dst: secId, rel: 'DEFINES' });
|
|
387
|
+
sectionStack.push({ id: secId, depth });
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// RST-style headings: line followed by ===, ---, ~~~, ^^^, etc.
|
|
392
|
+
if (i + 1 < lines.length && lines[i + 1].match(/^[=\-~^"'`#*+!]{3,}\s*$/) && line.trim().length > 0 && line.trim().length <= lines[i + 1].trim().length + 2) {
|
|
393
|
+
const underlineChar = lines[i + 1].trim()[0];
|
|
394
|
+
const rstDepth = '=-~^"\'`#*+!'.indexOf(underlineChar) + 1 || 3;
|
|
395
|
+
const title = line.trim();
|
|
396
|
+
const secId = 'sec:' + relPath + ':' + (i + 1);
|
|
397
|
+
nodes.push({ id: secId, label: 'Section', name: title, norm_label: normTitle(title), file_path: relPath, start_line: i + 1, end_line: i + 1, language: ext });
|
|
398
|
+
totalSections++;
|
|
399
|
+
const depth = Math.min(6, Math.ceil(rstDepth / 2));
|
|
400
|
+
while (sectionStack.length > 1 && sectionStack[sectionStack.length - 1].depth >= depth) sectionStack.pop();
|
|
401
|
+
const parentId = sectionStack[sectionStack.length - 1].id;
|
|
402
|
+
edges.push({ id: 'e:' + secId + ':' + parentId + ':parent', src: parentId, dst: secId, rel: 'DEFINES' });
|
|
403
|
+
sectionStack.push({ id: secId, depth });
|
|
404
|
+
i++; // skip underline line
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// #hashtag concepts (skip markdown headings already matched)
|
|
409
|
+
const tags = line.match(/#([a-zA-Z][a-zA-Z0-9_-]{2,})/g);
|
|
410
|
+
if (tags) {
|
|
411
|
+
for (const tag of tags) {
|
|
412
|
+
const concept = tag.slice(1);
|
|
413
|
+
const cId = 'concept:tag:' + concept.toLowerCase();
|
|
414
|
+
if (!nodes.find(n => n.id === cId)) {
|
|
415
|
+
nodes.push({ id: cId, label: 'Concept', name: concept, norm_label: normTitle(concept), file_path: null, start_line: 0, end_line: 0, language: null });
|
|
416
|
+
}
|
|
417
|
+
const curSec = sectionStack[sectionStack.length - 1].id;
|
|
418
|
+
edges.push({ id: 'e:' + curSec + ':' + cId + ':tag', src: curSec, dst: cId, rel: 'TAGGED_AS' });
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
try {
|
|
424
|
+
insertAll(nodes, edges);
|
|
425
|
+
// Update file cache so we skip unchanged files next run
|
|
426
|
+
try {
|
|
427
|
+
updateFileCache(db, { filePath, contentHash, lastParsed: Date.now(), nodeCount: nodes.length, edgeCount: edges.length });
|
|
428
|
+
} catch {}
|
|
429
|
+
} catch (e) { console.error('[docs-build] error inserting', relPath, e.message); }
|
|
430
|
+
}
|
|
431
|
+
console.log(`[docs-build] indexed ${docFiles.length - skipped} docs (${skipped} cached), ${totalSections} sections → ${dbPath}`);
|
|
432
|
+
ctx.buildDocsState.set(d, { status: 'done', sections: totalSections, files: docFiles.length - skipped, cached: skipped, error: null, startedAt, completedAt: Date.now() });
|
|
433
|
+
} finally { closeDb(db); }
|
|
434
|
+
})().catch(e => {
|
|
435
|
+
console.error('[docs-build] fatal:', e.message);
|
|
436
|
+
ctx.buildDocsState.set(d, { status: 'error', sections: 0, files: 0, error: e.message, startedAt, completedAt: Date.now() });
|
|
437
|
+
});
|
|
438
|
+
} catch (err) {
|
|
439
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
440
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
441
|
+
}
|
|
442
|
+
return true;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// -------------------------------------------------- GET /api/monograph-content
|
|
446
|
+
// Returns actual file content for a node (properties.content or file slice)
|
|
447
|
+
if (req.method === 'GET' && url === '/api/monograph-content') {
|
|
448
|
+
try {
|
|
449
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
450
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
451
|
+
const id = qs.get('id') || '';
|
|
452
|
+
const d = path.resolve(dir || process.cwd());
|
|
453
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
454
|
+
if (!id) { res.writeHead(400); res.end(JSON.stringify({ error: 'Missing ?id=' })); return true; }
|
|
455
|
+
if (!fs.existsSync(dbPath)) { res.writeHead(404); res.end(JSON.stringify({ error: 'Graph not built' })); return true; }
|
|
456
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
457
|
+
const db = openDb(dbPath);
|
|
458
|
+
let content = '', filePath = '', startLine = 0, endLine = 0, language = '', name = '', type = '';
|
|
459
|
+
try {
|
|
460
|
+
const node = db.prepare('SELECT * FROM nodes WHERE id=?').get(id);
|
|
461
|
+
if (!node) { res.writeHead(404); res.end(JSON.stringify({ error: 'Node not found' })); return true; }
|
|
462
|
+
name = node.name || id;
|
|
463
|
+
type = node.label || 'Unknown';
|
|
464
|
+
filePath = node.file_path || '';
|
|
465
|
+
startLine = node.start_line || 0;
|
|
466
|
+
endLine = node.end_line || 0;
|
|
467
|
+
language = node.language || '';
|
|
468
|
+
// Try properties.content first (from official monograph pipeline)
|
|
469
|
+
if (node.properties) {
|
|
470
|
+
try {
|
|
471
|
+
const props = JSON.parse(node.properties);
|
|
472
|
+
if (props.content && props.content.trim()) { content = props.content; }
|
|
473
|
+
} catch {}
|
|
474
|
+
}
|
|
475
|
+
// Fallback: read from actual file
|
|
476
|
+
if (!content && filePath) {
|
|
477
|
+
const absPath = path.isAbsolute(filePath) ? filePath : path.join(d, filePath);
|
|
478
|
+
try {
|
|
479
|
+
const lines = fs.readFileSync(absPath, 'utf-8').split('\n');
|
|
480
|
+
const sl = Math.max(0, (startLine || 1) - 1);
|
|
481
|
+
const el = Math.min(lines.length, (endLine || startLine || lines.length) + 5);
|
|
482
|
+
content = lines.slice(sl, Math.min(el, sl + 120)).join('\n');
|
|
483
|
+
} catch {}
|
|
484
|
+
}
|
|
485
|
+
} finally { closeDb(db); }
|
|
486
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
487
|
+
res.end(JSON.stringify({ content, filePath, startLine, endLine, language, name, type }));
|
|
488
|
+
} catch (err) {
|
|
489
|
+
res.writeHead(500); res.end(JSON.stringify({ error: err.message }));
|
|
490
|
+
}
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// -------------------------------------------------- GET /api/monograph-fts
|
|
495
|
+
// Full-text search with content snippets — powers the wiki search box
|
|
496
|
+
if (req.method === 'GET' && url === '/api/monograph-fts') {
|
|
497
|
+
try {
|
|
498
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
499
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
500
|
+
// Cap ?q= to prevent DoS via megabyte FTS query strings.
|
|
501
|
+
const q = (qs.get('q') || '').trim().slice(0, 4096);
|
|
502
|
+
const limit = Math.min(100, parseInt(qs.get('limit') || '50', 10));
|
|
503
|
+
const d = path.resolve(dir || process.cwd());
|
|
504
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
505
|
+
if (!q) { res.writeHead(400); res.end(JSON.stringify({ error: 'Missing ?q=' })); return true; }
|
|
506
|
+
if (!fs.existsSync(dbPath)) { res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) }); res.end(JSON.stringify({ nodes: [] })); return true; }
|
|
507
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
508
|
+
const { ftsSearch } = await import(new URL('../../../../monograph/dist/src/storage/fts-store.js', import.meta.url).href);
|
|
509
|
+
const db = openDb(dbPath);
|
|
510
|
+
let nodes = [];
|
|
511
|
+
try {
|
|
512
|
+
const hits = ftsSearch(db, q, limit);
|
|
513
|
+
nodes = hits.map(h => {
|
|
514
|
+
let snippet = '';
|
|
515
|
+
if (h.properties) { try { const p = JSON.parse(h.properties); snippet = (p.content || '').slice(0, 200); } catch {} }
|
|
516
|
+
return { id: h.id, label: h.name, type: h.label, degree: 0, filePath: h.filePath || h.file_path, startLine: h.startLine || h.start_line, snippet };
|
|
517
|
+
});
|
|
518
|
+
} finally { closeDb(db); }
|
|
519
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
520
|
+
res.end(JSON.stringify({ nodes }));
|
|
521
|
+
} catch (err) {
|
|
522
|
+
res.writeHead(500); res.end(JSON.stringify({ error: err.message }));
|
|
523
|
+
}
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// -------------------------------------------------- GET /api/monograph-related
|
|
528
|
+
// BFS from a node — returns node IDs sorted by graph distance (for re-ranking)
|
|
529
|
+
if (req.method === 'GET' && url === '/api/monograph-related') {
|
|
530
|
+
try {
|
|
531
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
532
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
533
|
+
const id = qs.get('id') || '';
|
|
534
|
+
const limit = Math.min(200, parseInt(qs.get('limit') || '60', 10));
|
|
535
|
+
const maxDepth = Math.min(4, parseInt(qs.get('depth') || '3', 10));
|
|
536
|
+
const d = path.resolve(dir || process.cwd());
|
|
537
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
538
|
+
if (!id || !fs.existsSync(dbPath)) { res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) }); res.end(JSON.stringify({ related: [] })); return true; }
|
|
539
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
540
|
+
const db = openDb(dbPath);
|
|
541
|
+
const related = [];
|
|
542
|
+
try {
|
|
543
|
+
const visited = new Set([id]);
|
|
544
|
+
let frontier = [id];
|
|
545
|
+
for (let depth = 1; depth <= maxDepth && frontier.length > 0 && related.length < limit; depth++) {
|
|
546
|
+
const next = [];
|
|
547
|
+
for (const nodeId of frontier) {
|
|
548
|
+
const rows = db.prepare(`SELECT DISTINCT target_id as nid FROM edges WHERE source_id=? UNION SELECT DISTINCT source_id as nid FROM edges WHERE target_id=? LIMIT 30`).all(nodeId, nodeId);
|
|
549
|
+
for (const r of rows) {
|
|
550
|
+
if (!visited.has(r.nid)) {
|
|
551
|
+
visited.add(r.nid);
|
|
552
|
+
next.push(r.nid);
|
|
553
|
+
related.push({ id: r.nid, distance: depth });
|
|
554
|
+
if (related.length >= limit) break;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (related.length >= limit) break;
|
|
558
|
+
}
|
|
559
|
+
frontier = next;
|
|
560
|
+
}
|
|
561
|
+
} finally { closeDb(db); }
|
|
562
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
563
|
+
res.end(JSON.stringify({ related }));
|
|
564
|
+
} catch (err) {
|
|
565
|
+
res.writeHead(500); res.end(JSON.stringify({ error: err.message }));
|
|
566
|
+
}
|
|
567
|
+
return true;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// -------------------------------------------------- GET /api/monograph-ai-context
|
|
571
|
+
// Builds a rich AI context bundle for a node: content + 1-hop neighbors
|
|
572
|
+
if (req.method === 'GET' && url === '/api/monograph-ai-context') {
|
|
573
|
+
try {
|
|
574
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
575
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
576
|
+
const id = qs.get('id') || '';
|
|
577
|
+
const d = path.resolve(dir || process.cwd());
|
|
578
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
579
|
+
if (!id || !fs.existsSync(dbPath)) { res.writeHead(404); res.end(JSON.stringify({ error: 'Not found' })); return true; }
|
|
580
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
581
|
+
const db = openDb(dbPath);
|
|
582
|
+
let result = { node: null, content: '', neighbors: [], markdown: '' };
|
|
583
|
+
try {
|
|
584
|
+
const node = db.prepare('SELECT * FROM nodes WHERE id=?').get(id);
|
|
585
|
+
if (!node) { res.writeHead(404); res.end(JSON.stringify({ error: 'Node not found' })); return true; }
|
|
586
|
+
result.node = { id: node.id, name: node.name, type: node.label, filePath: node.file_path, startLine: node.start_line, endLine: node.end_line };
|
|
587
|
+
// Get content
|
|
588
|
+
let content = '';
|
|
589
|
+
if (node.properties) { try { const p = JSON.parse(node.properties); content = p.content || ''; } catch {} }
|
|
590
|
+
if (!content && node.file_path) {
|
|
591
|
+
const absPath = path.isAbsolute(node.file_path) ? node.file_path : path.join(d, node.file_path);
|
|
592
|
+
try {
|
|
593
|
+
const lines = fs.readFileSync(absPath, 'utf-8').split('\n');
|
|
594
|
+
const sl = Math.max(0, (node.start_line || 1) - 1);
|
|
595
|
+
const el = Math.min(lines.length, (node.end_line || node.start_line || lines.length) + 5);
|
|
596
|
+
content = lines.slice(sl, Math.min(el, sl + 80)).join('\n');
|
|
597
|
+
} catch {}
|
|
598
|
+
}
|
|
599
|
+
result.content = content;
|
|
600
|
+
// Get 1-hop neighbors
|
|
601
|
+
const outEdges = db.prepare('SELECT e.relation, n.id, n.name, n.label, n.file_path FROM edges e JOIN nodes n ON n.id=e.target_id WHERE e.source_id=? LIMIT 20').all(id);
|
|
602
|
+
const inEdges = db.prepare('SELECT e.relation, n.id, n.name, n.label, n.file_path FROM edges e JOIN nodes n ON n.id=e.source_id WHERE e.target_id=? LIMIT 20').all(id);
|
|
603
|
+
result.neighbors = [
|
|
604
|
+
...outEdges.map(e => ({ direction: 'out', relation: e.relation, id: e.id, name: e.name, type: e.label, filePath: e.file_path })),
|
|
605
|
+
...inEdges.map(e => ({ direction: 'in', relation: e.relation, id: e.id, name: e.name, type: e.label, filePath: e.file_path })),
|
|
606
|
+
];
|
|
607
|
+
// Build markdown for clipboard/AI
|
|
608
|
+
const lines2 = [];
|
|
609
|
+
lines2.push(`# ${node.name} [${node.label}]`);
|
|
610
|
+
if (node.file_path) lines2.push(`**File:** \`${node.file_path}\`${node.start_line ? ` (line ${node.start_line})` : ''}`);
|
|
611
|
+
if (content) lines2.push(`\n\`\`\`${node.language || ''}\n${content.slice(0, 3000)}\n\`\`\``);
|
|
612
|
+
if (outEdges.length) {
|
|
613
|
+
lines2.push(`\n**Depends on (${outEdges.length}):**`);
|
|
614
|
+
outEdges.forEach(e => lines2.push(`- ${e.relation} → ${e.name} [${e.label}]${e.file_path ? ' `' + e.file_path + '`' : ''}`));
|
|
615
|
+
}
|
|
616
|
+
if (inEdges.length) {
|
|
617
|
+
lines2.push(`\n**Used by (${inEdges.length}):**`);
|
|
618
|
+
inEdges.forEach(e => lines2.push(`- ${e.relation} ← ${e.name} [${e.label}]${e.file_path ? ' `' + e.file_path + '`' : ''}`));
|
|
619
|
+
}
|
|
620
|
+
result.markdown = lines2.join('\n');
|
|
621
|
+
} finally { closeDb(db); }
|
|
622
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
623
|
+
res.end(JSON.stringify(result));
|
|
624
|
+
} catch (err) {
|
|
625
|
+
res.writeHead(500); res.end(JSON.stringify({ error: err.message }));
|
|
626
|
+
}
|
|
627
|
+
return true;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// -------------------------------------------------- GET /api/monograph-query
|
|
631
|
+
if (req.method === 'GET' && url === '/api/monograph-query') {
|
|
632
|
+
try {
|
|
633
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
634
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
635
|
+
const q = (qs.get('q') || '').trim().slice(0, 4096);
|
|
636
|
+
const d = path.resolve(dir || process.cwd());
|
|
637
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
638
|
+
if (!q) { res.writeHead(400); res.end(JSON.stringify({ error: 'Missing ?q= parameter' })); return true; }
|
|
639
|
+
if (!fs.existsSync(dbPath)) { res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) }); res.end(JSON.stringify({ success: false, result: 'Graph not built yet. Run: monomind monograph build' })); return true; }
|
|
640
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
641
|
+
const { ftsSearch } = await import(new URL('../../../../monograph/dist/src/storage/fts-store.js', import.meta.url).href);
|
|
642
|
+
const db = openDb(dbPath);
|
|
643
|
+
let result = '';
|
|
644
|
+
try {
|
|
645
|
+
const hits = ftsSearch(db, q, 20);
|
|
646
|
+
if (!hits.length) {
|
|
647
|
+
result = `No matches found for: "${q}"`;
|
|
648
|
+
} else {
|
|
649
|
+
result = hits.map((h, i) => `${String(i+1).padStart(3,' ')}. ${h.name} [${h.normLabel}]${h.filePath ? '\n ' + h.filePath : ''}`).join('\n');
|
|
650
|
+
// Show outgoing edges for top hit
|
|
651
|
+
const topHit = hits[0];
|
|
652
|
+
const neighbors = db.prepare('SELECT target_id, relation FROM edges WHERE source_id=? LIMIT 10').all(topHit.id);
|
|
653
|
+
if (neighbors.length) {
|
|
654
|
+
result += `\n\n── ${topHit.name} references:\n` + neighbors.map(n => ` ${n.relation} → ${n.target_id.split('/').pop() || n.target_id}`).join('\n');
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
} finally { closeDb(db); }
|
|
658
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
659
|
+
res.end(JSON.stringify({ success: true, query: q, result }));
|
|
660
|
+
} catch (err) {
|
|
661
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
662
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
663
|
+
}
|
|
664
|
+
return true;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// -------------------------------------------------- GET /api/monograph-explain
|
|
668
|
+
if (req.method === 'GET' && url === '/api/monograph-explain') {
|
|
669
|
+
try {
|
|
670
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
671
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
672
|
+
const nodeQ = (qs.get('node') || '').trim().slice(0, 4096);
|
|
673
|
+
const d = path.resolve(dir || process.cwd());
|
|
674
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
675
|
+
if (!nodeQ) { res.writeHead(400); res.end(JSON.stringify({ error: 'Missing ?node= parameter' })); return true; }
|
|
676
|
+
if (!fs.existsSync(dbPath)) { res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) }); res.end(JSON.stringify({ success: false, explanation: 'Graph not built yet. Run: monomind monograph build' })); return true; }
|
|
677
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
678
|
+
const { ftsSearch } = await import(new URL('../../../../monograph/dist/src/storage/fts-store.js', import.meta.url).href);
|
|
679
|
+
const db = openDb(dbPath);
|
|
680
|
+
let explanation = '';
|
|
681
|
+
try {
|
|
682
|
+
let nd = db.prepare('SELECT * FROM nodes WHERE id=?').get(nodeQ) || db.prepare('SELECT * FROM nodes WHERE name=?').get(nodeQ);
|
|
683
|
+
if (!nd) { const hits = ftsSearch(db, nodeQ, 1); if (hits[0]) nd = db.prepare('SELECT * FROM nodes WHERE id=?').get(hits[0].id); }
|
|
684
|
+
if (!nd) {
|
|
685
|
+
explanation = `No node found matching: "${nodeQ}"`;
|
|
686
|
+
} else {
|
|
687
|
+
const outEdges = db.prepare('SELECT target_id, relation FROM edges WHERE source_id=? LIMIT 20').all(nd.id);
|
|
688
|
+
const inEdges = db.prepare('SELECT source_id, relation FROM edges WHERE target_id=? LIMIT 20').all(nd.id);
|
|
689
|
+
explanation = [
|
|
690
|
+
`## ${nd.name} [${nd.label}]`,
|
|
691
|
+
nd.file_path ? `File: ${nd.file_path}${nd.start_line ? ':' + nd.start_line : ''}` : '',
|
|
692
|
+
nd.language ? `Language: ${nd.language}` : '',
|
|
693
|
+
nd.is_exported ? 'Exported: yes' : 'Exported: no',
|
|
694
|
+
'',
|
|
695
|
+
outEdges.length ? `References (${outEdges.length}):\n` + outEdges.map(e => ` ${e.relation} → ${e.target_id.split('/').pop() || e.target_id}`).join('\n') : 'No outgoing references.',
|
|
696
|
+
inEdges.length ? `\nReferenced by (${inEdges.length}):\n` + inEdges.map(e => ` ${e.source_id.split('/').pop() || e.source_id} [${e.relation}]`).join('\n') : '',
|
|
697
|
+
].filter(Boolean).join('\n');
|
|
698
|
+
}
|
|
699
|
+
} finally { closeDb(db); }
|
|
700
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
701
|
+
res.end(JSON.stringify({ success: true, node: nodeQ, explanation }));
|
|
702
|
+
} catch (err) {
|
|
703
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
704
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
705
|
+
}
|
|
706
|
+
return true;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
// -------------------------------------------------- GET /api/monograph-path
|
|
710
|
+
if (req.method === 'GET' && url === '/api/monograph-path') {
|
|
711
|
+
try {
|
|
712
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
713
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
714
|
+
const from = (qs.get('from') || '').trim().slice(0, 4096);
|
|
715
|
+
const to = (qs.get('to') || '').trim().slice(0, 4096);
|
|
716
|
+
const d = path.resolve(dir || process.cwd());
|
|
717
|
+
const dbPath = path.join(d, '.monomind', 'monograph.db');
|
|
718
|
+
if (!from || !to) { res.writeHead(400); res.end(JSON.stringify({ error: 'Missing ?from= and ?to= parameters' })); return true; }
|
|
719
|
+
if (!fs.existsSync(dbPath)) { res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) }); res.end(JSON.stringify({ success: false, path: 'Graph not built yet.' })); return true; }
|
|
720
|
+
// Import only graphology-free storage modules to avoid broken graphology dep
|
|
721
|
+
const { openDb, closeDb } = await import(new URL('../../../../monograph/dist/src/storage/db.js', import.meta.url).href);
|
|
722
|
+
const { ftsSearch } = await import(new URL('../../../../monograph/dist/src/storage/fts-store.js', import.meta.url).href);
|
|
723
|
+
// SQL-based BFS for shortest path (avoids graphology)
|
|
724
|
+
const getShortestPath = (db, fromId, toId, maxDepth = 6) => {
|
|
725
|
+
if (fromId === toId) return [fromId];
|
|
726
|
+
const visited = new Set([fromId]);
|
|
727
|
+
let frontier = [[fromId]];
|
|
728
|
+
for (let depth = 0; depth < maxDepth; depth++) {
|
|
729
|
+
const next = [];
|
|
730
|
+
for (const chain of frontier) {
|
|
731
|
+
const cur = chain[chain.length - 1];
|
|
732
|
+
const neighbors = db.prepare('SELECT target_id AS id FROM edges WHERE source_id=? UNION SELECT source_id AS id FROM edges WHERE target_id=?').all(cur, cur);
|
|
733
|
+
for (const { id } of neighbors) {
|
|
734
|
+
if (!visited.has(id)) {
|
|
735
|
+
const newChain = [...chain, id];
|
|
736
|
+
if (id === toId) return newChain;
|
|
737
|
+
visited.add(id);
|
|
738
|
+
next.push(newChain);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
if (!next.length) break;
|
|
743
|
+
frontier = next;
|
|
744
|
+
}
|
|
745
|
+
return null;
|
|
746
|
+
};
|
|
747
|
+
const db = openDb(dbPath);
|
|
748
|
+
let pathResult = '';
|
|
749
|
+
try {
|
|
750
|
+
const resolveId = (q) => {
|
|
751
|
+
const direct = db.prepare('SELECT id FROM nodes WHERE id=? OR name=?').get(q, q);
|
|
752
|
+
if (direct) return direct.id;
|
|
753
|
+
const hits = ftsSearch(db, q, 1);
|
|
754
|
+
return hits[0]?.id || q;
|
|
755
|
+
};
|
|
756
|
+
const fromId = resolveId(from);
|
|
757
|
+
const toId = resolveId(to);
|
|
758
|
+
const p = getShortestPath(db, fromId, toId);
|
|
759
|
+
if (!p || !p.length) {
|
|
760
|
+
pathResult = `No path found between "${from}" and "${to}"`;
|
|
761
|
+
} else {
|
|
762
|
+
const names = p.map(id => { const n = db.prepare('SELECT name FROM nodes WHERE id=?').get(id); return n ? n.name : id.split('/').pop() || id; });
|
|
763
|
+
pathResult = names.join(' → ') + ` (${p.length - 1} hop${p.length !== 2 ? 's' : ''})`;
|
|
764
|
+
}
|
|
765
|
+
} finally { closeDb(db); }
|
|
766
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
767
|
+
res.end(JSON.stringify({ success: true, from, to, path: pathResult }));
|
|
768
|
+
} catch (err) {
|
|
769
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
770
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
771
|
+
}
|
|
772
|
+
return true;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// -------------------------------------------------- GET /api/monograph-watch-status
|
|
776
|
+
if (req.method === 'GET' && url === '/api/monograph-watch-status') {
|
|
777
|
+
try {
|
|
778
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
779
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
780
|
+
const d = path.resolve(dir || process.cwd());
|
|
781
|
+
let running = false, pid = null;
|
|
782
|
+
for (const pidName of ['monograph.watch.pid', 'monograph-watch.pid']) {
|
|
783
|
+
try {
|
|
784
|
+
const pp = path.join(d, '.monomind', pidName);
|
|
785
|
+
pid = parseInt(fs.readFileSync(pp, 'utf-8').trim(), 10);
|
|
786
|
+
process.kill(pid, 0);
|
|
787
|
+
if (!ctx.looksLikeOurProcess(pid, d)) continue;
|
|
788
|
+
running = true;
|
|
789
|
+
break;
|
|
790
|
+
} catch {}
|
|
791
|
+
}
|
|
792
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
793
|
+
res.end(JSON.stringify({ running, pid }));
|
|
794
|
+
} catch (err) {
|
|
795
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
796
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
797
|
+
}
|
|
798
|
+
return true;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// -------------------------------------------------- POST /api/monograph-watch-toggle
|
|
802
|
+
if (req.method === 'POST' && url === '/api/monograph-watch-toggle') {
|
|
803
|
+
try {
|
|
804
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
805
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
806
|
+
const d = path.resolve(dir || process.cwd());
|
|
807
|
+
const pidPath = path.join(d, '.monomind', 'monograph.watch.pid');
|
|
808
|
+
let wasRunning = false;
|
|
809
|
+
for (const pidName of ['monograph.watch.pid', 'monograph-watch.pid']) {
|
|
810
|
+
try {
|
|
811
|
+
const pp = path.join(d, '.monomind', pidName);
|
|
812
|
+
const pid = parseInt(fs.readFileSync(pp, 'utf-8').trim(), 10);
|
|
813
|
+
process.kill(pid, 0);
|
|
814
|
+
if (!ctx.looksLikeOurProcess(pid, d)) continue;
|
|
815
|
+
wasRunning = true;
|
|
816
|
+
process.kill(pid, 'SIGTERM');
|
|
817
|
+
try { fs.unlinkSync(pp); } catch {}
|
|
818
|
+
} catch {}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
if (wasRunning) {
|
|
822
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
823
|
+
res.end(JSON.stringify({ running: false, action: 'stopped' }));
|
|
824
|
+
} else {
|
|
825
|
+
const { spawn: sp } = await import('child_process');
|
|
826
|
+
const child = sp(process.execPath, [process.argv[1], 'monograph', 'watch'], { stdio: 'ignore', detached: true, cwd: d, env: process.env });
|
|
827
|
+
child.unref();
|
|
828
|
+
try { fs.mkdirSync(path.join(d, '.monomind'), { recursive: true }); } catch {}
|
|
829
|
+
try { fs.writeFileSync(pidPath, String(child.pid)); } catch {}
|
|
830
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
831
|
+
res.end(JSON.stringify({ running: true, pid: child.pid, action: 'started' }));
|
|
832
|
+
}
|
|
833
|
+
} catch (err) {
|
|
834
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
835
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
836
|
+
}
|
|
837
|
+
return true;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// -------------------------------------------------- GET /api/monograph-benchmark
|
|
841
|
+
if (req.method === 'GET' && url === '/api/monograph-benchmark') {
|
|
842
|
+
try {
|
|
843
|
+
const qs = new URL(req.url, 'http://localhost').searchParams;
|
|
844
|
+
const dir = qs.get('dir') || ctx.projectDir || process.cwd();
|
|
845
|
+
const d = path.resolve(dir || process.cwd());
|
|
846
|
+
const graphPath = path.join(d, '.monomind', 'graph', 'graph.json');
|
|
847
|
+
const legacyPath = path.join(d, 'graphify-out', 'graph.json');
|
|
848
|
+
const gp = fs.existsSync(graphPath) ? graphPath : (fs.existsSync(legacyPath) ? legacyPath : null);
|
|
849
|
+
|
|
850
|
+
if (!gp) {
|
|
851
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
852
|
+
res.end(JSON.stringify({ available: false }));
|
|
853
|
+
return true;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
const { execSync: ex } = await import('child_process');
|
|
857
|
+
const out = ex(`graphify benchmark ${gp}`, { encoding: 'utf8', cwd: d, timeout: 30000, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
858
|
+
res.writeHead(200, { 'Content-Type': 'application/json', ...(corsOrigin ? { 'Access-Control-Allow-Origin': corsOrigin } : {}) });
|
|
859
|
+
res.end(JSON.stringify({ available: true, result: out }));
|
|
860
|
+
} catch (err) {
|
|
861
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
862
|
+
res.end(JSON.stringify({ error: err.message }));
|
|
863
|
+
}
|
|
864
|
+
return true;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// Reads .monomind/monograph.db via sqlite3 CLI to avoid bundling better-sqlite3.
|
|
868
|
+
if (req.method === 'GET' && url === '/api/monograph') {
|
|
869
|
+
try {
|
|
870
|
+
const dbPath = path.join(ctx.projectDir || process.cwd(), '.monomind', 'monograph.db');
|
|
871
|
+
if (!fs.existsSync(dbPath)) {
|
|
872
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
873
|
+
res.end(JSON.stringify({ exists: false }));
|
|
874
|
+
return true;
|
|
875
|
+
}
|
|
876
|
+
const { execFileSync } = await import('child_process');
|
|
877
|
+
// Pipe SQL via stdin to avoid shell quoting issues with single-quoted SQL strings.
|
|
878
|
+
const runSql = (sql, timeout = 5000) => {
|
|
879
|
+
try {
|
|
880
|
+
return execFileSync('sqlite3', ['-json', dbPath],
|
|
881
|
+
{ encoding: 'utf-8', timeout: timeout, input: sql + ';' });
|
|
882
|
+
} catch (e) { return '[]'; }
|
|
883
|
+
};
|
|
884
|
+
const counts = JSON.parse(runSql(
|
|
885
|
+
"SELECT (SELECT COUNT(*) FROM nodes) AS nodes, (SELECT COUNT(*) FROM edges) AS edges;"
|
|
886
|
+
) || '[{}]')[0] || { nodes: 0, edges: 0 };
|
|
887
|
+
// Compute degree in one pass via GROUP BY (much faster than per-row subquery).
|
|
888
|
+
const gods = JSON.parse(runSql(
|
|
889
|
+
"WITH deg(node_id, d) AS (" +
|
|
890
|
+
" SELECT source_id, COUNT(*) FROM edges GROUP BY source_id " +
|
|
891
|
+
" UNION ALL " +
|
|
892
|
+
" SELECT target_id, COUNT(*) FROM edges GROUP BY target_id" +
|
|
893
|
+
"), totals AS (" +
|
|
894
|
+
" SELECT node_id, SUM(d) AS deg FROM deg GROUP BY node_id" +
|
|
895
|
+
") " +
|
|
896
|
+
"SELECT n.name, n.label, n.file_path, t.deg " +
|
|
897
|
+
"FROM nodes n JOIN totals t ON t.node_id = n.id " +
|
|
898
|
+
"WHERE n.label NOT IN ('Concept') " +
|
|
899
|
+
"AND n.file_path IS NOT NULL AND n.file_path != '' " +
|
|
900
|
+
"AND n.name NOT LIKE '(%' AND length(n.name) >= 3 " +
|
|
901
|
+
"ORDER BY t.deg DESC LIMIT 20",
|
|
902
|
+
10000
|
|
903
|
+
) || '[]');
|
|
904
|
+
const types = JSON.parse(runSql(
|
|
905
|
+
"SELECT label, COUNT(*) AS count FROM nodes GROUP BY label ORDER BY count DESC LIMIT 12"
|
|
906
|
+
) || '[]');
|
|
907
|
+
const relations = JSON.parse(runSql(
|
|
908
|
+
"SELECT relation, COUNT(*) AS count FROM edges GROUP BY relation ORDER BY count DESC"
|
|
909
|
+
) || '[]');
|
|
910
|
+
|
|
911
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
912
|
+
res.end(JSON.stringify({
|
|
913
|
+
exists: true,
|
|
914
|
+
nodes: counts.nodes,
|
|
915
|
+
edges: counts.edges,
|
|
916
|
+
godNodes: gods,
|
|
917
|
+
typeDistribution: types,
|
|
918
|
+
relationDistribution: relations,
|
|
919
|
+
updatedAt: (() => { try { return fs.statSync(dbPath).mtime; } catch { return null; } })(),
|
|
920
|
+
}));
|
|
921
|
+
} catch (err) {
|
|
922
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
923
|
+
res.end(JSON.stringify({ exists: true, nodes: 0, edges: 0, godNodes: [], typeDistribution: [], relationDistribution: [], error: String(err) }));
|
|
924
|
+
}
|
|
925
|
+
return true;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return false;
|
|
929
|
+
}
|