@aivin-labs/cli 1.0.30 → 1.0.32
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 +1 -1
- package/bin/cli.mjs +6 -1
- package/bin/lib/remote/desktop/index.mjs +8 -6
- package/bin/lib/remote/desktop/strings.mjs +20 -4
- package/bin/lib/remote/desktop/traySource.mjs +121 -6
- package/bin/lib/remote/mascot/hostSource.mjs +1 -1
- package/bin/lib/remote/mascot/strings.mjs +2 -2
- package/docs/AIVIN_MASCOT.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ curl -fsSL https://get.aivin.vn/install.sh | sh
|
|
|
123
123
|
| **Linux glibc x64 / arm64** | `aivin-linux-x64` / `aivin-linux-arm64` |
|
|
124
124
|
| **Linux musl (Alpine)** | `aivin-linux-x64-musl` / `aivin-linux-arm64-musl` |
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
On Windows, open Aivin from the system tray and choose **Sign in to connect** to link this computer through the usual browser login. You can also pair from Aivin Web with a one-time code (`aivin remote start --code <code>`).
|
|
127
127
|
|
|
128
128
|
---
|
|
129
129
|
|
package/bin/cli.mjs
CHANGED
|
@@ -842,7 +842,12 @@ program
|
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
844
|
const next = normalizeServerUrl(target);
|
|
845
|
-
if (next === current)
|
|
845
|
+
if (next === current) {
|
|
846
|
+
// An explicit selection should persist even when the value currently comes only from
|
|
847
|
+
// AIVIN_BASE_URL or the built-in default; desktop launchers read server.json themselves.
|
|
848
|
+
if (!readActiveServer()) setActiveServer(next);
|
|
849
|
+
return console.log(`Đang dùng ${serverLabel(next)} (${next}).`);
|
|
850
|
+
}
|
|
846
851
|
const holder = lockHolder();
|
|
847
852
|
if (holder) {
|
|
848
853
|
const { proceed } = await inquirer.prompt([{
|
|
@@ -230,8 +230,8 @@ export function ensureLauncher({ exe = launcherExePath(), home = REMOTE_CONFIG_D
|
|
|
230
230
|
return { exe, built: true };
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export function ensureStartMenuShortcut({ exe = launcherExePath(), lnk = startMenuShortcutPath(), lang = 'en', dir = DESKTOP_DIR } = {}) {
|
|
234
|
-
runSetup({ Lnk: lnk, Target: exe, Desc: trayStrings(lang).shortcut }, dir);
|
|
233
|
+
export function ensureStartMenuShortcut({ exe = launcherExePath(), lnk = startMenuShortcutPath(), lang = 'en', args = '--platform', dir = DESKTOP_DIR } = {}) {
|
|
234
|
+
runSetup({ Lnk: lnk, Target: exe, LnkArgs: args, Desc: trayStrings(lang).shortcut }, dir);
|
|
235
235
|
return lnk;
|
|
236
236
|
}
|
|
237
237
|
|
|
@@ -239,9 +239,9 @@ export function desktopShortcutName() {
|
|
|
239
239
|
return `${DISPLAY_NAME}.lnk`;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
export function ensureDesktopShortcut({ exe = launcherExePath(), lang = 'en', dir = DESKTOP_DIR } = {}) {
|
|
242
|
+
export function ensureDesktopShortcut({ exe = launcherExePath(), lang = 'en', args = '--platform', dir = DESKTOP_DIR } = {}) {
|
|
243
243
|
const name = desktopShortcutName();
|
|
244
|
-
runSetup({ DesktopLnkName: name, Target: exe, Desc: trayStrings(lang).shortcut }, dir);
|
|
244
|
+
runSetup({ DesktopLnkName: name, Target: exe, LnkArgs: args, Desc: trayStrings(lang).shortcut }, dir);
|
|
245
245
|
return name;
|
|
246
246
|
}
|
|
247
247
|
|
|
@@ -277,6 +277,8 @@ export function refreshDesktopIntegration({ lang = 'en' } = {}) {
|
|
|
277
277
|
const done = [];
|
|
278
278
|
const { exe, built } = ensureLauncher();
|
|
279
279
|
if (built) done.push('launcher');
|
|
280
|
+
if (built || !fs.existsSync(startMenuShortcutPath())) ensureStartMenuShortcut({ exe, lang, args: '--platform' });
|
|
281
|
+
if (built) ensureDesktopShortcut({ exe, lang, args: '--platform' });
|
|
280
282
|
if (ensureFileAssociations({ exe, lang, stampFile: ASSOCIATION_STAMP_FILE })) done.push('associations');
|
|
281
283
|
if (built || !fs.existsSync(sendToShortcutPath())) { ensureSendToShortcut({ exe, lang }); done.push('send_to'); }
|
|
282
284
|
if (ensureUninstallEntry({ ...uninstallEntryOptions(exe), stampFile: UNINSTALL_STAMP_FILE })) done.push('uninstall_entry');
|
|
@@ -343,8 +345,8 @@ export function installDesktop({ argv, rollback = null, lang = 'en', autostart =
|
|
|
343
345
|
const { exe, built } = ensureLauncher();
|
|
344
346
|
const lnk = startMenuShortcutPath();
|
|
345
347
|
for (const p of legacyStartMenuShortcutPaths()) fs.rmSync(p, { force: true });
|
|
346
|
-
|
|
347
|
-
const desktopShortcut = ensureDesktopShortcut({ exe, lang });
|
|
348
|
+
ensureStartMenuShortcut({ exe, lnk, lang, args: '--platform' });
|
|
349
|
+
const desktopShortcut = ensureDesktopShortcut({ exe, lang, args: '--platform' });
|
|
348
350
|
if (autostart) registerStartup(exe);
|
|
349
351
|
const openWith = registerOpenWith(exe, lang);
|
|
350
352
|
if (launch && built) quitRunningTray({ exe });
|
|
@@ -30,12 +30,20 @@ export const TRAY_STRINGS = Object.freeze({
|
|
|
30
30
|
updateUpdating: 'Đang tải bản cập nhật...',
|
|
31
31
|
quit: 'Thoát Aivin',
|
|
32
32
|
firstRun: 'Aivin đang chạy ở khay hệ thống — bấm biểu tượng để mở.',
|
|
33
|
-
connectHint: 'Aivin
|
|
33
|
+
connectHint: 'Aivin đang ở khay hệ thống — bấm biểu tượng rồi chọn “Đăng nhập để kết nối”.',
|
|
34
34
|
connected: 'Đã kết nối máy này với Aivin.',
|
|
35
35
|
pairFailed: 'Không kết nối được — mã sai hoặc đã hết hạn. Tạo mã mới trong Aivin rồi thử lại.',
|
|
36
36
|
pairPrompt: 'Nhập mã kết nối từ Aivin (khung chat → Browser ▾ → Thêm máy tính này):',
|
|
37
37
|
pairOk: 'Kết nối',
|
|
38
38
|
pairCancel: 'Huỷ',
|
|
39
|
+
connectTitle: 'Kết nối máy tính này với Aivin Cloud',
|
|
40
|
+
connectPrompt: 'Đăng nhập tài khoản Aivin để liên kết máy tính này và nhận việc từ Aivin Cloud.',
|
|
41
|
+
connectSignIn: 'Đăng nhập để kết nối',
|
|
42
|
+
connectCode: 'Tôi có mã kết nối',
|
|
43
|
+
connectWorking: 'Đang mở trang đăng nhập…',
|
|
44
|
+
connectPairing: 'Đăng nhập thành công. Đang liên kết máy tính…',
|
|
45
|
+
connectFailed: 'Chưa kết nối được. Hãy thử lại hoặc dùng mã kết nối.',
|
|
46
|
+
connectDone: 'Đã kết nối máy tính này với Aivin Cloud.',
|
|
39
47
|
shortcut: 'Aivin — cho các agent Aivin làm việc trên máy tính này',
|
|
40
48
|
openWith: 'Mở bằng AIVIN Bot',
|
|
41
49
|
share: 'Gửi cho AIVIN Bot',
|
|
@@ -74,12 +82,20 @@ export const TRAY_STRINGS = Object.freeze({
|
|
|
74
82
|
updateUpdating: 'Downloading update...',
|
|
75
83
|
quit: 'Quit Aivin',
|
|
76
84
|
firstRun: 'Aivin is running in the system tray — click the icon to open it.',
|
|
77
|
-
connectHint: 'Aivin is in the system tray — click the icon
|
|
85
|
+
connectHint: 'Aivin is in the system tray — click the icon, then choose “Sign in to connect”.',
|
|
78
86
|
connected: 'This computer is now connected to Aivin.',
|
|
79
87
|
pairFailed: 'Could not connect — the code is wrong or expired. Create a new code in Aivin and try again.',
|
|
80
88
|
pairPrompt: 'Enter the connect code from Aivin (chat box → Browser ▾ → Add this computer):',
|
|
81
89
|
pairOk: 'Connect',
|
|
82
90
|
pairCancel: 'Cancel',
|
|
91
|
+
connectTitle: 'Connect this computer to Aivin Cloud',
|
|
92
|
+
connectPrompt: 'Sign in to your Aivin account to link this computer and receive work from Aivin Cloud.',
|
|
93
|
+
connectSignIn: 'Sign in to connect',
|
|
94
|
+
connectCode: 'I have a connect code',
|
|
95
|
+
connectWorking: 'Opening sign-in…',
|
|
96
|
+
connectPairing: 'Signed in. Linking this computer…',
|
|
97
|
+
connectFailed: 'Could not connect. Try again or use a connect code.',
|
|
98
|
+
connectDone: 'This computer is connected to Aivin Cloud.',
|
|
83
99
|
shortcut: 'Aivin — lets your Aivin agents work on this computer',
|
|
84
100
|
openWith: 'Open with AIVIN Bot',
|
|
85
101
|
share: 'Share with AIVIN Bot',
|
|
@@ -96,13 +112,13 @@ const PLATFORM_STRINGS = Object.freeze({
|
|
|
96
112
|
vi: {
|
|
97
113
|
startup: 'Mở khi đăng nhập',
|
|
98
114
|
firstRun: 'Aivin đang chạy trên thanh menu — bấm biểu tượng để xem.',
|
|
99
|
-
|
|
115
|
+
connectHint: 'Aivin đang ở khay hệ thống — bấm biểu tượng rồi chọn “Đăng nhập để kết nối”.',
|
|
100
116
|
folder: 'Mở thư mục Aivin trong Finder',
|
|
101
117
|
},
|
|
102
118
|
en: {
|
|
103
119
|
startup: 'Open at login',
|
|
104
120
|
firstRun: 'Aivin is running in the menu bar — click its icon to see it.',
|
|
105
|
-
connectHint: 'Aivin is in the
|
|
121
|
+
connectHint: 'Aivin is in the system tray — click its icon, then choose “Sign in to connect”.',
|
|
106
122
|
folder: 'Show Aivin folder in Finder',
|
|
107
123
|
},
|
|
108
124
|
},
|
|
@@ -53,6 +53,7 @@ namespace AivinDesktop {
|
|
|
53
53
|
if (workAt >= 0) return SendRequest(args, workAt + 1, id, ".workdir");
|
|
54
54
|
bool autostart = Array.IndexOf(args, "--autostart") >= 0;
|
|
55
55
|
bool installed = Array.IndexOf(args, "--installed") >= 0;
|
|
56
|
+
bool openPlatform = Array.IndexOf(args, "--platform") >= 0;
|
|
56
57
|
bool quit = Array.IndexOf(args, "--quit") >= 0;
|
|
57
58
|
bool created;
|
|
58
59
|
using (EventWaitHandle platformLaunch = new EventWaitHandle(false, EventResetMode.AutoReset, "Local\\AivinTrayPlatform-" + id)) {
|
|
@@ -60,6 +61,7 @@ namespace AivinDesktop {
|
|
|
60
61
|
if (!created) {
|
|
61
62
|
// Double-click Aivin.exe / Start menu mở platform; lệnh nội bộ vẫn chỉ đánh thức linh vật.
|
|
62
63
|
if (quit) Signal("Local\\AivinTrayQuit-" + id);
|
|
64
|
+
else if (openPlatform) TrayApp.OpenPlatformNow();
|
|
63
65
|
else if (args.Length == 0) platformLaunch.Set();
|
|
64
66
|
else if (!autostart && !installed) Signal("Local\\AivinTrayOpen-" + id);
|
|
65
67
|
return 0;
|
|
@@ -68,7 +70,7 @@ namespace AivinDesktop {
|
|
|
68
70
|
try { SetProcessDPIAware(); } catch { }
|
|
69
71
|
Application.EnableVisualStyles();
|
|
70
72
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
71
|
-
Application.Run(new TrayApp(id, !autostart && !installed, installed));
|
|
73
|
+
Application.Run(new TrayApp(id, !autostart && (!installed || openPlatform), installed));
|
|
72
74
|
GC.KeepAlive(mutex);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
@@ -668,6 +670,14 @@ namespace AivinDesktop {
|
|
|
668
670
|
});
|
|
669
671
|
}
|
|
670
672
|
|
|
673
|
+
static int CompareVersions(string left, string right) {
|
|
674
|
+
string a = (left ?? "").Trim().TrimStart('v', 'V').Split('-')[0].Split('+')[0];
|
|
675
|
+
string b = (right ?? "").Trim().TrimStart('v', 'V').Split('-')[0].Split('+')[0];
|
|
676
|
+
Version av, bv;
|
|
677
|
+
if (Version.TryParse(a, out av) && Version.TryParse(b, out bv)) return av.CompareTo(bv);
|
|
678
|
+
return string.Compare(left, right, StringComparison.OrdinalIgnoreCase);
|
|
679
|
+
}
|
|
680
|
+
|
|
671
681
|
void Refresh() {
|
|
672
682
|
bool paired = HasPairedServer();
|
|
673
683
|
bool paused = File.Exists(PausedFile);
|
|
@@ -698,10 +708,14 @@ namespace AivinDesktop {
|
|
|
698
708
|
if (isUpdating) {
|
|
699
709
|
updateItem.Text = cfg.T("updateUpdating");
|
|
700
710
|
updateItem.Enabled = false;
|
|
701
|
-
} else if (!string.IsNullOrEmpty(siteLatest) &&
|
|
711
|
+
} else if (!string.IsNullOrEmpty(siteLatest) && CompareVersions(siteLatest, ver) > 0) {
|
|
702
712
|
updateItem.Text = "★ " + cfg.T("updateAvailable").Replace("{version}", siteLatest);
|
|
703
713
|
updateItem.Font = new Font(updateItem.Font, FontStyle.Bold);
|
|
704
714
|
updateItem.Enabled = true;
|
|
715
|
+
} else if (!string.IsNullOrEmpty(siteLatest)) {
|
|
716
|
+
updateItem.Text = "✓ " + cfg.T("updateUpToDate") + " (" + ver + ")";
|
|
717
|
+
updateItem.Font = new Font(updateItem.Font, FontStyle.Regular);
|
|
718
|
+
updateItem.Enabled = true;
|
|
705
719
|
} else {
|
|
706
720
|
updateItem.Text = cfg.T("updateCheckNow") + " (" + ver + ")";
|
|
707
721
|
updateItem.Font = new Font(updateItem.Font, FontStyle.Regular);
|
|
@@ -829,6 +843,9 @@ namespace AivinDesktop {
|
|
|
829
843
|
}
|
|
830
844
|
}
|
|
831
845
|
} catch { }
|
|
846
|
+
if (api == "https://api.aivin.vn") return "https://brain.aivin.vn";
|
|
847
|
+
if (api == "https://beta-api.aivin.vn") return "https://beta.aivin.vn";
|
|
848
|
+
if (api == "https://api.aivin.cloud") return "https://brain.aivin.cloud";
|
|
832
849
|
return "https://brain.aivin.cloud";
|
|
833
850
|
}
|
|
834
851
|
|
|
@@ -864,7 +881,7 @@ namespace AivinDesktop {
|
|
|
864
881
|
// Unknown default browsers keep their own profile/session via the normal URL handler.
|
|
865
882
|
if (exe == null && progId.Length == 0) exe = BrowserPath("edge") ?? BrowserPath("chrome");
|
|
866
883
|
if (exe != null) {
|
|
867
|
-
ProcessStartInfo app = new ProcessStartInfo(exe, "--app=\"" + url + "\"");
|
|
884
|
+
ProcessStartInfo app = new ProcessStartInfo(exe, "--app=\"" + url + "\" --start-maximized");
|
|
868
885
|
app.UseShellExecute = false;
|
|
869
886
|
Process.Start(app);
|
|
870
887
|
return;
|
|
@@ -873,6 +890,8 @@ namespace AivinDesktop {
|
|
|
873
890
|
try { Process.Start(new ProcessStartInfo(url) { UseShellExecute = true }); } catch { }
|
|
874
891
|
}
|
|
875
892
|
|
|
893
|
+
internal static void OpenPlatformNow() { LaunchPlatformApp(); }
|
|
894
|
+
|
|
876
895
|
/** Gửi yêu cầu cho daemon qua tệp đánh dấu (mascot-show = mở ô hỏi, mascot-voice = nói chuyện); daemon đang dừng thì chạy lại để nó nhận. */
|
|
877
896
|
void RequestMascot(string requestFile) {
|
|
878
897
|
if (quitting) return;
|
|
@@ -988,6 +1007,102 @@ namespace AivinDesktop {
|
|
|
988
1007
|
}
|
|
989
1008
|
|
|
990
1009
|
void ShowPair() {
|
|
1010
|
+
if (pairForm != null) { pairForm.Activate(); return; }
|
|
1011
|
+
Form f = new Form();
|
|
1012
|
+
f.Text = cfg.T("connectTitle");
|
|
1013
|
+
f.Icon = colorIcon;
|
|
1014
|
+
f.Font = SystemFonts.MessageBoxFont;
|
|
1015
|
+
f.AutoScaleDimensions = new SizeF(96F, 96F);
|
|
1016
|
+
f.AutoScaleMode = AutoScaleMode.Dpi;
|
|
1017
|
+
f.FormBorderStyle = FormBorderStyle.FixedDialog;
|
|
1018
|
+
f.MaximizeBox = false;
|
|
1019
|
+
f.MinimizeBox = false;
|
|
1020
|
+
f.StartPosition = FormStartPosition.CenterScreen;
|
|
1021
|
+
f.TopMost = true;
|
|
1022
|
+
f.ClientSize = new Size(420, 194);
|
|
1023
|
+
bool[] connectCancelled = new bool[] { false };
|
|
1024
|
+
f.FormClosing += delegate { connectCancelled[0] = true; };
|
|
1025
|
+
Label label = new Label();
|
|
1026
|
+
label.Text = cfg.T("connectPrompt");
|
|
1027
|
+
label.SetBounds(16, 16, 388, 52);
|
|
1028
|
+
Label statusLabel = new Label();
|
|
1029
|
+
statusLabel.SetBounds(16, 76, 388, 24);
|
|
1030
|
+
statusLabel.ForeColor = Color.FromArgb(80, 90, 105);
|
|
1031
|
+
Button signIn = new Button();
|
|
1032
|
+
signIn.Text = cfg.T("connectSignIn");
|
|
1033
|
+
signIn.SetBounds(16, 128, 190, 32);
|
|
1034
|
+
signIn.BackColor = Color.FromArgb(33, 98, 230);
|
|
1035
|
+
signIn.ForeColor = Color.White;
|
|
1036
|
+
signIn.FlatStyle = FlatStyle.Flat;
|
|
1037
|
+
Button code = new Button();
|
|
1038
|
+
code.Text = cfg.T("connectCode");
|
|
1039
|
+
code.SetBounds(212, 128, 128, 32);
|
|
1040
|
+
Button cancel = new Button();
|
|
1041
|
+
cancel.Text = cfg.T("pairCancel");
|
|
1042
|
+
cancel.SetBounds(346, 128, 58, 32);
|
|
1043
|
+
cancel.DialogResult = DialogResult.Cancel;
|
|
1044
|
+
f.Controls.AddRange(new Control[] { label, statusLabel, signIn, code, cancel });
|
|
1045
|
+
f.CancelButton = cancel;
|
|
1046
|
+
pairForm = f;
|
|
1047
|
+
signIn.Click += delegate {
|
|
1048
|
+
signIn.Enabled = false;
|
|
1049
|
+
code.Enabled = false;
|
|
1050
|
+
statusLabel.Text = cfg.T("connectWorking");
|
|
1051
|
+
ThreadPool.QueueUserWorkItem(delegate {
|
|
1052
|
+
int loginResult = RunCliAndWait("login");
|
|
1053
|
+
if (loginResult != 0) {
|
|
1054
|
+
UI(delegate { if (!quitting && pairForm == f) { statusLabel.Text = cfg.T("connectFailed"); signIn.Enabled = code.Enabled = true; } });
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
if (connectCancelled[0]) return;
|
|
1058
|
+
UI(delegate { if (!quitting && pairForm == f) statusLabel.Text = cfg.T("connectPairing"); });
|
|
1059
|
+
int pairResult = RunCliAndWait("remote pair");
|
|
1060
|
+
UI(delegate {
|
|
1061
|
+
if (quitting || pairForm != f) return;
|
|
1062
|
+
if (pairResult == 0 && HasPairedServer()) {
|
|
1063
|
+
statusLabel.Text = cfg.T("connectDone");
|
|
1064
|
+
f.Close();
|
|
1065
|
+
} else {
|
|
1066
|
+
statusLabel.Text = cfg.T("connectFailed");
|
|
1067
|
+
signIn.Enabled = code.Enabled = true;
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
});
|
|
1071
|
+
};
|
|
1072
|
+
code.Click += delegate { f.DialogResult = DialogResult.Retry; f.Close(); };
|
|
1073
|
+
DialogResult r = f.ShowDialog();
|
|
1074
|
+
pairForm = null;
|
|
1075
|
+
f.Dispose();
|
|
1076
|
+
if (r == DialogResult.Retry && !quitting) { ShowPairWithCode(); return; }
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
int RunCliAndWait(string command) {
|
|
1080
|
+
try {
|
|
1081
|
+
cfg = Config.Load(CfgFile);
|
|
1082
|
+
if (string.IsNullOrEmpty(cfg.Exe)) return 1;
|
|
1083
|
+
List<string> args = new List<string>();
|
|
1084
|
+
foreach (string a in cfg.Args) { if (a == "remote") break; args.Add(a); }
|
|
1085
|
+
foreach (string a in command.Split(' ')) args.Add(a);
|
|
1086
|
+
StringBuilder line = new StringBuilder();
|
|
1087
|
+
foreach (string a in args) { if (line.Length > 0) line.Append(' '); line.Append(Quote(a)); }
|
|
1088
|
+
ProcessStartInfo psi = new ProcessStartInfo(cfg.Exe, line.ToString());
|
|
1089
|
+
psi.UseShellExecute = false;
|
|
1090
|
+
psi.CreateNoWindow = true;
|
|
1091
|
+
psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
|
1092
|
+
psi.EnvironmentVariables.Remove("AIVIN_SUPERVISOR");
|
|
1093
|
+
psi.RedirectStandardOutput = true;
|
|
1094
|
+
psi.RedirectStandardError = true;
|
|
1095
|
+
Process p = Process.Start(psi);
|
|
1096
|
+
p.BeginOutputReadLine();
|
|
1097
|
+
p.BeginErrorReadLine();
|
|
1098
|
+
p.WaitForExit();
|
|
1099
|
+
int result = p.ExitCode;
|
|
1100
|
+
p.Dispose();
|
|
1101
|
+
return result;
|
|
1102
|
+
} catch { return 1; }
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
void ShowPairWithCode() {
|
|
991
1106
|
if (pairForm != null) { pairForm.Activate(); return; }
|
|
992
1107
|
Form f = new Form();
|
|
993
1108
|
f.Text = "AIVIN Bot";
|
|
@@ -1020,12 +1135,12 @@ namespace AivinDesktop {
|
|
|
1020
1135
|
f.CancelButton = cancel;
|
|
1021
1136
|
pairForm = f;
|
|
1022
1137
|
DialogResult r = f.ShowDialog();
|
|
1023
|
-
string
|
|
1138
|
+
string pairingCode = box.Text.Trim();
|
|
1024
1139
|
pairForm = null;
|
|
1025
1140
|
f.Dispose();
|
|
1026
|
-
if (r != DialogResult.OK ||
|
|
1141
|
+
if (r != DialogResult.OK || pairingCode.Length == 0 || quitting) return;
|
|
1027
1142
|
KillChild();
|
|
1028
|
-
StartChild(
|
|
1143
|
+
StartChild(pairingCode);
|
|
1029
1144
|
Refresh();
|
|
1030
1145
|
}
|
|
1031
1146
|
|
|
@@ -563,7 +563,7 @@ $script:topTimer.Start()
|
|
|
563
563
|
# change: the bot sits at the anchor inside it, the boxes (ask box, bubble, activity panel) are laid out around the bot (ArrangeBoxes).
|
|
564
564
|
$wa = [Windows.SystemParameters]::WorkArea
|
|
565
565
|
$script:cx = if ($cfg.x -ne $null) { [double]$cfg.x } else { $wa.Right - 76 }
|
|
566
|
-
$script:cy = if ($cfg.y -ne $null) { [double]$cfg.y } else { $
|
|
566
|
+
$script:cy = if ($cfg.y -ne $null) { [double]$cfg.y } else { [Windows.SystemParameters]::PrimaryScreenHeight - ${MASCOT_BOX.h - MASCOT_CENTER.y} }
|
|
567
567
|
# Bot center inside the window (DIPs).
|
|
568
568
|
$script:mx = ${WINDOW.w / 2}; $script:my = ${WINDOW.h - ROOT_MARGIN - (MASCOT_BOX.h - MASCOT_CENTER.y)}
|
|
569
569
|
function DeviceScale {
|
|
@@ -282,7 +282,7 @@ const STRINGS = {
|
|
|
282
282
|
[MascotText.UI_SHOWN]: "Linh vật Aivin đã hiện trên màn hình — gõ hoặc bấm mic để hỏi.",
|
|
283
283
|
[MascotText.UI_STARTING]: "Đang bật Aivin trên máy này…",
|
|
284
284
|
[MascotText.UI_STARTED]: "Đã bật Aivin chạy nền — linh vật hiện trong giây lát.",
|
|
285
|
-
[MascotText.UI_NOT_PAIRED]: "Máy này chưa kết nối Aivin.
|
|
285
|
+
[MascotText.UI_NOT_PAIRED]: "Máy này chưa kết nối Aivin. Bấm biểu tượng Aivin ở khay hệ thống rồi chọn ‘Đăng nhập để kết nối’.",
|
|
286
286
|
[MascotText.UI_START_FAILED]: "Chưa bật được Aivin chạy nền — chạy: aivin remote start",
|
|
287
287
|
},
|
|
288
288
|
en: {
|
|
@@ -418,7 +418,7 @@ const STRINGS = {
|
|
|
418
418
|
[MascotText.UI_SHOWN]: "The Aivin mascot is on screen — type or click the mic to ask.",
|
|
419
419
|
[MascotText.UI_STARTING]: "Starting Aivin on this computer…",
|
|
420
420
|
[MascotText.UI_STARTED]: "Aivin is running in the background — the mascot shows up in a moment.",
|
|
421
|
-
[MascotText.UI_NOT_PAIRED]: "This computer is not connected to Aivin
|
|
421
|
+
[MascotText.UI_NOT_PAIRED]: "This computer is not connected to Aivin. Click the Aivin system tray icon and choose ‘Sign in to connect’.",
|
|
422
422
|
[MascotText.UI_START_FAILED]: "Could not start Aivin in the background — run: aivin remote start",
|
|
423
423
|
},
|
|
424
424
|
};
|
package/docs/AIVIN_MASCOT.md
CHANGED
|
@@ -34,7 +34,7 @@ To show the mascot and open its ask box directly, run:
|
|
|
34
34
|
aivin ui
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
If the listener is not running, `aivin ui` starts it in the background. If the computer has not been paired, the
|
|
37
|
+
If the listener is not running, `aivin ui` starts it in the background. If the computer has not been paired, click the Aivin system tray icon and choose **Sign in to connect**. Aivin opens the usual browser sign-in, links this computer, then starts the listener. The one-time pairing code remains available as a fallback from Aivin Web.
|
|
38
38
|
|
|
39
39
|
## Using the mascot
|
|
40
40
|
|