@astralform/js 8.4.0 → 8.5.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/dist/index.cjs CHANGED
@@ -404,7 +404,31 @@ function toMessage(m) {
404
404
  content: m.content,
405
405
  parentId: m.parent_id,
406
406
  status: "complete",
407
- createdAt: m.created_at
407
+ createdAt: m.created_at,
408
+ // Server-joined result typing. `?? undefined` rather than `?? null` so an
409
+ // absent field and an explicit null both read as "the server said nothing",
410
+ // which is the one distinction a renderer actually makes here.
411
+ toolCalls: m.tool_calls?.map(toToolCallRequest) ?? void 0,
412
+ sources: m.sources?.map(toToolSource) ?? void 0,
413
+ durationMs: m.duration_ms ?? void 0,
414
+ isError: m.is_error ?? void 0,
415
+ deniedBy: m.denied_by ?? void 0,
416
+ denialKind: m.denial_kind ?? void 0
417
+ };
418
+ }
419
+ function toToolSource(s) {
420
+ return { title: s.title, url: s.url, snippet: s.snippet };
421
+ }
422
+ function toToolCallRequest(t) {
423
+ return {
424
+ callId: t.call_id,
425
+ toolName: t.tool_name,
426
+ displayName: t.display_name,
427
+ description: t.description,
428
+ arguments: t.arguments ?? {},
429
+ isClientTool: t.is_client_tool ?? false,
430
+ toolCategory: t.tool_category,
431
+ iconUrl: t.icon_url
408
432
  };
409
433
  }
410
434
  var AstralformClient = class {