flowstack-sdk 0.2.3 → 0.2.4

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.mjs CHANGED
@@ -3003,6 +3003,11 @@ function normalizeEventType(type) {
3003
3003
  "progress": "progress",
3004
3004
  "step": "progress",
3005
3005
  // Step-based progress alias
3006
+ // Build pipeline stage markers (harness emits {type:"stage", name:"plan"|…}).
3007
+ // Without this they fell through to 'content' and were dropped, so the build
3008
+ // UI's stage bar never advanced. useAgent's `case 'stage'` maps them to the
3009
+ // running tool call's agentResponse as `[<tool>] stage: <name>`.
3010
+ "stage": "stage",
3006
3011
  // Billing
3007
3012
  "credit_status": "credit_status",
3008
3013
  "credits": "credit_status",
@@ -4016,6 +4021,39 @@ ${prompt}`;
4016
4021
  }
4017
4022
  }
4018
4023
  break;
4024
+ // ── BUILD PIPELINE STAGE MARKERS ─────────────────────────────
4025
+ // The build harness emits {type:"stage", name:"plan"|"style"|
4026
+ // "build"|"verify"|"publish"} as the app progresses. Surface each
4027
+ // as a `[<tool>] stage: <name>` line on the running build tool's
4028
+ // agentResponse so the Casino build UI's stage bar can advance.
4029
+ // Without this these events fell through to 'content' and were
4030
+ // dropped, leaving the bar stuck on "Building…".
4031
+ // (normalizeEvent maps the event's `name` field onto `tool`.)
4032
+ case "stage": {
4033
+ const stageName = event.tool || event.data?.name;
4034
+ if (stageName && currentToolCalls.length > 0) {
4035
+ let idx = -1;
4036
+ for (let i = currentToolCalls.length - 1; i >= 0; i--) {
4037
+ if (currentToolCalls[i].status === "running") {
4038
+ idx = i;
4039
+ break;
4040
+ }
4041
+ }
4042
+ if (idx >= 0) {
4043
+ const marker = `[${currentToolCalls[idx].name}] stage: ${stageName}`;
4044
+ const prev = currentToolCalls[idx].agentResponse || "";
4045
+ if (!prev.endsWith(marker)) {
4046
+ currentToolCalls[idx] = {
4047
+ ...currentToolCalls[idx],
4048
+ agentResponse: prev + (prev.length > 0 ? "\n" : "") + marker
4049
+ };
4050
+ setToolCalls([...currentToolCalls]);
4051
+ updateMessage(assistantId, { toolCalls: [...currentToolCalls] });
4052
+ }
4053
+ }
4054
+ }
4055
+ break;
4056
+ }
4019
4057
  // ── VISUALIZATIONS ─────────────────────────────────────────
4020
4058
  case "visualization":
4021
4059
  if (event.data) {