@vite-hub/workspace 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -19
- package/dist/{abort-BCwpdrN0.js → abort-CQGxJBqa.js} +1 -2
- package/dist/{asset-registry-DfBV5kmw.js → asset-registry-0CdRAjIV.js} +2 -3
- package/dist/blob-database/postgres.d.ts +423 -0
- package/dist/blob-database/postgres.js +1 -0
- package/dist/blob-database-sources-CQPAyCz3.js +8 -0
- package/dist/blob-database.d.ts +29 -449
- package/dist/blob-database.js +636 -210
- package/dist/checkout.d.ts +1 -2
- package/dist/checkout.js +3 -4
- package/dist/cloudflare.d.ts +1 -5
- package/dist/cloudflare.js +1 -2
- package/dist/{config-B-863EgC.js → config-CsgNNVAI.js} +1 -2
- package/dist/{config-CDeGd0RB.d.ts → config-DeA287c0.d.ts} +1 -5
- package/dist/{config-D1QENneP.js → config-jo5QgE1w.js} +18 -27
- package/dist/{discard-CNNtCozM.js → discard-BkoLmmmN.js} +1 -2
- package/dist/durability.d.ts +10 -4
- package/dist/durability.js +47 -6
- package/dist/{error-diagnostics-B5s9kNEA.js → error-diagnostics-B4me-ouV.js} +11 -4
- package/dist/{error-diagnostics-CQ4BUqRe.js → error-diagnostics-kKXseq8d.js} +10 -3
- package/dist/{path-uxLkzrZm.d.ts → errors-CnFDXxeJ.d.ts} +0 -3
- package/dist/{file-CqG9zqiF.js → file-BrNAXQgY.js} +4 -8
- package/dist/{target-Dm9dHAVJ.js → file-metadata-Bpsvjw_X.js} +3 -32
- package/dist/{files-B6wpAhEx.js → files--z2dLC5z.js} +3 -4
- package/dist/files.d.ts +12 -8
- package/dist/files.js +7 -6
- package/dist/{github-DKAlO0Vh.js → github-k--_LCrX.js} +7 -9
- package/dist/{glob-BOqSKzSg.js → glob-BEutagp1.js} +9 -10
- package/dist/{glob-Cjxms1t7.js → glob-BreFjNAV.js} +3 -4
- package/dist/history-schema-BR4UDPHL.d.ts +434 -0
- package/dist/history-schema-postgres-DZepCSBq.js +40 -0
- package/dist/{host-Bf1a2uo_.js → host-C8yZizfk.js} +153 -22
- package/dist/{hosted-zG7HJaE4.js → hosted-8BTKAtMX.js} +27 -21
- package/dist/{hosted-vercel-blob-AbXG8fvR.js → hosted-vercel-blob-B6kygYqn.js} +10 -12
- package/dist/hosted-vercel-blob.d.ts +1 -3
- package/dist/hosted-vercel-blob.js +1 -2
- package/dist/hosted.d.ts +1 -3
- package/dist/hosted.js +1 -2
- package/dist/index.d.ts +11 -41
- package/dist/index.js +34 -116
- package/dist/internal/path.d.ts +1 -1
- package/dist/internal/path.js +1 -2
- package/dist/internal/workspace.d.ts +10 -0
- package/dist/internal/workspace.js +85 -0
- package/dist/{lifecycle-D8FdpBod.js → lifecycle-IReZfi0b.js} +15 -13
- package/dist/lineage.d.ts +1 -3
- package/dist/lineage.js +1 -2
- package/dist/loader.d.ts +1 -7
- package/dist/loader.js +4 -6
- package/dist/{mcp-resources-DntxtmDU.js → mcp-resources-DeJnbOaw.js} +4 -5
- package/dist/{memory-D5jq9HZW.js → memory-BlSRrBH1.js} +19 -13
- package/dist/{metadata-target-DDoOQNp1.js → metadata-target-CaGLY4ay.js} +214 -77
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{operation-definition-nmRu_O3V.d.ts → operation-definition-CqZkx1Rm.d.ts} +8 -6
- package/dist/{operations-DsY2MQnG.js → operations-CtRDU3cA.js} +34 -29
- package/dist/{operations-D8uCpzhM.js → operations-DfbqHWAe.js} +7 -8
- package/dist/operations.d.ts +2 -6
- package/dist/operations.js +2 -2
- package/dist/{path--wrT_Azm.js → path-Bb9OIc_F.js} +3 -19
- package/dist/{path-zHxQUbqa.d.ts → path-C0uZxDdW.d.ts} +0 -2
- package/dist/{path-DrSIenjj.js → path-CuYE8-X6.js} +2 -4
- package/dist/{plugins-CsrXCA1Q.d.ts → plugins-CLc32jvL.d.ts} +1 -3
- package/dist/{provider-sm9uzkLg.js → provider-CN14ewvx.js} +30 -22
- package/dist/providers/github/store.d.ts +2 -4
- package/dist/providers/github/store.js +1 -2
- package/dist/{registry-CFl1Htyc.d.ts → registry-B0g19sdy.d.ts} +5 -8
- package/dist/{registry-DmVfUe4K.js → registry-BbUg9vJB.js} +10 -6
- package/dist/registry-s2Ob9PeX.d.ts +9 -0
- package/dist/{request-scope-Dw5n8bMC.js → request-scope-CXCI_wCb.js} +4 -4
- package/dist/{results-DgkZUmTL.js → results-z-HpV9EP.js} +1 -2
- package/dist/{rolldown-runtime-rQ84J-ij.js → rolldown-runtime-DnNXxpGL.js} +2 -3
- package/dist/rule-keys-BLEbi1h5.js +18 -0
- package/dist/rules-BPDXypZV.js +267 -0
- package/dist/runtime/assets.d.ts +2 -3
- package/dist/runtime/assets.js +5 -6
- package/dist/runtime/empty-assets-registry.d.ts +1 -3
- package/dist/runtime/empty-assets-registry.js +1 -2
- package/dist/runtime/empty-registry.d.ts +2 -4
- package/dist/runtime/empty-registry.js +1 -2
- package/dist/runtime/registry.d.ts +2 -2
- package/dist/runtime/registry.js +2 -3
- package/dist/runtime/request.d.ts +1 -3
- package/dist/runtime/request.js +2 -3
- package/dist/runtime/state.d.ts +5 -4
- package/dist/runtime/state.js +18 -7
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -2
- package/dist/runtime.d.ts +9 -24
- package/dist/runtime.js +29 -25
- package/dist/{search-C_RfoM2j.js → search-C_nVorq7.js} +3 -4
- package/dist/{server-Cd4-iCh5.js → server-aa1a4rkV.js} +8 -10
- package/dist/server.d.ts +3 -4
- package/dist/server.js +1 -2
- package/dist/{shared-ovXVSV3-.js → shared-C20Wh1mp.js} +23 -19
- package/dist/source-metadata.d.ts +2 -6
- package/dist/source-metadata.js +4 -5
- package/dist/state-BdDfBtOR.d.ts +17 -0
- package/dist/{store-NZoRto-Y.js → store-cx3OqNTi.js} +42 -44
- package/dist/{sync-CrT8zjwc.js → sync-BBfR4g5y.js} +6 -7
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -2
- package/dist/{types-1Z-tKK3g.d.ts → types-Bel5IDmF.d.ts} +52 -6
- package/dist/{use-CjbF8EO9.d.ts → use-CpphIBof.d.ts} +20 -32
- package/dist/{use-B0o5HoBl.js → use-D0DyTMxM.js} +19 -21
- package/dist/use-tools-CAK10LTc.d.ts +10 -0
- package/dist/{state-Cb_hIyAw.js → use-tools-CHduR5k6.js} +8 -24
- package/dist/{utils-Dw-WULEZ.js → utils-DXP9xfXo.js} +80 -273
- package/dist/vite.d.ts +30 -19
- package/dist/vite.js +1481 -1617
- package/dist/vitehub-grants-Co713QTg.js +36 -0
- package/dist/workspace-BOuxrZrP.d.ts +5 -0
- package/dist/{workspace-DvKu5PRa.js → workspace-CLuPkyZR.js} +28 -36
- package/package.json +34 -24
- package/dist/registry-CwryP59t.d.ts +0 -9
- package/dist/state-C-YtsaiJ.d.ts +0 -35
- package/dist/workspace-CIXgHeyX.d.ts +0 -7
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { a as workspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-
|
|
3
|
-
import { a as isExcludedWorkspacePath,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as resolveWorkspaceRevisionMaterializer } from "./
|
|
7
|
-
import {
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-DnNXxpGL.js";
|
|
2
|
+
import { a as workspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
3
|
+
import { a as isExcludedWorkspacePath, d as sha256, i as decodeFile, l as normalizeWorkspacePath, r as contentToBytes, s as matchesAny } from "./path-Bb9OIc_F.js";
|
|
4
|
+
import { n as createSnapshotFromEntries, r as diffSnapshots } from "./utils-DXP9xfXo.js";
|
|
5
|
+
import { C as isMissingWorkspacePathError, S as filterSessionEntries, b as assertPathInSessionScope, w as scopedSearchQuery, x as filterSessionDiff, y as assertDiffInsideSessionPaths } from "./workspace-CLuPkyZR.js";
|
|
6
|
+
import { r as resolveWorkspaceRevisionMaterializer } from "./vitehub-grants-Co713QTg.js";
|
|
7
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
8
8
|
import { normalizeExecutionAuthority } from "@vite-hub/runtime";
|
|
9
9
|
import { posix } from "node:path";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
|
-
|
|
11
|
+
// src/session/progress.ts
|
|
12
12
|
async function withWorkspaceProgress(onProgress, event, fn) {
|
|
13
13
|
const startedAt = Date.now();
|
|
14
14
|
await onProgress?.({
|
|
@@ -43,8 +43,72 @@ async function withWorkspaceProgress(onProgress, event, fn) {
|
|
|
43
43
|
throw error;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
// src/session/tar.ts
|
|
47
|
+
const encoder = new TextEncoder();
|
|
48
|
+
function writeField(header, offset, length, value) {
|
|
49
|
+
header.set(encoder.encode(value).subarray(0, length), offset);
|
|
50
|
+
}
|
|
51
|
+
function writeOctal(header, offset, length, value) {
|
|
52
|
+
writeField(header, offset, length, `${value.toString(8).padStart(length - 1, "0")}\0`);
|
|
53
|
+
}
|
|
54
|
+
function tarHeader(name, type, size, mode, mtime, linkname = "") {
|
|
55
|
+
const header = /* @__PURE__ */ new Uint8Array(512);
|
|
56
|
+
writeField(header, 0, 100, name);
|
|
57
|
+
writeOctal(header, 100, 8, mode);
|
|
58
|
+
writeOctal(header, 108, 8, 0);
|
|
59
|
+
writeOctal(header, 116, 8, 0);
|
|
60
|
+
writeOctal(header, 124, 12, size);
|
|
61
|
+
writeOctal(header, 136, 12, mtime);
|
|
62
|
+
header.fill(32, 148, 156);
|
|
63
|
+
writeField(header, 156, 1, type);
|
|
64
|
+
writeField(header, 157, 100, linkname);
|
|
65
|
+
writeField(header, 257, 8, "ustar\x0000");
|
|
66
|
+
let checksum = 0;
|
|
67
|
+
for (const byte of header) checksum += byte;
|
|
68
|
+
writeField(header, 148, 8, `${checksum.toString(8).padStart(6, "0")}\0 `);
|
|
69
|
+
return header;
|
|
70
|
+
}
|
|
71
|
+
function paxRecord(key, value) {
|
|
72
|
+
const body = ` ${key}=${value}\n`;
|
|
73
|
+
const size = encoder.encode(body).byteLength;
|
|
74
|
+
let length = size + String(size).length;
|
|
75
|
+
if (String(length).length !== String(size).length) length = size + String(length).length;
|
|
76
|
+
return `${length}${body}`;
|
|
77
|
+
}
|
|
78
|
+
function padding(size) {
|
|
79
|
+
return new Uint8Array((512 - size % 512) % 512);
|
|
80
|
+
}
|
|
81
|
+
/** Packs the entries into one gzip tar archive. Names longer than the 100-byte ustar field use a PAX header. */
|
|
82
|
+
async function createTarGz(entries, maxBytes) {
|
|
83
|
+
const mtime = Math.floor(Date.now() / 1e3);
|
|
84
|
+
const chunks = [];
|
|
85
|
+
let size = 1024;
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
const start = chunks.length;
|
|
88
|
+
const name = entry.type === "directory" ? `${entry.path}/` : entry.path;
|
|
89
|
+
const linkname = entry.type === "symlink" ? entry.target : "";
|
|
90
|
+
const pax = [encoder.encode(name).byteLength > 100 ? paxRecord("path", name) : "", encoder.encode(linkname).byteLength > 100 ? paxRecord("linkpath", linkname) : ""].join("");
|
|
91
|
+
if (pax) {
|
|
92
|
+
const records = encoder.encode(pax);
|
|
93
|
+
chunks.push(tarHeader("PaxHeader", "x", records.byteLength, 420, mtime), records, padding(records.byteLength));
|
|
94
|
+
}
|
|
95
|
+
if (entry.type === "directory") chunks.push(tarHeader(name, "5", 0, 493, mtime));
|
|
96
|
+
else if (entry.type === "symlink") chunks.push(tarHeader(name, "2", 0, 511, mtime, linkname));
|
|
97
|
+
else chunks.push(tarHeader(name, "0", entry.content.byteLength, entry.executable ? 493 : 420, mtime), entry.content, padding(entry.content.byteLength));
|
|
98
|
+
for (let index = start; index < chunks.length; index++) size += chunks[index].byteLength;
|
|
99
|
+
if (size > maxBytes) return;
|
|
100
|
+
}
|
|
101
|
+
chunks.push(/* @__PURE__ */ new Uint8Array(1024));
|
|
102
|
+
const tar = new Uint8Array(size);
|
|
103
|
+
let offset = 0;
|
|
104
|
+
for (const chunk of chunks) {
|
|
105
|
+
tar.set(chunk, offset);
|
|
106
|
+
offset += chunk.byteLength;
|
|
107
|
+
}
|
|
108
|
+
const compressed = new Blob([tar]).stream().pipeThrough(new CompressionStream("gzip"));
|
|
109
|
+
return new Uint8Array(await new Response(compressed).arrayBuffer());
|
|
110
|
+
}
|
|
111
|
+
// src/session/host.ts
|
|
48
112
|
var host_exports = /* @__PURE__ */ __exportAll({ createHostedWorkspaceSession: () => createHostedWorkspaceSession });
|
|
49
113
|
const publicationQueues = /* @__PURE__ */ new WeakMap();
|
|
50
114
|
const defaultHostInspectionConcurrency = 16;
|
|
@@ -661,6 +725,33 @@ async function extractRevisionArchive(host, root, materialization, signal) {
|
|
|
661
725
|
await removeHostPath(host, root, stagingRoot, true, signal);
|
|
662
726
|
}
|
|
663
727
|
}
|
|
728
|
+
const sessionArchiveMinFiles = 32;
|
|
729
|
+
const sessionArchiveMaxBytes = 67108864;
|
|
730
|
+
async function extractSessionArchive(host, root, archive, signal) {
|
|
731
|
+
const path = posix.join(root, `.vitehub-workspace-${randomUUID()}.tar.gz`);
|
|
732
|
+
signal?.throwIfAborted();
|
|
733
|
+
try {
|
|
734
|
+
await host.files.write(path, archive, { signal });
|
|
735
|
+
signal?.throwIfAborted();
|
|
736
|
+
const extracted = await host.exec("tar", [
|
|
737
|
+
"-xzf",
|
|
738
|
+
path,
|
|
739
|
+
"-C",
|
|
740
|
+
root
|
|
741
|
+
], { signal });
|
|
742
|
+
signal?.throwIfAborted();
|
|
743
|
+
return extracted.code === 0;
|
|
744
|
+
} catch {
|
|
745
|
+
signal?.throwIfAborted();
|
|
746
|
+
return false;
|
|
747
|
+
} finally {
|
|
748
|
+
try {
|
|
749
|
+
if (await host.files.exists(path)) await host.files.remove(path, { recursive: false });
|
|
750
|
+
} finally {
|
|
751
|
+
signal?.throwIfAborted();
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
664
755
|
async function sanitizeHostSymlinks(host, root, abortSignal) {
|
|
665
756
|
const symlinks = (await listHostEntries(host, root, "", true, void 0, false, [], abortSignal)).filter(isGitSymlinkEntry);
|
|
666
757
|
for (const entry of symlinks) {
|
|
@@ -733,22 +824,64 @@ async function materializeWorkspace(workspace, host, root, options, useRevisionM
|
|
|
733
824
|
const symlinks = new Set(entries.filter(isGitSymlinkEntry).map((entry) => entry.path));
|
|
734
825
|
const nested = entries.find((entry) => hasSymlinkParent(entry.path, symlinks));
|
|
735
826
|
if (nested) throw workspaceError(`[vitehub] Workspace path crosses a symlink parent: ${nested.path}.`);
|
|
736
|
-
|
|
737
|
-
abortSignal?.throwIfAborted();
|
|
738
|
-
await host.files.mkdir(toHostPath(root, entry.path), {
|
|
739
|
-
recursive: true,
|
|
740
|
-
signal: abortSignal
|
|
741
|
-
});
|
|
742
|
-
abortSignal?.throwIfAborted();
|
|
743
|
-
}
|
|
827
|
+
const bytes = entries.reduce((total, entry) => total + (entry.size || 0), 0);
|
|
744
828
|
await withWorkspaceProgress(options?.onProgress, {
|
|
745
829
|
data: {
|
|
746
|
-
bytes
|
|
830
|
+
bytes,
|
|
747
831
|
files: files.length
|
|
748
832
|
},
|
|
749
833
|
id: "workspace.prepare.read-files",
|
|
750
834
|
label: "Reading workspace files"
|
|
751
835
|
}, async () => {
|
|
836
|
+
abortSignal?.throwIfAborted();
|
|
837
|
+
const archiveBudget = Math.min(host.archiveMaxBytes ?? 0, sessionArchiveMaxBytes);
|
|
838
|
+
const tryArchive = async () => {
|
|
839
|
+
let remaining = archiveBudget;
|
|
840
|
+
const archive = entries.filter((entry) => entry.type === "directory").map((entry) => ({
|
|
841
|
+
path: entry.path,
|
|
842
|
+
type: "directory"
|
|
843
|
+
}));
|
|
844
|
+
for (const entry of files) {
|
|
845
|
+
abortSignal?.throwIfAborted();
|
|
846
|
+
const symlink = isGitSymlinkEntry(entry);
|
|
847
|
+
const content = symlink && typeof entry.metadata?.symlinkTarget === "string" ? contentToBytes(entry.metadata.symlinkTarget) : contentToBytes(await workspace.readFile(entry.path, { encoding: "binary" }));
|
|
848
|
+
remaining -= content.byteLength;
|
|
849
|
+
if (remaining < 0) return false;
|
|
850
|
+
if (symlink) {
|
|
851
|
+
const target = new TextDecoder().decode(content);
|
|
852
|
+
if (isSafeHostSymlink(root, entry.path, target)) archive.push({
|
|
853
|
+
path: entry.path,
|
|
854
|
+
type: "symlink",
|
|
855
|
+
target
|
|
856
|
+
});
|
|
857
|
+
else {
|
|
858
|
+
matchesRetained = false;
|
|
859
|
+
archive.push({
|
|
860
|
+
path: entry.path,
|
|
861
|
+
type: "file",
|
|
862
|
+
content: contentToBytes(target)
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
} else archive.push({
|
|
866
|
+
path: entry.path,
|
|
867
|
+
type: "file",
|
|
868
|
+
content,
|
|
869
|
+
executable: entry.metadata?.gitMode === "100755"
|
|
870
|
+
});
|
|
871
|
+
if (matchesRetained && !await matchesRetainedWorkspaceFile(workspace, entry, content, retained?.files.get(entry.path))) matchesRetained = false;
|
|
872
|
+
}
|
|
873
|
+
abortSignal?.throwIfAborted();
|
|
874
|
+
const compressed = await createTarGz(archive, archiveBudget);
|
|
875
|
+
return !!compressed && compressed.byteLength <= archiveBudget && await extractSessionArchive(host, root, compressed, abortSignal);
|
|
876
|
+
};
|
|
877
|
+
if (archiveBudget > 0 && files.length >= sessionArchiveMinFiles && bytes <= archiveBudget && await tryArchive()) return;
|
|
878
|
+
for (const entry of entries.filter((entry) => entry.type === "directory")) {
|
|
879
|
+
abortSignal?.throwIfAborted();
|
|
880
|
+
await host.files.mkdir(toHostPath(root, entry.path), {
|
|
881
|
+
recursive: true,
|
|
882
|
+
signal: abortSignal
|
|
883
|
+
});
|
|
884
|
+
}
|
|
752
885
|
abortSignal?.throwIfAborted();
|
|
753
886
|
await mapHostMaterialization(host, files, async (entry) => {
|
|
754
887
|
abortSignal?.throwIfAborted();
|
|
@@ -906,7 +1039,6 @@ async function createHostedWorkspaceSession(workspace, options) {
|
|
|
906
1039
|
assertOpen();
|
|
907
1040
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
908
1041
|
const cwd = normalizeSearchRoot(globOptions?.cwd || "");
|
|
909
|
-
const { matchesAny } = await import("./path--wrT_Azm.js").then((n) => n.u);
|
|
910
1042
|
return filterSessionEntries(await listHostEntries(host, root, "", true), sessionPaths).filter((entry) => {
|
|
911
1043
|
if (entry.type !== "file") return false;
|
|
912
1044
|
if (!cwd) return patterns.some((item) => matchesAny(entry.path, item));
|
|
@@ -917,7 +1049,7 @@ async function createHostedWorkspaceSession(workspace, options) {
|
|
|
917
1049
|
},
|
|
918
1050
|
async search(query) {
|
|
919
1051
|
assertOpen();
|
|
920
|
-
const { searchText } = await import("./search-
|
|
1052
|
+
const { searchText } = await import("./search-C_nVorq7.js").then((n) => n.n);
|
|
921
1053
|
const scoped = scopedSearchQuery(query, sessionPaths, normalizeSearchRoot);
|
|
922
1054
|
if (!scoped) return [];
|
|
923
1055
|
const scopedSearchRoots = [...new Set((scoped.paths?.length ? scoped.paths : [scoped.cwd || ""]).map(normalizeSearchRoot))].filter(Boolean);
|
|
@@ -1093,5 +1225,4 @@ async function createHostedWorkspaceSession(workspace, options) {
|
|
|
1093
1225
|
}
|
|
1094
1226
|
};
|
|
1095
1227
|
}
|
|
1096
|
-
//#endregion
|
|
1097
1228
|
export { host_exports as n, withWorkspaceProgress as r, createHostedWorkspaceSession as t };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { t as createWorkspaceGlobMatcher } from "./glob-
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as createGitHubWorkspaceStore } from "./store-
|
|
12
|
-
import { n as setWorkspaceRuntimeConfig } from "./config-
|
|
1
|
+
import { a as resolveGitHubWorkspaceStore, d as setWorkspaceHostedStoreLoader, i as resolveCloudflareArtifactsStore, u as getWorkspaceHostedStoreLoader } from "./provider-CN14ewvx.js";
|
|
2
|
+
import { a as workspaceConflict, n as assertWorkspaceDigest, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
3
|
+
import { k as getActiveCloudflareBinding } from "./shared-C20Wh1mp.js";
|
|
4
|
+
import { t as copyJsonFileMetadata } from "./file-metadata-Bpsvjw_X.js";
|
|
5
|
+
import { a as isExcludedWorkspacePath, c as normalizeSafeWorkspacePattern, d as sha256, l as normalizeWorkspacePath, r as contentToBytes } from "./path-Bb9OIc_F.js";
|
|
6
|
+
import { t as createWorkspaceGlobMatcher } from "./glob-BreFjNAV.js";
|
|
7
|
+
import { t as workspaceStoreDiscard } from "./discard-BkoLmmmN.js";
|
|
8
|
+
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
9
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
10
|
+
import { n as createSnapshotFromEntries, r as diffSnapshots } from "./utils-DXP9xfXo.js";
|
|
11
|
+
import { t as createGitHubWorkspaceStore } from "./store-cx3OqNTi.js";
|
|
12
|
+
import { n as setWorkspaceRuntimeConfig } from "./config-CsgNNVAI.js";
|
|
13
13
|
import { resolve } from "node:path";
|
|
14
14
|
import { boolean, check, object, optional, parse as parse$1, pipe, record, string, unknown } from "valibot";
|
|
15
|
-
|
|
15
|
+
// src/storage/memory-fs.ts
|
|
16
16
|
function copyBinaryData(data) {
|
|
17
17
|
if (ArrayBuffer.isView(data)) return Uint8Array.from(new Uint8Array(data.buffer, data.byteOffset, data.byteLength));
|
|
18
18
|
if (Object.prototype.toString.call(data) === "[object ArrayBuffer]") return Uint8Array.from(new Uint8Array(data));
|
|
@@ -182,8 +182,7 @@ var MemoryFS = class {
|
|
|
182
182
|
function memoryFsError(code, path) {
|
|
183
183
|
return Object.assign(workspaceErrorDiagnostics.WORKSPACE_R0065({ message: `${code}: ${path}` }), { code });
|
|
184
184
|
}
|
|
185
|
-
|
|
186
|
-
//#region src/providers/cloudflare/artifacts-store.ts
|
|
185
|
+
// src/providers/cloudflare/artifacts-store.ts
|
|
187
186
|
const dir = "/workspace";
|
|
188
187
|
const fileMetadataPath = ".vitehub/files.json";
|
|
189
188
|
const fileMetadataJournalPath = ".vitehub/files.pending.json";
|
|
@@ -251,6 +250,7 @@ var CloudflareArtifactsWorkspaceStore = class {
|
|
|
251
250
|
workspaceName;
|
|
252
251
|
#baseline;
|
|
253
252
|
#branch = "main";
|
|
253
|
+
#digests = /* @__PURE__ */ new WeakMap();
|
|
254
254
|
#files = /* @__PURE__ */ new Map();
|
|
255
255
|
#fs;
|
|
256
256
|
#head;
|
|
@@ -331,7 +331,7 @@ var CloudflareArtifactsWorkspaceStore = class {
|
|
|
331
331
|
if (entry.kind === "file") {
|
|
332
332
|
const fileMetadata = this.#files.get(path);
|
|
333
333
|
entries.push({
|
|
334
|
-
digest: await
|
|
334
|
+
digest: await this.#digest(entry.data),
|
|
335
335
|
mediaType: fileMetadata?.mediaType,
|
|
336
336
|
metadata: structuredClone(fileMetadata?.metadata),
|
|
337
337
|
mtime: entry.mtimeMs,
|
|
@@ -347,6 +347,14 @@ var CloudflareArtifactsWorkspaceStore = class {
|
|
|
347
347
|
}
|
|
348
348
|
return entries.sort((a, b) => a.path.localeCompare(b.path));
|
|
349
349
|
}
|
|
350
|
+
async #digest(data) {
|
|
351
|
+
let digest = this.#digests.get(data);
|
|
352
|
+
if (digest === void 0) {
|
|
353
|
+
digest = await sha256(data);
|
|
354
|
+
this.#digests.set(data, digest);
|
|
355
|
+
}
|
|
356
|
+
return digest;
|
|
357
|
+
}
|
|
350
358
|
async glob(pattern, options = {}) {
|
|
351
359
|
const patterns = Array.isArray(pattern) ? pattern.map(normalizeSafeWorkspacePattern) : normalizeSafeWorkspacePattern(pattern);
|
|
352
360
|
const { cwd, matches } = createWorkspaceGlobMatcher(patterns, options);
|
|
@@ -360,10 +368,10 @@ var CloudflareArtifactsWorkspaceStore = class {
|
|
|
360
368
|
async #stat(normalized) {
|
|
361
369
|
const stat = await this.#fs.promises.stat(this.#absolute(normalized)).catch(() => void 0);
|
|
362
370
|
if (!stat) return void 0;
|
|
363
|
-
const
|
|
371
|
+
const entry = this.#fs.entries.get(this.#fs.normalize(this.#absolute(normalized)));
|
|
364
372
|
const fileMetadata = stat.isFile() ? this.#files.get(normalized) : void 0;
|
|
365
373
|
return {
|
|
366
|
-
digest:
|
|
374
|
+
digest: entry?.kind === "file" ? await this.#digest(entry.data) : void 0,
|
|
367
375
|
mediaType: fileMetadata?.mediaType,
|
|
368
376
|
metadata: structuredClone(fileMetadata?.metadata),
|
|
369
377
|
mtime: stat.mtimeMs,
|
|
@@ -839,8 +847,7 @@ var CloudflareArtifactsWorkspaceStore = class {
|
|
|
839
847
|
function createCloudflareArtifactsWorkspaceStore(options, workspaceName) {
|
|
840
848
|
return new CloudflareArtifactsWorkspaceStore(options, workspaceName);
|
|
841
849
|
}
|
|
842
|
-
|
|
843
|
-
//#region src/hosted.ts
|
|
850
|
+
// src/hosted.ts
|
|
844
851
|
function installHostedGitHubWorkspaceStore() {
|
|
845
852
|
const existingWorkspaceHostedStoreLoader = getWorkspaceHostedStoreLoader();
|
|
846
853
|
setWorkspaceHostedStoreLoader((storeOptions, workspaceName) => {
|
|
@@ -873,5 +880,4 @@ function configureHostedWorkspaceRuntime(options = {}) {
|
|
|
873
880
|
setWorkspaceRuntimeConfig(config);
|
|
874
881
|
return config;
|
|
875
882
|
}
|
|
876
|
-
//#endregion
|
|
877
883
|
export { createCloudflareArtifactsWorkspaceStore as a, installHostedWorkspaceRuntime as i, installHostedCloudflareArtifactsWorkspaceStore as n, installHostedGitHubWorkspaceStore as r, configureHostedWorkspaceRuntime as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { n as setWorkspaceRuntimeConfig } from "./config-
|
|
1
|
+
import { d as setWorkspaceHostedStoreLoader, l as ownedBlobPrefix, o as resolveRuntimeVercelBlobWorkspaceStore, s as resolveVercelBlobWorkspaceStore, u as getWorkspaceHostedStoreLoader } from "./provider-CN14ewvx.js";
|
|
2
|
+
import { a as workspaceConflict, s as workspaceError, t as normalizeSafeWorkspacePath } from "./path-CuYE8-X6.js";
|
|
3
|
+
import { a as isExcludedWorkspacePath, c as normalizeSafeWorkspacePattern, d as sha256, l as normalizeWorkspacePath, r as contentToBytes } from "./path-Bb9OIc_F.js";
|
|
4
|
+
import { t as createWorkspaceGlobMatcher } from "./glob-BreFjNAV.js";
|
|
5
|
+
import { r as diffSnapshots, t as createCurrentSnapshotFromStore } from "./utils-DXP9xfXo.js";
|
|
6
|
+
import { t as workspaceErrorDiagnostics } from "./error-diagnostics-B4me-ouV.js";
|
|
7
|
+
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
8
|
+
import { n as setWorkspaceRuntimeConfig } from "./config-CsgNNVAI.js";
|
|
9
9
|
import { resolve } from "node:path";
|
|
10
|
-
|
|
10
|
+
// src/providers/vercel/blob-store.ts
|
|
11
11
|
const fileMutations = /* @__PURE__ */ new Map();
|
|
12
12
|
async function serializeFileMutation(key, mutate) {
|
|
13
13
|
const pending = (fileMutations.get(key) || Promise.resolve()).catch(() => {}).then(mutate);
|
|
@@ -386,8 +386,7 @@ var VercelBlobWorkspaceStore = class {
|
|
|
386
386
|
function createVercelBlobWorkspaceStore(options, workspaceName) {
|
|
387
387
|
return new VercelBlobWorkspaceStore(options, workspaceName);
|
|
388
388
|
}
|
|
389
|
-
|
|
390
|
-
//#region src/hosted-vercel-blob.ts
|
|
389
|
+
// src/hosted-vercel-blob.ts
|
|
391
390
|
function installHostedVercelBlobWorkspaceRuntime() {
|
|
392
391
|
const existingWorkspaceHostedStoreLoader = getWorkspaceHostedStoreLoader();
|
|
393
392
|
setWorkspaceHostedStoreLoader((storeOptions, workspaceName) => {
|
|
@@ -406,5 +405,4 @@ function configureHostedVercelBlobWorkspaceRuntime(options = {}) {
|
|
|
406
405
|
setWorkspaceRuntimeConfig(config);
|
|
407
406
|
return config;
|
|
408
407
|
}
|
|
409
|
-
//#endregion
|
|
410
408
|
export { installHostedVercelBlobWorkspaceRuntime as n, configureHostedVercelBlobWorkspaceRuntime as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/hosted-vercel-blob.d.ts
|
|
1
|
+
import { T as VercelBlobWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions } from "./types-Bel5IDmF.js";
|
|
3
2
|
export interface HostedVercelBlobWorkspaceRuntimeOptions {
|
|
4
3
|
assets?: boolean | string[];
|
|
5
4
|
env?: Record<string, string | undefined>;
|
|
@@ -10,5 +9,4 @@ export interface HostedVercelBlobWorkspaceRuntimeOptions {
|
|
|
10
9
|
}
|
|
11
10
|
export declare function installHostedVercelBlobWorkspaceRuntime(): void;
|
|
12
11
|
export declare function configureHostedVercelBlobWorkspaceRuntime(options?: HostedVercelBlobWorkspaceRuntimeOptions): ResolvedWorkspaceModuleOptions;
|
|
13
|
-
//#endregion
|
|
14
12
|
export type { VercelBlobWorkspaceStoreOptions };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { configureHostedVercelBlobWorkspaceRuntime, installHostedVercelBlobWorkspaceRuntime };
|
|
1
|
+
export { t as configureHostedVercelBlobWorkspaceRuntime, n as installHostedVercelBlobWorkspaceRuntime } from "./hosted-vercel-blob-B6kygYqn.js";
|
package/dist/hosted.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions
|
|
2
|
-
//#region src/hosted.d.ts
|
|
1
|
+
import { T as VercelBlobWorkspaceStoreOptions, s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions } from "./types-Bel5IDmF.js";
|
|
3
2
|
export type HostedWorkspaceRuntimeStoreOptions = Partial<CloudflareArtifactsWorkspaceStoreOptions> | (Partial<GitHubWorkspaceStoreOptions> & {
|
|
4
3
|
driver: "github";
|
|
5
4
|
}) | (Partial<VercelBlobWorkspaceStoreOptions> & {
|
|
@@ -15,5 +14,4 @@ export declare function installHostedGitHubWorkspaceStore(): void;
|
|
|
15
14
|
export declare function installHostedCloudflareArtifactsWorkspaceStore(): void;
|
|
16
15
|
export declare function installHostedWorkspaceRuntime(): void;
|
|
17
16
|
export declare function configureHostedWorkspaceRuntime(options?: HostedWorkspaceRuntimeOptions): ResolvedWorkspaceModuleOptions;
|
|
18
|
-
//#endregion
|
|
19
17
|
export type { CloudflareArtifactsWorkspaceStoreOptions, GitHubWorkspaceStoreOptions, VercelBlobWorkspaceStoreOptions };
|
package/dist/hosted.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { configureHostedWorkspaceRuntime, installHostedCloudflareArtifactsWorkspaceStore, installHostedGitHubWorkspaceStore, installHostedWorkspaceRuntime };
|
|
1
|
+
export { t as configureHostedWorkspaceRuntime, n as installHostedCloudflareArtifactsWorkspaceStore, r as installHostedGitHubWorkspaceStore, i as installHostedWorkspaceRuntime } from "./hosted-8BTKAtMX.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { FileSourceOptions as FileSourceOptions$1, GitHubSourceOptions as GitHubSourceOptions$1,
|
|
1
|
+
import { $ as WorkspaceHistoryDiffOptions, $t as WorkspaceSourceDefinition, A as WorkspaceAuthor, An as WorkspaceStreamFile, At as WorkspaceOptions, B as WorkspaceDiffEntry, Bn as WorkspaceWriteOperation, Bt as WorkspaceScopeName, C as SourceContextWorkspaceFiles, Cn as WorkspaceSourceSyncResult, Ct as WorkspaceMergeConflict, D as WorkspaceAssetPath, Dn as WorkspaceStoreHistory, Dt as WorkspaceName, E as Workspace, En as WorkspaceStore, Et as WorkspaceMergeResolution, F as WorkspaceContentStream, Fn as WorkspaceWriteCommit, Ft as WorkspaceRetainedHistory, G as WorkspaceFileSourceInput, Gt as WorkspaceSessionHost, H as WorkspaceFetchSourceInput, Hn as WorkspaceWriteValidatorResult, Ht as WorkspaceSearchQuery, I as WorkspaceCustomSourceInput, In as WorkspaceWriteErrorHook, It as WorkspaceRevision, J as WorkspaceHistoryChanges, Jt as WorkspaceSessionOptions, K as WorkspaceGitHubSourceInput, Kt as WorkspaceSessionHostFileEntry, L as WorkspaceDefinition, Ln as WorkspaceWriteHook, Lt as WorkspaceRevisionView, M as WorkspaceCacheOptions, Mn as WorkspaceSyncResultDetails, Mt as WorkspacePrepareSessionProgressEvent, N as WorkspaceCapabilities, Nn as WorkspaceSyncSnapshotOptions, Nt as WorkspacePullRequest, O as WorkspaceAssets, On as WorkspaceStoreHistoryCommitOptions, Ot as WorkspaceNameMap, P as WorkspaceContent, Pn as WorkspaceValidateMode, Pt as WorkspaceRebaseOptions, Q as WorkspaceHistoryDeleteRefOptions, Qt as WorkspaceSourceBindingInput, R as WorkspaceDefinitionInput, Rn as WorkspaceWriteInput, Rt as WorkspaceRule, S as SourceContext, Sn as WorkspaceSourceSyncPolicy, St as WorkspaceMergeCommit, T as VercelBlobWorkspaceStoreOptions, Tn as WorkspaceStat, Tt as WorkspaceMergeOptions, U as WorkspaceFetchSourceRequestOptions, Un as WriteFileOptions, Ut as WorkspaceSelectedScope, V as WorkspaceEntry, Vn as WorkspaceWriteValidator, Vt as WorkspaceSearchHit, W as WorkspaceFile, Wt as WorkspaceSession, X as WorkspaceHistoryCommitBase, Xt as WorkspaceSnapshot, Y as WorkspaceHistoryChangesCommitOptions, Yt as WorkspaceSessionWriteFileOptions, Z as WorkspaceHistoryCommitOptions, Zt as WorkspaceSource, _ as ReadFileResult, _n as WorkspaceSourceResolver, _t as WorkspaceMaterializeMode, a as GitHubWorkspaceOption, an as WorkspaceSourceMount, at as WorkspaceHistoryListResult, b as RmOptions, bn as WorkspaceSourceSyncCounts, bt as WorkspaceMaterializeSourcesResult, c as GlobOptions, cn as WorkspaceSourceRequestExecutionInput, ct as WorkspaceHistoryRefOptions, d as LocalWorkspaceStoreOptions, dn as WorkspaceSourceRequestMethod, dt as WorkspaceInstructionBinding, en as WorkspaceSourceInput, et as WorkspaceHistoryExtensions, f as Logger, fn as WorkspaceSourceResolutionContext, ft as WorkspaceInstructionBindingValue, g as ReadFileOptions, gn as WorkspaceSourceResolutionResult, gt as WorkspaceLookupName, h as MkdirOptions, hn as WorkspaceSourceResolutionInvocation, ht as WorkspaceLoaderSource, i as ExecResult, in as WorkspaceSourceMaterializationStatus, it as WorkspaceHistoryListOptions, j as WorkspaceAutoCommitPlan, jn as WorkspaceSyncOptions, jt as WorkspacePlugin, k as WorkspaceAssetsRegistry, kn as WorkspaceStoreOptions, kt as WorkspaceOpenPullRequestOptions, l as ListOptions, ln as WorkspaceSourceRequestExecutionResult, lt as WorkspaceHookContext, m as MemoryWorkspaceStoreOptions, mn as WorkspaceSourceResolutionContextValueReader, mt as WorkspaceLoader, n as DiffOptions, nn as WorkspaceSourceMaterializationCounts, nt as WorkspaceHistoryFileInput, o as GitHubWorkspaceRefs, on as WorkspaceSourceMountOptions, ot as WorkspaceHistoryReader, p as MaybePromise, pn as WorkspaceSourceResolutionContextMap, pt as WorkspaceLastChange, q as WorkspaceGlobSourceInput, qt as WorkspaceSessionHostFiles, r as ExecOptions, rn as WorkspaceSourceMaterializationPathResult, rt as WorkspaceHistoryFilesCommitOptions, s as GitHubWorkspaceStoreOptions, sn as WorkspaceSourceRequestDescriptor, st as WorkspaceHistoryRef, t as CloudflareArtifactsWorkspaceStoreOptions, tn as WorkspaceSourceItem, tt as WorkspaceHistoryFile, u as LoaderContext, un as WorkspaceSourceRequestExecutor, ut as WorkspaceHooks, v as ResolvedWorkspaceModuleOptions, vn as WorkspaceSourceSelection, vt as WorkspaceMaterializeSourcesOptions, w as ValidatedWorkspaceName, wn as WorkspaceSourceSyncStatus, wt as WorkspaceMergeConflictContext, x as SnapshotOptions, xn as WorkspaceSourceSyncPathResult, xt as WorkspaceMcpResourcesSourceInput, y as ResolvedWorkspaceRule, yn as WorkspaceSourceSyncConfig, yt as WorkspaceMaterializeSourcesProgressEvent, z as WorkspaceDiff, zn as WorkspaceWriteMode, zt as WorkspaceRules } from "./types-Bel5IDmF.js";
|
|
2
|
+
import { t as createWorkspace } from "./workspace-BOuxrZrP.js";
|
|
3
|
+
import { A as WorkspaceTools, C as ShellEnabled, D as WorkspaceShellResult, E as WorkspaceReadOperations, M as WorkspaceWriteToolMap, N as createWorkspaceTools, O as WorkspaceToolOperations, S as EnabledReadCapability, T as WorkspacePathResult, _ as WritableWorkspaceFiles, a as ReadonlyWorkspaceFiles, b as createWorkspaceFileRuntime, c as WorkspaceFacade, d as WorkspaceReadToolSet, f as WorkspaceReadTools, g as WritableWorkspaceFacadeToolOptions, h as WritableWorkspaceFacade, i as ReadonlyWorkspaceFacade, j as WorkspaceWriteOperations, k as WorkspaceToolOptions, l as WorkspaceFacadeToolOptions, m as WorkspaceWriteTools, n as HistoryCheckpoint, o as ReadonlyWorkspaceFs, p as WorkspaceWriteToolSet, r as HistoryCheckpointOptions, s as UseWorkspaceOptions, t as History, u as WorkspaceHistory, v as WritableWorkspaceFs, w as WorkspaceMoveResult, x as useWorkspaceFiles, y as createReadonlyFs } from "./use-CpphIBof.js";
|
|
4
|
+
import { n as isWorkspaceConflict, t as WorkspaceErrorCode } from "./errors-CnFDXxeJ.js";
|
|
5
|
+
import { t as isWorkspaceName } from "./registry-s2Ob9PeX.js";
|
|
6
|
+
import { t as registerWorkspacePlugin } from "./plugins-CLc32jvL.js";
|
|
7
|
+
import { t as useWorkspace } from "./use-tools-CAK10LTc.js";
|
|
8
|
+
import * as source from "@vite-hub/source";
|
|
9
|
+
import { FileSourceOptions as FileSourceOptions$1, GitHubSourceOptions as GitHubSourceOptions$1, sourceIgnores } from "@vite-hub/source";
|
|
10
10
|
import { McpResourceContent, McpResourceDescriptor, McpResourcesClient, McpResourcesClientConfig, McpResourcesRequestOptions, McpResourcesServer, McpResourcesSourceOptions as McpResourcesSourceOptions$1 } from "@vite-hub/source/mcp";
|
|
11
|
-
//#region src/core/define.d.ts
|
|
12
11
|
export declare function defineWorkspace(definition: WorkspaceDefinitionInput): WorkspaceDefinitionInput;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/sources/runtime-options.d.ts
|
|
15
12
|
type ExactOptions$1<TInput, TShape> = TInput & Record<Exclude<keyof TInput, keyof TShape>, never>;
|
|
16
13
|
type WorkspaceSourceRuntimeOptions = Pick<WorkspaceSource, "cache" | "materialize" | "mount" | "sync" | "validate">;
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/sources/custom.d.ts
|
|
19
14
|
type CustomWorkspaceSourceFile = Omit<WorkspaceSourceItem, "content" | "contentStream" | "key" | "path"> & {
|
|
20
15
|
content: WorkspaceContent | ((context: SourceContext) => MaybePromise<WorkspaceContent>);
|
|
21
16
|
path: string;
|
|
@@ -25,14 +20,10 @@ type CustomWorkspaceSourceFiles = WorkspaceSourceRuntimeOptions & Pick<Workspace
|
|
|
25
20
|
};
|
|
26
21
|
export declare function custom<const TSource extends CustomWorkspaceSourceFiles>(source: ExactOptions$1<TSource, CustomWorkspaceSourceFiles>): WorkspaceSource;
|
|
27
22
|
export declare function custom<const TSource extends WorkspaceSource>(source: ExactOptions$1<TSource, WorkspaceSource>): WorkspaceSource;
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/sources/file.d.ts
|
|
30
23
|
type FileWorkspaceSourceRuntimeOptions = WorkspaceSourceRuntimeOptions & Pick<WorkspaceSource, "probeKeys">;
|
|
31
24
|
type FileSourceOptions<TKey extends string = string> = FileSourceOptions$1<TKey> & FileWorkspaceSourceRuntimeOptions;
|
|
32
25
|
export declare function file<const TKey extends string>(input: TKey): WorkspaceSource;
|
|
33
26
|
export declare function file<const TKey extends string = string, const TOptions extends FileSourceOptions<TKey> = FileSourceOptions<TKey>>(input: ExactOptions$1<TOptions, FileSourceOptions<TKey>>): WorkspaceSource;
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/sources/fetch.d.ts
|
|
36
27
|
type FetchSourceMethod = "GET" | "HEAD" | "POST";
|
|
37
28
|
type FetchSourceResponseType = "json" | "text";
|
|
38
29
|
interface FetchSourceStandardSchemaResultSuccess<T = unknown> {
|
|
@@ -104,8 +95,6 @@ type FetchSourceInput<TResponse = unknown, TOutput = TResponse> = FetchSourceOpt
|
|
|
104
95
|
export declare function url<TResponse = unknown, TOutput = TResponse>(options: ExactOptions<FetchSourceOptions<TResponse, TOutput>, FetchSourceOptions<TResponse, TOutput>>): WorkspaceSource;
|
|
105
96
|
export declare function url<const TOptions extends FetchSourceOptions<any, any>>(options: ExactOptions<TOptions, FetchSourceOptions<any, any>>): WorkspaceSource;
|
|
106
97
|
export declare function url<TResponse = unknown, TOutput = TResponse>(resolve: FetchSourceResolver<TResponse, TOutput>): WorkspaceSource;
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/sources/github.d.ts
|
|
109
98
|
type GitHubAuth = NonNullable<GitHubSourceOptions$1["auth"]>;
|
|
110
99
|
type GitHubResolvedSourceOptions = Omit<GitHubSourceOptions, "repo"> & Partial<Pick<GitHubSourceOptions, "repo">>;
|
|
111
100
|
interface GitHubSourceOptions extends Omit<GitHubSourceOptions$1, "auth" | "ignore">, WorkspaceSourceRuntimeOptions {
|
|
@@ -117,31 +106,12 @@ type GitHubSourceResolver = (context: WorkspaceSourceResolutionContext) => Maybe
|
|
|
117
106
|
type GitHubSourceInput = GitHubSourceOptions | GitHubSourceResolver;
|
|
118
107
|
export declare function github<const TOptions extends GitHubSourceOptions>(options: ExactOptions$1<TOptions, GitHubSourceOptions>): WorkspaceSource;
|
|
119
108
|
export declare function github(resolve: GitHubSourceResolver): WorkspaceSource;
|
|
120
|
-
|
|
121
|
-
//#region src/sources/glob.d.ts
|
|
122
|
-
type GlobSourceOptions = GlobSourceOptions$1 & WorkspaceSourceRuntimeOptions;
|
|
109
|
+
type GlobSourceOptions = source.GlobSourceOptions & WorkspaceSourceRuntimeOptions;
|
|
123
110
|
export declare function glob<const TOptions extends GlobSourceOptions>(options: ExactOptions$1<TOptions, GlobSourceOptions>): WorkspaceSource;
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/sources/markdown.d.ts
|
|
126
111
|
export declare function markdown(options: FileSourceOptions): WorkspaceSource;
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/sources/mcp-resources.d.ts
|
|
129
112
|
interface McpResourcesSourceOptions<TKey extends string = string> extends Omit<McpResourcesSourceOptions$1<TKey>, "cache">, WorkspaceSourceRuntimeOptions {}
|
|
130
113
|
export declare function mcpResources<const TKey extends string = string, const TOptions extends McpResourcesSourceOptions<TKey> = McpResourcesSourceOptions<TKey>>(options: ExactOptions$1<TOptions, McpResourcesSourceOptions<TKey>>): WorkspaceSource;
|
|
131
114
|
declare namespace index_d_exports {
|
|
132
115
|
export { FetchSourceInput, FetchSourceOptions, FetchSourceRequest, FetchSourceRequestOptions, FetchSourceResolver, FileSourceOptions, GitHubSourceInput, GitHubSourceOptions, GitHubSourceResolver, GlobSourceOptions, McpResourceContent, McpResourceDescriptor, McpResourcesClient, McpResourcesClientConfig, McpResourcesRequestOptions, McpResourcesServer, McpResourcesSourceOptions, custom, file, github, glob, markdown, mcpResources, url };
|
|
133
116
|
}
|
|
134
|
-
|
|
135
|
-
//#region src/core/rules.d.ts
|
|
136
|
-
export declare function resolveWorkspaceAutoCommit(definition: WorkspaceDefinition, diff: WorkspaceDiff): WorkspaceAutoCommitPlan | undefined;
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/core/glob-pattern.d.ts
|
|
139
|
-
interface WorkspaceGlobPatternLimits {
|
|
140
|
-
maxBytes: number;
|
|
141
|
-
maxComplexity: number;
|
|
142
|
-
maxPatterns: number;
|
|
143
|
-
}
|
|
144
|
-
export declare const modelWorkspaceGlobPatternLimits: Readonly<WorkspaceGlobPatternLimits>;
|
|
145
|
-
export declare function assertModelWorkspaceGlobPattern(pattern: string | readonly string[], limits?: Readonly<WorkspaceGlobPatternLimits>): void;
|
|
146
|
-
//#endregion
|
|
147
|
-
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 GitHubWorkspaceRefs, type GitHubWorkspaceStoreOptions, type GlobOptions, type GlobSourceOptions, type History, type HistoryCheckpoint, type HistoryCheckpointOptions, 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 ReadFileOptions, type ReadFileResult, type ReadonlyWorkspaceFacade, type ReadonlyWorkspaceFiles, 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 WorkspaceAuthor, type WorkspaceAutoCommitPlan, type WorkspaceCacheOptions, type WorkspaceCapabilities, 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 WorkspaceGlobPatternLimits, type WorkspaceGlobSourceInput, type WorkspaceHistory, type WorkspaceHistoryChanges, type WorkspaceHistoryChangesCommitOptions, type WorkspaceHistoryCommitBase, type WorkspaceHistoryCommitOptions, type WorkspaceHistoryExtensions, type WorkspaceHistoryFile, type WorkspaceHistoryFileInput, type WorkspaceHistoryFilesCommitOptions, type WorkspaceHistoryListOptions, type WorkspaceHistoryListResult, type WorkspaceHistoryReader, type WorkspaceHistoryRef, type WorkspaceHistoryRefOptions, type WorkspaceHookContext, type WorkspaceHooks, type WorkspaceInstructionBinding, type WorkspaceInstructionBindingValue, type WorkspaceLastChange, type WorkspaceLoader, type WorkspaceLoaderSource, type WorkspaceMaterializeMode, type WorkspaceMaterializeSourcesOptions, type WorkspaceMaterializeSourcesProgressEvent, type WorkspaceMaterializeSourcesResult, type WorkspaceMcpResourcesSourceInput, type WorkspaceMergeCommit, type WorkspaceMergeConflict, type WorkspaceMergeConflictContext, type WorkspaceMergeOptions, type WorkspaceMergeResolution, type WorkspaceMoveResult, type WorkspaceName, type WorkspaceNameMap, type WorkspaceOpenPullRequestOptions, type WorkspaceOptions, type WorkspacePathResult, type WorkspacePlugin, type WorkspacePrepareSessionProgressEvent, type WorkspacePullRequest, type WorkspaceReadOperations, type WorkspaceReadToolSet, type WorkspaceReadTools, type WorkspaceRebaseOptions, type WorkspaceRetainedHistory, type WorkspaceRevision, type WorkspaceRevisionView, type WorkspaceRule, type WorkspaceRules, type WorkspaceScopeName, type WorkspaceSearchHit, type WorkspaceSearchQuery, type WorkspaceSelectedScope, type WorkspaceSession, type WorkspaceSessionHost, type WorkspaceSessionHostFileEntry, type WorkspaceSessionHostFiles, type WorkspaceSessionOptions, type WorkspaceSessionWriteFileOptions, type WorkspaceShellResult, type WorkspaceSnapshot, type WorkspaceSource, type WorkspaceSourceBindingInput, type WorkspaceSourceDefinition, type WorkspaceSourceInput, type WorkspaceSourceItem, type WorkspaceSourceMaterializationCounts, type WorkspaceSourceMaterializationPathResult, 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 WorkspaceStoreHistory, type WorkspaceStoreHistoryCommitOptions, type WorkspaceStoreOptions, type WorkspaceStoreTarget, type WorkspaceStreamFile, type WorkspaceSyncOptions, type WorkspaceSyncResultDetails, type WorkspaceSyncSnapshotOptions, type WorkspaceToolOperations, type WorkspaceToolOptions, type WorkspaceTools, type WorkspaceValidateMode, type WorkspaceWriteCommit, 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 WritableWorkspaceFiles, type WritableWorkspaceFs, type WriteFileOptions, type createReadonlyFs, createWorkspace, type createWorkspaceFileRuntime, createWorkspaceTools, invalidateWorkspaceStore, isWorkspaceConflict, normalizeSafeWorkspacePath, registerWorkspacePlugin, resolveRegisteredWorkspaceDefinition, resolveWorkspaceStoreTarget, index_d_exports as source, sourceIgnores, useWorkspace, useWorkspaceFiles };
|
|
117
|
+
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 GitHubWorkspaceRefs, type GitHubWorkspaceStoreOptions, type GlobOptions, type GlobSourceOptions, type History, type HistoryCheckpoint, type HistoryCheckpointOptions, 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 ReadFileOptions, type ReadFileResult, type ReadonlyWorkspaceFacade, type ReadonlyWorkspaceFiles, type ReadonlyWorkspaceFs, type ResolvedWorkspaceModuleOptions, type ResolvedWorkspaceRule, type RmOptions, type ShellEnabled, type SnapshotOptions, type SourceContext, type SourceContextWorkspaceFiles, type UseWorkspaceOptions, type ValidatedWorkspaceName, type VercelBlobWorkspaceStoreOptions, type Workspace, type WorkspaceAssetPath, type WorkspaceAssets, type WorkspaceAssetsRegistry, type WorkspaceAuthor, type WorkspaceAutoCommitPlan, type WorkspaceCacheOptions, type WorkspaceCapabilities, 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 WorkspaceHistory, type WorkspaceHistoryChanges, type WorkspaceHistoryChangesCommitOptions, type WorkspaceHistoryCommitBase, type WorkspaceHistoryCommitOptions, type WorkspaceHistoryDeleteRefOptions, type WorkspaceHistoryDiffOptions, type WorkspaceHistoryExtensions, type WorkspaceHistoryFile, type WorkspaceHistoryFileInput, type WorkspaceHistoryFilesCommitOptions, type WorkspaceHistoryListOptions, type WorkspaceHistoryListResult, type WorkspaceHistoryReader, type WorkspaceHistoryRef, type WorkspaceHistoryRefOptions, type WorkspaceHookContext, type WorkspaceHooks, type WorkspaceInstructionBinding, type WorkspaceInstructionBindingValue, type WorkspaceLastChange, type WorkspaceLoader, type WorkspaceLoaderSource, type WorkspaceLookupName, type WorkspaceMaterializeMode, type WorkspaceMaterializeSourcesOptions, type WorkspaceMaterializeSourcesProgressEvent, type WorkspaceMaterializeSourcesResult, type WorkspaceMcpResourcesSourceInput, type WorkspaceMergeCommit, type WorkspaceMergeConflict, type WorkspaceMergeConflictContext, type WorkspaceMergeOptions, type WorkspaceMergeResolution, type WorkspaceMoveResult, type WorkspaceName, type WorkspaceNameMap, type WorkspaceOpenPullRequestOptions, type WorkspaceOptions, type WorkspacePathResult, type WorkspacePlugin, type WorkspacePrepareSessionProgressEvent, type WorkspacePullRequest, type WorkspaceReadOperations, type WorkspaceReadToolSet, type WorkspaceReadTools, type WorkspaceRebaseOptions, type WorkspaceRetainedHistory, type WorkspaceRevision, type WorkspaceRevisionView, type WorkspaceRule, type WorkspaceRules, type WorkspaceScopeName, type WorkspaceSearchHit, type WorkspaceSearchQuery, type WorkspaceSelectedScope, type WorkspaceSession, type WorkspaceSessionHost, type WorkspaceSessionHostFileEntry, type WorkspaceSessionHostFiles, type WorkspaceSessionOptions, type WorkspaceSessionWriteFileOptions, type WorkspaceShellResult, type WorkspaceSnapshot, type WorkspaceSource, type WorkspaceSourceBindingInput, type WorkspaceSourceDefinition, type WorkspaceSourceInput, type WorkspaceSourceItem, type WorkspaceSourceMaterializationCounts, type WorkspaceSourceMaterializationPathResult, 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 WorkspaceStoreHistory, type WorkspaceStoreHistoryCommitOptions, type WorkspaceStoreOptions, type WorkspaceStreamFile, type WorkspaceSyncOptions, type WorkspaceSyncResultDetails, type WorkspaceSyncSnapshotOptions, type WorkspaceToolOperations, type WorkspaceToolOptions, type WorkspaceTools, type WorkspaceValidateMode, type WorkspaceWriteCommit, 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 WritableWorkspaceFiles, type WritableWorkspaceFs, type WriteFileOptions, type createReadonlyFs, createWorkspace, type createWorkspaceFileRuntime, createWorkspaceTools, isWorkspaceConflict, isWorkspaceName, registerWorkspacePlugin, index_d_exports as source, sourceIgnores, useWorkspace, useWorkspaceFiles };
|