@aivin-labs/cli 1.0.5 → 1.0.11
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 +288 -216
- package/bin/assets/aivin-mascot.png +0 -0
- package/bin/cli.mjs +551 -5
- package/bin/lib/browserAutomation.mjs +384 -614
- package/bin/lib/browserTui.mjs +276 -251
- package/bin/lib/cancellation.mjs +61 -0
- package/bin/lib/localBrowser.mjs +345 -0
- package/bin/lib/mcpProxy.mjs +869 -837
- package/bin/lib/missionStream.mjs +696 -691
- package/bin/lib/releaseKeys.mjs +9 -0
- package/bin/lib/remote/activityLog.mjs +68 -0
- package/bin/lib/remote/autoStart.mjs +617 -0
- package/bin/lib/remote/autoUpdate.mjs +129 -0
- package/bin/lib/remote/brand.mjs +60 -0
- package/bin/lib/remote/browserTunnel.mjs +403 -0
- package/bin/lib/remote/callLedger.mjs +134 -0
- package/bin/lib/remote/cdpPolicy.mjs +79 -0
- package/bin/lib/remote/client.mjs +808 -0
- package/bin/lib/remote/clipboard.mjs +138 -0
- package/bin/lib/remote/codingAgents.mjs +293 -0
- package/bin/lib/remote/constants.mjs +234 -0
- package/bin/lib/remote/credentials.mjs +208 -0
- package/bin/lib/remote/daemonLock.mjs +86 -0
- package/bin/lib/remote/dailyBrowser.mjs +371 -0
- package/bin/lib/remote/desktop/index.mjs +272 -0
- package/bin/lib/remote/desktop/linux.mjs +144 -0
- package/bin/lib/remote/desktop/linuxTraySource.mjs +427 -0
- package/bin/lib/remote/desktop/mac.mjs +187 -0
- package/bin/lib/remote/desktop/macTraySource.mjs +292 -0
- package/bin/lib/remote/desktop/strings.mjs +74 -0
- package/bin/lib/remote/desktop/traySource.mjs +527 -0
- package/bin/lib/remote/deviceMemory.mjs +246 -0
- package/bin/lib/remote/deviceProfile.mjs +142 -0
- package/bin/lib/remote/deviceWatches.mjs +138 -0
- package/bin/lib/remote/docText.mjs +117 -0
- package/bin/lib/remote/fileIndexer.mjs +399 -0
- package/bin/lib/remote/gui/index.mjs +326 -0
- package/bin/lib/remote/gui/officeHostSource.mjs +393 -0
- package/bin/lib/remote/gui/windowsHost.mjs +109 -0
- package/bin/lib/remote/gui/windowsHostSource.mjs +1156 -0
- package/bin/lib/remote/httpTransfer.mjs +89 -0
- package/bin/lib/remote/idempotency.mjs +135 -0
- package/bin/lib/remote/keepAwake.mjs +100 -0
- package/bin/lib/remote/localConfirm.mjs +268 -0
- package/bin/lib/remote/localPolicy.mjs +256 -0
- package/bin/lib/remote/mascot/adpcm.mjs +70 -0
- package/bin/lib/remote/mascot/ask.mjs +768 -0
- package/bin/lib/remote/mascot/askHostSource.mjs +512 -0
- package/bin/lib/remote/mascot/assets.mjs +827 -0
- package/bin/lib/remote/mascot/bot.mjs +372 -0
- package/bin/lib/remote/mascot/hostSource.mjs +759 -0
- package/bin/lib/remote/mascot/hotkey.mjs +66 -0
- package/bin/lib/remote/mascot/index.mjs +493 -0
- package/bin/lib/remote/mascot/labels.mjs +82 -0
- package/bin/lib/remote/mascot/rigSource.mjs +609 -0
- package/bin/lib/remote/mascot/strings.mjs +375 -0
- package/bin/lib/remote/mascot/ui.mjs +104 -0
- package/bin/lib/remote/mascot/voiceSource.mjs +584 -0
- package/bin/lib/remote/meeting/index.mjs +415 -0
- package/bin/lib/remote/meeting/recorder.mjs +109 -0
- package/bin/lib/remote/meeting/recorderSource.mjs +394 -0
- package/bin/lib/remote/meeting/transcribe.mjs +259 -0
- package/bin/lib/remote/memberFsPool.mjs +134 -0
- package/bin/lib/remote/memberFsWorker.mjs +60 -0
- package/bin/lib/remote/mission.mjs +156 -0
- package/bin/lib/remote/missionQuestion.mjs +63 -0
- package/bin/lib/remote/multiUser.mjs +344 -0
- package/bin/lib/remote/netProxy.mjs +145 -0
- package/bin/lib/remote/notify.mjs +58 -0
- package/bin/lib/remote/office/index.mjs +90 -0
- package/bin/lib/remote/policyCommand.mjs +93 -0
- package/bin/lib/remote/processes.mjs +217 -0
- package/bin/lib/remote/sandbox.mjs +221 -0
- package/bin/lib/remote/schedule.mjs +213 -0
- package/bin/lib/remote/scheduler.mjs +124 -0
- package/bin/lib/remote/tabGroups.mjs +209 -0
- package/bin/lib/remote/textIndex.mjs +131 -0
- package/bin/lib/remote/tokenStore.mjs +77 -0
- package/bin/lib/remote/toolHandlers.mjs +741 -0
- package/bin/lib/remote/undoStore.mjs +242 -0
- package/bin/lib/remoteControl.mjs +26 -0
- package/bin/lib/scaffold.mjs +654 -653
- package/bin/lib/selfUpdate.mjs +71 -0
- package/bin/lib/update/binarySwap.mjs +63 -0
- package/bin/lib/update/constants.mjs +56 -0
- package/bin/lib/update/download.mjs +145 -0
- package/bin/lib/update/signature.mjs +42 -0
- package/bin/lib/update/state.mjs +205 -0
- package/bin/lib/update/versions.mjs +60 -0
- package/docs/AIVIN_MASCOT.md +116 -0
- package/docs/CLI.md +1484 -1299
- package/docs/media/aivin-mascot-states.mp4 +0 -0
- package/package.json +71 -62
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Khoá công khai ký bản phát hành CLI (Ed25519, 29/10/2026). Tự cập nhật chỉ cài bản có `SHA256SUMS.sig` ký bằng một khoá trong danh sách
|
|
3
|
+
* này — chiếm được trang tải (get.aivin.vn) cũng không đẩy được tệp chạy lạ xuống máy đã cài. Khoá bí mật KHÔNG nằm trên trang tải / CI
|
|
4
|
+
* (scripts/release-key.mjs tạo, scripts/sign-release.mjs ký). Đổi khoá: thêm khoá mới ở đây, phát hành một bản ký bằng khoá cũ, rồi mới ký
|
|
5
|
+
* bằng khoá mới; gỡ khoá cũ ở bản sau đó.
|
|
6
|
+
*/
|
|
7
|
+
export const RELEASE_PUBLIC_KEYS = Object.freeze([
|
|
8
|
+
{ id: '05b62965e1847716', key: 'QlThaBcc4Yl+ctV2MD+VuOOa0lu3yBxhiexprDarWHM=' },
|
|
9
|
+
]);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { REMOTE_CONFIG_DIR } from './deviceProfile.mjs';
|
|
4
|
+
|
|
5
|
+
export const REMOTE_ACTIVITY_LOG_FILE = path.join(REMOTE_CONFIG_DIR, 'remote-activity.log');
|
|
6
|
+
const MAX_LOG_LINES = 500;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Ghi lại một hoạt động điều khiển từ xa vào nhật ký máy tính.
|
|
10
|
+
*/
|
|
11
|
+
export function logActivity(entry) {
|
|
12
|
+
try {
|
|
13
|
+
fs.mkdirSync(REMOTE_CONFIG_DIR, { recursive: true });
|
|
14
|
+
const line = JSON.stringify({
|
|
15
|
+
timestamp: new Date().toISOString(),
|
|
16
|
+
...entry,
|
|
17
|
+
}) + '\n';
|
|
18
|
+
|
|
19
|
+
fs.appendFileSync(REMOTE_ACTIVITY_LOG_FILE, line, 'utf8');
|
|
20
|
+
|
|
21
|
+
// Cắt tỉa nếu tập tin nhật ký vượt quá giới hạn
|
|
22
|
+
const content = fs.readFileSync(REMOTE_ACTIVITY_LOG_FILE, 'utf8');
|
|
23
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
24
|
+
if (lines.length > MAX_LOG_LINES) {
|
|
25
|
+
const trimmed = lines.slice(-MAX_LOG_LINES).join('\n') + '\n';
|
|
26
|
+
fs.writeFileSync(REMOTE_ACTIVITY_LOG_FILE, trimmed, 'utf8');
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
// Tránh để lỗi ghi nhật ký làm gián đoạn luồng chính
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Lấy danh sách các hoạt động gần đây nhất.
|
|
35
|
+
*/
|
|
36
|
+
export function getRecentLogs(limit = 50) {
|
|
37
|
+
try {
|
|
38
|
+
if (!fs.existsSync(REMOTE_ACTIVITY_LOG_FILE)) return [];
|
|
39
|
+
const content = fs.readFileSync(REMOTE_ACTIVITY_LOG_FILE, 'utf8');
|
|
40
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
41
|
+
return lines
|
|
42
|
+
.slice(-Number(limit))
|
|
43
|
+
.map((line) => {
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(line);
|
|
46
|
+
} catch {
|
|
47
|
+
return { message: line };
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
.reverse();
|
|
51
|
+
} catch {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Xóa toàn bộ lịch sử hoạt động.
|
|
58
|
+
*/
|
|
59
|
+
export function clearLogs() {
|
|
60
|
+
try {
|
|
61
|
+
if (fs.existsSync(REMOTE_ACTIVITY_LOG_FILE)) {
|
|
62
|
+
fs.unlinkSync(REMOTE_ACTIVITY_LOG_FILE);
|
|
63
|
+
}
|
|
64
|
+
return { success: true };
|
|
65
|
+
} catch (err) {
|
|
66
|
+
throw new Error(`Không thể xóa nhật ký hoạt động: ${err.message}`, { cause: err });
|
|
67
|
+
}
|
|
68
|
+
}
|