veryfront 0.1.183 → 0.1.184

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/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.183",
3
+ "version": "0.1.184",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -1 +1 @@
1
- {"version":3,"file":"ag-ui-browser-encoder.d.ts","sourceRoot":"","sources":["../../../src/src/agent/ag-ui-browser-encoder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,8BAA8B,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC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C;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAYvE;AAyID,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,uBAAuB,EAC9B,KAAK,EAAE,sBAAsB,GAC5B,uBAAuB,EAAE,CAgL3B;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,uBAAuB,EAC9B,QAAQ,EAAE,aAAa,GAAG,IAAI,GAC7B,uBAAuB,EAAE,CAmC3B"}
@@ -105,6 +105,16 @@ function completeToolInput(state, event) {
105
105
  });
106
106
  return events;
107
107
  }
108
+ function createToolResultEvent(toolCallId, result, isError = false) {
109
+ return {
110
+ event: "ToolCallResult",
111
+ payload: {
112
+ toolCallId,
113
+ result,
114
+ ...(isError ? { isError: true } : {}),
115
+ },
116
+ };
117
+ }
108
118
  export function mapRuntimeStreamEventToAgUiBrowserEvents(state, event) {
109
119
  if (event.type.startsWith("data-")) {
110
120
  const name = event.type.slice("data-".length);
@@ -227,33 +237,13 @@ export function mapRuntimeStreamEventToAgUiBrowserEvents(state, event) {
227
237
  }
228
238
  case "tool-output-available":
229
239
  state.sawVisibleOutput = true;
230
- return [{
231
- event: "ToolCallResult",
232
- payload: {
233
- toolCallId: event.toolCallId,
234
- result: event.output,
235
- },
236
- }];
240
+ return [createToolResultEvent(event.toolCallId, event.output)];
237
241
  case "tool-output-error":
238
242
  state.sawVisibleOutput = true;
239
- return [{
240
- event: "ToolCallResult",
241
- payload: {
242
- toolCallId: event.toolCallId,
243
- result: { error: event.errorText },
244
- isError: true,
245
- },
246
- }];
243
+ return [createToolResultEvent(event.toolCallId, { error: event.errorText }, true)];
247
244
  case "tool-output-denied":
248
245
  state.sawVisibleOutput = true;
249
- return [{
250
- event: "ToolCallResult",
251
- payload: {
252
- toolCallId: event.toolCallId,
253
- result: { error: "Tool output denied" },
254
- isError: true,
255
- },
256
- }];
246
+ return [createToolResultEvent(event.toolCallId, { error: "Tool output denied" }, true)];
257
247
  case "step-start":
258
248
  case "start-step":
259
249
  state.sawVisibleOutput = true;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.183";
1
+ export declare const VERSION = "0.1.184";
2
2
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.183";
3
+ export const VERSION = "0.1.184";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.183",
3
+ "version": "0.1.184",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.183",
3
+ "version": "0.1.184",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -163,6 +163,21 @@ function completeToolInput(
163
163
  return events;
164
164
  }
165
165
 
166
+ function createToolResultEvent(
167
+ toolCallId: unknown,
168
+ result: Record<string, unknown> | unknown,
169
+ isError = false,
170
+ ): AgUiBrowserEncodedEvent {
171
+ return {
172
+ event: "ToolCallResult",
173
+ payload: {
174
+ toolCallId,
175
+ result,
176
+ ...(isError ? { isError: true } : {}),
177
+ },
178
+ };
179
+ }
180
+
166
181
  export function mapRuntimeStreamEventToAgUiBrowserEvents(
167
182
  state: AgUiBrowserEncoderState,
168
183
  event: AgUiRuntimeStreamEvent,
@@ -300,35 +315,15 @@ export function mapRuntimeStreamEventToAgUiBrowserEvents(
300
315
 
301
316
  case "tool-output-available":
302
317
  state.sawVisibleOutput = true;
303
- return [{
304
- event: "ToolCallResult",
305
- payload: {
306
- toolCallId: event.toolCallId,
307
- result: event.output,
308
- },
309
- }];
318
+ return [createToolResultEvent(event.toolCallId, event.output)];
310
319
 
311
320
  case "tool-output-error":
312
321
  state.sawVisibleOutput = true;
313
- return [{
314
- event: "ToolCallResult",
315
- payload: {
316
- toolCallId: event.toolCallId,
317
- result: { error: event.errorText },
318
- isError: true,
319
- },
320
- }];
322
+ return [createToolResultEvent(event.toolCallId, { error: event.errorText }, true)];
321
323
 
322
324
  case "tool-output-denied":
323
325
  state.sawVisibleOutput = true;
324
- return [{
325
- event: "ToolCallResult",
326
- payload: {
327
- toolCallId: event.toolCallId,
328
- result: { error: "Tool output denied" },
329
- isError: true,
330
- },
331
- }];
326
+ return [createToolResultEvent(event.toolCallId, { error: "Tool output denied" }, true)];
332
327
 
333
328
  case "step-start":
334
329
  case "start-step":
@@ -1,3 +1,3 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
- export const VERSION = "0.1.183";
3
+ export const VERSION = "0.1.184";