opencode-mailbox 0.0.2 → 0.0.4
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 +3 -3
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -12678,7 +12678,7 @@ var init_dist = __esm(() => {
|
|
|
12678
12678
|
|
|
12679
12679
|
// index.ts
|
|
12680
12680
|
import * as path from "path";
|
|
12681
|
-
import Database from "
|
|
12681
|
+
import { Database } from "bun:sqlite";
|
|
12682
12682
|
var dbFile = null;
|
|
12683
12683
|
var db = null;
|
|
12684
12684
|
var activeWatches = new Map;
|
|
@@ -12693,7 +12693,7 @@ async function getDatabase(client) {
|
|
|
12693
12693
|
if (!db) {
|
|
12694
12694
|
const file2 = await getDbFile(client);
|
|
12695
12695
|
db = new Database(file2);
|
|
12696
|
-
db.
|
|
12696
|
+
db.run("PRAGMA journal_mode = WAL");
|
|
12697
12697
|
db.exec(`
|
|
12698
12698
|
CREATE TABLE IF NOT EXISTS messages (
|
|
12699
12699
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -12724,7 +12724,7 @@ async function addMessage(client, recipient, sender, message, timestamp) {
|
|
|
12724
12724
|
async function getUnreadMessages(client, recipient) {
|
|
12725
12725
|
const database = await getDatabase(client);
|
|
12726
12726
|
const stmt = database.prepare(`
|
|
12727
|
-
SELECT sender as from, message, timestamp, read
|
|
12727
|
+
SELECT sender as "from", message, timestamp, read
|
|
12728
12728
|
FROM messages
|
|
12729
12729
|
WHERE recipient = ? AND read = 0
|
|
12730
12730
|
ORDER BY timestamp ASC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-mailbox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A simple mailbox system for sending and receiving messages between sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "bun build ./index.ts --outdir ./dist --target bun
|
|
19
|
+
"build": "bun build ./index.ts --outdir ./dist --target bun && bun run build:types",
|
|
20
20
|
"build:types": "tsc --emitDeclarationOnly",
|
|
21
21
|
"start": "bun run build",
|
|
22
22
|
"prepublishOnly": "bun run build"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/
|
|
25
|
+
"@types/bun": "^1.2.2",
|
|
26
26
|
"@types/node": "^25.0.10",
|
|
27
27
|
"electron": "^28.0.0",
|
|
28
28
|
"typescript": "^5.9.3"
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"@opencode-ai/plugin": "^1.1.25"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"better-sqlite3": "^12.1.0",
|
|
35
34
|
"dotenv": "^17.2.3"
|
|
36
35
|
},
|
|
37
36
|
"keywords": [
|