@lunnoa/client 0.0.0-development
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/LICENSE +202 -0
- package/README.md +338 -0
- package/dist/cli.js +2635 -0
- package/dist/index.cjs +2141 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7211 -0
- package/dist/index.d.ts +7211 -0
- package/dist/index.js +2094 -0
- package/dist/index.js.map +1 -0
- package/dist/react.cjs +2640 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +3533 -0
- package/dist/react.d.ts +3533 -0
- package/dist/react.js +2630 -0
- package/dist/react.js.map +1 -0
- package/package.json +110 -0
package/dist/react.d.cts
ADDED
|
@@ -0,0 +1,3533 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { UIMessage, UIMessageChunk } from 'ai';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Pluggable storage for Pattern B JWTs.
|
|
7
|
+
* The SDK never uses httpOnly cookies: Automate auth is bearer JWT based.
|
|
8
|
+
*/
|
|
9
|
+
interface TokenStore {
|
|
10
|
+
getAccessToken(): string | null | Promise<string | null>;
|
|
11
|
+
getRefreshToken(): string | null | Promise<string | null>;
|
|
12
|
+
setTokens(tokens: {
|
|
13
|
+
accessToken: string;
|
|
14
|
+
refreshToken?: string;
|
|
15
|
+
}): void | Promise<void>;
|
|
16
|
+
clear(): void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type FetchLike = (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
20
|
+
interface LunnoaClientOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Base URL of the Lunnoa Automate deployment, e.g. `https://lunnoa.acme.example`.
|
|
23
|
+
* Paths are appended under `/api/*`.
|
|
24
|
+
*/
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
/**
|
|
27
|
+
* Server-side machine credential (`lna_...`). Never usable in browsers —
|
|
28
|
+
* the constructor throws if one is supplied while `window` exists.
|
|
29
|
+
*/
|
|
30
|
+
apiKey?: string;
|
|
31
|
+
/**
|
|
32
|
+
* User JWT obtained from login / SSO. The supported credential for browser
|
|
33
|
+
* applications. May be a function so refreshed tokens are picked up per request.
|
|
34
|
+
*
|
|
35
|
+
* Prefer {@link tokenStore} for Pattern B so login/refresh can persist tokens
|
|
36
|
+
* and optionally auto-refresh on 401.
|
|
37
|
+
*/
|
|
38
|
+
accessToken?: string | (() => string | Promise<string>);
|
|
39
|
+
/**
|
|
40
|
+
* Optional JWT store for Pattern B. When set, authenticated requests read
|
|
41
|
+
* the access token from the store. Login / refresh helpers write back into it.
|
|
42
|
+
*/
|
|
43
|
+
tokenStore?: TokenStore;
|
|
44
|
+
/**
|
|
45
|
+
* When true (default if `tokenStore` is set), a 401 triggers one
|
|
46
|
+
* `POST /api/auth/refresh-token` attempt using the stored refresh token,
|
|
47
|
+
* then retries the original request.
|
|
48
|
+
*/
|
|
49
|
+
autoRefresh?: boolean;
|
|
50
|
+
/** Custom fetch implementation (testing, polyfills, interceptors). */
|
|
51
|
+
fetch?: FetchLike;
|
|
52
|
+
/** Extra headers sent with every request. */
|
|
53
|
+
headers?: Record<string, string>;
|
|
54
|
+
}
|
|
55
|
+
type QueryValue = string | number | boolean | undefined | null;
|
|
56
|
+
interface RequestOptions {
|
|
57
|
+
query?: Record<string, QueryValue>;
|
|
58
|
+
body?: unknown;
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
headers?: Record<string, string>;
|
|
61
|
+
/**
|
|
62
|
+
* Return the raw Response instead of parsing JSON. Used by the streaming
|
|
63
|
+
* module and endpoints that may legitimately return 204.
|
|
64
|
+
*/
|
|
65
|
+
raw?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Skip the Authorization header. Used for public auth endpoints
|
|
68
|
+
* (login, refresh, SSO providers).
|
|
69
|
+
*/
|
|
70
|
+
skipAuth?: boolean;
|
|
71
|
+
/** Internal: set after an auto-refresh retry so we do not loop. */
|
|
72
|
+
_retriedAfterRefresh?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Minimal typed HTTP layer shared by every resource namespace. Handles auth
|
|
76
|
+
* header resolution, query serialisation, JSON parsing, and error mapping.
|
|
77
|
+
*/
|
|
78
|
+
declare class HttpClient {
|
|
79
|
+
readonly baseUrl: string;
|
|
80
|
+
readonly tokenStore?: TokenStore;
|
|
81
|
+
/** Underlying fetch (shared with AI SDK transports when needed). */
|
|
82
|
+
readonly fetch: FetchLike;
|
|
83
|
+
private readonly apiKey?;
|
|
84
|
+
private readonly accessToken?;
|
|
85
|
+
private readonly autoRefresh;
|
|
86
|
+
private readonly defaultHeaders;
|
|
87
|
+
private refreshInFlight;
|
|
88
|
+
constructor(options: LunnoaClientOptions);
|
|
89
|
+
resolveAuthHeader(): Promise<string>;
|
|
90
|
+
buildUrl(path: string, query?: Record<string, QueryValue>): string;
|
|
91
|
+
request<T>(method: string, path: string, options: RequestOptions & {
|
|
92
|
+
raw: true;
|
|
93
|
+
}): Promise<Response>;
|
|
94
|
+
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
95
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
96
|
+
post<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
97
|
+
patch<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
98
|
+
put<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
99
|
+
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
100
|
+
/**
|
|
101
|
+
* Single-flight refresh using the token store. Returns false when refresh
|
|
102
|
+
* is impossible or fails (store is cleared on failure).
|
|
103
|
+
*/
|
|
104
|
+
tryRefreshAccessToken(): Promise<boolean>;
|
|
105
|
+
private performRefresh;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
type ChatMode = 'builder' | 'preview';
|
|
109
|
+
interface StreamMessageOptions {
|
|
110
|
+
/** Agent chat mode; defaults to the server default (`builder`). */
|
|
111
|
+
chatMode?: ChatMode;
|
|
112
|
+
/** Abort the stream (closes the HTTP connection; the run keeps going server-side — call `stop` to cancel it). */
|
|
113
|
+
signal?: AbortSignal;
|
|
114
|
+
}
|
|
115
|
+
interface StopStreamOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Partial assistant message (AI SDK UIMessage) received so far; the server
|
|
118
|
+
* persists it so the partial turn is not lost.
|
|
119
|
+
*/
|
|
120
|
+
assistantMessage?: UIMessage;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* An in-flight agent chat turn, exposed as an async iterable of AI SDK
|
|
124
|
+
* `UIMessageChunk`s (`text-delta`, `tool-*`, `finish`, ...).
|
|
125
|
+
*
|
|
126
|
+
* ```ts
|
|
127
|
+
* const stream = await client.agentChat.streamMessage(agentId, taskId, message);
|
|
128
|
+
* for await (const chunk of stream) {
|
|
129
|
+
* if (chunk.type === 'text-delta') process.stdout.write(chunk.delta);
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* Use {@link AgentChatStream.toUIMessageStream} with the AI SDK's
|
|
134
|
+
* `readUIMessageStream` to consume assembled `UIMessage` snapshots instead of
|
|
135
|
+
* raw chunks.
|
|
136
|
+
*/
|
|
137
|
+
declare class AgentChatStream implements AsyncIterable<UIMessageChunk> {
|
|
138
|
+
private readonly response;
|
|
139
|
+
private readonly options?;
|
|
140
|
+
/**
|
|
141
|
+
* Server run id of this turn (`X-Task-Run-Id` response header), when
|
|
142
|
+
* provided. Useful for diagnostics.
|
|
143
|
+
*/
|
|
144
|
+
readonly runId: string | null;
|
|
145
|
+
private consumed;
|
|
146
|
+
constructor(response: Response, options?: {
|
|
147
|
+
signal?: AbortSignal;
|
|
148
|
+
} | undefined);
|
|
149
|
+
[Symbol.asyncIterator](): AsyncGenerator<UIMessageChunk, void, undefined>;
|
|
150
|
+
chunks(): AsyncGenerator<UIMessageChunk, void, undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* The same chunks as a web `ReadableStream`, ready for the AI SDK's
|
|
153
|
+
* `readUIMessageStream({ stream })` to assemble into `UIMessage` snapshots.
|
|
154
|
+
*/
|
|
155
|
+
toUIMessageStream(): ReadableStream<UIMessageChunk>;
|
|
156
|
+
/** Collects the full text of the turn (concatenated `text-delta` chunks). */
|
|
157
|
+
text(): Promise<string>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Hand-written client for the Agent Runtime SSE endpoints
|
|
161
|
+
* (`POST/GET /api/agents/:agentId/tasks/:taskId/stream-message` and `/stop`).
|
|
162
|
+
* Code generators handle SSE poorly, so this module wraps the wire protocol
|
|
163
|
+
* the bundled UI uses (AI SDK UIMessage chunks, SSE-framed, resumable).
|
|
164
|
+
*/
|
|
165
|
+
declare class AgentChatClient {
|
|
166
|
+
private readonly http;
|
|
167
|
+
constructor(http: HttpClient);
|
|
168
|
+
/**
|
|
169
|
+
* Sends a user message to an agent task and streams the assistant turn.
|
|
170
|
+
* Creates the task row when `taskId` does not exist yet (client-generated
|
|
171
|
+
* UUIDs are supported, mirroring the bundled UI).
|
|
172
|
+
*
|
|
173
|
+
* `message` may be a plain string (wrapped into a UIMessage) or a full AI
|
|
174
|
+
* SDK `UIMessage`.
|
|
175
|
+
*/
|
|
176
|
+
streamMessage(agentId: string, taskId: string, message: string | UIMessage, options?: StreamMessageOptions): Promise<AgentChatStream>;
|
|
177
|
+
/**
|
|
178
|
+
* Reattaches to an in-flight agent turn after a disconnect (the resumable
|
|
179
|
+
* stream replays from the beginning of the turn). Returns `null` when
|
|
180
|
+
* there is no active stream to resume (server responds 204).
|
|
181
|
+
*/
|
|
182
|
+
resumeStream(agentId: string, taskId: string, options?: {
|
|
183
|
+
signal?: AbortSignal;
|
|
184
|
+
}): Promise<AgentChatStream | null>;
|
|
185
|
+
/**
|
|
186
|
+
* Requests cancellation of the active agent turn for a task. Idempotent:
|
|
187
|
+
* succeeds even when no stream is active. Optionally persists the partial
|
|
188
|
+
* assistant message received so far.
|
|
189
|
+
*/
|
|
190
|
+
stop(agentId: string, taskId: string, options?: StopStreamOptions): Promise<{
|
|
191
|
+
ok: boolean;
|
|
192
|
+
}>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
interface components {
|
|
196
|
+
schemas: {
|
|
197
|
+
AuthMethodFlagsDto: {
|
|
198
|
+
/** @description True when password-based login is disabled for this deployment (via AUTH_DISABLED_METHODS). */
|
|
199
|
+
passwordDisabled: boolean;
|
|
200
|
+
/** @description True when Google sign-in is disabled for this deployment (via AUTH_DISABLED_METHODS). */
|
|
201
|
+
googleDisabled: boolean;
|
|
202
|
+
};
|
|
203
|
+
EnabledFeaturesResponseDto: {
|
|
204
|
+
/** @description Whether the Workflows feature is enabled. Always enabled. */
|
|
205
|
+
WORKFLOWS: boolean;
|
|
206
|
+
/** @description Whether the Agents feature is enabled. */
|
|
207
|
+
AGENTS: boolean;
|
|
208
|
+
/** @description Whether the Connections feature is enabled. Always enabled. */
|
|
209
|
+
CONNECTIONS: boolean;
|
|
210
|
+
/** @description Whether the Variables feature is enabled. Always enabled. */
|
|
211
|
+
VARIABLES: boolean;
|
|
212
|
+
/** @description Whether the Knowledge feature is enabled. Requires storage (S3 or database-configured storage) and a vector database. */
|
|
213
|
+
KNOWLEDGE: boolean;
|
|
214
|
+
/** @description Whether email sending is enabled. Requires an active email configuration. */
|
|
215
|
+
EMAILS: boolean;
|
|
216
|
+
/** @description Whether web search is enabled. Requires a Serper API key. */
|
|
217
|
+
WEB_SEARCH: boolean;
|
|
218
|
+
/** @description Whether dynamic web content extraction is enabled. Requires an Apify configuration. */
|
|
219
|
+
WEB_EXTRACTION_DYNAMIC: boolean;
|
|
220
|
+
/** @description Whether static web content extraction is enabled. Requires an Apify configuration. */
|
|
221
|
+
WEB_EXTRACTION_STATIC: boolean;
|
|
222
|
+
/** @description Whether the phone calling feature is enabled. Requires a VAPI API key. */
|
|
223
|
+
CALLING: boolean;
|
|
224
|
+
/** @description Whether the Teams feature is enabled. Always enabled. */
|
|
225
|
+
TEAMS: boolean;
|
|
226
|
+
/** @description Whether the Skills feature is enabled. */
|
|
227
|
+
SKILLS: boolean;
|
|
228
|
+
/** @description Whether the hexagonal agent builder canvas UI is enabled. */
|
|
229
|
+
AGENT_BUILDER_CANVAS: boolean;
|
|
230
|
+
/** @description Whether isolated code execution for agents is enabled. */
|
|
231
|
+
CODE_EXECUTION: boolean;
|
|
232
|
+
/** @description Whether SSO (OIDC) login is enabled. Requires at least one enabled SSO provider. */
|
|
233
|
+
SSO: boolean;
|
|
234
|
+
/** @description Whether SCIM provisioning is configured. True when at least one active (non-revoked) SCIM bearer token exists. */
|
|
235
|
+
SCIM: boolean;
|
|
236
|
+
/** @description Availability of authentication methods for this deployment. */
|
|
237
|
+
AUTH_METHODS: components["schemas"]["AuthMethodFlagsDto"];
|
|
238
|
+
};
|
|
239
|
+
CreateProjectDto: {
|
|
240
|
+
/** @description Name of the project. */
|
|
241
|
+
name: string;
|
|
242
|
+
/** @description Description of the project. */
|
|
243
|
+
description?: string;
|
|
244
|
+
};
|
|
245
|
+
ProjectCountDto: {
|
|
246
|
+
/** @description Number of agents in the project. */
|
|
247
|
+
agents?: number;
|
|
248
|
+
/** @description Number of variables in the project. */
|
|
249
|
+
variables?: number;
|
|
250
|
+
/** @description Number of workflows in the project. */
|
|
251
|
+
workflows?: number;
|
|
252
|
+
};
|
|
253
|
+
ProjectCreatedByUserDto: {
|
|
254
|
+
/** @description User ID. */
|
|
255
|
+
id: string;
|
|
256
|
+
/** @description User email address. */
|
|
257
|
+
email: string;
|
|
258
|
+
/** @description User display name. */
|
|
259
|
+
name: string;
|
|
260
|
+
};
|
|
261
|
+
ProjectCreatedByWorkspaceUserDto: {
|
|
262
|
+
/** @description Workspace user ID. */
|
|
263
|
+
id: string;
|
|
264
|
+
/** @description The underlying user. */
|
|
265
|
+
user: components["schemas"]["ProjectCreatedByUserDto"];
|
|
266
|
+
};
|
|
267
|
+
ProjectWorkflowSummaryDto: {
|
|
268
|
+
/** @description Workflow ID. */
|
|
269
|
+
id: string;
|
|
270
|
+
/** @description Workflow name. */
|
|
271
|
+
name: string;
|
|
272
|
+
};
|
|
273
|
+
ProjectResponseDto: {
|
|
274
|
+
/** @description Project ID. */
|
|
275
|
+
id: string;
|
|
276
|
+
/** @description Project name. */
|
|
277
|
+
name: string;
|
|
278
|
+
/** @description Project description. Included when `expansion=description` is requested. */
|
|
279
|
+
description?: string;
|
|
280
|
+
/**
|
|
281
|
+
* Format: date-time
|
|
282
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
283
|
+
*/
|
|
284
|
+
createdAt?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Format: date-time
|
|
287
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
288
|
+
*/
|
|
289
|
+
updatedAt?: string;
|
|
290
|
+
/** @description Aggregate counts. Included when `expansion=countAgents` is requested; countVariables and countWorkflows add their respective counts. */
|
|
291
|
+
_count?: components["schemas"]["ProjectCountDto"];
|
|
292
|
+
/** @description Workspace user who created the project. Included when `expansion=createdByWorkspaceUser` is requested. */
|
|
293
|
+
createdByWorkspaceUser?: components["schemas"]["ProjectCreatedByWorkspaceUserDto"];
|
|
294
|
+
/** @description Workflows in the project. Included when `expansion=workflows` is requested. */
|
|
295
|
+
workflows?: components["schemas"]["ProjectWorkflowSummaryDto"][];
|
|
296
|
+
};
|
|
297
|
+
CreateQueueDto: {
|
|
298
|
+
/** @description Human-readable name for the queue. */
|
|
299
|
+
name: string;
|
|
300
|
+
/** @description Description of what the queue is used for. */
|
|
301
|
+
description?: string;
|
|
302
|
+
/** @description Maximum number of retry attempts per item. Defaults to 3. */
|
|
303
|
+
maxRetries?: number;
|
|
304
|
+
/** @description Delay in minutes before a failed item becomes eligible for retry. Defaults to 60. */
|
|
305
|
+
retryDelayMinutes?: number;
|
|
306
|
+
/** @description Number of items fetched per processing batch. Defaults to 10. */
|
|
307
|
+
batchSize?: number;
|
|
308
|
+
/** @description Default priority for items in this queue. Higher values are processed first. Defaults to 0. */
|
|
309
|
+
priority?: number;
|
|
310
|
+
};
|
|
311
|
+
QueueProjectSummaryDto: {
|
|
312
|
+
/** @description Project ID. */
|
|
313
|
+
id: string;
|
|
314
|
+
/** @description Project name. */
|
|
315
|
+
name: string;
|
|
316
|
+
};
|
|
317
|
+
QueueWorkspaceSummaryDto: {
|
|
318
|
+
/** @description Workspace ID. */
|
|
319
|
+
id: string;
|
|
320
|
+
/** @description Workspace name. */
|
|
321
|
+
name: string;
|
|
322
|
+
};
|
|
323
|
+
QueueCreatedByUserSummaryDto: {
|
|
324
|
+
/** @description User ID. */
|
|
325
|
+
id: string;
|
|
326
|
+
/** @description User email address. */
|
|
327
|
+
email: string;
|
|
328
|
+
/** @description User display name. */
|
|
329
|
+
name: string;
|
|
330
|
+
};
|
|
331
|
+
QueueCreatedByWorkspaceUserDto: {
|
|
332
|
+
/** @description Workspace user ID. */
|
|
333
|
+
id: string;
|
|
334
|
+
/** @description User account behind the workspace user. */
|
|
335
|
+
user: components["schemas"]["QueueCreatedByUserSummaryDto"];
|
|
336
|
+
};
|
|
337
|
+
QueueItemCountsDto: {
|
|
338
|
+
/** @description Number of items in the queue. */
|
|
339
|
+
items: number;
|
|
340
|
+
};
|
|
341
|
+
QueueResponseDto: {
|
|
342
|
+
/** @description Queue ID. */
|
|
343
|
+
id: string;
|
|
344
|
+
/** @description Queue name. */
|
|
345
|
+
name: string;
|
|
346
|
+
/** @description Whether the queue is active. Inactive queues do not accept processing. */
|
|
347
|
+
isActive: boolean;
|
|
348
|
+
/** @description Default priority for items in this queue. */
|
|
349
|
+
priority: number;
|
|
350
|
+
/** @description Maximum number of retry attempts per item. Not included in list responses. */
|
|
351
|
+
maxRetries?: number;
|
|
352
|
+
/** @description Delay in minutes before a failed item becomes eligible for retry. Not included in list responses. */
|
|
353
|
+
retryDelayMinutes?: number;
|
|
354
|
+
/** @description Number of items fetched per processing batch. Not included in list responses. */
|
|
355
|
+
batchSize?: number;
|
|
356
|
+
/** @description Queue description. Included when `expansion=description` is requested. */
|
|
357
|
+
description?: string | null;
|
|
358
|
+
/**
|
|
359
|
+
* Format: date-time
|
|
360
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
361
|
+
*/
|
|
362
|
+
createdAt?: string;
|
|
363
|
+
/**
|
|
364
|
+
* Format: date-time
|
|
365
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
366
|
+
*/
|
|
367
|
+
updatedAt?: string;
|
|
368
|
+
/** @description Total number of items. Included when `expansion=statistics` is requested. */
|
|
369
|
+
totalItems?: number;
|
|
370
|
+
/** @description Number of pending items. Included when `expansion=statistics` is requested. */
|
|
371
|
+
pendingItems?: number;
|
|
372
|
+
/** @description Number of items being processed. Included when `expansion=statistics` is requested. */
|
|
373
|
+
processingItems?: number;
|
|
374
|
+
/** @description Number of successfully processed items. Included when `expansion=statistics` is requested. */
|
|
375
|
+
successItems?: number;
|
|
376
|
+
/** @description Number of failed items. Included when `expansion=statistics` is requested. */
|
|
377
|
+
failedItems?: number;
|
|
378
|
+
/** @description Owning project. Included when `expansion=project` is requested. */
|
|
379
|
+
project?: components["schemas"]["QueueProjectSummaryDto"];
|
|
380
|
+
/** @description Owning workspace. Included when `expansion=workspace` is requested. */
|
|
381
|
+
workspace?: components["schemas"]["QueueWorkspaceSummaryDto"];
|
|
382
|
+
/** @description Workspace user who created the queue. Included when `expansion=createdByWorkspaceUser` is requested. */
|
|
383
|
+
createdByWorkspaceUser?: components["schemas"]["QueueCreatedByWorkspaceUserDto"];
|
|
384
|
+
/** @description Relation counts. Included when `expansion=itemCounts` is requested. */
|
|
385
|
+
_count?: components["schemas"]["QueueItemCountsDto"];
|
|
386
|
+
};
|
|
387
|
+
QueueStatsResponseDto: {
|
|
388
|
+
/** @description Total number of items in the queue. */
|
|
389
|
+
totalItems: number;
|
|
390
|
+
/** @description Number of items awaiting processing. */
|
|
391
|
+
pendingItems: number;
|
|
392
|
+
/** @description Number of items currently being processed. */
|
|
393
|
+
processingItems: number;
|
|
394
|
+
/** @description Number of successfully processed items. */
|
|
395
|
+
successItems: number;
|
|
396
|
+
/** @description Number of items that failed permanently. */
|
|
397
|
+
failedItems: number;
|
|
398
|
+
/** @description Number of items awaiting a retry attempt. */
|
|
399
|
+
retryingItems: number;
|
|
400
|
+
};
|
|
401
|
+
UpdateQueueDto: {
|
|
402
|
+
/** @description Human-readable name for the queue. */
|
|
403
|
+
name?: string;
|
|
404
|
+
/** @description Description of what the queue is used for. */
|
|
405
|
+
description?: string;
|
|
406
|
+
/** @description Maximum number of retry attempts per item. Defaults to 3. */
|
|
407
|
+
maxRetries?: number;
|
|
408
|
+
/** @description Delay in minutes before a failed item becomes eligible for retry. Defaults to 60. */
|
|
409
|
+
retryDelayMinutes?: number;
|
|
410
|
+
/** @description Number of items fetched per processing batch. Defaults to 10. */
|
|
411
|
+
batchSize?: number;
|
|
412
|
+
/** @description Default priority for items in this queue. Higher values are processed first. Defaults to 0. */
|
|
413
|
+
priority?: number;
|
|
414
|
+
/** @description Whether the queue is active. Inactive queues do not accept processing. */
|
|
415
|
+
isActive?: boolean;
|
|
416
|
+
};
|
|
417
|
+
SuccessResponseDto: {
|
|
418
|
+
/** @description True when the operation succeeded. */
|
|
419
|
+
success: boolean;
|
|
420
|
+
};
|
|
421
|
+
CreateQueueItemDto: {
|
|
422
|
+
/** @description External identifier used to deduplicate items within the queue. */
|
|
423
|
+
externalId?: string;
|
|
424
|
+
/** @description Arbitrary JSON payload for the item. Maximum size 64KB. */
|
|
425
|
+
data?: {
|
|
426
|
+
[key: string]: unknown;
|
|
427
|
+
};
|
|
428
|
+
/** @description Item priority. Higher values are processed first. Defaults to the queue priority. */
|
|
429
|
+
priority?: number;
|
|
430
|
+
/** @description Maximum number of retry attempts for this item. Defaults to the queue setting. */
|
|
431
|
+
maxRetries?: number;
|
|
432
|
+
/** @description ISO 8601 date-time to defer processing until. Omit to make the item ready immediately. */
|
|
433
|
+
scheduledFor?: string;
|
|
434
|
+
/** @description Arbitrary JSON metadata attached to the item. Maximum size 64KB. */
|
|
435
|
+
metadata?: {
|
|
436
|
+
[key: string]: unknown;
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
QueueItemErrorEntryResponseDto: {
|
|
440
|
+
/** @description Error message. */
|
|
441
|
+
error: string;
|
|
442
|
+
/** @description Additional structured error details, if provided. */
|
|
443
|
+
errorDetails?: {
|
|
444
|
+
[key: string]: unknown;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* Format: date-time
|
|
448
|
+
* @description ISO 8601 timestamp when the error was recorded.
|
|
449
|
+
*/
|
|
450
|
+
timestamp: string;
|
|
451
|
+
};
|
|
452
|
+
QueueItemQueueSummaryDto: {
|
|
453
|
+
/** @description Queue ID. */
|
|
454
|
+
id: string;
|
|
455
|
+
/** @description Queue name. */
|
|
456
|
+
name: string;
|
|
457
|
+
};
|
|
458
|
+
QueueItemExecutionWorkflowDto: {
|
|
459
|
+
/** @description Workflow ID. */
|
|
460
|
+
id: string;
|
|
461
|
+
};
|
|
462
|
+
QueueItemLastExecutionDto: {
|
|
463
|
+
/** @description Execution ID. */
|
|
464
|
+
id: string;
|
|
465
|
+
/** @description Execution status. */
|
|
466
|
+
status: string;
|
|
467
|
+
/** @description Workflow the execution belongs to. */
|
|
468
|
+
workflow: components["schemas"]["QueueItemExecutionWorkflowDto"];
|
|
469
|
+
};
|
|
470
|
+
QueueItemCreateResponseDto: {
|
|
471
|
+
/** @description Queue item ID. */
|
|
472
|
+
id: string;
|
|
473
|
+
/** @description External identifier used for deduplication. */
|
|
474
|
+
externalId: string | null;
|
|
475
|
+
/** @description JSON payload for the item. */
|
|
476
|
+
data: {
|
|
477
|
+
[key: string]: unknown;
|
|
478
|
+
} | null;
|
|
479
|
+
/**
|
|
480
|
+
* @description Processing status of the item.
|
|
481
|
+
* @enum {string}
|
|
482
|
+
*/
|
|
483
|
+
status: "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED" | "RETRYING";
|
|
484
|
+
/** @description Number of retry attempts made so far. */
|
|
485
|
+
retryCount: number;
|
|
486
|
+
/** @description Maximum number of retry attempts allowed. */
|
|
487
|
+
maxRetries: number;
|
|
488
|
+
/** @description Most recent error message. */
|
|
489
|
+
lastError: string | null;
|
|
490
|
+
/** @description Item priority. Higher values are processed first. */
|
|
491
|
+
priority: number;
|
|
492
|
+
/** @description JSON metadata attached to the item. */
|
|
493
|
+
metadata: {
|
|
494
|
+
[key: string]: unknown;
|
|
495
|
+
} | null;
|
|
496
|
+
/**
|
|
497
|
+
* Format: date-time
|
|
498
|
+
* @description When the item becomes eligible for retry. Included when `expansion=createdAt` is requested.
|
|
499
|
+
*/
|
|
500
|
+
nextRetryAt?: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* Format: date-time
|
|
503
|
+
* @description When processing started. Included when `expansion=createdAt` is requested.
|
|
504
|
+
*/
|
|
505
|
+
processingStartedAt?: string | null;
|
|
506
|
+
/**
|
|
507
|
+
* Format: date-time
|
|
508
|
+
* @description When processing finished. Included when `expansion=createdAt` is requested.
|
|
509
|
+
*/
|
|
510
|
+
processingCompletedAt?: string | null;
|
|
511
|
+
/**
|
|
512
|
+
* Format: date-time
|
|
513
|
+
* @description When the most recent error occurred. Included when `expansion=createdAt` is requested.
|
|
514
|
+
*/
|
|
515
|
+
lastErrorAt?: string | null;
|
|
516
|
+
/**
|
|
517
|
+
* Format: date-time
|
|
518
|
+
* @description When the item is scheduled for processing. Included when `expansion=createdAt` is requested.
|
|
519
|
+
*/
|
|
520
|
+
scheduledFor?: string | null;
|
|
521
|
+
/**
|
|
522
|
+
* Format: date-time
|
|
523
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
524
|
+
*/
|
|
525
|
+
createdAt?: string;
|
|
526
|
+
/**
|
|
527
|
+
* Format: date-time
|
|
528
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
529
|
+
*/
|
|
530
|
+
updatedAt?: string;
|
|
531
|
+
/** @description History of errors recorded against the item. Included when `expansion=errorHistory` is requested. */
|
|
532
|
+
errorHistory?: components["schemas"]["QueueItemErrorEntryResponseDto"][] | null;
|
|
533
|
+
/** @description Owning queue. Included when `expansion=queue` is requested. */
|
|
534
|
+
queue?: components["schemas"]["QueueItemQueueSummaryDto"];
|
|
535
|
+
/** @description Most recently linked workflow execution. Included when `expansion=lastExecution` is requested. */
|
|
536
|
+
lastExecution?: components["schemas"]["QueueItemLastExecutionDto"] | null;
|
|
537
|
+
/** @description True when an existing item with the same externalId was returned instead of creating a new one. */
|
|
538
|
+
isDuplicate: boolean;
|
|
539
|
+
};
|
|
540
|
+
BulkCreateQueueItemsOptionsDto: {
|
|
541
|
+
/** @description If true, items whose externalId already exists are skipped silently. If false, existing items are returned. */
|
|
542
|
+
skipDuplicates?: boolean;
|
|
543
|
+
/** @description If true, existing items matched by externalId are updated with the submitted data. */
|
|
544
|
+
updateExisting?: boolean;
|
|
545
|
+
};
|
|
546
|
+
BulkCreateQueueItemsDto: {
|
|
547
|
+
/** @description Items to create in the queue. */
|
|
548
|
+
items: components["schemas"]["CreateQueueItemDto"][];
|
|
549
|
+
/** @description Options controlling duplicate handling. */
|
|
550
|
+
options?: components["schemas"]["BulkCreateQueueItemsOptionsDto"];
|
|
551
|
+
};
|
|
552
|
+
QueueItemResponseDto: {
|
|
553
|
+
/** @description Queue item ID. */
|
|
554
|
+
id: string;
|
|
555
|
+
/** @description External identifier used for deduplication. */
|
|
556
|
+
externalId: string | null;
|
|
557
|
+
/** @description JSON payload for the item. */
|
|
558
|
+
data: {
|
|
559
|
+
[key: string]: unknown;
|
|
560
|
+
} | null;
|
|
561
|
+
/**
|
|
562
|
+
* @description Processing status of the item.
|
|
563
|
+
* @enum {string}
|
|
564
|
+
*/
|
|
565
|
+
status: "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED" | "RETRYING";
|
|
566
|
+
/** @description Number of retry attempts made so far. */
|
|
567
|
+
retryCount: number;
|
|
568
|
+
/** @description Maximum number of retry attempts allowed. */
|
|
569
|
+
maxRetries: number;
|
|
570
|
+
/** @description Most recent error message. */
|
|
571
|
+
lastError: string | null;
|
|
572
|
+
/** @description Item priority. Higher values are processed first. */
|
|
573
|
+
priority: number;
|
|
574
|
+
/** @description JSON metadata attached to the item. */
|
|
575
|
+
metadata: {
|
|
576
|
+
[key: string]: unknown;
|
|
577
|
+
} | null;
|
|
578
|
+
/**
|
|
579
|
+
* Format: date-time
|
|
580
|
+
* @description When the item becomes eligible for retry. Included when `expansion=createdAt` is requested.
|
|
581
|
+
*/
|
|
582
|
+
nextRetryAt?: string | null;
|
|
583
|
+
/**
|
|
584
|
+
* Format: date-time
|
|
585
|
+
* @description When processing started. Included when `expansion=createdAt` is requested.
|
|
586
|
+
*/
|
|
587
|
+
processingStartedAt?: string | null;
|
|
588
|
+
/**
|
|
589
|
+
* Format: date-time
|
|
590
|
+
* @description When processing finished. Included when `expansion=createdAt` is requested.
|
|
591
|
+
*/
|
|
592
|
+
processingCompletedAt?: string | null;
|
|
593
|
+
/**
|
|
594
|
+
* Format: date-time
|
|
595
|
+
* @description When the most recent error occurred. Included when `expansion=createdAt` is requested.
|
|
596
|
+
*/
|
|
597
|
+
lastErrorAt?: string | null;
|
|
598
|
+
/**
|
|
599
|
+
* Format: date-time
|
|
600
|
+
* @description When the item is scheduled for processing. Included when `expansion=createdAt` is requested.
|
|
601
|
+
*/
|
|
602
|
+
scheduledFor?: string | null;
|
|
603
|
+
/**
|
|
604
|
+
* Format: date-time
|
|
605
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
606
|
+
*/
|
|
607
|
+
createdAt?: string;
|
|
608
|
+
/**
|
|
609
|
+
* Format: date-time
|
|
610
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
611
|
+
*/
|
|
612
|
+
updatedAt?: string;
|
|
613
|
+
/** @description History of errors recorded against the item. Included when `expansion=errorHistory` is requested. */
|
|
614
|
+
errorHistory?: components["schemas"]["QueueItemErrorEntryResponseDto"][] | null;
|
|
615
|
+
/** @description Owning queue. Included when `expansion=queue` is requested. */
|
|
616
|
+
queue?: components["schemas"]["QueueItemQueueSummaryDto"];
|
|
617
|
+
/** @description Most recently linked workflow execution. Included when `expansion=lastExecution` is requested. */
|
|
618
|
+
lastExecution?: components["schemas"]["QueueItemLastExecutionDto"] | null;
|
|
619
|
+
};
|
|
620
|
+
BulkCreateQueueItemsSummaryDto: {
|
|
621
|
+
/** @description Number of items created. */
|
|
622
|
+
created: number;
|
|
623
|
+
/** @description Number of existing items returned or updated. */
|
|
624
|
+
existing: number;
|
|
625
|
+
/** @description Number of duplicate items skipped. */
|
|
626
|
+
skipped: number;
|
|
627
|
+
/** @description Total number of items submitted. */
|
|
628
|
+
total: number;
|
|
629
|
+
};
|
|
630
|
+
BulkCreateQueueItemsResponseDto: {
|
|
631
|
+
/** @description Newly created queue items. */
|
|
632
|
+
created: components["schemas"]["QueueItemResponseDto"][];
|
|
633
|
+
/** @description Existing items matched by externalId, updated when the updateExisting option is set. */
|
|
634
|
+
existing: components["schemas"]["QueueItemResponseDto"][];
|
|
635
|
+
/** @description Summary counts for the bulk operation. */
|
|
636
|
+
summary: components["schemas"]["BulkCreateQueueItemsSummaryDto"];
|
|
637
|
+
};
|
|
638
|
+
QueueItemListPaginationDto: {
|
|
639
|
+
/** @description Total number of items matching the filters. */
|
|
640
|
+
total: number;
|
|
641
|
+
/** @description Page size applied to the request. */
|
|
642
|
+
limit: number;
|
|
643
|
+
/** @description Offset applied to the request. */
|
|
644
|
+
offset: number;
|
|
645
|
+
/** @description Whether more items exist beyond the current page. */
|
|
646
|
+
hasMore: boolean;
|
|
647
|
+
};
|
|
648
|
+
QueueItemListResponseDto: {
|
|
649
|
+
/** @description Queue items for the current page. */
|
|
650
|
+
items: components["schemas"]["QueueItemResponseDto"][];
|
|
651
|
+
/** @description Pagination details. */
|
|
652
|
+
pagination: components["schemas"]["QueueItemListPaginationDto"];
|
|
653
|
+
};
|
|
654
|
+
QueueItemFullResponseDto: {
|
|
655
|
+
/** @description Queue item ID. */
|
|
656
|
+
id: string;
|
|
657
|
+
/**
|
|
658
|
+
* Format: date-time
|
|
659
|
+
* @description Creation timestamp.
|
|
660
|
+
*/
|
|
661
|
+
createdAt: string;
|
|
662
|
+
/**
|
|
663
|
+
* Format: date-time
|
|
664
|
+
* @description Last update timestamp.
|
|
665
|
+
*/
|
|
666
|
+
updatedAt: string;
|
|
667
|
+
/** @description External identifier used for deduplication. */
|
|
668
|
+
externalId: string | null;
|
|
669
|
+
/** @description JSON payload for the item. */
|
|
670
|
+
data: {
|
|
671
|
+
[key: string]: unknown;
|
|
672
|
+
} | null;
|
|
673
|
+
/**
|
|
674
|
+
* @description Processing status of the item.
|
|
675
|
+
* @enum {string}
|
|
676
|
+
*/
|
|
677
|
+
status: "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED" | "RETRYING";
|
|
678
|
+
/** @description Number of retry attempts made so far. */
|
|
679
|
+
retryCount: number;
|
|
680
|
+
/** @description Maximum number of retry attempts allowed. */
|
|
681
|
+
maxRetries: number;
|
|
682
|
+
/**
|
|
683
|
+
* Format: date-time
|
|
684
|
+
* @description When the item becomes eligible for retry.
|
|
685
|
+
*/
|
|
686
|
+
nextRetryAt: string | null;
|
|
687
|
+
/**
|
|
688
|
+
* Format: date-time
|
|
689
|
+
* @description When processing started.
|
|
690
|
+
*/
|
|
691
|
+
processingStartedAt: string | null;
|
|
692
|
+
/**
|
|
693
|
+
* Format: date-time
|
|
694
|
+
* @description When processing finished.
|
|
695
|
+
*/
|
|
696
|
+
processingCompletedAt: string | null;
|
|
697
|
+
/** @description Most recent error message. */
|
|
698
|
+
lastError: string | null;
|
|
699
|
+
/**
|
|
700
|
+
* Format: date-time
|
|
701
|
+
* @description When the most recent error occurred.
|
|
702
|
+
*/
|
|
703
|
+
lastErrorAt: string | null;
|
|
704
|
+
/** @description History of errors recorded against the item. */
|
|
705
|
+
errorHistory: {
|
|
706
|
+
[key: string]: unknown;
|
|
707
|
+
}[] | null;
|
|
708
|
+
/** @description ID of the most recently linked workflow execution. */
|
|
709
|
+
FK_lastExecutionId: string | null;
|
|
710
|
+
/** @description Item priority. Higher values are processed first. */
|
|
711
|
+
priority: number;
|
|
712
|
+
/**
|
|
713
|
+
* Format: date-time
|
|
714
|
+
* @description When the item is scheduled for processing.
|
|
715
|
+
*/
|
|
716
|
+
scheduledFor: string | null;
|
|
717
|
+
/** @description JSON metadata attached to the item. */
|
|
718
|
+
metadata: {
|
|
719
|
+
[key: string]: unknown;
|
|
720
|
+
} | null;
|
|
721
|
+
/** @description ID of the owning queue. */
|
|
722
|
+
FK_queueId: string;
|
|
723
|
+
};
|
|
724
|
+
QueueItemStatusCountsDto: {
|
|
725
|
+
/** @description Number of items awaiting processing. */
|
|
726
|
+
PENDING: number;
|
|
727
|
+
/** @description Number of items currently being processed. */
|
|
728
|
+
PROCESSING: number;
|
|
729
|
+
/** @description Number of successfully processed items. */
|
|
730
|
+
SUCCESS: number;
|
|
731
|
+
/** @description Number of items that failed permanently. */
|
|
732
|
+
FAILED: number;
|
|
733
|
+
/** @description Number of items awaiting a retry attempt. */
|
|
734
|
+
RETRYING: number;
|
|
735
|
+
};
|
|
736
|
+
QueueItemPriorityCountsDto: {
|
|
737
|
+
/** @description Items with priority 10 or above. */
|
|
738
|
+
high: number;
|
|
739
|
+
/** @description Items with priority 5 to 9. */
|
|
740
|
+
medium: number;
|
|
741
|
+
/** @description Items with priority below 5. */
|
|
742
|
+
low: number;
|
|
743
|
+
};
|
|
744
|
+
QueueItemStatsResponseDto: {
|
|
745
|
+
/** @description Total number of items in the queue. */
|
|
746
|
+
total: number;
|
|
747
|
+
/** @description Item counts grouped by status. */
|
|
748
|
+
byStatus: components["schemas"]["QueueItemStatusCountsDto"];
|
|
749
|
+
/** @description Item counts grouped by priority band. */
|
|
750
|
+
byPriority: components["schemas"]["QueueItemPriorityCountsDto"];
|
|
751
|
+
/** @description Average processing time in milliseconds for successful items. */
|
|
752
|
+
averageProcessingTime: number;
|
|
753
|
+
/** @description Fraction of items that required at least one retry, between 0 and 1. */
|
|
754
|
+
retryRate: number;
|
|
755
|
+
};
|
|
756
|
+
UpdateQueueItemDto: {
|
|
757
|
+
/** @description External identifier used to deduplicate items within the queue. */
|
|
758
|
+
externalId?: string;
|
|
759
|
+
/** @description Arbitrary JSON payload for the item. Maximum size 64KB. */
|
|
760
|
+
data?: {
|
|
761
|
+
[key: string]: unknown;
|
|
762
|
+
};
|
|
763
|
+
/** @description Item priority. Higher values are processed first. Defaults to the queue priority. */
|
|
764
|
+
priority?: number;
|
|
765
|
+
/** @description Maximum number of retry attempts for this item. Defaults to the queue setting. */
|
|
766
|
+
maxRetries?: number;
|
|
767
|
+
/** @description ISO 8601 date-time to defer processing until. Omit to make the item ready immediately. */
|
|
768
|
+
scheduledFor?: string;
|
|
769
|
+
/** @description Arbitrary JSON metadata attached to the item. Maximum size 64KB. */
|
|
770
|
+
metadata?: {
|
|
771
|
+
[key: string]: unknown;
|
|
772
|
+
};
|
|
773
|
+
/**
|
|
774
|
+
* @description New processing status for the item.
|
|
775
|
+
* @enum {string}
|
|
776
|
+
*/
|
|
777
|
+
status?: "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED" | "RETRYING";
|
|
778
|
+
/** @description ISO 8601 date-time when the item becomes eligible for retry. Set to null to clear. */
|
|
779
|
+
nextRetryAt?: string;
|
|
780
|
+
};
|
|
781
|
+
UpdateStatusDto: {
|
|
782
|
+
/**
|
|
783
|
+
* @description Target status. Must be a valid transition from the current status.
|
|
784
|
+
* @enum {string}
|
|
785
|
+
*/
|
|
786
|
+
status: "PENDING" | "PROCESSING" | "SUCCESS" | "FAILED" | "RETRYING";
|
|
787
|
+
/** @description Error message recorded with the transition. Recommended when moving to FAILED or RETRYING. */
|
|
788
|
+
error?: string;
|
|
789
|
+
};
|
|
790
|
+
LinkExecutionDto: {
|
|
791
|
+
/** @description ID of the workflow execution to link to the queue item. */
|
|
792
|
+
executionId: string;
|
|
793
|
+
};
|
|
794
|
+
BulkUpdateItemsDto: {
|
|
795
|
+
/** @description IDs of the queue items to update. */
|
|
796
|
+
itemIds: string[];
|
|
797
|
+
/** @description Fields to apply to every listed item. */
|
|
798
|
+
updates: components["schemas"]["UpdateQueueItemDto"];
|
|
799
|
+
};
|
|
800
|
+
AddErrorDto: {
|
|
801
|
+
/** @description Error message to record against the queue item. */
|
|
802
|
+
error: string;
|
|
803
|
+
/** @description Additional structured error details, supplied as a JSON string. */
|
|
804
|
+
errorDetails?: {
|
|
805
|
+
[key: string]: unknown;
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
BulkDeleteItemsDto: {
|
|
809
|
+
/** @description IDs of the queue items to delete. */
|
|
810
|
+
itemIds: string[];
|
|
811
|
+
};
|
|
812
|
+
BulkDeleteItemsResponseDto: {
|
|
813
|
+
/** @description Whether the bulk delete ran to completion. */
|
|
814
|
+
success: boolean;
|
|
815
|
+
/** @description Number of items actually deleted. */
|
|
816
|
+
deletedCount: number;
|
|
817
|
+
/** @description Number of item IDs submitted for deletion. */
|
|
818
|
+
requestedCount: number;
|
|
819
|
+
};
|
|
820
|
+
WorkflowProjectSummaryDto: {
|
|
821
|
+
/** @description Project ID */
|
|
822
|
+
id: string;
|
|
823
|
+
/** @description Project name */
|
|
824
|
+
name: string;
|
|
825
|
+
};
|
|
826
|
+
WorkflowResponseDto: {
|
|
827
|
+
/** @description Workflow ID */
|
|
828
|
+
id: string;
|
|
829
|
+
/** @description Workflow name */
|
|
830
|
+
name: string;
|
|
831
|
+
/** @description Stable project-scoped slug for CLI / code deploy upserts. Included when `expansion=slug` is requested. */
|
|
832
|
+
slug?: string | null;
|
|
833
|
+
/** @description True when last written by code (CLI / SDK). Included when `expansion=managedByCode` is requested. */
|
|
834
|
+
managedByCode?: boolean;
|
|
835
|
+
/** @description Workflow description. Included when `expansion=description` is requested. */
|
|
836
|
+
description?: string | null;
|
|
837
|
+
/** @description Declared output schema from the workflow's Output Workflow Data node. Shape is a map of field ID to `{ type, description? }`. Included when `expansion=output` is requested. Null when the workflow has no declared output schema. */
|
|
838
|
+
output?: {
|
|
839
|
+
[key: string]: unknown;
|
|
840
|
+
} | null;
|
|
841
|
+
/**
|
|
842
|
+
* Format: date-time
|
|
843
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
844
|
+
*/
|
|
845
|
+
createdAt?: string;
|
|
846
|
+
/**
|
|
847
|
+
* Format: date-time
|
|
848
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
849
|
+
*/
|
|
850
|
+
updatedAt?: string;
|
|
851
|
+
/** @description Whether the workflow is active and can be triggered. Included when `expansion=isActive` is requested. */
|
|
852
|
+
isActive?: boolean;
|
|
853
|
+
/** @description Whether the workflow is internal (hidden from default listings). Included when `expansion=isInternal` is requested. */
|
|
854
|
+
isInternal?: boolean;
|
|
855
|
+
/** @description Workflow node definitions (JSON). Included when `expansion=nodes` is requested. */
|
|
856
|
+
nodes?: {
|
|
857
|
+
[key: string]: unknown;
|
|
858
|
+
}[];
|
|
859
|
+
/** @description Workflow edge definitions connecting nodes (JSON). Included when `expansion=edges` is requested. */
|
|
860
|
+
edges?: {
|
|
861
|
+
[key: string]: unknown;
|
|
862
|
+
}[];
|
|
863
|
+
/** @description The workflow trigger node definition (JSON). Included when `expansion=triggerNode` is requested. */
|
|
864
|
+
triggerNode?: {
|
|
865
|
+
[key: string]: unknown;
|
|
866
|
+
} | null;
|
|
867
|
+
/** @description IDs of the triggers and actions used by the workflow. Included when `expansion=triggerAndActionIds` is requested. */
|
|
868
|
+
triggerAndActionIds?: string[];
|
|
869
|
+
/** @description IDs of sub-workflows referenced by the workflow. Included when `expansion=subWorkflowIds` is requested. Only returned by GET /workflows/{workflowId}. */
|
|
870
|
+
subWorkflowIds?: string[];
|
|
871
|
+
/** @description IDs of agents referenced by the workflow. Included when `expansion=agentIds` is requested. Only returned by GET /workflows/{workflowId}. */
|
|
872
|
+
agentIds?: string[];
|
|
873
|
+
/** @description Internal polling trigger storage value. Included when `expansion=pollStorage` is requested. */
|
|
874
|
+
pollStorage?: string | null;
|
|
875
|
+
/**
|
|
876
|
+
* Format: date-time
|
|
877
|
+
* @description Timestamp of the next scheduled execution, if the workflow runs on a schedule. Included when `expansion=nextScheduledExecution` is requested.
|
|
878
|
+
*/
|
|
879
|
+
nextScheduledExecution?: string | null;
|
|
880
|
+
/**
|
|
881
|
+
* @description Editor orientation of the workflow canvas. Included when `expansion=orientation` is requested.
|
|
882
|
+
* @enum {string}
|
|
883
|
+
*/
|
|
884
|
+
workflowOrientation?: "HORIZONTAL" | "VERTICAL";
|
|
885
|
+
/** @description The project the workflow belongs to. Included when `expansion=project` is requested. */
|
|
886
|
+
project?: components["schemas"]["WorkflowProjectSummaryDto"];
|
|
887
|
+
/** @description AI provider connection used by the workflow builder chat. Always returned on GET /workflows/{workflowId}. */
|
|
888
|
+
aiConnectionId?: string | null;
|
|
889
|
+
/** @description Selected model ID within the AI provider connection for workflow builder chat. Always returned on GET /workflows/{workflowId}. */
|
|
890
|
+
selectedModelId?: string | null;
|
|
891
|
+
};
|
|
892
|
+
UpsertWorkflowStepDto: {
|
|
893
|
+
/** @description Workflow app id (catalogue slug). */
|
|
894
|
+
appId: string;
|
|
895
|
+
/** @description Catalogue action id. */
|
|
896
|
+
actionId: string;
|
|
897
|
+
/** @description Connection instance UUID for this step. */
|
|
898
|
+
connectionId?: string;
|
|
899
|
+
/** @description Action input / config fields. */
|
|
900
|
+
input?: {
|
|
901
|
+
[key: string]: unknown;
|
|
902
|
+
};
|
|
903
|
+
/** @description Display name for the step node. */
|
|
904
|
+
name?: string;
|
|
905
|
+
/** @description Step description. */
|
|
906
|
+
description?: string;
|
|
907
|
+
};
|
|
908
|
+
UpsertWorkflowBySlugDto: {
|
|
909
|
+
/**
|
|
910
|
+
* @description Stable project-scoped slug (lowercase, digits, hyphens). Used as the upsert key.
|
|
911
|
+
* @example sync-orders
|
|
912
|
+
*/
|
|
913
|
+
slug: string;
|
|
914
|
+
/** @description Display name. Defaults to the slug when omitted. */
|
|
915
|
+
name?: string;
|
|
916
|
+
description?: string;
|
|
917
|
+
/** @description Whether the workflow is active. */
|
|
918
|
+
isActive?: boolean;
|
|
919
|
+
/** @description Linear catalogue-action steps (v1; no branches). */
|
|
920
|
+
steps: components["schemas"]["UpsertWorkflowStepDto"][];
|
|
921
|
+
/** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
|
|
922
|
+
managedByCode?: boolean;
|
|
923
|
+
};
|
|
924
|
+
WorkflowAppResponseDto: {
|
|
925
|
+
/** @description App ID, e.g. `gmail`. Matches the appId used in workflow execution steps. */
|
|
926
|
+
id: string;
|
|
927
|
+
/** @description Human-readable app name. */
|
|
928
|
+
name: string;
|
|
929
|
+
/** @description App description. */
|
|
930
|
+
description: string;
|
|
931
|
+
/** @description URL of the app logo. */
|
|
932
|
+
logoUrl: string;
|
|
933
|
+
/** @description Whether the app is published and available for use. */
|
|
934
|
+
isPublished: boolean;
|
|
935
|
+
/** @description Whether the app requires a connection before its actions and triggers can run. */
|
|
936
|
+
needsConnection: boolean;
|
|
937
|
+
/** @description Whether the app can be used by agents. */
|
|
938
|
+
availableForAgent: boolean;
|
|
939
|
+
/** @description Action definitions, each with id, name, description, iconUrl, needsConnection, availableForAgent, viewOptions and the declarative inputConfig field metadata used to render action UIs. */
|
|
940
|
+
actions: {
|
|
941
|
+
[key: string]: unknown;
|
|
942
|
+
}[];
|
|
943
|
+
/** @description Trigger definitions, each with id, name, description, iconUrl, needsConnection and the declarative inputConfig field metadata used to render trigger UIs. */
|
|
944
|
+
triggers: {
|
|
945
|
+
[key: string]: unknown;
|
|
946
|
+
}[];
|
|
947
|
+
/** @description Connection type definitions supported by the app (e.g. oauth2, apiKey, basic), each with id, name, description, connectionType and any declarative inputConfig fields. */
|
|
948
|
+
connections: {
|
|
949
|
+
[key: string]: unknown;
|
|
950
|
+
}[];
|
|
951
|
+
};
|
|
952
|
+
ObjectTypeUserSummaryDto: {
|
|
953
|
+
/** @description User ID. */
|
|
954
|
+
id: string;
|
|
955
|
+
/** @description Email address of the user. */
|
|
956
|
+
email: string;
|
|
957
|
+
/** @description Display name of the user. */
|
|
958
|
+
name: string;
|
|
959
|
+
};
|
|
960
|
+
ObjectTypeCreatedByDto: {
|
|
961
|
+
/** @description Workspace user ID. */
|
|
962
|
+
id: string;
|
|
963
|
+
user: components["schemas"]["ObjectTypeUserSummaryDto"];
|
|
964
|
+
};
|
|
965
|
+
ObjectTypeCountDto: {
|
|
966
|
+
/** @description Number of non-deleted entities of this type. */
|
|
967
|
+
objects: number;
|
|
968
|
+
};
|
|
969
|
+
ObjectTypeResponseDto: {
|
|
970
|
+
/** @description Entity type ID. */
|
|
971
|
+
id: string;
|
|
972
|
+
/** @description Singular display name of the entity type. */
|
|
973
|
+
name: string;
|
|
974
|
+
/** @description Plural display name of the entity type. */
|
|
975
|
+
namePlural: string;
|
|
976
|
+
/** @description URL-safe slug, unique within the workspace. */
|
|
977
|
+
slug: string;
|
|
978
|
+
/** @description Icon identifier for the entity type. */
|
|
979
|
+
icon: string;
|
|
980
|
+
/** @description Hex colour of the entity type. */
|
|
981
|
+
color: string;
|
|
982
|
+
/** @description Whether the entity type is enabled. */
|
|
983
|
+
isEnabled: boolean;
|
|
984
|
+
/** @description Description of the entity type. Included when `expansion=description` is requested. */
|
|
985
|
+
description?: string | null;
|
|
986
|
+
/** @description Field definitions grouped into sections. Included when `expansion=attributeSchema` is requested. */
|
|
987
|
+
attributeSchema?: {
|
|
988
|
+
[key: string]: unknown;
|
|
989
|
+
};
|
|
990
|
+
/** @description State machine definition. Included when `expansion=stateSchema` is requested. */
|
|
991
|
+
stateSchema?: {
|
|
992
|
+
[key: string]: unknown;
|
|
993
|
+
} | null;
|
|
994
|
+
/**
|
|
995
|
+
* Format: date-time
|
|
996
|
+
* @description Included when `expansion=createdAt` is requested.
|
|
997
|
+
*/
|
|
998
|
+
createdAt?: string;
|
|
999
|
+
/**
|
|
1000
|
+
* Format: date-time
|
|
1001
|
+
* @description Included when `expansion=updatedAt` is requested.
|
|
1002
|
+
*/
|
|
1003
|
+
updatedAt?: string;
|
|
1004
|
+
/** @description Workspace member who created the entity type. Included when `expansion=createdBy` is requested. */
|
|
1005
|
+
createdBy?: components["schemas"]["ObjectTypeCreatedByDto"];
|
|
1006
|
+
/** @description Included when `expansion=countObjects` is requested. */
|
|
1007
|
+
_count?: components["schemas"]["ObjectTypeCountDto"];
|
|
1008
|
+
};
|
|
1009
|
+
CreateObjectDto: {
|
|
1010
|
+
/** @description Display name of the entity. */
|
|
1011
|
+
name: string;
|
|
1012
|
+
/**
|
|
1013
|
+
* Format: uuid
|
|
1014
|
+
* @description ID of the entity type to create the entity under.
|
|
1015
|
+
*/
|
|
1016
|
+
objectTypeId: string;
|
|
1017
|
+
/** @description Initial state ID. Must exist in the entity type state schema. Defaults to the schema initial state when omitted. */
|
|
1018
|
+
state?: string;
|
|
1019
|
+
/** @description Dynamic attribute values keyed by field ID. */
|
|
1020
|
+
attributes?: {
|
|
1021
|
+
[key: string]: unknown;
|
|
1022
|
+
};
|
|
1023
|
+
/**
|
|
1024
|
+
* Format: uuid
|
|
1025
|
+
* @description Workspace user ID of the entity owner.
|
|
1026
|
+
*/
|
|
1027
|
+
ownerId?: string;
|
|
1028
|
+
};
|
|
1029
|
+
ObjectTypeSummaryDto: {
|
|
1030
|
+
/** @description Entity type ID. */
|
|
1031
|
+
id: string;
|
|
1032
|
+
/** @description Singular display name of the entity type. */
|
|
1033
|
+
name: string;
|
|
1034
|
+
/** @description URL-safe slug of the entity type. */
|
|
1035
|
+
slug: string;
|
|
1036
|
+
/** @description Icon identifier for the entity type. */
|
|
1037
|
+
icon: string;
|
|
1038
|
+
/** @description Hex colour of the entity type. */
|
|
1039
|
+
color: string;
|
|
1040
|
+
/** @description Plural display name. Included when `expansion=objectType` is requested. */
|
|
1041
|
+
namePlural?: string;
|
|
1042
|
+
/** @description Field definitions grouped into sections. Included when `expansion=objectType` is requested on single-entity reads. */
|
|
1043
|
+
attributeSchema?: {
|
|
1044
|
+
[key: string]: unknown;
|
|
1045
|
+
};
|
|
1046
|
+
/** @description State machine definition. Included when `expansion=objectType` is requested. */
|
|
1047
|
+
stateSchema?: {
|
|
1048
|
+
[key: string]: unknown;
|
|
1049
|
+
} | null;
|
|
1050
|
+
};
|
|
1051
|
+
ObjectUserSummaryDto: {
|
|
1052
|
+
/** @description User ID. */
|
|
1053
|
+
id: string;
|
|
1054
|
+
/** @description Email address of the user. */
|
|
1055
|
+
email: string;
|
|
1056
|
+
/** @description Display name of the user. */
|
|
1057
|
+
name: string;
|
|
1058
|
+
};
|
|
1059
|
+
ObjectWorkspaceUserSummaryDto: {
|
|
1060
|
+
/** @description Workspace user ID. */
|
|
1061
|
+
id: string;
|
|
1062
|
+
user: components["schemas"]["ObjectUserSummaryDto"];
|
|
1063
|
+
};
|
|
1064
|
+
ObjectStateHistoryUserSummaryDto: {
|
|
1065
|
+
/** @description User ID. */
|
|
1066
|
+
id: string;
|
|
1067
|
+
/** @description Display name of the user. */
|
|
1068
|
+
name: string;
|
|
1069
|
+
};
|
|
1070
|
+
ObjectStateHistoryChangedByDto: {
|
|
1071
|
+
/** @description Workspace user ID. */
|
|
1072
|
+
id: string;
|
|
1073
|
+
user: components["schemas"]["ObjectStateHistoryUserSummaryDto"];
|
|
1074
|
+
};
|
|
1075
|
+
ObjectStateHistoryItemDto: {
|
|
1076
|
+
/** @description State history entry ID. */
|
|
1077
|
+
id: string;
|
|
1078
|
+
/** @description State the entity moved from. Null for the initial state. */
|
|
1079
|
+
fromState: string | null;
|
|
1080
|
+
/** @description State the entity moved to. */
|
|
1081
|
+
toState: string;
|
|
1082
|
+
/** @description Reason recorded for the state change, if any. */
|
|
1083
|
+
reason: string | null;
|
|
1084
|
+
/**
|
|
1085
|
+
* Format: date-time
|
|
1086
|
+
* @description When the state change occurred.
|
|
1087
|
+
*/
|
|
1088
|
+
createdAt: string;
|
|
1089
|
+
/** @description Workspace member who made the change, if recorded. */
|
|
1090
|
+
changedBy: components["schemas"]["ObjectStateHistoryChangedByDto"] | null;
|
|
1091
|
+
};
|
|
1092
|
+
ObjectResponseDto: {
|
|
1093
|
+
/** @description Entity ID. */
|
|
1094
|
+
id: string;
|
|
1095
|
+
/** @description Display name of the entity. */
|
|
1096
|
+
name: string;
|
|
1097
|
+
/** @description Current state of the entity, if the type defines states. */
|
|
1098
|
+
state: string | null;
|
|
1099
|
+
/** @description Dynamic attribute values keyed by field ID. */
|
|
1100
|
+
attributes: {
|
|
1101
|
+
[key: string]: unknown;
|
|
1102
|
+
};
|
|
1103
|
+
/**
|
|
1104
|
+
* Format: date-time
|
|
1105
|
+
* @description Included when `expansion=createdAt` is requested.
|
|
1106
|
+
*/
|
|
1107
|
+
createdAt?: string;
|
|
1108
|
+
/**
|
|
1109
|
+
* Format: date-time
|
|
1110
|
+
* @description Included by default on list responses, otherwise when `expansion=updatedAt` is requested.
|
|
1111
|
+
*/
|
|
1112
|
+
updatedAt?: string;
|
|
1113
|
+
/** @description Included by default on list responses with a minimal shape, otherwise when `expansion=objectType` is requested. */
|
|
1114
|
+
objectType?: components["schemas"]["ObjectTypeSummaryDto"];
|
|
1115
|
+
/** @description Included when `expansion=owner` is requested. */
|
|
1116
|
+
owner?: components["schemas"]["ObjectWorkspaceUserSummaryDto"] | null;
|
|
1117
|
+
/** @description Included when `expansion=createdBy` is requested. */
|
|
1118
|
+
createdBy?: components["schemas"]["ObjectWorkspaceUserSummaryDto"] | null;
|
|
1119
|
+
/** @description Most recent state changes (up to 50, newest first). Included when `expansion=stateHistory` is requested. */
|
|
1120
|
+
stateHistory?: components["schemas"]["ObjectStateHistoryItemDto"][];
|
|
1121
|
+
};
|
|
1122
|
+
ObjectPaginationDto: {
|
|
1123
|
+
/** @description Current page number (1-based). */
|
|
1124
|
+
page: number;
|
|
1125
|
+
/** @description Number of items per page (maximum 100). */
|
|
1126
|
+
pageSize: number;
|
|
1127
|
+
/** @description Total number of matching entities. */
|
|
1128
|
+
totalCount: number;
|
|
1129
|
+
/** @description Total number of pages. */
|
|
1130
|
+
totalPages: number;
|
|
1131
|
+
};
|
|
1132
|
+
PaginatedObjectsResponseDto: {
|
|
1133
|
+
data: components["schemas"]["ObjectResponseDto"][];
|
|
1134
|
+
pagination: components["schemas"]["ObjectPaginationDto"];
|
|
1135
|
+
};
|
|
1136
|
+
UpdateObjectDto: {
|
|
1137
|
+
/** @description New display name of the entity. */
|
|
1138
|
+
name?: string;
|
|
1139
|
+
/** @description Attribute values keyed by field ID. Merged into the existing attributes; fields not supplied are left unchanged. */
|
|
1140
|
+
attributes?: {
|
|
1141
|
+
[key: string]: unknown;
|
|
1142
|
+
};
|
|
1143
|
+
/** @description Workspace user ID of the new entity owner. */
|
|
1144
|
+
ownerId?: string;
|
|
1145
|
+
};
|
|
1146
|
+
ChangeObjectStateDto: {
|
|
1147
|
+
/** @description ID of the target state. Must be a valid transition from the current state when the entity type defines transitions. */
|
|
1148
|
+
newState: string;
|
|
1149
|
+
/** @description Reason for the state change. Required when the transition is configured with requiresReason. */
|
|
1150
|
+
reason?: string;
|
|
1151
|
+
};
|
|
1152
|
+
ChangeObjectStateResponseDto: {
|
|
1153
|
+
/** @description Entity ID. */
|
|
1154
|
+
id: string;
|
|
1155
|
+
/** @description Display name of the entity. */
|
|
1156
|
+
name: string;
|
|
1157
|
+
/** @description State of the entity after the change. */
|
|
1158
|
+
state: string | null;
|
|
1159
|
+
/**
|
|
1160
|
+
* Format: date-time
|
|
1161
|
+
* @description When the entity was last updated.
|
|
1162
|
+
*/
|
|
1163
|
+
updatedAt: string;
|
|
1164
|
+
};
|
|
1165
|
+
StateHistoryUserSummaryDto: {
|
|
1166
|
+
/** @description User ID. */
|
|
1167
|
+
id: string;
|
|
1168
|
+
/** @description Display name of the user. */
|
|
1169
|
+
name: string;
|
|
1170
|
+
/** @description Email address of the user. */
|
|
1171
|
+
email: string;
|
|
1172
|
+
};
|
|
1173
|
+
StateHistoryChangedByDto: {
|
|
1174
|
+
/** @description Workspace user ID. */
|
|
1175
|
+
id: string;
|
|
1176
|
+
user: components["schemas"]["StateHistoryUserSummaryDto"];
|
|
1177
|
+
};
|
|
1178
|
+
ObjectStateHistoryEntryResponseDto: {
|
|
1179
|
+
/** @description State history entry ID. */
|
|
1180
|
+
id: string;
|
|
1181
|
+
/** @description State the entity moved from. Null for the initial state. */
|
|
1182
|
+
fromState: string | null;
|
|
1183
|
+
/** @description State the entity moved to. */
|
|
1184
|
+
toState: string;
|
|
1185
|
+
/** @description Reason recorded for the state change, if any. */
|
|
1186
|
+
reason: string | null;
|
|
1187
|
+
/**
|
|
1188
|
+
* Format: date-time
|
|
1189
|
+
* @description When the state change occurred.
|
|
1190
|
+
*/
|
|
1191
|
+
createdAt: string;
|
|
1192
|
+
/** @description Workspace member who made the change, if recorded. */
|
|
1193
|
+
changedBy: components["schemas"]["StateHistoryChangedByDto"] | null;
|
|
1194
|
+
};
|
|
1195
|
+
ObjectStateInfoDto: {
|
|
1196
|
+
/** @description State ID. */
|
|
1197
|
+
id: string;
|
|
1198
|
+
/** @description Display name of the state. */
|
|
1199
|
+
name: string;
|
|
1200
|
+
/** @description Colour associated with the state. */
|
|
1201
|
+
color?: string;
|
|
1202
|
+
/** @description Icon associated with the state. */
|
|
1203
|
+
icon?: string;
|
|
1204
|
+
/** @description Whether the state is a final state. */
|
|
1205
|
+
isFinal: boolean;
|
|
1206
|
+
};
|
|
1207
|
+
ObjectStateTransitionDto: {
|
|
1208
|
+
/** @description Transition ID from the state schema. */
|
|
1209
|
+
transitionId: string;
|
|
1210
|
+
/** @description ID of the target state. */
|
|
1211
|
+
toStateId: string;
|
|
1212
|
+
/** @description Display name of the target state. */
|
|
1213
|
+
toStateName: string;
|
|
1214
|
+
/** @description Colour of the target state. */
|
|
1215
|
+
toStateColor?: string;
|
|
1216
|
+
/** @description Icon of the target state. */
|
|
1217
|
+
toStateIcon?: string;
|
|
1218
|
+
/** @description Whether a reason must be supplied for this transition. */
|
|
1219
|
+
requiresReason: boolean;
|
|
1220
|
+
/** @description Confirmation message to show before applying the transition. */
|
|
1221
|
+
confirmationMessage?: string;
|
|
1222
|
+
};
|
|
1223
|
+
ObjectStateTransitionsResponseDto: {
|
|
1224
|
+
/** @description Current state of the entity. Null when the entity has no state or the type defines no state schema. */
|
|
1225
|
+
currentState: components["schemas"]["ObjectStateInfoDto"] | null;
|
|
1226
|
+
/** @description Transitions allowed from the current state. */
|
|
1227
|
+
validTransitions: components["schemas"]["ObjectStateTransitionDto"][];
|
|
1228
|
+
/** @description All states defined by the entity type, for cases where no transitions are defined. */
|
|
1229
|
+
allStates: components["schemas"]["ObjectStateInfoDto"][];
|
|
1230
|
+
};
|
|
1231
|
+
ImportRowErrorDto: {
|
|
1232
|
+
/** @description Row number the error relates to (1-based). */
|
|
1233
|
+
row: number;
|
|
1234
|
+
/** @description Field ID the error relates to, when applicable. */
|
|
1235
|
+
field?: string;
|
|
1236
|
+
/** @description Human-readable error message. */
|
|
1237
|
+
message: string;
|
|
1238
|
+
};
|
|
1239
|
+
ImportEntitiesResponseDto: {
|
|
1240
|
+
/** @description Total number of rows processed. */
|
|
1241
|
+
totalRows: number;
|
|
1242
|
+
/** @description Number of rows imported successfully. */
|
|
1243
|
+
successCount: number;
|
|
1244
|
+
/** @description Number of rows that failed to import. */
|
|
1245
|
+
errorCount: number;
|
|
1246
|
+
/** @description Per-row errors encountered during the import. */
|
|
1247
|
+
errors: components["schemas"]["ImportRowErrorDto"][];
|
|
1248
|
+
/** @description IDs of entities created by the import. */
|
|
1249
|
+
createdIds: string[];
|
|
1250
|
+
/** @description IDs of existing entities updated by the import. */
|
|
1251
|
+
updatedIds: string[];
|
|
1252
|
+
};
|
|
1253
|
+
ImportTemplateResponseDto: {
|
|
1254
|
+
/** @description Column headers for the import file. Always starts with "name". */
|
|
1255
|
+
columns: string[];
|
|
1256
|
+
/** @description Sample row with an example value for each column. */
|
|
1257
|
+
sampleRow: {
|
|
1258
|
+
[key: string]: string;
|
|
1259
|
+
};
|
|
1260
|
+
};
|
|
1261
|
+
CreateKnowledgeDto: {
|
|
1262
|
+
/** @description Name of the knowledge base. */
|
|
1263
|
+
name: string;
|
|
1264
|
+
/** @description Description of the knowledge base. */
|
|
1265
|
+
description?: string;
|
|
1266
|
+
/** @description Default chunk overlap in words. Must be provided together with chunkSize and cannot exceed 50% of it. */
|
|
1267
|
+
chunkOverlap?: number;
|
|
1268
|
+
/** @description Default chunk size in words (50 to 2000). Must be provided together with chunkOverlap. */
|
|
1269
|
+
chunkSize?: number;
|
|
1270
|
+
/** @description Embedding model to use. Defaults to the platform-configured embedding model. */
|
|
1271
|
+
embeddingModel?: string;
|
|
1272
|
+
/** @description Embedding provider to use. Defaults to the platform-configured embedding provider. */
|
|
1273
|
+
embeddingProvider?: string;
|
|
1274
|
+
/** @description Embedding vector dimensions. Defaults to the platform-configured dimensions. */
|
|
1275
|
+
dimensions?: number;
|
|
1276
|
+
};
|
|
1277
|
+
KnowledgeCountDto: {
|
|
1278
|
+
/** @description Number of vector references stored in this knowledge base. */
|
|
1279
|
+
vectorRefs: number;
|
|
1280
|
+
};
|
|
1281
|
+
KnowledgeVectorRefSummaryDto: {
|
|
1282
|
+
/** @description Vector reference ID. */
|
|
1283
|
+
id: string;
|
|
1284
|
+
/** @description ID of the knowledge base the vector reference belongs to. */
|
|
1285
|
+
FK_knowledgeId: string;
|
|
1286
|
+
};
|
|
1287
|
+
KnowledgeUsageDto: {
|
|
1288
|
+
/** @description Total prompt tokens consumed when embedding content into this knowledge base. */
|
|
1289
|
+
promptTokens: number;
|
|
1290
|
+
};
|
|
1291
|
+
KnowledgeWorkspaceDto: {
|
|
1292
|
+
/** @description Workspace ID. */
|
|
1293
|
+
id: string;
|
|
1294
|
+
/** @description Workspace name. */
|
|
1295
|
+
name: string;
|
|
1296
|
+
};
|
|
1297
|
+
KnowledgeResponseDto: {
|
|
1298
|
+
/** @description Knowledge base ID. */
|
|
1299
|
+
id: string;
|
|
1300
|
+
/** @description Knowledge base name. */
|
|
1301
|
+
name: string;
|
|
1302
|
+
/** @description Knowledge base description. Included when `expansion=description` is requested. */
|
|
1303
|
+
description?: string;
|
|
1304
|
+
/**
|
|
1305
|
+
* Format: date-time
|
|
1306
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
1307
|
+
*/
|
|
1308
|
+
createdAt?: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* Format: date-time
|
|
1311
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
1312
|
+
*/
|
|
1313
|
+
updatedAt?: string;
|
|
1314
|
+
/** @description Name of the underlying vector index collection. Included when `expansion=indexName` is requested. */
|
|
1315
|
+
indexName?: string;
|
|
1316
|
+
/** @description Default chunk size in words used when uploading text. Included when `expansion=chunkSize` is requested. */
|
|
1317
|
+
chunkSize?: number;
|
|
1318
|
+
/** @description Default chunk overlap in words used when uploading text. Included when `expansion=chunkOverlap` is requested. */
|
|
1319
|
+
chunkOverlap?: number;
|
|
1320
|
+
/** @description Embedding model used for this knowledge base. Included when `expansion=embeddingModel` is requested. */
|
|
1321
|
+
embeddingModel?: string;
|
|
1322
|
+
/** @description Embedding provider used for this knowledge base. Included when `expansion=embeddingProvider` is requested. */
|
|
1323
|
+
embeddingProvider?: string;
|
|
1324
|
+
/** @description Embedding vector dimensions. Included when `expansion=dimensions` is requested. */
|
|
1325
|
+
dimensions?: number;
|
|
1326
|
+
/** @description Aggregate counts. Included when `expansion=countVectorRefs` is requested. */
|
|
1327
|
+
_count?: components["schemas"]["KnowledgeCountDto"];
|
|
1328
|
+
/** @description Vector references stored in this knowledge base. Included when `expansion=vectorRefs` is requested. */
|
|
1329
|
+
vectorRefs?: components["schemas"]["KnowledgeVectorRefSummaryDto"][];
|
|
1330
|
+
/** @description Embedding token usage. Included when `expansion=usage` is requested. */
|
|
1331
|
+
usage?: components["schemas"]["KnowledgeUsageDto"];
|
|
1332
|
+
/** @description Owning workspace. Included when `expansion=workspace` is requested. */
|
|
1333
|
+
workspace?: components["schemas"]["KnowledgeWorkspaceDto"];
|
|
1334
|
+
};
|
|
1335
|
+
UpdateKnowledgeDto: {
|
|
1336
|
+
/** @description Name of the knowledge base. */
|
|
1337
|
+
name?: string;
|
|
1338
|
+
/** @description Description of the knowledge base. */
|
|
1339
|
+
description?: string;
|
|
1340
|
+
/** @description Default chunk overlap in words. Must be provided together with chunkSize and cannot exceed 50% of it. */
|
|
1341
|
+
chunkOverlap?: number;
|
|
1342
|
+
/** @description Default chunk size in words (50 to 2000). Must be provided together with chunkOverlap. */
|
|
1343
|
+
chunkSize?: number;
|
|
1344
|
+
/** @description Embedding model to use. Defaults to the platform-configured embedding model. */
|
|
1345
|
+
embeddingModel?: string;
|
|
1346
|
+
/** @description Embedding provider to use. Defaults to the platform-configured embedding provider. */
|
|
1347
|
+
embeddingProvider?: string;
|
|
1348
|
+
/** @description Embedding vector dimensions. Defaults to the platform-configured dimensions. */
|
|
1349
|
+
dimensions?: number;
|
|
1350
|
+
};
|
|
1351
|
+
SaveUploadedTextToKnowledgeDto: {
|
|
1352
|
+
/** @description Name of the document. Multi-part uploads are suffixed with the part number. */
|
|
1353
|
+
name: string;
|
|
1354
|
+
/** @description Raw text content to embed into the knowledge base. */
|
|
1355
|
+
text: string;
|
|
1356
|
+
/** @description Chunk overlap in words. Roughly 10% of chunkSize is recommended. */
|
|
1357
|
+
chunkOverlap: number;
|
|
1358
|
+
/** @description Chunk size in words used to split the text before embedding. */
|
|
1359
|
+
chunkSize: number;
|
|
1360
|
+
};
|
|
1361
|
+
KnowledgeDocumentResponseDto: {
|
|
1362
|
+
/** @description Document ID. For `group` documents this is the vector reference group ID; for `standalone` documents it is the vector reference ID. */
|
|
1363
|
+
id: string;
|
|
1364
|
+
/** @description Document name. */
|
|
1365
|
+
name: string;
|
|
1366
|
+
/**
|
|
1367
|
+
* Format: date-time
|
|
1368
|
+
* @description Creation timestamp.
|
|
1369
|
+
*/
|
|
1370
|
+
createdAt: string;
|
|
1371
|
+
/** @description Number of parts (chunks) the document was split into. */
|
|
1372
|
+
partCount: number;
|
|
1373
|
+
/**
|
|
1374
|
+
* @description Whether the document is a multi-part group or a standalone single-part upload.
|
|
1375
|
+
* @enum {string}
|
|
1376
|
+
*/
|
|
1377
|
+
type: "group" | "standalone";
|
|
1378
|
+
};
|
|
1379
|
+
KnowledgeDocumentGroupVectorRefDto: {
|
|
1380
|
+
/** @description Vector reference ID. */
|
|
1381
|
+
id: string;
|
|
1382
|
+
/** @description Vector reference name, including the part suffix for multi-part uploads. */
|
|
1383
|
+
name: string;
|
|
1384
|
+
/**
|
|
1385
|
+
* Format: date-time
|
|
1386
|
+
* @description Creation timestamp.
|
|
1387
|
+
*/
|
|
1388
|
+
createdAt: string;
|
|
1389
|
+
/** @description Part number within the group, or null for single-part uploads. */
|
|
1390
|
+
part: number | null;
|
|
1391
|
+
/** @description Storage path of the raw text for this part. */
|
|
1392
|
+
s3Link: string | null;
|
|
1393
|
+
};
|
|
1394
|
+
KnowledgeDocumentGroupResponseDto: {
|
|
1395
|
+
/** @description Document group ID. */
|
|
1396
|
+
id: string;
|
|
1397
|
+
/** @description Document group name, or null for legacy groups without a stored name. */
|
|
1398
|
+
name: string | null;
|
|
1399
|
+
/**
|
|
1400
|
+
* Format: date-time
|
|
1401
|
+
* @description Creation timestamp.
|
|
1402
|
+
*/
|
|
1403
|
+
createdAt: string;
|
|
1404
|
+
/** @description ID of the knowledge base the group belongs to, or null for legacy groups. */
|
|
1405
|
+
FK_knowledgeId: string | null;
|
|
1406
|
+
/** @description Vector references (parts) in the group, ordered by part number. */
|
|
1407
|
+
vectorRefs: components["schemas"]["KnowledgeDocumentGroupVectorRefDto"][];
|
|
1408
|
+
};
|
|
1409
|
+
ManuallyRunWorkflowInputDataDto: {
|
|
1410
|
+
/**
|
|
1411
|
+
* @description Values for the custom input fields configured on the workflow "Manually Run" trigger, keyed by field ID. Pass an empty object when the trigger defines no custom input fields.
|
|
1412
|
+
* @example {
|
|
1413
|
+
* "customerEmail": "jane@example.com",
|
|
1414
|
+
* "priority": "high"
|
|
1415
|
+
* }
|
|
1416
|
+
*/
|
|
1417
|
+
inputData: {
|
|
1418
|
+
[key: string]: unknown;
|
|
1419
|
+
};
|
|
1420
|
+
};
|
|
1421
|
+
ExecuteWorkflowResponseDto: {
|
|
1422
|
+
/** @description ID of the newly created execution. Poll GET /executions/{executionId} to track progress. */
|
|
1423
|
+
id: string;
|
|
1424
|
+
};
|
|
1425
|
+
ExecutionWorkspaceSummaryDto: {
|
|
1426
|
+
/** @description Workspace ID */
|
|
1427
|
+
id: string;
|
|
1428
|
+
/** @description Workspace name */
|
|
1429
|
+
name: string;
|
|
1430
|
+
};
|
|
1431
|
+
ExecutionProjectSummaryDto: {
|
|
1432
|
+
/** @description Project ID */
|
|
1433
|
+
id: string;
|
|
1434
|
+
/** @description Project name */
|
|
1435
|
+
name: string;
|
|
1436
|
+
/** @description The workspace the project belongs to. Included when `expansion=workspace` is requested alongside `workflow` and `project`. */
|
|
1437
|
+
workspace?: components["schemas"]["ExecutionWorkspaceSummaryDto"];
|
|
1438
|
+
};
|
|
1439
|
+
ExecutionWorkflowSummaryDto: {
|
|
1440
|
+
/** @description Workflow ID */
|
|
1441
|
+
id: string;
|
|
1442
|
+
/** @description Workflow name */
|
|
1443
|
+
name: string;
|
|
1444
|
+
/** @description The project the workflow belongs to. Included when `expansion=project` is requested alongside `workflow`. */
|
|
1445
|
+
project?: components["schemas"]["ExecutionProjectSummaryDto"];
|
|
1446
|
+
};
|
|
1447
|
+
ExecutionPathStepDto: {
|
|
1448
|
+
/** @description ID of the workflow node this step represents */
|
|
1449
|
+
nodeId: string;
|
|
1450
|
+
/** @description Human-friendly node name */
|
|
1451
|
+
label: string;
|
|
1452
|
+
/** @description ID of the app the node belongs to */
|
|
1453
|
+
appId: string;
|
|
1454
|
+
/** @description Action ID, present when the step is an action node */
|
|
1455
|
+
actionId?: string;
|
|
1456
|
+
/** @description Trigger ID, present when the step is the trigger node */
|
|
1457
|
+
triggerId?: string;
|
|
1458
|
+
/**
|
|
1459
|
+
* @description Step status. NEEDS_INPUT indicates the step is paused waiting for user input.
|
|
1460
|
+
* @enum {string}
|
|
1461
|
+
*/
|
|
1462
|
+
status: "RUNNING" | "SUCCESS" | "FAILED" | "NEEDS_INPUT" | "SCHEDULED" | "RETRYING" | "WAITING";
|
|
1463
|
+
/** @description Status detail message for the step */
|
|
1464
|
+
statusMessage?: string;
|
|
1465
|
+
/** @description Timestamp when the step started */
|
|
1466
|
+
startTime?: string;
|
|
1467
|
+
/** @description Timestamp when the step finished */
|
|
1468
|
+
endTime?: string;
|
|
1469
|
+
/** @description nodeId this step is an iteration of (set on loop child entries) */
|
|
1470
|
+
iterationOf?: string;
|
|
1471
|
+
/** @description Index of the loop iteration this step belongs to */
|
|
1472
|
+
iterationIndex?: number;
|
|
1473
|
+
/** @description On the collapsed loop parent entry: how many times the loop ran (or is planned to run) */
|
|
1474
|
+
iterationCount?: number;
|
|
1475
|
+
/**
|
|
1476
|
+
* @description Approval status when this step is a Request Approval node awaiting or past a decision
|
|
1477
|
+
* @enum {string}
|
|
1478
|
+
*/
|
|
1479
|
+
approvalStatus?: "pending" | "partially_approved" | "approved" | "rejected" | "expired";
|
|
1480
|
+
/** @description Number of approve decisions received so far */
|
|
1481
|
+
approvalsReceived?: number;
|
|
1482
|
+
/** @description Number of approvals required for quorum / current stage */
|
|
1483
|
+
approvalsRequired?: number;
|
|
1484
|
+
};
|
|
1485
|
+
PendingInputFieldDto: {
|
|
1486
|
+
/** @description Field ID used as the key when submitting input */
|
|
1487
|
+
id: string;
|
|
1488
|
+
/** @description Human-readable field label */
|
|
1489
|
+
label: string;
|
|
1490
|
+
/** @description Field input type from the workflow builder (e.g. text, number, select) */
|
|
1491
|
+
inputType: string;
|
|
1492
|
+
/** @description Whether the field must be provided to resume */
|
|
1493
|
+
required: boolean;
|
|
1494
|
+
/** @description Optional helper text for the field */
|
|
1495
|
+
description?: string;
|
|
1496
|
+
/** @description Selectable options when the field is a select-like input */
|
|
1497
|
+
options?: {
|
|
1498
|
+
label?: string;
|
|
1499
|
+
value?: string;
|
|
1500
|
+
}[];
|
|
1501
|
+
};
|
|
1502
|
+
PendingInputDto: {
|
|
1503
|
+
/** @description ID of the waiting workflow node */
|
|
1504
|
+
nodeId: string;
|
|
1505
|
+
/** @description Human-friendly node name */
|
|
1506
|
+
label: string;
|
|
1507
|
+
/** @description Action ID of the waiting node, when it is an action step */
|
|
1508
|
+
actionId?: string;
|
|
1509
|
+
/** @description Optional instructions configured on the waiting node */
|
|
1510
|
+
instructions?: string;
|
|
1511
|
+
/** @description Fields the custom UI should collect. Submit values keyed by field `id` to POST /api/webhooks/executions/{executionId}/nodes/{nodeId}/input. */
|
|
1512
|
+
fields: components["schemas"]["PendingInputFieldDto"][];
|
|
1513
|
+
};
|
|
1514
|
+
ExecutionResponseDto: {
|
|
1515
|
+
/** @description Execution ID */
|
|
1516
|
+
id: string;
|
|
1517
|
+
/**
|
|
1518
|
+
* Format: date-time
|
|
1519
|
+
* @description Timestamp when the execution started. Always returned by GET /executions/{executionId}; included in list responses when `expansion=startedAt` is requested.
|
|
1520
|
+
*/
|
|
1521
|
+
startedAt?: string;
|
|
1522
|
+
/**
|
|
1523
|
+
* Format: date-time
|
|
1524
|
+
* @description Timestamp when the execution stopped. Included when `expansion=stoppedAt` is requested.
|
|
1525
|
+
*/
|
|
1526
|
+
stoppedAt?: string | null;
|
|
1527
|
+
/**
|
|
1528
|
+
* Format: date-time
|
|
1529
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
1530
|
+
*/
|
|
1531
|
+
createdAt?: string;
|
|
1532
|
+
/**
|
|
1533
|
+
* Format: date-time
|
|
1534
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
1535
|
+
*/
|
|
1536
|
+
updatedAt?: string | null;
|
|
1537
|
+
/** @description Sequential execution number within the workflow. Included when `expansion=executionNumber` is requested. */
|
|
1538
|
+
executionNumber?: number;
|
|
1539
|
+
/** @description Raw execution node state (JSON). Included when `expansion=nodes` is requested. Most integrations should prefer the `executionPath` expansion instead. */
|
|
1540
|
+
nodes?: {
|
|
1541
|
+
[key: string]: unknown;
|
|
1542
|
+
}[];
|
|
1543
|
+
/** @description Raw execution edge state (JSON). Included when `expansion=edges` is requested. */
|
|
1544
|
+
edges?: {
|
|
1545
|
+
[key: string]: unknown;
|
|
1546
|
+
}[];
|
|
1547
|
+
/**
|
|
1548
|
+
* @description Overall execution status. Included when `expansion=status` is requested.
|
|
1549
|
+
* @enum {string}
|
|
1550
|
+
*/
|
|
1551
|
+
status?: "RUNNING" | "SUCCESS" | "FAILED" | "NEEDS_INPUT" | "SCHEDULED" | "CANCELLED" | "WAITING";
|
|
1552
|
+
/** @description Human-readable status detail. Included when `expansion=statusMessage` is requested. */
|
|
1553
|
+
statusMessage?: string | null;
|
|
1554
|
+
/** @description Final output of the execution (JSON). Included when `expansion=output` is requested. */
|
|
1555
|
+
output?: {
|
|
1556
|
+
[key: string]: unknown;
|
|
1557
|
+
} | null;
|
|
1558
|
+
/**
|
|
1559
|
+
* Format: date-time
|
|
1560
|
+
* @description Timestamp when a waiting execution is scheduled to continue. Included when `expansion=continueExecutionAt` is requested.
|
|
1561
|
+
*/
|
|
1562
|
+
continueExecutionAt?: string | null;
|
|
1563
|
+
/**
|
|
1564
|
+
* @description Editor orientation of the workflow canvas at execution time. Included when `expansion=orientation` is requested.
|
|
1565
|
+
* @enum {string}
|
|
1566
|
+
*/
|
|
1567
|
+
workflowOrientation?: "HORIZONTAL" | "VERTICAL";
|
|
1568
|
+
/** @description Variables captured during the execution (JSON). Included when `expansion=executionVariables` is requested. */
|
|
1569
|
+
executionVariables?: {
|
|
1570
|
+
[key: string]: unknown;
|
|
1571
|
+
} | null;
|
|
1572
|
+
/** @description The workflow the execution belongs to. Included when `expansion=workflow` is requested. */
|
|
1573
|
+
workflow?: components["schemas"]["ExecutionWorkflowSummaryDto"];
|
|
1574
|
+
/** @description Business-readable, ordered representation of the executed (or queued) steps, derived from the raw node and edge state: step labels, per-step status (including NEEDS_INPUT for steps paused awaiting user input), start and end timings, and loop iteration metadata. Custom UIs render execution progress from this field. Included when `expansion=executionPath` is requested. Only returned by GET /executions/{executionId}. */
|
|
1575
|
+
executionPath?: components["schemas"]["ExecutionPathStepDto"][];
|
|
1576
|
+
/** @description Field schemas for steps currently paused in NEEDS_INPUT. Each entry includes the waiting nodeId, label, optional instructions, and the fields to collect. Submit values keyed by field id to POST /api/webhooks/executions/{executionId}/nodes/{nodeId}/input. Included when `expansion=pendingInput` is requested. Only returned by GET /executions/{executionId}. Null when no step is waiting for input. */
|
|
1577
|
+
pendingInput?: components["schemas"]["PendingInputDto"][] | null;
|
|
1578
|
+
/**
|
|
1579
|
+
* @description How the execution was started. `WORKFLOW` for graph runs; `SDK` for ad-hoc single-action runs from the Public API / client SDK. Included when `expansion=source` is requested.
|
|
1580
|
+
* @enum {string}
|
|
1581
|
+
*/
|
|
1582
|
+
source?: "WORKFLOW" | "SDK";
|
|
1583
|
+
/** @description Optional display name (set for ad-hoc SDK runs). Included when `expansion=name` is requested. */
|
|
1584
|
+
name?: string | null;
|
|
1585
|
+
};
|
|
1586
|
+
RunActionDto: {
|
|
1587
|
+
/** @description Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
|
|
1588
|
+
appId: string;
|
|
1589
|
+
/** @description Action id within the app, e.g. `http_action_send-request`. Discover via GET /workflow-apps (`actions[].id` / `inputConfig`). */
|
|
1590
|
+
actionId: string;
|
|
1591
|
+
/** @description Connection instance UUID (`Connection.id`). Required when the action needs a connection and the workspace has more than one connection for the app with no single workspace default. When omitted: sole usable connection for the app is used; else the workspace default (`isDefault`); else 400 with candidates. Never silently picks among multiple non-default connections. */
|
|
1592
|
+
connectionId?: string;
|
|
1593
|
+
/** @description Project UUID used for variable/project scoping. When omitted and the workspace has exactly one project, that project is used; otherwise the request fails with 400. */
|
|
1594
|
+
projectId?: string;
|
|
1595
|
+
/** @description Action input fields (mirrors the action `inputConfig` keys). Combined with `connectionId` into the action configValue. */
|
|
1596
|
+
input?: {
|
|
1597
|
+
[key: string]: unknown;
|
|
1598
|
+
};
|
|
1599
|
+
/** @description Optional display name for the ad-hoc Execution. */
|
|
1600
|
+
name?: string;
|
|
1601
|
+
};
|
|
1602
|
+
RunActionResponseDto: {
|
|
1603
|
+
/** @description ID of the ad-hoc Execution. Use GET /executions/{executionId} (with expansion=executionPath) to re-read progress. */
|
|
1604
|
+
id: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* @description Final execution status after the single action step.
|
|
1607
|
+
* @enum {string}
|
|
1608
|
+
*/
|
|
1609
|
+
status: "RUNNING" | "SUCCESS" | "FAILED" | "NEEDS_INPUT" | "SCHEDULED" | "CANCELLED" | "WAITING";
|
|
1610
|
+
/** @description Human-readable status detail. */
|
|
1611
|
+
statusMessage?: string | null;
|
|
1612
|
+
/** @description Action output on success (same shape as a workflow step output). Null on failure or when the run paused. */
|
|
1613
|
+
output?: {
|
|
1614
|
+
[key: string]: unknown;
|
|
1615
|
+
} | null;
|
|
1616
|
+
/** @description Single-step executionPath for the ad-hoc run (label, status, timings). */
|
|
1617
|
+
executionPath?: components["schemas"]["ExecutionPathStepDto"][];
|
|
1618
|
+
};
|
|
1619
|
+
RunStepDto: {
|
|
1620
|
+
/** @description Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
|
|
1621
|
+
appId: string;
|
|
1622
|
+
/** @description Action id within the app, e.g. `http_action_send-request`. Discover via GET /workflow-apps. */
|
|
1623
|
+
actionId: string;
|
|
1624
|
+
/** @description Connection instance UUID. When omitted, the platform resolves: sole usable connection for the app, else the workspace default (`isDefault`), else 400 with candidates. */
|
|
1625
|
+
connectionId?: string;
|
|
1626
|
+
/** @description Action input fields (mirrors the action `inputConfig` keys). */
|
|
1627
|
+
input?: {
|
|
1628
|
+
[key: string]: unknown;
|
|
1629
|
+
};
|
|
1630
|
+
/** @description Optional display name for this step. */
|
|
1631
|
+
name?: string;
|
|
1632
|
+
};
|
|
1633
|
+
StartRunDto: {
|
|
1634
|
+
/** @description Linear catalogue-action steps. Executed as one multi-step Execution with `source: SDK` (not a soft batch / correlation id). */
|
|
1635
|
+
steps: components["schemas"]["RunStepDto"][];
|
|
1636
|
+
/** @description Project UUID for variable/project scoping. When omitted and the workspace has exactly one project, that project is used. */
|
|
1637
|
+
projectId?: string;
|
|
1638
|
+
/** @description Optional display name for the ad-hoc Execution. */
|
|
1639
|
+
name?: string;
|
|
1640
|
+
};
|
|
1641
|
+
CreateVariableDto: {
|
|
1642
|
+
/** @description Name of the variable. */
|
|
1643
|
+
name: string;
|
|
1644
|
+
/** @description Description of the variable. */
|
|
1645
|
+
description?: string;
|
|
1646
|
+
/**
|
|
1647
|
+
* @description Scope of the variable (system, workspace or project).
|
|
1648
|
+
* @enum {string}
|
|
1649
|
+
*/
|
|
1650
|
+
type: "system" | "workspace" | "project";
|
|
1651
|
+
/**
|
|
1652
|
+
* @description Data type of the variable value.
|
|
1653
|
+
* @enum {string}
|
|
1654
|
+
*/
|
|
1655
|
+
dataType: "string" | "number" | "boolean" | "date" | "json";
|
|
1656
|
+
/** @description Project ID to scope the variable to. Must belong to the current workspace. */
|
|
1657
|
+
projectId?: string;
|
|
1658
|
+
/** @description Variable value, submitted as a string. Values with dataType `number` are converted to numbers on save. */
|
|
1659
|
+
value: string;
|
|
1660
|
+
};
|
|
1661
|
+
VariableWorkspaceDto: {
|
|
1662
|
+
/** @description Workspace ID. */
|
|
1663
|
+
id: string;
|
|
1664
|
+
/** @description Workspace name. */
|
|
1665
|
+
name: string;
|
|
1666
|
+
};
|
|
1667
|
+
VariableProjectDto: {
|
|
1668
|
+
/** @description Project ID. */
|
|
1669
|
+
id: string;
|
|
1670
|
+
/** @description Project name. */
|
|
1671
|
+
name: string;
|
|
1672
|
+
};
|
|
1673
|
+
VariableResponseDto: {
|
|
1674
|
+
/** @description Variable ID. */
|
|
1675
|
+
id: string;
|
|
1676
|
+
/** @description Variable name. */
|
|
1677
|
+
name: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* @description Data type of the variable value.
|
|
1680
|
+
* @enum {string}
|
|
1681
|
+
*/
|
|
1682
|
+
dataType: "string" | "number" | "boolean" | "date" | "json";
|
|
1683
|
+
/**
|
|
1684
|
+
* @description Scope of the variable (system, workspace or project).
|
|
1685
|
+
* @enum {string}
|
|
1686
|
+
*/
|
|
1687
|
+
type: "system" | "workspace" | "project";
|
|
1688
|
+
/** @description Variable value. Included when `expansion=value` is requested. */
|
|
1689
|
+
value?: Record<string, never>;
|
|
1690
|
+
/** @description Variable description. Included when `expansion=description` is requested. */
|
|
1691
|
+
description?: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* Format: date-time
|
|
1694
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
1695
|
+
*/
|
|
1696
|
+
createdAt?: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* Format: date-time
|
|
1699
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
1700
|
+
*/
|
|
1701
|
+
updatedAt?: string;
|
|
1702
|
+
/** @description Owning workspace. Included when `expansion=workspace` is requested. */
|
|
1703
|
+
workspace?: components["schemas"]["VariableWorkspaceDto"];
|
|
1704
|
+
/** @description Owning project for project-scoped variables. Included when `expansion=project` is requested. */
|
|
1705
|
+
project?: components["schemas"]["VariableProjectDto"];
|
|
1706
|
+
};
|
|
1707
|
+
UpdateVariableDto: {
|
|
1708
|
+
/** @description Name of the variable. */
|
|
1709
|
+
name?: string;
|
|
1710
|
+
/** @description Description of the variable. */
|
|
1711
|
+
description?: string;
|
|
1712
|
+
/**
|
|
1713
|
+
* @description Scope of the variable (system, workspace or project).
|
|
1714
|
+
* @enum {string}
|
|
1715
|
+
*/
|
|
1716
|
+
type?: "system" | "workspace" | "project";
|
|
1717
|
+
/**
|
|
1718
|
+
* @description Data type of the variable value.
|
|
1719
|
+
* @enum {string}
|
|
1720
|
+
*/
|
|
1721
|
+
dataType?: "string" | "number" | "boolean" | "date" | "json";
|
|
1722
|
+
/** @description Project ID to scope the variable to. Must belong to the current workspace. */
|
|
1723
|
+
projectId?: string;
|
|
1724
|
+
/** @description Variable value, submitted as a string. Values with dataType `number` are converted to numbers on save. */
|
|
1725
|
+
value?: string;
|
|
1726
|
+
};
|
|
1727
|
+
ConnectionWorkspaceDto: {
|
|
1728
|
+
/** @description Workspace ID. */
|
|
1729
|
+
id: string;
|
|
1730
|
+
/** @description Workspace name. */
|
|
1731
|
+
name: string;
|
|
1732
|
+
};
|
|
1733
|
+
ConnectionResponseDto: {
|
|
1734
|
+
/** @description Connection ID. */
|
|
1735
|
+
id: string;
|
|
1736
|
+
/** @description Connection name. */
|
|
1737
|
+
name: string;
|
|
1738
|
+
/**
|
|
1739
|
+
* Format: date-time
|
|
1740
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
1741
|
+
*/
|
|
1742
|
+
createdAt?: string;
|
|
1743
|
+
/**
|
|
1744
|
+
* Format: date-time
|
|
1745
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
1746
|
+
*/
|
|
1747
|
+
updatedAt?: string;
|
|
1748
|
+
/** @description App connection type ID (e.g. the OAuth2 or API key connection definition of the app). Included when `expansion=connectionId` is requested. */
|
|
1749
|
+
connectionId?: string;
|
|
1750
|
+
/** @description ID of the workflow app this connection belongs to. Included when `expansion=workflowAppId` or `expansion=workflowApp` is requested. */
|
|
1751
|
+
workflowAppId?: string;
|
|
1752
|
+
/** @description Full workflow app definition for this connection. Included when `expansion=workflowApp` is requested on the list endpoint. */
|
|
1753
|
+
workflowApp?: {
|
|
1754
|
+
[key: string]: unknown;
|
|
1755
|
+
};
|
|
1756
|
+
/** @description Owning workspace. Included when `expansion=workspace` is requested. */
|
|
1757
|
+
workspace?: components["schemas"]["ConnectionWorkspaceDto"];
|
|
1758
|
+
};
|
|
1759
|
+
AgentResponseDto: {
|
|
1760
|
+
/**
|
|
1761
|
+
* @description Agent ID (UUID)
|
|
1762
|
+
* @example 4f7c9d2e-8a1b-4c3d-9e5f-6a7b8c9d0e1f
|
|
1763
|
+
*/
|
|
1764
|
+
id: string;
|
|
1765
|
+
/**
|
|
1766
|
+
* @description Agent name
|
|
1767
|
+
* @example Invoice Triage Agent
|
|
1768
|
+
*/
|
|
1769
|
+
name: string;
|
|
1770
|
+
/** @description Stable project-scoped slug for CLI / code deploy upserts. Included when `expansion=slug` is requested. */
|
|
1771
|
+
slug?: string | null;
|
|
1772
|
+
/** @description True when last written by code (CLI / SDK). Included when `expansion=managedByCode` is requested. */
|
|
1773
|
+
managedByCode?: boolean;
|
|
1774
|
+
/** @description ID of the AI provider connection assigned to the agent. Always included. Null when the agent falls back to the workspace default connection. */
|
|
1775
|
+
FK_aiConnectionId: string | null;
|
|
1776
|
+
/** @description Agent description. Included when `expansion=description` is requested. */
|
|
1777
|
+
description?: string | null;
|
|
1778
|
+
/** @description Public URL of the agent profile image. Included when `expansion=profileImageUrl` is requested. */
|
|
1779
|
+
profileImageUrl?: string | null;
|
|
1780
|
+
/**
|
|
1781
|
+
* Format: date-time
|
|
1782
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
1783
|
+
*/
|
|
1784
|
+
createdAt?: string;
|
|
1785
|
+
/**
|
|
1786
|
+
* Format: date-time
|
|
1787
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
1788
|
+
*/
|
|
1789
|
+
updatedAt?: string;
|
|
1790
|
+
/** @description System instructions authored for the agent. Included when `expansion=instructions` is requested. */
|
|
1791
|
+
instructions?: string | null;
|
|
1792
|
+
/**
|
|
1793
|
+
* @description Model temperature. Included when `expansion=temperature` is requested.
|
|
1794
|
+
* @example 1
|
|
1795
|
+
*/
|
|
1796
|
+
temperature?: number;
|
|
1797
|
+
/** @description Maximum output tokens per turn. Included when `expansion=maxOutputTokens` is requested. */
|
|
1798
|
+
maxOutputTokens?: number | null;
|
|
1799
|
+
/**
|
|
1800
|
+
* @description Top-p sampling. Included when `expansion=topP` is requested.
|
|
1801
|
+
* @example 1
|
|
1802
|
+
*/
|
|
1803
|
+
topP?: number;
|
|
1804
|
+
/**
|
|
1805
|
+
* @description Frequency penalty. Included when `expansion=frequencyPenalty` is requested.
|
|
1806
|
+
* @example 0
|
|
1807
|
+
*/
|
|
1808
|
+
frequencyPenalty?: number;
|
|
1809
|
+
/**
|
|
1810
|
+
* @description Presence penalty. Included when `expansion=presencePenalty` is requested.
|
|
1811
|
+
* @example 0
|
|
1812
|
+
*/
|
|
1813
|
+
presencePenalty?: number;
|
|
1814
|
+
/**
|
|
1815
|
+
* @description Maximum retries for a failed model call. Included when `expansion=maxRetries` is requested.
|
|
1816
|
+
* @example 0
|
|
1817
|
+
*/
|
|
1818
|
+
maxRetries?: number;
|
|
1819
|
+
/** @description Fixed sampling seed. Included when `expansion=seed` is requested. */
|
|
1820
|
+
seed?: number | null;
|
|
1821
|
+
/**
|
|
1822
|
+
* @description Maximum tool roundtrips per turn. Included when `expansion=maxToolRoundtrips` is requested.
|
|
1823
|
+
* @example 5
|
|
1824
|
+
*/
|
|
1825
|
+
maxToolRoundtrips?: number;
|
|
1826
|
+
/**
|
|
1827
|
+
* @description How many previous messages are sent to the model. Included when `expansion=messageLookbackLimit` is requested.
|
|
1828
|
+
* @example 40
|
|
1829
|
+
*/
|
|
1830
|
+
messageLookbackLimit?: number;
|
|
1831
|
+
/** @description Configured tool nodes (app actions) for the agent. Included when `expansion=tools` is requested. */
|
|
1832
|
+
tools?: {
|
|
1833
|
+
[key: string]: unknown;
|
|
1834
|
+
}[] | null;
|
|
1835
|
+
/** @description Action IDs of the configured tools. Included when `expansion=toolIds` is requested. */
|
|
1836
|
+
toolIds?: string[];
|
|
1837
|
+
/** @description Instructions used when auto-naming new tasks. Included when `expansion=taskNamingInstructions` is requested. */
|
|
1838
|
+
taskNamingInstructions?: string | null;
|
|
1839
|
+
/** @description IDs of enabled provider built-in tools. Included when `expansion=enabledBuiltInTools` is requested. */
|
|
1840
|
+
enabledBuiltInTools?: string[];
|
|
1841
|
+
/** @description IDs of enabled platform tools. Included when `expansion=enabledPlatformTools` is requested. */
|
|
1842
|
+
enabledPlatformTools?: string[];
|
|
1843
|
+
/** @description Whether dynamic workflow-app action discovery is enabled. Included when `expansion=dynamicActionDiscoveryEnabled` is requested. */
|
|
1844
|
+
dynamicActionDiscoveryEnabled?: boolean;
|
|
1845
|
+
/** @description Whether dynamic MCP server discovery is enabled. Included when `expansion=dynamicMcpDiscoveryEnabled` is requested. */
|
|
1846
|
+
dynamicMcpDiscoveryEnabled?: boolean;
|
|
1847
|
+
/** @description Whether the agent maintains its own instructions. Included when `expansion=dynamicSelfInstructionsEnabled` is requested. */
|
|
1848
|
+
dynamicSelfInstructionsEnabled?: boolean;
|
|
1849
|
+
/** @description Whether long-term memory is enabled. Included when `expansion=memoryEnabled` is requested. */
|
|
1850
|
+
memoryEnabled?: boolean;
|
|
1851
|
+
/**
|
|
1852
|
+
* @description Memory partitioning scope. Included when `expansion=memoryScope` is requested.
|
|
1853
|
+
* @enum {string}
|
|
1854
|
+
*/
|
|
1855
|
+
memoryScope?: "PER_USER" | "PER_AGENT" | "PER_USER_PER_AGENT";
|
|
1856
|
+
/**
|
|
1857
|
+
* @description Days memories are retained. Included when `expansion=memoryRetentionDays` is requested.
|
|
1858
|
+
* @example 90
|
|
1859
|
+
*/
|
|
1860
|
+
memoryRetentionDays?: number;
|
|
1861
|
+
/** @description Suggested prompts shown to users starting a conversation. Included when `expansion=suggestedPrompts` is requested. */
|
|
1862
|
+
suggestedPrompts?: string[];
|
|
1863
|
+
/**
|
|
1864
|
+
* Format: date-time
|
|
1865
|
+
* @description When the first-time builder setup wizard was completed. Included when `expansion=builderSetupCompletedAt` is requested.
|
|
1866
|
+
*/
|
|
1867
|
+
builderSetupCompletedAt?: string | null;
|
|
1868
|
+
/** @description Saved canvas node positions for the agent builder. Included when `expansion=builderCanvasPositions` is requested. */
|
|
1869
|
+
builderCanvasPositions?: {
|
|
1870
|
+
[key: string]: unknown;
|
|
1871
|
+
} | null;
|
|
1872
|
+
/** @description Selected model ID within the AI provider connection. Included when `expansion=selectedModelId` is requested. */
|
|
1873
|
+
selectedModelId?: string | null;
|
|
1874
|
+
/** @description Assigned AI provider connection. Included when `expansion=aiConnection` is requested. */
|
|
1875
|
+
aiConnection?: {
|
|
1876
|
+
id?: string;
|
|
1877
|
+
name?: string;
|
|
1878
|
+
providerConfig?: {
|
|
1879
|
+
id?: string;
|
|
1880
|
+
providerSlug?: string;
|
|
1881
|
+
};
|
|
1882
|
+
} | null;
|
|
1883
|
+
/** @description Knowledge notebooks attached to the agent. Included when `expansion=knowledge` is requested. */
|
|
1884
|
+
agentKnowledge?: {
|
|
1885
|
+
id?: string;
|
|
1886
|
+
knowledge?: {
|
|
1887
|
+
id?: string;
|
|
1888
|
+
name?: string;
|
|
1889
|
+
};
|
|
1890
|
+
}[];
|
|
1891
|
+
/** @description Object types attached to the agent. Included when `expansion=objectTypes` is requested. */
|
|
1892
|
+
agentObjectTypes?: {
|
|
1893
|
+
id?: string;
|
|
1894
|
+
scope?: string;
|
|
1895
|
+
objectType?: {
|
|
1896
|
+
id?: string;
|
|
1897
|
+
name?: string;
|
|
1898
|
+
slug?: string;
|
|
1899
|
+
icon?: string | null;
|
|
1900
|
+
color?: string | null;
|
|
1901
|
+
};
|
|
1902
|
+
}[];
|
|
1903
|
+
/** @description Objects attached to the agent. Included when `expansion=objects` is requested. */
|
|
1904
|
+
agentObjects?: {
|
|
1905
|
+
id?: string;
|
|
1906
|
+
scope?: string;
|
|
1907
|
+
object?: {
|
|
1908
|
+
id?: string;
|
|
1909
|
+
name?: string;
|
|
1910
|
+
state?: string;
|
|
1911
|
+
objectType?: {
|
|
1912
|
+
id?: string;
|
|
1913
|
+
name?: string;
|
|
1914
|
+
slug?: string;
|
|
1915
|
+
icon?: string | null;
|
|
1916
|
+
color?: string | null;
|
|
1917
|
+
};
|
|
1918
|
+
};
|
|
1919
|
+
}[];
|
|
1920
|
+
/** @description App connections available to the agent. Included when `expansion=connections` is requested. */
|
|
1921
|
+
connections?: {
|
|
1922
|
+
id?: string;
|
|
1923
|
+
name?: string;
|
|
1924
|
+
}[];
|
|
1925
|
+
/** @description Variables attached to the agent. Included when `expansion=variables` is requested. */
|
|
1926
|
+
agentVariables?: {
|
|
1927
|
+
id?: string;
|
|
1928
|
+
variable?: {
|
|
1929
|
+
id?: string;
|
|
1930
|
+
name?: string;
|
|
1931
|
+
};
|
|
1932
|
+
}[];
|
|
1933
|
+
/** @description Workflows the agent can trigger. Included when `expansion=workflows` is requested. */
|
|
1934
|
+
agentWorkflows?: {
|
|
1935
|
+
id?: string;
|
|
1936
|
+
workflow?: {
|
|
1937
|
+
id?: string;
|
|
1938
|
+
name?: string;
|
|
1939
|
+
};
|
|
1940
|
+
}[];
|
|
1941
|
+
/** @description Sub-agent links for the agent. Included when `expansion=subAgents` is requested. */
|
|
1942
|
+
agentSubAgents?: {
|
|
1943
|
+
id?: string;
|
|
1944
|
+
subagent?: {
|
|
1945
|
+
id?: string;
|
|
1946
|
+
name?: string;
|
|
1947
|
+
};
|
|
1948
|
+
parentAgent?: {
|
|
1949
|
+
id?: string;
|
|
1950
|
+
name?: string;
|
|
1951
|
+
};
|
|
1952
|
+
}[];
|
|
1953
|
+
/** @description MCP servers attached to the agent, with per-tool overrides. Included when `expansion=mcpServers` is requested. */
|
|
1954
|
+
agentMcpServers?: {
|
|
1955
|
+
id?: string;
|
|
1956
|
+
mcpServer?: {
|
|
1957
|
+
id?: string;
|
|
1958
|
+
slug?: string;
|
|
1959
|
+
name?: string;
|
|
1960
|
+
provider?: string;
|
|
1961
|
+
logoUrl?: string | null;
|
|
1962
|
+
description?: string | null;
|
|
1963
|
+
};
|
|
1964
|
+
toolOverrides?: {
|
|
1965
|
+
id?: string;
|
|
1966
|
+
toolName?: string;
|
|
1967
|
+
enabled?: boolean;
|
|
1968
|
+
requireApproval?: boolean;
|
|
1969
|
+
}[];
|
|
1970
|
+
}[];
|
|
1971
|
+
/** @description A2A (agent-to-agent) endpoints attached to the agent. Included when `expansion=a2aAgents` is requested. */
|
|
1972
|
+
agentA2aAgents?: {
|
|
1973
|
+
id?: string;
|
|
1974
|
+
a2aAgent?: {
|
|
1975
|
+
id?: string;
|
|
1976
|
+
slug?: string;
|
|
1977
|
+
name?: string;
|
|
1978
|
+
logoUrl?: string | null;
|
|
1979
|
+
description?: string | null;
|
|
1980
|
+
authType?: string;
|
|
1981
|
+
};
|
|
1982
|
+
}[];
|
|
1983
|
+
/** @description Web access configuration. Included when `expansion=webAccess` is requested. */
|
|
1984
|
+
agentWebAccess?: {
|
|
1985
|
+
service?: string;
|
|
1986
|
+
webSearchEnabled?: boolean;
|
|
1987
|
+
websiteAccessEnabled?: boolean;
|
|
1988
|
+
} | null;
|
|
1989
|
+
/** @description Phone access configuration. Included when `expansion=phoneAccess` is requested. */
|
|
1990
|
+
agentPhoneAccess?: {
|
|
1991
|
+
service?: string;
|
|
1992
|
+
outboundCallsEnabled?: boolean;
|
|
1993
|
+
inboundCallsEnabled?: boolean;
|
|
1994
|
+
} | null;
|
|
1995
|
+
/** @description Project the agent belongs to. Included when `expansion=project` is requested. */
|
|
1996
|
+
project?: {
|
|
1997
|
+
id?: string;
|
|
1998
|
+
name?: string;
|
|
1999
|
+
};
|
|
2000
|
+
};
|
|
2001
|
+
UpsertAgentToolDto: {
|
|
2002
|
+
/** @description Workflow app id (catalogue slug). */
|
|
2003
|
+
appId: string;
|
|
2004
|
+
/** @description Catalogue action id. */
|
|
2005
|
+
actionId: string;
|
|
2006
|
+
/** @description Connection instance UUID pre-bound on the tool. */
|
|
2007
|
+
connectionId?: string;
|
|
2008
|
+
/** @description Tool display name for the model. */
|
|
2009
|
+
name?: string;
|
|
2010
|
+
/** @description Tool description shown to the model. */
|
|
2011
|
+
description?: string;
|
|
2012
|
+
/** @description Pre-filled tool config (fields left empty are filled by the model). */
|
|
2013
|
+
input?: {
|
|
2014
|
+
[key: string]: unknown;
|
|
2015
|
+
};
|
|
2016
|
+
};
|
|
2017
|
+
UpsertAgentBySlugDto: {
|
|
2018
|
+
/**
|
|
2019
|
+
* @description Stable project-scoped slug (lowercase, digits, hyphens). Used as the upsert key.
|
|
2020
|
+
* @example support-triage
|
|
2021
|
+
*/
|
|
2022
|
+
slug: string;
|
|
2023
|
+
/** @description Display name. Defaults to the slug when omitted. */
|
|
2024
|
+
name?: string;
|
|
2025
|
+
description?: string;
|
|
2026
|
+
/** @description System instructions / prompt for the agent. */
|
|
2027
|
+
instructions: string;
|
|
2028
|
+
/** @description Selected model id on the AI provider connection (e.g. `gpt-4o`). */
|
|
2029
|
+
model: string;
|
|
2030
|
+
/** @description AiProviderConnection UUID. When omitted, platform AI defaults apply. */
|
|
2031
|
+
aiConnectionId?: string;
|
|
2032
|
+
/** @description App Connection UUIDs the agent may use for tools. */
|
|
2033
|
+
connectionIds?: string[];
|
|
2034
|
+
/** @description Workflow UUIDs the agent may run (AgentWorkflow links). */
|
|
2035
|
+
workflowIds?: string[];
|
|
2036
|
+
/** @description Catalogue action tools (WorkflowNodeForRunner-shaped). */
|
|
2037
|
+
tools?: components["schemas"]["UpsertAgentToolDto"][];
|
|
2038
|
+
/** @description Marks the row as managed by code (CLI / SDK). Defaults to true on this endpoint. */
|
|
2039
|
+
managedByCode?: boolean;
|
|
2040
|
+
};
|
|
2041
|
+
TaskListItemResponseDto: {
|
|
2042
|
+
/**
|
|
2043
|
+
* @description Task ID (UUID)
|
|
2044
|
+
* @example 2c8e0f1a-3b4d-4e5f-8a9b-0c1d2e3f4a5b
|
|
2045
|
+
*/
|
|
2046
|
+
id: string;
|
|
2047
|
+
/**
|
|
2048
|
+
* @description Task name
|
|
2049
|
+
* @example Summarise the Q3 sales figures
|
|
2050
|
+
*/
|
|
2051
|
+
name: string;
|
|
2052
|
+
/** @description True when a UI stream is currently in progress for this task */
|
|
2053
|
+
isStreaming: boolean;
|
|
2054
|
+
/** @description Task description. Included when `expansion=description` is requested. */
|
|
2055
|
+
description?: string | null;
|
|
2056
|
+
/**
|
|
2057
|
+
* Format: date-time
|
|
2058
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
2059
|
+
*/
|
|
2060
|
+
createdAt?: string;
|
|
2061
|
+
/**
|
|
2062
|
+
* Format: date-time
|
|
2063
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
2064
|
+
*/
|
|
2065
|
+
updatedAt?: string;
|
|
2066
|
+
/** @description Conversation messages ordered oldest first. Included when `expansion=messages` is requested. */
|
|
2067
|
+
messages?: {
|
|
2068
|
+
id?: string;
|
|
2069
|
+
/** @description Message content in AI SDK UIMessage part format */
|
|
2070
|
+
content?: {
|
|
2071
|
+
[key: string]: unknown;
|
|
2072
|
+
} | {
|
|
2073
|
+
[key: string]: unknown;
|
|
2074
|
+
}[] | string;
|
|
2075
|
+
/** @enum {string} */
|
|
2076
|
+
role?: "system" | "user" | "assistant" | "function" | "data" | "tool";
|
|
2077
|
+
/** Format: date-time */
|
|
2078
|
+
createdAt?: string;
|
|
2079
|
+
data?: {
|
|
2080
|
+
[key: string]: unknown;
|
|
2081
|
+
} | null;
|
|
2082
|
+
}[];
|
|
2083
|
+
/** @description Agent the task belongs to. Included when `expansion=agent` is requested. The nested `project` is included when `expansion=project` is also requested. */
|
|
2084
|
+
agent?: {
|
|
2085
|
+
id?: string;
|
|
2086
|
+
name?: string;
|
|
2087
|
+
project?: {
|
|
2088
|
+
id?: string;
|
|
2089
|
+
name?: string;
|
|
2090
|
+
};
|
|
2091
|
+
};
|
|
2092
|
+
};
|
|
2093
|
+
TaskLatestRunDto: {
|
|
2094
|
+
/**
|
|
2095
|
+
* @description Run ID (also the resumable stream ID)
|
|
2096
|
+
* @example 9b2f4c6d-1e3a-4b5c-8d7e-0f1a2b3c4d5e
|
|
2097
|
+
*/
|
|
2098
|
+
id: string;
|
|
2099
|
+
/**
|
|
2100
|
+
* @description Run status
|
|
2101
|
+
* @enum {string}
|
|
2102
|
+
*/
|
|
2103
|
+
status: "QUEUED" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
2104
|
+
/** @description Error message when the run failed */
|
|
2105
|
+
errorMessage: string | null;
|
|
2106
|
+
/**
|
|
2107
|
+
* Format: date-time
|
|
2108
|
+
* @description When the run finished
|
|
2109
|
+
*/
|
|
2110
|
+
finishedAt: string | null;
|
|
2111
|
+
};
|
|
2112
|
+
TaskResponseDto: {
|
|
2113
|
+
/**
|
|
2114
|
+
* @description Task ID (UUID)
|
|
2115
|
+
* @example 2c8e0f1a-3b4d-4e5f-8a9b-0c1d2e3f4a5b
|
|
2116
|
+
*/
|
|
2117
|
+
id: string;
|
|
2118
|
+
/**
|
|
2119
|
+
* @description Task name
|
|
2120
|
+
* @example Summarise the Q3 sales figures
|
|
2121
|
+
*/
|
|
2122
|
+
name: string;
|
|
2123
|
+
/** @description True when a UI stream is currently in progress for this task */
|
|
2124
|
+
isStreaming: boolean;
|
|
2125
|
+
/**
|
|
2126
|
+
* Format: date-time
|
|
2127
|
+
* @description Timestamp of the last activity on the task
|
|
2128
|
+
*/
|
|
2129
|
+
lastActivityAt: string | null;
|
|
2130
|
+
/** @description Present when a resumable UI stream may still be running. Pass to `GET /agents/:agentId/tasks/:taskId/stream-message` to resume. */
|
|
2131
|
+
activeStreamId?: string;
|
|
2132
|
+
/** @description Durable outcome of the most recent agent-turn run. Omitted when the task has never run. */
|
|
2133
|
+
latestRun?: components["schemas"]["TaskLatestRunDto"];
|
|
2134
|
+
/** @description Task description. Included when `expansion=description` is requested. */
|
|
2135
|
+
description?: string | null;
|
|
2136
|
+
/**
|
|
2137
|
+
* Format: date-time
|
|
2138
|
+
* @description Creation timestamp. Included when `expansion=createdAt` is requested.
|
|
2139
|
+
*/
|
|
2140
|
+
createdAt?: string;
|
|
2141
|
+
/**
|
|
2142
|
+
* Format: date-time
|
|
2143
|
+
* @description Last update timestamp. Included when `expansion=updatedAt` is requested.
|
|
2144
|
+
*/
|
|
2145
|
+
updatedAt?: string;
|
|
2146
|
+
/** @description Client-supplied deduplication identifier. Included when `expansion=customIdentifier` is requested. */
|
|
2147
|
+
customIdentifier?: string | null;
|
|
2148
|
+
/** @description Conversation messages ordered oldest first. Included when `expansion=messages` is requested. */
|
|
2149
|
+
messages?: {
|
|
2150
|
+
id?: string;
|
|
2151
|
+
/** @description Message content in AI SDK UIMessage part format */
|
|
2152
|
+
content?: {
|
|
2153
|
+
[key: string]: unknown;
|
|
2154
|
+
} | {
|
|
2155
|
+
[key: string]: unknown;
|
|
2156
|
+
}[] | string;
|
|
2157
|
+
/** @enum {string} */
|
|
2158
|
+
role?: "system" | "user" | "assistant" | "function" | "data" | "tool";
|
|
2159
|
+
/** Format: date-time */
|
|
2160
|
+
createdAt?: string;
|
|
2161
|
+
data?: {
|
|
2162
|
+
[key: string]: unknown;
|
|
2163
|
+
} | null;
|
|
2164
|
+
}[];
|
|
2165
|
+
/** @description Agent the task belongs to. Included when `expansion=agent` is requested. The nested `project` is included when `expansion=project` is also requested. */
|
|
2166
|
+
agent?: {
|
|
2167
|
+
id?: string;
|
|
2168
|
+
name?: string;
|
|
2169
|
+
project?: {
|
|
2170
|
+
id?: string;
|
|
2171
|
+
name?: string;
|
|
2172
|
+
};
|
|
2173
|
+
};
|
|
2174
|
+
};
|
|
2175
|
+
UpdateTaskDto: {
|
|
2176
|
+
/**
|
|
2177
|
+
* @description New task name
|
|
2178
|
+
* @example Summarise the Q3 sales figures
|
|
2179
|
+
*/
|
|
2180
|
+
name?: string;
|
|
2181
|
+
/**
|
|
2182
|
+
* @description New task description
|
|
2183
|
+
* @example Conversation covering the Q3 regional sales report
|
|
2184
|
+
*/
|
|
2185
|
+
description?: string;
|
|
2186
|
+
};
|
|
2187
|
+
DeletedTaskResponseDto: {
|
|
2188
|
+
/**
|
|
2189
|
+
* @description Task ID (UUID)
|
|
2190
|
+
* @example 2c8e0f1a-3b4d-4e5f-8a9b-0c1d2e3f4a5b
|
|
2191
|
+
*/
|
|
2192
|
+
id: string;
|
|
2193
|
+
/**
|
|
2194
|
+
* Format: date-time
|
|
2195
|
+
* @description Creation timestamp
|
|
2196
|
+
*/
|
|
2197
|
+
createdAt: string;
|
|
2198
|
+
/**
|
|
2199
|
+
* Format: date-time
|
|
2200
|
+
* @description Last update timestamp
|
|
2201
|
+
*/
|
|
2202
|
+
updatedAt: string;
|
|
2203
|
+
/**
|
|
2204
|
+
* @description Task name
|
|
2205
|
+
* @example Summarise the Q3 sales figures
|
|
2206
|
+
*/
|
|
2207
|
+
name: string;
|
|
2208
|
+
/** @description Task description */
|
|
2209
|
+
description: string | null;
|
|
2210
|
+
/** @description ID of the agent the task belonged to */
|
|
2211
|
+
FK_agentId: string;
|
|
2212
|
+
/** @description Client-supplied deduplication identifier */
|
|
2213
|
+
customIdentifier: string | null;
|
|
2214
|
+
/** @description Resumable stream ID that was active when the task was deleted, if any */
|
|
2215
|
+
activeStreamId: string | null;
|
|
2216
|
+
/**
|
|
2217
|
+
* Format: date-time
|
|
2218
|
+
* @description Timestamp of the last activity on the task
|
|
2219
|
+
*/
|
|
2220
|
+
lastActivityAt: string | null;
|
|
2221
|
+
/** @description Workspace user who owned the conversation. Null for legacy or builder-created tasks without owner attribution. */
|
|
2222
|
+
FK_ownerWorkspaceUserId: string | null;
|
|
2223
|
+
};
|
|
2224
|
+
CreateTaskDto: {
|
|
2225
|
+
/**
|
|
2226
|
+
* @description Task name shown in the task list
|
|
2227
|
+
* @example Summarise the Q3 sales figures
|
|
2228
|
+
*/
|
|
2229
|
+
name: string;
|
|
2230
|
+
/**
|
|
2231
|
+
* @description Optional task description
|
|
2232
|
+
* @example Conversation covering the Q3 regional sales report
|
|
2233
|
+
*/
|
|
2234
|
+
description?: string;
|
|
2235
|
+
/**
|
|
2236
|
+
* @description Client-supplied identifier used to deduplicate tasks for an agent. When a task with this identifier already exists, that task is returned instead of creating a new one.
|
|
2237
|
+
* @example crm-ticket-1042
|
|
2238
|
+
*/
|
|
2239
|
+
customIdentifier?: string;
|
|
2240
|
+
};
|
|
2241
|
+
MessageTaskDto: {
|
|
2242
|
+
/** @description Conversation messages in AI SDK UI format */
|
|
2243
|
+
messages: {
|
|
2244
|
+
[key: string]: unknown;
|
|
2245
|
+
}[];
|
|
2246
|
+
/**
|
|
2247
|
+
* @description Agent chat mode
|
|
2248
|
+
* @example preview
|
|
2249
|
+
* @enum {string}
|
|
2250
|
+
*/
|
|
2251
|
+
chatMode?: "builder" | "preview";
|
|
2252
|
+
/**
|
|
2253
|
+
* @description Optional attachment data for the message
|
|
2254
|
+
* @example {
|
|
2255
|
+
* "imageUrl": "https://example.com/image.png"
|
|
2256
|
+
* }
|
|
2257
|
+
*/
|
|
2258
|
+
data?: Record<string, never>;
|
|
2259
|
+
};
|
|
2260
|
+
StreamMessageStopDto: {
|
|
2261
|
+
/** @description Partial assistant message to persist when stopping a stream */
|
|
2262
|
+
assistantMessage?: {
|
|
2263
|
+
[key: string]: unknown;
|
|
2264
|
+
};
|
|
2265
|
+
};
|
|
2266
|
+
};
|
|
2267
|
+
responses: never;
|
|
2268
|
+
parameters: never;
|
|
2269
|
+
requestBodies: never;
|
|
2270
|
+
headers: never;
|
|
2271
|
+
pathItems: never;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* Friendly aliases over the OpenAPI-generated component schemas
|
|
2276
|
+
* (`src/generated/schema.d.ts`, produced by `npm run codegen:spec`).
|
|
2277
|
+
*
|
|
2278
|
+
* Regenerate the underlying types whenever the deployment's
|
|
2279
|
+
* `openapi.public.json` changes.
|
|
2280
|
+
*/
|
|
2281
|
+
|
|
2282
|
+
type Schemas = components['schemas'];
|
|
2283
|
+
type EnabledFeatures = Schemas['EnabledFeaturesResponseDto'];
|
|
2284
|
+
type Project = Schemas['ProjectResponseDto'];
|
|
2285
|
+
type CreateProjectInput = Schemas['CreateProjectDto'];
|
|
2286
|
+
type Agent = Schemas['AgentResponseDto'];
|
|
2287
|
+
type Task = Schemas['TaskResponseDto'];
|
|
2288
|
+
type TaskListItem = Schemas['TaskListItemResponseDto'];
|
|
2289
|
+
type CreateTaskInput = Schemas['CreateTaskDto'];
|
|
2290
|
+
type UpdateTaskInput = Schemas['UpdateTaskDto'];
|
|
2291
|
+
type DeletedTask = Schemas['DeletedTaskResponseDto'];
|
|
2292
|
+
type Workflow = Schemas['WorkflowResponseDto'];
|
|
2293
|
+
type Execution = Schemas['ExecutionResponseDto'];
|
|
2294
|
+
type ExecutionPathStep = Schemas['ExecutionPathStepDto'];
|
|
2295
|
+
type ExecuteWorkflowResult = Schemas['ExecuteWorkflowResponseDto'];
|
|
2296
|
+
type ExecutionStatus = NonNullable<Execution['status']>;
|
|
2297
|
+
type PendingInput = Schemas['PendingInputDto'];
|
|
2298
|
+
type RunActionResult = Schemas['RunActionResponseDto'];
|
|
2299
|
+
type Entity = Schemas['ObjectResponseDto'];
|
|
2300
|
+
type PaginatedEntities = Schemas['PaginatedObjectsResponseDto'];
|
|
2301
|
+
type CreateEntityInput = Schemas['CreateObjectDto'];
|
|
2302
|
+
type UpdateEntityInput = Schemas['UpdateObjectDto'];
|
|
2303
|
+
type ChangeEntityStateInput = Schemas['ChangeObjectStateDto'];
|
|
2304
|
+
type ChangeEntityStateResult = Schemas['ChangeObjectStateResponseDto'];
|
|
2305
|
+
type EntityStateHistoryEntry = Schemas['ObjectStateHistoryEntryResponseDto'];
|
|
2306
|
+
type EntityStateTransitions = Schemas['ObjectStateTransitionsResponseDto'];
|
|
2307
|
+
type ImportEntitiesResult = Schemas['ImportEntitiesResponseDto'];
|
|
2308
|
+
type ImportTemplate = Schemas['ImportTemplateResponseDto'];
|
|
2309
|
+
type EntityType = Schemas['ObjectTypeResponseDto'];
|
|
2310
|
+
type Knowledge = Schemas['KnowledgeResponseDto'];
|
|
2311
|
+
type CreateKnowledgeInput = Schemas['CreateKnowledgeDto'];
|
|
2312
|
+
type UpdateKnowledgeInput = Schemas['UpdateKnowledgeDto'];
|
|
2313
|
+
type SaveUploadedTextInput = Schemas['SaveUploadedTextToKnowledgeDto'];
|
|
2314
|
+
type KnowledgeDocument = Schemas['KnowledgeDocumentResponseDto'];
|
|
2315
|
+
type KnowledgeDocumentGroup = Schemas['KnowledgeDocumentGroupResponseDto'];
|
|
2316
|
+
type Queue = Schemas['QueueResponseDto'];
|
|
2317
|
+
type CreateQueueInput = Schemas['CreateQueueDto'];
|
|
2318
|
+
type UpdateQueueInput = Schemas['UpdateQueueDto'];
|
|
2319
|
+
type QueueStats = Schemas['QueueStatsResponseDto'];
|
|
2320
|
+
type QueueItem = Schemas['QueueItemResponseDto'];
|
|
2321
|
+
type QueueItemFull = Schemas['QueueItemFullResponseDto'];
|
|
2322
|
+
type CreateQueueItemInput = Schemas['CreateQueueItemDto'];
|
|
2323
|
+
type UpdateQueueItemInput = Schemas['UpdateQueueItemDto'];
|
|
2324
|
+
type QueueItemList = Schemas['QueueItemListResponseDto'];
|
|
2325
|
+
type QueueItemStats = Schemas['QueueItemStatsResponseDto'];
|
|
2326
|
+
type BulkCreateQueueItemsInput = Schemas['BulkCreateQueueItemsDto'];
|
|
2327
|
+
type BulkCreateQueueItemsResult = Schemas['BulkCreateQueueItemsResponseDto'];
|
|
2328
|
+
type QueueItemErrorEntry = Schemas['QueueItemErrorEntryResponseDto'];
|
|
2329
|
+
type Variable = Schemas['VariableResponseDto'];
|
|
2330
|
+
type CreateVariableInput = Schemas['CreateVariableDto'];
|
|
2331
|
+
type UpdateVariableInput = Schemas['UpdateVariableDto'];
|
|
2332
|
+
type Connection = Schemas['ConnectionResponseDto'];
|
|
2333
|
+
type WorkflowApp = Schemas['WorkflowAppResponseDto'];
|
|
2334
|
+
|
|
2335
|
+
type ExecutionStreamEventType = 'connected' | 'heartbeat' | 'execution.progress' | 'execution.finished' | 'execution.error' | 'loop.progress' | string;
|
|
2336
|
+
interface ExecutionStreamEvent {
|
|
2337
|
+
event: ExecutionStreamEventType;
|
|
2338
|
+
data: Record<string, unknown>;
|
|
2339
|
+
}
|
|
2340
|
+
interface WatchProgressOptions {
|
|
2341
|
+
signal?: AbortSignal;
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* Opens `GET /api/executions/:id/stream` and yields typed SSE events.
|
|
2345
|
+
* Prefer {@link ExecutionsResource.watchProgress} for timeline UIs.
|
|
2346
|
+
*/
|
|
2347
|
+
declare class ExecutionProgressStream implements AsyncIterable<ExecutionStreamEvent> {
|
|
2348
|
+
private readonly response;
|
|
2349
|
+
private readonly options?;
|
|
2350
|
+
private consumed;
|
|
2351
|
+
constructor(response: Response, options?: WatchProgressOptions | undefined);
|
|
2352
|
+
[Symbol.asyncIterator](): AsyncGenerator<ExecutionStreamEvent, void, undefined>;
|
|
2353
|
+
events(): AsyncGenerator<ExecutionStreamEvent, void, undefined>;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* Standard list-query conventions shared by most Lunnoa list endpoints:
|
|
2358
|
+
*
|
|
2359
|
+
* - `expansion` — comma-separated field names to include beyond the defaults
|
|
2360
|
+
* - `filterBy` — comma-separated `key:value` pairs
|
|
2361
|
+
* - `includeType` — comma-separated inclusion flags (e.g. `all`, `internal`)
|
|
2362
|
+
*/
|
|
2363
|
+
interface ListQueryOptions {
|
|
2364
|
+
expansion?: string | string[];
|
|
2365
|
+
filterBy?: string | Record<string, string>;
|
|
2366
|
+
includeType?: string | string[];
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* Read-only catalog of workflow apps and their actions/triggers. Custom UIs
|
|
2371
|
+
* use it to resolve `executionPath` step `appId`/`actionId` pairs to
|
|
2372
|
+
* human-readable names and icons, and to read the declarative
|
|
2373
|
+
* `ActionUIDefinition` metadata for rendering rich action outputs.
|
|
2374
|
+
*/
|
|
2375
|
+
declare class WorkflowAppsResource {
|
|
2376
|
+
private readonly http;
|
|
2377
|
+
constructor(http: HttpClient);
|
|
2378
|
+
/** Lists all workflow apps installed on the deployment. */
|
|
2379
|
+
list(): Promise<WorkflowApp[]>;
|
|
2380
|
+
/**
|
|
2381
|
+
* Creates a connection for an app where the connection type is
|
|
2382
|
+
* non-interactive (API key, basic auth). OAuth connections require the
|
|
2383
|
+
* browser flow inside the bundled UI and cannot be created here.
|
|
2384
|
+
*/
|
|
2385
|
+
connect(appId: string, connectionId: string, value: Record<string, unknown>): Promise<unknown>;
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
interface WaitUntilFinishedOptions {
|
|
2389
|
+
/** Give up after this long. Default: 10 minutes. */
|
|
2390
|
+
timeoutMs?: number;
|
|
2391
|
+
/** First delay between polls. Default: 500ms. */
|
|
2392
|
+
initialDelayMs?: number;
|
|
2393
|
+
/** Cap on the delay between polls. Default: 5s. */
|
|
2394
|
+
maxDelayMs?: number;
|
|
2395
|
+
/** Multiplier applied to the delay after each poll. Default: 1.5. */
|
|
2396
|
+
backoffFactor?: number;
|
|
2397
|
+
/**
|
|
2398
|
+
* Also stop waiting when the execution pauses in `NEEDS_INPUT` (so a form
|
|
2399
|
+
* can be shown). Default: true.
|
|
2400
|
+
*/
|
|
2401
|
+
stopOnNeedsInput?: boolean;
|
|
2402
|
+
/** Extra expansion fields to request with each poll (always includes `status,statusMessage,output`). */
|
|
2403
|
+
expansion?: string[];
|
|
2404
|
+
signal?: AbortSignal;
|
|
2405
|
+
/** Injectable sleep, for tests. */
|
|
2406
|
+
sleep?: (ms: number) => Promise<void>;
|
|
2407
|
+
}
|
|
2408
|
+
/** One step in a timeline-ready progress snapshot. */
|
|
2409
|
+
interface ExecutionProgressStep extends ExecutionPathStep {
|
|
2410
|
+
/** App logo URL from the workflow-apps catalogue, when resolvable. */
|
|
2411
|
+
appLogoUrl?: string | null;
|
|
2412
|
+
/** Action/trigger icon URL from the catalogue, when resolvable. */
|
|
2413
|
+
iconUrl?: string | null;
|
|
2414
|
+
/** Duration in ms when both startTime and endTime are present. */
|
|
2415
|
+
durationMs?: number | null;
|
|
2416
|
+
}
|
|
2417
|
+
/** Timeline-ready progress for a custom UI (status bar / step list). */
|
|
2418
|
+
interface ExecutionProgress {
|
|
2419
|
+
executionId: string;
|
|
2420
|
+
status?: ExecutionStatus | string;
|
|
2421
|
+
statusMessage?: string | null;
|
|
2422
|
+
name?: string | null;
|
|
2423
|
+
source?: string | null;
|
|
2424
|
+
startedAt?: string;
|
|
2425
|
+
stoppedAt?: string | null;
|
|
2426
|
+
steps: ExecutionProgressStep[];
|
|
2427
|
+
pendingInput?: unknown;
|
|
2428
|
+
output?: unknown;
|
|
2429
|
+
/** Index of the first non-terminal step, or -1 when all done / unknown. */
|
|
2430
|
+
activeStepIndex: number;
|
|
2431
|
+
}
|
|
2432
|
+
declare class ExecutionsResource {
|
|
2433
|
+
#private;
|
|
2434
|
+
private readonly http;
|
|
2435
|
+
private readonly workflowApps?;
|
|
2436
|
+
private catalogCache;
|
|
2437
|
+
constructor(http: HttpClient, workflowApps?: WorkflowAppsResource | undefined);
|
|
2438
|
+
/**
|
|
2439
|
+
* Starts a new execution of a workflow. Only the execution ID is returned;
|
|
2440
|
+
* use {@link waitUntilFinished} or `get` to track progress.
|
|
2441
|
+
*/
|
|
2442
|
+
execute(workflowId: string, inputData?: Record<string, unknown>): Promise<ExecuteWorkflowResult>;
|
|
2443
|
+
/** Lists executions in the current workspace, most recently started first. */
|
|
2444
|
+
list(options?: ListQueryOptions): Promise<Execution[]>;
|
|
2445
|
+
/**
|
|
2446
|
+
* Returns a single execution. Request `expansion: ['status', 'executionPath']`
|
|
2447
|
+
* for the business-readable step list custom UIs render progress from.
|
|
2448
|
+
*/
|
|
2449
|
+
get(executionId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Execution>;
|
|
2450
|
+
/**
|
|
2451
|
+
* Timeline-ready progress: `executionPath` plus catalogue icons/logos.
|
|
2452
|
+
* Use this for a custom status bar / step list (not raw nodes/edges).
|
|
2453
|
+
*/
|
|
2454
|
+
getProgress(executionId: string): Promise<ExecutionProgress>;
|
|
2455
|
+
/**
|
|
2456
|
+
* Opens the Public API SSE stream (`GET /executions/:id/stream`).
|
|
2457
|
+
* Yields `execution.progress`, `loop.progress`, `execution.finished`, etc.
|
|
2458
|
+
* For a simple timeline, prefer {@link watchProgress}.
|
|
2459
|
+
*/
|
|
2460
|
+
stream(executionId: string, options?: WatchProgressOptions): Promise<ExecutionProgressStream>;
|
|
2461
|
+
/**
|
|
2462
|
+
* Live progress snapshots for a custom timeline UI.
|
|
2463
|
+
* Subscribes to SSE `execution.progress` events (and enriches steps with icons).
|
|
2464
|
+
* Completes when the execution reaches a terminal status or the signal aborts.
|
|
2465
|
+
*/
|
|
2466
|
+
watchProgress(executionId: string, options?: WatchProgressOptions): AsyncGenerator<ExecutionProgress, void, undefined>;
|
|
2467
|
+
/**
|
|
2468
|
+
* Polls an execution with exponential backoff until it reaches a terminal
|
|
2469
|
+
* status (`SUCCESS`, `FAILED`, `CANCELLED`) — or pauses in `NEEDS_INPUT`
|
|
2470
|
+
* (unless `stopOnNeedsInput: false`). Resolves with the final execution
|
|
2471
|
+
* including `status`, `statusMessage`, and `output`.
|
|
2472
|
+
*/
|
|
2473
|
+
waitUntilFinished(executionId: string, options?: WaitUntilFinishedOptions): Promise<Execution>;
|
|
2474
|
+
/**
|
|
2475
|
+
* Resumes an execution paused in `NEEDS_INPUT` by submitting values for the
|
|
2476
|
+
* waiting node. Identify the waiting node and its field schema via
|
|
2477
|
+
* `expansion: ['pendingInput', 'executionPath']` (prefer `pendingInput` for
|
|
2478
|
+
* the form contract; `executionPath` steps with status `NEEDS_INPUT` also
|
|
2479
|
+
* carry the `nodeId`). Required fields from the schema must be present.
|
|
2480
|
+
* The server acknowledges immediately and resumes asynchronously — follow
|
|
2481
|
+
* up with {@link waitUntilFinished}.
|
|
2482
|
+
*/
|
|
2483
|
+
submitInput(executionId: string, nodeId: string, values: Record<string, unknown>): Promise<void>;
|
|
2484
|
+
/**
|
|
2485
|
+
* Submit an approve/reject decision for a Request Approval node.
|
|
2486
|
+
* Uses the authenticated Approvals API (not the public input webhook).
|
|
2487
|
+
* Partial approvals keep the execution paused; terminal decisions resume it.
|
|
2488
|
+
*/
|
|
2489
|
+
submitApproval(executionId: string, nodeId: string, body: {
|
|
2490
|
+
decision: 'approved' | 'rejected';
|
|
2491
|
+
comment?: string;
|
|
2492
|
+
}): Promise<{
|
|
2493
|
+
executionId: string;
|
|
2494
|
+
nodeId: string;
|
|
2495
|
+
approvalId?: string;
|
|
2496
|
+
terminal: boolean;
|
|
2497
|
+
canDecide: boolean;
|
|
2498
|
+
approval: Record<string, unknown>;
|
|
2499
|
+
}>;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
interface RunActionOptions {
|
|
2503
|
+
/** Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
|
|
2504
|
+
appId: string;
|
|
2505
|
+
/** Action id within the app, e.g. `http_action_send-request`. */
|
|
2506
|
+
actionId: string;
|
|
2507
|
+
/**
|
|
2508
|
+
* Connection instance UUID (`Connection.id`). Required when the action needs
|
|
2509
|
+
* a connection and the workspace has more than one for the app. When omitted
|
|
2510
|
+
* and exactly one connection exists, the platform uses that connection.
|
|
2511
|
+
*/
|
|
2512
|
+
connectionId?: string;
|
|
2513
|
+
/**
|
|
2514
|
+
* Project UUID for variable/project scoping. Required when the workspace has
|
|
2515
|
+
* more than one project.
|
|
2516
|
+
*/
|
|
2517
|
+
projectId?: string;
|
|
2518
|
+
/** Action input fields (keys from the action `inputConfig`). */
|
|
2519
|
+
input?: Record<string, unknown>;
|
|
2520
|
+
/** Optional display name for the ad-hoc Execution. */
|
|
2521
|
+
name?: string;
|
|
2522
|
+
}
|
|
2523
|
+
declare class ActionsResource {
|
|
2524
|
+
private readonly http;
|
|
2525
|
+
private readonly executions;
|
|
2526
|
+
constructor(http: HttpClient, executions: ExecutionsResource);
|
|
2527
|
+
/**
|
|
2528
|
+
* Run a single catalogue action as a one-step ad-hoc Execution (`source: SDK`).
|
|
2529
|
+
*
|
|
2530
|
+
* The platform runs the action synchronously and returns the execution id
|
|
2531
|
+
* plus status/output/executionPath. You can also poll
|
|
2532
|
+
* {@link ExecutionsResource.get} / {@link ExecutionsResource.waitUntilFinished}
|
|
2533
|
+
* with the returned id.
|
|
2534
|
+
*
|
|
2535
|
+
* Discover `appId` / `actionId` / `inputConfig` via `workflowApps.list()`.
|
|
2536
|
+
*/
|
|
2537
|
+
run(options: RunActionOptions): Promise<RunActionResult>;
|
|
2538
|
+
/**
|
|
2539
|
+
* Convenience: run the action and wait until the Execution reaches a
|
|
2540
|
+
* terminal status (or pauses in `NEEDS_INPUT`). Prefer {@link run} when the
|
|
2541
|
+
* synchronous response is enough.
|
|
2542
|
+
*/
|
|
2543
|
+
runAndWait(options: RunActionOptions, waitOptions?: WaitUntilFinishedOptions): Promise<Execution>;
|
|
2544
|
+
/**
|
|
2545
|
+
* Thin discovery helper: find one action definition from `workflowApps.list()`.
|
|
2546
|
+
* Prefer calling `workflowApps.list()` once and caching when looking up many
|
|
2547
|
+
* actions.
|
|
2548
|
+
*/
|
|
2549
|
+
get(appId: string, actionId: string): Promise<Record<string, unknown> | undefined>;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
/**
|
|
2553
|
+
* Pure typed definition factories for local workflow/agent authoring.
|
|
2554
|
+
* These do not call the network. Deploy with the CLI; run ad-hoc with `runs.start`.
|
|
2555
|
+
*
|
|
2556
|
+
* Not the same as `@lunnoa/toolkit` `createAction` / `createApp` (in-platform apps).
|
|
2557
|
+
*/
|
|
2558
|
+
declare const DEFINE_KINDS: {
|
|
2559
|
+
readonly connection: "connection";
|
|
2560
|
+
readonly aiConnection: "aiConnection";
|
|
2561
|
+
readonly action: "action";
|
|
2562
|
+
readonly workflow: "workflow";
|
|
2563
|
+
readonly agent: "agent";
|
|
2564
|
+
};
|
|
2565
|
+
/** Ref to an existing app Connection (credentials stay on Lunnoa). */
|
|
2566
|
+
interface ConnectionDefinition {
|
|
2567
|
+
kind: typeof DEFINE_KINDS.connection;
|
|
2568
|
+
/** Connection instance UUID. Optional when the platform can resolve sole/default. */
|
|
2569
|
+
id?: string;
|
|
2570
|
+
}
|
|
2571
|
+
/** Ref to an existing AiProviderConnection. */
|
|
2572
|
+
interface AiConnectionDefinition {
|
|
2573
|
+
kind: typeof DEFINE_KINDS.aiConnection;
|
|
2574
|
+
/** AiProviderConnection UUID. Optional when platform AI defaults apply. */
|
|
2575
|
+
id?: string;
|
|
2576
|
+
}
|
|
2577
|
+
interface ActionDefinition {
|
|
2578
|
+
kind: typeof DEFINE_KINDS.action;
|
|
2579
|
+
/**
|
|
2580
|
+
* Catalogue action id, e.g. `http_action_send-request`.
|
|
2581
|
+
* Optionally `appId.actionId` (first segment before `.` used as appId when
|
|
2582
|
+
* `appId` is omitted and the id contains a dot that is not part of the
|
|
2583
|
+
* usual `_action_` pattern).
|
|
2584
|
+
*/
|
|
2585
|
+
id: string;
|
|
2586
|
+
/** Workflow app id. Inferred from `id` when it matches `{app}_action_…`. */
|
|
2587
|
+
appId?: string;
|
|
2588
|
+
/** Optional Connection ref. Omit to let the platform resolve. */
|
|
2589
|
+
connection?: ConnectionDefinition;
|
|
2590
|
+
/** Default input merged at run/deploy time. */
|
|
2591
|
+
input?: Record<string, unknown>;
|
|
2592
|
+
name?: string;
|
|
2593
|
+
description?: string;
|
|
2594
|
+
}
|
|
2595
|
+
interface WorkflowStepDefinition {
|
|
2596
|
+
/** Action definition (or inline action-shaped object). */
|
|
2597
|
+
use: ActionDefinition;
|
|
2598
|
+
/** Per-step input overrides. */
|
|
2599
|
+
input?: Record<string, unknown>;
|
|
2600
|
+
name?: string;
|
|
2601
|
+
}
|
|
2602
|
+
interface WorkflowDefinition {
|
|
2603
|
+
kind: typeof DEFINE_KINDS.workflow;
|
|
2604
|
+
/** Stable project-scoped slug (upsert key). */
|
|
2605
|
+
slug: string;
|
|
2606
|
+
name?: string;
|
|
2607
|
+
description?: string;
|
|
2608
|
+
isActive?: boolean;
|
|
2609
|
+
/** Linear steps (v1; no branches). */
|
|
2610
|
+
steps: WorkflowStepDefinition[];
|
|
2611
|
+
}
|
|
2612
|
+
type AgentToolDefinition = ActionDefinition | WorkflowDefinition | {
|
|
2613
|
+
use: ActionDefinition | WorkflowDefinition;
|
|
2614
|
+
};
|
|
2615
|
+
interface AgentDefinition {
|
|
2616
|
+
kind: typeof DEFINE_KINDS.agent;
|
|
2617
|
+
/** Stable project-scoped slug (upsert key). */
|
|
2618
|
+
slug: string;
|
|
2619
|
+
name?: string;
|
|
2620
|
+
description?: string;
|
|
2621
|
+
/** Selected model id on the AI provider connection. */
|
|
2622
|
+
model: string;
|
|
2623
|
+
instructions: string;
|
|
2624
|
+
aiConnection?: AiConnectionDefinition;
|
|
2625
|
+
/** App Connection refs the agent may use for tools. */
|
|
2626
|
+
connections?: ConnectionDefinition[];
|
|
2627
|
+
/** Action and/or workflow tool refs. */
|
|
2628
|
+
tools?: AgentToolDefinition[];
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
interface UpsertAgentToolInput {
|
|
2632
|
+
appId: string;
|
|
2633
|
+
actionId: string;
|
|
2634
|
+
connectionId?: string;
|
|
2635
|
+
name?: string;
|
|
2636
|
+
description?: string;
|
|
2637
|
+
input?: Record<string, unknown>;
|
|
2638
|
+
}
|
|
2639
|
+
interface UpsertAgentBySlugInput {
|
|
2640
|
+
slug: string;
|
|
2641
|
+
name?: string;
|
|
2642
|
+
description?: string;
|
|
2643
|
+
instructions: string;
|
|
2644
|
+
model: string;
|
|
2645
|
+
aiConnectionId?: string;
|
|
2646
|
+
connectionIds?: string[];
|
|
2647
|
+
workflowIds?: string[];
|
|
2648
|
+
tools?: UpsertAgentToolInput[];
|
|
2649
|
+
managedByCode?: boolean;
|
|
2650
|
+
}
|
|
2651
|
+
declare class AgentsResource {
|
|
2652
|
+
private readonly http;
|
|
2653
|
+
constructor(http: HttpClient);
|
|
2654
|
+
/** Lists agents visible to the caller in the current workspace. */
|
|
2655
|
+
list(options?: ListQueryOptions): Promise<Agent[]>;
|
|
2656
|
+
/** Returns a single agent. */
|
|
2657
|
+
get(agentId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Agent>;
|
|
2658
|
+
/**
|
|
2659
|
+
* Upsert an agent by project-scoped slug.
|
|
2660
|
+
* Prefer the CLI (`npx @lunnoa/client agents deploy`) for happy-path deploy.
|
|
2661
|
+
*/
|
|
2662
|
+
upsertBySlug(projectId: string, body: UpsertAgentBySlugInput | AgentDefinition, options?: {
|
|
2663
|
+
workflowIds?: string[];
|
|
2664
|
+
}): Promise<Agent>;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
/**
|
|
2668
|
+
* Tokens returned by login / 2FA / login-with-token.
|
|
2669
|
+
* Mapped from the wire format (`access_token` / `refresh_token`).
|
|
2670
|
+
*/
|
|
2671
|
+
interface AuthTokens {
|
|
2672
|
+
accessToken: string;
|
|
2673
|
+
refreshToken: string;
|
|
2674
|
+
}
|
|
2675
|
+
/** Successful password login without 2FA, or after 2FA / token exchange. */
|
|
2676
|
+
type LoginSuccess = AuthTokens;
|
|
2677
|
+
/**
|
|
2678
|
+
* Password login when the user has 2FA enabled.
|
|
2679
|
+
* Call {@link AuthResource.verify2faLogin} with the session token and TOTP/backup code.
|
|
2680
|
+
*/
|
|
2681
|
+
interface LoginRequires2FA {
|
|
2682
|
+
requires2FA: true;
|
|
2683
|
+
sessionToken: string;
|
|
2684
|
+
}
|
|
2685
|
+
type LoginResult = LoginSuccess | LoginRequires2FA;
|
|
2686
|
+
/** Public SSO discovery from `GET /api/auth/sso/providers`. */
|
|
2687
|
+
interface SsoProvidersResponse {
|
|
2688
|
+
providers: SsoProviderSummary[];
|
|
2689
|
+
passwordAuthDisabled: boolean;
|
|
2690
|
+
googleAuthDisabled: boolean;
|
|
2691
|
+
ssoEnforced: boolean;
|
|
2692
|
+
}
|
|
2693
|
+
interface SsoProviderSummary {
|
|
2694
|
+
id: string;
|
|
2695
|
+
name: string;
|
|
2696
|
+
buttonLabel: string | null;
|
|
2697
|
+
}
|
|
2698
|
+
/**
|
|
2699
|
+
* Current user from `GET /api/users/me`.
|
|
2700
|
+
* Password is never returned.
|
|
2701
|
+
*/
|
|
2702
|
+
interface CurrentUser {
|
|
2703
|
+
id: string;
|
|
2704
|
+
email: string;
|
|
2705
|
+
name: string | null;
|
|
2706
|
+
createdAt?: string;
|
|
2707
|
+
updatedAt?: string;
|
|
2708
|
+
rootProfileImageUrl?: string | null;
|
|
2709
|
+
emailVerifiedAt?: string | null;
|
|
2710
|
+
toursCompleted?: unknown;
|
|
2711
|
+
hasPassword?: boolean;
|
|
2712
|
+
ssoProviders?: string[];
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
/**
|
|
2716
|
+
* Login, refresh, SSO discovery, and session helpers for Pattern B.
|
|
2717
|
+
*
|
|
2718
|
+
* Password login, token exchange, refresh, and SSO provider listing are
|
|
2719
|
+
* **public** endpoints (no Bearer). `me()` requires a user JWT.
|
|
2720
|
+
*
|
|
2721
|
+
* There is no server logout endpoint: {@link AuthResource.logout} only clears
|
|
2722
|
+
* the configured {@link TokenStore}.
|
|
2723
|
+
*/
|
|
2724
|
+
declare class AuthResource {
|
|
2725
|
+
private readonly http;
|
|
2726
|
+
private readonly tokenStore?;
|
|
2727
|
+
readonly sso: SsoAuthResource;
|
|
2728
|
+
constructor(http: HttpClient, tokenStore?: TokenStore | undefined);
|
|
2729
|
+
/**
|
|
2730
|
+
* `POST /api/auth/login`
|
|
2731
|
+
*
|
|
2732
|
+
* On success without 2FA, tokens are written to the token store (when set).
|
|
2733
|
+
* When 2FA is required, returns `{ requires2FA, sessionToken }` and does not
|
|
2734
|
+
* store tokens until {@link verify2faLogin} succeeds.
|
|
2735
|
+
*/
|
|
2736
|
+
login(input: {
|
|
2737
|
+
email: string;
|
|
2738
|
+
password: string;
|
|
2739
|
+
}): Promise<LoginResult>;
|
|
2740
|
+
/**
|
|
2741
|
+
* `POST /api/auth/2fa/verify-login`
|
|
2742
|
+
*
|
|
2743
|
+
* Completes password login after TOTP or backup-code verification.
|
|
2744
|
+
*/
|
|
2745
|
+
verify2faLogin(input: {
|
|
2746
|
+
sessionToken: string;
|
|
2747
|
+
token: string;
|
|
2748
|
+
}): Promise<AuthTokens>;
|
|
2749
|
+
/**
|
|
2750
|
+
* `POST /api/auth/login-with-token`
|
|
2751
|
+
*
|
|
2752
|
+
* Exchanges a short-lived hidden JWT (SSO callback or email verification)
|
|
2753
|
+
* for access and refresh tokens.
|
|
2754
|
+
*/
|
|
2755
|
+
loginWithToken(input: {
|
|
2756
|
+
token: string;
|
|
2757
|
+
}): Promise<AuthTokens>;
|
|
2758
|
+
/**
|
|
2759
|
+
* `POST /api/auth/refresh-token`
|
|
2760
|
+
*
|
|
2761
|
+
* Returns a new access token. The refresh token itself is not rotated.
|
|
2762
|
+
* When a token store is configured and `refreshToken` is omitted, the
|
|
2763
|
+
* stored refresh token is used.
|
|
2764
|
+
*/
|
|
2765
|
+
refresh(input?: {
|
|
2766
|
+
refreshToken?: string;
|
|
2767
|
+
}): Promise<{
|
|
2768
|
+
accessToken: string;
|
|
2769
|
+
}>;
|
|
2770
|
+
/**
|
|
2771
|
+
* `GET /api/users/me` — current user profile for the active JWT.
|
|
2772
|
+
*/
|
|
2773
|
+
me(): Promise<CurrentUser>;
|
|
2774
|
+
/**
|
|
2775
|
+
* Clears tokens from the token store.
|
|
2776
|
+
* There is no server-side logout endpoint; access tokens remain valid until expiry
|
|
2777
|
+
* (or until the user's `tokensValidFrom` watermark invalidates them).
|
|
2778
|
+
*/
|
|
2779
|
+
logout(): Promise<void>;
|
|
2780
|
+
/** True when the token store has an access token (sync stores only wait on Promise). */
|
|
2781
|
+
hasSession(): Promise<boolean>;
|
|
2782
|
+
private persistTokens;
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* SSO discovery and login URL helpers.
|
|
2786
|
+
*
|
|
2787
|
+
* Browser SSO callbacks redirect to the deployment's `CLIENT_URL/verify-token`,
|
|
2788
|
+
* not to an arbitrary custom origin. Custom portals typically complete the
|
|
2789
|
+
* exchange with {@link AuthResource.loginWithToken} after receiving the hidden
|
|
2790
|
+
* token (for example via a BFF that can see the verify-token page, or by
|
|
2791
|
+
* setting `CLIENT_URL` to the custom app).
|
|
2792
|
+
*/
|
|
2793
|
+
declare class SsoAuthResource {
|
|
2794
|
+
private readonly http;
|
|
2795
|
+
constructor(http: HttpClient);
|
|
2796
|
+
/** `GET /api/auth/sso/providers` (public). */
|
|
2797
|
+
listProviders(): Promise<SsoProvidersResponse>;
|
|
2798
|
+
/**
|
|
2799
|
+
* Absolute URL for `GET /api/auth/sso/:providerId/login`.
|
|
2800
|
+
* Navigate the browser here to start the OIDC redirect.
|
|
2801
|
+
*/
|
|
2802
|
+
getLoginUrl(providerId: string): string;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
declare class ConnectionsResource {
|
|
2806
|
+
private readonly http;
|
|
2807
|
+
constructor(http: HttpClient);
|
|
2808
|
+
/** Lists connections in the workspace. */
|
|
2809
|
+
list(options?: ListQueryOptions): Promise<Connection[]>;
|
|
2810
|
+
/** Returns a single connection (secrets are never included). */
|
|
2811
|
+
get(connectionId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Connection>;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
declare class DiscoveryResource {
|
|
2815
|
+
private readonly http;
|
|
2816
|
+
constructor(http: HttpClient);
|
|
2817
|
+
/**
|
|
2818
|
+
* Returns the deployment's feature flags (storage, vector database, email,
|
|
2819
|
+
* SSO, edition gating), letting a custom UI adapt to what is enabled.
|
|
2820
|
+
*/
|
|
2821
|
+
enabledFeatures(): Promise<EnabledFeatures>;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
interface ListEntitiesOptions {
|
|
2825
|
+
/** Filter by entity type ID. */
|
|
2826
|
+
objectTypeId?: string;
|
|
2827
|
+
/** Filter by entity type slug (alternative to objectTypeId). */
|
|
2828
|
+
objectTypeSlug?: string;
|
|
2829
|
+
/** Filter by a single state. */
|
|
2830
|
+
state?: string;
|
|
2831
|
+
/** Filter by several states (comma-separated server-side). */
|
|
2832
|
+
states?: string[];
|
|
2833
|
+
/** Filter by owner workspace-user ID. */
|
|
2834
|
+
ownerId?: string;
|
|
2835
|
+
/** Free-text search over entity names. */
|
|
2836
|
+
search?: string;
|
|
2837
|
+
sortBy?: string;
|
|
2838
|
+
sortOrder?: 'asc' | 'desc';
|
|
2839
|
+
/** 1-based page number. */
|
|
2840
|
+
page?: number;
|
|
2841
|
+
/** Items per page (max 100). */
|
|
2842
|
+
pageSize?: number;
|
|
2843
|
+
/** Fields to expand, e.g. `['attributes', 'objectType']`. */
|
|
2844
|
+
expansion?: string | string[];
|
|
2845
|
+
}
|
|
2846
|
+
interface ImportEntitiesInput {
|
|
2847
|
+
entityTypeId: string;
|
|
2848
|
+
columnMappings: Array<{
|
|
2849
|
+
sourceColumn: string;
|
|
2850
|
+
targetFieldId: string;
|
|
2851
|
+
transform?: 'none' | 'date' | 'number' | 'boolean';
|
|
2852
|
+
}>;
|
|
2853
|
+
rows: Array<Record<string, string>>;
|
|
2854
|
+
updateExisting?: boolean;
|
|
2855
|
+
matchField?: string;
|
|
2856
|
+
}
|
|
2857
|
+
interface ExportEntitiesInput {
|
|
2858
|
+
entityTypeId: string;
|
|
2859
|
+
fieldIds: string[];
|
|
2860
|
+
filters?: Array<{
|
|
2861
|
+
fieldId: string;
|
|
2862
|
+
operator: string;
|
|
2863
|
+
value: unknown;
|
|
2864
|
+
}>;
|
|
2865
|
+
format?: 'csv' | 'xlsx';
|
|
2866
|
+
includeRelatedEntityNames?: boolean;
|
|
2867
|
+
}
|
|
2868
|
+
/**
|
|
2869
|
+
* Entities (the platform calls them Objects internally): the structured data
|
|
2870
|
+
* layer custom UIs query heavily. Attribute values are keyed by field ID as
|
|
2871
|
+
* defined on the entity type's `attributeSchema` — run
|
|
2872
|
+
* `npx @lunnoa/client codegen` against your deployment for fully typed,
|
|
2873
|
+
* per-entity-type accessors.
|
|
2874
|
+
*/
|
|
2875
|
+
declare class EntitiesResource {
|
|
2876
|
+
private readonly http;
|
|
2877
|
+
constructor(http: HttpClient);
|
|
2878
|
+
/** Returns one page of entities matching the filter. */
|
|
2879
|
+
list(options?: ListEntitiesOptions): Promise<PaginatedEntities>;
|
|
2880
|
+
/**
|
|
2881
|
+
* Async-iterates every entity matching the filter, fetching pages lazily.
|
|
2882
|
+
*
|
|
2883
|
+
* ```ts
|
|
2884
|
+
* for await (const invoice of client.entities.iterate({ objectTypeSlug: 'invoice' })) { ... }
|
|
2885
|
+
* ```
|
|
2886
|
+
*/
|
|
2887
|
+
iterate(options?: Omit<ListEntitiesOptions, 'page'>): AsyncGenerator<Entity, void, undefined>;
|
|
2888
|
+
/** Returns a single entity. Request `expansion: ['attributes']` for field values. */
|
|
2889
|
+
get(entityId: string, options?: {
|
|
2890
|
+
expansion?: string | string[];
|
|
2891
|
+
}): Promise<Entity>;
|
|
2892
|
+
/** Creates an entity. `attributes` are keyed by field ID. */
|
|
2893
|
+
create(data: CreateEntityInput, options?: {
|
|
2894
|
+
expansion?: string | string[];
|
|
2895
|
+
}): Promise<Entity>;
|
|
2896
|
+
/** Partially updates an entity; supplied attributes are merged. */
|
|
2897
|
+
update(entityId: string, data: UpdateEntityInput, options?: {
|
|
2898
|
+
expansion?: string | string[];
|
|
2899
|
+
}): Promise<Entity>;
|
|
2900
|
+
/** Soft-deletes an entity. */
|
|
2901
|
+
delete(entityId: string): Promise<boolean>;
|
|
2902
|
+
/** Moves an entity to a new state (validated against the type's state machine). */
|
|
2903
|
+
changeState(entityId: string, data: ChangeEntityStateInput): Promise<ChangeEntityStateResult>;
|
|
2904
|
+
/** Returns the entity's state changes, newest first. */
|
|
2905
|
+
getStateHistory(entityId: string, options?: {
|
|
2906
|
+
limit?: number;
|
|
2907
|
+
}): Promise<EntityStateHistoryEntry[]>;
|
|
2908
|
+
/** Returns the current state and the transitions allowed from it. */
|
|
2909
|
+
getStateTransitions(entityId: string): Promise<EntityStateTransitions>;
|
|
2910
|
+
/** Imports pre-parsed rows into an entity type (SuperAdmin only). */
|
|
2911
|
+
import(data: ImportEntitiesInput): Promise<ImportEntitiesResult>;
|
|
2912
|
+
/** Exports entities of a type as flat JSON rows. */
|
|
2913
|
+
export(data: ExportEntitiesInput): Promise<Array<Record<string, unknown>>>;
|
|
2914
|
+
/** Returns the column headers and a sample row for importing (SuperAdmin only). */
|
|
2915
|
+
getImportTemplate(entityTypeId: string): Promise<ImportTemplate>;
|
|
2916
|
+
private serializeListOptions;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
interface EntityTypeReadOptions {
|
|
2920
|
+
/** Fields to expand, e.g. `['attributeSchema', 'stateSchema', 'description']`. */
|
|
2921
|
+
expansion?: string | string[];
|
|
2922
|
+
}
|
|
2923
|
+
declare class EntityTypesResource {
|
|
2924
|
+
private readonly http;
|
|
2925
|
+
constructor(http: HttpClient);
|
|
2926
|
+
/**
|
|
2927
|
+
* Lists entity types in the workspace. Request
|
|
2928
|
+
* `expansion: ['attributeSchema', 'stateSchema']` for the field and state
|
|
2929
|
+
* machine definitions the codegen CLI builds types from.
|
|
2930
|
+
*/
|
|
2931
|
+
list(options?: EntityTypeReadOptions & {
|
|
2932
|
+
includeDisabled?: boolean;
|
|
2933
|
+
}): Promise<EntityType[]>;
|
|
2934
|
+
/** Returns a single entity type by ID. */
|
|
2935
|
+
get(id: string, options?: EntityTypeReadOptions): Promise<EntityType>;
|
|
2936
|
+
/** Returns a single entity type by its URL-safe slug. */
|
|
2937
|
+
getBySlug(slug: string, options?: EntityTypeReadOptions): Promise<EntityType>;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
type EligibleApprover = {
|
|
2941
|
+
workspaceUserId: string;
|
|
2942
|
+
email: string;
|
|
2943
|
+
name?: string;
|
|
2944
|
+
};
|
|
2945
|
+
type ApprovalInboxItem = {
|
|
2946
|
+
approvalId: string;
|
|
2947
|
+
executionId: string;
|
|
2948
|
+
nodeId: string;
|
|
2949
|
+
title: string;
|
|
2950
|
+
status: string;
|
|
2951
|
+
requiredCount: number;
|
|
2952
|
+
receivedApprovals: number;
|
|
2953
|
+
currentStageIndex?: number;
|
|
2954
|
+
expiresAt?: string;
|
|
2955
|
+
createdAt?: string;
|
|
2956
|
+
updatedAt?: string;
|
|
2957
|
+
canDecide?: boolean;
|
|
2958
|
+
executionNumber?: number;
|
|
2959
|
+
workflow?: {
|
|
2960
|
+
id: string;
|
|
2961
|
+
name: string;
|
|
2962
|
+
};
|
|
2963
|
+
project?: {
|
|
2964
|
+
id: string;
|
|
2965
|
+
name: string;
|
|
2966
|
+
};
|
|
2967
|
+
myDecision?: {
|
|
2968
|
+
decision: string;
|
|
2969
|
+
comment?: string;
|
|
2970
|
+
decidedAt?: string;
|
|
2971
|
+
};
|
|
2972
|
+
/** People who can still decide (current stage; emails resolved). */
|
|
2973
|
+
eligibleApprovers?: EligibleApprover[];
|
|
2974
|
+
approval?: Record<string, unknown>;
|
|
2975
|
+
};
|
|
2976
|
+
/**
|
|
2977
|
+
* Authenticated Approvals inbox helpers (workspace API; not Public API v1).
|
|
2978
|
+
*/
|
|
2979
|
+
declare class ApprovalsResource {
|
|
2980
|
+
private readonly http;
|
|
2981
|
+
constructor(http: HttpClient);
|
|
2982
|
+
/**
|
|
2983
|
+
* @param options.status `pending` (default) for actionable items, or `done` for history.
|
|
2984
|
+
*/
|
|
2985
|
+
inbox(options?: {
|
|
2986
|
+
status?: 'pending' | 'done' | string;
|
|
2987
|
+
}): Promise<{
|
|
2988
|
+
items: ApprovalInboxItem[];
|
|
2989
|
+
}>;
|
|
2990
|
+
decide(approvalId: string, body: {
|
|
2991
|
+
decision: 'approved' | 'rejected';
|
|
2992
|
+
comment?: string;
|
|
2993
|
+
}): Promise<{
|
|
2994
|
+
executionId: string;
|
|
2995
|
+
nodeId: string;
|
|
2996
|
+
approvalId?: string;
|
|
2997
|
+
terminal: boolean;
|
|
2998
|
+
canDecide: boolean;
|
|
2999
|
+
approval: Record<string, unknown>;
|
|
3000
|
+
}>;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
declare class KnowledgeResource {
|
|
3004
|
+
private readonly http;
|
|
3005
|
+
constructor(http: HttpClient);
|
|
3006
|
+
/** Lists knowledge notebooks in the workspace. */
|
|
3007
|
+
list(options?: {
|
|
3008
|
+
expansion?: string | string[];
|
|
3009
|
+
}): Promise<Knowledge[]>;
|
|
3010
|
+
/** Returns a single knowledge notebook. */
|
|
3011
|
+
get(knowledgeId: string, options?: {
|
|
3012
|
+
expansion?: string | string[];
|
|
3013
|
+
}): Promise<Knowledge>;
|
|
3014
|
+
/** Creates a knowledge notebook. Subject to the deployment's storage/vector infrastructure. */
|
|
3015
|
+
create(data: CreateKnowledgeInput): Promise<Knowledge>;
|
|
3016
|
+
/** Updates a knowledge notebook. */
|
|
3017
|
+
update(knowledgeId: string, data: UpdateKnowledgeInput): Promise<Knowledge>;
|
|
3018
|
+
/** Deletes a knowledge notebook. */
|
|
3019
|
+
delete(knowledgeId: string): Promise<boolean>;
|
|
3020
|
+
/** Saves raw text into the notebook (chunked, embedded, and indexed server-side). */
|
|
3021
|
+
saveUploadedText(knowledgeId: string, data: SaveUploadedTextInput): Promise<unknown>;
|
|
3022
|
+
/** Lists the documents stored in a notebook. */
|
|
3023
|
+
listDocuments(knowledgeId: string): Promise<KnowledgeDocument[]>;
|
|
3024
|
+
/** Returns one document group (an uploaded document and its chunks). */
|
|
3025
|
+
getDocumentGroup(knowledgeId: string, groupId: string): Promise<KnowledgeDocumentGroup>;
|
|
3026
|
+
/** Deletes one document group from the notebook. */
|
|
3027
|
+
deleteDocumentGroup(knowledgeId: string, groupId: string): Promise<boolean>;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
declare class ProjectsResource {
|
|
3031
|
+
private readonly http;
|
|
3032
|
+
constructor(http: HttpClient);
|
|
3033
|
+
/** Lists projects in the workspace, most recently updated first. */
|
|
3034
|
+
list(options?: ListQueryOptions): Promise<Project[]>;
|
|
3035
|
+
/** Returns a single project. */
|
|
3036
|
+
get(projectId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Project>;
|
|
3037
|
+
/** Creates a project. */
|
|
3038
|
+
create(data: CreateProjectInput): Promise<Project>;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
interface ListQueueItemsOptions {
|
|
3042
|
+
limit?: number;
|
|
3043
|
+
offset?: number;
|
|
3044
|
+
expansion?: string | string[];
|
|
3045
|
+
filterBy?: string | Record<string, string>;
|
|
3046
|
+
}
|
|
3047
|
+
declare class QueueItemsResource {
|
|
3048
|
+
private readonly http;
|
|
3049
|
+
constructor(http: HttpClient);
|
|
3050
|
+
/** Returns one page of items in a queue (offset-based pagination). */
|
|
3051
|
+
list(queueId: string, options?: ListQueueItemsOptions): Promise<QueueItemList>;
|
|
3052
|
+
/** Async-iterates every item in a queue, fetching batches lazily. */
|
|
3053
|
+
iterate(queueId: string, options?: Omit<ListQueueItemsOptions, 'offset'>): AsyncGenerator<QueueItem, void, undefined>;
|
|
3054
|
+
/** Returns a single queue item. */
|
|
3055
|
+
get(queueId: string, itemId: string): Promise<QueueItemFull>;
|
|
3056
|
+
/** Adds an item to a queue. */
|
|
3057
|
+
create(queueId: string, data: CreateQueueItemInput): Promise<QueueItem>;
|
|
3058
|
+
/** Adds many items to a queue in one call. */
|
|
3059
|
+
bulkCreate(queueId: string, data: BulkCreateQueueItemsInput): Promise<BulkCreateQueueItemsResult>;
|
|
3060
|
+
/** Updates a queue item. */
|
|
3061
|
+
update(queueId: string, itemId: string, data: UpdateQueueItemInput): Promise<QueueItem>;
|
|
3062
|
+
/** Deletes a queue item. */
|
|
3063
|
+
delete(queueId: string, itemId: string): Promise<{
|
|
3064
|
+
success: boolean;
|
|
3065
|
+
}>;
|
|
3066
|
+
/** Returns items that are ready to be processed. */
|
|
3067
|
+
listReady(queueId: string, options?: {
|
|
3068
|
+
limit?: number;
|
|
3069
|
+
}): Promise<QueueItem[]>;
|
|
3070
|
+
/** Returns items eligible for retry. */
|
|
3071
|
+
listRetryable(queueId: string): Promise<QueueItem[]>;
|
|
3072
|
+
/** Returns items with the given status. */
|
|
3073
|
+
listByStatus(queueId: string, status: string): Promise<QueueItem[]>;
|
|
3074
|
+
/** Looks an item up by the external ID your system supplied. */
|
|
3075
|
+
getByExternalId(queueId: string, externalId: string): Promise<QueueItemFull>;
|
|
3076
|
+
/** Searches items in the queue. */
|
|
3077
|
+
search(queueId: string, query: string): Promise<QueueItem[]>;
|
|
3078
|
+
/** Returns per-status and per-priority counts for the queue. */
|
|
3079
|
+
stats(queueId: string): Promise<QueueItemStats>;
|
|
3080
|
+
/** Returns the recorded processing errors of an item. */
|
|
3081
|
+
listErrors(queueId: string, itemId: string): Promise<QueueItemErrorEntry[]>;
|
|
3082
|
+
/** Updates the processing status of an item. */
|
|
3083
|
+
updateStatus(queueId: string, itemId: string, status: string): Promise<QueueItem>;
|
|
3084
|
+
/** Links an item to the workflow execution that processed it. */
|
|
3085
|
+
linkExecution(queueId: string, itemId: string, executionId: string): Promise<QueueItem>;
|
|
3086
|
+
/** Queues the item for another processing attempt. */
|
|
3087
|
+
retry(queueId: string, itemId: string): Promise<QueueItem>;
|
|
3088
|
+
/** Records a processing error on the item. */
|
|
3089
|
+
addError(queueId: string, itemId: string, error: {
|
|
3090
|
+
message: string;
|
|
3091
|
+
[key: string]: unknown;
|
|
3092
|
+
}): Promise<QueueItem>;
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
declare class QueuesResource {
|
|
3096
|
+
private readonly http;
|
|
3097
|
+
constructor(http: HttpClient);
|
|
3098
|
+
/** Lists queues in the workspace, ordered by priority then creation date. */
|
|
3099
|
+
list(options?: ListQueryOptions): Promise<Queue[]>;
|
|
3100
|
+
/** Returns a single queue. */
|
|
3101
|
+
get(queueId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Queue>;
|
|
3102
|
+
/** Creates a queue. */
|
|
3103
|
+
create(data: CreateQueueInput): Promise<Queue>;
|
|
3104
|
+
/** Updates a queue. */
|
|
3105
|
+
update(queueId: string, data: UpdateQueueInput): Promise<Queue>;
|
|
3106
|
+
/** Deletes a queue. */
|
|
3107
|
+
delete(queueId: string): Promise<{
|
|
3108
|
+
success: boolean;
|
|
3109
|
+
}>;
|
|
3110
|
+
/** Returns aggregate statistics for a queue. */
|
|
3111
|
+
stats(queueId: string): Promise<QueueStats>;
|
|
3112
|
+
/** Activates a queue. */
|
|
3113
|
+
activate(queueId: string): Promise<Queue>;
|
|
3114
|
+
/** Deactivates a queue. */
|
|
3115
|
+
deactivate(queueId: string): Promise<Queue>;
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
interface StartRunStep {
|
|
3119
|
+
appId: string;
|
|
3120
|
+
actionId: string;
|
|
3121
|
+
connectionId?: string;
|
|
3122
|
+
input?: Record<string, unknown>;
|
|
3123
|
+
name?: string;
|
|
3124
|
+
}
|
|
3125
|
+
interface StartRunOptions {
|
|
3126
|
+
steps: StartRunStep[];
|
|
3127
|
+
projectId?: string;
|
|
3128
|
+
name?: string;
|
|
3129
|
+
}
|
|
3130
|
+
type StartRunInput = StartRunOptions | WorkflowDefinition | WorkflowStepDefinition[] | StartRunStep[];
|
|
3131
|
+
/**
|
|
3132
|
+
* Multi-step ad-hoc runs (`POST /api/runs`) → one Execution with `source: SDK`.
|
|
3133
|
+
*/
|
|
3134
|
+
declare class RunsResource {
|
|
3135
|
+
private readonly http;
|
|
3136
|
+
private readonly executions;
|
|
3137
|
+
constructor(http: HttpClient, executions: ExecutionsResource);
|
|
3138
|
+
/**
|
|
3139
|
+
* Start a linear multi-step ad-hoc Execution.
|
|
3140
|
+
*
|
|
3141
|
+
* Accepts a `defineWorkflow` result, a step array, or an explicit
|
|
3142
|
+
* `{ steps, projectId?, name? }` payload.
|
|
3143
|
+
*/
|
|
3144
|
+
start(input: StartRunInput): Promise<RunActionResult>;
|
|
3145
|
+
/** Convenience: start and wait until terminal / NEEDS_INPUT. */
|
|
3146
|
+
startAndWait(input: StartRunInput, waitOptions?: WaitUntilFinishedOptions): Promise<Execution>;
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
declare class TasksResource {
|
|
3150
|
+
private readonly http;
|
|
3151
|
+
constructor(http: HttpClient);
|
|
3152
|
+
/** Lists tasks (conversation threads) visible to the caller, most recently updated first. */
|
|
3153
|
+
list(options?: ListQueryOptions): Promise<TaskListItem[]>;
|
|
3154
|
+
/** Returns a single task. Request `expansion: ['messages']` for the conversation history. */
|
|
3155
|
+
get(taskId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Task>;
|
|
3156
|
+
/** Creates a task (conversation thread) for an agent. */
|
|
3157
|
+
create(agentId: string, data: CreateTaskInput, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Task>;
|
|
3158
|
+
/** Updates the task name or description. */
|
|
3159
|
+
update(taskId: string, data: UpdateTaskInput, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Task>;
|
|
3160
|
+
/** Permanently deletes a task and its messages. */
|
|
3161
|
+
delete(taskId: string): Promise<DeletedTask>;
|
|
3162
|
+
/**
|
|
3163
|
+
* Sends a message to an agent task and waits for the full agent turn to
|
|
3164
|
+
* finish (non-streaming). Returns either a plain string or the assistant
|
|
3165
|
+
* messages in AI SDK UIMessage format. For token-by-token output use
|
|
3166
|
+
* `client.agentChat.streamMessage` instead.
|
|
3167
|
+
*/
|
|
3168
|
+
message(agentId: string, taskId: string, message: string | UIMessage, options?: {
|
|
3169
|
+
chatMode?: ChatMode;
|
|
3170
|
+
}): Promise<string | UIMessage[]>;
|
|
3171
|
+
}
|
|
3172
|
+
|
|
3173
|
+
declare class VariablesResource {
|
|
3174
|
+
private readonly http;
|
|
3175
|
+
constructor(http: HttpClient);
|
|
3176
|
+
/** Lists variables in the workspace. */
|
|
3177
|
+
list(options?: ListQueryOptions): Promise<Variable[]>;
|
|
3178
|
+
/** Returns a single variable. */
|
|
3179
|
+
get(variableId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Variable>;
|
|
3180
|
+
/** Creates a variable. */
|
|
3181
|
+
create(data: CreateVariableInput): Promise<Variable>;
|
|
3182
|
+
/** Updates a variable. */
|
|
3183
|
+
update(variableId: string, data: UpdateVariableInput): Promise<Variable>;
|
|
3184
|
+
/** Deletes a variable. */
|
|
3185
|
+
delete(variableId: string): Promise<boolean>;
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
interface UpsertWorkflowStepInput {
|
|
3189
|
+
appId: string;
|
|
3190
|
+
actionId: string;
|
|
3191
|
+
connectionId?: string;
|
|
3192
|
+
input?: Record<string, unknown>;
|
|
3193
|
+
name?: string;
|
|
3194
|
+
description?: string;
|
|
3195
|
+
}
|
|
3196
|
+
interface UpsertWorkflowBySlugInput {
|
|
3197
|
+
slug: string;
|
|
3198
|
+
name?: string;
|
|
3199
|
+
description?: string;
|
|
3200
|
+
isActive?: boolean;
|
|
3201
|
+
steps: UpsertWorkflowStepInput[];
|
|
3202
|
+
managedByCode?: boolean;
|
|
3203
|
+
}
|
|
3204
|
+
declare class WorkflowsResource {
|
|
3205
|
+
private readonly http;
|
|
3206
|
+
private readonly executions;
|
|
3207
|
+
constructor(http: HttpClient, executions: ExecutionsResource);
|
|
3208
|
+
/** Lists workflows in the current workspace. */
|
|
3209
|
+
list(options?: ListQueryOptions): Promise<Workflow[]>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Returns a single workflow. Request `expansion: ['triggerNode']` to read
|
|
3212
|
+
* the manual trigger's custom input field definitions.
|
|
3213
|
+
*/
|
|
3214
|
+
get(workflowId: string, options?: Pick<ListQueryOptions, 'expansion'>): Promise<Workflow>;
|
|
3215
|
+
/**
|
|
3216
|
+
* Upsert a workflow by project-scoped slug from a linear step list.
|
|
3217
|
+
* Prefer the CLI (`npx @lunnoa/client workflows deploy`) for happy-path deploy.
|
|
3218
|
+
*/
|
|
3219
|
+
upsertBySlug(projectId: string, body: UpsertWorkflowBySlugInput | WorkflowDefinition): Promise<Workflow>;
|
|
3220
|
+
/**
|
|
3221
|
+
* Starts a new execution of the workflow with the given trigger inputs.
|
|
3222
|
+
* Returns immediately with the execution ID.
|
|
3223
|
+
*/
|
|
3224
|
+
execute(workflowId: string, inputs?: Record<string, unknown>): Promise<ExecuteWorkflowResult>;
|
|
3225
|
+
/**
|
|
3226
|
+
* Convenience: execute the workflow and wait (poll with backoff) until it
|
|
3227
|
+
* reaches a terminal status or pauses in `NEEDS_INPUT`.
|
|
3228
|
+
*/
|
|
3229
|
+
executeAndWait(workflowId: string, inputs?: Record<string, unknown>, waitOptions?: WaitUntilFinishedOptions): Promise<Execution>;
|
|
3230
|
+
/**
|
|
3231
|
+
* Triggers a workflow through its unauthenticated custom webhook endpoint
|
|
3232
|
+
* (`POST /api/webhooks/workflows/:workflowId`). Only works for workflows
|
|
3233
|
+
* with a webhook trigger. Returns the synchronous trigger output when the
|
|
3234
|
+
* workflow responds synchronously.
|
|
3235
|
+
*/
|
|
3236
|
+
triggerWebhook(workflowId: string, payload?: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
/**
|
|
3240
|
+
* Typed client for the Lunnoa Automate Public API.
|
|
3241
|
+
*
|
|
3242
|
+
* Server-side (Pattern A — the backend holds the key):
|
|
3243
|
+
* ```ts
|
|
3244
|
+
* const lunnoa = new LunnoaClient({
|
|
3245
|
+
* baseUrl: 'https://lunnoa.acme.example',
|
|
3246
|
+
* apiKey: process.env.LUNNOA_API_KEY, // lna_...
|
|
3247
|
+
* });
|
|
3248
|
+
* ```
|
|
3249
|
+
*
|
|
3250
|
+
* Browser (Pattern B — the end user is a Lunnoa user):
|
|
3251
|
+
* ```ts
|
|
3252
|
+
* import { createBrowserClient } from '@lunnoa/client';
|
|
3253
|
+
* const lunnoa = createBrowserClient({ baseUrl: 'https://lunnoa.acme.example' });
|
|
3254
|
+
* await lunnoa.auth.login({ email, password });
|
|
3255
|
+
* ```
|
|
3256
|
+
*
|
|
3257
|
+
* Passing an `lna_` API key in a browser throws immediately: API keys are
|
|
3258
|
+
* workspace-wide server credentials and must never ship to browsers.
|
|
3259
|
+
*/
|
|
3260
|
+
declare class LunnoaClient {
|
|
3261
|
+
/** The underlying HTTP layer, exposed for advanced/escape-hatch requests. */
|
|
3262
|
+
readonly http: HttpClient;
|
|
3263
|
+
/** Login, refresh, SSO discovery, and session helpers (Pattern B). */
|
|
3264
|
+
readonly auth: AuthResource;
|
|
3265
|
+
readonly agents: AgentsResource;
|
|
3266
|
+
readonly tasks: TasksResource;
|
|
3267
|
+
/** Hand-written SSE streaming client for agent chat (AI SDK UIMessage chunks). */
|
|
3268
|
+
readonly agentChat: AgentChatClient;
|
|
3269
|
+
readonly workflows: WorkflowsResource;
|
|
3270
|
+
readonly executions: ExecutionsResource;
|
|
3271
|
+
/** Run catalogue actions as one-step ad-hoc Executions (`source: SDK`). */
|
|
3272
|
+
readonly actions: ActionsResource;
|
|
3273
|
+
/**
|
|
3274
|
+
* Multi-step ad-hoc Executions (`source: SDK`) via `POST /api/runs`.
|
|
3275
|
+
* Prefer `defineWorkflow` + `runs.start` for local linear chains.
|
|
3276
|
+
*/
|
|
3277
|
+
readonly runs: RunsResource;
|
|
3278
|
+
/** Authenticated Approvals inbox (workspace API). */
|
|
3279
|
+
readonly approvals: ApprovalsResource;
|
|
3280
|
+
readonly entities: EntitiesResource;
|
|
3281
|
+
readonly entityTypes: EntityTypesResource;
|
|
3282
|
+
readonly knowledge: KnowledgeResource;
|
|
3283
|
+
readonly queues: QueuesResource;
|
|
3284
|
+
readonly queueItems: QueueItemsResource;
|
|
3285
|
+
readonly variables: VariablesResource;
|
|
3286
|
+
readonly connections: ConnectionsResource;
|
|
3287
|
+
readonly projects: ProjectsResource;
|
|
3288
|
+
readonly workflowApps: WorkflowAppsResource;
|
|
3289
|
+
readonly discovery: DiscoveryResource;
|
|
3290
|
+
constructor(options: LunnoaClientOptions);
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
interface CreateBrowserClientOptions {
|
|
3294
|
+
/** Base URL of the Lunnoa Automate deployment. */
|
|
3295
|
+
baseUrl: string;
|
|
3296
|
+
/**
|
|
3297
|
+
* JWT store. Defaults to `localStorage` keys `accessToken` / `refreshToken`
|
|
3298
|
+
* (same as the built-in Automate UI).
|
|
3299
|
+
*/
|
|
3300
|
+
tokenStore?: TokenStore;
|
|
3301
|
+
/**
|
|
3302
|
+
* Retry once after `POST /api/auth/refresh-token` on 401.
|
|
3303
|
+
* Defaults to true.
|
|
3304
|
+
*/
|
|
3305
|
+
autoRefresh?: boolean;
|
|
3306
|
+
fetch?: FetchLike;
|
|
3307
|
+
headers?: Record<string, string>;
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3310
|
+
type AuthStatus = 'loading' | 'authenticated' | 'unauthenticated';
|
|
3311
|
+
interface LunnoaAuthContextValue {
|
|
3312
|
+
/** Shared Lunnoa client (Pattern B token store). */
|
|
3313
|
+
client: LunnoaClient;
|
|
3314
|
+
/** Current user from `GET /api/users/me`, or null when signed out. */
|
|
3315
|
+
user: CurrentUser | null;
|
|
3316
|
+
/** Session bootstrap / mutation status. */
|
|
3317
|
+
status: AuthStatus;
|
|
3318
|
+
/** Last auth error message, if any. */
|
|
3319
|
+
error: string | null;
|
|
3320
|
+
/**
|
|
3321
|
+
* Password login. May return `{ requires2FA, sessionToken }` — then call
|
|
3322
|
+
* {@link verify2faLogin}. On success, refreshes `user`.
|
|
3323
|
+
*/
|
|
3324
|
+
login: (input: {
|
|
3325
|
+
email: string;
|
|
3326
|
+
password: string;
|
|
3327
|
+
}) => Promise<LoginResult>;
|
|
3328
|
+
/** Completes password login when 2FA is required. */
|
|
3329
|
+
verify2faLogin: (input: {
|
|
3330
|
+
sessionToken: string;
|
|
3331
|
+
token: string;
|
|
3332
|
+
}) => Promise<CurrentUser>;
|
|
3333
|
+
/**
|
|
3334
|
+
* Exchanges an SSO / email-verification hidden JWT (from verify-token URL).
|
|
3335
|
+
*/
|
|
3336
|
+
loginWithToken: (input: {
|
|
3337
|
+
token: string;
|
|
3338
|
+
}) => Promise<CurrentUser>;
|
|
3339
|
+
/**
|
|
3340
|
+
* Returns the OIDC start URL for a provider. Navigate the browser there
|
|
3341
|
+
* (e.g. `window.location.assign(url)`).
|
|
3342
|
+
*/
|
|
3343
|
+
getSsoLoginUrl: (providerId: string) => string;
|
|
3344
|
+
/** Lists public SSO providers for the login screen. */
|
|
3345
|
+
listSsoProviders: () => Promise<SsoProvidersResponse>;
|
|
3346
|
+
/** Clears the token store and local user state. */
|
|
3347
|
+
logout: () => Promise<void>;
|
|
3348
|
+
/** Re-fetches `auth.me()` when a session exists. */
|
|
3349
|
+
refreshUser: () => Promise<CurrentUser | null>;
|
|
3350
|
+
/** Current access token from the token store (for AI SDK headers, etc.). */
|
|
3351
|
+
getAccessToken: () => Promise<string | null>;
|
|
3352
|
+
}
|
|
3353
|
+
type LunnoaAuthProviderProps = {
|
|
3354
|
+
/** Existing Pattern B client (from `createBrowserClient`). */
|
|
3355
|
+
client: LunnoaClient;
|
|
3356
|
+
children: ReactNode;
|
|
3357
|
+
} | (CreateBrowserClientOptions & {
|
|
3358
|
+
client?: undefined;
|
|
3359
|
+
children: ReactNode;
|
|
3360
|
+
});
|
|
3361
|
+
/**
|
|
3362
|
+
* Provides a Pattern B Lunnoa client and session helpers to React trees.
|
|
3363
|
+
*
|
|
3364
|
+
* ```tsx
|
|
3365
|
+
* <LunnoaAuthProvider baseUrl={import.meta.env.VITE_LUNNOA_URL}>
|
|
3366
|
+
* <App />
|
|
3367
|
+
* </LunnoaAuthProvider>
|
|
3368
|
+
* ```
|
|
3369
|
+
*/
|
|
3370
|
+
declare function LunnoaAuthProvider(props: LunnoaAuthProviderProps): react.FunctionComponentElement<react.ProviderProps<LunnoaAuthContextValue | null>>;
|
|
3371
|
+
/** Full auth session API for Pattern B React apps. */
|
|
3372
|
+
declare function useLunnoaAuth(): LunnoaAuthContextValue;
|
|
3373
|
+
/** The Lunnoa client from the nearest {@link LunnoaAuthProvider}. */
|
|
3374
|
+
declare function useLunnoaClient(): LunnoaClient;
|
|
3375
|
+
/**
|
|
3376
|
+
* Current access token from the provider's token store.
|
|
3377
|
+
* Useful for AI SDK `useChat` / `DefaultChatTransport` Authorization headers.
|
|
3378
|
+
*/
|
|
3379
|
+
declare function useAccessToken(): {
|
|
3380
|
+
getAccessToken: () => Promise<string | null>;
|
|
3381
|
+
status: AuthStatus;
|
|
3382
|
+
};
|
|
3383
|
+
|
|
3384
|
+
type ExecutionProgressStatus = 'idle' | 'loading' | 'live' | 'error' | 'finished';
|
|
3385
|
+
interface UseExecutionProgressResult {
|
|
3386
|
+
/** Latest progress snapshot, or null before the first update. */
|
|
3387
|
+
progress: ExecutionProgress | null;
|
|
3388
|
+
status: ExecutionProgressStatus;
|
|
3389
|
+
error: Error | null;
|
|
3390
|
+
/** Fetches a one-shot snapshot via `executions.getProgress`. */
|
|
3391
|
+
refresh: () => Promise<ExecutionProgress | null>;
|
|
3392
|
+
}
|
|
3393
|
+
/**
|
|
3394
|
+
* Live execution timeline for a custom UI.
|
|
3395
|
+
*
|
|
3396
|
+
* When `executionId` is set, subscribes via `executions.watchProgress` and
|
|
3397
|
+
* keeps the latest snapshot. Aborts the stream on unmount or id change.
|
|
3398
|
+
*
|
|
3399
|
+
* ```tsx
|
|
3400
|
+
* const { progress, status, error, refresh } = useExecutionProgress(executionId);
|
|
3401
|
+
* ```
|
|
3402
|
+
*/
|
|
3403
|
+
declare function useExecutionProgress(executionId: string | null): UseExecutionProgressResult;
|
|
3404
|
+
|
|
3405
|
+
type NeedsInputSource = ExecutionProgress | Pick<Execution, 'id' | 'executionPath' | 'pendingInput' | 'status'> | null | undefined;
|
|
3406
|
+
interface UseNeedsInputOptions {
|
|
3407
|
+
/** Called after a successful `submitInput`. */
|
|
3408
|
+
onSubmitted?: () => void | Promise<void>;
|
|
3409
|
+
}
|
|
3410
|
+
interface UseNeedsInputResult {
|
|
3411
|
+
/** True when a step is currently waiting for input. */
|
|
3412
|
+
waiting: boolean;
|
|
3413
|
+
/** The `NEEDS_INPUT` step, when present. */
|
|
3414
|
+
waitingStep: ExecutionPathStep | ExecutionProgressStep | null;
|
|
3415
|
+
/**
|
|
3416
|
+
* Field schema for the waiting step (from `pendingInput` expansion), when
|
|
3417
|
+
* available.
|
|
3418
|
+
*/
|
|
3419
|
+
pendingInput: PendingInput | null;
|
|
3420
|
+
executionId: string | null;
|
|
3421
|
+
nodeId: string | null;
|
|
3422
|
+
/**
|
|
3423
|
+
* Submits values keyed by field id, then optionally runs `onSubmitted`.
|
|
3424
|
+
* Throws when nothing is waiting.
|
|
3425
|
+
*/
|
|
3426
|
+
submitInput: (values: Record<string, unknown>) => Promise<void>;
|
|
3427
|
+
}
|
|
3428
|
+
/**
|
|
3429
|
+
* Derives the waiting `NEEDS_INPUT` step from an execution or progress
|
|
3430
|
+
* snapshot and exposes `submitInput` for custom forms.
|
|
3431
|
+
*
|
|
3432
|
+
* ```tsx
|
|
3433
|
+
* const { waiting, pendingInput, submitInput } = useNeedsInput(progress);
|
|
3434
|
+
* ```
|
|
3435
|
+
*/
|
|
3436
|
+
declare function useNeedsInput(source: NeedsInputSource, options?: UseNeedsInputOptions): UseNeedsInputResult;
|
|
3437
|
+
|
|
3438
|
+
interface UseAgentChatOptions {
|
|
3439
|
+
/** Agent chat mode forwarded in the request body. */
|
|
3440
|
+
chatMode?: 'builder' | 'preview';
|
|
3441
|
+
}
|
|
3442
|
+
interface UseAgentChatResult {
|
|
3443
|
+
/** Stable task id for this hook lifetime (generated if omitted). */
|
|
3444
|
+
taskId: string;
|
|
3445
|
+
messages: UIMessage[];
|
|
3446
|
+
/** AI SDK chat status (`ready` | `submitted` | `streaming` | `error`). */
|
|
3447
|
+
status: string;
|
|
3448
|
+
error: Error | undefined;
|
|
3449
|
+
/** Sends a plain-text user message. */
|
|
3450
|
+
send: (text: string) => Promise<void>;
|
|
3451
|
+
/**
|
|
3452
|
+
* Aborts the in-flight HTTP stream and asks the server to cancel the turn.
|
|
3453
|
+
*/
|
|
3454
|
+
stop: () => Promise<void>;
|
|
3455
|
+
}
|
|
3456
|
+
/**
|
|
3457
|
+
* Thin AI SDK wrapper for Lunnoa agent chat.
|
|
3458
|
+
*
|
|
3459
|
+
* Requires optional peer `@ai-sdk/react` (and the `ai` package already shipped
|
|
3460
|
+
* with `@lunnoa/client`). Points `DefaultChatTransport` at the Automate
|
|
3461
|
+
* stream-message endpoint with a Bearer token from the auth provider.
|
|
3462
|
+
*
|
|
3463
|
+
* ```tsx
|
|
3464
|
+
* const { messages, send, stop, status, taskId } = useAgentChat(agentId);
|
|
3465
|
+
* ```
|
|
3466
|
+
*/
|
|
3467
|
+
declare function useAgentChat(agentId: string, taskId?: string, options?: UseAgentChatOptions): UseAgentChatResult;
|
|
3468
|
+
|
|
3469
|
+
type ApprovalsInboxStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
3470
|
+
interface UseApprovalsInboxOptions {
|
|
3471
|
+
/** Inbox filter; defaults to `pending`. */
|
|
3472
|
+
status?: 'pending' | 'done' | string;
|
|
3473
|
+
/**
|
|
3474
|
+
* Poll interval in ms. Off by default (`0` / `undefined`).
|
|
3475
|
+
* A common value for live inboxes is `15_000`.
|
|
3476
|
+
*/
|
|
3477
|
+
pollIntervalMs?: number;
|
|
3478
|
+
}
|
|
3479
|
+
interface UseApprovalsInboxResult {
|
|
3480
|
+
items: ApprovalInboxItem[];
|
|
3481
|
+
status: ApprovalsInboxStatus;
|
|
3482
|
+
error: Error | null;
|
|
3483
|
+
refresh: () => Promise<ApprovalInboxItem[]>;
|
|
3484
|
+
decide: (approvalId: string, body: {
|
|
3485
|
+
decision: 'approved' | 'rejected';
|
|
3486
|
+
comment?: string;
|
|
3487
|
+
}) => Promise<void>;
|
|
3488
|
+
}
|
|
3489
|
+
/**
|
|
3490
|
+
* Approvals inbox for the current user (workspace API).
|
|
3491
|
+
*
|
|
3492
|
+
* ```tsx
|
|
3493
|
+
* const { items, decide, refresh } = useApprovalsInbox({ pollIntervalMs: 15_000 });
|
|
3494
|
+
* ```
|
|
3495
|
+
*/
|
|
3496
|
+
declare function useApprovalsInbox(options?: UseApprovalsInboxOptions): UseApprovalsInboxResult;
|
|
3497
|
+
|
|
3498
|
+
type EntityListStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
3499
|
+
type UseEntityListOptions = ListEntitiesOptions & {
|
|
3500
|
+
/**
|
|
3501
|
+
* When false, skips fetching until set true. Defaults to true.
|
|
3502
|
+
*/
|
|
3503
|
+
enabled?: boolean;
|
|
3504
|
+
};
|
|
3505
|
+
interface UseEntityListResult {
|
|
3506
|
+
data: Entity[];
|
|
3507
|
+
pagination: PaginatedEntities['pagination'] | null;
|
|
3508
|
+
page: number;
|
|
3509
|
+
setPage: (page: number) => void;
|
|
3510
|
+
status: EntityListStatus;
|
|
3511
|
+
error: Error | null;
|
|
3512
|
+
refresh: () => Promise<PaginatedEntities | null>;
|
|
3513
|
+
/** Merges into list filters and resets to page 1. */
|
|
3514
|
+
setSearch: (search: string | undefined) => void;
|
|
3515
|
+
/** Merges into list filters and resets to page 1. */
|
|
3516
|
+
setState: (state: string | undefined) => void;
|
|
3517
|
+
/** Current effective list options (including page). */
|
|
3518
|
+
options: ListEntitiesOptions;
|
|
3519
|
+
}
|
|
3520
|
+
/**
|
|
3521
|
+
* Paginated entity list for tables and pickers.
|
|
3522
|
+
*
|
|
3523
|
+
* ```tsx
|
|
3524
|
+
* const { data, page, setPage, setSearch, status } = useEntityList({
|
|
3525
|
+
* objectTypeSlug: 'invoice',
|
|
3526
|
+
* expansion: ['attributes'],
|
|
3527
|
+
* pageSize: 25,
|
|
3528
|
+
* });
|
|
3529
|
+
* ```
|
|
3530
|
+
*/
|
|
3531
|
+
declare function useEntityList(initialOptions: UseEntityListOptions): UseEntityListResult;
|
|
3532
|
+
|
|
3533
|
+
export { type ApprovalsInboxStatus, type AuthStatus, type EntityListStatus, type ExecutionProgressStatus, type LunnoaAuthContextValue, LunnoaAuthProvider, type LunnoaAuthProviderProps, type NeedsInputSource, type UseAgentChatOptions, type UseAgentChatResult, type UseApprovalsInboxOptions, type UseApprovalsInboxResult, type UseEntityListOptions, type UseEntityListResult, type UseExecutionProgressResult, type UseNeedsInputOptions, type UseNeedsInputResult, useAccessToken, useAgentChat, useApprovalsInbox, useEntityList, useExecutionProgress, useLunnoaAuth, useLunnoaClient, useNeedsInput };
|