@iota-uz/sdk 0.4.21 → 0.4.22
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/README.md +4 -5
- package/dist/bichat/index.cjs +83 -178
- package/dist/bichat/index.cjs.map +1 -1
- package/dist/bichat/index.d.cts +5 -13
- package/dist/bichat/index.d.ts +5 -13
- package/dist/bichat/index.mjs +84 -179
- package/dist/bichat/index.mjs.map +1 -1
- package/dist/bichat/tailwind.cjs +0 -8
- package/dist/bichat/tailwind.cjs.map +1 -1
- package/dist/bichat/tailwind.mjs +0 -8
- package/dist/bichat/tailwind.mjs.map +1 -1
- package/package.json +2 -1
- package/tailwind/compiled.css +1 -1
- package/tailwind/create-config.cjs +50 -2
- package/tailwind/sdk-content.cjs +177 -0
package/README.md
CHANGED
|
@@ -52,8 +52,8 @@ applet rpc gen --name <applet-name>
|
|
|
52
52
|
applet rpc check --name <applet-name>
|
|
53
53
|
applet rpc watch --name <applet-name>
|
|
54
54
|
applet deps check
|
|
55
|
-
applet sdk
|
|
56
|
-
applet sdk
|
|
55
|
+
applet sdk link --sdk-root ../../applets
|
|
56
|
+
applet sdk unlink
|
|
57
57
|
applet check # deps + RPC drift for all applets
|
|
58
58
|
applet schema export --name <applet>
|
|
59
59
|
applet dev # start dev environment (all configured applets)
|
|
@@ -67,15 +67,14 @@ applet secrets delete --name <applet> --key OPENAI_API_KEY
|
|
|
67
67
|
|
|
68
68
|
- **Specific version:** `go install github.com/iota-uz/applets/cmd/applet@v0.4.4`
|
|
69
69
|
- **Shell completion:** `applet completion bash`, `applet completion zsh`, or `applet completion fish` — see `applet completion --help` for install instructions.
|
|
70
|
-
- **Local SDK
|
|
70
|
+
- **Local SDK overrides:** `applet sdk link` writes local-only settings to `.applets/local.env` (gitignored) and avoids committing link overrides into package manifests/lockfiles.
|
|
71
71
|
|
|
72
72
|
---
|
|
73
73
|
|
|
74
74
|
## DX Migration Notes (Breaking)
|
|
75
75
|
|
|
76
76
|
- `applets/` is the canonical source of `@iota-uz/sdk`; `iota-sdk/package.json` is no longer the publish source.
|
|
77
|
-
- Local SDK iteration
|
|
78
|
-
- Never commit local `pnpm` overrides/workspace links for `@iota-uz/sdk`.
|
|
77
|
+
- Local SDK iteration should use `applet sdk link --sdk-root ../../applets` and `applet sdk unlink` instead of committing `pnpm` overrides/workspace links.
|
|
79
78
|
- `applet dev` now detects `go.work` dependencies and automatically watches/restarts critical processes when dependency code changes.
|
|
80
79
|
- Keep `.applets/local.env` local-only. It is intentionally gitignored and must not be committed.
|
|
81
80
|
|
package/dist/bichat/index.cjs
CHANGED
|
@@ -1649,28 +1649,6 @@ function loadDebugMode(sessionId) {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
1651
|
|
|
1652
|
-
// ui/src/bichat/utils/reasoningEffortStorage.ts
|
|
1653
|
-
var STORAGE_KEY = "bichat.reasoningEffort";
|
|
1654
|
-
function saveReasoningEffort(effort) {
|
|
1655
|
-
if (typeof window === "undefined") {
|
|
1656
|
-
return;
|
|
1657
|
-
}
|
|
1658
|
-
try {
|
|
1659
|
-
window.sessionStorage.setItem(STORAGE_KEY, effort);
|
|
1660
|
-
} catch {
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
function loadReasoningEffort() {
|
|
1664
|
-
if (typeof window === "undefined") {
|
|
1665
|
-
return null;
|
|
1666
|
-
}
|
|
1667
|
-
try {
|
|
1668
|
-
return window.sessionStorage.getItem(STORAGE_KEY);
|
|
1669
|
-
} catch {
|
|
1670
|
-
return null;
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
1652
|
// ui/src/bichat/utils/debugTrace.ts
|
|
1675
1653
|
function hasMeaningfulUsage(trace) {
|
|
1676
1654
|
if (!trace) {
|
|
@@ -1813,16 +1791,6 @@ function readDebugLimitsFromGlobalContext() {
|
|
|
1813
1791
|
completionReserveTokens
|
|
1814
1792
|
};
|
|
1815
1793
|
}
|
|
1816
|
-
function readReasoningEffortOptionsFromGlobalContext() {
|
|
1817
|
-
if (typeof window === "undefined") {
|
|
1818
|
-
return void 0;
|
|
1819
|
-
}
|
|
1820
|
-
const opts = window.__APPLET_CONTEXT__?.extensions?.llm?.reasoningEffortOptions;
|
|
1821
|
-
if (!Array.isArray(opts) || opts.length === 0) {
|
|
1822
|
-
return void 0;
|
|
1823
|
-
}
|
|
1824
|
-
return opts.filter((o) => typeof o === "string");
|
|
1825
|
-
}
|
|
1826
1794
|
|
|
1827
1795
|
// ui/src/bichat/machine/selectors.ts
|
|
1828
1796
|
function deriveDebugMode(state) {
|
|
@@ -1839,10 +1807,8 @@ function deriveSessionSnapshot(state, methods) {
|
|
|
1839
1807
|
debugMode: deriveDebugMode(state),
|
|
1840
1808
|
sessionDebugUsage: getSessionDebugUsage(state.messaging.turns),
|
|
1841
1809
|
debugLimits: state.session.debugLimits,
|
|
1842
|
-
reasoningEffort: state.session.reasoningEffort,
|
|
1843
1810
|
setError: methods.setError,
|
|
1844
|
-
retryFetchSession: methods.retryFetchSession
|
|
1845
|
-
setReasoningEffort: methods.setReasoningEffort
|
|
1811
|
+
retryFetchSession: methods.retryFetchSession
|
|
1846
1812
|
};
|
|
1847
1813
|
}
|
|
1848
1814
|
function deriveMessagingSnapshot(state, methods) {
|
|
@@ -2063,8 +2029,7 @@ var ChatMachine = class {
|
|
|
2063
2029
|
if (this.lastSessionSnapshotVersion !== this.sessionSnapshotVersion) {
|
|
2064
2030
|
this.cachedSessionSnapshot = deriveSessionSnapshot(this.state, {
|
|
2065
2031
|
setError: this.setError,
|
|
2066
|
-
retryFetchSession: this.retryFetchSession
|
|
2067
|
-
setReasoningEffort: this.setReasoningEffort
|
|
2032
|
+
retryFetchSession: this.retryFetchSession
|
|
2068
2033
|
});
|
|
2069
2034
|
this.lastSessionSnapshotVersion = this.sessionSnapshotVersion;
|
|
2070
2035
|
}
|
|
@@ -2126,8 +2091,7 @@ var ChatMachine = class {
|
|
|
2126
2091
|
error: null,
|
|
2127
2092
|
errorRetryable: false,
|
|
2128
2093
|
debugModeBySession: {},
|
|
2129
|
-
debugLimits: readDebugLimitsFromGlobalContext()
|
|
2130
|
-
reasoningEffort: loadReasoningEffort() || void 0
|
|
2094
|
+
debugLimits: readDebugLimitsFromGlobalContext()
|
|
2131
2095
|
},
|
|
2132
2096
|
messaging: {
|
|
2133
2097
|
turns: [],
|
|
@@ -2169,7 +2133,6 @@ var ChatMachine = class {
|
|
|
2169
2133
|
this.enqueueMessage = this._enqueueMessage.bind(this);
|
|
2170
2134
|
this.removeQueueItem = this._removeQueueItem.bind(this);
|
|
2171
2135
|
this.updateQueueItem = this._updateQueueItem.bind(this);
|
|
2172
|
-
this.setReasoningEffort = this._setReasoningEffort.bind(this);
|
|
2173
2136
|
}
|
|
2174
2137
|
// =====================================================================
|
|
2175
2138
|
// Lifecycle
|
|
@@ -2290,10 +2253,6 @@ var ChatMachine = class {
|
|
|
2290
2253
|
}
|
|
2291
2254
|
});
|
|
2292
2255
|
}
|
|
2293
|
-
_setReasoningEffort(effort) {
|
|
2294
|
-
this._updateSession({ reasoningEffort: effort });
|
|
2295
|
-
saveReasoningEffort(effort);
|
|
2296
|
-
}
|
|
2297
2256
|
// =====================================================================
|
|
2298
2257
|
// Private — session fetch
|
|
2299
2258
|
// =====================================================================
|
|
@@ -2686,7 +2645,6 @@ var ChatMachine = class {
|
|
|
2686
2645
|
attachments,
|
|
2687
2646
|
debugMode,
|
|
2688
2647
|
replaceFromMessageID,
|
|
2689
|
-
reasoningEffort,
|
|
2690
2648
|
tempTurnId
|
|
2691
2649
|
} = params;
|
|
2692
2650
|
let accumulatedContent = "";
|
|
@@ -2701,8 +2659,7 @@ var ChatMachine = class {
|
|
|
2701
2659
|
this.abortController?.signal,
|
|
2702
2660
|
{
|
|
2703
2661
|
debugMode,
|
|
2704
|
-
replaceFromMessageID
|
|
2705
|
-
reasoningEffort
|
|
2662
|
+
replaceFromMessageID
|
|
2706
2663
|
}
|
|
2707
2664
|
)) {
|
|
2708
2665
|
if (this.abortController?.signal.aborted) {
|
|
@@ -2901,7 +2858,6 @@ var ChatMachine = class {
|
|
|
2901
2858
|
attachments,
|
|
2902
2859
|
debugMode: curDebugMode,
|
|
2903
2860
|
replaceFromMessageID,
|
|
2904
|
-
reasoningEffort: this.state.session.reasoningEffort,
|
|
2905
2861
|
tempTurnId: tempTurn.id
|
|
2906
2862
|
});
|
|
2907
2863
|
if (stopped) {
|
|
@@ -6975,43 +6931,6 @@ function CopyPill({ text }) {
|
|
|
6975
6931
|
}
|
|
6976
6932
|
);
|
|
6977
6933
|
}
|
|
6978
|
-
function InlineCopyButton({ text }) {
|
|
6979
|
-
const [copied, setCopied] = React.useState(false);
|
|
6980
|
-
const timerRef = React.useRef(null);
|
|
6981
|
-
React.useEffect(() => () => {
|
|
6982
|
-
if (timerRef.current !== null) {
|
|
6983
|
-
clearTimeout(timerRef.current);
|
|
6984
|
-
}
|
|
6985
|
-
}, []);
|
|
6986
|
-
const handleCopy = async (e) => {
|
|
6987
|
-
e.stopPropagation();
|
|
6988
|
-
try {
|
|
6989
|
-
await navigator.clipboard.writeText(text);
|
|
6990
|
-
setCopied(true);
|
|
6991
|
-
if (timerRef.current !== null) {
|
|
6992
|
-
clearTimeout(timerRef.current);
|
|
6993
|
-
}
|
|
6994
|
-
timerRef.current = window.setTimeout(() => {
|
|
6995
|
-
setCopied(false);
|
|
6996
|
-
timerRef.current = null;
|
|
6997
|
-
}, 2e3);
|
|
6998
|
-
} catch (err) {
|
|
6999
|
-
console.error("Copy failed:", err);
|
|
7000
|
-
}
|
|
7001
|
-
};
|
|
7002
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7003
|
-
"button",
|
|
7004
|
-
{
|
|
7005
|
-
onClick: handleCopy,
|
|
7006
|
-
"aria-label": copied ? "Copied" : "Copy",
|
|
7007
|
-
className: [
|
|
7008
|
-
"flex-shrink-0 p-1 rounded transition-colors duration-150",
|
|
7009
|
-
copied ? "text-emerald-500 dark:text-emerald-400" : "text-gray-300 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700/40"
|
|
7010
|
-
].join(" "),
|
|
7011
|
-
children: copied ? /* @__PURE__ */ jsxRuntime.jsx(react.Check, { size: 11, weight: "bold" }) : /* @__PURE__ */ jsxRuntime.jsx(react.Copy, { size: 11 })
|
|
7012
|
-
}
|
|
7013
|
-
);
|
|
7014
|
-
}
|
|
7015
6934
|
function MetricChip({ icon, value, label }) {
|
|
7016
6935
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-gray-50 dark:bg-gray-800/40 text-[11px] tabular-nums", children: [
|
|
7017
6936
|
icon,
|
|
@@ -7110,7 +7029,7 @@ function ToolCard({ tool }) {
|
|
|
7110
7029
|
}
|
|
7111
7030
|
);
|
|
7112
7031
|
}
|
|
7113
|
-
function DebugPanel({ trace }) {
|
|
7032
|
+
function DebugPanel({ trace, debugLimits = null }) {
|
|
7114
7033
|
const hasData = !!trace && hasDebugTrace(trace);
|
|
7115
7034
|
const traceID = trace?.traceId?.trim() || "";
|
|
7116
7035
|
const traceURL = trace?.traceUrl?.trim() || "";
|
|
@@ -7129,6 +7048,22 @@ function DebugPanel({ trace }) {
|
|
|
7129
7048
|
}
|
|
7130
7049
|
})();
|
|
7131
7050
|
const tokensPerSecond = calculateCompletionTokensPerSecond(trace?.usage, trace?.generationMs);
|
|
7051
|
+
const effectiveMaxTokens = debugLimits?.effectiveMaxTokens ?? 0;
|
|
7052
|
+
const promptTokens = trace?.usage?.promptTokens ?? 0;
|
|
7053
|
+
const contextUsagePercent = calculateContextUsagePercent(promptTokens, effectiveMaxTokens);
|
|
7054
|
+
const contextUsagePercentLabel = contextUsagePercent !== null ? contextUsagePercent.toFixed(1) : null;
|
|
7055
|
+
const formatCompactTokens = (value) => {
|
|
7056
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
7057
|
+
return "0 tokens";
|
|
7058
|
+
}
|
|
7059
|
+
return `${new Intl.NumberFormat("en-US", {
|
|
7060
|
+
notation: "compact",
|
|
7061
|
+
maximumFractionDigits: value >= 1e5 ? 0 : 1
|
|
7062
|
+
}).format(value)} tokens`;
|
|
7063
|
+
};
|
|
7064
|
+
const contextPercentValue = contextUsagePercent ?? 0;
|
|
7065
|
+
const contextUsageToneClass = contextPercentValue > 75 ? "bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400" : contextPercentValue > 50 ? "bg-amber-100 dark:bg-amber-900/30 text-amber-600 dark:text-amber-400" : "bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400";
|
|
7066
|
+
const contextUsageBarColor = contextPercentValue > 75 ? "#ef4444" : contextPercentValue > 50 ? "#f59e0b" : "#10b981";
|
|
7132
7067
|
const metrics = [];
|
|
7133
7068
|
if (hasData && trace) {
|
|
7134
7069
|
if (trace.generationMs !== void 0) {
|
|
@@ -7181,36 +7116,34 @@ function DebugPanel({ trace }) {
|
|
|
7181
7116
|
hasData && trace && /* @__PURE__ */ jsxRuntime.jsx(CopyPill, { text: JSON.stringify(trace, null, 2) })
|
|
7182
7117
|
] }),
|
|
7183
7118
|
hasData && trace ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
7184
|
-
(traceID ||
|
|
7185
|
-
traceID && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2
|
|
7186
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500 w-14", children: "Session" }),
|
|
7192
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 min-w-0 font-mono text-[11px] text-gray-700 dark:text-gray-300 truncate", title: trace.sessionId, children: trace.sessionId }),
|
|
7193
|
-
/* @__PURE__ */ jsxRuntime.jsx(InlineCopyButton, { text: trace.sessionId })
|
|
7119
|
+
(traceID || safeTraceURL) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-gray-200/60 dark:border-gray-700/40 bg-gray-50/50 dark:bg-gray-800/40 p-3 space-y-2", children: [
|
|
7120
|
+
traceID && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
7121
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
7122
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 dark:text-gray-400", children: "Trace ID" }),
|
|
7123
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono text-[11px] text-gray-800 dark:text-gray-200 break-all", children: traceID })
|
|
7124
|
+
] }),
|
|
7125
|
+
/* @__PURE__ */ jsxRuntime.jsx(CopyPill, { text: traceID })
|
|
7194
7126
|
] }),
|
|
7195
|
-
safeTraceURL && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
children:
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
}
|
|
7210
|
-
)
|
|
7211
|
-
] })
|
|
7127
|
+
safeTraceURL && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7128
|
+
"a",
|
|
7129
|
+
{
|
|
7130
|
+
href: safeTraceURL,
|
|
7131
|
+
target: "_blank",
|
|
7132
|
+
rel: "noopener noreferrer",
|
|
7133
|
+
"aria-label": "View full trace in Langfuse (opens in new tab)",
|
|
7134
|
+
className: "inline-flex items-center gap-1.5 text-[11px] font-medium text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",
|
|
7135
|
+
children: [
|
|
7136
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.ArrowSquareOut, { size: 12, weight: "bold" }),
|
|
7137
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Open in Langfuse" })
|
|
7138
|
+
]
|
|
7139
|
+
}
|
|
7140
|
+
)
|
|
7212
7141
|
] }),
|
|
7213
|
-
(trace.thinking || trace.observationReason) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-gray-200/60 dark:border-gray-700/40 bg-gray-50/50 dark:bg-gray-800/40 p-3 space-y-2", children: [
|
|
7142
|
+
(trace.thinking || trace.observationReason || trace.sessionId) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-gray-200/60 dark:border-gray-700/40 bg-gray-50/50 dark:bg-gray-800/40 p-3 space-y-2", children: [
|
|
7143
|
+
trace.sessionId && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 dark:text-gray-400", children: [
|
|
7144
|
+
"Session: ",
|
|
7145
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono normal-case break-all", children: trace.sessionId })
|
|
7146
|
+
] }),
|
|
7214
7147
|
trace.observationReason && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[11px] text-amber-700 dark:text-amber-300", children: [
|
|
7215
7148
|
"Observation: ",
|
|
7216
7149
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: trace.observationReason })
|
|
@@ -7250,6 +7183,30 @@ function DebugPanel({ trace }) {
|
|
|
7250
7183
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1.5 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-[10px] font-mono font-medium text-gray-500 dark:text-gray-400 tabular-nums", children: trace.tools.length })
|
|
7251
7184
|
] }),
|
|
7252
7185
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1.5", children: trace.tools.map((tool, idx) => /* @__PURE__ */ jsxRuntime.jsx(ToolCard, { tool }, `${tool.callId || tool.name}-${idx}`)) })
|
|
7186
|
+
] }),
|
|
7187
|
+
contextUsagePercentLabel !== null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-gray-200/60 dark:border-gray-700/40 bg-gray-50/50 dark:bg-gray-800/40 p-3 space-y-2", children: [
|
|
7188
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
7189
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase tracking-wider text-gray-500 dark:text-gray-400", children: "Context usage" }),
|
|
7190
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono text-[10px] text-gray-500 dark:text-gray-400 tabular-nums", children: [
|
|
7191
|
+
formatCompactTokens(promptTokens),
|
|
7192
|
+
" / ",
|
|
7193
|
+
formatCompactTokens(effectiveMaxTokens)
|
|
7194
|
+
] }),
|
|
7195
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `px-1.5 py-0.5 rounded-full text-[10px] font-semibold tabular-nums ${contextUsageToneClass}`, children: [
|
|
7196
|
+
contextUsagePercentLabel,
|
|
7197
|
+
"%"
|
|
7198
|
+
] })
|
|
7199
|
+
] }),
|
|
7200
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 rounded-full bg-gray-200/80 dark:bg-gray-700/50 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7201
|
+
"div",
|
|
7202
|
+
{
|
|
7203
|
+
className: "h-full rounded-full transition-all duration-700 ease-out",
|
|
7204
|
+
style: {
|
|
7205
|
+
width: `${Math.min(contextPercentValue, 100)}%`,
|
|
7206
|
+
backgroundColor: contextUsageBarColor
|
|
7207
|
+
}
|
|
7208
|
+
}
|
|
7209
|
+
) })
|
|
7253
7210
|
] })
|
|
7254
7211
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500 italic", children: "Debug info unavailable" })
|
|
7255
7212
|
] });
|
|
@@ -7311,7 +7268,8 @@ function AssistantMessage({
|
|
|
7311
7268
|
hideAvatar = false,
|
|
7312
7269
|
hideActions = false,
|
|
7313
7270
|
hideTimestamp = false,
|
|
7314
|
-
showDebug = false
|
|
7271
|
+
showDebug = false,
|
|
7272
|
+
debugLimits = null
|
|
7315
7273
|
}) {
|
|
7316
7274
|
const { t } = useTranslation();
|
|
7317
7275
|
const [explanationExpanded, setExplanationExpanded] = React.useState(false);
|
|
@@ -7502,7 +7460,7 @@ function AssistantMessage({
|
|
|
7502
7460
|
explanationExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-3 text-sm text-gray-600 dark:text-gray-400", children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("BiChat.Common.Loading") }), children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownRenderer2, { content: turn.explanation }) }) })
|
|
7503
7461
|
] })
|
|
7504
7462
|
) }),
|
|
7505
|
-
showDebug && /* @__PURE__ */ jsxRuntime.jsx(DebugPanel, { trace: turn.debug })
|
|
7463
|
+
showDebug && /* @__PURE__ */ jsxRuntime.jsx(DebugPanel, { trace: turn.debug, debugLimits })
|
|
7506
7464
|
] }),
|
|
7507
7465
|
turn.artifacts && turn.artifacts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.artifacts, children: renderSlot(
|
|
7508
7466
|
slots?.artifacts,
|
|
@@ -7694,7 +7652,7 @@ function AssistantTurnView({
|
|
|
7694
7652
|
hideTimestamp,
|
|
7695
7653
|
allowRegenerate = true
|
|
7696
7654
|
}) {
|
|
7697
|
-
const { debugMode } = useChatSession();
|
|
7655
|
+
const { debugMode, debugLimits } = useChatSession();
|
|
7698
7656
|
const { handleCopy, handleRegenerate, pendingQuestion, sendMessage: sendMessage2, loading } = useChatMessaging();
|
|
7699
7657
|
const assistantTurn = turn.assistantTurn;
|
|
7700
7658
|
if (!assistantTurn) {
|
|
@@ -7729,7 +7687,8 @@ function AssistantTurnView({
|
|
|
7729
7687
|
hideAvatar,
|
|
7730
7688
|
hideActions,
|
|
7731
7689
|
hideTimestamp,
|
|
7732
|
-
showDebug: debugMode
|
|
7690
|
+
showDebug: debugMode,
|
|
7691
|
+
debugLimits
|
|
7733
7692
|
}
|
|
7734
7693
|
);
|
|
7735
7694
|
}
|
|
@@ -8869,36 +8828,6 @@ function DebugStatsPanel({ debugSessionUsage, debugLimits }) {
|
|
|
8869
8828
|
] })
|
|
8870
8829
|
] });
|
|
8871
8830
|
}
|
|
8872
|
-
var EFFORT_LABEL_KEYS = {
|
|
8873
|
-
low: "BiChat.Input.ReasoningEffortLow",
|
|
8874
|
-
medium: "BiChat.Input.ReasoningEffortMedium",
|
|
8875
|
-
high: "BiChat.Input.ReasoningEffortHigh",
|
|
8876
|
-
xhigh: "BiChat.Input.ReasoningEffortXHigh"
|
|
8877
|
-
};
|
|
8878
|
-
function ReasoningEffortSelector({ options, value, onChange, disabled }) {
|
|
8879
|
-
const { t } = useTranslation();
|
|
8880
|
-
const selected = value || options[1] || options[0];
|
|
8881
|
-
const label = t("BiChat.Input.ReasoningEffort");
|
|
8882
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 self-center flex items-center gap-1.5", children: [
|
|
8883
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500 font-medium whitespace-nowrap select-none", children: label }),
|
|
8884
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8885
|
-
"select",
|
|
8886
|
-
{
|
|
8887
|
-
value: selected,
|
|
8888
|
-
disabled,
|
|
8889
|
-
onChange: (event) => onChange(event.target.value),
|
|
8890
|
-
className: [
|
|
8891
|
-
"cursor-pointer h-8 rounded-lg border border-gray-200 dark:border-gray-600",
|
|
8892
|
-
"bg-gray-50 dark:bg-gray-700/50 px-2.5 text-[11px] font-medium leading-none",
|
|
8893
|
-
"text-gray-700 dark:text-gray-200 focus:outline-none focus:ring-2 focus:ring-primary-500/25",
|
|
8894
|
-
"disabled:opacity-40 disabled:cursor-not-allowed"
|
|
8895
|
-
].join(" "),
|
|
8896
|
-
"aria-label": label,
|
|
8897
|
-
children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: t(EFFORT_LABEL_KEYS[opt] ?? opt) }, opt))
|
|
8898
|
-
}
|
|
8899
|
-
)
|
|
8900
|
-
] });
|
|
8901
|
-
}
|
|
8902
8831
|
var MAX_FILES_DEFAULT = 10;
|
|
8903
8832
|
var MAX_FILE_SIZE_DEFAULT = 20 * 1024 * 1024;
|
|
8904
8833
|
var MAX_HEIGHT = 192;
|
|
@@ -8925,10 +8854,7 @@ var MessageInput = React.forwardRef(
|
|
|
8925
8854
|
maxFiles = MAX_FILES_DEFAULT,
|
|
8926
8855
|
maxFileSize = MAX_FILE_SIZE_DEFAULT,
|
|
8927
8856
|
containerClassName,
|
|
8928
|
-
formClassName
|
|
8929
|
-
reasoningEffortOptions,
|
|
8930
|
-
reasoningEffort,
|
|
8931
|
-
onReasoningEffortChange
|
|
8857
|
+
formClassName
|
|
8932
8858
|
}, ref) => {
|
|
8933
8859
|
const { t } = useTranslation();
|
|
8934
8860
|
const [attachments, setAttachments] = React.useState([]);
|
|
@@ -9377,25 +9303,16 @@ var MessageInput = React.forwardRef(
|
|
|
9377
9303
|
"aria-label": t("BiChat.Input.MessageInput")
|
|
9378
9304
|
}
|
|
9379
9305
|
) }),
|
|
9380
|
-
reasoningEffortOptions && reasoningEffortOptions.length > 0 && onReasoningEffortChange && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9381
|
-
ReasoningEffortSelector,
|
|
9382
|
-
{
|
|
9383
|
-
options: reasoningEffortOptions,
|
|
9384
|
-
value: reasoningEffort,
|
|
9385
|
-
onChange: onReasoningEffortChange,
|
|
9386
|
-
disabled: disabled || loading
|
|
9387
|
-
}
|
|
9388
|
-
),
|
|
9389
9306
|
isStreaming && onCancelStreaming ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9390
9307
|
"button",
|
|
9391
9308
|
{
|
|
9392
9309
|
type: "button",
|
|
9393
9310
|
onClick: onCancelStreaming,
|
|
9394
9311
|
disabled: disabled || fetching,
|
|
9395
|
-
className: "cursor-pointer flex-shrink-0 self-center p-2 rounded-lg bg-
|
|
9312
|
+
className: "cursor-pointer flex-shrink-0 self-center p-2 rounded-lg bg-red-600 hover:bg-red-700 active:bg-red-800 active:scale-95 text-white shadow-sm transition-all disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-red-600",
|
|
9396
9313
|
"aria-label": t("BiChat.Common.Cancel"),
|
|
9397
9314
|
title: t("BiChat.Common.Cancel"),
|
|
9398
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(react.
|
|
9315
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 18, weight: "bold" })
|
|
9399
9316
|
}
|
|
9400
9317
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
9401
9318
|
"button",
|
|
@@ -10967,9 +10884,7 @@ function ChatSessionCore({
|
|
|
10967
10884
|
debugLimits,
|
|
10968
10885
|
currentSessionId,
|
|
10969
10886
|
setError,
|
|
10970
|
-
retryFetchSession
|
|
10971
|
-
reasoningEffort,
|
|
10972
|
-
setReasoningEffort
|
|
10887
|
+
retryFetchSession
|
|
10973
10888
|
} = useChatSession();
|
|
10974
10889
|
const {
|
|
10975
10890
|
turns,
|
|
@@ -10996,7 +10911,6 @@ function ChatSessionCore({
|
|
|
10996
10911
|
const isArchived = session?.status === "archived";
|
|
10997
10912
|
const effectiveReadOnly = Boolean(readOnly ?? isReadOnly) || isArchived;
|
|
10998
10913
|
const [restoring, setRestoring] = React.useState(false);
|
|
10999
|
-
const [reasoningEffortOptions] = React.useState(() => readReasoningEffortOptionsFromGlobalContext());
|
|
11000
10914
|
const handleRestore = React.useCallback(async () => {
|
|
11001
10915
|
if (!session?.id) {
|
|
11002
10916
|
return;
|
|
@@ -11223,10 +11137,7 @@ function ChatSessionCore({
|
|
|
11223
11137
|
onUpdateQueueItem: updateQueueItem,
|
|
11224
11138
|
onCancelStreaming: cancel,
|
|
11225
11139
|
containerClassName: "pt-6 px-6",
|
|
11226
|
-
formClassName: "mx-auto"
|
|
11227
|
-
reasoningEffortOptions,
|
|
11228
|
-
reasoningEffort,
|
|
11229
|
-
onReasoningEffortChange: setReasoningEffort
|
|
11140
|
+
formClassName: "mx-auto"
|
|
11230
11141
|
}
|
|
11231
11142
|
),
|
|
11232
11143
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 pb-1 text-center text-xs text-gray-500 dark:text-gray-400", children: t("BiChat.Welcome.Disclaimer") })
|
|
@@ -11282,10 +11193,7 @@ function ChatSessionCore({
|
|
|
11282
11193
|
onUnqueue: handleUnqueue,
|
|
11283
11194
|
onRemoveQueueItem: removeQueueItem,
|
|
11284
11195
|
onUpdateQueueItem: updateQueueItem,
|
|
11285
|
-
onCancelStreaming: cancel
|
|
11286
|
-
reasoningEffortOptions,
|
|
11287
|
-
reasoningEffort,
|
|
11288
|
-
onReasoningEffortChange: setReasoningEffort
|
|
11196
|
+
onCancelStreaming: cancel
|
|
11289
11197
|
}
|
|
11290
11198
|
)
|
|
11291
11199
|
] }) }),
|
|
@@ -17712,9 +17620,6 @@ async function* sendMessage(deps, sessionId, content, attachments = [], signal,
|
|
|
17712
17620
|
replaceFromMessageId: options?.replaceFromMessageID,
|
|
17713
17621
|
attachments: streamAttachments
|
|
17714
17622
|
};
|
|
17715
|
-
if (options?.reasoningEffort) {
|
|
17716
|
-
payload.reasoningEffort = options.reasoningEffort;
|
|
17717
|
-
}
|
|
17718
17623
|
const timeoutMs = deps.timeout ?? 0;
|
|
17719
17624
|
if (timeoutMs > 0) {
|
|
17720
17625
|
connectionTimeoutID = setTimeout(() => {
|