@dudousxd/nestjs-agent-store-drizzle 0.10.8 → 0.11.1

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/README.md CHANGED
@@ -116,6 +116,9 @@ ALTER TABLE agent_thread ADD COLUMN default_agent TEXT;
116
116
  ALTER TABLE agent_message ADD COLUMN run_id TEXT;
117
117
  ALTER TABLE agent_message ADD COLUMN attachments TEXT;
118
118
  ALTER TABLE agent_run ADD COLUMN parent_run_id TEXT;
119
+ ALTER TABLE agent_message ADD COLUMN reasoning TEXT;
120
+ ALTER TABLE agent_message ADD COLUMN reasoning_ms INTEGER;
121
+ ALTER TABLE agent_message ADD COLUMN ui TEXT;
119
122
  CREATE INDEX agent_tool_call_message_idx ON agent_tool_call (message_id);
120
123
  ```
121
124
 
package/dist/index.cjs CHANGED
@@ -90,6 +90,13 @@ var agentMessage = (0, import_sqlite_core.sqliteTable)("agent_message", {
90
90
  }).$type(),
91
91
  agentName: (0, import_sqlite_core.text)("agent_name"),
92
92
  runId: (0, import_sqlite_core.text)("run_id"),
93
+ /** The step's streamed thinking; `null` when the model produced none. */
94
+ reasoning: (0, import_sqlite_core.text)("reasoning"),
95
+ reasoningMs: (0, import_sqlite_core.integer)("reasoning_ms"),
96
+ /** Components pushed during the step (`ui` stream frames), replayed on reload. */
97
+ ui: (0, import_sqlite_core.text)("ui", {
98
+ mode: "json"
99
+ }).$type(),
93
100
  createdAt: (0, import_sqlite_core.integer)("created_at", {
94
101
  mode: "timestamp_ms"
95
102
  }).notNull()
@@ -286,6 +293,9 @@ var statements = [
286
293
  usage TEXT,
287
294
  agent_name TEXT,
288
295
  run_id TEXT,
296
+ reasoning TEXT,
297
+ reasoning_ms INTEGER,
298
+ ui TEXT,
289
299
  created_at INTEGER NOT NULL
290
300
  )`,
291
301
  `CREATE INDEX IF NOT EXISTS agent_message_thread_created_idx
@@ -405,6 +415,21 @@ var additiveColumns = [
405
415
  table: "agent_run",
406
416
  column: "parent_run_id",
407
417
  ddl: "ALTER TABLE agent_run ADD COLUMN parent_run_id TEXT"
418
+ },
419
+ {
420
+ table: "agent_message",
421
+ column: "reasoning",
422
+ ddl: "ALTER TABLE agent_message ADD COLUMN reasoning TEXT"
423
+ },
424
+ {
425
+ table: "agent_message",
426
+ column: "reasoning_ms",
427
+ ddl: "ALTER TABLE agent_message ADD COLUMN reasoning_ms INTEGER"
428
+ },
429
+ {
430
+ table: "agent_message",
431
+ column: "ui",
432
+ ddl: "ALTER TABLE agent_message ADD COLUMN ui TEXT"
408
433
  }
409
434
  ];
410
435
  async function ensureAgentSchema(db) {
@@ -568,6 +593,9 @@ var DrizzleAgentStore = class {
568
593
  // turn produced this text gets the truthful answer; the run's own thread is still the
569
594
  // original, so a run-scoped read never picks the fork's rows up.
570
595
  runId: message.runId,
596
+ reasoning: message.reasoning,
597
+ reasoningMs: message.reasoningMs,
598
+ ui: message.ui,
571
599
  createdAt: message.createdAt
572
600
  })));
573
601
  }
@@ -711,6 +739,9 @@ var DrizzleAgentStore = class {
711
739
  usage: input.usage ?? null,
712
740
  agentName: input.agentName ?? null,
713
741
  runId: input.runId ?? null,
742
+ reasoning: input.reasoning ?? null,
743
+ reasoningMs: input.reasoningMs ?? null,
744
+ ui: input.ui ?? null,
714
745
  createdAt: now
715
746
  };
716
747
  await this.db.insert(agentMessage).values(message);
@@ -871,6 +902,15 @@ var DrizzleAgentStore = class {
871
902
  } : {},
872
903
  ...message.runId != null ? {
873
904
  runId: message.runId
905
+ } : {},
906
+ ...message.reasoning != null ? {
907
+ reasoning: message.reasoning
908
+ } : {},
909
+ ...message.reasoningMs != null ? {
910
+ reasoningMs: message.reasoningMs
911
+ } : {},
912
+ ...message.ui != null ? {
913
+ ui: message.ui
874
914
  } : {}
875
915
  };
876
916
  }