@holoscript/framework 6.0.3 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -2
- package/ROADMAP.md +68 -66
- package/dist/{InvisibleWallet-BB6tFvRA.d.cts → InvisibleWallet-EFiuaLn3.d.cts} +1 -1
- package/dist/{OrchestratorAgent-BvWgf9uw.d.cts → OrchestratorAgent-CrLDGNL6.d.cts} +1 -1
- package/dist/agents/index.cjs +11 -10
- package/dist/agents/index.d.cts +4 -16
- package/dist/ai/index.cjs +2 -2
- package/dist/behavior.cjs +10 -0
- package/dist/economy/index.cjs +4 -4
- package/dist/economy/index.d.cts +2 -2
- package/dist/index.cjs +33 -11
- package/dist/index.d.cts +3 -3
- package/dist/swarm/index.cjs +3 -0
- package/package.json +14 -9
- package/src/__tests__/bounty-marketplace.test.ts +53 -21
- package/src/__tests__/delegation.test.ts +1 -4
- package/src/__tests__/done-log-audit.test.ts +38 -46
- package/src/__tests__/framework.test.ts +172 -53
- package/src/__tests__/goal-synthesizer.test.ts +9 -6
- package/src/__tests__/presence.test.ts +1 -1
- package/src/__tests__/protocol-agent.test.ts +12 -11
- package/src/__tests__/revenue-splitter.test.ts +22 -15
- package/src/__tests__/scenario-driven-todo.test.ts +55 -35
- package/src/__tests__/self-improve.test.ts +28 -9
- package/src/__tests__/service-lifecycle.test.ts +9 -3
- package/src/__tests__/skill-router.test.ts +3 -3
- package/src/agents/CulturalMemory.ts +6 -6
- package/src/agents/DelegationTraceHooks.ts +560 -0
- package/src/agents/FederatedRegistryAdapter.ts +1 -1
- package/src/agents/NormEngine.ts +3 -8
- package/src/agents/OrchestratorAgent.ts +1 -1
- package/src/agents/TaskDelegationService.ts +5 -9
- package/src/agents/__tests__/AgentWalletRegistry.test.ts +5 -4
- package/src/agents/__tests__/CrossRealityHandoff.test.ts +9 -3
- package/src/agents/__tests__/DelegationTraceHooks.test.ts +390 -0
- package/src/agents/__tests__/TaskDelegationService.test.ts +4 -2
- package/src/agents/spatial-comms/Layer1RealTime.ts +36 -19
- package/src/agents/spatial-comms/Layer2A2A.ts +1 -3
- package/src/agents/spatial-comms/Layer3MCP.ts +13 -4
- package/src/agents/spatial-comms/ProtocolTypes.ts +5 -2
- package/src/agents/spatial-comms/examples/multi-agent-world-creation.ts +2 -2
- package/src/ai/HoloScriptGenerator.ts +2 -2
- package/src/ai/__tests__/PerceptionSystem.prod.test.ts +1 -1
- package/src/ai/__tests__/PerceptionSystem.test.ts +14 -14
- package/src/ai/__tests__/SteeringBehaviors.prod.test.ts +1 -1
- package/src/ai/index.ts +5 -1
- package/src/board/audit.ts +17 -6
- package/src/board/board-ops.ts +45 -15
- package/src/board/board-types.ts +94 -20
- package/src/delegation.ts +5 -3
- package/src/distributed-claimer.ts +13 -2
- package/src/economy/BountyManager.ts +40 -18
- package/src/economy/KnowledgeMarketplace.ts +27 -8
- package/src/economy/PaymentWebhookService.ts +0 -1
- package/src/economy/RevenueSplitter.ts +2 -4
- package/src/economy/UnifiedBudgetOptimizer.ts +8 -9
- package/src/economy/_core-stubs.ts +1 -1
- package/src/economy/x402-facilitator.ts +17 -8
- package/src/index.ts +16 -12
- package/src/knowledge/__tests__/knowledge-consolidator.test.ts +138 -89
- package/src/knowledge/__tests__/knowledge-store-vector.test.ts +59 -16
- package/src/knowledge/brain.ts +7 -7
- package/src/knowledge/consolidation.ts +16 -16
- package/src/knowledge/knowledge-consolidator.ts +60 -30
- package/src/knowledge/knowledge-store.ts +83 -45
- package/src/learning/ProceduralCompiler.ts +6 -1
- package/src/learning/learning/MemoryConsolidator.ts +102 -0
- package/src/learning/learning/MemoryScorer.ts +69 -0
- package/src/learning/learning/ProceduralCompiler.ts +45 -0
- package/src/learning/learning/SemanticClusterer.ts +66 -0
- package/src/llm/llm-adapter.ts +24 -10
- package/src/mesh/index.ts +37 -17
- package/src/protocol/goal-synthesizer.ts +24 -34
- package/src/protocol/implementations.ts +91 -22
- package/src/protocol/micro-phase-decomposer.ts +25 -17
- package/src/protocol/micro-step-decomposer.test.ts +104 -39
- package/src/protocol-agent.test.ts +17 -7
- package/src/protocol-agent.ts +45 -42
- package/src/self-improve/absorb-scanner.ts +9 -6
- package/src/self-improve/evolution-engine.ts +36 -18
- package/src/self-improve/framework-absorber.ts +21 -16
- package/src/self-improve/index.ts +2 -10
- package/src/self-improve/prompt-optimizer.ts +31 -19
- package/src/self-improve/test-generator.ts +16 -12
- package/src/skill-router.ts +7 -6
- package/src/swarm/messaging/GossipProtocol.ts +1 -1
- package/src/swarm/messaging/__tests__/BroadcastChannel.prod.test.ts +31 -9
- package/src/swarm/messaging/__tests__/GossipProtocol.prod.test.ts +21 -7
- package/src/swarm/messaging/__tests__/SwarmEventBus.prod.test.ts +24 -8
- package/src/swarm/messaging/__tests__/SwarmEventBus.test.ts +6 -2
- package/src/team.ts +277 -122
- package/src/training/scripts/generate-spatial-dataset.ts +1 -1
- package/src/training/training/LRScheduler.ts +377 -0
- package/src/training/training/QualityScoringPipeline.ts +139 -0
- package/src/training/training/SoftDedup.ts +461 -0
- package/src/training/training/SparsityMonitor.ts +685 -0
- package/src/training/training/SparsityMonitorTypes.ts +209 -0
- package/src/training/training/SpatialTrainingDataGenerator.ts +1526 -0
- package/src/training/training/SpatialTrainingDataTypes.ts +216 -0
- package/src/training/training/TrainingPipelineConfig.ts +215 -0
- package/src/training/training/__tests__/CorpusValidation.test.ts +87 -0
- package/src/training/training/__tests__/LRScheduler.test.ts +592 -0
- package/src/training/training/__tests__/SoftDedup.test.ts +415 -0
- package/src/training/training/__tests__/SparsityMonitor.test.ts +1623 -0
- package/src/training/training/__tests__/SpatialCorpusValidation.test.ts +72 -0
- package/src/training/training/__tests__/SpatialTrainingDataGenerator.test.ts +1244 -0
- package/src/training/training/__tests__/TrainingMonkeyIntegration.test.ts +897 -0
- package/src/training/training/__tests__/TrainingPipelineConfig.test.ts +202 -0
- package/src/training/training/__tests__/schema.test.ts +72 -0
- package/src/training/training/__tests__/training-constants.test.ts +106 -0
- package/src/training/training/__tests__/trait-mappings.test.ts +81 -0
- package/src/training/training/constants.ts +94 -0
- package/src/training/training/index.ts +17 -0
- package/src/training/training/schema.ts +147 -0
- package/src/training/training/scripts/generate-novel-use-cases-dataset.ts +272 -0
- package/src/training/training/scripts/generate-spatial-dataset.ts +521 -0
- package/src/training/training/trainingmonkey/TrainingMonkeyIntegration.ts +477 -0
- package/src/training/training/trainingmonkey/TrainingMonkeyTypes.ts +230 -0
- package/src/training/training/trainingmonkey/index.ts +26 -0
- package/src/training/training/trait-mappings.ts +157 -0
- package/src/types.ts +2 -7
- package/ALL-test-results.json +0 -1
- package/LICENSE +0 -21
- package/dist/AgentManifest-CB4xM-Ma.d.ts +0 -704
- package/dist/BehaviorTree-BrBFECv5.d.ts +0 -103
- package/dist/InvisibleWallet-rtRrBOA8.d.ts +0 -1732
- package/dist/OrchestratorAgent-Q_CbVTmO.d.ts +0 -798
- package/dist/agents/index.d.ts +0 -1788
- package/dist/agents/index.js +0 -4695
- package/dist/ai/index.d.ts +0 -1753
- package/dist/ai/index.js +0 -5244
- package/dist/behavior.d.ts +0 -130
- package/dist/behavior.js +0 -407
- package/dist/economy/index.d.ts +0 -747
- package/dist/economy/index.js +0 -3617
- package/dist/implementations-D9T3un9D.d.ts +0 -236
- package/dist/index.d.ts +0 -1729
- package/dist/index.js +0 -24277
- package/dist/learning/index.d.ts +0 -104
- package/dist/learning/index.js +0 -189
- package/dist/negotiation/index.d.ts +0 -610
- package/dist/negotiation/index.js +0 -931
- package/dist/skills/index.d.ts +0 -289
- package/dist/skills/index.js +0 -1079
- package/dist/swarm/index.d.ts +0 -2433
- package/dist/swarm/index.js +0 -5221
- package/dist/training/index.d.ts +0 -1734
- package/dist/training/index.js +0 -2687
- package/extract-failures.js +0 -10
- package/src/training/training/data/novel-use-cases.jsonl +0 -153
- package/src/training/training/data/spatial-reasoning-10k.jsonl +0 -9354
- package/src/types/core-stubs.d.ts +0 -113
- package/test-output.txt +0 -0
- package/test-result.json +0 -1
- package/tsc-errors.txt +0 -4
- package/tsc_output.txt +0 -0
- package/typescript-errors-2.txt +0 -0
- package/typescript-errors.txt +0 -22
- package/vitest-log-utf8.txt +0 -268
- package/vitest-log.txt +0 -0
package/dist/ai/index.d.ts
DELETED
|
@@ -1,1753 +0,0 @@
|
|
|
1
|
-
import { HSPlusCompileResult } from '@holoscript/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @holoscript/core AI Adapter Interface
|
|
5
|
-
*
|
|
6
|
-
* Provider-agnostic AI integration for HoloScript.
|
|
7
|
-
* Users can implement this interface to integrate any AI service.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { AIAdapter, registerAIAdapter } from '@holoscript/core';
|
|
12
|
-
*
|
|
13
|
-
* // Implement your own adapter
|
|
14
|
-
* class MyOpenAIAdapter implements AIAdapter {
|
|
15
|
-
* async generateHoloScript(prompt: string) {
|
|
16
|
-
* const response = await openai.chat.completions.create({...});
|
|
17
|
-
* return { holoScript: response.choices[0].message.content };
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* // Register it
|
|
22
|
-
* registerAIAdapter(new MyOpenAIAdapter());
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Result of HoloScript generation from natural language
|
|
27
|
-
*/
|
|
28
|
-
interface GenerateResult {
|
|
29
|
-
/** Generated HoloScript code */
|
|
30
|
-
holoScript: string;
|
|
31
|
-
/** Confidence score (0-1) */
|
|
32
|
-
confidence?: number;
|
|
33
|
-
/** Estimated object count */
|
|
34
|
-
objectCount?: number;
|
|
35
|
-
/** Any warnings or suggestions */
|
|
36
|
-
warnings?: string[];
|
|
37
|
-
/** Provider-specific metadata */
|
|
38
|
-
metadata?: Record<string, unknown>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Result of HoloScript explanation
|
|
42
|
-
*/
|
|
43
|
-
interface ExplainResult {
|
|
44
|
-
/** Human-readable explanation */
|
|
45
|
-
explanation: string;
|
|
46
|
-
/** Line-by-line breakdown */
|
|
47
|
-
breakdown?: Array<{
|
|
48
|
-
line: number;
|
|
49
|
-
code: string;
|
|
50
|
-
description: string;
|
|
51
|
-
}>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Result of HoloScript optimization
|
|
55
|
-
*/
|
|
56
|
-
interface OptimizeResult {
|
|
57
|
-
/** Optimized HoloScript code */
|
|
58
|
-
holoScript: string;
|
|
59
|
-
/** What was improved */
|
|
60
|
-
improvements: string[];
|
|
61
|
-
/** Performance metrics comparison */
|
|
62
|
-
metrics?: {
|
|
63
|
-
before: {
|
|
64
|
-
polygons?: number;
|
|
65
|
-
nodes?: number;
|
|
66
|
-
};
|
|
67
|
-
after: {
|
|
68
|
-
polygons?: number;
|
|
69
|
-
nodes?: number;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Result of HoloScript validation/fixing
|
|
75
|
-
*/
|
|
76
|
-
interface FixResult {
|
|
77
|
-
/** Fixed HoloScript code */
|
|
78
|
-
holoScript: string;
|
|
79
|
-
/** Issues that were fixed */
|
|
80
|
-
fixes: Array<{
|
|
81
|
-
line: number;
|
|
82
|
-
issue: string;
|
|
83
|
-
fix: string;
|
|
84
|
-
}>;
|
|
85
|
-
/** Issues that couldn't be fixed automatically */
|
|
86
|
-
remaining?: string[];
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Generation options
|
|
90
|
-
*/
|
|
91
|
-
interface GenerateOptions {
|
|
92
|
-
/** Style hint: modern, classic, minimal, realistic */
|
|
93
|
-
style?: 'modern' | 'classic' | 'minimal' | 'realistic';
|
|
94
|
-
/** Complexity level */
|
|
95
|
-
complexity?: 'low' | 'medium' | 'high';
|
|
96
|
-
/** Include physics simulation */
|
|
97
|
-
includePhysics?: boolean;
|
|
98
|
-
/** Target platform for optimization */
|
|
99
|
-
targetPlatform?: 'mobile' | 'desktop' | 'vr' | 'ar';
|
|
100
|
-
/** Maximum tokens/length */
|
|
101
|
-
maxTokens?: number;
|
|
102
|
-
/** Temperature for generation (0-1) */
|
|
103
|
-
temperature?: number;
|
|
104
|
-
/** Additional context about the world */
|
|
105
|
-
context?: string;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* AI Adapter Interface
|
|
109
|
-
*
|
|
110
|
-
* Implement this interface to integrate any AI provider with HoloScript.
|
|
111
|
-
* All methods are optional - implement only what your provider supports.
|
|
112
|
-
*/
|
|
113
|
-
interface AIAdapter {
|
|
114
|
-
/** Unique identifier for this adapter */
|
|
115
|
-
readonly id: string;
|
|
116
|
-
/** Human-readable name */
|
|
117
|
-
readonly name: string;
|
|
118
|
-
/** Whether the adapter is ready to use */
|
|
119
|
-
isReady(): boolean | Promise<boolean>;
|
|
120
|
-
/**
|
|
121
|
-
* Generate HoloScript from natural language
|
|
122
|
-
* @param prompt User's natural language description
|
|
123
|
-
* @param options Generation options
|
|
124
|
-
*/
|
|
125
|
-
generateHoloScript?(prompt: string, options?: GenerateOptions): Promise<GenerateResult>;
|
|
126
|
-
/**
|
|
127
|
-
* Explain what HoloScript code does
|
|
128
|
-
* @param holoScript The code to explain
|
|
129
|
-
*/
|
|
130
|
-
explainHoloScript?(holoScript: string): Promise<ExplainResult>;
|
|
131
|
-
/**
|
|
132
|
-
* Optimize HoloScript for a target platform
|
|
133
|
-
* @param holoScript The code to optimize
|
|
134
|
-
* @param target Target platform
|
|
135
|
-
*/
|
|
136
|
-
optimizeHoloScript?(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
137
|
-
/**
|
|
138
|
-
* Fix errors in HoloScript code
|
|
139
|
-
* @param holoScript The code to fix
|
|
140
|
-
* @param errors Error messages from parser/validator
|
|
141
|
-
*/
|
|
142
|
-
fixHoloScript?(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
143
|
-
/**
|
|
144
|
-
* Complete HoloScript code (autocomplete)
|
|
145
|
-
* @param holoScript Partial code
|
|
146
|
-
* @param cursorPosition Position of cursor
|
|
147
|
-
*/
|
|
148
|
-
completeHoloScript?(holoScript: string, cursorPosition: number): Promise<string[]>;
|
|
149
|
-
/**
|
|
150
|
-
* Chat with AI about HoloScript code
|
|
151
|
-
* @param message User message
|
|
152
|
-
* @param holoScript Current code context
|
|
153
|
-
* @param history Previous messages
|
|
154
|
-
*/
|
|
155
|
-
chat?(message: string, holoScript?: string, history?: Array<{
|
|
156
|
-
role: 'user' | 'assistant';
|
|
157
|
-
content: string;
|
|
158
|
-
}>): Promise<string>;
|
|
159
|
-
/**
|
|
160
|
-
* Get vector embeddings for text
|
|
161
|
-
* @param text Text to embed
|
|
162
|
-
*/
|
|
163
|
-
getEmbeddings?(text: string | string[]): Promise<number[][]>;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Register an AI adapter
|
|
167
|
-
* @param adapter The adapter to register
|
|
168
|
-
* @param setAsDefault Whether to set as the default adapter
|
|
169
|
-
*/
|
|
170
|
-
declare function registerAIAdapter(adapter: AIAdapter, setAsDefault?: boolean): void;
|
|
171
|
-
/**
|
|
172
|
-
* Get an AI adapter by ID
|
|
173
|
-
* @param id Adapter ID
|
|
174
|
-
*/
|
|
175
|
-
declare function getAIAdapter(id: string): AIAdapter | undefined;
|
|
176
|
-
/**
|
|
177
|
-
* Get the default AI adapter
|
|
178
|
-
*/
|
|
179
|
-
declare function getDefaultAIAdapter(): AIAdapter | null;
|
|
180
|
-
/**
|
|
181
|
-
* Set the default AI adapter
|
|
182
|
-
* @param id Adapter ID
|
|
183
|
-
*/
|
|
184
|
-
declare function setDefaultAIAdapter(id: string): boolean;
|
|
185
|
-
/**
|
|
186
|
-
* List all registered adapters
|
|
187
|
-
*/
|
|
188
|
-
declare function listAIAdapters(): Array<{
|
|
189
|
-
id: string;
|
|
190
|
-
name: string;
|
|
191
|
-
}>;
|
|
192
|
-
/**
|
|
193
|
-
* Unregister an AI adapter
|
|
194
|
-
* @param id Adapter ID
|
|
195
|
-
*/
|
|
196
|
-
declare function unregisterAIAdapter(id: string): boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Generate HoloScript from natural language using the default adapter
|
|
199
|
-
*/
|
|
200
|
-
declare function generateHoloScript$1(prompt: string, options?: GenerateOptions): Promise<GenerateResult>;
|
|
201
|
-
/**
|
|
202
|
-
* Explain HoloScript code using the default adapter
|
|
203
|
-
*/
|
|
204
|
-
declare function explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
205
|
-
/**
|
|
206
|
-
* Optimize HoloScript using the default adapter
|
|
207
|
-
*/
|
|
208
|
-
declare function optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
209
|
-
/**
|
|
210
|
-
* Fix HoloScript errors using the default adapter
|
|
211
|
-
*/
|
|
212
|
-
declare function fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* @holoscript/core - Built-in AI Adapters
|
|
216
|
-
*
|
|
217
|
-
* Ready-to-use adapters for popular AI providers.
|
|
218
|
-
* Users just need to provide their API key.
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
interface OpenAIAdapterConfig {
|
|
222
|
-
apiKey: string;
|
|
223
|
-
model?: string;
|
|
224
|
-
baseUrl?: string;
|
|
225
|
-
organization?: string;
|
|
226
|
-
}
|
|
227
|
-
declare class OpenAIAdapter implements AIAdapter {
|
|
228
|
-
readonly id = "openai";
|
|
229
|
-
readonly name = "OpenAI";
|
|
230
|
-
private config;
|
|
231
|
-
private model;
|
|
232
|
-
constructor(config: OpenAIAdapterConfig);
|
|
233
|
-
isReady(): boolean;
|
|
234
|
-
generateHoloScript(prompt: string, options?: GenerateOptions): Promise<GenerateResult>;
|
|
235
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
236
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
237
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
238
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
239
|
-
role: 'user' | 'assistant';
|
|
240
|
-
content: string;
|
|
241
|
-
}>): Promise<string>;
|
|
242
|
-
private buildSystemPrompt;
|
|
243
|
-
private extractCode;
|
|
244
|
-
private callAPI;
|
|
245
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
246
|
-
}
|
|
247
|
-
interface AnthropicAdapterConfig {
|
|
248
|
-
apiKey: string;
|
|
249
|
-
model?: string;
|
|
250
|
-
}
|
|
251
|
-
declare class AnthropicAdapter implements AIAdapter {
|
|
252
|
-
readonly id = "anthropic";
|
|
253
|
-
readonly name = "Anthropic Claude";
|
|
254
|
-
private config;
|
|
255
|
-
private model;
|
|
256
|
-
constructor(config: AnthropicAdapterConfig);
|
|
257
|
-
isReady(): boolean;
|
|
258
|
-
generateHoloScript(prompt: string, options?: GenerateOptions): Promise<GenerateResult>;
|
|
259
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
260
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
261
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
262
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
263
|
-
role: 'user' | 'assistant';
|
|
264
|
-
content: string;
|
|
265
|
-
}>): Promise<string>;
|
|
266
|
-
private extractCode;
|
|
267
|
-
private callAPI;
|
|
268
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
269
|
-
}
|
|
270
|
-
interface OllamaAdapterConfig {
|
|
271
|
-
baseUrl?: string;
|
|
272
|
-
model?: string;
|
|
273
|
-
}
|
|
274
|
-
declare class OllamaAdapter implements AIAdapter {
|
|
275
|
-
readonly id = "ollama";
|
|
276
|
-
readonly name = "Ollama (Local)";
|
|
277
|
-
private baseUrl;
|
|
278
|
-
private model;
|
|
279
|
-
constructor(config?: OllamaAdapterConfig);
|
|
280
|
-
isReady(): Promise<boolean>;
|
|
281
|
-
generateHoloScript(prompt: string, _options?: GenerateOptions): Promise<GenerateResult>;
|
|
282
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
283
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
284
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
285
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
286
|
-
role: 'user' | 'assistant';
|
|
287
|
-
content: string;
|
|
288
|
-
}>): Promise<string>;
|
|
289
|
-
private callAPIWithErrorHandling;
|
|
290
|
-
private extractCode;
|
|
291
|
-
private callAPI;
|
|
292
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
293
|
-
}
|
|
294
|
-
interface LMStudioAdapterConfig {
|
|
295
|
-
baseUrl?: string;
|
|
296
|
-
model?: string;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* LM Studio adapter - uses OpenAI-compatible API running locally
|
|
300
|
-
*/
|
|
301
|
-
declare class LMStudioAdapter implements AIAdapter {
|
|
302
|
-
readonly id = "lmstudio";
|
|
303
|
-
readonly name = "LM Studio (Local)";
|
|
304
|
-
private openaiAdapter;
|
|
305
|
-
constructor(config?: LMStudioAdapterConfig);
|
|
306
|
-
isReady(): boolean;
|
|
307
|
-
generateHoloScript(prompt: string, options?: GenerateOptions): Promise<GenerateResult>;
|
|
308
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
309
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
310
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
311
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
312
|
-
role: 'user' | 'assistant';
|
|
313
|
-
content: string;
|
|
314
|
-
}>): Promise<string>;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Create and register an OpenAI adapter
|
|
318
|
-
*/
|
|
319
|
-
declare function useOpenAI(config: OpenAIAdapterConfig): OpenAIAdapter;
|
|
320
|
-
/**
|
|
321
|
-
* Create and register an Anthropic adapter
|
|
322
|
-
*/
|
|
323
|
-
declare function useAnthropic(config: AnthropicAdapterConfig): AnthropicAdapter;
|
|
324
|
-
/**
|
|
325
|
-
* Create and register an Ollama adapter (local)
|
|
326
|
-
*/
|
|
327
|
-
declare function useOllama(config?: OllamaAdapterConfig): OllamaAdapter;
|
|
328
|
-
/**
|
|
329
|
-
* Create and register an LM Studio adapter (local)
|
|
330
|
-
*/
|
|
331
|
-
declare function useLMStudio(config?: LMStudioAdapterConfig): LMStudioAdapter;
|
|
332
|
-
interface GeminiAdapterConfig {
|
|
333
|
-
apiKey: string;
|
|
334
|
-
model?: string;
|
|
335
|
-
/** Embedding model (default: text-embedding-004) */
|
|
336
|
-
embeddingModel?: string;
|
|
337
|
-
}
|
|
338
|
-
declare class GeminiAdapter implements AIAdapter {
|
|
339
|
-
readonly id = "gemini";
|
|
340
|
-
readonly name = "Google Gemini";
|
|
341
|
-
private config;
|
|
342
|
-
private model;
|
|
343
|
-
private embeddingModel;
|
|
344
|
-
constructor(config: GeminiAdapterConfig);
|
|
345
|
-
isReady(): boolean;
|
|
346
|
-
generateHoloScript(prompt: string, options?: GenerateOptions): Promise<GenerateResult>;
|
|
347
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
348
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
349
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
350
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
351
|
-
role: 'user' | 'assistant';
|
|
352
|
-
content: string;
|
|
353
|
-
}>): Promise<string>;
|
|
354
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
355
|
-
private extractCode;
|
|
356
|
-
private callAPI;
|
|
357
|
-
}
|
|
358
|
-
interface XAIAdapterConfig {
|
|
359
|
-
apiKey: string;
|
|
360
|
-
model?: string;
|
|
361
|
-
}
|
|
362
|
-
declare class XAIAdapter implements AIAdapter {
|
|
363
|
-
readonly id = "xai";
|
|
364
|
-
readonly name = "xAI Grok";
|
|
365
|
-
private config;
|
|
366
|
-
private model;
|
|
367
|
-
constructor(config: XAIAdapterConfig);
|
|
368
|
-
isReady(): boolean;
|
|
369
|
-
generateHoloScript(prompt: string, _options?: GenerateOptions): Promise<GenerateResult>;
|
|
370
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
371
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
372
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
373
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
374
|
-
role: 'user' | 'assistant';
|
|
375
|
-
content: string;
|
|
376
|
-
}>): Promise<string>;
|
|
377
|
-
private extractCode;
|
|
378
|
-
private callAPI;
|
|
379
|
-
}
|
|
380
|
-
interface TogetherAdapterConfig {
|
|
381
|
-
apiKey: string;
|
|
382
|
-
model?: string;
|
|
383
|
-
}
|
|
384
|
-
declare class TogetherAdapter implements AIAdapter {
|
|
385
|
-
readonly id = "together";
|
|
386
|
-
readonly name = "Together AI";
|
|
387
|
-
private config;
|
|
388
|
-
private model;
|
|
389
|
-
constructor(config: TogetherAdapterConfig);
|
|
390
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
391
|
-
isReady(): boolean;
|
|
392
|
-
generateHoloScript(prompt: string, _options?: GenerateOptions): Promise<GenerateResult>;
|
|
393
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
394
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
395
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
396
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
397
|
-
role: 'user' | 'assistant';
|
|
398
|
-
content: string;
|
|
399
|
-
}>): Promise<string>;
|
|
400
|
-
private extractCode;
|
|
401
|
-
private callAPI;
|
|
402
|
-
}
|
|
403
|
-
interface FireworksAdapterConfig {
|
|
404
|
-
apiKey: string;
|
|
405
|
-
model?: string;
|
|
406
|
-
}
|
|
407
|
-
declare class FireworksAdapter implements AIAdapter {
|
|
408
|
-
readonly id = "fireworks";
|
|
409
|
-
readonly name = "Fireworks AI";
|
|
410
|
-
private config;
|
|
411
|
-
private model;
|
|
412
|
-
constructor(config: FireworksAdapterConfig);
|
|
413
|
-
isReady(): boolean;
|
|
414
|
-
generateHoloScript(prompt: string, _options?: GenerateOptions): Promise<GenerateResult>;
|
|
415
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
416
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
417
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
418
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
419
|
-
role: 'user' | 'assistant';
|
|
420
|
-
content: string;
|
|
421
|
-
}>): Promise<string>;
|
|
422
|
-
private extractCode;
|
|
423
|
-
private callAPI;
|
|
424
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
425
|
-
}
|
|
426
|
-
interface NVIDIAAdapterConfig {
|
|
427
|
-
apiKey: string;
|
|
428
|
-
model?: string;
|
|
429
|
-
baseUrl?: string;
|
|
430
|
-
}
|
|
431
|
-
declare class NVIDIAAdapter implements AIAdapter {
|
|
432
|
-
readonly id = "nvidia";
|
|
433
|
-
readonly name = "NVIDIA NIM";
|
|
434
|
-
private config;
|
|
435
|
-
private model;
|
|
436
|
-
private baseUrl;
|
|
437
|
-
constructor(config: NVIDIAAdapterConfig);
|
|
438
|
-
isReady(): boolean;
|
|
439
|
-
generateHoloScript(prompt: string, _options?: GenerateOptions): Promise<GenerateResult>;
|
|
440
|
-
explainHoloScript(holoScript: string): Promise<ExplainResult>;
|
|
441
|
-
optimizeHoloScript(holoScript: string, target: 'mobile' | 'desktop' | 'vr' | 'ar'): Promise<OptimizeResult>;
|
|
442
|
-
fixHoloScript(holoScript: string, errors: string[]): Promise<FixResult>;
|
|
443
|
-
chat(message: string, holoScript?: string, history?: Array<{
|
|
444
|
-
role: 'user' | 'assistant';
|
|
445
|
-
content: string;
|
|
446
|
-
}>): Promise<string>;
|
|
447
|
-
private extractCode;
|
|
448
|
-
private callAPI;
|
|
449
|
-
getEmbeddings(text: string | string[]): Promise<number[][]>;
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Create and register a Gemini adapter
|
|
453
|
-
*/
|
|
454
|
-
declare function useGemini(config: GeminiAdapterConfig): GeminiAdapter;
|
|
455
|
-
/**
|
|
456
|
-
* Create and register an xAI (Grok) adapter
|
|
457
|
-
*/
|
|
458
|
-
declare function useXAI(config: XAIAdapterConfig): XAIAdapter;
|
|
459
|
-
/** Alias for useXAI */
|
|
460
|
-
declare const useGrok: typeof useXAI;
|
|
461
|
-
/**
|
|
462
|
-
* Create and register a Together AI adapter
|
|
463
|
-
*/
|
|
464
|
-
declare function useTogether(config: TogetherAdapterConfig): TogetherAdapter;
|
|
465
|
-
/**
|
|
466
|
-
* Create and register a Fireworks AI adapter
|
|
467
|
-
*/
|
|
468
|
-
declare function useFireworks(config: FireworksAdapterConfig): FireworksAdapter;
|
|
469
|
-
/**
|
|
470
|
-
* Create and register an NVIDIA NIM adapter
|
|
471
|
-
*/
|
|
472
|
-
declare function useNVIDIA(config: NVIDIAAdapterConfig): NVIDIAAdapter;
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* SemanticSearchService
|
|
476
|
-
*
|
|
477
|
-
* Provides vector-based search for HoloScript traits.
|
|
478
|
-
*/
|
|
479
|
-
|
|
480
|
-
interface SearchResult<T> {
|
|
481
|
-
item: T;
|
|
482
|
-
score: number;
|
|
483
|
-
}
|
|
484
|
-
declare class SemanticSearchService<T extends {
|
|
485
|
-
name: string;
|
|
486
|
-
description: string;
|
|
487
|
-
}> {
|
|
488
|
-
private adapter;
|
|
489
|
-
private items;
|
|
490
|
-
private embeddings;
|
|
491
|
-
constructor(adapter: AIAdapter, items: T[]);
|
|
492
|
-
/**
|
|
493
|
-
* Pre-calculate embeddings for all items
|
|
494
|
-
*/
|
|
495
|
-
initialize(): Promise<void>;
|
|
496
|
-
/**
|
|
497
|
-
* Search for items similar to the query
|
|
498
|
-
*/
|
|
499
|
-
search(query: string, limit?: number): Promise<SearchResult<T>[]>;
|
|
500
|
-
/**
|
|
501
|
-
* Calculate cosine similarity between two vectors
|
|
502
|
-
*/
|
|
503
|
-
private cosineSimilarity;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* BTNodes.ts
|
|
508
|
-
*
|
|
509
|
-
* Behavior tree node types: composite (sequence, selector, parallel),
|
|
510
|
-
* decorator (inverter, repeater, guard), leaf (action, condition, wait).
|
|
511
|
-
*
|
|
512
|
-
* @module ai
|
|
513
|
-
*/
|
|
514
|
-
type BTStatus = 'success' | 'failure' | 'running' | 'ready';
|
|
515
|
-
interface BTContext$1 {
|
|
516
|
-
blackboard: {
|
|
517
|
-
get: (key: string) => unknown;
|
|
518
|
-
set: (key: string, value: unknown) => void;
|
|
519
|
-
};
|
|
520
|
-
deltaTime: number;
|
|
521
|
-
entity: string;
|
|
522
|
-
}
|
|
523
|
-
declare abstract class BTNode {
|
|
524
|
-
name: string;
|
|
525
|
-
status: BTStatus;
|
|
526
|
-
children: BTNode[];
|
|
527
|
-
constructor(name: string);
|
|
528
|
-
abstract tick(ctx: BTContext$1): BTStatus;
|
|
529
|
-
reset(): void;
|
|
530
|
-
}
|
|
531
|
-
declare class SequenceNode extends BTNode {
|
|
532
|
-
private currentIndex;
|
|
533
|
-
constructor(name: string, children: BTNode[]);
|
|
534
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
535
|
-
reset(): void;
|
|
536
|
-
}
|
|
537
|
-
declare class SelectorNode extends BTNode {
|
|
538
|
-
private currentIndex;
|
|
539
|
-
constructor(name: string, children: BTNode[]);
|
|
540
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
541
|
-
reset(): void;
|
|
542
|
-
}
|
|
543
|
-
declare class ParallelNode extends BTNode {
|
|
544
|
-
private requiredSuccesses;
|
|
545
|
-
constructor(name: string, children: BTNode[], requiredSuccesses?: number);
|
|
546
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
547
|
-
}
|
|
548
|
-
declare class InverterNode extends BTNode {
|
|
549
|
-
constructor(name: string, child: BTNode);
|
|
550
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
551
|
-
}
|
|
552
|
-
declare class RepeaterNode extends BTNode {
|
|
553
|
-
private maxRepeats;
|
|
554
|
-
private count;
|
|
555
|
-
constructor(name: string, child: BTNode, repeats?: number);
|
|
556
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
557
|
-
reset(): void;
|
|
558
|
-
}
|
|
559
|
-
declare class GuardNode extends BTNode {
|
|
560
|
-
private condition;
|
|
561
|
-
constructor(name: string, condition: (ctx: BTContext$1) => boolean, child: BTNode);
|
|
562
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
563
|
-
}
|
|
564
|
-
declare class ActionNode extends BTNode {
|
|
565
|
-
private action;
|
|
566
|
-
constructor(name: string, action: (ctx: BTContext$1) => BTStatus);
|
|
567
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
568
|
-
}
|
|
569
|
-
declare class ConditionNode extends BTNode {
|
|
570
|
-
private condition;
|
|
571
|
-
constructor(name: string, condition: (ctx: BTContext$1) => boolean);
|
|
572
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
573
|
-
}
|
|
574
|
-
declare class WaitNode extends BTNode {
|
|
575
|
-
private duration;
|
|
576
|
-
private elapsed;
|
|
577
|
-
constructor(name: string, seconds: number);
|
|
578
|
-
tick(ctx: BTContext$1): BTStatus;
|
|
579
|
-
reset(): void;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
declare class Blackboard {
|
|
583
|
-
private data;
|
|
584
|
-
private observers;
|
|
585
|
-
private scopes;
|
|
586
|
-
private history;
|
|
587
|
-
private maxHistory;
|
|
588
|
-
set(key: string, value: unknown, scope?: string): void;
|
|
589
|
-
get<T = unknown>(key: string): T | undefined;
|
|
590
|
-
has(key: string): boolean;
|
|
591
|
-
delete(key: string): boolean;
|
|
592
|
-
getByScope(scope: string): Map<string, unknown>;
|
|
593
|
-
clearScope(scope: string): number;
|
|
594
|
-
getScopes(): string[];
|
|
595
|
-
observe(key: string, callback: (key: string, value: unknown, old: unknown) => void): void;
|
|
596
|
-
observeAll(callback: (key: string, value: unknown, old: unknown) => void): void;
|
|
597
|
-
private notifyObservers;
|
|
598
|
-
getEntryCount(): number;
|
|
599
|
-
getKeys(): string[];
|
|
600
|
-
getVersion(key: string): number;
|
|
601
|
-
getHistory(): typeof this.history;
|
|
602
|
-
clear(): void;
|
|
603
|
-
toJSON(): Record<string, unknown>;
|
|
604
|
-
fromJSON(data: Record<string, unknown>, scope?: string): void;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* BehaviorTree.ts
|
|
609
|
-
*
|
|
610
|
-
* Behavior tree runner: tick-based evaluation, status propagation,
|
|
611
|
-
* subtree mounting, conditional abort, and debug tracing.
|
|
612
|
-
*
|
|
613
|
-
* @module ai
|
|
614
|
-
*/
|
|
615
|
-
|
|
616
|
-
interface BTContext {
|
|
617
|
-
blackboard: Blackboard;
|
|
618
|
-
deltaTime: number;
|
|
619
|
-
entity: string;
|
|
620
|
-
}
|
|
621
|
-
interface BTTreeDef {
|
|
622
|
-
id: string;
|
|
623
|
-
root: BTNode;
|
|
624
|
-
context: BTContext;
|
|
625
|
-
status: BTStatus;
|
|
626
|
-
tickCount: number;
|
|
627
|
-
aborted: boolean;
|
|
628
|
-
}
|
|
629
|
-
declare class BehaviorTree {
|
|
630
|
-
private trees;
|
|
631
|
-
private subtrees;
|
|
632
|
-
private debugTrace;
|
|
633
|
-
private tracing;
|
|
634
|
-
createTree(id: string, root: BTNode, entity: string, blackboard?: Blackboard): BTTreeDef;
|
|
635
|
-
removeTree(id: string): boolean;
|
|
636
|
-
getTree(id: string): BTTreeDef | undefined;
|
|
637
|
-
registerSubtree(name: string, root: BTNode): void;
|
|
638
|
-
getSubtree(name: string): BTNode | undefined;
|
|
639
|
-
tick(id: string, dt: number): BTStatus;
|
|
640
|
-
tickAll(dt: number): void;
|
|
641
|
-
private tickNode;
|
|
642
|
-
abort(id: string): void;
|
|
643
|
-
enableTracing(): void;
|
|
644
|
-
disableTracing(): void;
|
|
645
|
-
getTrace(): typeof this.debugTrace;
|
|
646
|
-
clearTrace(): void;
|
|
647
|
-
getTreeCount(): number;
|
|
648
|
-
getStatus(id: string): BTStatus;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* StateMachine.ts
|
|
653
|
-
*
|
|
654
|
-
* Hierarchical state machine: states with enter/exit/update hooks,
|
|
655
|
-
* transitions with guards, sub-state machines, and event dispatch.
|
|
656
|
-
*
|
|
657
|
-
* @module ai
|
|
658
|
-
*/
|
|
659
|
-
type StateAction = (context: Record<string, unknown>) => void;
|
|
660
|
-
type GuardFn = (context: Record<string, unknown>) => boolean;
|
|
661
|
-
interface StateConfig {
|
|
662
|
-
id: string;
|
|
663
|
-
onEnter?: StateAction;
|
|
664
|
-
onExit?: StateAction;
|
|
665
|
-
onUpdate?: StateAction;
|
|
666
|
-
parent?: string;
|
|
667
|
-
}
|
|
668
|
-
interface TransitionConfig {
|
|
669
|
-
from: string;
|
|
670
|
-
to: string;
|
|
671
|
-
event: string;
|
|
672
|
-
guard?: GuardFn;
|
|
673
|
-
action?: StateAction;
|
|
674
|
-
}
|
|
675
|
-
declare class StateMachine {
|
|
676
|
-
private states;
|
|
677
|
-
private transitions;
|
|
678
|
-
private currentStateId;
|
|
679
|
-
private context;
|
|
680
|
-
private history;
|
|
681
|
-
private maxHistory;
|
|
682
|
-
addState(config: StateConfig): void;
|
|
683
|
-
removeState(id: string): void;
|
|
684
|
-
setInitialState(id: string): void;
|
|
685
|
-
getCurrentState(): string | null;
|
|
686
|
-
addTransition(config: TransitionConfig): void;
|
|
687
|
-
send(event: string): boolean;
|
|
688
|
-
private getTransitionsFor;
|
|
689
|
-
private getStateChain;
|
|
690
|
-
update(): void;
|
|
691
|
-
setContext(key: string, value: unknown): void;
|
|
692
|
-
getContext(key: string): unknown;
|
|
693
|
-
getStateCount(): number;
|
|
694
|
-
getHistory(): string[];
|
|
695
|
-
isInState(id: string): boolean;
|
|
696
|
-
getChildStates(parentId: string): string[];
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* SteeringBehavior — Seek/flee/arrive/wander/avoid with weighted blending
|
|
701
|
-
*
|
|
702
|
-
* @version 1.0.0
|
|
703
|
-
*/
|
|
704
|
-
interface Vec2 {
|
|
705
|
-
x: number;
|
|
706
|
-
z: number;
|
|
707
|
-
}
|
|
708
|
-
type SteeringType = 'seek' | 'flee' | 'arrive' | 'wander' | 'avoid' | 'pursue' | 'evade';
|
|
709
|
-
interface SteeringAgent$1 {
|
|
710
|
-
position: Vec2;
|
|
711
|
-
velocity: Vec2;
|
|
712
|
-
maxSpeed: number;
|
|
713
|
-
maxForce: number;
|
|
714
|
-
mass: number;
|
|
715
|
-
}
|
|
716
|
-
interface SteeringOutput {
|
|
717
|
-
force: Vec2;
|
|
718
|
-
type: SteeringType;
|
|
719
|
-
weight: number;
|
|
720
|
-
}
|
|
721
|
-
declare class SteeringBehavior {
|
|
722
|
-
/**
|
|
723
|
-
* Seek — steer toward a target
|
|
724
|
-
*/
|
|
725
|
-
static seek(agent: SteeringAgent$1, target: Vec2): Vec2;
|
|
726
|
-
/**
|
|
727
|
-
* Flee — steer away from a target
|
|
728
|
-
*/
|
|
729
|
-
static flee(agent: SteeringAgent$1, target: Vec2): Vec2;
|
|
730
|
-
/**
|
|
731
|
-
* Arrive — seek with deceleration near target
|
|
732
|
-
*/
|
|
733
|
-
static arrive(agent: SteeringAgent$1, target: Vec2, slowRadius?: number): Vec2;
|
|
734
|
-
/**
|
|
735
|
-
* Wander — random jitter-based steering
|
|
736
|
-
*/
|
|
737
|
-
static wander(agent: SteeringAgent$1, wanderRadius?: number, wanderDistance?: number, jitter?: number): Vec2;
|
|
738
|
-
/**
|
|
739
|
-
* Obstacle avoidance
|
|
740
|
-
*/
|
|
741
|
-
static avoid(agent: SteeringAgent$1, obstacles: {
|
|
742
|
-
position: Vec2;
|
|
743
|
-
radius: number;
|
|
744
|
-
}[], lookAhead?: number): Vec2;
|
|
745
|
-
/**
|
|
746
|
-
* Blend multiple steering outputs by weight
|
|
747
|
-
*/
|
|
748
|
-
static blend(outputs: SteeringOutput[], maxForce: number): Vec2;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
/**
|
|
752
|
-
* SteeringBehaviors.ts
|
|
753
|
-
*
|
|
754
|
-
* Autonomous agent steering: seek, flee, arrive, wander,
|
|
755
|
-
* flock (separation/alignment/cohesion), and obstacle avoidance.
|
|
756
|
-
*
|
|
757
|
-
* @module ai
|
|
758
|
-
*/
|
|
759
|
-
interface SteeringAgent {
|
|
760
|
-
position: {
|
|
761
|
-
x: number;
|
|
762
|
-
y: number;
|
|
763
|
-
z: number;
|
|
764
|
-
};
|
|
765
|
-
velocity: {
|
|
766
|
-
x: number;
|
|
767
|
-
y: number;
|
|
768
|
-
z: number;
|
|
769
|
-
};
|
|
770
|
-
maxSpeed: number;
|
|
771
|
-
maxForce: number;
|
|
772
|
-
mass: number;
|
|
773
|
-
}
|
|
774
|
-
interface FlockConfig {
|
|
775
|
-
separationWeight: number;
|
|
776
|
-
alignmentWeight: number;
|
|
777
|
-
cohesionWeight: number;
|
|
778
|
-
neighborRadius: number;
|
|
779
|
-
}
|
|
780
|
-
interface ObstacleCircle {
|
|
781
|
-
center: {
|
|
782
|
-
x: number;
|
|
783
|
-
y: number;
|
|
784
|
-
z: number;
|
|
785
|
-
};
|
|
786
|
-
radius: number;
|
|
787
|
-
}
|
|
788
|
-
type Vec3 = {
|
|
789
|
-
x: number;
|
|
790
|
-
y: number;
|
|
791
|
-
z: number;
|
|
792
|
-
};
|
|
793
|
-
declare class SteeringBehaviors {
|
|
794
|
-
static seek(agent: SteeringAgent, target: Vec3): Vec3;
|
|
795
|
-
static flee(agent: SteeringAgent, threat: Vec3): Vec3;
|
|
796
|
-
static arrive(agent: SteeringAgent, target: Vec3, slowRadius: number): Vec3;
|
|
797
|
-
static wander(agent: SteeringAgent, circleDistance: number, circleRadius: number, angleJitter: number, currentAngle: number): {
|
|
798
|
-
force: Vec3;
|
|
799
|
-
newAngle: number;
|
|
800
|
-
};
|
|
801
|
-
static flock(agent: SteeringAgent, neighbors: SteeringAgent[], config: FlockConfig): Vec3;
|
|
802
|
-
private static separation;
|
|
803
|
-
private static alignment;
|
|
804
|
-
private static cohesion;
|
|
805
|
-
static obstacleAvoidance(agent: SteeringAgent, obstacles: ObstacleCircle[], lookAhead: number): Vec3;
|
|
806
|
-
static applyForce(agent: SteeringAgent, force: Vec3, dt: number): void;
|
|
807
|
-
private static sub;
|
|
808
|
-
private static add;
|
|
809
|
-
private static scale;
|
|
810
|
-
private static vecLength;
|
|
811
|
-
private static distance;
|
|
812
|
-
private static normalize;
|
|
813
|
-
private static truncate;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
/**
|
|
817
|
-
* NavMesh — Navigation mesh with polygon walk and path smoothing
|
|
818
|
-
*
|
|
819
|
-
* @version 1.0.0
|
|
820
|
-
*/
|
|
821
|
-
interface NavPolygon {
|
|
822
|
-
id: number;
|
|
823
|
-
vertices: {
|
|
824
|
-
x: number;
|
|
825
|
-
z: number;
|
|
826
|
-
}[];
|
|
827
|
-
neighbors: number[];
|
|
828
|
-
center: {
|
|
829
|
-
x: number;
|
|
830
|
-
z: number;
|
|
831
|
-
};
|
|
832
|
-
walkable: boolean;
|
|
833
|
-
cost: number;
|
|
834
|
-
}
|
|
835
|
-
interface NavPath {
|
|
836
|
-
waypoints: {
|
|
837
|
-
x: number;
|
|
838
|
-
z: number;
|
|
839
|
-
}[];
|
|
840
|
-
totalCost: number;
|
|
841
|
-
polygonIds: number[];
|
|
842
|
-
}
|
|
843
|
-
declare class NavMesh {
|
|
844
|
-
private polygons;
|
|
845
|
-
private nextId;
|
|
846
|
-
/**
|
|
847
|
-
* Add a navigation polygon
|
|
848
|
-
*/
|
|
849
|
-
addPolygon(vertices: {
|
|
850
|
-
x: number;
|
|
851
|
-
z: number;
|
|
852
|
-
}[], walkable?: boolean, cost?: number): number;
|
|
853
|
-
/**
|
|
854
|
-
* Connect two polygons as neighbors
|
|
855
|
-
*/
|
|
856
|
-
connect(a: number, b: number): boolean;
|
|
857
|
-
/**
|
|
858
|
-
* Find path using A*
|
|
859
|
-
*/
|
|
860
|
-
findPath(startPoly: number, endPoly: number): NavPath | null;
|
|
861
|
-
/**
|
|
862
|
-
* Smooth a path using string-pulling (funnel algorithm simplified)
|
|
863
|
-
*/
|
|
864
|
-
smoothPath(path: NavPath): NavPath;
|
|
865
|
-
private reconstructPath;
|
|
866
|
-
private heuristic;
|
|
867
|
-
getPolygon(id: number): NavPolygon | undefined;
|
|
868
|
-
getPolygonCount(): number;
|
|
869
|
-
setWalkable(id: number, walkable: boolean): void;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
/**
|
|
873
|
-
* PerceptionSystem.ts
|
|
874
|
-
*
|
|
875
|
-
* AI perception: sight/hearing/smell sense cones, stimulus memory,
|
|
876
|
-
* priority scoring, and detection events.
|
|
877
|
-
*
|
|
878
|
-
* @module ai
|
|
879
|
-
*/
|
|
880
|
-
type SenseType = 'sight' | 'hearing' | 'smell';
|
|
881
|
-
interface Stimulus {
|
|
882
|
-
id: string;
|
|
883
|
-
type: SenseType;
|
|
884
|
-
sourceId: string;
|
|
885
|
-
position: {
|
|
886
|
-
x: number;
|
|
887
|
-
y: number;
|
|
888
|
-
z: number;
|
|
889
|
-
};
|
|
890
|
-
intensity: number;
|
|
891
|
-
timestamp: number;
|
|
892
|
-
data?: unknown;
|
|
893
|
-
}
|
|
894
|
-
interface SenseConfig {
|
|
895
|
-
type: SenseType;
|
|
896
|
-
range: number;
|
|
897
|
-
fov: number;
|
|
898
|
-
sensitivity: number;
|
|
899
|
-
}
|
|
900
|
-
interface PerceivedStimulus extends Stimulus {
|
|
901
|
-
awareness: number;
|
|
902
|
-
lastSeen: number;
|
|
903
|
-
}
|
|
904
|
-
declare class PerceptionSystem {
|
|
905
|
-
private entities;
|
|
906
|
-
private stimuli;
|
|
907
|
-
registerEntity(id: string, senses: SenseConfig[], memoryDuration?: number): void;
|
|
908
|
-
setEntityTransform(entityId: string, position: {
|
|
909
|
-
x: number;
|
|
910
|
-
y: number;
|
|
911
|
-
z: number;
|
|
912
|
-
}, facing: {
|
|
913
|
-
x: number;
|
|
914
|
-
y: number;
|
|
915
|
-
z: number;
|
|
916
|
-
}): void;
|
|
917
|
-
addStimulus(stimulus: Stimulus): void;
|
|
918
|
-
removeStimulus(id: string): void;
|
|
919
|
-
update(time: number): void;
|
|
920
|
-
getPerceivedStimuli(entityId: string): PerceivedStimulus[];
|
|
921
|
-
getHighestPriority(entityId: string): PerceivedStimulus | null;
|
|
922
|
-
isAwareOf(entityId: string, stimulusId: string): boolean;
|
|
923
|
-
getStimulusCount(): number;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
/**
|
|
927
|
-
* InfluenceMap.ts
|
|
928
|
-
*
|
|
929
|
-
* Grid-based influence map: propagation, decay, multi-layer
|
|
930
|
-
* support, and spatial queries.
|
|
931
|
-
*
|
|
932
|
-
* @module ai
|
|
933
|
-
*/
|
|
934
|
-
interface InfluenceConfig {
|
|
935
|
-
width: number;
|
|
936
|
-
height: number;
|
|
937
|
-
cellSize: number;
|
|
938
|
-
decayRate: number;
|
|
939
|
-
propagationRate: number;
|
|
940
|
-
maxValue: number;
|
|
941
|
-
}
|
|
942
|
-
declare class InfluenceMap {
|
|
943
|
-
private layers;
|
|
944
|
-
private config;
|
|
945
|
-
constructor(config: InfluenceConfig);
|
|
946
|
-
addLayer(name: string): void;
|
|
947
|
-
removeLayer(name: string): void;
|
|
948
|
-
getLayerNames(): string[];
|
|
949
|
-
setInfluence(layer: string, gx: number, gy: number, value: number): void;
|
|
950
|
-
addInfluence(layer: string, gx: number, gy: number, value: number): void;
|
|
951
|
-
stampRadius(layer: string, cx: number, cy: number, radius: number, value: number): void;
|
|
952
|
-
update(): void;
|
|
953
|
-
getInfluence(layer: string, gx: number, gy: number): number;
|
|
954
|
-
getInfluenceAtWorld(layer: string, wx: number, wy: number): number;
|
|
955
|
-
getMaxCell(layer: string): {
|
|
956
|
-
x: number;
|
|
957
|
-
y: number;
|
|
958
|
-
value: number;
|
|
959
|
-
};
|
|
960
|
-
clear(layer: string): void;
|
|
961
|
-
clearAll(): void;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
/**
|
|
965
|
-
* UtilityAI.ts
|
|
966
|
-
*
|
|
967
|
-
* Utility-based AI: action scoring with consideration curves,
|
|
968
|
-
* weighted selection, cooldowns, and action history.
|
|
969
|
-
*
|
|
970
|
-
* @module ai
|
|
971
|
-
*/
|
|
972
|
-
type CurveType = 'linear' | 'quadratic' | 'logistic' | 'step';
|
|
973
|
-
interface Consideration {
|
|
974
|
-
name: string;
|
|
975
|
-
input: () => number;
|
|
976
|
-
curve: CurveType;
|
|
977
|
-
weight: number;
|
|
978
|
-
invert: boolean;
|
|
979
|
-
}
|
|
980
|
-
interface UtilityAction {
|
|
981
|
-
id: string;
|
|
982
|
-
name: string;
|
|
983
|
-
considerations: Consideration[];
|
|
984
|
-
cooldown: number;
|
|
985
|
-
lastExecuted: number;
|
|
986
|
-
bonus: number;
|
|
987
|
-
execute: () => void;
|
|
988
|
-
}
|
|
989
|
-
declare class UtilityAI {
|
|
990
|
-
private actions;
|
|
991
|
-
private history;
|
|
992
|
-
private maxHistory;
|
|
993
|
-
private currentTime;
|
|
994
|
-
addAction(action: UtilityAction): void;
|
|
995
|
-
removeAction(id: string): void;
|
|
996
|
-
scoreAction(action: UtilityAction): number;
|
|
997
|
-
scoreAll(): Array<{
|
|
998
|
-
actionId: string;
|
|
999
|
-
score: number;
|
|
1000
|
-
}>;
|
|
1001
|
-
selectBest(): UtilityAction | null;
|
|
1002
|
-
executeBest(): string | null;
|
|
1003
|
-
setTime(time: number): void;
|
|
1004
|
-
getHistory(): {
|
|
1005
|
-
actionId: string;
|
|
1006
|
-
score: number;
|
|
1007
|
-
timestamp: number;
|
|
1008
|
-
}[];
|
|
1009
|
-
getActionCount(): number;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
/**
|
|
1013
|
-
* BehaviorSelector.ts
|
|
1014
|
-
*
|
|
1015
|
-
* Behavior selection: weighted random, priority-based, and
|
|
1016
|
-
* conditional behavior picking with fallbacks and lockout timers.
|
|
1017
|
-
*
|
|
1018
|
-
* @module ai
|
|
1019
|
-
*/
|
|
1020
|
-
interface Behavior {
|
|
1021
|
-
id: string;
|
|
1022
|
-
name: string;
|
|
1023
|
-
weight: number;
|
|
1024
|
-
priority: number;
|
|
1025
|
-
condition?: () => boolean;
|
|
1026
|
-
action: () => void;
|
|
1027
|
-
lockoutMs: number;
|
|
1028
|
-
lastExecuted: number;
|
|
1029
|
-
}
|
|
1030
|
-
type SelectionMode = 'priority' | 'weighted' | 'sequential';
|
|
1031
|
-
declare class BehaviorSelector {
|
|
1032
|
-
private behaviors;
|
|
1033
|
-
private mode;
|
|
1034
|
-
private currentIndex;
|
|
1035
|
-
private currentTime;
|
|
1036
|
-
private fallback;
|
|
1037
|
-
private history;
|
|
1038
|
-
private maxHistory;
|
|
1039
|
-
constructor(mode?: SelectionMode);
|
|
1040
|
-
addBehavior(behavior: Behavior): void;
|
|
1041
|
-
removeBehavior(id: string): void;
|
|
1042
|
-
setFallback(behavior: Behavior): void;
|
|
1043
|
-
setMode(mode: SelectionMode): void;
|
|
1044
|
-
select(): Behavior | null;
|
|
1045
|
-
private getAvailable;
|
|
1046
|
-
private selectByPriority;
|
|
1047
|
-
private selectByWeight;
|
|
1048
|
-
private selectSequential;
|
|
1049
|
-
execute(): string | null;
|
|
1050
|
-
setTime(time: number): void;
|
|
1051
|
-
getBehaviorCount(): number;
|
|
1052
|
-
getHistory(): {
|
|
1053
|
-
behaviorId: string;
|
|
1054
|
-
timestamp: number;
|
|
1055
|
-
}[];
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* GoalPlanner.ts
|
|
1060
|
-
*
|
|
1061
|
-
* GOAP-style goal planner: goal states, actions with preconditions
|
|
1062
|
-
* and effects, backward chaining plan generation, and plan execution.
|
|
1063
|
-
*
|
|
1064
|
-
* @module ai
|
|
1065
|
-
*/
|
|
1066
|
-
type WorldState = Map<string, boolean>;
|
|
1067
|
-
interface PlanAction {
|
|
1068
|
-
id: string;
|
|
1069
|
-
name: string;
|
|
1070
|
-
cost: number;
|
|
1071
|
-
preconditions: Map<string, boolean>;
|
|
1072
|
-
effects: Map<string, boolean>;
|
|
1073
|
-
execute: () => void;
|
|
1074
|
-
}
|
|
1075
|
-
interface Goal {
|
|
1076
|
-
id: string;
|
|
1077
|
-
name: string;
|
|
1078
|
-
conditions: Map<string, boolean>;
|
|
1079
|
-
priority: number;
|
|
1080
|
-
}
|
|
1081
|
-
interface Plan {
|
|
1082
|
-
actions: PlanAction[];
|
|
1083
|
-
totalCost: number;
|
|
1084
|
-
goalId: string;
|
|
1085
|
-
}
|
|
1086
|
-
declare class GoalPlanner {
|
|
1087
|
-
private actions;
|
|
1088
|
-
private goals;
|
|
1089
|
-
addAction(action: PlanAction): void;
|
|
1090
|
-
addGoal(goal: Goal): void;
|
|
1091
|
-
removeAction(id: string): void;
|
|
1092
|
-
removeGoal(id: string): void;
|
|
1093
|
-
plan(currentState: WorldState): Plan | null;
|
|
1094
|
-
private findPlan;
|
|
1095
|
-
private satisfiesGoal;
|
|
1096
|
-
private preconditionsMet;
|
|
1097
|
-
private stateKey;
|
|
1098
|
-
executePlan(plan: Plan): void;
|
|
1099
|
-
getActionCount(): number;
|
|
1100
|
-
getGoalCount(): number;
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Generation Analytics & Metrics
|
|
1105
|
-
*
|
|
1106
|
-
* Tracks and analyzes generation metrics:
|
|
1107
|
-
* - Success rates by adapter
|
|
1108
|
-
* - Confidence score distributions
|
|
1109
|
-
* - Code quality metrics
|
|
1110
|
-
* - Performance metrics
|
|
1111
|
-
* - User patterns and trends
|
|
1112
|
-
*/
|
|
1113
|
-
interface GenerationMetrics {
|
|
1114
|
-
promptLength: number;
|
|
1115
|
-
codeLength: number;
|
|
1116
|
-
confidence: number;
|
|
1117
|
-
parseSuccess: boolean;
|
|
1118
|
-
errorCount: number;
|
|
1119
|
-
wasFixed: boolean;
|
|
1120
|
-
responseTimeMs: number;
|
|
1121
|
-
attemptsNeeded: number;
|
|
1122
|
-
adapterName: string;
|
|
1123
|
-
timestamp: Date;
|
|
1124
|
-
platform?: string;
|
|
1125
|
-
}
|
|
1126
|
-
interface MetricsAggregate {
|
|
1127
|
-
totalGenerations: number;
|
|
1128
|
-
successRate: number;
|
|
1129
|
-
avgConfidence: number;
|
|
1130
|
-
avgResponseTime: number;
|
|
1131
|
-
avgErrorCount: number;
|
|
1132
|
-
avgAttemptsNeeded: number;
|
|
1133
|
-
mostCommonAdapter: string;
|
|
1134
|
-
mostCommonPlatform: string;
|
|
1135
|
-
}
|
|
1136
|
-
interface AdapterMetrics {
|
|
1137
|
-
name: string;
|
|
1138
|
-
generationCount: number;
|
|
1139
|
-
successRate: number;
|
|
1140
|
-
avgConfidence: number;
|
|
1141
|
-
avgResponseTime: number;
|
|
1142
|
-
bestFor: string[];
|
|
1143
|
-
reliabilityScore: number;
|
|
1144
|
-
}
|
|
1145
|
-
interface TimeSeriesMetrics {
|
|
1146
|
-
timestamp: Date;
|
|
1147
|
-
successRate: number;
|
|
1148
|
-
avgConfidence: number;
|
|
1149
|
-
avgResponseTime: number;
|
|
1150
|
-
generationCount: number;
|
|
1151
|
-
}
|
|
1152
|
-
declare class GenerationAnalytics {
|
|
1153
|
-
private metrics;
|
|
1154
|
-
private timeSeriesWindow;
|
|
1155
|
-
/**
|
|
1156
|
-
* Record a generation metric
|
|
1157
|
-
*/
|
|
1158
|
-
recordMetric(metric: GenerationMetrics): void;
|
|
1159
|
-
/**
|
|
1160
|
-
* Get all metrics
|
|
1161
|
-
*/
|
|
1162
|
-
getAllMetrics(): GenerationMetrics[];
|
|
1163
|
-
/**
|
|
1164
|
-
* Clear metrics
|
|
1165
|
-
*/
|
|
1166
|
-
clearMetrics(): void;
|
|
1167
|
-
/**
|
|
1168
|
-
* Get aggregate metrics
|
|
1169
|
-
*/
|
|
1170
|
-
getAggregateMetrics(): MetricsAggregate;
|
|
1171
|
-
/**
|
|
1172
|
-
* Get metrics by adapter
|
|
1173
|
-
*/
|
|
1174
|
-
getMetricsByAdapter(adapterName: string): AdapterMetrics;
|
|
1175
|
-
/**
|
|
1176
|
-
* Get all adapter metrics
|
|
1177
|
-
*/
|
|
1178
|
-
getAllAdapterMetrics(): AdapterMetrics[];
|
|
1179
|
-
/**
|
|
1180
|
-
* Get confidence distribution
|
|
1181
|
-
*/
|
|
1182
|
-
getConfidenceDistribution(): {
|
|
1183
|
-
range: string;
|
|
1184
|
-
count: number;
|
|
1185
|
-
percentage: number;
|
|
1186
|
-
}[];
|
|
1187
|
-
/**
|
|
1188
|
-
* Get error patterns
|
|
1189
|
-
*/
|
|
1190
|
-
getErrorPatterns(): {
|
|
1191
|
-
errorType: string;
|
|
1192
|
-
frequency: number;
|
|
1193
|
-
percentage: number;
|
|
1194
|
-
}[];
|
|
1195
|
-
/**
|
|
1196
|
-
* Get response time distribution
|
|
1197
|
-
*/
|
|
1198
|
-
getResponseTimeDistribution(): {
|
|
1199
|
-
range: string;
|
|
1200
|
-
count: number;
|
|
1201
|
-
percentage: number;
|
|
1202
|
-
}[];
|
|
1203
|
-
/**
|
|
1204
|
-
* Get time series metrics for a window
|
|
1205
|
-
*/
|
|
1206
|
-
getTimeSeries(windowMs?: number): TimeSeriesMetrics[];
|
|
1207
|
-
/**
|
|
1208
|
-
* Get recommendations based on metrics
|
|
1209
|
-
*/
|
|
1210
|
-
getRecommendations(): string[];
|
|
1211
|
-
/**
|
|
1212
|
-
* Export metrics as JSON
|
|
1213
|
-
*/
|
|
1214
|
-
exportMetrics(): string;
|
|
1215
|
-
/**
|
|
1216
|
-
* Create a detailed report
|
|
1217
|
-
*/
|
|
1218
|
-
generateReport(): string;
|
|
1219
|
-
}
|
|
1220
|
-
/**
|
|
1221
|
-
* Quick analytics creation
|
|
1222
|
-
*/
|
|
1223
|
-
declare function createAnalytics(): GenerationAnalytics;
|
|
1224
|
-
|
|
1225
|
-
/**
|
|
1226
|
-
* Generation Cache System
|
|
1227
|
-
*
|
|
1228
|
-
* Caches generated HoloScript code to avoid redundant API calls.
|
|
1229
|
-
* Implements LRU (Least Recently Used) eviction policy.
|
|
1230
|
-
*
|
|
1231
|
-
* Features:
|
|
1232
|
-
* - Prompt-based caching (hash of prompt + adapter)
|
|
1233
|
-
* - TTL (Time-To-Live) support
|
|
1234
|
-
* - Statistics tracking
|
|
1235
|
-
* - Serialization for persistence
|
|
1236
|
-
*/
|
|
1237
|
-
interface CacheEntry {
|
|
1238
|
-
prompt: string;
|
|
1239
|
-
code: string;
|
|
1240
|
-
confidence: number;
|
|
1241
|
-
timestamp: number;
|
|
1242
|
-
ttl?: number;
|
|
1243
|
-
hits: number;
|
|
1244
|
-
adapterName: string;
|
|
1245
|
-
}
|
|
1246
|
-
interface CacheStats {
|
|
1247
|
-
totalHits: number;
|
|
1248
|
-
totalMisses: number;
|
|
1249
|
-
hitRate: number;
|
|
1250
|
-
entriesCount: number;
|
|
1251
|
-
maxSize: number;
|
|
1252
|
-
averageHitCount: number;
|
|
1253
|
-
}
|
|
1254
|
-
declare class GenerationCache {
|
|
1255
|
-
private cache;
|
|
1256
|
-
private maxSize;
|
|
1257
|
-
private ttlMs;
|
|
1258
|
-
private hits;
|
|
1259
|
-
private misses;
|
|
1260
|
-
constructor(options?: {
|
|
1261
|
-
maxSize?: number;
|
|
1262
|
-
ttlMs?: number;
|
|
1263
|
-
});
|
|
1264
|
-
/**
|
|
1265
|
-
* Generate cache key from prompt and adapter
|
|
1266
|
-
*/
|
|
1267
|
-
private generateKey;
|
|
1268
|
-
/**
|
|
1269
|
-
* Get cached code if available and valid
|
|
1270
|
-
*/
|
|
1271
|
-
get(prompt: string, adapterName: string): CacheEntry | null;
|
|
1272
|
-
/**
|
|
1273
|
-
* Store generated code in cache
|
|
1274
|
-
*/
|
|
1275
|
-
set(prompt: string, code: string, confidence: number, adapterName: string): void;
|
|
1276
|
-
/**
|
|
1277
|
-
* Evict least recently used entry
|
|
1278
|
-
*/
|
|
1279
|
-
private evictLRU;
|
|
1280
|
-
/**
|
|
1281
|
-
* Clear entire cache
|
|
1282
|
-
*/
|
|
1283
|
-
clear(): void;
|
|
1284
|
-
/**
|
|
1285
|
-
* Get cache statistics
|
|
1286
|
-
*/
|
|
1287
|
-
getStats(): CacheStats;
|
|
1288
|
-
/**
|
|
1289
|
-
* Export cache as JSON
|
|
1290
|
-
*/
|
|
1291
|
-
serialize(): string;
|
|
1292
|
-
/**
|
|
1293
|
-
* Import cache from JSON
|
|
1294
|
-
*/
|
|
1295
|
-
deserialize(json: string): void;
|
|
1296
|
-
/**
|
|
1297
|
-
* Get all cache entries
|
|
1298
|
-
*/
|
|
1299
|
-
getEntries(): CacheEntry[];
|
|
1300
|
-
/**
|
|
1301
|
-
* Remove specific entry
|
|
1302
|
-
*/
|
|
1303
|
-
remove(prompt: string, adapterName: string): boolean;
|
|
1304
|
-
/**
|
|
1305
|
-
* Get cache size in bytes (approximate)
|
|
1306
|
-
*/
|
|
1307
|
-
getSize(): number;
|
|
1308
|
-
}
|
|
1309
|
-
interface CachedGenerationResult {
|
|
1310
|
-
code: string;
|
|
1311
|
-
confidence: number;
|
|
1312
|
-
fromCache: boolean;
|
|
1313
|
-
cacheAge?: number;
|
|
1314
|
-
}
|
|
1315
|
-
/**
|
|
1316
|
-
* Wrap generation with caching
|
|
1317
|
-
*/
|
|
1318
|
-
declare function cachedGenerate(prompt: string, adapterName: string, cache: GenerationCache, generator: () => Promise<{
|
|
1319
|
-
holoScript: string;
|
|
1320
|
-
aiConfidence: number;
|
|
1321
|
-
}>): Promise<CachedGenerationResult>;
|
|
1322
|
-
|
|
1323
|
-
interface GenerationConfig {
|
|
1324
|
-
/** Maximum attempts to generate valid code */
|
|
1325
|
-
maxAttempts: number;
|
|
1326
|
-
/** Target platform for optimization */
|
|
1327
|
-
targetPlatform: 'mobile' | 'desktop' | 'vr' | 'ar';
|
|
1328
|
-
/** Auto-fix errors if generation is invalid */
|
|
1329
|
-
autoFix: boolean;
|
|
1330
|
-
/** Minimum confidence threshold (0-1) */
|
|
1331
|
-
minConfidence: number;
|
|
1332
|
-
}
|
|
1333
|
-
interface GeneratedCode {
|
|
1334
|
-
/** The generated HoloScript code */
|
|
1335
|
-
holoScript: string;
|
|
1336
|
-
/** Confidence score from AI (0-1) */
|
|
1337
|
-
aiConfidence: number;
|
|
1338
|
-
/** Parse result */
|
|
1339
|
-
parseResult: HSPlusCompileResult;
|
|
1340
|
-
/** Was auto-fixed */
|
|
1341
|
-
wasFixed: boolean;
|
|
1342
|
-
/** Number of attempts before success */
|
|
1343
|
-
attempts: number;
|
|
1344
|
-
/** Explanation of generated code */
|
|
1345
|
-
explanation?: string;
|
|
1346
|
-
}
|
|
1347
|
-
interface GenerationHistory {
|
|
1348
|
-
/** Prompt that was used */
|
|
1349
|
-
prompt: string;
|
|
1350
|
-
/** Generated code */
|
|
1351
|
-
generated: GeneratedCode;
|
|
1352
|
-
/** Timestamp */
|
|
1353
|
-
timestamp: Date;
|
|
1354
|
-
/** Attempt number in session */
|
|
1355
|
-
sessionAttempt: number;
|
|
1356
|
-
}
|
|
1357
|
-
interface GenerationSession {
|
|
1358
|
-
/** Unique session ID */
|
|
1359
|
-
sessionId: string;
|
|
1360
|
-
/** All generations in this session */
|
|
1361
|
-
history: GenerationHistory[];
|
|
1362
|
-
/** AI adapter used */
|
|
1363
|
-
adapter: AIAdapter;
|
|
1364
|
-
/** Configuration */
|
|
1365
|
-
config: GenerationConfig;
|
|
1366
|
-
}
|
|
1367
|
-
declare class HoloScriptGenerator {
|
|
1368
|
-
private parser;
|
|
1369
|
-
private currentSession?;
|
|
1370
|
-
private sessionCounter;
|
|
1371
|
-
private cache;
|
|
1372
|
-
private analytics;
|
|
1373
|
-
private cacheEnabled;
|
|
1374
|
-
constructor(enableCache?: boolean);
|
|
1375
|
-
/**
|
|
1376
|
-
* Create a new generation session
|
|
1377
|
-
*/
|
|
1378
|
-
createSession(adapter: AIAdapter, config?: Partial<GenerationConfig>): GenerationSession;
|
|
1379
|
-
/**
|
|
1380
|
-
* Generate HoloScript from a natural language prompt
|
|
1381
|
-
*/
|
|
1382
|
-
generate(prompt: string, session?: GenerationSession): Promise<GeneratedCode>;
|
|
1383
|
-
/**
|
|
1384
|
-
* Optimize generated code for a target platform
|
|
1385
|
-
*/
|
|
1386
|
-
optimize(code: string, targetPlatform: 'mobile' | 'desktop' | 'vr' | 'ar', session?: GenerationSession): Promise<GeneratedCode>;
|
|
1387
|
-
/**
|
|
1388
|
-
* Fix invalid HoloScript code
|
|
1389
|
-
*/
|
|
1390
|
-
fix(code: string, session?: GenerationSession): Promise<GeneratedCode>;
|
|
1391
|
-
/**
|
|
1392
|
-
* Explain generated code
|
|
1393
|
-
*/
|
|
1394
|
-
explain(code: string, session?: GenerationSession): Promise<string>;
|
|
1395
|
-
/**
|
|
1396
|
-
* Multi-turn conversation for iterative code generation
|
|
1397
|
-
*/
|
|
1398
|
-
chat(message: string, session?: GenerationSession, history?: Array<{
|
|
1399
|
-
role: 'user' | 'assistant';
|
|
1400
|
-
content: string;
|
|
1401
|
-
}>): Promise<string>;
|
|
1402
|
-
/**
|
|
1403
|
-
* Get current generation session
|
|
1404
|
-
*/
|
|
1405
|
-
getCurrentSession(): GenerationSession | undefined;
|
|
1406
|
-
/**
|
|
1407
|
-
* Get generation history
|
|
1408
|
-
*/
|
|
1409
|
-
getHistory(session?: GenerationSession): GenerationHistory[];
|
|
1410
|
-
/**
|
|
1411
|
-
* Clear history
|
|
1412
|
-
*/
|
|
1413
|
-
clearHistory(session?: GenerationSession): void;
|
|
1414
|
-
/**
|
|
1415
|
-
* Get statistics for a session
|
|
1416
|
-
*/
|
|
1417
|
-
getStats(session?: GenerationSession): {
|
|
1418
|
-
totalGenerations: number;
|
|
1419
|
-
successCount: number;
|
|
1420
|
-
fixedCount: number;
|
|
1421
|
-
avgAttempts: number;
|
|
1422
|
-
avgConfidence: number;
|
|
1423
|
-
successRate: number;
|
|
1424
|
-
} | null;
|
|
1425
|
-
/**
|
|
1426
|
-
* Get cache statistics
|
|
1427
|
-
*/
|
|
1428
|
-
getCacheStats(): CacheStats;
|
|
1429
|
-
/**
|
|
1430
|
-
* Get analytics metrics
|
|
1431
|
-
*/
|
|
1432
|
-
getAnalytics(): {
|
|
1433
|
-
aggregateMetrics: MetricsAggregate;
|
|
1434
|
-
adapterMetrics: AdapterMetrics[];
|
|
1435
|
-
confidenceDistribution: {
|
|
1436
|
-
range: string;
|
|
1437
|
-
count: number;
|
|
1438
|
-
percentage: number;
|
|
1439
|
-
}[];
|
|
1440
|
-
responseTimeDistribution: {
|
|
1441
|
-
range: string;
|
|
1442
|
-
count: number;
|
|
1443
|
-
percentage: number;
|
|
1444
|
-
}[];
|
|
1445
|
-
errorPatterns: {
|
|
1446
|
-
errorType: string;
|
|
1447
|
-
frequency: number;
|
|
1448
|
-
percentage: number;
|
|
1449
|
-
}[];
|
|
1450
|
-
recommendations: string[];
|
|
1451
|
-
};
|
|
1452
|
-
/**
|
|
1453
|
-
* Generate analytics report
|
|
1454
|
-
*/
|
|
1455
|
-
generateReport(): string;
|
|
1456
|
-
}
|
|
1457
|
-
/**
|
|
1458
|
-
* Quick generation helper
|
|
1459
|
-
*/
|
|
1460
|
-
declare function generateHoloScript(prompt: string, adapter: AIAdapter, config?: Partial<GenerationConfig>): Promise<GeneratedCode>;
|
|
1461
|
-
/**
|
|
1462
|
-
* Batch generation helper
|
|
1463
|
-
*/
|
|
1464
|
-
declare function generateBatch(prompts: string[], adapter: AIAdapter, config?: Partial<GenerationConfig>): Promise<GeneratedCode[]>;
|
|
1465
|
-
/**
|
|
1466
|
-
* Validate batch of generated code
|
|
1467
|
-
*/
|
|
1468
|
-
declare function validateBatch(codes: string[]): Array<{
|
|
1469
|
-
code: string;
|
|
1470
|
-
valid: boolean;
|
|
1471
|
-
errors: number;
|
|
1472
|
-
}>;
|
|
1473
|
-
|
|
1474
|
-
/**
|
|
1475
|
-
* HoloScript AI Training Data Generator
|
|
1476
|
-
*
|
|
1477
|
-
* Generates diverse HoloScript examples for AI model training.
|
|
1478
|
-
* Creates input/output pairs covering all language features.
|
|
1479
|
-
*
|
|
1480
|
-
* @version 1.0.0
|
|
1481
|
-
*/
|
|
1482
|
-
interface TrainingExample {
|
|
1483
|
-
id: string;
|
|
1484
|
-
category: TrainingCategory;
|
|
1485
|
-
description: string;
|
|
1486
|
-
holoScript: string;
|
|
1487
|
-
expectedOutput?: {
|
|
1488
|
-
type: 'r3f' | 'visionos' | 'usda';
|
|
1489
|
-
snippet?: string;
|
|
1490
|
-
};
|
|
1491
|
-
tags: string[];
|
|
1492
|
-
complexity: 'basic' | 'intermediate' | 'advanced';
|
|
1493
|
-
}
|
|
1494
|
-
type TrainingCategory = 'geometry' | 'materials' | 'physics' | 'interactions' | 'audio' | 'ui' | 'composition' | 'state' | 'logic' | 'traits' | 'animations' | 'ar_vr' | 'accessibility';
|
|
1495
|
-
interface GeneratorOptions {
|
|
1496
|
-
count?: number;
|
|
1497
|
-
categories?: TrainingCategory[];
|
|
1498
|
-
complexityFilter?: ('basic' | 'intermediate' | 'advanced')[];
|
|
1499
|
-
includeExpectedOutput?: boolean;
|
|
1500
|
-
}
|
|
1501
|
-
declare class TrainingDataGenerator {
|
|
1502
|
-
private allExamples;
|
|
1503
|
-
constructor();
|
|
1504
|
-
/**
|
|
1505
|
-
* Generate training examples based on options
|
|
1506
|
-
*/
|
|
1507
|
-
generate(options?: GeneratorOptions): TrainingExample[];
|
|
1508
|
-
/**
|
|
1509
|
-
* Generate all examples
|
|
1510
|
-
*/
|
|
1511
|
-
generateAll(): TrainingExample[];
|
|
1512
|
-
/**
|
|
1513
|
-
* Get examples by category
|
|
1514
|
-
*/
|
|
1515
|
-
getByCategory(category: TrainingCategory): TrainingExample[];
|
|
1516
|
-
/**
|
|
1517
|
-
* Get examples by complexity
|
|
1518
|
-
*/
|
|
1519
|
-
getByComplexity(complexity: 'basic' | 'intermediate' | 'advanced'): TrainingExample[];
|
|
1520
|
-
/**
|
|
1521
|
-
* Get examples by tag
|
|
1522
|
-
*/
|
|
1523
|
-
getByTag(tag: string): TrainingExample[];
|
|
1524
|
-
/**
|
|
1525
|
-
* Get category statistics
|
|
1526
|
-
*/
|
|
1527
|
-
getStats(): Record<TrainingCategory, number>;
|
|
1528
|
-
/**
|
|
1529
|
-
* Export as JSON for training
|
|
1530
|
-
*/
|
|
1531
|
-
exportJSON(): string;
|
|
1532
|
-
/**
|
|
1533
|
-
* Export as JSONL (one JSON per line)
|
|
1534
|
-
*/
|
|
1535
|
-
exportJSONL(): string;
|
|
1536
|
-
private shuffleArray;
|
|
1537
|
-
}
|
|
1538
|
-
declare const ALL_CATEGORIES: TrainingCategory[];
|
|
1539
|
-
declare function createTrainingDataGenerator(): TrainingDataGenerator;
|
|
1540
|
-
|
|
1541
|
-
/**
|
|
1542
|
-
* Prompt Templates System
|
|
1543
|
-
*
|
|
1544
|
-
* Provides pre-built prompt templates for common HoloScript generation tasks.
|
|
1545
|
-
* Supports:
|
|
1546
|
-
* - Variable interpolation
|
|
1547
|
-
* - Context-aware suggestions
|
|
1548
|
-
* - Template composition
|
|
1549
|
-
* - Custom template creation
|
|
1550
|
-
*/
|
|
1551
|
-
interface PromptTemplate {
|
|
1552
|
-
id: string;
|
|
1553
|
-
name: string;
|
|
1554
|
-
description: string;
|
|
1555
|
-
category: string;
|
|
1556
|
-
template: string;
|
|
1557
|
-
variables: string[];
|
|
1558
|
-
examples: string[];
|
|
1559
|
-
bestFor: string;
|
|
1560
|
-
}
|
|
1561
|
-
interface TemplateContext {
|
|
1562
|
-
[key: string]: string | number | boolean;
|
|
1563
|
-
}
|
|
1564
|
-
declare class PromptTemplateSystem {
|
|
1565
|
-
private customTemplates;
|
|
1566
|
-
/**
|
|
1567
|
-
* Get all available templates
|
|
1568
|
-
*/
|
|
1569
|
-
getAvailableTemplates(): PromptTemplate[];
|
|
1570
|
-
/**
|
|
1571
|
-
* Get templates by category
|
|
1572
|
-
*/
|
|
1573
|
-
getTemplatesByCategory(category: string): PromptTemplate[];
|
|
1574
|
-
/**
|
|
1575
|
-
* Get a specific template
|
|
1576
|
-
*/
|
|
1577
|
-
getTemplate(id: string): PromptTemplate | null;
|
|
1578
|
-
/**
|
|
1579
|
-
* Create a prompt from template with context
|
|
1580
|
-
*/
|
|
1581
|
-
createPrompt(templateId: string, context: TemplateContext): string;
|
|
1582
|
-
/**
|
|
1583
|
-
* Validate context against template
|
|
1584
|
-
*/
|
|
1585
|
-
validateContext(templateId: string, context: TemplateContext): {
|
|
1586
|
-
valid: boolean;
|
|
1587
|
-
missing: string[];
|
|
1588
|
-
};
|
|
1589
|
-
/**
|
|
1590
|
-
* Register custom template
|
|
1591
|
-
*/
|
|
1592
|
-
registerTemplate(template: PromptTemplate): void;
|
|
1593
|
-
/**
|
|
1594
|
-
* Get template suggestions for a category
|
|
1595
|
-
*/
|
|
1596
|
-
suggestTemplates(category: string, query?: string): PromptTemplate[];
|
|
1597
|
-
/**
|
|
1598
|
-
* Get all categories
|
|
1599
|
-
*/
|
|
1600
|
-
getCategories(): string[];
|
|
1601
|
-
/**
|
|
1602
|
-
* Create a batch of prompts from templates
|
|
1603
|
-
*/
|
|
1604
|
-
createBatch(templates: Array<{
|
|
1605
|
-
templateId: string;
|
|
1606
|
-
context: TemplateContext;
|
|
1607
|
-
}>): string[];
|
|
1608
|
-
}
|
|
1609
|
-
/**
|
|
1610
|
-
* Quick prompt creation helpers
|
|
1611
|
-
*/
|
|
1612
|
-
declare const QuickPrompts: {
|
|
1613
|
-
/**
|
|
1614
|
-
* Create prompt for a simple object
|
|
1615
|
-
*/
|
|
1616
|
-
object(geometry: string, color: string, position: [number, number, number]): string;
|
|
1617
|
-
/**
|
|
1618
|
-
* Create prompt for an interactive object
|
|
1619
|
-
*/
|
|
1620
|
-
interactive(color: string, geometry: string, interaction: string, purpose: string): string;
|
|
1621
|
-
/**
|
|
1622
|
-
* Create prompt for a physics object
|
|
1623
|
-
*/
|
|
1624
|
-
physics(geometry: string, physics_type: string, mass: number, restitution: number): string;
|
|
1625
|
-
/**
|
|
1626
|
-
* Create prompt for a player controller
|
|
1627
|
-
*/
|
|
1628
|
-
player(geometry: string, movement_type: string, health: number, abilities: string): string;
|
|
1629
|
-
/**
|
|
1630
|
-
* Create prompt for networked object
|
|
1631
|
-
*/
|
|
1632
|
-
networked(object_type: string, synced_properties: string, sync_rate: number): string;
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
/**
|
|
1636
|
-
* AICopilot.ts
|
|
1637
|
-
*
|
|
1638
|
-
* Editor-aware AI assistant that bridges the existing AIAdapter/HoloScriptGenerator
|
|
1639
|
-
* infrastructure with the runtime and editor for real-time AI assistance.
|
|
1640
|
-
*
|
|
1641
|
-
* @module ai
|
|
1642
|
-
*/
|
|
1643
|
-
|
|
1644
|
-
interface CopilotContext {
|
|
1645
|
-
/** Currently selected entity type/id */
|
|
1646
|
-
selectedEntity?: {
|
|
1647
|
-
id: string;
|
|
1648
|
-
type: string;
|
|
1649
|
-
properties?: Record<string, unknown>;
|
|
1650
|
-
};
|
|
1651
|
-
/** Current scene node types */
|
|
1652
|
-
sceneNodeTypes?: string[];
|
|
1653
|
-
/** Active state keys */
|
|
1654
|
-
stateKeys?: string[];
|
|
1655
|
-
/** Recent user actions */
|
|
1656
|
-
recentActions?: string[];
|
|
1657
|
-
}
|
|
1658
|
-
interface CopilotSuggestion {
|
|
1659
|
-
type: 'modify' | 'create' | 'explain' | 'fix';
|
|
1660
|
-
description: string;
|
|
1661
|
-
holoScript?: string;
|
|
1662
|
-
confidence: number;
|
|
1663
|
-
}
|
|
1664
|
-
interface CopilotResponse {
|
|
1665
|
-
text: string;
|
|
1666
|
-
suggestions: CopilotSuggestion[];
|
|
1667
|
-
generatedCode?: GeneratedCode;
|
|
1668
|
-
error?: string;
|
|
1669
|
-
}
|
|
1670
|
-
interface CopilotMessage {
|
|
1671
|
-
role: 'user' | 'assistant';
|
|
1672
|
-
content: string;
|
|
1673
|
-
timestamp: number;
|
|
1674
|
-
}
|
|
1675
|
-
declare class AICopilot {
|
|
1676
|
-
private adapter;
|
|
1677
|
-
private generator;
|
|
1678
|
-
private history;
|
|
1679
|
-
private context;
|
|
1680
|
-
constructor(adapter?: AIAdapter);
|
|
1681
|
-
setAdapter(adapter: AIAdapter): void;
|
|
1682
|
-
getAdapter(): AIAdapter | null;
|
|
1683
|
-
isReady(): boolean;
|
|
1684
|
-
updateContext(context: Partial<CopilotContext>): void;
|
|
1685
|
-
getContext(): CopilotContext;
|
|
1686
|
-
/**
|
|
1687
|
-
* Generate HoloScript from a natural language prompt.
|
|
1688
|
-
* Uses the full HoloScriptGenerator pipeline (generate → validate → auto-fix).
|
|
1689
|
-
*/
|
|
1690
|
-
generateFromPrompt(prompt: string, options?: Partial<GenerateOptions>): Promise<CopilotResponse>;
|
|
1691
|
-
/**
|
|
1692
|
-
* Suggest modifications for the currently selected entity.
|
|
1693
|
-
*/
|
|
1694
|
-
suggestFromSelection(): Promise<CopilotResponse>;
|
|
1695
|
-
/**
|
|
1696
|
-
* Explain the current scene in natural language.
|
|
1697
|
-
*/
|
|
1698
|
-
explainScene(sceneCode: string): Promise<CopilotResponse>;
|
|
1699
|
-
/**
|
|
1700
|
-
* Auto-fix runtime errors using the AI adapter.
|
|
1701
|
-
*/
|
|
1702
|
-
autoFix(code: string, errors: string[]): Promise<CopilotResponse>;
|
|
1703
|
-
/**
|
|
1704
|
-
* Chat with the AI about HoloScript code (multi-turn conversation).
|
|
1705
|
-
*/
|
|
1706
|
-
chat(message: string): Promise<CopilotResponse>;
|
|
1707
|
-
getHistory(): CopilotMessage[];
|
|
1708
|
-
clearHistory(): void;
|
|
1709
|
-
private addMessage;
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
/**
|
|
1713
|
-
* AI Output Validator
|
|
1714
|
-
*
|
|
1715
|
-
* Validates AI-generated HoloScript code before execution.
|
|
1716
|
-
* Catches structural errors, dangerous patterns, and excessive complexity.
|
|
1717
|
-
*
|
|
1718
|
-
* @module ai
|
|
1719
|
-
*/
|
|
1720
|
-
interface ValidationIssue {
|
|
1721
|
-
severity: 'error' | 'warning' | 'info';
|
|
1722
|
-
message: string;
|
|
1723
|
-
line?: number;
|
|
1724
|
-
rule: string;
|
|
1725
|
-
}
|
|
1726
|
-
interface ValidationResult {
|
|
1727
|
-
valid: boolean;
|
|
1728
|
-
issues: ValidationIssue[];
|
|
1729
|
-
confidence: number;
|
|
1730
|
-
stats: {
|
|
1731
|
-
lineCount: number;
|
|
1732
|
-
traitCount: number;
|
|
1733
|
-
dangerousPatternCount: number;
|
|
1734
|
-
maxNesting: number;
|
|
1735
|
-
};
|
|
1736
|
-
}
|
|
1737
|
-
interface ValidatorConfig {
|
|
1738
|
-
maxLines: number;
|
|
1739
|
-
maxNesting: number;
|
|
1740
|
-
maxTraits: number;
|
|
1741
|
-
allowedTraits?: string[];
|
|
1742
|
-
blockDangerousPatterns: boolean;
|
|
1743
|
-
}
|
|
1744
|
-
/**
|
|
1745
|
-
* Validate AI-generated code for safety and correctness.
|
|
1746
|
-
*/
|
|
1747
|
-
declare function validateAIOutput(code: string, config?: Partial<ValidatorConfig>): ValidationResult;
|
|
1748
|
-
/**
|
|
1749
|
-
* Quick check — returns true if code passes all error-level checks.
|
|
1750
|
-
*/
|
|
1751
|
-
declare function isAISafe(code: string, config?: Partial<ValidatorConfig>): boolean;
|
|
1752
|
-
|
|
1753
|
-
export { type AIAdapter, AICopilot, ALL_CATEGORIES, ActionNode, AnthropicAdapter, type AnthropicAdapterConfig, BTNode, type BTStatus, type BTContext as BTTreeContext, type BTTreeDef, BehaviorSelector, BehaviorTree, Blackboard, ConditionNode, type ExplainResult, FireworksAdapter, type FireworksAdapterConfig, type FixResult, GeminiAdapter, type GeminiAdapterConfig, type GenerateOptions, type GenerateResult, GenerationAnalytics, GenerationCache, GoalPlanner, type GuardFn, GuardNode, HoloScriptGenerator, InfluenceMap, InverterNode, LMStudioAdapter, type LMStudioAdapterConfig, NVIDIAAdapter, type NVIDIAAdapterConfig, NavMesh, OllamaAdapter, type OllamaAdapterConfig, OpenAIAdapter, type OpenAIAdapterConfig, type OptimizeResult, ParallelNode, PerceptionSystem, type PromptTemplate, PromptTemplateSystem, QuickPrompts, RepeaterNode, type SearchResult, SelectorNode, SemanticSearchService, SequenceNode, type StateAction, type StateConfig, StateMachine, SteeringBehavior, SteeringBehaviors, type TemplateContext, TogetherAdapter, type TogetherAdapterConfig, TrainingDataGenerator, type TransitionConfig, UtilityAI, WaitNode, XAIAdapter, type XAIAdapterConfig, cachedGenerate, createAnalytics, createTrainingDataGenerator, explainHoloScript, fixHoloScript, generateBatch, generateHoloScript$1 as generateHoloScript, generateHoloScript as generateHoloScriptWithAdapter, getAIAdapter, getDefaultAIAdapter, isAISafe, listAIAdapters, optimizeHoloScript, registerAIAdapter, setDefaultAIAdapter, unregisterAIAdapter, useAnthropic, useFireworks, useGemini, useGrok, useLMStudio, useNVIDIA, useOllama, useOpenAI, useTogether, useXAI, validateAIOutput, validateBatch };
|