@vite-hub/workspace 0.1.0 → 0.3.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 +164 -107
- package/dist/abort-BCwpdrN0.js +32 -0
- package/dist/blob-database.d.ts +70 -117
- package/dist/blob-database.js +48 -41
- package/dist/checkout.d.ts +128 -0
- package/dist/checkout.js +849 -0
- package/dist/cloudflare.d.ts +2 -2
- package/dist/cloudflare.js +1 -1
- package/dist/config-B-863EgC.js +15 -0
- package/dist/{config-B7dmzDX3.js → config-BAgL2dtB.js} +48 -84
- package/dist/{config-DLKdaFWN.d.ts → config-BQKcPawI.d.ts} +1 -1
- package/dist/discard-CNNtCozM.js +8 -0
- package/dist/durability.d.ts +22 -0
- package/dist/durability.js +70 -0
- package/dist/error-diagnostics-CtKjGtGb.js +188 -0
- package/dist/error-diagnostics-DSkCJC_L.js +266 -0
- package/dist/file-2pFYNtsU.js +22 -0
- package/dist/{files-C7Px8uaC.js → files-BOo4SbwE.js} +2 -2
- package/dist/files.d.ts +38 -0
- package/dist/files.js +6 -0
- package/dist/{github-CPxHtFB7.js → github-CrYp4v8k.js} +32 -5
- package/dist/{glob--XcLlcml.js → glob-B8YGvTrZ.js} +4 -5
- package/dist/{glob--kNYDbfU.js → glob-Cjxms1t7.js} +1 -1
- package/dist/{host-CFnrTXTK.js → host-BFBpXn0N.js} +58 -47
- package/dist/{hosted-acMA5XyL.js → hosted-KcUR_jPv.js} +216 -93
- package/dist/hosted-vercel-blob-B3-wRdUm.js +410 -0
- package/dist/hosted-vercel-blob.d.ts +2 -2
- package/dist/hosted-vercel-blob.js +1 -1
- package/dist/hosted.d.ts +5 -3
- package/dist/hosted.js +2 -2
- package/dist/index.d.ts +9 -51
- package/dist/index.js +21 -91
- package/dist/{lifecycle-BwZ7c9hb.js → lifecycle-B-enk_4A.js} +8 -8
- package/dist/lineage.d.ts +26 -0
- package/dist/lineage.js +76 -0
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +2 -2
- package/dist/{mcp-resources-BREFCmtn.js → mcp-resources-DF0F5rcL.js} +2 -2
- package/dist/{memory-BbwOqDXl.js → memory-BOexthyW.js} +3 -4
- package/dist/{metadata-target-DZEZQGHA.js → metadata-target-CWz6KHKq.js} +17 -16
- package/dist/object-Da1zyPCR.js +11 -0
- package/dist/operation-definition-8gOe-ubD.d.ts +234 -0
- package/dist/operations-C6FpR8Rr.js +389 -0
- package/dist/operations-CE2drFih.js +1234 -0
- package/dist/operations.d.ts +41 -4
- package/dist/operations.js +3 -2
- package/dist/{path-CNAwN7pw.js → path--wrT_Azm.js} +2 -3
- package/dist/path-AxMho1wo.d.ts +7 -0
- package/dist/{plugins-DqQ8b4T5.d.ts → plugins-C8C0auoW.d.ts} +1 -1
- package/dist/{provider-kXjfli9u.js → provider-9s4Ufkm5.js} +104 -82
- package/dist/providers/github/store.d.ts +1 -1
- package/dist/providers/github/store.js +1 -1
- package/dist/registry-B3BBm4Ts.d.ts +19 -0
- package/dist/{registry-Bp-8UUfG.js → registry-CNphafBx.js} +55 -20
- package/dist/registry-CYNN623b.d.ts +9 -0
- package/dist/request-scope-Dw5n8bMC.js +83 -0
- package/dist/results-DgkZUmTL.js +8 -0
- package/dist/{rolldown-runtime-B4iAMlE-.js → rolldown-runtime-rQ84J-ij.js} +2 -3
- package/dist/runtime/assets.d.ts +1 -1
- package/dist/runtime/assets.js +3 -3
- package/dist/runtime/empty-assets-registry.d.ts +1 -1
- package/dist/runtime/empty-registry.d.ts +2 -1
- package/dist/runtime/registry.d.ts +2 -0
- package/dist/runtime/registry.js +23 -0
- package/dist/runtime/request.d.ts +4 -0
- package/dist/runtime/request.js +8 -0
- package/dist/runtime/state.d.ts +5 -4
- package/dist/runtime/state.js +8 -18
- package/dist/runtime/workspace.d.ts +1 -1
- package/dist/runtime/workspace.js +1 -1
- package/dist/runtime.d.ts +9 -8
- package/dist/runtime.js +23 -26
- package/dist/{search-CrTmXj5h.js → search-C_RfoM2j.js} +2 -2
- package/dist/{server-BNQ-Nbjj.js → server-8tGltlGz.js} +53 -40
- package/dist/server.d.ts +17 -8
- package/dist/server.js +1 -1
- package/dist/shared-B3_EUk89.js +848 -0
- package/dist/source-metadata.d.ts +6 -2
- package/dist/source-metadata.js +8 -8
- package/dist/state-BISnUf1s.d.ts +35 -0
- package/dist/{ai-BZyLwULx.js → state-DbrW-njQ.js} +96 -54
- package/dist/{store-CXgmu-uw.js → store-ybhyD38Z.js} +250 -106
- package/dist/{sync-CN6ec-5M.js → sync-CCD_VYC8.js} +4 -4
- package/dist/target-jWhTdIuF.js +89 -0
- package/dist/test.d.ts +1 -1
- package/dist/test.js +1 -1
- package/dist/{types-DeK9GIxy.d.ts → types-BbtwmBZ5.d.ts} +68 -14
- package/dist/use-C6lV3-wC.d.ts +321 -0
- package/dist/{use-BQj7nSz6.js → use-CSpT5W87.js} +75 -82
- package/dist/{utils-Blrh4N2n.js → utils-CgMZCHsX.js} +112 -41
- package/dist/vite.d.ts +585 -2
- package/dist/vite.js +21368 -1
- package/dist/{workspace-BWJQBK1u.d.ts → workspace-CYB2xZ1T.d.ts} +1 -1
- package/dist/{workspace-6pxkOuxr.js → workspace-sPWn2Jxj.js} +125 -40
- package/package.json +46 -55
- package/dist/ai-BW2ZhizI.d.ts +0 -177
- package/dist/ai.d.ts +0 -3
- package/dist/ai.js +0 -2
- package/dist/association-Cm0dUTDU-CDDhJnIh-Cv3bWnVb.js +0 -19
- package/dist/error-diagnostics-A_8Kp-48.js +0 -116
- package/dist/error-diagnostics-DY5GP47p.js +0 -96
- package/dist/events-7EBoeIPd-A2RUkJi5-BxrICQ17.js +0 -354
- package/dist/events-CRaLy7U3-3PNNp5WZ-Gv9nd0cH.js +0 -214
- package/dist/events-CeChclTf-CX-gD8oy-4aL2j6V-.js +0 -527
- package/dist/feed-DsC7Vws1-M_de2nSK-tKc0Pwo8.js +0 -248
- package/dist/feed-Dyf730Ys-D0HgBba6-BUnCa5gS.js +0 -179
- package/dist/file-C0_aPWSS.js +0 -26
- package/dist/file-metadata-CxDy-E2H.js +0 -58
- package/dist/forgejo-BN8ItCfl-Bbn4vhDd.js +0 -2278
- package/dist/github-DtncTfmv-Du2S8lGF.js +0 -4159
- package/dist/gitlab-BoDm8-BC-xzZsW9eW.js +0 -2530
- package/dist/graphql-DG5aJBT3-DceyFYdM-C4saqX37.js +0 -489
- package/dist/hosted-vercel-blob-DKntsHaf.js +0 -12603
- package/dist/inspect-BoObD2cJ.js +0 -167
- package/dist/mountx.d.ts +0 -8
- package/dist/mountx.js +0 -145
- package/dist/nitro.d.ts +0 -2
- package/dist/nitro.js +0 -2
- package/dist/nuxt.d.ts +0 -27
- package/dist/nuxt.js +0 -38
- package/dist/operations-BcpWr41m.js +0 -159
- package/dist/operations-CGqY1XeG.js +0 -965
- package/dist/operations-DnOwKsJT.d.ts +0 -136
- package/dist/registry-Cg1TJVVZ.d.ts +0 -10
- package/dist/request-execution-Dk9rY-Yh.js +0 -84
- package/dist/shared-DalXdP0i.js +0 -2158
- package/dist/state-B8zbLi5t.d.ts +0 -26
- package/dist/target-D4Bqb1eH.js +0 -11
- package/dist/templates-Bn8a-pd2-D9DhJEVD-CBfXNRzz.js +0 -125
- package/dist/token-CO62GglH.js +0 -61
- package/dist/use-DhwhbAVV.d.ts +0 -108
- package/dist/vite-BEvgU2GY.js +0 -20909
- package/dist/vite-CcZmMQ7S.d.ts +0 -476
- package/dist/webhooks-DgHwxxYz-D1V2LOr1-azofFOiP.js +0 -1565
package/dist/state-B8zbLi5t.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { O as WorkspaceAssetsRegistry, bn as WorkspaceStore, s as GitHubWorkspaceStoreOptions, t as CloudflareArtifactsWorkspaceStoreOptions, v as ResolvedWorkspaceModuleOptions, w as VercelBlobWorkspaceStoreOptions } from "./types-DeK9GIxy.js";
|
|
2
|
-
import "./use-DhwhbAVV.js";
|
|
3
|
-
import { t as WorkspaceRegistry } from "./registry-Cg1TJVVZ.js";
|
|
4
|
-
//#region ../internal/src/runtime/cloudflare-env.d.ts
|
|
5
|
-
type CloudflareWorkerEnv = Record<string, unknown>;
|
|
6
|
-
declare function setActiveCloudflareEnv(env: CloudflareWorkerEnv | undefined): void;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/core/workspace-cache.d.ts
|
|
9
|
-
declare function resetWorkspaceStoreCache(): void;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/runtime/hosted-store-loader.d.ts
|
|
12
|
-
type HostedWorkspaceStoreOptions = CloudflareArtifactsWorkspaceStoreOptions | GitHubWorkspaceStoreOptions | VercelBlobWorkspaceStoreOptions;
|
|
13
|
-
type WorkspaceHostedStoreLoader = (options: HostedWorkspaceStoreOptions, workspaceName: string) => WorkspaceStore;
|
|
14
|
-
declare function setWorkspaceHostedStoreLoader(loader: WorkspaceHostedStoreLoader | undefined): void;
|
|
15
|
-
declare function getWorkspaceHostedStoreLoader(): WorkspaceHostedStoreLoader | undefined;
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/runtime/config.d.ts
|
|
18
|
-
declare function setWorkspaceRuntimeConfig(config: false | ResolvedWorkspaceModuleOptions): void;
|
|
19
|
-
declare function getWorkspaceRuntimeConfig(): false | ResolvedWorkspaceModuleOptions;
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/runtime/state.d.ts
|
|
22
|
-
declare function invalidateWorkspaceStore(name: string): Promise<void>;
|
|
23
|
-
declare function setWorkspaceRuntimeRegistry(registry: WorkspaceRegistry): void;
|
|
24
|
-
declare function setWorkspaceRuntimeAssetsRegistry(registry: WorkspaceAssetsRegistry): void;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { setWorkspaceRuntimeConfig as a, getWorkspaceHostedStoreLoader as c, setActiveCloudflareEnv as d, getWorkspaceRuntimeConfig as i, setWorkspaceHostedStoreLoader as l, setWorkspaceRuntimeAssetsRegistry as n, HostedWorkspaceStoreOptions as o, setWorkspaceRuntimeRegistry as r, WorkspaceHostedStoreLoader as s, invalidateWorkspaceStore as t, resetWorkspaceStoreCache as u };
|
package/dist/target-D4Bqb1eH.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/storage/target.ts
|
|
2
|
-
const workspaceStoreTarget = Symbol.for("vitehub.workspace.storeTarget");
|
|
3
|
-
function forwardWorkspaceStoreTarget(source, target) {
|
|
4
|
-
const resolveTarget = source[workspaceStoreTarget];
|
|
5
|
-
if (resolveTarget) target[workspaceStoreTarget] = resolveTarget.bind(source);
|
|
6
|
-
}
|
|
7
|
-
async function resolveWorkspaceStoreTarget(source) {
|
|
8
|
-
return await source[workspaceStoreTarget]?.();
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { resolveWorkspaceStoreTarget as n, workspaceStoreTarget as r, forwardWorkspaceStoreTarget as t };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { F as NotFoundError, pt as mapConcurrent } from "./shared-DalXdP0i.js";
|
|
2
|
-
//#region ../forge/dist/templates-Bn8a-pd2-D9DhJEVD.js
|
|
3
|
-
/** Where GitHub looks for a pull request template and the legacy issue template, in its order of precedence. */
|
|
4
|
-
const LOCATIONS = [
|
|
5
|
-
".github",
|
|
6
|
-
"",
|
|
7
|
-
"docs"
|
|
8
|
-
];
|
|
9
|
-
const ISSUE_TEMPLATE = /\.(?:md|ya?ml)$/i;
|
|
10
|
-
const ISSUE_FORM = /\.ya?ml$/i;
|
|
11
|
-
const CHOOSER_CONFIG = /^config\.ya?ml$/i;
|
|
12
|
-
const CONTENTS_OWNER = /\/repos\/([^/]+)\/[^/]+\/contents(?:[/?]|$)/;
|
|
13
|
-
/** No REST endpoint for templates, and GraphQL's `issueTemplates` skips issue forms, so this walks the folders GitHub reads. */
|
|
14
|
-
async function readTemplates(repo, kinds, reader) {
|
|
15
|
-
const root = await rootOf(repo, reader);
|
|
16
|
-
const own = await templatesOf(repo, root.entries, kinds, reader);
|
|
17
|
-
const missing = kinds.filter((kind) => kind === "issue" ? !own.ownsIssues : !own.templates.some((template) => template.kind === kind));
|
|
18
|
-
if (!missing.length || repo.name.toLowerCase() === ".github") return own.templates;
|
|
19
|
-
const source = {
|
|
20
|
-
forge: repo.forge,
|
|
21
|
-
instance: repo.instance,
|
|
22
|
-
owner: root.owner,
|
|
23
|
-
name: ".github"
|
|
24
|
-
};
|
|
25
|
-
const fallback = await fallbackOf(source, missing, reader);
|
|
26
|
-
return [...own.templates, ...fallback.map((template) => ({
|
|
27
|
-
...template,
|
|
28
|
-
source
|
|
29
|
-
}))];
|
|
30
|
-
}
|
|
31
|
-
/** The root of the default branch, and the owner the repository lives under now, which differs from `repo.owner` after a transfer. */
|
|
32
|
-
async function rootOf(repo, reader) {
|
|
33
|
-
try {
|
|
34
|
-
const entries = await reader.list(repo, "");
|
|
35
|
-
const owner = entries.map((entry) => entry.url && CONTENTS_OWNER.exec(new URL(entry.url).pathname)?.[1]).find(Boolean);
|
|
36
|
-
return {
|
|
37
|
-
entries,
|
|
38
|
-
owner: owner ? decodeURIComponent(owner) : repo.owner
|
|
39
|
-
};
|
|
40
|
-
} catch (error) {
|
|
41
|
-
if (!(error instanceof NotFoundError)) throw error;
|
|
42
|
-
return {
|
|
43
|
-
entries: [],
|
|
44
|
-
owner: (await reader.repository(repo)).owner?.login ?? repo.owner
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/** The owner's `.github` repository serves defaults only while it is public, or internal in an enterprise. */
|
|
49
|
-
async function fallbackOf(source, kinds, reader) {
|
|
50
|
-
let detail;
|
|
51
|
-
try {
|
|
52
|
-
detail = await reader.repository(source);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
if (error instanceof NotFoundError) return [];
|
|
55
|
-
throw error;
|
|
56
|
-
}
|
|
57
|
-
if (detail.visibility ? detail.visibility === "private" : detail.private) return [];
|
|
58
|
-
return (await templatesOf(source, await orEmpty(reader.list(source, "")), kinds, reader)).templates;
|
|
59
|
-
}
|
|
60
|
-
/** A chooser `config.yml` alone still makes issue templates the repository's own, while any other file there doesn't. */
|
|
61
|
-
async function templatesOf(repo, root, kinds, reader) {
|
|
62
|
-
const locations = await Promise.all(LOCATIONS.map((directory) => !directory ? root : root.some((entry) => entry.type === "dir" && entry.name === directory) ? orEmpty(reader.list(repo, directory)) : []));
|
|
63
|
-
const folder = async (entries, name) => {
|
|
64
|
-
const found = entries.find((entry) => entry.type === "dir" && entry.name.toLowerCase() === name);
|
|
65
|
-
return found ? (await orEmpty(reader.list(repo, found.path))).filter((entry) => entry.type === "file") : [];
|
|
66
|
-
};
|
|
67
|
-
const [issueFiles, pullFiles] = await Promise.all([kinds.includes("issue") ? folder(locations[0], "issue_template") : [], kinds.includes("pull_request") ? folder(locations.flat(), "pull_request_template") : []]);
|
|
68
|
-
const found = [];
|
|
69
|
-
let ownsIssues = false;
|
|
70
|
-
if (kinds.includes("issue")) {
|
|
71
|
-
const templates = issueFiles.filter((entry) => ISSUE_TEMPLATE.test(entry.name) && !CHOOSER_CONFIG.test(entry.name));
|
|
72
|
-
const legacy = firstFile(locations, "issue_template");
|
|
73
|
-
if (templates.length) {
|
|
74
|
-
const forms = templates.filter((entry) => ISSUE_FORM.test(entry.name));
|
|
75
|
-
found.push(...forms.map((entry) => ({
|
|
76
|
-
kind: "issue",
|
|
77
|
-
format: "form",
|
|
78
|
-
entry
|
|
79
|
-
})), ...templates.filter((entry) => !forms.includes(entry)).map((entry) => ({
|
|
80
|
-
kind: "issue",
|
|
81
|
-
format: "markdown",
|
|
82
|
-
entry
|
|
83
|
-
})));
|
|
84
|
-
} else if (legacy) found.push({
|
|
85
|
-
kind: "issue",
|
|
86
|
-
format: "markdown",
|
|
87
|
-
entry: legacy
|
|
88
|
-
});
|
|
89
|
-
ownsIssues = templates.length > 0 || issueFiles.some((entry) => CHOOSER_CONFIG.test(entry.name)) || legacy !== void 0;
|
|
90
|
-
}
|
|
91
|
-
if (kinds.includes("pull_request")) {
|
|
92
|
-
const single = firstFile(locations, "pull_request_template");
|
|
93
|
-
found.push(...[...single ? [single] : [], ...pullFiles].map((entry) => ({
|
|
94
|
-
kind: "pull_request",
|
|
95
|
-
format: "markdown",
|
|
96
|
-
entry
|
|
97
|
-
})));
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
templates: await mapConcurrent(found, 4, async ({ kind, format, entry }) => ({
|
|
101
|
-
kind,
|
|
102
|
-
name: entry.name,
|
|
103
|
-
path: entry.path,
|
|
104
|
-
format,
|
|
105
|
-
body: await reader.read(repo, entry.path),
|
|
106
|
-
raw: entry
|
|
107
|
-
})),
|
|
108
|
-
ownsIssues
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
/** The first file named `name`, with any extension and in any case, across the locations in their order. */
|
|
112
|
-
function firstFile(locations, name) {
|
|
113
|
-
return locations.flat().find((entry) => entry.type === "file" && entry.name.toLowerCase().replace(/\.[^.]*$/, "") === name);
|
|
114
|
-
}
|
|
115
|
-
/** A listing of a directory that may not exist, or of a repository that is empty. */
|
|
116
|
-
async function orEmpty(listing) {
|
|
117
|
-
try {
|
|
118
|
-
return await listing;
|
|
119
|
-
} catch (error) {
|
|
120
|
-
if (error instanceof NotFoundError) return [];
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
export { readTemplates };
|
package/dist/token-CO62GglH.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { t as __commonJSMin } from "./rolldown-runtime-B4iAMlE-.js";
|
|
2
|
-
import { a as require_token_error, i as require_dist, r as require_token_util } from "./hosted-vercel-blob-DKntsHaf.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@vercel+oidc@3.8.10/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 {};
|
package/dist/use-DhwhbAVV.d.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { D as WorkspaceAssets, E as WorkspaceAssetPath, F as WorkspaceDefinition, Ft as WorkspaceSearchHit, Ht as WorkspaceSessionOptions, In as WriteFileOptions, It as WorkspaceSearchQuery, L as WorkspaceDiff, M as WorkspaceContent, Ot as WorkspaceRebaseOptions, Rt as WorkspaceSession, St as WorkspaceName, Tn as WorkspaceSyncOptions, Wt as WorkspaceSnapshot, _ as ReadFileResult, _n as WorkspaceSourceSyncResult, b as RmOptions, c as GlobOptions, ft as WorkspaceMaterializeSourcesOptions, g as ReadFileOptions, h as MkdirOptions, j as WorkspaceCapabilities, kt as WorkspaceRetainedHistory, l as ListOptions, mt as WorkspaceMaterializeSourcesResult, n as DiffOptions, nt as WorkspaceHistoryReader, x as SnapshotOptions, yn as WorkspaceStat, z as WorkspaceEntry } from "./types-DeK9GIxy.js";
|
|
2
|
-
import { a as WorkspaceReadOperations, d as WorkspaceWriteToolMap, n as ShellEnabled, o as WorkspaceShellResult, u as WorkspaceWriteOperations } from "./ai-BW2ZhizI.js";
|
|
3
|
-
import { ExecutionBudget } from "@vite-hub/runtime";
|
|
4
|
-
import { Tool, ToolSet } from "ai";
|
|
5
|
-
//#region src/core/use.d.ts
|
|
6
|
-
type WorkspaceWritablePath<Name extends WorkspaceName> = WorkspaceAssetPath<Name> | (string & {});
|
|
7
|
-
interface UseWorkspaceOptions {
|
|
8
|
-
definition?: WorkspaceDefinition;
|
|
9
|
-
mode?: "read" | "write";
|
|
10
|
-
refresh?: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface WorkspaceFacadeToolOptions extends WorkspaceReadOperations {
|
|
13
|
-
broadSearchPaths?: string[];
|
|
14
|
-
cwd?: string;
|
|
15
|
-
executionBudget?: ExecutionBudget;
|
|
16
|
-
maxShellCalls?: number;
|
|
17
|
-
maxOutputLength?: number;
|
|
18
|
-
sourceRequests?: boolean;
|
|
19
|
-
timeout?: number;
|
|
20
|
-
}
|
|
21
|
-
interface WritableWorkspaceFacadeToolOptions extends WorkspaceFacadeToolOptions, WorkspaceWriteOperations {}
|
|
22
|
-
type EnabledWriteCapability<Options, Key extends keyof WorkspaceWriteOperations> = Options extends Record<Key, infer Value> ? Value extends false ? false : true : true;
|
|
23
|
-
type WorkspaceReadTools<Options = undefined> = ((ShellEnabled<Options, Options extends {
|
|
24
|
-
sourceRequests: true;
|
|
25
|
-
} ? true : false> extends true ? {
|
|
26
|
-
shell: Tool<{
|
|
27
|
-
command: string;
|
|
28
|
-
}, WorkspaceShellResult>;
|
|
29
|
-
} : {}) & (Options extends {
|
|
30
|
-
materialize: true;
|
|
31
|
-
} ? {
|
|
32
|
-
materialize_sources: Tool<{
|
|
33
|
-
path?: string;
|
|
34
|
-
sources?: string[];
|
|
35
|
-
}, WorkspaceMaterializeSourcesResult>;
|
|
36
|
-
} : {}) & ToolSet);
|
|
37
|
-
type WorkspaceWriteTools<Options = undefined> = WorkspaceReadTools<Options> & { [Key in keyof WorkspaceWriteToolMap as EnabledWriteCapability<Options, Key> extends true ? Key : never]: WorkspaceWriteToolMap[Key]; } & ToolSet;
|
|
38
|
-
type WorkspaceReadToolSet = WorkspaceReadTools & {
|
|
39
|
-
inspect: <Options extends WorkspaceFacadeToolOptions | undefined = undefined>(options?: Options) => WorkspaceReadTools<Options>;
|
|
40
|
-
none: () => ToolSet;
|
|
41
|
-
};
|
|
42
|
-
type WorkspaceWriteToolSet = WorkspaceWriteTools & {
|
|
43
|
-
inspect: <Options extends WorkspaceFacadeToolOptions | undefined = undefined>(options?: Options) => WorkspaceReadTools<Options>;
|
|
44
|
-
none: () => ToolSet;
|
|
45
|
-
write: <Options extends WritableWorkspaceFacadeToolOptions | undefined = undefined>(options?: Options) => WorkspaceWriteTools<Options>;
|
|
46
|
-
};
|
|
47
|
-
type ReadonlyWorkspaceFs<Name extends WorkspaceName = WorkspaceName> = WorkspaceAssets<WorkspaceAssetPath<Name>>;
|
|
48
|
-
interface HistoryCheckpoint {
|
|
49
|
-
createdAt: string;
|
|
50
|
-
id: string;
|
|
51
|
-
name?: string;
|
|
52
|
-
}
|
|
53
|
-
interface HistoryCheckpointOptions {
|
|
54
|
-
message?: string;
|
|
55
|
-
}
|
|
56
|
-
interface History<TCheckpoint extends HistoryCheckpoint = HistoryCheckpoint> {
|
|
57
|
-
checkpoint(options?: HistoryCheckpointOptions): Promise<TCheckpoint>;
|
|
58
|
-
}
|
|
59
|
-
interface WritableWorkspaceFs<Name extends WorkspaceName = WorkspaceName> {
|
|
60
|
-
readFile<TOptions extends ReadFileOptions | undefined = undefined>(path: WorkspaceWritablePath<Name>, options?: TOptions): Promise<ReadFileResult<TOptions>>;
|
|
61
|
-
writeFile(path: WorkspaceWritablePath<Name>, content: WorkspaceContent, options?: WriteFileOptions): Promise<string>;
|
|
62
|
-
appendFile(path: WorkspaceWritablePath<Name>, content: string): Promise<void>;
|
|
63
|
-
stat(path: WorkspaceWritablePath<Name>): Promise<WorkspaceStat>;
|
|
64
|
-
exists(path: WorkspaceWritablePath<Name>): Promise<boolean>;
|
|
65
|
-
list(path?: WorkspaceWritablePath<Name> | "", options?: ListOptions): Promise<WorkspaceEntry[]>;
|
|
66
|
-
glob(pattern: WorkspaceWritablePath<Name> | Array<WorkspaceWritablePath<Name>>, options?: GlobOptions): Promise<WorkspaceEntry[]>;
|
|
67
|
-
search(query: WorkspaceSearchQuery): Promise<WorkspaceSearchHit[]>;
|
|
68
|
-
mkdir(path: WorkspaceWritablePath<Name>, options?: MkdirOptions): Promise<void>;
|
|
69
|
-
rm(path: WorkspaceWritablePath<Name>, options?: RmOptions): Promise<void>;
|
|
70
|
-
movePath(from: WorkspaceWritablePath<Name>, to: WorkspaceWritablePath<Name>, options?: {
|
|
71
|
-
overwrite?: boolean;
|
|
72
|
-
}): Promise<void>;
|
|
73
|
-
copyPath(from: WorkspaceWritablePath<Name>, to: WorkspaceWritablePath<Name>, options?: {
|
|
74
|
-
overwrite?: boolean;
|
|
75
|
-
}): Promise<void>;
|
|
76
|
-
}
|
|
77
|
-
interface ReadonlyWorkspaceFacade<Name extends WorkspaceName = WorkspaceName> {
|
|
78
|
-
fs: ReadonlyWorkspaceFs<Name>;
|
|
79
|
-
history: WorkspaceHistoryReader;
|
|
80
|
-
getMeta?(key: string): Promise<unknown>;
|
|
81
|
-
tools: WorkspaceReadToolSet;
|
|
82
|
-
}
|
|
83
|
-
interface WorkspaceHistory extends History<WorkspaceSnapshot>, WorkspaceRetainedHistory {
|
|
84
|
-
rebase(options?: WorkspaceRebaseOptions): Promise<void>;
|
|
85
|
-
}
|
|
86
|
-
interface WritableWorkspaceFacade<Name extends WorkspaceName = WorkspaceName> {
|
|
87
|
-
capabilities(): Promise<WorkspaceCapabilities>;
|
|
88
|
-
diff(options?: DiffOptions): Promise<WorkspaceDiff>;
|
|
89
|
-
fs: WritableWorkspaceFs<Name>;
|
|
90
|
-
history: WorkspaceHistory;
|
|
91
|
-
getMeta?(key: string): Promise<unknown>;
|
|
92
|
-
materializeSources(options?: WorkspaceMaterializeSourcesOptions): Promise<WorkspaceMaterializeSourcesResult>;
|
|
93
|
-
setMeta?(key: string, value: unknown, capability?: symbol): Promise<void>;
|
|
94
|
-
snapshot(options?: SnapshotOptions): Promise<WorkspaceSnapshot>;
|
|
95
|
-
startSession(options?: WorkspaceSessionOptions): Promise<WorkspaceSession>;
|
|
96
|
-
sync(options: WorkspaceSyncOptions): Promise<WorkspaceSourceSyncResult>;
|
|
97
|
-
tools: WorkspaceWriteToolSet;
|
|
98
|
-
}
|
|
99
|
-
type WorkspaceFacade<Name extends WorkspaceName = WorkspaceName, Mode extends UseWorkspaceOptions["mode"] = "read"> = Mode extends "write" ? WritableWorkspaceFacade<Name> : ReadonlyWorkspaceFacade<Name>;
|
|
100
|
-
declare function useWorkspace<Name extends WorkspaceName>(name: Name): ReadonlyWorkspaceFacade<Name>;
|
|
101
|
-
declare function useWorkspace<Name extends WorkspaceName>(name: Name, options: UseWorkspaceOptions & {
|
|
102
|
-
mode?: "read";
|
|
103
|
-
}): ReadonlyWorkspaceFacade<Name>;
|
|
104
|
-
declare function useWorkspace<Name extends WorkspaceName>(name: Name, options: UseWorkspaceOptions & {
|
|
105
|
-
mode: "write";
|
|
106
|
-
}): WritableWorkspaceFacade<Name>;
|
|
107
|
-
//#endregion
|
|
108
|
-
export { useWorkspace as _, ReadonlyWorkspaceFs as a, WorkspaceFacadeToolOptions as c, WorkspaceReadTools as d, WorkspaceWriteToolSet as f, WritableWorkspaceFs as g, WritableWorkspaceFacadeToolOptions as h, ReadonlyWorkspaceFacade as i, WorkspaceHistory as l, WritableWorkspaceFacade as m, HistoryCheckpoint as n, UseWorkspaceOptions as o, WorkspaceWriteTools as p, HistoryCheckpointOptions as r, WorkspaceFacade as s, History as t, WorkspaceReadToolSet as u };
|