packages/whenm/
├── src/ # Core source files
│ ├── index.ts # Main entry point & exports
│ ├── final-engine.ts # Unified schemaless engine (main implementation)
│ ├── llm-powered-engine.ts # LLM-powered schemaless engine
│ ├── proxy-entity.ts # Dynamic property access via Proxy
│ ├── truly-schemaless-v2.ts # Zero-mapping schemaless engine
│ ├── unix-time-engine.ts # Millisecond precision temporal engine
│ ├── unified-api.ts # Unified API layer
│ ├── entity-api.ts # Entity manipulation API
│ ├── prolog-parser.ts # Prolog query parser
│ ├── nlp-parser.ts # Natural language parser
│ ├── simple-api.ts # Simplified API
│ ├── smart-assert.ts # Intelligent assertions
│ ├── persistence.ts # D1 persistence layer
│ ├── tools.ts # Utility functions
│ └── _experimental/ # Experimental implementations (archived)
│ ├── schemaless-engine.ts
│ ├── llm-schemaless.ts
│ ├── kuromoji-schemaless.ts
│ ├── truly-schemaless.ts
│ ├── locale-strategy.ts
│ ├── sliding-window.ts
│ └── time-precision.ts
│
├── examples/ # Example code & tests
│ ├── tests/ # Primary test examples
│ │ ├── 01-unified-engine.js # Main unified engine test
│ │ ├── 02-llm-powered.js # LLM-powered engine test
│ │ ├── 03-llm-real-api.js # Real API integration test
│ │ ├── 04-truly-schemaless.js # Zero-mapping engine test
│ │ └── 05-basic-schemaless.js # Basic schemaless test
│ │
│ └── _experimental/ # Experimental tests (archived)
│ ├── test-comprehensive-comparison.js
│ ├── test-final-analysis.js
│ ├── test-llm-schemaless.js
│ ├── test-minimal.js
│ ├── test-no-preset.js
│ ├── test-prolog-debug.js
│ ├── test-schemaless-debug.js
│ ├── test-schemaless-deep.js
│ └── test-truly-schemaless.js
│
├── prolog/ # Prolog rules & Event Calculus
│ └── ec.pl # Event Calculus core rules
│
├── benchmarks/ # Performance benchmarks
│ └── ...
│
├── dist/ # Compiled JavaScript output
│ └── ...
│
├── README.md # User-facing documentation
├── README-old.md # Previous version documentation
├── PROJECT_STRUCTURE.md # This file
├── package.json # Package configuration
├── tsconfig.json # TypeScript configuration
└── vitest.config.ts # Test configuration
final-engine.ts- The unified schemaless engine that combines all approaches- Integrates with UniLLM for multiple LLM providers
- Dynamic verb learning
- ProxyEntity support
- Knowledge export capability
llm-powered-engine.ts- LLM-based natural language processingtruly-schemaless-v2.ts- Pure schemaless with zero predefined mappingsproxy-entity.ts- Dynamic property access without schemaunix-time-engine.ts- High-precision temporal operations
Tests are numbered for recommended execution order:
01-unified-engine.js- Complete unified engine functionality02-llm-powered.js- LLM integration with mock provider03-llm-real-api.js- Real API integration (requires API key)04-truly-schemaless.js- Zero-mapping implementation05-basic-schemaless.js- Basic schemaless operations
# Run main unified engine test
node examples/tests/01-unified-engine.js
# Run with real API (requires GROQ_API_KEY)
GROQ_API_KEY=your_key node examples/tests/03-llm-real-api.jsFiles in _experimental directories are previous iterations kept for reference but not part of the main implementation:
- Different schemaless approaches (NLP-based, Kuromoji, etc.)
- Performance experiments
- Alternative implementations
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run tests
npm test
# Run specific test
node examples/tests/01-unified-engine.js- Schemaless Operation - No predefined verb mappings or schemas required
- Dynamic Learning - Learns new verbs and concepts on the fly
- Temporal Reasoning - Event Calculus for time-based logic
- Multi-Language - Works with Japanese, English, or any language
- LLM Integration - Uses LLMs for natural language understanding
If upgrading from schema-based version:
- Use
createUnifiedEngine()instead ofcreateWhenM() - Remove all schema.ts dependencies
- No need to define verb mappings
- Works immediately with any language/domain