@aivin-labs/cli 1.0.61 → 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.
- package/bin/lib/remote/desktop/castTouchViewers.mjs +3 -5
- package/bin/lib/remote/desktop/desktopCast.mjs +2 -2
- package/bin/lib/remote/desktop/desktopCastCaptureSource.mjs +2 -2
- package/bin/lib/remote/desktop/desktopCastSource.mjs +0 -10
- package/bin/lib/remote/mascot/askHostSource.mjs +16 -11
- package/bin/lib/remote/mascot/hostSource.mjs +6 -6
- package/package.json +1 -1
|
@@ -17,10 +17,8 @@ export function createCastTouchViewers() {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Bộ quay
|
|
21
|
-
* Đường JPEG: chỉ bỏ khi mọi người xem đều cảm ứng, còn người dùng chuột thì họ cần thấy con trỏ.
|
|
22
|
-
* Đường video: theo từng người xem báo tự vẽ hay chưa, để lúc đang ghi hình con trỏ vẫn nằm trong bản ghi.
|
|
20
|
+
* Bộ quay không vẽ con trỏ vào khung hình (cả JPEG lẫn video) để tránh hiện tượng 2 con trỏ không đồng bộ với chuột của người xem.
|
|
23
21
|
*/
|
|
24
|
-
export function shouldDrawCursorInFrame(
|
|
25
|
-
return
|
|
22
|
+
export function shouldDrawCursorInFrame() {
|
|
23
|
+
return false;
|
|
26
24
|
}
|
|
@@ -343,8 +343,8 @@ export function createDesktopCastManager({ dir = CAST_DIR, spawnImpl = spawn } =
|
|
|
343
343
|
config({ jpeg: on });
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
/** Con trỏ lồng vào khung hình
|
|
347
|
-
let cursorInFrame =
|
|
346
|
+
/** Con trỏ không lồng vào khung hình mặc định (tránh hiện 2 con trỏ lệch nhau trên giao diện). */
|
|
347
|
+
let cursorInFrame = false;
|
|
348
348
|
function setCursorInFrame(on) {
|
|
349
349
|
if (cursorInFrame === on) return;
|
|
350
350
|
cursorInFrame = on;
|
|
@@ -427,8 +427,8 @@ namespace AivinDesktopCast {
|
|
|
427
427
|
public static class CursorTracker {
|
|
428
428
|
const int POLL_MS = 15;
|
|
429
429
|
const int MAX_SHAPE_SIDE = 128;
|
|
430
|
-
/**
|
|
431
|
-
public static volatile bool DrawInFrame =
|
|
430
|
+
/** Không vẽ con trỏ vào khung hình (mặc định tắt để tránh hiện 2 con trỏ lệch nhịp giữa máy và trình duyệt). */
|
|
431
|
+
public static volatile bool DrawInFrame = false;
|
|
432
432
|
/** Tăng mỗi khi con trỏ đổi — vòng quay dùng để gửi khung khi con trỏ nằm trong hình. */
|
|
433
433
|
public static volatile int Seq = 0;
|
|
434
434
|
static volatile bool forceEmit = false;
|
|
@@ -238,16 +238,6 @@ namespace AivinDesktopCast {
|
|
|
238
238
|
var list = new System.Collections.Specialized.StringCollection();
|
|
239
239
|
list.Add(filePath);
|
|
240
240
|
data.SetFileDropList(list);
|
|
241
|
-
string ext = Path.GetExtension(filePath).ToLowerInvariant();
|
|
242
|
-
if (ext == ".png" || ext == ".jpg" || ext == ".jpeg" || ext == ".bmp" || ext == ".gif" || ext == ".webp") {
|
|
243
|
-
try {
|
|
244
|
-
using (var src = Image.FromFile(filePath)) {
|
|
245
|
-
var bmp = new Bitmap(src.Width, src.Height, PixelFormat.Format32bppArgb);
|
|
246
|
-
using (var g = Graphics.FromImage(bmp)) g.DrawImage(src, 0, 0, src.Width, src.Height);
|
|
247
|
-
data.SetImage(bmp);
|
|
248
|
-
}
|
|
249
|
-
} catch { }
|
|
250
|
-
}
|
|
251
241
|
return data;
|
|
252
242
|
}
|
|
253
243
|
|
|
@@ -212,10 +212,12 @@ $script:askHideTimer.Add_Tick({
|
|
|
212
212
|
$held = $script:askFocused; CloseAsk
|
|
213
213
|
if ($held -and $script:askTarget) { try { [void][AivinMascotAsk.Native]::GiveFocusBack($script:hwnd, [string]$script:askTarget.window) } catch { } }
|
|
214
214
|
})
|
|
215
|
-
# In use = keep the box out: mouse over
|
|
215
|
+
# In use = keep the box out: the mouse over THE BOX or THE BOT, talking, dragging, picking a file, or holding the keyboard with unsent
|
|
216
|
+
# text / files or a running turn. 14/11/2026: this used to be the whole window, which is a large transparent rectangle - a cursor
|
|
217
|
+
# merely resting anywhere near the bot kept the box out for ever (seen in the live run of the 5 s auto-fold).
|
|
216
218
|
# A pending question no longer counts (14/11/2026): the box slips away after ASK_PINNED_IDLE_MS and the question waits on the bot's badge.
|
|
217
219
|
function AskInUse {
|
|
218
|
-
|
|
220
|
+
(E 'Ask').IsMouseOver -or (E 'Mascot').IsMouseOver -or $script:voiceLive -or $script:drag -or $script:picking -or ($script:askFocused -and ($script:chatBusy -or $script:files -or (E 'AskBox').Text.Trim()))
|
|
219
221
|
}
|
|
220
222
|
# Aivin is waiting for an answer (HIL): the box stays out with the question + option buttons until it is answered (no focus taken).
|
|
221
223
|
$script:askPinned = $false
|
|
@@ -279,17 +281,19 @@ function SyncAction {
|
|
|
279
281
|
(E 'MicBtn').ToolTip = if ($typed) { $T.ask_send } elseif ($stop) { $T.ask_stop } else { $T.ask_mic }
|
|
280
282
|
InputLayout
|
|
281
283
|
}
|
|
282
|
-
# Input row
|
|
283
|
-
#
|
|
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.
|
|
284
286
|
function InputLayout {
|
|
285
287
|
$box = E 'AskBox'
|
|
286
|
-
|
|
287
|
-
$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
|
|
288
289
|
$wrapped = $box.Visibility -eq 'Visible' -and $box.LineCount -gt 1
|
|
289
|
-
$box.Parent.MinHeight =
|
|
290
|
-
$mid = if ($
|
|
291
|
-
$box.VerticalAlignment = $mid; (E 'AskHint').VerticalAlignment =
|
|
292
|
-
|
|
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' }
|
|
293
297
|
}
|
|
294
298
|
(E 'AskBox').Add_TextChanged({ SyncAction; AttendAsk; if ($script:askOpen) { HideAskLater ${ASK_IDLE_MS} } })
|
|
295
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.
|
|
@@ -356,7 +360,7 @@ ${ASK_BLOCKS_PS1}
|
|
|
356
360
|
function ChatRow($m) {
|
|
357
361
|
$list = E 'ChatList'; $id = [string]$m.id
|
|
358
362
|
$row = $null; if ($id) { $row = $script:chatRows[$id] }
|
|
359
|
-
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 }
|
|
360
364
|
(E 'ChatScroll').Visibility = 'Visible'
|
|
361
365
|
if (-not $row) {
|
|
362
366
|
# Segoe UI adds its own space above / below the letters: block line height + slim vertical padding so the space you see is about
|
|
@@ -472,6 +476,7 @@ function ChoiceButtons($options, $multiple) {
|
|
|
472
476
|
}
|
|
473
477
|
$panel.Visibility = if ($panel.Children.Count) { 'Visible' } else { 'Collapsed' }
|
|
474
478
|
if ($panel.Children.Count) { (E 'ChatScroll').Visibility = 'Visible'; (E 'ChatScroll').ScrollToEnd() }
|
|
479
|
+
InputLayout
|
|
475
480
|
}
|
|
476
481
|
|
|
477
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="
|
|
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="
|
|
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="
|
|
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"/>
|