@uipath/uipath-typescript 1.5.0 → 1.5.1
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/README.md +7 -1
- package/dist/assets/index.cjs +107 -6
- package/dist/assets/index.d.ts +12 -1
- package/dist/assets/index.mjs +107 -6
- package/dist/attachments/index.cjs +95 -3
- package/dist/attachments/index.mjs +95 -3
- package/dist/buckets/index.cjs +111 -6
- package/dist/buckets/index.d.ts +12 -1
- package/dist/buckets/index.mjs +111 -6
- package/dist/cases/index.cjs +434 -266
- package/dist/cases/index.d.ts +140 -3
- package/dist/cases/index.mjs +434 -266
- package/dist/conversational-agent/index.cjs +23 -1
- package/dist/conversational-agent/index.d.ts +117 -6
- package/dist/conversational-agent/index.mjs +23 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +423 -0
- package/dist/entities/index.d.ts +441 -1
- package/dist/entities/index.mjs +422 -1
- package/dist/index.cjs +974 -293
- package/dist/index.d.ts +1150 -43
- package/dist/index.mjs +975 -294
- package/dist/index.umd.js +974 -293
- package/dist/jobs/index.cjs +12 -5
- package/dist/jobs/index.d.ts +12 -1
- package/dist/jobs/index.mjs +12 -5
- package/dist/maestro-processes/index.cjs +344 -243
- package/dist/maestro-processes/index.d.ts +189 -5
- package/dist/maestro-processes/index.mjs +344 -243
- package/dist/notifications/index.cjs +2012 -0
- package/dist/notifications/index.d.ts +615 -0
- package/dist/notifications/index.mjs +2010 -0
- package/dist/processes/index.cjs +93 -9
- package/dist/processes/index.d.ts +12 -1
- package/dist/processes/index.mjs +93 -9
- package/dist/queues/index.cjs +106 -5
- package/dist/queues/index.d.ts +12 -1
- package/dist/queues/index.mjs +106 -5
- package/dist/tasks/index.cjs +100 -4
- package/dist/tasks/index.mjs +100 -4
- package/dist/traces/index.cjs +218 -4
- package/dist/traces/index.d.ts +357 -22
- package/dist/traces/index.mjs +219 -5
- package/package.json +14 -4
|
@@ -2837,6 +2837,7 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
2837
2837
|
this.startEventMaybe = startEventMaybe;
|
|
2838
2838
|
this._endHandlers = new Array();
|
|
2839
2839
|
this._confirmHandlers = new Array();
|
|
2840
|
+
this._executingHandlers = new Array();
|
|
2840
2841
|
this.addStartEventTimestamp(startEventMaybe);
|
|
2841
2842
|
}
|
|
2842
2843
|
/**
|
|
@@ -2921,6 +2922,21 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
2921
2922
|
this.assertNotEnded();
|
|
2922
2923
|
this.emit({ confirmToolCall });
|
|
2923
2924
|
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Registers a handler for executingToolCall events.
|
|
2927
|
+
* Fired when the tool is about to be executed. For client-side tools,
|
|
2928
|
+
* the client should begin executing its handler upon receiving this.
|
|
2929
|
+
* @returns Cleanup function to remove the handler.
|
|
2930
|
+
* @internal
|
|
2931
|
+
*/
|
|
2932
|
+
onExecutingToolCall(cb) {
|
|
2933
|
+
this._executingHandlers.push(cb);
|
|
2934
|
+
return () => {
|
|
2935
|
+
const index = this._executingHandlers.indexOf(cb);
|
|
2936
|
+
if (index >= 0)
|
|
2937
|
+
this._executingHandlers.splice(index, 1);
|
|
2938
|
+
};
|
|
2939
|
+
}
|
|
2924
2940
|
/**
|
|
2925
2941
|
* Sends an error start event for this tool call.
|
|
2926
2942
|
*/
|
|
@@ -3000,6 +3016,10 @@ class ToolCallEventHelperImpl extends ToolCallEventHelper {
|
|
|
3000
3016
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3001
3017
|
this._confirmHandlers.forEach(cb => cb(toolCallEvent.confirmToolCall));
|
|
3002
3018
|
}
|
|
3019
|
+
if (toolCallEvent.executingToolCall) {
|
|
3020
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3021
|
+
this._executingHandlers.forEach(cb => cb(toolCallEvent.executingToolCall));
|
|
3022
|
+
}
|
|
3003
3023
|
if (toolCallEvent.endToolCall) {
|
|
3004
3024
|
this.setEnded();
|
|
3005
3025
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3596,7 +3616,9 @@ class ExchangeEventHelper extends ConversationEventHelperBase {
|
|
|
3596
3616
|
this.emit({ metaEvent });
|
|
3597
3617
|
}
|
|
3598
3618
|
/**
|
|
3599
|
-
* Ends the exchange
|
|
3619
|
+
* Ends the exchange. Stops further events for that exchange from being received.
|
|
3620
|
+
* Can be called from either the client side (to stop an in-progress response) or
|
|
3621
|
+
* the server/agent side (to signal natural completion).
|
|
3600
3622
|
* @throws Error if exchange has already ended.
|
|
3601
3623
|
*/
|
|
3602
3624
|
sendExchangeEnd(endExchange = {}) {
|
|
@@ -887,6 +887,16 @@ interface SessionEndingEvent {
|
|
|
887
887
|
*/
|
|
888
888
|
timeToLiveMS: number;
|
|
889
889
|
}
|
|
890
|
+
/**
|
|
891
|
+
* A client-side tool that the client supports, declared during exchange start
|
|
892
|
+
* so the server knows which tools to route client-side.
|
|
893
|
+
* @internal
|
|
894
|
+
*/
|
|
895
|
+
interface ClientSideTool {
|
|
896
|
+
name: string;
|
|
897
|
+
inputSchema?: JSONValue;
|
|
898
|
+
outputSchema?: JSONValue;
|
|
899
|
+
}
|
|
890
900
|
/**
|
|
891
901
|
* Signals the start of an exchange of messages within a conversation.
|
|
892
902
|
*/
|
|
@@ -903,6 +913,12 @@ interface ExchangeStartEvent {
|
|
|
903
913
|
* The time the exchange started.
|
|
904
914
|
*/
|
|
905
915
|
timestamp?: string;
|
|
916
|
+
/**
|
|
917
|
+
* Optional list of client-side tools the client supports. The server validates these against the agent's
|
|
918
|
+
* design-time definitions and forwards them to the runtime so it knows which tools to route client-side.
|
|
919
|
+
* @internal
|
|
920
|
+
*/
|
|
921
|
+
clientSideTools?: ClientSideTool[];
|
|
906
922
|
}
|
|
907
923
|
/**
|
|
908
924
|
* Signals the end of an exchange of messages within a conversation.
|
|
@@ -1156,6 +1172,16 @@ interface ToolCallStartEvent {
|
|
|
1156
1172
|
* `requireConfirmation` is true so the client can render an editable form.
|
|
1157
1173
|
*/
|
|
1158
1174
|
inputSchema?: JSONValue;
|
|
1175
|
+
/**
|
|
1176
|
+
* Output schema — used by the client to render the result form for client-side tools.
|
|
1177
|
+
* @internal
|
|
1178
|
+
*/
|
|
1179
|
+
outputSchema?: JSONValue;
|
|
1180
|
+
/**
|
|
1181
|
+
* Indicates this tool call should be executed client-side rather than server-side.
|
|
1182
|
+
* @internal
|
|
1183
|
+
*/
|
|
1184
|
+
isClientSideTool?: boolean;
|
|
1159
1185
|
}
|
|
1160
1186
|
/**
|
|
1161
1187
|
* Sent by the client to approve or reject a tool call that was emitted with
|
|
@@ -1198,6 +1224,20 @@ interface ToolCallEndEvent {
|
|
|
1198
1224
|
*/
|
|
1199
1225
|
metaData?: MetaData;
|
|
1200
1226
|
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Signals to the client that the tool is about to be executed. Emitted in all scenarios
|
|
1229
|
+
* (server-side and client-side tools). For client-side tools, the client should begin
|
|
1230
|
+
* executing its registered handler upon receiving this event.
|
|
1231
|
+
* @internal
|
|
1232
|
+
*/
|
|
1233
|
+
interface ExecutingToolCallEvent {
|
|
1234
|
+
/**
|
|
1235
|
+
* The time the tool call began executing.
|
|
1236
|
+
*/
|
|
1237
|
+
timestamp?: string;
|
|
1238
|
+
/** The final tool input, reflecting any modifications made during tool-call confirmation. */
|
|
1239
|
+
input?: ToolCallInputValue;
|
|
1240
|
+
}
|
|
1201
1241
|
/**
|
|
1202
1242
|
* Allows additional events to be sent in the context of the enclosing event stream.
|
|
1203
1243
|
*/
|
|
@@ -1238,6 +1278,12 @@ interface ToolCallEvent {
|
|
|
1238
1278
|
* emitted with `requireConfirmation: true`.
|
|
1239
1279
|
*/
|
|
1240
1280
|
confirmToolCall?: ToolCallConfirmationEvent;
|
|
1281
|
+
/**
|
|
1282
|
+
* Signals that the tool is about to be executed. For client-side tools,
|
|
1283
|
+
* the client should begin executing its handler upon receiving this event.
|
|
1284
|
+
* @internal
|
|
1285
|
+
*/
|
|
1286
|
+
executingToolCall?: ExecutingToolCallEvent;
|
|
1241
1287
|
/**
|
|
1242
1288
|
* Allows additional events to be sent in the context of the enclosing event stream.
|
|
1243
1289
|
*/
|
|
@@ -1916,6 +1962,19 @@ type CompletedToolCall = ToolCallStartEvent & ToolCallEndEvent & {
|
|
|
1916
1962
|
* }
|
|
1917
1963
|
* });
|
|
1918
1964
|
* ```
|
|
1965
|
+
*
|
|
1966
|
+
* @example Handling client-side tool execution
|
|
1967
|
+
* ```typescript
|
|
1968
|
+
* message.onToolCallStart((toolCall) => {
|
|
1969
|
+
* const { isClientSideTool, toolName } = toolCall.startEvent;
|
|
1970
|
+
* if (!isClientSideTool) return;
|
|
1971
|
+
*
|
|
1972
|
+
* toolCall.onExecutingToolCall(async (event) => {
|
|
1973
|
+
* const result = await runLocalProcess(toolName, event.input);
|
|
1974
|
+
* toolCall.sendToolCallEnd({ output: result });
|
|
1975
|
+
* });
|
|
1976
|
+
* });
|
|
1977
|
+
* ```
|
|
1919
1978
|
*/
|
|
1920
1979
|
interface ToolCallStream {
|
|
1921
1980
|
/** Unique identifier for this tool call */
|
|
@@ -1987,6 +2046,24 @@ interface ToolCallStream {
|
|
|
1987
2046
|
* ```
|
|
1988
2047
|
*/
|
|
1989
2048
|
onToolCallConfirm(callback: (confirmToolCall: ToolCallConfirmationEvent) => void): () => void;
|
|
2049
|
+
/**
|
|
2050
|
+
* Registers a handler for executingToolCall events. Fired when the tool is about
|
|
2051
|
+
* to be executed. For client-side tools, the client should begin executing its
|
|
2052
|
+
* handler upon receiving this event.
|
|
2053
|
+
*
|
|
2054
|
+
* @param cb - Callback receiving the executing event
|
|
2055
|
+
* @returns Cleanup function to remove the handler
|
|
2056
|
+
*
|
|
2057
|
+
* @example Handling client-side tool execution
|
|
2058
|
+
* ```typescript
|
|
2059
|
+
* toolCall.onExecutingToolCall(async (event) => {
|
|
2060
|
+
* const result = await executeLocally(toolCall.startEvent.toolName, event.input);
|
|
2061
|
+
* toolCall.sendToolCallEnd({ output: result });
|
|
2062
|
+
* });
|
|
2063
|
+
* ```
|
|
2064
|
+
* @internal
|
|
2065
|
+
*/
|
|
2066
|
+
onExecutingToolCall(cb: (event: ExecutingToolCallEvent) => void): () => void;
|
|
1990
2067
|
/**
|
|
1991
2068
|
* Ends the tool call
|
|
1992
2069
|
*
|
|
@@ -3018,12 +3095,23 @@ interface ExchangeStream {
|
|
|
3018
3095
|
*/
|
|
3019
3096
|
getMessage(messageId: string): MessageStream | undefined;
|
|
3020
3097
|
/**
|
|
3021
|
-
* Ends the exchange
|
|
3098
|
+
* Ends the exchange. Stops further events for that exchange from being received.
|
|
3099
|
+
* Use this to stop an in-progress agent response from the client side.
|
|
3022
3100
|
*
|
|
3023
3101
|
* @param endExchange - Optional end event data
|
|
3024
3102
|
*
|
|
3025
|
-
* @example Manually ending an exchange
|
|
3103
|
+
* @example Manually ending an exchange and stopping a response mid-stream
|
|
3104
|
+
* ```typescript
|
|
3105
|
+
* session.onExchangeStart((exchange) => {
|
|
3106
|
+
* stopButton.addEventListener('click', () => exchange.sendExchangeEnd());
|
|
3107
|
+
* });
|
|
3108
|
+
* ```
|
|
3109
|
+
*
|
|
3110
|
+
* @example End an exchange after sending a message
|
|
3026
3111
|
* ```typescript
|
|
3112
|
+
* const exchange = session.startExchange();
|
|
3113
|
+
* exchange.sendMessageWithContentPart({ data: 'Hello!' });
|
|
3114
|
+
* // Later, stop the response
|
|
3027
3115
|
* exchange.sendExchangeEnd();
|
|
3028
3116
|
* ```
|
|
3029
3117
|
*/
|
|
@@ -4805,6 +4893,7 @@ type FeatureFlags = Record<string, unknown>;
|
|
|
4805
4893
|
* S -->|onExchangeStart| E["ExchangeStream"]
|
|
4806
4894
|
* S -->|onSessionEnd| SE(["session closed"])
|
|
4807
4895
|
* E -->|onMessageStart| M["MessageStream"]
|
|
4896
|
+
* E -->|sendExchangeEnd| STOP(["stop response"])
|
|
4808
4897
|
* E -->|onExchangeEnd| EE(["exchange complete"])
|
|
4809
4898
|
* M -->|onContentPartStart| CP["ContentPartStream"]
|
|
4810
4899
|
* M -->|onToolCallStart| TC["ToolCallStream"]
|
|
@@ -4848,10 +4937,20 @@ type FeatureFlags = Record<string, unknown>;
|
|
|
4848
4937
|
* exchange.sendMessageWithContentPart({ data: 'Hello!' });
|
|
4849
4938
|
* });
|
|
4850
4939
|
*
|
|
4851
|
-
* // 5.
|
|
4940
|
+
* // 5. Stop a response mid-stream
|
|
4941
|
+
* // Use sendExchangeEnd() on any active exchange to stop the agent
|
|
4942
|
+
* session.onSessionStarted(() => {
|
|
4943
|
+
* const exchange = session.startExchange();
|
|
4944
|
+
* exchange.sendMessageWithContentPart({ data: 'Tell me a long story' });
|
|
4945
|
+
*
|
|
4946
|
+
* // Stop after 5 seconds
|
|
4947
|
+
* setTimeout(() => exchange.sendExchangeEnd(), 5000);
|
|
4948
|
+
* });
|
|
4949
|
+
*
|
|
4950
|
+
* // 6. End session when done
|
|
4852
4951
|
* conversation.endSession();
|
|
4853
4952
|
*
|
|
4854
|
-
* //
|
|
4953
|
+
* // 7. Retrieve conversation history (offline)
|
|
4855
4954
|
* const exchanges = await conversation.exchanges.getAll();
|
|
4856
4955
|
* ```
|
|
4857
4956
|
*/
|
|
@@ -5184,6 +5283,7 @@ declare abstract class ToolCallEventHelper extends ConversationEventHelperBase<T
|
|
|
5184
5283
|
readonly startEventMaybe: ToolCallStartEvent | undefined;
|
|
5185
5284
|
protected readonly _endHandlers: ToolCallEndHandler[];
|
|
5186
5285
|
protected readonly _confirmHandlers: ToolCallConfirmationHandler[];
|
|
5286
|
+
protected readonly _executingHandlers: ExecutingToolCallHandler[];
|
|
5187
5287
|
constructor(message: MessageEventHelper, toolCallId: string,
|
|
5188
5288
|
/**
|
|
5189
5289
|
* ToolCallStartEvent used to initialize the ToolCallEventHelper. Will be undefined if some other sub-event was
|
|
@@ -5235,6 +5335,14 @@ declare abstract class ToolCallEventHelper extends ConversationEventHelperBase<T
|
|
|
5235
5335
|
* @throws Error if tool call has already ended.
|
|
5236
5336
|
*/
|
|
5237
5337
|
sendToolCallConfirm(confirmToolCall: ToolCallConfirmationEvent): void;
|
|
5338
|
+
/**
|
|
5339
|
+
* Registers a handler for executingToolCall events.
|
|
5340
|
+
* Fired when the tool is about to be executed. For client-side tools,
|
|
5341
|
+
* the client should begin executing its handler upon receiving this.
|
|
5342
|
+
* @returns Cleanup function to remove the handler.
|
|
5343
|
+
* @internal
|
|
5344
|
+
*/
|
|
5345
|
+
onExecutingToolCall(cb: ExecutingToolCallHandler): () => void;
|
|
5238
5346
|
/**
|
|
5239
5347
|
* Sends an error start event for this tool call.
|
|
5240
5348
|
*/
|
|
@@ -5519,7 +5627,9 @@ declare abstract class ExchangeEventHelper extends ConversationEventHelperBase<E
|
|
|
5519
5627
|
*/
|
|
5520
5628
|
sendMetaEvent(metaEvent: MetaEvent): void;
|
|
5521
5629
|
/**
|
|
5522
|
-
* Ends the exchange
|
|
5630
|
+
* Ends the exchange. Stops further events for that exchange from being received.
|
|
5631
|
+
* Can be called from either the client side (to stop an in-progress response) or
|
|
5632
|
+
* the server/agent side (to signal natural completion).
|
|
5523
5633
|
* @throws Error if exchange has already ended.
|
|
5524
5634
|
*/
|
|
5525
5635
|
sendExchangeEnd(endExchange?: ExchangeEndEvent): void;
|
|
@@ -6167,6 +6277,7 @@ type ToolCallEndHandler = (endToolCall: ToolCallEndEvent) => void;
|
|
|
6167
6277
|
type ToolCallStartHandler = (toolCall: ToolCallEventHelper) => void;
|
|
6168
6278
|
type ToolCallStartHandlerAsync = (toolCall: ToolCallEventHelper) => Promise<ToolCallEndEvent | void>;
|
|
6169
6279
|
type ToolCallConfirmationHandler = (confirmToolCall: ToolCallConfirmationEvent) => void;
|
|
6280
|
+
type ExecutingToolCallHandler = (event: ExecutingToolCallEvent) => void;
|
|
6170
6281
|
type ToolCallConfirmHandler = (args: ToolCallConfirmationHandlerArgs) => void;
|
|
6171
6282
|
type ToolCallCompletedHandler = (completedToolCall: CompletedToolCall) => void;
|
|
6172
6283
|
type ContentPartCompletedHandler = (completedContentPart: CompletedContentPart) => void;
|
|
@@ -7082,4 +7193,4 @@ declare class ConversationalAgentService extends BaseService implements Conversa
|
|
|
7082
7193
|
}
|
|
7083
7194
|
|
|
7084
7195
|
export { AgentMap, AsyncInputStreamEventHelper, AsyncInputStreamEventHelperImpl, AsyncToolCallEventHelper, AsyncToolCallEventHelperImpl, CitationErrorType, ContentPartEventHelper, ContentPartEventHelperImpl, ContentPartHelper, ConversationEventHelperBase, ConversationEventHelperManager, ConversationEventHelperManagerImpl, ConversationEventInvalidOperationError, ConversationEventValidationError, ConversationGetAllFilterMap, ConversationMap, ConversationalAgentService as ConversationalAgent, ConversationalAgentService, EventErrorId, ExchangeEventHelper, ExchangeEventHelperImpl, ExchangeMap, ExchangeService, ExchangeService as Exchanges, FeedbackRating, InputStreamSpeechSensitivity, InterruptType, MessageEventHelper, MessageEventHelperImpl, MessageMap, MessageRole, MessageService, MessageService as Messages, SessionEventHelper, SessionEventHelperImpl, SortOrder, ToolCallEventHelper, ToolCallEventHelperImpl, UserSettingsService as UserSettings, UserSettingsMap, UserSettingsService, assertCitationSourceMedia, assertCitationSourceUrl, assertExternalValue, assertInlineValue, createAgentWithMethods, createConversationWithMethods, isCitationSourceMedia, isCitationSourceUrl, isExternalValue, isInlineValue, transformExchange, transformExchanges, transformMessage };
|
|
7085
|
-
export type { AgentAppearance, AgentConversationServiceModel, AgentCreateConversationOptions, AgentGetByIdResponse, AgentGetResponse, AgentInput, AgentMethods, AgentStartingPrompt, AnyErrorEndHandler, AnyErrorEndHandlerArgs, AnyErrorStartHandler, AnyErrorStartHandlerArgs, AsyncInputStream, AsyncInputStreamChunkEvent, AsyncInputStreamChunkHandler, AsyncInputStreamEndEvent, AsyncInputStreamEndHandler, AsyncInputStreamEvent, AsyncInputStreamStartEvent, AsyncToolCallStartHandler, AsyncToolCallStartHandlerAsync, AsyncToolCallStream, ChunkHandler, Citation, CitationEndEvent, CitationError, CitationEvent, CitationOptions, CitationSource, CitationSourceBase, CitationSourceMedia, CitationSourceUrl, CitationStartEvent, CompletedContentPart, CompletedMessage, CompletedToolCall, ContentPart, ContentPartChunkEvent, ContentPartCompletedHandler, ContentPartData, ContentPartEndEvent, ContentPartEndHandler, ContentPartEvent, ContentPartGetResponse, ContentPartInterrupted, ContentPartStartEvent, ContentPartStartEventOptions, ContentPartStartEventWithData, ContentPartStartHandler, ContentPartStartHandlerAsync, ContentPartStartMetaData, ContentPartStream, ConversationAttachmentCreateResponse, ConversationAttachmentUploadResponse, ConversationCreateOptions, ConversationCreateResponse, ConversationDeleteResponse, ConversationEvent, ConversationEventEmitter, ConversationEventErrorSource, ConversationEventHandler, ConversationEventHelperManagerConfig, ConversationEventHelperProperties, ConversationExchangeServiceModel, ConversationGetAllOptions, ConversationGetResponse, ConversationJobStartOverrides, ConversationMethods, ConversationServiceModel, ConversationSessionMethods, ConversationSessionOptions, ConversationUpdateOptions, ConversationUpdateResponse, ConversationalAgentOptions, ConversationalAgentServiceModel, CreateFeedbackOptions, DeletedHandler, ErrorEndEvent, ErrorEndEventOptions, ErrorEndHandler, ErrorEndHandlerArgs, ErrorEvent, ErrorStartEvent, ErrorStartEventOptions, ErrorStartHandler, ErrorStartHandlerArgs, Exchange, ExchangeEndEvent, ExchangeEndHandler, ExchangeEvent, ExchangeGetAllOptions, ExchangeGetByIdOptions, ExchangeGetResponse, ExchangeServiceModel, ExchangeStartEvent, ExchangeStartEventOptions, ExchangeStartHandler, ExchangeStartHandlerAsync, ExchangeStream, ExternalValue, FeatureFlags, FeedbackCreateResponse, FileUploadAccess, GenericInterruptStartEvent, InlineOrExternalValue, InlineValue, InputStreamStartEventOptions, InputStreamStartHandler, Interrupt, InterruptCompletedHandler, InterruptCompletedHandlerArgs, InterruptEndEvent, InterruptEndHandler, InterruptEndHandlerArgs, InterruptEvent, InterruptStartEvent, InterruptStartHandler, InterruptStartHandlerArgs, JSONArray, JSONObject, JSONPrimitive, JSONValue, LabelUpdatedEvent, LabelUpdatedHandler, MakeOptional, MakeRequired, Message, MessageCompletedHandler, MessageEndEvent, MessageEndHandler, MessageEvent, MessageGetResponse, MessageServiceModel, MessageStartEvent, MessageStartEventOptions, MessageStartHandler, MessageStartHandlerAsync, MessageStream, MetaData, MetaEvent, MetaEventHandler, RawAgentGetByIdResponse, RawAgentGetResponse, RawConversationGetResponse, SendMessageWithContentPartOptions, SessionCapabilities, SessionEndEvent, SessionEndHandler, SessionEndingEvent, SessionEndingHandler, SessionStartEvent, SessionStartEventOptions, SessionStartHandler, SessionStartHandlerAsync, SessionStartedEvent, SessionStartedHandler, SessionStream, Simplify, ToolCall, ToolCallCompletedHandler, ToolCallConfirmHandler, ToolCallConfirmationEndValue, ToolCallConfirmationEvent, ToolCallConfirmationHandler, ToolCallConfirmationHandlerArgs, ToolCallConfirmationInterruptStartEvent, ToolCallConfirmationValue, ToolCallEndEvent, ToolCallEndHandler, ToolCallEvent, ToolCallInputValue, ToolCallOutputValue, ToolCallResult, ToolCallStartEvent, ToolCallStartEventWithId, ToolCallStartHandler, ToolCallStartHandlerAsync, ToolCallStream, UnhandledErrorEndHandler, UnhandledErrorEndHandlerArgs, UnhandledErrorStartHandler, UnhandledErrorStartHandlerArgs, UserSettingsGetResponse, UserSettingsServiceModel, UserSettingsUpdateOptions, UserSettingsUpdateResponse };
|
|
7196
|
+
export type { AgentAppearance, AgentConversationServiceModel, AgentCreateConversationOptions, AgentGetByIdResponse, AgentGetResponse, AgentInput, AgentMethods, AgentStartingPrompt, AnyErrorEndHandler, AnyErrorEndHandlerArgs, AnyErrorStartHandler, AnyErrorStartHandlerArgs, AsyncInputStream, AsyncInputStreamChunkEvent, AsyncInputStreamChunkHandler, AsyncInputStreamEndEvent, AsyncInputStreamEndHandler, AsyncInputStreamEvent, AsyncInputStreamStartEvent, AsyncToolCallStartHandler, AsyncToolCallStartHandlerAsync, AsyncToolCallStream, ChunkHandler, Citation, CitationEndEvent, CitationError, CitationEvent, CitationOptions, CitationSource, CitationSourceBase, CitationSourceMedia, CitationSourceUrl, CitationStartEvent, ClientSideTool, CompletedContentPart, CompletedMessage, CompletedToolCall, ContentPart, ContentPartChunkEvent, ContentPartCompletedHandler, ContentPartData, ContentPartEndEvent, ContentPartEndHandler, ContentPartEvent, ContentPartGetResponse, ContentPartInterrupted, ContentPartStartEvent, ContentPartStartEventOptions, ContentPartStartEventWithData, ContentPartStartHandler, ContentPartStartHandlerAsync, ContentPartStartMetaData, ContentPartStream, ConversationAttachmentCreateResponse, ConversationAttachmentUploadResponse, ConversationCreateOptions, ConversationCreateResponse, ConversationDeleteResponse, ConversationEvent, ConversationEventEmitter, ConversationEventErrorSource, ConversationEventHandler, ConversationEventHelperManagerConfig, ConversationEventHelperProperties, ConversationExchangeServiceModel, ConversationGetAllOptions, ConversationGetResponse, ConversationJobStartOverrides, ConversationMethods, ConversationServiceModel, ConversationSessionMethods, ConversationSessionOptions, ConversationUpdateOptions, ConversationUpdateResponse, ConversationalAgentOptions, ConversationalAgentServiceModel, CreateFeedbackOptions, DeletedHandler, ErrorEndEvent, ErrorEndEventOptions, ErrorEndHandler, ErrorEndHandlerArgs, ErrorEvent, ErrorStartEvent, ErrorStartEventOptions, ErrorStartHandler, ErrorStartHandlerArgs, Exchange, ExchangeEndEvent, ExchangeEndHandler, ExchangeEvent, ExchangeGetAllOptions, ExchangeGetByIdOptions, ExchangeGetResponse, ExchangeServiceModel, ExchangeStartEvent, ExchangeStartEventOptions, ExchangeStartHandler, ExchangeStartHandlerAsync, ExchangeStream, ExecutingToolCallEvent, ExecutingToolCallHandler, ExternalValue, FeatureFlags, FeedbackCreateResponse, FileUploadAccess, GenericInterruptStartEvent, InlineOrExternalValue, InlineValue, InputStreamStartEventOptions, InputStreamStartHandler, Interrupt, InterruptCompletedHandler, InterruptCompletedHandlerArgs, InterruptEndEvent, InterruptEndHandler, InterruptEndHandlerArgs, InterruptEvent, InterruptStartEvent, InterruptStartHandler, InterruptStartHandlerArgs, JSONArray, JSONObject, JSONPrimitive, JSONValue, LabelUpdatedEvent, LabelUpdatedHandler, MakeOptional, MakeRequired, Message, MessageCompletedHandler, MessageEndEvent, MessageEndHandler, MessageEvent, MessageGetResponse, MessageServiceModel, MessageStartEvent, MessageStartEventOptions, MessageStartHandler, MessageStartHandlerAsync, MessageStream, MetaData, MetaEvent, MetaEventHandler, RawAgentGetByIdResponse, RawAgentGetResponse, RawConversationGetResponse, SendMessageWithContentPartOptions, SessionCapabilities, SessionEndEvent, SessionEndHandler, SessionEndingEvent, SessionEndingHandler, SessionStartEvent, SessionStartEventOptions, SessionStartHandler, SessionStartHandlerAsync, SessionStartedEvent, SessionStartedHandler, SessionStream, Simplify, ToolCall, ToolCallCompletedHandler, ToolCallConfirmHandler, ToolCallConfirmationEndValue, ToolCallConfirmationEvent, ToolCallConfirmationHandler, ToolCallConfirmationHandlerArgs, ToolCallConfirmationInterruptStartEvent, ToolCallConfirmationValue, ToolCallEndEvent, ToolCallEndHandler, ToolCallEvent, ToolCallInputValue, ToolCallOutputValue, ToolCallResult, ToolCallStartEvent, ToolCallStartEventWithId, ToolCallStartHandler, ToolCallStartHandlerAsync, ToolCallStream, UnhandledErrorEndHandler, UnhandledErrorEndHandlerArgs, UnhandledErrorStartHandler, UnhandledErrorStartHandlerArgs, UserSettingsGetResponse, UserSettingsServiceModel, UserSettingsUpdateOptions, UserSettingsUpdateResponse };
|
|
@@ -2835,6 +2835,7 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
2835
2835
|
this.startEventMaybe = startEventMaybe;
|
|
2836
2836
|
this._endHandlers = new Array();
|
|
2837
2837
|
this._confirmHandlers = new Array();
|
|
2838
|
+
this._executingHandlers = new Array();
|
|
2838
2839
|
this.addStartEventTimestamp(startEventMaybe);
|
|
2839
2840
|
}
|
|
2840
2841
|
/**
|
|
@@ -2919,6 +2920,21 @@ class ToolCallEventHelper extends ConversationEventHelperBase {
|
|
|
2919
2920
|
this.assertNotEnded();
|
|
2920
2921
|
this.emit({ confirmToolCall });
|
|
2921
2922
|
}
|
|
2923
|
+
/**
|
|
2924
|
+
* Registers a handler for executingToolCall events.
|
|
2925
|
+
* Fired when the tool is about to be executed. For client-side tools,
|
|
2926
|
+
* the client should begin executing its handler upon receiving this.
|
|
2927
|
+
* @returns Cleanup function to remove the handler.
|
|
2928
|
+
* @internal
|
|
2929
|
+
*/
|
|
2930
|
+
onExecutingToolCall(cb) {
|
|
2931
|
+
this._executingHandlers.push(cb);
|
|
2932
|
+
return () => {
|
|
2933
|
+
const index = this._executingHandlers.indexOf(cb);
|
|
2934
|
+
if (index >= 0)
|
|
2935
|
+
this._executingHandlers.splice(index, 1);
|
|
2936
|
+
};
|
|
2937
|
+
}
|
|
2922
2938
|
/**
|
|
2923
2939
|
* Sends an error start event for this tool call.
|
|
2924
2940
|
*/
|
|
@@ -2998,6 +3014,10 @@ class ToolCallEventHelperImpl extends ToolCallEventHelper {
|
|
|
2998
3014
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2999
3015
|
this._confirmHandlers.forEach(cb => cb(toolCallEvent.confirmToolCall));
|
|
3000
3016
|
}
|
|
3017
|
+
if (toolCallEvent.executingToolCall) {
|
|
3018
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3019
|
+
this._executingHandlers.forEach(cb => cb(toolCallEvent.executingToolCall));
|
|
3020
|
+
}
|
|
3001
3021
|
if (toolCallEvent.endToolCall) {
|
|
3002
3022
|
this.setEnded();
|
|
3003
3023
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -3594,7 +3614,9 @@ class ExchangeEventHelper extends ConversationEventHelperBase {
|
|
|
3594
3614
|
this.emit({ metaEvent });
|
|
3595
3615
|
}
|
|
3596
3616
|
/**
|
|
3597
|
-
* Ends the exchange
|
|
3617
|
+
* Ends the exchange. Stops further events for that exchange from being received.
|
|
3618
|
+
* Can be called from either the client side (to stop an in-progress response) or
|
|
3619
|
+
* the server/agent side (to signal natural completion).
|
|
3598
3620
|
* @throws Error if exchange has already ended.
|
|
3599
3621
|
*/
|
|
3600
3622
|
sendExchangeEnd(endExchange = {}) {
|
package/dist/core/index.cjs
CHANGED
|
@@ -4822,7 +4822,7 @@ class EmbeddedTokenManager {
|
|
|
4822
4822
|
* SDK's public API.
|
|
4823
4823
|
*/
|
|
4824
4824
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
4825
|
-
const SDK_VERSION = '1.5.
|
|
4825
|
+
const SDK_VERSION = '1.5.1';
|
|
4826
4826
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
4827
4827
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
4828
4828
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|
package/dist/core/index.mjs
CHANGED
|
@@ -4820,7 +4820,7 @@ class EmbeddedTokenManager {
|
|
|
4820
4820
|
* SDK's public API.
|
|
4821
4821
|
*/
|
|
4822
4822
|
/** SDK version placeholder — patched by the SDK publish workflow. */
|
|
4823
|
-
const SDK_VERSION = '1.5.
|
|
4823
|
+
const SDK_VERSION = '1.5.1';
|
|
4824
4824
|
const CLOUD_ROLE_NAME = 'uipath-ts-sdk';
|
|
4825
4825
|
const SDK_SERVICE_NAME = 'UiPath.TypeScript.Sdk';
|
|
4826
4826
|
const SDK_LOGGER_NAME = 'uipath-ts-sdk-telemetry';
|