@aivin-labs/cli 1.0.11 → 1.0.21

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 (88) hide show
  1. package/README.md +325 -288
  2. package/bin/cli.mjs +163 -17
  3. package/bin/lib/localPreview.mjs +437 -0
  4. package/bin/lib/openFile.mjs +235 -0
  5. package/bin/lib/previewCache.mjs +71 -0
  6. package/bin/lib/remote/atomicFile.mjs +32 -0
  7. package/bin/lib/remote/autoStart.mjs +2 -1
  8. package/bin/lib/remote/autoUpdate.mjs +12 -0
  9. package/bin/lib/remote/browserTunnel.mjs +47 -8
  10. package/bin/lib/remote/callLedger.mjs +94 -14
  11. package/bin/lib/remote/cdpPolicy.mjs +14 -2
  12. package/bin/lib/remote/client.mjs +1024 -808
  13. package/bin/lib/remote/cloudFiles.mjs +53 -0
  14. package/bin/lib/remote/codingAgents.mjs +2 -2
  15. package/bin/lib/remote/constants.mjs +261 -234
  16. package/bin/lib/remote/credentials.mjs +81 -4
  17. package/bin/lib/remote/daemonLock.mjs +57 -17
  18. package/bin/lib/remote/dailyBrowser.mjs +8 -2
  19. package/bin/lib/remote/desktop/castInput.mjs +98 -0
  20. package/bin/lib/remote/desktop/desktopCast.mjs +334 -0
  21. package/bin/lib/remote/desktop/desktopCastCaptureSource.mjs +598 -0
  22. package/bin/lib/remote/desktop/desktopCastSource.mjs +798 -0
  23. package/bin/lib/remote/desktop/desktopWebRtc.mjs +242 -0
  24. package/bin/lib/remote/desktop/fileAssociation.mjs +108 -0
  25. package/bin/lib/remote/desktop/index.mjs +58 -7
  26. package/bin/lib/remote/desktop/linux.mjs +1 -1
  27. package/bin/lib/remote/desktop/linuxTraySource.mjs +427 -427
  28. package/bin/lib/remote/desktop/mac.mjs +2 -2
  29. package/bin/lib/remote/desktop/macTraySource.mjs +293 -292
  30. package/bin/lib/remote/desktop/strings.mjs +28 -2
  31. package/bin/lib/remote/desktop/traySource.mjs +905 -527
  32. package/bin/lib/remote/desktop/webrtcRuntime.mjs +137 -0
  33. package/bin/lib/remote/desktop/webrtcWorker.mjs +181 -0
  34. package/bin/lib/remote/deviceProfile.mjs +1 -0
  35. package/bin/lib/remote/docText.mjs +85 -0
  36. package/bin/lib/remote/fileIndexer.mjs +773 -399
  37. package/bin/lib/remote/folderRules.mjs +143 -0
  38. package/bin/lib/remote/gitSafe.mjs +31 -0
  39. package/bin/lib/remote/gui/index.mjs +170 -19
  40. package/bin/lib/remote/gui/officeHostSource.mjs +635 -393
  41. package/bin/lib/remote/gui/windowsHost.mjs +12 -3
  42. package/bin/lib/remote/gui/windowsHostSource.mjs +461 -87
  43. package/bin/lib/remote/httpTransfer.mjs +64 -3
  44. package/bin/lib/remote/idempotency.mjs +49 -20
  45. package/bin/lib/remote/localPolicy.mjs +81 -9
  46. package/bin/lib/remote/mascot/ask.mjs +207 -42
  47. package/bin/lib/remote/mascot/askBlocksSource.mjs +286 -0
  48. package/bin/lib/remote/mascot/askHostSource.mjs +658 -512
  49. package/bin/lib/remote/mascot/blocks.mjs +201 -0
  50. package/bin/lib/remote/mascot/bot.mjs +54 -5
  51. package/bin/lib/remote/mascot/chartLayout.mjs +382 -0
  52. package/bin/lib/remote/mascot/diagramRender.mjs +154 -0
  53. package/bin/lib/remote/mascot/emojiSource.mjs +273 -0
  54. package/bin/lib/remote/mascot/fileChips.mjs +62 -0
  55. package/bin/lib/remote/mascot/hostSource.mjs +331 -52
  56. package/bin/lib/remote/mascot/hotkey.mjs +31 -7
  57. package/bin/lib/remote/mascot/images.mjs +111 -0
  58. package/bin/lib/remote/mascot/index.mjs +663 -493
  59. package/bin/lib/remote/mascot/lucideIcons.mjs +32 -0
  60. package/bin/lib/remote/mascot/mermaidBundle.mjs +28 -0
  61. package/bin/lib/remote/mascot/mood.mjs +57 -0
  62. package/bin/lib/remote/mascot/rigSource.mjs +648 -609
  63. package/bin/lib/remote/mascot/safeUrl.mjs +29 -0
  64. package/bin/lib/remote/mascot/strings.mjs +456 -375
  65. package/bin/lib/remote/mascot/ui.mjs +27 -7
  66. package/bin/lib/remote/multiUser.mjs +7 -2
  67. package/bin/lib/remote/notify.mjs +4 -1
  68. package/bin/lib/remote/office/index.mjs +12 -6
  69. package/bin/lib/remote/osSearch.mjs +107 -0
  70. package/bin/lib/remote/processes.mjs +5 -2
  71. package/bin/lib/remote/sandbox.mjs +26 -0
  72. package/bin/lib/remote/secretPaths.mjs +21 -0
  73. package/bin/lib/remote/sqliteDb.mjs +51 -0
  74. package/bin/lib/remote/tokenRotation.mjs +28 -0
  75. package/bin/lib/remote/toolHandlers.mjs +852 -741
  76. package/bin/lib/remote/watchBatcher.mjs +56 -0
  77. package/bin/lib/remoteControl.mjs +26 -26
  78. package/bin/lib/selfUpdate.mjs +12 -2
  79. package/bin/lib/update/binarySwap.mjs +15 -1
  80. package/bin/lib/update/state.mjs +10 -0
  81. package/docs/AIVIN_MASCOT.md +14 -0
  82. package/docs/CLI.md +1545 -1484
  83. package/docs/media/aivin-ecosystem.jpg +0 -0
  84. package/docs/media/aivin-mascot-live.gif +0 -0
  85. package/docs/media/aivin-mascot-live.png +0 -0
  86. package/docs/media/aivin-remote-architecture.svg +102 -0
  87. package/package.json +75 -71
  88. package/docs/media/aivin-mascot-states.mp4 +0 -0
Binary file
Binary file
Binary file
@@ -0,0 +1,102 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="720" viewBox="0 0 1200 720" role="img" aria-labelledby="title desc">
2
+ <title id="title">Aivin Remote architecture</title>
3
+ <desc id="desc">Aivin Platform sends authenticated work over outbound encrypted connections to Aivin listeners on multiple computers. Each listener applies local policy, requests approval when required, controls local tools and returns status and results. The mascot is a local interface to its listener.</desc>
4
+ <defs>
5
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
6
+ <stop offset="0" stop-color="#f7f9ff"/>
7
+ <stop offset="1" stop-color="#eef8ff"/>
8
+ </linearGradient>
9
+ <linearGradient id="platform" x1="0" y1="0" x2="1" y2="1">
10
+ <stop offset="0" stop-color="#5b5ce2"/>
11
+ <stop offset="1" stop-color="#1677ff"/>
12
+ </linearGradient>
13
+ <linearGradient id="device" x1="0" y1="0" x2="1" y2="1">
14
+ <stop offset="0" stop-color="#ffffff"/>
15
+ <stop offset="1" stop-color="#f4f8ff"/>
16
+ </linearGradient>
17
+ <filter id="shadow" x="-20%" y="-20%" width="140%" height="150%">
18
+ <feDropShadow dx="0" dy="8" stdDeviation="12" flood-color="#183b73" flood-opacity=".14"/>
19
+ </filter>
20
+ <marker id="arrowBlue" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
21
+ <path d="M0 0L10 5L0 10Z" fill="#5b6ee1"/>
22
+ </marker>
23
+ <marker id="arrowGreen" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
24
+ <path d="M0 0L10 5L0 10Z" fill="#00a870"/>
25
+ </marker>
26
+ <style>
27
+ .title{font:700 28px 'Segoe UI',Arial,sans-serif;fill:#17233d}.subtitle{font:400 15px 'Segoe UI',Arial,sans-serif;fill:#60708f}
28
+ .boxTitle{font:700 19px 'Segoe UI',Arial,sans-serif;fill:#17233d}.boxText{font:400 14px 'Segoe UI',Arial,sans-serif;fill:#52627e}
29
+ .whiteTitle{font:700 22px 'Segoe UI',Arial,sans-serif;fill:#fff}.whiteText{font:400 14px 'Segoe UI',Arial,sans-serif;fill:#e9f3ff}
30
+ .pill{font:600 12px 'Segoe UI',Arial,sans-serif}.flow{font:600 13px 'Segoe UI',Arial,sans-serif;fill:#405275}
31
+ .step{font:700 13px 'Segoe UI',Arial,sans-serif;fill:#fff}.small{font:400 12px 'Segoe UI',Arial,sans-serif;fill:#65738c}
32
+ </style>
33
+ </defs>
34
+
35
+ <rect width="1200" height="720" rx="28" fill="url(#bg)"/>
36
+ <text x="54" y="54" class="title">How Aivin Remote connects the platform to your computers</text>
37
+ <text x="54" y="82" class="subtitle">Every device initiates its own encrypted connection; Aivin does not expose an inbound remote-control port.</text>
38
+
39
+ <g filter="url(#shadow)">
40
+ <rect x="405" y="116" width="390" height="150" rx="24" fill="url(#platform)"/>
41
+ </g>
42
+ <circle cx="457" cy="164" r="24" fill="#ffffff" fill-opacity=".18"/>
43
+ <path d="M444 165c10-18 23-18 31-4-11-4-19 2-26 14 1-6-1-9-5-10Z" fill="#fff"/>
44
+ <text x="493" y="158" class="whiteTitle">Aivin Platform</text>
45
+ <text x="493" y="184" class="whiteText">Chats · agents · missions · approvals</text>
46
+ <rect x="443" y="211" width="145" height="28" rx="14" fill="#fff" fill-opacity=".16"/>
47
+ <text x="515" y="230" text-anchor="middle" class="pill" fill="#fff">authenticated routing</text>
48
+ <rect x="600" y="211" width="155" height="28" rx="14" fill="#fff" fill-opacity=".16"/>
49
+ <text x="677" y="230" text-anchor="middle" class="pill" fill="#fff">status + result relay</text>
50
+
51
+ <path d="M465 286C392 325 300 327 236 368" fill="none" stroke="#5b6ee1" stroke-width="3" marker-end="url(#arrowBlue)"/>
52
+ <path d="M735 286C808 325 900 327 964 368" fill="none" stroke="#5b6ee1" stroke-width="3" marker-end="url(#arrowBlue)"/>
53
+ <path d="M600 286V368" fill="none" stroke="#5b6ee1" stroke-width="3" marker-end="url(#arrowBlue)"/>
54
+ <text x="600" y="314" text-anchor="middle" class="flow">work ↓</text>
55
+ <text x="600" y="345" text-anchor="middle" class="small">TLS / Socket.IO · outbound from each computer</text>
56
+
57
+ <g transform="translate(54 374)" filter="url(#shadow)">
58
+ <rect width="330" height="250" rx="22" fill="url(#device)" stroke="#dce6f7"/>
59
+ <circle cx="38" cy="40" r="20" fill="#e8edff"/><text x="38" y="45" text-anchor="middle" class="pill" fill="#5b5ce2">1</text>
60
+ <text x="70" y="38" class="boxTitle">Work computer</text><text x="70" y="61" class="boxText">Windows · macOS · Linux</text>
61
+ <rect x="24" y="84" width="282" height="50" rx="12" fill="#eef1ff"/>
62
+ <text x="40" y="106" class="pill" fill="#4b56c0">Aivin listener</text><text x="40" y="124" class="small">identity · policy · scheduler</text>
63
+ <rect x="24" y="146" width="134" height="38" rx="10" fill="#e8fff6"/><text x="91" y="170" text-anchor="middle" class="pill" fill="#00875a">Local approval</text>
64
+ <rect x="172" y="146" width="134" height="38" rx="10" fill="#edf7ff"/><text x="239" y="170" text-anchor="middle" class="pill" fill="#1668b2">Tools &amp; apps</text>
65
+ <rect x="24" y="198" width="282" height="28" rx="14" fill="#f2f4f8"/><text x="165" y="217" text-anchor="middle" class="small">files · browser · GUI · shell · Office</text>
66
+ </g>
67
+
68
+ <g transform="translate(435 374)" filter="url(#shadow)">
69
+ <rect width="330" height="250" rx="22" fill="url(#device)" stroke="#dce6f7"/>
70
+ <circle cx="38" cy="40" r="20" fill="#e8edff"/><text x="38" y="45" text-anchor="middle" class="pill" fill="#5b5ce2">2</text>
71
+ <text x="70" y="38" class="boxTitle">Personal computer</text><text x="70" y="61" class="boxText">Selected per chat or mission</text>
72
+ <rect x="24" y="84" width="282" height="50" rx="12" fill="#eef1ff"/>
73
+ <text x="40" y="106" class="pill" fill="#4b56c0">Aivin listener</text><text x="40" y="124" class="small">outbound connection · no open port</text>
74
+ <rect x="24" y="146" width="134" height="38" rx="10" fill="#fff3e8"/><text x="91" y="170" text-anchor="middle" class="pill" fill="#b85c00">Mascot UI</text>
75
+ <rect x="172" y="146" width="134" height="38" rx="10" fill="#edf7ff"/><text x="239" y="170" text-anchor="middle" class="pill" fill="#1668b2">Tools &amp; apps</text>
76
+ <rect x="24" y="198" width="282" height="28" rx="14" fill="#f2f4f8"/><text x="165" y="217" text-anchor="middle" class="small">ask · voice · status · notifications</text>
77
+ </g>
78
+
79
+ <g transform="translate(816 374)" filter="url(#shadow)">
80
+ <rect width="330" height="250" rx="22" fill="url(#device)" stroke="#dce6f7"/>
81
+ <circle cx="38" cy="40" r="20" fill="#e8edff"/><text x="38" y="45" text-anchor="middle" class="pill" fill="#5b5ce2">N</text>
82
+ <text x="70" y="38" class="boxTitle">Organization computer</text><text x="70" y="61" class="boxText">Isolated users and limits</text>
83
+ <rect x="24" y="84" width="282" height="50" rx="12" fill="#eef1ff"/>
84
+ <text x="40" y="106" class="pill" fill="#4b56c0">Aivin listener</text><text x="40" y="124" class="small">member scope · quotas · audit trail</text>
85
+ <rect x="24" y="146" width="134" height="38" rx="10" fill="#e8fff6"/><text x="91" y="170" text-anchor="middle" class="pill" fill="#00875a">Local policy</text>
86
+ <rect x="172" y="146" width="134" height="38" rx="10" fill="#edf7ff"/><text x="239" y="170" text-anchor="middle" class="pill" fill="#1668b2">Tools &amp; apps</text>
87
+ <rect x="24" y="198" width="282" height="28" rx="14" fill="#f2f4f8"/><text x="165" y="217" text-anchor="middle" class="small">separate files · processes · memory</text>
88
+ </g>
89
+
90
+ <path d="M236 640C300 680 392 682 465 643" fill="none" stroke="#00a870" stroke-width="3" marker-end="url(#arrowGreen)"/>
91
+ <path d="M964 640C900 680 808 682 735 643" fill="none" stroke="#00a870" stroke-width="3" marker-end="url(#arrowGreen)"/>
92
+ <path d="M600 640V676" fill="none" stroke="#00a870" stroke-width="3"/>
93
+ <rect x="435" y="660" width="330" height="34" rx="17" fill="#e6fff5" stroke="#b6efd9"/>
94
+ <text x="600" y="682" text-anchor="middle" class="pill" fill="#00875a">↑ progress · questions · approvals · results</text>
95
+
96
+ <circle cx="70" cy="676" r="14" fill="#5b6ee1"/><text x="70" y="681" text-anchor="middle" class="step">1</text>
97
+ <text x="92" y="681" class="small">Choose a computer</text>
98
+ <circle cx="224" cy="676" r="14" fill="#5b6ee1"/><text x="224" y="681" text-anchor="middle" class="step">2</text>
99
+ <text x="246" y="681" class="small">Send scoped work</text>
100
+ <circle cx="990" cy="676" r="14" fill="#00a870"/><text x="990" y="681" text-anchor="middle" class="step">3</text>
101
+ <text x="1012" y="681" class="small">Return the result</text>
102
+ </svg>
package/package.json CHANGED
@@ -1,71 +1,75 @@
1
- {
2
- "name": "@aivin-labs/cli",
3
- "version": "1.0.11",
4
- "description": "aivin CLI - scaffold, run, and deploy Aivin plugins built on @aivin-labs/sdk",
5
- "type": "module",
6
- "bin": {
7
- "aivin": "bin/cli.mjs"
8
- },
9
- "scripts": {
10
- "lint": "eslint .",
11
- "format": "prettier --write .",
12
- "test": "node --test test/*.test.mjs",
13
- "build:binary": "bun scripts/build-binary.mjs",
14
- "release:fetch": "node scripts/release-fetch.mjs",
15
- "sign:release": "node scripts/sign-release.mjs",
16
- "get:publish": "node scripts/publish-get.mjs",
17
- "get:rollout": "node scripts/rollout-get.mjs",
18
- "get:up": "docker compose -f deploy/get/docker-compose.yml up -d"
19
- },
20
- "keywords": [
21
- "aivin",
22
- "plugin",
23
- "cli",
24
- "sdk",
25
- "scaffold"
26
- ],
27
- "author": "Aivin Team",
28
- "license": "MIT",
29
- "dependencies": {
30
- "@aivin-labs/sdk": "^1.1.2",
31
- "axios": "^1.18.1",
32
- "chalk": "^5.6.2",
33
- "commander": "^15.0.0",
34
- "dotenv": "^17.4.2",
35
- "https-proxy-agent": "^7.0.6",
36
- "ink": "^7.1.1",
37
- "ink-text-input": "^6.0.0",
38
- "inquirer": "^14.0.2",
39
- "react": "^19.2.8",
40
- "socket.io-client": "^4.8.3",
41
- "ws": "^8.18.0",
42
- "yaml": "^2.8.1"
43
- },
44
- "devDependencies": {
45
- "@eslint/js": "^10.0.1",
46
- "bun": "^1.4.4",
47
- "eslint": "^10.8.0",
48
- "eslint-config-prettier": "^10.1.8",
49
- "globals": "^17.7.0",
50
- "prettier": "^3.9.6"
51
- },
52
- "files": [
53
- "bin/**/*",
54
- "docs/**/*",
55
- "README.md"
56
- ],
57
- "publishConfig": {
58
- "access": "public"
59
- },
60
- "engines": {
61
- "node": ">=22.0.0"
62
- },
63
- "repository": {
64
- "type": "git",
65
- "url": "git+https://github.com/aivin-labs/cli.git"
66
- },
67
- "bugs": {
68
- "url": "https://github.com/aivin-labs/cli/issues"
69
- },
70
- "homepage": "https://github.com/aivin-labs/cli#readme"
71
- }
1
+ {
2
+ "name": "@aivin-labs/cli",
3
+ "version": "1.0.21",
4
+ "description": "aivin CLI - scaffold, run, and deploy Aivin plugins built on @aivin-labs/sdk",
5
+ "type": "module",
6
+ "bin": {
7
+ "aivin": "bin/cli.mjs"
8
+ },
9
+ "scripts": {
10
+ "lint": "eslint .",
11
+ "format": "prettier --write .",
12
+ "test": "node --test test/*.test.mjs",
13
+ "build:binary": "bun scripts/build-binary.mjs",
14
+ "release:fetch": "node scripts/release-fetch.mjs",
15
+ "sign:release": "node scripts/sign-release.mjs",
16
+ "get:publish": "node scripts/publish-get.mjs",
17
+ "get:rollout": "node scripts/rollout-get.mjs",
18
+ "get:up": "docker compose -f deploy/get/docker-compose.yml up -d",
19
+ "publish:all": "node scripts/sign-release.mjs && node scripts/publish-get.mjs && npm publish"
20
+ },
21
+ "keywords": [
22
+ "aivin",
23
+ "plugin",
24
+ "cli",
25
+ "sdk",
26
+ "scaffold"
27
+ ],
28
+ "author": "Aivin Team",
29
+ "license": "MIT",
30
+ "dependencies": {
31
+ "@aivin-labs/sdk": "^1.1.2",
32
+ "axios": "^1.18.1",
33
+ "chalk": "^5.6.2",
34
+ "commander": "^15.0.0",
35
+ "dotenv": "^17.4.2",
36
+ "https-proxy-agent": "^7.0.6",
37
+ "ink": "^7.1.1",
38
+ "ink-text-input": "^6.0.0",
39
+ "inquirer": "^14.0.2",
40
+ "react": "^19.2.8",
41
+ "socket.io-client": "^4.8.3",
42
+ "ws": "^8.18.0",
43
+ "yaml": "^2.8.1"
44
+ },
45
+ "devDependencies": {
46
+ "@eslint/js": "^10.0.1",
47
+ "bun": "^1.4.4",
48
+ "eslint": "^10.8.0",
49
+ "eslint-config-prettier": "^10.1.8",
50
+ "globals": "^17.7.0",
51
+ "prettier": "^3.9.6"
52
+ },
53
+ "files": [
54
+ "bin/**/*",
55
+ "docs/**/*",
56
+ "README.md"
57
+ ],
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
61
+ "engines": {
62
+ "node": ">=22.13.0"
63
+ },
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "git+https://github.com/aivin-labs/cli.git"
67
+ },
68
+ "bugs": {
69
+ "url": "https://github.com/aivin-labs/cli/issues"
70
+ },
71
+ "homepage": "https://github.com/aivin-labs/cli#readme",
72
+ "optionalDependencies": {
73
+ "@roamhq/wrtc": "^0.10.0"
74
+ }
75
+ }
Binary file