@vite-hub/schedule 0.0.4 → 0.1.0
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 +68 -5
- package/dist/definition-CMiOg1lg.js +111 -0
- package/dist/definition.d.ts +4 -6
- package/dist/definition.js +2 -42
- package/dist/error-diagnostics-A_8Kp-48.js +116 -0
- package/dist/error-diagnostics-in7mif5s.js +45 -0
- package/dist/execute-BJrgNgQ0.js +201 -0
- package/dist/index.d.ts +7 -40
- package/dist/index.js +2 -7
- package/dist/inspect-DTfAo5gS.js +118 -0
- package/dist/kv-storage-Bv9ocZT-.d.ts +18 -0
- package/dist/nuxt.d.ts +4 -6
- package/dist/nuxt.js +2 -1
- package/dist/operations-gk2qzhYV.js +131 -0
- package/dist/operations-tNUdj3G4.d.ts +212 -0
- package/dist/operations.d.ts +61 -0
- package/dist/operations.js +921 -0
- package/dist/registry-module.d.ts +0 -5
- package/dist/runtime/kv.d.ts +4 -0
- package/dist/{kv-BJ1I9IlJ.js → runtime/kv.js} +1 -1
- package/dist/runtime/process.d.ts +26 -5
- package/dist/runtime/process.js +337 -75
- package/dist/runtime/state.d.ts +8 -12
- package/dist/runtime/state.js +2 -2
- package/dist/runtime/static.d.ts +18 -12
- package/dist/runtime/static.js +2 -150
- package/dist/runtime.d.ts +36 -4
- package/dist/runtime.js +5 -3
- package/dist/state-DSxmHPn3.js +448 -0
- package/dist/static-6g82xguw.js +245 -0
- package/dist/store-QAOd8bxm.d.ts +11 -0
- package/dist/types-CHdV9FQU.d.ts +113 -0
- package/dist/vite-BAVyZ8hZ.d.ts +474 -0
- package/dist/{vite-BHs17nWX.js → vite-BJwZkMrn.js} +1366 -339
- package/dist/vite.d.ts +2 -52
- package/dist/vite.js +2 -3
- package/dist/wait-until-BmIqRo4x.js +87 -0
- package/package.json +67 -21
- package/dist/client-DpCD4YFE.js +0 -233
- package/dist/discovery-DkFAN7Wd.d.ts +0 -15
- package/dist/discovery-DvU3B6iD.js +0 -753
- package/dist/due-Bbh4yIxq.js +0 -59
- package/dist/execute-B-pii4wf.js +0 -211
- package/dist/runtime/driver.d.ts +0 -26
- package/dist/runtime/driver.js +0 -337
- package/dist/state-By7WU_ks.js +0 -472
- package/dist/store-t-74rsM_.d.ts +0 -48
- package/dist/types-Bcje4dLV.d.ts +0 -136
- package/dist/wait-until-BzIwzXw4.js +0 -23
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,12 @@
|
|
|
1
1
|
/// <reference path="./registry-module.d.ts" />
|
|
2
|
-
import {
|
|
3
|
-
import { defineSchedule
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { getRuntimeScheduleStore, getScheduleRunStore, getScheduleRuntimeRegistry, loadScheduleDefinition, resetScheduleRuntime, setRuntimeScheduleStore, setScheduleRunStore, setScheduleRuntimeRegistry } from "./runtime/state.js";
|
|
2
|
+
import { a as ScheduleDefinitionRegistry, c as ScheduleRunAttemptRecord, d as ScheduleRunError, f as ScheduleRunListOptions, g as ScheduleRunStore, h as ScheduleRunStatus, l as ScheduleRunAttemptStatus, m as ScheduleRunResponse, n as ScheduleDefinition, o as ScheduleHandler, p as ScheduleRunRecord, r as ScheduleDefinitionInput, s as ScheduleRegistryDefinition, t as DiscoveredScheduleDefinition, u as ScheduleRunContext } from "./types-CHdV9FQU.js";
|
|
3
|
+
import { defineSchedule } from "./definition.js";
|
|
4
|
+
import { t as ScheduleKVStorage } from "./kv-storage-Bv9ocZT-.js";
|
|
5
|
+
import { t as KVScheduleStoreOptions } from "./store-QAOd8bxm.js";
|
|
7
6
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
8
|
-
|
|
9
|
-
//#region src/runtime/execute.d.ts
|
|
10
|
-
interface ExecuteScheduleOptions {
|
|
11
|
-
definition: ScheduleRegistryDefinition;
|
|
12
|
-
input?: unknown;
|
|
13
|
-
runStore?: ScheduleRunStore;
|
|
14
|
-
scheduleId: string;
|
|
15
|
-
source?: "direct" | "runtime" | "static";
|
|
16
|
-
scheduledAt?: Date;
|
|
17
|
-
target: ScheduleTargetName;
|
|
18
|
-
waitUntil?: (promise: PromiseLike<unknown>) => void;
|
|
19
|
-
}
|
|
20
|
-
interface ExecuteStaticScheduleOptions {
|
|
21
|
-
cron: string;
|
|
22
|
-
definition: ScheduleDefinition;
|
|
23
|
-
name: string;
|
|
24
|
-
scheduledAt?: Date;
|
|
25
|
-
waitUntil?: (promise: PromiseLike<unknown>) => void;
|
|
26
|
-
}
|
|
27
|
-
interface ExecuteRuntimeScheduleOptions {
|
|
28
|
-
id: string;
|
|
29
|
-
requireDue?: boolean;
|
|
30
|
-
runtimeScheduleStore?: RuntimeScheduleStore;
|
|
31
|
-
scheduledAt?: Date;
|
|
32
|
-
scheduleRunStore?: ScheduleRunStore;
|
|
33
|
-
waitUntil?: (promise: PromiseLike<unknown>) => void;
|
|
34
|
-
}
|
|
35
|
-
declare function createScheduleRun(options: Omit<ExecuteScheduleOptions, "definition" | "waitUntil">): Promise<ScheduleRunRecord>;
|
|
36
|
-
declare function executeSchedule(options: ExecuteScheduleOptions): Promise<ScheduleRunRecord>;
|
|
37
|
-
declare function executeStaticSchedule(options: ExecuteStaticScheduleOptions): Promise<ScheduleRunRecord>;
|
|
38
|
-
declare function executeRuntimeSchedule(options: ExecuteRuntimeScheduleOptions | string): Promise<ScheduleRunRecord>;
|
|
39
|
-
//#endregion
|
|
40
7
|
//#region src/errors.d.ts
|
|
41
|
-
declare const scheduleErrorCodes: readonly ["
|
|
42
|
-
declare const scheduleErrorFields: readonly ["cron", "
|
|
8
|
+
declare const scheduleErrorCodes: readonly ["SCHEDULE_DEFINITION_NOT_FOUND", "SCHEDULE_INVALID_CRON", "SCHEDULE_INVALID_SCHEDULED_AT", "SCHEDULE_MANUAL_RUN_DISABLED", "SCHEDULE_NOT_DUE", "SCHEDULE_RUN_NOT_FOUND"];
|
|
9
|
+
declare const scheduleErrorFields: readonly ["cron", "scheduledAt"];
|
|
43
10
|
declare const scheduleErrorValueTypes: readonly ["array", "bigint", "boolean", "date", "function", "null", "number", "object", "string", "symbol", "undefined", "unknown"];
|
|
44
11
|
type ScheduleErrorCode = typeof scheduleErrorCodes[number];
|
|
45
12
|
type ScheduleErrorField = typeof scheduleErrorFields[number];
|
|
@@ -50,4 +17,4 @@ type ScheduleErrorDetails = {
|
|
|
50
17
|
valueType: ScheduleErrorValueType;
|
|
51
18
|
};
|
|
52
19
|
//#endregion
|
|
53
|
-
export { type DiscoveredScheduleDefinition, type KVScheduleStoreOptions, type
|
|
20
|
+
export { type DiscoveredScheduleDefinition, type KVScheduleStoreOptions, type ScheduleDefinition, type ScheduleDefinitionInput, type ScheduleDefinitionRegistry, type ScheduleErrorCode, type ScheduleErrorDetails, type ScheduleErrorField, type ScheduleErrorValueType, type ScheduleHandler, type ScheduleKVStorage, type ScheduleRegistryDefinition, type ScheduleRunAttemptRecord, type ScheduleRunAttemptStatus, type ScheduleRunContext, type ScheduleRunError, type ScheduleRunListOptions, type ScheduleRunRecord, type ScheduleRunResponse, type ScheduleRunStatus, type ScheduleRunStore, type ScheduleValidationErrorCode, defineSchedule };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import { defineSchedule
|
|
2
|
-
|
|
3
|
-
import { a as executeStaticSchedule, i as executeSchedule, n as executeRuntimeSchedule, t as createScheduleRun } from "./execute-B-pii4wf.js";
|
|
4
|
-
import { a as resetScheduleRuntime, c as setScheduleRuntimeRegistry, d as createMemoryRuntimeScheduleStore, f as createMemoryScheduleRunStore, i as loadScheduleDefinition, l as createKVRuntimeScheduleStore, n as getScheduleRunStore, o as setRuntimeScheduleStore, r as getScheduleRuntimeRegistry, s as setScheduleRunStore, t as getRuntimeScheduleStore, u as createKVScheduleRunStore } from "./state-By7WU_ks.js";
|
|
5
|
-
import { n as validateRuntimeScheduleCron, t as schedules } from "./client-DpCD4YFE.js";
|
|
6
|
-
import { t as createScheduleKVStorage } from "./kv-storage-DWinmLLy.js";
|
|
7
|
-
export { createKVRuntimeScheduleStore, createKVScheduleRunStore, createMemoryRuntimeScheduleStore, createMemoryScheduleRunStore, createScheduleKVStorage, createScheduleRun, defineSchedule, defineScheduleTarget, discoverScheduleDefinitions, executeRuntimeSchedule, executeSchedule, executeStaticSchedule, getRuntimeScheduleStore, getScheduleRunStore, getScheduleRuntimeRegistry, loadScheduleDefinition, resetScheduleRuntime, schedules, setRuntimeScheduleStore, setScheduleRunStore, setScheduleRuntimeRegistry, validateRuntimeScheduleCron };
|
|
1
|
+
import { t as defineSchedule } from "./definition-CMiOg1lg.js";
|
|
2
|
+
export { defineSchedule };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
|
+
function normalizeWindowsPath(input = "") {
|
|
4
|
+
if (!input) return input;
|
|
5
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6
|
+
}
|
|
7
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
8
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
9
|
+
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
10
|
+
function cwd() {
|
|
11
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
12
|
+
return "/";
|
|
13
|
+
}
|
|
14
|
+
const resolve = function(...arguments_) {
|
|
15
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
16
|
+
let resolvedPath = "";
|
|
17
|
+
let resolvedAbsolute = false;
|
|
18
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
19
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
20
|
+
if (!path || path.length === 0) continue;
|
|
21
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
22
|
+
resolvedAbsolute = isAbsolute(path);
|
|
23
|
+
}
|
|
24
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
25
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
26
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
27
|
+
};
|
|
28
|
+
function normalizeString(path, allowAboveRoot) {
|
|
29
|
+
let res = "";
|
|
30
|
+
let lastSegmentLength = 0;
|
|
31
|
+
let lastSlash = -1;
|
|
32
|
+
let dots = 0;
|
|
33
|
+
let char = null;
|
|
34
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
35
|
+
if (index < path.length) char = path[index];
|
|
36
|
+
else if (char === "/") break;
|
|
37
|
+
else char = "/";
|
|
38
|
+
if (char === "/") {
|
|
39
|
+
if (lastSlash === index - 1 || dots === 1);
|
|
40
|
+
else if (dots === 2) {
|
|
41
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
42
|
+
if (res.length > 2) {
|
|
43
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
44
|
+
if (lastSlashIndex === -1) {
|
|
45
|
+
res = "";
|
|
46
|
+
lastSegmentLength = 0;
|
|
47
|
+
} else {
|
|
48
|
+
res = res.slice(0, lastSlashIndex);
|
|
49
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
50
|
+
}
|
|
51
|
+
lastSlash = index;
|
|
52
|
+
dots = 0;
|
|
53
|
+
continue;
|
|
54
|
+
} else if (res.length > 0) {
|
|
55
|
+
res = "";
|
|
56
|
+
lastSegmentLength = 0;
|
|
57
|
+
lastSlash = index;
|
|
58
|
+
dots = 0;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (allowAboveRoot) {
|
|
63
|
+
res += res.length > 0 ? "/.." : "..";
|
|
64
|
+
lastSegmentLength = 2;
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
68
|
+
else res = path.slice(lastSlash + 1, index);
|
|
69
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
70
|
+
}
|
|
71
|
+
lastSlash = index;
|
|
72
|
+
dots = 0;
|
|
73
|
+
} else if (char === "." && dots !== -1) ++dots;
|
|
74
|
+
else dots = -1;
|
|
75
|
+
}
|
|
76
|
+
return res;
|
|
77
|
+
}
|
|
78
|
+
const isAbsolute = function(p) {
|
|
79
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
80
|
+
};
|
|
81
|
+
const relative = function(from, to) {
|
|
82
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
83
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
84
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
|
|
85
|
+
const _fromCopy = [..._from];
|
|
86
|
+
for (const segment of _fromCopy) {
|
|
87
|
+
if (_to[0] !== segment) break;
|
|
88
|
+
_from.shift();
|
|
89
|
+
_to.shift();
|
|
90
|
+
}
|
|
91
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
92
|
+
};
|
|
93
|
+
const dirname = function(p) {
|
|
94
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
95
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
96
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region ../internal/src/inspect.ts
|
|
100
|
+
function relativeDefinitionFile(projectRoot, file) {
|
|
101
|
+
return relative(projectRoot, file).replaceAll("\\", "/");
|
|
102
|
+
}
|
|
103
|
+
const redactedInspectionValue = "[redacted]";
|
|
104
|
+
const secretKeyPattern = /secret|token|passw(?:or)?d|credential|api[-_\s]?key|private[-_\s]?key|authorization|cookie|signature|dsn|connection[-_\s]?string/i;
|
|
105
|
+
const embeddedUrlCredentialPattern = /\b([a-z][a-z0-9+.-]*:\/\/)[^/\s?#]*@/gi;
|
|
106
|
+
const embeddedCookiePattern = /\b([\w-]*cookie[\w-]*["']?\s*[:=]\s*)(?:"(?:\\[^\r\n]|[^"\\\r\n])*"(?:\s*;\s*[\w.-]+\s*=[^;\r\n]*)*|'(?:\\[^\r\n]|[^'\\\r\n])*'(?:\s*;\s*[\w.-]+\s*=[^;\r\n]*)*|[^\r\n]+?(?=\s*(?:;\s*[^;=\r\n/]+\s*(?:\r?\n|$)|&|\r?\n|$)))/gi;
|
|
107
|
+
const embeddedBearerPattern = /\bbearer\s+[^\s,;]+/gi;
|
|
108
|
+
const embeddedAuthorizationPattern = new RegExp(String.raw`\b([\w-]*authorization[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\r\n]+?(?=\s*(?:[,;])?\s*(?:${secretKeyPattern.source})[\w-]*\s*[:=]|\s+rejected\b|$))`, "gi");
|
|
109
|
+
const embeddedSecretAssignmentPattern = new RegExp(String.raw`\b([\w-]*(?:${secretKeyPattern.source})[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\s,;&#&]+)`, "gi");
|
|
110
|
+
/**
|
|
111
|
+
* Removes credentials inside free text, for example an error message. URL credentials, bearer tokens, and
|
|
112
|
+
* `name=value` pairs with a secret name are replaced with `[redacted]`.
|
|
113
|
+
*/
|
|
114
|
+
function redactInspectionText(value) {
|
|
115
|
+
return value.replace(embeddedUrlCredentialPattern, `$1${redactedInspectionValue}@`).replace(embeddedAuthorizationPattern, `$1${redactedInspectionValue}`).replace(embeddedCookiePattern, `$1${redactedInspectionValue}`).replace(embeddedBearerPattern, `Bearer ${redactedInspectionValue}`).replace(embeddedSecretAssignmentPattern, `$1${redactedInspectionValue}`);
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { relative as a, isAbsolute as i, relativeDefinitionFile as n, resolve as o, dirname as r, redactInspectionText as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/runtime/kv-storage.d.ts
|
|
2
|
+
interface ScheduleKVStorage {
|
|
3
|
+
del(key: string): boolean | Promise<boolean> | Promise<void> | void;
|
|
4
|
+
get<T = unknown>(key: string): Promise<T | null | undefined> | T | null | undefined;
|
|
5
|
+
has(key: string): boolean | Promise<boolean>;
|
|
6
|
+
keys(base?: string): Promise<string[]> | string[];
|
|
7
|
+
set<T = unknown>(key: string, value: T): Promise<void> | void;
|
|
8
|
+
}
|
|
9
|
+
interface ViteHubKVStorage {
|
|
10
|
+
del(key: string): Promise<readonly [unknown, unknown]>;
|
|
11
|
+
get<T = unknown>(key: string): Promise<readonly [unknown, T | null | undefined]>;
|
|
12
|
+
has(key: string): Promise<readonly [unknown, boolean | undefined]>;
|
|
13
|
+
keys(base?: string): Promise<readonly [unknown, string[] | undefined]>;
|
|
14
|
+
set<T = unknown>(key: string, value: T): Promise<readonly [unknown, unknown]>;
|
|
15
|
+
}
|
|
16
|
+
declare function createScheduleKVStorage(kvStore: ViteHubKVStorage): ScheduleKVStorage;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { createScheduleKVStorage as n, ScheduleKVStorage as t };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ScheduleVitePluginOptions } from "./vite.js";
|
|
2
|
-
|
|
1
|
+
import { i as ScheduleVitePluginOptions } from "./vite-BAVyZ8hZ.js";
|
|
3
2
|
//#region src/nuxt.d.ts
|
|
4
|
-
interface ScheduleNuxtModuleOptions extends ScheduleVitePluginOptions {}
|
|
3
|
+
export interface ScheduleNuxtModuleOptions extends ScheduleVitePluginOptions {}
|
|
5
4
|
type NuxtLike = {
|
|
6
5
|
hook?: (name: "nitro:config", handler: (nitroConfig: Record<string, unknown>) => void | Promise<void>) => void;
|
|
7
6
|
options: {
|
|
@@ -14,6 +13,5 @@ type NuxtLike = {
|
|
|
14
13
|
};
|
|
15
14
|
};
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { ScheduleNuxtModuleOptions, viteHubScheduleNuxtModule as default };
|
|
16
|
+
export default function viteHubScheduleNuxtModule(options?: ScheduleNuxtModuleOptions, nuxt?: NuxtLike): void;
|
|
17
|
+
//#endregion
|
package/dist/nuxt.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as hubSchedule, t as createScheduleNitroConfig } from "./vite-
|
|
1
|
+
import { n as hubSchedule, t as createScheduleNitroConfig } from "./vite-BJwZkMrn.js";
|
|
2
2
|
//#region src/nuxt.ts
|
|
3
3
|
function isScheduleVitePlugin(value) {
|
|
4
4
|
return Boolean(value && typeof value === "object" && value.name === "@vite-hub/schedule/vite");
|
|
@@ -16,6 +16,7 @@ function viteHubScheduleNuxtModule(options = {}, nuxt) {
|
|
|
16
16
|
command: nuxt.options.dev ? "serve" : "build",
|
|
17
17
|
nitroOwnsPaths: true,
|
|
18
18
|
nitro: nitroConfig,
|
|
19
|
+
plugins: nuxt.options.vite?.plugins,
|
|
19
20
|
projectRoot: options.projectRoot || rootDir,
|
|
20
21
|
root: nuxt.options.srcDir || rootDir
|
|
21
22
|
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { t as redactInspectionText } from "./inspect-DTfAo5gS.js";
|
|
2
|
+
import { i as runSchedule } from "./execute-BJrgNgQ0.js";
|
|
3
|
+
import { t as getScheduleRunStore } from "./state-DSxmHPn3.js";
|
|
4
|
+
//#region src/runtime/operations.ts
|
|
5
|
+
function isoDate(value) {
|
|
6
|
+
if (value === void 0) return;
|
|
7
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
8
|
+
return Number.isNaN(date.getTime()) ? String(value) : date.toISOString();
|
|
9
|
+
}
|
|
10
|
+
function summarizeError(error) {
|
|
11
|
+
if (!error) return;
|
|
12
|
+
const summary = { message: redactInspectionText(error.message) };
|
|
13
|
+
if (error.name) summary.name = redactInspectionText(error.name);
|
|
14
|
+
return summary;
|
|
15
|
+
}
|
|
16
|
+
function summarizeScheduleRun(run) {
|
|
17
|
+
const error = summarizeError(run.error);
|
|
18
|
+
const completedAt = isoDate(run.completedAt);
|
|
19
|
+
const startedAt = isoDate(run.startedAt);
|
|
20
|
+
const summary = {
|
|
21
|
+
attemptCount: run.attemptCount,
|
|
22
|
+
id: run.id,
|
|
23
|
+
scheduleId: run.scheduleId,
|
|
24
|
+
scheduledAt: isoDate(run.scheduledAt) ?? "",
|
|
25
|
+
status: run.status,
|
|
26
|
+
target: run.target
|
|
27
|
+
};
|
|
28
|
+
if (completedAt) summary.completedAt = completedAt;
|
|
29
|
+
if (error) summary.error = error;
|
|
30
|
+
if (run.response) summary.response = {
|
|
31
|
+
status: run.response.status,
|
|
32
|
+
statusText: redactInspectionText(run.response.statusText)
|
|
33
|
+
};
|
|
34
|
+
if (startedAt) summary.startedAt = startedAt;
|
|
35
|
+
return summary;
|
|
36
|
+
}
|
|
37
|
+
function summarizeManualScheduleRun(run) {
|
|
38
|
+
const error = summarizeError(run.error);
|
|
39
|
+
const completedAt = isoDate(run.completedAt);
|
|
40
|
+
const startedAt = isoDate(run.startedAt);
|
|
41
|
+
return {
|
|
42
|
+
...completedAt ? { completedAt } : {},
|
|
43
|
+
...error ? { error } : {},
|
|
44
|
+
id: run.id,
|
|
45
|
+
scheduleId: run.scheduleId,
|
|
46
|
+
...startedAt ? { startedAt } : {},
|
|
47
|
+
status: run.status
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function summarizeScheduleRunAttempt(attempt) {
|
|
51
|
+
const error = summarizeError(attempt.error);
|
|
52
|
+
const completedAt = isoDate(attempt.completedAt);
|
|
53
|
+
return {
|
|
54
|
+
...completedAt ? { completedAt } : {},
|
|
55
|
+
...error ? { error } : {},
|
|
56
|
+
id: attempt.id,
|
|
57
|
+
runId: attempt.runId,
|
|
58
|
+
startedAt: isoDate(attempt.startedAt) ?? "",
|
|
59
|
+
status: attempt.status
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function newestFirst(left, right) {
|
|
63
|
+
return new Date(right.scheduledAt).getTime() - new Date(left.scheduledAt).getTime();
|
|
64
|
+
}
|
|
65
|
+
/** Lists the recorded runs of one Schedule Definition, newest first. */
|
|
66
|
+
async function listScheduleRuns(scheduleId, options = {}) {
|
|
67
|
+
const runs = (await getScheduleRunStore().listRuns({
|
|
68
|
+
scheduleId,
|
|
69
|
+
limit: options.limit
|
|
70
|
+
})).filter((run) => run.scheduleId === scheduleId).sort(newestFirst);
|
|
71
|
+
return (options.limit === void 0 ? runs : runs.slice(0, options.limit)).map(summarizeScheduleRun);
|
|
72
|
+
}
|
|
73
|
+
/** Lists the attempts of one Schedule Run, oldest first. */
|
|
74
|
+
async function listScheduleRunAttempts(runId) {
|
|
75
|
+
return [...await getScheduleRunStore().listAttempts(runId)].sort((left, right) => new Date(left.startedAt).getTime() - new Date(right.startedAt).getTime()).map(summarizeScheduleRunAttempt);
|
|
76
|
+
}
|
|
77
|
+
/** Raised for the failures of a Schedule operation. `status` and `code` reach every surface. */
|
|
78
|
+
var ScheduleOperationError = class extends Error {
|
|
79
|
+
code;
|
|
80
|
+
fix;
|
|
81
|
+
status;
|
|
82
|
+
constructor(status, code, message, fix) {
|
|
83
|
+
super(message);
|
|
84
|
+
this.code = code;
|
|
85
|
+
this.status = status;
|
|
86
|
+
if (fix) this.fix = fix;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const errorStatus = {
|
|
90
|
+
SCHEDULE_DEFINITION_NOT_FOUND: 404,
|
|
91
|
+
SCHEDULE_HISTORY_INCOMPLETE: 503,
|
|
92
|
+
SCHEDULE_MANUAL_RUN_DISABLED: 403,
|
|
93
|
+
SCHEDULE_RUN_NOT_FOUND: 404
|
|
94
|
+
};
|
|
95
|
+
/** Gives a Schedule error the status and the redacted message that every surface reports. */
|
|
96
|
+
async function attempt(work) {
|
|
97
|
+
try {
|
|
98
|
+
return await work();
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (error instanceof ScheduleOperationError) throw error;
|
|
101
|
+
const code = Reflect.get(Object(error), "code");
|
|
102
|
+
const status = String(code) === code ? errorStatus[code] : void 0;
|
|
103
|
+
if (status && error instanceof Error) throw new ScheduleOperationError(status, String(code), redactInspectionText(error.message));
|
|
104
|
+
throw new ScheduleOperationError(500, "OPERATION_FAILED", "Schedule operation failed.");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function runScheduleRuns(input) {
|
|
108
|
+
return await attempt(async () => ({ runs: await listScheduleRuns(input.id, { limit: input.limit ?? 100 }) }));
|
|
109
|
+
}
|
|
110
|
+
async function runScheduleAttempts(input) {
|
|
111
|
+
return await attempt(async () => {
|
|
112
|
+
const run = await getScheduleRunStore().getRun(input.id);
|
|
113
|
+
if (!run) throw new ScheduleOperationError(404, "SCHEDULE_RUN_NOT_FOUND", "Schedule Run was not found.", "List the runs of the Schedule with `vitehub schedule runs <name>` and pass one of their ids.");
|
|
114
|
+
return {
|
|
115
|
+
attempts: await listScheduleRunAttempts(input.id),
|
|
116
|
+
run: summarizeScheduleRun(run)
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** The manual Static Schedule Definitions that the Console installed. Only `console.invoke` installs them. */
|
|
121
|
+
const consoleSchedulesKey = Symbol.for("vitehub.console.schedules");
|
|
122
|
+
/**
|
|
123
|
+
* Runs a Static Schedule Definition that sets `manual: true`. The registry holds only those definitions, and it is empty
|
|
124
|
+
* unless Console invocation is enabled, so anything else is "not available".
|
|
125
|
+
*/
|
|
126
|
+
async function runScheduleNow(input, registry = Reflect.get(globalThis, consoleSchedulesKey) ?? {}) {
|
|
127
|
+
if (!Object.hasOwn(registry, input.name)) throw new ScheduleOperationError(404, "SCHEDULE_DEFINITION_NOT_FOUND", "Schedule run is not available. Set manual: true on the Schedule Definition and enable Console invocation.", "Set `manual: true` in defineSchedule() and keep `console.invoke` on (it is on in development).");
|
|
128
|
+
return await attempt(async () => ({ run: summarizeManualScheduleRun(await runSchedule(input.name, { registry })) }));
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { listScheduleRunAttempts, listScheduleRuns, runScheduleAttempts, runScheduleNow, runScheduleRuns, summarizeScheduleRun, summarizeScheduleRunAttempt };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
2
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
3
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
4
|
+
/** The Standard properties. */
|
|
5
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
6
|
+
}
|
|
7
|
+
declare namespace StandardTypedV1 {
|
|
8
|
+
/** The Standard Typed properties interface. */
|
|
9
|
+
interface Props<Input = unknown, Output = Input> {
|
|
10
|
+
/** The version number of the standard. */
|
|
11
|
+
readonly version: 1;
|
|
12
|
+
/** The vendor name of the schema library. */
|
|
13
|
+
readonly vendor: string;
|
|
14
|
+
/** Inferred types associated with the schema. */
|
|
15
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** The Standard Typed types interface. */
|
|
18
|
+
interface Types<Input = unknown, Output = Input> {
|
|
19
|
+
/** The input type of the schema. */
|
|
20
|
+
readonly input: Input;
|
|
21
|
+
/** The output type of the schema. */
|
|
22
|
+
readonly output: Output;
|
|
23
|
+
}
|
|
24
|
+
/** Infers the input type of a Standard Typed. */
|
|
25
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
26
|
+
/** Infers the output type of a Standard Typed. */
|
|
27
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
28
|
+
}
|
|
29
|
+
/** The Standard Schema interface. */
|
|
30
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
31
|
+
/** The Standard Schema properties. */
|
|
32
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
33
|
+
}
|
|
34
|
+
declare namespace StandardSchemaV1 {
|
|
35
|
+
/** The Standard Schema properties interface. */
|
|
36
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
37
|
+
/** Validates unknown input values. */
|
|
38
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
39
|
+
}
|
|
40
|
+
/** The result interface of the validate function. */
|
|
41
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
42
|
+
/** The result interface if validation succeeds. */
|
|
43
|
+
interface SuccessResult<Output> {
|
|
44
|
+
/** The typed output value. */
|
|
45
|
+
readonly value: Output;
|
|
46
|
+
/** A falsy value for `issues` indicates success. */
|
|
47
|
+
readonly issues?: undefined;
|
|
48
|
+
}
|
|
49
|
+
interface Options {
|
|
50
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
51
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** The result interface if validation fails. */
|
|
54
|
+
interface FailureResult {
|
|
55
|
+
/** The issues of failed validation. */
|
|
56
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
57
|
+
}
|
|
58
|
+
/** The issue interface of the failure output. */
|
|
59
|
+
interface Issue {
|
|
60
|
+
/** The error message of the issue. */
|
|
61
|
+
readonly message: string;
|
|
62
|
+
/** The path of the issue, if any. */
|
|
63
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
64
|
+
}
|
|
65
|
+
/** The path segment interface of the issue. */
|
|
66
|
+
interface PathSegment {
|
|
67
|
+
/** The key representing a path segment. */
|
|
68
|
+
readonly key: PropertyKey;
|
|
69
|
+
}
|
|
70
|
+
/** The Standard types interface. */
|
|
71
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
72
|
+
/** Infers the input type of a Standard. */
|
|
73
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
74
|
+
/** Infers the output type of a Standard. */
|
|
75
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region ../internal/src/operations.d.ts
|
|
79
|
+
/** `read` never changes state. `write` changes state. `destructive` deletes or publishes. */
|
|
80
|
+
type OperationKind = "read" | "write" | "destructive";
|
|
81
|
+
/** The signed-in user of a call. */
|
|
82
|
+
interface OperationUser {
|
|
83
|
+
id: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
email?: string;
|
|
86
|
+
image?: string;
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
/** The Agent Actor when an agent calls through a capability or MCP on behalf of a user. */
|
|
90
|
+
interface OperationActor {
|
|
91
|
+
id: string;
|
|
92
|
+
kind?: string;
|
|
93
|
+
label?: string;
|
|
94
|
+
meta?: object;
|
|
95
|
+
}
|
|
96
|
+
/** The checked Console access of a call. `vite-hub` issues it. `ConsoleAccess` has this shape. */
|
|
97
|
+
interface OperationAccess {
|
|
98
|
+
readonly mode: string;
|
|
99
|
+
/**
|
|
100
|
+
* The sections that the call may use. `"all"` when no section filter applies. An entry is a section id (`"kv"`, every
|
|
101
|
+
* operation of the section) or `"<section>:read"` (only the operations that read).
|
|
102
|
+
*/
|
|
103
|
+
readonly sections: "all" | readonly string[];
|
|
104
|
+
readonly user?: OperationUser;
|
|
105
|
+
}
|
|
106
|
+
interface OperationContext {
|
|
107
|
+
/** The checked Console access of the call. */
|
|
108
|
+
access: OperationAccess;
|
|
109
|
+
/** The signed-in user, or null. */
|
|
110
|
+
user: OperationUser | null;
|
|
111
|
+
/** The Agent Actor when an agent calls on behalf of `user`. */
|
|
112
|
+
actor?: OperationActor;
|
|
113
|
+
surface: "console" | "cli" | "mcp" | "agent";
|
|
114
|
+
/** Set by the host from generated build identity, never from request input or runtime NODE_ENV. */
|
|
115
|
+
development?: boolean;
|
|
116
|
+
env?: Record<string, unknown>;
|
|
117
|
+
waitUntil?: (task: Promise<unknown>) => void;
|
|
118
|
+
request?: Request;
|
|
119
|
+
/** Operations set a success status here, such as 202 for an accepted call. */
|
|
120
|
+
response?: {
|
|
121
|
+
status?: number;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* An agent or an MCP client may pass `lease: "override"` to `content.save`, `content.remove`, and `content.restore`
|
|
125
|
+
* only when the developer allowed it. Defaults to false, so a model cannot take over a document that a person is editing.
|
|
126
|
+
*/
|
|
127
|
+
overrideLeases?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* What an Agent may read of the Channel conversations, set by `operations({ conversations })`. `participant`: only the
|
|
130
|
+
* threads that the Actor takes part in. `all`: every thread. Unset: none.
|
|
131
|
+
*/
|
|
132
|
+
conversations?: "all" | "participant";
|
|
133
|
+
}
|
|
134
|
+
interface OperationDefinition<Input, Output> {
|
|
135
|
+
/** `<section>.<verb>`, such as `content.publish`. Unique per app. */
|
|
136
|
+
name: string;
|
|
137
|
+
/** One sentence. Becomes the CLI help line and the MCP tool description. */
|
|
138
|
+
description: string;
|
|
139
|
+
/**
|
|
140
|
+
* Console section that grants access, such as `content`. `false`: any Console user. A function reads the section
|
|
141
|
+
* from the input, for operations that serve several sections.
|
|
142
|
+
*/
|
|
143
|
+
section: string | false | ((input: Input) => string | undefined);
|
|
144
|
+
/** `read` never changes state. `write` changes state. `destructive` deletes or publishes; the CLI asks for `--yes`, MCP marks `destructiveHint`, agents require approval by default. */
|
|
145
|
+
kind: OperationKind;
|
|
146
|
+
/** Standard Schema (valibot in this repo). Its Standard JSON Schema builds CLI flags and the MCP input schema. */
|
|
147
|
+
input: StandardSchemaV1<unknown, Input>;
|
|
148
|
+
output?: StandardSchemaV1<unknown, Output>;
|
|
149
|
+
cli?: {
|
|
150
|
+
/** Defaults: namespace = section, command = verb. */
|
|
151
|
+
namespace?: string;
|
|
152
|
+
command?: string;
|
|
153
|
+
/** Input keys read from positional arguments, in order. */
|
|
154
|
+
positional?: string[];
|
|
155
|
+
/** Human output, written verbatim. Without it the CLI prints JSON. `--json` always prints JSON. */
|
|
156
|
+
format?: (output: Output) => string;
|
|
157
|
+
/** `vitehub <namespace>` runs this command when no command is named, such as `vitehub usage`. */
|
|
158
|
+
default?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Route of the app that takes a signed dispatch of this operation, such as `/_vitehub/schedules/run`. With `--url`
|
|
161
|
+
* and a dispatch key in the environment (`VITEHUB_DISPATCH_KEY`), the command signs the input and posts it there, so
|
|
162
|
+
* a CI job needs no Console credentials. Without a key it calls the RPC.
|
|
163
|
+
*/
|
|
164
|
+
dispatch?: string;
|
|
165
|
+
};
|
|
166
|
+
/** Largest request body in bytes. It can raise the 64 KiB default but not lower it. */
|
|
167
|
+
maxRequestBytes?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Returns true when this call only reads, such as a dry run of a `destructive` operation. The CLI then skips the
|
|
170
|
+
* confirmation, and agents run it without approval. Without it, every call of a `destructive` operation asks.
|
|
171
|
+
*/
|
|
172
|
+
readOnlyWhen?: (input: Input) => boolean;
|
|
173
|
+
/** `false`: MCP does not offer the operation as a tool, such as an editor transport that only the Console uses. */
|
|
174
|
+
mcp?: false;
|
|
175
|
+
/** `false`: the operation never reads `context.user`, so the Console skips the session lookup for it. */
|
|
176
|
+
user?: false;
|
|
177
|
+
/**
|
|
178
|
+
* The operation runs code of the app, such as a workflow, a job, a task, or a schedule. The Console registers it only
|
|
179
|
+
* when `console.invoke` is on, which is the default in development and off in a production build.
|
|
180
|
+
*/
|
|
181
|
+
invoke?: true;
|
|
182
|
+
run: (input: Input, context: OperationContext) => Output | Promise<Output>;
|
|
183
|
+
}
|
|
184
|
+
/** An operation of any input and output, as a registry holds it. */
|
|
185
|
+
interface AnyOperation extends Omit<OperationDefinition<unknown, unknown>, "cli" | "input" | "output" | "readOnlyWhen" | "run" | "section"> {
|
|
186
|
+
readOnlyWhen?: (input: never) => boolean;
|
|
187
|
+
cli?: {
|
|
188
|
+
namespace?: string;
|
|
189
|
+
command?: string;
|
|
190
|
+
default?: boolean;
|
|
191
|
+
dispatch?: string;
|
|
192
|
+
positional?: string[];
|
|
193
|
+
format?: (output: never) => string;
|
|
194
|
+
};
|
|
195
|
+
input: StandardSchemaV1;
|
|
196
|
+
output?: StandardSchemaV1;
|
|
197
|
+
run: (input: never, context: OperationContext) => unknown;
|
|
198
|
+
section: string | false | ((input: never) => string | undefined);
|
|
199
|
+
}
|
|
200
|
+
/** The contribution of one plugin: operations, or a module that exports them. */
|
|
201
|
+
interface OperationContributionEntry {
|
|
202
|
+
/** Module the app imports, such as `@vite-hub/content/operations`. */
|
|
203
|
+
module: string;
|
|
204
|
+
/** Named export that holds an operation or an array of operations. Defaults to `default`. */
|
|
205
|
+
export?: string;
|
|
206
|
+
/** Loads the export in the tool process, for a module that the tool cannot resolve by name. */
|
|
207
|
+
load?: () => Promise<unknown>;
|
|
208
|
+
/** `false`: the app already has these operations at runtime. Only tools such as the CLI and `vitehub inspect` read the entry. */
|
|
209
|
+
runtime?: false;
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
export { OperationContributionEntry as n, AnyOperation as t };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { h as ScheduleRunStatus, l as ScheduleRunAttemptStatus } from "./types-CHdV9FQU.js";
|
|
2
|
+
import { t as AnyOperation } from "./operations-tNUdj3G4.js";
|
|
3
|
+
//#region src/runtime/operations.d.ts
|
|
4
|
+
/** Error of a run or attempt. The stack is not included. */
|
|
5
|
+
interface ScheduleRunErrorSummary {
|
|
6
|
+
message: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Serializable view of one Schedule Run. The response body is not included. */
|
|
10
|
+
interface ScheduleRunSummary {
|
|
11
|
+
attemptCount: number;
|
|
12
|
+
completedAt?: string;
|
|
13
|
+
error?: ScheduleRunErrorSummary;
|
|
14
|
+
id: string;
|
|
15
|
+
response?: {
|
|
16
|
+
status: number;
|
|
17
|
+
statusText: string;
|
|
18
|
+
};
|
|
19
|
+
scheduleId: string;
|
|
20
|
+
scheduledAt: string;
|
|
21
|
+
startedAt?: string;
|
|
22
|
+
status: ScheduleRunStatus;
|
|
23
|
+
target: string;
|
|
24
|
+
}
|
|
25
|
+
/** Serializable view of one Schedule Run attempt. */
|
|
26
|
+
interface ScheduleRunAttemptSummary {
|
|
27
|
+
completedAt?: string;
|
|
28
|
+
error?: ScheduleRunErrorSummary;
|
|
29
|
+
id: string;
|
|
30
|
+
runId: string;
|
|
31
|
+
startedAt: string;
|
|
32
|
+
status: ScheduleRunAttemptStatus;
|
|
33
|
+
}
|
|
34
|
+
/** Serializable view of one manual Static Schedule run, as `vitehub schedule run` prints it. */
|
|
35
|
+
interface ManualScheduleRunSummary {
|
|
36
|
+
completedAt?: string;
|
|
37
|
+
error?: ScheduleRunErrorSummary;
|
|
38
|
+
id: string;
|
|
39
|
+
scheduleId: string;
|
|
40
|
+
startedAt?: string;
|
|
41
|
+
status: ScheduleRunStatus;
|
|
42
|
+
}
|
|
43
|
+
/** Result of `schedule.runs`. */
|
|
44
|
+
interface ScheduleRunsResult {
|
|
45
|
+
runs: ScheduleRunSummary[];
|
|
46
|
+
}
|
|
47
|
+
/** Result of `schedule.attempts`. */
|
|
48
|
+
interface ScheduleAttemptsResult {
|
|
49
|
+
attempts: ScheduleRunAttemptSummary[];
|
|
50
|
+
run: ScheduleRunSummary;
|
|
51
|
+
}
|
|
52
|
+
/** Result of `schedule.run`. */
|
|
53
|
+
interface ScheduleRunResult {
|
|
54
|
+
run: ManualScheduleRunSummary;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/operations.d.ts
|
|
58
|
+
/** The `schedule.*` operations: runs, attempts, and run. The Console, `vitehub schedule`, and agents run them. */
|
|
59
|
+
export declare const scheduleOperations: readonly AnyOperation[];
|
|
60
|
+
//#endregion
|
|
61
|
+
export type { ScheduleAttemptsResult, ScheduleRunResult, ScheduleRunsResult };
|