@memberjunction/ai-cli 3.4.0 → 4.1.0
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 +154 -333
- package/bin/run.js +3 -3
- package/dist/commands/actions/list.js +17 -46
- package/dist/commands/actions/list.js.map +1 -1
- package/dist/commands/actions/run.d.ts +1 -1
- package/dist/commands/actions/run.js +32 -61
- package/dist/commands/actions/run.js.map +1 -1
- package/dist/commands/agents/list.js +17 -46
- package/dist/commands/agents/list.js.map +1 -1
- package/dist/commands/agents/run.d.ts +2 -2
- package/dist/commands/agents/run.js +34 -63
- package/dist/commands/agents/run.js.map +1 -1
- package/dist/commands/prompts/list.js +15 -21
- package/dist/commands/prompts/list.js.map +1 -1
- package/dist/commands/prompts/run.d.ts +5 -5
- package/dist/commands/prompts/run.js +22 -28
- package/dist/commands/prompts/run.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -24
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +13 -32
- package/dist/index.js.map +1 -1
- package/dist/lib/audit-analyzer.js +1 -5
- package/dist/lib/audit-analyzer.js.map +1 -1
- package/dist/lib/audit-formatter.d.ts +1 -1
- package/dist/lib/audit-formatter.js +78 -85
- package/dist/lib/audit-formatter.js.map +1 -1
- package/dist/lib/console-manager.js +3 -7
- package/dist/lib/console-manager.js.map +1 -1
- package/dist/lib/execution-logger.js +13 -25
- package/dist/lib/execution-logger.js.map +1 -1
- package/dist/lib/mj-provider.js +20 -29
- package/dist/lib/mj-provider.js.map +1 -1
- package/dist/lib/output-formatter.js +61 -69
- package/dist/lib/output-formatter.js.map +1 -1
- package/dist/lib/text-formatter.js +13 -20
- package/dist/lib/text-formatter.js.map +1 -1
- package/dist/services/ActionService.d.ts +1 -1
- package/dist/services/ActionService.js +14 -40
- package/dist/services/ActionService.js.map +1 -1
- package/dist/services/AgentAuditService.d.ts +1 -1
- package/dist/services/AgentAuditService.js +14 -44
- package/dist/services/AgentAuditService.js.map +1 -1
- package/dist/services/AgentService.d.ts +1 -1
- package/dist/services/AgentService.js +19 -49
- package/dist/services/AgentService.js.map +1 -1
- package/dist/services/ConversationService.js +31 -60
- package/dist/services/ConversationService.js.map +1 -1
- package/dist/services/PromptService.d.ts +1 -1
- package/dist/services/PromptService.js +12 -39
- package/dist/services/PromptService.js.map +1 -1
- package/dist/services/ValidationService.js +1 -5
- package/dist/services/ValidationService.js.map +1 -1
- package/oclif.manifest.json +7 -7
- package/package.json +31 -30
|
@@ -1,79 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const core_1 = require("@oclif/core");
|
|
30
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const ora_classic_1 = __importDefault(require("ora-classic"));
|
|
32
|
-
const ActionService_1 = require("../../services/ActionService");
|
|
33
|
-
const ValidationService_1 = require("../../services/ValidationService");
|
|
34
|
-
const output_formatter_1 = require("../../lib/output-formatter");
|
|
35
|
-
class ActionsRun extends core_1.Command {
|
|
36
|
-
static description = 'Execute individual actions directly';
|
|
37
|
-
static examples = [
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import ora from 'ora-classic';
|
|
4
|
+
import { ActionService } from '../../services/ActionService.js';
|
|
5
|
+
import { ValidationService } from '../../services/ValidationService.js';
|
|
6
|
+
import { OutputFormatter } from '../../lib/output-formatter.js';
|
|
7
|
+
export default class ActionsRun extends Command {
|
|
8
|
+
static { this.description = 'Execute individual actions directly'; }
|
|
9
|
+
static { this.examples = [
|
|
38
10
|
'<%= config.bin %> <%= command.id %> -n "Get Weather" --param "Location=Boston"',
|
|
39
11
|
'<%= config.bin %> <%= command.id %> -n "Send Email" --param "To=user@example.com" --param "Subject=Test"',
|
|
40
12
|
'<%= config.bin %> <%= command.id %> --output=json',
|
|
41
13
|
'<%= config.bin %> <%= command.id %> -n "Calculate" --param "Numbers=[1,2,3]" --verbose',
|
|
42
|
-
];
|
|
43
|
-
static flags = {
|
|
44
|
-
name:
|
|
14
|
+
]; }
|
|
15
|
+
static { this.flags = {
|
|
16
|
+
name: Flags.string({
|
|
45
17
|
char: 'n',
|
|
46
18
|
description: 'Name of the action to execute',
|
|
47
19
|
required: false
|
|
48
20
|
}),
|
|
49
|
-
param:
|
|
21
|
+
param: Flags.string({
|
|
50
22
|
description: 'Action parameter (key=value format, can be used multiple times)',
|
|
51
23
|
multiple: true,
|
|
52
24
|
default: []
|
|
53
25
|
}),
|
|
54
|
-
verbose:
|
|
26
|
+
verbose: Flags.boolean({
|
|
55
27
|
char: 'v',
|
|
56
28
|
description: 'Show detailed execution information'
|
|
57
29
|
}),
|
|
58
|
-
timeout:
|
|
30
|
+
timeout: Flags.integer({
|
|
59
31
|
description: 'Override default timeout (milliseconds)',
|
|
60
32
|
default: 300000
|
|
61
33
|
}),
|
|
62
|
-
'dry-run':
|
|
34
|
+
'dry-run': Flags.boolean({
|
|
63
35
|
description: 'Validate without executing'
|
|
64
36
|
}),
|
|
65
|
-
output:
|
|
37
|
+
output: Flags.string({
|
|
66
38
|
description: 'Output format',
|
|
67
39
|
options: ['compact', 'json', 'table'],
|
|
68
40
|
default: 'compact'
|
|
69
41
|
})
|
|
70
|
-
};
|
|
42
|
+
}; }
|
|
71
43
|
async run() {
|
|
72
44
|
const { flags } = await this.parse(ActionsRun);
|
|
73
|
-
const spinner = (
|
|
45
|
+
const spinner = ora();
|
|
74
46
|
try {
|
|
75
47
|
// Validate inputs
|
|
76
|
-
const validator = new
|
|
48
|
+
const validator = new ValidationService();
|
|
77
49
|
const outputFormat = validator.validateOutputFormat(flags.output);
|
|
78
50
|
const timeout = validator.validateTimeout(flags.timeout);
|
|
79
51
|
const parameters = validator.parseParameters(flags.param);
|
|
@@ -81,17 +53,17 @@ class ActionsRun extends core_1.Command {
|
|
|
81
53
|
// Show available actions if none specified
|
|
82
54
|
if (!flags.name) {
|
|
83
55
|
spinner.start('Loading available actions...');
|
|
84
|
-
const actionService = new
|
|
56
|
+
const actionService = new ActionService();
|
|
85
57
|
await actionService.initialize();
|
|
86
58
|
const actions = await actionService.listActions();
|
|
87
59
|
spinner.stop();
|
|
88
|
-
const formatter = new
|
|
60
|
+
const formatter = new OutputFormatter(outputFormat);
|
|
89
61
|
this.log(formatter.formatActionList(actions));
|
|
90
62
|
return;
|
|
91
63
|
}
|
|
92
64
|
if (flags['dry-run']) {
|
|
93
65
|
spinner.start('Validating action and parameters...');
|
|
94
|
-
const actionService = new
|
|
66
|
+
const actionService = new ActionService();
|
|
95
67
|
await actionService.initialize();
|
|
96
68
|
// Try to find the action to validate it exists
|
|
97
69
|
const action = await actionService.findAction(flags.name);
|
|
@@ -99,25 +71,25 @@ class ActionsRun extends core_1.Command {
|
|
|
99
71
|
if (!action) {
|
|
100
72
|
this.error(`Action "${flags.name}" not found. Use 'mj-ai actions:list' to see available actions.`);
|
|
101
73
|
}
|
|
102
|
-
this.log(
|
|
103
|
-
this.log(
|
|
74
|
+
this.log(chalk.green('✓ Validation passed - dry run complete'));
|
|
75
|
+
this.log(chalk.dim(`Action: ${flags.name}`));
|
|
104
76
|
if (Object.keys(parameters).length > 0) {
|
|
105
|
-
this.log(
|
|
77
|
+
this.log(chalk.dim(`Parameters:`));
|
|
106
78
|
Object.entries(parameters).forEach(([key, value]) => {
|
|
107
79
|
const valueStr = typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
108
80
|
const displayValue = valueStr.length > 50 ? valueStr.substring(0, 50) + '...' : valueStr;
|
|
109
|
-
this.log(
|
|
81
|
+
this.log(chalk.dim(` ${key}: ${displayValue}`));
|
|
110
82
|
});
|
|
111
83
|
}
|
|
112
84
|
else {
|
|
113
|
-
this.log(
|
|
85
|
+
this.log(chalk.dim(`Parameters: None`));
|
|
114
86
|
}
|
|
115
|
-
this.log(
|
|
87
|
+
this.log(chalk.dim(`Timeout: ${timeout}ms`));
|
|
116
88
|
return;
|
|
117
89
|
}
|
|
118
90
|
// Execute action
|
|
119
91
|
spinner.start(`Executing action: ${flags.name}...`);
|
|
120
|
-
const actionService = new
|
|
92
|
+
const actionService = new ActionService();
|
|
121
93
|
await actionService.initialize();
|
|
122
94
|
const result = await actionService.executeAction(flags.name, {
|
|
123
95
|
verbose: flags.verbose,
|
|
@@ -125,7 +97,7 @@ class ActionsRun extends core_1.Command {
|
|
|
125
97
|
parameters: parameters
|
|
126
98
|
});
|
|
127
99
|
spinner.stop();
|
|
128
|
-
const formatter = new
|
|
100
|
+
const formatter = new OutputFormatter(outputFormat);
|
|
129
101
|
this.log(formatter.formatActionResult(result));
|
|
130
102
|
// Clean up resources
|
|
131
103
|
await this.cleanup();
|
|
@@ -152,7 +124,7 @@ class ActionsRun extends core_1.Command {
|
|
|
152
124
|
}
|
|
153
125
|
async cleanup() {
|
|
154
126
|
try {
|
|
155
|
-
const { closeMJProvider } = await
|
|
127
|
+
const { closeMJProvider } = await import('../../lib/mj-provider.js');
|
|
156
128
|
await closeMJProvider();
|
|
157
129
|
}
|
|
158
130
|
catch (error) {
|
|
@@ -160,5 +132,4 @@ class ActionsRun extends core_1.Command {
|
|
|
160
132
|
}
|
|
161
133
|
}
|
|
162
134
|
}
|
|
163
|
-
exports.default = ActionsRun;
|
|
164
135
|
//# sourceMappingURL=run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/actions/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/actions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;aACtC,gBAAW,GAAG,qCAAqC,CAAC;aAEpD,aAAQ,GAAG;QAChB,gFAAgF;QAChF,0GAA0G;QAC1G,mDAAmD;QACnD,wFAAwF;KACzF,CAAC;aAEK,UAAK,GAAG;QACb,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE,iEAAiE;YAC9E,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ,CAAC;QACF,OAAO,EAAE,KAAK,CAA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IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;YAED,yCAAyC;YACzC,YAAY,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACnC,CAAC;YAED,qDAAqD;YACrD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACxB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC;YACH,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAClE,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,6DAA6D;QAC/D,CAAC;IACH,CAAC"}
|
|
@@ -1,62 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const core_1 = require("@oclif/core");
|
|
30
|
-
const ora_classic_1 = __importDefault(require("ora-classic"));
|
|
31
|
-
const AgentService_1 = require("../../services/AgentService");
|
|
32
|
-
const output_formatter_1 = require("../../lib/output-formatter");
|
|
33
|
-
const ValidationService_1 = require("../../services/ValidationService");
|
|
34
|
-
class AgentsList extends core_1.Command {
|
|
35
|
-
static description = 'List available AI agents';
|
|
36
|
-
static examples = [
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import ora from 'ora-classic';
|
|
3
|
+
import { AgentService } from '../../services/AgentService.js';
|
|
4
|
+
import { OutputFormatter } from '../../lib/output-formatter.js';
|
|
5
|
+
import { ValidationService } from '../../services/ValidationService.js';
|
|
6
|
+
export default class AgentsList extends Command {
|
|
7
|
+
static { this.description = 'List available AI agents'; }
|
|
8
|
+
static { this.examples = [
|
|
37
9
|
'<%= config.bin %> <%= command.id %>',
|
|
38
10
|
'<%= config.bin %> <%= command.id %> --output=json',
|
|
39
11
|
'<%= config.bin %> <%= command.id %> --output=table',
|
|
40
|
-
];
|
|
41
|
-
static flags = {
|
|
42
|
-
output:
|
|
12
|
+
]; }
|
|
13
|
+
static { this.flags = {
|
|
14
|
+
output: Flags.string({
|
|
43
15
|
description: 'Output format',
|
|
44
16
|
options: ['compact', 'json', 'table'],
|
|
45
17
|
default: 'table'
|
|
46
18
|
})
|
|
47
|
-
};
|
|
19
|
+
}; }
|
|
48
20
|
async run() {
|
|
49
21
|
const { flags } = await this.parse(AgentsList);
|
|
50
|
-
const spinner = (
|
|
22
|
+
const spinner = ora('Loading available agents...');
|
|
51
23
|
try {
|
|
52
|
-
const validator = new
|
|
24
|
+
const validator = new ValidationService();
|
|
53
25
|
const outputFormat = validator.validateOutputFormat(flags.output);
|
|
54
26
|
spinner.start();
|
|
55
|
-
const agentService = new
|
|
27
|
+
const agentService = new AgentService();
|
|
56
28
|
await agentService.initialize();
|
|
57
29
|
const agents = await agentService.listAgents();
|
|
58
30
|
spinner.stop();
|
|
59
|
-
const formatter = new
|
|
31
|
+
const formatter = new OutputFormatter(outputFormat);
|
|
60
32
|
this.log(formatter.formatAgentList(agents));
|
|
61
33
|
// Clean up resources
|
|
62
34
|
await this.cleanup();
|
|
@@ -79,7 +51,7 @@ class AgentsList extends core_1.Command {
|
|
|
79
51
|
}
|
|
80
52
|
async cleanup() {
|
|
81
53
|
try {
|
|
82
|
-
const { closeMJProvider } = await
|
|
54
|
+
const { closeMJProvider } = await import('../../lib/mj-provider.js');
|
|
83
55
|
await closeMJProvider();
|
|
84
56
|
}
|
|
85
57
|
catch (error) {
|
|
@@ -87,5 +59,4 @@ class AgentsList extends core_1.Command {
|
|
|
87
59
|
}
|
|
88
60
|
}
|
|
89
61
|
}
|
|
90
|
-
exports.default = AgentsList;
|
|
91
62
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/agents/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/agents/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,GAAG,MAA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AI,CAAC,OAAO,EAAE,CAAC;YAErB,yCAAyC;YACzC,YAAY,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACvB,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;YACxC,CAAC;YAED,qDAAqD;YACrD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACxB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC;YACH,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAClE,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,6DAA6D;QAC/D,CAAC;IACH,CAAC"}
|
|
@@ -3,8 +3,8 @@ export default class AgentsRun extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
agent: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
7
|
-
prompt: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
6
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
prompt: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
chat: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -1,100 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const core_1 = require("@oclif/core");
|
|
30
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const ora_classic_1 = __importDefault(require("ora-classic"));
|
|
32
|
-
const AgentService_1 = require("../../services/AgentService");
|
|
33
|
-
const ConversationService_1 = require("../../services/ConversationService");
|
|
34
|
-
const ValidationService_1 = require("../../services/ValidationService");
|
|
35
|
-
const output_formatter_1 = require("../../lib/output-formatter");
|
|
36
|
-
class AgentsRun extends core_1.Command {
|
|
37
|
-
static description = 'Execute AI agents with custom prompts';
|
|
38
|
-
static examples = [
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import ora from 'ora-classic';
|
|
4
|
+
import { AgentService } from '../../services/AgentService.js';
|
|
5
|
+
import { ConversationService } from '../../services/ConversationService.js';
|
|
6
|
+
import { ValidationService } from '../../services/ValidationService.js';
|
|
7
|
+
import { OutputFormatter } from '../../lib/output-formatter.js';
|
|
8
|
+
export default class AgentsRun extends Command {
|
|
9
|
+
static { this.description = 'Execute AI agents with custom prompts'; }
|
|
10
|
+
static { this.examples = [
|
|
39
11
|
'<%= config.bin %> <%= command.id %> -a "Demo Loop Agent" -p "Hello world"',
|
|
40
12
|
'<%= config.bin %> <%= command.id %> -a "Demo Loop Agent" --chat',
|
|
41
13
|
'<%= config.bin %> <%= command.id %> -a "Demo Loop Agent" -p "Get weather" --verbose',
|
|
42
14
|
'<%= config.bin %> <%= command.id %> --output=json',
|
|
43
|
-
];
|
|
44
|
-
static flags = {
|
|
45
|
-
agent:
|
|
15
|
+
]; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
agent: Flags.string({
|
|
46
18
|
char: 'a',
|
|
47
19
|
description: 'Name of the AI agent to execute',
|
|
48
20
|
required: false
|
|
49
21
|
}),
|
|
50
|
-
prompt:
|
|
22
|
+
prompt: Flags.string({
|
|
51
23
|
char: 'p',
|
|
52
24
|
description: 'Prompt text to send to the agent'
|
|
53
25
|
}),
|
|
54
|
-
chat:
|
|
26
|
+
chat: Flags.boolean({
|
|
55
27
|
char: 'c',
|
|
56
28
|
description: 'Start interactive conversation mode'
|
|
57
29
|
}),
|
|
58
|
-
verbose:
|
|
30
|
+
verbose: Flags.boolean({
|
|
59
31
|
char: 'v',
|
|
60
32
|
description: 'Show detailed execution information'
|
|
61
33
|
}),
|
|
62
|
-
timeout:
|
|
34
|
+
timeout: Flags.integer({
|
|
63
35
|
description: 'Override default timeout (milliseconds)',
|
|
64
36
|
default: 300000
|
|
65
37
|
}),
|
|
66
|
-
'dry-run':
|
|
38
|
+
'dry-run': Flags.boolean({
|
|
67
39
|
description: 'Validate without executing'
|
|
68
40
|
}),
|
|
69
|
-
output:
|
|
41
|
+
output: Flags.string({
|
|
70
42
|
description: 'Output format',
|
|
71
43
|
options: ['compact', 'json', 'table'],
|
|
72
44
|
default: 'compact'
|
|
73
45
|
})
|
|
74
|
-
};
|
|
46
|
+
}; }
|
|
75
47
|
async run() {
|
|
76
48
|
const { flags } = await this.parse(AgentsRun);
|
|
77
|
-
const spinner = (
|
|
49
|
+
const spinner = ora();
|
|
78
50
|
try {
|
|
79
51
|
// Validate inputs
|
|
80
|
-
const validator = new
|
|
52
|
+
const validator = new ValidationService();
|
|
81
53
|
const outputFormat = validator.validateOutputFormat(flags.output);
|
|
82
54
|
const timeout = validator.validateTimeout(flags.timeout);
|
|
83
55
|
await validator.validateAgentInput(flags.agent, flags.prompt, flags.chat);
|
|
84
56
|
// Show available agents if none specified
|
|
85
57
|
if (!flags.agent) {
|
|
86
58
|
spinner.start('Loading available agents...');
|
|
87
|
-
const agentService = new
|
|
59
|
+
const agentService = new AgentService();
|
|
88
60
|
await agentService.initialize();
|
|
89
61
|
const agents = await agentService.listAgents();
|
|
90
62
|
spinner.stop();
|
|
91
|
-
const formatter = new
|
|
63
|
+
const formatter = new OutputFormatter(outputFormat);
|
|
92
64
|
this.log(formatter.formatAgentList(agents));
|
|
93
65
|
return;
|
|
94
66
|
}
|
|
95
67
|
if (flags['dry-run']) {
|
|
96
68
|
spinner.start('Validating agent and configuration...');
|
|
97
|
-
const agentService = new
|
|
69
|
+
const agentService = new AgentService();
|
|
98
70
|
await agentService.initialize();
|
|
99
71
|
// Try to find the agent to validate it exists
|
|
100
72
|
const agent = await agentService.findAgent(flags.agent);
|
|
@@ -102,18 +74,18 @@ class AgentsRun extends core_1.Command {
|
|
|
102
74
|
if (!agent) {
|
|
103
75
|
this.error(`Agent "${flags.agent}" not found. Use 'mj-ai agents:list' to see available agents.`);
|
|
104
76
|
}
|
|
105
|
-
this.log(
|
|
106
|
-
this.log(
|
|
77
|
+
this.log(chalk.green('✓ Validation passed - dry run complete'));
|
|
78
|
+
this.log(chalk.dim(`Agent: ${flags.agent}`));
|
|
107
79
|
if (flags.prompt) {
|
|
108
|
-
this.log(
|
|
80
|
+
this.log(chalk.dim(`Prompt: ${flags.prompt.substring(0, 100)}${flags.prompt.length > 100 ? '...' : ''}`));
|
|
109
81
|
}
|
|
110
|
-
this.log(
|
|
111
|
-
this.log(
|
|
82
|
+
this.log(chalk.dim(`Mode: ${flags.chat ? 'Interactive chat' : 'Single execution'}`));
|
|
83
|
+
this.log(chalk.dim(`Timeout: ${timeout}ms`));
|
|
112
84
|
return;
|
|
113
85
|
}
|
|
114
86
|
// Execute agent in chat mode
|
|
115
87
|
if (flags.chat) {
|
|
116
|
-
const conversationService = new
|
|
88
|
+
const conversationService = new ConversationService();
|
|
117
89
|
await conversationService.startChat(flags.agent, flags.prompt, {
|
|
118
90
|
verbose: flags.verbose,
|
|
119
91
|
timeout: timeout
|
|
@@ -125,14 +97,14 @@ class AgentsRun extends core_1.Command {
|
|
|
125
97
|
this.error('Prompt is required for non-interactive mode. Use --chat for interactive mode or provide --prompt.');
|
|
126
98
|
}
|
|
127
99
|
spinner.start(`Executing agent: ${flags.agent}...`);
|
|
128
|
-
const agentService = new
|
|
100
|
+
const agentService = new AgentService();
|
|
129
101
|
await agentService.initialize();
|
|
130
102
|
const result = await agentService.executeAgent(flags.agent, flags.prompt, {
|
|
131
103
|
verbose: flags.verbose,
|
|
132
104
|
timeout: timeout
|
|
133
105
|
});
|
|
134
106
|
spinner.stop();
|
|
135
|
-
const formatter = new
|
|
107
|
+
const formatter = new OutputFormatter(outputFormat);
|
|
136
108
|
this.log(formatter.formatAgentResult(result));
|
|
137
109
|
// Clean up resources
|
|
138
110
|
await this.cleanup();
|
|
@@ -169,7 +141,7 @@ class AgentsRun extends core_1.Command {
|
|
|
169
141
|
}
|
|
170
142
|
async cleanup() {
|
|
171
143
|
try {
|
|
172
|
-
const { closeMJProvider } = await
|
|
144
|
+
const { closeMJProvider } = await import('../../lib/mj-provider.js');
|
|
173
145
|
await closeMJProvider();
|
|
174
146
|
}
|
|
175
147
|
catch (error) {
|
|
@@ -177,5 +149,4 @@ class AgentsRun extends core_1.Command {
|
|
|
177
149
|
}
|
|
178
150
|
}
|
|
179
151
|
}
|
|
180
|
-
exports.default = AgentsRun;
|
|
181
152
|
//# sourceMappingURL=run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/agents/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/agents/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;aACrC,gBAAW,GAAG,uCAAuC,CAAC;aAEtD,aAAQ,GAAG;QAChB,2EAA2E;QAC3E,iEAAiE;QACjE,qFAAqF;QACrF,mDAAmD;KACpD,CAAC;aAEK,UAAK,GAAG;QACb,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,kCAAkC;SAChD,CAAC;QACF,I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,uBAAuB,CAAC,CAAC;YAClE,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,6DAA6D;QAC/D,CAAC;IACH,CAAC"}
|
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const PromptService_1 = require("../../services/PromptService");
|
|
8
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
class PromptsList extends core_1.Command {
|
|
10
|
-
static description = 'List available models for prompt execution';
|
|
11
|
-
static examples = [
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { PromptService } from '../../services/PromptService.js';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
export default class PromptsList extends Command {
|
|
5
|
+
static { this.description = 'List available models for prompt execution'; }
|
|
6
|
+
static { this.examples = [
|
|
12
7
|
'<%= config.bin %> <%= command.id %>',
|
|
13
|
-
];
|
|
14
|
-
static flags = {
|
|
15
|
-
verbose:
|
|
8
|
+
]; }
|
|
9
|
+
static { this.flags = {
|
|
10
|
+
verbose: Flags.boolean({
|
|
16
11
|
char: 'v',
|
|
17
12
|
description: 'Show detailed model information',
|
|
18
13
|
}),
|
|
19
|
-
};
|
|
14
|
+
}; }
|
|
20
15
|
async run() {
|
|
21
16
|
const { flags } = await this.parse(PromptsList);
|
|
22
17
|
try {
|
|
23
|
-
const service = new
|
|
18
|
+
const service = new PromptService();
|
|
24
19
|
const models = await service.listAvailableModels();
|
|
25
|
-
this.log(
|
|
20
|
+
this.log(chalk.bold(`\nAvailable AI Models (${models.length}):\n`));
|
|
26
21
|
for (const model of models) {
|
|
27
|
-
this.log(`${
|
|
22
|
+
this.log(`${chalk.cyan(model.name)} ${chalk.gray(`(${model.vendor})`)}`);
|
|
28
23
|
if (flags.verbose && model.description) {
|
|
29
|
-
this.log(` ${
|
|
24
|
+
this.log(` ${chalk.dim(model.description)}`);
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
|
-
this.log(
|
|
27
|
+
this.log(chalk.gray('\nUse any of these models with the --model flag when running prompts'));
|
|
33
28
|
}
|
|
34
29
|
catch (error) {
|
|
35
30
|
this.error(error);
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
|
-
exports.default = PromptsList;
|
|
40
34
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/prompts/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/prompts/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;aACvC,gBAAW,GAAG,4CAA4C,CAAC;aAE3D,aAAQ,GAAG;QAChB,qCAAqC;KACtC,CAAC;aAEK,UAAK,GAAG;QACb,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,iCAAiC;SAC/C,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEhD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAEnD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;YAEpE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;gBACzE,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;oBACvC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC,CAAC;QAE/F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAc,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC"}
|
|
@@ -4,11 +4,11 @@ export default class PromptsRun extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
prompt: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
-
model: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
8
|
-
system: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
9
|
-
temperature: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
10
|
-
'max-tokens': import("@oclif/core/lib/interfaces").OptionFlag<number
|
|
11
|
-
configuration: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
7
|
+
model: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
system: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
temperature: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'max-tokens': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
configuration: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
13
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|