or3-provider-sqlite 0.0.11 → 0.0.12
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 +20 -12
- package/dist/module.json +1 -1
- package/dist/runtime/server/plugins/register.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,19 +127,27 @@ OR3_CONNECT_PROVIDER=sqlite
|
|
|
127
127
|
|
|
128
128
|
On server startup, the Nitro plugin:
|
|
129
129
|
|
|
130
|
-
1.
|
|
131
|
-
2.
|
|
132
|
-
3. Registers `
|
|
133
|
-
4. Registers `
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
7. Registers `RateLimitProvider` with ID `sqlite` and the sync admin adapter
|
|
138
|
-
8. Registers a durable `BackgroundJobProvider` with ID `sqlite`, so active chat
|
|
130
|
+
1. Registers `AuthWorkspaceStore` with ID `sqlite`
|
|
131
|
+
2. Registers `SyncGatewayAdapter` when SQLite conversation transfer is enabled
|
|
132
|
+
3. Registers `ConnectStore` when SQLite Connect persistence is selected
|
|
133
|
+
4. Registers `WebhookStore` on runtimes other than D1, and the admin store
|
|
134
|
+
provider (D1 declares server-side admin capabilities unavailable)
|
|
135
|
+
5. Registers `RateLimitProvider` with ID `sqlite` and the sync admin adapter
|
|
136
|
+
6. Registers a durable `BackgroundJobProvider` with ID `sqlite`, so active chat
|
|
139
137
|
and workflow jobs remain addressable across Nitro HMR/module reloads
|
|
138
|
+
7. Initializes the database and runs schema migrations eagerly on local
|
|
139
|
+
runtimes, or on the first Worker request for D1
|
|
140
140
|
|
|
141
|
-
Registration is skipped when `auth.enabled` is `false`, or when
|
|
142
|
-
|
|
141
|
+
Registration is skipped when `auth.enabled` is `false`, or when SQLite is not
|
|
142
|
+
selected for account workspaces, Connect or background jobs. Account workspaces
|
|
143
|
+
use `sync.provider` even with `sync.enabled=false`; disabling conversation
|
|
144
|
+
transfer does not disable the workspace store. The sync gateway remains
|
|
145
|
+
unregistered while transfer is disabled.
|
|
146
|
+
|
|
147
|
+
Workspace-only account storage requires `or3-provider-sqlite@0.0.12` or later.
|
|
148
|
+
Version `0.0.11` skips workspace-store registration when sync, Connect and
|
|
149
|
+
background jobs are all disabled, causing Chat to exit before listening.
|
|
150
|
+
Upgrade the provider; conversation transfer can remain disabled.
|
|
143
151
|
|
|
144
152
|
SQLite background jobs also persist mixed-runtime tool handoffs. Browser-only
|
|
145
153
|
calls are atomically claimed and settled in `execution_json`; parked calls are
|
|
@@ -254,7 +262,7 @@ bun run build # build for distribution
|
|
|
254
262
|
|
|
255
263
|
### Atomic workspace settings
|
|
256
264
|
|
|
257
|
-
The workspace settings store implements `compareAndSet(workspaceId, key, expectedValue, nextValue)` atomically. A `null` expected value means the key must be absent; a conflict returns `false` without overwriting it. The host uses this for concurrent plugin setup saves and persistent AI spend reservations.
|
|
265
|
+
The workspace settings store implements `compareAndSet(workspaceId, key, expectedValue, nextValue)` atomically. A `null` expected value means the key must be absent; a conflict returns `false` without overwriting it. The host uses this for concurrent plugin setup saves, bulk plugin enablement and permission review, and persistent AI spend reservations. A provider without this operation cannot safely run a bulk plugin rollout. A slow plugin write may outlive the HTTP response: the host reports pending after eight seconds and keeps the plugin lock until the atomic operation settles.
|
|
258
266
|
|
|
259
267
|
|
|
260
268
|
### Testing local changes in OR3 Chat
|
package/dist/module.json
CHANGED
|
@@ -29,10 +29,12 @@ let d1RuntimeInitialization;
|
|
|
29
29
|
export default defineNitroPlugin(async (nitroApp) => {
|
|
30
30
|
const config = useRuntimeConfig();
|
|
31
31
|
if (!config.auth?.enabled) return;
|
|
32
|
+
const workspaceSelected = config.sync?.provider === SQLITE_PROVIDER_ID;
|
|
32
33
|
const syncSelected = config.sync?.enabled === true && config.sync?.provider === SQLITE_PROVIDER_ID;
|
|
33
34
|
const connectSelected = config.connect?.enabled === true && config.connect?.provider === SQLITE_PROVIDER_ID;
|
|
34
35
|
const backgroundJobsSelected = config.backgroundJobs?.enabled === true && config.backgroundJobs?.storageProvider === SQLITE_PROVIDER_ID;
|
|
35
|
-
if (!
|
|
36
|
+
if (!workspaceSelected && !connectSelected && !backgroundJobsSelected)
|
|
37
|
+
return;
|
|
36
38
|
const driver = getSqliteDriver();
|
|
37
39
|
if (driver === "d1" && connectSelected) {
|
|
38
40
|
throw new Error(
|