@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,1082 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HoloScript AI Training Data Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates diverse HoloScript examples for AI model training.
|
|
5
|
+
* Creates input/output pairs covering all language features.
|
|
6
|
+
*
|
|
7
|
+
* @version 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// TYPES
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
export interface TrainingExample {
|
|
15
|
+
id: string;
|
|
16
|
+
category: TrainingCategory;
|
|
17
|
+
description: string;
|
|
18
|
+
holoScript: string;
|
|
19
|
+
expectedOutput?: {
|
|
20
|
+
type: 'r3f' | 'visionos' | 'usda';
|
|
21
|
+
snippet?: string;
|
|
22
|
+
};
|
|
23
|
+
tags: string[];
|
|
24
|
+
complexity: 'basic' | 'intermediate' | 'advanced';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type TrainingCategory =
|
|
28
|
+
| 'geometry'
|
|
29
|
+
| 'materials'
|
|
30
|
+
| 'physics'
|
|
31
|
+
| 'interactions'
|
|
32
|
+
| 'audio'
|
|
33
|
+
| 'ui'
|
|
34
|
+
| 'composition'
|
|
35
|
+
| 'state'
|
|
36
|
+
| 'logic'
|
|
37
|
+
| 'traits'
|
|
38
|
+
| 'animations'
|
|
39
|
+
| 'ar_vr'
|
|
40
|
+
| 'accessibility';
|
|
41
|
+
|
|
42
|
+
export interface GeneratorOptions {
|
|
43
|
+
count?: number;
|
|
44
|
+
categories?: TrainingCategory[];
|
|
45
|
+
complexityFilter?: ('basic' | 'intermediate' | 'advanced')[];
|
|
46
|
+
includeExpectedOutput?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// GEOMETRY EXAMPLES
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
const GEOMETRY_EXAMPLES: TrainingExample[] = [
|
|
54
|
+
{
|
|
55
|
+
id: 'geo-001',
|
|
56
|
+
category: 'geometry',
|
|
57
|
+
description: 'Simple cube object',
|
|
58
|
+
holoScript: `object "MyCube" {
|
|
59
|
+
geometry: "cube"
|
|
60
|
+
position: [0, 1, 0]
|
|
61
|
+
scale: [1, 1, 1]
|
|
62
|
+
}`,
|
|
63
|
+
tags: ['cube', 'basic', 'position'],
|
|
64
|
+
complexity: 'basic',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'geo-002',
|
|
68
|
+
category: 'geometry',
|
|
69
|
+
description: 'Colored sphere with radius',
|
|
70
|
+
holoScript: `object "Ball" {
|
|
71
|
+
geometry: "sphere"
|
|
72
|
+
radius: 0.5
|
|
73
|
+
color: "#ff6600"
|
|
74
|
+
position: [2, 0.5, 0]
|
|
75
|
+
}`,
|
|
76
|
+
tags: ['sphere', 'color', 'radius'],
|
|
77
|
+
complexity: 'basic',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'geo-003',
|
|
81
|
+
category: 'geometry',
|
|
82
|
+
description: 'Rotated plane as floor',
|
|
83
|
+
holoScript: `object "Floor" {
|
|
84
|
+
geometry: "plane"
|
|
85
|
+
size: 10
|
|
86
|
+
rotation: [-90, 0, 0]
|
|
87
|
+
color: "#333333"
|
|
88
|
+
}`,
|
|
89
|
+
tags: ['plane', 'rotation', 'floor'],
|
|
90
|
+
complexity: 'basic',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'geo-004',
|
|
94
|
+
category: 'geometry',
|
|
95
|
+
description: 'Cylinder pillar',
|
|
96
|
+
holoScript: `object "Pillar" {
|
|
97
|
+
geometry: "cylinder"
|
|
98
|
+
radius: 0.3
|
|
99
|
+
height: 3
|
|
100
|
+
position: [0, 1.5, 0]
|
|
101
|
+
color: "#aaaaaa"
|
|
102
|
+
}`,
|
|
103
|
+
tags: ['cylinder', 'height'],
|
|
104
|
+
complexity: 'basic',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'geo-005',
|
|
108
|
+
category: 'geometry',
|
|
109
|
+
description: '3D text object',
|
|
110
|
+
holoScript: `object "Title" {
|
|
111
|
+
geometry: "text"
|
|
112
|
+
text: "Hello VR"
|
|
113
|
+
font_size: 0.5
|
|
114
|
+
position: [0, 2, -2]
|
|
115
|
+
color: "#ffffff"
|
|
116
|
+
}`,
|
|
117
|
+
tags: ['text', '3d-text'],
|
|
118
|
+
complexity: 'intermediate',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'geo-006',
|
|
122
|
+
category: 'geometry',
|
|
123
|
+
description: 'External GLB model',
|
|
124
|
+
holoScript: `object "Character" {
|
|
125
|
+
model: "models/robot.glb"
|
|
126
|
+
position: [0, 0, 0]
|
|
127
|
+
scale: 0.5
|
|
128
|
+
}`,
|
|
129
|
+
tags: ['model', 'glb', 'import'],
|
|
130
|
+
complexity: 'intermediate',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'geo-007',
|
|
134
|
+
category: 'geometry',
|
|
135
|
+
description: 'Torus ring',
|
|
136
|
+
holoScript: `object "Ring" {
|
|
137
|
+
geometry: "torus"
|
|
138
|
+
radius: 1
|
|
139
|
+
tube: 0.2
|
|
140
|
+
position: [0, 1, 0]
|
|
141
|
+
color: "#gold"
|
|
142
|
+
}`,
|
|
143
|
+
tags: ['torus', 'ring'],
|
|
144
|
+
complexity: 'intermediate',
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
// =============================================================================
|
|
149
|
+
// MATERIAL EXAMPLES
|
|
150
|
+
// =============================================================================
|
|
151
|
+
|
|
152
|
+
const MATERIAL_EXAMPLES: TrainingExample[] = [
|
|
153
|
+
{
|
|
154
|
+
id: 'mat-001',
|
|
155
|
+
category: 'materials',
|
|
156
|
+
description: 'Metallic material',
|
|
157
|
+
holoScript: `object "MetalSphere" {
|
|
158
|
+
geometry: "sphere"
|
|
159
|
+
material: {
|
|
160
|
+
color: "#888888"
|
|
161
|
+
metalness: 1.0
|
|
162
|
+
roughness: 0.2
|
|
163
|
+
}
|
|
164
|
+
}`,
|
|
165
|
+
tags: ['metal', 'pbr', 'material'],
|
|
166
|
+
complexity: 'intermediate',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 'mat-002',
|
|
170
|
+
category: 'materials',
|
|
171
|
+
description: 'Glass material with transmission',
|
|
172
|
+
holoScript: `object "GlassCube" {
|
|
173
|
+
geometry: "cube"
|
|
174
|
+
surface: "glass"
|
|
175
|
+
color: "#ffffff"
|
|
176
|
+
opacity: 0.3
|
|
177
|
+
}`,
|
|
178
|
+
tags: ['glass', 'transparent', 'surface'],
|
|
179
|
+
complexity: 'intermediate',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'mat-003',
|
|
183
|
+
category: 'materials',
|
|
184
|
+
description: 'Emissive glowing object',
|
|
185
|
+
holoScript: `object "GlowOrb" {
|
|
186
|
+
geometry: "sphere"
|
|
187
|
+
surface: "emissive"
|
|
188
|
+
color: "#00ffff"
|
|
189
|
+
material: {
|
|
190
|
+
emissiveIntensity: 2.0
|
|
191
|
+
}
|
|
192
|
+
}`,
|
|
193
|
+
tags: ['emissive', 'glow', 'light'],
|
|
194
|
+
complexity: 'intermediate',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'mat-004',
|
|
198
|
+
category: 'materials',
|
|
199
|
+
description: 'Holographic material',
|
|
200
|
+
holoScript: `object "HoloDisplay" {
|
|
201
|
+
geometry: "plane"
|
|
202
|
+
surface: "hologram"
|
|
203
|
+
color: "#00ff88"
|
|
204
|
+
opacity: 0.7
|
|
205
|
+
}`,
|
|
206
|
+
tags: ['hologram', 'futuristic'],
|
|
207
|
+
complexity: 'advanced',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'mat-005',
|
|
211
|
+
category: 'materials',
|
|
212
|
+
description: 'Textured object',
|
|
213
|
+
holoScript: `object "TexturedBox" {
|
|
214
|
+
geometry: "cube"
|
|
215
|
+
material: {
|
|
216
|
+
map: "textures/wood.jpg"
|
|
217
|
+
normalMap: "textures/wood_normal.jpg"
|
|
218
|
+
roughness: 0.8
|
|
219
|
+
}
|
|
220
|
+
}`,
|
|
221
|
+
tags: ['texture', 'map', 'normal'],
|
|
222
|
+
complexity: 'advanced',
|
|
223
|
+
},
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
// =============================================================================
|
|
227
|
+
// PHYSICS EXAMPLES
|
|
228
|
+
// =============================================================================
|
|
229
|
+
|
|
230
|
+
const PHYSICS_EXAMPLES: TrainingExample[] = [
|
|
231
|
+
{
|
|
232
|
+
id: 'phy-001',
|
|
233
|
+
category: 'physics',
|
|
234
|
+
description: 'Physics-enabled falling cube',
|
|
235
|
+
holoScript: `object "FallingCube" {
|
|
236
|
+
geometry: "cube"
|
|
237
|
+
position: [0, 5, 0]
|
|
238
|
+
@physics(mass: 1.0)
|
|
239
|
+
@collidable
|
|
240
|
+
}`,
|
|
241
|
+
tags: ['physics', 'gravity', 'fall'],
|
|
242
|
+
complexity: 'basic',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: 'phy-002',
|
|
246
|
+
category: 'physics',
|
|
247
|
+
description: 'Bouncy ball',
|
|
248
|
+
holoScript: `object "BouncyBall" {
|
|
249
|
+
geometry: "sphere"
|
|
250
|
+
radius: 0.3
|
|
251
|
+
position: [0, 3, 0]
|
|
252
|
+
@physics(mass: 0.5, restitution: 0.9)
|
|
253
|
+
@collidable
|
|
254
|
+
}`,
|
|
255
|
+
tags: ['bounce', 'restitution', 'ball'],
|
|
256
|
+
complexity: 'intermediate',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: 'phy-003',
|
|
260
|
+
category: 'physics',
|
|
261
|
+
description: 'Static floor collider',
|
|
262
|
+
holoScript: `object "Ground" {
|
|
263
|
+
geometry: "plane"
|
|
264
|
+
size: 20
|
|
265
|
+
rotation: [-90, 0, 0]
|
|
266
|
+
@static
|
|
267
|
+
@collidable
|
|
268
|
+
}`,
|
|
269
|
+
tags: ['static', 'floor', 'collider'],
|
|
270
|
+
complexity: 'basic',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: 'phy-004',
|
|
274
|
+
category: 'physics',
|
|
275
|
+
description: 'Kinematic moving platform',
|
|
276
|
+
holoScript: `object "Platform" {
|
|
277
|
+
geometry: "cube"
|
|
278
|
+
scale: [3, 0.2, 3]
|
|
279
|
+
@kinematic
|
|
280
|
+
@collidable
|
|
281
|
+
|
|
282
|
+
logic {
|
|
283
|
+
on_tick(delta) {
|
|
284
|
+
position.y = sin(time) * 2
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}`,
|
|
288
|
+
tags: ['kinematic', 'platform', 'moving'],
|
|
289
|
+
complexity: 'advanced',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: 'phy-005',
|
|
293
|
+
category: 'physics',
|
|
294
|
+
description: 'Stacked physics boxes',
|
|
295
|
+
holoScript: `composition "PhysicsStack" {
|
|
296
|
+
object "Ground" {
|
|
297
|
+
geometry: "plane"
|
|
298
|
+
size: 10
|
|
299
|
+
rotation: [-90, 0, 0]
|
|
300
|
+
@static
|
|
301
|
+
@collidable
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
object "Box1" {
|
|
305
|
+
geometry: "cube"
|
|
306
|
+
position: [0, 0.5, 0]
|
|
307
|
+
@physics(mass: 2.0)
|
|
308
|
+
@collidable
|
|
309
|
+
@stackable
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
object "Box2" {
|
|
313
|
+
geometry: "cube"
|
|
314
|
+
position: [0, 1.5, 0]
|
|
315
|
+
@physics(mass: 1.0)
|
|
316
|
+
@collidable
|
|
317
|
+
@stackable
|
|
318
|
+
}
|
|
319
|
+
}`,
|
|
320
|
+
tags: ['stack', 'multiple', 'scene'],
|
|
321
|
+
complexity: 'advanced',
|
|
322
|
+
},
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
// =============================================================================
|
|
326
|
+
// INTERACTION EXAMPLES
|
|
327
|
+
// =============================================================================
|
|
328
|
+
|
|
329
|
+
const INTERACTION_EXAMPLES: TrainingExample[] = [
|
|
330
|
+
{
|
|
331
|
+
id: 'int-001',
|
|
332
|
+
category: 'interactions',
|
|
333
|
+
description: 'Grabbable object',
|
|
334
|
+
holoScript: `object "GrabbableCube" {
|
|
335
|
+
geometry: "cube"
|
|
336
|
+
color: "#4444ff"
|
|
337
|
+
@grabbable
|
|
338
|
+
@physics
|
|
339
|
+
@collidable
|
|
340
|
+
}`,
|
|
341
|
+
tags: ['grab', 'vr', 'hand'],
|
|
342
|
+
complexity: 'basic',
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
id: 'int-002',
|
|
346
|
+
category: 'interactions',
|
|
347
|
+
description: 'Hoverable button',
|
|
348
|
+
holoScript: `object "HoverButton" {
|
|
349
|
+
geometry: "cube"
|
|
350
|
+
scale: [0.2, 0.05, 0.1]
|
|
351
|
+
color: "#00ff00"
|
|
352
|
+
@hoverable(highlight_color: "#ffff00", scale_factor: 1.1)
|
|
353
|
+
@clickable
|
|
354
|
+
}`,
|
|
355
|
+
tags: ['hover', 'button', 'highlight'],
|
|
356
|
+
complexity: 'intermediate',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: 'int-003',
|
|
360
|
+
category: 'interactions',
|
|
361
|
+
description: 'Throwable ball',
|
|
362
|
+
holoScript: `object "ThrowBall" {
|
|
363
|
+
geometry: "sphere"
|
|
364
|
+
radius: 0.15
|
|
365
|
+
color: "#ff0000"
|
|
366
|
+
@grabbable
|
|
367
|
+
@throwable(max_velocity: 15, spin: true)
|
|
368
|
+
@physics(mass: 0.3)
|
|
369
|
+
@collidable
|
|
370
|
+
}`,
|
|
371
|
+
tags: ['throw', 'velocity', 'sports'],
|
|
372
|
+
complexity: 'intermediate',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
id: 'int-004',
|
|
376
|
+
category: 'interactions',
|
|
377
|
+
description: 'Draggable slider',
|
|
378
|
+
holoScript: `object "DragSlider" {
|
|
379
|
+
geometry: "sphere"
|
|
380
|
+
radius: 0.05
|
|
381
|
+
color: "#ffffff"
|
|
382
|
+
@draggable(constrain_axis: "x", min: -1, max: 1)
|
|
383
|
+
@pointable
|
|
384
|
+
}`,
|
|
385
|
+
tags: ['drag', 'constrain', 'slider'],
|
|
386
|
+
complexity: 'intermediate',
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: 'int-005',
|
|
390
|
+
category: 'interactions',
|
|
391
|
+
description: 'Scalable and rotatable object',
|
|
392
|
+
holoScript: `object "Manipulable" {
|
|
393
|
+
geometry: "cube"
|
|
394
|
+
@grabbable
|
|
395
|
+
@scalable(min_scale: 0.5, max_scale: 3.0)
|
|
396
|
+
@rotatable
|
|
397
|
+
}`,
|
|
398
|
+
tags: ['scale', 'rotate', 'transform'],
|
|
399
|
+
complexity: 'advanced',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
id: 'int-006',
|
|
403
|
+
category: 'interactions',
|
|
404
|
+
description: 'Snappable object',
|
|
405
|
+
holoScript: `object "SnapCube" {
|
|
406
|
+
geometry: "cube"
|
|
407
|
+
@grabbable
|
|
408
|
+
@snappable(snap_distance: 0.3, snap_rotation: 45)
|
|
409
|
+
}`,
|
|
410
|
+
tags: ['snap', 'grid', 'align'],
|
|
411
|
+
complexity: 'advanced',
|
|
412
|
+
},
|
|
413
|
+
];
|
|
414
|
+
|
|
415
|
+
// =============================================================================
|
|
416
|
+
// AUDIO EXAMPLES
|
|
417
|
+
// =============================================================================
|
|
418
|
+
|
|
419
|
+
const AUDIO_EXAMPLES: TrainingExample[] = [
|
|
420
|
+
{
|
|
421
|
+
id: 'aud-001',
|
|
422
|
+
category: 'audio',
|
|
423
|
+
description: 'Ambient background music',
|
|
424
|
+
holoScript: `object "BackgroundMusic" {
|
|
425
|
+
audio: "sounds/ambient.mp3"
|
|
426
|
+
volume: 0.5
|
|
427
|
+
loop: true
|
|
428
|
+
}`,
|
|
429
|
+
tags: ['music', 'ambient', 'loop'],
|
|
430
|
+
complexity: 'basic',
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
id: 'aud-002',
|
|
434
|
+
category: 'audio',
|
|
435
|
+
description: 'Spatial audio source',
|
|
436
|
+
holoScript: `object "Speaker" {
|
|
437
|
+
geometry: "cube"
|
|
438
|
+
scale: [0.3, 0.3, 0.3]
|
|
439
|
+
position: [2, 1, 0]
|
|
440
|
+
audio: "sounds/radio.mp3"
|
|
441
|
+
@spatial_audio(refDistance: 2, rolloff: 1.5)
|
|
442
|
+
}`,
|
|
443
|
+
tags: ['spatial', '3d-audio', 'positional'],
|
|
444
|
+
complexity: 'intermediate',
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
id: 'aud-003',
|
|
448
|
+
category: 'audio',
|
|
449
|
+
description: 'Audio zone with reverb',
|
|
450
|
+
holoScript: `zone "CaveZone" {
|
|
451
|
+
shape: "box"
|
|
452
|
+
size: [10, 5, 10]
|
|
453
|
+
position: [0, 2.5, 0]
|
|
454
|
+
@reverb_zone(preset: "cave", wetLevel: 0.6)
|
|
455
|
+
}`,
|
|
456
|
+
tags: ['reverb', 'zone', 'cave'],
|
|
457
|
+
complexity: 'advanced',
|
|
458
|
+
},
|
|
459
|
+
];
|
|
460
|
+
|
|
461
|
+
// =============================================================================
|
|
462
|
+
// UI EXAMPLES
|
|
463
|
+
// =============================================================================
|
|
464
|
+
|
|
465
|
+
const UI_EXAMPLES: TrainingExample[] = [
|
|
466
|
+
{
|
|
467
|
+
id: 'ui-001',
|
|
468
|
+
category: 'ui',
|
|
469
|
+
description: 'Floating UI panel',
|
|
470
|
+
holoScript: `ui_panel "Settings" {
|
|
471
|
+
position: [0, 1.5, -2]
|
|
472
|
+
width: 400
|
|
473
|
+
height: 300
|
|
474
|
+
@ui_floating(follow_delay: 0.3, distance: 2)
|
|
475
|
+
|
|
476
|
+
ui_text "Title" {
|
|
477
|
+
content: "Settings"
|
|
478
|
+
fontSize: 24
|
|
479
|
+
}
|
|
480
|
+
}`,
|
|
481
|
+
tags: ['panel', 'floating', 'vr-ui'],
|
|
482
|
+
complexity: 'intermediate',
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: 'ui-002',
|
|
486
|
+
category: 'ui',
|
|
487
|
+
description: 'Interactive button',
|
|
488
|
+
holoScript: `ui_button "StartButton" {
|
|
489
|
+
text: "Start Game"
|
|
490
|
+
position: [0, 1, -1.5]
|
|
491
|
+
@hoverable(highlight_color: "#00ff00")
|
|
492
|
+
@clickable
|
|
493
|
+
|
|
494
|
+
logic {
|
|
495
|
+
on_click() {
|
|
496
|
+
emit("game:start")
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}`,
|
|
500
|
+
tags: ['button', 'click', 'event'],
|
|
501
|
+
complexity: 'intermediate',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
id: 'ui-003',
|
|
505
|
+
category: 'ui',
|
|
506
|
+
description: 'Slider with data binding',
|
|
507
|
+
holoScript: `ui_slider "VolumeControl" {
|
|
508
|
+
min: 0
|
|
509
|
+
max: 100
|
|
510
|
+
value: bind(state.volume)
|
|
511
|
+
position: [0, 1.2, -1.5]
|
|
512
|
+
}`,
|
|
513
|
+
tags: ['slider', 'binding', 'control'],
|
|
514
|
+
complexity: 'intermediate',
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
id: 'ui-004',
|
|
518
|
+
category: 'ui',
|
|
519
|
+
description: 'Hand-attached menu',
|
|
520
|
+
holoScript: `ui_panel "HandMenu" {
|
|
521
|
+
@ui_hand_menu(hand: "left", trigger: "palm_up")
|
|
522
|
+
|
|
523
|
+
ui_button "Inventory" {
|
|
524
|
+
text: "Inventory"
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
ui_button "Settings" {
|
|
528
|
+
text: "Settings"
|
|
529
|
+
}
|
|
530
|
+
}`,
|
|
531
|
+
tags: ['hand-menu', 'palm', 'vr'],
|
|
532
|
+
complexity: 'advanced',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
id: 'ui-005',
|
|
536
|
+
category: 'ui',
|
|
537
|
+
description: 'Curved display panel',
|
|
538
|
+
holoScript: `ui_panel "CurvedDisplay" {
|
|
539
|
+
position: [0, 1.5, -3]
|
|
540
|
+
width: 800
|
|
541
|
+
height: 400
|
|
542
|
+
@ui_curved(radius: 3, arc_angle: 90)
|
|
543
|
+
|
|
544
|
+
ui_text "Content" {
|
|
545
|
+
content: "Immersive curved display"
|
|
546
|
+
}
|
|
547
|
+
}`,
|
|
548
|
+
tags: ['curved', 'display', 'immersive'],
|
|
549
|
+
complexity: 'advanced',
|
|
550
|
+
},
|
|
551
|
+
];
|
|
552
|
+
|
|
553
|
+
// =============================================================================
|
|
554
|
+
// COMPOSITION EXAMPLES
|
|
555
|
+
// =============================================================================
|
|
556
|
+
|
|
557
|
+
const COMPOSITION_EXAMPLES: TrainingExample[] = [
|
|
558
|
+
{
|
|
559
|
+
id: 'comp-001',
|
|
560
|
+
category: 'composition',
|
|
561
|
+
description: 'Basic scene composition',
|
|
562
|
+
holoScript: `composition "SimpleScene" {
|
|
563
|
+
environment: "studio"
|
|
564
|
+
|
|
565
|
+
object "Floor" {
|
|
566
|
+
geometry: "plane"
|
|
567
|
+
size: 10
|
|
568
|
+
rotation: [-90, 0, 0]
|
|
569
|
+
color: "#444444"
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
object "Subject" {
|
|
573
|
+
geometry: "sphere"
|
|
574
|
+
position: [0, 1, 0]
|
|
575
|
+
color: "#ff6600"
|
|
576
|
+
}
|
|
577
|
+
}`,
|
|
578
|
+
tags: ['composition', 'scene', 'basic'],
|
|
579
|
+
complexity: 'basic',
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
id: 'comp-002',
|
|
583
|
+
category: 'composition',
|
|
584
|
+
description: 'Spatial group hierarchy',
|
|
585
|
+
holoScript: `composition "GroupedScene" {
|
|
586
|
+
group "Furniture" {
|
|
587
|
+
position: [2, 0, 0]
|
|
588
|
+
|
|
589
|
+
object "Table" {
|
|
590
|
+
geometry: "cube"
|
|
591
|
+
scale: [1, 0.05, 0.6]
|
|
592
|
+
position: [0, 0.75, 0]
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
object "Chair" {
|
|
596
|
+
geometry: "cube"
|
|
597
|
+
scale: [0.4, 0.8, 0.4]
|
|
598
|
+
position: [0, 0.4, 0.5]
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}`,
|
|
602
|
+
tags: ['group', 'hierarchy', 'furniture'],
|
|
603
|
+
complexity: 'intermediate',
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
id: 'comp-003',
|
|
607
|
+
category: 'composition',
|
|
608
|
+
description: 'Template-based composition',
|
|
609
|
+
holoScript: `template "InteractiveBox" {
|
|
610
|
+
geometry: "cube"
|
|
611
|
+
@grabbable
|
|
612
|
+
@physics
|
|
613
|
+
@collidable
|
|
614
|
+
@hoverable
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
composition "TemplateDemo" {
|
|
618
|
+
object "Box1" using "InteractiveBox" {
|
|
619
|
+
position: [-1, 1, 0]
|
|
620
|
+
color: "#ff0000"
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
object "Box2" using "InteractiveBox" {
|
|
624
|
+
position: [0, 1, 0]
|
|
625
|
+
color: "#00ff00"
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
object "Box3" using "InteractiveBox" {
|
|
629
|
+
position: [1, 1, 0]
|
|
630
|
+
color: "#0000ff"
|
|
631
|
+
}
|
|
632
|
+
}`,
|
|
633
|
+
tags: ['template', 'reuse', 'multiple'],
|
|
634
|
+
complexity: 'advanced',
|
|
635
|
+
},
|
|
636
|
+
];
|
|
637
|
+
|
|
638
|
+
// =============================================================================
|
|
639
|
+
// STATE EXAMPLES
|
|
640
|
+
// =============================================================================
|
|
641
|
+
|
|
642
|
+
const STATE_EXAMPLES: TrainingExample[] = [
|
|
643
|
+
{
|
|
644
|
+
id: 'state-001',
|
|
645
|
+
category: 'state',
|
|
646
|
+
description: 'Basic state management',
|
|
647
|
+
holoScript: `composition "StatefulScene" {
|
|
648
|
+
state {
|
|
649
|
+
score: 0
|
|
650
|
+
isPlaying: false
|
|
651
|
+
playerName: "Player 1"
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
ui_text "ScoreDisplay" {
|
|
655
|
+
content: bind("Score: " + state.score)
|
|
656
|
+
position: [0, 2, -2]
|
|
657
|
+
}
|
|
658
|
+
}`,
|
|
659
|
+
tags: ['state', 'binding', 'score'],
|
|
660
|
+
complexity: 'intermediate',
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
id: 'state-002',
|
|
664
|
+
category: 'state',
|
|
665
|
+
description: 'State with arrays',
|
|
666
|
+
holoScript: `composition "InventorySystem" {
|
|
667
|
+
state {
|
|
668
|
+
items: []
|
|
669
|
+
selectedIndex: 0
|
|
670
|
+
maxItems: 10
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
logic {
|
|
674
|
+
action addItem(item) {
|
|
675
|
+
if (state.items.length < state.maxItems) {
|
|
676
|
+
state.items.push(item)
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
action removeItem(index) {
|
|
681
|
+
state.items.splice(index, 1)
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}`,
|
|
685
|
+
tags: ['array', 'inventory', 'actions'],
|
|
686
|
+
complexity: 'advanced',
|
|
687
|
+
},
|
|
688
|
+
];
|
|
689
|
+
|
|
690
|
+
// =============================================================================
|
|
691
|
+
// LOGIC EXAMPLES
|
|
692
|
+
// =============================================================================
|
|
693
|
+
|
|
694
|
+
const LOGIC_EXAMPLES: TrainingExample[] = [
|
|
695
|
+
{
|
|
696
|
+
id: 'logic-001',
|
|
697
|
+
category: 'logic',
|
|
698
|
+
description: 'Event handler on click',
|
|
699
|
+
holoScript: `object "ClickTarget" {
|
|
700
|
+
geometry: "cube"
|
|
701
|
+
@clickable
|
|
702
|
+
|
|
703
|
+
logic {
|
|
704
|
+
on_click() {
|
|
705
|
+
color = "#ff0000"
|
|
706
|
+
emit("target:hit")
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}`,
|
|
710
|
+
tags: ['event', 'click', 'emit'],
|
|
711
|
+
complexity: 'basic',
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
id: 'logic-002',
|
|
715
|
+
category: 'logic',
|
|
716
|
+
description: 'Conditional logic',
|
|
717
|
+
holoScript: `object "Door" {
|
|
718
|
+
geometry: "cube"
|
|
719
|
+
scale: [1, 2, 0.1]
|
|
720
|
+
|
|
721
|
+
state {
|
|
722
|
+
isOpen: false
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
logic {
|
|
726
|
+
action toggle() {
|
|
727
|
+
if (state.isOpen) {
|
|
728
|
+
animate { rotation: [0, 0, 0], duration: 0.5 }
|
|
729
|
+
state.isOpen = false
|
|
730
|
+
} else {
|
|
731
|
+
animate { rotation: [0, 90, 0], duration: 0.5 }
|
|
732
|
+
state.isOpen = true
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}`,
|
|
737
|
+
tags: ['conditional', 'door', 'animate'],
|
|
738
|
+
complexity: 'intermediate',
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
id: 'logic-003',
|
|
742
|
+
category: 'logic',
|
|
743
|
+
description: 'Timer-based logic',
|
|
744
|
+
holoScript: `object "Spawner" {
|
|
745
|
+
logic {
|
|
746
|
+
on_tick(1.0) {
|
|
747
|
+
spawn("Projectile", {
|
|
748
|
+
position: position,
|
|
749
|
+
velocity: [0, 5, 0]
|
|
750
|
+
})
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}`,
|
|
754
|
+
tags: ['timer', 'spawn', 'tick'],
|
|
755
|
+
complexity: 'intermediate',
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
id: 'logic-004',
|
|
759
|
+
category: 'logic',
|
|
760
|
+
description: 'Loop iteration',
|
|
761
|
+
holoScript: `composition "GridSpawner" {
|
|
762
|
+
logic {
|
|
763
|
+
action createGrid(rows, cols) {
|
|
764
|
+
for (i in range(rows)) {
|
|
765
|
+
for (j in range(cols)) {
|
|
766
|
+
spawn("GridCell", {
|
|
767
|
+
position: [i * 1.2, 0.5, j * 1.2]
|
|
768
|
+
})
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}`,
|
|
774
|
+
tags: ['loop', 'grid', 'spawn'],
|
|
775
|
+
complexity: 'advanced',
|
|
776
|
+
},
|
|
777
|
+
];
|
|
778
|
+
|
|
779
|
+
// =============================================================================
|
|
780
|
+
// TRAIT EXAMPLES
|
|
781
|
+
// =============================================================================
|
|
782
|
+
|
|
783
|
+
const TRAIT_EXAMPLES: TrainingExample[] = [
|
|
784
|
+
{
|
|
785
|
+
id: 'trait-001',
|
|
786
|
+
category: 'traits',
|
|
787
|
+
description: 'Multiple physics traits',
|
|
788
|
+
holoScript: `object "ComplexPhysics" {
|
|
789
|
+
geometry: "sphere"
|
|
790
|
+
@physics(mass: 2.0, friction: 0.5, restitution: 0.7)
|
|
791
|
+
@collidable
|
|
792
|
+
@grabbable(snap_to_hand: true)
|
|
793
|
+
@throwable(max_velocity: 20)
|
|
794
|
+
}`,
|
|
795
|
+
tags: ['multiple-traits', 'physics', 'interaction'],
|
|
796
|
+
complexity: 'intermediate',
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
id: 'trait-002',
|
|
800
|
+
category: 'traits',
|
|
801
|
+
description: 'Accessibility traits',
|
|
802
|
+
holoScript: `object "AccessibleButton" {
|
|
803
|
+
geometry: "cube"
|
|
804
|
+
@accessible(label: "Submit form", hint: "Double tap to submit")
|
|
805
|
+
@hoverable
|
|
806
|
+
@clickable
|
|
807
|
+
}`,
|
|
808
|
+
tags: ['accessible', 'a11y', 'screen-reader'],
|
|
809
|
+
complexity: 'intermediate',
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
id: 'trait-003',
|
|
813
|
+
category: 'traits',
|
|
814
|
+
description: 'AR anchor trait',
|
|
815
|
+
holoScript: `object "ARObject" {
|
|
816
|
+
model: "models/furniture.glb"
|
|
817
|
+
@anchor(anchor_type: "plane")
|
|
818
|
+
@grabbable
|
|
819
|
+
@scalable
|
|
820
|
+
}`,
|
|
821
|
+
tags: ['ar', 'anchor', 'plane-detection'],
|
|
822
|
+
complexity: 'advanced',
|
|
823
|
+
},
|
|
824
|
+
];
|
|
825
|
+
|
|
826
|
+
// =============================================================================
|
|
827
|
+
// ANIMATION EXAMPLES
|
|
828
|
+
// =============================================================================
|
|
829
|
+
|
|
830
|
+
const ANIMATION_EXAMPLES: TrainingExample[] = [
|
|
831
|
+
{
|
|
832
|
+
id: 'anim-001',
|
|
833
|
+
category: 'animations',
|
|
834
|
+
description: 'Simple position animation',
|
|
835
|
+
holoScript: `object "MovingCube" {
|
|
836
|
+
geometry: "cube"
|
|
837
|
+
position: [0, 1, 0]
|
|
838
|
+
|
|
839
|
+
logic {
|
|
840
|
+
on_start() {
|
|
841
|
+
animate {
|
|
842
|
+
position: [3, 1, 0]
|
|
843
|
+
duration: 2.0
|
|
844
|
+
easing: "ease-in-out"
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}`,
|
|
849
|
+
tags: ['animate', 'position', 'easing'],
|
|
850
|
+
complexity: 'basic',
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
id: 'anim-002',
|
|
854
|
+
category: 'animations',
|
|
855
|
+
description: 'Looping rotation',
|
|
856
|
+
holoScript: `object "SpinningLogo" {
|
|
857
|
+
geometry: "cube"
|
|
858
|
+
|
|
859
|
+
logic {
|
|
860
|
+
on_start() {
|
|
861
|
+
animate {
|
|
862
|
+
rotation: [0, 360, 0]
|
|
863
|
+
duration: 4.0
|
|
864
|
+
loop: true
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}`,
|
|
869
|
+
tags: ['rotation', 'loop', 'spin'],
|
|
870
|
+
complexity: 'basic',
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
id: 'anim-003',
|
|
874
|
+
category: 'animations',
|
|
875
|
+
description: 'Timeline animation',
|
|
876
|
+
holoScript: `composition "Sequence" {
|
|
877
|
+
timeline "intro" {
|
|
878
|
+
0.0: animate "Title" { opacity: 1, duration: 1 }
|
|
879
|
+
1.5: animate "Subtitle" { opacity: 1, duration: 0.5 }
|
|
880
|
+
2.5: animate "Content" { position: [0, 1, -2], duration: 1 }
|
|
881
|
+
4.0: emit "intro:complete"
|
|
882
|
+
}
|
|
883
|
+
}`,
|
|
884
|
+
tags: ['timeline', 'sequence', 'keyframes'],
|
|
885
|
+
complexity: 'advanced',
|
|
886
|
+
},
|
|
887
|
+
];
|
|
888
|
+
|
|
889
|
+
// =============================================================================
|
|
890
|
+
// AR/VR EXAMPLES
|
|
891
|
+
// =============================================================================
|
|
892
|
+
|
|
893
|
+
const AR_VR_EXAMPLES: TrainingExample[] = [
|
|
894
|
+
{
|
|
895
|
+
id: 'arvr-001',
|
|
896
|
+
category: 'ar_vr',
|
|
897
|
+
description: 'Hand-tracked interaction',
|
|
898
|
+
holoScript: `object "HandTarget" {
|
|
899
|
+
geometry: "sphere"
|
|
900
|
+
radius: 0.1
|
|
901
|
+
@hand_tracking(joints: ["indexTip", "thumbTip"])
|
|
902
|
+
@pointable
|
|
903
|
+
|
|
904
|
+
logic {
|
|
905
|
+
on_pinch() {
|
|
906
|
+
emit("pinch:detected")
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}`,
|
|
910
|
+
tags: ['hand-tracking', 'pinch', 'gesture'],
|
|
911
|
+
complexity: 'advanced',
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
id: 'arvr-002',
|
|
915
|
+
category: 'ar_vr',
|
|
916
|
+
description: 'Eye tracking gaze',
|
|
917
|
+
holoScript: `object "GazeTarget" {
|
|
918
|
+
geometry: "sphere"
|
|
919
|
+
@eye_tracking
|
|
920
|
+
@hoverable
|
|
921
|
+
|
|
922
|
+
logic {
|
|
923
|
+
on_gaze_enter() {
|
|
924
|
+
scale = 1.2
|
|
925
|
+
}
|
|
926
|
+
on_gaze_exit() {
|
|
927
|
+
scale = 1.0
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}`,
|
|
931
|
+
tags: ['eye-tracking', 'gaze', 'focus'],
|
|
932
|
+
complexity: 'advanced',
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
id: 'arvr-003',
|
|
936
|
+
category: 'ar_vr',
|
|
937
|
+
description: 'Portal to another world',
|
|
938
|
+
holoScript: `object "PortalFrame" {
|
|
939
|
+
geometry: "torus"
|
|
940
|
+
radius: 1.5
|
|
941
|
+
tube: 0.1
|
|
942
|
+
@portal(target_world: "fantasy_realm")
|
|
943
|
+
}`,
|
|
944
|
+
tags: ['portal', 'world', 'visionos'],
|
|
945
|
+
complexity: 'advanced',
|
|
946
|
+
},
|
|
947
|
+
];
|
|
948
|
+
|
|
949
|
+
// =============================================================================
|
|
950
|
+
// GENERATOR CLASS
|
|
951
|
+
// =============================================================================
|
|
952
|
+
|
|
953
|
+
export class TrainingDataGenerator {
|
|
954
|
+
private allExamples: TrainingExample[] = [];
|
|
955
|
+
|
|
956
|
+
constructor() {
|
|
957
|
+
this.allExamples = [
|
|
958
|
+
...GEOMETRY_EXAMPLES,
|
|
959
|
+
...MATERIAL_EXAMPLES,
|
|
960
|
+
...PHYSICS_EXAMPLES,
|
|
961
|
+
...INTERACTION_EXAMPLES,
|
|
962
|
+
...AUDIO_EXAMPLES,
|
|
963
|
+
...UI_EXAMPLES,
|
|
964
|
+
...COMPOSITION_EXAMPLES,
|
|
965
|
+
...STATE_EXAMPLES,
|
|
966
|
+
...LOGIC_EXAMPLES,
|
|
967
|
+
...TRAIT_EXAMPLES,
|
|
968
|
+
...ANIMATION_EXAMPLES,
|
|
969
|
+
...AR_VR_EXAMPLES,
|
|
970
|
+
];
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Generate training examples based on options
|
|
975
|
+
*/
|
|
976
|
+
generate(options: GeneratorOptions = {}): TrainingExample[] {
|
|
977
|
+
let filtered = [...this.allExamples];
|
|
978
|
+
|
|
979
|
+
// Filter by category
|
|
980
|
+
if (options.categories && options.categories.length > 0) {
|
|
981
|
+
filtered = filtered.filter((ex) => options.categories!.includes(ex.category));
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
// Filter by complexity
|
|
985
|
+
if (options.complexityFilter && options.complexityFilter.length > 0) {
|
|
986
|
+
filtered = filtered.filter((ex) => options.complexityFilter!.includes(ex.complexity));
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
// Limit count
|
|
990
|
+
if (options.count && options.count < filtered.length) {
|
|
991
|
+
filtered = this.shuffleArray(filtered).slice(0, options.count);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
return filtered;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Generate all examples
|
|
999
|
+
*/
|
|
1000
|
+
generateAll(): TrainingExample[] {
|
|
1001
|
+
return [...this.allExamples];
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Get examples by category
|
|
1006
|
+
*/
|
|
1007
|
+
getByCategory(category: TrainingCategory): TrainingExample[] {
|
|
1008
|
+
return this.allExamples.filter((ex) => ex.category === category);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Get examples by complexity
|
|
1013
|
+
*/
|
|
1014
|
+
getByComplexity(complexity: 'basic' | 'intermediate' | 'advanced'): TrainingExample[] {
|
|
1015
|
+
return this.allExamples.filter((ex) => ex.complexity === complexity);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Get examples by tag
|
|
1020
|
+
*/
|
|
1021
|
+
getByTag(tag: string): TrainingExample[] {
|
|
1022
|
+
return this.allExamples.filter((ex) => ex.tags.includes(tag));
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Get category statistics
|
|
1027
|
+
*/
|
|
1028
|
+
getStats(): Record<TrainingCategory, number> {
|
|
1029
|
+
const stats = {} as Record<TrainingCategory, number>;
|
|
1030
|
+
for (const ex of this.allExamples) {
|
|
1031
|
+
stats[ex.category] = (stats[ex.category] || 0) + 1;
|
|
1032
|
+
}
|
|
1033
|
+
return stats;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Export as JSON for training
|
|
1038
|
+
*/
|
|
1039
|
+
exportJSON(): string {
|
|
1040
|
+
return JSON.stringify(this.allExamples, null, 2);
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* Export as JSONL (one JSON per line)
|
|
1045
|
+
*/
|
|
1046
|
+
exportJSONL(): string {
|
|
1047
|
+
return this.allExamples.map((ex) => JSON.stringify(ex)).join('\n');
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
private shuffleArray<T>(array: T[]): T[] {
|
|
1051
|
+
const result = [...array];
|
|
1052
|
+
for (let i = result.length - 1; i > 0; i--) {
|
|
1053
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
1054
|
+
[result[i], result[j]] = [result[j], result[i]];
|
|
1055
|
+
}
|
|
1056
|
+
return result;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
// =============================================================================
|
|
1061
|
+
// EXPORTS
|
|
1062
|
+
// =============================================================================
|
|
1063
|
+
|
|
1064
|
+
export const ALL_CATEGORIES: TrainingCategory[] = [
|
|
1065
|
+
'geometry',
|
|
1066
|
+
'materials',
|
|
1067
|
+
'physics',
|
|
1068
|
+
'interactions',
|
|
1069
|
+
'audio',
|
|
1070
|
+
'ui',
|
|
1071
|
+
'composition',
|
|
1072
|
+
'state',
|
|
1073
|
+
'logic',
|
|
1074
|
+
'traits',
|
|
1075
|
+
'animations',
|
|
1076
|
+
'ar_vr',
|
|
1077
|
+
'accessibility',
|
|
1078
|
+
];
|
|
1079
|
+
|
|
1080
|
+
export function createTrainingDataGenerator(): TrainingDataGenerator {
|
|
1081
|
+
return new TrainingDataGenerator();
|
|
1082
|
+
}
|