veryfront 0.1.1091 → 0.1.1092
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/commands/schedule/handler.d.ts.map +1 -1
- package/esm/cli/commands/schedule/handler.js +27 -1
- package/esm/deno.js +1 -1
- package/esm/src/schedule/factory.d.ts.map +1 -1
- package/esm/src/schedule/factory.js +19 -1
- package/esm/src/schedule/index.d.ts +2 -1
- package/esm/src/schedule/index.d.ts.map +1 -1
- package/esm/src/schedule/index.js +1 -0
- package/esm/src/schedule/types.d.ts +5 -0
- package/esm/src/schedule/types.d.ts.map +1 -1
- package/esm/src/schedule/types.js +12 -0
- package/esm/src/skill/tools.d.ts +4 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/skill/tools.js +2 -2
- package/esm/src/trigger/local-runner.d.ts +2 -0
- package/esm/src/trigger/local-runner.d.ts.map +1 -1
- package/esm/src/trigger/local-runner.js +40 -3
- 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":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/schedule/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA4BxD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/schedule/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA4BxD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwE3E"}
|
|
@@ -33,6 +33,31 @@ export async function handleScheduleCommand(args) {
|
|
|
33
33
|
if (!schedule) {
|
|
34
34
|
throw new Error(`Schedule "${opts.id}" not found.`);
|
|
35
35
|
}
|
|
36
|
+
const triggerInput = input ?? schedule.input ?? {};
|
|
37
|
+
const scheduleConfig = triggerInput && typeof triggerInput === "object" && !Array.isArray(triggerInput)
|
|
38
|
+
? triggerInput
|
|
39
|
+
: {};
|
|
40
|
+
const scheduleName = schedule.name ?? schedule.id;
|
|
41
|
+
const scheduleTarget = scheduleConfig._schedule_target;
|
|
42
|
+
const conversationMode = scheduleTarget && typeof scheduleTarget === "object" &&
|
|
43
|
+
!Array.isArray(scheduleTarget)
|
|
44
|
+
? scheduleTarget.conversationMode
|
|
45
|
+
: undefined;
|
|
46
|
+
if (schedule.target.kind === "agent" && conversationMode === "existing") {
|
|
47
|
+
throw new Error("Local scheduled agent runs cannot attach to an existing cloud conversation.");
|
|
48
|
+
}
|
|
49
|
+
const agentRunOptions = schedule.target.kind === "agent"
|
|
50
|
+
? {
|
|
51
|
+
agentInput: typeof scheduleConfig.prompt === "string" && scheduleConfig.prompt.trim().length > 0
|
|
52
|
+
? scheduleConfig.prompt
|
|
53
|
+
: `Run scheduled agent ${schedule.target.id} for ${scheduleName}`,
|
|
54
|
+
agentContext: {
|
|
55
|
+
trigger: "schedule",
|
|
56
|
+
schedule: { id: schedule.id, name: scheduleName },
|
|
57
|
+
forwardedProps: scheduleConfig,
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
: {};
|
|
36
61
|
const run = await runTriggerTarget({
|
|
37
62
|
projectDir,
|
|
38
63
|
adapter,
|
|
@@ -40,7 +65,8 @@ export async function handleScheduleCommand(args) {
|
|
|
40
65
|
cacheKey: configCacheKey,
|
|
41
66
|
projectId,
|
|
42
67
|
target: schedule.target,
|
|
43
|
-
input:
|
|
68
|
+
input: triggerInput,
|
|
69
|
+
...agentRunOptions,
|
|
44
70
|
debug: opts.debug,
|
|
45
71
|
});
|
|
46
72
|
await outputTriggerRun({
|
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/schedule/factory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,cAAc,EACd,kBAAkB,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/schedule/factory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,cAAc,EACd,kBAAkB,EAKnB,MAAM,YAAY,CAAC;AAmNpB,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,kBAAkB,CA8CnE"}
|
|
@@ -13,9 +13,13 @@ function requireString(value, label) {
|
|
|
13
13
|
function validatePositiveInteger(value, label) {
|
|
14
14
|
if (value === undefined)
|
|
15
15
|
return;
|
|
16
|
-
|
|
16
|
+
requirePositiveInteger(value, label);
|
|
17
|
+
}
|
|
18
|
+
function requirePositiveInteger(value, label) {
|
|
19
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) {
|
|
17
20
|
throw SCHEDULE_CONFIG_INVALID.create({ detail: `${label} must be a positive integer.` });
|
|
18
21
|
}
|
|
22
|
+
return value;
|
|
19
23
|
}
|
|
20
24
|
function requireContractString(value, label, maxLength) {
|
|
21
25
|
const normalized = requireString(value, label).trim();
|
|
@@ -45,6 +49,18 @@ function assertOnlyKeys(record, allowedKeys, label) {
|
|
|
45
49
|
throw new Error(`${label}.${unknownKey} is not supported.`);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
52
|
+
function normalizeScheduleHealth(value) {
|
|
53
|
+
if (value === undefined)
|
|
54
|
+
return undefined;
|
|
55
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
56
|
+
throw SCHEDULE_CONFIG_INVALID.create({ detail: "Schedule health must be an object." });
|
|
57
|
+
}
|
|
58
|
+
const record = value;
|
|
59
|
+
assertOnlyKeys(record, ["maxStalenessSeconds"], "Schedule health");
|
|
60
|
+
return {
|
|
61
|
+
maxStalenessSeconds: requirePositiveInteger(record.maxStalenessSeconds, "Schedule health.maxStalenessSeconds"),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
48
64
|
function normalizeIntegrationRequirements(value) {
|
|
49
65
|
if (value === undefined)
|
|
50
66
|
return undefined;
|
|
@@ -138,6 +154,7 @@ export function schedule(config) {
|
|
|
138
154
|
validatePositiveInteger(config.backoffLimit, "Schedule backoffLimit");
|
|
139
155
|
validatePositiveInteger(config.maxRuns, "Schedule maxRuns");
|
|
140
156
|
assertSerializable(config.input, "Schedule input");
|
|
157
|
+
const health = normalizeScheduleHealth(config.health);
|
|
141
158
|
const integrationRequirements = normalizeIntegrationRequirements(config.integrationRequirements);
|
|
142
159
|
return {
|
|
143
160
|
id,
|
|
@@ -153,6 +170,7 @@ export function schedule(config) {
|
|
|
153
170
|
? {}
|
|
154
171
|
: { concurrencyPolicy: config.concurrencyPolicy }),
|
|
155
172
|
...(config.maxRuns === undefined ? {} : { maxRuns: config.maxRuns }),
|
|
173
|
+
...(health === undefined ? {} : { health }),
|
|
156
174
|
...(integrationRequirements === undefined ? {} : { integrationRequirements }),
|
|
157
175
|
};
|
|
158
176
|
}
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
* timezone: "Europe/Stockholm",
|
|
14
14
|
* target: { kind: "workflow", id: "escalate-ticket" },
|
|
15
15
|
* input: { severity: "high" },
|
|
16
|
+
* health: { maxStalenessSeconds: 1800 },
|
|
16
17
|
* });
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
20
|
import "../../_dnt.polyfills.js";
|
|
20
21
|
export { schedule } from "./factory.js";
|
|
21
|
-
export type { ScheduleConcurrencyPolicy, ScheduleConfig, ScheduleDefinition, ScheduleIntegrationRequirement, ScheduleIntegrationRequirementConfig, ScheduleIntegrationResource, ScheduleIntegrationResourceIdentity, } from "./types.js";
|
|
22
|
+
export type { ScheduleConcurrencyPolicy, ScheduleConfig, ScheduleDefinition, ScheduleHealth, ScheduleIntegrationRequirement, ScheduleIntegrationRequirementConfig, ScheduleIntegrationResource, ScheduleIntegrationResourceIdentity, } from "./types.js";
|
|
22
23
|
export { isScheduleDefinition } from "./types.js";
|
|
23
24
|
export { discoverSchedules } from "./discovery.js";
|
|
24
25
|
export type { ScheduleDiscoveryOptions, ScheduleDiscoveryResult } from "./discovery.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/schedule/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/schedule/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EACV,yBAAyB,EACzB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,8BAA8B,EAC9B,oCAAoC,EACpC,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { TriggerTarget } from "../trigger/target.js";
|
|
2
2
|
export type ScheduleConcurrencyPolicy = "Allow" | "Forbid" | "Replace";
|
|
3
|
+
/** Marks a schedule unhealthy when it has not succeeded within the given budget. */
|
|
4
|
+
export interface ScheduleHealth {
|
|
5
|
+
maxStalenessSeconds: number;
|
|
6
|
+
}
|
|
3
7
|
export interface ScheduleIntegrationResourceIdentity {
|
|
4
8
|
kind: string;
|
|
5
9
|
id: string;
|
|
@@ -29,6 +33,7 @@ export interface ScheduleDefinition {
|
|
|
29
33
|
backoffLimit?: number;
|
|
30
34
|
concurrencyPolicy?: ScheduleConcurrencyPolicy;
|
|
31
35
|
maxRuns?: number;
|
|
36
|
+
health?: ScheduleHealth;
|
|
32
37
|
integrationRequirements?: ScheduleIntegrationRequirement[];
|
|
33
38
|
}
|
|
34
39
|
export type ScheduleConfig = Omit<ScheduleDefinition, "schedule" | "integrationRequirements"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/schedule/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,2BAA4B,SAAQ,mCAAmC;IACtF,MAAM,CAAC,EAAE,mCAAmC,CAAC;CAC9C;AAED,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,2BAA2B,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,oCAAoC;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,2BAA2B,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACt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C;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,uBAAuB,CAAC,EAAE,8BAA8B,EAAE,CAAC;CAC5D;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,yBAAyB,CAAC,GAAG;IAC9F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB,CAAC,EAAE,oCAAoC,EAAE,CAAC;CAClE,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAWhF"}
|
|
@@ -6,8 +6,20 @@ export function isScheduleDefinition(value) {
|
|
|
6
6
|
typeof definition.schedule === "string" &&
|
|
7
7
|
definition.target !== null &&
|
|
8
8
|
typeof definition.target === "object" &&
|
|
9
|
+
isScheduleHealth(definition.health) &&
|
|
9
10
|
isScheduleIntegrationRequirements(definition.integrationRequirements));
|
|
10
11
|
}
|
|
12
|
+
function isScheduleHealth(value) {
|
|
13
|
+
if (value === undefined)
|
|
14
|
+
return true;
|
|
15
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
16
|
+
return false;
|
|
17
|
+
const record = value;
|
|
18
|
+
return hasOnlyKeys(record, ["maxStalenessSeconds"]) &&
|
|
19
|
+
typeof record.maxStalenessSeconds === "number" &&
|
|
20
|
+
Number.isInteger(record.maxStalenessSeconds) &&
|
|
21
|
+
record.maxStalenessSeconds > 0;
|
|
22
|
+
}
|
|
11
23
|
function isScheduleIntegrationRequirements(value) {
|
|
12
24
|
if (value === undefined)
|
|
13
25
|
return true;
|
package/esm/src/skill/tools.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
import type { Tool } from "../tool/index.js";
|
|
12
|
+
import type { SkillScriptExecutor } from "./types.js";
|
|
12
13
|
/**
|
|
13
14
|
* Create the load_skill tool.
|
|
14
15
|
* Loads a skill's full instructions, available references, and scripts.
|
|
@@ -23,5 +24,7 @@ export declare function createLoadSkillReferenceTool(): Tool;
|
|
|
23
24
|
* Create the execute_skill_script tool.
|
|
24
25
|
* Executes a script from a skill's scripts/ directory.
|
|
25
26
|
*/
|
|
26
|
-
export declare function createExecuteSkillScriptTool(
|
|
27
|
+
export declare function createExecuteSkillScriptTool(options?: {
|
|
28
|
+
executor?: SkillScriptExecutor;
|
|
29
|
+
}): Tool;
|
|
27
30
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/src/skill/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAwB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/src/skill/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAwB,MAAM,kBAAkB,CAAC;AAQnE,OAAO,KAAK,EAAuB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA2I3E;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAkD1C;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CA+BnD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAAO,GAC/C,IAAI,CAuCN"}
|
package/esm/src/skill/tools.js
CHANGED
|
@@ -169,7 +169,7 @@ export function createLoadSkillReferenceTool() {
|
|
|
169
169
|
* Create the execute_skill_script tool.
|
|
170
170
|
* Executes a script from a skill's scripts/ directory.
|
|
171
171
|
*/
|
|
172
|
-
export function createExecuteSkillScriptTool() {
|
|
172
|
+
export function createExecuteSkillScriptTool(options = {}) {
|
|
173
173
|
return tool({
|
|
174
174
|
id: "execute_skill_script",
|
|
175
175
|
description: "Execute a script from a skill's scripts/ directory. Returns stdout, stderr, and exit code.",
|
|
@@ -186,7 +186,7 @@ export function createExecuteSkillScriptTool() {
|
|
|
186
186
|
// Validate path safety (only scripts/ allowed)
|
|
187
187
|
const validatedPath = await validateSkillPath(skill.rootPath, input.script, [SKILL_SCRIPTS_DIR], skill.fsAdapter);
|
|
188
188
|
const scriptContent = await readSkillFile(skill, validatedPath);
|
|
189
|
-
const executor = getSkillScriptExecutor();
|
|
189
|
+
const executor = options.executor ?? getSkillScriptExecutor();
|
|
190
190
|
return await executor.execute({
|
|
191
191
|
scriptPath: validatedPath,
|
|
192
192
|
scriptContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/local-runner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQ1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,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B,OAAO,CAAC,sBAAsB,CAAC,CAUjC"}
|
|
@@ -88,6 +88,45 @@ async function runWorkflowTarget(options) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
+
async function runAgentTarget(options) {
|
|
92
|
+
const agentInput = options.agentInput;
|
|
93
|
+
if (agentInput === undefined) {
|
|
94
|
+
throw TRIGGER_NOT_SUPPORTED.create({
|
|
95
|
+
detail: "Local agent trigger runs require an explicit agent input.",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const start = Date.now();
|
|
99
|
+
const discovery = await discoverRuntimeOrThrow(options);
|
|
100
|
+
const agent = agentRegistry.get(options.target.id);
|
|
101
|
+
if (!agent) {
|
|
102
|
+
throw TRIGGER_TARGET_NOT_FOUND.create({
|
|
103
|
+
detail: `Agent target "${options.target.id}" not found.`,
|
|
104
|
+
context: { targetId: options.target.id },
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return await runWithProjectAgentRuntime(discovery, async () => {
|
|
108
|
+
const response = await agent.generate({
|
|
109
|
+
input: agentInput,
|
|
110
|
+
...(options.agentContext === undefined ? {} : { context: options.agentContext }),
|
|
111
|
+
});
|
|
112
|
+
if (response.status === "error") {
|
|
113
|
+
throw TRIGGER_EXECUTION_FAILED.create({
|
|
114
|
+
detail: `Agent target "${options.target.id}" failed.`,
|
|
115
|
+
context: { targetId: options.target.id },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
kind: "agent",
|
|
120
|
+
id: options.target.id,
|
|
121
|
+
output: {
|
|
122
|
+
text: response.text,
|
|
123
|
+
status: response.status,
|
|
124
|
+
toolCalls: response.toolCalls.length,
|
|
125
|
+
},
|
|
126
|
+
durationMs: Date.now() - start,
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
}
|
|
91
130
|
export async function runTriggerTarget(options) {
|
|
92
131
|
if (options.target.kind === "task") {
|
|
93
132
|
return await runTaskTarget(options);
|
|
@@ -95,7 +134,5 @@ export async function runTriggerTarget(options) {
|
|
|
95
134
|
if (options.target.kind === "workflow") {
|
|
96
135
|
return await runWorkflowTarget(options);
|
|
97
136
|
}
|
|
98
|
-
|
|
99
|
-
detail: "Agent trigger targets are Cloud-only for this milestone. Use a workflow or task for local trigger runs.",
|
|
100
|
-
});
|
|
137
|
+
return await runAgentTarget(options);
|
|
101
138
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1092",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -328,10 +328,10 @@
|
|
|
328
328
|
"@types/react": "19.2.14",
|
|
329
329
|
"@types/react-dom": "19.2.3",
|
|
330
330
|
"ws": "8.21.0",
|
|
331
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
332
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
333
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
334
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
331
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1092",
|
|
332
|
+
"@veryfront/ext-content-mdx": "0.1.1092",
|
|
333
|
+
"@veryfront/ext-css-tailwind": "0.1.1092",
|
|
334
|
+
"@veryfront/ext-parser-babel": "0.1.1092"
|
|
335
335
|
},
|
|
336
336
|
"devDependencies": {
|
|
337
337
|
"@types/node": "20.9.0"
|