@ottocode/web-sdk 0.1.293 → 0.1.294
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/components/index.js +90 -47
- package/dist/components/index.js.map +4 -4
- package/dist/components/messages/AssistantMessageGroup.d.ts.map +1 -1
- package/dist/components/messages/MessagePartItem.d.ts +1 -0
- package/dist/components/messages/MessagePartItem.d.ts.map +1 -1
- package/dist/index.js +90 -47
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
package/dist/components/index.js
CHANGED
|
@@ -9967,6 +9967,7 @@ import { ArrowDown } from "lucide-react";
|
|
|
9967
9967
|
import { useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
9968
9968
|
|
|
9969
9969
|
// src/components/messages/AssistantMessageGroup.tsx
|
|
9970
|
+
import { AnimatePresence, motion as motion2 } from "motion/react";
|
|
9970
9971
|
import { memo as memo13, useState as useState32, useCallback as useCallback18, useMemo as useMemo15 } from "react";
|
|
9971
9972
|
import {
|
|
9972
9973
|
Sparkles as Sparkles4,
|
|
@@ -15750,6 +15751,7 @@ var MessagePartItem = memo12(function MessagePartItem2({
|
|
|
15750
15751
|
showLine,
|
|
15751
15752
|
isLastToolCall,
|
|
15752
15753
|
isLastProgressUpdate,
|
|
15754
|
+
isStatusLineToolCall,
|
|
15753
15755
|
onNavigateToSession,
|
|
15754
15756
|
compact,
|
|
15755
15757
|
pendingApproval,
|
|
@@ -15763,9 +15765,9 @@ var MessagePartItem = memo12(function MessagePartItem2({
|
|
|
15763
15765
|
const isCompactThread = Boolean(compact || isCompactDensity);
|
|
15764
15766
|
if (part.type === "tool_call") {
|
|
15765
15767
|
const toolName = part.toolName || "";
|
|
15766
|
-
if (toolName === "progress_update")
|
|
15768
|
+
if (toolName === "progress_update" && !isStatusLineToolCall)
|
|
15767
15769
|
return null;
|
|
15768
|
-
if (!isLastToolCall && !pendingApproval)
|
|
15770
|
+
if (!isStatusLineToolCall && !isLastToolCall && !pendingApproval)
|
|
15769
15771
|
return null;
|
|
15770
15772
|
}
|
|
15771
15773
|
if (part.type === "tool_result" && part.toolName === "progress_update" && !isLastProgressUpdate) {
|
|
@@ -16166,7 +16168,7 @@ var MessagePartItem = memo12(function MessagePartItem2({
|
|
|
16166
16168
|
]
|
|
16167
16169
|
});
|
|
16168
16170
|
}, (prevProps, nextProps) => {
|
|
16169
|
-
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;
|
|
16171
|
+
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.isStatusLineToolCall === nextProps.isStatusLineToolCall && prevProps.compact === nextProps.compact && prevProps.onNavigateToSession === nextProps.onNavigateToSession && prevProps.pendingApproval?.callId === nextProps.pendingApproval?.callId && prevProps.onApprove === nextProps.onApprove && prevProps.onReject === nextProps.onReject;
|
|
16170
16172
|
});
|
|
16171
16173
|
|
|
16172
16174
|
// src/components/messages/CompactActivityGroup.tsx
|
|
@@ -17525,6 +17527,14 @@ function getLoadingMessage(messageId) {
|
|
|
17525
17527
|
const hash = messageId.split("").reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
|
17526
17528
|
return loadingMessages[hash % loadingMessages.length];
|
|
17527
17529
|
}
|
|
17530
|
+
var STATUS_LINE_TOOL_NAMES = new Set([
|
|
17531
|
+
"progress_update",
|
|
17532
|
+
"update_status",
|
|
17533
|
+
"update_todos"
|
|
17534
|
+
]);
|
|
17535
|
+
function isStatusLineTool(toolName) {
|
|
17536
|
+
return STATUS_LINE_TOOL_NAMES.has(toolName || "");
|
|
17537
|
+
}
|
|
17528
17538
|
var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
17529
17539
|
sessionId,
|
|
17530
17540
|
message,
|
|
@@ -17594,6 +17604,9 @@ var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
|
17594
17604
|
const hasFinish = parts.some((part) => part.toolName === "finish");
|
|
17595
17605
|
const latestProgressUpdateIndex = parts.reduce((lastIndex, part, index) => part.type === "tool_result" && part.toolName === "progress_update" ? index : lastIndex, -1);
|
|
17596
17606
|
const latestProgressUpdatePart = latestProgressUpdateIndex >= 0 ? parts[latestProgressUpdateIndex] : null;
|
|
17607
|
+
const completedToolCallIds = new Set(parts.filter((part) => part.type === "tool_result" && part.toolCallId).map((part) => part.toolCallId).filter((callId) => Boolean(callId)));
|
|
17608
|
+
const latestStatusLineToolCallIndex = parts.reduce((lastIndex, part, index) => part.type === "tool_call" && isStatusLineTool(part.toolName) && (!part.toolCallId || !completedToolCallIds.has(part.toolCallId)) ? index : lastIndex, -1);
|
|
17609
|
+
const latestStatusLineToolCallPart = latestStatusLineToolCallIndex >= 0 ? parts[latestStatusLineToolCallIndex] : null;
|
|
17597
17610
|
const liveActionToolCallIds = new Set(parts.filter((part) => part.ephemeral && [
|
|
17598
17611
|
"shell",
|
|
17599
17612
|
"bash",
|
|
@@ -17656,6 +17669,10 @@ var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
|
17656
17669
|
}
|
|
17657
17670
|
continue;
|
|
17658
17671
|
}
|
|
17672
|
+
if (isStatusLineTool(part.toolName)) {
|
|
17673
|
+
flushCompactBuffer();
|
|
17674
|
+
continue;
|
|
17675
|
+
}
|
|
17659
17676
|
if (compact && isCompactActivityPart(part)) {
|
|
17660
17677
|
if (compactBuffer.length === 0) {
|
|
17661
17678
|
bufferStartIndex = index;
|
|
@@ -17670,9 +17687,10 @@ var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
|
17670
17687
|
return items;
|
|
17671
17688
|
}, [parts, compact]);
|
|
17672
17689
|
const hasVisibleNonProgressParts = renderItems.length > 0;
|
|
17673
|
-
const firstVisiblePartIndex = parts.findIndex((part) => !(part.
|
|
17674
|
-
const
|
|
17675
|
-
const
|
|
17690
|
+
const firstVisiblePartIndex = parts.findIndex((part) => !isStatusLineTool(part.toolName));
|
|
17691
|
+
const shouldShowStatusLineToolCall = message.status === "pending" && !hasFinish && Boolean(latestStatusLineToolCallPart);
|
|
17692
|
+
const shouldShowProgressUpdate = message.status === "pending" && !hasFinish && !latestStatusLineToolCallPart && Boolean(latestProgressUpdatePart);
|
|
17693
|
+
const shouldShowLoadingFallback = message.status === "pending" && !hasFinish && !latestStatusLineToolCallPart && !latestProgressUpdatePart && !isQueued;
|
|
17676
17694
|
const shouldShowErrorFallback = message.status === "error" && !hasVisibleNonProgressParts && message.error;
|
|
17677
17695
|
const formatTime = (ts) => {
|
|
17678
17696
|
if (!ts)
|
|
@@ -17701,6 +17719,12 @@ var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
|
17701
17719
|
const handleBranchClick = useCallback18(() => {
|
|
17702
17720
|
setShowBranchModal(true);
|
|
17703
17721
|
}, []);
|
|
17722
|
+
const statusLineMotion = {
|
|
17723
|
+
initial: { opacity: 0, y: 6, filter: "blur(2px)" },
|
|
17724
|
+
animate: { opacity: 1, y: 0, filter: "blur(0px)" },
|
|
17725
|
+
exit: { opacity: 0, y: -6, filter: "blur(2px)" },
|
|
17726
|
+
transition: { duration: 0.16, ease: "easeOut" }
|
|
17727
|
+
};
|
|
17704
17728
|
if (isQueued) {
|
|
17705
17729
|
return null;
|
|
17706
17730
|
}
|
|
@@ -17786,7 +17810,7 @@ var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
|
17786
17810
|
className: "relative ml-1",
|
|
17787
17811
|
children: [
|
|
17788
17812
|
renderItems.map((item, renderIndex) => {
|
|
17789
|
-
const hasFollowingContent = renderIndex < renderItems.length - 1 || hasNextAssistantMessage || shouldShowProgressUpdate || shouldShowLoadingFallback;
|
|
17813
|
+
const hasFollowingContent = renderIndex < renderItems.length - 1 || hasNextAssistantMessage || shouldShowStatusLineToolCall || shouldShowProgressUpdate || shouldShowLoadingFallback;
|
|
17790
17814
|
if (item.kind === "group") {
|
|
17791
17815
|
return /* @__PURE__ */ jsx73(CompactActivityGroup, {
|
|
17792
17816
|
entries: item.entries,
|
|
@@ -17868,43 +17892,62 @@ var AssistantMessageGroup = memo13(function AssistantMessageGroup2({
|
|
|
17868
17892
|
})
|
|
17869
17893
|
]
|
|
17870
17894
|
}),
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
|
|
17876
|
-
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17895
|
+
/* @__PURE__ */ jsx73(AnimatePresence, {
|
|
17896
|
+
mode: "wait",
|
|
17897
|
+
initial: false,
|
|
17898
|
+
children: shouldShowStatusLineToolCall && latestStatusLineToolCallPart ? /* @__PURE__ */ jsx73(motion2.div, {
|
|
17899
|
+
...statusLineMotion,
|
|
17900
|
+
children: /* @__PURE__ */ jsx73(MessagePartItem, {
|
|
17901
|
+
part: latestStatusLineToolCallPart,
|
|
17902
|
+
showLine: hasNextAssistantMessage,
|
|
17903
|
+
isFirstPart: !hasVisibleNonProgressParts && !showHeader,
|
|
17904
|
+
isLastToolCall: true,
|
|
17905
|
+
isStatusLineToolCall: true,
|
|
17906
|
+
compact
|
|
17907
|
+
})
|
|
17908
|
+
}, `status-tool-${latestStatusLineToolCallPart.id}`) : shouldShowProgressUpdate && latestProgressUpdatePart ? /* @__PURE__ */ jsx73(motion2.div, {
|
|
17909
|
+
...statusLineMotion,
|
|
17910
|
+
children: /* @__PURE__ */ jsx73(MessagePartItem, {
|
|
17911
|
+
part: latestProgressUpdatePart,
|
|
17912
|
+
showLine: hasNextAssistantMessage,
|
|
17913
|
+
isFirstPart: !hasVisibleNonProgressParts && !showHeader,
|
|
17914
|
+
isLastProgressUpdate: true,
|
|
17915
|
+
compact
|
|
17916
|
+
})
|
|
17917
|
+
}, `status-progress-${latestProgressUpdatePart.id}`) : shouldShowLoadingFallback ? /* @__PURE__ */ jsx73(motion2.div, {
|
|
17918
|
+
...statusLineMotion,
|
|
17919
|
+
children: /* @__PURE__ */ jsxs62("div", {
|
|
17920
|
+
className: `flex ${isCompactThread ? "gap-1.5" : "gap-3"} pb-2 relative max-w-full overflow-hidden`,
|
|
17887
17921
|
children: [
|
|
17922
|
+
/* @__PURE__ */ jsxs62("div", {
|
|
17923
|
+
className: `flex-shrink-0 ${isCompactThread ? "w-4" : "w-6"} flex items-center justify-center relative`,
|
|
17924
|
+
children: [
|
|
17925
|
+
/* @__PURE__ */ jsx73("div", {
|
|
17926
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full relative bg-card text-violet-700 dark:bg-background dark:text-violet-300",
|
|
17927
|
+
children: /* @__PURE__ */ jsx73(StableSpinner, {
|
|
17928
|
+
title: "Assistant is working"
|
|
17929
|
+
})
|
|
17930
|
+
}),
|
|
17931
|
+
hasNextAssistantMessage && /* @__PURE__ */ jsx73("div", {
|
|
17932
|
+
className: "absolute left-1/2 -translate-x-1/2 w-[2px] bg-border z-0",
|
|
17933
|
+
style: { top: "1.25rem", bottom: "-0.5rem" }
|
|
17934
|
+
})
|
|
17935
|
+
]
|
|
17936
|
+
}),
|
|
17888
17937
|
/* @__PURE__ */ jsx73("div", {
|
|
17889
|
-
className: "flex
|
|
17890
|
-
children: /* @__PURE__ */ jsx73(
|
|
17891
|
-
|
|
17938
|
+
className: "flex-1 min-w-0",
|
|
17939
|
+
children: /* @__PURE__ */ jsx73("div", {
|
|
17940
|
+
className: "text-base leading-5 text-foreground animate-pulse",
|
|
17941
|
+
children: getLoadingMessage(message.id)
|
|
17892
17942
|
})
|
|
17893
|
-
}),
|
|
17894
|
-
hasNextAssistantMessage && /* @__PURE__ */ jsx73("div", {
|
|
17895
|
-
className: "absolute left-1/2 -translate-x-1/2 w-[2px] bg-border z-0",
|
|
17896
|
-
style: { top: "1.25rem", bottom: "-0.5rem" }
|
|
17897
17943
|
})
|
|
17898
17944
|
]
|
|
17899
|
-
}),
|
|
17900
|
-
/* @__PURE__ */ jsx73("div", {
|
|
17901
|
-
className: "flex-1 min-w-0",
|
|
17902
|
-
children: /* @__PURE__ */ jsx73("div", {
|
|
17903
|
-
className: "text-base leading-5 text-foreground animate-pulse",
|
|
17904
|
-
children: getLoadingMessage(message.id)
|
|
17905
|
-
})
|
|
17906
17945
|
})
|
|
17907
|
-
|
|
17946
|
+
}, `status-loading-${message.id}`) : null
|
|
17947
|
+
}),
|
|
17948
|
+
shouldShowErrorFallback && /* @__PURE__ */ jsx73("div", {
|
|
17949
|
+
className: "ml-7 mb-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",
|
|
17950
|
+
children: message.error
|
|
17908
17951
|
})
|
|
17909
17952
|
]
|
|
17910
17953
|
}),
|
|
@@ -24022,7 +24065,7 @@ import {
|
|
|
24022
24065
|
useRef as useRef27,
|
|
24023
24066
|
useState as useState42
|
|
24024
24067
|
} from "react";
|
|
24025
|
-
import { AnimatePresence, motion as
|
|
24068
|
+
import { AnimatePresence as AnimatePresence2, motion as motion3 } from "motion/react";
|
|
24026
24069
|
import { Check as Check12, GitBranch as GitBranch9, Plus as Plus3, RefreshCw as RefreshCw6, Search as Search7 } from "lucide-react";
|
|
24027
24070
|
|
|
24028
24071
|
// src/components/git/GitCreateBranchModal.tsx
|
|
@@ -24355,8 +24398,8 @@ function GitBranchSwitcher({
|
|
|
24355
24398
|
})
|
|
24356
24399
|
]
|
|
24357
24400
|
}),
|
|
24358
|
-
/* @__PURE__ */ jsx94(
|
|
24359
|
-
children: isOpen && /* @__PURE__ */ jsxs81(
|
|
24401
|
+
/* @__PURE__ */ jsx94(AnimatePresence2, {
|
|
24402
|
+
children: isOpen && /* @__PURE__ */ jsxs81(motion3.div, {
|
|
24360
24403
|
ref: popoverRef,
|
|
24361
24404
|
role: "dialog",
|
|
24362
24405
|
"aria-label": "Switch branch",
|
|
@@ -24413,7 +24456,7 @@ function GitBranchSwitcher({
|
|
|
24413
24456
|
}) : filteredRows.map((row, index) => {
|
|
24414
24457
|
const isActive = index === activeIndex;
|
|
24415
24458
|
const isCurrent = row.branch.current;
|
|
24416
|
-
return /* @__PURE__ */ jsxs81(
|
|
24459
|
+
return /* @__PURE__ */ jsxs81(motion3.button, {
|
|
24417
24460
|
type: "button",
|
|
24418
24461
|
ref: (el) => {
|
|
24419
24462
|
if (el)
|
|
@@ -27548,7 +27591,7 @@ var ResearchSidebarToggle = memo35(function ResearchSidebarToggle2({
|
|
|
27548
27591
|
// src/components/settings/SettingsSidebar.tsx
|
|
27549
27592
|
import { memo as memo37, useState as useState50, useMemo as useMemo29, useCallback as useCallback35, useEffect as useEffect51, useRef as useRef33 } from "react";
|
|
27550
27593
|
import { createPortal } from "react-dom";
|
|
27551
|
-
import { AnimatePresence as
|
|
27594
|
+
import { AnimatePresence as AnimatePresence3, motion as motion4 } from "motion/react";
|
|
27552
27595
|
import {
|
|
27553
27596
|
Settings as Settings2,
|
|
27554
27597
|
ChevronRight as ChevronRight15,
|
|
@@ -28860,7 +28903,7 @@ function PreferencesModal({ isOpen, onClose }) {
|
|
|
28860
28903
|
onClick: () => setActiveTab(tab.id),
|
|
28861
28904
|
className: `relative flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${isActive ? "bg-background text-foreground" : "text-muted-foreground hover:bg-muted/60 hover:text-foreground"}`,
|
|
28862
28905
|
children: [
|
|
28863
|
-
isActive ? /* @__PURE__ */ jsx110(
|
|
28906
|
+
isActive ? /* @__PURE__ */ jsx110(motion4.span, {
|
|
28864
28907
|
layoutId: "preferences-tab-indicator",
|
|
28865
28908
|
className: "absolute inset-y-1 left-0 w-0.5 rounded-full bg-primary",
|
|
28866
28909
|
transition: { duration: 0.2, ease: "easeOut" }
|
|
@@ -28895,9 +28938,9 @@ function PreferencesModal({ isOpen, onClose }) {
|
|
|
28895
28938
|
}),
|
|
28896
28939
|
/* @__PURE__ */ jsx110("div", {
|
|
28897
28940
|
className: "min-h-0 flex-1 overflow-y-auto px-6 py-3",
|
|
28898
|
-
children: /* @__PURE__ */ jsx110(
|
|
28941
|
+
children: /* @__PURE__ */ jsx110(AnimatePresence3, {
|
|
28899
28942
|
mode: "wait",
|
|
28900
|
-
children: /* @__PURE__ */ jsx110(
|
|
28943
|
+
children: /* @__PURE__ */ jsx110(motion4.div, {
|
|
28901
28944
|
initial: { opacity: 0, y: 6 },
|
|
28902
28945
|
animate: { opacity: 1, y: 0 },
|
|
28903
28946
|
exit: { opacity: 0, y: -6 },
|
|
@@ -37763,4 +37806,4 @@ export {
|
|
|
37763
37806
|
AssistantMessageGroup
|
|
37764
37807
|
};
|
|
37765
37808
|
|
|
37766
|
-
//# debugId=
|
|
37809
|
+
//# debugId=CCE99FF69013389F64756E2164756E21
|