@vite-hub/workspace 0.4.0 → 0.5.0

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 (95) hide show
  1. package/README.md +62 -19
  2. package/dist/blob-database/postgres.d.ts +424 -0
  3. package/dist/blob-database/postgres.js +2 -0
  4. package/dist/blob-database-sources-DDZ1wV9w.js +9 -0
  5. package/dist/blob-database.d.ts +33 -447
  6. package/dist/blob-database.js +637 -208
  7. package/dist/checkout.js +1 -1
  8. package/dist/cloudflare.d.ts +1 -1
  9. package/dist/cloudflare.js +1 -1
  10. package/dist/{config-D1QENneP.js → config-DiyPi3Ff.js} +7 -7
  11. package/dist/{config-CDeGd0RB.d.ts → config-hxABr_Gg.d.ts} +1 -1
  12. package/dist/durability.d.ts +11 -2
  13. package/dist/durability.js +46 -4
  14. package/dist/{error-diagnostics-CQ4BUqRe.js → error-diagnostics-C0KyI408.js} +5 -1
  15. package/dist/{error-diagnostics-B5s9kNEA.js → error-diagnostics-Cth97txN.js} +10 -2
  16. package/dist/{path-uxLkzrZm.d.ts → errors-DXCZjdUU.d.ts} +0 -1
  17. package/dist/{file-CqG9zqiF.js → file-C1DYoGz3.js} +1 -1
  18. package/dist/{target-Dm9dHAVJ.js → file-metadata-Dv2JZwal.js} +1 -29
  19. package/dist/{files-B6wpAhEx.js → files-iHyik8jj.js} +2 -2
  20. package/dist/files.d.ts +13 -5
  21. package/dist/files.js +6 -5
  22. package/dist/{github-DKAlO0Vh.js → github-CFHl6RI0.js} +4 -4
  23. package/dist/{glob-BOqSKzSg.js → glob-BitxqDhb.js} +7 -7
  24. package/dist/{glob-Cjxms1t7.js → glob-Buxfvmyy.js} +1 -1
  25. package/dist/history-schema-BBWbpDk4.d.ts +436 -0
  26. package/dist/history-schema-postgres-U_ueRvmO.js +41 -0
  27. package/dist/{host-Bf1a2uo_.js → host-Dmr2Ctem.js} +150 -16
  28. package/dist/{hosted-zG7HJaE4.js → hosted-BktlvkF2.js} +20 -11
  29. package/dist/{hosted-vercel-blob-AbXG8fvR.js → hosted-vercel-blob-D0IPAjb1.js} +5 -5
  30. package/dist/hosted-vercel-blob.d.ts +1 -1
  31. package/dist/hosted-vercel-blob.js +1 -1
  32. package/dist/hosted.d.ts +1 -1
  33. package/dist/hosted.js +1 -1
  34. package/dist/index.d.ts +11 -23
  35. package/dist/index.js +28 -106
  36. package/dist/internal/workspace.d.ts +14 -0
  37. package/dist/internal/workspace.js +86 -0
  38. package/dist/{lifecycle-D8FdpBod.js → lifecycle-D6WN2dd_.js} +11 -8
  39. package/dist/loader.d.ts +1 -1
  40. package/dist/loader.js +2 -2
  41. package/dist/{mcp-resources-DntxtmDU.js → mcp-resources-TtxLNSL6.js} +1 -1
  42. package/dist/{memory-D5jq9HZW.js → memory-DjzwSng2.js} +16 -8
  43. package/dist/{metadata-target-DDoOQNp1.js → metadata-target-CR0aDtvS.js} +205 -60
  44. package/dist/{operation-definition-nmRu_O3V.d.ts → operation-definition-CI2PJGqu.d.ts} +8 -2
  45. package/dist/{operations-D8uCpzhM.js → operations-Cib30_dt.js} +5 -5
  46. package/dist/{operations-DsY2MQnG.js → operations-dtcU5LkD.js} +22 -7
  47. package/dist/operations.d.ts +2 -2
  48. package/dist/operations.js +1 -1
  49. package/dist/{path--wrT_Azm.js → path-BlIBpI7U.js} +1 -16
  50. package/dist/{plugins-CsrXCA1Q.d.ts → plugins-DKCBrH31.d.ts} +1 -1
  51. package/dist/{provider-sm9uzkLg.js → provider-Fc3M6bEx.js} +23 -10
  52. package/dist/providers/github/store.d.ts +1 -1
  53. package/dist/providers/github/store.js +1 -1
  54. package/dist/{registry-CwryP59t.d.ts → registry-CLL0TY0L.d.ts} +5 -3
  55. package/dist/{registry-DmVfUe4K.js → registry-CedQvQxW.js} +8 -3
  56. package/dist/{registry-CFl1Htyc.d.ts → registry-DpB5PBA4.d.ts} +5 -4
  57. package/dist/{request-scope-Dw5n8bMC.js → request-scope-Bcv2kD8h.js} +2 -1
  58. package/dist/rule-keys-Bsz6jTTF.js +19 -0
  59. package/dist/rules-OHaPFopX.js +269 -0
  60. package/dist/runtime/assets.d.ts +1 -1
  61. package/dist/runtime/assets.js +3 -3
  62. package/dist/runtime/empty-assets-registry.d.ts +1 -1
  63. package/dist/runtime/empty-registry.d.ts +2 -2
  64. package/dist/runtime/registry.d.ts +2 -2
  65. package/dist/runtime/request.js +1 -1
  66. package/dist/runtime/state.d.ts +5 -4
  67. package/dist/runtime/state.js +18 -6
  68. package/dist/runtime/workspace.d.ts +1 -1
  69. package/dist/runtime/workspace.js +1 -1
  70. package/dist/runtime.d.ts +9 -8
  71. package/dist/runtime.js +23 -16
  72. package/dist/{search-C_RfoM2j.js → search-BqNV9LnO.js} +1 -1
  73. package/dist/{server-Cd4-iCh5.js → server-CFtrOPk6.js} +5 -5
  74. package/dist/server.d.ts +2 -2
  75. package/dist/server.js +1 -1
  76. package/dist/{shared-ovXVSV3-.js → shared-BgDjxY3J.js} +14 -3
  77. package/dist/source-metadata.d.ts +2 -2
  78. package/dist/source-metadata.js +3 -3
  79. package/dist/{state-C-YtsaiJ.d.ts → state-DBV6VHS6.d.ts} +13 -21
  80. package/dist/{store-NZoRto-Y.js → store-BRMdD8Ft.js} +37 -36
  81. package/dist/{sync-CrT8zjwc.js → sync-BezGVzrW.js} +4 -4
  82. package/dist/test.d.ts +1 -1
  83. package/dist/test.js +1 -1
  84. package/dist/{types-1Z-tKK3g.d.ts → types-9DMtFjaa.d.ts} +52 -4
  85. package/dist/{use-B0o5HoBl.js → use-Dm2tbI5F.js} +15 -15
  86. package/dist/{use-CjbF8EO9.d.ts → use-Dv973swc.d.ts} +20 -28
  87. package/dist/{state-Cb_hIyAw.js → use-tools-C1qvhzme.js} +4 -17
  88. package/dist/use-tools-CMUthOdy.d.ts +12 -0
  89. package/dist/{utils-Dw-WULEZ.js → utils-C0Au2R16.js} +77 -268
  90. package/dist/vite.d.ts +32 -3
  91. package/dist/vite.js +990 -1286
  92. package/dist/vitehub-grants-C8IAl5-M.js +38 -0
  93. package/dist/{workspace-DvKu5PRa.js → workspace-CFrwWhEm.js} +18 -17
  94. package/dist/{workspace-CIXgHeyX.d.ts → workspace-Cw4ycIW-.d.ts} +1 -1
  95. package/package.json +22 -12
package/dist/checkout.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B5s9kNEA.js";
1
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Cth97txN.js";
2
2
  import { staleDerivedFiles } from "./lineage.js";
3
3
  import { t as workspaceCommitRequestBytes } from "./results-DgkZUmTL.js";
4
4
  import { isRuntimeDiagnostic } from "@vite-hub/runtime";
@@ -1,4 +1,4 @@
1
- import { Sn as WorkspaceStore, s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions } from "./types-1Z-tKK3g.js";
1
+ import { En as WorkspaceStore, s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions } from "./types-9DMtFjaa.js";
2
2
  import { configureHostedWorkspaceRuntime } from "./hosted.js";
3
3
  //#region src/providers/cloudflare/artifacts-store.d.ts
4
4
  export declare function createCloudflareArtifactsWorkspaceStore(options: CloudflareArtifactsWorkspaceStoreOptions, workspaceName: string): WorkspaceStore;
@@ -1,2 +1,2 @@
1
- import { a as createCloudflareArtifactsWorkspaceStore, t as configureHostedWorkspaceRuntime } from "./hosted-zG7HJaE4.js";
1
+ import { a as createCloudflareArtifactsWorkspaceStore, t as configureHostedWorkspaceRuntime } from "./hosted-BktlvkF2.js";
2
2
  export { configureHostedWorkspaceRuntime as configureCloudflareWorkspaceRuntime, createCloudflareArtifactsWorkspaceStore };
@@ -1,8 +1,8 @@
1
1
  import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-DrSIenjj.js";
2
- import { i as decodeFile, o as isWorkspaceBytes } from "./path--wrT_Azm.js";
3
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B5s9kNEA.js";
2
+ import { i as decodeFile, o as isWorkspaceBytes } from "./path-BlIBpI7U.js";
3
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Cth97txN.js";
4
4
  import { t as isRecord } from "./object-Da1zyPCR.js";
5
- import { t as internalErrorDiagnostics } from "./error-diagnostics-CQ4BUqRe.js";
5
+ import { t as internalErrorDiagnostics } from "./error-diagnostics-C0KyI408.js";
6
6
  import { t as abortable } from "./abort-BCwpdrN0.js";
7
7
  import { posix } from "node:path";
8
8
  import { createHash } from "node:crypto";
@@ -956,10 +956,10 @@ function inferredSourceFingerprintOptions(family, input) {
956
956
  async function loadInferredWorkspaceSource(family, input) {
957
957
  if (family === "fetch" && isRecord(input)) return createInferredFetchSource(input);
958
958
  if (family === "fetch") return createInferredFetchSource(input);
959
- if (family === "file") return (await import("./file-CqG9zqiF.js").then((n) => n.n)).file(input);
960
- if (family === "github") return (await import("./github-DKAlO0Vh.js").then((n) => n.n)).github(input);
961
- if (family === "glob") return (await import("./glob-BOqSKzSg.js").then((n) => n.n)).glob(input);
962
- return (await import("./mcp-resources-DntxtmDU.js").then((n) => n.n)).mcpResources(input);
959
+ if (family === "file") return (await import("./file-C1DYoGz3.js").then((n) => n.n)).file(input);
960
+ if (family === "github") return (await import("./github-CFHl6RI0.js").then((n) => n.n)).github(input);
961
+ if (family === "glob") return (await import("./glob-BitxqDhb.js").then((n) => n.n)).glob(input);
962
+ return (await import("./mcp-resources-TtxLNSL6.js").then((n) => n.n)).mcpResources(input);
963
963
  }
964
964
  function inferredSourceDefaults(family, input) {
965
965
  if (!isRecord(input)) return family === "file" ? { key: inferredFileSourceKey(input) } : {};
@@ -1,4 +1,4 @@
1
- import { An as WorkspaceValidateMode, I as WorkspaceDefinition, Xt as WorkspaceSourceInput, j as WorkspaceCacheOptions, pt as WorkspaceMaterializeMode, qt as WorkspaceSource, rn as WorkspaceSourceRequestDescriptor, vn as WorkspaceSourceSyncPolicy } from "./types-1Z-tKK3g.js";
1
+ import { L as WorkspaceDefinition, M as WorkspaceCacheOptions, Pn as WorkspaceValidateMode, Sn as WorkspaceSourceSyncPolicy, Zt as WorkspaceSource, _t as WorkspaceMaterializeMode, en as WorkspaceSourceInput, sn as WorkspaceSourceRequestDescriptor } from "./types-9DMtFjaa.js";
2
2
  //#region src/sources/request-metadata.d.ts
3
3
  declare function getWorkspaceSourceRequestDescriptor(source: WorkspaceSource): WorkspaceSourceRequestDescriptor | undefined;
4
4
  declare function isWorkspaceSourceRequestOnly(source: WorkspaceSource): boolean;
@@ -1,10 +1,19 @@
1
- import { L as WorkspaceDefinitionInput, v as ResolvedWorkspaceModuleOptions } from "./types-1Z-tKK3g.js";
1
+ import { R as WorkspaceDefinitionInput, v as ResolvedWorkspaceModuleOptions } from "./types-9DMtFjaa.js";
2
2
  import { Durability, DurabilityContext } from "@vite-hub/runtime/durability";
3
+ //#region src/storage/blob-database-sources.d.ts
4
+ /** The Blob store and Database names of a Blob + Database Store. `undefined` when the app passed an object. */
5
+ interface BlobDatabaseSources {
6
+ blob: string | undefined;
7
+ database: string | undefined;
8
+ }
9
+ //#endregion
3
10
  //#region src/durability.d.ts
4
11
  /** What the build passes to `workspaceDurability()`. */
5
12
  export interface WorkspaceDurabilityInput {
6
13
  /** The app passes its own `WorkspaceStore` object. */
7
14
  custom?: true;
15
+ /** The app passes a Blob + Database Store. Each name is `undefined` when the app passed an object. */
16
+ blobDatabase?: BlobDatabaseSources;
8
17
  /** The build chose the store, so `BLOB_STORE_ID` or `BLOB_READ_WRITE_TOKEN` can switch it to Vercel Blob at boot. */
9
18
  inferred?: boolean;
10
19
  driver?: string;
@@ -12,7 +21,7 @@ export interface WorkspaceDurabilityInput {
12
21
  root?: string;
13
22
  }
14
23
  /** The durability of Workspace files, from the store driver. */
15
- export declare function workspaceDurability(input: WorkspaceDurabilityInput, { env }: DurabilityContext): Durability[];
24
+ export declare function workspaceDurability(input: WorkspaceDurabilityInput, context: DurabilityContext): Durability[];
16
25
  /** Read the Definitions of the eager generated registry, whose loaders return the module without a Promise. */
17
26
  export declare function workspaceRegistryDefinitions(registry: Record<string, () => {
18
27
  default?: WorkspaceDefinitionInput;
@@ -1,5 +1,6 @@
1
- import { c as resolveWorkspaceDefinitionStore, n as isWorkspaceStore } from "./provider-sm9uzkLg.js";
2
- import { s as workspaceRegistryLoadError, t as normalizeWorkspaceDefinition } from "./registry-DmVfUe4K.js";
1
+ import { n as readBlobDatabaseSources } from "./blob-database-sources-DDZ1wV9w.js";
2
+ import { c as resolveWorkspaceDefinitionStore, n as isWorkspaceStore } from "./provider-Fc3M6bEx.js";
3
+ import { c as workspaceRegistryLoadError, n as normalizeWorkspaceDefinition } from "./registry-CedQvQxW.js";
3
4
  //#region src/durability.ts
4
5
  const sharedDrivers = {
5
6
  "cloudflare": "Cloudflare Artifacts.",
@@ -7,8 +8,48 @@ const sharedDrivers = {
7
8
  "vercel": "Vercel Blob."
8
9
  };
9
10
  const fix = "Use a shared Workspace store, such as `workspace: { store: { driver: \"github\" } }` or Vercel Blob.";
11
+ const blobDatabaseFix = "Pass the names of a shared Blob store and a shared Database, such as `createBlobDatabaseWorkspaceStore({ blob: \"default\", database: \"history\", workspace: \"docs\" })`.";
12
+ const scopeOrder = [
13
+ "process",
14
+ "host",
15
+ "shared"
16
+ ];
17
+ function blobDatabaseDurability({ blob, database }, context) {
18
+ if (blob === void 0 || database === void 0) return {
19
+ primitive: "workspace",
20
+ store: "blob-database",
21
+ scope: "shared",
22
+ reason: "A Blob + Database Store that got objects, not names. ViteHub cannot see which Blob store and Database it uses, so check that every instance uses the same shared ones, or pass their names."
23
+ };
24
+ const parts = [{
25
+ label: `the ${blob} Blob store`,
26
+ report: context.find("blob", blob)
27
+ }, {
28
+ label: `the ${database} Database`,
29
+ report: context.find("database", database)
30
+ }];
31
+ const off = parts.find((part) => !part.report);
32
+ if (off) return {
33
+ primitive: "workspace",
34
+ store: "blob-database",
35
+ scope: "process",
36
+ reason: `The Blob + Database Store uses ${off.label}, which is off.`,
37
+ fix: blobDatabaseFix
38
+ };
39
+ const reports = parts.map((part) => part.report);
40
+ const worst = reports.reduce((left, right) => scopeOrder.indexOf(right.scope) < scopeOrder.indexOf(left.scope) ? right : left);
41
+ return {
42
+ primitive: "workspace",
43
+ store: `blob-database (${reports.map((report) => report.store).join(", ")})`,
44
+ scope: worst.scope,
45
+ reason: `File bytes in ${parts[0].label} and history in ${parts[1].label}. ${reports.map((report) => report.reason).join(" ")}`,
46
+ ...worst.scope === "shared" ? {} : { fix: worst.fix ?? blobDatabaseFix }
47
+ };
48
+ }
10
49
  /** The durability of Workspace files, from the store driver. */
11
- function workspaceDurability(input, { env }) {
50
+ function workspaceDurability(input, context) {
51
+ const { env } = context;
52
+ if (input.blobDatabase) return [blobDatabaseDurability(input.blobDatabase, context)];
12
53
  if (input.custom) return [{
13
54
  primitive: "workspace",
14
55
  store: "custom",
@@ -57,7 +98,8 @@ function workspaceDefinitionsDurability(definitions, config, context) {
57
98
  env: context.env,
58
99
  hosting: context.env.VITEHUB_HOST
59
100
  });
60
- return workspaceDurability(isWorkspaceStore(store) ? { custom: true } : {
101
+ const blobDatabase = readBlobDatabaseSources(store);
102
+ return workspaceDurability(blobDatabase ? { blobDatabase } : isWorkspaceStore(store) ? { custom: true } : {
61
103
  driver: store?.driver,
62
104
  root: store && "root" in store && typeof store.root === "string" ? store.root : config ? `${config.root}/${name}` : void 0
63
105
  }, context).map((entry) => ({
@@ -25,7 +25,7 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
25
25
  why: ({ message }) => message === void 0 ? "" : String(message)
26
26
  },
27
27
  INTERNAL_R0022: {
28
- fix: "Send input that matches the schema of the operation. `vitehub <namespace> <command> --help` shows the fields.",
28
+ fix: "Send input that matches the schema of the operation. `vitehub <namespace> <command> --help` shows the fields, and the list_operations tool of the ViteHub MCP gives the input schema of each operation.",
29
29
  why: ({ message }) => message === void 0 ? "" : String(message)
30
30
  },
31
31
  INTERNAL_R0024: {
@@ -244,6 +244,10 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
244
244
  why: ({ owner }) => `[vitehub] ${owner} extends tuple requires [preset, options] with an options object.`,
245
245
  fix: "Set `extends` to a preset, or to a two-item tuple `[preset, { ...options }]` whose second item is a plain object."
246
246
  },
247
+ INTERNAL_RUNTIME_PACKAGE_VERSION_CONFLICT: {
248
+ why: ({ first, name, second }) => `[vitehub] One server function needs ${name} from two installations: ${first} and ${second}.`,
249
+ fix: "Install one version of the package that the message names, for example with `pnpm dedupe` or an `overrides` entry in `package.json`, then build again."
250
+ },
247
251
  INTERNAL_SECRET_PURPOSE_MISSING: {
248
252
  why: "[vitehub] A derived secret requires a purpose.",
249
253
  fix: "Pass a non-empty purpose to `deriveSecret()`, such as `deriveSecret(\"my-module:session\")`."
@@ -28,7 +28,7 @@ const workspaceErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
28
28
  target: `Workspace "${workspace}" has no ref or revision "${id}". Run \`vitehub workspace refs ${workspace}\` to list refs.`,
29
29
  workspace: `Unknown Workspace: ${workspace}.`
30
30
  })[problem],
31
- fix: "Check the Workspace name, the ref or revision, and the path. `vitehub workspace refs <workspace>` lists the refs, and `vitehub workspace show <workspace> <ref>` lists the files. When a base revision is gone, pull again without it."
31
+ fix: "Check the Workspace name, the ref or revision, and the path. `vitehub workspace refs <workspace>` lists the refs, and `vitehub workspace get <workspace> <ref>` lists the files. When a base revision is gone, pull again without it."
32
32
  },
33
33
  WORKSPACE_CHECKOUT_CONFLICT: {
34
34
  why: ({ conflicted, workspace }) => `Workspace "${workspace}" has unresolved conflicts: ${conflicted}.`,
@@ -100,6 +100,14 @@ const workspaceErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
100
100
  why: ({ driver, renamed }) => renamed ? `The Workspace \`store.driver\` is ${driver}. ViteHub renamed this driver to "${renamed}", and it does not read ${driver}.` : `The Workspace \`store.driver\` ${driver} is not a Workspace Store driver.`,
101
101
  fix: ({ renamed }) => renamed ? `Set \`store: { driver: "${renamed}" }\`, or run \`npx @vite-hub/codemods driver-key\` to rename it in every config file.` : "Set `store.driver` to \"local\", \"memory\", \"github\", \"cloudflare\", or \"vercel\", or pass a Store object."
102
102
  },
103
+ WORKSPACE_DEFAULT_REF_DELETE: {
104
+ why: "`history.deleteRef()` cannot delete `main` or the ref that the Workspace working tree follows.",
105
+ fix: "Delete another ref, such as the ref of one run. To remove files from the working ref, commit without them. To remove the whole Workspace history, call `delete()` on the Blob + Database Store."
106
+ },
107
+ WORKSPACE_POSTGRES_HISTORY_SCHEMA_MISSING: {
108
+ why: "The Postgres Database for this Workspace is missing its history catalog table.",
109
+ fix: "Apply the migrations for `workspaceHistorySchema` from `vite-hub/workspace/blob-database/postgres`. For a ViteHub Database, add the schema to its Definition and run `vitehub database generate` and `vitehub database migrate`. With PGlite, stop the dev server before running `vitehub database migrate` and start it again afterward, because only one process can open the local PGlite folder at a time."
110
+ },
103
111
  WORKSPACE_REGISTRY_LOAD_FAILED: {
104
112
  why: ({ reason, workspace }) => `The module of Workspace "${workspace}" did not load: ${reason}`,
105
113
  fix: "Read `error.cause` for the first error. Make sure that the module of the Workspace loads without errors and exports its Definition: the default export of a file in `server/workspaces/`, or the export that the Vite plugin names in its Workspace contribution. Then restart the dev server or build again."
@@ -185,7 +193,7 @@ const workspaceErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
185
193
  WORKSPACE_R0074: withFix("The Workspace Store keeps no file revisions, so ViteHub cannot prove that the file at the path in the message is the one it started to remove. Check the file. If it must go, delete it in the Store itself, for example in its directory or bucket, because the Workspace rejects writes under a Source. Then run the Source operation again."),
186
194
  WORKSPACE_R0075: withFix("Remove `read` from the rule. Workspace rules limit writes only, so `read: false` would not hide the files. Keep files that a reader must not see out of the Workspace, for example in another Workspace or in an Env secret."),
187
195
  WORKSPACE_R0076: withFix("Remove the option from the rule. A Workspace rule accepts `commit`, `maxBytes`, `mediaType`, `validate`, and `write`."),
188
- WORKSPACE_R0077: withFix("Pass the Drizzle database of the history Database: `database: () => useDatabase(\"history\").db` with `import { useDatabase } from \"vite-hub/database\"`. A Database Definition from `defineDatabase()` is not a Drizzle database.")
196
+ WORKSPACE_R0077: withFix("Pass the name of the history Database, `database: \"history\"`, or its Drizzle database, `database: () => useDatabase(\"history\").db` with `import { useDatabase } from \"vite-hub/database\"`. The Database can be SQLite, libSQL, D1, or Postgres. A Database Definition from `defineDatabase()` is not a Drizzle database.")
189
197
  }
190
198
  });
191
199
  //#endregion
@@ -1,4 +1,3 @@
1
- import "./types-1Z-tKK3g.js";
2
1
  import { ViteHubError } from "@vite-hub/runtime";
3
2
  //#region src/core/errors.d.ts
4
3
  type WorkspaceErrorCode = "WORKSPACE_CONFLICT" | "WORKSPACE_FAILED" | "WORKSPACE_NOT_FOUND" | "WORKSPACE_PATH_INVALID";
@@ -1,5 +1,5 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.js";
2
- import { d as withWorkspaceRuntimeOptions, u as ownSourceOption } from "./config-D1QENneP.js";
2
+ import { d as withWorkspaceRuntimeOptions, u as ownSourceOption } from "./config-DiyPi3Ff.js";
3
3
  import { file } from "@vite-hub/source";
4
4
  //#region src/sources/file.ts
5
5
  var file_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,4 @@
1
1
  import { s as workspaceError } from "./path-DrSIenjj.js";
2
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B5s9kNEA.js";
3
2
  //#region src/core/file-metadata.ts
4
3
  function invalidMetadata(path) {
5
4
  return workspaceError(`[vitehub] Invalid Workspace metadata for ${path}. Metadata must contain only JSON-safe plain objects, dense arrays, strings, booleans, null, and finite numbers other than negative zero.`);
@@ -59,31 +58,4 @@ function copyJsonFileMetadata(path, metadata, normalizeOptional = false) {
59
58
  return copy;
60
59
  }
61
60
  //#endregion
62
- //#region src/core/rule-keys.ts
63
- /** The rule fields that a more specific rule replaces only when it sets them. */
64
- const cascadingRuleKeys = [
65
- "commit",
66
- "maxBytes",
67
- "mediaType",
68
- "write"
69
- ];
70
- const workspaceRuleKeys = /* @__PURE__ */ new Set([...cascadingRuleKeys, "validate"]);
71
- /** Rejects rule keys that ViteHub does not enforce, such as `read`, so that a rule never looks like a protection it is not. */
72
- function assertWorkspaceRules(rules) {
73
- for (const [pattern, rule] of Object.entries(rules ?? {})) for (const key of Object.keys(rule ?? {})) {
74
- if (key === "read") throw workspaceErrorDiagnostics.WORKSPACE_R0075({ message: `[vitehub] Workspace rule "${pattern}" sets read. Workspace rules do not limit reads.` });
75
- if (!workspaceRuleKeys.has(key)) throw workspaceErrorDiagnostics.WORKSPACE_R0076({ message: `[vitehub] Workspace rule "${pattern}" does not support option "${key}".` });
76
- }
77
- }
78
- //#endregion
79
- //#region src/storage/target.ts
80
- const workspaceStoreTarget = Symbol.for("vitehub.workspace.storeTarget");
81
- function forwardWorkspaceStoreTarget(source, target) {
82
- const resolveTarget = source[workspaceStoreTarget];
83
- if (resolveTarget) target[workspaceStoreTarget] = resolveTarget.bind(source);
84
- }
85
- async function resolveWorkspaceStoreTarget(source) {
86
- return await source[workspaceStoreTarget]?.();
87
- }
88
- //#endregion
89
- export { cascadingRuleKeys as a, assertWorkspaceRules as i, resolveWorkspaceStoreTarget as n, copyJsonFileMetadata as o, workspaceStoreTarget as r, copyJsonWorkspaceMetadata as s, forwardWorkspaceStoreTarget as t };
61
+ export { copyJsonWorkspaceMetadata as n, copyJsonFileMetadata as t };
@@ -1,5 +1,5 @@
1
- import { l as normalizeWorkspacePath, o as isWorkspaceBytes, s as matchesAny } from "./path--wrT_Azm.js";
2
- import { f as prepareWorkspaceSource, n as createSourceContext } from "./config-D1QENneP.js";
1
+ import { l as normalizeWorkspacePath, o as isWorkspaceBytes, s as matchesAny } from "./path-BlIBpI7U.js";
2
+ import { f as prepareWorkspaceSource, n as createSourceContext } from "./config-DiyPi3Ff.js";
3
3
  //#region src/loaders/files.ts
4
4
  function shouldLoad(path, options) {
5
5
  if (options.include && !matchesAny(path, options.include)) return false;
package/dist/files.d.ts CHANGED
@@ -1,8 +1,16 @@
1
- import { $ as WorkspaceHistoryFileInput, $t as WorkspaceSourceMaterializationPathResult, A as WorkspaceAutoCommitPlan, An as WorkspaceValidateMode, At as WorkspaceRebaseOptions, B as WorkspaceEntry, Bt as WorkspaceSession, C as SourceContextWorkspaceFiles, Cn as WorkspaceStoreHistory, Ct as WorkspaceName, D as WorkspaceAssets, Dn as WorkspaceSyncOptions, Dt as WorkspacePlugin, E as WorkspaceAssetPath, En as WorkspaceStreamFile, Et as WorkspaceOptions, F as WorkspaceCustomSourceInput, Fn as WorkspaceWriteMode, Ft as WorkspaceRules, G as WorkspaceGitHubSourceInput, Gt as WorkspaceSessionWriteFileOptions, H as WorkspaceFetchSourceRequestOptions, Ht as WorkspaceSessionHostFileEntry, I as WorkspaceDefinition, In as WorkspaceWriteOperation, It as WorkspaceScopeName, J as WorkspaceHistoryChangesCommitOptions, Jt as WorkspaceSourceBindingInput, K as WorkspaceGlobSourceInput, Kt as WorkspaceSnapshot, L as WorkspaceDefinitionInput, Ln as WorkspaceWriteValidator, Lt as WorkspaceSearchHit, M as WorkspaceCapabilities, Mn as WorkspaceWriteErrorHook, Mt as WorkspaceRevision, N as WorkspaceContent, Nn as WorkspaceWriteHook, Nt as WorkspaceRevisionView, O as WorkspaceAssetsRegistry, On as WorkspaceSyncResultDetails, Ot as WorkspacePrepareSessionProgressEvent, P as WorkspaceContentStream, Pn as WorkspaceWriteInput, Pt as WorkspaceRule, Q as WorkspaceHistoryFile, Qt as WorkspaceSourceMaterializationCounts, R as WorkspaceDiff, Rn as WorkspaceWriteValidatorResult, Rt as WorkspaceSearchQuery, S as SourceContext, Sn as WorkspaceStore, St as WorkspaceMergeResolution, T as Workspace, Tn as WorkspaceStoreOptions, Tt as WorkspaceOpenPullRequestOptions, U as WorkspaceFile, Ut as WorkspaceSessionHostFiles, V as WorkspaceFetchSourceInput, Vt as WorkspaceSessionHost, W as WorkspaceFileSourceInput, Wt as WorkspaceSessionOptions, X as WorkspaceHistoryCommitOptions, Xt as WorkspaceSourceInput, Y as WorkspaceHistoryCommitBase, Yt as WorkspaceSourceDefinition, Z as WorkspaceHistoryExtensions, Zt as WorkspaceSourceItem, _ as ReadFileResult, _n as WorkspaceSourceSyncPathResult, _t as WorkspaceMcpResourcesSourceInput, a as GitHubWorkspaceOption, an as WorkspaceSourceRequestExecutionResult, at as WorkspaceHistoryRefOptions, b as RmOptions, bn as WorkspaceSourceSyncStatus, bt as WorkspaceMergeConflictContext, c as GlobOptions, cn as WorkspaceSourceResolutionContext, ct as WorkspaceInstructionBinding, d as LocalWorkspaceStoreOptions, dn as WorkspaceSourceResolutionInvocation, dt as WorkspaceLoader, en as WorkspaceSourceMaterializationStatus, et as WorkspaceHistoryFilesCommitOptions, f as Logger, fn as WorkspaceSourceResolutionResult, ft as WorkspaceLoaderSource, g as ReadFileOptions, gn as WorkspaceSourceSyncCounts, gt as WorkspaceMaterializeSourcesResult, h as MkdirOptions, hn as WorkspaceSourceSyncConfig, ht as WorkspaceMaterializeSourcesProgressEvent, i as ExecResult, in as WorkspaceSourceRequestExecutionInput, it as WorkspaceHistoryRef, j as WorkspaceCacheOptions, jn as WorkspaceWriteCommit, jt as WorkspaceRetainedHistory, k as WorkspaceAuthor, kn as WorkspaceSyncSnapshotOptions, kt as WorkspacePullRequest, l as ListOptions, ln as WorkspaceSourceResolutionContextMap, lt as WorkspaceInstructionBindingValue, m as MemoryWorkspaceStoreOptions, mn as WorkspaceSourceSelection, mt as WorkspaceMaterializeSourcesOptions, n as DiffOptions, nn as WorkspaceSourceMountOptions, nt as WorkspaceHistoryListResult, o as GitHubWorkspaceRefs, on as WorkspaceSourceRequestExecutor, ot as WorkspaceHookContext, p as MaybePromise, pn as WorkspaceSourceResolver, pt as WorkspaceMaterializeMode, q as WorkspaceHistoryChanges, qt as WorkspaceSource, r as ExecOptions, rn as WorkspaceSourceRequestDescriptor, rt as WorkspaceHistoryReader, s as GitHubWorkspaceStoreOptions, sn as WorkspaceSourceRequestMethod, st as WorkspaceHooks, t as CloudflareArtifactsWorkspaceStoreOptions, tn as WorkspaceSourceMount, tt as WorkspaceHistoryListOptions, u as LoaderContext, un as WorkspaceSourceResolutionContextValueReader, ut as WorkspaceLastChange, v as ResolvedWorkspaceModuleOptions, vn as WorkspaceSourceSyncPolicy, vt as WorkspaceMergeCommit, w as VercelBlobWorkspaceStoreOptions, wn as WorkspaceStoreHistoryCommitOptions, wt as WorkspaceNameMap, x as SnapshotOptions, xn as WorkspaceStat, xt as WorkspaceMergeOptions, y as ResolvedWorkspaceRule, yn as WorkspaceSourceSyncResult, yt as WorkspaceMergeConflict, z as WorkspaceDiffEntry, zn as WriteFileOptions, zt as WorkspaceSelectedScope } from "./types-1Z-tKK3g.js";
2
- import { C as resolveWorkspaceStoreTarget, S as WorkspaceStoreTarget, _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles, o as ReadonlyWorkspaceFs, s as UseWorkspaceOptions, u as WorkspaceHistory, v as WritableWorkspaceFs, x as useWorkspaceFiles } from "./use-CjbF8EO9.js";
3
- import { n as isWorkspaceConflict } from "./path-uxLkzrZm.js";
1
+ import { $ as WorkspaceHistoryDiffOptions, $t as WorkspaceSourceDefinition, A as WorkspaceAuthor, An as WorkspaceStreamFile, At as WorkspaceOptions, B as WorkspaceDiffEntry, Bn as WorkspaceWriteOperation, Bt as WorkspaceScopeName, C as SourceContextWorkspaceFiles, Cn as WorkspaceSourceSyncResult, Ct as WorkspaceMergeConflict, D as WorkspaceAssetPath, Dn as WorkspaceStoreHistory, Dt as WorkspaceName, E as Workspace, En as WorkspaceStore, Et as WorkspaceMergeResolution, F as WorkspaceContentStream, Fn as WorkspaceWriteCommit, Ft as WorkspaceRetainedHistory, G as WorkspaceFileSourceInput, Gt as WorkspaceSessionHost, H as WorkspaceFetchSourceInput, Hn as WorkspaceWriteValidatorResult, Ht as WorkspaceSearchQuery, I as WorkspaceCustomSourceInput, In as WorkspaceWriteErrorHook, It as WorkspaceRevision, J as WorkspaceHistoryChanges, Jt as WorkspaceSessionOptions, K as WorkspaceGitHubSourceInput, Kt as WorkspaceSessionHostFileEntry, L as WorkspaceDefinition, Ln as WorkspaceWriteHook, Lt as WorkspaceRevisionView, M as WorkspaceCacheOptions, Mn as WorkspaceSyncResultDetails, Mt as WorkspacePrepareSessionProgressEvent, N as WorkspaceCapabilities, Nn as WorkspaceSyncSnapshotOptions, Nt as WorkspacePullRequest, O as WorkspaceAssets, On as WorkspaceStoreHistoryCommitOptions, Ot as WorkspaceNameMap, P as WorkspaceContent, Pn as WorkspaceValidateMode, Pt as WorkspaceRebaseOptions, Q as WorkspaceHistoryDeleteRefOptions, Qt as WorkspaceSourceBindingInput, R as WorkspaceDefinitionInput, Rn as WorkspaceWriteInput, Rt as WorkspaceRule, S as SourceContext, Sn as WorkspaceSourceSyncPolicy, St as WorkspaceMergeCommit, T as VercelBlobWorkspaceStoreOptions, Tn as WorkspaceStat, Tt as WorkspaceMergeOptions, U as WorkspaceFetchSourceRequestOptions, Un as WriteFileOptions, Ut as WorkspaceSelectedScope, V as WorkspaceEntry, Vn as WorkspaceWriteValidator, Vt as WorkspaceSearchHit, W as WorkspaceFile, Wt as WorkspaceSession, X as WorkspaceHistoryCommitBase, Xt as WorkspaceSnapshot, Y as WorkspaceHistoryChangesCommitOptions, Yt as WorkspaceSessionWriteFileOptions, Z as WorkspaceHistoryCommitOptions, Zt as WorkspaceSource, _ as ReadFileResult, _n as WorkspaceSourceResolver, _t as WorkspaceMaterializeMode, a as GitHubWorkspaceOption, an as WorkspaceSourceMount, at as WorkspaceHistoryListResult, b as RmOptions, bn as WorkspaceSourceSyncCounts, bt as WorkspaceMaterializeSourcesResult, c as GlobOptions, cn as WorkspaceSourceRequestExecutionInput, ct as WorkspaceHistoryRefOptions, d as LocalWorkspaceStoreOptions, dn as WorkspaceSourceRequestMethod, dt as WorkspaceInstructionBinding, en as WorkspaceSourceInput, et as WorkspaceHistoryExtensions, f as Logger, fn as WorkspaceSourceResolutionContext, ft as WorkspaceInstructionBindingValue, g as ReadFileOptions, gn as WorkspaceSourceResolutionResult, gt as WorkspaceLookupName, h as MkdirOptions, hn as WorkspaceSourceResolutionInvocation, ht as WorkspaceLoaderSource, i as ExecResult, in as WorkspaceSourceMaterializationStatus, it as WorkspaceHistoryListOptions, j as WorkspaceAutoCommitPlan, jn as WorkspaceSyncOptions, jt as WorkspacePlugin, k as WorkspaceAssetsRegistry, kn as WorkspaceStoreOptions, kt as WorkspaceOpenPullRequestOptions, l as ListOptions, ln as WorkspaceSourceRequestExecutionResult, lt as WorkspaceHookContext, m as MemoryWorkspaceStoreOptions, mn as WorkspaceSourceResolutionContextValueReader, mt as WorkspaceLoader, n as DiffOptions, nn as WorkspaceSourceMaterializationCounts, nt as WorkspaceHistoryFileInput, o as GitHubWorkspaceRefs, on as WorkspaceSourceMountOptions, ot as WorkspaceHistoryReader, p as MaybePromise, pn as WorkspaceSourceResolutionContextMap, pt as WorkspaceLastChange, q as WorkspaceGlobSourceInput, qt as WorkspaceSessionHostFiles, r as ExecOptions, rn as WorkspaceSourceMaterializationPathResult, rt as WorkspaceHistoryFilesCommitOptions, s as GitHubWorkspaceStoreOptions, sn as WorkspaceSourceRequestDescriptor, st as WorkspaceHistoryRef, t as CloudflareArtifactsWorkspaceStoreOptions, tn as WorkspaceSourceItem, tt as WorkspaceHistoryFile, u as LoaderContext, un as WorkspaceSourceRequestExecutor, ut as WorkspaceHooks, v as ResolvedWorkspaceModuleOptions, vn as WorkspaceSourceSelection, vt as WorkspaceMaterializeSourcesOptions, w as ValidatedWorkspaceName, wn as WorkspaceSourceSyncStatus, wt as WorkspaceMergeConflictContext, x as SnapshotOptions, xn as WorkspaceSourceSyncPathResult, xt as WorkspaceMcpResourcesSourceInput, y as ResolvedWorkspaceRule, yn as WorkspaceSourceSyncConfig, yt as WorkspaceMaterializeSourcesProgressEvent, z as WorkspaceDiff, zn as WorkspaceWriteMode, zt as WorkspaceRules } from "./types-9DMtFjaa.js";
2
+ import { _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles, o as ReadonlyWorkspaceFs, s as UseWorkspaceOptions, u as WorkspaceHistory, v as WritableWorkspaceFs, x as useWorkspaceFiles } from "./use-Dv973swc.js";
3
+ import { n as isWorkspaceConflict } from "./errors-DXCZjdUU.js";
4
+ import { t as isWorkspaceName } from "./registry-CLL0TY0L.js";
4
5
  import { n as normalizeSafeWorkspacePath } from "./path-zHxQUbqa.js";
5
- import { t as registerWorkspacePlugin } from "./plugins-CsrXCA1Q.js";
6
+ import { t as registerWorkspacePlugin } from "./plugins-DKCBrH31.js";
7
+ //#region src/storage/target.d.ts
8
+ interface WorkspaceStoreTarget {
9
+ provider: string;
10
+ containsPath?(ancestor: string, path: string): Promise<boolean>;
11
+ }
12
+ export declare function resolveWorkspaceStoreTarget(source: unknown): Promise<WorkspaceStoreTarget | undefined>;
13
+ //#endregion
6
14
  //#region src/providers/github/cache.d.ts
7
15
  /**
8
16
  * The GitHub answers that the GitHub Store keeps. An answer for a URL that names a commit or tree sha never
@@ -35,4 +43,4 @@ export declare function registerWorkspaceKV(store: WorkspaceKV | undefined): voi
35
43
  /** The reads of the GitHub Store in this server instance, for tests and inspection. */
36
44
  export declare function readGitHubReadStats(): GitHubReadStats;
37
45
  //#endregion
38
- export { type CloudflareArtifactsWorkspaceStoreOptions, type DiffOptions, type ExecOptions, type ExecResult, type GitHubReadStats, type GitHubWorkspaceOption, type GitHubWorkspaceRefs, type GitHubWorkspaceStoreOptions, type GlobOptions, type ListOptions, type LoaderContext, type LocalWorkspaceStoreOptions, type Logger, type MaybePromise, type MemoryWorkspaceStoreOptions, type MkdirOptions, type ReadFileOptions, type ReadFileResult, type ReadonlyWorkspaceFiles, type ReadonlyWorkspaceFs, type ResolvedWorkspaceModuleOptions, type ResolvedWorkspaceRule, type RmOptions, type SnapshotOptions, type SourceContext, type SourceContextWorkspaceFiles, type UseWorkspaceOptions, type VercelBlobWorkspaceStoreOptions, type Workspace, type WorkspaceAssetPath, type WorkspaceAssets, type WorkspaceAssetsRegistry, type WorkspaceAuthor, type WorkspaceAutoCommitPlan, type WorkspaceCacheOptions, type WorkspaceCapabilities, type WorkspaceContent, type WorkspaceContentStream, type WorkspaceCustomSourceInput, type WorkspaceDefinition, type WorkspaceDefinitionInput, type WorkspaceDiff, type WorkspaceDiffEntry, type WorkspaceEntry, type WorkspaceFetchSourceInput, type WorkspaceFetchSourceRequestOptions, type WorkspaceFile, type WorkspaceFileSourceInput, type WorkspaceGitHubSourceInput, type WorkspaceGlobSourceInput, type WorkspaceHistory, type WorkspaceHistoryChanges, type WorkspaceHistoryChangesCommitOptions, type WorkspaceHistoryCommitBase, type WorkspaceHistoryCommitOptions, type WorkspaceHistoryExtensions, type WorkspaceHistoryFile, type WorkspaceHistoryFileInput, type WorkspaceHistoryFilesCommitOptions, type WorkspaceHistoryListOptions, type WorkspaceHistoryListResult, type WorkspaceHistoryReader, type WorkspaceHistoryRef, type WorkspaceHistoryRefOptions, type WorkspaceHookContext, type WorkspaceHooks, type WorkspaceInstructionBinding, type WorkspaceInstructionBindingValue, type WorkspaceKV, type WorkspaceLastChange, type WorkspaceLoader, type WorkspaceLoaderSource, type WorkspaceMaterializeMode, type WorkspaceMaterializeSourcesOptions, type WorkspaceMaterializeSourcesProgressEvent, type WorkspaceMaterializeSourcesResult, type WorkspaceMcpResourcesSourceInput, type WorkspaceMergeCommit, type WorkspaceMergeConflict, type WorkspaceMergeConflictContext, type WorkspaceMergeOptions, type WorkspaceMergeResolution, type WorkspaceName, type WorkspaceNameMap, type WorkspaceOpenPullRequestOptions, type WorkspaceOptions, type WorkspacePlugin, type WorkspacePrepareSessionProgressEvent, type WorkspacePullRequest, type WorkspaceRebaseOptions, type WorkspaceRetainedHistory, type WorkspaceRevision, type WorkspaceRevisionView, type WorkspaceRule, type WorkspaceRules, type WorkspaceScopeName, type WorkspaceSearchHit, type WorkspaceSearchQuery, type WorkspaceSelectedScope, type WorkspaceSession, type WorkspaceSessionHost, type WorkspaceSessionHostFileEntry, type WorkspaceSessionHostFiles, type WorkspaceSessionOptions, type WorkspaceSessionWriteFileOptions, type WorkspaceSnapshot, type WorkspaceSource, type WorkspaceSourceBindingInput, type WorkspaceSourceDefinition, type WorkspaceSourceInput, type WorkspaceSourceItem, type WorkspaceSourceMaterializationCounts, type WorkspaceSourceMaterializationPathResult, type WorkspaceSourceMaterializationStatus, type WorkspaceSourceMount, type WorkspaceSourceMountOptions, type WorkspaceSourceRequestDescriptor, type WorkspaceSourceRequestExecutionInput, type WorkspaceSourceRequestExecutionResult, type WorkspaceSourceRequestExecutor, type WorkspaceSourceRequestMethod, type WorkspaceSourceResolutionContext, type WorkspaceSourceResolutionContextMap, type WorkspaceSourceResolutionContextValueReader, type WorkspaceSourceResolutionInvocation, type WorkspaceSourceResolutionResult, type WorkspaceSourceResolver, type WorkspaceSourceSelection, type WorkspaceSourceSyncConfig, type WorkspaceSourceSyncCounts, type WorkspaceSourceSyncPathResult, type WorkspaceSourceSyncPolicy, type WorkspaceSourceSyncResult, type WorkspaceSourceSyncStatus, type WorkspaceStat, type WorkspaceStore, type WorkspaceStoreHistory, type WorkspaceStoreHistoryCommitOptions, type WorkspaceStoreOptions, type WorkspaceStoreTarget, type WorkspaceStreamFile, type WorkspaceSyncOptions, type WorkspaceSyncResultDetails, type WorkspaceSyncSnapshotOptions, type WorkspaceValidateMode, type WorkspaceWriteCommit, type WorkspaceWriteErrorHook, type WorkspaceWriteHook, type WorkspaceWriteInput, type WorkspaceWriteMode, type WorkspaceWriteOperation, type WorkspaceWriteValidator, type WorkspaceWriteValidatorResult, type WritableWorkspaceFiles, type WritableWorkspaceFs, type WriteFileOptions, isWorkspaceConflict, normalizeSafeWorkspacePath, registerWorkspacePlugin, resolveWorkspaceStoreTarget, useWorkspaceFiles };
46
+ export { type CloudflareArtifactsWorkspaceStoreOptions, type DiffOptions, type ExecOptions, type ExecResult, type GitHubReadStats, type GitHubWorkspaceOption, type GitHubWorkspaceRefs, type GitHubWorkspaceStoreOptions, type GlobOptions, type ListOptions, type LoaderContext, type LocalWorkspaceStoreOptions, type Logger, type MaybePromise, type MemoryWorkspaceStoreOptions, type MkdirOptions, type ReadFileOptions, type ReadFileResult, type ReadonlyWorkspaceFiles, type ReadonlyWorkspaceFs, type ResolvedWorkspaceModuleOptions, type ResolvedWorkspaceRule, type RmOptions, type SnapshotOptions, type SourceContext, type SourceContextWorkspaceFiles, type UseWorkspaceOptions, type ValidatedWorkspaceName, type VercelBlobWorkspaceStoreOptions, type Workspace, type WorkspaceAssetPath, type WorkspaceAssets, type WorkspaceAssetsRegistry, type WorkspaceAuthor, type WorkspaceAutoCommitPlan, type WorkspaceCacheOptions, type WorkspaceCapabilities, type WorkspaceContent, type WorkspaceContentStream, type WorkspaceCustomSourceInput, type WorkspaceDefinition, type WorkspaceDefinitionInput, type WorkspaceDiff, type WorkspaceDiffEntry, type WorkspaceEntry, type WorkspaceFetchSourceInput, type WorkspaceFetchSourceRequestOptions, type WorkspaceFile, type WorkspaceFileSourceInput, type WorkspaceGitHubSourceInput, type WorkspaceGlobSourceInput, type WorkspaceHistory, type WorkspaceHistoryChanges, type WorkspaceHistoryChangesCommitOptions, type WorkspaceHistoryCommitBase, type WorkspaceHistoryCommitOptions, type WorkspaceHistoryDeleteRefOptions, type WorkspaceHistoryDiffOptions, type WorkspaceHistoryExtensions, type WorkspaceHistoryFile, type WorkspaceHistoryFileInput, type WorkspaceHistoryFilesCommitOptions, type WorkspaceHistoryListOptions, type WorkspaceHistoryListResult, type WorkspaceHistoryReader, type WorkspaceHistoryRef, type WorkspaceHistoryRefOptions, type WorkspaceHookContext, type WorkspaceHooks, type WorkspaceInstructionBinding, type WorkspaceInstructionBindingValue, type WorkspaceKV, type WorkspaceLastChange, type WorkspaceLoader, type WorkspaceLoaderSource, type WorkspaceLookupName, type WorkspaceMaterializeMode, type WorkspaceMaterializeSourcesOptions, type WorkspaceMaterializeSourcesProgressEvent, type WorkspaceMaterializeSourcesResult, type WorkspaceMcpResourcesSourceInput, type WorkspaceMergeCommit, type WorkspaceMergeConflict, type WorkspaceMergeConflictContext, type WorkspaceMergeOptions, type WorkspaceMergeResolution, type WorkspaceName, type WorkspaceNameMap, type WorkspaceOpenPullRequestOptions, type WorkspaceOptions, type WorkspacePlugin, type WorkspacePrepareSessionProgressEvent, type WorkspacePullRequest, type WorkspaceRebaseOptions, type WorkspaceRetainedHistory, type WorkspaceRevision, type WorkspaceRevisionView, type WorkspaceRule, type WorkspaceRules, type WorkspaceScopeName, type WorkspaceSearchHit, type WorkspaceSearchQuery, type WorkspaceSelectedScope, type WorkspaceSession, type WorkspaceSessionHost, type WorkspaceSessionHostFileEntry, type WorkspaceSessionHostFiles, type WorkspaceSessionOptions, type WorkspaceSessionWriteFileOptions, type WorkspaceSnapshot, type WorkspaceSource, type WorkspaceSourceBindingInput, type WorkspaceSourceDefinition, type WorkspaceSourceInput, type WorkspaceSourceItem, type WorkspaceSourceMaterializationCounts, type WorkspaceSourceMaterializationPathResult, type WorkspaceSourceMaterializationStatus, type WorkspaceSourceMount, type WorkspaceSourceMountOptions, type WorkspaceSourceRequestDescriptor, type WorkspaceSourceRequestExecutionInput, type WorkspaceSourceRequestExecutionResult, type WorkspaceSourceRequestExecutor, type WorkspaceSourceRequestMethod, type WorkspaceSourceResolutionContext, type WorkspaceSourceResolutionContextMap, type WorkspaceSourceResolutionContextValueReader, type WorkspaceSourceResolutionInvocation, type WorkspaceSourceResolutionResult, type WorkspaceSourceResolver, type WorkspaceSourceSelection, type WorkspaceSourceSyncConfig, type WorkspaceSourceSyncCounts, type WorkspaceSourceSyncPathResult, type WorkspaceSourceSyncPolicy, type WorkspaceSourceSyncResult, type WorkspaceSourceSyncStatus, type WorkspaceStat, type WorkspaceStore, type WorkspaceStoreHistory, type WorkspaceStoreHistoryCommitOptions, type WorkspaceStoreOptions, type WorkspaceStoreTarget, type WorkspaceStreamFile, type WorkspaceSyncOptions, type WorkspaceSyncResultDetails, type WorkspaceSyncSnapshotOptions, type WorkspaceValidateMode, type WorkspaceWriteCommit, type WorkspaceWriteErrorHook, type WorkspaceWriteHook, type WorkspaceWriteInput, type WorkspaceWriteMode, type WorkspaceWriteOperation, type WorkspaceWriteValidator, type WorkspaceWriteValidatorResult, type WritableWorkspaceFiles, type WritableWorkspaceFs, type WriteFileOptions, isWorkspaceConflict, isWorkspaceName, normalizeSafeWorkspacePath, registerWorkspacePlugin, useWorkspaceFiles };
package/dist/files.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { r as isWorkspaceConflict, t as normalizeSafeWorkspacePath } from "./path-DrSIenjj.js";
2
- import { n as resolveWorkspaceStoreTarget } from "./target-Dm9dHAVJ.js";
3
- import { _ as registerWorkspacePlugin } from "./utils-Dw-WULEZ.js";
4
- import { E as registerWorkspaceKV, w as readGitHubReadStats } from "./shared-ovXVSV3-.js";
5
- import { r as useWorkspaceFiles } from "./use-B0o5HoBl.js";
6
- export { isWorkspaceConflict, normalizeSafeWorkspacePath, readGitHubReadStats, registerWorkspaceKV, registerWorkspacePlugin, resolveWorkspaceStoreTarget, useWorkspaceFiles };
2
+ import { r as registerWorkspacePlugin } from "./rules-OHaPFopX.js";
3
+ import { o as resolveWorkspaceStoreTarget } from "./vitehub-grants-C8IAl5-M.js";
4
+ import { E as registerWorkspaceKV, w as readGitHubReadStats } from "./shared-BgDjxY3J.js";
5
+ import { t as isWorkspaceName } from "./registry-CedQvQxW.js";
6
+ import { r as useWorkspaceFiles } from "./use-Dm2tbI5F.js";
7
+ export { isWorkspaceConflict, isWorkspaceName, normalizeSafeWorkspacePath, readGitHubReadStats, registerWorkspaceKV, registerWorkspacePlugin, resolveWorkspaceStoreTarget, useWorkspaceFiles };
@@ -1,8 +1,8 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.js";
2
- import { s as matchesAny } from "./path--wrT_Azm.js";
3
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B5s9kNEA.js";
4
- import { M as readForgeEnv, h as readGitHubEnvToken, j as forgeEnv } from "./shared-ovXVSV3-.js";
5
- import { d as withWorkspaceRuntimeOptions, f as prepareWorkspaceSource, p as resolveGitHubIgnore } from "./config-D1QENneP.js";
2
+ import { s as matchesAny } from "./path-BlIBpI7U.js";
3
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Cth97txN.js";
4
+ import { M as readForgeEnv, h as readGitHubEnvToken, j as forgeEnv } from "./shared-BgDjxY3J.js";
5
+ import { d as withWorkspaceRuntimeOptions, f as prepareWorkspaceSource, p as resolveGitHubIgnore } from "./config-DiyPi3Ff.js";
6
6
  import { github } from "@vite-hub/source";
7
7
  //#region src/env.ts
8
8
  let viteLoadEnv;
@@ -1,14 +1,14 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.js";
2
- import { d as withWorkspaceRuntimeOptions, u as ownSourceOption } from "./config-D1QENneP.js";
3
- import { glob } from "@vite-hub/source";
2
+ import { d as withWorkspaceRuntimeOptions, u as ownSourceOption } from "./config-DiyPi3Ff.js";
3
+ import * as source from "@vite-hub/source";
4
4
  //#region src/sources/glob.ts
5
- var glob_exports = /* @__PURE__ */ __exportAll({ glob: () => glob$1 });
6
- function glob$1(options) {
7
- const source = glob({
5
+ var glob_exports = /* @__PURE__ */ __exportAll({ glob: () => glob });
6
+ function glob(options) {
7
+ const fileSource = source.glob({
8
8
  ...options,
9
9
  keyCache: options.keyCache ?? !isLazySource(options)
10
10
  });
11
- return withWorkspaceRuntimeOptions(source, options);
11
+ return withWorkspaceRuntimeOptions(fileSource, options);
12
12
  }
13
13
  function isLazySource(options) {
14
14
  const materialize = ownSourceOption(options, "materialize");
@@ -18,4 +18,4 @@ function isLazySource(options) {
18
18
  return mountMaterialize === "lazy" || mountMaterialize === "startup";
19
19
  }
20
20
  //#endregion
21
- export { glob_exports as n, glob$1 as t };
21
+ export { glob_exports as n, glob as t };
@@ -1,5 +1,5 @@
1
1
  import { t as normalizeSafeWorkspacePath } from "./path-DrSIenjj.js";
2
- import { l as normalizeWorkspacePath } from "./path--wrT_Azm.js";
2
+ import { l as normalizeWorkspacePath } from "./path-BlIBpI7U.js";
3
3
  import { Minimatch } from "minimatch";
4
4
  //#region src/core/glob.ts
5
5
  function createWorkspaceGlobMatcher(pattern, options = {}) {