veryfront 0.1.77 → 0.1.79

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.
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/task/command.ts"],"names":[],"mappings":"AAYA,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,CA0FrE"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/task/command.ts"],"names":[],"mappings":"AAaA,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,CA4FrE"}
@@ -8,6 +8,7 @@ import * as dntShim from "../../../_dnt.shims.js";
8
8
  import { cliLogger } from "../../utils/index.js";
9
9
  import { exitProcess } from "../../utils/index.js";
10
10
  import { withProjectSourceContext } from "../../shared/project-source-context.js";
11
+ import { sanitizeJobOutputForLogging } from "../../utils/sanitize-job-output.js";
11
12
  export async function taskCommand(options) {
12
13
  const { discoverTasks } = await import("../../../src/task/discovery.js");
13
14
  const { runTask } = await import("../../../src/task/runner.js");
@@ -75,7 +76,7 @@ export async function taskCommand(options) {
75
76
  if (result.success) {
76
77
  cliLogger.info(`Task completed in ${result.durationMs}ms`);
77
78
  if (result.result !== undefined) {
78
- cliLogger.info(`Result: ${JSON.stringify(result.result, null, 2)}`);
79
+ cliLogger.info(`Result: ${JSON.stringify(sanitizeJobOutputForLogging(result.result), null, 2)}`);
79
80
  }
80
81
  return;
81
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/workflow/command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,WAAW,eAAgB,SAAQ,YAAY;CAAG;AA2DxD,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmF7E"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/workflow/command.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,WAAW,eAAgB,SAAQ,YAAY;CAAG;AA6DxD,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmF7E"}
@@ -2,6 +2,7 @@ import * as dntShim from "../../../_dnt.shims.js";
2
2
  import { cliLogger } from "../../utils/index.js";
3
3
  import { exitProcess } from "../../utils/index.js";
4
4
  import { withProjectSourceContext } from "../../shared/project-source-context.js";
5
+ import { sanitizeJobOutputForLogging } from "../../utils/sanitize-job-output.js";
5
6
  import { getEnv } from "../../../src/platform/index.js";
6
7
  const WORKFLOW_STATUS_POLL_INTERVAL_MS = 1_000;
7
8
  async function createWorkflowClient(debug) {
@@ -26,7 +27,7 @@ async function waitForWorkflowExit(client, runId) {
26
27
  if (run.status === "completed") {
27
28
  cliLogger.info(`Workflow completed: ${runId}`);
28
29
  if (run.output !== undefined) {
29
- cliLogger.info(`Result: ${JSON.stringify(run.output, null, 2)}`);
30
+ cliLogger.info(`Result: ${JSON.stringify(sanitizeJobOutputForLogging(run.output), null, 2)}`);
30
31
  }
31
32
  return;
32
33
  }
@@ -0,0 +1,2 @@
1
+ export declare function sanitizeJobOutputForLogging(value: unknown): unknown;
2
+ //# sourceMappingURL=sanitize-job-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-job-output.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/sanitize-job-output.ts"],"names":[],"mappings":"AAoBA,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEnE"}
@@ -0,0 +1,19 @@
1
+ function sanitizeValue(value) {
2
+ if (Array.isArray(value)) {
3
+ return value.map(sanitizeValue);
4
+ }
5
+ if (value == null || typeof value !== "object") {
6
+ return value;
7
+ }
8
+ const sanitized = {};
9
+ for (const [key, entry] of Object.entries(value)) {
10
+ if (key === "_tenant") {
11
+ continue;
12
+ }
13
+ sanitized[key] = sanitizeValue(entry);
14
+ }
15
+ return sanitized;
16
+ }
17
+ export function sanitizeJobOutputForLogging(value) {
18
+ return sanitizeValue(value);
19
+ }
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -0,0 +1,8 @@
1
+ import type { RuntimeAdapter } from "../platform/index.js";
2
+ interface ImportDiscoveryModuleOptions {
3
+ adapter: RuntimeAdapter;
4
+ projectDir?: string;
5
+ }
6
+ export declare function importDiscoveryModule(filePath: string, options: ImportDiscoveryModuleOptions): Promise<Record<string, unknown>>;
7
+ export {};
8
+ //# sourceMappingURL=module-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-import.d.ts","sourceRoot":"","sources":["../../../src/src/discovery/module-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,UAAU,4BAA4B;IACpC,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAgBD,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQlC"}
@@ -0,0 +1,24 @@
1
+ import { detectPlatform } from "../platform/core-platform.js";
2
+ import * as pathHelper from "../platform/compat/path/index.js";
3
+ import { importModule } from "./transpiler.js";
4
+ function normalizeModulePath(filePath) {
5
+ return filePath.startsWith("file://") ? filePath : `file://${filePath}`;
6
+ }
7
+ function resolveModulePath(filePath, projectDir) {
8
+ if (filePath.startsWith("file://"))
9
+ return filePath;
10
+ if (pathHelper.isAbsolute(filePath))
11
+ return normalizeModulePath(filePath);
12
+ if (!projectDir || projectDir === "." || projectDir === "") {
13
+ return normalizeModulePath(`/${filePath.replace(/^\/+/, "")}`);
14
+ }
15
+ return normalizeModulePath(pathHelper.join(projectDir, filePath));
16
+ }
17
+ export async function importDiscoveryModule(filePath, options) {
18
+ const module = await importModule(resolveModulePath(filePath, options.projectDir), {
19
+ platform: detectPlatform(),
20
+ fsAdapter: options.adapter.fs,
21
+ baseDir: options.projectDir || ".",
22
+ });
23
+ return module;
24
+ }
@@ -1 +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,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASvE;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA6G9B;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAiFhC"}
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,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASvE;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAyG9B;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA6EhC"}
@@ -22,7 +22,7 @@
22
22
  import { join } from "../../deps/jsr.io/@std/path/1.1.4/mod.js";
23
23
  import { logger as baseLogger } from "../utils/index.js";
24
24
  import { collectFiles } from "../utils/file-discovery.js";
25
- import { loadHandlerModule } from "../routing/api/module-loader/loader.js";
25
+ import { importDiscoveryModule } from "../discovery/module-import.js";
26
26
  import { isTaskDefinition } from "./types.js";
27
27
  const logger = baseLogger.component("task-discovery");
28
28
  /**
@@ -71,14 +71,10 @@ export async function discoverTasks(options) {
71
71
  }
72
72
  for (const file of files) {
73
73
  try {
74
- const module = await loadHandlerModule({
75
- projectDir,
76
- modulePath: file.path,
74
+ const module = await importDiscoveryModule(file.path, {
77
75
  adapter,
78
- config,
76
+ projectDir,
79
77
  });
80
- if (!module)
81
- continue;
82
78
  // Prefer default export (aligned with discovery-engine behaviour)
83
79
  const defaultExport = module.default;
84
80
  if (isTaskDefinition(defaultExport)) {
@@ -160,14 +156,10 @@ export async function findTaskById(taskId, options) {
160
156
  if (id !== taskId)
161
157
  continue;
162
158
  try {
163
- const module = await loadHandlerModule({
164
- projectDir,
165
- modulePath: file.path,
159
+ const module = await importDiscoveryModule(file.path, {
166
160
  adapter,
167
- config,
161
+ projectDir,
168
162
  });
169
- if (!module)
170
- continue;
171
163
  const defaultExport = module.default;
172
164
  if (isTaskDefinition(defaultExport)) {
173
165
  if (debug) {
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-discovery.d.ts","sourceRoot":"","sources":["../../../../src/src/workflow/discovery/workflow-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IAEX,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IAEnB,8BAA8B;IAC9B,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IAEnB,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAC;IAExB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,+BAA+B;IAC/B,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAEhC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAqCD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAiGlC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAGpC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,kBAAkB,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAMjC"}
1
+ {"version":3,"file":"workflow-discovery.d.ts","sourceRoot":"","sources":["../../../../src/src/workflow/discovery/workflow-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IAEX,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IAEnB,8BAA8B;IAC9B,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IAEnB,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAC;IAExB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,+BAA+B;IAC/B,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAEhC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAqCD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CA2FlC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAGpC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,kBAAkB,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAMjC"}
@@ -24,7 +24,7 @@
24
24
  import { join } from "../../../deps/jsr.io/@std/path/1.1.4/mod.js";
25
25
  import { logger as baseLogger } from "../../utils/index.js";
26
26
  import { collectFiles } from "../../utils/file-discovery.js";
27
- import { loadHandlerModule } from "../../routing/api/module-loader/loader.js";
27
+ import { importDiscoveryModule } from "../../discovery/module-import.js";
28
28
  const logger = baseLogger.component("workflow-discovery");
29
29
  /**
30
30
  * Check if a value looks like a workflow definition
@@ -95,15 +95,10 @@ export async function discoverWorkflows(options) {
95
95
  // Load and extract workflows from each file
96
96
  for (const file of files) {
97
97
  try {
98
- const module = await loadHandlerModule({
99
- projectDir,
100
- modulePath: file.path,
98
+ const module = await importDiscoveryModule(file.path, {
101
99
  adapter,
102
- config,
100
+ projectDir,
103
101
  });
104
- if (!module) {
105
- continue;
106
- }
107
102
  // Extract workflows from module exports
108
103
  for (const [exportName, value] of Object.entries(module)) {
109
104
  const definition = extractWorkflowDefinition(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -10,6 +10,7 @@ import * as dntShim from "../../../_dnt.shims.js";
10
10
  import { cliLogger } from "../../utils/index.js";
11
11
  import { exitProcess } from "../../utils/index.js";
12
12
  import { withProjectSourceContext } from "../../shared/project-source-context.js";
13
+ import { sanitizeJobOutputForLogging } from "../../utils/sanitize-job-output.js";
13
14
  import type { TaskArgs } from "./handler.js";
14
15
 
15
16
  export interface TaskOptions extends TaskArgs {}
@@ -95,7 +96,9 @@ export async function taskCommand(options: TaskOptions): Promise<void> {
95
96
  if (result.success) {
96
97
  cliLogger.info(`Task completed in ${result.durationMs}ms`);
97
98
  if (result.result !== undefined) {
98
- cliLogger.info(`Result: ${JSON.stringify(result.result, null, 2)}`);
99
+ cliLogger.info(
100
+ `Result: ${JSON.stringify(sanitizeJobOutputForLogging(result.result), null, 2)}`,
101
+ );
99
102
  }
100
103
  return;
101
104
  }
@@ -2,6 +2,7 @@ import * as dntShim from "../../../_dnt.shims.js";
2
2
  import { cliLogger } from "../../utils/index.js";
3
3
  import { exitProcess } from "../../utils/index.js";
4
4
  import { withProjectSourceContext } from "../../shared/project-source-context.js";
5
+ import { sanitizeJobOutputForLogging } from "../../utils/sanitize-job-output.js";
5
6
  import { getEnv } from "../../../src/platform/index.js";
6
7
  import type { WorkflowArgs } from "./handler.js";
7
8
 
@@ -44,7 +45,9 @@ async function waitForWorkflowExit(
44
45
  if (run.status === "completed") {
45
46
  cliLogger.info(`Workflow completed: ${runId}`);
46
47
  if (run.output !== undefined) {
47
- cliLogger.info(`Result: ${JSON.stringify(run.output, null, 2)}`);
48
+ cliLogger.info(
49
+ `Result: ${JSON.stringify(sanitizeJobOutputForLogging(run.output), null, 2)}`,
50
+ );
48
51
  }
49
52
  return;
50
53
  }
@@ -0,0 +1,23 @@
1
+ function sanitizeValue(value: unknown): unknown {
2
+ if (Array.isArray(value)) {
3
+ return value.map(sanitizeValue);
4
+ }
5
+
6
+ if (value == null || typeof value !== "object") {
7
+ return value;
8
+ }
9
+
10
+ const sanitized: Record<string, unknown> = {};
11
+ for (const [key, entry] of Object.entries(value)) {
12
+ if (key === "_tenant") {
13
+ continue;
14
+ }
15
+ sanitized[key] = sanitizeValue(entry);
16
+ }
17
+
18
+ return sanitized;
19
+ }
20
+
21
+ export function sanitizeJobOutputForLogging(value: unknown): unknown {
22
+ return sanitizeValue(value);
23
+ }
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -0,0 +1,36 @@
1
+ import type { RuntimeAdapter } from "../platform/index.js";
2
+ import { detectPlatform } from "../platform/core-platform.js";
3
+ import * as pathHelper from "../platform/compat/path/index.js";
4
+ import { importModule } from "./transpiler.js";
5
+
6
+ interface ImportDiscoveryModuleOptions {
7
+ adapter: RuntimeAdapter;
8
+ projectDir?: string;
9
+ }
10
+
11
+ function normalizeModulePath(filePath: string): string {
12
+ return filePath.startsWith("file://") ? filePath : `file://${filePath}`;
13
+ }
14
+
15
+ function resolveModulePath(filePath: string, projectDir?: string): string {
16
+ if (filePath.startsWith("file://")) return filePath;
17
+ if (pathHelper.isAbsolute(filePath)) return normalizeModulePath(filePath);
18
+ if (!projectDir || projectDir === "." || projectDir === "") {
19
+ return normalizeModulePath(`/${filePath.replace(/^\/+/, "")}`);
20
+ }
21
+
22
+ return normalizeModulePath(pathHelper.join(projectDir, filePath));
23
+ }
24
+
25
+ export async function importDiscoveryModule(
26
+ filePath: string,
27
+ options: ImportDiscoveryModuleOptions,
28
+ ): Promise<Record<string, unknown>> {
29
+ const module = await importModule(resolveModulePath(filePath, options.projectDir), {
30
+ platform: detectPlatform(),
31
+ fsAdapter: options.adapter.fs,
32
+ baseDir: options.projectDir || ".",
33
+ });
34
+
35
+ return module as Record<string, unknown>;
36
+ }
@@ -25,7 +25,7 @@ import { logger as baseLogger } from "../utils/index.js";
25
25
  import type { RuntimeAdapter } from "../platform/index.js";
26
26
  import type { VeryfrontConfig } from "../config/index.js";
27
27
  import { collectFiles } from "../utils/file-discovery.js";
28
- import { loadHandlerModule } from "../routing/api/module-loader/loader.js";
28
+ import { importDiscoveryModule } from "../discovery/module-import.js";
29
29
  import type { TaskDefinition } from "./types.js";
30
30
  import { isTaskDefinition } from "./types.js";
31
31
 
@@ -144,17 +144,13 @@ export async function discoverTasks(
144
144
 
145
145
  for (const file of files) {
146
146
  try {
147
- const module = await loadHandlerModule({
148
- projectDir,
149
- modulePath: file.path,
147
+ const module = await importDiscoveryModule(file.path, {
150
148
  adapter,
151
- config,
149
+ projectDir,
152
150
  });
153
151
 
154
- if (!module) continue;
155
-
156
152
  // Prefer default export (aligned with discovery-engine behaviour)
157
- const defaultExport = (module as Record<string, unknown>).default;
153
+ const defaultExport = module.default;
158
154
  if (isTaskDefinition(defaultExport)) {
159
155
  const id = deriveTaskId(file.path, baseDir);
160
156
  tasks.push({
@@ -248,16 +244,12 @@ export async function findTaskById(
248
244
  if (id !== taskId) continue;
249
245
 
250
246
  try {
251
- const module = await loadHandlerModule({
252
- projectDir,
253
- modulePath: file.path,
247
+ const module = await importDiscoveryModule(file.path, {
254
248
  adapter,
255
- config,
249
+ projectDir,
256
250
  });
257
251
 
258
- if (!module) continue;
259
-
260
- const defaultExport = (module as Record<string, unknown>).default;
252
+ const defaultExport = module.default;
261
253
  if (isTaskDefinition(defaultExport)) {
262
254
  if (debug) {
263
255
  logger.info(`Found task "${id}" in ${file.path} (export: default)`);
@@ -27,7 +27,7 @@ import { logger as baseLogger } from "../../utils/index.js";
27
27
  import type { RuntimeAdapter } from "../../platform/index.js";
28
28
  import type { VeryfrontConfig } from "../../config/index.js";
29
29
  import { collectFiles } from "../../utils/file-discovery.js";
30
- import { loadHandlerModule } from "../../routing/api/module-loader/loader.js";
30
+ import { importDiscoveryModule } from "../../discovery/module-import.js";
31
31
  import type { WorkflowDefinition } from "../types.js";
32
32
 
33
33
  const logger = baseLogger.component("workflow-discovery");
@@ -167,17 +167,11 @@ export async function discoverWorkflows(
167
167
  // Load and extract workflows from each file
168
168
  for (const file of files) {
169
169
  try {
170
- const module = await loadHandlerModule({
171
- projectDir,
172
- modulePath: file.path,
170
+ const module = await importDiscoveryModule(file.path, {
173
171
  adapter,
174
- config,
172
+ projectDir,
175
173
  });
176
174
 
177
- if (!module) {
178
- continue;
179
- }
180
-
181
175
  // Extract workflows from module exports
182
176
  for (const [exportName, value] of Object.entries(module)) {
183
177
  const definition = extractWorkflowDefinition(value);