@signetai/connector-base 0.167.0 → 0.169.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.
Files changed (2) hide show
  1. package/dist/index.js +52 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10377,6 +10377,36 @@ function up106(db) {
10377
10377
  }
10378
10378
  db.exec("CREATE INDEX IF NOT EXISTS idx_memories_review_after ON memories(review_after);");
10379
10379
  }
10380
+ function hasColumn18(db, table, column) {
10381
+ return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
10382
+ }
10383
+ var TOKEN_COLUMNS = [
10384
+ ["tokens_input", "INTEGER"],
10385
+ ["tokens_output", "INTEGER"],
10386
+ ["tokens_cache_read", "INTEGER"],
10387
+ ["tokens_cache_write", "INTEGER"],
10388
+ ["tokens_cost", "REAL"]
10389
+ ];
10390
+ function up107(db) {
10391
+ for (const [column, type] of TOKEN_COLUMNS) {
10392
+ if (!hasColumn18(db, "dreaming_passes", column)) {
10393
+ db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
10394
+ }
10395
+ }
10396
+ }
10397
+ function up108(db) {
10398
+ db.exec(`
10399
+ CREATE TABLE IF NOT EXISTS embedding_usage (
10400
+ day TEXT NOT NULL,
10401
+ agent_id TEXT NOT NULL DEFAULT '',
10402
+ source_kind TEXT NOT NULL,
10403
+ provider TEXT NOT NULL,
10404
+ requests INTEGER NOT NULL DEFAULT 0,
10405
+ tokens INTEGER NOT NULL DEFAULT 0,
10406
+ PRIMARY KEY (day, agent_id, source_kind, provider)
10407
+ );
10408
+ `);
10409
+ }
10380
10410
  var MIGRATIONS = [
10381
10411
  {
10382
10412
  version: 1,
@@ -11217,6 +11247,28 @@ var MIGRATIONS = [
11217
11247
  artifacts: {
11218
11248
  columns: [{ table: "memories", column: "review_after" }]
11219
11249
  }
11250
+ },
11251
+ {
11252
+ version: 107,
11253
+ name: "dreaming-pass-usage",
11254
+ up: up107,
11255
+ artifacts: {
11256
+ columns: [
11257
+ { table: "dreaming_passes", column: "tokens_input" },
11258
+ { table: "dreaming_passes", column: "tokens_output" },
11259
+ { table: "dreaming_passes", column: "tokens_cache_read" },
11260
+ { table: "dreaming_passes", column: "tokens_cache_write" },
11261
+ { table: "dreaming_passes", column: "tokens_cost" }
11262
+ ]
11263
+ }
11264
+ },
11265
+ {
11266
+ version: 108,
11267
+ name: "embedding-usage",
11268
+ up: up108,
11269
+ artifacts: {
11270
+ tables: ["embedding_usage"]
11271
+ }
11220
11272
  }
11221
11273
  ];
11222
11274
  var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/connector-base",
3
- "version": "0.167.0",
3
+ "version": "0.169.0",
4
4
  "description": "Base class for Signet harness connectors",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsc --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@signetai/core": "0.167.0",
29
+ "@signetai/core": "0.169.0",
30
30
  "json5": "^2.2.3",
31
31
  "jsonc-parser": "3.3.1"
32
32
  },