HoloScript Core Build Issues
Created: 2026-02-09
Updated: 2026-02-09
Status: Partially Resolved
Priority: Medium
Affects: @holoscript/core package tsc declaration generation
Summary
The @holoscript/core package bundling works (ESM + CJS via tsup), but tsc declaration generation has ~30 remaining TypeScript errors. All 4,746 unit tests pass.
Current Status
| Component | Status |
|---|---|
| ESM Bundle | ✅ Builds successfully |
| CJS Bundle | ✅ Builds successfully |
| Unit Tests | ✅ 4,746 passing, 5 skipped |
| Type Declarations | ⚠️ ~30 errors remain |
Recent Fixes Applied
✅ WebGPU Types (Fixed)
- Issue: 184 errors for missing GPU* types (GPUDevice, GPUBuffer, GPUTexture, etc.)
- Fix: Added
@webgpu/types@^0.1.40to devDependencies and"types": ["@webgpu/types"]to tsconfig.json - Result: Reduced errors from 324 → 140
✅ Audio Module Types (Fixed)
- Added
SpatialModel,RolloffType,LoopMode,SequencerStatetypes - Added
IEqualizerBand,IEqualizerEffect,ISpatialEffect,IAudioBus,ISequencerConfig,IPatternRefinterfaces - Extended
EffectTypeandAudioEventTypeunions - Fixed
createPattern,createNotehelper functions
✅ WebGPU Buffer Types (Fixed)
- Added type assertions for
writeBuffercalls in WebGPURenderer.ts
✅ ShaderGraph Serialization (Fixed)
- Created
ISerializedShaderGraphinterface - Updated
toJSONreturn type andfromJSONparameter type
✅ Swarm Module (Fixed)
- Updated
ICollectiveIntelligenceServiceinterface to match implementation - Fixed
IHiveContribution.contenttype fromunknowntostring - Added
convergedanditerationstorefineWithACOreturn type
✅ Messaging Types (Fixed)
- Added
MessageAckStatustype and updatedMessageAckinterface - Extended
MessagePriorityto include string aliases
✅ TraitBehavior (Added)
- Created
TraitBehaviorinterface intypes/index.ts
Remaining Issues (~30 Errors)
Export Conflicts in index.ts
Multiple modules export the same symbols:
HeartbeatMessage(hololand, negotiation)Vote,VotingResult(negotiation)IVector3,IQuaternion,zeroVector(physics)ConnectionState,createMessage(hololand, physics)MessageHandler(swarm)
Fix: Use explicit named exports instead of export *
AgentManifest/AgentCapability Export
AgentTypes.ts uses export default but files try to import as named export.
Message Interface Properties
AgentMessaging.ts uses recipientId and channelId not in interface
BinarySerializer Types
ArrayBuffer | SharedArrayBufferassignment issueIMeshPrimitiveattributes type mismatch
Action Items
- [ ] Resolve export conflicts in
src/index.ts - [ ] Fix
AgentTypes.tsexport pattern - [ ] Extend
Messageinterface with missing properties - [ ] Fix
BinarySerializertype assertions
ISequencerConfig- interface not exportedIPatternRef- interface not defined
Property Mismatches:
IDelayEffectmissingtimepropertyINotemissingstartpropertyIPatternmissinglength,looppropertiesITrackmissingsourceIdpropertyISequencemissingpatternOrder,timeSignature,loopproperties
Suggested Fix:
- Audit
AudioTypes.tsinterface definitions - Add missing exports to
index.ts - Align interface properties with usage
Shader Module (~7 errors)
File: src/shader/graph/ShaderGraph.ts
Issues:
- Line 454:
'id' is specified more than once- spread operator overwrites property - Lines 465-468: Type assertion on
jsonobject missingname,id,description,version,metadata,connectionsproperties
Suggested Fix:
// Line 454-455: Remove duplicate id
const nodeWithId = {
...node,
// id already in node, don't duplicate
};
// Line 465: Add type assertion
interface ShaderGraphJSON {
name: string;
id?: string;
description?: string;
version?: string;
metadata?: unknown;
nodes: IShaderNode[];
connections?: unknown[];
}
const graph = new ShaderGraph((json as ShaderGraphJSON).name, (json as ShaderGraphJSON).id);Swarm Module (~12 errors)
Files:
src/swarm/CollectiveIntelligence.tssrc/swarm/ContributionSynthesizer.tssrc/swarm/SwarmCoordinator.ts
Issues:
- Method signatures don't match
ICollectiveIntelligenceServiceinterface - Methods return sync values but interface expects
Promise<T>
Misaligned Methods:
| Method | Interface | Implementation |
|---|---|---|
createSession | Promise<string> | IHiveSession |
join | Promise<void> | void |
leave | Promise<void> | void |
contribute | Promise<void> | IHiveContribution |
vote | 3 params | 4 params |
synthesize | Promise<unknown> | SynthesisResult |
resolve | Promise<void> | void |
Suggested Fix: Either update interface to match implementation or wrap returns in Promise.resolve().
Other Modules (~46 errors)
Files with type issues:
src/consensus/RaftConsensus.ts- 1 errorsrc/debug/AgentDebugger.ts- 1 errorsrc/debug/AgentInspector.ts- 2 errorssrc/debug/TelemetryCollector.ts- 1 errorsrc/export/BinarySerializer.ts- 2 errorssrc/export/SceneSerializer.ts- 1 errorsrc/hierarchy/AgentHierarchy.ts- 2 errorssrc/hierarchy/DelegationEngine.ts- 1 errorsrc/hierarchy/HierarchyTypes.ts- 2 errorssrc/index.ts- 10 errors (missing exports)src/messaging/AgentMessaging.ts- 16 errorssrc/messaging/MessagingTrait.ts- 3 errorssrc/render/postprocess/index.ts- 3 errorssrc/render/postprocess/PostProcessEffect.ts- 48 errorssrc/render/postprocess/PostProcessPipeline.ts- 17 errorssrc/render/postprocess/PostProcessTypes.ts- 14 errors
Build Success Prerequisites
To achieve a clean build:
Audio Module Refactor (Highest Priority)
- Define all missing interfaces
- Export all types from index
- Align property names
Swarm Module Async Alignment
- Update implementations to match interface contracts
- Add async/await where needed
Shader Graph Type Safety
- Add proper JSON type for deserialization
- Fix spread operator duplicate key
PostProcess Module
- Complete WebGPU integration types
- Fix effect type definitions
Test Status
| Suite | Status | Notes |
|---|---|---|
| Unit Tests (vitest) | ✅ 4700+ passing | Works without dist |
| Puppeteer Tests | ✅ 34/34 passing | New feature complete |
| MCP Server E2E | ✅ Passing | No core dependency |
| Live Integration | ❌ Blocked | Requires dist build |
| tree-sitter | ❌ Skipped | CLI not installed |
Workaround
For development, tests can be run directly via vitest without building:
pnpm --filter @holoscript/core testThe tsup bundler successfully creates ESM/CJS bundles (Build success in 9061ms), but tsc declaration generation fails.
Action Items
- [ ] Fix audio module type definitions
- [ ] Align swarm module with interface contracts
- [ ] Add ShaderGraph JSON type assertion
- [ ] Complete postprocess module types
- [ ] Re-run full build
- [ ] Enable live integration tests