plazbot-cli 0.2.25 → 0.3.1
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/CLAUDE.md +34 -5
- package/README.md +21 -0
- package/dist/cli.js +32 -20
- package/dist/commands/agent/ai-config.js +98 -50
- package/dist/commands/agent/chat.js +80 -74
- package/dist/commands/agent/copy.js +23 -21
- package/dist/commands/agent/create.js +42 -72
- package/dist/commands/agent/delete.js +29 -30
- package/dist/commands/agent/enable-widget.js +30 -26
- package/dist/commands/agent/export.js +90 -77
- package/dist/commands/agent/files.js +68 -60
- package/dist/commands/agent/get.js +101 -87
- package/dist/commands/agent/index.js +53 -39
- package/dist/commands/agent/list.js +26 -24
- package/dist/commands/agent/monitor.js +91 -86
- package/dist/commands/agent/on-message.js +40 -37
- package/dist/commands/agent/set.js +62 -59
- package/dist/commands/agent/templates.js +109 -108
- package/dist/commands/agent/tools.js +64 -65
- package/dist/commands/agent/update.js +28 -27
- package/dist/commands/agent/validate.js +127 -0
- package/dist/commands/agent/wizard.js +152 -159
- package/dist/commands/auth/index.js +7 -10
- package/dist/commands/auth/login.js +50 -37
- package/dist/commands/auth/logout.js +16 -14
- package/dist/commands/auth/status.js +19 -16
- package/dist/commands/portal/add-agent.js +26 -24
- package/dist/commands/portal/add-link.js +21 -17
- package/dist/commands/portal/clear-links.js +17 -15
- package/dist/commands/portal/create.js +25 -21
- package/dist/commands/portal/delete.js +31 -30
- package/dist/commands/portal/get.js +33 -31
- package/dist/commands/portal/index.js +30 -22
- package/dist/commands/portal/list.js +34 -30
- package/dist/commands/portal/update.js +41 -33
- package/dist/commands/whatsapp/broadcast.js +40 -37
- package/dist/commands/whatsapp/channels.js +40 -34
- package/dist/commands/whatsapp/chat.js +33 -32
- package/dist/commands/whatsapp/connect.js +59 -55
- package/dist/commands/whatsapp/delete-webhook.js +19 -17
- package/dist/commands/whatsapp/index.js +35 -25
- package/dist/commands/whatsapp/register-webhook.js +21 -19
- package/dist/commands/whatsapp/send-template.js +39 -31
- package/dist/commands/whatsapp/send.js +27 -23
- package/dist/commands/whatsapp/widget.js +35 -31
- package/dist/commands/workers/deploy.js +49 -44
- package/dist/commands/workers/index.js +28 -18
- package/dist/commands/workers/list.js +43 -35
- package/dist/commands/workers/logs.js +38 -32
- package/dist/commands/workers/remove.js +38 -37
- package/dist/commands/workers/secret.js +63 -58
- package/dist/commands/workers/test.js +44 -36
- package/dist/schemas/agent.config.schema.json +569 -0
- package/dist/studio/api/sseClient.js +97 -0
- package/dist/studio/api/studioApi.js +25 -0
- package/dist/studio/api/types.js +16 -0
- package/dist/studio/components/AgentPanel.js +35 -0
- package/dist/studio/components/App.js +214 -0
- package/dist/studio/components/ChatLog.js +59 -0
- package/dist/studio/components/Footer.js +11 -0
- package/dist/studio/components/Header.js +8 -0
- package/dist/studio/components/Input.js +15 -0
- package/dist/studio/components/Message.js +56 -0
- package/dist/studio/components/Suggestions.js +11 -0
- package/dist/studio/components/ToolCall.js +33 -0
- package/dist/studio/components/WhatsappConnectCard.js +57 -0
- package/dist/studio/index.js +42 -0
- package/dist/studio/render/json.js +16 -0
- package/dist/studio/render/markdown.js +32 -0
- package/dist/studio/render/steps.js +58 -0
- package/dist/studio/runOneShot.js +96 -0
- package/dist/studio/runRepl.js +52 -0
- package/dist/studio/slash/handlers.js +199 -0
- package/dist/studio/slash/parser.js +46 -0
- package/dist/studio/slash/registry.js +16 -0
- package/dist/studio/state/store.js +181 -0
- package/dist/studio/whatsapp/api.js +63 -0
- package/dist/studio/whatsapp/polling.js +77 -0
- package/dist/studio/whatsapp/types.js +31 -0
- package/dist/types/agent.js +1 -2
- package/dist/types/auth.js +1 -2
- package/dist/types/common.js +1 -2
- package/dist/types/message.js +1 -2
- package/dist/types/portal.js +1 -2
- package/dist/types/workers.js +1 -2
- package/dist/utils/agent-errors.js +46 -0
- package/dist/utils/api.js +8 -9
- package/dist/utils/banner.js +33 -34
- package/dist/utils/credentials.js +12 -20
- package/dist/utils/help.js +44 -0
- package/dist/utils/logger.js +13 -19
- package/dist/utils/ui.js +35 -49
- package/package.json +21 -10
- package/src/cli.ts +24 -8
- package/src/commands/agent/ai-config.ts +89 -34
- package/src/commands/agent/chat.ts +49 -37
- package/src/commands/agent/copy.ts +19 -13
- package/src/commands/agent/create.ts +32 -22
- package/src/commands/agent/delete.ts +24 -18
- package/src/commands/agent/enable-widget.ts +31 -23
- package/src/commands/agent/export.ts +72 -51
- package/src/commands/agent/files.ts +51 -39
- package/src/commands/agent/get.ts +86 -66
- package/src/commands/agent/index.ts +36 -18
- package/src/commands/agent/list.ts +22 -16
- package/src/commands/agent/monitor.ts +67 -56
- package/src/commands/agent/on-message.ts +36 -27
- package/src/commands/agent/set.ts +47 -37
- package/src/commands/agent/templates.ts +90 -82
- package/src/commands/agent/tools.ts +53 -47
- package/src/commands/agent/update.ts +28 -20
- package/src/commands/agent/validate.ts +135 -0
- package/src/commands/agent/wizard.ts +114 -114
- package/src/commands/auth/index.ts +3 -3
- package/src/commands/auth/login.ts +44 -29
- package/src/commands/auth/logout.ts +16 -10
- package/src/commands/auth/status.ts +14 -8
- package/src/commands/portal/add-agent.ts +23 -17
- package/src/commands/portal/add-link.ts +17 -9
- package/src/commands/portal/clear-links.ts +13 -7
- package/src/commands/portal/create.ts +20 -12
- package/src/commands/portal/delete.ts +28 -20
- package/src/commands/portal/get.ts +25 -19
- package/src/commands/portal/index.ts +22 -10
- package/src/commands/portal/list.ts +27 -19
- package/src/commands/portal/update.ts +38 -26
- package/src/commands/whatsapp/broadcast.ts +28 -18
- package/src/commands/whatsapp/channels.ts +31 -20
- package/src/commands/whatsapp/chat.ts +20 -12
- package/src/commands/whatsapp/connect.ts +48 -36
- package/src/commands/whatsapp/delete-webhook.ts +15 -9
- package/src/commands/whatsapp/index.ts +24 -10
- package/src/commands/whatsapp/register-webhook.ts +16 -10
- package/src/commands/whatsapp/send-template.ts +33 -21
- package/src/commands/whatsapp/send.ts +23 -15
- package/src/commands/whatsapp/widget.ts +25 -17
- package/src/commands/workers/deploy.ts +34 -22
- package/src/commands/workers/index.ts +21 -7
- package/src/commands/workers/list.ts +31 -19
- package/src/commands/workers/logs.ts +30 -20
- package/src/commands/workers/remove.ts +30 -22
- package/src/commands/workers/secret.ts +46 -34
- package/src/commands/workers/test.ts +34 -22
- package/src/schemas/agent.config.schema.json +569 -0
- package/src/studio/api/sseClient.ts +91 -0
- package/src/studio/api/studioApi.ts +27 -0
- package/src/studio/api/types.ts +96 -0
- package/src/studio/components/App.tsx +266 -0
- package/src/studio/components/ChatLog.tsx +95 -0
- package/src/studio/components/Footer.tsx +38 -0
- package/src/studio/components/Header.tsx +39 -0
- package/src/studio/components/Input.tsx +32 -0
- package/src/studio/components/Message.tsx +87 -0
- package/src/studio/components/Suggestions.tsx +26 -0
- package/src/studio/components/ToolCall.tsx +58 -0
- package/src/studio/components/WhatsappConnectCard.tsx +139 -0
- package/src/studio/index.ts +58 -0
- package/src/studio/render/markdown.ts +32 -0
- package/src/studio/render/steps.ts +57 -0
- package/src/studio/runOneShot.ts +114 -0
- package/src/studio/runRepl.tsx +76 -0
- package/src/studio/slash/handlers.ts +226 -0
- package/src/studio/slash/parser.ts +41 -0
- package/src/studio/slash/registry.ts +54 -0
- package/src/studio/state/store.ts +273 -0
- package/src/studio/whatsapp/api.ts +96 -0
- package/src/studio/whatsapp/polling.ts +93 -0
- package/src/studio/whatsapp/types.ts +80 -0
- package/src/types/agent.ts +1 -1
- package/src/types/auth.ts +4 -3
- package/src/types/portal.ts +1 -1
- package/src/types/workers.ts +1 -1
- package/src/utils/agent-errors.ts +67 -0
- package/src/utils/api.ts +6 -0
- package/src/utils/banner.ts +14 -9
- package/src/utils/credentials.ts +6 -5
- package/src/utils/help.ts +51 -0
- package/tsconfig.json +9 -6
|
@@ -1,27 +1,39 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { getStoredCredentials } from '../../utils/credentials';
|
|
3
|
-
import { createApiClient } from '../../utils/api';
|
|
4
|
-
import { logger } from '../../utils/logger';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { getStoredCredentials } from '../../utils/credentials.js';
|
|
3
|
+
import { createApiClient } from '../../utils/api.js';
|
|
4
|
+
import { logger } from '../../utils/logger.js';
|
|
5
|
+
import { addExamples } from '../../utils/help.js';
|
|
6
|
+
import { createSpinner, createTable, theme, formatDate } from '../../utils/ui.js';
|
|
7
|
+
import { WorkerSecretItem } from '../../types/workers.js';
|
|
7
8
|
import readline from 'readline';
|
|
8
9
|
|
|
9
10
|
// ── Comando padre: secret ───────────────────────────────────────────────────
|
|
10
11
|
|
|
11
12
|
export const secretCommand = new Command('secret')
|
|
12
|
-
.description('
|
|
13
|
+
.description('Manage worker secrets (environment variables)')
|
|
13
14
|
.addCommand(secretSetCommand())
|
|
14
15
|
.addCommand(secretListCommand())
|
|
15
16
|
.addCommand(secretRemoveCommand());
|
|
16
17
|
|
|
18
|
+
addExamples(secretCommand, [
|
|
19
|
+
{ description: 'Save (or update) an API key as a secret',
|
|
20
|
+
command: 'plazbot workers secret set STRIPE_API_KEY sk_live_xxxxx' },
|
|
21
|
+
{ description: 'List every secret (values are hidden)',
|
|
22
|
+
command: 'plazbot workers secret list' },
|
|
23
|
+
{ description: 'Delete a secret with confirmation prompt',
|
|
24
|
+
command: 'plazbot workers secret remove STRIPE_API_KEY' },
|
|
25
|
+
{ description: 'Delete a secret without confirmation',
|
|
26
|
+
command: 'plazbot workers secret remove STRIPE_API_KEY -f' },
|
|
27
|
+
]);
|
|
28
|
+
|
|
17
29
|
// ── secret set ──────────────────────────────────────────────────────────────
|
|
18
30
|
|
|
19
31
|
function secretSetCommand(): Command {
|
|
20
32
|
return new Command('set')
|
|
21
|
-
.description('
|
|
22
|
-
.argument('<key>', '
|
|
23
|
-
.argument('<value>', '
|
|
24
|
-
.option('--dev', '
|
|
33
|
+
.description('Create or update a secret')
|
|
34
|
+
.argument('<key>', 'Secret name (e.g.: STRIPE_API_KEY)')
|
|
35
|
+
.argument('<value>', 'Secret value')
|
|
36
|
+
.option('--dev', 'Use development environment', false)
|
|
25
37
|
.action(async (key: string, value: string, options: { dev?: boolean }) => {
|
|
26
38
|
try {
|
|
27
39
|
const credentials = await getStoredCredentials();
|
|
@@ -32,21 +44,21 @@ function secretSetCommand(): Command {
|
|
|
32
44
|
dev: options.dev,
|
|
33
45
|
});
|
|
34
46
|
|
|
35
|
-
const spinner = createSpinner(`
|
|
47
|
+
const spinner = createSpinner(`Saving secret "${key}"...`);
|
|
36
48
|
spinner.start();
|
|
37
49
|
|
|
38
50
|
await api.put('/api/worker/secrets', { key, value });
|
|
39
51
|
|
|
40
|
-
spinner.succeed(`Secret "${key}"
|
|
41
|
-
logger.dim(`
|
|
52
|
+
spinner.succeed(`Secret "${key}" saved`);
|
|
53
|
+
logger.dim(` Available in your workers as plz.env.${key}`);
|
|
42
54
|
console.log();
|
|
43
55
|
|
|
44
56
|
if (options.dev) {
|
|
45
|
-
logger.warning('
|
|
57
|
+
logger.warning('Environment: development');
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
} catch (error) {
|
|
49
|
-
const message = error instanceof Error ? error.message : '
|
|
61
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
50
62
|
logger.error(message);
|
|
51
63
|
process.exit(1);
|
|
52
64
|
}
|
|
@@ -57,8 +69,8 @@ function secretSetCommand(): Command {
|
|
|
57
69
|
|
|
58
70
|
function secretListCommand(): Command {
|
|
59
71
|
return new Command('list')
|
|
60
|
-
.description('
|
|
61
|
-
.option('--dev', '
|
|
72
|
+
.description('List all secrets in the workspace (without showing values)')
|
|
73
|
+
.option('--dev', 'Use development environment', false)
|
|
62
74
|
.action(async (options: { dev?: boolean }) => {
|
|
63
75
|
try {
|
|
64
76
|
const credentials = await getStoredCredentials();
|
|
@@ -69,7 +81,7 @@ function secretListCommand(): Command {
|
|
|
69
81
|
dev: options.dev,
|
|
70
82
|
});
|
|
71
83
|
|
|
72
|
-
const spinner = createSpinner('
|
|
84
|
+
const spinner = createSpinner('Fetching secrets...');
|
|
73
85
|
spinner.start();
|
|
74
86
|
|
|
75
87
|
const response = await api.get('/api/worker/secrets');
|
|
@@ -78,8 +90,8 @@ function secretListCommand(): Command {
|
|
|
78
90
|
spinner.stop();
|
|
79
91
|
|
|
80
92
|
if (!secrets || secrets.length === 0) {
|
|
81
|
-
logger.info('\n No
|
|
82
|
-
logger.dim('
|
|
93
|
+
logger.info('\n No secrets configured');
|
|
94
|
+
logger.dim(' Add one: plazbot workers secret set MY_KEY my_value');
|
|
83
95
|
console.log();
|
|
84
96
|
return;
|
|
85
97
|
}
|
|
@@ -93,18 +105,18 @@ function secretListCommand(): Command {
|
|
|
93
105
|
]);
|
|
94
106
|
|
|
95
107
|
console.log(createTable(
|
|
96
|
-
['Key', '
|
|
108
|
+
['Key', 'Value', 'Updated'],
|
|
97
109
|
rows,
|
|
98
110
|
));
|
|
99
111
|
|
|
100
112
|
console.log();
|
|
101
113
|
|
|
102
114
|
if (options.dev) {
|
|
103
|
-
logger.warning('
|
|
115
|
+
logger.warning('Environment: development');
|
|
104
116
|
}
|
|
105
117
|
|
|
106
118
|
} catch (error) {
|
|
107
|
-
const message = error instanceof Error ? error.message : '
|
|
119
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
108
120
|
logger.error(message);
|
|
109
121
|
process.exit(1);
|
|
110
122
|
}
|
|
@@ -115,10 +127,10 @@ function secretListCommand(): Command {
|
|
|
115
127
|
|
|
116
128
|
function secretRemoveCommand(): Command {
|
|
117
129
|
return new Command('remove')
|
|
118
|
-
.description('
|
|
119
|
-
.argument('<key>', '
|
|
120
|
-
.option('-f, --force', '
|
|
121
|
-
.option('--dev', '
|
|
130
|
+
.description('Delete a secret from the workspace')
|
|
131
|
+
.argument('<key>', 'Name of the secret to delete')
|
|
132
|
+
.option('-f, --force', 'Delete without confirmation', false)
|
|
133
|
+
.option('--dev', 'Use development environment', false)
|
|
122
134
|
.action(async (key: string, options: { dev?: boolean; force?: boolean }) => {
|
|
123
135
|
try {
|
|
124
136
|
const credentials = await getStoredCredentials();
|
|
@@ -131,32 +143,32 @@ function secretRemoveCommand(): Command {
|
|
|
131
143
|
|
|
132
144
|
if (!options.force) {
|
|
133
145
|
const confirmed = await askConfirmation(
|
|
134
|
-
`
|
|
146
|
+
` Delete secret "${key}"? (y/N): `
|
|
135
147
|
);
|
|
136
148
|
|
|
137
149
|
if (!confirmed) {
|
|
138
|
-
logger.info('\n
|
|
150
|
+
logger.info('\n Operation cancelled');
|
|
139
151
|
process.exit(0);
|
|
140
152
|
}
|
|
141
153
|
}
|
|
142
154
|
|
|
143
|
-
const spinner = createSpinner(`
|
|
155
|
+
const spinner = createSpinner(`Deleting secret "${key}"...`);
|
|
144
156
|
spinner.start();
|
|
145
157
|
|
|
146
158
|
await api.delete(`/api/worker/secrets/${encodeURIComponent(key)}`);
|
|
147
159
|
|
|
148
|
-
spinner.succeed(`Secret "${key}"
|
|
160
|
+
spinner.succeed(`Secret "${key}" deleted`);
|
|
149
161
|
console.log();
|
|
150
162
|
|
|
151
163
|
if (options.dev) {
|
|
152
|
-
logger.warning('
|
|
164
|
+
logger.warning('Environment: development');
|
|
153
165
|
}
|
|
154
166
|
|
|
155
167
|
} catch (error: any) {
|
|
156
168
|
if (error.response?.status === 404) {
|
|
157
|
-
logger.error(`Secret "${key}"
|
|
169
|
+
logger.error(`Secret "${key}" not found`);
|
|
158
170
|
} else {
|
|
159
|
-
const message = error instanceof Error ? error.message : '
|
|
171
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
160
172
|
logger.error(message);
|
|
161
173
|
}
|
|
162
174
|
process.exit(1);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import { getStoredCredentials } from '../../utils/credentials';
|
|
3
|
-
import { createApiClient } from '../../utils/api';
|
|
4
|
-
import { logger } from '../../utils/logger';
|
|
5
|
-
import {
|
|
2
|
+
import { getStoredCredentials } from '../../utils/credentials.js';
|
|
3
|
+
import { createApiClient } from '../../utils/api.js';
|
|
4
|
+
import { logger } from '../../utils/logger.js';
|
|
5
|
+
import { addExamples } from '../../utils/help.js';
|
|
6
|
+
import { createSpinner, theme } from '../../utils/ui.js';
|
|
6
7
|
|
|
7
8
|
interface WorkerTestResult {
|
|
8
9
|
success: boolean;
|
|
@@ -12,13 +13,13 @@ interface WorkerTestResult {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export const testCommand = new Command('test')
|
|
15
|
-
.description('
|
|
16
|
-
.argument('<name>', '
|
|
17
|
-
.option('-p, --payload <json>', '
|
|
18
|
-
.option('-t, --type <type>', '
|
|
19
|
-
.option('--contact <id>', 'ID
|
|
20
|
-
.option('--agent <id>', 'ID
|
|
21
|
-
.option('--dev', '
|
|
16
|
+
.description('Run a worker manually to test it')
|
|
17
|
+
.argument('<name>', 'Name of the worker to run')
|
|
18
|
+
.option('-p, --payload <json>', 'JSON payload for the worker (e.g.: \'{"product":"iPhone"}\')')
|
|
19
|
+
.option('-t, --type <type>', 'Worker type (tool, worker, sync, schedule, webhook)')
|
|
20
|
+
.option('--contact <id>', 'Contact ID (context for tools)')
|
|
21
|
+
.option('--agent <id>', 'Agent ID (context for tools)')
|
|
22
|
+
.option('--dev', 'Use development environment', false)
|
|
22
23
|
.action(async (name: string, options: {
|
|
23
24
|
payload?: string;
|
|
24
25
|
type?: string;
|
|
@@ -41,13 +42,13 @@ export const testCommand = new Command('test')
|
|
|
41
42
|
try {
|
|
42
43
|
payload = JSON.parse(options.payload);
|
|
43
44
|
} catch {
|
|
44
|
-
logger.error('
|
|
45
|
-
logger.dim('
|
|
45
|
+
logger.error('Payload is not valid JSON');
|
|
46
|
+
logger.dim('Example: --payload \'{"product":"iPhone 15"}\'');
|
|
46
47
|
process.exit(1);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
logger.title(`
|
|
51
|
+
logger.title(`Running worker "${name}"`);
|
|
51
52
|
console.log();
|
|
52
53
|
|
|
53
54
|
if (Object.keys(payload).length > 0) {
|
|
@@ -55,7 +56,7 @@ export const testCommand = new Command('test')
|
|
|
55
56
|
console.log();
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
const spinner = createSpinner('
|
|
59
|
+
const spinner = createSpinner('Running...');
|
|
59
60
|
spinner.start();
|
|
60
61
|
|
|
61
62
|
const response = await api.post('/api/worker/execute', {
|
|
@@ -73,16 +74,16 @@ export const testCommand = new Command('test')
|
|
|
73
74
|
spinner.stop();
|
|
74
75
|
|
|
75
76
|
if (data.success) {
|
|
76
|
-
logger.success(`
|
|
77
|
+
logger.success(`Completed in ${duration}ms`);
|
|
77
78
|
} else {
|
|
78
|
-
logger.error(`
|
|
79
|
+
logger.error(`Failed in ${duration}ms`);
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
console.log();
|
|
82
83
|
|
|
83
84
|
// Mostrar resultado
|
|
84
85
|
if (data.result !== undefined && data.result !== null) {
|
|
85
|
-
logger.label('
|
|
86
|
+
logger.label('Result', '');
|
|
86
87
|
|
|
87
88
|
const result = data.result as Record<string, unknown>;
|
|
88
89
|
|
|
@@ -117,17 +118,28 @@ export const testCommand = new Command('test')
|
|
|
117
118
|
console.log();
|
|
118
119
|
|
|
119
120
|
if (options.dev) {
|
|
120
|
-
logger.warning('
|
|
121
|
+
logger.warning('Environment: development');
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
} catch (error: any) {
|
|
124
125
|
if (error.response?.status === 404) {
|
|
125
|
-
logger.error(`Worker "${name}"
|
|
126
|
-
logger.dim('
|
|
126
|
+
logger.error(`Worker "${name}" not found or inactive`);
|
|
127
|
+
logger.dim('Verify the worker is deployed with: plazbot workers list');
|
|
127
128
|
} else {
|
|
128
|
-
const message = error.response?.data?.message || error.message || '
|
|
129
|
+
const message = error.response?.data?.message || error.message || 'Unknown error';
|
|
129
130
|
logger.error(message);
|
|
130
131
|
}
|
|
131
132
|
process.exit(1);
|
|
132
133
|
}
|
|
133
134
|
});
|
|
135
|
+
|
|
136
|
+
addExamples(testCommand, [
|
|
137
|
+
{ description: 'Run a worker without payload',
|
|
138
|
+
command: 'plazbot workers test my-tool' },
|
|
139
|
+
{ description: 'Run a worker with a JSON payload',
|
|
140
|
+
command: 'plazbot workers test get-stock -p \'{"product":"iPhone 15"}\'' },
|
|
141
|
+
{ description: 'Run a tool with contact and agent context',
|
|
142
|
+
command: 'plazbot workers test my-tool --contact ctc_AbcDef123 --agent agt_AbcDef123' },
|
|
143
|
+
{ description: 'Run against the local backend',
|
|
144
|
+
command: 'plazbot workers test my-tool --dev' },
|
|
145
|
+
]);
|