@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.
- package/ALL-test-results.json +1 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/ROADMAP.md +175 -0
- package/dist/AgentManifest-CB4xM-Ma.d.cts +704 -0
- package/dist/AgentManifest-CB4xM-Ma.d.ts +704 -0
- package/dist/BehaviorTree-BrBFECv5.d.cts +103 -0
- package/dist/BehaviorTree-BrBFECv5.d.ts +103 -0
- package/dist/InvisibleWallet-BB6tFvRA.d.cts +1732 -0
- package/dist/InvisibleWallet-rtRrBOA8.d.ts +1732 -0
- package/dist/OrchestratorAgent-BvWgf9uw.d.cts +798 -0
- package/dist/OrchestratorAgent-Q_CbVTmO.d.ts +798 -0
- package/dist/agents/index.cjs +4790 -0
- package/dist/agents/index.d.cts +1788 -0
- package/dist/agents/index.d.ts +1788 -0
- package/dist/agents/index.js +4695 -0
- package/dist/ai/index.cjs +5347 -0
- package/dist/ai/index.d.cts +1753 -0
- package/dist/ai/index.d.ts +1753 -0
- package/dist/ai/index.js +5244 -0
- package/dist/behavior.cjs +449 -0
- package/dist/behavior.d.cts +130 -0
- package/dist/behavior.d.ts +130 -0
- package/dist/behavior.js +407 -0
- package/dist/economy/index.cjs +3659 -0
- package/dist/economy/index.d.cts +747 -0
- package/dist/economy/index.d.ts +747 -0
- package/dist/economy/index.js +3617 -0
- package/dist/implementations-D9T3un9D.d.cts +236 -0
- package/dist/implementations-D9T3un9D.d.ts +236 -0
- package/dist/index.cjs +24550 -0
- package/dist/index.d.cts +1729 -0
- package/dist/index.d.ts +1729 -0
- package/dist/index.js +24277 -0
- package/dist/learning/index.cjs +219 -0
- package/dist/learning/index.d.cts +104 -0
- package/dist/learning/index.d.ts +104 -0
- package/dist/learning/index.js +189 -0
- package/dist/negotiation/index.cjs +970 -0
- package/dist/negotiation/index.d.cts +610 -0
- package/dist/negotiation/index.d.ts +610 -0
- package/dist/negotiation/index.js +931 -0
- package/dist/skills/index.cjs +1118 -0
- package/dist/skills/index.d.cts +289 -0
- package/dist/skills/index.d.ts +289 -0
- package/dist/skills/index.js +1079 -0
- package/dist/swarm/index.cjs +5268 -0
- package/dist/swarm/index.d.cts +2433 -0
- package/dist/swarm/index.d.ts +2433 -0
- package/dist/swarm/index.js +5221 -0
- package/dist/training/index.cjs +2745 -0
- package/dist/training/index.d.cts +1734 -0
- package/dist/training/index.d.ts +1734 -0
- package/dist/training/index.js +2687 -0
- package/extract-failures.js +10 -0
- package/package.json +82 -0
- package/src/__tests__/bounty-marketplace.test.ts +374 -0
- package/src/__tests__/delegation.test.ts +144 -0
- package/src/__tests__/distributed-claimer.test.ts +147 -0
- package/src/__tests__/done-log-audit.test.ts +342 -0
- package/src/__tests__/framework.test.ts +865 -0
- package/src/__tests__/goal-synthesizer.test.ts +236 -0
- package/src/__tests__/presence.test.ts +223 -0
- package/src/__tests__/protocol-agent.test.ts +254 -0
- package/src/__tests__/revenue-splitter.test.ts +114 -0
- package/src/__tests__/scenario-driven-todo.test.ts +197 -0
- package/src/__tests__/self-improve.test.ts +349 -0
- package/src/__tests__/service-lifecycle.test.ts +237 -0
- package/src/__tests__/skill-router.test.ts +121 -0
- package/src/agents/AgentManifest.ts +493 -0
- package/src/agents/AgentRegistry.ts +475 -0
- package/src/agents/AgentTypes.ts +585 -0
- package/src/agents/AgentWalletRegistry.ts +83 -0
- package/src/agents/AuthenticatedCRDT.ts +388 -0
- package/src/agents/CapabilityMatcher.ts +453 -0
- package/src/agents/CrossRealityHandoff.ts +305 -0
- package/src/agents/CulturalMemory.ts +454 -0
- package/src/agents/FederatedRegistryAdapter.ts +429 -0
- package/src/agents/NormEngine.ts +450 -0
- package/src/agents/OrchestratorAgent.ts +414 -0
- package/src/agents/SkillWorkflowEngine.ts +472 -0
- package/src/agents/TaskDelegationService.ts +551 -0
- package/src/agents/__tests__/AgentManifest.prod.test.ts +134 -0
- package/src/agents/__tests__/AgentManifest.test.ts +182 -0
- package/src/agents/__tests__/AgentModule.test.ts +864 -0
- package/src/agents/__tests__/AgentRegistry.prod.test.ts +125 -0
- package/src/agents/__tests__/AgentRegistry.test.ts +148 -0
- package/src/agents/__tests__/AgentTypes.test.ts +534 -0
- package/src/agents/__tests__/AgentWalletRegistry.test.ts +152 -0
- package/src/agents/__tests__/AuthenticatedCRDT.test.ts +558 -0
- package/src/agents/__tests__/CapabilityMatcher.prod.test.ts +117 -0
- package/src/agents/__tests__/CapabilityMatcher.test.ts +178 -0
- package/src/agents/__tests__/CrossRealityHandoff.test.ts +402 -0
- package/src/agents/__tests__/CulturalMemory.test.ts +200 -0
- package/src/agents/__tests__/FederatedRegistryAdapter.test.ts +409 -0
- package/src/agents/__tests__/NormEngine.test.ts +276 -0
- package/src/agents/__tests__/OrchestratorAgent.test.ts +182 -0
- package/src/agents/__tests__/SkillWorkflowEngine.test.ts +357 -0
- package/src/agents/__tests__/TaskDelegationService.test.ts +446 -0
- package/src/agents/index.ts +107 -0
- package/src/agents/spatial-comms/Layer1RealTime.ts +621 -0
- package/src/agents/spatial-comms/Layer2A2A.ts +661 -0
- package/src/agents/spatial-comms/Layer3MCP.ts +651 -0
- package/src/agents/spatial-comms/ProtocolTypes.ts +543 -0
- package/src/agents/spatial-comms/SpatialCommClient.ts +483 -0
- package/src/agents/spatial-comms/__tests__/performance-benchmark.test.ts +465 -0
- package/src/agents/spatial-comms/examples/multi-agent-world-creation.ts +409 -0
- package/src/agents/spatial-comms/index.ts +66 -0
- package/src/ai/AIAdapter.ts +313 -0
- package/src/ai/AICopilot.ts +331 -0
- package/src/ai/AIOutputValidator.ts +203 -0
- package/src/ai/BTNodes.ts +239 -0
- package/src/ai/BehaviorSelector.ts +135 -0
- package/src/ai/BehaviorTree.ts +153 -0
- package/src/ai/Blackboard.ts +165 -0
- package/src/ai/GenerationAnalytics.ts +461 -0
- package/src/ai/GenerationCache.ts +265 -0
- package/src/ai/GoalPlanner.ts +165 -0
- package/src/ai/HoloScriptGenerator.ts +580 -0
- package/src/ai/InfluenceMap.ts +180 -0
- package/src/ai/NavMesh.ts +168 -0
- package/src/ai/PerceptionSystem.ts +178 -0
- package/src/ai/PromptTemplates.ts +453 -0
- package/src/ai/SemanticSearchService.ts +80 -0
- package/src/ai/StateMachine.ts +196 -0
- package/src/ai/SteeringBehavior.ts +150 -0
- package/src/ai/SteeringBehaviors.ts +244 -0
- package/src/ai/TrainingDataGenerator.ts +1082 -0
- package/src/ai/UtilityAI.ts +145 -0
- package/src/ai/__tests__/AIAdapter.prod.test.ts +259 -0
- package/src/ai/__tests__/AIAdapter.test.ts +109 -0
- package/src/ai/__tests__/AICopilot.prod.test.ts +341 -0
- package/src/ai/__tests__/AICopilot.test.ts +178 -0
- package/src/ai/__tests__/AIOutputValidator.prod.test.ts +226 -0
- package/src/ai/__tests__/AIOutputValidator.test.ts +138 -0
- package/src/ai/__tests__/BTNodes.prod.test.ts +391 -0
- package/src/ai/__tests__/BTNodes.test.ts +263 -0
- package/src/ai/__tests__/BehaviorSelector.prod.test.ts +129 -0
- package/src/ai/__tests__/BehaviorSelector.test.ts +132 -0
- package/src/ai/__tests__/BehaviorTree.prod.test.ts +266 -0
- package/src/ai/__tests__/BehaviorTree.test.ts +216 -0
- package/src/ai/__tests__/Blackboard.prod.test.ts +339 -0
- package/src/ai/__tests__/Blackboard.test.ts +183 -0
- package/src/ai/__tests__/GenerationAnalytics.prod.test.ts +141 -0
- package/src/ai/__tests__/GenerationAnalytics.test.ts +165 -0
- package/src/ai/__tests__/GenerationCache.prod.test.ts +144 -0
- package/src/ai/__tests__/GenerationCache.test.ts +171 -0
- package/src/ai/__tests__/GoalPlanner.prod.test.ts +189 -0
- package/src/ai/__tests__/GoalPlanner.test.ts +137 -0
- package/src/ai/__tests__/GoalPlannerDepth.prod.test.ts +217 -0
- package/src/ai/__tests__/HoloScriptGenerator.test.ts +125 -0
- package/src/ai/__tests__/InfluenceMap.prod.test.ts +146 -0
- package/src/ai/__tests__/InfluenceMap.test.ts +149 -0
- package/src/ai/__tests__/NavMesh.prod.test.ts +141 -0
- package/src/ai/__tests__/NavMesh.test.ts +159 -0
- package/src/ai/__tests__/PerceptionSystem.prod.test.ts +135 -0
- package/src/ai/__tests__/PerceptionSystem.test.ts +250 -0
- package/src/ai/__tests__/PromptTemplates.prod.test.ts +313 -0
- package/src/ai/__tests__/PromptTemplates.test.ts +146 -0
- package/src/ai/__tests__/SemanticSearch.test.ts +37 -0
- package/src/ai/__tests__/StateMachine.prod.test.ts +162 -0
- package/src/ai/__tests__/StateMachine.test.ts +163 -0
- package/src/ai/__tests__/SteeringBehavior.prod.test.ts +251 -0
- package/src/ai/__tests__/SteeringBehavior.test.ts +135 -0
- package/src/ai/__tests__/SteeringBehaviors.prod.test.ts +133 -0
- package/src/ai/__tests__/SteeringBehaviors.test.ts +151 -0
- package/src/ai/__tests__/TrainingDataGenerator.prod.test.ts +286 -0
- package/src/ai/__tests__/TrainingDataGenerator.test.ts +286 -0
- package/src/ai/__tests__/UtilityAI.prod.test.ts +207 -0
- package/src/ai/__tests__/UtilityAI.test.ts +155 -0
- package/src/ai/__tests__/adapters.prod.test.ts +263 -0
- package/src/ai/__tests__/adapters.test.ts +320 -0
- package/src/ai/adapters.ts +1585 -0
- package/src/ai/index.ts +130 -0
- package/src/behavior/BehaviorPresets.ts +140 -0
- package/src/behavior/BehaviorTree.ts +236 -0
- package/src/behavior/StateMachine.ts +176 -0
- package/src/behavior/StateTrait.ts +67 -0
- package/src/behavior/index.ts +8 -0
- package/src/behavior.ts +8 -0
- package/src/board/audit.ts +284 -0
- package/src/board/board-ops.ts +336 -0
- package/src/board/board-types.ts +302 -0
- package/src/board/index.ts +69 -0
- package/src/define-agent.ts +46 -0
- package/src/define-team.ts +33 -0
- package/src/delegation.ts +265 -0
- package/src/distributed-claimer.ts +228 -0
- package/src/economy/AgentBudgetEnforcer.ts +464 -0
- package/src/economy/BountyManager.ts +185 -0
- package/src/economy/CreatorRevenueAggregator.ts +460 -0
- package/src/economy/InvisibleWallet.ts +82 -0
- package/src/economy/KnowledgeMarketplace.ts +193 -0
- package/src/economy/PaymentWebhookService.ts +512 -0
- package/src/economy/RevenueSplitter.ts +156 -0
- package/src/economy/SubscriptionManager.ts +546 -0
- package/src/economy/UnifiedBudgetOptimizer.ts +635 -0
- package/src/economy/UsageMeter.ts +440 -0
- package/src/economy/_core-stubs.ts +219 -0
- package/src/economy/index.ts +100 -0
- package/src/economy/x402-facilitator.ts +1978 -0
- package/src/index.ts +348 -0
- package/src/knowledge/__tests__/knowledge-consolidator.test.ts +444 -0
- package/src/knowledge/__tests__/knowledge-store-vector.test.ts +291 -0
- package/src/knowledge/brain.ts +167 -0
- package/src/knowledge/consolidation.ts +581 -0
- package/src/knowledge/knowledge-consolidator.ts +510 -0
- package/src/knowledge/knowledge-store.ts +616 -0
- package/src/learning/MemoryConsolidator.ts +102 -0
- package/src/learning/MemoryScorer.ts +69 -0
- package/src/learning/ProceduralCompiler.ts +45 -0
- package/src/learning/SemanticClusterer.ts +66 -0
- package/src/learning/index.ts +8 -0
- package/src/llm/llm-adapter.ts +159 -0
- package/src/mesh/index.ts +309 -0
- package/src/negotiation/NegotiationProtocol.ts +694 -0
- package/src/negotiation/NegotiationTypes.ts +473 -0
- package/src/negotiation/VotingMechanisms.ts +691 -0
- package/src/negotiation/index.ts +49 -0
- package/src/protocol/goal-synthesizer.ts +317 -0
- package/src/protocol/implementations.ts +474 -0
- package/src/protocol/micro-phase-decomposer.ts +299 -0
- package/src/protocol/micro-step-decomposer.test.ts +306 -0
- package/src/protocol-agent.test.ts +353 -0
- package/src/protocol-agent.ts +670 -0
- package/src/self-improve/absorb-scanner.ts +252 -0
- package/src/self-improve/evolution-engine.ts +149 -0
- package/src/self-improve/framework-absorber.ts +214 -0
- package/src/self-improve/index.ts +50 -0
- package/src/self-improve/prompt-optimizer.ts +212 -0
- package/src/self-improve/test-generator.ts +175 -0
- package/src/skill-router.ts +186 -0
- package/src/skills/index.ts +5 -0
- package/src/skills/skill-md-bridge.ts +1699 -0
- package/src/swarm/ACOEngine.ts +261 -0
- package/src/swarm/CollectiveIntelligence.ts +383 -0
- package/src/swarm/ContributionSynthesizer.ts +481 -0
- package/src/swarm/LeaderElection.ts +393 -0
- package/src/swarm/PSOEngine.ts +206 -0
- package/src/swarm/QuorumPolicy.ts +173 -0
- package/src/swarm/SwarmCoordinator.ts +335 -0
- package/src/swarm/SwarmManager.ts +442 -0
- package/src/swarm/SwarmMembership.ts +456 -0
- package/src/swarm/VotingRound.ts +255 -0
- package/src/swarm/__tests__/ACOEngine.prod.test.ts +164 -0
- package/src/swarm/__tests__/ACOEngine.test.ts +117 -0
- package/src/swarm/__tests__/CollectiveIntelligence.prod.test.ts +296 -0
- package/src/swarm/__tests__/CollectiveIntelligence.test.ts +457 -0
- package/src/swarm/__tests__/ContributionSynthesizer.prod.test.ts +269 -0
- package/src/swarm/__tests__/ContributionSynthesizer.test.ts +254 -0
- package/src/swarm/__tests__/LeaderElection.prod.test.ts +196 -0
- package/src/swarm/__tests__/LeaderElection.test.ts +151 -0
- package/src/swarm/__tests__/PSOEngine.prod.test.ts +162 -0
- package/src/swarm/__tests__/PSOEngine.test.ts +106 -0
- package/src/swarm/__tests__/QuorumPolicy.prod.test.ts +216 -0
- package/src/swarm/__tests__/QuorumPolicy.test.ts +177 -0
- package/src/swarm/__tests__/SwarmCoordinator.prod.test.ts +186 -0
- package/src/swarm/__tests__/SwarmCoordinator.test.ts +167 -0
- package/src/swarm/__tests__/SwarmManager.prod.test.ts +308 -0
- package/src/swarm/__tests__/SwarmManager.test.ts +373 -0
- package/src/swarm/__tests__/SwarmMembership.prod.test.ts +273 -0
- package/src/swarm/__tests__/SwarmMembership.test.ts +264 -0
- package/src/swarm/__tests__/VotingRound.prod.test.ts +233 -0
- package/src/swarm/__tests__/VotingRound.test.ts +174 -0
- package/src/swarm/analytics/SwarmInspector.ts +476 -0
- package/src/swarm/analytics/SwarmMetrics.ts +449 -0
- package/src/swarm/analytics/__tests__/SwarmInspector.prod.test.ts +366 -0
- package/src/swarm/analytics/__tests__/SwarmInspector.test.ts +454 -0
- package/src/swarm/analytics/__tests__/SwarmMetrics.prod.test.ts +254 -0
- package/src/swarm/analytics/__tests__/SwarmMetrics.test.ts +370 -0
- package/src/swarm/analytics/index.ts +7 -0
- package/src/swarm/index.ts +69 -0
- package/src/swarm/messaging/BroadcastChannel.ts +509 -0
- package/src/swarm/messaging/GossipProtocol.ts +565 -0
- package/src/swarm/messaging/SwarmEventBus.ts +443 -0
- package/src/swarm/messaging/__tests__/BroadcastChannel.prod.test.ts +331 -0
- package/src/swarm/messaging/__tests__/BroadcastChannel.test.ts +333 -0
- package/src/swarm/messaging/__tests__/GossipProtocol.prod.test.ts +356 -0
- package/src/swarm/messaging/__tests__/GossipProtocol.test.ts +437 -0
- package/src/swarm/messaging/__tests__/SwarmEventBus.prod.test.ts +191 -0
- package/src/swarm/messaging/__tests__/SwarmEventBus.test.ts +247 -0
- package/src/swarm/messaging/index.ts +8 -0
- package/src/swarm/spatial/FlockingBehavior.ts +462 -0
- package/src/swarm/spatial/FormationController.ts +500 -0
- package/src/swarm/spatial/Vector3.ts +170 -0
- package/src/swarm/spatial/ZoneClaiming.ts +509 -0
- package/src/swarm/spatial/__tests__/FlockingBehavior.prod.test.ts +239 -0
- package/src/swarm/spatial/__tests__/FlockingBehavior.test.ts +298 -0
- package/src/swarm/spatial/__tests__/FormationController.prod.test.ts +240 -0
- package/src/swarm/spatial/__tests__/FormationController.test.ts +297 -0
- package/src/swarm/spatial/__tests__/Vector3.prod.test.ts +283 -0
- package/src/swarm/spatial/__tests__/Vector3.test.ts +224 -0
- package/src/swarm/spatial/__tests__/ZoneClaiming.prod.test.ts +246 -0
- package/src/swarm/spatial/__tests__/ZoneClaiming.test.ts +374 -0
- package/src/swarm/spatial/index.ts +28 -0
- package/src/team.ts +1245 -0
- package/src/training/LRScheduler.ts +377 -0
- package/src/training/QualityScoringPipeline.ts +139 -0
- package/src/training/SoftDedup.ts +461 -0
- package/src/training/SparsityMonitor.ts +685 -0
- package/src/training/SparsityMonitorTypes.ts +209 -0
- package/src/training/SpatialTrainingDataGenerator.ts +1526 -0
- package/src/training/SpatialTrainingDataTypes.ts +216 -0
- package/src/training/TrainingPipelineConfig.ts +215 -0
- package/src/training/constants.ts +94 -0
- package/src/training/index.ts +138 -0
- package/src/training/schema.ts +147 -0
- package/src/training/scripts/generate-novel-use-cases-dataset.ts +272 -0
- package/src/training/scripts/generate-spatial-dataset.ts +521 -0
- package/src/training/training/data/novel-use-cases.jsonl +153 -0
- package/src/training/training/data/spatial-reasoning-10k.jsonl +9354 -0
- package/src/training/trainingmonkey/TrainingMonkeyIntegration.ts +477 -0
- package/src/training/trainingmonkey/TrainingMonkeyTypes.ts +230 -0
- package/src/training/trainingmonkey/index.ts +26 -0
- package/src/training/trait-mappings.ts +157 -0
- package/src/types/core-stubs.d.ts +113 -0
- package/src/types.ts +304 -0
- package/test-output.txt +0 -0
- package/test-result.json +1 -0
- package/tsc-errors.txt +4 -0
- package/tsc_output.txt +0 -0
- package/tsconfig.json +14 -0
- package/tsup-learning-esm.config.ts +12 -0
- package/tsup.config.ts +21 -0
- package/typescript-errors-2.txt +0 -0
- package/typescript-errors.txt +22 -0
- package/vitest-log-utf8.txt +268 -0
- package/vitest-log.txt +0 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrainingMonkey Integration Module
|
|
3
|
+
*
|
|
4
|
+
* Converts HoloScript spatial reasoning JSONL training data into
|
|
5
|
+
* TrainingMonkey-compatible Alpaca format with SoftDedup reweighting,
|
|
6
|
+
* stratified train/validation splits, and W.006-compliant training configs.
|
|
7
|
+
*
|
|
8
|
+
* @module training/trainingmonkey
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
TrainingMonkeyIntegration,
|
|
13
|
+
createTrainingMonkeyIntegration,
|
|
14
|
+
} from './TrainingMonkeyIntegration';
|
|
15
|
+
|
|
16
|
+
export type {
|
|
17
|
+
AlpacaEntry,
|
|
18
|
+
WeightedAlpacaEntry,
|
|
19
|
+
DatasetSplit,
|
|
20
|
+
SplitStats,
|
|
21
|
+
TrainingMonkeyConfig,
|
|
22
|
+
TrainingMonkeyIntegrationConfig,
|
|
23
|
+
IntegrationResult,
|
|
24
|
+
} from './TrainingMonkeyTypes';
|
|
25
|
+
|
|
26
|
+
export { DEFAULT_INTEGRATION_CONFIG } from './TrainingMonkeyTypes';
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trait Mappings
|
|
3
|
+
*
|
|
4
|
+
* Maps TrainingMonkey trait names to canonical @holoscript/core trait IDs.
|
|
5
|
+
* Provides validation utilities to check trait coverage.
|
|
6
|
+
*
|
|
7
|
+
* @version 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { TrainingCategory } from './constants';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Training metadata that extends a trait definition
|
|
14
|
+
*/
|
|
15
|
+
export interface TrainingMetadata {
|
|
16
|
+
difficulty: 'beginner' | 'intermediate' | 'advanced' | 'production';
|
|
17
|
+
categories: TrainingCategory[];
|
|
18
|
+
exampleCount: number;
|
|
19
|
+
qualityScore: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Mapping entry from TM trait to HS canonical trait
|
|
24
|
+
*/
|
|
25
|
+
export interface TraitMapping {
|
|
26
|
+
/** TrainingMonkey trait name */
|
|
27
|
+
tmName: string;
|
|
28
|
+
/** Canonical HoloScript trait name (null if unmapped) */
|
|
29
|
+
hsName: string | null;
|
|
30
|
+
/** Status of the mapping */
|
|
31
|
+
status: 'matched' | 'unmatched' | 'deprecated' | 'promoted';
|
|
32
|
+
/** Training metadata (populated from TM datasets) */
|
|
33
|
+
training?: TrainingMetadata;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Result of a trait validation run
|
|
38
|
+
*/
|
|
39
|
+
export interface TraitValidationReport {
|
|
40
|
+
matched: number;
|
|
41
|
+
unmatched: number;
|
|
42
|
+
deprecated: number;
|
|
43
|
+
total: number;
|
|
44
|
+
details: TraitMapping[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Known TM traits from holoscript-trait-registry.ts (46 = 41 traits + 5 physics patterns)
|
|
49
|
+
* These are the traits explicitly registered in TrainingMonkey.
|
|
50
|
+
*/
|
|
51
|
+
export const TM_REGISTERED_TRAITS = [
|
|
52
|
+
// V43 Tier 1 Core AI
|
|
53
|
+
'llm_agent',
|
|
54
|
+
'behavior_tree',
|
|
55
|
+
'goal_oriented',
|
|
56
|
+
'neural_link',
|
|
57
|
+
'neural_forge',
|
|
58
|
+
'spatial_awareness',
|
|
59
|
+
'shared_world',
|
|
60
|
+
'eye_tracked',
|
|
61
|
+
'hand_tracking',
|
|
62
|
+
'vision',
|
|
63
|
+
// V43 Tier 2 visionOS
|
|
64
|
+
'spatial_persona',
|
|
65
|
+
'shareplay',
|
|
66
|
+
'object_tracking',
|
|
67
|
+
'scene_reconstruction',
|
|
68
|
+
'realitykit_mesh',
|
|
69
|
+
'room_mesh',
|
|
70
|
+
'volumetric_window',
|
|
71
|
+
'spatial_navigation',
|
|
72
|
+
// V43 Tier 2 AI Generative
|
|
73
|
+
'stable_diffusion',
|
|
74
|
+
'controlnet',
|
|
75
|
+
'ai_texture_gen',
|
|
76
|
+
'diffusion_realtime',
|
|
77
|
+
'ai_inpainting',
|
|
78
|
+
'ai_upscaling',
|
|
79
|
+
// V5.1 Hololand Exclusive
|
|
80
|
+
'networked',
|
|
81
|
+
'render_network',
|
|
82
|
+
'openxr_hal',
|
|
83
|
+
'hitl',
|
|
84
|
+
'zora_coins',
|
|
85
|
+
'neural_upscaling',
|
|
86
|
+
'grabbable',
|
|
87
|
+
'throwable',
|
|
88
|
+
'pointable',
|
|
89
|
+
'drawable',
|
|
90
|
+
'attachable',
|
|
91
|
+
'socket',
|
|
92
|
+
'billboard',
|
|
93
|
+
'ui_panel',
|
|
94
|
+
'hud',
|
|
95
|
+
'glowing',
|
|
96
|
+
'physics',
|
|
97
|
+
'persistent',
|
|
98
|
+
'tool',
|
|
99
|
+
// Physics Patterns
|
|
100
|
+
'conversion_tracking',
|
|
101
|
+
'impact_physics',
|
|
102
|
+
'fragment_conversion',
|
|
103
|
+
'damage_falloff',
|
|
104
|
+
'cross_system_integration',
|
|
105
|
+
] as const;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Validate a trait name against a set of valid traits.
|
|
109
|
+
* Returns the canonical name if found, null otherwise.
|
|
110
|
+
*/
|
|
111
|
+
export function validateTraitName(
|
|
112
|
+
traitName: string,
|
|
113
|
+
validTraits: ReadonlySet<string> | readonly string[]
|
|
114
|
+
): string | null {
|
|
115
|
+
const normalized = traitName.toLowerCase().replace(/@/g, '').trim();
|
|
116
|
+
const traitSet = validTraits instanceof Set ? validTraits : new Set(validTraits);
|
|
117
|
+
|
|
118
|
+
if (traitSet.has(normalized)) return normalized;
|
|
119
|
+
if (traitSet.has(traitName)) return traitName;
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Generate a validation report comparing TM traits against HS registry.
|
|
125
|
+
* @param tmTraits - Trait names from TrainingMonkey
|
|
126
|
+
* @param hsTraits - Valid trait names from HoloScript core
|
|
127
|
+
* @param deprecatedTraits - Set of deprecated trait names
|
|
128
|
+
*/
|
|
129
|
+
export function generateValidationReport(
|
|
130
|
+
tmTraits: readonly string[],
|
|
131
|
+
hsTraits: ReadonlySet<string> | readonly string[],
|
|
132
|
+
deprecatedTraits?: ReadonlySet<string>
|
|
133
|
+
): TraitValidationReport {
|
|
134
|
+
const hsSet = hsTraits instanceof Set ? hsTraits : new Set(hsTraits);
|
|
135
|
+
const depSet = deprecatedTraits ?? new Set<string>();
|
|
136
|
+
const details: TraitMapping[] = [];
|
|
137
|
+
|
|
138
|
+
for (const tm of tmTraits) {
|
|
139
|
+
const normalized = tm.toLowerCase().replace(/@/g, '').trim();
|
|
140
|
+
|
|
141
|
+
if (depSet.has(normalized)) {
|
|
142
|
+
details.push({ tmName: tm, hsName: normalized, status: 'deprecated' });
|
|
143
|
+
} else if (hsSet.has(normalized)) {
|
|
144
|
+
details.push({ tmName: tm, hsName: normalized, status: 'matched' });
|
|
145
|
+
} else {
|
|
146
|
+
details.push({ tmName: tm, hsName: null, status: 'unmatched' });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
matched: details.filter((d) => d.status === 'matched').length,
|
|
152
|
+
unmatched: details.filter((d) => d.status === 'unmatched').length,
|
|
153
|
+
deprecated: details.filter((d) => d.status === 'deprecated').length,
|
|
154
|
+
total: details.length,
|
|
155
|
+
details,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
declare module '@holoscript/core' {
|
|
2
|
+
export type NormEnforcement = 'hard' | 'soft' | 'advisory';
|
|
3
|
+
export type NormScope = 'agent' | 'zone' | 'world' | 'session';
|
|
4
|
+
export type NormCategory =
|
|
5
|
+
| 'cooperation'
|
|
6
|
+
| 'communication'
|
|
7
|
+
| 'territory'
|
|
8
|
+
| 'exchange'
|
|
9
|
+
| 'economy'
|
|
10
|
+
| 'authority'
|
|
11
|
+
| 'safety'
|
|
12
|
+
| 'ritual'
|
|
13
|
+
| 'identity';
|
|
14
|
+
|
|
15
|
+
export interface CulturalNorm {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
category: NormCategory;
|
|
20
|
+
enforcement: NormEnforcement;
|
|
21
|
+
scope: NormScope;
|
|
22
|
+
activationThreshold: number;
|
|
23
|
+
strength: 'weak' | 'moderate' | 'strong';
|
|
24
|
+
requiredEffects?: string[];
|
|
25
|
+
forbiddenEffects?: string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const BUILTIN_NORMS: CulturalNorm[];
|
|
29
|
+
export function criticalMassForChange(norm: CulturalNorm, populationSize: number): number;
|
|
30
|
+
export const XR_PLATFORM_CAPABILITIES: Record<string, string[]>;
|
|
31
|
+
|
|
32
|
+
export interface HSPlusNode {
|
|
33
|
+
id: string;
|
|
34
|
+
type: string;
|
|
35
|
+
properties: Record<string, any>;
|
|
36
|
+
__creditState?: any;
|
|
37
|
+
}
|
|
38
|
+
export interface TraitContext {
|
|
39
|
+
emit(event: string, payload: any): void;
|
|
40
|
+
blackboard: Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
export interface TraitEvent {
|
|
43
|
+
type: string;
|
|
44
|
+
payload: any;
|
|
45
|
+
}
|
|
46
|
+
export type TraitHandler<T = any> = any;
|
|
47
|
+
|
|
48
|
+
// Swarm extensions
|
|
49
|
+
export interface ICollectiveIntelligenceService {
|
|
50
|
+
createSession(topic: string, goal: string, initiator: string): any;
|
|
51
|
+
}
|
|
52
|
+
export interface IHiveContribution {
|
|
53
|
+
id: string;
|
|
54
|
+
agentId: string;
|
|
55
|
+
content: string;
|
|
56
|
+
type: 'idea' | 'critique' | 'consensus' | 'solution';
|
|
57
|
+
confidence: number;
|
|
58
|
+
timestamp: number;
|
|
59
|
+
references?: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface IHiveSession {
|
|
62
|
+
id: string;
|
|
63
|
+
topic: string;
|
|
64
|
+
goal: string;
|
|
65
|
+
initiator: string;
|
|
66
|
+
status: 'active' | 'resolved' | 'closed';
|
|
67
|
+
participants: string[];
|
|
68
|
+
contributions: IHiveContribution[];
|
|
69
|
+
resolution?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ILeaderElectionService {
|
|
72
|
+
holdElection(candidates: string[]): string;
|
|
73
|
+
}
|
|
74
|
+
export interface ILeaderElection {
|
|
75
|
+
startElection(): Promise<string>;
|
|
76
|
+
getLeader(): string | null;
|
|
77
|
+
}
|
|
78
|
+
export interface ISwarmCoordinator {
|
|
79
|
+
// Empty interface for now since SwarmCoordinator class implements its own methods
|
|
80
|
+
}
|
|
81
|
+
export interface ISwarmConfig {
|
|
82
|
+
populationSize?: number;
|
|
83
|
+
maxIterations?: number;
|
|
84
|
+
convergenceThreshold?: number;
|
|
85
|
+
algorithm?: string;
|
|
86
|
+
adaptiveSizing?: boolean;
|
|
87
|
+
velocityWeight?: number;
|
|
88
|
+
cognitiveWeight?: number;
|
|
89
|
+
socialWeight?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ISwarmResult {
|
|
92
|
+
bestSolution: any;
|
|
93
|
+
bestFitness: number;
|
|
94
|
+
iterations: number;
|
|
95
|
+
improvementPercent: number;
|
|
96
|
+
converged: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface IMessageBroker {
|
|
99
|
+
publish(topic: string, message: any): void;
|
|
100
|
+
subscribe(topic: string, handler: (message: any) => void): void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export class HoloScriptPlusParser {
|
|
104
|
+
constructor(options?: any);
|
|
105
|
+
parse(source: string): any;
|
|
106
|
+
}
|
|
107
|
+
export interface HSPlusCompileResult {
|
|
108
|
+
success: boolean;
|
|
109
|
+
errors?: any[];
|
|
110
|
+
ast?: any;
|
|
111
|
+
exports?: any;
|
|
112
|
+
}
|
|
113
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HoloScript Framework Types
|
|
3
|
+
*
|
|
4
|
+
* Canonical home for all agent types. No circular dependencies.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ProtocolPhase } from './protocol/implementations';
|
|
8
|
+
import type { PhaseResult, ProtocolCycleResult } from './protocol/implementations';
|
|
9
|
+
|
|
10
|
+
// Re-export protocol specs from canonical source (framework owns these now)
|
|
11
|
+
export type {
|
|
12
|
+
PWGEntry,
|
|
13
|
+
Pattern,
|
|
14
|
+
Wisdom,
|
|
15
|
+
Gotcha,
|
|
16
|
+
PWGSeverity,
|
|
17
|
+
AgentIdentity,
|
|
18
|
+
PhaseResult,
|
|
19
|
+
ProtocolCycleResult,
|
|
20
|
+
Goal,
|
|
21
|
+
MicroPhaseTask,
|
|
22
|
+
MicroPhaseGroup,
|
|
23
|
+
ExecutionPlan,
|
|
24
|
+
ExecutionResult,
|
|
25
|
+
ServiceMetadata,
|
|
26
|
+
ServiceMetrics,
|
|
27
|
+
ServiceConfig,
|
|
28
|
+
} from './protocol/implementations';
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
ProtocolPhase,
|
|
32
|
+
isPattern,
|
|
33
|
+
isWisdom,
|
|
34
|
+
isGotcha,
|
|
35
|
+
} from './protocol/implementations';
|
|
36
|
+
|
|
37
|
+
// ── LLM Provider (framework-original — nothing like this exists) ──
|
|
38
|
+
|
|
39
|
+
export type LLMProvider = 'anthropic' | 'openai' | 'xai' | 'openrouter';
|
|
40
|
+
|
|
41
|
+
export interface ModelConfig {
|
|
42
|
+
provider: LLMProvider;
|
|
43
|
+
model: string;
|
|
44
|
+
apiKey?: string;
|
|
45
|
+
maxTokens?: number;
|
|
46
|
+
temperature?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ── Agent Config (aligns with TeamAgentProfile from mcp-server) ──
|
|
50
|
+
// We use our own shape for the public API but document the mapping.
|
|
51
|
+
|
|
52
|
+
export type AgentRole = 'architect' | 'coder' | 'researcher' | 'reviewer';
|
|
53
|
+
export type SlotRole = 'coder' | 'tester' | 'researcher' | 'reviewer' | 'flex';
|
|
54
|
+
|
|
55
|
+
export interface ClaimFilter {
|
|
56
|
+
roles: SlotRole[];
|
|
57
|
+
maxPriority: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface AgentConfig {
|
|
61
|
+
name: string;
|
|
62
|
+
role: AgentRole;
|
|
63
|
+
model: ModelConfig;
|
|
64
|
+
capabilities: string[];
|
|
65
|
+
claimFilter: ClaimFilter;
|
|
66
|
+
systemPrompt?: string;
|
|
67
|
+
knowledgeDomains?: string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ── Tasks (aligns with TeamTask from http-routes.ts) ──
|
|
71
|
+
|
|
72
|
+
export interface TaskDef {
|
|
73
|
+
id: string;
|
|
74
|
+
title: string;
|
|
75
|
+
description: string;
|
|
76
|
+
status: 'open' | 'claimed' | 'done' | 'blocked';
|
|
77
|
+
priority: number;
|
|
78
|
+
role?: SlotRole;
|
|
79
|
+
source?: string;
|
|
80
|
+
claimedBy?: string;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
completedAt?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ── Knowledge (aligns with MeshKnowledgeEntry from holomesh/types.ts) ──
|
|
86
|
+
|
|
87
|
+
export interface KnowledgeConfig {
|
|
88
|
+
persist: boolean;
|
|
89
|
+
path?: string;
|
|
90
|
+
/** Remote knowledge store URL (MCP orchestrator) */
|
|
91
|
+
remoteUrl?: string;
|
|
92
|
+
remoteApiKey?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface KnowledgeInsight {
|
|
96
|
+
type: 'wisdom' | 'pattern' | 'gotcha';
|
|
97
|
+
content: string;
|
|
98
|
+
domain: string;
|
|
99
|
+
confidence: number;
|
|
100
|
+
source: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ── Team ──
|
|
104
|
+
|
|
105
|
+
export type ConsensusMode = 'simple_majority' | 'unanimous' | 'owner_decides';
|
|
106
|
+
|
|
107
|
+
export interface TeamConfig {
|
|
108
|
+
name: string;
|
|
109
|
+
agents: AgentConfig[];
|
|
110
|
+
knowledge?: KnowledgeConfig;
|
|
111
|
+
consensus?: ConsensusMode;
|
|
112
|
+
maxSlots?: number;
|
|
113
|
+
/** Remote board API — when set, board ops delegate to HoloMesh HTTP API */
|
|
114
|
+
boardUrl?: string;
|
|
115
|
+
boardApiKey?: string;
|
|
116
|
+
/** Local presence tracking configuration (FW-0.3). */
|
|
117
|
+
presence?: PresenceConfig;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ── Work Cycle ──
|
|
121
|
+
|
|
122
|
+
export interface AgentRuntime {
|
|
123
|
+
name: string;
|
|
124
|
+
role: AgentRole;
|
|
125
|
+
config: AgentConfig;
|
|
126
|
+
tasksCompleted: number;
|
|
127
|
+
knowledgePublished: number;
|
|
128
|
+
reputationScore: number;
|
|
129
|
+
reputationTier: ReputationTier;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type ReputationTier = 'newcomer' | 'contributor' | 'expert' | 'authority';
|
|
133
|
+
|
|
134
|
+
export interface CycleResult {
|
|
135
|
+
teamName: string;
|
|
136
|
+
cycle: number;
|
|
137
|
+
agentResults: AgentCycleResult[];
|
|
138
|
+
knowledgeProduced: KnowledgeInsight[];
|
|
139
|
+
compoundedInsights: number;
|
|
140
|
+
durationMs: number;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface AgentCycleResult {
|
|
144
|
+
agentName: string;
|
|
145
|
+
taskId: string | null;
|
|
146
|
+
taskTitle: string | null;
|
|
147
|
+
action: 'claimed' | 'completed' | 'skipped' | 'error' | 'synthesized';
|
|
148
|
+
summary: string;
|
|
149
|
+
knowledge: KnowledgeInsight[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ── Consensus (aligns with ConsensusTypes from core) ──
|
|
153
|
+
|
|
154
|
+
export interface ProposalResult<T = unknown> {
|
|
155
|
+
proposalId: string;
|
|
156
|
+
accepted: boolean;
|
|
157
|
+
votesFor: number;
|
|
158
|
+
votesAgainst: number;
|
|
159
|
+
votesTotal: number;
|
|
160
|
+
value: T;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ── Suggestions (aligns with HoloMesh team suggestions API) ──
|
|
164
|
+
|
|
165
|
+
export type SuggestionStatus = 'open' | 'promoted' | 'dismissed';
|
|
166
|
+
|
|
167
|
+
export interface SuggestionVoteEntry {
|
|
168
|
+
agent: string;
|
|
169
|
+
vote: 'up' | 'down';
|
|
170
|
+
reason?: string;
|
|
171
|
+
votedAt: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface Suggestion {
|
|
175
|
+
id: string;
|
|
176
|
+
title: string;
|
|
177
|
+
description?: string;
|
|
178
|
+
category?: string;
|
|
179
|
+
evidence?: string;
|
|
180
|
+
proposedBy: string;
|
|
181
|
+
status: SuggestionStatus;
|
|
182
|
+
votes: SuggestionVoteEntry[];
|
|
183
|
+
/** Net score (upvotes minus downvotes) */
|
|
184
|
+
score: number;
|
|
185
|
+
createdAt: string;
|
|
186
|
+
resolvedAt?: string;
|
|
187
|
+
/** When upvotes >= this threshold, auto-promote to board task */
|
|
188
|
+
autoPromoteThreshold?: number;
|
|
189
|
+
/** When downvotes >= this threshold, auto-dismiss */
|
|
190
|
+
autoDismissThreshold?: number;
|
|
191
|
+
/** If promoted, the resulting task ID */
|
|
192
|
+
promotedTaskId?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface SuggestionCreateResult {
|
|
196
|
+
suggestion: Suggestion;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface SuggestionVoteResult {
|
|
200
|
+
suggestion: Suggestion;
|
|
201
|
+
/** Set when a suggestion was auto-promoted via threshold */
|
|
202
|
+
promotedTaskId?: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface SuggestionListResult {
|
|
206
|
+
suggestions: Suggestion[];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// ── Team Mode ──
|
|
210
|
+
|
|
211
|
+
export type TeamMode = 'audit' | 'research' | 'build' | 'review';
|
|
212
|
+
|
|
213
|
+
export interface SetModeResult {
|
|
214
|
+
mode: TeamMode;
|
|
215
|
+
previousMode?: TeamMode;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// ── Derive ──
|
|
219
|
+
|
|
220
|
+
export interface DeriveResult {
|
|
221
|
+
tasks: TaskDef[];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// ── Presence / Heartbeat ──
|
|
225
|
+
|
|
226
|
+
export interface SlotInfo {
|
|
227
|
+
agentName: string;
|
|
228
|
+
role: SlotRole;
|
|
229
|
+
status: string;
|
|
230
|
+
lastSeen?: string;
|
|
231
|
+
ideType?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface PresenceResult {
|
|
235
|
+
slots: SlotInfo[];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface HeartbeatResult {
|
|
239
|
+
ok: boolean;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// ── Local Presence Tracking (FW-0.3) ──
|
|
243
|
+
|
|
244
|
+
export type AgentPresenceStatus = 'online' | 'idle' | 'offline';
|
|
245
|
+
|
|
246
|
+
export interface AgentPresence {
|
|
247
|
+
name: string;
|
|
248
|
+
status: AgentPresenceStatus;
|
|
249
|
+
lastSeen: number;
|
|
250
|
+
currentTask?: string;
|
|
251
|
+
uptime: number; // ms since first heartbeat
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface PresenceConfig {
|
|
255
|
+
/** Milliseconds without heartbeat before agent is marked idle (default 60_000). */
|
|
256
|
+
idleTimeoutMs?: number;
|
|
257
|
+
/** Milliseconds without heartbeat before agent is marked offline (default 300_000). */
|
|
258
|
+
offlineTimeoutMs?: number;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// ── Protocol Agent (FW-0.2) ──
|
|
262
|
+
|
|
263
|
+
export type ProtocolStyle = 'uaa2' | 'react' | 'plan-exec' | 'debate' | 'swarm';
|
|
264
|
+
|
|
265
|
+
export type AgentStatus = 'idle' | 'running' | 'paused' | 'cancelled' | 'error';
|
|
266
|
+
|
|
267
|
+
export interface PhaseHook {
|
|
268
|
+
before?: (phase: ProtocolPhase, input: unknown) => Promise<unknown> | unknown;
|
|
269
|
+
after?: (phase: ProtocolPhase, result: PhaseResult) => Promise<PhaseResult> | PhaseResult;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface ProtocolAgentConfig extends AgentConfig {
|
|
273
|
+
/** Protocol style — defaults to 'uaa2' (7-phase cycle). */
|
|
274
|
+
protocolStyle?: ProtocolStyle;
|
|
275
|
+
/** Phase hooks — called before/after each phase. */
|
|
276
|
+
phaseHooks?: PhaseHook;
|
|
277
|
+
/** Additional LLM overrides for lightweight phases. */
|
|
278
|
+
lightModel?: Partial<ModelConfig>;
|
|
279
|
+
/** Team knowledge context injected into phases. */
|
|
280
|
+
teamKnowledge?: string;
|
|
281
|
+
/** Maximum phase retries on failure. */
|
|
282
|
+
maxPhaseRetries?: number;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface ProtocolAgentHandle {
|
|
286
|
+
/** Agent name. */
|
|
287
|
+
readonly name: string;
|
|
288
|
+
/** Agent role. */
|
|
289
|
+
readonly role: AgentRole;
|
|
290
|
+
/** Current status. */
|
|
291
|
+
readonly status: AgentStatus;
|
|
292
|
+
/** Phase execution history. */
|
|
293
|
+
readonly history: PhaseResult[];
|
|
294
|
+
/** Execute a task through the full protocol cycle. */
|
|
295
|
+
execute(task: { title: string; description: string }): Promise<ProtocolCycleResult>;
|
|
296
|
+
/** Pause execution after the current phase completes. */
|
|
297
|
+
pause(): void;
|
|
298
|
+
/** Resume a paused agent. */
|
|
299
|
+
resume(): void;
|
|
300
|
+
/** Cancel execution. The current phase will finish but no further phases run. */
|
|
301
|
+
cancel(): void;
|
|
302
|
+
/** Reset status to idle and clear history. */
|
|
303
|
+
reset(): void;
|
|
304
|
+
}
|
package/test-output.txt
ADDED
|
Binary file
|
package/test-result.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"numTotalTestSuites":9,"numPassedTestSuites":6,"numFailedTestSuites":3,"numPendingTestSuites":0,"numTotalTests":17,"numPassedTests":16,"numFailedTests":1,"numPendingTests":0,"numTodoTests":0,"snapshot":{"added":0,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0,"didUpdate":false},"startTime":1775361548300,"success":false,"testResults":[{"assertionResults":[{"ancestorTitles":["Performance Benchmarks","Layer 1: Real-Time Performance"],"fullName":"Performance Benchmarks Layer 1: Real-Time Performance should encode position sync in <0.5ms","status":"passed","title":"should encode position sync in <0.5ms","duration":8.551300000000083,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Layer 1: Real-Time Performance"],"fullName":"Performance Benchmarks Layer 1: Real-Time Performance should decode position sync in <0.5ms","status":"passed","title":"should decode position sync in <0.5ms","duration":4.490000000000009,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Layer 1: Real-Time Performance"],"fullName":"Performance Benchmarks Layer 1: Real-Time Performance should maintain message rate of 90 msg/s","status":"passed","title":"should maintain message rate of 90 msg/s","duration":1017.0662,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Layer 1: Real-Time Performance"],"fullName":"Performance Benchmarks Layer 1: Real-Time Performance should keep binary message size under 512 bytes","status":"passed","title":"should keep binary message size under 512 bytes","duration":0.47870000000011714,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Frame Budget Tracker"],"fullName":"Performance Benchmarks Frame Budget Tracker should maintain 90fps with 11.1ms frame times","status":"passed","title":"should maintain 90fps with 11.1ms frame times","duration":0.8992000000000644,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Frame Budget Tracker"],"fullName":"Performance Benchmarks Frame Budget Tracker should degrade to medium quality at 12.5ms","status":"passed","title":"should degrade to medium quality at 12.5ms","duration":0.32809999999994943,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Frame Budget Tracker"],"fullName":"Performance Benchmarks Frame Budget Tracker should degrade to low quality at 14ms","status":"passed","title":"should degrade to low quality at 14ms","duration":0.2358000000001539,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Frame Budget Tracker"],"fullName":"Performance Benchmarks Frame Budget Tracker should degrade to minimal quality at 16ms","status":"passed","title":"should degrade to minimal quality at 16ms","duration":0.26739999999995234,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Frame Budget Tracker"],"fullName":"Performance Benchmarks Frame Budget Tracker should recover quality when frame times improve","status":"passed","title":"should recover quality when frame times improve","duration":0.3382000000001426,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Frame Budget Tracker"],"fullName":"Performance Benchmarks Frame Budget Tracker should track budget remaining accurately","status":"passed","title":"should track budget remaining accurately","duration":0.1993999999999687,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Multi-Agent Performance"],"fullName":"Performance Benchmarks Multi-Agent Performance should maintain 90fps with 5 agents","status":"passed","title":"should maintain 90fps with 5 agents","duration":1.0174999999999272,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Multi-Agent Performance"],"fullName":"Performance Benchmarks Multi-Agent Performance should maintain 90fps with 10 agents","status":"passed","title":"should maintain 90fps with 10 agents","duration":0.6838000000000193,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Bandwidth Usage"],"fullName":"Performance Benchmarks Bandwidth Usage should use <10 KB/s per agent at 90fps","status":"passed","title":"should use <10 KB/s per agent at 90fps","duration":0.36159999999995307,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Bandwidth Usage"],"fullName":"Performance Benchmarks Bandwidth Usage should use <50 KB/s total with 5 agents","status":"passed","title":"should use <50 KB/s total with 5 agents","duration":0.39629999999988286,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Latency Tests"],"fullName":"Performance Benchmarks Latency Tests should complete round-trip in <2ms","status":"passed","title":"should complete round-trip in <2ms","duration":1560.2852999999998,"failureMessages":[],"meta":{}},{"ancestorTitles":["Performance Benchmarks","Memory Usage"],"fullName":"Performance Benchmarks Memory Usage should not leak memory over time","status":"failed","title":"should not leak memory over time","duration":5016.5497000000005,"failureMessages":["Error: STACK_TRACE_ERROR\n at task (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:638:27)\n at Object.<anonymous> (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:662:16)\n at Object.<anonymous> (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:458:28)\n at chain (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:369:14)\n at C:\\Users\\josep\\Documents\\GitHub\\HoloScript\\packages\\framework\\src\\agents\\spatial-comms\\__tests__\\performance-benchmark.test.ts:394:5\n at file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:734:40\n at runWithSuite (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1849:8)\n at Object.collect (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:734:10)\n at Object.collect (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:738:54)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at Object.collect (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:738:46)\n at collectTests (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1179:25)\n at startTests (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:1817:17)\n at file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/vitest@3.2.4_@types+node@24.10.13/node_modules/vitest/dist/chunks/runBaseTests.9Ij9_de-.js:117:26\n at withEnv (file:///C:/Users/josep/Documents/GitHub/HoloScript/node_modules/.pnpm/vitest@3.2.4_@types+node@24.10.13/node_modules/vitest/dist/chunks/runBaseTests.9Ij9_de-.js:84:3)"],"meta":{}},{"ancestorTitles":["Performance Summary"],"fullName":"Performance Summary should print performance summary","status":"passed","title":"should print performance summary","duration":0.3923999999988155,"failureMessages":[],"meta":{}}],"startTime":1775361549002,"endTime":1775361556615.3923,"status":"failed","message":"","name":"C:/Users/josep/Documents/GitHub/HoloScript/packages/framework/src/agents/spatial-comms/__tests__/performance-benchmark.test.ts"}]}
|
package/tsc-errors.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
npm warn Unknown project config "shamefully-hoist". This will stop working in the next major version of npm.
|
|
2
|
+
npm warn Unknown project config "strict-peer-dependencies". This will stop working in the next major version of npm.
|
|
3
|
+
src/agents/__tests__/TaskDelegationService.test.ts(176,14): error TS2532: Object is possibly 'undefined'.
|
|
4
|
+
src/agents/__tests__/TaskDelegationService.test.ts(176,33): error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
|
package/tsc_output.txt
ADDED
|
File without changes
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"skipLibCheck": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: {
|
|
5
|
+
index: 'src/index.ts',
|
|
6
|
+
behavior: 'src/behavior.ts',
|
|
7
|
+
'agents/index': 'src/agents/index.ts',
|
|
8
|
+
'economy/index': 'src/economy/index.ts',
|
|
9
|
+
'swarm/index': 'src/swarm/index.ts',
|
|
10
|
+
'ai/index': 'src/ai/index.ts',
|
|
11
|
+
'training/index': 'src/training/index.ts',
|
|
12
|
+
'learning/index': 'src/learning/index.ts',
|
|
13
|
+
'skills/index': 'src/skills/index.ts',
|
|
14
|
+
'negotiation/index': 'src/negotiation/index.ts',
|
|
15
|
+
},
|
|
16
|
+
format: ['esm', 'cjs'],
|
|
17
|
+
dts: true,
|
|
18
|
+
clean: true,
|
|
19
|
+
splitting: false,
|
|
20
|
+
external: ['@holoscript/core'],
|
|
21
|
+
});
|
|
Binary file
|