@agentuity/cli 2.0.1 → 2.0.2
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/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +2 -0
- package/dist/cmd/cloud/index.js.map +1 -1
- package/dist/cmd/cloud/workflow/get.d.ts +3 -0
- package/dist/cmd/cloud/workflow/get.d.ts.map +1 -0
- package/dist/cmd/cloud/workflow/get.js +52 -0
- package/dist/cmd/cloud/workflow/get.js.map +1 -0
- package/dist/cmd/cloud/workflow/index.d.ts +3 -0
- package/dist/cmd/cloud/workflow/index.d.ts.map +1 -0
- package/dist/cmd/cloud/workflow/index.js +21 -0
- package/dist/cmd/cloud/workflow/index.js.map +1 -0
- package/dist/cmd/cloud/workflow/list.d.ts +3 -0
- package/dist/cmd/cloud/workflow/list.d.ts.map +1 -0
- package/dist/cmd/cloud/workflow/list.js +62 -0
- package/dist/cmd/cloud/workflow/list.js.map +1 -0
- package/dist/cmd/cloud/workflow/util.d.ts +10 -0
- package/dist/cmd/cloud/workflow/util.d.ts.map +1 -0
- package/dist/cmd/cloud/workflow/util.js +16 -0
- package/dist/cmd/cloud/workflow/util.js.map +1 -0
- package/package.json +6 -6
- package/src/cmd/cloud/index.ts +2 -0
- package/src/cmd/cloud/workflow/get.ts +58 -0
- package/src/cmd/cloud/workflow/index.ts +22 -0
- package/src/cmd/cloud/workflow/list.ts +84 -0
- package/src/cmd/cloud/workflow/util.ts +28 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmd/cloud/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmd/cloud/index.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,OAAO,mCAwClB,CAAC"}
|
package/dist/cmd/cloud/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { emailCommand } from './email';
|
|
|
21
21
|
import taskCommand from './task';
|
|
22
22
|
import sandboxCommand from './sandbox';
|
|
23
23
|
import scheduleCommand from './schedule';
|
|
24
|
+
import workflowCommand from './workflow';
|
|
24
25
|
import servicesCommand from './services';
|
|
25
26
|
import { regionSubcommand } from './region';
|
|
26
27
|
import { machineCommand } from './machine';
|
|
@@ -50,6 +51,7 @@ export const command = createCommand({
|
|
|
50
51
|
vectorCommand,
|
|
51
52
|
sandboxCommand,
|
|
52
53
|
scheduleCommand,
|
|
54
|
+
workflowCommand,
|
|
53
55
|
envCommand,
|
|
54
56
|
evalCommand,
|
|
55
57
|
evalRunCommand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cmd/cloud/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,eAAe,MAAM,YAAY,CAAC;AACzC,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,cAAc,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,UAAU,MAAM,OAAO,CAAC;AAC/B,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,O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md/cloud/workflow/get.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,sCAgDxB,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createWorkflowAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import { WorkflowGetResultSchema } from '@agentuity/core';
|
|
7
|
+
export const getSubcommand = createCommand({
|
|
8
|
+
name: 'get',
|
|
9
|
+
aliases: ['show', 'info'],
|
|
10
|
+
description: 'Get workflow details',
|
|
11
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
12
|
+
requires: { auth: true },
|
|
13
|
+
idempotent: true,
|
|
14
|
+
examples: [
|
|
15
|
+
{
|
|
16
|
+
command: getCommand('cloud workflow get wf_abc123'),
|
|
17
|
+
description: 'Get workflow details',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
schema: {
|
|
21
|
+
args: z.object({
|
|
22
|
+
workflow_id: z.string().min(1).describe('Workflow ID'),
|
|
23
|
+
}),
|
|
24
|
+
response: WorkflowGetResultSchema,
|
|
25
|
+
},
|
|
26
|
+
async handler(ctx) {
|
|
27
|
+
const { args, options } = ctx;
|
|
28
|
+
const workflow = await createWorkflowAdapter(ctx);
|
|
29
|
+
const result = await workflow.get(args.workflow_id);
|
|
30
|
+
if (!options.json) {
|
|
31
|
+
const details = {
|
|
32
|
+
Name: result.workflow.name,
|
|
33
|
+
ID: result.workflow.id,
|
|
34
|
+
'Source Type': result.workflow.source_type,
|
|
35
|
+
'Source Ref ID': result.workflow.source_ref_id,
|
|
36
|
+
Status: result.workflow.status,
|
|
37
|
+
Description: result.workflow.description || '-',
|
|
38
|
+
Created: new Date(result.workflow.created_at).toLocaleString(),
|
|
39
|
+
Updated: new Date(result.workflow.updated_at).toLocaleString(),
|
|
40
|
+
};
|
|
41
|
+
tui.table([details], undefined, { layout: 'vertical', padStart: ' ' });
|
|
42
|
+
if (result.workflow.graph_json) {
|
|
43
|
+
tui.newline();
|
|
44
|
+
tui.header('Graph');
|
|
45
|
+
tui.info(JSON.stringify(result.workflow.graph_json, null, 2));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export default getSubcommand;
|
|
52
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC;IAC5C,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;IACxB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE;QACT;YACC,OAAO,EAAE,UAAU,CAAC,8BAA8B,CAAC;YACnD,WAAW,EAAE,sBAAsB;SACnC;KACD;IACD,MAAM,EAAE;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,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C,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/D,CAAC;QACF,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,sCAclB,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createCommand } from '../../../types';
|
|
2
|
+
import { listSubcommand } from './list';
|
|
3
|
+
import { getSubcommand } from './get';
|
|
4
|
+
import { getCommand } from '../../../command-prefix';
|
|
5
|
+
export const command = createCommand({
|
|
6
|
+
name: 'workflow',
|
|
7
|
+
aliases: ['workflows', 'wf'],
|
|
8
|
+
description: 'Manage workflows',
|
|
9
|
+
tags: ['requires-auth'],
|
|
10
|
+
requires: { auth: true },
|
|
11
|
+
subcommands: [listSubcommand, getSubcommand],
|
|
12
|
+
examples: [
|
|
13
|
+
{ command: getCommand('cloud workflow list'), description: 'List workflows' },
|
|
14
|
+
{
|
|
15
|
+
command: getCommand('cloud workflow get wf_abc123'),
|
|
16
|
+
description: 'Get workflow details',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
export default command;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;IACpC,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;IAC5B,WAAW,EAAE,kBAAkB;IAC/B,IAAI,EAAE,CAAC,eAAe,CAAC;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;IACxB,WAAW,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC;IAC5C,QAAQ,EAAE;QACT,EAAE,OAAO,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE;QAC7E;YACC,OAAO,EAAE,UAAU,CAAC,8BAA8B,CAAC;YACnD,WAAW,EAAE,sBAAsB;SACnC;KACD;CACD,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/list.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc,sCAsEzB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createWorkflowAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import { WorkflowListResultSchema, WorkflowSourceTypeSchema, WorkflowStatusSchema, } from '@agentuity/core';
|
|
7
|
+
export const listSubcommand = createCommand({
|
|
8
|
+
name: 'list',
|
|
9
|
+
aliases: ['ls'],
|
|
10
|
+
description: 'List workflows',
|
|
11
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
12
|
+
requires: { auth: true },
|
|
13
|
+
idempotent: true,
|
|
14
|
+
examples: [
|
|
15
|
+
{ command: getCommand('cloud workflow list'), description: 'List workflows' },
|
|
16
|
+
{ command: getCommand('cloud workflow list --limit 20'), description: 'List 20 workflows' },
|
|
17
|
+
{
|
|
18
|
+
command: getCommand('cloud workflow list --source-type queue'),
|
|
19
|
+
description: 'List workflows with queue sources',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
schema: {
|
|
23
|
+
options: z.object({
|
|
24
|
+
limit: z.coerce.number().min(0).optional().describe('Maximum number of workflows'),
|
|
25
|
+
offset: z.coerce.number().min(0).optional().describe('Pagination offset'),
|
|
26
|
+
'source-type': WorkflowSourceTypeSchema.optional().describe('Filter by source type'),
|
|
27
|
+
status: WorkflowStatusSchema.optional().describe('Filter by status'),
|
|
28
|
+
filter: z.string().optional().describe('Filter workflows by name'),
|
|
29
|
+
}),
|
|
30
|
+
response: WorkflowListResultSchema,
|
|
31
|
+
},
|
|
32
|
+
async handler(ctx) {
|
|
33
|
+
const { opts, options } = ctx;
|
|
34
|
+
const workflow = await createWorkflowAdapter(ctx);
|
|
35
|
+
const result = await workflow.list({
|
|
36
|
+
limit: opts.limit,
|
|
37
|
+
offset: opts.offset,
|
|
38
|
+
source_type: opts['source-type'],
|
|
39
|
+
status: opts.status,
|
|
40
|
+
filter: opts.filter,
|
|
41
|
+
});
|
|
42
|
+
if (!options.json) {
|
|
43
|
+
if (result.workflows.length === 0) {
|
|
44
|
+
tui.info('No workflows found');
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
tui.table(result.workflows.map((item) => ({
|
|
48
|
+
Name: item.name,
|
|
49
|
+
ID: item.id,
|
|
50
|
+
Source: item.source_type,
|
|
51
|
+
'Ref ID': item.source_ref_id,
|
|
52
|
+
Status: item.status,
|
|
53
|
+
Execs: item.execution_count ?? 0,
|
|
54
|
+
Created: new Date(item.created_at).toLocaleString(),
|
|
55
|
+
})), ['Name', 'ID', 'Source', 'Ref ID', 'Status', 'Execs', 'Created']);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
export default listSubcommand;
|
|
62
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACN,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,CAAC,IAAI,CAAC;IACf,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC;IAC5C,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;IACxB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE;QACT,EAAE,OAAO,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE;QAC7E,EAAE,OAAO,EAAE,UAAU,CAAC,gCAAgC,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE;QAC3F;YACC,OAAO,EAAE,UAAU,CAAC,yCAAyC,CAAC;YAC9D,WAAW,EAAE,mCAAmC;SAChD;KACD;IACD,MAAM,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;YACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,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MAAM,EAAE,IAAI,CAAC,WAAW;oBACxB,QAAQ,EAAE,IAAI,CAAC,aAAa;oBAC5B,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,KAAK,EAAE,IAAI,CAAC,eAAe,IAAI,CAAC;oBAChC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,cAAc,EAAE;iBACnD,CAAC,CACF,EACD,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAChE,CAAC;YACH,CAAC;QACF,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Logger, WorkflowService } from '@agentuity/core';
|
|
2
|
+
import type { AuthData, Config, GlobalOptions } from '../../../types';
|
|
3
|
+
export interface WorkflowContext {
|
|
4
|
+
logger: Logger;
|
|
5
|
+
auth: AuthData;
|
|
6
|
+
config: Config | null;
|
|
7
|
+
options: GlobalOptions;
|
|
8
|
+
}
|
|
9
|
+
export declare function createWorkflowAdapter(ctx: WorkflowContext): Promise<WorkflowService>;
|
|
10
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAK/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC;CACvB;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,eAAe,4BAa/D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WorkflowService } from '@agentuity/core';
|
|
2
|
+
import { createServerFetchAdapter } from '@agentuity/server';
|
|
3
|
+
import { getCatalystUrl } from '../../../catalyst';
|
|
4
|
+
import { defaultProfileName, getDefaultRegion } from '../../../config';
|
|
5
|
+
import * as tui from '../../../tui';
|
|
6
|
+
export async function createWorkflowAdapter(ctx) {
|
|
7
|
+
const orgId = ctx.options.orgId ?? (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
|
|
8
|
+
if (!orgId) {
|
|
9
|
+
tui.fatal('Organization ID is required. Use --org-id flag or set AGENTUITY_CLOUD_ORG_ID.');
|
|
10
|
+
}
|
|
11
|
+
const adapter = createServerFetchAdapter({ headers: { Authorization: `Bearer ${ctx.auth.apiKey}`, 'x-agentuity-orgid': orgId } }, ctx.logger);
|
|
12
|
+
const region = await getDefaultRegion(ctx.config?.name ?? defaultProfileName, ctx.config);
|
|
13
|
+
const baseUrl = getCatalystUrl(region, ctx.config?.overrides);
|
|
14
|
+
return new WorkflowService(baseUrl, adapter);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/cmd/cloud/workflow/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAUpC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,GAAoB;IAC/D,MAAM,KAAK,GACV,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC7F,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,GAAG,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;IAC5F,CAAC;IACD,MAAM,OAAO,GAAG,wBAAwB,CACvC,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,EAAE,EACvF,GAAG,CAAC,MAAM,CACV,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,IAAI,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9D,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentuity/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"type": "module",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"prepublishOnly": "bun run clean && bun run build"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@agentuity/auth": "2.0.
|
|
45
|
-
"@agentuity/core": "2.0.
|
|
46
|
-
"@agentuity/frontend": "2.0.
|
|
47
|
-
"@agentuity/server": "2.0.
|
|
44
|
+
"@agentuity/auth": "2.0.2",
|
|
45
|
+
"@agentuity/core": "2.0.2",
|
|
46
|
+
"@agentuity/frontend": "2.0.2",
|
|
47
|
+
"@agentuity/server": "2.0.2",
|
|
48
48
|
"@datasert/cronjs-parser": "^1.4.0",
|
|
49
49
|
"@vitejs/plugin-react": "^5.1.2",
|
|
50
50
|
"acorn-loose": "^8.5.2",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"zod": "^4.3.5"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@agentuity/test-utils": "2.0.
|
|
66
|
+
"@agentuity/test-utils": "2.0.2",
|
|
67
67
|
"@types/adm-zip": "^0.5.7",
|
|
68
68
|
"@types/archiver": "^7.0.0",
|
|
69
69
|
"@types/bun": "latest",
|
package/src/cmd/cloud/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { emailCommand } from './email';
|
|
|
21
21
|
import taskCommand from './task';
|
|
22
22
|
import sandboxCommand from './sandbox';
|
|
23
23
|
import scheduleCommand from './schedule';
|
|
24
|
+
import workflowCommand from './workflow';
|
|
24
25
|
import servicesCommand from './services';
|
|
25
26
|
import { regionSubcommand } from './region';
|
|
26
27
|
import { machineCommand } from './machine';
|
|
@@ -51,6 +52,7 @@ export const command = createCommand({
|
|
|
51
52
|
vectorCommand,
|
|
52
53
|
sandboxCommand,
|
|
53
54
|
scheduleCommand,
|
|
55
|
+
workflowCommand,
|
|
54
56
|
envCommand,
|
|
55
57
|
evalCommand,
|
|
56
58
|
evalRunCommand,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createWorkflowAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import { WorkflowGetResultSchema } from '@agentuity/core';
|
|
7
|
+
|
|
8
|
+
export const getSubcommand = createCommand({
|
|
9
|
+
name: 'get',
|
|
10
|
+
aliases: ['show', 'info'],
|
|
11
|
+
description: 'Get workflow details',
|
|
12
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
13
|
+
requires: { auth: true },
|
|
14
|
+
idempotent: true,
|
|
15
|
+
examples: [
|
|
16
|
+
{
|
|
17
|
+
command: getCommand('cloud workflow get wf_abc123'),
|
|
18
|
+
description: 'Get workflow details',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
schema: {
|
|
22
|
+
args: z.object({
|
|
23
|
+
workflow_id: z.string().min(1).describe('Workflow ID'),
|
|
24
|
+
}),
|
|
25
|
+
response: WorkflowGetResultSchema,
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
async handler(ctx) {
|
|
29
|
+
const { args, options } = ctx;
|
|
30
|
+
const workflow = await createWorkflowAdapter(ctx);
|
|
31
|
+
const result = await workflow.get(args.workflow_id);
|
|
32
|
+
|
|
33
|
+
if (!options.json) {
|
|
34
|
+
const details: Record<string, unknown> = {
|
|
35
|
+
Name: result.workflow.name,
|
|
36
|
+
ID: result.workflow.id,
|
|
37
|
+
'Source Type': result.workflow.source_type,
|
|
38
|
+
'Source Ref ID': result.workflow.source_ref_id,
|
|
39
|
+
Status: result.workflow.status,
|
|
40
|
+
Description: result.workflow.description || '-',
|
|
41
|
+
Created: new Date(result.workflow.created_at).toLocaleString(),
|
|
42
|
+
Updated: new Date(result.workflow.updated_at).toLocaleString(),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
tui.table([details], undefined, { layout: 'vertical', padStart: ' ' });
|
|
46
|
+
|
|
47
|
+
if (result.workflow.graph_json) {
|
|
48
|
+
tui.newline();
|
|
49
|
+
tui.header('Graph');
|
|
50
|
+
tui.info(JSON.stringify(result.workflow.graph_json, null, 2));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return result;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export default getSubcommand;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createCommand } from '../../../types';
|
|
2
|
+
import { listSubcommand } from './list';
|
|
3
|
+
import { getSubcommand } from './get';
|
|
4
|
+
import { getCommand } from '../../../command-prefix';
|
|
5
|
+
|
|
6
|
+
export const command = createCommand({
|
|
7
|
+
name: 'workflow',
|
|
8
|
+
aliases: ['workflows', 'wf'],
|
|
9
|
+
description: 'Manage workflows',
|
|
10
|
+
tags: ['requires-auth'],
|
|
11
|
+
requires: { auth: true },
|
|
12
|
+
subcommands: [listSubcommand, getSubcommand],
|
|
13
|
+
examples: [
|
|
14
|
+
{ command: getCommand('cloud workflow list'), description: 'List workflows' },
|
|
15
|
+
{
|
|
16
|
+
command: getCommand('cloud workflow get wf_abc123'),
|
|
17
|
+
description: 'Get workflow details',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default command;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createCommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { createWorkflowAdapter } from './util';
|
|
5
|
+
import { getCommand } from '../../../command-prefix';
|
|
6
|
+
import {
|
|
7
|
+
WorkflowListResultSchema,
|
|
8
|
+
WorkflowSourceTypeSchema,
|
|
9
|
+
WorkflowStatusSchema,
|
|
10
|
+
} from '@agentuity/core';
|
|
11
|
+
|
|
12
|
+
export const listSubcommand = createCommand({
|
|
13
|
+
name: 'list',
|
|
14
|
+
aliases: ['ls'],
|
|
15
|
+
description: 'List workflows',
|
|
16
|
+
tags: ['read-only', 'fast', 'requires-auth'],
|
|
17
|
+
requires: { auth: true },
|
|
18
|
+
idempotent: true,
|
|
19
|
+
examples: [
|
|
20
|
+
{ command: getCommand('cloud workflow list'), description: 'List workflows' },
|
|
21
|
+
{ command: getCommand('cloud workflow list --limit 20'), description: 'List 20 workflows' },
|
|
22
|
+
{
|
|
23
|
+
command: getCommand('cloud workflow list --source-type queue'),
|
|
24
|
+
description: 'List workflows with queue sources',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
schema: {
|
|
28
|
+
options: z.object({
|
|
29
|
+
limit: z.coerce.number().min(0).optional().describe('Maximum number of workflows'),
|
|
30
|
+
offset: z.coerce.number().min(0).optional().describe('Pagination offset'),
|
|
31
|
+
'source-type': WorkflowSourceTypeSchema.optional().describe('Filter by source type'),
|
|
32
|
+
status: WorkflowStatusSchema.optional().describe('Filter by status'),
|
|
33
|
+
filter: z.string().optional().describe('Filter workflows by name'),
|
|
34
|
+
}),
|
|
35
|
+
response: WorkflowListResultSchema,
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async handler(ctx) {
|
|
39
|
+
const { opts, options } = ctx;
|
|
40
|
+
const workflow = await createWorkflowAdapter(ctx);
|
|
41
|
+
const result = await workflow.list({
|
|
42
|
+
limit: opts.limit,
|
|
43
|
+
offset: opts.offset,
|
|
44
|
+
source_type: opts['source-type'],
|
|
45
|
+
status: opts.status,
|
|
46
|
+
filter: opts.filter,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
if (!options.json) {
|
|
50
|
+
if (result.workflows.length === 0) {
|
|
51
|
+
tui.info('No workflows found');
|
|
52
|
+
} else {
|
|
53
|
+
tui.table(
|
|
54
|
+
result.workflows.map(
|
|
55
|
+
(item: {
|
|
56
|
+
id: string;
|
|
57
|
+
created_at: string;
|
|
58
|
+
updated_at: string;
|
|
59
|
+
name: string;
|
|
60
|
+
description: string | null;
|
|
61
|
+
source_type: string;
|
|
62
|
+
source_ref_id: string;
|
|
63
|
+
status: string;
|
|
64
|
+
execution_count?: number;
|
|
65
|
+
}) => ({
|
|
66
|
+
Name: item.name,
|
|
67
|
+
ID: item.id,
|
|
68
|
+
Source: item.source_type,
|
|
69
|
+
'Ref ID': item.source_ref_id,
|
|
70
|
+
Status: item.status,
|
|
71
|
+
Execs: item.execution_count ?? 0,
|
|
72
|
+
Created: new Date(item.created_at).toLocaleString(),
|
|
73
|
+
})
|
|
74
|
+
),
|
|
75
|
+
['Name', 'ID', 'Source', 'Ref ID', 'Status', 'Execs', 'Created']
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return result;
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export default listSubcommand;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Logger, WorkflowService } from '@agentuity/core';
|
|
2
|
+
import { createServerFetchAdapter } from '@agentuity/server';
|
|
3
|
+
import { getCatalystUrl } from '../../../catalyst';
|
|
4
|
+
import { defaultProfileName, getDefaultRegion } from '../../../config';
|
|
5
|
+
import * as tui from '../../../tui';
|
|
6
|
+
import type { AuthData, Config, GlobalOptions } from '../../../types';
|
|
7
|
+
|
|
8
|
+
export interface WorkflowContext {
|
|
9
|
+
logger: Logger;
|
|
10
|
+
auth: AuthData;
|
|
11
|
+
config: Config | null;
|
|
12
|
+
options: GlobalOptions;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function createWorkflowAdapter(ctx: WorkflowContext) {
|
|
16
|
+
const orgId =
|
|
17
|
+
ctx.options.orgId ?? (process.env.AGENTUITY_CLOUD_ORG_ID || ctx.config?.preferences?.orgId);
|
|
18
|
+
if (!orgId) {
|
|
19
|
+
tui.fatal('Organization ID is required. Use --org-id flag or set AGENTUITY_CLOUD_ORG_ID.');
|
|
20
|
+
}
|
|
21
|
+
const adapter = createServerFetchAdapter(
|
|
22
|
+
{ headers: { Authorization: `Bearer ${ctx.auth.apiKey}`, 'x-agentuity-orgid': orgId } },
|
|
23
|
+
ctx.logger
|
|
24
|
+
);
|
|
25
|
+
const region = await getDefaultRegion(ctx.config?.name ?? defaultProfileName, ctx.config);
|
|
26
|
+
const baseUrl = getCatalystUrl(region, ctx.config?.overrides);
|
|
27
|
+
return new WorkflowService(baseUrl, adapter);
|
|
28
|
+
}
|