@vite-hub/workspace 0.4.1 → 0.5.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.
Files changed (116) hide show
  1. package/README.md +62 -19
  2. package/dist/{abort-BCwpdrN0.js → abort-CQGxJBqa.js} +1 -2
  3. package/dist/{asset-registry-DfBV5kmw.js → asset-registry-0CdRAjIV.js} +2 -3
  4. package/dist/blob-database/postgres.d.ts +423 -0
  5. package/dist/blob-database/postgres.js +1 -0
  6. package/dist/blob-database-sources-CQPAyCz3.js +8 -0
  7. package/dist/blob-database.d.ts +29 -449
  8. package/dist/blob-database.js +636 -210
  9. package/dist/checkout.d.ts +1 -2
  10. package/dist/checkout.js +3 -4
  11. package/dist/cloudflare.d.ts +1 -5
  12. package/dist/cloudflare.js +1 -2
  13. package/dist/{config-B-863EgC.js → config-CsgNNVAI.js} +1 -2
  14. package/dist/{config-CDeGd0RB.d.ts → config-DeA287c0.d.ts} +1 -5
  15. package/dist/{config-D1QENneP.js → config-jo5QgE1w.js} +18 -27
  16. package/dist/{discard-CNNtCozM.js → discard-BkoLmmmN.js} +1 -2
  17. package/dist/durability.d.ts +10 -4
  18. package/dist/durability.js +47 -6
  19. package/dist/{error-diagnostics-B5s9kNEA.js → error-diagnostics-B4me-ouV.js} +11 -4
  20. package/dist/{error-diagnostics-CQ4BUqRe.js → error-diagnostics-kKXseq8d.js} +10 -3
  21. package/dist/{path-uxLkzrZm.d.ts → errors-CnFDXxeJ.d.ts} +0 -3
  22. package/dist/{file-CqG9zqiF.js → file-BrNAXQgY.js} +4 -8
  23. package/dist/{target-Dm9dHAVJ.js → file-metadata-Bpsvjw_X.js} +3 -32
  24. package/dist/{files-B6wpAhEx.js → files--z2dLC5z.js} +3 -4
  25. package/dist/files.d.ts +12 -8
  26. package/dist/files.js +7 -6
  27. package/dist/{github-DKAlO0Vh.js → github-k--_LCrX.js} +7 -9
  28. package/dist/{glob-BOqSKzSg.js → glob-BEutagp1.js} +9 -10
  29. package/dist/{glob-Cjxms1t7.js → glob-BreFjNAV.js} +3 -4
  30. package/dist/history-schema-BR4UDPHL.d.ts +434 -0
  31. package/dist/history-schema-postgres-DZepCSBq.js +40 -0
  32. package/dist/{host-Bf1a2uo_.js → host-C8yZizfk.js} +153 -22
  33. package/dist/{hosted-zG7HJaE4.js → hosted-8BTKAtMX.js} +27 -21
  34. package/dist/{hosted-vercel-blob-AbXG8fvR.js → hosted-vercel-blob-B6kygYqn.js} +10 -12
  35. package/dist/hosted-vercel-blob.d.ts +1 -3
  36. package/dist/hosted-vercel-blob.js +1 -2
  37. package/dist/hosted.d.ts +1 -3
  38. package/dist/hosted.js +1 -2
  39. package/dist/index.d.ts +11 -41
  40. package/dist/index.js +34 -116
  41. package/dist/internal/path.d.ts +1 -1
  42. package/dist/internal/path.js +1 -2
  43. package/dist/internal/workspace.d.ts +10 -0
  44. package/dist/internal/workspace.js +85 -0
  45. package/dist/{lifecycle-D8FdpBod.js → lifecycle-IReZfi0b.js} +15 -13
  46. package/dist/lineage.d.ts +1 -3
  47. package/dist/lineage.js +1 -2
  48. package/dist/loader.d.ts +1 -7
  49. package/dist/loader.js +4 -6
  50. package/dist/{mcp-resources-DntxtmDU.js → mcp-resources-DeJnbOaw.js} +4 -5
  51. package/dist/{memory-D5jq9HZW.js → memory-BlSRrBH1.js} +19 -13
  52. package/dist/{metadata-target-DDoOQNp1.js → metadata-target-CaGLY4ay.js} +214 -77
  53. package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
  54. package/dist/{operation-definition-nmRu_O3V.d.ts → operation-definition-CqZkx1Rm.d.ts} +8 -6
  55. package/dist/{operations-DsY2MQnG.js → operations-CtRDU3cA.js} +34 -29
  56. package/dist/{operations-D8uCpzhM.js → operations-DfbqHWAe.js} +7 -8
  57. package/dist/operations.d.ts +2 -6
  58. package/dist/operations.js +2 -2
  59. package/dist/{path--wrT_Azm.js → path-Bb9OIc_F.js} +3 -19
  60. package/dist/{path-zHxQUbqa.d.ts → path-C0uZxDdW.d.ts} +0 -2
  61. package/dist/{path-DrSIenjj.js → path-CuYE8-X6.js} +2 -4
  62. package/dist/{plugins-CsrXCA1Q.d.ts → plugins-CLc32jvL.d.ts} +1 -3
  63. package/dist/{provider-sm9uzkLg.js → provider-CN14ewvx.js} +30 -22
  64. package/dist/providers/github/store.d.ts +2 -4
  65. package/dist/providers/github/store.js +1 -2
  66. package/dist/{registry-CFl1Htyc.d.ts → registry-B0g19sdy.d.ts} +5 -8
  67. package/dist/{registry-DmVfUe4K.js → registry-BbUg9vJB.js} +10 -6
  68. package/dist/registry-s2Ob9PeX.d.ts +9 -0
  69. package/dist/{request-scope-Dw5n8bMC.js → request-scope-CXCI_wCb.js} +4 -4
  70. package/dist/{results-DgkZUmTL.js → results-z-HpV9EP.js} +1 -2
  71. package/dist/{rolldown-runtime-rQ84J-ij.js → rolldown-runtime-DnNXxpGL.js} +2 -3
  72. package/dist/rule-keys-BLEbi1h5.js +18 -0
  73. package/dist/rules-BPDXypZV.js +267 -0
  74. package/dist/runtime/assets.d.ts +2 -3
  75. package/dist/runtime/assets.js +5 -6
  76. package/dist/runtime/empty-assets-registry.d.ts +1 -3
  77. package/dist/runtime/empty-assets-registry.js +1 -2
  78. package/dist/runtime/empty-registry.d.ts +2 -4
  79. package/dist/runtime/empty-registry.js +1 -2
  80. package/dist/runtime/registry.d.ts +2 -2
  81. package/dist/runtime/registry.js +2 -3
  82. package/dist/runtime/request.d.ts +1 -3
  83. package/dist/runtime/request.js +2 -3
  84. package/dist/runtime/state.d.ts +5 -4
  85. package/dist/runtime/state.js +18 -7
  86. package/dist/runtime/workspace.d.ts +1 -1
  87. package/dist/runtime/workspace.js +1 -2
  88. package/dist/runtime.d.ts +9 -24
  89. package/dist/runtime.js +29 -25
  90. package/dist/{search-C_RfoM2j.js → search-C_nVorq7.js} +3 -4
  91. package/dist/{server-Cd4-iCh5.js → server-aa1a4rkV.js} +8 -10
  92. package/dist/server.d.ts +3 -4
  93. package/dist/server.js +1 -2
  94. package/dist/{shared-ovXVSV3-.js → shared-C20Wh1mp.js} +23 -19
  95. package/dist/source-metadata.d.ts +2 -6
  96. package/dist/source-metadata.js +4 -5
  97. package/dist/state-BdDfBtOR.d.ts +17 -0
  98. package/dist/{store-NZoRto-Y.js → store-cx3OqNTi.js} +42 -44
  99. package/dist/{sync-CrT8zjwc.js → sync-BBfR4g5y.js} +6 -7
  100. package/dist/test.d.ts +1 -1
  101. package/dist/test.js +1 -2
  102. package/dist/{types-1Z-tKK3g.d.ts → types-Bel5IDmF.d.ts} +52 -6
  103. package/dist/{use-CjbF8EO9.d.ts → use-CpphIBof.d.ts} +20 -32
  104. package/dist/{use-B0o5HoBl.js → use-D0DyTMxM.js} +19 -21
  105. package/dist/use-tools-CAK10LTc.d.ts +10 -0
  106. package/dist/{state-Cb_hIyAw.js → use-tools-CHduR5k6.js} +8 -24
  107. package/dist/{utils-Dw-WULEZ.js → utils-DXP9xfXo.js} +80 -273
  108. package/dist/vite.d.ts +30 -19
  109. package/dist/vite.js +1481 -1617
  110. package/dist/vitehub-grants-Co713QTg.js +36 -0
  111. package/dist/workspace-BOuxrZrP.d.ts +5 -0
  112. package/dist/{workspace-DvKu5PRa.js → workspace-CLuPkyZR.js} +28 -36
  113. package/package.json +34 -24
  114. package/dist/registry-CwryP59t.d.ts +0 -9
  115. package/dist/state-C-YtsaiJ.d.ts +0 -35
  116. package/dist/workspace-CIXgHeyX.d.ts +0 -7
package/README.md CHANGED
@@ -35,7 +35,7 @@ Use `skipLibCheck: true` in app TypeScript configs while ViteHub depends on runt
35
35
 
36
36
  The local Store persists file metadata inside `.vitehub` under the Workspace root. If file removal stops before metadata cleanup completes, reads reject with `Interrupted Workspace removal` so a restored file cannot reuse deleted ownership. Retry removal of the reported path with `force: true` and, for directories, `recursive: true` before restoring files.
37
37
 
38
- Lock markers are not reclaimed based on age because a slow operation or failed heartbeat may still own them. If a process crashes and operations report `Timed out waiting to read Workspace` or `Timed out waiting to write Workspace`, stop every process using that Workspace. Call `recoverLocalWorkspaceLocks({ root, offline: true })` from `@vite-hub/workspace/runtime` with the Local Store's root, then restart the processes after recovery succeeds. Prevent changes to the Store and its ancestor directories throughout recovery. The `offline: true` flag confirms exclusive offline access; it does not stop other processes. See [Local Store recovery](../../docs/content/docs/workspace/limits-and-errors.md#recover-a-local-store-after-a-crash) for the procedure.
38
+ Lock markers are not reclaimed based on age because a slow operation or failed heartbeat may still own them. If a process crashes and operations report `Timed out waiting to read Workspace` or `Timed out waiting to write Workspace`, stop every process using that Workspace. Call `recoverLocalWorkspaceLocks({ root, offline: true })` from `@vite-hub/workspace/runtime` with the Local Store's root, then restart the processes after recovery succeeds. Prevent changes to the Store and its ancestor directories throughout recovery. The `offline: true` flag confirms exclusive offline access; it does not stop other processes. See [Local Store recovery](https://vitehub.dev/docs/workspace/limits-and-errors#recover-a-local-store-after-a-crash) for the procedure.
39
39
 
40
40
  Set `locks: "process"` on a local Store when one process owns its root, for example a disposable checkout that one worker uses. The Store then keeps the same per-path read and write locks in memory. It creates no `.vitehub/locks` directory, does not poll lock markers, and lists entries in parallel. Keep the default `locks: "filesystem"` when more than one process can access the root.
41
41
 
@@ -148,12 +148,11 @@ Definition, apply its migrations, and pass
148
148
  Workspace Definition's `store`. The framework also exports
149
149
  `vite-hub/workspace/blob-database`.
150
150
 
151
- `database` is a Drizzle database, or a function that returns one. In a
152
- Workspace Definition, pass `() => useDatabase("history").db`. The Store calls
153
- the function on first use, because the build loads the Workspace Definition
154
- without the app's Databases. Do not pass the Database Definition: it holds
155
- options only, and `useDatabase()` gives the database with the migrations and
156
- relations of the build.
151
+ `blob` names a Blob store and `database` names a Database. The Store looks
152
+ them up on first use, because the build loads the Workspace Definition without
153
+ the app's Databases. `blob` also takes a `BlobStorage` object, and `database`
154
+ takes a Drizzle database or a function that returns one. Do not pass the
155
+ Database Definition: it holds options only.
157
156
 
158
157
  ```ts [server/databases/history/index.ts]
159
158
  import { defineDatabase } from "@vite-hub/database"
@@ -163,20 +162,31 @@ export default defineDatabase({ name: "history", schema: workspaceHistorySchema
163
162
  ```
164
163
 
165
164
  ```ts [server/workspaces/notes.ts]
166
- import { blob } from "@vite-hub/blob"
167
- import { useDatabase } from "@vite-hub/database"
168
165
  import { defineWorkspace } from "@vite-hub/workspace"
169
166
  import { createBlobDatabaseWorkspaceStore } from "@vite-hub/workspace/blob-database"
170
167
 
171
168
  export default defineWorkspace({
172
169
  store: createBlobDatabaseWorkspaceStore({
173
- blob: blob.store("workspace-history"),
174
- database: () => useDatabase("history").db,
170
+ blob: "workspace-history",
171
+ database: "history",
175
172
  workspace: "notes-123",
176
173
  }),
177
174
  })
178
175
  ```
179
176
 
177
+ On Postgres, import `workspaceHistorySchema` from
178
+ `@vite-hub/workspace/blob-database/postgres` and set `dialect: "postgresql"`.
179
+ If the Database uses Cloudflare Hyperdrive, disable query caching so all instances
180
+ read the current head.
181
+
182
+ Instances that use the same Blob store, Database, and workspace identity share
183
+ one Workspace. The Database decides which commit wins: a commit from a stale
184
+ head fails with `WORKSPACE_CONFLICT` on every instance. Postgres runs each
185
+ commit in one transaction that locks the Workspace row. SQLite, libSQL, and D1
186
+ run it as one batch of conditional statements. With names, the durability
187
+ report shows the Store as `shared` only when the Blob store and the Database
188
+ are both shared. With objects, it trusts them, as it does a custom Store.
189
+
180
190
  ```ts
181
191
  import { useWorkspace } from "@vite-hub/workspace"
182
192
 
@@ -196,7 +206,7 @@ await workspace.history.usage()
196
206
  Commits publish the complete desired file set with an atomic head comparison.
197
207
  Catch `isWorkspaceConflict(error)` for a stale `ifHead`. Omitted paths disappear
198
208
  from the new revision; earlier versions retain their bytes. Read mode exposes
199
- `head`, `list`, `refs`, `open`, and `usage`. Stores without retained history
209
+ `head`, `list`, `refs`, `open`, `diff`, and `usage`. Stores without retained history
200
210
  throw `WORKSPACE_R0069`. Existing checkpoint and rebase behavior is unchanged.
201
211
 
202
212
  History has named refs. Calls without `ref` use `main`. Each ref has its own head
@@ -213,6 +223,38 @@ await workspace.history.commit({
213
223
  await workspace.history.refs() // [{ name: "draft", head }, { name: "main", head }]
214
224
  ```
215
225
 
226
+ `history.diff({ from, to })` lists the files that were added, modified, or removed
227
+ between two revisions, also on different refs. Changes to bytes, media type, or
228
+ retained metadata count as modifications:
229
+
230
+ ```ts fragment
231
+ const [published, saved] = await Promise.all([
232
+ workspace.history.head({ ref: "published" }),
233
+ workspace.history.head({ ref: "draft" }),
234
+ ])
235
+ if (saved) {
236
+ const { entries } = await workspace.history.diff({ from: published?.id, to: saved.id })
237
+ // [{ path: "posts/hello.md", type: "modified", before, after }]
238
+ }
239
+ ```
240
+
241
+ Use `isWorkspaceName(name)` to check a Workspace name from a request or a database
242
+ before you pass it to `useWorkspace()` or `useWorkspaceFiles()`.
243
+
244
+ `history.deleteRef({ ref, ifHead? })` deletes a ref. It returns `false` when the ref
245
+ does not exist and no `ifHead` was supplied. It cannot delete `main` or the Store's
246
+ working ref:
247
+
248
+ ```ts fragment
249
+ const head = await workspace.history.head({ ref: runId })
250
+ await workspace.history.deleteRef({ ref: runId, ifHead: head?.id })
251
+ ```
252
+
253
+ Blob + Database checks `ifHead` atomically with ref deletion and also removes the
254
+ ref's revisions and bytes that no other revision uses. GitHub only deletes the
255
+ branch, so commits and bytes may still be readable by SHA. Its `ifHead` check
256
+ happens before a separate, unconditional delete request.
257
+
216
258
  Rules, validators, hooks, and Source ownership run on every changed path in both
217
259
  forms. Use `registerWorkspacePlugin(name, plugin)` to add rules and hooks to a
218
260
  Workspace your package does not define. In a history commit, each hook gets
@@ -220,7 +262,7 @@ Workspace your package does not define. In a history commit, each hook gets
220
262
  that the commit changes. A hook can check all paths at once, and read the intent of
221
263
  the caller from the metadata, as Content reads `lease: "override"`.
222
264
 
223
- File objects use `_vitehub/workspace-history[/<prefix>]/<sha256(workspace)>/sha256/<digest>` Blob keys.
265
+ File objects use `_vitehub/workspace-history[/<prefix>]/<sha256(workspace)>/sha256/<digest>-<generation>` Blob keys. Existing digest-only keys remain readable.
224
266
  The optional `prefix` nests below `_vitehub/workspace-history/`, so ViteHub owns every
225
267
  history object.
226
268
  Identical bytes share one object within a workspace. Database stores immutable
@@ -232,7 +274,8 @@ Normal file writes stage changes in instance memory until checkpoint or snapshot
232
274
  which commit to `main`. Only committed history is durable; keep drafts on a ref. `store.delete()` permanently tombstones the
233
275
  identity and removes its history and objects. Retry deletion after storage errors
234
276
  or after stopping abandoned uploads. Failed publications can leave reusable
235
- objects outside retained usage accounting until deletion. Pruning is not supported.
277
+ objects outside retained usage accounting until deletion. `history.deleteRef()` deletes
278
+ one ref and the objects that no other revision uses.
236
279
  Use a strongly consistent Blob backend and small folders. See
237
280
  [configuration](https://vitehub.dev/docs/workspace/configure#blob-database-store)
238
281
  and [server API](https://vitehub.dev/docs/workspace/server-api#retained-folder-history).
@@ -244,8 +287,8 @@ runtime of the dev server, or of a deployed app with `--url`, and never write:
244
287
  vitehub workspace history content # revisions on every ref, newest first
245
288
  vitehub workspace history content --ref draft
246
289
  vitehub workspace refs content # each ref and its head revision
247
- vitehub workspace show content draft # one revision and its files
248
- vitehub workspace show content draft posts/hello.md
290
+ vitehub workspace get content draft # one revision and its files
291
+ vitehub workspace get content draft posts/hello.md
249
292
  ```
250
293
 
251
294
  Add `--json` for machine-readable output. A Store without retained history
@@ -499,7 +542,7 @@ GitHub-backed Stores also expose the retained history reader. Repository branche
499
542
  history refs, and GitHub commits are immutable Workspace revisions. Revision metadata
500
543
  includes the commit author and a `url` that opens the commit on GitHub. Revision file
501
544
  views read the configured Workspace root from the commit tree and fetch file bytes from
502
- that commit. The `vitehub workspace history`, `refs`, and `show` CLI commands
545
+ that commit. The `vitehub workspace history`, `refs`, and `get` CLI commands
503
546
  inspect this data; the Console Workspace/files view does not yet provide a history
504
547
  navigator.
505
548
 
@@ -519,8 +562,6 @@ first use, so a missing one throws `WORKSPACE_R0072` then, not when the definiti
519
562
 
520
563
  Built on [`@vite-hub/source`](../source/README.md) and [isomorphic-git](https://isomorphic-git.org/). Shell-backed Workspace tools load `@vite-hub/shell` only when the shell tool executes.
521
564
 
522
- Learn more at [vitehub.dev](https://vitehub.dev).
523
-
524
565
  Startup and build Source cleanup track ownership by Workspace name. When definitions share a Store, removing or refreshing one definition does not remove files last materialized by another definition. Cleanup also preserves files without a recorded Workspace owner, including files from legacy snapshots. Shared paths still contain the most recent write.
525
566
 
526
567
  Source Sync and runtime Source materialization change files only inside the mount of the Source that they process. A Source with an empty mount owns the Workspace root. Source Sync with `stale: "remove"` removes only stale paths inside the current mount. If you move a Source mount, the files in the old mount stay. Remove them yourself if you do not need them. When mounts for the same Source key share an output path, sync retains their claims separately. Each mount can update the file, and every claim tracks the digest of the latest Source write to that shared path. Stale cleanup removes the file only after the other mounts release their claims and its content still matches that digest. Releasing a claim preserves this digest without adopting current file content, including user edits that restore an older Source version.
@@ -536,3 +577,5 @@ File metadata must be a JSON-safe plain object containing only plain objects, de
536
577
  Custom Stores can implement `removeEmptyDirectory(path)` to support build directory cleanup. The operation must check the path inside the Store mutation boundary, preserve files and missing paths, and reject nonempty directories. Stores without this method retain generated directories. The local, memory, and Cloudflare Artifacts Stores implement it.
537
578
 
538
579
  Writable facade wrappers that replace `fs` and omit symbol properties must forward internal Source Sync routing explicitly. After creating a wrapper, call `forwardWorkspaceFacade(base, wrapped)` from `@vite-hub/workspace/runtime`. This preserves durable sync metadata and enclosing Source guards without exposing internal setters or passing capabilities to the wrapper's public `setMeta` method. Public metadata writes still reject reserved keys.
580
+
581
+ Learn more at [vitehub.dev](https://vitehub.dev).
@@ -1,4 +1,4 @@
1
- //#region ../internal/src/abort.ts
1
+ // ../internal/src/abort.ts
2
2
  /**
3
3
  * Runs `task` and rejects as soon as `signal` aborts, without waiting for the task.
4
4
  *
@@ -28,5 +28,4 @@ function abortReason(signal, message) {
28
28
  if (signal?.reason !== void 0) return signal.reason;
29
29
  return new DOMException(message, "AbortError");
30
30
  }
31
- //#endregion
32
31
  export { abortable as t };
@@ -1,6 +1,6 @@
1
- import { c as workspaceNotFoundError } from "./path-DrSIenjj.js";
1
+ import { c as workspaceNotFoundError } from "./path-CuYE8-X6.js";
2
2
  import runtimeAssetsRegistry from "#vitehub-workspace-assets-registry";
3
- //#region src/asset-registry.ts
3
+ // src/asset-registry.ts
4
4
  const workspaceAssetsRegistryKey = Symbol.for("vitehub.workspace.assetsRegistry");
5
5
  function workspaceAssetsRegistryGlobal() {
6
6
  const scope = globalThis;
@@ -16,5 +16,4 @@ function useWorkspaceAssets(name) {
16
16
  if (!assets) throw workspaceNotFoundError(name);
17
17
  return assets;
18
18
  }
19
- //#endregion
20
19
  export { useWorkspaceAssets as n, setWorkspaceAssetsRegistry as t };
@@ -0,0 +1,423 @@
1
+ import { t as HistoryManifestFile } from "../history-schema-BR4UDPHL.js";
2
+ type HistoryFileIndex = Record<string, Pick<HistoryManifestFile, "digest" | "size"> & {
3
+ fingerprint: string;
4
+ }>;
5
+ /** Include these tables in a Postgres Database Definition and apply its migrations. */
6
+ export declare const workspaceHistorySchema: {
7
+ workspaceHistoryWorkspaces: import("drizzle-orm/pg-core").PgTableWithColumns<{
8
+ name: "workspace_history_workspaces";
9
+ schema: undefined;
10
+ columns: {
11
+ workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_workspaces", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
12
+ name: string;
13
+ tableName: "workspace_history_workspaces";
14
+ dataType: "string";
15
+ data: string;
16
+ driverParam: string;
17
+ notNull: true;
18
+ hasDefault: false;
19
+ isPrimaryKey: false;
20
+ isAutoincrement: false;
21
+ hasRuntimeDefault: false;
22
+ enumValues: undefined;
23
+ identity: undefined;
24
+ generated: undefined;
25
+ }>;
26
+ deleted: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_workspaces", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBooleanBuilder>>, {
27
+ name: string;
28
+ tableName: "workspace_history_workspaces";
29
+ dataType: "boolean";
30
+ data: boolean;
31
+ driverParam: boolean;
32
+ notNull: true;
33
+ hasDefault: true;
34
+ isPrimaryKey: false;
35
+ isAutoincrement: false;
36
+ hasRuntimeDefault: false;
37
+ enumValues: undefined;
38
+ identity: undefined;
39
+ generated: undefined;
40
+ }>;
41
+ };
42
+ dialect: "pg";
43
+ isAlias: false;
44
+ }>;
45
+ workspaceHistoryRefs: import("drizzle-orm/pg-core").PgTableWithColumns<{
46
+ name: "workspace_history_refs";
47
+ schema: undefined;
48
+ columns: {
49
+ workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
50
+ name: string;
51
+ tableName: "workspace_history_refs";
52
+ dataType: "string";
53
+ data: string;
54
+ driverParam: string;
55
+ notNull: true;
56
+ hasDefault: false;
57
+ isPrimaryKey: false;
58
+ isAutoincrement: false;
59
+ hasRuntimeDefault: false;
60
+ enumValues: undefined;
61
+ identity: undefined;
62
+ generated: undefined;
63
+ }>;
64
+ ref: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
65
+ name: string;
66
+ tableName: "workspace_history_refs";
67
+ dataType: "string";
68
+ data: string;
69
+ driverParam: string;
70
+ notNull: true;
71
+ hasDefault: false;
72
+ isPrimaryKey: false;
73
+ isAutoincrement: false;
74
+ hasRuntimeDefault: false;
75
+ enumValues: undefined;
76
+ identity: undefined;
77
+ generated: undefined;
78
+ }>;
79
+ head: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
80
+ name: string;
81
+ tableName: "workspace_history_refs";
82
+ dataType: "string";
83
+ data: string;
84
+ driverParam: string;
85
+ notNull: false;
86
+ hasDefault: false;
87
+ isPrimaryKey: false;
88
+ isAutoincrement: false;
89
+ hasRuntimeDefault: false;
90
+ enumValues: undefined;
91
+ identity: undefined;
92
+ generated: undefined;
93
+ }>;
94
+ sequence: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_refs", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>>, {
95
+ name: string;
96
+ tableName: "workspace_history_refs";
97
+ dataType: "number int32";
98
+ data: number;
99
+ driverParam: string | number;
100
+ notNull: true;
101
+ hasDefault: true;
102
+ isPrimaryKey: false;
103
+ isAutoincrement: false;
104
+ hasRuntimeDefault: false;
105
+ enumValues: undefined;
106
+ identity: undefined;
107
+ generated: undefined;
108
+ }>;
109
+ };
110
+ dialect: "pg";
111
+ isAlias: false;
112
+ }>;
113
+ workspaceHistoryRevisions: import("drizzle-orm/pg-core").PgTableWithColumns<{
114
+ name: "workspace_history_revisions";
115
+ schema: undefined;
116
+ columns: {
117
+ workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
118
+ name: string;
119
+ tableName: "workspace_history_revisions";
120
+ dataType: "string";
121
+ data: string;
122
+ driverParam: string;
123
+ notNull: true;
124
+ hasDefault: false;
125
+ isPrimaryKey: false;
126
+ isAutoincrement: false;
127
+ hasRuntimeDefault: false;
128
+ enumValues: undefined;
129
+ identity: undefined;
130
+ generated: undefined;
131
+ }>;
132
+ id: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
133
+ name: string;
134
+ tableName: "workspace_history_revisions";
135
+ dataType: "string";
136
+ data: string;
137
+ driverParam: string;
138
+ notNull: true;
139
+ hasDefault: false;
140
+ isPrimaryKey: false;
141
+ isAutoincrement: false;
142
+ hasRuntimeDefault: false;
143
+ enumValues: undefined;
144
+ identity: undefined;
145
+ generated: undefined;
146
+ }>;
147
+ ref: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
148
+ name: string;
149
+ tableName: "workspace_history_revisions";
150
+ dataType: "string";
151
+ data: string;
152
+ driverParam: string;
153
+ notNull: true;
154
+ hasDefault: false;
155
+ isPrimaryKey: false;
156
+ isAutoincrement: false;
157
+ hasRuntimeDefault: false;
158
+ enumValues: undefined;
159
+ identity: undefined;
160
+ generated: undefined;
161
+ }>;
162
+ parentId: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
163
+ name: string;
164
+ tableName: "workspace_history_revisions";
165
+ dataType: "string";
166
+ data: string;
167
+ driverParam: string;
168
+ notNull: false;
169
+ hasDefault: false;
170
+ isPrimaryKey: false;
171
+ isAutoincrement: false;
172
+ hasRuntimeDefault: false;
173
+ enumValues: undefined;
174
+ identity: undefined;
175
+ generated: undefined;
176
+ }>;
177
+ sequence: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
178
+ name: string;
179
+ tableName: "workspace_history_revisions";
180
+ dataType: "number int32";
181
+ data: number;
182
+ driverParam: string | number;
183
+ notNull: true;
184
+ hasDefault: false;
185
+ isPrimaryKey: false;
186
+ isAutoincrement: false;
187
+ hasRuntimeDefault: false;
188
+ enumValues: undefined;
189
+ identity: undefined;
190
+ generated: undefined;
191
+ }>;
192
+ createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
193
+ name: string;
194
+ tableName: "workspace_history_revisions";
195
+ dataType: "string";
196
+ data: string;
197
+ driverParam: string;
198
+ notNull: true;
199
+ hasDefault: false;
200
+ isPrimaryKey: false;
201
+ isAutoincrement: false;
202
+ hasRuntimeDefault: false;
203
+ enumValues: undefined;
204
+ identity: undefined;
205
+ generated: undefined;
206
+ }>;
207
+ message: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
208
+ name: string;
209
+ tableName: "workspace_history_revisions";
210
+ dataType: "string";
211
+ data: string;
212
+ driverParam: string;
213
+ notNull: false;
214
+ hasDefault: false;
215
+ isPrimaryKey: false;
216
+ isAutoincrement: false;
217
+ hasRuntimeDefault: false;
218
+ enumValues: undefined;
219
+ identity: undefined;
220
+ generated: undefined;
221
+ }>;
222
+ metadata: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonBuilder, Record<string, unknown>>, {
223
+ name: string;
224
+ tableName: "workspace_history_revisions";
225
+ dataType: "object json";
226
+ data: Record<string, unknown>;
227
+ driverParam: unknown;
228
+ notNull: false;
229
+ hasDefault: false;
230
+ isPrimaryKey: false;
231
+ isAutoincrement: false;
232
+ hasRuntimeDefault: false;
233
+ enumValues: undefined;
234
+ identity: undefined;
235
+ generated: undefined;
236
+ }>;
237
+ files: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgIntegerBuilder>, {
238
+ name: string;
239
+ tableName: "workspace_history_revisions";
240
+ dataType: "number int32";
241
+ data: number;
242
+ driverParam: string | number;
243
+ notNull: true;
244
+ hasDefault: false;
245
+ isPrimaryKey: false;
246
+ isAutoincrement: false;
247
+ hasRuntimeDefault: false;
248
+ enumValues: undefined;
249
+ identity: undefined;
250
+ generated: undefined;
251
+ }>;
252
+ bytes: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
253
+ name: string;
254
+ tableName: "workspace_history_revisions";
255
+ dataType: "number int53";
256
+ data: number;
257
+ driverParam: string | number;
258
+ notNull: true;
259
+ hasDefault: false;
260
+ isPrimaryKey: false;
261
+ isAutoincrement: false;
262
+ hasRuntimeDefault: false;
263
+ enumValues: undefined;
264
+ identity: undefined;
265
+ generated: undefined;
266
+ }>;
267
+ entries: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonBuilder, Record<string, HistoryManifestFile>>>, {
268
+ name: string;
269
+ tableName: "workspace_history_revisions";
270
+ dataType: "object json";
271
+ data: Record<string, HistoryManifestFile>;
272
+ driverParam: unknown;
273
+ notNull: true;
274
+ hasDefault: false;
275
+ isPrimaryKey: false;
276
+ isAutoincrement: false;
277
+ hasRuntimeDefault: false;
278
+ enumValues: undefined;
279
+ identity: undefined;
280
+ generated: undefined;
281
+ }>;
282
+ fileIndex: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, HistoryFileIndex>>, {
283
+ name: string;
284
+ tableName: "workspace_history_revisions";
285
+ dataType: "object json";
286
+ data: HistoryFileIndex;
287
+ driverParam: unknown;
288
+ notNull: true;
289
+ hasDefault: false;
290
+ isPrimaryKey: false;
291
+ isAutoincrement: false;
292
+ hasRuntimeDefault: false;
293
+ enumValues: undefined;
294
+ identity: undefined;
295
+ generated: undefined;
296
+ }>;
297
+ committed: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_revisions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBooleanBuilder>>, {
298
+ name: string;
299
+ tableName: "workspace_history_revisions";
300
+ dataType: "boolean";
301
+ data: boolean;
302
+ driverParam: boolean;
303
+ notNull: true;
304
+ hasDefault: true;
305
+ isPrimaryKey: false;
306
+ isAutoincrement: false;
307
+ hasRuntimeDefault: false;
308
+ enumValues: undefined;
309
+ identity: undefined;
310
+ generated: undefined;
311
+ }>;
312
+ };
313
+ dialect: "pg";
314
+ isAlias: false;
315
+ }>;
316
+ workspaceHistoryObjects: import("drizzle-orm/pg-core").PgTableWithColumns<{
317
+ name: "workspace_history_objects";
318
+ schema: undefined;
319
+ columns: {
320
+ workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_objects", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
321
+ name: string;
322
+ tableName: "workspace_history_objects";
323
+ dataType: "string";
324
+ data: string;
325
+ driverParam: string;
326
+ notNull: true;
327
+ hasDefault: false;
328
+ isPrimaryKey: false;
329
+ isAutoincrement: false;
330
+ hasRuntimeDefault: false;
331
+ enumValues: undefined;
332
+ identity: undefined;
333
+ generated: undefined;
334
+ }>;
335
+ digest: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_objects", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
336
+ name: string;
337
+ tableName: "workspace_history_objects";
338
+ dataType: "string";
339
+ data: string;
340
+ driverParam: string;
341
+ notNull: true;
342
+ hasDefault: false;
343
+ isPrimaryKey: false;
344
+ isAutoincrement: false;
345
+ hasRuntimeDefault: false;
346
+ enumValues: undefined;
347
+ identity: undefined;
348
+ generated: undefined;
349
+ }>;
350
+ size: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_objects", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>, {
351
+ name: string;
352
+ tableName: "workspace_history_objects";
353
+ dataType: "number int53";
354
+ data: number;
355
+ driverParam: string | number;
356
+ notNull: true;
357
+ hasDefault: false;
358
+ isPrimaryKey: false;
359
+ isAutoincrement: false;
360
+ hasRuntimeDefault: false;
361
+ enumValues: undefined;
362
+ identity: undefined;
363
+ generated: undefined;
364
+ }>;
365
+ };
366
+ dialect: "pg";
367
+ isAlias: false;
368
+ }>;
369
+ workspaceHistoryMetadata: import("drizzle-orm/pg-core").PgTableWithColumns<{
370
+ name: "workspace_history_metadata";
371
+ schema: undefined;
372
+ columns: {
373
+ workspace: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_metadata", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
374
+ name: string;
375
+ tableName: "workspace_history_metadata";
376
+ dataType: "string";
377
+ data: string;
378
+ driverParam: string;
379
+ notNull: true;
380
+ hasDefault: false;
381
+ isPrimaryKey: false;
382
+ isAutoincrement: false;
383
+ hasRuntimeDefault: false;
384
+ enumValues: undefined;
385
+ identity: undefined;
386
+ generated: undefined;
387
+ }>;
388
+ key: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_metadata", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>>, {
389
+ name: string;
390
+ tableName: "workspace_history_metadata";
391
+ dataType: "string";
392
+ data: string;
393
+ driverParam: string;
394
+ notNull: true;
395
+ hasDefault: false;
396
+ isPrimaryKey: false;
397
+ isAutoincrement: false;
398
+ hasRuntimeDefault: false;
399
+ enumValues: undefined;
400
+ identity: undefined;
401
+ generated: undefined;
402
+ }>;
403
+ value: import("drizzle-orm/pg-core").PgBuildColumn<"workspace_history_metadata", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonBuilder, unknown>>, {
404
+ name: string;
405
+ tableName: "workspace_history_metadata";
406
+ dataType: "object json";
407
+ data: unknown;
408
+ driverParam: unknown;
409
+ notNull: true;
410
+ hasDefault: false;
411
+ isPrimaryKey: false;
412
+ isAutoincrement: false;
413
+ hasRuntimeDefault: false;
414
+ enumValues: undefined;
415
+ identity: undefined;
416
+ generated: undefined;
417
+ }>;
418
+ };
419
+ dialect: "pg";
420
+ isAlias: false;
421
+ }>;
422
+ };
423
+ export {};
@@ -0,0 +1 @@
1
+ export { t as workspaceHistorySchema } from "../history-schema-postgres-DZepCSBq.js";
@@ -0,0 +1,8 @@
1
+ // src/storage/blob-database-sources.ts
2
+ const blobDatabaseSources = Symbol.for("vitehub.workspace.blobDatabaseSources");
3
+ function readBlobDatabaseSources(store) {
4
+ if (typeof store !== "object" || store === null) return void 0;
5
+ const read = Reflect.get(store, blobDatabaseSources);
6
+ return typeof read === "function" ? Reflect.apply(read, store, []) : void 0;
7
+ }
8
+ export { readBlobDatabaseSources as n, blobDatabaseSources as t };