@vertesia/workflow 0.80.0-dev.20251121 → 0.80.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/workflow",
3
- "version": "0.80.0-dev.20251121",
3
+ "version": "0.80.0",
4
4
  "type": "module",
5
5
  "description": "Vertesia workflow DSL",
6
6
  "main": "./lib/esm/index.js",
@@ -44,11 +44,11 @@
44
44
  "tmp": "^0.2.4",
45
45
  "tmp-promise": "^3.0.3",
46
46
  "yaml": "^2.6.0",
47
- "@vertesia/api-fetch-client": "0.80.0-dev.20251121",
48
- "@vertesia/memory": "0.80.0-dev.20251121",
49
- "@vertesia/common": "0.80.0-dev.20251121",
50
- "@vertesia/client": "0.80.0-dev.20251121",
51
- "@llumiverse/common": "0.23.0-dev.20251121"
47
+ "@llumiverse/common": "0.23.0",
48
+ "@vertesia/common": "0.80.0",
49
+ "@vertesia/client": "0.80.0",
50
+ "@vertesia/api-fetch-client": "0.80.0",
51
+ "@vertesia/memory": "0.80.0"
52
52
  },
53
53
  "ts_dual_module": {
54
54
  "outDir": "lib",
@@ -105,6 +105,16 @@
105
105
  "url": "https://github.com/vertesia/composableai.git",
106
106
  "directory": "packages/workflow"
107
107
  },
108
+ "keywords": [
109
+ "vertesia",
110
+ "workflow",
111
+ "dsl",
112
+ "temporalio",
113
+ "llm",
114
+ "ai",
115
+ "agents",
116
+ "typescript"
117
+ ],
108
118
  "types": "./lib/types/index.d.ts",
109
119
  "typesVersions": {
110
120
  "*": {
@@ -1,4 +1,4 @@
1
- import { CompletionResult, Modalities, ModelOptions } from "@llumiverse/common";
1
+ import { CompletionResult, ModelOptions } from "@llumiverse/common";
2
2
  import { activityInfo, log } from "@temporalio/activity";
3
3
  import { VertesiaClient } from "@vertesia/client";
4
4
  import { NodeStreamSource } from "@vertesia/client/node";
@@ -159,32 +159,37 @@ export async function executeInteraction(payload: DSLActivityExecutionPayload<Ex
159
159
  let completionResult: CompletionResult[] = res.result;
160
160
 
161
161
  // Handle image uploads if the result contains base64 images
162
- if (res.output_modality === Modalities.image) {
163
- const images = res.result.images();
162
+ const imageResults = completionResult.filter(r => r.type === "image");
163
+ if (imageResults.length > 0) {
164
164
  const uploadedImages = await Promise.all(
165
- images.map((image: string, index: number) => {
166
- // Extract base64 data and create buffer
167
- const base64Data = image.replace(/^data:image\/[a-z]+;base64,/, "");
168
- const buffer = Buffer.from(base64Data, 'base64');
169
-
170
- // Generate filename
171
- const { runId } = activityInfo().workflowExecution;
172
- const { activityId } = activityInfo();
173
- const filename = `generated-image-${runId}-${activityId}-${index}.png`;
174
-
175
- // Create a readable stream from the buffer
176
- const stream = Readable.from(buffer);
177
-
178
- const source = new NodeStreamSource(
179
- stream,
180
- filename,
181
- "image/png",
182
- );
183
-
184
- return client.files.uploadFile(source);
165
+ completionResult.map(async (item, index) => {
166
+ if (item.type === "image") {
167
+ const image = item.value;
168
+ // Extract base64 data and create buffer
169
+ const base64Data = image.replace(/^data:image\/[a-z]+;base64,/, "");
170
+ const buffer = Buffer.from(base64Data, 'base64');
171
+
172
+ // Generate filename
173
+ const { runId } = activityInfo().workflowExecution;
174
+ const { activityId } = activityInfo();
175
+ const filename = `generated-image-${runId}-${activityId}-${index}.png`;
176
+
177
+ // Create a readable stream from the buffer
178
+ const stream = Readable.from(buffer);
179
+
180
+ const source = new NodeStreamSource(
181
+ stream,
182
+ filename,
183
+ "image/png",
184
+ );
185
+
186
+ const file = await client.files.uploadFile(source);
187
+ return { type: "image", value: file } as CompletionResult;
188
+ }
189
+ return item;
185
190
  })
186
191
  );
187
- completionResult = uploadedImages.map(file => ({ type: "image", value: file }));
192
+ completionResult = uploadedImages;
188
193
  }
189
194
 
190
195
  return projectResult(payload, params, res, {
@@ -166,8 +166,6 @@ export async function setupActivity<ParamsT extends Record<string, any>>(
166
166
  }
167
167
 
168
168
  const params = vars.resolve() as ParamsT;
169
- log.info(`Activity ${payload.activity.name} setup complete`);
170
-
171
169
  return new ActivityContext<ParamsT>(payload, client, params);
172
170
  }
173
171
 
@@ -34,7 +34,6 @@ export async function saveAgentArtifact(
34
34
 
35
35
  //create the file path and append extension if needed
36
36
  const filePath = agentStoragePath(runId) + "/" + name + (ext && !name.endsWith(ext) ? "." + ext : "");
37
- log.info(`Storing agent artifact ${filePath} for run ${runId}`);
38
37
 
39
38
  try {
40
39
  const source = new NodeStreamSource(fileContent, `${runId}-${basename(filePath)}`, mimeType, filePath);