veryfront 0.1.623 → 0.1.625

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.
Files changed (151) hide show
  1. package/README.md +3 -3
  2. package/esm/cli/commands/knowledge/command-help.d.ts.map +1 -1
  3. package/esm/cli/commands/knowledge/command-help.js +2 -3
  4. package/esm/cli/commands/knowledge/command.d.ts +2 -47
  5. package/esm/cli/commands/knowledge/command.d.ts.map +1 -1
  6. package/esm/cli/commands/knowledge/command.js +22 -124
  7. package/esm/cli/commands/knowledge/parser.d.ts +40 -0
  8. package/esm/cli/commands/knowledge/parser.d.ts.map +1 -0
  9. package/esm/cli/commands/knowledge/parser.js +353 -0
  10. package/esm/cli/commands/knowledge/result.d.ts +3 -3
  11. package/esm/cli/commands/knowledge/result.js +1 -1
  12. package/esm/cli/commands/styles/command.js +2 -2
  13. package/esm/cli/commands/task/command.js +4 -4
  14. package/esm/cli/commands/worker/command-help.js +4 -4
  15. package/esm/cli/commands/worker/command.d.ts +1 -1
  16. package/esm/cli/commands/worker/command.js +9 -9
  17. package/esm/cli/commands/workflow/command.js +4 -4
  18. package/esm/cli/utils/sanitize-run-output.d.ts +2 -0
  19. package/esm/cli/utils/sanitize-run-output.d.ts.map +1 -0
  20. package/esm/cli/utils/{sanitize-job-output.js → sanitize-run-output.js} +1 -1
  21. package/esm/cli/utils/write-run-result.d.ts +2 -0
  22. package/esm/cli/utils/write-run-result.d.ts.map +1 -0
  23. package/esm/cli/utils/write-run-result.js +16 -0
  24. package/esm/deno.d.ts +4 -3
  25. package/esm/deno.js +6 -5
  26. package/esm/src/build/production-build/static-generation.d.ts.map +1 -1
  27. package/esm/src/build/production-build/static-generation.js +85 -0
  28. package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
  29. package/esm/src/html/hydration-script-builder/templates/renderer.js +37 -4
  30. package/esm/src/integrations/_data.js +1 -1
  31. package/esm/src/integrations/schema.d.ts +8 -0
  32. package/esm/src/integrations/schema.d.ts.map +1 -1
  33. package/esm/src/integrations/schema.js +3 -0
  34. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  35. package/esm/src/internal-agents/run-stream.js +20 -3
  36. package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts +2 -2
  37. package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts.map +1 -1
  38. package/esm/src/platform/adapters/veryfront-api-client/operations.js +2 -2
  39. package/esm/src/platform/adapters/veryfront-api-client/schemas/api.schema.d.ts +1 -1
  40. package/esm/src/platform/adapters/veryfront-api-client/schemas/api.schema.js +1 -1
  41. package/esm/src/react/components/chat/chat/components/attachment-pill.js +1 -1
  42. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +1 -0
  43. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
  44. package/esm/src/react/components/chat/chat/composition/chat-composer.js +27 -11
  45. package/esm/src/react/components/chat/chat/index.d.ts +1 -0
  46. package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
  47. package/esm/src/react/components/chat/chat/index.js +2 -2
  48. package/esm/src/react/components/chat/theme.js +1 -1
  49. package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
  50. package/esm/src/rendering/layouts/utils/applicator.js +1 -1
  51. package/esm/src/rendering/layouts/utils/component-loader.d.ts +8 -0
  52. package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
  53. package/esm/src/rendering/layouts/utils/component-loader.js +19 -0
  54. package/esm/src/rendering/rsc/client-boot.ts +23 -6
  55. package/esm/src/runs/index.d.ts +27 -0
  56. package/esm/src/runs/index.d.ts.map +1 -0
  57. package/esm/src/runs/index.js +26 -0
  58. package/esm/src/runs/runs-client.d.ts +95 -0
  59. package/esm/src/runs/runs-client.d.ts.map +1 -0
  60. package/esm/src/runs/runs-client.js +181 -0
  61. package/esm/src/{jobs → runs}/runtime-env.d.ts.map +1 -1
  62. package/esm/src/{jobs → runs}/runtime-env.js +2 -2
  63. package/esm/src/runs/schemas.d.ts +236 -0
  64. package/esm/src/runs/schemas.d.ts.map +1 -0
  65. package/esm/src/runs/schemas.js +61 -0
  66. package/esm/src/security/deno-permissions.d.ts +2 -2
  67. package/esm/src/security/deno-permissions.js +2 -2
  68. package/esm/src/security/index.d.ts +1 -1
  69. package/esm/src/security/index.js +1 -1
  70. package/esm/src/server/build-app-route-renderer.d.ts +2 -0
  71. package/esm/src/server/build-app-route-renderer.d.ts.map +1 -1
  72. package/esm/src/server/build-app-route-renderer.js +51 -28
  73. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  74. package/esm/src/server/handlers/dev/framework-candidates.generated.js +54 -8
  75. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  76. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +1 -1
  77. package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
  78. package/esm/src/server/services/static/static-file.service.js +9 -4
  79. package/esm/src/skill/index.d.ts +1 -1
  80. package/esm/src/skill/index.d.ts.map +1 -1
  81. package/esm/src/skill/index.js +1 -1
  82. package/esm/src/skill/prompt-augmentation.js +2 -2
  83. package/esm/src/skill/tools.d.ts +1 -1
  84. package/esm/src/skill/tools.d.ts.map +1 -1
  85. package/esm/src/skill/tools.js +11 -9
  86. package/esm/src/skill/types.d.ts +1 -0
  87. package/esm/src/skill/types.d.ts.map +1 -1
  88. package/esm/src/skill/types.js +1 -0
  89. package/esm/src/task/runner.js +1 -1
  90. package/esm/src/task/types.d.ts +4 -4
  91. package/esm/src/task/types.d.ts.map +1 -1
  92. package/esm/src/task/types.js +1 -1
  93. package/esm/src/tool/factory.d.ts.map +1 -1
  94. package/esm/src/tool/factory.js +10 -0
  95. package/esm/src/tool/types.d.ts +5 -4
  96. package/esm/src/tool/types.d.ts.map +1 -1
  97. package/esm/src/utils/index.d.ts +1 -1
  98. package/esm/src/utils/index.js +1 -1
  99. package/esm/src/utils/logger/index.d.ts +1 -1
  100. package/esm/src/utils/logger/index.js +1 -1
  101. package/esm/src/utils/logger/logger.d.ts +6 -6
  102. package/esm/src/utils/logger/logger.d.ts.map +1 -1
  103. package/esm/src/utils/logger/logger.js +10 -10
  104. package/esm/src/utils/version-constant.d.ts +1 -1
  105. package/esm/src/utils/version-constant.js +1 -1
  106. package/esm/src/workflow/executor/workflow-executor.js +3 -3
  107. package/esm/src/workflow/worker/{dynamic-job-entrypoint.d.ts → dynamic-run-entrypoint.d.ts} +2 -2
  108. package/esm/src/workflow/worker/{dynamic-job-entrypoint.d.ts.map → dynamic-run-entrypoint.d.ts.map} +1 -1
  109. package/esm/src/workflow/worker/{dynamic-job-entrypoint.js → dynamic-run-entrypoint.js} +1 -1
  110. package/esm/src/workflow/worker/executors/index.d.ts +8 -8
  111. package/esm/src/workflow/worker/executors/index.d.ts.map +1 -1
  112. package/esm/src/workflow/worker/executors/index.js +5 -5
  113. package/esm/src/workflow/worker/executors/k8s.d.ts +34 -34
  114. package/esm/src/workflow/worker/executors/k8s.d.ts.map +1 -1
  115. package/esm/src/workflow/worker/executors/k8s.js +59 -58
  116. package/esm/src/workflow/worker/executors/process.d.ts +15 -15
  117. package/esm/src/workflow/worker/executors/process.d.ts.map +1 -1
  118. package/esm/src/workflow/worker/executors/process.js +86 -86
  119. package/esm/src/workflow/worker/executors/types.d.ts +38 -39
  120. package/esm/src/workflow/worker/executors/types.d.ts.map +1 -1
  121. package/esm/src/workflow/worker/executors/types.js +9 -10
  122. package/esm/src/workflow/worker/index.d.ts +7 -7
  123. package/esm/src/workflow/worker/index.d.ts.map +1 -1
  124. package/esm/src/workflow/worker/index.js +9 -9
  125. package/esm/src/workflow/worker/{job-entrypoint.d.ts → run-entrypoint.d.ts} +3 -3
  126. package/esm/src/workflow/worker/{job-entrypoint.d.ts.map → run-entrypoint.d.ts.map} +1 -1
  127. package/esm/src/workflow/worker/{job-entrypoint.js → run-entrypoint.js} +2 -2
  128. package/esm/src/workflow/worker/{job-manager.d.ts → run-manager.d.ts} +32 -32
  129. package/esm/src/workflow/worker/run-manager.d.ts.map +1 -0
  130. package/esm/src/workflow/worker/{job-manager.js → run-manager.js} +63 -63
  131. package/esm/src/workflow/worker/shared.js +1 -1
  132. package/package.json +4 -4
  133. package/esm/cli/commands/knowledge/parser-source.d.ts +0 -2
  134. package/esm/cli/commands/knowledge/parser-source.d.ts.map +0 -1
  135. package/esm/cli/commands/knowledge/parser-source.js +0 -641
  136. package/esm/cli/utils/sanitize-job-output.d.ts +0 -2
  137. package/esm/cli/utils/sanitize-job-output.d.ts.map +0 -1
  138. package/esm/cli/utils/write-job-result.d.ts +0 -2
  139. package/esm/cli/utils/write-job-result.d.ts.map +0 -1
  140. package/esm/cli/utils/write-job-result.js +0 -16
  141. package/esm/src/jobs/index.d.ts +0 -25
  142. package/esm/src/jobs/index.d.ts.map +0 -1
  143. package/esm/src/jobs/index.js +0 -24
  144. package/esm/src/jobs/jobs-client.d.ts +0 -182
  145. package/esm/src/jobs/jobs-client.d.ts.map +0 -1
  146. package/esm/src/jobs/jobs-client.js +0 -255
  147. package/esm/src/jobs/schemas.d.ts +0 -1146
  148. package/esm/src/jobs/schemas.d.ts.map +0 -1
  149. package/esm/src/jobs/schemas.js +0 -294
  150. package/esm/src/workflow/worker/job-manager.d.ts.map +0 -1
  151. /package/esm/src/{jobs → runs}/runtime-env.d.ts +0 -0
@@ -1,22 +1,22 @@
1
1
  import { type WorkflowBackend } from "../backends/types.js";
2
- import type { JobExecutor, JobStatus } from "./executors/types.js";
3
- export type { JobExecutor, JobInfo, JobStatus } from "./executors/types.js";
2
+ import type { RunExecutionStatus, RunExecutor } from "./executors/types.js";
3
+ export type { RunExecutionInfo, RunExecutionStatus, RunExecutor } from "./executors/types.js";
4
4
  /**
5
- * Configuration for the workflow run manager backed by job executors.
5
+ * Configuration for the workflow run manager backed by run executors.
6
6
  */
7
7
  export interface WorkflowRunManagerConfig {
8
8
  /** Backend for workflow persistence */
9
9
  backend: WorkflowBackend;
10
- /** Job executor (K8s, Docker, Process, etc.) */
11
- executor: JobExecutor;
12
- /** Environment variables to inject into jobs */
10
+ /** Run executor (Kubernetes, Docker, Process, etc.) */
11
+ executor: RunExecutor;
12
+ /** Environment variables to inject into run executions */
13
13
  env?: Record<string, string>;
14
14
  /** Poll interval for checking pending workflows (ms) */
15
15
  pollInterval?: number;
16
- /** Maximum concurrent jobs */
17
- maxConcurrentJobs?: number;
18
- /** Job timeout (ms) - kills job if it exceeds this */
19
- jobTimeout?: number;
16
+ /** Maximum concurrent run executions */
17
+ maxConcurrentExecutions?: number;
18
+ /** Run timeout (ms) - kills execution if it exceeds this */
19
+ executionTimeout?: number;
20
20
  /** Time after which a run is considered stalled (ms) - for crash recovery */
21
21
  stalledThreshold?: number;
22
22
  /** Enable debug logging */
@@ -34,32 +34,32 @@ export interface ManagerStats {
34
34
  managerId: string;
35
35
  startedAt?: Date;
36
36
  pollCount: number;
37
- jobsCreated: number;
38
- jobsCompleted: number;
39
- jobsFailed: number;
40
- activeJobs: number;
37
+ executionsCreated: number;
38
+ executionsCompleted: number;
39
+ executionsFailed: number;
40
+ activeExecutions: number;
41
41
  lastPollAt?: Date;
42
42
  lastErrorAt?: Date;
43
43
  lastError?: string;
44
44
  }
45
45
  /**
46
- * Internal job tracking
46
+ * Internal run execution tracking
47
47
  */
48
- interface TrackedJob {
49
- jobId: string;
48
+ interface TrackedExecution {
49
+ executionId: string;
50
50
  runId: string;
51
- status: JobStatus;
51
+ status: RunExecutionStatus;
52
52
  createdAt: Date;
53
53
  }
54
54
  /**
55
55
  * Workflow run manager
56
56
  *
57
- * Orchestrates workflow execution via pluggable job executors.
57
+ * Orchestrates workflow execution via pluggable run executors.
58
58
  * Each workflow runs in complete isolation.
59
59
  *
60
60
  * @example K8s
61
61
  * ```typescript
62
- * const executor = new K8sJobExecutor({
62
+ * const executor = new K8sRunExecutor({
63
63
  * image: "my-app:latest",
64
64
  * namespace: "workflows",
65
65
  * }, k8sClient);
@@ -74,8 +74,8 @@ interface TrackedJob {
74
74
  *
75
75
  * @example Local Process
76
76
  * ```typescript
77
- * const executor = new ProcessJobExecutor({
78
- * entrypointPath: "./job-entrypoint.ts",
77
+ * const executor = new ProcessRunExecutor({
78
+ * entrypointPath: "./workflow-run.ts",
79
79
  * });
80
80
  *
81
81
  * const manager = new WorkflowRunManager({
@@ -90,7 +90,7 @@ export declare class WorkflowRunManager {
90
90
  private config;
91
91
  private status;
92
92
  private pollTimeout?;
93
- private activeJobs;
93
+ private activeExecutions;
94
94
  private stats;
95
95
  private managerId;
96
96
  constructor(config: WorkflowRunManagerConfig);
@@ -107,9 +107,9 @@ export declare class WorkflowRunManager {
107
107
  */
108
108
  getStats(): ManagerStats;
109
109
  /**
110
- * Get active jobs
110
+ * Get active executions
111
111
  */
112
- getActiveJobs(): TrackedJob[];
112
+ getActiveExecutions(): TrackedExecution[];
113
113
  /**
114
114
  * Get manager ID
115
115
  */
@@ -119,24 +119,24 @@ export declare class WorkflowRunManager {
119
119
  */
120
120
  private scheduleNextPoll;
121
121
  /**
122
- * Poll for pending workflows and manage jobs
122
+ * Poll for pending workflows and manage run executions
123
123
  */
124
124
  private poll;
125
125
  /**
126
- * Sync job statuses with executor
126
+ * Sync run execution statuses with executor
127
127
  */
128
- private syncJobStatuses;
128
+ private syncRunExecutionStatuses;
129
129
  /**
130
- * Create a job for a workflow run
130
+ * Create an isolated execution for a workflow run
131
131
  */
132
- private createJobForWorkflow;
132
+ private createExecutionForWorkflow;
133
133
  /**
134
134
  * Record an error in stats
135
135
  */
136
136
  private recordError;
137
137
  }
138
138
  /**
139
- * Create a workflow run manager backed by job executors.
139
+ * Create a workflow run manager backed by run executors.
140
140
  */
141
141
  export declare function createWorkflowRunManager(config: WorkflowRunManagerConfig): WorkflowRunManager;
142
- //# sourceMappingURL=job-manager.d.ts.map
142
+ //# sourceMappingURL=run-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-manager.d.ts","sourceRoot":"","sources":["../../../../src/src/workflow/worker/run-manager.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG9F,OAAO,KAAK,EAAsB,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAehG,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,uCAAuC;IACvC,OAAO,EAAE,eAAe,CAAC;IAEzB,uDAAuD;IACvD,QAAQ,EAAE,WAAW,CAAC;IAEtB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,wCAAwC;IACxC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;CACjB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,WAAW,CAAC,CAAwC;IAC5D,OAAO,CAAC,gBAAgB,CAAuC;IAC/D,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,wBAAwB;IAuB5C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B3B;;OAEG;IACH,QAAQ,IAAI,YAAY;IAIxB;;OAEG;IACH,mBAAmB,IAAI,gBAAgB,EAAE;IAIzC;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;OAEG;YACW,IAAI;IAyGlB;;OAEG;YACW,wBAAwB;IAuCtC;;OAEG;YACW,0BAA0B;IAoDxC;;OAEG;IACH,OAAO,CAAC,WAAW;CAIpB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,kBAAkB,CAEpB"}
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Workflow run manager
3
3
  *
4
- * Orchestrates workflow run execution via isolated jobs.
5
- * Uses pluggable JobExecutor interface for runtime flexibility.
4
+ * Orchestrates workflow run execution via isolated run executors.
5
+ * Uses pluggable RunExecutor interface for runtime flexibility.
6
6
  *
7
7
  * Supported runtimes:
8
- * - K8sJobExecutor: Kubernetes Jobs (production)
9
- * - ProcessJobExecutor: Child processes (local dev)
10
- * - DockerJobExecutor: Docker containers (future)
8
+ * - K8sRunExecutor: Kubernetes Job adapter (production)
9
+ * - ProcessRunExecutor: Child processes (local dev)
10
+ * - DockerRunExecutor: Docker containers (future)
11
11
  *
12
12
  * Key properties:
13
13
  * - Each workflow runs in isolation (no shared state)
14
- * - Supports crash recovery via stalled job detection
15
- * - Runtime-agnostic through JobExecutor abstraction
14
+ * - Supports crash recovery via stalled execution detection
15
+ * - Runtime-agnostic through RunExecutor abstraction
16
16
  */
17
17
  import * as dntShim from "../../../_dnt.shims.js";
18
18
  import { logger as baseLogger } from "../../utils/index.js";
@@ -22,19 +22,19 @@ import { ORCHESTRATION_ERROR } from "../../errors/index.js";
22
22
  const logger = baseLogger.component("workflow-run-manager");
23
23
  /** Default interval between poll cycles */
24
24
  const DEFAULT_POLL_INTERVAL_MS = 5_000;
25
- /** Default timeout for a single job (30 minutes) */
26
- const DEFAULT_JOB_TIMEOUT_MS = 30 * 60 * 1_000;
25
+ /** Default timeout for a single run execution (30 minutes) */
26
+ const DEFAULT_EXECUTION_TIMEOUT_MS = 30 * 60 * 1_000;
27
27
  /** Default threshold after which a run is considered stalled */
28
28
  const DEFAULT_STALLED_THRESHOLD_MS = 60_000;
29
29
  /**
30
30
  * Workflow run manager
31
31
  *
32
- * Orchestrates workflow execution via pluggable job executors.
32
+ * Orchestrates workflow execution via pluggable run executors.
33
33
  * Each workflow runs in complete isolation.
34
34
  *
35
35
  * @example K8s
36
36
  * ```typescript
37
- * const executor = new K8sJobExecutor({
37
+ * const executor = new K8sRunExecutor({
38
38
  * image: "my-app:latest",
39
39
  * namespace: "workflows",
40
40
  * }, k8sClient);
@@ -49,8 +49,8 @@ const DEFAULT_STALLED_THRESHOLD_MS = 60_000;
49
49
  *
50
50
  * @example Local Process
51
51
  * ```typescript
52
- * const executor = new ProcessJobExecutor({
53
- * entrypointPath: "./job-entrypoint.ts",
52
+ * const executor = new ProcessRunExecutor({
53
+ * entrypointPath: "./workflow-run.ts",
54
54
  * });
55
55
  *
56
56
  * const manager = new WorkflowRunManager({
@@ -65,15 +65,15 @@ export class WorkflowRunManager {
65
65
  config;
66
66
  status = "idle";
67
67
  pollTimeout;
68
- activeJobs = new Map();
68
+ activeExecutions = new Map();
69
69
  stats;
70
70
  managerId;
71
71
  constructor(config) {
72
72
  this.managerId = generateId("mgr");
73
73
  this.config = {
74
74
  pollInterval: DEFAULT_POLL_INTERVAL_MS,
75
- maxConcurrentJobs: 10,
76
- jobTimeout: DEFAULT_JOB_TIMEOUT_MS,
75
+ maxConcurrentExecutions: 10,
76
+ executionTimeout: DEFAULT_EXECUTION_TIMEOUT_MS,
77
77
  stalledThreshold: DEFAULT_STALLED_THRESHOLD_MS,
78
78
  debug: false,
79
79
  ...config,
@@ -82,10 +82,10 @@ export class WorkflowRunManager {
82
82
  status: "idle",
83
83
  managerId: this.managerId,
84
84
  pollCount: 0,
85
- jobsCreated: 0,
86
- jobsCompleted: 0,
87
- jobsFailed: 0,
88
- activeJobs: 0,
85
+ executionsCreated: 0,
86
+ executionsCompleted: 0,
87
+ executionsFailed: 0,
88
+ activeExecutions: 0,
89
89
  };
90
90
  }
91
91
  /**
@@ -139,13 +139,13 @@ export class WorkflowRunManager {
139
139
  * Get manager statistics
140
140
  */
141
141
  getStats() {
142
- return { ...this.stats, activeJobs: this.activeJobs.size };
142
+ return { ...this.stats, activeExecutions: this.activeExecutions.size };
143
143
  }
144
144
  /**
145
- * Get active jobs
145
+ * Get active executions
146
146
  */
147
- getActiveJobs() {
148
- return Array.from(this.activeJobs.values());
147
+ getActiveExecutions() {
148
+ return Array.from(this.activeExecutions.values());
149
149
  }
150
150
  /**
151
151
  * Get manager ID
@@ -166,7 +166,7 @@ export class WorkflowRunManager {
166
166
  }, this.config.pollInterval);
167
167
  }
168
168
  /**
169
- * Poll for pending workflows and manage jobs
169
+ * Poll for pending workflows and manage run executions
170
170
  */
171
171
  async poll() {
172
172
  if (this.status !== "running") {
@@ -175,10 +175,10 @@ export class WorkflowRunManager {
175
175
  this.stats.pollCount++;
176
176
  this.stats.lastPollAt = new Date();
177
177
  try {
178
- // 1. Check status of active jobs
179
- await this.syncJobStatuses();
178
+ // 1. Check status of active executions
179
+ await this.syncRunExecutionStatuses();
180
180
  // 2. Find workflows that need execution
181
- const availableSlots = this.config.maxConcurrentJobs - this.activeJobs.size;
181
+ const availableSlots = this.config.maxConcurrentExecutions - this.activeExecutions.size;
182
182
  if (availableSlots <= 0) {
183
183
  return;
184
184
  }
@@ -187,7 +187,7 @@ export class WorkflowRunManager {
187
187
  status: "pending",
188
188
  limit: availableSlots,
189
189
  });
190
- // Also check for stalled workflows (crashed jobs)
190
+ // Also check for stalled workflows (crashed run executions)
191
191
  let stalledRuns = [];
192
192
  if (hasWorkerSupport(this.config.backend)) {
193
193
  stalledRuns = await this.config.backend.findStalledRuns(this.config.stalledThreshold);
@@ -198,8 +198,8 @@ export class WorkflowRunManager {
198
198
  // Combine pending and stalled runs
199
199
  const runsToProcess = [...pendingRuns, ...stalledRuns].slice(0, availableSlots);
200
200
  for (const run of runsToProcess) {
201
- // Skip if already has an active job
202
- if (this.activeJobs.has(run.id)) {
201
+ // Skip if already has an active execution
202
+ if (this.activeExecutions.has(run.id)) {
203
203
  continue;
204
204
  }
205
205
  let pendingLockAcquired = false;
@@ -213,7 +213,7 @@ export class WorkflowRunManager {
213
213
  continue;
214
214
  }
215
215
  }
216
- // For pending runs, acquire a short lock to avoid duplicate job creation
216
+ // For pending runs, acquire a short lock to avoid duplicate execution creation
217
217
  // across managers between listRuns() and updateRun().
218
218
  if (run.status === "pending" && hasLockSupport(this.config.backend)) {
219
219
  pendingLockAcquired = await this.config.backend.acquireLock(run.id, this.config.stalledThreshold);
@@ -230,7 +230,7 @@ export class WorkflowRunManager {
230
230
  if (!runToProcess) {
231
231
  continue;
232
232
  }
233
- await this.createJobForWorkflow(runToProcess);
233
+ await this.createExecutionForWorkflow(runToProcess);
234
234
  }
235
235
  finally {
236
236
  if (pendingLockAcquired) {
@@ -250,81 +250,81 @@ export class WorkflowRunManager {
250
250
  }
251
251
  }
252
252
  /**
253
- * Sync job statuses with executor
253
+ * Sync run execution statuses with executor
254
254
  */
255
- async syncJobStatuses() {
255
+ async syncRunExecutionStatuses() {
256
256
  try {
257
- const jobs = await this.config.executor.listJobs(this.managerId);
258
- for (const jobInfo of jobs) {
259
- const tracked = this.activeJobs.get(jobInfo.runId);
257
+ const executions = await this.config.executor.listRunExecutions(this.managerId);
258
+ for (const executionInfo of executions) {
259
+ const tracked = this.activeExecutions.get(executionInfo.runId);
260
260
  if (!tracked) {
261
261
  continue;
262
262
  }
263
- if (jobInfo.status === tracked.status) {
263
+ if (executionInfo.status === tracked.status) {
264
264
  continue;
265
265
  }
266
- tracked.status = jobInfo.status;
266
+ tracked.status = executionInfo.status;
267
267
  // Handle terminal states
268
- if (jobInfo.status === "succeeded" || jobInfo.status === "failed") {
269
- this.activeJobs.delete(jobInfo.runId);
270
- if (jobInfo.status === "succeeded") {
271
- this.stats.jobsCompleted++;
268
+ if (executionInfo.status === "succeeded" || executionInfo.status === "failed") {
269
+ this.activeExecutions.delete(executionInfo.runId);
270
+ if (executionInfo.status === "succeeded") {
271
+ this.stats.executionsCompleted++;
272
272
  if (this.config.debug) {
273
- logger.info(`Job completed: ${jobInfo.jobId}`);
273
+ logger.info(`Run execution completed: ${executionInfo.executionId}`);
274
274
  }
275
275
  }
276
276
  else {
277
- this.stats.jobsFailed++;
278
- logger.error(`[WorkflowRunManager] Job failed: ${jobInfo.jobId}`, jobInfo.error);
277
+ this.stats.executionsFailed++;
278
+ logger.error(`[WorkflowRunManager] Run execution failed: ${executionInfo.executionId}`, executionInfo.error);
279
279
  }
280
280
  }
281
281
  }
282
282
  }
283
283
  catch (error) {
284
- logger.error(`Failed to sync job statuses:`, error);
284
+ logger.error(`Failed to sync run execution statuses:`, error);
285
285
  }
286
286
  }
287
287
  /**
288
- * Create a job for a workflow run
288
+ * Create an isolated execution for a workflow run
289
289
  */
290
- async createJobForWorkflow(run) {
291
- const jobId = generateId("job");
292
- const jobConfig = {
293
- jobId,
290
+ async createExecutionForWorkflow(run) {
291
+ const executionId = generateId("run_exec");
292
+ const executionConfig = {
293
+ executionId,
294
294
  run,
295
295
  managerId: this.managerId,
296
- timeout: this.config.jobTimeout,
296
+ timeout: this.config.executionTimeout,
297
297
  env: this.config.env ?? {},
298
298
  debug: this.config.debug,
299
299
  };
300
300
  try {
301
- await this.config.executor.createJob(jobConfig);
301
+ await this.config.executor.createRunExecution(executionConfig);
302
302
  const tracked = {
303
- jobId,
303
+ executionId,
304
304
  runId: run.id,
305
305
  status: "pending",
306
306
  createdAt: new Date(),
307
307
  };
308
- this.activeJobs.set(run.id, tracked);
309
- this.stats.jobsCreated++;
308
+ this.activeExecutions.set(run.id, tracked);
309
+ this.stats.executionsCreated++;
310
310
  // Mark workflow as running
311
311
  await this.config.backend.updateRun(run.id, {
312
312
  status: "running",
313
313
  startedAt: new Date(),
314
314
  heartbeatAt: new Date(),
315
- workerId: `job:${jobId}`,
315
+ workerId: `run-execution:${executionId}`,
316
316
  });
317
317
  if (this.config.debug) {
318
- logger.info(`Created job ${jobId} for workflow ${run.id}`);
318
+ logger.info(`Created run execution ${executionId} for workflow ${run.id}`);
319
319
  }
320
320
  }
321
321
  catch (error) {
322
- logger.error(`Failed to create job for ${run.id}:`, error);
322
+ logger.error(`Failed to create run execution for ${run.id}:`, error);
323
323
  // Mark workflow as failed
324
324
  await this.config.backend.updateRun(run.id, {
325
325
  status: "failed",
326
326
  error: {
327
- message: `JOB_CREATION_FAILED: Failed to create execution job: ${error instanceof Error ? error.message : String(error)}`,
327
+ message: `RUN_EXECUTION_CREATION_FAILED: Failed to create run execution: ${error instanceof Error ? error.message : String(error)}`,
328
328
  },
329
329
  completedAt: new Date(),
330
330
  });
@@ -339,7 +339,7 @@ export class WorkflowRunManager {
339
339
  }
340
340
  }
341
341
  /**
342
- * Create a workflow run manager backed by job executors.
342
+ * Create a workflow run manager backed by run executors.
343
343
  */
344
344
  export function createWorkflowRunManager(config) {
345
345
  return new WorkflowRunManager(config);
@@ -1,7 +1,7 @@
1
1
  import { env as getProcessEnv } from "../../platform/compat/process.js";
2
2
  import { runWithRequestContext } from "../../platform/adapters/fs/veryfront/multi-project-adapter.js";
3
3
  import { getEnv } from "../../platform/compat/process.js";
4
- import { mergeInjectedWorkflowEnv } from "../../jobs/runtime-env.js";
4
+ import { mergeInjectedWorkflowEnv } from "../../runs/runtime-env.js";
5
5
  export function getTenantFromEnv() {
6
6
  const projectSlug = getEnv("TENANT_PROJECT_SLUG");
7
7
  const token = getEnv("TENANT_TOKEN");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.623",
3
+ "version": "0.1.625",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -137,9 +137,9 @@
137
137
  "import": "./esm/src/resource/index.js",
138
138
  "types": "./esm/src/resource/index.d.ts"
139
139
  },
140
- "./jobs": {
141
- "import": "./esm/src/jobs/index.js",
142
- "types": "./esm/src/jobs/index.d.ts"
140
+ "./runs": {
141
+ "import": "./esm/src/runs/index.js",
142
+ "types": "./esm/src/runs/index.d.ts"
143
143
  },
144
144
  "./mcp": {
145
145
  "import": "./esm/src/mcp/index.js",
@@ -1,2 +0,0 @@
1
- export declare const knowledgeIngestPythonSource: string;
2
- //# sourceMappingURL=parser-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser-source.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/knowledge/parser-source.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,QAgoBvC,CAAC"}