@ottocode/web-sdk 0.1.250 → 0.1.251

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useSessionStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useSessionStream.ts"],"names":[],"mappings":"AAQA,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,UAAO,QA65Bd"}
1
+ {"version":3,"file":"useSessionStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useSessionStream.ts"],"names":[],"mappings":"AAQA,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,UAAO,QAm4Bd"}
package/dist/index.js CHANGED
@@ -11739,7 +11739,7 @@ var MessagePartItem = memo8(function MessagePartItem2({
11739
11739
  ]
11740
11740
  });
11741
11741
  }, (prevProps, nextProps) => {
11742
- return prevProps.part.id === nextProps.part.id && prevProps.part.content === nextProps.part.content && prevProps.part.contentJson === nextProps.part.contentJson && prevProps.part.ephemeral === nextProps.part.ephemeral && prevProps.part.completedAt === nextProps.part.completedAt && prevProps.showLine === nextProps.showLine && prevProps.isLastToolCall === nextProps.isLastToolCall && prevProps.isLastProgressUpdate === nextProps.isLastProgressUpdate && prevProps.compact === nextProps.compact && prevProps.onNavigateToSession === nextProps.onNavigateToSession && prevProps.pendingApproval?.callId === nextProps.pendingApproval?.callId && prevProps.onApprove === nextProps.onApprove && prevProps.onReject === nextProps.onReject;
11742
+ return prevProps.part.id === nextProps.part.id && prevProps.part.content === nextProps.part.content && prevProps.part.ephemeral === nextProps.part.ephemeral && prevProps.part.completedAt === nextProps.part.completedAt && prevProps.showLine === nextProps.showLine && prevProps.isLastToolCall === nextProps.isLastToolCall && prevProps.isLastProgressUpdate === nextProps.isLastProgressUpdate && prevProps.compact === nextProps.compact && prevProps.onNavigateToSession === nextProps.onNavigateToSession && prevProps.pendingApproval?.callId === nextProps.pendingApproval?.callId && prevProps.onApprove === nextProps.onApprove && prevProps.onReject === nextProps.onReject;
11743
11743
  });
11744
11744
 
11745
11745
  // src/components/messages/CompactActivityGroup.tsx
@@ -13389,7 +13389,7 @@ var AssistantMessageGroup = memo9(function AssistantMessageGroup2({
13389
13389
  for (let i = 0;i < prevParts.length; i++) {
13390
13390
  const prevPart = prevParts[i];
13391
13391
  const nextPart = nextParts[i];
13392
- if (prevPart.id !== nextPart.id || prevPart.index !== nextPart.index || prevPart.stepIndex !== nextPart.stepIndex || prevPart.type !== nextPart.type || prevPart.content !== nextPart.content || prevPart.contentJson !== nextPart.contentJson || prevPart.toolName !== nextPart.toolName || prevPart.toolCallId !== nextPart.toolCallId || prevPart.ephemeral !== nextPart.ephemeral || prevPart.completedAt !== nextPart.completedAt || prevPart.startedAt !== nextPart.startedAt) {
13392
+ if (prevPart.id !== nextPart.id || prevPart.index !== nextPart.index || prevPart.stepIndex !== nextPart.stepIndex || prevPart.type !== nextPart.type || prevPart.content !== nextPart.content || prevPart.toolName !== nextPart.toolName || prevPart.toolCallId !== nextPart.toolCallId || prevPart.ephemeral !== nextPart.ephemeral || prevPart.completedAt !== nextPart.completedAt || prevPart.startedAt !== nextPart.startedAt) {
13393
13393
  return false;
13394
13394
  }
13395
13395
  }
@@ -15283,27 +15283,18 @@ function useSessionStream(sessionId, enabled = true) {
15283
15283
  return typeof payload?.outputTextDelta === "string" ? payload.outputTextDelta : null;
15284
15284
  };
15285
15285
  const getOptimisticPartIndex = (parts, stepIndex) => {
15286
+ const appendIndex = (() => {
15287
+ const indexes = parts.map((part) => part.index).filter((index) => Number.isFinite(index));
15288
+ return indexes.length > 0 ? Math.max(...indexes) + 0.001 : 0;
15289
+ })();
15286
15290
  if (typeof stepIndex !== "number") {
15287
- return parts.length;
15291
+ return appendIndex;
15288
15292
  }
15289
15293
  const sameStepIndexes = parts.filter((part) => part.stepIndex === stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
15290
15294
  if (sameStepIndexes.length > 0) {
15291
15295
  return Math.max(...sameStepIndexes) + 0.001;
15292
15296
  }
15293
- const previousStepIndexes = parts.filter((part) => typeof part.stepIndex === "number" && part.stepIndex < stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
15294
- const nextStepIndexes = parts.filter((part) => typeof part.stepIndex === "number" && part.stepIndex > stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
15295
- const lowerBound = previousStepIndexes.length > 0 ? Math.max(...previousStepIndexes) : null;
15296
- const upperBound = nextStepIndexes.length > 0 ? Math.min(...nextStepIndexes) : null;
15297
- if (lowerBound !== null && upperBound !== null) {
15298
- return (lowerBound + upperBound) / 2;
15299
- }
15300
- if (lowerBound !== null) {
15301
- return lowerBound + 1;
15302
- }
15303
- if (upperBound !== null) {
15304
- return upperBound - 1;
15305
- }
15306
- return parts.length;
15297
+ return appendIndex;
15307
15298
  };
15308
15299
  const applyReasoningDelta = (payload) => {
15309
15300
  const messageId = typeof payload?.messageId === "string" ? payload.messageId : null;
@@ -28011,4 +28002,4 @@ export {
28011
28002
  API_BASE_URL
28012
28003
  };
28013
28004
 
28014
- //# debugId=AFB356A4FAF30FFC64756E2164756E21
28005
+ //# debugId=7BFF7991CFAF945D64756E2164756E21