@vite-hub/workspace 0.8.0 → 0.9.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 (46) hide show
  1. package/dist/blob-database.js +2 -2
  2. package/dist/checkout.d.ts +0 -6
  3. package/dist/checkout.js +1 -30
  4. package/dist/{config-Bze7OyvB.js → config-B-S_Z4G0.js} +5 -14
  5. package/dist/durability.js +2 -2
  6. package/dist/{error-diagnostics-CHgE8TQM.js → error-diagnostics-Dn4sQcKL.js} +3 -4
  7. package/dist/{file-DIBPXqbk.js → file-B3KxJyxb.js} +1 -1
  8. package/dist/{files-DAJyo7TU.js → files-DSOjTK36.js} +1 -1
  9. package/dist/files.d.ts +0 -6
  10. package/dist/files.js +4 -4
  11. package/dist/{github-DcrnEGNN.js → github-DDUrrKt8.js} +3 -3
  12. package/dist/{glob-YVshR7WP.js → glob-BfZVRPCk.js} +1 -1
  13. package/dist/{host-BT7EnmZf.js → host-CcCDXyJI.js} +3 -3
  14. package/dist/hosted-vercel-blob.js +3 -3
  15. package/dist/hosted.js +4 -19
  16. package/dist/index.js +12 -12
  17. package/dist/internal/path.js +1 -1
  18. package/dist/internal/workspace.js +2 -2
  19. package/dist/{lifecycle-B0ucHUum.js → lifecycle-CXiS7Dks.js} +4 -4
  20. package/dist/loader.js +1 -1
  21. package/dist/{mcp-resources-BDL0llKW.js → mcp-resources-B2J0YCD2.js} +1 -1
  22. package/dist/{metadata-target-mlHAv1p4.js → metadata-target-oc00D8g2.js} +2 -8
  23. package/dist/{operations-D3mZArDi.js → operations-DWPC8nrk.js} +3 -11
  24. package/dist/operations.js +1 -9
  25. package/dist/{provider-DZY1cLP5.js → provider-DBJeUNFI.js} +2 -11
  26. package/dist/providers/github/store.js +3 -35
  27. package/dist/{registry-OonxXCbd.js → registry-CqDWpDe9.js} +2 -2
  28. package/dist/{request-scope-jH4H0Sbm.js → request-scope-DZJbe-tP.js} +0 -2
  29. package/dist/{rule-keys-xMpiTLq1.js → rule-keys-DQYcSewo.js} +1 -1
  30. package/dist/{rules-DYQCKYdt.js → rules-sItt6TP-.js} +2 -10
  31. package/dist/runtime/request.js +1 -1
  32. package/dist/runtime/state.js +6 -6
  33. package/dist/runtime/workspace.js +1 -1
  34. package/dist/runtime.js +12 -12
  35. package/dist/server.js +4 -4
  36. package/dist/{shared-DCAyMX8U.js → shared-CaAKcBBr.js} +1 -14
  37. package/dist/source-metadata.js +3 -3
  38. package/dist/{sync-DkpTCr9u.js → sync-ztyvA0Va.js} +3 -3
  39. package/dist/test.js +1 -1
  40. package/dist/{use-hLouCwGz.js → use-BskfWVjx.js} +6 -6
  41. package/dist/{use-tools-NXEQt099.js → use-tools-D_eorKu1.js} +3 -3
  42. package/dist/{utils-Bv1NBg8r.js → utils-BoFJcaT1.js} +2 -3
  43. package/dist/vite.js +6 -62
  44. package/dist/{workspace-Cz-5Ne1c.js → workspace-Dbo5iYIc.js} +10 -10
  45. package/dist/{workspace-inspection-scanner-BlJ8bCAB.js → workspace-inspection-scanner-6QrvwVJG.js} +0 -5
  46. package/package.json +12 -12
package/dist/vite.js CHANGED
@@ -3,14 +3,14 @@ import { C as resolve$1, S as relative$1, _ as requireViteHubDevServerUrl, a as
3
3
  import { t as internalErrorDiagnostics } from "./error-diagnostics-CsiNo_oI.js";
4
4
  import { n as isRecord, r as isRecordOrFunction, t as isObject } from "./object-DNOrQSl5.js";
5
5
  import { ensureWorkspaceDevToken, readWorkspaceDevToken, refreshWorkspaceDevToken, runWorkspaceDevCommand, t as isViteHubSecretEqual, validateWorkspaceDevToken, workspaceDevHeader, workspaceDevRoute, workspaceDevTokenHeader, workspaceDevTokenServerId } from "./server.js";
6
- import { n as syncWorkspaceDefinition } from "./lifecycle-B0ucHUum.js";
7
- import { a as normalizeWorkspaceSources, n as createSourceContext } from "./config-Bze7OyvB.js";
6
+ import { n as syncWorkspaceDefinition } from "./lifecycle-CXiS7Dks.js";
7
+ import { a as normalizeWorkspaceSources, n as createSourceContext } from "./config-B-S_Z4G0.js";
8
8
  import { normalizeSafeWorkspacePath } from "./internal/path.js";
9
9
  import { t as createMemoryWorkspaceStore } from "./memory-BCZl_ZsJ.js";
10
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-CHgE8TQM.js";
10
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
11
11
  import { assertNoSymlinks, checkoutFailure, conflictMarkerPatterns, folderOf, formatWorkspaceStatus, ignoredName, localCheckoutStatus, pullWorkspaces, pushWorkspaces, resolveWorkspaceConflicts, workspaceLockFile, workspaceStatus } from "./checkout.js";
12
- import { n as isWorkspaceStore, r as normalizeWorkspaceStoreOptions } from "./provider-DZY1cLP5.js";
13
- import { c as workspaceRegistryLoadError, n as normalizeWorkspaceDefinition } from "./registry-OonxXCbd.js";
12
+ import { n as isWorkspaceStore, r as normalizeWorkspaceStoreOptions } from "./provider-DBJeUNFI.js";
13
+ import { c as workspaceRegistryLoadError, n as normalizeWorkspaceDefinition } from "./registry-CqDWpDe9.js";
14
14
  import { installHostedWorkspaceRuntime } from "./hosted.js";
15
15
  import { installHostedVercelBlobWorkspaceRuntime } from "./hosted-vercel-blob.js";
16
16
  import { createRequire, isBuiltin } from "node:module";
@@ -377,11 +377,9 @@ function isRelativeSpecifier(path) {
377
377
  function isBareSpecifier(id) {
378
378
  return !/^(?:\.{1,2}(?:[\\/]|$)|[\\/]|[A-Za-z]:[\\/]|\0|#|[a-z][a-z0-9+.-]*:)/i.test(id);
379
379
  }
380
- /** The folder that a relative import of `importer` resolves from, as esbuild's `resolveDir`. */
381
380
  function importerDir(importer, workingDir) {
382
381
  return importer && isAbsolute(importer) ? dirname(importer) : workingDir;
383
382
  }
384
- /** Rolldown resolves a specifier from an importer file. A bundle entry has none, so use a file in the working folder. */
385
383
  function importerFor(importer, workingDir) {
386
384
  return importer ?? join(workingDir, "__vitehub_entry__.js");
387
385
  }
@@ -414,11 +412,6 @@ function collectPackageExportCandidates(packageName, exportsValue, packageRelati
414
412
  }
415
413
  return candidates;
416
414
  }
417
- /**
418
- * Resolves `specifier` from a resolveId hook without running that hook again. `flag` in `custom` also skips the hook in
419
- * resolutions that other plugins start from this one. `skipSelf` is still needed: when two equal resolutions run at the
420
- * same time, Rolldown 1.2 can give one of them no `custom`, and the hook would then wait on its own resolution.
421
- */
422
415
  function resolveFrom(context, specifier, request, workingDir, flag) {
423
416
  return context.resolve(specifier, importerFor(request.importer, workingDir), {
424
417
  custom: {
@@ -735,9 +728,6 @@ function createWasmModulePlugin(outdir, workingDir, copy) {
735
728
  }
736
729
  };
737
730
  }
738
- /**
739
- * Leaves package imports external. Resolve package.json import mappings first, and preserve unmapped host imports.
740
- */
741
731
  function createExternalPackagesPlugin() {
742
732
  return {
743
733
  name: "vitehub-external-packages",
@@ -823,7 +813,6 @@ function createOptionalImportPlugin() {
823
813
  }
824
814
  };
825
815
  }
826
- /** Matches import paths as esbuild's `external` does: `*` is a wildcard, and a package name also matches its subpaths. */
827
816
  function createExternalMatcher(patterns) {
828
817
  if (!patterns?.length) return;
829
818
  const matchers = patterns.map((pattern) => {
@@ -835,7 +824,6 @@ function createExternalMatcher(patterns) {
835
824
  });
836
825
  return (id) => matchers.some((matches) => matches(id));
837
826
  }
838
- /** Returns the modules of the chunks that no chunk loaded from the entry chunk imports. */
839
827
  function findUnusedChunkModules(chunks) {
840
828
  const used = new Set(chunks.filter((chunk) => chunk.isEntry));
841
829
  for (const chunk of used) for (const other of chunks) if (!used.has(other) && chunk.code.includes(other.fileName)) used.add(other);
@@ -1104,7 +1092,6 @@ function publishedPackagePaths(packageDir) {
1104
1092
  entries
1105
1093
  };
1106
1094
  }
1107
- /** Copies a file or folder and follows links. `node_modules` folders and paths that disappear during the copy are skipped. */
1108
1095
  async function copyTree(source, target) {
1109
1096
  const info = await unlessGone(() => stat(source));
1110
1097
  if (!info) return;
@@ -2991,11 +2978,6 @@ function rejectDevRequest(rejection) {
2991
2978
  const fileOrExtensionProtocol = /^(?:file|.+-extension):/i;
2992
2979
  const ipv4Octet = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)";
2993
2980
  const ipv4Literal = new RegExp(`^${ipv4Octet}(?:\\.${ipv4Octet}){3}$`);
2994
- /**
2995
- * Tests IP literals like `node:net` `isIP`, without a Node import, so the Nitro-side check also runs in Worker
2996
- * runtimes. IPv4 uses the Node pattern (dotted decimal, no leading zeros). IPv6 uses the WHATWG URL parser, which
2997
- * rejects zone IDs. Browsers do not send zone IDs in `Host`.
2998
- */
2999
2981
  function isIPv4Literal(value) {
3000
2982
  return ipv4Literal.test(value);
3001
2983
  }
@@ -3214,10 +3196,6 @@ const runs = shared[runsKey] ??= /* @__PURE__ */ new Map();
3214
3196
  const startedKey = Symbol.for("vitehub.hints.started");
3215
3197
  const startedShared = globalThis;
3216
3198
  const started = startedShared[startedKey] ??= /* @__PURE__ */ new WeakSet();
3217
- /**
3218
- * The report of the ViteHub project root, where the other generated files go. A Nuxt app with `srcDir: "app"` has its
3219
- * Vite root in `app/`, one folder below.
3220
- */
3221
3199
  function hintsFile(config) {
3222
3200
  const projectRoot = Reflect.get(config, VITEHUB_PROJECT_ROOT);
3223
3201
  return resolve(typeof projectRoot === "string" ? projectRoot : resolveViteHubProjectRoot(config.root), viteHubHintsFile);
@@ -19814,7 +19792,6 @@ async function syncDiscoveredWorkspaceAssetBundles(definitions, rootDir, options
19814
19792
  }
19815
19793
  return bundles;
19816
19794
  }
19817
- /** The build does not read `lazy` and `startup` Sources, so it checks that each one can reach its data after deploy. */
19818
19795
  async function checkDeferredSourceAccess(definition) {
19819
19796
  for (const source of normalizeWorkspaceSources(definition.sources)) {
19820
19797
  if (source.materialize !== "lazy" && source.materialize !== "startup") continue;
@@ -19927,7 +19904,6 @@ const valueFlags = /* @__PURE__ */ new Set([
19927
19904
  "timeout",
19928
19905
  "url"
19929
19906
  ]);
19930
- /** The flags of each command. Any other flag fails before a call, so `push --dry-run` cannot commit. */
19931
19907
  const commandFlags = {
19932
19908
  pull: /* @__PURE__ */ new Set([
19933
19909
  "dir",
@@ -20172,7 +20148,6 @@ async function git(cwd, ...args) {
20172
20148
  async function exists(path) {
20173
20149
  return await stat(path).then(() => true, () => false);
20174
20150
  }
20175
- /** The hook manager that owns the hooks of the repository, such as Husky, or undefined when Git runs `.git/hooks`. */
20176
20151
  async function hookManager(top, rootDir) {
20177
20152
  const hooksPath = await git(top, "config", "--get", "core.hooksPath");
20178
20153
  if (hooksPath && [".husky", ".husky/_"].some((path) => resolve(top, hooksPath) === resolve(top, path))) return "Husky";
@@ -20186,7 +20161,6 @@ async function hookManager(top, rootDir) {
20186
20161
  for (const dir of /* @__PURE__ */ new Set([top, rootDir])) if ((await readFile(join(dir, "package.json"), "utf8").catch(() => void 0))?.includes("\"simple-git-hooks\"")) return "simple-git-hooks";
20187
20162
  return hooksPath ? `core.hooksPath (${hooksPath})` : void 0;
20188
20163
  }
20189
- /** Only a missing hook is safe to create. Other read errors must stop install and uninstall. */
20190
20164
  async function readHook(path) {
20191
20165
  try {
20192
20166
  return await readFile(path, "utf8");
@@ -20195,11 +20169,9 @@ async function readHook(path) {
20195
20169
  throw error;
20196
20170
  }
20197
20171
  }
20198
- /** A shell word for a value, such as a project path with spaces or quotes. */
20199
20172
  function shellQuote(value) {
20200
20173
  return `'${value.replaceAll("'", "'\\''")}'`;
20201
20174
  }
20202
- /** The hook file that `install` writes. A hook with any other content is not ViteHub's. */
20203
20175
  function script(hook, project) {
20204
20176
  const cd = project ? `"$(git rev-parse --show-toplevel)"/${shellQuote(project)}` : `"$(git rev-parse --show-toplevel)"`;
20205
20177
  return [
@@ -20215,7 +20187,6 @@ function manualLines(project) {
20215
20187
  const prefix = project ? `cd ${shellQuote(project)} && ` : "";
20216
20188
  return ` pre-commit: ${prefix}vitehub hooks pre-commit\n pre-push: ${prefix}vitehub hooks pre-push\n`;
20217
20189
  }
20218
- /** The top folder of the Git repository and the project folder inside it. */
20219
20190
  async function repository(rootDir) {
20220
20191
  const top = await git(rootDir, "rev-parse", "--show-toplevel");
20221
20192
  return top ? {
@@ -20270,7 +20241,6 @@ async function uninstall(context) {
20270
20241
  }
20271
20242
  return 0;
20272
20243
  }
20273
- /** True when the project has a lock file with at least one checked-out Workspace. Fails when the lock cannot be read. */
20274
20244
  async function hasCheckouts(rootDir) {
20275
20245
  let source;
20276
20246
  try {
@@ -20286,10 +20256,6 @@ async function hasCheckouts(rootDir) {
20286
20256
  return true;
20287
20257
  }
20288
20258
  }
20289
- /**
20290
- * A digest of `vitehub.lock` and of every file in its checkout folders, by path from the project folder. The pre-push
20291
- * hook compares two of them to find what `vitehub push` changed.
20292
- */
20293
20259
  async function checkoutFiles(rootDir) {
20294
20260
  const files = /* @__PURE__ */ new Map();
20295
20261
  const digest = async (path) => {
@@ -20350,7 +20316,6 @@ async function readStandardInput() {
20350
20316
  for await (const chunk of process.stdin) text += String(chunk);
20351
20317
  return text;
20352
20318
  }
20353
- /** Writes an error of a hook as the checkout commands write it, and fails the hook. */
20354
20319
  function fail(context, error) {
20355
20320
  const failure = checkoutFailure(error);
20356
20321
  context.stderr.write(`${failure.code}: ${failure.message}\n${failure.fix ? `${failure.fix}\n` : ""}`);
@@ -20381,7 +20346,6 @@ async function prePushChecked(context, options) {
20381
20346
  context.stderr.write(`vitehub: the Workspace push went through and changed these files:\n${changed.map((path) => ` ${path}\n`).join("")}Git stops this push because it does not contain them. Commit them, then run git push again.\n`);
20382
20347
  return 1;
20383
20348
  }
20384
- /** Text conflicts in the index, including files resolved only in the working tree. Paths are relative to the checkout. */
20385
20349
  async function stagedCheckoutConflicts(top, folder) {
20386
20350
  const dir = relative(top, folder).split(sep).join("/");
20387
20351
  try {
@@ -20771,7 +20735,7 @@ async function declaredSources(file, exportName = "default") {
20771
20735
  } catch {
20772
20736
  return;
20773
20737
  }
20774
- const { argumentExpression, defaultExportExpression, objectProperties, scanModule, unwrapExpression } = await import("./workspace-inspection-scanner-BlJ8bCAB.js").then((n) => n.t);
20738
+ const { argumentExpression, defaultExportExpression, objectProperties, scanModule, unwrapExpression } = await import("./workspace-inspection-scanner-6QrvwVJG.js").then((n) => n.t);
20775
20739
  const module = scanModule(source, file);
20776
20740
  if (module.errors.length) return;
20777
20741
  const exported = exportName === "default" ? defaultExportExpression(module) : namedWorkspaceExport(module, exportName);
@@ -20957,11 +20921,6 @@ function babelStaticObjectProperties(node) {
20957
20921
  if (node.properties?.some((property) => property.type === "SpreadElement" || property.computed || (property.key?.name ?? property.key?.value) === "__proto__")) return;
20958
20922
  return node.properties;
20959
20923
  }
20960
- /**
20961
- * Reads a store from the source of a Definition's default export when its driver cannot change when the module runs
20962
- * again: `{}` for no store or a custom Store, `{ driver }` for a hosted store, and `undefined` when the source does not
20963
- * show it. Comments do not count, because this reads the syntax tree.
20964
- */
20965
20924
  async function readStaticWorkspaceStore(file, loader, exportedName = "default") {
20966
20925
  if (exportedName !== "default") return;
20967
20926
  const loaded = await readSourceModule(file);
@@ -21006,11 +20965,6 @@ async function readStaticWorkspaceStore(file, loader, exportedName = "default")
21006
20965
  });
21007
20966
  return staticStore;
21008
20967
  }
21009
- /**
21010
- * Reads each Definition's store by loading the Definition, as the runtime does. When the build cannot load a Definition,
21011
- * it skips it only if the source shows that its store needs no Artifacts binding. Otherwise the build cannot write the
21012
- * binding that the store may need, so it fails and tells the developer to set the store in the `workspace` config.
21013
- */
21014
20968
  async function resolveDefinitionCloudflareArtifactsConfigs(definitions, rootDir, options) {
21015
20969
  const loader = createWorkspaceDefinitionLoader(rootDir, options.aliases);
21016
20970
  const configs = [];
@@ -21050,12 +21004,6 @@ async function resolveDefinitionCloudflareArtifactsConfigs(definitions, rootDir,
21050
21004
  }
21051
21005
  return configs;
21052
21006
  }
21053
- /**
21054
- * The Definitions that the config loads to find their Cloudflare Artifacts stores. A build loads all of them to learn
21055
- * which stores it bundles. `vite dev` and CLI calls (`serve`) load them only on the Cloudflare host, because only a
21056
- * Cloudflare server binds Artifacts. Loading runs app code outside Nitro, so its Nitro runtime imports would print
21057
- * Nitro's "stub implementation" warning on every command.
21058
- */
21059
21007
  function definitionsToLoad(definitions, command, hosting) {
21060
21008
  return command !== "serve" || getHostingProvider(hosting) === "cloudflare" ? definitions : [];
21061
21009
  }
@@ -21142,10 +21090,6 @@ const hostedWorkspaceStoreDrivers = [
21142
21090
  function isHostedWorkspaceStore(store) {
21143
21091
  return store.driver === "cloudflare" || store.driver === "github" || store.driver === "vercel";
21144
21092
  }
21145
- /**
21146
- * The hosted stores the Nitro plugin installs. Each store pulls its client into the server startup, so a build installs
21147
- * only the stores that its definitions use. Without `storeUsage` (dev) it installs every store.
21148
- */
21149
21093
  function resolveNitroHostedStoreProviders(config, definitionCount, storeUsage) {
21150
21094
  const configProvider = config && isHostedWorkspaceStore(config.store) ? config.store.driver : void 0;
21151
21095
  if (!storeUsage) return new Set(configProvider || definitionCount > 0 ? hostedWorkspaceStoreDrivers : []);
@@ -2,17 +2,17 @@ import { l as workspaceSourceReadOnlyError, n as isWorkspaceConflict, normalizeS
2
2
  import { a as isExcludedWorkspacePath, f as sha256, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, r as contentToBytes, s as matchesAny, u as readStoredFile } from "./path-DYHw5KNk.js";
3
3
  import { t as searchText } from "./search-CG6UNOtn.js";
4
4
  import { t as createMemoryWorkspaceStore } from "./memory-BCZl_ZsJ.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-Bze7OyvB.js";
6
- import { t as workspaceErrorDiagnostics } from "./error-diagnostics-CHgE8TQM.js";
7
- import { f as normalizeHistoryRef, i as createWorkspaceHistory, m as rejectHistoryHead, u as historyConflict } from "./utils-Bv1NBg8r.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-B-S_Z4G0.js";
6
+ import { t as workspaceErrorDiagnostics } from "./error-diagnostics-Dn4sQcKL.js";
7
+ import { f as normalizeHistoryRef, i as createWorkspaceHistory, m as rejectHistoryHead, u as historyConflict } from "./utils-BoFJcaT1.js";
8
8
  import { t as assertPublicFileMetadata } from "./file-metadata-Dqpldj0h.js";
9
9
  import { t as createWorkspaceGlobMatcher } from "./glob-BIg9O4yY.js";
10
- import { t as createWorkspaceWritePolicy } from "./rules-DYQCKYdt.js";
10
+ import { t as createWorkspaceWritePolicy } from "./rules-sItt6TP-.js";
11
11
  import { i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget, t as forwardWorkspaceRevisionMaterializer } from "./vitehub-grants-Co713QTg.js";
12
12
  import { i as replaceStorePath, n as getWorkspaceReplacement, o as requireWorkspaceReplacement, r as prepareWorkspaceReplacement, t as attachWorkspaceReplacement } from "./replacement-CVZVsflC.js";
13
- 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-mlHAv1p4.js";
14
- import { t as createWorkspaceStoreFromProvider } from "./provider-DZY1cLP5.js";
15
- import { n as trackStagedWrites } from "./request-scope-jH4H0Sbm.js";
13
+ 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-oc00D8g2.js";
14
+ import { t as createWorkspaceStoreFromProvider } from "./provider-DBJeUNFI.js";
15
+ import { n as trackStagedWrites } from "./request-scope-DZJbe-tP.js";
16
16
  import { noExecutionAuthority } from "@vite-hub/runtime";
17
17
  import { posix } from "node:path";
18
18
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1520,7 +1520,7 @@ function createWorkspace(definition, options = {}) {
1520
1520
  };
1521
1521
  },
1522
1522
  async sync(options) {
1523
- const { syncWorkspaceSources } = await import("./sync-DkpTCr9u.js");
1523
+ const { syncWorkspaceSources } = await import("./sync-ztyvA0Va.js");
1524
1524
  return await syncWorkspaceSources(definition, store, options);
1525
1525
  },
1526
1526
  async materializeSources(options) {
@@ -1575,7 +1575,7 @@ function createWorkspace(definition, options = {}) {
1575
1575
  async startSession(options) {
1576
1576
  const host = options?.host;
1577
1577
  if (host) {
1578
- const { createHostedWorkspaceSession } = await import("./host-BT7EnmZf.js").then((n) => n.n);
1578
+ const { createHostedWorkspaceSession } = await import("./host-CcCDXyJI.js").then((n) => n.n);
1579
1579
  return await createHostedWorkspaceSession(workspace, {
1580
1580
  ...options,
1581
1581
  host
@@ -1591,7 +1591,7 @@ function createWorkspace(definition, options = {}) {
1591
1591
  const synchronizedWorkspace = workspace;
1592
1592
  synchronizedWorkspace.__workspaceDefinitionSyncKey = definition;
1593
1593
  synchronizedWorkspace.__syncWorkspaceDefinition = async (abortSignal) => {
1594
- const { syncWorkspaceDefinition } = await import("./lifecycle-B0ucHUum.js").then((n) => n.t);
1594
+ const { syncWorkspaceDefinition } = await import("./lifecycle-CXiS7Dks.js").then((n) => n.t);
1595
1595
  await syncWorkspaceDefinition(definition, store, abortSignal);
1596
1596
  };
1597
1597
  return attachWorkspaceSourceRequestExecution(workspace, createWorkspaceSourceRequestExecution(definition));
@@ -70,16 +70,11 @@ function objectProperties(object) {
70
70
  value: unwrapExpression(node.value)
71
71
  });
72
72
  }
73
- /** The value of a template literal without substitutions. */
74
73
  function staticTemplate(node) {
75
74
  if (node.expressions.length) return dynamic;
76
75
  return node.quasis[0]?.value.cooked ?? dynamic;
77
76
  }
78
77
  const escapePattern = /\\(u\{[^}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|0\d|[\s\S])/g;
79
- /**
80
- * True when a string literal has an escape that strict mode code rejects. The parser recovers from some bad escapes
81
- * and accepts legacy octal escapes, so the scanner checks them again.
82
- */
83
78
  function hasInvalidEscape(raw) {
84
79
  for (const [, escape = ""] of raw.matchAll(escapePattern)) if (escape.startsWith("u{")) {
85
80
  const code = escape.slice(2, -1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/workspace",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Agent-oriented filesystem state and Vite integration for ViteHub.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -150,8 +150,8 @@
150
150
  "dependencies": {
151
151
  "@valibot/to-json-schema": "^1.8.0",
152
152
  "@vercel/nft": "^1.11.12",
153
- "@vite-hub/runtime": "0.8.0",
154
- "@vite-hub/source": "0.8.0",
153
+ "@vite-hub/runtime": "0.9.0",
154
+ "@vite-hub/source": "0.9.0",
155
155
  "birpc": "^4.2.0",
156
156
  "defu": "^6.1.7",
157
157
  "exsolve": "^1.2.0",
@@ -162,18 +162,18 @@
162
162
  "nostics": "1.4.0",
163
163
  "valibot": "^1.5.0",
164
164
  "yaml": "^2.9.1",
165
- "@vite-hub/markdown-template": "0.8.0",
166
- "@vite-hub/blob": "0.8.0",
167
- "@vite-hub/database": "0.8.0",
168
- "@vite-hub/sandbox": "0.8.0"
165
+ "@vite-hub/markdown-template": "0.9.0",
166
+ "@vite-hub/blob": "0.9.0",
167
+ "@vite-hub/database": "0.9.0",
168
+ "@vite-hub/sandbox": "0.9.0"
169
169
  },
170
170
  "devDependencies": {
171
171
  "@types/node": "^24.19.2",
172
172
  "@vercel/blob": "^2.9.0",
173
- "@vite-hub/env": "0.8.0",
174
- "@vite-hub/forge": "0.8.0",
173
+ "@vite-hub/env": "0.9.0",
174
+ "@vite-hub/forge": "0.9.0",
175
175
  "@vite-hub/internal": "0.0.1",
176
- "@vite-hub/shell": "0.8.0",
176
+ "@vite-hub/shell": "0.9.0",
177
177
  "ai": "7.0.179",
178
178
  "esbuild": "^0.28.2",
179
179
  "publint": "^0.3.25",
@@ -186,11 +186,11 @@
186
186
  "@libsql/client": "^0.18.0"
187
187
  },
188
188
  "peerDependencies": {
189
- "@vite-hub/shell": "0.8.0",
189
+ "@vite-hub/shell": "0.9.0",
190
190
  "ai": "^6.0.0 || ^7.0.0-0",
191
191
  "vite": ">=8.0.0",
192
192
  "drizzle-orm": "1.0.0-rc.5 || 1.0.0-rc.6 || ^1.0.0",
193
- "@vite-hub/forge": "0.8.0"
193
+ "@vite-hub/forge": "0.9.0"
194
194
  },
195
195
  "peerDependenciesMeta": {
196
196
  "@vite-hub/shell": {