@bctrl/cli 0.1.7 → 0.1.9
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 +17 -89
- package/dist/api/client.d.ts +1 -0
- package/dist/api/client.js +1 -0
- package/dist/api/errors.js +2 -2
- package/dist/bin/bctrl.js +0 -0
- package/dist/commands/{vault → account}/index.d.ts +1 -1
- package/dist/commands/account/index.js +21 -0
- package/dist/commands/ai/index.js +13 -8
- package/dist/commands/api-key/index.js +1 -1
- package/dist/commands/browser-extension/index.js +8 -8
- package/dist/commands/conversation/index.d.ts +3 -0
- package/dist/commands/conversation/index.js +51 -0
- package/dist/commands/file/index.js +8 -3
- package/dist/commands/run/index.js +23 -292
- package/dist/commands/runtime/index.js +32 -453
- package/dist/commands/shared/operation.d.ts +3 -0
- package/dist/commands/shared/operation.js +20 -7
- package/dist/commands/space/index.js +0 -25
- package/dist/commands/subaccount/index.js +2 -2
- package/dist/commands/tool/index.js +15 -5
- package/dist/commands/tool-call/index.js +22 -6
- package/dist/commands/toolset/index.js +1 -1
- package/dist/commands/view/index.d.ts +3 -0
- package/dist/commands/view/index.js +26 -0
- package/dist/commands/webhook/index.d.ts +3 -0
- package/dist/commands/webhook/index.js +64 -0
- package/dist/generated/help.d.ts +4896 -5977
- package/dist/generated/help.js +6208 -7532
- package/dist/generated/openapi-routes.d.ts +114 -142
- package/dist/generated/openapi-routes.js +37 -44
- package/dist/generated/openapi-types.d.ts +4451 -5302
- package/dist/root.js +8 -2
- package/package.json +14 -12
- package/dist/commands/vault/index.js +0 -171
|
@@ -2,7 +2,7 @@ import { Command } from 'commander';
|
|
|
2
2
|
import { parsePositiveInteger } from '../shared/options.js';
|
|
3
3
|
import { createOperationDeleteCommand, createOperationJsonBodyCommand, createOperationListCommand, createOperationViewCommand, } from '../shared/operation.js';
|
|
4
4
|
export function createToolCommand(factory) {
|
|
5
|
-
const command = new Command('
|
|
5
|
+
const command = new Command('tools').description('Manage tools');
|
|
6
6
|
command.addCommand(createOperationListCommand(factory, {
|
|
7
7
|
operationId: 'tools.list',
|
|
8
8
|
description: 'List tools',
|
|
@@ -33,10 +33,20 @@ export function createToolCommand(factory) {
|
|
|
33
33
|
argNames: ['id'],
|
|
34
34
|
}));
|
|
35
35
|
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
36
|
-
operationId: 'tools.
|
|
37
|
-
name: '
|
|
38
|
-
description: '
|
|
39
|
-
argNames: ['
|
|
36
|
+
operationId: 'tools.call',
|
|
37
|
+
name: 'call',
|
|
38
|
+
description: 'Call a tool and wait for its result',
|
|
39
|
+
argNames: ['toolRef'],
|
|
40
|
+
configure: (cmd) => cmd.option('--runtime <id>', 'Runtime whose active Run should execute the Tool'),
|
|
41
|
+
runtimeId: (_args, options) => typeof options.runtime === 'string' ? options.runtime : undefined,
|
|
42
|
+
}));
|
|
43
|
+
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
44
|
+
operationId: 'tools.calls.create',
|
|
45
|
+
name: 'start',
|
|
46
|
+
description: 'Start an asynchronous tool call',
|
|
47
|
+
argNames: ['toolRef'],
|
|
48
|
+
configure: (cmd) => cmd.option('--runtime <id>', 'Runtime whose active Run should execute the Tool'),
|
|
49
|
+
runtimeId: (_args, options) => typeof options.runtime === 'string' ? options.runtime : undefined,
|
|
40
50
|
}));
|
|
41
51
|
command.addCommand(createOperationDeleteCommand(factory, {
|
|
42
52
|
operationId: 'tools.delete',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { createOperationListCommand, createOperationViewCommand } from '../shared/operation.js';
|
|
2
|
+
import { createOperationJsonBodyCommand, createOperationListCommand, createOperationViewCommand, } from '../shared/operation.js';
|
|
3
3
|
export function createToolCallCommand(factory) {
|
|
4
|
-
const command = new Command('tool-
|
|
4
|
+
const command = new Command('tool-calls').description('Inspect BCTRL tool calls');
|
|
5
5
|
command.addCommand(createOperationListCommand(factory, {
|
|
6
6
|
operationId: 'tool-calls.list',
|
|
7
7
|
description: 'List tool calls',
|
|
@@ -9,18 +9,34 @@ export function createToolCallCommand(factory) {
|
|
|
9
9
|
.option('--space <id>', 'Space id')
|
|
10
10
|
.option('--tool <id>', 'Filter by tool id')
|
|
11
11
|
.option('--run <id>', 'Filter by run id')
|
|
12
|
-
.option('--invocation <id>', 'Filter by invocation id')
|
|
13
12
|
.option('--status <status>', 'Filter by status')
|
|
14
|
-
.option('--
|
|
13
|
+
.option('--caller-type <type>', 'Filter by caller type'),
|
|
15
14
|
query: (options) => ({
|
|
16
15
|
spaceId: typeof options.space === 'string' ? options.space : undefined,
|
|
17
16
|
toolId: typeof options.tool === 'string' ? options.tool : undefined,
|
|
18
17
|
runId: typeof options.run === 'string' ? options.run : undefined,
|
|
19
|
-
invocationId: typeof options.invocation === 'string' ? options.invocation : undefined,
|
|
20
18
|
status: typeof options.status === 'string' ? options.status : undefined,
|
|
21
|
-
|
|
19
|
+
callerType: typeof options.callerType === 'string' ? options.callerType : undefined,
|
|
22
20
|
}),
|
|
23
21
|
}));
|
|
22
|
+
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
23
|
+
operationId: 'tool-calls.cancel',
|
|
24
|
+
name: 'cancel',
|
|
25
|
+
description: 'Cancel a tool call',
|
|
26
|
+
argNames: ['toolCallId'],
|
|
27
|
+
}));
|
|
28
|
+
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
29
|
+
operationId: 'tool-calls.respond',
|
|
30
|
+
name: 'respond',
|
|
31
|
+
description: 'Respond to a tool input request',
|
|
32
|
+
argNames: ['toolCallId'],
|
|
33
|
+
}));
|
|
34
|
+
command.addCommand(createOperationViewCommand(factory, {
|
|
35
|
+
operationId: 'tool-calls.result',
|
|
36
|
+
name: 'result',
|
|
37
|
+
description: 'Wait for and return a tool call result',
|
|
38
|
+
argName: 'toolCallId',
|
|
39
|
+
}));
|
|
24
40
|
command.addCommand(createOperationViewCommand(factory, {
|
|
25
41
|
operationId: 'tool-calls.get',
|
|
26
42
|
name: 'get',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { createOperationDeleteCommand, createOperationJsonBodyCommand, createOperationListCommand, createOperationViewCommand, } from '../shared/operation.js';
|
|
3
3
|
export function createToolsetCommand(factory) {
|
|
4
|
-
const command = new Command('
|
|
4
|
+
const command = new Command('toolsets').description('Manage BCTRL toolsets');
|
|
5
5
|
command.addCommand(createOperationListCommand(factory, {
|
|
6
6
|
operationId: 'toolsets.list',
|
|
7
7
|
description: 'List toolsets',
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { createOperationDeleteCommand, createOperationJsonBodyCommand, createOperationListCommand, createOperationViewCommand, } from "../shared/operation.js";
|
|
3
|
+
export function createViewsCommand(factory) {
|
|
4
|
+
const command = new Command("view").description("Manage expiring human-facing views");
|
|
5
|
+
command.addCommand(createOperationListCommand(factory, {
|
|
6
|
+
operationId: "views.list",
|
|
7
|
+
description: "List active views",
|
|
8
|
+
}));
|
|
9
|
+
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
10
|
+
operationId: "views.create",
|
|
11
|
+
name: "create",
|
|
12
|
+
description: "Create a hosted link or origin-restricted website embed (pass scope, components, presentation, and TTL with --body)",
|
|
13
|
+
}));
|
|
14
|
+
command.addCommand(createOperationViewCommand(factory, {
|
|
15
|
+
operationId: "views.get",
|
|
16
|
+
name: "get",
|
|
17
|
+
description: "Get a view",
|
|
18
|
+
argName: "viewId",
|
|
19
|
+
}));
|
|
20
|
+
command.addCommand(createOperationDeleteCommand(factory, {
|
|
21
|
+
operationId: "views.delete",
|
|
22
|
+
description: "Revoke a view",
|
|
23
|
+
argNames: ["viewId"],
|
|
24
|
+
}));
|
|
25
|
+
return command;
|
|
26
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { addOutputFlags } from '../shared/output.js';
|
|
3
|
+
import { addPaginationFlags, buildOperationInput, createOperationDeleteCommand, createOperationJsonBodyCommand, createOperationListCommand, createOperationViewCommand, outputFlags, requestOperationAndPrint, } from '../shared/operation.js';
|
|
4
|
+
export function createWebhookCommand(factory) {
|
|
5
|
+
const command = new Command('webhook').description('Manage signed webhook deliveries');
|
|
6
|
+
command.addCommand(createOperationListCommand(factory, {
|
|
7
|
+
operationId: 'webhooks.list',
|
|
8
|
+
description: 'List webhooks',
|
|
9
|
+
}));
|
|
10
|
+
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
11
|
+
operationId: 'webhooks.create',
|
|
12
|
+
name: 'create',
|
|
13
|
+
description: 'Create a webhook (the signing secret is returned once)',
|
|
14
|
+
}));
|
|
15
|
+
command.addCommand(createOperationViewCommand(factory, {
|
|
16
|
+
operationId: 'webhooks.get',
|
|
17
|
+
name: 'get',
|
|
18
|
+
description: 'Get a webhook',
|
|
19
|
+
argName: 'webhookId',
|
|
20
|
+
}));
|
|
21
|
+
command.addCommand(createOperationJsonBodyCommand(factory, {
|
|
22
|
+
operationId: 'webhooks.update',
|
|
23
|
+
name: 'patch',
|
|
24
|
+
description: 'Update a webhook',
|
|
25
|
+
argNames: ['webhookId'],
|
|
26
|
+
}));
|
|
27
|
+
command.addCommand(createOperationDeleteCommand(factory, {
|
|
28
|
+
operationId: 'webhooks.delete',
|
|
29
|
+
description: 'Delete a webhook',
|
|
30
|
+
argNames: ['webhookId'],
|
|
31
|
+
}));
|
|
32
|
+
command.addCommand(createWebhookActionCommand(factory, 'rotate-secret', 'Rotate a webhook signing secret', 'webhooks.rotate-secret'));
|
|
33
|
+
command.addCommand(createWebhookActionCommand(factory, 'test', 'Queue a test delivery', 'webhooks.test'));
|
|
34
|
+
const deliveries = new Command('deliveries').description('Inspect webhook deliveries');
|
|
35
|
+
deliveries.addCommand(addOutputFlags(addPaginationFlags(new Command('list').description('List webhook deliveries').argument('<webhookId>'))).action(async (webhookId, options) => {
|
|
36
|
+
await requestOperationAndPrint(factory, 'webhooks.deliveries.list', await buildOperationInput('webhooks.deliveries.list', options, {
|
|
37
|
+
pathParams: { webhookId },
|
|
38
|
+
query: {
|
|
39
|
+
limit: options.limit,
|
|
40
|
+
cursor: options.cursor,
|
|
41
|
+
},
|
|
42
|
+
output: outputFlags(options),
|
|
43
|
+
}));
|
|
44
|
+
}));
|
|
45
|
+
deliveries.addCommand(addOutputFlags(new Command('redeliver')
|
|
46
|
+
.description('Queue a webhook delivery again')
|
|
47
|
+
.argument('<webhookId>')
|
|
48
|
+
.argument('<deliveryId>')).action(async (webhookId, deliveryId, options) => {
|
|
49
|
+
await requestOperationAndPrint(factory, 'webhooks.deliveries.redeliver', await buildOperationInput('webhooks.deliveries.redeliver', options, {
|
|
50
|
+
pathParams: { webhookId, deliveryId },
|
|
51
|
+
output: outputFlags(options),
|
|
52
|
+
}));
|
|
53
|
+
}));
|
|
54
|
+
command.addCommand(deliveries);
|
|
55
|
+
return command;
|
|
56
|
+
}
|
|
57
|
+
function createWebhookActionCommand(factory, name, description, operationId) {
|
|
58
|
+
return addOutputFlags(new Command(name).description(description).argument('<webhookId>')).action(async (webhookId, options) => {
|
|
59
|
+
await requestOperationAndPrint(factory, operationId, await buildOperationInput(operationId, options, {
|
|
60
|
+
pathParams: { webhookId },
|
|
61
|
+
output: outputFlags(options),
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
}
|