@vite-hub/sandbox 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 +118 -53
- package/dist/abortable-CR01hzfi.js +57 -0
- package/dist/cloudflare-Cog_r2Me.js +910 -0
- package/dist/cloudflare-env-lookup-DzI6Xv1Y.js +16 -0
- package/dist/cloudflare-failure-CFQhalfh.js +50 -0
- package/dist/container-CqfD8yuE.js +868 -0
- package/dist/{crabbox-BFCdf41h.js → crabbox-sbV3Zjuo.js} +10 -6
- package/dist/error-diagnostics-5QT_BjbQ.js +354 -0
- package/dist/error-diagnostics-BJtLRL9w.js +536 -0
- package/dist/{file-listing-DECFTdSl.js → file-listing-CHtRrfo1.js} +1 -1
- package/dist/{file-lock-CxyVl4Cv.js → file-lock-D0-XPogS.js} +3 -2
- package/dist/{index-CXej1Bt0.d.ts → index-DsoQAUb7.d.ts} +94 -19
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -10
- package/dist/internal/cloudflare.d.ts +173 -1
- package/dist/internal/cloudflare.js +4 -12
- package/dist/internal/host-toolchain.d.ts +1 -1
- package/dist/internal/host-toolchain.js +6 -7
- package/dist/internal/vercel.d.ts +1 -1
- package/dist/internal/vercel.js +3 -11
- package/dist/invariant-DolT9EEx.js +22 -0
- package/dist/module-types-B0LQ5H2S.js +7 -0
- package/dist/module-types-DCeJbS9Z.d.ts +110 -0
- package/dist/process-sweep-CMaujWE5.js +33 -0
- package/dist/provider-resolution-C6AQzuFG.js +133 -0
- package/dist/{remote-1Jz2oUMK.js → remote-70ZVZZlq.js} +32 -14
- package/dist/runtime-type-Deo4qzxN.js +9 -0
- package/dist/{session-DD0S1PDC.js → session-e0lyzjJ3.js} +2 -1
- package/dist/size-7AkVwGZb.js +118 -0
- package/dist/ssh.d.ts +8 -0
- package/dist/ssh.js +107 -40
- package/dist/task/index.d.ts +19 -17
- package/dist/task/index.js +92 -201
- package/dist/task/runtime/provider-loader.d.ts +7 -9
- package/dist/task/runtime/provider-loader.js +2 -5
- package/dist/task/runtime/providers/cloudflare.d.ts +5 -19
- package/dist/task/runtime/providers/cloudflare.js +7 -6
- package/dist/task/runtime/providers/vercel.d.ts +3 -3
- package/dist/task/runtime/providers/vercel.js +35 -4
- package/dist/task/runtime/state.d.ts +4 -1
- package/dist/task/runtime/state.js +11 -2
- package/dist/task/vite.d.ts +143 -17
- package/dist/task/vite.js +723 -400
- package/dist/{toolchain-BUVXtQ2m.js → toolchain-BIVGMRty.js} +12 -11
- package/dist/{trusted-host-DNMJ-Oig.js → trusted-host-kxkpaQcs.js} +21 -179
- package/dist/{vercel-Jtxa9TJx.js → vercel-BGGrNpza.js} +107 -34
- package/package.json +15 -12
- package/dist/cloudflare-DO0h3Ncf.js +0 -281
- package/dist/cloudflare-env-BBJaBbuQ.js +0 -39
- package/dist/error-diagnostics-BSysPv-D.js +0 -166
- package/dist/error-diagnostics-dGQqfgLt.js +0 -99
- package/dist/module-types-BfyRBaiP.js +0 -7
- package/dist/module-types-Cis4hrF1.d.ts +0 -95
- package/dist/runtime-type-DrmrW5m5.js +0 -42
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { n as loadVercelSandbox } from "../../../vercel-BGGrNpza.js";
|
|
1
2
|
import { resolveVercelSandbox } from "../../../internal/vercel.js";
|
|
3
|
+
import { t as sandboxTaskErrorDiagnostics } from "../../../error-diagnostics-5QT_BjbQ.js";
|
|
4
|
+
import "../../../provider-resolution-C6AQzuFG.js";
|
|
5
|
+
import { a as resolveVercelSandboxTaskVcpus } from "../../../size-7AkVwGZb.js";
|
|
2
6
|
//#region ../internal/src/env.ts
|
|
3
7
|
function trimmed(value) {
|
|
4
8
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
@@ -11,6 +15,11 @@ function readEnv(env, ...names) {
|
|
|
11
15
|
}
|
|
12
16
|
//#endregion
|
|
13
17
|
//#region src/task/runtime/providers/vercel.ts
|
|
18
|
+
/**
|
|
19
|
+
* The Vercel VM timeout starts at create, but the task timeout starts after the Sandbox opens.
|
|
20
|
+
* The VM gets this extra time so that ViteHub, not the VM, ends a run at the task timeout.
|
|
21
|
+
*/
|
|
22
|
+
const VERCEL_TASK_SANDBOX_HEADROOM_MS = 3e4;
|
|
14
23
|
function readConfigCredential(value) {
|
|
15
24
|
return value?.trim() || void 0;
|
|
16
25
|
}
|
|
@@ -37,9 +46,9 @@ function resolveCredentials(provider) {
|
|
|
37
46
|
async function resolveVercelTaskSandbox(options) {
|
|
38
47
|
const credentials = resolveCredentials(options.provider);
|
|
39
48
|
const sandboxOptions = {
|
|
40
|
-
runtime: options.provider.runtime
|
|
41
|
-
timeout:
|
|
42
|
-
cpu: options.provider
|
|
49
|
+
runtime: options.provider.runtime,
|
|
50
|
+
timeout: (options.local.timeout ?? 3e5) + VERCEL_TASK_SANDBOX_HEADROOM_MS,
|
|
51
|
+
cpu: resolveVercelSandboxTaskVcpus(options.provider),
|
|
43
52
|
ports: options.provider.ports,
|
|
44
53
|
source: options.provider.source,
|
|
45
54
|
networkPolicy: options.provider.networkPolicy,
|
|
@@ -47,8 +56,30 @@ async function resolveVercelTaskSandbox(options) {
|
|
|
47
56
|
};
|
|
48
57
|
return {
|
|
49
58
|
provider: "vercel",
|
|
50
|
-
resolveSandbox: async (requirements) => await resolveVercelSandbox(
|
|
59
|
+
resolveSandbox: async (requirements) => await resolveVercelSandbox({
|
|
60
|
+
...sandboxOptions,
|
|
61
|
+
create: withPlanLimitError(await loadVercelSandbox())
|
|
62
|
+
}, requirements)
|
|
51
63
|
};
|
|
52
64
|
}
|
|
65
|
+
/** Reports a session timeout above the Vercel plan maximum with its own code and the limit from Vercel. */
|
|
66
|
+
function withPlanLimitError(create) {
|
|
67
|
+
return async (createOptions) => {
|
|
68
|
+
try {
|
|
69
|
+
return await create(createOptions);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
const limit = error instanceof Error ? vercelTimeoutLimit(error.message) : void 0;
|
|
72
|
+
if (limit && createOptions.timeout !== void 0) throw sandboxTaskErrorDiagnostics.SANDBOX_TASK_VERCEL_TIMEOUT_LIMIT({
|
|
73
|
+
cause: error,
|
|
74
|
+
limit,
|
|
75
|
+
timeout: createOptions.timeout
|
|
76
|
+
});
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function vercelTimeoutLimit(message) {
|
|
82
|
+
return /`timeout` restricted to [^\n]+/.exec(message)?.[0];
|
|
83
|
+
}
|
|
53
84
|
//#endregion
|
|
54
85
|
export { resolveVercelTaskSandbox };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SandboxTaskDefinitionBundle,
|
|
1
|
+
import { a as SandboxTaskDefinitionBundle, t as AgentSandboxTaskConfig, u as SandboxTaskDefinitionOptions } from "../../module-types-DCeJbS9Z.js";
|
|
2
2
|
//#region src/task/runtime/state.d.ts
|
|
3
3
|
export type SandboxTaskRegistryEntry = {
|
|
4
4
|
bundle: SandboxTaskDefinitionBundle;
|
|
@@ -19,6 +19,9 @@ export declare function createGeneratedSandboxTaskRuntimeRegistry(scope: string,
|
|
|
19
19
|
export declare function getSandboxTaskRuntimeConfig(): false | AgentSandboxTaskConfig | undefined;
|
|
20
20
|
export declare function getSandboxTaskRuntimeRegistry(): SandboxTaskRuntimeRegistry | undefined;
|
|
21
21
|
export declare function setSandboxTaskRuntimeConfig(config: false | AgentSandboxTaskConfig | undefined): void;
|
|
22
|
+
/** `vite dev` sets this. Task error Responses then keep the stack and process output. */
|
|
23
|
+
export declare function isSandboxTaskRuntimeDevelopment(): boolean;
|
|
24
|
+
export declare function setSandboxTaskRuntimeDevelopment(development: boolean): void;
|
|
22
25
|
export declare function setSandboxTaskRuntimeRegistry(registry: SandboxTaskRuntimeRegistry | undefined): void;
|
|
23
26
|
export declare function resetSandboxTaskRuntimeState(): void;
|
|
24
27
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as sandboxTaskErrorDiagnostics } from "../../error-diagnostics-
|
|
1
|
+
import { t as sandboxTaskErrorDiagnostics } from "../../error-diagnostics-5QT_BjbQ.js";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
//#region src/task/runtime/state.ts
|
|
4
4
|
let sandboxTaskConfig;
|
|
5
|
+
let sandboxTaskDevelopment = false;
|
|
5
6
|
let sandboxTaskRegistry;
|
|
6
7
|
const generatedRegistries = /* @__PURE__ */ new Map();
|
|
7
8
|
const generatedRegistryOwnership = /* @__PURE__ */ new WeakMap();
|
|
@@ -59,6 +60,13 @@ function getSandboxTaskRuntimeRegistry() {
|
|
|
59
60
|
function setSandboxTaskRuntimeConfig(config) {
|
|
60
61
|
sandboxTaskConfig = config;
|
|
61
62
|
}
|
|
63
|
+
/** `vite dev` sets this. Task error Responses then keep the stack and process output. */
|
|
64
|
+
function isSandboxTaskRuntimeDevelopment() {
|
|
65
|
+
return sandboxTaskDevelopment;
|
|
66
|
+
}
|
|
67
|
+
function setSandboxTaskRuntimeDevelopment(development) {
|
|
68
|
+
sandboxTaskDevelopment = development;
|
|
69
|
+
}
|
|
62
70
|
function setSandboxTaskRuntimeRegistry(registry) {
|
|
63
71
|
sandboxTaskRegistry = registry;
|
|
64
72
|
const generated = registry && generatedRegistryOwnership.get(registry);
|
|
@@ -66,8 +74,9 @@ function setSandboxTaskRuntimeRegistry(registry) {
|
|
|
66
74
|
}
|
|
67
75
|
function resetSandboxTaskRuntimeState() {
|
|
68
76
|
sandboxTaskConfig = void 0;
|
|
77
|
+
sandboxTaskDevelopment = false;
|
|
69
78
|
sandboxTaskRegistry = void 0;
|
|
70
79
|
generatedRegistries.clear();
|
|
71
80
|
}
|
|
72
81
|
//#endregion
|
|
73
|
-
export { createGeneratedSandboxTaskModuleSpecifier, createGeneratedSandboxTaskRuntimeRegistry, getSandboxTaskRuntimeConfig, getSandboxTaskRuntimeRegistry, resetSandboxTaskRuntimeState, setSandboxTaskRuntimeConfig, setSandboxTaskRuntimeRegistry };
|
|
82
|
+
export { createGeneratedSandboxTaskModuleSpecifier, createGeneratedSandboxTaskRuntimeRegistry, getSandboxTaskRuntimeConfig, getSandboxTaskRuntimeRegistry, isSandboxTaskRuntimeDevelopment, resetSandboxTaskRuntimeState, setSandboxTaskRuntimeConfig, setSandboxTaskRuntimeDevelopment, setSandboxTaskRuntimeRegistry };
|
package/dist/task/vite.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { t as AgentSandboxTaskConfig } from "../module-types-
|
|
1
|
+
import { t as AgentSandboxTaskConfig } from "../module-types-DCeJbS9Z.js";
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
|
+
//#region ../internal/src/deployment.d.ts
|
|
4
|
+
/** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
|
|
5
|
+
type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
|
|
6
|
+
//#endregion
|
|
3
7
|
//#region ../internal/src/inspect.d.ts
|
|
4
8
|
interface ViteHubDefinitionField {
|
|
5
9
|
label: string;
|
|
@@ -26,15 +30,72 @@ interface ViteHubProviderOutputEntry {
|
|
|
26
30
|
/** Absolute path. */
|
|
27
31
|
path: string;
|
|
28
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Where an inspected resource id came from. `name` means the host binds the resource by its name and needs no id.
|
|
35
|
+
* The CLI sets `provider-output` when only a generated Wrangler config names the id.
|
|
36
|
+
*/
|
|
37
|
+
type ViteHubResourceIdSource = "config" | "env" | "name" | "provider-output" | "provision-state";
|
|
38
|
+
/** One host resource that a Definition or store maps to. Owner packages read only local config and Provision State. */
|
|
39
|
+
interface ViteHubResourceSummary {
|
|
40
|
+
/** Cloudflare binding name, so the CLI can find the id in generated Wrangler config. */
|
|
41
|
+
binding?: string;
|
|
42
|
+
/** Definition or store name. */
|
|
43
|
+
definition: string;
|
|
44
|
+
/** Env variable that supplied the id when `source` is `env`. */
|
|
45
|
+
env?: string;
|
|
46
|
+
host: "cloudflare" | "vercel";
|
|
47
|
+
id?: string;
|
|
48
|
+
/** Same resource kind names as Provision actions, for example `cloudflare-d1`. */
|
|
49
|
+
kind: string;
|
|
50
|
+
/** Resource name on the host, when the config names it. */
|
|
51
|
+
name?: string;
|
|
52
|
+
/** Explains how the host finds the resource when no id or name is known locally. */
|
|
53
|
+
note?: string;
|
|
54
|
+
owner: string;
|
|
55
|
+
/** Absent when no id is known yet. */
|
|
56
|
+
source?: ViteHubResourceIdSource;
|
|
57
|
+
}
|
|
29
58
|
interface ViteHubInspectionContributor {
|
|
30
59
|
definitions?: readonly ViteHubDefinitionInspector[];
|
|
31
60
|
providerOutput?: readonly ViteHubProviderOutputEntry[];
|
|
61
|
+
resources?: () => readonly ViteHubResourceSummary[] | Promise<readonly ViteHubResourceSummary[]>;
|
|
32
62
|
}
|
|
33
63
|
type ViteHubInspectionContributorFactory = () => ViteHubInspectionContributor | undefined | Promise<ViteHubInspectionContributor | undefined>;
|
|
34
64
|
interface ViteHubInspectionPluginMetadata {
|
|
35
65
|
inspect?: ViteHubInspectionContributor | ViteHubInspectionContributorFactory;
|
|
36
66
|
}
|
|
37
67
|
//#endregion
|
|
68
|
+
//#region ../internal/src/build/deployment-plan-output.d.ts
|
|
69
|
+
/**
|
|
70
|
+
* One set of host variables that the deployed app reads, as `deployment.json` lists it: a Server Env declaration, or
|
|
71
|
+
* a variable that a primitive reads itself, such as `VITEHUB_SECRET` or `BLOB_READ_WRITE_TOKEN`.
|
|
72
|
+
* It holds names only, so `vitehub deploy` can check the host without booting Vite. It never holds a value.
|
|
73
|
+
*/
|
|
74
|
+
interface DeploymentEnvEntry {
|
|
75
|
+
/** The declaration path, such as `env.server.github.token`, when it is safe to show. Primitive entries have none. */
|
|
76
|
+
path?: string;
|
|
77
|
+
/** The host variable names, in read order. The first name that is set supplies the value. */
|
|
78
|
+
names: readonly string[];
|
|
79
|
+
/** Any variable whose name starts with this prefix supplies the value, such as `VITEHUB_CONSOLE_KEY_`. */
|
|
80
|
+
prefix?: string;
|
|
81
|
+
required: boolean;
|
|
82
|
+
secret: boolean;
|
|
83
|
+
/** A default supplies the value when no name is set. */
|
|
84
|
+
hasDefault: boolean;
|
|
85
|
+
/** The primitives that read these names, such as `blob`. Server Env declarations have none. */
|
|
86
|
+
owners?: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
/** What a primitive needs to know to name the variables it reads in the deployed app. */
|
|
89
|
+
interface DeploymentEnvContext {
|
|
90
|
+
host: ViteHubHost;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The host variables that a primitive reads itself, outside the Server Env registry, for one host and its resolved
|
|
94
|
+
* config. A Vite plugin exposes it as `api.deploymentEnv`, and the build writes the result to `deployment.json`.
|
|
95
|
+
* Return names only, never values.
|
|
96
|
+
*/
|
|
97
|
+
type DeploymentEnvContribution = (context: DeploymentEnvContext) => readonly DeploymentEnvEntry[];
|
|
98
|
+
//#endregion
|
|
38
99
|
//#region src/task/internal/shared/feature-definitions.d.ts
|
|
39
100
|
interface ScannedDefinition {
|
|
40
101
|
name: string;
|
|
@@ -67,7 +128,15 @@ interface ViteHubConsoleDefinitionCatalogView {
|
|
|
67
128
|
/** States which runtime data this catalog does not include. */
|
|
68
129
|
notice: string;
|
|
69
130
|
}
|
|
131
|
+
/** Lists Workspace Definitions like a catalog, and browses the refs, revisions, and files of the selected one. */
|
|
132
|
+
interface ViteHubConsoleWorkspaceBrowserView {
|
|
133
|
+
kind: "workspace-browser";
|
|
134
|
+
/** States which runtime data the browser does not include. */
|
|
135
|
+
notice: string;
|
|
136
|
+
}
|
|
70
137
|
interface ViteHubConsoleRecordColumn {
|
|
138
|
+
/** Set it for a column with few values, such as a status. The Console then filters the table by its values. */
|
|
139
|
+
filter?: boolean;
|
|
71
140
|
/** Key in `ViteHubConsoleRecord.cells`. */
|
|
72
141
|
key: string;
|
|
73
142
|
label: string;
|
|
@@ -92,8 +161,42 @@ interface ViteHubConsoleOperationColumn {
|
|
|
92
161
|
/** Dot path into each item of the result, such as `author.name` or `messages.0.body`. */
|
|
93
162
|
key: string;
|
|
94
163
|
label: string;
|
|
95
|
-
/**
|
|
96
|
-
|
|
164
|
+
/**
|
|
165
|
+
* `datetime` shows a time in milliseconds since the epoch as a relative date, such as `5m ago`. `excerpt` cuts a long
|
|
166
|
+
* text. `status` shows the value as a status with a colored dot, such as `Open`. `tones` picks the color of each value.
|
|
167
|
+
* `switch` shows a boolean as a switch that calls the `switch` operation.
|
|
168
|
+
*/
|
|
169
|
+
format?: "datetime" | "excerpt" | "status" | "switch";
|
|
170
|
+
/** The color of each value of a `status` column, such as `{ open: "info", resolved: "success" }`. Other values are neutral. */
|
|
171
|
+
tones?: Readonly<Record<string, "error" | "info" | "neutral" | "success" | "warning">>;
|
|
172
|
+
/**
|
|
173
|
+
* What a `switch` column calls when the user flips it: `operation` with an input that maps each key of `input` to a
|
|
174
|
+
* dot path of the item, and the column `key` to the new value. `{ operation: "skills.set", input: { name: "name" } }`
|
|
175
|
+
* on the column `enabled` calls `skills.set` with `{ name, enabled }`, then loads the list again. A user who may only
|
|
176
|
+
* read the section sees the switch disabled.
|
|
177
|
+
*/
|
|
178
|
+
switch?: {
|
|
179
|
+
operation: string;
|
|
180
|
+
input: Readonly<Record<string, string>>;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A button on each row that calls `operation` with the Console user, then loads the list again. `input` maps each input
|
|
185
|
+
* key to a dot path of the item, as a `switch` column does.
|
|
186
|
+
*/
|
|
187
|
+
interface ViteHubConsoleOperationAction {
|
|
188
|
+
label: string;
|
|
189
|
+
operation: string;
|
|
190
|
+
input: Readonly<Record<string, string>>;
|
|
191
|
+
/**
|
|
192
|
+
* The result is `{ url }`, such as a one-time link or a provider sign-in: the Console opens it in a new tab, and loads
|
|
193
|
+
* the list again when the person comes back. The URL must be `https:`, or `http:` on a loopback host.
|
|
194
|
+
*/
|
|
195
|
+
tab?: true;
|
|
196
|
+
/** Show the button only on rows where each dot path holds one of the listed values. */
|
|
197
|
+
when?: Readonly<Record<string, readonly string[]>>;
|
|
198
|
+
/** Ask this question before the call. `{path}` takes a value from the item. */
|
|
199
|
+
confirm?: string;
|
|
97
200
|
}
|
|
98
201
|
/** A chip above the list. Choosing it merges `input` into the operation input. The first chip is the default. */
|
|
99
202
|
interface ViteHubConsoleOperationFilter {
|
|
@@ -107,13 +210,24 @@ interface ViteHubConsoleOperationFilter {
|
|
|
107
210
|
* array of objects with an `id`. A failure of the operation, with its `fix`, shows where the list would be.
|
|
108
211
|
*/
|
|
109
212
|
interface ViteHubConsoleOperationView {
|
|
213
|
+
/** Buttons on each row. A user who may only read the section does not see them. */
|
|
214
|
+
actions?: readonly ViteHubConsoleOperationAction[];
|
|
110
215
|
columns: readonly ViteHubConsoleOperationColumn[];
|
|
216
|
+
/**
|
|
217
|
+
* Opens the item of a row in a side panel. `comment-thread` shows an item of `comments.list` as a comment thread
|
|
218
|
+
* where the user reads, replies, resolves, reopens, and mentions people. The panel calls the `comments.*` operations
|
|
219
|
+
* with the Console user, and `?thread=<id>` in the URL opens it.
|
|
220
|
+
*/
|
|
221
|
+
detail?: {
|
|
222
|
+
kind: "comment-thread";
|
|
223
|
+
};
|
|
111
224
|
filters?: readonly ViteHubConsoleOperationFilter[];
|
|
112
225
|
kind: "operation-view";
|
|
113
226
|
/**
|
|
114
227
|
* Makes each row a link: `{path}` placeholders take values from the item and are URL-encoded, and `{path:path}` takes an
|
|
115
|
-
* app path and encodes each segment (a value that is not an app path, such as `//evil.com/x`, gives no link).
|
|
116
|
-
* `
|
|
228
|
+
* app path and encodes each segment (a value that is not an app path, such as `//evil.com/x`, gives no link).
|
|
229
|
+
* `{path:href}` takes an app URL that is already encoded, with its query, as it is. Rows where `when.path` is not
|
|
230
|
+
* `when.equals` get none.
|
|
117
231
|
*/
|
|
118
232
|
link?: {
|
|
119
233
|
label?: string;
|
|
@@ -137,7 +251,17 @@ interface ViteHubConsoleAuthView {
|
|
|
137
251
|
notice: string;
|
|
138
252
|
}
|
|
139
253
|
interface ViteHubConsoleAuthSection extends ViteHubConsoleSectionDescriptor<ViteHubConsoleAuthView> {}
|
|
140
|
-
|
|
254
|
+
/**
|
|
255
|
+
* The webhooks of the app, their pending debounce timers, and their delivery log. The Console calls the `webhooks.*`
|
|
256
|
+
* operations of `@vite-hub/webhooks` with the Console user to list them, send a test, send a pending delivery now,
|
|
257
|
+
* cancel it, and redeliver. It has no build-time data.
|
|
258
|
+
*/
|
|
259
|
+
interface ViteHubConsoleWebhooksView {
|
|
260
|
+
kind: "webhooks";
|
|
261
|
+
notice: string;
|
|
262
|
+
}
|
|
263
|
+
interface ViteHubConsoleWebhooksSection extends ViteHubConsoleSectionDescriptor<ViteHubConsoleWebhooksView> {}
|
|
264
|
+
type ViteHubConsoleSectionView = ViteHubConsoleOperationView | ViteHubConsoleAuthView | ViteHubConsoleWebhooksView | ViteHubConsoleDefinitionCatalogView | ViteHubConsoleRecordTableView | ViteHubConsoleDocumentEditorView | ViteHubConsoleWorkspaceBrowserView;
|
|
141
265
|
/**
|
|
142
266
|
* The overview of a document editor section: document counts by state, the changes that wait for a publish, recent
|
|
143
267
|
* activity, and a New button per collection. It reads the owner `overview` action.
|
|
@@ -247,8 +371,8 @@ interface ViteHubConsoleServerExport {
|
|
|
247
371
|
/** Named export of `module`. */
|
|
248
372
|
export: string;
|
|
249
373
|
/**
|
|
250
|
-
*
|
|
251
|
-
* path that the application can import.
|
|
374
|
+
* Absolute path of the owner module, such as `ownModule(import.meta.url, "runtime/console")`, or an owner package
|
|
375
|
+
* specifier that the host maps to a module path that the application can import.
|
|
252
376
|
*/
|
|
253
377
|
module: string;
|
|
254
378
|
}
|
|
@@ -259,7 +383,8 @@ interface ViteHubConsoleServerExport {
|
|
|
259
383
|
interface ViteHubConsoleRuntimeReader extends ViteHubConsoleServerExport {}
|
|
260
384
|
/**
|
|
261
385
|
* A record table that also reads records at request time. The Console shows the build-time records of `read` first,
|
|
262
|
-
* then the records of the `runtime` reader. A runtime record
|
|
386
|
+
* then the records of the `runtime` reader. A runtime record updates the build-time record with the same id: its cells
|
|
387
|
+
* and fields replace the build-time ones with the same key or label.
|
|
263
388
|
*/
|
|
264
389
|
interface ViteHubConsoleRuntimeRecordTableSection<TOptions = void> extends ViteHubConsoleSectionDescriptor<ViteHubConsoleRecordTableView> {
|
|
265
390
|
/** Reads build-time records on the server. When omitted, the section has only runtime records. */
|
|
@@ -295,7 +420,7 @@ interface ViteHubConsoleDocumentEditorSection<TOptions = void> extends ViteHubCo
|
|
|
295
420
|
* A Console section that an owner package contributes. The owner defines the label, icon, view, and data reader.
|
|
296
421
|
* `TOptions` is the discovery context that the host passes to `read`.
|
|
297
422
|
*/
|
|
298
|
-
type ViteHubConsoleSectionContribution<TOptions = void> = ViteHubConsoleAuthSection | ViteHubConsoleDefinitionCatalogSection<TOptions> | ViteHubConsoleRecordTableSection<TOptions> | ViteHubConsoleRuntimeRecordTableSection<TOptions> | ViteHubConsoleDocumentEditorSection<TOptions> | ViteHubConsoleOperationSection;
|
|
423
|
+
type ViteHubConsoleSectionContribution<TOptions = void> = ViteHubConsoleAuthSection | ViteHubConsoleWebhooksSection | ViteHubConsoleDefinitionCatalogSection<TOptions> | ViteHubConsoleRecordTableSection<TOptions> | ViteHubConsoleRuntimeRecordTableSection<TOptions> | ViteHubConsoleDocumentEditorSection<TOptions> | ViteHubConsoleOperationSection;
|
|
299
424
|
/** A fix that the owner names for a feature the project lacks, such as `Add authorize to defineContent().` */
|
|
300
425
|
interface ViteHubConsoleDocumentHint {
|
|
301
426
|
/** One sentence that names the fix. Text in backticks shows as code. */
|
|
@@ -337,8 +462,12 @@ export declare function inspectSandboxTaskDefinitions(options: SandboxTaskInspec
|
|
|
337
462
|
export declare const sandboxTaskConsoleSection: ViteHubConsoleSectionContribution<SandboxTaskInspectionOptions>;
|
|
338
463
|
//#endregion
|
|
339
464
|
//#region src/task/vite.d.ts
|
|
340
|
-
export type
|
|
465
|
+
export type SandboxTaskOptions = AgentSandboxTaskConfig | false;
|
|
341
466
|
export type SandboxTaskVitePlugin = Plugin & {
|
|
467
|
+
/** The variables that Sandbox Tasks read on the deployed host. See `sandboxDeploymentEnv()`. */
|
|
468
|
+
api: {
|
|
469
|
+
deploymentEnv: DeploymentEnvContribution;
|
|
470
|
+
};
|
|
342
471
|
vitehub: ViteHubInspectionPluginMetadata;
|
|
343
472
|
nitro: {
|
|
344
473
|
name: string;
|
|
@@ -350,11 +479,8 @@ export type SandboxTaskVitePlugin = Plugin & {
|
|
|
350
479
|
}) => void;
|
|
351
480
|
};
|
|
352
481
|
};
|
|
353
|
-
|
|
354
|
-
declare
|
|
355
|
-
|
|
356
|
-
sandboxTask?: SandboxTaskPublicOptions;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
482
|
+
/** The path of the Sandbox Task runtime state module. Generated code of other owners imports it by path. */
|
|
483
|
+
export declare const sandboxTaskRuntimeStateModule: string;
|
|
484
|
+
export declare function hubSandboxTask(options?: SandboxTaskOptions): SandboxTaskVitePlugin;
|
|
359
485
|
//#endregion
|
|
360
486
|
export type { DiscoveredSandboxTaskDefinition, SandboxTaskInspectionOptions };
|