veryfront 0.1.1153 → 0.1.1155
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/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +9 -2
- package/esm/cli/commands/schedule/command-help.d.ts.map +1 -1
- package/esm/cli/commands/schedule/command-help.js +6 -1
- package/esm/cli/commands/schedule/handler.d.ts +10 -0
- package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
- package/esm/cli/commands/schedule/handler.js +105 -1
- package/esm/deno.js +1 -1
- package/esm/src/cache/dependency-graph.d.ts.map +1 -1
- package/esm/src/cache/dependency-graph.js +11 -3
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.js +4 -3
- package/esm/src/modules/react-loader/ssr-module-loader/tmp-paths.js +1 -1
- package/esm/src/routing/api/module-loader/loader.d.ts +1 -4
- package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.js +12 -22
- package/esm/src/runs/index.d.ts +3 -3
- package/esm/src/runs/index.d.ts.map +1 -1
- package/esm/src/runs/index.js +2 -2
- package/esm/src/runs/runs-client.d.ts +24 -1
- package/esm/src/runs/runs-client.d.ts.map +1 -1
- package/esm/src/runs/runs-client.js +43 -1
- package/esm/src/runs/schemas.d.ts +42 -0
- package/esm/src/runs/schemas.d.ts.map +1 -1
- package/esm/src/runs/schemas.js +23 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/login.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAoB,QAAQ,EAAE,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E,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAkC9B;AAED,wBAAsB,mBAAmB,CACvC,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA6B9B;AAED,wBAAsB,MAAM,CAAC,GAAG,GAAE,iBAA0C,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3F;AAyCD,wBAAsB,MAAM,CAC1B,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAiC9B;AAED,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
|
package/esm/cli/auth/login.js
CHANGED
|
@@ -222,11 +222,14 @@ export async function login(method, env = getEnvironmentConfig()) {
|
|
|
222
222
|
return identity;
|
|
223
223
|
}
|
|
224
224
|
export async function ensureAuthenticated(env = getEnvironmentConfig()) {
|
|
225
|
+
const humanOutput = !isJsonMode();
|
|
225
226
|
if (env.apiToken) {
|
|
226
227
|
const credential = await validateCredential(env.apiToken, env);
|
|
227
228
|
if (credential)
|
|
228
229
|
return credential;
|
|
229
|
-
|
|
230
|
+
if (humanOutput) {
|
|
231
|
+
console.log(" " + warning("Warning: VERYFRONT_API_TOKEN is invalid"));
|
|
232
|
+
}
|
|
230
233
|
}
|
|
231
234
|
const storedToken = await readToken(env);
|
|
232
235
|
if (storedToken) {
|
|
@@ -234,8 +237,12 @@ export async function ensureAuthenticated(env = getEnvironmentConfig()) {
|
|
|
234
237
|
if (credential)
|
|
235
238
|
return credential;
|
|
236
239
|
await deleteToken(env);
|
|
237
|
-
|
|
240
|
+
if (humanOutput) {
|
|
241
|
+
console.log(" " + warning("Session expired. Please log in again."));
|
|
242
|
+
}
|
|
238
243
|
}
|
|
244
|
+
if (!humanOutput)
|
|
245
|
+
return null;
|
|
239
246
|
if (!isTTY()) {
|
|
240
247
|
cliLogger.error("Not logged in. Set VERYFRONT_API_TOKEN or run in interactive mode.");
|
|
241
248
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/schedule/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/schedule/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,YAAY,EAAE,WA6B1B,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export const scheduleHelp = {
|
|
2
2
|
name: "schedule",
|
|
3
3
|
category: "ai",
|
|
4
|
-
description: "Run a source-defined schedule locally",
|
|
4
|
+
description: "Run a source-defined schedule locally or in the Veryfront cloud",
|
|
5
5
|
usage: "veryfront schedule run <id> [options]",
|
|
6
6
|
options: [
|
|
7
7
|
{
|
|
8
8
|
flag: "--input <file>",
|
|
9
9
|
description: "JSON input file to override the schedule input",
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
flag: "--remote",
|
|
13
|
+
description: "Run the pushed source schedule in the Veryfront cloud runtime; cannot be combined with --input",
|
|
14
|
+
},
|
|
11
15
|
{
|
|
12
16
|
flag: "--json",
|
|
13
17
|
description: "Output the run result as JSON",
|
|
@@ -20,5 +24,6 @@ export const scheduleHelp = {
|
|
|
20
24
|
examples: [
|
|
21
25
|
"veryfront schedule run daily-triage",
|
|
22
26
|
"veryfront schedule run daily-triage --input fixtures/priority-queue.json --json",
|
|
27
|
+
"veryfront schedule run daily-triage --remote --json",
|
|
23
28
|
],
|
|
24
29
|
};
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { ParsedArgs } from "../../shared/types.js";
|
|
2
|
+
import { type CreateScheduleRunFromSourceResult, type Run, type VeryfrontRunsClient } from "../../../src/runs/index.js";
|
|
3
|
+
import { type TriggerTarget } from "../../../src/trigger/index.js";
|
|
4
|
+
interface RemoteSchedulePollOptions {
|
|
5
|
+
now?: () => number;
|
|
6
|
+
sleep?: (delayMs: number) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function waitForRemoteScheduleRun(client: Pick<VeryfrontRunsClient, "get">, accepted: CreateScheduleRunFromSourceResult, options?: RemoteSchedulePollOptions): Promise<Run>;
|
|
9
|
+
export declare function formatRemoteScheduleRunOutput(run: Run): Record<string, unknown>;
|
|
10
|
+
export declare function resolveRemoteScheduleTarget(run: Run, fallback: TriggerTarget): TriggerTarget;
|
|
2
11
|
export declare function handleScheduleCommand(args: ParsedArgs): Promise<void>;
|
|
12
|
+
export {};
|
|
3
13
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/schedule/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/schedule/handler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIxD,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,GAAG,EACR,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AA+BrF,UAAU,yBAAyB;IACjC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,EACxC,QAAQ,EAAE,iCAAiC,EAC3C,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,GAAG,CAAC,CA2Cd;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAO/E;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,GAAG,aAAa,CAU5F;AA2BD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAkF3E"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
3
|
+
import { resolveConfigWithAuth } from "../../shared/config.js";
|
|
3
4
|
import { withProjectSourceContext } from "../../shared/project-source-context.js";
|
|
4
5
|
import { exitProcess } from "../../utils/index.js";
|
|
5
6
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
7
|
+
import { createRunsClient, } from "../../../src/runs/index.js";
|
|
6
8
|
import { discoverSchedules } from "../../../src/schedule/index.js";
|
|
7
9
|
import { runTriggerTarget } from "../../../src/trigger/index.js";
|
|
8
10
|
import { outputTriggerRun, readJsonFile } from "../trigger-utils.js";
|
|
11
|
+
const REMOTE_SCHEDULE_POLL_INTERVAL_MS = 1_000;
|
|
12
|
+
const REMOTE_SCHEDULE_TIMEOUT_GRACE_MS = 30_000;
|
|
13
|
+
// Bound how long the CLI waits for dispatch without consuming the cloud run's
|
|
14
|
+
// execution budget. The run remains durable in Veryfront if this wait expires.
|
|
15
|
+
const REMOTE_SCHEDULE_QUEUE_WAIT_TIMEOUT_MS = 5 * 60_000;
|
|
9
16
|
const getScheduleArgsSchema = defineSchema((v) => v.object({
|
|
10
17
|
action: v.literal("run"),
|
|
11
18
|
id: v.string(),
|
|
12
19
|
input: v.string().optional(),
|
|
20
|
+
remote: v.boolean().default(false),
|
|
13
21
|
debug: v.boolean().default(false),
|
|
14
22
|
}));
|
|
15
23
|
const ScheduleArgsSchema = lazySchema(getScheduleArgsSchema);
|
|
@@ -17,14 +25,110 @@ const parseScheduleArgs = createArgParser(ScheduleArgsSchema, {
|
|
|
17
25
|
action: { keys: ["action"], type: "string", positional: 0 },
|
|
18
26
|
id: { keys: ["id"], type: "string", positional: 1 },
|
|
19
27
|
input: { keys: ["input"], type: "string" },
|
|
28
|
+
remote: { keys: ["remote"], type: "boolean" },
|
|
20
29
|
debug: { keys: ["debug"], type: "boolean" },
|
|
21
30
|
});
|
|
31
|
+
export async function waitForRemoteScheduleRun(client, accepted, options = {}) {
|
|
32
|
+
const now = options.now ?? Date.now;
|
|
33
|
+
const sleep = options.sleep ??
|
|
34
|
+
((delayMs) => new Promise((resolve) => setTimeout(resolve, delayMs)));
|
|
35
|
+
const runId = accepted.scheduleRun.run_id;
|
|
36
|
+
const acceptedAt = now();
|
|
37
|
+
const queueDeadline = acceptedAt + REMOTE_SCHEDULE_QUEUE_WAIT_TIMEOUT_MS;
|
|
38
|
+
let executionStartedAtMs;
|
|
39
|
+
while (true) {
|
|
40
|
+
const run = await client.get(runId);
|
|
41
|
+
const observedAt = now();
|
|
42
|
+
const parsedStartedAt = run.started_at ? Date.parse(run.started_at) : NaN;
|
|
43
|
+
if (executionStartedAtMs === undefined && Number.isFinite(parsedStartedAt)) {
|
|
44
|
+
executionStartedAtMs = Math.min(parsedStartedAt, observedAt);
|
|
45
|
+
}
|
|
46
|
+
else if (run.status !== "pending" && executionStartedAtMs === undefined) {
|
|
47
|
+
executionStartedAtMs = observedAt;
|
|
48
|
+
}
|
|
49
|
+
if (run.status === "completed" || run.status === "waiting") {
|
|
50
|
+
return run;
|
|
51
|
+
}
|
|
52
|
+
if (run.status === "failed") {
|
|
53
|
+
throw new Error(run.error?.message ?? `Scheduled run failed: ${runId}`);
|
|
54
|
+
}
|
|
55
|
+
if (run.status === "cancelled") {
|
|
56
|
+
throw new Error(`Scheduled run was cancelled: ${runId}`);
|
|
57
|
+
}
|
|
58
|
+
const recordedTimeoutSeconds = run.timeout_seconds;
|
|
59
|
+
const executionTimeoutSeconds = recordedTimeoutSeconds !== null &&
|
|
60
|
+
recordedTimeoutSeconds > 0
|
|
61
|
+
? recordedTimeoutSeconds
|
|
62
|
+
: accepted.timeoutSeconds;
|
|
63
|
+
const executionDeadline = executionStartedAtMs === undefined
|
|
64
|
+
? undefined
|
|
65
|
+
: executionStartedAtMs + executionTimeoutSeconds * 1_000 +
|
|
66
|
+
REMOTE_SCHEDULE_TIMEOUT_GRACE_MS;
|
|
67
|
+
if (executionDeadline !== undefined && observedAt >= executionDeadline) {
|
|
68
|
+
throw new Error(`Timed out waiting for scheduled run: ${runId}`);
|
|
69
|
+
}
|
|
70
|
+
if (executionStartedAtMs === undefined && observedAt >= queueDeadline) {
|
|
71
|
+
throw new Error(`Timed out waiting for scheduled run to start: ${runId}`);
|
|
72
|
+
}
|
|
73
|
+
await sleep(REMOTE_SCHEDULE_POLL_INTERVAL_MS);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export function formatRemoteScheduleRunOutput(run) {
|
|
77
|
+
return {
|
|
78
|
+
runId: run.run_id,
|
|
79
|
+
status: run.status,
|
|
80
|
+
...(run.waiting_reason ? { waitingReason: run.waiting_reason } : {}),
|
|
81
|
+
result: run.output,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function resolveRemoteScheduleTarget(run, fallback) {
|
|
85
|
+
if (!run.target)
|
|
86
|
+
return fallback;
|
|
87
|
+
const separator = run.target.indexOf(":");
|
|
88
|
+
if (separator < 1)
|
|
89
|
+
return fallback;
|
|
90
|
+
const kind = run.target.slice(0, separator);
|
|
91
|
+
const id = run.target.slice(separator + 1).trim();
|
|
92
|
+
if ((kind !== "agent" && kind !== "task" && kind !== "workflow") || id.length === 0) {
|
|
93
|
+
return fallback;
|
|
94
|
+
}
|
|
95
|
+
return { kind, id };
|
|
96
|
+
}
|
|
97
|
+
async function runRemoteSchedule(projectDir, opts) {
|
|
98
|
+
const startedAt = Date.now();
|
|
99
|
+
const cliConfig = await resolveConfigWithAuth(projectDir);
|
|
100
|
+
const client = createRunsClient({
|
|
101
|
+
apiUrl: cliConfig.apiUrl,
|
|
102
|
+
authToken: cliConfig.apiToken,
|
|
103
|
+
projectReference: cliConfig.projectSlug,
|
|
104
|
+
});
|
|
105
|
+
const accepted = await client.createScheduleRunFromSource({
|
|
106
|
+
sourceTriggerId: opts.id,
|
|
107
|
+
idempotencyKey: `schedule-cli:${dntShim.crypto.randomUUID()}`,
|
|
108
|
+
});
|
|
109
|
+
const remoteRun = await waitForRemoteScheduleRun(client, accepted);
|
|
110
|
+
await outputTriggerRun({
|
|
111
|
+
command: "schedule",
|
|
112
|
+
triggerId: opts.id,
|
|
113
|
+
target: resolveRemoteScheduleTarget(remoteRun, accepted.target),
|
|
114
|
+
output: formatRemoteScheduleRunOutput(remoteRun),
|
|
115
|
+
durationMs: remoteRun.duration_ms ?? Date.now() - startedAt,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
22
118
|
export async function handleScheduleCommand(args) {
|
|
23
119
|
const opts = parseArgsOrThrow(parseScheduleArgs, "schedule", args);
|
|
24
120
|
const projectDir = dntShim.Deno.cwd();
|
|
25
|
-
|
|
121
|
+
if (opts.remote && opts.input) {
|
|
122
|
+
throw new Error("Invalid schedule arguments: remote runs use the source already pushed to Veryfront and do not accept --input.");
|
|
123
|
+
}
|
|
124
|
+
if (opts.remote) {
|
|
125
|
+
await runRemoteSchedule(projectDir, opts);
|
|
126
|
+
exitProcess(0);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
26
129
|
await withProjectSourceContext(projectDir, async (context) => {
|
|
27
130
|
const { adapter, config, configCacheKey, projectId } = context;
|
|
131
|
+
const input = opts.input ? await readJsonFile(opts.input, "--input JSON file") : undefined;
|
|
28
132
|
const result = await discoverSchedules({ projectDir, adapter, config });
|
|
29
133
|
if (result.errors.length > 0) {
|
|
30
134
|
throw new Error(`Schedule discovery failed: ${result.errors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,IAAI,CAAC,CAAC,CAAC;IAC9C,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAQ/D;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,mBAAmB,EAC1B,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC7B,MAAM,CAkBR;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGpE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWjE;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAsBR;AAkBD,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EAC7C,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,mBAAiD,GACvD,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
|
|
@@ -147,7 +147,7 @@ export function filterLocalImports(specifiers) {
|
|
|
147
147
|
}
|
|
148
148
|
export function normalizeSpecifierToPath(specifier, fromFile, projectDir) {
|
|
149
149
|
if (specifier.startsWith("@/")) {
|
|
150
|
-
return
|
|
150
|
+
return normalizeDependencyPath(`${projectDir}/${specifier.slice(2)}`, fromFile);
|
|
151
151
|
}
|
|
152
152
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
153
153
|
const fromDir = fromFile.substring(0, fromFile.lastIndexOf("/"));
|
|
@@ -158,13 +158,21 @@ export function normalizeSpecifierToPath(specifier, fromFile, projectDir) {
|
|
|
158
158
|
else if (part !== ".")
|
|
159
159
|
parts.push(part);
|
|
160
160
|
}
|
|
161
|
-
return
|
|
161
|
+
return normalizeDependencyPath(`/${parts.join("/")}`, fromFile);
|
|
162
162
|
}
|
|
163
163
|
if (specifier.startsWith("file://")) {
|
|
164
|
-
return
|
|
164
|
+
return normalizeDependencyPath(specifier.slice(7), fromFile);
|
|
165
165
|
}
|
|
166
166
|
return specifier;
|
|
167
167
|
}
|
|
168
|
+
function normalizeDependencyPath(path, fromFile) {
|
|
169
|
+
if (fromFile.endsWith(".src") &&
|
|
170
|
+
!path.endsWith(".src") &&
|
|
171
|
+
/\.(?:[cm]?[jt]sx?|mdx?)$/.test(path)) {
|
|
172
|
+
return `${path}.src`;
|
|
173
|
+
}
|
|
174
|
+
return normalizeExtension(path);
|
|
175
|
+
}
|
|
168
176
|
function normalizeExtension(path) {
|
|
169
177
|
return path.replace(/\.(tsx?|jsx)$/, ".js");
|
|
170
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-bundle-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AA2BzD;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC7E,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;GAGG;AACH,wBAAsB,kCAAkC,CACtD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAyBhD;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA4B1F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"http-bundle-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AA2BzD;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC7E,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;GAGG;AACH,wBAAsB,kCAAkC,CACtD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAyBhD;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA4B1F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAmB1D;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBlF;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,wBAElC,CAAC"}
|
|
@@ -124,13 +124,14 @@ export function extractHttpBundlePaths(code) {
|
|
|
124
124
|
*/
|
|
125
125
|
export function extractAllFilePaths(code) {
|
|
126
126
|
// Create regex per call to avoid shared lastIndex state across concurrent calls.
|
|
127
|
-
const allFilePathsPattern = /file:\/\/([^"'\s]
|
|
127
|
+
const allFilePathsPattern = /file:\/\/(\/[^"'\s]+)/gi;
|
|
128
|
+
const supportedPathPattern = /\.(?:mjs|js|tsx|ts|jsx)(?:\.src)?$/i;
|
|
128
129
|
const paths = [];
|
|
129
130
|
const seen = new Set();
|
|
130
131
|
let match;
|
|
131
132
|
while ((match = allFilePathsPattern.exec(code)) !== null) {
|
|
132
|
-
const path = match[1]?.replace(
|
|
133
|
-
if (!path || seen.has(path))
|
|
133
|
+
const path = match[1]?.replace(/[?#].*$/, "");
|
|
134
|
+
if (!path || !supportedPathPattern.test(path) || seen.has(path))
|
|
134
135
|
continue;
|
|
135
136
|
seen.add(path);
|
|
136
137
|
paths.push(path);
|
|
@@ -26,6 +26,6 @@ export function buildTempModulePath(tmpDir, filePath, projectDir, version, conte
|
|
|
26
26
|
const hashSuffix = contentHash
|
|
27
27
|
? `.v${versionPrefix}.${contentHash.slice(0, 8)}`
|
|
28
28
|
: `.v${versionPrefix}`;
|
|
29
|
-
const jsPath = relativePath.replace(/\.(tsx?|jsx|mdx)
|
|
29
|
+
const jsPath = relativePath.replace(/\.(tsx?|jsx|mdx)(?:\.src)?$/, `${hashSuffix}.js`);
|
|
30
30
|
return join(tmpDir, jsPath);
|
|
31
31
|
}
|
|
@@ -7,8 +7,5 @@ export declare function loadHandlerModule(options: LoadModuleOptions): Promise<A
|
|
|
7
7
|
* import specifiers, rather than because the module itself is broken.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isSpecifierResolutionError(error: unknown): boolean;
|
|
10
|
-
export declare function getUserDependencies(allDeps: ReadonlyMap<string, string
|
|
11
|
-
isDeno: boolean;
|
|
12
|
-
isCompiledBinary: boolean;
|
|
13
|
-
}): Map<string, string>;
|
|
10
|
+
export declare function getUserDependencies(allDeps: ReadonlyMap<string, string>): Map<string, string>;
|
|
14
11
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/routing/api/module-loader/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkB9D,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,0CAA0C,EAC1C,qCAAqC,EACrC,6BAA6B,EAC7B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAyBtF;AA0DD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIlE;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/src/routing/api/module-loader/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkB9D,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,0CAA0C,EAC1C,qCAAqC,EACrC,6BAA6B,EAC7B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAyBtF;AA0DD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIlE;AAobD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAWrB"}
|
|
@@ -305,25 +305,17 @@ function loadAndTranspileModule(modulePath, projectDir, adapter, fs, config) {
|
|
|
305
305
|
// handled by the framework's own external/rewrite logic and should not be
|
|
306
306
|
// treated as user npm packages.
|
|
307
307
|
//
|
|
308
|
-
// `zod` is kept as a user dep on Node
|
|
309
|
-
// handler's own `import { z } from "zod"` is
|
|
310
|
-
// specifier. Excluding it left a bare `import "zod"`
|
|
311
|
-
// that Deno cannot resolve → "not a dependency and not in
|
|
312
|
-
// (The Node path already always-resolves zod via
|
|
313
|
-
// getNodeExternalPackagesToResolve
|
|
314
|
-
//
|
|
315
|
-
//
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
|
|
319
|
-
// veryfront runtime shims written next to the temp handler, a separate and
|
|
320
|
-
// more constrained resolution path; wiring a user `zod` through it belongs
|
|
321
|
-
// in a dedicated change with its own binary coverage. Leaving the binary
|
|
322
|
-
// branch byte-identical to before keeps that path untouched here.
|
|
323
|
-
const userDeps = getUserDependencies(allDeps, {
|
|
324
|
-
isDeno,
|
|
325
|
-
isCompiledBinary: isDeno && isCompiledBinary(),
|
|
326
|
-
});
|
|
308
|
+
// `zod` is kept as a user dep on every runtime — Node, the Deno source-run,
|
|
309
|
+
// AND the compiled binary — so a handler's own `import { z } from "zod"` is
|
|
310
|
+
// rewritten to a resolvable specifier. Excluding it left a bare `import "zod"`
|
|
311
|
+
// in the temp handler that Deno cannot resolve → "not a dependency and not in
|
|
312
|
+
// import map" → 500. (The Node path already always-resolves zod via
|
|
313
|
+
// getNodeExternalPackagesToResolve.) On the compiled binary, keeping zod in
|
|
314
|
+
// userDeps routes it through rewriteCompiledBinaryUserDependencyImports like
|
|
315
|
+
// any other npm package, so its import resolves from the project's
|
|
316
|
+
// node_modules via the createRequire shim. zod is still force-externalized
|
|
317
|
+
// below, never bundled inline. See veryfront-issue-inbox#217.
|
|
318
|
+
const userDeps = getUserDependencies(allDeps);
|
|
327
319
|
// Always externalize user npm dependencies. The bundled handler is loaded
|
|
328
320
|
// from a temp file and user deps are resolved at runtime:
|
|
329
321
|
// - Node.js: via file:// URLs pointing to node_modules
|
|
@@ -419,10 +411,8 @@ async function readFileWithExtensions(adapter, basePath, extensions, projectDir)
|
|
|
419
411
|
message: `File not found: ${basePath}`,
|
|
420
412
|
}));
|
|
421
413
|
}
|
|
422
|
-
export function getUserDependencies(allDeps
|
|
414
|
+
export function getUserDependencies(allDeps) {
|
|
423
415
|
const frameworkPackages = new Set(["veryfront", "react", "react-dom", "path"]);
|
|
424
|
-
if (runtime.isDeno && runtime.isCompiledBinary)
|
|
425
|
-
frameworkPackages.add("zod");
|
|
426
416
|
const frameworkPrefixes = ["@opentelemetry/", "node:", "veryfront/"];
|
|
427
417
|
const userDeps = new Map();
|
|
428
418
|
for (const [name, version] of allDeps) {
|
package/esm/src/runs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Canonical durable runs for task, workflow, and
|
|
2
|
+
* Canonical durable runs for task, workflow, eval, and schedule-triggered execution.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
import "../../_dnt.polyfills.js";
|
|
25
|
-
export { type CreateEvalRunInput, createRunsClient, type CreateTaskRunInput, type CreateWorkflowRunInput, type KnowledgeIngestByUploadIdsInput, type KnowledgeIngestByUploadPathsInput, type KnowledgeIngestByUploadPrefixInput, type ListRunEventsOptions, type ListRunsOptions, type ProjectScopedOptions, type RunRuntimeTargetKind, type RunRuntimeTargetOptions, VeryfrontRunsClient, type VeryfrontRunsClientConfig, } from "./runs-client.js";
|
|
26
|
-
export { type CancelRunResponse, CancelRunResponseSchema, type CreateRunResponse, CreateRunResponseSchema, type Run, type RunEvent, RunEventListSchema, RunEventSchema, type RunExecutionError, type RunKind, type RunList, RunListSchema, type RunOwner, RunSchema, type RunStatus, type RunTriggerKind, } from "./schemas.js";
|
|
25
|
+
export { type CreateEvalRunInput, createRunsClient, type CreateScheduleRunFromSourceInput, type CreateScheduleRunFromSourceResult, type CreateScheduleRunInput, type CreateTaskRunInput, type CreateWorkflowRunInput, type KnowledgeIngestByUploadIdsInput, type KnowledgeIngestByUploadPathsInput, type KnowledgeIngestByUploadPrefixInput, type ListRunEventsOptions, type ListRunsOptions, type ProjectScopedOptions, type RunRuntimeTargetKind, type RunRuntimeTargetOptions, VeryfrontRunsClient, type VeryfrontRunsClientConfig, } from "./runs-client.js";
|
|
26
|
+
export { type CancelRunResponse, CancelRunResponseSchema, type CreateRunResponse, CreateRunResponseSchema, type Run, type RunEvent, RunEventListSchema, RunEventSchema, type RunExecutionError, type RunKind, type RunList, RunListSchema, type RunOwner, RunSchema, type RunStatus, type RunTriggerKind, type ScheduleRunCreateResponse, ScheduleRunCreateResponseSchema, } from "./schemas.js";
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/runs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,kBAAkB,EAClB,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,aAAa,EACb,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,SAAS,EACd,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/runs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,kBAAkB,EAClB,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,aAAa,EACb,KAAK,QAAQ,EACb,SAAS,EACT,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,+BAA+B,GAChC,MAAM,cAAc,CAAC"}
|
package/esm/src/runs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Canonical durable runs for task, workflow, and
|
|
2
|
+
* Canonical durable runs for task, workflow, eval, and schedule-triggered execution.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import "../../_dnt.polyfills.js";
|
|
25
25
|
export { createRunsClient, VeryfrontRunsClient, } from "./runs-client.js";
|
|
26
|
-
export { CancelRunResponseSchema, CreateRunResponseSchema, RunEventListSchema, RunEventSchema, RunListSchema, RunSchema, } from "./schemas.js";
|
|
26
|
+
export { CancelRunResponseSchema, CreateRunResponseSchema, RunEventListSchema, RunEventSchema, RunListSchema, RunSchema, ScheduleRunCreateResponseSchema, } from "./schemas.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RetryConfig } from "../platform/adapters/veryfront-api-client/retry-handler.js";
|
|
2
|
-
import { type CancelRunResponse, type CreateRunResponse, type Run, type RunEventList, type RunList } from "./schemas.js";
|
|
2
|
+
import { type CancelRunResponse, type CreateRunResponse, type Run, type RunEventList, type RunList, type ScheduleRunCreateResponse } from "./schemas.js";
|
|
3
3
|
/** Configuration used by the Veryfront runs client. */
|
|
4
4
|
export interface VeryfrontRunsClientConfig {
|
|
5
5
|
apiUrl?: string;
|
|
@@ -45,6 +45,27 @@ export interface CreateEvalRunInput extends RunCreateBaseInput, RunRuntimeTarget
|
|
|
45
45
|
config?: Record<string, unknown>;
|
|
46
46
|
startMode?: string;
|
|
47
47
|
}
|
|
48
|
+
/** Input for triggering one persisted schedule by its canonical UUID. */
|
|
49
|
+
export interface CreateScheduleRunInput extends ProjectScopedOptions {
|
|
50
|
+
scheduleId: string;
|
|
51
|
+
runName?: string;
|
|
52
|
+
idempotencyKey?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Input for resolving and triggering one pushed source-defined schedule. */
|
|
55
|
+
export interface CreateScheduleRunFromSourceInput extends ProjectScopedOptions {
|
|
56
|
+
sourceTriggerId: string;
|
|
57
|
+
runName?: string;
|
|
58
|
+
idempotencyKey?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Cloud schedule metadata returned with an accepted source-triggered run. */
|
|
61
|
+
export interface CreateScheduleRunFromSourceResult {
|
|
62
|
+
scheduleRun: ScheduleRunCreateResponse;
|
|
63
|
+
timeoutSeconds: number;
|
|
64
|
+
target: {
|
|
65
|
+
kind: "task" | "workflow" | "agent";
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
48
69
|
/** Input payload for knowledge ingest by upload IDs. */
|
|
49
70
|
export interface KnowledgeIngestByUploadIdsInput extends Omit<CreateTaskRunInput, "target" | "config"> {
|
|
50
71
|
uploadIds: string[];
|
|
@@ -85,6 +106,8 @@ export declare class VeryfrontRunsClient {
|
|
|
85
106
|
createTaskRun(input: CreateTaskRunInput): Promise<CreateRunResponse>;
|
|
86
107
|
createWorkflowRun(input: CreateWorkflowRunInput): Promise<CreateRunResponse>;
|
|
87
108
|
createEvalRun(input: CreateEvalRunInput): Promise<CreateRunResponse>;
|
|
109
|
+
createScheduleRun(input: CreateScheduleRunInput): Promise<ScheduleRunCreateResponse>;
|
|
110
|
+
createScheduleRunFromSource(input: CreateScheduleRunFromSourceInput): Promise<CreateScheduleRunFromSourceResult>;
|
|
88
111
|
list(options?: ListRunsOptions): Promise<RunList>;
|
|
89
112
|
get(runId: string): Promise<Run>;
|
|
90
113
|
events(runId: string, options?: ListRunEventsOptions): Promise<RunEventList>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs-client.d.ts","sourceRoot":"","sources":["../../../src/src/runs/runs-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runs-client.d.ts","sourceRoot":"","sources":["../../../src/src/runs/runs-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,4DAA4D,CAAC;AAGpE,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EAEtB,KAAK,GAAG,EACR,KAAK,YAAY,EAEjB,KAAK,OAAO,EAIZ,KAAK,yBAAyB,EAE/B,MAAM,cAAc,CAAC;AAQtB,uDAAuD;AACvD,MAAM,WAAW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,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA8BpE,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAkB9E,2BAA2B,CAC/B,KAAK,EAAE,gCAAgC,GACtC,OAAO,CAAC,iCAAiC,CAAC;IAsCvC,IAAI,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAW3D,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIhC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC;IAWhF,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMjD,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,4BAA4B;IAYpC,OAAO,CAAC,6BAA6B;IAYrC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,uBAAuB;YAcjB,WAAW;CAmB1B;AAED,4BAA4B;AAC5B,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,yBAAyB,GAAG,mBAAmB,CAExF"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
1
2
|
import { getVeryfrontCloudBootstrap } from "../platform/cloud/resolver.js";
|
|
2
3
|
import { requestWithRetry, } from "../platform/adapters/veryfront-api-client/retry-handler.js";
|
|
3
4
|
import { API_CLIENT_ERROR } from "../platform/adapters/veryfront-api-client/types.js";
|
|
4
|
-
import { CancelRunResponseSchema, CreateRunResponseSchema, RunEventListSchema, RunListSchema, RunSchema, } from "./schemas.js";
|
|
5
|
+
import { CancelRunResponseSchema, CreateRunResponseSchema, RunEventListSchema, RunListSchema, RunSchema, ScheduleReferenceListSchema, ScheduleRunCreateResponseSchema, } from "./schemas.js";
|
|
5
6
|
const DEFAULT_MAX_RETRIES = 3;
|
|
6
7
|
const DEFAULT_INITIAL_RETRY_DELAY_MS = 1_000;
|
|
7
8
|
const DEFAULT_MAX_RETRY_DELAY_MS = 10_000;
|
|
8
9
|
const DEFAULT_KNOWLEDGE_INGEST_RUN_NAME = "Ingest knowledge";
|
|
10
|
+
const GENERATED_SCHEDULE_RUN_IDEMPOTENCY_PREFIX = "schedule-run";
|
|
9
11
|
function toQueryParams(values) {
|
|
10
12
|
const params = new URLSearchParams();
|
|
11
13
|
for (const [key, value] of Object.entries(values)) {
|
|
@@ -117,6 +119,46 @@ export class VeryfrontRunsClient {
|
|
|
117
119
|
},
|
|
118
120
|
});
|
|
119
121
|
}
|
|
122
|
+
createScheduleRun(input) {
|
|
123
|
+
const { scheduleId, projectReference, runName, idempotencyKey } = input;
|
|
124
|
+
const project = this.resolveProjectReference(projectReference);
|
|
125
|
+
const resolvedIdempotencyKey = idempotencyKey ??
|
|
126
|
+
`${GENERATED_SCHEDULE_RUN_IDEMPOTENCY_PREFIX}:${dntShim.crypto.randomUUID()}`;
|
|
127
|
+
return this.requestJson(`/projects/${encodeURIComponent(project)}/schedules/${encodeURIComponent(scheduleId)}/runs`, ScheduleRunCreateResponseSchema, {
|
|
128
|
+
method: "POST",
|
|
129
|
+
body: {
|
|
130
|
+
run_name: runName,
|
|
131
|
+
idempotency_key: resolvedIdempotencyKey,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
async createScheduleRunFromSource(input) {
|
|
136
|
+
const projectReference = this.resolveProjectReference(input.projectReference);
|
|
137
|
+
const listed = await this.requestJson(withQuery(`/projects/${encodeURIComponent(projectReference)}/schedules`, toQueryParams({
|
|
138
|
+
status: "active",
|
|
139
|
+
source_trigger_id: input.sourceTriggerId,
|
|
140
|
+
})), ScheduleReferenceListSchema);
|
|
141
|
+
const schedule = listed.schedules.find((candidate) => candidate.status === "active" &&
|
|
142
|
+
candidate.definition_source === "source" &&
|
|
143
|
+
candidate.source_trigger_id === input.sourceTriggerId);
|
|
144
|
+
if (!schedule) {
|
|
145
|
+
throw API_CLIENT_ERROR.create({
|
|
146
|
+
detail: `Active source schedule "${input.sourceTriggerId}" not found in project "${projectReference}". Push the source schedule before running it remotely.`,
|
|
147
|
+
status: 404,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const scheduleRun = await this.createScheduleRun({
|
|
151
|
+
scheduleId: schedule.id,
|
|
152
|
+
projectReference,
|
|
153
|
+
runName: input.runName ?? schedule.name,
|
|
154
|
+
idempotencyKey: input.idempotencyKey,
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
scheduleRun,
|
|
158
|
+
timeoutSeconds: schedule.timeout_seconds,
|
|
159
|
+
target: schedule.target,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
120
162
|
async list(options = {}) {
|
|
121
163
|
const { projectReference, cursor, limit } = options;
|
|
122
164
|
return await this.requestJson(withQuery(`/projects/${encodeURIComponent(this.resolveProjectReference(projectReference))}/runs`, toQueryParams({ cursor, limit })), RunListSchema);
|
|
@@ -100,6 +100,25 @@ export declare const getCreateRunResponseSchema: () => import("../internal-agent
|
|
|
100
100
|
completed_at: import("../internal-agents/schema.js").Schema<string | null>;
|
|
101
101
|
}>>;
|
|
102
102
|
}>>;
|
|
103
|
+
export declare const getScheduleRunCreateResponseSchema: () => import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
104
|
+
run_id: import("../internal-agents/schema.js").Schema<string>;
|
|
105
|
+
run_execution_id: import("../internal-agents/schema.js").Schema<string>;
|
|
106
|
+
schedule_id: import("../internal-agents/schema.js").Schema<string>;
|
|
107
|
+
}>>;
|
|
108
|
+
export declare const getScheduleReferenceListSchema: () => import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
109
|
+
schedules: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
110
|
+
id: import("../internal-agents/schema.js").Schema<string>;
|
|
111
|
+
name: import("../internal-agents/schema.js").Schema<string>;
|
|
112
|
+
status: import("../internal-agents/schema.js").Schema<"active" | "deleting" | "paused">;
|
|
113
|
+
target: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
114
|
+
kind: import("../internal-agents/schema.js").Schema<"agent" | "task" | "workflow">;
|
|
115
|
+
id: import("../internal-agents/schema.js").Schema<string>;
|
|
116
|
+
}>>;
|
|
117
|
+
definition_source: import("../internal-agents/schema.js").Schema<"manual" | "source">;
|
|
118
|
+
source_trigger_id: import("../internal-agents/schema.js").Schema<string | null>;
|
|
119
|
+
timeout_seconds: import("../internal-agents/schema.js").Schema<number>;
|
|
120
|
+
}>[]>;
|
|
121
|
+
}>>;
|
|
103
122
|
export declare const getCancelRunResponseSchema: () => import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
104
123
|
cancelled: import("../internal-agents/schema.js").Schema<boolean>;
|
|
105
124
|
run: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
@@ -311,6 +330,27 @@ export declare const CreateRunResponseSchema: import("../internal-agents/schema.
|
|
|
311
330
|
completed_at: import("../internal-agents/schema.js").Schema<string | null>;
|
|
312
331
|
}>>;
|
|
313
332
|
}>>;
|
|
333
|
+
/** Zod schema for a schedule-triggered create-run response. */
|
|
334
|
+
export declare const ScheduleRunCreateResponseSchema: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
335
|
+
run_id: import("../internal-agents/schema.js").Schema<string>;
|
|
336
|
+
run_execution_id: import("../internal-agents/schema.js").Schema<string>;
|
|
337
|
+
schedule_id: import("../internal-agents/schema.js").Schema<string>;
|
|
338
|
+
}>>;
|
|
339
|
+
/** Zod schema for the schedule references needed to trigger source schedules. */
|
|
340
|
+
export declare const ScheduleReferenceListSchema: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
341
|
+
schedules: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
342
|
+
id: import("../internal-agents/schema.js").Schema<string>;
|
|
343
|
+
name: import("../internal-agents/schema.js").Schema<string>;
|
|
344
|
+
status: import("../internal-agents/schema.js").Schema<"active" | "deleting" | "paused">;
|
|
345
|
+
target: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
346
|
+
kind: import("../internal-agents/schema.js").Schema<"agent" | "task" | "workflow">;
|
|
347
|
+
id: import("../internal-agents/schema.js").Schema<string>;
|
|
348
|
+
}>>;
|
|
349
|
+
definition_source: import("../internal-agents/schema.js").Schema<"manual" | "source">;
|
|
350
|
+
source_trigger_id: import("../internal-agents/schema.js").Schema<string | null>;
|
|
351
|
+
timeout_seconds: import("../internal-agents/schema.js").Schema<number>;
|
|
352
|
+
}>[]>;
|
|
353
|
+
}>>;
|
|
314
354
|
/** Zod schema for a cancel-run response. */
|
|
315
355
|
export declare const CancelRunResponseSchema: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
|
|
316
356
|
cancelled: import("../internal-agents/schema.js").Schema<boolean>;
|
|
@@ -446,6 +486,8 @@ export type RunExecutionError = InferSchema<ReturnType<typeof getRunExecutionErr
|
|
|
446
486
|
export type Run = InferSchema<ReturnType<typeof getRunSchema>>;
|
|
447
487
|
/** Response returned when a run is accepted. */
|
|
448
488
|
export type CreateRunResponse = InferSchema<ReturnType<typeof getCreateRunResponseSchema>>;
|
|
489
|
+
/** Response returned when a schedule-triggered run is accepted. */
|
|
490
|
+
export type ScheduleRunCreateResponse = InferSchema<ReturnType<typeof getScheduleRunCreateResponseSchema>>;
|
|
449
491
|
/** Response returned when a run is cancelled. */
|
|
450
492
|
export type CancelRunResponse = InferSchema<ReturnType<typeof getCancelRunResponseSchema>>;
|
|
451
493
|
/** Event emitted by a run. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts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AAO,0BAA0B,CAAC,CAAC,CAAC;AAC3F,6BAA6B;AAC7B,MAAM,MAAM,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAC/D,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC;AAC3F,mEAAmE;AACnE,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,UAAU,CAAC,OAAO,kCAAkC,CAAC,CACtD,CAAC;AACF,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC;AAC3F,8BAA8B;AAC9B,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC;AACzE,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;AACjF,sCAAsC;AACtC,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC"}
|
package/esm/src/runs/schemas.js
CHANGED
|
@@ -52,6 +52,25 @@ export const getCreateRunResponseSchema = defineSchema((v) => v.object({
|
|
|
52
52
|
duplicate: v.boolean().optional(),
|
|
53
53
|
run: getRunSchema(),
|
|
54
54
|
}));
|
|
55
|
+
export const getScheduleRunCreateResponseSchema = defineSchema((v) => v.object({
|
|
56
|
+
run_id: v.string(),
|
|
57
|
+
run_execution_id: v.string(),
|
|
58
|
+
schedule_id: v.string(),
|
|
59
|
+
}));
|
|
60
|
+
export const getScheduleReferenceListSchema = defineSchema((v) => v.object({
|
|
61
|
+
schedules: v.array(v.object({
|
|
62
|
+
id: v.string(),
|
|
63
|
+
name: v.string(),
|
|
64
|
+
status: v.enum(["active", "paused", "deleting"]),
|
|
65
|
+
target: v.object({
|
|
66
|
+
kind: v.enum(["task", "workflow", "agent"]),
|
|
67
|
+
id: v.string(),
|
|
68
|
+
}),
|
|
69
|
+
definition_source: v.enum(["manual", "source"]),
|
|
70
|
+
source_trigger_id: v.string().nullable(),
|
|
71
|
+
timeout_seconds: v.number().int(),
|
|
72
|
+
})),
|
|
73
|
+
}));
|
|
55
74
|
export const getCancelRunResponseSchema = defineSchema((v) => v.object({
|
|
56
75
|
cancelled: v.boolean(),
|
|
57
76
|
run: getRunSchema(),
|
|
@@ -80,6 +99,10 @@ export const getRunListSchema = defineSchema((v) => v.object({
|
|
|
80
99
|
export const RunSchema = lazySchema(getRunSchema);
|
|
81
100
|
/** Zod schema for a create-run response. */
|
|
82
101
|
export const CreateRunResponseSchema = lazySchema(getCreateRunResponseSchema);
|
|
102
|
+
/** Zod schema for a schedule-triggered create-run response. */
|
|
103
|
+
export const ScheduleRunCreateResponseSchema = lazySchema(getScheduleRunCreateResponseSchema);
|
|
104
|
+
/** Zod schema for the schedule references needed to trigger source schedules. */
|
|
105
|
+
export const ScheduleReferenceListSchema = lazySchema(getScheduleReferenceListSchema);
|
|
83
106
|
/** Zod schema for a cancel-run response. */
|
|
84
107
|
export const CancelRunResponseSchema = lazySchema(getCancelRunResponseSchema);
|
|
85
108
|
/** Zod schema for a run event. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1155",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -332,10 +332,10 @@
|
|
|
332
332
|
"@types/react": "19.2.14",
|
|
333
333
|
"@types/react-dom": "19.2.3",
|
|
334
334
|
"ws": "8.21.0",
|
|
335
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
336
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
337
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
338
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
335
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1155",
|
|
336
|
+
"@veryfront/ext-content-mdx": "0.1.1155",
|
|
337
|
+
"@veryfront/ext-css-tailwind": "0.1.1155",
|
|
338
|
+
"@veryfront/ext-parser-babel": "0.1.1155"
|
|
339
339
|
},
|
|
340
340
|
"devDependencies": {
|
|
341
341
|
"@types/node": "20.9.0"
|