@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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as CiTransportError } from "./errors-C3UmgGGu.js";
|
|
2
|
+
import { l as makeEntityCore, p as runEntityRequest, r as fromEntityTransport, u as makeLegacyResourceCore } from "./service-l8wUAlPK.js";
|
|
2
3
|
import * as Schema from "effect/Schema";
|
|
3
4
|
import * as Layer from "effect/Layer";
|
|
4
5
|
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
@@ -1,519 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { D as CiError, i as ClientFetch, k as CiTransportError, t as ProxyAuthentication } from "./proxy-DRPEFvaV.js";
|
|
2
2
|
import * as Config from "effect/Config";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import * as Layer from "effect/Layer";
|
|
6
|
-
import * as Stream from "effect/Stream";
|
|
7
6
|
import "effect/ManagedRuntime";
|
|
8
|
-
/** Code of an Expected Error that CI returns for an operation. */
|
|
9
|
-
declare const CiErrorCode$1: Schema.Literals<readonly ["unauthenticated", "forbidden", "not_found", "conflict", "invalid_request", "rate_limited", "unavailable", "internal"]>;
|
|
10
|
-
type CiErrorCode$1 = typeof CiErrorCode$1.Type;
|
|
11
|
-
/** Code of an Expected Error of the federated sign-in flow. */
|
|
12
|
-
declare const FederatedAuthErrorCode: Schema.Literals<readonly ["configuration_error", "invalid_return_target", "invalid_callback", "invalid_state", "transaction_expired", "authorization_failed", "token_exchange_failed", "reauthorization_required"]>;
|
|
13
|
-
type FederatedAuthErrorCode = typeof FederatedAuthErrorCode.Type;
|
|
14
|
-
declare const CiError_base: Schema.Class<CiError$1, Schema.TaggedStruct<"CiError", {
|
|
15
|
-
readonly code: Schema.Literals<readonly ["unauthenticated", "forbidden", "not_found", "conflict", "invalid_request", "rate_limited", "unavailable", "internal"]>;
|
|
16
|
-
readonly details: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
17
|
-
readonly message: Schema.String;
|
|
18
|
-
readonly retryable: Schema.Boolean;
|
|
19
|
-
}>, import("effect/Cause").YieldableError>;
|
|
20
|
-
/** An Expected Error that CI returns for an operation. */
|
|
21
|
-
declare class CiError$1 extends CiError_base {}
|
|
22
|
-
type FederatedAuthErrorFields = Readonly<{
|
|
23
|
-
code: FederatedAuthErrorCode;
|
|
24
|
-
message: string;
|
|
25
|
-
}>;
|
|
26
|
-
declare const FederatedAuthError_base: Schema.Class<FederatedAuthError, Schema.TaggedStruct<"FederatedAuthError", {
|
|
27
|
-
readonly code: Schema.Literals<readonly ["configuration_error", "invalid_return_target", "invalid_callback", "invalid_state", "transaction_expired", "authorization_failed", "token_exchange_failed", "reauthorization_required"]>;
|
|
28
|
-
readonly message: Schema.String;
|
|
29
|
-
}>, import("effect/Cause").YieldableError>;
|
|
30
|
-
/** An Expected Error of the federated sign-in flow. */
|
|
31
|
-
declare class FederatedAuthError extends FederatedAuthError_base {
|
|
32
|
-
constructor(fields: FederatedAuthErrorFields, options?: Schema.MakeOptions);
|
|
33
|
-
/** The positional form that `.` callers used before the tagged class. */
|
|
34
|
-
constructor(code: FederatedAuthErrorCode, message: string);
|
|
35
|
-
}
|
|
36
|
-
declare const CiTransportError_base: Schema.Class<CiTransportError, Schema.TaggedStruct<"CiTransportError", {
|
|
37
|
-
readonly cause: Schema.Defect;
|
|
38
|
-
}>, import("effect/Cause").YieldableError>;
|
|
39
|
-
/** The request did not reach CI, or CI's response was not readable. */
|
|
40
|
-
declare class CiTransportError extends CiTransportError_base {}
|
|
41
|
-
type ServerSessionAuthOptions = Readonly<{
|
|
42
|
-
basePath: string;
|
|
43
|
-
fetch?: ClientFetch;
|
|
44
|
-
navigate?: (url: string) => void;
|
|
45
|
-
now?: () => number;
|
|
46
|
-
origin?: string;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* Browser session client for a sealed-cookie BFF. The access token never
|
|
50
|
-
* leaves the server. A bad option throws `FederatedAuthError`
|
|
51
|
-
* `configuration_error`. `close` disposes the runtime of the client.
|
|
52
|
-
*/
|
|
53
|
-
declare const createServerSessionAuth: (options: ServerSessionAuthOptions) => FederatedAuth & Readonly<{
|
|
54
|
-
close: () => Promise<void>;
|
|
55
|
-
}>;
|
|
56
|
-
type ReturnTarget = Readonly<{
|
|
57
|
-
returnTo: string;
|
|
58
|
-
}>;
|
|
59
|
-
type FederatedAuthValue = Readonly<{
|
|
60
|
-
beginLogin: (options: ReturnTarget) => Effect.Effect<string, FederatedAuthError>;
|
|
61
|
-
completeLogin: (callbackUrl: string) => Effect.Effect<ReturnTarget, FederatedAuthError | CiTransportError>;
|
|
62
|
-
getAccessToken: Effect.Effect<string, FederatedAuthError>;
|
|
63
|
-
logout: Effect.Effect<void>;
|
|
64
|
-
reauthorize: (options?: Readonly<{
|
|
65
|
-
returnTo?: string;
|
|
66
|
-
}>) => Effect.Effect<string, FederatedAuthError>;
|
|
67
|
-
/** The current state, read at once. */
|
|
68
|
-
getState: () => FederatedAuthState;
|
|
69
|
-
/** Calls `listener` at each state change, in the call that changes it. */
|
|
70
|
-
subscribe: (listener: (state: FederatedAuthState) => void) => () => void;
|
|
71
|
-
/** Each state change, from the subscription on. */
|
|
72
|
-
changes: Stream.Stream<FederatedAuthState>;
|
|
73
|
-
}>;
|
|
74
|
-
declare const FederatedAuth_base: Context.ServiceClass<FederatedAuth$1, "@collective-intelligence/external-apps-client-sdk/FederatedAuth", Readonly<{
|
|
75
|
-
beginLogin: (options: ReturnTarget) => Effect.Effect<string, FederatedAuthError>;
|
|
76
|
-
completeLogin: (callbackUrl: string) => Effect.Effect<ReturnTarget, FederatedAuthError | CiTransportError>;
|
|
77
|
-
getAccessToken: Effect.Effect<string, FederatedAuthError>;
|
|
78
|
-
logout: Effect.Effect<void>;
|
|
79
|
-
reauthorize: (options?: Readonly<{
|
|
80
|
-
returnTo?: string;
|
|
81
|
-
}>) => Effect.Effect<string, FederatedAuthError>;
|
|
82
|
-
/** The current state, read at once. */
|
|
83
|
-
getState: () => FederatedAuthState;
|
|
84
|
-
/** Calls `listener` at each state change, in the call that changes it. */
|
|
85
|
-
subscribe: (listener: (state: FederatedAuthState) => void) => () => void;
|
|
86
|
-
/** Each state change, from the subscription on. */
|
|
87
|
-
changes: Stream.Stream<FederatedAuthState>;
|
|
88
|
-
}>>;
|
|
89
|
-
declare class FederatedAuth$1 extends FederatedAuth_base {}
|
|
90
|
-
/** `FederatedAuth` of browser federated sign-in; a bad option fails with `configuration_error`. */
|
|
91
|
-
declare const layerFederated: (options: FederatedAuthOptions) => Layer.Layer<FederatedAuth$1, FederatedAuthError, never>;
|
|
92
|
-
/** `FederatedAuth` of a sealed-cookie BFF session; a bad option fails with `configuration_error`. */
|
|
93
|
-
declare const layerServerSession: (options: ServerSessionAuthOptions) => Layer.Layer<FederatedAuth$1, FederatedAuthError, never>;
|
|
94
|
-
/** `layerFederated` with options that Effect `Config` reads. */
|
|
95
|
-
declare const layerFederatedConfig: (config: Config.Wrap<FederatedAuthOptions>) => Layer.Layer<FederatedAuth$1, FederatedAuthError | Config.ConfigError, never>;
|
|
96
|
-
/** `layerServerSession` with options that Effect `Config` reads. */
|
|
97
|
-
declare const layerServerSessionConfig: (config: Config.Wrap<ServerSessionAuthOptions>) => Layer.Layer<FederatedAuth$1, FederatedAuthError | Config.ConfigError, never>;
|
|
98
|
-
/**
|
|
99
|
-
* The signed-in CI user as the application's BFF reports it: the fields of
|
|
100
|
-
* CI's `/oauth/identity`, read live by the server, plus email and name.
|
|
101
|
-
*/
|
|
102
|
-
type FederatedSessionIdentity = Readonly<{
|
|
103
|
-
appId: string;
|
|
104
|
-
email: string | null;
|
|
105
|
-
/**
|
|
106
|
-
* A person is a member or a guest of one Organization, never both; null
|
|
107
|
-
* for a tenant user without a membership.
|
|
108
|
-
*/
|
|
109
|
-
kind: "member" | "guest" | null;
|
|
110
|
-
name: string | null;
|
|
111
|
-
organizationId: string;
|
|
112
|
-
userId: string;
|
|
113
|
-
}>;
|
|
114
|
-
type FederatedAuthState = Readonly<{
|
|
115
|
-
status: "anonymous";
|
|
116
|
-
}> | Readonly<{
|
|
117
|
-
status: "redirecting";
|
|
118
|
-
}> | Readonly<{
|
|
119
|
-
expiresAt: number;
|
|
120
|
-
identity?: FederatedSessionIdentity;
|
|
121
|
-
status: "authenticated";
|
|
122
|
-
}> | Readonly<{
|
|
123
|
-
status: "expired";
|
|
124
|
-
}> | Readonly<{
|
|
125
|
-
error: FederatedAuthError;
|
|
126
|
-
status: "error";
|
|
127
|
-
}>;
|
|
128
|
-
type FederatedAuth = Readonly<{
|
|
129
|
-
beginLogin: (options: Readonly<{
|
|
130
|
-
returnTo: string;
|
|
131
|
-
}>) => Promise<string>;
|
|
132
|
-
completeLogin: (callbackUrl: string) => Promise<Readonly<{
|
|
133
|
-
returnTo: string;
|
|
134
|
-
}>>;
|
|
135
|
-
getAccessToken: () => Promise<string>;
|
|
136
|
-
getState: () => FederatedAuthState;
|
|
137
|
-
logout: () => Promise<void>;
|
|
138
|
-
reauthorize: (options?: Readonly<{
|
|
139
|
-
returnTo?: string;
|
|
140
|
-
}>) => Promise<string>;
|
|
141
|
-
subscribe: (listener: (state: FederatedAuthState) => void) => () => void;
|
|
142
|
-
}>;
|
|
143
|
-
type ClientFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
144
|
-
type FederatedAuthOptions = Readonly<{
|
|
145
|
-
clientId: string;
|
|
146
|
-
crypto?: Pick<Crypto, "getRandomValues" | "subtle">;
|
|
147
|
-
fetch?: ClientFetch;
|
|
148
|
-
navigate?: (url: string) => void;
|
|
149
|
-
now?: () => number;
|
|
150
|
-
redirectUri: string;
|
|
151
|
-
sessionStorage?: Pick<Storage, "getItem" | "removeItem" | "setItem">;
|
|
152
|
-
tenantUrl: string;
|
|
153
|
-
}>;
|
|
154
|
-
/**
|
|
155
|
-
* Browser federated sign-in with PKCE; the access token stays in memory. A
|
|
156
|
-
* bad option throws `FederatedAuthError` `configuration_error`. Methods
|
|
157
|
-
* reject with `FederatedAuthError`, or with `CiTransportError` when the
|
|
158
|
-
* tenant cannot be reached. `close` disposes the runtime of the client.
|
|
159
|
-
*/
|
|
160
|
-
declare const createFederatedAuth: (options: FederatedAuthOptions) => FederatedAuth & Readonly<{
|
|
161
|
-
close: () => Promise<void>;
|
|
162
|
-
}>;
|
|
163
|
-
type JsonValue$1 = boolean | null | number | readonly JsonValue$1[] | Readonly<{
|
|
164
|
-
readonly [key: string]: JsonValue$1;
|
|
165
|
-
}> | string;
|
|
166
|
-
type JsonObject = Readonly<Record<string, JsonValue$1>>;
|
|
167
|
-
type WorkflowInvokeTarget = {
|
|
168
|
-
workflowId: string;
|
|
169
|
-
workflowFqn?: never;
|
|
170
|
-
} | {
|
|
171
|
-
workflowFqn: string;
|
|
172
|
-
workflowId?: never;
|
|
173
|
-
};
|
|
174
|
-
/** Addresses an Agent by its UUID or its in-organization FQN. */
|
|
175
|
-
type AgentInvokeTarget = {
|
|
176
|
-
agentId: string;
|
|
177
|
-
agentFqn?: never;
|
|
178
|
-
} | {
|
|
179
|
-
agentFqn: string;
|
|
180
|
-
agentId?: never;
|
|
181
|
-
};
|
|
182
|
-
/** Starts a conversation with an Agent, or continues an existing one. */
|
|
183
|
-
type ConversationContinueTarget = (AgentInvokeTarget & {
|
|
184
|
-
conversationId?: never;
|
|
185
|
-
}) | {
|
|
186
|
-
agentFqn?: never;
|
|
187
|
-
agentId?: never;
|
|
188
|
-
conversationId: string;
|
|
189
|
-
};
|
|
190
|
-
type ConversationTurnStatus = "accepted" | "cancelled" | "failed" | "running" | "succeeded";
|
|
191
|
-
/**
|
|
192
|
-
* One conversation turn: the application's input, the Agent's final message
|
|
193
|
-
* once its run succeeded, and the Agent Output the run saved, if any.
|
|
194
|
-
* `runId` identifies the turn and its producing run.
|
|
195
|
-
*/
|
|
196
|
-
interface ConversationTurn {
|
|
197
|
-
completedAt: string | null;
|
|
198
|
-
createdAt: string;
|
|
199
|
-
input: unknown;
|
|
200
|
-
message: string | null;
|
|
201
|
-
output?: unknown;
|
|
202
|
-
runId: string;
|
|
203
|
-
status: ConversationTurnStatus;
|
|
204
|
-
}
|
|
205
|
-
interface ConversationHistory {
|
|
206
|
-
agentId: string;
|
|
207
|
-
conversationId: string;
|
|
208
|
-
createdAt: string;
|
|
209
|
-
turns: ConversationTurn[];
|
|
210
|
-
}
|
|
211
|
-
interface QueryFilter {
|
|
212
|
-
caseSensitive?: boolean;
|
|
213
|
-
field: string;
|
|
214
|
-
op: "eq" | "neq" | "in" | "contains" | "gt" | "gte" | "lt" | "lte" | "exists";
|
|
215
|
-
value?: unknown;
|
|
216
|
-
}
|
|
217
|
-
interface SearchQuery {
|
|
218
|
-
cursor?: string;
|
|
219
|
-
entitySchemaId: string;
|
|
220
|
-
fields?: string[];
|
|
221
|
-
filters?: QueryFilter[];
|
|
222
|
-
limit?: number;
|
|
223
|
-
text?: string;
|
|
224
|
-
}
|
|
225
|
-
type KnowledgeQuery = {
|
|
226
|
-
entityId: string;
|
|
227
|
-
op: "get";
|
|
228
|
-
} | (SearchQuery & {
|
|
229
|
-
op: "search";
|
|
230
|
-
}) | {
|
|
231
|
-
entitySchemaId: string;
|
|
232
|
-
fields: string[];
|
|
233
|
-
filters?: QueryFilter[];
|
|
234
|
-
op: "facets";
|
|
235
|
-
text?: string;
|
|
236
|
-
} | (SearchQuery & {
|
|
237
|
-
op: "autocomplete";
|
|
238
|
-
});
|
|
239
|
-
type ExternalApplicationOperationRequest = {
|
|
240
|
-
input: JsonObject | unknown[];
|
|
241
|
-
operationId: "context_get";
|
|
242
|
-
} | {
|
|
243
|
-
input: {
|
|
244
|
-
query: KnowledgeQuery;
|
|
245
|
-
};
|
|
246
|
-
operationId: "knowledge_query";
|
|
247
|
-
} | {
|
|
248
|
-
input: {
|
|
249
|
-
schemaId: string;
|
|
250
|
-
};
|
|
251
|
-
operationId: "knowledge_get_entity_schema_snapshot";
|
|
252
|
-
} | {
|
|
253
|
-
input: SearchQuery;
|
|
254
|
-
operationId: "knowledge_search_entities";
|
|
255
|
-
} | {
|
|
256
|
-
input: {
|
|
257
|
-
entitySchemaId: string;
|
|
258
|
-
fields: string[];
|
|
259
|
-
filters?: QueryFilter[];
|
|
260
|
-
text?: string;
|
|
261
|
-
};
|
|
262
|
-
operationId: "knowledge_facets";
|
|
263
|
-
} | {
|
|
264
|
-
input: {
|
|
265
|
-
entitySchemaId: string;
|
|
266
|
-
};
|
|
267
|
-
operationId: "knowledge_get_schema_query_context";
|
|
268
|
-
} | {
|
|
269
|
-
input: SearchQuery;
|
|
270
|
-
operationId: "knowledge_autocomplete";
|
|
271
|
-
} | {
|
|
272
|
-
input: {
|
|
273
|
-
entityId: string;
|
|
274
|
-
};
|
|
275
|
-
operationId: "knowledge_get_entity";
|
|
276
|
-
} | {
|
|
277
|
-
input: {
|
|
278
|
-
entity: {
|
|
279
|
-
data: JsonObject;
|
|
280
|
-
description?: string;
|
|
281
|
-
entitySchemaId: string;
|
|
282
|
-
name: string;
|
|
283
|
-
};
|
|
284
|
-
idempotencyKey: string;
|
|
285
|
-
};
|
|
286
|
-
operationId: "knowledge_create_entity";
|
|
287
|
-
} | {
|
|
288
|
-
input: {
|
|
289
|
-
entity: {
|
|
290
|
-
data?: JsonObject;
|
|
291
|
-
description?: string;
|
|
292
|
-
name?: string;
|
|
293
|
-
};
|
|
294
|
-
entityId: string;
|
|
295
|
-
expectedVersion: number;
|
|
296
|
-
idempotencyKey: string;
|
|
297
|
-
};
|
|
298
|
-
operationId: "knowledge_update_entity";
|
|
299
|
-
} | {
|
|
300
|
-
input: {
|
|
301
|
-
entity: {
|
|
302
|
-
data: JsonObject;
|
|
303
|
-
description?: string;
|
|
304
|
-
entitySchemaId: string;
|
|
305
|
-
name: string;
|
|
306
|
-
};
|
|
307
|
-
entitySchemaId: string;
|
|
308
|
-
externalIdentity: {
|
|
309
|
-
source: string;
|
|
310
|
-
value: string;
|
|
311
|
-
};
|
|
312
|
-
idempotencyKey: string;
|
|
313
|
-
};
|
|
314
|
-
operationId: "knowledge_upsert_entity";
|
|
315
|
-
} | {
|
|
316
|
-
input: {
|
|
317
|
-
entityId: string;
|
|
318
|
-
expectedVersion: number;
|
|
319
|
-
idempotencyKey: string;
|
|
320
|
-
};
|
|
321
|
-
operationId: "knowledge_delete_entity";
|
|
322
|
-
} | {
|
|
323
|
-
input: {
|
|
324
|
-
filter?: JsonObject;
|
|
325
|
-
};
|
|
326
|
-
operationId: "agents_list";
|
|
327
|
-
} | {
|
|
328
|
-
input: {
|
|
329
|
-
idempotencyKey: string;
|
|
330
|
-
input: unknown;
|
|
331
|
-
} & AgentInvokeTarget;
|
|
332
|
-
operationId: "agents_invoke";
|
|
333
|
-
} | {
|
|
334
|
-
input: {
|
|
335
|
-
filter?: JsonObject;
|
|
336
|
-
};
|
|
337
|
-
operationId: "skills_list";
|
|
338
|
-
} | {
|
|
339
|
-
input: {
|
|
340
|
-
idempotencyKey: string;
|
|
341
|
-
input: unknown;
|
|
342
|
-
skillId: string;
|
|
343
|
-
};
|
|
344
|
-
operationId: "skills_invoke";
|
|
345
|
-
} | {
|
|
346
|
-
input: {
|
|
347
|
-
filter?: JsonObject;
|
|
348
|
-
};
|
|
349
|
-
operationId: "workflows_list";
|
|
350
|
-
} | {
|
|
351
|
-
input: {
|
|
352
|
-
idempotencyKey: string;
|
|
353
|
-
input: unknown;
|
|
354
|
-
} & WorkflowInvokeTarget;
|
|
355
|
-
operationId: "workflows_invoke";
|
|
356
|
-
} | {
|
|
357
|
-
input: {
|
|
358
|
-
runId: string;
|
|
359
|
-
};
|
|
360
|
-
operationId: "runs_get";
|
|
361
|
-
} | {
|
|
362
|
-
input: {
|
|
363
|
-
afterCursor?: string;
|
|
364
|
-
runId: string;
|
|
365
|
-
};
|
|
366
|
-
operationId: "runs_stream";
|
|
367
|
-
} | {
|
|
368
|
-
input: {
|
|
369
|
-
runId: string;
|
|
370
|
-
};
|
|
371
|
-
operationId: "runs_cancel";
|
|
372
|
-
} | {
|
|
373
|
-
input: {
|
|
374
|
-
contentBase64: string;
|
|
375
|
-
contentType: string;
|
|
376
|
-
fileName: string;
|
|
377
|
-
runId: string;
|
|
378
|
-
sizeBytes: number;
|
|
379
|
-
};
|
|
380
|
-
operationId: "attachments_upload";
|
|
381
|
-
} | {
|
|
382
|
-
input: {
|
|
383
|
-
attachmentId: string;
|
|
384
|
-
runId: string;
|
|
385
|
-
};
|
|
386
|
-
operationId: "attachments_download_url";
|
|
387
|
-
} | {
|
|
388
|
-
input: {
|
|
389
|
-
idempotencyKey: string;
|
|
390
|
-
input: unknown;
|
|
391
|
-
} & ConversationContinueTarget;
|
|
392
|
-
operationId: "conversations_continue";
|
|
393
|
-
} | {
|
|
394
|
-
input: {
|
|
395
|
-
conversationId: string;
|
|
396
|
-
};
|
|
397
|
-
operationId: "conversations_history";
|
|
398
|
-
};
|
|
399
|
-
interface EnvelopeSuccess<Id extends string, Result> {
|
|
400
|
-
correlationId: string;
|
|
401
|
-
operationId: Id;
|
|
402
|
-
result: Result;
|
|
403
|
-
}
|
|
404
|
-
type ExternalApplicationOperationSuccess = EnvelopeSuccess<"context_get", JsonObject> | EnvelopeSuccess<"knowledge_query", JsonObject> | EnvelopeSuccess<"knowledge_get_entity_schema_snapshot", JsonObject> | EnvelopeSuccess<"knowledge_search_entities", JsonObject> | EnvelopeSuccess<"knowledge_facets", JsonObject> | EnvelopeSuccess<"knowledge_get_schema_query_context", JsonObject> | EnvelopeSuccess<"knowledge_autocomplete", JsonObject> | EnvelopeSuccess<"knowledge_get_entity", JsonObject> | EnvelopeSuccess<"knowledge_create_entity", JsonObject> | EnvelopeSuccess<"knowledge_update_entity", JsonObject> | EnvelopeSuccess<"knowledge_upsert_entity", JsonObject> | EnvelopeSuccess<"knowledge_delete_entity", JsonObject> | EnvelopeSuccess<"agents_list", JsonObject> | EnvelopeSuccess<"agents_invoke", {
|
|
405
|
-
runId: string;
|
|
406
|
-
}> | EnvelopeSuccess<"skills_list", JsonObject> | EnvelopeSuccess<"skills_invoke", {
|
|
407
|
-
runId: string;
|
|
408
|
-
}> | EnvelopeSuccess<"workflows_list", JsonObject> | EnvelopeSuccess<"workflows_invoke", {
|
|
409
|
-
runId: string;
|
|
410
|
-
}> | EnvelopeSuccess<"runs_get", JsonObject> | EnvelopeSuccess<"runs_stream", {
|
|
411
|
-
events: JsonObject[];
|
|
412
|
-
nextCursor: string | null;
|
|
413
|
-
}> | EnvelopeSuccess<"runs_cancel", JsonObject> | EnvelopeSuccess<"attachments_upload", {
|
|
414
|
-
attachmentId: string;
|
|
415
|
-
}> | EnvelopeSuccess<"attachments_download_url", {
|
|
416
|
-
expiresAt: string;
|
|
417
|
-
url: string;
|
|
418
|
-
}> | EnvelopeSuccess<"conversations_continue", {
|
|
419
|
-
conversationId: string;
|
|
420
|
-
runId: string;
|
|
421
|
-
}> | EnvelopeSuccess<"conversations_history", ConversationHistory>;
|
|
422
|
-
declare const storageFileIdBrand: unique symbol;
|
|
423
|
-
/** A durable private file of the application's Organization. */
|
|
424
|
-
type StorageFileId = string & Readonly<{
|
|
425
|
-
[storageFileIdBrand]: "StorageFileId";
|
|
426
|
-
}>;
|
|
427
|
-
/**
|
|
428
|
-
* One file of up to 10 MiB, base64-encoded. CI accepts the content types
|
|
429
|
-
* `application/pdf`, `image/jpeg` and `image/png`.
|
|
430
|
-
*/
|
|
431
|
-
interface DurableFileUpload {
|
|
432
|
-
contentBase64: string;
|
|
433
|
-
contentType: string;
|
|
434
|
-
fileName: string;
|
|
435
|
-
sizeBytes: number;
|
|
436
|
-
}
|
|
437
|
-
interface ExternalApplicationServiceOperationRequest {
|
|
438
|
-
input: DurableFileUpload;
|
|
439
|
-
operationId: "files_upload";
|
|
440
|
-
}
|
|
441
|
-
type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"files_upload", {
|
|
442
|
-
storageFileId: StorageFileId;
|
|
443
|
-
}>;
|
|
444
|
-
/** Every operation a confidential server client may invoke. */
|
|
445
|
-
type ExternalApplicationServerOperationRequest = ExternalApplicationOperationRequest | ExternalApplicationServiceOperationRequest;
|
|
446
|
-
type ExternalApplicationOperationId = ExternalApplicationOperationRequest["operationId"];
|
|
447
|
-
type ExternalApplicationServerOperationId = ExternalApplicationServerOperationRequest["operationId"];
|
|
448
|
-
type ExternalApplicationOperationRequestFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationServerOperationRequest, {
|
|
449
|
-
operationId: Id;
|
|
450
|
-
}>;
|
|
451
|
-
type ExternalApplicationOperationSuccessFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationOperationSuccess | ExternalApplicationServiceOperationSuccess, {
|
|
452
|
-
operationId: Id;
|
|
453
|
-
}>;
|
|
454
|
-
/** Generated, curated external-application operation authority. */
|
|
455
|
-
declare const clientOperationIds: readonly ["context_get", "knowledge_query", "knowledge_get_entity_schema_snapshot", "knowledge_search_entities", "knowledge_facets", "knowledge_get_schema_query_context", "knowledge_autocomplete", "knowledge_get_entity", "knowledge_create_entity", "knowledge_update_entity", "knowledge_upsert_entity", "knowledge_delete_entity", "agents_list", "agents_invoke", "skills_list", "skills_invoke", "workflows_list", "workflows_invoke", "runs_get", "runs_stream", "runs_cancel", "attachments_upload", "attachments_download_url", "conversations_continue", "conversations_history"];
|
|
456
|
-
type ClientOperationId = ExternalApplicationOperationId;
|
|
457
|
-
declare const isClientOperationId: (value: string) => value is ClientOperationId;
|
|
458
|
-
interface ClientOperationDefinition<Input, Output> {
|
|
459
|
-
readonly input: Input;
|
|
460
|
-
readonly output: Output;
|
|
461
|
-
}
|
|
462
|
-
type ClientOperationMap = Readonly<{ [Id in ClientOperationId]: ClientOperationDefinition<ExternalApplicationOperationRequestFor<Id>["input"], ExternalApplicationOperationSuccessFor<Id>["result"]>; }>;
|
|
463
|
-
type ClientOperationInput<Operations extends ClientOperationMap, Id extends ClientOperationId> = Operations[Id]["input"];
|
|
464
|
-
type ClientOperationOutput<Operations extends ClientOperationMap, Id extends ClientOperationId> = Operations[Id]["output"];
|
|
465
|
-
type OperationExecutionOptions = Readonly<{
|
|
466
|
-
organizationId: string;
|
|
467
|
-
signal?: AbortSignal;
|
|
468
|
-
}>;
|
|
469
|
-
interface TypedOperationExecutor<Operations extends ClientOperationMap> {
|
|
470
|
-
readonly execute: <Id extends ClientOperationId>(operationId: Id, input: ClientOperationInput<Operations, Id>, options?: OperationExecutionOptions) => Promise<CiResult<ClientOperationOutput<Operations, Id>>>;
|
|
471
|
-
}
|
|
472
|
-
type JsonValue = null | boolean | number | string | readonly JsonValue[] | Readonly<{
|
|
473
|
-
[key: string]: JsonValue;
|
|
474
|
-
}>;
|
|
475
|
-
/** Codes of the Expected Errors that CI returns. The `CiErrorCode` Schema of `./effect` uses this list. */
|
|
476
|
-
declare const ciErrorCodes: readonly ["unauthenticated", "forbidden", "not_found", "conflict", "invalid_request", "rate_limited", "unavailable", "internal"];
|
|
477
|
-
type CiErrorCode = (typeof ciErrorCodes)[number];
|
|
478
|
-
type CiError = Readonly<{
|
|
479
|
-
code: CiErrorCode;
|
|
480
|
-
message: string;
|
|
481
|
-
retryable: boolean;
|
|
482
|
-
details?: Readonly<Record<string, JsonValue>>;
|
|
483
|
-
}>;
|
|
484
|
-
type CiResult<Value> = Readonly<{
|
|
485
|
-
correlationId: string;
|
|
486
|
-
ok: true;
|
|
487
|
-
value: Value;
|
|
488
|
-
}> | Readonly<{
|
|
489
|
-
correlationId: string;
|
|
490
|
-
error: CiError;
|
|
491
|
-
ok: false;
|
|
492
|
-
}>;
|
|
493
|
-
type OperationRequest<Id extends ClientOperationId> = ExternalApplicationOperationRequestFor<Id>;
|
|
494
|
-
type OperationSuccess<Id extends ClientOperationId> = ExternalApplicationOperationSuccessFor<Id>;
|
|
495
|
-
type ProxyAuthentication = Readonly<{
|
|
496
|
-
auth: Readonly<{
|
|
497
|
-
getAccessToken: () => Promise<string> | string;
|
|
498
|
-
}>;
|
|
499
|
-
mode: "federated";
|
|
500
|
-
}> | Readonly<{
|
|
501
|
-
credentials?: RequestCredentials;
|
|
502
|
-
mode: "server_delegated";
|
|
503
|
-
}>;
|
|
504
|
-
type ProxyTransportOptions = Readonly<{
|
|
505
|
-
authentication: ProxyAuthentication;
|
|
506
|
-
fetch?: ClientFetch;
|
|
507
|
-
path: string;
|
|
508
|
-
serverUrl: string;
|
|
509
|
-
}>;
|
|
510
|
-
/**
|
|
511
|
-
* The Vanilla Facade of `CiClient.layerProxy`, in a runtime of its own;
|
|
512
|
-
* `close` disposes it. A bad `serverUrl` or `path` throws `TypeError`.
|
|
513
|
-
*/
|
|
514
|
-
declare const createProxyTransport: <Operations extends ClientOperationMap>(options: ProxyTransportOptions) => TypedOperationExecutor<Operations> & Readonly<{
|
|
515
|
-
close: () => Promise<void>;
|
|
516
|
-
}>;
|
|
517
7
|
type ResourceJsonValue = null | boolean | number | string | readonly ResourceJsonValue[] | Readonly<{
|
|
518
8
|
[key: string]: ResourceJsonValue;
|
|
519
9
|
}>;
|
|
@@ -953,7 +443,7 @@ declare const isEntityBatchRefusedError: (error: ResourceError) => error is Reso
|
|
|
953
443
|
declare const createEntityProtocol: <Value, Create = Value, Patch = Partial<Value>>(definition: ResourceDefinition<Value, Create, Patch>) => EntityProtocol<Value, Create, Patch>;
|
|
954
444
|
/** One entity request as its envelope; only a transport failure fails. */
|
|
955
445
|
type EntityExecute = (request: EntityRequest, options: ResourceRequestOptions) => Effect.Effect<ResourceResult<unknown>, CiTransportError>;
|
|
956
|
-
type ResourceFailure = CiError
|
|
446
|
+
type ResourceFailure = CiError | CiTransportError;
|
|
957
447
|
/** The entity client of one Resource Definition for `./effect`. */
|
|
958
448
|
type ResourceEntityClient<Value, Create, Patch> = Readonly<{
|
|
959
449
|
definition: ResourceDefinition<Value, Create, Patch>;
|
|
@@ -1067,4 +557,4 @@ declare const makeEntityHttpExecute: (options: EntityHttpTransportOptions) => En
|
|
|
1067
557
|
declare const createEntityHttpTransport: (options: EntityHttpTransportOptions) => EntityTransport & Readonly<{
|
|
1068
558
|
close: () => Promise<void>;
|
|
1069
559
|
}>;
|
|
1070
|
-
export { ResourceDefinition as $,
|
|
560
|
+
export { ResourceDefinition as $, EntityFileFieldWrite as A, EntityRequest as B, EntityBatchInput as C, ResourceUpdateRequest as Ct, EntityClient as D, EntityBatchRefusedDetails as E, EntityOperation as F, EntityUploadSlot as G, EntityTransport as H, EntityOperationResult as I, ResourceCapabilities as J, IdempotencyKey as K, EntityPage as L, EntityFileWrite as M, EntityListQuery as N, EntityCreateInput as O, EntityMemberValue as P, ResourceCursor as Q, EntityProtocol as R, createResourceClient as S, ResourceTransportRequest as St, EntityBatchRefusal as T, EntityUpdateInput as U, EntityRestoreInput as V, EntityUploadInput as W, ResourceCreateInput as X, ResourceClient as Y, ResourceCreateRequest as Z, layerLegacy as _, ResourceRequestOptions as _t, LegacyResourceClient as a, ResourceIdentityField as at, isEntityBatchRefusedError as b, ResourceSort as bt, LegacyResourcesValue as c, ResourceLifecycleRequest as ct, ResourcesFromEntityTransportOptions as d, ResourceListResult as dt, ResourceError as et, ResourcesLayerOptions as f, ResourceMutationInput as ft, layerFromEntityTransport as g, ResourceRecordId as gt, layerConfig as h, ResourceRecord as ht, makeEntityHttpExecute as i, ResourceId as it, EntityFileValue as j, EntityDeleteInput as k, ResourceEntityClient as l, ResourceListQuery as lt, layer as m, ResourcePaginationMode as mt, EntityHttpTransportOptions as n, ResourceFilter as nt, LegacyResources as o, ResourceJsonValue as ot, ResourcesValue as p, ResourcePagination as pt, PortableResourceSchema as q, createEntityHttpTransport as r, ResourceGetRequest as rt, LegacyResourcesLayerOptions as s, ResourceLifecycleInput as st, EntityHttpDestination as t, ResourceErrorCode as tt, Resources as u, ResourceListRequest as ut, layerLegacyConfig as v, ResourceResult as vt, EntityBatchOp as w, isEntityReadLimitError as x, ResourceTransport as xt, createEntityProtocol as y, ResourceRevision as yt, EntityReadLimitDetails as z };
|
package/dist/resources.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ResourceDefinition, A as EntityFileFieldWrite, B as EntityRequest, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, F as EntityOperation, G as EntityUploadSlot, H as EntityTransport, I as EntityOperationResult, J as ResourceCapabilities, K as IdempotencyKey, L as EntityPage, M as EntityFileWrite, N as EntityListQuery, O as EntityCreateInput, P as EntityMemberValue, Q as ResourceCursor, R as EntityProtocol, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, U as EntityUpdateInput, V as EntityRestoreInput, W as EntityUploadInput, X as ResourceCreateInput, Y as ResourceClient, Z as ResourceCreateRequest, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, ct as ResourceLifecycleRequest, dt as ResourceListResult, et as ResourceError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, k as EntityDeleteInput, lt as ResourceListQuery, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pt as ResourcePagination, q as PortableResourceSchema, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails } from "./resources-
|
|
1
|
+
import { $ as ResourceDefinition, A as EntityFileFieldWrite, B as EntityRequest, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, F as EntityOperation, G as EntityUploadSlot, H as EntityTransport, I as EntityOperationResult, J as ResourceCapabilities, K as IdempotencyKey, L as EntityPage, M as EntityFileWrite, N as EntityListQuery, O as EntityCreateInput, P as EntityMemberValue, Q as ResourceCursor, R as EntityProtocol, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, U as EntityUpdateInput, V as EntityRestoreInput, W as EntityUploadInput, X as ResourceCreateInput, Y as ResourceClient, Z as ResourceCreateRequest, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, ct as ResourceLifecycleRequest, dt as ResourceListResult, et as ResourceError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, k as EntityDeleteInput, lt as ResourceListQuery, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pt as ResourcePagination, q as PortableResourceSchema, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails } from "./resources-r2t8pcv2.js";
|
|
2
2
|
export { type EntityBatchInput, type EntityBatchOp, type EntityBatchRefusal, type EntityBatchRefusedDetails, type EntityClient, type EntityCreateInput, type EntityDeleteInput, type EntityFileFieldWrite, type EntityFileValue, type EntityFileWrite, type EntityHttpDestination, type EntityHttpTransportOptions, type EntityListQuery, type EntityMemberValue, type EntityOperation, type EntityOperationResult, type EntityPage, type EntityProtocol, type EntityReadLimitDetails, type EntityRequest, type EntityRestoreInput, type EntityTransport, type EntityUpdateInput, type EntityUploadInput, type EntityUploadSlot, type IdempotencyKey, type PortableResourceSchema, type ResourceCapabilities, type ResourceClient, type ResourceCreateInput, type ResourceCreateRequest, type ResourceCursor, type ResourceDefinition, type ResourceError, type ResourceErrorCode, type ResourceFilter, type ResourceGetRequest, type ResourceId, type ResourceIdentityField, type ResourceJsonValue, type ResourceLifecycleInput, type ResourceLifecycleRequest, type ResourceListQuery, type ResourceListRequest, type ResourceListResult, type ResourceMutationInput, type ResourcePagination, type ResourcePaginationMode, type ResourceRecord, type ResourceRecordId, type ResourceRequestOptions, type ResourceResult, type ResourceRevision, type ResourceSort, type ResourceTransport, type ResourceTransportRequest, type ResourceUpdateRequest, createEntityHttpTransport, createEntityProtocol, createResourceClient, isEntityBatchRefusedError, isEntityReadLimitError };
|
package/dist/resources.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { d as createEntityHttpTransport, g as isEntityReadLimitError, h as isEntityBatchRefusedError, m as createEntityProtocol } from "./service-
|
|
2
|
-
import { t as createResourceClient } from "./resources-
|
|
1
|
+
import { d as createEntityHttpTransport, g as isEntityReadLimitError, h as isEntityBatchRefusedError, m as createEntityProtocol } from "./service-l8wUAlPK.js";
|
|
2
|
+
import { t as createResourceClient } from "./resources-BZKqGxBT.js";
|
|
3
3
|
export { createEntityHttpTransport, createEntityProtocol, createResourceClient, isEntityBatchRefusedError, isEntityReadLimitError };
|