swarm-mail 1.9.0 → 1.9.3
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/db/schema/streams.d.ts +0 -57
- package/dist/db/schema/streams.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/libsql.d.ts.map +1 -1
- package/dist/streams/libsql-schema.d.ts.map +1 -1
- package/dist/streams/migrate-timestamps.d.ts +29 -0
- package/dist/streams/migrate-timestamps.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -138,25 +138,6 @@ export declare const eventsTable: import("drizzle-orm/sqlite-core").SQLiteTableW
|
|
|
138
138
|
}, {}, {
|
|
139
139
|
length: number | undefined;
|
|
140
140
|
}>;
|
|
141
|
-
created_at: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
142
|
-
name: "created_at";
|
|
143
|
-
tableName: "events";
|
|
144
|
-
dataType: "string";
|
|
145
|
-
columnType: "SQLiteText";
|
|
146
|
-
data: string;
|
|
147
|
-
driverParam: string;
|
|
148
|
-
notNull: false;
|
|
149
|
-
hasDefault: true;
|
|
150
|
-
isPrimaryKey: false;
|
|
151
|
-
isAutoincrement: false;
|
|
152
|
-
hasRuntimeDefault: false;
|
|
153
|
-
enumValues: [string, ...string[]];
|
|
154
|
-
baseColumn: never;
|
|
155
|
-
identity: undefined;
|
|
156
|
-
generated: undefined;
|
|
157
|
-
}, {}, {
|
|
158
|
-
length: number | undefined;
|
|
159
|
-
}>;
|
|
160
141
|
};
|
|
161
142
|
dialect: "sqlite";
|
|
162
143
|
}>;
|
|
@@ -1888,25 +1869,6 @@ export declare const decisionTracesTable: import("drizzle-orm/sqlite-core").SQLi
|
|
|
1888
1869
|
identity: undefined;
|
|
1889
1870
|
generated: undefined;
|
|
1890
1871
|
}, {}, {}>;
|
|
1891
|
-
created_at: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
1892
|
-
name: "created_at";
|
|
1893
|
-
tableName: "decision_traces";
|
|
1894
|
-
dataType: "string";
|
|
1895
|
-
columnType: "SQLiteText";
|
|
1896
|
-
data: string;
|
|
1897
|
-
driverParam: string;
|
|
1898
|
-
notNull: false;
|
|
1899
|
-
hasDefault: true;
|
|
1900
|
-
isPrimaryKey: false;
|
|
1901
|
-
isAutoincrement: false;
|
|
1902
|
-
hasRuntimeDefault: false;
|
|
1903
|
-
enumValues: [string, ...string[]];
|
|
1904
|
-
baseColumn: never;
|
|
1905
|
-
identity: undefined;
|
|
1906
|
-
generated: undefined;
|
|
1907
|
-
}, {}, {
|
|
1908
|
-
length: number | undefined;
|
|
1909
|
-
}>;
|
|
1910
1872
|
};
|
|
1911
1873
|
dialect: "sqlite";
|
|
1912
1874
|
}>;
|
|
@@ -2064,25 +2026,6 @@ export declare const entityLinksTable: import("drizzle-orm/sqlite-core").SQLiteT
|
|
|
2064
2026
|
}, {}, {
|
|
2065
2027
|
length: number | undefined;
|
|
2066
2028
|
}>;
|
|
2067
|
-
created_at: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2068
|
-
name: "created_at";
|
|
2069
|
-
tableName: "entity_links";
|
|
2070
|
-
dataType: "string";
|
|
2071
|
-
columnType: "SQLiteText";
|
|
2072
|
-
data: string;
|
|
2073
|
-
driverParam: string;
|
|
2074
|
-
notNull: false;
|
|
2075
|
-
hasDefault: true;
|
|
2076
|
-
isPrimaryKey: false;
|
|
2077
|
-
isAutoincrement: false;
|
|
2078
|
-
hasRuntimeDefault: false;
|
|
2079
|
-
enumValues: [string, ...string[]];
|
|
2080
|
-
baseColumn: never;
|
|
2081
|
-
identity: undefined;
|
|
2082
|
-
generated: undefined;
|
|
2083
|
-
}, {}, {
|
|
2084
|
-
length: number | undefined;
|
|
2085
|
-
}>;
|
|
2086
2029
|
};
|
|
2087
2030
|
dialect: "sqlite";
|
|
2088
2031
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../../src/db/schema/streams.ts"],"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;;;;;;EAe7B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyB/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAC;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -66992,8 +66992,10 @@ async function createLibSQLAdapter(config2) {
|
|
|
66992
66992
|
};
|
|
66993
66993
|
const client = createClient(clientConfig);
|
|
66994
66994
|
await client.execute("SELECT 1");
|
|
66995
|
+
await client.execute("PRAGMA auto_vacuum = INCREMENTAL");
|
|
66995
66996
|
await client.execute("PRAGMA foreign_keys = ON");
|
|
66996
66997
|
await client.execute("PRAGMA busy_timeout = 5000");
|
|
66998
|
+
await client.execute("PRAGMA journal_mode = WAL");
|
|
66997
66999
|
return new LibSQLAdapter(client);
|
|
66998
67000
|
}
|
|
66999
67001
|
var init_libsql = () => {};
|
|
@@ -67753,8 +67755,7 @@ async function createLibSQLStreamsSchema(db) {
|
|
|
67753
67755
|
project_key TEXT NOT NULL,
|
|
67754
67756
|
timestamp INTEGER NOT NULL,
|
|
67755
67757
|
sequence INTEGER GENERATED ALWAYS AS (id) STORED,
|
|
67756
|
-
data TEXT NOT NULL
|
|
67757
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
67758
|
+
data TEXT NOT NULL
|
|
67758
67759
|
)
|
|
67759
67760
|
`);
|
|
67760
67761
|
await db.exec(`
|
|
@@ -67773,6 +67774,10 @@ async function createLibSQLStreamsSchema(db) {
|
|
|
67773
67774
|
CREATE INDEX IF NOT EXISTS idx_events_project_type
|
|
67774
67775
|
ON events(project_key, type)
|
|
67775
67776
|
`);
|
|
67777
|
+
await db.exec(`
|
|
67778
|
+
CREATE INDEX IF NOT EXISTS idx_events_project_timestamp
|
|
67779
|
+
ON events(project_key, timestamp)
|
|
67780
|
+
`);
|
|
67776
67781
|
await db.exec(`
|
|
67777
67782
|
CREATE TABLE IF NOT EXISTS agents (
|
|
67778
67783
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -67964,8 +67969,7 @@ async function createLibSQLStreamsSchema(db) {
|
|
|
67964
67969
|
precedent_cited TEXT,
|
|
67965
67970
|
outcome_event_id INTEGER,
|
|
67966
67971
|
quality_score REAL,
|
|
67967
|
-
timestamp INTEGER NOT NULL
|
|
67968
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
67972
|
+
timestamp INTEGER NOT NULL
|
|
67969
67973
|
)
|
|
67970
67974
|
`);
|
|
67971
67975
|
await db.exec(`
|
|
@@ -67992,8 +67996,7 @@ async function createLibSQLStreamsSchema(db) {
|
|
|
67992
67996
|
target_entity_id TEXT NOT NULL,
|
|
67993
67997
|
link_type TEXT NOT NULL,
|
|
67994
67998
|
strength REAL DEFAULT 1.0,
|
|
67995
|
-
context TEXT
|
|
67996
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
67999
|
+
context TEXT
|
|
67997
68000
|
)
|
|
67998
68001
|
`);
|
|
67999
68002
|
await db.exec(`
|
|
@@ -68034,7 +68037,7 @@ async function validateLibSQLStreamsSchema(db) {
|
|
|
68034
68037
|
PRAGMA table_xinfo('events')
|
|
68035
68038
|
`);
|
|
68036
68039
|
const eventsColNames = eventsCols.rows.map((r) => r.name);
|
|
68037
|
-
const requiredEventsCols = ["id", "type", "project_key", "timestamp", "sequence", "data"
|
|
68040
|
+
const requiredEventsCols = ["id", "type", "project_key", "timestamp", "sequence", "data"];
|
|
68038
68041
|
for (const col of requiredEventsCols) {
|
|
68039
68042
|
if (!eventsColNames.includes(col))
|
|
68040
68043
|
return false;
|
|
@@ -68135,7 +68138,7 @@ async function migrateLibSQLToGlobal(sourcePath, globalDb) {
|
|
|
68135
68138
|
`);
|
|
68136
68139
|
const tableNames = new Set(tablesResult.rows.map((row) => row.name));
|
|
68137
68140
|
if (tableNames.has("events")) {
|
|
68138
|
-
stats.events = await migrateTable(sourceDb, globalDb, "events", "id, type, project_key, timestamp, data
|
|
68141
|
+
stats.events = await migrateTable(sourceDb, globalDb, "events", "id, type, project_key, timestamp, data", stats.errors);
|
|
68139
68142
|
}
|
|
68140
68143
|
if (tableNames.has("agents")) {
|
|
68141
68144
|
stats.agents = await migrateTable(sourceDb, globalDb, "agents", "id, project_key, name, program, model, task_description, registered_at, last_active_at", stats.errors);
|
|
@@ -68247,7 +68250,7 @@ async function migrateLocalDbToGlobal(localDbPath, globalDbPath) {
|
|
|
68247
68250
|
`);
|
|
68248
68251
|
const tableNames = new Set(tablesResult.rows.map((row) => row.name));
|
|
68249
68252
|
if (tableNames.has("events")) {
|
|
68250
|
-
stats.events = await migrateTable(localDb, globalDb, "events", "id, type, project_key, timestamp, data
|
|
68253
|
+
stats.events = await migrateTable(localDb, globalDb, "events", "id, type, project_key, timestamp, data", stats.errors);
|
|
68251
68254
|
}
|
|
68252
68255
|
if (tableNames.has("agents")) {
|
|
68253
68256
|
stats.agents = await migrateTable(localDb, globalDb, "agents", "id, project_key, name, program, model, task_description, registered_at, last_active_at", stats.errors);
|
|
@@ -79115,8 +79118,7 @@ var init_streams = __esm(() => {
|
|
|
79115
79118
|
project_key: text("project_key").notNull(),
|
|
79116
79119
|
timestamp: integer4("timestamp").notNull(),
|
|
79117
79120
|
sequence: integer4("sequence").generatedAlwaysAs(sql`id`),
|
|
79118
|
-
data: text("data").notNull()
|
|
79119
|
-
created_at: text("created_at").default("datetime('now')")
|
|
79121
|
+
data: text("data").notNull()
|
|
79120
79122
|
}, (table5) => ({
|
|
79121
79123
|
projectKeyIdx: index("idx_events_project_key").on(table5.project_key),
|
|
79122
79124
|
typeIdx: index("idx_events_type").on(table5.type),
|
|
@@ -79247,8 +79249,7 @@ var init_streams = __esm(() => {
|
|
|
79247
79249
|
precedent_cited: text("precedent_cited"),
|
|
79248
79250
|
outcome_event_id: integer4("outcome_event_id"),
|
|
79249
79251
|
quality_score: real("quality_score"),
|
|
79250
|
-
timestamp: integer4("timestamp").notNull()
|
|
79251
|
-
created_at: text("created_at").default("(datetime('now'))")
|
|
79252
|
+
timestamp: integer4("timestamp").notNull()
|
|
79252
79253
|
}, (table5) => ({
|
|
79253
79254
|
epicIdx: index("idx_decision_traces_epic").on(table5.epic_id),
|
|
79254
79255
|
typeIdx: index("idx_decision_traces_type").on(table5.decision_type),
|
|
@@ -79262,8 +79263,7 @@ var init_streams = __esm(() => {
|
|
|
79262
79263
|
target_entity_id: text("target_entity_id").notNull(),
|
|
79263
79264
|
link_type: text("link_type").notNull(),
|
|
79264
79265
|
strength: real("strength").default(1),
|
|
79265
|
-
context: text("context")
|
|
79266
|
-
created_at: text("created_at").default("(datetime('now'))")
|
|
79266
|
+
context: text("context")
|
|
79267
79267
|
}, (table5) => ({
|
|
79268
79268
|
sourceIdx: index("idx_entity_links_source").on(table5.source_decision_id),
|
|
79269
79269
|
targetIdx: index("idx_entity_links_target").on(table5.target_entity_type, table5.target_entity_id),
|
|
@@ -116640,7 +116640,7 @@ function detectSchemaVersion(tables) {
|
|
|
116640
116640
|
return "unknown";
|
|
116641
116641
|
}
|
|
116642
116642
|
var TABLE_COLUMNS = {
|
|
116643
|
-
events: "type, project_key, timestamp, data
|
|
116643
|
+
events: "type, project_key, timestamp, data",
|
|
116644
116644
|
agents: "project_key, name, program, model, task_description, registered_at, last_active_at",
|
|
116645
116645
|
messages: "project_key, from_agent, subject, body, thread_id, importance, ack_required, created_at",
|
|
116646
116646
|
message_recipients: "message_id, agent_name, read_at, acked_at",
|
package/dist/libsql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsql.d.ts","sourceRoot":"","sources":["../src/libsql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GAChB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAA;CAAE,CAuFhD;AAmGD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"libsql.d.ts","sourceRoot":"","sources":["../src/libsql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GAChB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAA;CAAE,CAuFhD;AAmGD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,eAAe,CAAC,CAkD1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsql-schema.d.ts","sourceRoot":"","sources":["../../src/streams/libsql-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,yBAAyB,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"libsql-schema.d.ts","sourceRoot":"","sources":["../../src/streams/libsql-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,yBAAyB,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwWlF;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAahF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,2BAA2B,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAkCvF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Fix broken datetime('now') timestamps
|
|
3
|
+
*
|
|
4
|
+
* Problem: Some events have string literal "datetime('now')" instead of numeric timestamps.
|
|
5
|
+
* This happened when schema used DEFAULT (datetime('now')) which SQLite interprets as
|
|
6
|
+
* a string literal, not a function call.
|
|
7
|
+
*
|
|
8
|
+
* Solution: Replace all broken timestamps with current time (best effort - we don't
|
|
9
|
+
* know the actual event time).
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```bash
|
|
13
|
+
* bun run packages/swarm-mail/src/streams/migrate-timestamps.ts
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
interface MigrationResult {
|
|
17
|
+
brokenCount: number;
|
|
18
|
+
fixedCount: number;
|
|
19
|
+
errors: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Find and fix broken timestamps in the events table
|
|
23
|
+
*
|
|
24
|
+
* @param db - Database adapter (defaults to global DB)
|
|
25
|
+
* @returns Migration result with counts and errors
|
|
26
|
+
*/
|
|
27
|
+
export declare function migrateTimestamps(db?: any): Promise<MigrationResult>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=migrate-timestamps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-timestamps.d.ts","sourceRoot":"","sources":["../../src/streams/migrate-timestamps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,eAAe,CAAC,CAgD1E"}
|