@fencyai/js 0.1.122 → 0.1.123
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/lib/AgentTaskEventData.d.ts +5 -0
- package/lib/AgentTaskEventData.d.ts.map +1 -0
- package/lib/AgentTaskModel.d.ts +4 -0
- package/lib/AgentTaskModel.d.ts.map +1 -0
- package/lib/AgentTaskModel.js +2 -0
- package/lib/api/agent-task-params/toStreamingChatCompletionTaskParams.d.ts +1 -0
- package/lib/api/agent-task-params/toStreamingChatCompletionTaskParams.d.ts.map +1 -0
- package/lib/api/agent-task-params/toStreamingChatCompletionTaskParams.js +1 -1
- package/lib/api/agent-task-params/toStreamingMemoryTypeChatCompletionTaskParams.d.ts +1 -0
- package/lib/api/agent-task-params/toStreamingMemoryTypeChatCompletionTaskParams.d.ts.map +1 -0
- package/lib/api/agent-task-params/toStreamingMemoryTypeChatCompletionTaskParams.js +1 -1
- package/lib/api/agent-task-params/toStructuredChatCompletionTaskParams.d.ts +1 -0
- package/lib/api/agent-task-params/toStructuredChatCompletionTaskParams.d.ts.map +1 -0
- package/lib/api/agent-task-params/toStructuredChatCompletionTaskParams.js +1 -1
- package/lib/api/createAgentTask.d.ts +5 -0
- package/lib/api/createAgentTask.d.ts.map +1 -0
- package/lib/api/createAgentTask.js +4 -0
- package/lib/api/createStream.d.ts +5 -0
- package/lib/api/createStream.d.ts.map +1 -0
- package/lib/api/createStream.js +4 -0
- package/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +4 -0
- package/lib/loadFency.d.ts +2 -0
- package/lib/loadFency.d.ts.map +1 -0
- package/lib/loadFency.js +1 -0
- package/lib/openapi/ct/core/ApiError.d.ts +1 -0
- package/lib/openapi/ct/core/ApiError.d.ts.map +1 -0
- package/lib/openapi/ct/core/ApiRequestOptions.d.ts +1 -0
- package/lib/openapi/ct/core/ApiRequestOptions.d.ts.map +1 -0
- package/lib/openapi/ct/core/ApiResult.d.ts +1 -0
- package/lib/openapi/ct/core/ApiResult.d.ts.map +1 -0
- package/lib/openapi/ct/core/CancelablePromise.d.ts +1 -0
- package/lib/openapi/ct/core/CancelablePromise.d.ts.map +1 -0
- package/lib/openapi/ct/core/OpenAPI.d.ts +1 -0
- package/lib/openapi/ct/core/OpenAPI.d.ts.map +1 -0
- package/lib/openapi/ct/core/request.d.ts +1 -0
- package/lib/openapi/ct/core/request.d.ts.map +1 -0
- package/lib/openapi/ct/index.d.ts +1 -0
- package/lib/openapi/ct/index.d.ts.map +1 -0
- package/lib/openapi/ct/models/AgentTaskProgressItemUpdatedEventDto.d.ts +1 -0
- package/lib/openapi/ct/models/AgentTaskProgressItemUpdatedEventDto.d.ts.map +1 -0
- package/lib/openapi/ct/models/ApiDtoType.d.ts +1 -0
- package/lib/openapi/ct/models/ApiDtoType.d.ts.map +1 -0
- package/lib/openapi/ct/models/StreamDto.d.ts +1 -0
- package/lib/openapi/ct/models/StreamDto.d.ts.map +1 -0
- package/lib/openapi/ct/models/StreamEventType.d.ts +1 -0
- package/lib/openapi/ct/models/StreamEventType.d.ts.map +1 -0
- package/lib/openapi/ct/models/StreamNotFoundEventDto.d.ts +1 -0
- package/lib/openapi/ct/models/StreamNotFoundEventDto.d.ts.map +1 -0
- package/lib/openapi/ct/models/StreamTimeoutEventDto.d.ts +1 -0
- package/lib/openapi/ct/models/StreamTimeoutEventDto.d.ts.map +1 -0
- package/lib/openapi/ct/services/PubService.d.ts +1 -0
- package/lib/openapi/ct/services/PubService.d.ts.map +1 -0
- package/lib/openapi/ct-st/core/ApiError.d.ts +1 -0
- package/lib/openapi/ct-st/core/ApiError.d.ts.map +1 -0
- package/lib/openapi/ct-st/core/ApiRequestOptions.d.ts +1 -0
- package/lib/openapi/ct-st/core/ApiRequestOptions.d.ts.map +1 -0
- package/lib/openapi/ct-st/core/ApiResult.d.ts +1 -0
- package/lib/openapi/ct-st/core/ApiResult.d.ts.map +1 -0
- package/lib/openapi/ct-st/core/CancelablePromise.d.ts +1 -0
- package/lib/openapi/ct-st/core/CancelablePromise.d.ts.map +1 -0
- package/lib/openapi/ct-st/core/OpenAPI.d.ts +1 -0
- package/lib/openapi/ct-st/core/OpenAPI.d.ts.map +1 -0
- package/lib/openapi/ct-st/core/request.d.ts +1 -0
- package/lib/openapi/ct-st/core/request.d.ts.map +1 -0
- package/lib/openapi/ct-st/index.d.ts +1 -0
- package/lib/openapi/ct-st/index.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/AgentTaskTypeName.d.ts +1 -0
- package/lib/openapi/ct-st/models/AgentTaskTypeName.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/ModelMessage.d.ts +1 -0
- package/lib/openapi/ct-st/models/ModelMessage.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/ModelMessageRole.d.ts +1 -0
- package/lib/openapi/ct-st/models/ModelMessageRole.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/PubAgentTaskDto.d.ts +1 -0
- package/lib/openapi/ct-st/models/PubAgentTaskDto.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/PubCreateAgentTaskRequest.d.ts +1 -0
- package/lib/openapi/ct-st/models/PubCreateAgentTaskRequest.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/StreamingChatCompletionTaskTypeRequestDto.d.ts +1 -0
- package/lib/openapi/ct-st/models/StreamingChatCompletionTaskTypeRequestDto.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/StreamingMemoryTypeChatCompletionTaskTypeRequestDto.d.ts +1 -0
- package/lib/openapi/ct-st/models/StreamingMemoryTypeChatCompletionTaskTypeRequestDto.d.ts.map +1 -0
- package/lib/openapi/ct-st/models/StructuredChatCompletionTaskTypeRequestDto.d.ts +1 -0
- package/lib/openapi/ct-st/models/StructuredChatCompletionTaskTypeRequestDto.d.ts.map +1 -0
- package/lib/openapi/ct-st/services/PubService.d.ts +1 -0
- package/lib/openapi/ct-st/services/PubService.d.ts.map +1 -0
- package/lib/types/AgentTask.d.ts +3 -0
- package/lib/types/AgentTask.d.ts.map +1 -0
- package/lib/types/AgentTask.js +1 -0
- package/lib/types/ApiError.d.ts +2 -0
- package/lib/types/ApiError.d.ts.map +1 -0
- package/lib/types/CreateAgentTaskRequest.d.ts +2 -0
- package/lib/types/CreateAgentTaskRequest.d.ts.map +1 -0
- package/lib/types/CreateAgentTaskResponse.d.ts +2 -0
- package/lib/types/CreateAgentTaskResponse.d.ts.map +1 -0
- package/lib/types/CreateStreamResponse.d.ts +2 -0
- package/lib/types/CreateStreamResponse.d.ts.map +1 -0
- package/lib/types/FencyInstance.d.ts +2 -0
- package/lib/types/FencyInstance.d.ts.map +1 -0
- package/lib/types/FencyOptions.d.ts +2 -0
- package/lib/types/FencyOptions.d.ts.map +1 -0
- package/lib/types/Stream.d.ts +3 -0
- package/lib/types/Stream.d.ts.map +1 -0
- package/lib/types/Stream.js +1 -0
- package/lib/types/StreamEventTypes.d.ts +25 -0
- package/lib/types/StreamEventTypes.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -7
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +9 -1
- package/lib/utils/streamEventTypes.d.ts +17 -0
- package/lib/utils/streamEventTypes.d.ts.map +1 -0
- package/lib/utils/streamEventTypes.js +75 -0
- package/lib/utils/toModelMessageRole.d.ts +3 -0
- package/lib/utils/toModelMessageRole.d.ts.map +1 -0
- package/lib/{toModelMessageRole.js → utils/toModelMessageRole.js} +1 -1
- package/lib/utils/version.d.ts +1 -0
- package/lib/utils/version.d.ts.map +1 -0
- package/lib/utils/version.js +1 -1
- package/package.json +5 -3
- package/lib/toModelMessageRole.d.ts +0 -2
- package/lib/types/CreateFileDownloadLinkRequest.d.ts +0 -3
- package/lib/types/CreateFileDownloadLinkResponse.d.ts +0 -4
- package/lib/types/CreateFileDownloadLinkResponse.js +0 -1
- package/lib/types/S3PostRequest.d.ts +0 -10
- package/lib/types/S3PostRequest.js +0 -1
- package/lib/utils/parseApiError.d.ts +0 -2
- package/lib/utils/parseApiError.js +0 -14
- package/lib/utils/parseErrorBody.d.ts +0 -1
- package/lib/utils/parseErrorBody.js +0 -8
- package/lib/utils/parseNonOkResponse.d.ts +0 -2
- package/lib/utils/parseNonOkResponse.js +0 -35
- /package/lib/types/{CreateFileDownloadLinkRequest.js → StreamEventTypes.js} +0 -0
package/lib/types/ApiError.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiError.d.ts","sourceRoot":"","sources":["../../src/types/ApiError.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateAgentTaskRequest.d.ts","sourceRoot":"","sources":["../../src/types/CreateAgentTaskRequest.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,sBAAsB;IACnC,2BAA2B,CAAC,EAAE;QAC1B,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;YACrC,OAAO,EAAE,MAAM,CAAA;SAClB,EAAE,CAAA;QACH,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,4BAA4B,CAAC,EAAE;QAC3B,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;YACrC,OAAO,EAAE,MAAM,CAAA;SAClB,EAAE,CAAA;QACH,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,qCAAqC,CAAC,EAAE;QACpC,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;YACrC,OAAO,EAAE,MAAM,CAAA;SAClB,EAAE,CAAA;QACH,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;CACJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiError } from './ApiError';
|
|
2
2
|
import { AgentTask } from './AgentTask';
|
|
3
|
+
/** @public */
|
|
3
4
|
export type CreateAgentTaskResponse = {
|
|
4
5
|
type: 'success';
|
|
5
6
|
agentTask: AgentTask;
|
|
@@ -7,3 +8,4 @@ export type CreateAgentTaskResponse = {
|
|
|
7
8
|
type: 'error';
|
|
8
9
|
error: ApiError;
|
|
9
10
|
};
|
|
11
|
+
//# sourceMappingURL=CreateAgentTaskResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateAgentTaskResponse.d.ts","sourceRoot":"","sources":["../../src/types/CreateAgentTaskResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,cAAc;AACd,MAAM,MAAM,uBAAuB,GAC7B;IACI,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,SAAS,CAAA;CACvB,GACD;IACI,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,QAAQ,CAAA;CAClB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiError } from './ApiError';
|
|
2
2
|
import { Stream } from './Stream';
|
|
3
|
+
/** @public */
|
|
3
4
|
export type CreateStreamResponse = {
|
|
4
5
|
type: 'success';
|
|
5
6
|
stream: Stream;
|
|
@@ -7,3 +8,4 @@ export type CreateStreamResponse = {
|
|
|
7
8
|
type: 'error';
|
|
8
9
|
error: ApiError;
|
|
9
10
|
};
|
|
11
|
+
//# sourceMappingURL=CreateStreamResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateStreamResponse.d.ts","sourceRoot":"","sources":["../../src/types/CreateStreamResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,cAAc;AACd,MAAM,MAAM,oBAAoB,GAC1B;IACI,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACjB,GACD;IACI,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,QAAQ,CAAA;CAClB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FencyInstance.d.ts","sourceRoot":"","sources":["../../src/types/FencyInstance.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,aAAa;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FencyOptions.d.ts","sourceRoot":"","sources":["../../src/types/FencyOptions.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,YAAY;IACzB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAA;IACtB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/lib/types/Stream.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stream.d.ts","sourceRoot":"","sources":["../../src/types/Stream.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,cAAc;AACd,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,KAAG,IAAI,IAAI,MAQ5C,CAAA"}
|
package/lib/types/Stream.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
export type StreamEventType = 'StreamTimeout' | 'StreamNotFound' | 'StreamUnauthorized' | 'AgentTaskProgressItemUpdated';
|
|
3
|
+
/** @public */
|
|
4
|
+
export type AgentTaskProgressItemUpdatedEventDto = {
|
|
5
|
+
type: StreamEventType;
|
|
6
|
+
streamId: string;
|
|
7
|
+
timestamp: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
agentTaskId: string;
|
|
10
|
+
progressItemId: string;
|
|
11
|
+
data: string;
|
|
12
|
+
};
|
|
13
|
+
/** @public */
|
|
14
|
+
export type StreamNotFoundEventDto = {
|
|
15
|
+
type: StreamEventType;
|
|
16
|
+
streamId: string;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
};
|
|
19
|
+
/** @public */
|
|
20
|
+
export type StreamTimeoutEventDto = {
|
|
21
|
+
type: StreamEventType;
|
|
22
|
+
streamId: string;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=StreamEventTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamEventTypes.d.ts","sourceRoot":"","sources":["../../src/types/StreamEventTypes.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,MAAM,eAAe,GACrB,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,8BAA8B,CAAA;AAEpC,cAAc;AACd,MAAM,MAAM,oCAAoC,GAAG;IAC/C,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED,cAAc;AACd,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,cAAc;AACd,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
export * from './AgentTask';
|
|
2
|
+
export * from './ApiError';
|
|
3
|
+
export * from './CreateAgentTaskRequest';
|
|
4
|
+
export * from './CreateAgentTaskResponse';
|
|
5
|
+
export * from './CreateStreamResponse';
|
|
6
|
+
export * from './FencyInstance';
|
|
7
|
+
export * from './FencyOptions';
|
|
8
|
+
export * from './Stream';
|
|
9
|
+
export * from './StreamEventTypes';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA"}
|
package/lib/types/index.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './AgentTask';
|
|
2
|
+
export * from './ApiError';
|
|
3
|
+
export * from './CreateAgentTaskRequest';
|
|
4
|
+
export * from './CreateAgentTaskResponse';
|
|
5
|
+
export * from './CreateStreamResponse';
|
|
6
|
+
export * from './FencyInstance';
|
|
7
|
+
export * from './FencyOptions';
|
|
8
|
+
export * from './Stream';
|
|
9
|
+
export * from './StreamEventTypes';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AgentTaskProgressItemUpdatedEventDto, StreamNotFoundEventDto, StreamTimeoutEventDto } from '../types/StreamEventTypes';
|
|
2
|
+
import type { AgentTaskProgressItemUpdatedEventDto as GeneratedAgentTaskDto } from '../openapi/ct/models/AgentTaskProgressItemUpdatedEventDto';
|
|
3
|
+
import type { StreamNotFoundEventDto as GeneratedStreamNotFoundDto } from '../openapi/ct/models/StreamNotFoundEventDto';
|
|
4
|
+
import type { StreamTimeoutEventDto as GeneratedStreamTimeoutDto } from '../openapi/ct/models/StreamTimeoutEventDto';
|
|
5
|
+
/** @public */
|
|
6
|
+
export declare function isStreamTimeoutEventDto(value: unknown): value is StreamTimeoutEventDto;
|
|
7
|
+
/** @public */
|
|
8
|
+
export declare function isStreamNotFoundEventDto(value: unknown): value is StreamNotFoundEventDto;
|
|
9
|
+
/** @public */
|
|
10
|
+
export declare function isAgentTaskProgressItemUpdatedEventDto(value: unknown): value is AgentTaskProgressItemUpdatedEventDto;
|
|
11
|
+
/** @public */
|
|
12
|
+
export declare function toStreamTimeoutEventDto(value: GeneratedStreamTimeoutDto): StreamTimeoutEventDto;
|
|
13
|
+
/** @public */
|
|
14
|
+
export declare function toStreamNotFoundEventDto(value: GeneratedStreamNotFoundDto): StreamNotFoundEventDto;
|
|
15
|
+
/** @public */
|
|
16
|
+
export declare function toAgentTaskProgressItemUpdatedEventDto(value: GeneratedAgentTaskDto): AgentTaskProgressItemUpdatedEventDto;
|
|
17
|
+
//# sourceMappingURL=streamEventTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamEventTypes.d.ts","sourceRoot":"","sources":["../../src/utils/streamEventTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,oCAAoC,EAEpC,sBAAsB,EACtB,qBAAqB,EACxB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,oCAAoC,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAA;AAC9I,OAAO,KAAK,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,6CAA6C,CAAA;AACvH,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAUpH,cAAc;AACd,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,qBAAqB,CAOhC;AAED,cAAc;AACd,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,sBAAsB,CAOjC;AAED,cAAc;AACd,wBAAgB,sCAAsC,CAClD,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,oCAAoC,CAW/C;AAWD,cAAc;AACd,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,yBAAyB,GACjC,qBAAqB,CAMvB;AAED,cAAc;AACd,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,0BAA0B,GAClC,sBAAsB,CAMxB;AAED,cAAc;AACd,wBAAgB,sCAAsC,CAClD,KAAK,EAAE,qBAAqB,GAC7B,oCAAoC,CAUtC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function isObject(value) {
|
|
2
|
+
return typeof value === 'object' && value !== null;
|
|
3
|
+
}
|
|
4
|
+
function hasString(obj, key) {
|
|
5
|
+
return key in obj && typeof obj[key] === 'string';
|
|
6
|
+
}
|
|
7
|
+
/** @public */
|
|
8
|
+
export function isStreamTimeoutEventDto(value) {
|
|
9
|
+
if (!isObject(value))
|
|
10
|
+
return false;
|
|
11
|
+
return (value.type === 'StreamTimeout' &&
|
|
12
|
+
hasString(value, 'streamId') &&
|
|
13
|
+
hasString(value, 'timestamp'));
|
|
14
|
+
}
|
|
15
|
+
/** @public */
|
|
16
|
+
export function isStreamNotFoundEventDto(value) {
|
|
17
|
+
if (!isObject(value))
|
|
18
|
+
return false;
|
|
19
|
+
return (value.type === 'StreamNotFound' &&
|
|
20
|
+
hasString(value, 'streamId') &&
|
|
21
|
+
hasString(value, 'timestamp'));
|
|
22
|
+
}
|
|
23
|
+
/** @public */
|
|
24
|
+
export function isAgentTaskProgressItemUpdatedEventDto(value) {
|
|
25
|
+
if (!isObject(value))
|
|
26
|
+
return false;
|
|
27
|
+
return (value.type === 'AgentTaskProgressItemUpdated' &&
|
|
28
|
+
hasString(value, 'streamId') &&
|
|
29
|
+
hasString(value, 'timestamp') &&
|
|
30
|
+
hasString(value, 'createdAt') &&
|
|
31
|
+
hasString(value, 'agentTaskId') &&
|
|
32
|
+
hasString(value, 'progressItemId') &&
|
|
33
|
+
hasString(value, 'data'));
|
|
34
|
+
}
|
|
35
|
+
function parseStreamEventType(value) {
|
|
36
|
+
if (typeof value !== 'string')
|
|
37
|
+
return 'StreamTimeout';
|
|
38
|
+
if (value === 'StreamTimeout')
|
|
39
|
+
return 'StreamTimeout';
|
|
40
|
+
if (value === 'StreamNotFound')
|
|
41
|
+
return 'StreamNotFound';
|
|
42
|
+
if (value === 'StreamUnauthorized')
|
|
43
|
+
return 'StreamUnauthorized';
|
|
44
|
+
if (value === 'AgentTaskProgressItemUpdated')
|
|
45
|
+
return 'AgentTaskProgressItemUpdated';
|
|
46
|
+
return 'StreamTimeout';
|
|
47
|
+
}
|
|
48
|
+
/** @public */
|
|
49
|
+
export function toStreamTimeoutEventDto(value) {
|
|
50
|
+
return {
|
|
51
|
+
type: parseStreamEventType(value.type),
|
|
52
|
+
streamId: value.streamId,
|
|
53
|
+
timestamp: value.timestamp,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** @public */
|
|
57
|
+
export function toStreamNotFoundEventDto(value) {
|
|
58
|
+
return {
|
|
59
|
+
type: parseStreamEventType(value.type),
|
|
60
|
+
streamId: value.streamId,
|
|
61
|
+
timestamp: value.timestamp,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** @public */
|
|
65
|
+
export function toAgentTaskProgressItemUpdatedEventDto(value) {
|
|
66
|
+
return {
|
|
67
|
+
type: parseStreamEventType(value.type),
|
|
68
|
+
streamId: value.streamId,
|
|
69
|
+
timestamp: value.timestamp,
|
|
70
|
+
createdAt: value.createdAt,
|
|
71
|
+
agentTaskId: value.agentTaskId,
|
|
72
|
+
progressItemId: value.progressItemId,
|
|
73
|
+
data: value.data,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toModelMessageRole.d.ts","sourceRoot":"","sources":["../../src/utils/toModelMessageRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAE3E,eAAO,MAAM,kBAAkB,GAC3B,MAAM,MAAM,GAAG,WAAW,GAAG,QAAQ,KACtC,gBASF,CAAA"}
|
package/lib/utils/version.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
package/lib/utils/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Browser-compatible version utility
|
|
2
2
|
// The version is set at build time and can be overridden if needed
|
|
3
3
|
// Build-time version constant - this should be updated during the build process
|
|
4
|
-
const SDK_VERSION = '0.1.
|
|
4
|
+
const SDK_VERSION = '0.1.121';
|
|
5
5
|
// Allow runtime override if needed
|
|
6
6
|
let versionOverride = null;
|
|
7
7
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.123",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"test:watch": "jest --watch",
|
|
33
33
|
"dev": "tsc --watch",
|
|
34
34
|
"prepublishOnly": "npm run build",
|
|
35
|
-
"codegen": "openapi --input http://localhost:8080/pub/ct-st/swagger.json --output ./src/openapi/ct-st && openapi --input http://localhost:8080/pub/ct/swagger.json --output ./src/openapi/ct"
|
|
35
|
+
"codegen": "openapi --input http://localhost:8080/pub/ct-st/swagger.json --output ./src/openapi/ct-st && openapi --input http://localhost:8080/pub/ct/swagger.json --output ./src/openapi/ct",
|
|
36
|
+
"extract-api": "api-extractor run",
|
|
37
|
+
"extract-api:local": "api-extractor run --local"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
38
40
|
"@types/jest": "^29.5.11",
|
|
@@ -42,5 +44,5 @@
|
|
|
42
44
|
"ts-jest": "^29.1.1",
|
|
43
45
|
"typescript": "^5.3.3"
|
|
44
46
|
},
|
|
45
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "69837e7a8a835804f22365e8970216e4c1ab047b"
|
|
46
48
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const parseApiError = (error) => {
|
|
2
|
-
if (typeof error === 'object' &&
|
|
3
|
-
error !== null &&
|
|
4
|
-
'code' in error &&
|
|
5
|
-
'message' in error &&
|
|
6
|
-
typeof error.code === 'string' &&
|
|
7
|
-
typeof error.message === 'string') {
|
|
8
|
-
return {
|
|
9
|
-
code: error.code,
|
|
10
|
-
message: error.message,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const parseErrorBody: (response: Response) => Promise<unknown>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { parseApiError } from './parseApiError';
|
|
2
|
-
import { parseErrorBody } from './parseErrorBody';
|
|
3
|
-
export const parseNonOkResponse = async (response) => {
|
|
4
|
-
const error = await parseErrorBody(response);
|
|
5
|
-
const apiError = parseApiError(error);
|
|
6
|
-
if (apiError) {
|
|
7
|
-
return apiError;
|
|
8
|
-
}
|
|
9
|
-
if (apiError) {
|
|
10
|
-
return apiError;
|
|
11
|
-
}
|
|
12
|
-
if (response.status === 401) {
|
|
13
|
-
return {
|
|
14
|
-
code: 'InvalidCredentials',
|
|
15
|
-
message: `Invalid credentials provided.
|
|
16
|
-
Please make sure a valid publishable key is set.
|
|
17
|
-
You can find your publishable key in the Fency dashboard.
|
|
18
|
-
Take a look at https://docs.fency.ai/docs for more information.`,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (response.status === 403) {
|
|
22
|
-
return {
|
|
23
|
-
code: 'ForbiddenOperation',
|
|
24
|
-
message: `Forbidden operation!
|
|
25
|
-
If your publishable key is correctly set, you might need to whitelist the domain you're using in the Fency dashboard.
|
|
26
|
-
If you're using localhost you also need to whitelist that.
|
|
27
|
-
Take a look at https://docs.fency.ai/docs for more information.
|
|
28
|
-
`,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
code: 'UnknownError',
|
|
33
|
-
message: `Unknown error!\n${response.status ? `Status code: ${response.status}\n` : ''}Response Body:${JSON.stringify(error, null, 2)}`.trim(),
|
|
34
|
-
};
|
|
35
|
-
};
|
|
File without changes
|