@aivin-labs/cli 1.0.8 → 1.0.13

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.
Files changed (63) hide show
  1. package/README.md +41 -0
  2. package/bin/assets/aivin-mascot.png +0 -0
  3. package/bin/cli.mjs +1979 -1780
  4. package/bin/lib/browserAutomation.mjs +232 -469
  5. package/bin/lib/localBrowser.mjs +345 -0
  6. package/bin/lib/remote/activityLog.mjs +1 -1
  7. package/bin/lib/remote/autoStart.mjs +174 -14
  8. package/bin/lib/remote/browserTunnel.mjs +187 -37
  9. package/bin/lib/remote/callLedger.mjs +74 -15
  10. package/bin/lib/remote/cdpPolicy.mjs +14 -1
  11. package/bin/lib/remote/client.mjs +174 -11
  12. package/bin/lib/remote/clipboard.mjs +138 -0
  13. package/bin/lib/remote/cloudFiles.mjs +53 -0
  14. package/bin/lib/remote/codingAgents.mjs +293 -0
  15. package/bin/lib/remote/constants.mjs +78 -0
  16. package/bin/lib/remote/dailyBrowser.mjs +9 -3
  17. package/bin/lib/remote/desktop/desktopCast.mjs +198 -0
  18. package/bin/lib/remote/desktop/desktopCastSource.mjs +514 -0
  19. package/bin/lib/remote/desktop/desktopWebRtc.mjs +95 -0
  20. package/bin/lib/remote/desktop/index.mjs +309 -0
  21. package/bin/lib/remote/desktop/linux.mjs +144 -0
  22. package/bin/lib/remote/desktop/linuxTraySource.mjs +434 -0
  23. package/bin/lib/remote/desktop/mac.mjs +187 -0
  24. package/bin/lib/remote/desktop/macTraySource.mjs +295 -0
  25. package/bin/lib/remote/desktop/strings.mjs +74 -0
  26. package/bin/lib/remote/desktop/traySource.mjs +541 -0
  27. package/bin/lib/remote/deviceProfile.mjs +1 -0
  28. package/bin/lib/remote/docText.mjs +86 -1
  29. package/bin/lib/remote/fileIndexer.mjs +757 -399
  30. package/bin/lib/remote/folderRules.mjs +140 -0
  31. package/bin/lib/remote/gui/index.mjs +208 -18
  32. package/bin/lib/remote/gui/windowsHost.mjs +9 -2
  33. package/bin/lib/remote/gui/windowsHostSource.mjs +444 -49
  34. package/bin/lib/remote/idempotency.mjs +50 -21
  35. package/bin/lib/remote/localPolicy.mjs +17 -4
  36. package/bin/lib/remote/mascot/adpcm.mjs +70 -0
  37. package/bin/lib/remote/mascot/ask.mjs +768 -0
  38. package/bin/lib/remote/mascot/askHostSource.mjs +530 -0
  39. package/bin/lib/remote/mascot/assets.mjs +825 -216
  40. package/bin/lib/remote/mascot/bot.mjs +397 -0
  41. package/bin/lib/remote/mascot/hostSource.mjs +500 -103
  42. package/bin/lib/remote/mascot/hotkey.mjs +66 -0
  43. package/bin/lib/remote/mascot/index.mjs +199 -28
  44. package/bin/lib/remote/mascot/labels.mjs +2 -3
  45. package/bin/lib/remote/mascot/rigSource.mjs +614 -0
  46. package/bin/lib/remote/mascot/strings.mjs +204 -18
  47. package/bin/lib/remote/mascot/ui.mjs +104 -0
  48. package/bin/lib/remote/mascot/voiceSource.mjs +584 -0
  49. package/bin/lib/remote/meeting/index.mjs +415 -0
  50. package/bin/lib/remote/meeting/recorder.mjs +109 -0
  51. package/bin/lib/remote/meeting/recorderSource.mjs +394 -0
  52. package/bin/lib/remote/meeting/transcribe.mjs +259 -0
  53. package/bin/lib/remote/osSearch.mjs +107 -0
  54. package/bin/lib/remote/sqliteDb.mjs +51 -0
  55. package/bin/lib/remote/tabGroups.mjs +209 -0
  56. package/bin/lib/remote/toolHandlers.mjs +788 -726
  57. package/bin/lib/remoteControl.mjs +26 -26
  58. package/docs/AIVIN_MASCOT.md +130 -0
  59. package/docs/CLI.md +1504 -1353
  60. package/docs/media/aivin-mascot-live.gif +0 -0
  61. package/docs/media/aivin-mascot-live.png +0 -0
  62. package/docs/media/aivin-remote-architecture.svg +102 -0
  63. package/package.json +71 -71
@@ -1,26 +1,26 @@
1
- /**
2
- * Điều khiển máy từ xa (Device Agent phía máy) — các mô-đun trong ./remote/:
3
- * - client.mjs : daemon `aivin remote start` — nối namespace /device bằng token thiết bị, nhận lô lời gọi, trả kết quả/luồng.
4
- * - credentials.mjs : mã máy, ghép máy (token thiết bị riêng), danh sách / thu hồi máy.
5
- * - deviceProfile.mjs : tự phát hiện năng lực máy (chương trình trên PATH, dự án) + danh mục công cụ có dấu vân tay.
6
- * - toolHandlers.mjs : các gói công cụ (fs, shell, system, git, memory).
7
- * - scheduler.mjs : song song theo nhóm công cụ, khoá theo đường dẫn khi ghi, huỷ / hết giờ.
8
- * - sandbox.mjs : sàn cứng — thư mục gốc (realpath), lọc biến môi trường, chặn lệnh thảm hoạ, công tắc ngắt.
9
- * - deviceMemory.mjs : bộ nhớ trên máy (YAML người đọc/sửa được + vector), tìm kết hợp BM25 + cosine.
10
- * - fileIndexer.mjs : chỉ mục tệp trong RAM, quét tăng dần + theo dõi thay đổi.
11
- * - mission.mjs : `aivin remote do` — giao thẳng việc cho Device Agent.
12
- * - activityLog.mjs / autoStart.mjs : nhật ký hoạt động, tự khởi động cùng máy.
13
- */
14
-
15
- export * from './remote/deviceProfile.mjs';
16
- export * from './remote/toolHandlers.mjs';
17
- export * from './remote/deviceMemory.mjs';
18
- export * from './remote/activityLog.mjs';
19
- export * from './remote/autoStart.mjs';
20
- export * from './remote/client.mjs';
21
- export * from './remote/fileIndexer.mjs';
22
- export * from './remote/credentials.mjs';
23
- export * from './remote/scheduler.mjs';
24
- export * from './remote/sandbox.mjs';
25
- export * from './remote/mission.mjs';
26
- export { DEVICE_AGENT_PLUGIN_ID, DeviceEvent, DeviceErrorCode, MemoryKind } from './remote/constants.mjs';
1
+ /**
2
+ * Điều khiển máy từ xa (Device Agent phía máy) — các mô-đun trong ./remote/:
3
+ * - client.mjs : daemon `aivin remote start` — nối namespace /device bằng token thiết bị, nhận lô lời gọi, trả kết quả/luồng.
4
+ * - credentials.mjs : mã máy, ghép máy (token thiết bị riêng), danh sách / thu hồi máy.
5
+ * - deviceProfile.mjs : tự phát hiện năng lực máy (chương trình trên PATH, dự án) + danh mục công cụ có dấu vân tay.
6
+ * - toolHandlers.mjs : các gói công cụ (fs, shell, system, git, memory).
7
+ * - scheduler.mjs : song song theo nhóm công cụ, khoá theo đường dẫn khi ghi, huỷ / hết giờ.
8
+ * - sandbox.mjs : sàn cứng — thư mục gốc (realpath), lọc biến môi trường, chặn lệnh thảm hoạ, công tắc ngắt.
9
+ * - deviceMemory.mjs : bộ nhớ trên máy (YAML người đọc/sửa được + vector), tìm kết hợp BM25 + cosine.
10
+ * - fileIndexer.mjs : chỉ mục tệp (SQLite trên đĩa, FTS5 + vector), quét tăng dần + theo dõi thay đổi.
11
+ * - mission.mjs : `aivin remote do` — giao thẳng việc cho Device Agent.
12
+ * - activityLog.mjs / autoStart.mjs : nhật ký hoạt động, tự khởi động cùng máy.
13
+ */
14
+
15
+ export * from './remote/deviceProfile.mjs';
16
+ export * from './remote/toolHandlers.mjs';
17
+ export * from './remote/deviceMemory.mjs';
18
+ export * from './remote/activityLog.mjs';
19
+ export * from './remote/autoStart.mjs';
20
+ export * from './remote/client.mjs';
21
+ export * from './remote/fileIndexer.mjs';
22
+ export * from './remote/credentials.mjs';
23
+ export * from './remote/scheduler.mjs';
24
+ export * from './remote/sandbox.mjs';
25
+ export * from './remote/mission.mjs';
26
+ export { DEVICE_AGENT_PLUGIN_ID, DeviceEvent, DeviceErrorCode, MemoryKind } from './remote/constants.mjs';
@@ -0,0 +1,130 @@
1
+ # Aivin mascot
2
+
3
+ <p align="center">
4
+ <img src="media/aivin-mascot-live.gif" alt="The current live Aivin mascot showing chat, file drag and attached-file states" width="480" />
5
+ </p>
6
+
7
+ The Aivin mascot is the floating Windows interface for Aivin Remote. It shows what the agent is doing, accepts typed or spoken questions, and gives access to recent activity without opening the web app.
8
+
9
+ The animation above is rendered from the current WPF visual tree. It demonstrates the real chat box, the file-drag target and the tray badge after two files have been attached.
10
+
11
+ ## How it connects to Aivin
12
+
13
+ ![Aivin Remote architecture: the platform routes work to listeners on selected computers, which enforce local policy and return results](media/aivin-remote-architecture.svg)
14
+
15
+ The mascot is a local interface to the Aivin listener running on the same computer. It sends typed questions, voice events and user choices to that listener; the listener maintains the authenticated outbound connection to Aivin Platform. Work coming back from the platform passes through local policy and approval checks before any tool or app is used. Status, questions and results then travel back over the same connection.
16
+
17
+ This design supports multiple paired computers without exposing an inbound remote-control port. A chat or mission targets a selected computer, and each computer keeps its own identity, capabilities, policy and local execution boundary.
18
+
19
+ ## Requirements
20
+
21
+ - Windows.
22
+ - A paired computer with the Aivin Remote listener running.
23
+ - The mascot enabled for that listener run.
24
+
25
+ Start the listener normally:
26
+
27
+ ```bash
28
+ aivin remote start
29
+ ```
30
+
31
+ To show the mascot and open its ask box directly, run:
32
+
33
+ ```bash
34
+ aivin ui
35
+ ```
36
+
37
+ If the listener is not running, `aivin ui` starts it in the background. If the computer has not been paired, the command prints pairing instructions instead.
38
+
39
+ ## Using the mascot
40
+
41
+ - **Move it:** drag the mascot to another position. Aivin remembers the position for the next start.
42
+ - **Ask by typing:** hover over the mascot to reveal the ask box, or click it to open the box. Type a question and press Enter.
43
+ - **Talk to Aivin:** click the microphone button to start a live voice conversation. Click it again to finish; clicking while Aivin is speaking interrupts the reply.
44
+ - **Open activity:** right-click the mascot to show the detailed activity panel.
45
+ - **Start fresh:** choose **New chat session** in the activity panel. The previous conversation remains available in Aivin.
46
+ - **Attach local files:** drag files or folders onto the mascot. They are attached to the next question, subject to the attachment limit.
47
+
48
+ The app window that was active immediately before you opened the mascot or used its microphone hotkey is included as context. This lets questions such as “what is wrong here?” refer to that window. The agent only observes or captures the window when the request requires it.
49
+
50
+ ## Status and motion
51
+
52
+ The mascot changes its expression and motion to reflect the listener state:
53
+
54
+ | State | Meaning |
55
+ | -------- | ---------------------------------------------------- |
56
+ | Idle | Connected and waiting for work |
57
+ | Working | A task or tool call is running |
58
+ | Thinking | Aivin is preparing a response |
59
+ | Waiting | Aivin needs an answer or confirmation |
60
+ | Done | The latest work completed successfully |
61
+ | Error | The latest work failed |
62
+ | Paused | Remote work is paused |
63
+ | Offline | The listener lost its connection and is reconnecting |
64
+
65
+ When turned off from the activity panel, the mascot fades and slides down before its window closes. This only closes the mascot interface; the Remote listener continues running in the background.
66
+
67
+ Preview all eight state animations without pairing or starting the listener:
68
+
69
+ ```bash
70
+ aivin ui --demo
71
+ ```
72
+
73
+ ## Keyboard shortcut
74
+
75
+ The default microphone shortcut is `Win+Alt+Space`. If another application already owns it, Aivin tries its fallback combinations.
76
+
77
+ ```bash
78
+ aivin remote mascot hotkey # show the current shortcut
79
+ aivin remote mascot hotkey Ctrl+Alt+M # set a custom shortcut
80
+ aivin remote mascot hotkey off # disable the shortcut
81
+ aivin remote mascot hotkey default # restore automatic defaults
82
+ ```
83
+
84
+ Shortcut changes take effect after the mascot restarts.
85
+
86
+ ## Turning the mascot on or off
87
+
88
+ Check or change the persistent setting:
89
+
90
+ ```bash
91
+ aivin remote mascot
92
+ aivin remote mascot off
93
+ aivin remote mascot on
94
+ ```
95
+
96
+ The activity panel's **Turn mascot off** button also changes the persistent setting. Run `aivin ui` to enable and bring it back immediately. After using `aivin remote mascot on`, restart the listener for the setting to take effect.
97
+
98
+ To hide the mascot for only one listener run:
99
+
100
+ ```bash
101
+ aivin remote start --no-mascot
102
+ ```
103
+
104
+ ## Privacy and window behavior
105
+
106
+ - The mascot stays out of Aivin screenshots and screen sharing captures.
107
+ - It does not take keyboard focus unless its ask box is open.
108
+ - It moves out of the way while the agent controls another app window.
109
+ - Voice conversations appear as text in the ask box. Aivin ignores microphone input while its own voice is playing to avoid feedback.
110
+ - Interface text follows `AIVIN_LANG`, falling back to the Windows system language.
111
+
112
+ ## Troubleshooting
113
+
114
+ **The mascot does not appear**
115
+
116
+ Run `aivin remote mascot` to check whether it is enabled, then run `aivin ui`. Use `aivin remote status` to confirm the listener is running.
117
+
118
+ **The microphone shortcut does not work**
119
+
120
+ Run `aivin remote mascot hotkey` to see the active candidates. Set another combination if they are already registered by other applications, then restart the mascot.
121
+
122
+ **The mascot says it is offline**
123
+
124
+ The listener is still running but cannot currently reach Aivin. Check the computer's connection and use `aivin remote logs` for details.
125
+
126
+ **The mascot is visible during a capture**
127
+
128
+ Normal Aivin captures exclude it. Set or remove any development-only capture overrides, then restart the listener.
129
+
130
+ See also the [Aivin Remote CLI reference](CLI.md#aivin-remote) for listener, meeting, update, and desktop-app commands.