@ant0/cli 0.0.0-stage → 0.3.22-beta.3
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/LICENSE +28 -0
- package/README.md +97 -2
- package/dist/api/generated/schema.d.ts +11600 -0
- package/dist/api/generated/schema.js +6 -0
- package/dist/api/index.d.ts +219 -0
- package/dist/api/index.js +342 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.js +12 -0
- package/dist/bulk.d.ts +38 -0
- package/dist/bulk.js +66 -0
- package/dist/commands/account.d.ts +48 -0
- package/dist/commands/account.js +337 -0
- package/dist/commands/api-keys.d.ts +5 -0
- package/dist/commands/api-keys.js +310 -0
- package/dist/commands/browsers.d.ts +4 -0
- package/dist/commands/browsers.js +165 -0
- package/dist/commands/daemon.d.ts +15 -0
- package/dist/commands/daemon.js +202 -0
- package/dist/commands/events.d.ts +8 -0
- package/dist/commands/events.js +81 -0
- package/dist/commands/extensions.d.ts +4 -0
- package/dist/commands/extensions.js +74 -0
- package/dist/commands/profiles.d.ts +36 -0
- package/dist/commands/profiles.js +552 -0
- package/dist/commands/proxies.d.ts +23 -0
- package/dist/commands/proxies.js +170 -0
- package/dist/commands/sync.d.ts +4 -0
- package/dist/commands/sync.js +435 -0
- package/dist/commands/team.d.ts +7 -0
- package/dist/commands/team.js +403 -0
- package/dist/commands/trash.d.ts +10 -0
- package/dist/commands/trash.js +54 -0
- package/dist/commands/workspace.d.ts +10 -0
- package/dist/commands/workspace.js +56 -0
- package/dist/context.d.ts +111 -0
- package/dist/context.js +300 -0
- package/dist/errors.d.ts +27 -0
- package/dist/errors.js +96 -0
- package/dist/format.d.ts +23 -0
- package/dist/format.js +85 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +35 -0
- package/dist/inventory.d.ts +50 -0
- package/dist/inventory.js +202 -0
- package/dist/management-transport.d.ts +3 -0
- package/dist/management-transport.js +90 -0
- package/dist/native-terminal.d.ts +50 -0
- package/dist/native-terminal.js +228 -0
- package/dist/program.d.ts +10 -0
- package/dist/program.js +185 -0
- package/dist/runtime-types.d.ts +20 -0
- package/dist/runtime-types.js +2 -0
- package/dist/set.d.ts +15 -0
- package/dist/set.js +87 -0
- package/dist/shared/parse-error.d.ts +6 -0
- package/dist/shared/parse-error.js +8 -0
- package/dist/shared/proxy-parse.d.ts +42 -0
- package/dist/shared/proxy-parse.js +238 -0
- package/dist/shared/proxy-types.d.ts +21 -0
- package/dist/shared/proxy-types.js +2 -0
- package/dist/shared/recovery-code.d.ts +7 -0
- package/dist/shared/recovery-code.js +53 -0
- package/dist/version.d.ts +8 -0
- package/dist/version.js +18 -0
- package/licenses/README.md +5 -0
- package/licenses/THIRD_PARTY_NOTICES +96 -0
- package/package.json +63 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ParseError } from "./parse-error.js";
|
|
2
|
+
/** A recovery code encodes exactly this many raw bytes. */
|
|
3
|
+
export const RECOVERY_CODE_BYTES = 32;
|
|
4
|
+
const BASE32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
5
|
+
/** Format 32 raw bytes as 13 dash-separated groups of four base32 characters. */
|
|
6
|
+
export function formatRecoveryCode(raw) {
|
|
7
|
+
if (raw.length !== RECOVERY_CODE_BYTES)
|
|
8
|
+
throw new ParseError("recovery code must be 32 bytes");
|
|
9
|
+
let bits = 0;
|
|
10
|
+
let value = 0;
|
|
11
|
+
let encoded = "";
|
|
12
|
+
for (const byte of raw) {
|
|
13
|
+
value = (value << 8) | byte;
|
|
14
|
+
bits += 8;
|
|
15
|
+
while (bits >= 5) {
|
|
16
|
+
encoded += BASE32[(value >>> (bits - 5)) & 31];
|
|
17
|
+
bits -= 5;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (bits > 0)
|
|
21
|
+
encoded += BASE32[(value << (5 - bits)) & 31];
|
|
22
|
+
return encoded.match(/.{4}/g).join("-");
|
|
23
|
+
}
|
|
24
|
+
/** Parse a recovery code (dashes and case ignored) back to its 32 raw bytes. */
|
|
25
|
+
export function parseRecoveryCode(text) {
|
|
26
|
+
if (typeof text !== "string" || text.length > 128 || /[^A-Za-z2-7-]/.test(text)) {
|
|
27
|
+
throw new ParseError("recovery code contains an invalid character");
|
|
28
|
+
}
|
|
29
|
+
const encoded = text.replaceAll("-", "").toUpperCase();
|
|
30
|
+
if (encoded.length !== 52)
|
|
31
|
+
throw new ParseError("recovery code must contain 52 base32 characters");
|
|
32
|
+
const out = Buffer.alloc(RECOVERY_CODE_BYTES);
|
|
33
|
+
let bits = 0;
|
|
34
|
+
let value = 0;
|
|
35
|
+
let offset = 0;
|
|
36
|
+
for (const char of encoded) {
|
|
37
|
+
const digit = BASE32.indexOf(char);
|
|
38
|
+
if (digit < 0)
|
|
39
|
+
throw new ParseError("recovery code contains an invalid base32 character");
|
|
40
|
+
value = (value << 5) | digit;
|
|
41
|
+
bits += 5;
|
|
42
|
+
if (bits >= 8) {
|
|
43
|
+
bits -= 8;
|
|
44
|
+
if (offset < out.length)
|
|
45
|
+
out[offset++] = (value >>> bits) & 0xff;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (offset !== RECOVERY_CODE_BYTES || bits !== 4 || (value & 0x0f) !== 0) {
|
|
49
|
+
throw new ParseError("recovery code has non-zero unused base32 bits");
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=recovery-code.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** What `ant0 --version` prints: the Ant0 release this CLI belongs to, else the package version. */
|
|
2
|
+
export declare const CLI_VERSION: string;
|
|
3
|
+
/**
|
|
4
|
+
* A warning when the daemon and the CLI differ in major.minor (the local API is not versioned
|
|
5
|
+
* separately), else undefined. Unparseable versions never warn.
|
|
6
|
+
*/
|
|
7
|
+
export declare function versionSkewWarning(daemonVersion: string, cliVersion?: string): string | undefined;
|
|
8
|
+
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** What `ant0 --version` prints: the Ant0 release this CLI belongs to, else the package version. */
|
|
2
|
+
export const CLI_VERSION = typeof __ANT0_VERSION__ === "string" ? __ANT0_VERSION__ : "0.3.22-beta.3";
|
|
3
|
+
function majorMinor(version) {
|
|
4
|
+
return /^(\d+)\.(\d+)(?:\.|-|$)/.exec(version)?.slice(1, 3).join(".");
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A warning when the daemon and the CLI differ in major.minor (the local API is not versioned
|
|
8
|
+
* separately), else undefined. Unparseable versions never warn.
|
|
9
|
+
*/
|
|
10
|
+
export function versionSkewWarning(daemonVersion, cliVersion = CLI_VERSION) {
|
|
11
|
+
const daemon = majorMinor(daemonVersion);
|
|
12
|
+
const cli = majorMinor(cliVersion);
|
|
13
|
+
if (daemon === undefined || cli === undefined || daemon === cli)
|
|
14
|
+
return undefined;
|
|
15
|
+
return (`warning: the daemon is version ${daemonVersion} but this CLI is ${cliVersion}; ` +
|
|
16
|
+
"commands may fail until both are on the same release");
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Dependency notices
|
|
2
|
+
|
|
3
|
+
`THIRD_PARTY_NOTICES` holds the licence and notice files of this package's runtime dependencies,
|
|
4
|
+
copied unchanged from the installed packages. `pnpm generate:notices` rewrites it from `node_modules`;
|
|
5
|
+
CI does not edit it. It ships in the npm package.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
THIRD-PARTY NOTICES
|
|
2
|
+
|
|
3
|
+
This package depends on the packages below; npm installs them next to it. Each
|
|
4
|
+
package's licence and notice files follow, copied unchanged from the package.
|
|
5
|
+
|
|
6
|
+
==============================================================================
|
|
7
|
+
@ant0/mcp@0.3.22-beta.2 (BSD-3-Clause)
|
|
8
|
+
==============================================================================
|
|
9
|
+
|
|
10
|
+
--- LICENSE ---
|
|
11
|
+
|
|
12
|
+
BSD 3-Clause License
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2026, RENEWBYTE LABS LTD
|
|
15
|
+
|
|
16
|
+
Redistribution and use in source and binary forms, with or without
|
|
17
|
+
modification, are permitted provided that the following conditions are met:
|
|
18
|
+
|
|
19
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
20
|
+
list of conditions and the following disclaimer.
|
|
21
|
+
|
|
22
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
23
|
+
this list of conditions and the following disclaimer in the documentation
|
|
24
|
+
and/or other materials provided with the distribution.
|
|
25
|
+
|
|
26
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
27
|
+
contributors may be used to endorse or promote products derived from
|
|
28
|
+
this software without specific prior written permission.
|
|
29
|
+
|
|
30
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
31
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
32
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
33
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
34
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
35
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
36
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
37
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
38
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
39
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
40
|
+
|
|
41
|
+
==============================================================================
|
|
42
|
+
commander@15.0.0 (MIT)
|
|
43
|
+
==============================================================================
|
|
44
|
+
|
|
45
|
+
--- LICENSE ---
|
|
46
|
+
|
|
47
|
+
(The MIT License)
|
|
48
|
+
|
|
49
|
+
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
|
50
|
+
|
|
51
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
52
|
+
a copy of this software and associated documentation files (the
|
|
53
|
+
'Software'), to deal in the Software without restriction, including
|
|
54
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
55
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
56
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
57
|
+
the following conditions:
|
|
58
|
+
|
|
59
|
+
The above copyright notice and this permission notice shall be
|
|
60
|
+
included in all copies or substantial portions of the Software.
|
|
61
|
+
|
|
62
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
63
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
64
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
65
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
66
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
67
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
68
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
69
|
+
|
|
70
|
+
==============================================================================
|
|
71
|
+
openapi-fetch@0.17.0 (MIT)
|
|
72
|
+
==============================================================================
|
|
73
|
+
|
|
74
|
+
--- LICENSE ---
|
|
75
|
+
|
|
76
|
+
MIT License
|
|
77
|
+
|
|
78
|
+
Copyright (c) 2023 Drew Powers
|
|
79
|
+
|
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
81
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
82
|
+
in the Software without restriction, including without limitation the rights
|
|
83
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
84
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
85
|
+
furnished to do so, subject to the following conditions:
|
|
86
|
+
|
|
87
|
+
The above copyright notice and this permission notice shall be included in all
|
|
88
|
+
copies or substantial portions of the Software.
|
|
89
|
+
|
|
90
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
91
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
92
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
93
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
94
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
95
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
96
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant0/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.22-beta.3",
|
|
4
|
+
"description": "The Ant0 command line: profiles, proxies, browsers and more, over the local Ant0 API.",
|
|
5
|
+
"license": "BSD-3-Clause",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"private": false,
|
|
8
|
+
"homepage": "https://ant0.link",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Ant0-Browser/ant0-cli.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Ant0-Browser/ant0-cli/issues"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=24",
|
|
18
|
+
"pnpm": ">=10"
|
|
19
|
+
},
|
|
20
|
+
"packageManager": "pnpm@11.25.0",
|
|
21
|
+
"bin": {
|
|
22
|
+
"ant0": "./dist/bin.js"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"!dist/**/*.map",
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"README.md",
|
|
35
|
+
"licenses"
|
|
36
|
+
],
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"provenance": true
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.json",
|
|
43
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"lint": "prettier --check .",
|
|
46
|
+
"format": "prettier --write .",
|
|
47
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
48
|
+
"generate:api": "node scripts/generate-api.mjs",
|
|
49
|
+
"generate:notices": "node scripts/generate-notices.mjs",
|
|
50
|
+
"check:forbidden": "node scripts/check-forbidden.mjs"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@ant0/mcp": "0.3.22-beta.2",
|
|
54
|
+
"commander": "15.0.0",
|
|
55
|
+
"openapi-fetch": "0.17.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@modelcontextprotocol/client": "2.4.0",
|
|
59
|
+
"@types/node": "^24.13.3",
|
|
60
|
+
"openapi-typescript": "^7.13.0",
|
|
61
|
+
"prettier": "3.9.6",
|
|
62
|
+
"typescript": "^5.9.3",
|
|
63
|
+
"vitest": "^4.1.12"
|
|
64
|
+
}
|
|
65
|
+
}
|