@vite-hub/workspace 0.0.4 → 0.1.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.
- package/README.md +225 -58
- package/dist/{ai-CjxvGqM0.d.ts → ai-BW2ZhizI.d.ts} +22 -7
- package/dist/{ai-BqCC8BpY.js → ai-BZyLwULx.js} +147 -66
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/{asset-registry-8QI3ML3K.js → asset-registry-DfBV5kmw.js} +3 -2
- package/dist/association-Cm0dUTDU-CDDhJnIh-Cv3bWnVb.js +19 -0
- package/dist/blob-database.d.ts +521 -0
- package/dist/blob-database.js +601 -0
- package/dist/cloudflare.d.ts +5 -6
- package/dist/cloudflare.js +1 -1
- package/dist/config-B7dmzDX3.js +1112 -0
- package/dist/{config-DE9xlaIw.d.ts → config-DLKdaFWN.d.ts} +1 -2
- package/dist/error-diagnostics-A_8Kp-48.js +116 -0
- package/dist/error-diagnostics-DY5GP47p.js +96 -0
- package/dist/events-7EBoeIPd-A2RUkJi5-BxrICQ17.js +354 -0
- package/dist/events-CRaLy7U3-3PNNp5WZ-Gv9nd0cH.js +214 -0
- package/dist/events-CeChclTf-CX-gD8oy-4aL2j6V-.js +527 -0
- package/dist/feed-DsC7Vws1-M_de2nSK-tKc0Pwo8.js +248 -0
- package/dist/feed-Dyf730Ys-D0HgBba6-BUnCa5gS.js +179 -0
- package/dist/file-C0_aPWSS.js +26 -0
- package/dist/file-metadata-CxDy-E2H.js +58 -0
- package/dist/{files-Q6xZjDHA.js → files-C7Px8uaC.js} +3 -3
- package/dist/forgejo-BN8ItCfl-Bbn4vhDd.js +2278 -0
- package/dist/{github-DHnjxQIX.js → github-CPxHtFB7.js} +16 -23
- package/dist/github-DtncTfmv-Du2S8lGF.js +4159 -0
- package/dist/gitlab-BoDm8-BC-xzZsW9eW.js +2530 -0
- package/dist/glob--XcLlcml.js +22 -0
- package/dist/glob--kNYDbfU.js +30 -0
- package/dist/graphql-DG5aJBT3-DceyFYdM-C4saqX37.js +489 -0
- package/dist/{host-DJH8cuoU.js → host-CFnrTXTK.js} +97 -41
- package/dist/{hosted-RPeJOCFz.js → hosted-acMA5XyL.js} +102 -19
- package/dist/hosted-vercel-blob-DKntsHaf.js +12603 -0
- package/dist/hosted-vercel-blob.d.ts +5 -6
- package/dist/hosted-vercel-blob.js +1 -1
- package/dist/hosted.d.ts +6 -7
- package/dist/hosted.js +1 -1
- package/dist/index.d.ts +57 -36
- package/dist/index.js +56 -56
- package/dist/inspect-BoObD2cJ.js +167 -0
- package/dist/internal/path.d.ts +2 -0
- package/dist/internal/path.js +2 -0
- package/dist/lifecycle-BwZ7c9hb.js +596 -0
- package/dist/loader.d.ts +5 -6
- package/dist/loader.js +3 -2
- package/dist/mcp-resources-BREFCmtn.js +39 -0
- package/dist/memory-BbwOqDXl.js +248 -0
- package/dist/metadata-target-DZEZQGHA.js +1588 -0
- package/dist/mountx.d.ts +4 -6
- package/dist/mountx.js +10 -8
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +1 -1
- package/dist/nuxt.d.ts +13 -12
- package/dist/nuxt.js +4 -8
- package/dist/operations-BcpWr41m.js +159 -0
- package/dist/operations-CGqY1XeG.js +965 -0
- package/dist/operations-DnOwKsJT.d.ts +136 -0
- package/dist/operations.d.ts +53 -0
- package/dist/operations.js +2 -0
- package/dist/path-CNAwN7pw.js +114 -0
- package/dist/path-DrSIenjj.js +59 -0
- package/dist/path-zHxQUbqa.d.ts +9 -0
- package/dist/plugins-DqQ8b4T5.d.ts +10 -0
- package/dist/provider-kXjfli9u.js +1457 -0
- package/dist/providers/github/store.d.ts +3 -5
- package/dist/providers/github/store.js +1 -1
- package/dist/{registry-D3yzt8HQ.js → registry-Bp-8UUfG.js} +9 -7
- package/dist/{registry-Uj6IVxes.d.ts → registry-Cg1TJVVZ.d.ts} +1 -2
- package/dist/{request-execution-B-dSFlGB.js → request-execution-Dk9rY-Yh.js} +19 -19
- package/dist/{chunk-2rV9d50f.js → rolldown-runtime-B4iAMlE-.js} +2 -2
- package/dist/runtime/assets.d.ts +3 -5
- package/dist/runtime/assets.js +7 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -2
- package/dist/runtime/empty-registry.d.ts +1 -2
- package/dist/runtime/state.d.ts +3 -3
- package/dist/runtime/state.js +6 -6
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +51 -17
- package/dist/runtime.js +320 -60
- package/dist/{search-BpiCF2Tw.js → search-CrTmXj5h.js} +10 -9
- package/dist/server-BNQ-Nbjj.js +290 -0
- package/dist/server.d.ts +22 -34
- package/dist/server.js +2 -328
- package/dist/shared-DalXdP0i.js +2158 -0
- package/dist/source-metadata.d.ts +6 -7
- package/dist/source-metadata.js +7 -7
- package/dist/{state-tYcRWEh2.d.ts → state-B8zbLi5t.d.ts} +3 -3
- package/dist/store-CXgmu-uw.js +1729 -0
- package/dist/{sync-DnTQwt8r.js → sync-CN6ec-5M.js} +61 -41
- package/dist/templates-Bn8a-pd2-D9DhJEVD-CBfXNRzz.js +125 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{token-CVzURBxC.js → token-CO62GglH.js} +3 -3
- package/dist/{types-CYuwjJ4V.d.ts → types-DeK9GIxy.d.ts} +256 -24
- package/dist/{use-BTNDR5Rd.js → use-BQj7nSz6.js} +82 -41
- package/dist/{use-BiHzt0xA.d.ts → use-DhwhbAVV.d.ts} +16 -11
- package/dist/utils-Blrh4N2n.js +545 -0
- package/dist/vite-BEvgU2GY.js +20909 -0
- package/dist/vite-CcZmMQ7S.d.ts +476 -0
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +2 -2
- package/dist/webhooks-DgHwxxYz-D1V2LOr1-azofFOiP.js +1565 -0
- package/dist/{workspace-Dq08Yn72.js → workspace-6pxkOuxr.js} +361 -230
- package/dist/{workspace-Xddf4G1B.d.ts → workspace-BWJQBK1u.d.ts} +4 -3
- package/package.json +89 -55
- package/dist/collections/client.d.ts +0 -39
- package/dist/collections/client.js +0 -137
- package/dist/collections.d.ts +0 -59
- package/dist/collections.js +0 -159
- package/dist/config-Bc3c4Su1.js +0 -7904
- package/dist/config-CHLLWklZ.js +0 -36
- package/dist/file-Bc1X7pco.js +0 -23
- package/dist/glob-CEZKeZFC.js +0 -18
- package/dist/hosted-vercel-blob-d6C8ND5j.js +0 -23580
- package/dist/lifecycle-LrL3sA4n.js +0 -316
- package/dist/metadata-target-B0tOmVW7.js +0 -717
- package/dist/path-Cp59koVz.js +0 -139
- package/dist/provider-B1yLjCJJ.js +0 -746
- package/dist/publish.d.ts +0 -35
- package/dist/publish.js +0 -112
- package/dist/runtime-options-BsPSv5O7.js +0 -13
- package/dist/runtime-type-iEE6BjQJ.js +0 -34
- package/dist/shared-DTR1Hhma.js +0 -331
- package/dist/store-Dt_Jyys3.js +0 -608
- package/dist/vite-BptCrpv2.js +0 -4526
- package/dist/vite-CtA9guIM.d.ts +0 -66
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { bn as WorkspaceStore, s as GitHubWorkspaceStoreOptions } from "../../types-DeK9GIxy.js";
|
|
3
2
|
//#region src/providers/github/store.d.ts
|
|
4
|
-
declare function createGitHubWorkspaceStore(options: GitHubWorkspaceStoreOptions, workspaceName: string): WorkspaceStore;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { createGitHubWorkspaceStore };
|
|
3
|
+
export declare function createGitHubWorkspaceStore(options: GitHubWorkspaceStoreOptions, workspaceName: string): WorkspaceStore;
|
|
4
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createGitHubWorkspaceStore } from "../../store-
|
|
1
|
+
import { t as createGitHubWorkspaceStore } from "../../store-CXgmu-uw.js";
|
|
2
2
|
export { createGitHubWorkspaceStore };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as createWorkspace } from "./workspace-
|
|
1
|
+
import { c as workspaceNotFoundError } from "./path-DrSIenjj.js";
|
|
2
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-DY5GP47p.js";
|
|
3
|
+
import { t as createWorkspace } from "./workspace-6pxkOuxr.js";
|
|
4
|
+
import { hasRuntimeType } from "@vite-hub/runtime/internal/runtime-type";
|
|
4
5
|
import runtimeRegistry from "#vitehub-workspace-registry";
|
|
5
6
|
//#region src/core/registry.ts
|
|
6
7
|
const workspaceRegistryStateKey = Symbol.for("vitehub.workspace.registryState");
|
|
@@ -38,7 +39,7 @@ function normalizeWorkspaceDefinition(name, definition) {
|
|
|
38
39
|
if (sources) normalizedWorkspace.sources = sources;
|
|
39
40
|
return normalizedWorkspace;
|
|
40
41
|
}
|
|
41
|
-
if ("name" in definition) throw
|
|
42
|
+
if ("name" in definition) throw workspaceErrorDiagnostics.WORKSPACE_R0021({ message: `[vitehub] Workspace definition "${name}" must not declare a name. Workspace names are inferred from filenames.` });
|
|
42
43
|
return {
|
|
43
44
|
...pickWorkspaceFields(definition),
|
|
44
45
|
name
|
|
@@ -52,7 +53,7 @@ function mergeWorkspaceSources(injected, configured) {
|
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
function registerWorkspace(name, definition) {
|
|
55
|
-
if (!name || !hasRuntimeType(name, "string")) throw
|
|
56
|
+
if (!name || !hasRuntimeType(name, "string")) throw workspaceErrorDiagnostics.WORKSPACE_R0022({ message: "[vitehub] registerWorkspace requires a string name." });
|
|
56
57
|
const registered = normalizeWorkspaceDefinition(name, definition);
|
|
57
58
|
workspaceRegistryState().registeredDefinitions.set(name, registered);
|
|
58
59
|
return registered;
|
|
@@ -120,8 +121,9 @@ async function resolveWorkspaceDefinition(name, abortSignal) {
|
|
|
120
121
|
async function resolveRegisteredWorkspaceDefinition(name, abortSignal) {
|
|
121
122
|
return resolveWorkspaceDefinition(name, abortSignal);
|
|
122
123
|
}
|
|
123
|
-
async function useRegisteredWorkspace(name) {
|
|
124
|
-
|
|
124
|
+
async function useRegisteredWorkspace(name, options = {}) {
|
|
125
|
+
const definition = await resolveWorkspaceDefinition(name);
|
|
126
|
+
return createWorkspace(definition, options);
|
|
125
127
|
}
|
|
126
128
|
//#endregion
|
|
127
129
|
export { useRegisteredWorkspace as a, setWorkspaceRegistry as i, registerWorkspace as n, resolveRegisteredWorkspaceDefinition as r, normalizeWorkspaceDefinition as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { F as WorkspaceDefinition, I as WorkspaceDefinitionInput } from "./types-
|
|
2
|
-
|
|
1
|
+
import { F as WorkspaceDefinition, I as WorkspaceDefinitionInput } from "./types-DeK9GIxy.js";
|
|
3
2
|
//#region src/core/registry.d.ts
|
|
4
3
|
type WorkspaceRegistryModule = {
|
|
5
4
|
default?: WorkspaceDefinitionInput;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as normalizeWorkspaceSources, g as getWorkspaceSourceRequestExecutor, n as createSourceContext, v as workspaceSourceRequestDescriptorPath, y as requestJsonEqual } from "./config-B7dmzDX3.js";
|
|
2
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-DY5GP47p.js";
|
|
2
3
|
//#region src/sources/request-execution.ts
|
|
3
4
|
const sourceRequestExecutions = /* @__PURE__ */ new WeakMap();
|
|
4
5
|
function isWeakKey(value) {
|
|
@@ -17,19 +18,19 @@ function createWorkspaceSourceRequestExecution(definition, options = {}) {
|
|
|
17
18
|
const sources = normalizeWorkspaceSources(definition.sources).filter((source) => source.requestDescriptor && getWorkspaceSourceRequestExecutor(source.source)).filter((source) => sourceRequestVisible(source, options.selectedWorkspaceScope));
|
|
18
19
|
if (!sources.length) return void 0;
|
|
19
20
|
return { async executeSourceRequest(input) {
|
|
20
|
-
const matches = sources.filter((source) =>
|
|
21
|
-
|
|
22
|
-
if (!descriptor || descriptor.method !== input.method) return false;
|
|
23
|
-
return sameRequestTarget(descriptor.url, input.url);
|
|
24
|
-
}).filter((source) => source.requestDescriptor && requestShapeMatches(source.requestDescriptor, input));
|
|
25
|
-
if (matches.length !== 1) throw new Error(matches.length > 1 ? "[vitehub] Source request is ambiguous; more than one visible Source matches this curl target." : "[vitehub] Source request is not visible in the selected workspace scope or does not match a declared Source target.");
|
|
21
|
+
const matches = sources.filter((source) => source.requestDescriptor && workspaceSourceRequestMatches(source.requestDescriptor, input));
|
|
22
|
+
if (matches.length !== 1) throw workspaceErrorDiagnostics.WORKSPACE_R0063({ message: matches.length > 1 ? "[vitehub] Source request is ambiguous; more than one visible Source matches this curl target." : "[vitehub] Source request is not visible in the selected workspace scope or does not match a declared Source target." });
|
|
26
23
|
const source = matches[0];
|
|
27
24
|
const executor = getWorkspaceSourceRequestExecutor(source.source);
|
|
28
|
-
if (!executor) throw
|
|
25
|
+
if (!executor) throw workspaceErrorDiagnostics.WORKSPACE_R0064({ message: "[vitehub] Source request executor is unavailable." });
|
|
26
|
+
const contextOptions = {
|
|
27
|
+
...input.signal ? { abortSignal: input.signal } : {},
|
|
28
|
+
selectedWorkspaceScope: options.selectedWorkspaceScope
|
|
29
|
+
};
|
|
29
30
|
return await executor(input, createSourceContext(definition, {
|
|
30
31
|
key: source.key,
|
|
31
32
|
mountPath: source.mountPath
|
|
32
|
-
}, void 0,
|
|
33
|
+
}, void 0, contextOptions));
|
|
33
34
|
} };
|
|
34
35
|
}
|
|
35
36
|
function sourceRequestVisible(source, scope) {
|
|
@@ -44,6 +45,9 @@ function pathContains(container, path) {
|
|
|
44
45
|
function pathIntersects(left, right) {
|
|
45
46
|
return pathContains(left, right) || pathContains(right, left);
|
|
46
47
|
}
|
|
48
|
+
function workspaceSourceRequestMatches(descriptor, input) {
|
|
49
|
+
return descriptor.method === input.method && sameRequestTarget(descriptor.url, input.url) && requestShapeMatches(descriptor, input);
|
|
50
|
+
}
|
|
47
51
|
function sameRequestTarget(left, right) {
|
|
48
52
|
const leftUrl = new URL(left);
|
|
49
53
|
const rightUrl = new URL(right);
|
|
@@ -52,20 +56,19 @@ function sameRequestTarget(left, right) {
|
|
|
52
56
|
function requestShapeMatches(descriptor, input) {
|
|
53
57
|
const request = descriptor.request;
|
|
54
58
|
if (request?.querySchema) return bodyShapeMatches(request, input);
|
|
55
|
-
if (!
|
|
59
|
+
if (!requestJsonEqual(queryFromUrl(new URL(input.url)) || {}, serializedQuery(request?.query) || {})) return false;
|
|
56
60
|
return bodyShapeMatches(request, input);
|
|
57
61
|
}
|
|
58
62
|
function bodyShapeMatches(request, input) {
|
|
59
63
|
if (request?.bodySchema) return true;
|
|
60
|
-
if (request && "body" in request) return
|
|
64
|
+
if (request && "body" in request) return requestJsonEqual(input.body, request.body);
|
|
61
65
|
return input.body === void 0;
|
|
62
66
|
}
|
|
63
67
|
function queryFromUrl(url) {
|
|
64
|
-
const query = {
|
|
65
|
-
for (const key of new Set(url.searchParams.keys())) {
|
|
68
|
+
const query = Object.fromEntries([...new Set(url.searchParams.keys())].map((key) => {
|
|
66
69
|
const values = url.searchParams.getAll(key);
|
|
67
|
-
|
|
68
|
-
}
|
|
70
|
+
return [key, values.length > 1 ? values : values[0]];
|
|
71
|
+
}));
|
|
69
72
|
return Object.keys(query).length ? query : void 0;
|
|
70
73
|
}
|
|
71
74
|
function serializedQuery(query) {
|
|
@@ -77,8 +80,5 @@ function serializedQuery(query) {
|
|
|
77
80
|
}
|
|
78
81
|
return queryFromUrl(new URL(`https://vitehub.local/?${params}`));
|
|
79
82
|
}
|
|
80
|
-
function jsonEqual(left, right) {
|
|
81
|
-
return JSON.stringify(left) === JSON.stringify(right);
|
|
82
|
-
}
|
|
83
83
|
//#endregion
|
|
84
|
-
export { createWorkspaceSourceRequestExecution as n, getWorkspaceSourceRequestExecution as r, attachWorkspaceSourceRequestExecution as t };
|
|
84
|
+
export { workspaceSourceRequestMatches as i, createWorkspaceSourceRequestExecution as n, getWorkspaceSourceRequestExecution as r, attachWorkspaceSourceRequestExecution as t };
|
|
@@ -26,10 +26,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
}
|
|
27
27
|
return to;
|
|
28
28
|
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
30
30
|
value: mod,
|
|
31
31
|
enumerable: true
|
|
32
32
|
}) : target, mod));
|
|
33
|
-
var __require = /*
|
|
33
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
34
34
|
//#endregion
|
|
35
35
|
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|
package/dist/runtime/assets.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { D as WorkspaceAssets, M as WorkspaceContent } from "../types-
|
|
2
|
-
|
|
1
|
+
import { D as WorkspaceAssets, M as WorkspaceContent } from "../types-DeK9GIxy.js";
|
|
3
2
|
//#region src/runtime/assets.d.ts
|
|
4
3
|
interface WorkspaceAssetFile {
|
|
5
4
|
load: () => Promise<WorkspaceContent>;
|
|
@@ -7,6 +6,5 @@ interface WorkspaceAssetFile {
|
|
|
7
6
|
metadata?: Record<string, unknown>;
|
|
8
7
|
}
|
|
9
8
|
type WorkspaceAssetFiles<TKey extends string = string> = Record<TKey, WorkspaceAssetFile>;
|
|
10
|
-
declare function createWorkspaceAssets<TKey extends string = string>(files: WorkspaceAssetFiles<TKey>): WorkspaceAssets<TKey>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { createWorkspaceAssets };
|
|
9
|
+
export declare function createWorkspaceAssets<TKey extends string = string>(files: WorkspaceAssetFiles<TKey>): WorkspaceAssets<TKey>;
|
|
10
|
+
//#endregion
|
package/dist/runtime/assets.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { i as isWorkspaceError, s as workspaceError, t as normalizeSafeWorkspacePath } from "../path-DrSIenjj.js";
|
|
2
|
+
import { a as isExcludedWorkspacePath, f as sha256, i as decodeFile, l as normalizeWorkspacePath } from "../path-CNAwN7pw.js";
|
|
3
|
+
import { t as createWorkspaceGlobMatcher } from "../glob--kNYDbfU.js";
|
|
4
|
+
import { t as searchText } from "../search-CrTmXj5h.js";
|
|
3
5
|
//#region src/runtime/assets.ts
|
|
4
6
|
function createMissingPathError(path) {
|
|
5
7
|
return workspaceError(`[vitehub] Workspace file does not exist: ${path}.`);
|
|
@@ -112,10 +114,9 @@ function createWorkspaceAssets(files) {
|
|
|
112
114
|
async list(path, options) {
|
|
113
115
|
return await listEntries(path || "", options);
|
|
114
116
|
},
|
|
115
|
-
async glob(pattern,
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
return entries.filter((entry) => entry.type === "file" && patterns.some((item) => matchesAny(entry.path, item)));
|
|
117
|
+
async glob(pattern, options = {}) {
|
|
118
|
+
const { cwd, matches } = createWorkspaceGlobMatcher(pattern, options);
|
|
119
|
+
return (await listEntries(cwd, { recursive: true })).filter((entry) => entry.type === "file" && matches(entry.path));
|
|
119
120
|
},
|
|
120
121
|
async search(query) {
|
|
121
122
|
const result = [];
|
package/dist/runtime/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as useWorkspace, i as ReadonlyWorkspaceFacade, m as WritableWorkspaceFacade, o as UseWorkspaceOptions } from "../use-
|
|
2
|
-
import { n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "../registry-
|
|
3
|
-
import { a as setWorkspaceRuntimeConfig, c as getWorkspaceHostedStoreLoader, d as setActiveCloudflareEnv, i as getWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, r as setWorkspaceRuntimeRegistry, t as invalidateWorkspaceStore, u as resetWorkspaceStoreCache } from "../state-
|
|
1
|
+
import { _ as useWorkspace, i as ReadonlyWorkspaceFacade, m as WritableWorkspaceFacade, o as UseWorkspaceOptions } from "../use-DhwhbAVV.js";
|
|
2
|
+
import { n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "../registry-Cg1TJVVZ.js";
|
|
3
|
+
import { a as setWorkspaceRuntimeConfig, c as getWorkspaceHostedStoreLoader, d as setActiveCloudflareEnv, i as getWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, r as setWorkspaceRuntimeRegistry, t as invalidateWorkspaceStore, u as resetWorkspaceStoreCache } from "../state-B8zbLi5t.js";
|
|
4
4
|
export { type ReadonlyWorkspaceFacade, type UseWorkspaceOptions, type WritableWorkspaceFacade, getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, invalidateWorkspaceStore, registerWorkspace, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, setActiveCloudflareEnv, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeRegistry, useWorkspace };
|
package/dist/runtime/state.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as setWorkspaceRegistry, n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "../registry-
|
|
6
|
-
import { t as useWorkspace } from "../use-
|
|
1
|
+
import { x as setActiveCloudflareEnv } from "../shared-DalXdP0i.js";
|
|
2
|
+
import { d as getWorkspaceRuntimeConfig, f as setWorkspaceRuntimeConfig, l as getWorkspaceHostedStoreLoader, u as setWorkspaceHostedStoreLoader } from "../provider-kXjfli9u.js";
|
|
3
|
+
import { n as invalidateCachedWorkspaceStore, r as resetWorkspaceStoreCache } from "../workspace-6pxkOuxr.js";
|
|
4
|
+
import { t as setWorkspaceAssetsRegistry } from "../asset-registry-DfBV5kmw.js";
|
|
5
|
+
import { i as setWorkspaceRegistry, n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "../registry-Bp-8UUfG.js";
|
|
6
|
+
import { t as useWorkspace } from "../use-BQj7nSz6.js";
|
|
7
7
|
//#region src/runtime/state.ts
|
|
8
8
|
async function invalidateWorkspaceStore(name) {
|
|
9
9
|
invalidateCachedWorkspaceStore(await resolveRegisteredWorkspaceDefinition(name));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createWorkspace } from "../workspace-
|
|
1
|
+
import { t as createWorkspace } from "../workspace-BWJQBK1u.js";
|
|
2
2
|
export { createWorkspace };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createWorkspace } from "../workspace-
|
|
1
|
+
import { t as createWorkspace } from "../workspace-6pxkOuxr.js";
|
|
2
2
|
export { createWorkspace };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { F as WorkspaceDefinition,
|
|
2
|
-
import { _ as useWorkspace, i as ReadonlyWorkspaceFacade, m as WritableWorkspaceFacade, o as UseWorkspaceOptions } from "./use-
|
|
3
|
-
import { n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "./registry-
|
|
4
|
-
import { a as setWorkspaceRuntimeConfig, c as getWorkspaceHostedStoreLoader, i as getWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, o as HostedWorkspaceStoreOptions, r as setWorkspaceRuntimeRegistry, s as WorkspaceHostedStoreLoader, t as invalidateWorkspaceStore, u as resetWorkspaceStoreCache } from "./state-
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { F as WorkspaceDefinition, Gt as WorkspaceSource, Lt as WorkspaceSelectedScope, St as WorkspaceName, T as Workspace, ln as WorkspaceSourceResolutionInvocation, mt as WorkspaceMaterializeSourcesResult, nn as WorkspaceSourceRequestExecutionInput, nt as WorkspaceHistoryReader, rn as WorkspaceSourceRequestExecutionResult, tn as WorkspaceSourceRequestDescriptor, z as WorkspaceEntry } from "./types-DeK9GIxy.js";
|
|
2
|
+
import { _ as useWorkspace, a as ReadonlyWorkspaceFs, g as WritableWorkspaceFs, i as ReadonlyWorkspaceFacade, m as WritableWorkspaceFacade, o as UseWorkspaceOptions } from "./use-DhwhbAVV.js";
|
|
3
|
+
import { n as registerWorkspace, r as resolveRegisteredWorkspaceDefinition } from "./registry-Cg1TJVVZ.js";
|
|
4
|
+
import { a as setWorkspaceRuntimeConfig, c as getWorkspaceHostedStoreLoader, i as getWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, n as setWorkspaceRuntimeAssetsRegistry, o as HostedWorkspaceStoreOptions, r as setWorkspaceRuntimeRegistry, s as WorkspaceHostedStoreLoader, t as invalidateWorkspaceStore, u as resetWorkspaceStoreCache } from "./state-B8zbLi5t.js";
|
|
5
|
+
import { t as registerWorkspacePlugin } from "./plugins-DqQ8b4T5.js";
|
|
6
|
+
import { a as getWorkspaceSourceRequestDescriptor, i as workspaceSourceGrantPaths, n as normalizeWorkspaceSourceMetadata, o as isWorkspaceSourceRequestOnly, r as normalizeWorkspaceSourcesMetadata, s as workspaceSourceRequestDescriptorPath, t as WorkspaceSourceMetadata } from "./config-DLKdaFWN.js";
|
|
7
7
|
//#region src/runtime/dependency-loaders.d.ts
|
|
8
8
|
interface WorkspaceDependencyRuntimeLoaders {
|
|
9
9
|
shellWorkspace: () => Promise<unknown>;
|
|
10
10
|
}
|
|
11
|
-
declare function setWorkspaceDependencyRuntimeLoaders(loaders: Partial<WorkspaceDependencyRuntimeLoaders> | undefined): void;
|
|
12
|
-
declare function getWorkspaceDependencyRuntimeLoaders(): WorkspaceDependencyRuntimeLoaders;
|
|
11
|
+
export declare function setWorkspaceDependencyRuntimeLoaders(loaders: Partial<WorkspaceDependencyRuntimeLoaders> | undefined): void;
|
|
12
|
+
export declare function getWorkspaceDependencyRuntimeLoaders(): WorkspaceDependencyRuntimeLoaders;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/sources/resolution.d.ts
|
|
15
15
|
interface WorkspaceSourceResolutionOptions {
|
|
@@ -21,19 +21,37 @@ interface WorkspaceSourceResolutionFacade<Name extends WorkspaceName = Workspace
|
|
|
21
21
|
definition: WorkspaceDefinition;
|
|
22
22
|
workspace: ReadonlyWorkspaceFacade<Name>;
|
|
23
23
|
}
|
|
24
|
-
declare function hasWorkspaceSourceResolvers(definition: Pick<WorkspaceDefinition, "sources"> | undefined): boolean;
|
|
25
|
-
|
|
26
|
-
declare function
|
|
24
|
+
export declare function hasWorkspaceSourceResolvers(definition: Pick<WorkspaceDefinition, "sources"> | undefined): boolean;
|
|
25
|
+
/** Preserve internal Source Sync routing when wrapping a writable facade. */
|
|
26
|
+
export declare function forwardWorkspaceFacade(source: WritableWorkspaceFacade, target: WritableWorkspaceFacade): void;
|
|
27
|
+
export declare function resolveWorkspaceSources(definition: WorkspaceDefinition, options: WorkspaceSourceResolutionOptions): Promise<WorkspaceDefinition>;
|
|
28
|
+
export declare function createWorkspaceSourceResolutionFacade<Name extends WorkspaceName = WorkspaceName>(workspace: ReadonlyWorkspaceFacade<Name>, definition: WorkspaceDefinition, options: WorkspaceSourceResolutionOptions): Promise<WorkspaceSourceResolutionFacade<Name>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/core/history.d.ts
|
|
31
|
+
/** Forward history only when the caller can inspect the complete folder. */
|
|
32
|
+
export declare function createWorkspaceHistoryReader(history: WorkspaceHistoryReader | undefined, complete: boolean): WorkspaceHistoryReader;
|
|
27
33
|
//#endregion
|
|
28
34
|
//#region src/sources/live.d.ts
|
|
29
|
-
declare function markLiveWorkspaceSource(source: WorkspaceSource, paths: Record<string, string>): WorkspaceSource;
|
|
35
|
+
export declare function markLiveWorkspaceSource(source: WorkspaceSource, paths: Record<string, string>): WorkspaceSource;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/storage/metadata-target.d.ts
|
|
38
|
+
/** An object that can carry a metadata target: a Workspace, a Workspace facade, or the `fs` of a facade. */
|
|
39
|
+
type WorkspaceMetadataCarrier = Workspace | ReadonlyWorkspaceFacade | WritableWorkspaceFacade | ReadonlyWorkspaceFs | WritableWorkspaceFs;
|
|
40
|
+
/**
|
|
41
|
+
* Attaches a read-only metadata view of `source` to `target`.
|
|
42
|
+
* The view has the Workspace name, `getMeta`, `list`, and the Store target. It never has Store writes.
|
|
43
|
+
* `filterEntries` limits the listed entries, for example to an access scope.
|
|
44
|
+
* Internal: `@vite-hub/agent` uses this for its Workspace facades.
|
|
45
|
+
*/
|
|
46
|
+
export declare function forwardWorkspaceMetadataView(source: unknown, target: WorkspaceMetadataCarrier, filterEntries?: (entries: WorkspaceEntry[]) => WorkspaceEntry[]): void;
|
|
30
47
|
//#endregion
|
|
31
48
|
//#region src/sources/request-execution.d.ts
|
|
32
49
|
interface WorkspaceSourceRequestExecutionTarget {
|
|
33
50
|
executeSourceRequest(input: WorkspaceSourceRequestExecutionInput): Promise<WorkspaceSourceRequestExecutionResult>;
|
|
34
51
|
}
|
|
35
|
-
declare function attachWorkspaceSourceRequestExecution<T extends object>(target: T, executor: WorkspaceSourceRequestExecutionTarget | undefined): T;
|
|
36
|
-
declare function getWorkspaceSourceRequestExecution(input: unknown): WorkspaceSourceRequestExecutionTarget | undefined;
|
|
52
|
+
export declare function attachWorkspaceSourceRequestExecution<T extends object>(target: T, executor: WorkspaceSourceRequestExecutionTarget | undefined): T;
|
|
53
|
+
export declare function getWorkspaceSourceRequestExecution(input: unknown): WorkspaceSourceRequestExecutionTarget | undefined;
|
|
54
|
+
export declare function workspaceSourceRequestMatches(descriptor: WorkspaceSourceRequestDescriptor, input: WorkspaceSourceRequestExecutionInput): boolean;
|
|
37
55
|
//#endregion
|
|
38
56
|
//#region src/runtime/preparation.d.ts
|
|
39
57
|
type WorkspacePreparationState = {
|
|
@@ -57,6 +75,8 @@ type WorkspacePreparationState = {
|
|
|
57
75
|
};
|
|
58
76
|
interface WorkspacePreparationOptions<Name extends WorkspaceName = WorkspaceName> {
|
|
59
77
|
onStateChange?: (state: WorkspacePreparationState) => void;
|
|
78
|
+
/** Fail readiness when a selected source contains no files. Empty sources are allowed by default. */
|
|
79
|
+
requireNonEmpty?: boolean;
|
|
60
80
|
retryDelayMs?: number;
|
|
61
81
|
sources?: readonly string[];
|
|
62
82
|
validate?: (result: WorkspaceMaterializeSourcesResult) => void | Promise<void>;
|
|
@@ -64,10 +84,24 @@ interface WorkspacePreparationOptions<Name extends WorkspaceName = WorkspaceName
|
|
|
64
84
|
}
|
|
65
85
|
interface WorkspacePreparation {
|
|
66
86
|
getState(): WorkspacePreparationState;
|
|
67
|
-
response(): Response;
|
|
87
|
+
response(method?: string): Response;
|
|
68
88
|
start(): Promise<WorkspacePreparationState>;
|
|
69
89
|
stop(): Promise<void>;
|
|
70
90
|
}
|
|
71
|
-
declare function createWorkspacePreparation<Name extends WorkspaceName = WorkspaceName>(options: WorkspacePreparationOptions<Name>): WorkspacePreparation;
|
|
91
|
+
export declare function createWorkspacePreparation<Name extends WorkspaceName = WorkspaceName>(options: WorkspacePreparationOptions<Name>): WorkspacePreparation;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/storage/recover-local-locks.d.ts
|
|
94
|
+
/**
|
|
95
|
+
* Remove abandoned markers from a trusted, exclusively owned local store.
|
|
96
|
+
* Stop all store users and prevent changes to the store and its ancestor directories
|
|
97
|
+
* for the entire call. Path checks catch existing symlinks; they do not provide
|
|
98
|
+
* protection against concurrent filesystem mutation.
|
|
99
|
+
*/
|
|
100
|
+
export declare function recoverLocalWorkspaceLocks(options: {
|
|
101
|
+
root: string;
|
|
102
|
+
offline: true;
|
|
103
|
+
}): Promise<{
|
|
104
|
+
removed: number;
|
|
105
|
+
}>;
|
|
72
106
|
//#endregion
|
|
73
|
-
export { type HostedWorkspaceStoreOptions, type ReadonlyWorkspaceFacade, type UseWorkspaceOptions, type WorkspaceDependencyRuntimeLoaders, type WorkspaceHostedStoreLoader, type WorkspacePreparation, type WorkspacePreparationOptions, type WorkspacePreparationState, type WorkspaceSourceMetadata, type WorkspaceSourceResolutionFacade, type WorkspaceSourceResolutionOptions, type WritableWorkspaceFacade,
|
|
107
|
+
export { type HostedWorkspaceStoreOptions, type ReadonlyWorkspaceFacade, type UseWorkspaceOptions, type WorkspaceDependencyRuntimeLoaders, type WorkspaceHostedStoreLoader, type WorkspacePreparation, type WorkspacePreparationOptions, type WorkspacePreparationState, type WorkspaceSourceMetadata, type WorkspaceSourceResolutionFacade, type WorkspaceSourceResolutionOptions, type WritableWorkspaceFacade, getWorkspaceHostedStoreLoader, getWorkspaceRuntimeConfig, getWorkspaceSourceRequestDescriptor, invalidateWorkspaceStore, isWorkspaceSourceRequestOnly, normalizeWorkspaceSourceMetadata, normalizeWorkspaceSourcesMetadata, registerWorkspace, registerWorkspacePlugin, resetWorkspaceStoreCache, resolveRegisteredWorkspaceDefinition, setWorkspaceHostedStoreLoader, setWorkspaceRuntimeAssetsRegistry, setWorkspaceRuntimeConfig, setWorkspaceRuntimeRegistry, useWorkspace, workspaceSourceGrantPaths, workspaceSourceRequestDescriptorPath };
|