@bctrl/cli 0.1.3 → 0.1.4

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 (42) hide show
  1. package/README.md +95 -95
  2. package/dist/api/auth.d.ts +5 -6
  3. package/dist/api/auth.js +4 -5
  4. package/dist/api/client.d.ts +1 -0
  5. package/dist/api/client.js +3 -0
  6. package/dist/api/errors.js +2 -2
  7. package/dist/bin/bctrl.js +0 -0
  8. package/dist/commands/ai/index.js +59 -102
  9. package/dist/commands/{browser → api-key}/index.d.ts +1 -1
  10. package/dist/commands/api-key/index.js +47 -0
  11. package/dist/commands/auth/login.js +2 -1
  12. package/dist/commands/auth/status.js +5 -0
  13. package/dist/commands/browser-extension/index.d.ts +3 -0
  14. package/dist/commands/browser-extension/index.js +86 -0
  15. package/dist/commands/file/index.js +9 -3
  16. package/dist/commands/{invocation → help}/index.d.ts +1 -1
  17. package/dist/commands/help/index.js +17 -0
  18. package/dist/commands/proxy/index.d.ts +3 -0
  19. package/dist/commands/proxy/index.js +66 -0
  20. package/dist/commands/run/index.js +205 -155
  21. package/dist/commands/runtime/index.js +274 -78
  22. package/dist/commands/shared/help.js +1 -1
  23. package/dist/commands/shared/rest.d.ts +1 -0
  24. package/dist/commands/shared/rest.js +14 -6
  25. package/dist/commands/space/index.js +17 -32
  26. package/dist/commands/space/list.d.ts +1 -11
  27. package/dist/commands/space/list.js +14 -23
  28. package/dist/commands/subaccount/index.js +29 -80
  29. package/dist/commands/tool/index.js +15 -7
  30. package/dist/commands/tool-call/index.js +6 -1
  31. package/dist/commands/toolset/index.js +6 -3
  32. package/dist/commands/usage/index.d.ts +3 -0
  33. package/dist/commands/usage/index.js +13 -0
  34. package/dist/commands/vault/index.js +104 -25
  35. package/dist/config/auth-store.d.ts +10 -12
  36. package/dist/config/auth-store.js +4 -5
  37. package/dist/generated/help.d.ts +132 -46
  38. package/dist/generated/help.js +192 -54
  39. package/dist/root.js +10 -4
  40. package/package.json +47 -45
  41. package/dist/commands/browser/index.js +0 -53
  42. package/dist/commands/invocation/index.js +0 -36
package/package.json CHANGED
@@ -1,45 +1,47 @@
1
- {
2
- "name": "@bctrl/cli",
3
- "version": "0.1.3",
4
- "description": "BCTRL command-line interface",
5
- "type": "module",
6
- "bin": {
7
- "bctrl": "./dist/bin/bctrl.js"
8
- },
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js"
13
- }
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "keywords": [
19
- "bctrl",
20
- "cli",
21
- "browser-automation",
22
- "agents"
23
- ],
24
- "author": "",
25
- "license": "ISC",
26
- "dependencies": {
27
- "commander": "^14.0.3",
28
- "handlebars": "^4.7.9",
29
- "jq-web": "^0.6.2",
30
- "zod": "^4.4.3"
31
- },
32
- "devDependencies": {
33
- "@types/node": "^25.7.0",
34
- "tsx": "^4.21.0",
35
- "typescript": "^6.0.3"
36
- },
37
- "scripts": {
38
- "clean": "rm -rf dist",
39
- "build": "pnpm run clean && tsc -p tsconfig.json",
40
- "dev": "tsx src/bin/bctrl.ts",
41
- "test": "tsx --test \"tests/**/*.test.ts\"",
42
- "typecheck": "tsc --noEmit",
43
- "typecheck:tests": "tsc --noEmit -p tests/tsconfig.json"
44
- }
45
- }
1
+ {
2
+ "name": "@bctrl/cli",
3
+ "version": "0.1.4",
4
+ "description": "BCTRL command-line interface",
5
+ "type": "module",
6
+ "bin": {
7
+ "bctrl": "./dist/bin/bctrl.js"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
20
+ "build": "pnpm run clean && tsc -p tsconfig.json",
21
+ "dev": "tsx src/bin/bctrl.ts",
22
+ "prepack": "pnpm run build",
23
+ "test": "tsx --test \"tests/**/*.test.ts\"",
24
+ "typecheck": "tsc --noEmit",
25
+ "typecheck:tests": "tsc --noEmit -p tests/tsconfig.json"
26
+ },
27
+ "keywords": [
28
+ "bctrl",
29
+ "cli",
30
+ "browser-automation",
31
+ "agents"
32
+ ],
33
+ "author": "",
34
+ "license": "ISC",
35
+ "packageManager": "pnpm@10.12.4",
36
+ "dependencies": {
37
+ "commander": "^14.0.3",
38
+ "handlebars": "^4.7.9",
39
+ "jq-web": "^0.6.2",
40
+ "zod": "^4.4.3"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^25.7.0",
44
+ "tsx": "^4.21.0",
45
+ "typescript": "^6.0.3"
46
+ }
47
+ }
@@ -1,53 +0,0 @@
1
- import { Command } from 'commander';
2
- import { readBlob, readJsonFile } from '../shared/io.js';
3
- import { addOutputFlags, outputData } from '../shared/output.js';
4
- import { createDeleteCommand, createJsonBodyCommand, createListCommand, createViewCommand, } from '../shared/rest.js';
5
- export function createBrowserCommand(factory) {
6
- const command = new Command('browser').description('Manage browser resources');
7
- command.addCommand(createBrowserExtensionCommand(factory));
8
- return command;
9
- }
10
- function createBrowserExtensionCommand(factory) {
11
- const command = new Command('extension').description('Manage browser extensions');
12
- command.addCommand(createListCommand(factory, {
13
- description: 'List browser extensions',
14
- path: '/browser-extensions',
15
- configure: (cmd) => cmd,
16
- }));
17
- command.addCommand(createViewCommand(factory, {
18
- description: 'View a browser extension',
19
- path: '/browser-extensions/{id}',
20
- }));
21
- command.addCommand(addOutputFlags(new Command('upload')
22
- .description('Upload a browser extension package')
23
- .argument('<path>'))
24
- .action(async (path, options) => {
25
- const client = await factory.apiClient();
26
- const file = await readBlob(path);
27
- const result = await client.uploadFile('/browser-extensions/upload', {
28
- file: file.blob,
29
- fileName: file.fileName,
30
- });
31
- await outputData(factory.io, result, options);
32
- }));
33
- command.addCommand(createJsonBodyCommand(factory, {
34
- name: 'import',
35
- description: 'Import a browser extension from a URL',
36
- method: 'post',
37
- path: '/browser-extensions/import',
38
- configure: (cmd) => cmd
39
- .option('--url <url>', 'Extension URL')
40
- .option('--input <path>', 'Read full JSON request body from file, or - for stdin'),
41
- body: async (_args, options) => {
42
- if (typeof options.input === 'string') {
43
- return readJsonFile(options.input);
44
- }
45
- return { source: { type: 'url', url: options.url } };
46
- },
47
- }));
48
- command.addCommand(createDeleteCommand(factory, {
49
- description: 'Delete a browser extension',
50
- path: '/browser-extensions/{id}',
51
- }));
52
- return command;
53
- }
@@ -1,36 +0,0 @@
1
- import { Command } from 'commander';
2
- import { readJsonFile } from '../shared/io.js';
3
- import { addOutputFlags } from '../shared/output.js';
4
- import { createJsonBodyCommand, createViewCommand, requestAndPrint } from '../shared/rest.js';
5
- export function createInvocationCommand(factory) {
6
- const command = new Command('invocation')
7
- .description('Inspect and control BCTRL invocations');
8
- command.addCommand(createViewCommand(factory, {
9
- description: 'View an invocation',
10
- path: '/invocations/{id}',
11
- }));
12
- command.addCommand(createJsonBodyCommand(factory, {
13
- name: 'wait',
14
- description: 'Wait for an invocation',
15
- method: 'post',
16
- path: '/invocations/{id}/wait',
17
- argNames: ['id'],
18
- configure: (cmd) => cmd
19
- .option('--timeout-ms <ms>', 'Timeout in milliseconds')
20
- .option('--input <path>', 'Read JSON request body from file, or - for stdin'),
21
- body: async (_args, options) => {
22
- if (typeof options.input === 'string')
23
- return readJsonFile(options.input);
24
- return { timeoutMs: options.timeoutMs ? Number(options.timeoutMs) : undefined };
25
- },
26
- }));
27
- command.addCommand(addOutputFlags(new Command('cancel')
28
- .description('Cancel an invocation')
29
- .argument('<id>'))
30
- .action(async (id, options) => {
31
- await requestAndPrint(factory, 'post', `/invocations/${encodeURIComponent(id)}/cancel`, {
32
- output: options,
33
- });
34
- }));
35
- return command;
36
- }