@deepagents/context 7.1.0 → 7.1.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/dist/index.js +8 -10
- package/dist/index.js.map +2 -2
- package/dist/lib/stream/sqlite.stream-store.d.ts.map +1 -1
- package/dist/scripts/scripts/generate-models-type.d.ts +2 -0
- package/dist/scripts/scripts/generate-models-type.d.ts.map +1 -0
- package/dist/scripts/scripts/probe-tool-output-reminders.d.ts +2 -0
- package/dist/scripts/scripts/probe-tool-output-reminders.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -13949,7 +13949,7 @@ import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
|
13949
13949
|
import { z as z19 } from "zod";
|
|
13950
13950
|
|
|
13951
13951
|
// packages/context/src/lib/stream/ddl.stream.sqlite.sql
|
|
13952
|
-
var ddl_stream_sqlite_default = "PRAGMA journal_mode = WAL;\nPRAGMA synchronous = NORMAL;\nPRAGMA foreign_keys = ON;\n\nCREATE TABLE IF NOT EXISTS streams (\n id TEXT PRIMARY KEY,\n status TEXT NOT NULL DEFAULT 'queued'\n CHECK(status IN ('queued','running','completed','failed','cancelled')),\n createdAt INTEGER NOT NULL,\n startedAt INTEGER,\n finishedAt INTEGER,\n cancelRequestedAt INTEGER,\n error TEXT\n);\n\nCREATE TABLE IF NOT EXISTS stream_chunks (\n streamId TEXT NOT NULL,\n seq INTEGER NOT NULL,\n data TEXT NOT NULL,\n createdAt INTEGER NOT NULL,\n PRIMARY KEY (streamId, seq),\n FOREIGN KEY (streamId) REFERENCES streams(id) ON DELETE CASCADE\n);\n\n-- Supports ordered listing across all streams.\nCREATE INDEX IF NOT EXISTS idx_streams_created_at_id\n ON streams(createdAt, id);\n\n-- Supports status-filtered ordered listing (e.g. running streams).\nCREATE INDEX IF NOT EXISTS idx_streams_status_created_at_id\n ON streams(status, createdAt, id);\n";
|
|
13952
|
+
var ddl_stream_sqlite_default = "PRAGMA busy_timeout = 5000;\nPRAGMA journal_mode = WAL;\nPRAGMA synchronous = NORMAL;\nPRAGMA foreign_keys = ON;\n\nCREATE TABLE IF NOT EXISTS streams (\n id TEXT PRIMARY KEY,\n status TEXT NOT NULL DEFAULT 'queued'\n CHECK(status IN ('queued','running','completed','failed','cancelled')),\n createdAt INTEGER NOT NULL,\n startedAt INTEGER,\n finishedAt INTEGER,\n cancelRequestedAt INTEGER,\n error TEXT\n);\n\nCREATE TABLE IF NOT EXISTS stream_chunks (\n streamId TEXT NOT NULL,\n seq INTEGER NOT NULL,\n data TEXT NOT NULL,\n createdAt INTEGER NOT NULL,\n PRIMARY KEY (streamId, seq),\n FOREIGN KEY (streamId) REFERENCES streams(id) ON DELETE CASCADE\n);\n\n-- Supports ordered listing across all streams.\nCREATE INDEX IF NOT EXISTS idx_streams_created_at_id\n ON streams(createdAt, id);\n\n-- Supports status-filtered ordered listing (e.g. running streams).\nCREATE INDEX IF NOT EXISTS idx_streams_status_created_at_id\n ON streams(status, createdAt, id);\n";
|
|
13953
13953
|
|
|
13954
13954
|
// packages/context/src/lib/stream/sqlite.stream-store.ts
|
|
13955
13955
|
var streamRow = z19.object({
|
|
@@ -14124,8 +14124,7 @@ var SqliteStreamStore = class extends StreamStore {
|
|
|
14124
14124
|
async appendChunks(chunks) {
|
|
14125
14125
|
if (chunks.length === 0) return;
|
|
14126
14126
|
const failures = collectStreamFailures(chunks);
|
|
14127
|
-
this.#
|
|
14128
|
-
try {
|
|
14127
|
+
this.#transaction(() => {
|
|
14129
14128
|
for (const chunk of chunks) {
|
|
14130
14129
|
this.#stmt(
|
|
14131
14130
|
`INSERT INTO stream_chunks (streamId, seq, data, createdAt)
|
|
@@ -14152,11 +14151,7 @@ var SqliteStreamStore = class extends StreamStore {
|
|
|
14152
14151
|
}
|
|
14153
14152
|
}
|
|
14154
14153
|
}
|
|
14155
|
-
|
|
14156
|
-
} catch (error) {
|
|
14157
|
-
this.#db.exec("ROLLBACK");
|
|
14158
|
-
throw error;
|
|
14159
|
-
}
|
|
14154
|
+
});
|
|
14160
14155
|
}
|
|
14161
14156
|
async getChunks(streamId, fromSeq, limit) {
|
|
14162
14157
|
let sql = "SELECT * FROM stream_chunks WHERE streamId = ?";
|
|
@@ -14212,13 +14207,16 @@ var SqliteStreamStore = class extends StreamStore {
|
|
|
14212
14207
|
});
|
|
14213
14208
|
}
|
|
14214
14209
|
#transaction(callback) {
|
|
14210
|
+
this.#db.exec("BEGIN IMMEDIATE");
|
|
14215
14211
|
try {
|
|
14216
|
-
this.#db.exec("BEGIN IMMEDIATE");
|
|
14217
14212
|
const result = callback();
|
|
14218
14213
|
this.#db.exec("COMMIT");
|
|
14219
14214
|
return result;
|
|
14220
14215
|
} catch (error) {
|
|
14221
|
-
|
|
14216
|
+
try {
|
|
14217
|
+
this.#db.exec("ROLLBACK");
|
|
14218
|
+
} catch {
|
|
14219
|
+
}
|
|
14222
14220
|
throw error;
|
|
14223
14221
|
}
|
|
14224
14222
|
}
|