veryfront 0.1.20 → 0.1.23
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/bin/veryfront.js +24 -11
- package/esm/cli/commands/task/command-help.d.ts +3 -0
- package/esm/cli/commands/task/command-help.d.ts.map +1 -0
- package/esm/cli/commands/task/command-help.js +20 -0
- package/esm/cli/commands/task/command.d.ts +5 -0
- package/esm/cli/commands/task/command.d.ts.map +1 -0
- package/esm/cli/commands/task/command.js +79 -0
- package/esm/cli/commands/task/handler.d.ts +24 -0
- package/esm/cli/commands/task/handler.d.ts.map +1 -0
- package/esm/cli/commands/task/handler.js +17 -0
- package/esm/cli/help/command-definitions.d.ts.map +1 -1
- package/esm/cli/help/command-definitions.js +2 -0
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +2 -0
- package/esm/deno.d.ts +1 -0
- package/esm/deno.js +2 -1
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +6 -1
- package/esm/src/discovery/handlers/index.d.ts +1 -0
- package/esm/src/discovery/handlers/index.d.ts.map +1 -1
- package/esm/src/discovery/handlers/index.js +1 -0
- package/esm/src/discovery/handlers/task-handler.d.ts +7 -0
- package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -0
- package/esm/src/discovery/handlers/task-handler.js +19 -0
- package/esm/src/discovery/types.d.ts +3 -0
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +0 -2
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +3 -7
- package/esm/src/studio/bridge-template.d.ts.map +1 -1
- package/esm/src/studio/bridge-template.js +3 -2
- package/esm/src/task/discovery.d.ts +83 -0
- package/esm/src/task/discovery.d.ts.map +1 -0
- package/esm/src/task/discovery.js +149 -0
- package/esm/src/task/runner.d.ts +34 -0
- package/esm/src/task/runner.d.ts.map +1 -0
- package/esm/src/task/runner.js +45 -0
- package/esm/src/task/types.d.ts +34 -0
- package/esm/src/task/types.d.ts.map +1 -0
- package/esm/src/task/types.js +16 -0
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/entities/getEntityInfo.js +34 -5
- package/esm/src/workflow/claude-code/tool.d.ts +5 -5
- package/package.json +2 -2
- package/src/cli/commands/task/command-help.ts +22 -0
- package/src/cli/commands/task/command.ts +98 -0
- package/src/cli/commands/task/handler.ts +23 -0
- package/src/cli/help/command-definitions.ts +2 -0
- package/src/cli/router.ts +2 -0
- package/src/deno.js +2 -1
- package/src/src/discovery/discovery-engine.ts +7 -0
- package/src/src/discovery/handlers/index.ts +1 -0
- package/src/src/discovery/handlers/task-handler.ts +23 -0
- package/src/src/discovery/types.ts +3 -0
- package/src/src/platform/adapters/fs/veryfront/adapter.ts +3 -7
- package/src/src/studio/bridge-template.ts +3 -2
- package/src/src/task/discovery.ts +228 -0
- package/src/src/task/runner.ts +94 -0
- package/src/src/task/types.ts +40 -0
- package/src/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.ts +1 -1
- package/src/src/types/entities/getEntityInfo.ts +34 -4
- package/esm/deps/esm.sh/react@19.1.1/jsx-dev-runtime.d.ts +0 -2
- package/esm/deps/esm.sh/react@19.1.1/jsx-dev-runtime.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.1.1/jsx-dev-runtime.js +0 -3
- package/src/deps/esm.sh/@types/react@19.1.17/global.d.ts +0 -165
- package/src/deps/esm.sh/@types/react@19.1.17/index.d.ts +0 -4267
- package/src/deps/esm.sh/@types/react@19.1.17/jsx-dev-runtime.d.ts +0 -45
- package/src/deps/esm.sh/csstype@3.1.3/index.d.ts +0 -21297
- package/src/deps/esm.sh/react@19.1.1/jsx-dev-runtime.d.ts +0 -45
- package/src/deps/esm.sh/react@19.1.1/jsx-dev-runtime.js +0 -3
package/bin/veryfront.js
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync } from
|
|
3
|
-
import { spawn } from
|
|
4
|
-
import { dirname, join } from
|
|
5
|
-
import { fileURLToPath } from
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
|
-
await import(
|
|
7
|
+
await import("../esm/_dnt.polyfills.js");
|
|
8
8
|
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
const nativeBinary = join(
|
|
10
|
+
const nativeBinary = join(
|
|
11
|
+
__dirname,
|
|
12
|
+
process.platform === "win32" ? "veryfront.exe" : "veryfront",
|
|
13
|
+
);
|
|
11
14
|
|
|
12
15
|
async function runJsFallback() {
|
|
13
|
-
await import(
|
|
16
|
+
await import("../esm/cli/main.js");
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
if (existsSync(nativeBinary)) {
|
|
17
|
-
const child = spawn(nativeBinary, process.argv.slice(2), {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const child = spawn(nativeBinary, process.argv.slice(2), {
|
|
21
|
+
stdio: "inherit",
|
|
22
|
+
});
|
|
23
|
+
child.on("close", (code) => process.exit(code ?? 0));
|
|
24
|
+
child.on("error", () =>
|
|
25
|
+
runJsFallback().catch((err) => {
|
|
26
|
+
console.error(err);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
20
30
|
} else {
|
|
21
|
-
runJsFallback().catch(err => {
|
|
31
|
+
runJsFallback().catch((err) => {
|
|
32
|
+
console.error(err);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
});
|
|
22
35
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/task/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,WAmBtB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const taskHelp = {
|
|
2
|
+
name: "task",
|
|
3
|
+
description: "Run a task from the tasks/ directory",
|
|
4
|
+
usage: "veryfront task <name> [options]",
|
|
5
|
+
options: [
|
|
6
|
+
{
|
|
7
|
+
flag: "--config <json>",
|
|
8
|
+
description: "JSON config to pass to the task's ctx.config",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
flag: "--debug",
|
|
12
|
+
description: "Enable debug logging",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
examples: [
|
|
16
|
+
"veryfront task sync-data",
|
|
17
|
+
'veryfront task send-report --config \'{"to": "team@example.com"}\'',
|
|
18
|
+
"veryfront task cleanup --debug",
|
|
19
|
+
],
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/task/command.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,WAAY,SAAQ,QAAQ;CAAG;AAEhD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkFrE"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task command - Discover and run a task from the tasks/ directory
|
|
3
|
+
*
|
|
4
|
+
* Finds the specified task file, imports it, and calls its run() function
|
|
5
|
+
* with a local execution context.
|
|
6
|
+
*/
|
|
7
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
8
|
+
import { cliLogger } from "../../utils/index.js";
|
|
9
|
+
import { exitProcess } from "../../utils/index.js";
|
|
10
|
+
export async function taskCommand(options) {
|
|
11
|
+
const { getAdapter } = await import("../../../src/platform/adapters/detect.js");
|
|
12
|
+
const { discoverTasks } = await import("../../../src/task/discovery.js");
|
|
13
|
+
const { runTask } = await import("../../../src/task/runner.js");
|
|
14
|
+
const taskName = options.name;
|
|
15
|
+
if (!taskName) {
|
|
16
|
+
cliLogger.error("Task name is required. Usage: veryfront task <name>");
|
|
17
|
+
exitProcess(1);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const projectDir = dntShim.Deno.cwd();
|
|
21
|
+
const adapter = await getAdapter();
|
|
22
|
+
cliLogger.info(`Discovering tasks in ${projectDir}/tasks/...`);
|
|
23
|
+
const { tasks, errors } = await discoverTasks({
|
|
24
|
+
projectDir,
|
|
25
|
+
adapter,
|
|
26
|
+
debug: options.debug,
|
|
27
|
+
});
|
|
28
|
+
if (errors.length > 0 && options.debug) {
|
|
29
|
+
for (const err of errors) {
|
|
30
|
+
cliLogger.warn(` Warning: ${err.filePath}: ${err.error}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const task = tasks.find((t) => t.id === taskName);
|
|
34
|
+
if (!task) {
|
|
35
|
+
cliLogger.error(`Task "${taskName}" not found.`);
|
|
36
|
+
if (tasks.length > 0) {
|
|
37
|
+
cliLogger.info("Available tasks:");
|
|
38
|
+
for (const t of tasks) {
|
|
39
|
+
cliLogger.info(` - ${t.id}${t.name !== t.id ? ` (${t.name})` : ""}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
cliLogger.info("No tasks found. Create a task file in tasks/ directory:");
|
|
44
|
+
cliLogger.info(" tasks/my-task.ts");
|
|
45
|
+
}
|
|
46
|
+
exitProcess(1);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// Parse config JSON if provided
|
|
50
|
+
let config = {};
|
|
51
|
+
if (options.config) {
|
|
52
|
+
try {
|
|
53
|
+
config = JSON.parse(options.config);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
cliLogger.error("Invalid --config JSON");
|
|
57
|
+
exitProcess(1);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
cliLogger.info(`Running task: ${task.name} (${task.id})`);
|
|
62
|
+
cliLogger.info("");
|
|
63
|
+
const result = await runTask({
|
|
64
|
+
task,
|
|
65
|
+
config,
|
|
66
|
+
debug: options.debug,
|
|
67
|
+
});
|
|
68
|
+
cliLogger.info("");
|
|
69
|
+
if (result.success) {
|
|
70
|
+
cliLogger.info(`Task completed in ${result.durationMs}ms`);
|
|
71
|
+
if (result.result !== undefined) {
|
|
72
|
+
cliLogger.info(`Result: ${JSON.stringify(result.result, null, 2)}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
cliLogger.error(`Task failed after ${result.durationMs}ms: ${result.error}`);
|
|
77
|
+
exitProcess(1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ParsedArgs } from "../../shared/types.js";
|
|
3
|
+
declare const TaskArgsSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
config: z.ZodOptional<z.ZodString>;
|
|
6
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
name: string;
|
|
9
|
+
debug: boolean;
|
|
10
|
+
config?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
name: string;
|
|
13
|
+
config?: string | undefined;
|
|
14
|
+
debug?: boolean | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export type TaskArgs = z.infer<typeof TaskArgsSchema>;
|
|
17
|
+
export declare const parseTaskArgs: (args: ParsedArgs) => z.SafeParseReturnType<unknown, {
|
|
18
|
+
name: string;
|
|
19
|
+
debug: boolean;
|
|
20
|
+
config?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function handleTaskCommand(args: ParsedArgs): Promise<void>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/task/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,QAAA,MAAM,cAAc;;;;;;;;;;;;EAIlB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,aAAa;;;;EAIxB,CAAC;AAEH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAIvE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
3
|
+
const TaskArgsSchema = z.object({
|
|
4
|
+
name: z.string(),
|
|
5
|
+
config: z.string().optional(),
|
|
6
|
+
debug: z.boolean().default(false),
|
|
7
|
+
});
|
|
8
|
+
export const parseTaskArgs = createArgParser(TaskArgsSchema, {
|
|
9
|
+
name: { keys: ["name"], type: "string", positional: 0 },
|
|
10
|
+
config: { keys: ["config"], type: "string" },
|
|
11
|
+
debug: { keys: ["debug"], type: "boolean" },
|
|
12
|
+
});
|
|
13
|
+
export async function handleTaskCommand(args) {
|
|
14
|
+
const opts = parseArgsOrThrow(parseTaskArgs, "task", args);
|
|
15
|
+
const { taskCommand } = await import("./command.js");
|
|
16
|
+
await taskCommand(opts);
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-definitions.d.ts","sourceRoot":"","sources":["../../../src/cli/help/command-definitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"command-definitions.d.ts","sourceRoot":"","sources":["../../../src/cli/help/command-definitions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6BlD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,eA2BtB,CAAC"}
|
|
@@ -29,6 +29,7 @@ import { demoHelp } from "../commands/demo/command-help.js";
|
|
|
29
29
|
import { mcpHelp } from "../commands/mcp/command-help.js";
|
|
30
30
|
import { issuesHelp } from "../commands/issues/command-help.js";
|
|
31
31
|
import { startHelp } from "../commands/start/command-help.js";
|
|
32
|
+
import { taskHelp } from "../commands/task/command-help.js";
|
|
32
33
|
/**
|
|
33
34
|
* Central registry of all command help definitions.
|
|
34
35
|
* Each command's help is imported from its respective command-help.ts file.
|
|
@@ -59,4 +60,5 @@ export const COMMANDS = {
|
|
|
59
60
|
mcp: mcpHelp,
|
|
60
61
|
issues: issuesHelp,
|
|
61
62
|
start: startHelp,
|
|
63
|
+
task: taskHelp,
|
|
62
64
|
};
|
package/esm/cli/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/cli/router.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/cli/router.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgCH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAuDpD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwClE"}
|
package/esm/cli/router.js
CHANGED
|
@@ -26,6 +26,7 @@ import { handleServeCommand } from "./commands/serve/handler.js";
|
|
|
26
26
|
import { handleStartCommand } from "./commands/start/handler.js";
|
|
27
27
|
import { handleStudioCommand } from "./commands/studio/handler.js";
|
|
28
28
|
import { handleUpCommand } from "./commands/up/index.js";
|
|
29
|
+
import { handleTaskCommand } from "./commands/task/handler.js";
|
|
29
30
|
import { handleWorkerCommand } from "./commands/worker/handler.js";
|
|
30
31
|
import { login, logout, whoami } from "./auth/index.js";
|
|
31
32
|
import { parseLoginMethod } from "./auth/utils.js";
|
|
@@ -70,6 +71,7 @@ const commands = {
|
|
|
70
71
|
"mcp": handleMCPCommand,
|
|
71
72
|
"issues": handleIssuesCommand,
|
|
72
73
|
"start": handleStartCommand,
|
|
74
|
+
"task": handleTaskCommand,
|
|
73
75
|
"worker": handleWorkerCommand,
|
|
74
76
|
};
|
|
75
77
|
/**
|
package/esm/deno.d.ts
CHANGED
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-engine.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/discovery-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EAEhB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery-engine.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/discovery-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EAEhB,MAAM,YAAY,CAAC;AA2DpB;;GAEG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAkDnF"}
|
|
@@ -9,7 +9,7 @@ import { agentLogger } from "../utils/logger/logger.js";
|
|
|
9
9
|
import { ensureError } from "../errors/veryfront-error.js";
|
|
10
10
|
import { importModule } from "./transpiler.js";
|
|
11
11
|
import { findTypeScriptFiles } from "./file-discovery.js";
|
|
12
|
-
import { agentHandler, promptHandler, resourceHandler, toolHandler, workflowHandler, } from "./handlers/index.js";
|
|
12
|
+
import { agentHandler, promptHandler, resourceHandler, taskHandler, toolHandler, workflowHandler, } from "./handlers/index.js";
|
|
13
13
|
const logger = agentLogger.component("discovery");
|
|
14
14
|
/**
|
|
15
15
|
* Discover items of a specific type in a directory
|
|
@@ -60,6 +60,7 @@ export async function discoverAll(config) {
|
|
|
60
60
|
resources: new Map(),
|
|
61
61
|
prompts: new Map(),
|
|
62
62
|
workflows: new Map(),
|
|
63
|
+
tasks: new Map(),
|
|
63
64
|
errors: [],
|
|
64
65
|
};
|
|
65
66
|
// Discover tools
|
|
@@ -82,5 +83,9 @@ export async function discoverAll(config) {
|
|
|
82
83
|
for (const dir of config.workflowDirs ?? ["workflows"]) {
|
|
83
84
|
await discoverItems(`${baseDir}/${dir}`, result, context, workflowHandler, config.verbose);
|
|
84
85
|
}
|
|
86
|
+
// Discover tasks
|
|
87
|
+
for (const dir of config.taskDirs ?? ["tasks"]) {
|
|
88
|
+
await discoverItems(`${baseDir}/${dir}`, result, context, taskHandler, config.verbose);
|
|
89
|
+
}
|
|
85
90
|
return result;
|
|
86
91
|
}
|
|
@@ -8,4 +8,5 @@ export { agentHandler } from "./agent-handler.js";
|
|
|
8
8
|
export { resourceHandler } from "./resource-handler.js";
|
|
9
9
|
export { promptHandler } from "./prompt-handler.js";
|
|
10
10
|
export { workflowHandler } from "./workflow-handler.js";
|
|
11
|
+
export { taskHandler } from "./task-handler.js";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/discovery/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/discovery/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -8,3 +8,4 @@ export { agentHandler } from "./agent-handler.js";
|
|
|
8
8
|
export { resourceHandler } from "./resource-handler.js";
|
|
9
9
|
export { promptHandler } from "./prompt-handler.js";
|
|
10
10
|
export { workflowHandler } from "./workflow-handler.js";
|
|
11
|
+
export { taskHandler } from "./task-handler.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-handler.d.ts","sourceRoot":"","sources":["../../../../src/src/discovery/handlers/task-handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,aAAa,CAAC;AAErE,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,cAAc,CAcxD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Discovery Handler
|
|
3
|
+
*/
|
|
4
|
+
import { isTaskDefinition } from "../../task/types.js";
|
|
5
|
+
export const taskHandler = {
|
|
6
|
+
typeName: "task",
|
|
7
|
+
validate: (item) => isTaskDefinition(item),
|
|
8
|
+
getId: (_task, file, dir) => {
|
|
9
|
+
// Derive ID from file path relative to tasks dir
|
|
10
|
+
let relative = file;
|
|
11
|
+
const prefix = dir.endsWith("/") ? dir : `${dir}/`;
|
|
12
|
+
if (relative.startsWith(prefix)) {
|
|
13
|
+
relative = relative.slice(prefix.length);
|
|
14
|
+
}
|
|
15
|
+
return relative.replace(/\.(ts|tsx|js|jsx)$/, "");
|
|
16
|
+
},
|
|
17
|
+
register: (_id, task) => task,
|
|
18
|
+
getResultMap: (result) => result.tasks,
|
|
19
|
+
};
|
|
@@ -8,6 +8,7 @@ import type { Agent } from "../agent/index.js";
|
|
|
8
8
|
import type { Resource } from "../resource/index.js";
|
|
9
9
|
import type { Prompt } from "../prompt/index.js";
|
|
10
10
|
import type { Workflow } from "../workflow/index.js";
|
|
11
|
+
import type { TaskDefinition } from "../task/types.js";
|
|
11
12
|
import type { Platform } from "../platform/core-platform.js";
|
|
12
13
|
import type { FileSystemAdapter } from "../platform/adapters/base.js";
|
|
13
14
|
/**
|
|
@@ -32,6 +33,7 @@ export interface DiscoveryConfig {
|
|
|
32
33
|
resourceDirs?: string[];
|
|
33
34
|
promptDirs?: string[];
|
|
34
35
|
workflowDirs?: string[];
|
|
36
|
+
taskDirs?: string[];
|
|
35
37
|
verbose?: boolean;
|
|
36
38
|
fsAdapter?: FileSystemAdapter;
|
|
37
39
|
}
|
|
@@ -44,6 +46,7 @@ export interface DiscoveryResult {
|
|
|
44
46
|
resources: Map<string, Resource>;
|
|
45
47
|
prompts: Map<string, Prompt>;
|
|
46
48
|
workflows: Map<string, Workflow>;
|
|
49
|
+
tasks: Map<string, TaskDefinition>;
|
|
47
50
|
errors: Array<{
|
|
48
51
|
file: string;
|
|
49
52
|
error: Error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAA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gBAAgB,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC;IACvC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACtD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC,CAAC;IAChE,YAAY,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CAC3D"}
|
|
@@ -12,8 +12,6 @@ export declare class VeryfrontFSAdapter implements FSAdapter {
|
|
|
12
12
|
private initialized;
|
|
13
13
|
/** Resolves when file list initialization is complete (for coordinating reads) */
|
|
14
14
|
private fileListReadyResolve;
|
|
15
|
-
/** Rejects when file list initialization fails */
|
|
16
|
-
private fileListReadyReject;
|
|
17
15
|
private projectData?;
|
|
18
16
|
private apiBaseUrl;
|
|
19
17
|
private apiToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EAEV,cAAc,EACd,SAAS,EACT,eAAe,EAEf,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAoBnE,qBAAa,kBAAmB,YAAW,SAAS;IAClD,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,KAAK,CAAY;IACzB,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,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IA0BvD,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIpC,iBAAiB,IAAI,IAAI;IAIzB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAK7C,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC,kBAAkB,IAAI,IAAI;IAK1B,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI;IAkCxD,iBAAiB,IAAI,sBAAsB,GAAG,IAAI;IAWlD,SAAS,IAAI,kBAAkB;YAIjB,iBAAiB;IAK/B;;;;;OAKG;YACW,uBAAuB;CA2CtC"}
|
|
@@ -21,8 +21,6 @@ export class VeryfrontFSAdapter {
|
|
|
21
21
|
initialized = false;
|
|
22
22
|
/** Resolves when file list initialization is complete (for coordinating reads) */
|
|
23
23
|
fileListReadyResolve = null;
|
|
24
|
-
/** Rejects when file list initialization fails */
|
|
25
|
-
fileListReadyReject = null;
|
|
26
24
|
projectData;
|
|
27
25
|
apiBaseUrl;
|
|
28
26
|
apiToken;
|
|
@@ -154,9 +152,8 @@ export class VeryfrontFSAdapter {
|
|
|
154
152
|
logger.debug("Already initialized, skipping", { projectSlug });
|
|
155
153
|
return;
|
|
156
154
|
}
|
|
157
|
-
const fileListReadyPromise = new Promise((resolve
|
|
155
|
+
const fileListReadyPromise = new Promise((resolve) => {
|
|
158
156
|
this.fileListReadyResolve = resolve;
|
|
159
|
-
this.fileListReadyReject = reject;
|
|
160
157
|
});
|
|
161
158
|
this.readOps.setFileListReadyPromise(fileListReadyPromise);
|
|
162
159
|
logger.debug("Step 1: client.initialize START", { projectSlug });
|
|
@@ -208,7 +205,6 @@ export class VeryfrontFSAdapter {
|
|
|
208
205
|
await this.cache.setAsync(cacheKey, files);
|
|
209
206
|
this.fileListReadyResolve?.();
|
|
210
207
|
this.fileListReadyResolve = null;
|
|
211
|
-
this.fileListReadyReject = null;
|
|
212
208
|
logger.debug("Fetched files during initialization", {
|
|
213
209
|
cacheKey,
|
|
214
210
|
totalFiles: fileSummary.totalFiles,
|
|
@@ -254,9 +250,9 @@ export class VeryfrontFSAdapter {
|
|
|
254
250
|
}
|
|
255
251
|
}
|
|
256
252
|
catch (error) {
|
|
257
|
-
|
|
253
|
+
// Resolve (not reject) to avoid an unhandled-rejection crash in Deno when no lookup() is awaiting.
|
|
254
|
+
this.fileListReadyResolve?.();
|
|
258
255
|
this.fileListReadyResolve = null;
|
|
259
|
-
this.fileListReadyReject = null;
|
|
260
256
|
throw error;
|
|
261
257
|
}
|
|
262
258
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-template.d.ts","sourceRoot":"","sources":["../../../src/src/studio/bridge-template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"bridge-template.d.ts","sourceRoot":"","sources":["../../../src/src/studio/bridge-template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA2tB/E"}
|
|
@@ -484,7 +484,7 @@ export function generateStudioBridgeScript(options) {
|
|
|
484
484
|
|
|
485
485
|
html2canvasPromise = new Promise((resolve, reject) => {
|
|
486
486
|
const script = document.createElement('script');
|
|
487
|
-
script.src = 'https://cdn.jsdelivr.net/npm/html2canvas@
|
|
487
|
+
script.src = 'https://cdn.jsdelivr.net/npm/html2canvas-pro@2.0.0/dist/html2canvas-pro.min.js';
|
|
488
488
|
script.onload = () => {
|
|
489
489
|
html2canvasLoaded = true;
|
|
490
490
|
resolve();
|
|
@@ -522,7 +522,8 @@ export function generateStudioBridgeScript(options) {
|
|
|
522
522
|
await new Promise(r => setTimeout(r, 100));
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
const
|
|
525
|
+
const html2canvasFn = window.html2canvas.default || window.html2canvas;
|
|
526
|
+
const canvas = await html2canvasFn(document.body, canvasOptions);
|
|
526
527
|
const dataUrl = canvas.toDataURL('image/png', quality);
|
|
527
528
|
|
|
528
529
|
window.scrollTo(0, originalScrollY);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Discovery
|
|
3
|
+
*
|
|
4
|
+
* Discovers task definitions from user's project `tasks/` directory.
|
|
5
|
+
* Follows the same patterns as workflow-discovery.ts.
|
|
6
|
+
*
|
|
7
|
+
* Scans:
|
|
8
|
+
* - tasks/*.ts - task definition files
|
|
9
|
+
* - tasks/**\/*.ts - nested task files
|
|
10
|
+
*
|
|
11
|
+
* Task files should export a task definition:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* export default {
|
|
14
|
+
* name: "Sync external data",
|
|
15
|
+
* run: async (ctx) => {
|
|
16
|
+
* console.log("Syncing data...")
|
|
17
|
+
* return { synced: 42 }
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
import type { RuntimeAdapter } from "../platform/index.js";
|
|
23
|
+
import type { VeryfrontConfig } from "../config/index.js";
|
|
24
|
+
import type { TaskDefinition } from "./types.js";
|
|
25
|
+
/**
|
|
26
|
+
* Discovered task info
|
|
27
|
+
*/
|
|
28
|
+
export interface DiscoveredTask {
|
|
29
|
+
/** Task ID derived from file path (e.g., "sync-data" from tasks/sync-data.ts) */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Human-readable name from task definition */
|
|
32
|
+
name: string;
|
|
33
|
+
/** File path where the task is defined */
|
|
34
|
+
filePath: string;
|
|
35
|
+
/** Export name (e.g., "default" or named export) */
|
|
36
|
+
exportName: string;
|
|
37
|
+
/** The task definition */
|
|
38
|
+
definition: TaskDefinition;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Options for task discovery
|
|
42
|
+
*/
|
|
43
|
+
export interface TaskDiscoveryOptions {
|
|
44
|
+
/** Project directory */
|
|
45
|
+
projectDir: string;
|
|
46
|
+
/** Runtime adapter for filesystem operations */
|
|
47
|
+
adapter: RuntimeAdapter;
|
|
48
|
+
/** Veryfront config (for import maps, etc.) */
|
|
49
|
+
config?: VeryfrontConfig;
|
|
50
|
+
/** Base directory for tasks (default: "tasks") */
|
|
51
|
+
tasksDir?: string;
|
|
52
|
+
/** Enable debug logging */
|
|
53
|
+
debug?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Result of task discovery
|
|
57
|
+
*/
|
|
58
|
+
export interface TaskDiscoveryResult {
|
|
59
|
+
/** All discovered tasks */
|
|
60
|
+
tasks: DiscoveredTask[];
|
|
61
|
+
/** Errors encountered during discovery */
|
|
62
|
+
errors: Array<{
|
|
63
|
+
filePath: string;
|
|
64
|
+
error: string;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Derive task ID from file path (e.g., "tasks/sync-data.ts" → "sync-data")
|
|
69
|
+
*/
|
|
70
|
+
export declare function deriveTaskId(filePath: string, tasksDir: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Discover all tasks in a project
|
|
73
|
+
*/
|
|
74
|
+
export declare function discoverTasks(options: TaskDiscoveryOptions): Promise<TaskDiscoveryResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Find a specific task by ID
|
|
77
|
+
*
|
|
78
|
+
* TODO: Optimise by short-circuiting discovery once the target task is found
|
|
79
|
+
* instead of discovering all tasks first. This is consistent with the workflow
|
|
80
|
+
* pattern but could be improved for large projects with many task files.
|
|
81
|
+
*/
|
|
82
|
+
export declare function findTaskById(taskId: string, options: TaskDiscoveryOptions): Promise<DiscoveredTask | null>;
|
|
83
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/src/task/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAKjD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IAEX,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IAEb,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IAEnB,0BAA0B;IAC1B,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IAEnB,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAC;IAExB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB,0CAA0C;IAC1C,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAA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