@steerable/agent-shell-web 0.14.2 → 0.14.3

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.
@@ -205,10 +205,18 @@ export function parseTurnBlocks(raw: unknown): TurnBlock[] | null {
205
205
  * Trailing text is the final conclusion — but only after the turn finishes.
206
206
  * While streaming, every text block stays in the process as a post-think
207
207
  * response so the next reasoning burst cannot restyle it as thinking.
208
+ *
209
+ * When a finished turn ends with terminal housekeeping tool calls (`todo_write`
210
+ * marking all items done, or `present_files`) emitted alongside the final text,
211
+ * promote that concluding text block to `answer` while keeping the housekeeping
212
+ * tools inside `process`.
208
213
  */
209
214
  export function splitTurnProcess<TTool = ExecutedAction>(
210
215
  blocks: ReadonlyArray<ProcessTimelineBlock<TTool>>,
211
- options?: { finalize?: boolean },
216
+ options?: {
217
+ finalize?: boolean;
218
+ isTrailingHousekeepingTool?: (action: TTool) => boolean;
219
+ },
212
220
  ): {
213
221
  process: ProcessTimelineBlock<TTool>[];
214
222
  answer: Extract<ProcessTimelineBlock<TTool>, { type: 'text' }>[];
@@ -218,10 +226,49 @@ export function splitTurnProcess<TTool = ExecutedAction>(
218
226
  return { process: [...blocks], answer: [] };
219
227
  }
220
228
  let split = blocks.length;
221
- while (split > 0 && blocks[split - 1].type === 'text') split -= 1;
229
+ while (split > 0 && blocks[split - 1]!.type === 'text') split -= 1;
230
+ if (split < blocks.length) {
231
+ return {
232
+ process: blocks.slice(0, split),
233
+ answer: blocks.slice(split) as Extract<ProcessTimelineBlock<TTool>, { type: 'text' }>[],
234
+ };
235
+ }
236
+
237
+ const isHousekeeping = options?.isTrailingHousekeepingTool;
238
+ if (isHousekeeping) {
239
+ let housekeepingStart = blocks.length;
240
+ while (housekeepingStart > 0) {
241
+ const candidate = blocks[housekeepingStart - 1]!;
242
+ if (
243
+ candidate.type === 'tools' &&
244
+ candidate.actions.length > 0 &&
245
+ candidate.actions.every(isHousekeeping)
246
+ ) {
247
+ housekeepingStart -= 1;
248
+ } else {
249
+ break;
250
+ }
251
+ }
252
+ if (housekeepingStart < blocks.length) {
253
+ let answerStart = housekeepingStart;
254
+ while (answerStart > 0 && blocks[answerStart - 1]!.type === 'text') {
255
+ answerStart -= 1;
256
+ }
257
+ const trailingAnswer = blocks.slice(answerStart, housekeepingStart) as Array<
258
+ Extract<ProcessTimelineBlock<TTool>, { type: 'text' }>
259
+ >;
260
+ if (trailingAnswer.some((block) => block.content.trim().length > 0)) {
261
+ return {
262
+ process: [...blocks.slice(0, answerStart), ...blocks.slice(housekeepingStart)],
263
+ answer: trailingAnswer,
264
+ };
265
+ }
266
+ }
267
+ }
268
+
222
269
  return {
223
- process: blocks.slice(0, split),
224
- answer: blocks.slice(split) as Extract<ProcessTimelineBlock<TTool>, { type: 'text' }>[],
270
+ process: [...blocks],
271
+ answer: [],
225
272
  };
226
273
  }
227
274
 
@@ -89,7 +89,7 @@ export const LlmSettingsPanel = forwardRef<LlmSettingsPanelHandle, LlmSettingsPa
89
89
  const [settings, setSettings] = useState<LlmSettings>({
90
90
  provider: 'openai-compat',
91
91
  vendorId: 'deepseek',
92
- model: 'deepseek-chat',
92
+ model: 'deepseek-flash',
93
93
  baseUrl: 'https://api.deepseek.com',
94
94
  apiKey: '',
95
95
  // temperature 缺省 = 自动(命中厂商预制用预制值,否则不下发)。
@@ -60,7 +60,7 @@ export const FALLBACK_VENDORS: CatalogProviderDescriptor[] = [
60
60
  apiBaseUrl: 'https://api.deepseek.com',
61
61
  envVars: ['DEEPSEEK_API_KEY'],
62
62
  wireKind: 'openai_compat',
63
- models: ['deepseek-chat', 'deepseek-v4-flash', 'deepseek-v4-pro'],
63
+ models: ['deepseek-flash', 'deepseek-v4-pro'],
64
64
  },
65
65
  {
66
66
  id: 'openai',
@@ -132,7 +132,7 @@ const DEMO_CATALOG_PROVIDERS: CatalogProviderDescriptor[] = [
132
132
  apiBaseUrl: 'https://api.deepseek.com/v1',
133
133
  envVars: ['DEEPSEEK_API_KEY'],
134
134
  wireKind: 'openai-compat',
135
- models: ['deepseek-chat', 'deepseek-reasoner'],
135
+ models: ['deepseek-flash', 'deepseek-v4-pro'],
136
136
  },
137
137
  {
138
138
  id: 'anthropic',
@@ -1692,7 +1692,7 @@ function AgentChatView({
1692
1692
  : undefined
1693
1693
  }
1694
1694
  inputToolbarExtras={
1695
- <div className="inline-flex items-center gap-1.5">
1695
+ <div className="inline-flex min-w-0 items-center gap-1">
1696
1696
  <ModelPicker
1697
1697
  model={modelOverride}
1698
1698
  reasoningEffort={effortOverride}
@@ -1709,7 +1709,6 @@ function AgentChatView({
1709
1709
  chatId={chatId}
1710
1710
  messageCount={effectiveMessages.length}
1711
1711
  isStreaming={effectiveIsStreaming}
1712
- livePromptTokens={currentTurnUsage?.promptTokens}
1713
1712
  liveCachedPromptTokens={currentTurnUsage?.cachedPromptTokens}
1714
1713
  onCompacted={() => onBranchTick()}
1715
1714
  />
@@ -12,6 +12,10 @@
12
12
  */
13
13
  @import "tailwindcss";
14
14
 
15
+ /* Mirror `darkMode: 'class'` from `@steerable/agent-ui/tailwind-preset` so OS dark mode
16
+ * (`prefers-color-scheme: dark`) never triggers `dark:*` utilities on the light canvas. */
17
+ @custom-variant dark (&:where(.dark, .dark *));
18
+
15
19
  @source "../**/*.{ts,tsx}";
16
20
  @source "../../node_modules/@steerable/agent-ui/dist/**/*.js";
17
21
 
@@ -72,14 +76,13 @@ body {
72
76
  .markdown-content > :last-child { margin-bottom: 0; }
73
77
 
74
78
  /*
75
- * ToolExecutionCard header: CJK status labels (已完成 / 失败 / …) wrap at
76
- * every character when the flex row is squeezed. Keep the trailing status
77
- * cluster at content width; let the truncated summary take the leftover.
79
+ * ToolExecutionCard header: CJK status labels wrap at every character when
80
+ * the flex row is squeezed. Keep the trailing status cluster at content width;
81
+ * let the truncated summary take the leftover.
78
82
  *
79
83
  * WKWebView (Tauri) lays out flex items of a <button> in the border box, so
80
- * padding-right on that button does not inset 「已完成」. Clear that padding
81
- * and inset the status with margin. The card also puts the same inset on an
82
- * inner span; these direct-child rules only match the older button markup.
84
+ * horizontal padding lives on the inner span inside ToolExecutionCard; clear
85
+ * UA inline padding on header buttons directly.
83
86
  */
84
87
  .steerable-tool-execution span.truncate {
85
88
  min-width: 0;
@@ -91,30 +94,12 @@ body {
91
94
  white-space: nowrap;
92
95
  }
93
96
 
94
- .steerable-tool-execution > div > button.flex-1 {
95
- padding-left: 0;
96
- padding-right: 0;
97
- padding-inline: 0;
98
- }
99
-
100
- .steerable-tool-execution > div > button.flex-1 > span.ml-auto {
101
- margin-inline-end: 0.625rem;
102
- }
103
-
104
- .steerable-tool-execution > div > button.flex-1.pl-2\.5 > :first-child {
105
- margin-inline-start: 0.625rem;
106
- }
107
-
108
- .steerable-tool-execution > div > button.shrink-0 {
97
+ .steerable-tool-execution > div > button {
109
98
  padding-left: 0;
110
99
  padding-right: 0;
111
100
  padding-inline: 0;
112
101
  }
113
102
 
114
- .steerable-tool-execution > div > button.shrink-0 > svg {
115
- margin-inline: 0.625rem;
116
- }
117
-
118
103
  /*
119
104
  * ChatInput overlay: the contenteditable must keep a real text fill.
120
105
  * macOS Pinyin inspects fill during the first letter's keydown — before