@soleri/forge 5.1.3 → 5.4.0
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/dist/index.js +0 -0
- package/dist/scaffolder.js +150 -2
- package/dist/scaffolder.js.map +1 -1
- package/dist/templates/brain.d.ts +6 -0
- package/dist/templates/brain.js +478 -0
- package/dist/templates/brain.js.map +1 -0
- package/dist/templates/claude-md-template.js +90 -1
- package/dist/templates/claude-md-template.js.map +1 -1
- package/dist/templates/core-facade.d.ts +6 -0
- package/dist/templates/core-facade.js +564 -0
- package/dist/templates/core-facade.js.map +1 -0
- package/dist/templates/domain-facade.d.ts +4 -0
- package/dist/templates/domain-facade.js +4 -0
- package/dist/templates/domain-facade.js.map +1 -1
- package/dist/templates/entry-point.js +32 -0
- package/dist/templates/entry-point.js.map +1 -1
- package/dist/templates/facade-factory.d.ts +1 -0
- package/dist/templates/facade-factory.js +63 -0
- package/dist/templates/facade-factory.js.map +1 -0
- package/dist/templates/facade-types.d.ts +1 -0
- package/dist/templates/facade-types.js +46 -0
- package/dist/templates/facade-types.js.map +1 -0
- package/dist/templates/intelligence-loader.d.ts +1 -0
- package/dist/templates/intelligence-loader.js +43 -0
- package/dist/templates/intelligence-loader.js.map +1 -0
- package/dist/templates/intelligence-types.d.ts +1 -0
- package/dist/templates/intelligence-types.js +24 -0
- package/dist/templates/intelligence-types.js.map +1 -0
- package/dist/templates/llm-client.d.ts +7 -0
- package/dist/templates/llm-client.js +300 -0
- package/dist/templates/llm-client.js.map +1 -0
- package/dist/templates/llm-key-pool.d.ts +7 -0
- package/dist/templates/llm-key-pool.js +211 -0
- package/dist/templates/llm-key-pool.js.map +1 -0
- package/dist/templates/llm-types.d.ts +5 -0
- package/dist/templates/llm-types.js +161 -0
- package/dist/templates/llm-types.js.map +1 -0
- package/dist/templates/llm-utils.d.ts +5 -0
- package/dist/templates/llm-utils.js +260 -0
- package/dist/templates/llm-utils.js.map +1 -0
- package/dist/templates/planner.d.ts +5 -0
- package/dist/templates/planner.js +150 -0
- package/dist/templates/planner.js.map +1 -0
- package/dist/templates/setup-script.js +26 -1
- package/dist/templates/setup-script.js.map +1 -1
- package/dist/templates/test-brain.d.ts +6 -0
- package/dist/templates/test-brain.js +474 -0
- package/dist/templates/test-brain.js.map +1 -0
- package/dist/templates/test-facades.js +173 -3
- package/dist/templates/test-facades.js.map +1 -1
- package/dist/templates/test-llm.d.ts +7 -0
- package/dist/templates/test-llm.js +574 -0
- package/dist/templates/test-llm.js.map +1 -0
- package/dist/templates/test-loader.d.ts +5 -0
- package/dist/templates/test-loader.js +146 -0
- package/dist/templates/test-loader.js.map +1 -0
- package/dist/templates/test-planner.d.ts +5 -0
- package/dist/templates/test-planner.js +271 -0
- package/dist/templates/test-planner.js.map +1 -0
- package/dist/templates/test-vault.d.ts +5 -0
- package/dist/templates/test-vault.js +380 -0
- package/dist/templates/test-vault.js.map +1 -0
- package/dist/templates/vault.d.ts +5 -0
- package/dist/templates/vault.js +263 -0
- package/dist/templates/vault.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/scaffolder.test.ts +2 -2
- package/src/scaffolder.ts +153 -2
- package/src/templates/claude-md-template.ts +181 -0
- package/src/templates/domain-facade.ts +4 -0
- package/src/templates/entry-point.ts +32 -0
- package/src/templates/setup-script.ts +28 -1
- package/src/templates/test-facades.ts +173 -3
- package/src/types.ts +2 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates the vault.ts source file for a new agent.
|
|
3
|
+
* The vault provides SQLite-backed knowledge storage with FTS5 search.
|
|
4
|
+
*/
|
|
5
|
+
export function generateVault() {
|
|
6
|
+
// The vault template is stored as a static string to avoid
|
|
7
|
+
// template literal escaping issues with nested backticks.
|
|
8
|
+
return VAULT_TEMPLATE;
|
|
9
|
+
}
|
|
10
|
+
const VAULT_TEMPLATE = [
|
|
11
|
+
"import Database from 'better-sqlite3';",
|
|
12
|
+
"import { mkdirSync } from 'node:fs';",
|
|
13
|
+
"import { dirname } from 'node:path';",
|
|
14
|
+
"import type { IntelligenceEntry } from '../intelligence/types.js';",
|
|
15
|
+
'',
|
|
16
|
+
'export interface SearchResult { entry: IntelligenceEntry; score: number; }',
|
|
17
|
+
'export interface VaultStats { totalEntries: number; byType: Record<string, number>; byDomain: Record<string, number>; bySeverity: Record<string, number>; }',
|
|
18
|
+
'export interface ProjectInfo { path: string; name: string; registeredAt: number; lastSeenAt: number; sessionCount: number; }',
|
|
19
|
+
"export interface Memory { id: string; projectPath: string; type: 'session' | 'lesson' | 'preference'; context: string; summary: string; topics: string[]; filesModified: string[]; toolsUsed: string[]; createdAt: number; archivedAt: number | null; }",
|
|
20
|
+
'export interface MemoryStats { total: number; byType: Record<string, number>; byProject: Record<string, number>; }',
|
|
21
|
+
'',
|
|
22
|
+
'export class Vault {',
|
|
23
|
+
' private db: Database.Database;',
|
|
24
|
+
'',
|
|
25
|
+
" constructor(dbPath: string = ':memory:') {",
|
|
26
|
+
" if (dbPath !== ':memory:') mkdirSync(dirname(dbPath), { recursive: true });",
|
|
27
|
+
' this.db = new Database(dbPath);',
|
|
28
|
+
" this.db.pragma('journal_mode = WAL');",
|
|
29
|
+
" this.db.pragma('foreign_keys = ON');",
|
|
30
|
+
' this.initialize();',
|
|
31
|
+
' }',
|
|
32
|
+
'',
|
|
33
|
+
' private initialize(): void {',
|
|
34
|
+
' this.db.exec(`',
|
|
35
|
+
' CREATE TABLE IF NOT EXISTS entries (',
|
|
36
|
+
' id TEXT PRIMARY KEY,',
|
|
37
|
+
" type TEXT NOT NULL CHECK(type IN ('pattern', 'anti-pattern', 'rule')),",
|
|
38
|
+
' domain TEXT NOT NULL,',
|
|
39
|
+
' title TEXT NOT NULL,',
|
|
40
|
+
" severity TEXT NOT NULL CHECK(severity IN ('critical', 'warning', 'suggestion')),",
|
|
41
|
+
' description TEXT NOT NULL,',
|
|
42
|
+
' context TEXT, example TEXT, counter_example TEXT, why TEXT,',
|
|
43
|
+
" tags TEXT NOT NULL DEFAULT '[]',",
|
|
44
|
+
" applies_to TEXT DEFAULT '[]',",
|
|
45
|
+
' created_at INTEGER NOT NULL DEFAULT (unixepoch()),',
|
|
46
|
+
' updated_at INTEGER NOT NULL DEFAULT (unixepoch())',
|
|
47
|
+
' );',
|
|
48
|
+
' CREATE VIRTUAL TABLE IF NOT EXISTS entries_fts USING fts5(',
|
|
49
|
+
' id, title, description, context, tags,',
|
|
50
|
+
" content='entries', content_rowid='rowid', tokenize='porter unicode61'",
|
|
51
|
+
' );',
|
|
52
|
+
' CREATE TRIGGER IF NOT EXISTS entries_ai AFTER INSERT ON entries BEGIN',
|
|
53
|
+
' INSERT INTO entries_fts(rowid,id,title,description,context,tags) VALUES(new.rowid,new.id,new.title,new.description,new.context,new.tags);',
|
|
54
|
+
' END;',
|
|
55
|
+
' CREATE TRIGGER IF NOT EXISTS entries_ad AFTER DELETE ON entries BEGIN',
|
|
56
|
+
" INSERT INTO entries_fts(entries_fts,rowid,id,title,description,context,tags) VALUES('delete',old.rowid,old.id,old.title,old.description,old.context,old.tags);",
|
|
57
|
+
' END;',
|
|
58
|
+
' CREATE TRIGGER IF NOT EXISTS entries_au AFTER UPDATE ON entries BEGIN',
|
|
59
|
+
" INSERT INTO entries_fts(entries_fts,rowid,id,title,description,context,tags) VALUES('delete',old.rowid,old.id,old.title,old.description,old.context,old.tags);",
|
|
60
|
+
' INSERT INTO entries_fts(rowid,id,title,description,context,tags) VALUES(new.rowid,new.id,new.title,new.description,new.context,new.tags);',
|
|
61
|
+
' END;',
|
|
62
|
+
' CREATE TABLE IF NOT EXISTS projects (',
|
|
63
|
+
' path TEXT PRIMARY KEY,',
|
|
64
|
+
' name TEXT NOT NULL,',
|
|
65
|
+
' registered_at INTEGER NOT NULL DEFAULT (unixepoch()),',
|
|
66
|
+
' last_seen_at INTEGER NOT NULL DEFAULT (unixepoch()),',
|
|
67
|
+
' session_count INTEGER NOT NULL DEFAULT 1',
|
|
68
|
+
' );',
|
|
69
|
+
' CREATE TABLE IF NOT EXISTS memories (',
|
|
70
|
+
' id TEXT PRIMARY KEY,',
|
|
71
|
+
' project_path TEXT NOT NULL,',
|
|
72
|
+
" type TEXT NOT NULL CHECK(type IN ('session', 'lesson', 'preference')),",
|
|
73
|
+
' context TEXT NOT NULL,',
|
|
74
|
+
' summary TEXT NOT NULL,',
|
|
75
|
+
" topics TEXT NOT NULL DEFAULT '[]',",
|
|
76
|
+
" files_modified TEXT NOT NULL DEFAULT '[]',",
|
|
77
|
+
" tools_used TEXT NOT NULL DEFAULT '[]',",
|
|
78
|
+
' created_at INTEGER NOT NULL DEFAULT (unixepoch()),',
|
|
79
|
+
' archived_at INTEGER',
|
|
80
|
+
' );',
|
|
81
|
+
' CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(',
|
|
82
|
+
' id, context, summary, topics,',
|
|
83
|
+
" content='memories', content_rowid='rowid', tokenize='porter unicode61'",
|
|
84
|
+
' );',
|
|
85
|
+
' CREATE TRIGGER IF NOT EXISTS memories_ai AFTER INSERT ON memories BEGIN',
|
|
86
|
+
' INSERT INTO memories_fts(rowid,id,context,summary,topics) VALUES(new.rowid,new.id,new.context,new.summary,new.topics);',
|
|
87
|
+
' END;',
|
|
88
|
+
' CREATE TRIGGER IF NOT EXISTS memories_ad AFTER DELETE ON memories BEGIN',
|
|
89
|
+
" INSERT INTO memories_fts(memories_fts,rowid,id,context,summary,topics) VALUES('delete',old.rowid,old.id,old.context,old.summary,old.topics);",
|
|
90
|
+
' END;',
|
|
91
|
+
' CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE ON memories BEGIN',
|
|
92
|
+
" INSERT INTO memories_fts(memories_fts,rowid,id,context,summary,topics) VALUES('delete',old.rowid,old.id,old.context,old.summary,old.topics);",
|
|
93
|
+
' INSERT INTO memories_fts(rowid,id,context,summary,topics) VALUES(new.rowid,new.id,new.context,new.summary,new.topics);',
|
|
94
|
+
' END;',
|
|
95
|
+
' CREATE TABLE IF NOT EXISTS brain_vocabulary (',
|
|
96
|
+
' term TEXT PRIMARY KEY,',
|
|
97
|
+
' idf REAL NOT NULL,',
|
|
98
|
+
' doc_count INTEGER NOT NULL DEFAULT 1,',
|
|
99
|
+
' updated_at INTEGER NOT NULL DEFAULT (unixepoch())',
|
|
100
|
+
' );',
|
|
101
|
+
' CREATE TABLE IF NOT EXISTS brain_feedback (',
|
|
102
|
+
' id INTEGER PRIMARY KEY AUTOINCREMENT,',
|
|
103
|
+
' query TEXT NOT NULL,',
|
|
104
|
+
' entry_id TEXT NOT NULL,',
|
|
105
|
+
" action TEXT NOT NULL CHECK(action IN ('accepted', 'dismissed')),",
|
|
106
|
+
' created_at INTEGER NOT NULL DEFAULT (unixepoch())',
|
|
107
|
+
' );',
|
|
108
|
+
' CREATE INDEX IF NOT EXISTS idx_brain_feedback_query ON brain_feedback(query);',
|
|
109
|
+
' `);',
|
|
110
|
+
' }',
|
|
111
|
+
'',
|
|
112
|
+
' seed(entries: IntelligenceEntry[]): number {',
|
|
113
|
+
' const upsert = this.db.prepare(`',
|
|
114
|
+
' INSERT INTO entries (id,type,domain,title,severity,description,context,example,counter_example,why,tags,applies_to)',
|
|
115
|
+
' VALUES (@id,@type,@domain,@title,@severity,@description,@context,@example,@counterExample,@why,@tags,@appliesTo)',
|
|
116
|
+
' ON CONFLICT(id) DO UPDATE SET type=excluded.type,domain=excluded.domain,title=excluded.title,severity=excluded.severity,',
|
|
117
|
+
' description=excluded.description,context=excluded.context,example=excluded.example,counter_example=excluded.counter_example,',
|
|
118
|
+
' why=excluded.why,tags=excluded.tags,applies_to=excluded.applies_to,updated_at=unixepoch()',
|
|
119
|
+
' `);',
|
|
120
|
+
' const tx = this.db.transaction((items: IntelligenceEntry[]) => {',
|
|
121
|
+
' let count = 0;',
|
|
122
|
+
' for (const entry of items) {',
|
|
123
|
+
' upsert.run({ id: entry.id, type: entry.type, domain: entry.domain, title: entry.title,',
|
|
124
|
+
' severity: entry.severity, description: entry.description, context: entry.context ?? null,',
|
|
125
|
+
' example: entry.example ?? null, counterExample: entry.counterExample ?? null,',
|
|
126
|
+
' why: entry.why ?? null, tags: JSON.stringify(entry.tags), appliesTo: JSON.stringify(entry.appliesTo ?? []) });',
|
|
127
|
+
' count++;',
|
|
128
|
+
' }',
|
|
129
|
+
' return count;',
|
|
130
|
+
' });',
|
|
131
|
+
' return tx(entries);',
|
|
132
|
+
' }',
|
|
133
|
+
'',
|
|
134
|
+
' search(query: string, options?: { domain?: string; type?: string; severity?: string; limit?: number }): SearchResult[] {',
|
|
135
|
+
' const limit = options?.limit ?? 10;',
|
|
136
|
+
' const filters: string[] = []; const fp: Record<string, string> = {};',
|
|
137
|
+
" if (options?.domain) { filters.push('e.domain = @domain'); fp.domain = options.domain; }",
|
|
138
|
+
" if (options?.type) { filters.push('e.type = @type'); fp.type = options.type; }",
|
|
139
|
+
" if (options?.severity) { filters.push('e.severity = @severity'); fp.severity = options.severity; }",
|
|
140
|
+
" const wc = filters.length > 0 ? `AND ${filters.join(' AND ')}` : '';",
|
|
141
|
+
' const rows = this.db.prepare(`SELECT e.*, -rank as score FROM entries_fts fts JOIN entries e ON e.rowid = fts.rowid WHERE entries_fts MATCH @query ${wc} ORDER BY score DESC LIMIT @limit`)',
|
|
142
|
+
' .all({ query, limit, ...fp }) as Array<Record<string, unknown>>;',
|
|
143
|
+
' return rows.map(rowToSearchResult);',
|
|
144
|
+
' }',
|
|
145
|
+
'',
|
|
146
|
+
' get(id: string): IntelligenceEntry | null {',
|
|
147
|
+
" const row = this.db.prepare('SELECT * FROM entries WHERE id = ?').get(id) as Record<string, unknown> | undefined;",
|
|
148
|
+
' return row ? rowToEntry(row) : null;',
|
|
149
|
+
' }',
|
|
150
|
+
'',
|
|
151
|
+
' list(options?: { domain?: string; type?: string; severity?: string; tags?: string[]; limit?: number; offset?: number }): IntelligenceEntry[] {',
|
|
152
|
+
' const filters: string[] = []; const params: Record<string, unknown> = {};',
|
|
153
|
+
" if (options?.domain) { filters.push('domain = @domain'); params.domain = options.domain; }",
|
|
154
|
+
" if (options?.type) { filters.push('type = @type'); params.type = options.type; }",
|
|
155
|
+
" if (options?.severity) { filters.push('severity = @severity'); params.severity = options.severity; }",
|
|
156
|
+
' if (options?.tags?.length) { const c = options.tags.map((t, i) => { params[`tag${i}`] = `%"${t}"%`; return `tags LIKE @tag${i}`; }); filters.push(`(${c.join(\' OR \')})`); }',
|
|
157
|
+
" const wc = filters.length > 0 ? `WHERE ${filters.join(' AND ')}` : '';",
|
|
158
|
+
' const rows = this.db.prepare(`SELECT * FROM entries ${wc} ORDER BY severity, domain, title LIMIT @limit OFFSET @offset`)',
|
|
159
|
+
' .all({ ...params, limit: options?.limit ?? 50, offset: options?.offset ?? 0 }) as Array<Record<string, unknown>>;',
|
|
160
|
+
' return rows.map(rowToEntry);',
|
|
161
|
+
' }',
|
|
162
|
+
'',
|
|
163
|
+
' stats(): VaultStats {',
|
|
164
|
+
" const total = (this.db.prepare('SELECT COUNT(*) as count FROM entries').get() as { count: number }).count;",
|
|
165
|
+
" return { totalEntries: total, byType: gc(this.db, 'type'), byDomain: gc(this.db, 'domain'), bySeverity: gc(this.db, 'severity') };",
|
|
166
|
+
' }',
|
|
167
|
+
'',
|
|
168
|
+
' add(entry: IntelligenceEntry): void { this.seed([entry]); }',
|
|
169
|
+
" remove(id: string): boolean { return this.db.prepare('DELETE FROM entries WHERE id = ?').run(id).changes > 0; }",
|
|
170
|
+
'',
|
|
171
|
+
' registerProject(path: string, name?: string): ProjectInfo {',
|
|
172
|
+
" const projectName = name ?? path.split('/').filter(Boolean).pop() ?? path;",
|
|
173
|
+
' const existing = this.getProject(path);',
|
|
174
|
+
' if (existing) {',
|
|
175
|
+
" this.db.prepare('UPDATE projects SET last_seen_at = unixepoch(), session_count = session_count + 1 WHERE path = ?').run(path);",
|
|
176
|
+
' return this.getProject(path)!;',
|
|
177
|
+
' }',
|
|
178
|
+
" this.db.prepare('INSERT INTO projects (path, name) VALUES (?, ?)').run(path, projectName);",
|
|
179
|
+
' return this.getProject(path)!;',
|
|
180
|
+
' }',
|
|
181
|
+
'',
|
|
182
|
+
' getProject(path: string): ProjectInfo | null {',
|
|
183
|
+
" const row = this.db.prepare('SELECT * FROM projects WHERE path = ?').get(path) as Record<string, unknown> | undefined;",
|
|
184
|
+
' if (!row) return null;',
|
|
185
|
+
' return { path: row.path as string, name: row.name as string, registeredAt: row.registered_at as number, lastSeenAt: row.last_seen_at as number, sessionCount: row.session_count as number };',
|
|
186
|
+
' }',
|
|
187
|
+
'',
|
|
188
|
+
' listProjects(): ProjectInfo[] {',
|
|
189
|
+
" const rows = this.db.prepare('SELECT * FROM projects ORDER BY last_seen_at DESC').all() as Array<Record<string, unknown>>;",
|
|
190
|
+
' return rows.map((row) => ({ path: row.path as string, name: row.name as string, registeredAt: row.registered_at as number, lastSeenAt: row.last_seen_at as number, sessionCount: row.session_count as number }));',
|
|
191
|
+
' }',
|
|
192
|
+
'',
|
|
193
|
+
" captureMemory(memory: Omit<Memory, 'id' | 'createdAt' | 'archivedAt'>): Memory {",
|
|
194
|
+
' const id = `mem-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;',
|
|
195
|
+
' this.db.prepare(`INSERT INTO memories (id, project_path, type, context, summary, topics, files_modified, tools_used) VALUES (@id, @projectPath, @type, @context, @summary, @topics, @filesModified, @toolsUsed)`)',
|
|
196
|
+
' .run({ id, projectPath: memory.projectPath, type: memory.type, context: memory.context, summary: memory.summary, topics: JSON.stringify(memory.topics), filesModified: JSON.stringify(memory.filesModified), toolsUsed: JSON.stringify(memory.toolsUsed) });',
|
|
197
|
+
' return this.getMemory(id)!;',
|
|
198
|
+
' }',
|
|
199
|
+
'',
|
|
200
|
+
' searchMemories(query: string, options?: { type?: string; projectPath?: string; limit?: number }): Memory[] {',
|
|
201
|
+
' const limit = options?.limit ?? 10;',
|
|
202
|
+
" const filters: string[] = ['m.archived_at IS NULL']; const fp: Record<string, unknown> = {};",
|
|
203
|
+
" if (options?.type) { filters.push('m.type = @type'); fp.type = options.type; }",
|
|
204
|
+
" if (options?.projectPath) { filters.push('m.project_path = @projectPath'); fp.projectPath = options.projectPath; }",
|
|
205
|
+
" const wc = filters.length > 0 ? `AND ${filters.join(' AND ')}` : '';",
|
|
206
|
+
' const rows = this.db.prepare(`SELECT m.* FROM memories_fts fts JOIN memories m ON m.rowid = fts.rowid WHERE memories_fts MATCH @query ${wc} ORDER BY rank LIMIT @limit`)',
|
|
207
|
+
' .all({ query, limit, ...fp }) as Array<Record<string, unknown>>;',
|
|
208
|
+
' return rows.map(rowToMemory);',
|
|
209
|
+
' }',
|
|
210
|
+
'',
|
|
211
|
+
' listMemories(options?: { type?: string; projectPath?: string; limit?: number; offset?: number }): Memory[] {',
|
|
212
|
+
" const filters: string[] = ['archived_at IS NULL']; const params: Record<string, unknown> = {};",
|
|
213
|
+
" if (options?.type) { filters.push('type = @type'); params.type = options.type; }",
|
|
214
|
+
" if (options?.projectPath) { filters.push('project_path = @projectPath'); params.projectPath = options.projectPath; }",
|
|
215
|
+
" const wc = `WHERE ${filters.join(' AND ')}`;",
|
|
216
|
+
' const rows = this.db.prepare(`SELECT * FROM memories ${wc} ORDER BY created_at DESC LIMIT @limit OFFSET @offset`)',
|
|
217
|
+
' .all({ ...params, limit: options?.limit ?? 50, offset: options?.offset ?? 0 }) as Array<Record<string, unknown>>;',
|
|
218
|
+
' return rows.map(rowToMemory);',
|
|
219
|
+
' }',
|
|
220
|
+
'',
|
|
221
|
+
' memoryStats(): MemoryStats {',
|
|
222
|
+
" const total = (this.db.prepare('SELECT COUNT(*) as count FROM memories WHERE archived_at IS NULL').get() as { count: number }).count;",
|
|
223
|
+
" const byTypeRows = this.db.prepare('SELECT type as key, COUNT(*) as count FROM memories WHERE archived_at IS NULL GROUP BY type').all() as Array<{ key: string; count: number }>;",
|
|
224
|
+
" const byProjectRows = this.db.prepare('SELECT project_path as key, COUNT(*) as count FROM memories WHERE archived_at IS NULL GROUP BY project_path').all() as Array<{ key: string; count: number }>;",
|
|
225
|
+
' return { total, byType: Object.fromEntries(byTypeRows.map((r) => [r.key, r.count])), byProject: Object.fromEntries(byProjectRows.map((r) => [r.key, r.count])) };',
|
|
226
|
+
' }',
|
|
227
|
+
'',
|
|
228
|
+
' getMemory(id: string): Memory | null {',
|
|
229
|
+
" const row = this.db.prepare('SELECT * FROM memories WHERE id = ?').get(id) as Record<string, unknown> | undefined;",
|
|
230
|
+
' return row ? rowToMemory(row) : null;',
|
|
231
|
+
' }',
|
|
232
|
+
'',
|
|
233
|
+
' getDb(): Database.Database { return this.db; }',
|
|
234
|
+
'',
|
|
235
|
+
' close(): void { this.db.close(); }',
|
|
236
|
+
'}',
|
|
237
|
+
'',
|
|
238
|
+
'function gc(db: Database.Database, col: string): Record<string, number> {',
|
|
239
|
+
' const rows = db.prepare(`SELECT ${col} as key, COUNT(*) as count FROM entries GROUP BY ${col}`).all() as Array<{ key: string; count: number }>;',
|
|
240
|
+
' return Object.fromEntries(rows.map((r) => [r.key, r.count]));',
|
|
241
|
+
'}',
|
|
242
|
+
'',
|
|
243
|
+
'function rowToEntry(row: Record<string, unknown>): IntelligenceEntry {',
|
|
244
|
+
" return { id: row.id as string, type: row.type as IntelligenceEntry['type'], domain: row.domain as IntelligenceEntry['domain'],",
|
|
245
|
+
" title: row.title as string, severity: row.severity as IntelligenceEntry['severity'], description: row.description as string,",
|
|
246
|
+
' context: (row.context as string) ?? undefined, example: (row.example as string) ?? undefined,',
|
|
247
|
+
' counterExample: (row.counter_example as string) ?? undefined, why: (row.why as string) ?? undefined,',
|
|
248
|
+
" tags: JSON.parse((row.tags as string) || '[]'), appliesTo: JSON.parse((row.applies_to as string) || '[]') };",
|
|
249
|
+
'}',
|
|
250
|
+
'',
|
|
251
|
+
'function rowToSearchResult(row: Record<string, unknown>): SearchResult {',
|
|
252
|
+
' return { entry: rowToEntry(row), score: row.score as number };',
|
|
253
|
+
'}',
|
|
254
|
+
'',
|
|
255
|
+
'function rowToMemory(row: Record<string, unknown>): Memory {',
|
|
256
|
+
" return { id: row.id as string, projectPath: row.project_path as string, type: row.type as Memory['type'],",
|
|
257
|
+
' context: row.context as string, summary: row.summary as string,',
|
|
258
|
+
" topics: JSON.parse((row.topics as string) || '[]'), filesModified: JSON.parse((row.files_modified as string) || '[]'),",
|
|
259
|
+
" toolsUsed: JSON.parse((row.tools_used as string) || '[]'), createdAt: row.created_at as number,",
|
|
260
|
+
' archivedAt: (row.archived_at as number) ?? null };',
|
|
261
|
+
'}',
|
|
262
|
+
].join('\n');
|
|
263
|
+
//# sourceMappingURL=vault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../../src/templates/vault.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,2DAA2D;IAC3D,0DAA0D;IAC1D,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,cAAc,GAAG;IACrB,wCAAwC;IACxC,sCAAsC;IACtC,sCAAsC;IACtC,oEAAoE;IACpE,EAAE;IACF,4EAA4E;IAC5E,6JAA6J;IAC7J,8HAA8H;IAC9H,yPAAyP;IACzP,oHAAoH;IACpH,EAAE;IACF,sBAAsB;IACtB,kCAAkC;IAClC,EAAE;IACF,8CAA8C;IAC9C,iFAAiF;IACjF,qCAAqC;IACrC,2CAA2C;IAC3C,0CAA0C;IAC1C,wBAAwB;IACxB,KAAK;IACL,EAAE;IACF,gCAAgC;IAChC,oBAAoB;IACpB,4CAA4C;IAC5C,8BAA8B;IAC9B,gFAAgF;IAChF,+BAA+B;IAC/B,8BAA8B;IAC9B,0FAA0F;IAC1F,oCAAoC;IACpC,qEAAqE;IACrE,0CAA0C;IAC1C,uCAAuC;IACvC,4DAA4D;IAC5D,2DAA2D;IAC3D,UAAU;IACV,kEAAkE;IAClE,gDAAgD;IAChD,+EAA+E;IAC/E,UAAU;IACV,6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A0C;IAC1C,wHAAwH;IACxH,2CAA2C;IAC3C,KAAK;IACL,EAAE;IACF,kDAAkD;IAClD,EAAE;IACF,sCAAsC;IACtC,GAAG;IACH,EAAE;IACF,2EAA2E;IAC3E,mJAAmJ;IACnJ,iEAAiE;IACjE,GAAG;IACH,EAAE;IACF,wEAAwE;IACxE,kIAAkI;IAClI,kIAAkI;IAClI,mGAAmG;IACnG,0GAA0G;IAC1G,kHAAkH;IAClH,GAAG;IACH,EAAE;IACF,0EAA0E;IAC1E,kEAAkE;IAClE,GAAG;IACH,EAAE;IACF,8DAA8D;IAC9D,6GAA6G;IAC7G,qEAAqE;IACrE,4HAA4H;IAC5H,qGAAqG;IACrG,wDAAwD;IACxD,GAAG;CACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export declare const AgentConfigSchema: z.ZodObject<{
|
|
|
17
17
|
greeting: z.ZodString;
|
|
18
18
|
/** Output directory (parent — agent dir will be created inside) */
|
|
19
19
|
outputDir: z.ZodString;
|
|
20
|
+
/** Hook packs to install after scaffolding (optional) */
|
|
21
|
+
hookPacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
22
|
}, "strip", z.ZodTypeAny, {
|
|
21
23
|
id: string;
|
|
22
24
|
name: string;
|
|
@@ -26,6 +28,7 @@ export declare const AgentConfigSchema: z.ZodObject<{
|
|
|
26
28
|
principles: string[];
|
|
27
29
|
greeting: string;
|
|
28
30
|
outputDir: string;
|
|
31
|
+
hookPacks?: string[] | undefined;
|
|
29
32
|
}, {
|
|
30
33
|
id: string;
|
|
31
34
|
name: string;
|
|
@@ -35,6 +38,7 @@ export declare const AgentConfigSchema: z.ZodObject<{
|
|
|
35
38
|
principles: string[];
|
|
36
39
|
greeting: string;
|
|
37
40
|
outputDir: string;
|
|
41
|
+
hookPacks?: string[] | undefined;
|
|
38
42
|
}>;
|
|
39
43
|
export type AgentConfig = z.infer<typeof AgentConfigSchema>;
|
|
40
44
|
/** Result of scaffolding */
|
package/dist/types.js
CHANGED
|
@@ -17,5 +17,7 @@ export const AgentConfigSchema = z.object({
|
|
|
17
17
|
greeting: z.string().min(10).max(300),
|
|
18
18
|
/** Output directory (parent — agent dir will be created inside) */
|
|
19
19
|
outputDir: z.string().min(1),
|
|
20
|
+
/** Hook packs to install after scaffolding (optional) */
|
|
21
|
+
hookPacks: z.array(z.string()).optional(),
|
|
20
22
|
});
|
|
21
23
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0DAA0D;AAC1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,yEAAyE;IACzE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,gDAAgD,CAAC;IAC3F,kCAAkC;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/B,gCAAgC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,iDAAiD;IACjD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACxC,0CAA0C;IAC1C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAClD,0DAA0D;IAC1D,UAAU,EAAE,CAA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C,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC9C,oDAAoD;IACpD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACrC,mEAAmE;IACnE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,yDAAyD;IACzD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -59,9 +59,9 @@ describe('Scaffolder', () => {
|
|
|
59
59
|
expect(preview.facades).toHaveLength(4); // 3 domains + core
|
|
60
60
|
expect(preview.facades[0].name).toBe('atlas_data_pipelines');
|
|
61
61
|
|
|
62
|
-
// Core facade should list all
|
|
62
|
+
// Core facade should list all 152 ops (147 core + 5 agent-specific)
|
|
63
63
|
const coreFacade = preview.facades.find((f) => f.name === 'atlas_core')!;
|
|
64
|
-
expect(coreFacade.ops.length).toBe(
|
|
64
|
+
expect(coreFacade.ops.length).toBe(152);
|
|
65
65
|
expect(coreFacade.ops).toContain('curator_status');
|
|
66
66
|
expect(coreFacade.ops).toContain('health');
|
|
67
67
|
|
package/src/scaffolder.ts
CHANGED
|
@@ -77,6 +77,13 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
|
|
|
77
77
|
},
|
|
78
78
|
];
|
|
79
79
|
|
|
80
|
+
if (config.hookPacks?.length) {
|
|
81
|
+
files.push({
|
|
82
|
+
path: '.claude/',
|
|
83
|
+
description: `Hook pack files (${config.hookPacks.join(', ')})`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
const facades = [
|
|
81
88
|
...config.domains.map((d) => ({
|
|
82
89
|
name: `${config.id}_${d.replace(/-/g, '_')}`,
|
|
@@ -85,7 +92,7 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
|
|
|
85
92
|
{
|
|
86
93
|
name: `${config.id}_core`,
|
|
87
94
|
ops: [
|
|
88
|
-
// From createCoreOps() —
|
|
95
|
+
// From createCoreOps() — 144 generic ops
|
|
89
96
|
'search',
|
|
90
97
|
'vault_stats',
|
|
91
98
|
'list_all',
|
|
@@ -101,9 +108,32 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
|
|
|
101
108
|
'update_task',
|
|
102
109
|
'complete_plan',
|
|
103
110
|
'record_feedback',
|
|
111
|
+
'brain_feedback',
|
|
112
|
+
'brain_feedback_stats',
|
|
104
113
|
'rebuild_vocabulary',
|
|
105
114
|
'brain_stats',
|
|
106
115
|
'llm_status',
|
|
116
|
+
'brain_session_context',
|
|
117
|
+
'brain_strengths',
|
|
118
|
+
'brain_global_patterns',
|
|
119
|
+
'brain_recommend',
|
|
120
|
+
'brain_build_intelligence',
|
|
121
|
+
'brain_export',
|
|
122
|
+
'brain_import',
|
|
123
|
+
'brain_extract_knowledge',
|
|
124
|
+
'brain_archive_sessions',
|
|
125
|
+
'brain_promote_proposals',
|
|
126
|
+
'brain_lifecycle',
|
|
127
|
+
'brain_reset_extracted',
|
|
128
|
+
// Cognee ops — 5
|
|
129
|
+
'cognee_status',
|
|
130
|
+
'cognee_search',
|
|
131
|
+
'cognee_add',
|
|
132
|
+
'cognee_cognify',
|
|
133
|
+
'cognee_config',
|
|
134
|
+
// LLM ops — 2
|
|
135
|
+
'llm_rotate',
|
|
136
|
+
'llm_call',
|
|
107
137
|
'curator_status',
|
|
108
138
|
'curator_detect_duplicates',
|
|
109
139
|
'curator_contradictions',
|
|
@@ -112,6 +142,119 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
|
|
|
112
142
|
'curator_groom_all',
|
|
113
143
|
'curator_consolidate',
|
|
114
144
|
'curator_health_audit',
|
|
145
|
+
'get_identity',
|
|
146
|
+
'update_identity',
|
|
147
|
+
'add_guideline',
|
|
148
|
+
'remove_guideline',
|
|
149
|
+
'rollback_identity',
|
|
150
|
+
'route_intent',
|
|
151
|
+
'morph',
|
|
152
|
+
'get_behavior_rules',
|
|
153
|
+
// Governance ops — 5
|
|
154
|
+
'governance_policy',
|
|
155
|
+
'governance_proposals',
|
|
156
|
+
'governance_stats',
|
|
157
|
+
'governance_expire',
|
|
158
|
+
'governance_dashboard',
|
|
159
|
+
// Planning Extra ops — 9
|
|
160
|
+
'plan_iterate',
|
|
161
|
+
'plan_split',
|
|
162
|
+
'plan_reconcile',
|
|
163
|
+
'plan_complete_lifecycle',
|
|
164
|
+
'plan_dispatch',
|
|
165
|
+
'plan_review',
|
|
166
|
+
'plan_archive',
|
|
167
|
+
'plan_list_tasks',
|
|
168
|
+
'plan_stats',
|
|
169
|
+
// Memory Extra ops — 8
|
|
170
|
+
'memory_delete',
|
|
171
|
+
'memory_stats',
|
|
172
|
+
'memory_export',
|
|
173
|
+
'memory_import',
|
|
174
|
+
'memory_prune',
|
|
175
|
+
'memory_deduplicate',
|
|
176
|
+
'memory_topics',
|
|
177
|
+
'memory_by_project',
|
|
178
|
+
// Vault Extra ops — 12
|
|
179
|
+
'vault_get',
|
|
180
|
+
'vault_update',
|
|
181
|
+
'vault_remove',
|
|
182
|
+
'vault_bulk_add',
|
|
183
|
+
'vault_bulk_remove',
|
|
184
|
+
'vault_tags',
|
|
185
|
+
'vault_domains',
|
|
186
|
+
'vault_recent',
|
|
187
|
+
'vault_import',
|
|
188
|
+
'vault_seed',
|
|
189
|
+
'vault_backup',
|
|
190
|
+
'vault_age_report',
|
|
191
|
+
// Admin ops — 8
|
|
192
|
+
'admin_health',
|
|
193
|
+
'admin_tool_list',
|
|
194
|
+
'admin_config',
|
|
195
|
+
'admin_vault_size',
|
|
196
|
+
'admin_uptime',
|
|
197
|
+
'admin_version',
|
|
198
|
+
'admin_reset_cache',
|
|
199
|
+
'admin_diagnostic',
|
|
200
|
+
// Loop ops — 7
|
|
201
|
+
'loop_start',
|
|
202
|
+
'loop_iterate',
|
|
203
|
+
'loop_status',
|
|
204
|
+
'loop_cancel',
|
|
205
|
+
'loop_history',
|
|
206
|
+
'loop_is_active',
|
|
207
|
+
'loop_complete',
|
|
208
|
+
// Orchestrate ops — 5
|
|
209
|
+
'orchestrate_plan',
|
|
210
|
+
'orchestrate_execute',
|
|
211
|
+
'orchestrate_complete',
|
|
212
|
+
'orchestrate_status',
|
|
213
|
+
'orchestrate_quick_capture',
|
|
214
|
+
// Grading ops — 5
|
|
215
|
+
'plan_grade',
|
|
216
|
+
'plan_check_history',
|
|
217
|
+
'plan_latest_check',
|
|
218
|
+
'plan_meets_grade',
|
|
219
|
+
'plan_auto_improve',
|
|
220
|
+
// Capture ops — 4
|
|
221
|
+
'capture_knowledge',
|
|
222
|
+
'capture_quick',
|
|
223
|
+
'search_intelligent',
|
|
224
|
+
'search_feedback',
|
|
225
|
+
// Admin Extra ops — 10
|
|
226
|
+
'admin_telemetry',
|
|
227
|
+
'admin_telemetry_recent',
|
|
228
|
+
'admin_telemetry_reset',
|
|
229
|
+
'admin_permissions',
|
|
230
|
+
'admin_vault_analytics',
|
|
231
|
+
'admin_search_insights',
|
|
232
|
+
'admin_module_status',
|
|
233
|
+
'admin_env',
|
|
234
|
+
'admin_gc',
|
|
235
|
+
'admin_export_config',
|
|
236
|
+
// Curator Extra ops — 4
|
|
237
|
+
'curator_entry_history',
|
|
238
|
+
'curator_record_snapshot',
|
|
239
|
+
'curator_queue_stats',
|
|
240
|
+
'curator_enrich',
|
|
241
|
+
// Project ops — 12
|
|
242
|
+
'project_get',
|
|
243
|
+
'project_list',
|
|
244
|
+
'project_unregister',
|
|
245
|
+
'project_get_rules',
|
|
246
|
+
'project_list_rules',
|
|
247
|
+
'project_add_rule',
|
|
248
|
+
'project_remove_rule',
|
|
249
|
+
'project_link',
|
|
250
|
+
'project_unlink',
|
|
251
|
+
'project_get_links',
|
|
252
|
+
'project_linked_projects',
|
|
253
|
+
'project_touch',
|
|
254
|
+
// Cross-project memory ops — 3
|
|
255
|
+
'memory_promote_to_global',
|
|
256
|
+
'memory_configure',
|
|
257
|
+
'memory_cross_project_search',
|
|
115
258
|
// Agent-specific ops — 5
|
|
116
259
|
'health',
|
|
117
260
|
'identity',
|
|
@@ -160,6 +303,10 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
|
|
|
160
303
|
'src/__tests__',
|
|
161
304
|
];
|
|
162
305
|
|
|
306
|
+
if (config.hookPacks?.length) {
|
|
307
|
+
dirs.push('.claude');
|
|
308
|
+
}
|
|
309
|
+
|
|
163
310
|
for (const dir of dirs) {
|
|
164
311
|
mkdirSync(join(agentDir, dir), { recursive: true });
|
|
165
312
|
}
|
|
@@ -211,7 +358,7 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
|
|
|
211
358
|
filesCreated.push(path);
|
|
212
359
|
}
|
|
213
360
|
|
|
214
|
-
const totalOps = config.domains.length * 5 +
|
|
361
|
+
const totalOps = config.domains.length * 5 + 61; // 5 per domain + 56 core (from createCoreOps) + 5 agent-specific
|
|
215
362
|
|
|
216
363
|
// Register the agent as an MCP server in ~/.claude.json
|
|
217
364
|
const mcpReg = registerMcpServer(config.id, agentDir);
|
|
@@ -225,6 +372,10 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
|
|
|
225
372
|
`1 test suite — facades (vault, brain, planner, llm tests provided by @soleri/core)`,
|
|
226
373
|
];
|
|
227
374
|
|
|
375
|
+
if (config.hookPacks?.length) {
|
|
376
|
+
summaryLines.push(`${config.hookPacks.length} hook pack(s) bundled in .claude/`);
|
|
377
|
+
}
|
|
378
|
+
|
|
228
379
|
if (mcpReg.registered) {
|
|
229
380
|
summaryLines.push(`MCP server registered in ${mcpReg.path}`);
|
|
230
381
|
} else {
|