@alfe.ai/mcp-server 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +945 -701
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +945 -701
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -5,40 +5,111 @@ import { ChangelogEntry, EncryptedEnvelopeV1, FieldEnvelope, FieldFormat, FieldS
|
|
|
5
5
|
|
|
6
6
|
//# sourceMappingURL=tool-error-capture.d.ts.map
|
|
7
7
|
//#endregion
|
|
8
|
-
//#region src/
|
|
8
|
+
//#region src/transport.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Shared HTTP transport for the Agent API client — request core, retry
|
|
11
|
+
* policy, error formatting, and the `ApiBase` class the domain method
|
|
12
|
+
* groups under `./domains/` build on.
|
|
13
|
+
*/
|
|
9
14
|
interface AgentApiClientConfig {
|
|
10
15
|
apiKey: string;
|
|
11
16
|
apiUrl: string;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* unpriceable product, so keep the literal union in lockstep with the service.
|
|
19
|
+
* Encode each path segment but keep the `/` separators — `encodeURIComponent`
|
|
20
|
+
* would escape the slashes too, breaking greedy proxy routes.
|
|
17
21
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
|
|
23
|
+
declare class AgentApiTransport {
|
|
24
|
+
private readonly apiKey;
|
|
25
|
+
private readonly apiUrl;
|
|
26
|
+
constructor(config: AgentApiClientConfig);
|
|
27
|
+
/**
|
|
28
|
+
* Binary sibling of `request<T>()`. `request()` forces
|
|
29
|
+
* `Content-Type: application/json` and parses a `{ data: T }` envelope,
|
|
30
|
+
* neither of which fits a raw-audio flow (voice TTS/STT), so those go
|
|
31
|
+
* through this instead. Auth (Bearer), the request budget, and the single
|
|
32
|
+
* retry on transient 5xx / network errors are kept in sync with
|
|
33
|
+
* `request()`. Retries fire only on statuses produced BEFORE the route
|
|
34
|
+
* handler runs (authorizer-timeout 500 + LB 502/503/504), so re-issuing a
|
|
35
|
+
* POST does not risk a duplicate side effect.
|
|
36
|
+
*/
|
|
37
|
+
rawRequest(path: string, init: {
|
|
38
|
+
method: string;
|
|
39
|
+
headers: Headers;
|
|
40
|
+
body?: BodyInit | Uint8Array;
|
|
41
|
+
}): Promise<Response>;
|
|
42
|
+
/**
|
|
43
|
+
* @param extra.timeoutMs Per-request abort timeout (default REQUEST_TIMEOUT_MS).
|
|
44
|
+
* Long endpoints (image generation) pass a larger value so the gateway's
|
|
45
|
+
* own timeout wins with a readable status instead of a client-side abort.
|
|
46
|
+
* @param extra.retry Whether to retry once on transient failures (default
|
|
47
|
+
* true). Expensive/non-idempotent endpoints pass false.
|
|
48
|
+
*/
|
|
49
|
+
request<T>(path: string, options?: RequestInit, extra?: {
|
|
50
|
+
timeoutMs?: number;
|
|
51
|
+
retry?: boolean;
|
|
52
|
+
}): Promise<T>;
|
|
27
53
|
}
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Base class for the domain method groups. Holds the shared transport;
|
|
56
|
+
* `AgentApiClient` assembles the groups onto one class via `applyMixins`
|
|
57
|
+
* (prototype copy), so methods keep their original `this`-on-the-client
|
|
58
|
+
* call shape.
|
|
59
|
+
*/
|
|
60
|
+
declare class ApiBase {
|
|
61
|
+
protected readonly transport: AgentApiTransport;
|
|
62
|
+
constructor(transport: AgentApiTransport);
|
|
32
63
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
64
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/domains/workspace.d.ts
|
|
67
|
+
/** Response of GET /agents/me/workspace (services/agents). */
|
|
68
|
+
interface AgentWorkspaceInfo {
|
|
69
|
+
templateKey?: string;
|
|
70
|
+
defaultModel?: string;
|
|
71
|
+
installedFrom?: {
|
|
72
|
+
templateKey: string;
|
|
73
|
+
authorTenantId: string;
|
|
74
|
+
version: number;
|
|
75
|
+
};
|
|
76
|
+
runtime?: string;
|
|
77
|
+
teams?: {
|
|
78
|
+
teamId: string;
|
|
79
|
+
name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
parentTeamId?: string;
|
|
82
|
+
}[];
|
|
83
|
+
projects?: {
|
|
84
|
+
projectId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
status: string;
|
|
88
|
+
parentProjectId?: string;
|
|
89
|
+
}[];
|
|
90
|
+
teamIds?: string[];
|
|
91
|
+
projectIds?: string[];
|
|
92
|
+
}
|
|
93
|
+
declare class WorkspaceApi extends ApiBase {
|
|
94
|
+
/**
|
|
95
|
+
* GET /agents/me/workspace — workspace config for the authenticated agent
|
|
96
|
+
* (template assignment, default model, org roster).
|
|
97
|
+
*/
|
|
98
|
+
getWorkspace(): Promise<AgentWorkspaceInfo>;
|
|
99
|
+
/**
|
|
100
|
+
* GET /templates/{key}/files — persona/workspace file contents for a
|
|
101
|
+
* template the agent has access to. Pass `version` to pin to the version
|
|
102
|
+
* the agent was installed from (omit → the endpoint resolves `latest`).
|
|
103
|
+
*/
|
|
104
|
+
getTemplateFiles(templateKey: string, opts?: {
|
|
105
|
+
version?: number;
|
|
106
|
+
}): Promise<{
|
|
107
|
+
files: Record<string, string>;
|
|
108
|
+
}>;
|
|
41
109
|
}
|
|
110
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/domains/sync.d.ts
|
|
42
113
|
interface SyncAgentInfo {
|
|
43
114
|
agentId: string;
|
|
44
115
|
tenantId: string;
|
|
@@ -123,6 +194,63 @@ interface SharedFileEntry {
|
|
|
123
194
|
size: number;
|
|
124
195
|
contentType?: string;
|
|
125
196
|
}
|
|
197
|
+
declare class SyncApi extends ApiBase {
|
|
198
|
+
syncRegister(args?: {
|
|
199
|
+
displayName?: string;
|
|
200
|
+
}): Promise<{
|
|
201
|
+
agent: SyncAgentInfo;
|
|
202
|
+
}>;
|
|
203
|
+
syncGetManifest(): Promise<SyncManifest>;
|
|
204
|
+
syncPresign(args: {
|
|
205
|
+
files: {
|
|
206
|
+
path: string;
|
|
207
|
+
operation: "put" | "get";
|
|
208
|
+
contentType?: string;
|
|
209
|
+
}[];
|
|
210
|
+
}): Promise<{
|
|
211
|
+
urls: SyncPresignedUrl[];
|
|
212
|
+
}>;
|
|
213
|
+
syncConfirmUpload(args: {
|
|
214
|
+
filePath: string;
|
|
215
|
+
hash: string;
|
|
216
|
+
size: number;
|
|
217
|
+
storageClass?: "STANDARD" | "GLACIER_IR";
|
|
218
|
+
}): Promise<SyncConfirmedUpload>;
|
|
219
|
+
syncReconstruct(args: {
|
|
220
|
+
mode: "full" | "active" | "memory";
|
|
221
|
+
}): Promise<SyncReconstructBundle>;
|
|
222
|
+
syncGetStats(): Promise<SyncAgentStats>;
|
|
223
|
+
syncListFiles(args?: {
|
|
224
|
+
prefix?: string;
|
|
225
|
+
}): Promise<{
|
|
226
|
+
files: SyncFileEntry[];
|
|
227
|
+
}>;
|
|
228
|
+
syncListSessions(): Promise<{
|
|
229
|
+
sessions: SyncSessionEntry[];
|
|
230
|
+
}>;
|
|
231
|
+
syncGetSession(sessionId: string): Promise<SyncSessionContent>;
|
|
232
|
+
syncDeleteFile(filePath: string): Promise<{
|
|
233
|
+
removed: boolean;
|
|
234
|
+
}>;
|
|
235
|
+
sharedListFiles(args: {
|
|
236
|
+
scope: "org" | "team" | "project";
|
|
237
|
+
scopeId: string;
|
|
238
|
+
}): Promise<{
|
|
239
|
+
files: SharedFileEntry[];
|
|
240
|
+
nextCursor: string | null;
|
|
241
|
+
}>;
|
|
242
|
+
sharedDownloadUrl(args: {
|
|
243
|
+
scope: "org" | "team" | "project";
|
|
244
|
+
scopeId: string;
|
|
245
|
+
filePath: string;
|
|
246
|
+
}): Promise<{
|
|
247
|
+
downloadUrl: string;
|
|
248
|
+
expiresIn: number;
|
|
249
|
+
}>;
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/domains/knowledge.d.ts
|
|
126
254
|
type KnowledgeScopeType = "org" | "team" | "project";
|
|
127
255
|
interface KnowledgeScope {
|
|
128
256
|
scopeType: KnowledgeScopeType;
|
|
@@ -165,15 +293,6 @@ interface KnowledgeProfile {
|
|
|
165
293
|
updatedAt: string | null;
|
|
166
294
|
updatedBy: string | null;
|
|
167
295
|
}
|
|
168
|
-
interface KnowledgeDoc {
|
|
169
|
-
filePath: string;
|
|
170
|
-
fileName: string;
|
|
171
|
-
contentType?: string;
|
|
172
|
-
size: number;
|
|
173
|
-
uploadedBy?: string;
|
|
174
|
-
createdAt: string;
|
|
175
|
-
updatedAt: string;
|
|
176
|
-
}
|
|
177
296
|
type ChangeRequestResourceType = "doc" | "profile";
|
|
178
297
|
type ChangeRequestOperation = "create" | "update" | "delete";
|
|
179
298
|
type ChangeRequestStatus = "open" | "approved" | "rejected" | "withdrawn" | "superseded";
|
|
@@ -215,6 +334,202 @@ interface ProposeScopeChangeInput {
|
|
|
215
334
|
/** profile: the proposed value ({ about, description, links }). */
|
|
216
335
|
proposedValue?: unknown;
|
|
217
336
|
}
|
|
337
|
+
interface KnowledgeDoc {
|
|
338
|
+
filePath: string;
|
|
339
|
+
fileName: string;
|
|
340
|
+
contentType?: string;
|
|
341
|
+
size: number;
|
|
342
|
+
uploadedBy?: string;
|
|
343
|
+
createdAt: string;
|
|
344
|
+
updatedAt: string;
|
|
345
|
+
}
|
|
346
|
+
declare class KnowledgeApi extends ApiBase {
|
|
347
|
+
/**
|
|
348
|
+
* Semantic search across the agent's member scopes. Fan-out is gated
|
|
349
|
+
* server-side by `listScopes` set-inclusion (fail-closed). Pass
|
|
350
|
+
* `scopeType` + `scopeId` to narrow to one scope; a non-member scope
|
|
351
|
+
* yields empty results (never a cross-scope leak).
|
|
352
|
+
*/
|
|
353
|
+
knowledgeSearch(query: string, opts?: {
|
|
354
|
+
limit?: number;
|
|
355
|
+
scopeType?: KnowledgeScopeType;
|
|
356
|
+
scopeId?: string;
|
|
357
|
+
}): Promise<KnowledgeSearchResult>;
|
|
358
|
+
/** Enumerate the scopes (org + teams + projects) this agent belongs to. */
|
|
359
|
+
listScopes(): Promise<{
|
|
360
|
+
scopes: KnowledgeScope[];
|
|
361
|
+
}>;
|
|
362
|
+
/** Read a scope's structured knowledge profile (after membership check). */
|
|
363
|
+
getScopeProfile(scopeType: KnowledgeScopeType, scopeId: string): Promise<KnowledgeProfile>;
|
|
364
|
+
/**
|
|
365
|
+
* Open a change request against a scope's knowledge resource. For a doc
|
|
366
|
+
* create/update, `services/org` returns a presigned staging PUT; this method
|
|
367
|
+
* uploads the proposed `content` to it (echoing the same Content-Type that
|
|
368
|
+
* was signed), mirroring `writeScopeDoc`. The staged body is applied to the
|
|
369
|
+
* canonical doc — attributed to this agent — only when a reviewer approves.
|
|
370
|
+
*/
|
|
371
|
+
proposeScopeChange(scopeType: KnowledgeScopeType, scopeId: string, input: ProposeScopeChangeInput): Promise<KnowledgeChangeRequest>;
|
|
372
|
+
/**
|
|
373
|
+
* List the agent's OWN change requests in a scope (filtered server-side to
|
|
374
|
+
* this agent as proposer). Pass `status` to narrow to open / approved / etc.
|
|
375
|
+
*/
|
|
376
|
+
listScopeChangeRequests(scopeType: KnowledgeScopeType, scopeId: string, opts?: {
|
|
377
|
+
status?: ChangeRequestStatus;
|
|
378
|
+
limit?: number;
|
|
379
|
+
cursor?: string;
|
|
380
|
+
}): Promise<{
|
|
381
|
+
changeRequests: KnowledgeChangeRequest[];
|
|
382
|
+
nextCursor: string | null;
|
|
383
|
+
}>;
|
|
384
|
+
/** List a scope's docs (the org-files corpus; mirrored to shared/<scope>/). */
|
|
385
|
+
listScopeDocs(scopeType: KnowledgeScopeType, scopeId: string, opts?: {
|
|
386
|
+
limit?: number;
|
|
387
|
+
cursor?: string;
|
|
388
|
+
}): Promise<{
|
|
389
|
+
files: KnowledgeDoc[];
|
|
390
|
+
nextCursor: string | null;
|
|
391
|
+
}>;
|
|
392
|
+
/**
|
|
393
|
+
* Read the full text of a scope doc. Resolves a presigned download URL
|
|
394
|
+
* from `services/org`, then fetches the bytes directly from S3 (the one
|
|
395
|
+
* legitimate raw fetch in a plugin — same pattern as sync).
|
|
396
|
+
*/
|
|
397
|
+
readScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string): Promise<{
|
|
398
|
+
filePath: string;
|
|
399
|
+
text: string;
|
|
400
|
+
}>;
|
|
401
|
+
/**
|
|
402
|
+
* Write (create or overwrite) a scope doc. Two-step presigned upload:
|
|
403
|
+
* `services/org` returns a signed URL plus `requiredHeaders` (author /
|
|
404
|
+
* authorKind / message as `x-amz-meta-*`) that MUST be sent verbatim on
|
|
405
|
+
* the PUT, alongside the same `Content-Type` that was signed. Author and
|
|
406
|
+
* authorKind are server-set from the agent token — never trusted here.
|
|
407
|
+
*/
|
|
408
|
+
writeScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string, content: string, opts?: {
|
|
409
|
+
contentType?: string;
|
|
410
|
+
message?: string;
|
|
411
|
+
}): Promise<{
|
|
412
|
+
filePath: string;
|
|
413
|
+
}>;
|
|
414
|
+
}
|
|
415
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region src/domains/mobile.d.ts
|
|
418
|
+
/** Response of GET /mobile/numbers for an agent (services/mobile). */
|
|
419
|
+
interface MobileNumberInfo {
|
|
420
|
+
phoneNumber: string;
|
|
421
|
+
countryCode: string;
|
|
422
|
+
monthlyPrice?: number;
|
|
423
|
+
status: string;
|
|
424
|
+
errorMessage?: string;
|
|
425
|
+
}
|
|
426
|
+
/** One purchasable number from GET /mobile/numbers/search. */
|
|
427
|
+
interface MobileAvailableNumber {
|
|
428
|
+
number: string;
|
|
429
|
+
friendlyName: string;
|
|
430
|
+
locality: string;
|
|
431
|
+
region: string;
|
|
432
|
+
country: string;
|
|
433
|
+
}
|
|
434
|
+
/** Approved WhatsApp content template from GET /mobile/whatsapp/templates. */
|
|
435
|
+
interface WhatsAppTemplate {
|
|
436
|
+
sid: string;
|
|
437
|
+
friendlyName: string;
|
|
438
|
+
language: string;
|
|
439
|
+
body: string;
|
|
440
|
+
variables: Record<string, string>;
|
|
441
|
+
dateCreated: string;
|
|
442
|
+
dateUpdated: string;
|
|
443
|
+
approvalStatus?: string;
|
|
444
|
+
rejectionReason?: string;
|
|
445
|
+
category?: string;
|
|
446
|
+
}
|
|
447
|
+
declare class MobileApi extends ApiBase {
|
|
448
|
+
getMobileNumber(): Promise<MobileNumberInfo>;
|
|
449
|
+
searchMobileNumbers(args?: {
|
|
450
|
+
country?: string;
|
|
451
|
+
query?: string;
|
|
452
|
+
}): Promise<{
|
|
453
|
+
numbers: MobileAvailableNumber[];
|
|
454
|
+
monthlyPrice: number;
|
|
455
|
+
}>;
|
|
456
|
+
assignMobileNumber(args: {
|
|
457
|
+
phoneNumber: string;
|
|
458
|
+
countryCode: string;
|
|
459
|
+
}): Promise<{
|
|
460
|
+
phoneNumber: string;
|
|
461
|
+
countryCode: string;
|
|
462
|
+
status: "pending";
|
|
463
|
+
}>;
|
|
464
|
+
releaseMobileNumber(): Promise<{
|
|
465
|
+
released: true;
|
|
466
|
+
}>;
|
|
467
|
+
sendSms(args: {
|
|
468
|
+
to: string;
|
|
469
|
+
body: string;
|
|
470
|
+
}): Promise<{
|
|
471
|
+
sent: true;
|
|
472
|
+
sid: string;
|
|
473
|
+
}>;
|
|
474
|
+
startOutboundCall(args: {
|
|
475
|
+
to: string;
|
|
476
|
+
}): Promise<{
|
|
477
|
+
callSid: string;
|
|
478
|
+
status: string;
|
|
479
|
+
}>;
|
|
480
|
+
getWhatsAppSession(to: string): Promise<{
|
|
481
|
+
active: boolean;
|
|
482
|
+
expiresAt?: string;
|
|
483
|
+
}>;
|
|
484
|
+
sendWhatsAppMessage(args: {
|
|
485
|
+
to: string;
|
|
486
|
+
body: string;
|
|
487
|
+
}): Promise<{
|
|
488
|
+
sent: true;
|
|
489
|
+
sid: string;
|
|
490
|
+
}>;
|
|
491
|
+
sendWhatsAppTemplate(args: {
|
|
492
|
+
to: string;
|
|
493
|
+
contentSid: string;
|
|
494
|
+
contentVariables: Record<string, string>;
|
|
495
|
+
bodyPreview?: string;
|
|
496
|
+
}): Promise<{
|
|
497
|
+
sent: true;
|
|
498
|
+
sid: string;
|
|
499
|
+
}>;
|
|
500
|
+
listWhatsAppTemplates(): Promise<{
|
|
501
|
+
templates: WhatsAppTemplate[];
|
|
502
|
+
}>;
|
|
503
|
+
}
|
|
504
|
+
//# sourceMappingURL=mobile.d.ts.map
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/domains/remote.d.ts
|
|
507
|
+
interface RemoteSessionInfo {
|
|
508
|
+
sessionId: string;
|
|
509
|
+
agentId: string;
|
|
510
|
+
surface: "browser" | "terminal";
|
|
511
|
+
status: "agent_driving" | "awaiting_human" | "human_in_control" | "resuming" | "completed" | "expired" | "failed";
|
|
512
|
+
url?: string;
|
|
513
|
+
instructions?: string;
|
|
514
|
+
requestedAt?: string;
|
|
515
|
+
}
|
|
516
|
+
declare class RemoteApi extends ApiBase {
|
|
517
|
+
requestBrowserTakeover(args: {
|
|
518
|
+
instructions: string;
|
|
519
|
+
url?: string;
|
|
520
|
+
conversationId?: string;
|
|
521
|
+
}): Promise<{
|
|
522
|
+
sessionId: string;
|
|
523
|
+
status: string;
|
|
524
|
+
}>;
|
|
525
|
+
getRemoteSession(sessionId: string): Promise<RemoteSessionInfo>;
|
|
526
|
+
completeRemoteSession(sessionId: string): Promise<{
|
|
527
|
+
ok: boolean;
|
|
528
|
+
}>;
|
|
529
|
+
}
|
|
530
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/domains/self.d.ts
|
|
218
533
|
/** Voice settings — core agent config. Mirrors `VoiceConfig` in `@alfe/types`. */
|
|
219
534
|
interface AgentVoiceConfig {
|
|
220
535
|
/** ElevenLabs voice ID; platform default when unset. */
|
|
@@ -256,15 +571,54 @@ interface AgentVoice {
|
|
|
256
571
|
labels: Record<string, string>;
|
|
257
572
|
category: string;
|
|
258
573
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
574
|
+
declare class SelfApi extends ApiBase {
|
|
575
|
+
/** Update the agent's own name and/or voice config. Returns the updated agent. */
|
|
576
|
+
updateSelf(update: {
|
|
577
|
+
name?: string;
|
|
578
|
+
voiceConfig?: AgentVoiceConfig;
|
|
579
|
+
}): Promise<AgentSelf>;
|
|
580
|
+
/**
|
|
581
|
+
* Generate the agent's own avatar from a text prompt. The image is generated,
|
|
582
|
+
* stored, and set on the agent server-side; returns the updated agent.
|
|
583
|
+
*
|
|
584
|
+
* ASYNC (same reason as `generateImage`): avatar gen runs `gpt-image-1`
|
|
585
|
+
* (30–60s) which exceeds the API Gateway 30s ceiling, so this enqueues a job
|
|
586
|
+
* (`POST /agent/avatar/generate` → `jobId`) then polls (`GET /agent/avatar/{jobId}`)
|
|
587
|
+
* until the avatar is set. Signature unchanged — the plugin is unaffected.
|
|
588
|
+
*/
|
|
589
|
+
generateAvatar(args: {
|
|
590
|
+
prompt: string;
|
|
591
|
+
}): Promise<AgentSelf>;
|
|
592
|
+
/**
|
|
593
|
+
* Get a presigned PUT URL to upload a new avatar image. Upload the bytes to
|
|
594
|
+
* `uploadUrl`, then call `finalizeAvatar(s3Key)` to set it on the agent.
|
|
595
|
+
*/
|
|
596
|
+
presignAvatar(args: {
|
|
597
|
+
mimeType: string;
|
|
598
|
+
size: number;
|
|
599
|
+
}): Promise<AgentAvatarPresign>;
|
|
600
|
+
/**
|
|
601
|
+
* Finalize an avatar upload — validates ownership + size, then sets the
|
|
602
|
+
* agent's `avatarUrl` server-side. Returns the updated agent.
|
|
603
|
+
*/
|
|
604
|
+
finalizeAvatar(s3Key: string): Promise<AgentSelf>;
|
|
605
|
+
/** List the platform voice catalogue (ElevenLabs) so the agent can pick its own voice. */
|
|
606
|
+
listVoices(): Promise<{
|
|
607
|
+
voices: AgentVoice[];
|
|
608
|
+
}>;
|
|
609
|
+
}
|
|
610
|
+
//# sourceMappingURL=self.d.ts.map
|
|
611
|
+
//#endregion
|
|
612
|
+
//#region src/domains/voice.d.ts
|
|
613
|
+
/** The ElevenLabs models with a pricing row — the TTS endpoint rejects any other value. */
|
|
614
|
+
type VoiceTtsModel = "eleven_turbo_v2_5" | "eleven_multilingual_v2";
|
|
615
|
+
interface VoiceTtsArgs {
|
|
616
|
+
/** Text to synthesize (1–5000 chars — the endpoint enforces this). */
|
|
617
|
+
text: string;
|
|
618
|
+
/** ElevenLabs voice id; platform default when unset. */
|
|
619
|
+
voiceId?: string;
|
|
620
|
+
/** TTS model; `eleven_turbo_v2_5` (lower latency) when unset. */
|
|
621
|
+
model?: VoiceTtsModel;
|
|
268
622
|
}
|
|
269
623
|
/** Raw synthesized audio plus its PCM framing (from the response headers). */
|
|
270
624
|
interface VoiceTtsResult {
|
|
@@ -288,84 +642,112 @@ interface VoiceSttResult {
|
|
|
288
642
|
/** Deepgram confidence in (0,1]. */
|
|
289
643
|
confidence: number;
|
|
290
644
|
}
|
|
291
|
-
declare class
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
645
|
+
declare class VoiceApi extends ApiBase {
|
|
646
|
+
/**
|
|
647
|
+
* Text-to-speech. Returns raw PCM audio bytes plus their framing — the
|
|
648
|
+
* voice service defaults to 24 kHz / mono / 16-bit. Wrap in a WAV container
|
|
649
|
+
* to produce a playable file. Metered per character against the tenant
|
|
650
|
+
* credit pool server-side; TTS completes regardless of metering outcome.
|
|
651
|
+
*/
|
|
652
|
+
tts(args: VoiceTtsArgs): Promise<VoiceTtsResult>;
|
|
653
|
+
/**
|
|
654
|
+
* Speech-to-text. Accepts raw linear16 (16-bit LE) mono PCM — NOT a WAV or
|
|
655
|
+
* other container (the endpoint transcribes with a fixed linear16 encoding,
|
|
656
|
+
* so a container header would be transcribed as noise). Strip any WAV header
|
|
657
|
+
* and pass `sampleRate` from it before calling. Metered by transcribed
|
|
658
|
+
* duration against the tenant credit pool server-side.
|
|
659
|
+
*/
|
|
660
|
+
stt(args: VoiceSttArgs): Promise<VoiceSttResult>;
|
|
661
|
+
}
|
|
662
|
+
//# sourceMappingURL=voice.d.ts.map
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/domains/search.d.ts
|
|
665
|
+
/**
|
|
666
|
+
* The broad-news providers behind the metered `services/news` Lambda. The
|
|
667
|
+
* server validates this with a zod enum; a value outside the union is an
|
|
668
|
+
* unpriceable product, so keep the literal union in lockstep with the service.
|
|
669
|
+
*/
|
|
670
|
+
type NewsProvider = "apitube" | "newsdata";
|
|
671
|
+
/** One normalized article. `sentiment` is provider-shaped (APITube supplies it). */
|
|
672
|
+
interface NewsArticle {
|
|
673
|
+
title: string;
|
|
674
|
+
url: string;
|
|
675
|
+
source: string;
|
|
676
|
+
publishedAt: string;
|
|
677
|
+
snippet: string;
|
|
678
|
+
sentiment?: unknown;
|
|
679
|
+
}
|
|
680
|
+
/** Provider-agnostic result — the server normalizes every adapter to this. */
|
|
681
|
+
interface NewsResult {
|
|
682
|
+
articles: NewsArticle[];
|
|
683
|
+
provider: string;
|
|
684
|
+
}
|
|
685
|
+
declare class SearchApi extends ApiBase {
|
|
686
|
+
searchWeb(params: {
|
|
687
|
+
query: string;
|
|
688
|
+
count?: number;
|
|
689
|
+
offset?: number;
|
|
690
|
+
country?: string;
|
|
691
|
+
freshness?: string;
|
|
692
|
+
}): Promise<unknown>;
|
|
693
|
+
searchImages(params: {
|
|
694
|
+
query: string;
|
|
695
|
+
count?: number;
|
|
696
|
+
}): Promise<unknown>;
|
|
697
|
+
searchNews(params: {
|
|
698
|
+
query: string;
|
|
699
|
+
count?: number;
|
|
700
|
+
freshness?: string;
|
|
701
|
+
}): Promise<unknown>;
|
|
702
|
+
/** Search news across the selected provider's corpus. → POST /agent/news/search */
|
|
703
|
+
newsSearch(params: {
|
|
704
|
+
query: string;
|
|
705
|
+
provider?: NewsProvider;
|
|
706
|
+
source?: string;
|
|
707
|
+
from?: string;
|
|
708
|
+
to?: string;
|
|
709
|
+
language?: string;
|
|
710
|
+
category?: string;
|
|
711
|
+
limit?: number;
|
|
712
|
+
}): Promise<NewsResult>;
|
|
713
|
+
/** Top headlines for the selected provider. → POST /agent/news/headlines */
|
|
714
|
+
newsHeadlines(params?: {
|
|
715
|
+
provider?: NewsProvider;
|
|
716
|
+
category?: string;
|
|
717
|
+
source?: string;
|
|
718
|
+
language?: string;
|
|
719
|
+
limit?: number;
|
|
720
|
+
}): Promise<NewsResult>;
|
|
721
|
+
}
|
|
722
|
+
//# sourceMappingURL=search.d.ts.map
|
|
723
|
+
//#endregion
|
|
724
|
+
//#region src/domains/chat.d.ts
|
|
725
|
+
declare class ChatApi extends ApiBase {
|
|
726
|
+
presignAttachments(files: {
|
|
727
|
+
filename: string;
|
|
728
|
+
mimeType: string;
|
|
314
729
|
size: number;
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}): Promise<{
|
|
324
|
-
files: SyncFileEntry[];
|
|
325
|
-
}>;
|
|
326
|
-
syncListSessions(): Promise<{
|
|
327
|
-
sessions: SyncSessionEntry[];
|
|
328
|
-
}>;
|
|
329
|
-
syncGetSession(sessionId: string): Promise<SyncSessionContent>;
|
|
330
|
-
syncDeleteFile(filePath: string): Promise<{
|
|
331
|
-
removed: boolean;
|
|
332
|
-
}>;
|
|
333
|
-
sharedListFiles(args: {
|
|
334
|
-
scope: "org" | "team" | "project";
|
|
335
|
-
scopeId: string;
|
|
336
|
-
}): Promise<{
|
|
337
|
-
files: SharedFileEntry[];
|
|
338
|
-
nextCursor: string | null;
|
|
730
|
+
}[]): Promise<{
|
|
731
|
+
attachments: {
|
|
732
|
+
id: string;
|
|
733
|
+
uploadUrl: string;
|
|
734
|
+
downloadUrl: string;
|
|
735
|
+
s3Key: string;
|
|
736
|
+
expiresAt: string;
|
|
737
|
+
}[];
|
|
339
738
|
}>;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
739
|
+
recordActivity(data: {
|
|
740
|
+
userId?: string;
|
|
741
|
+
channel: string;
|
|
742
|
+
role: "user" | "assistant";
|
|
344
743
|
}): Promise<{
|
|
345
|
-
|
|
346
|
-
expiresIn: number;
|
|
347
|
-
}>;
|
|
348
|
-
listIntegrations(): Promise<IntegrationInstall[]>;
|
|
349
|
-
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
|
|
350
|
-
updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
|
|
351
|
-
installIntegration(integrationId: string, options?: {
|
|
352
|
-
version?: string;
|
|
353
|
-
config?: Record<string, unknown>;
|
|
354
|
-
}): Promise<IntegrationInstall>;
|
|
355
|
-
removeIntegration(integrationId: string): Promise<IntegrationInstall>;
|
|
356
|
-
getOAuthUrl(provider: string, scopes?: string[]): Promise<{
|
|
357
|
-
url: string;
|
|
358
|
-
provider: string;
|
|
359
|
-
expiresIn: number;
|
|
360
|
-
}>;
|
|
361
|
-
getOAuthStatus(provider: string): Promise<{
|
|
362
|
-
provider: string;
|
|
363
|
-
connected: boolean;
|
|
364
|
-
config?: Record<string, string>;
|
|
365
|
-
}>;
|
|
366
|
-
getRegistry(): Promise<{
|
|
367
|
-
integrations: RegistryEntry[];
|
|
744
|
+
recorded: boolean;
|
|
368
745
|
}>;
|
|
746
|
+
}
|
|
747
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
748
|
+
//#endregion
|
|
749
|
+
//#region src/domains/connect-credentials.d.ts
|
|
750
|
+
declare class ConnectCredentialsApi extends ApiBase {
|
|
369
751
|
/**
|
|
370
752
|
* Returns every connected Google account for the agent. Multi-account by
|
|
371
753
|
* design — the openclaw-google plugin requires the LLM to pass `email`
|
|
@@ -422,90 +804,27 @@ declare class AgentApiClient {
|
|
|
422
804
|
[key: string]: unknown;
|
|
423
805
|
}>;
|
|
424
806
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* endpoint injects — they are never persisted on the connection. `host` is
|
|
432
|
-
* the resolved TLS endpoint (`live.ctraderapi.com` / `demo.ctraderapi.com`)
|
|
433
|
-
* derived from the selected account's live/demo flag.
|
|
807
|
+
* @deprecated Returns a single primary credential blob (legacy "pick-the-
|
|
808
|
+
* default-connection" shape). Use `getGithubAccounts()` for the multi-
|
|
809
|
+
* account shape required by Pattern A — explicit selector args on every
|
|
810
|
+
* tool. Retained because the `@alfe.ai/github-mcp` proxy is the
|
|
811
|
+
* only consumer that knows about Pattern A; legacy env-interpolation
|
|
812
|
+
* callers will keep hitting `/credentials` until they move to the proxy.
|
|
434
813
|
*/
|
|
435
|
-
|
|
814
|
+
getGithubCredentials(): Promise<{
|
|
815
|
+
login: string;
|
|
436
816
|
accessToken: string;
|
|
437
|
-
refreshToken: string;
|
|
438
|
-
accountId: string;
|
|
439
|
-
host: string;
|
|
440
|
-
clientId: string;
|
|
441
|
-
clientSecret: string;
|
|
442
817
|
}>;
|
|
443
818
|
/**
|
|
444
|
-
* Pattern A: multi-account credential fetch for
|
|
819
|
+
* Pattern A: multi-account credential fetch for GitHub.
|
|
445
820
|
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
* ctid:<userId>` (Phase 1). This aggregates the *trading accounts* across
|
|
450
|
-
* ALL of those Connection rows — each row contributes its `availableAccounts`
|
|
451
|
-
* flattened, and every account carries ITS OWN grant's `accessToken` (the
|
|
452
|
-
* token that authenticates that account against the cTrader Open API). One
|
|
453
|
-
* OAuth grant still covers all accounts under that single login on one shared
|
|
454
|
-
* token; only the `ctidTraderAccountId` and the protobuf socket `host` (live
|
|
455
|
-
* vs demo) differ within a grant. Across grants the tokens differ, so the
|
|
456
|
-
* token is now PER-ACCOUNT rather than hoisted to the top level.
|
|
821
|
+
* Returns every agent-scoped GitHub connection. The caller is expected
|
|
822
|
+
* to require a `login` selector on every credential-touching tool and
|
|
823
|
+
* look up the matching account at dispatch time.
|
|
457
824
|
*
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* `clientId` / `clientSecret` are the SST-sourced GLOBAL app credentials the
|
|
463
|
-
* connect endpoint injects — identical across every Connection row (one
|
|
464
|
-
* cTrader app), never persisted on a connection. We take them from the first
|
|
465
|
-
* row that carries them.
|
|
466
|
-
*
|
|
467
|
-
* Accounts are deduped on `ctidTraderAccountId` first-wins: Spotware ids are
|
|
468
|
-
* globally unique across logins, so a duplicate can only appear if the same
|
|
469
|
-
* account somehow surfaced under two grants — first-wins keeps it
|
|
470
|
-
* deterministic.
|
|
471
|
-
*
|
|
472
|
-
* `accounts` may be empty (no cTrader Connection at all), in which case we
|
|
473
|
-
* return empty creds rather than throwing.
|
|
474
|
-
*/
|
|
475
|
-
getCTraderAccounts(): Promise<{
|
|
476
|
-
accounts: {
|
|
477
|
-
ctidTraderAccountId: string;
|
|
478
|
-
host: string;
|
|
479
|
-
isLive: boolean;
|
|
480
|
-
brokerName?: string;
|
|
481
|
-
accountNumber?: string;
|
|
482
|
-
accessToken: string;
|
|
483
|
-
}[];
|
|
484
|
-
clientId: string;
|
|
485
|
-
clientSecret: string;
|
|
486
|
-
}>;
|
|
487
|
-
/**
|
|
488
|
-
* @deprecated Returns a single primary credential blob (legacy "pick-the-
|
|
489
|
-
* default-connection" shape). Use `getGithubAccounts()` for the multi-
|
|
490
|
-
* account shape required by Pattern A — explicit selector args on every
|
|
491
|
-
* tool. Retained because the `@alfe.ai/github-mcp` proxy is the
|
|
492
|
-
* only consumer that knows about Pattern A; legacy env-interpolation
|
|
493
|
-
* callers will keep hitting `/credentials` until they move to the proxy.
|
|
494
|
-
*/
|
|
495
|
-
getGithubCredentials(): Promise<{
|
|
496
|
-
login: string;
|
|
497
|
-
accessToken: string;
|
|
498
|
-
}>;
|
|
499
|
-
/**
|
|
500
|
-
* Pattern A: multi-account credential fetch for GitHub.
|
|
501
|
-
*
|
|
502
|
-
* Returns every agent-scoped GitHub connection. The caller is expected
|
|
503
|
-
* to require a `login` selector on every credential-touching tool and
|
|
504
|
-
* look up the matching account at dispatch time.
|
|
505
|
-
*
|
|
506
|
-
* GitHub OAuth tokens have no expiry (`tokenLifecycle: "no_expiry"`),
|
|
507
|
-
* so there is intentionally no `refreshGithubAccountToken` method — if
|
|
508
|
-
* a token is revoked the user must re-run the OAuth flow.
|
|
825
|
+
* GitHub OAuth tokens have no expiry (`tokenLifecycle: "no_expiry"`),
|
|
826
|
+
* so there is intentionally no `refreshGithubAccountToken` method — if
|
|
827
|
+
* a token is revoked the user must re-run the OAuth flow.
|
|
509
828
|
*
|
|
510
829
|
* Returned `accounts[i].login` is the GitHub username — the stable
|
|
511
830
|
* cross-session identifier the LLM should pass.
|
|
@@ -521,67 +840,6 @@ declare class AgentApiClient {
|
|
|
521
840
|
scopes: string;
|
|
522
841
|
}[];
|
|
523
842
|
}>;
|
|
524
|
-
/**
|
|
525
|
-
* Pattern A: provider-parameterized multi-account credential fetch for the
|
|
526
|
-
* social connectors (Bluesky, and the approval-gated backlog: X, Meta,
|
|
527
|
-
* Threads, LinkedIn, Pinterest, TikTok, Reddit, YouTube).
|
|
528
|
-
*
|
|
529
|
-
* Unlike the bespoke `getGithubAccounts()` / `getXeroAccounts()` shapes,
|
|
530
|
-
* this returns a UNIFORM normalized account shape so `@alfe.ai/social-mcp`'s
|
|
531
|
-
* shared driver can require a single `account` selector on every
|
|
532
|
-
* credential-touching tool regardless of platform. The backend
|
|
533
|
-
* `api-agents/{provider}/accounts` route is already provider-generic; this
|
|
534
|
-
* is the client-side normalization the plan (`do-we-need-any-moonlit-toucan`
|
|
535
|
-
* Phase 0, step 5) calls for.
|
|
536
|
-
*
|
|
537
|
-
* `accountIdentifier` is the stable per-account selector the LLM should
|
|
538
|
-
* pass back (for Bluesky: the account DID). `accessToken` carries whatever
|
|
539
|
-
* the provider's `buildCredentialsResponse` bundles (for Bluesky: the JSON
|
|
540
|
-
* session bundle — the driver parses the `accessJwt` out of it, or reads the
|
|
541
|
-
* top-level `accessJwt` from `providerMetadata`-adjacent fields). Everything
|
|
542
|
-
* else the driver needs for routing (handle, pdsHost, did, …) is on
|
|
543
|
-
* `providerMetadata`.
|
|
544
|
-
*
|
|
545
|
-
* Token refresh is delegated to connect (never done in-plugin) via the
|
|
546
|
-
* per-account route `POST /agent/connect/{provider}/accounts/{accountIdentifier}/refresh`
|
|
547
|
-
* — call `refreshSocialAccount(provider, accountIdentifier)`. (The non-account
|
|
548
|
-
* `POST /agent/connect/{provider}/refresh` route refreshes the provider's
|
|
549
|
-
* PRIMARY connection, which is wrong under multi-account Pattern A.)
|
|
550
|
-
*/
|
|
551
|
-
getSocialAccounts(provider: string): Promise<{
|
|
552
|
-
provider: string;
|
|
553
|
-
accounts: {
|
|
554
|
-
connectionId: string;
|
|
555
|
-
accountIdentifier: string;
|
|
556
|
-
displayName: string | null;
|
|
557
|
-
accessToken: string;
|
|
558
|
-
providerMetadata: Record<string, unknown>;
|
|
559
|
-
connectedAt: string;
|
|
560
|
-
}[];
|
|
561
|
-
}>;
|
|
562
|
-
/**
|
|
563
|
-
* Pattern A: refresh a specific social Connection by its stable
|
|
564
|
-
* `accountIdentifier` (for Bluesky: the account DID) via the
|
|
565
|
-
* provider-generic per-account refresh route. The counterpart to
|
|
566
|
-
* `getSocialAccounts(provider)`; `@alfe.ai/social-mcp` calls this on a
|
|
567
|
-
* 401/ExpiredToken from the platform PDS/API, then re-fetches accounts to
|
|
568
|
-
* pick up the rotated bundle.
|
|
569
|
-
*
|
|
570
|
-
* Refresh itself is ALWAYS delegated to connect — the plugin never calls
|
|
571
|
-
* the platform's own refresh XRPC (e.g. `com.atproto.server.refreshSession`)
|
|
572
|
-
* because connect owns the encrypted refresh token + rotation persistence
|
|
573
|
-
* (Bluesky rotates the refreshJwt; a missed rotation kills the connection
|
|
574
|
-
* after one refresh). The returned `accessToken` is whatever the provider's
|
|
575
|
-
* `refreshToken` hook re-bundled (for Bluesky: the JSON session bundle with
|
|
576
|
-
* the fresh `accessJwt`) — callers typically ignore it and re-fetch via
|
|
577
|
-
* `getSocialAccounts` for a consistent shape.
|
|
578
|
-
*/
|
|
579
|
-
refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{
|
|
580
|
-
accountIdentifier: string;
|
|
581
|
-
accessToken: string;
|
|
582
|
-
accessTokenExpiresAt: string;
|
|
583
|
-
expiresAt: string;
|
|
584
|
-
}>;
|
|
585
843
|
/**
|
|
586
844
|
* @deprecated Returns a single primary credential blob (legacy "pick-the-
|
|
587
845
|
* default-connection" shape). Use `getXeroAccounts()` for the multi-
|
|
@@ -817,67 +1075,6 @@ declare class AgentApiClient {
|
|
|
817
1075
|
accessTokenExpiresAt: string;
|
|
818
1076
|
expiresAt: string;
|
|
819
1077
|
}>;
|
|
820
|
-
/**
|
|
821
|
-
* @deprecated Returns a single primary credential blob. Use
|
|
822
|
-
* `getShopifyAccounts()` for the multi-account shape required by Pattern A
|
|
823
|
-
* (`@alfe.ai/shopify-mcp` keys per-shop on the myshopify domain).
|
|
824
|
-
*/
|
|
825
|
-
getShopifyCredentials(): Promise<{
|
|
826
|
-
accessToken: string;
|
|
827
|
-
shopDomain: string;
|
|
828
|
-
shopGid: string;
|
|
829
|
-
shopName: string;
|
|
830
|
-
apiVersion: string;
|
|
831
|
-
}>;
|
|
832
|
-
/**
|
|
833
|
-
* Pattern A: multi-account credential fetch for Shopify. Returns every
|
|
834
|
-
* agent-scoped Shopify Connection. One OAuth grant maps to one store, so the
|
|
835
|
-
* stable per-call selector is the store's myshopify domain (`shopDomain`),
|
|
836
|
-
* NOT `accountIdentifier` — the connect provider keys `accountIdentifier` on
|
|
837
|
-
* the immutable shop GID (falling back to the domain), so `shopDomain` is the
|
|
838
|
-
* value the LLM passes and the plugin routes on.
|
|
839
|
-
*
|
|
840
|
-
* Each entry is shaped by the connect provider's `buildCredentialsResponse`:
|
|
841
|
-
* `{ accessToken, shopDomain, shopGid, shopName, apiVersion }` — offline
|
|
842
|
-
* Shopify tokens never expire, so there is NO token / expiry field and no
|
|
843
|
-
* refresh method (unlike Salesforce). The GraphQL Admin API authenticates
|
|
844
|
-
* purely on `X-Shopify-Access-Token`; no client credentials are on the wire.
|
|
845
|
-
*/
|
|
846
|
-
getShopifyAccounts(): Promise<{
|
|
847
|
-
accounts: {
|
|
848
|
-
connectionId: string;
|
|
849
|
-
accountIdentifier: string;
|
|
850
|
-
displayName: string | null;
|
|
851
|
-
connectedAt: string;
|
|
852
|
-
accessToken: string;
|
|
853
|
-
shopDomain: string;
|
|
854
|
-
shopGid: string;
|
|
855
|
-
shopName: string;
|
|
856
|
-
apiVersion: string;
|
|
857
|
-
}[];
|
|
858
|
-
}>;
|
|
859
|
-
/**
|
|
860
|
-
* Disconnects one connected Microsoft 365 account for the agent, by its
|
|
861
|
-
* `accountIdentifier`. Hits the generic per-account disconnect route
|
|
862
|
-
* (`DELETE /agent/connect/microsoft/accounts/{accountIdentifier}`), which
|
|
863
|
-
* resolves across the agent's full effective scope chain and deletes the
|
|
864
|
-
* matching Connection row. Returns the remaining accounts.
|
|
865
|
-
*
|
|
866
|
-
* IMPORTANT: pass the `accountIdentifier` from `getMicrosoftAccounts()`, NOT
|
|
867
|
-
* a synthesised email. For Microsoft, `accountIdentifier` is the user's email
|
|
868
|
-
* only when the Graph profile fetch succeeded at connect time; it falls back
|
|
869
|
-
* to the Azure tenant id (`tid` claim) otherwise. The backend matches on
|
|
870
|
-
* `accountIdentifier` exactly, so passing an email would 404 on those
|
|
871
|
-
* fallback-identifier accounts. (This is why the param is not named `email`,
|
|
872
|
-
* unlike `disconnectGoogleAccount` where the identifier is always the email.)
|
|
873
|
-
*/
|
|
874
|
-
disconnectMicrosoftAccount(accountIdentifier: string): Promise<{
|
|
875
|
-
accounts: {
|
|
876
|
-
accountIdentifier: string;
|
|
877
|
-
displayName?: string;
|
|
878
|
-
connectedAt?: string;
|
|
879
|
-
}[];
|
|
880
|
-
}>;
|
|
881
1078
|
/**
|
|
882
1079
|
* Pattern A: multi-account credential fetch for Microsoft 365.
|
|
883
1080
|
*
|
|
@@ -928,242 +1125,213 @@ declare class AgentApiClient {
|
|
|
928
1125
|
accessTokenExpiresAt: string;
|
|
929
1126
|
expiresAt: string;
|
|
930
1127
|
}>;
|
|
931
|
-
getTeamsCredentials(): Promise<{
|
|
932
|
-
agentId: string;
|
|
933
|
-
tenantId: string;
|
|
934
|
-
azureAppId: string;
|
|
935
|
-
azureBotId: string;
|
|
936
|
-
azureClientSecret: string;
|
|
937
|
-
botDisplayName?: string;
|
|
938
|
-
teamsTenantId?: string;
|
|
939
|
-
serviceUrl?: string;
|
|
940
|
-
}>;
|
|
941
|
-
sendTeamsMessage(data: {
|
|
942
|
-
conversationId: string;
|
|
943
|
-
text?: string;
|
|
944
|
-
adaptiveCard?: Record<string, unknown>;
|
|
945
|
-
}): Promise<{
|
|
946
|
-
ok: boolean;
|
|
947
|
-
activityId: string;
|
|
948
|
-
}>;
|
|
949
|
-
listTeamsChannels(): Promise<{
|
|
950
|
-
channels: {
|
|
951
|
-
id: string;
|
|
952
|
-
name: string;
|
|
953
|
-
description?: string;
|
|
954
|
-
}[];
|
|
955
|
-
}>;
|
|
956
|
-
presignAttachments(files: {
|
|
957
|
-
filename: string;
|
|
958
|
-
mimeType: string;
|
|
959
|
-
size: number;
|
|
960
|
-
}[]): Promise<{
|
|
961
|
-
attachments: {
|
|
962
|
-
id: string;
|
|
963
|
-
uploadUrl: string;
|
|
964
|
-
downloadUrl: string;
|
|
965
|
-
s3Key: string;
|
|
966
|
-
expiresAt: string;
|
|
967
|
-
}[];
|
|
968
|
-
}>;
|
|
969
1128
|
/**
|
|
970
|
-
*
|
|
971
|
-
*
|
|
972
|
-
* `
|
|
1129
|
+
* Disconnects one connected Microsoft 365 account for the agent, by its
|
|
1130
|
+
* `accountIdentifier`. Hits the generic per-account disconnect route
|
|
1131
|
+
* (`DELETE /agent/connect/microsoft/accounts/{accountIdentifier}`), which
|
|
1132
|
+
* resolves across the agent's full effective scope chain and deletes the
|
|
1133
|
+
* matching Connection row. Returns the remaining accounts.
|
|
973
1134
|
*
|
|
974
|
-
*
|
|
975
|
-
*
|
|
976
|
-
*
|
|
977
|
-
*
|
|
978
|
-
*
|
|
1135
|
+
* IMPORTANT: pass the `accountIdentifier` from `getMicrosoftAccounts()`, NOT
|
|
1136
|
+
* a synthesised email. For Microsoft, `accountIdentifier` is the user's email
|
|
1137
|
+
* only when the Graph profile fetch succeeded at connect time; it falls back
|
|
1138
|
+
* to the Azure tenant id (`tid` claim) otherwise. The backend matches on
|
|
1139
|
+
* `accountIdentifier` exactly, so passing an email would 404 on those
|
|
1140
|
+
* fallback-identifier accounts. (This is why the param is not named `email`,
|
|
1141
|
+
* unlike `disconnectGoogleAccount` where the identifier is always the email.)
|
|
979
1142
|
*/
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
imageUrl: string;
|
|
987
|
-
model: string;
|
|
988
|
-
}>;
|
|
989
|
-
recordActivity(data: {
|
|
990
|
-
userId?: string;
|
|
991
|
-
channel: string;
|
|
992
|
-
role: "user" | "assistant";
|
|
993
|
-
}): Promise<{
|
|
994
|
-
recorded: boolean;
|
|
1143
|
+
disconnectMicrosoftAccount(accountIdentifier: string): Promise<{
|
|
1144
|
+
accounts: {
|
|
1145
|
+
accountIdentifier: string;
|
|
1146
|
+
displayName?: string;
|
|
1147
|
+
connectedAt?: string;
|
|
1148
|
+
}[];
|
|
995
1149
|
}>;
|
|
996
|
-
/** Update the agent's own name and/or voice config. Returns the updated agent. */
|
|
997
|
-
updateSelf(update: {
|
|
998
|
-
name?: string;
|
|
999
|
-
voiceConfig?: AgentVoiceConfig;
|
|
1000
|
-
}): Promise<AgentSelf>;
|
|
1001
1150
|
/**
|
|
1002
|
-
*
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
-
*
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1008
|
-
*
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
prompt: string;
|
|
1012
|
-
}): Promise<AgentSelf>;
|
|
1013
|
-
/**
|
|
1014
|
-
* Get a presigned PUT URL to upload a new avatar image. Upload the bytes to
|
|
1015
|
-
* `uploadUrl`, then call `finalizeAvatar(s3Key)` to set it on the agent.
|
|
1151
|
+
* Resolve the primary cTrader Connection's credentials for the calling
|
|
1152
|
+
* agent. Unlike most providers, the cTrader Open API needs app-level auth
|
|
1153
|
+
* (`clientId` + `clientSecret`) AND account auth (`accessToken` +
|
|
1154
|
+
* `accountId`) on the socket, so `@alfe.ai/ctrader-mcp` self-fetches the
|
|
1155
|
+
* full set here at startup (the atlassian/google pattern). `clientId` /
|
|
1156
|
+
* `clientSecret` are the SST-sourced global app credentials the connect
|
|
1157
|
+
* endpoint injects — they are never persisted on the connection. `host` is
|
|
1158
|
+
* the resolved TLS endpoint (`live.ctraderapi.com` / `demo.ctraderapi.com`)
|
|
1159
|
+
* derived from the selected account's live/demo flag.
|
|
1016
1160
|
*/
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1161
|
+
getCTraderCredentials(): Promise<{
|
|
1162
|
+
accessToken: string;
|
|
1163
|
+
refreshToken: string;
|
|
1164
|
+
accountId: string;
|
|
1165
|
+
host: string;
|
|
1166
|
+
clientId: string;
|
|
1167
|
+
clientSecret: string;
|
|
1168
|
+
}>;
|
|
1021
1169
|
/**
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
1170
|
+
* Pattern A: multi-account credential fetch for cTrader.
|
|
1171
|
+
*
|
|
1172
|
+
* Unlike atlassian/salesforce (one Connection row per account/site), a
|
|
1173
|
+
* cTrader is MULTI-grant per agent: an agent may connect several distinct
|
|
1174
|
+
* cTrader logins, each its own Connection row keyed on `accountIdentifier =
|
|
1175
|
+
* ctid:<userId>` (Phase 1). This aggregates the *trading accounts* across
|
|
1176
|
+
* ALL of those Connection rows — each row contributes its `availableAccounts`
|
|
1177
|
+
* flattened, and every account carries ITS OWN grant's `accessToken` (the
|
|
1178
|
+
* token that authenticates that account against the cTrader Open API). One
|
|
1179
|
+
* OAuth grant still covers all accounts under that single login on one shared
|
|
1180
|
+
* token; only the `ctidTraderAccountId` and the protobuf socket `host` (live
|
|
1181
|
+
* vs demo) differ within a grant. Across grants the tokens differ, so the
|
|
1182
|
+
* token is now PER-ACCOUNT rather than hoisted to the top level.
|
|
1183
|
+
*
|
|
1184
|
+
* `host` per account is derived from the account's `isLive` flag
|
|
1185
|
+
* (`live.ctraderapi.com` / `demo.ctraderapi.com`) — the same mapping the
|
|
1186
|
+
* connect provider applies server-side when an account is auto-selected.
|
|
1187
|
+
*
|
|
1188
|
+
* `clientId` / `clientSecret` are the SST-sourced GLOBAL app credentials the
|
|
1189
|
+
* connect endpoint injects — identical across every Connection row (one
|
|
1190
|
+
* cTrader app), never persisted on a connection. We take them from the first
|
|
1191
|
+
* row that carries them.
|
|
1192
|
+
*
|
|
1193
|
+
* Accounts are deduped on `ctidTraderAccountId` first-wins: Spotware ids are
|
|
1194
|
+
* globally unique across logins, so a duplicate can only appear if the same
|
|
1195
|
+
* account somehow surfaced under two grants — first-wins keeps it
|
|
1196
|
+
* deterministic.
|
|
1197
|
+
*
|
|
1198
|
+
* `accounts` may be empty (no cTrader Connection at all), in which case we
|
|
1199
|
+
* return empty creds rather than throwing.
|
|
1024
1200
|
*/
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1201
|
+
getCTraderAccounts(): Promise<{
|
|
1202
|
+
accounts: {
|
|
1203
|
+
ctidTraderAccountId: string;
|
|
1204
|
+
host: string;
|
|
1205
|
+
isLive: boolean;
|
|
1206
|
+
brokerName?: string;
|
|
1207
|
+
accountNumber?: string;
|
|
1208
|
+
accessToken: string;
|
|
1209
|
+
}[];
|
|
1210
|
+
clientId: string;
|
|
1211
|
+
clientSecret: string;
|
|
1029
1212
|
}>;
|
|
1030
1213
|
/**
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
* or field it doesn't own. Legacy single-envelope secrets are migrated to
|
|
1035
|
-
* `field#value` rows by the data migration, so call with `fieldKey: "value"`
|
|
1036
|
-
* to reach them.
|
|
1214
|
+
* @deprecated Returns a single primary credential blob. Use
|
|
1215
|
+
* `getShopifyAccounts()` for the multi-account shape required by Pattern A
|
|
1216
|
+
* (`@alfe.ai/shopify-mcp` keys per-shop on the myshopify domain).
|
|
1037
1217
|
*/
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1218
|
+
getShopifyCredentials(): Promise<{
|
|
1219
|
+
accessToken: string;
|
|
1220
|
+
shopDomain: string;
|
|
1221
|
+
shopGid: string;
|
|
1222
|
+
shopName: string;
|
|
1223
|
+
apiVersion: string;
|
|
1224
|
+
}>;
|
|
1044
1225
|
/**
|
|
1045
|
-
*
|
|
1046
|
-
*
|
|
1047
|
-
*
|
|
1048
|
-
* `
|
|
1226
|
+
* Pattern A: multi-account credential fetch for Shopify. Returns every
|
|
1227
|
+
* agent-scoped Shopify Connection. One OAuth grant maps to one store, so the
|
|
1228
|
+
* stable per-call selector is the store's myshopify domain (`shopDomain`),
|
|
1229
|
+
* NOT `accountIdentifier` — the connect provider keys `accountIdentifier` on
|
|
1230
|
+
* the immutable shop GID (falling back to the domain), so `shopDomain` is the
|
|
1231
|
+
* value the LLM passes and the plugin routes on.
|
|
1232
|
+
*
|
|
1233
|
+
* Each entry is shaped by the connect provider's `buildCredentialsResponse`:
|
|
1234
|
+
* `{ accessToken, shopDomain, shopGid, shopName, apiVersion }` — offline
|
|
1235
|
+
* Shopify tokens never expire, so there is NO token / expiry field and no
|
|
1236
|
+
* refresh method (unlike Salesforce). The GraphQL Admin API authenticates
|
|
1237
|
+
* purely on `X-Shopify-Access-Token`; no client credentials are on the wire.
|
|
1049
1238
|
*/
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1239
|
+
getShopifyAccounts(): Promise<{
|
|
1240
|
+
accounts: {
|
|
1241
|
+
connectionId: string;
|
|
1242
|
+
accountIdentifier: string;
|
|
1243
|
+
displayName: string | null;
|
|
1244
|
+
connectedAt: string;
|
|
1245
|
+
accessToken: string;
|
|
1246
|
+
shopDomain: string;
|
|
1247
|
+
shopGid: string;
|
|
1248
|
+
shopName: string;
|
|
1249
|
+
apiVersion: string;
|
|
1250
|
+
}[];
|
|
1058
1251
|
}>;
|
|
1059
1252
|
/**
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1063
|
-
*
|
|
1253
|
+
* Pattern A: provider-parameterized multi-account credential fetch for the
|
|
1254
|
+
* social connectors (Bluesky, and the approval-gated backlog: X, Meta,
|
|
1255
|
+
* Threads, LinkedIn, Pinterest, TikTok, Reddit, YouTube).
|
|
1256
|
+
*
|
|
1257
|
+
* Unlike the bespoke `getGithubAccounts()` / `getXeroAccounts()` shapes,
|
|
1258
|
+
* this returns a UNIFORM normalized account shape so `@alfe.ai/social-mcp`'s
|
|
1259
|
+
* shared driver can require a single `account` selector on every
|
|
1260
|
+
* credential-touching tool regardless of platform. The backend
|
|
1261
|
+
* `api-agents/{provider}/accounts` route is already provider-generic; this
|
|
1262
|
+
* is the client-side normalization the plan (`do-we-need-any-moonlit-toucan`
|
|
1263
|
+
* Phase 0, step 5) calls for.
|
|
1264
|
+
*
|
|
1265
|
+
* `accountIdentifier` is the stable per-account selector the LLM should
|
|
1266
|
+
* pass back (for Bluesky: the account DID). `accessToken` carries whatever
|
|
1267
|
+
* the provider's `buildCredentialsResponse` bundles (for Bluesky: the JSON
|
|
1268
|
+
* session bundle — the driver parses the `accessJwt` out of it, or reads the
|
|
1269
|
+
* top-level `accessJwt` from `providerMetadata`-adjacent fields). Everything
|
|
1270
|
+
* else the driver needs for routing (handle, pdsHost, did, …) is on
|
|
1271
|
+
* `providerMetadata`.
|
|
1272
|
+
*
|
|
1273
|
+
* Token refresh is delegated to connect (never done in-plugin) via the
|
|
1274
|
+
* per-account route `POST /agent/connect/{provider}/accounts/{accountIdentifier}/refresh`
|
|
1275
|
+
* — call `refreshSocialAccount(provider, accountIdentifier)`. (The non-account
|
|
1276
|
+
* `POST /agent/connect/{provider}/refresh` route refreshes the provider's
|
|
1277
|
+
* PRIMARY connection, which is wrong under multi-account Pattern A.)
|
|
1064
1278
|
*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
key: string;
|
|
1075
|
-
format?: FieldFormat;
|
|
1076
|
-
sensitivity: FieldSensitivity;
|
|
1077
|
-
value?: string;
|
|
1078
|
-
envelope?: EncryptedEnvelopeV1;
|
|
1279
|
+
getSocialAccounts(provider: string): Promise<{
|
|
1280
|
+
provider: string;
|
|
1281
|
+
accounts: {
|
|
1282
|
+
connectionId: string;
|
|
1283
|
+
accountIdentifier: string;
|
|
1284
|
+
displayName: string | null;
|
|
1285
|
+
accessToken: string;
|
|
1286
|
+
providerMetadata: Record<string, unknown>;
|
|
1287
|
+
connectedAt: string;
|
|
1079
1288
|
}[];
|
|
1080
|
-
reason?: string;
|
|
1081
|
-
}): Promise<SecretAggregate>;
|
|
1082
|
-
/** Fetch the secret aggregate plus per-field encrypted envelopes. */
|
|
1083
|
-
getSecret(args: {
|
|
1084
|
-
scope: SecretScope;
|
|
1085
|
-
scopeId: string;
|
|
1086
|
-
secretId: string;
|
|
1087
|
-
}): Promise<{
|
|
1088
|
-
aggregate: SecretAggregate;
|
|
1089
|
-
envelopes: FieldEnvelope[];
|
|
1090
1289
|
}>;
|
|
1091
|
-
/**
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
sensitivity: FieldSensitivity;
|
|
1114
|
-
format?: FieldFormat;
|
|
1115
|
-
value?: string;
|
|
1116
|
-
envelope?: EncryptedEnvelopeV1;
|
|
1117
|
-
reason?: string;
|
|
1118
|
-
}): Promise<{
|
|
1119
|
-
fieldKey: string;
|
|
1120
|
-
rotated: boolean;
|
|
1290
|
+
/**
|
|
1291
|
+
* Pattern A: refresh a specific social Connection by its stable
|
|
1292
|
+
* `accountIdentifier` (for Bluesky: the account DID) via the
|
|
1293
|
+
* provider-generic per-account refresh route. The counterpart to
|
|
1294
|
+
* `getSocialAccounts(provider)`; `@alfe.ai/social-mcp` calls this on a
|
|
1295
|
+
* 401/ExpiredToken from the platform PDS/API, then re-fetches accounts to
|
|
1296
|
+
* pick up the rotated bundle.
|
|
1297
|
+
*
|
|
1298
|
+
* Refresh itself is ALWAYS delegated to connect — the plugin never calls
|
|
1299
|
+
* the platform's own refresh XRPC (e.g. `com.atproto.server.refreshSession`)
|
|
1300
|
+
* because connect owns the encrypted refresh token + rotation persistence
|
|
1301
|
+
* (Bluesky rotates the refreshJwt; a missed rotation kills the connection
|
|
1302
|
+
* after one refresh). The returned `accessToken` is whatever the provider's
|
|
1303
|
+
* `refreshToken` hook re-bundled (for Bluesky: the JSON session bundle with
|
|
1304
|
+
* the fresh `accessJwt`) — callers typically ignore it and re-fetch via
|
|
1305
|
+
* `getSocialAccounts` for a consistent shape.
|
|
1306
|
+
*/
|
|
1307
|
+
refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{
|
|
1308
|
+
accountIdentifier: string;
|
|
1309
|
+
accessToken: string;
|
|
1310
|
+
accessTokenExpiresAt: string;
|
|
1311
|
+
expiresAt: string;
|
|
1121
1312
|
}>;
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
scopeId: string;
|
|
1133
|
-
secretId: string;
|
|
1134
|
-
secretName?: string;
|
|
1135
|
-
description?: string;
|
|
1136
|
-
tags?: string[];
|
|
1137
|
-
category?: SecretCategory;
|
|
1138
|
-
reason?: string;
|
|
1139
|
-
}): Promise<SecretAggregate>;
|
|
1140
|
-
/** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
|
|
1141
|
-
listSecrets(args: {
|
|
1142
|
-
scope: SecretScope;
|
|
1143
|
-
scopeId: string;
|
|
1144
|
-
category?: SecretCategory;
|
|
1145
|
-
tag?: string;
|
|
1146
|
-
fieldKey?: string;
|
|
1147
|
-
}): Promise<SecretMetadata[]>;
|
|
1148
|
-
/** Bounded changelog read — metadata-only audit entries. */
|
|
1149
|
-
getSecretHistory(args: {
|
|
1150
|
-
scope: SecretScope;
|
|
1151
|
-
scopeId: string;
|
|
1152
|
-
secretId: string;
|
|
1153
|
-
limit?: number;
|
|
1154
|
-
cursor?: string;
|
|
1155
|
-
}): Promise<{
|
|
1156
|
-
entries: ChangelogEntry[];
|
|
1157
|
-
nextCursor?: string;
|
|
1313
|
+
}
|
|
1314
|
+
//# sourceMappingURL=connect-credentials.d.ts.map
|
|
1315
|
+
//#endregion
|
|
1316
|
+
//#region src/domains/database.d.ts
|
|
1317
|
+
declare class DatabaseApi extends ApiBase {
|
|
1318
|
+
registerDatabaseCredentials(): Promise<{
|
|
1319
|
+
connectionString: string;
|
|
1320
|
+
username: string;
|
|
1321
|
+
password: string;
|
|
1322
|
+
databases: string[];
|
|
1158
1323
|
}>;
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1324
|
+
reportDatabaseAudit(entry: {
|
|
1325
|
+
database: string;
|
|
1326
|
+
collection: string;
|
|
1327
|
+
operation: string;
|
|
1328
|
+
summary?: string;
|
|
1164
1329
|
}): Promise<void>;
|
|
1165
|
-
|
|
1166
|
-
|
|
1330
|
+
}
|
|
1331
|
+
//# sourceMappingURL=database.d.ts.map
|
|
1332
|
+
//#endregion
|
|
1333
|
+
//#region src/domains/identity.d.ts
|
|
1334
|
+
declare class IdentityApi extends ApiBase {
|
|
1167
1335
|
/**
|
|
1168
1336
|
* Returns the calling agent's own identity context — `{ agentId, tenantId }`
|
|
1169
1337
|
* decoded server-side from the agent API token. Used by the
|
|
@@ -1326,6 +1494,62 @@ declare class AgentApiClient {
|
|
|
1326
1494
|
identityId: string | null;
|
|
1327
1495
|
status: string;
|
|
1328
1496
|
}>;
|
|
1497
|
+
}
|
|
1498
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
1499
|
+
//#endregion
|
|
1500
|
+
//#region src/domains/images.d.ts
|
|
1501
|
+
declare class ImagesApi extends ApiBase {
|
|
1502
|
+
/**
|
|
1503
|
+
* Generate an image from a text prompt and get back a STABLE, public URL
|
|
1504
|
+
* (served from the agent-assets CDN — it does not expire). Embed the returned
|
|
1505
|
+
* `imageUrl` in a reply as markdown to show it to the user.
|
|
1506
|
+
*
|
|
1507
|
+
* ASYNC: `gpt-image-1` routinely runs 30–60s, which exceeds the API Gateway
|
|
1508
|
+
* 30s ceiling, so this enqueues a job (`POST /agent/images/generate` →
|
|
1509
|
+
* `jobId`) then polls (`GET /agent/images/{jobId}`) until it completes. The
|
|
1510
|
+
* worker's real failure message (e.g. an unsupported `size`) surfaces via the
|
|
1511
|
+
* job's `error` field.
|
|
1512
|
+
*/
|
|
1513
|
+
generateImage(args: {
|
|
1514
|
+
prompt: string;
|
|
1515
|
+
model?: string;
|
|
1516
|
+
size?: string;
|
|
1517
|
+
quality?: string;
|
|
1518
|
+
}): Promise<{
|
|
1519
|
+
imageUrl: string;
|
|
1520
|
+
model: string;
|
|
1521
|
+
}>;
|
|
1522
|
+
}
|
|
1523
|
+
//# sourceMappingURL=images.d.ts.map
|
|
1524
|
+
//#endregion
|
|
1525
|
+
//#region src/domains/integrations.d.ts
|
|
1526
|
+
declare class IntegrationsApi extends ApiBase {
|
|
1527
|
+
listIntegrations(): Promise<IntegrationInstall[]>;
|
|
1528
|
+
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
|
|
1529
|
+
updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
|
|
1530
|
+
installIntegration(integrationId: string, options?: {
|
|
1531
|
+
version?: string;
|
|
1532
|
+
config?: Record<string, unknown>;
|
|
1533
|
+
}): Promise<IntegrationInstall>;
|
|
1534
|
+
removeIntegration(integrationId: string): Promise<IntegrationInstall>;
|
|
1535
|
+
getOAuthUrl(provider: string, scopes?: string[]): Promise<{
|
|
1536
|
+
url: string;
|
|
1537
|
+
provider: string;
|
|
1538
|
+
expiresIn: number;
|
|
1539
|
+
}>;
|
|
1540
|
+
getOAuthStatus(provider: string): Promise<{
|
|
1541
|
+
provider: string;
|
|
1542
|
+
connected: boolean;
|
|
1543
|
+
config?: Record<string, string>;
|
|
1544
|
+
}>;
|
|
1545
|
+
getRegistry(): Promise<{
|
|
1546
|
+
integrations: RegistryEntry[];
|
|
1547
|
+
}>;
|
|
1548
|
+
}
|
|
1549
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/domains/memory.d.ts
|
|
1552
|
+
declare class MemoryApi extends ApiBase {
|
|
1329
1553
|
memorySearch(query: string, opts?: {
|
|
1330
1554
|
limit?: number;
|
|
1331
1555
|
topic?: string;
|
|
@@ -1402,196 +1626,216 @@ declare class AgentApiClient {
|
|
|
1402
1626
|
vectorCount: number;
|
|
1403
1627
|
tripleCount: number;
|
|
1404
1628
|
storageEstimateBytes: number;
|
|
1405
|
-
lastIngestionAt?: string;
|
|
1406
|
-
}>;
|
|
1407
|
-
memoryLearn(args: {
|
|
1408
|
-
text: string;
|
|
1409
|
-
source?: string;
|
|
1410
|
-
sourceType?: "file" | "url" | "inline";
|
|
1411
|
-
metadata?: {
|
|
1412
|
-
sessionId?: string;
|
|
1413
|
-
channelId?: string;
|
|
1414
|
-
userName?: string;
|
|
1415
|
-
};
|
|
1416
|
-
}): Promise<{
|
|
1417
|
-
memoriesStored: number;
|
|
1418
|
-
triplesStored: number;
|
|
1419
|
-
chunks: number;
|
|
1420
|
-
source?: string;
|
|
1421
|
-
}>;
|
|
1422
|
-
memoryBootstrapStatus(): Promise<{
|
|
1423
|
-
synced: boolean;
|
|
1424
|
-
syncedAt?: string;
|
|
1425
|
-
sessionsBackfillSynced?: boolean;
|
|
1426
|
-
sessionsBackfillSyncedAt?: string;
|
|
1427
|
-
}>;
|
|
1428
|
-
memoryBootstrapStatusMark(scope?: "files" | "sessions"): Promise<{
|
|
1429
|
-
synced: true;
|
|
1430
|
-
syncedAt: string;
|
|
1431
|
-
}>;
|
|
1432
|
-
sendSms(args: {
|
|
1433
|
-
to: string;
|
|
1434
|
-
body: string;
|
|
1435
|
-
}): Promise<{
|
|
1436
|
-
sent: boolean;
|
|
1437
|
-
sid: string;
|
|
1438
|
-
}>;
|
|
1439
|
-
searchWeb(params: {
|
|
1440
|
-
query: string;
|
|
1441
|
-
count?: number;
|
|
1442
|
-
offset?: number;
|
|
1443
|
-
country?: string;
|
|
1444
|
-
freshness?: string;
|
|
1445
|
-
}): Promise<unknown>;
|
|
1446
|
-
searchImages(params: {
|
|
1447
|
-
query: string;
|
|
1448
|
-
count?: number;
|
|
1449
|
-
}): Promise<unknown>;
|
|
1450
|
-
searchNews(params: {
|
|
1451
|
-
query: string;
|
|
1452
|
-
count?: number;
|
|
1453
|
-
freshness?: string;
|
|
1454
|
-
}): Promise<unknown>;
|
|
1455
|
-
/** Search news across the selected provider's corpus. → POST /agent/news/search */
|
|
1456
|
-
newsSearch(params: {
|
|
1457
|
-
query: string;
|
|
1458
|
-
provider?: NewsProvider;
|
|
1459
|
-
source?: string;
|
|
1460
|
-
from?: string;
|
|
1461
|
-
to?: string;
|
|
1462
|
-
language?: string;
|
|
1463
|
-
category?: string;
|
|
1464
|
-
limit?: number;
|
|
1465
|
-
}): Promise<NewsResult>;
|
|
1466
|
-
/** Top headlines for the selected provider. → POST /agent/news/headlines */
|
|
1467
|
-
newsHeadlines(params?: {
|
|
1468
|
-
provider?: NewsProvider;
|
|
1469
|
-
category?: string;
|
|
1470
|
-
source?: string;
|
|
1471
|
-
language?: string;
|
|
1472
|
-
limit?: number;
|
|
1473
|
-
}): Promise<NewsResult>;
|
|
1474
|
-
/**
|
|
1475
|
-
* Semantic search across the agent's member scopes. Fan-out is gated
|
|
1476
|
-
* server-side by `listScopes` set-inclusion (fail-closed). Pass
|
|
1477
|
-
* `scopeType` + `scopeId` to narrow to one scope; a non-member scope
|
|
1478
|
-
* yields empty results (never a cross-scope leak).
|
|
1479
|
-
*/
|
|
1480
|
-
knowledgeSearch(query: string, opts?: {
|
|
1481
|
-
limit?: number;
|
|
1482
|
-
scopeType?: KnowledgeScopeType;
|
|
1483
|
-
scopeId?: string;
|
|
1484
|
-
}): Promise<KnowledgeSearchResult>;
|
|
1485
|
-
/** Enumerate the scopes (org + teams + projects) this agent belongs to. */
|
|
1486
|
-
listScopes(): Promise<{
|
|
1487
|
-
scopes: KnowledgeScope[];
|
|
1629
|
+
lastIngestionAt?: string;
|
|
1488
1630
|
}>;
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1631
|
+
memoryLearn(args: {
|
|
1632
|
+
text: string;
|
|
1633
|
+
source?: string;
|
|
1634
|
+
sourceType?: "file" | "url" | "inline";
|
|
1635
|
+
metadata?: {
|
|
1636
|
+
sessionId?: string;
|
|
1637
|
+
channelId?: string;
|
|
1638
|
+
userName?: string;
|
|
1639
|
+
};
|
|
1495
1640
|
}): Promise<{
|
|
1496
|
-
|
|
1497
|
-
|
|
1641
|
+
memoriesStored: number;
|
|
1642
|
+
triplesStored: number;
|
|
1643
|
+
chunks: number;
|
|
1644
|
+
source?: string;
|
|
1645
|
+
}>;
|
|
1646
|
+
memoryBootstrapStatus(): Promise<{
|
|
1647
|
+
synced: boolean;
|
|
1648
|
+
syncedAt?: string;
|
|
1649
|
+
sessionsBackfillSynced?: boolean;
|
|
1650
|
+
sessionsBackfillSyncedAt?: string;
|
|
1651
|
+
}>;
|
|
1652
|
+
memoryBootstrapStatusMark(scope?: "files" | "sessions"): Promise<{
|
|
1653
|
+
synced: true;
|
|
1654
|
+
syncedAt: string;
|
|
1498
1655
|
}>;
|
|
1656
|
+
}
|
|
1657
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
1658
|
+
//#endregion
|
|
1659
|
+
//#region src/domains/secrets.d.ts
|
|
1660
|
+
declare class SecretsApi extends ApiBase {
|
|
1499
1661
|
/**
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
1502
|
-
*
|
|
1662
|
+
* Mint a fresh AES-256 data key for a specific (secret, field) pair. The
|
|
1663
|
+
* encryption context is rebuilt server-side from `auth.tenantId` + the body
|
|
1664
|
+
* fields including `fieldKey`; the agent cannot forge context for a scope
|
|
1665
|
+
* or field it doesn't own. Legacy single-envelope secrets are migrated to
|
|
1666
|
+
* `field#value` rows by the data migration, so call with `fieldKey: "value"`
|
|
1667
|
+
* to reach them.
|
|
1503
1668
|
*/
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1669
|
+
generateSecretDataKey(args: {
|
|
1670
|
+
scope: SecretScope;
|
|
1671
|
+
scopeId: string;
|
|
1672
|
+
secretId: string;
|
|
1673
|
+
fieldKey: string;
|
|
1674
|
+
}): Promise<GeneratedDataKey>;
|
|
1508
1675
|
/**
|
|
1509
|
-
*
|
|
1510
|
-
* `
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1513
|
-
* authorKind are server-set from the agent token — never trusted here.
|
|
1676
|
+
* Unwrap a wrapped data key so the agent can decrypt the envelope locally.
|
|
1677
|
+
* `fieldKey` MUST match the value supplied when the data key was generated
|
|
1678
|
+
* (it's bound into KMS encryption context); mismatch fails with
|
|
1679
|
+
* `InvalidCiphertextException`.
|
|
1514
1680
|
*/
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1681
|
+
decryptSecretDataKey(args: {
|
|
1682
|
+
scope: SecretScope;
|
|
1683
|
+
scopeId: string;
|
|
1684
|
+
secretId: string;
|
|
1685
|
+
fieldKey: string;
|
|
1686
|
+
dataKeyCiphertext: string;
|
|
1518
1687
|
}): Promise<{
|
|
1519
|
-
|
|
1688
|
+
plaintextKey: string;
|
|
1520
1689
|
}>;
|
|
1521
1690
|
/**
|
|
1522
|
-
*
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1526
|
-
* canonical doc — attributed to this agent — only when a reviewer approves.
|
|
1527
|
-
*/
|
|
1528
|
-
proposeScopeChange(scopeType: KnowledgeScopeType, scopeId: string, input: ProposeScopeChangeInput): Promise<KnowledgeChangeRequest>;
|
|
1529
|
-
/**
|
|
1530
|
-
* List the agent's OWN change requests in a scope (filtered server-side to
|
|
1531
|
-
* this agent as proposer). Pass `status` to narrow to open / approved / etc.
|
|
1691
|
+
* Create a new secret with one or more fields. Encrypted fields must arrive
|
|
1692
|
+
* pre-sealed (the agent has already obtained per-field data keys via
|
|
1693
|
+
* `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).
|
|
1694
|
+
* Plaintext fields ship the value inline.
|
|
1532
1695
|
*/
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1696
|
+
createSecret(args: {
|
|
1697
|
+
scope: SecretScope;
|
|
1698
|
+
scopeId: string;
|
|
1699
|
+
secretId: string;
|
|
1700
|
+
secretName: string;
|
|
1701
|
+
category?: SecretCategory;
|
|
1702
|
+
description?: string;
|
|
1703
|
+
tags?: string[];
|
|
1704
|
+
fields: {
|
|
1705
|
+
key: string;
|
|
1706
|
+
format?: FieldFormat;
|
|
1707
|
+
sensitivity: FieldSensitivity;
|
|
1708
|
+
value?: string;
|
|
1709
|
+
envelope?: EncryptedEnvelopeV1;
|
|
1710
|
+
}[];
|
|
1711
|
+
reason?: string;
|
|
1712
|
+
}): Promise<SecretAggregate>;
|
|
1713
|
+
/** Fetch the secret aggregate plus per-field encrypted envelopes. */
|
|
1714
|
+
getSecret(args: {
|
|
1715
|
+
scope: SecretScope;
|
|
1716
|
+
scopeId: string;
|
|
1717
|
+
secretId: string;
|
|
1537
1718
|
}): Promise<{
|
|
1538
|
-
|
|
1539
|
-
|
|
1719
|
+
aggregate: SecretAggregate;
|
|
1720
|
+
envelopes: FieldEnvelope[];
|
|
1540
1721
|
}>;
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1722
|
+
/** Fetch one field. Plaintext: value inline. Encrypted: envelope. */
|
|
1723
|
+
getSecretField(args: {
|
|
1724
|
+
scope: SecretScope;
|
|
1725
|
+
scopeId: string;
|
|
1726
|
+
secretId: string;
|
|
1727
|
+
fieldKey: string;
|
|
1728
|
+
}): Promise<{
|
|
1729
|
+
key: string;
|
|
1730
|
+
sensitivity: FieldSensitivity;
|
|
1731
|
+
format?: FieldFormat;
|
|
1732
|
+
value?: string;
|
|
1733
|
+
envelope?: EncryptedEnvelopeV1;
|
|
1734
|
+
rotatedAt?: string;
|
|
1735
|
+
createdAt: string;
|
|
1736
|
+
updatedAt: string;
|
|
1546
1737
|
}>;
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1738
|
+
/** Add OR rotate one field. */
|
|
1739
|
+
setSecretField(args: {
|
|
1740
|
+
scope: SecretScope;
|
|
1741
|
+
scopeId: string;
|
|
1742
|
+
secretId: string;
|
|
1743
|
+
fieldKey: string;
|
|
1744
|
+
sensitivity: FieldSensitivity;
|
|
1745
|
+
format?: FieldFormat;
|
|
1746
|
+
value?: string;
|
|
1747
|
+
envelope?: EncryptedEnvelopeV1;
|
|
1748
|
+
reason?: string;
|
|
1749
|
+
}): Promise<{
|
|
1750
|
+
fieldKey: string;
|
|
1751
|
+
rotated: boolean;
|
|
1752
|
+
}>;
|
|
1753
|
+
/** Remove one field. */
|
|
1754
|
+
removeSecretField(args: {
|
|
1755
|
+
scope: SecretScope;
|
|
1756
|
+
scopeId: string;
|
|
1757
|
+
secretId: string;
|
|
1758
|
+
fieldKey: string;
|
|
1552
1759
|
}): Promise<void>;
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1760
|
+
/** Update secret-level metadata (name/description/tags/category). */
|
|
1761
|
+
updateSecretMetadata(args: {
|
|
1762
|
+
scope: SecretScope;
|
|
1763
|
+
scopeId: string;
|
|
1764
|
+
secretId: string;
|
|
1765
|
+
secretName?: string;
|
|
1766
|
+
description?: string;
|
|
1767
|
+
tags?: string[];
|
|
1768
|
+
category?: SecretCategory;
|
|
1769
|
+
reason?: string;
|
|
1770
|
+
}): Promise<SecretAggregate>;
|
|
1771
|
+
/** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
|
|
1772
|
+
listSecrets(args: {
|
|
1773
|
+
scope: SecretScope;
|
|
1774
|
+
scopeId: string;
|
|
1775
|
+
category?: SecretCategory;
|
|
1776
|
+
tag?: string;
|
|
1777
|
+
fieldKey?: string;
|
|
1778
|
+
}): Promise<SecretMetadata[]>;
|
|
1779
|
+
/** Bounded changelog read — metadata-only audit entries. */
|
|
1780
|
+
getSecretHistory(args: {
|
|
1781
|
+
scope: SecretScope;
|
|
1782
|
+
scopeId: string;
|
|
1783
|
+
secretId: string;
|
|
1784
|
+
limit?: number;
|
|
1785
|
+
cursor?: string;
|
|
1557
1786
|
}): Promise<{
|
|
1558
|
-
|
|
1559
|
-
|
|
1787
|
+
entries: ChangelogEntry[];
|
|
1788
|
+
nextCursor?: string;
|
|
1560
1789
|
}>;
|
|
1561
|
-
|
|
1562
|
-
|
|
1790
|
+
/** Delete a secret (and all its field rows + tag rows + changelog rows). */
|
|
1791
|
+
deleteSecret(args: {
|
|
1792
|
+
scope: SecretScope;
|
|
1793
|
+
scopeId: string;
|
|
1794
|
+
secretId: string;
|
|
1795
|
+
}): Promise<void>;
|
|
1796
|
+
/** Enumerate scopes (org/team/project/agent) this agent can access. */
|
|
1797
|
+
listSecretScopes(): Promise<ScopeInfo[]>;
|
|
1798
|
+
}
|
|
1799
|
+
//# sourceMappingURL=secrets.d.ts.map
|
|
1800
|
+
//#endregion
|
|
1801
|
+
//#region src/domains/teams.d.ts
|
|
1802
|
+
declare class TeamsApi extends ApiBase {
|
|
1803
|
+
getTeamsCredentials(): Promise<{
|
|
1804
|
+
agentId: string;
|
|
1805
|
+
tenantId: string;
|
|
1806
|
+
azureAppId: string;
|
|
1807
|
+
azureBotId: string;
|
|
1808
|
+
azureClientSecret: string;
|
|
1809
|
+
botDisplayName?: string;
|
|
1810
|
+
teamsTenantId?: string;
|
|
1811
|
+
serviceUrl?: string;
|
|
1812
|
+
}>;
|
|
1813
|
+
sendTeamsMessage(data: {
|
|
1814
|
+
conversationId: string;
|
|
1815
|
+
text?: string;
|
|
1816
|
+
adaptiveCard?: Record<string, unknown>;
|
|
1817
|
+
}): Promise<{
|
|
1563
1818
|
ok: boolean;
|
|
1819
|
+
activityId: string;
|
|
1564
1820
|
}>;
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
* voice service defaults to 24 kHz / mono / 16-bit. Wrap in a WAV container
|
|
1581
|
-
* to produce a playable file. Metered per character against the tenant
|
|
1582
|
-
* credit pool server-side; TTS completes regardless of metering outcome.
|
|
1583
|
-
*/
|
|
1584
|
-
tts(args: VoiceTtsArgs): Promise<VoiceTtsResult>;
|
|
1585
|
-
/**
|
|
1586
|
-
* Speech-to-text. Accepts raw linear16 (16-bit LE) mono PCM — NOT a WAV or
|
|
1587
|
-
* other container (the endpoint transcribes with a fixed linear16 encoding,
|
|
1588
|
-
* so a container header would be transcribed as noise). Strip any WAV header
|
|
1589
|
-
* and pass `sampleRate` from it before calling. Metered by transcribed
|
|
1590
|
-
* duration against the tenant credit pool server-side.
|
|
1591
|
-
*/
|
|
1592
|
-
stt(args: VoiceSttArgs): Promise<VoiceSttResult>;
|
|
1821
|
+
listTeamsChannels(): Promise<{
|
|
1822
|
+
channels: {
|
|
1823
|
+
id: string;
|
|
1824
|
+
name: string;
|
|
1825
|
+
description?: string;
|
|
1826
|
+
}[];
|
|
1827
|
+
}>;
|
|
1828
|
+
}
|
|
1829
|
+
//# sourceMappingURL=teams.d.ts.map
|
|
1830
|
+
|
|
1831
|
+
//#endregion
|
|
1832
|
+
//#region src/index.d.ts
|
|
1833
|
+
interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi {}
|
|
1834
|
+
declare class AgentApiClient extends ApiBase {
|
|
1835
|
+
constructor(config: AgentApiClientConfig);
|
|
1593
1836
|
}
|
|
1594
1837
|
//# sourceMappingURL=index.d.ts.map
|
|
1838
|
+
|
|
1595
1839
|
//#endregion
|
|
1596
1840
|
//#endregion
|
|
1597
1841
|
//#region src/index.d.ts
|