orchestrator-client 5.7.4 → 5.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +313 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +162 -1
- package/dist/index.d.ts +162 -1
- package/dist/index.js +306 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -580,6 +580,7 @@ declare class OrchestratorAsync {
|
|
|
580
580
|
protected _insecure: boolean;
|
|
581
581
|
close(): Promise<void>;
|
|
582
582
|
protected _makeUrl(path: string): string;
|
|
583
|
+
protected _makeAbsoluteUrl(path: string): URL;
|
|
583
584
|
protected _resolveHeaders(): Promise<Record<string, string>>;
|
|
584
585
|
protected _request(method: string, path: string, opts?: {
|
|
585
586
|
jsonBody?: unknown;
|
|
@@ -1180,6 +1181,166 @@ declare class OrchestratorConfigError extends OrchestratorError {
|
|
|
1180
1181
|
constructor(message: string);
|
|
1181
1182
|
}
|
|
1182
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Flow abstraction — reusable orchestrator workflow patterns.
|
|
1186
|
+
*
|
|
1187
|
+
* Every {@link Flow} subclass describes a complete orchestrator workflow
|
|
1188
|
+
* from trigger to parsed result. The base class handles task creation,
|
|
1189
|
+
* listening for completion via Socket.IO events, conversation retrieval,
|
|
1190
|
+
* and result parsing; subclasses only need to define the workflow
|
|
1191
|
+
* parameters and implement {@link Flow.parseResult}.
|
|
1192
|
+
*
|
|
1193
|
+
* Usage:
|
|
1194
|
+
*
|
|
1195
|
+
* ```ts
|
|
1196
|
+
* class MyFlow extends Flow<MyResult> {
|
|
1197
|
+
* get goalPrompt() { return "Do the thing"; }
|
|
1198
|
+
* parseResult(finalMessage: string): MyResult { ... }
|
|
1199
|
+
* }
|
|
1200
|
+
*
|
|
1201
|
+
* const result = await new MyFlow().run({ client: orchestrator });
|
|
1202
|
+
* ```
|
|
1203
|
+
*
|
|
1204
|
+
* @module
|
|
1205
|
+
*/
|
|
1206
|
+
|
|
1207
|
+
/** Default timeout for Socket.IO-based completion waiting (10 minutes). */
|
|
1208
|
+
declare const DEFAULT_FLOW_TIMEOUT_MS = 600000;
|
|
1209
|
+
/**
|
|
1210
|
+
* Set the default {@link OrchestratorAsync} and optional
|
|
1211
|
+
* {@link RealtimeClient} for all flows in this process.
|
|
1212
|
+
*
|
|
1213
|
+
* Call once during application startup so that `flow.run()` can be
|
|
1214
|
+
* invoked without passing `client` explicitly.
|
|
1215
|
+
*/
|
|
1216
|
+
declare function setupDefaultClient(client: OrchestratorAsync, realtime?: RealtimeClient): void;
|
|
1217
|
+
/** Raised when a flow execution fails. */
|
|
1218
|
+
declare class FlowError extends Error {
|
|
1219
|
+
constructor(message: string);
|
|
1220
|
+
}
|
|
1221
|
+
/** Raised when a flow's task does not reach a terminal state in time. */
|
|
1222
|
+
declare class FlowTimeoutError extends FlowError {
|
|
1223
|
+
constructor(message: string);
|
|
1224
|
+
}
|
|
1225
|
+
/** Raised when a flow's orchestrator task was explicitly cancelled. */
|
|
1226
|
+
declare class FlowCancelledError extends FlowError {
|
|
1227
|
+
/** The orchestrator task ID that was cancelled. */
|
|
1228
|
+
taskId: string;
|
|
1229
|
+
constructor(taskId: string);
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Extract the first JSON object from an LLM message body.
|
|
1233
|
+
*
|
|
1234
|
+
* Strategy (in order of preference):
|
|
1235
|
+
* 0. The entire trimmed message is parsed directly via `JSON.parse`.
|
|
1236
|
+
* 1. A fenced code block explicitly tagged `json`.
|
|
1237
|
+
* 2. Any fenced code block that parses as valid JSON.
|
|
1238
|
+
* 3. The first `{…}` block that parses as valid JSON.
|
|
1239
|
+
*
|
|
1240
|
+
* @throws {FlowError} If nothing parses.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function extractJsonFromMessage(content: string): Record<string, unknown>;
|
|
1243
|
+
/** Optional parameters for {@link Flow.run}. */
|
|
1244
|
+
interface FlowRunParams {
|
|
1245
|
+
/** Orchestrator async client. Falls back to the module-level default. */
|
|
1246
|
+
client?: OrchestratorAsync;
|
|
1247
|
+
/**
|
|
1248
|
+
* Optional realtime client for Socket.IO-based completion waiting.
|
|
1249
|
+
* Falls back to the module-level default. When neither is available
|
|
1250
|
+
* the flow uses polling instead.
|
|
1251
|
+
*/
|
|
1252
|
+
realtime?: RealtimeClient;
|
|
1253
|
+
/**
|
|
1254
|
+
* Maximum milliseconds to wait for completion.
|
|
1255
|
+
* Defaults to {@link DEFAULT_FLOW_TIMEOUT_MS}.
|
|
1256
|
+
*/
|
|
1257
|
+
timeoutMs?: number;
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Abstract base class for an orchestrator workflow flow.
|
|
1261
|
+
*
|
|
1262
|
+
* @typeParam T - The typed result produced by {@link parseResult}.
|
|
1263
|
+
*/
|
|
1264
|
+
declare abstract class Flow<T> {
|
|
1265
|
+
/** Orchestrator workflow type — `"proactive"` by default. */
|
|
1266
|
+
workflowId: string;
|
|
1267
|
+
/** Maximum agent turns before the orchestrator forces a failure. */
|
|
1268
|
+
maxIterations: number;
|
|
1269
|
+
/** LLM reasoning budget: `"low"`, `"medium"`, or `"high"`. */
|
|
1270
|
+
reasoningEffort: string;
|
|
1271
|
+
/**
|
|
1272
|
+
* Maximum milliseconds to wait for the orchestrator task to reach a
|
|
1273
|
+
* terminal state. When exceeded, {@link FlowTimeoutError} is raised.
|
|
1274
|
+
*/
|
|
1275
|
+
flowTimeoutMs: number;
|
|
1276
|
+
/**
|
|
1277
|
+
* The task description the orchestrator agent receives.
|
|
1278
|
+
* This is the primary instruction — it tells the agent *what* to do.
|
|
1279
|
+
*/
|
|
1280
|
+
abstract get goalPrompt(): string;
|
|
1281
|
+
/**
|
|
1282
|
+
* Optional system-prompt override.
|
|
1283
|
+
* When set, this replaces the orchestrator's default system prompt.
|
|
1284
|
+
*/
|
|
1285
|
+
get systemPrompt(): string | undefined;
|
|
1286
|
+
/**
|
|
1287
|
+
* Optional developer-prompt override appended after system prompt.
|
|
1288
|
+
*/
|
|
1289
|
+
get developerPrompt(): string | undefined;
|
|
1290
|
+
/**
|
|
1291
|
+
* Restrict which MCP / built-in tools the agent may use.
|
|
1292
|
+
* `undefined` means *all* tools are available. An empty array means
|
|
1293
|
+
* *no* tools — text-only reasoning.
|
|
1294
|
+
*/
|
|
1295
|
+
get availableTools(): string[] | undefined;
|
|
1296
|
+
/**
|
|
1297
|
+
* Per-task feature toggles sent in the creation request.
|
|
1298
|
+
* By default summaries and translation are disabled since flow
|
|
1299
|
+
* output is typically machine-consumed, not human-read.
|
|
1300
|
+
* Override in subclasses that produce human-facing content.
|
|
1301
|
+
*/
|
|
1302
|
+
get taskOptions(): TaskOptions;
|
|
1303
|
+
/**
|
|
1304
|
+
* Override the agent model for this flow.
|
|
1305
|
+
*/
|
|
1306
|
+
get agentModelId(): string | undefined;
|
|
1307
|
+
/**
|
|
1308
|
+
* Override the orchestrator (validation) model for this flow.
|
|
1309
|
+
*/
|
|
1310
|
+
get orchestratorModelId(): string | undefined;
|
|
1311
|
+
/**
|
|
1312
|
+
* Parse the agent's final message into a typed result.
|
|
1313
|
+
*
|
|
1314
|
+
* Called *after* the task reaches `"completed"` and the final
|
|
1315
|
+
* assistant message has been retrieved.
|
|
1316
|
+
*
|
|
1317
|
+
* @param finalMessage - The text content of the last assistant message.
|
|
1318
|
+
* @throws {FlowError} If the message cannot be parsed as expected.
|
|
1319
|
+
*/
|
|
1320
|
+
abstract parseResult(finalMessage: string): T;
|
|
1321
|
+
private _lastTaskId?;
|
|
1322
|
+
/**
|
|
1323
|
+
* Cancel the underlying orchestrator task, if one is running.
|
|
1324
|
+
*
|
|
1325
|
+
* Calling `cancel()` after `run()` has returned is a no-op.
|
|
1326
|
+
* The `run()` promise will reject with {@link FlowCancelledError}
|
|
1327
|
+
* after the orchestrator task transitions to `"cancelled"`.
|
|
1328
|
+
*/
|
|
1329
|
+
cancel(client?: OrchestratorAsync): Promise<void>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Execute the flow end-to-end.
|
|
1332
|
+
*
|
|
1333
|
+
* @returns The parsed result.
|
|
1334
|
+
* @throws {FlowError} If the task fails, times out, or cannot be parsed.
|
|
1335
|
+
*/
|
|
1336
|
+
run(params?: FlowRunParams): Promise<T>;
|
|
1337
|
+
private _waitForTerminal;
|
|
1338
|
+
private _waitViaSocketIO;
|
|
1339
|
+
private _waitViaPolling;
|
|
1340
|
+
private _getFinalMessage;
|
|
1341
|
+
private _sleep;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1183
1344
|
/**
|
|
1184
1345
|
* Convert a snake_case string to camelCase.
|
|
1185
1346
|
* Only converts single-underscore sequences followed by a lowercase letter.
|
|
@@ -1216,4 +1377,4 @@ declare function deepCamelCase<T>(obj: T): T;
|
|
|
1216
1377
|
*/
|
|
1217
1378
|
declare const VERSION = "5.6.0";
|
|
1218
1379
|
|
|
1219
|
-
export { type ArchivedContent, type AttachmentMeta, type AttachmentUploadResponse, type AuthConfig, type CompactionEvent, type ComponentHealth, type ConfigurationStatus, type ConversationResult, EVENT_ERROR_EVENT_RECORDED, EVENT_MESSAGE_ADDED, EVENT_MESSAGE_STREAMING, EVENT_MESSAGE_SUMMARY_GENERATED, EVENT_MESSAGE_TRANSLATION_READY, EVENT_TASK_CREATED, EVENT_TASK_DELETED, EVENT_TASK_INSIGHT_UPDATED, EVENT_TASK_ITERATION_CHANGED, EVENT_TASK_RESULT_UPDATED, EVENT_TASK_STATUS_CHANGED, type ErrorCountResult, type ErrorEvent, type ErrorEventDetail, type ErrorEventListResult, type ErrorPurgeResult, type ErrorStatsResult, type EventHandler, type HealthDetail, type HealthStatus, type LLMBackendInfo, type LLMBackendStatus, type LLMModelContextInfo, type LLMModelVisionInfo, type LeaderStatus, type LockStatus, type MCPServerInfo, type MCPServerStatus, type MatrixConversationResult, type Message, type MessageDeleteMultipleResult, type MessageTranslation, type MessageTranslationReadyEvent, type MessageTranslationsResult, type MetricSnapshot, type MioContext, type MioMemoriesResult, type MioMemoryItem, Orchestrator, OrchestratorAPIError, OrchestratorAsync, OrchestratorAuthError, type OrchestratorClientOptions, type OrchestratorConfig, OrchestratorConfigError, OrchestratorConnectionError, OrchestratorError, OrchestratorNotFoundError, type Pagination$1 as Pagination, type ReadinessCheck, type ReadinessResult, RealtimeClient, type RealtimeClientOptions, type ReloadServicesResult, type ReloadStatus, type SlotInfo, type SlotsStatus, type SubagentsStatus, type SuccessResponse, type SummaryWorkerStatus, type SystemStatus, type SystemStatusSettings, type TaskCancelResponse, type TaskCreateResponse, type TaskDeleteResult, type TaskDetail, type TaskHandlerCluster, type TaskHandlerReplica, type TaskHandlerStatus, type TaskHandlerStatusLocal, type TaskJournal, type TaskListResult, type TaskOptions, type TaskSummary, type TokenWorkerStatus, type ToolCall, type ToolInfo, type ToolsListResult, VERSION, type VSATaskCreateResponse, type WebSocketClientInfo, type WebSocketStatus, type WorkflowStates, camelToSnake, createInsecureFetch, deepCamelCase, loadConfig, snakeToCamel };
|
|
1380
|
+
export { type ArchivedContent, type AttachmentMeta, type AttachmentUploadResponse, type AuthConfig, type CompactionEvent, type ComponentHealth, type ConfigurationStatus, type ConversationResult, DEFAULT_FLOW_TIMEOUT_MS, EVENT_ERROR_EVENT_RECORDED, EVENT_MESSAGE_ADDED, EVENT_MESSAGE_STREAMING, EVENT_MESSAGE_SUMMARY_GENERATED, EVENT_MESSAGE_TRANSLATION_READY, EVENT_TASK_CREATED, EVENT_TASK_DELETED, EVENT_TASK_INSIGHT_UPDATED, EVENT_TASK_ITERATION_CHANGED, EVENT_TASK_RESULT_UPDATED, EVENT_TASK_STATUS_CHANGED, type ErrorCountResult, type ErrorEvent, type ErrorEventDetail, type ErrorEventListResult, type ErrorPurgeResult, type ErrorStatsResult, type EventHandler, Flow, FlowCancelledError, FlowError, type FlowRunParams, FlowTimeoutError, type HealthDetail, type HealthStatus, type LLMBackendInfo, type LLMBackendStatus, type LLMModelContextInfo, type LLMModelVisionInfo, type LeaderStatus, type LockStatus, type MCPServerInfo, type MCPServerStatus, type MatrixConversationResult, type Message, type MessageDeleteMultipleResult, type MessageTranslation, type MessageTranslationReadyEvent, type MessageTranslationsResult, type MetricSnapshot, type MioContext, type MioMemoriesResult, type MioMemoryItem, Orchestrator, OrchestratorAPIError, OrchestratorAsync, OrchestratorAuthError, type OrchestratorClientOptions, type OrchestratorConfig, OrchestratorConfigError, OrchestratorConnectionError, OrchestratorError, OrchestratorNotFoundError, type Pagination$1 as Pagination, type ReadinessCheck, type ReadinessResult, RealtimeClient, type RealtimeClientOptions, type ReloadServicesResult, type ReloadStatus, type SlotInfo, type SlotsStatus, type SubagentsStatus, type SuccessResponse, type SummaryWorkerStatus, type SystemStatus, type SystemStatusSettings, type TaskCancelResponse, type TaskCreateResponse, type TaskDeleteResult, type TaskDetail, type TaskHandlerCluster, type TaskHandlerReplica, type TaskHandlerStatus, type TaskHandlerStatusLocal, type TaskJournal, type TaskListResult, type TaskOptions, type TaskSummary, type TokenWorkerStatus, type ToolCall, type ToolInfo, type ToolsListResult, VERSION, type VSATaskCreateResponse, type WebSocketClientInfo, type WebSocketStatus, type WorkflowStates, camelToSnake, createInsecureFetch, deepCamelCase, extractJsonFromMessage, loadConfig, setupDefaultClient, snakeToCamel };
|
package/dist/index.d.ts
CHANGED
|
@@ -580,6 +580,7 @@ declare class OrchestratorAsync {
|
|
|
580
580
|
protected _insecure: boolean;
|
|
581
581
|
close(): Promise<void>;
|
|
582
582
|
protected _makeUrl(path: string): string;
|
|
583
|
+
protected _makeAbsoluteUrl(path: string): URL;
|
|
583
584
|
protected _resolveHeaders(): Promise<Record<string, string>>;
|
|
584
585
|
protected _request(method: string, path: string, opts?: {
|
|
585
586
|
jsonBody?: unknown;
|
|
@@ -1180,6 +1181,166 @@ declare class OrchestratorConfigError extends OrchestratorError {
|
|
|
1180
1181
|
constructor(message: string);
|
|
1181
1182
|
}
|
|
1182
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Flow abstraction — reusable orchestrator workflow patterns.
|
|
1186
|
+
*
|
|
1187
|
+
* Every {@link Flow} subclass describes a complete orchestrator workflow
|
|
1188
|
+
* from trigger to parsed result. The base class handles task creation,
|
|
1189
|
+
* listening for completion via Socket.IO events, conversation retrieval,
|
|
1190
|
+
* and result parsing; subclasses only need to define the workflow
|
|
1191
|
+
* parameters and implement {@link Flow.parseResult}.
|
|
1192
|
+
*
|
|
1193
|
+
* Usage:
|
|
1194
|
+
*
|
|
1195
|
+
* ```ts
|
|
1196
|
+
* class MyFlow extends Flow<MyResult> {
|
|
1197
|
+
* get goalPrompt() { return "Do the thing"; }
|
|
1198
|
+
* parseResult(finalMessage: string): MyResult { ... }
|
|
1199
|
+
* }
|
|
1200
|
+
*
|
|
1201
|
+
* const result = await new MyFlow().run({ client: orchestrator });
|
|
1202
|
+
* ```
|
|
1203
|
+
*
|
|
1204
|
+
* @module
|
|
1205
|
+
*/
|
|
1206
|
+
|
|
1207
|
+
/** Default timeout for Socket.IO-based completion waiting (10 minutes). */
|
|
1208
|
+
declare const DEFAULT_FLOW_TIMEOUT_MS = 600000;
|
|
1209
|
+
/**
|
|
1210
|
+
* Set the default {@link OrchestratorAsync} and optional
|
|
1211
|
+
* {@link RealtimeClient} for all flows in this process.
|
|
1212
|
+
*
|
|
1213
|
+
* Call once during application startup so that `flow.run()` can be
|
|
1214
|
+
* invoked without passing `client` explicitly.
|
|
1215
|
+
*/
|
|
1216
|
+
declare function setupDefaultClient(client: OrchestratorAsync, realtime?: RealtimeClient): void;
|
|
1217
|
+
/** Raised when a flow execution fails. */
|
|
1218
|
+
declare class FlowError extends Error {
|
|
1219
|
+
constructor(message: string);
|
|
1220
|
+
}
|
|
1221
|
+
/** Raised when a flow's task does not reach a terminal state in time. */
|
|
1222
|
+
declare class FlowTimeoutError extends FlowError {
|
|
1223
|
+
constructor(message: string);
|
|
1224
|
+
}
|
|
1225
|
+
/** Raised when a flow's orchestrator task was explicitly cancelled. */
|
|
1226
|
+
declare class FlowCancelledError extends FlowError {
|
|
1227
|
+
/** The orchestrator task ID that was cancelled. */
|
|
1228
|
+
taskId: string;
|
|
1229
|
+
constructor(taskId: string);
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Extract the first JSON object from an LLM message body.
|
|
1233
|
+
*
|
|
1234
|
+
* Strategy (in order of preference):
|
|
1235
|
+
* 0. The entire trimmed message is parsed directly via `JSON.parse`.
|
|
1236
|
+
* 1. A fenced code block explicitly tagged `json`.
|
|
1237
|
+
* 2. Any fenced code block that parses as valid JSON.
|
|
1238
|
+
* 3. The first `{…}` block that parses as valid JSON.
|
|
1239
|
+
*
|
|
1240
|
+
* @throws {FlowError} If nothing parses.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function extractJsonFromMessage(content: string): Record<string, unknown>;
|
|
1243
|
+
/** Optional parameters for {@link Flow.run}. */
|
|
1244
|
+
interface FlowRunParams {
|
|
1245
|
+
/** Orchestrator async client. Falls back to the module-level default. */
|
|
1246
|
+
client?: OrchestratorAsync;
|
|
1247
|
+
/**
|
|
1248
|
+
* Optional realtime client for Socket.IO-based completion waiting.
|
|
1249
|
+
* Falls back to the module-level default. When neither is available
|
|
1250
|
+
* the flow uses polling instead.
|
|
1251
|
+
*/
|
|
1252
|
+
realtime?: RealtimeClient;
|
|
1253
|
+
/**
|
|
1254
|
+
* Maximum milliseconds to wait for completion.
|
|
1255
|
+
* Defaults to {@link DEFAULT_FLOW_TIMEOUT_MS}.
|
|
1256
|
+
*/
|
|
1257
|
+
timeoutMs?: number;
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Abstract base class for an orchestrator workflow flow.
|
|
1261
|
+
*
|
|
1262
|
+
* @typeParam T - The typed result produced by {@link parseResult}.
|
|
1263
|
+
*/
|
|
1264
|
+
declare abstract class Flow<T> {
|
|
1265
|
+
/** Orchestrator workflow type — `"proactive"` by default. */
|
|
1266
|
+
workflowId: string;
|
|
1267
|
+
/** Maximum agent turns before the orchestrator forces a failure. */
|
|
1268
|
+
maxIterations: number;
|
|
1269
|
+
/** LLM reasoning budget: `"low"`, `"medium"`, or `"high"`. */
|
|
1270
|
+
reasoningEffort: string;
|
|
1271
|
+
/**
|
|
1272
|
+
* Maximum milliseconds to wait for the orchestrator task to reach a
|
|
1273
|
+
* terminal state. When exceeded, {@link FlowTimeoutError} is raised.
|
|
1274
|
+
*/
|
|
1275
|
+
flowTimeoutMs: number;
|
|
1276
|
+
/**
|
|
1277
|
+
* The task description the orchestrator agent receives.
|
|
1278
|
+
* This is the primary instruction — it tells the agent *what* to do.
|
|
1279
|
+
*/
|
|
1280
|
+
abstract get goalPrompt(): string;
|
|
1281
|
+
/**
|
|
1282
|
+
* Optional system-prompt override.
|
|
1283
|
+
* When set, this replaces the orchestrator's default system prompt.
|
|
1284
|
+
*/
|
|
1285
|
+
get systemPrompt(): string | undefined;
|
|
1286
|
+
/**
|
|
1287
|
+
* Optional developer-prompt override appended after system prompt.
|
|
1288
|
+
*/
|
|
1289
|
+
get developerPrompt(): string | undefined;
|
|
1290
|
+
/**
|
|
1291
|
+
* Restrict which MCP / built-in tools the agent may use.
|
|
1292
|
+
* `undefined` means *all* tools are available. An empty array means
|
|
1293
|
+
* *no* tools — text-only reasoning.
|
|
1294
|
+
*/
|
|
1295
|
+
get availableTools(): string[] | undefined;
|
|
1296
|
+
/**
|
|
1297
|
+
* Per-task feature toggles sent in the creation request.
|
|
1298
|
+
* By default summaries and translation are disabled since flow
|
|
1299
|
+
* output is typically machine-consumed, not human-read.
|
|
1300
|
+
* Override in subclasses that produce human-facing content.
|
|
1301
|
+
*/
|
|
1302
|
+
get taskOptions(): TaskOptions;
|
|
1303
|
+
/**
|
|
1304
|
+
* Override the agent model for this flow.
|
|
1305
|
+
*/
|
|
1306
|
+
get agentModelId(): string | undefined;
|
|
1307
|
+
/**
|
|
1308
|
+
* Override the orchestrator (validation) model for this flow.
|
|
1309
|
+
*/
|
|
1310
|
+
get orchestratorModelId(): string | undefined;
|
|
1311
|
+
/**
|
|
1312
|
+
* Parse the agent's final message into a typed result.
|
|
1313
|
+
*
|
|
1314
|
+
* Called *after* the task reaches `"completed"` and the final
|
|
1315
|
+
* assistant message has been retrieved.
|
|
1316
|
+
*
|
|
1317
|
+
* @param finalMessage - The text content of the last assistant message.
|
|
1318
|
+
* @throws {FlowError} If the message cannot be parsed as expected.
|
|
1319
|
+
*/
|
|
1320
|
+
abstract parseResult(finalMessage: string): T;
|
|
1321
|
+
private _lastTaskId?;
|
|
1322
|
+
/**
|
|
1323
|
+
* Cancel the underlying orchestrator task, if one is running.
|
|
1324
|
+
*
|
|
1325
|
+
* Calling `cancel()` after `run()` has returned is a no-op.
|
|
1326
|
+
* The `run()` promise will reject with {@link FlowCancelledError}
|
|
1327
|
+
* after the orchestrator task transitions to `"cancelled"`.
|
|
1328
|
+
*/
|
|
1329
|
+
cancel(client?: OrchestratorAsync): Promise<void>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Execute the flow end-to-end.
|
|
1332
|
+
*
|
|
1333
|
+
* @returns The parsed result.
|
|
1334
|
+
* @throws {FlowError} If the task fails, times out, or cannot be parsed.
|
|
1335
|
+
*/
|
|
1336
|
+
run(params?: FlowRunParams): Promise<T>;
|
|
1337
|
+
private _waitForTerminal;
|
|
1338
|
+
private _waitViaSocketIO;
|
|
1339
|
+
private _waitViaPolling;
|
|
1340
|
+
private _getFinalMessage;
|
|
1341
|
+
private _sleep;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1183
1344
|
/**
|
|
1184
1345
|
* Convert a snake_case string to camelCase.
|
|
1185
1346
|
* Only converts single-underscore sequences followed by a lowercase letter.
|
|
@@ -1216,4 +1377,4 @@ declare function deepCamelCase<T>(obj: T): T;
|
|
|
1216
1377
|
*/
|
|
1217
1378
|
declare const VERSION = "5.6.0";
|
|
1218
1379
|
|
|
1219
|
-
export { type ArchivedContent, type AttachmentMeta, type AttachmentUploadResponse, type AuthConfig, type CompactionEvent, type ComponentHealth, type ConfigurationStatus, type ConversationResult, EVENT_ERROR_EVENT_RECORDED, EVENT_MESSAGE_ADDED, EVENT_MESSAGE_STREAMING, EVENT_MESSAGE_SUMMARY_GENERATED, EVENT_MESSAGE_TRANSLATION_READY, EVENT_TASK_CREATED, EVENT_TASK_DELETED, EVENT_TASK_INSIGHT_UPDATED, EVENT_TASK_ITERATION_CHANGED, EVENT_TASK_RESULT_UPDATED, EVENT_TASK_STATUS_CHANGED, type ErrorCountResult, type ErrorEvent, type ErrorEventDetail, type ErrorEventListResult, type ErrorPurgeResult, type ErrorStatsResult, type EventHandler, type HealthDetail, type HealthStatus, type LLMBackendInfo, type LLMBackendStatus, type LLMModelContextInfo, type LLMModelVisionInfo, type LeaderStatus, type LockStatus, type MCPServerInfo, type MCPServerStatus, type MatrixConversationResult, type Message, type MessageDeleteMultipleResult, type MessageTranslation, type MessageTranslationReadyEvent, type MessageTranslationsResult, type MetricSnapshot, type MioContext, type MioMemoriesResult, type MioMemoryItem, Orchestrator, OrchestratorAPIError, OrchestratorAsync, OrchestratorAuthError, type OrchestratorClientOptions, type OrchestratorConfig, OrchestratorConfigError, OrchestratorConnectionError, OrchestratorError, OrchestratorNotFoundError, type Pagination$1 as Pagination, type ReadinessCheck, type ReadinessResult, RealtimeClient, type RealtimeClientOptions, type ReloadServicesResult, type ReloadStatus, type SlotInfo, type SlotsStatus, type SubagentsStatus, type SuccessResponse, type SummaryWorkerStatus, type SystemStatus, type SystemStatusSettings, type TaskCancelResponse, type TaskCreateResponse, type TaskDeleteResult, type TaskDetail, type TaskHandlerCluster, type TaskHandlerReplica, type TaskHandlerStatus, type TaskHandlerStatusLocal, type TaskJournal, type TaskListResult, type TaskOptions, type TaskSummary, type TokenWorkerStatus, type ToolCall, type ToolInfo, type ToolsListResult, VERSION, type VSATaskCreateResponse, type WebSocketClientInfo, type WebSocketStatus, type WorkflowStates, camelToSnake, createInsecureFetch, deepCamelCase, loadConfig, snakeToCamel };
|
|
1380
|
+
export { type ArchivedContent, type AttachmentMeta, type AttachmentUploadResponse, type AuthConfig, type CompactionEvent, type ComponentHealth, type ConfigurationStatus, type ConversationResult, DEFAULT_FLOW_TIMEOUT_MS, EVENT_ERROR_EVENT_RECORDED, EVENT_MESSAGE_ADDED, EVENT_MESSAGE_STREAMING, EVENT_MESSAGE_SUMMARY_GENERATED, EVENT_MESSAGE_TRANSLATION_READY, EVENT_TASK_CREATED, EVENT_TASK_DELETED, EVENT_TASK_INSIGHT_UPDATED, EVENT_TASK_ITERATION_CHANGED, EVENT_TASK_RESULT_UPDATED, EVENT_TASK_STATUS_CHANGED, type ErrorCountResult, type ErrorEvent, type ErrorEventDetail, type ErrorEventListResult, type ErrorPurgeResult, type ErrorStatsResult, type EventHandler, Flow, FlowCancelledError, FlowError, type FlowRunParams, FlowTimeoutError, type HealthDetail, type HealthStatus, type LLMBackendInfo, type LLMBackendStatus, type LLMModelContextInfo, type LLMModelVisionInfo, type LeaderStatus, type LockStatus, type MCPServerInfo, type MCPServerStatus, type MatrixConversationResult, type Message, type MessageDeleteMultipleResult, type MessageTranslation, type MessageTranslationReadyEvent, type MessageTranslationsResult, type MetricSnapshot, type MioContext, type MioMemoriesResult, type MioMemoryItem, Orchestrator, OrchestratorAPIError, OrchestratorAsync, OrchestratorAuthError, type OrchestratorClientOptions, type OrchestratorConfig, OrchestratorConfigError, OrchestratorConnectionError, OrchestratorError, OrchestratorNotFoundError, type Pagination$1 as Pagination, type ReadinessCheck, type ReadinessResult, RealtimeClient, type RealtimeClientOptions, type ReloadServicesResult, type ReloadStatus, type SlotInfo, type SlotsStatus, type SubagentsStatus, type SuccessResponse, type SummaryWorkerStatus, type SystemStatus, type SystemStatusSettings, type TaskCancelResponse, type TaskCreateResponse, type TaskDeleteResult, type TaskDetail, type TaskHandlerCluster, type TaskHandlerReplica, type TaskHandlerStatus, type TaskHandlerStatusLocal, type TaskJournal, type TaskListResult, type TaskOptions, type TaskSummary, type TokenWorkerStatus, type ToolCall, type ToolInfo, type ToolsListResult, VERSION, type VSATaskCreateResponse, type WebSocketClientInfo, type WebSocketStatus, type WorkflowStates, camelToSnake, createInsecureFetch, deepCamelCase, extractJsonFromMessage, loadConfig, setupDefaultClient, snakeToCamel };
|