@aivin-labs/cli 1.0.62 → 1.0.63

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.
@@ -281,17 +281,19 @@ function SyncAction {
281
281
  (E 'MicBtn').ToolTip = if ($typed) { $T.ask_send } elseif ($stop) { $T.ask_stop } else { $T.ask_mic }
282
282
  InputLayout
283
283
  }
284
- # Input row height: two lines for a fresh question; once a conversation is above it (or while talking), one line with the hint and the mic
285
- # button centred on the same line - the box only grows (mic back at the bottom) when the typed text wraps.
284
+ # Input row layout: one line with attachment button, input field, and mic/send button centered on the same line.
285
+ # Grows vertically only when the typed text wraps. Close 'x' button only shows when a chat conversation is active.
286
286
  function InputLayout {
287
287
  $box = E 'AskBox'
288
- # Box hidden = the voice bar is in its place (VoiceLook hides it before the voice state is set).
289
- $compact = $box.Visibility -ne 'Visible' -or [bool]$script:voiceLive -or (E 'ChatList').Children.Count -gt 0
288
+ $hasChat = (E 'ChatList').Children.Count -gt 0 -or (E 'Choices').Children.Count -gt 0
290
289
  $wrapped = $box.Visibility -eq 'Visible' -and $box.LineCount -gt 1
291
- $box.Parent.MinHeight = if ($compact) { 26 } else { 40 }
292
- $mid = if ($compact -and -not $wrapped) { 'Center' } else { 'Top' }
293
- $box.VerticalAlignment = $mid; (E 'AskHint').VerticalAlignment = $mid
294
- (E 'MicBtn').VerticalAlignment = if ($compact -and -not $wrapped) { 'Center' } else { 'Bottom' }
290
+ $box.Parent.MinHeight = 26
291
+ $mid = if ($wrapped) { 'Top' } else { 'Center' }
292
+ $box.VerticalAlignment = $mid; (E 'AskHint').VerticalAlignment = 'Center'
293
+ $btnAlign = if ($wrapped) { 'Bottom' } else { 'Center' }
294
+ (E 'MicBtn').VerticalAlignment = $btnAlign
295
+ (E 'AttachBtn').VerticalAlignment = $btnAlign
296
+ (E 'AskClose').Visibility = if ($hasChat) { 'Visible' } else { 'Collapsed' }
295
297
  }
296
298
  (E 'AskBox').Add_TextChanged({ SyncAction; AttendAsk; if ($script:askOpen) { HideAskLater ${ASK_IDLE_MS} } })
297
299
  # Typing: the bot looks at the box (above or below it) while keys come in; a little nod when a question / answer goes out.
@@ -358,7 +360,7 @@ ${ASK_BLOCKS_PS1}
358
360
  function ChatRow($m) {
359
361
  $list = E 'ChatList'; $id = [string]$m.id
360
362
  $row = $null; if ($id) { $row = $script:chatRows[$id] }
361
- if ($m.remove) { if ($row) { ChatLinks $row $null; ChatBlocks $row $null; [void]$list.Children.Remove($row.box); $script:chatRows.Remove($id) }; return }
363
+ if ($m.remove) { if ($row) { ChatLinks $row $null; ChatBlocks $row $null; [void]$list.Children.Remove($row.box); $script:chatRows.Remove($id) }; InputLayout; return }
362
364
  (E 'ChatScroll').Visibility = 'Visible'
363
365
  if (-not $row) {
364
366
  # Segoe UI adds its own space above / below the letters: block line height + slim vertical padding so the space you see is about
@@ -474,6 +476,7 @@ function ChoiceButtons($options, $multiple) {
474
476
  }
475
477
  $panel.Visibility = if ($panel.Children.Count) { 'Visible' } else { 'Collapsed' }
476
478
  if ($panel.Children.Count) { (E 'ChatScroll').Visibility = 'Visible'; (E 'ChatScroll').ScrollToEnd() }
479
+ InputLayout
477
480
  }
478
481
 
479
482
  # Attached files: one chip each above the input - the file type's icon + colour (fileChips.mjs), its name (full path in the tooltip),
@@ -270,7 +270,7 @@ ${[0, 1, 2].map((i) => ` <Border x:Name="NotifyStep${i}" Tag="${i}" Backgro
270
270
  <!-- Tệp thả vào bot, chờ đi kèm câu kế tiếp: chip icon + màu theo loại tệp, nút x để bỏ (askHostSource.mjs dựng theo ask_files). -->
271
271
  <WrapPanel x:Name="AttachBar" Visibility="Collapsed" Margin="-4,0,0,5"/>
272
272
  <DockPanel>
273
- <Button x:Name="MicBtn" DockPanel.Dock="Right" Style="{StaticResource IconBtn}" Width="26" Height="26" Margin="6,0,0,0" VerticalAlignment="Bottom"
273
+ <Button x:Name="MicBtn" DockPanel.Dock="Right" Style="{StaticResource IconBtn}" Width="26" Height="26" Margin="6,0,0,0" VerticalAlignment="Center"
274
274
  Background="${ASK_BTN.bg}" BorderThickness="0" Tag="#14000000">
275
275
  <Grid>
276
276
  <Path x:Name="MicIcon" Data="${ICON_MIC}" Stroke="${ASK_BTN.icon}" StrokeThickness="1.8" StrokeStartLineCap="Round" StrokeEndLineCap="Round"
@@ -281,21 +281,21 @@ ${[0, 1, 2].map((i) => ` <Border x:Name="NotifyStep${i}" Tag="${i}" Backgro
281
281
  </Grid>
282
282
  </Button>
283
283
  <!-- Chon tep tren may ngay trong o hoi (hop chon tep cua he dieu hanh) - cung duong voi keo tha tep vao bot. -->
284
- <Button x:Name="AttachBtn" DockPanel.Dock="Left" Style="{StaticResource IconBtn}" Width="24" Height="24" Margin="-4,0,4,0" VerticalAlignment="Bottom"
284
+ <Button x:Name="AttachBtn" DockPanel.Dock="Left" Style="{StaticResource IconBtn}" Width="24" Height="24" Margin="-4,0,4,0" VerticalAlignment="Center"
285
285
  Background="Transparent" BorderThickness="0" Tag="#F2F3F5">
286
286
  <Path Data="${ICON_CLIP}" Stroke="#A9AEB8" StrokeThickness="1.7" StrokeStartLineCap="Round" StrokeEndLineCap="Round"
287
287
  Width="13" Height="13" Stretch="Uniform"/>
288
288
  </Button>
289
- <Grid MinHeight="40">
289
+ <Grid MinHeight="26">
290
290
  <TextBox x:Name="AskBox" BorderThickness="0" Background="Transparent" FontSize="14" Foreground="${B.ink}" TextWrapping="Wrap"
291
- MaxHeight="60" VerticalScrollBarVisibility="Hidden" CaretBrush="#8B7CF6" MaxLength="2000" Padding="0,1,0,1"/>
292
- <TextBlock x:Name="AskHint" IsHitTestVisible="False" FontSize="14" Foreground="#A9AEB8" Margin="2,1,0,0" TextTrimming="CharacterEllipsis"/>
291
+ MaxHeight="60" VerticalScrollBarVisibility="Hidden" CaretBrush="#8B7CF6" MaxLength="2000" Padding="0,1,0,1" VerticalAlignment="Center"/>
292
+ <TextBlock x:Name="AskHint" IsHitTestVisible="False" FontSize="14" Foreground="#A9AEB8" Margin="2,1,0,0" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"/>
293
293
  </Grid>
294
294
  </DockPanel>
295
295
  <TextBlock x:Name="AskStatus" Visibility="Collapsed" FontSize="13" Foreground="${B.muted}" Margin="0,2,4,1" TextTrimming="CharacterEllipsis"/>
296
296
  </StackPanel>
297
297
  <!-- Dau x mo o goc phai tren: cat o hoi di ngay, ke ca khi Aivin dang cho tra loi (cau hoi van con, mo lai bang cach re vao bot). -->
298
- <Button x:Name="AskClose" Style="{StaticResource IconBtn}" Width="18" Height="18" Padding="0" Margin="0,3,3,0" Opacity="0.3"
298
+ <Button x:Name="AskClose" Visibility="Collapsed" Style="{StaticResource IconBtn}" Width="18" Height="18" Padding="0" Margin="0,3,3,0" Opacity="0.3"
299
299
  HorizontalAlignment="Right" VerticalAlignment="Top" Background="#E8FFFFFF" BorderThickness="0" Tag="#F2F3F5">
300
300
  <Path Data="${ICON_CLOSE_X}" Stroke="${B.muted}" StrokeThickness="1.5" StrokeStartLineCap="Round" StrokeEndLineCap="Round"
301
301
  Width="9" Height="9" Stretch="Uniform"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aivin-labs/cli",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "aivin CLI - scaffold, run, and deploy Aivin plugins built on @aivin-labs/sdk",
5
5
  "type": "module",
6
6
  "bin": {