agent-enderun 1.1.2 → 1.1.4

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 (533) hide show
  1. package/{.enderun/ENDERUN.md → ENDERUN.md} +25 -25
  2. package/README.md +10 -6
  3. package/bin/compile.js +13 -14
  4. package/bin/enderun-dashboard.js +866 -0
  5. package/bin/generate-cursor-rules.js +78 -0
  6. package/bin/test-init-run.js +37 -26
  7. package/bin/validate-agent-army.js +65 -67
  8. package/bin/watch-memory.js +54 -0
  9. package/dist/framework-mcp/src/index.js +1 -1
  10. package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +15 -0
  11. package/dist/framework-mcp/src/tools/control_plane/locking.js +65 -0
  12. package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -0
  13. package/dist/framework-mcp/src/tools/control_plane/registry.d.ts +12 -0
  14. package/dist/framework-mcp/src/tools/control_plane/registry.js +35 -0
  15. package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -0
  16. package/dist/framework-mcp/src/tools/definitions.js +46 -7
  17. package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
  18. package/dist/framework-mcp/src/tools/file_system/write_file.js +16 -2
  19. package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
  20. package/dist/framework-mcp/src/tools/index.d.ts +1 -1
  21. package/dist/framework-mcp/src/tools/index.js +5 -0
  22. package/dist/framework-mcp/src/tools/index.js.map +1 -1
  23. package/dist/framework-mcp/src/tools/messaging/send_message.d.ts +1 -1
  24. package/dist/framework-mcp/src/tools/messaging/send_message.js +2 -4
  25. package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
  26. package/dist/framework-mcp/src/utils/metrics.d.ts +10 -0
  27. package/dist/framework-mcp/src/utils/metrics.js +39 -0
  28. package/dist/framework-mcp/src/utils/metrics.js.map +1 -0
  29. package/dist/framework-mcp/src/utils/security.js +7 -3
  30. package/dist/framework-mcp/src/utils/security.js.map +1 -1
  31. package/dist/src/cli/adapters/types.d.ts +14 -0
  32. package/dist/src/cli/adapters/types.js +2 -0
  33. package/dist/src/cli/adapters/types.js.map +1 -0
  34. package/dist/src/cli/adapters.d.ts +4 -22
  35. package/dist/src/cli/adapters.js +123 -141
  36. package/dist/src/cli/adapters.js.map +1 -1
  37. package/dist/src/cli/commands/check.d.ts +0 -5
  38. package/dist/src/cli/commands/check.js +64 -76
  39. package/dist/src/cli/commands/check.js.map +1 -1
  40. package/dist/src/cli/commands/init.d.ts +1 -1
  41. package/dist/src/cli/commands/init.js +154 -319
  42. package/dist/src/cli/commands/init.js.map +1 -1
  43. package/dist/src/cli/commands/log.d.ts +1 -0
  44. package/dist/src/cli/commands/log.js.map +1 -1
  45. package/dist/src/cli/commands/memory.js +2 -69
  46. package/dist/src/cli/commands/memory.js.map +1 -1
  47. package/dist/src/cli/commands/orchestrate.d.ts +19 -9
  48. package/dist/src/cli/commands/orchestrate.js +56 -77
  49. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  50. package/dist/src/cli/index.js +112 -30
  51. package/dist/src/cli/index.js.map +1 -1
  52. package/dist/src/cli/utils/app.d.ts +1 -2
  53. package/dist/src/cli/utils/app.js +2 -2
  54. package/dist/src/cli/utils/app.js.map +1 -1
  55. package/dist/src/cli/utils/config-schema.d.ts +139 -0
  56. package/dist/src/cli/utils/config-schema.js +43 -0
  57. package/dist/src/cli/utils/config-schema.js.map +1 -0
  58. package/dist/src/cli/utils/fs.d.ts +2 -4
  59. package/dist/src/cli/utils/fs.js +9 -26
  60. package/dist/src/cli/utils/fs.js.map +1 -1
  61. package/dist/src/cli/utils/memory.d.ts +4 -3
  62. package/dist/src/cli/utils/memory.js +135 -116
  63. package/dist/src/cli/utils/memory.js.map +1 -1
  64. package/dist/src/cli/utils/pkg.js +4 -4
  65. package/dist/src/cli/utils/pkg.js.map +1 -1
  66. package/dist/src/cli/utils/ui.d.ts +30 -0
  67. package/dist/src/cli/utils/ui.js +56 -0
  68. package/dist/src/cli/utils/ui.js.map +1 -0
  69. package/dist/src/modules/adapters/antigravity-cli.d.ts +3 -0
  70. package/dist/src/modules/adapters/antigravity-cli.js +21 -0
  71. package/dist/src/modules/adapters/antigravity-cli.js.map +1 -0
  72. package/dist/src/modules/adapters/claude.d.ts +3 -0
  73. package/dist/src/modules/adapters/claude.js +36 -0
  74. package/dist/src/modules/adapters/claude.js.map +1 -0
  75. package/dist/src/modules/adapters/codex.d.ts +3 -0
  76. package/dist/src/modules/adapters/codex.js +20 -0
  77. package/dist/src/modules/adapters/codex.js.map +1 -0
  78. package/dist/src/modules/adapters/cursor.d.ts +3 -0
  79. package/dist/src/modules/adapters/cursor.js +20 -0
  80. package/dist/src/modules/adapters/cursor.js.map +1 -0
  81. package/dist/src/modules/adapters/gemini.d.ts +3 -0
  82. package/dist/src/modules/adapters/gemini.js +23 -0
  83. package/dist/src/modules/adapters/gemini.js.map +1 -0
  84. package/dist/src/modules/adapters/grok.d.ts +3 -0
  85. package/dist/src/modules/adapters/grok.js +18 -0
  86. package/dist/src/modules/adapters/grok.js.map +1 -0
  87. package/dist/src/modules/adapters/shared.d.ts +1 -0
  88. package/dist/src/modules/adapters/shared.js +79 -0
  89. package/dist/src/modules/adapters/shared.js.map +1 -0
  90. package/dist/src/modules/adapters/types.d.ts +14 -0
  91. package/dist/src/modules/adapters/types.js +2 -0
  92. package/dist/src/modules/adapters/types.js.map +1 -0
  93. package/dist/src/modules/agents/definitions.d.ts +13 -0
  94. package/dist/src/modules/agents/definitions.js +169 -0
  95. package/dist/src/modules/agents/definitions.js.map +1 -0
  96. package/dist/src/modules/skills/definitions.d.ts +31 -0
  97. package/dist/src/modules/skills/definitions.js +32 -0
  98. package/dist/src/modules/skills/definitions.js.map +1 -0
  99. package/dist/src/shared/fs.d.ts +3 -0
  100. package/dist/src/shared/fs.js +24 -0
  101. package/dist/src/shared/fs.js.map +1 -0
  102. package/eslint.config.js +1 -0
  103. package/framework-mcp/dist/index.js +1 -1
  104. package/framework-mcp/dist/tools/control_plane/locking.js +64 -0
  105. package/framework-mcp/dist/tools/control_plane/registry.js +34 -0
  106. package/framework-mcp/dist/tools/definitions.js +49 -8
  107. package/framework-mcp/dist/tools/file_system/read_file.js +20 -0
  108. package/framework-mcp/dist/tools/file_system/write_file.js +16 -2
  109. package/framework-mcp/dist/tools/index.js +5 -0
  110. package/framework-mcp/dist/tools/messaging/send_message.js +36 -15
  111. package/framework-mcp/dist/utils/metrics.js +38 -0
  112. package/framework-mcp/dist/utils/security.js +7 -3
  113. package/framework-mcp/package.json +1 -1
  114. package/framework-mcp/src/index.ts +1 -1
  115. package/framework-mcp/src/tools/control_plane/locking.ts +77 -0
  116. package/framework-mcp/src/tools/control_plane/registry.ts +44 -0
  117. package/framework-mcp/src/tools/definitions.ts +46 -7
  118. package/framework-mcp/src/tools/file_system/write_file.ts +19 -2
  119. package/framework-mcp/src/tools/index.ts +6 -1
  120. package/framework-mcp/src/tools/messaging/send_message.ts +2 -3
  121. package/framework-mcp/src/utils/metrics.ts +53 -0
  122. package/framework-mcp/src/utils/security.ts +8 -3
  123. package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +164 -0
  124. package/framework-mcp/tsconfig.json +4 -2
  125. package/package.json +12 -11
  126. package/src/cli/adapters/types.ts +16 -0
  127. package/src/cli/adapters.ts +130 -156
  128. package/src/cli/commands/check.ts +61 -77
  129. package/src/cli/commands/init.ts +163 -312
  130. package/src/cli/commands/log.ts +1 -1
  131. package/src/cli/commands/memory.ts +3 -80
  132. package/src/cli/commands/orchestrate.ts +76 -90
  133. package/src/cli/index.ts +121 -29
  134. package/src/cli/utils/app.ts +3 -3
  135. package/src/cli/utils/config-schema.ts +48 -0
  136. package/src/cli/utils/fs.ts +10 -27
  137. package/src/cli/utils/memory.ts +143 -112
  138. package/src/cli/utils/pkg.ts +4 -4
  139. package/src/cli/utils/ui.ts +63 -0
  140. package/src/modules/adapters/antigravity-cli.ts +25 -0
  141. package/src/modules/adapters/claude.ts +36 -0
  142. package/src/modules/adapters/codex.ts +22 -0
  143. package/src/modules/adapters/cursor.ts +22 -0
  144. package/src/modules/adapters/gemini.ts +27 -0
  145. package/src/modules/adapters/grok.ts +20 -0
  146. package/src/modules/adapters/shared.ts +90 -0
  147. package/src/modules/adapters/types.ts +16 -0
  148. package/src/modules/agents/definitions.ts +182 -0
  149. package/src/modules/skills/definitions.ts +32 -0
  150. package/src/shared/fs.ts +25 -0
  151. package/.enderun/BRAIN_DASHBOARD.md +0 -46
  152. package/.enderun/STATUS.md +0 -61
  153. package/.enderun/agents/agent_army_schema.json +0 -101
  154. package/.enderun/agents/analyst.json +0 -32
  155. package/.enderun/agents/backend.json +0 -32
  156. package/.enderun/agents/database.json +0 -32
  157. package/.enderun/agents/devops.json +0 -32
  158. package/.enderun/agents/explorer.json +0 -32
  159. package/.enderun/agents/frontend.json +0 -32
  160. package/.enderun/agents/git.json +0 -32
  161. package/.enderun/agents/manager.json +0 -32
  162. package/.enderun/agents/mobile.json +0 -32
  163. package/.enderun/agents/native.json +0 -32
  164. package/.enderun/agents/quality.json +0 -32
  165. package/.enderun/agents/schema/agent-lifecycle-schema.json +0 -41
  166. package/.enderun/agents/security.json +0 -32
  167. package/.enderun/benchmarks/.gitkeep +0 -0
  168. package/.enderun/cli-commands.json +0 -76
  169. package/.enderun/config.json +0 -13
  170. package/.enderun/knowledge/ARCHITECTURE.md +0 -1
  171. package/.enderun/knowledge/SECURITY.md +0 -1
  172. package/.enderun/knowledge/SHIM_TEMPLATE.md +0 -36
  173. package/.enderun/knowledge/analyst_reference_guide.md +0 -31
  174. package/.enderun/knowledge/async_error_handling.md +0 -27
  175. package/.enderun/knowledge/backend_reference_guide.md +0 -165
  176. package/.enderun/knowledge/blueprint_driven_construction.md +0 -22
  177. package/.enderun/knowledge/context_boundary_rules.md +0 -57
  178. package/.enderun/knowledge/corporate-governance/analyst-contract-integrity-guide.md +0 -92
  179. package/.enderun/knowledge/corporate-governance/audit-logging-standard.md +0 -59
  180. package/.enderun/knowledge/corporate-governance/backend-high-risk-endpoint-guide.md +0 -125
  181. package/.enderun/knowledge/corporate-governance/branded-types-law.md +0 -77
  182. package/.enderun/knowledge/corporate-governance/contract-drift-detection-simulation.md +0 -92
  183. package/.enderun/knowledge/corporate-governance/corporate-governance-playbook.md +0 -89
  184. package/.enderun/knowledge/corporate-governance/corporate-project-kickoff-checklist.md +0 -56
  185. package/.enderun/knowledge/corporate-governance/corporate-project-kickoff-simulation.md +0 -144
  186. package/.enderun/knowledge/corporate-governance/corporate-project-scaffolding-sop.md +0 -103
  187. package/.enderun/knowledge/corporate-governance/domain-error-handling-standard.md +0 -75
  188. package/.enderun/knowledge/corporate-governance/frontend-high-risk-modal-guide.md +0 -211
  189. package/.enderun/knowledge/corporate-governance/governance-baseline-briefing-template.md +0 -54
  190. package/.enderun/knowledge/corporate-governance/high-risk-action-approval-flow-simulation.md +0 -167
  191. package/.enderun/knowledge/corporate-governance/high-risk-action-approval-flow.md +0 -29
  192. package/.enderun/knowledge/corporate-governance/high-risk-actions-managerapproval.md +0 -76
  193. package/.enderun/knowledge/corporate-governance/high-risk-security-modal-hermes-flow.md +0 -49
  194. package/.enderun/knowledge/corporate-governance/manager-first-30-days-guide.md +0 -112
  195. package/.enderun/knowledge/corporate-governance/manager-first-three-briefings.md +0 -79
  196. package/.enderun/knowledge/database_reference_guide.md +0 -38
  197. package/.enderun/knowledge/devops_reference_guide.md +0 -43
  198. package/.enderun/knowledge/documentation_ownership.md +0 -53
  199. package/.enderun/knowledge/eslint-standards.md +0 -63
  200. package/.enderun/knowledge/evaluation_engine.md +0 -26
  201. package/.enderun/knowledge/explorer_reference_guide.md +0 -34
  202. package/.enderun/knowledge/framework_vs_user_project_boundary.md +0 -52
  203. package/.enderun/knowledge/frontend_professionalization_guidelines.md +0 -108
  204. package/.enderun/knowledge/frontend_reference_guide.md +0 -64
  205. package/.enderun/knowledge/git_reference_guide.md +0 -51
  206. package/.enderun/knowledge/hermes_live_test_guidelines.md +0 -90
  207. package/.enderun/knowledge/hermes_protocol.md +0 -59
  208. package/.enderun/knowledge/legacy_onboarding.md +0 -18
  209. package/.enderun/knowledge/lessons-learned.md +0 -14
  210. package/.enderun/knowledge/manager_authority_audit_enforcement.md +0 -104
  211. package/.enderun/knowledge/manager_reference_guide.md +0 -55
  212. package/.enderun/knowledge/mobile_reference_guide.md +0 -35
  213. package/.enderun/knowledge/native_reference_guide.md +0 -34
  214. package/.enderun/knowledge/project_scaffold_guidelines.md +0 -110
  215. package/.enderun/knowledge/quality_reference_guide.md +0 -42
  216. package/.enderun/knowledge/reference_application_guidelines.md +0 -101
  217. package/.enderun/knowledge/responsive_design_standards.md +0 -27
  218. package/.enderun/knowledge/router_logic.md +0 -29
  219. package/.enderun/knowledge/security_reference_guide.md +0 -35
  220. package/.enderun/knowledge/token_economy_and_memory.md +0 -129
  221. package/.enderun/knowledge/zero_ui_library_policy.md +0 -13
  222. package/.enderun/logs/manager.json +0 -52
  223. package/.enderun/mcp_config.json +0 -11
  224. package/.enderun/memory/BUSINESS_CONTEXT.md +0 -17
  225. package/.enderun/memory/DECISIONS.md +0 -24
  226. package/.enderun/memory/LESSONS_LEARNED.md +0 -12
  227. package/.enderun/memory/PATTERNS.md +0 -17
  228. package/.enderun/memory/PROJECT_MEMORY.md +0 -69
  229. package/.enderun/memory-graph/agent-contexts/analyst.json +0 -1
  230. package/.enderun/memory-graph/agent-contexts/backend.json +0 -1
  231. package/.enderun/memory-graph/agent-contexts/devops.json +0 -1
  232. package/.enderun/memory-graph/agent-contexts/explorer.json +0 -1
  233. package/.enderun/memory-graph/agent-contexts/frontend.json +0 -1
  234. package/.enderun/memory-graph/agent-contexts/git.json +0 -1
  235. package/.enderun/memory-graph/agent-contexts/manager.json +0 -1
  236. package/.enderun/memory-graph/agent-contexts/mobile.json +0 -1
  237. package/.enderun/memory-graph/agent-contexts/native.json +0 -1
  238. package/.enderun/memory-graph/agent-contexts/quality.json +0 -1
  239. package/.enderun/memory-graph/agent-contexts/security.json +0 -1
  240. package/.enderun/memory-graph/graph.json +0 -133
  241. package/.enderun/memory-graph/shared-facts.json +0 -46
  242. package/.enderun/monitoring/.gitkeep +0 -0
  243. package/.enderun/observability/AUDIT_LOG.md +0 -9
  244. package/.enderun/observability/METRICS.md +0 -10
  245. package/.enderun/observability/README.md +0 -19
  246. package/.enderun/observability/TRACE_LOG.md +0 -10
  247. package/.enderun/queue/README.md +0 -36
  248. package/.enderun/registry/agents.yaml +0 -69
  249. package/.enderun/skills/agent_handshake.md +0 -37
  250. package/.enderun/skills/multi_agent_coordination.md +0 -64
  251. package/.enderun/skills/subagent_lifecycle.md +0 -48
  252. package/CLAUDE.md +0 -21
  253. package/GEMINI.md +0 -24
  254. package/GROK.md +0 -20
  255. package/agent.md +0 -25
  256. package/dist/.keep +0 -1
  257. package/dist/tests/adapter.test.d.ts +0 -1
  258. package/dist/tests/adapter.test.js +0 -82
  259. package/dist/tests/adapter.test.js.map +0 -1
  260. package/dist/tests/gemini.test.d.ts +0 -1
  261. package/dist/tests/gemini.test.js +0 -39
  262. package/dist/tests/gemini.test.js.map +0 -1
  263. package/dist/tests/initial.test.d.ts +0 -1
  264. package/dist/tests/initial.test.js +0 -7
  265. package/dist/tests/initial.test.js.map +0 -1
  266. package/docs/project_analysis_report.md +0 -69
  267. package/framework-mcp/dist/src/index.js +0 -70
  268. package/framework-mcp/dist/src/tools/definitions.js +0 -112
  269. package/framework-mcp/dist/src/tools/file_system/patch_file.js +0 -18
  270. package/framework-mcp/dist/src/tools/file_system/read_file.js +0 -27
  271. package/framework-mcp/dist/src/tools/file_system/replace_text.js +0 -31
  272. package/framework-mcp/dist/src/tools/file_system/write_file.js +0 -9
  273. package/framework-mcp/dist/src/tools/framework/get_status.js +0 -5
  274. package/framework-mcp/dist/src/tools/framework/orchestrate.js +0 -5
  275. package/framework-mcp/dist/src/tools/framework/update_contract_hash.js +0 -5
  276. package/framework-mcp/dist/src/tools/framework/update_memory.js +0 -8
  277. package/framework-mcp/dist/src/tools/index.js +0 -25
  278. package/framework-mcp/dist/src/tools/messaging/log_action.js +0 -22
  279. package/framework-mcp/dist/src/tools/messaging/send_message.js +0 -46
  280. package/framework-mcp/dist/src/tools/types.js +0 -1
  281. package/framework-mcp/dist/src/utils/cli.js +0 -20
  282. package/framework-mcp/dist/src/utils/security.js +0 -53
  283. package/framework-mcp/dist/tests/tools/file_system/replace_text.test.js +0 -68
  284. package/framework-mcp/node_modules/@types/node/LICENSE +0 -21
  285. package/framework-mcp/node_modules/@types/node/README.md +0 -15
  286. package/framework-mcp/node_modules/@types/node/assert/strict.d.ts +0 -111
  287. package/framework-mcp/node_modules/@types/node/assert.d.ts +0 -1078
  288. package/framework-mcp/node_modules/@types/node/async_hooks.d.ts +0 -603
  289. package/framework-mcp/node_modules/@types/node/buffer.buffer.d.ts +0 -472
  290. package/framework-mcp/node_modules/@types/node/buffer.d.ts +0 -1934
  291. package/framework-mcp/node_modules/@types/node/child_process.d.ts +0 -1476
  292. package/framework-mcp/node_modules/@types/node/cluster.d.ts +0 -578
  293. package/framework-mcp/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  294. package/framework-mcp/node_modules/@types/node/compatibility/index.d.ts +0 -9
  295. package/framework-mcp/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  296. package/framework-mcp/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  297. package/framework-mcp/node_modules/@types/node/console.d.ts +0 -452
  298. package/framework-mcp/node_modules/@types/node/constants.d.ts +0 -21
  299. package/framework-mcp/node_modules/@types/node/crypto.d.ts +0 -4545
  300. package/framework-mcp/node_modules/@types/node/dgram.d.ts +0 -600
  301. package/framework-mcp/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  302. package/framework-mcp/node_modules/@types/node/dns/promises.d.ts +0 -503
  303. package/framework-mcp/node_modules/@types/node/dns.d.ts +0 -923
  304. package/framework-mcp/node_modules/@types/node/domain.d.ts +0 -170
  305. package/framework-mcp/node_modules/@types/node/events.d.ts +0 -976
  306. package/framework-mcp/node_modules/@types/node/fs/promises.d.ts +0 -1295
  307. package/framework-mcp/node_modules/@types/node/fs.d.ts +0 -4461
  308. package/framework-mcp/node_modules/@types/node/globals.d.ts +0 -172
  309. package/framework-mcp/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  310. package/framework-mcp/node_modules/@types/node/http.d.ts +0 -2089
  311. package/framework-mcp/node_modules/@types/node/http2.d.ts +0 -2721
  312. package/framework-mcp/node_modules/@types/node/https.d.ts +0 -579
  313. package/framework-mcp/node_modules/@types/node/index.d.ts +0 -97
  314. package/framework-mcp/node_modules/@types/node/inspector.d.ts +0 -253
  315. package/framework-mcp/node_modules/@types/node/inspector.generated.d.ts +0 -4052
  316. package/framework-mcp/node_modules/@types/node/module.d.ts +0 -891
  317. package/framework-mcp/node_modules/@types/node/net.d.ts +0 -1076
  318. package/framework-mcp/node_modules/@types/node/os.d.ts +0 -506
  319. package/framework-mcp/node_modules/@types/node/package.json +0 -145
  320. package/framework-mcp/node_modules/@types/node/path.d.ts +0 -200
  321. package/framework-mcp/node_modules/@types/node/perf_hooks.d.ts +0 -968
  322. package/framework-mcp/node_modules/@types/node/process.d.ts +0 -2084
  323. package/framework-mcp/node_modules/@types/node/punycode.d.ts +0 -117
  324. package/framework-mcp/node_modules/@types/node/querystring.d.ts +0 -152
  325. package/framework-mcp/node_modules/@types/node/readline/promises.d.ts +0 -161
  326. package/framework-mcp/node_modules/@types/node/readline.d.ts +0 -594
  327. package/framework-mcp/node_modules/@types/node/repl.d.ts +0 -428
  328. package/framework-mcp/node_modules/@types/node/sea.d.ts +0 -153
  329. package/framework-mcp/node_modules/@types/node/sqlite.d.ts +0 -721
  330. package/framework-mcp/node_modules/@types/node/stream/consumers.d.ts +0 -38
  331. package/framework-mcp/node_modules/@types/node/stream/promises.d.ts +0 -90
  332. package/framework-mcp/node_modules/@types/node/stream/web.d.ts +0 -622
  333. package/framework-mcp/node_modules/@types/node/stream.d.ts +0 -1687
  334. package/framework-mcp/node_modules/@types/node/string_decoder.d.ts +0 -67
  335. package/framework-mcp/node_modules/@types/node/test.d.ts +0 -2163
  336. package/framework-mcp/node_modules/@types/node/timers/promises.d.ts +0 -108
  337. package/framework-mcp/node_modules/@types/node/timers.d.ts +0 -287
  338. package/framework-mcp/node_modules/@types/node/tls.d.ts +0 -1319
  339. package/framework-mcp/node_modules/@types/node/trace_events.d.ts +0 -197
  340. package/framework-mcp/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  341. package/framework-mcp/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  342. package/framework-mcp/node_modules/@types/node/ts5.6/index.d.ts +0 -97
  343. package/framework-mcp/node_modules/@types/node/tty.d.ts +0 -208
  344. package/framework-mcp/node_modules/@types/node/url.d.ts +0 -984
  345. package/framework-mcp/node_modules/@types/node/util.d.ts +0 -2606
  346. package/framework-mcp/node_modules/@types/node/v8.d.ts +0 -920
  347. package/framework-mcp/node_modules/@types/node/vm.d.ts +0 -1000
  348. package/framework-mcp/node_modules/@types/node/wasi.d.ts +0 -181
  349. package/framework-mcp/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  350. package/framework-mcp/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  351. package/framework-mcp/node_modules/@types/node/web-globals/events.d.ts +0 -97
  352. package/framework-mcp/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  353. package/framework-mcp/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
  354. package/framework-mcp/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  355. package/framework-mcp/node_modules/@types/node/worker_threads.d.ts +0 -784
  356. package/framework-mcp/node_modules/@types/node/zlib.d.ts +0 -747
  357. package/framework-mcp/node_modules/typescript/LICENSE.txt +0 -55
  358. package/framework-mcp/node_modules/typescript/README.md +0 -50
  359. package/framework-mcp/node_modules/typescript/SECURITY.md +0 -41
  360. package/framework-mcp/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  361. package/framework-mcp/node_modules/typescript/bin/tsc +0 -2
  362. package/framework-mcp/node_modules/typescript/bin/tsserver +0 -2
  363. package/framework-mcp/node_modules/typescript/lib/_tsc.js +0 -133818
  364. package/framework-mcp/node_modules/typescript/lib/_tsserver.js +0 -659
  365. package/framework-mcp/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  366. package/framework-mcp/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  367. package/framework-mcp/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  368. package/framework-mcp/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  369. package/framework-mcp/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  370. package/framework-mcp/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  371. package/framework-mcp/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  372. package/framework-mcp/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  373. package/framework-mcp/node_modules/typescript/lib/lib.d.ts +0 -22
  374. package/framework-mcp/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  375. package/framework-mcp/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  376. package/framework-mcp/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  377. package/framework-mcp/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  378. package/framework-mcp/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  379. package/framework-mcp/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  380. package/framework-mcp/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  381. package/framework-mcp/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  382. package/framework-mcp/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  383. package/framework-mcp/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  384. package/framework-mcp/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  385. package/framework-mcp/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  386. package/framework-mcp/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  387. package/framework-mcp/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  388. package/framework-mcp/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  389. package/framework-mcp/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  390. package/framework-mcp/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  391. package/framework-mcp/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  392. package/framework-mcp/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  393. package/framework-mcp/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  394. package/framework-mcp/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  395. package/framework-mcp/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  396. package/framework-mcp/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  397. package/framework-mcp/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  398. package/framework-mcp/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  399. package/framework-mcp/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  400. package/framework-mcp/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  401. package/framework-mcp/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  402. package/framework-mcp/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  403. package/framework-mcp/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  404. package/framework-mcp/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  405. package/framework-mcp/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  406. package/framework-mcp/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  407. package/framework-mcp/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  408. package/framework-mcp/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  409. package/framework-mcp/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  410. package/framework-mcp/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  411. package/framework-mcp/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  412. package/framework-mcp/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  413. package/framework-mcp/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  414. package/framework-mcp/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  415. package/framework-mcp/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  416. package/framework-mcp/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  417. package/framework-mcp/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  418. package/framework-mcp/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  419. package/framework-mcp/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  420. package/framework-mcp/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  421. package/framework-mcp/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  422. package/framework-mcp/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  423. package/framework-mcp/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  424. package/framework-mcp/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  425. package/framework-mcp/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  426. package/framework-mcp/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  427. package/framework-mcp/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  428. package/framework-mcp/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  429. package/framework-mcp/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  430. package/framework-mcp/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  431. package/framework-mcp/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  432. package/framework-mcp/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  433. package/framework-mcp/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  434. package/framework-mcp/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  435. package/framework-mcp/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  436. package/framework-mcp/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  437. package/framework-mcp/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  438. package/framework-mcp/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  439. package/framework-mcp/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  440. package/framework-mcp/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  441. package/framework-mcp/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  442. package/framework-mcp/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  443. package/framework-mcp/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  444. package/framework-mcp/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  445. package/framework-mcp/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  446. package/framework-mcp/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  447. package/framework-mcp/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  448. package/framework-mcp/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  449. package/framework-mcp/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  450. package/framework-mcp/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  451. package/framework-mcp/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  452. package/framework-mcp/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  453. package/framework-mcp/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  454. package/framework-mcp/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  455. package/framework-mcp/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  456. package/framework-mcp/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  457. package/framework-mcp/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  458. package/framework-mcp/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  459. package/framework-mcp/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  460. package/framework-mcp/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  461. package/framework-mcp/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  462. package/framework-mcp/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  463. package/framework-mcp/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  464. package/framework-mcp/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  465. package/framework-mcp/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  466. package/framework-mcp/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  467. package/framework-mcp/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  468. package/framework-mcp/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  469. package/framework-mcp/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  470. package/framework-mcp/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  471. package/framework-mcp/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  472. package/framework-mcp/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  473. package/framework-mcp/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  474. package/framework-mcp/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  475. package/framework-mcp/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  476. package/framework-mcp/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  477. package/framework-mcp/node_modules/typescript/lib/tsc.js +0 -8
  478. package/framework-mcp/node_modules/typescript/lib/tsserver.js +0 -8
  479. package/framework-mcp/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  480. package/framework-mcp/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  481. package/framework-mcp/node_modules/typescript/lib/typesMap.json +0 -497
  482. package/framework-mcp/node_modules/typescript/lib/typescript.d.ts +0 -11437
  483. package/framework-mcp/node_modules/typescript/lib/typescript.js +0 -200276
  484. package/framework-mcp/node_modules/typescript/lib/typingsInstaller.js +0 -8
  485. package/framework-mcp/node_modules/typescript/lib/watchGuard.js +0 -53
  486. package/framework-mcp/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  487. package/framework-mcp/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  488. package/framework-mcp/node_modules/typescript/package.json +0 -120
  489. package/framework-mcp/node_modules/undici-types/LICENSE +0 -21
  490. package/framework-mcp/node_modules/undici-types/README.md +0 -6
  491. package/framework-mcp/node_modules/undici-types/agent.d.ts +0 -31
  492. package/framework-mcp/node_modules/undici-types/api.d.ts +0 -43
  493. package/framework-mcp/node_modules/undici-types/balanced-pool.d.ts +0 -29
  494. package/framework-mcp/node_modules/undici-types/cache.d.ts +0 -36
  495. package/framework-mcp/node_modules/undici-types/client.d.ts +0 -108
  496. package/framework-mcp/node_modules/undici-types/connector.d.ts +0 -34
  497. package/framework-mcp/node_modules/undici-types/content-type.d.ts +0 -21
  498. package/framework-mcp/node_modules/undici-types/cookies.d.ts +0 -28
  499. package/framework-mcp/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  500. package/framework-mcp/node_modules/undici-types/dispatcher.d.ts +0 -256
  501. package/framework-mcp/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  502. package/framework-mcp/node_modules/undici-types/errors.d.ts +0 -149
  503. package/framework-mcp/node_modules/undici-types/eventsource.d.ts +0 -61
  504. package/framework-mcp/node_modules/undici-types/fetch.d.ts +0 -209
  505. package/framework-mcp/node_modules/undici-types/file.d.ts +0 -39
  506. package/framework-mcp/node_modules/undici-types/filereader.d.ts +0 -54
  507. package/framework-mcp/node_modules/undici-types/formdata.d.ts +0 -108
  508. package/framework-mcp/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  509. package/framework-mcp/node_modules/undici-types/global-origin.d.ts +0 -7
  510. package/framework-mcp/node_modules/undici-types/handlers.d.ts +0 -15
  511. package/framework-mcp/node_modules/undici-types/header.d.ts +0 -4
  512. package/framework-mcp/node_modules/undici-types/index.d.ts +0 -71
  513. package/framework-mcp/node_modules/undici-types/interceptors.d.ts +0 -17
  514. package/framework-mcp/node_modules/undici-types/mock-agent.d.ts +0 -50
  515. package/framework-mcp/node_modules/undici-types/mock-client.d.ts +0 -25
  516. package/framework-mcp/node_modules/undici-types/mock-errors.d.ts +0 -12
  517. package/framework-mcp/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  518. package/framework-mcp/node_modules/undici-types/mock-pool.d.ts +0 -25
  519. package/framework-mcp/node_modules/undici-types/package.json +0 -55
  520. package/framework-mcp/node_modules/undici-types/patch.d.ts +0 -33
  521. package/framework-mcp/node_modules/undici-types/pool-stats.d.ts +0 -19
  522. package/framework-mcp/node_modules/undici-types/pool.d.ts +0 -39
  523. package/framework-mcp/node_modules/undici-types/proxy-agent.d.ts +0 -28
  524. package/framework-mcp/node_modules/undici-types/readable.d.ts +0 -65
  525. package/framework-mcp/node_modules/undici-types/retry-agent.d.ts +0 -8
  526. package/framework-mcp/node_modules/undici-types/retry-handler.d.ts +0 -116
  527. package/framework-mcp/node_modules/undici-types/util.d.ts +0 -18
  528. package/framework-mcp/node_modules/undici-types/webidl.d.ts +0 -228
  529. package/framework-mcp/node_modules/undici-types/websocket.d.ts +0 -150
  530. package/framework-mcp/tests/tools/file_system/replace_text.test.js +0 -68
  531. package/framework-mcp/tests/tools/file_system/replace_text.test.ts +0 -77
  532. package/mcp.json +0 -11
  533. package/panda.config.ts +0 -100
@@ -1,11 +1,13 @@
1
1
  export const TOOLS = [
2
2
  {
3
3
  name: "read_file",
4
- description: "Read the content of a file within the project.",
4
+ description: "Read the content of a file within the project. Supports optional line range reading to prevent stream overload.",
5
5
  inputSchema: {
6
6
  type: "object",
7
7
  properties: {
8
8
  path: { type: "string", description: "Path to the file relative to project root" },
9
+ startLine: { type: "number", description: "Optional starting line number (1-indexed)" },
10
+ endLine: { type: "number", description: "Optional ending line number (inclusive)" },
9
11
  },
10
12
  required: ["path"],
11
13
  },
@@ -73,19 +75,58 @@ export const TOOLS = [
73
75
  },
74
76
  {
75
77
  name: "send_agent_message",
76
- description: "Send a Hermes protocol message to another agent.",
78
+ description: "Send a Hermes protocol message to another agent for collaboration or sub-tasking.",
77
79
  inputSchema: {
78
80
  type: "object",
79
81
  properties: {
80
- from: { type: "string", description: "Sender agent (e.g., @manager, @backend). Defaults to @mcp if omitted." },
81
- to: { type: "string", description: "Target agent (e.g., @backend, @qa)" },
82
- category: { type: "string", enum: ["ACTION", "DELEGATION", "INFO", "ALERT"] },
83
- content: { type: "string", description: "Message content" },
84
- traceId: { type: "string", description: "Active Trace ID" },
82
+ from: { type: "string", description: "Sender agent (e.g., @manager, @backend)." },
83
+ to: { type: "string", description: "Target agent (e.g., @backend, @quality)." },
84
+ category: { type: "string", enum: ["ACTION", "DELEGATION", "SUBTASK", "REPLY", "ALERT"], description: "Message type." },
85
+ content: { type: "string", description: "Task description or message content." },
86
+ traceId: { type: "string", description: "Active Trace ID." },
87
+ parentId: { type: "string", description: "Optional parent task trace ID for hierarchical tracking." },
85
88
  },
86
- required: ["to", "category", "content", "traceId"],
89
+ required: ["from", "to", "category", "content", "traceId"],
87
90
  },
88
91
  },
92
+ {
93
+ name: "acquire_lock",
94
+ description: "Acquire a stateful lock on a shared resource (like PROJECT_MEMORY.md) to prevent concurrent write conflicts.",
95
+ inputSchema: {
96
+ type: "object",
97
+ properties: {
98
+ resource: { type: "string", description: "The resource name or path to lock (e.g., 'memory')." },
99
+ agent: { type: "string", description: "The agent requesting the lock (e.g., '@backend')." },
100
+ ttl: { type: "number", description: "Time-to-live in seconds before the lock auto-expires (default: 60)." }
101
+ },
102
+ required: ["resource", "agent"]
103
+ }
104
+ },
105
+ {
106
+ name: "release_lock",
107
+ description: "Release a previously acquired lock on a resource.",
108
+ inputSchema: {
109
+ type: "object",
110
+ properties: {
111
+ resource: { type: "string", description: "The resource name or path." },
112
+ agent: { type: "string", description: "The agent releasing the lock." }
113
+ },
114
+ required: ["resource", "agent"]
115
+ }
116
+ },
117
+ {
118
+ name: "register_agent",
119
+ description: "Register an agent instance with the Control Plane and validate its permissions.",
120
+ inputSchema: {
121
+ type: "object",
122
+ properties: {
123
+ agent: { type: "string", description: "The agent name (e.g., '@backend')." },
124
+ role: { type: "string", description: "The role of the agent." },
125
+ capability: { type: "number", description: "The capability score (1-10)." }
126
+ },
127
+ required: ["agent", "role"]
128
+ }
129
+ },
89
130
  {
90
131
  name: "log_agent_action",
91
132
  description: "Log an agent action to the framework logs.",
@@ -2,6 +2,26 @@ import fs from "fs";
2
2
  import { safePath } from "../../utils/security.js";
3
3
  export function handleReadFile(projectRoot, args) {
4
4
  const filePath = safePath(projectRoot, args.path);
5
+ const startLine = args.startLine !== undefined ? Number(args.startLine) : undefined;
6
+ const endLine = args.endLine !== undefined ? Number(args.endLine) : undefined;
5
7
  const content = fs.readFileSync(filePath, "utf8");
8
+ const lines = content.split(/\r?\n/);
9
+ if (startLine !== undefined || endLine !== undefined) {
10
+ const start = startLine !== undefined ? Math.max(1, startLine) - 1 : 0;
11
+ const end = endLine !== undefined ? Math.min(lines.length, endLine) : lines.length;
12
+ const sliced = lines.slice(start, end).join("\n");
13
+ return { content: [{ type: "text", text: sliced }] };
14
+ }
15
+ // Default protection limit: 1000 lines
16
+ const DEFAULT_MAX_LINES = 1000;
17
+ if (lines.length > DEFAULT_MAX_LINES) {
18
+ const sliced = lines.slice(0, DEFAULT_MAX_LINES).join("\n");
19
+ return {
20
+ content: [{
21
+ type: "text",
22
+ text: `${sliced}\n\n... [TRUNCATED - File is too long (${lines.length} lines). Only the first ${DEFAULT_MAX_LINES} lines are shown. Use startLine and endLine parameters to read other parts of the file.]`
23
+ }]
24
+ };
25
+ }
6
26
  return { content: [{ type: "text", text: content }] };
7
27
  }
@@ -1,9 +1,23 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { safePath } from "../../utils/security.js";
3
+ import { safePath, resolveFrameworkDir } from "../../utils/security.js";
4
+ import { Metrics } from "../../utils/metrics.js";
4
5
  export function handleWriteFile(projectRoot, args) {
5
6
  const filePath = safePath(projectRoot, args.path);
7
+ const content = args.content;
6
8
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
7
- fs.writeFileSync(filePath, args.content);
9
+ fs.writeFileSync(filePath, content);
10
+ // AUTO-LOGGING & METRICS
11
+ const tokens = Metrics.estimateTokens(content);
12
+ Metrics.logUsage(projectRoot, "@mcp", `write_file: ${args.path}`, tokens);
13
+ try {
14
+ const frameworkDir = resolveFrameworkDir(projectRoot);
15
+ const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
16
+ if (fs.existsSync(memoryPath)) {
17
+ const entry = `\n### ${new Date().toISOString().split("T")[0]} — Auto-Update\n- **Action:** wrote file \`${args.path}\` (${tokens} tokens estimated).\n`;
18
+ fs.appendFileSync(memoryPath, entry);
19
+ }
20
+ }
21
+ catch { /* ignore memory logging errors */ }
8
22
  return { content: [{ type: "text", text: `✅ File written: ${args.path}` }] };
9
23
  }
@@ -9,6 +9,8 @@ import { handleOrchestrateLoop } from "./framework/orchestrate.js";
9
9
  import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
10
10
  import { handleSendAgentMessage } from "./messaging/send_message.js";
11
11
  import { handleLogAgentAction } from "./messaging/log_action.js";
12
+ import { handleAcquireLock, handleReleaseLock } from "./control_plane/locking.js";
13
+ import { handleRegisterAgent } from "./control_plane/registry.js";
12
14
  // Map of tool names to their handler functions
13
15
  export const toolHandlers = {
14
16
  read_file: handleReadFile,
@@ -21,5 +23,8 @@ export const toolHandlers = {
21
23
  send_agent_message: handleSendAgentMessage,
22
24
  log_agent_action: handleLogAgentAction,
23
25
  update_contract_hash: handleUpdateContractHash,
26
+ acquire_lock: handleAcquireLock,
27
+ release_lock: handleReleaseLock,
28
+ register_agent: handleRegisterAgent,
24
29
  };
25
30
  export { TOOLS };
@@ -1,23 +1,44 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
- export function handleSendAgentMessage(projectRoot, args) {
4
+ export async function handleSendAgentMessage(projectRoot, args) {
5
5
  const { to, category, content, traceId } = args;
6
- // `from` is optional — falls back to "@mcp" for backward compatibility
7
6
  const from = args.from || "@mcp";
8
7
  const frameworkDir = resolveFrameworkDir(projectRoot);
8
+ const messagesDir = path.join(projectRoot, frameworkDir, "messages");
9
9
  const agentName = to.replace("@", "");
10
- const messagePath = path.join(projectRoot, frameworkDir, "messages", `${agentName}.json`);
11
- const message = {
12
- timestamp: new Date().toISOString(),
13
- from,
14
- to,
15
- category,
16
- traceId,
17
- content,
18
- status: "PENDING"
19
- };
20
- fs.mkdirSync(path.dirname(messagePath), { recursive: true });
21
- fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
22
- return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
10
+ const messagePath = path.join(messagesDir, `${agentName}.json`);
11
+ const lockPath = path.join(messagesDir, ".lock");
12
+ // Hermes Lock Protocol: Retry 3 times with 500ms delay
13
+ let retries = 3;
14
+ while (retries > 0 && fs.existsSync(lockPath)) {
15
+ const stats = fs.statSync(lockPath);
16
+ if (Date.now() - stats.mtimeMs > 5000) {
17
+ fs.unlinkSync(lockPath);
18
+ break;
19
+ }
20
+ retries--;
21
+ if (retries > 0) {
22
+ await new Promise((resolve) => setTimeout(resolve, 500));
23
+ }
24
+ }
25
+ try {
26
+ fs.mkdirSync(messagesDir, { recursive: true });
27
+ fs.writeFileSync(lockPath, `Locked by ${from} at ${new Date().toISOString()}`);
28
+ const message = {
29
+ timestamp: new Date().toISOString(),
30
+ from,
31
+ to,
32
+ category,
33
+ traceId,
34
+ content,
35
+ status: "PENDING"
36
+ };
37
+ fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
38
+ return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
39
+ }
40
+ finally {
41
+ if (fs.existsSync(lockPath))
42
+ fs.unlinkSync(lockPath);
43
+ }
23
44
  }
@@ -0,0 +1,38 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { resolveFrameworkDir } from "./security.js";
4
+ export const Metrics = {
5
+ /**
6
+ * Estimates tokens based on character count (rough heuristic: 1 token ~= 4 chars).
7
+ */
8
+ estimateTokens: (text) => {
9
+ return Math.ceil(text.length / 4);
10
+ },
11
+ /**
12
+ * Logs the token usage and action to the observability metrics file.
13
+ */
14
+ logUsage: (projectRoot, agent, action, tokens) => {
15
+ const frameworkDir = resolveFrameworkDir(projectRoot);
16
+ const metricsPath = path.join(projectRoot, frameworkDir, "observability/metrics.json");
17
+ try {
18
+ const metricsDir = path.dirname(metricsPath);
19
+ if (!fs.existsSync(metricsDir))
20
+ fs.mkdirSync(metricsDir, { recursive: true });
21
+ let currentMetrics = [];
22
+ if (fs.existsSync(metricsPath)) {
23
+ currentMetrics = JSON.parse(fs.readFileSync(metricsPath, "utf8"));
24
+ }
25
+ currentMetrics.push({
26
+ timestamp: new Date().toISOString(),
27
+ agent,
28
+ action,
29
+ estimatedTokens: tokens
30
+ });
31
+ // Keep only last 100 entries to save space
32
+ if (currentMetrics.length > 100)
33
+ currentMetrics.shift();
34
+ fs.writeFileSync(metricsPath, JSON.stringify(currentMetrics, null, 2));
35
+ }
36
+ catch { /* ignore: metrics should not block the main process */ }
37
+ }
38
+ };
@@ -33,15 +33,19 @@ export function resolveFrameworkDir(projectRoot) {
33
33
  catch {
34
34
  // ignore — fall through to filesystem scan
35
35
  }
36
- // 2. Filesystem scan — .enderun takes precedence over adapter-specific dirs
36
+ // 2. Filesystem scan
37
37
  const candidates = [
38
38
  ".enderun",
39
+ ".cursor",
39
40
  ".claude",
41
+ ".github",
40
42
  ".grok",
43
+ ".windsurf",
44
+ ".antigravity",
41
45
  ".agent",
42
- ".gemini/antigravity",
43
46
  ".gemini/antigravity-cli",
44
47
  ".gemini",
48
+ ".agents",
45
49
  ];
46
50
  for (const candidate of candidates) {
47
51
  const candidatePath = path.join(projectRoot, candidate);
@@ -49,5 +53,5 @@ export function resolveFrameworkDir(projectRoot) {
49
53
  return candidate;
50
54
  }
51
55
  }
52
- return ".enderun";
56
+ return ".gemini";
53
57
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-enderun/mcp",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Agent Enderun Model Context Protocol (MCP) Server",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ import { TOOLS, toolHandlers } from "./tools/index.js";
14
14
  const server = new Server(
15
15
  {
16
16
  name: "@agent-enderun/mcp",
17
- version: "1.1.2",
17
+ version: "1.1.4",
18
18
  },
19
19
  {
20
20
  capabilities: {
@@ -0,0 +1,77 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { ToolResult } from "../types.js";
4
+ import { resolveFrameworkDir } from "../../utils/security.js";
5
+
6
+ interface LockArgs {
7
+ resource: string;
8
+ agent: string;
9
+ ttl?: number;
10
+ }
11
+
12
+ /**
13
+ * Handles acquiring a stateful lock on a resource.
14
+ */
15
+ export async function handleAcquireLock(projectRoot: string, args: LockArgs): Promise<ToolResult> {
16
+ const { resource, agent, ttl = 60 } = args;
17
+ const frameworkDir = resolveFrameworkDir(projectRoot);
18
+ const lockDir = path.join(projectRoot, frameworkDir, "locks");
19
+ const lockPath = path.join(lockDir, `${resource}.lock`);
20
+
21
+ try {
22
+ if (!fs.existsSync(lockDir)) fs.mkdirSync(lockDir, { recursive: true });
23
+
24
+ if (fs.existsSync(lockPath)) {
25
+ const stat = fs.statSync(lockPath);
26
+ const now = new Date().getTime();
27
+ const age = (now - stat.mtimeMs) / 1000;
28
+
29
+ if (age < ttl) {
30
+ return {
31
+ isError: true,
32
+ content: [{ type: "text", text: `Resource '${resource}' is currently locked by another agent.` }]
33
+ };
34
+ }
35
+ // Lock expired, safe to override
36
+ fs.unlinkSync(lockPath);
37
+ }
38
+
39
+ fs.writeFileSync(lockPath, JSON.stringify({ agent, timestamp: new Date().toISOString() }));
40
+ return {
41
+ content: [{ type: "text", text: `✅ Lock acquired for resource '${resource}' by ${agent}.` }]
42
+ };
43
+ } catch (e) {
44
+ return {
45
+ isError: true,
46
+ content: [{ type: "text", text: `Failed to acquire lock: ${String(e)}` }]
47
+ };
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Handles releasing a lock.
53
+ */
54
+ export async function handleReleaseLock(projectRoot: string, args: LockArgs): Promise<ToolResult> {
55
+ const { resource, agent } = args;
56
+ const frameworkDir = resolveFrameworkDir(projectRoot);
57
+ const lockPath = path.join(projectRoot, frameworkDir, "locks", `${resource}.lock`);
58
+
59
+ try {
60
+ if (!fs.existsSync(lockPath)) {
61
+ return { content: [{ type: "text", text: `ℹ️ No lock found for resource '${resource}'.` }] };
62
+ }
63
+
64
+ const lockData = JSON.parse(fs.readFileSync(lockPath, "utf8"));
65
+ if (lockData.agent !== agent) {
66
+ return {
67
+ isError: true,
68
+ content: [{ type: "text", text: `❌ Denied: You do not own the lock for '${resource}'. Owned by ${lockData.agent}.` }]
69
+ };
70
+ }
71
+
72
+ fs.unlinkSync(lockPath);
73
+ return { content: [{ type: "text", text: `✅ Lock released for resource '${resource}' by ${agent}.` }] };
74
+ } catch (e) {
75
+ return { isError: true, content: [{ type: "text", text: `Failed to release lock: ${String(e)}` }] };
76
+ }
77
+ }
@@ -0,0 +1,44 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { ToolResult } from "../types.js";
4
+ import { resolveFrameworkDir } from "../../utils/security.js";
5
+
6
+ interface RegisterArgs {
7
+ agent: string;
8
+ role: string;
9
+ capability?: number;
10
+ }
11
+
12
+ /**
13
+ * Handles agent registration with the Control Plane.
14
+ * This can be used to validate permissions and active status.
15
+ */
16
+ export async function handleRegisterAgent(projectRoot: string, args: RegisterArgs): Promise<ToolResult> {
17
+ const { agent, role, capability = 5 } = args;
18
+ const frameworkDir = resolveFrameworkDir(projectRoot);
19
+ const registryDir = path.join(projectRoot, frameworkDir, "registry");
20
+ const agentFile = path.join(registryDir, `${agent.replace("@", "")}_active.json`);
21
+
22
+ try {
23
+ if (!fs.existsSync(registryDir)) fs.mkdirSync(registryDir, { recursive: true });
24
+
25
+ const agentData = {
26
+ agent,
27
+ role,
28
+ capability,
29
+ last_seen: new Date().toISOString(),
30
+ status: "ACTIVE"
31
+ };
32
+
33
+ fs.writeFileSync(agentFile, JSON.stringify(agentData, null, 2));
34
+
35
+ return {
36
+ content: [{ type: "text", text: `🎖️ Agent ${agent} (${role}) registered successfully in the Enderun Control Plane.` }]
37
+ };
38
+ } catch (e) {
39
+ return {
40
+ isError: true,
41
+ content: [{ type: "text", text: `Failed to register agent: ${String(e)}` }]
42
+ };
43
+ }
44
+ }
@@ -77,19 +77,58 @@ export const TOOLS: ToolDefinition[] = [
77
77
  },
78
78
  {
79
79
  name: "send_agent_message",
80
- description: "Send a Hermes protocol message to another agent.",
80
+ description: "Send a Hermes protocol message to another agent for collaboration or sub-tasking.",
81
81
  inputSchema: {
82
82
  type: "object",
83
83
  properties: {
84
- from: { type: "string", description: "Sender agent (e.g., @manager, @backend). Defaults to @mcp if omitted." },
85
- to: { type: "string", description: "Target agent (e.g., @backend, @qa)" },
86
- category: { type: "string", enum: ["ACTION", "DELEGATION", "INFO", "ALERT"] },
87
- content: { type: "string", description: "Message content" },
88
- traceId: { type: "string", description: "Active Trace ID" },
84
+ from: { type: "string", description: "Sender agent (e.g., @manager, @backend)." },
85
+ to: { type: "string", description: "Target agent (e.g., @backend, @quality)." },
86
+ category: { type: "string", enum: ["ACTION", "DELEGATION", "SUBTASK", "REPLY", "ALERT"], description: "Message type." },
87
+ content: { type: "string", description: "Task description or message content." },
88
+ traceId: { type: "string", description: "Active Trace ID." },
89
+ parentId: { type: "string", description: "Optional parent task trace ID for hierarchical tracking." },
89
90
  },
90
- required: ["to", "category", "content", "traceId"],
91
+ required: ["from", "to", "category", "content", "traceId"],
91
92
  },
92
93
  },
94
+ {
95
+ name: "acquire_lock",
96
+ description: "Acquire a stateful lock on a shared resource (like PROJECT_MEMORY.md) to prevent concurrent write conflicts.",
97
+ inputSchema: {
98
+ type: "object",
99
+ properties: {
100
+ resource: { type: "string", description: "The resource name or path to lock (e.g., 'memory')." },
101
+ agent: { type: "string", description: "The agent requesting the lock (e.g., '@backend')." },
102
+ ttl: { type: "number", description: "Time-to-live in seconds before the lock auto-expires (default: 60)." }
103
+ },
104
+ required: ["resource", "agent"]
105
+ }
106
+ },
107
+ {
108
+ name: "release_lock",
109
+ description: "Release a previously acquired lock on a resource.",
110
+ inputSchema: {
111
+ type: "object",
112
+ properties: {
113
+ resource: { type: "string", description: "The resource name or path." },
114
+ agent: { type: "string", description: "The agent releasing the lock." }
115
+ },
116
+ required: ["resource", "agent"]
117
+ }
118
+ },
119
+ {
120
+ name: "register_agent",
121
+ description: "Register an agent instance with the Control Plane and validate its permissions.",
122
+ inputSchema: {
123
+ type: "object",
124
+ properties: {
125
+ agent: { type: "string", description: "The agent name (e.g., '@backend')." },
126
+ role: { type: "string", description: "The role of the agent." },
127
+ capability: { type: "number", description: "The capability score (1-10)." }
128
+ },
129
+ required: ["agent", "role"]
130
+ }
131
+ },
93
132
  {
94
133
  name: "log_agent_action",
95
134
  description: "Log an agent action to the framework logs.",
@@ -1,11 +1,28 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { safePath } from "../../utils/security.js";
3
+ import { safePath, resolveFrameworkDir } from "../../utils/security.js";
4
+ import { Metrics } from "../../utils/metrics.js";
4
5
  import { ToolArgs, ToolResult } from "../types.js";
5
6
 
6
7
  export function handleWriteFile(projectRoot: string, args: ToolArgs): ToolResult {
7
8
  const filePath = safePath(projectRoot, args.path as string);
9
+ const content = args.content as string;
10
+
8
11
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
9
- fs.writeFileSync(filePath, args.content as string);
12
+ fs.writeFileSync(filePath, content);
13
+
14
+ // AUTO-LOGGING & METRICS
15
+ const tokens = Metrics.estimateTokens(content);
16
+ Metrics.logUsage(projectRoot, "@mcp", `write_file: ${args.path}`, tokens);
17
+
18
+ try {
19
+ const frameworkDir = resolveFrameworkDir(projectRoot);
20
+ const memoryPath = path.join(projectRoot, frameworkDir, "memory/PROJECT_MEMORY.md");
21
+ if (fs.existsSync(memoryPath)) {
22
+ const entry = `\n### ${new Date().toISOString().split("T")[0]} — Auto-Update\n- **Action:** wrote file \`${args.path}\` (${tokens} tokens estimated).\n`;
23
+ fs.appendFileSync(memoryPath, entry);
24
+ }
25
+ } catch { /* ignore memory logging errors */ }
26
+
10
27
  return { content: [{ type: "text", text: `✅ File written: ${args.path}` }] };
11
28
  }
@@ -9,10 +9,12 @@ import { handleOrchestrateLoop } from "./framework/orchestrate.js";
9
9
  import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
10
10
  import { handleSendAgentMessage } from "./messaging/send_message.js";
11
11
  import { handleLogAgentAction } from "./messaging/log_action.js";
12
+ import { handleAcquireLock, handleReleaseLock } from "./control_plane/locking.js";
13
+ import { handleRegisterAgent } from "./control_plane/registry.js";
12
14
  import { ToolResult, ToolArgs } from "./types.js";
13
15
 
14
16
  // Define a type for the tool handlers
15
- export type ToolHandler = (projectRoot: string, args: ToolArgs) => ToolResult;
17
+ export type ToolHandler = (projectRoot: string, args: ToolArgs) => ToolResult | Promise<ToolResult>;
16
18
 
17
19
  // Map of tool names to their handler functions
18
20
  export const toolHandlers: Record<string, ToolHandler> = {
@@ -26,6 +28,9 @@ export const toolHandlers: Record<string, ToolHandler> = {
26
28
  send_agent_message: handleSendAgentMessage,
27
29
  log_agent_action: handleLogAgentAction,
28
30
  update_contract_hash: handleUpdateContractHash,
31
+ acquire_lock: handleAcquireLock as ToolHandler,
32
+ release_lock: handleReleaseLock as ToolHandler,
33
+ register_agent: handleRegisterAgent as ToolHandler,
29
34
  };
30
35
 
31
36
  export { TOOLS };
@@ -3,7 +3,7 @@ import path from "path";
3
3
  import { resolveFrameworkDir } from "../../utils/security.js";
4
4
  import { ToolArgs, ToolResult } from "../types.js";
5
5
 
6
- export function handleSendAgentMessage(projectRoot: string, args: ToolArgs): ToolResult {
6
+ export async function handleSendAgentMessage(projectRoot: string, args: ToolArgs): Promise<ToolResult> {
7
7
  const { to, category, content, traceId } = args as Required<Pick<ToolArgs, "to" | "category" | "content" | "traceId">>;
8
8
  const from = (args.from as string) || "@mcp";
9
9
 
@@ -23,8 +23,7 @@ export function handleSendAgentMessage(projectRoot: string, args: ToolArgs): Too
23
23
  }
24
24
  retries--;
25
25
  if (retries > 0) {
26
- const start = Date.now();
27
- while (Date.now() - start < 500); // Simple busy wait for MCP environment
26
+ await new Promise((resolve) => setTimeout(resolve, 500));
28
27
  }
29
28
  }
30
29
 
@@ -0,0 +1,53 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { resolveFrameworkDir } from "./security.js";
4
+
5
+ /**
6
+ * Token and Metric Tracker for Enderun Core.
7
+ * Estimates token usage and logs operational costs.
8
+ */
9
+
10
+ interface MetricEntry {
11
+ timestamp: string;
12
+ agent: string;
13
+ action: string;
14
+ estimatedTokens: number;
15
+ }
16
+
17
+ export const Metrics = {
18
+ /**
19
+ * Estimates tokens based on character count (rough heuristic: 1 token ~= 4 chars).
20
+ */
21
+ estimateTokens: (text: string): number => {
22
+ return Math.ceil(text.length / 4);
23
+ },
24
+
25
+ /**
26
+ * Logs the token usage and action to the observability metrics file.
27
+ */
28
+ logUsage: (projectRoot: string, agent: string, action: string, tokens: number) => {
29
+ const frameworkDir = resolveFrameworkDir(projectRoot);
30
+ const metricsPath = path.join(projectRoot, frameworkDir, "observability/metrics.json");
31
+ try {
32
+ const metricsDir = path.dirname(metricsPath);
33
+ if (!fs.existsSync(metricsDir)) fs.mkdirSync(metricsDir, { recursive: true });
34
+
35
+ let currentMetrics: MetricEntry[] = [];
36
+ if (fs.existsSync(metricsPath)) {
37
+ currentMetrics = JSON.parse(fs.readFileSync(metricsPath, "utf8"));
38
+ }
39
+
40
+ currentMetrics.push({
41
+ timestamp: new Date().toISOString(),
42
+ agent,
43
+ action,
44
+ estimatedTokens: tokens
45
+ });
46
+
47
+ // Keep only last 100 entries to save space
48
+ if (currentMetrics.length > 100) currentMetrics.shift();
49
+
50
+ fs.writeFileSync(metricsPath, JSON.stringify(currentMetrics, null, 2));
51
+ } catch { /* ignore: metrics should not block the main process */ }
52
+ }
53
+ };
@@ -37,15 +37,19 @@ export function resolveFrameworkDir(projectRoot: string): string {
37
37
  // ignore — fall through to filesystem scan
38
38
  }
39
39
 
40
- // 2. Filesystem scan — .enderun takes precedence over adapter-specific dirs
40
+ // 2. Filesystem scan
41
41
  const candidates = [
42
42
  ".enderun",
43
+ ".cursor",
43
44
  ".claude",
45
+ ".github",
44
46
  ".grok",
47
+ ".windsurf",
48
+ ".antigravity",
45
49
  ".agent",
46
- ".gemini/antigravity",
47
50
  ".gemini/antigravity-cli",
48
51
  ".gemini",
52
+ ".agents",
49
53
  ];
50
54
 
51
55
  for (const candidate of candidates) {
@@ -55,5 +59,6 @@ export function resolveFrameworkDir(projectRoot: string): string {
55
59
  }
56
60
  }
57
61
 
58
- return ".enderun";
62
+ return ".gemini";
59
63
  }
64
+