@collective-intelligence/external-apps-client-sdk 0.3.4 → 0.3.7
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/AGENTS.md +3 -0
- package/README.md +126 -2
- package/dist/chat.d.ts +15 -0
- package/dist/chat.js +110 -0
- package/dist/client-_rl-iXS8.d.ts +424 -0
- package/dist/effect.d.ts +9 -7
- package/dist/effect.js +4 -3
- package/dist/errors-C3UmgGGu.js +86 -0
- package/dist/{index-DhKJ4NCr.d.ts → index-DFCHAlar.d.ts} +1536 -213
- package/dist/index.d.ts +5 -3
- package/dist/index.js +5 -3
- package/dist/proxy-DRPEFvaV.d.ts +2847 -0
- package/dist/{resources-B6e3qsBD.js → resources-BZKqGxBT.js} +2 -1
- package/dist/{resources-DVq8jSnc.d.ts → resources-r2t8pcv2.d.ts} +3 -513
- package/dist/resources.d.ts +1 -1
- package/dist/resources.js +2 -2
- package/dist/{service-BIyZo-CO.js → service-D-POpqlt.js} +117 -116
- package/dist/{service-Db0c8eg9.js → service-l8wUAlPK.js} +525 -94
- package/docs/chat.md +49 -0
- package/docs/guide/develop/extensions.md +44 -11
- package/docs/guide/platform/access.md +9 -7
- package/docs/guide/platform/architecture.md +17 -2
- package/docs/guide/template/index.md +23 -30
- package/package.json +19 -6
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { C as OperationExecutionOptions, D as CiError, P as CiResult, S as ClientOperationOutput, V as ExternalApplicationChatOperationId, b as ClientOperationInput, i as ClientFetch, k as CiTransportError, n as ProxyTransportOptions, w as TypedOperationExecutor, x as ClientOperationMap, y as ClientOperationId } from "./proxy-DRPEFvaV.js";
|
|
2
|
+
import "effect/Clock";
|
|
3
|
+
import * as Config from "effect/Config";
|
|
4
|
+
import * as Context from "effect/Context";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import "effect/ManagedRuntime";
|
|
8
|
+
type DirectTransportOptions = Readonly<{
|
|
9
|
+
auth: Readonly<{
|
|
10
|
+
getAccessToken: () => Promise<string> | string;
|
|
11
|
+
}>;
|
|
12
|
+
fetch?: ClientFetch;
|
|
13
|
+
tenantUrl: string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The Vanilla Facade of `CiClient.layerDirect`, in a runtime of its own;
|
|
17
|
+
* `close` disposes it. A bad `tenantUrl` throws `TypeError`.
|
|
18
|
+
*/
|
|
19
|
+
declare const createDirectTransport: <Operations extends ClientOperationMap>(options: DirectTransportOptions) => TypedOperationExecutor<Operations> & Readonly<{
|
|
20
|
+
close: () => Promise<void>;
|
|
21
|
+
}>;
|
|
22
|
+
type Input<Id extends ClientOperationId> = ClientOperationMap[Id]["input"];
|
|
23
|
+
type Output<Id extends ClientOperationId> = ClientOperationMap[Id]["output"];
|
|
24
|
+
/** One CI operation as its `CiResult` envelope; only a transport failure fails. */
|
|
25
|
+
type ExecuteResult<R = never> = <Id extends ClientOperationId>(operationId: Id, input: Input<Id>, options: OperationExecutionOptions) => Effect.Effect<CiResult<Output<Id>>, CiTransportError, R>;
|
|
26
|
+
type CiClientValue = Readonly<{
|
|
27
|
+
/**
|
|
28
|
+
* The result of one operation. An Expected Error of CI fails with
|
|
29
|
+
* `CiError`; a request that does not reach CI fails with
|
|
30
|
+
* `CiTransportError`. Interruption cancels the request.
|
|
31
|
+
*/
|
|
32
|
+
execute: <Id extends ClientOperationId>(operationId: Id, input: Input<Id>, options: OperationExecutionOptions) => Effect.Effect<Output<Id>, CiError | CiTransportError>;
|
|
33
|
+
/** The same call as its envelope, which keeps the correlation id of CI. */
|
|
34
|
+
executeResult: ExecuteResult;
|
|
35
|
+
}>;
|
|
36
|
+
declare const CiClient_base: Context.ServiceClass<CiClient, "@collective-intelligence/external-apps-client-sdk/CiClient", Readonly<{
|
|
37
|
+
/**
|
|
38
|
+
* The result of one operation. An Expected Error of CI fails with
|
|
39
|
+
* `CiError`; a request that does not reach CI fails with
|
|
40
|
+
* `CiTransportError`. Interruption cancels the request.
|
|
41
|
+
*/
|
|
42
|
+
execute: <Id extends ClientOperationId>(operationId: Id, input: Input<Id>, options: OperationExecutionOptions) => Effect.Effect<Output<Id>, CiError | CiTransportError>;
|
|
43
|
+
/** The same call as its envelope, which keeps the correlation id of CI. */
|
|
44
|
+
executeResult: ExecuteResult;
|
|
45
|
+
}>>;
|
|
46
|
+
declare class CiClient extends CiClient_base {}
|
|
47
|
+
/** `CiClient` over the tenant Application HTTP API; a bad `tenantUrl` dies with `TypeError`. */
|
|
48
|
+
declare const layerDirect: (options: DirectTransportOptions) => Layer.Layer<CiClient, never, never>;
|
|
49
|
+
/** `CiClient` over the app's protocol proxy; a bad `serverUrl` or `path` dies with `TypeError`. */
|
|
50
|
+
declare const layerProxy: (options: ProxyTransportOptions) => Layer.Layer<CiClient, never, never>;
|
|
51
|
+
/** `CiClient` over a `TypedOperationExecutor`, such as the transport of `createClient`. */
|
|
52
|
+
declare const layerFromExecutor: <Operations extends ClientOperationMap>(executor: TypedOperationExecutor<Operations>) => Layer.Layer<CiClient, never, never>;
|
|
53
|
+
/** `layerDirect` with options that Effect `Config` reads. */
|
|
54
|
+
declare const layerDirectConfig: (config: Config.Wrap<DirectTransportOptions>) => Layer.Layer<CiClient, Config.ConfigError, never>;
|
|
55
|
+
/** `layerProxy` with options that Effect `Config` reads. */
|
|
56
|
+
declare const layerProxyConfig: (config: Config.Wrap<ProxyTransportOptions>) => Layer.Layer<CiClient, Config.ConfigError, never>;
|
|
57
|
+
/** The `chat_*` operation of each method of the chat domain. */
|
|
58
|
+
declare const chatOperations: {
|
|
59
|
+
readonly agentConversations: {
|
|
60
|
+
readonly cancelTurn: "chat_agent_conversations_cancel_turn";
|
|
61
|
+
readonly close: "chat_agent_conversations_close";
|
|
62
|
+
readonly submitTurn: "chat_agent_conversations_submit_turn";
|
|
63
|
+
};
|
|
64
|
+
readonly agents: {
|
|
65
|
+
readonly list: "chat_agents_list";
|
|
66
|
+
};
|
|
67
|
+
readonly approvals: {
|
|
68
|
+
readonly decide: "chat_approvals_decide";
|
|
69
|
+
readonly get: "chat_approvals_get";
|
|
70
|
+
readonly reject: "chat_approvals_reject";
|
|
71
|
+
readonly search: "chat_approvals_search";
|
|
72
|
+
readonly searchRequests: "chat_approvals_search_requests";
|
|
73
|
+
readonly withdraw: "chat_approvals_withdraw";
|
|
74
|
+
};
|
|
75
|
+
readonly artifacts: {
|
|
76
|
+
readonly progress: "chat_artifacts_progress";
|
|
77
|
+
};
|
|
78
|
+
readonly attachments: {
|
|
79
|
+
readonly capabilities: "chat_attachments_capabilities";
|
|
80
|
+
readonly downloadUrl: "chat_attachments_download_url";
|
|
81
|
+
readonly upload: "chat_attachments_upload";
|
|
82
|
+
};
|
|
83
|
+
readonly compaction: {
|
|
84
|
+
readonly compact: "chat_compaction_compact";
|
|
85
|
+
readonly get: "chat_compaction_get";
|
|
86
|
+
readonly regenerate: "chat_compaction_regenerate";
|
|
87
|
+
readonly reset: "chat_compaction_reset";
|
|
88
|
+
};
|
|
89
|
+
readonly conversations: {
|
|
90
|
+
readonly create: "chat_conversations_create";
|
|
91
|
+
readonly delete: "chat_conversations_delete";
|
|
92
|
+
readonly get: "chat_conversations_get";
|
|
93
|
+
readonly list: "chat_conversations_list";
|
|
94
|
+
readonly transcript: "chat_conversations_transcript";
|
|
95
|
+
readonly update: "chat_conversations_update";
|
|
96
|
+
};
|
|
97
|
+
readonly evidence: {
|
|
98
|
+
readonly resolve: "chat_evidence_resolve";
|
|
99
|
+
};
|
|
100
|
+
readonly feedback: {
|
|
101
|
+
readonly clear: "chat_feedback_clear";
|
|
102
|
+
readonly upsert: "chat_feedback_upsert";
|
|
103
|
+
};
|
|
104
|
+
readonly interactions: {
|
|
105
|
+
readonly respond: "chat_interactions_respond";
|
|
106
|
+
readonly stream: "chat_interactions_stream";
|
|
107
|
+
};
|
|
108
|
+
readonly permissions: {
|
|
109
|
+
readonly decideWait: "chat_permissions_decide_wait";
|
|
110
|
+
readonly list: "chat_permissions_list";
|
|
111
|
+
readonly revoke: "chat_permissions_revoke";
|
|
112
|
+
readonly update: "chat_permissions_update";
|
|
113
|
+
};
|
|
114
|
+
readonly placeContext: {
|
|
115
|
+
readonly get: "chat_place_context_get";
|
|
116
|
+
};
|
|
117
|
+
readonly presentation: {
|
|
118
|
+
readonly get: "chat_presentation_get";
|
|
119
|
+
readonly stream: "chat_presentation_stream";
|
|
120
|
+
};
|
|
121
|
+
readonly projects: {
|
|
122
|
+
readonly create: "chat_projects_create";
|
|
123
|
+
readonly delete: "chat_projects_delete";
|
|
124
|
+
readonly deleteFile: "chat_projects_delete_file";
|
|
125
|
+
readonly fileDownloadUrl: "chat_projects_file_download_url";
|
|
126
|
+
readonly list: "chat_projects_list";
|
|
127
|
+
readonly listFiles: "chat_projects_list_files";
|
|
128
|
+
readonly update: "chat_projects_update";
|
|
129
|
+
readonly uploadFile: "chat_projects_upload_file";
|
|
130
|
+
};
|
|
131
|
+
readonly queuedMessages: {
|
|
132
|
+
readonly create: "chat_queued_messages_create";
|
|
133
|
+
readonly delete: "chat_queued_messages_delete";
|
|
134
|
+
readonly list: "chat_queued_messages_list";
|
|
135
|
+
readonly update: "chat_queued_messages_update";
|
|
136
|
+
};
|
|
137
|
+
readonly skills: {
|
|
138
|
+
readonly list: "chat_skills_list";
|
|
139
|
+
};
|
|
140
|
+
readonly speech: {
|
|
141
|
+
readonly availability: "chat_speech_availability";
|
|
142
|
+
readonly createClip: "chat_speech_create_clip";
|
|
143
|
+
readonly readAloudPart: "chat_speech_read_aloud_part";
|
|
144
|
+
readonly transcribe: "chat_speech_transcribe";
|
|
145
|
+
};
|
|
146
|
+
readonly steeringMessages: {
|
|
147
|
+
readonly send: "chat_steering_messages_send";
|
|
148
|
+
};
|
|
149
|
+
readonly tools: {
|
|
150
|
+
readonly list: "chat_tools_list";
|
|
151
|
+
};
|
|
152
|
+
readonly turns: {
|
|
153
|
+
readonly cancel: "chat_turns_cancel";
|
|
154
|
+
readonly stream: "chat_turns_stream";
|
|
155
|
+
readonly submit: "chat_turns_submit";
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
type ChatOperations = typeof chatOperations;
|
|
159
|
+
/** The `chat_*` operation id of one method of the chat domain. */
|
|
160
|
+
type ChatOperationOf<Group extends keyof ChatOperations, Method extends keyof ChatOperations[Group]> = Extract<ChatOperations[Group][Method], ExternalApplicationChatOperationId>;
|
|
161
|
+
type ChatEffect<Id extends ExternalApplicationChatOperationId> = (input: ClientOperationMap[Id]["input"], options: OperationExecutionOptions) => Effect.Effect<ClientOperationMap[Id]["output"], CiError | CiTransportError>;
|
|
162
|
+
type ChatValue = Readonly<{ [Group in keyof ChatOperations]: Readonly<{ [Method in keyof ChatOperations[Group]]: ChatEffect<ChatOperationOf<Group, Method>>; }>; }>;
|
|
163
|
+
declare const Chat_base: Context.ServiceClass<Chat, "@collective-intelligence/external-apps-client-sdk/Chat", Readonly<{
|
|
164
|
+
readonly agentConversations: Readonly<{
|
|
165
|
+
readonly cancelTurn: ChatEffect<"chat_agent_conversations_cancel_turn">;
|
|
166
|
+
readonly close: ChatEffect<"chat_agent_conversations_close">;
|
|
167
|
+
readonly submitTurn: ChatEffect<"chat_agent_conversations_submit_turn">;
|
|
168
|
+
}>;
|
|
169
|
+
readonly agents: Readonly<{
|
|
170
|
+
readonly list: ChatEffect<"chat_agents_list">;
|
|
171
|
+
}>;
|
|
172
|
+
readonly approvals: Readonly<{
|
|
173
|
+
readonly decide: ChatEffect<"chat_approvals_decide">;
|
|
174
|
+
readonly get: ChatEffect<"chat_approvals_get">;
|
|
175
|
+
readonly reject: ChatEffect<"chat_approvals_reject">;
|
|
176
|
+
readonly search: ChatEffect<"chat_approvals_search">;
|
|
177
|
+
readonly searchRequests: ChatEffect<"chat_approvals_search_requests">;
|
|
178
|
+
readonly withdraw: ChatEffect<"chat_approvals_withdraw">;
|
|
179
|
+
}>;
|
|
180
|
+
readonly artifacts: Readonly<{
|
|
181
|
+
readonly progress: ChatEffect<"chat_artifacts_progress">;
|
|
182
|
+
}>;
|
|
183
|
+
readonly attachments: Readonly<{
|
|
184
|
+
readonly capabilities: ChatEffect<"chat_attachments_capabilities">;
|
|
185
|
+
readonly downloadUrl: ChatEffect<"chat_attachments_download_url">;
|
|
186
|
+
readonly upload: ChatEffect<"chat_attachments_upload">;
|
|
187
|
+
}>;
|
|
188
|
+
readonly compaction: Readonly<{
|
|
189
|
+
readonly compact: ChatEffect<"chat_compaction_compact">;
|
|
190
|
+
readonly get: ChatEffect<"chat_compaction_get">;
|
|
191
|
+
readonly regenerate: ChatEffect<"chat_compaction_regenerate">;
|
|
192
|
+
readonly reset: ChatEffect<"chat_compaction_reset">;
|
|
193
|
+
}>;
|
|
194
|
+
readonly conversations: Readonly<{
|
|
195
|
+
readonly create: ChatEffect<"chat_conversations_create">;
|
|
196
|
+
readonly delete: ChatEffect<"chat_conversations_delete">;
|
|
197
|
+
readonly get: ChatEffect<"chat_conversations_get">;
|
|
198
|
+
readonly list: ChatEffect<"chat_conversations_list">;
|
|
199
|
+
readonly transcript: ChatEffect<"chat_conversations_transcript">;
|
|
200
|
+
readonly update: ChatEffect<"chat_conversations_update">;
|
|
201
|
+
}>;
|
|
202
|
+
readonly evidence: Readonly<{
|
|
203
|
+
readonly resolve: ChatEffect<"chat_evidence_resolve">;
|
|
204
|
+
}>;
|
|
205
|
+
readonly feedback: Readonly<{
|
|
206
|
+
readonly clear: ChatEffect<"chat_feedback_clear">;
|
|
207
|
+
readonly upsert: ChatEffect<"chat_feedback_upsert">;
|
|
208
|
+
}>;
|
|
209
|
+
readonly interactions: Readonly<{
|
|
210
|
+
readonly respond: ChatEffect<"chat_interactions_respond">;
|
|
211
|
+
readonly stream: ChatEffect<"chat_interactions_stream">;
|
|
212
|
+
}>;
|
|
213
|
+
readonly permissions: Readonly<{
|
|
214
|
+
readonly decideWait: ChatEffect<"chat_permissions_decide_wait">;
|
|
215
|
+
readonly list: ChatEffect<"chat_permissions_list">;
|
|
216
|
+
readonly revoke: ChatEffect<"chat_permissions_revoke">;
|
|
217
|
+
readonly update: ChatEffect<"chat_permissions_update">;
|
|
218
|
+
}>;
|
|
219
|
+
readonly placeContext: Readonly<{
|
|
220
|
+
readonly get: ChatEffect<"chat_place_context_get">;
|
|
221
|
+
}>;
|
|
222
|
+
readonly presentation: Readonly<{
|
|
223
|
+
readonly get: ChatEffect<"chat_presentation_get">;
|
|
224
|
+
readonly stream: ChatEffect<"chat_presentation_stream">;
|
|
225
|
+
}>;
|
|
226
|
+
readonly projects: Readonly<{
|
|
227
|
+
readonly create: ChatEffect<"chat_projects_create">;
|
|
228
|
+
readonly delete: ChatEffect<"chat_projects_delete">;
|
|
229
|
+
readonly deleteFile: ChatEffect<"chat_projects_delete_file">;
|
|
230
|
+
readonly fileDownloadUrl: ChatEffect<"chat_projects_file_download_url">;
|
|
231
|
+
readonly list: ChatEffect<"chat_projects_list">;
|
|
232
|
+
readonly listFiles: ChatEffect<"chat_projects_list_files">;
|
|
233
|
+
readonly update: ChatEffect<"chat_projects_update">;
|
|
234
|
+
readonly uploadFile: ChatEffect<"chat_projects_upload_file">;
|
|
235
|
+
}>;
|
|
236
|
+
readonly queuedMessages: Readonly<{
|
|
237
|
+
readonly create: ChatEffect<"chat_queued_messages_create">;
|
|
238
|
+
readonly delete: ChatEffect<"chat_queued_messages_delete">;
|
|
239
|
+
readonly list: ChatEffect<"chat_queued_messages_list">;
|
|
240
|
+
readonly update: ChatEffect<"chat_queued_messages_update">;
|
|
241
|
+
}>;
|
|
242
|
+
readonly skills: Readonly<{
|
|
243
|
+
readonly list: ChatEffect<"chat_skills_list">;
|
|
244
|
+
}>;
|
|
245
|
+
readonly speech: Readonly<{
|
|
246
|
+
readonly availability: ChatEffect<"chat_speech_availability">;
|
|
247
|
+
readonly createClip: ChatEffect<"chat_speech_create_clip">;
|
|
248
|
+
readonly readAloudPart: ChatEffect<"chat_speech_read_aloud_part">;
|
|
249
|
+
readonly transcribe: ChatEffect<"chat_speech_transcribe">;
|
|
250
|
+
}>;
|
|
251
|
+
readonly steeringMessages: Readonly<{
|
|
252
|
+
readonly send: ChatEffect<"chat_steering_messages_send">;
|
|
253
|
+
}>;
|
|
254
|
+
readonly tools: Readonly<{
|
|
255
|
+
readonly list: ChatEffect<"chat_tools_list">;
|
|
256
|
+
}>;
|
|
257
|
+
readonly turns: Readonly<{
|
|
258
|
+
readonly cancel: ChatEffect<"chat_turns_cancel">;
|
|
259
|
+
readonly stream: ChatEffect<"chat_turns_stream">;
|
|
260
|
+
readonly submit: ChatEffect<"chat_turns_submit">;
|
|
261
|
+
}>;
|
|
262
|
+
}>>;
|
|
263
|
+
declare class Chat extends Chat_base {}
|
|
264
|
+
/** `Chat` over the `CiClient` of the context. */
|
|
265
|
+
declare const layer$1: Layer.Layer<Chat, never, CiClient>;
|
|
266
|
+
type ChatClient<Operations extends ClientOperationMap, Scoped extends boolean> = Readonly<{ [Group in keyof ChatOperations]: Readonly<{ [Method in keyof ChatOperations[Group]]: DomainOperation<Operations, ChatOperationOf<Group, Method>, Scoped>; }>; }>;
|
|
267
|
+
type CiStreamPage = ClientOperationOutput<ClientOperationMap, "runs_stream">;
|
|
268
|
+
type CiStreamEvent = CiStreamPage["events"][number];
|
|
269
|
+
type CiRunCancellation = ClientOperationOutput<ClientOperationMap, "runs_cancel">;
|
|
270
|
+
declare const nextStreamCursor: (page: CiStreamPage) => string | null;
|
|
271
|
+
type RunFollowOptions = Readonly<{
|
|
272
|
+
/** Total wait before the follow fails with `CiError` `unavailable`. */
|
|
273
|
+
deadlineMs?: number;
|
|
274
|
+
/**
|
|
275
|
+
* First wait between polls in milliseconds (default 50). It doubles while
|
|
276
|
+
* no new event arrives, up to one second or `idleMs` if larger.
|
|
277
|
+
*/
|
|
278
|
+
idleMs?: number;
|
|
279
|
+
runId: string;
|
|
280
|
+
}>;
|
|
281
|
+
/**
|
|
282
|
+
* Ten minutes: a skill run's five-minute AI deadline plus queueing and
|
|
283
|
+
* delivery slack. Long runs return a `runId` immediately; follow is how
|
|
284
|
+
* callers wait for their outcome.
|
|
285
|
+
*/
|
|
286
|
+
declare const DEFAULT_FOLLOW_RUN_DEADLINE_MS = 600000;
|
|
287
|
+
type RunsValue = Readonly<{
|
|
288
|
+
/**
|
|
289
|
+
* Follows a run of `organizationId` until it finishes, and succeeds with
|
|
290
|
+
* its last event page. A failed read fails with its `CiError`; a run that
|
|
291
|
+
* does not finish before the deadline fails with `CiError` `unavailable`.
|
|
292
|
+
*/
|
|
293
|
+
follow: (options: RunFollowOptions & Readonly<{
|
|
294
|
+
organizationId: string;
|
|
295
|
+
}>) => Effect.Effect<CiStreamPage, CiError | CiTransportError>;
|
|
296
|
+
}>;
|
|
297
|
+
declare const Runs_base: Context.ServiceClass<Runs, "@collective-intelligence/external-apps-client-sdk/Runs", Readonly<{
|
|
298
|
+
/**
|
|
299
|
+
* Follows a run of `organizationId` until it finishes, and succeeds with
|
|
300
|
+
* its last event page. A failed read fails with its `CiError`; a run that
|
|
301
|
+
* does not finish before the deadline fails with `CiError` `unavailable`.
|
|
302
|
+
*/
|
|
303
|
+
follow: (options: RunFollowOptions & Readonly<{
|
|
304
|
+
organizationId: string;
|
|
305
|
+
}>) => Effect.Effect<CiStreamPage, CiError | CiTransportError>;
|
|
306
|
+
}>>;
|
|
307
|
+
declare class Runs extends Runs_base {}
|
|
308
|
+
/** `Runs` over the `CiClient` of the context. */
|
|
309
|
+
declare const layer: Layer.Layer<Runs, never, CiClient>;
|
|
310
|
+
type FollowRunSource = Readonly<{
|
|
311
|
+
get: (input: Readonly<{
|
|
312
|
+
runId: string;
|
|
313
|
+
}>) => Promise<CiResult<unknown>>;
|
|
314
|
+
stream: (input: Readonly<{
|
|
315
|
+
afterCursor?: string;
|
|
316
|
+
runId: string;
|
|
317
|
+
}>) => Promise<CiResult<CiStreamPage>>;
|
|
318
|
+
}>;
|
|
319
|
+
type FollowRunOptions = Readonly<{
|
|
320
|
+
/**
|
|
321
|
+
* Total wait before `followRun` rejects with `CiError` `unavailable`
|
|
322
|
+
* ("Run did not finish"). Defaults to
|
|
323
|
+
* {@link DEFAULT_FOLLOW_RUN_DEADLINE_MS}.
|
|
324
|
+
*/
|
|
325
|
+
deadlineMs?: number;
|
|
326
|
+
/**
|
|
327
|
+
* First wait between polls in milliseconds (default 50). It doubles while
|
|
328
|
+
* no new event arrives, up to one second or `idleMs` if larger.
|
|
329
|
+
*/
|
|
330
|
+
idleMs?: number;
|
|
331
|
+
now?: () => number;
|
|
332
|
+
runId: string;
|
|
333
|
+
/** Stops following and cancels in-flight requests made by `runs.follow`. */
|
|
334
|
+
signal?: AbortSignal;
|
|
335
|
+
sleep?: (ms: number) => Promise<void>;
|
|
336
|
+
}>;
|
|
337
|
+
/**
|
|
338
|
+
* Follows dedicated run events until a terminal event or snapshot status.
|
|
339
|
+
* Resolves with the last event page read. A failed read rejects with its
|
|
340
|
+
* `CiError`; a source that rejects gives `CiTransportError`; an abort
|
|
341
|
+
* rejects with `signal.reason`.
|
|
342
|
+
*/
|
|
343
|
+
declare const followRun: (runs: FollowRunSource, options: FollowRunOptions) => Promise<CiStreamPage>;
|
|
344
|
+
declare const clientSdkProtocolVersion: "v1";
|
|
345
|
+
type SignalOptions = Readonly<{
|
|
346
|
+
signal?: AbortSignal;
|
|
347
|
+
}>;
|
|
348
|
+
type FollowRunCall<Scoped extends boolean> = Scoped extends true ? (options: FollowRunOptions) => Promise<CiStreamPage> : (options: FollowRunOptions & Readonly<{
|
|
349
|
+
organizationId: string;
|
|
350
|
+
}>) => Promise<CiStreamPage>;
|
|
351
|
+
type ScopedOperation<Operations extends ClientOperationMap, Id extends ClientOperationId> = (input: ClientOperationInput<Operations, Id>, options?: SignalOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
|
|
352
|
+
type RootOperation<Operations extends ClientOperationMap, Id extends ClientOperationId> = (input: ClientOperationInput<Operations, Id> & Readonly<{
|
|
353
|
+
organizationId: string;
|
|
354
|
+
}>, options?: SignalOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
|
|
355
|
+
/** Internal. One domain method: organization-bound when `Scoped`. */
|
|
356
|
+
type DomainOperation<Operations extends ClientOperationMap, Id extends ClientOperationId, Scoped extends boolean> = Scoped extends true ? ScopedOperation<Operations, Id> : RootOperation<Operations, Id>;
|
|
357
|
+
type ClientDomains<Operations extends ClientOperationMap, Scoped extends boolean> = Readonly<{
|
|
358
|
+
agents: Readonly<{
|
|
359
|
+
invoke: DomainOperation<Operations, "agents_invoke", Scoped>;
|
|
360
|
+
list: DomainOperation<Operations, "agents_list", Scoped>;
|
|
361
|
+
}>;
|
|
362
|
+
attachments: Readonly<{
|
|
363
|
+
downloadUrl: DomainOperation<Operations, "attachments_download_url", Scoped>;
|
|
364
|
+
upload: DomainOperation<Operations, "attachments_upload", Scoped>;
|
|
365
|
+
}>;
|
|
366
|
+
/** The External App chat (`/chat/...`), for a signed-in app user. */
|
|
367
|
+
chat: ChatClient<Operations, Scoped>;
|
|
368
|
+
context: Readonly<{
|
|
369
|
+
get: DomainOperation<Operations, "context_get", Scoped>;
|
|
370
|
+
}>;
|
|
371
|
+
knowledge: Readonly<{
|
|
372
|
+
autocomplete: DomainOperation<Operations, "knowledge_autocomplete", Scoped>;
|
|
373
|
+
createEntity: DomainOperation<Operations, "knowledge_create_entity", Scoped>;
|
|
374
|
+
deleteEntity: DomainOperation<Operations, "knowledge_delete_entity", Scoped>;
|
|
375
|
+
facets: DomainOperation<Operations, "knowledge_facets", Scoped>;
|
|
376
|
+
getEntity: DomainOperation<Operations, "knowledge_get_entity", Scoped>;
|
|
377
|
+
getEntitySchemaSnapshot: DomainOperation<Operations, "knowledge_get_entity_schema_snapshot", Scoped>;
|
|
378
|
+
getSchemaQueryContext: DomainOperation<Operations, "knowledge_get_schema_query_context", Scoped>;
|
|
379
|
+
query: DomainOperation<Operations, "knowledge_query", Scoped>;
|
|
380
|
+
searchEntities: DomainOperation<Operations, "knowledge_search_entities", Scoped>;
|
|
381
|
+
updateEntity: DomainOperation<Operations, "knowledge_update_entity", Scoped>;
|
|
382
|
+
upsertEntity: DomainOperation<Operations, "knowledge_upsert_entity", Scoped>;
|
|
383
|
+
}>;
|
|
384
|
+
runs: Readonly<{
|
|
385
|
+
cancel: DomainOperation<Operations, "runs_cancel", Scoped>;
|
|
386
|
+
follow: FollowRunCall<Scoped>;
|
|
387
|
+
get: DomainOperation<Operations, "runs_get", Scoped>;
|
|
388
|
+
stream: DomainOperation<Operations, "runs_stream", Scoped>;
|
|
389
|
+
}>;
|
|
390
|
+
skills: Readonly<{
|
|
391
|
+
invoke: DomainOperation<Operations, "skills_invoke", Scoped>;
|
|
392
|
+
list: DomainOperation<Operations, "skills_list", Scoped>;
|
|
393
|
+
}>;
|
|
394
|
+
workflows: Readonly<{
|
|
395
|
+
invoke: DomainOperation<Operations, "workflows_invoke", Scoped>;
|
|
396
|
+
list: DomainOperation<Operations, "workflows_list", Scoped>;
|
|
397
|
+
}>;
|
|
398
|
+
}>;
|
|
399
|
+
type OrganizationClient<Operations extends ClientOperationMap> = ClientDomains<Operations, true> & Readonly<{
|
|
400
|
+
organizationId: string;
|
|
401
|
+
}>;
|
|
402
|
+
type ClientSdkClient<Operations extends ClientOperationMap> = Omit<ClientDomains<Operations, false>, "context"> & TypedOperationExecutor<Operations> & Readonly<{
|
|
403
|
+
context: ClientDomains<Operations, false>["context"] & Readonly<{
|
|
404
|
+
forOrganization: (organizationId: string) => OrganizationClient<Operations>;
|
|
405
|
+
}>;
|
|
406
|
+
forOrganization: (organizationId: string) => OrganizationClient<Operations>;
|
|
407
|
+
protocolVersion: typeof clientSdkProtocolVersion;
|
|
408
|
+
}>;
|
|
409
|
+
type ClientSdkEntrypoint = Readonly<{
|
|
410
|
+
protocolVersion: typeof clientSdkProtocolVersion;
|
|
411
|
+
}>;
|
|
412
|
+
/**
|
|
413
|
+
* The Vanilla Facade of `CiClient` and `Runs` over `transport`, in one
|
|
414
|
+
* runtime; `close` disposes it. A CI error answer resolves
|
|
415
|
+
* `{ ok: false, error }` with a `CiError`; `runs.follow` rejects with it. A
|
|
416
|
+
* transport failure rejects with `CiTransportError`, an abort with
|
|
417
|
+
* `signal.reason`.
|
|
418
|
+
*/
|
|
419
|
+
declare const createClient: <Operations extends ClientOperationMap>(options: {
|
|
420
|
+
readonly transport: TypedOperationExecutor<Operations>;
|
|
421
|
+
}) => ClientSdkClient<Operations> & Readonly<{
|
|
422
|
+
close: () => Promise<void>;
|
|
423
|
+
}>;
|
|
424
|
+
export { layerProxyConfig as A, CiClient as C, layerDirectConfig as D, layerDirect as E, createDirectTransport as M, layerFromExecutor as O, layer$1 as S, ExecuteResult as T, CiStreamPage as _, clientSdkProtocolVersion as a, Chat as b, FollowRunSource as c, RunFollowOptions as d, Runs as f, CiStreamEvent as g, CiRunCancellation as h, OrganizationClient as i, DirectTransportOptions as j, layerProxy as k, followRun as l, layer as m, ClientSdkClient as n, createClient as o, RunsValue as p, ClientSdkEntrypoint as r, FollowRunOptions as s, ClientDomains as t, DEFAULT_FOLLOW_RUN_DEADLINE_MS as u, nextStreamCursor as v, CiClientValue as w, ChatValue as x, ChatClient as y };
|
package/dist/effect.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { A as FederatedAuthError, D as CiError, O as CiErrorCode, d as FederatedAuthValue, f as layerFederated, h as layerServerSessionConfig, i as ClientFetch, j as FederatedAuthErrorCode, k as CiTransportError, m as layerServerSession, p as layerFederatedConfig, u as FederatedAuth } from "./proxy-DRPEFvaV.js";
|
|
2
|
+
import { A as layerProxyConfig, C as CiClient, D as layerDirectConfig, E as layerDirect, O as layerFromExecutor, S as layer, T as ExecuteResult, _ as CiStreamPage$1, b as Chat, d as RunFollowOptions, f as Runs, k as layerProxy, m as layer$5, p as RunsValue, u as DEFAULT_FOLLOW_RUN_DEADLINE_MS, w as CiClientValue, x as ChatValue } from "./client-_rl-iXS8.js";
|
|
3
|
+
import { C as RealtimeChange, T as RealtimeTopicFilter, f as DelegatedApplicationRuntimeOptions, p as DelegatedRuntimeState, w as RealtimeTopic } from "./index-DFCHAlar.js";
|
|
4
|
+
import { _ as layerLegacy, a as LegacyResourceClient, c as LegacyResourcesValue, d as ResourcesFromEntityTransportOptions, f as ResourcesLayerOptions, g as layerFromEntityTransport, h as layerConfig$3, i as makeEntityHttpExecute, l as ResourceEntityClient, m as layer$4, o as LegacyResources, p as ResourcesValue, s as LegacyResourcesLayerOptions, u as Resources, v as layerLegacyConfig } from "./resources-r2t8pcv2.js";
|
|
3
5
|
import * as Schema from "effect/Schema";
|
|
4
6
|
import * as Config from "effect/Config";
|
|
5
7
|
import * as Context from "effect/Context";
|
|
@@ -72,7 +74,7 @@ type RealtimeClientLayerOptions = Readonly<{
|
|
|
72
74
|
onRefused?: () => void;
|
|
73
75
|
}>;
|
|
74
76
|
/** `RealtimeClient` with the `fetch` of `FetchHttpClient.Fetch` and the page of this runtime. */
|
|
75
|
-
declare const layer$
|
|
77
|
+
declare const layer$3: (options: RealtimeClientLayerOptions) => Layer.Layer<RealtimeClient, never, never>;
|
|
76
78
|
/** `layer` with options that Effect `Config` reads. */
|
|
77
79
|
declare const layerConfig$2: (config: Config.Wrap<RealtimeClientLayerOptions>) => Layer.Layer<RealtimeClient, Config.ConfigError, never>;
|
|
78
80
|
/** The changes and Resyncs of `topic` from the `RealtimeClient` of the context. */
|
|
@@ -100,7 +102,7 @@ type FixedWorkflowsLayerOptions = Readonly<{
|
|
|
100
102
|
fetch?: ClientFetch;
|
|
101
103
|
}>;
|
|
102
104
|
/** `FixedWorkflows` over the `fetch` of `options`. */
|
|
103
|
-
declare const layer$
|
|
105
|
+
declare const layer$2: (options?: FixedWorkflowsLayerOptions) => Layer.Layer<FixedWorkflows, never, never>;
|
|
104
106
|
/** `layer` with options that Effect `Config` reads. */
|
|
105
107
|
declare const layerConfig$1: (config: Config.Wrap<FixedWorkflowsLayerOptions>) => Layer.Layer<FixedWorkflows, Config.ConfigError, never>;
|
|
106
108
|
type FollowError = CiError | CiTransportError | FederatedAuthError;
|
|
@@ -142,7 +144,7 @@ declare class DelegatedRuntime extends DelegatedRuntime_base {}
|
|
|
142
144
|
* `FederatedAuth`, `CiClient` and `Runs`. A bad `authBasePath` fails with
|
|
143
145
|
* `configuration_error`; a bad `origin` or `proxyPath` dies with `TypeError`.
|
|
144
146
|
*/
|
|
145
|
-
declare const layer: (options: DelegatedApplicationRuntimeOptions) => Layer.Layer<
|
|
147
|
+
declare const layer$1: (options: DelegatedApplicationRuntimeOptions) => Layer.Layer<CiClient | Runs | FederatedAuth | DelegatedRuntime, FederatedAuthError, never>;
|
|
146
148
|
/** `layer` with options that Effect `Config` reads. */
|
|
147
|
-
declare const layerConfig: (config: Config.Wrap<DelegatedApplicationRuntimeOptions>) => Layer.Layer<
|
|
148
|
-
export { CiClient, type CiClientValue, CiError, CiErrorCode, CiErrorEnvelope, CiResult, CiStreamPage, CiTransportError, DEFAULT_FOLLOW_RUN_DEADLINE_MS, DelegatedRuntime, type DelegatedRuntimeValue, type ExecuteResult, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, type FederatedAuthValue, type FixedWorkflowRequest, FixedWorkflows, type FixedWorkflowsLayerOptions, type FixedWorkflowsValue, type LegacyResourceClient, LegacyResources, type LegacyResourcesLayerOptions, type LegacyResourcesValue, type RealtimeChange, RealtimeClient, type RealtimeClientLayerOptions, type RealtimeResync, type RealtimeTopic, type RealtimeTopicFilter, type RealtimeUpdate, type ResourceEntityClient, Resources, type ResourcesFromEntityTransportOptions, type ResourcesLayerOptions, type ResourcesValue, type RunFollowOptions, Runs, type RunsValue, layerDirect as layerCiClientDirect, layerDirectConfig as layerCiClientDirectConfig, layerFromExecutor as layerCiClientFromExecutor, layerProxy as layerCiClientProxy, layerProxyConfig as layerCiClientProxyConfig, layer as layerDelegatedRuntime, layerConfig as layerDelegatedRuntimeConfig, layerFederated as layerFederatedAuth, layerFederatedConfig as layerFederatedAuthConfig, layer$
|
|
149
|
+
declare const layerConfig: (config: Config.Wrap<DelegatedApplicationRuntimeOptions>) => Layer.Layer<CiClient | Runs | FederatedAuth | DelegatedRuntime, Config.ConfigError | FederatedAuthError, never>;
|
|
150
|
+
export { Chat, type ChatValue, CiClient, type CiClientValue, CiError, CiErrorCode, CiErrorEnvelope, CiResult, CiStreamPage, CiTransportError, DEFAULT_FOLLOW_RUN_DEADLINE_MS, DelegatedRuntime, type DelegatedRuntimeValue, type ExecuteResult, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, type FederatedAuthValue, type FixedWorkflowRequest, FixedWorkflows, type FixedWorkflowsLayerOptions, type FixedWorkflowsValue, type LegacyResourceClient, LegacyResources, type LegacyResourcesLayerOptions, type LegacyResourcesValue, type RealtimeChange, RealtimeClient, type RealtimeClientLayerOptions, type RealtimeResync, type RealtimeTopic, type RealtimeTopicFilter, type RealtimeUpdate, type ResourceEntityClient, Resources, type ResourcesFromEntityTransportOptions, type ResourcesLayerOptions, type ResourcesValue, type RunFollowOptions, Runs, type RunsValue, layer as layerChat, layerDirect as layerCiClientDirect, layerDirectConfig as layerCiClientDirectConfig, layerFromExecutor as layerCiClientFromExecutor, layerProxy as layerCiClientProxy, layerProxyConfig as layerCiClientProxyConfig, layer$1 as layerDelegatedRuntime, layerConfig as layerDelegatedRuntimeConfig, layerFederated as layerFederatedAuth, layerFederatedConfig as layerFederatedAuthConfig, layer$2 as layerFixedWorkflows, layerConfig$1 as layerFixedWorkflowsConfig, layerLegacy as layerLegacyResources, layerLegacyConfig as layerLegacyResourcesConfig, layer$3 as layerRealtimeClient, layerConfig$2 as layerRealtimeClientConfig, layer$4 as layerResources, layerConfig$3 as layerResourcesConfig, layerFromEntityTransport as layerResourcesFromEntityTransport, layer$5 as layerRuns, layerServerSession as layerServerSessionAuth, layerServerSessionConfig as layerServerSessionAuthConfig, makeEntityHttpExecute, subscribe };
|
package/dist/effect.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as FederatedAuthErrorCode, i as FederatedAuthError, n as CiErrorCode, r as CiTransportError, t as CiError } from "./errors-C3UmgGGu.js";
|
|
2
|
+
import { a as layerConfig$3, c as layerLegacyConfig, f as makeEntityHttpExecute, i as layer$4, n as Resources, o as layerFromEntityTransport, s as layerLegacy, t as LegacyResources } from "./service-l8wUAlPK.js";
|
|
3
|
+
import { A as subscribe, C as layerProxy, D as layer$3, E as RealtimeClient, O as layerConfig$2, S as layerFromExecutor, a as layer$2, b as layerDirect, c as layerFederated, d as layerServerSessionConfig, f as Chat, g as Runs, h as DEFAULT_FOLLOW_RUN_DEADLINE_MS, i as FixedWorkflows, l as layerFederatedConfig, n as layer$1, o as layerConfig$1, p as layer, r as layerConfig, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layer$5, w as layerProxyConfig, x as layerDirectConfig, y as CiClient } from "./service-D-POpqlt.js";
|
|
3
4
|
import * as Schema from "effect/Schema";
|
|
4
5
|
/**
|
|
5
6
|
* The wire Schemas of the CI envelopes that `./effect` exports. The Type of
|
|
@@ -29,4 +30,4 @@ const CiStreamPage = Schema.Struct({
|
|
|
29
30
|
events: Schema.mutableKey(Schema.mutable(Schema.Array(Schema.JsonObject))),
|
|
30
31
|
nextCursor: Schema.mutableKey(Schema.NullOr(Schema.String))
|
|
31
32
|
});
|
|
32
|
-
export { CiClient, CiError, CiErrorCode, CiErrorEnvelope, CiResult, CiStreamPage, CiTransportError, DEFAULT_FOLLOW_RUN_DEADLINE_MS, DelegatedRuntime, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, FixedWorkflows, LegacyResources, RealtimeClient, Resources, Runs, layerDirect as layerCiClientDirect, layerDirectConfig as layerCiClientDirectConfig, layerFromExecutor as layerCiClientFromExecutor, layerProxy as layerCiClientProxy, layerProxyConfig as layerCiClientProxyConfig, layer as layerDelegatedRuntime, layerConfig as layerDelegatedRuntimeConfig, layerFederated as layerFederatedAuth, layerFederatedConfig as layerFederatedAuthConfig, layer$
|
|
33
|
+
export { Chat, CiClient, CiError, CiErrorCode, CiErrorEnvelope, CiResult, CiStreamPage, CiTransportError, DEFAULT_FOLLOW_RUN_DEADLINE_MS, DelegatedRuntime, FederatedAuth, FederatedAuthError, FederatedAuthErrorCode, FixedWorkflows, LegacyResources, RealtimeClient, Resources, Runs, layer as layerChat, layerDirect as layerCiClientDirect, layerDirectConfig as layerCiClientDirectConfig, layerFromExecutor as layerCiClientFromExecutor, layerProxy as layerCiClientProxy, layerProxyConfig as layerCiClientProxyConfig, layer$1 as layerDelegatedRuntime, layerConfig as layerDelegatedRuntimeConfig, layerFederated as layerFederatedAuth, layerFederatedConfig as layerFederatedAuthConfig, layer$2 as layerFixedWorkflows, layerConfig$1 as layerFixedWorkflowsConfig, layerLegacy as layerLegacyResources, layerLegacyConfig as layerLegacyResourcesConfig, layer$3 as layerRealtimeClient, layerConfig$2 as layerRealtimeClientConfig, layer$4 as layerResources, layerConfig$3 as layerResourcesConfig, layerFromEntityTransport as layerResourcesFromEntityTransport, layer$5 as layerRuns, layerServerSession as layerServerSessionAuth, layerServerSessionConfig as layerServerSessionAuthConfig, makeEntityHttpExecute, subscribe };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as Predicate from "effect/Predicate";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
21
|
+
key = keys[i];
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
23
|
+
get: ((k) => from[k]).bind(null, key),
|
|
24
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
/** Codes of the Expected Errors that CI returns. The `CiErrorCode` Schema of `./effect` uses this list. */
|
|
34
|
+
const ciErrorCodes = [
|
|
35
|
+
"unauthenticated",
|
|
36
|
+
"forbidden",
|
|
37
|
+
"not_found",
|
|
38
|
+
"conflict",
|
|
39
|
+
"invalid_request",
|
|
40
|
+
"rate_limited",
|
|
41
|
+
"unavailable",
|
|
42
|
+
"internal"
|
|
43
|
+
];
|
|
44
|
+
var errors_exports = /* @__PURE__ */ __exportAll({
|
|
45
|
+
CiError: () => CiError,
|
|
46
|
+
CiErrorCode: () => CiErrorCode,
|
|
47
|
+
CiTransportError: () => CiTransportError,
|
|
48
|
+
FederatedAuthError: () => FederatedAuthError,
|
|
49
|
+
FederatedAuthErrorCode: () => FederatedAuthErrorCode
|
|
50
|
+
});
|
|
51
|
+
/** Code of an Expected Error that CI returns for an operation. */
|
|
52
|
+
const CiErrorCode = Schema.Literals(ciErrorCodes);
|
|
53
|
+
/** Code of an Expected Error of the federated sign-in flow. */
|
|
54
|
+
const FederatedAuthErrorCode = Schema.Literals([
|
|
55
|
+
"configuration_error",
|
|
56
|
+
"invalid_return_target",
|
|
57
|
+
"invalid_callback",
|
|
58
|
+
"invalid_state",
|
|
59
|
+
"transaction_expired",
|
|
60
|
+
"authorization_failed",
|
|
61
|
+
"token_exchange_failed",
|
|
62
|
+
"reauthorization_required"
|
|
63
|
+
]);
|
|
64
|
+
/** An Expected Error that CI returns for an operation. */
|
|
65
|
+
var CiError = class extends Schema.TaggedError()("CiError", {
|
|
66
|
+
code: CiErrorCode,
|
|
67
|
+
details: Schema.optionalKey(Schema.Record(Schema.String, Schema.Json)),
|
|
68
|
+
message: Schema.String,
|
|
69
|
+
retryable: Schema.Boolean
|
|
70
|
+
}) {};
|
|
71
|
+
/** An Expected Error of the federated sign-in flow. */
|
|
72
|
+
var FederatedAuthError = class extends Schema.TaggedError()("FederatedAuthError", {
|
|
73
|
+
code: FederatedAuthErrorCode,
|
|
74
|
+
message: Schema.String
|
|
75
|
+
}) {
|
|
76
|
+
constructor(first, second) {
|
|
77
|
+
if (Predicate.isString(first)) super({
|
|
78
|
+
code: first,
|
|
79
|
+
message: Predicate.isString(second) ? second : ""
|
|
80
|
+
});
|
|
81
|
+
else super(first, Predicate.isString(second) ? void 0 : second);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
/** The request did not reach CI, or CI's response was not readable. */
|
|
85
|
+
var CiTransportError = class extends Schema.TaggedError()("CiTransportError", { cause: Schema.Defect() }) {};
|
|
86
|
+
export { FederatedAuthErrorCode as a, __commonJSMin as c, FederatedAuthError as i, __toESM as l, CiErrorCode as n, errors_exports as o, CiTransportError as r, ciErrorCodes as s, CiError as t };
|