@alfe.ai/openclaw-sync 0.3.4 → 0.3.6
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 +946 -702
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +946 -702
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin2.cjs +136 -156
- package/dist/plugin2.js +136 -156
- package/dist/plugin2.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -118,40 +118,111 @@ declare function filterIgnored(paths: string[], rules: IgnoreRules | string[]):
|
|
|
118
118
|
|
|
119
119
|
//# sourceMappingURL=tool-error-capture.d.ts.map
|
|
120
120
|
//#endregion
|
|
121
|
-
//#region src/
|
|
121
|
+
//#region src/transport.d.ts
|
|
122
|
+
/**
|
|
123
|
+
* Shared HTTP transport for the Agent API client — request core, retry
|
|
124
|
+
* policy, error formatting, and the `ApiBase` class the domain method
|
|
125
|
+
* groups under `./domains/` build on.
|
|
126
|
+
*/
|
|
122
127
|
interface AgentApiClientConfig {
|
|
123
128
|
apiKey: string;
|
|
124
129
|
apiUrl: string;
|
|
125
130
|
}
|
|
126
131
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* unpriceable product, so keep the literal union in lockstep with the service.
|
|
132
|
+
* Encode each path segment but keep the `/` separators — `encodeURIComponent`
|
|
133
|
+
* would escape the slashes too, breaking greedy proxy routes.
|
|
130
134
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
|
|
136
|
+
declare class AgentApiTransport {
|
|
137
|
+
private readonly apiKey;
|
|
138
|
+
private readonly apiUrl;
|
|
139
|
+
constructor(config: AgentApiClientConfig);
|
|
140
|
+
/**
|
|
141
|
+
* Binary sibling of `request<T>()`. `request()` forces
|
|
142
|
+
* `Content-Type: application/json` and parses a `{ data: T }` envelope,
|
|
143
|
+
* neither of which fits a raw-audio flow (voice TTS/STT), so those go
|
|
144
|
+
* through this instead. Auth (Bearer), the request budget, and the single
|
|
145
|
+
* retry on transient 5xx / network errors are kept in sync with
|
|
146
|
+
* `request()`. Retries fire only on statuses produced BEFORE the route
|
|
147
|
+
* handler runs (authorizer-timeout 500 + LB 502/503/504), so re-issuing a
|
|
148
|
+
* POST does not risk a duplicate side effect.
|
|
149
|
+
*/
|
|
150
|
+
rawRequest(path: string, init: {
|
|
151
|
+
method: string;
|
|
152
|
+
headers: Headers;
|
|
153
|
+
body?: BodyInit | Uint8Array;
|
|
154
|
+
}): Promise<Response>;
|
|
155
|
+
/**
|
|
156
|
+
* @param extra.timeoutMs Per-request abort timeout (default REQUEST_TIMEOUT_MS).
|
|
157
|
+
* Long endpoints (image generation) pass a larger value so the gateway's
|
|
158
|
+
* own timeout wins with a readable status instead of a client-side abort.
|
|
159
|
+
* @param extra.retry Whether to retry once on transient failures (default
|
|
160
|
+
* true). Expensive/non-idempotent endpoints pass false.
|
|
161
|
+
*/
|
|
162
|
+
request<T>(path: string, options?: RequestInit, extra?: {
|
|
163
|
+
timeoutMs?: number;
|
|
164
|
+
retry?: boolean;
|
|
165
|
+
}): Promise<T>;
|
|
140
166
|
}
|
|
141
|
-
/**
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Base class for the domain method groups. Holds the shared transport;
|
|
169
|
+
* `AgentApiClient` assembles the groups onto one class via `applyMixins`
|
|
170
|
+
* (prototype copy), so methods keep their original `this`-on-the-client
|
|
171
|
+
* call shape.
|
|
172
|
+
*/
|
|
173
|
+
declare class ApiBase {
|
|
174
|
+
protected readonly transport: AgentApiTransport;
|
|
175
|
+
constructor(transport: AgentApiTransport);
|
|
145
176
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
177
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/domains/workspace.d.ts
|
|
180
|
+
/** Response of GET /agents/me/workspace (services/agents). */
|
|
181
|
+
interface AgentWorkspaceInfo {
|
|
182
|
+
templateKey?: string;
|
|
183
|
+
defaultModel?: string;
|
|
184
|
+
installedFrom?: {
|
|
185
|
+
templateKey: string;
|
|
186
|
+
authorTenantId: string;
|
|
187
|
+
version: number;
|
|
188
|
+
};
|
|
189
|
+
runtime?: string;
|
|
190
|
+
teams?: {
|
|
191
|
+
teamId: string;
|
|
192
|
+
name: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
parentTeamId?: string;
|
|
195
|
+
}[];
|
|
196
|
+
projects?: {
|
|
197
|
+
projectId: string;
|
|
198
|
+
name: string;
|
|
199
|
+
description?: string;
|
|
200
|
+
status: string;
|
|
201
|
+
parentProjectId?: string;
|
|
202
|
+
}[];
|
|
203
|
+
teamIds?: string[];
|
|
204
|
+
projectIds?: string[];
|
|
205
|
+
}
|
|
206
|
+
declare class WorkspaceApi extends ApiBase {
|
|
207
|
+
/**
|
|
208
|
+
* GET /agents/me/workspace — workspace config for the authenticated agent
|
|
209
|
+
* (template assignment, default model, org roster).
|
|
210
|
+
*/
|
|
211
|
+
getWorkspace(): Promise<AgentWorkspaceInfo>;
|
|
212
|
+
/**
|
|
213
|
+
* GET /templates/{key}/files — persona/workspace file contents for a
|
|
214
|
+
* template the agent has access to. Pass `version` to pin to the version
|
|
215
|
+
* the agent was installed from (omit → the endpoint resolves `latest`).
|
|
216
|
+
*/
|
|
217
|
+
getTemplateFiles(templateKey: string, opts?: {
|
|
218
|
+
version?: number;
|
|
219
|
+
}): Promise<{
|
|
220
|
+
files: Record<string, string>;
|
|
221
|
+
}>;
|
|
154
222
|
}
|
|
223
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/domains/sync.d.ts
|
|
155
226
|
interface SyncAgentInfo {
|
|
156
227
|
agentId: string;
|
|
157
228
|
tenantId: string;
|
|
@@ -236,6 +307,63 @@ interface SharedFileEntry {
|
|
|
236
307
|
size: number;
|
|
237
308
|
contentType?: string;
|
|
238
309
|
}
|
|
310
|
+
declare class SyncApi extends ApiBase {
|
|
311
|
+
syncRegister(args?: {
|
|
312
|
+
displayName?: string;
|
|
313
|
+
}): Promise<{
|
|
314
|
+
agent: SyncAgentInfo;
|
|
315
|
+
}>;
|
|
316
|
+
syncGetManifest(): Promise<SyncManifest>;
|
|
317
|
+
syncPresign(args: {
|
|
318
|
+
files: {
|
|
319
|
+
path: string;
|
|
320
|
+
operation: "put" | "get";
|
|
321
|
+
contentType?: string;
|
|
322
|
+
}[];
|
|
323
|
+
}): Promise<{
|
|
324
|
+
urls: SyncPresignedUrl[];
|
|
325
|
+
}>;
|
|
326
|
+
syncConfirmUpload(args: {
|
|
327
|
+
filePath: string;
|
|
328
|
+
hash: string;
|
|
329
|
+
size: number;
|
|
330
|
+
storageClass?: "STANDARD" | "GLACIER_IR";
|
|
331
|
+
}): Promise<SyncConfirmedUpload>;
|
|
332
|
+
syncReconstruct(args: {
|
|
333
|
+
mode: "full" | "active" | "memory";
|
|
334
|
+
}): Promise<SyncReconstructBundle>;
|
|
335
|
+
syncGetStats(): Promise<SyncAgentStats>;
|
|
336
|
+
syncListFiles(args?: {
|
|
337
|
+
prefix?: string;
|
|
338
|
+
}): Promise<{
|
|
339
|
+
files: SyncFileEntry[];
|
|
340
|
+
}>;
|
|
341
|
+
syncListSessions(): Promise<{
|
|
342
|
+
sessions: SyncSessionEntry[];
|
|
343
|
+
}>;
|
|
344
|
+
syncGetSession(sessionId: string): Promise<SyncSessionContent>;
|
|
345
|
+
syncDeleteFile(filePath: string): Promise<{
|
|
346
|
+
removed: boolean;
|
|
347
|
+
}>;
|
|
348
|
+
sharedListFiles(args: {
|
|
349
|
+
scope: "org" | "team" | "project";
|
|
350
|
+
scopeId: string;
|
|
351
|
+
}): Promise<{
|
|
352
|
+
files: SharedFileEntry[];
|
|
353
|
+
nextCursor: string | null;
|
|
354
|
+
}>;
|
|
355
|
+
sharedDownloadUrl(args: {
|
|
356
|
+
scope: "org" | "team" | "project";
|
|
357
|
+
scopeId: string;
|
|
358
|
+
filePath: string;
|
|
359
|
+
}): Promise<{
|
|
360
|
+
downloadUrl: string;
|
|
361
|
+
expiresIn: number;
|
|
362
|
+
}>;
|
|
363
|
+
}
|
|
364
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/domains/knowledge.d.ts
|
|
239
367
|
type KnowledgeScopeType = "org" | "team" | "project";
|
|
240
368
|
interface KnowledgeScope {
|
|
241
369
|
scopeType: KnowledgeScopeType;
|
|
@@ -278,15 +406,6 @@ interface KnowledgeProfile {
|
|
|
278
406
|
updatedAt: string | null;
|
|
279
407
|
updatedBy: string | null;
|
|
280
408
|
}
|
|
281
|
-
interface KnowledgeDoc {
|
|
282
|
-
filePath: string;
|
|
283
|
-
fileName: string;
|
|
284
|
-
contentType?: string;
|
|
285
|
-
size: number;
|
|
286
|
-
uploadedBy?: string;
|
|
287
|
-
createdAt: string;
|
|
288
|
-
updatedAt: string;
|
|
289
|
-
}
|
|
290
409
|
type ChangeRequestResourceType = "doc" | "profile";
|
|
291
410
|
type ChangeRequestOperation = "create" | "update" | "delete";
|
|
292
411
|
type ChangeRequestStatus = "open" | "approved" | "rejected" | "withdrawn" | "superseded";
|
|
@@ -328,6 +447,202 @@ interface ProposeScopeChangeInput {
|
|
|
328
447
|
/** profile: the proposed value ({ about, description, links }). */
|
|
329
448
|
proposedValue?: unknown;
|
|
330
449
|
}
|
|
450
|
+
interface KnowledgeDoc {
|
|
451
|
+
filePath: string;
|
|
452
|
+
fileName: string;
|
|
453
|
+
contentType?: string;
|
|
454
|
+
size: number;
|
|
455
|
+
uploadedBy?: string;
|
|
456
|
+
createdAt: string;
|
|
457
|
+
updatedAt: string;
|
|
458
|
+
}
|
|
459
|
+
declare class KnowledgeApi extends ApiBase {
|
|
460
|
+
/**
|
|
461
|
+
* Semantic search across the agent's member scopes. Fan-out is gated
|
|
462
|
+
* server-side by `listScopes` set-inclusion (fail-closed). Pass
|
|
463
|
+
* `scopeType` + `scopeId` to narrow to one scope; a non-member scope
|
|
464
|
+
* yields empty results (never a cross-scope leak).
|
|
465
|
+
*/
|
|
466
|
+
knowledgeSearch(query: string, opts?: {
|
|
467
|
+
limit?: number;
|
|
468
|
+
scopeType?: KnowledgeScopeType;
|
|
469
|
+
scopeId?: string;
|
|
470
|
+
}): Promise<KnowledgeSearchResult>;
|
|
471
|
+
/** Enumerate the scopes (org + teams + projects) this agent belongs to. */
|
|
472
|
+
listScopes(): Promise<{
|
|
473
|
+
scopes: KnowledgeScope[];
|
|
474
|
+
}>;
|
|
475
|
+
/** Read a scope's structured knowledge profile (after membership check). */
|
|
476
|
+
getScopeProfile(scopeType: KnowledgeScopeType, scopeId: string): Promise<KnowledgeProfile>;
|
|
477
|
+
/**
|
|
478
|
+
* Open a change request against a scope's knowledge resource. For a doc
|
|
479
|
+
* create/update, `services/org` returns a presigned staging PUT; this method
|
|
480
|
+
* uploads the proposed `content` to it (echoing the same Content-Type that
|
|
481
|
+
* was signed), mirroring `writeScopeDoc`. The staged body is applied to the
|
|
482
|
+
* canonical doc — attributed to this agent — only when a reviewer approves.
|
|
483
|
+
*/
|
|
484
|
+
proposeScopeChange(scopeType: KnowledgeScopeType, scopeId: string, input: ProposeScopeChangeInput): Promise<KnowledgeChangeRequest>;
|
|
485
|
+
/**
|
|
486
|
+
* List the agent's OWN change requests in a scope (filtered server-side to
|
|
487
|
+
* this agent as proposer). Pass `status` to narrow to open / approved / etc.
|
|
488
|
+
*/
|
|
489
|
+
listScopeChangeRequests(scopeType: KnowledgeScopeType, scopeId: string, opts?: {
|
|
490
|
+
status?: ChangeRequestStatus;
|
|
491
|
+
limit?: number;
|
|
492
|
+
cursor?: string;
|
|
493
|
+
}): Promise<{
|
|
494
|
+
changeRequests: KnowledgeChangeRequest[];
|
|
495
|
+
nextCursor: string | null;
|
|
496
|
+
}>;
|
|
497
|
+
/** List a scope's docs (the org-files corpus; mirrored to shared/<scope>/). */
|
|
498
|
+
listScopeDocs(scopeType: KnowledgeScopeType, scopeId: string, opts?: {
|
|
499
|
+
limit?: number;
|
|
500
|
+
cursor?: string;
|
|
501
|
+
}): Promise<{
|
|
502
|
+
files: KnowledgeDoc[];
|
|
503
|
+
nextCursor: string | null;
|
|
504
|
+
}>;
|
|
505
|
+
/**
|
|
506
|
+
* Read the full text of a scope doc. Resolves a presigned download URL
|
|
507
|
+
* from `services/org`, then fetches the bytes directly from S3 (the one
|
|
508
|
+
* legitimate raw fetch in a plugin — same pattern as sync).
|
|
509
|
+
*/
|
|
510
|
+
readScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string): Promise<{
|
|
511
|
+
filePath: string;
|
|
512
|
+
text: string;
|
|
513
|
+
}>;
|
|
514
|
+
/**
|
|
515
|
+
* Write (create or overwrite) a scope doc. Two-step presigned upload:
|
|
516
|
+
* `services/org` returns a signed URL plus `requiredHeaders` (author /
|
|
517
|
+
* authorKind / message as `x-amz-meta-*`) that MUST be sent verbatim on
|
|
518
|
+
* the PUT, alongside the same `Content-Type` that was signed. Author and
|
|
519
|
+
* authorKind are server-set from the agent token — never trusted here.
|
|
520
|
+
*/
|
|
521
|
+
writeScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string, content: string, opts?: {
|
|
522
|
+
contentType?: string;
|
|
523
|
+
message?: string;
|
|
524
|
+
}): Promise<{
|
|
525
|
+
filePath: string;
|
|
526
|
+
}>;
|
|
527
|
+
}
|
|
528
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
529
|
+
//#endregion
|
|
530
|
+
//#region src/domains/mobile.d.ts
|
|
531
|
+
/** Response of GET /mobile/numbers for an agent (services/mobile). */
|
|
532
|
+
interface MobileNumberInfo {
|
|
533
|
+
phoneNumber: string;
|
|
534
|
+
countryCode: string;
|
|
535
|
+
monthlyPrice?: number;
|
|
536
|
+
status: string;
|
|
537
|
+
errorMessage?: string;
|
|
538
|
+
}
|
|
539
|
+
/** One purchasable number from GET /mobile/numbers/search. */
|
|
540
|
+
interface MobileAvailableNumber {
|
|
541
|
+
number: string;
|
|
542
|
+
friendlyName: string;
|
|
543
|
+
locality: string;
|
|
544
|
+
region: string;
|
|
545
|
+
country: string;
|
|
546
|
+
}
|
|
547
|
+
/** Approved WhatsApp content template from GET /mobile/whatsapp/templates. */
|
|
548
|
+
interface WhatsAppTemplate {
|
|
549
|
+
sid: string;
|
|
550
|
+
friendlyName: string;
|
|
551
|
+
language: string;
|
|
552
|
+
body: string;
|
|
553
|
+
variables: Record<string, string>;
|
|
554
|
+
dateCreated: string;
|
|
555
|
+
dateUpdated: string;
|
|
556
|
+
approvalStatus?: string;
|
|
557
|
+
rejectionReason?: string;
|
|
558
|
+
category?: string;
|
|
559
|
+
}
|
|
560
|
+
declare class MobileApi extends ApiBase {
|
|
561
|
+
getMobileNumber(): Promise<MobileNumberInfo>;
|
|
562
|
+
searchMobileNumbers(args?: {
|
|
563
|
+
country?: string;
|
|
564
|
+
query?: string;
|
|
565
|
+
}): Promise<{
|
|
566
|
+
numbers: MobileAvailableNumber[];
|
|
567
|
+
monthlyPrice: number;
|
|
568
|
+
}>;
|
|
569
|
+
assignMobileNumber(args: {
|
|
570
|
+
phoneNumber: string;
|
|
571
|
+
countryCode: string;
|
|
572
|
+
}): Promise<{
|
|
573
|
+
phoneNumber: string;
|
|
574
|
+
countryCode: string;
|
|
575
|
+
status: "pending";
|
|
576
|
+
}>;
|
|
577
|
+
releaseMobileNumber(): Promise<{
|
|
578
|
+
released: true;
|
|
579
|
+
}>;
|
|
580
|
+
sendSms(args: {
|
|
581
|
+
to: string;
|
|
582
|
+
body: string;
|
|
583
|
+
}): Promise<{
|
|
584
|
+
sent: true;
|
|
585
|
+
sid: string;
|
|
586
|
+
}>;
|
|
587
|
+
startOutboundCall(args: {
|
|
588
|
+
to: string;
|
|
589
|
+
}): Promise<{
|
|
590
|
+
callSid: string;
|
|
591
|
+
status: string;
|
|
592
|
+
}>;
|
|
593
|
+
getWhatsAppSession(to: string): Promise<{
|
|
594
|
+
active: boolean;
|
|
595
|
+
expiresAt?: string;
|
|
596
|
+
}>;
|
|
597
|
+
sendWhatsAppMessage(args: {
|
|
598
|
+
to: string;
|
|
599
|
+
body: string;
|
|
600
|
+
}): Promise<{
|
|
601
|
+
sent: true;
|
|
602
|
+
sid: string;
|
|
603
|
+
}>;
|
|
604
|
+
sendWhatsAppTemplate(args: {
|
|
605
|
+
to: string;
|
|
606
|
+
contentSid: string;
|
|
607
|
+
contentVariables: Record<string, string>;
|
|
608
|
+
bodyPreview?: string;
|
|
609
|
+
}): Promise<{
|
|
610
|
+
sent: true;
|
|
611
|
+
sid: string;
|
|
612
|
+
}>;
|
|
613
|
+
listWhatsAppTemplates(): Promise<{
|
|
614
|
+
templates: WhatsAppTemplate[];
|
|
615
|
+
}>;
|
|
616
|
+
}
|
|
617
|
+
//# sourceMappingURL=mobile.d.ts.map
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/domains/remote.d.ts
|
|
620
|
+
interface RemoteSessionInfo {
|
|
621
|
+
sessionId: string;
|
|
622
|
+
agentId: string;
|
|
623
|
+
surface: "browser" | "terminal";
|
|
624
|
+
status: "agent_driving" | "awaiting_human" | "human_in_control" | "resuming" | "completed" | "expired" | "failed";
|
|
625
|
+
url?: string;
|
|
626
|
+
instructions?: string;
|
|
627
|
+
requestedAt?: string;
|
|
628
|
+
}
|
|
629
|
+
declare class RemoteApi extends ApiBase {
|
|
630
|
+
requestBrowserTakeover(args: {
|
|
631
|
+
instructions: string;
|
|
632
|
+
url?: string;
|
|
633
|
+
conversationId?: string;
|
|
634
|
+
}): Promise<{
|
|
635
|
+
sessionId: string;
|
|
636
|
+
status: string;
|
|
637
|
+
}>;
|
|
638
|
+
getRemoteSession(sessionId: string): Promise<RemoteSessionInfo>;
|
|
639
|
+
completeRemoteSession(sessionId: string): Promise<{
|
|
640
|
+
ok: boolean;
|
|
641
|
+
}>;
|
|
642
|
+
}
|
|
643
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/domains/self.d.ts
|
|
331
646
|
/** Voice settings — core agent config. Mirrors `VoiceConfig` in `@alfe/types`. */
|
|
332
647
|
interface AgentVoiceConfig {
|
|
333
648
|
/** ElevenLabs voice ID; platform default when unset. */
|
|
@@ -369,15 +684,54 @@ interface AgentVoice {
|
|
|
369
684
|
labels: Record<string, string>;
|
|
370
685
|
category: string;
|
|
371
686
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
687
|
+
declare class SelfApi extends ApiBase {
|
|
688
|
+
/** Update the agent's own name and/or voice config. Returns the updated agent. */
|
|
689
|
+
updateSelf(update: {
|
|
690
|
+
name?: string;
|
|
691
|
+
voiceConfig?: AgentVoiceConfig;
|
|
692
|
+
}): Promise<AgentSelf>;
|
|
693
|
+
/**
|
|
694
|
+
* Generate the agent's own avatar from a text prompt. The image is generated,
|
|
695
|
+
* stored, and set on the agent server-side; returns the updated agent.
|
|
696
|
+
*
|
|
697
|
+
* ASYNC (same reason as `generateImage`): avatar gen runs `gpt-image-1`
|
|
698
|
+
* (30–60s) which exceeds the API Gateway 30s ceiling, so this enqueues a job
|
|
699
|
+
* (`POST /agent/avatar/generate` → `jobId`) then polls (`GET /agent/avatar/{jobId}`)
|
|
700
|
+
* until the avatar is set. Signature unchanged — the plugin is unaffected.
|
|
701
|
+
*/
|
|
702
|
+
generateAvatar(args: {
|
|
703
|
+
prompt: string;
|
|
704
|
+
}): Promise<AgentSelf>;
|
|
705
|
+
/**
|
|
706
|
+
* Get a presigned PUT URL to upload a new avatar image. Upload the bytes to
|
|
707
|
+
* `uploadUrl`, then call `finalizeAvatar(s3Key)` to set it on the agent.
|
|
708
|
+
*/
|
|
709
|
+
presignAvatar(args: {
|
|
710
|
+
mimeType: string;
|
|
711
|
+
size: number;
|
|
712
|
+
}): Promise<AgentAvatarPresign>;
|
|
713
|
+
/**
|
|
714
|
+
* Finalize an avatar upload — validates ownership + size, then sets the
|
|
715
|
+
* agent's `avatarUrl` server-side. Returns the updated agent.
|
|
716
|
+
*/
|
|
717
|
+
finalizeAvatar(s3Key: string): Promise<AgentSelf>;
|
|
718
|
+
/** List the platform voice catalogue (ElevenLabs) so the agent can pick its own voice. */
|
|
719
|
+
listVoices(): Promise<{
|
|
720
|
+
voices: AgentVoice[];
|
|
721
|
+
}>;
|
|
722
|
+
}
|
|
723
|
+
//# sourceMappingURL=self.d.ts.map
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region src/domains/voice.d.ts
|
|
726
|
+
/** The ElevenLabs models with a pricing row — the TTS endpoint rejects any other value. */
|
|
727
|
+
type VoiceTtsModel = "eleven_turbo_v2_5" | "eleven_multilingual_v2";
|
|
728
|
+
interface VoiceTtsArgs {
|
|
729
|
+
/** Text to synthesize (1–5000 chars — the endpoint enforces this). */
|
|
730
|
+
text: string;
|
|
731
|
+
/** ElevenLabs voice id; platform default when unset. */
|
|
732
|
+
voiceId?: string;
|
|
733
|
+
/** TTS model; `eleven_turbo_v2_5` (lower latency) when unset. */
|
|
734
|
+
model?: VoiceTtsModel;
|
|
381
735
|
}
|
|
382
736
|
/** Raw synthesized audio plus its PCM framing (from the response headers). */
|
|
383
737
|
interface VoiceTtsResult {
|
|
@@ -401,84 +755,112 @@ interface VoiceSttResult {
|
|
|
401
755
|
/** Deepgram confidence in (0,1]. */
|
|
402
756
|
confidence: number;
|
|
403
757
|
}
|
|
404
|
-
declare class
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
758
|
+
declare class VoiceApi extends ApiBase {
|
|
759
|
+
/**
|
|
760
|
+
* Text-to-speech. Returns raw PCM audio bytes plus their framing — the
|
|
761
|
+
* voice service defaults to 24 kHz / mono / 16-bit. Wrap in a WAV container
|
|
762
|
+
* to produce a playable file. Metered per character against the tenant
|
|
763
|
+
* credit pool server-side; TTS completes regardless of metering outcome.
|
|
764
|
+
*/
|
|
765
|
+
tts(args: VoiceTtsArgs): Promise<VoiceTtsResult>;
|
|
766
|
+
/**
|
|
767
|
+
* Speech-to-text. Accepts raw linear16 (16-bit LE) mono PCM — NOT a WAV or
|
|
768
|
+
* other container (the endpoint transcribes with a fixed linear16 encoding,
|
|
769
|
+
* so a container header would be transcribed as noise). Strip any WAV header
|
|
770
|
+
* and pass `sampleRate` from it before calling. Metered by transcribed
|
|
771
|
+
* duration against the tenant credit pool server-side.
|
|
772
|
+
*/
|
|
773
|
+
stt(args: VoiceSttArgs): Promise<VoiceSttResult>;
|
|
774
|
+
}
|
|
775
|
+
//# sourceMappingURL=voice.d.ts.map
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/domains/search.d.ts
|
|
778
|
+
/**
|
|
779
|
+
* The broad-news providers behind the metered `services/news` Lambda. The
|
|
780
|
+
* server validates this with a zod enum; a value outside the union is an
|
|
781
|
+
* unpriceable product, so keep the literal union in lockstep with the service.
|
|
782
|
+
*/
|
|
783
|
+
type NewsProvider = "apitube" | "newsdata";
|
|
784
|
+
/** One normalized article. `sentiment` is provider-shaped (APITube supplies it). */
|
|
785
|
+
interface NewsArticle {
|
|
786
|
+
title: string;
|
|
787
|
+
url: string;
|
|
788
|
+
source: string;
|
|
789
|
+
publishedAt: string;
|
|
790
|
+
snippet: string;
|
|
791
|
+
sentiment?: unknown;
|
|
792
|
+
}
|
|
793
|
+
/** Provider-agnostic result — the server normalizes every adapter to this. */
|
|
794
|
+
interface NewsResult {
|
|
795
|
+
articles: NewsArticle[];
|
|
796
|
+
provider: string;
|
|
797
|
+
}
|
|
798
|
+
declare class SearchApi extends ApiBase {
|
|
799
|
+
searchWeb(params: {
|
|
800
|
+
query: string;
|
|
801
|
+
count?: number;
|
|
802
|
+
offset?: number;
|
|
803
|
+
country?: string;
|
|
804
|
+
freshness?: string;
|
|
805
|
+
}): Promise<unknown>;
|
|
806
|
+
searchImages(params: {
|
|
807
|
+
query: string;
|
|
808
|
+
count?: number;
|
|
809
|
+
}): Promise<unknown>;
|
|
810
|
+
searchNews(params: {
|
|
811
|
+
query: string;
|
|
812
|
+
count?: number;
|
|
813
|
+
freshness?: string;
|
|
814
|
+
}): Promise<unknown>;
|
|
815
|
+
/** Search news across the selected provider's corpus. → POST /agent/news/search */
|
|
816
|
+
newsSearch(params: {
|
|
817
|
+
query: string;
|
|
818
|
+
provider?: NewsProvider;
|
|
819
|
+
source?: string;
|
|
820
|
+
from?: string;
|
|
821
|
+
to?: string;
|
|
822
|
+
language?: string;
|
|
823
|
+
category?: string;
|
|
824
|
+
limit?: number;
|
|
825
|
+
}): Promise<NewsResult>;
|
|
826
|
+
/** Top headlines for the selected provider. → POST /agent/news/headlines */
|
|
827
|
+
newsHeadlines(params?: {
|
|
828
|
+
provider?: NewsProvider;
|
|
829
|
+
category?: string;
|
|
830
|
+
source?: string;
|
|
831
|
+
language?: string;
|
|
832
|
+
limit?: number;
|
|
833
|
+
}): Promise<NewsResult>;
|
|
834
|
+
}
|
|
835
|
+
//# sourceMappingURL=search.d.ts.map
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region src/domains/chat.d.ts
|
|
838
|
+
declare class ChatApi extends ApiBase {
|
|
839
|
+
presignAttachments(files: {
|
|
840
|
+
filename: string;
|
|
841
|
+
mimeType: string;
|
|
427
842
|
size: number;
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}): Promise<{
|
|
437
|
-
files: SyncFileEntry[];
|
|
438
|
-
}>;
|
|
439
|
-
syncListSessions(): Promise<{
|
|
440
|
-
sessions: SyncSessionEntry[];
|
|
441
|
-
}>;
|
|
442
|
-
syncGetSession(sessionId: string): Promise<SyncSessionContent>;
|
|
443
|
-
syncDeleteFile(filePath: string): Promise<{
|
|
444
|
-
removed: boolean;
|
|
445
|
-
}>;
|
|
446
|
-
sharedListFiles(args: {
|
|
447
|
-
scope: "org" | "team" | "project";
|
|
448
|
-
scopeId: string;
|
|
449
|
-
}): Promise<{
|
|
450
|
-
files: SharedFileEntry[];
|
|
451
|
-
nextCursor: string | null;
|
|
843
|
+
}[]): Promise<{
|
|
844
|
+
attachments: {
|
|
845
|
+
id: string;
|
|
846
|
+
uploadUrl: string;
|
|
847
|
+
downloadUrl: string;
|
|
848
|
+
s3Key: string;
|
|
849
|
+
expiresAt: string;
|
|
850
|
+
}[];
|
|
452
851
|
}>;
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
852
|
+
recordActivity(data: {
|
|
853
|
+
userId?: string;
|
|
854
|
+
channel: string;
|
|
855
|
+
role: "user" | "assistant";
|
|
457
856
|
}): Promise<{
|
|
458
|
-
|
|
459
|
-
expiresIn: number;
|
|
460
|
-
}>;
|
|
461
|
-
listIntegrations(): Promise<IntegrationInstall[]>;
|
|
462
|
-
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
|
|
463
|
-
updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
|
|
464
|
-
installIntegration(integrationId: string, options?: {
|
|
465
|
-
version?: string;
|
|
466
|
-
config?: Record<string, unknown>;
|
|
467
|
-
}): Promise<IntegrationInstall>;
|
|
468
|
-
removeIntegration(integrationId: string): Promise<IntegrationInstall>;
|
|
469
|
-
getOAuthUrl(provider: string, scopes?: string[]): Promise<{
|
|
470
|
-
url: string;
|
|
471
|
-
provider: string;
|
|
472
|
-
expiresIn: number;
|
|
473
|
-
}>;
|
|
474
|
-
getOAuthStatus(provider: string): Promise<{
|
|
475
|
-
provider: string;
|
|
476
|
-
connected: boolean;
|
|
477
|
-
config?: Record<string, string>;
|
|
478
|
-
}>;
|
|
479
|
-
getRegistry(): Promise<{
|
|
480
|
-
integrations: RegistryEntry[];
|
|
857
|
+
recorded: boolean;
|
|
481
858
|
}>;
|
|
859
|
+
}
|
|
860
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
861
|
+
//#endregion
|
|
862
|
+
//#region src/domains/connect-credentials.d.ts
|
|
863
|
+
declare class ConnectCredentialsApi extends ApiBase {
|
|
482
864
|
/**
|
|
483
865
|
* Returns every connected Google account for the agent. Multi-account by
|
|
484
866
|
* design — the openclaw-google plugin requires the LLM to pass `email`
|
|
@@ -535,90 +917,27 @@ declare class AgentApiClient {
|
|
|
535
917
|
[key: string]: unknown;
|
|
536
918
|
}>;
|
|
537
919
|
/**
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
* endpoint injects — they are never persisted on the connection. `host` is
|
|
545
|
-
* the resolved TLS endpoint (`live.ctraderapi.com` / `demo.ctraderapi.com`)
|
|
546
|
-
* derived from the selected account's live/demo flag.
|
|
920
|
+
* @deprecated Returns a single primary credential blob (legacy "pick-the-
|
|
921
|
+
* default-connection" shape). Use `getGithubAccounts()` for the multi-
|
|
922
|
+
* account shape required by Pattern A — explicit selector args on every
|
|
923
|
+
* tool. Retained because the `@alfe.ai/github-mcp` proxy is the
|
|
924
|
+
* only consumer that knows about Pattern A; legacy env-interpolation
|
|
925
|
+
* callers will keep hitting `/credentials` until they move to the proxy.
|
|
547
926
|
*/
|
|
548
|
-
|
|
927
|
+
getGithubCredentials(): Promise<{
|
|
928
|
+
login: string;
|
|
549
929
|
accessToken: string;
|
|
550
|
-
refreshToken: string;
|
|
551
|
-
accountId: string;
|
|
552
|
-
host: string;
|
|
553
|
-
clientId: string;
|
|
554
|
-
clientSecret: string;
|
|
555
930
|
}>;
|
|
556
931
|
/**
|
|
557
|
-
* Pattern A: multi-account credential fetch for
|
|
932
|
+
* Pattern A: multi-account credential fetch for GitHub.
|
|
558
933
|
*
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
* ctid:<userId>` (Phase 1). This aggregates the *trading accounts* across
|
|
563
|
-
* ALL of those Connection rows — each row contributes its `availableAccounts`
|
|
564
|
-
* flattened, and every account carries ITS OWN grant's `accessToken` (the
|
|
565
|
-
* token that authenticates that account against the cTrader Open API). One
|
|
566
|
-
* OAuth grant still covers all accounts under that single login on one shared
|
|
567
|
-
* token; only the `ctidTraderAccountId` and the protobuf socket `host` (live
|
|
568
|
-
* vs demo) differ within a grant. Across grants the tokens differ, so the
|
|
569
|
-
* token is now PER-ACCOUNT rather than hoisted to the top level.
|
|
934
|
+
* Returns every agent-scoped GitHub connection. The caller is expected
|
|
935
|
+
* to require a `login` selector on every credential-touching tool and
|
|
936
|
+
* look up the matching account at dispatch time.
|
|
570
937
|
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
* `clientId` / `clientSecret` are the SST-sourced GLOBAL app credentials the
|
|
576
|
-
* connect endpoint injects — identical across every Connection row (one
|
|
577
|
-
* cTrader app), never persisted on a connection. We take them from the first
|
|
578
|
-
* row that carries them.
|
|
579
|
-
*
|
|
580
|
-
* Accounts are deduped on `ctidTraderAccountId` first-wins: Spotware ids are
|
|
581
|
-
* globally unique across logins, so a duplicate can only appear if the same
|
|
582
|
-
* account somehow surfaced under two grants — first-wins keeps it
|
|
583
|
-
* deterministic.
|
|
584
|
-
*
|
|
585
|
-
* `accounts` may be empty (no cTrader Connection at all), in which case we
|
|
586
|
-
* return empty creds rather than throwing.
|
|
587
|
-
*/
|
|
588
|
-
getCTraderAccounts(): Promise<{
|
|
589
|
-
accounts: {
|
|
590
|
-
ctidTraderAccountId: string;
|
|
591
|
-
host: string;
|
|
592
|
-
isLive: boolean;
|
|
593
|
-
brokerName?: string;
|
|
594
|
-
accountNumber?: string;
|
|
595
|
-
accessToken: string;
|
|
596
|
-
}[];
|
|
597
|
-
clientId: string;
|
|
598
|
-
clientSecret: string;
|
|
599
|
-
}>;
|
|
600
|
-
/**
|
|
601
|
-
* @deprecated Returns a single primary credential blob (legacy "pick-the-
|
|
602
|
-
* default-connection" shape). Use `getGithubAccounts()` for the multi-
|
|
603
|
-
* account shape required by Pattern A — explicit selector args on every
|
|
604
|
-
* tool. Retained because the `@alfe.ai/github-mcp` proxy is the
|
|
605
|
-
* only consumer that knows about Pattern A; legacy env-interpolation
|
|
606
|
-
* callers will keep hitting `/credentials` until they move to the proxy.
|
|
607
|
-
*/
|
|
608
|
-
getGithubCredentials(): Promise<{
|
|
609
|
-
login: string;
|
|
610
|
-
accessToken: string;
|
|
611
|
-
}>;
|
|
612
|
-
/**
|
|
613
|
-
* Pattern A: multi-account credential fetch for GitHub.
|
|
614
|
-
*
|
|
615
|
-
* Returns every agent-scoped GitHub connection. The caller is expected
|
|
616
|
-
* to require a `login` selector on every credential-touching tool and
|
|
617
|
-
* look up the matching account at dispatch time.
|
|
618
|
-
*
|
|
619
|
-
* GitHub OAuth tokens have no expiry (`tokenLifecycle: "no_expiry"`),
|
|
620
|
-
* so there is intentionally no `refreshGithubAccountToken` method — if
|
|
621
|
-
* a token is revoked the user must re-run the OAuth flow.
|
|
938
|
+
* GitHub OAuth tokens have no expiry (`tokenLifecycle: "no_expiry"`),
|
|
939
|
+
* so there is intentionally no `refreshGithubAccountToken` method — if
|
|
940
|
+
* a token is revoked the user must re-run the OAuth flow.
|
|
622
941
|
*
|
|
623
942
|
* Returned `accounts[i].login` is the GitHub username — the stable
|
|
624
943
|
* cross-session identifier the LLM should pass.
|
|
@@ -634,67 +953,6 @@ declare class AgentApiClient {
|
|
|
634
953
|
scopes: string;
|
|
635
954
|
}[];
|
|
636
955
|
}>;
|
|
637
|
-
/**
|
|
638
|
-
* Pattern A: provider-parameterized multi-account credential fetch for the
|
|
639
|
-
* social connectors (Bluesky, and the approval-gated backlog: X, Meta,
|
|
640
|
-
* Threads, LinkedIn, Pinterest, TikTok, Reddit, YouTube).
|
|
641
|
-
*
|
|
642
|
-
* Unlike the bespoke `getGithubAccounts()` / `getXeroAccounts()` shapes,
|
|
643
|
-
* this returns a UNIFORM normalized account shape so `@alfe.ai/social-mcp`'s
|
|
644
|
-
* shared driver can require a single `account` selector on every
|
|
645
|
-
* credential-touching tool regardless of platform. The backend
|
|
646
|
-
* `api-agents/{provider}/accounts` route is already provider-generic; this
|
|
647
|
-
* is the client-side normalization the plan (`do-we-need-any-moonlit-toucan`
|
|
648
|
-
* Phase 0, step 5) calls for.
|
|
649
|
-
*
|
|
650
|
-
* `accountIdentifier` is the stable per-account selector the LLM should
|
|
651
|
-
* pass back (for Bluesky: the account DID). `accessToken` carries whatever
|
|
652
|
-
* the provider's `buildCredentialsResponse` bundles (for Bluesky: the JSON
|
|
653
|
-
* session bundle — the driver parses the `accessJwt` out of it, or reads the
|
|
654
|
-
* top-level `accessJwt` from `providerMetadata`-adjacent fields). Everything
|
|
655
|
-
* else the driver needs for routing (handle, pdsHost, did, …) is on
|
|
656
|
-
* `providerMetadata`.
|
|
657
|
-
*
|
|
658
|
-
* Token refresh is delegated to connect (never done in-plugin) via the
|
|
659
|
-
* per-account route `POST /agent/connect/{provider}/accounts/{accountIdentifier}/refresh`
|
|
660
|
-
* — call `refreshSocialAccount(provider, accountIdentifier)`. (The non-account
|
|
661
|
-
* `POST /agent/connect/{provider}/refresh` route refreshes the provider's
|
|
662
|
-
* PRIMARY connection, which is wrong under multi-account Pattern A.)
|
|
663
|
-
*/
|
|
664
|
-
getSocialAccounts(provider: string): Promise<{
|
|
665
|
-
provider: string;
|
|
666
|
-
accounts: {
|
|
667
|
-
connectionId: string;
|
|
668
|
-
accountIdentifier: string;
|
|
669
|
-
displayName: string | null;
|
|
670
|
-
accessToken: string;
|
|
671
|
-
providerMetadata: Record<string, unknown>;
|
|
672
|
-
connectedAt: string;
|
|
673
|
-
}[];
|
|
674
|
-
}>;
|
|
675
|
-
/**
|
|
676
|
-
* Pattern A: refresh a specific social Connection by its stable
|
|
677
|
-
* `accountIdentifier` (for Bluesky: the account DID) via the
|
|
678
|
-
* provider-generic per-account refresh route. The counterpart to
|
|
679
|
-
* `getSocialAccounts(provider)`; `@alfe.ai/social-mcp` calls this on a
|
|
680
|
-
* 401/ExpiredToken from the platform PDS/API, then re-fetches accounts to
|
|
681
|
-
* pick up the rotated bundle.
|
|
682
|
-
*
|
|
683
|
-
* Refresh itself is ALWAYS delegated to connect — the plugin never calls
|
|
684
|
-
* the platform's own refresh XRPC (e.g. `com.atproto.server.refreshSession`)
|
|
685
|
-
* because connect owns the encrypted refresh token + rotation persistence
|
|
686
|
-
* (Bluesky rotates the refreshJwt; a missed rotation kills the connection
|
|
687
|
-
* after one refresh). The returned `accessToken` is whatever the provider's
|
|
688
|
-
* `refreshToken` hook re-bundled (for Bluesky: the JSON session bundle with
|
|
689
|
-
* the fresh `accessJwt`) — callers typically ignore it and re-fetch via
|
|
690
|
-
* `getSocialAccounts` for a consistent shape.
|
|
691
|
-
*/
|
|
692
|
-
refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{
|
|
693
|
-
accountIdentifier: string;
|
|
694
|
-
accessToken: string;
|
|
695
|
-
accessTokenExpiresAt: string;
|
|
696
|
-
expiresAt: string;
|
|
697
|
-
}>;
|
|
698
956
|
/**
|
|
699
957
|
* @deprecated Returns a single primary credential blob (legacy "pick-the-
|
|
700
958
|
* default-connection" shape). Use `getXeroAccounts()` for the multi-
|
|
@@ -930,67 +1188,6 @@ declare class AgentApiClient {
|
|
|
930
1188
|
accessTokenExpiresAt: string;
|
|
931
1189
|
expiresAt: string;
|
|
932
1190
|
}>;
|
|
933
|
-
/**
|
|
934
|
-
* @deprecated Returns a single primary credential blob. Use
|
|
935
|
-
* `getShopifyAccounts()` for the multi-account shape required by Pattern A
|
|
936
|
-
* (`@alfe.ai/shopify-mcp` keys per-shop on the myshopify domain).
|
|
937
|
-
*/
|
|
938
|
-
getShopifyCredentials(): Promise<{
|
|
939
|
-
accessToken: string;
|
|
940
|
-
shopDomain: string;
|
|
941
|
-
shopGid: string;
|
|
942
|
-
shopName: string;
|
|
943
|
-
apiVersion: string;
|
|
944
|
-
}>;
|
|
945
|
-
/**
|
|
946
|
-
* Pattern A: multi-account credential fetch for Shopify. Returns every
|
|
947
|
-
* agent-scoped Shopify Connection. One OAuth grant maps to one store, so the
|
|
948
|
-
* stable per-call selector is the store's myshopify domain (`shopDomain`),
|
|
949
|
-
* NOT `accountIdentifier` — the connect provider keys `accountIdentifier` on
|
|
950
|
-
* the immutable shop GID (falling back to the domain), so `shopDomain` is the
|
|
951
|
-
* value the LLM passes and the plugin routes on.
|
|
952
|
-
*
|
|
953
|
-
* Each entry is shaped by the connect provider's `buildCredentialsResponse`:
|
|
954
|
-
* `{ accessToken, shopDomain, shopGid, shopName, apiVersion }` — offline
|
|
955
|
-
* Shopify tokens never expire, so there is NO token / expiry field and no
|
|
956
|
-
* refresh method (unlike Salesforce). The GraphQL Admin API authenticates
|
|
957
|
-
* purely on `X-Shopify-Access-Token`; no client credentials are on the wire.
|
|
958
|
-
*/
|
|
959
|
-
getShopifyAccounts(): Promise<{
|
|
960
|
-
accounts: {
|
|
961
|
-
connectionId: string;
|
|
962
|
-
accountIdentifier: string;
|
|
963
|
-
displayName: string | null;
|
|
964
|
-
connectedAt: string;
|
|
965
|
-
accessToken: string;
|
|
966
|
-
shopDomain: string;
|
|
967
|
-
shopGid: string;
|
|
968
|
-
shopName: string;
|
|
969
|
-
apiVersion: string;
|
|
970
|
-
}[];
|
|
971
|
-
}>;
|
|
972
|
-
/**
|
|
973
|
-
* Disconnects one connected Microsoft 365 account for the agent, by its
|
|
974
|
-
* `accountIdentifier`. Hits the generic per-account disconnect route
|
|
975
|
-
* (`DELETE /agent/connect/microsoft/accounts/{accountIdentifier}`), which
|
|
976
|
-
* resolves across the agent's full effective scope chain and deletes the
|
|
977
|
-
* matching Connection row. Returns the remaining accounts.
|
|
978
|
-
*
|
|
979
|
-
* IMPORTANT: pass the `accountIdentifier` from `getMicrosoftAccounts()`, NOT
|
|
980
|
-
* a synthesised email. For Microsoft, `accountIdentifier` is the user's email
|
|
981
|
-
* only when the Graph profile fetch succeeded at connect time; it falls back
|
|
982
|
-
* to the Azure tenant id (`tid` claim) otherwise. The backend matches on
|
|
983
|
-
* `accountIdentifier` exactly, so passing an email would 404 on those
|
|
984
|
-
* fallback-identifier accounts. (This is why the param is not named `email`,
|
|
985
|
-
* unlike `disconnectGoogleAccount` where the identifier is always the email.)
|
|
986
|
-
*/
|
|
987
|
-
disconnectMicrosoftAccount(accountIdentifier: string): Promise<{
|
|
988
|
-
accounts: {
|
|
989
|
-
accountIdentifier: string;
|
|
990
|
-
displayName?: string;
|
|
991
|
-
connectedAt?: string;
|
|
992
|
-
}[];
|
|
993
|
-
}>;
|
|
994
1191
|
/**
|
|
995
1192
|
* Pattern A: multi-account credential fetch for Microsoft 365.
|
|
996
1193
|
*
|
|
@@ -1041,242 +1238,213 @@ declare class AgentApiClient {
|
|
|
1041
1238
|
accessTokenExpiresAt: string;
|
|
1042
1239
|
expiresAt: string;
|
|
1043
1240
|
}>;
|
|
1044
|
-
getTeamsCredentials(): Promise<{
|
|
1045
|
-
agentId: string;
|
|
1046
|
-
tenantId: string;
|
|
1047
|
-
azureAppId: string;
|
|
1048
|
-
azureBotId: string;
|
|
1049
|
-
azureClientSecret: string;
|
|
1050
|
-
botDisplayName?: string;
|
|
1051
|
-
teamsTenantId?: string;
|
|
1052
|
-
serviceUrl?: string;
|
|
1053
|
-
}>;
|
|
1054
|
-
sendTeamsMessage(data: {
|
|
1055
|
-
conversationId: string;
|
|
1056
|
-
text?: string;
|
|
1057
|
-
adaptiveCard?: Record<string, unknown>;
|
|
1058
|
-
}): Promise<{
|
|
1059
|
-
ok: boolean;
|
|
1060
|
-
activityId: string;
|
|
1061
|
-
}>;
|
|
1062
|
-
listTeamsChannels(): Promise<{
|
|
1063
|
-
channels: {
|
|
1064
|
-
id: string;
|
|
1065
|
-
name: string;
|
|
1066
|
-
description?: string;
|
|
1067
|
-
}[];
|
|
1068
|
-
}>;
|
|
1069
|
-
presignAttachments(files: {
|
|
1070
|
-
filename: string;
|
|
1071
|
-
mimeType: string;
|
|
1072
|
-
size: number;
|
|
1073
|
-
}[]): Promise<{
|
|
1074
|
-
attachments: {
|
|
1075
|
-
id: string;
|
|
1076
|
-
uploadUrl: string;
|
|
1077
|
-
downloadUrl: string;
|
|
1078
|
-
s3Key: string;
|
|
1079
|
-
expiresAt: string;
|
|
1080
|
-
}[];
|
|
1081
|
-
}>;
|
|
1082
1241
|
/**
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
* `
|
|
1242
|
+
* Disconnects one connected Microsoft 365 account for the agent, by its
|
|
1243
|
+
* `accountIdentifier`. Hits the generic per-account disconnect route
|
|
1244
|
+
* (`DELETE /agent/connect/microsoft/accounts/{accountIdentifier}`), which
|
|
1245
|
+
* resolves across the agent's full effective scope chain and deletes the
|
|
1246
|
+
* matching Connection row. Returns the remaining accounts.
|
|
1086
1247
|
*
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1248
|
+
* IMPORTANT: pass the `accountIdentifier` from `getMicrosoftAccounts()`, NOT
|
|
1249
|
+
* a synthesised email. For Microsoft, `accountIdentifier` is the user's email
|
|
1250
|
+
* only when the Graph profile fetch succeeded at connect time; it falls back
|
|
1251
|
+
* to the Azure tenant id (`tid` claim) otherwise. The backend matches on
|
|
1252
|
+
* `accountIdentifier` exactly, so passing an email would 404 on those
|
|
1253
|
+
* fallback-identifier accounts. (This is why the param is not named `email`,
|
|
1254
|
+
* unlike `disconnectGoogleAccount` where the identifier is always the email.)
|
|
1092
1255
|
*/
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
imageUrl: string;
|
|
1100
|
-
model: string;
|
|
1101
|
-
}>;
|
|
1102
|
-
recordActivity(data: {
|
|
1103
|
-
userId?: string;
|
|
1104
|
-
channel: string;
|
|
1105
|
-
role: "user" | "assistant";
|
|
1106
|
-
}): Promise<{
|
|
1107
|
-
recorded: boolean;
|
|
1256
|
+
disconnectMicrosoftAccount(accountIdentifier: string): Promise<{
|
|
1257
|
+
accounts: {
|
|
1258
|
+
accountIdentifier: string;
|
|
1259
|
+
displayName?: string;
|
|
1260
|
+
connectedAt?: string;
|
|
1261
|
+
}[];
|
|
1108
1262
|
}>;
|
|
1109
|
-
/** Update the agent's own name and/or voice config. Returns the updated agent. */
|
|
1110
|
-
updateSelf(update: {
|
|
1111
|
-
name?: string;
|
|
1112
|
-
voiceConfig?: AgentVoiceConfig;
|
|
1113
|
-
}): Promise<AgentSelf>;
|
|
1114
1263
|
/**
|
|
1115
|
-
*
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1121
|
-
*
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
prompt: string;
|
|
1125
|
-
}): Promise<AgentSelf>;
|
|
1126
|
-
/**
|
|
1127
|
-
* Get a presigned PUT URL to upload a new avatar image. Upload the bytes to
|
|
1128
|
-
* `uploadUrl`, then call `finalizeAvatar(s3Key)` to set it on the agent.
|
|
1264
|
+
* Resolve the primary cTrader Connection's credentials for the calling
|
|
1265
|
+
* agent. Unlike most providers, the cTrader Open API needs app-level auth
|
|
1266
|
+
* (`clientId` + `clientSecret`) AND account auth (`accessToken` +
|
|
1267
|
+
* `accountId`) on the socket, so `@alfe.ai/ctrader-mcp` self-fetches the
|
|
1268
|
+
* full set here at startup (the atlassian/google pattern). `clientId` /
|
|
1269
|
+
* `clientSecret` are the SST-sourced global app credentials the connect
|
|
1270
|
+
* endpoint injects — they are never persisted on the connection. `host` is
|
|
1271
|
+
* the resolved TLS endpoint (`live.ctraderapi.com` / `demo.ctraderapi.com`)
|
|
1272
|
+
* derived from the selected account's live/demo flag.
|
|
1129
1273
|
*/
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1274
|
+
getCTraderCredentials(): Promise<{
|
|
1275
|
+
accessToken: string;
|
|
1276
|
+
refreshToken: string;
|
|
1277
|
+
accountId: string;
|
|
1278
|
+
host: string;
|
|
1279
|
+
clientId: string;
|
|
1280
|
+
clientSecret: string;
|
|
1281
|
+
}>;
|
|
1134
1282
|
/**
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1283
|
+
* Pattern A: multi-account credential fetch for cTrader.
|
|
1284
|
+
*
|
|
1285
|
+
* Unlike atlassian/salesforce (one Connection row per account/site), a
|
|
1286
|
+
* cTrader is MULTI-grant per agent: an agent may connect several distinct
|
|
1287
|
+
* cTrader logins, each its own Connection row keyed on `accountIdentifier =
|
|
1288
|
+
* ctid:<userId>` (Phase 1). This aggregates the *trading accounts* across
|
|
1289
|
+
* ALL of those Connection rows — each row contributes its `availableAccounts`
|
|
1290
|
+
* flattened, and every account carries ITS OWN grant's `accessToken` (the
|
|
1291
|
+
* token that authenticates that account against the cTrader Open API). One
|
|
1292
|
+
* OAuth grant still covers all accounts under that single login on one shared
|
|
1293
|
+
* token; only the `ctidTraderAccountId` and the protobuf socket `host` (live
|
|
1294
|
+
* vs demo) differ within a grant. Across grants the tokens differ, so the
|
|
1295
|
+
* token is now PER-ACCOUNT rather than hoisted to the top level.
|
|
1296
|
+
*
|
|
1297
|
+
* `host` per account is derived from the account's `isLive` flag
|
|
1298
|
+
* (`live.ctraderapi.com` / `demo.ctraderapi.com`) — the same mapping the
|
|
1299
|
+
* connect provider applies server-side when an account is auto-selected.
|
|
1300
|
+
*
|
|
1301
|
+
* `clientId` / `clientSecret` are the SST-sourced GLOBAL app credentials the
|
|
1302
|
+
* connect endpoint injects — identical across every Connection row (one
|
|
1303
|
+
* cTrader app), never persisted on a connection. We take them from the first
|
|
1304
|
+
* row that carries them.
|
|
1305
|
+
*
|
|
1306
|
+
* Accounts are deduped on `ctidTraderAccountId` first-wins: Spotware ids are
|
|
1307
|
+
* globally unique across logins, so a duplicate can only appear if the same
|
|
1308
|
+
* account somehow surfaced under two grants — first-wins keeps it
|
|
1309
|
+
* deterministic.
|
|
1310
|
+
*
|
|
1311
|
+
* `accounts` may be empty (no cTrader Connection at all), in which case we
|
|
1312
|
+
* return empty creds rather than throwing.
|
|
1137
1313
|
*/
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1314
|
+
getCTraderAccounts(): Promise<{
|
|
1315
|
+
accounts: {
|
|
1316
|
+
ctidTraderAccountId: string;
|
|
1317
|
+
host: string;
|
|
1318
|
+
isLive: boolean;
|
|
1319
|
+
brokerName?: string;
|
|
1320
|
+
accountNumber?: string;
|
|
1321
|
+
accessToken: string;
|
|
1322
|
+
}[];
|
|
1323
|
+
clientId: string;
|
|
1324
|
+
clientSecret: string;
|
|
1142
1325
|
}>;
|
|
1143
1326
|
/**
|
|
1144
|
-
*
|
|
1145
|
-
*
|
|
1146
|
-
*
|
|
1147
|
-
* or field it doesn't own. Legacy single-envelope secrets are migrated to
|
|
1148
|
-
* `field#value` rows by the data migration, so call with `fieldKey: "value"`
|
|
1149
|
-
* to reach them.
|
|
1327
|
+
* @deprecated Returns a single primary credential blob. Use
|
|
1328
|
+
* `getShopifyAccounts()` for the multi-account shape required by Pattern A
|
|
1329
|
+
* (`@alfe.ai/shopify-mcp` keys per-shop on the myshopify domain).
|
|
1150
1330
|
*/
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1331
|
+
getShopifyCredentials(): Promise<{
|
|
1332
|
+
accessToken: string;
|
|
1333
|
+
shopDomain: string;
|
|
1334
|
+
shopGid: string;
|
|
1335
|
+
shopName: string;
|
|
1336
|
+
apiVersion: string;
|
|
1337
|
+
}>;
|
|
1157
1338
|
/**
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
* `
|
|
1339
|
+
* Pattern A: multi-account credential fetch for Shopify. Returns every
|
|
1340
|
+
* agent-scoped Shopify Connection. One OAuth grant maps to one store, so the
|
|
1341
|
+
* stable per-call selector is the store's myshopify domain (`shopDomain`),
|
|
1342
|
+
* NOT `accountIdentifier` — the connect provider keys `accountIdentifier` on
|
|
1343
|
+
* the immutable shop GID (falling back to the domain), so `shopDomain` is the
|
|
1344
|
+
* value the LLM passes and the plugin routes on.
|
|
1345
|
+
*
|
|
1346
|
+
* Each entry is shaped by the connect provider's `buildCredentialsResponse`:
|
|
1347
|
+
* `{ accessToken, shopDomain, shopGid, shopName, apiVersion }` — offline
|
|
1348
|
+
* Shopify tokens never expire, so there is NO token / expiry field and no
|
|
1349
|
+
* refresh method (unlike Salesforce). The GraphQL Admin API authenticates
|
|
1350
|
+
* purely on `X-Shopify-Access-Token`; no client credentials are on the wire.
|
|
1162
1351
|
*/
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1352
|
+
getShopifyAccounts(): Promise<{
|
|
1353
|
+
accounts: {
|
|
1354
|
+
connectionId: string;
|
|
1355
|
+
accountIdentifier: string;
|
|
1356
|
+
displayName: string | null;
|
|
1357
|
+
connectedAt: string;
|
|
1358
|
+
accessToken: string;
|
|
1359
|
+
shopDomain: string;
|
|
1360
|
+
shopGid: string;
|
|
1361
|
+
shopName: string;
|
|
1362
|
+
apiVersion: string;
|
|
1363
|
+
}[];
|
|
1171
1364
|
}>;
|
|
1172
1365
|
/**
|
|
1173
|
-
*
|
|
1174
|
-
*
|
|
1175
|
-
*
|
|
1176
|
-
*
|
|
1366
|
+
* Pattern A: provider-parameterized multi-account credential fetch for the
|
|
1367
|
+
* social connectors (Bluesky, and the approval-gated backlog: X, Meta,
|
|
1368
|
+
* Threads, LinkedIn, Pinterest, TikTok, Reddit, YouTube).
|
|
1369
|
+
*
|
|
1370
|
+
* Unlike the bespoke `getGithubAccounts()` / `getXeroAccounts()` shapes,
|
|
1371
|
+
* this returns a UNIFORM normalized account shape so `@alfe.ai/social-mcp`'s
|
|
1372
|
+
* shared driver can require a single `account` selector on every
|
|
1373
|
+
* credential-touching tool regardless of platform. The backend
|
|
1374
|
+
* `api-agents/{provider}/accounts` route is already provider-generic; this
|
|
1375
|
+
* is the client-side normalization the plan (`do-we-need-any-moonlit-toucan`
|
|
1376
|
+
* Phase 0, step 5) calls for.
|
|
1377
|
+
*
|
|
1378
|
+
* `accountIdentifier` is the stable per-account selector the LLM should
|
|
1379
|
+
* pass back (for Bluesky: the account DID). `accessToken` carries whatever
|
|
1380
|
+
* the provider's `buildCredentialsResponse` bundles (for Bluesky: the JSON
|
|
1381
|
+
* session bundle — the driver parses the `accessJwt` out of it, or reads the
|
|
1382
|
+
* top-level `accessJwt` from `providerMetadata`-adjacent fields). Everything
|
|
1383
|
+
* else the driver needs for routing (handle, pdsHost, did, …) is on
|
|
1384
|
+
* `providerMetadata`.
|
|
1385
|
+
*
|
|
1386
|
+
* Token refresh is delegated to connect (never done in-plugin) via the
|
|
1387
|
+
* per-account route `POST /agent/connect/{provider}/accounts/{accountIdentifier}/refresh`
|
|
1388
|
+
* — call `refreshSocialAccount(provider, accountIdentifier)`. (The non-account
|
|
1389
|
+
* `POST /agent/connect/{provider}/refresh` route refreshes the provider's
|
|
1390
|
+
* PRIMARY connection, which is wrong under multi-account Pattern A.)
|
|
1177
1391
|
*/
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
key: string;
|
|
1188
|
-
format?: FieldFormat;
|
|
1189
|
-
sensitivity: FieldSensitivity;
|
|
1190
|
-
value?: string;
|
|
1191
|
-
envelope?: EncryptedEnvelopeV1;
|
|
1392
|
+
getSocialAccounts(provider: string): Promise<{
|
|
1393
|
+
provider: string;
|
|
1394
|
+
accounts: {
|
|
1395
|
+
connectionId: string;
|
|
1396
|
+
accountIdentifier: string;
|
|
1397
|
+
displayName: string | null;
|
|
1398
|
+
accessToken: string;
|
|
1399
|
+
providerMetadata: Record<string, unknown>;
|
|
1400
|
+
connectedAt: string;
|
|
1192
1401
|
}[];
|
|
1193
|
-
reason?: string;
|
|
1194
|
-
}): Promise<SecretAggregate>;
|
|
1195
|
-
/** Fetch the secret aggregate plus per-field encrypted envelopes. */
|
|
1196
|
-
getSecret(args: {
|
|
1197
|
-
scope: SecretScope;
|
|
1198
|
-
scopeId: string;
|
|
1199
|
-
secretId: string;
|
|
1200
|
-
}): Promise<{
|
|
1201
|
-
aggregate: SecretAggregate;
|
|
1202
|
-
envelopes: FieldEnvelope[];
|
|
1203
1402
|
}>;
|
|
1204
|
-
/**
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
sensitivity: FieldSensitivity;
|
|
1227
|
-
format?: FieldFormat;
|
|
1228
|
-
value?: string;
|
|
1229
|
-
envelope?: EncryptedEnvelopeV1;
|
|
1230
|
-
reason?: string;
|
|
1231
|
-
}): Promise<{
|
|
1232
|
-
fieldKey: string;
|
|
1233
|
-
rotated: boolean;
|
|
1403
|
+
/**
|
|
1404
|
+
* Pattern A: refresh a specific social Connection by its stable
|
|
1405
|
+
* `accountIdentifier` (for Bluesky: the account DID) via the
|
|
1406
|
+
* provider-generic per-account refresh route. The counterpart to
|
|
1407
|
+
* `getSocialAccounts(provider)`; `@alfe.ai/social-mcp` calls this on a
|
|
1408
|
+
* 401/ExpiredToken from the platform PDS/API, then re-fetches accounts to
|
|
1409
|
+
* pick up the rotated bundle.
|
|
1410
|
+
*
|
|
1411
|
+
* Refresh itself is ALWAYS delegated to connect — the plugin never calls
|
|
1412
|
+
* the platform's own refresh XRPC (e.g. `com.atproto.server.refreshSession`)
|
|
1413
|
+
* because connect owns the encrypted refresh token + rotation persistence
|
|
1414
|
+
* (Bluesky rotates the refreshJwt; a missed rotation kills the connection
|
|
1415
|
+
* after one refresh). The returned `accessToken` is whatever the provider's
|
|
1416
|
+
* `refreshToken` hook re-bundled (for Bluesky: the JSON session bundle with
|
|
1417
|
+
* the fresh `accessJwt`) — callers typically ignore it and re-fetch via
|
|
1418
|
+
* `getSocialAccounts` for a consistent shape.
|
|
1419
|
+
*/
|
|
1420
|
+
refreshSocialAccount(provider: string, accountIdentifier: string): Promise<{
|
|
1421
|
+
accountIdentifier: string;
|
|
1422
|
+
accessToken: string;
|
|
1423
|
+
accessTokenExpiresAt: string;
|
|
1424
|
+
expiresAt: string;
|
|
1234
1425
|
}>;
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
scopeId: string;
|
|
1246
|
-
secretId: string;
|
|
1247
|
-
secretName?: string;
|
|
1248
|
-
description?: string;
|
|
1249
|
-
tags?: string[];
|
|
1250
|
-
category?: SecretCategory;
|
|
1251
|
-
reason?: string;
|
|
1252
|
-
}): Promise<SecretAggregate>;
|
|
1253
|
-
/** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
|
|
1254
|
-
listSecrets(args: {
|
|
1255
|
-
scope: SecretScope;
|
|
1256
|
-
scopeId: string;
|
|
1257
|
-
category?: SecretCategory;
|
|
1258
|
-
tag?: string;
|
|
1259
|
-
fieldKey?: string;
|
|
1260
|
-
}): Promise<SecretMetadata[]>;
|
|
1261
|
-
/** Bounded changelog read — metadata-only audit entries. */
|
|
1262
|
-
getSecretHistory(args: {
|
|
1263
|
-
scope: SecretScope;
|
|
1264
|
-
scopeId: string;
|
|
1265
|
-
secretId: string;
|
|
1266
|
-
limit?: number;
|
|
1267
|
-
cursor?: string;
|
|
1268
|
-
}): Promise<{
|
|
1269
|
-
entries: ChangelogEntry[];
|
|
1270
|
-
nextCursor?: string;
|
|
1426
|
+
}
|
|
1427
|
+
//# sourceMappingURL=connect-credentials.d.ts.map
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/domains/database.d.ts
|
|
1430
|
+
declare class DatabaseApi extends ApiBase {
|
|
1431
|
+
registerDatabaseCredentials(): Promise<{
|
|
1432
|
+
connectionString: string;
|
|
1433
|
+
username: string;
|
|
1434
|
+
password: string;
|
|
1435
|
+
databases: string[];
|
|
1271
1436
|
}>;
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1437
|
+
reportDatabaseAudit(entry: {
|
|
1438
|
+
database: string;
|
|
1439
|
+
collection: string;
|
|
1440
|
+
operation: string;
|
|
1441
|
+
summary?: string;
|
|
1277
1442
|
}): Promise<void>;
|
|
1278
|
-
|
|
1279
|
-
|
|
1443
|
+
}
|
|
1444
|
+
//# sourceMappingURL=database.d.ts.map
|
|
1445
|
+
//#endregion
|
|
1446
|
+
//#region src/domains/identity.d.ts
|
|
1447
|
+
declare class IdentityApi extends ApiBase {
|
|
1280
1448
|
/**
|
|
1281
1449
|
* Returns the calling agent's own identity context — `{ agentId, tenantId }`
|
|
1282
1450
|
* decoded server-side from the agent API token. Used by the
|
|
@@ -1439,6 +1607,62 @@ declare class AgentApiClient {
|
|
|
1439
1607
|
identityId: string | null;
|
|
1440
1608
|
status: string;
|
|
1441
1609
|
}>;
|
|
1610
|
+
}
|
|
1611
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
1612
|
+
//#endregion
|
|
1613
|
+
//#region src/domains/images.d.ts
|
|
1614
|
+
declare class ImagesApi extends ApiBase {
|
|
1615
|
+
/**
|
|
1616
|
+
* Generate an image from a text prompt and get back a STABLE, public URL
|
|
1617
|
+
* (served from the agent-assets CDN — it does not expire). Embed the returned
|
|
1618
|
+
* `imageUrl` in a reply as markdown to show it to the user.
|
|
1619
|
+
*
|
|
1620
|
+
* ASYNC: `gpt-image-1` routinely runs 30–60s, which exceeds the API Gateway
|
|
1621
|
+
* 30s ceiling, so this enqueues a job (`POST /agent/images/generate` →
|
|
1622
|
+
* `jobId`) then polls (`GET /agent/images/{jobId}`) until it completes. The
|
|
1623
|
+
* worker's real failure message (e.g. an unsupported `size`) surfaces via the
|
|
1624
|
+
* job's `error` field.
|
|
1625
|
+
*/
|
|
1626
|
+
generateImage(args: {
|
|
1627
|
+
prompt: string;
|
|
1628
|
+
model?: string;
|
|
1629
|
+
size?: string;
|
|
1630
|
+
quality?: string;
|
|
1631
|
+
}): Promise<{
|
|
1632
|
+
imageUrl: string;
|
|
1633
|
+
model: string;
|
|
1634
|
+
}>;
|
|
1635
|
+
}
|
|
1636
|
+
//# sourceMappingURL=images.d.ts.map
|
|
1637
|
+
//#endregion
|
|
1638
|
+
//#region src/domains/integrations.d.ts
|
|
1639
|
+
declare class IntegrationsApi extends ApiBase {
|
|
1640
|
+
listIntegrations(): Promise<IntegrationInstall[]>;
|
|
1641
|
+
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
|
|
1642
|
+
updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
|
|
1643
|
+
installIntegration(integrationId: string, options?: {
|
|
1644
|
+
version?: string;
|
|
1645
|
+
config?: Record<string, unknown>;
|
|
1646
|
+
}): Promise<IntegrationInstall>;
|
|
1647
|
+
removeIntegration(integrationId: string): Promise<IntegrationInstall>;
|
|
1648
|
+
getOAuthUrl(provider: string, scopes?: string[]): Promise<{
|
|
1649
|
+
url: string;
|
|
1650
|
+
provider: string;
|
|
1651
|
+
expiresIn: number;
|
|
1652
|
+
}>;
|
|
1653
|
+
getOAuthStatus(provider: string): Promise<{
|
|
1654
|
+
provider: string;
|
|
1655
|
+
connected: boolean;
|
|
1656
|
+
config?: Record<string, string>;
|
|
1657
|
+
}>;
|
|
1658
|
+
getRegistry(): Promise<{
|
|
1659
|
+
integrations: RegistryEntry[];
|
|
1660
|
+
}>;
|
|
1661
|
+
}
|
|
1662
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
1663
|
+
//#endregion
|
|
1664
|
+
//#region src/domains/memory.d.ts
|
|
1665
|
+
declare class MemoryApi extends ApiBase {
|
|
1442
1666
|
memorySearch(query: string, opts?: {
|
|
1443
1667
|
limit?: number;
|
|
1444
1668
|
topic?: string;
|
|
@@ -1481,7 +1705,7 @@ declare class AgentApiClient {
|
|
|
1481
1705
|
channelId?: string;
|
|
1482
1706
|
userId?: string;
|
|
1483
1707
|
userName?: string;
|
|
1484
|
-
}): Promise<{
|
|
1708
|
+
}, ingestEpoch?: number): Promise<{
|
|
1485
1709
|
queued: boolean;
|
|
1486
1710
|
messageCount: number;
|
|
1487
1711
|
}>;
|
|
@@ -1515,196 +1739,216 @@ declare class AgentApiClient {
|
|
|
1515
1739
|
vectorCount: number;
|
|
1516
1740
|
tripleCount: number;
|
|
1517
1741
|
storageEstimateBytes: number;
|
|
1518
|
-
lastIngestionAt?: string;
|
|
1519
|
-
}>;
|
|
1520
|
-
memoryLearn(args: {
|
|
1521
|
-
text: string;
|
|
1522
|
-
source?: string;
|
|
1523
|
-
sourceType?: "file" | "url" | "inline";
|
|
1524
|
-
metadata?: {
|
|
1525
|
-
sessionId?: string;
|
|
1526
|
-
channelId?: string;
|
|
1527
|
-
userName?: string;
|
|
1528
|
-
};
|
|
1529
|
-
}): Promise<{
|
|
1530
|
-
memoriesStored: number;
|
|
1531
|
-
triplesStored: number;
|
|
1532
|
-
chunks: number;
|
|
1533
|
-
source?: string;
|
|
1534
|
-
}>;
|
|
1535
|
-
memoryBootstrapStatus(): Promise<{
|
|
1536
|
-
synced: boolean;
|
|
1537
|
-
syncedAt?: string;
|
|
1538
|
-
sessionsBackfillSynced?: boolean;
|
|
1539
|
-
sessionsBackfillSyncedAt?: string;
|
|
1540
|
-
}>;
|
|
1541
|
-
memoryBootstrapStatusMark(scope?: "files" | "sessions"): Promise<{
|
|
1542
|
-
synced: true;
|
|
1543
|
-
syncedAt: string;
|
|
1544
|
-
}>;
|
|
1545
|
-
sendSms(args: {
|
|
1546
|
-
to: string;
|
|
1547
|
-
body: string;
|
|
1548
|
-
}): Promise<{
|
|
1549
|
-
sent: boolean;
|
|
1550
|
-
sid: string;
|
|
1551
|
-
}>;
|
|
1552
|
-
searchWeb(params: {
|
|
1553
|
-
query: string;
|
|
1554
|
-
count?: number;
|
|
1555
|
-
offset?: number;
|
|
1556
|
-
country?: string;
|
|
1557
|
-
freshness?: string;
|
|
1558
|
-
}): Promise<unknown>;
|
|
1559
|
-
searchImages(params: {
|
|
1560
|
-
query: string;
|
|
1561
|
-
count?: number;
|
|
1562
|
-
}): Promise<unknown>;
|
|
1563
|
-
searchNews(params: {
|
|
1564
|
-
query: string;
|
|
1565
|
-
count?: number;
|
|
1566
|
-
freshness?: string;
|
|
1567
|
-
}): Promise<unknown>;
|
|
1568
|
-
/** Search news across the selected provider's corpus. → POST /agent/news/search */
|
|
1569
|
-
newsSearch(params: {
|
|
1570
|
-
query: string;
|
|
1571
|
-
provider?: NewsProvider;
|
|
1572
|
-
source?: string;
|
|
1573
|
-
from?: string;
|
|
1574
|
-
to?: string;
|
|
1575
|
-
language?: string;
|
|
1576
|
-
category?: string;
|
|
1577
|
-
limit?: number;
|
|
1578
|
-
}): Promise<NewsResult>;
|
|
1579
|
-
/** Top headlines for the selected provider. → POST /agent/news/headlines */
|
|
1580
|
-
newsHeadlines(params?: {
|
|
1581
|
-
provider?: NewsProvider;
|
|
1582
|
-
category?: string;
|
|
1583
|
-
source?: string;
|
|
1584
|
-
language?: string;
|
|
1585
|
-
limit?: number;
|
|
1586
|
-
}): Promise<NewsResult>;
|
|
1587
|
-
/**
|
|
1588
|
-
* Semantic search across the agent's member scopes. Fan-out is gated
|
|
1589
|
-
* server-side by `listScopes` set-inclusion (fail-closed). Pass
|
|
1590
|
-
* `scopeType` + `scopeId` to narrow to one scope; a non-member scope
|
|
1591
|
-
* yields empty results (never a cross-scope leak).
|
|
1592
|
-
*/
|
|
1593
|
-
knowledgeSearch(query: string, opts?: {
|
|
1594
|
-
limit?: number;
|
|
1595
|
-
scopeType?: KnowledgeScopeType;
|
|
1596
|
-
scopeId?: string;
|
|
1597
|
-
}): Promise<KnowledgeSearchResult>;
|
|
1598
|
-
/** Enumerate the scopes (org + teams + projects) this agent belongs to. */
|
|
1599
|
-
listScopes(): Promise<{
|
|
1600
|
-
scopes: KnowledgeScope[];
|
|
1742
|
+
lastIngestionAt?: string;
|
|
1601
1743
|
}>;
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1744
|
+
memoryLearn(args: {
|
|
1745
|
+
text: string;
|
|
1746
|
+
source?: string;
|
|
1747
|
+
sourceType?: "file" | "url" | "inline";
|
|
1748
|
+
metadata?: {
|
|
1749
|
+
sessionId?: string;
|
|
1750
|
+
channelId?: string;
|
|
1751
|
+
userName?: string;
|
|
1752
|
+
};
|
|
1608
1753
|
}): Promise<{
|
|
1609
|
-
|
|
1610
|
-
|
|
1754
|
+
memoriesStored: number;
|
|
1755
|
+
triplesStored: number;
|
|
1756
|
+
chunks: number;
|
|
1757
|
+
source?: string;
|
|
1758
|
+
}>;
|
|
1759
|
+
memoryBootstrapStatus(): Promise<{
|
|
1760
|
+
synced: boolean;
|
|
1761
|
+
syncedAt?: string;
|
|
1762
|
+
sessionsBackfillSynced?: boolean;
|
|
1763
|
+
sessionsBackfillSyncedAt?: string;
|
|
1764
|
+
}>;
|
|
1765
|
+
memoryBootstrapStatusMark(scope?: "files" | "sessions"): Promise<{
|
|
1766
|
+
synced: true;
|
|
1767
|
+
syncedAt: string;
|
|
1611
1768
|
}>;
|
|
1769
|
+
}
|
|
1770
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
1771
|
+
//#endregion
|
|
1772
|
+
//#region src/domains/secrets.d.ts
|
|
1773
|
+
declare class SecretsApi extends ApiBase {
|
|
1612
1774
|
/**
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1775
|
+
* Mint a fresh AES-256 data key for a specific (secret, field) pair. The
|
|
1776
|
+
* encryption context is rebuilt server-side from `auth.tenantId` + the body
|
|
1777
|
+
* fields including `fieldKey`; the agent cannot forge context for a scope
|
|
1778
|
+
* or field it doesn't own. Legacy single-envelope secrets are migrated to
|
|
1779
|
+
* `field#value` rows by the data migration, so call with `fieldKey: "value"`
|
|
1780
|
+
* to reach them.
|
|
1616
1781
|
*/
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1782
|
+
generateSecretDataKey(args: {
|
|
1783
|
+
scope: SecretScope;
|
|
1784
|
+
scopeId: string;
|
|
1785
|
+
secretId: string;
|
|
1786
|
+
fieldKey: string;
|
|
1787
|
+
}): Promise<GeneratedDataKey>;
|
|
1621
1788
|
/**
|
|
1622
|
-
*
|
|
1623
|
-
* `
|
|
1624
|
-
*
|
|
1625
|
-
*
|
|
1626
|
-
* authorKind are server-set from the agent token — never trusted here.
|
|
1789
|
+
* Unwrap a wrapped data key so the agent can decrypt the envelope locally.
|
|
1790
|
+
* `fieldKey` MUST match the value supplied when the data key was generated
|
|
1791
|
+
* (it's bound into KMS encryption context); mismatch fails with
|
|
1792
|
+
* `InvalidCiphertextException`.
|
|
1627
1793
|
*/
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1794
|
+
decryptSecretDataKey(args: {
|
|
1795
|
+
scope: SecretScope;
|
|
1796
|
+
scopeId: string;
|
|
1797
|
+
secretId: string;
|
|
1798
|
+
fieldKey: string;
|
|
1799
|
+
dataKeyCiphertext: string;
|
|
1631
1800
|
}): Promise<{
|
|
1632
|
-
|
|
1801
|
+
plaintextKey: string;
|
|
1633
1802
|
}>;
|
|
1634
1803
|
/**
|
|
1635
|
-
*
|
|
1636
|
-
*
|
|
1637
|
-
*
|
|
1638
|
-
*
|
|
1639
|
-
* canonical doc — attributed to this agent — only when a reviewer approves.
|
|
1640
|
-
*/
|
|
1641
|
-
proposeScopeChange(scopeType: KnowledgeScopeType, scopeId: string, input: ProposeScopeChangeInput): Promise<KnowledgeChangeRequest>;
|
|
1642
|
-
/**
|
|
1643
|
-
* List the agent's OWN change requests in a scope (filtered server-side to
|
|
1644
|
-
* this agent as proposer). Pass `status` to narrow to open / approved / etc.
|
|
1804
|
+
* Create a new secret with one or more fields. Encrypted fields must arrive
|
|
1805
|
+
* pre-sealed (the agent has already obtained per-field data keys via
|
|
1806
|
+
* `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).
|
|
1807
|
+
* Plaintext fields ship the value inline.
|
|
1645
1808
|
*/
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1809
|
+
createSecret(args: {
|
|
1810
|
+
scope: SecretScope;
|
|
1811
|
+
scopeId: string;
|
|
1812
|
+
secretId: string;
|
|
1813
|
+
secretName: string;
|
|
1814
|
+
category?: SecretCategory;
|
|
1815
|
+
description?: string;
|
|
1816
|
+
tags?: string[];
|
|
1817
|
+
fields: {
|
|
1818
|
+
key: string;
|
|
1819
|
+
format?: FieldFormat;
|
|
1820
|
+
sensitivity: FieldSensitivity;
|
|
1821
|
+
value?: string;
|
|
1822
|
+
envelope?: EncryptedEnvelopeV1;
|
|
1823
|
+
}[];
|
|
1824
|
+
reason?: string;
|
|
1825
|
+
}): Promise<SecretAggregate>;
|
|
1826
|
+
/** Fetch the secret aggregate plus per-field encrypted envelopes. */
|
|
1827
|
+
getSecret(args: {
|
|
1828
|
+
scope: SecretScope;
|
|
1829
|
+
scopeId: string;
|
|
1830
|
+
secretId: string;
|
|
1650
1831
|
}): Promise<{
|
|
1651
|
-
|
|
1652
|
-
|
|
1832
|
+
aggregate: SecretAggregate;
|
|
1833
|
+
envelopes: FieldEnvelope[];
|
|
1653
1834
|
}>;
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1835
|
+
/** Fetch one field. Plaintext: value inline. Encrypted: envelope. */
|
|
1836
|
+
getSecretField(args: {
|
|
1837
|
+
scope: SecretScope;
|
|
1838
|
+
scopeId: string;
|
|
1839
|
+
secretId: string;
|
|
1840
|
+
fieldKey: string;
|
|
1841
|
+
}): Promise<{
|
|
1842
|
+
key: string;
|
|
1843
|
+
sensitivity: FieldSensitivity;
|
|
1844
|
+
format?: FieldFormat;
|
|
1845
|
+
value?: string;
|
|
1846
|
+
envelope?: EncryptedEnvelopeV1;
|
|
1847
|
+
rotatedAt?: string;
|
|
1848
|
+
createdAt: string;
|
|
1849
|
+
updatedAt: string;
|
|
1659
1850
|
}>;
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1851
|
+
/** Add OR rotate one field. */
|
|
1852
|
+
setSecretField(args: {
|
|
1853
|
+
scope: SecretScope;
|
|
1854
|
+
scopeId: string;
|
|
1855
|
+
secretId: string;
|
|
1856
|
+
fieldKey: string;
|
|
1857
|
+
sensitivity: FieldSensitivity;
|
|
1858
|
+
format?: FieldFormat;
|
|
1859
|
+
value?: string;
|
|
1860
|
+
envelope?: EncryptedEnvelopeV1;
|
|
1861
|
+
reason?: string;
|
|
1862
|
+
}): Promise<{
|
|
1863
|
+
fieldKey: string;
|
|
1864
|
+
rotated: boolean;
|
|
1865
|
+
}>;
|
|
1866
|
+
/** Remove one field. */
|
|
1867
|
+
removeSecretField(args: {
|
|
1868
|
+
scope: SecretScope;
|
|
1869
|
+
scopeId: string;
|
|
1870
|
+
secretId: string;
|
|
1871
|
+
fieldKey: string;
|
|
1665
1872
|
}): Promise<void>;
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1873
|
+
/** Update secret-level metadata (name/description/tags/category). */
|
|
1874
|
+
updateSecretMetadata(args: {
|
|
1875
|
+
scope: SecretScope;
|
|
1876
|
+
scopeId: string;
|
|
1877
|
+
secretId: string;
|
|
1878
|
+
secretName?: string;
|
|
1879
|
+
description?: string;
|
|
1880
|
+
tags?: string[];
|
|
1881
|
+
category?: SecretCategory;
|
|
1882
|
+
reason?: string;
|
|
1883
|
+
}): Promise<SecretAggregate>;
|
|
1884
|
+
/** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
|
|
1885
|
+
listSecrets(args: {
|
|
1886
|
+
scope: SecretScope;
|
|
1887
|
+
scopeId: string;
|
|
1888
|
+
category?: SecretCategory;
|
|
1889
|
+
tag?: string;
|
|
1890
|
+
fieldKey?: string;
|
|
1891
|
+
}): Promise<SecretMetadata[]>;
|
|
1892
|
+
/** Bounded changelog read — metadata-only audit entries. */
|
|
1893
|
+
getSecretHistory(args: {
|
|
1894
|
+
scope: SecretScope;
|
|
1895
|
+
scopeId: string;
|
|
1896
|
+
secretId: string;
|
|
1897
|
+
limit?: number;
|
|
1898
|
+
cursor?: string;
|
|
1670
1899
|
}): Promise<{
|
|
1671
|
-
|
|
1672
|
-
|
|
1900
|
+
entries: ChangelogEntry[];
|
|
1901
|
+
nextCursor?: string;
|
|
1673
1902
|
}>;
|
|
1674
|
-
|
|
1675
|
-
|
|
1903
|
+
/** Delete a secret (and all its field rows + tag rows + changelog rows). */
|
|
1904
|
+
deleteSecret(args: {
|
|
1905
|
+
scope: SecretScope;
|
|
1906
|
+
scopeId: string;
|
|
1907
|
+
secretId: string;
|
|
1908
|
+
}): Promise<void>;
|
|
1909
|
+
/** Enumerate scopes (org/team/project/agent) this agent can access. */
|
|
1910
|
+
listSecretScopes(): Promise<ScopeInfo[]>;
|
|
1911
|
+
}
|
|
1912
|
+
//# sourceMappingURL=secrets.d.ts.map
|
|
1913
|
+
//#endregion
|
|
1914
|
+
//#region src/domains/teams.d.ts
|
|
1915
|
+
declare class TeamsApi extends ApiBase {
|
|
1916
|
+
getTeamsCredentials(): Promise<{
|
|
1917
|
+
agentId: string;
|
|
1918
|
+
tenantId: string;
|
|
1919
|
+
azureAppId: string;
|
|
1920
|
+
azureBotId: string;
|
|
1921
|
+
azureClientSecret: string;
|
|
1922
|
+
botDisplayName?: string;
|
|
1923
|
+
teamsTenantId?: string;
|
|
1924
|
+
serviceUrl?: string;
|
|
1925
|
+
}>;
|
|
1926
|
+
sendTeamsMessage(data: {
|
|
1927
|
+
conversationId: string;
|
|
1928
|
+
text?: string;
|
|
1929
|
+
adaptiveCard?: Record<string, unknown>;
|
|
1930
|
+
}): Promise<{
|
|
1676
1931
|
ok: boolean;
|
|
1932
|
+
activityId: string;
|
|
1677
1933
|
}>;
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
* voice service defaults to 24 kHz / mono / 16-bit. Wrap in a WAV container
|
|
1694
|
-
* to produce a playable file. Metered per character against the tenant
|
|
1695
|
-
* credit pool server-side; TTS completes regardless of metering outcome.
|
|
1696
|
-
*/
|
|
1697
|
-
tts(args: VoiceTtsArgs): Promise<VoiceTtsResult>;
|
|
1698
|
-
/**
|
|
1699
|
-
* Speech-to-text. Accepts raw linear16 (16-bit LE) mono PCM — NOT a WAV or
|
|
1700
|
-
* other container (the endpoint transcribes with a fixed linear16 encoding,
|
|
1701
|
-
* so a container header would be transcribed as noise). Strip any WAV header
|
|
1702
|
-
* and pass `sampleRate` from it before calling. Metered by transcribed
|
|
1703
|
-
* duration against the tenant credit pool server-side.
|
|
1704
|
-
*/
|
|
1705
|
-
stt(args: VoiceSttArgs): Promise<VoiceSttResult>;
|
|
1934
|
+
listTeamsChannels(): Promise<{
|
|
1935
|
+
channels: {
|
|
1936
|
+
id: string;
|
|
1937
|
+
name: string;
|
|
1938
|
+
description?: string;
|
|
1939
|
+
}[];
|
|
1940
|
+
}>;
|
|
1941
|
+
}
|
|
1942
|
+
//# sourceMappingURL=teams.d.ts.map
|
|
1943
|
+
|
|
1944
|
+
//#endregion
|
|
1945
|
+
//#region src/index.d.ts
|
|
1946
|
+
interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi {}
|
|
1947
|
+
declare class AgentApiClient extends ApiBase {
|
|
1948
|
+
constructor(config: AgentApiClientConfig);
|
|
1706
1949
|
}
|
|
1707
1950
|
//# sourceMappingURL=index.d.ts.map
|
|
1951
|
+
|
|
1708
1952
|
//#endregion
|
|
1709
1953
|
//#endregion
|
|
1710
1954
|
//#region src/sync-engine.d.ts
|