@monoes/monomindcli 2.9.12 → 2.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (594) hide show
  1. package/.claude/agents/architecture/system-design/arch-system-design.md +0 -0
  2. package/.claude/agents/consensus/crdt-synchronizer.md +0 -0
  3. package/.claude/agents/consensus/quorum-manager.md +0 -0
  4. package/.claude/agents/consensus/security-manager.md +0 -0
  5. package/.claude/agents/core/coder.md +0 -0
  6. package/.claude/agents/core/coordinator.md +0 -0
  7. package/.claude/agents/core/planner.md +0 -0
  8. package/.claude/agents/core/researcher.md +0 -0
  9. package/.claude/agents/core/reviewer.md +0 -0
  10. package/.claude/agents/core/tester.md +0 -0
  11. package/.claude/agents/design/design-monodesign.md +0 -0
  12. package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +0 -0
  13. package/.claude/agents/engineering/engineering-ai-engineer.md +0 -0
  14. package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -0
  15. package/.claude/agents/engineering/engineering-backend-architect.md +0 -0
  16. package/.claude/agents/engineering/engineering-code-reviewer.md +0 -0
  17. package/.claude/agents/engineering/engineering-data-engineer.md +0 -0
  18. package/.claude/agents/engineering/engineering-database-optimizer.md +0 -0
  19. package/.claude/agents/engineering/engineering-devops-automator.md +0 -0
  20. package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +0 -0
  21. package/.claude/agents/engineering/engineering-feishu-integration-developer.md +0 -0
  22. package/.claude/agents/engineering/engineering-frontend-developer.md +0 -0
  23. package/.claude/agents/engineering/engineering-git-workflow-master.md +0 -0
  24. package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -0
  25. package/.claude/agents/engineering/engineering-mobile-app-builder.md +0 -0
  26. package/.claude/agents/engineering/engineering-rapid-prototyper.md +0 -0
  27. package/.claude/agents/engineering/engineering-security-engineer.md +0 -0
  28. package/.claude/agents/engineering/engineering-senior-developer.md +0 -0
  29. package/.claude/agents/engineering/engineering-software-architect.md +0 -0
  30. package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +0 -0
  31. package/.claude/agents/engineering/engineering-sre.md +0 -0
  32. package/.claude/agents/engineering/engineering-technical-writer.md +0 -0
  33. package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -0
  34. package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +0 -0
  35. package/.claude/agents/github/code-review-swarm.md +0 -0
  36. package/.claude/agents/github/github-modes.md +0 -0
  37. package/.claude/agents/github/issue-tracker.md +0 -0
  38. package/.claude/agents/github/multi-repo-swarm.md +0 -0
  39. package/.claude/agents/github/pr-manager.md +0 -0
  40. package/.claude/agents/github/project-board-sync.md +0 -0
  41. package/.claude/agents/github/release-manager.md +0 -0
  42. package/.claude/agents/github/repo-architect.md +0 -0
  43. package/.claude/agents/github/swarm-issue.md +0 -0
  44. package/.claude/agents/github/swarm-pr.md +0 -0
  45. package/.claude/agents/github/sync-coordinator.md +0 -0
  46. package/.claude/agents/github/workflow-automation.md +0 -0
  47. package/.claude/agents/goal/goal-planner.md +0 -0
  48. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -0
  49. package/.claude/agents/hive-mind/scout-explorer.md +0 -0
  50. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -0
  51. package/.claude/agents/hive-mind/worker-specialist.md +0 -0
  52. package/.claude/agents/marketing/marketing-competitive-content.md +0 -0
  53. package/.claude/agents/marketing/marketing-cro-specialist.md +0 -0
  54. package/.claude/agents/marketing/marketing-email-specialist.md +0 -0
  55. package/.claude/agents/marketing/marketing-launch-strategist.md +0 -0
  56. package/.claude/agents/marketing/marketing-pricing-strategist.md +0 -0
  57. package/.claude/agents/optimization/benchmark-suite.md +0 -0
  58. package/.claude/agents/optimization/load-balancer.md +0 -0
  59. package/.claude/agents/optimization/performance-monitor.md +0 -0
  60. package/.claude/agents/optimization/resource-allocator.md +0 -0
  61. package/.claude/agents/optimization/topology-optimizer.md +0 -0
  62. package/.claude/agents/schemas/architecture-output.json +0 -0
  63. package/.claude/agents/schemas/code-review-output.json +0 -0
  64. package/.claude/agents/schemas/generic-task-input.json +0 -0
  65. package/.claude/agents/schemas/implementation-output.json +0 -0
  66. package/.claude/agents/schemas/research-output.json +0 -0
  67. package/.claude/agents/schemas/security-audit-output.json +0 -0
  68. package/.claude/agents/schemas/test-report-output.json +0 -0
  69. package/.claude/agents/specialists/integration-architect.md +0 -0
  70. package/.claude/agents/specialized/agentic-identity-trust.md +0 -0
  71. package/.claude/agents/specialized/agents-orchestrator.md +0 -0
  72. package/.claude/agents/specialized/automation-governance-architect.md +0 -0
  73. package/.claude/agents/specialized/blockchain-security-auditor.md +0 -0
  74. package/.claude/agents/specialized/compliance-auditor.md +0 -0
  75. package/.claude/agents/specialized/identity-graph-operator.md +0 -0
  76. package/.claude/agents/specialized/lsp-index-engineer.md +0 -0
  77. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -0
  78. package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -0
  79. package/.claude/agents/specialized/specialized-developer-advocate.md +0 -0
  80. package/.claude/agents/specialized/specialized-document-generator.md +0 -0
  81. package/.claude/agents/specialized/specialized-mcp-builder.md +0 -0
  82. package/.claude/agents/specialized/specialized-model-qa.md +0 -0
  83. package/.claude/agents/specialized/specialized-workflow-architect.md +0 -0
  84. package/.claude/agents/specialized/zk-steward.md +0 -0
  85. package/.claude/agents/swarm/mesh-coordinator.md +0 -0
  86. package/.claude/agents/templates/automation-smart-agent.md +0 -0
  87. package/.claude/agents/templates/coordinator-swarm-init.md +0 -0
  88. package/.claude/agents/testing/production-validator.md +0 -0
  89. package/.claude/agents/testing/tdd-london-swarm.md +0 -0
  90. package/.claude/agents/testing/testing-accessibility-auditor.md +0 -0
  91. package/.claude/agents/testing/testing-api-tester.md +0 -0
  92. package/.claude/agents/testing/testing-evidence-collector.md +0 -0
  93. package/.claude/agents/testing/testing-performance-benchmarker.md +0 -0
  94. package/.claude/agents/testing/testing-test-results-analyzer.md +0 -0
  95. package/.claude/agents/testing/testing-tool-evaluator.md +0 -0
  96. package/.claude/agents/testing/testing-workflow-optimizer.md +0 -0
  97. package/.claude/commands/agents/README.md +0 -0
  98. package/.claude/commands/agents/agent-capabilities.md +0 -0
  99. package/.claude/commands/agents/agent-coordination.md +0 -0
  100. package/.claude/commands/agents/agent-spawning.md +0 -0
  101. package/.claude/commands/agents/agent-types.md +0 -0
  102. package/.claude/commands/analysis/README.md +0 -0
  103. package/.claude/commands/analysis/bottleneck-detect.md +0 -0
  104. package/.claude/commands/analysis/performance-bottlenecks.md +0 -0
  105. package/.claude/commands/analysis/performance-report.md +0 -0
  106. package/.claude/commands/analysis/token-usage.md +0 -0
  107. package/.claude/commands/automation/README.md +0 -0
  108. package/.claude/commands/automation/auto-agent.md +0 -0
  109. package/.claude/commands/automation/self-healing.md +0 -0
  110. package/.claude/commands/automation/session-memory.md +0 -0
  111. package/.claude/commands/automation/smart-agents.md +0 -0
  112. package/.claude/commands/automation/smart-spawn.md +0 -0
  113. package/.claude/commands/automation/workflow-select.md +0 -0
  114. package/.claude/commands/coordination/README.md +0 -0
  115. package/.claude/commands/coordination/agent-spawn.md +0 -0
  116. package/.claude/commands/coordination/swarm-init.md +0 -0
  117. package/.claude/commands/coordination/task-orchestrate.md +0 -0
  118. package/.claude/commands/github/README.md +0 -0
  119. package/.claude/commands/github/github-modes.md +0 -0
  120. package/.claude/commands/github/issue-tracker.md +0 -0
  121. package/.claude/commands/github/pr-manager.md +0 -0
  122. package/.claude/commands/github/release-manager.md +0 -0
  123. package/.claude/commands/github/repo-architect.md +0 -0
  124. package/.claude/commands/github/sync-coordinator.md +0 -0
  125. package/.claude/commands/hive-mind/README.md +0 -0
  126. package/.claude/commands/hive-mind/hive-mind-consensus.md +0 -0
  127. package/.claude/commands/hive-mind/hive-mind-init.md +0 -0
  128. package/.claude/commands/hive-mind/hive-mind-memory.md +0 -0
  129. package/.claude/commands/hive-mind/hive-mind-spawn.md +0 -0
  130. package/.claude/commands/hive-mind/hive-mind-status.md +0 -0
  131. package/.claude/commands/hive-mind/hive-mind-stop.md +0 -0
  132. package/.claude/commands/hive-mind/hive-mind.md +0 -0
  133. package/.claude/commands/hooks/overview.md +0 -0
  134. package/.claude/commands/hooks/post-edit.md +0 -0
  135. package/.claude/commands/hooks/post-task.md +0 -0
  136. package/.claude/commands/hooks/pre-edit.md +0 -0
  137. package/.claude/commands/hooks/pre-task.md +0 -0
  138. package/.claude/commands/hooks/session-end.md +0 -0
  139. package/.claude/commands/hooks/setup.md +0 -0
  140. package/.claude/commands/mastermind/_repeat.md +0 -0
  141. package/.claude/commands/mastermind/_taskfile.md +0 -0
  142. package/.claude/commands/mastermind/adr.md +0 -0
  143. package/.claude/commands/mastermind/brain.md +0 -0
  144. package/.claude/commands/mastermind/budget.md +0 -0
  145. package/.claude/commands/mastermind/code-review.md +0 -0
  146. package/.claude/commands/mastermind/content.md +0 -0
  147. package/.claude/commands/mastermind/createorg.md +0 -0
  148. package/.claude/commands/mastermind/createtask.md +0 -0
  149. package/.claude/commands/mastermind/debug.md +0 -0
  150. package/.claude/commands/mastermind/design.md +0 -0
  151. package/.claude/commands/mastermind/do.md +0 -0
  152. package/.claude/commands/mastermind/execute.md +0 -0
  153. package/.claude/commands/mastermind/finance.md +0 -0
  154. package/.claude/commands/mastermind/graph-status.md +0 -0
  155. package/.claude/commands/mastermind/help.md +0 -0
  156. package/.claude/commands/mastermind/idea.md +0 -0
  157. package/.claude/commands/mastermind/ideate.md +0 -0
  158. package/.claude/commands/mastermind/improve.md +0 -0
  159. package/.claude/commands/mastermind/loops.md +0 -0
  160. package/.claude/commands/mastermind/marketing.md +0 -0
  161. package/.claude/commands/mastermind/master.md +0 -0
  162. package/.claude/commands/mastermind/memory.md +0 -0
  163. package/.claude/commands/mastermind/okf-export.md +0 -0
  164. package/.claude/commands/mastermind/okf-import.md +0 -0
  165. package/.claude/commands/mastermind/ops.md +0 -0
  166. package/.claude/commands/mastermind/orgs.md +0 -0
  167. package/.claude/commands/mastermind/orgstatus.md +0 -0
  168. package/.claude/commands/mastermind/plan.md +0 -0
  169. package/.claude/commands/mastermind/receive-review.md +0 -0
  170. package/.claude/commands/mastermind/references/antigravity-tools.md +0 -0
  171. package/.claude/commands/mastermind/references/claude-code-tools.md +0 -0
  172. package/.claude/commands/mastermind/references/codex-tools.md +0 -0
  173. package/.claude/commands/mastermind/references/copilot-tools.md +0 -0
  174. package/.claude/commands/mastermind/references/gemini-tools.md +0 -0
  175. package/.claude/commands/mastermind/references/pi-tools.md +0 -0
  176. package/.claude/commands/mastermind/release.md +0 -0
  177. package/.claude/commands/mastermind/repeat.md +0 -0
  178. package/.claude/commands/mastermind/research.md +0 -0
  179. package/.claude/commands/mastermind/review.md +0 -0
  180. package/.claude/commands/mastermind/runorg.md +0 -0
  181. package/.claude/commands/mastermind/sales.md +0 -0
  182. package/.claude/commands/mastermind/skill-builder.md +0 -0
  183. package/.claude/commands/mastermind/specialagents.md +0 -0
  184. package/.claude/commands/mastermind/stoporg.md +0 -0
  185. package/.claude/commands/mastermind/swarm.md +0 -0
  186. package/.claude/commands/mastermind/techport.md +0 -0
  187. package/.claude/commands/mastermind/topology.md +0 -0
  188. package/.claude/commands/mastermind/understand.md +0 -0
  189. package/.claude/commands/mastermind/worktree.md +0 -0
  190. package/.claude/commands/mastermind.md +0 -0
  191. package/.claude/commands/memory/memory-search.md +0 -0
  192. package/.claude/commands/monitoring/agent-metrics.md +0 -0
  193. package/.claude/commands/monitoring/agents.md +0 -0
  194. package/.claude/commands/monitoring/status.md +0 -0
  195. package/.claude/commands/monobrowse.md +0 -0
  196. package/.claude/commands/monoes/README.md +0 -0
  197. package/.claude/commands/monoes/install.md +0 -0
  198. package/.claude/commands/monoes/monoagent.md +0 -0
  199. package/.claude/commands/monoes/monoclip.md +0 -0
  200. package/.claude/commands/monoes/monotask.md +0 -0
  201. package/.claude/commands/monograph/README.md +0 -0
  202. package/.claude/commands/monograph/monograph-build.md +0 -0
  203. package/.claude/commands/monograph/monograph-search.md +0 -0
  204. package/.claude/commands/monograph/monograph-stats.md +0 -0
  205. package/.claude/commands/monograph/monograph-watch.md +0 -0
  206. package/.claude/commands/monograph/monograph-wiki.md +0 -0
  207. package/.claude/commands/optimization/auto-topology.md +0 -0
  208. package/.claude/commands/optimization/performance-optimize.md +0 -0
  209. package/.claude/commands/pair/README.md +0 -0
  210. package/.claude/commands/pair/examples.md +0 -0
  211. package/.claude/commands/pair/modes.md +0 -0
  212. package/.claude/commands/pair/session.md +0 -0
  213. package/.claude/commands/stream-chain/pipeline.md +0 -0
  214. package/.claude/commands/stream-chain/run.md +0 -0
  215. package/.claude/commands/swarm/README.md +0 -0
  216. package/.claude/commands/swarm/analysis.md +0 -0
  217. package/.claude/commands/swarm/development.md +0 -0
  218. package/.claude/commands/swarm/examples.md +0 -0
  219. package/.claude/commands/swarm/maintenance.md +0 -0
  220. package/.claude/commands/swarm/optimization.md +0 -0
  221. package/.claude/commands/swarm/research.md +0 -0
  222. package/.claude/commands/swarm/swarm.md +0 -0
  223. package/.claude/commands/swarm/testing.md +0 -0
  224. package/.claude/commands/tokens.md +0 -0
  225. package/.claude/commands/truth/start.md +0 -0
  226. package/.claude/commands/ts.md +0 -0
  227. package/.claude/commands/workflows/README.md +0 -0
  228. package/.claude/commands/workflows/development.md +0 -0
  229. package/.claude/commands/workflows/research.md +0 -0
  230. package/.claude/commands/workflows/workflow-create.md +0 -0
  231. package/.claude/commands/workflows/workflow-execute.md +0 -0
  232. package/.claude/commands/workflows/workflow-export.md +0 -0
  233. package/.claude/helpers/auto-memory-hook.mjs +0 -0
  234. package/.claude/helpers/build-skill-registry.cjs +0 -0
  235. package/.claude/helpers/control-start.cjs +187 -148
  236. package/.claude/helpers/control-stop.cjs +0 -0
  237. package/.claude/helpers/event-logger.cjs +0 -0
  238. package/.claude/helpers/graphify-freshen.cjs +0 -0
  239. package/.claude/helpers/handlers/adr-draft-handler.cjs +0 -0
  240. package/.claude/helpers/handlers/agent-start-handler.cjs +0 -0
  241. package/.claude/helpers/handlers/budget-status-handler.cjs +0 -0
  242. package/.claude/helpers/handlers/capture-handler.cjs +0 -0
  243. package/.claude/helpers/handlers/compact-handler.cjs +0 -0
  244. package/.claude/helpers/handlers/edit-handler.cjs +0 -0
  245. package/.claude/helpers/handlers/gates-handler.cjs +0 -0
  246. package/.claude/helpers/handlers/graph-status-handler.cjs +0 -0
  247. package/.claude/helpers/handlers/loops-status-handler.cjs +0 -0
  248. package/.claude/helpers/handlers/stats-handler.cjs +0 -0
  249. package/.claude/helpers/handlers/task-handler.cjs +0 -0
  250. package/.claude/helpers/hook-handler.cjs +0 -0
  251. package/.claude/helpers/learning-service.mjs +0 -0
  252. package/.claude/helpers/loop-tracker.cjs +0 -0
  253. package/.claude/helpers/mastermind-activate.cjs +0 -0
  254. package/.claude/helpers/memory-palace.cjs +0 -0
  255. package/.claude/helpers/memory.cjs +0 -0
  256. package/.claude/helpers/metrics-db.mjs +0 -0
  257. package/.claude/helpers/monolean-activate.cjs +0 -0
  258. package/.claude/helpers/monolean-config.cjs +0 -0
  259. package/.claude/helpers/monolean-instructions.cjs +0 -0
  260. package/.claude/helpers/monolean-propagate.cjs +0 -0
  261. package/.claude/helpers/monolean-tracker.cjs +0 -0
  262. package/.claude/helpers/router.cjs +0 -0
  263. package/.claude/helpers/session.cjs +0 -0
  264. package/.claude/helpers/skill-registry.json +0 -0
  265. package/.claude/helpers/statusline.cjs +17 -4
  266. package/.claude/helpers/toggle-statusline.cjs +0 -0
  267. package/.claude/helpers/token-tracker.cjs +0 -0
  268. package/.claude/helpers/utils/agent-registrations.cjs +0 -0
  269. package/.claude/helpers/utils/fs-helpers.cjs +0 -0
  270. package/.claude/helpers/utils/micro-agents.cjs +0 -0
  271. package/.claude/helpers/utils/monograph.cjs +0 -0
  272. package/.claude/helpers/utils/system-pressure.cjs +0 -0
  273. package/.claude/helpers/utils/telemetry.cjs +0 -0
  274. package/.claude/settings.json +0 -0
  275. package/.claude/skills/agent-browser-testing/SKILL.md +0 -0
  276. package/.claude/skills/github-issue-triage/SKILL.md +0 -0
  277. package/.claude/skills/github-repo-recap/SKILL.md +0 -0
  278. package/.claude/skills/github-toolkit/SKILL.md +0 -0
  279. package/.claude/skills/mastermind-access/SKILL.md +0 -0
  280. package/.claude/skills/mastermind-activity/SKILL.md +0 -0
  281. package/.claude/skills/mastermind-adapter-manager/SKILL.md +0 -0
  282. package/.claude/skills/mastermind-agent-detail/SKILL.md +0 -0
  283. package/.claude/skills/mastermind-agent-select/SKILL.md +0 -0
  284. package/.claude/skills/mastermind-approval-detail/SKILL.md +0 -0
  285. package/.claude/skills/mastermind-budgets/SKILL.md +0 -0
  286. package/.claude/skills/mastermind-debug/SKILL.md +0 -0
  287. package/.claude/skills/mastermind-design/SKILL.md +0 -0
  288. package/.claude/skills/mastermind-diagnose/SKILL.md +0 -0
  289. package/.claude/skills/mastermind-env/SKILL.md +0 -0
  290. package/.claude/skills/mastermind-environments/SKILL.md +0 -0
  291. package/.claude/skills/mastermind-execute/SKILL.md +0 -0
  292. package/.claude/skills/mastermind-export/SKILL.md +0 -0
  293. package/.claude/skills/mastermind-goal-detail/SKILL.md +0 -0
  294. package/.claude/skills/mastermind-goals/SKILL.md +0 -0
  295. package/.claude/skills/mastermind-import/SKILL.md +0 -0
  296. package/.claude/skills/mastermind-inbox/SKILL.md +0 -0
  297. package/.claude/skills/mastermind-instance/SKILL.md +0 -0
  298. package/.claude/skills/mastermind-intake/SKILL.md +0 -0
  299. package/.claude/skills/mastermind-invite-landing/SKILL.md +0 -0
  300. package/.claude/skills/mastermind-invites/SKILL.md +0 -0
  301. package/.claude/skills/mastermind-issue-detail/SKILL.md +0 -0
  302. package/.claude/skills/mastermind-issues/SKILL.md +0 -0
  303. package/.claude/skills/mastermind-join-queue/SKILL.md +0 -0
  304. package/.claude/skills/mastermind-liveness/SKILL.md +0 -0
  305. package/.claude/skills/mastermind-memory/SKILL.md +0 -0
  306. package/.claude/skills/mastermind-monotask/SKILL.md +0 -0
  307. package/.claude/skills/mastermind-my-issues/SKILL.md +0 -0
  308. package/.claude/skills/mastermind-new-agent/SKILL.md +0 -0
  309. package/.claude/skills/mastermind-orgs/SKILL.md +0 -0
  310. package/.claude/skills/mastermind-orgstatus/SKILL.md +0 -0
  311. package/.claude/skills/mastermind-plan/SKILL.md +0 -0
  312. package/.claude/skills/mastermind-plan-to-tasks/SKILL.md +0 -0
  313. package/.claude/skills/mastermind-plugin-manager/SKILL.md +0 -0
  314. package/.claude/skills/mastermind-plugin-settings/SKILL.md +0 -0
  315. package/.claude/skills/mastermind-profile/SKILL.md +0 -0
  316. package/.claude/skills/mastermind-receive-review/SKILL.md +0 -0
  317. package/.claude/skills/mastermind-release/SKILL.md +0 -0
  318. package/.claude/skills/mastermind-research/SKILL.md +0 -0
  319. package/.claude/skills/mastermind-review/SKILL.md +0 -0
  320. package/.claude/skills/mastermind-routine-detail/SKILL.md +0 -0
  321. package/.claude/skills/mastermind-routines/SKILL.md +0 -0
  322. package/.claude/skills/mastermind-runorg/SKILL.md +0 -0
  323. package/.claude/skills/mastermind-search/SKILL.md +0 -0
  324. package/.claude/skills/mastermind-secrets/SKILL.md +0 -0
  325. package/.claude/skills/mastermind-skill-builder/SKILL.md +0 -0
  326. package/.claude/skills/mastermind-skills/SKILL.md +0 -0
  327. package/.claude/skills/mastermind-tasks/SKILL.md +0 -0
  328. package/.claude/skills/mastermind-techport/SKILL.md +0 -0
  329. package/.claude/skills/mastermind-threads/SKILL.md +0 -0
  330. package/.claude/skills/mastermind-tree-control/SKILL.md +0 -0
  331. package/.claude/skills/mastermind-workspace-detail/SKILL.md +0 -0
  332. package/.claude/skills/mastermind-workspaces/SKILL.md +0 -0
  333. package/.claude/skills/mastermind-worktree/SKILL.md +0 -0
  334. package/.claude/skills/memory-toolkit/SKILL.md +0 -0
  335. package/.claude/skills/monodesign/SKILL.md +0 -0
  336. package/.claude/skills/monodesign/adapt.md +0 -0
  337. package/.claude/skills/monodesign/animate.md +0 -0
  338. package/.claude/skills/monodesign/audit.md +0 -0
  339. package/.claude/skills/monodesign/bolder.md +0 -0
  340. package/.claude/skills/monodesign/clarify.md +0 -0
  341. package/.claude/skills/monodesign/colorize.md +0 -0
  342. package/.claude/skills/monodesign/craft.md +0 -0
  343. package/.claude/skills/monodesign/critique.md +0 -0
  344. package/.claude/skills/monodesign/delight.md +0 -0
  345. package/.claude/skills/monodesign/distill.md +0 -0
  346. package/.claude/skills/monodesign/document.md +0 -0
  347. package/.claude/skills/monodesign/extract.md +0 -0
  348. package/.claude/skills/monodesign/harden.md +0 -0
  349. package/.claude/skills/monodesign/init.md +0 -0
  350. package/.claude/skills/monodesign/layout.md +0 -0
  351. package/.claude/skills/monodesign/live.md +0 -0
  352. package/.claude/skills/monodesign/onboard.md +0 -0
  353. package/.claude/skills/monodesign/optimize.md +0 -0
  354. package/.claude/skills/monodesign/overdrive.md +0 -0
  355. package/.claude/skills/monodesign/polish.md +0 -0
  356. package/.claude/skills/monodesign/quieter.md +0 -0
  357. package/.claude/skills/monodesign/scripts/command-metadata.json +0 -0
  358. package/.claude/skills/monodesign/scripts/context-signals.mjs +0 -0
  359. package/.claude/skills/monodesign/scripts/context.mjs +0 -0
  360. package/.claude/skills/monodesign/scripts/critique-storage.mjs +0 -0
  361. package/.claude/skills/monodesign/scripts/detect-csp.mjs +0 -0
  362. package/.claude/skills/monodesign/scripts/detect.mjs +0 -0
  363. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +0 -0
  364. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +0 -0
  365. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +0 -0
  366. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +0 -0
  367. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +0 -0
  368. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +0 -0
  369. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +0 -0
  370. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +0 -0
  371. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +0 -0
  372. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -0
  373. package/.claude/skills/monodesign/scripts/detector/findings.mjs +0 -0
  374. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +0 -0
  375. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +0 -0
  376. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +0 -0
  377. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +0 -0
  378. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +0 -0
  379. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +0 -0
  380. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +0 -0
  381. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +0 -0
  382. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +0 -0
  383. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +0 -0
  384. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +0 -0
  385. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +0 -0
  386. package/.claude/skills/monodesign/scripts/hook-admin.mjs +0 -0
  387. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +0 -0
  388. package/.claude/skills/monodesign/scripts/hook-lib.mjs +0 -0
  389. package/.claude/skills/monodesign/scripts/hook.mjs +0 -0
  390. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +0 -0
  391. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +0 -0
  392. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +0 -0
  393. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +0 -0
  394. package/.claude/skills/monodesign/scripts/lib/provider.mjs +0 -0
  395. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +0 -0
  396. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +0 -0
  397. package/.claude/skills/monodesign/scripts/live/completion.mjs +0 -0
  398. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +0 -0
  399. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +0 -0
  400. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +0 -0
  401. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +0 -0
  402. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +0 -0
  403. package/.claude/skills/monodesign/scripts/live/session-store.mjs +0 -0
  404. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +0 -0
  405. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +0 -0
  406. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +0 -0
  407. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +0 -0
  408. package/.claude/skills/monodesign/scripts/live-accept.mjs +0 -0
  409. package/.claude/skills/monodesign/scripts/live-browser-dom.js +0 -0
  410. package/.claude/skills/monodesign/scripts/live-browser-session.js +0 -0
  411. package/.claude/skills/monodesign/scripts/live-browser.js +0 -0
  412. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +0 -0
  413. package/.claude/skills/monodesign/scripts/live-complete.mjs +0 -0
  414. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +0 -0
  415. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +0 -0
  416. package/.claude/skills/monodesign/scripts/live-inject.mjs +0 -0
  417. package/.claude/skills/monodesign/scripts/live-insert.mjs +0 -0
  418. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +0 -0
  419. package/.claude/skills/monodesign/scripts/live-poll.mjs +0 -0
  420. package/.claude/skills/monodesign/scripts/live-resume.mjs +0 -0
  421. package/.claude/skills/monodesign/scripts/live-server.mjs +0 -0
  422. package/.claude/skills/monodesign/scripts/live-status.mjs +0 -0
  423. package/.claude/skills/monodesign/scripts/live-target.mjs +0 -0
  424. package/.claude/skills/monodesign/scripts/live-wrap.mjs +0 -0
  425. package/.claude/skills/monodesign/scripts/live.mjs +0 -0
  426. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +0 -0
  427. package/.claude/skills/monodesign/scripts/palette.mjs +0 -0
  428. package/.claude/skills/monodesign/scripts/pin.mjs +0 -0
  429. package/.claude/skills/monodesign/shape.md +0 -0
  430. package/.claude/skills/monodesign/teach.md +0 -0
  431. package/.claude/skills/monodesign/typeset.md +0 -0
  432. package/.claude/skills/monolean/SKILL.md +0 -0
  433. package/.claude/skills/monolean-audit/SKILL.md +0 -0
  434. package/.claude/skills/monolean-debt/SKILL.md +0 -0
  435. package/.claude/skills/monolean-help/SKILL.md +0 -0
  436. package/.claude/skills/monomind/browse-agentcore.md +0 -0
  437. package/.claude/skills/monomind/browse-electron.md +0 -0
  438. package/.claude/skills/monomind/browse-qa.md +0 -0
  439. package/.claude/skills/monomind/browse-references/authentication.md +0 -0
  440. package/.claude/skills/monomind/browse-references/trust-boundaries.md +0 -0
  441. package/.claude/skills/monomind/browse-references/video-recording.md +0 -0
  442. package/.claude/skills/monomind/browse-slack.md +0 -0
  443. package/.claude/skills/monomind/browse-vercel.md +0 -0
  444. package/.claude/skills/monomind/browse.md +0 -0
  445. package/.claude/skills/monomotion/SKILL.md +0 -0
  446. package/.claude/skills/monomotion/rules/api-control.md +0 -0
  447. package/.claude/skills/monomotion/rules/effects.md +0 -0
  448. package/.claude/skills/monomotion/rules/integration.md +0 -0
  449. package/.claude/skills/monomotion/rules/scroll.md +0 -0
  450. package/.claude/skills/monomotion/rules/sequencing.md +0 -0
  451. package/.claude/skills/monomotion/rules/svg.md +0 -0
  452. package/.claude/skills/monomotion/rules/text.md +0 -0
  453. package/.claude/skills/skill-builder/SKILL.md +0 -0
  454. package/.claude/skills/stop-slop/SKILL.md +0 -0
  455. package/.claude/skills/stop-slop/references/examples.md +0 -0
  456. package/.claude/skills/stop-slop/references/phrases.md +0 -0
  457. package/.claude/skills/stop-slop/references/structures.md +0 -0
  458. package/bin/preinstall.cjs +0 -0
  459. package/dist/src/browser/dashboard/ui.html +0 -0
  460. package/dist/src/ui/dashboard.html +0 -0
  461. package/dist/src/ui/data/agent-avatars.html +0 -0
  462. package/dist/src/ui/data/avatars/account-strategist.svg +0 -0
  463. package/dist/src/ui/data/avatars/accounts-payable.svg +0 -0
  464. package/dist/src/ui/data/avatars/adaptive-coordinator.svg +0 -0
  465. package/dist/src/ui/data/avatars/adaptive-coordinator2.svg +0 -0
  466. package/dist/src/ui/data/avatars/ai-citation.svg +0 -0
  467. package/dist/src/ui/data/avatars/ai-engineer.svg +0 -0
  468. package/dist/src/ui/data/avatars/analytics-reporter.svg +0 -0
  469. package/dist/src/ui/data/avatars/api-tester.svg +0 -0
  470. package/dist/src/ui/data/avatars/architecture.svg +0 -0
  471. package/dist/src/ui/data/avatars/automation-governance.svg +0 -0
  472. package/dist/src/ui/data/avatars/backend-dev.svg +0 -0
  473. package/dist/src/ui/data/avatars/benchmarker.svg +0 -0
  474. package/dist/src/ui/data/avatars/blockchain-auditor.svg +0 -0
  475. package/dist/src/ui/data/avatars/byzantine-coord.svg +0 -0
  476. package/dist/src/ui/data/avatars/case-analyst.svg +0 -0
  477. package/dist/src/ui/data/avatars/cicd-engineer.svg +0 -0
  478. package/dist/src/ui/data/avatars/cloud-architect.svg +0 -0
  479. package/dist/src/ui/data/avatars/code-review-swarm.svg +0 -0
  480. package/dist/src/ui/data/avatars/coder-v119.svg +0 -0
  481. package/dist/src/ui/data/avatars/coder.svg +0 -0
  482. package/dist/src/ui/data/avatars/collective-coord.svg +0 -0
  483. package/dist/src/ui/data/avatars/compliance-auditor.svg +0 -0
  484. package/dist/src/ui/data/avatars/consensus-coordinator.svg +0 -0
  485. package/dist/src/ui/data/avatars/content-creator.svg +0 -0
  486. package/dist/src/ui/data/avatars/crdt-synchronizer.svg +0 -0
  487. package/dist/src/ui/data/avatars/cro-specialist.svg +0 -0
  488. package/dist/src/ui/data/avatars/data-consolidator.svg +0 -0
  489. package/dist/src/ui/data/avatars/data-engineer.svg +0 -0
  490. package/dist/src/ui/data/avatars/database-optimizer.svg +0 -0
  491. package/dist/src/ui/data/avatars/deal-strategist.svg +0 -0
  492. package/dist/src/ui/data/avatars/defender.svg +0 -0
  493. package/dist/src/ui/data/avatars/devops-automator.svg +0 -0
  494. package/dist/src/ui/data/avatars/discovery-coach.svg +0 -0
  495. package/dist/src/ui/data/avatars/email-marketing.svg +0 -0
  496. package/dist/src/ui/data/avatars/embedded-firmware.svg +0 -0
  497. package/dist/src/ui/data/avatars/evidence-collector.svg +0 -0
  498. package/dist/src/ui/data/avatars/experiment-tracker.svg +0 -0
  499. package/dist/src/ui/data/avatars/feedback-synthesizer.svg +0 -0
  500. package/dist/src/ui/data/avatars/finance-tracker.svg +0 -0
  501. package/dist/src/ui/data/avatars/frontend-developer.svg +0 -0
  502. package/dist/src/ui/data/avatars/game-audio-engineer.svg +0 -0
  503. package/dist/src/ui/data/avatars/game-designer.svg +0 -0
  504. package/dist/src/ui/data/avatars/gossip-coordinator.svg +0 -0
  505. package/dist/src/ui/data/avatars/hierarchical-coord.svg +0 -0
  506. package/dist/src/ui/data/avatars/incident-commander.svg +0 -0
  507. package/dist/src/ui/data/avatars/infrastructure.svg +0 -0
  508. package/dist/src/ui/data/avatars/input-validator.svg +0 -0
  509. package/dist/src/ui/data/avatars/ios-developer.svg +0 -0
  510. package/dist/src/ui/data/avatars/issue-tracker.svg +0 -0
  511. package/dist/src/ui/data/avatars/judge.svg +0 -0
  512. package/dist/src/ui/data/avatars/launch-strategist.svg +0 -0
  513. package/dist/src/ui/data/avatars/legal-compliance.svg +0 -0
  514. package/dist/src/ui/data/avatars/level-designer.svg +0 -0
  515. package/dist/src/ui/data/avatars/load-balancer.svg +0 -0
  516. package/dist/src/ui/data/avatars/mcp-builder.svg +0 -0
  517. package/dist/src/ui/data/avatars/memory-coordinator.svg +0 -0
  518. package/dist/src/ui/data/avatars/mesh-coordinator.svg +0 -0
  519. package/dist/src/ui/data/avatars/ml-developer.svg +0 -0
  520. package/dist/src/ui/data/avatars/mobile-app-builder.svg +0 -0
  521. package/dist/src/ui/data/avatars/mobile-dev.svg +0 -0
  522. package/dist/src/ui/data/avatars/model-qa.svg +0 -0
  523. package/dist/src/ui/data/avatars/narrative-designer.svg +0 -0
  524. package/dist/src/ui/data/avatars/outbound-strategist.svg +0 -0
  525. package/dist/src/ui/data/avatars/path-validator.svg +0 -0
  526. package/dist/src/ui/data/avatars/payment-agent.svg +0 -0
  527. package/dist/src/ui/data/avatars/perf-analyzer.svg +0 -0
  528. package/dist/src/ui/data/avatars/pipeline-analyst.svg +0 -0
  529. package/dist/src/ui/data/avatars/planner.svg +0 -0
  530. package/dist/src/ui/data/avatars/pr-manager.svg +0 -0
  531. package/dist/src/ui/data/avatars/pricing-strategist.svg +0 -0
  532. package/dist/src/ui/data/avatars/product-manager.svg +0 -0
  533. package/dist/src/ui/data/avatars/production-validator.svg +0 -0
  534. package/dist/src/ui/data/avatars/project-shepherd.svg +0 -0
  535. package/dist/src/ui/data/avatars/proposal-strategist.svg +0 -0
  536. package/dist/src/ui/data/avatars/prosecutor.svg +0 -0
  537. package/dist/src/ui/data/avatars/pseudocode.svg +0 -0
  538. package/dist/src/ui/data/avatars/queen-coordinator.svg +0 -0
  539. package/dist/src/ui/data/avatars/quorum-manager.svg +0 -0
  540. package/dist/src/ui/data/avatars/raft-manager.svg +0 -0
  541. package/dist/src/ui/data/avatars/reality-checker.svg +0 -0
  542. package/dist/src/ui/data/avatars/recruitment.svg +0 -0
  543. package/dist/src/ui/data/avatars/refinement.svg +0 -0
  544. package/dist/src/ui/data/avatars/release-manager.svg +0 -0
  545. package/dist/src/ui/data/avatars/repo-architect.svg +0 -0
  546. package/dist/src/ui/data/avatars/researcher.svg +0 -0
  547. package/dist/src/ui/data/avatars/resource-allocator.svg +0 -0
  548. package/dist/src/ui/data/avatars/reviewer.svg +0 -0
  549. package/dist/src/ui/data/avatars/safe-executor.svg +0 -0
  550. package/dist/src/ui/data/avatars/sales-coach.svg +0 -0
  551. package/dist/src/ui/data/avatars/sales-engineer.svg +0 -0
  552. package/dist/src/ui/data/avatars/scout-explorer.svg +0 -0
  553. package/dist/src/ui/data/avatars/security-architect.svg +0 -0
  554. package/dist/src/ui/data/avatars/security-auditor.svg +0 -0
  555. package/dist/src/ui/data/avatars/senior-developer.svg +0 -0
  556. package/dist/src/ui/data/avatars/senior-pm.svg +0 -0
  557. package/dist/src/ui/data/avatars/seo-specialist.svg +0 -0
  558. package/dist/src/ui/data/avatars/social-media.svg +0 -0
  559. package/dist/src/ui/data/avatars/solidity-engineer.svg +0 -0
  560. package/dist/src/ui/data/avatars/sparc-coder.svg +0 -0
  561. package/dist/src/ui/data/avatars/sparc-coord.svg +0 -0
  562. package/dist/src/ui/data/avatars/specification.svg +0 -0
  563. package/dist/src/ui/data/avatars/sprint-prioritizer.svg +0 -0
  564. package/dist/src/ui/data/avatars/sre.svg +0 -0
  565. package/dist/src/ui/data/avatars/studio-operations.svg +0 -0
  566. package/dist/src/ui/data/avatars/studio-producer.svg +0 -0
  567. package/dist/src/ui/data/avatars/support-responder.svg +0 -0
  568. package/dist/src/ui/data/avatars/system-architect.svg +0 -0
  569. package/dist/src/ui/data/avatars/task-orchestrator.svg +0 -0
  570. package/dist/src/ui/data/avatars/technical-artist.svg +0 -0
  571. package/dist/src/ui/data/avatars/technical-writer.svg +0 -0
  572. package/dist/src/ui/data/avatars/tester.svg +0 -0
  573. package/dist/src/ui/data/avatars/threat-detection.svg +0 -0
  574. package/dist/src/ui/data/avatars/trend-researcher.svg +0 -0
  575. package/dist/src/ui/data/avatars/trial-director.svg +0 -0
  576. package/dist/src/ui/data/avatars/unity-architect.svg +0 -0
  577. package/dist/src/ui/data/avatars/visionos-engineer.svg +0 -0
  578. package/dist/src/ui/data/avatars/worker-specialist.svg +0 -0
  579. package/dist/src/ui/data/avatars/workflow-architect.svg +0 -0
  580. package/dist/src/ui/data/avatars/workflow-automation.svg +0 -0
  581. package/dist/src/ui/data/avatars/zk-steward.svg +0 -0
  582. package/dist/src/ui/data/mastermind-sessions.json +0 -0
  583. package/dist/src/ui/mastermind-diagram-fallback.html +0 -0
  584. package/dist/src/ui/orgs.html +0 -0
  585. package/dist/src/ui/sse-manager.mjs +0 -0
  586. package/package.json +20 -19
  587. package/scripts/check-workspace-deps.mjs +0 -0
  588. package/scripts/deploy-ipfs-node.sh +0 -0
  589. package/scripts/download-embedding-model.mjs +0 -0
  590. package/scripts/publish.sh +0 -0
  591. package/scripts/setup-ipfs-registry.md +0 -0
  592. package/scripts/sync-claude-assets.sh +0 -0
  593. package/scripts/understand-analyze.mjs +0 -0
  594. package/LICENSE +0 -191
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -119,6 +119,29 @@ function probeStatus(p) {
119
119
  });
120
120
  }
121
121
 
122
+ // Resolves to the responder's pid (number), 'foreign-authwalled' for an
123
+ // auth-gated monomind server, null for unreadable, or false for "no answer".
124
+ function probePort(p) {
125
+ const http = require('http');
126
+ return new Promise((resolve) => {
127
+ const req = http.get({ hostname: 'localhost', port: p, path: '/api/status', timeout: 1000 }, (res) => {
128
+ let body = '';
129
+ res.on('data', (c) => { if (body.length < 4096) body += c; });
130
+ res.on('end', () => {
131
+ if (res.statusCode >= 500) return resolve(false);
132
+ try {
133
+ const parsed = JSON.parse(body);
134
+ if (typeof parsed.pid === 'number') return resolve(parsed.pid);
135
+ if (res.statusCode === 401 && parsed.error) return resolve('foreign-authwalled');
136
+ resolve(null);
137
+ } catch { resolve(null); }
138
+ });
139
+ });
140
+ req.on('error', () => resolve(false));
141
+ req.on('timeout', () => { req.destroy(); resolve(false); });
142
+ });
143
+ }
144
+
122
145
  const LOCK_FILE = path.join(CWD, '.monomind', 'control.lock');
123
146
 
124
147
  /**
@@ -144,6 +167,129 @@ function releaseSpawnLock() {
144
167
  releaseLock(LOCK_FILE);
145
168
  }
146
169
 
170
+ /**
171
+ * Confirms the spawned dashboard child actually bound a port, and updates
172
+ * control.json with the authoritative pid/port once it does.
173
+ *
174
+ * Runs in its own detached, fully independent process (see the
175
+ * MONOMIND_CONTROL_CONFIRM_MODE branch at the bottom of this file) — NOT
176
+ * inline inside the SessionStart-hook-invoked process. This can legitimately
177
+ * take up to HARD_CEILING_ATTEMPTS (~5 min: slow npx cold-resolve + AV/FS
178
+ * contention right after an install, #142) but the hook that spawns the
179
+ * dashboard is configured with a 5s timeout in settings.json — an inline
180
+ * await here would almost always get truncated by that hook timeout before
181
+ * ever reaching the slow paths #142/#143 were specifically added to
182
+ * tolerate, silently defeating those fixes and leaving control.json stuck on
183
+ * its pre-confirmation optimistic guess. Running this as a separate spawned
184
+ * process means the hook-invoked process can write the optimistic status and
185
+ * exit immediately (matching this file's own module docstring), while
186
+ * confirmation proceeds independently for as long as it legitimately needs.
187
+ */
188
+ async function runConfirm({ childPid, port: defaultPort, boundReportPath, isNpxFallback }) {
189
+ const CONFIRM_ATTEMPTS = isNpxFallback ? 60 : 20; // 500ms/attempt: 30s vs 10s
190
+ const HARD_CEILING_ATTEMPTS = 600; // 500ms/attempt: 5 min — see doc comment above
191
+ let sawForeignOnDefault = false;
192
+ let attempt = 0;
193
+ for (; attempt < HARD_CEILING_ATTEMPTS; attempt++) {
194
+ await new Promise(r => setTimeout(r, 500));
195
+ // Past the minimum grace period, a dead child means it's not coming
196
+ // back — stop waiting immediately instead of burning the rest of the
197
+ // budget. A LIVE child that simply hasn't reported yet keeps getting the
198
+ // benefit of the doubt up to HARD_CEILING_ATTEMPTS instead of being
199
+ // killed on a fixed guess.
200
+ if (attempt >= CONFIRM_ATTEMPTS && !isPidAlive(childPid)) break;
201
+ // 1) Authoritative: child self-reported its bound port. Identity comes
202
+ // from boundReportPath's own per-invocation-unique path (nothing else on
203
+ // the machine knows it, since it's only handed to this child via env),
204
+ // NOT a pid match: under shell:true (#141's Windows EINVAL fix), childPid
205
+ // is the wrapping cmd.exe's pid, not the real server's — rep.pid !==
206
+ // childPid always, so a pid comparison here can never succeed on the
207
+ // npx-fallback path regardless of how long we wait (#143). rep.pid is
208
+ // the real server pid — use it for control.json.
209
+ try {
210
+ const rep = JSON.parse(fs.readFileSync(boundReportPath, 'utf8'));
211
+ if (rep && typeof rep.pid === 'number' && typeof rep.port === 'number') {
212
+ try { fs.unlinkSync(boundReportPath); } catch { /* ignore */ }
213
+ writeStatus(rep.pid, rep.port);
214
+ if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] server bound to port ${rep.port} (pid ${rep.pid})\n`);
215
+ return;
216
+ }
217
+ } catch { /* not written yet or old server — fall through to probe */ }
218
+ // 2) Fallback: pid-matched HTTP probe (old servers without report support)
219
+ for (let delta = 0; delta <= 10; delta++) {
220
+ const p = defaultPort + delta;
221
+ const responderPid = await probePort(p);
222
+ if (responderPid === false) continue;
223
+ if (responderPid === childPid) {
224
+ if (p !== defaultPort) {
225
+ writeStatus(childPid, p);
226
+ if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] server bound to port ${p} (updated control.json)\n`);
227
+ }
228
+ return;
229
+ }
230
+ if (p === defaultPort && (typeof responderPid === 'number' || responderPid === 'foreign-authwalled')) {
231
+ sawForeignOnDefault = true;
232
+ }
233
+ // pid mismatch or unreadable — not provably ours, keep scanning
234
+ }
235
+ }
236
+ try { fs.unlinkSync(boundReportPath); } catch { /* ignore */ }
237
+ if (sawForeignOnDefault) {
238
+ // Another project's server owns defaultPort and our child never proved
239
+ // its own port — point control.json at the live server instead of lying,
240
+ // and kill our redundant child.
241
+ try { process.kill(childPid, 'SIGTERM'); } catch { /* already gone */ }
242
+ if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] port ${defaultPort} is served by another project's control server — reusing it (killed redundant child)\n`);
243
+ let foreignPid = await probePort(defaultPort);
244
+ if (typeof foreignPid !== 'number' || foreignPid <= 0) {
245
+ try {
246
+ const { execFileSync } = require('child_process');
247
+ const lsofOut = execFileSync('lsof', ['-ti', `:${defaultPort}`, '-sTCP:LISTEN'], { encoding: 'utf8', timeout: 3000 }).trim();
248
+ const parsedPid = parseInt(lsofOut.split('\n')[0], 10);
249
+ if (Number.isInteger(parsedPid) && parsedPid > 0) foreignPid = parsedPid;
250
+ } catch { /* ignore */ }
251
+ }
252
+ writeStatus(typeof foreignPid === 'number' ? foreignPid : 0, defaultPort);
253
+ // Pair with the foreign server: resolve its project dir from its pid,
254
+ // copy its dashboard-token beside OUR control.json (ingest is
255
+ // default-deny — without this every event from this project 401s
256
+ // silently), and self-register in its known-projects so future token
257
+ // rotations propagate back here on server restart.
258
+ try {
259
+ if (typeof foreignPid === 'number' && foreignPid > 0) {
260
+ const { execFileSync } = require('child_process');
261
+ const out = execFileSync('lsof', ['-a', '-p', String(foreignPid), '-d', 'cwd', '-Fn'], { encoding: 'utf8', timeout: 3000 });
262
+ const nLine = out.split('\n').find((l) => l.startsWith('n'));
263
+ const serverHome = nLine ? nLine.slice(1) : null;
264
+ if (serverHome) {
265
+ const srcTok = path.join(serverHome, '.monomind', 'dashboard-token');
266
+ const dstTok = path.join(CWD, '.monomind', 'dashboard-token');
267
+ if (fs.existsSync(srcTok)) {
268
+ fs.copyFileSync(srcTok, dstTok);
269
+ fs.chmodSync(dstTok, 0o600);
270
+ }
271
+ const kpFile = path.join(serverHome, 'data', 'known-projects.json');
272
+ try {
273
+ const kp = fs.existsSync(kpFile) ? JSON.parse(fs.readFileSync(kpFile, 'utf8')) : [];
274
+ if (Array.isArray(kp) && !kp.includes(CWD)) {
275
+ kp.push(CWD);
276
+ fs.writeFileSync(kpFile, JSON.stringify(kp));
277
+ }
278
+ } catch { /* registry unreadable — token copy alone still unblocks events */ }
279
+ process.stdout.write('[control] paired dashboard token and registered this project with the shared server\n');
280
+ }
281
+ }
282
+ } catch { /* pairing is best-effort; propagation-on-restart is the fallback */ }
283
+ return;
284
+ }
285
+ // Server never became reachable on any expected port — kill the child
286
+ // rather than leave an orphan bound to some port nothing will ever read.
287
+ // The next session-start simply retries.
288
+ try { process.kill(childPid, 'SIGTERM'); } catch { /* already gone */ }
289
+ try { fs.unlinkSync(STATUS_FILE); } catch { /* ignore */ }
290
+ process.stdout.write(`[control] server did not respond within ${((attempt + 1) * 500 / 1000).toFixed(1)} s — killed orphan, will retry next session\n`);
291
+ }
292
+
147
293
  async function main() {
148
294
  // Skip spawning when system memory is critically low
149
295
  try {
@@ -214,8 +360,8 @@ async function main() {
214
360
  // npx-fallback branch (cmd is 'npx'/'npx.cmd') pays npx's own first-time
215
361
  // package resolve into its `_npx` cache, measured at ~12s cold vs ~3s warm
216
362
  // (#142) — comfortably over the 10s budget every other branch needs.
363
+ // (Passed to the detached confirm process below — see runConfirm.)
217
364
  const isNpxFallback = cmd !== process.execPath;
218
- const CONFIRM_ATTEMPTS = isNpxFallback ? 60 : 20; // 500ms/attempt: 30s vs 10s
219
365
 
220
366
  // The child writes its ACTUAL bound port here — the only identity-proof
221
367
  // signal. An HTTP probe alone can be answered by another project's server
@@ -246,153 +392,46 @@ async function main() {
246
392
  writeStatus(child.pid, DEFAULT_PORT);
247
393
  if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] started Neural Control Room on port ${DEFAULT_PORT} (pid ${child.pid})\n`);
248
394
 
249
- // If port 4242 was in use, server.mjs auto-increments (up to +10).
250
- // Poll a few ports to find where it actually bound and update control.json.
251
- const http = require('http');
252
- // Resolves to the responder's pid (number), 'foreign-authwalled' for an
253
- // auth-gated monomind server, null for unreadable, or false for "no answer".
254
- function probePort(p) {
255
- return new Promise((resolve) => {
256
- const req = http.get({ hostname: 'localhost', port: p, path: '/api/status', timeout: 1000 }, (res) => {
257
- let body = '';
258
- res.on('data', (c) => { if (body.length < 4096) body += c; });
259
- res.on('end', () => {
260
- if (res.statusCode >= 500) return resolve(false);
261
- try {
262
- const parsed = JSON.parse(body);
263
- if (typeof parsed.pid === 'number') return resolve(parsed.pid);
264
- if (res.statusCode === 401 && parsed.error) return resolve('foreign-authwalled');
265
- resolve(null);
266
- } catch { resolve(null); }
267
- });
268
- });
269
- req.on('error', () => resolve(false));
270
- req.on('timeout', () => { req.destroy(); resolve(false); });
271
- });
272
- }
273
-
274
- // Give the server up to ~10 s to start, then confirm the actual port.
275
- // Identity-first: the child's bound-report file (written by server.mjs) is
276
- // authoritative; the HTTP probe only confirms a port when the responder's
277
- // pid matches our child. A foreign server answering on DEFAULT_PORT must
278
- // NOT be mistaken for ours — that lie misroutes every event emitter in
279
- // this project (root cause of orgs running invisibly).
280
- // Absolute safety net so a wedged-but-still-alive process can't hang this
281
- // hook forever — CONFIRM_ATTEMPTS below is a minimum grace period, not a
282
- // hard budget (#142 follow-up).
283
- const HARD_CEILING_ATTEMPTS = 600; // 500ms/attempt: 5 min
284
- async function confirmPort() {
285
- let sawForeignOnDefault = false;
286
- let attempt = 0;
287
- for (; attempt < HARD_CEILING_ATTEMPTS; attempt++) {
288
- await new Promise(r => setTimeout(r, 500));
289
- // Past the minimum grace period, a dead child means it's not coming
290
- // back — stop waiting immediately instead of burning the rest of the
291
- // budget. A LIVE child that simply hasn't reported yet (npm/AV
292
- // contention on a freshly-written node_modules right after install,
293
- // measured once at ~142s vs the normal ~5-9s — #142 follow-up) keeps
294
- // getting the benefit of the doubt up to HARD_CEILING_ATTEMPTS instead
295
- // of being killed on a fixed guess.
296
- if (attempt >= CONFIRM_ATTEMPTS && !isPidAlive(child.pid)) break;
297
- // 1) Authoritative: child self-reported its bound port. Identity comes
298
- // from BOUND_REPORT's own per-invocation-unique path (nothing else on
299
- // the machine knows it, since it's only handed to this child via env),
300
- // NOT a pid match: under shell:true (#141's Windows EINVAL fix),
301
- // child.pid is the wrapping cmd.exe's pid, not the real server's —
302
- // rep.pid !== child.pid always, so a pid comparison here can never
303
- // succeed on the npx-fallback path regardless of how long we wait
304
- // (#143). rep.pid is the real server pid — use it for control.json.
305
- try {
306
- const rep = JSON.parse(fs.readFileSync(BOUND_REPORT, 'utf8'));
307
- if (rep && typeof rep.pid === 'number' && typeof rep.port === 'number') {
308
- try { fs.unlinkSync(BOUND_REPORT); } catch { /* ignore */ }
309
- writeStatus(rep.pid, rep.port);
310
- if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] server bound to port ${rep.port} (pid ${rep.pid})\n`);
311
- return;
312
- }
313
- } catch { /* not written yet or old server — fall through to probe */ }
314
- // 2) Fallback: pid-matched HTTP probe (old servers without report support)
315
- for (let delta = 0; delta <= 10; delta++) {
316
- const p = DEFAULT_PORT + delta;
317
- const responderPid = await probePort(p);
318
- if (responderPid === false) continue;
319
- if (responderPid === child.pid) {
320
- if (p !== DEFAULT_PORT) {
321
- writeStatus(child.pid, p);
322
- if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] server bound to port ${p} (updated control.json)\n`);
323
- }
324
- return;
325
- }
326
- if (p === DEFAULT_PORT && (typeof responderPid === 'number' || responderPid === 'foreign-authwalled')) {
327
- sawForeignOnDefault = true;
328
- }
329
- // pid mismatch or unreadable — not provably ours, keep scanning
330
- }
331
- }
332
- try { fs.unlinkSync(BOUND_REPORT); } catch { /* ignore */ }
333
- if (sawForeignOnDefault) {
334
- // Another project's server owns DEFAULT_PORT and our child never proved
335
- // its own port — point control.json at the live server instead of lying,
336
- // and kill our redundant child.
337
- try { process.kill(child.pid, 'SIGTERM'); } catch { /* already gone */ }
338
- if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") process.stdout.write(`[control] port ${DEFAULT_PORT} is served by another project's control server — reusing it (killed redundant child)\n`);
339
- let foreignPid = await probePort(DEFAULT_PORT);
340
- if (typeof foreignPid !== 'number' || foreignPid <= 0) {
341
- try {
342
- const { execFileSync } = require('child_process');
343
- const lsofOut = execFileSync('lsof', ['-ti', `:${DEFAULT_PORT}`, '-sTCP:LISTEN'], { encoding: 'utf8', timeout: 3000 }).trim();
344
- const parsedPid = parseInt(lsofOut.split('\n')[0], 10);
345
- if (Number.isInteger(parsedPid) && parsedPid > 0) foreignPid = parsedPid;
346
- } catch { /* ignore */ }
347
- }
348
- writeStatus(typeof foreignPid === 'number' ? foreignPid : 0, DEFAULT_PORT);
349
- // Pair with the foreign server: resolve its project dir from its pid,
350
- // copy its dashboard-token beside OUR control.json (ingest is
351
- // default-deny — without this every event from this project 401s
352
- // silently), and self-register in its known-projects so future token
353
- // rotations propagate back here on server restart.
354
- try {
355
- if (typeof foreignPid === 'number' && foreignPid > 0) {
356
- const { execFileSync } = require('child_process');
357
- const out = execFileSync('lsof', ['-a', '-p', String(foreignPid), '-d', 'cwd', '-Fn'], { encoding: 'utf8', timeout: 3000 });
358
- const nLine = out.split('\n').find((l) => l.startsWith('n'));
359
- const serverHome = nLine ? nLine.slice(1) : null;
360
- if (serverHome) {
361
- const srcTok = path.join(serverHome, '.monomind', 'dashboard-token');
362
- const dstTok = path.join(CWD, '.monomind', 'dashboard-token');
363
- if (fs.existsSync(srcTok)) {
364
- fs.copyFileSync(srcTok, dstTok);
365
- fs.chmodSync(dstTok, 0o600);
366
- }
367
- const kpFile = path.join(serverHome, 'data', 'known-projects.json');
368
- try {
369
- const kp = fs.existsSync(kpFile) ? JSON.parse(fs.readFileSync(kpFile, 'utf8')) : [];
370
- if (Array.isArray(kp) && !kp.includes(CWD)) {
371
- kp.push(CWD);
372
- fs.writeFileSync(kpFile, JSON.stringify(kp));
373
- }
374
- } catch { /* registry unreadable — token copy alone still unblocks events */ }
375
- process.stdout.write('[control] paired dashboard token and registered this project with the shared server\n');
376
- }
377
- }
378
- } catch { /* pairing is best-effort; propagation-on-restart is the fallback */ }
379
- return;
380
- }
381
- // Server never became reachable on any expected port — kill the child
382
- // rather than leave an orphan bound to some port nothing will ever read.
383
- // The next session-start simply retries.
384
- try { process.kill(child.pid, 'SIGTERM'); } catch { /* already gone */ }
385
- try { fs.unlinkSync(STATUS_FILE); } catch { /* ignore */ }
386
- process.stdout.write(`[control] server did not respond within ${((attempt + 1) * 500 / 1000).toFixed(1)} s — killed orphan, will retry next session\n`);
387
- }
388
-
389
- confirmPort().catch(() => {}).finally(() => { releaseSpawnLock(); process.exit(0); });
390
- }
395
+ // Hand off confirmation to a fully independent detached process instead of
396
+ // awaiting it inline (see runConfirm's doc comment for why: the hook that
397
+ // invokes THIS process has only a 5s timeout, far short of what
398
+ // confirmation can legitimately need). This process's job — spawn the
399
+ // dashboard and report the optimistic status — is done; exit immediately.
400
+ const confirmChild = spawn(process.execPath, [__filename], {
401
+ detached: true,
402
+ stdio: 'ignore',
403
+ cwd: CWD,
404
+ env: {
405
+ ...process.env,
406
+ CLAUDE_PROJECT_DIR: CWD,
407
+ MONOMIND_CONTROL_CONFIRM_MODE: '1',
408
+ MONOMIND_CONTROL_CONFIRM_PID: String(child.pid),
409
+ MONOMIND_CONTROL_CONFIRM_PORT: String(DEFAULT_PORT),
410
+ MONOMIND_CONTROL_CONFIRM_REPORT: BOUND_REPORT,
411
+ MONOMIND_CONTROL_CONFIRM_NPX: isNpxFallback ? '1' : '0',
412
+ },
413
+ });
414
+ confirmChild.unref();
391
415
 
392
- main().catch((err) => {
393
- if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") {
394
- process.stderr.write(`[control] failed to start: ${err && err.message ? err.message : err}\n`);
395
- }
396
416
  releaseSpawnLock();
397
417
  process.exit(0);
398
- });
418
+ }
419
+
420
+ if (String(process.env.MONOMIND_CONTROL_CONFIRM_MODE || '') === '1') {
421
+ // Standalone confirmation process spawned by main() above — see runConfirm's
422
+ // doc comment. Not itself subject to the SessionStart hook's 5s timeout.
423
+ runConfirm({
424
+ childPid: Number(process.env.MONOMIND_CONTROL_CONFIRM_PID),
425
+ port: Number(process.env.MONOMIND_CONTROL_CONFIRM_PORT) || DEFAULT_PORT,
426
+ boundReportPath: process.env.MONOMIND_CONTROL_CONFIRM_REPORT,
427
+ isNpxFallback: process.env.MONOMIND_CONTROL_CONFIRM_NPX === '1',
428
+ }).catch(() => {}).finally(() => process.exit(0));
429
+ } else {
430
+ main().catch((err) => {
431
+ if (String(process.env.MONOMIND_HOOK_QUIET || "") !== "1") {
432
+ process.stderr.write(`[control] failed to start: ${err && err.message ? err.message : err}\n`);
433
+ }
434
+ releaseSpawnLock();
435
+ process.exit(0);
436
+ });
437
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -46,12 +46,25 @@ function getVersion() {
46
46
  }
47
47
  } catch { /* ignore */ }
48
48
  }
49
- // 2. Fallback: npm global prefix
49
+ // 2. Fallback: npm global prefix. Layout differs by platform — npm puts
50
+ // global packages directly under <prefix>/node_modules on Windows, but
51
+ // under <prefix>/lib/node_modules on macOS/Linux. Checking only the Unix
52
+ // shape meant this fallback silently failed on every Windows install,
53
+ // always landing on the hardcoded placeholder below regardless of the
54
+ // actual installed version.
50
55
  try {
51
56
  const { execSync } = require('child_process');
52
57
  const prefix = execSync('npm config get prefix', { encoding: 'utf-8', timeout: 2000 }).trim();
53
- const pkg = JSON.parse(fs.readFileSync(path.join(prefix, 'lib', 'node_modules', 'monomind', 'package.json'), 'utf-8'));
54
- if (pkg.version) return `v${pkg.version}`;
58
+ const prefixCandidates = [
59
+ path.join(prefix, 'node_modules', 'monomind', 'package.json'), // Windows
60
+ path.join(prefix, 'lib', 'node_modules', 'monomind', 'package.json'), // macOS/Linux
61
+ ];
62
+ for (const p of prefixCandidates) {
63
+ try {
64
+ const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
65
+ if (pkg.version) return `v${pkg.version}`;
66
+ } catch { /* try next candidate */ }
67
+ }
55
68
  } catch { /* ignore */ }
56
69
  return 'v1.0.6';
57
70
  }
@@ -1458,7 +1471,7 @@ function readMode() {
1458
1471
  // ─── Testability export (when required as a module, not run as CLI) ──────────
1459
1472
  if (require.main !== module) {
1460
1473
  module.exports = {
1461
- readJSON, safeStat, modelLabel,
1474
+ readJSON, safeStat, modelLabel, getVersion,
1462
1475
  getSecurityStatus, getSwarmStatus, getADRStatus,
1463
1476
  getHooksStatus, getActiveAgent, getLanceDBStats,
1464
1477
  getLearningStats, getTestStats, getIntegrationStatus,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes