scriptorium 0.0.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/README.md +110 -0
- package/bin/scriptorium.js +18 -0
- package/build/client/apple-touch-icon.png +0 -0
- package/build/client/assets/_layout-D-bxuQBW.js +1 -0
- package/build/client/assets/_layout-D2eOWFrG.js +1 -0
- package/build/client/assets/_layout-D4m0RbUC.js +1 -0
- package/build/client/assets/_layout-DggtTDZp.js +1 -0
- package/build/client/assets/ack-yx2DGjj6.js +1 -0
- package/build/client/assets/auth-shell-FEL5QDuP.js +1 -0
- package/build/client/assets/begin-DP2rzg_V.js +1 -0
- package/build/client/assets/begin-l0sNRNKZ.js +1 -0
- package/build/client/assets/chunk-EPOLDU6W-B-j6nV8T.js +26 -0
- package/build/client/assets/cn-Kn7NbJqM.js +1 -0
- package/build/client/assets/confirm-passkey-ntLsS7_k.js +1 -0
- package/build/client/assets/entry.client-BkscxSA6.js +5 -0
- package/build/client/assets/events-l0sNRNKZ.js +1 -0
- package/build/client/assets/file-list-DBDZbrBp.js +1 -0
- package/build/client/assets/files-Bzkr7-i7.js +1 -0
- package/build/client/assets/files-browser-KNurSsen.js +1 -0
- package/build/client/assets/files-cnv1kfgp.js +1 -0
- package/build/client/assets/files.browse-9p4xl9MV.js +1 -0
- package/build/client/assets/finish-DP2rzg_V.js +1 -0
- package/build/client/assets/finish-l0sNRNKZ.js +1 -0
- package/build/client/assets/git-CjSY0eSC.js +1 -0
- package/build/client/assets/git-T0lLjMNd.js +1 -0
- package/build/client/assets/git-browser-DwSOY6QN.js +1 -0
- package/build/client/assets/iconify-BDcX0yw8.js +1 -0
- package/build/client/assets/index-8zQ7Fizv.js +9 -0
- package/build/client/assets/index-BUN6tnpl.js +1 -0
- package/build/client/assets/index-BlNoCKAt.js +1 -0
- package/build/client/assets/index-g2QB9BbT.js +1 -0
- package/build/client/assets/instance-events-provider-DTYnvumj.js +39 -0
- package/build/client/assets/instance-route-C25LRYYo.js +1 -0
- package/build/client/assets/instances-CzjXhR3c.js +1 -0
- package/build/client/assets/instances._instanceId.proxy._-l0sNRNKZ.js +1 -0
- package/build/client/assets/instances._instanceId.sessions._sessionId.test-COZIMxji.js +208 -0
- package/build/client/assets/instances.new-BZi5xwEV.js +1 -0
- package/build/client/assets/login-Bwt79t7_.js +1 -0
- package/build/client/assets/logout-l0sNRNKZ.js +1 -0
- package/build/client/assets/magic-string.es-DjU5CGuV.js +10 -0
- package/build/client/assets/manifest-3c01c628.js +1 -0
- package/build/client/assets/message-card-BclR_JqA.css +1 -0
- package/build/client/assets/message-card-DJ5C3WNp.js +34 -0
- package/build/client/assets/passkeys-DpNQs4bn.js +1 -0
- package/build/client/assets/register-DXPj5RLZ.js +1 -0
- package/build/client/assets/root-DxD-Skic.css +1 -0
- package/build/client/assets/root-DxyfhNRI.js +1 -0
- package/build/client/assets/route-handle-DcEil3NY.js +1 -0
- package/build/client/assets/safe-area-DTPfLjT-.css +1 -0
- package/build/client/assets/safe-area.module-CwCzHS6V.js +1 -0
- package/build/client/assets/scroll-indicator-CFaTM_rb.js +12 -0
- package/build/client/assets/scroll-indicator-D4qxLVUu.css +1 -0
- package/build/client/assets/scrollable-layout-CS-vPTNM.js +1 -0
- package/build/client/assets/session-route-oxi4s_Qg.js +1 -0
- package/build/client/assets/sessions-provider-D1t07kir.js +1 -0
- package/build/client/assets/settings-CameSNIM.js +1 -0
- package/build/client/assets/sidebar-DRhB33rT.js +1 -0
- package/build/client/assets/use-double-check-CbbarqDt.js +1 -0
- package/build/client/assets/webauthn.client-C1ZSQfKs.js +2 -0
- package/build/client/dev-sw.js +7 -0
- package/build/client/favicon.ico +0 -0
- package/build/client/icon-192.png +0 -0
- package/build/client/icon-512.png +0 -0
- package/build/client/icon-maskable-512.png +0 -0
- package/build/client/icon-maskable.svg +8 -0
- package/build/client/icon.svg +8 -0
- package/build/client/manifest.webmanifest +28 -0
- package/build/client/sw.js +73 -0
- package/build/runtime/app/lib/runtime-config.server.js +422 -0
- package/build/runtime/cli/scriptorium.js +21 -0
- package/build/runtime/cli/serve.js +101 -0
- package/build/server/index.js +8574 -0
- package/docs/config.md +49 -0
- package/drizzle/20260312181200_fair_caretaker/migration.sql +54 -0
- package/drizzle/20260312181200_fair_caretaker/snapshot.json +484 -0
- package/drizzle/20260313000548_windy_paibok/migration.sql +37 -0
- package/drizzle/20260313000548_windy_paibok/snapshot.json +617 -0
- package/drizzle/20260318120000_session_read_statuses/migration.sql +11 -0
- package/drizzle/20260318120000_session_read_statuses/snapshot.json +710 -0
- package/drizzle/20260318213224_dear_captain_midlands/migration.sql +24 -0
- package/drizzle/20260318213224_dear_captain_midlands/snapshot.json +695 -0
- package/package.json +88 -0
package/docs/config.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Configuration Reference
|
|
2
|
+
|
|
3
|
+
Scriptorium reads non-sensitive settings from `config.yml` and secrets from `secrets.yml` in its per-user config directory.
|
|
4
|
+
CLI flags override environment variables, which override YAML values, which override schema defaults.
|
|
5
|
+
|
|
6
|
+
| Platform | <scriptorium_data_dir> |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| macOS | `~/Library/Application Support/scriptorium` |
|
|
9
|
+
| Linux | `$XDG_DATA_HOME/scriptorium` or `~/.local/share/scriptorium` |
|
|
10
|
+
| Windows | `%APPDATA%\scriptorium` |
|
|
11
|
+
|
|
12
|
+
Examples use `<scriptorium_data_dir>` as shorthand for Scriptorium's per-user data directory and `$HOME` for the user's home directory.
|
|
13
|
+
|
|
14
|
+
## config.yml
|
|
15
|
+
|
|
16
|
+
```yaml
|
|
17
|
+
server:
|
|
18
|
+
host: 0.0.0.0
|
|
19
|
+
port: 5174
|
|
20
|
+
workspace:
|
|
21
|
+
browserRoot: $HOME
|
|
22
|
+
opencode:
|
|
23
|
+
bin: opencode
|
|
24
|
+
network:
|
|
25
|
+
tailscale: false
|
|
26
|
+
database:
|
|
27
|
+
path: <scriptorium_data_dir>/app.db
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Key | Type | Default | CLI | Env | Description |
|
|
31
|
+
| --- | --- | --- | --- | --- | --- |
|
|
32
|
+
| `server.host` | string | `0.0.0.0` | `--host` | `HOST` | Host interface for the web server. |
|
|
33
|
+
| `server.port` | number | `5174` | `--port` | `PORT` | Port for the web server. |
|
|
34
|
+
| `workspace.browserRoot` | string | `$HOME` | `--browser-root` | `SCRIPTORIUM_BROWSER_ROOT` | Root directory exposed in the workspace browser. |
|
|
35
|
+
| `opencode.bin` | string | `opencode` | `--opencode-bin` | `OPENCODE_BIN` | OpenCode executable name or path. |
|
|
36
|
+
| `network.tailscale` | boolean | `false` | `--tailscale` | | Expose the app with tailscale serve. |
|
|
37
|
+
| `database.path` | string | `<scriptorium_data_dir>/app.db` | `--db-path` | `SCRIPTORIUM_DB_PATH` | Path to the SQLite database file. |
|
|
38
|
+
|
|
39
|
+
## secrets.yml
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
auth:
|
|
43
|
+
sessionSecret: <generated on first run or set via env>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
| Key | Type | Default | CLI | Env | Description |
|
|
47
|
+
| --- | --- | --- | --- | --- | --- |
|
|
48
|
+
| `auth.sessionSecret` | string | | | `SESSION_SECRET` | Session signing secret. |
|
|
49
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
CREATE TABLE `activation_codes` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`passkey_id` text NOT NULL,
|
|
4
|
+
`code_hash` text NOT NULL,
|
|
5
|
+
`expires_at` text NOT NULL,
|
|
6
|
+
`created_at` text NOT NULL,
|
|
7
|
+
`consumed_at` text,
|
|
8
|
+
`attempts` integer DEFAULT 0 NOT NULL,
|
|
9
|
+
FOREIGN KEY (`passkey_id`) REFERENCES `passkeys`(`id`) ON UPDATE no action ON DELETE cascade
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE INDEX `idx_activation_codes_passkey_id` ON `activation_codes` (`passkey_id`);--> statement-breakpoint
|
|
13
|
+
CREATE TABLE `authentication_challenges` (
|
|
14
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
15
|
+
`challenge` text NOT NULL,
|
|
16
|
+
`expires_at` text NOT NULL,
|
|
17
|
+
`created_at` text NOT NULL
|
|
18
|
+
);
|
|
19
|
+
--> statement-breakpoint
|
|
20
|
+
CREATE TABLE `passkeys` (
|
|
21
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
22
|
+
`webauthn_user_id` text NOT NULL,
|
|
23
|
+
`public_key` blob NOT NULL,
|
|
24
|
+
`counter` integer NOT NULL,
|
|
25
|
+
`device_type` text NOT NULL,
|
|
26
|
+
`backed_up` integer NOT NULL,
|
|
27
|
+
`transports_json` text NOT NULL,
|
|
28
|
+
`label` text NOT NULL,
|
|
29
|
+
`status` text NOT NULL,
|
|
30
|
+
`created_at` text NOT NULL,
|
|
31
|
+
`activated_at` text,
|
|
32
|
+
`revoked_at` text,
|
|
33
|
+
CONSTRAINT "passkeys_status_check" CHECK("passkeys"."status" in ('pending', 'active', 'revoked'))
|
|
34
|
+
);
|
|
35
|
+
--> statement-breakpoint
|
|
36
|
+
CREATE INDEX `idx_passkeys_status` ON `passkeys` (`status`);--> statement-breakpoint
|
|
37
|
+
CREATE TABLE `registration_challenges` (
|
|
38
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
39
|
+
`challenge` text NOT NULL,
|
|
40
|
+
`label` text NOT NULL,
|
|
41
|
+
`expires_at` text NOT NULL,
|
|
42
|
+
`created_at` text NOT NULL
|
|
43
|
+
);
|
|
44
|
+
--> statement-breakpoint
|
|
45
|
+
CREATE TABLE `sessions` (
|
|
46
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
47
|
+
`passkey_id` text NOT NULL,
|
|
48
|
+
`created_at` text NOT NULL,
|
|
49
|
+
`expires_at` text NOT NULL,
|
|
50
|
+
`last_seen_at` text NOT NULL,
|
|
51
|
+
FOREIGN KEY (`passkey_id`) REFERENCES `passkeys`(`id`) ON UPDATE no action ON DELETE cascade
|
|
52
|
+
);
|
|
53
|
+
--> statement-breakpoint
|
|
54
|
+
CREATE INDEX `idx_sessions_expires_at` ON `sessions` (`expires_at`);
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dialect": "sqlite",
|
|
3
|
+
"id": "d8fe33d6-0884-4785-989a-e1ba4e24e2d9",
|
|
4
|
+
"prevIds": [
|
|
5
|
+
"00000000-0000-0000-0000-000000000000"
|
|
6
|
+
],
|
|
7
|
+
"version": "7",
|
|
8
|
+
"ddl": [
|
|
9
|
+
{
|
|
10
|
+
"name": "activation_codes",
|
|
11
|
+
"entityType": "tables"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "text",
|
|
15
|
+
"notNull": false,
|
|
16
|
+
"autoincrement": false,
|
|
17
|
+
"default": null,
|
|
18
|
+
"generated": null,
|
|
19
|
+
"name": "id",
|
|
20
|
+
"table": "activation_codes",
|
|
21
|
+
"entityType": "columns"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"columns": [
|
|
25
|
+
"id"
|
|
26
|
+
],
|
|
27
|
+
"nameExplicit": false,
|
|
28
|
+
"name": "activation_codes_pk",
|
|
29
|
+
"table": "activation_codes",
|
|
30
|
+
"entityType": "pks"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "text",
|
|
34
|
+
"notNull": true,
|
|
35
|
+
"autoincrement": false,
|
|
36
|
+
"default": null,
|
|
37
|
+
"generated": null,
|
|
38
|
+
"name": "passkey_id",
|
|
39
|
+
"table": "activation_codes",
|
|
40
|
+
"entityType": "columns"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "text",
|
|
44
|
+
"notNull": true,
|
|
45
|
+
"autoincrement": false,
|
|
46
|
+
"default": null,
|
|
47
|
+
"generated": null,
|
|
48
|
+
"name": "code_hash",
|
|
49
|
+
"table": "activation_codes",
|
|
50
|
+
"entityType": "columns"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "text",
|
|
54
|
+
"notNull": true,
|
|
55
|
+
"autoincrement": false,
|
|
56
|
+
"default": null,
|
|
57
|
+
"generated": null,
|
|
58
|
+
"name": "expires_at",
|
|
59
|
+
"table": "activation_codes",
|
|
60
|
+
"entityType": "columns"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "text",
|
|
64
|
+
"notNull": true,
|
|
65
|
+
"autoincrement": false,
|
|
66
|
+
"default": null,
|
|
67
|
+
"generated": null,
|
|
68
|
+
"name": "created_at",
|
|
69
|
+
"table": "activation_codes",
|
|
70
|
+
"entityType": "columns"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "text",
|
|
74
|
+
"notNull": false,
|
|
75
|
+
"autoincrement": false,
|
|
76
|
+
"default": null,
|
|
77
|
+
"generated": null,
|
|
78
|
+
"name": "consumed_at",
|
|
79
|
+
"table": "activation_codes",
|
|
80
|
+
"entityType": "columns"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"notNull": true,
|
|
85
|
+
"autoincrement": false,
|
|
86
|
+
"default": "0",
|
|
87
|
+
"generated": null,
|
|
88
|
+
"name": "attempts",
|
|
89
|
+
"table": "activation_codes",
|
|
90
|
+
"entityType": "columns"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"columns": [
|
|
94
|
+
{
|
|
95
|
+
"value": "passkey_id",
|
|
96
|
+
"isExpression": false
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"isUnique": false,
|
|
100
|
+
"where": null,
|
|
101
|
+
"origin": "manual",
|
|
102
|
+
"name": "idx_activation_codes_passkey_id",
|
|
103
|
+
"table": "activation_codes",
|
|
104
|
+
"entityType": "indexes"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"columns": [
|
|
108
|
+
"passkey_id"
|
|
109
|
+
],
|
|
110
|
+
"tableTo": "passkeys",
|
|
111
|
+
"columnsTo": [
|
|
112
|
+
"id"
|
|
113
|
+
],
|
|
114
|
+
"onUpdate": "NO ACTION",
|
|
115
|
+
"onDelete": "CASCADE",
|
|
116
|
+
"nameExplicit": false,
|
|
117
|
+
"name": "activation_codes_passkey_id_passkeys_id_fk",
|
|
118
|
+
"table": "activation_codes",
|
|
119
|
+
"entityType": "fks"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "authentication_challenges",
|
|
123
|
+
"entityType": "tables"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"type": "text",
|
|
127
|
+
"notNull": false,
|
|
128
|
+
"autoincrement": false,
|
|
129
|
+
"default": null,
|
|
130
|
+
"generated": null,
|
|
131
|
+
"name": "id",
|
|
132
|
+
"table": "authentication_challenges",
|
|
133
|
+
"entityType": "columns"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"columns": [
|
|
137
|
+
"id"
|
|
138
|
+
],
|
|
139
|
+
"nameExplicit": false,
|
|
140
|
+
"name": "authentication_challenges_pk",
|
|
141
|
+
"table": "authentication_challenges",
|
|
142
|
+
"entityType": "pks"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "text",
|
|
146
|
+
"notNull": true,
|
|
147
|
+
"autoincrement": false,
|
|
148
|
+
"default": null,
|
|
149
|
+
"generated": null,
|
|
150
|
+
"name": "challenge",
|
|
151
|
+
"table": "authentication_challenges",
|
|
152
|
+
"entityType": "columns"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"type": "text",
|
|
156
|
+
"notNull": true,
|
|
157
|
+
"autoincrement": false,
|
|
158
|
+
"default": null,
|
|
159
|
+
"generated": null,
|
|
160
|
+
"name": "expires_at",
|
|
161
|
+
"table": "authentication_challenges",
|
|
162
|
+
"entityType": "columns"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"type": "text",
|
|
166
|
+
"notNull": true,
|
|
167
|
+
"autoincrement": false,
|
|
168
|
+
"default": null,
|
|
169
|
+
"generated": null,
|
|
170
|
+
"name": "created_at",
|
|
171
|
+
"table": "authentication_challenges",
|
|
172
|
+
"entityType": "columns"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "passkeys",
|
|
176
|
+
"entityType": "tables"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"type": "text",
|
|
180
|
+
"notNull": false,
|
|
181
|
+
"autoincrement": false,
|
|
182
|
+
"default": null,
|
|
183
|
+
"generated": null,
|
|
184
|
+
"name": "id",
|
|
185
|
+
"table": "passkeys",
|
|
186
|
+
"entityType": "columns"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"columns": [
|
|
190
|
+
"id"
|
|
191
|
+
],
|
|
192
|
+
"nameExplicit": false,
|
|
193
|
+
"name": "passkeys_pk",
|
|
194
|
+
"table": "passkeys",
|
|
195
|
+
"entityType": "pks"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"type": "text",
|
|
199
|
+
"notNull": true,
|
|
200
|
+
"autoincrement": false,
|
|
201
|
+
"default": null,
|
|
202
|
+
"generated": null,
|
|
203
|
+
"name": "webauthn_user_id",
|
|
204
|
+
"table": "passkeys",
|
|
205
|
+
"entityType": "columns"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"type": "blob",
|
|
209
|
+
"notNull": true,
|
|
210
|
+
"autoincrement": false,
|
|
211
|
+
"default": null,
|
|
212
|
+
"generated": null,
|
|
213
|
+
"name": "public_key",
|
|
214
|
+
"table": "passkeys",
|
|
215
|
+
"entityType": "columns"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"type": "integer",
|
|
219
|
+
"notNull": true,
|
|
220
|
+
"autoincrement": false,
|
|
221
|
+
"default": null,
|
|
222
|
+
"generated": null,
|
|
223
|
+
"name": "counter",
|
|
224
|
+
"table": "passkeys",
|
|
225
|
+
"entityType": "columns"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"type": "text",
|
|
229
|
+
"notNull": true,
|
|
230
|
+
"autoincrement": false,
|
|
231
|
+
"default": null,
|
|
232
|
+
"generated": null,
|
|
233
|
+
"name": "device_type",
|
|
234
|
+
"table": "passkeys",
|
|
235
|
+
"entityType": "columns"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"type": "integer",
|
|
239
|
+
"notNull": true,
|
|
240
|
+
"autoincrement": false,
|
|
241
|
+
"default": null,
|
|
242
|
+
"generated": null,
|
|
243
|
+
"name": "backed_up",
|
|
244
|
+
"table": "passkeys",
|
|
245
|
+
"entityType": "columns"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"type": "text",
|
|
249
|
+
"notNull": true,
|
|
250
|
+
"autoincrement": false,
|
|
251
|
+
"default": null,
|
|
252
|
+
"generated": null,
|
|
253
|
+
"name": "transports_json",
|
|
254
|
+
"table": "passkeys",
|
|
255
|
+
"entityType": "columns"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"type": "text",
|
|
259
|
+
"notNull": true,
|
|
260
|
+
"autoincrement": false,
|
|
261
|
+
"default": null,
|
|
262
|
+
"generated": null,
|
|
263
|
+
"name": "label",
|
|
264
|
+
"table": "passkeys",
|
|
265
|
+
"entityType": "columns"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"type": "text",
|
|
269
|
+
"notNull": true,
|
|
270
|
+
"autoincrement": false,
|
|
271
|
+
"default": null,
|
|
272
|
+
"generated": null,
|
|
273
|
+
"name": "status",
|
|
274
|
+
"table": "passkeys",
|
|
275
|
+
"entityType": "columns"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"type": "text",
|
|
279
|
+
"notNull": true,
|
|
280
|
+
"autoincrement": false,
|
|
281
|
+
"default": null,
|
|
282
|
+
"generated": null,
|
|
283
|
+
"name": "created_at",
|
|
284
|
+
"table": "passkeys",
|
|
285
|
+
"entityType": "columns"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"type": "text",
|
|
289
|
+
"notNull": false,
|
|
290
|
+
"autoincrement": false,
|
|
291
|
+
"default": null,
|
|
292
|
+
"generated": null,
|
|
293
|
+
"name": "activated_at",
|
|
294
|
+
"table": "passkeys",
|
|
295
|
+
"entityType": "columns"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"type": "text",
|
|
299
|
+
"notNull": false,
|
|
300
|
+
"autoincrement": false,
|
|
301
|
+
"default": null,
|
|
302
|
+
"generated": null,
|
|
303
|
+
"name": "revoked_at",
|
|
304
|
+
"table": "passkeys",
|
|
305
|
+
"entityType": "columns"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"columns": [
|
|
309
|
+
{
|
|
310
|
+
"value": "status",
|
|
311
|
+
"isExpression": false
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"isUnique": false,
|
|
315
|
+
"where": null,
|
|
316
|
+
"origin": "manual",
|
|
317
|
+
"name": "idx_passkeys_status",
|
|
318
|
+
"table": "passkeys",
|
|
319
|
+
"entityType": "indexes"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"value": "\"passkeys\".\"status\" in ('pending', 'active', 'revoked')",
|
|
323
|
+
"name": "passkeys_status_check",
|
|
324
|
+
"table": "passkeys",
|
|
325
|
+
"entityType": "checks"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "registration_challenges",
|
|
329
|
+
"entityType": "tables"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"type": "text",
|
|
333
|
+
"notNull": false,
|
|
334
|
+
"autoincrement": false,
|
|
335
|
+
"default": null,
|
|
336
|
+
"generated": null,
|
|
337
|
+
"name": "id",
|
|
338
|
+
"table": "registration_challenges",
|
|
339
|
+
"entityType": "columns"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"columns": [
|
|
343
|
+
"id"
|
|
344
|
+
],
|
|
345
|
+
"nameExplicit": false,
|
|
346
|
+
"name": "registration_challenges_pk",
|
|
347
|
+
"table": "registration_challenges",
|
|
348
|
+
"entityType": "pks"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"type": "text",
|
|
352
|
+
"notNull": true,
|
|
353
|
+
"autoincrement": false,
|
|
354
|
+
"default": null,
|
|
355
|
+
"generated": null,
|
|
356
|
+
"name": "challenge",
|
|
357
|
+
"table": "registration_challenges",
|
|
358
|
+
"entityType": "columns"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"type": "text",
|
|
362
|
+
"notNull": true,
|
|
363
|
+
"autoincrement": false,
|
|
364
|
+
"default": null,
|
|
365
|
+
"generated": null,
|
|
366
|
+
"name": "label",
|
|
367
|
+
"table": "registration_challenges",
|
|
368
|
+
"entityType": "columns"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"type": "text",
|
|
372
|
+
"notNull": true,
|
|
373
|
+
"autoincrement": false,
|
|
374
|
+
"default": null,
|
|
375
|
+
"generated": null,
|
|
376
|
+
"name": "expires_at",
|
|
377
|
+
"table": "registration_challenges",
|
|
378
|
+
"entityType": "columns"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"type": "text",
|
|
382
|
+
"notNull": true,
|
|
383
|
+
"autoincrement": false,
|
|
384
|
+
"default": null,
|
|
385
|
+
"generated": null,
|
|
386
|
+
"name": "created_at",
|
|
387
|
+
"table": "registration_challenges",
|
|
388
|
+
"entityType": "columns"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"name": "sessions",
|
|
392
|
+
"entityType": "tables"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"type": "text",
|
|
396
|
+
"notNull": false,
|
|
397
|
+
"autoincrement": false,
|
|
398
|
+
"default": null,
|
|
399
|
+
"generated": null,
|
|
400
|
+
"name": "id",
|
|
401
|
+
"table": "sessions",
|
|
402
|
+
"entityType": "columns"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"columns": [
|
|
406
|
+
"id"
|
|
407
|
+
],
|
|
408
|
+
"nameExplicit": false,
|
|
409
|
+
"name": "sessions_pk",
|
|
410
|
+
"table": "sessions",
|
|
411
|
+
"entityType": "pks"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"type": "text",
|
|
415
|
+
"notNull": true,
|
|
416
|
+
"autoincrement": false,
|
|
417
|
+
"default": null,
|
|
418
|
+
"generated": null,
|
|
419
|
+
"name": "passkey_id",
|
|
420
|
+
"table": "sessions",
|
|
421
|
+
"entityType": "columns"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"type": "text",
|
|
425
|
+
"notNull": true,
|
|
426
|
+
"autoincrement": false,
|
|
427
|
+
"default": null,
|
|
428
|
+
"generated": null,
|
|
429
|
+
"name": "created_at",
|
|
430
|
+
"table": "sessions",
|
|
431
|
+
"entityType": "columns"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"type": "text",
|
|
435
|
+
"notNull": true,
|
|
436
|
+
"autoincrement": false,
|
|
437
|
+
"default": null,
|
|
438
|
+
"generated": null,
|
|
439
|
+
"name": "expires_at",
|
|
440
|
+
"table": "sessions",
|
|
441
|
+
"entityType": "columns"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"type": "text",
|
|
445
|
+
"notNull": true,
|
|
446
|
+
"autoincrement": false,
|
|
447
|
+
"default": null,
|
|
448
|
+
"generated": null,
|
|
449
|
+
"name": "last_seen_at",
|
|
450
|
+
"table": "sessions",
|
|
451
|
+
"entityType": "columns"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"columns": [
|
|
455
|
+
{
|
|
456
|
+
"value": "expires_at",
|
|
457
|
+
"isExpression": false
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
"isUnique": false,
|
|
461
|
+
"where": null,
|
|
462
|
+
"origin": "manual",
|
|
463
|
+
"name": "idx_sessions_expires_at",
|
|
464
|
+
"table": "sessions",
|
|
465
|
+
"entityType": "indexes"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"columns": [
|
|
469
|
+
"passkey_id"
|
|
470
|
+
],
|
|
471
|
+
"tableTo": "passkeys",
|
|
472
|
+
"columnsTo": [
|
|
473
|
+
"id"
|
|
474
|
+
],
|
|
475
|
+
"onUpdate": "NO ACTION",
|
|
476
|
+
"onDelete": "CASCADE",
|
|
477
|
+
"nameExplicit": false,
|
|
478
|
+
"name": "sessions_passkey_id_passkeys_id_fk",
|
|
479
|
+
"table": "sessions",
|
|
480
|
+
"entityType": "fks"
|
|
481
|
+
}
|
|
482
|
+
],
|
|
483
|
+
"renames": []
|
|
484
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
CREATE TABLE `instances` (
|
|
2
|
+
`id` text PRIMARY KEY,
|
|
3
|
+
`name` text NOT NULL,
|
|
4
|
+
`directory` text NOT NULL,
|
|
5
|
+
`port` integer NOT NULL,
|
|
6
|
+
`status` text NOT NULL,
|
|
7
|
+
`created_at` text NOT NULL,
|
|
8
|
+
`updated_at` text NOT NULL,
|
|
9
|
+
`last_started_at` text,
|
|
10
|
+
`last_exit_at` text,
|
|
11
|
+
`last_error` text,
|
|
12
|
+
CONSTRAINT "instances_status_check" CHECK("status" in ('starting', 'running', 'stopped', 'error'))
|
|
13
|
+
);
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
16
|
+
CREATE TABLE `__new_passkeys` (
|
|
17
|
+
`id` text PRIMARY KEY,
|
|
18
|
+
`webauthn_user_id` text NOT NULL,
|
|
19
|
+
`public_key` blob NOT NULL,
|
|
20
|
+
`counter` integer NOT NULL,
|
|
21
|
+
`device_type` text NOT NULL,
|
|
22
|
+
`backed_up` integer NOT NULL,
|
|
23
|
+
`transports_json` text NOT NULL,
|
|
24
|
+
`label` text NOT NULL,
|
|
25
|
+
`status` text NOT NULL,
|
|
26
|
+
`created_at` text NOT NULL,
|
|
27
|
+
`activated_at` text,
|
|
28
|
+
`revoked_at` text,
|
|
29
|
+
CONSTRAINT "passkeys_status_check" CHECK("status" in ('pending', 'active', 'revoked'))
|
|
30
|
+
);
|
|
31
|
+
--> statement-breakpoint
|
|
32
|
+
INSERT INTO `__new_passkeys`(`id`, `webauthn_user_id`, `public_key`, `counter`, `device_type`, `backed_up`, `transports_json`, `label`, `status`, `created_at`, `activated_at`, `revoked_at`) SELECT `id`, `webauthn_user_id`, `public_key`, `counter`, `device_type`, `backed_up`, `transports_json`, `label`, `status`, `created_at`, `activated_at`, `revoked_at` FROM `passkeys`;--> statement-breakpoint
|
|
33
|
+
DROP TABLE `passkeys`;--> statement-breakpoint
|
|
34
|
+
ALTER TABLE `__new_passkeys` RENAME TO `passkeys`;--> statement-breakpoint
|
|
35
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
36
|
+
CREATE INDEX `idx_passkeys_status` ON `passkeys` (`status`);--> statement-breakpoint
|
|
37
|
+
CREATE INDEX `idx_instances_status` ON `instances` (`status`);
|