@ottocode/web-sdk 0.1.249 → 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.
- package/dist/components/chat/UnifiedModelSelector.d.ts.map +1 -1
- package/dist/components/index.js +13 -45
- package/dist/components/index.js.map +6 -6
- package/dist/components/messages/AssistantMessageGroup.d.ts.map +1 -1
- package/dist/components/messages/MessagePartItem.d.ts.map +1 -1
- package/dist/hooks/index.js +7 -16
- package/dist/hooks/index.js.map +3 -3
- package/dist/hooks/useSessionStream.d.ts.map +1 -1
- package/dist/index.js +13 -45
- package/dist/index.js.map +6 -6
- package/package.json +3 -3
|
@@ -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,
|
|
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
|
@@ -5172,13 +5172,6 @@ import {
|
|
|
5172
5172
|
import { ChevronDown, Search } from "lucide-react";
|
|
5173
5173
|
import Fuse2 from "fuse.js";
|
|
5174
5174
|
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5175
|
-
function formatTokenCount(tokens) {
|
|
5176
|
-
if (tokens >= 1e6)
|
|
5177
|
-
return `${(tokens / 1e6).toFixed(1)}M`;
|
|
5178
|
-
if (tokens >= 1000)
|
|
5179
|
-
return `${Math.round(tokens / 1000)}K`;
|
|
5180
|
-
return String(tokens);
|
|
5181
|
-
}
|
|
5182
5175
|
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false }, ref) {
|
|
5183
5176
|
const { data: allModels } = useAllModels();
|
|
5184
5177
|
const { data: currentProviderModels, isLoading: isCurrentProviderLoading } = useModels(provider);
|
|
@@ -5528,25 +5521,9 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5528
5521
|
className: "truncate",
|
|
5529
5522
|
children: modelItem.label
|
|
5530
5523
|
}),
|
|
5531
|
-
(!isAvailable || modelItem.toolCall || modelItem.reasoningText
|
|
5524
|
+
(!isAvailable || modelItem.toolCall || modelItem.reasoningText) && /* @__PURE__ */ jsxs10("div", {
|
|
5532
5525
|
className: "flex gap-1 ml-2 flex-shrink-0",
|
|
5533
5526
|
children: [
|
|
5534
|
-
modelItem.contextWindow && /* @__PURE__ */ jsxs10("span", {
|
|
5535
|
-
className: "text-[10px] px-1.5 py-0.5 bg-blue-600/20 text-blue-400 rounded",
|
|
5536
|
-
children: [
|
|
5537
|
-
formatTokenCount(modelItem.contextWindow),
|
|
5538
|
-
" ",
|
|
5539
|
-
"ctx"
|
|
5540
|
-
]
|
|
5541
|
-
}),
|
|
5542
|
-
modelItem.maxOutputTokens && /* @__PURE__ */ jsxs10("span", {
|
|
5543
|
-
className: "text-[10px] px-1.5 py-0.5 bg-cyan-600/20 text-cyan-400 rounded",
|
|
5544
|
-
children: [
|
|
5545
|
-
formatTokenCount(modelItem.maxOutputTokens),
|
|
5546
|
-
" ",
|
|
5547
|
-
"out"
|
|
5548
|
-
]
|
|
5549
|
-
}),
|
|
5550
5527
|
!isAvailable && /* @__PURE__ */ jsx16("span", {
|
|
5551
5528
|
className: "text-[10px] px-1.5 py-0.5 bg-red-600/20 text-red-400 rounded",
|
|
5552
5529
|
children: "Unavailable"
|
|
@@ -11762,7 +11739,7 @@ var MessagePartItem = memo8(function MessagePartItem2({
|
|
|
11762
11739
|
]
|
|
11763
11740
|
});
|
|
11764
11741
|
}, (prevProps, nextProps) => {
|
|
11765
|
-
return prevProps.part.id === nextProps.part.id && prevProps.part.content === nextProps.part.content && prevProps.part.
|
|
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;
|
|
11766
11743
|
});
|
|
11767
11744
|
|
|
11768
11745
|
// src/components/messages/CompactActivityGroup.tsx
|
|
@@ -13412,7 +13389,7 @@ var AssistantMessageGroup = memo9(function AssistantMessageGroup2({
|
|
|
13412
13389
|
for (let i = 0;i < prevParts.length; i++) {
|
|
13413
13390
|
const prevPart = prevParts[i];
|
|
13414
13391
|
const nextPart = nextParts[i];
|
|
13415
|
-
if (prevPart.id !== nextPart.id || prevPart.index !== nextPart.index || prevPart.stepIndex !== nextPart.stepIndex || prevPart.type !== nextPart.type || prevPart.content !== nextPart.content || prevPart.
|
|
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) {
|
|
13416
13393
|
return false;
|
|
13417
13394
|
}
|
|
13418
13395
|
}
|
|
@@ -15306,27 +15283,18 @@ function useSessionStream(sessionId, enabled = true) {
|
|
|
15306
15283
|
return typeof payload?.outputTextDelta === "string" ? payload.outputTextDelta : null;
|
|
15307
15284
|
};
|
|
15308
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
|
+
})();
|
|
15309
15290
|
if (typeof stepIndex !== "number") {
|
|
15310
|
-
return
|
|
15291
|
+
return appendIndex;
|
|
15311
15292
|
}
|
|
15312
15293
|
const sameStepIndexes = parts.filter((part) => part.stepIndex === stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
|
|
15313
15294
|
if (sameStepIndexes.length > 0) {
|
|
15314
15295
|
return Math.max(...sameStepIndexes) + 0.001;
|
|
15315
15296
|
}
|
|
15316
|
-
|
|
15317
|
-
const nextStepIndexes = parts.filter((part) => typeof part.stepIndex === "number" && part.stepIndex > stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
|
|
15318
|
-
const lowerBound = previousStepIndexes.length > 0 ? Math.max(...previousStepIndexes) : null;
|
|
15319
|
-
const upperBound = nextStepIndexes.length > 0 ? Math.min(...nextStepIndexes) : null;
|
|
15320
|
-
if (lowerBound !== null && upperBound !== null) {
|
|
15321
|
-
return (lowerBound + upperBound) / 2;
|
|
15322
|
-
}
|
|
15323
|
-
if (lowerBound !== null) {
|
|
15324
|
-
return lowerBound + 1;
|
|
15325
|
-
}
|
|
15326
|
-
if (upperBound !== null) {
|
|
15327
|
-
return upperBound - 1;
|
|
15328
|
-
}
|
|
15329
|
-
return parts.length;
|
|
15297
|
+
return appendIndex;
|
|
15330
15298
|
};
|
|
15331
15299
|
const applyReasoningDelta = (payload) => {
|
|
15332
15300
|
const messageId = typeof payload?.messageId === "string" ? payload.messageId : null;
|
|
@@ -25271,7 +25239,7 @@ var CUSTOM_PROVIDER_COMPATIBILITY_OPTIONS = [
|
|
|
25271
25239
|
{ value: "openrouter", label: "OpenRouter" },
|
|
25272
25240
|
{ value: "ollama", label: "Ollama" }
|
|
25273
25241
|
];
|
|
25274
|
-
function
|
|
25242
|
+
function formatTokenCount(tokens) {
|
|
25275
25243
|
if (tokens >= 1e6)
|
|
25276
25244
|
return `${(tokens / 1e6).toFixed(1)}M`;
|
|
25277
25245
|
if (tokens >= 1000)
|
|
@@ -26272,14 +26240,14 @@ var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
|
26272
26240
|
model.contextWindow && /* @__PURE__ */ jsxs91("span", {
|
|
26273
26241
|
className: "text-[10px] px-1.5 py-0.5 bg-blue-600/20 text-blue-400 rounded",
|
|
26274
26242
|
children: [
|
|
26275
|
-
|
|
26243
|
+
formatTokenCount(model.contextWindow),
|
|
26276
26244
|
" ctx"
|
|
26277
26245
|
]
|
|
26278
26246
|
}),
|
|
26279
26247
|
model.maxOutputTokens && /* @__PURE__ */ jsxs91("span", {
|
|
26280
26248
|
className: "text-[10px] px-1.5 py-0.5 bg-cyan-600/20 text-cyan-400 rounded",
|
|
26281
26249
|
children: [
|
|
26282
|
-
|
|
26250
|
+
formatTokenCount(model.maxOutputTokens),
|
|
26283
26251
|
" out"
|
|
26284
26252
|
]
|
|
26285
26253
|
}),
|
|
@@ -28034,4 +28002,4 @@ export {
|
|
|
28034
28002
|
API_BASE_URL
|
|
28035
28003
|
};
|
|
28036
28004
|
|
|
28037
|
-
//# debugId=
|
|
28005
|
+
//# debugId=7BFF7991CFAF945D64756E2164756E21
|