@amaster.ai/client 1.1.43-beta.2 → 1.1.43-beta.4

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/index.d.cts CHANGED
@@ -5,7 +5,7 @@ export { EntityGetParams, EntityListResponse, EntityQueryParams, FilterGroup, Fi
5
5
  import { BpmClient } from '@amaster.ai/bpm-client';
6
6
  export { ActivityInstanceTree, CamundaVariable, HistoryActivityInstance, HistoryProcessInstance, HistoryTask, ProcessInstance, ProcessVariable, Task, TaskFormSchema, TaskQueryParams, UserOperationLog } from '@amaster.ai/bpm-client';
7
7
  import { WorkflowClient } from '@amaster.ai/workflow-client';
8
- export { WorkflowFile, WorkflowInputValue, WorkflowNodeUsage, WorkflowRunRequest, WorkflowRunResponse, WorkflowRunUsage, WorkflowUsageSummary } from '@amaster.ai/workflow-client';
8
+ export { WorkflowAsyncRunDetailResponse, WorkflowAsyncRunResponse, WorkflowAsyncRunStatus, WorkflowCallbackConfig, WorkflowFile, WorkflowInputValue, WorkflowNodeUsage, WorkflowRunDetailOptions, WorkflowRunRequest, WorkflowRunResponse, WorkflowRunUsage, WorkflowUsageSummary } from '@amaster.ai/workflow-client';
9
9
  import { ASRClientConfig, ASRClient, ASRHttpClientConfig, ASRHttpClient } from '@amaster.ai/asr-client';
10
10
  export { ASRClient, ASRClientConfig, ASRHttpClient, ASRHttpClientConfig, ASRLanguage } from '@amaster.ai/asr-client';
11
11
  import { CopilotClient } from '@amaster.ai/copilot-client';
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { EntityGetParams, EntityListResponse, EntityQueryParams, FilterGroup, Fi
5
5
  import { BpmClient } from '@amaster.ai/bpm-client';
6
6
  export { ActivityInstanceTree, CamundaVariable, HistoryActivityInstance, HistoryProcessInstance, HistoryTask, ProcessInstance, ProcessVariable, Task, TaskFormSchema, TaskQueryParams, UserOperationLog } from '@amaster.ai/bpm-client';
7
7
  import { WorkflowClient } from '@amaster.ai/workflow-client';
8
- export { WorkflowFile, WorkflowInputValue, WorkflowNodeUsage, WorkflowRunRequest, WorkflowRunResponse, WorkflowRunUsage, WorkflowUsageSummary } from '@amaster.ai/workflow-client';
8
+ export { WorkflowAsyncRunDetailResponse, WorkflowAsyncRunResponse, WorkflowAsyncRunStatus, WorkflowCallbackConfig, WorkflowFile, WorkflowInputValue, WorkflowNodeUsage, WorkflowRunDetailOptions, WorkflowRunRequest, WorkflowRunResponse, WorkflowRunUsage, WorkflowUsageSummary } from '@amaster.ai/workflow-client';
9
9
  import { ASRClientConfig, ASRClient, ASRHttpClientConfig, ASRHttpClient } from '@amaster.ai/asr-client';
10
10
  export { ASRClient, ASRClientConfig, ASRHttpClient, ASRHttpClientConfig, ASRLanguage } from '@amaster.ai/asr-client';
11
11
  import { CopilotClient } from '@amaster.ai/copilot-client';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/client",
3
- "version": "1.1.43-beta.2",
3
+ "version": "1.1.43-beta.4",
4
4
  "description": "Unified API client for Amaster platform - All services in one package",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -72,16 +72,16 @@
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
74
  "dependencies": {
75
- "@amaster.ai/asr-client": "1.1.43-beta.2",
76
- "@amaster.ai/bpm-client": "1.1.43-beta.2",
77
- "@amaster.ai/function-client": "1.1.43-beta.2",
78
- "@amaster.ai/auth-client": "1.1.43-beta.2",
79
- "@amaster.ai/copilot-client": "1.1.43-beta.2",
80
- "@amaster.ai/entity-client": "1.1.43-beta.2",
81
- "@amaster.ai/tts-client": "1.1.43-beta.2",
82
- "@amaster.ai/s3-client": "1.1.43-beta.2",
83
- "@amaster.ai/http-client": "1.1.43-beta.2",
84
- "@amaster.ai/workflow-client": "1.1.43-beta.2"
75
+ "@amaster.ai/bpm-client": "1.1.43-beta.4",
76
+ "@amaster.ai/asr-client": "1.1.43-beta.4",
77
+ "@amaster.ai/copilot-client": "1.1.43-beta.4",
78
+ "@amaster.ai/auth-client": "1.1.43-beta.4",
79
+ "@amaster.ai/s3-client": "1.1.43-beta.4",
80
+ "@amaster.ai/http-client": "1.1.43-beta.4",
81
+ "@amaster.ai/function-client": "1.1.43-beta.4",
82
+ "@amaster.ai/workflow-client": "1.1.43-beta.4",
83
+ "@amaster.ai/entity-client": "1.1.43-beta.4",
84
+ "@amaster.ai/tts-client": "1.1.43-beta.4"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "axios": "^1.11.0"
package/types/index.d.ts CHANGED
@@ -399,7 +399,12 @@ export type {
399
399
  } from "./bpm";
400
400
  export type {
401
401
  WorkflowClientAPI,
402
+ WorkflowAsyncRunDetailResponse,
403
+ WorkflowAsyncRunResponse,
404
+ WorkflowAsyncRunStatus,
405
+ WorkflowCallbackConfig,
402
406
  WorkflowNodeUsage,
407
+ WorkflowRunDetailOptions,
403
408
  WorkflowRunRequest,
404
409
  WorkflowRunResponse,
405
410
  WorkflowRunUsage,
@@ -9,8 +9,9 @@ import type { ClientResult } from './common';
9
9
  * Workflow execution response mode
10
10
  * - `blocking`: Wait for workflow completion (default)
11
11
  * - `streaming`: Stream workflow execution progress
12
+ * - `async`: Submit workflow execution and return immediately
12
13
  */
13
- export type WorkflowResponseMode = 'blocking' | 'streaming';
14
+ export type WorkflowResponseMode = 'blocking' | 'streaming' | 'async';
14
15
 
15
16
  /**
16
17
  * Workflow input value (can be any JSON-serializable type)
@@ -39,6 +40,20 @@ export interface WorkflowFile {
39
40
  [key: string]: unknown;
40
41
  }
41
42
 
43
+ /**
44
+ * Callback config for async workflow runs.
45
+ */
46
+ export interface WorkflowCallbackConfig {
47
+ /** Edge Function name, for example `workflow-callback` */
48
+ name?: string;
49
+ /** Include workflow outputs in callback payload */
50
+ include_outputs?: boolean;
51
+ /** Include usage in callback payload */
52
+ include_usage?: boolean;
53
+ /** Include node-level usage detail */
54
+ usage_detail?: boolean;
55
+ }
56
+
42
57
  /**
43
58
  * Workflow execution request parameters
44
59
  *
@@ -65,6 +80,8 @@ export interface WorkflowRunRequest {
65
80
  usage?: boolean;
66
81
  /** Include node-level usage details when `usage` is enabled */
67
82
  usage_detail?: boolean;
83
+ /** Callback config for async workflow runs */
84
+ callback?: WorkflowCallbackConfig;
68
85
  }
69
86
 
70
87
  /**
@@ -142,6 +159,54 @@ export interface WorkflowRunResponse<TOutput = Record<string, unknown>> {
142
159
  usage?: WorkflowRunUsage;
143
160
  }
144
161
 
162
+ /**
163
+ * Async workflow run status.
164
+ */
165
+ export type WorkflowAsyncRunStatus =
166
+ | 'pending'
167
+ | 'queued'
168
+ | 'running'
169
+ | 'succeeded'
170
+ | 'failed'
171
+ | 'paused'
172
+ | 'rate_limited'
173
+ | 'retrying'
174
+ | string;
175
+
176
+ /**
177
+ * Response returned immediately by runAsync.
178
+ */
179
+ export interface WorkflowAsyncRunResponse {
180
+ async_run_id: string;
181
+ workflow_trigger_log_id: string;
182
+ workflow_run_id: string | null;
183
+ task_id?: string;
184
+ status: WorkflowAsyncRunStatus;
185
+ queue?: string;
186
+ created_at?: number | null;
187
+ }
188
+
189
+ /**
190
+ * Async workflow run detail response.
191
+ */
192
+ export interface WorkflowAsyncRunDetailResponse extends WorkflowAsyncRunResponse {
193
+ workflow_id?: string;
194
+ error?: string | null;
195
+ outputs?: Record<string, unknown> | null;
196
+ elapsed_time?: number | null;
197
+ total_tokens?: number | null;
198
+ triggered_at?: number | null;
199
+ finished_at?: number | null;
200
+ }
201
+
202
+ /**
203
+ * Workflow run detail query options.
204
+ */
205
+ export interface WorkflowRunDetailOptions {
206
+ usage?: boolean;
207
+ usage_detail?: boolean;
208
+ }
209
+
145
210
  // ==================== Workflow Client API ====================
146
211
 
147
212
  /**
@@ -189,4 +254,29 @@ export interface WorkflowClientAPI {
189
254
  workflowName: string,
190
255
  inputs?: Record<string, WorkflowInputValue> | WorkflowRunRequest
191
256
  ): Promise<ClientResult<WorkflowRunResponse<TOutput>>>;
257
+
258
+ /**
259
+ * Submit a workflow asynchronously and return immediately.
260
+ */
261
+ runAsync(
262
+ workflowName: string,
263
+ inputs?: Record<string, WorkflowInputValue> | WorkflowRunRequest
264
+ ): Promise<ClientResult<WorkflowAsyncRunResponse>>;
265
+
266
+ /**
267
+ * Get async workflow submission status.
268
+ */
269
+ getAsyncRun(
270
+ workflowName: string,
271
+ asyncRunId: string
272
+ ): Promise<ClientResult<WorkflowAsyncRunDetailResponse>>;
273
+
274
+ /**
275
+ * Get workflow run detail and optional usage.
276
+ */
277
+ getRun<TOutput = Record<string, unknown>>(
278
+ workflowName: string,
279
+ workflowRunId: string,
280
+ options?: WorkflowRunDetailOptions
281
+ ): Promise<ClientResult<WorkflowRunResponse<TOutput>>>;
192
282
  }