@opentrust/db 7.3.8 → 7.3.10

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.
@@ -1103,6 +1103,157 @@ export declare const toolCallObservations: import("drizzle-orm/mysql-core").MySq
1103
1103
  };
1104
1104
  dialect: "mysql";
1105
1105
  }>;
1106
+ export declare const commands: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
1107
+ name: "commands";
1108
+ schema: undefined;
1109
+ columns: {
1110
+ id: import("drizzle-orm/mysql-core").MySqlColumn<{
1111
+ name: "id";
1112
+ tableName: "commands";
1113
+ dataType: "string";
1114
+ columnType: "MySqlVarChar";
1115
+ data: string;
1116
+ driverParam: string | number;
1117
+ notNull: true;
1118
+ hasDefault: true;
1119
+ isPrimaryKey: true;
1120
+ isAutoincrement: false;
1121
+ hasRuntimeDefault: true;
1122
+ enumValues: [string, ...string[]];
1123
+ baseColumn: never;
1124
+ generated: undefined;
1125
+ }, object>;
1126
+ tenantId: import("drizzle-orm/mysql-core").MySqlColumn<{
1127
+ name: "tenant_id";
1128
+ tableName: "commands";
1129
+ dataType: "string";
1130
+ columnType: "MySqlVarChar";
1131
+ data: string;
1132
+ driverParam: string | number;
1133
+ notNull: true;
1134
+ hasDefault: true;
1135
+ isPrimaryKey: false;
1136
+ isAutoincrement: false;
1137
+ hasRuntimeDefault: false;
1138
+ enumValues: [string, ...string[]];
1139
+ baseColumn: never;
1140
+ generated: undefined;
1141
+ }, object>;
1142
+ agentId: import("drizzle-orm/mysql-core").MySqlColumn<{
1143
+ name: "agent_id";
1144
+ tableName: "commands";
1145
+ dataType: "string";
1146
+ columnType: "MySqlVarChar";
1147
+ data: string;
1148
+ driverParam: string | number;
1149
+ notNull: true;
1150
+ hasDefault: false;
1151
+ isPrimaryKey: false;
1152
+ isAutoincrement: false;
1153
+ hasRuntimeDefault: false;
1154
+ enumValues: [string, ...string[]];
1155
+ baseColumn: never;
1156
+ generated: undefined;
1157
+ }, object>;
1158
+ type: import("drizzle-orm/mysql-core").MySqlColumn<{
1159
+ name: "type";
1160
+ tableName: "commands";
1161
+ dataType: "string";
1162
+ columnType: "MySqlVarChar";
1163
+ data: string;
1164
+ driverParam: string | number;
1165
+ notNull: true;
1166
+ hasDefault: false;
1167
+ isPrimaryKey: false;
1168
+ isAutoincrement: false;
1169
+ hasRuntimeDefault: false;
1170
+ enumValues: [string, ...string[]];
1171
+ baseColumn: never;
1172
+ generated: undefined;
1173
+ }, object>;
1174
+ payload: import("drizzle-orm/mysql-core").MySqlColumn<{
1175
+ name: "payload";
1176
+ tableName: "commands";
1177
+ dataType: "json";
1178
+ columnType: "MySqlJson";
1179
+ data: unknown;
1180
+ driverParam: string;
1181
+ notNull: false;
1182
+ hasDefault: false;
1183
+ isPrimaryKey: false;
1184
+ isAutoincrement: false;
1185
+ hasRuntimeDefault: false;
1186
+ enumValues: undefined;
1187
+ baseColumn: never;
1188
+ generated: undefined;
1189
+ }, object>;
1190
+ status: import("drizzle-orm/mysql-core").MySqlColumn<{
1191
+ name: "status";
1192
+ tableName: "commands";
1193
+ dataType: "string";
1194
+ columnType: "MySqlVarChar";
1195
+ data: string;
1196
+ driverParam: string | number;
1197
+ notNull: true;
1198
+ hasDefault: true;
1199
+ isPrimaryKey: false;
1200
+ isAutoincrement: false;
1201
+ hasRuntimeDefault: false;
1202
+ enumValues: [string, ...string[]];
1203
+ baseColumn: never;
1204
+ generated: undefined;
1205
+ }, object>;
1206
+ result: import("drizzle-orm/mysql-core").MySqlColumn<{
1207
+ name: "result";
1208
+ tableName: "commands";
1209
+ dataType: "json";
1210
+ columnType: "MySqlJson";
1211
+ data: unknown;
1212
+ driverParam: string;
1213
+ notNull: false;
1214
+ hasDefault: false;
1215
+ isPrimaryKey: false;
1216
+ isAutoincrement: false;
1217
+ hasRuntimeDefault: false;
1218
+ enumValues: undefined;
1219
+ baseColumn: never;
1220
+ generated: undefined;
1221
+ }, object>;
1222
+ createdAt: import("drizzle-orm/mysql-core").MySqlColumn<{
1223
+ name: "created_at";
1224
+ tableName: "commands";
1225
+ dataType: "date";
1226
+ columnType: "MySqlDateTime";
1227
+ data: Date;
1228
+ driverParam: string | number;
1229
+ notNull: true;
1230
+ hasDefault: true;
1231
+ isPrimaryKey: false;
1232
+ isAutoincrement: false;
1233
+ hasRuntimeDefault: true;
1234
+ enumValues: undefined;
1235
+ baseColumn: never;
1236
+ generated: undefined;
1237
+ }, object>;
1238
+ updatedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
1239
+ name: "updated_at";
1240
+ tableName: "commands";
1241
+ dataType: "date";
1242
+ columnType: "MySqlDateTime";
1243
+ data: Date;
1244
+ driverParam: string | number;
1245
+ notNull: true;
1246
+ hasDefault: true;
1247
+ isPrimaryKey: false;
1248
+ isAutoincrement: false;
1249
+ hasRuntimeDefault: true;
1250
+ enumValues: undefined;
1251
+ baseColumn: never;
1252
+ generated: undefined;
1253
+ }, object>;
1254
+ };
1255
+ dialect: "mysql";
1256
+ }>;
1106
1257
  export declare const agentPermissions: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
1107
1258
  name: "agent_permissions";
1108
1259
  schema: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../src/schema/mysql.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInB,CAAC;AAGH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBlB,CAAC;AAGF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB5B,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EActB,CAAC;AAGF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaxB,CAAC"}
@@ -107,6 +107,21 @@ export const toolCallObservations = mysqlTable("tool_call_observations", {
107
107
  timestampIdx: index("idx_tool_obs_timestamp").on(table.timestamp),
108
108
  tenantIdIdx: index("idx_tool_obs_tenant_id").on(table.tenantId),
109
109
  }));
110
+ // ─── Commands ─────────────────────────────────────────────────
111
+ export const commands = mysqlTable("commands", {
112
+ id: varchar("id", { length: 36 }).primaryKey().$defaultFn(() => crypto.randomUUID()),
113
+ tenantId: varchar("tenant_id", { length: 64 }).notNull().default("default"),
114
+ agentId: varchar("agent_id", { length: 36 }).notNull(),
115
+ type: varchar("type", { length: 64 }).notNull(),
116
+ payload: json("payload"),
117
+ status: varchar("status", { length: 32 }).notNull().default("pending"),
118
+ result: json("result"),
119
+ createdAt: datetime("created_at").notNull().$defaultFn(() => new Date()),
120
+ updatedAt: datetime("updated_at").notNull().$defaultFn(() => new Date()),
121
+ }, (table) => ({
122
+ agentStatusIdx: index("idx_commands_agent_status").on(table.tenantId, table.agentId, table.status),
123
+ createdAtIdx: index("idx_commands_created_at").on(table.createdAt),
124
+ }));
110
125
  // ─── Agent Permissions ────────────────────────────────────────
111
126
  export const agentPermissions = mysqlTable("agent_permissions", {
112
127
  id: varchar("id", { length: 36 }).primaryKey().$defaultFn(() => crypto.randomUUID()),
@@ -1103,6 +1103,157 @@ export declare const toolCallObservations: import("drizzle-orm/pg-core").PgTable
1103
1103
  };
1104
1104
  dialect: "pg";
1105
1105
  }>;
1106
+ export declare const commands: import("drizzle-orm/pg-core").PgTableWithColumns<{
1107
+ name: "commands";
1108
+ schema: undefined;
1109
+ columns: {
1110
+ id: import("drizzle-orm/pg-core").PgColumn<{
1111
+ name: "id";
1112
+ tableName: "commands";
1113
+ dataType: "string";
1114
+ columnType: "PgUUID";
1115
+ data: string;
1116
+ driverParam: string;
1117
+ notNull: true;
1118
+ hasDefault: true;
1119
+ isPrimaryKey: true;
1120
+ isAutoincrement: false;
1121
+ hasRuntimeDefault: false;
1122
+ enumValues: undefined;
1123
+ baseColumn: never;
1124
+ generated: undefined;
1125
+ }, {}, {}>;
1126
+ tenantId: import("drizzle-orm/pg-core").PgColumn<{
1127
+ name: "tenant_id";
1128
+ tableName: "commands";
1129
+ dataType: "string";
1130
+ columnType: "PgVarchar";
1131
+ data: string;
1132
+ driverParam: string;
1133
+ notNull: true;
1134
+ hasDefault: true;
1135
+ isPrimaryKey: false;
1136
+ isAutoincrement: false;
1137
+ hasRuntimeDefault: false;
1138
+ enumValues: [string, ...string[]];
1139
+ baseColumn: never;
1140
+ generated: undefined;
1141
+ }, {}, {}>;
1142
+ agentId: import("drizzle-orm/pg-core").PgColumn<{
1143
+ name: "agent_id";
1144
+ tableName: "commands";
1145
+ dataType: "string";
1146
+ columnType: "PgUUID";
1147
+ data: string;
1148
+ driverParam: string;
1149
+ notNull: true;
1150
+ hasDefault: false;
1151
+ isPrimaryKey: false;
1152
+ isAutoincrement: false;
1153
+ hasRuntimeDefault: false;
1154
+ enumValues: undefined;
1155
+ baseColumn: never;
1156
+ generated: undefined;
1157
+ }, {}, {}>;
1158
+ type: import("drizzle-orm/pg-core").PgColumn<{
1159
+ name: "type";
1160
+ tableName: "commands";
1161
+ dataType: "string";
1162
+ columnType: "PgVarchar";
1163
+ data: string;
1164
+ driverParam: string;
1165
+ notNull: true;
1166
+ hasDefault: false;
1167
+ isPrimaryKey: false;
1168
+ isAutoincrement: false;
1169
+ hasRuntimeDefault: false;
1170
+ enumValues: [string, ...string[]];
1171
+ baseColumn: never;
1172
+ generated: undefined;
1173
+ }, {}, {}>;
1174
+ payload: import("drizzle-orm/pg-core").PgColumn<{
1175
+ name: "payload";
1176
+ tableName: "commands";
1177
+ dataType: "json";
1178
+ columnType: "PgJsonb";
1179
+ data: unknown;
1180
+ driverParam: unknown;
1181
+ notNull: false;
1182
+ hasDefault: false;
1183
+ isPrimaryKey: false;
1184
+ isAutoincrement: false;
1185
+ hasRuntimeDefault: false;
1186
+ enumValues: undefined;
1187
+ baseColumn: never;
1188
+ generated: undefined;
1189
+ }, {}, {}>;
1190
+ status: import("drizzle-orm/pg-core").PgColumn<{
1191
+ name: "status";
1192
+ tableName: "commands";
1193
+ dataType: "string";
1194
+ columnType: "PgVarchar";
1195
+ data: string;
1196
+ driverParam: string;
1197
+ notNull: true;
1198
+ hasDefault: true;
1199
+ isPrimaryKey: false;
1200
+ isAutoincrement: false;
1201
+ hasRuntimeDefault: false;
1202
+ enumValues: [string, ...string[]];
1203
+ baseColumn: never;
1204
+ generated: undefined;
1205
+ }, {}, {}>;
1206
+ result: import("drizzle-orm/pg-core").PgColumn<{
1207
+ name: "result";
1208
+ tableName: "commands";
1209
+ dataType: "json";
1210
+ columnType: "PgJsonb";
1211
+ data: unknown;
1212
+ driverParam: unknown;
1213
+ notNull: false;
1214
+ hasDefault: false;
1215
+ isPrimaryKey: false;
1216
+ isAutoincrement: false;
1217
+ hasRuntimeDefault: false;
1218
+ enumValues: undefined;
1219
+ baseColumn: never;
1220
+ generated: undefined;
1221
+ }, {}, {}>;
1222
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1223
+ name: "created_at";
1224
+ tableName: "commands";
1225
+ dataType: "date";
1226
+ columnType: "PgTimestamp";
1227
+ data: Date;
1228
+ driverParam: string;
1229
+ notNull: true;
1230
+ hasDefault: true;
1231
+ isPrimaryKey: false;
1232
+ isAutoincrement: false;
1233
+ hasRuntimeDefault: false;
1234
+ enumValues: undefined;
1235
+ baseColumn: never;
1236
+ generated: undefined;
1237
+ }, {}, {}>;
1238
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
1239
+ name: "updated_at";
1240
+ tableName: "commands";
1241
+ dataType: "date";
1242
+ columnType: "PgTimestamp";
1243
+ data: Date;
1244
+ driverParam: string;
1245
+ notNull: true;
1246
+ hasDefault: true;
1247
+ isPrimaryKey: false;
1248
+ isAutoincrement: false;
1249
+ hasRuntimeDefault: false;
1250
+ enumValues: undefined;
1251
+ baseColumn: never;
1252
+ generated: undefined;
1253
+ }, {}, {}>;
1254
+ };
1255
+ dialect: "pg";
1256
+ }>;
1106
1257
  export declare const agentPermissions: import("drizzle-orm/pg-core").PgTableWithColumns<{
1107
1258
  name: "agent_permissions";
1108
1259
  schema: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"pg.d.ts","sourceRoot":"","sources":["../../src/schema/pg.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInB,CAAC;AAGH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBlB,CAAC;AAGF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB9B,CAAC;AAGF,eAAO,MAAM,QAAQ;;;;;;;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;;;EAqB5B,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EActB,CAAC;AAGF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaxB,CAAC"}
package/dist/schema/pg.js CHANGED
@@ -107,6 +107,21 @@ export const toolCallObservations = pgTable("tool_call_observations", {
107
107
  timestampIdx: index("idx_tool_obs_timestamp").on(table.timestamp),
108
108
  tenantIdIdx: index("idx_tool_obs_tenant_id").on(table.tenantId),
109
109
  }));
110
+ // ─── Commands ─────────────────────────────────────────────────
111
+ export const commands = pgTable("commands", {
112
+ id: uuid("id").primaryKey().defaultRandom(),
113
+ tenantId: varchar("tenant_id", { length: 64 }).notNull().default("default"),
114
+ agentId: uuid("agent_id").notNull(),
115
+ type: varchar("type", { length: 64 }).notNull(),
116
+ payload: jsonb("payload"),
117
+ status: varchar("status", { length: 32 }).notNull().default("pending"),
118
+ result: jsonb("result"),
119
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
120
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
121
+ }, (table) => ({
122
+ agentStatusIdx: index("idx_commands_agent_status").on(table.tenantId, table.agentId, table.status),
123
+ createdAtIdx: index("idx_commands_created_at").on(table.createdAt),
124
+ }));
110
125
  // ─── Agent Permissions ────────────────────────────────────────
111
126
  export const agentPermissions = pgTable("agent_permissions", {
112
127
  id: uuid("id").primaryKey().defaultRandom(),
@@ -1293,6 +1293,157 @@ export declare const userSessions: import("drizzle-orm/sqlite-core").SQLiteTable
1293
1293
  };
1294
1294
  dialect: "sqlite";
1295
1295
  }>;
1296
+ export declare const commands: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
1297
+ name: "commands";
1298
+ schema: undefined;
1299
+ columns: {
1300
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1301
+ name: "id";
1302
+ tableName: "commands";
1303
+ dataType: "string";
1304
+ columnType: "SQLiteText";
1305
+ data: string;
1306
+ driverParam: string;
1307
+ notNull: true;
1308
+ hasDefault: true;
1309
+ isPrimaryKey: true;
1310
+ isAutoincrement: false;
1311
+ hasRuntimeDefault: true;
1312
+ enumValues: [string, ...string[]];
1313
+ baseColumn: never;
1314
+ generated: undefined;
1315
+ }, object>;
1316
+ tenantId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1317
+ name: "tenant_id";
1318
+ tableName: "commands";
1319
+ dataType: "string";
1320
+ columnType: "SQLiteText";
1321
+ data: string;
1322
+ driverParam: string;
1323
+ notNull: true;
1324
+ hasDefault: true;
1325
+ isPrimaryKey: false;
1326
+ isAutoincrement: false;
1327
+ hasRuntimeDefault: false;
1328
+ enumValues: [string, ...string[]];
1329
+ baseColumn: never;
1330
+ generated: undefined;
1331
+ }, object>;
1332
+ agentId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1333
+ name: "agent_id";
1334
+ tableName: "commands";
1335
+ dataType: "string";
1336
+ columnType: "SQLiteText";
1337
+ data: string;
1338
+ driverParam: string;
1339
+ notNull: true;
1340
+ hasDefault: false;
1341
+ isPrimaryKey: false;
1342
+ isAutoincrement: false;
1343
+ hasRuntimeDefault: false;
1344
+ enumValues: [string, ...string[]];
1345
+ baseColumn: never;
1346
+ generated: undefined;
1347
+ }, object>;
1348
+ type: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1349
+ name: "type";
1350
+ tableName: "commands";
1351
+ dataType: "string";
1352
+ columnType: "SQLiteText";
1353
+ data: string;
1354
+ driverParam: string;
1355
+ notNull: true;
1356
+ hasDefault: false;
1357
+ isPrimaryKey: false;
1358
+ isAutoincrement: false;
1359
+ hasRuntimeDefault: false;
1360
+ enumValues: [string, ...string[]];
1361
+ baseColumn: never;
1362
+ generated: undefined;
1363
+ }, object>;
1364
+ payload: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1365
+ name: "payload";
1366
+ tableName: "commands";
1367
+ dataType: "json";
1368
+ columnType: "SQLiteTextJson";
1369
+ data: unknown;
1370
+ driverParam: string;
1371
+ notNull: false;
1372
+ hasDefault: false;
1373
+ isPrimaryKey: false;
1374
+ isAutoincrement: false;
1375
+ hasRuntimeDefault: false;
1376
+ enumValues: undefined;
1377
+ baseColumn: never;
1378
+ generated: undefined;
1379
+ }, object>;
1380
+ status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1381
+ name: "status";
1382
+ tableName: "commands";
1383
+ dataType: "string";
1384
+ columnType: "SQLiteText";
1385
+ data: string;
1386
+ driverParam: string;
1387
+ notNull: true;
1388
+ hasDefault: true;
1389
+ isPrimaryKey: false;
1390
+ isAutoincrement: false;
1391
+ hasRuntimeDefault: false;
1392
+ enumValues: [string, ...string[]];
1393
+ baseColumn: never;
1394
+ generated: undefined;
1395
+ }, object>;
1396
+ result: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1397
+ name: "result";
1398
+ tableName: "commands";
1399
+ dataType: "json";
1400
+ columnType: "SQLiteTextJson";
1401
+ data: unknown;
1402
+ driverParam: string;
1403
+ notNull: false;
1404
+ hasDefault: false;
1405
+ isPrimaryKey: false;
1406
+ isAutoincrement: false;
1407
+ hasRuntimeDefault: false;
1408
+ enumValues: undefined;
1409
+ baseColumn: never;
1410
+ generated: undefined;
1411
+ }, object>;
1412
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1413
+ name: "created_at";
1414
+ tableName: "commands";
1415
+ dataType: "string";
1416
+ columnType: "SQLiteText";
1417
+ data: string;
1418
+ driverParam: string;
1419
+ notNull: true;
1420
+ hasDefault: true;
1421
+ isPrimaryKey: false;
1422
+ isAutoincrement: false;
1423
+ hasRuntimeDefault: true;
1424
+ enumValues: [string, ...string[]];
1425
+ baseColumn: never;
1426
+ generated: undefined;
1427
+ }, object>;
1428
+ updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1429
+ name: "updated_at";
1430
+ tableName: "commands";
1431
+ dataType: "string";
1432
+ columnType: "SQLiteText";
1433
+ data: string;
1434
+ driverParam: string;
1435
+ notNull: true;
1436
+ hasDefault: true;
1437
+ isPrimaryKey: false;
1438
+ isAutoincrement: false;
1439
+ hasRuntimeDefault: true;
1440
+ enumValues: [string, ...string[]];
1441
+ baseColumn: never;
1442
+ generated: undefined;
1443
+ }, object>;
1444
+ };
1445
+ dialect: "sqlite";
1446
+ }>;
1296
1447
  export declare const agentPermissions: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
1297
1448
  name: "agent_permissions";
1298
1449
  schema: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/schema/sqlite.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInB,CAAC;AAGH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBlB,CAAC;AAGF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB9B,CAAC;AAGF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB5B,CAAC"}
@@ -132,6 +132,21 @@ export const userSessions = sqliteTable("user_sessions", {
132
132
  tokenIdx: index("idx_user_sessions_token").on(table.token),
133
133
  emailIdx: index("idx_user_sessions_email").on(table.email),
134
134
  }));
135
+ // ─── Commands ─────────────────────────────────────────────────
136
+ export const commands = sqliteTable("commands", {
137
+ id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),
138
+ tenantId: text("tenant_id").notNull().default("default"),
139
+ agentId: text("agent_id").notNull(),
140
+ type: text("type").notNull(),
141
+ payload: text("payload", { mode: "json" }),
142
+ status: text("status").notNull().default("pending"),
143
+ result: text("result", { mode: "json" }),
144
+ createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
145
+ updatedAt: text("updated_at").notNull().$defaultFn(() => new Date().toISOString()),
146
+ }, (table) => ({
147
+ agentStatusIdx: index("idx_commands_agent_status").on(table.tenantId, table.agentId, table.status),
148
+ createdAtIdx: index("idx_commands_created_at").on(table.createdAt),
149
+ }));
135
150
  // ─── Agent Permissions ────────────────────────────────────────
136
151
  export const agentPermissions = sqliteTable("agent_permissions", {
137
152
  id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),