opencode-gateway 0.2.4 → 0.2.5
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 +17391 -1392
- package/dist/runtime/delay.d.ts +1 -0
- package/dist/store/database.d.ts +22 -0
- package/dist/store/migrations.d.ts +2 -2
- package/dist/store/sqlite.d.ts +2 -2
- package/package.json +9 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function delay(durationMs: number): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type SqliteQueryStatementLike<Row, Params extends unknown[]> = {
|
|
2
|
+
get(...params: Params): Row | undefined;
|
|
3
|
+
all(...params: Params): Row[];
|
|
4
|
+
run(...params: Params): {
|
|
5
|
+
changes: number;
|
|
6
|
+
lastInsertRowid: bigint | number;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type SqliteDatabaseLike = {
|
|
10
|
+
exec(source: string): void;
|
|
11
|
+
query<Row, Params extends unknown[]>(source: string): SqliteQueryStatementLike<Row, Params>;
|
|
12
|
+
transaction<Args extends unknown[], Result>(handler: (...args: Args) => Result): (...args: Args) => Result;
|
|
13
|
+
close(): void;
|
|
14
|
+
};
|
|
15
|
+
export declare class SqliteDatabase implements SqliteDatabaseLike {
|
|
16
|
+
private readonly db;
|
|
17
|
+
constructor(path: string);
|
|
18
|
+
exec(source: string): void;
|
|
19
|
+
query<Row, Params extends unknown[]>(source: string): SqliteQueryStatementLike<Row, Params>;
|
|
20
|
+
transaction<Args extends unknown[], Result>(handler: (...args: Args) => Result): (...args: Args) => Result;
|
|
21
|
+
close(): void;
|
|
22
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function migrateGatewayDatabase(db:
|
|
1
|
+
import type { SqliteDatabaseLike } from "./database";
|
|
2
|
+
export declare function migrateGatewayDatabase(db: SqliteDatabaseLike): void;
|
package/dist/store/sqlite.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Database } from "bun:sqlite";
|
|
2
1
|
import type { BindingDeliveryTarget } from "../binding";
|
|
3
2
|
import type { GatewayQuestionInfo, PendingQuestionRecord } from "../questions/types";
|
|
3
|
+
import type { SqliteDatabaseLike } from "./database";
|
|
4
4
|
export type RuntimeJournalKind = "inbound_message" | "cron_dispatch" | "delivery" | "mailbox_enqueue" | "mailbox_flush";
|
|
5
5
|
export type CronRunStatus = "running" | "succeeded" | "failed" | "abandoned";
|
|
6
6
|
export type ScheduleJobKind = "cron" | "once";
|
|
@@ -103,7 +103,7 @@ export type PersistPendingQuestionInput = {
|
|
|
103
103
|
};
|
|
104
104
|
export declare class SqliteStore {
|
|
105
105
|
private readonly db;
|
|
106
|
-
constructor(db:
|
|
106
|
+
constructor(db: SqliteDatabaseLike);
|
|
107
107
|
getSessionBinding(conversationKey: string): string | null;
|
|
108
108
|
putSessionBinding(conversationKey: string, sessionId: string, recordedAtMs: number): void;
|
|
109
109
|
putSessionBindingIfUnchanged(conversationKey: string, expectedSessionId: string | null, nextSessionId: string, recordedAtMs: number): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-gateway",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Gateway plugin for OpenCode",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "node ./scripts/build.mjs",
|
|
27
27
|
"build:wasm": "node ../../scripts/build-binding.mjs",
|
|
28
|
-
"check": "tsc --noEmit --project tsconfig.json && bun test src",
|
|
28
|
+
"check": "tsc --noEmit --project tsconfig.json && bun test src && node ./scripts/build.mjs && node ./scripts/smoke-node-import.mjs",
|
|
29
29
|
"prepack": "npm run build:wasm && npm run build",
|
|
30
30
|
"test": "bun test src"
|
|
31
31
|
},
|
|
@@ -53,9 +53,15 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@opencode-ai/plugin": "~1.3.0",
|
|
56
|
-
"@opencode-ai/sdk": "~1.3.0"
|
|
56
|
+
"@opencode-ai/sdk": "~1.3.0",
|
|
57
|
+
"better-sqlite3": "^12.8.0",
|
|
58
|
+
"fast-glob": "^3.3.3",
|
|
59
|
+
"mime-types": "^3.0.2",
|
|
60
|
+
"smol-toml": "^1.6.1"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
63
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
64
|
+
"@types/mime-types": "^3.0.1",
|
|
59
65
|
"bun-types": "^1.3.11"
|
|
60
66
|
}
|
|
61
67
|
}
|