@holoscript/framework 6.0.3

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 (329) hide show
  1. package/ALL-test-results.json +1 -0
  2. package/CHANGELOG.md +8 -0
  3. package/LICENSE +21 -0
  4. package/ROADMAP.md +175 -0
  5. package/dist/AgentManifest-CB4xM-Ma.d.cts +704 -0
  6. package/dist/AgentManifest-CB4xM-Ma.d.ts +704 -0
  7. package/dist/BehaviorTree-BrBFECv5.d.cts +103 -0
  8. package/dist/BehaviorTree-BrBFECv5.d.ts +103 -0
  9. package/dist/InvisibleWallet-BB6tFvRA.d.cts +1732 -0
  10. package/dist/InvisibleWallet-rtRrBOA8.d.ts +1732 -0
  11. package/dist/OrchestratorAgent-BvWgf9uw.d.cts +798 -0
  12. package/dist/OrchestratorAgent-Q_CbVTmO.d.ts +798 -0
  13. package/dist/agents/index.cjs +4790 -0
  14. package/dist/agents/index.d.cts +1788 -0
  15. package/dist/agents/index.d.ts +1788 -0
  16. package/dist/agents/index.js +4695 -0
  17. package/dist/ai/index.cjs +5347 -0
  18. package/dist/ai/index.d.cts +1753 -0
  19. package/dist/ai/index.d.ts +1753 -0
  20. package/dist/ai/index.js +5244 -0
  21. package/dist/behavior.cjs +449 -0
  22. package/dist/behavior.d.cts +130 -0
  23. package/dist/behavior.d.ts +130 -0
  24. package/dist/behavior.js +407 -0
  25. package/dist/economy/index.cjs +3659 -0
  26. package/dist/economy/index.d.cts +747 -0
  27. package/dist/economy/index.d.ts +747 -0
  28. package/dist/economy/index.js +3617 -0
  29. package/dist/implementations-D9T3un9D.d.cts +236 -0
  30. package/dist/implementations-D9T3un9D.d.ts +236 -0
  31. package/dist/index.cjs +24550 -0
  32. package/dist/index.d.cts +1729 -0
  33. package/dist/index.d.ts +1729 -0
  34. package/dist/index.js +24277 -0
  35. package/dist/learning/index.cjs +219 -0
  36. package/dist/learning/index.d.cts +104 -0
  37. package/dist/learning/index.d.ts +104 -0
  38. package/dist/learning/index.js +189 -0
  39. package/dist/negotiation/index.cjs +970 -0
  40. package/dist/negotiation/index.d.cts +610 -0
  41. package/dist/negotiation/index.d.ts +610 -0
  42. package/dist/negotiation/index.js +931 -0
  43. package/dist/skills/index.cjs +1118 -0
  44. package/dist/skills/index.d.cts +289 -0
  45. package/dist/skills/index.d.ts +289 -0
  46. package/dist/skills/index.js +1079 -0
  47. package/dist/swarm/index.cjs +5268 -0
  48. package/dist/swarm/index.d.cts +2433 -0
  49. package/dist/swarm/index.d.ts +2433 -0
  50. package/dist/swarm/index.js +5221 -0
  51. package/dist/training/index.cjs +2745 -0
  52. package/dist/training/index.d.cts +1734 -0
  53. package/dist/training/index.d.ts +1734 -0
  54. package/dist/training/index.js +2687 -0
  55. package/extract-failures.js +10 -0
  56. package/package.json +82 -0
  57. package/src/__tests__/bounty-marketplace.test.ts +374 -0
  58. package/src/__tests__/delegation.test.ts +144 -0
  59. package/src/__tests__/distributed-claimer.test.ts +147 -0
  60. package/src/__tests__/done-log-audit.test.ts +342 -0
  61. package/src/__tests__/framework.test.ts +865 -0
  62. package/src/__tests__/goal-synthesizer.test.ts +236 -0
  63. package/src/__tests__/presence.test.ts +223 -0
  64. package/src/__tests__/protocol-agent.test.ts +254 -0
  65. package/src/__tests__/revenue-splitter.test.ts +114 -0
  66. package/src/__tests__/scenario-driven-todo.test.ts +197 -0
  67. package/src/__tests__/self-improve.test.ts +349 -0
  68. package/src/__tests__/service-lifecycle.test.ts +237 -0
  69. package/src/__tests__/skill-router.test.ts +121 -0
  70. package/src/agents/AgentManifest.ts +493 -0
  71. package/src/agents/AgentRegistry.ts +475 -0
  72. package/src/agents/AgentTypes.ts +585 -0
  73. package/src/agents/AgentWalletRegistry.ts +83 -0
  74. package/src/agents/AuthenticatedCRDT.ts +388 -0
  75. package/src/agents/CapabilityMatcher.ts +453 -0
  76. package/src/agents/CrossRealityHandoff.ts +305 -0
  77. package/src/agents/CulturalMemory.ts +454 -0
  78. package/src/agents/FederatedRegistryAdapter.ts +429 -0
  79. package/src/agents/NormEngine.ts +450 -0
  80. package/src/agents/OrchestratorAgent.ts +414 -0
  81. package/src/agents/SkillWorkflowEngine.ts +472 -0
  82. package/src/agents/TaskDelegationService.ts +551 -0
  83. package/src/agents/__tests__/AgentManifest.prod.test.ts +134 -0
  84. package/src/agents/__tests__/AgentManifest.test.ts +182 -0
  85. package/src/agents/__tests__/AgentModule.test.ts +864 -0
  86. package/src/agents/__tests__/AgentRegistry.prod.test.ts +125 -0
  87. package/src/agents/__tests__/AgentRegistry.test.ts +148 -0
  88. package/src/agents/__tests__/AgentTypes.test.ts +534 -0
  89. package/src/agents/__tests__/AgentWalletRegistry.test.ts +152 -0
  90. package/src/agents/__tests__/AuthenticatedCRDT.test.ts +558 -0
  91. package/src/agents/__tests__/CapabilityMatcher.prod.test.ts +117 -0
  92. package/src/agents/__tests__/CapabilityMatcher.test.ts +178 -0
  93. package/src/agents/__tests__/CrossRealityHandoff.test.ts +402 -0
  94. package/src/agents/__tests__/CulturalMemory.test.ts +200 -0
  95. package/src/agents/__tests__/FederatedRegistryAdapter.test.ts +409 -0
  96. package/src/agents/__tests__/NormEngine.test.ts +276 -0
  97. package/src/agents/__tests__/OrchestratorAgent.test.ts +182 -0
  98. package/src/agents/__tests__/SkillWorkflowEngine.test.ts +357 -0
  99. package/src/agents/__tests__/TaskDelegationService.test.ts +446 -0
  100. package/src/agents/index.ts +107 -0
  101. package/src/agents/spatial-comms/Layer1RealTime.ts +621 -0
  102. package/src/agents/spatial-comms/Layer2A2A.ts +661 -0
  103. package/src/agents/spatial-comms/Layer3MCP.ts +651 -0
  104. package/src/agents/spatial-comms/ProtocolTypes.ts +543 -0
  105. package/src/agents/spatial-comms/SpatialCommClient.ts +483 -0
  106. package/src/agents/spatial-comms/__tests__/performance-benchmark.test.ts +465 -0
  107. package/src/agents/spatial-comms/examples/multi-agent-world-creation.ts +409 -0
  108. package/src/agents/spatial-comms/index.ts +66 -0
  109. package/src/ai/AIAdapter.ts +313 -0
  110. package/src/ai/AICopilot.ts +331 -0
  111. package/src/ai/AIOutputValidator.ts +203 -0
  112. package/src/ai/BTNodes.ts +239 -0
  113. package/src/ai/BehaviorSelector.ts +135 -0
  114. package/src/ai/BehaviorTree.ts +153 -0
  115. package/src/ai/Blackboard.ts +165 -0
  116. package/src/ai/GenerationAnalytics.ts +461 -0
  117. package/src/ai/GenerationCache.ts +265 -0
  118. package/src/ai/GoalPlanner.ts +165 -0
  119. package/src/ai/HoloScriptGenerator.ts +580 -0
  120. package/src/ai/InfluenceMap.ts +180 -0
  121. package/src/ai/NavMesh.ts +168 -0
  122. package/src/ai/PerceptionSystem.ts +178 -0
  123. package/src/ai/PromptTemplates.ts +453 -0
  124. package/src/ai/SemanticSearchService.ts +80 -0
  125. package/src/ai/StateMachine.ts +196 -0
  126. package/src/ai/SteeringBehavior.ts +150 -0
  127. package/src/ai/SteeringBehaviors.ts +244 -0
  128. package/src/ai/TrainingDataGenerator.ts +1082 -0
  129. package/src/ai/UtilityAI.ts +145 -0
  130. package/src/ai/__tests__/AIAdapter.prod.test.ts +259 -0
  131. package/src/ai/__tests__/AIAdapter.test.ts +109 -0
  132. package/src/ai/__tests__/AICopilot.prod.test.ts +341 -0
  133. package/src/ai/__tests__/AICopilot.test.ts +178 -0
  134. package/src/ai/__tests__/AIOutputValidator.prod.test.ts +226 -0
  135. package/src/ai/__tests__/AIOutputValidator.test.ts +138 -0
  136. package/src/ai/__tests__/BTNodes.prod.test.ts +391 -0
  137. package/src/ai/__tests__/BTNodes.test.ts +263 -0
  138. package/src/ai/__tests__/BehaviorSelector.prod.test.ts +129 -0
  139. package/src/ai/__tests__/BehaviorSelector.test.ts +132 -0
  140. package/src/ai/__tests__/BehaviorTree.prod.test.ts +266 -0
  141. package/src/ai/__tests__/BehaviorTree.test.ts +216 -0
  142. package/src/ai/__tests__/Blackboard.prod.test.ts +339 -0
  143. package/src/ai/__tests__/Blackboard.test.ts +183 -0
  144. package/src/ai/__tests__/GenerationAnalytics.prod.test.ts +141 -0
  145. package/src/ai/__tests__/GenerationAnalytics.test.ts +165 -0
  146. package/src/ai/__tests__/GenerationCache.prod.test.ts +144 -0
  147. package/src/ai/__tests__/GenerationCache.test.ts +171 -0
  148. package/src/ai/__tests__/GoalPlanner.prod.test.ts +189 -0
  149. package/src/ai/__tests__/GoalPlanner.test.ts +137 -0
  150. package/src/ai/__tests__/GoalPlannerDepth.prod.test.ts +217 -0
  151. package/src/ai/__tests__/HoloScriptGenerator.test.ts +125 -0
  152. package/src/ai/__tests__/InfluenceMap.prod.test.ts +146 -0
  153. package/src/ai/__tests__/InfluenceMap.test.ts +149 -0
  154. package/src/ai/__tests__/NavMesh.prod.test.ts +141 -0
  155. package/src/ai/__tests__/NavMesh.test.ts +159 -0
  156. package/src/ai/__tests__/PerceptionSystem.prod.test.ts +135 -0
  157. package/src/ai/__tests__/PerceptionSystem.test.ts +250 -0
  158. package/src/ai/__tests__/PromptTemplates.prod.test.ts +313 -0
  159. package/src/ai/__tests__/PromptTemplates.test.ts +146 -0
  160. package/src/ai/__tests__/SemanticSearch.test.ts +37 -0
  161. package/src/ai/__tests__/StateMachine.prod.test.ts +162 -0
  162. package/src/ai/__tests__/StateMachine.test.ts +163 -0
  163. package/src/ai/__tests__/SteeringBehavior.prod.test.ts +251 -0
  164. package/src/ai/__tests__/SteeringBehavior.test.ts +135 -0
  165. package/src/ai/__tests__/SteeringBehaviors.prod.test.ts +133 -0
  166. package/src/ai/__tests__/SteeringBehaviors.test.ts +151 -0
  167. package/src/ai/__tests__/TrainingDataGenerator.prod.test.ts +286 -0
  168. package/src/ai/__tests__/TrainingDataGenerator.test.ts +286 -0
  169. package/src/ai/__tests__/UtilityAI.prod.test.ts +207 -0
  170. package/src/ai/__tests__/UtilityAI.test.ts +155 -0
  171. package/src/ai/__tests__/adapters.prod.test.ts +263 -0
  172. package/src/ai/__tests__/adapters.test.ts +320 -0
  173. package/src/ai/adapters.ts +1585 -0
  174. package/src/ai/index.ts +130 -0
  175. package/src/behavior/BehaviorPresets.ts +140 -0
  176. package/src/behavior/BehaviorTree.ts +236 -0
  177. package/src/behavior/StateMachine.ts +176 -0
  178. package/src/behavior/StateTrait.ts +67 -0
  179. package/src/behavior/index.ts +8 -0
  180. package/src/behavior.ts +8 -0
  181. package/src/board/audit.ts +284 -0
  182. package/src/board/board-ops.ts +336 -0
  183. package/src/board/board-types.ts +302 -0
  184. package/src/board/index.ts +69 -0
  185. package/src/define-agent.ts +46 -0
  186. package/src/define-team.ts +33 -0
  187. package/src/delegation.ts +265 -0
  188. package/src/distributed-claimer.ts +228 -0
  189. package/src/economy/AgentBudgetEnforcer.ts +464 -0
  190. package/src/economy/BountyManager.ts +185 -0
  191. package/src/economy/CreatorRevenueAggregator.ts +460 -0
  192. package/src/economy/InvisibleWallet.ts +82 -0
  193. package/src/economy/KnowledgeMarketplace.ts +193 -0
  194. package/src/economy/PaymentWebhookService.ts +512 -0
  195. package/src/economy/RevenueSplitter.ts +156 -0
  196. package/src/economy/SubscriptionManager.ts +546 -0
  197. package/src/economy/UnifiedBudgetOptimizer.ts +635 -0
  198. package/src/economy/UsageMeter.ts +440 -0
  199. package/src/economy/_core-stubs.ts +219 -0
  200. package/src/economy/index.ts +100 -0
  201. package/src/economy/x402-facilitator.ts +1978 -0
  202. package/src/index.ts +348 -0
  203. package/src/knowledge/__tests__/knowledge-consolidator.test.ts +444 -0
  204. package/src/knowledge/__tests__/knowledge-store-vector.test.ts +291 -0
  205. package/src/knowledge/brain.ts +167 -0
  206. package/src/knowledge/consolidation.ts +581 -0
  207. package/src/knowledge/knowledge-consolidator.ts +510 -0
  208. package/src/knowledge/knowledge-store.ts +616 -0
  209. package/src/learning/MemoryConsolidator.ts +102 -0
  210. package/src/learning/MemoryScorer.ts +69 -0
  211. package/src/learning/ProceduralCompiler.ts +45 -0
  212. package/src/learning/SemanticClusterer.ts +66 -0
  213. package/src/learning/index.ts +8 -0
  214. package/src/llm/llm-adapter.ts +159 -0
  215. package/src/mesh/index.ts +309 -0
  216. package/src/negotiation/NegotiationProtocol.ts +694 -0
  217. package/src/negotiation/NegotiationTypes.ts +473 -0
  218. package/src/negotiation/VotingMechanisms.ts +691 -0
  219. package/src/negotiation/index.ts +49 -0
  220. package/src/protocol/goal-synthesizer.ts +317 -0
  221. package/src/protocol/implementations.ts +474 -0
  222. package/src/protocol/micro-phase-decomposer.ts +299 -0
  223. package/src/protocol/micro-step-decomposer.test.ts +306 -0
  224. package/src/protocol-agent.test.ts +353 -0
  225. package/src/protocol-agent.ts +670 -0
  226. package/src/self-improve/absorb-scanner.ts +252 -0
  227. package/src/self-improve/evolution-engine.ts +149 -0
  228. package/src/self-improve/framework-absorber.ts +214 -0
  229. package/src/self-improve/index.ts +50 -0
  230. package/src/self-improve/prompt-optimizer.ts +212 -0
  231. package/src/self-improve/test-generator.ts +175 -0
  232. package/src/skill-router.ts +186 -0
  233. package/src/skills/index.ts +5 -0
  234. package/src/skills/skill-md-bridge.ts +1699 -0
  235. package/src/swarm/ACOEngine.ts +261 -0
  236. package/src/swarm/CollectiveIntelligence.ts +383 -0
  237. package/src/swarm/ContributionSynthesizer.ts +481 -0
  238. package/src/swarm/LeaderElection.ts +393 -0
  239. package/src/swarm/PSOEngine.ts +206 -0
  240. package/src/swarm/QuorumPolicy.ts +173 -0
  241. package/src/swarm/SwarmCoordinator.ts +335 -0
  242. package/src/swarm/SwarmManager.ts +442 -0
  243. package/src/swarm/SwarmMembership.ts +456 -0
  244. package/src/swarm/VotingRound.ts +255 -0
  245. package/src/swarm/__tests__/ACOEngine.prod.test.ts +164 -0
  246. package/src/swarm/__tests__/ACOEngine.test.ts +117 -0
  247. package/src/swarm/__tests__/CollectiveIntelligence.prod.test.ts +296 -0
  248. package/src/swarm/__tests__/CollectiveIntelligence.test.ts +457 -0
  249. package/src/swarm/__tests__/ContributionSynthesizer.prod.test.ts +269 -0
  250. package/src/swarm/__tests__/ContributionSynthesizer.test.ts +254 -0
  251. package/src/swarm/__tests__/LeaderElection.prod.test.ts +196 -0
  252. package/src/swarm/__tests__/LeaderElection.test.ts +151 -0
  253. package/src/swarm/__tests__/PSOEngine.prod.test.ts +162 -0
  254. package/src/swarm/__tests__/PSOEngine.test.ts +106 -0
  255. package/src/swarm/__tests__/QuorumPolicy.prod.test.ts +216 -0
  256. package/src/swarm/__tests__/QuorumPolicy.test.ts +177 -0
  257. package/src/swarm/__tests__/SwarmCoordinator.prod.test.ts +186 -0
  258. package/src/swarm/__tests__/SwarmCoordinator.test.ts +167 -0
  259. package/src/swarm/__tests__/SwarmManager.prod.test.ts +308 -0
  260. package/src/swarm/__tests__/SwarmManager.test.ts +373 -0
  261. package/src/swarm/__tests__/SwarmMembership.prod.test.ts +273 -0
  262. package/src/swarm/__tests__/SwarmMembership.test.ts +264 -0
  263. package/src/swarm/__tests__/VotingRound.prod.test.ts +233 -0
  264. package/src/swarm/__tests__/VotingRound.test.ts +174 -0
  265. package/src/swarm/analytics/SwarmInspector.ts +476 -0
  266. package/src/swarm/analytics/SwarmMetrics.ts +449 -0
  267. package/src/swarm/analytics/__tests__/SwarmInspector.prod.test.ts +366 -0
  268. package/src/swarm/analytics/__tests__/SwarmInspector.test.ts +454 -0
  269. package/src/swarm/analytics/__tests__/SwarmMetrics.prod.test.ts +254 -0
  270. package/src/swarm/analytics/__tests__/SwarmMetrics.test.ts +370 -0
  271. package/src/swarm/analytics/index.ts +7 -0
  272. package/src/swarm/index.ts +69 -0
  273. package/src/swarm/messaging/BroadcastChannel.ts +509 -0
  274. package/src/swarm/messaging/GossipProtocol.ts +565 -0
  275. package/src/swarm/messaging/SwarmEventBus.ts +443 -0
  276. package/src/swarm/messaging/__tests__/BroadcastChannel.prod.test.ts +331 -0
  277. package/src/swarm/messaging/__tests__/BroadcastChannel.test.ts +333 -0
  278. package/src/swarm/messaging/__tests__/GossipProtocol.prod.test.ts +356 -0
  279. package/src/swarm/messaging/__tests__/GossipProtocol.test.ts +437 -0
  280. package/src/swarm/messaging/__tests__/SwarmEventBus.prod.test.ts +191 -0
  281. package/src/swarm/messaging/__tests__/SwarmEventBus.test.ts +247 -0
  282. package/src/swarm/messaging/index.ts +8 -0
  283. package/src/swarm/spatial/FlockingBehavior.ts +462 -0
  284. package/src/swarm/spatial/FormationController.ts +500 -0
  285. package/src/swarm/spatial/Vector3.ts +170 -0
  286. package/src/swarm/spatial/ZoneClaiming.ts +509 -0
  287. package/src/swarm/spatial/__tests__/FlockingBehavior.prod.test.ts +239 -0
  288. package/src/swarm/spatial/__tests__/FlockingBehavior.test.ts +298 -0
  289. package/src/swarm/spatial/__tests__/FormationController.prod.test.ts +240 -0
  290. package/src/swarm/spatial/__tests__/FormationController.test.ts +297 -0
  291. package/src/swarm/spatial/__tests__/Vector3.prod.test.ts +283 -0
  292. package/src/swarm/spatial/__tests__/Vector3.test.ts +224 -0
  293. package/src/swarm/spatial/__tests__/ZoneClaiming.prod.test.ts +246 -0
  294. package/src/swarm/spatial/__tests__/ZoneClaiming.test.ts +374 -0
  295. package/src/swarm/spatial/index.ts +28 -0
  296. package/src/team.ts +1245 -0
  297. package/src/training/LRScheduler.ts +377 -0
  298. package/src/training/QualityScoringPipeline.ts +139 -0
  299. package/src/training/SoftDedup.ts +461 -0
  300. package/src/training/SparsityMonitor.ts +685 -0
  301. package/src/training/SparsityMonitorTypes.ts +209 -0
  302. package/src/training/SpatialTrainingDataGenerator.ts +1526 -0
  303. package/src/training/SpatialTrainingDataTypes.ts +216 -0
  304. package/src/training/TrainingPipelineConfig.ts +215 -0
  305. package/src/training/constants.ts +94 -0
  306. package/src/training/index.ts +138 -0
  307. package/src/training/schema.ts +147 -0
  308. package/src/training/scripts/generate-novel-use-cases-dataset.ts +272 -0
  309. package/src/training/scripts/generate-spatial-dataset.ts +521 -0
  310. package/src/training/training/data/novel-use-cases.jsonl +153 -0
  311. package/src/training/training/data/spatial-reasoning-10k.jsonl +9354 -0
  312. package/src/training/trainingmonkey/TrainingMonkeyIntegration.ts +477 -0
  313. package/src/training/trainingmonkey/TrainingMonkeyTypes.ts +230 -0
  314. package/src/training/trainingmonkey/index.ts +26 -0
  315. package/src/training/trait-mappings.ts +157 -0
  316. package/src/types/core-stubs.d.ts +113 -0
  317. package/src/types.ts +304 -0
  318. package/test-output.txt +0 -0
  319. package/test-result.json +1 -0
  320. package/tsc-errors.txt +4 -0
  321. package/tsc_output.txt +0 -0
  322. package/tsconfig.json +14 -0
  323. package/tsup-learning-esm.config.ts +12 -0
  324. package/tsup.config.ts +21 -0
  325. package/typescript-errors-2.txt +0 -0
  326. package/typescript-errors.txt +22 -0
  327. package/vitest-log-utf8.txt +268 -0
  328. package/vitest-log.txt +0 -0
  329. package/vitest.config.ts +8 -0
@@ -0,0 +1,1729 @@
1
+ import { ac as StoredEntry, ad as ModelConfig, ae as KnowledgeStore, af as AgentConfig, c as BountyManager, ag as TeamConfig, ah as TaskDef, ai as CycleResult, aj as ProposalResult, ak as AgentRuntime, al as SuggestionCreateResult, am as SuggestionVoteResult, an as SuggestionStatus, ao as SuggestionListResult, ap as TeamMode, aq as SetModeResult, ar as DeriveResult, as as AgentPresence, at as PresenceResult, au as HeartbeatResult, e as BountyReward, B as Bounty, h as ClaimResult$1, i as CompletionProof, t as PayoutResult, av as ExcitabilityMetadata, aw as KnowledgeDomain, ax as HotBufferEntry, ay as ConsolidationResult, az as ReconsolidationEvent, aA as DomainConsolidationConfig, aB as KnowledgeInsight, aC as ProtocolAgentConfig, aD as ProtocolAgentHandle } from './InvisibleWallet-rtRrBOA8.js';
2
+ export { aE as AgentCycleResult, aF as AgentPresenceStatus, aG as AgentRole, aH as AgentStatus, b as BountyCurrency, d as BountyManagerConfig, f as BountyStatus, C as CHAIN_IDS, g as CHAIN_ID_TO_NETWORK, aI as ClaimFilter, aJ as ConsensusMode, k as CreatorRevenueAggregator, aK as DOMAIN_CONSOLIDATION, aL as DOMAIN_HALF_LIVES, aM as EmbedResult, I as InvisibleWalletStub, aN as KNOWLEDGE_DOMAINS, aO as KnowledgeConfig, K as KnowledgeListing, m as KnowledgeMarketplace, aP as LLMProvider, n as ListingResult, o as ListingStatus, M as MICRO_PAYMENT_THRESHOLD, p as MicroPaymentLedger, P as PaymentGateway, r as PaymentWebhookService, aQ as PhaseHook, aR as PresenceConfig, v as PricingFactors, aS as ProtocolStyle, w as PurchaseResult, aT as RECONSOLIDATION_WINDOW_MS, aU as ReputationTier, E as RevenueSplitter, aV as SemanticSearchOptions, aW as SlotInfo, aX as SlotRole, aY as Suggestion, aZ as SuggestionVoteEntry, U as USDC_CONTRACTS, a3 as X402Facilitator, aa as X402_VERSION, a_ as applyHalfLifeDecay, a$ as computeExcitability, b0 as triggerReconsolidation } from './InvisibleWallet-rtRrBOA8.js';
3
+ export { A as ActionNode, a as BTContext, B as BTNode, b as BehaviorTree, C as ConditionNode, I as InverterNode, N as NodeStatus, R as RepeaterNode, S as SelectorNode, c as SequenceNode, W as WaitNode } from './BehaviorTree-BrBFECv5.js';
4
+ export { BridgeResult, ClawHubManifest, HoloClawSkill, HoloClawSkillInput, HoloClawSkillOutput, ParsedSkill, SchemaField, SkillActionStep, SkillMetadata, SkillStateVar, SkillTest, SkillTraitDecl, fromHoloClawSkill, generateClawHubManifest, generateClawHubPackage, getHsInstallCommand, getInstallCommand, getPublishCommand, hsplusToSkillMd, parseHsplus, parseSkillMd, skillMdToHsplus, toHoloClawSkill, toHsplus, toSkillMd } from './skills/index.js';
5
+ export { AuditEntry, InitiateOptions, NegotiationConfig, NegotiationEvents, NegotiationProtocol, NegotiationSession, NegotiationStatus, Proposal, ProposalInput, ProposalStatus, Resolution, ResolutionOutcome, TieBreaker, Vote, VoteInput, VoteTally, VotingHandler, VotingMechanism, VotingResult, approvalHandler, bordaHandler, checkQuorum, consensusHandler, getNegotiationProtocol, getTrustWeight, getVotingHandler, majorityHandler, rankedHandler, resetNegotiationProtocol, supermajorityHandler, weightedHandler } from './negotiation/index.js';
6
+ import { G as Goal, B as BaseAgent, A as AgentIdentity, P as PhaseResult, b as ProtocolCycleResult } from './implementations-D9T3un9D.js';
7
+ export { c as BaseService, E as ExecutionPlan, d as ExecutionResult, e as Gotcha, M as MicroPhaseDecomposer, f as MicroPhaseGroup, g as MicroPhaseTask, h as PWGEntry, i as PWGSeverity, j as Pattern, a as ProtocolPhase, S as ServiceConfig, k as ServiceError, l as ServiceErrorCode, m as ServiceHealth, n as ServiceLifecycle, o as ServiceManager, p as ServiceManagerHealth, q as ServiceMetadata, r as ServiceMetrics, W as Wisdom, s as isGotcha, t as isPattern, u as isWisdom } from './implementations-D9T3un9D.js';
8
+ export { O as OrchestratorAgent, m as OrchestratorConfig } from './OrchestratorAgent-Q_CbVTmO.js';
9
+ export { ACOConfig, ACOEngine, ACOResult, AgentInfo, AntiEntropySync, BroadcastChannel, ChannelManager, CollectiveIntelligence, CollectiveIntelligenceConfig, ContributionSynthesizer, CreateSwarmRequest, DebugEventListener, DisbandOptions, ElectionMessage, ElectionRole, ElectionState, EventHandler, EventPriority, FlockingBehavior, FormationController, FormationType, GossipHandler, HeartbeatMessage, IAgentRelation, IAgentSnapshot, IBoid, IChannelConfig, IChannelMessage, IChannelSubscriber, IDebugEvent, IEventBusConfig, IEventBusStats, IEventSubscription, IFlockingConfig, IFormationConfig, IFormationSlot, IGossipConfig, IGossipMessage, IGossipPeer, IHealthCheck, IHistogramBuckets, IInspectionResult, IMetricDefinition, IMetricStats, IMetricValue, ISummaryPercentiles, ISwarmEvent, ISwarmSnapshot, IZone, IZoneClaim, IZoneClaimingConfig, IZoneEvent, JoinRequest, LeaderElection, LeaderElectionConfig, LeaveRequest, MemberInfo, MembershipEvent, MessageHandler, MetricType, PSOConfig, PSOEngine, PSOResult, Particle, PeerSelector, QuorumConfig, QuorumPolicy, QuorumState, QuorumStatus, SwarmCoordinator, SwarmEvent, SwarmEventBus, SwarmInfo, SwarmInspector, SwarmManager, SwarmManagerConfig, SwarmMembership, SwarmMembershipConfig, SwarmMetrics, SynthesisResult, SynthesizerConfig, TaskInfo, Vector3, VoteRequestMessage, VoteResponseMessage, VotingRound, VotingRoundConfig, ZoneClaiming, ZoneState } from './swarm/index.js';
10
+ export { AIAdapter, AICopilot, ALL_CATEGORIES, AnthropicAdapter, AnthropicAdapterConfig, BTStatus, BTTreeContext, BTTreeDef, BehaviorSelector, Blackboard, ExplainResult, FireworksAdapter, FireworksAdapterConfig, FixResult, GeminiAdapter, GeminiAdapterConfig, GenerateOptions, GenerateResult, GenerationAnalytics, GenerationCache, GoalPlanner, GuardFn, GuardNode, HoloScriptGenerator, InfluenceMap, LMStudioAdapter, LMStudioAdapterConfig, NVIDIAAdapter, NVIDIAAdapterConfig, NavMesh, OllamaAdapter, OllamaAdapterConfig, OpenAIAdapter, OpenAIAdapterConfig, OptimizeResult, ParallelNode, PerceptionSystem, PromptTemplate, PromptTemplateSystem, QuickPrompts, SearchResult, SemanticSearchService, StateAction, StateConfig, StateMachine, SteeringBehavior, SteeringBehaviors, TemplateContext, TogetherAdapter, TogetherAdapterConfig, TrainingDataGenerator, TransitionConfig, UtilityAI, XAIAdapter, XAIAdapterConfig, cachedGenerate, createAnalytics, createTrainingDataGenerator, explainHoloScript, fixHoloScript, generateBatch, generateHoloScript, generateHoloScriptWithAdapter, getAIAdapter, getDefaultAIAdapter, isAISafe, listAIAdapters, optimizeHoloScript, registerAIAdapter, setDefaultAIAdapter, unregisterAIAdapter, useAnthropic, useFireworks, useGemini, useGrok, useLMStudio, useNVIDIA, useOllama, useOpenAI, useTogether, useXAI, validateAIOutput, validateBatch } from './ai/index.js';
11
+ export { AlpacaEntry, DEFAULT_GENERATOR_THRESHOLDS, DEFAULT_INTEGRATION_CONFIG, DEFAULT_LR_SCHEDULER_CONFIG, DEFAULT_SCORING_CONFIG, DEFAULT_SOFTDEDUP_CONFIG, DEFAULT_TRAINING_PIPELINE_CONFIG, DIFFICULTY_LEVELS, DatasetSplit, DifficultyLevel, EnergyEfficiencyMetrics, GRPO_LR_SCHEDULER_CONFIG, GeneratorMetrics, IntegrationResult, LRScheduleStats, LRScheduler, LRSchedulerConfig, LRSchedulerSnapshot, LayerActivityInput, NgramStats, PipelineSettings, QUALITY_THRESHOLDS, QualityDetail, QualityScore, QualityScoringConfig, QualityScoringPipeline, QualityTier, RULEFORGE_DOMAINS, RuleForgeDomain, SNNLayerMetrics, SceneObject, SoftDedup, SoftDedupConfig, SoftDedupResult, SoftDedupStats, SparsityMonitor, SparsityMonitorConfig, SparsityMonitorStats, SparsityQualityHistoryEntry, SparsitySnapshot, SparsityViolation, SpatialDifficulty, SpatialGeneratorConfig, SpatialGeneratorStats, SpatialRelationship, SpatialRelationshipParams, SpatialRelationshipType, SpatialScene, SpatialTrainingDataGenerator, SpatialTrainingExample, SpatialTrainingJSONLEntry, SplitStats, TM_REGISTERED_TRAITS, TRAINING_CATEGORIES, TrainingCategory, TrainingCompressionResult, TrainingExample, TrainingExampleMetadata, TrainingHyperparameters, TrainingMetadata, TrainingMonkeyConfig, TrainingMonkeyIntegration, TrainingMonkeyIntegrationConfig, TrainingPipelineConfig, TrainingQualityScore, TrainingValidationError, TrainingValidationResult, TraitMapping, TraitValidationReport, WeightedAlpacaEntry, buildTrainingPipelineConfig, computeTotalSteps, createGRPOScheduler, createSFTScheduler, createSoftDedup, createSparsityMonitor, createSpatialTrainingDataGenerator, createTrainingMonkeyIntegration, generateValidationReport, getQualityTier, isValidCategory, isValidDifficulty, validateTrainingExample, validateTraitName } from './training/index.js';
12
+ export { EpisodicEvent, EpisodicMemory, MemoryConsolidator, MemoryScorer, ProceduralCompiler, ProceduralSkill, SemanticClusterer, SemanticFact } from './learning/index.js';
13
+ import '@holoscript/core';
14
+ import './AgentManifest-CB4xM-Ma.js';
15
+ import 'events';
16
+
17
+ /**
18
+ * GoalSynthesizer — Autonomous goal generation from context
19
+ *
20
+ * When a team's board is empty, agents should not idle. This module
21
+ * synthesizes goals from knowledge store context, recent activity,
22
+ * and domain expertise using an LLM (when available) or falling back
23
+ * to heuristic goal generation.
24
+ *
25
+ * Absorbed from @holoscript/agent-protocol per FW-0.2.
26
+ */
27
+
28
+ interface GoalContext {
29
+ /** Agent's primary domain (e.g. 'coding', 'research', 'security') */
30
+ domain: string;
31
+ /** Recent knowledge entries for context */
32
+ recentKnowledge?: StoredEntry[];
33
+ /** Recent completed task titles for dedup */
34
+ recentCompletedTasks?: string[];
35
+ /** Team name for context */
36
+ teamName?: string;
37
+ /** Agent name for personalization */
38
+ agentName?: string;
39
+ /** Agent capabilities */
40
+ capabilities?: string[];
41
+ /** Additional context to inject into the LLM prompt */
42
+ additionalContext?: string;
43
+ }
44
+ interface SynthesizedGoal extends Goal {
45
+ /** Rationale explaining why this goal was chosen */
46
+ rationale: string;
47
+ /** Relevance score 0-1 based on context alignment */
48
+ relevanceScore: number;
49
+ }
50
+ declare const GENERIC_GOALS: string[];
51
+ declare const DOMAIN_GOALS: Record<string, string[]>;
52
+ declare class GoalSynthesizer {
53
+ private llmConfig;
54
+ private knowledgeStore;
55
+ constructor(opts?: {
56
+ llm?: ModelConfig;
57
+ knowledge?: KnowledgeStore;
58
+ });
59
+ /**
60
+ * Synthesize goals from context. Uses LLM when available, falls back to heuristics.
61
+ * Returns goals ranked by relevance.
62
+ */
63
+ synthesizeMultiple(context: GoalContext, count?: number): Promise<SynthesizedGoal[]>;
64
+ /**
65
+ * Synthesize a single goal. Backward-compatible with the original API.
66
+ */
67
+ synthesize(agentDomain?: string, source?: Goal['source']): Goal;
68
+ private queryKnowledge;
69
+ private synthesizeWithLLM;
70
+ private parseLLMGoals;
71
+ private synthesizeHeuristic;
72
+ }
73
+
74
+ /**
75
+ * defineAgent() — Builder for creating agent configurations.
76
+ *
77
+ * Returns a validated AgentConfig that can be passed to defineTeam().
78
+ */
79
+
80
+ declare function defineAgent(config: AgentConfig): AgentConfig;
81
+
82
+ /**
83
+ * Board Types — Canonical home for all team board data structures.
84
+ *
85
+ * Absorbed from mcp-server/src/holomesh/http-routes.ts.
86
+ * The mcp-server should import these instead of defining inline.
87
+ */
88
+ type TaskStatus = 'open' | 'claimed' | 'done' | 'blocked';
89
+ type SlotRole = 'coder' | 'tester' | 'researcher' | 'reviewer' | 'flex';
90
+ interface TaskAction {
91
+ /** What to do when this task completes */
92
+ type: 'commit' | 'push' | 'deploy' | 'notify' | 'chain' | 'review';
93
+ /** For 'chain': task ID to unblock. For 'notify': agent name. For 'deploy': service name. */
94
+ target?: string;
95
+ /** Human-readable label shown in UI */
96
+ label?: string;
97
+ }
98
+ interface TeamTask {
99
+ id: string;
100
+ title: string;
101
+ description: string;
102
+ status: TaskStatus;
103
+ claimedBy?: string;
104
+ claimedByName?: string;
105
+ completedBy?: string;
106
+ commitHash?: string;
107
+ source?: string;
108
+ priority: number;
109
+ role?: SlotRole;
110
+ createdAt: string;
111
+ completedAt?: string;
112
+ /** Task IDs that must complete before this task can be claimed */
113
+ dependsOn?: string[];
114
+ /** Task IDs that this task unblocks when completed */
115
+ unblocks?: string[];
116
+ /** Actions to execute when this task is marked done */
117
+ onComplete?: TaskAction[];
118
+ /** Tags for filtering and categorization */
119
+ tags?: string[];
120
+ /** Arbitrary metadata (estimatedHours, repo, branch, etc.) */
121
+ metadata?: Record<string, unknown>;
122
+ }
123
+ interface DoneLogEntry {
124
+ taskId: string;
125
+ title: string;
126
+ completedBy: string;
127
+ commitHash?: string;
128
+ timestamp: string;
129
+ summary: string;
130
+ }
131
+ type SuggestionCategory = 'process' | 'tooling' | 'architecture' | 'testing' | 'docs' | 'performance' | 'other';
132
+ interface SuggestionVote {
133
+ agentId: string;
134
+ agentName: string;
135
+ value: 1 | -1;
136
+ reason?: string;
137
+ votedAt: string;
138
+ }
139
+ interface TeamSuggestion {
140
+ id: string;
141
+ title: string;
142
+ description: string;
143
+ category: SuggestionCategory;
144
+ proposedBy: string;
145
+ proposedByName: string;
146
+ votes: SuggestionVote[];
147
+ score: number;
148
+ status: 'open' | 'promoted' | 'dismissed';
149
+ promotedTaskId?: string;
150
+ evidence?: string;
151
+ createdAt: string;
152
+ resolvedAt?: string;
153
+ }
154
+ interface RoomPreset {
155
+ objective: string;
156
+ taskSources: string[];
157
+ rules: string[];
158
+ }
159
+ declare const ROOM_PRESETS: Record<string, RoomPreset>;
160
+ type AgentRole = 'architect' | 'coder' | 'researcher' | 'reviewer';
161
+ type AIProvider = 'anthropic' | 'openai' | 'xai';
162
+ interface ClaimFilter {
163
+ roles: SlotRole[];
164
+ maxPriority: number;
165
+ }
166
+ interface TeamAgentProfile {
167
+ id: string;
168
+ name: string;
169
+ role: AgentRole;
170
+ capabilities: string[];
171
+ model: string;
172
+ provider: AIProvider;
173
+ claimFilter: ClaimFilter;
174
+ systemPrompt: string;
175
+ knowledgeDomains: string[];
176
+ }
177
+ declare const BRITTNEY_AGENT: TeamAgentProfile;
178
+ declare const DAEMON_AGENT: TeamAgentProfile;
179
+ declare const ABSORB_AGENT: TeamAgentProfile;
180
+ declare const ORACLE_AGENT: TeamAgentProfile;
181
+ declare const TEAM_AGENT_PROFILES: ReadonlyMap<string, TeamAgentProfile>;
182
+ declare function getAllProfiles(): TeamAgentProfile[];
183
+ declare function getProfileById(id: string): TeamAgentProfile | undefined;
184
+ declare function getProfilesByClaimRole(role: SlotRole): TeamAgentProfile[];
185
+ declare function getProfilesByDomain(domain: string): TeamAgentProfile[];
186
+ /** Normalize a title for dedup comparison. */
187
+ declare function normalizeTitle(s: string): string;
188
+ /** Generate a unique task ID. */
189
+ declare function generateTaskId(): string;
190
+ /** Generate a unique suggestion ID. */
191
+ declare function generateSuggestionId(): string;
192
+ /** Infer priority from TODO/FIXME kind and text. */
193
+ declare function inferFixPriority(kind: string, text: string): number;
194
+ /** Parse a derive source (markdown, grep output) into task candidates. */
195
+ declare function parseDeriveContent(content: string, source: string): Array<Omit<TeamTask, 'id' | 'status' | 'createdAt'>>;
196
+
197
+ /**
198
+ * Done-Log Audit Logic (FW-0.3)
199
+ *
200
+ * Absorbed from mcp-server/src/holomesh/http-routes.ts.
201
+ * Verifies commit proof, detects duplicates, checks monotonic timestamps,
202
+ * and provides per-agent/per-source statistics.
203
+ *
204
+ * Two APIs:
205
+ * - `auditDoneLog(entries)` — the original function (unchanged signature)
206
+ * - `DoneLogAuditor` class — richer audit with stats, violations, and Team integration
207
+ */
208
+
209
+ interface AuditResult {
210
+ total: number;
211
+ proofRequiredTotal: number;
212
+ nonProofEntries: number;
213
+ verified: number;
214
+ unverified: number;
215
+ duplicates: number;
216
+ unverifiedTasks: Array<{
217
+ taskId: string;
218
+ title: string;
219
+ completedBy: string;
220
+ summary: string;
221
+ timestamp: string;
222
+ }>;
223
+ duplicateTasks: Array<{
224
+ title: string;
225
+ count: number;
226
+ }>;
227
+ health: {
228
+ verificationRate: number;
229
+ message: string;
230
+ };
231
+ }
232
+ /** A single violation found by the auditor. */
233
+ interface AuditViolation {
234
+ /** Which check produced this violation. */
235
+ rule: 'missing-completedBy' | 'missing-summary' | 'missing-commit' | 'duplicate-entry' | 'non-monotonic-timestamp';
236
+ /** Human-readable description. */
237
+ message: string;
238
+ /** The entry that triggered the violation. */
239
+ entry: DoneLogEntry;
240
+ }
241
+ /** Per-agent completion statistics. */
242
+ interface AgentStats {
243
+ agent: string;
244
+ completed: number;
245
+ verified: number;
246
+ unverified: number;
247
+ }
248
+ /** Per-source completion statistics. */
249
+ interface SourceStats {
250
+ source: string;
251
+ completed: number;
252
+ }
253
+ /** Completion rate bucket for a time period. */
254
+ interface CompletionBucket {
255
+ /** ISO date string (YYYY-MM-DD). */
256
+ date: string;
257
+ completed: number;
258
+ }
259
+ /** Full statistics from DoneLogAuditor.stats(). */
260
+ interface DoneLogStats {
261
+ total: number;
262
+ byAgent: AgentStats[];
263
+ bySource: SourceStats[];
264
+ completionOverTime: CompletionBucket[];
265
+ }
266
+ /** Combined audit + stats result from DoneLogAuditor. */
267
+ interface FullAuditResult {
268
+ /** Original AuditResult (backward compatible). */
269
+ audit: AuditResult;
270
+ /** Structural violations (missing fields, duplicates, non-monotonic). */
271
+ violations: AuditViolation[];
272
+ /** Statistics breakdown. */
273
+ stats: DoneLogStats;
274
+ }
275
+ /** Check if a done-log entry is a report/session summary (not real task work). */
276
+ declare function isLikelyReportEntry(entry: {
277
+ title?: string;
278
+ summary?: string;
279
+ }): boolean;
280
+ /** Check if a commit hash looks like real git proof. */
281
+ declare function isCommitProof(commitHash?: string): boolean;
282
+ /** Audit a done log: verify commits, find duplicates, calculate health. */
283
+ declare function auditDoneLog(doneLog: DoneLogEntry[]): AuditResult;
284
+ /**
285
+ * Stateless auditor that inspects a done-log for structural violations
286
+ * and computes aggregate statistics. Designed for Team.audit() integration.
287
+ */
288
+ declare class DoneLogAuditor {
289
+ private readonly entries;
290
+ constructor(entries: DoneLogEntry[]);
291
+ /**
292
+ * Run all audit checks and return violations.
293
+ *
294
+ * Checks:
295
+ * 1. Every done task has completedBy, summary, and commit proof
296
+ * 2. No duplicate entries (by taskId)
297
+ * 3. Timestamps are monotonically increasing
298
+ */
299
+ audit(): AuditViolation[];
300
+ /** Get aggregate statistics over the done log. */
301
+ stats(): DoneLogStats;
302
+ /** Run full audit: original AuditResult + violations + stats. */
303
+ fullAudit(): FullAuditResult;
304
+ }
305
+
306
+ /**
307
+ * Provider-Agnostic LLM Adapter
308
+ *
309
+ * Thin wrapper that dispatches to Anthropic, OpenAI, xAI, or OpenRouter.
310
+ * Each agent can use a different provider/model.
311
+ */
312
+
313
+ interface LLMMessage {
314
+ role: 'system' | 'user' | 'assistant';
315
+ content: string;
316
+ }
317
+ interface LLMResponse {
318
+ content: string;
319
+ model: string;
320
+ provider: string;
321
+ tokensUsed?: number;
322
+ }
323
+ declare function callLLM(config: ModelConfig, messages: LLMMessage[], options?: {
324
+ maxTokens?: number;
325
+ temperature?: number;
326
+ }): Promise<LLMResponse>;
327
+
328
+ /**
329
+ * MicroPhaseDecomposer — LLM-powered parallel task decomposition (FW-0.2)
330
+ *
331
+ * Takes a complex task description, uses an LLM to break it into independent
332
+ * micro-phases with dependency edges, then builds a wave-based execution plan
333
+ * where each wave runs in parallel.
334
+ *
335
+ * Two modes:
336
+ * 1. LLM-powered: `decompose()` calls the LLM to analyze task complexity
337
+ * 2. Manual: `decomposeManual()` accepts pre-defined phases (for testing / deterministic use)
338
+ *
339
+ * Wired into Team: when a task's estimated complexity exceeds a threshold,
340
+ * the team decomposes it before distributing sub-phases to agents.
341
+ */
342
+
343
+ interface TaskDescription {
344
+ id: string;
345
+ title: string;
346
+ description: string;
347
+ requiredCapabilities?: string[];
348
+ maxParallelism?: number;
349
+ complexityThreshold?: number;
350
+ }
351
+ interface MicroPhase {
352
+ id: string;
353
+ description: string;
354
+ dependencies: string[];
355
+ estimatedDuration: number;
356
+ requiredCapabilities: string[];
357
+ }
358
+ interface WaveExecutionPlan {
359
+ waves: MicroPhase[][];
360
+ totalEstimatedDuration: number;
361
+ parallelizationRatio: number;
362
+ phaseCount: number;
363
+ }
364
+ interface DecompositionResult {
365
+ taskId: string;
366
+ phases: MicroPhase[];
367
+ plan: WaveExecutionPlan;
368
+ wasDecomposed: boolean;
369
+ }
370
+ interface LLMAdapter {
371
+ call(messages: LLMMessage[], options?: {
372
+ maxTokens?: number;
373
+ temperature?: number;
374
+ }): Promise<string>;
375
+ }
376
+ /** Create an LLMAdapter from a ModelConfig */
377
+ declare function createLLMAdapter(config: ModelConfig): LLMAdapter;
378
+ declare class SmartMicroPhaseDecomposer {
379
+ private llm;
380
+ constructor(llm: LLMAdapter);
381
+ /**
382
+ * Decompose a complex task into parallel micro-phases using LLM analysis.
383
+ * Returns phases with dependency edges and a wave-based execution plan.
384
+ */
385
+ decompose(task: TaskDescription): Promise<DecompositionResult>;
386
+ /**
387
+ * Manual decomposition — accepts pre-defined phases. Useful for testing
388
+ * and deterministic pipelines where LLM analysis isn't needed.
389
+ */
390
+ decomposeManual(taskId: string, phases: MicroPhase[]): DecompositionResult;
391
+ /**
392
+ * Build an execution plan from phases — topological sort into parallel waves.
393
+ * Each wave contains phases that can run simultaneously.
394
+ */
395
+ buildExecutionPlan(phases: MicroPhase[]): WaveExecutionPlan;
396
+ private parseLLMResponse;
397
+ private fallbackSinglePhase;
398
+ private validatePhases;
399
+ private topologicalSort;
400
+ /**
401
+ * If maxParallelism is set, add synthetic dependencies to limit
402
+ * the number of phases running concurrently in any wave.
403
+ */
404
+ private enforceParallelismLimit;
405
+ }
406
+
407
+ /**
408
+ * Mesh Module — Peer discovery, signaling, gossip, and A2A interoperability.
409
+ *
410
+ * Canonical home for mesh primitives (previously in @holoscript/agent-sdk,
411
+ * which has been deleted).
412
+ */
413
+ interface PeerMetadata {
414
+ id: string;
415
+ hostname: string;
416
+ port: number;
417
+ version: string;
418
+ agentCount: number;
419
+ capabilities: string[];
420
+ lastSeen: number;
421
+ latency?: number;
422
+ }
423
+ declare class MeshDiscovery {
424
+ private peers;
425
+ private emitter;
426
+ readonly localId: string;
427
+ constructor(localId?: string);
428
+ registerPeer(peer: PeerMetadata): void;
429
+ removePeer(peerId: string): boolean;
430
+ getPeers(): PeerMetadata[];
431
+ getPeer(id: string): PeerMetadata | undefined;
432
+ getPeerCount(): number;
433
+ pruneStalePeers(timeoutMs?: number): number;
434
+ onPeerDiscovered(cb: (peer: PeerMetadata) => void): () => void;
435
+ onPeerLost(cb: (peer: PeerMetadata) => void): () => void;
436
+ }
437
+ type SignalType = 'did-resolver' | 'mcp-server' | 'storage-node' | 'agent-host' | string;
438
+ interface MeshSignal {
439
+ type: SignalType;
440
+ nodeId: string;
441
+ url: string;
442
+ capabilities: string[];
443
+ expiresAt: number;
444
+ }
445
+ declare class SignalService {
446
+ private localSignals;
447
+ private remoteSignals;
448
+ readonly nodeId: string;
449
+ constructor(nodeId?: string);
450
+ broadcastSignal(signal: Omit<MeshSignal, 'nodeId' | 'expiresAt'>, ttlMs?: number): MeshSignal;
451
+ receiveSignal(signal: MeshSignal): void;
452
+ discoverSignals(type: SignalType): MeshSignal[];
453
+ getLocalSignals(): MeshSignal[];
454
+ }
455
+ interface GossipPacket {
456
+ id: string;
457
+ source: string;
458
+ version: number;
459
+ payload: unknown;
460
+ timestamp: number;
461
+ }
462
+ declare class GossipProtocol {
463
+ private pool;
464
+ shareWisdom(sourceId: string, payload: unknown): GossipPacket;
465
+ antiEntropySync(peerPool: Map<string, GossipPacket>): number;
466
+ getPool(): Map<string, GossipPacket>;
467
+ getPoolSize(): number;
468
+ }
469
+ interface MCPToolSchema {
470
+ name: string;
471
+ description: string;
472
+ inputSchema: Record<string, unknown>;
473
+ }
474
+ declare const MCP_TOOL_SCHEMAS: MCPToolSchema[];
475
+ interface AgentCard {
476
+ name: string;
477
+ description: string;
478
+ version: string;
479
+ url: string;
480
+ capabilities: AgentCapability[];
481
+ skills: AgentSkill[];
482
+ authentication?: AgentAuthentication;
483
+ defaultInputModes?: string[];
484
+ defaultOutputModes?: string[];
485
+ }
486
+ interface AgentCapability {
487
+ id: string;
488
+ name: string;
489
+ description: string;
490
+ }
491
+ interface AgentSkill {
492
+ id: string;
493
+ name: string;
494
+ description: string;
495
+ tags: string[];
496
+ examples?: string[];
497
+ }
498
+ interface AgentAuthentication {
499
+ type: 'none' | 'api-key' | 'oauth2' | 'bearer';
500
+ credentials?: Record<string, string>;
501
+ }
502
+ declare function createAgentCard(config: {
503
+ name: string;
504
+ description: string;
505
+ version: string;
506
+ url: string;
507
+ skills: AgentSkill[];
508
+ capabilities?: AgentCapability[];
509
+ auth?: AgentAuthentication;
510
+ }): AgentCard;
511
+ declare function validateAgentCard(card: unknown): {
512
+ valid: boolean;
513
+ errors: string[];
514
+ };
515
+
516
+ /**
517
+ * Team — The central orchestrator.
518
+ *
519
+ * A persistent, knowledge-compounding workspace where agents claim tasks,
520
+ * execute work, publish knowledge, and get smarter over time.
521
+ *
522
+ * Local-first: works entirely in-process. Optional remote board/knowledge.
523
+ */
524
+
525
+ declare class Team {
526
+ readonly name: string;
527
+ readonly knowledge: KnowledgeStore;
528
+ private config;
529
+ private agentConfigs;
530
+ private runtimes;
531
+ private board;
532
+ private doneLog;
533
+ private cycle;
534
+ private consensusMode;
535
+ private proposals;
536
+ private localSuggestions;
537
+ private currentMode;
538
+ private modeObjective;
539
+ private modeRules;
540
+ private goalSynthesizer;
541
+ private decomposer;
542
+ private presenceRecords;
543
+ private idleTimeoutMs;
544
+ private offlineTimeoutMs;
545
+ readonly mesh: MeshDiscovery;
546
+ readonly signals: SignalService;
547
+ readonly gossip: GossipProtocol;
548
+ readonly bounties: BountyManager;
549
+ constructor(config: TeamConfig);
550
+ /** Whether this team is connected to a remote HoloMesh board. */
551
+ get isRemote(): boolean;
552
+ /** POST/GET/PATCH to remote board API. Returns null if local-only. */
553
+ private boardFetch;
554
+ /** Add tasks to the board. Deduplicates by normalized title. */
555
+ addTasks(tasks: Array<Omit<TaskDef, 'id' | 'status' | 'createdAt'>>): Promise<TaskDef[]>;
556
+ /** Get all open tasks, sorted by priority. */
557
+ get openTasks(): TaskDef[];
558
+ /** Get all board tasks. */
559
+ get allTasks(): TaskDef[];
560
+ /** Get completed task count. */
561
+ get completedCount(): number;
562
+ /**
563
+ * Run one work cycle: each agent checks the board, claims a matching task,
564
+ * executes it via LLM, publishes knowledge, and compounds insights.
565
+ */
566
+ runCycle(): Promise<CycleResult>;
567
+ /** Remote work cycle: board ops via HoloMesh API, execution local via LLM. */
568
+ private runRemoteCycle;
569
+ /** Propose a decision for the team to vote on. */
570
+ propose<T>(key: string, value: T): Promise<ProposalResult<T>>;
571
+ /** Get the reputation leaderboard. */
572
+ leaderboard(): AgentRuntime[];
573
+ /** Get a specific agent's runtime. */
574
+ getAgent(name: string): AgentRuntime | undefined;
575
+ /**
576
+ * Audit the done log: check for missing fields, duplicates, non-monotonic
577
+ * timestamps, and return aggregate statistics.
578
+ *
579
+ * Works in both local and remote modes. In local mode, the internal doneLog
580
+ * is converted to DoneLogEntry format. In remote mode, fetches the board
581
+ * and extracts the done log from the response.
582
+ */
583
+ audit(): Promise<FullAuditResult>;
584
+ /**
585
+ * Create a suggestion for the team.
586
+ * Works locally (in-memory) and remotely (delegates to HoloMesh API).
587
+ */
588
+ suggest(title: string, opts?: {
589
+ description?: string;
590
+ category?: string;
591
+ evidence?: string;
592
+ proposedBy?: string;
593
+ autoPromoteThreshold?: number;
594
+ autoDismissThreshold?: number;
595
+ }): Promise<SuggestionCreateResult>;
596
+ /**
597
+ * Vote on an existing suggestion.
598
+ * Local mode: vote(id, agentName, 'up'|'down', reason?).
599
+ * Remote mode: vote(id, 1|-1, reason?) for backward compatibility.
600
+ */
601
+ vote(suggestionId: string, agentNameOrValue: string | 1 | -1, voteOrReason?: 'up' | 'down' | string, reason?: string): Promise<SuggestionVoteResult>;
602
+ /**
603
+ * List suggestions, optionally filtered by status.
604
+ * Works locally (in-memory) and remotely (delegates to HoloMesh API).
605
+ */
606
+ suggestions(status?: SuggestionStatus): Promise<SuggestionListResult>;
607
+ /** Promote a suggestion to a board task manually. Local-only. */
608
+ promoteSuggestion(suggestionId: string, promoterName?: string): Promise<SuggestionVoteResult>;
609
+ /** Dismiss a suggestion. Local-only. */
610
+ dismissSuggestion(suggestionId: string): SuggestionVoteResult;
611
+ /** Get the current operating mode. */
612
+ get mode(): TeamMode;
613
+ /** Get the current mode's objective string. */
614
+ get objective(): string;
615
+ /** Get the current mode's rules. */
616
+ get rules(): string[];
617
+ /** Switch the team's operating mode. Local-first with optional remote sync. */
618
+ setMode(mode: TeamMode): Promise<SetModeResult>;
619
+ /**
620
+ * Derive tasks from a source document (audit, roadmap, grep output, etc.).
621
+ * Parses markdown checkboxes, section headers, and TODO/FIXME patterns.
622
+ * Deduplicates against existing board and done log.
623
+ * Works locally and remotely.
624
+ */
625
+ derive(source: string, content: string): Promise<DeriveResult>;
626
+ /**
627
+ * Delegate a task from this team's board to another team's board.
628
+ * Modifies both boards. Requires connected remote board.
629
+ */
630
+ delegate(otherTeamId: string, taskId: string): Promise<boolean>;
631
+ /**
632
+ * Record that an agent is alive. Updates lastSeen timestamp.
633
+ * Works locally on all teams. Optionally pass the task the agent is working on.
634
+ */
635
+ localHeartbeat(agentName: string, currentTask?: string): void;
636
+ /**
637
+ * Return the presence status of all known agents.
638
+ * Agents not heartbeating within idleTimeoutMs → 'idle'.
639
+ * Agents not heartbeating within offlineTimeoutMs → 'offline'.
640
+ */
641
+ localPresence(): AgentPresence[];
642
+ /** Get presence/slot info for the team. Requires remote board. */
643
+ presence(): Promise<PresenceResult>;
644
+ /** Send a heartbeat to the team's presence system. Requires remote board. */
645
+ heartbeat(ideType?: string): Promise<HeartbeatResult>;
646
+ /**
647
+ * Get discovered peers with their metadata.
648
+ * Prunes stale peers (>15s since last seen) before returning.
649
+ */
650
+ peers(): PeerMetadata[];
651
+ /**
652
+ * Register a peer node for multi-team coordination.
653
+ */
654
+ registerPeer(peer: PeerMetadata): void;
655
+ /**
656
+ * Broadcast this team's capabilities as a mesh signal.
657
+ * Other teams can discover this signal via `signals.discoverSignals('agent-host')`.
658
+ */
659
+ broadcastCapabilities(url?: string): void;
660
+ /**
661
+ * Share a knowledge insight via gossip protocol.
662
+ * Returns the gossip packet for cross-team anti-entropy sync.
663
+ */
664
+ shareKnowledge(payload: unknown): GossipPacket;
665
+ /**
666
+ * Sync knowledge from a peer's gossip pool.
667
+ * Returns the number of new entries absorbed.
668
+ */
669
+ syncFromPeer(peerPool: Map<string, GossipPacket>): number;
670
+ /** On-demand scout: parse TODO/FIXME content into tasks. */
671
+ scoutFromTodos(grepOutput: string): Promise<TaskDef[]>;
672
+ /**
673
+ * Decompose a complex task into parallel micro-phases and distribute
674
+ * the sub-phases as individual board tasks. Each sub-phase becomes a
675
+ * separate task that agents can claim independently.
676
+ *
677
+ * Returns the decomposition result including the wave-based execution plan.
678
+ * If no decomposer is available (no LLM configured), falls back to adding
679
+ * the task as-is.
680
+ */
681
+ decomposeAndDistribute(task: TaskDef): Promise<DecompositionResult | null>;
682
+ /** Get the decomposer instance for direct use (e.g., manual decomposition). */
683
+ getDecomposer(): SmartMicroPhaseDecomposer | null;
684
+ listBoard(): Promise<Record<string, unknown>>;
685
+ claimTask(taskId: string): Promise<Record<string, unknown>>;
686
+ completeTask(taskId: string, commit?: string, summary?: string): Promise<Record<string, unknown>>;
687
+ assignSlots(roles: string[]): Promise<Record<string, unknown>>;
688
+ /** Create a bounty for a board task. */
689
+ createBounty(taskId: string, reward: BountyReward, createdBy: string, deadline?: number): Bounty;
690
+ /** Claim a bounty for an agent. */
691
+ claimBountyForAgent(bountyId: string, agentId: string): ClaimResult$1;
692
+ /** Complete a bounty with proof. */
693
+ completeBountyWithProof(bountyId: string, proof: CompletionProof): PayoutResult;
694
+ /** List bounties, optionally filtered by status. */
695
+ listBounties(status?: Bounty['status']): Bounty[];
696
+ /** Convert a synthesized Goal into a TaskDef and add it to the board. */
697
+ private goalToTask;
698
+ private findClaimableTask;
699
+ private executeTask;
700
+ private getAgentVote;
701
+ }
702
+
703
+ /**
704
+ * defineTeam() — Builder for creating a Team instance.
705
+ *
706
+ * Validates configuration and returns a ready-to-use Team.
707
+ */
708
+
709
+ declare function defineTeam(config: TeamConfig): Team;
710
+
711
+ /**
712
+ * Consolidation Engine — Pure state machine for neuroscience-inspired memory consolidation.
713
+ *
714
+ * Absorbed from mcp-server/src/holomesh/crdt-sync.ts (V9 consolidation cycle).
715
+ * Extracts the hot buffer → cold store promotion pipeline as a standalone engine
716
+ * with no CRDT, HTTP, or persistence dependencies.
717
+ *
718
+ * Algorithm (6-phase biological consolidation cycle):
719
+ * 1. REPLAY — Filter hot buffer by TTL + corroboration threshold
720
+ * 1.5 SANITIZE — Reject entries with injection patterns (defense-in-depth)
721
+ * 2. CLUSTER — Find duplicate/overlapping entries by content+type
722
+ * 3. MERGE — Combine corroborations from duplicates
723
+ * 4. DOWNSCALE — Reduce all cold store excitability (synaptic homeostasis)
724
+ * 5. PROMOTE — Move surviving hot entries to cold store with metadata
725
+ * 6. PRUNE — Evict lowest-excitability entries when over capacity
726
+ */
727
+
728
+ interface ColdStoreEntry {
729
+ id: string;
730
+ content: string;
731
+ type: string;
732
+ authorDid: string;
733
+ tags: string[];
734
+ timestamp: number;
735
+ accessCount: number;
736
+ lastAccessed: number;
737
+ _excitability: ExcitabilityMetadata;
738
+ _contradictions?: string[];
739
+ _deprecated?: boolean;
740
+ _deprecatedAt?: number;
741
+ _deprecationReason?: string;
742
+ }
743
+ /**
744
+ * ConsolidationEngine manages hot buffer + cold store per knowledge domain.
745
+ *
746
+ * Pure state machine — no HTTP, no CRDT, no persistence.
747
+ * Feed it entries via `ingest()`, run cycles via `runConsolidationCycle()`,
748
+ * and read results via `getHotBuffer()` / `getColdStore()`.
749
+ */
750
+ declare class ConsolidationEngine {
751
+ private hotBuffers;
752
+ private coldStores;
753
+ private lastConsolidation;
754
+ private reconsolidationWindows;
755
+ constructor();
756
+ /**
757
+ * Ingest knowledge into the hot buffer (hippocampus).
758
+ * Entries stage here until a consolidation cycle promotes them.
759
+ */
760
+ ingest(domain: KnowledgeDomain, entry: {
761
+ content: string;
762
+ type: string;
763
+ authorDid: string;
764
+ tags: string[];
765
+ }, sourcePeerDid: string): HotBufferEntry;
766
+ /**
767
+ * Corroborate a hot buffer entry (another peer independently confirms it).
768
+ * Increases promotion likelihood during consolidation.
769
+ */
770
+ corroborate(domain: KnowledgeDomain, entryId: string, peerDid: string): boolean;
771
+ /**
772
+ * Seed cold store directly (for loading persisted state).
773
+ */
774
+ seedColdStore(domain: KnowledgeDomain, entries: ColdStoreEntry[]): void;
775
+ /**
776
+ * Run a consolidation (sleep) cycle for a specific domain.
777
+ *
778
+ * Implements the 6-phase biological consolidation cycle:
779
+ * 1. REPLAY — Filter hot buffer by TTL and corroboration threshold
780
+ * 1.5 SANITIZE — Reject entries with injection patterns
781
+ * 2. CLUSTER — Find duplicate/overlapping entries (content+type match)
782
+ * 3. MERGE — Combine corroborations from duplicates
783
+ * 4. DOWNSCALE — Reduce all cold store excitability (synaptic homeostasis)
784
+ * 5. PROMOTE — Move validated entries from hot buffer to cold store
785
+ * 6. PRUNE — Evict lowest-excitability entries if over capacity
786
+ */
787
+ runConsolidationCycle(domain: KnowledgeDomain): ConsolidationResult;
788
+ /**
789
+ * Run consolidation across ALL domains (full sleep cycle).
790
+ * Only consolidates domains whose sleepFrequency has elapsed.
791
+ */
792
+ sleepCycle(force?: boolean): ConsolidationResult[];
793
+ /**
794
+ * Check if any domain needs a consolidation cycle.
795
+ */
796
+ needsConsolidation(): {
797
+ domain: KnowledgeDomain;
798
+ overdue: boolean;
799
+ bufferSize: number;
800
+ }[];
801
+ /**
802
+ * Retrieve a cold store entry with excitability strengthening.
803
+ * Every retrieval is a read-modify-write that strengthens the entry
804
+ * and opens a reconsolidation window for updates.
805
+ */
806
+ retrieveWithReconsolidation(domain: KnowledgeDomain, entryId: string): {
807
+ entry: ColdStoreEntry;
808
+ reconsolidation: ReconsolidationEvent;
809
+ } | null;
810
+ /**
811
+ * Update an entry during its reconsolidation window.
812
+ * Returns false if the window is closed or entry not found.
813
+ */
814
+ reconsolidateEntry(domain: KnowledgeDomain, entryId: string, updatedContent: string): boolean;
815
+ /**
816
+ * Mark an entry as contradicted by a peer.
817
+ * 3+ contradictions → pruned (microglia-mediated removal).
818
+ */
819
+ contradictEntry(domain: KnowledgeDomain, entryId: string, contradictingPeerDid: string): {
820
+ contradicted: boolean;
821
+ pruned: boolean;
822
+ };
823
+ /**
824
+ * Deprecate an entry (self-superseding).
825
+ * Zeroes excitability — will be pruned in next consolidation cycle.
826
+ */
827
+ deprecateEntry(domain: KnowledgeDomain, entryId: string, reason: string): boolean;
828
+ /** Get hot buffer contents for a domain (copy). */
829
+ getHotBuffer(domain: KnowledgeDomain): HotBufferEntry[];
830
+ /** Get cold store entries for a domain (copy). */
831
+ getColdStore(domain: KnowledgeDomain): ColdStoreEntry[];
832
+ /** Get cold store entry by ID. */
833
+ getColdStoreEntry(domain: KnowledgeDomain, entryId: string): ColdStoreEntry | undefined;
834
+ /** Get hot buffer size across all domains. */
835
+ getHotBufferStats(): {
836
+ domain: string;
837
+ count: number;
838
+ }[];
839
+ /** Get cold store size across all domains. */
840
+ getColdStoreStats(): {
841
+ domain: string;
842
+ count: number;
843
+ }[];
844
+ /** Get consolidation config for a domain. */
845
+ getDomainConfig(domain: KnowledgeDomain): DomainConsolidationConfig;
846
+ /**
847
+ * Surface entries that appear across multiple domains, indicating cross-cutting patterns.
848
+ * Uses token overlap to find similar entries in different domains.
849
+ * Returns pairs of entries whose content overlaps above the threshold.
850
+ */
851
+ surfaceCrossDomainPatterns(minOverlap?: number): CrossDomainMatch[];
852
+ }
853
+ interface CrossDomainMatch {
854
+ entryA: {
855
+ id: string;
856
+ domain: KnowledgeDomain;
857
+ content: string;
858
+ };
859
+ entryB: {
860
+ id: string;
861
+ domain: KnowledgeDomain;
862
+ content: string;
863
+ };
864
+ overlap: number;
865
+ }
866
+
867
+ /**
868
+ * Knowledge Consolidator — FW-0.5
869
+ *
870
+ * Higher-level orchestrator that adds:
871
+ * - Tiered sleep/wake consolidation (hot → warm → cold)
872
+ * - Cross-domain pattern surfacing
873
+ * - Contradiction detection (content-based, not just peer-flagged)
874
+ * - Provenance chain tracking
875
+ *
876
+ * Builds on KnowledgeStore (local persistence) and ConsolidationEngine (pure state machine).
877
+ */
878
+
879
+ type KnowledgeTier = 'hot' | 'warm' | 'cold';
880
+ interface TieredEntry extends StoredEntry {
881
+ tier: KnowledgeTier;
882
+ /** Last tier transition timestamp */
883
+ tierChangedAt: number;
884
+ /** Full provenance chain (newest first) */
885
+ provenanceChain: ProvenanceNode[];
886
+ }
887
+ interface ProvenanceNode {
888
+ /** Entry ID at this point */
889
+ entryId: string;
890
+ /** Agent that created or modified */
891
+ agentId: string;
892
+ /** Timestamp of action */
893
+ timestamp: number;
894
+ /** What happened */
895
+ action: 'created' | 'promoted' | 'demoted' | 'merged' | 'corrected' | 'cited';
896
+ /** Optional parent entry (what was this derived from) */
897
+ parentEntryId?: string;
898
+ /** Optional hash for integrity verification */
899
+ hash?: string;
900
+ }
901
+ interface CrossDomainPattern {
902
+ /** Shared keywords or concepts across domains */
903
+ pattern: string;
904
+ /** Domains where the pattern appears */
905
+ domains: string[];
906
+ /** Entries contributing to this pattern */
907
+ entries: Array<{
908
+ id: string;
909
+ domain: string;
910
+ snippet: string;
911
+ }>;
912
+ /** Strength: how many entries corroborate */
913
+ strength: number;
914
+ }
915
+ interface Contradiction {
916
+ /** First entry */
917
+ entryA: {
918
+ id: string;
919
+ content: string;
920
+ domain: string;
921
+ };
922
+ /** Conflicting entry */
923
+ entryB: {
924
+ id: string;
925
+ content: string;
926
+ domain: string;
927
+ };
928
+ /** Why they conflict */
929
+ reason: string;
930
+ /** Confidence that this is a real contradiction (0-1) */
931
+ confidence: number;
932
+ }
933
+ interface ConsolidationStats {
934
+ demoted: number;
935
+ promoted: number;
936
+ evicted: number;
937
+ timestamp: number;
938
+ }
939
+ /** Thresholds for tier transitions */
940
+ interface ConsolidatorConfig {
941
+ /** Entries with no queries in this many ms get demoted hot→warm (default: 6h) */
942
+ warmDemoteAfterMs: number;
943
+ /** Entries with no queries in this many ms get demoted warm→cold (default: 48h) */
944
+ coldDemoteAfterMs: number;
945
+ /** Max entries in hot tier before forced demotion (default: 100) */
946
+ hotCapacity: number;
947
+ /** Max entries in warm tier before forced demotion (default: 500) */
948
+ warmCapacity: number;
949
+ }
950
+ /**
951
+ * Orchestrates tiered consolidation, cross-domain surfacing,
952
+ * contradiction detection, and provenance chain tracking.
953
+ */
954
+ declare class KnowledgeConsolidator {
955
+ private tiers;
956
+ private config;
957
+ constructor(config?: Partial<ConsolidatorConfig>);
958
+ /**
959
+ * Import entries from a KnowledgeStore into the tiered system.
960
+ * All imported entries start in the hot tier.
961
+ */
962
+ importFromStore(store: KnowledgeStore): number;
963
+ /**
964
+ * Add a single entry directly.
965
+ */
966
+ addEntry(entry: StoredEntry, parentEntryId?: string): TieredEntry;
967
+ /**
968
+ * Sleep cycle: demote stale entries down tiers.
969
+ * hot → warm if no access within warmDemoteAfterMs
970
+ * warm → cold if no access within coldDemoteAfterMs
971
+ */
972
+ sleepCycle(): ConsolidationStats;
973
+ /**
974
+ * Wake cycle: promote entries that were recently accessed back up tiers.
975
+ * cold → warm if accessed since last sleep
976
+ * warm → hot if access count > 3 since demotion
977
+ */
978
+ wakeCycle(): ConsolidationStats;
979
+ /**
980
+ * Promote a specific entry to a higher tier.
981
+ */
982
+ promote(entryId: string): boolean;
983
+ /**
984
+ * Evict an entry from all tiers.
985
+ */
986
+ evict(entryId: string): boolean;
987
+ /**
988
+ * Find entries that share concepts across multiple domains.
989
+ * Extracts significant keywords from each entry and groups
990
+ * entries that share keywords across different domains.
991
+ */
992
+ surfaceCrossDomainPatterns(domains?: string[]): CrossDomainPattern[];
993
+ /**
994
+ * Detect contradictions between entries.
995
+ *
996
+ * Strategy: find entry pairs in the same or related domains where:
997
+ * 1. They share significant keywords (about the same topic)
998
+ * 2. One contains negation patterns relative to the other
999
+ *
1000
+ * This is a heuristic — not an LLM call. False positives are expected
1001
+ * and should be reviewed by agents.
1002
+ */
1003
+ detectContradictions(entries?: StoredEntry[]): Contradiction[];
1004
+ /**
1005
+ * Get the full provenance chain for an entry.
1006
+ * Returns nodes from most recent to oldest.
1007
+ */
1008
+ getProvenanceChain(entryId: string): ProvenanceNode[];
1009
+ /**
1010
+ * Record a citation: entry B cites entry A.
1011
+ */
1012
+ recordCitation(citedEntryId: string, citingAgentId: string): boolean;
1013
+ getByTier(tier: KnowledgeTier): TieredEntry[];
1014
+ getEntry(id: string): TieredEntry | undefined;
1015
+ get size(): number;
1016
+ stats(): {
1017
+ hot: number;
1018
+ warm: number;
1019
+ cold: number;
1020
+ total: number;
1021
+ };
1022
+ all(): TieredEntry[];
1023
+ private appendProvenance;
1024
+ }
1025
+
1026
+ /**
1027
+ * ProtocolAgent — Concrete BaseAgent backed by LLM calls.
1028
+ *
1029
+ * Wraps the 7-phase uAA2++ lifecycle around a team agent's task execution.
1030
+ * Uses haiku-tier models for lightweight phases (reflect, compress, grow, evolve)
1031
+ * and the agent's configured model for the execute phase.
1032
+ */
1033
+
1034
+ /** Result of executing a full protocol cycle on a task. */
1035
+ interface ProtocolTaskResult {
1036
+ summary: string;
1037
+ insights: KnowledgeInsight[];
1038
+ phaseResults: PhaseResult[];
1039
+ totalDurationMs: number;
1040
+ }
1041
+ declare class ProtocolAgent extends BaseAgent {
1042
+ readonly identity: AgentIdentity;
1043
+ private agentConfig;
1044
+ private teamKnowledge;
1045
+ private task;
1046
+ constructor(agentConfig: AgentConfig, teamKnowledge?: string);
1047
+ intake(input: unknown): Promise<PhaseResult>;
1048
+ reflect(data: unknown): Promise<PhaseResult>;
1049
+ execute(plan: unknown): Promise<PhaseResult>;
1050
+ compress(results: unknown): Promise<PhaseResult>;
1051
+ reintake(compressed: unknown): Promise<PhaseResult>;
1052
+ grow(learnings: unknown): Promise<PhaseResult>;
1053
+ evolve(adaptations: unknown): Promise<PhaseResult>;
1054
+ }
1055
+ /**
1056
+ * Execute a full protocol cycle for a task and extract the structured result.
1057
+ * This is the main entry point used by Team.executeTask.
1058
+ */
1059
+ declare function runProtocolCycle(agentConfig: AgentConfig, task: {
1060
+ title: string;
1061
+ description: string;
1062
+ }, teamKnowledge: string): Promise<ProtocolTaskResult>;
1063
+ /**
1064
+ * Convert a protocol ProtocolCycleResult into the framework's team-oriented CycleResult.
1065
+ */
1066
+ declare function protocolToFrameworkCycleResult(protocol: ProtocolCycleResult, teamName: string, cycle: number): CycleResult;
1067
+ /**
1068
+ * Convert a framework CycleResult into a protocol ProtocolCycleResult.
1069
+ */
1070
+ declare function frameworkToProtocolCycleResult(fw: CycleResult, task: string, domain: string): ProtocolCycleResult;
1071
+ /**
1072
+ * Creates a live protocol agent handle backed by LLM calls.
1073
+ *
1074
+ * The returned handle has execute(task), pause/resume/cancel controls,
1075
+ * status tracking, and phase history.
1076
+ *
1077
+ * ```ts
1078
+ * const agent = defineProtocolAgent({
1079
+ * name: 'researcher',
1080
+ * role: 'researcher',
1081
+ * model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' },
1082
+ * capabilities: ['search', 'summarize'],
1083
+ * claimFilter: { roles: ['researcher'], maxPriority: 10 },
1084
+ * });
1085
+ * const result = await agent.execute({ title: 'Find X', description: 'Research X' });
1086
+ * ```
1087
+ */
1088
+ declare function defineProtocolAgent(config: ProtocolAgentConfig): ProtocolAgentHandle;
1089
+
1090
+ /**
1091
+ * Board Operations — Pure state machine logic for task and suggestion lifecycle.
1092
+ *
1093
+ * Absorbed from mcp-server/src/holomesh/http-routes.ts.
1094
+ * These are pure functions that mutate board/suggestion arrays.
1095
+ * The HTTP layer calls these and handles persistence + responses.
1096
+ */
1097
+
1098
+ interface TaskActionResult {
1099
+ success: boolean;
1100
+ error?: string;
1101
+ task?: TeamTask;
1102
+ doneEntry?: DoneLogEntry;
1103
+ }
1104
+ /** Claim an open task. Returns error if task isn't open or has unmet dependencies. */
1105
+ declare function claimTask(board: TeamTask[], taskId: string, claimerId: string, claimerName: string): TaskActionResult;
1106
+ /** Mark a task as done. Removes from board, returns done log entry. */
1107
+ declare function completeTask(board: TeamTask[], taskId: string, completedBy: string, opts?: {
1108
+ commit?: string;
1109
+ summary?: string;
1110
+ }): {
1111
+ result: TaskActionResult & {
1112
+ onComplete?: TaskAction[];
1113
+ unblocked?: string[];
1114
+ };
1115
+ updatedBoard: TeamTask[];
1116
+ };
1117
+ /** Block a task. */
1118
+ declare function blockTask(board: TeamTask[], taskId: string): TaskActionResult;
1119
+ /** Reopen a task (unclaim). */
1120
+ declare function reopenTask(board: TeamTask[], taskId: string): TaskActionResult;
1121
+ /** Delegate a task from a source board to a target board. */
1122
+ declare function delegateTask(sourceBoard: TeamTask[], targetBoard: TeamTask[], taskId: string): {
1123
+ result: TaskActionResult;
1124
+ updatedSource: TeamTask[];
1125
+ updatedTarget: TeamTask[];
1126
+ };
1127
+ /** Add tasks to a board with dedup against existing + done log. */
1128
+ declare function addTasksToBoard(board: TeamTask[], doneLog: DoneLogEntry[], tasks: Array<Omit<TeamTask, 'id' | 'status' | 'createdAt'>>): {
1129
+ added: TeamTask[];
1130
+ updatedBoard: TeamTask[];
1131
+ };
1132
+ interface SuggestionActionResult {
1133
+ success: boolean;
1134
+ error?: string;
1135
+ suggestion?: TeamSuggestion;
1136
+ promotedTask?: TeamTask;
1137
+ }
1138
+ /** Create a suggestion with dedup against existing open suggestions. */
1139
+ declare function createSuggestion(suggestions: TeamSuggestion[], opts: {
1140
+ title: string;
1141
+ description?: string;
1142
+ category?: SuggestionCategory;
1143
+ evidence?: string;
1144
+ proposedBy: string;
1145
+ proposedByName: string;
1146
+ }): SuggestionActionResult;
1147
+ /** Vote on a suggestion. Auto-promotes at majority, auto-dismisses at negative majority. */
1148
+ declare function voteSuggestion(suggestions: TeamSuggestion[], board: TeamTask[], suggestionId: string, voterId: string, voterName: string, value: 1 | -1, maxSlots: number, reason?: string): SuggestionActionResult;
1149
+ /** Promote a suggestion manually. Creates a board task. */
1150
+ declare function promoteSuggestion(suggestions: TeamSuggestion[], board: TeamTask[], suggestionId: string, promoterName: string, opts?: {
1151
+ priority?: number;
1152
+ role?: SlotRole;
1153
+ }): SuggestionActionResult;
1154
+ /** Dismiss a suggestion. */
1155
+ declare function dismissSuggestion(suggestions: TeamSuggestion[], suggestionId: string): SuggestionActionResult;
1156
+
1157
+ /**
1158
+ * DistributedClaimer — Optimistic CAS-based task claiming across machines.
1159
+ *
1160
+ * Uses the MeshDiscovery gossip layer for distributed state.
1161
+ * Conflict resolution: priority + first-writer-wins via monotonic timestamps.
1162
+ *
1163
+ * FW-0.6 — Distributed task claiming across machines.
1164
+ *
1165
+ * @module distributed-claimer
1166
+ */
1167
+
1168
+ interface ClaimResult {
1169
+ /** Whether this agent successfully claimed the task */
1170
+ success: boolean;
1171
+ /** The task ID that was claimed */
1172
+ taskId: string;
1173
+ /** The agent that holds the claim (may differ from requester on conflict) */
1174
+ claimedBy: string;
1175
+ /** Monotonic timestamp of the winning claim */
1176
+ claimTimestamp: number;
1177
+ /** If claim was contested, the losing agent IDs */
1178
+ contested?: string[];
1179
+ }
1180
+ interface ClaimRecord {
1181
+ taskId: string;
1182
+ agentId: string;
1183
+ /** Monotonic timestamp (Date.now + counter to guarantee uniqueness) */
1184
+ timestamp: number;
1185
+ /** Agent priority — lower is higher priority */
1186
+ priority: number;
1187
+ /** Expiry timestamp — claims expire if not confirmed */
1188
+ expiresAt: number;
1189
+ }
1190
+ interface DistributedClaimerConfig {
1191
+ /** Claim TTL in ms before auto-expiry (default 30_000) */
1192
+ claimTtlMs?: number;
1193
+ /** How often to prune expired claims in ms (default 10_000) */
1194
+ pruneIntervalMs?: number;
1195
+ }
1196
+ declare class DistributedClaimer {
1197
+ private mesh;
1198
+ private gossip;
1199
+ private claims;
1200
+ private claimTtlMs;
1201
+ private counter;
1202
+ constructor(mesh: MeshDiscovery, gossip: GossipProtocol, config?: DistributedClaimerConfig);
1203
+ /**
1204
+ * Attempt to claim a task using optimistic CAS.
1205
+ *
1206
+ * 1. Check local claim state
1207
+ * 2. If unclaimed, write optimistic claim + broadcast via gossip
1208
+ * 3. If already claimed, compare priority + timestamp (first-writer-wins)
1209
+ */
1210
+ claim(taskId: string, agentId: string, priority?: number): ClaimResult;
1211
+ /**
1212
+ * Release a claim (task completed or abandoned).
1213
+ */
1214
+ release(taskId: string, agentId: string): boolean;
1215
+ /**
1216
+ * Confirm a claim (mark as committed — extends TTL significantly).
1217
+ */
1218
+ confirm(taskId: string, agentId: string): boolean;
1219
+ /**
1220
+ * Get the current claim holder for a task.
1221
+ */
1222
+ getClaimHolder(taskId: string): ClaimRecord | undefined;
1223
+ /**
1224
+ * Get all active claims.
1225
+ */
1226
+ getActiveClaims(): ClaimRecord[];
1227
+ /**
1228
+ * Ingest a gossip packet (called when receiving from peers).
1229
+ */
1230
+ ingestGossip(packet: GossipPacket): void;
1231
+ private broadcastClaim;
1232
+ private pruneExpired;
1233
+ }
1234
+
1235
+ /**
1236
+ * SkillRouter — Skill-based task routing via agent capabilities.
1237
+ *
1238
+ * Matches task requirements to agent capabilities, scores by overlap,
1239
+ * and returns the best-fit agent. Supports required vs preferred skills.
1240
+ *
1241
+ * FW-0.6 — Skill-based routing via agent capabilities.
1242
+ *
1243
+ * @module skill-router
1244
+ */
1245
+
1246
+ interface RoutingResult {
1247
+ /** The selected agent, or null if no match */
1248
+ agent: AgentConfig | null;
1249
+ /** Score of the selected agent (0-100) */
1250
+ score: number;
1251
+ /** All candidates with their scores, sorted descending */
1252
+ candidates: ScoredCandidate[];
1253
+ /** Reason for selection or rejection */
1254
+ reason: string;
1255
+ }
1256
+ interface ScoredCandidate {
1257
+ agent: AgentConfig;
1258
+ score: number;
1259
+ matchedCapabilities: string[];
1260
+ roleMatch: boolean;
1261
+ }
1262
+ interface RoutingPolicy {
1263
+ /** Minimum score threshold (0-100) to be eligible (default 10) */
1264
+ minScore?: number;
1265
+ /** Weight for capability matches (default 15) */
1266
+ capabilityWeight?: number;
1267
+ /** Weight for exact role match (default 25) */
1268
+ roleWeight?: number;
1269
+ /** Weight for priority alignment (default 10) */
1270
+ priorityWeight?: number;
1271
+ /** Required capabilities — agent MUST have all of these */
1272
+ requiredCapabilities?: string[];
1273
+ }
1274
+ declare class SkillRouter {
1275
+ private defaultPolicy;
1276
+ constructor(policy?: RoutingPolicy);
1277
+ /**
1278
+ * Route a task to the best-fit agent.
1279
+ *
1280
+ * Scoring:
1281
+ * - Each capability keyword match in task title/description: +capabilityWeight
1282
+ * - Exact role match (task.role === agent role mapping): +roleWeight
1283
+ * - Priority alignment (agent.claimFilter.maxPriority >= task.priority): +priorityWeight
1284
+ * - Required capabilities must ALL be present or agent is filtered out
1285
+ */
1286
+ route(task: TaskDef, agents: AgentConfig[], policy?: RoutingPolicy): RoutingResult;
1287
+ /**
1288
+ * Route a task to multiple agents (for parallel execution or fallback chains).
1289
+ */
1290
+ routeMultiple(task: TaskDef, agents: AgentConfig[], count: number, policy?: RoutingPolicy): RoutingResult;
1291
+ private agentMatchesRole;
1292
+ }
1293
+
1294
+ /**
1295
+ * Cross-team Delegation — Send tasks between teams.
1296
+ *
1297
+ * Tracks delegation chains to prevent infinite loops and
1298
+ * enables cross-team collaboration via board forwarding.
1299
+ *
1300
+ * FW-0.6 — Cross-team delegation.
1301
+ *
1302
+ * @module delegation
1303
+ */
1304
+
1305
+ interface DelegationResult {
1306
+ /** Whether the delegation was accepted */
1307
+ success: boolean;
1308
+ /** The task that was delegated */
1309
+ taskId: string;
1310
+ /** Source team ID */
1311
+ fromTeam: string;
1312
+ /** Target team ID */
1313
+ toTeam: string;
1314
+ /** The delegation chain (to detect loops) */
1315
+ chain: string[];
1316
+ /** Reason for success or failure */
1317
+ reason: string;
1318
+ }
1319
+ interface DelegationRecord {
1320
+ /** Original task ID */
1321
+ taskId: string;
1322
+ /** Task title (for display) */
1323
+ taskTitle: string;
1324
+ /** The team that delegated */
1325
+ fromTeam: string;
1326
+ /** The team that received */
1327
+ toTeam: string;
1328
+ /** Full chain of delegations */
1329
+ chain: string[];
1330
+ /** When the delegation happened */
1331
+ timestamp: number;
1332
+ /** Status of the delegated task */
1333
+ status: 'pending' | 'accepted' | 'rejected' | 'completed' | 'bounced';
1334
+ /** Callback URL or team reference for result delivery */
1335
+ callbackRef?: string;
1336
+ }
1337
+ interface DelegationPolicy {
1338
+ /** Maximum delegation chain length before rejecting (default 5) */
1339
+ maxChainLength?: number;
1340
+ /** Whether to allow delegating back to a team already in the chain (default false) */
1341
+ allowCycles?: boolean;
1342
+ /** Required capabilities the target team must have (optional) */
1343
+ requiredCapabilities?: string[];
1344
+ }
1345
+ /**
1346
+ * Adapter interface for sending tasks to other teams.
1347
+ * Implementations may use HTTP (remote boards), gossip (mesh), or in-process (local).
1348
+ */
1349
+ interface TeamBoardAdapter {
1350
+ /** Send a task to a target team's board */
1351
+ sendTask(targetTeamId: string, task: Pick<TaskDef, 'title' | 'description' | 'priority' | 'role' | 'source'>): Promise<{
1352
+ accepted: boolean;
1353
+ taskId?: string;
1354
+ reason?: string;
1355
+ }>;
1356
+ /** Notify a team about delegation completion */
1357
+ notifyCompletion(teamId: string, delegation: DelegationRecord, result: {
1358
+ summary: string;
1359
+ }): Promise<void>;
1360
+ }
1361
+ type AddTasksFn = (tasks: Array<Pick<TaskDef, 'title' | 'description' | 'priority' | 'role' | 'source'>>) => Promise<TaskDef[]>;
1362
+ declare class InProcessBoardAdapter implements TeamBoardAdapter {
1363
+ private teams;
1364
+ registerTeam(teamId: string, addTasks: AddTasksFn): void;
1365
+ sendTask(targetTeamId: string, task: Pick<TaskDef, 'title' | 'description' | 'priority' | 'role' | 'source'>): Promise<{
1366
+ accepted: boolean;
1367
+ taskId?: string;
1368
+ reason?: string;
1369
+ }>;
1370
+ notifyCompletion(_teamId: string, _delegation: DelegationRecord, _result: {
1371
+ summary: string;
1372
+ }): Promise<void>;
1373
+ }
1374
+ declare class DelegationManager {
1375
+ private teamId;
1376
+ private adapter;
1377
+ private delegations;
1378
+ private policy;
1379
+ constructor(teamId: string, adapter: TeamBoardAdapter, policy?: DelegationPolicy);
1380
+ /**
1381
+ * Delegate a task to another team.
1382
+ *
1383
+ * 1. Validate delegation chain (no cycles, max length)
1384
+ * 2. Forward task to target team's board via adapter
1385
+ * 3. Track delegation record
1386
+ */
1387
+ delegate(task: TaskDef, targetTeamId: string, existingChain?: string[]): Promise<DelegationResult>;
1388
+ /**
1389
+ * Mark a delegation as completed.
1390
+ */
1391
+ completeDelegation(taskId: string, targetTeamId: string, summary: string): Promise<boolean>;
1392
+ /**
1393
+ * Get all delegations from this team.
1394
+ */
1395
+ getOutboundDelegations(): DelegationRecord[];
1396
+ /**
1397
+ * Get pending delegations.
1398
+ */
1399
+ getPendingDelegations(): DelegationRecord[];
1400
+ }
1401
+
1402
+ /**
1403
+ * Absorb Scanner — Framework scans its own codebase for improvements.
1404
+ *
1405
+ * Queries the MCP Orchestrator knowledge store for framework-related
1406
+ * insights, and scans local source files for TODO/FIXME markers.
1407
+ *
1408
+ * Does NOT depend on the absorb service being up — the orchestrator's
1409
+ * knowledge store is the source of truth (always available).
1410
+ */
1411
+ interface AbsorbScanConfig {
1412
+ /** MCP Orchestrator URL (default: production) */
1413
+ orchestratorUrl?: string;
1414
+ /** MCP API key for orchestrator auth */
1415
+ mcpApiKey?: string;
1416
+ /** Workspace ID for knowledge queries (default: ai-ecosystem) */
1417
+ workspaceId?: string;
1418
+ /** Max improvement tasks to generate */
1419
+ maxTasks?: number;
1420
+ /** Search query for knowledge store */
1421
+ searchQuery?: string;
1422
+ }
1423
+ interface ScanResult {
1424
+ scanned: boolean;
1425
+ filesAnalyzed: number;
1426
+ issuesFound: number;
1427
+ improvements: ImprovementTask[];
1428
+ knowledge: ExtractedKnowledge[];
1429
+ error?: string;
1430
+ }
1431
+ interface ImprovementTask {
1432
+ title: string;
1433
+ description: string;
1434
+ priority: number;
1435
+ category: 'refactor' | 'test' | 'docs' | 'performance' | 'type-safety';
1436
+ file?: string;
1437
+ line?: number;
1438
+ }
1439
+ interface ExtractedKnowledge {
1440
+ type: 'wisdom' | 'pattern' | 'gotcha';
1441
+ content: string;
1442
+ domain: string;
1443
+ confidence: number;
1444
+ }
1445
+ /**
1446
+ * Scan the framework via the MCP Orchestrator knowledge store.
1447
+ * Returns improvement tasks + extracted knowledge.
1448
+ * Falls back gracefully if the orchestrator is unreachable.
1449
+ */
1450
+ declare function scanFramework(config?: AbsorbScanConfig): Promise<ScanResult>;
1451
+ /**
1452
+ * Scan local source files for TODO/FIXME/HACK markers.
1453
+ * Returns improvement tasks derived from code comments.
1454
+ */
1455
+ declare function scanTodos(codebasePath: string): Promise<ScanResult>;
1456
+
1457
+ /**
1458
+ * Evolution Engine — The framework improves itself.
1459
+ *
1460
+ * The pipeline:
1461
+ * 1. SCAN: Query orchestrator knowledge store + scan local TODOs
1462
+ * 2. PROPOSE: Convert findings to improvement suggestions
1463
+ * 3. VOTE: Team agents vote on which improvements matter
1464
+ * 4. EXECUTE: Winning suggestions become board tasks
1465
+ * 5. COMPOUND: Knowledge from execution feeds back into the store
1466
+ *
1467
+ * This is the v1.0 singularity point — the framework's own agents
1468
+ * can propose, vote on, and ship improvements to themselves.
1469
+ */
1470
+
1471
+ interface EvolutionConfig {
1472
+ /** Absorb scan configuration */
1473
+ absorb?: AbsorbScanConfig;
1474
+ /** Path to scan for TODOs (default: none — skip TODO scan) */
1475
+ codebasePath?: string;
1476
+ /** Auto-propose improvements as suggestions (default: true) */
1477
+ autoPropose?: boolean;
1478
+ /** Auto-add high-priority improvements to board (default: false) */
1479
+ autoBoard?: boolean;
1480
+ /** Minimum priority to auto-board (1=critical, default: 2) */
1481
+ autoBoardMinPriority?: number;
1482
+ }
1483
+ interface EvolutionResult {
1484
+ scan: ScanResult;
1485
+ todoScan?: ScanResult;
1486
+ suggestionsCreated: number;
1487
+ tasksCreated: number;
1488
+ knowledgePublished: number;
1489
+ }
1490
+ /**
1491
+ * Run one evolution cycle on a team.
1492
+ *
1493
+ * Scans the orchestrator knowledge store and local TODOs,
1494
+ * proposes improvements as suggestions, publishes extracted knowledge,
1495
+ * and optionally adds high-priority items directly to the board.
1496
+ */
1497
+ declare function evolve(team: Team, config?: EvolutionConfig): Promise<EvolutionResult>;
1498
+
1499
+ /**
1500
+ * FrameworkAbsorber — Class-based absorb integration for framework self-scanning.
1501
+ *
1502
+ * @experimental
1503
+ *
1504
+ * Wraps the absorb service (https://absorb.holoscript.net) to scan the
1505
+ * framework codebase, query for code health, and surface improvements.
1506
+ * Falls back to the MCP Orchestrator knowledge store when the absorb
1507
+ * service is unreachable.
1508
+ */
1509
+
1510
+ interface CodebaseGraph {
1511
+ /** Number of files in the graph */
1512
+ fileCount: number;
1513
+ /** Number of edges (dependencies) between files */
1514
+ edgeCount: number;
1515
+ /** Top-level modules detected */
1516
+ modules: string[];
1517
+ /** Raw graph data from absorb (opaque — shape depends on service version) */
1518
+ raw?: unknown;
1519
+ }
1520
+ interface Improvement {
1521
+ id: string;
1522
+ title: string;
1523
+ description: string;
1524
+ priority: number;
1525
+ category: ImprovementTask['category'];
1526
+ file?: string;
1527
+ line?: number;
1528
+ /** Confidence score from absorb analysis (0-1) */
1529
+ confidence: number;
1530
+ }
1531
+ interface AbsorberConfig extends AbsorbScanConfig {
1532
+ /** Absorb service URL (default: production) */
1533
+ absorbUrl?: string;
1534
+ /** Absorb API key (default: ABSORB_API_KEY env var) */
1535
+ absorbApiKey?: string;
1536
+ /** Path to scan for local TODOs */
1537
+ codebasePath?: string;
1538
+ }
1539
+ /**
1540
+ * FrameworkAbsorber — scans the framework codebase for improvements.
1541
+ *
1542
+ * @experimental
1543
+ *
1544
+ * Usage:
1545
+ * ```ts
1546
+ * const absorber = new FrameworkAbsorber({ codebasePath: 'packages/framework' });
1547
+ * const graph = await absorber.scanSelf();
1548
+ * const improvements = await absorber.findImprovements();
1549
+ * ```
1550
+ */
1551
+ declare class FrameworkAbsorber {
1552
+ private readonly config;
1553
+ private lastScan;
1554
+ constructor(config?: AbsorberConfig);
1555
+ /**
1556
+ * Scan the framework codebase via the absorb service.
1557
+ * Returns a CodebaseGraph with module/dependency info.
1558
+ *
1559
+ * Calls absorb_run_absorb MCP tool via JSON-RPC for full graph analysis.
1560
+ * Falls back to knowledge store scan if the absorb service is unreachable.
1561
+ */
1562
+ scanSelf(): Promise<CodebaseGraph>;
1563
+ /**
1564
+ * Find improvements by scanning knowledge store + local TODOs.
1565
+ * Returns ranked improvement list with confidence scores.
1566
+ */
1567
+ findImprovements(): Promise<Improvement[]>;
1568
+ /**
1569
+ * Get extracted knowledge from the last scan.
1570
+ */
1571
+ getKnowledge(): ExtractedKnowledge[];
1572
+ /**
1573
+ * Run a full scan (knowledge store + local TODOs).
1574
+ */
1575
+ private runFullScan;
1576
+ }
1577
+
1578
+ /**
1579
+ * TestGenerator — Auto-generate tests for framework source files.
1580
+ *
1581
+ * @experimental
1582
+ *
1583
+ * Uses the LLM adapter to generate vitest test files from source code.
1584
+ * Part of FW-1.0 self-evolution: the framework writes its own tests.
1585
+ */
1586
+
1587
+ interface TestGeneratorConfig {
1588
+ /** LLM model configuration */
1589
+ model: ModelConfig;
1590
+ /** Maximum tokens for test generation */
1591
+ maxTokens?: number;
1592
+ /** Temperature (lower = more deterministic tests) */
1593
+ temperature?: number;
1594
+ /** Test framework (default: vitest) */
1595
+ testFramework?: 'vitest' | 'jest';
1596
+ /** Additional context to include in the prompt */
1597
+ additionalContext?: string;
1598
+ }
1599
+ interface GeneratedTest {
1600
+ /** Source file path */
1601
+ sourceFile: string;
1602
+ /** Generated test file content */
1603
+ testContent: string;
1604
+ /** Suggested test file path */
1605
+ testFilePath: string;
1606
+ /** Number of test cases generated */
1607
+ testCount: number;
1608
+ /** LLM tokens used */
1609
+ tokensUsed: number;
1610
+ }
1611
+ /**
1612
+ * TestGenerator — generates test files from source code via LLM.
1613
+ *
1614
+ * @experimental
1615
+ *
1616
+ * Usage:
1617
+ * ```ts
1618
+ * const gen = new TestGenerator({ model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' } });
1619
+ * const result = await gen.generateTests('src/self-improve/absorb-scanner.ts');
1620
+ * ```
1621
+ */
1622
+ declare class TestGenerator {
1623
+ private readonly config;
1624
+ constructor(config: TestGeneratorConfig);
1625
+ /**
1626
+ * Generate a test file for the given source file.
1627
+ *
1628
+ * @param filePath - Path to the TypeScript source file
1629
+ * @returns Generated test content and metadata
1630
+ */
1631
+ generateTests(filePath: string): Promise<GeneratedTest>;
1632
+ /**
1633
+ * Generate tests for multiple files.
1634
+ *
1635
+ * @param filePaths - Array of source file paths
1636
+ * @returns Array of generated tests
1637
+ */
1638
+ generateBatch(filePaths: string[]): Promise<GeneratedTest[]>;
1639
+ }
1640
+
1641
+ /**
1642
+ * PromptOptimizer — A/B test prompts to find the most effective phrasing.
1643
+ *
1644
+ * @experimental
1645
+ *
1646
+ * Part of FW-1.0 self-evolution: the framework optimizes its own prompts
1647
+ * by running controlled experiments and measuring quality metrics.
1648
+ */
1649
+
1650
+ interface ABTestConfig {
1651
+ /** LLM model configuration for running the test */
1652
+ model: ModelConfig;
1653
+ /** Number of runs per prompt variant (default: 3) */
1654
+ runs?: number;
1655
+ /** Evaluation criteria (default: quality + relevance) */
1656
+ criteria?: EvaluationCriteria[];
1657
+ /** Maximum tokens per response */
1658
+ maxTokens?: number;
1659
+ /** Temperature for test runs */
1660
+ temperature?: number;
1661
+ }
1662
+ interface EvaluationCriteria {
1663
+ name: string;
1664
+ description: string;
1665
+ weight: number;
1666
+ }
1667
+ interface PromptVariantResult {
1668
+ prompt: string;
1669
+ responses: string[];
1670
+ avgScore: number;
1671
+ scores: number[];
1672
+ avgTokens: number;
1673
+ avgLatencyMs: number;
1674
+ }
1675
+ interface ABTestResult {
1676
+ /** The task/question both prompts were tested against */
1677
+ task: string;
1678
+ /** Results for prompt A */
1679
+ variantA: PromptVariantResult;
1680
+ /** Results for prompt B */
1681
+ variantB: PromptVariantResult;
1682
+ /** Which variant won ('A' | 'B' | 'tie') */
1683
+ winner: 'A' | 'B' | 'tie';
1684
+ /** Confidence in the result (0-1, based on score delta and consistency) */
1685
+ confidence: number;
1686
+ /** Total tokens consumed across all runs */
1687
+ totalTokens: number;
1688
+ }
1689
+ /**
1690
+ * PromptOptimizer — A/B tests prompt variants to find the best one.
1691
+ *
1692
+ * @experimental
1693
+ *
1694
+ * Usage:
1695
+ * ```ts
1696
+ * const optimizer = new PromptOptimizer({
1697
+ * model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' }
1698
+ * });
1699
+ * const result = await optimizer.abTest(
1700
+ * 'Explain HoloScript in one paragraph.',
1701
+ * 'You are a HoloScript expert. Explain HoloScript concisely.',
1702
+ * 'What is HoloScript?'
1703
+ * );
1704
+ * console.log(`Winner: ${result.winner} (confidence: ${result.confidence})`);
1705
+ * ```
1706
+ */
1707
+ declare class PromptOptimizer {
1708
+ private readonly config;
1709
+ constructor(config: ABTestConfig);
1710
+ /**
1711
+ * Run an A/B test comparing two prompt variants on a given task.
1712
+ */
1713
+ abTest(promptA: string, promptB: string, task: string): Promise<ABTestResult>;
1714
+ /**
1715
+ * Run a single variant N times and evaluate.
1716
+ */
1717
+ private runVariant;
1718
+ /**
1719
+ * Judge a response using the LLM as evaluator.
1720
+ * Returns a weighted score (0-10).
1721
+ */
1722
+ private judge;
1723
+ /**
1724
+ * Compute variance of a number array.
1725
+ */
1726
+ private variance;
1727
+ }
1728
+
1729
+ export { ABSORB_AGENT, type ABTestConfig, type ABTestResult, type AIProvider, type AbsorbScanConfig, type AbsorberConfig, type AgentAuthentication, type AgentCapability, type AgentCard, AgentConfig, AgentIdentity, AgentPresence, AgentRuntime, type AgentSkill, type AgentStats, type AuditResult, type AuditViolation, BRITTNEY_AGENT, BaseAgent, Bounty, BountyManager, BountyReward, type ClaimRecord, ClaimResult$1 as ClaimResult, type CodebaseGraph, type ColdStoreEntry, type CompletionBucket, CompletionProof, ConsolidationEngine, ConsolidationResult, type ConsolidationStats, type ConsolidatorConfig, type Contradiction, type CrossDomainMatch, type CrossDomainPattern, CycleResult, DAEMON_AGENT, DOMAIN_GOALS, type DecompositionResult, DelegationManager, type DelegationPolicy, type DelegationRecord, type DelegationResult, DeriveResult, type ClaimResult as DistributedClaimResult, DistributedClaimer, type DistributedClaimerConfig, DomainConsolidationConfig, DoneLogAuditor, type DoneLogEntry, type DoneLogStats, type EvaluationCriteria, type EvolutionConfig, type EvolutionResult, ExcitabilityMetadata, type ExtractedKnowledge, FrameworkAbsorber, type FullAuditResult, GENERIC_GOALS, type GeneratedTest, Goal, type GoalContext, GoalSynthesizer, type GossipPacket, GossipProtocol, HeartbeatResult, HotBufferEntry, type Improvement, type ImprovementTask, InProcessBoardAdapter, KnowledgeConsolidator, KnowledgeDomain, KnowledgeInsight, KnowledgeStore, type KnowledgeTier, type LLMAdapter, type LLMMessage, type LLMResponse, type MCPToolSchema, MCP_TOOL_SCHEMAS, MeshDiscovery, type MeshSignal, type MicroPhase, ModelConfig, ORACLE_AGENT, PayoutResult, type PeerMetadata, PhaseResult, PresenceResult, PromptOptimizer, type PromptVariantResult, ProposalResult, ProtocolAgent, ProtocolAgentConfig, ProtocolAgentHandle, ProtocolCycleResult, type ProtocolTaskResult, type ProvenanceNode, ROOM_PRESETS, ReconsolidationEvent, type RoomPreset, type RoutingPolicy, type RoutingResult, type ScanResult, type ScoredCandidate, SetModeResult, SignalService, type SignalType, SkillRouter, SmartMicroPhaseDecomposer, type SourceStats, StoredEntry, type SuggestionActionResult, type SuggestionCategory, SuggestionCreateResult, SuggestionListResult, SuggestionStatus, type SuggestionVote, SuggestionVoteResult, type SynthesizedGoal, TEAM_AGENT_PROFILES, type TaskActionResult, TaskDef, type TaskDescription, type TaskStatus, Team, type TeamAgentProfile, type TeamBoardAdapter, TeamConfig, TeamMode, type TeamSuggestion, type TeamTask, TestGenerator, type TestGeneratorConfig, type TieredEntry, type WaveExecutionPlan, addTasksToBoard, auditDoneLog, blockTask, callLLM, claimTask, completeTask, createAgentCard, createLLMAdapter, createSuggestion, defineAgent, defineProtocolAgent, defineTeam, delegateTask, dismissSuggestion, evolve, frameworkToProtocolCycleResult, generateSuggestionId, generateTaskId, getAllProfiles, getProfileById, getProfilesByClaimRole, getProfilesByDomain, inferFixPriority, isCommitProof, isLikelyReportEntry, normalizeTitle, parseDeriveContent, promoteSuggestion, protocolToFrameworkCycleResult, reopenTask, runProtocolCycle, scanFramework, scanTodos, validateAgentCard, voteSuggestion };