@astralform/js 0.2.2 → 0.2.3

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
@@ -1092,6 +1092,40 @@ var ChatSession = class {
1092
1092
  this.todos = event.todos;
1093
1093
  this.emit({ type: "todo_update", todos: event.todos });
1094
1094
  break;
1095
+ case "context_update":
1096
+ this.emit({
1097
+ type: "context_update",
1098
+ context: event.context,
1099
+ phase: event.phase,
1100
+ updatedAt: event.updated_at
1101
+ });
1102
+ break;
1103
+ case "desktop_stream":
1104
+ this.emit({
1105
+ type: "desktop_stream",
1106
+ url: event.url,
1107
+ authKey: event.auth_key,
1108
+ sandboxId: event.sandbox_id
1109
+ });
1110
+ break;
1111
+ case "attachment_staged":
1112
+ this.emit({
1113
+ type: "attachment_staged",
1114
+ files: (event.files || []).map((f) => ({
1115
+ name: f.name,
1116
+ path: f.path,
1117
+ mediaType: f.media_type,
1118
+ sizeBytes: f.size_bytes
1119
+ }))
1120
+ });
1121
+ break;
1122
+ case "workspace_ready":
1123
+ this.emit({
1124
+ type: "workspace_ready",
1125
+ conversationId: event.conversation_id,
1126
+ sandboxId: event.sandbox_id
1127
+ });
1128
+ break;
1095
1129
  case "asset_created":
1096
1130
  this.emit({
1097
1131
  type: "asset_created",
@@ -1641,6 +1675,35 @@ var handleEditorContentEnd = (event, builder) => {
1641
1675
  }
1642
1676
  builder.activeEditorId = null;
1643
1677
  };
1678
+ var handleDesktopStream = (event, builder) => {
1679
+ const e = event;
1680
+ if (!e.url) return;
1681
+ const existing = builder.findBlock((b) => b.type === "desktop_stream");
1682
+ if (existing) {
1683
+ builder.patchBlock(existing.id, {
1684
+ url: e.url,
1685
+ authKey: e.authKey,
1686
+ sandboxId: e.sandboxId
1687
+ });
1688
+ } else {
1689
+ builder.addBlock({
1690
+ type: "desktop_stream",
1691
+ id: builder.nextId(),
1692
+ url: e.url,
1693
+ authKey: e.authKey,
1694
+ sandboxId: e.sandboxId
1695
+ });
1696
+ }
1697
+ };
1698
+ var handleAttachmentStaged = (event, builder) => {
1699
+ const e = event;
1700
+ if (!e.files || e.files.length === 0) return;
1701
+ builder.addBlock({
1702
+ type: "attachment",
1703
+ id: builder.nextId(),
1704
+ files: e.files
1705
+ });
1706
+ };
1644
1707
  var noop = () => {
1645
1708
  };
1646
1709
  var standardHandlers = {
@@ -1667,6 +1730,9 @@ var standardHandlers = {
1667
1730
  editor_content_start: handleEditorContentStart,
1668
1731
  editor_content_delta: handleEditorContentDelta,
1669
1732
  editor_content_end: handleEditorContentEnd,
1733
+ desktop_stream: handleDesktopStream,
1734
+ attachment_staged: handleAttachmentStaged,
1735
+ workspace_ready: noop,
1670
1736
  retry: noop,
1671
1737
  complete: handleComplete,
1672
1738
  error: handleError,
@@ -1705,7 +1771,11 @@ var ChatEventType = {
1705
1771
  Complete: "complete",
1706
1772
  Error: "error",
1707
1773
  Disconnected: "disconnected",
1708
- Retry: "retry"
1774
+ Retry: "retry",
1775
+ ContextUpdate: "context_update",
1776
+ DesktopStream: "desktop_stream",
1777
+ AttachmentStaged: "attachment_staged",
1778
+ WorkspaceReady: "workspace_ready"
1709
1779
  };
1710
1780
 
1711
1781
  // src/stream-manager.ts