@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
@@ -0,0 +1,36 @@
1
+ import { defineGrant } from "@vite-hub/runtime/internal/grant";
2
+ // src/storage/target.ts
3
+ const storeTargetKey = Symbol("vitehub.workspace.store-target");
4
+ const storeTarget = defineGrant("vitehub.workspace.store-target", (resolve) => resolve);
5
+ function readStoreTarget(source) {
6
+ return source === null || source === void 0 ? void 0 : source[storeTargetKey];
7
+ }
8
+ /** Records where a Store or Workspace keeps its files. Only Store implementations and Workspace wrappers call it. */
9
+ function provideWorkspaceStoreTarget(owner, resolve) {
10
+ owner[storeTargetKey] = storeTarget.issue(resolve);
11
+ }
12
+ function forwardWorkspaceStoreTarget(source, target) {
13
+ const grant = readStoreTarget(source);
14
+ if (storeTarget.isValid(grant)) target[storeTargetKey] = grant;
15
+ }
16
+ async function resolveWorkspaceStoreTarget(source) {
17
+ return await storeTarget.check(readStoreTarget(source))?.();
18
+ }
19
+ // src/storage/materialization.ts
20
+ const revisionMaterializerKey = Symbol("vitehub.workspace.revision-materializer");
21
+ const revisionMaterializer = defineGrant("vitehub.workspace.revision-materializer", (materializer) => materializer);
22
+ function readRevisionMaterializer(source) {
23
+ return source === null || source === void 0 ? void 0 : source[revisionMaterializerKey];
24
+ }
25
+ /** Lets hosted sessions read and materialize Store revisions. Only Store implementations call it. */
26
+ function provideWorkspaceRevisionMaterializer(owner, materializer) {
27
+ owner[revisionMaterializerKey] = revisionMaterializer.issue(materializer);
28
+ }
29
+ function forwardWorkspaceRevisionMaterializer(source, target) {
30
+ const grant = readRevisionMaterializer(source);
31
+ if (revisionMaterializer.isValid(grant)) target[revisionMaterializerKey] = grant;
32
+ }
33
+ function resolveWorkspaceRevisionMaterializer(workspace) {
34
+ return revisionMaterializer.check(readRevisionMaterializer(workspace));
35
+ }
36
+ export { provideWorkspaceStoreTarget as a, forwardWorkspaceStoreTarget as i, provideWorkspaceRevisionMaterializer as n, resolveWorkspaceStoreTarget as o, resolveWorkspaceRevisionMaterializer as r, forwardWorkspaceRevisionMaterializer as t };
@@ -0,0 +1,5 @@
1
+ import { E as Workspace, L as WorkspaceDefinition } from "./types-Bel5IDmF.js";
2
+ declare function createWorkspace(definition: WorkspaceDefinition, options?: {
3
+ reuseStartupSnapshots?: boolean;
4
+ }): Workspace;
5
+ export { createWorkspace as t };
@@ -1,18 +1,19 @@
1
- import { t as createMemoryWorkspaceStore } from "./memory-D5jq9HZW.js";
2
- import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-DrSIenjj.js";
3
- import { o as copyJsonFileMetadata, t as forwardWorkspaceStoreTarget } from "./target-Dm9dHAVJ.js";
4
- import { a as isExcludedWorkspacePath, f as sha256, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, r as contentToBytes, s as matchesAny } from "./path--wrT_Azm.js";
5
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B5s9kNEA.js";
6
- import { d as normalizeHistoryRef, f as rejectHistoryHead, h as createWorkspaceWritePolicy, i as createWorkspaceHistory, l as historyConflict } from "./utils-Dw-WULEZ.js";
7
- import { t as createWorkspaceGlobMatcher } from "./glob-Cjxms1t7.js";
8
- import { t as createWorkspaceStoreFromProvider } from "./provider-sm9uzkLg.js";
9
- import { n as forwardWorkspaceRevisionMaterializer } from "./store-NZoRto-Y.js";
10
- import { t as searchText } from "./search-C_RfoM2j.js";
11
- import { a as normalizeWorkspaceSources, c as sourceMountIntersectsPath, f as prepareWorkspaceSource, g as getWorkspaceSourceRequestExecutor, n as createSourceContext, s as sourceMountContainsPath, v as workspaceSourceRequestDescriptorPath, y as requestJsonEqual } from "./config-D1QENneP.js";
12
- import { C as withWorkspaceStoreMutation, D as readWorkspaceFileOwner, _ as reconcileRemovedStartupSources, b as statVirtualSourcePath, c as workspaceInternalMetadataCapability, f as materializeWorkspaceSources, g as readSourceSnapshotPaths, h as readResolvedSourceFile, l as hasCurrentSourceSnapshot, m as readCurrentSourceSnapshot, n as createWorkspaceMetadataTarget, p as materializesCompleteSource, t as attachWorkspaceMetadataTarget, u as hasFreshSourceSnapshot, v as searchMaterializedStore } from "./metadata-target-DDoOQNp1.js";
13
- import { n as trackStagedWrites } from "./request-scope-Dw5n8bMC.js";
1
+ import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
2
+ import { a as isExcludedWorkspacePath, d as sha256, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, r as contentToBytes, s as matchesAny } from "./path-Bb9OIc_F.js";
3
+ import { t as searchText } from "./search-C_nVorq7.js";
4
+ import { t as createMemoryWorkspaceStore } from "./memory-BlSRrBH1.js";
5
+ import { a as normalizeWorkspaceSources, c as sourceMountIntersectsPath, f as prepareWorkspaceSource, g as getWorkspaceSourceRequestExecutor, n as createSourceContext, s as sourceMountContainsPath, v as workspaceSourceRequestDescriptorPath, y as requestJsonEqual } from "./config-jo5QgE1w.js";
6
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
7
+ import { f as normalizeHistoryRef, i as createWorkspaceHistory, m as rejectHistoryHead, u as historyConflict } from "./utils-DXP9xfXo.js";
8
+ import { t as copyJsonFileMetadata } from "./file-metadata-Bpsvjw_X.js";
9
+ import { t as createWorkspaceGlobMatcher } from "./glob-BreFjNAV.js";
10
+ import { t as createWorkspaceWritePolicy } from "./rules-BPDXypZV.js";
11
+ import { C as withWorkspaceStoreMutation, D as readWorkspaceFileOwner, _ as reconcileRemovedStartupSources, b as statVirtualSourcePath, c as workspaceInternalMetadataCapability, f as materializeWorkspaceSources, g as readSourceSnapshotPaths, h as readResolvedSourceFile, l as hasCurrentSourceSnapshot, m as readCurrentSourceSnapshot, n as createWorkspaceMetadataTarget, p as materializesCompleteSource, t as attachWorkspaceMetadataTarget, u as hasFreshSourceSnapshot, v as searchMaterializedStore } from "./metadata-target-CaGLY4ay.js";
12
+ import { t as createWorkspaceStoreFromProvider } from "./provider-CN14ewvx.js";
13
+ import { i as forwardWorkspaceStoreTarget, t as forwardWorkspaceRevisionMaterializer } from "./vitehub-grants-Co713QTg.js";
14
+ import { n as trackStagedWrites } from "./request-scope-CXCI_wCb.js";
14
15
  import { noExecutionAuthority } from "@vite-hub/runtime";
15
- //#region src/session/scope.ts
16
+ // src/session/scope.ts
16
17
  function isMissingWorkspacePathError(error) {
17
18
  return error instanceof Error && error.message.includes("Workspace path does not exist:");
18
19
  }
@@ -62,8 +63,7 @@ function scopedSearchQuery(query, paths, normalizePath) {
62
63
  paths: [...scoped].sort((left, right) => left.localeCompare(right))
63
64
  };
64
65
  }
65
- //#endregion
66
- //#region src/session/basic.ts
66
+ // src/session/basic.ts
67
67
  function unsupportedExec() {
68
68
  throw workspaceError("[vitehub] Workspace exec requires a Sandbox session host. Pass the active Sandbox session to workspace.startSession({ host }).");
69
69
  }
@@ -187,8 +187,7 @@ async function createBasicWorkspaceSession(workspace, options) {
187
187
  async close() {}
188
188
  };
189
189
  }
190
- //#endregion
191
- //#region src/sources/request-execution.ts
190
+ // src/sources/request-execution.ts
192
191
  const sourceRequestExecutions = /* @__PURE__ */ new WeakMap();
193
192
  function isWeakKey(value) {
194
193
  return Object(value) === value;
@@ -268,8 +267,7 @@ function serializedQuery(query) {
268
267
  }
269
268
  return queryFromUrl(new URL(`https://vitehub.local/?${params}`));
270
269
  }
271
- //#endregion
272
- //#region src/sources/resolver.ts
270
+ // src/sources/resolver.ts
273
271
  function resolveWorkspacePath(definition, path) {
274
272
  const workspacePath = normalizeSafeWorkspacePath(path, { allowEmpty: true });
275
273
  const sources = normalizeWorkspaceSources(definition.sources).filter((source) => source.materialize !== "none");
@@ -299,8 +297,7 @@ function createSourceResolution(source, workspacePath, sourcePath) {
299
297
  readonly: true
300
298
  };
301
299
  }
302
- //#endregion
303
- //#region src/sources/sync-state.ts
300
+ // src/sources/sync-state.ts
304
301
  function sourceSyncMetaKey(sourceKey, workspace) {
305
302
  return workspace ? `workspace:${workspace}:source:${sourceKey}:sync` : `source:${sourceKey}:sync`;
306
303
  }
@@ -355,8 +352,7 @@ function canonicalSourceSyncState(state) {
355
352
  source: state.source
356
353
  };
357
354
  }
358
- //#endregion
359
- //#region src/sources/view.ts
355
+ // src/sources/view.ts
360
356
  function assertPublicFileMetadata(path, metadata) {
361
357
  metadata = copyJsonFileMetadata(path, metadata);
362
358
  if (metadata && Object.hasOwn(metadata, "source")) throw workspaceError(`[vitehub] Invalid Workspace metadata for ${path}. metadata.source is reserved for Source materialization.`);
@@ -678,8 +674,8 @@ function createWorkspaceSourceView(definition, store, options = {}) {
678
674
  const normalized = normalizeWorkspacePath(path);
679
675
  if (!isDescriptorPath(normalized)) for (const source of await getLazySourcesForPath(normalized)) {
680
676
  if (source.materialize !== "startup" || isExcludedWorkspacePath(source.mountPath, options.exclude)) continue;
681
- await ensurePrepared(source.key);
682
- if (!usesLiveProvider(source)) await ensureMaterialized(source.key);
677
+ await ensurePrepared(source.key, { directory: normalized });
678
+ if (!usesLiveProvider(source)) await ensureMaterialized(source.key, true, { directory: normalized });
683
679
  }
684
680
  const storeEntries = isDescriptorPath(normalized) ? [] : await store.list(path, options);
685
681
  const result = new Map(storeEntries.map((entry) => [entry.path, entry]));
@@ -1231,8 +1227,7 @@ function dedupeHits(hits) {
1231
1227
  return true;
1232
1228
  });
1233
1229
  }
1234
- //#endregion
1235
- //#region src/storage/metadata-keys.ts
1230
+ // src/storage/metadata-keys.ts
1236
1231
  const internalMetaKeyPrefixes = [
1237
1232
  "source:",
1238
1233
  "workspace:",
@@ -1249,8 +1244,7 @@ function assertPublicWorkspaceMetaKey(key) {
1249
1244
  if (isInternalWorkspaceMetaKey(key)) throw workspaceError(`[vitehub] Workspace metadata key ${JSON.stringify(key)} is reserved for Workspace internals.`);
1250
1245
  return key;
1251
1246
  }
1252
- //#endregion
1253
- //#region src/core/workspace-cache.ts
1247
+ // src/core/workspace-cache.ts
1254
1248
  const workspaceStoreCacheKey = Symbol.for("vitehub.workspace.storeCache");
1255
1249
  function storeByDefinition() {
1256
1250
  const scope = globalThis;
@@ -1272,8 +1266,7 @@ function resetWorkspaceStoreCache() {
1272
1266
  const scope = globalThis;
1273
1267
  scope[workspaceStoreCacheKey] = /* @__PURE__ */ new WeakMap();
1274
1268
  }
1275
- //#endregion
1276
- //#region src/core/workspace.ts
1269
+ // src/core/workspace.ts
1277
1270
  function getStore(definition) {
1278
1271
  return getCachedWorkspaceStore(definition, () => trackStagedWrites(createWorkspaceStoreFromProvider(definition)));
1279
1272
  }
@@ -1292,7 +1285,7 @@ function createWorkspace(definition, options = {}) {
1292
1285
  };
1293
1286
  },
1294
1287
  async sync(options) {
1295
- const { syncWorkspaceSources } = await import("./sync-CrT8zjwc.js");
1288
+ const { syncWorkspaceSources } = await import("./sync-BBfR4g5y.js");
1296
1289
  return await syncWorkspaceSources(definition, store, options);
1297
1290
  },
1298
1291
  async materializeSources(options) {
@@ -1347,7 +1340,7 @@ function createWorkspace(definition, options = {}) {
1347
1340
  async startSession(options) {
1348
1341
  const host = options?.host;
1349
1342
  if (host) {
1350
- const { createHostedWorkspaceSession } = await import("./host-Bf1a2uo_.js").then((n) => n.n);
1343
+ const { createHostedWorkspaceSession } = await import("./host-C8yZizfk.js").then((n) => n.n);
1351
1344
  return await createHostedWorkspaceSession(workspace, {
1352
1345
  ...options,
1353
1346
  host
@@ -1362,10 +1355,9 @@ function createWorkspace(definition, options = {}) {
1362
1355
  const synchronizedWorkspace = workspace;
1363
1356
  synchronizedWorkspace.__workspaceDefinitionSyncKey = definition;
1364
1357
  synchronizedWorkspace.__syncWorkspaceDefinition = async (abortSignal) => {
1365
- const { syncWorkspaceDefinition } = await import("./lifecycle-D8FdpBod.js").then((n) => n.t);
1358
+ const { syncWorkspaceDefinition } = await import("./lifecycle-IReZfi0b.js").then((n) => n.t);
1366
1359
  await syncWorkspaceDefinition(definition, store, abortSignal);
1367
1360
  };
1368
1361
  return attachWorkspaceSourceRequestExecution(workspace, createWorkspaceSourceRequestExecution(definition));
1369
1362
  }
1370
- //#endregion
1371
1363
  export { isMissingWorkspacePathError as C, filterSessionEntries as S, workspaceSourceRequestMatches as _, isInternalWorkspaceMetaKey as a, assertPathInSessionScope as b, isWorkspaceSourceSyncMetaKey as c, sourceSyncPathClaims as d, workspaceSourceSyncStateEquals as f, getWorkspaceSourceRequestExecution as g, createWorkspaceSourceRequestExecution as h, assertPublicWorkspaceMetaKey as i, readWorkspaceSourceSyncState as l, attachWorkspaceSourceRequestExecution as m, invalidateCachedWorkspaceStore as n, createWorkspaceSourceView as o, resolveWorkspacePath as p, resetWorkspaceStoreCache as r, invalidateWorkspaceSourceMaterialization as s, createWorkspace as t, sourceSyncMetaKey as u, createBasicWorkspaceSession as v, scopedSearchQuery as w, filterSessionDiff as x, assertDiffInsideSessionPaths as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/workspace",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "Agent-oriented filesystem state and Vite integration for ViteHub.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -50,6 +50,11 @@
50
50
  "import": "./dist/blob-database.js",
51
51
  "default": "./dist/blob-database.js"
52
52
  },
53
+ "./blob-database/postgres": {
54
+ "types": "./dist/blob-database/postgres.d.ts",
55
+ "import": "./dist/blob-database/postgres.js",
56
+ "default": "./dist/blob-database/postgres.js"
57
+ },
53
58
  "./checkout": {
54
59
  "types": "./dist/checkout.d.ts",
55
60
  "import": "./dist/checkout.js",
@@ -75,6 +80,11 @@
75
80
  "import": "./dist/internal/path.js",
76
81
  "default": "./dist/internal/path.js"
77
82
  },
83
+ "./internal/workspace": {
84
+ "types": "./dist/internal/workspace.d.ts",
85
+ "import": "./dist/internal/workspace.js",
86
+ "default": "./dist/internal/workspace.js"
87
+ },
78
88
  "./lineage": {
79
89
  "types": "./dist/lineage.d.ts",
80
90
  "import": "./dist/lineage.js",
@@ -139,48 +149,48 @@
139
149
  },
140
150
  "dependencies": {
141
151
  "@valibot/to-json-schema": "^1.8.0",
142
- "@vercel/nft": "^1.11.0",
143
- "@vite-hub/runtime": "0.4.1",
144
- "@vite-hub/source": "0.4.1",
152
+ "@vercel/nft": "^1.11.12",
153
+ "@vite-hub/runtime": "0.5.1",
154
+ "@vite-hub/source": "0.5.1",
145
155
  "birpc": "^4.2.0",
146
156
  "defu": "^6.1.7",
147
- "exsolve": "^1.1.3",
148
- "isomorphic-git": "^1.44.10",
157
+ "exsolve": "^1.2.0",
158
+ "isomorphic-git": "^1.44.18",
149
159
  "jiti": "^2.7.0",
150
- "minimatch": "^10.2.6",
160
+ "minimatch": "^11.0.9",
151
161
  "mrmime": "^2.0.1",
152
162
  "nostics": "1.4.0",
153
163
  "valibot": "^1.5.0",
154
164
  "yaml": "^2.9.1",
155
- "@vite-hub/markdown-template": "0.4.1",
156
- "@vite-hub/blob": "0.4.1",
157
- "@vite-hub/database": "0.4.1",
158
- "@vite-hub/sandbox": "0.4.1"
165
+ "@vite-hub/markdown-template": "0.5.1",
166
+ "@vite-hub/blob": "0.5.1",
167
+ "@vite-hub/database": "0.5.1",
168
+ "@vite-hub/sandbox": "0.5.1"
159
169
  },
160
170
  "devDependencies": {
161
- "@types/node": "^24.19.1",
162
- "@vercel/blob": "^2.8.0",
163
- "@vite-hub/env": "0.4.1",
164
- "@vite-hub/forge": "0.4.1",
171
+ "@types/node": "^24.19.2",
172
+ "@vercel/blob": "^2.9.0",
173
+ "@vite-hub/env": "0.5.1",
174
+ "@vite-hub/forge": "0.5.1",
165
175
  "@vite-hub/internal": "0.0.1",
166
- "@vite-hub/shell": "0.4.1",
167
- "ai": "7.0.130",
176
+ "@vite-hub/shell": "0.5.1",
177
+ "ai": "7.0.179",
168
178
  "esbuild": "^0.28.2",
169
179
  "publint": "^0.3.25",
170
180
  "typescript": "^6.0.3",
171
- "vite": "^8.2.2",
172
- "vite-plus": "^0.3.3",
173
- "vitest": "^4.1.11",
174
- "drizzle-orm": "1.0.0-rc.5",
181
+ "vite": "^8.3.8",
182
+ "vite-plus": "^1.7.0",
183
+ "vitest": "5.1.0",
184
+ "drizzle-orm": "1.0.0-rc.6",
175
185
  "miniflare": "4.20260730.0",
176
186
  "@libsql/client": "^0.18.0"
177
187
  },
178
188
  "peerDependencies": {
179
- "@vite-hub/shell": "0.4.1",
189
+ "@vite-hub/shell": "0.5.1",
180
190
  "ai": "^6.0.0 || ^7.0.0-0",
181
191
  "vite": ">=8.0.0",
182
- "drizzle-orm": "1.0.0-rc.5 || ^1.0.0",
183
- "@vite-hub/forge": "0.4.1"
192
+ "drizzle-orm": "1.0.0-rc.5 || 1.0.0-rc.6 || ^1.0.0",
193
+ "@vite-hub/forge": "0.5.1"
184
194
  },
185
195
  "peerDependenciesMeta": {
186
196
  "@vite-hub/shell": {
@@ -1,9 +0,0 @@
1
- import { I as WorkspaceDefinition, L as WorkspaceDefinitionInput } from "./types-1Z-tKK3g.js";
2
- import "./registry-CFl1Htyc.js";
3
- //#region src/core/registry.d.ts
4
- declare function registerWorkspace(name: string, definition: WorkspaceDefinitionInput): WorkspaceDefinition;
5
- /** Replace one generated catalog's definitions without replacing application registrations. */
6
- declare function setWorkspaceRuntimeDefinitions(scope: string, definitions: Record<string, WorkspaceDefinitionInput>): void;
7
- declare function resolveRegisteredWorkspaceDefinition(name: string, abortSignal?: AbortSignal): Promise<WorkspaceDefinition>;
8
- //#endregion
9
- export { resolveRegisteredWorkspaceDefinition as n, setWorkspaceRuntimeDefinitions as r, registerWorkspace as t };
@@ -1,35 +0,0 @@
1
- import { Ct as WorkspaceName, O as WorkspaceAssetsRegistry, Sn as WorkspaceStore, s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, w as VercelBlobWorkspaceStoreOptions } from "./types-1Z-tKK3g.js";
2
- import { h as WritableWorkspaceFacade, i as ReadonlyWorkspaceFacade, s as UseWorkspaceOptions } from "./use-CjbF8EO9.js";
3
- import { t as WorkspaceRegistry } from "./registry-CFl1Htyc.js";
4
- import "./registry-CwryP59t.js";
5
- //#region ../internal/src/runtime/cloudflare-env-lookup.d.ts
6
- type CloudflareWorkerEnv = Record<string, unknown>;
7
- //#endregion
8
- //#region ../internal/src/runtime/cloudflare-env.d.ts
9
- declare function setActiveCloudflareEnv(env: CloudflareWorkerEnv | undefined): void;
10
- //#endregion
11
- //#region src/core/use-tools.d.ts
12
- declare function useWorkspace<Name extends WorkspaceName>(name: Name): ReadonlyWorkspaceFacade<Name>;
13
- declare function useWorkspace<Name extends WorkspaceName>(name: Name, options: UseWorkspaceOptions & {
14
- mode?: "read";
15
- }): ReadonlyWorkspaceFacade<Name>;
16
- declare function useWorkspace<Name extends WorkspaceName>(name: Name, options: UseWorkspaceOptions & {
17
- mode: "write";
18
- }): WritableWorkspaceFacade<Name>;
19
- //#endregion
20
- //#region src/core/workspace-cache.d.ts
21
- declare function resetWorkspaceStoreCache(): void;
22
- //#endregion
23
- //#region src/runtime/hosted-store-loader.d.ts
24
- type HostedWorkspaceStoreOptions = CloudflareArtifactsWorkspaceStoreOptions | GitHubWorkspaceStoreOptions | VercelBlobWorkspaceStoreOptions;
25
- /** Returns `undefined` when no installed hosted store handles `options.provider`. */
26
- type WorkspaceHostedStoreLoader = (options: HostedWorkspaceStoreOptions, workspaceName: string) => WorkspaceStore | undefined;
27
- declare function setWorkspaceHostedStoreLoader(loader: WorkspaceHostedStoreLoader | undefined): void;
28
- declare function getWorkspaceHostedStoreLoader(): WorkspaceHostedStoreLoader | undefined;
29
- //#endregion
30
- //#region src/runtime/state.d.ts
31
- declare function invalidateWorkspaceStore(name: string): Promise<void>;
32
- declare function setWorkspaceRuntimeRegistry(registry: WorkspaceRegistry): void;
33
- declare function setWorkspaceRuntimeAssetsRegistry(registry: WorkspaceAssetsRegistry): void;
34
- //#endregion
35
- export { WorkspaceHostedStoreLoader as a, resetWorkspaceStoreCache as c, HostedWorkspaceStoreOptions as i, useWorkspace as l, setWorkspaceRuntimeAssetsRegistry as n, getWorkspaceHostedStoreLoader as o, setWorkspaceRuntimeRegistry as r, setWorkspaceHostedStoreLoader as s, invalidateWorkspaceStore as t, setActiveCloudflareEnv as u };
@@ -1,7 +0,0 @@
1
- import { I as WorkspaceDefinition, T as Workspace } from "./types-1Z-tKK3g.js";
2
- //#region src/core/workspace.d.ts
3
- declare function createWorkspace(definition: WorkspaceDefinition, options?: {
4
- reuseStartupSnapshots?: boolean;
5
- }): Workspace;
6
- //#endregion
7
- export { createWorkspace as t };