@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.
Files changed (160) hide show
  1. package/CHANGELOG.md +1 -2
  2. package/ROADMAP.md +68 -66
  3. package/dist/{InvisibleWallet-BB6tFvRA.d.cts → InvisibleWallet-EFiuaLn3.d.cts} +1 -1
  4. package/dist/{OrchestratorAgent-BvWgf9uw.d.cts → OrchestratorAgent-CrLDGNL6.d.cts} +1 -1
  5. package/dist/agents/index.cjs +11 -10
  6. package/dist/agents/index.d.cts +4 -16
  7. package/dist/ai/index.cjs +2 -2
  8. package/dist/behavior.cjs +10 -0
  9. package/dist/economy/index.cjs +4 -4
  10. package/dist/economy/index.d.cts +2 -2
  11. package/dist/index.cjs +33 -11
  12. package/dist/index.d.cts +3 -3
  13. package/dist/swarm/index.cjs +3 -0
  14. package/package.json +14 -9
  15. package/src/__tests__/bounty-marketplace.test.ts +53 -21
  16. package/src/__tests__/delegation.test.ts +1 -4
  17. package/src/__tests__/done-log-audit.test.ts +38 -46
  18. package/src/__tests__/framework.test.ts +172 -53
  19. package/src/__tests__/goal-synthesizer.test.ts +9 -6
  20. package/src/__tests__/presence.test.ts +1 -1
  21. package/src/__tests__/protocol-agent.test.ts +12 -11
  22. package/src/__tests__/revenue-splitter.test.ts +22 -15
  23. package/src/__tests__/scenario-driven-todo.test.ts +55 -35
  24. package/src/__tests__/self-improve.test.ts +28 -9
  25. package/src/__tests__/service-lifecycle.test.ts +9 -3
  26. package/src/__tests__/skill-router.test.ts +3 -3
  27. package/src/agents/CulturalMemory.ts +6 -6
  28. package/src/agents/DelegationTraceHooks.ts +560 -0
  29. package/src/agents/FederatedRegistryAdapter.ts +1 -1
  30. package/src/agents/NormEngine.ts +3 -8
  31. package/src/agents/OrchestratorAgent.ts +1 -1
  32. package/src/agents/TaskDelegationService.ts +5 -9
  33. package/src/agents/__tests__/AgentWalletRegistry.test.ts +5 -4
  34. package/src/agents/__tests__/CrossRealityHandoff.test.ts +9 -3
  35. package/src/agents/__tests__/DelegationTraceHooks.test.ts +390 -0
  36. package/src/agents/__tests__/TaskDelegationService.test.ts +4 -2
  37. package/src/agents/spatial-comms/Layer1RealTime.ts +36 -19
  38. package/src/agents/spatial-comms/Layer2A2A.ts +1 -3
  39. package/src/agents/spatial-comms/Layer3MCP.ts +13 -4
  40. package/src/agents/spatial-comms/ProtocolTypes.ts +5 -2
  41. package/src/agents/spatial-comms/examples/multi-agent-world-creation.ts +2 -2
  42. package/src/ai/HoloScriptGenerator.ts +2 -2
  43. package/src/ai/__tests__/PerceptionSystem.prod.test.ts +1 -1
  44. package/src/ai/__tests__/PerceptionSystem.test.ts +14 -14
  45. package/src/ai/__tests__/SteeringBehaviors.prod.test.ts +1 -1
  46. package/src/ai/index.ts +5 -1
  47. package/src/board/audit.ts +17 -6
  48. package/src/board/board-ops.ts +45 -15
  49. package/src/board/board-types.ts +94 -20
  50. package/src/delegation.ts +5 -3
  51. package/src/distributed-claimer.ts +13 -2
  52. package/src/economy/BountyManager.ts +40 -18
  53. package/src/economy/KnowledgeMarketplace.ts +27 -8
  54. package/src/economy/PaymentWebhookService.ts +0 -1
  55. package/src/economy/RevenueSplitter.ts +2 -4
  56. package/src/economy/UnifiedBudgetOptimizer.ts +8 -9
  57. package/src/economy/_core-stubs.ts +1 -1
  58. package/src/economy/x402-facilitator.ts +17 -8
  59. package/src/index.ts +16 -12
  60. package/src/knowledge/__tests__/knowledge-consolidator.test.ts +138 -89
  61. package/src/knowledge/__tests__/knowledge-store-vector.test.ts +59 -16
  62. package/src/knowledge/brain.ts +7 -7
  63. package/src/knowledge/consolidation.ts +16 -16
  64. package/src/knowledge/knowledge-consolidator.ts +60 -30
  65. package/src/knowledge/knowledge-store.ts +83 -45
  66. package/src/learning/ProceduralCompiler.ts +6 -1
  67. package/src/learning/learning/MemoryConsolidator.ts +102 -0
  68. package/src/learning/learning/MemoryScorer.ts +69 -0
  69. package/src/learning/learning/ProceduralCompiler.ts +45 -0
  70. package/src/learning/learning/SemanticClusterer.ts +66 -0
  71. package/src/llm/llm-adapter.ts +24 -10
  72. package/src/mesh/index.ts +37 -17
  73. package/src/protocol/goal-synthesizer.ts +24 -34
  74. package/src/protocol/implementations.ts +91 -22
  75. package/src/protocol/micro-phase-decomposer.ts +25 -17
  76. package/src/protocol/micro-step-decomposer.test.ts +104 -39
  77. package/src/protocol-agent.test.ts +17 -7
  78. package/src/protocol-agent.ts +45 -42
  79. package/src/self-improve/absorb-scanner.ts +9 -6
  80. package/src/self-improve/evolution-engine.ts +36 -18
  81. package/src/self-improve/framework-absorber.ts +21 -16
  82. package/src/self-improve/index.ts +2 -10
  83. package/src/self-improve/prompt-optimizer.ts +31 -19
  84. package/src/self-improve/test-generator.ts +16 -12
  85. package/src/skill-router.ts +7 -6
  86. package/src/swarm/messaging/GossipProtocol.ts +1 -1
  87. package/src/swarm/messaging/__tests__/BroadcastChannel.prod.test.ts +31 -9
  88. package/src/swarm/messaging/__tests__/GossipProtocol.prod.test.ts +21 -7
  89. package/src/swarm/messaging/__tests__/SwarmEventBus.prod.test.ts +24 -8
  90. package/src/swarm/messaging/__tests__/SwarmEventBus.test.ts +6 -2
  91. package/src/team.ts +277 -122
  92. package/src/training/scripts/generate-spatial-dataset.ts +1 -1
  93. package/src/training/training/LRScheduler.ts +377 -0
  94. package/src/training/training/QualityScoringPipeline.ts +139 -0
  95. package/src/training/training/SoftDedup.ts +461 -0
  96. package/src/training/training/SparsityMonitor.ts +685 -0
  97. package/src/training/training/SparsityMonitorTypes.ts +209 -0
  98. package/src/training/training/SpatialTrainingDataGenerator.ts +1526 -0
  99. package/src/training/training/SpatialTrainingDataTypes.ts +216 -0
  100. package/src/training/training/TrainingPipelineConfig.ts +215 -0
  101. package/src/training/training/__tests__/CorpusValidation.test.ts +87 -0
  102. package/src/training/training/__tests__/LRScheduler.test.ts +592 -0
  103. package/src/training/training/__tests__/SoftDedup.test.ts +415 -0
  104. package/src/training/training/__tests__/SparsityMonitor.test.ts +1623 -0
  105. package/src/training/training/__tests__/SpatialCorpusValidation.test.ts +72 -0
  106. package/src/training/training/__tests__/SpatialTrainingDataGenerator.test.ts +1244 -0
  107. package/src/training/training/__tests__/TrainingMonkeyIntegration.test.ts +897 -0
  108. package/src/training/training/__tests__/TrainingPipelineConfig.test.ts +202 -0
  109. package/src/training/training/__tests__/schema.test.ts +72 -0
  110. package/src/training/training/__tests__/training-constants.test.ts +106 -0
  111. package/src/training/training/__tests__/trait-mappings.test.ts +81 -0
  112. package/src/training/training/constants.ts +94 -0
  113. package/src/training/training/index.ts +17 -0
  114. package/src/training/training/schema.ts +147 -0
  115. package/src/training/training/scripts/generate-novel-use-cases-dataset.ts +272 -0
  116. package/src/training/training/scripts/generate-spatial-dataset.ts +521 -0
  117. package/src/training/training/trainingmonkey/TrainingMonkeyIntegration.ts +477 -0
  118. package/src/training/training/trainingmonkey/TrainingMonkeyTypes.ts +230 -0
  119. package/src/training/training/trainingmonkey/index.ts +26 -0
  120. package/src/training/training/trait-mappings.ts +157 -0
  121. package/src/types.ts +2 -7
  122. package/ALL-test-results.json +0 -1
  123. package/LICENSE +0 -21
  124. package/dist/AgentManifest-CB4xM-Ma.d.ts +0 -704
  125. package/dist/BehaviorTree-BrBFECv5.d.ts +0 -103
  126. package/dist/InvisibleWallet-rtRrBOA8.d.ts +0 -1732
  127. package/dist/OrchestratorAgent-Q_CbVTmO.d.ts +0 -798
  128. package/dist/agents/index.d.ts +0 -1788
  129. package/dist/agents/index.js +0 -4695
  130. package/dist/ai/index.d.ts +0 -1753
  131. package/dist/ai/index.js +0 -5244
  132. package/dist/behavior.d.ts +0 -130
  133. package/dist/behavior.js +0 -407
  134. package/dist/economy/index.d.ts +0 -747
  135. package/dist/economy/index.js +0 -3617
  136. package/dist/implementations-D9T3un9D.d.ts +0 -236
  137. package/dist/index.d.ts +0 -1729
  138. package/dist/index.js +0 -24277
  139. package/dist/learning/index.d.ts +0 -104
  140. package/dist/learning/index.js +0 -189
  141. package/dist/negotiation/index.d.ts +0 -610
  142. package/dist/negotiation/index.js +0 -931
  143. package/dist/skills/index.d.ts +0 -289
  144. package/dist/skills/index.js +0 -1079
  145. package/dist/swarm/index.d.ts +0 -2433
  146. package/dist/swarm/index.js +0 -5221
  147. package/dist/training/index.d.ts +0 -1734
  148. package/dist/training/index.js +0 -2687
  149. package/extract-failures.js +0 -10
  150. package/src/training/training/data/novel-use-cases.jsonl +0 -153
  151. package/src/training/training/data/spatial-reasoning-10k.jsonl +0 -9354
  152. package/src/types/core-stubs.d.ts +0 -113
  153. package/test-output.txt +0 -0
  154. package/test-result.json +0 -1
  155. package/tsc-errors.txt +0 -4
  156. package/tsc_output.txt +0 -0
  157. package/typescript-errors-2.txt +0 -0
  158. package/typescript-errors.txt +0 -22
  159. package/vitest-log-utf8.txt +0 -268
  160. package/vitest-log.txt +0 -0
@@ -1,704 +0,0 @@
1
- /**
2
- * @holoscript/core - Agent Type Definitions
3
- *
4
- * Shared types for the HoloScript Agent Framework.
5
- * Defines the 7-phase uAA2++ protocol and agent capabilities.
6
- */
7
- /**
8
- * The 7 phases of the uAA2++ protocol
9
- */
10
- type AgentPhase = 'INTAKE' | 'REFLECT' | 'EXECUTE' | 'COMPRESS' | 'REINTAKE' | 'GROW' | 'EVOLVE';
11
- /**
12
- * Phase execution order
13
- */
14
- declare const PHASE_ORDER: readonly AgentPhase[];
15
- /**
16
- * Default phase timings (milliseconds)
17
- */
18
- declare const DEFAULT_PHASE_TIMINGS: Record<AgentPhase, number>;
19
- /**
20
- * Base result for all phases
21
- */
22
- interface PhaseResult {
23
- success: boolean;
24
- phase: AgentPhase;
25
- duration_ms: number;
26
- error?: string;
27
- data?: Record<string, unknown>;
28
- }
29
- /**
30
- * INTAKE phase result
31
- */
32
- interface IntakeResult extends PhaseResult {
33
- phase: 'INTAKE';
34
- sources: string[];
35
- items_loaded: number;
36
- data?: {
37
- knowledge?: Record<string, unknown>;
38
- patterns?: unknown[];
39
- wisdom?: unknown[];
40
- gotchas?: unknown[];
41
- context?: Record<string, unknown>;
42
- };
43
- }
44
- /**
45
- * REFLECT phase result
46
- */
47
- interface ReflectResult extends PhaseResult {
48
- phase: 'REFLECT';
49
- analysis_depth: 'shallow' | 'medium' | 'deep';
50
- insights_generated: number;
51
- data?: {
52
- ai_context?: string;
53
- decision_criteria?: Record<string, unknown>;
54
- priorities?: string[];
55
- risks?: string[];
56
- };
57
- }
58
- /**
59
- * EXECUTE phase result
60
- */
61
- interface ExecuteResult extends PhaseResult {
62
- phase: 'EXECUTE';
63
- actions_taken: number;
64
- deliverables: string[];
65
- data?: {
66
- outputs?: unknown[];
67
- side_effects?: string[];
68
- metrics?: Record<string, number>;
69
- };
70
- }
71
- /**
72
- * COMPRESS phase result
73
- */
74
- interface CompressResult extends PhaseResult {
75
- phase: 'COMPRESS';
76
- compression_ratio: number;
77
- tokens_saved: number;
78
- data?: {
79
- compressed_knowledge?: string;
80
- symbol_mappings?: Record<string, string>;
81
- patterns_extracted?: string[];
82
- wisdom_extracted?: string[];
83
- gotchas_captured?: string[];
84
- };
85
- }
86
- /**
87
- * REINTAKE phase result
88
- */
89
- interface ReintakeResult extends PhaseResult {
90
- phase: 'REINTAKE';
91
- items_refreshed: number;
92
- effectiveness: number;
93
- data?: {
94
- merged_knowledge?: Record<string, unknown>;
95
- conflicts_resolved?: number;
96
- new_insights?: string[];
97
- };
98
- }
99
- /**
100
- * GROW phase result
101
- */
102
- interface GrowResult extends PhaseResult {
103
- phase: 'GROW';
104
- patterns_learned: number;
105
- wisdom_gained: number;
106
- gotchas_captured: number;
107
- data?: {
108
- new_patterns?: Array<{
109
- id: string;
110
- name: string;
111
- confidence: number;
112
- }>;
113
- new_wisdom?: Array<{
114
- id: string;
115
- content: string;
116
- domain: string;
117
- }>;
118
- new_gotchas?: Array<{
119
- id: string;
120
- trigger: string;
121
- avoidance: string;
122
- }>;
123
- capability_score_delta?: number;
124
- };
125
- }
126
- /**
127
- * EVOLVE phase result
128
- */
129
- interface EvolveResult extends PhaseResult {
130
- phase: 'EVOLVE';
131
- evolution_level: number;
132
- traits_activated: string[];
133
- traits_deactivated: string[];
134
- data?: {
135
- new_capabilities?: string[];
136
- optimizations_applied?: string[];
137
- efficiency_improvement?: number;
138
- next_evolution_threshold?: number;
139
- };
140
- }
141
- /**
142
- * Union type for all phase results
143
- */
144
- type AnyPhaseResult = IntakeResult | ReflectResult | ExecuteResult | CompressResult | ReintakeResult | GrowResult | EvolveResult;
145
- /**
146
- * Complete cycle result
147
- */
148
- interface CycleResult {
149
- cycle_number: number;
150
- success: boolean;
151
- total_duration_ms: number;
152
- phases: {
153
- intake?: IntakeResult;
154
- reflect?: ReflectResult;
155
- execute?: ExecuteResult;
156
- compress?: CompressResult;
157
- reintake?: ReintakeResult;
158
- grow?: GrowResult;
159
- evolve?: EvolveResult;
160
- };
161
- learnings: {
162
- patterns: number;
163
- wisdom: number;
164
- gotchas: number;
165
- };
166
- evolution_delta: number;
167
- timestamp: string;
168
- }
169
- /**
170
- * Agent category classification
171
- */
172
- type AgentCategory = 'trading' | 'analysis' | 'optimization' | 'monitoring' | 'creative' | 'management' | 'strategic' | 'assistant' | 'orchestrator' | 'quest_creator' | 'librarian' | 'twin_manager' | 'payment_handler' | 'autonomous';
173
- /**
174
- * Agent position in the Lotus Flower Architecture
175
- */
176
- type AgentPosition = 'center' | 'inner-circle' | 'main-petal' | 'inner-petal' | 'supportive' | 'background' | 'infrastructure';
177
- /**
178
- * Agent orchestral section (musical metaphor)
179
- */
180
- type AgentSection = 'strings' | 'woodwinds' | 'brass' | 'percussion' | 'keyboard' | 'vocal';
181
- /**
182
- * Architecture awareness metadata
183
- */
184
- interface ArchitectureAwareness {
185
- position: AgentPosition;
186
- section?: AgentSection;
187
- role: string;
188
- visualizationDoc?: string;
189
- musicPatterns?: {
190
- interval: 'I' | 'II' | 'III' | 'IV' | 'V' | 'VI' | 'VII' | 'VIII';
191
- formRole: 'exposition' | 'development' | 'recapitulation' | 'coda' | 'refrain';
192
- pulse: 'strong' | 'weak' | 'syncopated';
193
- };
194
- }
195
- /**
196
- * Phase configuration overrides
197
- */
198
- interface PhaseConfig {
199
- enabled?: boolean;
200
- timeout_ms?: number;
201
- retries?: number;
202
- parallel?: boolean;
203
- dependencies?: AgentPhase[];
204
- }
205
- /**
206
- * Curiosity configuration (what's next?)
207
- */
208
- interface CuriosityConfig {
209
- enabled: boolean;
210
- depth: 'shallow' | 'medium' | 'deep';
211
- sources: Array<'todo' | 'handoff' | 'codebase' | 'related' | 'improvement' | 'pattern'>;
212
- auto_continue: boolean;
213
- max_results: number;
214
- }
215
- /**
216
- * Budget configuration for runaway prevention
217
- */
218
- interface BudgetConfig {
219
- max_tokens_per_cycle: number;
220
- max_duration_ms: number;
221
- max_actions_per_minute: number;
222
- max_consecutive_failures: number;
223
- }
224
- /**
225
- * Complete agent configuration
226
- */
227
- interface AgentConfig {
228
- agent_id: string;
229
- agent_name: string;
230
- agent_type: string;
231
- categories: AgentCategory[];
232
- architecture?: ArchitectureAwareness;
233
- phases?: Partial<Record<AgentPhase, PhaseConfig>>;
234
- phase_timings?: Partial<Record<AgentPhase, number>>;
235
- enabled_phases?: AgentPhase[];
236
- auto_transition?: boolean;
237
- curiosity?: Partial<CuriosityConfig>;
238
- budget?: Partial<BudgetConfig>;
239
- llm?: {
240
- model?: string;
241
- temperature?: number;
242
- max_tokens?: number;
243
- system_prompt?: string;
244
- };
245
- custom?: Record<string, unknown>;
246
- }
247
- /**
248
- * Cycle metrics for lifespan tracking
249
- */
250
- interface CycleMetric {
251
- cycle_number: number;
252
- duration_ms: number;
253
- success: boolean;
254
- score: number;
255
- timestamp: number;
256
- }
257
- /**
258
- * Agent lifespan context - tracks evolution across cycles
259
- */
260
- interface AgentLifespanContext {
261
- total_cycles_completed: number;
262
- evolution_level: number;
263
- performance_trend: 'improving' | 'stable' | 'declining';
264
- average_cycle_duration: number;
265
- recent_metrics: CycleMetric[];
266
- knowledge_growth_trajectory: number;
267
- adaptation_score: number;
268
- related_tasks: string[];
269
- }
270
- /**
271
- * Assistant-specific lifespan context (e.g., Brittney)
272
- */
273
- interface AssistantLifespanContext {
274
- total_interactions: number;
275
- training_data_processed: number;
276
- personality_evolution: {
277
- emotional_responsiveness: number;
278
- communication_style: string[];
279
- user_preferences: Record<string, unknown>;
280
- };
281
- desktop_environment_memory: {
282
- frequent_apps: string[];
283
- window_arrangement_patterns: string[];
284
- user_workflows: string[];
285
- last_active_session_id?: string;
286
- };
287
- conversation_history: unknown[];
288
- }
289
- /**
290
- * Complete agent state
291
- */
292
- interface AgentState {
293
- agent_id: string;
294
- current_phase: AgentPhase;
295
- phase_start_time: number;
296
- cycle_number: number;
297
- knowledge: Map<string, unknown>;
298
- patterns: unknown[];
299
- wisdom: unknown[];
300
- gotchas: unknown[];
301
- reflection_context: Record<string, unknown>;
302
- execution_result: unknown;
303
- compressed_knowledge: string;
304
- metrics: {
305
- phases_completed: number;
306
- total_cycles: number;
307
- efficiency_score: number;
308
- token_usage: number;
309
- };
310
- lifespan?: AgentLifespanContext;
311
- assistant_lifespan?: AssistantLifespanContext;
312
- is_training_mode: boolean;
313
- is_shutting_down: boolean;
314
- }
315
- /**
316
- * Message priority levels
317
- */
318
- type MessagePriority = 'low' | 'medium' | 'high' | 'critical' | 'sovereign';
319
- /**
320
- * Inter-agent message
321
- */
322
- interface AgentMessage {
323
- id: string;
324
- from: string;
325
- to: string | 'broadcast';
326
- type: 'request' | 'response' | 'notification' | 'event';
327
- action: string;
328
- payload: Record<string, unknown>;
329
- priority: MessagePriority;
330
- timestamp: number;
331
- correlation_id?: string;
332
- ttl_ms?: number;
333
- }
334
- /**
335
- * Agent response
336
- */
337
- interface AgentResponse {
338
- message_id: string;
339
- success: boolean;
340
- data?: unknown;
341
- error?: string;
342
- duration_ms: number;
343
- }
344
- /**
345
- * Pattern entry for knowledge base
346
- */
347
- interface PatternEntry {
348
- pattern_id: string;
349
- name: string;
350
- domain: string;
351
- description: string;
352
- template: string;
353
- confidence: number;
354
- usage_count: number;
355
- created_at: string;
356
- updated_at: string;
357
- tags: string[];
358
- }
359
- /**
360
- * Wisdom entry for knowledge base
361
- */
362
- interface WisdomEntry {
363
- wisdom_id: string;
364
- content: string;
365
- domain: string;
366
- source: string;
367
- confidence: number;
368
- citations: string[];
369
- created_at: string;
370
- tags: string[];
371
- }
372
- /**
373
- * Gotcha entry for knowledge base
374
- */
375
- interface GotchaEntry {
376
- gotcha_id: string;
377
- trigger: string;
378
- consequence: string;
379
- avoidance: string;
380
- domain: string;
381
- severity: 'low' | 'medium' | 'high' | 'critical';
382
- occurrence_count: number;
383
- created_at: string;
384
- tags: string[];
385
- }
386
- /**
387
- * Agent-specific trait context
388
- */
389
- interface AgentTraitContext {
390
- agent_id: string;
391
- agent_name: string;
392
- agent_type: string;
393
- current_phase: AgentPhase;
394
- phase_history: AgentPhase[];
395
- getKnowledge: (key: string) => unknown;
396
- setKnowledge: (key: string, value: unknown) => void;
397
- queryKnowledge: (query: string) => Promise<unknown[]>;
398
- sendMessage: (to: string, action: string, payload: unknown) => Promise<AgentResponse>;
399
- broadcast: (action: string, payload: unknown) => Promise<void>;
400
- callAI: (options: {
401
- prompt: string;
402
- context?: Record<string, unknown>;
403
- model?: string;
404
- temperature?: number;
405
- max_tokens?: number;
406
- }) => Promise<{
407
- text: string;
408
- tokens_used: number;
409
- }>;
410
- transitionTo: (phase: AgentPhase) => void;
411
- skipPhase: (phase: AgentPhase) => void;
412
- repeatPhase: () => void;
413
- recordMetric: (name: string, value: number) => void;
414
- getMetrics: () => Record<string, number>;
415
- log: (level: 'debug' | 'info' | 'warn' | 'error', message: string, data?: unknown) => void;
416
- wallet?: {
417
- getBalance: (asset?: string) => Promise<number>;
418
- pay: (endpoint: string, amount: number, asset: string) => Promise<{
419
- success: boolean;
420
- txHash?: string;
421
- }>;
422
- trade: (from: string, to: string, amount: number) => Promise<{
423
- success: boolean;
424
- txHash?: string;
425
- }>;
426
- mintNFT: (metadata: Record<string, any>) => Promise<{
427
- success: boolean;
428
- tokenId?: string;
429
- }>;
430
- };
431
- story_weaver?: {
432
- generateNarrative: (context: Record<string, unknown>) => Promise<string>;
433
- createWorld: (theme: string) => Promise<string>;
434
- deployContracts: (worldId: string) => Promise<boolean>;
435
- };
436
- }
437
-
438
- /**
439
- * @holoscript/core - Agent Manifest Definitions
440
- *
441
- * Defines the structure for agent registration and capability declaration.
442
- * Part of HoloScript v3.1 Agentic Choreography.
443
- */
444
-
445
- /**
446
- * Resource cost for executing a capability
447
- */
448
- interface ResourceCost {
449
- /** Estimated compute cost (0-100 scale) */
450
- compute: number;
451
- /** Estimated memory usage (0-100 scale) */
452
- memory: number;
453
- /** Estimated network usage (0-100 scale) */
454
- network: number;
455
- /** Token cost for LLM operations (if applicable) */
456
- tokens?: number;
457
- }
458
- /**
459
- * Latency profile for a capability
460
- */
461
- type LatencyProfile = 'instant' | 'fast' | 'medium' | 'slow' | 'background';
462
- /**
463
- * Latency thresholds in milliseconds
464
- */
465
- declare const LATENCY_THRESHOLDS: Record<LatencyProfile, number>;
466
- /**
467
- * Capability types that agents can provide
468
- */
469
- type CapabilityType = 'render' | 'analyze' | 'generate' | 'approve' | 'detect' | 'transform' | 'store' | 'retrieve' | 'communicate' | 'orchestrate' | 'validate' | 'optimize' | 'custom';
470
- /**
471
- * Capability domains
472
- */
473
- type CapabilityDomain = 'vision' | 'nlp' | 'spatial' | 'blockchain' | 'audio' | 'video' | 'physics' | 'networking' | 'storage' | 'security' | 'trading' | 'social' | 'gaming' | 'general';
474
- /**
475
- * Single agent capability
476
- */
477
- interface AgentCapability {
478
- /** Capability type identifier */
479
- type: CapabilityType | string;
480
- /** Domain the capability operates in */
481
- domain: CapabilityDomain | string;
482
- /** Unique capability identifier */
483
- id?: string;
484
- /** Human-readable name */
485
- name?: string;
486
- /** Description of what this capability does */
487
- description?: string;
488
- /** Resource cost profile */
489
- cost?: Partial<ResourceCost>;
490
- /** Expected latency */
491
- latency?: LatencyProfile;
492
- /** Capability version */
493
- version?: string;
494
- /** Required input types */
495
- inputs?: string[];
496
- /** Output type */
497
- output?: string;
498
- /** Whether this capability is currently available */
499
- available?: boolean;
500
- /** Priority for conflict resolution (higher = preferred) */
501
- priority?: number;
502
- /** Custom metadata */
503
- metadata?: Record<string, unknown>;
504
- }
505
- /**
506
- * Endpoint protocol types
507
- */
508
- type EndpointProtocol = 'local' | 'ipc' | 'http' | 'https' | 'ws' | 'wss' | 'grpc' | 'mqtt' | 'custom';
509
- /**
510
- * Agent communication endpoint
511
- */
512
- interface AgentEndpoint {
513
- /** Endpoint protocol */
514
- protocol: EndpointProtocol;
515
- /** Endpoint address (URL, IPC path, etc.) */
516
- address: string;
517
- /** Endpoint port (if applicable) */
518
- port?: number;
519
- /** Whether this is the primary endpoint */
520
- primary?: boolean;
521
- /** Health check path (if applicable) */
522
- healthPath?: string;
523
- /** Authentication required */
524
- authRequired?: boolean;
525
- /** Supported message formats */
526
- formats?: Array<'json' | 'msgpack' | 'protobuf' | 'custom'>;
527
- }
528
- /**
529
- * 3D Vector for spatial definitions
530
- */
531
- interface Vector3 {
532
- x: number;
533
- y: number;
534
- z: number;
535
- }
536
- /**
537
- * Bounding box for spatial agents
538
- */
539
- interface BoundingBox {
540
- /** Minimum point (corner) */
541
- min: Vector3;
542
- /** Maximum point (opposite corner) */
543
- max: Vector3;
544
- /** Coordinate system reference */
545
- coordinateSystem?: 'world' | 'local' | 'scene';
546
- }
547
- /**
548
- * Spatial scope for agents
549
- */
550
- interface SpatialScope {
551
- /** Bounding box if defined */
552
- bounds?: BoundingBox;
553
- /** Named scene/world */
554
- scene?: string;
555
- /** Specific node IDs this agent operates on */
556
- nodes?: string[];
557
- /** Radius from a center point */
558
- radius?: {
559
- center: Vector3;
560
- distance: number;
561
- };
562
- /** Whether agent can operate outside its spatial scope */
563
- global?: boolean;
564
- }
565
- /**
566
- * Trust level for agents
567
- */
568
- type TrustLevel = 'local' | 'verified' | 'known' | 'external' | 'untrusted';
569
- /**
570
- * Verification status
571
- */
572
- interface VerificationStatus {
573
- /** Whether the agent is verified */
574
- verified: boolean;
575
- /** Verification method used */
576
- method?: 'signature' | 'certificate' | 'oauth' | 'token' | 'manual';
577
- /** When verification was performed */
578
- verifiedAt?: number;
579
- /** When verification expires */
580
- expiresAt?: number;
581
- /** Verifying authority */
582
- authority?: string;
583
- /** Verification signature/proof */
584
- proof?: string;
585
- }
586
- /**
587
- * Complete agent manifest for registration
588
- */
589
- interface AgentManifest {
590
- /** Unique agent identifier */
591
- id: string;
592
- /** Human-readable agent name */
593
- name: string;
594
- /** Agent version (semver) */
595
- version: string;
596
- /** Agent description */
597
- description?: string;
598
- /** Agent categories */
599
- categories?: AgentCategory[];
600
- /** Position in architecture */
601
- position?: AgentPosition;
602
- /** Orchestral section */
603
- section?: AgentSection;
604
- /** Custom tags for filtering */
605
- tags?: string[];
606
- /** List of capabilities this agent provides */
607
- capabilities: AgentCapability[];
608
- /** Available endpoints for communication */
609
- endpoints: AgentEndpoint[];
610
- /** Spatial scope this agent operates in */
611
- spatialScope?: SpatialScope;
612
- /** Trust level */
613
- trustLevel: TrustLevel;
614
- /** Verification status */
615
- verification?: VerificationStatus;
616
- /** Health check interval in ms */
617
- healthCheckInterval?: number;
618
- /** Last heartbeat timestamp */
619
- lastHeartbeat?: number;
620
- /** Current health status */
621
- status?: 'online' | 'offline' | 'degraded' | 'unknown';
622
- /** Registration timestamp */
623
- registeredAt?: number;
624
- /** Last updated timestamp */
625
- updatedAt?: number;
626
- /** Owner/creator identifier */
627
- owner?: string;
628
- /** Source repository/package */
629
- source?: string;
630
- /** Custom metadata */
631
- metadata?: Record<string, unknown>;
632
- }
633
- /**
634
- * Fluent builder for creating agent manifests
635
- */
636
- declare class AgentManifestBuilder {
637
- private manifest;
638
- /**
639
- * Set agent identity
640
- */
641
- identity(id: string, name: string, version: string): this;
642
- /**
643
- * Set agent description
644
- */
645
- description(desc: string): this;
646
- /**
647
- * Set classification
648
- */
649
- classify(categories: AgentCategory[], position?: AgentPosition, section?: AgentSection): this;
650
- /**
651
- * Add a capability
652
- */
653
- addCapability(capability: AgentCapability): this;
654
- /**
655
- * Add multiple capabilities
656
- */
657
- addCapabilities(capabilities: AgentCapability[]): this;
658
- /**
659
- * Add an endpoint
660
- */
661
- addEndpoint(endpoint: AgentEndpoint): this;
662
- /**
663
- * Set spatial scope
664
- */
665
- spatial(scope: SpatialScope): this;
666
- /**
667
- * Set trust level
668
- */
669
- trust(level: TrustLevel, verification?: VerificationStatus): this;
670
- /**
671
- * Set health check interval
672
- */
673
- healthCheck(intervalMs: number): this;
674
- /**
675
- * Add custom tags
676
- */
677
- tags(...tags: string[]): this;
678
- /**
679
- * Set metadata
680
- */
681
- metadata(data: Record<string, unknown>): this;
682
- /**
683
- * Build the manifest
684
- */
685
- build(): AgentManifest;
686
- }
687
- /**
688
- * Create a new manifest builder
689
- */
690
- declare function createManifest(): AgentManifestBuilder;
691
- /**
692
- * Validation result
693
- */
694
- interface ValidationResult {
695
- valid: boolean;
696
- errors: string[];
697
- warnings: string[];
698
- }
699
- /**
700
- * Validate an agent manifest
701
- */
702
- declare function validateManifest(manifest: Partial<AgentManifest>): ValidationResult;
703
-
704
- export { type AgentManifest as A, type BoundingBox as B, type CapabilityType as C, DEFAULT_PHASE_TIMINGS as D, type EndpointProtocol as E, LATENCY_THRESHOLDS as F, type GotchaEntry as G, type PatternEntry as H, type IntakeResult as I, type PhaseConfig as J, type PhaseResult as K, type LatencyProfile as L, type MessagePriority as M, type ReintakeResult as N, type ResourceCost as O, PHASE_ORDER as P, type VerificationStatus as Q, type ReflectResult as R, type SpatialScope as S, type TrustLevel as T, createManifest as U, type Vector3 as V, type WisdomEntry as W, validateManifest as X, type AgentCapability as a, type CapabilityDomain as b, type AgentCategory as c, type AgentConfig as d, type AgentEndpoint as e, type AgentLifespanContext as f, AgentManifestBuilder as g, type AgentMessage as h, type AgentPhase as i, type AgentPosition as j, type AgentResponse as k, type AgentSection as l, type AgentState as m, type AgentTraitContext as n, type ValidationResult as o, type AnyPhaseResult as p, type ArchitectureAwareness as q, type AssistantLifespanContext as r, type BudgetConfig as s, type CompressResult as t, type CuriosityConfig as u, type CycleMetric as v, type CycleResult as w, type EvolveResult as x, type ExecuteResult as y, type GrowResult as z };