@applica-software-guru/persona-sdk 0.1.101 → 0.1.102

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.
@@ -25,4 +25,70 @@ export class WorkflowExecutionsApi extends HttpApi {
25
25
  async queue(workflowId: string, request: ExecuteRequest): Promise<Execution> {
26
26
  return this.httpPost<Execution>('/workflows/' + workflowId + '/executions/queue', request);
27
27
  }
28
+
29
+ /** Runs across all workflows in the project (filter by status/workflow/date). */
30
+ async listRuns(filters: {
31
+ status?: string;
32
+ workflowId?: string;
33
+ dateFrom?: string;
34
+ dateTo?: string;
35
+ page?: number;
36
+ size?: number;
37
+ } = {}): Promise<Paginated<Execution>> {
38
+ const { page, size } = this.normalizePageParams(filters.page, filters.size);
39
+ const params: Record<string, unknown> = { page, size };
40
+ if (filters.status) params.status = filters.status;
41
+ if (filters.workflowId) params.workflowId = filters.workflowId;
42
+ if (filters.dateFrom) params.dateFrom = filters.dateFrom;
43
+ if (filters.dateTo) params.dateTo = filters.dateTo;
44
+ return this.httpGet<Paginated<Execution>>('/executions', params);
45
+ }
46
+
47
+ /** Request cancellation of a running/waiting execution (cascades to sub-workflows). */
48
+ async cancel(workflowId: string, executionId: string): Promise<Execution> {
49
+ return this.httpPost<Execution>(
50
+ '/workflows/' + workflowId + '/executions/' + executionId + '/cancel',
51
+ {},
52
+ );
53
+ }
54
+
55
+ /** Re-run an execution from a given node. mode: 'reuse_outputs' | 'fresh'. */
56
+ async rerun(
57
+ workflowId: string,
58
+ executionId: string,
59
+ fromNodeId: string,
60
+ mode: 'reuse_outputs' | 'fresh' = 'reuse_outputs',
61
+ ): Promise<Execution> {
62
+ return this.httpPost<Execution>(
63
+ '/workflows/' + workflowId + '/executions/' + executionId + '/rerun',
64
+ { fromNodeId, mode },
65
+ );
66
+ }
67
+
68
+ /** Execute a single node in isolation with the given inputs (debugging). */
69
+ async dryRunNode(
70
+ workflowId: string,
71
+ nodeId: string,
72
+ inputs: Record<string, unknown> = {},
73
+ ): Promise<Record<string, unknown>> {
74
+ return this.httpPost<Record<string, unknown>>(
75
+ '/workflows/' + workflowId + '/nodes/' + nodeId + '/dry-run',
76
+ { inputs },
77
+ );
78
+ }
79
+
80
+ /** Normalized action trace of an agent step (reasoning, tool calls, messages). */
81
+ async stepTrace(
82
+ workflowId: string,
83
+ executionId: string,
84
+ stepId: string,
85
+ page?: number,
86
+ size?: number,
87
+ ): Promise<Record<string, unknown>> {
88
+ const { page: p, size: s } = this.normalizePageParams(page, size ?? 200);
89
+ return this.httpGet<Record<string, unknown>>(
90
+ '/workflows/' + workflowId + '/executions/' + executionId + '/steps/' + stepId + '/trace',
91
+ { page: p, size: s },
92
+ );
93
+ }
28
94
  }
@@ -4,6 +4,7 @@ import { AuthenticationProvider } from '../auth/authentication-provider';
4
4
  import { Revision } from '../revisions/types';
5
5
  import { Workflow } from './types';
6
6
  import { WorkflowExecutionsApi } from './workflow-executions-api';
7
+ import { HumanTasksApi } from './human-tasks-api';
7
8
 
8
9
  export class WorkflowsApi extends HttpApi {
9
10
  constructor(baseUrl: string, auth: string | AuthenticationProvider) {
@@ -38,6 +39,10 @@ export class WorkflowsApi extends HttpApi {
38
39
  return new WorkflowExecutionsApi(this.getBaseUrl(), this.getAuthProvider());
39
40
  }
40
41
 
42
+ humanTasks(): HumanTasksApi {
43
+ return new HumanTasksApi(this.getBaseUrl(), this.getAuthProvider());
44
+ }
45
+
41
46
  async listRevisions(workflowId: string): Promise<Revision[]> {
42
47
  return this.httpGet<Revision[]>('/workflows/' + workflowId + '/revisions');
43
48
  }