noormme 1.2.1 → 1.2.2

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 (44) hide show
  1. package/dist/cjs/agentic/improvement/GovernanceManager.d.ts +14 -6
  2. package/dist/cjs/agentic/improvement/GovernanceManager.js +133 -294
  3. package/dist/cjs/agentic/improvement/QuotaManager.js +1 -1
  4. package/dist/cjs/agentic/improvement/SelfEvolution.js +1 -0
  5. package/dist/cjs/agentic/improvement/governance/AuditContext.d.ts +17 -0
  6. package/dist/cjs/agentic/improvement/governance/AuditContext.js +2 -0
  7. package/dist/cjs/agentic/improvement/governance/BudgetAuditor.d.ts +4 -0
  8. package/dist/cjs/agentic/improvement/governance/BudgetAuditor.js +50 -0
  9. package/dist/cjs/agentic/improvement/governance/EmergenceAuditor.d.ts +4 -0
  10. package/dist/cjs/agentic/improvement/governance/EmergenceAuditor.js +37 -0
  11. package/dist/cjs/agentic/improvement/governance/MaintenanceOracle.d.ts +4 -0
  12. package/dist/cjs/agentic/improvement/governance/MaintenanceOracle.js +67 -0
  13. package/dist/cjs/agentic/improvement/governance/PerformanceAuditor.d.ts +4 -0
  14. package/dist/cjs/agentic/improvement/governance/PerformanceAuditor.js +43 -0
  15. package/dist/cjs/agentic/improvement/governance/PersonaAuditor.d.ts +6 -0
  16. package/dist/cjs/agentic/improvement/governance/PersonaAuditor.js +74 -0
  17. package/dist/cjs/agentic/improvement/governance/RemediationEngine.d.ts +5 -0
  18. package/dist/cjs/agentic/improvement/governance/RemediationEngine.js +43 -0
  19. package/dist/cjs/agentic/improvement/governance/SkillAuditor.d.ts +5 -0
  20. package/dist/cjs/agentic/improvement/governance/SkillAuditor.js +52 -0
  21. package/dist/cjs/cli/index.js +0 -0
  22. package/dist/cjs/helpers/agent-schema.js +14 -14
  23. package/dist/esm/agentic/improvement/GovernanceManager.d.ts +14 -6
  24. package/dist/esm/agentic/improvement/GovernanceManager.js +133 -294
  25. package/dist/esm/agentic/improvement/QuotaManager.js +1 -1
  26. package/dist/esm/agentic/improvement/SelfEvolution.js +1 -0
  27. package/dist/esm/agentic/improvement/governance/AuditContext.d.ts +17 -0
  28. package/dist/esm/agentic/improvement/governance/AuditContext.js +2 -0
  29. package/dist/esm/agentic/improvement/governance/BudgetAuditor.d.ts +4 -0
  30. package/dist/esm/agentic/improvement/governance/BudgetAuditor.js +47 -0
  31. package/dist/esm/agentic/improvement/governance/EmergenceAuditor.d.ts +4 -0
  32. package/dist/esm/agentic/improvement/governance/EmergenceAuditor.js +34 -0
  33. package/dist/esm/agentic/improvement/governance/MaintenanceOracle.d.ts +4 -0
  34. package/dist/esm/agentic/improvement/governance/MaintenanceOracle.js +64 -0
  35. package/dist/esm/agentic/improvement/governance/PerformanceAuditor.d.ts +4 -0
  36. package/dist/esm/agentic/improvement/governance/PerformanceAuditor.js +40 -0
  37. package/dist/esm/agentic/improvement/governance/PersonaAuditor.d.ts +6 -0
  38. package/dist/esm/agentic/improvement/governance/PersonaAuditor.js +71 -0
  39. package/dist/esm/agentic/improvement/governance/RemediationEngine.d.ts +5 -0
  40. package/dist/esm/agentic/improvement/governance/RemediationEngine.js +40 -0
  41. package/dist/esm/agentic/improvement/governance/SkillAuditor.d.ts +5 -0
  42. package/dist/esm/agentic/improvement/governance/SkillAuditor.js +49 -0
  43. package/dist/esm/helpers/agent-schema.js +14 -14
  44. package/package.json +44 -40
@@ -0,0 +1,64 @@
1
+ /// <reference types="./MaintenanceOracle.d.ts" />
2
+ export class MaintenanceOracle {
3
+ async suggestRepairs(ctx) {
4
+ const repairs = [];
5
+ // Fetch maintenance policies
6
+ const policies = (await ctx.db
7
+ .selectFrom(ctx.policiesTable)
8
+ .selectAll()
9
+ .where('is_enabled', '=', true)
10
+ .execute());
11
+ const getPolicyValue = (name, fallback) => {
12
+ const p = policies.find(p => p.name === name);
13
+ if (!p)
14
+ return fallback;
15
+ const def = typeof p.definition === 'string' ? JSON.parse(p.definition) : p.definition;
16
+ return def.threshold ?? def.limit ?? def.days ?? fallback;
17
+ };
18
+ const latencyPolicy = getPolicyValue('latency_repair_threshold', 500);
19
+ const costPolicy = getPolicyValue('high_cost_threshold', 0.5);
20
+ const storagePolicy = getPolicyValue('cold_storage_threshold', 30);
21
+ // 1. Check for chronic high latency
22
+ const latencyStats = await ctx.cortex.metrics.getMetricStats('query_latency');
23
+ if (latencyStats.avg > latencyPolicy && latencyStats.count > 10) {
24
+ repairs.push(`Average latency is high (${latencyStats.avg.toFixed(2)}ms). Suggesting index audit across hit tables.`);
25
+ }
26
+ // 2. Detect specific slow tables
27
+ const recentSlowQueries = await ctx.db
28
+ .selectFrom(ctx.metricsTable)
29
+ .select('metadata')
30
+ .where('metric_name', '=', 'query_latency')
31
+ .where('metric_value', '>', latencyPolicy * 2)
32
+ .limit(20)
33
+ .execute();
34
+ const slowTables = new Set();
35
+ for (const q of recentSlowQueries) {
36
+ try {
37
+ const meta = typeof q.metadata === 'string' ? JSON.parse(q.metadata) : q.metadata || {};
38
+ if (meta.table)
39
+ slowTables.add(meta.table);
40
+ }
41
+ catch (e) { }
42
+ }
43
+ for (const table of slowTables) {
44
+ repairs.push(`Table '${table}' is experiencing periodic latency spikes. Suggesting 'CREATE INDEX' for common filters.`);
45
+ }
46
+ // 3. Check for high cost
47
+ const totalCost = await ctx.cortex.metrics.getAverageMetric('total_cost');
48
+ if (totalCost > costPolicy) {
49
+ repairs.push('Average query cost is high. Suggesting prompt compression or model switching (e.g., to a smaller model).');
50
+ }
51
+ // 4. Cold storage candidates
52
+ const oldThreshold = new Date(Date.now() - storagePolicy * 24 * 60 * 60 * 1000);
53
+ const sessionsTable = ctx.config.sessionsTable || 'agent_sessions';
54
+ const oldSessions = (await ctx.db
55
+ .selectFrom(sessionsTable)
56
+ .select((eb) => eb.fn.count('id').as('count'))
57
+ .where('created_at', '<', oldThreshold)
58
+ .executeTakeFirst());
59
+ if (Number(oldSessions?.count || 0) > 100) {
60
+ repairs.push(`[STORAGE OPTIMIZATION] Found ${oldSessions.count} sessions older than ${storagePolicy} days. Consider moving to cold storage.`);
61
+ }
62
+ return repairs;
63
+ }
64
+ }
@@ -0,0 +1,4 @@
1
+ import type { AuditContext, AuditResult } from './AuditContext.js';
2
+ export declare class PerformanceAuditor {
3
+ audit(ctx: AuditContext): Promise<AuditResult>;
4
+ }
@@ -0,0 +1,40 @@
1
+ /// <reference types="./PerformanceAuditor.d.ts" />
2
+ export class PerformanceAuditor {
3
+ async audit(ctx) {
4
+ const issues = [];
5
+ // Fetch safety policies for success rate
6
+ const policies = (await ctx.trx
7
+ .selectFrom(ctx.policiesTable)
8
+ .selectAll()
9
+ .where('is_enabled', '=', true)
10
+ .where((eb) => eb.or([
11
+ eb('name', '=', 'min_success_rate'),
12
+ eb('type', '=', 'safety')
13
+ ]))
14
+ .execute());
15
+ const getLimit = (name) => {
16
+ const p = policies.find(p => p.name === name);
17
+ if (!p)
18
+ return 0.8; // Default success floor
19
+ const def = typeof p.definition === 'string' ? JSON.parse(p.definition) : p.definition;
20
+ return def.threshold ?? def.limit ?? 0.8;
21
+ };
22
+ const minSuccess = getLimit('min_success_rate');
23
+ // Statistical Success Rate (last 100 events)
24
+ const recentSuccess = await ctx.trx
25
+ .selectFrom(ctx.metricsTable)
26
+ .select((eb) => eb.fn.avg('metric_value').as('avg'))
27
+ .where('metric_name', '=', 'success_rate')
28
+ .orderBy('created_at', 'desc')
29
+ .limit(100)
30
+ .executeTakeFirst();
31
+ const success = Number(recentSuccess?.avg || 1);
32
+ if (success < minSuccess) {
33
+ issues.push(`Performance Degradation: Rolling success rate (${Math.round(success * 100)}%) is below policy requirement (${minSuccess * 100}%)`);
34
+ }
35
+ return {
36
+ issues,
37
+ metadata: { success, minSuccess }
38
+ };
39
+ }
40
+ }
@@ -0,0 +1,6 @@
1
+ import type { AuditContext, AuditResult } from './AuditContext.js';
2
+ export declare class PersonaAuditor {
3
+ audit(ctx: AuditContext): Promise<AuditResult>;
4
+ private getActivePersona;
5
+ quarantinePersona(ctx: AuditContext, id: string | number, reason: string): Promise<void>;
6
+ }
@@ -0,0 +1,71 @@
1
+ /// <reference types="./PersonaAuditor.d.ts" />
2
+ export class PersonaAuditor {
3
+ async audit(ctx) {
4
+ const issues = [];
5
+ const activePersona = await this.getActivePersona(ctx);
6
+ if (activePersona) {
7
+ const quotaCheck = await ctx.cortex.quotas.checkQuota('persona', activePersona.id);
8
+ if (!quotaCheck.allowed) {
9
+ issues.push(`Quota Breach: ${quotaCheck.reason}`);
10
+ }
11
+ // Check for swarm-level quotas if part of a swarm
12
+ const swarmId = activePersona.metadata?.swarm_id;
13
+ if (swarmId) {
14
+ const swarmCheck = await ctx.cortex.quotas.checkQuota('swarm', swarmId);
15
+ if (!swarmCheck.allowed) {
16
+ issues.push(`Swarm Quota Breach [${swarmId}]: ${swarmCheck.reason}`);
17
+ }
18
+ }
19
+ }
20
+ return {
21
+ issues,
22
+ metadata: { activePersona }
23
+ };
24
+ }
25
+ async getActivePersona(ctx) {
26
+ const active = await ctx.trx
27
+ .selectFrom(ctx.personasTable)
28
+ .selectAll()
29
+ .where('status', '=', 'active')
30
+ .executeTakeFirst();
31
+ if (!active)
32
+ return null;
33
+ return {
34
+ ...active,
35
+ metadata: typeof active.metadata === 'string'
36
+ ? JSON.parse(active.metadata)
37
+ : active.metadata || {},
38
+ };
39
+ }
40
+ async quarantinePersona(ctx, id, reason) {
41
+ console.warn(`[PersonaAuditor] QUARANTINING Persona ${id}: ${reason}`);
42
+ let query = ctx.db
43
+ .selectFrom(ctx.personasTable)
44
+ .selectAll()
45
+ .where('id', '=', id);
46
+ // SQLite doesn't support SELECT ... FOR UPDATE easily in Kysely without specific dialect support
47
+ // But we are in a transaction usually if passed ctx.trx.
48
+ // Here we use ctx.db for the quarantine update if it's a standalone call.
49
+ const persona = await query.executeTakeFirst();
50
+ if (persona) {
51
+ const metadata = typeof persona.metadata === 'string'
52
+ ? JSON.parse(persona.metadata)
53
+ : persona.metadata || {};
54
+ await ctx.db
55
+ .updateTable(ctx.personasTable)
56
+ .set({
57
+ status: 'quarantined',
58
+ metadata: JSON.stringify({
59
+ ...metadata,
60
+ quarantine_reason: reason,
61
+ quarantined_at: new Date(),
62
+ }),
63
+ updated_at: new Date(),
64
+ })
65
+ .where('id', '=', id)
66
+ .execute();
67
+ // Rollback most recent changes via strategy engine
68
+ await ctx.cortex.strategy.rollbackPersona(id);
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,5 @@
1
+ import type { AuditContext } from './AuditContext.js';
2
+ export declare class RemediationEngine {
3
+ triggerRemediation(ctx: AuditContext, issues: string[]): Promise<void>;
4
+ private remediateSkillFailure;
5
+ }
@@ -0,0 +1,40 @@
1
+ /// <reference types="./RemediationEngine.d.ts" />
2
+ export class RemediationEngine {
3
+ async triggerRemediation(ctx, issues) {
4
+ for (const issue of issues) {
5
+ if (issue.includes('Budget Violations')) {
6
+ await ctx.cortex.rituals.scheduleRitual('Budget Remediation', 'compression', 'hourly', `Automated response to: ${issue}`, { priority: 'critical', enforce_limits: true });
7
+ }
8
+ if (issue.includes('Performance Degradation')) {
9
+ await ctx.cortex.rituals.scheduleRitual('Reliability Sweep', 'pruning', 'daily', `Sanitizing high-noise memories due to: ${issue}`, { priority: 'medium', target: 'longtail' });
10
+ }
11
+ if (issue.includes('Integrity Failure')) {
12
+ await this.remediateSkillFailure(ctx, issue);
13
+ }
14
+ if (issue.includes('Quota Breach') || issue.includes('Swarm Quota Breach')) {
15
+ await ctx.cortex.rituals.scheduleRitual('Resource Throttling', 'pruning', 'hourly', `Critical resource containment: ${issue}`, { priority: 'critical', active_containment: true });
16
+ }
17
+ }
18
+ }
19
+ async remediateSkillFailure(ctx, issue) {
20
+ const skillName = issue.match(/'([^']+)'/)?.[1];
21
+ if (!skillName)
22
+ return;
23
+ console.log(`[RemediationEngine] Demoting tainted skill out of verified pool: ${skillName}`);
24
+ // Use a fresh transaction for remediation if possible, or use ctx.trx
25
+ await ctx.db.transaction().execute(async (trx) => {
26
+ const skill = await trx
27
+ .selectFrom(ctx.skillsTable)
28
+ .select('id')
29
+ .where('name', '=', skillName)
30
+ .executeTakeFirst();
31
+ if (skill) {
32
+ await trx
33
+ .updateTable(ctx.skillsTable)
34
+ .set({ status: 'experimental', updated_at: new Date() })
35
+ .where('id', '=', skill.id)
36
+ .execute();
37
+ }
38
+ });
39
+ }
40
+ }
@@ -0,0 +1,5 @@
1
+ import type { AuditContext, AuditResult } from './AuditContext.js';
2
+ export declare class SkillAuditor {
3
+ audit(ctx: AuditContext): Promise<AuditResult>;
4
+ quarantineSkill(ctx: AuditContext, name: string, reason: string): Promise<void>;
5
+ }
@@ -0,0 +1,49 @@
1
+ /// <reference types="./SkillAuditor.d.ts" />
2
+ export class SkillAuditor {
3
+ async audit(ctx) {
4
+ const issues = [];
5
+ // Fetch integrity policies for reliability floor
6
+ const policies = (await ctx.trx
7
+ .selectFrom(ctx.policiesTable)
8
+ .selectAll()
9
+ .where('is_enabled', '=', true)
10
+ .where((eb) => eb.or([
11
+ eb('name', '=', 'reliability_floor'),
12
+ eb('type', '=', 'integrity')
13
+ ]))
14
+ .execute());
15
+ const getLimit = (name) => {
16
+ const p = policies.find(p => p.name === name);
17
+ if (!p)
18
+ return 0.7; // Default reliability floor
19
+ const def = typeof p.definition === 'string' ? JSON.parse(p.definition) : p.definition;
20
+ return def.threshold ?? def.limit ?? 0.7;
21
+ };
22
+ const reliabilityLimit = getLimit('reliability_floor');
23
+ const failingVerified = await ctx.trx
24
+ .selectFrom(ctx.skillsTable)
25
+ .select(['name', 'reliability'])
26
+ .where('status', '=', 'verified')
27
+ .where('reliability', '<', reliabilityLimit)
28
+ .execute();
29
+ for (const cap of failingVerified) {
30
+ issues.push(`Integrity Failure: Verified skill '${cap.name}' reliability (${cap.reliability.toFixed(2)}) dropped below floor (${reliabilityLimit})`);
31
+ }
32
+ return {
33
+ issues,
34
+ metadata: { reliabilityLimit, failingVerifiedCount: failingVerified.length }
35
+ };
36
+ }
37
+ async quarantineSkill(ctx, name, reason) {
38
+ console.warn(`[SkillAuditor] BLACKLISTING Skill ${name}: ${reason}`);
39
+ await ctx.db
40
+ .updateTable(ctx.skillsTable)
41
+ .set({
42
+ status: 'blacklisted',
43
+ metadata: JSON.stringify({ blacklist_reason: reason, blacklisted_at: new Date() }),
44
+ updated_at: new Date()
45
+ })
46
+ .where('name', '=', name)
47
+ .execute();
48
+ }
49
+ }
@@ -49,7 +49,7 @@ export class AgentSchemaHelper {
49
49
  .createTable(messagesTable)
50
50
  .ifNotExists()
51
51
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
52
- .addColumn('session_id', 'integer', (col) => col.references(`${sessionsTable}.id`).onDelete('cascade'))
52
+ .addColumn('session_id', 'text')
53
53
  .addColumn('role', 'text', (col) => col.notNull())
54
54
  .addColumn('content', 'text', (col) => col.notNull())
55
55
  .addColumn('metadata', 'text')
@@ -60,7 +60,7 @@ export class AgentSchemaHelper {
60
60
  .createTable(goalsTable)
61
61
  .ifNotExists()
62
62
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
63
- .addColumn('session_id', 'integer', (col) => col.references(`${sessionsTable}.id`).onDelete('cascade'))
63
+ .addColumn('session_id', 'text')
64
64
  .addColumn('parent_id', 'integer', (col) => col.references(`${goalsTable}.id`).onDelete('cascade'))
65
65
  .addColumn('description', 'text', (col) => col.notNull())
66
66
  .addColumn('status', 'text', (col) => col.notNull().defaultTo('pending'))
@@ -74,7 +74,7 @@ export class AgentSchemaHelper {
74
74
  .createTable(memoriesTable)
75
75
  .ifNotExists()
76
76
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
77
- .addColumn('session_id', 'integer', (col) => col.references(`${sessionsTable}.id`).onDelete('cascade'))
77
+ .addColumn('session_id', 'text')
78
78
  .addColumn('content', 'text', (col) => col.notNull())
79
79
  .addColumn('embedding', 'text') // In Postgres with pgvector, this would be 'vector(D)'
80
80
  .addColumn('metadata', 'text')
@@ -85,7 +85,7 @@ export class AgentSchemaHelper {
85
85
  .createTable(reflectionsTable)
86
86
  .ifNotExists()
87
87
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
88
- .addColumn('session_id', 'integer', (col) => col.references(`${sessionsTable}.id`).onDelete('cascade'))
88
+ .addColumn('session_id', 'text')
89
89
  .addColumn('outcome', 'text', (col) => col.notNull())
90
90
  .addColumn('lessons_learned', 'text', (col) => col.notNull())
91
91
  .addColumn('suggested_actions', 'text')
@@ -100,7 +100,7 @@ export class AgentSchemaHelper {
100
100
  .addColumn('entity', 'text', (col) => col.notNull())
101
101
  .addColumn('fact', 'text', (col) => col.notNull())
102
102
  .addColumn('confidence', 'real', (col) => col.notNull().defaultTo(1.0))
103
- .addColumn('source_session_id', 'integer', (col) => col.references(`${sessionsTable}.id`).onDelete('set null'))
103
+ .addColumn('source_session_id', 'text')
104
104
  .addColumn('status', 'text', (col) => col.notNull().defaultTo('proposed'))
105
105
  .addColumn('tags', 'text')
106
106
  .addColumn('metadata', 'text')
@@ -112,8 +112,8 @@ export class AgentSchemaHelper {
112
112
  .createTable(actionsTable)
113
113
  .ifNotExists()
114
114
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
115
- .addColumn('session_id', 'integer', (col) => col.notNull().references(`${sessionsTable}.id`).onDelete('cascade'))
116
- .addColumn('message_id', 'integer', (col) => col.references(`${messagesTable}.id`).onDelete('set null'))
115
+ .addColumn('session_id', 'text')
116
+ .addColumn('message_id', 'integer')
117
117
  .addColumn('tool_name', 'text', (col) => col.notNull())
118
118
  .addColumn('arguments', 'text', (col) => col.notNull())
119
119
  .addColumn('outcome', 'text')
@@ -127,7 +127,7 @@ export class AgentSchemaHelper {
127
127
  .createTable(episodesTable)
128
128
  .ifNotExists()
129
129
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
130
- .addColumn('session_id', 'integer', (col) => col.notNull().references(`${sessionsTable}.id`).onDelete('cascade'))
130
+ .addColumn('session_id', 'text')
131
131
  .addColumn('name', 'text', (col) => col.notNull())
132
132
  .addColumn('summary', 'text')
133
133
  .addColumn('status', 'text', (col) => col.notNull().defaultTo('active'))
@@ -140,7 +140,7 @@ export class AgentSchemaHelper {
140
140
  .createTable(resourcesTable)
141
141
  .ifNotExists()
142
142
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
143
- .addColumn('session_id', 'integer', (col) => col.notNull().references(`${sessionsTable}.id`).onDelete('cascade'))
143
+ .addColumn('session_id', 'text')
144
144
  .addColumn('agent_id', 'text')
145
145
  .addColumn('model_name', 'text', (col) => col.notNull())
146
146
  .addColumn('input_tokens', 'integer', (col) => col.notNull().defaultTo(0))
@@ -171,7 +171,7 @@ export class AgentSchemaHelper {
171
171
  .addColumn('name', 'text', (col) => col.notNull())
172
172
  .addColumn('type', 'text', (col) => col.notNull())
173
173
  .addColumn('definition', 'text', (col) => col.notNull())
174
- .addColumn('isEnabled', 'integer', (col) => col.notNull().defaultTo(1))
174
+ .addColumn('is_enabled', 'integer', (col) => col.notNull().defaultTo(1))
175
175
  .addColumn('metadata', 'text')
176
176
  .addColumn('created_at', 'timestamp', (col) => col.notNull())
177
177
  .addColumn('updated_at', 'timestamp', (col) => col.notNull())
@@ -181,7 +181,7 @@ export class AgentSchemaHelper {
181
181
  .createTable(metricsTable)
182
182
  .ifNotExists()
183
183
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
184
- .addColumn('session_id', 'integer', (col) => col.references(`${sessionsTable}.id`).onDelete('set null'))
184
+ .addColumn('session_id', 'text')
185
185
  .addColumn('agent_id', 'text')
186
186
  .addColumn('metric_name', 'text', (col) => col.notNull())
187
187
  .addColumn('metric_value', 'real', (col) => col.notNull())
@@ -208,7 +208,7 @@ export class AgentSchemaHelper {
208
208
  .createTable(epochsTable)
209
209
  .ifNotExists()
210
210
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
211
- .addColumn('session_id', 'integer', (col) => col.notNull().references(`${sessionsTable}.id`).onDelete('cascade'))
211
+ .addColumn('session_id', 'text')
212
212
  .addColumn('summary', 'text', (col) => col.notNull())
213
213
  .addColumn('start_message_id', 'integer', (col) => col.notNull())
214
214
  .addColumn('end_message_id', 'integer', (col) => col.notNull())
@@ -235,11 +235,11 @@ export class AgentSchemaHelper {
235
235
  .createTable(rulesTable)
236
236
  .ifNotExists()
237
237
  .addColumn('id', 'integer', (col) => col.primaryKey().autoIncrement())
238
- .addColumn('tableName', 'text', (col) => col.notNull())
238
+ .addColumn('table_name', 'text', (col) => col.notNull())
239
239
  .addColumn('operation', 'text', (col) => col.notNull())
240
240
  .addColumn('action', 'text', (col) => col.notNull())
241
241
  .addColumn('script', 'text')
242
- .addColumn('isEnabled', 'integer', (col) => col.notNull().defaultTo(1))
242
+ .addColumn('is_enabled', 'integer', (col) => col.notNull().defaultTo(1))
243
243
  .addColumn('metadata', 'text')
244
244
  .addColumn('created_at', 'timestamp', (col) => col.notNull())
245
245
  .execute();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noormme",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "NOORMME - The Agentic Data Engine. High-fidelity persistence and cognitive governance for Autonomous AI Agents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -60,6 +60,48 @@
60
60
  "default": "./dist/cjs/cli/index.js"
61
61
  }
62
62
  },
63
+ "scripts": {
64
+ "clean": "rm -rf dist & rm -rf test/node/dist & rm -rf test/browser/bundle.js & rm -rf helpers",
65
+ "bench:ts": "pnpm build && cd ./test/ts-benchmarks && node --experimental-strip-types ./index.ts",
66
+ "test": "jest",
67
+ "test:watch": "jest --watch",
68
+ "test:coverage": "jest --coverage",
69
+ "test:unit": "jest tests/unit",
70
+ "test:integration": "jest tests/integration",
71
+ "test:cli": "jest tests/cli",
72
+ "test:original": "pnpm build && pnpm test:node:build && pnpm test:node:run && pnpm test:typings && pnpm test:esmimports && pnpm test:exports",
73
+ "test:node:build": "tsc -p test/node",
74
+ "test:node": "pnpm build && pnpm test:node:build && pnpm test:node:run",
75
+ "test:node:run": "mocha --timeout 15000 test/node/dist/**/*.test.js",
76
+ "test:browser:build": "rm -rf test/browser/bundle.js && esbuild test/browser/main.ts --bundle --outfile=test/browser/bundle.js",
77
+ "test:browser": "pnpm build && pnpm test:browser:build && node test/browser/test.js",
78
+ "test:bun": "pnpm build && bun link && cd test/bun && bun install && bun run test",
79
+ "test:cloudflare-workers": "pnpm build && pnpm -r test --filter kysely-cloudflare-workers-test",
80
+ "test:deno": "deno run --allow-env --allow-read --allow-net --no-lock test/deno/local.test.ts && deno run --allow-env --allow-read --allow-net --no-lock test/deno/cdn.test.ts",
81
+ "test:typings": "tsd test/typings",
82
+ "test:esmimports": "node scripts/check-esm-imports.js",
83
+ "test:esbuild": "esbuild --bundle --platform=node --external:pg-native dist/esm/index.js --outfile=/dev/null",
84
+ "test:exports": "attw --pack . && node scripts/check-exports.js",
85
+ "test:jsdocs": "deno check --doc-only --no-lock --unstable-sloppy-imports --config=\"deno.check.json\" ./src",
86
+ "test:outdatedts": "pnpm build && cd test/outdated-ts && pnpm i && pnpm test",
87
+ "prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
88
+ "build": "pnpm clean && (pnpm build:esm & pnpm build:cjs) && pnpm script:module-fixup && pnpm script:copy-interface-doc",
89
+ "build:esm": "tsc -p tsconfig.json && pnpm script:add-deno-type-references",
90
+ "build:cjs": "tsc -p tsconfig-cjs.json",
91
+ "script:module-fixup": "node scripts/module-fixup.js",
92
+ "script:copy-interface-doc": "node scripts/copy-interface-documentation.js",
93
+ "script:add-deno-type-references": "node scripts/add-deno-type-references.js",
94
+ "script:align-site-version": "node --experimental-strip-types scripts/align-site-version.mts",
95
+ "script:generate-site-examples": "node scripts/generate-site-examples.js",
96
+ "script:exclude-test-files-for-backwards-compat": "node --experimental-strip-types scripts/exclude-test-files-for-backwards-compat.mts",
97
+ "prepublishOnly": "pnpm build",
98
+ "version": "pnpm script:align-site-version && git add .",
99
+ "postversion": "pnpm publish --no-git-checks",
100
+ "prepack": "pnpm build",
101
+ "postpack": "echo 'Package ready for npm publish'",
102
+ "publish:dry-run": "pnpm build && npm pack --dry-run",
103
+ "publish:check": "pnpm build && npm publish --dry-run"
104
+ },
63
105
  "author": "NOORMME Team",
64
106
  "license": "MIT",
65
107
  "devDependencies": {
@@ -94,6 +136,7 @@
94
136
  "tsd": "^0.33.0",
95
137
  "typescript": "~5.9.2"
96
138
  },
139
+ "packageManager": "pnpm@10.16.1+sha512.0e155aa2629db8672b49e8475da6226aa4bdea85fdcdfdc15350874946d4f3c91faaf64cbdc4a5d1ab8002f473d5c3fcedcd197989cf0390f9badd3c04678706",
97
140
  "dependencies": {
98
141
  "better-sqlite3": "^12.4.1",
99
142
  "chalk": "^5.0.0",
@@ -106,44 +149,5 @@
106
149
  },
107
150
  "bin": {
108
151
  "noormme": "./dist/cjs/cli/index.js"
109
- },
110
- "scripts": {
111
- "clean": "rm -rf dist & rm -rf test/node/dist & rm -rf test/browser/bundle.js & rm -rf helpers",
112
- "bench:ts": "pnpm build && cd ./test/ts-benchmarks && node --experimental-strip-types ./index.ts",
113
- "test": "jest",
114
- "test:watch": "jest --watch",
115
- "test:coverage": "jest --coverage",
116
- "test:unit": "jest tests/unit",
117
- "test:integration": "jest tests/integration",
118
- "test:cli": "jest tests/cli",
119
- "test:original": "pnpm build && pnpm test:node:build && pnpm test:node:run && pnpm test:typings && pnpm test:esmimports && pnpm test:exports",
120
- "test:node:build": "tsc -p test/node",
121
- "test:node": "pnpm build && pnpm test:node:build && pnpm test:node:run",
122
- "test:node:run": "mocha --timeout 15000 test/node/dist/**/*.test.js",
123
- "test:browser:build": "rm -rf test/browser/bundle.js && esbuild test/browser/main.ts --bundle --outfile=test/browser/bundle.js",
124
- "test:browser": "pnpm build && pnpm test:browser:build && node test/browser/test.js",
125
- "test:bun": "pnpm build && bun link && cd test/bun && bun install && bun run test",
126
- "test:cloudflare-workers": "pnpm build && pnpm -r test --filter kysely-cloudflare-workers-test",
127
- "test:deno": "deno run --allow-env --allow-read --allow-net --no-lock test/deno/local.test.ts && deno run --allow-env --allow-read --allow-net --no-lock test/deno/cdn.test.ts",
128
- "test:typings": "tsd test/typings",
129
- "test:esmimports": "node scripts/check-esm-imports.js",
130
- "test:esbuild": "esbuild --bundle --platform=node --external:pg-native dist/esm/index.js --outfile=/dev/null",
131
- "test:exports": "attw --pack . && node scripts/check-exports.js",
132
- "test:jsdocs": "deno check --doc-only --no-lock --unstable-sloppy-imports --config=\"deno.check.json\" ./src",
133
- "test:outdatedts": "pnpm build && cd test/outdated-ts && pnpm i && pnpm test",
134
- "prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
135
- "build": "pnpm clean && (pnpm build:esm & pnpm build:cjs) && pnpm script:module-fixup && pnpm script:copy-interface-doc",
136
- "build:esm": "tsc -p tsconfig.json && pnpm script:add-deno-type-references",
137
- "build:cjs": "tsc -p tsconfig-cjs.json",
138
- "script:module-fixup": "node scripts/module-fixup.js",
139
- "script:copy-interface-doc": "node scripts/copy-interface-documentation.js",
140
- "script:add-deno-type-references": "node scripts/add-deno-type-references.js",
141
- "script:align-site-version": "node --experimental-strip-types scripts/align-site-version.mts",
142
- "script:generate-site-examples": "node scripts/generate-site-examples.js",
143
- "script:exclude-test-files-for-backwards-compat": "node --experimental-strip-types scripts/exclude-test-files-for-backwards-compat.mts",
144
- "version": "pnpm script:align-site-version && git add .",
145
- "postversion": "pnpm publish --no-git-checks",
146
- "publish:dry-run": "pnpm build && npm pack --dry-run",
147
- "publish:check": "pnpm build && npm publish --dry-run"
148
152
  }
149
153
  }