@astralform/js 8.4.0 → 9.0.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
@@ -350,7 +350,6 @@ var ChatEventType = {
350
350
  AssetCreated: "asset_created",
351
351
  ToolApprovalRequested: "tool_approval_requested",
352
352
  ToolApprovalGranted: "tool_approval_granted",
353
- ToolPermissionDenied: "tool_permission_denied",
354
353
  ToolHarnessWarning: "tool_harness_warning",
355
354
  ToolProgress: "tool_progress",
356
355
  NestedLlmUsage: "nested_llm_usage",
@@ -404,7 +403,31 @@ function toMessage(m) {
404
403
  content: m.content,
405
404
  parentId: m.parent_id,
406
405
  status: "complete",
407
- createdAt: m.created_at
406
+ createdAt: m.created_at,
407
+ // Server-joined result typing. `?? undefined` rather than `?? null` so an
408
+ // absent field and an explicit null both read as "the server said nothing",
409
+ // which is the one distinction a renderer actually makes here.
410
+ toolCalls: m.tool_calls?.map(toToolCallRequest) ?? void 0,
411
+ sources: m.sources?.map(toToolSource) ?? void 0,
412
+ durationMs: m.duration_ms ?? void 0,
413
+ isError: m.is_error ?? void 0,
414
+ deniedBy: m.denied_by ?? void 0,
415
+ denialKind: m.denial_kind ?? void 0
416
+ };
417
+ }
418
+ function toToolSource(s) {
419
+ return { title: s.title, url: s.url, snippet: s.snippet };
420
+ }
421
+ function toToolCallRequest(t) {
422
+ return {
423
+ callId: t.call_id,
424
+ toolName: t.tool_name,
425
+ displayName: t.display_name,
426
+ description: t.description,
427
+ arguments: t.arguments ?? {},
428
+ isClientTool: t.is_client_tool ?? false,
429
+ toolCategory: t.tool_category,
430
+ iconUrl: t.icon_url
408
431
  };
409
432
  }
410
433
  var AstralformClient = class {
@@ -1554,14 +1577,6 @@ function translateCustomEvent(name, data) {
1554
1577
  toolName: data.tool_name ?? "",
1555
1578
  callId: data.call_id ?? ""
1556
1579
  };
1557
- case "tool_permission_denied":
1558
- return {
1559
- type: "tool_permission_denied",
1560
- toolName: data.tool_name ?? "",
1561
- callId: data.call_id ?? "",
1562
- reason: data.reason ?? null,
1563
- deniedBy: data.denied_by ?? null
1564
- };
1565
1580
  case "tool_harness_warning":
1566
1581
  return {
1567
1582
  type: "tool_harness_warning",