feat(core): add command, intent, and routing primitives

This commit is contained in:
William Valentin
2026-02-12 22:47:22 -08:00
parent 7ae0fb51c2
commit 6e8984f788
25 changed files with 1469 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { describe, it, expect } from 'vitest';
import { SessionIndexer, tokenize } from './indexer.js';
describe('session indexer', () => {
it('tokenizes text with stopword filtering', () => {
const tokens = tokenize('Deploy the backend service to production and verify logs');
expect(tokens).toContain('deploy');
expect(tokens).toContain('backend');
expect(tokens).toContain('service');
expect(tokens).not.toContain('the');
});
it('extracts top keywords and topics', () => {
const indexer = new SessionIndexer({ maxKeywords: 5 });
const metadata = indexer.indexText('deploy deploy backend service backend api release');
expect(metadata.keywords.length).toBeLessThanOrEqual(5);
expect(metadata.keywords).toContain('deploy');
expect(metadata.topics.length).toBeLessThanOrEqual(3);
});
});