@vite-hub/workspace 0.5.0 → 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.
- package/dist/{abort-BCwpdrN0.js → abort-CQGxJBqa.js} +1 -2
- package/dist/{asset-registry-DfBV5kmw.js → asset-registry-0CdRAjIV.js} +2 -3
- package/dist/blob-database/postgres.d.ts +2 -3
- package/dist/blob-database/postgres.js +1 -2
- package/dist/{blob-database-sources-DDZ1wV9w.js → blob-database-sources-CQPAyCz3.js} +1 -2
- package/dist/blob-database.d.ts +2 -8
- package/dist/blob-database.js +12 -15
- package/dist/checkout.d.ts +1 -2
- package/dist/checkout.js +3 -4
- package/dist/cloudflare.d.ts +1 -5
- package/dist/cloudflare.js +1 -2
- package/dist/{config-B-863EgC.js → config-CsgNNVAI.js} +1 -2
- package/dist/{config-hxABr_Gg.d.ts → config-DeA287c0.d.ts} +1 -5
- package/dist/{config-DiyPi3Ff.js → config-jo5QgE1w.js} +18 -27
- package/dist/{discard-CNNtCozM.js → discard-BkoLmmmN.js} +1 -2
- package/dist/durability.d.ts +2 -5
- package/dist/durability.js +4 -5
- package/dist/{error-diagnostics-Cth97txN.js → error-diagnostics-B4me-ouV.js} +1 -2
- package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
- package/dist/{errors-DXCZjdUU.d.ts → errors-CnFDXxeJ.d.ts} +0 -2
- package/dist/{file-C1DYoGz3.js → file-BrNAXQgY.js} +4 -8
- package/dist/{file-metadata-Dv2JZwal.js → file-metadata-Bpsvjw_X.js} +2 -3
- package/dist/{files-iHyik8jj.js → files--z2dLC5z.js} +3 -4
- package/dist/files.d.ts +6 -10
- package/dist/files.js +6 -6
- package/dist/{github-CFHl6RI0.js → github-k--_LCrX.js} +7 -9
- package/dist/{glob-BitxqDhb.js → glob-BEutagp1.js} +3 -4
- package/dist/{glob-Buxfvmyy.js → glob-BreFjNAV.js} +3 -4
- package/dist/{history-schema-BBWbpDk4.d.ts → history-schema-BR4UDPHL.d.ts} +0 -2
- package/dist/{history-schema-postgres-U_ueRvmO.js → history-schema-postgres-DZepCSBq.js} +0 -1
- package/dist/{host-Dmr2Ctem.js → host-C8yZizfk.js} +11 -14
- package/dist/{hosted-BktlvkF2.js → hosted-8BTKAtMX.js} +15 -18
- package/dist/{hosted-vercel-blob-D0IPAjb1.js → hosted-vercel-blob-B6kygYqn.js} +10 -12
- package/dist/hosted-vercel-blob.d.ts +1 -3
- package/dist/hosted-vercel-blob.js +1 -2
- package/dist/hosted.d.ts +1 -3
- package/dist/hosted.js +1 -2
- package/dist/index.d.ts +7 -25
- package/dist/index.js +18 -22
- package/dist/internal/path.d.ts +1 -1
- package/dist/internal/path.js +1 -2
- package/dist/internal/workspace.d.ts +1 -5
- package/dist/internal/workspace.js +2 -3
- package/dist/{lifecycle-D6WN2dd_.js → lifecycle-IReZfi0b.js} +9 -10
- package/dist/lineage.d.ts +1 -3
- package/dist/lineage.js +1 -2
- package/dist/loader.d.ts +1 -7
- package/dist/loader.js +4 -6
- package/dist/{mcp-resources-TtxLNSL6.js → mcp-resources-DeJnbOaw.js} +4 -5
- package/dist/{memory-DjzwSng2.js → memory-BlSRrBH1.js} +7 -9
- package/dist/{metadata-target-CR0aDtvS.js → metadata-target-CaGLY4ay.js} +15 -23
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{operation-definition-CI2PJGqu.d.ts → operation-definition-CqZkx1Rm.d.ts} +0 -4
- package/dist/{operations-dtcU5LkD.js → operations-CtRDU3cA.js} +14 -24
- package/dist/{operations-Cib30_dt.js → operations-DfbqHWAe.js} +7 -8
- package/dist/operations.d.ts +2 -6
- package/dist/operations.js +2 -2
- package/dist/{path-BlIBpI7U.js → path-Bb9OIc_F.js} +2 -3
- package/dist/{path-zHxQUbqa.d.ts → path-C0uZxDdW.d.ts} +0 -2
- package/dist/{path-DrSIenjj.js → path-CuYE8-X6.js} +2 -4
- package/dist/{plugins-DKCBrH31.d.ts → plugins-CLc32jvL.d.ts} +1 -3
- package/dist/{provider-Fc3M6bEx.js → provider-CN14ewvx.js} +15 -20
- package/dist/providers/github/store.d.ts +2 -4
- package/dist/providers/github/store.js +1 -2
- package/dist/{registry-DpB5PBA4.d.ts → registry-B0g19sdy.d.ts} +1 -5
- package/dist/{registry-CedQvQxW.js → registry-BbUg9vJB.js} +4 -5
- package/dist/{registry-CLL0TY0L.d.ts → registry-s2Ob9PeX.d.ts} +2 -4
- package/dist/{request-scope-Bcv2kD8h.js → request-scope-CXCI_wCb.js} +2 -3
- package/dist/{results-DgkZUmTL.js → results-z-HpV9EP.js} +1 -2
- package/dist/{rolldown-runtime-rQ84J-ij.js → rolldown-runtime-DnNXxpGL.js} +2 -3
- package/dist/{rule-keys-Bsz6jTTF.js → rule-keys-BLEbi1h5.js} +2 -3
- package/dist/{rules-OHaPFopX.js → rules-BPDXypZV.js} +6 -8
- package/dist/runtime/assets.d.ts +2 -3
- package/dist/runtime/assets.js +5 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -3
- package/dist/runtime/empty-assets-registry.js +1 -2
- package/dist/runtime/empty-registry.d.ts +2 -4
- package/dist/runtime/empty-registry.js +1 -2
- package/dist/runtime/registry.d.ts +1 -1
- package/dist/runtime/registry.js +2 -3
- package/dist/runtime/request.d.ts +1 -3
- package/dist/runtime/request.js +2 -3
- package/dist/runtime/state.d.ts +5 -5
- package/dist/runtime/state.js +9 -10
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -2
- package/dist/runtime.d.ts +8 -24
- package/dist/runtime.js +21 -24
- package/dist/{search-BqNV9LnO.js → search-C_nVorq7.js} +3 -4
- package/dist/{server-CFtrOPk6.js → server-aa1a4rkV.js} +8 -10
- package/dist/server.d.ts +3 -4
- package/dist/server.js +1 -2
- package/dist/{shared-BgDjxY3J.js → shared-C20Wh1mp.js} +12 -19
- package/dist/source-metadata.d.ts +2 -6
- package/dist/source-metadata.js +4 -5
- package/dist/{state-DBV6VHS6.d.ts → state-BdDfBtOR.d.ts} +5 -15
- package/dist/{store-BRMdD8Ft.js → store-cx3OqNTi.js} +11 -14
- package/dist/{sync-BezGVzrW.js → sync-BBfR4g5y.js} +6 -7
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -2
- package/dist/{types-9DMtFjaa.d.ts → types-Bel5IDmF.d.ts} +0 -2
- package/dist/{use-Dv973swc.d.ts → use-CpphIBof.d.ts} +1 -5
- package/dist/{use-Dm2tbI5F.js → use-D0DyTMxM.js} +12 -14
- package/dist/{use-tools-CMUthOdy.d.ts → use-tools-CAK10LTc.d.ts} +2 -4
- package/dist/{use-tools-C1qvhzme.js → use-tools-CHduR5k6.js} +7 -10
- package/dist/{utils-C0Au2R16.js → utils-DXP9xfXo.js} +7 -9
- package/dist/vite.d.ts +2 -20
- package/dist/vite.js +559 -399
- package/dist/{vitehub-grants-C8IAl5-M.js → vitehub-grants-Co713QTg.js} +2 -4
- package/dist/{workspace-Cw4ycIW-.d.ts → workspace-BOuxrZrP.d.ts} +1 -3
- package/dist/{workspace-CFrwWhEm.js → workspace-CLuPkyZR.js} +26 -35
- package/package.json +24 -24
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as workspaceConflict, n as assertWorkspaceDigest, r as isWorkspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { d as normalizeHistoryPath, f as normalizeHistoryRef, m as rejectHistoryHead, n as createSnapshotFromEntries, p as readHistoryDeleteRef, r as diffSnapshots, u as historyConflict } from "./utils-
|
|
5
|
-
import { t as
|
|
6
|
-
import { a as provideWorkspaceStoreTarget, n as provideWorkspaceRevisionMaterializer } from "./vitehub-grants-
|
|
7
|
-
import { C as githubKVKey, D as writeWorkspaceKV, O as BoundedMap, S as resolveGitHubRootOption, T as readWorkspaceKV, _ as requireGitHubOption, a as gitFileMode, b as resolveGitHubRefsOption, c as githubRequestStatus, d as preloadGitHubFiles, f as readCurrentHead, g as readGitHubFile, i as gitBlobSha, l as joinGitPath, m as readGitHubBranchState, n as commitGitHubChanges, o as githubBranchMovedConflict, p as readGitHubArchive, r as connectGitHubRepository, s as githubRequest, t as assertNoGitHubRepositoryKey, u as loadForge, v as resolveGitHubBranchOption, x as resolveGitHubRepositoryOption, y as resolveGitHubCredential } from "./shared-
|
|
8
|
-
import { t as
|
|
1
|
+
import { a as workspaceConflict, n as assertWorkspaceDigest, r as isWorkspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { t as createWorkspaceGlobMatcher } from "./glob-BreFjNAV.js";
|
|
3
|
+
import { a as isExcludedWorkspacePath, c as normalizeSafeWorkspacePattern, i as decodeFile, l as normalizeWorkspacePath, n as contentStreamToBytes, r as contentToBytes } from "./path-Bb9OIc_F.js";
|
|
4
|
+
import { d as normalizeHistoryPath, f as normalizeHistoryRef, m as rejectHistoryHead, n as createSnapshotFromEntries, p as readHistoryDeleteRef, r as diffSnapshots, u as historyConflict } from "./utils-DXP9xfXo.js";
|
|
5
|
+
import { t as workspaceStoreDiscard } from "./discard-BkoLmmmN.js";
|
|
6
|
+
import { a as provideWorkspaceStoreTarget, n as provideWorkspaceRevisionMaterializer } from "./vitehub-grants-Co713QTg.js";
|
|
7
|
+
import { C as githubKVKey, D as writeWorkspaceKV, O as BoundedMap, S as resolveGitHubRootOption, T as readWorkspaceKV, _ as requireGitHubOption, a as gitFileMode, b as resolveGitHubRefsOption, c as githubRequestStatus, d as preloadGitHubFiles, f as readCurrentHead, g as readGitHubFile, i as gitBlobSha, l as joinGitPath, m as readGitHubBranchState, n as commitGitHubChanges, o as githubBranchMovedConflict, p as readGitHubArchive, r as connectGitHubRepository, s as githubRequest, t as assertNoGitHubRepositoryKey, u as loadForge, v as resolveGitHubBranchOption, x as resolveGitHubRepositoryOption, y as resolveGitHubCredential } from "./shared-C20Wh1mp.js";
|
|
8
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
9
9
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
10
10
|
import { lookup } from "mrmime";
|
|
11
11
|
import { posix } from "node:path";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import * as v from "valibot";
|
|
14
|
-
|
|
14
|
+
// src/providers/github/publish-reservation.ts
|
|
15
15
|
const githubPublishReservationMs = 3e5;
|
|
16
16
|
const zeroOid = "0".repeat(40);
|
|
17
17
|
const leaseSchema = v.object({
|
|
@@ -140,8 +140,7 @@ async function acquireGitHubPublishReservation(repository, options) {
|
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
//#region src/providers/github/history.ts
|
|
143
|
+
// src/providers/github/history.ts
|
|
145
144
|
/**
|
|
146
145
|
* How long `head()` keeps the head that it read for a branch, in milliseconds. A commit through this history replaces
|
|
147
146
|
* the head at once. A commit by another writer shows after this time at most.
|
|
@@ -1265,8 +1264,7 @@ function createGitHubWorkspaceHistory(input) {
|
|
|
1265
1264
|
commit
|
|
1266
1265
|
};
|
|
1267
1266
|
}
|
|
1268
|
-
|
|
1269
|
-
//#region src/providers/github/store.ts
|
|
1267
|
+
// src/providers/github/store.ts
|
|
1270
1268
|
const fileMetadataPrefix = ".vitehub/file-metadata/";
|
|
1271
1269
|
function isFileMetadataPath(path) {
|
|
1272
1270
|
return path.startsWith(fileMetadataPrefix) && path.endsWith(".json");
|
|
@@ -1970,5 +1968,4 @@ function createGitHubWorkspaceStore(options, workspaceName) {
|
|
|
1970
1968
|
assertNoGitHubRepositoryKey(options);
|
|
1971
1969
|
return new GitHubWorkspaceStore(options, workspaceName);
|
|
1972
1970
|
}
|
|
1973
|
-
//#endregion
|
|
1974
1971
|
export { createGitHubWorkspaceStore as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as workspaceError } from "./path-
|
|
2
|
-
import { d as sha256, n as contentStreamToBytes } from "./path-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { s as workspaceError } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { d as sha256, n as contentStreamToBytes } from "./path-Bb9OIc_F.js";
|
|
3
|
+
import { a as normalizeWorkspaceSources, f as prepareWorkspaceSource, n as createSourceContext, s as sourceMountContainsPath } from "./config-jo5QgE1w.js";
|
|
4
|
+
import { C as withWorkspaceStoreMutation, E as normalizeSourceFileMetadata, S as sourceMountOwnsPath, T as normalizeMetadataValue, w as normalizeSourceItemPath, x as createWorkspaceSourceMountAuthority } from "./metadata-target-CaGLY4ay.js";
|
|
5
|
+
import { d as sourceSyncPathClaims, f as workspaceSourceSyncStateEquals, l as readWorkspaceSourceSyncState, u as sourceSyncMetaKey } from "./workspace-CLuPkyZR.js";
|
|
6
|
+
// src/sources/sync.ts
|
|
7
7
|
const sourceSyncLocks = /* @__PURE__ */ new Map();
|
|
8
8
|
const sourceSyncGrants = createWorkspaceSourceMountAuthority("Source Sync");
|
|
9
9
|
function zeroCounts() {
|
|
@@ -286,5 +286,4 @@ async function syncWorkspaceSources(definition, store, options) {
|
|
|
286
286
|
for (const key of lockKeys) if (sourceSyncLocks.get(key) === promise) sourceSyncLocks.delete(key);
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
//#endregion
|
|
290
289
|
export { syncWorkspaceSources };
|
package/dist/test.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as registerWorkspace } from "./registry-
|
|
1
|
+
import { n as registerWorkspace } from "./registry-s2Ob9PeX.js";
|
|
2
2
|
export { registerWorkspace };
|
package/dist/test.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { registerWorkspace };
|
|
1
|
+
export { r as registerWorkspace } from "./registry-BbUg9vJB.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ExecutionAuthority } from "@vite-hub/runtime";
|
|
2
2
|
import { FileSourceOptions, GitHubSourceOptions, GlobSourceOptions, Source, SourceContext, SourceRevision } from "@vite-hub/source";
|
|
3
3
|
import { McpResourcesSourceOptions } from "@vite-hub/source/mcp";
|
|
4
|
-
//#region src/core/types.d.ts
|
|
5
4
|
type WorkspaceContent = string | Uint8Array;
|
|
6
5
|
type WorkspaceContentStream = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
7
6
|
interface ReadFileOptions {
|
|
@@ -1024,5 +1023,4 @@ interface WorkspaceMaterializeSourcesResult {
|
|
|
1024
1023
|
path: string;
|
|
1025
1024
|
sources: WorkspaceSourceMaterializationStatus[];
|
|
1026
1025
|
}
|
|
1027
|
-
//#endregion
|
|
1028
1026
|
export { WorkspaceHistoryDiffOptions as $, WorkspaceSourceDefinition as $t, WorkspaceAuthor as A, WorkspaceStreamFile as An, WorkspaceOptions as At, WorkspaceDiffEntry as B, WorkspaceWriteOperation as Bn, WorkspaceScopeName as Bt, SourceContextWorkspaceFiles as C, WorkspaceSourceSyncResult as Cn, WorkspaceMergeConflict as Ct, WorkspaceAssetPath as D, WorkspaceStoreHistory as Dn, WorkspaceName as Dt, Workspace as E, WorkspaceStore as En, WorkspaceMergeResolution as Et, WorkspaceContentStream as F, WorkspaceWriteCommit as Fn, WorkspaceRetainedHistory as Ft, WorkspaceFileSourceInput as G, WorkspaceSessionHost as Gt, WorkspaceFetchSourceInput as H, WorkspaceWriteValidatorResult as Hn, WorkspaceSearchQuery as Ht, WorkspaceCustomSourceInput as I, WorkspaceWriteErrorHook as In, WorkspaceRevision as It, WorkspaceHistoryChanges as J, WorkspaceSessionOptions as Jt, WorkspaceGitHubSourceInput as K, WorkspaceSessionHostFileEntry as Kt, WorkspaceDefinition as L, WorkspaceWriteHook as Ln, WorkspaceRevisionView as Lt, WorkspaceCacheOptions as M, WorkspaceSyncResultDetails as Mn, WorkspacePrepareSessionProgressEvent as Mt, WorkspaceCapabilities as N, WorkspaceSyncSnapshotOptions as Nn, WorkspacePullRequest as Nt, WorkspaceAssets as O, WorkspaceStoreHistoryCommitOptions as On, WorkspaceNameMap as Ot, WorkspaceContent as P, WorkspaceValidateMode as Pn, WorkspaceRebaseOptions as Pt, WorkspaceHistoryDeleteRefOptions as Q, WorkspaceSourceBindingInput as Qt, WorkspaceDefinitionInput as R, WorkspaceWriteInput as Rn, WorkspaceRule as Rt, SourceContext$1 as S, WorkspaceSourceSyncPolicy as Sn, WorkspaceMergeCommit as St, VercelBlobWorkspaceStoreOptions as T, WorkspaceStat as Tn, WorkspaceMergeOptions as Tt, WorkspaceFetchSourceRequestOptions as U, WriteFileOptions as Un, WorkspaceSelectedScope as Ut, WorkspaceEntry as V, WorkspaceWriteValidator as Vn, WorkspaceSearchHit as Vt, WorkspaceFile as W, WorkspaceSession as Wt, WorkspaceHistoryCommitBase as X, WorkspaceSnapshot as Xt, WorkspaceHistoryChangesCommitOptions as Y, WorkspaceSessionWriteFileOptions as Yt, WorkspaceHistoryCommitOptions as Z, WorkspaceSource as Zt, ReadFileResult as _, WorkspaceSourceResolver as _n, WorkspaceMaterializeMode as _t, GitHubWorkspaceOption as a, WorkspaceSourceMount as an, WorkspaceHistoryListResult as at, RmOptions as b, WorkspaceSourceSyncCounts as bn, WorkspaceMaterializeSourcesResult as bt, GlobOptions as c, WorkspaceSourceRequestExecutionInput as cn, WorkspaceHistoryRefOptions as ct, LocalWorkspaceStoreOptions as d, WorkspaceSourceRequestMethod as dn, WorkspaceInstructionBinding as dt, WorkspaceSourceInput as en, WorkspaceHistoryExtensions as et, Logger as f, WorkspaceSourceResolutionContext as fn, WorkspaceInstructionBindingValue as ft, ReadFileOptions as g, WorkspaceSourceResolutionResult as gn, WorkspaceLookupName as gt, MkdirOptions as h, WorkspaceSourceResolutionInvocation as hn, WorkspaceLoaderSource as ht, ExecResult as i, WorkspaceSourceMaterializationStatus as in, WorkspaceHistoryListOptions as it, WorkspaceAutoCommitPlan as j, WorkspaceSyncOptions as jn, WorkspacePlugin as jt, WorkspaceAssetsRegistry as k, WorkspaceStoreOptions as kn, WorkspaceOpenPullRequestOptions as kt, ListOptions as l, WorkspaceSourceRequestExecutionResult as ln, WorkspaceHookContext as lt, MemoryWorkspaceStoreOptions as m, WorkspaceSourceResolutionContextValueReader as mn, WorkspaceLoader as mt, DiffOptions as n, WorkspaceSourceMaterializationCounts as nn, WorkspaceHistoryFileInput as nt, GitHubWorkspaceRefs as o, WorkspaceSourceMountOptions as on, WorkspaceHistoryReader as ot, MaybePromise as p, WorkspaceSourceResolutionContextMap as pn, WorkspaceLastChange as pt, WorkspaceGlobSourceInput as q, WorkspaceSessionHostFiles as qt, ExecOptions as r, WorkspaceSourceMaterializationPathResult as rn, WorkspaceHistoryFilesCommitOptions as rt, GitHubWorkspaceStoreOptions as s, WorkspaceSourceRequestDescriptor as sn, WorkspaceHistoryRef as st, CloudflareArtifactsWorkspaceStoreOptions as t, WorkspaceSourceItem as tn, WorkspaceHistoryFile as tt, LoaderContext as u, WorkspaceSourceRequestExecutor as un, WorkspaceHooks as ut, ResolvedWorkspaceModuleOptions as v, WorkspaceSourceSelection as vn, WorkspaceMaterializeSourcesOptions as vt, ValidatedWorkspaceName as w, WorkspaceSourceSyncStatus as wn, WorkspaceMergeConflictContext as wt, SnapshotOptions as x, WorkspaceSourceSyncPathResult as xn, WorkspaceMcpResourcesSourceInput as xt, ResolvedWorkspaceRule as y, WorkspaceSourceSyncConfig as yn, WorkspaceMaterializeSourcesProgressEvent as yt, WorkspaceDiff as z, WorkspaceWriteMode as zn, WorkspaceRules as zt };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { $ as WorkspaceHistoryDiffOptions, A as WorkspaceAuthor, Cn as WorkspaceSourceSyncResult, D as WorkspaceAssetPath, Dt as WorkspaceName, E as Workspace, Ft as WorkspaceRetainedHistory, Ht as WorkspaceSearchQuery, It as WorkspaceRevision, Jt as WorkspaceSessionOptions, L as WorkspaceDefinition, Lt as WorkspaceRevisionView, N as WorkspaceCapabilities, O as WorkspaceAssets, P as WorkspaceContent, Pt as WorkspaceRebaseOptions, Q as WorkspaceHistoryDeleteRefOptions, Tn as WorkspaceStat, Un as WriteFileOptions, V as WorkspaceEntry, Vt as WorkspaceSearchHit, Wt as WorkspaceSession, Xt as WorkspaceSnapshot, _ as ReadFileResult, at as WorkspaceHistoryListResult, b as RmOptions, bt as WorkspaceMaterializeSourcesResult, c as GlobOptions, ct as WorkspaceHistoryRefOptions, g as ReadFileOptions, gt as WorkspaceLookupName, h as MkdirOptions, it as WorkspaceHistoryListOptions, jn as WorkspaceSyncOptions, l as ListOptions, n as DiffOptions, ot as WorkspaceHistoryReader, st as WorkspaceHistoryRef, vt as WorkspaceMaterializeSourcesOptions, x as SnapshotOptions, z as WorkspaceDiff } from "./types-
|
|
1
|
+
import { $ as WorkspaceHistoryDiffOptions, A as WorkspaceAuthor, Cn as WorkspaceSourceSyncResult, D as WorkspaceAssetPath, Dt as WorkspaceName, E as Workspace, Ft as WorkspaceRetainedHistory, Ht as WorkspaceSearchQuery, It as WorkspaceRevision, Jt as WorkspaceSessionOptions, L as WorkspaceDefinition, Lt as WorkspaceRevisionView, N as WorkspaceCapabilities, O as WorkspaceAssets, P as WorkspaceContent, Pt as WorkspaceRebaseOptions, Q as WorkspaceHistoryDeleteRefOptions, Tn as WorkspaceStat, Un as WriteFileOptions, V as WorkspaceEntry, Vt as WorkspaceSearchHit, Wt as WorkspaceSession, Xt as WorkspaceSnapshot, _ as ReadFileResult, at as WorkspaceHistoryListResult, b as RmOptions, bt as WorkspaceMaterializeSourcesResult, c as GlobOptions, ct as WorkspaceHistoryRefOptions, g as ReadFileOptions, gt as WorkspaceLookupName, h as MkdirOptions, it as WorkspaceHistoryListOptions, jn as WorkspaceSyncOptions, l as ListOptions, n as DiffOptions, ot as WorkspaceHistoryReader, st as WorkspaceHistoryRef, vt as WorkspaceMaterializeSourcesOptions, x as SnapshotOptions, z as WorkspaceDiff } from "./types-Bel5IDmF.js";
|
|
2
2
|
import { ExecutionBudget } from "@vite-hub/runtime";
|
|
3
3
|
import { Tool, ToolSet } from "ai";
|
|
4
|
-
//#region src/ai.d.ts
|
|
5
4
|
type ShellObservationEvent = "command_finished" | "command_timed_out" | "policy_denied" | "session_disposed";
|
|
6
5
|
interface ShellRuntimeExecOptions {
|
|
7
6
|
budget?: ExecutionBudget;
|
|
@@ -173,8 +172,6 @@ type WorkspaceTools<Operations = undefined, SourceRequests extends boolean = fal
|
|
|
173
172
|
} : {})) & ToolSet;
|
|
174
173
|
type MaybePromise<T> = T | Promise<T>;
|
|
175
174
|
declare function createWorkspaceTools<Operations extends WorkspaceToolOperations | undefined = undefined, SourceRequests extends boolean = false>(input: Workspace | WorkspaceAssets, options?: WorkspaceToolOptions<Operations, SourceRequests>): WorkspaceTools<Operations, SourceRequests>;
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region src/core/use.d.ts
|
|
178
175
|
type WorkspaceWritablePath<Name extends WorkspaceLookupName> = WorkspaceAssetPath<Name> | (string & {});
|
|
179
176
|
interface UseWorkspaceOptions {
|
|
180
177
|
definition?: WorkspaceDefinition;
|
|
@@ -309,5 +306,4 @@ declare function useWorkspaceFiles<Name extends WorkspaceLookupName>(name: Name,
|
|
|
309
306
|
declare function useWorkspaceFiles<Name extends WorkspaceLookupName>(name: Name, options: UseWorkspaceOptions & {
|
|
310
307
|
mode: "write";
|
|
311
308
|
}): WritableWorkspaceFiles<Name>;
|
|
312
|
-
//#endregion
|
|
313
309
|
export { WorkspaceTools as A, ShellEnabled as C, WorkspaceShellResult as D, WorkspaceReadOperations as E, WorkspaceWriteToolMap as M, createWorkspaceTools as N, WorkspaceToolOperations as O, EnabledReadCapability as S, WorkspacePathResult as T, WritableWorkspaceFiles as _, ReadonlyWorkspaceFiles as a, createWorkspaceFileRuntime as b, WorkspaceFacade as c, WorkspaceReadToolSet as d, WorkspaceReadTools as f, WritableWorkspaceFacadeToolOptions as g, WritableWorkspaceFacade as h, ReadonlyWorkspaceFacade as i, WorkspaceWriteOperations as j, WorkspaceToolOptions as k, WorkspaceFacadeToolOptions as l, WorkspaceWriteTools as m, HistoryCheckpoint as n, ReadonlyWorkspaceFs as o, WorkspaceWriteToolSet as p, HistoryCheckpointOptions as r, UseWorkspaceOptions as s, History as t, WorkspaceHistory as u, WritableWorkspaceFs as v, WorkspaceMoveResult as w, useWorkspaceFiles as x, createReadonlyFs as y };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
1
|
+
import { n as useWorkspaceAssets } from "./asset-registry-0CdRAjIV.js";
|
|
2
|
+
import { i as isWorkspaceError, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
3
|
+
import { f as normalizeHistoryRef, g as validateHistoryMessage, h as requireWorkspaceHistory, m as rejectHistoryHead, s as deleteWorkspaceHistoryRef, u as historyConflict } from "./utils-DXP9xfXo.js";
|
|
4
|
+
import { a as provideWorkspaceStoreTarget, i as forwardWorkspaceStoreTarget, o as resolveWorkspaceStoreTarget } from "./vitehub-grants-Co713QTg.js";
|
|
5
|
+
import { c as normalizeSafeWorkspacePattern, d as sha256 } from "./path-Bb9OIc_F.js";
|
|
6
|
+
import { s as useRegisteredWorkspace } from "./registry-BbUg9vJB.js";
|
|
7
|
+
import { g as getWorkspaceSourceRequestExecution, i as assertPublicWorkspaceMetaKey, m as attachWorkspaceSourceRequestExecution, t as createWorkspace } from "./workspace-CLuPkyZR.js";
|
|
8
|
+
import { c as workspaceInternalMetadataCapability, o as resolveWorkspaceMetadataTarget, r as forwardWorkspaceMetadataTarget, t as attachWorkspaceMetadataTarget } from "./metadata-target-CaGLY4ay.js";
|
|
9
|
+
import { t as createHostedWorkspaceSession } from "./host-C8yZizfk.js";
|
|
10
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
11
11
|
import { getViteHubErrorShape } from "@vite-hub/runtime";
|
|
12
12
|
import { posix } from "node:path";
|
|
13
|
-
|
|
13
|
+
// src/fs-ops.ts
|
|
14
14
|
async function ensureMissingOrReplaceable(workspace, path, overwrite = false) {
|
|
15
15
|
if (!await workspace.exists(path)) return;
|
|
16
16
|
if (!overwrite) throw workspaceError(`[vitehub] Workspace path already exists: ${path}.`);
|
|
@@ -49,8 +49,7 @@ async function appendWorkspaceFile(workspace, path, content) {
|
|
|
49
49
|
}
|
|
50
50
|
await workspace.writeFile(path, `${current}${content}`);
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
//#region src/core/use.ts
|
|
52
|
+
// src/core/use.ts
|
|
54
53
|
const workspaceDefinitionSyncStates = /* @__PURE__ */ new WeakMap();
|
|
55
54
|
async function workspaceDefinitionSyncState(workspace) {
|
|
56
55
|
const owner = await resolveWorkspaceMetadataTarget(workspace) ?? workspace;
|
|
@@ -480,5 +479,4 @@ function createWorkspaceFileRuntime(name, options) {
|
|
|
480
479
|
function useWorkspaceFiles(name, options) {
|
|
481
480
|
return createWorkspaceFileRuntime(name, options).facade;
|
|
482
481
|
}
|
|
483
|
-
//#endregion
|
|
484
482
|
export { copyWorkspacePath as a, appendWorkspaceFile as i, createWorkspaceFileRuntime as n, useWorkspaceFiles as r, createReadonlyFs as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/core/use-tools.d.ts
|
|
1
|
+
import { h as WritableWorkspaceFacade, i as ReadonlyWorkspaceFacade, s as UseWorkspaceOptions } from "./use-CpphIBof.js";
|
|
2
|
+
import { gt as WorkspaceLookupName } from "./types-Bel5IDmF.js";
|
|
4
3
|
declare function useWorkspace<Name extends WorkspaceLookupName>(name: Name): ReadonlyWorkspaceFacade<Name>;
|
|
5
4
|
declare function useWorkspace<Name extends WorkspaceLookupName>(name: Name, options: UseWorkspaceOptions & {
|
|
6
5
|
mode?: "read";
|
|
@@ -8,5 +7,4 @@ declare function useWorkspace<Name extends WorkspaceLookupName>(name: Name, opti
|
|
|
8
7
|
declare function useWorkspace<Name extends WorkspaceLookupName>(name: Name, options: UseWorkspaceOptions & {
|
|
9
8
|
mode: "write";
|
|
10
9
|
}): WritableWorkspaceFacade<Name>;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { useWorkspace as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-
|
|
2
|
-
import { t as
|
|
3
|
-
import { g as getWorkspaceSourceRequestExecution } from "./workspace-
|
|
4
|
-
import {
|
|
1
|
+
import { s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { a as copyWorkspacePath, i as appendWorkspaceFile, n as createWorkspaceFileRuntime, t as createReadonlyFs } from "./use-D0DyTMxM.js";
|
|
3
|
+
import { g as getWorkspaceSourceRequestExecution } from "./workspace-CLuPkyZR.js";
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
5
5
|
import { executionBudgetCharged, executionBudgetOverride, markExecutionBudgetHandled } from "@vite-hub/runtime/internal/execution-budget";
|
|
6
|
-
|
|
6
|
+
// src/runtime/dependency-loaders.ts
|
|
7
7
|
const shellWorkspaceSpecifier = "@vite-hub/shell/workspace";
|
|
8
8
|
const defaultWorkspaceDependencyRuntimeLoaders = { shellWorkspace: () => import(
|
|
9
9
|
/* @vite-ignore */
|
|
@@ -38,8 +38,7 @@ function isMissingWorkspaceShellError(error) {
|
|
|
38
38
|
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND") return false;
|
|
39
39
|
return error.message.includes("Cannot find package '@vite-hub/shell'") || error.message.includes("Cannot find module '@vite-hub/shell'") || error.message.includes("Cannot find module '@vite-hub/shell/workspace'") || error.message.includes("tried to access @vite-hub/shell") && (error.message.includes("isn't declared") || error.message.includes("isn't provided"));
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
//#region src/ai.ts
|
|
41
|
+
// src/ai.ts
|
|
43
42
|
const defaultMaxOutputLength = 3e4;
|
|
44
43
|
const workspaceMountPoint = "/workspace";
|
|
45
44
|
const aiSchemaSymbol = Symbol.for("vercel.ai.schema");
|
|
@@ -519,8 +518,7 @@ function createWorkspaceTools(input, options = {}) {
|
|
|
519
518
|
}
|
|
520
519
|
return result;
|
|
521
520
|
}
|
|
522
|
-
|
|
523
|
-
//#region src/core/use-tools.ts
|
|
521
|
+
// src/core/use-tools.ts
|
|
524
522
|
function toReadOperations(options) {
|
|
525
523
|
return {
|
|
526
524
|
list: options?.list,
|
|
@@ -589,5 +587,4 @@ function useWorkspace(name, options) {
|
|
|
589
587
|
tools.none = emptyTools;
|
|
590
588
|
return Object.assign(runtime.facade, { tools });
|
|
591
589
|
}
|
|
592
|
-
//#endregion
|
|
593
590
|
export { setWorkspaceDependencyRuntimeLoaders as i, createWorkspaceTools as n, getWorkspaceDependencyRuntimeLoaders as r, useWorkspace as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as workspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-
|
|
2
|
-
import { n as copyJsonWorkspaceMetadata, t as copyJsonFileMetadata } from "./file-metadata-
|
|
3
|
-
import { d as sha256, o as isWorkspaceBytes, r as contentToBytes } from "./path-
|
|
4
|
-
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-
|
|
5
|
-
import { t as createWorkspaceWritePolicy } from "./rules-
|
|
1
|
+
import { a as workspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
2
|
+
import { n as copyJsonWorkspaceMetadata, t as copyJsonFileMetadata } from "./file-metadata-Bpsvjw_X.js";
|
|
3
|
+
import { d as sha256, o as isWorkspaceBytes, r as contentToBytes } from "./path-Bb9OIc_F.js";
|
|
4
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
5
|
+
import { t as createWorkspaceWritePolicy } from "./rules-BPDXypZV.js";
|
|
6
6
|
import { lookup } from "mrmime";
|
|
7
7
|
import { isRuntimeObject } from "@vite-hub/runtime/internal/runtime-type";
|
|
8
|
-
|
|
8
|
+
// src/core/history.ts
|
|
9
9
|
/** The ref used when a history call omits `ref`. A Store's working tree follows this ref. */
|
|
10
10
|
const defaultWorkspaceHistoryRef = "main";
|
|
11
11
|
const historyRefPattern = /^[\w-]+(?:[./][\w-]+)*$/;
|
|
@@ -359,8 +359,7 @@ function createWorkspaceHistory(definition, store, files) {
|
|
|
359
359
|
commit
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
|
|
363
|
-
//#region src/storage/utils.ts
|
|
362
|
+
// src/storage/utils.ts
|
|
364
363
|
const snapshotStatConcurrency = 16;
|
|
365
364
|
async function mapWithConcurrency(values, concurrency, visit) {
|
|
366
365
|
const results = [];
|
|
@@ -427,5 +426,4 @@ function diffSnapshots(from, to) {
|
|
|
427
426
|
entries
|
|
428
427
|
};
|
|
429
428
|
}
|
|
430
|
-
//#endregion
|
|
431
429
|
export { createWorkspaceHistoryReader as a, forwardWorkspaceHistoryFiles as c, normalizeHistoryPath as d, normalizeHistoryRef as f, validateHistoryMessage as g, requireWorkspaceHistory as h, createWorkspaceHistory as i, forwardWorkspaceHistoryMerge as l, rejectHistoryHead as m, createSnapshotFromEntries as n, defaultWorkspaceHistoryRef as o, readHistoryDeleteRef as p, diffSnapshots as r, deleteWorkspaceHistoryRef as s, createCurrentSnapshotFromStore as t, historyConflict as u };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { At as WorkspaceOptions } from "./types-
|
|
2
|
-
import { n as OperationContributionEntry } from "./operation-definition-
|
|
1
|
+
import { At as WorkspaceOptions } from "./types-Bel5IDmF.js";
|
|
2
|
+
import { n as OperationContributionEntry } from "./operation-definition-CqZkx1Rm.js";
|
|
3
3
|
import { EnvironmentOptions, Plugin } from "vite";
|
|
4
|
-
//#region ../internal/src/build/vite.d.ts
|
|
5
4
|
type NitroPackageLoadingOptions = {
|
|
6
5
|
devServer?: {
|
|
7
6
|
runner?: string;
|
|
@@ -23,8 +22,6 @@ declare function createNativePackageLoading(ssrPackageEntries?: readonly string[
|
|
|
23
22
|
}, options?: EnvironmentOptions): boolean;
|
|
24
23
|
load(id: string, environmentName: string | undefined): string | undefined;
|
|
25
24
|
};
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region ../internal/src/durability.d.ts
|
|
28
25
|
/**
|
|
29
26
|
* One durability reporter that a primitive's Vite plugin contributes through `vitehub.durability`. The Node server
|
|
30
27
|
* imports `export` from `module` at boot and calls it with `input` and the server environment. It returns the
|
|
@@ -47,8 +44,6 @@ interface DurabilityPluginMetadata {
|
|
|
47
44
|
/** Called after Vite resolves the config. Return an empty list when the primitive is off. */
|
|
48
45
|
durability?: () => readonly DurabilityContribution[];
|
|
49
46
|
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region ../internal/src/inspect.d.ts
|
|
52
47
|
interface ViteHubDefinitionField {
|
|
53
48
|
label: string;
|
|
54
49
|
value: string;
|
|
@@ -110,8 +105,6 @@ type ViteHubInspectionContributorFactory = () => ViteHubInspectionContributor |
|
|
|
110
105
|
interface ViteHubInspectionPluginMetadata {
|
|
111
106
|
inspect?: ViteHubInspectionContributor | ViteHubInspectionContributorFactory;
|
|
112
107
|
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/hosts/vite/plugin.d.ts
|
|
115
108
|
interface WorkspaceNitroConfigOptions {
|
|
116
109
|
aliases?: Record<string, string>;
|
|
117
110
|
command?: "build" | "serve";
|
|
@@ -160,8 +153,6 @@ type WorkspaceVitePlugin = Plugin & WorkspaceCliContributingPlugin & {
|
|
|
160
153
|
api: WorkspaceVitePluginAPI;
|
|
161
154
|
};
|
|
162
155
|
export declare function hubWorkspace(options?: WorkspaceOptions | false): WorkspaceVitePlugin;
|
|
163
|
-
//#endregion
|
|
164
|
-
//#region ../internal/src/contributions.d.ts
|
|
165
156
|
/** Module and export that hold a contributed Definition. */
|
|
166
157
|
interface ContributionDefinition {
|
|
167
158
|
/**
|
|
@@ -216,8 +207,6 @@ interface CollectedContribution {
|
|
|
216
207
|
/** Name of the contributing Vite plugin. */
|
|
217
208
|
plugin: string;
|
|
218
209
|
}
|
|
219
|
-
//#endregion
|
|
220
|
-
//#region src/build/contributions.d.ts
|
|
221
210
|
/**
|
|
222
211
|
* A Workspace Definition that another package registers from its Vite plugin. The Workspace plugin adds it to the
|
|
223
212
|
* generated registry next to the discovered files, so `useWorkspace(name)`, typegen, inspection, and the Console
|
|
@@ -242,8 +231,6 @@ type CollectedWorkspaceContribution = CollectedContribution;
|
|
|
242
231
|
* contributions with one name fail with `WORKSPACE_B0003`.
|
|
243
232
|
*/
|
|
244
233
|
export declare function collectWorkspaceContributions(plugins: readonly unknown[] | undefined, context: WorkspaceContributionContext): Promise<CollectedWorkspaceContribution[]>;
|
|
245
|
-
//#endregion
|
|
246
|
-
//#region src/build/discovery.d.ts
|
|
247
234
|
interface DiscoveredWorkspaceDefinition {
|
|
248
235
|
/** Plugin that contributed the definition. Only set for contributed definitions. */
|
|
249
236
|
contributor?: string;
|
|
@@ -265,8 +252,6 @@ interface ViteWorkspaceDiscoveryOptions {
|
|
|
265
252
|
serverRootDir?: string;
|
|
266
253
|
}
|
|
267
254
|
export declare function discoverViteWorkspaceDefinitions(rootDir: string, options?: ViteWorkspaceDiscoveryOptions): DiscoveredWorkspaceDefinition[];
|
|
268
|
-
//#endregion
|
|
269
|
-
//#region ../internal/src/console.d.ts
|
|
270
255
|
type MaybePromise<T> = T | Promise<T>;
|
|
271
256
|
/** Lists discovered Definitions in a sidebar and shows the selected Definition's fields. */
|
|
272
257
|
interface ViteHubConsoleDefinitionCatalogView {
|
|
@@ -598,8 +583,6 @@ interface ViteHubConsoleDocumentSetup {
|
|
|
598
583
|
*/
|
|
599
584
|
schedule?: ViteHubConsoleDocumentHint;
|
|
600
585
|
}
|
|
601
|
-
//#endregion
|
|
602
|
-
//#region src/inspect.d.ts
|
|
603
586
|
interface WorkspaceInspectionOptions {
|
|
604
587
|
/** Vite plugins that can contribute Workspace Definitions through `vitehub.workspaces`. */
|
|
605
588
|
plugins?: readonly unknown[];
|
|
@@ -612,5 +595,4 @@ interface WorkspaceInspectionOptions {
|
|
|
612
595
|
export declare function inspectWorkspaceDefinitions(options: WorkspaceInspectionOptions): Promise<ViteHubDefinitionSummary[]>;
|
|
613
596
|
/** Console section that lists discovered Workspace Definitions. `vitehub inspect definitions` reads the same data. */
|
|
614
597
|
export declare const workspaceConsoleSection: ViteHubConsoleSectionContribution<WorkspaceInspectionOptions>;
|
|
615
|
-
//#endregion
|
|
616
598
|
export type { CollectedWorkspaceContribution, DiscoveredWorkspaceDefinition, NitroConfig, ViteWorkspaceDiscoveryOptions, WorkspaceContributingPlugin, WorkspaceContribution, WorkspaceContributionContext, WorkspaceContributionFactory, WorkspaceInspectionOptions, WorkspaceNitroConfigOptions, WorkspaceVitePlugin, WorkspaceVitePluginAPI };
|