aiframe-agent-cli 1.0.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/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ initCommand,
4
+ runCommand,
5
+ uiCommand
6
+ } from "./chunk-7NQAVI47.js";
7
+
8
+ // src/cli.ts
9
+ import { Command } from "commander";
10
+ var program = new Command();
11
+ program.name("aiframe").description("Enterprise Resilient AI Agent Framework").version("1.0.0");
12
+ program.command("init").description("Bootstrap configuration directories and sample rules").action(async () => {
13
+ await initCommand();
14
+ });
15
+ program.command("run <workflowPath>").description("Run a declarative workflow YAML").option("-r, --resume", "Resume from the last saved checkpoint", false).action(async (workflowPath, options) => {
16
+ await runCommand(workflowPath, options);
17
+ });
18
+ program.command("ui").description("Start the local web UI dashboard").option("-p, --port <number>", "Port to run the server on", "3000").action(async (options) => {
19
+ const port = parseInt(options.port, 10);
20
+ await uiCommand({ port });
21
+ });
22
+ program.parse(process.argv);
@@ -0,0 +1,58 @@
1
+ declare function initCommand(): Promise<void>;
2
+
3
+ declare function runCommand(workflowPath: string, options: {
4
+ resume?: boolean;
5
+ }): Promise<void>;
6
+
7
+ declare function uiCommand(options: {
8
+ port?: number;
9
+ }): Promise<void>;
10
+
11
+ interface ExecResult {
12
+ stdout: string;
13
+ stderr: string;
14
+ exitCode: number | undefined;
15
+ success: boolean;
16
+ error?: Error;
17
+ }
18
+ declare function executeCommand(cmd: string, args: string[], options?: {
19
+ timeout?: number;
20
+ cwd?: string;
21
+ }): Promise<ExecResult>;
22
+
23
+ declare function mapArguments(toolName: string, subCommand: string | null, params: Record<string, any>): Promise<string[]>;
24
+
25
+ declare function getGoogleModel(modelName?: string): any;
26
+
27
+ interface WorkflowState {
28
+ workflowName: string;
29
+ workflowPath: string;
30
+ currentStepIndex: number;
31
+ status: 'in_progress' | 'completed' | 'failed';
32
+ errorHistory: Record<number, string[]>;
33
+ rollbackHistory?: Record<number, number>;
34
+ stepStatuses?: Record<number, 'pending' | 'running' | 'success' | 'failed'>;
35
+ inputs?: Record<string, string>;
36
+ execId: string;
37
+ }
38
+ declare class WorkflowEngine {
39
+ private workflowData;
40
+ private workflowPath;
41
+ private checkpointPath;
42
+ private state;
43
+ constructor(workflowPath: string);
44
+ load(resume?: boolean, inputs?: Record<string, string>): Promise<void>;
45
+ private saveCheckpoint;
46
+ private clearCheckpoint;
47
+ run(): Promise<boolean>;
48
+ private resolveVariables;
49
+ private resolveTargetStepIndex;
50
+ private parseCommand;
51
+ private runStepAction;
52
+ }
53
+
54
+ declare function executeAgent(agentName: string, instruction: string, depth?: number, workflowOutputDir?: string, workingDir?: string): Promise<string>;
55
+
56
+ declare function startServer(port?: number): Promise<void>;
57
+
58
+ export { type ExecResult, WorkflowEngine, type WorkflowState, executeAgent, executeCommand, getGoogleModel, initCommand, mapArguments, runCommand, startServer, uiCommand };
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ import {
2
+ WorkflowEngine,
3
+ executeAgent,
4
+ executeCommand,
5
+ getGoogleModel,
6
+ initCommand,
7
+ mapArguments,
8
+ runCommand,
9
+ startServer,
10
+ uiCommand
11
+ } from "./chunk-7NQAVI47.js";
12
+ export {
13
+ WorkflowEngine,
14
+ executeAgent,
15
+ executeCommand,
16
+ getGoogleModel,
17
+ initCommand,
18
+ mapArguments,
19
+ runCommand,
20
+ startServer,
21
+ uiCommand
22
+ };