@gobing-ai/ts-db 0.4.60 → 0.4.63
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
|
@@ -265,6 +265,13 @@ const stats = await queue.getStats();
|
|
|
265
265
|
// → { pending: 5, processing: 2, completed: 100, failed: 3 }
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
+
**Delivery semantics:** the lease path is **at-least-once, never exactly-once**. A
|
|
269
|
+
claimed job whose lease expires (crash, lost renewal, stalled event loop) becomes
|
|
270
|
+
claimable again and will execute a second time; the attempt token only fences the
|
|
271
|
+
*ack* (a stale `markCompleted`/`markFailed` from the lost owner is ignored), it
|
|
272
|
+
does not fence execution. Handlers must therefore be idempotent or carry their own
|
|
273
|
+
dedup key — assume any claimed job can run more than once under failure.
|
|
274
|
+
|
|
268
275
|
### InboxMessageDao — durable inter-agent messages
|
|
269
276
|
|
|
270
277
|
`InboxMessageDao` persists directed messages for team-mode or multi-agent workflows. It lives on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun-sqlite.d.ts","sourceRoot":"","sources":["../../src/adapters/bun-sqlite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAS5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,OAAO,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACL;AAWD;;GAE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,YAAW,SAAS;IAC9C,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,SAAS,CAAmC;IACpD;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0C;IAEpE,OAAO,CAAC,YAAY;gBAUR,OAAO,CAAC,EAAE,gBAAgB;IAmBtC,+EAA+E;IAC/E,IAAI,EAAE,IAAI,UAAU,CAEnB;IAED,wEAAwE;IACxE,YAAY,IAAI,iBAAiB,CAAC,OAAO,MAAM,CAAC;IAI1C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrD,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAQxE,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAK5D,KAAK,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAU5D,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -61,7 +61,8 @@ export class BunSqliteAdapter {
|
|
|
61
61
|
}
|
|
62
62
|
async queryFirst(sql, ...params) {
|
|
63
63
|
const stmt = this.getStatement(sql);
|
|
64
|
-
|
|
64
|
+
// bun:sqlite's get() returns null on no match; the DbAdapter contract (and D1) say undefined.
|
|
65
|
+
return (stmt.get(...params) ?? undefined);
|
|
65
66
|
}
|
|
66
67
|
async queryAll(sql, ...params) {
|
|
67
68
|
const stmt = this.getStatement(sql);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobing-ai/ts-db",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.63",
|
|
4
4
|
"description": "@gobing-ai/ts-db — a drizzle-free database facade: typed DAOs over Bun SQLite / Cloudflare D1, a small predicate query spec, single-source-of-truth tables, and migrations. Drizzle stays an internal detail.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-db-v<version> && git push --tags' && exit 1"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@gobing-ai/ts-runtime": "^0.4.
|
|
70
|
-
"@gobing-ai/ts-utils": "^0.4.
|
|
69
|
+
"@gobing-ai/ts-runtime": "^0.4.63",
|
|
70
|
+
"@gobing-ai/ts-utils": "^0.4.63"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"drizzle-orm": ">=0.38.0",
|
|
@@ -98,7 +98,10 @@ export class BunSqliteAdapter implements DbAdapter {
|
|
|
98
98
|
|
|
99
99
|
async queryFirst<T>(sql: string, ...params: unknown[]): Promise<T | undefined> {
|
|
100
100
|
const stmt = this.getStatement(sql);
|
|
101
|
-
|
|
101
|
+
// bun:sqlite's get() returns null on no match; the DbAdapter contract (and D1) say undefined.
|
|
102
|
+
return ((stmt as unknown as { get: (...p: unknown[]) => T | null }).get(...params) ?? undefined) as
|
|
103
|
+
| T
|
|
104
|
+
| undefined;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
async queryAll<T>(sql: string, ...params: unknown[]): Promise<T[]> {
|