@vite-hub/workspace 0.0.2 → 0.0.3
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 +35 -0
- package/dist/{ai-Cztw4eLk.js → ai-Ce3PtWFW.js} +14 -3
- package/dist/{ai-hFdsvDHC.d.ts → ai-nmHdzjCM.d.ts} +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/cloudflare.d.ts +4 -2
- package/dist/cloudflare.js +1 -2
- package/dist/collections.d.ts +2 -2
- package/dist/collections.js +1 -1
- package/dist/{config-Ca5DM8fF.d.ts → config-3I1BnsdO.d.ts} +1 -1
- package/dist/{config-DCQ6y30R.js → config-CDoyls2X.js} +1 -1
- package/dist/{config--r5unwPc.js → config-CZLO0m9h.js} +3 -3
- package/dist/{file-B2q9NE18.js → file-CHfsZpso.js} +7 -8
- package/dist/{files-xy0le-_U.js → files-QRV55OCx.js} +1 -1
- package/dist/{github-lIO6-2sH.js → github-CfA5vpJ5.js} +5 -10
- package/dist/{glob-DeH0dzZX.js → glob-D0vD_wRY.js} +6 -12
- package/dist/{host-I-_vDs05.js → host-CAnbugpI.js} +2 -2
- package/dist/{artifacts-store-BAV9jZpd.js → hosted-C1-tTTTf.js} +29 -3
- package/dist/{providers/vercel/blob-store.js → hosted-vercel-blob-CWBILDVo.js} +26 -4
- package/dist/hosted-vercel-blob.d.ts +1 -1
- package/dist/hosted-vercel-blob.js +1 -25
- package/dist/hosted.d.ts +1 -1
- package/dist/hosted.js +1 -29
- package/dist/index.d.ts +27 -35
- package/dist/index.js +18 -25
- package/dist/{lifecycle-Lhk3dAMt.js → lifecycle-BYoa9hVb.js} +3 -3
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +1 -1
- package/dist/mountx.d.ts +10 -0
- package/dist/mountx.js +143 -0
- package/dist/nitro.js +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/{provider-CeQciesl.js → provider-C3_elpEh.js} +1 -1
- package/dist/providers/github/store.d.ts +1 -1
- package/dist/providers/github/store.js +1 -361
- package/dist/publish.d.ts +1 -1
- package/dist/publish.js +1 -1
- package/dist/{registry-CoC9JxVt.d.ts → registry-BIQVCBWI.d.ts} +1 -1
- package/dist/{registry-C7DMdBXN.js → registry-CqyDTW9Y.js} +1 -1
- package/dist/{request-execution-C8qRcReq.js → request-execution-u9mgUXKX.js} +1 -1
- package/dist/runtime/assets.d.ts +1 -1
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +1 -1
- package/dist/runtime/state.d.ts +3 -3
- package/dist/runtime/state.js +5 -5
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime-options-BsPSv5O7.js +13 -0
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +11 -28
- package/dist/server.d.ts +2 -2
- package/dist/server.js +3 -3
- package/dist/{shared-BRycRSbo.js → shared-jfogBrd5.js} +20 -2
- package/dist/source-metadata.d.ts +1 -1
- package/dist/source-metadata.js +1 -1
- package/dist/{state-DSAHEsq6.d.ts → state-TTqa3x3Y.d.ts} +2 -2
- package/dist/store-Bs1SLh55.js +414 -0
- package/dist/{sync-DO42ypji.js → sync-DiuDmSGk.js} +3 -3
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{types-DHkae7Cb.d.ts → types-60Yn149G.d.ts} +1 -17
- package/dist/{use-D16tf8Ph.d.ts → use-CUFSnFCS.d.ts} +2 -2
- package/dist/{use-d_PlAdOu.js → use-CsV3oIxH.js} +6 -23
- package/dist/{vite-NWC9mFjI.js → vite-tbfDxtlu.js} +332 -23
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +1 -1
- package/dist/{workspace-f2DBLmPZ.d.ts → workspace-66SKyiec.d.ts} +1 -1
- package/dist/{workspace-n4wBmdaM.js → workspace-C4k92Ow8.js} +8 -24
- package/package.json +13 -28
- package/dist/cli.d.ts +0 -31
- package/dist/cli.js +0 -303
- package/dist/cloudflare-env-CKxUs2fa.js +0 -20
- package/dist/providers/cloudflare/artifacts-store.d.ts +0 -6
- package/dist/providers/cloudflare/artifacts-store.js +0 -2
- package/dist/providers/vercel/blob-store.d.ts +0 -6
- package/dist/utils-BPdaCyI6.js +0 -55
package/README.md
CHANGED
|
@@ -152,6 +152,41 @@ Workspace definitions are runtime-free. To run generated code, open a [`@vite-hu
|
|
|
152
152
|
|
|
153
153
|
Use `startSession({ attach: true, host })` only when another integration already owns the live materialized tree. Attached Sessions preserve that baseline without rematerializing the tree and roll back only their own uncommitted changes on close.
|
|
154
154
|
|
|
155
|
+
## MountX projection
|
|
156
|
+
|
|
157
|
+
Use the `@vite-hub/workspace/mountx` integration when an Agent, editor, CLI, or VM needs a real filesystem instead of Workspace methods. The adapter keeps Workspace Session diff and commit semantics in ViteHub while MountX owns the host transport.
|
|
158
|
+
|
|
159
|
+
Install MountX directly before importing its transport entry points:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pnpm add mountx@0.0.2
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
import { createWorkspaceDriver } from "@vite-hub/workspace/mountx"
|
|
167
|
+
import { mount } from "mountx/auto"
|
|
168
|
+
|
|
169
|
+
const session = await workspace.startSession()
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
const mounted = await mount(createWorkspaceDriver(session), "/tmp/vitehub-docs")
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
// Programs can now use /tmp/vitehub-docs as an ordinary directory.
|
|
176
|
+
}
|
|
177
|
+
finally {
|
|
178
|
+
await mounted.unmount()
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
await session.commit({ message: "accept projected changes" })
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
await session.close()
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The same driver works with MountX's 9P and NFSv4.1 servers for Linux guests, or its S3 gateway for S3-compatible clients. Use `{ readOnly: true }` when the consumer only needs inspection. The adapter uses MountX's unstorage driver, so it does not project or persist empty directories, and filenames cannot contain `:`, `?`, or end in `$`. Renames use copy then delete and are not atomic. Executable Git files retain their execute bits; Git symlinks are rejected because the unstorage driver cannot preserve symlink semantics. MountX is still alpha and unaudited, so keep network transports loopback-only unless the surrounding sandbox or network is the explicit security boundary.
|
|
189
|
+
|
|
155
190
|
Harness-backed Agents use the Workspace Package to prepare Harness Workspace Sessions for `defineAgent({ driver: { harness }, workspace })`. The Agent Package keeps the harness inside the Agent Driver boundary, Capabilities keep tools and Skills opt-in, and Workspace owns materializing the selected Workspace Scope plus write-mode sync back through Workspace rules.
|
|
156
191
|
|
|
157
192
|
## Vite Integration
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as isWorkspaceError, o as normalizeSafeWorkspacePath, p as workspaceError } from "./path-CNI6wKIU.js";
|
|
2
|
-
import { r as getWorkspaceSourceRequestExecution } from "./request-execution-
|
|
2
|
+
import { r as getWorkspaceSourceRequestExecution } from "./request-execution-u9mgUXKX.js";
|
|
3
3
|
import { posix } from "node:path";
|
|
4
4
|
//#region src/fs-ops.ts
|
|
5
5
|
async function ensureMissingOrReplaceable(workspace, path, overwrite = false) {
|
|
@@ -60,8 +60,19 @@ function setWorkspaceDependencyRuntimeLoaders(loaders) {
|
|
|
60
60
|
function getWorkspaceDependencyRuntimeLoaders() {
|
|
61
61
|
return workspaceDependencyRuntimeLoadersGlobal()[workspaceDependencyRuntimeLoadersKey()] ?? defaultWorkspaceDependencyRuntimeLoaders;
|
|
62
62
|
}
|
|
63
|
-
function loadWorkspaceShellModule() {
|
|
64
|
-
|
|
63
|
+
async function loadWorkspaceShellModule() {
|
|
64
|
+
try {
|
|
65
|
+
return await getWorkspaceDependencyRuntimeLoaders().shellWorkspace();
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (isMissingWorkspaceShellError(error)) throw workspaceError("[vitehub] Install @vite-hub/shell to use Workspace Tools shell commands.", { cause: error });
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function isMissingWorkspaceShellError(error) {
|
|
72
|
+
if (!(error instanceof Error)) return false;
|
|
73
|
+
const code = error.code;
|
|
74
|
+
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND") return false;
|
|
75
|
+
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"));
|
|
65
76
|
}
|
|
66
77
|
//#endregion
|
|
67
78
|
//#region src/ai.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as WorkspaceAssets, T as Workspace, et as WorkspaceMaterializeSourcesResult } from "./types-
|
|
1
|
+
import { D as WorkspaceAssets, T as Workspace, et as WorkspaceMaterializeSourcesResult } from "./types-60Yn149G.js";
|
|
2
2
|
import { Tool, ToolSet } from "ai";
|
|
3
3
|
|
|
4
4
|
//#region src/ai.d.ts
|
package/dist/ai.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { et as WorkspaceMaterializeSourcesResult } from "./types-
|
|
2
|
-
import { a as WorkspaceReadOperations, c as WorkspaceToolOptions, d as WorkspaceWriteToolMap, f as createWorkspaceTools, i as WorkspacePathResult, l as WorkspaceTools, n as ShellEnabled, o as WorkspaceShellResult, r as WorkspaceMoveResult, s as WorkspaceToolOperations, t as EnabledReadCapability, u as WorkspaceWriteOperations } from "./ai-
|
|
1
|
+
import { et as WorkspaceMaterializeSourcesResult } from "./types-60Yn149G.js";
|
|
2
|
+
import { a as WorkspaceReadOperations, c as WorkspaceToolOptions, d as WorkspaceWriteToolMap, f as createWorkspaceTools, i as WorkspacePathResult, l as WorkspaceTools, n as ShellEnabled, o as WorkspaceShellResult, r as WorkspaceMoveResult, s as WorkspaceToolOperations, t as EnabledReadCapability, u as WorkspaceWriteOperations } from "./ai-nmHdzjCM.js";
|
|
3
3
|
export { EnabledReadCapability, ShellEnabled, type WorkspaceMaterializeSourcesResult, WorkspaceMoveResult, WorkspacePathResult, WorkspaceReadOperations, WorkspaceShellResult, WorkspaceToolOperations, WorkspaceToolOptions, WorkspaceTools, WorkspaceWriteOperations, WorkspaceWriteToolMap, createWorkspaceTools };
|
package/dist/ai.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createWorkspaceTools } from "./ai-
|
|
1
|
+
import { t as createWorkspaceTools } from "./ai-Ce3PtWFW.js";
|
|
2
2
|
export { createWorkspaceTools };
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { o as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions } from "./types-
|
|
1
|
+
import { Jt as WorkspaceStore, o as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions } from "./types-60Yn149G.js";
|
|
2
2
|
import { configureHostedWorkspaceRuntime } from "./hosted.js";
|
|
3
|
-
import { createCloudflareArtifactsWorkspaceStore } from "./providers/cloudflare/artifacts-store.js";
|
|
4
3
|
|
|
4
|
+
//#region src/providers/cloudflare/artifacts-store.d.ts
|
|
5
|
+
declare function createCloudflareArtifactsWorkspaceStore(options: CloudflareArtifactsWorkspaceStoreOptions, workspaceName: string): WorkspaceStore;
|
|
6
|
+
//#endregion
|
|
5
7
|
//#region src/cloudflare.d.ts
|
|
6
8
|
type CloudflareWorkspaceRuntimeStoreOptions = Partial<CloudflareArtifactsWorkspaceStoreOptions> | (Partial<GitHubWorkspaceStoreOptions> & {
|
|
7
9
|
provider: "github";
|
package/dist/cloudflare.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { configureHostedWorkspaceRuntime } from "./hosted.js";
|
|
1
|
+
import { r as createCloudflareArtifactsWorkspaceStore, t as configureHostedWorkspaceRuntime } from "./hosted-C1-tTTTf.js";
|
|
3
2
|
export { configureHostedWorkspaceRuntime as configureCloudflareWorkspaceRuntime, createCloudflareArtifactsWorkspaceStore };
|
package/dist/collections.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ReadonlyWorkspaceFacade } from "./use-
|
|
1
|
+
import { rt as WorkspaceName } from "./types-60Yn149G.js";
|
|
2
|
+
import { t as ReadonlyWorkspaceFacade } from "./use-CUFSnFCS.js";
|
|
3
3
|
|
|
4
4
|
//#region src/collections.d.ts
|
|
5
5
|
interface WorkspaceCollectionEmptyFilter {
|
package/dist/collections.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as WorkspaceCacheOptions,
|
|
1
|
+
import { A as WorkspaceCacheOptions, P as WorkspaceDefinition, Wt as WorkspaceSourceSyncPolicy, Z as WorkspaceMaterializeMode, en as WorkspaceValidateMode, kt as WorkspaceSourceRequestDescriptor, wt as WorkspaceSourceInput, xt as WorkspaceSource } from "./types-60Yn149G.js";
|
|
2
2
|
|
|
3
3
|
//#region src/sources/request-metadata.d.ts
|
|
4
4
|
declare function getWorkspaceSourceRequestDescriptor(source: WorkspaceSource): WorkspaceSourceRequestDescriptor | undefined;
|
|
@@ -7688,9 +7688,9 @@ function createInferredWorkspaceSource(family, input) {
|
|
|
7688
7688
|
async function loadInferredWorkspaceSource(family, input) {
|
|
7689
7689
|
if (family === "fetch" && isPlainRecord(input)) return createInferredFetchSource(input);
|
|
7690
7690
|
if (family === "fetch") return createInferredFetchSource(input);
|
|
7691
|
-
if (family === "file") return (await import("./file-
|
|
7692
|
-
if (family === "github") return (await import("./github-
|
|
7693
|
-
if (family === "glob") return (await import("./glob-
|
|
7691
|
+
if (family === "file") return (await import("./file-CHfsZpso.js").then((n) => n.n)).file(input);
|
|
7692
|
+
if (family === "github") return (await import("./github-CfA5vpJ5.js").then((n) => n.n)).github(input);
|
|
7693
|
+
if (family === "glob") return (await import("./glob-D0vD_wRY.js").then((n) => n.n)).glob(input);
|
|
7694
7694
|
return await loadMcpResourcesSource(input);
|
|
7695
7695
|
}
|
|
7696
7696
|
function inferredSourceDefaults(family, input) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-8H4AJuhK.js";
|
|
2
2
|
import { o as normalizeSafeWorkspacePath } from "./path-CNI6wKIU.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as withWorkspaceRuntimeOptions } from "./runtime-options-BsPSv5O7.js";
|
|
4
|
+
import { file } from "@vite-hub/source";
|
|
4
5
|
//#region src/sources/file.ts
|
|
5
6
|
var file_exports = /* @__PURE__ */ __exportAll({ file: () => file$1 });
|
|
6
7
|
function file$1(input) {
|
|
@@ -11,13 +12,11 @@ function file$1(input) {
|
|
|
11
12
|
path: ""
|
|
12
13
|
} : options.mount ?? "";
|
|
13
14
|
return {
|
|
14
|
-
...file(options),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
probeKeys: options.probeKeys || [key]
|
|
19
|
-
sync: options.sync,
|
|
20
|
-
validate: options.validate
|
|
15
|
+
...withWorkspaceRuntimeOptions(file(options), {
|
|
16
|
+
...options,
|
|
17
|
+
mount
|
|
18
|
+
}),
|
|
19
|
+
probeKeys: options.probeKeys || [key]
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
22
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as matchesAny, c as normalizeWorkspacePath } from "./path-CNI6wKIU.js";
|
|
2
|
-
import { n as createSourceContext } from "./config
|
|
2
|
+
import { n as createSourceContext } from "./config-CZLO0m9h.js";
|
|
3
3
|
//#region src/loaders/files.ts
|
|
4
4
|
function shouldLoad(path, options) {
|
|
5
5
|
if (options.include && !matchesAny(path, options.include)) return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-8H4AJuhK.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { github } from "@vite-hub/source
|
|
2
|
+
import { g as getActiveCloudflareBinding, h as resolveGitHubTokenOption, s as processEnv } from "./shared-jfogBrd5.js";
|
|
3
|
+
import { t as withWorkspaceRuntimeOptions } from "./runtime-options-BsPSv5O7.js";
|
|
4
|
+
import { github } from "@vite-hub/source";
|
|
5
5
|
//#region src/env.ts
|
|
6
6
|
let viteLoadEnv;
|
|
7
7
|
async function resolveWorkspaceEnv(rootDir, name) {
|
|
@@ -52,9 +52,8 @@ function github$1(input) {
|
|
|
52
52
|
sourceByRootAndToken.set(cacheKey, source);
|
|
53
53
|
return source;
|
|
54
54
|
}
|
|
55
|
-
return {
|
|
55
|
+
return withWorkspaceRuntimeOptions({
|
|
56
56
|
...baseSource,
|
|
57
|
-
cache: resolvedOptions.cache,
|
|
58
57
|
fingerprint: {
|
|
59
58
|
exclude: resolvedOptions.exclude,
|
|
60
59
|
include: resolvedOptions.include,
|
|
@@ -62,10 +61,6 @@ function github$1(input) {
|
|
|
62
61
|
repo: resolvedOptions.repo,
|
|
63
62
|
root: resolvedOptions.root
|
|
64
63
|
},
|
|
65
|
-
materialize: resolvedOptions.materialize,
|
|
66
|
-
mount: resolvedOptions.mount,
|
|
67
|
-
sync: resolvedOptions.sync,
|
|
68
|
-
validate: resolvedOptions.validate,
|
|
69
64
|
async prepare(ctx) {
|
|
70
65
|
await (await getSourceForRoot(ctx.rootDir)).prepare?.(ctx);
|
|
71
66
|
},
|
|
@@ -85,7 +80,7 @@ function github$1(input) {
|
|
|
85
80
|
async search(query, ctx) {
|
|
86
81
|
return await (await getSourceForRoot(ctx.rootDir)).search?.(query, ctx) ?? [];
|
|
87
82
|
}
|
|
88
|
-
};
|
|
83
|
+
}, resolvedOptions);
|
|
89
84
|
}
|
|
90
85
|
function resolvableGitHubSource(resolve) {
|
|
91
86
|
return {
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-8H4AJuhK.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as withWorkspaceRuntimeOptions } from "./runtime-options-BsPSv5O7.js";
|
|
3
|
+
import { glob } from "@vite-hub/source";
|
|
3
4
|
//#region src/sources/glob.ts
|
|
4
5
|
var glob_exports = /* @__PURE__ */ __exportAll({ glob: () => glob$1 });
|
|
5
6
|
function glob$1(options) {
|
|
6
|
-
return {
|
|
7
|
-
...
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}),
|
|
11
|
-
cache: options.cache,
|
|
12
|
-
materialize: options.materialize,
|
|
13
|
-
mount: options.mount,
|
|
14
|
-
sync: options.sync,
|
|
15
|
-
validate: options.validate
|
|
16
|
-
};
|
|
7
|
+
return withWorkspaceRuntimeOptions(glob({
|
|
8
|
+
...options,
|
|
9
|
+
keyCache: options.keyCache ?? !isLazySource(options)
|
|
10
|
+
}), options);
|
|
17
11
|
}
|
|
18
12
|
function isLazySource(options) {
|
|
19
13
|
if (options.materialize === "lazy") return true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as normalizeWorkspacePath, d as sha256, i as decodeFile, o as normalizeSafeWorkspacePath, p as workspaceError, r as contentToBytes } from "./path-CNI6wKIU.js";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as scopedSearchQuery, f as assertDiffInsideSessionPaths, g as isMissingWorkspacePathError, h as filterSessionEntries, m as filterSessionDiff, p as assertPathInSessionScope } from "./workspace-
|
|
2
|
+
import { i as diffSnapshots, r as createSnapshotFromEntries } from "./store-Bs1SLh55.js";
|
|
3
|
+
import { _ as scopedSearchQuery, f as assertDiffInsideSessionPaths, g as isMissingWorkspacePathError, h as filterSessionEntries, m as filterSessionDiff, p as assertPathInSessionScope } from "./workspace-C4k92Ow8.js";
|
|
4
4
|
import { posix } from "node:path";
|
|
5
5
|
import { normalizeExecutionAuthority } from "@vite-hub/runtime";
|
|
6
6
|
//#region src/session/host.ts
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { a as matchesAny, c as normalizeWorkspacePath, d as sha256, o as normalizeSafeWorkspacePath, p as workspaceError, r as contentToBytes, s as normalizeSafeWorkspacePattern } from "./path-CNI6wKIU.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
2
|
+
import { c as getWorkspaceHostedStoreLoader, d as setWorkspaceRuntimeConfig, i as resolveGitHubWorkspaceStore, l as setWorkspaceHostedStoreLoader, r as resolveCloudflareArtifactsStore } from "./provider-C3_elpEh.js";
|
|
3
|
+
import { i as diffSnapshots, r as createSnapshotFromEntries, t as createGitHubWorkspaceStore } from "./store-Bs1SLh55.js";
|
|
4
|
+
import { g as getActiveCloudflareBinding } from "./shared-jfogBrd5.js";
|
|
5
|
+
import { resolve } from "node:path";
|
|
4
6
|
//#region src/storage/memory-fs.ts
|
|
5
7
|
var MemoryStats = class {
|
|
6
8
|
entry;
|
|
@@ -552,4 +554,28 @@ function createCloudflareArtifactsWorkspaceStore(options, workspaceName) {
|
|
|
552
554
|
return new CloudflareArtifactsWorkspaceStore(options, workspaceName);
|
|
553
555
|
}
|
|
554
556
|
//#endregion
|
|
555
|
-
|
|
557
|
+
//#region src/hosted.ts
|
|
558
|
+
function installHostedWorkspaceRuntime() {
|
|
559
|
+
const existingWorkspaceHostedStoreLoader = getWorkspaceHostedStoreLoader();
|
|
560
|
+
setWorkspaceHostedStoreLoader((storeOptions, workspaceName) => {
|
|
561
|
+
if (storeOptions.provider === "cloudflare-artifacts") return createCloudflareArtifactsWorkspaceStore(storeOptions, workspaceName);
|
|
562
|
+
if (storeOptions.provider === "github") return createGitHubWorkspaceStore(storeOptions, workspaceName);
|
|
563
|
+
if (existingWorkspaceHostedStoreLoader) return existingWorkspaceHostedStoreLoader(storeOptions, workspaceName);
|
|
564
|
+
throw workspaceError("[vitehub] Hosted workspace runtime cannot load unsupported hosted store.");
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
function configureHostedWorkspaceRuntime(options = {}) {
|
|
568
|
+
const root = resolve(process.cwd(), options.root || ".vitehub/workspaces");
|
|
569
|
+
const store = options.store?.provider === "github" ? resolveGitHubWorkspaceStore(options.store, options.env, { runtime: true }) : options.store?.provider === "vercel-blob" ? void 0 : resolveCloudflareArtifactsStore(options.store, options.env);
|
|
570
|
+
if (!store) throw workspaceError("[vitehub] Vercel Blob hosted workspace runtime must use @vite-hub/workspace/internal/runtime/hosted-vercel-blob.");
|
|
571
|
+
const config = {
|
|
572
|
+
assets: options.assets,
|
|
573
|
+
root,
|
|
574
|
+
store
|
|
575
|
+
};
|
|
576
|
+
installHostedWorkspaceRuntime();
|
|
577
|
+
setWorkspaceRuntimeConfig(config);
|
|
578
|
+
return config;
|
|
579
|
+
}
|
|
580
|
+
//#endregion
|
|
581
|
+
export { installHostedWorkspaceRuntime as n, createCloudflareArtifactsWorkspaceStore as r, configureHostedWorkspaceRuntime as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as matchesAny, c as normalizeWorkspacePath, d as sha256, o as normalizeSafeWorkspacePath, p as workspaceError, r as contentToBytes, s as normalizeSafeWorkspacePattern } from "
|
|
2
|
-
import { a as resolveRuntimeVercelBlobWorkspaceStore } from "
|
|
3
|
-
import {
|
|
1
|
+
import { a as matchesAny, c as normalizeWorkspacePath, d as sha256, o as normalizeSafeWorkspacePath, p as workspaceError, r as contentToBytes, s as normalizeSafeWorkspacePattern } from "./path-CNI6wKIU.js";
|
|
2
|
+
import { a as resolveRuntimeVercelBlobWorkspaceStore, c as getWorkspaceHostedStoreLoader, d as setWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, o as resolveVercelBlobWorkspaceStore } from "./provider-C3_elpEh.js";
|
|
3
|
+
import { i as diffSnapshots, r as createSnapshotFromEntries } from "./store-Bs1SLh55.js";
|
|
4
|
+
import { resolve } from "node:path";
|
|
4
5
|
//#region src/providers/vercel/blob-store.ts
|
|
5
6
|
function joinBlobPath(...parts) {
|
|
6
7
|
return parts.map((part) => normalizeWorkspacePath(part)).filter(Boolean).join("/");
|
|
@@ -232,4 +233,25 @@ function createVercelBlobWorkspaceStore(options, workspaceName) {
|
|
|
232
233
|
return new VercelBlobWorkspaceStore(options, workspaceName);
|
|
233
234
|
}
|
|
234
235
|
//#endregion
|
|
235
|
-
|
|
236
|
+
//#region src/hosted-vercel-blob.ts
|
|
237
|
+
function installHostedVercelBlobWorkspaceRuntime() {
|
|
238
|
+
const existingWorkspaceHostedStoreLoader = getWorkspaceHostedStoreLoader();
|
|
239
|
+
setWorkspaceHostedStoreLoader((storeOptions, workspaceName) => {
|
|
240
|
+
if (storeOptions.provider === "vercel-blob") return createVercelBlobWorkspaceStore(storeOptions, workspaceName);
|
|
241
|
+
if (existingWorkspaceHostedStoreLoader) return existingWorkspaceHostedStoreLoader(storeOptions, workspaceName);
|
|
242
|
+
throw workspaceError("[vitehub] Vercel Blob hosted workspace runtime cannot load unsupported hosted store.");
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function configureHostedVercelBlobWorkspaceRuntime(options = {}) {
|
|
246
|
+
const root = resolve(process.cwd(), options.root || ".vitehub/workspaces");
|
|
247
|
+
const config = {
|
|
248
|
+
assets: options.assets,
|
|
249
|
+
root,
|
|
250
|
+
store: resolveVercelBlobWorkspaceStore(options.store, options.env)
|
|
251
|
+
};
|
|
252
|
+
installHostedVercelBlobWorkspaceRuntime();
|
|
253
|
+
setWorkspaceRuntimeConfig(config);
|
|
254
|
+
return config;
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
export { installHostedVercelBlobWorkspaceRuntime as n, configureHostedVercelBlobWorkspaceRuntime as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as ResolvedWorkspaceModuleOptions, w as VercelBlobWorkspaceStoreOptions } from "./types-
|
|
1
|
+
import { v as ResolvedWorkspaceModuleOptions, w as VercelBlobWorkspaceStoreOptions } from "./types-60Yn149G.js";
|
|
2
2
|
|
|
3
3
|
//#region src/hosted-vercel-blob.d.ts
|
|
4
4
|
interface HostedVercelBlobWorkspaceRuntimeOptions {
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getWorkspaceHostedStoreLoader, d as setWorkspaceRuntimeConfig, l as setWorkspaceHostedStoreLoader, o as resolveVercelBlobWorkspaceStore } from "./provider-CeQciesl.js";
|
|
3
|
-
import { createVercelBlobWorkspaceStore } from "./providers/vercel/blob-store.js";
|
|
4
|
-
import { resolve } from "node:path";
|
|
5
|
-
//#region src/hosted-vercel-blob.ts
|
|
6
|
-
function installHostedVercelBlobWorkspaceRuntime() {
|
|
7
|
-
const existingWorkspaceHostedStoreLoader = getWorkspaceHostedStoreLoader();
|
|
8
|
-
setWorkspaceHostedStoreLoader((storeOptions, workspaceName) => {
|
|
9
|
-
if (storeOptions.provider === "vercel-blob") return createVercelBlobWorkspaceStore(storeOptions, workspaceName);
|
|
10
|
-
if (existingWorkspaceHostedStoreLoader) return existingWorkspaceHostedStoreLoader(storeOptions, workspaceName);
|
|
11
|
-
throw workspaceError("[vitehub] Vercel Blob hosted workspace runtime cannot load unsupported hosted store.");
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
function configureHostedVercelBlobWorkspaceRuntime(options = {}) {
|
|
15
|
-
const root = resolve(process.cwd(), options.root || ".vitehub/workspaces");
|
|
16
|
-
const config = {
|
|
17
|
-
assets: options.assets,
|
|
18
|
-
root,
|
|
19
|
-
store: resolveVercelBlobWorkspaceStore(options.store, options.env)
|
|
20
|
-
};
|
|
21
|
-
installHostedVercelBlobWorkspaceRuntime();
|
|
22
|
-
setWorkspaceRuntimeConfig(config);
|
|
23
|
-
return config;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
1
|
+
import { n as installHostedVercelBlobWorkspaceRuntime, t as configureHostedVercelBlobWorkspaceRuntime } from "./hosted-vercel-blob-CWBILDVo.js";
|
|
26
2
|
export { configureHostedVercelBlobWorkspaceRuntime, installHostedVercelBlobWorkspaceRuntime };
|
package/dist/hosted.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions, w as VercelBlobWorkspaceStoreOptions } from "./types-
|
|
1
|
+
import { o as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions, w as VercelBlobWorkspaceStoreOptions } from "./types-60Yn149G.js";
|
|
2
2
|
|
|
3
3
|
//#region src/hosted.d.ts
|
|
4
4
|
type HostedWorkspaceRuntimeStoreOptions = Partial<CloudflareArtifactsWorkspaceStoreOptions> | (Partial<GitHubWorkspaceStoreOptions> & {
|
package/dist/hosted.js
CHANGED
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getWorkspaceHostedStoreLoader, d as setWorkspaceRuntimeConfig, i as resolveGitHubWorkspaceStore, l as setWorkspaceHostedStoreLoader, r as resolveCloudflareArtifactsStore } from "./provider-CeQciesl.js";
|
|
3
|
-
import { createGitHubWorkspaceStore } from "./providers/github/store.js";
|
|
4
|
-
import { t as createCloudflareArtifactsWorkspaceStore } from "./artifacts-store-BAV9jZpd.js";
|
|
5
|
-
import { resolve } from "node:path";
|
|
6
|
-
//#region src/hosted.ts
|
|
7
|
-
function installHostedWorkspaceRuntime() {
|
|
8
|
-
const existingWorkspaceHostedStoreLoader = getWorkspaceHostedStoreLoader();
|
|
9
|
-
setWorkspaceHostedStoreLoader((storeOptions, workspaceName) => {
|
|
10
|
-
if (storeOptions.provider === "cloudflare-artifacts") return createCloudflareArtifactsWorkspaceStore(storeOptions, workspaceName);
|
|
11
|
-
if (storeOptions.provider === "github") return createGitHubWorkspaceStore(storeOptions, workspaceName);
|
|
12
|
-
if (existingWorkspaceHostedStoreLoader) return existingWorkspaceHostedStoreLoader(storeOptions, workspaceName);
|
|
13
|
-
throw workspaceError("[vitehub] Hosted workspace runtime cannot load unsupported hosted store.");
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function configureHostedWorkspaceRuntime(options = {}) {
|
|
17
|
-
const root = resolve(process.cwd(), options.root || ".vitehub/workspaces");
|
|
18
|
-
const store = options.store?.provider === "github" ? resolveGitHubWorkspaceStore(options.store, options.env, { runtime: true }) : options.store?.provider === "vercel-blob" ? void 0 : resolveCloudflareArtifactsStore(options.store, options.env);
|
|
19
|
-
if (!store) throw workspaceError("[vitehub] Vercel Blob hosted workspace runtime must use @vite-hub/workspace/internal/runtime/hosted-vercel-blob.");
|
|
20
|
-
const config = {
|
|
21
|
-
assets: options.assets,
|
|
22
|
-
root,
|
|
23
|
-
store
|
|
24
|
-
};
|
|
25
|
-
installHostedWorkspaceRuntime();
|
|
26
|
-
setWorkspaceRuntimeConfig(config);
|
|
27
|
-
return config;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
1
|
+
import { n as installHostedWorkspaceRuntime, t as configureHostedWorkspaceRuntime } from "./hosted-C1-tTTTf.js";
|
|
30
2
|
export { configureHostedWorkspaceRuntime, installHostedWorkspaceRuntime };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { $ as WorkspaceMaterializeSourcesProgressEvent, $t as
|
|
2
|
-
import { a as WorkspaceReadOperations, c as WorkspaceToolOptions, d as WorkspaceWriteToolMap, f as createWorkspaceTools, i as WorkspacePathResult, l as WorkspaceTools, n as ShellEnabled, o as WorkspaceShellResult, r as WorkspaceMoveResult, s as WorkspaceToolOperations, t as EnabledReadCapability, u as WorkspaceWriteOperations } from "./ai-
|
|
3
|
-
import { a as WorkspaceFacadeToolOptions, c as WorkspaceWriteToolSet, d as WritableWorkspaceFacadeToolOptions, f as WritableWorkspaceFs, i as WorkspaceFacade, l as WorkspaceWriteTools, n as ReadonlyWorkspaceFs, o as WorkspaceReadToolSet, p as useWorkspace, r as UseWorkspaceOptions, s as WorkspaceReadTools, t as ReadonlyWorkspaceFacade, u as WritableWorkspaceFacade } from "./use-
|
|
4
|
-
import { t as createWorkspace } from "./workspace-
|
|
5
|
-
import { r as resolveRegisteredWorkspaceDefinition } from "./registry-
|
|
1
|
+
import { $ as WorkspaceMaterializeSourcesProgressEvent, $t as WorkspaceSyncSnapshotOptions, A as WorkspaceCacheOptions, At as WorkspaceSourceRequestExecutionInput, B as WorkspaceFetchSourceRequestOptions, Bt as WorkspaceSourceSelection, C as SourceContextWorkspaceFiles, Ct as WorkspaceSourceDefinition, D as WorkspaceAssets, Dt as WorkspaceSourceMount, E as WorkspaceAssetPath, Et as WorkspaceSourceMaterializationStatus, F as WorkspaceDefinitionInput, Ft as WorkspaceSourceResolutionContextMap, G as WorkspaceHookContext, Gt as WorkspaceSourceSyncResult, H as WorkspaceFileSourceInput, Ht as WorkspaceSourceSyncCounts, I as WorkspaceDiff, It as WorkspaceSourceResolutionContextValueReader, J as WorkspaceInstructionBindingValue, Jt as WorkspaceStore, K as WorkspaceHooks, Kt as WorkspaceSourceSyncStatus, L as WorkspaceDiffEntry, Lt as WorkspaceSourceResolutionInvocation, M as WorkspaceContentStream, Mt as WorkspaceSourceRequestExecutor, N as WorkspaceCustomSourceInput, Nt as WorkspaceSourceRequestMethod, O as WorkspaceAssetsRegistry, Ot as WorkspaceSourceMountOptions, P as WorkspaceDefinition, Pt as WorkspaceSourceResolutionContext, Q as WorkspaceMaterializeSourcesOptions, Qt as WorkspaceSyncResultDetails, R as WorkspaceEntry, Rt as WorkspaceSourceResolutionResult, S as SourceContext, St as WorkspaceSourceBindingInput, T as Workspace, Tt as WorkspaceSourceItem, U as WorkspaceGitHubSourceInput, Ut as WorkspaceSourceSyncPathResult, V as WorkspaceFile, Vt as WorkspaceSourceSyncConfig, W as WorkspaceGlobSourceInput, Wt as WorkspaceSourceSyncPolicy, X as WorkspaceLoaderSource, Xt as WorkspaceStreamFile, Y as WorkspaceLoader, Yt as WorkspaceStoreOptions, Z as WorkspaceMaterializeMode, Zt as WorkspaceSyncOptions, _ as ReadFileResult, _t as WorkspaceSessionHostFileEntry, a as GitHubWorkspaceOption, an as WorkspaceWriteOperation, at as WorkspacePlugin, b as RmOptions, bt as WorkspaceSnapshot, c as ListOptions, cn as WriteFileOptions, ct as WorkspacePublisher, d as Logger, dt as WorkspaceScopeName, en as WorkspaceValidateMode, et as WorkspaceMaterializeSourcesResult, f as MaybePromise, ft as WorkspaceSearchHit, g as ReadFileOptions, gt as WorkspaceSessionHost, h as PublishContext, ht as WorkspaceSession, i as ExecResult, in as WorkspaceWriteMode, it as WorkspaceNameMap, j as WorkspaceContent, jt as WorkspaceSourceRequestExecutionResult, k as WorkspaceAutoCommitPlan, kt as WorkspaceSourceRequestDescriptor, l as LoaderContext, lt as WorkspaceRule, m as MkdirOptions, mt as WorkspaceSelectedScope, n as DiffOptions, nn as WorkspaceWriteHook, nt as WorkspaceModuleOptions, o as GitHubWorkspaceStoreOptions, on as WorkspaceWriteValidator, ot as WorkspacePrepareSessionProgressEvent, p as MemoryWorkspaceStoreOptions, pt as WorkspaceSearchQuery, q as WorkspaceInstructionBinding, qt as WorkspaceStat, r as ExecOptions, rn as WorkspaceWriteInput, rt as WorkspaceName, s as GlobOptions, sn as WorkspaceWriteValidatorResult, st as WorkspacePublishOptions, t as CloudflareArtifactsWorkspaceStoreOptions, tn as WorkspaceWriteErrorHook, tt as WorkspaceMcpResourcesSourceInput, u as LocalWorkspaceStoreOptions, ut as WorkspaceRules, v as ResolvedWorkspaceModuleOptions, vt as WorkspaceSessionHostFiles, w as VercelBlobWorkspaceStoreOptions, wt as WorkspaceSourceInput, x as SnapshotOptions, xt as WorkspaceSource, y as ResolvedWorkspaceRule, yt as WorkspaceSessionOptions, z as WorkspaceFetchSourceInput, zt as WorkspaceSourceResolver } from "./types-60Yn149G.js";
|
|
2
|
+
import { a as WorkspaceReadOperations, c as WorkspaceToolOptions, d as WorkspaceWriteToolMap, f as createWorkspaceTools, i as WorkspacePathResult, l as WorkspaceTools, n as ShellEnabled, o as WorkspaceShellResult, r as WorkspaceMoveResult, s as WorkspaceToolOperations, t as EnabledReadCapability, u as WorkspaceWriteOperations } from "./ai-nmHdzjCM.js";
|
|
3
|
+
import { a as WorkspaceFacadeToolOptions, c as WorkspaceWriteToolSet, d as WritableWorkspaceFacadeToolOptions, f as WritableWorkspaceFs, i as WorkspaceFacade, l as WorkspaceWriteTools, n as ReadonlyWorkspaceFs, o as WorkspaceReadToolSet, p as useWorkspace, r as UseWorkspaceOptions, s as WorkspaceReadTools, t as ReadonlyWorkspaceFacade, u as WritableWorkspaceFacade } from "./use-CUFSnFCS.js";
|
|
4
|
+
import { t as createWorkspace } from "./workspace-66SKyiec.js";
|
|
5
|
+
import { r as resolveRegisteredWorkspaceDefinition } from "./registry-BIQVCBWI.js";
|
|
6
6
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
7
|
-
import { FileSourceOptions as FileSourceOptions$1 } from "@vite-hub/source
|
|
8
|
-
import { GitHubSourceOptions as GitHubSourceOptions$1 } from "@vite-hub/source/sources/github";
|
|
9
|
-
import { GlobSourceOptions as GlobSourceOptions$1 } from "@vite-hub/source/sources/glob";
|
|
10
|
-
import { McpResourceContent, McpResourceDescriptor, McpResourcesClient, McpResourcesClientConfig, McpResourcesRequestOptions, McpResourcesServer, McpResourcesSourceOptions as McpResourcesSourceOptions$1 } from "@vite-hub/source/sources/mcp-resources";
|
|
7
|
+
import { FileSourceOptions as FileSourceOptions$1, GitHubSourceOptions as GitHubSourceOptions$1, GlobSourceOptions as GlobSourceOptions$1, McpResourceContent, McpResourceDescriptor, McpResourcesClient, McpResourcesClientConfig, McpResourcesRequestOptions, McpResourcesServer, McpResourcesSourceOptions as McpResourcesSourceOptions$1 } from "@vite-hub/source";
|
|
11
8
|
|
|
12
9
|
//#region src/core/define.d.ts
|
|
13
10
|
declare function defineWorkspace(definition: WorkspaceDefinitionInput): WorkspaceDefinitionInput;
|
|
14
11
|
//#endregion
|
|
12
|
+
//#region src/sources/runtime-options.d.ts
|
|
13
|
+
type ExactOptions$1<TInput, TShape> = TInput & Record<Exclude<keyof TInput, keyof TShape>, never>;
|
|
14
|
+
type WorkspaceSourceRuntimeOptions = Pick<WorkspaceSource, "cache" | "materialize" | "mount" | "sync" | "validate">;
|
|
15
|
+
//#endregion
|
|
15
16
|
//#region src/sources/custom.d.ts
|
|
16
|
-
type ExactOptions$5<TInput, TShape> = TInput & Record<Exclude<keyof TInput, keyof TShape>, never>;
|
|
17
|
-
type WorkspaceSourceRuntimeOptions = Pick<WorkspaceSource, "cache" | "materialize" | "mount" | "probeKeys" | "sync" | "validate">;
|
|
18
17
|
type CustomWorkspaceSourceFile = Omit<WorkspaceSourceItem, "content" | "contentStream" | "key" | "path"> & {
|
|
19
18
|
content: WorkspaceContent | ((context: SourceContext) => MaybePromise<WorkspaceContent>);
|
|
20
19
|
path: string;
|
|
21
20
|
};
|
|
22
|
-
type CustomWorkspaceSourceFiles = WorkspaceSourceRuntimeOptions & {
|
|
21
|
+
type CustomWorkspaceSourceFiles = WorkspaceSourceRuntimeOptions & Pick<WorkspaceSource, "probeKeys"> & {
|
|
23
22
|
files: readonly CustomWorkspaceSourceFile[];
|
|
24
23
|
};
|
|
25
|
-
declare function custom<const TSource extends CustomWorkspaceSourceFiles>(source: ExactOptions$
|
|
26
|
-
declare function custom<const TSource extends WorkspaceSource>(source: ExactOptions$
|
|
24
|
+
declare function custom<const TSource extends CustomWorkspaceSourceFiles>(source: ExactOptions$1<TSource, CustomWorkspaceSourceFiles>): WorkspaceSource;
|
|
25
|
+
declare function custom<const TSource extends WorkspaceSource>(source: ExactOptions$1<TSource, WorkspaceSource>): WorkspaceSource;
|
|
27
26
|
//#endregion
|
|
28
27
|
//#region src/sources/file.d.ts
|
|
29
|
-
type
|
|
30
|
-
type
|
|
31
|
-
type FileSourceOptions<TKey extends string = string> = FileSourceOptions$1<TKey> & SourceRuntimeOptions$4;
|
|
28
|
+
type FileWorkspaceSourceRuntimeOptions = WorkspaceSourceRuntimeOptions & Pick<WorkspaceSource, "probeKeys">;
|
|
29
|
+
type FileSourceOptions<TKey extends string = string> = FileSourceOptions$1<TKey> & FileWorkspaceSourceRuntimeOptions;
|
|
32
30
|
declare function file<const TKey extends string>(input: TKey): WorkspaceSource;
|
|
33
|
-
declare function file<const TKey extends string = string, const TOptions extends FileSourceOptions<TKey> = FileSourceOptions<TKey>>(input: ExactOptions$
|
|
31
|
+
declare function file<const TKey extends string = string, const TOptions extends FileSourceOptions<TKey> = FileSourceOptions<TKey>>(input: ExactOptions$1<TOptions, FileSourceOptions<TKey>>): WorkspaceSource;
|
|
34
32
|
//#endregion
|
|
35
33
|
//#region src/sources/fetch.d.ts
|
|
36
34
|
type FetchSourceMethod = "GET" | "HEAD" | "POST";
|
|
@@ -56,8 +54,8 @@ interface FetchSourceStandardJsonSchemaV1<T = unknown> extends FetchSourceStanda
|
|
|
56
54
|
};
|
|
57
55
|
};
|
|
58
56
|
}
|
|
59
|
-
type SourceRuntimeOptions
|
|
60
|
-
type ExactOptions
|
|
57
|
+
type SourceRuntimeOptions = Pick<WorkspaceSource, "cache" | "materialize" | "probeKeys" | "sync">;
|
|
58
|
+
type ExactOptions<TInput, TShape> = TInput & Record<Exclude<keyof TInput, keyof TShape>, never>;
|
|
61
59
|
interface FetchSourceCredentialOptions {
|
|
62
60
|
cookies?: Record<string, string>;
|
|
63
61
|
headers?: Record<string, string>;
|
|
@@ -82,7 +80,7 @@ interface FetchSourceRequestCallbackContext {
|
|
|
82
80
|
};
|
|
83
81
|
}
|
|
84
82
|
type FetchSourceRequest = FetchSourceCredentialOptions | ((context: FetchSourceRequestCallbackContext) => FetchSourceCredentialOptions | Promise<FetchSourceCredentialOptions>);
|
|
85
|
-
interface FetchSourceOptions<TResponse = unknown, TOutput = TResponse> extends SourceRuntimeOptions
|
|
83
|
+
interface FetchSourceOptions<TResponse = unknown, TOutput = TResponse> extends SourceRuntimeOptions {
|
|
86
84
|
body?: unknown;
|
|
87
85
|
bodySchema?: FetchSourceStandardJsonSchemaV1;
|
|
88
86
|
cookies?: Record<string, string>;
|
|
@@ -99,37 +97,31 @@ interface FetchSourceOptions<TResponse = unknown, TOutput = TResponse> extends S
|
|
|
99
97
|
}
|
|
100
98
|
type FetchSourceResolver<TResponse = unknown, TOutput = TResponse> = (context: WorkspaceSourceResolutionContext) => MaybePromise<FetchSourceOptions<TResponse, TOutput> | false | null | undefined>;
|
|
101
99
|
type FetchSourceInput<TResponse = unknown, TOutput = TResponse> = FetchSourceOptions<TResponse, TOutput> | FetchSourceResolver<TResponse, TOutput>;
|
|
102
|
-
declare function fetch<TResponse = unknown, TOutput = TResponse>(options: ExactOptions
|
|
103
|
-
declare function fetch<const TOptions extends FetchSourceOptions<any, any>>(options: ExactOptions
|
|
100
|
+
declare function fetch<TResponse = unknown, TOutput = TResponse>(options: ExactOptions<FetchSourceOptions<TResponse, TOutput>, FetchSourceOptions<TResponse, TOutput>>): WorkspaceSource;
|
|
101
|
+
declare function fetch<const TOptions extends FetchSourceOptions<any, any>>(options: ExactOptions<TOptions, FetchSourceOptions<any, any>>): WorkspaceSource;
|
|
104
102
|
declare function fetch<TResponse = unknown, TOutput = TResponse>(resolve: FetchSourceResolver<TResponse, TOutput>): WorkspaceSource;
|
|
105
103
|
//#endregion
|
|
106
104
|
//#region src/sources/github.d.ts
|
|
107
|
-
type SourceRuntimeOptions$2 = Pick<WorkspaceSource, "cache" | "materialize" | "mount" | "sync" | "validate">;
|
|
108
|
-
type ExactOptions$2<TInput, TShape> = TInput & Record<Exclude<keyof TInput, keyof TShape>, never>;
|
|
109
105
|
type GitHubAuth = NonNullable<GitHubSourceOptions$1["auth"]>;
|
|
110
106
|
type GitHubResolvedSourceOptions = Omit<GitHubSourceOptions, "repo"> & Partial<Pick<GitHubSourceOptions, "repo">>;
|
|
111
|
-
interface GitHubSourceOptions extends Omit<GitHubSourceOptions$1, "auth">,
|
|
107
|
+
interface GitHubSourceOptions extends Omit<GitHubSourceOptions$1, "auth">, WorkspaceSourceRuntimeOptions {
|
|
112
108
|
auth?: GitHubAuth;
|
|
113
109
|
}
|
|
114
110
|
type GitHubSourceResolver = (context: WorkspaceSourceResolutionContext) => MaybePromise<GitHubResolvedSourceOptions | false | null | undefined>;
|
|
115
111
|
type GitHubSourceInput = GitHubSourceOptions | GitHubSourceResolver;
|
|
116
|
-
declare function github<const TOptions extends GitHubSourceOptions>(options: ExactOptions$
|
|
112
|
+
declare function github<const TOptions extends GitHubSourceOptions>(options: ExactOptions$1<TOptions, GitHubSourceOptions>): WorkspaceSource;
|
|
117
113
|
declare function github(resolve: GitHubSourceResolver): WorkspaceSource;
|
|
118
114
|
//#endregion
|
|
119
115
|
//#region src/sources/glob.d.ts
|
|
120
|
-
type
|
|
121
|
-
type ExactOptions$1<TInput, TShape> = TInput & Record<Exclude<keyof TInput, keyof TShape>, never>;
|
|
122
|
-
type GlobSourceOptions = GlobSourceOptions$1 & SourceRuntimeOptions$1;
|
|
116
|
+
type GlobSourceOptions = GlobSourceOptions$1 & WorkspaceSourceRuntimeOptions;
|
|
123
117
|
declare function glob<const TOptions extends GlobSourceOptions>(options: ExactOptions$1<TOptions, GlobSourceOptions>): WorkspaceSource;
|
|
124
118
|
//#endregion
|
|
125
119
|
//#region src/sources/markdown.d.ts
|
|
126
120
|
declare function markdown(options: FileSourceOptions): WorkspaceSource;
|
|
127
121
|
//#endregion
|
|
128
122
|
//#region src/sources/mcp-resources.d.ts
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
interface McpResourcesSourceOptions<TKey extends string = string> extends Omit<McpResourcesSourceOptions$1<TKey>, "cache">, SourceRuntimeOptions {}
|
|
132
|
-
declare function mcpResources<const TKey extends string = string, const TOptions extends McpResourcesSourceOptions<TKey> = McpResourcesSourceOptions<TKey>>(options: ExactOptions<TOptions, McpResourcesSourceOptions<TKey>>): WorkspaceSource;
|
|
123
|
+
interface McpResourcesSourceOptions<TKey extends string = string> extends Omit<McpResourcesSourceOptions$1<TKey>, "cache">, WorkspaceSourceRuntimeOptions {}
|
|
124
|
+
declare function mcpResources<const TKey extends string = string, const TOptions extends McpResourcesSourceOptions<TKey> = McpResourcesSourceOptions<TKey>>(options: ExactOptions$1<TOptions, McpResourcesSourceOptions<TKey>>): WorkspaceSource;
|
|
133
125
|
declare namespace index_d_exports {
|
|
134
126
|
export { FetchSourceInput, FetchSourceOptions, FetchSourceRequest, FetchSourceRequestOptions, FetchSourceResolver, FileSourceOptions, GitHubSourceInput, GitHubSourceOptions, GitHubSourceResolver, GlobSourceOptions, McpResourceContent, McpResourceDescriptor, McpResourcesClient, McpResourcesClientConfig, McpResourcesRequestOptions, McpResourcesServer, McpResourcesSourceOptions, custom, fetch, file, github, glob, markdown, mcpResources };
|
|
135
127
|
}
|
|
@@ -182,4 +174,4 @@ declare function resolveWorkspaceAutoCommit(definition: WorkspaceDefinition, dif
|
|
|
182
174
|
//#region src/core/errors.d.ts
|
|
183
175
|
type WorkspaceErrorCode = "WORKSPACE_COLLECTION_CURSOR_INVALID" | "WORKSPACE_FAILED" | "WORKSPACE_NOT_FOUND" | "WORKSPACE_PATH_INVALID";
|
|
184
176
|
//#endregion
|
|
185
|
-
export { type CloudflareArtifactsWorkspaceStoreOptions, type DiffOptions, type EnabledReadCapability, type ExecOptions, type ExecResult, type FetchSourceInput, type FetchSourceOptions, type FetchSourceRequest, type FetchSourceRequestOptions, type FetchSourceResolver, type FileSourceOptions, type GitHubSourceInput, type GitHubSourceOptions, type GitHubSourceResolver, type GitHubWorkspaceOption, type GitHubWorkspaceStoreOptions, type GlobOptions, type GlobSourceOptions, type HarnessSandboxSession, type HarnessWorkspaceSession, type ListOptions, type LoaderContext, type LocalWorkspaceStoreOptions, type Logger, type MaybePromise, type McpResourceContent, type McpResourceDescriptor, type McpResourcesClient, type McpResourcesClientConfig, type McpResourcesRequestOptions, type McpResourcesServer, type McpResourcesSourceOptions, type MemoryWorkspaceStoreOptions, type MkdirOptions, type PrepareHarnessWorkspaceSessionOptions, type PublishContext, type ReadFileOptions, type ReadFileResult, type ReadonlyWorkspaceFacade, type ReadonlyWorkspaceFs, type ResolvedWorkspaceModuleOptions, type ResolvedWorkspaceRule, type RmOptions, type ShellEnabled, type SnapshotOptions, type SourceContext, type SourceContextWorkspaceFiles, type UseWorkspaceOptions, type VercelBlobWorkspaceStoreOptions, type Workspace, type WorkspaceAssetPath, type WorkspaceAssets, type WorkspaceAssetsRegistry, type WorkspaceAutoCommitPlan, type WorkspaceCacheOptions, type WorkspaceContent, type WorkspaceContentStream, type WorkspaceCustomSourceInput, type WorkspaceDefinition, type WorkspaceDefinitionInput, type WorkspaceDiff, type WorkspaceDiffEntry, type WorkspaceEntry, type WorkspaceErrorCode, type WorkspaceFacade, type WorkspaceFacadeToolOptions, type WorkspaceFetchSourceInput, type WorkspaceFetchSourceRequestOptions, type WorkspaceFile, type WorkspaceFileSourceInput, type WorkspaceGitHubSourceInput, type WorkspaceGlobSourceInput, type WorkspaceHookContext, type WorkspaceHooks, type WorkspaceInstructionBinding, type WorkspaceInstructionBindingValue, type WorkspaceLoader, type WorkspaceLoaderSource, type WorkspaceMaterializeMode, type WorkspaceMaterializeSourcesOptions, type WorkspaceMaterializeSourcesProgressEvent, type WorkspaceMaterializeSourcesResult, type WorkspaceMcpResourcesSourceInput, type WorkspaceModuleOptions, type
|
|
177
|
+
export { type CloudflareArtifactsWorkspaceStoreOptions, type DiffOptions, type EnabledReadCapability, type ExecOptions, type ExecResult, type FetchSourceInput, type FetchSourceOptions, type FetchSourceRequest, type FetchSourceRequestOptions, type FetchSourceResolver, type FileSourceOptions, type GitHubSourceInput, type GitHubSourceOptions, type GitHubSourceResolver, type GitHubWorkspaceOption, type GitHubWorkspaceStoreOptions, type GlobOptions, type GlobSourceOptions, type HarnessSandboxSession, type HarnessWorkspaceSession, type ListOptions, type LoaderContext, type LocalWorkspaceStoreOptions, type Logger, type MaybePromise, type McpResourceContent, type McpResourceDescriptor, type McpResourcesClient, type McpResourcesClientConfig, type McpResourcesRequestOptions, type McpResourcesServer, type McpResourcesSourceOptions, type MemoryWorkspaceStoreOptions, type MkdirOptions, type PrepareHarnessWorkspaceSessionOptions, type PublishContext, type ReadFileOptions, type ReadFileResult, type ReadonlyWorkspaceFacade, type ReadonlyWorkspaceFs, type ResolvedWorkspaceModuleOptions, type ResolvedWorkspaceRule, type RmOptions, type ShellEnabled, type SnapshotOptions, type SourceContext, type SourceContextWorkspaceFiles, type UseWorkspaceOptions, type VercelBlobWorkspaceStoreOptions, type Workspace, type WorkspaceAssetPath, type WorkspaceAssets, type WorkspaceAssetsRegistry, type WorkspaceAutoCommitPlan, type WorkspaceCacheOptions, type WorkspaceContent, type WorkspaceContentStream, type WorkspaceCustomSourceInput, type WorkspaceDefinition, type WorkspaceDefinitionInput, type WorkspaceDiff, type WorkspaceDiffEntry, type WorkspaceEntry, type WorkspaceErrorCode, type WorkspaceFacade, type WorkspaceFacadeToolOptions, type WorkspaceFetchSourceInput, type WorkspaceFetchSourceRequestOptions, type WorkspaceFile, type WorkspaceFileSourceInput, type WorkspaceGitHubSourceInput, type WorkspaceGlobSourceInput, type WorkspaceHookContext, type WorkspaceHooks, type WorkspaceInstructionBinding, type WorkspaceInstructionBindingValue, type WorkspaceLoader, type WorkspaceLoaderSource, type WorkspaceMaterializeMode, type WorkspaceMaterializeSourcesOptions, type WorkspaceMaterializeSourcesProgressEvent, type WorkspaceMaterializeSourcesResult, type WorkspaceMcpResourcesSourceInput, type WorkspaceModuleOptions, type WorkspaceMoveResult, type WorkspaceName, type WorkspaceNameMap, type WorkspacePathResult, type WorkspacePlugin, type WorkspacePrepareSessionProgressEvent, type WorkspacePublishOptions, type WorkspacePublisher, type WorkspaceReadOperations, type WorkspaceReadToolSet, type WorkspaceReadTools, type WorkspaceRule, type WorkspaceRules, type WorkspaceScopeName, type WorkspaceSearchHit, type WorkspaceSearchQuery, type WorkspaceSelectedScope, type WorkspaceSession, type WorkspaceSessionHost, type WorkspaceSessionHostFileEntry, type WorkspaceSessionHostFiles, type WorkspaceSessionOptions, type WorkspaceShellResult, type WorkspaceSnapshot, type WorkspaceSource, type WorkspaceSourceBindingInput, type WorkspaceSourceDefinition, type WorkspaceSourceInput, type WorkspaceSourceItem, type WorkspaceSourceMaterializationStatus, type WorkspaceSourceMount, type WorkspaceSourceMountOptions, type WorkspaceSourceRequestDescriptor, type WorkspaceSourceRequestExecutionInput, type WorkspaceSourceRequestExecutionResult, type WorkspaceSourceRequestExecutor, type WorkspaceSourceRequestMethod, type WorkspaceSourceResolutionContext, type WorkspaceSourceResolutionContextMap, type WorkspaceSourceResolutionContextValueReader, type WorkspaceSourceResolutionInvocation, type WorkspaceSourceResolutionResult, type WorkspaceSourceResolver, type WorkspaceSourceSelection, type WorkspaceSourceSyncConfig, type WorkspaceSourceSyncCounts, type WorkspaceSourceSyncPathResult, type WorkspaceSourceSyncPolicy, type WorkspaceSourceSyncResult, type WorkspaceSourceSyncStatus, type WorkspaceStat, type WorkspaceStore, type WorkspaceStoreOptions, type WorkspaceStreamFile, type WorkspaceSyncOptions, type WorkspaceSyncResultDetails, type WorkspaceSyncSnapshotOptions, type WorkspaceToolOperations, type WorkspaceToolOptions, type WorkspaceTools, type WorkspaceValidateMode, type WorkspaceWriteErrorHook, type WorkspaceWriteHook, type WorkspaceWriteInput, type WorkspaceWriteMode, type WorkspaceWriteOperation, type WorkspaceWriteOperations, type WorkspaceWriteToolMap, type WorkspaceWriteToolSet, type WorkspaceWriteTools, type WorkspaceWriteValidator, type WorkspaceWriteValidatorResult, type WritableWorkspaceFacade, type WritableWorkspaceFacadeToolOptions, type WritableWorkspaceFs, type WriteFileOptions, createWorkspace, createWorkspaceTools, custom, defineWorkspace, fetch, file, github, glob, markdown, mcpResources, prepareHarnessWorkspaceSession, resolveRegisteredWorkspaceDefinition, resolveWorkspaceAutoCommit, index_d_exports as source, useWorkspace };
|