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
@@ -0,0 +1,353 @@
1
+ import * as dntShim from "../../../_dnt.shims.js";
2
+ import { basename, extname, join } from "../../../src/platform/compat/path/index.js";
3
+ import { KreuzbergDocumentExtractor } from "../../../extensions/ext-document-kreuzberg/src/index.js";
4
+ const CODE_FENCE = "`".repeat(3);
5
+ const TEXT_FILE_EXTENSIONS = new Set([
6
+ ".c",
7
+ ".cc",
8
+ ".conf",
9
+ ".cpp",
10
+ ".cs",
11
+ ".css",
12
+ ".go",
13
+ ".h",
14
+ ".hpp",
15
+ ".ini",
16
+ ".java",
17
+ ".js",
18
+ ".jsonl",
19
+ ".jsx",
20
+ ".kt",
21
+ ".less",
22
+ ".lua",
23
+ ".mjs",
24
+ ".ndjson",
25
+ ".php",
26
+ ".pl",
27
+ ".py",
28
+ ".r",
29
+ ".rb",
30
+ ".rs",
31
+ ".sass",
32
+ ".scala",
33
+ ".scss",
34
+ ".sh",
35
+ ".sql",
36
+ ".swift",
37
+ ".toml",
38
+ ".ts",
39
+ ".tsx",
40
+ ".xml",
41
+ ".yaml",
42
+ ".yml",
43
+ ".zsh",
44
+ ]);
45
+ const TEXT_FILE_NAMES = new Set([
46
+ "dockerfile",
47
+ "makefile",
48
+ "readme",
49
+ "license",
50
+ "changelog",
51
+ ]);
52
+ const MIME_BY_EXTENSION = {
53
+ ".csv": "text/csv",
54
+ ".doc": "application/msword",
55
+ ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
56
+ ".epub": "application/epub+zip",
57
+ ".htm": "text/html",
58
+ ".html": "text/html",
59
+ ".json": "application/json",
60
+ ".md": "text/markdown",
61
+ ".mdx": "text/mdx",
62
+ ".pdf": "application/pdf",
63
+ ".ppt": "application/vnd.ms-powerpoint",
64
+ ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
65
+ ".rtf": "application/rtf",
66
+ ".tsv": "text/tab-separated-values",
67
+ ".txt": "text/plain",
68
+ ".xls": "application/vnd.ms-excel",
69
+ ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
70
+ ".xml": "text/xml",
71
+ };
72
+ export function slugifyKnowledgeValue(value) {
73
+ return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") ||
74
+ "document";
75
+ }
76
+ function titleizeFilename(path) {
77
+ const name = basename(path);
78
+ const dot = name.lastIndexOf(".");
79
+ const stem = dot > 0 ? name.slice(0, dot) : name;
80
+ const title = stem.replaceAll("_", " ").replaceAll("-", " ").trim();
81
+ return title
82
+ .split(/\s+/)
83
+ .filter(Boolean)
84
+ .map((word) => `${word.slice(0, 1).toUpperCase()}${word.slice(1)}`)
85
+ .join(" ") || name;
86
+ }
87
+ function cleanText(value) {
88
+ return value.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
89
+ }
90
+ function yamlQuote(value) {
91
+ return JSON.stringify(value == null ? "" : String(value));
92
+ }
93
+ function buildFrontmatter(source, sourceType, description) {
94
+ return [
95
+ "---",
96
+ `source: ${yamlQuote(source)}`,
97
+ `source_type: ${yamlQuote(sourceType)}`,
98
+ `added: ${yamlQuote(new Date().toISOString().slice(0, 10))}`,
99
+ `description: ${yamlQuote(description)}`,
100
+ "---",
101
+ ].join("\n");
102
+ }
103
+ function tableToMarkdown(rows) {
104
+ if (!rows.length)
105
+ return "";
106
+ const maxColumns = Math.max(...rows.map((row) => row.length));
107
+ if (maxColumns === 0)
108
+ return "";
109
+ const normalized = rows.map((row) => Array.from({ length: maxColumns }, (_, index) => (row[index] ?? "").replaceAll("|", "\\|").replaceAll("\n", " ").trim()));
110
+ const [header = [], ...body] = normalized;
111
+ return [
112
+ `| ${header.join(" | ")} |`,
113
+ `| ${Array.from({ length: maxColumns }, () => "---").join(" | ")} |`,
114
+ ...body.map((row) => `| ${row.join(" | ")} |`),
115
+ ].join("\n");
116
+ }
117
+ function parseCsvLine(line) {
118
+ const values = [];
119
+ let current = "";
120
+ let inQuotes = false;
121
+ for (let index = 0; index < line.length; index += 1) {
122
+ const char = line[index];
123
+ if (char === '"') {
124
+ if (inQuotes && line[index + 1] === '"') {
125
+ current += '"';
126
+ index += 1;
127
+ }
128
+ else {
129
+ inQuotes = !inQuotes;
130
+ }
131
+ }
132
+ else if (char === "," && !inQuotes) {
133
+ values.push(current.trim());
134
+ current = "";
135
+ }
136
+ else {
137
+ current += char;
138
+ }
139
+ }
140
+ values.push(current.trim());
141
+ return values;
142
+ }
143
+ async function parseCsvLike(path, delimiter) {
144
+ const raw = await dntShim.Deno.readTextFile(path);
145
+ const lines = raw.split("\n").filter((line) => line.trim());
146
+ if (!lines.length) {
147
+ return { content: "_Empty file._", stats: { rows: 0, columns: 0 }, warnings: [] };
148
+ }
149
+ const parseLine = delimiter === ","
150
+ ? parseCsvLine
151
+ : (line) => line.split("\t").map((value) => value.trim());
152
+ const header = parseLine(lines[0] ?? "");
153
+ const data = lines.slice(1).map(parseLine);
154
+ const limitedRows = [header, ...data.slice(0, 200)];
155
+ const warnings = data.length > 200
156
+ ? [`Truncated ${data.length - 200} rows from markdown output`]
157
+ : [];
158
+ const parts = [
159
+ `**Rows:** ${data.length} | **Columns:** ${header.length}`,
160
+ "",
161
+ tableToMarkdown(limitedRows),
162
+ ];
163
+ if (data.length > 200) {
164
+ parts.push(`\n_...and ${data.length - 200} more rows (truncated)._`);
165
+ }
166
+ return {
167
+ content: parts.join("\n").trim(),
168
+ stats: { rows: data.length, columns: header.length },
169
+ warnings,
170
+ };
171
+ }
172
+ async function parseText(path) {
173
+ const content = cleanText(await dntShim.Deno.readTextFile(path));
174
+ return {
175
+ content,
176
+ stats: { characters: content.length, lines: content ? content.split("\n").length : 0 },
177
+ warnings: [],
178
+ };
179
+ }
180
+ async function parseJson(path) {
181
+ const raw = await dntShim.Deno.readTextFile(path);
182
+ const data = JSON.parse(raw);
183
+ if (Array.isArray(data) && data.length > 0 && data[0] != null && typeof data[0] === "object" &&
184
+ !Array.isArray(data[0])) {
185
+ const first = data[0];
186
+ const headers = Object.keys(first);
187
+ const rows = data.slice(0, 200).map((entry) => {
188
+ const record = entry != null && typeof entry === "object" && !Array.isArray(entry)
189
+ ? entry
190
+ : {};
191
+ return headers.map((header) => String(record[header] ?? ""));
192
+ });
193
+ const warnings = data.length > 200
194
+ ? [`Truncated ${data.length - 200} records from markdown output`]
195
+ : [];
196
+ const parts = [
197
+ `**Records:** ${data.length} | **Fields:** ${headers.length}`,
198
+ "",
199
+ tableToMarkdown([headers, ...rows]),
200
+ ];
201
+ if (data.length > 200) {
202
+ parts.push(`\n_...and ${data.length - 200} more records (truncated)._`);
203
+ }
204
+ return {
205
+ content: parts.join("\n").trim(),
206
+ stats: { records: data.length, fields: headers.length },
207
+ warnings,
208
+ };
209
+ }
210
+ const rendered = JSON.stringify(data, null, 2);
211
+ return {
212
+ content: `${CODE_FENCE}json\n${rendered}\n${CODE_FENCE}`,
213
+ stats: { top_level_type: Array.isArray(data) ? "list" : typeof data },
214
+ warnings: [],
215
+ };
216
+ }
217
+ async function parseWithKreuzberg(path, deps) {
218
+ const mimeType = MIME_BY_EXTENSION[extname(path).toLowerCase()] ?? "application/octet-stream";
219
+ const content = cleanText(await deps.extractDocumentText({ filePath: path, mimeType }));
220
+ return {
221
+ content: content || "_No extractable text found in document._",
222
+ stats: {
223
+ characters: content.length,
224
+ lines: content ? content.split("\n").length : 0,
225
+ engine: "kreuzberg",
226
+ },
227
+ warnings: [],
228
+ };
229
+ }
230
+ function selectParserDefinition(path) {
231
+ const extension = extname(path).toLowerCase();
232
+ const name = basename(path).toLowerCase();
233
+ if (extension === ".csv" || extension === ".tsv") {
234
+ const delimiter = extension === ".tsv" ? "\t" : ",";
235
+ return {
236
+ sourceType: extension.slice(1),
237
+ parse: (filePath) => parseCsvLike(filePath, delimiter),
238
+ };
239
+ }
240
+ if (extension === ".txt" || extension === ".md" || extension === ".mdx") {
241
+ return { sourceType: extension.slice(1), parse: parseText };
242
+ }
243
+ if (extension === ".json") {
244
+ return { sourceType: "json", parse: parseJson };
245
+ }
246
+ if (TEXT_FILE_EXTENSIONS.has(extension)) {
247
+ return { sourceType: extension.slice(1), parse: parseText };
248
+ }
249
+ if (!extension && TEXT_FILE_NAMES.has(name)) {
250
+ return { sourceType: "text", parse: parseText };
251
+ }
252
+ if (extension in MIME_BY_EXTENSION) {
253
+ return {
254
+ sourceType: extension.slice(1),
255
+ parse: (filePath, deps) => parseWithKreuzberg(filePath, deps),
256
+ };
257
+ }
258
+ throw new Error(`Unsupported file type: ${extension || name}`);
259
+ }
260
+ function buildSummary(sourceType, stats) {
261
+ if (stats.engine === "kreuzberg") {
262
+ return `Extracted ${sourceType.toUpperCase()} text with Kreuzberg (${stats.characters ?? 0} chars).`;
263
+ }
264
+ if (sourceType === "csv" || sourceType === "tsv") {
265
+ return `Parsed ${stats.rows ?? 0} rows across ${stats.columns ?? 0} columns.`;
266
+ }
267
+ if (sourceType === "json") {
268
+ if ("records" in stats) {
269
+ return `Parsed ${stats.records ?? 0} record(s) across ${stats.fields ?? 0} fields.`;
270
+ }
271
+ return `Converted JSON (${stats.top_level_type ?? "object"}) to markdown.`;
272
+ }
273
+ return `Converted document to markdown (${stats.characters ?? 0} chars).`;
274
+ }
275
+ async function defaultExtractDocumentText(input) {
276
+ const bytes = await dntShim.Deno.readFile(input.filePath);
277
+ const extractor = new KreuzbergDocumentExtractor();
278
+ return await extractor.extractInWorker(bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength), input.mimeType);
279
+ }
280
+ export async function runKnowledgeParser(input, deps = {}) {
281
+ const [result] = await runKnowledgeParsers({
282
+ files: [{
283
+ filePath: input.filePath,
284
+ description: input.description,
285
+ slug: input.slug,
286
+ sourceReference: input.sourceReference,
287
+ }],
288
+ outputDir: input.outputDir,
289
+ }, deps);
290
+ if (!result) {
291
+ throw new Error("knowledge ingest parser returned no results");
292
+ }
293
+ return result;
294
+ }
295
+ export async function runKnowledgeParsers(input, deps = {}) {
296
+ if (!input.files.length) {
297
+ return [];
298
+ }
299
+ const parserDeps = {
300
+ extractDocumentText: deps.extractDocumentText ?? defaultExtractDocumentText,
301
+ };
302
+ await dntShim.Deno.mkdir(input.outputDir, { recursive: true });
303
+ const results = [];
304
+ for (const file of input.files) {
305
+ try {
306
+ const stat = await dntShim.Deno.stat(file.filePath);
307
+ if (!stat.isFile) {
308
+ throw new Error(`File not found: ${file.filePath}`);
309
+ }
310
+ const definition = selectParserDefinition(file.filePath);
311
+ const parsed = await definition.parse(file.filePath, parserDeps);
312
+ const content = cleanText(parsed.content);
313
+ const fileName = basename(file.filePath);
314
+ const extension = extname(fileName);
315
+ const stem = extension ? fileName.slice(0, -extension.length) : fileName;
316
+ const slug = file.slug ?? slugifyKnowledgeValue(stem);
317
+ const description = file.description ?? `Parsed from ${basename(file.filePath)}`;
318
+ const title = titleizeFilename(file.filePath);
319
+ const outputPath = join(input.outputDir, `${slug}.md`);
320
+ const markdown = [
321
+ buildFrontmatter(file.sourceReference ?? basename(file.filePath), definition.sourceType, description),
322
+ "",
323
+ `# ${title}`,
324
+ "",
325
+ content,
326
+ "",
327
+ ].join("\n");
328
+ await dntShim.Deno.writeTextFile(outputPath, markdown);
329
+ results.push({
330
+ success: true,
331
+ source_path: file.filePath,
332
+ source_filename: basename(file.filePath),
333
+ source_type: definition.sourceType,
334
+ slug,
335
+ sandbox_output_path: outputPath,
336
+ suggested_project_path: `knowledge/${slug}.md`,
337
+ description,
338
+ title,
339
+ summary: buildSummary(definition.sourceType, parsed.stats),
340
+ stats: parsed.stats,
341
+ warnings: parsed.warnings,
342
+ });
343
+ }
344
+ catch (error) {
345
+ if (error instanceof Error && error.message.startsWith("knowledge ingest parser failed")) {
346
+ throw error;
347
+ }
348
+ const message = error instanceof Error ? error.message : String(error);
349
+ throw new Error(`knowledge ingest parser failed: ${message}`);
350
+ }
351
+ }
352
+ return results;
353
+ }
@@ -34,7 +34,7 @@ export interface KnowledgeIngestResultMetadata {
34
34
  source_mode: "explicit_sources" | "path_prefix";
35
35
  knowledge_path: string;
36
36
  }
37
- export interface KnowledgeIngestJobResult {
37
+ export interface KnowledgeIngestRunResult {
38
38
  kind: "knowledge_ingest";
39
39
  version: 1;
40
40
  metadata: KnowledgeIngestResultMetadata;
@@ -43,12 +43,12 @@ export interface KnowledgeIngestJobResult {
43
43
  skipped: KnowledgeIngestSkippedFileResult[];
44
44
  failed: KnowledgeIngestFailedFileResult[];
45
45
  }
46
- export declare function buildKnowledgeIngestJobResult(input: {
46
+ export declare function buildKnowledgeIngestRunResult(input: {
47
47
  requestedCount: number;
48
48
  sourceMode: KnowledgeIngestResultMetadata["source_mode"];
49
49
  knowledgePath: string;
50
50
  ingested: KnowledgeIngestFileResult[];
51
51
  skipped?: KnowledgeIngestSkippedFileResult[];
52
52
  failed?: KnowledgeIngestFailedFileResult[];
53
- }): KnowledgeIngestJobResult;
53
+ }): KnowledgeIngestRunResult;
54
54
  //# sourceMappingURL=result.d.ts.map
@@ -1,4 +1,4 @@
1
- export function buildKnowledgeIngestJobResult(input) {
1
+ export function buildKnowledgeIngestRunResult(input) {
2
2
  const skipped = input.skipped ?? [];
3
3
  const failed = input.failed ?? [];
4
4
  return {
@@ -4,7 +4,7 @@ import { getConfig } from "../../../src/config/index.js";
4
4
  import { enhanceAdapterWithFS, getEnv, isExtendedFSAdapter, runtime, } from "../../../src/platform/index.js";
5
5
  import { buildPreparedCSSArtifactFromFiles, createStyleScopeProfile, resolveStyleContentVersion, } from "../../../src/rendering/styles.js";
6
6
  import { cliLogger, exitProcess } from "../../utils/index.js";
7
- import { writeJobResultIfConfigured } from "../../utils/write-job-result.js";
7
+ import { writeRunResultIfConfigured } from "../../utils/write-run-result.js";
8
8
  const getStyleArtifactBuildConfigSchema = defineSchema((v) => v.object({
9
9
  style_profile_hash: v.string().min(1).optional(),
10
10
  branch: v.string().min(1).optional(),
@@ -194,7 +194,7 @@ export async function stylesCommand(options) {
194
194
  value: selector.value,
195
195
  },
196
196
  };
197
- await writeJobResultIfConfigured(result);
197
+ await writeRunResultIfConfigured(result);
198
198
  cliLogger.info(`Built style artifact ${build.hash}`);
199
199
  }
200
200
  catch (error) {
@@ -8,8 +8,8 @@ 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";
12
- import { writeJobResultIfConfigured } from "../../utils/write-job-result.js";
11
+ import { sanitizeRunOutputForLogging } from "../../utils/sanitize-run-output.js";
12
+ import { writeRunResultIfConfigured } from "../../utils/write-run-result.js";
13
13
  export async function taskCommand(options) {
14
14
  const { discoverTasks } = await import("../../../src/task/discovery.js");
15
15
  const { runTask } = await import("../../../src/task/runner.js");
@@ -77,8 +77,8 @@ export async function taskCommand(options) {
77
77
  if (result.success) {
78
78
  cliLogger.info(`Task completed in ${result.durationMs}ms`);
79
79
  if (result.result !== undefined) {
80
- await writeJobResultIfConfigured(result.result);
81
- cliLogger.info(`Result: ${JSON.stringify(sanitizeJobOutputForLogging(result.result), null, 2)}`);
80
+ await writeRunResultIfConfigured(result.result);
81
+ cliLogger.info(`Result: ${JSON.stringify(sanitizeRunOutputForLogging(result.result), null, 2)}`);
82
82
  }
83
83
  return;
84
84
  }
@@ -11,7 +11,7 @@ export const workerHelp = {
11
11
  },
12
12
  {
13
13
  flag: "-c, --concurrency <number>",
14
- description: "Maximum concurrent jobs",
14
+ description: "Maximum concurrent runs",
15
15
  default: "3",
16
16
  },
17
17
  {
@@ -26,13 +26,13 @@ export const workerHelp = {
26
26
  },
27
27
  {
28
28
  flag: "-e, --executor <type>",
29
- description: "Job executor type (process | k8s)",
29
+ description: "Run executor type (process | k8s)",
30
30
  default: "process",
31
31
  },
32
32
  {
33
33
  flag: "--entrypoint <path>",
34
34
  description: "Path to workflow run entrypoint script",
35
- default: "./workflow-job.ts",
35
+ default: "./workflow-run.ts",
36
36
  },
37
37
  {
38
38
  flag: "--debug",
@@ -42,6 +42,6 @@ export const workerHelp = {
42
42
  examples: [
43
43
  "veryfront worker",
44
44
  "veryfront worker --redis-url redis://prod:6379 --concurrency 5",
45
- "veryfront worker --entrypoint ./src/jobs/workflow-runner.ts --debug",
45
+ "veryfront worker --entrypoint ./src/runs/workflow-runner.ts --debug",
46
46
  ],
47
47
  };
@@ -2,7 +2,7 @@
2
2
  * Worker command - Start workflow run worker
3
3
  *
4
4
  * Polls Redis for pending/stalled workflow runs and executes them
5
- * as isolated processes. Supports multi-tenant execution: each job
5
+ * as isolated processes. Supports multi-tenant execution: each run
6
6
  * runs with its own tenant context captured at workflow creation time.
7
7
  */
8
8
  import type { WorkerArgs } from "./handler.js";
@@ -2,15 +2,15 @@
2
2
  * Worker command - Start workflow run worker
3
3
  *
4
4
  * Polls Redis for pending/stalled workflow runs and executes them
5
- * as isolated processes. Supports multi-tenant execution: each job
5
+ * as isolated processes. Supports multi-tenant execution: each run
6
6
  * runs with its own tenant context captured at workflow creation time.
7
7
  */
8
8
  import { cliLogger } from "../../utils/index.js";
9
9
  import { exitProcess, registerTerminationSignals, showLogo } from "../../utils/index.js";
10
10
  export async function workerCommand(options) {
11
11
  showLogo();
12
- const { WorkflowRunManager } = await import("../../../src/workflow/worker/job-manager.js");
13
- const { ProcessJobExecutor } = await import("../../../src/workflow/worker/executors/process.js");
12
+ const { WorkflowRunManager } = await import("../../../src/workflow/worker/run-manager.js");
13
+ const { ProcessRunExecutor } = await import("../../../src/workflow/worker/executors/process.js");
14
14
  const { RedisBackend } = await import("../../../src/workflow/backends/redis.js");
15
15
  cliLogger.info("Starting workflow worker...");
16
16
  cliLogger.info(` Redis: ${options.redisUrl}`);
@@ -25,18 +25,18 @@ export async function workerCommand(options) {
25
25
  if (backend.initialize) {
26
26
  await backend.initialize();
27
27
  }
28
- // Create job executor
28
+ // Create run executor
29
29
  // The entrypoint script runs inside each spawned process.
30
30
  // It reads WORKFLOW_RUN_ID + TENANT_* env vars, discovers workflows
31
31
  // from the user's project, and executes the matching one.
32
- const entrypointPath = options.entrypoint ?? "./workflow-job.ts";
32
+ const entrypointPath = options.entrypoint ?? "./workflow-run.ts";
33
33
  if (options.executor === "k8s") {
34
34
  cliLogger.error("K8s executor requires custom configuration. Use --executor process for local dev, " +
35
- "or configure K8sJobExecutor programmatically for production.");
35
+ "or configure K8sRunExecutor programmatically for production.");
36
36
  exitProcess(1);
37
37
  return;
38
38
  }
39
- const executor = new ProcessJobExecutor({
39
+ const executor = new ProcessRunExecutor({
40
40
  entrypointPath,
41
41
  env: {
42
42
  REDIS_URL: options.redisUrl,
@@ -48,7 +48,7 @@ export async function workerCommand(options) {
48
48
  backend,
49
49
  executor,
50
50
  pollInterval: options.pollInterval,
51
- maxConcurrentJobs: options.concurrency,
51
+ maxConcurrentExecutions: options.concurrency,
52
52
  stalledThreshold: options.stalledThreshold,
53
53
  debug: options.debug,
54
54
  });
@@ -67,7 +67,7 @@ export async function workerCommand(options) {
67
67
  await backend.destroy();
68
68
  const stats = manager.getStats();
69
69
  cliLogger.info("Worker stopped.");
70
- cliLogger.info(` Jobs: ${stats.jobsCreated} created, ${stats.jobsCompleted} completed, ${stats.jobsFailed} failed`);
70
+ cliLogger.info(` Runs: ${stats.executionsCreated} created, ${stats.executionsCompleted} completed, ${stats.executionsFailed} failed`);
71
71
  }
72
72
  catch (error) {
73
73
  cliLogger.warn("Error during shutdown:", error);
@@ -2,8 +2,8 @@ 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";
6
- import { writeJobResultIfConfigured } from "../../utils/write-job-result.js";
5
+ import { sanitizeRunOutputForLogging } from "../../utils/sanitize-run-output.js";
6
+ import { writeRunResultIfConfigured } from "../../utils/write-run-result.js";
7
7
  import { getEnv } from "../../../src/platform/index.js";
8
8
  const WORKFLOW_STATUS_POLL_INTERVAL_MS = 1_000;
9
9
  const MAX_DISCOVERY_ERRORS_TO_PRINT = 5;
@@ -38,8 +38,8 @@ async function waitForWorkflowExit(client, runId) {
38
38
  if (run.status === "completed") {
39
39
  cliLogger.info(`Workflow completed: ${runId}`);
40
40
  if (run.output !== undefined) {
41
- await writeJobResultIfConfigured(run.output);
42
- cliLogger.info(`Result: ${JSON.stringify(sanitizeJobOutputForLogging(run.output), null, 2)}`);
41
+ await writeRunResultIfConfigured(run.output);
42
+ cliLogger.info(`Result: ${JSON.stringify(sanitizeRunOutputForLogging(run.output), null, 2)}`);
43
43
  }
44
44
  return;
45
45
  }
@@ -0,0 +1,2 @@
1
+ export declare function sanitizeRunOutputForLogging(value: unknown): unknown;
2
+ //# sourceMappingURL=sanitize-run-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-run-output.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/sanitize-run-output.ts"],"names":[],"mappings":"AAoBA,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEnE"}
@@ -14,6 +14,6 @@ function sanitizeValue(value) {
14
14
  }
15
15
  return sanitized;
16
16
  }
17
- export function sanitizeJobOutputForLogging(value) {
17
+ export function sanitizeRunOutputForLogging(value) {
18
18
  return sanitizeValue(value);
19
19
  }
@@ -0,0 +1,2 @@
1
+ export declare function writeRunResultIfConfigured(value: unknown): Promise<void>;
2
+ //# sourceMappingURL=write-run-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-run-result.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/write-run-result.ts"],"names":[],"mappings":"AAWA,wBAAsB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAW9E"}
@@ -0,0 +1,16 @@
1
+ import * as dntShim from "../../_dnt.shims.js";
2
+ import { dirname } from "../../src/platform/compat/path/index.js";
3
+ import { sanitizeRunOutputForLogging } from "./sanitize-run-output.js";
4
+ const RUN_RESULT_PATH_ENV = "VERYFRONT_RUN_RESULT_PATH";
5
+ function getRunResultPath() {
6
+ const value = dntShim.Deno.env.get(RUN_RESULT_PATH_ENV)?.trim();
7
+ return value ? value : null;
8
+ }
9
+ export async function writeRunResultIfConfigured(value) {
10
+ const resultPath = getRunResultPath();
11
+ if (!resultPath) {
12
+ return;
13
+ }
14
+ await dntShim.Deno.mkdir(dirname(resultPath), { recursive: true });
15
+ await dntShim.Deno.writeTextFile(resultPath, JSON.stringify(sanitizeRunOutputForLogging(value), null, 2));
16
+ }
package/esm/deno.d.ts CHANGED
@@ -34,7 +34,7 @@ declare namespace _default {
34
34
  "./schemas": string;
35
35
  "./prompt": string;
36
36
  "./resource": string;
37
- "./jobs": string;
37
+ "./runs": string;
38
38
  "./mcp": string;
39
39
  "./middleware": string;
40
40
  "./observability": string;
@@ -94,7 +94,7 @@ declare namespace _default {
94
94
  "veryfront/components/chat": string;
95
95
  "veryfront/sandbox": string;
96
96
  "veryfront/embedding": string;
97
- "veryfront/jobs": string;
97
+ "veryfront/runs": string;
98
98
  "veryfront/agent/identity": string;
99
99
  "veryfront/agent/react": string;
100
100
  "veryfront/agent/testing": string;
@@ -179,7 +179,8 @@ declare namespace _default {
179
179
  "#veryfront/react": string;
180
180
  "#veryfront/rendering": string;
181
181
  "#veryfront/resource": string;
182
- "#veryfront/jobs": string;
182
+ "#veryfront/runs": string;
183
+ "#veryfront/runs/": string;
183
184
  "#veryfront/routing": string;
184
185
  "#veryfront/security": string;
185
186
  "#veryfront/skill": string;