@vite-hub/workspace 0.0.2 → 0.0.4
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/LICENSE +201 -0
- package/README.md +48 -2
- package/dist/{ai-Cztw4eLk.js → ai-BqCC8BpY.js} +15 -4
- package/dist/{ai-hFdsvDHC.d.ts → ai-CjxvGqM0.d.ts} +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/{asset-registry-CaG9b7tf.js → asset-registry-8QI3ML3K.js} +1 -1
- package/dist/chunk-2rV9d50f.js +35 -0
- 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--r5unwPc.js → config-Bc3c4Su1.js} +213 -120
- package/dist/{config-DCQ6y30R.js → config-CHLLWklZ.js} +9 -3
- package/dist/{config-Ca5DM8fF.d.ts → config-DE9xlaIw.d.ts} +1 -1
- package/dist/{file-B2q9NE18.js → file-Bc1X7pco.js} +9 -10
- package/dist/{files-xy0le-_U.js → files-Q6xZjDHA.js} +20 -9
- package/dist/{github-lIO6-2sH.js → github-DHnjxQIX.js} +27 -23
- package/dist/glob-CEZKeZFC.js +18 -0
- package/dist/host-DJH8cuoU.js +1030 -0
- package/dist/{artifacts-store-BAV9jZpd.js → hosted-RPeJOCFz.js} +146 -30
- package/dist/hosted-vercel-blob-d6C8ND5j.js +23580 -0
- 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 +61 -78
- package/dist/index.js +133 -435
- package/dist/lifecycle-LrL3sA4n.js +316 -0
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +1 -1
- package/dist/metadata-target-B0tOmVW7.js +717 -0
- package/dist/mountx.d.ts +10 -0
- package/dist/mountx.js +143 -0
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +8 -2
- package/dist/{path-CNI6wKIU.js → path-Cp59koVz.js} +28 -4
- package/dist/{provider-CeQciesl.js → provider-B1yLjCJJ.js} +194 -47
- 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 +2 -2
- package/dist/registry-D3yzt8HQ.js +127 -0
- package/dist/{registry-CoC9JxVt.d.ts → registry-Uj6IVxes.d.ts} +3 -3
- package/dist/{request-execution-C8qRcReq.js → request-execution-B-dSFlGB.js} +8 -4
- package/dist/runtime/assets.d.ts +1 -1
- package/dist/runtime/assets.js +4 -2
- 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 +4 -4
- package/dist/runtime/state.js +10 -7
- 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-type-iEE6BjQJ.js +34 -0
- package/dist/runtime.d.ts +42 -7
- package/dist/runtime.js +276 -100
- package/dist/{search-C4REyHj9.js → search-BpiCF2Tw.js} +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +24 -51
- package/dist/{shared-BRycRSbo.js → shared-DTR1Hhma.js} +115 -39
- package/dist/source-metadata.d.ts +9 -2
- package/dist/source-metadata.js +34 -2
- package/dist/{state-DSAHEsq6.d.ts → state-tYcRWEh2.d.ts} +13 -12
- package/dist/store-Dt_Jyys3.js +608 -0
- package/dist/{sync-DO42ypji.js → sync-DnTQwt8r.js} +6 -5
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/token-CVzURBxC.js +61 -0
- package/dist/{types-DHkae7Cb.d.ts → types-CYuwjJ4V.d.ts} +94 -43
- package/dist/{use-d_PlAdOu.js → use-BTNDR5Rd.js} +147 -50
- package/dist/{use-D16tf8Ph.d.ts → use-BiHzt0xA.d.ts} +21 -4
- package/dist/vite-BptCrpv2.js +4526 -0
- package/dist/vite-CtA9guIM.d.ts +66 -0
- package/dist/vite.d.ts +2 -50
- package/dist/vite.js +2 -2
- package/dist/{workspace-n4wBmdaM.js → workspace-Dq08Yn72.js} +224 -545
- package/dist/{workspace-f2DBLmPZ.d.ts → workspace-Xddf4G1B.d.ts} +1 -1
- package/package.json +20 -38
- package/dist/chunk-8H4AJuhK.js +0 -14
- package/dist/cli.d.ts +0 -31
- package/dist/cli.js +0 -303
- package/dist/cloudflare-env-CKxUs2fa.js +0 -20
- package/dist/glob-DeH0dzZX.js +0 -23
- package/dist/host-I-_vDs05.js +0 -370
- package/dist/lifecycle-Lhk3dAMt.js +0 -176
- 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/providers/vercel/blob-store.js +0 -235
- package/dist/registry-C7DMdBXN.js +0 -74
- package/dist/utils-BPdaCyI6.js +0 -55
- package/dist/vite-NWC9mFjI.js +0 -1882
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
+
import { a as require_token_error, i as require_dist, r as require_token_util } from "./hosted-vercel-blob-d6C8ND5j.js";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.8.2/node_modules/@vercel/oidc/dist/token.js
|
|
4
|
+
var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var token_exports = {};
|
|
26
|
+
__export(token_exports, { refreshToken: () => refreshToken });
|
|
27
|
+
module.exports = __toCommonJS(token_exports);
|
|
28
|
+
var import_cli_config = require_dist();
|
|
29
|
+
var import_token_error = require_token_error();
|
|
30
|
+
var import_token_util = require_token_util();
|
|
31
|
+
async function refreshToken(options) {
|
|
32
|
+
let projectId = options?.project;
|
|
33
|
+
let teamId = options?.team;
|
|
34
|
+
if (!projectId && !teamId) {
|
|
35
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
36
|
+
projectId = projectInfo.projectId;
|
|
37
|
+
teamId = projectInfo.teamId;
|
|
38
|
+
} else if (!projectId || !teamId) {
|
|
39
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
40
|
+
projectId = projectId ?? projectInfo.projectId;
|
|
41
|
+
teamId = teamId ?? projectInfo.teamId;
|
|
42
|
+
}
|
|
43
|
+
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");
|
|
44
|
+
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
45
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {
|
|
46
|
+
const configDir = (0, import_cli_config.getGlobalPathConfig)();
|
|
47
|
+
if ((0, import_cli_config.getLikelyEffectiveCredStorage)(configDir) === "keyring") maybeToken = await (0, import_token_util.getVercelOidcTokenFromCli)(projectId, teamId);
|
|
48
|
+
else {
|
|
49
|
+
const authToken = await (0, import_token_util.getVercelToken)({ expirationBufferMs: options?.expirationBufferMs });
|
|
50
|
+
maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
51
|
+
}
|
|
52
|
+
if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
|
53
|
+
(0, import_token_util.saveToken)(maybeToken, projectId);
|
|
54
|
+
}
|
|
55
|
+
process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
|
|
56
|
+
}
|
|
57
|
+
0 && (module.exports = { refreshToken });
|
|
58
|
+
}));
|
|
59
|
+
//#endregion
|
|
60
|
+
export default require_token();
|
|
61
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ExecutionAuthority } from "@vite-hub/runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Source, SourceContext, SourceRevision } from "@vite-hub/source";
|
|
3
|
+
import { FileSourceOptions } from "@vite-hub/source/file";
|
|
4
|
+
import { GitHubSourceOptions } from "@vite-hub/source/github";
|
|
5
|
+
import { GlobSourceOptions } from "@vite-hub/source/glob";
|
|
6
|
+
import { McpResourcesSourceOptions } from "@vite-hub/source/mcp";
|
|
3
7
|
|
|
4
8
|
//#region src/core/types.d.ts
|
|
5
9
|
type WorkspaceContent = string | Uint8Array;
|
|
@@ -11,10 +15,14 @@ type ReadFileResult<TOptions extends ReadFileOptions | undefined = undefined> =
|
|
|
11
15
|
encoding: "binary";
|
|
12
16
|
} ? Uint8Array : string;
|
|
13
17
|
interface WriteFileOptions {
|
|
18
|
+
ifDigest?: string | null;
|
|
14
19
|
mediaType?: string;
|
|
15
20
|
metadata?: Record<string, unknown>;
|
|
21
|
+
preservePath?: boolean;
|
|
16
22
|
}
|
|
23
|
+
type WorkspaceSessionWriteFileOptions = Omit<WriteFileOptions, "ifDigest" | "preservePath">;
|
|
17
24
|
interface ListOptions {
|
|
25
|
+
exclude?: string[];
|
|
18
26
|
recursive?: boolean;
|
|
19
27
|
}
|
|
20
28
|
interface GlobOptions {
|
|
@@ -107,32 +115,51 @@ interface WorkspaceSyncOptions {
|
|
|
107
115
|
sources: WorkspaceSourceSelection;
|
|
108
116
|
}
|
|
109
117
|
interface WorkspaceSessionOptions {
|
|
118
|
+
abortSignal?: AbortSignal;
|
|
110
119
|
attach?: boolean;
|
|
111
120
|
host?: WorkspaceSessionHost;
|
|
121
|
+
materializeSources?: false;
|
|
122
|
+
onProgress?: (event: WorkspacePrepareSessionProgressEvent) => void | Promise<void>;
|
|
112
123
|
paths?: readonly string[];
|
|
113
124
|
target?: string;
|
|
125
|
+
writeBack?: false | {
|
|
126
|
+
exclude?: readonly string[];
|
|
127
|
+
};
|
|
114
128
|
}
|
|
115
129
|
interface WorkspaceSessionHostFileEntry {
|
|
130
|
+
executable?: boolean;
|
|
116
131
|
path: string;
|
|
117
132
|
size?: number;
|
|
118
133
|
type: "directory" | "file" | "symlink";
|
|
119
134
|
}
|
|
120
135
|
interface WorkspaceSessionHostFiles {
|
|
121
|
-
exists(path: string
|
|
136
|
+
exists(path: string, options?: {
|
|
137
|
+
signal?: AbortSignal;
|
|
138
|
+
}): Promise<boolean>;
|
|
122
139
|
list(path: string, options?: {
|
|
140
|
+
exclude?: readonly string[];
|
|
123
141
|
recursive?: boolean;
|
|
142
|
+
signal?: AbortSignal;
|
|
124
143
|
}): Promise<readonly WorkspaceSessionHostFileEntry[]>;
|
|
125
144
|
mkdir(path: string, options?: {
|
|
126
145
|
recursive?: boolean;
|
|
146
|
+
signal?: AbortSignal;
|
|
127
147
|
}): Promise<void>;
|
|
128
|
-
read(path: string
|
|
148
|
+
read(path: string, options?: {
|
|
149
|
+
signal?: AbortSignal;
|
|
150
|
+
}): Promise<Uint8Array | null>;
|
|
129
151
|
remove(path: string, options?: {
|
|
130
152
|
recursive?: boolean;
|
|
153
|
+
signal?: AbortSignal;
|
|
154
|
+
}): Promise<void>;
|
|
155
|
+
write(path: string, content: Uint8Array, options?: {
|
|
156
|
+
signal?: AbortSignal;
|
|
131
157
|
}): Promise<void>;
|
|
132
|
-
write(path: string, content: Uint8Array): Promise<void>;
|
|
133
158
|
}
|
|
134
159
|
interface WorkspaceSessionHost {
|
|
135
160
|
readonly executionAuthority: ExecutionAuthority;
|
|
161
|
+
readonly inspectionConcurrency?: number;
|
|
162
|
+
detachAbortSignal?(): void;
|
|
136
163
|
files: WorkspaceSessionHostFiles;
|
|
137
164
|
exec(command: string, args?: readonly string[], options?: {
|
|
138
165
|
cwd?: string;
|
|
@@ -145,21 +172,6 @@ interface WorkspaceSessionHost {
|
|
|
145
172
|
stdout: string;
|
|
146
173
|
}>;
|
|
147
174
|
}
|
|
148
|
-
type WorkspaceMountMode = "read-only" | "read-write" | "copy-on-write";
|
|
149
|
-
interface WorkspaceMountOptions {
|
|
150
|
-
mode: WorkspaceMountMode;
|
|
151
|
-
target?: string;
|
|
152
|
-
}
|
|
153
|
-
interface WorkspaceMount {
|
|
154
|
-
workspace: Workspace;
|
|
155
|
-
mode: WorkspaceMountMode;
|
|
156
|
-
target: string;
|
|
157
|
-
diff(): Promise<WorkspaceDiff>;
|
|
158
|
-
commit(options?: {
|
|
159
|
-
message?: string;
|
|
160
|
-
}): Promise<void>;
|
|
161
|
-
export(): Promise<WorkspaceSnapshot>;
|
|
162
|
-
}
|
|
163
175
|
interface ExecOptions {
|
|
164
176
|
abortSignal?: AbortSignal;
|
|
165
177
|
cwd?: string;
|
|
@@ -176,21 +188,26 @@ interface ExecResult {
|
|
|
176
188
|
interface WorkspaceSession {
|
|
177
189
|
readonly executionAuthority: ExecutionAuthority;
|
|
178
190
|
readFile<TOptions extends ReadFileOptions | undefined = undefined>(path: string, options?: TOptions): Promise<ReadFileResult<TOptions>>;
|
|
179
|
-
writeFile(path: string, content: WorkspaceContent, options?:
|
|
191
|
+
writeFile(path: string, content: WorkspaceContent, options?: WorkspaceSessionWriteFileOptions): Promise<void>;
|
|
180
192
|
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
181
193
|
rm(path: string, options?: RmOptions): Promise<void>;
|
|
182
194
|
list(path?: string, options?: ListOptions): Promise<WorkspaceEntry[]>;
|
|
183
195
|
glob(pattern: string | string[], options?: GlobOptions): Promise<WorkspaceEntry[]>;
|
|
184
196
|
search(query: WorkspaceSearchQuery): Promise<WorkspaceSearchHit[]>;
|
|
185
|
-
diff(
|
|
197
|
+
diff(options?: {
|
|
198
|
+
abortSignal?: AbortSignal;
|
|
199
|
+
}): Promise<WorkspaceDiff>;
|
|
186
200
|
commit(options?: {
|
|
201
|
+
abortSignal?: AbortSignal;
|
|
187
202
|
message?: string;
|
|
188
203
|
}): Promise<void>;
|
|
189
204
|
exec(command: string, args?: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
190
205
|
tools?: {
|
|
191
206
|
aiSdk?(): Promise<Record<string, unknown>>;
|
|
192
207
|
};
|
|
193
|
-
close(
|
|
208
|
+
close(options?: {
|
|
209
|
+
abortSignal?: AbortSignal;
|
|
210
|
+
}): Promise<void>;
|
|
194
211
|
}
|
|
195
212
|
declare global {
|
|
196
213
|
interface ViteHubWorkspaceNameMap {}
|
|
@@ -263,16 +280,23 @@ interface WorkspaceAutoCommitPlan {
|
|
|
263
280
|
message: string;
|
|
264
281
|
paths: string[];
|
|
265
282
|
}
|
|
283
|
+
interface WorkspaceRebaseOptions {
|
|
284
|
+
takeRemote?: string[];
|
|
285
|
+
}
|
|
266
286
|
interface WorkspaceStore {
|
|
267
287
|
readFile(path: string): Promise<WorkspaceFile | undefined>;
|
|
268
288
|
writeFile(path: string, file: WorkspaceFile): Promise<void>;
|
|
269
|
-
|
|
289
|
+
writeFileConditional?(path: string, file: WorkspaceFile, ifDigest: string | null): Promise<void>;
|
|
290
|
+
writeFileStream?(path: string, file: WorkspaceStreamFile): Promise<WorkspaceStat & {
|
|
291
|
+
digest: string;
|
|
292
|
+
}>;
|
|
270
293
|
list(prefix?: string, options?: ListOptions): Promise<WorkspaceEntry[]>;
|
|
271
294
|
glob(pattern: string | string[], options?: GlobOptions): Promise<WorkspaceEntry[]>;
|
|
272
295
|
stat(path: string): Promise<WorkspaceStat | undefined>;
|
|
273
296
|
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
274
297
|
rm(path: string, options?: RmOptions): Promise<void>;
|
|
275
298
|
snapshot(options?: SnapshotOptions): Promise<WorkspaceSnapshot>;
|
|
299
|
+
rebase?(options?: WorkspaceRebaseOptions): Promise<void>;
|
|
276
300
|
diff(options?: DiffOptions): Promise<WorkspaceDiff>;
|
|
277
301
|
getMeta?(key: string): Promise<unknown>;
|
|
278
302
|
setMeta?(key: string, value: unknown): Promise<void>;
|
|
@@ -282,13 +306,9 @@ interface SourceContextWorkspaceFiles {
|
|
|
282
306
|
stat(path: string): Promise<WorkspaceStat | undefined>;
|
|
283
307
|
exists(path: string): Promise<boolean>;
|
|
284
308
|
}
|
|
285
|
-
interface SourceContext {
|
|
286
|
-
abortSignal?: AbortSignal;
|
|
309
|
+
interface SourceContext$1 extends SourceContext {
|
|
287
310
|
mountPath?: string;
|
|
288
|
-
rootDir: string;
|
|
289
311
|
selectedWorkspaceScope?: WorkspaceSelectedScope;
|
|
290
|
-
source?: string;
|
|
291
|
-
sourceRootDir?: string;
|
|
292
312
|
workspace: string;
|
|
293
313
|
workspaceFiles?: SourceContextWorkspaceFiles;
|
|
294
314
|
}
|
|
@@ -296,7 +316,7 @@ type MaybePromise<T> = T | Promise<T>;
|
|
|
296
316
|
interface WorkspaceSourceResolutionContextValueReader<TContextMap extends object = WorkspaceSourceResolutionContextMap> {
|
|
297
317
|
entries(): IterableIterator<[string, unknown]>;
|
|
298
318
|
get<K extends Extract<keyof TContextMap, string>>(id: K): TContextMap[K] | undefined;
|
|
299
|
-
get
|
|
319
|
+
get(id: string): unknown;
|
|
300
320
|
has(id: string): boolean;
|
|
301
321
|
toJSON?(): Record<string, unknown>;
|
|
302
322
|
}
|
|
@@ -328,7 +348,7 @@ type WorkspaceSourceResolutionContext<TContextMap extends object = WorkspaceSour
|
|
|
328
348
|
};
|
|
329
349
|
type WorkspaceSourceResolutionResult = WorkspaceSource | false | null | undefined;
|
|
330
350
|
type WorkspaceSourceResolver<TContextMap extends object = WorkspaceSourceResolutionContextMap, TScopeName extends string = WorkspaceScopeName> = (context: WorkspaceSourceResolutionContext<TContextMap, TScopeName>) => MaybePromise<WorkspaceSourceResolutionResult>;
|
|
331
|
-
type WorkspaceMaterializeMode = "build" | "lazy" | "none";
|
|
351
|
+
type WorkspaceMaterializeMode = "build" | "startup" | "lazy" | "none";
|
|
332
352
|
type WorkspaceValidateMode = false | "request";
|
|
333
353
|
interface WorkspaceCacheOptions {
|
|
334
354
|
maxAge?: number;
|
|
@@ -384,8 +404,10 @@ interface WorkspaceSourceRequestExecutionResult {
|
|
|
384
404
|
metadata?: Record<string, unknown>;
|
|
385
405
|
status?: number;
|
|
386
406
|
}
|
|
387
|
-
type WorkspaceSourceRequestExecutor = (input: WorkspaceSourceRequestExecutionInput, context: SourceContext) => MaybePromise<WorkspaceSourceRequestExecutionResult>;
|
|
407
|
+
type WorkspaceSourceRequestExecutor = (input: WorkspaceSourceRequestExecutionInput, context: SourceContext$1) => MaybePromise<WorkspaceSourceRequestExecutionResult>;
|
|
388
408
|
interface WorkspaceSource {
|
|
409
|
+
/** Stable provider name used for inspection and diagnostics. */
|
|
410
|
+
name?: string;
|
|
389
411
|
mount?: WorkspaceSourceMount;
|
|
390
412
|
materialize?: WorkspaceMaterializeMode;
|
|
391
413
|
cache?: false | WorkspaceCacheOptions;
|
|
@@ -394,13 +416,12 @@ interface WorkspaceSource {
|
|
|
394
416
|
probeKeys?: string[];
|
|
395
417
|
fingerprint?: unknown;
|
|
396
418
|
resolve?: WorkspaceSourceResolver;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
watch?: unknown[];
|
|
419
|
+
resolveRevision?(ctx: SourceContext$1): Promise<SourceRevision | undefined>;
|
|
420
|
+
prepare?(ctx: SourceContext$1): Promise<void>;
|
|
421
|
+
getKeys(ctx: SourceContext$1): Promise<string[]>;
|
|
422
|
+
getItem(key: string, ctx: SourceContext$1): Promise<WorkspaceSourceItem>;
|
|
423
|
+
getItems?(ctx: SourceContext$1): Promise<WorkspaceSourceItem[]>;
|
|
424
|
+
getMeta?(key: string, ctx: SourceContext$1): Promise<Record<string, unknown> | undefined>;
|
|
404
425
|
}
|
|
405
426
|
interface WorkspaceSourceSyncPolicy {
|
|
406
427
|
concurrency?: "skip" | "queue";
|
|
@@ -417,11 +438,13 @@ type WorkspaceFileSourceInput<TKey extends string = string> = TKey | (FileSource
|
|
|
417
438
|
interface WorkspaceFetchSourceRequestOptions {
|
|
418
439
|
body?: unknown;
|
|
419
440
|
headers?: Record<string, string>;
|
|
441
|
+
maxResponseBytes?: number;
|
|
420
442
|
method?: "GET" | "HEAD" | "POST";
|
|
421
443
|
query?: Record<string, unknown>;
|
|
422
444
|
timeout?: number;
|
|
423
445
|
}
|
|
424
446
|
interface WorkspaceFetchSourceInput<TResponse = unknown, TOutput = TResponse> extends WorkspaceSourceBindingOptions {
|
|
447
|
+
maxResponseBytes?: number;
|
|
425
448
|
method?: "GET" | "HEAD" | "POST";
|
|
426
449
|
path?: string;
|
|
427
450
|
request?: WorkspaceFetchSourceRequestOptions | (() => WorkspaceFetchSourceRequestOptions | Promise<WorkspaceFetchSourceRequestOptions>);
|
|
@@ -431,13 +454,16 @@ interface WorkspaceFetchSourceInput<TResponse = unknown, TOutput = TResponse> ex
|
|
|
431
454
|
url: string | URL;
|
|
432
455
|
}
|
|
433
456
|
type WorkspaceGlobSourceInput = GlobSourceOptions & WorkspaceSourceBindingOptions;
|
|
434
|
-
type WorkspaceGitHubSourceInput = GitHubSourceOptions &
|
|
457
|
+
type WorkspaceGitHubSourceInput = Omit<GitHubSourceOptions, "ignore"> & {
|
|
458
|
+
ignore?: false | string | readonly string[];
|
|
459
|
+
} & WorkspaceSourceBindingOptions;
|
|
435
460
|
type WorkspaceMcpResourcesSourceInput<TKey extends string = string> = Omit<McpResourcesSourceOptions<TKey>, "cache"> & WorkspaceSourceBindingOptions;
|
|
436
461
|
type WorkspaceSourceInput = WorkspaceSourceBindingInput | WorkspaceCustomSourceInput | WorkspaceFileSourceInput | WorkspaceFetchSourceInput | WorkspaceGlobSourceInput | WorkspaceGitHubSourceInput | WorkspaceMcpResourcesSourceInput;
|
|
437
462
|
interface WorkspaceLoaderSource extends WorkspaceSource {
|
|
438
463
|
key: string;
|
|
439
464
|
}
|
|
440
465
|
interface LoaderContext {
|
|
466
|
+
abortSignal?: AbortSignal;
|
|
441
467
|
workspace: string;
|
|
442
468
|
rootDir: string;
|
|
443
469
|
sourceRootDir?: string;
|
|
@@ -458,6 +484,7 @@ interface WorkspaceLoader {
|
|
|
458
484
|
load(ctx: LoaderContext): Promise<void>;
|
|
459
485
|
}
|
|
460
486
|
interface PublishContext {
|
|
487
|
+
abortSignal?: AbortSignal;
|
|
461
488
|
durable: boolean;
|
|
462
489
|
workspace: WorkspaceDefinition;
|
|
463
490
|
store: WorkspaceStore;
|
|
@@ -534,14 +561,18 @@ interface ResolvedWorkspaceModuleOptions {
|
|
|
534
561
|
assets?: boolean | string[];
|
|
535
562
|
store: Exclude<WorkspaceStoreOptions, WorkspaceStore>;
|
|
536
563
|
}
|
|
564
|
+
interface WorkspaceCapabilities {
|
|
565
|
+
conditionalWrites: boolean;
|
|
566
|
+
}
|
|
537
567
|
interface Workspace {
|
|
538
568
|
name: string;
|
|
569
|
+
capabilities?(): Promise<WorkspaceCapabilities>;
|
|
539
570
|
sync(options: WorkspaceSyncOptions): Promise<WorkspaceSourceSyncResult>;
|
|
540
571
|
materializeSources?(options?: WorkspaceMaterializeSourcesOptions): Promise<WorkspaceMaterializeSourcesResult>;
|
|
541
572
|
getMeta?(key: string): Promise<unknown>;
|
|
542
573
|
setMeta?(key: string, value: unknown): Promise<void>;
|
|
543
574
|
readFile<TOptions extends ReadFileOptions | undefined = undefined>(path: string, options?: TOptions): Promise<ReadFileResult<TOptions>>;
|
|
544
|
-
writeFile(path: string, content: WorkspaceContent, options?: WriteFileOptions): Promise<
|
|
575
|
+
writeFile(path: string, content: WorkspaceContent, options?: WriteFileOptions): Promise<string>;
|
|
545
576
|
list(path?: string, options?: ListOptions): Promise<WorkspaceEntry[]>;
|
|
546
577
|
glob(pattern: string | string[], options?: GlobOptions): Promise<WorkspaceEntry[]>;
|
|
547
578
|
search(query: WorkspaceSearchQuery): Promise<WorkspaceSearchHit[]>;
|
|
@@ -551,9 +582,9 @@ interface Workspace {
|
|
|
551
582
|
rm(path: string, options?: RmOptions): Promise<void>;
|
|
552
583
|
publish(options?: WorkspacePublishOptions): Promise<void>;
|
|
553
584
|
snapshot(options?: SnapshotOptions): Promise<WorkspaceSnapshot>;
|
|
585
|
+
rebase(options?: WorkspaceRebaseOptions): Promise<void>;
|
|
554
586
|
diff(options?: DiffOptions): Promise<WorkspaceDiff>;
|
|
555
587
|
startSession(options?: WorkspaceSessionOptions): Promise<WorkspaceSession>;
|
|
556
|
-
mount(options?: WorkspaceMountOptions): WorkspaceMount;
|
|
557
588
|
}
|
|
558
589
|
interface WorkspaceSourceSyncCounts {
|
|
559
590
|
added: number;
|
|
@@ -582,28 +613,48 @@ interface WorkspaceSourceSyncResult {
|
|
|
582
613
|
status: "error" | "partial" | "ready" | "skipped";
|
|
583
614
|
}
|
|
584
615
|
interface WorkspaceSourceMaterializationStatus {
|
|
616
|
+
cacheStatus?: "bypassed" | "disabled" | "hit" | "miss";
|
|
617
|
+
counts?: WorkspaceSourceMaterializationCounts;
|
|
618
|
+
durationMs?: number;
|
|
585
619
|
source: string;
|
|
586
620
|
mountPath: string;
|
|
621
|
+
paths?: WorkspaceSourceMaterializationPathResult[];
|
|
622
|
+
provider?: string;
|
|
587
623
|
status: "lazy" | "updating" | "ready" | "error";
|
|
588
|
-
|
|
624
|
+
revision?: SourceRevision;
|
|
589
625
|
materializedAt?: string;
|
|
590
626
|
files?: number;
|
|
591
627
|
bytes?: number;
|
|
592
628
|
error?: string;
|
|
593
629
|
}
|
|
630
|
+
interface WorkspaceSourceMaterializationCounts {
|
|
631
|
+
added: number;
|
|
632
|
+
removed: number;
|
|
633
|
+
unchanged: number;
|
|
634
|
+
updated: number;
|
|
635
|
+
}
|
|
636
|
+
interface WorkspaceSourceMaterializationPathResult {
|
|
637
|
+
path: string;
|
|
638
|
+
status: "added" | "removed" | "unchanged" | "updated";
|
|
639
|
+
}
|
|
594
640
|
interface WorkspaceMaterializeSourcesProgressEvent {
|
|
595
641
|
bytes?: number;
|
|
642
|
+
cacheStatus?: WorkspaceSourceMaterializationStatus["cacheStatus"];
|
|
643
|
+
counts?: WorkspaceSourceMaterializationCounts;
|
|
596
644
|
directories?: number;
|
|
597
645
|
durationMs?: number;
|
|
598
646
|
error?: string;
|
|
599
647
|
files?: number;
|
|
600
648
|
mountPath: string;
|
|
601
649
|
path: string;
|
|
650
|
+
provider?: string;
|
|
651
|
+
revision?: SourceRevision;
|
|
602
652
|
source: string;
|
|
603
653
|
status: "started" | "updating" | "completed" | "failed";
|
|
604
654
|
}
|
|
605
655
|
interface WorkspaceMaterializeSourcesOptions {
|
|
606
656
|
abortSignal?: AbortSignal;
|
|
657
|
+
details?: "paths";
|
|
607
658
|
onProgress?: (event: WorkspaceMaterializeSourcesProgressEvent) => void | Promise<void>;
|
|
608
659
|
sources?: string[];
|
|
609
660
|
path?: string;
|
|
@@ -625,4 +676,4 @@ interface WorkspaceMaterializeSourcesResult {
|
|
|
625
676
|
sources: WorkspaceSourceMaterializationStatus[];
|
|
626
677
|
}
|
|
627
678
|
//#endregion
|
|
628
|
-
export {
|
|
679
|
+
export { WorkspaceMaterializeSourcesOptions as $, WorkspaceStore as $t, WorkspaceCacheOptions as A, WorkspaceSourceMaterializationPathResult as At, WorkspaceFetchSourceInput as B, WorkspaceSourceResolutionContextMap as Bt, SourceContextWorkspaceFiles as C, WorkspaceSnapshot as Ct, WorkspaceAssets as D, WorkspaceSourceInput as Dt, WorkspaceAssetPath as E, WorkspaceSourceDefinition as Et, WorkspaceDefinition as F, WorkspaceSourceRequestExecutionInput as Ft, WorkspaceGlobSourceInput as G, WorkspaceSourceSelection as Gt, WorkspaceFile as H, WorkspaceSourceResolutionInvocation as Ht, WorkspaceDefinitionInput as I, WorkspaceSourceRequestExecutionResult as It, WorkspaceInstructionBinding as J, WorkspaceSourceSyncPathResult as Jt, WorkspaceHookContext as K, WorkspaceSourceSyncConfig as Kt, WorkspaceDiff as L, WorkspaceSourceRequestExecutor as Lt, WorkspaceContent as M, WorkspaceSourceMount as Mt, WorkspaceContentStream as N, WorkspaceSourceMountOptions as Nt, WorkspaceAssetsRegistry as O, WorkspaceSourceItem as Ot, WorkspaceCustomSourceInput as P, WorkspaceSourceRequestDescriptor as Pt, WorkspaceMaterializeMode as Q, WorkspaceStat as Qt, WorkspaceDiffEntry as R, WorkspaceSourceRequestMethod as Rt, SourceContext$1 as S, WorkspaceSessionWriteFileOptions as St, Workspace as T, WorkspaceSourceBindingInput as Tt, WorkspaceFileSourceInput as U, WorkspaceSourceResolutionResult as Ut, WorkspaceFetchSourceRequestOptions as V, WorkspaceSourceResolutionContextValueReader as Vt, WorkspaceGitHubSourceInput as W, WorkspaceSourceResolver as Wt, WorkspaceLoader as X, WorkspaceSourceSyncResult as Xt, WorkspaceInstructionBindingValue as Y, WorkspaceSourceSyncPolicy as Yt, WorkspaceLoaderSource as Z, WorkspaceSourceSyncStatus as Zt, ReadFileResult as _, WorkspaceSession as _t, GitHubWorkspaceOption as a, WorkspaceValidateMode as an, WorkspaceNameMap as at, RmOptions as b, WorkspaceSessionHostFiles as bt, ListOptions as c, WorkspaceWriteInput as cn, WorkspacePublishOptions as ct, Logger as d, WorkspaceWriteValidator as dn, WorkspaceRule as dt, WorkspaceStoreOptions as en, WorkspaceMaterializeSourcesProgressEvent as et, MaybePromise as f, WorkspaceWriteValidatorResult as fn, WorkspaceRules as ft, ReadFileOptions as g, WorkspaceSelectedScope as gt, PublishContext as h, WorkspaceSearchQuery as ht, ExecResult as i, WorkspaceSyncSnapshotOptions as in, WorkspaceName as it, WorkspaceCapabilities as j, WorkspaceSourceMaterializationStatus as jt, WorkspaceAutoCommitPlan as k, WorkspaceSourceMaterializationCounts as kt, LoaderContext as l, WorkspaceWriteMode as ln, WorkspacePublisher as lt, MkdirOptions as m, WorkspaceSearchHit as mt, DiffOptions as n, WorkspaceSyncOptions as nn, WorkspaceMcpResourcesSourceInput as nt, GitHubWorkspaceStoreOptions as o, WorkspaceWriteErrorHook as on, WorkspacePlugin as ot, MemoryWorkspaceStoreOptions as p, WriteFileOptions as pn, WorkspaceScopeName as pt, WorkspaceHooks as q, WorkspaceSourceSyncCounts as qt, ExecOptions as r, WorkspaceSyncResultDetails as rn, WorkspaceModuleOptions as rt, GlobOptions as s, WorkspaceWriteHook as sn, WorkspacePrepareSessionProgressEvent as st, CloudflareArtifactsWorkspaceStoreOptions as t, WorkspaceStreamFile as tn, WorkspaceMaterializeSourcesResult as tt, LocalWorkspaceStoreOptions as u, WorkspaceWriteOperation as un, WorkspaceRebaseOptions as ut, ResolvedWorkspaceModuleOptions as v, WorkspaceSessionHost as vt, VercelBlobWorkspaceStoreOptions as w, WorkspaceSource as wt, SnapshotOptions as x, WorkspaceSessionOptions as xt, ResolvedWorkspaceRule as y, WorkspaceSessionHostFileEntry as yt, WorkspaceEntry as z, WorkspaceSourceResolutionContext as zt };
|